InstrumentClusterRenderingService 使用解析

InstrumentClusterRenderingService 使用解析


InstrumentClusterRenderingService

InstrumentClusterRenderingService类为Android Car下car-lib目录下的api接口。主要是提供仪表盘渲染效果的服务。但是这个类使用的API解释得比较复杂,所以这里单独做一下解析。

2326194-8e1c435fbba3ab0f.png
car automotive架构

首先,该类处于Car API目录下,属于直接提供给APP使用的接口,同时在Car-Service中也存在一个极为类似的类InstrumentClusterService,该类处于Car SERVICE层中,与android 原生中ANDROID SYSTEM SERVICES 同层级,并相互调用。

解析相关类

那么我们先来看google是怎么解释得。首先是InstrumentClusterRenderingService
,官方的解释文档

 * A service that used for interaction between Car Service and Instrument Cluster. Car Service may
 * provide internal navigation binder interface to Navigation App and all notifications will be
 * eventually land in the {@link NavigationRenderer} returned by {@link #getNavigationRenderer()}.
 *
 * <p>To extend this class, you must declare the service in your manifest file with
 * the {@code android.car.permission.BIND_INSTRUMENT_CLUSTER_RENDERER_SERVICE} permission
 * <pre>
 * &lt;service android:name=".MyInstrumentClusterService"
 *          android:permission="android.car.permission.BIND_INSTRUMENT_CLUSTER_RENDERER_SERVICE">
 * &lt;/service></pre>
 * <p>Also, you will need to register this service in the following configuration file:
 * {@code packages/services/Car/service/res/values/config.xml}

翻译一下意思:

InstrumentClusterRenderingService用于Car Service和汽车组合仪表之间的交互。Car Service将为导航应用提供内部导航代理接口,并且所有的通知将展示在NavigationRenderer上,并且通过getNavigationRenderer()可以返回对应的NavigationRenderer。继承该类时,需要在manifest文件下声明该service,并且需要获取android.car.permission.BIND_INSTRUMENT_CLUSTER_RENDERER_SERVICE权限,获取方式:
<service android:name=".MyInstrumentClusterService" android:permission="android.car.permission.BIND_INSTRUMENT_CLUSTER_RENDERER_SERVICE">
service>
并且,你将需要在以下目录:packages/services/Car/service/res/values/config.xml注册该服务。

可以看出该类主要用途在于实现Car service层与Car API层中仪表模块的交互,并处理仪表相关的通知功能。

其次,InstrumentClusterService类,先看官方解释

Service responsible for interaction with car's instrument cluster.

翻译过来就是:

负责与汽车仪表盘交互的服务。

也就是说此类主要是服务提供,实现Car service层相关功能。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值