Loading res/values/strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -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> Loading res/xml/all_tether_prefs.xml +1 −0 Original line number Diff line number Diff line Loading @@ -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> Loading src/com/android/settings/network/WifiTetherDisablePreferenceController.java +9 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading Loading
res/values/strings.xml +8 −0 Original line number Diff line number Diff line Loading @@ -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> Loading
res/xml/all_tether_prefs.xml +1 −0 Original line number Diff line number Diff line Loading @@ -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> Loading
src/com/android/settings/network/WifiTetherDisablePreferenceController.java +9 −2 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading