summaryrefslogtreecommitdiff
path: root/apishim/common/com/android
AgeCommit message (Collapse)Author
2020-07-03Injecting network validation stats into statsdFrank Li
1. Fill in each field of the NetworkValidationReported 2. Write the NetworkValidationReported into statsd This patch also refactors tryCapportApiProbe to return null when the capport data is incorrect, instead of doing the check after calling the method. This makes it easier to compile capport API probe metrics. Test: atest NetworkStackIntegrationTests NetworkStackTests Test: atest FrameworksNetTests Test: Manual test with statsd_testdrive Bug: 151796056 Original-Change: https://android-review.googlesource.com/1295496 Merged-In: Icf34402d6a293cc76c32d00835cbf358c99a87fa Change-Id: Icf34402d6a293cc76c32d00835cbf358c99a87fa
2020-05-15Move common apishim classes to apishim.common pkgRemi NGUYEN VAN
This provides a better separation of the classes based on their role (an actual shim, or an interface or utility common to all shims), and forces the apishim package to import the common classes, which makes it easier at SDK bump time since the imports do not need to be added at that point. Bug: 143586229 Test: atest NetworkStackTests Original-Change: https://android-review.googlesource.com/1310517 Merged-In: Ie77c17a96a67016f35890afa065bea0a07b09504 Change-Id: Ie77c17a96a67016f35890afa065bea0a07b09504
2020-04-27Add a ShimUtils.isAtLeastR() and use it in tests.Treehugger Robot
Bug: 152723363 Test: atest NetworkStackTests NetworkStackIntegrationTests Test: atest NetworkStackNextTests NetworkStackNextIntegrationTests Original-Change: http://aosp/1295494 Merged-In: I88c33a48a627008f5ad7f880bd09c568866b1c5b Change-Id: I88c33a48a627008f5ad7f880bd09c568866b1c5b
2020-04-15Add shims to get and set the NAT64 prefix in LinkProperties.Treehugger Robot
Bug: 153694684 Test: m NetworkStack NetworkStackNext Merged-In: I934fed7a0a8921d3dce7584b5f1b74a0ad67f14a Change-Id: I934fed7a0a8921d3dce7584b5f1b74a0ad67f14a
2020-03-18Move sensitive field parceling bool to constructorAutomerger Merge Worker
This addresses API review comments recommending to use a copy constructor with additional parameters instead of a dedicated method. makeSensitiveFieldsParcelingCopy becomes LinkProperties(base, true). Bug: 150877475 Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests Merged-In: I588a40cd32667aba8e11c663833621b1c441a87a (cherry picked from commit a148ea2ac623cc85f23155bfdb35609756d6bdbc) Change-Id: Ibe7c94627c2a6af45b129020808b752207ff82b6
2020-03-16Merge "Address aosp/1199568 leftover comments" into rvc-devPaul Hu
2020-03-11Make IpClient populate the DHCP server address in LinkPropertiesAutomerger Merge Worker
Bug: 134098566 Test: lunch arm_aosp-userdebug make -j32 Change-Id: Ide9610f9b17992eef83e1c42ac71b1b79c179f44 Merged-In: If86a6303671b03bb2ccf98de7e9d77020b013d2f (cherry picked from commit 10d243214ae933d063affdd2b4f6c1f837279586)
2020-03-10Address aosp/1199568 leftover commentsAutomerger Merge Worker
Bug: 139269711 Test: atest NetworkStackTests NetworkStackNextTests Change-Id: I6e4f16e70b290ce6a3566b92e5946c65075971a1 Merged-In: I6e4f16e70b290ce6a3566b92e5946c65075971a1 (cherry picked from aosp/1240746)
2020-02-20Merge "Show notifications after capport login"Chalard Jean
2020-02-19Show notifications after capport loginRemi NGUYEN VAN
Add NetworkStackNotifier to manage notifications created by NetworkStack. NetworkStackNotifier handles the "connected" notifications shown after connecting to a captive portal, which may contain information sourced from the captive portal API. Test: atest NetworkStackTests Bug: 139269711 Change-Id: Iaf96f7e5f02be04b098230316595ad4c0777a9d8
2020-02-18Send the capport fields to the system server.Chalard Jean
The fields are behind a protection method to avoid inadvertently sending private data to apps. This is going to the system server which needs those fields. Test: NetworkStackTests Change-Id: I7c9a7a82efa364835164622d2e93977e0bcd3d8c
2020-02-14Add shims for network info classesRemi NGUYEN VAN
Combine shims for LinkProperties and NetworkCapabilities to avoid too many shim classes, and use static methods as the original types (and not the shims) would generally be used to reference the classes. CaptivePortalData is not available in API29 so CaptivePortalDataShim is used as a wrapper that can hold a reference to it in common code. Sample usage in NetworkMonitor: final CaptivePortalDataShim data; try { data = CaptivePortalDataShimImpl.fromJSON(obj); } catch (UnsupportedApiLevelException | JSONException e) { // Do some fallback return; } // Just to give an idea if (data.isCaptive()) { openCaptivePortalApp(data.getUserPortalUrl()); } data.notifyChanged(mCallbacks); Test: atest NetworkStackTests NetworkStackNextTests Bug: 139269711 Change-Id: I262aaa41013ebe1ec4263a6516bd8cab76509304
2019-12-18Revise doc for NetworkShimChiachang Wang
Bug: 130325409 Test: atest NetworkStackTests NetworkStackNextTests Test: m doc-comment-check-docs Change-Id: Ie1813a1304533349bbd27fada94a9aeb223f09e0
2019-12-18Add NetworkShimChiachang Wang
NetId is exposed as system API after API 29. NetworkStack will need netId to get the fwmark information from netd. Because NetworkStack will need at least two different build to support the API usage. Thus, create NetworkShim to support design compatible. Bug: 130325409 Test: atest NetworkStackTests NetworkStackNextTests Change-Id: I1b8fa69b4c0fece95a81e4aa43ef84dc68852237
2019-10-28Compile NetworkStackApiStable as system_29Remi NGUYEN VAN
Also slightly change the structure of shims so that the compat version uses a different package (com.android.networkstack.apishim.api29), which is jarjared to the main package name on API stable builds. On API current builds, the shim falls back to the compat version if Build.VERSION is older, or uses the main package otherwise. Jarjar requires using a java_library instead of a filegroup, so the shims build targets are converted to java_libraries. This allows the API current build to be usable on older devices, since it will automatically fall back to the compat APIs. When the new SDK is finalized, the API current build can then be shipped without code modification. The code also looks better in IDEs as there are no package conflicts. If there are several versions of the same shim depending on the API level (so different implementations for different methods in SocketUtilsShimImpl depending on the API level), having the shim extend the previous version shim allows to add methods with compatibility behavior without re-implementing the whole class. Test: m NetworkStack NetworkStackApiStable Test: flashed, WiFi working Test: atest NetworkStackTests Change-Id: I86f28912b80b8396d6b9b2acd2e247651ba80289