Allow pickupGestureEnabled default configurable
Overlays can override the default enabled behavior. Fixes: 256185823 Test: manual Change-Id: I57f5f80647f52a9006fcaa66252c096f9883c7ba
This commit is contained in:
@@ -40,6 +40,7 @@ public class AmbientDisplayConfiguration {
|
||||
private static final String TAG = "AmbientDisplayConfig";
|
||||
private final Context mContext;
|
||||
private final boolean mAlwaysOnByDefault;
|
||||
private final boolean mPickupGestureEnabledByDefault;
|
||||
|
||||
/** Copied from android.provider.Settings.Secure since these keys are hidden. */
|
||||
private static final String[] DOZE_SETTINGS = {
|
||||
@@ -65,6 +66,8 @@ public class AmbientDisplayConfiguration {
|
||||
public AmbientDisplayConfiguration(Context context) {
|
||||
mContext = context;
|
||||
mAlwaysOnByDefault = mContext.getResources().getBoolean(R.bool.config_dozeAlwaysOnEnabled);
|
||||
mPickupGestureEnabledByDefault =
|
||||
mContext.getResources().getBoolean(R.bool.config_dozePickupGestureEnabled);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@@ -95,7 +98,8 @@ public class AmbientDisplayConfiguration {
|
||||
|
||||
/** @hide */
|
||||
public boolean pickupGestureEnabled(int user) {
|
||||
return boolSettingDefaultOn(Settings.Secure.DOZE_PICK_UP_GESTURE, user)
|
||||
return boolSetting(Settings.Secure.DOZE_PICK_UP_GESTURE, user,
|
||||
mPickupGestureEnabledByDefault ? 1 : 0)
|
||||
&& dozePickupSensorAvailable();
|
||||
}
|
||||
|
||||
|
||||
@@ -2543,6 +2543,10 @@
|
||||
states. -->
|
||||
<bool name="config_dozeAlwaysOnDisplayAvailable">false</bool>
|
||||
|
||||
<!-- Control whether the pickup gesture is enabled by default. This value will be used
|
||||
during initialization when the setting is still null. -->
|
||||
<bool name="config_dozePickupGestureEnabled">true</bool>
|
||||
|
||||
<!-- Control whether the always on display mode is enabled by default. This value will be used
|
||||
during initialization when the setting is still null. -->
|
||||
<bool name="config_dozeAlwaysOnEnabled">true</bool>
|
||||
|
||||
@@ -3814,6 +3814,7 @@
|
||||
<java-symbol type="string" name="config_cameraShutterSound" />
|
||||
<java-symbol type="integer" name="config_autoGroupAtCount" />
|
||||
<java-symbol type="bool" name="config_dozeAlwaysOnDisplayAvailable" />
|
||||
<java-symbol type="bool" name="config_dozePickupGestureEnabled" />
|
||||
<java-symbol type="bool" name="config_dozeAlwaysOnEnabled" />
|
||||
<java-symbol type="bool" name="config_dozeSupportsAodWallpaper" />
|
||||
<java-symbol type="bool" name="config_displayBlanksAfterDoze" />
|
||||
|
||||
Reference in New Issue
Block a user