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

Commit 7ea711a2 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
Merged-In: Ia089884ac91b008e4179bd9970eb6c8c91daaf25
Change-Id: Ia089884ac91b008e4179bd9970eb6c8c91daaf25
(cherry picked from commit d17686c0)
parent 41e4ebf0
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1365,11 +1365,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);
        }
    }