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

Commit 6fbde9fc authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Introducing activityType window configuration.

Used to represent the current activity type of the window
configuration which can be undefined, standard, home, recents, or
assistant. This information if currently represented in a few ways in
the window heirarchy e.g. with stack id or with fields in tasks and
activities. This change allows us to represent the idea in a more
structure way without overloading concepts like stack ids.

Test: bit FrameworksServicesTests:com.android.server.wm.ConfigurationContainerTests
Test: bit FrameworksServicesTests:com.android.server.wm.WindowConfigurationTests
Test: go/wm-smoke
Change-Id: I7d7283c72e806972eeb3a8dab448f195dd6cd811
parent fe12d97a
Loading
Loading
Loading
Loading
+24 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,10 @@


package android.app;
package android.app;


import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_DOCKED;
import static android.app.WindowConfiguration.WINDOWING_MODE_DOCKED;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
@@ -874,6 +878,26 @@ public class ActivityManager {
            }
            }
            return windowingMode;
            return windowingMode;
        }
        }

        /** Returns the activity type that should be used for this input stack id. */
        // TODO: To be removed once we are not using stack id for stuff...
        public static int getActivityTypeForStackId(int stackId) {
            final int activityType;
            switch (stackId) {
                case HOME_STACK_ID:
                    activityType = ACTIVITY_TYPE_HOME;
                    break;
                case RECENTS_STACK_ID:
                    activityType = ACTIVITY_TYPE_RECENTS;
                    break;
                case ASSISTANT_STACK_ID:
                    activityType = ACTIVITY_TYPE_ASSISTANT;
                    break;
                default :
                    activityType = ACTIVITY_TYPE_STANDARD;
            }
            return activityType;
        }
    }
    }


    /**
    /**
+74 −2
Original line number Original line Diff line number Diff line
@@ -55,7 +55,7 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
    /** Can be freely resized within its parent container. */
    /** Can be freely resized within its parent container. */
    public static final int WINDOWING_MODE_FREEFORM = 4;
    public static final int WINDOWING_MODE_FREEFORM = 4;


    @IntDef(value = {
    @IntDef({
            WINDOWING_MODE_UNDEFINED,
            WINDOWING_MODE_UNDEFINED,
            WINDOWING_MODE_FULLSCREEN,
            WINDOWING_MODE_FULLSCREEN,
            WINDOWING_MODE_PINNED,
            WINDOWING_MODE_PINNED,
@@ -64,15 +64,41 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
    })
    })
    public @interface WindowingMode {}
    public @interface WindowingMode {}


    /** The current activity type of the configuration. */
    private @ActivityType int mActivityType;

    /** Activity type is currently not defined. */
    public static final int ACTIVITY_TYPE_UNDEFINED = 0;
    /** Standard activity type. Nothing special about the activity... */
    public static final int ACTIVITY_TYPE_STANDARD = 1;
    /** Home/Launcher activity type. */
    public static final int ACTIVITY_TYPE_HOME = 2;
    /** Recents/Overview activity type. */
    public static final int ACTIVITY_TYPE_RECENTS = 3;
    /** Assistant activity type. */
    public static final int ACTIVITY_TYPE_ASSISTANT = 4;

    @IntDef({
            ACTIVITY_TYPE_UNDEFINED,
            ACTIVITY_TYPE_STANDARD,
            ACTIVITY_TYPE_HOME,
            ACTIVITY_TYPE_RECENTS,
            ACTIVITY_TYPE_ASSISTANT,
    })
    public @interface ActivityType {}

    /** Bit that indicates that the {@link #mAppBounds} changed. */
    /** Bit that indicates that the {@link #mAppBounds} changed. */
    public static final int WINDOW_CONFIG_APP_BOUNDS = 1 << 0;
    public static final int WINDOW_CONFIG_APP_BOUNDS = 1 << 0;
    /** Bit that indicates that the {@link #mWindowingMode} changed. */
    /** Bit that indicates that the {@link #mWindowingMode} changed. */
    public static final int WINDOW_CONFIG_WINDOWING_MODE = 1 << 1;
    public static final int WINDOW_CONFIG_WINDOWING_MODE = 1 << 1;
    /** Bit that indicates that the {@link #mActivityType} changed. */
    public static final int WINDOW_CONFIG_ACTIVITY_TYPE = 1 << 2;


    @IntDef(flag = true,
    @IntDef(flag = true,
            value = {
            value = {
                    WINDOW_CONFIG_APP_BOUNDS,
                    WINDOW_CONFIG_APP_BOUNDS,
                    WINDOW_CONFIG_WINDOWING_MODE,
                    WINDOW_CONFIG_WINDOWING_MODE,
                    WINDOW_CONFIG_ACTIVITY_TYPE,
            })
            })
    public @interface WindowConfig {}
    public @interface WindowConfig {}


