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

Commit b3292282 authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Make StorageVolume#getOwner a system API.

Since the MediaProvider mainline module will now manage volumes of
multiple users, it needs to know which user a volume belongs to. This
was implemented by an already existing API, so make that a @SystemApi.

Bug: 182396009
Test: N/A

Change-Id: I9ca24e500adfd51fbd52e863f549365dd9aaf39d
parent 958a6e73
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -312,6 +312,10 @@ package android.os.storage {
    field public static final int APP_IO_BLOCKED_REASON_TRANSCODING = 0; // 0x0
  }

  public final class StorageVolume implements android.os.Parcelable {
    method @NonNull public android.os.UserHandle getOwner();
  }

}

package android.provider {
+9 −2
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.os.storage;

import static android.annotation.SystemApi.Client.MODULE_LIBRARIES;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
@@ -289,9 +291,14 @@ public final class StorageVolume implements Parcelable {
        return mMaxFileSize;
    }

    /** {@hide} */
    /**
     * Returns the user that owns this volume
     *
     * {@hide}
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
    public UserHandle getOwner() {
    @SystemApi(client = MODULE_LIBRARIES)
    public @NonNull UserHandle getOwner() {
        return mOwner;
    }