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

Commit 04321bf3 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android Git Automerger
Browse files

am a79239b1: Merge change I2d844842 into eclair

Merge commit 'a79239b1' into eclair-plus-aosp

* commit 'a79239b1':
  Fix for NPE in #2248683
parents d1fa9316 a79239b1
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1403,13 +1403,17 @@ public class ManageApplications extends ListActivity implements
                    }
                } else {
                    final String prefixString = prefix.toString().toLowerCase();
                    final String spacePrefixString = " " + prefixString;
                    Map<String, String> newMap = new HashMap<String, String>();
                    synchronized (mFilterLock) {
                        Map<String, String> localMap = mFilterMap;
                        Set<String> keys = mFilterMap.keySet();
                        for (String key : keys) {
                            String label = localMap.get(key);
                            if (label.indexOf(prefixString) != -1) {
                            if (label == null) continue;
                            label = label.toLowerCase();
                            if (label.startsWith(prefixString)
                                    || label.indexOf(spacePrefixString) != -1) {
                                newMap.put(key, label);
                            }
                        }
@@ -1895,6 +1899,9 @@ public class ManageApplications extends ListActivity implements
        public final int compare(ApplicationInfo a, ApplicationInfo b) {
            AppInfo ainfo = mCache.getEntry(a.packageName);
            AppInfo binfo = mCache.getEntry(b.packageName);
            // Check for null app names, to avoid NPE in rare cases
            if (ainfo == null || ainfo.appName == null) return -1;
            if (binfo == null || binfo.appName == null) return 1;
            return sCollator.compare(ainfo.appName.toString(), binfo.appName.toString());
        }
    }