Don't remove alarms for packages that are being updated.
Change-Id: I296e6587aa1bb391e748ff4bb5649dcfa6ebbc24
diff --git a/services/java/com/android/server/AlarmManagerService.java b/services/java/com/android/server/AlarmManagerService.java
index 43fe6ab..1ffb427 100644
--- a/services/java/com/android/server/AlarmManagerService.java
+++ b/services/java/com/android/server/AlarmManagerService.java
@@ -821,6 +821,11 @@
} else if (Intent.ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE.equals(action)) {
pkgList = intent.getStringArrayExtra(Intent.EXTRA_CHANGED_PACKAGE_LIST);
} else {
+ if (Intent.ACTION_PACKAGE_REMOVED.equals(action)
+ && intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
+ // This package is being updated; don't kill its alarms.
+ return;
+ }
Uri data = intent.getData();
if (data != null) {
String pkg = data.getSchemeSpecificPart();