Snap for 7478028 from 16f96a2cb9f5d2764be7d8fad4eac6ae7167cd92 to mainline-documentsui-release

Change-Id: I112f8ffffe1157adff079e3a442562f74bae13b9
diff --git a/Android.bp b/Android.bp
index 228bcaf..ab53382 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library_headers {
     name: "rs-headers",
     export_include_dirs: ["."],
@@ -10,6 +14,7 @@
         "-Werror",
         "-Wall",
         "-Wextra",
+        "-Wno-deprecated-declarations",
         "-Wno-unused-parameter",
         "-Wno-unused-variable",
     ],
@@ -301,6 +306,9 @@
     name: "libRS",
     defaults: ["rs_defaults"],
     native_bridge_supported: true,
+    llndk: {
+        symbol_file: "libRS.map",
+    },
     srcs: [
         "rsApiStubs.cpp",
         "rsHidlAdaptation.cpp",
@@ -336,11 +344,6 @@
     version_script: "libRS.map",
 }
 
-llndk_library {
-    name: "libRS",
-    symbol_file: "libRS.map",
-}
-
 cc_library_shared {
     name: "libRSCacheDir",
     defaults: ["rs_defaults"],
diff --git a/cpp/Android.bp b/cpp/Android.bp
index 1d08b02..433c79f 100644
--- a/cpp/Android.bp
+++ b/cpp/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library_static {
     name: "libRSDispatch",
     native_bridge_supported: true,
@@ -53,14 +57,21 @@
         "-Werror",
         "-Wall",
         "-Wextra",
+        "-Wno-deprecated-declarations",
         "-Wno-unused-parameter",
         "-Wno-unused-variable",
     ],
 
     // We need to export not just rs/cpp but also rs.  This is because
     // RenderScript.h includes rsCppStructs.h, which includes rs/rsDefines.h.
-    header_libs: ["rs-headers"],
-    export_header_lib_headers: ["rs-headers"],
+    header_libs: [
+        "jni_headers",
+        "rs-headers"
+    ],
+    export_header_lib_headers: [
+        "jni_headers",
+        "rs-headers"
+    ],
     export_include_dirs: ["."],
 
     shared_libs: [
diff --git a/cpu_ref/Android.bp b/cpu_ref/Android.bp
index 84b90af..6b4d855 100644
--- a/cpu_ref/Android.bp
+++ b/cpu_ref/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library_shared {
     name: "libRSCpuRef",
     defaults: ["libbcc-targets"],
diff --git a/cpu_ref/rsCpuExecutable.cpp b/cpu_ref/rsCpuExecutable.cpp
index 82e3738..cc7f7a5 100644
--- a/cpu_ref/rsCpuExecutable.cpp
+++ b/cpu_ref/rsCpuExecutable.cpp
@@ -1,6 +1,7 @@
 #include "rsCpuExecutable.h"
 #include "rsCppUtils.h"
 
+#include <fcntl.h>
 #include <fstream>
 #include <set>
 #include <memory>
diff --git a/cpu_ref/rsCpuScript.cpp b/cpu_ref/rsCpuScript.cpp
index e41a6b8..a495246 100644
--- a/cpu_ref/rsCpuScript.cpp
+++ b/cpu_ref/rsCpuScript.cpp
@@ -357,7 +357,7 @@
         }
     }
     else {
-        // add a dummy/constant as a checksum if verification is disabled
+        // add a placeholder/constant as a checksum if verification is disabled
         mBuildChecksum = 0xabadcafe;
     }
 
diff --git a/driver/rsdGL.cpp b/driver/rsdGL.cpp
index 6111e0d..ca16148 100644
--- a/driver/rsdGL.cpp
+++ b/driver/rsdGL.cpp
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <system/window.h>
+#include <vndk/window.h>
 
 #include <sys/types.h>
 #include <sys/resource.h>
@@ -440,12 +440,12 @@
     }
 
     if (dc->gl.currentWndSurface != nullptr) {
-        dc->gl.currentWndSurface->decStrong(nullptr);
+        ANativeWindow_release(dc->gl.currentWndSurface);
     }
 
     dc->gl.currentWndSurface = (ANativeWindow *)sur;
     if (dc->gl.currentWndSurface != nullptr) {
-        dc->gl.currentWndSurface->incStrong(nullptr);
+        ANativeWindow_acquire(dc->gl.currentWndSurface);
 
         rsc->setWatchdogGL("eglCreateWindowSurface", __LINE__, __FILE__);
         dc->gl.egl.surface = eglCreateWindowSurface(dc->gl.egl.display, dc->gl.egl.config,
@@ -468,7 +468,7 @@
     RsdHal *dc = (RsdHal *)rsc->mHal.drv;
 
     if (dc->gl.wndSurface != nullptr) {
-        dc->gl.wndSurface->decStrong(nullptr);
+        ANativeWindow_release(dc->gl.wndSurface);
         dc->gl.wndSurface = nullptr;
     }
     if(w && h) {
@@ -476,7 +476,7 @@
         // pbuffer to avoid this pitfall.
         dc->gl.wndSurface = (ANativeWindow *)sur;
         if (dc->gl.wndSurface != nullptr) {
-            dc->gl.wndSurface->incStrong(nullptr);
+            ANativeWindow_acquire(dc->gl.wndSurface);
         }
     }
 
diff --git a/driver/runtime/Android.mk b/driver/runtime/Android.mk
index 157841b..a35ceab 100755
--- a/driver/runtime/Android.mk
+++ b/driver/runtime/Android.mk
@@ -80,6 +80,9 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libclcore.bc
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 LOCAL_CFLAGS += $(clcore_cflags)
 LOCAL_SRC_FILES := $(clcore_base_files)
 LOCAL_SRC_FILES_32 := $(clcore_files_32)
@@ -99,6 +102,9 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libclcore_debug.bc
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 rs_debug_runtime := 1
 LOCAL_CFLAGS += $(clcore_cflags)
 LOCAL_SRC_FILES := $(clcore_base_files)
@@ -121,6 +127,9 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libclcore_x86.bc
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 LOCAL_CFLAGS += $(clcore_cflags) -DARCH_X86_HAVE_SSSE3
 LOCAL_SRC_FILES := $(clcore_x86_files)
 LOCAL_SRC_FILES_32 := $(clcore_base_files_32)
@@ -136,6 +145,9 @@
 LOCAL_32_BIT_ONLY := true
 
 LOCAL_MODULE := libclcore_neon.bc
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 LOCAL_CFLAGS += $(clcore_cflags)
 LOCAL_SRC_FILES := $(clcore_neon_files)
 LOCAL_CFLAGS += -DARCH_ARM_HAVE_NEON
@@ -146,6 +158,9 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libclcore_g.bc
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 rs_g_runtime := 1
 LOCAL_CFLAGS += $(clcore_cflags)
 LOCAL_CFLAGS += -g -O0
@@ -163,6 +178,9 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libclcore_debug_g.bc
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 rs_debug_runtime := 1
 rs_g_runtime := 1
 LOCAL_CFLAGS += $(clcore_cflags)
@@ -195,6 +213,9 @@
 BCC_RS_TRIPLE := renderscript32-linux-androideabi
 RS_TRIPLE_CFLAGS :=
 LOCAL_MODULE := librsrt_arm.bc
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 LOCAL_IS_HOST_MODULE := true
 LOCAL_CFLAGS += $(clcore_cflags)
 LOCAL_SRC_FILES := $(clcore_files) $(clcore_files_32)
@@ -209,6 +230,9 @@
 BCC_RS_TRIPLE := renderscript32-linux-androideabi
 RS_TRIPLE_CFLAGS :=
 LOCAL_MODULE := librsrt_mips.bc
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 LOCAL_IS_HOST_MODULE := true
 LOCAL_CFLAGS += $(clcore_cflags)
 LOCAL_SRC_FILES := $(clcore_files) $(clcore_files_32)
@@ -223,6 +247,9 @@
 BCC_RS_TRIPLE := renderscript32-linux-androideabi
 RS_TRIPLE_CFLAGS := -D__i386__
 LOCAL_MODULE := librsrt_x86.bc
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 LOCAL_IS_HOST_MODULE := true
 LOCAL_CFLAGS += $(clcore_cflags) -DARCH_X86_HAVE_SSSE3
 LOCAL_SRC_FILES := $(clcore_x86_files) $(clcore_base_files_32)
@@ -233,6 +260,9 @@
 BCC_RS_TRIPLE := renderscript64-linux-android
 RS_TRIPLE_CFLAGS :=
 LOCAL_MODULE := librsrt_arm64.bc
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 LOCAL_IS_HOST_MODULE := true
 LOCAL_CFLAGS += $(clcore_cflags)
 LOCAL_SRC_FILES := $(clcore_files) $(clcore_files_64)
@@ -244,6 +274,9 @@
 BCC_RS_TRIPLE := renderscript64-linux-android
 RS_TRIPLE_CFLAGS := -D__x86_64__
 LOCAL_MODULE := librsrt_x86_64.bc
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
+LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
 LOCAL_IS_HOST_MODULE := true
 LOCAL_CFLAGS += $(clcore_cflags) -DARCH_X86_HAVE_SSSE3
 LOCAL_SRC_FILES := $(clcore_x86_files) $(clcore_base_files_64)
diff --git a/rs.h b/rs.h
index edf98ef..b748849 100644
--- a/rs.h
+++ b/rs.h
@@ -23,41 +23,41 @@
 #include "rsInternalDefines.h"
 
 extern "C" {
-    // Legacy graphics functions
-    RsObjectBase rsaFileA3DGetEntryByIndex(RsContext, uint32_t idx, RsFile);
-    RsFile rsaFileA3DCreateFromMemory(RsContext, const void *data,
-                                      uint32_t len);
-    RsFile rsaFileA3DCreateFromAsset(RsContext, void *asset);
-    RsFile rsaFileA3DCreateFromFile(RsContext, const char *path);
-    void rsaFileA3DGetNumIndexEntries(RsContext, int32_t *numEntries, RsFile);
-    void rsaFileA3DGetIndexEntries(RsContext, RsFileIndexEntry *fileEntries,
-                                   uint32_t numEntries, RsFile);
-    // Mesh update functions
-    void rsaMeshGetVertexBufferCount(RsContext, RsMesh, int32_t *vtxCount);
-    void rsaMeshGetIndexCount(RsContext, RsMesh, int32_t *idxCount);
-    void rsaMeshGetVertices(RsContext, RsMesh, RsAllocation *vtxData,
-                            uint32_t vtxDataCount);
-    void rsaMeshGetIndices(RsContext, RsMesh, RsAllocation *va,
-                           uint32_t *primType, uint32_t idxDataCount);
-    RsContext rsContextCreateGL(RsDevice dev, uint32_t version,
-                                uint32_t sdkVersion, RsSurfaceConfig sc,
-                                uint32_t dpi);
+// Legacy graphics functions
+RsObjectBase rsaFileA3DGetEntryByIndex(RsContext, uint32_t idx, RsFile) __DEPRECATED_IN(31);
+RsFile rsaFileA3DCreateFromMemory(RsContext, const void* data, uint32_t len) __DEPRECATED_IN(31);
+RsFile rsaFileA3DCreateFromAsset(RsContext, void* asset) __DEPRECATED_IN(31);
+RsFile rsaFileA3DCreateFromFile(RsContext, const char* path) __DEPRECATED_IN(31);
+void rsaFileA3DGetNumIndexEntries(RsContext, int32_t* numEntries, RsFile) __DEPRECATED_IN(31);
+void rsaFileA3DGetIndexEntries(RsContext, RsFileIndexEntry* fileEntries, uint32_t numEntries,
+                               RsFile) __DEPRECATED_IN(31);
+// Mesh update functions
+void rsaMeshGetVertexBufferCount(RsContext, RsMesh, int32_t* vtxCount) __DEPRECATED_IN(31);
+void rsaMeshGetIndexCount(RsContext, RsMesh, int32_t* idxCount) __DEPRECATED_IN(31);
+void rsaMeshGetVertices(RsContext, RsMesh, RsAllocation* vtxData, uint32_t vtxDataCount)
+        __DEPRECATED_IN(31);
+void rsaMeshGetIndices(RsContext, RsMesh, RsAllocation* va, uint32_t* primType,
+                       uint32_t idxDataCount) __DEPRECATED_IN(31);
+RsContext rsContextCreateGL(RsDevice dev, uint32_t version, uint32_t sdkVersion, RsSurfaceConfig sc,
+                            uint32_t dpi) __DEPRECATED_IN(31);
 
-    void rsaGetName(RsContext, void * obj, const char **name);
-    // Allocation update
-    const void* rsaAllocationGetType(RsContext con, RsAllocation va);
-    // Type update
-    void rsaTypeGetNativeData(RsContext, RsType, uintptr_t *typeData, uint32_t typeDataSize);
-    // Element update
-    void rsaElementGetNativeData(RsContext, RsElement, uintptr_t *elemData, uint32_t elemDataSize);
-    void rsaElementGetSubElements(RsContext, RsElement, uintptr_t *ids, const char **names,
-                                  uint32_t *arraySizes, uint32_t dataSize);
+void rsaGetName(RsContext, void* obj, const char** name) __DEPRECATED_IN(31);
+// Allocation update
+const void* rsaAllocationGetType(RsContext con, RsAllocation va) __DEPRECATED_IN(31);
+// Type update
+void rsaTypeGetNativeData(RsContext, RsType, uintptr_t* typeData, uint32_t typeDataSize)
+        __DEPRECATED_IN(31);
+// Element update
+void rsaElementGetNativeData(RsContext, RsElement, uintptr_t* elemData, uint32_t elemDataSize)
+        __DEPRECATED_IN(31);
+void rsaElementGetSubElements(RsContext, RsElement, uintptr_t* ids, const char** names,
+                              uint32_t* arraySizes, uint32_t dataSize) __DEPRECATED_IN(31);
 
-    RsDevice rsDeviceCreate();
-    void rsDeviceDestroy(RsDevice dev);
-    void rsDeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value);
-    RsContext rsContextCreate(RsDevice dev, uint32_t version, uint32_t sdkVersion,
-                              RsContextType ct, uint32_t flags);
+RsDevice rsDeviceCreate() __DEPRECATED_IN(31);
+void rsDeviceDestroy(RsDevice dev) __DEPRECATED_IN(31);
+void rsDeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value) __DEPRECATED_IN(31);
+RsContext rsContextCreate(RsDevice dev, uint32_t version, uint32_t sdkVersion, RsContextType ct,
+                          uint32_t flags) __DEPRECATED_IN(31);
 }
 #include "rsgApiFuncDecl.h"
 
diff --git a/rsApiStubs.h b/rsApiStubs.h
index 6dd1b3f..c5a36a7 100644
--- a/rsApiStubs.h
+++ b/rsApiStubs.h
@@ -20,140 +20,293 @@
 #include "rsInternalDefines.h"
 
 // Device
-extern "C" RsDevice rsDeviceCreate();
-extern "C" void rsDeviceDestroy(RsDevice dev);
-extern "C" void rsDeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value);
+extern "C" RsDevice rsDeviceCreate() __DEPRECATED_IN(31);
+extern "C" void rsDeviceDestroy(RsDevice dev) __DEPRECATED_IN(31);
+extern "C" void rsDeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value) __DEPRECATED_IN(31);
 
 // Context
-extern "C" RsContext rsContextCreate(RsDevice vdev, uint32_t version, uint32_t sdkVersion, RsContextType ct, uint32_t flags);
-extern "C" void rsContextDestroy (RsContext rsc);
-extern "C" void rsContextFinish (RsContext rsc);
-extern "C" void rsContextDump (RsContext rsc, int32_t bits);
-extern "C" void rsContextSetPriority (RsContext rsc, int32_t priority);
-extern "C" void rsContextDestroyWorker (RsContext rsc);
-extern "C" RsMessageToClientType rsContextGetMessage (RsContext rsc, void * data, size_t data_length, size_t * receiveLen, size_t receiveLen_length, uint32_t * usrID, size_t usrID_length);
-extern "C" RsMessageToClientType rsContextPeekMessage (RsContext rsc, size_t * receiveLen, size_t receiveLen_length, uint32_t * usrID, size_t usrID_length);
-extern "C" void rsContextSendMessage (RsContext rsc, uint32_t id, const uint8_t * data, size_t data_length);
-extern "C" void rsContextInitToClient (RsContext rsc);
-extern "C" void rsContextDeinitToClient (RsContext rsc);
-extern "C" void rsContextSetCacheDir (RsContext rsc, const char * cacheDir, size_t cacheDir_length);
-extern "C" void rsaContextSetNativeLibDir(RsContext con, char *libDir, size_t length);
+extern "C" RsContext rsContextCreate(RsDevice vdev, uint32_t version, uint32_t sdkVersion,
+                                     RsContextType ct, uint32_t flags) __DEPRECATED_IN(31);
+extern "C" void rsContextDestroy(RsContext rsc) __DEPRECATED_IN(31);
+extern "C" void rsContextFinish(RsContext rsc) __DEPRECATED_IN(31);
+extern "C" void rsContextDump(RsContext rsc, int32_t bits) __DEPRECATED_IN(31);
+extern "C" void rsContextSetPriority(RsContext rsc, int32_t priority) __DEPRECATED_IN(31);
+extern "C" void rsContextDestroyWorker(RsContext rsc) __DEPRECATED_IN(31);
+extern "C" RsMessageToClientType rsContextGetMessage(RsContext rsc, void* data, size_t data_length,
+                                                     size_t* receiveLen, size_t receiveLen_length,
+                                                     uint32_t* usrID, size_t usrID_length)
+        __DEPRECATED_IN(31);
+extern "C" RsMessageToClientType rsContextPeekMessage(RsContext rsc, size_t* receiveLen,
+                                                      size_t receiveLen_length, uint32_t* usrID,
+                                                      size_t usrID_length) __DEPRECATED_IN(31);
+extern "C" void rsContextSendMessage(RsContext rsc, uint32_t id, const uint8_t* data,
+                                     size_t data_length) __DEPRECATED_IN(31);
+extern "C" void rsContextInitToClient(RsContext rsc) __DEPRECATED_IN(31);
+extern "C" void rsContextDeinitToClient(RsContext rsc) __DEPRECATED_IN(31);
+extern "C" void rsContextSetCacheDir(RsContext rsc, const char* cacheDir, size_t cacheDir_length)
+        __DEPRECATED_IN(31);
+extern "C" void rsaContextSetNativeLibDir(RsContext con, char* libDir, size_t length)
+        __DEPRECATED_IN(31);
 
 // BaseObject