@@ -92,11 +118,13 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
    public void writeToParcel(Parcel dest, int flags) {
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(mAppBounds, flags);
        dest.writeParcelable(mAppBounds, flags);
        dest.writeInt(mWindowingMode);
        dest.writeInt(mWindowingMode);
        dest.writeInt(mActivityType);
    }
    }


    private void readFromParcel(Parcel source) {
    private void readFromParcel(Parcel source) {
        mAppBounds = source.readParcelable(Rect.class.getClassLoader());
        mAppBounds = source.readParcelable(Rect.class.getClassLoader());
        mWindowingMode = source.readInt();
        mWindowingMode = source.readInt();
        mActivityType = source.readInt();
    }
    }


    @Override
    @Override
@@ -158,9 +186,27 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
        return mWindowingMode;
        return mWindowingMode;
    }
    }


    public void setActivityType(@ActivityType int activityType) {
        if (mActivityType == activityType) {
            return;
        }
        if (mActivityType != ACTIVITY_TYPE_UNDEFINED
                && activityType != ACTIVITY_TYPE_UNDEFINED) {
            throw new IllegalStateException("Can't change activity type once set: " + this
                    + " activityType=" + activityTypeToString(activityType));
        }
        mActivityType = activityType;
    }

    @ActivityType
    public int getActivityType() {
        return mActivityType;
    }

    public void setTo(WindowConfiguration other) {
    public void setTo(WindowConfiguration other) {
        setAppBounds(other.mAppBounds);
        setAppBounds(other.mAppBounds);
        setWindowingMode(other.mWindowingMode);
        setWindowingMode(other.mWindowingMode);
        setActivityType(other.mActivityType);
    }
    }


    /** Set this object to completely undefined. */
    /** Set this object to completely undefined. */
