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

Commit 05d525ad authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Schematize Telephony System Properties" am: f3aab4b8 am: fc8dd06e

Change-Id: I9d3a769fc86b3ae097f2eaecb62123fa4d059294
parents f4f77642 fc8dd06e
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ import android.os.Message;
import android.os.PersistableBundle;
import android.os.Registrant;
import android.os.RegistrantList;
import android.os.SystemProperties;
import android.sysprop.TelephonyProperties;
import android.telecom.TelecomManager;
import android.telephony.Annotation.RilRadioTechnology;
import android.telephony.CarrierConfigManager;
@@ -656,14 +656,13 @@ public class GsmCdmaCallTracker extends CallTracker {
     * @throws CallStateException
     */
    public void checkForDialIssues(boolean isEmergencyCall) throws CallStateException {
        String disableCall = SystemProperties.get(
                TelephonyProperties.PROPERTY_DISABLE_CALL, "false");
        boolean disableCall = TelephonyProperties.disable_call().orElse(false);

        if (mCi.getRadioState() != TelephonyManager.RADIO_POWER_ON) {
            throw new CallStateException(CallStateException.ERROR_POWER_OFF,
                    "Modem not powered");
        }
        if (disableCall.equals("true")) {
        if (disableCall) {
            throw new CallStateException(CallStateException.ERROR_CALLING_DISABLED,
                    "Calling disabled via ro.telephony.disable-call property");
        }
+8 −7
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import android.os.WorkSource;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.provider.Telephony;
import android.sysprop.TelephonyProperties;
import android.telecom.TelecomManager;
import android.telecom.VideoProfile;
import android.telephony.AccessNetworkConstants;
@@ -139,7 +140,7 @@ public class GsmCdmaPhone extends Phone {

    //CDMA
    // Default Emergency Callback Mode exit timer
    private static final int DEFAULT_ECM_EXIT_TIMER_VALUE = 300000;
    private static final long DEFAULT_ECM_EXIT_TIMER_VALUE = 300000;
    private static final String VM_NUMBER_CDMA = "vm_number_key_cdma";
    public static final int RESTART_ECM_TIMER = 0; // restart Ecm timer
    public static final int CANCEL_ECM_TIMER = 1; // cancel Ecm timer
@@ -347,8 +348,8 @@ public class GsmCdmaPhone extends Phone {
        mCarrierOtaSpNumSchema = TelephonyManager.from(mContext).getOtaSpNumberSchemaForPhone(
                getPhoneId(), "");

        mResetModemOnRadioTechnologyChange = SystemProperties.getBoolean(
                TelephonyProperties.PROPERTY_RESET_ON_RADIO_TECH_CHANGE, false);
        mResetModemOnRadioTechnologyChange = TelephonyProperties.reset_on_radio_tech_change()
                .orElse(false);

        mCi.registerForRilConnected(this, EVENT_RIL_CONNECTED, null);
        mCi.registerForVoiceRadioTechChanged(this, EVENT_VOICE_RADIO_TECH_CHANGED, null);
@@ -3261,8 +3262,8 @@ public class GsmCdmaPhone extends Phone {

            // Post this runnable so we will automatically exit
            // if no one invokes exitEmergencyCallbackMode() directly.
            long delayInMillis = SystemProperties.getLong(
                    TelephonyProperties.PROPERTY_ECM_EXIT_TIMER, DEFAULT_ECM_EXIT_TIMER_VALUE);
            long delayInMillis = TelephonyProperties.ecm_exit_timer()
                    .orElse(DEFAULT_ECM_EXIT_TIMER_VALUE);
            postDelayed(mExitEcmRunnable, delayInMillis);
            // We don't want to go to sleep while in Ecm
            mWakeLock.acquire();
@@ -3319,8 +3320,8 @@ public class GsmCdmaPhone extends Phone {
                mEcmTimerResetRegistrants.notifyResult(Boolean.TRUE);
                break;
            case RESTART_ECM_TIMER:
                long delayInMillis = SystemProperties.getLong(
                        TelephonyProperties.PROPERTY_ECM_EXIT_TIMER, DEFAULT_ECM_EXIT_TIMER_VALUE);
                long delayInMillis = TelephonyProperties.ecm_exit_timer()
                        .orElse(DEFAULT_ECM_EXIT_TIMER_VALUE);
                postDelayed(mExitEcmRunnable, delayInMillis);
                mEcmTimerResetRegistrants.notifyResult(Boolean.FALSE);
                break;
+10 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.os.AsyncResult;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.sysprop.TelephonyProperties;
import android.telephony.CellInfo;
import android.telephony.CellInfoGsm;
import android.telephony.CellInfoLte;
@@ -47,6 +48,7 @@ import com.android.internal.util.IndentingPrintWriter;

import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
@@ -571,8 +573,14 @@ public class LocaleTracker extends Handler {
            mLocalLog.log(msg);
            mCurrentCountryIso = countryIso;

            TelephonyManager.setTelephonyProperty(mPhone.getPhoneId(),
                    TelephonyProperties.PROPERTY_OPERATOR_ISO_COUNTRY, mCurrentCountryIso);
            int phoneId = mPhone.getPhoneId();
            if (SubscriptionManager.isValidPhoneId(phoneId)) {
                List<String> newProp = new ArrayList<>(
                        TelephonyProperties.operator_iso_country());
                while (newProp.size() <= phoneId) newProp.add(null);
                newProp.set(phoneId, mCurrentCountryIso);
                TelephonyProperties.operator_iso_country(newProp);
            }

            Intent intent = new Intent(TelephonyManager.ACTION_NETWORK_COUNTRY_CHANGED);
            intent.putExtra(TelephonyManager.EXTRA_NETWORK_COUNTRY, countryIso);
+8 −6
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.WorkSource;
import android.preference.PreferenceManager;
import android.sysprop.TelephonyProperties;
import android.telecom.VideoProfile;
import android.telephony.AccessNetworkConstants;
import android.telephony.Annotation.ApnType;
@@ -534,12 +535,11 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
         * the RIL_UNSOL_CALL_RING so the default if there is no property is
         * true.
         */
        mDoesRilSendMultipleCallRing = SystemProperties.getBoolean(
                TelephonyProperties.PROPERTY_RIL_SENDS_MULTIPLE_CALL_RING, true);
        mDoesRilSendMultipleCallRing = TelephonyProperties.ril_sends_multiple_call_ring()
                .orElse(true);
        Rlog.d(LOG_TAG, "mDoesRilSendMultipleCallRing=" + mDoesRilSendMultipleCallRing);

        mCallRingDelay = SystemProperties.getInt(
                TelephonyProperties.PROPERTY_CALL_RING_DELAY, 3000);
        mCallRingDelay = TelephonyProperties.call_ring_delay().orElse(3000);
        Rlog.d(LOG_TAG, "mCallRingDelay=" + mCallRingDelay);

        if (getPhoneType() == PhoneConstants.PHONE_TYPE_IMS) {
@@ -2457,7 +2457,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    // This property is used to handle phone process crashes, and is the same for CDMA and IMS
    // phones
    protected static boolean getInEcmMode() {
        return SystemProperties.getBoolean(TelephonyProperties.PROPERTY_INECM_MODE, false);
        return TelephonyProperties.in_ecm_mode().orElse(false);
    }

    /**
@@ -2470,7 +2470,9 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    }

    public void setIsInEcm(boolean isInEcm) {
        setGlobalSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, String.valueOf(isInEcm));
        if (!getUnitTestMode()) {
            TelephonyProperties.in_ecm_mode(isInEcm);
        }
        mIsPhoneInEcmState = isInEcm;
    }

+4 −5
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@ import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import android.os.RegistrantList;
import android.os.SystemProperties;
import android.os.storage.StorageManager;
import android.sysprop.TelephonyProperties;
import android.telephony.PhoneCapability;
import android.telephony.Rlog;
import android.telephony.SubscriptionManager;
@@ -420,10 +420,9 @@ public class PhoneConfigurationManager {
         */
        @VisibleForTesting
        public boolean isRebootRequiredForModemConfigChange() {
            String rebootRequired = SystemProperties.get(
                    TelephonyProperties.PROPERTY_REBOOT_REQUIRED_ON_MODEM_CHANGE);
            boolean rebootRequired = TelephonyProperties.reboot_on_modem_change().orElse(false);
            log("isRebootRequiredForModemConfigChange: isRebootRequired = " + rebootRequired);
            return !rebootRequired.equals("false");
            return rebootRequired;
        }

        /**
@@ -444,7 +443,7 @@ public class PhoneConfigurationManager {
            }

            log("setMultiSimProperties to " + multiSimConfig);
            SystemProperties.set(TelephonyProperties.PROPERTY_MULTI_SIM_CONFIG, multiSimConfig);
            TelephonyProperties.multi_sim_config(multiSimConfig);
        }

        /**
Loading