在哪里可以找到可用于以下功能的不同"int路由"的列表:
setAudioRoute (int routes)
或
setRouting (int mode, int routes, int mask)
我想找到一个具有不同 int 的列表,例如:
1 = 扬声器
2 = 蓝牙
3 = 耳机
您可以在本文档中找到可能的音频路由:CallAudioState
我发现找到它的最佳方法是在实际代码中使用文档。如果您进入文件,请查看该函数的文档,它:
/**
* Sets the audio route (speaker, bluetooth, etc...). When this request is honored, there will
* be change to the {@link #getCallAudioState()}.
* <p>
* Used by self-managed {@link ConnectionService}s which wish to change the audio route for a
* self-managed {@link Connection} (see {@link PhoneAccount#CAPABILITY_SELF_MANAGED}.)
* <p>
* See also {@link InCallService#setAudioRoute(int)}.
*
* @param route The audio route to use (one of {@link CallAudioState#ROUTE_BLUETOOTH},
* {@link CallAudioState#ROUTE_EARPIECE}, {@link CallAudioState#ROUTE_SPEAKER}, or
* {@link CallAudioState#ROUTE_WIRED_HEADSET}).
*/
public final void setAudioRoute(int route) {
for (Listener l : mListeners) {
l.onAudioRouteChanged(this, route, null);
}
}