diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-11-22 15:59:56 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2010-11-22 18:35:55 -0800 |
commit | 621e17de87f18003aba2dedb719a2941020a7902 (patch) | |
tree | 978b402ced5bd03d3b4f6eaa9fbaaf186427823c /packages | |
parent | 703c5f39c58168829e8d8f7ed7b5aea3f4fb600b (diff) | |
download | frameworks_base-621e17de87f18003aba2dedb719a2941020a7902.zip frameworks_base-621e17de87f18003aba2dedb719a2941020a7902.tar.gz frameworks_base-621e17de87f18003aba2dedb719a2941020a7902.tar.bz2 |
Implement issue #3221502: New APIs to support new back stack / task navigation
What this adds:
- A new Intent activity flag to completely replace an existing task.
- A new Intent activity flag to bring the current home task up behind
a new task being started/brought to the foreground.
- New versions of startActivity() that take an array of Intents to be
started, allowing applications to start a task in a specific state.
- A public moveTaskToFront() method on ActivityManager, with a new flag
that allows the caller to have the task moved to the front with the
current home task immediately behind it.
Change-Id: Ie8028d09acffb5349d98043c67676daba09f75c8
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recent/RecentApplicationsActivity.java | 11 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java | 10 |
2 files changed, 10 insertions, 11 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentApplicationsActivity.java b/packages/SystemUI/src/com/android/systemui/recent/RecentApplicationsActivity.java index ff2a4ed..a98ef0b 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentApplicationsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentApplicationsActivity.java @@ -193,14 +193,13 @@ public class RecentApplicationsActivity extends Activity { ActivityDescription item = mActivityDescriptions.get(n); if (item.id >= 0) { // This is an active task; it should just go to the foreground. - IActivityManager am = ActivityManagerNative.getDefault(); - try { - am.moveTaskToFront(item.id); - } catch (RemoteException e) { - } + final ActivityManager am = (ActivityManager) + getSystemService(Context.ACTIVITY_SERVICE); + am.moveTaskToFront(item.id, ActivityManager.MOVE_TASK_WITH_HOME); } else if (item.intent != null) { // prepare a launch intent and send it - item.intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY); + item.intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY + | Intent.FLAG_ACTIVITY_TASK_ON_HOME); try { if (DBG) Log.v(TAG, "Starting intent " + item.intent); startActivity(item.intent); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java index e0b05f9..0c31304 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/RecentAppsPanel.java @@ -252,13 +252,13 @@ public class RecentAppsPanel extends LinearLayout implements StatusBarPanel, OnC ActivityDescription ad = (ActivityDescription)v.getTag(); if (ad.id >= 0) { // This is an active task; it should just go to the foreground. - IActivityManager am = ActivityManagerNative.getDefault(); - try { - am.moveTaskToFront(ad.id); - } catch (RemoteException e) { - } + final ActivityManager am = (ActivityManager) + getContext().getSystemService(Context.ACTIVITY_SERVICE); + am.moveTaskToFront(ad.id, ActivityManager.MOVE_TASK_WITH_HOME); } else { Intent intent = ad.intent; + intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY + | Intent.FLAG_ACTIVITY_TASK_ON_HOME); if (DEBUG) Log.v(TAG, "Starting activity " + intent); getContext().startActivity(intent); } |