Skip to content
Snippets Groups Projects
  1. Jan 11, 2024
    • Yan Yan's avatar
      Enable NetworkMetricMonitor and support penalizing networks · ce1468a2
      Yan Yan authored
      This CL integrates the IpSecPacketLossDetector into VCN
      route selection. With this change, when a data stall is
      reported, the network candidate will be penalized and
      then deprioritized during network selection. A network
      candidate will stop being penalized until it hitting a timeout
      or passing the validation.
      
      Bug: 282996138
      Test: atest FrameworksVcnTests(new tests), CtsVcnTestCases
      Change-Id: Ifabd6fdea1d5a4fea40cf929dbab7c26d37274ac
      ce1468a2
  2. Jan 10, 2024
    • Yan Yan's avatar
      Support IPsec packet loss detector · 4d8d4462
      Yan Yan authored
      This CL creates an abstract class NetworkMetricMonitor and a
      subclass IpSecPacketLossDetector. IpSecPacketLossDetector
      is responsible for continuously monitoring IPsec packet loss
      and reporting to the caller when the data loss rate surpass
      a threshold. This detector allows the VCN to switch from
      the underlying network that has bad quality.
      
      This CL also defines new carrier configs that specify the
      data loss threshold and detecting frequency
      
      Bug: 282996138
      Test: atest FrameworksVcnTests(new tests), CtsVcnTestCases
      Change-Id: I5f4b8e1821bdbb37f0a6de6e1584f8e3c87273f3
      4d8d4462
    • Nelson Li's avatar
      Convert CameraTooTest to Android.bp · d894cc2f
      Nelson Li authored
      "CameraTooTests" requires the prior installation of "CameraToo" to run
      correctly.
      Set "CameraToo" as `data` for "CameraTooTests" and add
      "AndroidTest.xml" to it.
      
      Bug: 319184564
      Test: atest CameraTooTests
      Change-Id: I105fc12c7e63e534b0744184876e3526f69021d0
      d894cc2f
    • Yan Yan's avatar
      Refactor VCN route selection with UnderlyingNetworkEvaluator · 90864bc8
      Yan Yan authored
      This is a preparation CL that allows followup CLs to add network
      metric monitors. This CL does a pure refactoring without
      introducing any behavior changes
      
      Specific changes include:
      - UnderlyingNetworkEvaluator now encapsulates the calculation of
        mPriorityClass
      - mIsSelected is moved from UnderlyingNetworkRecord to
        UnderlyingNetworkEvaluator
      - UnderlyingNetworkListener is simplified by moving the network
        candidate out to the UnderlyingNetworkController
      - NetworkPriorityClassifier now takes a "isSelected" boolean
        instead of the currently selected network candidate
      
      Bug: 282996138
      Bug: 315858972
      Test: atest FrameworksVcnTests, CtsVcnTestCases
      Change-Id: I8461a68f1c4260b253d84d3efed2b09c41116656
      90864bc8
  3. Jan 03, 2024
  4. Dec 05, 2023
  5. Dec 01, 2023
  6. Nov 22, 2023
    • Eric Biggers's avatar
      Rename the fix_unlocked_device_required_keys flag · 27a776f5
      Eric Biggers authored
      This flag was defined as a regular flag and then was later changed to a
      fixed_read_only flag.  This scenario is currently "unsupported" by the
      flags infrastructure; an error occurs when trying to advance the flag to
      staging.  Work around this by renaming the flag so that the flags
      infrastructure sees it as an entirely new flag.
      
      (Also fix two formatting errors in LockStateTrackingRule.kt which were
      causing the ktlint_hook pre-upload hook to fail.)
      
      Bug: 296464083
      Bug: 311648623
      Test: build
      Change-Id: Ia8c7b3d2602bcbd4e349cc7f340ff6077412996e
      27a776f5
  7. Nov 15, 2023
    • Cole Faust's avatar
      Fixes for errorprone update · a599ed93
      Cole Faust authored
      Bug: 311064136
      Test: m RUN_ERROR_PRONE=true javac-check
      Change-Id: Ia6e4162a4244793f772dc880b73be0bc30f26d8b
      a599ed93
  8. Nov 07, 2023
  9. Oct 31, 2023
  10. Oct 27, 2023
    • Yan Yan's avatar
      Respect caller config to disable VCN safe mode · ec86848d
      Yan Yan authored
      Update VcnGatewayConnection to support disabling safe mode
      
      Bug: 276358140
      Test: atest FrameworksVcnTests (new tests)
      Test: atest CtsVcnTestCases
      Change-Id: If767dbace925c7e13705db2ea6f23c890992405c
      ec86848d
    • Yan Yan's avatar
      Add setter/getter to disable VCN safe mode · 0e92cfc3
      Yan Yan authored
      Bug: 276358140
      Test: atest FrameworksVcnTests (new tests)
      Test: atest CtsVcnTestCases
      Change-Id: I7b460cc3a3b143de212bb5a1b717fc99582f05ec
      0e92cfc3
  11. Oct 06, 2023
    • Eric Biggers's avatar
      Rename CanUnlockWithActiveUnlockTest.kt · a9826c8c
      Eric Biggers authored
      The name of this source file does not match the test class it contains.
      Rename the source file to match the test class.
      
      Flag: TEST_ONLY
      Test: atest TrustTests
      Change-Id: Ib1b4bbcf980545dd0ee7b08951185d4038954e37
      Merged-In: Ib1b4bbcf980545dd0ee7b08951185d4038954e37
      (cherry picked from commit 2e98f22c)
      a9826c8c
    • Krzysztof Kosiński's avatar
      Clean up obsolete aliases for Truth. · bbe98fe3
      Krzysztof Kosiński authored
      Bug: 255714762
      Test: presubmit
      Change-Id: I7e29732e1e77e37cfb491521d14d2f3eb07deb36
      Merged-In: I7e29732e1e77e37cfb491521d14d2f3eb07deb36
      bbe98fe3
    • Krzysztof Kosiński's avatar
      Clean up obsolete aliases for Truth. · ce1b2a1c
      Krzysztof Kosiński authored
      Bug: 255714762
      Test: presubmit
      Change-Id: I7e29732e1e77e37cfb491521d14d2f3eb07deb36
      Merged-In: I7e29732e1e77e37cfb491521d14d2f3eb07deb36
      ce1b2a1c
  12. Sep 25, 2023
    • Jiyong Park's avatar
      binder: fix death recipient leak for apps targeting >= V · 646cc266
      Jiyong Park authored
      Before this change, when a death recipient is set on a binder proxy via
      linkToDeath, a JNI global ref to the recipient object was created. That
      global ref is cleared only when unlinkToDeath is explicitly called or
      binderDied is notified.
      
      In addition, since binderDied didn't give the IBinder which has died,
      people has kept a strong reference to IBinder in the death recipient
      object. Ex:
      
      class FooHolder implements Binder.DeathRecipient {
          private IFoo mFoo;
          public FooHolder(IFoo foo) {
              mFoo = foo; // this!!!
              mFoo.linkToDeath(this, 0);
          }
          @Override
          public void binderDied() {
              // know that IFoo has died
          }
      }
      
      Unfortunately, this is prone to leak. Even if there's no reference to
      FooHolder in your program, it is kept in memory due to the JNI global
      ref as mentioned above. It means that you keep IFoo as well, and that
      in turn keeps the binder service in the remote side. As a result,
      binderDied will never be called (well, except when the server process
      crashes).
      
      The only way to release this object is calling unlinkToDeath explicitly
      when you drop references to FooHolder. However, it's error prone and
      keeping that practice is hard to be enforced.
      
      Recently, the need for this pattern has become weaker as we introduced
      binderDied(IBinder who). However, the API is quite new and its use is
      not mandated. There still are many cases where this pattern is used.
      
      This change is an attempt to fix the issue without having to touch the
      existing uses. The idea is to change the way that death recipient
      objects are strongly referenced - depending on whether you are targeting
      Android V+ or not.
      
      If targeting Android V+, the death recipient object is "weakly"
      referenced from JNI. Instead, it is "strongly" referenced from the
      BinderProxy object it is registered at. This means that if you drop
      a BinderProxy object, you are dropping its death recipients as well,
      unless you keep references to the recipients separately.
      
      For apps targeting pre-V versions, we keep the JNI strong reference.
      
      An important implication of this is that you won't get binderDied if you
      drop BinderProxy object before the binder actually dies. This actually
      is the documented behavior and has been the actual behavior "if you
      don't use the FooHolder pattern mentioned above". I'd argue that this CL
      fixes the undocumented incorrect behavior. However, we should be
      conservative when making any behavioral change, thus we are hiding this
      change behind the target SDK level.
      
      Bug: 298374304
      Test: atest BinderLeakTest BinderLeakTest_legacy
      
      Change-Id: Ibb371f4de45530670d5f783f8ead8404c39381b4
      646cc266
  13. Sep 13, 2023
    • Pete Bentley's avatar
      Fix up NetworkSecurityConfigTests. · a14b9b34
      Pete Bentley authored
      * Outdated defaults for plain HTTP.
      * Replaced expired test pins with the current intermediate.
      issuer cert for android.com.
      * Replaced obsolete trust anchors with a single GTS Root cert.
      * Fixed connection tests to use startHandshake() not getInputStream().
      * Made checkstyle happier.
      
      Would have converted to JUnit4 too, but unsure how to
      migrate ActivityUnitTestCase correctly.
      
      Bug: 259406200
      Test: NetworkSecurityConfigTests
      Change-Id: I385fc4bb67cd937e9e5f7b291f2cee37fd9ad715
      a14b9b34
  14. Sep 11, 2023
  15. Sep 08, 2023
    • Eric Biggers's avatar
      Fix refreshDeviceLockedForUser() to use correct trust state · c6772277
      Eric Biggers authored
      TrustManagerService#refreshDeviceLockedForUser() incorrectly considers
      the device to be unlocked by a trust agent whenever a trust agent has
      granted trust.  This ignores the conditions that
      TrustManagerService#updateTrust() has for recognizing trust grants.
      This code used to be correct, but it became incorrect in Android 10 when
      trust agents were made to extend unlock rather than actively unlock.
      
      The correct state is sent to Keyguard, while the incorrect state is sent
      to Keystore.  This would cause UnlockedDeviceRequired keys to sometimes
      be usable when the device is locked, though since Android 12 this bug is
      hidden by other bugs with UnlockedDeviceRequired keys that make them
      unusable in many cases.  However, these bugs are planned to be fixed.
      
      Therefore, fix this bug by making refreshDeviceLockedForUser() use
      mUserTrustState, which holds the user's authoritative trust state.
      
      Bug: 296464083
      Bug: 298249081
      Flag: 296464083
      Test: adb shell device_config put hardware_backed_security android.security.fix_unlocked_device_required_keys true
            atest TrustTests
            adb shell device_config put hardware_backed_security android.security.fix_unlocked_device_required_keys false
            atest TrustTests
      Change-Id: I0880685c23ebe71a799671fa611fafb42642fa83
      c6772277
    • Colin Cross's avatar
      Fix kotlin nullable errors in TrustTests · 5f70c172
      Colin Cross authored
      Fix kotlin nullable errors that were exposed by setting the retention
      of android.annotation.NonNull and android.annotation.Nullable to
      class retention.
      
      Bug: 294110802
      Test: builds
      Change-Id: I31c4f4d256ff8dd2b6ed1f6ed74844ccaf7a4814
      Merged-In: I31c4f4d256ff8dd2b6ed1f6ed74844ccaf7a4814
      (cherry picked from commit c5a0cfdd)
      5f70c172
    • Eric Biggers's avatar
      Improve LockStateTrackingRule · 37873686
      Eric Biggers authored
      - Make assertLocked and assertUnlocked check
        KeyguardManager#isDeviceLocked, in addition to what they were checking
        before.  This is important, as this verifies what TrustManagerService
        (and thus also Keystore) considers the device locked state to be.
      
      - Rename assertUnlocked to assertUnlockedAndTrusted.  This makes it
        clear that it checks for trusted (which implies unlocked), not just
        unlocked (which does not necessarily imply trusted).
      
      - Rename the inner class LockState to TrustState.  This makes it clear
        what it actually is.
      
      - Improve the class comment.
      
      Bug: 296464083
      Bug: 298249081
      Flag: TEST_ONLY
      Test: atest TrustTests
      Change-Id: I865ec19dff7ebe00ff083da29154e3c9cb846574
      37873686
  16. Sep 07, 2023
    • Bryce Lee's avatar
      Notify TrustListeners when enabled trust agents change. · c3522c19
      Bryce Lee authored
      This change adds a new callback from TrustManagerService when the
      enabled trust agents change. This addition enables TrustListeners to
      react when an authentication method has been enabled by the user.
      
      Test: atest KeyguardStateControllerTest#testOnEnabledTrustAgentsChangedCallback
      Test: atest KeyguardUpdateMonitorTest#testOnEnabledTrustAgentsChangedCallback
      Test: atest TrustManagerServiceTest#reportEnabledTrustAgentsChangedInformsListener
      Fixes: 277845892
      Fixes: 279231562
      Change-Id: Id6d4b65abb4de77f52f1d48499eed3ca26384663
      (cherry picked from commit 3580317c)
      Fixes: 299529171
      Merged-In: Id6d4b65abb4de77f52f1d48499eed3ca26384663
      c3522c19
  17. Sep 01, 2023
  18. Aug 23, 2023
    • Colin Cross's avatar
      Fix kotlin nullable errors in TrustTests · c5a0cfdd
      Colin Cross authored
      Fix kotlin nullable errors that were exposed by setting the retention
      of android.annotation.NonNull and android.annotation.Nullable to
      class retention.
      
      Bug: 294110802
      Test: builds
      Change-Id: I31c4f4d256ff8dd2b6ed1f6ed74844ccaf7a4814
      c5a0cfdd
    • Colin Cross's avatar
      Fix kotlin nullable errors in Input tests · f3413858
      Colin Cross authored
      Fix kotlin nullable errors that were exposed by setting the retention
      of android.annotation.NonNull and android.annotation.Nullable to
      class retention.
      
      Bug: 294110802
      Test: builds
      Change-Id: I35530e7ed63a647c39018ef0ee850ceea4dbc0ba
      f3413858
    • Colin Cross's avatar
      Fix kotlin nullable errors in SilkFX tests · 37a0857d
      Colin Cross authored
      Fix kotlin nullable errors that were exposed by setting the retention
      of android.annotation.NonNull and android.annotation.Nullable to
      class retention.
      
      Bug: 294110802
      Test: builds
      Change-Id: I8113aa76a60904bc70211f95b1e4c05d11e4ae85
      Merged-In: I8113aa76a60904bc70211f95b1e4c05d11e4ae85
      37a0857d
  19. Aug 22, 2023
  20. Aug 21, 2023
  21. Aug 17, 2023
Loading