diff options
author | Henrique Silva <jhenrique09.mcz@hotmail.com> | 2019-01-17 21:40:14 -0200 |
---|---|---|
committer | Davide Garberi <dade.garberi@gmail.com> | 2019-02-06 13:56:16 +0100 |
commit | d0c7a757799835dd57ed880d1abc3e41357ade14 (patch) | |
tree | 272f9f16194cd2766b57b491301db64fae0a0394 /doze | |
parent | cdadb841db0307eb0bb66b757f1e7860b1086d6e (diff) |
msm8996-common: 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
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
Diffstat (limited to 'doze')
-rw-r--r-- | doze/src/org/lineageos/settings/doze/Utils.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/doze/src/org/lineageos/settings/doze/Utils.java b/doze/src/org/lineageos/settings/doze/Utils.java index bc7c955..edcb60e 100644 --- a/doze/src/org/lineageos/settings/doze/Utils.java +++ b/doze/src/org/lineageos/settings/doze/Utils.java @@ -99,8 +99,12 @@ public final class Utils { } 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 alwaysOnDisplayAvailable(Context context) { |