Merge "TetheringManager API clean up" into rvc-dev am: cca0c6192e

Change-Id: Id093ec8add4777f1d4a2c3d0890378acdc7ceaed
This commit is contained in:
Mark Chien
2020-03-19 12:07:18 +00:00
committed by Automerger Merge Worker

View File

@@ -2487,13 +2487,13 @@ public class ConnectivityManager {
} }
@Override @Override
public void onTetheringFailed(final int resultCode) { public void onTetheringFailed(final int error) {
callback.onTetheringFailed(); callback.onTetheringFailed();
} }
}; };
final TetheringRequest request = new TetheringRequest.Builder(type) final TetheringRequest request = new TetheringRequest.Builder(type)
.setSilentProvisioning(!showProvisioningUi).build(); .setShouldShowEntitlementUi(showProvisioningUi).build();
mTetheringManager.startTethering(request, executor, tetheringCallback); mTetheringManager.startTethering(request, executor, tetheringCallback);
} }
@@ -2713,11 +2713,12 @@ public class ConnectivityManager {
public static final int TETHER_ERROR_UNAVAIL_IFACE = public static final int TETHER_ERROR_UNAVAIL_IFACE =
TetheringManager.TETHER_ERROR_UNAVAIL_IFACE; TetheringManager.TETHER_ERROR_UNAVAIL_IFACE;
/** /**
* @deprecated Use {@link TetheringManager#TETHER_ERROR_MASTER_ERROR}. * @deprecated Use {@link TetheringManager#TETHER_ERROR_INTERNAL_ERROR}.
* {@hide} * {@hide}
*/ */
@Deprecated @Deprecated
public static final int TETHER_ERROR_MASTER_ERROR = TetheringManager.TETHER_ERROR_MASTER_ERROR; public static final int TETHER_ERROR_MASTER_ERROR =
TetheringManager.TETHER_ERROR_INTERNAL_ERROR;
/** /**
* @deprecated Use {@link TetheringManager#TETHER_ERROR_TETHER_IFACE_ERROR}. * @deprecated Use {@link TetheringManager#TETHER_ERROR_TETHER_IFACE_ERROR}.
* {@hide} * {@hide}
@@ -2733,19 +2734,19 @@ public class ConnectivityManager {
public static final int TETHER_ERROR_UNTETHER_IFACE_ERROR = public static final int TETHER_ERROR_UNTETHER_IFACE_ERROR =
TetheringManager.TETHER_ERROR_UNTETHER_IFACE_ERROR; TetheringManager.TETHER_ERROR_UNTETHER_IFACE_ERROR;
/** /**
* @deprecated Use {@link TetheringManager#TETHER_ERROR_ENABLE_NAT_ERROR}. * @deprecated Use {@link TetheringManager#TETHER_ERROR_ENABLE_FORWARDING_ERROR}.
* {@hide} * {@hide}
*/ */
@Deprecated @Deprecated
public static final int TETHER_ERROR_ENABLE_NAT_ERROR = public static final int TETHER_ERROR_ENABLE_NAT_ERROR =
TetheringManager.TETHER_ERROR_ENABLE_NAT_ERROR; TetheringManager.TETHER_ERROR_ENABLE_FORWARDING_ERROR;
/** /**
* @deprecated Use {@link TetheringManager#TETHER_ERROR_DISABLE_NAT_ERROR}. * @deprecated Use {@link TetheringManager#TETHER_ERROR_DISABLE_FORWARDING_ERROR}.
* {@hide} * {@hide}
*/ */
@Deprecated @Deprecated
public static final int TETHER_ERROR_DISABLE_NAT_ERROR = public static final int TETHER_ERROR_DISABLE_NAT_ERROR =
TetheringManager.TETHER_ERROR_DISABLE_NAT_ERROR; TetheringManager.TETHER_ERROR_DISABLE_FORWARDING_ERROR;
/** /**
* @deprecated Use {@link TetheringManager#TETHER_ERROR_IFACE_CFG_ERROR}. * @deprecated Use {@link TetheringManager#TETHER_ERROR_IFACE_CFG_ERROR}.
* {@hide} * {@hide}
@@ -2754,13 +2755,13 @@ public class ConnectivityManager {
public static final int TETHER_ERROR_IFACE_CFG_ERROR = public static final int TETHER_ERROR_IFACE_CFG_ERROR =
TetheringManager.TETHER_ERROR_IFACE_CFG_ERROR; TetheringManager.TETHER_ERROR_IFACE_CFG_ERROR;
/** /**
* @deprecated Use {@link TetheringManager#TETHER_ERROR_PROVISION_FAILED}. * @deprecated Use {@link TetheringManager#TETHER_ERROR_PROVISIONING_FAILED}.
* {@hide} * {@hide}
*/ */
@SystemApi @SystemApi
@Deprecated @Deprecated
public static final int TETHER_ERROR_PROVISION_FAILED = public static final int TETHER_ERROR_PROVISION_FAILED =
TetheringManager.TETHER_ERROR_PROVISION_FAILED; TetheringManager.TETHER_ERROR_PROVISIONING_FAILED;
/** /**
* @deprecated Use {@link TetheringManager#TETHER_ERROR_DHCPSERVER_ERROR}. * @deprecated Use {@link TetheringManager#TETHER_ERROR_DHCPSERVER_ERROR}.
* {@hide} * {@hide}
@@ -2792,7 +2793,14 @@ public class ConnectivityManager {
@UnsupportedAppUsage @UnsupportedAppUsage
@Deprecated @Deprecated
public int getLastTetherError(String iface) { public int getLastTetherError(String iface) {
return mTetheringManager.getLastTetherError(iface); int error = mTetheringManager.getLastTetherError(iface);
if (error == TetheringManager.TETHER_ERROR_UNKNOWN_TYPE) {
// TETHER_ERROR_UNKNOWN_TYPE was introduced with TetheringManager and has never been
// returned by ConnectivityManager. Convert it to the legacy TETHER_ERROR_UNKNOWN_IFACE
// instead.
error = TetheringManager.TETHER_ERROR_UNKNOWN_IFACE;
}
return error;
} }
/** @hide */ /** @hide */