OSDN Git Service

Make audiohal service 'oneshot' to avoid double restart on crash
authorMikhail Naganov <mnaganov@google.com>
Thu, 8 Dec 2016 00:34:18 +0000 (16:34 -0800)
committerIliyan Malchev <malchev@google.com>
Fri, 9 Dec 2016 18:53:22 +0000 (18:53 +0000)
audioserver receives a change that makes it to crash once it
detects that audiohal server has crashed (because audioflinger
can't gracefully restore the state of the audio system).

As audioserver.rc file prescribes restaring the audiohal on
audioserver restart, there is no need to rely on the init process
to restart the audiohal. Moreover, asking the init process to do
that causes a double restart of the audiohal service if it crashes.

Test: kill audio-hal process, watch dmesg and logcat
Change-Id: Iac4cc79cdc1a3debd2b9cfcdf42f11451d7ce24c

audio/2.0/default/android.hardware.audio@2.0-service.rc

index f9fecdb..0a5bfc5 100644 (file)
@@ -5,3 +5,7 @@ service audio-hal-2-0 /system/bin/hw/android.hardware.audio@2.0-service
     group audio camera drmrpc inet media mediadrm net_bt net_bt_admin net_bw_acct
     ioprio rt 4
     writepid /dev/cpuset/foreground/tasks /dev/stune/foreground/tasks
+    # audioflinger restarts itself when it loses connection with the hal
+    # and its .rc file has an "onrestart restart audio-hal" rule, thus
+    # an additional auto-restart from the init process isn't needed.
+    oneshot