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
Loading
Please register or sign in to comment