* 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
}
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(),
- 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) {