-extern "C" void rsAssignName (RsContext rsc, RsObjectBase obj, const char * name, size_t name_length);
-extern "C" void rsaGetName(RsContext con, void * obj, const char **name);
-extern "C" void rsObjDestroy (RsContext rsc, RsAsyncVoidPtr objPtr);
+extern "C" void rsAssignName(RsContext rsc, RsObjectBase obj, const char* name, size_t name_length)
+        __DEPRECATED_IN(31);
+extern "C" void rsaGetName(RsContext con, void* obj, const char** name) __DEPRECATED_IN(31);
+extern "C" void rsObjDestroy(RsContext rsc, RsAsyncVoidPtr objPtr) __DEPRECATED_IN(31);
 
 // Element
-extern "C" RsElement rsElementCreate (RsContext rsc, RsDataType mType, RsDataKind mKind, bool mNormalized, uint32_t mVectorSize);
-extern "C" RsElement rsElementCreate2 (RsContext rsc, const RsElement * elements, size_t elements_length, const char ** names, size_t names_length_length, const size_t * names_length, const uint32_t * arraySize, size_t arraySize_length);
-extern "C" void rsaElementGetNativeData(RsContext con, RsElement elem, uint32_t *elemData, uint32_t elemDataSize);
-extern "C" void rsaElementGetSubElements(RsContext con, RsElement elem, uintptr_t *ids, const char **names, size_t *arraySizes, uint32_t dataSize);
+extern "C" RsElement rsElementCreate(RsContext rsc, RsDataType mType, RsDataKind mKind,
+                                     bool mNormalized, uint32_t mVectorSize) __DEPRECATED_IN(31);
+extern "C" RsElement rsElementCreate2(RsContext rsc, const RsElement* elements,
+                                      size_t elements_length, const char** names,
+                                      size_t names_length_length, const size_t* names_length,
+                                      const uint32_t* arraySize, size_t arraySize_length)
+        __DEPRECATED_IN(31);
+extern "C" void rsaElementGetNativeData(RsContext con, RsElement elem, uint32_t* elemData,
+                                        uint32_t elemDataSize) __DEPRECATED_IN(31);
+extern "C" void rsaElementGetSubElements(RsContext con, RsElement elem, uintptr_t* ids,
+                                         const char** names, size_t* arraySizes, uint32_t dataSize)
+        __DEPRECATED_IN(31);
 
 // Type
-extern "C" RsType rsTypeCreate (RsContext rsc, RsElement e, uint32_t dimX, uint32_t dimY, uint32_t dimZ, bool mipmaps, bool faces, uint32_t yuv);
-extern "C" RsType rsTypeCreate2 (RsContext rsc, const RsTypeCreateParams * dat, size_t dat_length);
-extern "C" void rsaTypeGetNativeData(RsContext con, RsType type, uintptr_t *typeData, uint32_t typeDataSize);
+extern "C" RsType rsTypeCreate(RsContext rsc, RsElement e, uint32_t dimX, uint32_t dimY,
+                               uint32_t dimZ, bool mipmaps, bool faces, uint32_t yuv)
+        __DEPRECATED_IN(31);
+extern "C" RsType rsTypeCreate2(RsContext rsc, const RsTypeCreateParams* dat, size_t dat_length)
+        __DEPRECATED_IN(31);
+extern "C" void rsaTypeGetNativeData(RsContext con, RsType type, uintptr_t* typeData,
+                                     uint32_t typeDataSize) __DEPRECATED_IN(31);
 
 // Allocation
-extern "C" RsAllocation rsAllocationCreateTyped (RsContext rsc, RsType vtype, RsAllocationMipmapControl mipmaps, uint32_t usages, uintptr_t ptr);
-extern "C" RsAllocation rsAllocationCreateFromBitmap (RsContext rsc, RsType vtype, RsAllocationMipmapControl mipmaps, const void * data, size_t data_length, uint32_t usages);
-extern "C" RsAllocation rsAllocationCubeCreateFromBitmap (RsContext rsc, RsType vtype, RsAllocationMipmapControl mipmaps, const void * data, size_t data_length, uint32_t usages);
-extern "C" RsAllocation rsAllocationAdapterCreate (RsContext rsc, RsType vtype, RsAllocation baseAlloc);
-extern "C" const void * rsaAllocationGetType(RsContext con, RsAllocation va);
-extern "C" RsNativeWindow rsAllocationGetSurface (RsContext rsc, RsAllocation alloc);
-extern "C" void rsAllocationSetupBufferQueue (RsContext rsc, RsAllocation alloc, uint32_t numAlloc);
-extern "C" void rsAllocationShareBufferQueue (RsContext rsc, RsAllocation alloc1, RsAllocation alloc2);
-extern "C" void rsAllocationSetSurface (RsContext rsc, RsAllocation alloc, RsNativeWindow sur);
-extern "C" void rsAllocationAdapterOffset (RsContext rsc, RsAllocation alloc, const uint32_t * offsets, size_t offsets_length);
-extern "C" void rsAllocationCopyToBitmap (RsContext rsc, RsAllocation alloc, void * data, size_t data_length);
-extern "C" void * rsAllocationGetPointer (RsContext rsc, RsAllocation va, uint32_t lod, RsAllocationCubemapFace face, uint32_t z, uint32_t array, size_t * stride, size_t stride_length);
-extern "C" void rsAllocation1DData (RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t lod, uint32_t count, const void * data, size_t data_length);
-extern "C" void rsAllocation1DElementData (RsContext rsc, RsAllocation va, uint32_t x, uint32_t lod, const void * data, size_t data_length, size_t comp_offset);
-extern "C" void rsAllocationElementData (RsContext rsc, RsAllocation va, uint32_t x, uint32_t y, uint32_t z, uint32_t lod, const void * data, size_t data_length, size_t comp_offset);
-extern "C" void rsAllocation2DData (RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face, uint32_t w, uint32_t h, const void * data, size_t data_length, size_t stride);
-extern "C" void rsAllocation3DData (RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, uint32_t w, uint32_t h, uint32_t d, const void * data, size_t data_length, size_t stride);
-extern "C" void rsAllocationGenerateMipmaps (RsContext rsc, RsAllocation va);
-extern "C" void rsAllocationRead (RsContext rsc, RsAllocation va, void * data, size_t data_length);
-extern "C" void rsAllocation1DRead (RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t lod, uint32_t count, void * data, size_t data_length);
-extern "C" void rsAllocationElementRead (RsContext rsc, RsAllocation va, uint32_t x, uint32_t y, uint32_t z, uint32_t lod, void * data, size_t data_length, size_t comp_offset);
-extern "C" void rsAllocation2DRead (RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face, uint32_t w, uint32_t h, void * data, size_t data_length, size_t stride);
-extern "C" void rsAllocation3DRead (RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, uint32_t w, uint32_t h, uint32_t d, void * data, size_t data_length, size_t stride);
-extern "C" void rsAllocationSyncAll (RsContext rsc, RsAllocation va, RsAllocationUsageType src);
-extern "C" void rsAllocationResize1D (RsContext rsc, RsAllocation va, uint32_t dimX);
-extern "C" void rsAllocationCopy2DRange (RsContext rsc, RsAllocation dest, uint32_t destXoff, uint32_t destYoff, uint32_t destMip, uint32_t destFace, uint32_t width, uint32_t height, RsAllocation src, uint32_t srcXoff, uint32_t srcYoff, uint32_t srcMip, uint32_t srcFace);
-extern "C" void rsAllocationCopy3DRange (RsContext rsc, RsAllocation dest, uint32_t destXoff, uint32_t destYoff, uint32_t destZoff, uint32_t destMip, uint32_t width, uint32_t height, uint32_t depth, RsAllocation src, uint32_t srcXoff, uint32_t srcYoff, uint32_t srcZoff, uint32_t srcMip);
-extern "C" void rsAllocationIoSend (RsContext rsc, RsAllocation alloc);
-extern "C" int64_t rsAllocationIoReceive (RsContext rsc, RsAllocation alloc);
+extern "C" RsAllocation rsAllocationCreateTyped(RsContext rsc, RsType vtype,
+                                                RsAllocationMipmapControl mipmaps, uint32_t usages,
+                                                uintptr_t ptr) __DEPRECATED_IN(31);
+extern "C" RsAllocation rsAllocationCreateFromBitmap(RsContext rsc, RsType vtype,
+                                                     RsAllocationMipmapControl mipmaps,
+                                                     const void* data, size_t data_length,
+                                                     uint32_t usages) __DEPRECATED_IN(31);
+extern "C" RsAllocation rsAllocationCubeCreateFromBitmap(RsContext rsc, RsType vtype,
+                                                         RsAllocationMipmapControl mipmaps,
+                                                         const void* data, size_t data_length,
+                                                         uint32_t usages) __DEPRECATED_IN(31);
+extern "C" RsAllocation rsAllocationAdapterCreate(RsContext rsc, RsType vtype,
+                                                  RsAllocation baseAlloc) __DEPRECATED_IN(31);
+extern "C" const void* rsaAllocationGetType(RsContext con, RsAllocation va) __DEPRECATED_IN(31);
+extern "C" RsNativeWindow rsAllocationGetSurface(RsContext rsc, RsAllocation alloc)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocationSetupBufferQueue(RsContext rsc, RsAllocation alloc, uint32_t numAlloc)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocationShareBufferQueue(RsContext rsc, RsAllocation alloc1,
+                                             RsAllocation alloc2) __DEPRECATED_IN(31);
+extern "C" void rsAllocationSetSurface(RsContext rsc, RsAllocation alloc, RsNativeWindow sur)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocationAdapterOffset(RsContext rsc, RsAllocation alloc,
+                                          const uint32_t* offsets, size_t offsets_length)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocationCopyToBitmap(RsContext rsc, RsAllocation alloc, void* data,
+                                         size_t data_length) __DEPRECATED_IN(31);
+extern "C" void* rsAllocationGetPointer(RsContext rsc, RsAllocation va, uint32_t lod,
+                                        RsAllocationCubemapFace face, uint32_t z, uint32_t array,
+                                        size_t* stride, size_t stride_length) __DEPRECATED_IN(31);
+extern "C" void rsAllocation1DData(RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t lod,
+                                   uint32_t count, const void* data, size_t data_length)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocation1DElementData(RsContext rsc, RsAllocation va, uint32_t x, uint32_t lod,
+                                          const void* data, size_t data_length, size_t comp_offset)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocationElementData(RsContext rsc, RsAllocation va, uint32_t x, uint32_t y,
+                                        uint32_t z, uint32_t lod, const void* data,
+                                        size_t data_length, size_t comp_offset) __DEPRECATED_IN(31);
+extern "C" void rsAllocation2DData(RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t yoff,
+                                   uint32_t lod, RsAllocationCubemapFace face, uint32_t w,
+                                   uint32_t h, const void* data, size_t data_length, size_t stride)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocation3DData(RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t yoff,
+                                   uint32_t zoff, uint32_t lod, uint32_t w, uint32_t h, uint32_t d,
+                                   const void* data, size_t data_length, size_t stride)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocationGenerateMipmaps(RsContext rsc, RsAllocation va) __DEPRECATED_IN(31);
+extern "C" void rsAllocationRead(RsContext rsc, RsAllocation va, void* data, size_t data_length)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocation1DRead(RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t lod,
+                                   uint32_t count, void* data, size_t data_length)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocationElementRead(RsContext rsc, RsAllocation va, uint32_t x, uint32_t y,
+                                        uint32_t z, uint32_t lod, void* data, size_t data_length,
+                                        size_t comp_offset) __DEPRECATED_IN(31);
+extern "C" void rsAllocation2DRead(RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t yoff,
+                                   uint32_t lod, RsAllocationCubemapFace face, uint32_t w,
+                                   uint32_t h, void* data, size_t data_length, size_t stride)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocation3DRead(RsContext rsc, RsAllocation va, uint32_t xoff, uint32_t yoff,
+                                   uint32_t zoff, uint32_t lod, uint32_t w, uint32_t h, uint32_t d,
+                                   void* data, size_t data_length, size_t stride)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocationSyncAll(RsContext rsc, RsAllocation va, RsAllocationUsageType src)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocationResize1D(RsContext rsc, RsAllocation va, uint32_t dimX)
+        __DEPRECATED_IN(31);
+extern "C" void rsAllocationCopy2DRange(RsContext rsc, RsAllocation dest, uint32_t destXoff,
+                                        uint32_t destYoff, uint32_t destMip, uint32_t destFace,
+                                        uint32_t width, uint32_t height, RsAllocation src,
+                                        uint32_t srcXoff, uint32_t srcYoff, uint32_t srcMip,
+                                        uint32_t srcFace) __DEPRECATED_IN(31);
+extern "C" void rsAllocationCopy3DRange(RsContext rsc, RsAllocation dest, uint32_t destXoff,
+                                        uint32_t destYoff, uint32_t destZoff, uint32_t destMip,
+                                        uint32_t width, uint32_t height, uint32_t depth,
+                                        RsAllocation src, uint32_t srcXoff, uint32_t srcYoff,
+                                        uint32_t srcZoff, uint32_t srcMip) __DEPRECATED_IN(31);
+extern "C" void rsAllocationIoSend(RsContext rsc, RsAllocation alloc) __DEPRECATED_IN(31);
+extern "C" int64_t rsAllocationIoReceive(RsContext rsc, RsAllocation alloc) __DEPRECATED_IN(31);
 
 // ScriptGroup
-extern "C" RsScriptGroup rsScriptGroupCreate (RsContext rsc, RsScriptKernelID * kernels, size_t kernels_length, RsScriptKernelID * src, size_t src_length, RsScriptKernelID * dstK, size_t dstK_length, RsScriptFieldID * dstF, size_t dstF_length, const RsType * type, size_t type_length);
-extern "C" RsScriptGroup2 rsScriptGroup2Create (RsContext rsc, const char * name, size_t name_length, const char * cacheDir, size_t cacheDir_length, RsClosure * closures, size_t closures_length);
-extern "C" RsClosure rsClosureCreate (RsContext rsc, RsScriptKernelID kernelID, RsAllocation returnValue, RsScriptFieldID * fieldIDs, size_t fieldIDs_length, const int64_t * values, size_t values_length, const int * sizes, size_t sizes_length, RsClosure * depClosures, size_t depClosures_length, RsScriptFieldID * depFieldIDs, size_t depFieldIDs_length);
-extern "C" RsClosure rsInvokeClosureCreate (RsContext rsc, RsScriptInvokeID invokeID, const void * params, size_t params_length, const RsScriptFieldID * fieldIDs, size_t fieldIDs_length, const int64_t * values, size_t values_length, const int * sizes, size_t sizes_length);
-extern "C" void rsClosureSetArg (RsContext rsc, RsClosure closureID, uint32_t index, uintptr_t value, int valueSize);
-extern "C" void rsClosureSetGlobal (RsContext rsc, RsClosure closureID, RsScriptFieldID fieldID, int64_t value, int valueSize);
-extern "C" RsScriptKernelID rsScriptKernelIDCreate (RsContext rsc, RsScript sid, int slot, int sig);
-extern "C" RsScriptInvokeID rsScriptInvokeIDCreate (RsContext rsc, RsScript s, uint32_t slot);
-extern "C" RsScriptFieldID rsScriptFieldIDCreate (RsContext rsc, RsScript sid, int slot);
-extern "C" void rsScriptGroupSetOutput (RsContext rsc, RsScriptGroup group, RsScriptKernelID kernel, RsAllocation alloc);
-extern "C" void rsScriptGroupSetInput (RsContext rsc, RsScriptGroup group, RsScriptKernelID kernel, RsAllocation alloc);
-extern "C" void rsScriptGroupExecute (RsContext rsc, RsScriptGroup group);
+extern "C" RsScriptGroup rsScriptGroupCreate(RsContext rsc, RsScriptKernelID* kernels,
+                                             size_t kernels_length, RsScriptKernelID* src,
+                                             size_t src_length, RsScriptKernelID* dstK,
+                                             size_t dstK_length, RsScriptFieldID* dstF,
+                                             size_t dstF_length, const RsType* type,
+                                             size_t type_length) __DEPRECATED_IN(31);
+extern "C" RsScriptGroup2 rsScriptGroup2Create(RsContext rsc, const char* name, size_t name_length,
+                                               const char* cacheDir, size_t cacheDir_length,
+                                               RsClosure* closures, size_t closures_length)
+        __DEPRECATED_IN(31);
+extern "C" RsClosure rsClosureCreate(RsContext rsc, RsScriptKernelID kernelID,
+                                     RsAllocation returnValue, RsScriptFieldID* fieldIDs,
+                                     size_t fieldIDs_length, const int64_t* values,
+                                     size_t values_length, const int* sizes, size_t sizes_length,
+                                     RsClosure* depClosures, size_t depClosures_length,
+                                     RsScriptFieldID* depFieldIDs, size_t depFieldIDs_length)
+        __DEPRECATED_IN(31);
+extern "C" RsClosure rsInvokeClosureCreate(RsContext rsc, RsScriptInvokeID invokeID,
+                                           const void* params, size_t params_length,
+                                           const RsScriptFieldID* fieldIDs, size_t fieldIDs_length,
+                                           const int64_t* values, size_t values_length,
+                                           const int* sizes, size_t sizes_length)
+        __DEPRECATED_IN(31);
+extern "C" void rsClosureSetArg(RsContext rsc, RsClosure closureID, uint32_t index, uintptr_t value,
+                                int valueSize) __DEPRECATED_IN(31);
+extern "C" void rsClosureSetGlobal(RsContext rsc, RsClosure closureID, RsScriptFieldID fieldID,
+                                   int64_t value, int valueSize) __DEPRECATED_IN(31);
+extern "C" RsScriptKernelID rsScriptKernelIDCreate(RsContext rsc, RsScript sid, int slot, int sig)
+        __DEPRECATED_IN(31);
+extern "C" RsScriptInvokeID rsScriptInvokeIDCreate(RsContext rsc, RsScript s, uint32_t slot)
+        __DEPRECATED_IN(31);
+extern "C" RsScriptFieldID rsScriptFieldIDCreate(RsContext rsc, RsScript sid, int slot)
+        __DEPRECATED_IN(31);
+extern "C" void rsScriptGroupSetOutput(RsContext rsc, RsScriptGroup group, RsScriptKernelID kernel,
+                                       RsAllocation alloc) __DEPRECATED_IN(31);
+extern "C" void rsScriptGroupSetInput(RsContext rsc, RsScriptGroup group, RsScriptKernelID kernel,
+                                      RsAllocation alloc) __DEPRECATED_IN(31);
+extern "C" void rsScriptGroupExecute(RsContext rsc, RsScriptGroup group) __DEPRECATED_IN(31);
 
 // Sampler
