Make BluetoothPan implement BluetoothProfile.

This makes it consistent across all other profiles.

Change-Id: I4c0694d042d7ed1b78c92ca3be38c8d543886769
This commit is contained in:
Jaikumar Ganesh
2011-02-23 13:08:09 -08:00
parent 77bcd7e807
commit 9ad703cdb9
3 changed files with 36 additions and 10 deletions

View File

@@ -736,12 +736,22 @@ abstract class LocalBluetoothProfileManager {
}
}
private static class PanProfileManager extends LocalBluetoothProfileManager {
private final BluetoothPan mService;
private static class PanProfileManager extends LocalBluetoothProfileManager
implements BluetoothProfile.ServiceListener {
private BluetoothPan mService;
public PanProfileManager(LocalBluetoothManager localManager) {
super(localManager);
mService = new BluetoothPan(localManager.getContext());
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
adapter.getProfileProxy(localManager.getContext(), this, BluetoothProfile.PAN);
}
public void onServiceConnected(int profile, BluetoothProfile proxy) {
mService = (BluetoothPan) proxy;
}
public void onServiceDisconnected(int profile) {
mService = null;
}
@Override
@@ -799,7 +809,7 @@ abstract class LocalBluetoothProfileManager {
@Override
public int getConnectionStatus(BluetoothDevice device) {
return convertState(mService.getPanDeviceState(device));
return convertState(mService.getConnectionState(device));
}
@Override