diff options
author | Zoltan Szatmary-Ban <szatmz@google.com> | 2015-04-30 09:48:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-30 09:48:36 +0000 |
commit | 780a9b9e12228402144f5c88917875c9da226cbf (patch) | |
tree | 65ebc65011ee8994eb4b0eb462ab7deab94339d9 /services | |
parent | dc4ad271f931eca48ab8ef22ef76db740d179d99 (diff) | |
parent | cccbe885b94f2dca088c01b2f38addac3054c402 (diff) | |
download | frameworks_base-780a9b9e12228402144f5c88917875c9da226cbf.zip frameworks_base-780a9b9e12228402144f5c88917875c9da226cbf.tar.gz frameworks_base-780a9b9e12228402144f5c88917875c9da226cbf.tar.bz2 |
Merge "Fix potential NPE on devices without DPMS" into mnc-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/net/NetworkStatsService.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/net/NetworkStatsService.java b/services/core/java/com/android/server/net/NetworkStatsService.java index 50e03a2..0035d01 100644 --- a/services/core/java/com/android/server/net/NetworkStatsService.java +++ b/services/core/java/com/android/server/net/NetworkStatsService.java @@ -561,9 +561,10 @@ public class NetworkStatsService extends INetworkStatsService.Stub { final int callingUid = Binder.getCallingUid(); final DevicePolicyManagerInternal dpmi = LocalServices.getService( DevicePolicyManagerInternal.class); - if (dpmi.isActiveAdminWithPolicy(callingUid, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER) - || dpmi.isActiveAdminWithPolicy(callingUid, - DeviceAdminInfo.USES_POLICY_DEVICE_OWNER)) { + + // Device owners are also profile owners so it is enough to check for that. + if (dpmi != null && dpmi.isActiveAdminWithPolicy(callingUid, + DeviceAdminInfo.USES_POLICY_PROFILE_OWNER)) { return; } } |