Bug 1465323 - Update WhatsNewReceiver; r?JanH draft
authorPetru Lingurar <petru.lingurar@softvision.ro>
Tue, 12 Jun 2018 12:43:55 +0300
changeset 817982 fdd4bf6ff67f07d93233f1e964e6321326696ca0
parent 817981 86dc30aed7445e07f38ea95cba9d58f162178b67
child 817983 42ac3d92b32fad825d64411ebefd0d48207f1f3d
push id116231
push userplingurar@mozilla.com
push dateFri, 13 Jul 2018 19:23:06 +0000
reviewersJanH
bugs1465323
milestone63.0a1
Bug 1465323 - Update WhatsNewReceiver; r?JanH Listening for `ACTION_MY_PACKAGE_REPLACED` [1] is the easiest way to get notified when the app has been updated. This broadcast, while not explicitly exempt from Oreo's Background Execution Limits [2] is considered explicit because it is sent only to the package being replaced and so it is compatible with the new limitations. The previous intent action was chosen because at that time this action was not supported by all platforms Fennec ran on [3], but this is not the case anymore. The other broadcast - `ACTION_NOTIFICATION_CANCELLED` that this receiver listens to is send explicitly. [1] https://developer.android.com/reference/android/content/Intent.html#ACTION_MY_PACKAGE_REPLACED [2] https://developer.android.com/guide/components/broadcast-exceptions [3] https://github.com/mozilla-services/android-sync/pull/442/commits/5c06063be6f6ae33f3624474c0ee11e4f3ff5142 MozReview-Commit-ID: DLUdw906i3P
mobile/android/base/AndroidManifest.xml.in
--- a/mobile/android/base/AndroidManifest.xml.in
+++ b/mobile/android/base/AndroidManifest.xml.in
@@ -262,18 +262,17 @@
                  android:exported="false"
                  android:stopWithTask="true">
         </service>
 
         <receiver
             android:name="org.mozilla.gecko.notifications.WhatsNewReceiver"
             android:exported="false">
             <intent-filter>
-                <action android:name="android.intent.action.PACKAGE_REPLACED" />
-                <data android:scheme="package" android:path="org.mozilla.gecko" />
+                <action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
             </intent-filter>
         </receiver>
 
         <receiver
             android:name="org.mozilla.gecko.notifications.NotificationReceiver"
             android:exported="false">
             <!-- Notification API V2 -->
             <intent-filter>