Set the default cachedir during context create.
- Use JNI reflection to access RenderScriptCacheDir.mCacheDir, and set
it immediately after the context is created.
- Java or C++ APIs could still call ContextSetCacheDir to override it.
- The JNI query is guarded by std::unique_lock to make sure that the
current thread is the only one attached to JNI.
- This change ensures that vendors could always get a valid code cache
dir even with support lib path, as RenderScriptCacheDir.mCacheDir is
set by ActivityThread.java when launching the application, regardless
of using RenderScript or not.
Bug: 34396220
Test: mm, CTS tests pass, tested with RSTest_CompatLib to make sure that
support lib path is covered.
Change-Id: I542ed2fe03e34b72e85398271b748c0053a35ae3
3 files changed