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

Commit 0312d1b0 authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

No canceling while package manager is processing

At this time a cancelation does not do anything as we cannot stop the
package manager anymore. Hence do not give the user the impression that
he cannot cancel.

Test: Tried to cancel during this stage.
Change-Id: I8f0e3705c6a05fcfcf43a80d348f0bf163f2bf63
parent 3450ba84
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -220,6 +220,7 @@ public class InstallInstalling extends Activity {
            } else {
                // we will receive a broadcast when the install is finished
                mCancelButton.setEnabled(false);
                setFinishOnTouchOutside(false);
            }
        }
    }
@@ -232,6 +233,13 @@ public class InstallInstalling extends Activity {
        outState.putInt(INSTALL_ID, mInstallId);
    }

    @Override
    public void onBackPressed() {
        if (mCancelButton.isEnabled()) {
            super.onBackPressed();
        }
    }

    @Override
    protected void onStop() {
        super.onStop();
@@ -384,6 +392,7 @@ public class InstallInstalling extends Activity {

                session.commit(pendingIntent.getIntentSender());
                mCancelButton.setEnabled(false);
                setFinishOnTouchOutside(false);
            } else {
                getPackageManager().getPackageInstaller().abandonSession(mSessionId);
                launchFailure(PackageInstaller.STATUS_FAILURE, null);