diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-04-13 18:21:45 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-04-13 18:21:45 -0700 |
commit | baa0fd95cf23c30aa440867dba2848ae3a50dc2b (patch) | |
tree | b993e16e39011af0aa96009273b73767b45a4a0c /services | |
parent | 6d1127228564b4506c78ad13cd681ea96d336525 (diff) | |
parent | 7b16f95cd293cedd2b9204428088ea3e2f8399e5 (diff) | |
download | frameworks_base-baa0fd95cf23c30aa440867dba2848ae3a50dc2b.zip frameworks_base-baa0fd95cf23c30aa440867dba2848ae3a50dc2b.tar.gz frameworks_base-baa0fd95cf23c30aa440867dba2848ae3a50dc2b.tar.bz2 |
am 7b16f95c: am 8e1f2f88: Merge "Fix issue #2555171: Switching to app immediately after unmounting..." into froyo
Merge commit '7b16f95cd293cedd2b9204428088ea3e2f8399e5' into kraken
* commit '7b16f95cd293cedd2b9204428088ea3e2f8399e5':
Fix issue #2555171: Switching to app immediately after unmounting...
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index bc26fa0..b6f323d 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -6867,6 +6867,8 @@ public final class ActivityManagerService extends ActivityManagerNative implemen enforceCallingPermission(android.Manifest.permission.GET_TASKS, "getRecentTasks()"); + IPackageManager pm = ActivityThread.getPackageManager(); + final int N = mRecentTasks.size(); ArrayList<ActivityManager.RecentTaskInfo> res = new ArrayList<ActivityManager.RecentTaskInfo>( @@ -6883,6 +6885,25 @@ public final class ActivityManagerService extends ActivityManagerNative implemen rti.baseIntent = new Intent( tr.intent != null ? tr.intent : tr.affinityIntent); rti.origActivity = tr.origActivity; + + if ((flags&ActivityManager.RECENT_IGNORE_UNAVAILABLE) != 0) { + // Check whether this activity is currently available. + try { + if (rti.origActivity != null) { + if (pm.getActivityInfo(rti.origActivity, 0) == null) { + continue; + } + } else if (rti.baseIntent != null) { + if (pm.queryIntentActivities(rti.baseIntent, + null, 0) == null) { + continue; + } + } + } catch (RemoteException e) { + // Will never happen. + } + } + res.add(rti); maxNum--; } |