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

Commit 65eb6cf0 authored by Songchun Fan's avatar Songchun Fan Committed by Android Build Coastguard Worker
Browse files

Revert "[ADI][22/N] remove verifier override option"

FLAG: EXEMPT just revert
BUG: 422535876
Test: n/a just revert

This reverts commit 387e0598.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c354e4458f50efb893d92a0845145b5f31600ebb)
Merged-In: I5c2c66799f61898ed3e799bbd87679ef593c97e5
Change-Id: I5c2c66799f61898ed3e799bbd87679ef593c97e5
parent 7b3ffa72
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ import static android.os.Process.INVALID_UID;
import static android.os.Process.SYSTEM_UID;
import static android.provider.DeviceConfig.NAMESPACE_PACKAGE_MANAGER_SERVICE;

import static com.android.server.pm.PackageInstallerService.isValidPackageName;

import android.annotation.CurrentTimeMillisLong;
import android.annotation.DurationMillisLong;
import android.annotation.NonNull;
@@ -39,6 +41,7 @@ import android.content.pm.verify.pkg.VerificationStatus;
import android.net.Uri;
import android.os.Handler;
import android.os.PersistableBundle;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.provider.DeviceConfig;
import android.util.Slog;
@@ -161,10 +164,17 @@ public class VerifierController {

    /**
     * Used by the installation session to get the package name of the installed verifier.
     * Note: there can be only one active verifier for all the users on the device.
     * It can be overwritten by a system config for testing purpose.
     * Note: there can be only one verifier specified for all users on device.
     * TODO(b/360129657): remove debug property and verifier override after moving tests to cts-root
     */
    @Nullable
    public String getVerifierPackageName() {
        final String verifierPackageOverride = SystemProperties.get(
                "debug.pm.verification_service_provider_override", "");
        if (!verifierPackageOverride.isEmpty() && isValidPackageName(verifierPackageOverride)) {
            return verifierPackageOverride;
        }
        return mDefaultVerifierPackageName;
    }