From 13fb2cac71d56661aadc5f14fb46b315714c5f8c Mon Sep 17 00:00:00 2001 From: Winson Date: Fri, 10 Jan 2020 15:21:36 -0800 Subject: [PATCH] Check mIncludeCode before building appComponentFactory It should be impossible to resolve a custom appComponentFactory if the LoadedApk doesn't contain any code paths, so just skip it to avoid logging an incorrect error. Bug: 146219140 Test: manual force updateApplicationInfo call, verify bunch of errors before fix, no logs after fix; rest of device works Change-Id: Icbb8533c95c9437ec0a946886e00b9c341e21796 --- core/java/android/app/LoadedApk.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/app/LoadedApk.java b/core/java/android/app/LoadedApk.java index 775b1d165717f..70262b08dcc95 100644 --- a/core/java/android/app/LoadedApk.java +++ b/core/java/android/app/LoadedApk.java @@ -251,7 +251,7 @@ public final class LoadedApk { } private AppComponentFactory createAppFactory(ApplicationInfo appInfo, ClassLoader cl) { - if (appInfo.appComponentFactory != null && cl != null) { + if (mIncludeCode && appInfo.appComponentFactory != null && cl != null) { try { return (AppComponentFactory) cl.loadClass(appInfo.appComponentFactory).newInstance();