Prevent stock OTA activities from running in CM
Change-Id: I3f586cd246fc351afb82c94f41329bf930f6f41a
diff --git a/config/common.mk b/config/common.mk
index a204f9b..96f0ceb 100644
--- a/config/common.mk
+++ b/config/common.mk
@@ -112,6 +112,10 @@
vendor/cm/prebuilt/common/bin/compcache:system/bin/compcache \
vendor/cm/prebuilt/common/bin/handle_compcache:system/bin/handle_compcache
+# block stock OTAs
+PRODUCT_COPY_FILES += \
+ vendor/cm/prebuilt/common/bin/otablock:system/bin/otablock
+
# Terminal Emulator
PRODUCT_COPY_FILES += \
vendor/cm/proprietary/Term.apk:system/app/Term.apk \
diff --git a/prebuilt/common/bin/otablock b/prebuilt/common/bin/otablock
new file mode 100644
index 0000000..b1a93f2
--- /dev/null
+++ b/prebuilt/common/bin/otablock
@@ -0,0 +1,9 @@
+#!/system/bin/sh
+
+
+## If these activities are installed, get rid of them. We don't want updates
+## coming in from outside CM
+
+exec 2>/dev/null
+pm disable com.google.android.gsf/com.google.android.gsf.update.SystemUpdateActivity
+pm disable com.google.android.gsf/com.google.android.gsf.update.SystemUpdateService
diff --git a/prebuilt/common/etc/init.local.rc b/prebuilt/common/etc/init.local.rc
index 9cdc8ea..c9c79da 100644
--- a/prebuilt/common/etc/init.local.rc
+++ b/prebuilt/common/etc/init.local.rc
@@ -49,3 +49,12 @@
user root
oneshot
disabled
+
+# Block stock OTA activities
+service otablock /system/bin/otablock
+ user root
+ oneshot
+ disabled
+
+on property:dev.bootcomplete=1
+ start otablock