本文整理汇总了Java中android.media.AudioManager.MODE_IN_COMMUNICATION属性的典型用法代码示例。如果您正苦于以下问题:Java AudioManager.MODE_IN_COMMUNICATION属性的具体用法?Java AudioManager.MODE_IN_COMMUNICATION怎么用?Java AudioManager.MODE_IN_COMMUNICATION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.media.AudioManager
的用法示例。
在下文中一共展示了AudioManager.MODE_IN_COMMUNICATION属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setAudioManagerInCallMode
public void setAudioManagerInCallMode() {
if (mAudioManager.getMode() == AudioManager.MODE_IN_COMMUNICATION) {
Log.w("[AudioManager] already in MODE_IN_COMMUNICATION, skipping...");
return;
}
Log.d("[AudioManager] Mode: MODE_IN_COMMUNICATION");
mAudioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
}
示例2: run
public void run() {
final int mode = audioManager.getMode();
if (mode == AudioManager.MODE_RINGTONE) {
Logging.d(TAG, "STREAM_RING stream volume: "
+ audioManager.getStreamVolume(AudioManager.STREAM_RING) + " (max="
+ maxRingVolume + ")");
} else if (mode == AudioManager.MODE_IN_COMMUNICATION) {
Logging.d(TAG, "VOICE_CALL stream volume: "
+ audioManager.getStreamVolume(AudioManager.STREAM_VOICE_CALL) + " (max="
+ maxVoiceCallVolume + ")");
}
}
示例3: isCommunicationModeEnabled
private boolean isCommunicationModeEnabled() {
return (audioManager.getMode() == AudioManager.MODE_IN_COMMUNICATION);
}