audioservice.java_AudioService 和AudioManager 以及使用举例.

本文介绍了Android中的AudioService实现,该服务通过IAudioService.Stub扩展,并在AudioManager中封装以获取和设置音量。AudioManager通过getService()获取AudioService实例,提供了设置音量等操作。示例代码展示了如何获取原始音量和调用服务设置音量。
摘要由CSDN通过智能技术生成

/**

* The implementation of the volume manager service.

*

* This implementation focuses on delivering a responsive UI. Most methods are

* asynchronous to external calls. For example, the task of setting a volume

* will update our internal state, but in a separate thread will set the system

* volume and later persist to the database. Similarly, setting the ringer mode

* will update the state and broadcast a change and in a separate thread later

* persist the ringer mode.

*

* @hide

*/

frameworks/base/media/java/android/media/AudioService .java

public class AudioService extends IAudioService.Stub {

}

AudioService .java 提供了audio service 的服务实现, IAudioService.aidl 定义了服务的方法.

private static IAudioService sService;

/**

* @hide

*/

public AudioManager(Context context)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值