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

Commit f2b20054 authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by Android (Google) Code Review
Browse files

Merge "Don't require unrelated permissions for install archived." into main

parents ca120d0f 71bb10f5
Loading
Loading
Loading
Loading
+17 −14
Original line number Diff line number Diff line
@@ -1683,13 +1683,15 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
                archivedPackageParcel);

        // Create and commit install archived session.
        // Session belongs to the system_server and would not appear anywhere in the Public APIs.
        Binder.withCleanCallingIdentity(() -> {
            PackageInstallerSession session = null;
            try {
            var sessionId = createSessionInternal(params, installerPackageName,
                    null /*installerAttributionTag*/, Binder.getCallingUid(), userId);
                var sessionId = createSessionInternal(params, installerPackageName, null
                        /*installerAttributionTag*/, Binder.getCallingUid(), userId);
                session = openSessionInternal(sessionId);
            session.addFile(LOCATION_DATA_APP, "base", 0 /*lengthBytes*/, metadata.toByteArray(),
                    null /*signature*/);
                session.addFile(LOCATION_DATA_APP, "base", 0 /*lengthBytes*/,
                        metadata.toByteArray(), null /*signature*/);
                session.commit(statusReceiver, false /*forTransfer*/);
            } catch (IOException e) {
                throw ExceptionUtils.wrap(e);
@@ -1698,6 +1700,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
                    session.close();
                }
            }
        });
    }

    // TODO(b/307299702) Implement error dialog and propagate userActionIntent.