summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBjorn Bringert <bringert@android.com>2010-02-10 23:12:39 +0000
committerBjorn Bringert <bringert@android.com>2010-02-10 23:12:39 +0000
commitaff3859c161a390e5057825efd1640e63bc69b48 (patch)
treef2d45721b3ef9e86a670aced222ad46a58737e7b /src
parent42241e75d2775b6b44b82b939e66fbb50d4b189b (diff)
downloadpackages_apps_Settings-aff3859c161a390e5057825efd1640e63bc69b48.tar.gz
packages_apps_Settings-aff3859c161a390e5057825efd1640e63bc69b48.tar.bz2
packages_apps_Settings-aff3859c161a390e5057825efd1640e63bc69b48.zip
Guard against null from queryBroadcastReceivers()
See http://b/issue?id=2418982 Change-Id: I7bb62820275423504872de075dc126b6e717afcf
Diffstat (limited to 'src')
-rw-r--r--src/com/android/settings/DeviceAdminSettings.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/settings/DeviceAdminSettings.java b/src/com/android/settings/DeviceAdminSettings.java
index cbf446de6..a36fc8af4 100644
--- a/src/com/android/settings/DeviceAdminSettings.java
+++ b/src/com/android/settings/DeviceAdminSettings.java
@@ -87,7 +87,8 @@ public class DeviceAdminSettings extends ListActivity {
List<ResolveInfo> avail = getPackageManager().queryBroadcastReceivers(
new Intent(DeviceAdmin.ACTION_DEVICE_ADMIN_ENABLED),
PackageManager.GET_META_DATA);
- for (int i=0; i<avail.size(); i++) {
+ int count = avail == null ? 0 : avail.size();
+ for (int i=0; i<count; i++) {
ResolveInfo ri = avail.get(i);
try {
DeviceAdminInfo dpi = new DeviceAdminInfo(this, ri);