Dela via


StorageStatsManager.QueryStatsForPackage(UUID, String, UserHandle) Method

Definition

Return storage statistics for a specific package on the requested storage volume.

[Android.Runtime.Register("queryStatsForPackage", "(Ljava/util/UUID;Ljava/lang/String;Landroid/os/UserHandle;)Landroid/app/usage/StorageStats;", "GetQueryStatsForPackage_Ljava_util_UUID_Ljava_lang_String_Landroid_os_UserHandle_Handler", ApiSince=26)]
public virtual Android.App.Usage.StorageStats QueryStatsForPackage (Java.Util.UUID storageUuid, string packageName, Android.OS.UserHandle user);
[<Android.Runtime.Register("queryStatsForPackage", "(Ljava/util/UUID;Ljava/lang/String;Landroid/os/UserHandle;)Landroid/app/usage/StorageStats;", "GetQueryStatsForPackage_Ljava_util_UUID_Ljava_lang_String_Landroid_os_UserHandle_Handler", ApiSince=26)>]
abstract member QueryStatsForPackage : Java.Util.UUID * string * Android.OS.UserHandle -> Android.App.Usage.StorageStats
override this.QueryStatsForPackage : Java.Util.UUID * string * Android.OS.UserHandle -> Android.App.Usage.StorageStats

Parameters

storageUuid
UUID

the UUID of the storage volume you're interested in, such as StorageManager#UUID_DEFAULT.

packageName
String

the package name you're interested in.

user
UserHandle

the user you're interested in.

Returns

Attributes

Remarks

Return storage statistics for a specific package on the requested storage volume. <p class="note"> Note: no permissions are required when calling this API for your own package. However, requesting details for any other package requires the android.Manifest.permission#PACKAGE_USAGE_STATS permission, which is a system-level permission that will not be granted to normal apps. Declaring that permission expresses your intention to use this API and an end user can then choose to grant this permission through the Settings application. </p> <p class="note"> Note: if the requested package uses the android:sharedUserId manifest feature, this call will be forced into a slower manual calculation path. If possible, consider always using #queryStatsForUid(UUID, int), which is typically faster. </p>

Java documentation for android.app.usage.StorageStatsManager.queryStatsForPackage(java.util.UUID, java.lang.String, android.os.UserHandle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to