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

Commit 2c5404ca authored by Songchun Fan's avatar Songchun Fan
Browse files

Skip building root hash if not incremental

BUG: 235386854
Test: manually install a non-incremental app from Play Store and observe
the logcat. Before the change there is always a line saying "ERROR: could not load root hash from incremental install". After the change there is no more.

Change-Id: Iade72d4c5fd030885c82d0344f67952780f69996
parent 395e63d2
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.incremental.IncrementalManager;
import android.provider.DeviceConfig;
import android.provider.Settings;
import android.text.TextUtils;
@@ -426,10 +427,11 @@ final class VerifyingSession {

        final String baseCodePath = mPackageLite.getBaseApkPath();
        final String[] splitCodePaths = mPackageLite.getSplitApkPaths();
        final String rootHashString = PackageManagerServiceUtils.buildVerificationRootHashString(
                baseCodePath, splitCodePaths);

        if (rootHashString != null) {
        if (IncrementalManager.isIncrementalPath(baseCodePath)) {
            final String rootHashString =
                    PackageManagerServiceUtils.buildVerificationRootHashString(
                            baseCodePath, splitCodePaths);
            verification.putExtra(PackageManager.EXTRA_VERIFICATION_ROOT_HASH, rootHashString);
        }