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

Commit 9a281de7 authored by cretin45's avatar cretin45
Browse files

Dialer: Add config for IP call settings on dialpad

Change-Id: Ifc735504afeecc8c5eca00045bdaf20fa64e642b
parent b6783c46
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -18,4 +18,7 @@
    <bool name="call_recording_enabled">false</bool>
    <bool name="call_recording_enabled">false</bool>
    <integer name="call_recording_audio_source">1</integer>
    <integer name="call_recording_audio_source">1</integer>
    <bool name="call_durationtype_enabled">false</bool>
    <bool name="call_durationtype_enabled">false</bool>

    <!-- Flag whether to enable IP Prefix setting-->
    <bool name="config_ip_prefix_enable" translatable="false">false</bool>
</resources>
</resources>
+10 −3
Original line number Original line Diff line number Diff line
@@ -846,7 +846,8 @@ public class DialpadFragment extends Fragment
        final MenuItem videocallsettingsMenuItem = menu.findItem(R.id.menu_video_call_settings);
        final MenuItem videocallsettingsMenuItem = menu.findItem(R.id.menu_video_call_settings);
        final MenuItem ipCallBySlot1MenuItem = menu.findItem(R.id.menu_ip_call_by_slot1);
        final MenuItem ipCallBySlot1MenuItem = menu.findItem(R.id.menu_ip_call_by_slot1);
        final MenuItem ipCallBySlot2MenuItem = menu.findItem(R.id.menu_ip_call_by_slot2);
        final MenuItem ipCallBySlot2MenuItem = menu.findItem(R.id.menu_ip_call_by_slot2);

        final boolean isIPPrefixEnabled =
                getResources().getBoolean(R.bool.config_ip_prefix_enable);
        // We show "video call setting" menu only when the csvt is supported
        // We show "video call setting" menu only when the csvt is supported
        //which means the prop "persist.radio.csvt.enabled" = true
        //which means the prop "persist.radio.csvt.enabled" = true
        videocallsettingsMenuItem.setVisible(isVTSupported());
        videocallsettingsMenuItem.setVisible(isVTSupported());
@@ -860,16 +861,22 @@ public class DialpadFragment extends Fragment
            ipCallBySlot1MenuItem.setVisible(false);
            ipCallBySlot1MenuItem.setVisible(false);
            ipCallBySlot2MenuItem.setVisible(false);
            ipCallBySlot2MenuItem.setVisible(false);
        } else {
        } else {
            if (MoreContactUtils.isMultiSimEnable(mContext, MSimConstants.SUB1)) {
            if (isIPPrefixEnabled && MoreContactUtils.isMultiSimEnable(mContext,
                    MSimConstants.SUB1)) {
                String sub1Name = MoreContactUtils.getSimSpnName(MSimConstants.SUB1);
                String sub1Name = MoreContactUtils.getSimSpnName(MSimConstants.SUB1);
                sub1Name = Settings.Global.getSimNameForSubscription(getActivity(),
                        MSimConstants.SUB1, sub1Name);
                ipCallBySlot1MenuItem.setTitle(getActivity().getString(
                ipCallBySlot1MenuItem.setTitle(getActivity().getString(
                        com.android.contacts.common.R.string.ip_call_by_slot, sub1Name));
                        com.android.contacts.common.R.string.ip_call_by_slot, sub1Name));
                ipCallBySlot1MenuItem.setVisible(true);
                ipCallBySlot1MenuItem.setVisible(true);
            } else {
            } else {
                ipCallBySlot1MenuItem.setVisible(false);
                ipCallBySlot1MenuItem.setVisible(false);
            }
            }
            if (MoreContactUtils.isMultiSimEnable(mContext, MSimConstants.SUB2)) {
            if (isIPPrefixEnabled && MoreContactUtils.isMultiSimEnable(mContext,
                    MSimConstants.SUB2)) {
                String sub2Name = MoreContactUtils.getSimSpnName(MSimConstants.SUB2);
                String sub2Name = MoreContactUtils.getSimSpnName(MSimConstants.SUB2);
                sub2Name = Settings.Global.getSimNameForSubscription(getActivity(),
                        MSimConstants.SUB2, sub2Name);
                ipCallBySlot2MenuItem.setTitle(getActivity().getString(
                ipCallBySlot2MenuItem.setTitle(getActivity().getString(
                        com.android.contacts.common.R.string.ip_call_by_slot, sub2Name));
                        com.android.contacts.common.R.string.ip_call_by_slot, sub2Name));
                ipCallBySlot2MenuItem.setVisible(true);
                ipCallBySlot2MenuItem.setVisible(true);