mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
59bf3b75c7
https://review.lineageos.org/c/LineageOS/android_frameworks_base/+/353117 https://review.lineageos.org/q/topic:Q_asb_2023-03 https://review.lineageos.org/q/topic:Q_asb_2023-04 https://review.lineageos.org/q/topic:Q_asb_2023-05 https://review.lineageos.org/q/topic:Q_asb_2023-06 https://review.lineageos.org/q/topic:Q_asb_2023-07 https://review.lineageos.org/q/topic:Q_asb_2023-08 accounted for via patches: https://review.lineageos.org/c/LineageOS/android_system_ca-certificates/+/376560 https://review.lineageos.org/c/LineageOS/android_system_ca-certificates/+/376561 https://review.lineageos.org/c/LineageOS/android_system_ca-certificates/+/376562 https://review.lineageos.org/q/topic:Q_asb_2023-09 https://review.lineageos.org/q/topic:Q_asb_2023-10 https://review.lineageos.org/q/topic:Q_asb_2023-11 accounted for via patches: https://review.lineageos.org/c/LineageOS/android_system_ca-certificates/+/376563 accounted for via manifest change: https://review.lineageos.org/c/LineageOS/android_external_webp/+/376568 https://review.lineageos.org/q/topic:Q_asb_2023-12 https://review.lineageos.org/q/topic:Q_asb_2024-01 https://review.lineageos.org/q/topic:Q_asb_2024-02 https://review.lineageos.org/q/topic:Q_asb_2024-03 Signed-off-by: Tavi <tavi@divested.dev>
36 lines
1.7 KiB
Diff
36 lines
1.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Hongwei Wang <hwwang@google.com>
|
|
Date: Thu, 23 Feb 2023 13:23:37 -0800
|
|
Subject: [PATCH] Remove Activity if it enters PiP without window
|
|
|
|
This is to prevent malicious app entering PiP without being visible
|
|
first, like blocking onResume from completion. Which in turn
|
|
leaves the PiP window in limbo and non-interactable.
|
|
|
|
Bug: 265293293
|
|
Test: atest PinnedStackTests
|
|
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4fad1456409b79d6e649a29d5116a4fe3160bd21)
|
|
Merged-In: I458a9508662e72a1adb9d9818105f2e9d7096d44
|
|
Change-Id: I458a9508662e72a1adb9d9818105f2e9d7096d44
|
|
---
|
|
.../core/java/com/android/server/wm/ActivityRecord.java | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
|
|
index 55e8e19fd278..66514b44ba94 100644
|
|
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
|
|
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
|
|
@@ -781,6 +781,12 @@ final class ActivityRecord extends ConfigurationContainer {
|
|
}
|
|
schedulePictureInPictureModeChanged(newConfig);
|
|
scheduleMultiWindowModeChanged(newConfig);
|
|
+ if (inPictureInPictureMode && mAppWindowToken != null && mAppWindowToken.findMainWindow() == null) {
|
|
+ // Prevent malicious app entering PiP without valid WindowState, which can in turn
|
|
+ // result a non-touchable PiP window since the InputConsumer for PiP requires it.
|
|
+ EventLog.writeEvent(0x534e4554, "265293293", -1, "");
|
|
+ mAppWindowToken.removeImmediately();
|
|
+ }
|
|
}
|
|
}
|
|
|