summaryrefslogtreecommitdiffstats
path: root/services/backup
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2015-08-28 10:55:14 -0700
committerChristopher Tate <ctate@google.com>2015-08-28 10:59:25 -0700
commit0d446c18dc84f8db522823f24983b8e71a0b0f04 (patch)
tree26003cdb2cc2ef2ff740e2dcfb55d90fad73cbc6 /services/backup
parent3883e72aeda7dcc5f76eba7ad2e95ad2cb041687 (diff)
downloadframeworks_base-0d446c18dc84f8db522823f24983b8e71a0b0f04.zip
frameworks_base-0d446c18dc84f8db522823f24983b8e71a0b0f04.tar.gz
frameworks_base-0d446c18dc84f8db522823f24983b8e71a0b0f04.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/backup')
-rw-r--r--services/backup/java/com/android/server/backup/BackupManagerService.java10
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);
+ }
}
}