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

Commit 83b8a6b8 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Renamed some members of AppWindowToken (49/n)

- Renamed fillParent to occludesParent since it indicates the
activity is opaque and fills the entire space of this task.
- Renamed canTurnScreenOn to currentLaunchCanTurnScreenOn since
it only applies to the current launch.
Also, made additional clean-ups relating to the rename.

Bug: 80414790
Test: Existing tests pass
Change-Id: I212fae928d9de87e8324d9702eb96661888f3b46
parent a441b924
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ import static com.android.server.wm.ActivityStack.PAUSE_TIMEOUT_MSG;
import static com.android.server.wm.ActivityStack.STACK_VISIBILITY_VISIBLE;
import static com.android.server.wm.ActivityStack.STOP_TIMEOUT_MSG;
import static com.android.server.wm.ActivityStackSupervisor.PAUSE_IMMEDIATELY;
import static com.android.server.wm.ActivityStackSupervisor.PRESERVE_WINDOWS;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_ALL;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_CONFIGURATION;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.DEBUG_CONTAINERS;
@@ -1372,16 +1373,17 @@ final class ActivityRecord extends ConfigurationContainer {
        return stack != null ? stack.getDisplay() : null;
    }

    boolean changeWindowTranslucency(boolean toOpaque) {
        if (fullscreen == toOpaque) {
            return false;
    boolean setOccludesParent(boolean occludesParent) {
        final boolean changed = mAppWindowToken.setOccludesParent(occludesParent);
        if (changed) {
            if (!occludesParent) {
                getActivityStack().convertActivityToTranslucent(this);
            }

            // Keep track of the number of fullscreen activities in this task.
        task.numFullscreen += toOpaque ? +1 : -1;

        fullscreen = toOpaque;
        return true;
            task.numFullscreen += occludesParent ? +1 : -1;
            mRootActivityContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
        }
        return changed;
    }

    void takeFromHistory() {
+1 −1
Original line number Diff line number Diff line
@@ -2492,7 +2492,7 @@ class ActivityStack extends ConfigurationContainer {
            mHandler.removeMessages(TRANSLUCENT_TIMEOUT_MSG);

            if (waitingActivity != null) {
                mWindowManager.setWindowOpaque(waitingActivity.appToken, false);
                mWindowManager.setWindowOpaqueLocked(waitingActivity.appToken, false);
                if (waitingActivity.attachedToProcess()) {
                    try {
                        waitingActivity.app.getThread().scheduleTranslucentConversionComplete(
+1 −1
Original line number Diff line number Diff line
@@ -2742,7 +2742,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
        mWindowManager.deferSurfaceLayout();
        try {
            if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) {
                mWindowManager.setDockedStackCreateState(
                mWindowManager.setDockedStackCreateStateLocked(
                        activityOptions.getSplitScreenCreateMode(), null /* initialBounds */);

                // Defer updating the stack in which recents is until the app transition is done, to
+4 −15
Original line number Diff line number Diff line
@@ -1949,12 +1949,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                if (r == null) {
                    return false;
                }
                final boolean translucentChanged = r.changeWindowTranslucency(true);
                if (translucentChanged) {
                    mRootActivityContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
                }
                mWindowManager.setAppFullscreen(token, true);
                return translucentChanged;
                return r.setOccludesParent(true);
            }
        } finally {
            Binder.restoreCallingIdentity(origId);
@@ -1977,13 +1972,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                    ActivityRecord under = task.mActivities.get(index - 1);
                    under.returningOptions = safeOptions != null ? safeOptions.getOptions(r) : null;
                }
                final boolean translucentChanged = r.changeWindowTranslucency(false);
                if (translucentChanged) {
                    r.getActivityStack().convertActivityToTranslucent(r);
                }
                mRootActivityContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
                mWindowManager.setAppFullscreen(token, false);
                return translucentChanged;
                return r.setOccludesParent(false);
            }
        } finally {
            Binder.restoreCallingIdentity(origId);
@@ -2576,7 +2565,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                            + taskId + " to stack " + stackId);
                }
                if (stack.inSplitScreenPrimaryWindowingMode()) {
                    mWindowManager.setDockedStackCreateState(
                    mWindowManager.setDockedStackCreateStateLocked(
                            SPLIT_SCREEN_CREATE_MODE_TOP_OR_LEFT, null /* initialBounds */);
                }
                task.reparent(stack, toTop, REPARENT_KEEP_STACK_AT_FRONT, ANIMATE, !DEFER_RESUME,
@@ -2695,7 +2684,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                            + " non-standard task " + taskId + " to split-screen windowing mode");
                }

                mWindowManager.setDockedStackCreateState(createMode, initialBounds);
                mWindowManager.setDockedStackCreateStateLocked(createMode, initialBounds);
                final int windowingMode = task.getWindowingMode();
                final ActivityStack stack = task.getStack();
                if (toTop) {
+30 −8
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ import android.content.ComponentName;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.graphics.GraphicBuffer;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.Binder;
@@ -153,8 +154,11 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
    final ComponentName mActivityComponent;
    final boolean mVoiceInteraction;

    /** @see WindowContainer#fillsParent() */
    private boolean mFillsParent;
    /**
     * The activity is opaque and fills the entire space of this task.
     * @see WindowContainer#fillsParent()
     */
    private boolean mOccludesParent;
    boolean mShowForAllUsers;
    int mTargetSdk;

@@ -373,7 +377,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        appToken = token;
        mActivityComponent = activityComponent;
        mVoiceInteraction = voiceInteraction;
        mFillsParent = fillsParent;
        mOccludesParent = fillsParent;
        mInputApplicationHandle = new InputApplicationHandle(appToken.asBinder());
    }

@@ -2354,11 +2358,29 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree

    @Override
    boolean fillsParent() {
        return mFillsParent;
        return occludesParent();
    }

    /** Returns true if this activity is opaque and fills the entire space of this task. */
    boolean occludesParent() {
        return mOccludesParent;
    }

    boolean setOccludesParent(boolean occludesParent) {
        final boolean changed = occludesParent != mOccludesParent;
        mOccludesParent = occludesParent;
        setMainWindowOpaque(occludesParent);
        mWmService.mWindowPlacerLocked.requestTraversal();
        return changed;
    }

    void setFillsParent(boolean fillsParent) {
        mFillsParent = fillsParent;
    void setMainWindowOpaque(boolean isOpaque) {
        final WindowState win = findMainWindow();
        if (win == null) {
            return;
        }
        isOpaque = isOpaque & !PixelFormat.formatHasAlpha(win.getAttrs().format);
        win.mWinAnimator.setOpaqueLocked(isOpaque);
    }

    boolean containsDismissKeyguardWindow() {
@@ -3035,7 +3057,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        }
        pw.println(prefix + "component=" + mActivityComponent.flattenToShortString());
        pw.print(prefix); pw.print("task="); pw.println(getTask());
        pw.print(prefix); pw.print(" mFillsParent="); pw.print(mFillsParent);
        pw.print(prefix); pw.print(" mOccludesParent="); pw.print(mOccludesParent);
                pw.print(" mOrientation="); pw.println(mOrientation);
        pw.println(prefix + "hiddenRequested=" + hiddenRequested + " mClientHidden=" + mClientHidden
            + ((mDeferHidingClient) ? " mDeferHidingClient=" + mDeferHidingClient : "")
@@ -3152,7 +3174,7 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree
        if (mThumbnail != null){
            mThumbnail.writeToProto(proto, THUMBNAIL);
        }
        proto.write(FILLS_PARENT, mFillsParent);
        proto.write(FILLS_PARENT, mOccludesParent);
        proto.write(APP_STOPPED, mAppStopped);
        proto.write(HIDDEN_REQUESTED, hiddenRequested);
        proto.write(CLIENT_HIDDEN, mClientHidden);
Loading