[MTCD Software Development] Timops:
Working example

folepole almost got it right. The problem was that he sent strings in his intent. The CanBus app only deals with integers. The following code works (successfully tested in my Mercedes-Benz W211 on a head unit running Hal9k's Android 7.1.2 ROM).

public void sendCanBusMusicOn()
{
Log.i("PlaybackService", "sendCanBusMusicOn()");
Intent canBusDisplayIntent = new Intent("com.microntek.canbusdisplay");
canBusDisplayIntent.putExtra("type", "music-on");
sendBroadcast(canBusDisplayIntent);
}

public void sendCanBusMusicOff()
{
Log.i("PlaybackService", "sendCanBusMusicOff()");
Intent canBusDisplayIntent = new Intent("com.microntek.canbusdisplay");
canBusDisplayIntent.putExtra("type", "music-off");
sendBroadcast(canBusDisplayIntent);
}

/**
* Sends track information to the CanBus App
* (to display in car's display)
*/
public void sendCanBusInfo()
{
String methodTag = "PlaybackService";
// send intent to "com.microntek.canbusdisplay"
// "type": "music" (String)
// "all": number of tracks in playlist / queue (int)
// "cur": currentPlayIndex, position of current track in playlist (int)
// "time": either 0 or actual time position in milliseconds (int)

int numberOfTracksInQueue = getTimelineLength(); // e.g. 241 for playlist with 241 tracks
int currentPositionInQueue = getTimelinePosition() + 1; // e.g. 5 for 5th track of current playlist
int currentTimeOffset = getPosition(); // in milliseconds, e.g. 20000 for 00:20

Intent canBusDisplayIntent = new Intent("com.microntek.canbusdisplay");
canBusDisplayIntent.putExtra("type", "music");
canBusDisplayIntent.putExtra("all", numberOfTracksInQueue);
canBusDisplayIntent.putExtra("cur", currentPositionInQueue);
canBusDisplayIntent.putExtra("time", currentTimeOffset);

String hms = String.format("%02d:%02d",
TimeUnit.MILLISECONDS.toMinutes(currentTimeOffset),
TimeUnit.MILLISECONDS.toSeconds(currentTimeOffset) % TimeUnit.MINUTES.toSeconds(1));

String msg = hms + ", " + currentPositionInQueue + "/" + numberOfTracksInQueue;
Log.i(methodTag, msg);
sendBroadcast(canBusDisplayIntent);
}

For the order of calling the methods:

You have to call sendCanBusMusicOn() to let the CanBus app know that it shall "enable" the music mode. (At this point, my display already shows 00:00 and not "Audio off" anymore.)

Call sendCanBusInfo() to show the correct information (current position in the playlist and passed mm:ss in the track). I am calling this method every second to update the information shown.

Call sendCanBusMusicOff() to "leave" music mode. I think this step is optional. You can also just switch to the radio app and the current mode is overridden.

To test this, I have used the open-source media player "Vanilla" and added my code inside the "PlaybackService" class. But you can - of course - write custom apps.

I am currently going through the de-odexed source code of the MTCCanBus.apk to get an understanding of how the communication works and to see if it's possible to display strings in the FIS/MFA/Board computer (whatever you want to call it). So far I don't think it can be done easily. There are 76 different implementations of the "Canbus" class. One for every type of canbus adapter, I guess. And I don't even know which one my head unit is set to use. Plus, I'm no Android/Java developer...

But hey, it's a start. :)