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

Commit 9edc606d authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[ADI][54/N] bring back AppNotInstalled dialog" into main

parents 72efbfbd 0a1b34a7
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -1087,16 +1087,9 @@ class InstallRepository(private val context: Context) {
            // InstallFailed dialog must not be shown only when the user denies ownership update. We
            // must show this dialog for all other install failures.

            // Since API 36.1, InstallFailed dialog must not be shown if the installation failed
            // because of the developer verification failure.
            val developerVerificationFailed = Flags.verificationService()
                    && statusCode == PackageInstaller.STATUS_FAILURE_ABORTED
                    && hasDeveloperVerificationFailure

            val userDenied = developerVerificationFailed ||
                    (statusCode == PackageInstaller.STATUS_FAILURE_ABORTED &&
            val userDenied = statusCode == PackageInstaller.STATUS_FAILURE_ABORTED &&
                            legacyStatus != PackageManager.INSTALL_FAILED_VERIFICATION_TIMEOUT &&
                            legacyStatus != PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE)
                            legacyStatus != PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE

            if (shouldReturnResult) {
                val resultIntent = Intent().putExtra(Intent.EXTRA_INSTALL_RESULT, legacyStatus)
+7 −2
Original line number Diff line number Diff line
@@ -311,13 +311,18 @@ class InstallLaunch : FragmentActivity(), InstallActionListener {
        if (localLogv) {
            Log.d(LOG_TAG, "Negative button clicked. StageCode: $stageCode")
        }
        var resultCode = RESULT_CANCELED
        when (stageCode) {
            InstallStage.STAGE_USER_ACTION_REQUIRED -> installViewModel!!.cleanupInstall()
            InstallStage.STAGE_STAGING -> installViewModel!!.abortStaging()
            InstallStage.STAGE_VERIFICATION_CONFIRMATION_REQUIRED ->
            InstallStage.STAGE_VERIFICATION_CONFIRMATION_REQUIRED -> {
                // Developer verification requested user action and user has declined to continue
                // the installation. Don't abandon the session. Let the installation fail through.
                resultCode = RESULT_OK
                installViewModel!!.onNegativeVerificationUserResponse()
            }
        setResult(RESULT_CANCELED, null, true)
        }
        setResult(resultCode, null, true)
    }

    override fun onNegativeResponse(resultCode: Int, data: Intent?) {
+6 −1
Original line number Diff line number Diff line
@@ -640,6 +640,8 @@ public class InstallationFragment extends DialogFragment {
        mCustomMessageTextView.setVisibility(View.VISIBLE);
        mIndeterminateProgressBar.setVisibility(View.GONE);
        mProgressBar.setVisibility(View.GONE);
        // Disable clicking outside of the dialog
        this.setCancelable(false);

        mAppIcon.setImageDrawable(installStage.getAppIcon());
        mAppLabelTextView.setText(installStage.getAppLabel());
@@ -665,7 +667,10 @@ public class InstallationFragment extends DialogFragment {
            negativeButton.setFilterTouchesWhenObscured(true);
            UiUtil.applyOutlinedButtonStyle(requireContext(), negativeButton);
            negativeButton.setOnClickListener(view -> {
                mInstallActionListener.onNegativeResponse(installStage.getStageCode());
                // Don't use installStage.getStageCode() here because it can be
                // STAGE_USER_ACTION_REQUIRED if the installation is triggered by Pia itself.
                mInstallActionListener.onNegativeResponse(
                        InstallStage.STAGE_VERIFICATION_CONFIRMATION_REQUIRED);
            });
        }
        // Hide positive button