summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2018-08-13 13:01:01 -0700
committerXin Li <delphij@google.com>2018-08-13 13:01:01 -0700
commitf5250b5907fddfcdd784c0945fa2d2c6cd66bccf (patch)
treeda6ce3a028858c2d483dfe5aa1784bddcd31dfc9
parent6455ce66fb1012d939c14083d66d8f9b1421fbdd (diff)
parent6f99982e50e3f578f0ef469ad3f3e44e2c4fe4c2 (diff)
downloadcar-pie-temp.tar.gz
Merge stage-dr1-aosp-master into stage-aosp-masterpie-temp
Bug: 112535855 Change-Id: Ie628d04bd3a8c618ca7db558222fec12fdf45e90
-rw-r--r--common/car.mk2
-rw-r--r--common/manifest.xml58
-rw-r--r--emulator/audio/audio_policy_configuration.xml36
-rw-r--r--emulator/audio/car_emulator_audio.mk12
-rw-r--r--emulator/audio/driver/audio_hw.c8
-rw-r--r--emulator/audio/driver/audio_hw.h7
-rw-r--r--emulator/hal/car_emulator_manifest.xml9
7 files changed, 66 insertions, 66 deletions
diff --git a/common/car.mk b/common/car.mk
index 27860b3..871d828 100644
--- a/common/car.mk
+++ b/common/car.mk
@@ -16,6 +16,7 @@
# Auto modules
PRODUCT_PACKAGES += \
+ android.hardware.broadcastradio@2.0-service \
android.hardware.automotive.vehicle@2.0-service
# Emulator configuration
@@ -41,6 +42,7 @@ PRODUCT_COPY_FILES += \
# Vendor Interface Manifest
PRODUCT_COPY_FILES += \
+ frameworks/native/data/etc/android.hardware.broadcastradio.xml:system/etc/permissions/android.hardware.broadcastradio.xml \
device/generic/car/common/manifest.xml:$(TARGET_COPY_OUT_VENDOR)/manifest.xml
PRODUCT_PROPERTY_OVERRIDES += \
diff --git a/common/manifest.xml b/common/manifest.xml
index f27e715..279c098 100644
--- a/common/manifest.xml
+++ b/common/manifest.xml
@@ -1,5 +1,5 @@
<!-- A copy of the goldfish manifest with the addition of vehicle hal. -->
-<manifest version="1.0" type="device">
+<manifest version="1.0" type="device" target-level="3">
<hal format="hidl">
<name>android.hardware.drm</name>
<transport>hwbinder</transport>
@@ -7,27 +7,20 @@
<interface>
<name>ICryptoFactory</name>
<instance>default</instance>
- <instance>widevine</instance>
</interface>
<interface>
<name>IDrmFactory</name>
<instance>default</instance>
- <instance>widevine</instance>
- </interface>
- </hal>
- <hal format="hidl">
- <name>android.hardware.soundtrigger</name>
- <transport>hwbinder</transport>
- <version>2.0</version>
- <interface>
- <name>ISoundTriggerHw</name>
- <instance>default</instance>
</interface>
+ <fqname>@1.1::ICryptoFactory/clearkey</fqname>
+ <fqname>@1.1::IDrmFactory/clearkey</fqname>
+ <fqname>@1.1::ICryptoFactory/widevine</fqname>
+ <fqname>@1.1::IDrmFactory/widevine</fqname>
</hal>
<hal format="hidl">
<name>android.hardware.audio.effect</name>
<transport>hwbinder</transport>
- <version>2.0</version>
+ <version>4.0</version>
<interface>
<name>IEffectsFactory</name>
<instance>default</instance>
@@ -54,7 +47,7 @@
<hal format="hidl">
<name>android.hardware.audio</name>
<transport>hwbinder</transport>
- <version>2.0</version>
+ <version>4.0</version>
<interface>
<name>IDevicesFactory</name>
<instance>default</instance>
@@ -105,12 +98,13 @@
<instance>default</instance>
</interface>
</hal>
+ <!-- 2.0 for car builds -->
<hal format="hidl">
<name>android.hardware.broadcastradio</name>
<transport>hwbinder</transport>
- <version>1.0</version>
+ <version>2.0</version>
<interface>
- <name>IBroadcastRadioFactory</name>
+ <name>IBroadcastRadio</name>
<instance>default</instance>
</interface>
</hal>
@@ -164,29 +158,29 @@
</interface>
</hal>
<hal format="hidl">
- <name>android.hardware.radio.deprecated</name>
+ <name>android.hardware.radio</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
- <name>IOemHook</name>
+ <name>IRadio</name>
<instance>slot1</instance>
</interface>
</hal>
<hal format="hidl">
- <name>android.hardware.radio</name>
+ <name>android.hardware.wifi</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
- <name>IRadio</name>
- <instance>slot1</instance>
+ <name>IWifi</name>
+ <instance>default</instance>
</interface>
</hal>
<hal format="hidl">
- <name>android.hardware.wifi</name>
+ <name>android.hardware.wifi.hostapd</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
- <name>IWifi</name>
+ <name>IHostapd</name>
<instance>default</instance>
</interface>
</hal>
@@ -200,6 +194,24 @@
</interface>
</hal>
<hal format="hidl">
+ <name>android.hardware.cas</name>
+ <transport>hwbinder</transport>
+ <version>1.0</version>
+ <interface>
+ <name>IMediaCasService</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
+ <name>android.hardware.health</name>
+ <transport>hwbinder</transport>
+ <version>2.0</version>
+ <interface>
+ <name>IHealth</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl">
<name>android.hardware.automotive.vehicle</name>
<transport>hwbinder</transport>
<version>2.0</version>
diff --git a/emulator/audio/audio_policy_configuration.xml b/emulator/audio/audio_policy_configuration.xml
index eb1d453..44e4666 100644
--- a/emulator/audio/audio_policy_configuration.xml
+++ b/emulator/audio/audio_policy_configuration.xml
@@ -61,9 +61,7 @@
<item>bus7_system_sound_out</item>
<item>Built-In Mic</item>
<item>Built-In Back Mic</item>
- <item>bus0_mic1_in</item>
- <!-- Test input device port for audio patch -->
- <item>bus1_audio_patch_test_in</item>
+ <item>FM Tuner</item>
</attachedDevices>
<defaultOutputDevice>bus0_media_out</defaultOutputDevice>
<mixPorts>
@@ -120,16 +118,7 @@
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
</mixPort>
- <mixPort name="mixport_bus0_mic1_in" role="sink">
- <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
- samplingRates="48000"
- channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
- </mixPort>
- <!--
- Test mixport for audio patch,
- this needs to be present to work around the framework limitation
- -->
- <mixPort name="mixport_audio_patch_in" role="sink">
+ <mixPort name="mixport_tuner0" role="sink">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="48000"
channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
@@ -218,18 +207,8 @@
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
channelMasks="AUDIO_CHANNEL_IN_MONO,AUDIO_CHANNEL_IN_STEREO,AUDIO_CHANNEL_IN_FRONT_BACK"/>
</devicePort>
- <devicePort tagName="bus0_mic1_in" type="AUDIO_DEVICE_IN_BUS" role="source"
- address="bus0_mic1_in">
- <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
- samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
- <gains>
- <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
- minValueMB="-3200" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
- </gains>
- </devicePort>
- <!-- Test input device ports for audio patch -->
- <devicePort tagName="bus1_audio_patch_test_in" type="AUDIO_DEVICE_IN_BUS" role="source"
- address="bus1_audio_patch_test_in">
+ <devicePort tagName="FM Tuner" type="AUDIO_DEVICE_IN_FM_TUNER" role="source"
+ address="tuner0">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
samplingRates="48000" channelMasks="AUDIO_CHANNEL_IN_STEREO"/>
<gains>
@@ -249,12 +228,7 @@
<route type="mix" sink="bus6_notification_out" sources="mixport_bus6_notification_out"/>
<route type="mix" sink="bus7_system_sound_out" sources="mixport_bus7_system_sound_out"/>
<route type="mix" sink="primary input" sources="Built-In Mic,Built-In Back Mic"/>
- <route type="mix" sink="mixport_bus0_mic1_in" sources="bus0_mic1_in"/>
- <!--
- Listed source device ports will be routed to desired sinks via audio patch,
- this route needs to be present to work around framework limitation for now
- -->
- <route type="mix" sink="mixport_audio_patch_in" sources="bus1_audio_patch_test_in"/>
+ <route type="mix" sink="mixport_tuner0" sources="FM Tuner"/>
</routes>
</module>
diff --git a/emulator/audio/car_emulator_audio.mk b/emulator/audio/car_emulator_audio.mk
index a716538..b7ccbec 100644
--- a/emulator/audio/car_emulator_audio.mk
+++ b/emulator/audio/car_emulator_audio.mk
@@ -19,11 +19,11 @@ PRODUCT_PACKAGES += audio.primary.caremu
PRODUCT_PROPERTY_OVERRIDES += ro.hardware.audio.primary=caremu
PRODUCT_COPY_FILES += \
- frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:system/etc/a2dp_audio_policy_configuration.xml \
- frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:system/etc/usb_audio_policy_configuration.xml \
- frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \
- frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \
- frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \
- device/generic/car/emulator/audio/audio_policy_configuration.xml:system/etc/audio_policy_configuration.xml
+ frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration.xml \
+ frameworks/av/services/audiopolicy/config/usb_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usb_audio_policy_configuration.xml \
+ frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \
+ frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \
+ frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \
+ device/generic/car/emulator/audio/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
DEVICE_PACKAGE_OVERLAYS += device/generic/car/emulator/audio/overlay
diff --git a/emulator/audio/driver/audio_hw.c b/emulator/audio/driver/audio_hw.c
index 807cc15..1c17683 100644
--- a/emulator/audio/driver/audio_hw.c
+++ b/emulator/audio/driver/audio_hw.c
@@ -1237,7 +1237,7 @@ static int adev_create_audio_patch(struct audio_hw_device *dev,
unsigned int num_sinks,
const struct audio_port_config *sinks,
audio_patch_handle_t *handle) {
- // Logging only, no real work is done here
+ struct generic_audio_device *audio_dev = (struct generic_audio_device *)dev;
for (int i = 0; i < num_sources; i++) {
ALOGD("%s: source[%d] type=%d address=%s", __func__, i, sources[i].type,
sources[i].type == AUDIO_PORT_TYPE_DEVICE
@@ -1252,8 +1252,10 @@ static int adev_create_audio_patch(struct audio_hw_device *dev,
if (num_sources == 1 && num_sinks == 1 &&
sources[0].type == AUDIO_PORT_TYPE_DEVICE &&
sinks[0].type == AUDIO_PORT_TYPE_DEVICE) {
- // The same audio_patch_handle_t will be passed to release_audio_patch
- *handle = 42;
+ pthread_mutex_lock(&audio_dev->lock);
+ audio_dev->last_patch_id += 1;
+ pthread_mutex_unlock(&audio_dev->lock);
+ *handle = audio_dev->last_patch_id;
ALOGD("%s: handle: %d", __func__, *handle);
}
return 0;
diff --git a/emulator/audio/driver/audio_hw.h b/emulator/audio/driver/audio_hw.h
index 41217ad..21eda66 100644
--- a/emulator/audio/driver/audio_hw.h
+++ b/emulator/audio/driver/audio_hw.h
@@ -28,9 +28,10 @@
struct generic_audio_device {
struct audio_hw_device device; // Constant after init
pthread_mutex_t lock;
- bool master_mute; // Proteced by this->lock
- bool mic_mute; // Proteced by this->lock
- struct mixer *mixer; // Proteced by this->lock
+ unsigned int last_patch_id; // Protected by this->lock
+ bool master_mute; // Protected by this->lock
+ bool mic_mute; // Protected by this->lock
+ struct mixer *mixer; // Protected by this->lock
Hashmap *out_bus_stream_map; // Extended field. Constant after init
};
diff --git a/emulator/hal/car_emulator_manifest.xml b/emulator/hal/car_emulator_manifest.xml
index 0e09a8f..9ab23f7 100644
--- a/emulator/hal/car_emulator_manifest.xml
+++ b/emulator/hal/car_emulator_manifest.xml
@@ -199,6 +199,15 @@
<instance>default</instance>
</interface>
</hal>
+ <hal format="hidl">
+ <name>android.hardware.broadcastradio</name>
+ <transport>hwbinder</transport>
+ <version>2.0</version>
+ <interface>
+ <name>IBroadcastRadio</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
<sepolicy>
<version>10000.0</version>
</sepolicy>