vendor: add custom backuptools and postinstall script for A/B OTAs
* A/B OTA devices wont run backuptools in recovery (because they don't
go in to recovery to do an OTA). In these cases let's use a modified
version to backup/restore from within android upon postinstall.
* Add backuptool_postinstall.sh which will be run prior to the normal
postinstall script in order to backup/restore via addon.d scripts.
* This needs to be done in such a manner because we need /postinstall
mounted rw instead of the ro with context= options which are used for
the normal postinstall (dexopt) script.
Change-Id: I51511870634dd1ec5388adafddb446f95cc5a950
diff --git a/config/common.mk b/config/common.mk
index 0bc4fed..a0a7294 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -35,12 +35,25 @@
PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.adb.secure=1
endif
+# Enforce privapp-permissions whitelist
+PRODUCT_PROPERTY_OVERRIDES += \
+ ro.control_privapp_permissions=enforce
+
+PRODUCT_COPY_FILES += \
+ vendor/omni/prebuilt/bin/clean_cache.sh:system/bin/clean_cache.sh
+
# Backup Tool
+ifeq ($(AB_OTA_UPDATER),true)
+PRODUCT_COPY_FILES += \
+ vendor/omni/prebuilt/common/bin/backuptool_ab.sh:system/bin/backuptool_ab.sh \
+ vendor/omni/prebuilt/common/bin/backuptool_ab.functions:system/bin/backuptool_ab.functions \
+ vendor/omni/prebuilt/common/bin/backuptool_postinstall.sh:system/bin/backuptool_postinstall.sh
+else
PRODUCT_COPY_FILES += \
vendor/omni/prebuilt/bin/backuptool.sh:system/bin/backuptool.sh \
vendor/omni/prebuilt/bin/backuptool.functions:system/bin/backuptool.functions \
- vendor/omni/prebuilt/bin/blacklist:system/addon.d/blacklist \
- vendor/omni/prebuilt/bin/clean_cache.sh:system/bin/clean_cache.sh
+ vendor/omni/prebuilt/bin/blacklist:system/addon.d/blacklist
+endif
# Backup Services whitelist
PRODUCT_COPY_FILES += \