Revert "Add onSupportedTetheringType callback"
This reverts commit ae3d303344.
Reason for revert: this cause GTS fail
Bug: 238038401
Change-Id: I3e21321e931f60208cb0befaed38e58b088ff966
This commit is contained in:
@@ -36,5 +36,4 @@ oneway interface ITetheringEventCallback
|
||||
void onTetherStatesChanged(in TetherStatesParcel states);
|
||||
void onTetherClientsChanged(in List<TetheredClient> clients);
|
||||
void onOffloadStatusChanged(int status);
|
||||
void onSupportedTetheringTypes(long supportedBitmap);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import android.net.TetherStatesParcel;
|
||||
* @hide
|
||||
*/
|
||||
parcelable TetheringCallbackStartedParcel {
|
||||
long supportedTypes;
|
||||
boolean tetheringSupported;
|
||||
Network upstreamNetwork;
|
||||
TetheringConfigurationParcel config;
|
||||
TetherStatesParcel states;
|
||||
|
||||
@@ -183,12 +183,6 @@ public class TetheringManager {
|
||||
*/
|
||||
public static final int TETHERING_WIGIG = 6;
|
||||
|
||||
/**
|
||||
* The int value of last tethering type.
|
||||
* @hide
|
||||
*/
|
||||
public static final int MAX_TETHERING_TYPE = TETHERING_WIGIG;
|
||||
|
||||
/** @hide */
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef(value = {
|
||||
@@ -525,9 +519,6 @@ public class TetheringManager {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSupportedTetheringTypes(long supportedBitmap) { }
|
||||
|
||||
@Override
|
||||
public void onUpstreamChanged(Network network) { }
|
||||
|
||||
@@ -1039,19 +1030,6 @@ public class TetheringManager {
|
||||
* upstream status.
|
||||
*/
|
||||
public interface TetheringEventCallback {
|
||||
/**
|
||||
* Called when tethering supported status changed.
|
||||
*
|
||||
* <p>This callback will be called immediately after the callback is
|
||||
* registered, and never be called if there is changes afterward.
|
||||
*
|
||||
* <p>Tethering may be disabled via system properties, device configuration, or device
|
||||
* policy restrictions.
|
||||
*
|
||||
* @param supported whether any tethering type is supported.
|
||||
*/
|
||||
default void onTetheringSupported(boolean supported) {}
|
||||
|
||||
/**
|
||||
* Called when tethering supported status changed.
|
||||
*
|
||||
@@ -1061,10 +1039,9 @@ public class TetheringManager {
|
||||
* <p>Tethering may be disabled via system properties, device configuration, or device
|
||||
* policy restrictions.
|
||||
*
|
||||
* @param supportedTypes a set of @TetheringType which is supported.
|
||||
* @hide
|
||||
* @param supported The new supported status
|
||||
*/
|
||||
default void onSupportedTetheringTypes(@NonNull Set<Integer> supportedTypes) {}
|
||||
default void onTetheringSupported(boolean supported) {}
|
||||
|
||||
/**
|
||||
* Called when tethering upstream changed.
|
||||
@@ -1362,8 +1339,7 @@ public class TetheringManager {
|
||||
@Override
|
||||
public void onCallbackStarted(TetheringCallbackStartedParcel parcel) {
|
||||
executor.execute(() -> {
|
||||
callback.onSupportedTetheringTypes(unpackBits(parcel.supportedTypes));
|
||||
callback.onTetheringSupported(parcel.supportedTypes != 0);
|
||||
callback.onTetheringSupported(parcel.tetheringSupported);
|
||||
callback.onUpstreamChanged(parcel.upstreamNetwork);
|
||||
sendErrorCallbacks(parcel.states);
|
||||
sendRegexpsChanged(parcel.config);
|
||||
@@ -1382,13 +1358,6 @@ public class TetheringManager {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSupportedTetheringTypes(long supportedBitmap) {
|
||||
executor.execute(() -> {
|
||||
callback.onSupportedTetheringTypes(unpackBits(supportedBitmap));
|
||||
});
|
||||
}
|
||||
|
||||
private void sendRegexpsChanged(TetheringConfigurationParcel parcel) {
|
||||
callback.onTetherableInterfaceRegexpsChanged(new TetheringInterfaceRegexps(
|
||||
parcel.tetherableBluetoothRegexs,
|
||||
@@ -1426,23 +1395,6 @@ public class TetheringManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpack bitmap to a set of bit position intergers.
|
||||
* @hide
|
||||
*/
|
||||
public static ArraySet<Integer> unpackBits(long val) {
|
||||
final ArraySet<Integer> result = new ArraySet<>(Long.bitCount(val));
|
||||
int bitPos = 0;
|
||||
while (val != 0) {
|
||||
if ((val & 1) == 1) result.add(bitPos);
|
||||
|
||||
val = val >>> 1;
|
||||
bitPos++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove tethering event callback previously registered with
|
||||
* {@link #registerTetheringEventCallback}.
|
||||
|
||||
Reference in New Issue
Block a user