diff options
author | Craig Mautner <cmautner@google.com> | 2013-07-23 12:56:02 -0700 |
---|---|---|
committer | Craig Mautner <cmautner@google.com> | 2013-07-23 13:15:37 -0700 |
commit | 2c1faed4123baca6d5c2d87a7609da0fb33cbbd9 (patch) | |
tree | efc69bb169e30562d403fd043882e53a4be60c8e | |
parent | d1233575b558d3dc585f7e04ff1377c24f3beaf4 (diff) | |
download | frameworks_base-2c1faed4123baca6d5c2d87a7609da0fb33cbbd9.zip frameworks_base-2c1faed4123baca6d5c2d87a7609da0fb33cbbd9.tar.gz frameworks_base-2c1faed4123baca6d5c2d87a7609da0fb33cbbd9.tar.bz2 |
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
-rw-r--r-- | services/java/com/android/server/am/ActivityRecord.java | 2 | ||||
-rw-r--r-- | services/java/com/android/server/am/TaskRecord.java | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java index b858755..bf3713b 100644 --- a/services/java/com/android/server/am/ActivityRecord.java +++ b/services/java/com/android/server/am/ActivityRecord.java @@ -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 diff --git a/services/java/com/android/server/am/TaskRecord.java b/services/java/com/android/server/am/TaskRecord.java index ebcf22a..63793fa 100644 --- a/services/java/com/android/server/am/TaskRecord.java +++ b/services/java/com/android/server/am/TaskRecord.java @@ -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) { |