DO NOT MERGE ANYWHERE Enable shader cache for applications that shared UID with multiple packages
from AOSP: https://android-review.googlesource.com/#/c/209490/ Frameworks supported a mature mechanism for shader cache per each package already, but as a special case such as Settings APP, if there are several packages in this application which means that multiple packages shared the same SharedUserID with it, it won't initialize the graphics disk caches, thereby APP like Settings have to rebuild and relink shader every time during launch, which cause a bad launching performance, so here to enable the GFX and RS cache initialization for multiple shared packages case too. Change-Id: If0f927e3399b775804abf1d9a868887951f471c5 Signed-off-by: Shuo Gao <shuo.gao@intel.com> Signed-off-by: Zhiquan Liu <zhiquan.liu@intel.com>
This commit is contained in:
committed by
Andriy Naborskyy
parent
80e6d8873b
commit
1b5d5bd119
@@ -4409,9 +4409,7 @@ public final class ActivityThread {
|
|||||||
int uid = Process.myUid();
|
int uid = Process.myUid();
|
||||||
String[] packages = getPackageManager().getPackagesForUid(uid);
|
String[] packages = getPackageManager().getPackagesForUid(uid);
|
||||||
|
|
||||||
// If there are several packages in this application we won't
|
if (packages != null) {
|
||||||
// initialize the graphics disk caches
|
|
||||||
if (packages != null && packages.length == 1) {
|
|
||||||
HardwareRenderer.setupDiskCache(cacheDir);
|
HardwareRenderer.setupDiskCache(cacheDir);
|
||||||
RenderScriptCacheDir.setupDiskCache(cacheDir);
|
RenderScriptCacheDir.setupDiskCache(cacheDir);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user