-extern "C" RsSampler rsSamplerCreate (RsContext rsc, RsSamplerValue magFilter, RsSamplerValue minFilter, RsSamplerValue wrapS, RsSamplerValue wrapT, RsSamplerValue wrapR, float mAniso);
+extern "C" RsSampler rsSamplerCreate(RsContext rsc, RsSamplerValue magFilter,
+                                     RsSamplerValue minFilter, RsSamplerValue wrapS,
+                                     RsSamplerValue wrapT, RsSamplerValue wrapR, float mAniso)
+        __DEPRECATED_IN(31);
 
 // Script
-extern "C" RsScript rsScriptCCreate (RsContext rsc, const char * resName, size_t resName_length, const char * cacheDir, size_t cacheDir_length, const char * text, size_t text_length);
-extern "C" RsScript rsScriptIntrinsicCreate (RsContext rsc, uint32_t id, RsElement eid);
-extern "C" void rsScriptBindAllocation (RsContext rsc, RsScript vtm, RsAllocation va, uint32_t slot);
-extern "C" void rsScriptSetTimeZone (RsContext rsc, RsScript s, const char * timeZone, size_t timeZone_length);
-extern "C" void rsScriptInvoke (RsContext rsc, RsScript s, uint32_t slot);
-extern "C" void rsScriptInvokeV (RsContext rsc, RsScript s, uint32_t slot, const void * data, size_t data_length);
-extern "C" void rsScriptForEach (RsContext rsc, RsScript s, uint32_t slot, RsAllocation ain, RsAllocation aout, const void * usr, size_t usr_length, const RsScriptCall * sc, size_t sc_length);
-extern "C" void rsScriptForEachMulti (RsContext rsc, RsScript s, uint32_t slot, RsAllocation * ains, size_t ains_length, RsAllocation aout, const void * usr, size_t usr_length, const RsScriptCall * sc, size_t sc_length);
-extern "C" void rsScriptReduce (RsContext rsc, RsScript s, uint32_t slot, RsAllocation * ains, size_t ains_length, RsAllocation aout, const RsScriptCall * sc, size_t sc_length);
-extern "C" void rsScriptSetVarI (RsContext rsc, RsScript s, uint32_t slot, int value);
-extern "C" void rsScriptSetVarObj (RsContext rsc, RsScript s, uint32_t slot, RsObjectBase value);
-extern "C" void rsScriptSetVarJ (RsContext rsc, RsScript s, uint32_t slot, int64_t value);
-extern "C" void rsScriptSetVarF (RsContext rsc, RsScript s, uint32_t slot, float value);
-extern "C" void rsScriptSetVarD (RsContext rsc, RsScript s, uint32_t slot, double value);
-extern "C" void rsScriptSetVarV (RsContext rsc, RsScript s, uint32_t slot, const void * data, size_t data_length);
-extern "C" void rsScriptGetVarV (RsContext rsc, RsScript s, uint32_t slot, void * data, size_t data_length);
-extern "C" void rsScriptSetVarVE (RsContext rsc, RsScript s, uint32_t slot, const void * data, size_t data_length, RsElement e, const uint32_t * dims, size_t dims_length);
+extern "C" RsScript rsScriptCCreate(RsContext rsc, const char* resName, size_t resName_length,
+                                    const char* cacheDir, size_t cacheDir_length, const char* text,
+                                    size_t text_length) __DEPRECATED_IN(31);
+extern "C" RsScript rsScriptIntrinsicCreate(RsContext rsc, uint32_t id, RsElement eid)
+        __DEPRECATED_IN(31);
+extern "C" void rsScriptBindAllocation(RsContext rsc, RsScript vtm, RsAllocation va, uint32_t slot)
+        __DEPRECATED_IN(31);
+extern "C" void rsScriptSetTimeZone(RsContext rsc, RsScript s, const char* timeZone,
+                                    size_t timeZone_length) __DEPRECATED_IN(31);
+extern "C" void rsScriptInvoke(RsContext rsc, RsScript s, uint32_t slot) __DEPRECATED_IN(31);
+extern "C" void rsScriptInvokeV(RsContext rsc, RsScript s, uint32_t slot, const void* data,
+                                size_t data_length) __DEPRECATED_IN(31);
+extern "C" void rsScriptForEach(RsContext rsc, RsScript s, uint32_t slot, RsAllocation ain,
+                                RsAllocation aout, const void* usr, size_t usr_length,
+                                const RsScriptCall* sc, size_t sc_length) __DEPRECATED_IN(31);
+extern "C" void rsScriptForEachMulti(RsContext rsc, RsScript s, uint32_t slot, RsAllocation* ains,
+                                     size_t ains_length, RsAllocation aout, const void* usr,
+                                     size_t usr_length, const RsScriptCall* sc, size_t sc_length)
+        __DEPRECATED_IN(31);
+extern "C" void rsScriptReduce(RsContext rsc, RsScript s, uint32_t slot, RsAllocation* ains,
+                               size_t ains_length, RsAllocation aout, const RsScriptCall* sc,
+                               size_t sc_length) __DEPRECATED_IN(31);
+extern "C" void rsScriptSetVarI(RsContext rsc, RsScript s, uint32_t slot, int value)
+        __DEPRECATED_IN(31);
+extern "C" void rsScriptSetVarObj(RsContext rsc, RsScript s, uint32_t slot, RsObjectBase value)
+        __DEPRECATED_IN(31);
+extern "C" void rsScriptSetVarJ(RsContext rsc, RsScript s, uint32_t slot, int64_t value)
+        __DEPRECATED_IN(31);
+extern "C" void rsScriptSetVarF(RsContext rsc, RsScript s, uint32_t slot, float value)
+        __DEPRECATED_IN(31);
+extern "C" void rsScriptSetVarD(RsContext rsc, RsScript s, uint32_t slot, double value)
+        __DEPRECATED_IN(31);
+extern "C" void rsScriptSetVarV(RsContext rsc, RsScript s, uint32_t slot, const void* data,
+                                size_t data_length) __DEPRECATED_IN(31);
+extern "C" void rsScriptGetVarV(RsContext rsc, RsScript s, uint32_t slot, void* data,
+                                size_t data_length) __DEPRECATED_IN(31);
+extern "C" void rsScriptSetVarVE(RsContext rsc, RsScript s, uint32_t slot, const void* data,
+                                 size_t data_length, RsElement e, const uint32_t* dims,
+                                 size_t dims_length) __DEPRECATED_IN(31);
 
 // Graphics
-extern "C" RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, uint32_t sdkVersion, RsSurfaceConfig sc, uint32_t dpi);
-extern "C" void rsContextSetSurface (RsContext rsc, uint32_t width, uint32_t height, RsNativeWindow sur);
-extern "C" void rsContextPause (RsContext rsc);
-extern "C" void rsContextResume (RsContext rsc);
-extern "C" void rsContextBindProgramStore (RsContext rsc, RsProgramStore pgm);
-extern "C" void rsContextBindProgramFragment (RsContext rsc, RsProgramFragment pgm);
-extern "C" void rsContextBindProgramVertex (RsContext rsc, RsProgramVertex pgm);
-extern "C" void rsContextBindProgramRaster (RsContext rsc, RsProgramRaster pgm);
-extern "C" void rsContextBindFont (RsContext rsc, RsFont pgm);
-extern "C" void rsContextBindRootScript (RsContext rsc, RsScript sampler);
+extern "C" RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, uint32_t sdkVersion,
+                                       RsSurfaceConfig sc, uint32_t dpi) __DEPRECATED_IN(31);
+extern "C" void rsContextSetSurface(RsContext rsc, uint32_t width, uint32_t height,
+                                    RsNativeWindow sur) __DEPRECATED_IN(31);
+extern "C" void rsContextPause(RsContext rsc) __DEPRECATED_IN(31);
+extern "C" void rsContextResume(RsContext rsc) __DEPRECATED_IN(31);
+extern "C" void rsContextBindProgramStore(RsContext rsc, RsProgramStore pgm) __DEPRECATED_IN(31);
+extern "C" void rsContextBindProgramFragment(RsContext rsc, RsProgramFragment pgm)
+        __DEPRECATED_IN(31);
+extern "C" void rsContextBindProgramVertex(RsContext rsc, RsProgramVertex pgm) __DEPRECATED_IN(31);
+extern "C" void rsContextBindProgramRaster(RsContext rsc, RsProgramRaster pgm) __DEPRECATED_IN(31);
+extern "C" void rsContextBindFont(RsContext rsc, RsFont pgm) __DEPRECATED_IN(31);
+extern "C" void rsContextBindRootScript(RsContext rsc, RsScript sampler) __DEPRECATED_IN(31);
 
-extern "C" RsProgramStore rsProgramStoreCreate (RsContext rsc, bool colorMaskR, bool colorMaskG, bool colorMaskB, bool colorMaskA, bool depthMask, bool ditherEnable, RsBlendSrcFunc srcFunc, RsBlendDstFunc destFunc, RsDepthFunc depthFunc);
-extern "C" RsProgramRaster rsProgramRasterCreate (RsContext rsc, bool pointSprite, RsCullMode cull);
-extern "C" RsProgramFragment rsProgramFragmentCreate (RsContext rsc, const char * shaderText, size_t shaderText_length, const char ** textureNames, size_t textureNames_length_length, const size_t * textureNames_length, const uintptr_t * params, size_t params_length);
-extern "C" RsProgramVertex rsProgramVertexCreate (RsContext rsc, const char * shaderText, size_t shaderText_length, const char ** textureNames, size_t textureNames_length_length, const size_t * textureNames_length, const uintptr_t * params, size_t params_length);
-extern "C" RsFont rsFontCreateFromFile (RsContext rsc, const char * name, size_t name_length, float fontSize, uint32_t dpi);
-extern "C" RsFont rsFontCreateFromMemory (RsContext rsc, const char * name, size_t name_length, float fontSize, uint32_t dpi, const void * data, size_t data_length);
-extern "C" RsMesh rsMeshCreate (RsContext rsc, RsAllocation * vtx, size_t vtx_length, RsAllocation * idx, size_t idx_length, uint32_t * primType, size_t primType_length);
-extern "C" void rsProgramBindConstants (RsContext rsc, RsProgram vp, uint32_t slot, RsAllocation constants);
-extern "C" void rsProgramBindTexture (RsContext rsc, RsProgramFragment pf, uint32_t slot, RsAllocation a);
-extern "C" void rsProgramBindSampler (RsContext rsc, RsProgramFragment pf, uint32_t slot, RsSampler s);
+extern "C" RsProgramStore rsProgramStoreCreate(RsContext rsc, bool colorMaskR, bool colorMaskG,
+                                               bool colorMaskB, bool colorMaskA, bool depthMask,
+                                               bool ditherEnable, RsBlendSrcFunc srcFunc,
+                                               RsBlendDstFunc destFunc, RsDepthFunc depthFunc)
+        __DEPRECATED_IN(31);
+extern "C" RsProgramRaster rsProgramRasterCreate(RsContext rsc, bool pointSprite, RsCullMode cull)
+        __DEPRECATED_IN(31);
+extern "C" RsProgramFragment rsProgramFragmentCreate(
+        RsContext rsc, const char* shaderText, size_t shaderText_length, const char** textureNames,
+        size_t textureNames_length_length, const size_t* textureNames_length,
+        const uintptr_t* params, size_t params_length) __DEPRECATED_IN(31);
+extern "C" RsProgramVertex rsProgramVertexCreate(
+        RsContext rsc, const char* shaderText, size_t shaderText_length, const char** textureNames,
+        size_t textureNames_length_length, const size_t* textureNames_length,
+        const uintptr_t* params, size_t params_length) __DEPRECATED_IN(31);
+extern "C" RsFont rsFontCreateFromFile(RsContext rsc, const char* name, size_t name_length,
+                                       float fontSize, uint32_t dpi) __DEPRECATED_IN(31);
+extern "C" RsFont rsFontCreateFromMemory(RsContext rsc, const char* name, size_t name_length,
+                                         float fontSize, uint32_t dpi, const void* data,
+                                         size_t data_length) __DEPRECATED_IN(31);
+extern "C" RsMesh rsMeshCreate(RsContext rsc, RsAllocation* vtx, size_t vtx_length,
+                               RsAllocation* idx, size_t idx_length, uint32_t* primType,
+                               size_t primType_length) __DEPRECATED_IN(31);
+extern "C" void rsProgramBindConstants(RsContext rsc, RsProgram vp, uint32_t slot,
+                                       RsAllocation constants) __DEPRECATED_IN(31);
+extern "C" void rsProgramBindTexture(RsContext rsc, RsProgramFragment pf, uint32_t slot,
+                                     RsAllocation a) __DEPRECATED_IN(31);
+extern "C" void rsProgramBindSampler(RsContext rsc, RsProgramFragment pf, uint32_t slot,
+                                     RsSampler s) __DEPRECATED_IN(31);
 
-extern "C" RsObjectBase rsaFileA3DGetEntryByIndex(RsContext con, uint32_t index, RsFile file);
-extern "C" RsFile rsaFileA3DCreateFromMemory(RsContext con, const void *data, uint32_t len);
-extern "C" RsFile rsaFileA3DCreateFromAsset(RsContext con, void *_asset);
-extern "C" RsFile rsaFileA3DCreateFromFile(RsContext con, const char *path);
-extern "C" void rsaFileA3DGetNumIndexEntries(RsContext con, int32_t *numEntries, RsFile file);
-extern "C" void rsaFileA3DGetIndexEntries(RsContext con, RsFileIndexEntry *fileEntries, uint32_t numEntries, RsFile file);
-extern "C" void rsaMeshGetVertexBufferCount(RsContext con, RsMesh mv, int32_t *numVtx);
-extern "C" void rsaMeshGetIndexCount(RsContext con, RsMesh mv, int32_t *numIdx);
-extern "C" void rsaMeshGetVertices(RsContext con, RsMesh mv, RsAllocation *vtxData, uint32_t vtxDataCount);
-extern "C" void rsaMeshGetIndices(RsContext con, RsMesh mv, RsAllocation *va, uint32_t *primType, uint32_t idxDataCount);
+extern "C" RsObjectBase rsaFileA3DGetEntryByIndex(RsContext con, uint32_t index, RsFile file)
+        __DEPRECATED_IN(31);
+extern "C" RsFile rsaFileA3DCreateFromMemory(RsContext con, const void* data, uint32_t len)
+        __DEPRECATED_IN(31);
+extern "C" RsFile rsaFileA3DCreateFromAsset(RsContext con, void* _asset) __DEPRECATED_IN(31);
+extern "C" RsFile rsaFileA3DCreateFromFile(RsContext con, const char* path) __DEPRECATED_IN(31);
+extern "C" void rsaFileA3DGetNumIndexEntries(RsContext con, int32_t* numEntries, RsFile file)
+        __DEPRECATED_IN(31);
+extern "C" void rsaFileA3DGetIndexEntries(RsContext con, RsFileIndexEntry* fileEntries,
+                                          uint32_t numEntries, RsFile file) __DEPRECATED_IN(31);
+extern "C" void rsaMeshGetVertexBufferCount(RsContext con, RsMesh mv, int32_t* numVtx)
+        __DEPRECATED_IN(31);
+extern "C" void rsaMeshGetIndexCount(RsContext con, RsMesh mv, int32_t* numIdx) __DEPRECATED_IN(31);
+extern "C" void rsaMeshGetVertices(RsContext con, RsMesh mv, RsAllocation* vtxData,
+                                   uint32_t vtxDataCount) __DEPRECATED_IN(31);
+extern "C" void rsaMeshGetIndices(RsContext con, RsMesh mv, RsAllocation* va, uint32_t* primType,
+                                  uint32_t idxDataCount) __DEPRECATED_IN(31);
 
 #endif // ANDROID_RS_API_STUBS_H
diff --git a/rsg_generator.c b/rsg_generator.c
index 89caa600..02aa1c8 100644
--- a/rsg_generator.c
+++ b/rsg_generator.c
@@ -149,7 +149,7 @@
             fprintf(f, "extern \"C\" ");
         }
         printFuncDecl(f, &apis[ct], prefix, addContext, 0);
-        fprintf(f, ";\n");
+        fprintf(f, " __DEPRECATED_IN(31);\n");
     }
     fprintf(f, "\n\n");
 }
diff --git a/script_api/Android.bp b/script_api/Android.bp
index 943f956..0f026bf 100644
--- a/script_api/Android.bp
+++ b/script_api/Android.bp
@@ -1,5 +1,9 @@
 // Build API doc generator ====================
 
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_binary_host {
     name: "rs-api-doc-generator",
     srcs: [
@@ -10,7 +14,7 @@
         "GenerateTestFiles.cpp",
         "Scanner.cpp",
         "Utilities.cpp",
-        "GenerateStubsWhiteList.cpp",
+        "GenerateRSFunctionsList.cpp",
     ],
 
     cflags: [
@@ -22,4 +26,3 @@
         never: true,
     },
 }
