From ad92df4731daac4d68843bbe6c45178fd90071d1 Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Thu, 22 Oct 2020 13:22:54 -0700 Subject: [PATCH] Add FLAG_IMMUTABLE to PendingIntent Bug: 171497806 Test: manually enter PiP from YouTube Change-Id: If2c02345f43e2d301a92ab1a94c62e04d3b2fee5 --- .../android/wm/shell/pip/phone/PipMediaController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMediaController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMediaController.java index 22c05fb8acd9a..64e3758fd81a1 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMediaController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipMediaController.java @@ -16,6 +16,7 @@ package com.android.wm.shell.pip.phone; +import static android.app.PendingIntent.FLAG_IMMUTABLE; import static android.app.PendingIntent.FLAG_UPDATE_CURRENT; import android.app.IActivityManager; @@ -180,25 +181,25 @@ public class PipMediaController { mPauseAction = new RemoteAction(Icon.createWithResource(mContext, R.drawable.pip_ic_pause_white), pauseDescription, pauseDescription, PendingIntent.getBroadcast(mContext, 0, new Intent(ACTION_PAUSE), - FLAG_UPDATE_CURRENT)); + FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE)); String playDescription = mContext.getString(R.string.pip_play); mPlayAction = new RemoteAction(Icon.createWithResource(mContext, R.drawable.pip_ic_play_arrow_white), playDescription, playDescription, PendingIntent.getBroadcast(mContext, 0, new Intent(ACTION_PLAY), - FLAG_UPDATE_CURRENT)); + FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE)); String nextDescription = mContext.getString(R.string.pip_skip_to_next); mNextAction = new RemoteAction(Icon.createWithResource(mContext, R.drawable.pip_ic_skip_next_white), nextDescription, nextDescription, PendingIntent.getBroadcast(mContext, 0, new Intent(ACTION_NEXT), - FLAG_UPDATE_CURRENT)); + FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE)); String prevDescription = mContext.getString(R.string.pip_skip_to_prev); mPrevAction = new RemoteAction(Icon.createWithResource(mContext, R.drawable.pip_ic_skip_previous_white), prevDescription, prevDescription, PendingIntent.getBroadcast(mContext, 0, new Intent(ACTION_PREV), - FLAG_UPDATE_CURRENT)); + FLAG_UPDATE_CURRENT | FLAG_IMMUTABLE)); } /**