summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJusik Chung <jschung@google.com>2023-02-16 03:10:17 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2023-02-16 03:10:17 +0000
commitb5b22bcfcf3982d0399b25683a18d9dd7d5b7465 (patch)
tree0bcaecdfb3752ae0a34156f756c217acb981bc71
parentc148da416b8d4656613ca6447eb463de492c5ed6 (diff)
parentc50151c64d221fbba515d15d9ccee204c813ef6d (diff)
downloadcar-b5b22bcfcf3982d0399b25683a18d9dd7d5b7465.tar.gz
Merge "Set the LocalMediaPlayer as the default media source of emulator targets." into tm-qpr-dev
-rw-r--r--emulator/aosp_car_emulator.mk2
-rw-r--r--emulator/media/rro_overlay/CarServiceOverlay/Android.bp34
-rw-r--r--emulator/media/rro_overlay/CarServiceOverlay/AndroidManifest.xml25
-rw-r--r--emulator/media/rro_overlay/CarServiceOverlay/res/values/config.xml24
-rw-r--r--emulator/media/rro_overlay/CarServiceOverlay/res/xml/overlays.xml19
5 files changed, 104 insertions, 0 deletions
diff --git a/emulator/aosp_car_emulator.mk b/emulator/aosp_car_emulator.mk
index aedcdc7..e7af75d 100644
--- a/emulator/aosp_car_emulator.mk
+++ b/emulator/aosp_car_emulator.mk
@@ -56,6 +56,8 @@ PRODUCT_PACKAGES += CarServiceOverlayEmulator
endif # ENABLE_CLUSTER_OS_DOUBLE
endif # BUILD_EMULATOR_CLUSTER_DISPLAY
+PRODUCT_PACKAGES += CarServiceOverlayEmulatorMedia
+
PRODUCT_PRODUCT_PROPERTIES += \
ro.carwatchdog.vhal_healthcheck.interval=10 \
ro.carwatchdog.client_healthcheck.interval=20 \
diff --git a/emulator/media/rro_overlay/CarServiceOverlay/Android.bp b/emulator/media/rro_overlay/CarServiceOverlay/Android.bp
new file mode 100644
index 0000000..292373c
--- /dev/null
+++ b/emulator/media/rro_overlay/CarServiceOverlay/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2023 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.
+//
+//
+
+package {
+ default_applicable_licenses: ["device_generic_car_license"],
+}
+
+runtime_resource_overlay {
+ name: "CarServiceOverlayEmulatorMedia",
+ resource_dirs: ["res"],
+ manifest: "AndroidManifest.xml",
+ sdk_version: "current",
+ product_specific: true
+}
+
+override_runtime_resource_overlay {
+ name: "CarServiceOverlayEmulatorMediaGoogle",
+ base: "CarServiceOverlayEmulatorMedia",
+ package_name: "com.google.android.car.resources.emulator.media",
+ target_package_name: "com.google.android.car.updatable",
+}
diff --git a/emulator/media/rro_overlay/CarServiceOverlay/AndroidManifest.xml b/emulator/media/rro_overlay/CarServiceOverlay/AndroidManifest.xml
new file mode 100644
index 0000000..d4620fd
--- /dev/null
+++ b/emulator/media/rro_overlay/CarServiceOverlay/AndroidManifest.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2023 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.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.car.resources.emulator.media">
+ <application android:hasCode="false"/>
+ <overlay android:priority="5001"
+ android:targetPackage="com.android.car.updatable"
+ android:targetName="CarServiceCustomization"
+ android:resourcesMap="@xml/overlays"
+ android:isStatic="true" />
+</manifest>
diff --git a/emulator/media/rro_overlay/CarServiceOverlay/res/values/config.xml b/emulator/media/rro_overlay/CarServiceOverlay/res/values/config.xml
new file mode 100644
index 0000000..ec39832
--- /dev/null
+++ b/emulator/media/rro_overlay/CarServiceOverlay/res/values/config.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2023, 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 to configure car service based on each OEM's preference. -->
+<resources>
+ <!-- The ComponentName of the media source that will be selected as the default -->
+ <string name="config_defaultMediaSource">com.android.car.media.localmediaplayer/.LocalMediaBrowserService</string>
+</resources>
diff --git a/emulator/media/rro_overlay/CarServiceOverlay/res/xml/overlays.xml b/emulator/media/rro_overlay/CarServiceOverlay/res/xml/overlays.xml
new file mode 100644
index 0000000..c605422
--- /dev/null
+++ b/emulator/media/rro_overlay/CarServiceOverlay/res/xml/overlays.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2023 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>
+ <item target="string/config_defaultMediaSource" value="@string/config_defaultMediaSource" />
+</overlay>