summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-11-11 19:15:47 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-11-11 19:15:47 -0800
commita79239b102f7b9c83e31be7b3a47ab50459b6a4f (patch)
treecc24b5207570cff44a0375c1299a3d19330f5b0f /src/com
parent6b23b2700c2c5a2766ec2ab23d83a6e3ba7ab26c (diff)
parentf6b384045db92e1a47fa1135405e5618f4bf8d24 (diff)
downloadpackages_apps_settings-a79239b102f7b9c83e31be7b3a47ab50459b6a4f.zip
packages_apps_settings-a79239b102f7b9c83e31be7b3a47ab50459b6a4f.tar.gz
packages_apps_settings-a79239b102f7b9c83e31be7b3a47ab50459b6a4f.tar.bz2
Merge change I2d844842 into eclair
* changes: Fix for NPE in #2248683
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/settings/ManageApplications.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/settings/ManageApplications.java b/src/com/android/settings/ManageApplications.java
index a71d17b..9cd6e23 100644
--- a/src/com/android/settings/ManageApplications.java
+++ b/src/com/android/settings/ManageApplications.java
@@ -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());
}
}