Skip to content
Snippets Groups Projects
  1. May 10, 2024
  2. Feb 23, 2024
    • Hai Zhang's avatar
      Fix NPE when PermissionEntry.getGids() returns null. · 1ba16aa8
      Hai Zhang authored
      PermissionEntry.gids may return null when parsing legacy config trying
      to work around an issue about upgrading from L platfrm. We can just
      ignore such entries now.
      
      Bug: 325137277
      Bug: 322197421
      Test: system boots with flag enabled
      Change-Id: I71a160d53b1a1b429019bb1973a892f78ccb0a17
      Merged-In: I71a160d53b1a1b429019bb1973a892f78ccb0a17
      (cherry picked from commit b0b149c4)
      1ba16aa8
    • Hai Zhang's avatar
      Create a better implementation for permission GIDs. · dc8c435c
      Hai Zhang authored
      The old subsystem creates "fake" permissions owned by the "android"
      package that will contain the GIDs and be overridden by system apps,
      however that approach is fragile because it depends a lot on the package
      scan order since these "fake" permissions will be trimmed after we scan
      the "android" package.
      
      In contrast, it's a lot easier and straightforward to just look up the
      GIDs upon scanning permission definitions, which will also fix the
      package scanning order issue. It also helps with removing one type of
      permission definition and the special cases we had to add for it.
      
      This is a better version of the easier but behavior changing fix
      ag/26216413.
      
      This change is behind a bug-fix flag since it's still a new way of doing
      things, despite that it's straightforward and there's no expected
      behavior change except for fixing GID assignment for permissions
      declared in APKs-in-APEX etc on first boot.
      
      Fixes: 325137277
      Bug: 322197421
      Test: manually check the GIDs in dumpsys permissionmgr after clean flash
      Change-Id: Ied24c45734e7c57ce8ed0d015121675bfcbae54f
      Merged-In: Ied24c45734e7c57ce8ed0d015121675bfcbae54f
      (cherry picked from commit 05b75fb4)
      dc8c435c
  3. Dec 13, 2023
    • TYM Tsai's avatar
      Move package parsing implementations to internal · 4bf59a58
      TYM Tsai authored
      1. Move implementations and related utils to internal
      2. Make calling SystemConfig methods from ParsingPackageUtils.Callback
         to avoid calling from the client side.
      3. Move isMatch and isEnabled from ComponentParseUtils to PackageInfoUtils
      4. Move string from SELinuxUtil to SeinfoUtil
      5. Move some methods from AndroidPackageUtils to AndroidPackageLegacyUtils
      6. Copy some methods from PackageInfoUtils to AppInfoUtils
      7. Use PackageParserException instead of PackageManagerException for
         validatePackageDexMetadata method
      
      Bug: 309596860
      Test: build pass and boot to home
      Test: atest PackageManagerServiceServerTests
      Test: atest PackageManagerComponentOverrideTests
      Test: atest PermissionServiceMockingTests
      Test: atest PackageManagerServiceUnitTests
      Test: atest PackageManagerPerfTests
      Change-Id: I3de48d0d8adf714447823408673e07ed379f27ab
      4bf59a58
  4. Dec 11, 2023
  5. Dec 07, 2023
    • mrulhania's avatar
      Rename device aware permissions apis flag · 04966c5e
      mrulhania authored
      Renaming the flag to avoid potential issues
      during rollout (the flag was changed to fixed
      in a follow up CL due to some errors)
      
      Fix: 315334748
      Test: build
      Change-Id: I8c4b1a449917df1de879f99eac79c5662e03f6ab
      04966c5e
  6. Dec 01, 2023
    • mrulhania's avatar
      Clear permissions for virtual devices · bfd2e7a5
      mrulhania authored
      Remove permissions for external devices on
      removal i.e. when the external device is removed.
      
      Bug: 283975881
      Test: presubmit
      Change-Id: I72983f25071d867d6f7d4b908ef76c796ed77d06
      bfd2e7a5
  7. Nov 22, 2023
  8. Nov 21, 2023
    • mrulhania's avatar
      Rename deviceId to persistentDeviceId · b42d5323
      mrulhania authored
      Name device Id and persistent device Id carefully
      in the classes where both ID are used.
      
      Bug: 289355341
      Test: local build
      Change-Id: I7b5c2063cf60500bbcd293cc76b4979bc08bf1ee
      b42d5323
  9. Nov 17, 2023
    • mrulhania's avatar
      Support virtual device in permissions listener · 31207a9b
      mrulhania authored
      Clients can opt-in for virtual devices
      permission changes by overriding new callback.
      
      Bug: 289355341
      Bug: 302627733
      Test: presubmit
      Change-Id: I282eb4fabea6d36005b8eb1dc4a8c6887d3cd400
      31207a9b
  10. Nov 15, 2023
  11. Nov 10, 2023
    • Yuting Fang's avatar
      Hardcode device aware permissions in system server · 4a4701de
      Yuting Fang authored
      CAMERA and MICROPHONE are the only two permissions that can be device aware at this moment. Hardcode them in the system server to
      enable saving permission states for device aware permissions. Note: this is a temporary change. Once we have a formal API to return
      device aware permissions, we should replace the hardcode.
      
      Bug: 292252664
      Test: Existing tests pass. Refer to tests in ag/24855864
      Change-Id: If706ea1c9dc5b171a5210298dab5ad4812d6bb88
      4a4701de
  12. Nov 01, 2023
  13. Oct 11, 2023
  14. Oct 10, 2023
    • Manjeet Rulhania's avatar
      Reset virtual device permissions · bf9058ca
      Manjeet Rulhania authored
      Add permission reset support for `reset-permissions`
      shell command.
      
      Fix: 303700254
      Test: presubmit & manual
      Change-Id: Iff374ac90549ca3abe1f2bbd249b7f18b9c63437
      bf9058ca
  15. Oct 03, 2023
  16. Sep 21, 2023
    • mrulhania's avatar
      device aware self revoke and one time session timeout · 8ac2e966
      mrulhania authored
      Bug: 283978092
      Test: atest RevokeSelfPermissionTest
      Test: atest OneTimePermissionTest
      Test: atest DevicePermissionsTest
      
      Change-Id: I0adef572133a288c17e43b3e1b8adcf53ff68114
      8ac2e966
    • Hai Zhang's avatar
      Use non-null assertion instead of checkNotNull(). · 2d8d591b
      Hai Zhang authored
      For consistency in code style, and always avoiding a method call
      regardless of optimizations.
      
      Change-Id: I2c041c8ef2e5cb8e3ca6c9d3eaaec36ebb01779b
      2d8d591b
    • Hai Zhang's avatar
      Add missing permission checks for adding permission listeners. · 6a7f3726
      Hai Zhang authored
      They were in the old PermissionManagerServiceImpl but missing in
      ag/20684040. The new subsystem is only enabled in V+ so we can just fix
      it directly.
      
      Also added the permission check for removing despite that the old method
      was only enforcing not instant app, because the removing API is
      annotated with requiring the permission, and anyone currently able to
      add will still remain able to remove since it's the same permission.
      
      Bug: 263504888
      Test: presubmit
      Change-Id: Ie5688abdbc4d9039c3f7c42f3d253e69f7cc899d
      6a7f3726
  17. Sep 12, 2023
  18. Sep 11, 2023
  19. Sep 07, 2023
  20. Sep 05, 2023
  21. Aug 29, 2023
    • Colin Cross's avatar
      Fix more kotlin nullable errors in services.permission · 8bcfcd29
      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
      Merged-In: Ib3358be57d7dd401fd2014ade3e58f9fc6c2b6a7
      Change-Id: I74b2b7570adf025cf8ec3ea105eb06ea22c7d30e
      8bcfcd29
  22. Aug 28, 2023
  23. Aug 24, 2023
  24. Aug 23, 2023
    • Colin Cross's avatar
      Fix kotlin nullable errors in services.permission · 6687a2ca
      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: Iead08db297fa20963df7ee83b19d5ac76d0d4846
      Merged-In: Iead08db297fa20963df7ee83b19d5ac76d0d4846
      6687a2ca
  25. Aug 22, 2023
    • Colin Cross's avatar
      Fix kotlin nullable errors in services.permission · 8583ef80
      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: Iead08db297fa20963df7ee83b19d5ac76d0d4846
      8583ef80
  26. Aug 21, 2023
  27. Aug 18, 2023
  28. Aug 16, 2023
    • Hai Zhang's avatar
      Fix NPE due to SparseArray.remove() without gc(). · 77599805
      Hai Zhang authored
      This is a follow-up to ag/23216745 where we missed one method that is
      removing elements from SparseArray. It is calling remove() instead of
      removeReturnOld() because we don't need the old value and may get
      slightly better performance.
      
      Fixes: 295856715
      Bug: 263504888
      Test: presubmit
      Change-Id: I9ce0a9cc4571b343debfc4f0cfce3ea351f2f1a7
      77599805
  29. Aug 08, 2023
  30. Jul 31, 2023
  31. Jul 27, 2023
  32. Jul 25, 2023
    • Yi-an Chen's avatar
      Prevent some key system applications from losing storage permissions · 462c1d1f
      Yi-an Chen authored
      The storage permissions of some system applications have been authorized by default and cannot be modified by users with SYSTEM_FIXED or POLICY_FIXED flags. Once revoked due to an self-upgrade package, the user cannot re-grant.
      
      Bug: 292732635
      Test: build
      Change-Id: I055ecc6a523f680b411505ed18d90deb0252bf85
      462c1d1f
  33. Jul 21, 2023
    • Jay Thomas Sullivan's avatar
      Only run flaky permissions test in postsubmit (frameworks/base) · 86d4819f
      Jay Thomas Sullivan authored
      Certain tests in these test modules have a flake rate higher than 0.5%,
      which means they are out-of-SLO for Project Ironwood. We've marked them
      as @FlakyTest (in a separate change). But, in this change, we also
      update the TEST_MAPPING files so that don't run any flaky tests
      (i.e., annotated with @FlakyTest) in presubmit, but do run them in
      postsubmit.
      
      Test: Verify tests do not run in presubmit, but do in postsubmit
      Bug: 290240321
      Change-Id: Ia679980a0d8aa7bc9266a3f624ff7279c19a46b3
      86d4819f
  34. Jul 18, 2023
  35. Jul 12, 2023
    • Hai Zhang's avatar
      Add test mapping for new permission code. · 83bdb148
      Hai Zhang authored
      This is a copy of the existing test mapping under pm/permission, and
      does cover a number of scenarios about package updates.
      
      Fixes: 290686675
      Test: presubmit
      Change-Id: I772b2b4f1bdf411675ceaa93059ce6f3e2edbdec
      83bdb148
  36. Jul 10, 2023
Loading