[2/2] omni: add OTA script do delete package cache
after flashing new image delete contents of /data/system/package_cache/
to make sure they are recreated. Outdated cache files are the
reason for the famous 'resource derps'
Change-Id: Iaf1f113a64242254b8fb33bc5b9fdef0c9fdb120
diff --git a/config/common.mk b/config/common.mk
index 1a53295..448e232 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -34,8 +34,8 @@
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/50-hosts.sh:system/addon.d/50-hosts.sh \
- vendor/omni/prebuilt/bin/blacklist:system/addon.d/blacklist
+ vendor/omni/prebuilt/bin/blacklist:system/addon.d/blacklist \
+ vendor/omni/prebuilt/bin/clean_cache.sh:system/bin/clean_cache.sh
# Backup Services whitelist
PRODUCT_COPY_FILES += \
diff --git a/prebuilt/bin/clean_cache.sh b/prebuilt/bin/clean_cache.sh
new file mode 100755
index 0000000..5efbb42
--- /dev/null
+++ b/prebuilt/bin/clean_cache.sh
@@ -0,0 +1,10 @@
+#!/sbin/sh
+#
+# /system/bin/clean_cache.sh
+# During a firmware upgrade, this script deletes cache files
+# in /data/system/package_cache/*
+#
+
+if [ -d /data/system/package_cache/ ]; then
+ rm -fr /data/system/package_cache/*
+fi