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

Commit 7b90d047 authored by Gary Jian's avatar Gary Jian
Browse files

Check ro.boot.radio.allow_mock_modem in USER build

Provide new ro.boot.radio.allow_mock_modem for emulator to set it,
so we have two property one is for developer options (persist.radio.*)
another is for emulator (ro.boot.*).

The setModemService is allowed in USER build as long as either is true.

Bug: 231323121
Test: emulator
Change-Id: I2904172265919770d9984605d27189b916d42b5b
parent d40a9380
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ public class PhoneConfigurationManager {
    private TelephonyManager mTelephonyManager;
    private static final RegistrantList sMultiSimConfigChangeRegistrants = new RegistrantList();
    private static final String ALLOW_MOCK_MODEM_PROPERTY = "persist.radio.allow_mock_modem";
    private static final String BOOT_ALLOW_MOCK_MODEM_PROPERTY = "ro.boot.radio.allow_mock_modem";
    private static final boolean DEBUG = !"user".equals(Build.TYPE);
    /**
     * Init method to instantiate the object
@@ -473,9 +474,11 @@ public class PhoneConfigurationManager {
        boolean statusRadioConfig = false;
        boolean statusRil = false;
        final boolean isAllowed = SystemProperties.getBoolean(ALLOW_MOCK_MODEM_PROPERTY, false);
        final boolean isAllowedForBoot =
                SystemProperties.getBoolean(BOOT_ALLOW_MOCK_MODEM_PROPERTY, false);

        // Check for ALLOW_MOCK_MODEM_PROPERTY on user builds
        if (isAllowed || DEBUG) {
        // Check for ALLOW_MOCK_MODEM_PROPERTY and BOOT_ALLOW_MOCK_MODEM_PROPERTY on user builds
        if (isAllowed || isAllowedForBoot || DEBUG) {
            if (serviceName != null) {
                statusRadioConfig = mRadioConfig.setModemService(serviceName);