|
|
@ -43,6 +43,7 @@ public class SamsungDozeSettings extends PreferenceFragment |
|
|
|
private SwitchPreference mAlwaysOnDisplayPreference; |
|
|
|
private SwitchPreference mAlwaysOnDisplayPreference; |
|
|
|
private SwitchPreference mHandwavePreference; |
|
|
|
private SwitchPreference mHandwavePreference; |
|
|
|
private SwitchPreference mPocketPreference; |
|
|
|
private SwitchPreference mPocketPreference; |
|
|
|
|
|
|
|
private SwitchPreference mWakeOnGesturePreference; |
|
|
|
|
|
|
|
|
|
|
|
private Handler mHandler = new Handler(); |
|
|
|
private Handler mHandler = new Handler(); |
|
|
|
|
|
|
|
|
|
|
@ -67,12 +68,17 @@ public class SamsungDozeSettings extends PreferenceFragment |
|
|
|
mPocketPreference.setEnabled(dozeEnabled); |
|
|
|
mPocketPreference.setEnabled(dozeEnabled); |
|
|
|
mPocketPreference.setOnPreferenceChangeListener(this); |
|
|
|
mPocketPreference.setOnPreferenceChangeListener(this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mWakeOnGesturePreference = (SwitchPreference) findPreference(Utils.WAKE_ON_GESTURE_KEY); |
|
|
|
|
|
|
|
mWakeOnGesturePreference.setEnabled(dozeEnabled); |
|
|
|
|
|
|
|
mWakeOnGesturePreference.setOnPreferenceChangeListener(this); |
|
|
|
|
|
|
|
|
|
|
|
// Hide AOD if not supported and set all its dependents otherwise
|
|
|
|
// Hide AOD if not supported and set all its dependents otherwise
|
|
|
|
if (!Utils.alwaysOnDisplayAvailable(getActivity())) { |
|
|
|
if (!Utils.alwaysOnDisplayAvailable(getActivity())) { |
|
|
|
getPreferenceScreen().removePreference(mAlwaysOnDisplayPreference); |
|
|
|
getPreferenceScreen().removePreference(mAlwaysOnDisplayPreference); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
mHandwavePreference.setDependency(Utils.ALWAYS_ON_DISPLAY); |
|
|
|
mHandwavePreference.setDependency(Utils.ALWAYS_ON_DISPLAY); |
|
|
|
mPocketPreference.setDependency(Utils.ALWAYS_ON_DISPLAY); |
|
|
|
mPocketPreference.setDependency(Utils.ALWAYS_ON_DISPLAY); |
|
|
|
|
|
|
|
mWakeOnGesturePreference.setDependency(Utils.ALWAYS_ON_DISPLAY); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -143,6 +149,7 @@ public class SamsungDozeSettings extends PreferenceFragment |
|
|
|
|
|
|
|
|
|
|
|
mHandwavePreference.setEnabled(isChecked); |
|
|
|
mHandwavePreference.setEnabled(isChecked); |
|
|
|
mPocketPreference.setEnabled(isChecked); |
|
|
|
mPocketPreference.setEnabled(isChecked); |
|
|
|
|
|
|
|
mWakeOnGesturePreference.setEnabled(isChecked); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|