Integration guide

This page outlines how to integrate unbundled apps. Apps that include Dialer, Media, Car UI Library, and SMS are considered unbundled apps. These apps are unbundled from the Android platform and include the logic for receiving data from the phone companion app and UX on the car side, including settings for association and feature enrollment.

APKs built from the unbundled code work with several versions of the platform.

Check out the code

To check out the unbundled code:

  1. Run the following:
    repo init -u https://android.googlesource.com/platform/manifest -b ub-automotive-master
    repo sync -cq -j4
    
  2. To learn more about working with AOSP source code, see Initializing a Repo Client.

Build the code

Android Studio

To build the code in Android Studio:

  1. In Android Studio, import this build file:
    packages/apps/Car/libs/aaos-apps-gradle-project/build.gradle
  2. Be sure to set the Gradle JDK in Android Studio to at least Version 11:


    Figure 1. Version 11.
  3. Build the desired APKs.

Command line

To build the code from the command line:

  1. Set the Android SDK location in one of these two ways:
    • Create packages/apps/Car/libs/aaos-apps-gradle-project/local.properties and then set the sdk.dir property it contains. Android Studio can do this automatically when opening a project. For example, use sdk.dir=/Users/MY-USERNAME/Library/Android/sdk.

      or
    • Set the ANDROID_SDK_ROOT environment variable with the path to the Android SDK.
  2. Open a command prompt or a shell window.
  3. Go to packages/apps/Car/libs/aaos-apps-gradle-project.
  4. Run the following command:
    ./gradlew assemble

Minimum required API levels

Each unbundled app works on Android platforms with a version equal to or greater than its minSdkVersion. The following table lists the minimum API version supported by each app:

App Minimum API level
Calendar 29
Car UI library 29
CompanionDevice 29
Dialer 31
Media 30
SMS 30
AOSP Host 29

Integrating a prebuild into a system image

Android 13 and higher images

The unbundled code is removed from the Android 13 platform. Therefore, adding prebuilt APKs into platform builds might be required for:

  • CDD compliance testing
  • Provisioning privileged apps

This is achieved with the android_app_import Soong rule:

android_app_import {
    name: "CarMediaApp",
    apk: "CarMediaApp.apk",
    privileged: true,
    certificate: "platform", // Media must be signed by the platform
    required: ["allowed_privapp_com.android.car.media"],
}

Android 12 and lower

As long as the Android platform version is supported by the app (see table above), the APK can be added to that system image. However, most unbundled apps have previous versions of source code included in platforms lower than Android 13. By default, Soong gives precedence to the source code over a prebuilt. Therefore, it's necessary to set the prefer flag to true inside the android_app_import rule:

android_app_import {
    name: "CarDialerApp",
    apk: "CarDialerApp.apk",
    privileged: true,
    presigned: true, // Dialer can have its own signature
    required: ["allowed_privapp_com.android.car.dialer"],
    overrides: ["Dialer"],
    prefer: true, // The prebuilt replaces a source target with the same name,
    }

Apps listed according to unbundled type

App Privileged unbundled Unbundled
(Needn't be on system partition)
System signed Non-system signed
Calendar X
CompanionDevice X
Dialer X
AOSP Host X
Media X
SMS X
Update distribution OTA OTA or Google Play OTA or Google Play