Merge \\\"Fix tethering re-enable after edit.\\\" into nyc-dev am: dbb5a0b918 am: c04ac8415a

am: e0d330f138

Change-Id: Ic67c1ed8a63103476b2579179374ab405e98b3b6
This commit is contained in:
Jason Monk
2016-06-22 15:31:59 +00:00
committed by android-build-merger

View File

@@ -280,6 +280,14 @@ public class TetherSettings extends RestrictedSettingsFragment
Log.d(TAG, "Restarting WifiAp due to prior config change.");
startTethering(TETHERING_WIFI);
}
} else if (action.equals(WifiManager.WIFI_AP_STATE_CHANGED_ACTION)) {
int state = intent.getIntExtra(WifiManager.EXTRA_WIFI_AP_STATE, 0);
if (state == WifiManager.WIFI_AP_STATE_DISABLED
&& mRestartWifiApAfterConfigChange) {
mRestartWifiApAfterConfigChange = false;
Log.d(TAG, "Restarting WifiAp due to prior config change.");
startTethering(TETHERING_WIFI);
}
} else if (action.equals(Intent.ACTION_MEDIA_SHARED)) {
mMassStorageActive = true;
updateState();
@@ -331,6 +339,7 @@ public class TetherSettings extends RestrictedSettingsFragment
mMassStorageActive = Environment.MEDIA_SHARED.equals(Environment.getExternalStorageState());
mTetherChangeReceiver = new TetherChangeReceiver();
IntentFilter filter = new IntentFilter(ConnectivityManager.ACTION_TETHER_STATE_CHANGED);
filter.addAction(WifiManager.WIFI_AP_STATE_CHANGED_ACTION);
Intent intent = activity.registerReceiver(mTetherChangeReceiver, filter);
filter = new IntentFilter();