mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-02-22 14:24:45 +01:00
Add exception ignoring to UpdateHelper when PendingIntent is duplicated (#1168)
This commit is contained in:
parent
9d8ad73e63
commit
a801c8f8be
@ -3,6 +3,7 @@ package io.github.wulkanowy.utils
|
|||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import android.app.Activity.RESULT_OK
|
import android.app.Activity.RESULT_OK
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.IntentSender
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
@ -87,9 +88,13 @@ class UpdateHelper @Inject constructor(
|
|||||||
|
|
||||||
private fun startUpdate(activity: Activity, appUpdateInfo: AppUpdateInfo, updateType: Int) {
|
private fun startUpdate(activity: Activity, appUpdateInfo: AppUpdateInfo, updateType: Int) {
|
||||||
Timber.d("Start update ($updateType): $appUpdateInfo")
|
Timber.d("Start update ($updateType): $appUpdateInfo")
|
||||||
appUpdateManager.startUpdateFlowForResult(
|
try {
|
||||||
appUpdateInfo, updateType, activity, IN_APP_UPDATE_REQUEST_CODE
|
appUpdateManager.startUpdateFlowForResult(
|
||||||
)
|
appUpdateInfo, updateType, activity, IN_APP_UPDATE_REQUEST_CODE
|
||||||
|
)
|
||||||
|
} catch (e: IntentSender.SendIntentException) {
|
||||||
|
Timber.i("Update failed! Duplicated PendingIntent")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onActivityResult(requestCode: Int, resultCode: Int) {
|
fun onActivityResult(requestCode: Int, resultCode: Int) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user