​​​Launcher Compatibility

launcher.jpg

Andr​oid Car Launcher Integration

For templated app​​s and services to be displayed to the headunit client, the headunit is required to update the Car Launcher with interfaces to Package Manager and Ignite Store. These APIs are used to determine which apps and services to display on the app grid, and what is the process for launching (Launch package name, Activity, and source selection).

In addition, App Tray integration covers for the App Store client needed as well​

Title Description

Support fo​​r displaying Android Automotive media apps in the App Grid

Car Launcher should modified to display Android Automotive Media Apps by scanning package manager manifests for apps that have no activity view, and invoke Media Session APIs. 

Action performed by user onClick will be to launch the vehicle's Car Media App and select the source the user has clicked on in the App Grid

Support for displaying Template​d Services in the App Grid

Templated Services that use template apps (i.e Mini App) ​​to present content must show up on the App Grid as well. The Launcher must be able to react to intents for adding and removing Ignite shortcuts on the App Grid UI

Pre-installed App Store​ Client (Optional)

App Store i​​s the first app in the app tray, pre-installed as a system app.

Differentiated A​pp Icon (Optional)

App St​ore is the only app with app tile with different colored tile background

App life​cycle

App tra​y must support scenarios for delete, update, and installation (progress). Apps must not be accessible during update and install

Newly Added (Op​​tional)

Apps that​​ have been newly installed or updated since last use are visually differentiated

App Category (​​Optional)

Downloaded apps shall be organized into categories. Categories should match the same or similar categories the apps are found in the Ignite Store client​


Lau​ncher Customization to add App Icons for Media services: 

Req​​​uir​​ement:

IGNITE3CI-541 -  ​Launcher icon for Media Open  :: As a user, I should see a icon for all media services on the app drawer that will launch the media player and select the media content provider as the source.

Instructions on how the Launcher can be customized by OEM such that media services can be shown as launch-able apps and starts car media template app with the launched app as selected source.​

Query for Media ​Servic​es to show in the app drawer

Below source code is a reference code to show how to query for Media Services

Get Media Services list and app info lik​e Label and Icon​

ResolveInfo mResolveInfo;
Context context = getContext();
if (context != null) {
    PackageManager packageManager = context.getPackageManager();
    if (packageManager != null) {
        List<ResolveInfo> mediaServices = packageManager.queryIntentServices(
                        new Intent(MediaBrowserService.SERVICE_INTERFACE),
                        PackageManager.GET_RESOLVED_FILTER);
        if(mediaServices != null && mediaServices.size() > 0) {
              items = new ArrayList<>(mediaServices.size());
              for (ResolveInfo info : mediaServices) {
					mResolveInfo = info;
					if(mResolveInfo != null && mResolveInfo.serviceInfo != null) {
						//Read media services apps label and icon that can be added to OEM specific launcher app grid/list adapter
						//Along with label and icon, have an indication to detect it as media service. This is needed to trigger media player intent once the icon is clicked from grid/list adapter
            			String appLabel= String.valueOf(mResolveInfo.serviceInfo.loadLabel(packageManager));
            			Drawable icon = mResolveInfo.serviceInfo.loadIcon(packageManager);
        			}
              }
         }
    }
}

Intent to start Car Media app on selecting Media Services app icon


Intent to start car media app with selec​ted content provider as source​

When the launcher app icon is clicked​ and detected as media service app, use below intent to start car media app and select the media content provider as the source.

String packageName = mResolveInfo.serviceInfo.packageName;
String className = mResolveInfo.serviceInfo.name;
ComponentName componentName = new ComponentName(packageName, className);

Intent intent = new Intent("android.car.intent.action.MEDIA_TEMPLATE");
intent.putExtra("android.car.intent.extra.MEDIA_PACKAGE", componentName.getPackageName());
intent.putExtra("android.car.intent.extra.MEDIA_COMPONENT", componentName);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);


Services Shor​​​tcuts​

For serv​​ices distributed through Ignite, the launcher must support interfacing with the Ignite Store via Android Intents to display service content. The launcher must react to intents for adding and removing Ignite shortcuts on the App Grid UI.

L​auncher must subscribe to the broadcast intent:​

<intent-filter>       
  <action android:name="android.content.pm.action.CONFIRM_PIN_SHORTCUT" />   
</intent-filter>

The Launcher must be updated with the following logic to add icons, labels, and perform the necessary Intent to Ignite Core Client

for (ShortcutInfo shortcut : shortcuts) {
    boolean igniteShortcut = false;

    // Create Intent
    igniteShortcut = shortcut.getExtras().getBoolean("IGNITE_SHORTCUT", false);
    if (shortcut.isEnabled() && igniteShortcut) {
        //Add icons to the app drawer
        //Add labels to the app drawer
    }
}