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

Commit b6b58f66 authored by Christopher Tate's avatar Christopher Tate Committed by The Android Automerger
Browse files

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
parent b9880c44
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1955,12 +1955,14 @@ public class BackupManagerService {
                .setPackage(pkgInfo.packageName);
        List<ResolveInfo> hosts = mPackageManager.queryIntentServicesAsUser(
                intent, 0, UserHandle.USER_OWNER);
        if (hosts != null) {
            final int N = hosts.size();
            for (int i = 0; i < N; i++) {
                final ServiceInfo info = hosts.get(i).serviceInfo;
                tryBindTransport(info);
            }
        }
    }

    // Verify that the service exists and is hosted by a privileged app, then proceed to bind
    boolean tryBindTransport(ServiceInfo info) {