Use explicit APIs to get device owner information
Bug 24676413 Change-Id: Id346c2f01658173c9671edcfd34bc33f1b25faa4
This commit is contained in:
@@ -206,6 +206,9 @@ public class InstalledAppDetails extends AppInfoBase
|
||||
enabled = false;
|
||||
}
|
||||
|
||||
// We don't allow uninstalling DO/PO on *any* users, because if it's a system app,
|
||||
// "uninstall" is actually "downgrade to the system version + disable", and "downgrade"
|
||||
// will clear data on all users.
|
||||
if (isProfileOrDeviceOwner(mPackageInfo.packageName)) {
|
||||
enabled = false;
|
||||
}
|
||||
@@ -250,7 +253,7 @@ public class InstalledAppDetails extends AppInfoBase
|
||||
List<UserInfo> userInfos = mUserManager.getUsers();
|
||||
DevicePolicyManager dpm = (DevicePolicyManager)
|
||||
getContext().getSystemService(Context.DEVICE_POLICY_SERVICE);
|
||||
if (packageName.equals(dpm.getDeviceOwner())) {
|
||||
if (dpm.isDeviceOwnerAppOnAnyUser(packageName)) {
|
||||
return true;
|
||||
}
|
||||
for (UserInfo userInfo : userInfos) {
|
||||
|
Reference in New Issue
Block a user