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