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

Commit 210deda3 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Limit toasts posted by system" into rvc-dev

parents f51b6aa5 dcb4b0ce
Loading
Loading
Loading
Loading
+13 −14
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ import android.annotation.CallbackExecutor;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.UserIdInt;
import android.annotation.WorkerThread;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
@@ -2842,9 +2843,8 @@ public class NotificationManagerService extends SystemService {
                        record = mToastQueue.get(index);
                        record.update(duration);
                    } else {
                        // Limit the number of toasts that any given package except the android
                        // package can enqueue.  Prevents DOS attacks and deals with leaks.
                        if (!isSystemToast) {
                        // Limit the number of toasts that any given package can enqueue.
                        // Prevents DOS attacks and deals with leaks.
                        int count = 0;
                        final int N = mToastQueue.size();
                        for (int i = 0; i < N; i++) {
@@ -2858,7 +2858,6 @@ public class NotificationManagerService extends SystemService {
                                }
                            }
                        }
                        }

                        Binder windowToken = new Binder();
                        mWindowManagerInternal.addWindowToken(windowToken, TYPE_TOAST, displayId);