am 7f76e505: Merge "Fixing invalid check to get component enabled state. (Bug 17679693)" into lmp-dev

* commit '7f76e505624fddbc4ba3350f3e381ccd275a5a75':
  Fixing invalid check to get component enabled state. (Bug 17679693)
This commit is contained in:
Winson Chung
2014-10-01 22:59:26 +00:00
committed by Android Git Automerger
2 changed files with 7 additions and 5 deletions

View File

@@ -2031,7 +2031,7 @@ public final class ActivityManagerService extends ActivityManagerNative
@Override
public void onPackageModified(String packageName) {
final int eventUserId = getChangingUserId();
final PackageManager pm = mContext.getPackageManager();
final IPackageManager pm = AppGlobals.getPackageManager();
final ArrayList<Pair<Intent, Integer>> recentTaskIntents =
new ArrayList<Pair<Intent, Integer>>();
final HashSet<ComponentName> componentsKnownToExist = new HashSet<ComponentName>();
@@ -2056,13 +2056,15 @@ public final class ActivityManagerService extends ActivityManagerNative
continue;
}
try {
ActivityInfo info = pm.getActivityInfo(cn, eventUserId);
if (info != null && info.isEnabled()) {
ActivityInfo info = pm.getActivityInfo(cn, 0, eventUserId);
if (info != null) {
componentsKnownToExist.add(cn);
} else {
tasksToRemove.add(p.second);
}
} catch (Exception e) {}
} catch (RemoteException e) {
Log.e(TAG, "Failed to query activity info for component: " + cn, e);
}
}
}
// Prune all the tasks with removed components from the list of recent tasks

View File

@@ -254,7 +254,7 @@ public class LauncherAppsService extends SystemService {
try {
IPackageManager pm = AppGlobals.getPackageManager();
ActivityInfo info = pm.getActivityInfo(component, 0, user.getIdentifier());
return info != null && info.isEnabled();
return info != null;
} finally {
Binder.restoreCallingIdentity(ident);
}