AOSP host integration guide

The Android Open Source Project (AOSP) Automotive App Host is a part of the Car App Library used by third-party (3P) developers to enable apps for Android Automotive. The App Host is a system app that allows 3P car apps to render OEM-styled user interface (UI) components on its behalf.

To run 3P apps, both the 3P app and the AOSP Automotive App Host must be installed:

  • Automotive App Host provides 3P apps with a a set of UI templates and components optimized for vehicles, including capabilities like usability and safety.
  • OEMs can style these UI templates and components.
  • The result? 3P apps are visually well-integrated into the infotainment system of the OEM.

This page explains how to generate the AOSP Automotive App Host from the Gradle project in the ub-automotive branch and then how to integrate the AOSP Automotive App Host into car targets.

Check out the code

To check out the unbundled code:

  1. Run the following command:
    repo init -u -b ub-automotive-master
    repo sync -j4
  2. To learn more about working with AOSP source code, see Initialize a Repo client.

  3. Install Android Studio.

Create the AOSP host APK

  1. Check out ub-automotive and then open the Gradle project under packages/apps/Car/Templates/Host.
  2. To configure the project with the Android SDK, configure your project's file. You can find the path under Android SDK Settings in Android Studio.
  3. Create the host APK as a typical Gradle project. For example, run the gradle command:
    ./gradlew :app:assembleDebug

    The APK file is located in:


Embed the AOSP host

  1. Create a new file to include the following content:
    LOCAL_PATH := $(my-dir)
    ################## Start of AOSPHost target ##################
    include $(CLEAR_VARS)
    LOCAL_LICENSE_KINDS := legacy_notice
    LOCAL_MODULE_OWNER := google
    LOCAL_MODULE_TAGS := optional
    LOCAL_BUILT_MODULE_STEM := package.apk
    LOCAL_DEX_PREOPT := false
    include $(BUILD_PREBUILT)
  2. Rename the app-debug.apk to AOSPHost.apk and put the APK in the same folder as
  3. Add the CarAOSPHost module to your targets as PRODUCT_PACKAGES:
       CarAOSPHost \

Add the permissions config

  1. Create a file called to contain the following:
        <!-- Rename the package to -->
        <privapp-permissions package="">
            <!-- To be able to display activities in the cluster -->
            <permission name="" />
            <!-- To be able to show navigation state (turn by turn directions) in the cluster.-->
            <permission name="" />
            <!-- To be considered a system-approved host -->
            <permission name="" />
        <!-- Declare support for templated applications. -->
        <feature name="" />
  2. In your target, add the config file to your targets:
        <the file root>/$(TARGET_COPY_OUT_VENDOR)/etc/permissions/

Build the target

When you build the target, the host is installed and permission is granted:

      … granted=true granted=true granted=true

Test the integration

To build and install the samples, see this GitHub project, car-samples/car_app_library.