diff options
author | Jason Monk <jmonk@google.com> | 2014-05-16 14:56:17 -0400 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2014-05-16 14:56:57 -0400 |
commit | 9fcff5aadd48206235d205c30cbdae47fc586e3b (patch) | |
tree | 0b14696c618bf900a5be6e1c082ae4b33b0325fd /services | |
parent | 9d08a93b2dd378cdb66c35a1230d19f894481eab (diff) | |
download | frameworks_base-9fcff5aadd48206235d205c30cbdae47fc586e3b.zip frameworks_base-9fcff5aadd48206235d205c30cbdae47fc586e3b.tar.gz frameworks_base-9fcff5aadd48206235d205c30cbdae47fc586e3b.tar.bz2 |
Fix NPE in DevicePolicyManagerService
Bug: 15015897
Change-Id: Id9f6ae8b5abf96d35f799b150210813fb52da54c
Diffstat (limited to 'services')
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 24 |
1 files changed, 13 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 a0c59cc..edbbc9f 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -1214,18 +1214,20 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } mAppOpsService = IAppOpsService.Stub.asInterface( ServiceManager.getService(Context.APP_OPS_SERVICE)); - if (mDeviceOwner.hasDeviceOwner()) { - try { - mAppOpsService.setDeviceOwner(mDeviceOwner.getDeviceOwnerPackageName()); - } catch (RemoteException e) { - Log.w(LOG_TAG, "Unable to notify AppOpsService of DeviceOwner", e); + if (mDeviceOwner != null) { + if (mDeviceOwner.hasDeviceOwner()) { + try { + mAppOpsService.setDeviceOwner(mDeviceOwner.getDeviceOwnerPackageName()); + } catch (RemoteException e) { + Log.w(LOG_TAG, "Unable to notify AppOpsService of DeviceOwner", e); + } } - } - for (Integer i : mDeviceOwner.getProfileOwnerKeys()) { - try { - mAppOpsService.setProfileOwner(mDeviceOwner.getProfileOwnerName(i), i); - } catch (RemoteException e) { - Log.w(LOG_TAG, "Unable to notify AppOpsService of ProfileOwner", e); + for (Integer i : mDeviceOwner.getProfileOwnerKeys()) { + try { + mAppOpsService.setProfileOwner(mDeviceOwner.getProfileOwnerName(i), i); + } catch (RemoteException e) { + Log.w(LOG_TAG, "Unable to notify AppOpsService of ProfileOwner", e); + } } } } |