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

Commit 56e2aeba authored by Adam Powell's avatar Adam Powell Committed by Android (Google) Code Review
Browse files

Merge "Move Activity multi-window event logic out of the public methods" into nyc-dev

parents 44aabe4b 858cf036
Loading
Loading
Loading
Loading
+21 −11
Original line number Diff line number Diff line
@@ -1879,14 +1879,9 @@ public class Activity extends ContextThemeWrapper
     *
     * @param isInMultiWindowMode True if the activity is in multi-window mode.
     */
    @CallSuper
    public void onMultiWindowModeChanged(boolean isInMultiWindowMode) {
        if (DEBUG_LIFECYCLE) Slog.v(TAG,
                "onMultiWindowModeChanged " + this + ": " + isInMultiWindowMode);
        mFragments.dispatchMultiWindowModeChanged(isInMultiWindowMode);
        if (mWindow != null) {
            mWindow.onMultiWindowModeChanged();
        }
        // Left deliberately empty. There should be no side effects if a direct
        // subclass of Activity does not call super.
    }

    /**
@@ -1909,11 +1904,9 @@ public class Activity extends ContextThemeWrapper
     *
     * @param isInPictureInPictureMode True if the activity is in picture-in-picture mode.
     */
    @CallSuper
    public void onPictureInPictureModeChanged(boolean isInPictureInPictureMode) {
        if (DEBUG_LIFECYCLE) Slog.v(TAG,
                "onPictureInPictureModeChanged " + this + ": " + isInPictureInPictureMode);
        mFragments.dispatchPictureInPictureModeChanged(isInPictureInPictureMode);
        // Left deliberately empty. There should be no side effects if a direct
        // subclass of Activity does not call super.
    }

    /**
@@ -6875,6 +6868,23 @@ public class Activity extends ContextThemeWrapper
        }
    }

    final void dispatchMultiWindowModeChanged(boolean isInMultiWindowMode) {
        if (DEBUG_LIFECYCLE) Slog.v(TAG,
                "dispatchMultiWindowModeChanged " + this + ": " + isInMultiWindowMode);
        mFragments.dispatchMultiWindowModeChanged(isInMultiWindowMode);
        if (mWindow != null) {
            mWindow.onMultiWindowModeChanged();
        }
        onMultiWindowModeChanged(isInMultiWindowMode);
    }

    final void dispatchPictureInPictureModeChanged(boolean isInPictureInPictureMode) {
        if (DEBUG_LIFECYCLE) Slog.v(TAG,
                "dispatchPictureInPictureModeChanged " + this + ": " + isInPictureInPictureMode);
        mFragments.dispatchPictureInPictureModeChanged(isInPictureInPictureMode);
        onPictureInPictureModeChanged(isInPictureInPictureMode);
    }

    /**
     * @hide
     */
+2 −2
Original line number Diff line number Diff line
@@ -2906,14 +2906,14 @@ public final class ActivityThread {
    private void handleMultiWindowModeChanged(IBinder token, boolean isInMultiWindowMode) {
        final ActivityClientRecord r = mActivities.get(token);
        if (r != null) {
            r.activity.onMultiWindowModeChanged(isInMultiWindowMode);
            r.activity.dispatchMultiWindowModeChanged(isInMultiWindowMode);
        }
    }

    private void handlePictureInPictureModeChanged(IBinder token, boolean isInPipMode) {
        final ActivityClientRecord r = mActivities.get(token);
        if (r != null) {
            r.activity.onPictureInPictureModeChanged(isInPipMode);
            r.activity.dispatchPictureInPictureModeChanged(isInPipMode);
        }
    }