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

Commit 7f01ff91 authored by Bernardo Rufino's avatar Bernardo Rufino
Browse files

Return null for getWindowParams() on system-rendered toasts

Bug: 144754526
Test: atest android.widget.cts29.ToastTest android.widget.cts.ToastTest
Change-Id: I768424ab157d64cfc922cd307ffcc688a6ab6de3
parent d99acdae
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -455,8 +455,19 @@ public class Toast {
     * @hide
     */
    @UnsupportedAppUsage
    public WindowManager.LayoutParams getWindowParams() {
    @Nullable public WindowManager.LayoutParams getWindowParams() {
        if (Compatibility.isChangeEnabled(CHANGE_TEXT_TOASTS_IN_THE_SYSTEM)) {
            if (mNextView != null) {
                // Custom toasts
                return mTN.mParams;
            } else {
                // Text toasts
                return null;
            }
        } else {
            // Text and custom toasts are app-rendered
            return mTN.mParams;
        }
    }

    /**