diff options
author | Christopher Tate <ctate@google.com> | 2015-08-28 10:55:14 -0700 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-08-28 19:53:58 -0700 |
commit | b6b58f662eec6568c7b2eed10de8e10f35faa1ab (patch) | |
tree | fef1aa7eca97a10f0940591ba31726d1d641f942 /services | |
parent | b9880c44f8626151aaa4479d7b22124b87d2ecc2 (diff) | |
download | frameworks_base-b6b58f662eec6568c7b2eed10de8e10f35faa1ab.zip frameworks_base-b6b58f662eec6568c7b2eed10de8e10f35faa1ab.tar.gz frameworks_base-b6b58f662eec6568c7b2eed10de8e10f35faa1ab.tar.bz2 |
Crashing the system process is inadvisable
When asking for the set of services published by a package, it's
quite possible that there are none, in which case the returned List<>
is null rather than valid-but-empty. Don't bother looking at it
when it's null.
Bug 23614440
Change-Id: Ibebb26b9c3f75ec810a95f1b9d2663e884cb98bc
Diffstat (limited to 'services')
-rw-r--r-- | services/backup/java/com/android/server/backup/BackupManagerService.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java index 7c74a30..12003e2 100644 --- a/services/backup/java/com/android/server/backup/BackupManagerService.java +++ b/services/backup/java/com/android/server/backup/BackupManagerService.java @@ -1955,10 +1955,12 @@ public class BackupManagerService { .setPackage(pkgInfo.packageName); List<ResolveInfo> hosts = mPackageManager.queryIntentServicesAsUser( intent, 0, UserHandle.USER_OWNER); - final int N = hosts.size(); - for (int i = 0; i < N; i++) { - final ServiceInfo info = hosts.get(i).serviceInfo; - tryBindTransport(info); + if (hosts != null) { + final int N = hosts.size(); + for (int i = 0; i < N; i++) { + final ServiceInfo info = hosts.get(i).serviceInfo; + tryBindTransport(info); + } } } |