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

Commit 602789f1 authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by Automerger Merge Worker
Browse files

Merge changes from topic "LOADER_USAGE_STATS" into rvc-dev am: 50e02440 am:...

Merge changes from topic "LOADER_USAGE_STATS" into rvc-dev am: 50e02440 am: 3ea7adf0 am: c63d0680 am: 6366444f

Change-Id: Ic49b31f0282cd147549f6bf2da9bf37b131ec880
parents 4b76feae 6366444f
Loading
Loading
Loading
Loading
+0 −24
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
// edit this file. It looks like you are doing that because you have modified
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
// from an interface or a field from a parcelable and it broke the build. That
// breakage is intended.
//
// You must not make a backward incompatible changes to the AIDL files built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.os.incremental;
/* @hide */
parcelable IncrementalFileSystemControlParcel {
  ParcelFileDescriptor cmd;
  ParcelFileDescriptor pendingReads;
  ParcelFileDescriptor log;
}
+0 −44
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
// edit this file. It looks like you are doing that because you have modified
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
// from an interface or a field from a parcelable and it broke the build. That
// breakage is intended.
//
// You must not make a backward incompatible changes to the AIDL files built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.os.incremental;
/* @hide */
interface IIncrementalService {
  int openStorage(in @utf8InCpp String path);
  int createStorage(in @utf8InCpp String path, in android.content.pm.DataLoaderParamsParcel params, in android.content.pm.IDataLoaderStatusListener listener, int createMode);
  int createLinkedStorage(in @utf8InCpp String path, int otherStorageId, int createMode);
  int makeBindMount(int storageId, in @utf8InCpp String sourcePath, in @utf8InCpp String targetFullPath, int bindType);
  int deleteBindMount(int storageId, in @utf8InCpp String targetFullPath);
  int makeDirectory(int storageId, in @utf8InCpp String path);
  int makeDirectories(int storageId, in @utf8InCpp String path);
  int makeFile(int storageId, in @utf8InCpp String path, in android.os.incremental.IncrementalNewFileParams params);
  int makeFileFromRange(int storageId, in @utf8InCpp String targetPath, in @utf8InCpp String sourcePath, long start, long end);
  int makeLink(int sourceStorageId, in @utf8InCpp String sourcePath, int destStorageId, in @utf8InCpp String destPath);
  int unlink(int storageId, in @utf8InCpp String path);
  boolean isFileRangeLoaded(int storageId, in @utf8InCpp String path, long start, long end);
  byte[] getMetadataByPath(int storageId, in @utf8InCpp String path);
  byte[] getMetadataById(int storageId, in byte[] fileId);
  boolean startLoading(int storageId);
  void deleteStorage(int storageId);
  boolean configureNativeBinaries(int storageId, in @utf8InCpp String apkFullPath, in @utf8InCpp String libDirRelativePath, in @utf8InCpp String abi);
  const int CREATE_MODE_TEMPORARY_BIND = 1;
  const int CREATE_MODE_PERMANENT_BIND = 2;
  const int CREATE_MODE_CREATE = 4;
  const int CREATE_MODE_OPEN_EXISTING = 8;
  const int BIND_TEMPORARY = 0;
  const int BIND_PERMANENT = 1;
}
+0 −25
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////////
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE.                          //
///////////////////////////////////////////////////////////////////////////////

// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
// edit this file. It looks like you are doing that because you have modified
// an AIDL interface in a backward-incompatible way, e.g., deleting a function
// from an interface or a field from a parcelable and it broke the build. That
// breakage is intended.
//
// You must not make a backward incompatible changes to the AIDL files built
// with the aidl_interface module type with versions property set. The module
// type is used to build AIDL files in a way that they can be used across
// independently updatable components of the system. If a device is shipped
// with such a backward incompatible change, it has a high risk of breaking
// later when a module using the interface is updated, e.g., Mainline modules.

package android.os.incremental;
/* @hide */
parcelable IncrementalNewFileParams {
  long size;
  byte[] fileId;
  byte[] metadata;
  @nullable byte[] signature;
}
+7 −0
Original line number Diff line number Diff line
@@ -37,6 +37,13 @@ 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.
     */
+19 −0
Original line number Diff line number Diff line
@@ -19,11 +19,13 @@ 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;
@@ -319,6 +321,23 @@ 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