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

Commit 1f381502 authored by sailendrabathi's avatar sailendrabathi
Browse files

Make StorageVolume#getOwner public

Make StorageVolume#getOwner accessible to apps so
that if we have an API that can return volumes
from multiple users (like b/209973853), then the
caller should also be able to figure out which
user each volume belongs to.

Bug: 213658045
Test: atest
AppCloningHostTest#testGetStorageVolumesIncludingSharedProfiles

Change-Id: I8d1ccc621a8808f6f072d147888869013192494b
parent 7aeeb341
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -33201,6 +33201,7 @@ package android.os.storage {
    method public String getDescription(android.content.Context);
    method @Nullable public java.io.File getDirectory();
    method @Nullable public String getMediaStoreVolumeName();
    method @NonNull public android.os.UserHandle getOwner();
    method public String getState();
    method @Nullable public java.util.UUID getStorageUuid();
    method @Nullable public String getUuid();
+0 −4
Original line number Diff line number Diff line
@@ -446,10 +446,6 @@ package android.os.storage {
    field public static final int APP_IO_BLOCKED_REASON_UNKNOWN = 0; // 0x0
  }

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

}

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

package android.os.storage;

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

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
@@ -308,11 +306,9 @@ public final class StorageVolume implements Parcelable {

    /**
     * Returns the user that owns this volume
     *
     * {@hide}
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
    @SystemApi(client = MODULE_LIBRARIES)
    // TODO(b/193460475) : Android Lint handle API change from systemApi to public Api incorrectly
    @SuppressLint("NewApi")
    public @NonNull UserHandle getOwner() {
        return mOwner;
    }