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