if app gets upgraded, restart the service after the upgrade

This commit is contained in:
geeksville 2020-07-07 13:29:16 -07:00
parent 39a5275b1e
commit 55d6c9448b
2 changed files with 10 additions and 1 deletions

View file

@ -149,6 +149,7 @@
</activity>
<receiver android:name="com.geeksville.mesh.service.BootCompleteReceiver">
<!-- handle boot events -->
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
@ -160,6 +161,15 @@
<!-- for testing -->
<action android:name="com.geeksville.mesh.SIM_BOOT" />
</intent-filter>
<!-- Also restart our service if the app gets upgraded -->
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
<!-- I was using PACKAGE_REPLACED, but MY_PACKAGE_REPLACED is newer and seems cleaner
<data
android:scheme="package"
android:path="com.geeksville.mesh" /> -->
</intent-filter>
</receiver>
</application>