summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2015-02-11 12:34:08 -0500
committerJulia Reynolds <juliacr@google.com>2015-03-04 17:36:00 -0500
commite925440a551b66a3d3121ec8badaf948d71d66a1 (patch)
treede4d687777ba68b90a63e8ebe7ede03a4f0ea1ec /services/devicepolicy
parentaa7e7318e3bd33dc40792d35ca3a29d8d9ada4a2 (diff)
downloadframeworks_base-e925440a551b66a3d3121ec8badaf948d71d66a1.zip
frameworks_base-e925440a551b66a3d3121ec8badaf948d71d66a1.tar.gz
frameworks_base-e925440a551b66a3d3121ec8badaf948d71d66a1.tar.bz2
DOs can clear the DI; rehide hasUserSetupCompleted.
Bug: 19230954 Change-Id: I97467229b23f3c9be1c3c4fff1c888a812f14a95
Diffstat (limited to 'services/devicepolicy')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java14
1 files changed, 3 insertions, 11 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 6270212..7e7eb2d 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -3947,18 +3947,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
if (packageName == null) {
throw new NullPointerException("packageName is null");
}
- try {
- int uid = mContext.getPackageManager().getPackageUid(packageName, 0);
- if (uid != Binder.getCallingUid()) {
- throw new SecurityException(
- "clearDeviceInitializer can only be called by the device initializer");
- }
- } catch (NameNotFoundException e) {
- throw new SecurityException(e);
- }
- if (!isDeviceInitializer(packageName)) {
+
+ if (!isDeviceInitializer(packageName) && !isDeviceOwner(packageName)) {
throw new SecurityException(
- "clearDeviceInitializer can only be called by the device initializer");
+ "clearDeviceInitializer can only be called by the device initializer/owner");
}
synchronized (this) {
long ident = Binder.clearCallingIdentity();