droid_wrap/android/media.rs
1/*
2 * Copyright (c) 2024. The RigelA open source project team and
3 * its contributors reserve all rights.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software distributed under the
10 * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and limitations under the License.
12 */
13
14use crate::{JObjNew, JObjRef, JType, java_class};
15
16/// AudioManager 提供对音量和铃声模式的控制。
17#[java_class(name = "android/media/AudioManager")]
18pub struct AudioManager;
19
20impl AudioManager {
21 /**
22 广播操作:有线耳机已插入或拔出。您无法通过清单中声明的组件接收此信息,只能通过使用 Context.registerReceiver() 明确注册来接收。
23 意图将具有以下额外值: state - 0 表示拔出,1 表示插入。 name - 耳机类型,人类可读的字符串 microphone - 如果耳机有麦克风则为 1,否则为 0
24 */
25 pub const ACTION_HEADSET_PLUG: &'static str = "android.intent.action.HEADSET_PLUG";
26}