Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10011fa9 authored by Petr Cermak's avatar Petr Cermak
Browse files

Replace smart reply boolean setting with key-value list

This patch replaces the recently introduced
Settings.Global.ENABLE_SMART_REPLIES_IN_NOTIFICATIONS boolean setting
with a new Settings.Global.SMART_REPLIES_IN_NOTIFICATIONS_FLAGS
key-value list.

Rationale: This will allow us to add and tweak smart reply parameters
without polluting the global settings namespace.

Bug: 67765414
Test: atest SmartReplyConstantsTest
Change-Id: I284bb6b31618a234c4772d16ad6190a713035f1b
parent ce706f6b
Loading
Loading
Loading
Loading
+14 −3
Original line number Diff line number Diff line
@@ -12089,11 +12089,22 @@ public final class Settings {
                "zram_enabled";

        /**
         * Whether smart replies in notifications are enabled.
         * Configuration flags for smart replies in notifications.
         * This is encoded as a key=value list, separated by commas. Ex:
         *
         * "enabled=1,max_squeeze_remeasure_count=3"
         *
         * The following keys are supported:
         *
         * <pre>
         * enabled                         (boolean)
         * max_squeeze_remeasure_attempts  (int)
         * </pre>
         * @see com.android.systemui.statusbar.policy.SmartReplyConstants
         * @hide
         */
        public static final String ENABLE_SMART_REPLIES_IN_NOTIFICATIONS =
                "enable_smart_replies_in_notifications";
        public static final String SMART_REPLIES_IN_NOTIFICATIONS_FLAGS =
                "smart_replies_in_notifications_flags";

        /**
         * If nonzero, crashes in foreground processes will bring up a dialog.
+1 −1
Original line number Diff line number Diff line
@@ -422,7 +422,7 @@ message GlobalSettingsProto {
    optional SettingProto notification_snooze_options = 341 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingProto enable_gnss_raw_meas_full_tracking = 346 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingProto zram_enabled = 347 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingProto enable_smart_replies_in_notifications = 348 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingProto smart_replies_in_notifications_flags = 348 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingProto show_first_crash_dialog = 349 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingProto show_restart_in_crash_dialog = 351 [ (android.privacy).dest = DEST_AUTOMATIC ];
    optional SettingProto show_mute_in_crash_dialog = 352 [ (android.privacy).dest = DEST_AUTOMATIC ];
+1 −1
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ public class SettingsBackupTest {
                    Settings.Global.ENABLE_DELETION_HELPER_NO_THRESHOLD_TOGGLE,
                    Settings.Global.ENABLE_DISKSTATS_LOGGING,
                    Settings.Global.ENABLE_EPHEMERAL_FEATURE,
                    Settings.Global.ENABLE_SMART_REPLIES_IN_NOTIFICATIONS,
                    Settings.Global.SMART_REPLIES_IN_NOTIFICATIONS_FLAGS,
                    Settings.Global.ENHANCED_4G_MODE_ENABLED,
                    Settings.Global.EPHEMERAL_COOKIE_MAX_SIZE_BYTES,
                    Settings.Global.ERROR_LOGCAT_PREFIX,
+2 −2
Original line number Diff line number Diff line
@@ -1112,8 +1112,8 @@ class SettingsProtoDumpUtil {
                Settings.Global.ZRAM_ENABLED,
                GlobalSettingsProto.ZRAM_ENABLED);
        dumpSetting(s, p,
                Settings.Global.ENABLE_SMART_REPLIES_IN_NOTIFICATIONS,
                GlobalSettingsProto.ENABLE_SMART_REPLIES_IN_NOTIFICATIONS);
                Settings.Global.SMART_REPLIES_IN_NOTIFICATIONS_FLAGS,
                GlobalSettingsProto.SMART_REPLIES_IN_NOTIFICATIONS_FLAGS);
        dumpSetting(s, p,
                Settings.Global.SHOW_FIRST_CRASH_DIALOG,
                GlobalSettingsProto.SHOW_FIRST_CRASH_DIALOG);
+7 −0
Original line number Diff line number Diff line
@@ -475,4 +475,11 @@
        <item>60</item>
        <item>120</item>
    </integer-array>

    <!-- Smart replies in notifications: Whether smart replies in notifications are enabled. -->
    <bool name="config_smart_replies_in_notifications_enabled">true</bool>

    <!-- Smart replies in notifications: Maximum number of times SmartReplyView will try to find a
         better (narrower) line-break for a double-line smart reply button. -->
    <integer name="config_smart_replies_in_notifications_max_squeeze_remeasure_attempts">3</integer>
</resources>
Loading