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

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
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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() {
        return mUninstallResult;
    }
+1 −0
Original line number Diff line number Diff line
@@ -161,6 +161,7 @@ public class UninstallLaunch extends FragmentActivity implements UninstallAction

    @Override
    public void onNegativeResponse() {
        mUninstallViewModel.cancelInstall();
        setResult(Activity.RESULT_FIRST_USER, null, true);
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -62,4 +62,8 @@ public class UninstallViewModel extends AndroidViewModel {
            }
        });
    }

    public void cancelInstall() {
        mRepository.cancelInstall();
    }
}