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

Commit cccbe885 authored by Zoltan Szatmary-Ban's avatar Zoltan Szatmary-Ban
Browse files

Fix potential NPE on devices without DPMS

Bug: 20563108
Change-Id: Ie2bda65c834ddad9db8753f7616c2754072551cd
parent 78f895a7
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;
            }
        }