Skip to content

Commit

Permalink
Launching updates in place causes issues
Browse files Browse the repository at this point in the history
  • Loading branch information
AbandonedCart committed Mar 10, 2024
1 parent a95d70a commit b8a5208
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
6 changes: 1 addition & 5 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,7 @@
android:process=":TagMo" />
<receiver
android:name=".update.UpdateReceiver"
android:exported="true">
<intent-filter android:priority="999">
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
android:exported="true" />
<meta-data
android:name="com.android.packageinstaller.notification.smallIcon"
android:resource="@mipmap/ic_launcher" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ class UpdateReceiver : BroadcastReceiver() {
intent.setPackage(context.packageName)
intent.flags = 0
intent.data = null
if (Intent.ACTION_MY_PACKAGE_REPLACED == action) {
var mainIntent: Intent? = Intent(context, BrowserActivity::class.java)
try {
mainIntent = context.packageManager
.getLaunchIntentForPackage(BuildConfig.APPLICATION_ID)
} catch (ignored: Exception) { }
startLauncherActivity(context, mainIntent)
} else if (!BuildConfig.GOOGLE_PLAY && Version.isLollipop) {
if (!BuildConfig.GOOGLE_PLAY && Version.isLollipop) {
when (intent.getIntExtra(PackageInstaller.EXTRA_STATUS, -1)) {
PackageInstaller.STATUS_PENDING_USER_ACTION -> {
intent.parcelable<Intent>(Intent.EXTRA_INTENT)?.let {
Expand Down

0 comments on commit b8a5208

Please sign in to comment.