summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy/java
diff options
context:
space:
mode:
authorKenny Guy <kennyguy@google.com>2014-06-05 16:51:24 +0100
committerKenny Guy <kennyguy@google.com>2014-06-05 18:10:43 +0100
commit73a41d2c4e4184504959628ae5536a7e862e0f67 (patch)
tree5228a6b4e1b3866f618a5a0fe0dfb657bce005ee /services/devicepolicy/java
parent585fc71ea71e594b179bf53522f6201b3858f91c (diff)
downloadframeworks_base-73a41d2c4e4184504959628ae5536a7e862e0f67.zip
frameworks_base-73a41d2c4e4184504959628ae5536a7e862e0f67.tar.gz
frameworks_base-73a41d2c4e4184504959628ae5536a7e862e0f67.tar.bz2
Fix bug with sending intents to correct user for device admin.
Password change intents etc. were always being sent to owner rather than user the device admin was installed for. Also add TODO to not assume profile parent is OWNER. Bug: 15442331 Change-Id: I7e58069bc4a6ab94f038ae1b80c044d666986318
Diffstat (limited to 'services/devicepolicy/java')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 043fab4..7381e5e 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -840,7 +840,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
mContext.sendOrderedBroadcastAsUser(intent, admin.getUserHandle(),
null, result, mHandler, Activity.RESULT_OK, null, null);
} else {
- mContext.sendBroadcastAsUser(intent, UserHandle.OWNER);
+ mContext.sendBroadcastAsUser(intent, admin.getUserHandle());
}
}
@@ -3123,6 +3123,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
intent.putExtra(Intent.EXTRA_USER, new UserHandle(UserHandle.getCallingUserId()));
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY |
Intent.FLAG_RECEIVER_FOREGROUND);
+ // TODO This should send to parent of profile (which is always owner at the moment).
mContext.sendBroadcastAsUser(intent, UserHandle.OWNER);
} finally {
restoreCallingIdentity(id);