1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 Copyright 2019 The Android Open Source Project 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16--> 17 18<!-- 19 Example to use Runtime Resource Overlay(RRO). 20 21 Step 1: Create a new project with AndroidManifest.xml file as shown below. 22 "{{TARGET_PACKAGE_NAME}}" will point to the package which will be overridden by new values. 23 "{{RRO_PACKAGE_NAME}}" will be the current package name of this apk. 24 Step 2: Create new values in the current package that will override the values in the target 25 apk. Path and resource name should be same as the target apk in order to override. 26 Look at car-ui-lib/res to see a list of resources available for customization. 27 Step 3: Update Android.mk variables as needed (see details at generate-rros.mk): 28 CAR_UI_RRO_SET_NAME: general name of this overlay, e.g: base. 29 CAR_UI_RESOURCE_DIR: location of the resources folder, e.g.: $(LOCAL_PATH)/res 30 CAR_UI_RRO_TARGETS: list of package names to overlay 31 Step 4: Build and generate the apk package for this project. Resulting RROs will be located at 32 $OUT/vendor/overlay. A full flashing of a device will install all of them, but they can be 33 installed individually (see below). 34 Step 5: Push the package to "/vendor/overlay/" and reboot. Follow the commands below. 35 # adb root; 36 # adb remount; 37 # adb push <path-to-apk> /vendor/overlay/; 38 Alternatively, to side-load a change, just install the APK as normal (note: the apk 39 will end up at /data/app instead of /vendor/overlay). 40 # adb install -r <path-to-apk> 41 Step 6: Apply by overlay command 42 # "adb shell cmd overlay list;" Output of the same will be as shown below. 43 com.android.car.ui.paintbooth 44 [ ] com.android.car.ui.paintbooth.base.rro 45 # adb shell cmd overlay enable (double-hyphen)user 0 com.android.car.ui.paintbooth.rro 46 to enable the RRO 47 # adb shell cmd overlay disable (double-hyphen)user 0 com.android.car.ui.paintbooth.rro 48 to disable RRO 49 (Be careful to use the right user id, depending on the targeted app) 50--> 51<manifest xmlns:android="http://schemas.android.com/apk/res/android" 52 package="{{RRO_PACKAGE_NAME}}"> 53 <application android:hasCode="false"/> 54 <overlay android:priority="10" 55 android:targetPackage="{{TARGET_PACKAGE_NAME}}"/> 56</manifest> 57