Loading core/java/android/view/LayoutInflater.java +25 −12 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.Nullable; import android.annotation.SystemService; import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; Loading Loading @@ -398,10 +399,23 @@ public abstract class LayoutInflater { } private void initPrecompiledViews() { try { // Check if precompiled layouts are enabled by a system property. mUseCompiledView = SystemProperties.getBoolean(USE_PRECOMPILED_LAYOUT_SYSTEM_PROPERTY, false); if (mUseCompiledView) { if (!mUseCompiledView) { return; } // Make sure the application allows code generation ApplicationInfo appInfo = mContext.getApplicationInfo(); if ((appInfo.privateFlags & ApplicationInfo.PRIVATE_FLAG_PREFER_CODE_INTEGRITY) != 0 || appInfo.isPrivilegedApp()) { mUseCompiledView = false; return; } // Try to load the precompiled layout file. try { mPrecompiledClassLoader = mContext.getClassLoader(); String dexFile = mContext.getCodeCacheDir() + COMPILED_VIEW_DEX_FILE_NAME; if (new File(dexFile).exists()) { Loading @@ -411,7 +425,6 @@ public abstract class LayoutInflater { // layouts. mUseCompiledView = false; } } } catch (Throwable e) { if (DEBUG) { Log.e(TAG, "Failed to initialized precompiled views layouts", e); Loading Loading
core/java/android/view/LayoutInflater.java +25 −12 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.Nullable; import android.annotation.SystemService; import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; Loading Loading @@ -398,10 +399,23 @@ public abstract class LayoutInflater { } private void initPrecompiledViews() { try { // Check if precompiled layouts are enabled by a system property. mUseCompiledView = SystemProperties.getBoolean(USE_PRECOMPILED_LAYOUT_SYSTEM_PROPERTY, false); if (mUseCompiledView) { if (!mUseCompiledView) { return; } // Make sure the application allows code generation ApplicationInfo appInfo = mContext.getApplicationInfo(); if ((appInfo.privateFlags & ApplicationInfo.PRIVATE_FLAG_PREFER_CODE_INTEGRITY) != 0 || appInfo.isPrivilegedApp()) { mUseCompiledView = false; return; } // Try to load the precompiled layout file. try { mPrecompiledClassLoader = mContext.getClassLoader(); String dexFile = mContext.getCodeCacheDir() + COMPILED_VIEW_DEX_FILE_NAME; if (new File(dexFile).exists()) { Loading @@ -411,7 +425,6 @@ public abstract class LayoutInflater { // layouts. mUseCompiledView = false; } } } catch (Throwable e) { if (DEBUG) { Log.e(TAG, "Failed to initialized precompiled views layouts", e); Loading