Skip to content
Snippets Groups Projects
  1. May 14, 2024
    • guangkui.ren's avatar
      Fix potential crash issue in NonRequiredPackageDeleteObserver · 43d93da7
      guangkui.ren authored
      mLatch.notifyAll() will not help wake the thread which is blocked by
      mLatch.await, instead, it will cause system server crash.
      
      So, mark state as failed if any package is failed to be deleted, and let
      mLatch.countDown work until it comes to 0 and wake the thread blocked by
      await.
      
      Bug: 333845008
      Change-Id: Ida1c3c128ddef376aaaacda1358717d0d4e9ca8b
      43d93da7
  2. Apr 30, 2024
  3. Apr 29, 2024
    • Ellen Arteca's avatar
      Wipe the LockscreenCredential in DPMS#resetPasswordInternal · eec02e9f
      Ellen Arteca authored
      This CL adds try-with-resources around LockscreenCredential objects,
      in order to call `close()` when the resource is done being used.
      This also clears the LSKF `byte[]` representation in the LockscreenCredential.
      
      This CL applies the above changes to the DevicePolicyManagerService.
      
      Bug: 320392352
      Test: build
      Change-Id: Iad642dd4706ae052affc2f9ac6d6f0695870728d
      eec02e9f
  4. Apr 25, 2024
    • Eric Biggers's avatar
      Use KeyProperties.UID_SELF instead of KeyStore.UID_SELF · 4d8462cb
      Eric Biggers authored
      Since the class 'android.security.KeyStore' is going away, the UID_SELF
      constant is being moved to a more appropriate location in KeyProperties.
      Update code that references this constant to use the new location.  No
      change in behavior; the value of the constant remains the same.
      
      Bug: 326508120
      Test: build
      Flag: NONE mechanical refactoring with no behavior change
      Change-Id: I86aa1add526a9eb45bb89a73cc18bb54ba3496c3
      4d8462cb
  5. Apr 15, 2024
  6. Apr 05, 2024
    • Ronald Braunstein's avatar
      Migrating test options From TEST_MAPPING -> Android.bp · d9b0dc59
      Ronald Braunstein authored
      See parent cl: aosp/3028633
      
      Test: atest -p cmds/locksettings:postsubmit
      Test: atest -p services/core/java/com/android/server/locksettings:postsubmit
      Test: atest -p services/devicepolicy:postsubmit
      Change-Id: I6d0d0320e0bf8927f9b8b27b471ae58ace56124a
      d9b0dc59
  7. Mar 06, 2024
    • Kangping Dong's avatar
      [Thread] add DISALLOW_THREAD_NETWORK to policy sets · 8de9e946
      Kangping Dong authored
      This commit add missing policy configurations for
      DISALLOW_THREAD_NETWORK.
      
      See background go/ae-v-thread-admin-control
      
      Test: atest CtsDevicePolicyTestCases:android.devicepolicy.cts.ThreadNetworkTest
      Bug: 319079428
      Merged-In: I90ea527f5352d4ff11248acf8c985321620daa19
      Change-Id: I90ea527f5352d4ff11248acf8c985321620daa19
      8de9e946
  8. Feb 20, 2024
    • Kangping Dong's avatar
      [Thread] rename package name for Thread platform flags · 3c355586
      Kangping Dong authored
      There are two Thread flag files in frameworks/base and
      packages/modules/Connectivity/thread. Both are currently using the same
      "com.android.net.thread.flags" package name for their flags. While all
      flags needs to be built in a aconfig_declarations target, two aconfig_declarations
      can't have the same package name:
      
      ```
      FAILED: out/soong/build.aosp_arm.ninja
      cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --top "$TOP"     --soong_out "out/soong"     --out "out"     --soong_variables out/soong/soong.aosp_arm.variables -o out/soong/b
      uild.aosp_arm.ninja --globListDir aosp_arm --globFile out/soong/globs-aosp_arm.ninja -l out/.module_paths/Android.bp.list --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used.aosp_arm.build Android.bp
      2 aconfig_declarations found for package com.android.net.thread.flags
      ```
      
      To resolve this issue, this commit renames the platform flags to package
      name "android.net.thread.platform.flags".
      
      This commit is required by ag/26286387
      
      Bug: 325886480
      Merged-In: Icacf88f7c0aa499b4b29f4072ae58840f0b1761f
      Change-Id: Icacf88f7c0aa499b4b29f4072ae58840f0b1761f
      3c355586
    • Kangping Dong's avatar
      [Thread] rename package name for Thread platform flags · 9cb44920
      Kangping Dong authored
      (This is a cherry-pick of aosp/2968526 for resolving merge conflicts)
      
      There are two Thread flag files in frameworks/base and
      packages/modules/Connectivity/thread. Both are currently using the same
      "com.android.net.thread.flags" package name for their flags. While all
      flags needs to be built in a aconfig_declarations target, two aconfig_declarations
      can't have the same package name:
      
      ```
      FAILED: out/soong/build.aosp_arm.ninja
      cd "$(dirname "out/host/linux-x86/bin/soong_build")" && BUILDER="$PWD/$(basename "out/host/linux-x86/bin/soong_build")" && cd / && env -i  "$BUILDER"     --top "$TOP"     --soong_out "out/soong"     --out "out"     --soong_variables out/soong/soong.aosp_arm.variables -o out/soong/b
      uild.aosp_arm.ninja --globListDir aosp_arm --globFile out/soong/globs-aosp_arm.ninja -l out/.module_paths/Android.bp.list --available_env out/soong/soong.environment.available --used_env out/soong/soong.environment.used.aosp_arm.build Android.bp
      2 aconfig_declarations found for package com.android.net.thread.flags
      ```
      
      To resolve this issue, this commit renames the platform flags to package
      name "android.net.thread.platform.flags".
      
      This commit is required by ag/26286387
      
      Bug: 325886480
      Merged-In: Icacf88f7c0aa499b4b29f4072ae58840f0b1761f
      Change-Id: Icacf88f7c0aa499b4b29f4072ae58840f0b1761f
      9cb44920
  9. Jan 25, 2024
  10. Dec 13, 2023
    • Pavel Grafov's avatar
      Update data types to support cross user suspension · 59ed73ed
      Pavel Grafov authored
      This CL is a refactoring for the follow-up implementation and shouldn't
      change any behavior. It changes the data types and signatures to allow
      expressing cross-profile suspension and refactors the code to make
      adding a flagged functionality change easier in a follow-up. Some
      changes only make sense in that contex.
      
      String package is replaced with UserPackage, which encapsulates both
      suspending user id and suspending package. In this CL suspending user
      id is always the same as target user id, so suspension is never cross
      user.
      
      Some userId arguments were renamed to make it clearer whether it refers
      to the suspending user or the target user.
      
      Brief doc: go/ae-xu-suspend
      
      Also inline setPackagesSuspendedByAdmin into PMII
      
      Bug: 263464464
      Test: atest PackageManagerSettingsTests
      Test: atest PackageUserStateTest
      Test: atest com.android.server.pm.SuspendPackageHelperTest
      Test: atest CtsSuspendAppsTestCases
      Test: atest WmTests:ActivityStartInterceptorTest
      Change-Id: I71a4c524fb22fc3d3e0c64fd0b984ea44423b5d8
      59ed73ed
  11. Dec 05, 2023
    • Rubin Xu's avatar
      Handle screen capture disabled state for multiple users · 5f3db5ae
      Rubin Xu authored
      Before this fix, the framework use one single integer to track screen
      capture disabled policy across the device. This can be either a real
      userId, or the symbolic USER_ALL or USER_NULL for all users or no user.
      This has the problem that it can't represent policies from more than
      one admin (or policies from both the admin and its parent). In addition,
      due to the way DevicePolicyManagerService refreshes policies, when a
      non-managed user is started, its default policy state overrides any
      existing policy, causing screen capture to be no longer disabled.
      
      Fix this by properly tracking the policy for each user in an set.
      We still use USER_ALL in the set to represent screen capture being
      disabled for all users.
      
      In Android 14, the screen capture logic is migrated to policy engine
      which already contains this fix.
      
      Bug: 305664128
      Test: ScreenCaptureDisabledTest
      Test: FrameworksServicesTests:DevicePolicyManagerTest
      Test: DevicePolicyManagerServiceMigrationTest
      Test: MixedDeviceOwnerTest#testScreenCaptureDisabled_assist
            MixedProfileOwnerTest#testScreenCaptureDisabled_assist
            MixedManagedProfileOwnerTest#testScreenCaptureDisabled_assist
      Test: MixedManagedProfileOwnerTest#testScreenCaptureDisabled_assist_allowedPrimaryUser
      Test: MixedDeviceOwnerTest#testCreateAdminSupportIntent
            MixedProfileOwnerTest#testCreateAdminSupportIntent
            MixedManagedProfileOwnerTest#testCreateAdminSupportIntent
      
      Merged-In: I9da7b026e937a9e729777b4de613b319a4084418
      Change-Id: Ib016b740927003f8bd81992f24c722c29ac723b5
      5f3db5ae
  12. Nov 10, 2023
  13. Nov 07, 2023
  14. Nov 02, 2023
    • Pavel Grafov's avatar
      Delete TurnOffWork 2.0 code · c600a441
      Pavel Grafov authored
      Most of the change just deleted dead code - the flag for the feature has
      been hard coded as false and could only be manipulated via TestAPI that
      was only used in already disabled tests.
      
      To support upgrades from builds that had the feature turned on, this CL
      preserves the functionality of unsuspending work apps during boot if
      necessary. For that the now removed SPH.setPackagesSuspendedForQuietMode
      is functionally inlined into DPMS code.
      
      Bug: 306606563
      Test: btest a.d.c.QuietModeTest
      Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
      Test: atest SuspendPackageHelperTest
      Test: atest CtsSuspendAppsTestCases
      Test: atest WmTests:ActivityStartInterceptorTest
      Test: manual, OTA from early U build with the feature enabled
      Change-Id: Ib9d749348f9b75b472aad479ad5eb9fff608f71b
      c600a441
  15. Oct 27, 2023
  16. Oct 26, 2023
  17. Oct 20, 2023
    • Pavel Grafov's avatar
      Remove flag wrappers · 0a721669
      Pavel Grafov authored
      Reading flags no longer requires READ_DEVICE_CONFIG, so there is no need
      to wrap access in Binder.withCleanCallingIdentity().
      
      Bug: none
      Test: TH
      Change-Id: I43eb2e18860ac87907b1b79b3906d9f81bf9c078
      0a721669
  18. Oct 18, 2023
  19. Oct 17, 2023
  20. Oct 16, 2023
  21. Oct 13, 2023
  22. Oct 12, 2023
  23. Oct 10, 2023
  24. Oct 06, 2023
    • Victor Hsieh's avatar
      Move PersistentDataBlock* in server to its namespace · d3486987
      Victor Hsieh authored
      Also add OWNERS.
      
      Bug: 303523453
      Test: m
      Test: mma in services/devicepolicy/ services/tests/servicestests/
      Change-Id: Ic1d03d1483505b77ac88ac2e185026d668a22292
      d3486987
    • Eric Biggers's avatar
      DPMS: allow getPasswordMinimumMetrics() to anyone who can set LSKF · f30bd8b6
      Eric Biggers authored
      Everyone who sets a new LSKF is supposed to first validate it against
      the minimum password metrics.  Yet, the
      SET_AND_VERIFY_LOCKSCREEN_CREDENTIALS or ACCESS_KEYGUARD_SECURE_STORAGE
      permission is sufficient to set a new LSKF but isn't necessarily
      sufficient to get the minimum password metrics.  This is preventing
      'KeyguardManager#setLock(int, byte[], int, byte[])' from being fixed to
      properly validate the new LSKF.
      
      To fix this, make DevicePolicyManagerService#getPasswordMinimumMetrics()
      accept these permissions.
      
      Bug: 219511761
      Bug: 232900169
      Bug: 243881358
      Test: see I46d8bf920526a00d6e6d2145d06c8e39f8047ea8
      Change-Id: Ic69fd01dadf95ab49b025295711fa020180690ff
      Merged-In: Ic69fd01dadf95ab49b025295711fa020180690ff
      (cherry picked from commit 62dbf253)
      f30bd8b6
    • Eric Biggers's avatar
      Add and use PasswordMetrics#validateCredential() · 811f091f
      Eric Biggers authored
      Add a method PasswordMetrics#validateCredential() which takes a
      LockscreenCredential argument and honors the "invalid chars" flag in it.
      This should be used instead of PasswordMetrics#validatePassword() which
      does not honor the "invalid chars" flag (which it does not have access
      to) and only works for PASSWORD and PIN, not PATTERN and NONE.
      
      Convert all callers of validatePassword() in frameworks/base to use
      validateCredential().  After this, two callers remain: one in
      packages/apps/Settings which I'll convert right away too, and several in
      packages/apps/Car/Settings which will take a bit longer to get rid of.
      
      Bug: 219511761
      Bug: 232900169
      Bug: 243881358
      Test: atest PasswordMetricsTest
      Test: Verified that 'locksettings set-password' no longer accepts
            a non-ASCII char that was accepted before
      Test: see I5f1822a34688473cb103eb64dca56e4c19d4dd08
      Change-Id: Ib8f43aef5b5aa5bb059780707582d0419f9ddf9a
      Merged-In: Ib8f43aef5b5aa5bb059780707582d0419f9ddf9a
      (cherry picked from commit 813f32c9)
      811f091f
  25. Oct 04, 2023
  26. Oct 02, 2023
  27. Sep 28, 2023
  28. Sep 27, 2023
    • bkchoi's avatar
      Fix the side effect of `adb shell dpm set-device-owner` · 1165c2d1
      bkchoi authored
      When there was already an active admin, the command created a fresh
      active admin and replaced the existing one, which cleared some
      necessary flags that were previously set in the admin.
      This CL fixes the unwnated side effect by not overwriting the existing
      admin.
      
      Bug: 282239828
      
      Test: adb shell dpm set-device-owner --user 0 <component>
            adb shell dumpsys device_policy
      
      Change-Id: Ib424dcbcec4e3699beb5aa46079424dc9d87d275
      1165c2d1
  29. Sep 25, 2023
  30. Sep 22, 2023
  31. Sep 18, 2023
  32. Sep 15, 2023
  33. Sep 12, 2023
  34. Sep 11, 2023
Loading