Add knobs for tweaking blocking helper thresholds
Added both blocking helper parameters to Global Settings to allow for
tweaking stats/values. Added listeners for value updates (so that
channels are updated properly with new thresholds).
Bug: 77143005
Test: manually, test cases
Change-Id: Ia5cfb29ca40500a694261bd5e9e60fa1f34e742a
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index f2d4542..a5f6c9d 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -12420,7 +12420,7 @@
*/
public static final String MULTI_SIM_SMS_SUBSCRIPTION = "multi_sim_sms";
- /**
+ /**
* Used to provide option to user to select subscription during send SMS.
* The value 1 - enable, 0 - disable
* @hide
@@ -12562,6 +12562,28 @@
"notification_snooze_options";
/**
+ * Settings key for the ratio of notification dismissals to notification views - one of the
+ * criteria for showing the notification blocking helper.
+ *
+ * <p>The value is a float ranging from 0.0 to 1.0 (the closer to 0.0, the more intrusive
+ * the blocking helper will be).
+ *
+ * @hide
+ */
+ public static final String BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT =
+ "blocking_helper_dismiss_to_view_ratio";
+
+ /**
+ * Settings key for the longest streak of dismissals - one of the criteria for showing the
+ * notification blocking helper.
+ *
+ * <p>The value is an integer greater than 0.
+ *
+ * @hide
+ */
+ public static final String BLOCKING_HELPER_STREAK_LIMIT = "blocking_helper_streak_limit";
+
+ /**
* Configuration flags for SQLite Compatibility WAL. Encoded as a key-value list, separated
* by commas. E.g.: compatibility_wal_supported=true, wal_syncmode=OFF
*
diff --git a/core/java/android/service/notification/NotificationAssistantService.java b/core/java/android/service/notification/NotificationAssistantService.java
index 8e52bfa..18e0ab0 100644
--- a/core/java/android/service/notification/NotificationAssistantService.java
+++ b/core/java/android/service/notification/NotificationAssistantService.java
@@ -48,7 +48,10 @@
public static final String SERVICE_INTERFACE
= "android.service.notification.NotificationAssistantService";
- private Handler mHandler;
+ /**
+ * @hide
+ */
+ protected Handler mHandler;
@Override
protected void attachBaseContext(Context base) {
diff --git a/core/tests/coretests/src/android/provider/SettingsBackupTest.java b/core/tests/coretests/src/android/provider/SettingsBackupTest.java
index dafd475..e9e6cb6 100644
--- a/core/tests/coretests/src/android/provider/SettingsBackupTest.java
+++ b/core/tests/coretests/src/android/provider/SettingsBackupTest.java
@@ -131,6 +131,8 @@
Settings.Global.BLE_SCAN_LOW_LATENCY_WINDOW_MS,
Settings.Global.BLE_SCAN_LOW_LATENCY_INTERVAL_MS,
Settings.Global.BLE_SCAN_BACKGROUND_MODE,
+ Settings.Global.BLOCKING_HELPER_DISMISS_TO_VIEW_RATIO_LIMIT,
+ Settings.Global.BLOCKING_HELPER_STREAK_LIMIT,
Settings.Global.BLUETOOTH_A2DP_SINK_PRIORITY_PREFIX,
Settings.Global.BLUETOOTH_A2DP_SRC_PRIORITY_PREFIX,
Settings.Global.BLUETOOTH_A2DP_SUPPORTS_OPTIONAL_CODECS_PREFIX,