Merge "Revert "Send TetheringRequest to restart Tethering from IpServer"" into main
This commit is contained in:
commit
cc579ba0e9
2 changed files with 11 additions and 11 deletions
|
|
@ -174,10 +174,10 @@ public class IpServer extends StateMachineShim {
|
|||
/**
|
||||
* Request Tethering change.
|
||||
*
|
||||
* @param request the TetheringRequest this IpServer was enabled with.
|
||||
* @param tetheringType the downstream type of this IpServer.
|
||||
* @param enabled enable or disable tethering.
|
||||
*/
|
||||
public void requestEnableTethering(TetheringRequest request, boolean enabled) { }
|
||||
public void requestEnableTethering(int tetheringType, boolean enabled) { }
|
||||
}
|
||||
|
||||
/** Capture IpServer dependencies, for injection. */
|
||||
|
|
@ -1189,8 +1189,8 @@ public class IpServer extends StateMachineShim {
|
|||
handleNewPrefixRequest((IpPrefix) message.obj);
|
||||
break;
|
||||
case CMD_NOTIFY_PREFIX_CONFLICT:
|
||||
mLog.i("restart tethering: " + mIfaceName);
|
||||
mCallback.requestEnableTethering(mTetheringRequest, false /* enabled */);
|
||||
mLog.i("restart tethering: " + mInterfaceType);
|
||||
mCallback.requestEnableTethering(mInterfaceType, false /* enabled */);
|
||||
transitionTo(mWaitingForRestartState);
|
||||
break;
|
||||
case CMD_SERVICE_FAILED_TO_START:
|
||||
|
|
@ -1474,12 +1474,12 @@ public class IpServer extends StateMachineShim {
|
|||
case CMD_TETHER_UNREQUESTED:
|
||||
transitionTo(mInitialState);
|
||||
mLog.i("Untethered (unrequested) and restarting " + mIfaceName);
|
||||
mCallback.requestEnableTethering(mTetheringRequest, true /* enabled */);
|
||||
mCallback.requestEnableTethering(mInterfaceType, true /* enabled */);
|
||||
break;
|
||||
case CMD_INTERFACE_DOWN:
|
||||
transitionTo(mUnavailableState);
|
||||
mLog.i("Untethered (interface down) and restarting " + mIfaceName);
|
||||
mCallback.requestEnableTethering(mTetheringRequest, true /* enabled */);
|
||||
mCallback.requestEnableTethering(mInterfaceType, true /* enabled */);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -2232,9 +2232,9 @@ public class Tethering {
|
|||
break;
|
||||
}
|
||||
case EVENT_REQUEST_CHANGE_DOWNSTREAM: {
|
||||
final boolean enabled = message.arg1 == 1;
|
||||
final TetheringRequest request = (TetheringRequest) message.obj;
|
||||
enableTetheringInternal(request.getTetheringType(), enabled, null, null);
|
||||
final int tetheringType = message.arg1;
|
||||
final Boolean enabled = (Boolean) message.obj;
|
||||
enableTetheringInternal(tetheringType, enabled, null, null);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
@ -2812,9 +2812,9 @@ public class Tethering {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void requestEnableTethering(TetheringRequest request, boolean enabled) {
|
||||
public void requestEnableTethering(int tetheringType, boolean enabled) {
|
||||
mTetherMainSM.sendMessage(TetherMainSM.EVENT_REQUEST_CHANGE_DOWNSTREAM,
|
||||
enabled ? 1 : 0, 0, request);
|
||||
tetheringType, 0, enabled ? Boolean.TRUE : Boolean.FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue