• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Revisão829122e78837bd3f3bc69b6412510e47bff0e7a1 (tree)
Hora2016-10-01 21:12:31
AutorDan Elkouby <streetwalrus@code...>
CommiterDan Elkouby

Mensagem de Log

Revert "Open WiFi network when pull out the USB line."

This reverts commit adce6ee6b751b7fa51e13d13ba5a5435f2461a9c.
- Tethering from WiFi to USB is a perfectly legit use case, nuke that

shit.

- That extra xml key + check is useless and breaks USB tethering

entirely unless added to the overlay.

Change-Id: I8c1c5d267a16df310f944234235234076787cd03

Mudança Sumário

Diff

--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -56,10 +56,6 @@
5656 <!-- show tethering help begin -->
5757 <bool name="tethering_show_help_for_first_using">false</bool>
5858 <bool name="tethering_show_help_menu">false</bool>
59-
60- <!-- Config to enable/disable the USB line-->
61- <bool name="config_usb_line_enable">false</bool>
62-
6359 <!-- show tethering help end -->
6460 <!-- Config voice over lte in wireless settings begin -->
6561 <bool name="config_voice_over_lte_enabled">false</bool>
@@ -72,8 +68,6 @@
7268
7369 <bool name="config_regional_usb_tethering_quick_start_enable">false</bool>
7470 <bool name="config_regional_hotspot_tether_help_enable">false</bool>
75- <!-- Config to enable/disable the USB line-->
76- <bool name="config_usb_line_enable">false</bool>
7771 <bool name="config_show_dialog_open_wifi_when_tethering_open">false</bool>
7872 <bool name="config_regional_account_check_dialog_enable">false</bool>
7973 <!-- Tethering & Mobile HotSpots display summary on Tmoblie -->
--- a/src/com/android/settings/TetherSettings.java
+++ b/src/com/android/settings/TetherSettings.java
@@ -150,10 +150,6 @@ public class TetherSettings extends RestrictedSettingsFragment
150150 private DataSaverBackend mDataSaverBackend;
151151 private boolean mDataSaverEnabled;
152152 private Preference mDataSaverFooter;
153- /* Record the wifi status before usb tether is on */
154- private boolean mUsbEnable = false;
155- private WifiManager mWifiStatusManager;
156- private boolean mIsWifiEnabled = false;
157153
158154 @Override
159155 protected int getMetricsCategory() {
@@ -272,9 +268,6 @@ public class TetherSettings extends RestrictedSettingsFragment
272268 }
273269 // Set initial state based on Data Saver mode.
274270 onDataSaverChanged(mDataSaverBackend.isDataSaverEnabled());
275- mUsbEnable = getResources().getBoolean(R.bool.config_usb_line_enable);
276- mWifiStatusManager= (WifiManager) getActivity().getSystemService(
277- Context.WIFI_SERVICE);
278271 }
279272
280273 @Override
@@ -371,12 +364,6 @@ public class TetherSettings extends RestrictedSettingsFragment
371364 updateState();
372365 } else if (action.equals(UsbManager.ACTION_USB_STATE)) {
373366 mUsbConnected = intent.getBooleanExtra(UsbManager.USB_CONNECTED, false);
374- mMassStorageActive = Environment.MEDIA_SHARED.equals(
375- Environment.getExternalStorageState());
376- boolean usbAvailable = mUsbConnected && !mMassStorageActive;
377- if(!usbAvailable && mIsWifiEnabled && mUsbEnable){
378- mWifiManager.setWifiEnabled(true);
379- }
380367 updateState();
381368 } else if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
382369 if (mBluetoothEnableForTether) {
@@ -700,29 +687,16 @@ public class TetherSettings extends RestrictedSettingsFragment
700687 }
701688 }
702689
703- if (choice == TETHERING_USB) {
704- if(mUsbTether.isChecked()) {
705- mWifiManager.setWifiEnabled(false);
706- }
707- }
708690 mCm.startTethering(choice, true, mStartTetheringCallback, mHandler);
709691 }
710692
711693 @Override
712694 public boolean onPreferenceTreeClick(Preference preference) {
713695 if (preference == mUsbTether) {
714- if (mUsbTether.isChecked() && mUsbEnable) {
715- //get the wifi status
716- mIsWifiEnabled = mWifiStatusManager.isWifiEnabled();
717- IntentFilter filter = new IntentFilter();
718- filter.addAction(UsbManager.ACTION_USB_STATE);
719- getActivity().registerReceiver(mTetherChangeReceiver, filter);
696+ if (mUsbTether.isChecked()) {
720697 startTethering(TETHERING_USB);
721698 } else {
722699 mCm.stopTethering(TETHERING_USB);
723- if (mIsWifiEnabled) {
724- mWifiManager.setWifiEnabled(true);
725- }
726700 }
727701 } else if (preference == mBluetoothTether) {
728702 if (mBluetoothTether.isChecked()) {