Enable shader cache for applications that shared UID with multiple packages too

Bug: 31224514

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>
(cherry picked from commit 7c69a669a5)
This commit is contained in:
Shuo Gao
2016-03-01 13:32:03 +08:00
committed by Miao Wang
parent dd6230d466
commit 1e6d77e836

View File

@@ -5003,9 +5003,7 @@ public final class ActivityThread {
int uid = Process.myUid();
String[] packages = getPackageManager().getPackagesForUid(uid);
// If there are several packages in this application we won't
// initialize the graphics disk caches
if (packages != null && packages.length == 1) {
if (packages != null) {
ThreadedRenderer.setupDiskCache(cacheDir);
RenderScriptCacheDir.setupDiskCache(cacheDir);
}