From c3af7379baa348e336461809a92faf5e7d8e2837 Mon Sep 17 00:00:00 2001 From: Jacqueline Bronger Date: Tue, 5 Jan 2021 11:19:15 +0000 Subject: [PATCH] Intent flags for toggling tv notification panel. Flags are added so that the launchers don't have to change the launch mode. Changed for the default tv notification panel for consistency. Bug: 174025821 Test: manual (both launchers and without a launcher) Change-Id: Ia855352a717ab98688d9d9676b2f4e08bb34611f --- .../statusbar/tv/notifications/TvNotificationPanel.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationPanel.java index 477424c55a737..c9bc7e6c8e5c7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/notifications/TvNotificationPanel.java @@ -91,6 +91,7 @@ public class TvNotificationPanel extends SystemUI implements CommandQueue.Callba private void openInternalNotificationPanel(String action) { Intent intent = new Intent(mContext, TvNotificationPanelActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); intent.setAction(action); mContext.startActivityAsUser(intent, UserHandle.SYSTEM); } @@ -113,6 +114,7 @@ public class TvNotificationPanel extends SystemUI implements CommandQueue.Callba if (ri != null && ri.activityInfo != null) { if (ri.activityInfo.permission != null && ri.activityInfo.permission.equals( Manifest.permission.STATUS_BAR_SERVICE)) { + intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); mContext.startActivityAsUser(intent, UserHandle.CURRENT); } else { Log.e(TAG,