Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30103df3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove trampoline toast" into sc-dev am: 80e8dc21

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15175434

Change-Id: I587ebbe5187c9860c138b5df868400ed67b37e7a
parents 9b3a6c28 80e8dc21
Loading
Loading
Loading
Loading
+0 −16
Original line number Original line Diff line number Diff line
@@ -11073,8 +11073,6 @@ public class NotificationManagerService extends SystemService {
            String logcatMessage =
            String logcatMessage =
                    "Indirect notification activity start (trampoline) from " + packageName;
                    "Indirect notification activity start (trampoline) from " + packageName;
            if (blockTrampoline(uid)) {
            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");
                Slog.e(TAG, logcatMessage + " blocked");
                return false;
                return false;
            } else {
            } else {
@@ -11098,19 +11096,5 @@ public class NotificationManagerService extends SystemService {
            return tokens.contains(ALLOWLIST_TOKEN)
            return tokens.contains(ALLOWLIST_TOKEN)
                    && !CompatChanges.isChangeEnabled(NOTIFICATION_TRAMPOLINE_BLOCK, uid);
                    && !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());
        }
    }
    }
}
}