add android tv build target

This commit is contained in:
Konsta
2023-07-24 15:00:53 +03:00
parent 441fee39c8
commit 1273c5706f
10 changed files with 213 additions and 22 deletions

View File

@@ -1,11 +1,13 @@
#
# Copyright (C) 2021-2022 KonstaKANG
# Copyright (C) 2021-2023 KonstaKANG
#
# SPDX-License-Identifier: Apache-2.0
#
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/aosp_rpi4.mk
$(LOCAL_DIR)/aosp_rpi4.mk \
$(LOCAL_DIR)/aosp_rpi4_tv.mk
COMMON_LUNCH_CHOICES := \
aosp_rpi4-userdebug
aosp_rpi4-userdebug \
aosp_rpi4_tv-userdebug

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2021-2022 KonstaKANG
# Copyright (C) 2021-2023 KonstaKANG
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -7,6 +7,23 @@
# Inherit device configuration
$(call inherit-product, device/brcm/rpi4/device.mk)
PRODUCT_AAPT_CONFIG := normal mdpi hdpi
PRODUCT_AAPT_PREF_CONFIG := hdpi
PRODUCT_CHARACTERISTICS := tablet,nosdcard
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
# Overlays
PRODUCT_PACKAGES += \
AndroidRpiOverlay \
SettingsRpiOverlay \
SettingsProviderRpiOverlay \
SystemUIRpiOverlay \
WifiRpiOverlay
# Permissions
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/tablet_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/tablet_core_hardware.xml
# Device identifier. This must come after all inclusions.
PRODUCT_DEVICE := rpi4
PRODUCT_NAME := aosp_rpi4

38
aosp_rpi4_tv.mk Normal file
View File

@@ -0,0 +1,38 @@
#
# Copyright (C) 2021-2023 KonstaKANG
#
# SPDX-License-Identifier: Apache-2.0
#
# Inherit device configuration
$(call inherit-product, device/brcm/rpi4/device.mk)
PRODUCT_AAPT_PREF_CONFIG := tvdpi
PRODUCT_CHARACTERISTICS := tv
$(call inherit-product, device/google/atv/products/atv_base.mk)
# Android TV
PRODUCT_PACKAGES += \
DocumentsUI \
LeanbackIME \
TvProvision \
TvSampleLeanbackLauncher \
TvSettingsTwoPanel
# Bluetooth
PRODUCT_VENDOR_PROPERTIES += \
bluetooth.device.class_of_device=34,4,36
# Overlays
PRODUCT_PACKAGES += \
AndroidTvRpiOverlay \
SettingsProviderTvRpiOverlay \
WifiRpiOverlay
# Device identifier. This must come after all inclusions.
PRODUCT_DEVICE := rpi4
PRODUCT_NAME := aosp_rpi4_tv
PRODUCT_BRAND := Raspberry
PRODUCT_MODEL := Raspberry Pi 4
PRODUCT_MANUFACTURER := Raspberry
PRODUCT_RELEASE_NAME := Raspberry Pi 4

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2021-2022 KonstaKANG
# Copyright (C) 2021-2023 KonstaKANG
#
# SPDX-License-Identifier: Apache-2.0
#
@@ -8,14 +8,9 @@ DEVICE_PATH := device/brcm/rpi4
PRODUCT_SOONG_NAMESPACES += $(DEVICE_PATH)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
$(call inherit-product, frameworks/native/build/tablet-7in-xhdpi-2048-dalvik-heap.mk)
$(call inherit-product, vendor/brcm/rpi4/rpi4-vendor.mk)
PRODUCT_AAPT_CONFIG := normal mdpi hdpi
PRODUCT_AAPT_PREF_CONFIG := hdpi
PRODUCT_CHARACTERISTICS := tablet,nosdcard
# API level
PRODUCT_SHIPPING_API_LEVEL := 33
@@ -218,18 +213,6 @@ PRODUCT_COPY_FILES += \
frameworks/av/media/libstagefright/data/media_codecs_google_c2_tv.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_c2_tv.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_c2_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_c2_video.xml
# Overlays
PRODUCT_PACKAGES += \
AndroidRpiOverlay \
SettingsRpiOverlay \
SettingsProviderRpiOverlay \
SystemUIRpiOverlay \
WifiRpiOverlay
# Permissions
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/tablet_core_hardware.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/tablet_core_hardware.xml
# Power
PRODUCT_PACKAGES += \
android.hardware.power-service.example

