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

Commit c5687234 authored by Zhen Zhang's avatar Zhen Zhang Committed by Android (Google) Code Review
Browse files

Merge "Update summary for WifiTetherDisablePreference accordingly"

parents f9bf994a 15ec9911
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3750,6 +3750,14 @@
    <!-- Tethering controls, footer note displayed when tethering is disabled because Data Saver mode is on [CHAR LIMIT=none]-->
    <string name="tether_settings_disabled_on_data_saver">"Can\u2019t tether or use portable hotspots while Data Saver is on"</string>
    <!-- Disable Wifi Hotspot option-->
    <!-- Don't use Wi-Fi hotspot summary when USB tethering is chosen [CHAR LIMIT=NONE]-->
    <string name="disable_wifi_hotspot_when_usb_on">Only share internet via USB</string>
    <!-- Don't use Wi-Fi hotspot summary when Bluetooth tethering is chosen [CHAR LIMIT=NONE]-->
    <string name="disable_wifi_hotspot_when_bluetooth_on">Only share internet via Bluetooth</string>
    <!-- Don't use Wi-Fi hotspot summary when USB tethering and Bluetooth tethering are chosen [CHAR LIMIT=NONE]-->
    <string name="disable_wifi_hotspot_when_usb_and_bluetooth_on">Only share internet via USB and Bluetooth</string>
    <!-- USB Tethering options -->
    <string name="usb_title">USB</string>
    <string name="usb_tethering_button_text">USB tethering</string>
+1 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@
        <SwitchPreference
            android:key="disable_wifi_tethering"
            android:title="Don't use Wi-Fi hotspot"
            android:summary="@string/summary_placeholder"
            settings:controller="com.android.settings.network.WifiTetherDisablePreferenceController"
            settings:keywords="@string/keywords_hotspot_tethering" />
    </PreferenceCategory>
+9 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import androidx.preference.PreferenceScreen;
import androidx.preference.SwitchPreference;

import com.android.internal.annotations.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settingslib.TetherUtil;

@@ -95,8 +96,14 @@ public final class WifiTetherDisablePreferenceController extends BasePreferenceC

    @Override
    public CharSequence getSummary() {
        // TODO(b/146818850): Update summary accordingly.
        return super.getSummary();
        if (mUSBTetherEnabled && mBluetoothTetherEnabled) {
            return mContext.getString(R.string.disable_wifi_hotspot_when_usb_and_bluetooth_on);
        } else if (mUSBTetherEnabled) {
            return mContext.getString(R.string.disable_wifi_hotspot_when_usb_on);
        } else if (mBluetoothTetherEnabled) {
            return mContext.getString(R.string.disable_wifi_hotspot_when_bluetooth_on);
        }
        return mContext.getString(R.string.summary_placeholder);
    }

    @Override