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

Commit 57d3e7d1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add try-catch for the augmented autofill UI to avoid crashing" into...

Merge "Add try-catch for the augmented autofill UI to avoid crashing" into rvc-dev am: c5c35fc3 am: 19ccb788

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

Change-Id: Ic23d7a55fa5502bc2dc2d9e5aa64bb5e531f1a6d
parents 6513ae18 19ccb788
Loading
Loading
Loading
Loading
+18 −8
Original line number Original line Diff line number Diff line
@@ -208,6 +208,7 @@ public final class FillWindow implements AutoCloseable {
        if (sDebug) Log.d(TAG, "handleShow()");
        if (sDebug) Log.d(TAG, "handleShow()");
        synchronized (mLock) {
        synchronized (mLock) {
            if (mWm != null && mFillView != null) {
            if (mWm != null && mFillView != null) {
                try {
                    p.flags |= WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
                    p.flags |= WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH;
                    if (!mShowing) {
                    if (!mShowing) {
                        mWm.addView(mFillView, p);
                        mWm.addView(mFillView, p);
@@ -215,6 +216,11 @@ public final class FillWindow implements AutoCloseable {
                    } else {
                    } else {
                        mWm.updateViewLayout(mFillView, p);
                        mWm.updateViewLayout(mFillView, p);
                    }
                    }
                } catch (WindowManager.BadTokenException e) {
                    if (sDebug) Log.d(TAG, "Filed with token " + p.token + " gone.");
                } catch (IllegalStateException e) {
                    if (sDebug) Log.d(TAG, "Exception showing window.");
                }
            }
            }
        }
        }
    }
    }
@@ -223,8 +229,12 @@ public final class FillWindow implements AutoCloseable {
        if (sDebug) Log.d(TAG, "handleHide()");
        if (sDebug) Log.d(TAG, "handleHide()");
        synchronized (mLock) {
        synchronized (mLock) {
            if (mWm != null && mFillView != null && mShowing) {
            if (mWm != null && mFillView != null && mShowing) {
                try {
                    mWm.removeView(mFillView);
                    mWm.removeView(mFillView);
                    mShowing = false;
                    mShowing = false;
                } catch (IllegalStateException e) {
                    if (sDebug) Log.d(TAG, "Exception hiding window.");
                }
            }
            }
        }
        }
    }
    }