Remove unnecessarily @System/TestApi annotations

We can't expose APIs if the enclosing class is hidden, so these
annotations are redundant. We need to remove them so that we can enable the
check.

Exempt-From-Owner-Approval:Cherry-pick from goog/master
Bug: 159121253
Test: treehugger (i.e. this shouldn't trigger "API has changed" error.)
Merged-in: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
Change-Id: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
This commit is contained in:
Makoto Onuki
2020-06-19 14:47:41 -07:00
parent 4d21c064fc
commit 42bec243c0
13 changed files with 0 additions and 43 deletions

View File

@@ -20,7 +20,6 @@ import static android.app.ActivityThread.DEBUG_CONFIGURATION;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.pm.ActivityInfo;
import android.content.pm.ApplicationInfo;
@@ -1043,7 +1042,6 @@ public class ResourcesManager {
}
}
@TestApi
public final boolean applyConfigurationToResources(@NonNull Configuration config,
@Nullable CompatibilityInfo compat) {
synchronized(this) {

View File

@@ -19,7 +19,6 @@ package android.bluetooth;
import android.Manifest;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.os.Binder;
@@ -587,7 +586,6 @@ public final class BluetoothHeadsetClient implements BluetoothProfile {
* @return true if connectionPolicy is set, false on error
* @hide
*/
@SystemApi
@RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public boolean setConnectionPolicy(@NonNull BluetoothDevice device,
@ConnectionPolicy int connectionPolicy) {
@@ -637,7 +635,6 @@ public final class BluetoothHeadsetClient implements BluetoothProfile {
* @return connection policy of the device
* @hide
*/
@SystemApi
@RequiresPermission(Manifest.permission.BLUETOOTH)
public @ConnectionPolicy int getConnectionPolicy(@NonNull BluetoothDevice device) {
if (VDBG) log("getConnectionPolicy(" + device + ")");

View File

@@ -19,7 +19,6 @@ package android.bluetooth;
import android.Manifest;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.app.PendingIntent;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
@@ -276,7 +275,6 @@ public final class BluetoothMapClient implements BluetoothProfile {
* @return true if connectionPolicy is set, false on error
* @hide
*/
@SystemApi
@RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public boolean setConnectionPolicy(@NonNull BluetoothDevice device,
@ConnectionPolicy int connectionPolicy) {
@@ -325,7 +323,6 @@ public final class BluetoothMapClient implements BluetoothProfile {
* @return connection policy of the device
* @hide
*/
@SystemApi
@RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public @ConnectionPolicy int getConnectionPolicy(@NonNull BluetoothDevice device) {
if (VDBG) Log.d(TAG, "getConnectionPolicy(" + device + ")");

View File

@@ -19,7 +19,6 @@ package android.bluetooth;
import android.Manifest;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.content.Context;
import android.os.Binder;
import android.os.IBinder;
@@ -276,7 +275,6 @@ public final class BluetoothPbapClient implements BluetoothProfile {
* @return true if connectionPolicy is set, false on error
* @hide
*/
@SystemApi
@RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public boolean setConnectionPolicy(@NonNull BluetoothDevice device,
@ConnectionPolicy int connectionPolicy) {
@@ -329,7 +327,6 @@ public final class BluetoothPbapClient implements BluetoothProfile {
* @return connection policy of the device
* @hide
*/
@SystemApi
@RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public @ConnectionPolicy int getConnectionPolicy(@NonNull BluetoothDevice device) {
if (VDBG) {

View File

@@ -18,7 +18,6 @@ package android.bluetooth;
import android.Manifest;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.os.Binder;
@@ -328,7 +327,6 @@ public final class BluetoothSap implements BluetoothProfile {
* @return true if connectionPolicy is set, false on error
* @hide
*/
@SystemApi
@RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public boolean setConnectionPolicy(BluetoothDevice device,
@ConnectionPolicy int connectionPolicy) {
@@ -377,7 +375,6 @@ public final class BluetoothSap implements BluetoothProfile {
* @return connection policy of the device
* @hide
*/
@SystemApi
@RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
public @ConnectionPolicy int getConnectionPolicy(BluetoothDevice device) {
if (VDBG) log("getConnectionPolicy(" + device + ")");

View File

@@ -21,7 +21,6 @@ import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.compat.Compatibility;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledAfter;
@@ -241,7 +240,6 @@ public class OverlayManager {
*
* @hide
*/
@TestApi
@RequiresPermission(anyOf = {
"android.permission.INTERACT_ACROSS_USERS",
})

View File

@@ -46,7 +46,6 @@ import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.StringRes;
import android.annotation.TestApi;
import android.apex.ApexInfo;
import android.app.ActivityTaskManager;
import android.app.ActivityThread;
@@ -2545,7 +2544,6 @@ public class PackageParser {
* not compatible with this platform
* @hide Exposed for unit testing only.
*/
@TestApi
public static int computeTargetSdkVersion(@IntRange(from = 0) int targetVers,
@Nullable String targetCode, @NonNull String[] platformSdkCodenames,
@NonNull String[] outError) {
@@ -2610,7 +2608,6 @@ public class PackageParser {
* compatible with this platform
* @hide Exposed for unit testing only.
*/
@TestApi
public static int computeMinSdkVersion(@IntRange(from = 1) int minVers,
@Nullable String minCode, @IntRange(from = 1) int platformSdkVersion,
@NonNull String[] platformSdkCodenames, @NonNull String[] outError) {
@@ -4732,7 +4729,6 @@ public class PackageParser {
* AndroidManifest.xml.
* @hide Exposed for unit testing only.
*/
@TestApi
public static int getActivityConfigChanges(int configChanges, int recreateOnConfigChanges) {
return configChanges | ((~recreateOnConfigChanges) & RECREATE_ON_CONFIG_CHANGES_MASK);
}

View File

@@ -18,7 +18,6 @@ package android.telephony;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.TestApi;
import android.compat.Compatibility;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledAfter;
@@ -283,7 +282,6 @@ public class TelephonyRegistryManager {
* @param incomingNumber incoming phone number.
* @hide
*/
@TestApi
@RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
public void notifyCallStateChangedForAllSubscriptions(@CallState int state,
@Nullable String incomingNumber) {

View File

@@ -16,7 +16,6 @@
package android.graphics;
import android.annotation.SystemApi;
import android.app.AlarmManager;
import android.app.AppOpsManager;
import android.content.Context;
@@ -100,7 +99,6 @@ public class GraphicsStatsService extends IGraphicsStats.Stub {
private Handler mWriteOutHandler;
private boolean mRotateIsScheduled = false;
@SystemApi
public GraphicsStatsService(Context context) {
mContext = context;
mAppOps = context.getSystemService(AppOpsManager.class);

View File

@@ -18,7 +18,6 @@ package android.media;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.TestApi;
import android.os.Bundle;
import java.nio.ByteBuffer;
@@ -578,7 +577,6 @@ public class MediaMetrics {
*
* @return a Bundle with the keys set according to data in the Item's buffer.
*/
@TestApi
public Bundle toBundle() {
updateHeader();
@@ -591,23 +589,14 @@ public class MediaMetrics {
// The following constants are used for tests to extract
// the content of the Bundle for CTS testing.
@TestApi
public static final String BUNDLE_TOTAL_SIZE = "_totalSize";
@TestApi
public static final String BUNDLE_HEADER_SIZE = "_headerSize";
@TestApi
public static final String BUNDLE_VERSION = "_version";
@TestApi
public static final String BUNDLE_KEY_SIZE = "_keySize";
@TestApi
public static final String BUNDLE_KEY = "_key";
@TestApi
public static final String BUNDLE_PID = "_pid";
@TestApi
public static final String BUNDLE_UID = "_uid";
@TestApi
public static final String BUNDLE_TIMESTAMP = "_timestamp";
@TestApi
public static final String BUNDLE_PROPERTY_COUNT = "_propertyCount";
/**
@@ -618,7 +607,6 @@ public class MediaMetrics {
* @param buffer contains the byte data serialized according to the byte string version.
* @return a Bundle with the keys set according to data in the buffer.
*/
@TestApi
public static Bundle toBundle(ByteBuffer buffer) {
final Bundle bundle = new Bundle();

View File

@@ -18,7 +18,6 @@ package android.media;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.TestApi;
import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
@@ -440,7 +439,6 @@ public class Utils {
*
* @param <V> The class of the object returned to the listener.
*/
@TestApi
public static class ListenerList<V> {
/**
* The Listener interface for callback.

View File

@@ -19,7 +19,6 @@ package android.media.audiopolicy;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.media.AudioAttributes;
import android.media.AudioSystem;
import android.media.MediaRecorder;
@@ -108,7 +107,6 @@ public final class AudioProductStrategy implements Parcelable {
* @param id the ID for the invalid strategy, always use a different one than in use
* @return an invalid instance that cannot successfully be used for volume groups or routing
*/
@TestApi
@SystemApi
public static @NonNull AudioProductStrategy createInvalidAudioProductStrategy(int id) {
return new AudioProductStrategy("dummy strategy", id, new AudioAttributesGroup[0]);

View File

@@ -343,7 +343,6 @@ public class MmTelFeature extends ImsFeature {
* @hide
*/
@Override
@SystemApi @TestApi
public void onIncomingCall(IImsCallSession c, Bundle extras) {
}
@@ -355,7 +354,6 @@ public class MmTelFeature extends ImsFeature {
* @hide
*/
@Override
@SystemApi @TestApi
public void onRejectedCall(ImsCallProfile callProfile, ImsReasonInfo reason) {
}
@@ -366,7 +364,6 @@ public class MmTelFeature extends ImsFeature {
* @hide
*/
@Override
@SystemApi @TestApi
public void onVoiceMessageCountUpdate(int count) {
}