最終更新:2021-10-18 (月) 13:32:44 (893d)
Android/音量
https://developer.android.com/guide/topics/media-apps/volume-and-earphones?hl=ja
メモ
- デフォルトでは、音量コントロールを押すと、アクティブな音声ストリームの音量が変更されます。
- アプリで何も再生していない場合は、音量ボタンを押すと音楽(Android 9 より前では着信音)の音量が調整されます。
クラス
- android.media.AudioManager
- android.media.AudioAttributes?
ストリーム
変更
メイン
- Activity.setVolumeControlStream?
その他
AudioManager.adjustStreamVolume(int streamType, int direction, int flags) Adjusts the volume of a particular stream by one step in a direction. AudioManager.adjustSuggestedStreamVolume?(int direction, int suggestedStreamType?, int flags) Adjusts the volume of the most relevant stream, or the given fallback stream. AudioManager.adjustVolume?(int direction, int flags) Adjusts the volume of the most relevant stream. AudioManager.setStreamVolume(int streamType, int index, int flags) Sets the volume index for a particular stream. AudioManager.setStreamSolo?(int streamType, boolean state) This method was deprecated in API level 23. Do not use. AudioManager.setStreamMute This method was deprecated in API level 23. Use AudioManager.adjustStreamVolume
フラグ
AudioManager.FLAG_SHOW_UI 1 Show a toast containing the current volume. AudioManager.FLAG_ALLOW_RINGER_MODES? 2 Whether to include ringer modes as possible options when changing volume. AudioManager.FLAG_PLAY_SOUND 4 Whether to play a sound when changing the volume AudioManager.FLAG_REMOVE_SOUND_AND_VIBRATE? 8 Removes any sounds/vibrate that may be in the queue, or are playing (related to changing volume). AudioManager.FLAG_VIBRATE? 16 Whether to vibrate if going into the vibrate ringer mode. AudioManager.FLAG_FIXED_VOLUME? 1 << 5 @hide AudioManager.FLAG_BLUETOOTH_ABS_VOLUME? 1 << 6 @hide AudioManager.FLAG_SHOW_SILENT_HINT? 1 << 7 @hide AudioManager.FLAG_HDMI_SYSTEM_AUDIO_VOLUME? 1 << 8 @hide AudioManager.FLAG_ACTIVE_MEDIA_ONLY? 1 << 9 @hide AudioManager.FLAG_SHOW_UI_WARNINGS? 1 << 10 @hide AudioManager.FLAG_SHOW_VIBRATE_HINT? 1 << 11 @hide AudioManager.FLAG_FROM_KEY? 1 << 12 @hide
キーコード定義
Nexus 7 (2013) AOSP/device/asus/flo/keypad_8064.kl? Android/system/usr/keylayout/keypad_8064.kl? Nexus 7 AOSP/device/asus/grouper/gpio-keys.kl? Nexus 5 AOSP/device/lge/hammerhead/gpio-keys.kl? Nexus 4 AOSP/device/lge/mako/keypad_8064.kl? Android/system/usr/keylayout/keypad_8064.kl? Nexus 6 AOSP/device/moto/shamu/gpio-keys.kl? Generic.kl AOSP/frameworks/base/data/keyboards/Generic.kl Android/system/usr/keylayout/Generic.kl qwerty.kl? AOSP/frameworks/base/data/keyboards/qwerty.kl? Android/system/usr/keylayout/qwerty.kl?
メモ
Android/バージョン 仕様 ~2.3.7 「着信音量」と「通知音量」は個別に設定可能です。 4.X (4.0~4.4) 「着信音量」と「通知音量」が同じ音量設定です。 5.0~6.0 「着信音量」と「通知音量」と「システム音量」が同じ音量設定です。