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

Commit daca8ee6 authored by Svet Ganov's avatar Svet Ganov Committed by Svetoslav Ganov
Browse files

Upstream allowing multiple toasts for focused app

Test:The topic contains CTS tests that pass

Change-Id: I60515845f7c9be23887764bb1c59bf2b3301adc8
parent 8e737ef8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1488,6 +1488,13 @@ class DisplayContent extends WindowContainer<DisplayContent.DisplayChildWindowCo

    boolean canAddToastWindowForUid(int uid) {
        // We allow one toast window per UID being shown at a time.
        // Also if the app is focused adding more than one toast at
        // a time for better backwards compatibility.
        final WindowState focusedWindowForUid = getWindow(w ->
                w.mOwnerUid == uid && w.isFocused());
        if (focusedWindowForUid != null) {
            return true;
        }
        final WindowState win = getWindow(w ->
                w.mAttrs.type == TYPE_TOAST && w.mOwnerUid == uid && !w.mPermanentlyHidden
                && !w.mWindowRemovalAllowed);