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

Commit c74bff21 authored by Himanshu Gupta's avatar Himanshu Gupta Committed by Automerger Merge Worker
Browse files

Merge "Fixing Storage Volume listing for Cloned User." into tm-qpr-dev am: 4a5b6525

parents dd101aa8 4a5b6525
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -10015,7 +10015,7 @@ package android.os.storage {
    method @WorkerThread public long getAllocatableBytes(@NonNull java.util.UUID, @RequiresPermission int) throws java.io.IOException;
    method @WorkerThread public long getAllocatableBytes(@NonNull java.util.UUID, @RequiresPermission int) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.WRITE_MEDIA_STORAGE) public int getExternalStorageMountMode(int, @NonNull String);
    method @RequiresPermission(android.Manifest.permission.WRITE_MEDIA_STORAGE) public int getExternalStorageMountMode(int, @NonNull String);
    method public static boolean hasIsolatedStorage();
    method public static boolean hasIsolatedStorage();
    method public void updateExternalStorageFileQuotaType(@NonNull java.io.File, int) throws java.io.IOException;
    method @RequiresPermission(android.Manifest.permission.MANAGE_EXTERNAL_STORAGE) public void updateExternalStorageFileQuotaType(@NonNull java.io.File, int) throws java.io.IOException;
    field @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public static final int FLAG_ALLOCATE_AGGRESSIVE = 1; // 0x1
    field @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public static final int FLAG_ALLOCATE_AGGRESSIVE = 1; // 0x1
    field public static final int MOUNT_MODE_EXTERNAL_ANDROID_WRITABLE = 4; // 0x4
    field public static final int MOUNT_MODE_EXTERNAL_ANDROID_WRITABLE = 4; // 0x4
    field public static final int MOUNT_MODE_EXTERNAL_DEFAULT = 1; // 0x1
    field public static final int MOUNT_MODE_EXTERNAL_DEFAULT = 1; // 0x1
+7 −2
Original line number Original line Diff line number Diff line
@@ -2549,7 +2549,7 @@ public class StorageManager {
     * called on first creation of a new file on external storage, and whenever the
     * called on first creation of a new file on external storage, and whenever the
     * media type of the file is updated later.
     * media type of the file is updated later.
     *
     *
     * This API doesn't require any special permissions, though typical implementations
     * This API requires MANAGE_EXTERNAL_STORAGE permission and typical implementations
     * will require being called from an SELinux domain that allows setting file attributes
     * will require being called from an SELinux domain that allows setting file attributes
     * related to quota (eg the GID or project ID).
     * related to quota (eg the GID or project ID).
     *
     *
@@ -2568,11 +2568,16 @@ public class StorageManager {
     * @hide
     * @hide
     */
     */
    @SystemApi
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MANAGE_EXTERNAL_STORAGE)
    public void updateExternalStorageFileQuotaType(@NonNull File path,
    public void updateExternalStorageFileQuotaType(@NonNull File path,
            @QuotaType int quotaType) throws IOException {
            @QuotaType int quotaType) throws IOException {
        long projectId;
        long projectId;
        final String filePath = path.getCanonicalPath();
        final String filePath = path.getCanonicalPath();
        final StorageVolume volume = getStorageVolume(path);
        // MANAGE_EXTERNAL_STORAGE permission is required as FLAG_INCLUDE_SHARED_PROFILE is being
        // set while querying getVolumeList.
        final StorageVolume[] availableVolumes = getVolumeList(mContext.getUserId(),
                FLAG_REAL_STATE | FLAG_INCLUDE_INVISIBLE | FLAG_INCLUDE_SHARED_PROFILE);
        final StorageVolume volume = getStorageVolume(availableVolumes, path);
        if (volume == null) {
        if (volume == null) {
            Log.w(TAG, "Failed to update quota type for " + filePath);
            Log.w(TAG, "Failed to update quota type for " + filePath);
            return;
            return;