From 3cce600614c2a2643ae9a38c6ed87c06c7bab0b6 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 6 Apr 2010 20:24:15 -0700 Subject: [PATCH] Fix issue #2574016: Preferred activity setting is not persistent 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 --- .../android/internal/policy/impl/RecentApplicationsDialog.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phone/com/android/internal/policy/impl/RecentApplicationsDialog.java b/phone/com/android/internal/policy/impl/RecentApplicationsDialog.java index 8287253..3a09185 100644 --- a/phone/com/android/internal/policy/impl/RecentApplicationsDialog.java +++ b/phone/com/android/internal/policy/impl/RecentApplicationsDialog.java @@ -173,9 +173,9 @@ public class RecentApplicationsDialog extends Dialog implements OnClickListener final List 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; } -- 2.11.0