An application can restart mm-detect with an explicit command if mm-detect
has unexpectedly stopped and if the application can't proceed without automated media detection and synchronization.
The exact conditions that require an application to restart mm-detect are:
- the mm-detect process has terminated abnormally;
- the client is required, by design or user request, to ensure that all its media information is
up to date before refreshing its display; and
- the car infotainment system can't be rebooted to restart mm-detect with SLM
because doing so would be too disruptive to the user.
To restart mm-detect manually, your application must:
-
Confirm that mm-detect isn't already running by
checking the list of active processes with the pidin or ps command.
-
Confirm that both the qdb and mm-sync processes are already running by
checking the same list of active processes.
The mm-detect process depends on both these other services, so if either one is not running,
that service must be started; otherwise, mm-detect won't do anything when it runs.
-
Send the command line for running mm-detect with the desired command options
to the OS, using the system() or spawn() system call.
The OS tries to run mm-detect and reports the operation outcome to sloginfo.
For details on the system calls that send commands to the OS, see the C Library Reference.
For the full list of command-line options, see the mm-detect command line section.
If sloginfo shows no error, mm-detect is now running.
Your car infotainment system should run only one instance of mm-detect, so multiple applications relying
on the service must coordinate with each other to avoid unnecessarily restarting mm-detect.