init.ranchu.rc: Enable goldfish audio

On qemu-android, ${ro.hardware} evaluates to "ranchu", not "goldfish"
as on the classic emulator. This prevents AudioFlinger from loading the
goldfish audio HAL module (audio.primary.goldfish.so, which is present
in /system/lib/hw/ and /system/lib64/hw/), because it tries to find
audio.primary.${ro.hardware}.so, but audio.primary.ranchu.so does not
exist.

A quick inspection of hw_get_module_by_class() (hardware/libhardware/
hardware.c), which is called by AudioFlinger for loading audio HAL
modules, reveals that the function actually looks for

 <module_name>.${ro.hardware.<module_name>}.so

before trying <module_name>.${ro.hardware}.so. Therefore, set

 ro.hardware.audio.primary=goldfish

at boot time so that goldfish audio can work.

Change-Id: I7c91d070ef2d8f582c9cf0e8cfd6512f75e83486
Signed-off-by: Yu Ning <yu.ning@intel.com>
1 file changed