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
This commit is contained in:
Jacqueline Bronger
2021-01-05 11:19:15 +00:00
parent 74e51dd2cb
commit c3af7379ba

View File

@@ -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,