<SwitchPreference
android:key="always_on_display"
- android:defaultValue="false"
android:disableDependentsState="true"
android:title="@string/ambient_display_always_on_title"
- android:summary="@string/ambient_display_always_on_summary" />
+ android:summary="@string/ambient_display_always_on_summary"
+ android:persistent="false" />
<PreferenceCategory
android:key="proximity_sensor"
mAlwaysOnDisplayPreference = findPreference(Utils.ALWAYS_ON_DISPLAY);
mAlwaysOnDisplayPreference.setEnabled(dozeEnabled);
+ mAlwaysOnDisplayPreference.setChecked(Utils.isAlwaysOnEnabled(getActivity()));
mAlwaysOnDisplayPreference.setOnPreferenceChangeListener(this);
mHandwavePreference = findPreference(Utils.GESTURE_HAND_WAVE_KEY);
return new AmbientDisplayConfiguration(context).alwaysOnAvailable();
}
- private static boolean isAlwaysOnEnabled(Context context) {
+ protected static boolean isAlwaysOnEnabled(Context context) {
return Settings.Secure.getIntForUser(context.getContentResolver(),
DOZE_ALWAYS_ON, 1, UserHandle.USER_CURRENT) != 0;
}