Merge "Add @UnsupportedAppUsage annotations"
am: 06f2e6b7c8
Change-Id: I21260b0436ae2a6fb432b752ec9cd35637f9cd68
This commit is contained in:
@@ -4634,97 +4634,7 @@ Landroid/transition/Transition;->getRunningAnimators()Landroid/util/ArrayMap;
|
||||
Landroid/transition/TransitionManager;->getRunningTransitions()Landroid/util/ArrayMap;
|
||||
Landroid/transition/TransitionManager;->sPendingTransitions:Ljava/util/ArrayList;
|
||||
Landroid/transition/TransitionManager;->sRunningTransitions:Ljava/lang/ThreadLocal;
|
||||
Landroid/util/ArrayMap;->allocArrays(I)V
|
||||
Landroid/util/ArrayMap;->append(Ljava/lang/Object;Ljava/lang/Object;)V
|
||||
Landroid/util/ArrayMap;->CACHE_SIZE:I
|
||||
Landroid/util/ArrayMap;->EMPTY:Landroid/util/ArrayMap;
|
||||
Landroid/util/ArrayMap;->EMPTY_IMMUTABLE_INTS:[I
|
||||
Landroid/util/ArrayMap;->freeArrays([I[Ljava/lang/Object;I)V
|
||||
Landroid/util/ArrayMap;->indexOf(Ljava/lang/Object;I)I
|
||||
Landroid/util/ArrayMap;->indexOfNull()I
|
||||
Landroid/util/ArrayMap;->indexOfValue(Ljava/lang/Object;)I
|
||||
Landroid/util/ArrayMap;->mArray:[Ljava/lang/Object;
|
||||
Landroid/util/ArrayMap;->mBaseCache:[Ljava/lang/Object;
|
||||
Landroid/util/ArrayMap;->mBaseCacheSize:I
|
||||
Landroid/util/ArrayMap;->mHashes:[I
|
||||
Landroid/util/ArrayMap;->mSize:I
|
||||
Landroid/util/ArrayMap;->mTwiceBaseCache:[Ljava/lang/Object;
|
||||
Landroid/util/ArrayMap;->mTwiceBaseCacheSize:I
|
||||
Landroid/util/ArraySet;-><init>(Ljava/util/Collection;)V
|
||||
Landroid/util/ArraySet;->allocArrays(I)V
|
||||
Landroid/util/ArraySet;->freeArrays([I[Ljava/lang/Object;I)V
|
||||
Landroid/util/ArraySet;->indexOf(Ljava/lang/Object;I)I
|
||||
Landroid/util/ArraySet;->indexOfNull()I
|
||||
Landroid/util/ArraySet;->mArray:[Ljava/lang/Object;
|
||||
Landroid/util/ArraySet;->mHashes:[I
|
||||
Landroid/util/ArraySet;->mSize:I
|
||||
Landroid/util/Base64;-><init>()V
|
||||
Landroid/util/Base64OutputStream;-><init>(Ljava/io/OutputStream;IZ)V
|
||||
Landroid/util/DebugUtils;->buildShortClassTag(Ljava/lang/Object;Ljava/lang/StringBuilder;)V
|
||||
Landroid/util/DisplayMetrics;->DENSITY_DEVICE:I
|
||||
Landroid/util/DisplayMetrics;->noncompatDensityDpi:I
|
||||
Landroid/util/DisplayMetrics;->noncompatHeightPixels:I
|
||||
Landroid/util/DisplayMetrics;->noncompatWidthPixels:I
|
||||
Landroid/util/EventLog$Event;-><init>([B)V
|
||||
Landroid/util/IconDrawableFactory;->getBadgedIcon(Landroid/content/pm/ApplicationInfo;)Landroid/graphics/drawable/Drawable;
|
||||
Landroid/util/LocalLog;->dump(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V
|
||||
Landroid/util/Log;->println_native(IILjava/lang/String;Ljava/lang/String;)I
|
||||
Landroid/util/Log;->wtf(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ZZ)I
|
||||
Landroid/util/LogWriter;-><init>(ILjava/lang/String;)V
|
||||
Landroid/util/LongSparseLongArray;->mKeys:[J
|
||||
Landroid/util/LongSparseLongArray;->mSize:I
|
||||
Landroid/util/LongSparseLongArray;->mValues:[J
|
||||
Landroid/util/LruCache;->map:Ljava/util/LinkedHashMap;
|
||||
Landroid/util/MathUtils;->abs(F)F
|
||||
Landroid/util/MathUtils;->constrain(FFF)F
|
||||
Landroid/util/MathUtils;->constrain(III)I
|
||||
Landroid/util/MathUtils;->lerp(FFF)F
|
||||
Landroid/util/MathUtils;->max(II)F
|
||||
Landroid/util/NtpTrustedTime;->currentTimeMillis()J
|
||||
Landroid/util/NtpTrustedTime;->forceRefresh()Z
|
||||
Landroid/util/NtpTrustedTime;->getCachedNtpTime()J
|
||||
Landroid/util/NtpTrustedTime;->getCachedNtpTimeReference()J
|
||||
Landroid/util/NtpTrustedTime;->getInstance(Landroid/content/Context;)Landroid/util/NtpTrustedTime;
|
||||
Landroid/util/NtpTrustedTime;->hasCache()Z
|
||||
Landroid/util/PathParser;->createPathFromPathData(Ljava/lang/String;)Landroid/graphics/Path;
|
||||
Landroid/util/Pools$Pool;->acquire()Ljava/lang/Object;
|
||||
Landroid/util/Pools$Pool;->release(Ljava/lang/Object;)Z
|
||||
Landroid/util/Pools$SimplePool;-><init>(I)V
|
||||
Landroid/util/Pools$SimplePool;->acquire()Ljava/lang/Object;
|
||||
Landroid/util/Pools$SimplePool;->mPool:[Ljava/lang/Object;
|
||||
Landroid/util/Pools$SimplePool;->release(Ljava/lang/Object;)Z
|
||||
Landroid/util/Pools$SynchronizedPool;-><init>(I)V
|
||||
Landroid/util/Pools$SynchronizedPool;->acquire()Ljava/lang/Object;
|
||||
Landroid/util/Pools$SynchronizedPool;->release(Ljava/lang/Object;)Z
|
||||
Landroid/util/Rational;->mDenominator:I
|
||||
Landroid/util/Rational;->mNumerator:I
|
||||
Landroid/util/Singleton;-><init>()V
|
||||
Landroid/util/Singleton;->get()Ljava/lang/Object;
|
||||
Landroid/util/Singleton;->mInstance:Ljava/lang/Object;
|
||||
Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
|
||||
Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
||||
Landroid/util/Slog;->i(Ljava/lang/String;Ljava/lang/String;)I
|
||||
Landroid/util/Slog;->v(Ljava/lang/String;Ljava/lang/String;)I
|
||||
Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;)I
|
||||
Landroid/util/Slog;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
||||
Landroid/util/Slog;->wtf(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
||||
Landroid/util/Slog;->wtfStack(Ljava/lang/String;Ljava/lang/String;)I
|
||||
Landroid/util/SparseArray;->mKeys:[I
|
||||
Landroid/util/SparseArray;->mSize:I
|
||||
Landroid/util/SparseArray;->mValues:[Ljava/lang/Object;
|
||||
Landroid/util/SparseBooleanArray;->mKeys:[I
|
||||
Landroid/util/SparseBooleanArray;->mSize:I
|
||||
Landroid/util/SparseBooleanArray;->mValues:[Z
|
||||
Landroid/util/SparseIntArray;->mKeys:[I
|
||||
Landroid/util/SparseIntArray;->mSize:I
|
||||
Landroid/util/SparseIntArray;->mValues:[I
|
||||
Landroid/util/TimeUtils;->formatDuration(JLjava/io/PrintWriter;)V
|
||||
Landroid/util/TimeUtils;->formatDuration(JLjava/io/PrintWriter;I)V
|
||||
Landroid/util/TimeUtils;->logTimeOfDay(J)Ljava/lang/String;
|
||||
Landroid/util/TrustedTime;->currentTimeMillis()J
|
||||
Landroid/util/TrustedTime;->forceRefresh()Z
|
||||
Landroid/util/TrustedTime;->getCacheAge()J
|
||||
Landroid/util/TrustedTime;->hasCache()Z
|
||||
Landroid/view/accessibility/AccessibilityEvent;->mAction:I
|
||||
Landroid/view/accessibility/AccessibilityEvent;->mEventType:I
|
||||
Landroid/view/accessibility/AccessibilityInteractionClient;->clearCache()V
|
||||
|
||||
@@ -475,22 +475,6 @@ Landroid/telephony/TelephonyManager;->nvResetConfig(I)Z
|
||||
Landroid/telephony/TelephonyManager;->putIntAtIndex(Landroid/content/ContentResolver;Ljava/lang/String;II)Z
|
||||
Landroid/telephony/TelephonyManager;->setPreferredNetworkType(II)Z
|
||||
Landroid/text/TextUtils;->isPrintableAsciiOnly(Ljava/lang/CharSequence;)Z
|
||||
Landroid/util/IconDrawableFactory;->getBadgedIcon(Landroid/content/pm/PackageItemInfo;Landroid/content/pm/ApplicationInfo;I)Landroid/graphics/drawable/Drawable;
|
||||
Landroid/util/IconDrawableFactory;->newInstance(Landroid/content/Context;)Landroid/util/IconDrawableFactory;
|
||||
Landroid/util/LocalLog$ReadOnlyLocalLog;->dump(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V
|
||||
Landroid/util/LocalLog;-><init>(I)V
|
||||
Landroid/util/LocalLog;->log(Ljava/lang/String;)V
|
||||
Landroid/util/LocalLog;->readOnlyLocalLog()Landroid/util/LocalLog$ReadOnlyLocalLog;
|
||||
Landroid/util/LongArray;-><init>()V
|
||||
Landroid/util/LongArray;->add(IJ)V
|
||||
Landroid/util/LongArray;->get(I)J
|
||||
Landroid/util/LongArray;->size()I
|
||||
Landroid/util/RecurrenceRule;->buildRecurringMonthly(ILjava/time/ZoneId;)Landroid/util/RecurrenceRule;
|
||||
Landroid/util/RecurrenceRule;->start:Ljava/time/ZonedDateTime;
|
||||
Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
|
||||
Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
||||
Landroid/util/Slog;->println(ILjava/lang/String;Ljava/lang/String;)I
|
||||
Landroid/util/Slog;->wtf(Ljava/lang/String;Ljava/lang/String;)I
|
||||
Landroid/view/AppTransitionAnimationSpec;-><init>(ILandroid/graphics/GraphicBuffer;Landroid/graphics/Rect;)V
|
||||
Landroid/view/BatchedInputEventReceiver;-><init>(Landroid/view/InputChannel;Landroid/os/Looper;Landroid/view/Choreographer;)V
|
||||
Landroid/view/Choreographer;->getSfInstance()Landroid/view/Choreographer;
|
||||
|
||||
@@ -18,6 +18,7 @@ package android.util;
|
||||
|
||||
import libcore.util.EmptyArray;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import java.util.Collection;
|
||||
import java.util.ConcurrentModificationException;
|
||||
import java.util.Map;
|
||||
@@ -70,16 +71,19 @@ public final class ArrayMap<K, V> implements Map<K, V> {
|
||||
/**
|
||||
* Maximum number of entries to have in array caches.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
private static final int CACHE_SIZE = 10;
|
||||
|
||||
/**
|
||||
* Special hash array value that indicates the container is immutable.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
static final int[] EMPTY_IMMUTABLE_INTS = new int[0];
|
||||
|
||||
/**
|
||||
* @hide Special immutable empty ArrayMap.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public static final ArrayMap EMPTY = new ArrayMap<>(-1);
|
||||
|
||||
/**
|
||||
@@ -88,14 +92,21 @@ public final class ArrayMap<K, V> implements Map<K, V> {
|
||||
* The first entry in the array is a pointer to the next array in the
|
||||
* list; the second entry is a pointer to the int[] hash code array for it.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
static Object[] mBaseCache;
|
||||
@UnsupportedAppUsage
|
||||
static int mBaseCacheSize;
|
||||
@UnsupportedAppUsage
|
||||
static Object[] mTwiceBaseCache;
|
||||
@UnsupportedAppUsage
|
||||
static int mTwiceBaseCacheSize;
|
||||
|
||||
final boolean mIdentityHashCode;
|
||||
@UnsupportedAppUsage
|
||||
int[] mHashes;
|
||||
@UnsupportedAppUsage
|
||||
Object[] mArray;
|
||||
@UnsupportedAppUsage
|
||||
int mSize;
|
||||
MapCollections<K, V> mCollections;
|
||||
|
||||
@@ -111,6 +122,7 @@ public final class ArrayMap<K, V> implements Map<K, V> {
|
||||
}
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
int indexOf(Object key, int hash) {
|
||||
final int N = mSize;
|
||||
|
||||
@@ -149,6 +161,7 @@ public final class ArrayMap<K, V> implements Map<K, V> {
|
||||
return ~end;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
int indexOfNull() {
|
||||
final int N = mSize;
|
||||
|
||||
@@ -187,6 +200,7 @@ public final class ArrayMap<K, V> implements Map<K, V> {
|
||||
return ~end;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
private void allocArrays(final int size) {
|
||||
if (mHashes == EMPTY_IMMUTABLE_INTS) {
|
||||
throw new UnsupportedOperationException("ArrayMap is immutable");
|
||||
@@ -225,6 +239,7 @@ public final class ArrayMap<K, V> implements Map<K, V> {
|
||||
mArray = new Object[size<<1];
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
private static void freeArrays(final int[] hashes, final Object[] array, final int size) {
|
||||
if (hashes.length == (BASE_SIZE*2)) {
|
||||
synchronized (ArrayMap.class) {
|
||||
@@ -378,6 +393,7 @@ public final class ArrayMap<K, V> implements Map<K, V> {
|
||||
: indexOf(key, mIdentityHashCode ? System.identityHashCode(key) : key.hashCode());
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
int indexOfValue(Object value) {
|
||||
final int N = mSize*2;
|
||||
final Object[] array = mArray;
|
||||
@@ -535,6 +551,7 @@ public final class ArrayMap<K, V> implements Map<K, V> {
|
||||
* The array must already be large enough to contain the item.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public void append(K key, V value) {
|
||||
int index = mSize;
|
||||
final int hash = key == null ? 0
|
||||
|
||||
@@ -18,6 +18,7 @@ package android.util;
|
||||
|
||||
import libcore.util.EmptyArray;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
@@ -70,11 +71,15 @@ public final class ArraySet<E> implements Collection<E>, Set<E> {
|
||||
static int sTwiceBaseCacheSize;
|
||||
|
||||
final boolean mIdentityHashCode;
|
||||
@UnsupportedAppUsage
|
||||
int[] mHashes;
|
||||
@UnsupportedAppUsage
|
||||
Object[] mArray;
|
||||
@UnsupportedAppUsage
|
||||
int mSize;
|
||||
MapCollections<E, E> mCollections;
|
||||
|
||||
@UnsupportedAppUsage
|
||||
private int indexOf(Object key, int hash) {
|
||||
final int N = mSize;
|
||||
|
||||
@@ -113,6 +118,7 @@ public final class ArraySet<E> implements Collection<E>, Set<E> {
|
||||
return ~end;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
private int indexOfNull() {
|
||||
final int N = mSize;
|
||||
|
||||
@@ -151,6 +157,7 @@ public final class ArraySet<E> implements Collection<E>, Set<E> {
|
||||
return ~end;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
private void allocArrays(final int size) {
|
||||
if (size == (BASE_SIZE * 2)) {
|
||||
synchronized (ArraySet.class) {
|
||||
@@ -208,6 +215,7 @@ public final class ArraySet<E> implements Collection<E>, Set<E> {
|
||||
mArray = new Object[size];
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
private static void freeArrays(final int[] hashes, final Object[] array, final int size) {
|
||||
if (hashes.length == (BASE_SIZE * 2)) {
|
||||
synchronized (ArraySet.class) {
|
||||
@@ -282,6 +290,7 @@ public final class ArraySet<E> implements Collection<E>, Set<E> {
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@UnsupportedAppUsage
|
||||
public ArraySet(Collection<E> set) {
|
||||
this();
|
||||
if (set != null) {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
/**
|
||||
@@ -737,5 +738,6 @@ public class Base64 {
|
||||
}
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
private Base64() { } // don't instantiate
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import java.io.FilterOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
@@ -57,6 +58,7 @@ public class Base64OutputStream extends FilterOutputStream {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public Base64OutputStream(OutputStream out, int flags, boolean encode) {
|
||||
super(out);
|
||||
this.flags = flags;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
@@ -108,6 +109,7 @@ public class DebugUtils {
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@UnsupportedAppUsage
|
||||
public static void buildShortClassTag(Object cls, StringBuilder out) {
|
||||
if (cls == null) {
|
||||
out.append("null");
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import android.os.SystemProperties;
|
||||
|
||||
|
||||
@@ -172,6 +173,7 @@ public class DisplayMetrics {
|
||||
* density for a specific display.
|
||||
*/
|
||||
@Deprecated
|
||||
@UnsupportedAppUsage
|
||||
public static int DENSITY_DEVICE = getDeviceDensity();
|
||||
|
||||
/**
|
||||
@@ -234,12 +236,14 @@ public class DisplayMetrics {
|
||||
* being applied.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public int noncompatWidthPixels;
|
||||
/**
|
||||
* The reported display height prior to any compatibility mode scaling
|
||||
* being applied.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public int noncompatHeightPixels;
|
||||
/**
|
||||
* The reported display density prior to any compatibility mode scaling
|
||||
@@ -252,6 +256,7 @@ public class DisplayMetrics {
|
||||
* being applied.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public int noncompatDensityDpi;
|
||||
/**
|
||||
* The reported scaled density prior to any compatibility mode scaling
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.util;
|
||||
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
@@ -82,6 +83,7 @@ public class EventLog {
|
||||
private static final byte FLOAT_TYPE = 4;
|
||||
|
||||
/** @param data containing event, read from the system */
|
||||
@UnsupportedAppUsage
|
||||
/*package*/ Event(byte[] data) {
|
||||
mBuffer = ByteBuffer.wrap(data);
|
||||
mBuffer.order(ByteOrder.nativeOrder());
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import android.annotation.UserIdInt;
|
||||
import android.content.Context;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
@@ -52,6 +53,7 @@ public class IconDrawableFactory {
|
||||
return appInfo.isInstantApp() || mUm.isManagedProfile(userId);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public Drawable getBadgedIcon(ApplicationInfo appInfo) {
|
||||
return getBadgedIcon(appInfo, UserHandle.getUserId(appInfo.uid));
|
||||
}
|
||||
@@ -60,6 +62,7 @@ public class IconDrawableFactory {
|
||||
return getBadgedIcon(appInfo, appInfo, userId);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public Drawable getBadgedIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo,
|
||||
@UserIdInt int userId) {
|
||||
Drawable icon = mPm.loadUnbadgedItemIcon(itemInfo, appInfo);
|
||||
@@ -107,6 +110,7 @@ public class IconDrawableFactory {
|
||||
return Resources.getSystem().getColor(resourceId, null);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static IconDrawableFactory newInstance(Context context) {
|
||||
return new IconDrawableFactory(context, true);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -31,11 +32,13 @@ public final class LocalLog {
|
||||
private final Deque<String> mLog;
|
||||
private final int mMaxLines;
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public LocalLog(int maxLines) {
|
||||
mMaxLines = Math.max(0, maxLines);
|
||||
mLog = new ArrayDeque<>(mMaxLines);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public void log(String msg) {
|
||||
if (mMaxLines <= 0) {
|
||||
return;
|
||||
@@ -50,6 +53,7 @@ public final class LocalLog {
|
||||
mLog.add(logLine);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public synchronized void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||
Iterator<String> itr = mLog.iterator();
|
||||
while (itr.hasNext()) {
|
||||
@@ -69,6 +73,7 @@ public final class LocalLog {
|
||||
ReadOnlyLocalLog(LocalLog log) {
|
||||
mLog = log;
|
||||
}
|
||||
@UnsupportedAppUsage
|
||||
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||
mLog.dump(fd, pw, args);
|
||||
}
|
||||
@@ -77,6 +82,7 @@ public final class LocalLog {
|
||||
}
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public ReadOnlyLocalLog readOnlyLocalLog() {
|
||||
return new ReadOnlyLocalLog(this);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import android.os.DeadSystemException;
|
||||
|
||||
import com.android.internal.os.RuntimeInit;
|
||||
@@ -294,6 +295,7 @@ public final class Log {
|
||||
return wtf(LOG_ID_MAIN, tag, msg, tr, false, false);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
static int wtf(int logId, String tag, String msg, Throwable tr, boolean localStack,
|
||||
boolean system) {
|
||||
TerribleFailure what = new TerribleFailure(msg, tr);
|
||||
@@ -371,6 +373,7 @@ public final class Log {
|
||||
/** @hide */ public static final int LOG_ID_CRASH = 4;
|
||||
|
||||
/** @hide */
|
||||
@UnsupportedAppUsage
|
||||
public static native int println_native(int bufID, int priority, String tag, String msg);
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import java.io.Writer;
|
||||
|
||||
/** @hide */
|
||||
@@ -37,6 +38,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
|
||||
public LogWriter(int priority, String tag) {
|
||||
mPriority = priority;
|
||||
mTag = tag;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.util;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.util.Preconditions;
|
||||
@@ -44,6 +45,7 @@ public class LongArray implements Cloneable {
|
||||
/**
|
||||
* Creates an empty LongArray with the default initial capacity.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public LongArray() {
|
||||
this(10);
|
||||
}
|
||||
@@ -102,6 +104,7 @@ public class LongArray implements Cloneable {
|
||||
*
|
||||
* @throws IndexOutOfBoundsException when index < 0 || index > size()
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public void add(int index, long value) {
|
||||
ensureCapacity(1);
|
||||
int rightSegment = mSize - index;
|
||||
@@ -165,6 +168,7 @@ public class LongArray implements Cloneable {
|
||||
/**
|
||||
* Returns the value at the specified position in this array.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public long get(int index) {
|
||||
ArrayUtils.checkBounds(mSize, index);
|
||||
return mValues[index];
|
||||
@@ -204,6 +208,7 @@ public class LongArray implements Cloneable {
|
||||
/**
|
||||
* Returns the number of values in this array.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public int size() {
|
||||
return mSize;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package android.util;
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.util.GrowingArrayUtils;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import libcore.util.EmptyArray;
|
||||
|
||||
/**
|
||||
@@ -45,8 +46,11 @@ import libcore.util.EmptyArray;
|
||||
* @hide
|
||||
*/
|
||||
public class LongSparseLongArray implements Cloneable {
|
||||
@UnsupportedAppUsage
|
||||
private long[] mKeys;
|
||||
@UnsupportedAppUsage
|
||||
private long[] mValues;
|
||||
@UnsupportedAppUsage
|
||||
private int mSize;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -60,6 +61,7 @@ import java.util.Map;
|
||||
* Support Package</a> for earlier releases.
|
||||
*/
|
||||
public class LruCache<K, V> {
|
||||
@UnsupportedAppUsage
|
||||
private final LinkedHashMap<K, V> map;
|
||||
|
||||
/** Size of this cache in units. Not necessarily the number of elements. */
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
|
||||
/**
|
||||
* A class that contains utility methods related to numbers.
|
||||
*
|
||||
@@ -28,10 +30,12 @@ public final class MathUtils {
|
||||
private MathUtils() {
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static float abs(float v) {
|
||||
return v > 0 ? v : -v;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static int constrain(int amount, int low, int high) {
|
||||
return amount < low ? low : (amount > high ? high : amount);
|
||||
}
|
||||
@@ -40,6 +44,7 @@ public final class MathUtils {
|
||||
return amount < low ? low : (amount > high ? high : amount);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static float constrain(float amount, float low, float high) {
|
||||
return amount < low ? low : (amount > high ? high : amount);
|
||||
}
|
||||
@@ -64,6 +69,7 @@ public final class MathUtils {
|
||||
return a > b ? a : b;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static float max(int a, int b) {
|
||||
return a > b ? a : b;
|
||||
}
|
||||
@@ -153,6 +159,7 @@ public final class MathUtils {
|
||||
return (float) Math.tan(angle);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static float lerp(float start, float stop, float amount) {
|
||||
return start + (stop - start) * amount;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
@@ -56,6 +57,7 @@ public class NtpTrustedTime implements TrustedTime {
|
||||
mTimeout = timeout;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static synchronized NtpTrustedTime getInstance(Context context) {
|
||||
if (sSingleton == null) {
|
||||
final Resources res = context.getResources();
|
||||
@@ -80,6 +82,7 @@ public class NtpTrustedTime implements TrustedTime {
|
||||
}
|
||||
|
||||
@Override
|
||||
@UnsupportedAppUsage
|
||||
public boolean forceRefresh() {
|
||||
// We can't do this at initialization time: ConnectivityService might not be running yet.
|
||||
synchronized (this) {
|
||||
@@ -126,6 +129,7 @@ public class NtpTrustedTime implements TrustedTime {
|
||||
}
|
||||
|
||||
@Override
|
||||
@UnsupportedAppUsage
|
||||
public boolean hasCache() {
|
||||
return mHasCache;
|
||||
}
|
||||
@@ -149,6 +153,7 @@ public class NtpTrustedTime implements TrustedTime {
|
||||
}
|
||||
|
||||
@Override
|
||||
@UnsupportedAppUsage
|
||||
public long currentTimeMillis() {
|
||||
if (!mHasCache) {
|
||||
throw new IllegalStateException("Missing authoritative time source");
|
||||
@@ -160,11 +165,13 @@ public class NtpTrustedTime implements TrustedTime {
|
||||
return mCachedNtpTime + getCacheAge();
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public long getCachedNtpTime() {
|
||||
if (LOGD) Log.d(TAG, "getCachedNtpTime() cache hit");
|
||||
return mCachedNtpTime;
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public long getCachedNtpTimeReference() {
|
||||
return mCachedNtpElapsedRealtime;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import android.graphics.Path;
|
||||
|
||||
import dalvik.annotation.optimization.FastNative;
|
||||
@@ -28,6 +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
|
||||
public static Path createPathFromPathData(String pathString) {
|
||||
if (pathString == null) {
|
||||
throw new IllegalArgumentException("Path string can not be null.");
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
|
||||
/**
|
||||
* Helper class for crating pools of objects. An example use looks like this:
|
||||
* <pre>
|
||||
@@ -52,6 +54,7 @@ public final class Pools {
|
||||
/**
|
||||
* @return An instance from the pool if such, null otherwise.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public T acquire();
|
||||
|
||||
/**
|
||||
@@ -62,6 +65,7 @@ public final class Pools {
|
||||
*
|
||||
* @throws IllegalStateException If the instance is already in the pool.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public boolean release(T instance);
|
||||
}
|
||||
|
||||
@@ -75,6 +79,7 @@ public final class Pools {
|
||||
* @param <T> The pooled type.
|
||||
*/
|
||||
public static class SimplePool<T> implements Pool<T> {
|
||||
@UnsupportedAppUsage
|
||||
private final Object[] mPool;
|
||||
|
||||
private int mPoolSize;
|
||||
@@ -86,6 +91,7 @@ public final class Pools {
|
||||
*
|
||||
* @throws IllegalArgumentException If the max pool size is less than zero.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public SimplePool(int maxPoolSize) {
|
||||
if (maxPoolSize <= 0) {
|
||||
throw new IllegalArgumentException("The max pool size must be > 0");
|
||||
@@ -95,6 +101,7 @@ public final class Pools {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
@UnsupportedAppUsage
|
||||
public T acquire() {
|
||||
if (mPoolSize > 0) {
|
||||
final int lastPooledIndex = mPoolSize - 1;
|
||||
@@ -107,6 +114,7 @@ public final class Pools {
|
||||
}
|
||||
|
||||
@Override
|
||||
@UnsupportedAppUsage
|
||||
public boolean release(T instance) {
|
||||
if (isInPool(instance)) {
|
||||
throw new IllegalStateException("Already in the pool!");
|
||||
@@ -151,11 +159,13 @@ public final class Pools {
|
||||
}
|
||||
|
||||
/** @see #SynchronizedPool(int, Object) */
|
||||
@UnsupportedAppUsage
|
||||
public SynchronizedPool(int maxPoolSize) {
|
||||
this(maxPoolSize, new Object());
|
||||
}
|
||||
|
||||
@Override
|
||||
@UnsupportedAppUsage
|
||||
public T acquire() {
|
||||
synchronized (mLock) {
|
||||
return super.acquire();
|
||||
@@ -163,6 +173,7 @@ public final class Pools {
|
||||
}
|
||||
|
||||
@Override
|
||||
@UnsupportedAppUsage
|
||||
public boolean release(T element) {
|
||||
synchronized (mLock) {
|
||||
return super.release(element);
|
||||
|
||||
@@ -17,6 +17,7 @@ package android.util;
|
||||
|
||||
import static com.android.internal.util.Preconditions.*;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import java.io.IOException;
|
||||
import java.io.InvalidObjectException;
|
||||
|
||||
@@ -74,7 +75,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
|
||||
private final int mNumerator;
|
||||
@UnsupportedAppUsage
|
||||
private final int mDenominator;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
@@ -49,6 +50,7 @@ public class RecurrenceRule implements Parcelable {
|
||||
@VisibleForTesting
|
||||
public static Clock sClock = Clock.systemDefaultZone();
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public final ZonedDateTime start;
|
||||
public final ZonedDateTime end;
|
||||
public final Period period;
|
||||
@@ -65,6 +67,7 @@ public class RecurrenceRule implements Parcelable {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@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);
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
|
||||
/**
|
||||
* Singleton helper class for lazily initialization.
|
||||
*
|
||||
@@ -24,10 +26,12 @@ package android.util;
|
||||
* @hide
|
||||
*/
|
||||
public abstract class Singleton<T> {
|
||||
@UnsupportedAppUsage
|
||||
private T mInstance;
|
||||
|
||||
protected abstract T create();
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public final T get() {
|
||||
synchronized (this) {
|
||||
if (mInstance == null) {
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
@@ -24,6 +26,7 @@ public final class Slog {
|
||||
private Slog() {
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static int v(String tag, String msg) {
|
||||
return Log.println_native(Log.LOG_ID_SYSTEM, Log.VERBOSE, tag, msg);
|
||||
}
|
||||
@@ -33,15 +36,18 @@ public final class Slog {
|
||||
msg + '\n' + Log.getStackTraceString(tr));
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static int d(String tag, String msg) {
|
||||
return Log.println_native(Log.LOG_ID_SYSTEM, Log.DEBUG, tag, msg);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static int d(String tag, String msg, Throwable tr) {
|
||||
return Log.println_native(Log.LOG_ID_SYSTEM, Log.DEBUG, tag,
|
||||
msg + '\n' + Log.getStackTraceString(tr));
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static int i(String tag, String msg) {
|
||||
return Log.println_native(Log.LOG_ID_SYSTEM, Log.INFO, tag, msg);
|
||||
}
|
||||
@@ -51,10 +57,12 @@ public final class Slog {
|
||||
msg + '\n' + Log.getStackTraceString(tr));
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static int w(String tag, String msg) {
|
||||
return Log.println_native(Log.LOG_ID_SYSTEM, Log.WARN, tag, msg);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static int w(String tag, String msg, Throwable tr) {
|
||||
return Log.println_native(Log.LOG_ID_SYSTEM, Log.WARN, tag,
|
||||
msg + '\n' + Log.getStackTraceString(tr));
|
||||
@@ -64,10 +72,12 @@ public final class Slog {
|
||||
return Log.println_native(Log.LOG_ID_SYSTEM, Log.WARN, tag, Log.getStackTraceString(tr));
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static int e(String tag, String msg) {
|
||||
return Log.println_native(Log.LOG_ID_SYSTEM, Log.ERROR, tag, msg);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static int e(String tag, String msg, Throwable tr) {
|
||||
return Log.println_native(Log.LOG_ID_SYSTEM, Log.ERROR, tag,
|
||||
msg + '\n' + Log.getStackTraceString(tr));
|
||||
@@ -78,6 +88,7 @@ public final class Slog {
|
||||
* will always be handled asynchronously. Primarily for use by coding running within
|
||||
* the system process.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public static int wtf(String tag, String msg) {
|
||||
return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, null, false, true);
|
||||
}
|
||||
@@ -94,6 +105,7 @@ public final class Slog {
|
||||
* will always be handled asynchronously. Primarily for use by coding running within
|
||||
* the system process.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public static int wtfStack(String tag, String msg) {
|
||||
return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, null, true, true);
|
||||
}
|
||||
@@ -112,10 +124,12 @@ public final class Slog {
|
||||
* and will always be handled asynchronously. Primarily for use by coding running within
|
||||
* the system process.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public static int wtf(String tag, String msg, Throwable tr) {
|
||||
return Log.wtf(Log.LOG_ID_SYSTEM, tag, msg, tr, false, true);
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
public static int println(int priority, String tag, String msg) {
|
||||
return Log.println_native(Log.LOG_ID_SYSTEM, priority, tag, msg);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ package android.util;
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.util.GrowingArrayUtils;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import libcore.util.EmptyArray;
|
||||
|
||||
/**
|
||||
@@ -53,8 +54,11 @@ public class SparseArray<E> implements Cloneable {
|
||||
private static final Object DELETED = new Object();
|
||||
private boolean mGarbage = false;
|
||||
|
||||
@UnsupportedAppUsage
|
||||
private int[] mKeys;
|
||||
@UnsupportedAppUsage
|
||||
private Object[] mValues;
|
||||
@UnsupportedAppUsage
|
||||
private int mSize;
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,6 +19,7 @@ package android.util;
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.util.GrowingArrayUtils;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import libcore.util.EmptyArray;
|
||||
|
||||
/**
|
||||
@@ -303,7 +304,10 @@ public class SparseBooleanArray implements Cloneable {
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
@UnsupportedAppUsage
|
||||
private int[] mKeys;
|
||||
@UnsupportedAppUsage
|
||||
private boolean[] mValues;
|
||||
@UnsupportedAppUsage
|
||||
private int mSize;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.android.internal.util.GrowingArrayUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import libcore.util.EmptyArray;
|
||||
|
||||
/**
|
||||
@@ -45,8 +46,11 @@ import libcore.util.EmptyArray;
|
||||
* order in the case of <code>valueAt(int)</code>.</p>
|
||||
*/
|
||||
public class SparseIntArray implements Cloneable {
|
||||
@UnsupportedAppUsage
|
||||
private int[] mKeys;
|
||||
@UnsupportedAppUsage
|
||||
private int[] mValues;
|
||||
@UnsupportedAppUsage
|
||||
private int mSize;
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
import android.os.SystemClock;
|
||||
|
||||
import libcore.util.TimeZoneFinder;
|
||||
@@ -248,6 +249,7 @@ public class TimeUtils {
|
||||
}
|
||||
|
||||
/** @hide Just for debugging; not internationalized. */
|
||||
@UnsupportedAppUsage
|
||||
public static void formatDuration(long duration, PrintWriter pw, int fieldLen) {
|
||||
synchronized (sFormatSync) {
|
||||
int len = formatDurationLocked(duration, fieldLen);
|
||||
@@ -264,6 +266,7 @@ public class TimeUtils {
|
||||
}
|
||||
|
||||
/** @hide Just for debugging; not internationalized. */
|
||||
@UnsupportedAppUsage
|
||||
public static void formatDuration(long duration, PrintWriter pw) {
|
||||
formatDuration(duration, pw, 0);
|
||||
}
|
||||
@@ -297,6 +300,7 @@ public class TimeUtils {
|
||||
* @return String representation of the time.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public static String logTimeOfDay(long millis) {
|
||||
Calendar c = Calendar.getInstance();
|
||||
if (millis >= 0) {
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package android.util;
|
||||
|
||||
import android.annotation.UnsupportedAppUsage;
|
||||
|
||||
/**
|
||||
* Interface that provides trusted time information, possibly coming from an NTP
|
||||
* server. Implementations may cache answers until {@link #forceRefresh()}.
|
||||
@@ -27,17 +29,20 @@ public interface TrustedTime {
|
||||
* Force update with an external trusted time source, returning {@code true}
|
||||
* when successful.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public boolean forceRefresh();
|
||||
|
||||
/**
|
||||
* Check if this instance has cached a response from a trusted time source.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public boolean hasCache();
|
||||
|
||||
/**
|
||||
* Return time since last trusted time source contact, or
|
||||
* {@link Long#MAX_VALUE} if never contacted.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public long getCacheAge();
|
||||
|
||||
/**
|
||||
@@ -51,5 +56,6 @@ public interface TrustedTime {
|
||||
* Return current time similar to {@link System#currentTimeMillis()},
|
||||
* possibly using a cached authoritative time source.
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public long currentTimeMillis();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user