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

Commit 8337ad3b authored by Jason Monk's avatar Jason Monk
Browse files

Fix dev settings crash when no OEM unlock service

Test: Open dev settings, no crash
Change-Id: I028c52ee58d7262e9fbd015289d7848b397c82e3
parent 7a65c7f2
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -402,7 +402,9 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
        mBackupManager = IBackupManager.Stub.asInterface(
                ServiceManager.getService(Context.BACKUP_SERVICE));
        mWebViewUpdateService = WebViewFactory.getUpdateService();
        if (showEnableOemUnlockPreference(getContext())) {
            mOemLockManager = (OemLockManager) getSystemService(Context.OEM_LOCK_SERVICE);
        }
        mTelephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);

        mUm = (UserManager) getSystemService(Context.USER_SERVICE);
@@ -1066,7 +1068,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
    }

    private static boolean showEnableOemUnlockPreference(Context context) {
        return context.getSystemService(Context.OEM_LOCK_SERVICE) != null;
        return ServiceManager.getService(Context.OEM_LOCK_SERVICE) != null;
    }

    /**