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

Commit 82503688 authored by Jan Sebechlebsky's avatar Jan Sebechlebsky
Browse files

Fix crash when attempting to show toast on recently removed display.

Bug: 265325338
Bug: 297288652
Test: atest ToastPresenterTest ToastTest ToastUITest
Change-Id: Icf9848ea78f5340f1ead81401bd0222ebbdd0359
parent 94099956
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -342,7 +342,10 @@ public class ToastPresenter {
            // to cancel the toast there is an inherent race and we may attempt to add a window
            // after the token has been invalidated. Let us hedge against that.
            Log.w(TAG, "Error while attempting to show toast from " + mPackageName, e);
            return;
        } catch (WindowManager.InvalidDisplayException e) {
            // Display the toast was scheduled on might have been meanwhile removed.
            Log.w(TAG, "Cannot show toast from " + mPackageName
                    + " on display it was scheduled on.", e);
        }
    }
}