diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-04-13 18:07:27 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-04-13 18:07:27 -0700 |
commit | 8e1f2f8804a1f63c7a03a3eeced9ffdf6e6c3293 (patch) | |
tree | ef2e627ee57c43b0aa60e49f1bdab1964dfba66d /services | |
parent | ce73c1e5bfd36154d21ee7b332cfdc6cea48812e (diff) | |
parent | 53d9264de4f99a069dd7306f881d28ddd5956b35 (diff) | |
download | frameworks_base-8e1f2f8804a1f63c7a03a3eeced9ffdf6e6c3293.zip frameworks_base-8e1f2f8804a1f63c7a03a3eeced9ffdf6e6c3293.tar.gz frameworks_base-8e1f2f8804a1f63c7a03a3eeced9ffdf6e6c3293.tar.bz2 |
Merge "Fix issue #2555171: Switching to app immediately after unmounting..." into froyo
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--; } |