Skip to content
Snippets Groups Projects
  1. May 31, 2024
    • Veena Arvind's avatar
      Don't unlock other users if user 0 or parent user does not contain escrow data. · 9cb7c7af
      Veena Arvind authored
      Bug: 324085891
      Test: atest CtsResumeOnRebootHostTestCases \
      FrameworksServicesTests: RebootEscrowDataTest \
      FrameworksServicesTests: LockSettingsServiceTests \
      FrameworksServicesTests: RecoverySystemServiceTest \
      FrameworksServicesTests: RebootEscrowManagerTests \
      FrameworksServicesTests: RebootEscrowProviderServerBasedImplTests
      Change-Id: Ibba55830bb3168d312d3f92094d7a266931439e6
      9cb7c7af
  2. May 17, 2024
  3. May 15, 2024
    • Suprabh Shukla's avatar
      Use metered firewalls for metered uid policy · 68e9bc59
      Suprabh Shukla authored
      Since the underlying code in connectivity manager is moving to metered
      firewalls to denote the uid policy for metered restrictions, NPMS can
      start using them now.
      Rather than having a single PENALTY_BOX, we have separate firewalls for
      user and admin imposed restrictions. Once NPMS uses the appropriate
      firewalls for these, it does not need to separately convey the blocked
      reasons for metered restrictions on uids to the ConnectivityManager.
      
      Flag: com.android.server.net.use_metered_firewall_chains
      
      Test: atest FrameworksServicesTests:NetworkManagementServiceTest
      Test: atest FrameworksServicesTests:NetworkPolicyManagerTest
      Test: atest CtsHostsideNetworkPolicyTests
      
      Bug: 336693007
      Change-Id: I8da11ff663257d3dafcb5e22ae3313a9255ef0a6
      Merged-In: I8da11ff663257d3dafcb5e22ae3313a9255ef0a6
      68e9bc59
  4. May 13, 2024
  5. May 09, 2024
    • Alexei Nicoara's avatar
      Update OWNERS · 65ff85f1
      Alexei Nicoara authored
      Bug: 335982533
      Change-Id: I975641f193917101645cfcf2b78e198801c59a2c
      65ff85f1
    • Harshit Mahajan's avatar
      Fix RescuePartyTest · 00e50067
      Harshit Mahajan authored
      Disable flags in old test, these could be removed during flag cleanup
      
      Bug: 333720513
      Test: atest RescuePartyTest
      Change-Id: If659c702e3348c1c814f922f55d97776b99f2ff8
      00e50067
  6. May 02, 2024
    • Tim Yu's avatar
      Add Autofill OWNERS · a506bf80
      Tim Yu authored
      To services/tests/servicestests/src/com/android/server/autofill
      
      Change-Id: Ibcd6798627dc3506e4ef4ed690daf5c4e90c53d1
      Test: n/a
      Bug: n/a
      a506bf80
  7. Apr 30, 2024
    • Ronald Braunstein's avatar
      Fix test-suite for test_module_configs · cffaa00f
      Ronald Braunstein authored
      With upcoming changes, test_module_config modules need to live in
      the same test-suite as their base, in this case FrameworksServicesTests.
      It lives in device-tests, so the derived tests should as well.
      
      In the future we can migrate to general-tests if that makes more sense.
      FYI: b/149420197 has some context on the difference.
      
      Test: mm
      Test: atest FrameworksServicesTests_contentprotection
      Change-Id: I8358e2b026eea4b8fe449e9c51d13ea5623389a1
      cffaa00f
  8. Apr 27, 2024
  9. Apr 24, 2024
    • Harshit Mahajan's avatar
      Fixing RescuePartyTests · e1773b2e
      Harshit Mahajan authored
      1. Enabling "flag resets" behind aconfig flag
      2. Mocking the above flag in Tests
      
      Bug: 333720513
      Test: atest RescuePartyTest
      Change-Id: I87e82def65b01367dbb36c7324b91c36203f2409
      e1773b2e
  10. Apr 16, 2024
    • Ronald Braunstein's avatar
      Migrate TEST_MAPPING options -> Android.bp · a895d3a1
      Ronald Braunstein authored
      This is the second of several cls to start the migration of options in
      TEST_MAPPING files to being specified in Android.bp files.
      
      These tests already fail and will not pass the SLO checker, but
      we will get an exception.
      
      https://android-build.corp.google.com/test_investigate/invocation/I90500010261340262/test/TR68129237142233643/
      java.lang.SecurityException: You either need MANAGE_USERS or CREATE_USERS permission to: query users
      	at com.android.server.pm.UserManagerService.checkCreateUsersPermission(UserManagerService.java:3824)
      	at com.android.server.pm.UserManagerService.getUsers(UserManagerService.java:1362)
      	at com.android.server.pm.UserManagerService.getUsers(UserManagerService.java:1355)
      	at com.android.server.pm.UserManagerServiceUserInfoTest.setup(UserManagerServiceUserInfoTest.java:102)
      
      The overall goal is to get local (atest) runs closer to CI runs of the
      tests and split FrameworksServicesTests at runtime to different owners
      can be assigned to different parts of the test.
      
      Step 1) Introduce new modules and list them in TEST_MAPPING postsubmit
      Step 2) Wait a week for SLO checker to accept the new modules.
      Step 3) Replace current presubmit TEST_MAPPING entries with the module
      names.
      This was hand-crafted cl, not using the migration script yet.
      I am starting with one directory that has several TEST_MAPPING files
      
      Migration Plan Doc: https://docs.google.com/document/d/1x3w-BvKO3E-GbY8YOSBuzJC6-pkLkuhfjSyZ1hJQBYM/edit?tab=t.0#heading=h.17wg41voij6q
      
      Test: atest FrameworksServicesTests_pm_presubmit
      Test: atest -p .:presubmit
      Change-Id: I5227f9c4b66e62e2f858b796cfb8aa7b1eea806c
      Flag: TEST_ONLY
      Test-Mapping-Slo-Bypass-Bug: b/335015078
      a895d3a1
  11. Apr 04, 2024
  12. Apr 03, 2024
    • Shrinidhi Hegde's avatar
      update package watchdog to perform mitigations after every reboot once threshold is reached. · 3c56021d
      Shrinidhi Hegde authored
      Since the bootloop is not for complete boot rather for  system-server
      restarts, we dont have to be as conscious about performing higher
      impact mitigations and we can perform them earlier. (Reboots
      initiated by user doesnt trigger a bootloop scenario.)
      
      Removed the increment boot count threshold needed between 2 mitigations.
      Also removed BOOT_LOOP_THRESHOLD(default value: 15) which was needed to
      perform any high impact mitigations.
      
      PackageWatchdog would wait for DEFAULT_BOOT_LOOP_TRIGGER_COUNT (default
      value: 5) after a reboot (ex: WARM_REBOOT step in rescue party, mainline
      rollback). Changed the behaviour to wait for DEFAULT_BOOT_LOOP_TRIGGER_COUNT
      only for first mitigation.
      
      MitigationCount was not getting reset properly after de-escalation
      window. Updated the logic to save mitigationCount to the file after reset.
      
      Did manual tests by killing system_server process using the following
      command:
      `adb shell kill -9 $(adb shell pidof system_server)`
      Verified that the first mitigation was performed at 5 restarts.
      Every restart after that resulted in next mitigation being executed.
      
      Ran `atest PackageEatcdogTest` to verify PackageWatchdogTest and
      CrashRecoveryTest changes.
      
      Test: Unit test, manual test
      Bug: 291137901
      Change-Id: Ia0174e0e5dca09c5d4e9d3a12909c5e5087b4dbf
      3c56021d
    • Seigo Nonaka's avatar
      Fix font update failure · 55a60a5a
      Seigo Nonaka authored
      Bug: 331717791
      Test: atest UpdatableFontDirTest
      Test: Step 1: Build AOSP image and install
      Test: Step 2: Install font family.
      Test: Step 3: Remove certificate manually by adb shell.
      Test: Step 4: Reboot the device
      Test: Step 5: Install font family.
      Change-Id: I0373a2e66b7a6a51168094772afb36d8905b6979
      Merged-In: I0373a2e66b7a6a51168094772afb36d8905b6979
      55a60a5a
  13. Apr 02, 2024
  14. Apr 01, 2024
    • Eric Biggers's avatar
      Use consistent helper class for keystore authorization · a5d7857d
      Eric Biggers authored
      Currently the IKeystoreAuthorization service is intended to be accessed
      through the helper class android.security.Authorization.  However,
      because Authorization provides only static methods, it can only be
      unit-tested by static mocking, which is only available in
      mockingservicestests.  BiometricService works around this in two
      different ways: (a) using IKeystoreAuthorization directly, and (b) using
      android.security.KeyStore, which is an obsolete class which is now
      almost empty and just contains a couple random helpers.  I'd like to
      remove it to avoid confusion with java.security.KeyStore.
      
      This CL solves the testability problem in a consistent way by renaming
      Authorization to KeyStoreAuthorization and changing all public static
      methods to instance methods.  It updates all callers of the keystore
      authorization service to go through a KeyStoreAuthorization instance.
      Finally, it updates the unit tests for TrustManagerService and
      BiometricService to inject a mock KeyStoreAuthorization.
      
      Bug: 326508120
      Test: atest TrustManagerServiceTest
      Test: atest FrameworksServicesTests:{BiometricServiceTest,AuthSessionTest}
      Test: atest CtsBiometricsTestCases:BiometricSimpleTests
      Flag: N/A.  Refactoring with no behavior change intended.
      Change-Id: I68504f447b1b880c08a60cf027b13f77a6567ec9
      a5d7857d
    • Hansen Kurli's avatar
      Add APIs to manage profiles in the VpnBlobStore · a388a892
      Hansen Kurli authored
      Add hidden apis for settings to store profiles directly into the
      VpnBlobStore.
      
      Bug: 307903113
      Test: m
      Change-Id: I148ceedcb2ae235d89a3dd5ffba4a8ef26b5d104
      a388a892
  15. Mar 26, 2024
    • Chiachang Wang's avatar
      Remove unused assertTransportInfoMatches() method · 8f622ae9
      Chiachang Wang authored
      Test: atest FrameworksVpnTests
      Change-Id: I677c046fba993c97296dd2876d928d7d5d2b213c
      8f622ae9
    • Ronald Braunstein's avatar
      Migrate options in TEST_MAPPING -> Android.bp · f74ed57e
      Ronald Braunstein authored
      This is the first of several cls to start the migration of options in
      TEST_MAPPING files to being specified in Android.bp files.
      
      The overall goal is to get local (atest) runs closer to CI runs of the
      tests.
      
      These all have FrameworksServicesTests as the base test and all
      TEST_MAPPING files to refer to these new test modules reside under this
      (servictests) directory.
      
      Step 1) Introduce new modules and list them in TEST_MAPPING postsubmit
      Step 2) Wait a week for SLO checker to accept the new modules.
      Step 3) Replace current presubmit TEST_MAPPING entries with the module
      names.
      This second CL will be part of the same topic, which will also run in
      presubmit ...
      
      Later steps will ensure that if new options are added to these
      TEST_MAPPING files, they will get converted too, but nothing is
      preventing that yet.
      
      This was hand-crafted cl, not using the migration script yet.
      I am starting with one directory that has several TEST_MAPPING files
      below and converting them all, thus 10 new modules instead of 1 or 2.
      
      Migration Plan Doc: https://docs.google.com/document/d/1x3w-BvKO3E-GbY8YOSBuzJC6-pkLkuhfjSyZ1hJQBYM/edit?tab=t.0#heading=h.17wg41voij6q
      
      For these tests, the out dir increases by 1.7 Gig (total for all them).
      
      From: ~/aosp-main-with-phones/frameworks/base/services/tests/servicestests
      Ran atest and verified the test that ran matched the new filters.
      Test: atest --test-mapping src/com/android/server/contentcapture:postsubmit
      Test: atest --test-mapping src/com/android/server/contentprotection:postsubmit
      Test: atest --test-mapping src/com/android/server/location/contexthub:postsubmit
      Test: atest --test-mapping src/com/android/server/om:postsubmit
      Test: atest --test-mapping src/com/android/server/os:postsubmit
      Test: atest --test-mapping src/com/android/server/pm:postsubmit
          # 4 postsubmit tests fail, but there were already failing
      Test: atest --test-mapping src/com/android/server/recoverysystem:postsubmit
      
      Change-Id: I6e793d8c8fb1efb3b990466ea409a3cf1bf53434
      f74ed57e
  16. Mar 25, 2024
    • Cole Faust's avatar
      Supress errorprone warnings · a88e319b
      Cole Faust authored
      So that they can be promoted to an error by default.
      
      Bug: 253827323
      Test: m RUN_ERROR_PRONE=true javac-check
      Change-Id: Id386aecfaed2c96809a8a4cbfdb104e5fe87a084
      a88e319b
  17. Mar 22, 2024
    • Victor Chang's avatar
      Update LocaleUtils.filterByLanguage due to addLikelySubtags change · c033ce97
      Victor Chang authored
      ULocale.addLikelySubtags is allowed to canonicalize subtags according to
      step 1 in the spec http://www.unicode.org/reports/tr35/#Likely_Subtags
      - "Replace any deprecated subtags with their canonical values using the
        <alias> data in supplemental metadata. Use the first value in the
        replacement list, if it exists."
      - In this case, ULocale.addLikelySubtag("sr-Latn-CS") returns
        "sr-Latn-RS". Thus, the algorithm of LocaleUtils.calculateMatchingSubScore
        needs to be updated to do what it tries to do.
      
      In addition, update DateIntervalFormatTest due to
        ICU 74 de locale data change
      
      Bug: 327164201
      Test: atest FrameworksCoreTests:android.text.format
      Test: atest FrameworksServicesTests:com.android.server.inputmethod
      Test: atest CtsInputMethodTestCases
      Change-Id: I5902000994c8af8bdb7e26c99ae33b85cd5ccca4
      c033ce97
  18. Mar 21, 2024
    • Suprabh Shukla's avatar
      Always process state changes below TOP_THRESHOLD · 2db4d2ef
      Suprabh Shukla authored
      Sometimes, we deliberately send a process-state TOP change before the
      normal oom adjuster update gets triggered for resuming activities. In
      this case, there may be a duplicate notification for the same
      process-state change with a newer procStateSeq. We need to ensure we
      always process these notifications and notify activity manager on
      completion.
      
      These are redundant notifications but should be rare and cheap enough to
      always process - even if they do not end up changing any of the firewall
      state.
      
      Also modifying the log in ActivityManager to report a wtf whenever the
      wait timeouts to help emphasize this discrepancy.
      
      Test: atest FrameworksServicesTests:NetworkPolicyManagerServiceTest
      
      Fixes: 327303931
      (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:28afbd2a2183162a38d261c79abdfb50be65e896)
      Merged-In: I4884072bd6d7820acee67851d7504886564e2348
      Change-Id: I4884072bd6d7820acee67851d7504886564e2348
      2db4d2ef
  19. Mar 20, 2024
  20. Mar 19, 2024
  21. Mar 13, 2024
    • Harshit Mahajan's avatar
      Renaming isAttemptingFactoryReset to new name · 04e08e9f
      Harshit Mahajan authored
      Scope of isAttemptingFactoryReset method was updated to include both the
      reboots that were triggered by RescueParty.
      As it would be made an API, refactoring it to isRecoveryTriggeredReboot
      which seems a better name with expanded scope.
      
      Bug: b/289203818
      Test: m
      Change-Id: Ic4bc1765e2f08ad35ff23f0f6ea6dae0e4195e79
      04e08e9f
  22. Mar 12, 2024
    • Harshit Mahajan's avatar
      Fixing the owners file · 885c430d
      Harshit Mahajan authored
      Same three owners were being repeated at multiple places, having them at
      central owner place and including that everywhere.
      
      Bug: 289203818
      Test: NA
      Change-Id: Ic63f939e196fe5974eb5e4c31d7b2991eafac6cd
      885c430d
    • Chiachang Wang's avatar
      Remove dependency on framework-connectivity-test-defaults · c10258e7
      Chiachang Wang authored
      Replace the usage to include necessary lib only to address
      comment from aosp/2981832.
      
      Test: atest FrameworksVpnTests
      Change-Id: Id130c6739a683fc0c9e01e4e42d9215b660dba95
      c10258e7
  23. Mar 11, 2024
  24. Mar 09, 2024
  25. Mar 08, 2024
  26. Mar 06, 2024
  27. Mar 05, 2024
  28. Mar 04, 2024
    • Chiachang Wang's avatar
      Use ArgumentMatchers to replace deprecated org.mockito.Matchers · 4c1a704a
      Chiachang Wang authored
      Address lint warning in aosp/2985391.
      
      Test: atest FrameworksVpnTests
      Change-Id: I44794e92a87372b83a63c36b57eb99909f570444
      4c1a704a
    • Chiachang Wang's avatar
      Move VPN related platform code unit tests · 8f830968
      Chiachang Wang authored
      As VpnProfile, VpnManager and Ik2v2VpnProfile are platform codes,
      their unit tests should be better to be placed together with
      their source code.
      
      Move the unit test from module to platform for better test
      configuration.
      
      Test: atest FrameworksNetTests FrameworksVpnTests
      Change-Id: Idb5033e23306b714a29d953866ca5a5771fb78a7
      8f830968
    • Chiachang Wang's avatar
      Move LockdownVpnTrackerTest to FrameworksVpnNets · 249ebbeb
      Chiachang Wang authored
      LockdownVpnTrackerTest was put inside FrameworksServiceTest
      because there is no better place to put the test. This VPN
      related test should be better to be placed together with
      other VPN related tests.
      
      Also update the TEST_MAPPING to run the test accurately.
      
      Test: atest FrameworksVpnTests
      Change-Id: I2d90e401e3d0a6eea4a047a0079b28bba7aa15ed
      249ebbeb
  29. Mar 02, 2024
    • Suprabh Shukla's avatar
      Avoid obsolete uid-state change evaluations in NPMS · 0bb786e3
      Suprabh Shukla authored
      In some cases, where a uid undergoes quick consecutive state changes and
      the handler message has not completed execution, we can return early if
      we know a following handler message to evaluate the same rules is
      pending.
      
      We peek at UidStateCallbackInfos to infer this state as these are
      populated directly in the UidObserver callbacks before posting to the
      handler.
      
      The code avoids removing messages from the Handler as
      - it is a linear operation that may be slower.
      - the check on UidStateCallback happens later and returns from redundant
      handler message-processing without incurring much additional work.
      
      Also taking out some code out of the mUidRulesFirstLock lock.
      
      Test: atest CtsHostsideNetworkTests
      Test: FrameworksServicesTests:NetworkPolicyManagerServiceTest
      
      Bug: 327058756
      (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a0703d6dd4e906b9a38a1a4b497ff0c628d1411d)
      Merged-In: I764f714d3ce09699a0ab82b77c8b6a577cd9f9ab
      Change-Id: I764f714d3ce09699a0ab82b77c8b6a577cd9f9ab
      0bb786e3
Loading