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

Commit bcfd8ea0 authored by wilsonshih's avatar wilsonshih
Browse files

Preventing TaskSnapshotWindow crash from resized.

Create Window#mOuter in contructor, so mOuter won't have change to be
nullwhen resized.

Bug: 316720635
Test: presubmit
Test: verify no difference when create TaskSnapshotStartingWindow.
Change-Id: I5e8c4daba0879ea0a02b2f17373b2a6b205802c4
parent de0a2c47
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -135,7 +135,6 @@ public class TaskSnapshotWindow {
        } catch (RemoteException e) {
            snapshotSurface.clearWindowSynced();
        }
        window.setOuter(snapshotSurface);
        try {
            Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "TaskSnapshot#relayout");
            session.relayout(window, layoutParams, -1, -1, View.VISIBLE, 0, 0, 0,
@@ -161,7 +160,7 @@ public class TaskSnapshotWindow {
            ShellExecutor splashScreenExecutor) {
        mSplashScreenExecutor = splashScreenExecutor;
        mSession = WindowManagerGlobal.getWindowSession();
        mWindow = new Window();
        mWindow = new Window(this);
        mWindow.setSession(mSession);
        int backgroundColor = taskDescription.getBackgroundColor();
        mBackgroundPaint.setColor(backgroundColor != 0 ? backgroundColor : WHITE);
@@ -204,9 +203,9 @@ public class TaskSnapshotWindow {
    }

    static class Window extends BaseIWindow {
        private WeakReference<TaskSnapshotWindow> mOuter;
        private final WeakReference<TaskSnapshotWindow> mOuter;

        public void setOuter(TaskSnapshotWindow outer) {
        Window(TaskSnapshotWindow outer) {
            mOuter = new WeakReference<>(outer);
        }