diff options
author | Zoltan Szatmary-Ban <szatmz@google.com> | 2015-04-30 15:20:27 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-04-30 15:20:27 +0000 |
commit | 2aab6de5a8370833077c3d58a64e615c33e52e0f (patch) | |
tree | 8708e58e091bb26c4422d98972836d95954729ea /services/core/java/com | |
parent | f225e6c6af849f965eec8392204b2491f17babac (diff) | |
parent | 795ec67721c565ffa15a4c283428227c954e7a5f (diff) | |
download | frameworks_base-2aab6de5a8370833077c3d58a64e615c33e52e0f.zip frameworks_base-2aab6de5a8370833077c3d58a64e615c33e52e0f.tar.gz frameworks_base-2aab6de5a8370833077c3d58a64e615c33e52e0f.tar.bz2 |
am 795ec677: am 780a9b9e: Merge "Fix potential NPE on devices without DPMS" into mnc-dev
* commit '795ec67721c565ffa15a4c283428227c954e7a5f':
Fix potential NPE on devices without DPMS
Diffstat (limited to 'services/core/java/com')
-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; } } |