Avoid unnecessary stopTethering when startTethering fails
- If Wi-Fi tethering is enabled or enabling, avoid to startTethering again. - If Wi-Fi tethering is disabled or disabling, avoid to stopTethering again. - Add more logs to know which module stopped Tethering. Bug: 230457055 Test: manual test make RunSettingsRoboTests ROBOTEST_FILTER=WifiTetherSwitchBarControllerTest Change-Id: I51d42ac0117d935ecaa9fa7312acc646b43d3593
This commit is contained in:
@@ -256,6 +256,7 @@ public class TetherService extends Service {
|
||||
}
|
||||
|
||||
private void disableTethering(final int tetheringType) {
|
||||
Log.w(TAG, "Disable tethering, type:" + tetheringType);
|
||||
final TetheringManager tm = (TetheringManager) getSystemService(Context.TETHERING_SERVICE);
|
||||
tm.stopTethering(tetheringType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user