Merge "Allow pickupGestureEnabled default configurable" into tm-qpr-dev am: fb952d5f3c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20665999

Change-Id: I1bcdd4d8e28dd109d95b0a6224b4349505636ac0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Beverly Tai
2022-12-08 23:41:54 +00:00
committed by Automerger Merge Worker
3 changed files with 10 additions and 1 deletions

View File

@@ -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();
}

View File

@@ -2484,6 +2484,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>

View File

@@ -3804,6 +3804,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" />