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

Commit 656a2a0d authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Read install session attrs before child elements

As otherwise the ATTR_INSTALL_REASON attribute would be read from the
TAG_GRANTED_RUNTIME_PERMISSION element.

Test: Restarted right after SUW was done and saw apps getting restored
      after reboot.
Change-Id: I53f37d8fee54b3cc2a000971d7244fa47f3509f2
Fixes: 70826795
parent ede3344e
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1613,6 +1613,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
            writeStringAttribute(out, ATTR_VOLUME_UUID, params.volumeUuid);
            writeIntAttribute(out, ATTR_INSTALL_REASON, params.installReason);

            writeGrantedRuntimePermissionsLocked(out, params.grantedRuntimePermissions);

            // Persist app icon if changed since last written
            File appIconFile = buildAppIconFile(sessionId, sessionsDir);
            if (params.appIcon == null && appIconFile.exists()) {
@@ -1632,8 +1634,6 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {

                params.appIconLastModified = appIconFile.lastModified();
            }

            writeGrantedRuntimePermissionsLocked(out, params.grantedRuntimePermissions);
        }

        out.endTag(null, TAG_SESSION);
@@ -1711,9 +1711,10 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
        params.referrerUri = readUriAttribute(in, ATTR_REFERRER_URI);
        params.abiOverride = readStringAttribute(in, ATTR_ABI_OVERRIDE);
        params.volumeUuid = readStringAttribute(in, ATTR_VOLUME_UUID);
        params.grantedRuntimePermissions = readGrantedRuntimePermissions(in);
        params.installReason = readIntAttribute(in, ATTR_INSTALL_REASON);

        params.grantedRuntimePermissions = readGrantedRuntimePermissions(in);

        final File appIconFile = buildAppIconFile(sessionId, sessionsDir);
        if (appIconFile.exists()) {
            params.appIcon = BitmapFactory.decodeFile(appIconFile.getAbsolutePath());