Only allow NEW_TASK flag when adjusting pending intents

Bug: 243794108
Test: atest CtsSecurityBulletinHostTestCases:android.security.cts.CVE_2023_20918
Change-Id: I5d329beecef1902c36704e93d0bc5cb60d0e2f5b
This commit is contained in:
Winson Chung
2023-02-08 01:04:46 +00:00
parent e6ffbc91fb
commit c62d2e1021

View File

@@ -20,6 +20,8 @@ import static android.Manifest.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIO
import static android.app.ActivityTaskManager.SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.Intent.FLAG_RECEIVER_FOREGROUND;
import static android.view.Display.INVALID_DISPLAY;
import android.annotation.Nullable;
@@ -1263,7 +1265,9 @@ public class ActivityOptions {
* @hide
*/
public int getPendingIntentLaunchFlags() {
return mPendingIntentLaunchFlags;
// b/243794108: Ignore all flags except the new task flag, to be reconsidered in b/254490217
return mPendingIntentLaunchFlags &
(FLAG_ACTIVITY_NEW_TASK | FLAG_RECEIVER_FOREGROUND);
}
/**