- Mar 06, 2023
-
-
Cole Faust authored
HalfSheetUX uses private apis of framework-connectivity-t. It appears that using just "framework-connectivity-t" will compile against either the stubs or source of framework-connectivity-t depending on if the module was included in the same apex as it or not. aosp/2462194 is adding the ability to compile modules like HalfSheetUX outside of the context of the apex, at which point it will start compiling against stubs if we don't explicetly specify to use the implementation library. Bug: 254205429 Test: m javac-check with aosp/2462194 Change-Id: I1d41e47aa0e4e3d320b78b28cfc181fc30c4537c Merged-In: I1d41e47aa0e4e3d320b78b28cfc181fc30c4537c
-
- Mar 03, 2023
-
-
Junyu Lai authored
aosp/2241257 and aosp/2241058 are included in the mainline train release and it causes the T device can’t pass CTS-13_R2/CTS-13_R3. It’s because some parameters of the constructor have been removed. Add it back to keep backward compatibility. Test: 1. atest CtsNetTestCases:android.net.netstats.NetworkTemplateTest 2. CTS-13_R3 Fix: 269974916 Fix: 269834366 Change-Id: I197fbfb8419e4d4885a97a93a71f13d33c3f02da
-
Aaron Huang authored
Since there's a bug about apps still call hidden APIs, it's likely some developers might build apps against hidden API. To be safe, add these methods back to avoid apps crash. These methods are still in hiddenapi-max-target-o-low-priority.txt, so they should not be removed without considering hidden API usage. Removing hidden API in general isn't forbidden, but the ones listed in hiddenapi usage need extra care. Bug: 269178029 Test: 1. atest CtsNetTestCases:android.net.netstats.NetworkTemplateTest 2. CTS-13_R3 Change-Id: I485369274ccacd314230e3d267df665d8083bf97
-
- Mar 01, 2023
-
-
Junyu Lai authored
Test: 1. manual test with test app 2. atest CtsNetTestCases:android.net.cts.NetworkStatsManagerTest Fix: 249920382 Fix: 269561252 Change-Id: I4af7fd640d551be3ef62ea248e58bf8bae5e0b87
-
- Feb 21, 2023
-
-
Aaron Huang authored
There's a user still call this method which causes the app crash and it might be the app was built against hidden API. The bug was observed after updating the mainline module so adding this method back to the module to avoid apps crash due to the method is not found in NetworkTemplate. Bug: 269178029 Test: build Change-Id: I06dc694b1ce060488135f5d34138f14abd50ad32
-
Aaron Huang authored
A template with type MATCH_MOBILE could have empty subscriber IDs but it should not contain one of subscriber IDs is null. An app might still build a template through the constructor which is annotated with @UnsupportedAppUsage. NetworkTemplate will throw an exception when the app trying to construct a template with type *_WILDCARD. The constructor should be backward compatible with old version so this change is to add the backward compatibility to have NetworkTemplate not throw an exception. Bug: 267701889 Test: FrameworksNetTests Change-Id: I23a607dae508e0c53520e2edf187cb611ed36b68
-
- Feb 10, 2023
-
-
Aaron Huang authored
mSubscriberId was removed from NetworkTemplate and equals/hashCode does not check the mMatchSubscriberIds. This will cause tempates with different subscriber ID matching that are equal now. Thus adding the check for mMatchSubscriberIds to fix it. Bug: 267968247 Test: FrameworksNetTests:NetworkTemplateTest Change-Id: I2956bf4c8cf2c4d73ebe102d53e755fbcc5d7642
-
- Feb 09, 2023
-
-
Yuyang Huang authored
ConnectivityCompatChanges.java becomes the centralized place for all the CompatChanges used in the Connectivity module. By putting all the CompatChanges here, we are able to manage them under a single platform_compat_config. Bug: 268440216 Test: atest FrameworksNetTests Change-Id: I3e17af545718073d7d1c96e27298e7790563fd33
-
- Jan 30, 2023
-
-
Paul Hu authored
Rename the method onResolveStopped(NsdServiceInfo) to onResolutionStopped(NsdServiceInfo) for consistency as API review feedback. Bug: 266811051 Test: atest FrameworksNetTests CtsNetTestCases Change-Id: I788b5903ecaf78a9aa960dd3b7413a22f171c72f
-
- Jan 19, 2023
-
-
Paul Hu authored
Currently, the resolution is a one shot query, it only notifies the first finding service information. There is no way to listen the service update. Thus, add a new API that can register a callback to listen to the service updates continuously. Bug: 245369943 Test: atest FrameworksNetTests CtsNetTestCases Change-Id: I0e9d92b9028375feb3e344ab6c4acb515c5b2be9
-
- Jan 18, 2023
-
-
Paul Hu authored
Resolve service may take long time due to network issue or using wrong service information, but users are not able to stop it. They can only wait for the callback of resolveService to end, which sometimes takes a long time. Thus, add the new API that users can stop the service resolution. Bug: 245369943 Test: atest FrameworksNetTests CtsNetTestCases Change-Id: I6b6183c8c73f8db981b9afa51fbc73bf886d9ed3
-
- Jan 17, 2023
-
-
Paul Hu authored
Service resolved should be notified when receive the onServiceFound callbacks from MdnsServiceBrowserListener Bug: 254166302 Test: atest FrameworksNetTests CtsNetTestCases Change-Id: I681720065084bf3449c5b1ab44cd4ed6a659dcdb
-
Paul Hu authored
Service found should be notified when receives the onServiceNameDiscovered callbacks from MdnsServiceBrowserListener. Bug: 254166302 Test: atest FrameworksNetTests CtsNetTestCases Change-Id: I3f41b4fe85cd85ad356fa764663187a88914412c
-
Paul Hu authored
Register/Unregister the listener to/from MdnsDiscoveryManager when discovery started/stopped. Bug: 254166302 Test: atest FrameworksNetTests CtsNetTestsCases Change-Id: Ibd782029826ac5856c608165928cd942e46dd9a4
-
- Jan 10, 2023
-
-
Yan Yan authored
This commit exposes APIs to migrate a tunnel mode transform to new source/destination addresses, as required by MOBIKE. By calling the exposed API, the caller only caches the new address in the transform. To complete the migration, caller MUST apply the tranform to the appropriate tunnel. This API design is mainly based on the kernel interface and use cases. The Linux kernel requires Android to provide both the IpSecTransform and the IpSecTunnelInterface to perform the migration. And in most cases those two instances are managed by different entities: IpSecTranform is managed by the key exchange protocol (e.g. IKE) and IpSecTunnelInterface is managed by the security tunnel provider (e.g. VPN, VCN, and IWLAN). Thus the migration process has been designed to have two steps where the key exchange protocol negotiates and caches the new address, passes out the updated transform, and the security tunnel provider applies the transform to a tunnel. Another benefit of this API is it can also apply to the case where the network peer does not support MOBIKE and thus cannot update the existing transforms. In this case, the key exchange protocol can create a new transform and give it to the security tunnel provider, and the tunnel provider can still call "apply" to perform migration without needing to know the details of the transform update process. Bug: 169171001 Test: atest FrameworksNetTests, IpSecManagerTunnelTest Change-Id: I0658cdb09fb31f7e0fb9d0b07f37c2b72b6e705f
-
- Jan 07, 2023
-
-
Maciej Żenczykowski authored
Based on documentation, String parameter to CloseGuard.open() should be the name of the method to close the resource (in this case Resource.close()). As currently written, the debug output from warnIfOpen() will be "Resource failed to call constructor." Bug: 131838407 Test: TreeHugger Signed-off-by:
Maciej Żenczykowski <maze@google.com> Change-Id: I25f005a7944bf3995ae6dc4c021ed1034f2187dd
-
Maciej Żenczykowski authored
Based on documentation, String parameter to CloseGuard.open() should be the name of the method to close the resource (in this case Resource.close()). As currently written, the debug output from warnIfOpen() will be "Resource failed to call constructor." Bug: 131838407 Test: TreeHugger Signed-off-by:
Maciej Żenczykowski <maze@google.com> Change-Id: I9b8a71f9076712014bb883bbde5e5fbdb018b2d5
-
- Dec 28, 2022
-
-
Aaron Huang authored
NetworkTemplate was moved into mainline module and provide Builder for external users to build template. MATCH_MOBILE_WILDCARD and MATCH_WIFI_WILDCARD are not exposed so currently the usage of these two constants only in module. This change is to remove the constants. After removing the constants, two methods matchesWifi and matchesMobile are changed to adapt the original matches[Wifi|Mobile]Wildcard behavior. Bug: 238843364 Test: FrameworksNetTests Change-Id: I9e156b504ce4eb903b39279e443fad27bc921186
-
Aaron Huang authored
Currently NetworkTemplate provides Builder for users to build a template and it supports multiple subscriber ids. The mSubscriberId is a local variable in current design so it can be removed from NetworkTemplate and also can be removed from the parameter of a constructor as long as the constructor is not annotated with @UnsupportedAppUsage. Bug: 238843364 Test: build, FrameworksNetTests CtsNetTestCases Change-Id: Ic6a695e1c1719111bf26ba905a38673952a24736
-
Aaron Huang authored
Currently, mSubscriberIdMatchRule is only used in NetworkTemplate and it depends on if mMatchSubscriberIds is empty or not. Thus, remove it since is not really necessary and replace it with checking matchSubscriberIds if needed. Bug: 238843364 Test: build, FrameworksNetTests CtsNetTestCases Change-Id: Ic66d2ff2826846778b004bb15a4718a62fa1f470
-
- Dec 21, 2022
-
-
Yan Yan authored
Bug: 169169973 Test: atest IpSecServiceParameterizedTest (new tests added) Change-Id: I3dd45b29163cd1e0cdbef08cb8aabdb629cf73bc
-
Yan Yan authored
This commit adds methods to support migrating tunnel mode IpSecTransform to new source/destination addresses. Bug: 169171001 Test: atest FrameworksNetTests (new tests added) Change-Id: Ic177015fba5b62d3f73009633118109d3631086f
-
- Dec 02, 2022
-
-
Aaron Huang authored
Currently, NET_CAPABILITY_TEMPORARILY_NOT_METERED traffic is counted as unmetered data usage, and "mobile data usage" settings screen shows metered data usage which means it doesn't include TEMPORARILY_NOT_METERED traffic. However, some carriers show TEMPORARILY_NOT_METERED data usage in customer's bill which would be confusing if the data usage in the device shows different results. Thus, revert the change to avoid confusing. Bug: 183776809 Test: FrameworksNetTests Change-Id: I4ef25095462adf30b1ecf82134996739f167930d
-
- Nov 30, 2022
-
-
Aaron Huang authored
In current design, mMatchSubscriberIds can be null which has the same meaning with empty set, and is not easy to maintain since it need more checks for this variable when mSubscriberId is null. Thus make mMatchSubscriberIds NonNull for the maintenance. Bug: 238843364 Test: build, FrameworksNetTests Change-Id: I6cfc529b5f4a39ded8598283ff968f2f4d1bc89f
-
Aaron Huang authored
NetworkTemplate.Builder was introduced in Android T and the callers outside of Connectivity module should use this Builder to build a template instead. Thus remove the buildTemplate* methods from NetworkTemplate class. Also, deprecate the methods which are annotated with @UnsupportedAppUsage and also use Builder to build the template. Bug: 238843364 Test: build, FrameworksNetTests Change-Id: I3190325f6663e4771edf5c7a19bf5ecc7780bf12
-
- Nov 09, 2022
-
-
Maciej Żenczykowski authored
Bug: 254143771 Test: TreeHugger Signed-off-by:
Maciej Żenczykowski <maze@google.com> Change-Id: I9f91fc250e0fa40c9dc9ee3e7a2f7bc3cf2ebc75
-
- Nov 02, 2022
-
-
Cole Faust authored
This commit is part of a large scale change to fix errorprone errors that have been downgraded to warnings in the android source tree, so that they can be promoted to errors again. The full list of changes include the following, but not all will be present in any one individual commit: BadAnnotationImplementation BadShiftAmount BanJNDI BoxedPrimitiveEquality ComparableType ComplexBooleanConstant CollectionToArraySafeParameter ConditionalExpressionNumericPromotion DangerousLiteralNull DoubleBraceInitialization DurationFrom DurationTemporalUnit EmptyTopLevelDeclaration EqualsNull EqualsReference FormatString FromTemporalAccessor GetClassOnAnnotation GetClassOnClass HashtableContains IdentityBinaryExpression IdentityHashMapBoxing InstantTemporalUnit InvalidTimeZoneID InvalidZoneId IsInstanceIncompatibleType JUnitParameterMethodNotFound LockOnBoxedPrimitive MathRoundIntLong MislabeledAndroidString MisusedDayOfYear MissingSuperCall MisusedWeekYear ModifyingCollectionWithItself NoCanIgnoreReturnValueOnClasses NonRuntimeAnnotation NullableOnContainingClass NullTernary OverridesJavaxInjectableMethod ParcelableCreator PeriodFrom PreconditionsInvalidPlaceholder ProtoBuilderReturnValueIgnored ProtoFieldNullComparison RandomModInteger RectIntersectReturnValueIgnored ReturnValueIgnored SelfAssignment SelfComparison SelfEquals SizeGreaterThanOrEqualsZero StringBuilderInitWithChar TreeToString TryFailThrowable UnnecessaryCheckNotNull UnusedCollectionModifiedInPlace XorPower See https://errorprone.info/bugpatterns for more information on the checks. Bug: 253827323 Test: m RUN_ERROR_PRONE=true javac-check Change-Id: I7625fa386afe93823b97cb2ecb8fd09a5856c05b
-
- Oct 12, 2022
-
-
Chalard Jean authored
Test: BitUtilsTest Change-Id: I3e100c6087f61c2a13aa8558ee8f9a9ad480c681
-
- Sep 13, 2022
-
-
Paul Duffin authored
Previously, the hiddenapi*-tiramisu.txt files that were created as part of the work for creating framework-connecvity-t were just added to the list of hidden API files on the bootclasspath_fragment. Unfortunately, that made it impossible to exclude those when generating an sdk snapshot for S which cannot include framework-connectivity-t. This change moves those files to be part of framework-connectivity-t instead of the bcpf so that they will only be used in an sdk snapshot when the library is part of the snapshot. Bug: 240406019 Test: packages/modules/common/build/mainline_modules_sdks.sh # Ran the previous command with and without this change to make # sure that this change does not change the sdk snapshot # contents. A follow up change will exclude the # framework-connectivity-t library from the S sdk snapshot. Change-Id: Ib5c5c6046d96b911c8e9e5ac3729ce963f1b6907
-
- Aug 29, 2022
-
-
Junyu Lai authored
Currently, data usage of all test networks are all attributed to the same NetworkIdentity, which does not allow services to distinguish upload & download traffic of different test networks. Thus, this CL put specifier that comes along with TestNetworkAgent into wifiNetworkKey field to build different NetworkIdentity to attribute data usage to different for individual networks. And allow querying test network usage with wifiNetworkKeys. Bug: 139774492 Test: atest FrameworksNetTests atest android.net.cts.ConnectivityManagerTest Change-Id: I1bb38fd20781eaf3105735440a04b27bef36fcae
-
- Aug 03, 2022
-
-
Remi NGUYEN VAN authored
Do not use framework-connectivity stubs for framework-connectivity-t-pre-jarjar, as that library can build against the full framework-connectivity implementation including hidden symbols: it already builds against framework-connectivity-pre-jarjar. The stubs are only necessary to build framework-connectivity-t stubs, to avoid circular dependencies between these and the framework-connectivity implementation. This change allows using hidden symbols of framework-connectivity in framework-connectivity-t-pre-jarjar, but does not fully fix the problem as framework-connectivity-t will use the framework-connectivity stubs both to build its own stubs and to build its implementation library, due to "libs" being used in both cases (and prioritized over impl_only_libs). As a result, it is still not possible to build framework-connectivity-t when it references hidden symbols of classes that are also part of the stubs. Still, this is a first step and organizes the build rules closer to what they should be. Bug: 139774492 Test: m Change-Id: I5e696fa6a7871d048e0ba16442de33b5f139faae
-
- Aug 02, 2022
-
-
Aaron Huang authored
Have all callers to use the same constructor and remove the unused constructors. Bug: 238843364 Test: FrameworksNetTests Change-Id: Ieb1d0bc4ff8d2238c7a802189f8d91f4a9978eb8
-
- Jul 27, 2022
-
-
Remi NGUYEN VAN authored
Add back compat config for RUN_NATIVE_NSD_ONLY_IF_LEGACY_APPS, which was lost when moving NsdManager to framework-connectivity-t. This causes NsdManager to start mdnsresponder again when used by apps with target SDK < 31. The change also changes the compat ID used, to make sure it does not conflict with the ID already in use in S and below, when the module is installed on such a platform. This is the only ChangeId used by framework-t. Also add a CtsNetTestCasesMaxTargetSdk30 test to verify that behavior. Bug: 235355681 Test: atest CtsNetTestCasesMaxTargetSdk30 Change-Id: I7ca6051d0a4ba5aff3e44bece2cbac22eb1be32d
-
- Jul 25, 2022
-
-
Remi NGUYEN VAN authored
R8 emits "missing class" warnings when optimizing service-connectivity because service-connectivity combines several already built static_libs (service-connectivity, service-connectivity-t, service-nearby), but does not specify any classpath library, which are actually needed for R8. This causes wrong optimizations, where R8 would sometimes strip out code that it thinks is unused (because it considers it unreachable due to the missing class, or it does not know the superclass of a callback and thinks the overridden methods cannot be called). Add the necessary classpath libraries to remove the warnings. Bug: 226127213 Bug: 239990030 Test: m service-connectivity, see no "Missing class" warnings Change-Id: I1eaa39b70da4b540e3a3e8e798bec1359b5bf533
-
Aaron Huang authored
Use new Builder API which was introduced in Android T. Bug: 238843364 Test: FrameworksNetTests dumpsys netstats --checkin and check the output Change-Id: Ieb0a2ee04056a1cedb71274ea710ff5153e2d68c
-
- Jul 20, 2022
-
-
Remi NGUYEN VAN authored
Just include all files with a blob, instead of listing them separately. All files in the directory were previously referenced by framework-connectivity-tiramisu-updatable-sources, so this is a no-op. Bug: 217129444 Test: m Change-Id: I83415b8f2a5836874c5ea2bffee45c43e03cc139
-
Remi NGUYEN VAN authored
(This rolls forward part of a previous change, now that jarjar was fixed to not get very slow when the number of rules increases). Autogenerate connectivity jarjar rules at build time, to avoid issues with forgotten jarjar rules or hard-to-diagnose errors introduced by incorrect rules. This change causes all classes in framework-connectivity(-t) and service-connectivity to be jarjared into android.net.connectivity, but still avoids jarjaring classes in com.android.server as before, to keep it small. For many classes this differs from the original jarjar rule. Notes on implementation: - connectivity-jarjar-rules now has a subset framework-connectivity-jarjar-rules containing only the rules necessary for framework-connectivity. This is necessary because framework-connectivity cannot depend on rules generated based on service-connectivity, as there would be a dependency cycle (service-connectivity depends on framework-connectivity); Soong even crashes with a stack overflow. - framework-wifi.stubs.module_lib is added to framework-connectivity-pre-jarjar as it is necessary to build it (it is already in impl_only_libs in the defaults). It is unclear why framework-connectivity-pre-jarjar could build before that (possibly because it was only used as "lib" ?) - Fix package-private visibility; for example NattSocketKeepalive, TcpSocketKeepalive are not API so should be jarjared, but are used by ConnectivityManager which is not jarjared, so they are not in the same package after the change. Package-private members in the former 2 need to be public to be accessible. Changes in this commit are all that is needed, as demonstrated by followup commits that move the classes to a different package without further changes, and that enforce that no class in an API package gets jarjared. - framework-connectivity-internal-test-defaults is separated from framework-connectivity-test-defaults, for unit tests that need to access internal jarjared classes. Such tests need to use the jarjar rules themselves too, so this is only appropriate for connectivity internal unit tests. Test: atest ConnectivityCoverageTests CtsNetTestCases Bug: 217129444 Change-Id: Ib1bd939b71c0171d945fc01b96195d2f620ff13b
-
Aaron Huang authored
Test: build Change-Id: I4366480e7a71004612d775bfa54744cc74c1fd7b
-
- Jul 18, 2022
-
-
Aaron Huang authored
Use Builder API which was provided in Android T to build a template. Bug: 238843364 Test: build, FrameworksNetTests:NetworkStatsManagerTest Change-Id: Ibf1ac16541d6f3ddaf9b241e2f47ae04acbedf93
-
- Jul 15, 2022
-
-
chiachangwang authored
"{@see" aren't rendered properly. Replace them with "See {@link" or @see depending on the usage. Bug: 238753273 Test: make doc-comment-check-docs ; Check the doc result Change-Id: I70cb2f36e7c5fa8102b5949054df5184d755202c
-