Get android.os tests running against real APIs.
Combination of moving to existing public API, tagging things as @TestApi, and bringing utility methods into tests. Bug: 13282254 Test: atest cts/tests/tests/os/ Change-Id: Ifd24c0d048d200e8595e194890cc1dc53ddc2b3e
This commit is contained in:
@@ -32811,6 +32811,7 @@ package android.os {
|
||||
method public void readMap(java.util.Map, java.lang.ClassLoader);
|
||||
method public <T extends android.os.Parcelable> T readParcelable(java.lang.ClassLoader);
|
||||
method public android.os.Parcelable[] readParcelableArray(java.lang.ClassLoader);
|
||||
method public <T extends android.os.Parcelable> java.util.List<T> readParcelableList(java.util.List<T>, java.lang.ClassLoader);
|
||||
method public android.os.PersistableBundle readPersistableBundle();
|
||||
method public android.os.PersistableBundle readPersistableBundle(java.lang.ClassLoader);
|
||||
method public java.io.Serializable readSerializable();
|
||||
@@ -32857,6 +32858,7 @@ package android.os {
|
||||
method public void writeNoException();
|
||||
method public void writeParcelable(android.os.Parcelable, int);
|
||||
method public <T extends android.os.Parcelable> void writeParcelableArray(T[], int);
|
||||
method public <T extends android.os.Parcelable> void writeParcelableList(java.util.List<T>, int);
|
||||
method public void writePersistableBundle(android.os.PersistableBundle);
|
||||
method public void writeSerializable(java.io.Serializable);
|
||||
method public void writeSize(android.util.Size);
|
||||
|
||||
@@ -257,6 +257,8 @@ package android.content.pm {
|
||||
public class ApplicationInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
|
||||
method public boolean isPrivilegedApp();
|
||||
method public boolean isSystemApp();
|
||||
field public static final int PRIVATE_FLAG_PRIVILEGED = 8; // 0x8
|
||||
field public int privateFlags;
|
||||
}
|
||||
|
||||
public class LauncherApps {
|
||||
@@ -277,6 +279,8 @@ package android.content.pm {
|
||||
field public static final java.lang.String FEATURE_FILE_BASED_ENCRYPTION = "android.software.file_based_encryption";
|
||||
field public static final int MATCH_FACTORY_ONLY = 2097152; // 0x200000
|
||||
field public static final int MATCH_KNOWN_PACKAGES = 4202496; // 0x402000
|
||||
field public static final java.lang.String SYSTEM_SHARED_LIBRARY_SERVICES = "android.ext.services";
|
||||
field public static final java.lang.String SYSTEM_SHARED_LIBRARY_SHARED = "android.ext.shared";
|
||||
}
|
||||
|
||||
public class PermissionInfo extends android.content.pm.PackageItemInfo implements android.os.Parcelable {
|
||||
@@ -632,6 +636,10 @@ package android.net {
|
||||
|
||||
package android.os {
|
||||
|
||||
public class Build {
|
||||
method public static boolean is64BitAbi(java.lang.String);
|
||||
}
|
||||
|
||||
public static class Build.VERSION {
|
||||
field public static final int FIRST_SDK_INT;
|
||||
field public static final int RESOURCES_SDK_INT;
|
||||
@@ -644,6 +652,7 @@ package android.os {
|
||||
|
||||
public class Environment {
|
||||
method public static java.io.File buildPath(java.io.File, java.lang.String...);
|
||||
method public static java.io.File getStorageDirectory();
|
||||
}
|
||||
|
||||
public class IncidentManager {
|
||||
@@ -666,8 +675,9 @@ package android.os {
|
||||
field public static final android.os.Parcelable.Creator<android.os.IncidentReportArgs> CREATOR;
|
||||
}
|
||||
|
||||
public final class PowerManager {
|
||||
method public void nap(long);
|
||||
public final class MessageQueue {
|
||||
method public int postSyncBarrier();
|
||||
method public void removeSyncBarrier(int);
|
||||
}
|
||||
|
||||
public class Process {
|
||||
@@ -688,9 +698,14 @@ package android.os {
|
||||
}
|
||||
|
||||
public final class StrictMode {
|
||||
method public static void conditionallyCheckInstanceCounts();
|
||||
method public static void setViolationLogger(android.os.StrictMode.ViolationLogger);
|
||||
}
|
||||
|
||||
public static final class StrictMode.ThreadPolicy.Builder {
|
||||
method public android.os.StrictMode.ThreadPolicy.Builder detectExplicitGc();
|
||||
}
|
||||
|
||||
public static final class StrictMode.ViolationInfo implements android.os.Parcelable {
|
||||
ctor public StrictMode.ViolationInfo(android.os.Parcel);
|
||||
ctor public StrictMode.ViolationInfo(android.os.Parcel, boolean);
|
||||
@@ -715,6 +730,7 @@ package android.os {
|
||||
}
|
||||
|
||||
public class SystemProperties {
|
||||
method public static java.lang.String get(java.lang.String);
|
||||
method public static java.lang.String get(java.lang.String, java.lang.String);
|
||||
}
|
||||
|
||||
@@ -734,7 +750,17 @@ package android.os {
|
||||
method public static android.os.VibrationEffect get(int);
|
||||
method public static android.os.VibrationEffect get(int, boolean);
|
||||
method public static android.os.VibrationEffect get(android.net.Uri, android.content.Context);
|
||||
method public abstract long getDuration();
|
||||
method protected static int scale(int, float, int);
|
||||
field public static final int EFFECT_CLICK = 0; // 0x0
|
||||
field public static final int EFFECT_DOUBLE_CLICK = 1; // 0x1
|
||||
field public static final int EFFECT_HEAVY_CLICK = 5; // 0x5
|
||||
field public static final int EFFECT_POP = 4; // 0x4
|
||||
field public static final int EFFECT_STRENGTH_LIGHT = 0; // 0x0
|
||||
field public static final int EFFECT_STRENGTH_MEDIUM = 1; // 0x1
|
||||
field public static final int EFFECT_STRENGTH_STRONG = 2; // 0x2
|
||||
field public static final int EFFECT_THUD = 3; // 0x3
|
||||
field public static final int EFFECT_TICK = 2; // 0x2
|
||||
field public static final int[] RINGTONES;
|
||||
}
|
||||
|
||||
@@ -775,6 +801,86 @@ package android.os {
|
||||
field public static final android.os.Parcelable.Creator<android.os.VibrationEffect.Waveform> CREATOR;
|
||||
}
|
||||
|
||||
public class WorkSource implements android.os.Parcelable {
|
||||
ctor public WorkSource(int);
|
||||
method public boolean add(int);
|
||||
method public boolean add(int, java.lang.String);
|
||||
method public deprecated android.os.WorkSource addReturningNewbs(android.os.WorkSource);
|
||||
method public int get(int);
|
||||
method public java.lang.String getName(int);
|
||||
method public deprecated android.os.WorkSource[] setReturningDiffs(android.os.WorkSource);
|
||||
method public int size();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package android.os.health {
|
||||
|
||||
public class HealthKeys {
|
||||
ctor public HealthKeys();
|
||||
field public static final int BASE_PACKAGE = 40000; // 0x9c40
|
||||
field public static final int BASE_PID = 20000; // 0x4e20
|
||||
field public static final int BASE_PROCESS = 30000; // 0x7530
|
||||
field public static final int BASE_SERVICE = 50000; // 0xc350
|
||||
field public static final int BASE_UID = 10000; // 0x2710
|
||||
field public static final int TYPE_COUNT = 5; // 0x5
|
||||
field public static final int TYPE_MEASUREMENT = 1; // 0x1
|
||||
field public static final int TYPE_MEASUREMENTS = 4; // 0x4
|
||||
field public static final int TYPE_STATS = 2; // 0x2
|
||||
field public static final int TYPE_TIMER = 0; // 0x0
|
||||
field public static final int TYPE_TIMERS = 3; // 0x3
|
||||
field public static final int UNKNOWN_KEY = 0; // 0x0
|
||||
}
|
||||
|
||||
public static abstract class HealthKeys.Constant implements java.lang.annotation.Annotation {
|
||||
}
|
||||
|
||||
public static class HealthKeys.Constants {
|
||||
ctor public HealthKeys.Constants(java.lang.Class);
|
||||
method public java.lang.String getDataType();
|
||||
method public int getIndex(int, int);
|
||||
method public int[] getKeys(int);
|
||||
method public int getSize(int);
|
||||
}
|
||||
|
||||
public class HealthStats {
|
||||
ctor public HealthStats(android.os.Parcel);
|
||||
}
|
||||
|
||||
public class HealthStatsParceler implements android.os.Parcelable {
|
||||
ctor public HealthStatsParceler(android.os.health.HealthStatsWriter);
|
||||
ctor public HealthStatsParceler(android.os.Parcel);
|
||||
method public int describeContents();
|
||||
method public android.os.health.HealthStats getHealthStats();
|
||||
method public void writeToParcel(android.os.Parcel, int);
|
||||
field public static final android.os.Parcelable.Creator<android.os.health.HealthStatsParceler> CREATOR;
|
||||
}
|
||||
|
||||
public class HealthStatsWriter {
|
||||
ctor public HealthStatsWriter(android.os.health.HealthKeys.Constants);
|
||||
method public void addMeasurement(int, long);
|
||||
method public void addMeasurements(int, java.lang.String, long);
|
||||
method public void addStats(int, java.lang.String, android.os.health.HealthStatsWriter);
|
||||
method public void addTimer(int, int, long);
|
||||
method public void addTimers(int, java.lang.String, android.os.health.TimerStat);
|
||||
method public void flattenToParcel(android.os.Parcel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package android.os.storage {
|
||||
|
||||
public final class StorageVolume implements android.os.Parcelable {
|
||||
method public java.lang.String getPath();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package android.os.strictmode {
|
||||
|
||||
public final class ExplicitGcViolation extends android.os.strictmode.Violation {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
package android.print {
|
||||
|
||||
@@ -1444,8 +1444,6 @@ Landroid/content/pm/ApplicationInfo;->isForwardLocked()Z
|
||||
Landroid/content/pm/ApplicationInfo;->isPackageUnavailable(Landroid/content/pm/PackageManager;)Z
|
||||
Landroid/content/pm/ApplicationInfo;->nativeLibraryRootDir:Ljava/lang/String;
|
||||
Landroid/content/pm/ApplicationInfo;->primaryCpuAbi:Ljava/lang/String;
|
||||
Landroid/content/pm/ApplicationInfo;->privateFlags:I
|
||||
Landroid/content/pm/ApplicationInfo;->PRIVATE_FLAG_PRIVILEGED:I
|
||||
Landroid/content/pm/ApplicationInfo;->resourceDirs:[Ljava/lang/String;
|
||||
Landroid/content/pm/ApplicationInfo;->scanPublicSourceDir:Ljava/lang/String;
|
||||
Landroid/content/pm/ApplicationInfo;->scanSourceDir:Ljava/lang/String;
|
||||
@@ -3925,7 +3923,6 @@ Landroid/os/Environment;->buildExternalStorageAppObbDirs(Ljava/lang/String;)[Lja
|
||||
Landroid/os/Environment;->getDataSystemDirectory()Ljava/io/File;
|
||||
Landroid/os/Environment;->getLegacyExternalStorageObbDirectory()Ljava/io/File;
|
||||
Landroid/os/Environment;->getOemDirectory()Ljava/io/File;
|
||||
Landroid/os/Environment;->getStorageDirectory()Ljava/io/File;
|
||||
Landroid/os/Environment;->getVendorDirectory()Ljava/io/File;
|
||||
Landroid/os/Environment;->initForCurrentUser()V
|
||||
Landroid/os/Environment;->maybeTranslateEmulatedPathToInternal(Ljava/io/File;)Ljava/io/File;
|
||||
@@ -3952,18 +3949,6 @@ Landroid/os/Handler;->getPostMessage(Ljava/lang/Runnable;Ljava/lang/Object;)Land
|
||||
Landroid/os/Handler;->mCallback:Landroid/os/Handler$Callback;
|
||||
Landroid/os/Handler;->mLooper:Landroid/os/Looper;
|
||||
Landroid/os/Handler;->mMessenger:Landroid/os/IMessenger;
|
||||
Landroid/os/health/HealthKeys$Constants;-><init>(Ljava/lang/Class;)V
|
||||
Landroid/os/health/HealthStats;-><init>(Landroid/os/Parcel;)V
|
||||
Landroid/os/health/HealthStatsParceler;-><init>(Landroid/os/health/HealthStatsWriter;)V
|
||||
Landroid/os/health/HealthStatsParceler;-><init>(Landroid/os/Parcel;)V
|
||||
Landroid/os/health/HealthStatsParceler;->getHealthStats()Landroid/os/health/HealthStats;
|
||||
Landroid/os/health/HealthStatsWriter;-><init>(Landroid/os/health/HealthKeys$Constants;)V
|
||||
Landroid/os/health/HealthStatsWriter;->addMeasurement(IJ)V
|
||||
Landroid/os/health/HealthStatsWriter;->addMeasurements(ILjava/lang/String;J)V
|
||||
Landroid/os/health/HealthStatsWriter;->addStats(ILjava/lang/String;Landroid/os/health/HealthStatsWriter;)V
|
||||
Landroid/os/health/HealthStatsWriter;->addTimer(IIJ)V
|
||||
Landroid/os/health/HealthStatsWriter;->addTimers(ILjava/lang/String;Landroid/os/health/TimerStat;)V
|
||||
Landroid/os/health/HealthStatsWriter;->flattenToParcel(Landroid/os/Parcel;)V
|
||||
Landroid/os/health/SystemHealthManager;-><init>()V
|
||||
Landroid/os/health/SystemHealthManager;->from(Landroid/content/Context;)Landroid/os/health/SystemHealthManager;
|
||||
Landroid/os/HwParcel;-><init>(Z)V
|
||||
@@ -4039,8 +4024,6 @@ Landroid/os/MessageQueue;->mPtr:J
|
||||
Landroid/os/MessageQueue;->mQuitAllowed:Z
|
||||
Landroid/os/MessageQueue;->nativePollOnce(JI)V
|
||||
Landroid/os/MessageQueue;->next()Landroid/os/Message;
|
||||
Landroid/os/MessageQueue;->postSyncBarrier()I
|
||||
Landroid/os/MessageQueue;->removeSyncBarrier(I)V
|
||||
Landroid/os/Parcel$ReadWriteHelper;-><init>()V
|
||||
Landroid/os/Parcel;->getGlobalAllocCount()J
|
||||
Landroid/os/Parcel;->getGlobalAllocSize()J
|
||||
@@ -4052,13 +4035,11 @@ Landroid/os/Parcel;->readCharSequence()Ljava/lang/CharSequence;
|
||||
Landroid/os/Parcel;->readCreator(Landroid/os/Parcelable$Creator;Ljava/lang/ClassLoader;)Landroid/os/Parcelable;
|
||||
Landroid/os/Parcel;->readExceptionCode()I
|
||||
Landroid/os/Parcel;->readParcelableCreator(Ljava/lang/ClassLoader;)Landroid/os/Parcelable$Creator;
|
||||
Landroid/os/Parcel;->readParcelableList(Ljava/util/List;Ljava/lang/ClassLoader;)Ljava/util/List;
|
||||
Landroid/os/Parcel;->readRawFileDescriptor()Ljava/io/FileDescriptor;
|
||||
Landroid/os/Parcel;->writeArrayMap(Landroid/util/ArrayMap;)V
|
||||
Landroid/os/Parcel;->writeArraySet(Landroid/util/ArraySet;)V
|
||||
Landroid/os/Parcel;->writeCharSequence(Ljava/lang/CharSequence;)V
|
||||
Landroid/os/Parcel;->writeParcelableCreator(Landroid/os/Parcelable;)V
|
||||
Landroid/os/Parcel;->writeParcelableList(Ljava/util/List;I)V
|
||||
Landroid/os/ParcelableParcel;-><init>(Ljava/lang/ClassLoader;)V
|
||||
Landroid/os/ParcelableParcel;->CREATOR:Landroid/os/Parcelable$ClassLoaderCreator;
|
||||
Landroid/os/ParcelableParcel;->getClassLoader()Ljava/lang/ClassLoader;
|
||||
@@ -4206,7 +4187,6 @@ Landroid/os/storage/StorageVolume;->allowMassStorage()Z
|
||||
Landroid/os/storage/StorageVolume;->getFatVolumeId()I
|
||||
Landroid/os/storage/StorageVolume;->getMaxFileSize()J
|
||||
Landroid/os/storage/StorageVolume;->getOwner()Landroid/os/UserHandle;
|
||||
Landroid/os/storage/StorageVolume;->getPath()Ljava/lang/String;
|
||||
Landroid/os/storage/StorageVolume;->getPathFile()Ljava/io/File;
|
||||
Landroid/os/storage/StorageVolume;->getUserLabel()Ljava/lang/String;
|
||||
Landroid/os/storage/StorageVolume;->mDescription:Ljava/lang/String;
|
||||
@@ -4252,7 +4232,6 @@ Landroid/os/StrictMode$Span;->finish()V
|
||||
Landroid/os/StrictMode$ThreadPolicy;->mask:I
|
||||
Landroid/os/StrictMode$VmPolicy$Builder;->mMask:I
|
||||
Landroid/os/StrictMode$VmPolicy;->mask:I
|
||||
Landroid/os/StrictMode;->conditionallyCheckInstanceCounts()V
|
||||
Landroid/os/StrictMode;->disableDeathOnFileUriExposure()V
|
||||
Landroid/os/StrictMode;->enableDeathOnFileUriExposure()V
|
||||
Landroid/os/StrictMode;->enterCriticalSpan(Ljava/lang/String;)Landroid/os/StrictMode$Span;
|
||||
@@ -4368,19 +4347,11 @@ Landroid/os/VintfRuntimeInfo;->getNodeName()Ljava/lang/String;
|
||||
Landroid/os/VintfRuntimeInfo;->getOsName()Ljava/lang/String;
|
||||
Landroid/os/VintfRuntimeInfo;->getOsRelease()Ljava/lang/String;
|
||||
Landroid/os/VintfRuntimeInfo;->getOsVersion()Ljava/lang/String;
|
||||
Landroid/os/WorkSource;-><init>(I)V
|
||||
Landroid/os/WorkSource;-><init>(Landroid/os/Parcel;)V
|
||||
Landroid/os/WorkSource;->add(I)Z
|
||||
Landroid/os/WorkSource;->add(ILjava/lang/String;)Z
|
||||
Landroid/os/WorkSource;->addReturningNewbs(Landroid/os/WorkSource;)Landroid/os/WorkSource;
|
||||
Landroid/os/WorkSource;->get(I)I
|
||||
Landroid/os/WorkSource;->getName(I)Ljava/lang/String;
|
||||
Landroid/os/WorkSource;->mNames:[Ljava/lang/String;
|
||||
Landroid/os/WorkSource;->mNum:I
|
||||
Landroid/os/WorkSource;->mUids:[I
|
||||
Landroid/os/WorkSource;->setReturningDiffs(Landroid/os/WorkSource;)[Landroid/os/WorkSource;
|
||||
Landroid/os/WorkSource;->sGoneWork:Landroid/os/WorkSource;
|
||||
Landroid/os/WorkSource;->size()I
|
||||
Landroid/os/WorkSource;->sNewbWork:Landroid/os/WorkSource;
|
||||
Landroid/os/WorkSource;->sTmpWorkSource:Landroid/os/WorkSource;
|
||||
Landroid/os/WorkSource;->updateLocked(Landroid/os/WorkSource;ZZ)Z
|
||||
|
||||
@@ -477,6 +477,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
*
|
||||
* {@hide}
|
||||
*/
|
||||
@TestApi
|
||||
public static final int PRIVATE_FLAG_PRIVILEGED = 1<<3;
|
||||
|
||||
/**
|
||||
@@ -649,6 +650,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
|
||||
* Private/hidden flags. See {@code PRIVATE_FLAG_...} constants.
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public @ApplicationInfoPrivateFlags int privateFlags;
|
||||
|
||||
/**
|
||||
|
||||
@@ -2937,6 +2937,7 @@ public abstract class PackageManager {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public static final String SYSTEM_SHARED_LIBRARY_SERVICES = "android.ext.services";
|
||||
|
||||
/**
|
||||
@@ -2948,6 +2949,7 @@ public abstract class PackageManager {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public static final String SYSTEM_SHARED_LIBRARY_SHARED = "android.ext.shared";
|
||||
|
||||
/**
|
||||
|
||||
@@ -165,6 +165,11 @@ public class Build {
|
||||
public static final String[] SUPPORTED_64_BIT_ABIS =
|
||||
getStringList("ro.product.cpu.abilist64", ",");
|
||||
|
||||
/** {@hide} */
|
||||
@TestApi
|
||||
public static boolean is64BitAbi(String abi) {
|
||||
return VMRuntime.is64BitAbi(abi);
|
||||
}
|
||||
|
||||
static {
|
||||
/*
|
||||
|
||||
@@ -149,6 +149,7 @@ public class Environment {
|
||||
}
|
||||
|
||||
/** {@hide} */
|
||||
@TestApi
|
||||
public static File getStorageDirectory() {
|
||||
return DIR_ANDROID_STORAGE;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package android.os;
|
||||
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.TestApi;
|
||||
import android.os.MessageQueueProto;
|
||||
import android.util.Log;
|
||||
import android.util.Printer;
|
||||
@@ -458,6 +459,7 @@ public final class MessageQueue {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public int postSyncBarrier() {
|
||||
return postSyncBarrier(SystemClock.uptimeMillis());
|
||||
}
|
||||
@@ -501,6 +503,7 @@ public final class MessageQueue {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public void removeSyncBarrier(int token) {
|
||||
// Remove a sync barrier token from the queue.
|
||||
// If the queue is no longer stalled by a barrier then wake it.
|
||||
|
||||
@@ -1465,7 +1465,6 @@ public final class Parcel {
|
||||
* {@link #readParcelableList(List, ClassLoader)} if required.
|
||||
*
|
||||
* @see #readParcelableList(List, ClassLoader)
|
||||
* @hide
|
||||
*/
|
||||
public final <T extends Parcelable> void writeParcelableList(@Nullable List<T> val, int flags) {
|
||||
if (val == null) {
|
||||
@@ -2570,7 +2569,6 @@ public final class Parcel {
|
||||
* list was {@code null}, {@code list} is cleared.
|
||||
*
|
||||
* @see #writeParcelableList(List, int)
|
||||
* @hide
|
||||
*/
|
||||
@NonNull
|
||||
public final <T extends Parcelable> List<T> readParcelableList(@NonNull List<T> list,
|
||||
|
||||
@@ -961,7 +961,6 @@ public final class PowerManager {
|
||||
*
|
||||
* @hide Requires signature permission.
|
||||
*/
|
||||
@TestApi
|
||||
public void nap(long time) {
|
||||
try {
|
||||
mService.nap(time);
|
||||
|
||||
@@ -577,6 +577,7 @@ public final class StrictMode {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public Builder detectExplicitGc() {
|
||||
// TODO(b/3400644): Un-hide this for next API update
|
||||
// TODO(b/3400644): Un-hide ExplicitGcViolation for next API update
|
||||
@@ -1814,6 +1815,7 @@ public final class StrictMode {
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@TestApi
|
||||
public static void conditionallyCheckInstanceCounts() {
|
||||
VmPolicy policy = getVmPolicy();
|
||||
int policySize = policy.classInstanceLimit.size();
|
||||
@@ -2004,10 +2006,6 @@ public final class StrictMode {
|
||||
onVmPolicyViolation(new ContentUriWithoutPermissionViolation(uri, location));
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public static final String CLEARTEXT_DETECTED_MSG =
|
||||
"Detected cleartext network traffic from UID ";
|
||||
|
||||
/** @hide */
|
||||
public static void onCleartextNetworkDetected(byte[] firstPacket) {
|
||||
byte[] rawAddr = null;
|
||||
@@ -2024,7 +2022,7 @@ public final class StrictMode {
|
||||
}
|
||||
|
||||
final int uid = android.os.Process.myUid();
|
||||
String msg = CLEARTEXT_DETECTED_MSG + uid;
|
||||
String msg = "Detected cleartext network traffic from UID " + uid;
|
||||
if (rawAddr != null) {
|
||||
try {
|
||||
msg += " to " + InetAddress.getByAddress(rawAddr);
|
||||
|
||||
@@ -96,6 +96,7 @@ public class SystemProperties {
|
||||
*/
|
||||
@NonNull
|
||||
@SystemApi
|
||||
@TestApi
|
||||
public static String get(@NonNull String key) {
|
||||
if (TRACK_KEY_ACCESS) onKeyAccess(key);
|
||||
return native_get(key);
|
||||
|
||||
@@ -54,6 +54,7 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
* @see #get(int)
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public static final int EFFECT_CLICK = Effect.CLICK;
|
||||
|
||||
/**
|
||||
@@ -62,6 +63,7 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
* @see #get(int)
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public static final int EFFECT_DOUBLE_CLICK = Effect.DOUBLE_CLICK;
|
||||
|
||||
/**
|
||||
@@ -69,6 +71,7 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
* @see #get(int)
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public static final int EFFECT_TICK = Effect.TICK;
|
||||
|
||||
/**
|
||||
@@ -76,6 +79,7 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
* @see #get(int)
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public static final int EFFECT_THUD = Effect.THUD;
|
||||
|
||||
/**
|
||||
@@ -83,6 +87,7 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
* @see #get(int)
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public static final int EFFECT_POP = Effect.POP;
|
||||
|
||||
/**
|
||||
@@ -90,8 +95,20 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
* @see #get(int)
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public static final int EFFECT_HEAVY_CLICK = Effect.HEAVY_CLICK;
|
||||
|
||||
/** {@hide} */
|
||||
@TestApi
|
||||
public static final int EFFECT_STRENGTH_LIGHT = EffectStrength.LIGHT;
|
||||
|
||||
/** {@hide} */
|
||||
@TestApi
|
||||
public static final int EFFECT_STRENGTH_MEDIUM = EffectStrength.MEDIUM;
|
||||
|
||||
/** {@hide} */
|
||||
@TestApi
|
||||
public static final int EFFECT_STRENGTH_STRONG = EffectStrength.STRONG;
|
||||
|
||||
/**
|
||||
* Ringtone patterns. They may correspond with the device's ringtone audio, or may just be a
|
||||
@@ -307,6 +324,7 @@ public abstract class VibrationEffect implements Parcelable {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public abstract long getDuration();
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@ package android.os;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.TestApi;
|
||||
import android.content.Context;
|
||||
import android.os.WorkSourceProto;
|
||||
import android.provider.Settings;
|
||||
@@ -83,6 +84,7 @@ public class WorkSource implements Parcelable {
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@TestApi
|
||||
public WorkSource(int uid) {
|
||||
mNum = 1;
|
||||
mUids = new int[] { uid, 0 };
|
||||
@@ -127,16 +129,19 @@ public class WorkSource implements Parcelable {
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@TestApi
|
||||
public int size() {
|
||||
return mNum;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@TestApi
|
||||
public int get(int index) {
|
||||
return mUids[index];
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@TestApi
|
||||
public String getName(int index) {
|
||||
return mNames != null ? mNames[index] : null;
|
||||
}
|
||||
@@ -328,6 +333,7 @@ public class WorkSource implements Parcelable {
|
||||
* to be aware of internal differences.
|
||||
*/
|
||||
@Deprecated
|
||||
@TestApi
|
||||
public WorkSource[] setReturningDiffs(WorkSource other) {
|
||||
synchronized (sTmpWorkSource) {
|
||||
sNewbWork = null;
|
||||
@@ -379,6 +385,7 @@ public class WorkSource implements Parcelable {
|
||||
* @deprecated meant for unit testing use only. Will be removed in a future API revision.
|
||||
*/
|
||||
@Deprecated
|
||||
@TestApi
|
||||
public WorkSource addReturningNewbs(WorkSource other) {
|
||||
synchronized (sTmpWorkSource) {
|
||||
sNewbWork = null;
|
||||
@@ -388,6 +395,7 @@ public class WorkSource implements Parcelable {
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@TestApi
|
||||
public boolean add(int uid) {
|
||||
if (mNum <= 0) {
|
||||
mNames = null;
|
||||
@@ -407,6 +415,7 @@ public class WorkSource implements Parcelable {
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@TestApi
|
||||
public boolean add(int uid, String name) {
|
||||
if (mNum <= 0) {
|
||||
insert(0, uid, name);
|
||||
|
||||
@@ -16,10 +16,8 @@
|
||||
|
||||
package android.os.health;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.annotation.TestApi;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
@@ -32,6 +30,7 @@ import java.util.Arrays;
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public class HealthKeys {
|
||||
|
||||
/**
|
||||
@@ -81,6 +80,7 @@ public class HealthKeys {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public static class Constants {
|
||||
private final String mDataType;
|
||||
private final int[][] mKeys = new int[TYPE_COUNT][];
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.os.health;
|
||||
|
||||
import android.annotation.TestApi;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.ArrayMap;
|
||||
@@ -126,6 +127,7 @@ public class HealthStats {
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public HealthStats(Parcel in) {
|
||||
int count;
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.os.health;
|
||||
|
||||
import android.annotation.TestApi;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.ArrayMap;
|
||||
@@ -35,6 +36,7 @@ import java.util.Map;
|
||||
* reuse them.
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public class HealthStatsParceler implements Parcelable {
|
||||
private HealthStatsWriter mWriter;
|
||||
private HealthStats mHealthStats;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.os.health;
|
||||
|
||||
import android.annotation.TestApi;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.util.ArrayMap;
|
||||
@@ -31,6 +32,7 @@ import java.util.Map;
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public class HealthStatsWriter {
|
||||
private final HealthKeys.Constants mConstants;
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.os.storage;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.annotation.TestApi;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
@@ -162,6 +163,7 @@ public final class StorageVolume implements Parcelable {
|
||||
* @return the mount path
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public String getPath() {
|
||||
return mPath.toString();
|
||||
}
|
||||
|
||||
@@ -15,11 +15,14 @@
|
||||
*/
|
||||
package android.os.strictmode;
|
||||
|
||||
import android.annotation.TestApi;
|
||||
|
||||
/**
|
||||
* See #{@link android.os.StrictMode.ThreadPolicy.Builder#detectExplicitGc()}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@TestApi
|
||||
public final class ExplicitGcViolation extends Violation {
|
||||
/** @hide */
|
||||
public ExplicitGcViolation() {
|
||||
|
||||
@@ -25,13 +25,9 @@ import android.content.pm.PackageManager;
|
||||
* @see PackageManager#MATCH_DIRECT_BOOT_AUTO
|
||||
*/
|
||||
public final class ImplicitDirectBootViolation extends Violation {
|
||||
/** @hide */
|
||||
public static final String MESSAGE =
|
||||
"Implicitly relying on automatic Direct Boot filtering; request explicit"
|
||||
+ " filtering with PackageManager.MATCH_DIRECT_BOOT flags";
|
||||
|
||||
/** @hide */
|
||||
public ImplicitDirectBootViolation() {
|
||||
super(MESSAGE);
|
||||
super("Implicitly relying on automatic Direct Boot filtering; request explicit"
|
||||
+ " filtering with PackageManager.MATCH_DIRECT_BOOT flags");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,13 +16,9 @@
|
||||
package android.os.strictmode;
|
||||
|
||||
public final class UntaggedSocketViolation extends Violation {
|
||||
/** @hide */
|
||||
public static final String MESSAGE =
|
||||
"Untagged socket detected; use"
|
||||
+ " TrafficStats.setThreadSocketTag() to track all network usage";
|
||||
|
||||
/** @hide */
|
||||
public UntaggedSocketViolation() {
|
||||
super(MESSAGE);
|
||||
super("Untagged socket detected; use TrafficStats.setThreadSocketTag() to "
|
||||
+ "track all network usage");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user