Skip to content
Snippets Groups Projects
  1. Oct 23, 2023
    • Hansen Kurli's avatar
      Add tests for always on lockdown VPN on system user. · a09c6f29
      Hansen Kurli authored
      Add test coverage for Vpn.setAlwaysOnPackage() where the caller
      is system user to ensure uid = 0 is not restricted.
      
      Bug: 230548427
      Test: atest FrameworksNetTests
      Change-Id: Id9f81fdf0147597f64f8440b971930b3bd7b55e5
      a09c6f29
    • Hansen Kurli's avatar
      Remove MockVpn.setAlwaysOnPackage() non-lockdown. · 9ae16e4e
      Hansen Kurli authored
      Remove calls to MockVpn.setAlwaysOnPackage() where lockdown is
      false as this does not cause any changes to occur. Also verify
      setRequireVpnForUids() is not called for this case in VpnTest.
      
      Bug: 230548427
      Test: atest FrameworksNetTests
      Change-Id: I3428e8b31b02975975be9e943e1f88cf0e80c5ee
      9ae16e4e
    • Hansen Kurli's avatar
      Mock onUserAdded() and onUserRemoved() · cd040621
      Hansen Kurli authored
      Replace calls to onUserAdded() and onUserRemoved() to their
      equivalent setUids() or setRequireVpnForUids() calls.
      
      Note coverage for the calls to Vpn were added in VpnTest.
      
      Bug: 230548427
      Test: atest FrameworksNetTests
      Change-Id: Ifa895f71f78bd3376216fd2759c7a5a33cd3aff1
      cd040621
    • Hansen Kurli's avatar
      Refactor helper method to return integer ranges. · 946cafb8
      Hansen Kurli authored
      Calls to setRequireVpnForUids() for Vpn lockdown actually uses a
      List instead of a Set of integer ranges.
      Add intRangesExcludingUids() to return the needed List of integer
      ranges and replace relevant usages of UidRange.toIntRanges() with
      it.
      
      Bug: 230548427
      Test: atest FrameworksNetTests
      Change-Id: I61cd4751ce2faeb129daa5ad5da7181e3c1df73c
      946cafb8
  2. Oct 16, 2023
    • Hansen Kurli's avatar
      Add tests for onUserAdded and onUserRemoved · a0cca025
      Hansen Kurli authored
      Test coverage of adding and removing a restricted user with and
      without lockdown mode, using either setLockdown() and
      setAlwaysOnPackage().
      
      This change also refactors makeVpnUidRange() to return a list
      and adds makeVpnUidRangeSet().
      
      Bug: 230548427
      Test: atest FrameworksNetTests
      Change-Id: I47a25e9f0337f5c1d5754c279534640cd2753b5c
      a0cca025
  3. Oct 13, 2023
    • Hansen Kurli's avatar
      Mock Vpn.setUnderlyingNetworks() · 233ac946
      Hansen Kurli authored
      Override Vpn.setUnderlyingNetworks() to do a direct call on the
      network agent instead of relying on the Vpn class.
      
      Bug: 230548427
      Test: atest FrameworksNetTests
      Change-Id: Ib7883f8a81a22317616cae79ce57a30afdd2bed4
      233ac946
    • Hansen Kurli's avatar
      Mock Vpn.setLockdown() · 39654c33
      Hansen Kurli authored
      Call setRequireVpnForUids directly to enable lockdown instead of
      calling the real Vpn method.
      
      Bug: 230548427
      Test: atest FrameworksNetTests
      Change-Id: I91ec59f7542d145e9250a7e7a414593db3d99424
      39654c33
  4. Oct 12, 2023
    • Hansen Kurli's avatar
      Ensure nri is satisfied before returning. · ed972a6f
      Hansen Kurli authored
      When a network preference is set, the highest priority nri will
      be a managed default request that disallows default networking.
      In the case where there is no satisfying network,
      mNoServiceNetwork is used as the satisfier instead of null.
      (see computeNetworkReassignment)
      
      mNoServiceNetwork should not be returned in any public API.
      Check for the nri being satisfied before returning the satisfier
      to ensure mNoServiceNetwork is not returned.
      
      Fixes: 301222648
      Test: atest FrameworksNetTests
      Change-Id: I22d67a7e8d0274d8ad4f6123fbedf6d37eed18e7
      ed972a6f
    • Hansen Kurli's avatar
      Add testLockdownVpn that mocks platform VPN. · 48c14686
      Hansen Kurli authored
      Add a test for lockdown vpn that uses TYPE_IKEV2_IPSEC_PSK and
      mocks platform VPN by override in startLegacyVpnPrivileged().
      In the context of ConnectivityService, setVpnDefaultForUids()
      is the main interaction.
      
      Refactor testLegacyLockdownVpn to take a VpnProfile and assert
      behaviors with and without setVpnDefaultForUids().
      This includes:
          1. Updating callback asserts and assertActiveNetworkInfo to
             reflect setVpnDefaultForUids().
          2. Adding TODOs where mCm.getActiveNetworkInfo() returns
             unexpected values.
      
      Bug: 230548427
      Test: atest FrameworksNetTests
      Change-Id: Ida4a4bc745af5ba2fc251795b2ffca56ead79b7f
      48c14686
  5. Oct 04, 2023
    • Hansen Kurli's avatar
      Make variables in testLegacyLockdownVpn() final. · 78b06ebe
      Hansen Kurli authored
      Test: atest FrameworksNetTests
      Change-Id: Ie852286275f0e377be582648f7766c077d9877e8
      78b06ebe
    • Hansen Kurli's avatar
      Update testLegacyLockdownVpn to mock VPN. · b2764be9
      Hansen Kurli authored
      Override more VPN methods to mock the VPN interaction of
      testLegacyLockdownVpn instead of relying on the Vpn class.
      This includes:
          1. Overriding startLegacyVpnPrivileged() and avoid creating
             a VpnRunner.
          2. Removing expectStartLegacyVpnRunner() since it is not
             used when startLegacyVpnPrivileged() is overridden.
      
      Bug: 230548427
      Test: atest FrameworksNetTests
      Change-Id: Id55d8d6cd03b84bca815cd331eb0f7d584eaed5f
      b2764be9
    • Hansen Kurli's avatar
      Remove the fail case on IPv6 in testLockdownVpn · acb52055
      Hansen Kurli authored
      In testLegacyLockdownVpn, remove the fail check on IPv6 networks
      and add coverage in VpnTest instead as this interaction relies
      on the Vpn implementation, not ConnectivityService.
      
      Bug: 230548427
      Test: atest FrameworksNetTests
      Change-Id: Ib24809ece2332c4c3d3e08c168e02ad859242eac
      acb52055
    • Hansen Kurli's avatar
      Remove LockdownVpnTracker from testLegacyLockdownVpn · 35f6fef3
      Hansen Kurli authored
      The test coverage of LockdownVpnTracker has been moved to a
      separate unit test file. testLegacyLockdownVpn now calls the Vpn
      methods directly instead of creating a new LockdownVpnTracker.
      Note this removes calls to expectStopVpnRunnerPrivileged since
      stopVpnRunnerPrivileged is now directly called in the test so it
      is already guaranteed to be called.
      
      The expected calls/behavior of LockdownVpnTracker can be seen in
      LockdownVpnTrackerTest.
      
      Bug: 230548427
      Test: atest FrameworksNetTests
      Change-Id: Id9d26435bf62ffef954f6c7fa0558ce99540de1f
      35f6fef3
  6. Sep 12, 2023
    • Paul Hu's avatar
      046b0c1c
    • Motomu Utsumi's avatar
      Merge changes If3217916,I86023b1f into main · c6dc826c
      Motomu Utsumi authored
      * changes:
        Add java_defaults for @FlaggedApi handling
        Prepare api directory for udc mainline branch
      c6dc826c
    • Mike Yu's avatar
    • Yi Kong's avatar
      Fix misc-unused-using-decls clang-tidy warning · a669de72
      Yi Kong authored
      packages/modules/Connectivity/service/native/TrafficController.cpp:58:18: error: using decl 'DumpWriter' is unused [misc-unused-using-decls,-warnings-as-errors]
      using netdutils::DumpWriter;
      ^
      packages/modules/Connectivity/service/native/TrafficController.cpp:58:18: note: remove the using
      using netdutils::DumpWriter;
      ~~~~~~~~~~~~~~~~^~~~~~~~~~~
      packages/modules/Connectivity/service/native/TrafficController.cpp:61:18: error: using decl 'ScopedIndent' is unused [misc-unused-using-decls,-warnings-as-errors]
      using netdutils::ScopedIndent;
      ^
      packages/modules/Connectivity/service/native/TrafficController.cpp:61:18: note: remove the using
      using netdutils::ScopedIndent;
      ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
      
      Test: presubmit
      Change-Id: I1871139fed31c57a5c15a8ab4f88aa7c695ff360
      a669de72
    • Paul Hu's avatar
      Correct isLegacy metric data · 508a012b
      Paul Hu authored
      The isLegacy field of Nsd metrics should indicate whether the
      data was collected from the old backend or not. However, it is
      currently only dependent on the ENABLE_PLATFORM_MDNS_BACKEND
      compat change value, which is incorrect. This is because the
      NsdService always uses the new backend since Android U,
      regardless of the compat change value. Therefore, the isLegacy
      data should be obtained from each transaction.
      
      Bug: 287546772
      Bug: 299880473
      Test: atest FrameworksNetTestCases NsdManagerTest
      Change-Id: I156abd656b90578d710696a69ccf7dfca97a2c9c
      508a012b
  7. Sep 11, 2023
    • Igor Zaslavsky's avatar
      Implement Discovery PLATFORM logic in Rust · 3521a5ed
      Igor Zaslavsky authored
      Add RemoteAuthConnectionCache and RemoteAuthPlatform
      with support to sendMessage
      
      Design doc: go/remote-auth-manager-fishfood-design
      
      Test: built successfully.
      Bug: : 291333048
      Change-Id: I17f73b4fb2e22924a484eeb3baa9b933ae980076
      3521a5ed
    • Jean Chalard's avatar
      Merge changes I0afdda02,I1c47f616 into main · 5f730c6a
      Jean Chalard authored
      * changes:
        Implement ConnectivityStateMetrics sample
        Add base classes for common ConnectivityService tests.
      5f730c6a
    • Kangping Dong's avatar
    • Motomu Utsumi's avatar
      Merge "Merge remote-tracking branch 'remotes/aosp/tmp_libs_net_move' into... · 55850dcc
      Motomu Utsumi authored
      Merge "Merge remote-tracking branch 'remotes/aosp/tmp_libs_net_move' into libs_net_move_merge" into main
      55850dcc
    • Mike Yu's avatar
      Add sim card requirement for CtsNativeNetDnsTestCases · a7d02ba6
      Mike Yu authored
      As connectivity pre-check was added to CtsNativeNetDnsTestCases
      recently, this CL is needed as well.
      
      Bug: 298886804
      Test: TreeHugger
      Change-Id: I3c26920e8609256470cd2b8c37fc1f33f56c39fd
      a7d02ba6
    • Chalard Jean's avatar
      Implement ConnectivityStateMetrics sample · f95e2de3
      Chalard Jean authored
      Test: ConnectivitySampleMetricsTest
      Change-Id: I0afdda023208c3f8620cb5b89add66448af596d7
      f95e2de3
    • Chalard Jean's avatar
      Add base classes for common ConnectivityService tests. · 0f5c4fe9
      Chalard Jean authored
      This sets up what is necessary for an instrumented
      ConnectivityService to run. Users of this class are
      meant to inherit CSTest.
      
      This is still relatively basic and does not have all the
      instrumentation in ConnectivityServiceTest. Developers
      looking to extend CSTest may find some instrumentation
      missing ; when they add the missing instrumentation,
      they should consider whether it should be generic for all
      CSTests (and put it in base/), or whether it's local to
      their own test suite. This should enable faster testing
      as each CSTest children will only need to set up the
      instrumentation it actually needs.
      
      This patch also migrates a basic test to have a first user.
      
      Bug: 272685721
      Test: ConnectivityServiceTest
            CSBasicMethodsTest
      Change-Id: I1c47f616af90629c9cb2a6ae89d992b19863e704
      0f5c4fe9
    • Kangping Dong's avatar
      [Thread] add ot-daemon to com.android.tethering · f2060610
      Kangping Dong authored
      ot-daemon is a dependency of the new Thread feature. This commit
      add the ot-daemon binary and init rc file to the Tethering module.
      Note that the ot-daemon service is default disabled and versioned
      init rc file is used to ensure that this service won't be started
      before Android U.
      
      This is expected to increase the size of "com.android.tethering.capex"
      by around 400 KB.
      
      Manual verification:
      1. on Android T (33) CF device, the ot-daemon service is not started
         after device boots; It reports service not found error when trying
         to start the ot-daemon service with adb shell command "start
         ot-daemon"
      2. on Android U (34) CF device, the ot-daemon service is not started
         after device boots; It can be started with shell comamnd "start
         ot-daemon" but then failed because of missing sepolicy rules as
         expected
      
      Test: see above manual verification note
      Bug: 296211911
      Change-Id: I222e2bbcc2ad0be2beec9f5f3406e7144d314370
      f2060610
    • Yuyang Huang's avatar
      Handle closed socket and NPE properly · 8f4adaed
      Yuyang Huang authored
      Don't get interfaceIndex if the socket is closed. Properly catch NPE
      instead of letting is propagating.
      
      Test: TH
      Change-Id: If962541e67dd6323426e46bc7a1f118786f83b9b
      8f4adaed
    • Motomu Utsumi's avatar
      Merge remote-tracking branch 'remotes/aosp/tmp_libs_net_move' into libs_net_move_merge · c4800393
      Motomu Utsumi authored
      frameworks/libs/net/common ->
      packages/modules/Connectivity/staticlibs
      
      frameworks/libs/net/client-libs ->
      packages/modules/Connectivity/staticlbs/client-libs
      
      Test: TH
      Bug: 296014682
      Change-Id: I5dc78f0c4653e20312ab3d488b1e69262dbb9840
      c4800393
    • Motomu Utsumi's avatar
  8. Sep 08, 2023
Loading