Merge "Avoid NullPointerException if createUser returns null" into lmp-mr1-dev

This commit is contained in:
Benjamin Franz
2015-01-26 10:49:47 +00:00
committed by Android (Google) Code Review

View File

@@ -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();