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

Commit 42de44bf authored by Songchun Fan's avatar Songchun Fan
Browse files

[pm] fix dynamic library after update and restart

There was a mistake in the refactoring CL ag/20136647 where the wrong
disabledPs was used. This CL fixes that.

Test: manual with the following steps:

1. adb pull /product/priv-app/PrebuiltGmsCore/PrebuiltGmsCoreNext.apk
2. adb install PrebuiltGmsCoreNext.apk // this step simulates installing
   a system app update on the /data partition
3. reboot and check the Libraries section in dumpsys. Make sure that
   gmscore still shows up there

BUG: 310550085

Change-Id: I9e1f7d672674ea7e0707dba65f18f041edf4ff83
parent 6a2243d0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -538,6 +538,12 @@ final class InstallRequest {
        return mScanResult.mRequest.mPkgSetting;
    }

    @Nullable
    public PackageSetting getScanRequestDisabledPackageSetting() {
        assertScanResultExists();
        return mScanResult.mRequest.mDisabledPkgSetting;
    }

    @Nullable
    public String getRealPackageName() {
        assertScanResultExists();
+2 −2
Original line number Diff line number Diff line
@@ -856,9 +856,9 @@ public final class SharedLibrariesImpl implements SharedLibrariesRead, Watchable
        // We may not yet have disabled the updated package yet, so be sure to grab the
        // current setting if that's the case.
        final PackageSetting updatedSystemPs = isUpdatedSystemApp
                ? installRequest.getDisabledPackageSetting() == null
                ? installRequest.getScanRequestDisabledPackageSetting() == null
                ? installRequest.getScanRequestOldPackageSetting()
                : installRequest.getDisabledPackageSetting()
                : installRequest.getScanRequestDisabledPackageSetting()
                : null;
        if (isUpdatedSystemApp && (updatedSystemPs.getPkg() == null
                || updatedSystemPs.getPkg().getLibraryNames() == null)) {