Revert "Add maxTargetSdk restriction to unused APIs."

This reverts commit 72f07d6a8a.

Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397

Bug: 171886397
Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
This commit is contained in:
Hongwei Wang
2020-10-28 19:38:11 +00:00
parent 72f07d6a8a
commit 050275cd83
642 changed files with 2030 additions and 2403 deletions

View File

@@ -20,7 +20,6 @@ import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
import java.io.BufferedReader;
import java.io.FileReader;
@@ -86,7 +85,7 @@ public class EventLog {
private static final byte FLOAT_TYPE = 4;
/** @param data containing event, read from the system */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
/*package*/ Event(byte[] data) {
mBuffer = ByteBuffer.wrap(data);
mBuffer.order(ByteOrder.nativeOrder());

View File

@@ -23,7 +23,6 @@ import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.UserHandle;
import android.os.UserManager;
@@ -52,7 +51,7 @@ public class IconDrawableFactory {
return appInfo.isInstantApp() || mUm.hasBadge(userId);
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public Drawable getBadgedIcon(ApplicationInfo appInfo) {
return getBadgedIcon(appInfo, UserHandle.getUserId(appInfo.uid));
}

View File

@@ -17,7 +17,6 @@
package android.util;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.os.SystemClock;
import java.io.FileDescriptor;
@@ -113,7 +112,7 @@ public final class LocalLog {
ReadOnlyLocalLog(LocalLog log) {
mLog = log;
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
mLog.dump(pw);
}
@@ -128,7 +127,7 @@ public final class LocalLog {
}
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public ReadOnlyLocalLog readOnlyLocalLog() {
return new ReadOnlyLocalLog(this);
}

View File

@@ -17,7 +17,6 @@
package android.util;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
import java.io.Writer;
@@ -40,7 +39,7 @@ public class LogWriter extends Writer {
* {@link android.util.Log#ERROR Log.ERROR}.
* @param tag A string tag to associate with each printed log statement.
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public LogWriter(int priority, String tag) {
mPriority = priority;
mTag = tag;

View File

@@ -18,7 +18,6 @@ package android.util;
import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.Preconditions;
@@ -46,7 +45,7 @@ public class LongArray implements Cloneable {
/**
* Creates an empty LongArray with the default initial capacity.
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public LongArray() {
this(10);
}
@@ -105,7 +104,7 @@ public class LongArray implements Cloneable {
*
* @throws IndexOutOfBoundsException when index < 0 || index > size()
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public void add(int index, long value) {
ensureCapacity(1);
int rightSegment = mSize - index;
@@ -209,7 +208,7 @@ public class LongArray implements Cloneable {
/**
* Returns the number of values in this array.
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public int size() {
return mSize;
}

View File

@@ -26,7 +26,6 @@ import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkInfo;
import android.net.SntpClient;
import android.os.Build;
import android.os.SystemClock;
import android.provider.Settings;
import android.text.TextUtils;
@@ -139,7 +138,7 @@ public class NtpTrustedTime implements TrustedTime {
return sSingleton;
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public boolean forceRefresh() {
synchronized (this) {
NtpConnectionInfo connectionInfo = getNtpConnectionInfo();
@@ -182,7 +181,7 @@ public class NtpTrustedTime implements TrustedTime {
* @deprecated Use {@link #getCachedTimeResult()} to obtain a {@link TimeResult} atomically.
*/
@Deprecated
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public boolean hasCache() {
return mTimeResult != null;
}
@@ -209,7 +208,7 @@ public class NtpTrustedTime implements TrustedTime {
* @deprecated Use {@link #getCachedTimeResult()} to obtain a {@link TimeResult} atomically.
*/
@Deprecated
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public long currentTimeMillis() {
TimeResult timeResult = mTimeResult;
if (timeResult == null) {
@@ -228,7 +227,7 @@ public class NtpTrustedTime implements TrustedTime {
* @deprecated Use {@link #getCachedTimeResult()} to obtain a {@link TimeResult} atomically.
*/
@Deprecated
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public long getCachedNtpTime() {
if (LOGD) Log.d(TAG, "getCachedNtpTime() cache hit");
TimeResult timeResult = mTimeResult;
@@ -241,7 +240,7 @@ public class NtpTrustedTime implements TrustedTime {
* @deprecated Use {@link #getCachedTimeResult()} to obtain a {@link TimeResult} atomically.
*/
@Deprecated
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public long getCachedNtpTimeReference() {
TimeResult timeResult = mTimeResult;
return timeResult == null ? 0 : timeResult.getElapsedRealtimeMillis();

View File

@@ -16,7 +16,6 @@ package android.util;
import android.compat.annotation.UnsupportedAppUsage;
import android.graphics.Path;
import android.os.Build;
import dalvik.annotation.optimization.FastNative;
@@ -30,7 +29,7 @@ public class PathParser {
* @param pathString The string representing a path, the same as "d" string in svg file.
* @return the generated Path object.
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public static Path createPathFromPathData(String pathString) {
if (pathString == null) {
throw new IllegalArgumentException("Path string can not be null.");

View File

@@ -19,7 +19,6 @@ import static com.android.internal.util.Preconditions.checkNotNull;
import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
import java.io.IOException;
import java.io.InvalidObjectException;
@@ -78,9 +77,9 @@ public final class Rational extends Number implements Comparable<Rational> {
* Do not change the order of these fields or add new instance fields to maintain the
* Serializable compatibility across API revisions.
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
private final int mNumerator;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
private final int mDenominator;
/**

View File

@@ -18,7 +18,6 @@ package android.util;
import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
@@ -52,7 +51,7 @@ public class RecurrenceRule implements Parcelable {
@VisibleForTesting
public static Clock sClock = Clock.systemDefaultZone();
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public final ZonedDateTime start;
public final ZonedDateTime end;
public final Period period;
@@ -69,7 +68,7 @@ public class RecurrenceRule implements Parcelable {
}
@Deprecated
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public static RecurrenceRule buildRecurringMonthly(int dayOfMonth, ZoneId zone) {
// Assume we started last January, since it has all possible days
final ZonedDateTime now = ZonedDateTime.now(sClock).withZoneSameInstant(zone);

View File

@@ -89,7 +89,7 @@ public final class Slog {
* will always be handled asynchronously. Primarily for use by coding running within
* the system process.
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public static int wtf(String tag, String msg) {
return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, null, false, true);
}
@@ -130,7 +130,7 @@ public final class Slog {
return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, tr, false, true);
}
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public static int println(int priority, String tag, String msg) {
return Log.println_native(Log.LOG_ID_SYSTEM, priority, tag, msg);
}

View File

@@ -363,7 +363,7 @@ public class TimeUtils {
* @return String representation of the time.
* @hide
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public static String logTimeOfDay(long millis) {
Calendar c = Calendar.getInstance();
if (millis >= 0) {

View File

@@ -17,7 +17,6 @@
package android.util;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
/**
* Interface that provides trusted time information, possibly coming from an NTP
@@ -53,7 +52,7 @@ public interface TrustedTime {
* @deprecated Only kept for UnsupportedAppUsage. Do not use. See {@link NtpTrustedTime}
*/
@Deprecated
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
@UnsupportedAppUsage
public long getCacheAge();
/**