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

Commit 225565e9 authored by Louis Chang's avatar Louis Chang Committed by Android (Google) Code Review
Browse files

Merge "Sets mAdded to true only when the #setView is done successfully" into main

parents 93e71566 81c0503e
Loading
Loading
Loading
Loading
+13 −3
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ import static com.android.window.flags.Flags.enableWindowContextResourcesUpdateO
import static com.android.window.flags.Flags.predictiveBackSwipeEdgeNoneApi;
import static com.android.window.flags.Flags.reduceChangedExclusionRectsMsgs;
import static com.android.window.flags.Flags.setScPropertiesInClient;
import static com.android.window.flags.Flags.fixViewRootCallTrace;
import android.Manifest;
import android.accessibilityservice.AccessibilityService;
@@ -1590,7 +1591,9 @@ public final class ViewRootImpl implements ViewParent,
                    mAttachInfo.mPanelParentWindowToken
                            = panelParentView.getApplicationWindowToken();
                }
                if (!fixViewRootCallTrace()) {
                    mAdded = true;
                }
                int res; /* = WindowManagerImpl.ADD_OKAY; */
                // Schedule the first layout -before- adding to the window
@@ -1641,7 +1644,9 @@ public final class ViewRootImpl implements ViewParent,
                    mTmpFrames.compatScale = compatScale[0];
                    mInvCompatScale = 1f / compatScale[0];
                } catch (RemoteException | RuntimeException e) {
                    if (!fixViewRootCallTrace()) {
                        mAdded = false;
                    }
                    mView = null;
                    mAttachInfo.mRootView = null;
                    mFallbackEventHandler.setView(null);
@@ -1672,7 +1677,9 @@ public final class ViewRootImpl implements ViewParent,
                if (DEBUG_LAYOUT) Log.v(mTag, "Added window " + mWindow);
                if (res < WindowManagerGlobal.ADD_OKAY) {
                    mAttachInfo.mRootView = null;
                    if (!fixViewRootCallTrace()) {
                        mAdded = false;
                    }
                    mFallbackEventHandler.setView(null);
                    unscheduleTraversals();
                    setAccessibilityFocus(null, null);
@@ -1781,6 +1788,9 @@ public final class ViewRootImpl implements ViewParent,
                mFirstInputStage = nativePreImeStage;
                mFirstPostImeInputStage = earlyPostImeStage;
                mPendingInputEventQueueLengthCounterName = "aq:pending:" + counterSuffix;
                if (fixViewRootCallTrace()) {
                    mAdded = true;
                }
                if (!mRemoved || !mAppVisible) {
                    AnimationHandler.requestAnimatorsEnabled(mAppVisible, this);
+11 −0
Original line number Diff line number Diff line
@@ -174,3 +174,14 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    namespace: "windowing_sdk"
    name: "fix_view_root_call_trace"
    description: "Do not set mAdded=true unless #setView finished successfully"
    bug: "385705687"
    is_fixed_read_only: true
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}