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

Commit 211c8077 authored by Louis Chang's avatar Louis Chang Committed by Automerger Merge Worker
Browse files

Merge "Ensure the activity type is set to the activity" into udc-dev am: b255015e

parents 6602a837 b255015e
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -9060,8 +9060,13 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        }
        if (activityType != ACTIVITY_TYPE_UNDEFINED
                && activityType != getActivityType()) {
            Slog.w(TAG, "Can't change activity type once set: " + this
                    + " activityType=" + activityTypeToString(getActivityType()));
            final String errorMessage = "Can't change activity type once set: " + this
                    + " activityType=" + activityTypeToString(getActivityType()) + ", was "
                    + activityTypeToString(activityType);
            if (Build.IS_DEBUGGABLE) {
                throw new IllegalStateException(errorMessage);
            }
            Slog.w(TAG, errorMessage);
        }

        // Configuration's equality doesn't consider seq so if only seq number changes in resolved
+12 −6
Original line number Diff line number Diff line
@@ -1450,14 +1450,22 @@ class Task extends TaskFragment {

        // Only set this based on the first activity
        if (!hadActivity) {
            if (r.getActivityType() == ACTIVITY_TYPE_UNDEFINED) {
            int activityOverrideType =
                    r.getRequestedOverrideConfiguration().windowConfiguration.getActivityType();
            if (activityOverrideType == ACTIVITY_TYPE_UNDEFINED) {
                // Normally non-standard activity type for the activity record will be set when the
                // object is created, however we delay setting the standard application type until
                // this point so that the task can set the type for additional activities added in
                // the else condition below.
                r.setActivityType(ACTIVITY_TYPE_STANDARD);
            }
            setActivityType(r.getActivityType());
                activityOverrideType = activityType != ACTIVITY_TYPE_UNDEFINED ? activityType
                        : ACTIVITY_TYPE_STANDARD;
                // Set the Activity's requestedOverrideConfiguration directly to reduce
                // WC#onConfigurationChanged calls since it will be called while setting the
                // Task's activity type below.
                r.getRequestedOverrideConfiguration().windowConfiguration.setActivityType(
                        activityOverrideType);
            }
            setActivityType(activityOverrideType);
            isPersistable = r.isPersistable();
            mCallingUid = r.launchedFromUid;
            mCallingPackage = r.launchedFromPackage;
@@ -5799,8 +5807,6 @@ class Task extends TaskFragment {
            final int activityType = getActivityType();
            task = new Task.Builder(mAtmService)
                    .setTaskId(taskId)
                    .setActivityType(activityType != ACTIVITY_TYPE_UNDEFINED ? activityType
                            : ACTIVITY_TYPE_STANDARD)
                    .setActivityInfo(info)
                    .setActivityOptions(options)
                    .setIntent(intent)