Stale cache management to address a P1 bug # 3296131.

Change-Id: I593f35a91c4a14c055828f8989fe01b9e7790039
This commit is contained in:
Shih-wei Liao
2010-12-20 20:45:56 +08:00
parent b70c82dc45
commit eeca435dc6
7 changed files with 67 additions and 15 deletions

View File

@@ -77,8 +77,14 @@ public class ScriptC extends Script {
rs.nScriptCBegin();
rs.nScriptCSetScript(pgm, 0, pgmLength);
Log.v(TAG, "Create script for resource = " + resources.getResourceName(resourceID));
// E.g, /system/apps/Fountain.apk
String packageName = rs.getApplicationContext().getPackageResourcePath();
// For res/raw/fountain.bc, it wil be /com.android.fountain:raw/fountain
String resName = resources.getResourceName(resourceID);
String cacheDir = rs.getApplicationContext().getCacheDir().toString();
return rs.nScriptCCreate(resources.getResourceName(resourceID), cacheDir);
Log.v(TAG, "Create script for resource = " + resName);
return rs.nScriptCCreate(packageName, resName, cacheDir);
}
}