Fix listenForPackageChanges for upgrades again

This commit is contained in:
Mygod
2018-02-14 00:18:49 -08:00
committed by GitHub
parent 4483765b2d
commit 7461d3bf30
@@ -179,8 +179,7 @@ class App : Application() {
filter.addAction(Intent.ACTION_PACKAGE_REMOVED)
filter.addDataScheme("package")
val result = broadcastReceiver { _, intent ->
if (intent.action == Intent.ACTION_PACKAGE_REMOVED ||
!intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) callback()
if (!intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) callback()
}
app.registerReceiver(result, filter)
return result