samsung: doze: Fix AoD default pref

* Fixes non-working pulse notifications from sensors until user toggles
  the main switch and also sets the proper initial status of the
  AoD preference for the devices that have the feature available.

Signed-off-by: Henrique Silva <jhenrique09.mcz@hotmail.com>
Change-Id: I8e554decca3734b165fdc722d904d90713666db9
tirimbino
Henrique Silva 6 years ago committed by Bruno Martins
parent 9a527bab46
commit 9eae563ab3
  1. 6
      doze/src/org/lineageos/settings/doze/Utils.java

@ -65,8 +65,12 @@ public final class Utils {
} }
protected static boolean isAlwaysOnEnabled(Context context) { protected static boolean isAlwaysOnEnabled(Context context) {
final boolean enabledByDefault = context.getResources()
.getBoolean(com.android.internal.R.bool.config_dozeAlwaysOnEnabled);
return Settings.Secure.getIntForUser(context.getContentResolver(), return Settings.Secure.getIntForUser(context.getContentResolver(),
DOZE_ALWAYS_ON, 1, UserHandle.USER_CURRENT) != 0; DOZE_ALWAYS_ON, alwaysOnDisplayAvailable(context) && enabledByDefault ? 1 : 0,
UserHandle.USER_CURRENT) != 0;
} }
protected static boolean isDozeEnabled(Context context) { protected static boolean isDozeEnabled(Context context) {

Loading…
Cancel
Save