Merge changes from topic "rs-deprecation"

* changes:
  Mark NDK renderscript APIs as deprecated at API level 31.
  Deprecate RS SL Java APIs.
diff --git a/Android.bp b/Android.bp
index f726891..9679d92 100644
--- a/Android.bp
+++ b/Android.bp
@@ -14,6 +14,7 @@
         "-Werror",
         "-Wall",
         "-Wextra",
+        "-Wno-deprecated-declarations",
         "-Wno-unused-parameter",
         "-Wno-unused-variable",
     ],
diff --git a/cpp/Android.bp b/cpp/Android.bp
index 23ac393..433c79f 100644
--- a/cpp/Android.bp
+++ b/cpp/Android.bp
@@ -57,6 +57,7 @@
         "-Werror",
         "-Wall",
         "-Wextra",
+        "-Wno-deprecated-declarations",
         "-Wno-unused-parameter",
         "-Wno-unused-variable",
     ],
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/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/java/src/androidx/renderscript/Allocation.java b/support/java/src/androidx/renderscript/Allocation.java
index cb14a50..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;
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 b385b0f..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;
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 5569fe4..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;
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 1dcbe3b..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
@@ -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 a330cae..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;