View File

@@ -0,0 +1,10 @@
// Copyright (C) 2021-2022 KonstaKANG
//
// SPDX-License-Identifier: Apache-2.0
runtime_resource_overlay {
name: "AndroidTvRpiOverlay",
resource_dirs: ["res"],
sdk_version: "current",
proprietary: true
}

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright (C) 2021-2022 KonstaKANG
**
** SPDX-License-Identifier: Apache-2.0
*/
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="android.rpi.tv"
android:versionCode="1"
android:versionName="1.0" >
<application android:hasCode="false" />
<overlay
android:targetPackage="android"
android:isStatic="true"
android:priority="0" />
</manifest>

View File

@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2009 The Android Open Source Project
Copyright (C) 2021-2022 KonstaKANG
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>
<!-- User activity timeout: Minimum screen off timeout in milliseconds.
Sets a lower bound for the {@link Settings.System#SCREEN_OFF_TIMEOUT} setting
which determines how soon the device will go to sleep when there is no
user activity.
This value must be greater than zero, otherwise the device will immediately
fall asleep again as soon as it is awoken.
-->
<integer name="config_minimumScreenOffTimeout">86400000</integer>
<!-- Default screen brightness setting.
Must be in the range specified by minimum and maximum. -->
<integer name="config_screenBrightnessSettingDefault">128</integer>
<!-- Minimum screen brightness setting allowed by the power manager.
The user is forbidden from setting the brightness below this level. -->
<integer name="config_screenBrightnessSettingMinimum">20</integer>
<!-- Screen brightness used to dim the screen when the user activity
timeout expires. May be less than the minimum allowed brightness setting
that can be set by the user. -->
<integer name="config_screenBrightnessDim">20</integer>
<!-- If true, then we do not ask user for permission for apps to connect to USB devices.
Do not set this to true for production devices. Doing so will cause you to fail CTS. -->
<bool name="config_disableUsbPermissionDialogs">true</bool>
<!-- Control the behavior when the user long presses the power button.
0 - Nothing
1 - Global actions menu
2 - Power off (with confirmation)
3 - Power off (without confirmation)
4 - Go to voice assist
5 - Go to assistant (Settings.Secure.ASSISTANT)
-->
<integer name="config_longPressOnPowerBehavior">1</integer>
<!-- CEC Configuration -->
<bool name="config_cecTvSendStandbyOnSleepEnabled_default">false</bool>
<bool name="config_cecTvSendStandbyOnSleepDisabled_default">true</bool>
</resources>

View File

@@ -0,0 +1,10 @@
// Copyright (C) 2021-2022 KonstaKANG
//
// SPDX-License-Identifier: Apache-2.0
runtime_resource_overlay {
name: "SettingsProviderTvRpiOverlay",
resource_dirs: ["res"],
sdk_version: "current",
proprietary: true
}

View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright (C) 2021-2022 KonstaKANG
**
** SPDX-License-Identifier: Apache-2.0
*/
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.providers.settings.rpi.tv"
android:versionCode="1"
android:versionName="1.0" >
<application android:hasCode="false" />
<overlay
android:targetPackage="com.android.providers.settings"
android:isStatic="true"
android:priority="0" />
</manifest>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2009 The Android Open Source Project
Copyright (C) 2021-2022 KonstaKANG
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>
<!-- Default screen brightness -->
<integer name="def_screen_brightness">128</integer>
<!-- Disable location by default -->
<integer name="def_location_mode">0</integer>
<!-- No setup wizard -->
<bool name="def_device_provisioned">true</bool>
<bool name="def_user_setup_complete">true</bool>
</resources>