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

Commit 96be8d73 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Remove outdated logic for relaunch with split screen

This removes commit 4846ee3c. Since hierarchy merge, there are no
longer frozen bounds. The bounds are already synced.

Bug: 163976519
Test: CtsActivityManagerDeviceTestCases

Change-Id: I160e300ff777ce5c04532392662927e79daae853
parent 099f8243
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -5762,10 +5762,6 @@ public final class ActivityThread extends ClientTransactionHandler

        handleRelaunchActivityInner(r, configChanges, tmp.pendingResults, tmp.pendingIntents,
                pendingActions, tmp.startsNotResumed, tmp.overrideConfig, "handleRelaunchActivity");
        if (pendingActions != null) {
            // Only report a successful relaunch to WindowManager.
            pendingActions.setReportRelaunchToWindowManager(true);
        }
    }

    void scheduleRelaunchActivity(IBinder token) {
@@ -5873,11 +5869,8 @@ public final class ActivityThread extends ClientTransactionHandler
    }

    @Override
    public void reportRelaunch(ActivityClientRecord r, PendingTransactionActions pendingActions) {
    public void reportRelaunch(ActivityClientRecord r) {
        ActivityClient.getInstance().activityRelaunched(r.token);
        if (pendingActions.shouldReportRelaunchToWindowManager() && r.window != null) {
            r.window.reportActivityRelaunched();
        }
    }

    private void callActivityOnSaveInstanceState(ActivityClientRecord r) {
+2 −5
Original line number Diff line number Diff line
@@ -221,9 +221,6 @@ public abstract class ClientTransactionHandler {
    /**
     * Report that relaunch request was handled.
     * @param r Target activity record.
     * @param pendingActions Pending actions initialized on earlier stages of activity transaction.
     *                       Used to check if we should report relaunch to WM.
     * */
    public abstract void reportRelaunch(@NonNull ActivityClientRecord r,
            PendingTransactionActions pendingActions);
     */
    public abstract void reportRelaunch(@NonNull ActivityClientRecord r);
}
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ public class ActivityRelaunchItem extends ActivityTransactionItem {
    public void postExecute(ClientTransactionHandler client, IBinder token,
            PendingTransactionActions pendingActions) {
        final ActivityClientRecord r = getActivityClientRecord(client, token);
        client.reportRelaunch(r, pendingActions);
        client.reportRelaunch(r);
    }

    // ObjectPoolItem implementation
+0 −19
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ public class PendingTransactionActions {
    private boolean mCallOnPostCreate;
    private Bundle mOldState;
    private StopInfo mStopInfo;
    private boolean mReportRelaunchToWM;

    public PendingTransactionActions() {
        clear();
@@ -92,24 +91,6 @@ public class PendingTransactionActions {
        mStopInfo = stopInfo;
    }

    /**
     * Check if we should report an activity relaunch to WindowManager. We report back for every
     * relaunch request to ActivityManager, but only for those that were actually finished to we
     * report to WindowManager.
     */
    public boolean shouldReportRelaunchToWindowManager() {
        return mReportRelaunchToWM;
    }

    /**
     * Set if we should report an activity relaunch to WindowManager. We report back for every
     * relaunch request to ActivityManager, but only for those that were actually finished we report
     * to WindowManager.
     */
    public void setReportRelaunchToWindowManager(boolean reportToWm) {
        mReportRelaunchToWM = reportToWm;
    }

    /** Reports to server about activity stop. */
    public static class StopInfo implements Runnable {
        private static final String TAG = "ActivityStopInfo";
+0 −17
Original line number Diff line number Diff line
@@ -515,8 +515,6 @@ public final class ViewRootImpl implements ViewParent,
    private boolean mInvalidateRootRequested;
    private int mCanvasOffsetX;
    private int mCanvasOffsetY;
    private boolean mActivityRelaunched;

    CompatibilityInfo.Translator mTranslator;

    @UnsupportedAppUsage
@@ -3028,11 +3026,6 @@ public final class ViewRootImpl implements ViewParent,
                        frame.height() < desiredWindowHeight && frame.height() != mHeight));
        windowShouldResize |= mDragResizing && mPendingDragResizing;

        // If the activity was just relaunched, it might have unfrozen the task bounds (while
        // relaunching), so we need to force a call into window manager to pick up the latest
        // bounds.
        windowShouldResize |= mActivityRelaunched;

        // Determine whether to compute insets.
        // If there are no inset listeners remaining then we may still need to compute
        // insets in case the old insets were non-empty and must be reset.
@@ -3640,7 +3633,6 @@ public final class ViewRootImpl implements ViewParent,
        mFirst = false;
        mWillDrawSoon = false;
        mNewSurfaceNeeded = false;
        mActivityRelaunched = false;
        mViewVisibility = viewVisibility;

        final boolean hasWindowFocus = mAttachInfo.mHasWindowFocus && isViewVisible;
@@ -10517,15 +10509,6 @@ public final class ViewRootImpl implements ViewParent,
        }
    }

    /**
     * Tells this instance that its corresponding activity has just relaunched. In this case, we
     * need to force a relayout of the window to make sure we get the correct bounds from window
     * manager.
     */
    public void reportActivityRelaunched() {
        mActivityRelaunched = true;
    }

    public SurfaceControl getSurfaceControl() {
        return mSurfaceControl;
    }
Loading