Loading core/java/android/bluetooth/BluetoothHeadset.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -189,11 +189,11 @@ public final class BluetoothHeadset { * @return One of the STATE_ return codes, or STATE_ERROR if this proxy * @return One of the STATE_ return codes, or STATE_ERROR if this proxy * object is currently not connected to the Headset service. * object is currently not connected to the Headset service. */ */ public int getState() { public int getState(BluetoothDevice device) { if (DBG) log("getState()"); if (DBG) log("getState()"); if (mService != null) { if (mService != null) { try { try { return mService.getState(); return mService.getState(device); } catch (RemoteException e) {Log.e(TAG, e.toString());} } catch (RemoteException e) {Log.e(TAG, e.toString());} } else { } else { Log.w(TAG, "Proxy not attached to service"); Log.w(TAG, "Proxy not attached to service"); Loading Loading @@ -271,11 +271,11 @@ public final class BluetoothHeadset { * be made asynchornous. Returns false if this proxy object is * be made asynchornous. Returns false if this proxy object is * not currently connected to the Headset service. * not currently connected to the Headset service. */ */ public boolean disconnectHeadset() { public boolean disconnectHeadset(BluetoothDevice device) { if (DBG) log("disconnectHeadset()"); if (DBG) log("disconnectHeadset()"); if (mService != null) { if (mService != null) { try { try { mService.disconnectHeadset(); mService.disconnectHeadset(device); return true; return true; } catch (RemoteException e) {Log.e(TAG, e.toString());} } catch (RemoteException e) {Log.e(TAG, e.toString());} } else { } else { Loading core/java/android/bluetooth/IBluetoothHeadset.aidl +2 −2 Original line number Original line Diff line number Diff line Loading @@ -24,10 +24,10 @@ import android.bluetooth.BluetoothDevice; * {@hide} * {@hide} */ */ interface IBluetoothHeadset { interface IBluetoothHeadset { int getState(); int getState(in BluetoothDevice device); BluetoothDevice getCurrentHeadset(); BluetoothDevice getCurrentHeadset(); boolean connectHeadset(in BluetoothDevice device); boolean connectHeadset(in BluetoothDevice device); void disconnectHeadset(); void disconnectHeadset(in BluetoothDevice device); boolean isConnected(in BluetoothDevice device); boolean isConnected(in BluetoothDevice device); boolean startVoiceRecognition(); boolean startVoiceRecognition(); boolean stopVoiceRecognition(); boolean stopVoiceRecognition(); Loading core/java/android/server/BluetoothService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1858,7 +1858,7 @@ public class BluetoothService extends IBluetooth.Stub { // Rather not do this from here, but no-where else and I need this // Rather not do this from here, but no-where else and I need this // dump // dump pw.println("\n--Headset Service--"); pw.println("\n--Headset Service--"); switch (headset.getState()) { switch (headset.getState(headset.getCurrentHeadset())) { case BluetoothHeadset.STATE_DISCONNECTED: case BluetoothHeadset.STATE_DISCONNECTED: pw.println("getState() = STATE_DISCONNECTED"); pw.println("getState() = STATE_DISCONNECTED"); break; break; Loading media/java/android/media/AudioService.java +11 −7 Original line number Original line Diff line number Diff line Loading @@ -1092,18 +1092,22 @@ public class AudioService extends IAudioService.Stub { private BluetoothHeadset.ServiceListener mBluetoothHeadsetServiceListener = private BluetoothHeadset.ServiceListener mBluetoothHeadsetServiceListener = new BluetoothHeadset.ServiceListener() { new BluetoothHeadset.ServiceListener() { public void onServiceConnected() { public void onServiceConnected() { if (mBluetoothHeadset != null && if (mBluetoothHeadset != null) { mBluetoothHeadset.getState() == BluetoothHeadset.STATE_CONNECTED) { BluetoothDevice device = mBluetoothHeadset.getCurrentHeadset(); if (mBluetoothHeadset.getState(device) == BluetoothHeadset.STATE_CONNECTED) { mBluetoothHeadsetConnected = true; mBluetoothHeadsetConnected = true; } } } } } public void onServiceDisconnected() { public void onServiceDisconnected() { if (mBluetoothHeadset != null && if (mBluetoothHeadset != null) { mBluetoothHeadset.getState() == BluetoothHeadset.STATE_DISCONNECTED) { BluetoothDevice device = mBluetoothHeadset.getCurrentHeadset(); if (mBluetoothHeadset.getState(device) == BluetoothHeadset.STATE_DISCONNECTED) { mBluetoothHeadsetConnected = false; mBluetoothHeadsetConnected = false; clearAllScoClients(); clearAllScoClients(); } } } } } }; }; /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// Loading wifi/java/android/net/wifi/WifiStateTracker.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -2324,7 +2324,7 @@ public class WifiStateTracker extends NetworkStateTracker { * @return Whether to disable coexistence mode. * @return Whether to disable coexistence mode. */ */ private boolean shouldDisableCoexistenceMode() { private boolean shouldDisableCoexistenceMode() { int state = mBluetoothHeadset.getState(); int state = mBluetoothHeadset.getState(mBluetoothHeadset.getCurrentHeadset()); return state == BluetoothHeadset.STATE_DISCONNECTED; return state == BluetoothHeadset.STATE_DISCONNECTED; } } } } Loading Loading
core/java/android/bluetooth/BluetoothHeadset.java +4 −4 Original line number Original line Diff line number Diff line Loading @@ -189,11 +189,11 @@ public final class BluetoothHeadset { * @return One of the STATE_ return codes, or STATE_ERROR if this proxy * @return One of the STATE_ return codes, or STATE_ERROR if this proxy * object is currently not connected to the Headset service. * object is currently not connected to the Headset service. */ */ public int getState() { public int getState(BluetoothDevice device) { if (DBG) log("getState()"); if (DBG) log("getState()"); if (mService != null) { if (mService != null) { try { try { return mService.getState(); return mService.getState(device); } catch (RemoteException e) {Log.e(TAG, e.toString());} } catch (RemoteException e) {Log.e(TAG, e.toString());} } else { } else { Log.w(TAG, "Proxy not attached to service"); Log.w(TAG, "Proxy not attached to service"); Loading Loading @@ -271,11 +271,11 @@ public final class BluetoothHeadset { * be made asynchornous. Returns false if this proxy object is * be made asynchornous. Returns false if this proxy object is * not currently connected to the Headset service. * not currently connected to the Headset service. */ */ public boolean disconnectHeadset() { public boolean disconnectHeadset(BluetoothDevice device) { if (DBG) log("disconnectHeadset()"); if (DBG) log("disconnectHeadset()"); if (mService != null) { if (mService != null) { try { try { mService.disconnectHeadset(); mService.disconnectHeadset(device); return true; return true; } catch (RemoteException e) {Log.e(TAG, e.toString());} } catch (RemoteException e) {Log.e(TAG, e.toString());} } else { } else { Loading
core/java/android/bluetooth/IBluetoothHeadset.aidl +2 −2 Original line number Original line Diff line number Diff line Loading @@ -24,10 +24,10 @@ import android.bluetooth.BluetoothDevice; * {@hide} * {@hide} */ */ interface IBluetoothHeadset { interface IBluetoothHeadset { int getState(); int getState(in BluetoothDevice device); BluetoothDevice getCurrentHeadset(); BluetoothDevice getCurrentHeadset(); boolean connectHeadset(in BluetoothDevice device); boolean connectHeadset(in BluetoothDevice device); void disconnectHeadset(); void disconnectHeadset(in BluetoothDevice device); boolean isConnected(in BluetoothDevice device); boolean isConnected(in BluetoothDevice device); boolean startVoiceRecognition(); boolean startVoiceRecognition(); boolean stopVoiceRecognition(); boolean stopVoiceRecognition(); Loading
core/java/android/server/BluetoothService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1858,7 +1858,7 @@ public class BluetoothService extends IBluetooth.Stub { // Rather not do this from here, but no-where else and I need this // Rather not do this from here, but no-where else and I need this // dump // dump pw.println("\n--Headset Service--"); pw.println("\n--Headset Service--"); switch (headset.getState()) { switch (headset.getState(headset.getCurrentHeadset())) { case BluetoothHeadset.STATE_DISCONNECTED: case BluetoothHeadset.STATE_DISCONNECTED: pw.println("getState() = STATE_DISCONNECTED"); pw.println("getState() = STATE_DISCONNECTED"); break; break; Loading
media/java/android/media/AudioService.java +11 −7 Original line number Original line Diff line number Diff line Loading @@ -1092,18 +1092,22 @@ public class AudioService extends IAudioService.Stub { private BluetoothHeadset.ServiceListener mBluetoothHeadsetServiceListener = private BluetoothHeadset.ServiceListener mBluetoothHeadsetServiceListener = new BluetoothHeadset.ServiceListener() { new BluetoothHeadset.ServiceListener() { public void onServiceConnected() { public void onServiceConnected() { if (mBluetoothHeadset != null && if (mBluetoothHeadset != null) { mBluetoothHeadset.getState() == BluetoothHeadset.STATE_CONNECTED) { BluetoothDevice device = mBluetoothHeadset.getCurrentHeadset(); if (mBluetoothHeadset.getState(device) == BluetoothHeadset.STATE_CONNECTED) { mBluetoothHeadsetConnected = true; mBluetoothHeadsetConnected = true; } } } } } public void onServiceDisconnected() { public void onServiceDisconnected() { if (mBluetoothHeadset != null && if (mBluetoothHeadset != null) { mBluetoothHeadset.getState() == BluetoothHeadset.STATE_DISCONNECTED) { BluetoothDevice device = mBluetoothHeadset.getCurrentHeadset(); if (mBluetoothHeadset.getState(device) == BluetoothHeadset.STATE_DISCONNECTED) { mBluetoothHeadsetConnected = false; mBluetoothHeadsetConnected = false; clearAllScoClients(); clearAllScoClients(); } } } } } }; }; /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// Loading
wifi/java/android/net/wifi/WifiStateTracker.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -2324,7 +2324,7 @@ public class WifiStateTracker extends NetworkStateTracker { * @return Whether to disable coexistence mode. * @return Whether to disable coexistence mode. */ */ private boolean shouldDisableCoexistenceMode() { private boolean shouldDisableCoexistenceMode() { int state = mBluetoothHeadset.getState(); int state = mBluetoothHeadset.getState(mBluetoothHeadset.getCurrentHeadset()); return state == BluetoothHeadset.STATE_DISCONNECTED; return state == BluetoothHeadset.STATE_DISCONNECTED; } } } } Loading