Merge "Fix dev settings crash when no OEM unlock service"
diff --git a/src/com/android/settings/development/DevelopmentSettings.java b/src/com/android/settings/development/DevelopmentSettings.java
index 62f285f..40c827b 100644
--- a/src/com/android/settings/development/DevelopmentSettings.java
+++ b/src/com/android/settings/development/DevelopmentSettings.java
@@ -402,7 +402,9 @@
mBackupManager = IBackupManager.Stub.asInterface(
ServiceManager.getService(Context.BACKUP_SERVICE));
mWebViewUpdateService = WebViewFactory.getUpdateService();
- mOemLockManager = (OemLockManager) getSystemService(Context.OEM_LOCK_SERVICE);
+ 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 @@
}
private static boolean showEnableOemUnlockPreference(Context context) {
- return context.getSystemService(Context.OEM_LOCK_SERVICE) != null;
+ return ServiceManager.getService(Context.OEM_LOCK_SERVICE) != null;
}
/**