OSDN Git Service

Fix issue #2574016: Preferred activity setting is not persistent
authorDianne Hackborn <hackbod@google.com>
Wed, 7 Apr 2010 03:24:15 +0000 (20:24 -0700)
committerDianne Hackborn <hackbod@google.com>
Wed, 7 Apr 2010 03:24:15 +0000 (20:24 -0700)
The recent tasks UI was trying to retrieve the current home activity
in the wrong way, causing it to be a different match of activities and
thus clearing any preferred activity that was set.

In the future we should look at what the package manager is doing here
and make it more robust in how it clears the list...  but for now,
this is the safest thing.

Change-Id: Idc917dffa7d05d62671213414387e8bdb2e34bea

phone/com/android/internal/policy/impl/RecentApplicationsDialog.java

index 8287253..3a09185 100644 (file)
@@ -173,9 +173,9 @@ public class RecentApplicationsDialog extends Dialog implements OnClickListener
         final List<ActivityManager.RecentTaskInfo> recentTasks =
                                         am.getRecentTasks(MAX_RECENT_TASKS, 0);
 
-        ResolveInfo homeInfo = pm.resolveActivity(
-                new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME),
-                0);
+        ActivityInfo homeInfo = 
+            new Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_HOME)
+                    .resolveActivityInfo(pm, 0);
 
         IconUtilities iconUtilities = new IconUtilities(getContext());
 
@@ -197,9 +197,9 @@ public class RecentApplicationsDialog extends Dialog implements OnClickListener
 
             // Skip the current home activity.
             if (homeInfo != null) {
-                if (homeInfo.activityInfo.packageName.equals(
+                if (homeInfo.packageName.equals(
                         intent.getComponent().getPackageName())
-                        && homeInfo.activityInfo.name.equals(
+                        && homeInfo.name.equals(
                                 intent.getComponent().getClassName())) {
                     continue;
                 }