graphics: restart HWC when SurfaceFlinger stops

Currently display stays on when SurfaceFlinger is stopped, since HWC
runs as a separate service. There's no reason for display to remain on
in this state, and can be confusing to developers.

Restarting HWC when SurfaceFlinger stops causes display to turn off,
matching expected behavior. HWC is then ready to service SurfaceFlinger
when SurfaceFlinger starts back up.

Bug: 74199279
Change-Id: Ic772c29b362b3e8b2d6bc674a0bd237440880492
This commit is contained in:
Daniel Solomon
2018-03-12 18:55:06 -07:00
parent a1dc57b6b3
commit 399a5b8d60

View File

@@ -3,5 +3,9 @@ service vendor.hwcomposer-2-1 /vendor/bin/hw/android.hardware.graphics.composer@
user system
group graphics drmrpc
capabilities SYS_NICE
onrestart restart surfaceflinger
writepid /dev/cpuset/system-background/tasks
# Restart HWC when SurfaceFlinger stops. This turns off the display and prpares
# a new HWC instance for when SurfaceFlinger gets started again
on property:init.svc.surfaceflinger=stopped
restart vendor.hwcomposer-2-1