Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d5921ee authored by Alex Buynytskyy's avatar Alex Buynytskyy
Browse files

Switching off ART verifications for debuggable apps (dev option-controlled).

This is complementary to switching off install-time checks for
debuggable apps and improves launch times for dex-heavy apps.
It's ON by default and controlled via developer option.

Bug: 124403695
Test: manual

Change-Id: Icafba38e8af71ef785088577ebf674bc13e26666
parent e264eab8
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -11706,6 +11706,14 @@ public final class Settings {
         */
        public static final String APP_IDLE_CONSTANTS = "app_idle_constants";
        /**
         * Enable ART bytecode verification verifications for debuggable apps.
         * 0 = disable, 1 = enable.
         * @hide
         */
        public static final String ART_VERIFIER_VERIFY_DEBUGGABLE =
                "art_verifier_verify_debuggable";
        /**
         * Power manager specific settings.
         * This is encoded as a key=value list, separated by commas. Ex:
+1 −0
Original line number Diff line number Diff line
@@ -122,6 +122,7 @@ public class SettingsBackupTest {
                    Settings.Global.APP_OPS_CONSTANTS,
                    Settings.Global.APP_STANDBY_ENABLED,
                    Settings.Global.APP_TIME_LIMIT_USAGE_SOURCE,
                    Settings.Global.ART_VERIFIER_VERIFY_DEBUGGABLE,
                    Settings.Global.ASSISTED_GPS_ENABLED,
                    Settings.Global.AUDIO_SAFE_VOLUME_STATE,
                    Settings.Global.AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES,
+7 −0
Original line number Diff line number Diff line
@@ -1498,6 +1498,13 @@ public final class ProcessList {
                // Also turn on CheckJNI for debuggable apps. It's quite
                // awkward to turn on otherwise.
                runtimeFlags |= Zygote.DEBUG_ENABLE_CHECKJNI;

                // Check if the developer does not want ART verification
                if (android.provider.Settings.Global.getInt(mService.mContext.getContentResolver(),
                        android.provider.Settings.Global.ART_VERIFIER_VERIFY_DEBUGGABLE, 1) == 0) {
                    runtimeFlags |= Zygote.DISABLE_VERIFIER;
                    Slog.w(TAG_PROCESSES, app + ": ART verification disabled");
                }
            }
            // Run the app in safe mode if its manifest requests so or the
            // system is booted in safe mode.