summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy
diff options
context:
space:
mode:
authorSvetoslav <svetoslavganov@google.com>2014-10-14 15:53:14 -0700
committerSvetoslav <svetoslavganov@google.com>2014-10-14 15:53:17 -0700
commit28433dbdabd3f60224131039911a8f1def3fe670 (patch)
treec577f9b8a249eb2e3122fa201112fc4280247096 /services/devicepolicy
parenta89ac60e25eb77b4c605fc1a40c96416b199bea5 (diff)
downloadframeworks_base-28433dbdabd3f60224131039911a8f1def3fe670.zip
frameworks_base-28433dbdabd3f60224131039911a8f1def3fe670.tar.gz
frameworks_base-28433dbdabd3f60224131039911a8f1def3fe670.tar.bz2
Fix a NPE in device policy manager service.
It is possible that the device does not have an owner. If there is no owner we get a NPE when asking the device policy manager for cross-profile widget providers. bug:17989189 Change-Id: I5759f2dec160ed8076ab47fdf09134f78c57458d
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 f8f20dc..a5a622c 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -5320,6 +5320,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
@Override
public List<String> getCrossProfileWidgetProviders(int profileId) {
synchronized (DevicePolicyManagerService.this) {
+ if (mDeviceOwner == null) {
+ return Collections.emptyList();
+ }
ComponentName ownerComponent = mDeviceOwner.getProfileOwnerComponent(profileId);
if (ownerComponent == null) {
return Collections.emptyList();