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

Commit 2c1faed4 authored by Craig Mautner's avatar Craig Mautner
Browse files

Set task and activity types when adding to task.

Activities from the home package were causing tasks types to change from
application to home. This was not the intention of setting the task type
when adding an activity. This change sets the task type to the inherent
type of the first activity added. All subsequent activities added to the
task then inherent the task's type overriding the inherent type of the
task.

Fixes bug 9972495.

Change-Id: Ib77675aea790ea64d4f166af62c7138e89356c13
parent d1233575
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ final class ActivityRecord {
    static final int APPLICATION_ACTIVITY_TYPE = 0;
    static final int HOME_ACTIVITY_TYPE = 1;
    static final int RECENTS_ACTIVITY_TYPE = 2;
    final int mActivityType;
    int mActivityType;

    final String baseDir;   // where activity source (resources etc) located
    final String resDir;   // where public activity source (public resources etc) located
+9 −5
Original line number Diff line number Diff line
@@ -57,7 +57,8 @@ final class TaskRecord extends ThumbnailHolder {
    /** Current stack */
    ActivityStack stack;

    private boolean mApplicationTask = true;
    /** Takes on same set of values as ActivityRecord.mActivityType */
    private int mTaskType;

    TaskRecord(int _taskId, ActivityInfo info, Intent _intent) {
        taskId = _taskId;
@@ -163,9 +164,12 @@ final class TaskRecord extends ThumbnailHolder {
            // Was not previously in list.
            numFullscreen++;
        }
        // Only set this to be an application task if it has not already been set as home task.
        if (mApplicationTask) {
            mApplicationTask = r.isApplicationActivity();
        // Only set this based on the first activity
        if (mActivities.isEmpty()) {
            mTaskType = r.mActivityType;
        } else {
            // Otherwise make all added activities match this one.
            r.mActivityType = mTaskType;
        }
        mActivities.add(index, r);
    }
@@ -319,7 +323,7 @@ final class TaskRecord extends ThumbnailHolder {
    }

    boolean isApplicationTask() {
        return mApplicationTask;
        return mTaskType == ActivityRecord.APPLICATION_ACTIVITY_TYPE;
    }

    public TaskAccessInfo getTaskAccessInfoLocked(boolean inclThumbs) {