Move shader cache out of code cache

Test: make && perfetto trace
Fixes: 262018792

Change-Id: I18f8dd0d4ee097e458e75009ec91868371ed6e31
This commit is contained in:
John Reck
2022-12-09 15:01:42 -05:00
parent 8f5595eb46
commit d202dfd348

View File

@@ -6644,12 +6644,13 @@ public final class ActivityThread extends ClientTransactionHandler
// Setup a location to store generated/compiled graphics code.
final Context deviceContext = context.createDeviceProtectedStorageContext();
final File codeCacheDir = deviceContext.getCodeCacheDir();
if (codeCacheDir != null) {
final File deviceCacheDir = deviceContext.getCacheDir();
if (codeCacheDir != null && deviceCacheDir != null) {
try {
int uid = Process.myUid();
String[] packages = getPackageManager().getPackagesForUid(uid);
if (packages != null) {
HardwareRenderer.setupDiskCache(codeCacheDir);
HardwareRenderer.setupDiskCache(deviceCacheDir);
RenderScriptCacheDir.setupDiskCache(codeCacheDir);
}
} catch (RemoteException e) {