Merge "Clarify IControlsTethering LOCAL_ONLY state name"
This commit is contained in:
@@ -136,7 +136,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
|
|||||||
public boolean isCurrentlyServing() {
|
public boolean isCurrentlyServing() {
|
||||||
switch (lastState) {
|
switch (lastState) {
|
||||||
case IControlsTethering.STATE_TETHERED:
|
case IControlsTethering.STATE_TETHERED:
|
||||||
case IControlsTethering.STATE_LOCAL_HOTSPOT:
|
case IControlsTethering.STATE_LOCAL_ONLY:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
@@ -643,7 +643,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
|
|||||||
erroredList.add(iface);
|
erroredList.add(iface);
|
||||||
} else if (tetherState.lastState == IControlsTethering.STATE_AVAILABLE) {
|
} else if (tetherState.lastState == IControlsTethering.STATE_AVAILABLE) {
|
||||||
availableList.add(iface);
|
availableList.add(iface);
|
||||||
} else if (tetherState.lastState == IControlsTethering.STATE_LOCAL_HOTSPOT) {
|
} else if (tetherState.lastState == IControlsTethering.STATE_LOCAL_ONLY) {
|
||||||
localOnlyList.add(iface);
|
localOnlyList.add(iface);
|
||||||
} else if (tetherState.lastState == IControlsTethering.STATE_TETHERED) {
|
} else if (tetherState.lastState == IControlsTethering.STATE_TETHERED) {
|
||||||
if (cfg.isUsb(iface)) {
|
if (cfg.isUsb(iface)) {
|
||||||
@@ -807,7 +807,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
|
|||||||
// Otherwise, assume it's a local-only hotspot request.
|
// Otherwise, assume it's a local-only hotspot request.
|
||||||
final int state = mWifiTetherRequested
|
final int state = mWifiTetherRequested
|
||||||
? IControlsTethering.STATE_TETHERED
|
? IControlsTethering.STATE_TETHERED
|
||||||
: IControlsTethering.STATE_LOCAL_HOTSPOT;
|
: IControlsTethering.STATE_LOCAL_ONLY;
|
||||||
tetherMatchingInterfaces(state, ConnectivityManager.TETHERING_WIFI);
|
tetherMatchingInterfaces(state, ConnectivityManager.TETHERING_WIFI);
|
||||||
break;
|
break;
|
||||||
case WifiManager.WIFI_AP_STATE_DISABLED:
|
case WifiManager.WIFI_AP_STATE_DISABLED:
|
||||||
@@ -877,7 +877,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
|
|||||||
result = untether(chosenIface);
|
result = untether(chosenIface);
|
||||||
break;
|
break;
|
||||||
case IControlsTethering.STATE_TETHERED:
|
case IControlsTethering.STATE_TETHERED:
|
||||||
case IControlsTethering.STATE_LOCAL_HOTSPOT:
|
case IControlsTethering.STATE_LOCAL_ONLY:
|
||||||
result = tether(chosenIface, requestedState);
|
result = tether(chosenIface, requestedState);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1642,7 +1642,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
|
|||||||
case IControlsTethering.STATE_TETHERED:
|
case IControlsTethering.STATE_TETHERED:
|
||||||
pw.print("TetheredState");
|
pw.print("TetheredState");
|
||||||
break;
|
break;
|
||||||
case IControlsTethering.STATE_LOCAL_HOTSPOT:
|
case IControlsTethering.STATE_LOCAL_ONLY:
|
||||||
pw.print("LocalHotspotState");
|
pw.print("LocalHotspotState");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1697,7 +1697,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering
|
|||||||
which = TetherMasterSM.EVENT_IFACE_SERVING_STATE_INACTIVE;
|
which = TetherMasterSM.EVENT_IFACE_SERVING_STATE_INACTIVE;
|
||||||
break;
|
break;
|
||||||
case IControlsTethering.STATE_TETHERED:
|
case IControlsTethering.STATE_TETHERED:
|
||||||
case IControlsTethering.STATE_LOCAL_HOTSPOT:
|
case IControlsTethering.STATE_LOCAL_ONLY:
|
||||||
which = TetherMasterSM.EVENT_IFACE_SERVING_STATE_ACTIVE;
|
which = TetherMasterSM.EVENT_IFACE_SERVING_STATE_ACTIVE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ package com.android.server.connectivity.tethering;
|
|||||||
*/
|
*/
|
||||||
public interface IControlsTethering {
|
public interface IControlsTethering {
|
||||||
public final int STATE_UNAVAILABLE = 0;
|
public final int STATE_UNAVAILABLE = 0;
|
||||||
public final int STATE_AVAILABLE = 1;
|
public final int STATE_AVAILABLE = 1;
|
||||||
public final int STATE_TETHERED = 2;
|
public final int STATE_TETHERED = 2;
|
||||||
public final int STATE_LOCAL_HOTSPOT = 3;
|
public final int STATE_LOCAL_ONLY = 3;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify that |who| has changed its tethering state. This may be called from any thread.
|
* Notify that |who| has changed its tethering state. This may be called from any thread.
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ public class IPv6TetheringCoordinator {
|
|||||||
final Downstream ds = findDownstream(sm);
|
final Downstream ds = findDownstream(sm);
|
||||||
if (ds == null) return null;
|
if (ds == null) return null;
|
||||||
|
|
||||||
if (ds.mode == IControlsTethering.STATE_LOCAL_HOTSPOT) {
|
if (ds.mode == IControlsTethering.STATE_LOCAL_ONLY) {
|
||||||
// Build a Unique Locally-assigned Prefix configuration.
|
// Build a Unique Locally-assigned Prefix configuration.
|
||||||
return getUniqueLocalConfig(mUniqueLocalPrefix, ds.subnetId);
|
return getUniqueLocalConfig(mUniqueLocalPrefix, ds.subnetId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ public class TetherInterfaceStateMachine extends StateMachine {
|
|||||||
case CMD_TETHER_REQUESTED:
|
case CMD_TETHER_REQUESTED:
|
||||||
mLastError = ConnectivityManager.TETHER_ERROR_NO_ERROR;
|
mLastError = ConnectivityManager.TETHER_ERROR_NO_ERROR;
|
||||||
switch (message.arg1) {
|
switch (message.arg1) {
|
||||||
case IControlsTethering.STATE_LOCAL_HOTSPOT:
|
case IControlsTethering.STATE_LOCAL_ONLY:
|
||||||
transitionTo(mLocalHotspotState);
|
transitionTo(mLocalHotspotState);
|
||||||
break;
|
break;
|
||||||
case IControlsTethering.STATE_TETHERED:
|
case IControlsTethering.STATE_TETHERED:
|
||||||
@@ -304,7 +304,7 @@ public class TetherInterfaceStateMachine extends StateMachine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (DBG) Log.d(TAG, "Local hotspot " + mIfaceName);
|
if (DBG) Log.d(TAG, "Local hotspot " + mIfaceName);
|
||||||
sendInterfaceState(IControlsTethering.STATE_LOCAL_HOTSPOT);
|
sendInterfaceState(IControlsTethering.STATE_LOCAL_ONLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import static android.net.ConnectivityManager.TETHERING_BLUETOOTH;
|
|||||||
import static android.net.ConnectivityManager.TETHERING_USB;
|
import static android.net.ConnectivityManager.TETHERING_USB;
|
||||||
import static android.net.ConnectivityManager.TETHERING_WIFI;
|
import static android.net.ConnectivityManager.TETHERING_WIFI;
|
||||||
import static com.android.server.connectivity.tethering.IControlsTethering.STATE_AVAILABLE;
|
import static com.android.server.connectivity.tethering.IControlsTethering.STATE_AVAILABLE;
|
||||||
import static com.android.server.connectivity.tethering.IControlsTethering.STATE_LOCAL_HOTSPOT;
|
|
||||||
import static com.android.server.connectivity.tethering.IControlsTethering.STATE_TETHERED;
|
import static com.android.server.connectivity.tethering.IControlsTethering.STATE_TETHERED;
|
||||||
import static com.android.server.connectivity.tethering.IControlsTethering.STATE_UNAVAILABLE;
|
import static com.android.server.connectivity.tethering.IControlsTethering.STATE_UNAVAILABLE;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user