Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Snippets Groups Projects
Commit f79bba70 authored by Sumedh Sen's avatar Sumedh Sen
Browse files

On negative user action, cancel the install

Send an aborted message to the caller and set appropriate activity result code.

Bug: 182205982
Test: builds successfully
Test: No CTS Tests. Flag to use new app is turned off by default

Change-Id: Ib92caadd2ffb7d13b282c355db45b06f67796a77
parent 518950fc
Branches
No related tags found
No related merge requests found
...@@ -682,6 +682,13 @@ public class UninstallRepository { ...@@ -682,6 +682,13 @@ public class UninstallRepository {
} }
} }
public void cancelInstall() {
if (mCallback != null) {
mCallback.onUninstallComplete(mTargetPackageName,
PackageManager.DELETE_FAILED_ABORTED, "Cancelled by user");
}
}
public MutableLiveData<UninstallStage> getUninstallResult() { public MutableLiveData<UninstallStage> getUninstallResult() {
return mUninstallResult; return mUninstallResult;
} }
......
...@@ -161,6 +161,7 @@ public class UninstallLaunch extends FragmentActivity implements UninstallAction ...@@ -161,6 +161,7 @@ public class UninstallLaunch extends FragmentActivity implements UninstallAction
@Override @Override
public void onNegativeResponse() { public void onNegativeResponse() {
mUninstallViewModel.cancelInstall();
setResult(Activity.RESULT_FIRST_USER, null, true); setResult(Activity.RESULT_FIRST_USER, null, true);
} }
} }
...@@ -62,4 +62,8 @@ public class UninstallViewModel extends AndroidViewModel { ...@@ -62,4 +62,8 @@ public class UninstallViewModel extends AndroidViewModel {
} }
}); });
} }
public void cancelInstall() {
mRepository.cancelInstall();
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment