Test: cts-tradefed run cts --module DevicePolicyManager --test com.android.cts.devicepolicy.ManagedProfileTest#testAppLinks_enabledStatus
Bug:
32695379
Change-Id: I0fa22f50f1aa344195b7c6bc1e6ee97879d91c46
}
synchronized (mPackages) {
- if (uid == Process.SHELL_UID) {
+ if (uid == Process.SHELL_UID
+ && (pkgSetting.pkgFlags & ApplicationInfo.FLAG_TEST_ONLY) == 0) {
// Shell can only change whole packages between ENABLED and DISABLED_USER states
+ // unless it is a test package.
int oldState = pkgSetting.getEnabled(userId);
if (className == null
&&