Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 30554003 authored by Jackal Guo's avatar Jackal Guo
Browse files

Fix cross user app visibility gap for setApplicationHidden

Since DO/POs are privileged components, the implementation in DPM
would invoke PM#setApplicationHidden with #clearCallingIdentity.
However, the check in #getPackageStateForInstalledAndFiltered by-
passes system, shell, and root UID. This makes the check invalid,
and results in cross user app visibility gap. Apply the install
state check manually to mitigate this. Besides, this CL makes the
return early if the hidden state is unchanged.

Bug: 229684723
Bug: 239945013
Test: CtsDevicePolicyManagerTestCases:ManagedProfileCrossProfileTest
Test: FrameworksServicesTests:DevicePolicyManagerTest#
        testSetApplicationHiddenWithDO
        testSetApplicationHiddenWithPOOfOrganizationOwnedDevice
        testSetApplicationHidden_failIfNotDeviceOrProfileOwner
Test: SettingsLibTests:
        AppRestrictionsHelperTest#testApplyUserAppsStates
        AppCopyingHelperTest#testInstallSelectedApps
Test: manually using the PoC in the buganizer to ensure the symptom
      no longer exists.

Change-Id: I5f6040e622f6dfc6c10a6bdfb7d37e30fdf3c3f1
parent 9bfd66eb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment