File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
app/src/main/java/app/revanced/manager/ui/viewmodel Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -108,14 +108,19 @@ class UpdateViewModel(
108108 val extra =
109109 intent.getStringExtra(InstallService .EXTRA_INSTALL_STATUS_MESSAGE )!!
110110
111- if (pmStatus == PackageInstaller .STATUS_SUCCESS ) {
112- app.toast(app.getString(R .string.install_app_success))
113- state = State .SUCCESS
114- } else {
115- state = State .FAILED
116- // TODO: handle install fail with a popup
117- installError = extra
118- app.toast(app.getString(R .string.install_app_fail, extra))
111+ when (pmStatus) {
112+ PackageInstaller .STATUS_SUCCESS -> {
113+ app.toast(app.getString(R .string.install_app_success))
114+ state = State .SUCCESS
115+ }
116+ PackageInstaller .STATUS_FAILURE_ABORTED -> {
117+ state = State .CAN_INSTALL
118+ }
119+ else -> {
120+ app.toast(app.getString(R .string.install_app_fail, extra))
121+ installError = extra
122+ state = State .FAILED
123+ }
119124 }
120125 }
121126 }
You can’t perform that action at this time.
0 commit comments