configs: msmsteppe_au: add overlay for car service config

Add car service overlay for dynamic routing enable and
audio volume groups.
Add frameworks overlay for volume key event configuration.

Change-Id: Ica5d08e546438cba1af526328a49e1e06f409ef6
diff --git a/configs/msmsteppe_au/msmsteppe_au.mk b/configs/msmsteppe_au/msmsteppe_au.mk
index 6edc7e0..68d17b9 100644
--- a/configs/msmsteppe_au/msmsteppe_au.mk
+++ b/configs/msmsteppe_au/msmsteppe_au.mk
@@ -75,6 +75,9 @@
 DEVICE_PACKAGE_OVERLAYS += hardware/qcom/audio/configs/common/overlay
 endif
 
+#Automotive audio specific device overlays
+DEVICE_PACKAGE_OVERLAYS += hardware/qcom/audio/configs/msmsteppe_au/overlay
+
 PRODUCT_COPY_FILES += \
     hardware/qcom/audio/configs/msmsteppe_au/audio_output_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_output_policy.conf \
     hardware/qcom/audio/configs/msmsteppe_au/audio_effects.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.conf \
diff --git a/configs/msmsteppe_au/overlay/frameworks/base/core/res/res/values/config.xml b/configs/msmsteppe_au/overlay/frameworks/base/core/res/res/values/config.xml
new file mode 100644
index 0000000..01e279d
--- /dev/null
+++ b/configs/msmsteppe_au/overlay/frameworks/base/core/res/res/values/config.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
+** Not a Contribution.
+*/
+/*
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<resources>
+     <!-- Car uses hardware amplifier for volume. -->
+    <bool name="config_useFixedVolume">true</bool>
+    <!--
+      Handle volume keys directly in CarAudioService without passing them to the foreground app
+    -->
+    <bool name="config_handleVolumeKeysInWindowManager">true</bool>
+</resources>
diff --git a/configs/msmsteppe_au/overlay/packages/services/Car/service/res/values/config.xml b/configs/msmsteppe_au/overlay/packages/services/Car/service/res/values/config.xml
new file mode 100644
index 0000000..ac5f818
--- /dev/null
+++ b/configs/msmsteppe_au/overlay/packages/services/Car/service/res/values/config.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
+** Not a Contribution.
+*/
+/*
+** Copyright 2015, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<!--
+  Overlay resources to configure car service based on each OEM's preference.
+  See also packages/services/Car/service/res/values/config.xml
+-->
+<resources>
+    <!--  Configuration to enable usage of dynamic audio routing. If this is set to false,
+          dynamic audio routing is disabled and audio works in legacy mode. It may be useful
+          during initial development where audio hal does not support bus based addressing yet. -->
+    <bool name="audioUseDynamicRouting">true</bool>
+</resources>
diff --git a/configs/msmsteppe_au/overlay/packages/services/Car/service/res/xml/car_volume_groups.xml b/configs/msmsteppe_au/overlay/packages/services/Car/service/res/xml/car_volume_groups.xml
new file mode 100644
index 0000000..850d4d4
--- /dev/null
+++ b/configs/msmsteppe_au/overlay/packages/services/Car/service/res/xml/car_volume_groups.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
+     Not a Contribution.
+
+     Copyright (C) 2018 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!--
+  Defines the all available volume groups for volume control in a car.
+  One can overlay this configuration to customize the groups.
+
+  This configuration will be populated by CarAudioService and
+  surfaced to Car Settings App and/or other volume control interfaces.
+
+  Certain constraints applied to this configuration
+    - One context should not appear in two groups
+    - All contexts are assigned
+    - One bus should not appear in two groups
+    - All gain controllers (set on each bus) in one group have same step value
+
+  It is fine that there are buses that do not appear in any group, those buses
+  may be reserved for other usages.
+
+  Important note: when overlaying this configuration,
+  make sure the resources are in the same package as CarAudioService.
+-->
+<volumeGroups xmlns:car="http://schemas.android.com/apk/res-auto">
+    <group>
+        <context car:context="music"/>
+    </group>
+    <group>
+        <context car:context="call"/>
+        <context car:context="call_ring"/>
+    </group>
+    <group>
+        <context car:context="alarm"/>
+        <context car:context="notification"/>
+        <context car:context="system_sound"/>
+    </group>
+    <group>
+        <context car:context="navigation"/>
+        <context car:context="voice_command"/>
+    </group>
+</volumeGroups>