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

Commit 34d4599d authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "Change the way how we call setStorageParams." into rvc-dev am:...

Merge "Merge "Change the way how we call setStorageParams." into rvc-dev am: 9f16f266 am: 14e544cd" into rvc-d1-dev-plus-aosp am: a477eaf6

Change-Id: I3657906e960b4d182f6b13c2d90a89e1002f02ff
parents 2b78e1fa a477eaf6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -914,6 +914,7 @@ cc_library {
filegroup {
    name: "incremental_aidl",
    srcs: [
        "core/java/android/os/incremental/IIncrementalServiceConnector.aidl",
        "core/java/android/os/incremental/IncrementalFileSystemControlParcel.aidl",
    ],
    path: "core/java",
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.content.pm;

import android.content.pm.IPackageInstallerSessionFileSystemConnector;
import android.os.incremental.IIncrementalServiceConnector;
import android.os.incremental.IncrementalFileSystemControlParcel;

/**
@@ -26,6 +27,8 @@ import android.os.incremental.IncrementalFileSystemControlParcel;
parcelable FileSystemControlParcel {
    // Incremental FS control descriptors.
    @nullable IncrementalFileSystemControlParcel incremental;
    // Incremental FS service.
    @nullable IIncrementalServiceConnector service;
    // Callback-based installation connector.
    @nullable IPackageInstallerSessionFileSystemConnector callback;
}
+0 −7
Original line number Diff line number Diff line
@@ -37,13 +37,6 @@ interface IIncrementalService {
    int createStorage(in @utf8InCpp String path, in DataLoaderParamsParcel params, in IDataLoaderStatusListener listener, int createMode);
    int createLinkedStorage(in @utf8InCpp String path, int otherStorageId, int createMode);

    /**
     * Changes storage params. Returns 0 on success, and -errno on failure.
     * Use enableReadLogs to switch pages read logs reporting on and off.
     * Returns 0 on success, and - errno on failure: permission check or remount.
     */
    int setStorageParams(int storageId, boolean enableReadLogs);

    /**
     * Bind-mounts a path under a storage to a full path. Can be permanent or temporary.
     */
+27 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.os.incremental;

/** @hide */
interface IIncrementalServiceConnector {
    /**
     * Changes storage params. Returns 0 on success, and -errno on failure.
     * Use enableReadLogs to switch pages read logs reporting on and off.
     * Returns 0 on success, and - errno on failure: permission check or remount.
     */
    int setStorageParams(boolean enableReadLogs);
}
+0 −19
Original line number Diff line number Diff line
@@ -19,13 +19,11 @@ package android.os.incremental;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemService;
import android.content.Context;
import android.content.pm.DataLoaderParams;
import android.content.pm.IDataLoaderStatusListener;
import android.os.RemoteException;
import android.system.ErrnoException;
import android.util.SparseArray;

import com.android.internal.annotations.GuardedBy;
@@ -321,23 +319,6 @@ public final class IncrementalManager {
        return nativeUnsafeGetFileSignature(path);
    }

    /**
     * Sets storage parameters.
     *
     * @param enableReadLogs - enables or disables read logs. Caller has to have a permission.
     */
    @RequiresPermission(android.Manifest.permission.LOADER_USAGE_STATS)
    public void setStorageParams(int storageId, boolean enableReadLogs) throws ErrnoException {
        try {
            int res = mService.setStorageParams(storageId, enableReadLogs);
            if (res < 0) {
                throw new ErrnoException("setStorageParams", -res);
            }
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
    }

    /* Native methods */
    private static native boolean nativeIsEnabled();
    private static native boolean nativeIsIncrementalPath(@NonNull String path);
Loading