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

Commit 9b421ee9 authored by Alex Mang's avatar Alex Mang
Browse files

Cache Feedback Enabled Setting in Controller

AssistantFeedbackController#isFeedbackEnabled was making a binder call every time.  We are caching this state in the feedback controller now and listening to changes in the setting.
This change also moves the NOTIFICATION_FEEDBACK_ENABLED setting to Settings.Global.

Bug: 161512521
Test: atest AssistantFeedbackControllerTest
Change-Id: I79526f36577de2b170b703e3cbc89a29dbb0649b
parent a170a543
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -8727,16 +8727,6 @@ public final class Settings {
        public static final String BUBBLE_IMPORTANT_CONVERSATIONS
                = "bubble_important_conversations";
        /**
         * When enabled, notifications the notification assistant service has modified will show an
         * indicator. When tapped, this indicator will describe the adjustment made and solicit
         * feedback. This flag will also add a "automatic" option to the long press menu.
         *
         * The value 1 - enable, 0 - disable
         * @hide
         */
        public static final String NOTIFICATION_FEEDBACK_ENABLED = "notification_feedback_enabled";
        /**
         * Whether notifications are dismissed by a right-to-left swipe (instead of a left-to-right
         * swipe).
@@ -14046,6 +14036,16 @@ public final class Settings {
        public static final String NOTIFICATION_SNOOZE_OPTIONS =
                "notification_snooze_options";
        /**
         * When enabled, notifications the notification assistant service has modified will show an
         * indicator. When tapped, this indicator will describe the adjustment made and solicit
         * feedback. This flag will also add a "automatic" option to the long press menu.
         *
         * The value 1 - enable, 0 - disable
         * @hide
         */
        public static final String NOTIFICATION_FEEDBACK_ENABLED = "notification_feedback_enabled";
        /**
         * Settings key for the ratio of notification dismissals to notification views - one of the
         * criteria for showing the notification blocking helper.
+0 −1
Original line number Diff line number Diff line
@@ -112,7 +112,6 @@ public class SecureSettings {
        Settings.Secure.FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION,
        Settings.Secure.VR_DISPLAY_MODE,
        Settings.Secure.NOTIFICATION_BADGING,
        Settings.Secure.NOTIFICATION_FEEDBACK_ENABLED,
        Settings.Secure.NOTIFICATION_DISMISS_RTL,
        Settings.Secure.QS_AUTO_ADDED_TILES,
        Settings.Secure.SCREENSAVER_ENABLED,
+1 −0
Original line number Diff line number Diff line
@@ -149,5 +149,6 @@ public class GlobalSettingsValidators {
        VALIDATORS.put(Global.CUSTOM_BUGREPORT_HANDLER_APP, ANY_STRING_VALIDATOR);
        VALIDATORS.put(Global.CUSTOM_BUGREPORT_HANDLER_USER, ANY_INTEGER_VALIDATOR);
        VALIDATORS.put(Global.DEVELOPMENT_SETTINGS_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Global.NOTIFICATION_FEEDBACK_ENABLED, BOOLEAN_VALIDATOR);
    }
}
+0 −1
Original line number Diff line number Diff line
@@ -189,7 +189,6 @@ public class SecureSettingsValidators {
        VALIDATORS.put(Secure.LOCK_SCREEN_SHOW_SILENT_NOTIFICATIONS, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.SHOW_NOTIFICATION_SNOOZE, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.NOTIFICATION_HISTORY_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.NOTIFICATION_FEEDBACK_ENABLED, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.ZEN_DURATION, ANY_INTEGER_VALIDATOR);
        VALIDATORS.put(Secure.SHOW_ZEN_UPGRADE_NOTIFICATION, BOOLEAN_VALIDATOR);
        VALIDATORS.put(Secure.SHOW_ZEN_SETTINGS_SUGGESTION, BOOLEAN_VALIDATOR);
+1 −0
Original line number Diff line number Diff line
@@ -389,6 +389,7 @@ public class SettingsBackupTest {
                    Settings.Global.NITZ_UPDATE_DIFF,
                    Settings.Global.NITZ_UPDATE_SPACING,
                    Settings.Global.NOTIFICATION_SNOOZE_OPTIONS,
                    Settings.Global.NOTIFICATION_FEEDBACK_ENABLED,
                    Settings.Global.NR_NSA_TRACKING_SCREEN_OFF_MODE,
                    Settings.Global.NSD_ON,
                    Settings.Global.NTP_SERVER,
Loading