@@ -171,6 +217,7 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
    public void setToDefaults() {
    public void setToDefaults() {
        setAppBounds(null);
        setAppBounds(null);
        setWindowingMode(WINDOWING_MODE_UNDEFINED);
        setWindowingMode(WINDOWING_MODE_UNDEFINED);
        setActivityType(ACTIVITY_TYPE_UNDEFINED);
    }
    }


    /**
    /**
@@ -191,6 +238,11 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
            changed |= WINDOW_CONFIG_WINDOWING_MODE;
            changed |= WINDOW_CONFIG_WINDOWING_MODE;
            setWindowingMode(delta.mWindowingMode);
            setWindowingMode(delta.mWindowingMode);
        }
        }
        if (delta.mActivityType != ACTIVITY_TYPE_UNDEFINED
                && mActivityType != delta.mActivityType) {
            changed |= WINDOW_CONFIG_ACTIVITY_TYPE;
            setActivityType(delta.mActivityType);
        }
        return changed;
        return changed;
    }
    }


@@ -219,6 +271,11 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
            changes |= WINDOW_CONFIG_WINDOWING_MODE;
            changes |= WINDOW_CONFIG_WINDOWING_MODE;
        }
        }


        if ((compareUndefined || other.mActivityType != ACTIVITY_TYPE_UNDEFINED)
                && mActivityType != other.mActivityType) {
            changes |= WINDOW_CONFIG_ACTIVITY_TYPE;
        }

        return changes;
        return changes;
    }
    }


@@ -241,6 +298,8 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
        }
        }
        n = mWindowingMode - that.mWindowingMode;
        n = mWindowingMode - that.mWindowingMode;
        if (n != 0) return n;
        if (n != 0) return n;
        n = mActivityType - that.mActivityType;
        if (n != 0) return n;


        // if (n != 0) return n;
        // if (n != 0) return n;
        return n;
        return n;
@@ -263,13 +322,15 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
            result = 31 * result + mAppBounds.hashCode();
            result = 31 * result + mAppBounds.hashCode();
        }
        }
        result = 31 * result + mWindowingMode;
        result = 31 * result + mWindowingMode;
        result = 31 * result + mActivityType;
        return result;
        return result;
    }
    }


    @Override
    @Override
    public String toString() {
    public String toString() {
        return "{mAppBounds=" + mAppBounds
        return "{mAppBounds=" + mAppBounds
                + " mWindowingMode=" + windowingModeToString(mWindowingMode) + "}";
                + " mWindowingMode=" + windowingModeToString(mWindowingMode)
                + " mActivityType=" + activityTypeToString(mActivityType) + "}";
    }
    }


    /**
    /**
@@ -366,4 +427,15 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
        }
        }
        return String.valueOf(windowingMode);
        return String.valueOf(windowingMode);
    }
    }

    public static String activityTypeToString(@ActivityType int applicationType) {
        switch (applicationType) {
            case ACTIVITY_TYPE_UNDEFINED: return "undefined";
            case ACTIVITY_TYPE_STANDARD: return "standard";
            case ACTIVITY_TYPE_HOME: return "home";
            case ACTIVITY_TYPE_RECENTS: return "recents";
            case ACTIVITY_TYPE_ASSISTANT: return "assistant";
        }
        return String.valueOf(applicationType);
    }
}
}
+4 −4
Original line number Original line Diff line number Diff line
@@ -3093,7 +3093,7 @@ public class ActivityManagerService extends IActivityManager.Stub
     */
     */
    void setResumedActivityUncheckLocked(ActivityRecord r, String reason) {
    void setResumedActivityUncheckLocked(ActivityRecord r, String reason) {
        final TaskRecord task = r.getTask();
        final TaskRecord task = r.getTask();
        if (task.isApplicationTask()) {
        if (task.isActivityTypeStandard()) {
            if (mCurAppTimeTracker != r.appTimeTracker) {
            if (mCurAppTimeTracker != r.appTimeTracker) {
                // We are switching app tracking.  Complete the current one.
                // We are switching app tracking.  Complete the current one.
                if (mCurAppTimeTracker != null) {
                if (mCurAppTimeTracker != null) {
@@ -9934,7 +9934,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                    if (!allowed) {
                    if (!allowed) {
                        // If the caller doesn't have the GET_TASKS permission, then only
                        // If the caller doesn't have the GET_TASKS permission, then only
                        // allow them to see a small subset of tasks -- their own and home.
                        // allow them to see a small subset of tasks -- their own and home.
                        if (!tr.isHomeTask() && tr.effectiveUid != callingUid) {
                        if (!tr.isActivityTypeHome() && tr.effectiveUid != callingUid) {
                            if (DEBUG_RECENTS) Slog.d(TAG_RECENTS, "Skipping, not allowed: " + tr);
                            if (DEBUG_RECENTS) Slog.d(TAG_RECENTS, "Skipping, not allowed: " + tr);
                            continue;
                            continue;
                        }
                        }
@@ -12945,7 +12945,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        int userId;
        int userId;
        synchronized (this) {
        synchronized (this) {
            final ActivityStack focusedStack = getFocusedStack();
            final ActivityStack focusedStack = getFocusedStack();
            if (focusedStack == null || focusedStack.isAssistantStack()) {
            if (focusedStack == null || focusedStack.isActivityTypeAssistant()) {
                return false;
                return false;
            }
            }
@@ -13050,7 +13050,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            pae = new PendingAssistExtras(activity, extras, intent, hint, receiver, receiverExtras,
            pae = new PendingAssistExtras(activity, extras, intent, hint, receiver, receiverExtras,
                    userHandle);
                    userHandle);
            pae.isHome = activity.isHomeActivity();
            pae.isHome = activity.isActivityTypeHome();
            // Increment the sessionId if necessary
            // Increment the sessionId if necessary
            if (newSessionId) {
            if (newSessionId) {
+20 −41
Original line number Original line Diff line number Diff line
@@ -33,6 +33,12 @@ import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_DOWN;
import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_UP;
import static android.app.ActivityOptions.ANIM_THUMBNAIL_SCALE_UP;
import static android.app.AppOpsManager.MODE_ALLOWED;
import static android.app.AppOpsManager.MODE_ALLOWED;
import static android.app.AppOpsManager.OP_PICTURE_IN_PICTURE;
import static android.app.AppOpsManager.OP_PICTURE_IN_PICTURE;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.activityTypeToString;
import static android.content.Intent.ACTION_MAIN;
import static android.content.Intent.ACTION_MAIN;
import static android.content.Intent.CATEGORY_HOME;
import static android.content.Intent.CATEGORY_HOME;
import static android.content.Intent.CATEGORY_LAUNCHER;
import static android.content.Intent.CATEGORY_LAUNCHER;
@@ -226,12 +232,6 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
    private final boolean componentSpecified;  // did caller specify an explicit component?
    private final boolean componentSpecified;  // did caller specify an explicit component?
    final boolean rootVoiceInteraction;  // was this the root activity of a voice interaction?
    final boolean rootVoiceInteraction;  // was this the root activity of a voice interaction?


    static final int APPLICATION_ACTIVITY_TYPE = 0;
    static final int HOME_ACTIVITY_TYPE = 1;
    static final int RECENTS_ACTIVITY_TYPE = 2;
    static final int ASSISTANT_ACTIVITY_TYPE = 3;
    int mActivityType;

    private CharSequence nonLocalizedLabel;  // the label information from the package mgr.
    private CharSequence nonLocalizedLabel;  // the label information from the package mgr.
    private int labelRes;           // the label information from the package mgr.
    private int labelRes;           // the label information from the package mgr.
    private int icon;               // resource identifier of activity's icon.
    private int icon;               // resource identifier of activity's icon.
@@ -388,7 +388,8 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
        }
        }
        pw.print(prefix); pw.print("stateNotNeeded="); pw.print(stateNotNeeded);
        pw.print(prefix); pw.print("stateNotNeeded="); pw.print(stateNotNeeded);
                pw.print(" componentSpecified="); pw.print(componentSpecified);
                pw.print(" componentSpecified="); pw.print(componentSpecified);
                pw.print(" mActivityType="); pw.println(mActivityType);
                pw.print(" mActivityType="); pw.println(
                        activityTypeToString(getActivityType()));
        if (rootVoiceInteraction) {
        if (rootVoiceInteraction) {
            pw.print(prefix); pw.print("rootVoiceInteraction="); pw.println(rootVoiceInteraction);
            pw.print(prefix); pw.print("rootVoiceInteraction="); pw.println(rootVoiceInteraction);
        }
        }
@@ -495,7 +496,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
        pw.print(prefix); pw.print("frozenBeforeDestroy="); pw.print(frozenBeforeDestroy);
        pw.print(prefix); pw.print("frozenBeforeDestroy="); pw.print(frozenBeforeDestroy);
                pw.print(" forceNewConfig="); pw.println(forceNewConfig);
                pw.print(" forceNewConfig="); pw.println(forceNewConfig);
        pw.print(prefix); pw.print("mActivityType=");
        pw.print(prefix); pw.print("mActivityType=");
                pw.println(activityTypeToString(mActivityType));
                pw.println(activityTypeToString(getActivityType()));
        if (requestedVrComponent != null) {
        if (requestedVrComponent != null) {
            pw.print(prefix);
            pw.print(prefix);
            pw.print("requestedVrComponent=");
            pw.print("requestedVrComponent=");
@@ -938,7 +939,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
                task.voiceSession != null, mLaunchTaskBehind, isAlwaysFocusable(),
                task.voiceSession != null, mLaunchTaskBehind, isAlwaysFocusable(),
                appInfo.targetSdkVersion, mRotationAnimationHint,
                appInfo.targetSdkVersion, mRotationAnimationHint,
                ActivityManagerService.getInputDispatchingTimeoutLocked(this) * 1000000L,
                ActivityManagerService.getInputDispatchingTimeoutLocked(this) * 1000000L,
                getOverrideConfiguration(), mBounds);
                new Configuration(getOverrideConfiguration()), mBounds);


        task.addActivityToTop(this);
        task.addActivityToTop(this);


@@ -1028,10 +1029,11 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo


    private void setActivityType(boolean componentSpecified, int launchedFromUid, Intent intent,
    private void setActivityType(boolean componentSpecified, int launchedFromUid, Intent intent,
            ActivityOptions options, ActivityRecord sourceRecord) {
            ActivityOptions options, ActivityRecord sourceRecord) {
        int activityType = ACTIVITY_TYPE_UNDEFINED;
        if ((!componentSpecified || canLaunchHomeActivity(launchedFromUid, sourceRecord))
        if ((!componentSpecified || canLaunchHomeActivity(launchedFromUid, sourceRecord))
                && isHomeIntent(intent) && !isResolverActivity()) {
                && isHomeIntent(intent) && !isResolverActivity()) {
            // This sure looks like a home activity!
            // This sure looks like a home activity!
            mActivityType = HOME_ACTIVITY_TYPE;
            activityType = ACTIVITY_TYPE_HOME;


            if (info.resizeMode == RESIZE_MODE_FORCE_RESIZEABLE
            if (info.resizeMode == RESIZE_MODE_FORCE_RESIZEABLE
                    || info.resizeMode == RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION) {
                    || info.resizeMode == RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION) {
@@ -1039,13 +1041,12 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
                info.resizeMode = RESIZE_MODE_UNRESIZEABLE;
                info.resizeMode = RESIZE_MODE_UNRESIZEABLE;
            }
            }
        } else if (realActivity.getClassName().contains(RECENTS_PACKAGE_NAME)) {
        } else if (realActivity.getClassName().contains(RECENTS_PACKAGE_NAME)) {
            mActivityType = RECENTS_ACTIVITY_TYPE;
            activityType = ACTIVITY_TYPE_RECENTS;
        } else if (options != null && options.getLaunchStackId() == ASSISTANT_STACK_ID
        } else if (options != null && options.getLaunchStackId() == ASSISTANT_STACK_ID
                && canLaunchAssistActivity(launchedFromPackage)) {
                && canLaunchAssistActivity(launchedFromPackage)) {
            mActivityType = ASSISTANT_ACTIVITY_TYPE;
            activityType = ACTIVITY_TYPE_ASSISTANT;
        } else {
            mActivityType = APPLICATION_ACTIVITY_TYPE;
        }
        }
        setActivityType(activityType);
    }
    }


    void setTaskToAffiliateWith(TaskRecord taskToAffiliateWith) {
    void setTaskToAffiliateWith(TaskRecord taskToAffiliateWith) {
@@ -1096,18 +1097,6 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
        return stack != null && stack.isInStackLocked(this) != null;
        return stack != null && stack.isInStackLocked(this) != null;
    }
    }


    boolean isHomeActivity() {
        return mActivityType == HOME_ACTIVITY_TYPE;
    }

    boolean isRecentsActivity() {
        return mActivityType == RECENTS_ACTIVITY_TYPE;
    }

    boolean isAssistantActivity() {
        return mActivityType == ASSISTANT_ACTIVITY_TYPE;
    }

    boolean isPersistable() {
    boolean isPersistable() {
        return (info.persistableMode == PERSIST_ROOT_ONLY ||
        return (info.persistableMode == PERSIST_ROOT_ONLY ||
                info.persistableMode == PERSIST_ACROSS_REBOOTS) &&
                info.persistableMode == PERSIST_ACROSS_REBOOTS) &&
@@ -1134,7 +1123,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
     * @return whether this activity supports PiP multi-window and can be put in the pinned stack.
     * @return whether this activity supports PiP multi-window and can be put in the pinned stack.
     */
     */
    boolean supportsPictureInPicture() {
    boolean supportsPictureInPicture() {
        return service.mSupportsPictureInPicture && !isHomeActivity()
        return service.mSupportsPictureInPicture && isActivityTypeStandard()
                && info.supportsPictureInPicture();
                && info.supportsPictureInPicture();
    }
    }


@@ -1160,7 +1149,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
     * @return whether this activity supports non-PiP multi-window.
     * @return whether this activity supports non-PiP multi-window.
     */
     */
    private boolean supportsResizeableMultiWindow() {
    private boolean supportsResizeableMultiWindow() {
        return service.mSupportsMultiWindow && !isHomeActivity()
        return service.mSupportsMultiWindow && !isActivityTypeHome()
                && (ActivityInfo.isResizeableMode(info.resizeMode)
                && (ActivityInfo.isResizeableMode(info.resizeMode)
                        || service.mForceResizableActivities);
                        || service.mForceResizableActivities);
    }
    }
@@ -1537,7 +1526,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo


        boolean isVisible = !behindFullscreenActivity || mLaunchTaskBehind;
        boolean isVisible = !behindFullscreenActivity || mLaunchTaskBehind;


        if (service.mSupportsLeanbackOnly && isVisible && isRecentsActivity()) {
        if (service.mSupportsLeanbackOnly && isVisible && isActivityTypeRecents()) {
            // On devices that support leanback only (Android TV), Recents activity can only be
            // On devices that support leanback only (Android TV), Recents activity can only be
            // visible if the home stack is the focused stack or we are in split-screen mode.
            // visible if the home stack is the focused stack or we are in split-screen mode.
            isVisible = mStackSupervisor.getStack(DOCKED_STACK_ID) != null
            isVisible = mStackSupervisor.getStack(DOCKED_STACK_ID) != null
@@ -1615,7 +1604,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
        newIntents = null;
        newIntents = null;
        stopped = false;
        stopped = false;


        if (isHomeActivity()) {
        if (isActivityTypeHome()) {
            ProcessRecord app = task.mActivities.get(0).app;
            ProcessRecord app = task.mActivities.get(0).app;
            if (app != null && app != service.mHomeProcess) {
            if (app != null && app != service.mHomeProcess) {
                service.mHomeProcess = app;
                service.mHomeProcess = app;
@@ -2145,7 +2134,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
            config.getOverrideConfiguration());
            config.getOverrideConfiguration());
    }
    }


    void setLastReportedConfiguration(Configuration global, Configuration override) {
    private void setLastReportedConfiguration(Configuration global, Configuration override) {
        mLastReportedConfiguration.setConfiguration(global, override);
        mLastReportedConfiguration.setConfiguration(global, override);
    }
    }


@@ -2718,16 +2707,6 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo
        return r;
        return r;
    }
    }


    private static String activityTypeToString(int type) {
        switch (type) {
            case APPLICATION_ACTIVITY_TYPE: return "APPLICATION_ACTIVITY_TYPE";
            case HOME_ACTIVITY_TYPE: return "HOME_ACTIVITY_TYPE";
            case RECENTS_ACTIVITY_TYPE: return "RECENTS_ACTIVITY_TYPE";
            case ASSISTANT_ACTIVITY_TYPE: return "ASSISTANT_ACTIVITY_TYPE";
            default: return Integer.toString(type);
        }
    }

    private static boolean isInVrUiMode(Configuration config) {
    private static boolean isInVrUiMode(Configuration config) {
        return (config.uiMode & UI_MODE_TYPE_MASK) == UI_MODE_TYPE_VR_HEADSET;
        return (config.uiMode & UI_MODE_TYPE_MASK) == UI_MODE_TYPE_VR_HEADSET;
    }
    }
+61 −86

File changed.

Preview size limit exceeded, changes collapsed.

Loading