From 6ef1b59021135de776317ee981f5882bf8e3d0d2 Mon Sep 17 00:00:00 2001 From: Will Date: Thu, 5 May 2022 14:13:46 -0700 Subject: [PATCH] Add a config for "wake screen on notifications". This config value controls whether the "wake screen on notifications" setting and functionality are available on a given device. By default the value is "true", which means that there will be no change to any current functionality. Test: manually by checking that the "wake screen on notifications" setting is still present in Settings, and the screen does wake up when a notification arrives and this setting is enabled. Bug: 231246919 Change-Id: I37f09fd3bcb820cbfa763bc8aa942924683cf9fb --- .../android/hardware/display/AmbientDisplayConfiguration.java | 3 ++- core/res/res/values/config.xml | 3 +++ core/res/res/values/symbols.xml | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/java/android/hardware/display/AmbientDisplayConfiguration.java b/core/java/android/hardware/display/AmbientDisplayConfiguration.java index 7d8f2ff92200a..8c71b363eb7bd 100644 --- a/core/java/android/hardware/display/AmbientDisplayConfiguration.java +++ b/core/java/android/hardware/display/AmbientDisplayConfiguration.java @@ -89,7 +89,8 @@ public class AmbientDisplayConfiguration { /** @hide */ public boolean pulseOnNotificationAvailable() { - return ambientDisplayAvailable(); + return mContext.getResources().getBoolean(R.bool.config_pulseOnNotificationsAvailable) + && ambientDisplayAvailable(); } /** @hide */ diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 08c407bdffb2b..264812ad5a641 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -5824,4 +5824,7 @@ "com.android.phone" + + + true diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml index 4174fe6005810..534c5840aa358 100644 --- a/core/res/res/values/symbols.xml +++ b/core/res/res/values/symbols.xml @@ -3337,6 +3337,7 @@ +