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

Commit d17686c0 authored by William Loh's avatar William Loh
Browse files

Filter AppMetadata file from Session.getNames

AppMetadata for a install is set using setAppMetadata and the bundle is
written to a file. This file should not be returned included in the
getNames API since it was not added to the session using openWrite.

Bug: 296471104
Test: atest InstallAppMetadataTest
Change-Id: Ia089884ac91b008e4179bd9970eb6c8c91daaf25
parent 6befa78b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1399,11 +1399,13 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
        assertCallerIsOwnerRootOrVerifier();
        synchronized (mLock) {
            assertPreparedAndNotDestroyedLocked("getNames");
            String[] names;
            if (!isCommitted()) {
                return getNamesLocked();
                names = getNamesLocked();
            } else {
                return getStageDirContentsLocked();
                names = getStageDirContentsLocked();
            }
            return ArrayUtils.removeString(names, APP_METADATA_FILE_NAME);
        }
    }