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

Commit 293595fa authored by Victor Hsieh's avatar Victor Hsieh
Browse files

Change the old experiment setup to use the new API

Vendors can still set the default behavior by pm.dexopt.priv-app-oob*
system properties, but still the experiment flag can override the
behavior.

This change also removes the audit log because the setting provider is
not ready.  The old code works because we use the default system property
(which may be inconsistent to settings).

Test: cmd package compile -m speed -f com.google.android.dialer
      am start com.google.android.dialer
      cat /proc/`pidof com.google.android.dialer`/maps |grep oat |grep /data
      # Compiled code IS mapped as executable
Test: device_config put fsi_boot oob_enabled true
      pkill com.google.android.dialer; am start ...
      # Compiled code is NOT mapped as executable
Test: device_config put fsi_boot oob_enabled false
      # Compiled code IS mapped as executable
Test: device_config put fsi_boot oob_enabled true
      device_config put fsi_boot oob_whitelist com.android.vending,com.example
      # Compiled code is NOT mapped as executable
Test: device_config put fsi_boot oob_enabled true
      device_config put fsi_boot oob_whitelist com.android.vending,com.google.android.dialer
      # Compiled code IS mapped as executable
Test: device_config reset untrusted_clear
      # Compiled code IS mapped as executable
Test: atest DexManagerTests
Bug: 120793002
Change-Id: I67f29ac593bd2c33dc8c75ce2135cf9ec5490650
parent 161833f2
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -5547,6 +5547,12 @@ package android.provider {
    field public static final String NAMESPACE_NOTIFICATION_ASSISTANT = "notification_assistant";
  }
  public static interface DeviceConfig.FsiBoot {
    field public static final String NAMESPACE = "fsi_boot";
    field public static final String OOB_ENABLED = "oob_enabled";
    field public static final String OOB_WHITELIST = "oob_whitelist";
  }
  public static interface DeviceConfig.OnPropertyChangedListener {
    method public void onPropertyChanged(String, String, String);
  }
+13 −0
Original line number Diff line number Diff line
@@ -121,6 +121,19 @@ public final class DeviceConfig {
        String PROPERTY_RAMPING_RINGER_DURATION = "ramping_duration";
    }

    /**
     * Namespace for Full Stack Integrity to run privileged apps only in JIT mode. The flag applies
     * at process start, so reboot is a way to bring the device to a clean state.
     *
     * @hide
     */
    @SystemApi
    public interface FsiBoot {
        String NAMESPACE = "fsi_boot";
        String OOB_ENABLED = "oob_enabled";
        String OOB_WHITELIST = "oob_whitelist";
    }

    private static final Object sLock = new Object();
    @GuardedBy("sLock")
    private static Map<OnPropertyChangedListener, Pair<String, Executor>> sListeners =
+0 −17
Original line number Diff line number Diff line
@@ -9451,23 +9451,6 @@ public final class Settings {
        public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED =
                "hdmi_control_auto_device_off_enabled";
        /**
         * If <b>true</b>, enables out-of-the-box execution for priv apps.
         * Default: false
         * Values: 0 = false, 1 = true
         *
         * @hide
         */
        public static final String PRIV_APP_OOB_ENABLED = "priv_app_oob_enabled";
        /**
         * Comma separated list of privileged package names, which will be running out-of-box APK.
         * Default: "ALL"
         *
         * @hide
         */
        public static final String PRIV_APP_OOB_LIST = "priv_app_oob_list";
        /**
         * The interval in milliseconds at which location requests will be throttled when they are
         * coming from the background.
+1 −2
Original line number Diff line number Diff line
@@ -731,8 +731,7 @@ message GlobalSettingsProto {
    // Defines global runtime overrides to window policy.
    optional SettingProto policy_control = 92;
    optional SettingProto power_manager_constants = 93;
    // If true, out-of-the-box execution for priv apps is enabled.
    optional SettingProto priv_app_oob_enabled = 94 [ (android.privacy).dest = DEST_AUTOMATIC ];
    reserved 94; // Used to be priv_app_oob_enabled

    message PrepaidSetup {
        option (android.msg_privacy).dest = DEST_EXPLICIT;
+0 −2
Original line number Diff line number Diff line
@@ -387,8 +387,6 @@ public class SettingsBackupTest {
                    Settings.Global.POLICY_CONTROL,
                    Settings.Global.POWER_MANAGER_CONSTANTS,
                    Settings.Global.PREFERRED_NETWORK_MODE,
                    Settings.Global.PRIV_APP_OOB_ENABLED,
                    Settings.Global.PRIV_APP_OOB_LIST,
                    Settings.Global.PRIVATE_DNS_DEFAULT_MODE,
                    Settings.Global.PRIVILEGED_DEVICE_IDENTIFIER_CHECK_ENABLED,
                    Settings.Global.PRIVILEGED_DEVICE_IDENTIFIER_NON_PRIV_CHECK_RELAXED,
Loading