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

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

Merge "Fix fs-verity API for secondary users" into main

parents 74c488c7 e5c85f77
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -193,7 +193,7 @@ public abstract class StorageManagerInternal {
     * @see com.android.server.pm.Installer#createFsveritySetupAuthToken()
     */
    public abstract IInstalld.IFsveritySetupAuthToken createFsveritySetupAuthToken(
            ParcelFileDescriptor authFd, int appUid, @UserIdInt int userId) throws IOException;
            ParcelFileDescriptor authFd, int uid) throws IOException;

    /**
     * A proxy call to the corresponding method in Installer.
+2 −2
Original line number Diff line number Diff line
@@ -5040,9 +5040,9 @@ class StorageManagerService extends IStorageManager.Stub

        @Override
        public IFsveritySetupAuthToken createFsveritySetupAuthToken(ParcelFileDescriptor authFd,
                int appUid, @UserIdInt int userId) throws IOException {
                int uid) throws IOException {
            try {
                return mInstaller.createFsveritySetupAuthToken(authFd, appUid, userId);
                return mInstaller.createFsveritySetupAuthToken(authFd, uid);
            } catch (Installer.InstallerException e) {
                throw new IOException(e);
            }
+3 −5
Original line number Diff line number Diff line
@@ -1183,8 +1183,7 @@ public class Installer extends SystemService {
     * Returns an auth token for the provided writable FD.
     *
     * @param authFd a file descriptor to proof that the caller can write to the file.
     * @param appUid uid of the calling app.
     * @param userId id of the user whose app file to enable fs-verity.
     * @param uid uid of the calling app.
     *
     * @return authToken, or null if a remote call shouldn't be continued. See {@link
     * #checkBeforeRemote}.
@@ -1192,13 +1191,12 @@ public class Installer extends SystemService {
     * @throws InstallerException if the remote call failed.
     */
    public IInstalld.IFsveritySetupAuthToken createFsveritySetupAuthToken(
            ParcelFileDescriptor authFd, int appUid, @UserIdInt int userId)
            throws InstallerException {
            ParcelFileDescriptor authFd, int uid) throws InstallerException {
        if (!checkBeforeRemote()) {
            return null;
        }
        try {
            return mInstalld.createFsveritySetupAuthToken(authFd, appUid, userId);
            return mInstalld.createFsveritySetupAuthToken(authFd, uid);
        } catch (Exception e) {
            throw InstallerException.from(e);
        }
+1 −1
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@ public class FileIntegrityService extends SystemService {
            Objects.requireNonNull(authFd);
            try {
                var authToken = getStorageManagerInternal().createFsveritySetupAuthToken(authFd,
                        Binder.getCallingUid(), Binder.getCallingUserHandle().getIdentifier());
                        Binder.getCallingUid());
                // fs-verity setup requires no writable fd to the file. Release the dup now that
                // it's passed.
                authFd.close();
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
-->
<configuration description="fs-verity end-to-end test">
    <option name="test-suite-tag" value="apct" />
    <option name="config-descriptor:metadata" key="parameter" value="secondary_user"/>

    <object type="module_controller" class="com.android.tradefed.testtype.suite.module.ShippingApiLevelModuleController">
        <!-- fs-verity is required since R/30 -->