Skip to content
Snippets Groups Projects
  1. May 15, 2023
  2. Apr 12, 2023
    • Paul Hu's avatar
      Add missed NSD event name · 99fdf930
      Paul Hu authored
      Some events are missed their name in the EVENT_NAMES array and
      shows the number on dumpsys logs. Add their name to the event
      array to show correct info.
      
      Before:
       rec[0]: time=04-12 15:15:23.553 processed=DefaultState org=EnabledState dest=<null> what=21
       rec[1]: time=04-12 15:15:23.555 processed=EnabledState org=EnabledState dest=<null> what=REGISTER_SERVICE
       rec[2]: time=04-12 15:15:24.375 processed=EnabledState org=EnabledState dest=<null> what=DISCOVER_SERVICES
       rec[3]: time=04-12 15:15:25.338 processed=EnabledState org=EnabledState dest=<null> what=23
       rec[4]: time=04-12 15:15:25.342 processed=EnabledState org=EnabledState dest=<null> what=RESOLVE_SERVICE
       rec[5]: time=04-12 15:15:25.344 processed=EnabledState org=EnabledState dest=<null> what=23
       rec[6]: time=04-12 15:15:25.358 processed=EnabledState org=EnabledState dest=<null> what=UNREGISTER_SERVICE
       rec[7]: time=04-12 15:15:25.551 processed=DefaultState org=EnabledState dest=<null> what=22
      
      After:
       rec[0]: time=04-12 15:19:58.955 processed=DefaultState org=EnabledState dest=<null> what=REGISTER_CLIENT
       rec[1]: time=04-12 15:19:58.958 processed=EnabledState org=EnabledState dest=<null> what=REGISTER_SERVICE
       rec[2]: time=04-12 15:19:59.979 processed=EnabledState org=EnabledState dest=<null> what=DISCOVER_SERVICES
       rec[3]: time=04-12 15:20:00.768 processed=EnabledState org=EnabledState dest=<null> what=MDNS_DISCOVERY_MANAGER_EVENT
       rec[4]: time=04-12 15:20:00.777 processed=EnabledState org=EnabledState dest=<null> what=RESOLVE_SERVICE
       rec[5]: time=04-12 15:20:00.778 processed=EnabledState org=EnabledState dest=<null> what=MDNS_DISCOVERY_MANAGER_EVENT
       rec[6]: time=04-12 15:20:00.785 processed=EnabledState org=EnabledState dest=<null> what=UNREGISTER_SERVICE
       rec[7]: time=04-12 15:20:00.925 processed=DefaultState org=EnabledState dest=<null> what=UNREGISTER_CLIENT
      
      Test: adb shell dumpsys servicediscovery
      Bug: 275004614
      Change-Id: I9c05efc2d2993af353a2a902fd8810f53ab2cd16
      99fdf930
  3. Apr 11, 2023
    • Junyu Lai's avatar
      Check MAINLINE_NETWORK_STACK as well to make GTS can access proper stats · e68c42b8
      Junyu Lai authored
      Follow up from aosp/1933093. The test failed because certain
      devices use a flattened apex that lacks the NETWORK_STACK
      permission for sharing with the GTS apk.
      Additionally, the NetworkStatsAccess does not recognize the
      GTS apk, which holds the MAINLINE_NETWORK_STACK permission.
      
      Test: TH
      Bug: 275532605
      Change-Id: Icce80a3d3dbea4a84fbd369d9b5fbe0029ab463e
      e68c42b8
  4. Apr 10, 2023
  5. Apr 07, 2023
    • Chalard Jean's avatar
      Rename throwAboveU to throwAtLeastU · 1bfd3ccf
      Chalard Jean authored
      And address other comments on aosp/2527139
      
      Bug: 273963543
      Test: FrameworksNetTests
      Change-Id: I4328aea2881badc2be667b900b7ac2a296af1678
      1bfd3ccf
    • Chalard Jean's avatar
      Restore the null behavior of buildWifiTemplate · 843cd6ca
      Chalard Jean authored
      The old behavior was to only return those wifis that have
      a null key/subscriber ID (e.g. not carrier wifi). To keep
      backward compatibility, restore that behavior.
      
      Also only crash the old methods on devices with initial
      SDK U, because it can't be mandated that devices that
      upgrade must not call these methods.
      
      Bug: 273963543
      Test: FrameworksNetTests
      Merged-In: Iefb976ed86a732158964fae38e9e601001c2637a
      Change-Id: Iefb976ed86a732158964fae38e9e601001c2637a
      843cd6ca
  6. Apr 06, 2023
    • Chalard Jean's avatar
      Restore the null behavior of buildWifiTemplate · 4c0fb401
      Chalard Jean authored
      The old behavior was to only return those wifis that have
      a null key/subscriber ID (e.g. not carrier wifi). To keep
      backward compatibility, restore that behavior.
      
      Also only crash the old methods on devices with initial
      SDK U, because it can't be mandated that devices that
      upgrade must not call these methods.
      
      Bug: 273963543
      Test: FrameworksNetTests
      Change-Id: Iefb976ed86a732158964fae38e9e601001c2637a
      (cherry picked from commit 78f94fc15035560c279f8e9378561e60a676410a)
      4c0fb401
  7. Mar 30, 2023
    • Junyu Lai's avatar
      Do not crash when passing null into buildTemplateMobileAll · 2c12f922
      Junyu Lai authored
      Test: atest FrameworksNetTests:android.net.connectivity.android.net.NetworkTemplateTest
      Test: atest FrameworksNetTests:android.net.connectivity.android.net.netstats.NetworkTemplateTest
      Bug: 273963543
      Change-Id: I0a8f94df124147e92d35cf474b3d69d1dee6902c
      2c12f922
  8. Mar 24, 2023
  9. Mar 23, 2023
    • Remi NGUYEN VAN's avatar
      Add back @hide NetworkTemplate methods · 37c4a9f2
      Remi NGUYEN VAN authored
      Add back methods that were removed in recent refactoring
      (aosp/2286634).  Even though they are fully @hide, some usage by
      an OEM has been found on T.
      
      Test: atest; the methods should be unused except on the OEM device
      Change-Id: Icd67fb8b7e63cc131356a30a3044458ae2f5efff
      37c4a9f2
  10. Mar 22, 2023
  11. Mar 17, 2023
    • Paul Hu's avatar
      Add a CompatChange flag to enable platform backend · 2e0a88c0
      Paul Hu authored
      Apps targeting sdk < U are considered to use a legacy native
      daemon as NsdManager backend, but other apps use a
      platform-integration mDNS implementation as backend. So add a
      CompatChange flag to enable platform backend for non-legacy
      apps.
      
      Bug: 270306772
      Test: atest FrameworksNetTests CtsNetTestCases
      Change-Id: I7ba58f8a5186fb49ad5f8aeacc8b8234bef1eabe
      2e0a88c0
  12. Mar 15, 2023
    • Anton Hansson's avatar
      Use filegroup defaults for framework sources · 57f3d69f
      Anton Hansson authored
      There's now a shared defaults module for this kind of filegroup. Use
      that and remove the previously duplicated prop.
      
      Bug: 271816210
      Test: m
      Change-Id: Ia4547984a73179fdfc98c427482dd10246f9722c
      57f3d69f
  13. Mar 07, 2023
    • Aaron Huang's avatar
      Remove requireNonNull check from matchesWifiNetworkKey · 8ac11435
      Aaron Huang authored
      matchesWifiNetworkKey expects a non-null value of the
      wifiNetworkKey, however, it might be null in practice
      and the null wifiNetworkKey will be stored into disk.
      And then when the matchesWifiNetworkKey is called, the
      requireNonNull will crash the system. Thus, remove the
      requireNonNull from matchesWifiNetworkKey to avoid
      system crash and handle if the wifiNetworkKey is null
      then it should not match a template with non-empty
      mMatchWifiNetworkKeys.
      
      Check if WifiInfo contains a null network key then skip it
      to prevent adding the identity to the network identity set.
      Also, add a Log.wtf when setWifiNetworkKey(info.getNetworkKey()),
      this might be useful to catch why the wifiNetworkKey is
      null.
      
      Bug: 267815242
      Bug: 266598304
      Test: FrmeworksNetTests
      Change-Id: I9c21f7e3dca9482133c7e331741cf808105414e9
      8ac11435
  14. Mar 06, 2023
    • Cole Faust's avatar
      Compile HalfSheetUX against framework-connectivity-t.impl · 41228921
      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
      41228921
    • Cole Faust's avatar
      Compile HalfSheetUX against framework-connectivity-t.impl · c944f10f
      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
      c944f10f
    • Paul Hu's avatar
      Migrate reigster service callback backend · 30bd70d1
      Paul Hu authored
      registerServiceInfoCallback currently only sends updates for
      addresses added, but does not handle removes (expiration) and
      TXT/SRV record updates. Thus, migrate its backend to
      MdnsDiscoveryManager which can support the expiration update.
      
      Bug: 266030646
      Test: atest FrameworksNetTests CteNetTestCases
      Change-Id: I72add213935dc1beacb6277007868ad30bd89c00
      30bd70d1
  15. Mar 03, 2023
    • Junyu Lai's avatar
      Add constructor which used by Android T CTS · 84b5936e
      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
      84b5936e
    • Aaron Huang's avatar
      Add some hidden APIs back to NetworkTemplate · 960c6267
      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
      960c6267
  16. Mar 01, 2023
    • Junyu Lai's avatar
      Clear calling identity before calling into DPM · 09330c43
      Junyu Lai authored
      Test: 1. manual test with test app
            2. atest CtsNetTestCases:android.net.cts.NetworkStatsManagerTest
      Fix: 249920382
      Fix: 269561252
      Change-Id: I4af7fd640d551be3ef62ea248e58bf8bae5e0b87
      09330c43
  17. Feb 21, 2023
    • Aaron Huang's avatar
      Add isMatchRuleMobile back · dc979057
      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
      dc979057
    • Aaron Huang's avatar
      Fix backward compatibility issue for removed wildcard match rule · 69086d6c
      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
      69086d6c
  18. Feb 14, 2023
  19. Feb 12, 2023
  20. Feb 10, 2023
    • Aaron Huang's avatar
      Tempates with different subscriber ID should be not equal · c9371d05
      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
      c9371d05
  21. Feb 09, 2023
    • Yuyang Huang's avatar
      Moves all compatibility flags to ConnectivityCompatChanges.java · 90a2cbdd
      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
      90a2cbdd
  22. Feb 03, 2023
    • Xinyi Zhou's avatar
      [API] Add more error codes · 5f5f292c
      Xinyi Zhou authored
      go/presence_api_u
      
      Test: -m
      Ignore-AOSP-First: nearby_not_in_aosp_yet
      Fix: 265353983
      Change-Id: I0c1fd8ff72c0f52189330a471b5ff5865a3446b4
      5f5f292c
  23. Feb 01, 2023
    • Xinyi Zhou's avatar
      [API] Add offloadOnly API · 8fe45419
      Xinyi Zhou authored
      go/presence_api_u
      
      Test: -m
      Ignore-AOSP-First: nearby_not_in_aosp_yet
      Bug: 265353983
      Change-Id: Ib423285439ec62949ae59487081164b44f1580a6
      8fe45419
    • Xinyi Zhou's avatar
      [API] Upadate queryOffloadCapability API · e73c76f9
      Xinyi Zhou authored
      go/presence_api_u
      
      Test: -m
      Ignore-AOSP-First: nearby_not_in_aosp_yet
      Bug: 265353983
      Change-Id: Ic7e95cf0f65c3eb60d8b08d402ac56783821bac1
      e73c76f9
  24. Jan 30, 2023
    • Paul Hu's avatar
      Rename onResolveStopped to onResolutionStopped · b2c0f340
      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
      b2c0f340
  25. Jan 19, 2023
    • Paul Hu's avatar
      New API to listen service update · 18aecccc
      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
      18aecccc
  26. Jan 18, 2023
    • Paul Hu's avatar
      New API to stop service resolution · b58deb70
      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
      b58deb70
  27. Jan 17, 2023
    • Paul Hu's avatar
      Implement service resolved callback · 75069ed4
      Paul Hu authored
      Service resolved should be notified when receive the
      onServiceFound callbacks from MdnsServiceBrowserListener
      
      Bug: 254166302
      Test: atest FrameworksNetTests CtsNetTestCases
      Change-Id: I681720065084bf3449c5b1ab44cd4ed6a659dcdb
      75069ed4
    • Paul Hu's avatar
      Implement service found callback · 019621e0
      Paul Hu authored
      Service found should be notified when receives the
      onServiceNameDiscovered callbacks from
      MdnsServiceBrowserListener.
      
      Bug: 254166302
      Test: atest FrameworksNetTests CtsNetTestCases
      Change-Id: I3f41b4fe85cd85ad356fa764663187a88914412c
      019621e0
    • Paul Hu's avatar
      Use MdnsDiscoveryManager for discovery · 23fa2024
      Paul Hu authored
      Register/Unregister the listener to/from MdnsDiscoveryManager
      when discovery started/stopped.
      
      Bug: 254166302
      Test: atest FrameworksNetTests CtsNetTestsCases
      Change-Id: Ibd782029826ac5856c608165928cd942e46dd9a4
      23fa2024
  28. Jan 13, 2023
    • Xinyi Zhou's avatar
      [API] Add Offload Callback API · b90b2015
      Xinyi Zhou authored
      go/presence_api_u
      
      Test: -m
      Ignore-AOSP-First: nearby_not_in_aosp_yet
      Bug: 265353983
      Change-Id: Ie00a1bd5bcdf42d7b4678a3ffbaf18ebfbe735e6
      b90b2015
  29. Jan 11, 2023
    • Xinyi Zhou's avatar
      [API] Add onError API · 9afce39c
      Xinyi Zhou authored
      go/presence_api_u
      
      Test: Unit test
      Ignore-AOSP-First: nearby_not_in_aosp_yet
      Fix: 263907284
      Change-Id: I87df0b4592b32f241eb7d22405357bc039766cb8
      9afce39c
  30. Jan 10, 2023
    • Yan Yan's avatar
      Expose APIs to migrate IpSecTransform · 81c2160a
      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
      81c2160a
  31. Jan 07, 2023
    • Maciej Żenczykowski's avatar
      fix argument to CloseGuard.open() · 40112289
      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: default avatarMaciej Żenczykowski <maze@google.com>
      Change-Id: I25f005a7944bf3995ae6dc4c021ed1034f2187dd
      40112289
Loading