Add maxTargetSdk restriction to unused APIs.

These are APIs that have @UnsupportedAppUsage but for which we don't
have any evidence of them currently being used, so should be safe to
remove from the unsupported list.

Bug: 170729553
Test: Treehugger
Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
This commit is contained in:
Mathew Inwood
2020-10-27 11:47:29 +00:00
parent 69bca6a513
commit 72f07d6a8a
642 changed files with 2403 additions and 2030 deletions

View File

@@ -20,6 +20,7 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.RemoteException;
@@ -38,7 +39,7 @@ import java.util.Set;
* suitable for use as the key of a {@link java.util.Map}
*/
public class Account implements Parcelable {
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
private static final String TAG = "Account";
@GuardedBy("sAccessedAccounts")
@@ -47,7 +48,7 @@ public class Account implements Parcelable {
public final String name;
public final String type;
private String mSafeName;
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
private final @Nullable String accessId;
public boolean equals(@Nullable Object o) {

View File

@@ -546,7 +546,7 @@ public class AccountManager {
/**
* @hide used for testing only
*/
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public AccountManager(Context context, IAccountManager service, Handler handler) {
mContext = context;
mService = service;
@@ -831,7 +831,7 @@ public class AccountManager {
/** @hide Same as {@link #getAccountsByType(String)} but for a specific user. */
@NonNull
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public Account[] getAccountsByTypeAsUser(String type, UserHandle userHandle) {
try {
return mService.getAccountsAsUser(type, userHandle.getIdentifier(),
@@ -2122,7 +2122,7 @@ public class AccountManager {
* Same as {@link #confirmCredentials(Account, Bundle, Activity, AccountManagerCallback, Handler)}
* but for the specified user.
*/
@UnsupportedAppUsage
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public AccountManagerFuture<Bundle> confirmCredentialsAsUser(final Account account,
final Bundle options,
final Activity activity,