Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 780a9b9e authored by Zoltan Szatmary-Ban's avatar Zoltan Szatmary-Ban Committed by Android (Google) Code Review
Browse files

Merge "Fix potential NPE on devices without DPMS" into mnc-dev

parents dc4ad271 cccbe885
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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;
            }
        }