Signed-off-by: Tavi <tavi@divested.dev>
This commit is contained in:
Tavi 2024-05-12 11:44:47 -04:00
parent 055af41678
commit 89ab1d69ef
No known key found for this signature in database
GPG Key ID: E599F62ECBAEAF2E
3 changed files with 15 additions and 15 deletions

View File

@ -135,7 +135,7 @@ external/cblas d82c5f4ae14b2a5468303985070f7dadc15d4094
external/cbor-java f81e576298790c97498311e99a0b0b34653c3dd8
external/chromium-libpac 169c93e00a00605346a68d39d3f4713735bdb61e
external/chromium-trace e524766cad26d677a9a1ec8c00c512d4cac2cf5e
external/chromium-webview 7a167062342c2f6dc6b6a152dd1021735287d0b9
external/chromium-webview 2b59e6725f2fb27a8bf8f4d048f1e6c1271e5144
external/clang 0a1c53a5d295109bd4702ad13c0f2a5510ca1b26
external/cldr 38850463abd624d5b2293be75fddc43cf6b55ae2
external/cn-cbor 696530332036f5518681d3c450cdbc3ee412004a

View File

@ -1,4 +1,4 @@
From 402c96a6689e35f11b3de7f86ec010002da7772a Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jan Tomljanovic <jtomljanovic@google.com>
Date: Fri, 6 Nov 2020 11:28:09 +0000
Subject: [PATCH] Don't try to show the current toast again while it's showing.
@ -19,7 +19,7 @@ Change-Id: Ie4953109314113efae49fa0c5e0c236e6e0dbb23
2 files changed, 66 insertions(+)
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 32873445b5e6f..11c89bbdf4d94 100755
index 32873445b5e6..11c89bbdf4d9 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -493,6 +493,10 @@ public class NotificationManagerService extends SystemService {
@ -33,7 +33,7 @@ index 32873445b5e6f..11c89bbdf4d94 100755
// The last key in this list owns the hardware.
ArrayList<String> mLights = new ArrayList<>();
@@ -7444,10 +7448,15 @@ public void run() {
@@ -7444,10 +7448,15 @@ public class NotificationManagerService extends SystemService {
@GuardedBy("mToastQueue")
void showNextToastLocked() {
@ -49,7 +49,7 @@ index 32873445b5e6f..11c89bbdf4d94 100755
return;
}
int index = mToastQueue.indexOf(record);
@@ -7463,6 +7472,10 @@ void cancelToastLocked(int index) {
@@ -7463,6 +7472,10 @@ public class NotificationManagerService extends SystemService {
ToastRecord record = mToastQueue.get(index);
record.hide();
@ -61,10 +61,10 @@ index 32873445b5e6f..11c89bbdf4d94 100755
mWindowManagerInternal.removeWindowToken(lastToast.windowToken, false /* removeWindows */,
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index 9ed2b17de4237..3a108144ad66a 100755
index 9ed2b17de423..3a108144ad66 100755
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -5341,6 +5341,32 @@ public void testDisallowBackgroundCustomToasts() throws Exception {
@@ -5341,6 +5341,32 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
assertEquals(0, mService.mToastQueue.size());
}
@ -97,7 +97,7 @@ index 9ed2b17de4237..3a108144ad66a 100755
@Test
public void testAllowForegroundTextToasts() throws Exception {
final String testPackage = "testPackageName";
@@ -5377,6 +5403,33 @@ public void testAllowBackgroundTextToasts() throws Exception {
@@ -5377,6 +5403,33 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
assertEquals(1, mService.mToastQueue.size());
}

View File

@ -1,7 +1,7 @@
From 29f60871d3789e757b012b5d433bf9d9508b274a Mon Sep 17 00:00:00 2001
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Valentin Iftime <valiiftime@google.com>
Date: Mon, 16 Oct 2023 09:29:17 +0200
Subject: [PATCH] [BACKPORT] Prioritize system toasts
Subject: [PATCH] Prioritize system toasts
Insert toasts from system packages at the front of the queue
to ensure that apps can't spam with toast to delay system toasts from showing.
@ -17,10 +17,10 @@ Change-Id: I13547f853476bc88d12026c545aba9f857ce8724
2 files changed, 99 insertions(+), 2 deletions(-)
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 11c89bbdf4d94..dfc9c135c7da7 100755
index 11c89bbdf4d9..dfc9c135c7da 100755
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -3042,8 +3042,19 @@ record = mToastQueue.get(index);
@@ -3042,8 +3042,19 @@ public class NotificationManagerService extends SystemService {
mWindowManagerInternal.addWindowToken(windowToken, TYPE_TOAST, displayId);
record = getToastRecord(callingUid, callingPid, pkg, token, text, callback,
duration, windowToken, displayId, textCallback);
@ -42,7 +42,7 @@ index 11c89bbdf4d94..dfc9c135c7da7 100755
keepProcessAliveForToastIfNeededLocked(callingPid);
}
// If it's at index 0, it's the current toast. It doesn't matter if it's
@@ -3059,6 +3070,24 @@ record = getToastRecord(callingUid, callingPid, pkg, token, text, callback,
@@ -3059,6 +3070,24 @@ public class NotificationManagerService extends SystemService {
}
}
@ -68,10 +68,10 @@ index 11c89bbdf4d94..dfc9c135c7da7 100755
* Implementation note: Our definition of foreground for toasts is an implementation matter
* and should strike a balance between functionality and anti-abuse effectiveness. We
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index 3a108144ad66a..011c408492fa3 100755
index 3a108144ad66..011c408492fa 100755
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -5510,6 +5510,74 @@ public void testAlwaysAllowSystemToasts() throws Exception {
@@ -5510,6 +5510,74 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
assertEquals(1, mService.mToastQueue.size());
}