Merge "Default to enable oem-unlocking preference" into qt-dev am: c82a225c6f

am: 36c5e429fb

Change-Id: I2a9515be227a45aa683709fdfb8393dad81c1dcd
This commit is contained in:
Mill Chen
2019-04-17 10:36:14 -07:00
committed by android-build-merger
2 changed files with 20 additions and 14 deletions

View File

@@ -21,13 +21,12 @@ import static com.android.settings.development.DevelopmentOptionsActivityRequest
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.os.Build;
import android.os.UserHandle;
import android.os.UserManager;
import android.service.oemlock.OemLockManager;
import android.telephony.TelephonyManager;
import android.util.Log;
import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
@@ -56,15 +55,11 @@ public class OemUnlockPreferenceController extends DeveloperOptionsPreferenceCon
DevelopmentSettingsDashboardFragment fragment) {
super(context);
if (context.getPackageManager().hasSystemFeature(PackageManager
.FEATURE_TELEPHONY_CARRIERLOCK)) {
mOemLockManager = (OemLockManager) context.getSystemService(Context.OEM_LOCK_SERVICE);
} else {
if (Build.IS_EMULATOR && Build.IS_ENG) {
mOemLockManager = null;
Log.i(TAG, "Missing FEATURE_TELEPHONY_CARRIERLOCK, OemUnlock Preference" +
" Controller disabled.");
} else {
mOemLockManager = (OemLockManager) context.getSystemService(Context.OEM_LOCK_SERVICE);
}
mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
mFragment = fragment;