-
diff --git a/script_api/GenerateStubsWhiteList.cpp b/script_api/GenerateRSFunctionsList.cpp
similarity index 96%
rename from script_api/GenerateStubsWhiteList.cpp
rename to script_api/GenerateRSFunctionsList.cpp
index 1c98adf..38fa4d7 100644
--- a/script_api/GenerateStubsWhiteList.cpp
+++ b/script_api/GenerateRSFunctionsList.cpp
@@ -386,18 +386,18 @@
     return success;
 }
 
-/* Generate the white list file of the mangled function prototypes.  This generated list is used
+/* Generate the file with the mangled function names.  This generated list is used
  * to validate unresolved external references.  'lastApiLevel' is the largest api level found in
  * all spec files.
  */
-static bool generateWhiteListFile(unsigned int lastApiLevel) {
+static bool generateRSFunctionsListFile(unsigned int lastApiLevel) {
     bool success = true;
     // We generate all the manglings in a set to remove duplicates and to order them.
     set<string> allManglings;
     for (auto f : systemSpecification.getFunctions()) {
         const Function* function = f.second;
         for (auto spec : function->getSpecifications()) {
-            // Compiler intrinsics are not runtime APIs. Do not include them in the whitelist.
+            // Compiler intrinsics are not runtime APIs. Do not include them.
             if (spec->isIntrinsic()) {
                 continue;
             }
@@ -410,12 +410,12 @@
 
     if (success) {
         GeneratedFile file;
-        if (!file.start(".", "RSStubsWhiteList.cpp")) {
+        if (!file.start(".", "RSFunctionsList.cpp")) {
             return false;
         }
 
         file.writeNotices();
-        file << "#include \"RSStubsWhiteList.h\"\n\n";
+        file << "#include \"RSFunctionsList.h\"\n\n";
         file << "std::array<std::string_view, " << allManglings.size() << "> stubList = {\n";
         for (const auto& e : allManglings) {
             file << "\"" << e << "\",\n";
@@ -423,18 +423,18 @@
         file << "};\n";
 
         GeneratedFile header;
-        if (!header.start(".", "RSStubsWhiteList.h")) {
+        if (!header.start(".", "RSFunctionsList.h")) {
             return false;
         }
 
         header.writeNotices();
-        header << "#ifndef RSStubsWhiteList_H\n";
-        header << "#define RSStubsWhiteList_H\n\n";
+        header << "#ifndef RSFunctionsList_H\n";
+        header << "#define RSFunctionsList_H\n\n";
         header << "#include <cstdlib>\n";
         header << "#include <array>\n";
         header << "#include <string_view>\n\n";
         header << "extern std::array<std::string_view, " << allManglings.size() << "> stubList;\n\n";
-        header << "#endif // RSStubsWhiteList_H\n";
+        header << "#endif // RSFunctionsList_H\n";
     }
     return success;
 }
@@ -442,7 +442,7 @@
 // Add a uniquely named variable definition to the file and return its name.
 static const string addVariable(GeneratedFile* file, unsigned int* variableNumber) {
     const string name = "buf" + to_string((*variableNumber)++);
-    /* Some data structures like rs_tm can't be exported.  We'll just use a dumb buffer
+    /* Some data structures like rs_tm can't be exported.  We'll just use a unexpected buffer
      * and cast its address later on.
      */
     *file << "char " << name << "[200];\n";
@@ -493,7 +493,7 @@
  * Since some structures can't be defined at the global level, we use casts of simple byte
  * buffers to get around that restriction.
  *
- * This file can be used to verify the white list that's also generated in this file.  To do so,
+ * This file can be used to verify the function list that's also generated in this file.  To do so,
  * run "llvm-nm -undefined-only -just-symbol-name" on the resulting bit code.
  */
 static bool generateApiTesterFile(const string& slangTestDirectory, unsigned int apiLevel) {
@@ -562,9 +562,9 @@
     return true;
 }
 
-bool generateStubsWhiteList(const string& slangTestDirectory, unsigned int maxApiLevel) {
+bool generateRSFunctionsList(const string& slangTestDirectory, unsigned int maxApiLevel) {
     unsigned int lastApiLevel = min(systemSpecification.getMaximumApiLevel(), maxApiLevel);
-    if (!generateWhiteListFile(lastApiLevel)) {
+    if (!generateRSFunctionsListFile(lastApiLevel)) {
         return false;
     }
     // Generate a test file for each apiLevel.
diff --git a/script_api/Generator.h b/script_api/Generator.h
index dc61edc..2cbc37f 100644
--- a/script_api/Generator.h
+++ b/script_api/Generator.h
@@ -29,10 +29,10 @@
  */
 bool generateDocumentation(const std::string& director);
 
-/* Generates the RSStubsWhiteList.cpp file.  Also generates script test files that are used
- * when testing slang and that can be used to manually verify the white list.
- * The implementation is in GenerateStubsWhiteList.cpp.
+/* Generates the RSFunctionsList.cpp file.  Also generates script test files that are used
+ * when testing slang and that can be used to manually verify the list.
+ * The implementation is in GenerateRSFunctionsList.cpp.
  */
-bool generateStubsWhiteList(const std::string& slangTestDirectory, unsigned int maxApiLevel);
+bool generateRSFunctionsList(const std::string& slangTestDirectory, unsigned int maxApiLevel);
 
 #endif  // ANDROID_RS_API_GENERATOR_GENERATOR_H
diff --git a/script_api/Specification.cpp b/script_api/Specification.cpp
index 95ebc78..32354e4 100644
--- a/script_api/Specification.cpp
+++ b/script_api/Specification.cpp
@@ -937,7 +937,7 @@
     bool success = generateHeaderFiles("include") &&
                    generateDocumentation("docs") &&
                    generateTestFiles("test", maxApiLevel) &&
-                   generateStubsWhiteList("slangtest", maxApiLevel);
+                   generateRSFunctionsList("slangtest", maxApiLevel);
     if (success) {
         cout << "Successfully processed " << mTypes.size() << " types, " << mConstants.size()
              << " constants, and " << mFunctions.size() << " functions.\n";
diff --git a/script_api/generate.sh b/script_api/generate.sh
index 9b14ee5..befed81 100755
--- a/script_api/generate.sh
+++ b/script_api/generate.sh
@@ -63,5 +63,5 @@
 done
 rm -rf slangtest
 
-mv RSStubsWhiteList.cpp ../../compile/libbcc/lib/
-mv RSStubsWhiteList.h ../../compile/libbcc/lib/
+mv RSFunctionsList.cpp ../../compile/libbcc/lib/
+mv RsFunctionsList.h ../../compile/libbcc/lib/
diff --git a/script_api/include/rs_for_each.rsh b/script_api/include/rs_for_each.rsh
index bcc5db9..bdff8f9 100644
--- a/script_api/include/rs_for_each.rsh
+++ b/script_api/include/rs_for_each.rsh
@@ -40,7 +40,7 @@
  */
 typedef enum rs_for_each_strategy {
     RS_FOR_EACH_STRATEGY_SERIAL = 0, // Prefer contiguous memory regions.
-    RS_FOR_EACH_STRATEGY_DONT_CARE = 1, // No prefrences.
+    RS_FOR_EACH_STRATEGY_DONT_CARE = 1, // No preferences.
     RS_FOR_EACH_STRATEGY_DST_LINEAR = 2, // Prefer DST.
     RS_FOR_EACH_STRATEGY_TILE_SMALL = 3, // Prefer processing small rectangular regions.
     RS_FOR_EACH_STRATEGY_TILE_MEDIUM = 4, // Prefer processing medium rectangular regions.
diff --git a/support.bp b/support.bp
index ca73744..d16bdbd 100644
--- a/support.bp
+++ b/support.bp
@@ -6,6 +6,9 @@
             enabled: false,
         },
     },
+    cflags: [
+        "-Wno-deprecated-declarations",
+    ],
 }
 
 // Generate custom headers
diff --git a/support/Android.bp b/support/Android.bp
index 3e23269..6e500f0 100644
--- a/support/Android.bp
+++ b/support/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 subdirs = [
     "jni",
 ]
diff --git a/support/java/src/androidx/renderscript/Allocation.java b/support/java/src/androidx/renderscript/Allocation.java
index b6588c0..a37eff6 100644
--- a/support/java/src/androidx/renderscript/Allocation.java
+++ b/support/java/src/androidx/renderscript/Allocation.java
@@ -54,7 +54,12 @@
  * <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a>
  * developer guide.</p>
  * </div>
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Allocation extends BaseObj {
     Type mType;
     Bitmap mBitmap;
@@ -225,7 +230,7 @@
     }
 
     /**
-     * Getter & Setter for the dummy allocation for Inc Support Lib.
+     * Getter & Setter for the placeholder allocation for Inc Support Lib.
      *
      */
     public long getIncAllocID() {
diff --git a/support/java/src/androidx/renderscript/BaseObj.java b/support/java/src/androidx/renderscript/BaseObj.java
index eda0066..b7f9d9e 100644
--- a/support/java/src/androidx/renderscript/BaseObj.java
+++ b/support/java/src/androidx/renderscript/BaseObj.java
@@ -24,7 +24,11 @@
  * It is responsible for lifetime management and resource tracking. This class
  * should not be used by a user application.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class BaseObj {
     BaseObj(long id, RenderScript rs) {
         rs.validate();
diff --git a/support/java/src/androidx/renderscript/Byte2.java b/support/java/src/androidx/renderscript/Byte2.java
index cf738f4..b2f029e 100644
--- a/support/java/src/androidx/renderscript/Byte2.java
+++ b/support/java/src/androidx/renderscript/Byte2.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript byte2 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Byte2 {
     public Byte2() {
     }
diff --git a/support/java/src/androidx/renderscript/Byte3.java b/support/java/src/androidx/renderscript/Byte3.java
index 559e34a..1e12dec 100644
--- a/support/java/src/androidx/renderscript/Byte3.java
+++ b/support/java/src/androidx/renderscript/Byte3.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript byte3 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Byte3 {
     public Byte3() {
     }
diff --git a/support/java/src/androidx/renderscript/Byte4.java b/support/java/src/androidx/renderscript/Byte4.java
index 0a71e63..1ad22c7 100644
--- a/support/java/src/androidx/renderscript/Byte4.java
+++ b/support/java/src/androidx/renderscript/Byte4.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript byte4 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Byte4 {
     public Byte4() {
     }
diff --git a/support/java/src/androidx/renderscript/Double2.java b/support/java/src/androidx/renderscript/Double2.java
index 9abcd01..66d54ae 100644
--- a/support/java/src/androidx/renderscript/Double2.java
+++ b/support/java/src/androidx/renderscript/Double2.java
@@ -24,7 +24,11 @@
  * Class for exposing the native RenderScript double2 type back
  * to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Double2 {
     public Double2() {
     }
diff --git a/support/java/src/androidx/renderscript/Double3.java b/support/java/src/androidx/renderscript/Double3.java
index 0d07a50..98cf8c6 100644
--- a/support/java/src/androidx/renderscript/Double3.java
+++ b/support/java/src/androidx/renderscript/Double3.java
@@ -24,7 +24,11 @@
  * Class for exposing the native RenderScript double3 type back
  * to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Double3 {
     public Double3() {
     }
diff --git a/support/java/src/androidx/renderscript/Double4.java b/support/java/src/androidx/renderscript/Double4.java
index 3350abf..b10ed05 100644
--- a/support/java/src/androidx/renderscript/Double4.java
+++ b/support/java/src/androidx/renderscript/Double4.java
@@ -24,7 +24,11 @@
  * Class for exposing the native RenderScript double4 type back
  * to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Double4 {
     public Double4() {
     }
diff --git a/support/java/src/androidx/renderscript/Element.java b/support/java/src/androidx/renderscript/Element.java
index 44dbc61..6376681 100644
--- a/support/java/src/androidx/renderscript/Element.java
+++ b/support/java/src/androidx/renderscript/Element.java
@@ -57,7 +57,12 @@
  * <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a>
  * developer guide.</p>
  * </div>
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Element extends BaseObj {
     int mSize;
     Element[] mElements;
@@ -755,7 +760,7 @@
     }
 
     /*
-     * Get an identical dummy Element for Compat Context
+     * Get an identical placeholder Element for Compat Context
      *
      */
     public long getDummyElement(RenderScript mRS) {
diff --git a/support/java/src/androidx/renderscript/FieldPacker.java b/support/java/src/androidx/renderscript/FieldPacker.java
index 34e9ae6..f3d1a44 100644
--- a/support/java/src/androidx/renderscript/FieldPacker.java
+++ b/support/java/src/androidx/renderscript/FieldPacker.java
@@ -27,7 +27,11 @@
  * reflected code generated by the RS tool chain.  It should not
  * be called directly.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class FieldPacker {
     public FieldPacker(int len) {
         mPos = 0;
diff --git a/support/java/src/androidx/renderscript/Float2.java b/support/java/src/androidx/renderscript/Float2.java
index 01a166b..b743beb 100644
--- a/support/java/src/androidx/renderscript/Float2.java
+++ b/support/java/src/androidx/renderscript/Float2.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript float2 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Float2 {
     public Float2() {
     }
diff --git a/support/java/src/androidx/renderscript/Float3.java b/support/java/src/androidx/renderscript/Float3.java
index bb7932a..63c5c89 100644
--- a/support/java/src/androidx/renderscript/Float3.java
+++ b/support/java/src/androidx/renderscript/Float3.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript float2 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Float3 {
     public Float3() {
     }
diff --git a/support/java/src/androidx/renderscript/Float4.java b/support/java/src/androidx/renderscript/Float4.java
index 8336d9e..d65a1ab 100644
--- a/support/java/src/androidx/renderscript/Float4.java
+++ b/support/java/src/androidx/renderscript/Float4.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript float2 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Float4 {
     public Float4() {
     }
diff --git a/support/java/src/androidx/renderscript/Int2.java b/support/java/src/androidx/renderscript/Int2.java
index fe86fe3..b841f8b 100644
--- a/support/java/src/androidx/renderscript/Int2.java
+++ b/support/java/src/androidx/renderscript/Int2.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript int2 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Int2 {
     public Int2() {
     }
diff --git a/support/java/src/androidx/renderscript/Int3.java b/support/java/src/androidx/renderscript/Int3.java
index bd6fbc7..8ff4dce 100644
--- a/support/java/src/androidx/renderscript/Int3.java
+++ b/support/java/src/androidx/renderscript/Int3.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript int3 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Int3 {
     public Int3() {
     }
diff --git a/support/java/src/androidx/renderscript/Int4.java b/support/java/src/androidx/renderscript/Int4.java
index 91e0b9f..449e996 100644
--- a/support/java/src/androidx/renderscript/Int4.java
+++ b/support/java/src/androidx/renderscript/Int4.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript int4 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Int4 {
     public Int4() {
     }
diff --git a/support/java/src/androidx/renderscript/Long2.java b/support/java/src/androidx/renderscript/Long2.java
index 0871706..76419b5 100644
--- a/support/java/src/androidx/renderscript/Long2.java
+++ b/support/java/src/androidx/renderscript/Long2.java
@@ -22,7 +22,12 @@
 
 /**
  * Class for exposing the native RenderScript long2 type back to the Android system.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Long2 {
     public Long2() {
     }
diff --git a/support/java/src/androidx/renderscript/Long3.java b/support/java/src/androidx/renderscript/Long3.java
index 250b50f..cee3f55 100644
--- a/support/java/src/androidx/renderscript/Long3.java
+++ b/support/java/src/androidx/renderscript/Long3.java
@@ -22,7 +22,12 @@
 
 /**
  * Class for exposing the native RenderScript long3 type back to the Android system.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Long3 {
     public Long3() {
     }
diff --git a/support/java/src/androidx/renderscript/Long4.java b/support/java/src/androidx/renderscript/Long4.java
index 438d34e..2f5e5b9 100644
--- a/support/java/src/androidx/renderscript/Long4.java
+++ b/support/java/src/androidx/renderscript/Long4.java
@@ -22,7 +22,12 @@
 
 /**
  * Class for exposing the native RenderScript long4 type back to the Android system.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Long4 {
     public Long4() {
     }
diff --git a/support/java/src/androidx/renderscript/Matrix2f.java b/support/java/src/androidx/renderscript/Matrix2f.java
index b5c5a08..d2733c4 100644
--- a/support/java/src/androidx/renderscript/Matrix2f.java
+++ b/support/java/src/androidx/renderscript/Matrix2f.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript rs_matrix2x2 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Matrix2f {
 
     /**
diff --git a/support/java/src/androidx/renderscript/Matrix3f.java b/support/java/src/androidx/renderscript/Matrix3f.java
index 699c42b..83435d4 100644
--- a/support/java/src/androidx/renderscript/Matrix3f.java
+++ b/support/java/src/androidx/renderscript/Matrix3f.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript rs_matrix3x3 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Matrix3f {
 
     /**
diff --git a/support/java/src/androidx/renderscript/Matrix4f.java b/support/java/src/androidx/renderscript/Matrix4f.java
index 6a38af8..0addfa0 100644
--- a/support/java/src/androidx/renderscript/Matrix4f.java
+++ b/support/java/src/androidx/renderscript/Matrix4f.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript rs_matrix4x4 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Matrix4f {
 
     /**
diff --git a/support/java/src/androidx/renderscript/RSDriverException.java b/support/java/src/androidx/renderscript/RSDriverException.java
index 11b5be2..514bee0 100644
--- a/support/java/src/androidx/renderscript/RSDriverException.java
+++ b/support/java/src/androidx/renderscript/RSDriverException.java
@@ -20,7 +20,12 @@
 /**
  * Base class for all exceptions thrown by the Android
  * RenderScript
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  */
+@Deprecated
 public class RSDriverException extends RSRuntimeException {
     public RSDriverException(String string) {
         super(string);
diff --git a/support/java/src/androidx/renderscript/RSIllegalArgumentException.java b/support/java/src/androidx/renderscript/RSIllegalArgumentException.java
index 6e7c0e9..13d212d 100644
--- a/support/java/src/androidx/renderscript/RSIllegalArgumentException.java
+++ b/support/java/src/androidx/renderscript/RSIllegalArgumentException.java
@@ -20,7 +20,12 @@
 /**
  * Base class for all exceptions thrown by the Android
  * RenderScript
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  */
+@Deprecated
 public class RSIllegalArgumentException extends RSRuntimeException {
     public RSIllegalArgumentException(String string) {
         super(string);
diff --git a/support/java/src/androidx/renderscript/RSInvalidStateException.java b/support/java/src/androidx/renderscript/RSInvalidStateException.java
index 82cc7c9..f75d63d 100644
--- a/support/java/src/androidx/renderscript/RSInvalidStateException.java
+++ b/support/java/src/androidx/renderscript/RSInvalidStateException.java
@@ -20,7 +20,12 @@
 /**
  * Base class for all exceptions thrown by the Android
  * RenderScript
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  */
+@Deprecated
 public class RSInvalidStateException extends RSRuntimeException {
     public RSInvalidStateException(String string) {
         super(string);
diff --git a/support/java/src/androidx/renderscript/RSRuntimeException.java b/support/java/src/androidx/renderscript/RSRuntimeException.java
index 886cd14..12a3b0f 100644
--- a/support/java/src/androidx/renderscript/RSRuntimeException.java
+++ b/support/java/src/androidx/renderscript/RSRuntimeException.java
@@ -20,7 +20,12 @@
 /**
  * Base class for all exceptions thrown by the Android
  * RenderScript
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  */
+@Deprecated
 public class RSRuntimeException
   extends java.lang.RuntimeException {
     public RSRuntimeException(String string) {
diff --git a/support/java/src/androidx/renderscript/RenderScript.java b/support/java/src/androidx/renderscript/RenderScript.java
index cf80342..b789f2c 100644
--- a/support/java/src/androidx/renderscript/RenderScript.java
+++ b/support/java/src/androidx/renderscript/RenderScript.java
@@ -43,7 +43,12 @@
  * <p>For more information about creating an application that uses RenderScript, read the
  * <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a> developer guide.</p>
  * </div>
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class RenderScript {
     static final String LOG_TAG = "RenderScript_jni";
     static final boolean DEBUG  = false;
@@ -63,20 +68,20 @@
     private Context mApplicationContext;
     private String mNativeLibDir;
 
-    static private String mBlackList = "";
+    static private String mDenyList = "";
      /**
-     * Sets the blackList of Models to only use support lib runtime.
+     * Sets the denylist of Models to only use support lib runtime.
      * Should be used before context create.
      *
-     * @param blackList User provided black list string.
+     * @param denylist User provided denylist string.
      *
      * Format: "(MANUFACTURER1:PRODUCT1:MODEL1), (MANUFACTURER2:PRODUCT2:MODEL2)..."
-     * e.g. : To Blacklist Nexus 7(2013) and Nexus 5.
-     *        mBlackList = "(asus:razor:Nexus 7), (LGE:hammerhead:Nexus 5)";
+     * e.g. : To Denylist Nexus 7(2013) and Nexus 5.
+     *        mDenyList = "(asus:razor:Nexus 7), (LGE:hammerhead:Nexus 5)";
      */
-    static public void setBlackList(String blackList) {
-        if (blackList != null) {
-            mBlackList = blackList;
+    static public void setDenyList(String denyList) {
+        if (denyList != null) {
+            mDenyList = denyList;
         }
     }
      /**
@@ -224,8 +229,8 @@
         }
 
         if (sNative == 1) {
-            // check against the blacklist
-            if (mBlackList.length() > 0) {
+            // check against the denylist
+            if (mDenyList.length() > 0) {
                 String deviceInfo = '(' +
                                     android.os.Build.MANUFACTURER +
                                     ':' +
@@ -233,7 +238,7 @@
                                     ':' +
                                     android.os.Build.MODEL +
                                     ')';
-                if (mBlackList.contains(deviceInfo)) {
+                if (mDenyList.contains(deviceInfo)) {
                     sNative = 0;
                     return false;
                 }
@@ -797,7 +802,7 @@
                 mIncLoaded = true;
             }
             if (mIncCon == 0) {
-                //Create a dummy compat context (synchronous).
+                //Create a placeholder compat context (synchronous).
                 long device = nIncDeviceCreate();
                 mIncCon = nIncContextCreate(device, 0, 0, 0);
             }
@@ -1044,7 +1049,7 @@
 
     long     mContext;
     private boolean mDestroyed = false;
-    //Dummy device & context for Inc Support Lib
+    //Placeholder device & context for Inc Support Lib
     long     mIncCon;
     //indicator of whether inc support lib has been loaded or not.
     boolean  mIncLoaded;
diff --git a/support/java/src/androidx/renderscript/Sampler.java b/support/java/src/androidx/renderscript/Sampler.java
index 57b94d5..2e5ae15 100644
--- a/support/java/src/androidx/renderscript/Sampler.java
+++ b/support/java/src/androidx/renderscript/Sampler.java
@@ -38,7 +38,12 @@
  * created with
  * {@link androidx.renderscript.Allocation#USAGE_GRAPHICS_TEXTURE} is
  * undefined.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Sampler extends BaseObj {
     public enum Value {
         NEAREST (0),
diff --git a/support/java/src/androidx/renderscript/Script.java b/support/java/src/androidx/renderscript/Script.java
index 49c0039..3d4ba01 100644
--- a/support/java/src/androidx/renderscript/Script.java
+++ b/support/java/src/androidx/renderscript/Script.java
@@ -21,7 +21,12 @@
 /**
  * The parent class for all executable scripts. This should not be used by
  * applications.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Script extends BaseObj {
     /**
      * Determine if Incremental Intrinsic Support is needed
@@ -42,17 +47,17 @@
     long getDummyAlloc(Allocation ain) {
         long dInElement = 0;
         long dInType = 0;
-        long dummyAlloc = 0;
+        long placeholderAlloc = 0;
         if (ain != null) {
             Type inType = ain.getType();
             dInElement = inType.getElement().getDummyElement(mRS);
             dInType = inType.getDummyType(mRS, dInElement);
             int xBytesSize = inType.getX() * inType.getElement().getBytesSize();
-            dummyAlloc = mRS.nIncAllocationCreateTyped(ain.getID(mRS), dInType, xBytesSize);
-            ain.setIncAllocID(dummyAlloc);
+            placeholderAlloc = mRS.nIncAllocationCreateTyped(ain.getID(mRS), dInType, xBytesSize);
+            ain.setIncAllocID(placeholderAlloc);
         }
 
-        return dummyAlloc;
+        return placeholderAlloc;
     }
     /**
      * KernelID is an identifier for a Script + root function pair. It is used
@@ -305,7 +310,7 @@
         if (mUseIncSupp) {
             long ainInc = getDummyAlloc(ain);
             long aoutInc = getDummyAlloc(aout);
-            mRS.nScriptForEachClipped(getID(mRS), slot, ainInc, aoutInc, params, sc.xstart, sc.xend, sc.ystart, sc.yend, sc.zstart, sc.zend, mUseIncSupp);        
+            mRS.nScriptForEachClipped(getID(mRS), slot, ainInc, aoutInc, params, sc.xstart, sc.xend, sc.ystart, sc.yend, sc.zstart, sc.zend, mUseIncSupp);
         } else {
             mRS.nScriptForEachClipped(getID(mRS), slot, in_id, out_id, params, sc.xstart, sc.xend, sc.ystart, sc.yend, sc.zstart, sc.zend, mUseIncSupp);
         }
@@ -481,7 +486,7 @@
     public void setVar(int index, BaseObj o) {
         if (mUseIncSupp) {
             long oInc = getDummyAlloc((Allocation)o);
-            mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : oInc, mUseIncSupp);            
+            mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : oInc, mUseIncSupp);
         } else {
             mRS.nScriptSetVarObj(getID(mRS), index, (o == null) ? 0 : o.getID(mRS), mUseIncSupp);
         }
diff --git a/support/java/src/androidx/renderscript/ScriptC.java b/support/java/src/androidx/renderscript/ScriptC.java
index 31201b1..4fd626e 100644
--- a/support/java/src/androidx/renderscript/ScriptC.java
+++ b/support/java/src/androidx/renderscript/ScriptC.java
@@ -32,7 +32,12 @@
 /**
  * The superclass for all user-defined scripts. This is only
  * intended to be used by the generated derived classes.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class ScriptC extends Script {
     private static final String TAG = "ScriptC";
 
diff --git a/support/java/src/androidx/renderscript/ScriptGroup.java b/support/java/src/androidx/renderscript/ScriptGroup.java
index ba8cf4b..f5096e5 100644
--- a/support/java/src/androidx/renderscript/ScriptGroup.java
+++ b/support/java/src/androidx/renderscript/ScriptGroup.java
@@ -40,7 +40,12 @@
  * Grouping kernels together allows for more efficient execution. For example,
  * runtime and compiler optimization can be applied to reduce computation and
  * communication overhead, and to make better use of the CPU and the GPU.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public final class ScriptGroup extends BaseObj {
     //FIXME: Change 23 to the codename when that is decided.
     private static final int MIN_API_VERSION = 23;
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsic.java b/support/java/src/androidx/renderscript/ScriptIntrinsic.java
index cf7b72e..c9a616d 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsic.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsic.java
@@ -23,7 +23,12 @@
  * operations.
  *
  * Not intended for direct use.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public abstract class ScriptIntrinsic extends Script {
     ScriptIntrinsic(long id, RenderScript rs) {
         super(id, rs);
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsic3DLUT.java b/support/java/src/androidx/renderscript/ScriptIntrinsic3DLUT.java
index e7b6a07..5d5bc4c 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsic3DLUT.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsic3DLUT.java
@@ -25,7 +25,11 @@
  * allocation.  The 8 nearest values are sampled and linearly interpolated.  The
  * result is placed in the output.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class ScriptIntrinsic3DLUT extends ScriptIntrinsic {
     private Allocation mLUT;
     private Element mElement;
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicBLAS.java b/support/java/src/androidx/renderscript/ScriptIntrinsicBLAS.java
index 7d8e668..d6acc27 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsicBLAS.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsicBLAS.java
@@ -29,7 +29,11 @@
  *
  * For detailed description of BLAS, please refer to http://www.netlib.org/blas/
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public final class ScriptIntrinsicBLAS extends ScriptIntrinsic {
     private Allocation mLUT;
     private static final int INTRINSIC_API_LEVEL = 23;
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicBlend.java b/support/java/src/androidx/renderscript/ScriptIntrinsicBlend.java
index c7e174d..534de8a 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsicBlend.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsicBlend.java
@@ -20,7 +20,12 @@
 /**
  * Intrinsic kernels for blending two
  * {@link androidx.renderscript.Allocation} objects.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class ScriptIntrinsicBlend extends ScriptIntrinsic {
     // API level for the intrinsic
     private static final int INTRINSIC_API_LEVEL = 19;
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicBlur.java b/support/java/src/androidx/renderscript/ScriptIntrinsicBlur.java
index 4024416..09114cd 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsicBlur.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsicBlur.java
@@ -24,8 +24,11 @@
  * Intrinsic Gausian blur filter. Applies a gaussian blur of the
  * specified radius to all elements of an allocation.
  *
- *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class ScriptIntrinsicBlur extends ScriptIntrinsic {
     private final float[] mValues = new float[9];
     private Allocation mInput;
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicColorMatrix.java b/support/java/src/androidx/renderscript/ScriptIntrinsicColorMatrix.java
index a0a247d..cb17244 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsicColorMatrix.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsicColorMatrix.java
@@ -26,7 +26,12 @@
  * result by the 4x4 color matrix as performed by
  * rsMatrixMultiply() and writing it to the output after
  * conversion back to {@link Element#U8_4}.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class ScriptIntrinsicColorMatrix extends ScriptIntrinsic {
     private final Matrix4f mMatrix = new Matrix4f();
     private final Float4 mAdd = new Float4();
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve3x3.java b/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve3x3.java
index d4e57b0..87149b3 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve3x3.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve3x3.java
@@ -21,7 +21,11 @@
 /**
  * Intrinsic for applying a 3x3 convolve to an allocation.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class ScriptIntrinsicConvolve3x3 extends ScriptIntrinsic {
     private final float[] mValues = new float[9];
     private Allocation mInput;
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve5x5.java b/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve5x5.java
index 298596e..7105847 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve5x5.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsicConvolve5x5.java
@@ -21,7 +21,11 @@
 /**
  * Intrinsic for applying a 5x5 convolve to an allocation.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class ScriptIntrinsicConvolve5x5 extends ScriptIntrinsic {
     private final float[] mValues = new float[25];
     private Allocation mInput;
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicHistogram.java b/support/java/src/androidx/renderscript/ScriptIntrinsicHistogram.java
index 3437f2c..821a1de 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsicHistogram.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsicHistogram.java
@@ -21,8 +21,11 @@
 /**
  * Intrinsic Histogram filter.
  *
- *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class ScriptIntrinsicHistogram extends ScriptIntrinsic {
     private Allocation mOut;
     // API level for the intrinsic
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicLUT.java b/support/java/src/androidx/renderscript/ScriptIntrinsicLUT.java
index 6434903..0418334 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsicLUT.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsicLUT.java
@@ -23,7 +23,12 @@
  * channel of the input has an independant lookup table. The
  * tables are 256 entries in size and can cover the full value
  * range of {@link Element#U8_4}.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class ScriptIntrinsicLUT extends ScriptIntrinsic {
     private final Matrix4f mMatrix = new Matrix4f();
     private Allocation mTables;
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicResize.java b/support/java/src/androidx/renderscript/ScriptIntrinsicResize.java
index c3450f1..6ef32a1 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsicResize.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsicResize.java
@@ -20,7 +20,12 @@
 
 /**
  * Intrinsic for performing a resize of a 2D allocation.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  */
+@Deprecated
 public class ScriptIntrinsicResize extends ScriptIntrinsic {
     private Allocation mInput;
     // API level for the intrinsic
diff --git a/support/java/src/androidx/renderscript/ScriptIntrinsicYuvToRGB.java b/support/java/src/androidx/renderscript/ScriptIntrinsicYuvToRGB.java
index 8749398..0a09074 100644
--- a/support/java/src/androidx/renderscript/ScriptIntrinsicYuvToRGB.java
+++ b/support/java/src/androidx/renderscript/ScriptIntrinsicYuvToRGB.java
@@ -23,7 +23,12 @@
  * The input allocation is supplied in NV21 format as a U8
  * element type. The output is RGBA, the alpha channel will be
  * set to 255.
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  */
+@Deprecated
 public class ScriptIntrinsicYuvToRGB extends ScriptIntrinsic {
     private Allocation mInput;
     // API level for the intrinsic
diff --git a/support/java/src/androidx/renderscript/Short2.java b/support/java/src/androidx/renderscript/Short2.java
index f06d746..679ea8a 100644
--- a/support/java/src/androidx/renderscript/Short2.java
+++ b/support/java/src/androidx/renderscript/Short2.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript Short2 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Short2 {
     public Short2() {
     }
diff --git a/support/java/src/androidx/renderscript/Short3.java b/support/java/src/androidx/renderscript/Short3.java
index fbf9a89..e6e76c2 100644
--- a/support/java/src/androidx/renderscript/Short3.java
+++ b/support/java/src/androidx/renderscript/Short3.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript short3 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Short3 {
     public Short3() {
     }
diff --git a/support/java/src/androidx/renderscript/Short4.java b/support/java/src/androidx/renderscript/Short4.java
index 1e479d2..0826e5f 100644
--- a/support/java/src/androidx/renderscript/Short4.java
+++ b/support/java/src/androidx/renderscript/Short4.java
@@ -23,7 +23,11 @@
 /**
  * Class for exposing the native RenderScript short4 type back to the Android system.
  *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Short4 {
     public Short4() {
     }
diff --git a/support/java/src/androidx/renderscript/Type.java b/support/java/src/androidx/renderscript/Type.java
index cec834c..a0c225d 100644
--- a/support/java/src/androidx/renderscript/Type.java
+++ b/support/java/src/androidx/renderscript/Type.java
@@ -50,7 +50,12 @@
  * <a href="{@docRoot}guide/topics/renderscript/index.html">RenderScript</a>
  * developer guide.</p>
  * </div>
+ *
+ * @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a
+ * href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration
+ * guide</a> for the proposed alternatives.
  **/
+@Deprecated
 public class Type extends BaseObj {
     int mDimX;
     int mDimY;
@@ -190,7 +195,7 @@
     }
 
     /*
-     * Get an identical dummy Type for Compat Context
+     * Get an identical placeholder Type for Compat Context
      *
      */
     public long getDummyType(RenderScript mRS, long eid) {
diff --git a/support/jni/Android.bp b/support/jni/Android.bp
index 4f4fef8..5a86d46 100644
--- a/support/jni/Android.bp
+++ b/support/jni/Android.bp
@@ -1,3 +1,7 @@
+package {
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
 cc_library_shared {
     name: "libRSSupportIO",
     defaults: ["rs_support_defaults"],
@@ -23,6 +27,8 @@
         "-DRS_COMPATIBILITY_LIB",
     ],
 
+    header_libs: ["jni_headers"],
+
     shared_libs: [
         "libandroid",
         "libdl",
@@ -43,6 +49,9 @@
 
     srcs: ["android_renderscript_RenderScript.cpp"],
 
+    header_libs: ["jni_headers"],
+    export_header_lib_headers: ["jni_headers"],
+
     shared_libs: [
         "libdl",
         "libjnigraphics",
diff --git a/support/jni/android_renderscript_RenderScript.cpp b/support/jni/android_renderscript_RenderScript.cpp
index b65243c..c2911be 100644
--- a/support/jni/android_renderscript_RenderScript.cpp
+++ b/support/jni/android_renderscript_RenderScript.cpp
@@ -2129,7 +2129,7 @@
 }
 
 // -----------------------------------
-// To create/destroy a dummy context
+// To create/destroy a placeholder context
 static void
 nIncObjDestroy(JNIEnv *_env, jobject _this, jlong con, jlong obj)
 {
@@ -2177,7 +2177,7 @@
 }
 
 // -----------------------------------
-// Create dummy Element
+// Create placeholder Element
 static jlong
 nIncElementCreate(JNIEnv *_env, jobject _this, jlong con, jlong type, jint kind, jboolean norm, jint size)
 {
@@ -2187,7 +2187,7 @@
                                                           (RsDataKind)kind, norm, size);
 }
 // -----------------------------------
-// Create dummy Type
+// Create placeholder Type
 static jlong
 nIncTypeCreate(JNIEnv *_env, jobject _this, jlong con, jlong eid,
             jint dimx, jint dimy, jint dimz, jboolean mips, jboolean faces, jint yuv)
diff --git a/tests/cpp_api/cpp-globalguard/Android.mk b/tests/cpp_api/cpp-globalguard/Android.mk
index 0f98f77..88a10c9 100644
--- a/tests/cpp_api/cpp-globalguard/Android.mk
+++ b/tests/cpp_api/cpp-globalguard/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE:= rstest-cpp-globalguard
+LOCAL_LICENSE_KINDS:= SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS:= notice
 
 LOCAL_SDK_VERSION := 21
 LOCAL_NDK_STL_VARIANT := c++_static
diff --git a/tests/cpp_api/cppallocation/Android.mk b/tests/cpp_api/cppallocation/Android.mk
index 3b7a7d7..d2c7cbc 100644
--- a/tests/cpp_api/cppallocation/Android.mk
+++ b/tests/cpp_api/cppallocation/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE:= rstest-cppallocation
+LOCAL_LICENSE_KINDS:= SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS:= notice
 
 LOCAL_SDK_VERSION := 21
 LOCAL_NDK_STL_VARIANT := c++_static
diff --git a/tests/cpp_api/cppbasic-getpointer/Android.mk b/tests/cpp_api/cppbasic-getpointer/Android.mk
index c50db0d..963a3e4 100644
--- a/tests/cpp_api/cppbasic-getpointer/Android.mk
+++ b/tests/cpp_api/cppbasic-getpointer/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE:= rstest-compute-getpointer
+LOCAL_LICENSE_KINDS:= SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS:= notice
 
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
diff --git a/tests/cpp_api/cppbasic-shared/Android.mk b/tests/cpp_api/cppbasic-shared/Android.mk
index 3ec3035..ca91745 100644
--- a/tests/cpp_api/cppbasic-shared/Android.mk
+++ b/tests/cpp_api/cppbasic-shared/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE:= rstest-compute-shared
+LOCAL_LICENSE_KINDS:= SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS:= notice
 
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
diff --git a/tests/cpp_api/cppbasic/Android.mk b/tests/cpp_api/cppbasic/Android.mk
index 979d364..a1f090f 100644
--- a/tests/cpp_api/cppbasic/Android.mk
+++ b/tests/cpp_api/cppbasic/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE:= rstest-compute
+LOCAL_LICENSE_KINDS:= SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS:= notice
 
 LOCAL_SDK_VERSION := 21
 LOCAL_NDK_STL_VARIANT := c++_static
diff --git a/tests/cpp_api/cppf16/Android.mk b/tests/cpp_api/cppf16/Android.mk
index b49dc1d..eca91db 100644
--- a/tests/cpp_api/cppf16/Android.mk
+++ b/tests/cpp_api/cppf16/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE:= rstest-cppf16
+LOCAL_LICENSE_KINDS:= SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS:= notice
 
 LOCAL_NDK_STL_VARIANT := c++_static
 
diff --git a/tests/cpp_api/cppstrided/Android.mk b/tests/cpp_api/cppstrided/Android.mk
index e88f6cf..e0e03b3 100644
--- a/tests/cpp_api/cppstrided/Android.mk
+++ b/tests/cpp_api/cppstrided/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE:= rstest-cppstrided
+LOCAL_LICENSE_KINDS:= SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS:= notice
 
 LOCAL_SDK_VERSION := 21
 LOCAL_NDK_STL_VARIANT := c++_static
diff --git a/tests/cpp_api/latency/Android.mk b/tests/cpp_api/latency/Android.mk
index 59d49f5..16557f4 100644
--- a/tests/cpp_api/latency/Android.mk
+++ b/tests/cpp_api/latency/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE:= rstest-latency
+LOCAL_LICENSE_KINDS:= SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS:= notice
 
 LOCAL_SDK_VERSION := 21
 LOCAL_NDK_STL_VARIANT := c++_static
diff --git a/tests/cpp_api/typecheck/Android.mk b/tests/cpp_api/typecheck/Android.mk
index 66ad645..82f92ea 100644
--- a/tests/cpp_api/typecheck/Android.mk
+++ b/tests/cpp_api/typecheck/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE:= rstest-typecheck
+LOCAL_LICENSE_KINDS:= SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS:= notice
 
 LOCAL_SDK_VERSION := 21
 LOCAL_NDK_STL_VARIANT := c++_static
diff --git a/tests/java_api/Android.mk b/tests/java_api/Android.mk
index d070b87..54845a1 100644
--- a/tests/java_api/Android.mk
+++ b/tests/java_api/Android.mk
@@ -36,7 +36,11 @@
 
 include $(BUILD_SYSTEM)/tasks/tools/package-modules.mk
 
+.PHONY: RSUnbundledTests19
+RSUnbundledTests19: $(my_package_zip)
+
 $(call dist-for-goals,RSUnbundledTests,$(my_package_zip):$(my_package_name).zip)
+$(call dist-for-goals,RSUnbundledTests19,$(my_package_zip):$(my_package_name).zip)
 
 
 # RSTests
diff --git a/tests/java_api/Balls/Android.mk b/tests/java_api/Balls/Android.mk
index e1cea04..409c735 100644
--- a/tests/java_api/Balls/Android.mk
+++ b/tests/java_api/Balls/Android.mk
@@ -22,6 +22,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := RsBalls
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := 14
 
 include $(BUILD_PACKAGE)
diff --git a/tests/java_api/CannyLive/Android.mk b/tests/java_api/CannyLive/Android.mk
index 9481365..54aeb00 100644
--- a/tests/java_api/CannyLive/Android.mk
+++ b/tests/java_api/CannyLive/Android.mk
@@ -28,5 +28,7 @@
 LOCAL_SDK_VERSION := current
 
 LOCAL_PACKAGE_NAME := CannyLive
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 include $(BUILD_PACKAGE)
diff --git a/tests/java_api/ComputeBenchmark/Android.mk b/tests/java_api/ComputeBenchmark/Android.mk
index e3f4291..a3ca785 100644
--- a/tests/java_api/ComputeBenchmark/Android.mk
+++ b/tests/java_api/ComputeBenchmark/Android.mk
@@ -23,6 +23,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := RsComputeBenchmark
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_MIN_SDK_VERSION := 17
 
diff --git a/tests/java_api/ComputePerf/Android.mk b/tests/java_api/ComputePerf/Android.mk
index 39858dc..163e7dd 100644
--- a/tests/java_api/ComputePerf/Android.mk
+++ b/tests/java_api/ComputePerf/Android.mk
@@ -23,6 +23,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := RsComputePerf
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_MIN_SDK_VERSION := 19
 
diff --git a/tests/java_api/GenImages/Android.mk b/tests/java_api/GenImages/Android.mk
index 18728f6..d3e00ae 100644
--- a/tests/java_api/GenImages/Android.mk
+++ b/tests/java_api/GenImages/Android.mk
@@ -23,6 +23,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := RsGenImages
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_MIN_SDK_VERSION := 14
 
diff --git a/tests/java_api/HealingBrush/Android.mk b/tests/java_api/HealingBrush/Android.mk
index 89ec9ad..4ca1251 100644
--- a/tests/java_api/HealingBrush/Android.mk
+++ b/tests/java_api/HealingBrush/Android.mk
@@ -25,6 +25,8 @@
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-v8-renderscript
 
 LOCAL_PACKAGE_NAME := HealingBrush
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_RENDERSCRIPT_TARGET_API := 19
 LOCAL_RENDERSCRIPT_COMPATIBILITY := 18
diff --git a/tests/java_api/HelloComputeNDK/Android.mk b/tests/java_api/HelloComputeNDK/Android.mk
index 2f5bd17..5fe2ffd 100644
--- a/tests/java_api/HelloComputeNDK/Android.mk
+++ b/tests/java_api/HelloComputeNDK/Android.mk
@@ -25,6 +25,8 @@
 LOCAL_CFLAGS := -Werror -Wall -Wextra
 
 LOCAL_PACKAGE_NAME := HelloComputeNDK
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 LOCAL_JNI_SHARED_LIBRARIES := libhellocomputendk
diff --git a/tests/java_api/HelloComputeNDK/libhellocomputendk/Android.mk b/tests/java_api/HelloComputeNDK/libhellocomputendk/Android.mk
index b9fab0b..d0a8d88 100644
--- a/tests/java_api/HelloComputeNDK/libhellocomputendk/Android.mk
+++ b/tests/java_api/HelloComputeNDK/libhellocomputendk/Android.mk
@@ -20,13 +20,14 @@
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 
 LOCAL_MODULE := libhellocomputendk
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_MODULE_TAGS := tests
 LOCAL_SRC_FILES := helloComputeNDK.cpp mono.rscript
 
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
 LOCAL_CFLAGS := -Wall -Werror
 LOCAL_LDFLAGS := -Wl,-Bsymbolic
+LOCAL_HEADER_LIBRARIES := jni_headers
 LOCAL_SHARED_LIBRARIES := libdl liblog libjnigraphics
 LOCAL_STATIC_LIBRARIES := libRScpp_static
 
diff --git a/tests/java_api/ImageProcessing/Android.mk b/tests/java_api/ImageProcessing/Android.mk
index 2fcb8a4..5ac0d15 100644
--- a/tests/java_api/ImageProcessing/Android.mk
+++ b/tests/java_api/ImageProcessing/Android.mk
@@ -27,6 +27,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := ImageProcessing
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_MIN_SDK_VERSION := 23
 
diff --git a/tests/java_api/ImageProcessing2/Android.mk b/tests/java_api/ImageProcessing2/Android.mk
index 8cf7a5a..7165cc3 100644
--- a/tests/java_api/ImageProcessing2/Android.mk
+++ b/tests/java_api/ImageProcessing2/Android.mk
@@ -25,6 +25,8 @@
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-v8-renderscript
 
 LOCAL_PACKAGE_NAME := ImageProcessing2
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_RENDERSCRIPT_TARGET_API := 18
 LOCAL_RENDERSCRIPT_COMPATIBILITY := 18
diff --git a/tests/java_api/ImageProcessing_jb/Android.mk b/tests/java_api/ImageProcessing_jb/Android.mk
index 4271c3c..71669e7 100644
--- a/tests/java_api/ImageProcessing_jb/Android.mk
+++ b/tests/java_api/ImageProcessing_jb/Android.mk
@@ -27,6 +27,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := ImageProcessingJB
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 include $(BUILD_PACKAGE)
diff --git a/tests/java_api/ImageProcessing_jb/AndroidManifest.xml b/tests/java_api/ImageProcessing_jb/AndroidManifest.xml
index 5a61312..ea3d7ef 100644
--- a/tests/java_api/ImageProcessing_jb/AndroidManifest.xml
+++ b/tests/java_api/ImageProcessing_jb/AndroidManifest.xml
@@ -8,13 +8,15 @@
                  android:hardwareAccelerated="true"
                  android:theme="@android:style/Theme.Holo.Light">
         <uses-library android:name="android.test.runner" />
-        <activity android:name="ImageProcessingActivityJB">
+        <activity android:name="ImageProcessingActivityJB"
+                  android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
             </intent-filter>
         </activity>
 
-        <activity class=".IPControlsJB" android:name="IPControlsJB">
+        <activity class=".IPControlsJB" android:name="IPControlsJB"
+                  android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
diff --git a/tests/java_api/LatencyBenchmark/Android.mk b/tests/java_api/LatencyBenchmark/Android.mk
index 791a362..8df2d05 100644
--- a/tests/java_api/LatencyBenchmark/Android.mk
+++ b/tests/java_api/LatencyBenchmark/Android.mk
@@ -25,6 +25,8 @@
 LOCAL_RENDERSCRIPT_TARGET_API := 23
 
 LOCAL_PACKAGE_NAME := RsLatencyBenchmark
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_MIN_SDK_VERSION := 23
 
diff --git a/tests/java_api/LivePreview/Android.mk b/tests/java_api/LivePreview/Android.mk
index 416853f..a1cbe5f 100644
--- a/tests/java_api/LivePreview/Android.mk
+++ b/tests/java_api/LivePreview/Android.mk
@@ -22,6 +22,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := PreviewRS
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 include $(BUILD_PACKAGE)
diff --git a/tests/java_api/MathErr/Android.mk b/tests/java_api/MathErr/Android.mk
index 40f38f3..1fae614 100644
--- a/tests/java_api/MathErr/Android.mk
+++ b/tests/java_api/MathErr/Android.mk
@@ -23,6 +23,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := RsMathErr
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_MIN_SDK_VERSION := 19
 
diff --git a/tests/java_api/RSTestBackward/Android.mk b/tests/java_api/RSTestBackward/Android.mk
index d253ee5..b3111a6 100644
--- a/tests/java_api/RSTestBackward/Android.mk
+++ b/tests/java_api/RSTestBackward/Android.mk
@@ -18,6 +18,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_PACKAGE_NAME := RSTestBackward
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_MODULE_TAGS := tests
 
@@ -34,4 +36,3 @@
 LOCAL_SDK_VERSION := current
 
 include $(BUILD_PACKAGE)
-
diff --git a/tests/java_api/RSTestBackward19/Android.mk b/tests/java_api/RSTestBackward19/Android.mk
index 15da2d5..5e56346 100644
--- a/tests/java_api/RSTestBackward19/Android.mk
+++ b/tests/java_api/RSTestBackward19/Android.mk
@@ -27,6 +27,8 @@
 LOCAL_MIN_SDK_VERSION := 17
 LOCAL_SDK_VERSION := current
 LOCAL_PACKAGE_NAME := RSTestBackward19
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 my_rs_unit_tests_path := ../RSUnitTests/src/com/android/rs/unittest
 LOCAL_SRC_FILES :=\
     $(call all-java-files-under,src)\
@@ -105,4 +107,3 @@
 include $(BUILD_PACKAGE)
 
 my_rs_unit_tests_path :=
-
diff --git a/tests/java_api/RSTestForward/21.1.2/Android.mk b/tests/java_api/RSTestForward/21.1.2/Android.mk
index f67fbbd..9adce23 100644
--- a/tests/java_api/RSTestForward/21.1.2/Android.mk
+++ b/tests/java_api/RSTestForward/21.1.2/Android.mk
@@ -31,6 +31,8 @@
 LOCAL_COMPATIBILITY_SUITE := device-tests
 LOCAL_RENDERSCRIPT_TARGET_API := current
 LOCAL_PACKAGE_NAME := RSTestForward_21_1_2
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 my_rs_path := $(TOP)/prebuilts/renderscript/host/linux-x86/21.1.2
 LOCAL_RENDERSCRIPT_CC := $(my_rs_path)/bin/llvm-rs-cc
diff --git a/tests/java_api/RSTestForward/22.0.1/Android.mk b/tests/java_api/RSTestForward/22.0.1/Android.mk
index 34ccb5f..0479a36 100644
--- a/tests/java_api/RSTestForward/22.0.1/Android.mk
+++ b/tests/java_api/RSTestForward/22.0.1/Android.mk
@@ -31,6 +31,8 @@
 LOCAL_COMPATIBILITY_SUITE := device-tests
 LOCAL_RENDERSCRIPT_TARGET_API := current
 LOCAL_PACKAGE_NAME := RSTestForward_22_0_1
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 my_rs_path := $(TOP)/prebuilts/renderscript/host/linux-x86/22.0.1
 LOCAL_RENDERSCRIPT_CC := $(my_rs_path)/bin/llvm-rs-cc
diff --git a/tests/java_api/RSTestForward/23.0.3/Android.mk b/tests/java_api/RSTestForward/23.0.3/Android.mk
index 861541b..ddafbd4 100644
--- a/tests/java_api/RSTestForward/23.0.3/Android.mk
+++ b/tests/java_api/RSTestForward/23.0.3/Android.mk
@@ -31,6 +31,8 @@
 LOCAL_COMPATIBILITY_SUITE := device-tests
 LOCAL_RENDERSCRIPT_TARGET_API := current
 LOCAL_PACKAGE_NAME := RSTestForward_23_0_3
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 my_rs_path := $(TOP)/prebuilts/renderscript/host/linux-x86/23.0.3
 LOCAL_RENDERSCRIPT_CC := $(my_rs_path)/bin/llvm-rs-cc
diff --git a/tests/java_api/RSTestForward/24.0.3/Android.mk b/tests/java_api/RSTestForward/24.0.3/Android.mk
index 3e81caa..6148657 100644
--- a/tests/java_api/RSTestForward/24.0.3/Android.mk
+++ b/tests/java_api/RSTestForward/24.0.3/Android.mk
@@ -31,6 +31,8 @@
 LOCAL_COMPATIBILITY_SUITE := device-tests
 LOCAL_RENDERSCRIPT_TARGET_API := current
 LOCAL_PACKAGE_NAME := RSTestForward_24_0_3
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 my_rs_path := $(TOP)/prebuilts/renderscript/host/linux-x86/24.0.3
 LOCAL_RENDERSCRIPT_CC := $(my_rs_path)/bin/llvm-rs-cc
diff --git a/tests/java_api/RSTestForward/25.0.2/Android.mk b/tests/java_api/RSTestForward/25.0.2/Android.mk
index 127f29d..df491a1 100644
--- a/tests/java_api/RSTestForward/25.0.2/Android.mk
+++ b/tests/java_api/RSTestForward/25.0.2/Android.mk
@@ -31,6 +31,8 @@
 LOCAL_COMPATIBILITY_SUITE := device-tests
 LOCAL_RENDERSCRIPT_TARGET_API := current
 LOCAL_PACKAGE_NAME := RSTestForward_25_0_2
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 my_rs_path := $(TOP)/prebuilts/renderscript/host/linux-x86/25.0.2
 LOCAL_RENDERSCRIPT_CC := $(my_rs_path)/bin/llvm-rs-cc
diff --git a/tests/java_api/RSTest_CompatLib/Android.mk b/tests/java_api/RSTest_CompatLib/Android.mk
index 6f8e247..2df8904 100644
--- a/tests/java_api/RSTest_CompatLib/Android.mk
+++ b/tests/java_api/RSTest_CompatLib/Android.mk
@@ -18,6 +18,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_PACKAGE_NAME := RSTest_Compat
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_MODULE_TAGS := tests
 
@@ -39,4 +41,3 @@
 LOCAL_RENDERSCRIPT_FLAGS := -rs-package-name=androidx.renderscript
 
 include $(BUILD_PACKAGE)
-
diff --git a/tests/java_api/RSTest_CompatLib19/Android.mk b/tests/java_api/RSTest_CompatLib19/Android.mk
index 80596d0..4d200f2 100644
--- a/tests/java_api/RSTest_CompatLib19/Android.mk
+++ b/tests/java_api/RSTest_CompatLib19/Android.mk
@@ -21,6 +21,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_PACKAGE_NAME := RSTest_Compat19
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_MODULE_TAGS := tests
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
@@ -111,4 +113,3 @@
 include $(BUILD_PACKAGE)
 
 my_rs_unit_tests_path :=
-
diff --git a/tests/java_api/RSTest_CompatLibLegacy/Android.mk b/tests/java_api/RSTest_CompatLibLegacy/Android.mk
index 66df528..537cff9 100644
--- a/tests/java_api/RSTest_CompatLibLegacy/Android.mk
+++ b/tests/java_api/RSTest_CompatLibLegacy/Android.mk
@@ -27,6 +27,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := RSTest_CompatLegacy
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_STATIC_JAVA_LIBRARIES := \
     android-support-v8-renderscript
diff --git a/tests/java_api/RSUnitTests/supportlibonlysrc/com/android/rs/unittest/apitest.rscript b/tests/java_api/RSUnitTests/supportlibonlysrc/com/android/rs/unittest/apitest.rscript
index b0829a3..4e2dd4f 100644
--- a/tests/java_api/RSUnitTests/supportlibonlysrc/com/android/rs/unittest/apitest.rscript
+++ b/tests/java_api/RSUnitTests/supportlibonlysrc/com/android/rs/unittest/apitest.rscript
@@ -132,7 +132,7 @@
 rs_matrix3x3 m3x3;
 rs_matrix4x4 m4x4;
 
-int RS_KERNEL dummyKernel(int v) { return v; }
+int RS_KERNEL testKernel(int v) { return v; }
 
 // This function just checks that all of the called functions are
 // able to be linked. It is not intended to be executed!
@@ -1137,7 +1137,7 @@
     rsSendToClientBlocking(0);
     rsSendToClientBlocking(0, NULL, 0);
 
-    rsForEach(dummyKernel, allocNonNull, allocNonNull);
+    rsForEach(testKernel, allocNonNull, allocNonNull);
 
     // rs_debug.rsh
     rsDebug("", f);
diff --git a/tests/java_api/RSUnitTests/supportlibsrc_gen/com/android/rs/unittest/apitest.rscript b/tests/java_api/RSUnitTests/supportlibsrc_gen/com/android/rs/unittest/apitest.rscript
index 28f6c8f..2ebdf7a 100644
--- a/tests/java_api/RSUnitTests/supportlibsrc_gen/com/android/rs/unittest/apitest.rscript
+++ b/tests/java_api/RSUnitTests/supportlibsrc_gen/com/android/rs/unittest/apitest.rscript
@@ -134,7 +134,7 @@
 rs_matrix3x3 m3x3;
 rs_matrix4x4 m4x4;
 
-int RS_KERNEL dummyKernel(int v) { return v; }
+int RS_KERNEL testKernel(int v) { return v; }
 
 // This function just checks that all of the called functions are
 // able to be linked. It is not intended to be executed!
@@ -1139,7 +1139,7 @@
     rsSendToClientBlocking(0);
     rsSendToClientBlocking(0, NULL, 0);
 
-    rsForEach(dummyKernel, allocNonNull, allocNonNull);
+    rsForEach(testKernel, allocNonNull, allocNonNull);
 
     // rs_debug.rsh
     rsDebug("", f);
diff --git a/tests/java_api/Refocus/Android.mk b/tests/java_api/Refocus/Android.mk
index 95e1fb9..9635005 100644
--- a/tests/java_api/Refocus/Android.mk
+++ b/tests/java_api/Refocus/Android.mk
@@ -25,6 +25,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := Refocus
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SDK_VERSION := current
 LOCAL_RENDERSCRIPT_TARGET_API := 21
diff --git a/tests/java_api/Refocus/dataExtraction/RefocusTestTimingProcess.txt b/tests/java_api/Refocus/dataExtraction/RefocusTestTimingProcess.txt
index 98460a4..1d82453 100644
--- a/tests/java_api/Refocus/dataExtraction/RefocusTestTimingProcess.txt
+++ b/tests/java_api/Refocus/dataExtraction/RefocusTestTimingProcess.txt
@@ -26,7 +26,7 @@
 		…..logs 2…..

 		3.

 		…..logs 3…..

-		N5 (you have to put this dummy line here. The script is not perfect and feel free to change)

+		N5 (you have to put this placeholder line here. The script is not perfect and feel free to change)

 

 

 3. Put the file “extract_ave.sh” and “extract_data.sh” in the same directory as the file N5.txt

diff --git a/tests/java_api/Refocus/src/com/android/rs/test/layered_filter_fast_d1new.rscript b/tests/java_api/Refocus/src/com/android/rs/test/layered_filter_fast_d1new.rscript
index 750e4ee..9a63ac6 100644
--- a/tests/java_api/Refocus/src/com/android/rs/test/layered_filter_fast_d1new.rscript
+++ b/tests/java_api/Refocus/src/com/android/rs/test/layered_filter_fast_d1new.rscript
@@ -30,7 +30,6 @@
 // UnpackInputImage, ComputeLayerMatteBehindFocalDepth, ComputeIntegralImageForLayerBehindFocalDepth,
 // FilterLayerBehindFocalDepth, updateSharpImageUsingFuzzyImage, ComputeLayerMatteInFrontOfFocalDepth,
 // FilterLayerInFrontOfFocalDepth
-// double cpuDummy;
 
 // Image size of padded images: g_sharp_image and g_fuzzy_image.
 // Float4 that stores the image size info: 1. width, 2. height, 3. margin
diff --git a/tests/java_api/RsBLAS_Benchmark/Android.bp b/tests/java_api/RsBLAS_Benchmark/Android.bp
new file mode 100644
index 0000000..e5a088e
--- /dev/null
+++ b/tests/java_api/RsBLAS_Benchmark/Android.bp
@@ -0,0 +1,33 @@
+//
+// Copyright (C) 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package {
+    // See: http://go/android-license-faq
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+android_test {
+    name: "RsBlasBenchmark",
+    static_libs: ["androidx.test.rules"],
+    libs: [
+        "android.test.runner.stubs",
+        "android.test.base.stubs",
+    ],
+    test_suites: ["device-tests"],
+    srcs: ["src/**/*.java"],
+    sdk_version: "current",
+    jni_libs: ["libgemmdata"],
+}
diff --git a/tests/java_api/RsBLAS_Benchmark/Android.mk b/tests/java_api/RsBLAS_Benchmark/Android.mk
deleted file mode 100644
index dccc342..0000000
--- a/tests/java_api/RsBLAS_Benchmark/Android.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.rules
-LOCAL_JAVA_LIBRARIES := android.test.runner.stubs android.test.base.stubs
-
-LOCAL_MODULE_TAGS := tests
-LOCAL_COMPATIBILITY_SUITE += device-tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src) \
-		   $(call all-renderscript-files-under, src)
-
-LOCAL_PACKAGE_NAME := RsBlasBenchmark
-LOCAL_SDK_VERSION := current
-LOCAL_JNI_SHARED_LIBRARIES := libgemmdata
-
-include $(BUILD_PACKAGE)
-include $(LOCAL_PATH)/libsgemm/Android.mk
diff --git a/tests/java_api/RsBLAS_Benchmark/AndroidManifest.xml b/tests/java_api/RsBLAS_Benchmark/AndroidManifest.xml
index 38a2c93..87f29b8 100644
--- a/tests/java_api/RsBLAS_Benchmark/AndroidManifest.xml
+++ b/tests/java_api/RsBLAS_Benchmark/AndroidManifest.xml
@@ -22,12 +22,14 @@
     <application android:label="RsBlasBenchmark"
                  android:hardwareAccelerated="true">
         <uses-library android:name="android.test.runner" />
-        <activity android:name="BlasBenchmark">
+        <activity android:name="BlasBenchmark"
+                  android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
             </intent-filter>
         </activity>
-        <activity class=".BlasControls" android:name="BlasControls">
+        <activity class=".BlasControls" android:name="BlasControls"
+                  android:exported="true">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
diff --git a/tests/java_api/RsBLAS_Benchmark/libsgemm/Android.bp b/tests/java_api/RsBLAS_Benchmark/libsgemm/Android.bp
new file mode 100644
index 0000000..9e4b7e2
--- /dev/null
+++ b/tests/java_api/RsBLAS_Benchmark/libsgemm/Android.bp
@@ -0,0 +1,29 @@
+// Copyright (C) 2015 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+//
+// This is the shared library included by the JNI test app.
+//
+
+package {
+    // See: http://go/android-license-faq
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_test_library {
+    name: "libgemmdata",
+    srcs: ["test_data.cpp"],
+    sdk_version: "current",
+    header_libs: ["jni_headers"],
+}
diff --git a/tests/java_api/RsBLAS_Benchmark/libsgemm/Android.mk b/tests/java_api/RsBLAS_Benchmark/libsgemm/Android.mk
deleted file mode 100644
index 6c86873..0000000
--- a/tests/java_api/RsBLAS_Benchmark/libsgemm/Android.mk
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-#
-# This is the shared library included by the JNI test app.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libgemmdata
-LOCAL_MODULE_TAGS := tests
-LOCAL_SRC_FILES := test_data.cpp
-LOCAL_SDK_VERSION := current
-
-LOCAL_CFLAGS := -Wall -Werror
-LOCAL_C_INCLUDES := $(JNI_H_INCLUDE)
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/tests/java_api/RsCameraDemo/Android.mk b/tests/java_api/RsCameraDemo/Android.mk
index 8e9c269..fd9daf9 100644
--- a/tests/java_api/RsCameraDemo/Android.mk
+++ b/tests/java_api/RsCameraDemo/Android.mk
@@ -23,5 +23,7 @@
 LOCAL_SDK_VERSION := current
 
 LOCAL_PACKAGE_NAME := RsCameraDemo
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 include $(BUILD_PACKAGE)
diff --git a/tests/java_api/RsMinimalTest/Android.mk b/tests/java_api/RsMinimalTest/Android.mk
index 74c4966..65cba1b 100644
--- a/tests/java_api/RsMinimalTest/Android.mk
+++ b/tests/java_api/RsMinimalTest/Android.mk
@@ -26,7 +26,8 @@
 LOCAL_SDK_VERSION := 26
 
 LOCAL_PACKAGE_NAME := RsMinimalTest
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_COMPATIBILITY_SUITE := device-tests
 
 include $(BUILD_PACKAGE)
-
diff --git a/tests/java_api/RsNbody/Android.mk b/tests/java_api/RsNbody/Android.mk
index 80aa3fb..4c99c42 100644
--- a/tests/java_api/RsNbody/Android.mk
+++ b/tests/java_api/RsNbody/Android.mk
@@ -25,6 +25,8 @@
 LOCAL_STATIC_ANDROID_LIBRARIES += androidx.legacy_legacy-support-v4
 
 LOCAL_PACKAGE_NAME := RsNbody
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_RENDERSCRIPT_TARGET_API := 23
 
diff --git a/tests/java_api/RsTest/Android.mk b/tests/java_api/RsTest/Android.mk
index 256efef..4f231b5 100644
--- a/tests/java_api/RsTest/Android.mk
+++ b/tests/java_api/RsTest/Android.mk
@@ -29,8 +29,9 @@
 LOCAL_RENDERSCRIPT_TARGET_API := current
 
 LOCAL_PACKAGE_NAME := RSTest
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_COMPATIBILITY_SUITE := device-tests
 
 include $(BUILD_PACKAGE)
-
diff --git a/tests/java_api/RsTest_11/Android.mk b/tests/java_api/RsTest_11/Android.mk
index 13c8065..8741441 100644
--- a/tests/java_api/RsTest_11/Android.mk
+++ b/tests/java_api/RsTest_11/Android.mk
@@ -22,6 +22,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := RSTest_v11
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := 11
 
 include $(BUILD_PACKAGE)
diff --git a/tests/java_api/RsTest_14/Android.mk b/tests/java_api/RsTest_14/Android.mk
index a4386a4..3008e2e 100644
--- a/tests/java_api/RsTest_14/Android.mk
+++ b/tests/java_api/RsTest_14/Android.mk
@@ -22,6 +22,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := RSTest_v14
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := 14
 
 include $(BUILD_PACKAGE)
diff --git a/tests/java_api/RsTest_16/Android.mk b/tests/java_api/RsTest_16/Android.mk
index f53c1ab..4bb59a2 100644
--- a/tests/java_api/RsTest_16/Android.mk
+++ b/tests/java_api/RsTest_16/Android.mk
@@ -22,6 +22,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := RSTest_v16
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := 16
 
 include $(BUILD_PACKAGE)
diff --git a/tests/java_api/SSHealingBrush/Android.mk b/tests/java_api/SSHealingBrush/Android.mk
index 47bf9fb..63154e5 100644
--- a/tests/java_api/SSHealingBrush/Android.mk
+++ b/tests/java_api/SSHealingBrush/Android.mk
@@ -25,9 +25,10 @@
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-v8-renderscript
 
 LOCAL_PACKAGE_NAME := SSHealingBrush
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 LOCAL_RENDERSCRIPT_FLAGS := -target-api 0
 
 include $(BUILD_PACKAGE)
-
diff --git a/tests/java_api/SampleTest/Android.mk b/tests/java_api/SampleTest/Android.mk
index 41ae99f..8152181 100644
--- a/tests/java_api/SampleTest/Android.mk
+++ b/tests/java_api/SampleTest/Android.mk
@@ -22,6 +22,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := SampleRS
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 LOCAL_MIN_SDK_VERSION := 17
 
diff --git a/tests/java_api/ScriptGroupTest/Android.mk b/tests/java_api/ScriptGroupTest/Android.mk
index c9e6dad..6fed8b9 100644
--- a/tests/java_api/ScriptGroupTest/Android.mk
+++ b/tests/java_api/ScriptGroupTest/Android.mk
@@ -28,6 +28,8 @@
 LOCAL_RENDERSCRIPT_FLAGS := -target-api 0
 
 LOCAL_PACKAGE_NAME := ScriptGroupTest
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 include $(BUILD_PACKAGE)
diff --git a/tests/java_api/VrDemo/Android.mk b/tests/java_api/VrDemo/Android.mk
index 4cc64ec..e33fb77 100644
--- a/tests/java_api/VrDemo/Android.mk
+++ b/tests/java_api/VrDemo/Android.mk
@@ -23,5 +23,7 @@
 LOCAL_SDK_VERSION := current
 
 LOCAL_PACKAGE_NAME := VrDemo
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 include $(BUILD_PACKAGE)
diff --git a/tests/lldb/README.txt b/tests/lldb/README.txt
index 9c07494..70e93bc 100644
--- a/tests/lldb/README.txt
+++ b/tests/lldb/README.txt
@@ -42,7 +42,7 @@
                               [--run-emu]
                               [--adb-path ADB_PATH]
                               [--aosp-product-path AOSP_PRODUCT_PATH]
-                              [--blacklist BLACKLIST [BLACKLIST ...]]
+                              [--blocklist BLOCKLIST [BLOCKLIST ...]]
                               [--device-port DEVICE_PORT]
                               [--emu-cmd EMU_CMD]
                               [--host-port HOST_PORT]
@@ -75,10 +75,10 @@
           --adb-path ADB_PATH   Path to android debug bridge on the host.
           --aosp-product-path AOSP_PRODUCT_PATH
                                 The path to the "out" folder of the AOSP repository.
-          --blacklist BLACKLIST [BLACKLIST ...]
-                                Provide a test blacklist for skipping specific tests.
-                                To specify the blacklist from the command line the
-                                following can be used: --blacklist test1.py test2.py
+          --blocklist BLOCKLIST [BLOCKLIST ...]
+                                Provide a test blocklist for skipping specific tests.
+                                To specify the blocklist from the command line the
+                                following can be used: --blocklist test1.py test2.py
                                 ...
           --device-port DEVICE_PORT
                                 Specify the port number that lldb-server (on the
diff --git a/tests/lldb/config.py b/tests/lldb/config.py
index a72b80b..bc478d0 100644
--- a/tests/lldb/config.py
+++ b/tests/lldb/config.py
@@ -82,11 +82,11 @@
         return 'lldb'
 
     @property
-    def blacklist(self):
-        '''Provide a test blacklist for skipping specific tests.
+    def blocklist(self):
+        '''Provide a test blocklist for skipping specific tests.
 
-        To specify the blacklist from the command line the following can be
-        used: --blacklist test1.py test2.py ...'''
+        To specify the blocklist from the command line the following can be
+        used: --blocklist test1.py test2.py ...'''
         return []
 
     @property
diff --git a/tests/lldb/cpp/Allocations/Android.mk b/tests/lldb/cpp/Allocations/Android.mk
index 11b484f..9f72923 100644
--- a/tests/lldb/cpp/Allocations/Android.mk
+++ b/tests/lldb/cpp/Allocations/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := CppAllocations
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := \
 	Allocations.cpp \
diff --git a/tests/lldb/cpp/BranchingFunCalls/Android.mk b/tests/lldb/cpp/BranchingFunCalls/Android.mk
index 12a3e32..c06e6af 100644
--- a/tests/lldb/cpp/BranchingFunCalls/Android.mk
+++ b/tests/lldb/cpp/BranchingFunCalls/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := CppBranchingFunCalls
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := \
 	BranchingFunCalls.cpp \
diff --git a/tests/lldb/cpp/InfiniteLoop/Android.mk b/tests/lldb/cpp/InfiniteLoop/Android.mk
index f0895ec..86a4ec5 100644
--- a/tests/lldb/cpp/InfiniteLoop/Android.mk
+++ b/tests/lldb/cpp/InfiniteLoop/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := CppInfiniteLoop
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := \
 	InfiniteLoop.cpp \
diff --git a/tests/lldb/cpp/KernelVariables/Android.mk b/tests/lldb/cpp/KernelVariables/Android.mk
index b9f9102..7a68c93 100644
--- a/tests/lldb/cpp/KernelVariables/Android.mk
+++ b/tests/lldb/cpp/KernelVariables/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := CppKernelVariables
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := \
 	KernelVariables.cpp \
diff --git a/tests/lldb/cpp/MultipleRSFiles/Android.mk b/tests/lldb/cpp/MultipleRSFiles/Android.mk
index 4c224b8..d4b5b35 100644
--- a/tests/lldb/cpp/MultipleRSFiles/Android.mk
+++ b/tests/lldb/cpp/MultipleRSFiles/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := CppMultipleRSFiles
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := \
 	MultipleRSFiles.cpp \
diff --git a/tests/lldb/cpp/WaitAttach/Android.mk b/tests/lldb/cpp/WaitAttach/Android.mk
index 2c4f18c..00bf745 100644
--- a/tests/lldb/cpp/WaitAttach/Android.mk
+++ b/tests/lldb/cpp/WaitAttach/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := CppDebugWaitAttach
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := \
 	WaitAttach.cpp \
@@ -13,6 +15,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := CppNoDebugWaitAttach
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := \
 	WaitAttach.cpp \
diff --git a/tests/lldb/java/Allocations/Android.mk b/tests/lldb/java/Allocations/Android.mk
index f7de2af..cff322f 100644
--- a/tests/lldb/java/Allocations/Android.mk
+++ b/tests/lldb/java/Allocations/Android.mk
@@ -8,9 +8,10 @@
 	$(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := Allocations
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_PRIVATE_PLATFORM_APIS := true
 
 LOCAL_RENDERSCRIPT_FLAGS := -g -O0 -Wno-unused -target-api 0
 
 include $(BUILD_PACKAGE)
-
diff --git a/tests/lldb/java/BranchingFunCalls/Android.mk b/tests/lldb/java/BranchingFunCalls/Android.mk
index ae79a64..94f9d6f 100644
--- a/tests/lldb/java/BranchingFunCalls/Android.mk
+++ b/tests/lldb/java/BranchingFunCalls/Android.mk
@@ -8,9 +8,10 @@
 	$(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := BranchingFunCalls
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_PRIVATE_PLATFORM_APIS := true
 
 LOCAL_RENDERSCRIPT_FLAGS := -g -O0 -target-api 0
 
 include $(BUILD_PACKAGE)
-
diff --git a/tests/lldb/java/DebugWaitAttach/Android.mk b/tests/lldb/java/DebugWaitAttach/Android.mk
index 8eafa53..3486b78 100644
--- a/tests/lldb/java/DebugWaitAttach/Android.mk
+++ b/tests/lldb/java/DebugWaitAttach/Android.mk
@@ -6,9 +6,10 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := JavaDebugWaitAttach
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_PRIVATE_PLATFORM_APIS := true
 
 LOCAL_RENDERSCRIPT_FLAGS := -g -O0 -target-api 0
 
 include $(BUILD_PACKAGE)
-
diff --git a/tests/lldb/java/InfiniteLoop/Android.mk b/tests/lldb/java/InfiniteLoop/Android.mk
index d2f143c..02e2790 100644
--- a/tests/lldb/java/InfiniteLoop/Android.mk
+++ b/tests/lldb/java/InfiniteLoop/Android.mk
@@ -6,6 +6,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := JavaInfiniteLoop
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 LOCAL_RENDERSCRIPT_FLAGS := -g -O0 -target-api 0
diff --git a/tests/lldb/java/KernelVariables/Android.mk b/tests/lldb/java/KernelVariables/Android.mk
index f37abce..c642a9d 100644
--- a/tests/lldb/java/KernelVariables/Android.mk
+++ b/tests/lldb/java/KernelVariables/Android.mk
@@ -6,9 +6,10 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := KernelVariables
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_PRIVATE_PLATFORM_APIS := true
 
 LOCAL_RENDERSCRIPT_FLAGS := -g -O0 -target-api 0
 
 include $(BUILD_PACKAGE)
-
diff --git a/tests/lldb/java/MultipleRSFiles/Android.mk b/tests/lldb/java/MultipleRSFiles/Android.mk
index b7cb887..b45cc51 100644
--- a/tests/lldb/java/MultipleRSFiles/Android.mk
+++ b/tests/lldb/java/MultipleRSFiles/Android.mk
@@ -6,9 +6,10 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := MultipleRSFiles
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_PRIVATE_PLATFORM_APIS := true
 
 LOCAL_RENDERSCRIPT_FLAGS := -g -O0 -target-api 0
 
 include $(BUILD_PACKAGE)
-
diff --git a/tests/lldb/java/NoDebugWaitAttach/Android.mk b/tests/lldb/java/NoDebugWaitAttach/Android.mk
index a852a52..355ffb7 100644
--- a/tests/lldb/java/NoDebugWaitAttach/Android.mk
+++ b/tests/lldb/java/NoDebugWaitAttach/Android.mk
@@ -6,7 +6,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := JavaNoDebugWaitAttach
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_PRIVATE_PLATFORM_APIS := true
 
 include $(BUILD_PACKAGE)
-
diff --git a/tests/lldb/java/Reduction/Android.mk b/tests/lldb/java/Reduction/Android.mk
index bd0d5a5..6e71659 100644
--- a/tests/lldb/java/Reduction/Android.mk
+++ b/tests/lldb/java/Reduction/Android.mk
@@ -24,6 +24,8 @@
 LOCAL_RENDERSCRIPT_FLAGS := -target-api 0 -O0 -g
 
 LOCAL_PACKAGE_NAME := Reduction
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_PRIVATE_PLATFORM_APIS := true
 
 include $(BUILD_PACKAGE)
diff --git a/tests/lldb/java/ScriptGroup/Android.mk b/tests/lldb/java/ScriptGroup/Android.mk
index c673b67..18a1cd5 100644
--- a/tests/lldb/java/ScriptGroup/Android.mk
+++ b/tests/lldb/java/ScriptGroup/Android.mk
@@ -6,6 +6,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := ScriptGroup
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_PRIVATE_PLATFORM_APIS := true
 
 LOCAL_RENDERSCRIPT_FLAGS := -g -O0 -target-api 0
diff --git a/tests/lldb/java/SingleSource/Android.mk b/tests/lldb/java/SingleSource/Android.mk
index 09bfc4e..202c2a7 100644
--- a/tests/lldb/java/SingleSource/Android.mk
+++ b/tests/lldb/java/SingleSource/Android.mk
@@ -6,6 +6,8 @@
 LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := SingleSource
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_PRIVATE_PLATFORM_APIS := true
 
 LOCAL_RENDERSCRIPT_FLAGS := -g -O0 -target-api 0
diff --git a/tests/lldb/jni/Allocations/Android.mk b/tests/lldb/jni/Allocations/Android.mk
index 8b0793b..67ef2d9 100644
--- a/tests/lldb/jni/Allocations/Android.mk
+++ b/tests/lldb/jni/Allocations/Android.mk
@@ -7,6 +7,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := JNIAllocations
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 LOCAL_JNI_SHARED_LIBRARIES := libjniallocations
@@ -15,4 +17,3 @@
 
 include $(BUILD_PACKAGE)
 include $(LOCAL_PATH)/jniallocations/Android.mk
-
diff --git a/tests/lldb/jni/Allocations/jniallocations/Android.mk b/tests/lldb/jni/Allocations/jniallocations/Android.mk
index e5c2863..e52e1a3 100644
--- a/tests/lldb/jni/Allocations/jniallocations/Android.mk
+++ b/tests/lldb/jni/Allocations/jniallocations/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libjniallocations
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := jniallocations.cpp allocs.rscript
 
diff --git a/tests/lldb/jni/BranchingFunCalls/Android.mk b/tests/lldb/jni/BranchingFunCalls/Android.mk
index 5fdcdb3..a5ee3b4 100644
--- a/tests/lldb/jni/BranchingFunCalls/Android.mk
+++ b/tests/lldb/jni/BranchingFunCalls/Android.mk
@@ -7,6 +7,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := JNIBranchingFunCalls
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 LOCAL_JNI_SHARED_LIBRARIES := libjnibranchingfuncalls
@@ -15,4 +17,3 @@
 
 include $(BUILD_PACKAGE)
 include $(LOCAL_PATH)/jnibranchingfuncalls/Android.mk
-
diff --git a/tests/lldb/jni/BranchingFunCalls/jnibranchingfuncalls/Android.mk b/tests/lldb/jni/BranchingFunCalls/jnibranchingfuncalls/Android.mk
index 34dd1ad..69f9162 100644
--- a/tests/lldb/jni/BranchingFunCalls/jnibranchingfuncalls/Android.mk
+++ b/tests/lldb/jni/BranchingFunCalls/jnibranchingfuncalls/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libjnibranchingfuncalls
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := jnibranchingfuncalls.cpp scalars.rscript
 
diff --git a/tests/lldb/jni/DebugWaitAttach/Android.mk b/tests/lldb/jni/DebugWaitAttach/Android.mk
index 9d84842..14cf20d 100644
--- a/tests/lldb/jni/DebugWaitAttach/Android.mk
+++ b/tests/lldb/jni/DebugWaitAttach/Android.mk
@@ -7,6 +7,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := JNIDebugWaitAttach
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 LOCAL_JNI_SHARED_LIBRARIES := libjnidebugwaitattach
@@ -15,4 +17,3 @@
 
 include $(BUILD_PACKAGE)
 include $(LOCAL_PATH)/jnidebugwaitattach/Android.mk
-
diff --git a/tests/lldb/jni/DebugWaitAttach/jnidebugwaitattach/Android.mk b/tests/lldb/jni/DebugWaitAttach/jnidebugwaitattach/Android.mk
index edb348f..af7d578 100644
--- a/tests/lldb/jni/DebugWaitAttach/jnidebugwaitattach/Android.mk
+++ b/tests/lldb/jni/DebugWaitAttach/jnidebugwaitattach/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libjnidebugwaitattach
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := jnidebugwaitattach.cpp simple.rscript
 
diff --git a/tests/lldb/jni/InfiniteLoop/Android.mk b/tests/lldb/jni/InfiniteLoop/Android.mk
index 35dfc0d..892e1e9 100644
--- a/tests/lldb/jni/InfiniteLoop/Android.mk
+++ b/tests/lldb/jni/InfiniteLoop/Android.mk
@@ -7,6 +7,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := JNIInfiniteLoop
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 LOCAL_JNI_SHARED_LIBRARIES := libjniinfiniteloop
@@ -15,4 +17,3 @@
 
 include $(BUILD_PACKAGE)
 include $(LOCAL_PATH)/jniinfiniteloop/Android.mk
-
diff --git a/tests/lldb/jni/InfiniteLoop/jniinfiniteloop/Android.mk b/tests/lldb/jni/InfiniteLoop/jniinfiniteloop/Android.mk
index 31001d0..2171722 100644
--- a/tests/lldb/jni/InfiniteLoop/jniinfiniteloop/Android.mk
+++ b/tests/lldb/jni/InfiniteLoop/jniinfiniteloop/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libjniinfiniteloop
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := jniinfiniteloop.cpp infiniteloop.rscript
 
diff --git a/tests/lldb/jni/KernelVariables/Android.mk b/tests/lldb/jni/KernelVariables/Android.mk
index 8ab1297..12017d5 100644
--- a/tests/lldb/jni/KernelVariables/Android.mk
+++ b/tests/lldb/jni/KernelVariables/Android.mk
@@ -7,6 +7,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := JNIKernelVariables
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 LOCAL_JNI_SHARED_LIBRARIES := libjnikernelvariables
@@ -15,4 +17,3 @@
 
 include $(BUILD_PACKAGE)
 include $(LOCAL_PATH)/jnikernelvariables/Android.mk
-
diff --git a/tests/lldb/jni/KernelVariables/jnikernelvariables/Android.mk b/tests/lldb/jni/KernelVariables/jnikernelvariables/Android.mk
index fe372a7..10afc4b 100644
--- a/tests/lldb/jni/KernelVariables/jnikernelvariables/Android.mk
+++ b/tests/lldb/jni/KernelVariables/jnikernelvariables/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libjnikernelvariables
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := jnikernelvariables.cpp simple.rscript
 
diff --git a/tests/lldb/jni/MultipleRSFiles/Android.mk b/tests/lldb/jni/MultipleRSFiles/Android.mk
index 4aa54e3..ff24154 100644
--- a/tests/lldb/jni/MultipleRSFiles/Android.mk
+++ b/tests/lldb/jni/MultipleRSFiles/Android.mk
@@ -7,6 +7,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := JNIMultipleRSFiles
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 LOCAL_JNI_SHARED_LIBRARIES := libjnimultiplersfiles
@@ -15,4 +17,3 @@
 
 include $(BUILD_PACKAGE)
 include $(LOCAL_PATH)/jnimultiplersfiles/Android.mk
-
diff --git a/tests/lldb/jni/MultipleRSFiles/jnimultiplersfiles/Android.mk b/tests/lldb/jni/MultipleRSFiles/jnimultiplersfiles/Android.mk
index 6fd4b10..b3c335f 100644
--- a/tests/lldb/jni/MultipleRSFiles/jnimultiplersfiles/Android.mk
+++ b/tests/lldb/jni/MultipleRSFiles/jnimultiplersfiles/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libjnimultiplersfiles
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := jnimultiplersfiles.cpp first.rscript second.rscript
 
diff --git a/tests/lldb/jni/NoDebugWaitAttach/Android.mk b/tests/lldb/jni/NoDebugWaitAttach/Android.mk
index 84d4e28..887b199 100644
--- a/tests/lldb/jni/NoDebugWaitAttach/Android.mk
+++ b/tests/lldb/jni/NoDebugWaitAttach/Android.mk
@@ -7,6 +7,8 @@
                    $(call all-renderscript-files-under, src)
 
 LOCAL_PACKAGE_NAME := JNINoDebugWaitAttach
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 LOCAL_SDK_VERSION := current
 
 LOCAL_JNI_SHARED_LIBRARIES := libjninodebugwaitattach
@@ -15,4 +17,3 @@
 
 include $(BUILD_PACKAGE)
 include $(LOCAL_PATH)/jninodebugwaitattach/Android.mk
-
diff --git a/tests/lldb/jni/NoDebugWaitAttach/jninodebugwaitattach/Android.mk b/tests/lldb/jni/NoDebugWaitAttach/jninodebugwaitattach/Android.mk
index fda6fcf..19b0807 100644
--- a/tests/lldb/jni/NoDebugWaitAttach/jninodebugwaitattach/Android.mk
+++ b/tests/lldb/jni/NoDebugWaitAttach/jninodebugwaitattach/Android.mk
@@ -2,6 +2,8 @@
 include $(CLEAR_VARS)
 
 LOCAL_MODULE := libjninodebugwaitattach
+LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
+LOCAL_LICENSE_CONDITIONS := notice
 
 LOCAL_SRC_FILES := jninodebugwaitattach.cpp simple.rscript
 
diff --git a/tests/lldb/jni/common.mk b/tests/lldb/jni/common.mk
index 269f1d9..7441307 100644
--- a/tests/lldb/jni/common.mk
+++ b/tests/lldb/jni/common.mk
@@ -1,12 +1,11 @@
 LOCAL_MODULE_TAGS := tests
 
-LOCAL_C_INCLUDES += $(JNI_H_INCLUDE)
-
 LOCAL_CPP_FEATURES += exceptions
 
 LOCAL_CFLAGS := -Werror -Wall -Wextra -std=c++11
 LOCAL_RENDERSCRIPT_FLAGS += -O0 -target-api 0
 
+LOCAL_HEADER_LIBRARIES := jni_headers
 LOCAL_SHARED_LIBRARIES += libdl liblog
 LOCAL_STATIC_LIBRARIES += libRScpp_static
 
diff --git a/tests/lldb/run_tests.py b/tests/lldb/run_tests.py
index 2ac5123..d1700bb 100755
--- a/tests/lldb/run_tests.py
+++ b/tests/lldb/run_tests.py
@@ -173,8 +173,8 @@
             # use the default configuration
             config = Config()
 
-        # save the test blacklist
-        self.blacklist = _choice(args.blacklist, config.blacklist)
+        # save the test denylist
+        self.blocklist = _choice(args.blocklist, config.blocklist)
 
         # Allow any of the command line arguments to override the
         # values in the config file.
@@ -722,7 +722,7 @@
                 for item in os.listdir(current_test_dir):
                     if (item.startswith('test')
                         and item.endswith('.py')
-                        and not item in state.blacklist):
+                        and not item in state.blocklist):
                         tests.append(item)
     else:
         if single_test.endswith('.py'):
diff --git a/tests/lldb/tests/harness/util_android.py b/tests/lldb/tests/harness/util_android.py
index 16596f5..a0cf700 100644
--- a/tests/lldb/tests/harness/util_android.py
+++ b/tests/lldb/tests/harness/util_android.py
@@ -635,7 +635,7 @@
 
         # if the remote is an emulator do not even try to reboot
         # otherwise check whether a reboot is advised
-        if (self._get_prop('ro.kernel.qemu') != '1' and output and
+        if (self._get_prop('ro.boot.qemu') != '1' and output and
                 'Now reboot your device for settings to take effect' in output):
             self._reboot_device()