Loading res/xml/development_prefs.xml +4 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ --> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" android:title="@string/development_settings_title"> <com.android.settings.BugreportPreference android:key="bugreport" Loading @@ -32,10 +33,11 @@ android:targetClass="com.android.settings.SetFullBackupPassword" /> </PreferenceScreen> <SwitchPreference <com.android.settingslib.RestrictedSwitchPreference android:key="keep_screen_on" android:title="@string/keep_screen_on" android:summary="@string/keep_screen_on_summary"/> android:summary="@string/keep_screen_on_summary" settings:useAdditionalSummary="true" /> <ListPreference android:key="hdcp_checking" Loading src/com/android/settings/DevelopmentSettings.java +15 −9 Original line number Diff line number Diff line Loading @@ -84,6 +84,9 @@ import com.android.settings.fuelgauge.InactiveApps; import com.android.settings.search.BaseSearchIndexProvider; import com.android.settings.search.Indexable; import com.android.settings.widget.SwitchBar; import com.android.settingslib.RestrictedLockUtils; import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin; import com.android.settingslib.RestrictedSwitchPreference; import java.util.ArrayList; import java.util.Arrays; Loading Loading @@ -232,7 +235,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment private SwitchPreference mEnableTerminal; private Preference mBugreport; private SwitchPreference mBugreportInPower; private SwitchPreference mKeepScreenOn; private RestrictedSwitchPreference mKeepScreenOn; private SwitchPreference mBtHciSnoopLog; private SwitchPreference mEnableOemUnlock; private SwitchPreference mDebugViewAttributes; Loading Loading @@ -364,7 +367,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment mBugreport = findPreference(BUGREPORT); mBugreportInPower = findAndInitSwitchPref(BUGREPORT_IN_POWER_KEY); mKeepScreenOn = findAndInitSwitchPref(KEEP_SCREEN_ON); mKeepScreenOn = (RestrictedSwitchPreference) findAndInitSwitchPref(KEEP_SCREEN_ON); mBtHciSnoopLog = findAndInitSwitchPref(BT_HCI_SNOOP_LOG); mEnableOemUnlock = findAndInitSwitchPref(ENABLE_OEM_UNLOCK); if (!showEnableOemUnlockPreference()) { Loading Loading @@ -562,14 +565,17 @@ public class DevelopmentSettings extends RestrictedSettingsFragment return; } if (mDpm.getMaximumTimeToLockForUserAndProfiles(UserHandle.myUserId()) > 0) { // A DeviceAdmin has specified a maximum time until the device // will lock... in this case we can't allow the user to turn // on "stay awake when plugged in" because that would defeat the // restriction. mDisabledPrefs.add(mKeepScreenOn); } else { final EnforcedAdmin admin = RestrictedLockUtils.checkIfMaximumTimeToLockIsSet( getActivity()); mKeepScreenOn.setDisabledByAdmin(admin); if (admin == null) { mDisabledPrefs.remove(mKeepScreenOn); } else { mDisabledPrefs.add(mKeepScreenOn); } final ContentResolver cr = getActivity().getContentResolver(); Loading Loading
res/xml/development_prefs.xml +4 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ --> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" xmlns:settings="http://schemas.android.com/apk/res/com.android.settings" android:title="@string/development_settings_title"> <com.android.settings.BugreportPreference android:key="bugreport" Loading @@ -32,10 +33,11 @@ android:targetClass="com.android.settings.SetFullBackupPassword" /> </PreferenceScreen> <SwitchPreference <com.android.settingslib.RestrictedSwitchPreference android:key="keep_screen_on" android:title="@string/keep_screen_on" android:summary="@string/keep_screen_on_summary"/> android:summary="@string/keep_screen_on_summary" settings:useAdditionalSummary="true" /> <ListPreference android:key="hdcp_checking" Loading
src/com/android/settings/DevelopmentSettings.java +15 −9 Original line number Diff line number Diff line Loading @@ -84,6 +84,9 @@ import com.android.settings.fuelgauge.InactiveApps; import com.android.settings.search.BaseSearchIndexProvider; import com.android.settings.search.Indexable; import com.android.settings.widget.SwitchBar; import com.android.settingslib.RestrictedLockUtils; import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin; import com.android.settingslib.RestrictedSwitchPreference; import java.util.ArrayList; import java.util.Arrays; Loading Loading @@ -232,7 +235,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment private SwitchPreference mEnableTerminal; private Preference mBugreport; private SwitchPreference mBugreportInPower; private SwitchPreference mKeepScreenOn; private RestrictedSwitchPreference mKeepScreenOn; private SwitchPreference mBtHciSnoopLog; private SwitchPreference mEnableOemUnlock; private SwitchPreference mDebugViewAttributes; Loading Loading @@ -364,7 +367,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment mBugreport = findPreference(BUGREPORT); mBugreportInPower = findAndInitSwitchPref(BUGREPORT_IN_POWER_KEY); mKeepScreenOn = findAndInitSwitchPref(KEEP_SCREEN_ON); mKeepScreenOn = (RestrictedSwitchPreference) findAndInitSwitchPref(KEEP_SCREEN_ON); mBtHciSnoopLog = findAndInitSwitchPref(BT_HCI_SNOOP_LOG); mEnableOemUnlock = findAndInitSwitchPref(ENABLE_OEM_UNLOCK); if (!showEnableOemUnlockPreference()) { Loading Loading @@ -562,14 +565,17 @@ public class DevelopmentSettings extends RestrictedSettingsFragment return; } if (mDpm.getMaximumTimeToLockForUserAndProfiles(UserHandle.myUserId()) > 0) { // A DeviceAdmin has specified a maximum time until the device // will lock... in this case we can't allow the user to turn // on "stay awake when plugged in" because that would defeat the // restriction. mDisabledPrefs.add(mKeepScreenOn); } else { final EnforcedAdmin admin = RestrictedLockUtils.checkIfMaximumTimeToLockIsSet( getActivity()); mKeepScreenOn.setDisabledByAdmin(admin); if (admin == null) { mDisabledPrefs.remove(mKeepScreenOn); } else { mDisabledPrefs.add(mKeepScreenOn); } final ContentResolver cr = getActivity().getContentResolver(); Loading