Merge "Settings: Add laser sensor preference" into oc-mr1-dev am: 22eb007eea

am: 11179290a2

Change-Id: I0575553117ca62c027a82aa69ecc0c1865f6c762
This commit is contained in:
Emilian Peev
2017-09-13 09:52:30 +00:00
committed by android-build-merger
6 changed files with 299 additions and 0 deletions

View File

@@ -332,6 +332,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
private BugReportInPowerPreferenceController mBugReportInPowerController;
private TelephonyMonitorPreferenceController mTelephonyMonitorController;
private CameraHalHdrplusPreferenceController mCameraHalHdrplusController;
private CameraLaserSensorPreferenceController mCameraLaserSensorController;
private BroadcastReceiver mEnableAdbReceiver;
@@ -379,6 +380,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
mWebViewAppPrefController = new WebViewAppPreferenceController(getActivity());
mVerifyAppsOverUsbController = new VerifyAppsOverUsbPreferenceController(getActivity());
mCameraHalHdrplusController = new CameraHalHdrplusPreferenceController(getActivity());
mCameraLaserSensorController = new CameraLaserSensorPreferenceController(getActivity());
setIfOnlyAvailableForAdmins(true);
if (isUiRestricted() || !Utils.isDeviceProvisioned(getActivity())) {
@@ -417,6 +419,8 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
mCameraHalHdrplusController.displayPreference(preferenceScreen);
mEnableAdbController.displayPreference(preferenceScreen);
mCameraLaserSensorController.displayPreference(getPreferenceScreen());
mKeepScreenOn = (RestrictedSwitchPreference) findAndInitSwitchPref(KEEP_SCREEN_ON);
mBtHciSnoopLog = findAndInitSwitchPref(BT_HCI_SNOOP_LOG);
mEnableOemUnlock = (RestrictedSwitchPreference) findAndInitSwitchPref(ENABLE_OEM_UNLOCK);
@@ -625,6 +629,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
mLogpersistController.enablePreference(enabled);
mWebViewAppPrefController.enablePreference(enabled);
mCameraHalHdrplusController.enablePreference(enabled);
mCameraLaserSensorController.enablePreference(enabled);
updateAllOptions();
}
@@ -771,6 +776,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
mHaveDebugSettings |= mBugReportInPowerController.updatePreference();
mHaveDebugSettings |= mTelephonyMonitorController.updatePreference();
mHaveDebugSettings |= mCameraHalHdrplusController.updatePreference();
mHaveDebugSettings |= mCameraLaserSensorController.updatePreference();
updateSwitchPreference(mKeepScreenOn, Settings.Global.getInt(cr,
Settings.Global.STAY_ON_WHILE_PLUGGED_IN, 0) != 0);
updateSwitchPreference(mBtHciSnoopLog, SystemProperties.getBoolean(
@@ -2224,6 +2230,10 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
return true;
}
if (mCameraLaserSensorController.handlePreferenceTreeClick(preference)) {
return true;
}
if (preference == mClearAdbKeys) {
if (mAdbKeysDialog != null) dismissDialogs();
mAdbKeysDialog = new AlertDialog.Builder(getActivity())