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

Commit a4fcb440 authored by Alexandra Gherghina's avatar Alexandra Gherghina
Browse files

Fix two potential NPEs in DeviceInfo

Change-Id: Ic4b5b203af25cda9ae65b477c92c1fb5f31ab093
parent e255d739
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -110,11 +110,11 @@ public class DeviceOwner {
    }

    String getDeviceOwnerPackageName() {
        return mDeviceOwner.packageName;
        return mDeviceOwner != null ? mDeviceOwner.packageName : null;
    }

    String getDeviceOwnerName() {
        return mDeviceOwner.name;
        return mDeviceOwner != null ? mDeviceOwner.name : null;
    }

    void setDeviceOwner(String packageName, String ownerName) {
+1 −1
Original line number Diff line number Diff line
@@ -2828,7 +2828,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            return null;
        }
        synchronized (this) {
            if (mDeviceOwner != null) {
            if (mDeviceOwner != null && mDeviceOwner.hasDeviceOwner()) {
                return mDeviceOwner.getDeviceOwnerPackageName();
            }
        }