AmbientDisplay: Add always on prototype
Test: adb shell settings put secure doze_always_on 1
Change-Id: I3f293b3ef43847b7848af416b44f212fc40514d4
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java
index 9e9bdd7..0e074c7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/DozeParameters.java
@@ -17,20 +17,17 @@
package com.android.systemui.statusbar.phone;
import android.content.Context;
+import android.os.Build;
import android.os.SystemProperties;
import android.os.UserHandle;
+import android.provider.Settings;
import android.text.TextUtils;
-import android.util.Log;
import android.util.MathUtils;
import android.util.SparseBooleanArray;
-import com.android.internal.hardware.AmbientDisplayConfiguration;
import com.android.systemui.R;
import java.io.PrintWriter;
-import java.util.Arrays;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
public class DozeParameters {
private static final int MAX_DURATION = 60 * 1000;
@@ -115,6 +112,12 @@
return getInt("doze.pickup.vibration.threshold", R.integer.doze_pickup_vibration_threshold);
}
+ public boolean getAlwaysOn() {
+ return Build.IS_DEBUGGABLE
+ && Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.DOZE_ALWAYS_ON, 0, UserHandle.USER_CURRENT) != 0;
+ }
+
private boolean getBoolean(String propName, int resId) {
return SystemProperties.getBoolean(propName, mContext.getResources().getBoolean(resId));
}