summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy
diff options
context:
space:
mode:
authorBenjamin Franz <bfranz@google.com>2015-01-26 10:49:47 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-01-26 10:49:48 +0000
commit6d16b8614ac4c5aa44304e6fdcb9ed8aeec675fd (patch)
tree167c83ccd328b50c6c09340133d37fda26f721c4 /services/devicepolicy
parent414ea81ea364d7b961cbfb885c30729595e3a7b2 (diff)
parentf87b174dac87ed9e95e8522bfb836707f4a2239d (diff)
downloadframeworks_base-6d16b8614ac4c5aa44304e6fdcb9ed8aeec675fd.zip
frameworks_base-6d16b8614ac4c5aa44304e6fdcb9ed8aeec675fd.tar.gz
frameworks_base-6d16b8614ac4c5aa44304e6fdcb9ed8aeec675fd.tar.bz2
Merge "Avoid NullPointerException if createUser returns null" into lmp-mr1-dev
Diffstat (limited to 'services/devicepolicy')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index c52b571..fd4c016 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -4734,6 +4734,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
public UserHandle createAndInitializeUser(ComponentName who, String name,
String ownerName, ComponentName profileOwnerComponent, Bundle adminExtras) {
UserHandle user = createUser(who, name);
+ if (user == null) {
+ return null;
+ }
long id = Binder.clearCallingIdentity();
try {
String profileOwnerPkg = profileOwnerComponent.getPackageName();