Add TYPE_BLUETOOTH network interface for reverse tethering.
Change-Id: I2aa61ce15f57aea9e8fd3a4cb56799c8bc51e998
This commit is contained in:
@@ -213,10 +213,16 @@ public class ConnectivityManager
|
|||||||
*/
|
*/
|
||||||
public static final int TYPE_WIMAX = 6;
|
public static final int TYPE_WIMAX = 6;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bluetooth data connection. This is used for Bluetooth reverse tethering.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int TYPE_BLUETOOTH = 7;
|
||||||
|
|
||||||
/** {@hide} */
|
/** {@hide} */
|
||||||
public static final int TYPE_DUMMY = 7;
|
public static final int TYPE_DUMMY = 8;
|
||||||
/** {@hide} TODO: Need to adjust this for WiMAX. */
|
/** {@hide} TODO: Need to adjust this for WiMAX. */
|
||||||
public static final int MAX_RADIO_TYPE = TYPE_WIFI;
|
public static final int MAX_RADIO_TYPE = TYPE_DUMMY;
|
||||||
/** {@hide} TODO: Need to adjust this for WiMAX. */
|
/** {@hide} TODO: Need to adjust this for WiMAX. */
|
||||||
public static final int MAX_NETWORK_TYPE = TYPE_DUMMY;
|
public static final int MAX_NETWORK_TYPE = TYPE_DUMMY;
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,7 @@
|
|||||||
|
|
||||||
package com.android.server;
|
package com.android.server;
|
||||||
|
|
||||||
import android.app.Notification;
|
import android.bluetooth.BluetoothTetheringDataTracker;
|
||||||
import android.app.NotificationManager;
|
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -26,9 +25,9 @@ import android.database.ContentObserver;
|
|||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.DummyDataStateTracker;
|
import android.net.DummyDataStateTracker;
|
||||||
import android.net.IConnectivityManager;
|
import android.net.IConnectivityManager;
|
||||||
|
import android.net.LinkProperties;
|
||||||
import android.net.MobileDataStateTracker;
|
import android.net.MobileDataStateTracker;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.net.LinkProperties;
|
|
||||||
import android.net.NetworkStateTracker;
|
import android.net.NetworkStateTracker;
|
||||||
import android.net.NetworkUtils;
|
import android.net.NetworkUtils;
|
||||||
import android.net.Proxy;
|
import android.net.Proxy;
|
||||||
@@ -50,7 +49,6 @@ import android.util.EventLog;
|
|||||||
import android.util.Slog;
|
import android.util.Slog;
|
||||||
|
|
||||||
import com.android.internal.telephony.Phone;
|
import com.android.internal.telephony.Phone;
|
||||||
|
|
||||||
import com.android.server.connectivity.Tethering;
|
import com.android.server.connectivity.Tethering;
|
||||||
|
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
@@ -58,7 +56,6 @@ import java.io.FileWriter;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -412,6 +409,10 @@ public class ConnectivityService extends IConnectivityManager.Stub {
|
|||||||
mNetAttributes[netType].mName);
|
mNetAttributes[netType].mName);
|
||||||
mNetTrackers[netType].startMonitoring(context, mHandler);
|
mNetTrackers[netType].startMonitoring(context, mHandler);
|
||||||
break;
|
break;
|
||||||
|
case ConnectivityManager.TYPE_BLUETOOTH:
|
||||||
|
mNetTrackers[netType] = BluetoothTetheringDataTracker.getInstance();
|
||||||
|
mNetTrackers[netType].startMonitoring(context, mHandler);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
loge("Trying to create a DataStateTracker for an unknown radio type " +
|
loge("Trying to create a DataStateTracker for an unknown radio type " +
|
||||||
mNetAttributes[netType].mRadio);
|
mNetAttributes[netType].mRadio);
|
||||||
|
|||||||
Reference in New Issue
Block a user