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

Commit f2a3160b authored by Alex Mang's avatar Alex Mang
Browse files

Flag guarding all notification feedback UI

Test: manually on device
Change-Id: I1597e35f0a39f6594e47d8f2a6956befd4f100ea
parent f58cef41
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -8695,6 +8695,16 @@ 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).
+1 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ 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
@@ -189,6 +189,7 @@ 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);
+6 −8
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import com.android.systemui.bubbles.BubbleController;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.dagger.StatusBarModule;
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
import com.android.systemui.statusbar.notification.DynamicChildBindController;
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
@@ -88,6 +89,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
    private final DynamicPrivacyController mDynamicPrivacyController;
    private final KeyguardBypassController mBypassController;
    private final ForegroundServiceSectionController mFgsSectionController;
    private AssistantFeedbackController mAssistantFeedbackController;
    private final Context mContext;

    private NotificationPresenter mPresenter;
@@ -115,7 +117,8 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
            DynamicPrivacyController privacyController,
            ForegroundServiceSectionController fgsSectionController,
            DynamicChildBindController dynamicChildBindController,
            LowPriorityInflationHelper lowPriorityInflationHelper) {
            LowPriorityInflationHelper lowPriorityInflationHelper,
            AssistantFeedbackController assistantFeedbackController) {
        mContext = context;
        mHandler = mainHandler;
        mLockscreenUserManager = notificationLockscreenUserManager;
@@ -132,6 +135,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
        mDynamicPrivacyController = privacyController;
        mDynamicChildBindController = dynamicChildBindController;
        mLowPriorityInflationHelper = lowPriorityInflationHelper;
        mAssistantFeedbackController = assistantFeedbackController;
    }

    public void setUpWithPresenter(NotificationPresenter presenter,
@@ -488,7 +492,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
            }

            row.showAppOpsIcons(entry.mActiveAppOps);
            row.showFeedbackIcon(showFeedback(entry));
            row.showFeedbackIcon(mAssistantFeedbackController.showFeedbackIndicator(entry));
            row.setLastAudiblyAlertedMs(entry.getLastAudiblyAlertedMs());
        }

@@ -530,10 +534,4 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
        }
        mPerformingUpdate = false;
    }

    public static boolean showFeedback(NotificationEntry entry) {
        Ranking ranking = entry.getRanking();
        return ranking.getImportance() != ranking.getChannel().getImportance()
                || ranking.getRankingAdjustment() != Ranking.RANKING_UNCHANGED;
    }
}
+5 −2
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import com.android.systemui.statusbar.NotificationMediaManager;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.NotificationViewHierarchyManager;
import com.android.systemui.statusbar.SmartReplyController;
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
import com.android.systemui.statusbar.notification.DynamicChildBindController;
import com.android.systemui.statusbar.notification.DynamicPrivacyController;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
@@ -152,7 +153,8 @@ public interface StatusBarDependenciesModule {
            DynamicPrivacyController privacyController,
            ForegroundServiceSectionController fgsSectionController,
            DynamicChildBindController dynamicChildBindController,
            LowPriorityInflationHelper lowPriorityInflationHelper) {
            LowPriorityInflationHelper lowPriorityInflationHelper,
            AssistantFeedbackController assistantFeedbackController) {
        return new NotificationViewHierarchyManager(
                context,
                mainHandler,
@@ -166,7 +168,8 @@ public interface StatusBarDependenciesModule {
                privacyController,
                fgsSectionController,
                dynamicChildBindController,
                lowPriorityInflationHelper);
                lowPriorityInflationHelper,
                assistantFeedbackController);
    }

    /**
Loading