From fb4aadf6227222049e032a9f3c0552deddc8c402 Mon Sep 17 00:00:00 2001 From: Daniel Norman Date: Tue, 30 Jul 2019 10:11:56 -0700 Subject: [PATCH] Replaces 'oneshot' and 'interface' with 'onrestart restart audioserver'. This default service should still restart on audioserver restart because audioserver uses 'onrestart restart vendor.audio-hal-2-0' for restarts. Bug: 138114550 Bug: 80227481 Test: for i in {0..100}; do \ adb shell 'ps|grep audio;killall audioserver;ps|grep audio' \ && sleep 2; \ done Test: Ran steps mentioned in http://b/80227481#comment1, device did not get stuck in boot animation. Killing either audioserver or audio-hal caused both to restart (just once) and the device booted correctly after the sleep finished. Change-Id: Ice128b51f79d3a9de22a719e6d897c8dca915e28 --- .../default/service/android.hardware.audio@2.0-service.rc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/audio/common/all-versions/default/service/android.hardware.audio@2.0-service.rc b/audio/common/all-versions/default/service/android.hardware.audio@2.0-service.rc index 6e91bccb3c..72b4d197dd 100644 --- a/audio/common/all-versions/default/service/android.hardware.audio@2.0-service.rc +++ b/audio/common/all-versions/default/service/android.hardware.audio@2.0-service.rc @@ -6,9 +6,4 @@ service vendor.audio-hal-2-0 /vendor/bin/hw/android.hardware.audio@2.0-service capabilities BLOCK_SUSPEND 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 - interface android.hardware.audio@4.0::IDevicesFactory default - interface android.hardware.audio@2.0::IDevicesFactory default + onrestart restart audioserver