Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e65c77e9 authored by Winson Chung's avatar Winson Chung Committed by The Android Automerger
Browse files

Fixing invalid check to get component enabled state. (Bug 17679693)

Change-Id: I225d59bf766122d667d990d7e5b1971c6e8af2aa
parent f1bda201
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -2031,7 +2031,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        @Override
        @Override
        public void onPackageModified(String packageName) {
        public void onPackageModified(String packageName) {
            final int eventUserId = getChangingUserId();
            final int eventUserId = getChangingUserId();
            final PackageManager pm = mContext.getPackageManager();
            final IPackageManager pm = AppGlobals.getPackageManager();
            final ArrayList<Pair<Intent, Integer>> recentTaskIntents =
            final ArrayList<Pair<Intent, Integer>> recentTaskIntents =
                    new ArrayList<Pair<Intent, Integer>>();
                    new ArrayList<Pair<Intent, Integer>>();
            final HashSet<ComponentName> componentsKnownToExist = new HashSet<ComponentName>();
            final HashSet<ComponentName> componentsKnownToExist = new HashSet<ComponentName>();
@@ -2056,13 +2056,15 @@ public final class ActivityManagerService extends ActivityManagerNative
                        continue;
                        continue;
                    }
                    }
                    try {
                    try {
                        ActivityInfo info = pm.getActivityInfo(cn, eventUserId);
                        ActivityInfo info = pm.getActivityInfo(cn, 0, eventUserId);
                        if (info != null && info.isEnabled()) {
                        if (info != null) {
                            componentsKnownToExist.add(cn);
                            componentsKnownToExist.add(cn);
                        } else {
                        } else {
                            tasksToRemove.add(p.second);
                            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
            // Prune all the tasks with removed components from the list of recent tasks
+1 −1
Original line number Original line Diff line number Diff line
@@ -254,7 +254,7 @@ public class LauncherAppsService extends SystemService {
            try {
            try {
                IPackageManager pm = AppGlobals.getPackageManager();
                IPackageManager pm = AppGlobals.getPackageManager();
                ActivityInfo info = pm.getActivityInfo(component, 0, user.getIdentifier());
                ActivityInfo info = pm.getActivityInfo(component, 0, user.getIdentifier());
                return info != null && info.isEnabled();
                return info != null;
            } finally {
            } finally {
                Binder.restoreCallingIdentity(ident);
                Binder.restoreCallingIdentity(ident);
            }
            }