Add @UnsupportedAppUsage annotations
For packages:
android.os
This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.
Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@
Bug: 110868826
Test: m
Change-Id: I4ece0a3f37f88fc2508cb965092aed7cabc61819
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
index fea69c0..cceb6ed 100644
--- a/core/java/android/os/Environment.java
+++ b/core/java/android/os/Environment.java
@@ -19,6 +19,7 @@
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.annotation.TestApi;
+import android.annotation.UnsupportedAppUsage;
import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.os.storage.StorageManager;
@@ -74,6 +75,7 @@
private static final File DIR_PRODUCT_SERVICES_ROOT = getDirectory(ENV_PRODUCT_SERVICES_ROOT,
"/product_services");
+ @UnsupportedAppUsage
private static UserEnvironment sCurrentUser;
private static boolean sUserRequired;
@@ -82,6 +84,7 @@
}
/** {@hide} */
+ @UnsupportedAppUsage
public static void initForCurrentUser() {
final int userId = UserHandle.myUserId();
sCurrentUser = new UserEnvironment(userId);
@@ -91,10 +94,12 @@
public static class UserEnvironment {
private final int mUserId;
+ @UnsupportedAppUsage
public UserEnvironment(int userId) {
mUserId = userId;
}
+ @UnsupportedAppUsage
public File[] getExternalDirs() {
final StorageVolume[] volumes = StorageManager.getVolumeList(mUserId,
StorageManager.FLAG_FOR_WRITE);
@@ -105,11 +110,13 @@
return files;
}
+ @UnsupportedAppUsage
@Deprecated
public File getExternalStorageDirectory() {
return getExternalDirs()[0];
}
+ @UnsupportedAppUsage
@Deprecated
public File getExternalStoragePublicDirectory(String type) {
return buildExternalStoragePublicDirs(type)[0];
@@ -278,6 +285,7 @@
}
/** {@hide} */
+ @UnsupportedAppUsage
public static File getDataSystemDirectory() {
return new File(getDataDirectory(), "system");
}
@@ -553,11 +561,13 @@
}
/** {@hide} */
+ @UnsupportedAppUsage
public static File getLegacyExternalStorageDirectory() {
return new File(System.getenv(ENV_EXTERNAL_STORAGE));
}
/** {@hide} */
+ @UnsupportedAppUsage
public static File getLegacyExternalStorageObbDirectory() {
return buildPath(getLegacyExternalStorageDirectory(), DIR_ANDROID, DIR_OBB);
}
@@ -839,6 +849,7 @@
* Returns the path for android-specific data on the SD card.
* @hide
*/
+ @UnsupportedAppUsage
public static File[] buildExternalStorageAndroidDataDirs() {
throwIfUserRequired();
return sCurrentUser.buildExternalStorageAndroidDataDirs();
@@ -848,6 +859,7 @@
* Generates the raw path to an application's data
* @hide
*/
+ @UnsupportedAppUsage
public static File[] buildExternalStorageAppDataDirs(String packageName) {
throwIfUserRequired();
return sCurrentUser.buildExternalStorageAppDataDirs(packageName);
@@ -857,6 +869,7 @@
* Generates the raw path to an application's media
* @hide
*/
+ @UnsupportedAppUsage
public static File[] buildExternalStorageAppMediaDirs(String packageName) {
throwIfUserRequired();
return sCurrentUser.buildExternalStorageAppMediaDirs(packageName);
@@ -866,6 +879,7 @@
* Generates the raw path to an application's OBB files
* @hide
*/
+ @UnsupportedAppUsage
public static File[] buildExternalStorageAppObbDirs(String packageName) {
throwIfUserRequired();
return sCurrentUser.buildExternalStorageAppObbDirs(packageName);
@@ -875,6 +889,7 @@
* Generates the path to an application's files.
* @hide
*/
+ @UnsupportedAppUsage
public static File[] buildExternalStorageAppFilesDirs(String packageName) {
throwIfUserRequired();
return sCurrentUser.buildExternalStorageAppFilesDirs(packageName);
@@ -884,6 +899,7 @@
* Generates the path to an application's cache.
* @hide
*/
+ @UnsupportedAppUsage
public static File[] buildExternalStorageAppCacheDirs(String packageName) {
throwIfUserRequired();
return sCurrentUser.buildExternalStorageAppCacheDirs(packageName);
@@ -1118,6 +1134,7 @@
*
* @hide
*/
+ @UnsupportedAppUsage
public static File[] buildPaths(File[] base, String... segments) {
File[] result = new File[base.length];
for (int i = 0; i < base.length; i++) {
@@ -1157,6 +1174,7 @@
* @deprecated disabled now that FUSE has been replaced by sdcardfs
* @hide
*/
+ @UnsupportedAppUsage
@Deprecated
public static File maybeTranslateEmulatedPathToInternal(File path) {
return StorageManager.maybeTranslateEmulatedPathToInternal(path);