# Alexa Auto Client Service (AACS)
## Overview
Alexa Auto Client Service (AACS) is an Alexa Auto SDK feature packaged in an Android archive library (AAR). By providing a common service framework, AACS simplifies the integration of the Auto SDK with your Android device and supports all the Auto SDK extensions.
Your application communicates with AACS through an intent, which is a messaging object on an Android device. AACS provides the platform implementation for certain interfaces, which speeds up Alexa integration for in-vehicle infotainment (IVI). Without AACS, typical integration of the Auto SDK in the IVI involves the implementation of abstract interfaces provided by each Auto SDK module to handle platform-specific functionality. To implement all required platform interfaces, the Auto SDK is integrated to an event-based system that converts from direct method APIs to an event-based architecture.
This document assumes that you understand how the Auto SDK works, as described in the [Auto SDK concepts documentation](https://alexa.github.io/alexa-auto-sdk/docs/explore/concepts). When this document uses the term "application," it refers to the application you develop on the Android platform. Information for your application in this document also applies to your Android service.
## AACS Architecture
The following diagram shows the high-level architecture of AACS on the Android platform. The shaded boxes in the diagram represent components developed by Amazon that are packaged in AACS.
![AACS Arch Detailed](./docs/diagrams/AACSArchDetailed.png)
The following list describes the components in the AACS service layer, as illustrated in the diagram, and how they interact with one another and with the Auto SDK:
1. **AlexaAutoClientService** is a persistent service that can start automatically after device boot-up or be manually started by an application through a `startService()` call. The service performs the following functions:
* Instantiating the Auto SDK Engine.
* Creating and registering the AASB message handler with the AASB MessageBroker.
* Setting the required Engine configuration.
* Managing the notifications displayed in the system notification area.
2. **PhoneControlMessagingImpl** and **NavigationMessagingImpl** are messaging implementations that serialize direct API calls into a standardized message format. The `PhoneControlMessagingImpl` or `NavigationMessagingImpl` converts platform interface method parameters into the message payload of the respective messaging implementation. The message is then sent to the service layer by using the AASB `MessageBroker` with a specific message topic and action. The messaging implementation also subscribes to message topics that are sent from the human-machine interface (HMI) application to the Auto SDK.
3. **AudioInputImpl**, **AudioOutputImpl**, **ExternalMediaPlayerImpl**, and **AdditionalPlatformImpl** are the direct implementations of Auto SDK platform interfaces. You can enable or disable the implementations in the AACS AAR through the configuration file. If an implementation is disabled, the platform message handler must be provided by a client application.
4. **AASB MessageBroker** is an abstraction built on top of the Auto SDK core. `MessageBroker` routes messages between the application and the Auto SDK core. When the
application responds to `MessageBroker` with an event, the event is routed back through the platform interface implementation.
5. **AASB MessageHandler** implements the platform-specific logic to send and receive AASB messages.
6. **Mediaplayer** handles the default AudioOutput actions, such as prepare, play, and pause for a TTS channel.
7. **IPCLibrary** defines the protocol for the communication between the HMI application and AACS.
It provides the APIs for sending and receiving AASB Messages over the Android Intent/Binder interface and
supports streaming audio data to and from an external application. It builds into an Android archive (AAR) file, which you can include in other apps that need to communicate with AACS. For more information about the IPC, see this [README](common/ipc/README.md).
8. **LVCInteractionProvider** implements APIs defined by the `ILVCClient` Android Interface Definition Language (AIDL) file to connect with `ILVCService`, which is implemented by the Local Voice Control (LVC) application. This connection also enables the LVC APK to provide the configuration for LVC.
9. The core of the **HMI application** that holds the business logic need not change with
`AlexaAutoClientService`. However, you must modify the application so that it can interface with the APIs defined by AACS.
### AACS as Foreground Service or System Service
AACS runs as a started service on Android. The [Initialization](#initialization) section describes how it is started; this section describes what you do to run AACS as a foreground service or a system service.
#### As Foreground Service
Typically, AACS is started as a foreground service, which has higher priority and continues running unless it is under memory constraints. In addition, the service displays notifications to alert the user that it is running.
AACS is run as a foreground service if your application containg AACS AAR is not a system application.
Then your application can use the `startForegroundService()` function to initialize AACS. If AACS is started properly, a notification is displayed.
Since Android 8.0 (API level 26), foreground services have had
some changes in how they are initialized. The following code checks the Android version and calls the correct API:
~~~
Intent intentStartService = new Intent();
intentStartService.setComponent(new ComponentName(AACSConstants.getAACSPackageName(new WeakReference<Context>(context)),
"com.amazon.alexaautoclientservice.AlexaAutoClientService"));
intentStartService.setAction(Action.LAUNCH_SERVICE);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
startForegroundService(intent);
} else {
startService(intent);
}
~~~
#### As Persistent System Service
If you have root access on the device and your application containing AACS AAR is a system application, then AACS is run as a system service.
Your application no longer needs to start AACS in the foreground, and no notifications appear to show that the service is running. The following example shows an application starting AACS as a system service:
~~~
Intent intentStartService = new Intent();
intentStartService.setComponent(new ComponentName(AACSConstants.getAACSPackageName(new WeakReference<Context>(context)),
"com.amazon.alexaautoclientservice.AlexaAutoClientService"));
intentStartService.setAction(Action.LAUNCH_SERVICE);
startService(intent);
~~~
Note: persistentSystemService configuration is deprecated. You no longer need to specify this field to run AACS as a persistent system service.
### AACS Initialization and Configuration
Initializing AACS means getting AACS ready to communicate with other applications. However, Alexa functionality is not available until AACS receives the configuration.
#### Initialization
There are two ways to initialize AACS:
* Start AACS from an application:
AACS includes a permission that determines whether an application can start or stop the service. For an application to start or stop AACS, specify the permission name in the application's `AndroidManifest.xml` file as follows:
`<uses-permission android:name="com.amazon.alexaautoclientservice"/>`
For an example of starting AACS from an application, see [example for starting AACS as a system service](#as-persistent-system-service).
* Start AACS upon device boot: If you want AACS to start every time the user turns on the device, set `startOnDeviceBootEnabled` in `aacs.general` of your configuration to `true`. Due to this setting, AACS initiates a `startService()` call on itself when it receives the `BOOT_COMPLETED` intent, which the device broadcasts when it is finished
没有合适的资源?快使用搜索试试~ 我知道了~
AlexaAutoSDK供汽车原始设备制造商将Alexa直接集成.zip
共4092个文件
xml:735个
java:623个
h:559个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 66 浏览量
2023-04-05
13:00:33
上传
评论
收藏 20.25MB ZIP 举报
温馨提示
AlexaAutoSDK供汽车原始设备制造商将Alexa直接集成.zip
资源推荐
资源详情
资源评论
收起资源包目录
AlexaAutoSDK供汽车原始设备制造商将Alexa直接集成.zip (4092个子文件)
6d41d539.0 2KB
6d41d539.0 2KB
b204d74a.0 2KB
b204d74a.0 2KB
85cf5865.0 2KB
85cf5865.0 2KB
f387163d.0 1KB
f387163d.0 1KB
09789157.0 1KB
09789157.0 1KB
3513523f.0 1KB
3513523f.0 1KB
ce5e74ef.0 1KB
ce5e74ef.0 1KB
de6d66f3.0 737B
de6d66f3.0 737B
8cb5ee0f.0 656B
8cb5ee0f.0 656B
aac-android 199B
aac-linux 80B
aac-macos 52B
aac-mingw 494B
aac-poky 167B
aac-qnx 10B
aac-qnx700 190B
aac-qnx710 162B
lib_Makefile_add.am 597B
ringbuf-test.c 93KB
core.c 22KB
player.c 13KB
core.c 12KB
player.c 11KB
ringbuf.c 8KB
common.c 7KB
recorder.c 5KB
player.c 5KB
core.c 2KB
recorder.c 1KB
mathstubs.c 243B
.clang-format 669B
.clang-format 40B
aac-core-module.cmake 5KB
aac-sampleapp.cmake 4KB
001-aac-base-module.cmake 1KB
qnx7_toolchain_armv8.cmake 418B
qnx7_toolchain_x86_64.cmake 409B
fix-findLibevent.cmake 402B
fix-findJemalloc.cmake 337B
aac-alexa-module.cmake 150B
cmake-wrapper 1KB
cmake-wrapper.cmd 1KB
conan.conf 32B
lombok.config 213B
COPYING 7KB
AlexaEngineService.cpp 127KB
ExternalMediaPlayer.cpp 75KB
AddressBookCloudUploaderTest.cpp 68KB
CBLAuthorizationProvider.cpp 60KB
AddressBookCloudUploader.cpp 55KB
AudioChannelEngineImpl.cpp 47KB
SpeechRecognizerEngineImpl.cpp 47KB
Application.cpp 45KB
PhoneCallControllerCapabilityAgent.cpp 43KB
NavigationEngineImpl.cpp 42KB
PhoneCallControllerCapabilityAgentTest.cpp 37KB
ExternalMediaPlayerEngineImpl.cpp 36KB
SpeechRecognizerEngineImplTest.cpp 35KB
MessagingHandler.cpp 34KB
AlexaConnectivityEngineImplTest.cpp 32KB
NavigationCapabilityAgent.cpp 31KB
AudioOutputImpl.cpp 30KB
PhoneControlHandler.cpp 30KB
AddressBookCloudUploaderRESTAgent.cpp 30KB
LocalMediaSourceEngineImpl.cpp 28KB
ExternalMediaAdapterEngineImpl.cpp 28KB
CarControlDataProvider.cpp 28KB
NavigationHandler.cpp 26KB
CarControlConfigurationImpl.cpp 26KB
NavigationAssistanceCapabilityAgent.cpp 26KB
AASBExternalMediaAdapter.cpp 26KB
CBLAuthorizationProviderTest.cpp 24KB
AgentHandler.cpp 23KB
LocalMediaSourceHandler.cpp 22KB
CustomDomainCapabilityAgent.cpp 22KB
ExternalMediaAdapterHandler.cpp 21KB
ExternalMediaAdapterBinder.cpp 21KB
Views.cpp 21KB
AlexaMockComponentFactory.cpp 21KB
AlexaConfigurationImpl.cpp 21KB
DisplayManagerCapabilityAgent.cpp 20KB
DisplayManagerCapabilityAgentTest.cpp 20KB
AudioPlayerEngineImplTest.cpp 20KB
EngineImpl.cpp 20KB
AudioOutputProviderHandler.cpp 19KB
AlexaAuthorizationProviderTest.cpp 19KB
ConnectivityCapabilityAgent.cpp 19KB
AuthorizationHandler.cpp 19KB
AlexaConnectivityEngineImpl.cpp 19KB
AASBAudioOutput.cpp 18KB
AlexaConnectivityHandler.cpp 18KB
共 4092 条
- 1
- 2
- 3
- 4
- 5
- 6
- 41
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功