0

在哪里可以找到可用于以下功能的不同“int 路由”的列表:

setAudioRoute (int routes)

或者

setRouting (int mode, int routes, int mask)

我想找到一个具有不同 int 的列表,例如:

1 = 扬声器

2 = 蓝牙

3 = 耳机

4

1 回答 1

0

您可以在本文档中找到可能的音频路由: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);
        }
    }
于 2019-11-21T03:20:59.550 回答