Fix cross user app visibility gap for setPackagesSuspended
Since DO/POs are privileged components, the implementation in DPM
would invoke PM#setPackageSudpended 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.
Bug: 229684723
Bug: 239945013
Test: CtsSuspendAppsTestCases
Test: CtsAppEnumerationTestCases:CrossUserPackageVisibilityTests
Test: CtsDevicePolicyManagerTestCases:MixedDeviceOwnerTest
#testSuspendPackageWithPackageManager
Test: manually using the PoC in the buganizer to ensure the symptom
no longer exists.
Change-Id: I04775ee1a5870fd7b1284c49cc5739bf88fbcfd4
Loading
Please register or sign in to comment