Add overlays

* Use a high priority to override other rro overlays
This commit is contained in:
Alessandro Astone 2021-12-16 15:50:59 +01:00
parent de08478020
commit 401e4af0e0
13 changed files with 122 additions and 0 deletions

View File

@ -43,6 +43,8 @@ function create() {
test -d $OUT/$GARCH || mkdir -p $OUT/$GARCH
test -d $OUT/$GARCH/system || mkdir -p $OUT/$GARCH/system
echo "Build directories are now ready" >> $GLOG
echo "Compiling RROs"
$TOP/overlay/build_overlays.sh $GARCH $OUT/$GARCH
echo "Getting prebuilts..."
echo "Copying stuff" >> $GLOG
cp $TOP/toybox-$GARCH $OUT/$GARCH/toybox >> $GLOG

View File

@ -0,0 +1,5 @@
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/lineage_gapps_arm.mk \
$(LOCAL_DIR)/lineage_gapps_arm64.mk \
$(LOCAL_DIR)/lineage_gapps_x86.mk \
$(LOCAL_DIR)/lineage_gapps_x86_64.mk

View File

@ -0,0 +1,6 @@
$(call inherit-product, vendor/lineage/build/target/product/lineage_arm.mk)
PRODUCT_NAME := lineage_gapps_arm
PRODUCT_USE_DYNAMIC_PARTITIONS := false
PRODUCT_SOONG_NAMESPACES += vendor/gapps/overlay

View File

@ -0,0 +1,6 @@
$(call inherit-product, vendor/lineage/build/target/product/lineage_arm64.mk)
PRODUCT_NAME := lineage_gapps_arm64
PRODUCT_USE_DYNAMIC_PARTITIONS := false
PRODUCT_SOONG_NAMESPACES += vendor/gapps/overlay

View File

@ -0,0 +1,6 @@
$(call inherit-product, vendor/lineage/build/target/product/lineage_x86.mk)
PRODUCT_NAME := lineage_gapps_x86
PRODUCT_USE_DYNAMIC_PARTITIONS := false
PRODUCT_SOONG_NAMESPACES += vendor/gapps/overlay

View File

@ -0,0 +1,6 @@
$(call inherit-product, vendor/lineage/build/target/product/lineage_x86_64.mk)
PRODUCT_NAME := lineage_gapps_x86_64
PRODUCT_USE_DYNAMIC_PARTITIONS := false
PRODUCT_SOONG_NAMESPACES += vendor/gapps/overlay

View File

@ -29,3 +29,6 @@ ifeq ($(TARGET_IS_GROUPER),)
PRODUCT_PACKAGES += \
GoogleRestore
endif
PRODUCT_SOONG_NAMESPACES += vendor/gapps/overlay
PRODUCT_PACKAGES += GmsOverlay

2
overlay/Android.bp Normal file
View File

@ -0,0 +1,2 @@
soong_namespace {
}

View File

@ -0,0 +1,4 @@
runtime_resource_overlay {
name: "GmsOverlay",
product_specific: true
}

View File

@ -0,0 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mtg.gmsoverlay"
android:versionCode="1"
android:versionName="1.0">
<overlay android:targetPackage="android" android:priority="1337" android:isStatic="true" />
</manifest>

View File

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<!-- Default service to enable with accessibility shortcut [DO NOT TRANSLATE] -->
<string name="config_defaultAccessibilityService" translatable="false">com.google.android.marvin.talkback/.TalkBackService</string>
<!-- The name of the package that will hold the speech recognizer role by default. -->
<string name="config_systemSpeechRecognizer" translatable="false">com.google.android.tts</string>
<!-- The name of the package that will hold the wellbeing role. -->
<string name="config_systemWellbeing" translatable="false">com.google.android.apps.wellbeing</string>
<!-- The package name for the default wellbeing application. [DO NOT TRANSLATE] -->
<string name="config_defaultWellbeingPackage" translatable="false">com.google.android.apps.wellbeing</string>
<!-- An array of packages that can make sound on the ringer stream in priority-only DND mode -->
<string-array name="config_priorityOnlyDndExemptPackages" translatable="false">
<item>com.android.dialer</item>
<item>com.google.android.dialer</item>
<item>com.android.server.telecom</item>
<item>android</item>
<item>com.android.systemui</item>
</string-array>
<!-- Colon separated list of package names that should be granted DND access -->
<string name="config_defaultDndAccessPackages" translatable="false">com.google.android.gms:com.google.android.apps.wellbeing</string>
<!-- Names of packages that should not be suspended when personal use is blocked by policy. -->
<string-array name="config_packagesExemptFromSuspension" translatable="false">
<item>com.google.android.apps.wellbeing</item>
</string-array>
<!-- List containing the allowed install sources for accessibility service. -->
<string-array name="config_accessibility_allowed_install_source" translatable="false">
<item>com.android.vending</item>
</string-array>
<!-- The names of the packages that will hold the system automotive projection role. -->
<string name="config_systemAutomotiveProjection" translatable="false">com.google.android.projection.gearhead</string>
</resources>

27
overlay/build_overlays.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
set -e
GARCH=$1
GOUT=$2
SCRIPT_DIR=$(dirname "$0")
cd "$SCRIPT_DIR"
OVERLAYS=$(for dir in $(ls -d */); do echo ${dir%%/}; done)
croot 2>/dev/null || cd ../../../
source build/envsetup.sh
breakfast gapps_$GARCH
m installclean
m $OVERLAYS | tee $OUT/.log
LOC="$(cat $OUT/.log | sed -r -e 's/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g' -e 's/^\[ {0,2}[0-9]{1,3}% [0-9]{1,6}\/[0-9]{1,6}\] +//' \
| grep '^Install: ' | cut -d ':' -f 2)"
RELOUT=$(echo $OUT | sed "s#^${ANDROID_BUILD_TOP}/##")
FILES=$(echo $LOC | tr " " "\n" | sed "s#.*${RELOUT}##" | sort | uniq)
for TARGET in $FILES; do
mkdir -p $(dirname $GOUT/$TARGET) && cp $OUT/$TARGET $GOUT/$TARGET
done

View File

@ -49,6 +49,15 @@ echo "ifeq (\$(TARGET_IS_GROUPER),)" >> "$PRODUCTMK"
write_makefiles "$MY_DIR"/proprietary-files-common-nongrouper.txt
echo "endif" >> "$PRODUCTMK"
# Overlays
cd overlay
OVERLAYS=$(for dir in $(ls -d */); do echo ${dir%%/}; done)
OVERLAYS=$(echo $OVERLAYS | paste -s -d ' ')
cd - >/dev/null
printf "\n" >> "$PRODUCTMK"
echo "PRODUCT_SOONG_NAMESPACES += vendor/$VENDOR/overlay" >> "$PRODUCTMK"
echo "PRODUCT_PACKAGES += $OVERLAYS" >> "$PRODUCTMK"
sed -i 's/TARGET_DEVICE/TARGET_ARCH/g' "$ANDROIDMK"
# We are done with common