summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2018-10-17 11:41:22 +0100
committerPaul Duffin <paulduffin@google.com>2018-10-18 16:00:16 +0100
commit3b0456bb88b60244366609bf2921a050274e3e87 (patch)
tree9904a43eda8e5bedda120d41232ad91ec8b160d5
parent4575d7ef920b231d7790823ed154fc27e7020586 (diff)
Add @UnsupportedAppUsage to non-ojluni classes
Test: ensured that generated light grey list did not change Bug: 117818301 Merged-In: Ifcdd4c815a2d8fc438290a5b3b9db669f5035145 Change-Id: I6bd92384b4c81d425961d0f9ef4b681271e36125
-rw-r--r--dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java6
-rw-r--r--dalvik/src/main/java/dalvik/system/BlockGuard.java11
-rw-r--r--dalvik/src/main/java/dalvik/system/CloseGuard.java11
-rw-r--r--dalvik/src/main/java/dalvik/system/DexFile.java11
-rw-r--r--dalvik/src/main/java/dalvik/system/DexPathList.java22
-rw-r--r--dalvik/src/main/java/dalvik/system/SocketTagger.java4
-rw-r--r--dalvik/src/main/java/dalvik/system/VMDebug.java4
-rw-r--r--json/src/main/java/org/json/JSONArray.java3
-rw-r--r--json/src/main/java/org/json/JSONObject.java7
-rw-r--r--json/src/main/java/org/json/JSONStringer.java13
-rw-r--r--json/src/main/java/org/json/JSONTokener.java11
-rw-r--r--libart/src/main/java/dalvik/system/VMRuntime.java23
-rw-r--r--libart/src/main/java/dalvik/system/VMStack.java5
-rw-r--r--libart/src/main/java/java/lang/Daemons.java13
-rw-r--r--luni/src/main/java/android/system/Int32Ref.java3
-rw-r--r--luni/src/main/java/android/system/NetlinkSocketAddress.java2
-rw-r--r--luni/src/main/java/android/system/Os.java6
-rw-r--r--luni/src/main/java/android/system/OsConstants.java56
-rw-r--r--luni/src/main/java/android/system/PacketSocketAddress.java3
-rw-r--r--luni/src/main/java/android/system/StructTimeval.java2
-rw-r--r--luni/src/main/java/java/lang/ref/FinalizerReference.java6
-rw-r--r--luni/src/main/java/java/nio/NIOAccess.java5
-rw-r--r--luni/src/main/java/java/nio/NioUtils.java4
-rw-r--r--luni/src/main/java/libcore/icu/ICU.java2
-rw-r--r--luni/src/main/java/libcore/util/BasicLruCache.java2
-rw-r--r--luni/src/main/java/libcore/util/ZoneInfo.java2
-rw-r--r--luni/src/main/java/org/w3c/dom/ls/LSSerializerFilter.java2
-rw-r--r--luni/src/main/java/org/w3c/dom/traversal/NodeFilter.java2
-rw-r--r--luni/src/main/java/org/w3c/dom/traversal/NodeIterator.java3
-rw-r--r--luni/src/main/java/org/xml/sax/InputSource.java6
-rw-r--r--luni/src/main/java/org/xml/sax/SAXException.java3
-rw-r--r--luni/src/main/java/org/xml/sax/SAXParseException.java7
-rw-r--r--luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java3
-rw-r--r--luni/src/main/java/org/xml/sax/ext/Locator2Impl.java3
-rw-r--r--luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java5
-rw-r--r--luni/src/main/java/org/xml/sax/helpers/LocatorImpl.java5
-rw-r--r--luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java6
-rw-r--r--luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java21
-rw-r--r--luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java8
-rw-r--r--luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java6
-rw-r--r--luni/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java2
41 files changed, 319 insertions, 0 deletions
diff --git a/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
index 7da3027ce0..9839889aab 100644
--- a/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
+++ b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
@@ -16,6 +16,7 @@
package dalvik.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.io.File;
import java.net.URL;
import java.nio.ByteBuffer;
@@ -43,6 +44,7 @@ public class BaseDexClassLoader extends ClassLoader {
*/
/* @NonNull */ private static volatile Reporter reporter = null;
+ @UnsupportedAppUsage
private final DexPathList pathList;
/**
@@ -68,6 +70,7 @@ public class BaseDexClassLoader extends ClassLoader {
/**
* @hide
*/
+ @UnsupportedAppUsage
public BaseDexClassLoader(String dexPath, File optimizedDirectory,
String librarySearchPath, ClassLoader parent, boolean isTrusted) {
super(parent);
@@ -144,6 +147,7 @@ public class BaseDexClassLoader extends ClassLoader {
/**
* @hide
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public void addDexPath(String dexPath) {
addDexPath(dexPath, false /*isTrusted*/);
@@ -152,6 +156,7 @@ public class BaseDexClassLoader extends ClassLoader {
/**
* @hide
*/
+ @UnsupportedAppUsage
public void addDexPath(String dexPath, boolean isTrusted) {
pathList.addDexPath(dexPath, null /*optimizedDirectory*/, isTrusted);
}
@@ -226,6 +231,7 @@ public class BaseDexClassLoader extends ClassLoader {
/**
* @hide
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public String getLdLibraryPath() {
StringBuilder result = new StringBuilder();
diff --git a/dalvik/src/main/java/dalvik/system/BlockGuard.java b/dalvik/src/main/java/dalvik/system/BlockGuard.java
index b1b36f3157..c608407dd5 100644
--- a/dalvik/src/main/java/dalvik/system/BlockGuard.java
+++ b/dalvik/src/main/java/dalvik/system/BlockGuard.java
@@ -18,6 +18,7 @@ package dalvik.system;
import libcore.util.NonNull;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.util.Objects;
/**
@@ -57,12 +58,14 @@ public final class BlockGuard {
/**
* Called on disk reads.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
void onReadFromDisk();
/**
* Called on network operations.
*/
+ @UnsupportedAppUsage
@libcore.api.IntraCoreApi
void onNetwork();
@@ -122,14 +125,18 @@ public final class BlockGuard {
@Deprecated
public static class BlockGuardPolicyException extends RuntimeException {
// bitmask of DISALLOW_*, PENALTY_*, etc flags
+ @UnsupportedAppUsage
private final int mPolicyState;
+ @UnsupportedAppUsage
private final int mPolicyViolated;
+ @UnsupportedAppUsage
private final String mMessage; // may be null
public BlockGuardPolicyException(int policyState, int policyViolated) {
this(policyState, policyViolated, null);
}
+ @UnsupportedAppUsage
public BlockGuardPolicyException(int policyState, int policyViolated, String message) {
mPolicyState = policyState;
mPolicyViolated = policyViolated;
@@ -160,6 +167,7 @@ public final class BlockGuard {
/**
* The default, permissive per-thread policy.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final Policy LAX_POLICY = new Policy() {
@Override public String toString() { return "LAX_POLICY"; }
@@ -184,6 +192,7 @@ public final class BlockGuard {
@Override public void onPathAccess(String path) {}
};
+ @UnsupportedAppUsage
private static ThreadLocal<Policy> threadPolicy = new ThreadLocal<Policy>() {
@Override protected Policy initialValue() {
return LAX_POLICY;
@@ -198,6 +207,7 @@ public final class BlockGuard {
* @return the current thread's policy. Will return the {@link #LAX_POLICY}
* instance if nothing else is set.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
@libcore.api.IntraCoreApi
public static @NonNull Policy getThreadPolicy() {
@@ -213,6 +223,7 @@ public final class BlockGuard {
* @param policy policy to set. Use the public {@link #LAX_POLICY} if you
* want to unset the active policy.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static void setThreadPolicy(@NonNull Policy policy) {
threadPolicy.set(Objects.requireNonNull(policy));
diff --git a/dalvik/src/main/java/dalvik/system/CloseGuard.java b/dalvik/src/main/java/dalvik/system/CloseGuard.java
index 9bd13fb921..6fe94a94e3 100644
--- a/dalvik/src/main/java/dalvik/system/CloseGuard.java
+++ b/dalvik/src/main/java/dalvik/system/CloseGuard.java
@@ -16,6 +16,8 @@
package dalvik.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
+
/**
* CloseGuard is a mechanism for flagging implicit finalizer cleanup of
* resources that should have been cleaned up by explicit close
@@ -136,6 +138,7 @@ public final class CloseGuard {
* Returns a CloseGuard instance. {@code #open(String)} can be used to set
* up the instance to warn on failure to close.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
@libcore.api.IntraCoreApi
public static CloseGuard get() {
@@ -149,6 +152,7 @@ public final class CloseGuard {
* #getReporter() reporter} is informed of unclosed resources; otherwise a
* one-line warning is logged.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static void setEnabled(boolean enabled) {
CloseGuard.stackAndTrackingEnabled = enabled;
@@ -165,6 +169,7 @@ public final class CloseGuard {
* Used to replace default Reporter used to warn of CloseGuard
* violations when stack tracking is enabled. Must be non-null.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static void setReporter(Reporter rep) {
if (rep == null) {
@@ -204,6 +209,7 @@ public final class CloseGuard {
return currentTracker;
}
+ @UnsupportedAppUsage
private CloseGuard() {}
/**
@@ -214,6 +220,7 @@ public final class CloseGuard {
* @param closer non-null name of explicit termination method. Printed by warnIfOpen.
* @throws NullPointerException if closer is null.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
@libcore.api.IntraCoreApi
public void open(String closer) {
@@ -244,6 +251,7 @@ public final class CloseGuard {
* Marks this CloseGuard instance as closed to avoid warnings on
* finalization.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
@libcore.api.IntraCoreApi
public void close() {
@@ -262,6 +270,7 @@ public final class CloseGuard {
* the allocation to the current reporter. If it was not enabled, it just
* directly logs a brief message.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
@libcore.api.IntraCoreApi
public void warnIfOpen() {
@@ -296,6 +305,7 @@ public final class CloseGuard {
*/
@libcore.api.CorePlatformApi
public interface Reporter {
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
void report(String message, Throwable allocationSite);
}
@@ -304,6 +314,7 @@ public final class CloseGuard {
* Default Reporter which reports CloseGuard violations to the log.
*/
private static final class DefaultReporter implements Reporter {
+ @UnsupportedAppUsage
private DefaultReporter() {}
@Override public void report (String message, Throwable allocationSite) {
diff --git a/dalvik/src/main/java/dalvik/system/DexFile.java b/dalvik/src/main/java/dalvik/system/DexFile.java
index 78db5d0023..535257f46e 100644
--- a/dalvik/src/main/java/dalvik/system/DexFile.java
+++ b/dalvik/src/main/java/dalvik/system/DexFile.java
@@ -17,6 +17,7 @@
package dalvik.system;
import android.system.ErrnoException;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import dalvik.annotation.optimization.ReachabilitySensitive;
import java.io.File;
import java.io.FileNotFoundException;
@@ -44,10 +45,13 @@ public final class DexFile {
* If close is called, mCookie becomes null but the internal cookie is preserved if the close
* failed so that we can free resources in the finalizer.
*/
+ @UnsupportedAppUsage
@ReachabilitySensitive
private Object mCookie;
+ @UnsupportedAppUsage
private Object mInternalCookie;
+ @UnsupportedAppUsage
private final String mFileName;
/**
@@ -190,6 +194,7 @@ public final class DexFile {
* @throws IOException
* If unable to open the source or output file.
*/
+ @UnsupportedAppUsage
static DexFile loadDex(String sourcePathName, String outputPathName,
int flags, ClassLoader loader, DexPathList.Element[] elements) throws IOException {
@@ -273,6 +278,7 @@ public final class DexFile {
*
* @hide
*/
+ @UnsupportedAppUsage
public Class loadClassBinaryName(String name, ClassLoader loader, List<Throwable> suppressed) {
return defineClass(name, loader, mCookie, this, suppressed);
}
@@ -309,6 +315,7 @@ public final class DexFile {
*/
private static class DFEnum implements Enumeration<String> {
private int mIndex;
+ @UnsupportedAppUsage
private String[] mNameList;
DFEnum(DexFile df) {
@@ -349,6 +356,7 @@ public final class DexFile {
* Open a DEX file. The value returned is a magic VM cookie. On
* failure, an IOException is thrown.
*/
+ @UnsupportedAppUsage
private static Object openDexFile(String sourceName, String outputName, int flags,
ClassLoader loader, DexPathList.Element[] elements) throws IOException {
// Use absolute paths to enable the use of relative paths when testing on host.
@@ -375,6 +383,7 @@ public final class DexFile {
/*
* Returns true if the dex file is backed by a valid oat file.
*/
+ @UnsupportedAppUsage
/*package*/ boolean isBackedByOatFile() {
return isBackedByOatFile(mCookie);
}
@@ -393,6 +402,7 @@ public final class DexFile {
private static native Class defineClassNative(String name, ClassLoader loader, Object cookie,
DexFile dexFile)
throws ClassNotFoundException, NoClassDefFoundError;
+ @UnsupportedAppUsage
private static native String[] getClassNameList(Object cookie);
private static native boolean isBackedByOatFile(Object cookie);
private static native void setTrusted(Object cookie);
@@ -400,6 +410,7 @@ public final class DexFile {
* Open a DEX file. The value returned is a magic VM cookie. On
* failure, an IOException is thrown.
*/
+ @UnsupportedAppUsage
private static native Object openDexFileNative(String sourceName, String outputName, int flags,
ClassLoader loader, DexPathList.Element[] elements);
diff --git a/dalvik/src/main/java/dalvik/system/DexPathList.java b/dalvik/src/main/java/dalvik/system/DexPathList.java
index e68e365908..1bbb6d923a 100644
--- a/dalvik/src/main/java/dalvik/system/DexPathList.java
+++ b/dalvik/src/main/java/dalvik/system/DexPathList.java
@@ -18,6 +18,7 @@ package dalvik.system;
import android.system.ErrnoException;
import android.system.StructStat;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
@@ -54,6 +55,7 @@ import static android.system.OsConstants.S_ISDIR;
private static final String zipSeparator = "!/";
/** class definition context */
+ @UnsupportedAppUsage
private final ClassLoader definingContext;
/**
@@ -61,21 +63,26 @@ import static android.system.OsConstants.S_ISDIR;
* Should be called pathElements, but the Facebook app uses reflection
* to modify 'dexElements' (http://b/7726934).
*/
+ @UnsupportedAppUsage
private Element[] dexElements;
/** List of native library path elements. */
// Some applications rely on this field being an array or we'd use a final list here
+ @UnsupportedAppUsage
/* package visible for testing */ NativeLibraryElement[] nativeLibraryPathElements;
/** List of application native library directories. */
+ @UnsupportedAppUsage
private final List<File> nativeLibraryDirectories;
/** List of system native library directories. */
+ @UnsupportedAppUsage
private final List<File> systemNativeLibraryDirectories;
/**
* Exceptions thrown during creation of the dexElements list.
*/
+ @UnsupportedAppUsage
private IOException[] dexElementsSuppressedExceptions;
/**
@@ -127,6 +134,7 @@ import static android.system.OsConstants.S_ISDIR;
* should be found and written to, or {@code null} to use the default
* system directory for same
*/
+ @UnsupportedAppUsage
public DexPathList(ClassLoader definingContext, String dexPath,
String librarySearchPath, File optimizedDirectory) {
this(definingContext, dexPath, librarySearchPath, optimizedDirectory, false);
@@ -217,6 +225,7 @@ import static android.system.OsConstants.S_ISDIR;
* should be found and written to, or {@code null} to use the default
* system directory for same
*/
+ @UnsupportedAppUsage
public void addDexPath(String dexPath, File optimizedDirectory) {
addDexPath(dexPath, optimizedDirectory, false);
}
@@ -271,6 +280,7 @@ import static android.system.OsConstants.S_ISDIR;
* are empty or {@code null}, or all elements get pruned out, then
* this returns a zero-element list.
*/
+ @UnsupportedAppUsage
private static List<File> splitPaths(String searchPath, boolean directoriesOnly) {
List<File> result = new ArrayList<>();
@@ -293,6 +303,7 @@ import static android.system.OsConstants.S_ISDIR;
return result;
}
+ @UnsupportedAppUsage
private static Element[] makeInMemoryDexElements(ByteBuffer[] dexFiles,
List<IOException> suppressedExceptions) {
Element[] elements = new Element[dexFiles.length];
@@ -316,6 +327,7 @@ import static android.system.OsConstants.S_ISDIR;
* Makes an array of dex/resource path elements, one per element of
* the given array.
*/
+ @UnsupportedAppUsage
private static Element[] makeDexElements(List<File> files, File optimizedDirectory,
List<IOException> suppressedExceptions, ClassLoader loader) {
return makeDexElements(files, optimizedDirectory, suppressedExceptions, loader, false);
@@ -387,6 +399,7 @@ import static android.system.OsConstants.S_ISDIR;
* {@code optimizedDirectory} is {@code null}. An application image file may be associated with
* the {@code loader} if it is not null.
*/
+ @UnsupportedAppUsage
private static DexFile loadDexFile(File file, File optimizedDirectory, ClassLoader loader,
Element[] elements)
throws IOException {
@@ -437,6 +450,7 @@ import static android.system.OsConstants.S_ISDIR;
* TODO (dimitry): Revert after apps stops relying on the existence of this
* method (see http://b/21957414 and http://b/26317852 for details)
*/
+ @UnsupportedAppUsage
@SuppressWarnings("unused")
private static Element[] makePathElements(List<File> files, File optimizedDirectory,
List<IOException> suppressedExceptions) {
@@ -447,6 +461,7 @@ import static android.system.OsConstants.S_ISDIR;
* Makes an array of directory/zip path elements for the native library search path, one per
* element of the given array.
*/
+ @UnsupportedAppUsage
private static NativeLibraryElement[] makePathElements(List<File> files) {
NativeLibraryElement[] elements = new NativeLibraryElement[files.size()];
int elementsPos = 0;
@@ -580,6 +595,7 @@ import static android.system.OsConstants.S_ISDIR;
* Note: This method will attempt to dedupe elements.
* Note: This method replaces the value of {@link #nativeLibraryPathElements}
*/
+ @UnsupportedAppUsage
public void addNativePath(Collection<String> libPaths) {
if (libPaths.isEmpty()) {
return;
@@ -608,8 +624,10 @@ import static android.system.OsConstants.S_ISDIR;
* A file denoting a zip file (in case of a resource jar or a dex jar), or a directory
* (only when dexFile is null).
*/
+ @UnsupportedAppUsage
private final File path;
+ @UnsupportedAppUsage
private final DexFile dexFile;
private ClassPathURLStreamHandler urlHandler;
@@ -619,6 +637,7 @@ import static android.system.OsConstants.S_ISDIR;
* Element encapsulates a dex file. This may be a plain dex file (in which case dexZipPath
* should be null), or a jar (in which case dexZipPath should denote the zip file).
*/
+ @UnsupportedAppUsage
public Element(DexFile dexFile, File dexZipPath) {
this.dexFile = dexFile;
this.path = dexZipPath;
@@ -642,6 +661,7 @@ import static android.system.OsConstants.S_ISDIR;
* classes and resources, and NativeLibraryElement for the library
* search path.
*/
+ @UnsupportedAppUsage
@Deprecated
public Element(File dir, boolean isDirectory, File zip, DexFile dexFile) {
System.err.println("Warning: Using deprecated Element constructor. Do not use internal"
@@ -756,6 +776,7 @@ import static android.system.OsConstants.S_ISDIR;
/**
* A file denoting a directory or zip file.
*/
+ @UnsupportedAppUsage
private final File path;
/**
@@ -766,6 +787,7 @@ import static android.system.OsConstants.S_ISDIR;
private ClassPathURLStreamHandler urlHandler;
private boolean initialized;
+ @UnsupportedAppUsage
public NativeLibraryElement(File dir) {
this.path = dir;
this.zipDir = null;
diff --git a/dalvik/src/main/java/dalvik/system/SocketTagger.java b/dalvik/src/main/java/dalvik/system/SocketTagger.java
index 15c3d8dbe0..839215a74f 100644
--- a/dalvik/src/main/java/dalvik/system/SocketTagger.java
+++ b/dalvik/src/main/java/dalvik/system/SocketTagger.java
@@ -16,6 +16,7 @@
package dalvik.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.io.FileDescriptor;
import java.net.DatagramSocket;
import java.net.Socket;
@@ -53,6 +54,7 @@ public abstract class SocketTagger {
@libcore.api.CorePlatformApi
public abstract void untag(FileDescriptor socketDescriptor) throws SocketException;
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public final void tag(Socket socket) throws SocketException {
if (!socket.isClosed()) {
@@ -60,6 +62,7 @@ public abstract class SocketTagger {
}
}
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public final void untag(Socket socket) throws SocketException {
if (!socket.isClosed()) {
@@ -95,6 +98,7 @@ public abstract class SocketTagger {
/**
* Returns this process socket tagger.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static synchronized SocketTagger get() {
return tagger;
diff --git a/dalvik/src/main/java/dalvik/system/VMDebug.java b/dalvik/src/main/java/dalvik/system/VMDebug.java
index 36ccdc15f1..1802a72a4b 100644
--- a/dalvik/src/main/java/dalvik/system/VMDebug.java
+++ b/dalvik/src/main/java/dalvik/system/VMDebug.java
@@ -16,6 +16,7 @@
package dalvik.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import dalvik.annotation.optimization.FastNative;
import java.io.FileDescriptor;
import java.io.IOException;
@@ -139,6 +140,7 @@ public final class VMDebug {
*
* @return true if (and only if) a debugger is connected
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
@FastNative
public static native boolean isDebuggerConnected();
@@ -393,6 +395,7 @@ public final class VMDebug {
* Dumps the contents of the VM reference tables (e.g. JNI locals and
* globals) to the log file.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static native void dumpReferenceTables();
@@ -580,5 +583,6 @@ public final class VMDebug {
*
* @param klass The class whose methods should be exempted.
*/
+ @UnsupportedAppUsage
public static native void allowHiddenApiReflectionFrom(Class<?> klass);
}
diff --git a/json/src/main/java/org/json/JSONArray.java b/json/src/main/java/org/json/JSONArray.java
index 996f44909f..5e758d73bd 100644
--- a/json/src/main/java/org/json/JSONArray.java
+++ b/json/src/main/java/org/json/JSONArray.java
@@ -16,6 +16,7 @@
package org.json;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collection;
@@ -48,6 +49,7 @@ import java.util.List;
*/
public class JSONArray {
+ @UnsupportedAppUsage
private final List<Object> values;
/**
@@ -607,6 +609,7 @@ public class JSONArray {
return stringer.toString();
}
+ @UnsupportedAppUsage
void writeTo(JSONStringer stringer) throws JSONException {
stringer.array();
for (Object value : values) {
diff --git a/json/src/main/java/org/json/JSONObject.java b/json/src/main/java/org/json/JSONObject.java
index 2aae841838..b274c2f029 100644
--- a/json/src/main/java/org/json/JSONObject.java
+++ b/json/src/main/java/org/json/JSONObject.java
@@ -16,6 +16,7 @@
package org.json;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
@@ -80,6 +81,7 @@ import java.util.Set;
*/
public class JSONObject {
+ @UnsupportedAppUsage
private static final Double NEGATIVE_ZERO = -0d;
/**
@@ -108,6 +110,7 @@ public class JSONObject {
}
};
+ @UnsupportedAppUsage
private final LinkedHashMap<String, Object> nameValuePairs;
/**
@@ -328,6 +331,7 @@ public class JSONObject {
*
* @hide
*/
+ @UnsupportedAppUsage
public JSONObject append(String name, Object value) throws JSONException {
Object current = nameValuePairs.get(checkName(name));
@@ -347,6 +351,7 @@ public class JSONObject {
return this;
}
+ @UnsupportedAppUsage
String checkName(String name) throws JSONException {
if (name == null) {
throw new JSONException("Names must be non-null");
@@ -668,6 +673,7 @@ public class JSONObject {
*
* @hide.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public Set<String> keySet() {
return nameValuePairs.keySet();
@@ -718,6 +724,7 @@ public class JSONObject {
return stringer.toString();
}
+ @UnsupportedAppUsage
void writeTo(JSONStringer stringer) throws JSONException {
stringer.object();
for (Map.Entry<String, Object> entry : nameValuePairs.entrySet()) {
diff --git a/json/src/main/java/org/json/JSONStringer.java b/json/src/main/java/org/json/JSONStringer.java
index dd3b2a7d83..3d1738ce60 100644
--- a/json/src/main/java/org/json/JSONStringer.java
+++ b/json/src/main/java/org/json/JSONStringer.java
@@ -16,6 +16,7 @@
package org.json;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -61,6 +62,7 @@ import java.util.List;
public class JSONStringer {
/** The output data, containing at most one top-level array or object. */
+ @UnsupportedAppUsage
final StringBuilder out = new StringBuilder();
/**
@@ -111,18 +113,21 @@ public class JSONStringer {
* Unlike the original implementation, this stack isn't limited to 20
* levels of nesting.
*/
+ @UnsupportedAppUsage
private final List<Scope> stack = new ArrayList<Scope>();
/**
* A string containing a full set of spaces for a single level of
* indentation, or null for no pretty printing.
*/
+ @UnsupportedAppUsage
private final String indent;
public JSONStringer() {
indent = null;
}
+ @UnsupportedAppUsage
JSONStringer(int indentSpaces) {
char[] indentChars = new char[indentSpaces];
Arrays.fill(indentChars, ' ');
@@ -171,6 +176,7 @@ public class JSONStringer {
* Enters a new scope by appending any necessary whitespace and the given
* bracket.
*/
+ @UnsupportedAppUsage
JSONStringer open(Scope empty, String openBracket) throws JSONException {
if (stack.isEmpty() && out.length() > 0) {
throw new JSONException("Nesting problem: multiple top-level roots");
@@ -185,6 +191,7 @@ public class JSONStringer {
* Closes the current scope by appending any necessary whitespace and the
* given bracket.
*/
+ @UnsupportedAppUsage
JSONStringer close(Scope empty, Scope nonempty, String closeBracket) throws JSONException {
Scope context = peek();
if (context != nonempty && context != empty) {
@@ -202,6 +209,7 @@ public class JSONStringer {
/**
* Returns the value on the top of the stack.
*/
+ @UnsupportedAppUsage
private Scope peek() throws JSONException {
if (stack.isEmpty()) {
throw new JSONException("Nesting problem");
@@ -212,6 +220,7 @@ public class JSONStringer {
/**
* Replace the value on the top of the stack with the given value.
*/
+ @UnsupportedAppUsage
private void replaceTop(Scope topOfStack) {
stack.set(stack.size() - 1, topOfStack);
}
@@ -299,6 +308,7 @@ public class JSONStringer {
return this;
}
+ @UnsupportedAppUsage
private void string(String value) {
out.append("\"");
for (int i = 0, length = value.length(); i < length; i++) {
@@ -350,6 +360,7 @@ public class JSONStringer {
out.append("\"");
}
+ @UnsupportedAppUsage
private void newline() {
if (indent == null) {
return;
@@ -380,6 +391,7 @@ public class JSONStringer {
* Inserts any necessary separators and whitespace before a name. Also
* adjusts the stack to expect the key's value.
*/
+ @UnsupportedAppUsage
private void beforeKey() throws JSONException {
Scope context = peek();
if (context == Scope.NONEMPTY_OBJECT) { // first in object
@@ -396,6 +408,7 @@ public class JSONStringer {
* inline array, or inline object. Also adjusts the stack to expect either a
* closing bracket or another element.
*/
+ @UnsupportedAppUsage
private void beforeValue() throws JSONException {
if (stack.isEmpty()) {
return;
diff --git a/json/src/main/java/org/json/JSONTokener.java b/json/src/main/java/org/json/JSONTokener.java
index 8caecc8a16..55667b0ae6 100644
--- a/json/src/main/java/org/json/JSONTokener.java
+++ b/json/src/main/java/org/json/JSONTokener.java
@@ -16,6 +16,8 @@
package org.json;
+import dalvik.annotation.compat.UnsupportedAppUsage;
+
// Note: this class was written without inspecting the non-free org.json sourcecode.
/**
@@ -62,12 +64,14 @@ package org.json;
public class JSONTokener {
/** The input JSON. */
+ @UnsupportedAppUsage
private final String in;
/**
* The index of the next character to be returned by {@link #next}. When
* the input is exhausted, this equals the input's length.
*/
+ @UnsupportedAppUsage
private int pos;
/**
@@ -112,6 +116,7 @@ public class JSONTokener {
}
}
+ @UnsupportedAppUsage
private int nextCleanInternal() throws JSONException {
while (pos < in.length()) {
int c = in.charAt(pos++);
@@ -171,6 +176,7 @@ public class JSONTokener {
* is terminated by "\r\n", the '\n' must be consumed as whitespace by the
* caller.
*/
+ @UnsupportedAppUsage
private void skipToEndOfLine() {
for (; pos < in.length(); pos++) {
char c = in.charAt(pos);
@@ -234,6 +240,7 @@ public class JSONTokener {
* been read. This supports both unicode escapes "u000A" and two-character
* escapes "\n".
*/
+ @UnsupportedAppUsage
private char readEscapeCharacter() throws JSONException {
char escaped = in.charAt(pos++);
switch (escaped) {
@@ -277,6 +284,7 @@ public class JSONTokener {
* values will be returned as an Integer, Long, or Double, in that order of
* preference.
*/
+ @UnsupportedAppUsage
private Object readLiteral() throws JSONException {
String literal = nextToInternal("{}[]/\\:,=;# \t\f");
@@ -331,6 +339,7 @@ public class JSONTokener {
* Returns the string up to but not including any of the given characters or
* a newline character. This does not consume the excluded character.
*/
+ @UnsupportedAppUsage
private String nextToInternal(String excluded) {
int start = pos;
for (; pos < in.length(); pos++) {
@@ -346,6 +355,7 @@ public class JSONTokener {
* Reads a sequence of key/value pairs and the trailing closing brace '}' of
* an object. The opening brace '{' should have already been read.
*/
+ @UnsupportedAppUsage
private JSONObject readObject() throws JSONException {
JSONObject result = new JSONObject();
@@ -401,6 +411,7 @@ public class JSONTokener {
* "[]" yields an empty array, but "[,]" returns a two-element array
* equivalent to "[null,null]".
*/
+ @UnsupportedAppUsage
private JSONArray readArray() throws JSONException {
JSONArray result = new JSONArray();
diff --git a/libart/src/main/java/dalvik/system/VMRuntime.java b/libart/src/main/java/dalvik/system/VMRuntime.java
index 602d0f5a72..cd061b9e2c 100644
--- a/libart/src/main/java/dalvik/system/VMRuntime.java
+++ b/libart/src/main/java/dalvik/system/VMRuntime.java
@@ -16,6 +16,7 @@
package dalvik.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import dalvik.annotation.optimization.FastNative;
import java.lang.ref.FinalizerReference;
import java.util.HashMap;
@@ -78,6 +79,7 @@ public final class VMRuntime {
*
* @return the runtime object
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static VMRuntime getRuntime() {
return THE_ONE;
@@ -107,18 +109,21 @@ public final class VMRuntime {
/**
* Returns the name of the shared library providing the VM implementation.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public native String vmLibrary();
/**
* Returns the VM's instruction set.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public native String vmInstructionSet();
/**
* Returns whether the VM is running in 64-bit mode.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
@FastNative
public native boolean is64Bit();
@@ -154,6 +159,7 @@ public final class VMRuntime {
* @return the previous ideal heap utilization
* @throws IllegalArgumentException if newTarget is &lt;= 0.0 or &gt;= 1.0
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public float setTargetHeapUtilization(float newTarget) {
if (newTarget <= 0.0f || newTarget >= 1.0f) {
@@ -176,6 +182,7 @@ public final class VMRuntime {
* app starts to run, because it may change the VM's behavior in
* dangerous ways. Defaults to {@link #SDK_VERSION_CUR_DEVELOPMENT}.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public synchronized void setTargetSdkVersion(int targetSdkVersion) {
this.targetSdkVersion = targetSdkVersion;
@@ -197,6 +204,7 @@ public final class VMRuntime {
* This method exists for binary compatibility. It was part of a
* heap sizing API which was removed in Android 3.0 (Honeycomb).
*/
+ @UnsupportedAppUsage
@Deprecated
public long getMinimumHeapSize() {
return 0;
@@ -206,6 +214,7 @@ public final class VMRuntime {
* This method exists for binary compatibility. It was part of a
* heap sizing API which was removed in Android 3.0 (Honeycomb).
*/
+ @UnsupportedAppUsage
@Deprecated
public long setMinimumHeapSize(long size) {
return 0;
@@ -215,6 +224,7 @@ public final class VMRuntime {
* This method exists for binary compatibility. It used to
* perform a garbage collection that cleared SoftReferences.
*/
+ @UnsupportedAppUsage
@Deprecated
public void gcSoftReferences() {}
@@ -222,6 +232,7 @@ public final class VMRuntime {
* This method exists for binary compatibility. It is equivalent
* to {@link System#runFinalization}.
*/
+ @UnsupportedAppUsage
@Deprecated
public void runFinalizationSync() {
System.runFinalization();
@@ -239,6 +250,7 @@ public final class VMRuntime {
* This method exists for binary compatibility. It was part of
* the external allocation API which was removed in Android 3.0 (Honeycomb).
*/
+ @UnsupportedAppUsage
@Deprecated
public boolean trackExternalAllocation(long size) {
return true;
@@ -248,6 +260,7 @@ public final class VMRuntime {
* This method exists for binary compatibility. It was part of
* the external allocation API which was removed in Android 3.0 (Honeycomb).
*/
+ @UnsupportedAppUsage
@Deprecated
public void trackExternalFree(long size) {}
@@ -255,6 +268,7 @@ public final class VMRuntime {
* This method exists for binary compatibility. It was part of
* the external allocation API which was removed in Android 3.0 (Honeycomb).
*/
+ @UnsupportedAppUsage
@Deprecated
public long getExternalBytesAllocated() {
return 0;
@@ -306,6 +320,7 @@ public final class VMRuntime {
* This is used to implement native allocations on the Java heap, such as DirectByteBuffers
* and Bitmaps.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
@FastNative
public native Object newNonMovableArray(Class<?> componentType, int length);
@@ -323,6 +338,7 @@ public final class VMRuntime {
* Returns the address of array[0]. This differs from using JNI in that JNI might lie and
* give you the address of a copy of the array when in forcecopy mode.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
@FastNative
public native long addressOf(Object array);
@@ -331,6 +347,7 @@ public final class VMRuntime {
* Removes any growth limits, allowing the application to allocate
* up to the maximum heap size.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public native void clearGrowthLimit();
@@ -367,12 +384,14 @@ public final class VMRuntime {
* unusually high rate and a GC is performed inside of the function to prevent memory usage
* from excessively increasing.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public native void registerNativeAllocation(int bytes);
/**
* Registers a native free by reducing the number of native bytes accounted for.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public native void registerNativeFree(int bytes);
@@ -390,6 +409,7 @@ public final class VMRuntime {
* @see #Runtime.runFinalization()
* @see #wait(long,int)
*/
+ @UnsupportedAppUsage
public static void runFinalization(long timeout) {
try {
FinalizerReference.finalizeAllEnqueued(timeout);
@@ -438,6 +458,7 @@ public final class VMRuntime {
*
* This influences the compilation of the applications classes.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static String getInstructionSet(String abi) {
final String instructionSet = ABI_TO_INSTRUCTION_SET_MAP.get(abi);
@@ -455,6 +476,7 @@ public final class VMRuntime {
"mips64".equals(instructionSet);
}
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static boolean is64BitAbi(String abi) {
return is64BitInstructionSet(getInstructionSet(abi));
@@ -481,6 +503,7 @@ public final class VMRuntime {
/**
* Returns the instruction set of the current runtime.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static native String getCurrentInstructionSet();
diff --git a/libart/src/main/java/dalvik/system/VMStack.java b/libart/src/main/java/dalvik/system/VMStack.java
index 45c664834a..a76ce09f39 100644
--- a/libart/src/main/java/dalvik/system/VMStack.java
+++ b/libart/src/main/java/dalvik/system/VMStack.java
@@ -16,6 +16,7 @@
package dalvik.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import dalvik.annotation.optimization.FastNative;
/**
@@ -35,6 +36,7 @@ public final class VMStack {
* Note that that can return {@link BootClassLoader} on Android where the RI
* would have returned null.
*/
+ @UnsupportedAppUsage
@FastNative
@Deprecated
native public static ClassLoader getCallingClassLoader();
@@ -55,6 +57,7 @@ public final class VMStack {
*
* @return the requested class, or {@code null}.
*/
+ @UnsupportedAppUsage
@FastNative
native public static Class<?> getStackClass2();
@@ -73,6 +76,7 @@ public final class VMStack {
* @return an array of stack trace elements, or null if the thread
* doesn't have a stack trace (e.g. because it exited)
*/
+ @UnsupportedAppUsage
@FastNative
native public static StackTraceElement[] getThreadStackTrace(Thread t);
@@ -100,6 +104,7 @@ public final class VMStack {
* desired. Unused elements will be filled with null values.
* @return the number of elements filled
*/
+ @UnsupportedAppUsage
@FastNative
native public static int fillStackTraceElements(Thread t,
StackTraceElement[] stackTraceElements);
diff --git a/libart/src/main/java/java/lang/Daemons.java b/libart/src/main/java/java/lang/Daemons.java
index f25c78cf30..a04bee8267 100644
--- a/libart/src/main/java/java/lang/Daemons.java
+++ b/libart/src/main/java/java/lang/Daemons.java
@@ -18,6 +18,7 @@ package java.lang;
import android.system.Os;
import android.system.OsConstants;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import dalvik.system.VMRuntime;
import java.lang.ref.FinalizerReference;
import java.lang.ref.Reference;
@@ -37,8 +38,10 @@ import libcore.util.EmptyArray;
public final class Daemons {
private static final int NANOS_PER_MILLI = 1000 * 1000;
private static final int NANOS_PER_SECOND = NANOS_PER_MILLI * 1000;
+ @UnsupportedAppUsage
private static final long MAX_FINALIZE_NANOS = 10L * NANOS_PER_SECOND;
+ @UnsupportedAppUsage
public static void start() {
ReferenceQueueDaemon.INSTANCE.start();
FinalizerDaemon.INSTANCE.start();
@@ -53,6 +56,7 @@ public final class Daemons {
HeapTaskDaemon.INSTANCE.startPostZygoteFork();
}
+ @UnsupportedAppUsage
public static void stop() {
HeapTaskDaemon.INSTANCE.stop();
ReferenceQueueDaemon.INSTANCE.stop();
@@ -66,6 +70,7 @@ public final class Daemons {
* single-threaded process when it forks.
*/
private static abstract class Daemon implements Runnable {
+ @UnsupportedAppUsage
private Thread thread;
private String name;
private boolean postZygoteFork;
@@ -74,6 +79,7 @@ public final class Daemons {
this.name = name;
}
+ @UnsupportedAppUsage
public synchronized void start() {
startInternal();
}
@@ -109,6 +115,7 @@ public final class Daemons {
* Returns true while the current thread should continue to run; false
* when it should return.
*/
+ @UnsupportedAppUsage
protected synchronized boolean isRunning() {
return thread != null;
}
@@ -128,6 +135,7 @@ public final class Daemons {
* Waits for the runtime thread to stop. This interrupts the thread
* currently running the runnable and then waits for it to exit.
*/
+ @UnsupportedAppUsage
public void stop() {
Thread threadToStop;
synchronized (this) {
@@ -163,6 +171,7 @@ public final class Daemons {
* pending list to the managed reference queue.
*/
private static class ReferenceQueueDaemon extends Daemon {
+ @UnsupportedAppUsage
private static final ReferenceQueueDaemon INSTANCE = new ReferenceQueueDaemon();
ReferenceQueueDaemon() {
@@ -191,10 +200,12 @@ public final class Daemons {
}
private static class FinalizerDaemon extends Daemon {
+ @UnsupportedAppUsage
private static final FinalizerDaemon INSTANCE = new FinalizerDaemon();
private final ReferenceQueue<Object> queue = FinalizerReference.queue;
private final AtomicInteger progressCounter = new AtomicInteger(0);
// Object (not reference!) being finalized. Accesses may race!
+ @UnsupportedAppUsage
private Object finalizingObject = null;
FinalizerDaemon() {
@@ -264,6 +275,7 @@ public final class Daemons {
* on one instance.
*/
private static class FinalizerWatchdogDaemon extends Daemon {
+ @UnsupportedAppUsage
private static final FinalizerWatchdogDaemon INSTANCE = new FinalizerWatchdogDaemon();
private boolean needToWork = true; // Only accessed in synchronized methods.
@@ -439,6 +451,7 @@ public final class Daemons {
// Adds a heap trim task to the heap event processor, not called from java. Left for
// compatibility purposes due to reflection.
+ @UnsupportedAppUsage
public static void requestHeapTrim() {
VMRuntime.getRuntime().requestHeapTrim();
}
diff --git a/luni/src/main/java/android/system/Int32Ref.java b/luni/src/main/java/android/system/Int32Ref.java
index 0d8645c893..8f4a9496ef 100644
--- a/luni/src/main/java/android/system/Int32Ref.java
+++ b/luni/src/main/java/android/system/Int32Ref.java
@@ -16,12 +16,15 @@
package android.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
+
/**
* @hide
* A signed 32bit integer reference suitable for passing to lower-level system calls.
*/
@libcore.api.CorePlatformApi
public class Int32Ref {
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public int value;
diff --git a/luni/src/main/java/android/system/NetlinkSocketAddress.java b/luni/src/main/java/android/system/NetlinkSocketAddress.java
index d24a366e5f..64b0eabe7d 100644
--- a/luni/src/main/java/android/system/NetlinkSocketAddress.java
+++ b/luni/src/main/java/android/system/NetlinkSocketAddress.java
@@ -16,6 +16,7 @@
package android.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import libcore.util.Objects;
import java.net.SocketAddress;
@@ -43,6 +44,7 @@ public final class NetlinkSocketAddress extends SocketAddress {
this(nlPortId, 0);
}
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public NetlinkSocketAddress(int nlPortId, int nlGroupsMask) {
this.nlPortId = nlPortId;
diff --git a/luni/src/main/java/android/system/Os.java b/luni/src/main/java/android/system/Os.java
index 85531609fb..3434d1fa95 100644
--- a/luni/src/main/java/android/system/Os.java
+++ b/luni/src/main/java/android/system/Os.java
@@ -16,6 +16,7 @@
package android.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.io.FileDescriptor;
import java.io.InterruptedIOException;
import java.net.InetAddress;
@@ -60,6 +61,7 @@ public final class Os {
public static void bind(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketException { Libcore.os.bind(fd, address, port); }
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static void bind(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException { Libcore.os.bind(fd, address); }
@@ -105,6 +107,7 @@ public final class Os {
public static void connect(FileDescriptor fd, InetAddress address, int port) throws ErrnoException, SocketException { Libcore.os.connect(fd, address, port); }
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static void connect(FileDescriptor fd, SocketAddress address) throws ErrnoException, SocketException { Libcore.os.connect(fd, address); }
@@ -516,6 +519,7 @@ public final class Os {
* See <a href="http://man7.org/linux/man-pages/man2/sendto.2.html">sendto(2)</a>.
* @hide
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static int sendto(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount, int flags, SocketAddress address) throws ErrnoException, SocketException { return Libcore.os.sendto(fd, bytes, byteOffset, byteCount, flags, address); }
@@ -569,6 +573,7 @@ public final class Os {
public static void setsockoptByte(FileDescriptor fd, int level, int option, int value) throws ErrnoException { Libcore.os.setsockoptByte(fd, level, option, value); }
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static void setsockoptIfreq(FileDescriptor fd, int level, int option, String value) throws ErrnoException { Libcore.os.setsockoptIfreq(fd, level, option, value); }
@@ -588,6 +593,7 @@ public final class Os {
public static void setsockoptLinger(FileDescriptor fd, int level, int option, StructLinger value) throws ErrnoException { Libcore.os.setsockoptLinger(fd, level, option, value); }
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static void setsockoptTimeval(FileDescriptor fd, int level, int option, StructTimeval value) throws ErrnoException { Libcore.os.setsockoptTimeval(fd, level, option, value); }
diff --git a/luni/src/main/java/android/system/OsConstants.java b/luni/src/main/java/android/system/OsConstants.java
index e2ed0da271..32c877b6d9 100644
--- a/luni/src/main/java/android/system/OsConstants.java
+++ b/luni/src/main/java/android/system/OsConstants.java
@@ -16,10 +16,13 @@
package android.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
+
/**
* Constants and helper functions for use with {@link Os}.
*/
public final class OsConstants {
+ @UnsupportedAppUsage
private OsConstants() {
}
@@ -28,6 +31,7 @@ public final class OsConstants {
* in.
* @hide
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static int CAP_TO_INDEX(int x) { return x >>> 5; }
@@ -36,6 +40,7 @@ public final class OsConstants {
* element, the index of which can be retrieved with CAP_TO_INDEX.
* @hide
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static int CAP_TO_MASK(int x) { return 1 << (x & 31); }
@@ -112,9 +117,11 @@ public final class OsConstants {
public static final int AF_INET = placeholder();
public static final int AF_INET6 = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int AF_NETLINK = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int AF_PACKET = placeholder();
public static final int AF_UNIX = placeholder();
@@ -127,9 +134,11 @@ public final class OsConstants {
public static final int AI_PASSIVE = placeholder();
public static final int AI_V4MAPPED = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int ARPHRD_ETHER = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int ARPHRD_LOOPBACK = placeholder();
public static final int CAP_AUDIT_CONTROL = placeholder();
public static final int CAP_AUDIT_WRITE = placeholder();
@@ -231,6 +240,7 @@ public final class OsConstants {
public static final int ENOMEM = placeholder();
public static final int ENOMSG = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int ENONET = placeholder();
public static final int ENOPROTOOPT = placeholder();
@@ -258,21 +268,26 @@ public final class OsConstants {
public static final int ESRCH = placeholder();
public static final int ESTALE = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int ETH_P_ALL = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int ETH_P_ARP = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int ETH_P_IP = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int ETH_P_IPV6 = placeholder();
public static final int ETIME = placeholder();
public static final int ETIMEDOUT = placeholder();
public static final int ETXTBSY = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int EUSERS = placeholder();
// On Linux, EWOULDBLOCK == EAGAIN. Use EAGAIN instead, to reduce confusion.
@@ -300,15 +315,19 @@ public final class OsConstants {
public static final int F_UNLCK = placeholder();
public static final int F_WRLCK = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int ICMP_ECHO = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int ICMP_ECHOREPLY = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int ICMP6_ECHO_REQUEST = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int ICMP6_ECHO_REPLY = placeholder();
public static final int IFA_F_DADFAILED = placeholder();
@@ -357,19 +376,23 @@ public final class OsConstants {
public static final int IPV6_UNICAST_HOPS = placeholder();
public static final int IPV6_V6ONLY = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int IP_MULTICAST_ALL = placeholder();
public static final int IP_MULTICAST_IF = placeholder();
public static final int IP_MULTICAST_LOOP = placeholder();
public static final int IP_MULTICAST_TTL = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int IP_RECVTOS = placeholder();
public static final int IP_TOS = placeholder();
public static final int IP_TTL = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int _LINUX_CAPABILITY_VERSION_3 = placeholder();
public static final int MAP_FIXED = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int MAP_POPULATE = placeholder();
public static final int MAP_PRIVATE = placeholder();
@@ -393,9 +416,11 @@ public final class OsConstants {
public static final int MS_INVALIDATE = placeholder();
public static final int MS_SYNC = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int NETLINK_NETFILTER = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int NETLINK_ROUTE = placeholder();
/**
@@ -414,6 +439,7 @@ public final class OsConstants {
public static final int O_CLOEXEC = placeholder();
public static final int O_CREAT = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int O_DIRECT = placeholder();
public static final int O_EXCL = placeholder();
@@ -437,9 +463,11 @@ public final class OsConstants {
public static final int POLLWRBAND = placeholder();
public static final int POLLWRNORM = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int PR_CAP_AMBIENT = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int PR_CAP_AMBIENT_RAISE = placeholder();
public static final int PR_GET_DUMPABLE = placeholder();
@@ -451,6 +479,7 @@ public final class OsConstants {
public static final int PROT_WRITE = placeholder();
public static final int R_OK = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int RLIMIT_NOFILE = placeholder();
public static final int RT_SCOPE_HOST = placeholder();
@@ -459,32 +488,45 @@ public final class OsConstants {
public static final int RT_SCOPE_SITE = placeholder();
public static final int RT_SCOPE_UNIVERSE = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int RTMGRP_IPV4_IFADDR = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int RTMGRP_IPV4_MROUTE = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int RTMGRP_IPV4_ROUTE = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int RTMGRP_IPV4_RULE = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int RTMGRP_IPV6_IFADDR = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int RTMGRP_IPV6_IFINFO = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int RTMGRP_IPV6_MROUTE = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int RTMGRP_IPV6_PREFIX = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int RTMGRP_IPV6_ROUTE = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int RTMGRP_LINK = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int RTMGRP_NEIGH = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int RTMGRP_NOTIFY = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int RTMGRP_TC = placeholder();
public static final int SEEK_CUR = placeholder();
public static final int SEEK_END = placeholder();
@@ -538,6 +580,7 @@ public final class OsConstants {
public static final int SO_BROADCAST = placeholder();
public static final int SO_DEBUG = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int SO_DOMAIN = placeholder();
public static final int SO_DONTROUTE = placeholder();
public static final int SO_ERROR = placeholder();
@@ -547,6 +590,7 @@ public final class OsConstants {
public static final int SO_PASSCRED = placeholder();
public static final int SO_PEERCRED = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int SO_PROTOCOL = placeholder();
public static final int SO_RCVBUF = placeholder();
public static final int SO_RCVLOWAT = placeholder();
@@ -557,11 +601,14 @@ public final class OsConstants {
public static final int SO_SNDTIMEO = placeholder();
public static final int SO_TYPE = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int SPLICE_F_MOVE = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int SPLICE_F_NONBLOCK = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int SPLICE_F_MORE = placeholder();
public static final int STDERR_FILENO = placeholder();
@@ -602,17 +649,22 @@ public final class OsConstants {
public static final int TCP_NODELAY = placeholder();
public static final int TCP_USER_TIMEOUT = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int TIOCOUTQ = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int UDP_ENCAP = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int UDP_ENCAP_ESPINUDP_NON_IKE = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int UDP_ENCAP_ESPINUDP = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int UNIX_PATH_MAX = placeholder();
public static final int WCONTINUED = placeholder();
public static final int WEXITED = placeholder();
@@ -622,9 +674,11 @@ public final class OsConstants {
public static final int WUNTRACED = placeholder();
public static final int W_OK = placeholder();
/** @hide */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static final int XATTR_CREATE = placeholder();
/** @hide */
+ @UnsupportedAppUsage
public static final int XATTR_REPLACE = placeholder();
public static final int X_OK = placeholder();
public static final int _SC_2_CHAR_TERM = placeholder();
@@ -1004,9 +1058,11 @@ public final class OsConstants {
return null;
}
+ @UnsupportedAppUsage
private static native void initConstants();
// A hack to avoid these constants being inlined by javac...
+ @UnsupportedAppUsage
private static int placeholder() { return 0; }
// ...because we want to initialize them at runtime.
static {
diff --git a/luni/src/main/java/android/system/PacketSocketAddress.java b/luni/src/main/java/android/system/PacketSocketAddress.java
index 6622272675..d3752268af 100644
--- a/luni/src/main/java/android/system/PacketSocketAddress.java
+++ b/luni/src/main/java/android/system/PacketSocketAddress.java
@@ -16,6 +16,7 @@
package android.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import libcore.util.Objects;
import java.net.SocketAddress;
@@ -54,12 +55,14 @@ public final class PacketSocketAddress extends SocketAddress {
}
/** Constructs a new PacketSocketAddress suitable for binding to. */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public PacketSocketAddress(short sll_protocol, int sll_ifindex) {
this(sll_protocol, sll_ifindex, (short) 0, (byte) 0, null);
}
/** Constructs a new PacketSocketAddress suitable for sending to. */
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public PacketSocketAddress(int sll_ifindex, byte[] sll_addr) {
this((short) 0, sll_ifindex, (short) 0, (byte) 0, sll_addr);
diff --git a/luni/src/main/java/android/system/StructTimeval.java b/luni/src/main/java/android/system/StructTimeval.java
index 62e03904a9..e01cf91882 100644
--- a/luni/src/main/java/android/system/StructTimeval.java
+++ b/luni/src/main/java/android/system/StructTimeval.java
@@ -16,6 +16,7 @@
package android.system;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import libcore.util.Objects;
/**
@@ -42,6 +43,7 @@ public final class StructTimeval {
this.tv_usec = tv_usec;
}
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
@libcore.api.IntraCoreApi
public static StructTimeval fromMillis(long millis) {
diff --git a/luni/src/main/java/java/lang/ref/FinalizerReference.java b/luni/src/main/java/java/lang/ref/FinalizerReference.java
index d7e803e4fd..9589a9d0a6 100644
--- a/luni/src/main/java/java/lang/ref/FinalizerReference.java
+++ b/luni/src/main/java/java/lang/ref/FinalizerReference.java
@@ -16,6 +16,7 @@
package java.lang.ref;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import dalvik.annotation.optimization.FastNative;
/**
@@ -23,6 +24,7 @@ import dalvik.annotation.optimization.FastNative;
*/
public final class FinalizerReference<T> extends Reference<T> {
// This queue contains those objects eligible for finalization.
+ @UnsupportedAppUsage
public static final ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
// Guards the list (not the queue).
@@ -30,10 +32,12 @@ public final class FinalizerReference<T> extends Reference<T> {
// This list contains a FinalizerReference for every finalizable object in the heap.
// Objects in this list may or may not be eligible for finalization yet.
+ @UnsupportedAppUsage
private static FinalizerReference<?> head = null;
// The links used to construct the list.
private FinalizerReference<?> prev;
+ @UnsupportedAppUsage
private FinalizerReference<?> next;
// When the GC wants something finalized, it moves it from the 'referent' field to
@@ -52,6 +56,7 @@ public final class FinalizerReference<T> extends Reference<T> {
zombie = null;
}
+ @UnsupportedAppUsage
public static void add(Object referent) {
FinalizerReference<?> reference = new FinalizerReference<Object>(referent, queue);
synchronized (LIST_LOCK) {
@@ -64,6 +69,7 @@ public final class FinalizerReference<T> extends Reference<T> {
}
}
+ @UnsupportedAppUsage
public static void remove(FinalizerReference<?> reference) {
synchronized (LIST_LOCK) {
FinalizerReference<?> next = reference.next;
diff --git a/luni/src/main/java/java/nio/NIOAccess.java b/luni/src/main/java/java/nio/NIOAccess.java
index 4094ef8a65..7a07e3d307 100644
--- a/luni/src/main/java/java/nio/NIOAccess.java
+++ b/luni/src/main/java/java/nio/NIOAccess.java
@@ -16,6 +16,8 @@
package java.nio;
+import dalvik.annotation.compat.UnsupportedAppUsage;
+
/**
* This class is used via JNI by code in frameworks/base/.
* @hide
@@ -30,6 +32,7 @@ public final class NIOAccess {
* @hide
*/
// @VisibleForTesting : was default
+ @UnsupportedAppUsage
public static long getBasePointer(Buffer b) {
long address = b.address;
if (address == 0L) {
@@ -42,6 +45,7 @@ public final class NIOAccess {
* Returns the underlying Java array containing the data of the
* given Buffer, or null if the Buffer is not backed by a Java array.
*/
+ @UnsupportedAppUsage
static Object getBaseArray(Buffer b) {
return b.hasArray() ? b.array() : null;
}
@@ -53,6 +57,7 @@ public final class NIOAccess {
* account the Buffer's current position. This method is only
* meaningful if getBaseArray() returns non-null.
*/
+ @UnsupportedAppUsage
static int getBaseArrayOffset(Buffer b) {
return b.hasArray() ? ((b.arrayOffset() + b.position) << b._elementSizeShift) : 0;
}
diff --git a/luni/src/main/java/java/nio/NioUtils.java b/luni/src/main/java/java/nio/NioUtils.java
index cb91ae8852..678382dd8d 100644
--- a/luni/src/main/java/java/nio/NioUtils.java
+++ b/luni/src/main/java/java/nio/NioUtils.java
@@ -24,6 +24,7 @@ import java.nio.channels.FileChannel;
import java.util.Set;
import static android.system.OsConstants.*;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import sun.misc.Cleaner;
import sun.nio.ch.DirectBuffer;
import sun.nio.ch.FileChannelImpl;
@@ -36,6 +37,7 @@ public final class NioUtils {
private NioUtils() {
}
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static void freeDirectBuffer(ByteBuffer buffer) {
if (buffer == null) {
@@ -72,6 +74,7 @@ public final class NioUtils {
* Exposes the array backing a non-direct ByteBuffer, even if the ByteBuffer is read-only.
* Normally, attempting to access the array backing a read-only buffer throws.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static byte[] unsafeArray(ByteBuffer b) {
return b.array();
@@ -81,6 +84,7 @@ public final class NioUtils {
* Exposes the array offset for the array backing a non-direct ByteBuffer,
* even if the ByteBuffer is read-only.
*/
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static int unsafeArrayOffset(ByteBuffer b) {
return b.arrayOffset();
diff --git a/luni/src/main/java/libcore/icu/ICU.java b/luni/src/main/java/libcore/icu/ICU.java
index 7771bcd1a6..a2960cd9e9 100644
--- a/luni/src/main/java/libcore/icu/ICU.java
+++ b/luni/src/main/java/libcore/icu/ICU.java
@@ -16,6 +16,7 @@
package libcore.icu;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -443,6 +444,7 @@ public final class ICU {
public static native String getISO3Language(String languageTag);
+ @UnsupportedAppUsage
@libcore.api.CorePlatformApi
public static Locale addLikelySubtags(Locale locale) {
return Locale.forLanguageTag(addLikelySubtags(locale.toLanguageTag()).replace('_', '-'));
diff --git a/luni/src/main/java/libcore/util/BasicLruCache.java b/luni/src/main/java/libcore/util/BasicLruCache.java
index 8cb0b41011..6ba0bf2db0 100644
--- a/luni/src/main/java/libcore/util/BasicLruCache.java
+++ b/luni/src/main/java/libcore/util/BasicLruCache.java
@@ -16,6 +16,7 @@
package libcore.util;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -26,6 +27,7 @@ import java.util.Map;
*/
@libcore.api.CorePlatformApi
public class BasicLruCache<K, V> {
+ @UnsupportedAppUsage
private final LinkedHashMap<K, V> map;
private final int maxSize;
diff --git a/luni/src/main/java/libcore/util/ZoneInfo.java b/luni/src/main/java/libcore/util/ZoneInfo.java
index d938b68bfa..49724a0572 100644
--- a/luni/src/main/java/libcore/util/ZoneInfo.java
+++ b/luni/src/main/java/libcore/util/ZoneInfo.java
@@ -22,6 +22,7 @@
*/
package libcore.util;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Arrays;
@@ -132,6 +133,7 @@ public final class ZoneInfo extends TimeZone {
*
* @see #mTypes
*/
+ @UnsupportedAppUsage
private final long[] mTransitions;
/**
diff --git a/luni/src/main/java/org/w3c/dom/ls/LSSerializerFilter.java b/luni/src/main/java/org/w3c/dom/ls/LSSerializerFilter.java
index 0a0381074a..554807c619 100644
--- a/luni/src/main/java/org/w3c/dom/ls/LSSerializerFilter.java
+++ b/luni/src/main/java/org/w3c/dom/ls/LSSerializerFilter.java
@@ -12,6 +12,7 @@
package org.w3c.dom.ls;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import org.w3c.dom.traversal.NodeFilter;
/**
@@ -60,6 +61,7 @@ public interface LSSerializerFilter extends NodeFilter {
* <br> The constants used here are defined in [<a href='http://www.w3.org/TR/2000/REC-DOM-Level-2-Traversal-Range-20001113'>DOM Level 2 Traversal and Range</a>]
* .
*/
+ @UnsupportedAppUsage
public int getWhatToShow();
}
diff --git a/luni/src/main/java/org/w3c/dom/traversal/NodeFilter.java b/luni/src/main/java/org/w3c/dom/traversal/NodeFilter.java
index 12f63775cb..24f75993fb 100644
--- a/luni/src/main/java/org/w3c/dom/traversal/NodeFilter.java
+++ b/luni/src/main/java/org/w3c/dom/traversal/NodeFilter.java
@@ -12,6 +12,7 @@
package org.w3c.dom.traversal;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import org.w3c.dom.Node;
/**
@@ -141,6 +142,7 @@ public interface NodeFilter {
* @return A constant to determine whether the node is accepted,
* rejected, or skipped, as defined above.
*/
+ @UnsupportedAppUsage
public short acceptNode(Node n);
}
diff --git a/luni/src/main/java/org/w3c/dom/traversal/NodeIterator.java b/luni/src/main/java/org/w3c/dom/traversal/NodeIterator.java
index f1fd5d01d0..686beb7726 100644
--- a/luni/src/main/java/org/w3c/dom/traversal/NodeIterator.java
+++ b/luni/src/main/java/org/w3c/dom/traversal/NodeIterator.java
@@ -12,6 +12,7 @@
package org.w3c.dom.traversal;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
@@ -83,6 +84,7 @@ public interface NodeIterator {
* INVALID_STATE_ERR: Raised if this method is called after the
* <code>detach</code> method was invoked.
*/
+ @UnsupportedAppUsage
public Node nextNode()
throws DOMException;
@@ -106,6 +108,7 @@ public interface NodeIterator {
* or <code>previousNode</code> will raise the exception
* INVALID_STATE_ERR.
*/
+ @UnsupportedAppUsage
public void detach();
}
diff --git a/luni/src/main/java/org/xml/sax/InputSource.java b/luni/src/main/java/org/xml/sax/InputSource.java
index b9b148e6a9..3750cfed29 100644
--- a/luni/src/main/java/org/xml/sax/InputSource.java
+++ b/luni/src/main/java/org/xml/sax/InputSource.java
@@ -5,6 +5,7 @@
package org.xml.sax;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.io.InputStream;
import java.io.Reader;
@@ -326,10 +327,15 @@ public class InputSource {
// Internal state.
////////////////////////////////////////////////////////////////////
+ @UnsupportedAppUsage
private String publicId;
+ @UnsupportedAppUsage
private String systemId;
+ @UnsupportedAppUsage
private InputStream byteStream;
+ @UnsupportedAppUsage
private String encoding;
+ @UnsupportedAppUsage
private Reader characterStream;
}
diff --git a/luni/src/main/java/org/xml/sax/SAXException.java b/luni/src/main/java/org/xml/sax/SAXException.java
index b8d0a9b78a..ea69d3f2eb 100644
--- a/luni/src/main/java/org/xml/sax/SAXException.java
+++ b/luni/src/main/java/org/xml/sax/SAXException.java
@@ -5,6 +5,8 @@
package org.xml.sax;
+import dalvik.annotation.compat.UnsupportedAppUsage;
+
/**
* Encapsulate a general SAX error or warning.
*
@@ -144,6 +146,7 @@ public class SAXException extends Exception {
/**
* @serial The embedded exception if tunnelling, or null.
*/
+ @UnsupportedAppUsage
private Exception exception;
}
diff --git a/luni/src/main/java/org/xml/sax/SAXParseException.java b/luni/src/main/java/org/xml/sax/SAXParseException.java
index 424f77be93..72b16cf904 100644
--- a/luni/src/main/java/org/xml/sax/SAXParseException.java
+++ b/luni/src/main/java/org/xml/sax/SAXParseException.java
@@ -5,6 +5,8 @@
package org.xml.sax;
+import dalvik.annotation.compat.UnsupportedAppUsage;
+
/**
* Encapsulate an XML parse error or warning.
*
@@ -163,6 +165,7 @@ public class SAXParseException extends SAXException {
* @param lineNumber The line number of the error, or -1.
* @param columnNumber The column number of the error, or -1.
*/
+ @UnsupportedAppUsage
private void init (String publicId, String systemId,
int lineNumber, int columnNumber)
{
@@ -241,6 +244,7 @@ public class SAXParseException extends SAXException {
* @serial The public identifier, or null.
* @see #getPublicId
*/
+ @UnsupportedAppUsage
private String publicId;
@@ -248,6 +252,7 @@ public class SAXParseException extends SAXException {
* @serial The system identifier, or null.
* @see #getSystemId
*/
+ @UnsupportedAppUsage
private String systemId;
@@ -255,6 +260,7 @@ public class SAXParseException extends SAXException {
* @serial The line number, or -1.
* @see #getLineNumber
*/
+ @UnsupportedAppUsage
private int lineNumber;
@@ -262,6 +268,7 @@ public class SAXParseException extends SAXException {
* @serial The column number, or -1.
* @see #getColumnNumber
*/
+ @UnsupportedAppUsage
private int columnNumber;
}
diff --git a/luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java b/luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java
index 52fa1e5513..b3702a4844 100644
--- a/luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java
+++ b/luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java
@@ -5,6 +5,7 @@
package org.xml.sax.ext;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import libcore.util.EmptyArray;
import org.xml.sax.Attributes;
import org.xml.sax.helpers.AttributesImpl;
@@ -37,7 +38,9 @@ import org.xml.sax.helpers.AttributesImpl;
*/
public class Attributes2Impl extends AttributesImpl implements Attributes2
{
+ @UnsupportedAppUsage
private boolean[] declared;
+ @UnsupportedAppUsage
private boolean[] specified;
diff --git a/luni/src/main/java/org/xml/sax/ext/Locator2Impl.java b/luni/src/main/java/org/xml/sax/ext/Locator2Impl.java
index 9274d58ca0..bb9582f02a 100644
--- a/luni/src/main/java/org/xml/sax/ext/Locator2Impl.java
+++ b/luni/src/main/java/org/xml/sax/ext/Locator2Impl.java
@@ -5,6 +5,7 @@
package org.xml.sax.ext;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import org.xml.sax.Locator;
import org.xml.sax.helpers.LocatorImpl;
@@ -26,7 +27,9 @@ import org.xml.sax.helpers.LocatorImpl;
*/
public class Locator2Impl extends LocatorImpl implements Locator2
{
+ @UnsupportedAppUsage
private String encoding;
+ @UnsupportedAppUsage
private String version;
diff --git a/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java b/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java
index f6d5f85839..9193075bb9 100644
--- a/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java
+++ b/luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java
@@ -6,6 +6,7 @@
package org.xml.sax.helpers;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import org.xml.sax.Attributes;
@@ -563,6 +564,7 @@ public class AttributesImpl implements Attributes
* @param n The minimum number of attributes that the array must
* be able to hold.
*/
+ @UnsupportedAppUsage
private void ensureCapacity (int n) {
if (n <= 0) {
return;
@@ -595,6 +597,7 @@ public class AttributesImpl implements Attributes
* @param index The index to report.
* @exception java.lang.ArrayIndexOutOfBoundsException Always.
*/
+ @UnsupportedAppUsage
private void badIndex (int index)
throws ArrayIndexOutOfBoundsException
{
@@ -609,7 +612,9 @@ public class AttributesImpl implements Attributes
// Internal state.
////////////////////////////////////////////////////////////////////
+ @UnsupportedAppUsage
int length;
+ @UnsupportedAppUsage
String data [];
}
diff --git a/luni/src/main/java/org/xml/sax/helpers/LocatorImpl.java b/luni/src/main/java/org/xml/sax/helpers/LocatorImpl.java
index e7ec76aa12..944c41aa87 100644
--- a/luni/src/main/java/org/xml/sax/helpers/LocatorImpl.java
+++ b/luni/src/main/java/org/xml/sax/helpers/LocatorImpl.java
@@ -5,6 +5,7 @@
package org.xml.sax.helpers;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import org.xml.sax.Locator;
@@ -204,9 +205,13 @@ public class LocatorImpl implements Locator
// Internal state.
////////////////////////////////////////////////////////////////////
+ @UnsupportedAppUsage
private String publicId;
+ @UnsupportedAppUsage
private String systemId;
+ @UnsupportedAppUsage
private int lineNumber;
+ @UnsupportedAppUsage
private int columnNumber;
}
diff --git a/luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java b/luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java
index 5f96797aa0..b68080a32e 100644
--- a/luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java
+++ b/luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java
@@ -6,6 +6,7 @@
package org.xml.sax.helpers;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EmptyStackException;
@@ -113,6 +114,7 @@ public class NamespaceSupport
/**
* An empty enumeration.
*/
+ @UnsupportedAppUsage
private static final Enumeration EMPTY_ENUMERATION = Collections.enumeration(Collections.emptyList());
@@ -517,9 +519,13 @@ public class NamespaceSupport
// Internal state.
////////////////////////////////////////////////////////////////////
+ @UnsupportedAppUsage
private Context contexts[];
+ @UnsupportedAppUsage
private Context currentContext;
+ @UnsupportedAppUsage
private int contextPos;
+ @UnsupportedAppUsage
private boolean namespaceDeclUris;
diff --git a/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java b/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
index 9d1c6830eb..56a79f916c 100644
--- a/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
+++ b/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
@@ -6,6 +6,7 @@
package org.xml.sax.helpers;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
@@ -129,6 +130,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler
* @exception java.lang.NullPointerException If the parser parameter
* is null.
*/
+ @UnsupportedAppUsage
private void setup (Parser parser)
{
if (parser == null) {
@@ -697,6 +699,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler
/**
* Initialize the parser before each run.
*/
+ @UnsupportedAppUsage
private void setupParser ()
{
// catch an illegal "nonsense" state.
@@ -734,6 +737,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler
* @exception SAXException The client may throw
* an exception if there is an error callback.
*/
+ @UnsupportedAppUsage
private String [] processName (String qName, boolean isAttribute,
boolean useException)
throws SAXException
@@ -759,6 +763,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler
* @exception SAXException The client may throw
* an exception.
*/
+ @UnsupportedAppUsage
void reportError (String message)
throws SAXException
{
@@ -772,6 +777,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler
*
* @param message The error message.
*/
+ @UnsupportedAppUsage
private SAXParseException makeException (String message)
{
if (locator != null) {
@@ -793,6 +799,7 @@ public class ParserAdapter implements XMLReader, DocumentHandler
* @exception SAXNotSupportedException If a
* document is currently being parsed.
*/
+ @UnsupportedAppUsage
private void checkNotParsing (String type, String name)
throws SAXNotSupportedException
{
@@ -810,29 +817,43 @@ public class ParserAdapter implements XMLReader, DocumentHandler
// Internal state.
////////////////////////////////////////////////////////////////////
+ @UnsupportedAppUsage
private NamespaceSupport nsSupport;
+ @UnsupportedAppUsage
private AttributeListAdapter attAdapter;
+ @UnsupportedAppUsage
private boolean parsing = false;
+ @UnsupportedAppUsage
private String nameParts[] = new String[3];
+ @UnsupportedAppUsage
private Parser parser = null;
+ @UnsupportedAppUsage
private AttributesImpl atts = null;
// Features
+ @UnsupportedAppUsage
private boolean namespaces = true;
+ @UnsupportedAppUsage
private boolean prefixes = false;
+ @UnsupportedAppUsage
private boolean uris = false;
// Properties
// Handlers
+ @UnsupportedAppUsage
Locator locator;
+ @UnsupportedAppUsage
EntityResolver entityResolver = null;
+ @UnsupportedAppUsage
DTDHandler dtdHandler = null;
+ @UnsupportedAppUsage
ContentHandler contentHandler = null;
+ @UnsupportedAppUsage
ErrorHandler errorHandler = null;
diff --git a/luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java b/luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java
index 4b4dd71c7d..95ae356354 100644
--- a/luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java
+++ b/luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java
@@ -6,6 +6,7 @@
package org.xml.sax.helpers;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.io.IOException;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
@@ -683,6 +684,7 @@ public class XMLFilterImpl
* non-null, and re-register the filter for all of the
* events.</p>
*/
+ @UnsupportedAppUsage
private void setupParse ()
{
if (parent == null) {
@@ -700,11 +702,17 @@ public class XMLFilterImpl
// Internal state.
////////////////////////////////////////////////////////////////////
+ @UnsupportedAppUsage
private XMLReader parent = null;
+ @UnsupportedAppUsage
private Locator locator = null;
+ @UnsupportedAppUsage
private EntityResolver entityResolver = null;
+ @UnsupportedAppUsage
private DTDHandler dtdHandler = null;
+ @UnsupportedAppUsage
private ContentHandler contentHandler = null;
+ @UnsupportedAppUsage
private ErrorHandler errorHandler = null;
}
diff --git a/luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java b/luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java
index c683229f91..0ef4d6fca1 100644
--- a/luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java
+++ b/luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java
@@ -6,6 +6,7 @@
package org.xml.sax.helpers;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.io.IOException;
import java.util.Locale;
import org.xml.sax.AttributeList;
@@ -95,6 +96,7 @@ public class XMLReaderAdapter implements Parser, ContentHandler
*
* @param xmlReader The embedded XMLReader.
*/
+ @UnsupportedAppUsage
private void setup (XMLReader xmlReader)
{
if (xmlReader == null) {
@@ -227,6 +229,7 @@ public class XMLReaderAdapter implements Parser, ContentHandler
/**
* Set up the XML reader.
*/
+ @UnsupportedAppUsage
private void setupXMLReader ()
throws SAXException
{
@@ -425,8 +428,11 @@ public class XMLReaderAdapter implements Parser, ContentHandler
// Internal state.
////////////////////////////////////////////////////////////////////
+ @UnsupportedAppUsage
XMLReader xmlReader;
+ @UnsupportedAppUsage
DocumentHandler documentHandler;
+ @UnsupportedAppUsage
AttributesAdapter qAtts;
diff --git a/luni/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java b/luni/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java
index 39dd367fb9..b95728f944 100644
--- a/luni/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java
+++ b/luni/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java
@@ -7,6 +7,7 @@
package org.xml.sax.helpers;
+import dalvik.annotation.compat.UnsupportedAppUsage;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
@@ -185,6 +186,7 @@ final public class XMLReaderFactory
return loadClass (NewInstance.getClassLoader (), className);
}
+ @UnsupportedAppUsage
private static XMLReader loadClass (ClassLoader loader, String className)
throws SAXException
{