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

Commit c594402a authored by Victor Hsieh's avatar Victor Hsieh Committed by Android (Google) Code Review
Browse files

Merge "Stop calling into system server from isApkVeritySupport" into main

parents 4c845885 ce6637a2
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -65,13 +65,7 @@ public final class FileIntegrityManager {
     * other fs-verity APIs.
     */
    public boolean isApkVeritySupported() {
        try {
            // Go through the service just to avoid exposing the vendor controlled system property
            // to all apps.
            return mService.isApkVeritySupported();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
        return VerityUtils.isFsVeritySupported();
    }

    /**
+0 −2
Original line number Diff line number Diff line
@@ -24,8 +24,6 @@ import android.os.IInstalld;
 * @hide
 */
interface IFileIntegrityService {
    boolean isApkVeritySupported();

    IInstalld.IFsveritySetupAuthToken createAuthToken(in ParcelFileDescriptor authFd);

    @EnforcePermission("SETUP_FSVERITY")
+1 −2
Original line number Diff line number Diff line
@@ -56,8 +56,7 @@ public abstract class VerityUtils {
    private static final int HASH_SIZE_BYTES = 32;

    public static boolean isFsVeritySupported() {
        return Build.VERSION.DEVICE_INITIAL_SDK_INT >= Build.VERSION_CODES.R
                || SystemProperties.getInt("ro.apk_verity.mode", 0) == 2;
        return Build.VERSION.DEVICE_INITIAL_SDK_INT >= Build.VERSION_CODES.R;
    }

    /** Enables fs-verity for the file without signature. */
+0 −5
Original line number Diff line number Diff line
@@ -54,11 +54,6 @@ public class FileIntegrityService extends SystemService {
            super(PermissionEnforcer.fromContext(context));
        }

        @Override
        public boolean isApkVeritySupported() {
            return VerityUtils.isFsVeritySupported();
        }

        private void checkCallerPackageName(String packageName) {
            final int callingUid = Binder.getCallingUid();
            final int callingUserId = UserHandle.getUserId(callingUid);