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

Commit cca0dc31 authored by Todd Kennedy's avatar Todd Kennedy
Browse files

Expose getInstallerPackage to instant apps

Instant apps can now call this method and _may_ get a non-null
response. The return value could be null if the requested application
is not exposed to instant apps.

NOTE: It's possible for this to leak the installer package name. The
installer may not be exposed to instant applications and may be off
limits for other package manager query APIs.

Change-Id: Ib914bb9a946aad32b42dcbc0543d74007a28c76a
Fixes: 68277134
Test: atest CtsAppSecurityHostTestCases:EphemeralTest#testEphemeralGetInstaller01,testEphemeralGetInstaller02,testEphemeralGetInstaller03
parent 11817c6b
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -20644,10 +20644,6 @@ Slog.v(TAG, ":: stepped forward, applying functor at tag " + parser.getName());
    @Override
    public String getInstallerPackageName(String packageName) {
        final int callingUid = Binder.getCallingUid();
        if (getInstantAppPackageName(callingUid) != null) {
            return null;
        }
        // reader
        synchronized (mPackages) {
            final PackageSetting ps = mSettings.mPackages.get(packageName);
            if (filterAppAccessLPr(ps, callingUid, UserHandle.getUserId(callingUid))) {