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

Commit 00c334cc authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Adding "wifi only" option for wifi calling." into nyc-dev

parents e89bebe9 2013ba8e
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -1967,10 +1967,20 @@
    <string-array name="wifi_calling_mode_choices">
    <string-array name="wifi_calling_mode_choices">
        <item>Wi-Fi preferred</item>
        <item>Wi-Fi preferred</item>
        <item>Cellular preferred</item>
        <item>Cellular preferred</item>
        <item>Wi-Fi only</item>
    </string-array>
    </string-array>
    <string-array name="wifi_calling_mode_values">
    <string-array name="wifi_calling_mode_values">
        <item>"2"</item>
        <item>"2"</item>
        <item>"1"</item>
        <item>"1"</item>
        <item>"0"</item>
    </string-array>
    <string-array name="wifi_calling_mode_choices_without_wifi_only">
        <item>Wi-Fi preferred</item>
        <item>Cellular preferred</item>
    </string-array>
    <string-array name="wifi_calling_mode_values_without_wifi_only">
        <item>"2"</item>
        <item>"1"</item>
    </string-array>
    </string-array>
    <!-- Wi-Fi Calling settings. Text displayed when Wi-Fi Calling is off -->
    <!-- Wi-Fi Calling settings. Text displayed when Wi-Fi Calling is off -->
    <string name="wifi_calling_off_explanation">When Wi-Fi calling is on, your phone can route calls via Wi-Fi networks or your carrier\u2019s network, depending on your preference and which signal is stronger. Before turning on this feature, check with your carrier regarding fees and other details.</string>
    <string name="wifi_calling_off_explanation">When Wi-Fi calling is on, your phone can route calls via Wi-Fi networks or your carrier\u2019s network, depending on your preference and which signal is stronger. Before turning on this feature, check with your carrier regarding fees and other details.</string>
+8 −0
Original line number Original line Diff line number Diff line
@@ -168,12 +168,20 @@ public class WifiCallingSettings extends SettingsPreferenceFragment


        CarrierConfigManager configManager = (CarrierConfigManager)
        CarrierConfigManager configManager = (CarrierConfigManager)
                getSystemService(Context.CARRIER_CONFIG_SERVICE);
                getSystemService(Context.CARRIER_CONFIG_SERVICE);
        boolean isWifiOnlySupported = true;
        if (configManager != null) {
        if (configManager != null) {
            PersistableBundle b = configManager.getConfig();
            PersistableBundle b = configManager.getConfig();
            if (b != null) {
            if (b != null) {
                mEditableWfcMode = b.getBoolean(CarrierConfigManager.KEY_EDITABLE_WFC_MODE_BOOL);
                mEditableWfcMode = b.getBoolean(CarrierConfigManager.KEY_EDITABLE_WFC_MODE_BOOL);
                isWifiOnlySupported = b.getBoolean(
                        CarrierConfigManager.KEY_CARRIER_WFC_SUPPORTS_WIFI_ONLY_BOOL, true);
            }
            }
        }
        }

        if (!isWifiOnlySupported) {
            mButtonWfcMode.setEntries(R.array.wifi_calling_mode_choices_without_wifi_only);
            mButtonWfcMode.setEntryValues(R.array.wifi_calling_mode_values_without_wifi_only);
        }
    }
    }


    @Override
    @Override