Merge "Add ability to set whether audio route is allowed in BluetoothHeadsetClient" into cw-e-dev am: 4636770f0d
am: 3b6f9f78cf
* commit '3b6f9f78cf0ea09176250059653d05cf6a5282c4':
Add ability to set whether audio route is allowed in BluetoothHeadsetClient
This commit is contained in:
@@ -1058,6 +1058,41 @@ public final class BluetoothHeadsetClient implements BluetoothProfile {
|
|||||||
return BluetoothHeadsetClient.STATE_AUDIO_DISCONNECTED;
|
return BluetoothHeadsetClient.STATE_AUDIO_DISCONNECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets whether audio routing is allowed.
|
||||||
|
*
|
||||||
|
* Note: This is an internal function and shouldn't be exposed
|
||||||
|
*/
|
||||||
|
public void setAudioRouteAllowed(boolean allowed) {
|
||||||
|
if (VDBG) log("setAudioRouteAllowed");
|
||||||
|
if (mService != null && isEnabled()) {
|
||||||
|
try {
|
||||||
|
mService.setAudioRouteAllowed(allowed);
|
||||||
|
} catch (RemoteException e) {Log.e(TAG, e.toString());}
|
||||||
|
} else {
|
||||||
|
Log.w(TAG, "Proxy not attached to service");
|
||||||
|
if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether audio routing is allowed.
|
||||||
|
*
|
||||||
|
* Note: This is an internal function and shouldn't be exposed
|
||||||
|
*/
|
||||||
|
public boolean getAudioRouteAllowed() {
|
||||||
|
if (VDBG) log("getAudioRouteAllowed");
|
||||||
|
if (mService != null && isEnabled()) {
|
||||||
|
try {
|
||||||
|
return mService.getAudioRouteAllowed();
|
||||||
|
} catch (RemoteException e) {Log.e(TAG, e.toString());}
|
||||||
|
} else {
|
||||||
|
Log.w(TAG, "Proxy not attached to service");
|
||||||
|
if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable()));
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initiates a connection of audio channel.
|
* Initiates a connection of audio channel.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ interface IBluetoothHeadsetClient {
|
|||||||
int getAudioState(in BluetoothDevice device);
|
int getAudioState(in BluetoothDevice device);
|
||||||
boolean connectAudio();
|
boolean connectAudio();
|
||||||
boolean disconnectAudio();
|
boolean disconnectAudio();
|
||||||
|
void setAudioRouteAllowed(boolean allowed);
|
||||||
|
boolean getAudioRouteAllowed();
|
||||||
|
|
||||||
Bundle getCurrentAgFeatures(in BluetoothDevice device);
|
Bundle getCurrentAgFeatures(in BluetoothDevice device);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user