From b73787e9a5827d58258bda19bc2bf4e0d6f09720 Mon Sep 17 00:00:00 2001 From: Bernardo Rufino Date: Fri, 2 Jul 2021 15:41:24 +0100 Subject: [PATCH] Remove trampoline toast Bug: 161957908 Test: Trigger trampoline on app w/ targetSdk S, observe no toast. Change-Id: I533ebc578f1221af3f0efdda2f9eb2b5cb30e658 --- .../notification/NotificationManagerService.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index 0dd9b292b386b..f4cb870df06c0 100755 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -11039,8 +11039,6 @@ public class NotificationManagerService extends SystemService { String logcatMessage = "Indirect notification activity start (trampoline) from " + packageName; if (blockTrampoline(uid)) { - // Post toast() call to mHandler to offload PM lookup from the activity start path - mHandler.post(() -> toast(packageName, uid)); Slog.e(TAG, logcatMessage + " blocked"); return false; } else { @@ -11064,19 +11062,5 @@ public class NotificationManagerService extends SystemService { return tokens.contains(ALLOWLIST_TOKEN) && !CompatChanges.isChangeEnabled(NOTIFICATION_TRAMPOLINE_BLOCK, uid); } - - private void toast(String packageName, int uid) { - final CharSequence label; - try { - label = mPackageManagerClient.getApplicationLabel( - mPackageManager.getApplicationInfo(packageName, 0, - UserHandle.getUserId(uid))); - } catch (RemoteException e) { - Slog.e(TAG, "Unexpected exception obtaining app label from PackageManager", e); - return; - } - mUiHandler.post(() -> Toast.makeText(getUiContext(), - label + " launch blocked\ng.co/dev/trampolines", Toast.LENGTH_LONG).show()); - } } }