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

Commit 572d2539 authored by Etan Cohen's avatar Etan Cohen
Browse files

Radio Information UI for enabling/disabling debug settings of MO over VoLTE

Change-Id: Ib05ff460ac6001c511113e80a63707a073908637
parent 86163b6b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -234,6 +234,14 @@
                android:layout_height="wrap_content"
                />

        <!-- Dial over PS (i.e. MO VoLTE) -->
        <Button android:id="@+id/mo_over_volte"
            android:textSize="14sp"
            android:layout_marginTop="8dip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            />

        <!-- LTE ram dump -->
        <Button android:id="@+id/lte_ram_dump"
                android:textSize="14sp"
+5 −0
Original line number Diff line number Diff line
@@ -67,6 +67,11 @@
    <!-- Phone SMS over IMS off. Only shown in diagnostic screen, so precise translation is not needed. -->
    <string name="sms_over_ims_off">Turn off SMS over IMS</string>

    <!-- MO over PS/VoLTE. Only shown in diagnostic screen, so precise translation is not needed. -->
    <string name="mo_over_volte_on">Enable MO over PS/VoLTE</string>
    <!-- MO over PS/VoLTE. Only shown in diagnostic screen, so precise translation is not needed. -->
    <string name="mo_over_volte_off">Disable MO over PS/VoLTE</string>

    <!-- Phone SMS over IMS IMS registration required on. Only shown in diagnostic screen, so precise translation is not needed. -->
    <string name="ims_reg_required_on">Turn on IMS registration required</string>
    <!-- Phone IMS registration required off. Only shown in diagnostic screen, so precise translation is not needed. -->
+33 −0
Original line number Diff line number Diff line
@@ -303,6 +303,9 @@ public class RadioInfo extends Activity {
        imsRegRequiredButton = (Button) findViewById(R.id.ims_reg_required);
        imsRegRequiredButton.setOnClickListener(mImsRegRequiredHandler);

        moOverVolteButton = (Button) findViewById(R.id.mo_over_volte);
        moOverVolteButton.setOnClickListener(mMoOverVolteHandler);

        smsOverImsButton = (Button) findViewById(R.id.sms_over_ims);
        smsOverImsButton.setOnClickListener(mSmsOverImsHandler);

@@ -360,6 +363,7 @@ public class RadioInfo extends Activity {
        updatePowerState();
        updateCellInfoListRate();
        updateImsRegRequiredState();
        updateMoOverImsState();
        updateSmsOverImsState();
        updateLteRamDumpState();
        updateProperties();
@@ -985,6 +989,35 @@ public class RadioInfo extends Activity {
        imsRegRequiredButton.setText(buttonText);
    }

    private Button moOverVolteButton;
    OnClickListener mMoOverVolteHandler = new OnClickListener() {
        @Override
        public void onClick(View v) {
            boolean moOverVolteEnabled = isMoOverVolteEnabled();
            log(String.format("toggle %s: currently %s",
                    TelephonyProperties.PROPERTY_DBG_IMS_VOLTE_ENABLE,
                    (moOverVolteEnabled ? "on" : "off")));
            boolean newValue = !moOverVolteEnabled;
            SystemProperties.set(TelephonyProperties.PROPERTY_DBG_IMS_VOLTE_ENABLE,
                    newValue ? "1" : "0");
            updateMoOverImsState();
        }
    };

    private boolean isMoOverVolteEnabled() {
        return SystemProperties.getInt(TelephonyProperties.PROPERTY_DBG_IMS_VOLTE_ENABLE,
                TelephonyProperties.PROPERTY_DBG_IMS_VOLTE_ENABLE_DEAFULT) == 1;
    }

    private void updateMoOverImsState() {
        boolean moOverVolteEnabled = isMoOverVolteEnabled();
        log("updateMoOverImsState isMoOverVolteEnabled()=" + moOverVolteEnabled);
        String buttonText = moOverVolteEnabled ?
                getString(R.string.mo_over_volte_off) :
                getString(R.string.mo_over_volte_on);
        moOverVolteButton.setText(buttonText);
    }

    private Button smsOverImsButton;
    static final String PROPERTY_SMS_OVER_IMS = "persist.radio.imsallowmtsms";
    OnClickListener mSmsOverImsHandler = new OnClickListener() {