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

Commit f3a6be3b authored by Sumedh Sen's avatar Sumedh Sen
Browse files

Catch exceptions thrown inside the Handler

Bug: 343803187
Test: Manual. Perform CUJ9 from go/pia_manual_testing_plan
Change-Id: I50b945c5d7042eedd2cd0203df5e915b74a1d710
parent 59cf6de3
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -311,18 +311,18 @@ public class InstallInstalling extends Activity {
                        broadcastIntent,
                        PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE);

                try {
                // Delay committing the session by 100ms to fix a UI glitch while displaying the
                // Update-Owner change dialog on top of the Installing dialog
                new Handler(Looper.getMainLooper()).postDelayed(() -> {
                    try {
                        session.commit(pendingIntent.getIntentSender());
                    }, 100);
                    } catch (Exception e) {
                        Log.e(LOG_TAG, "Cannot install package: ", e);
                        launchFailure(PackageInstaller.STATUS_FAILURE,
                            PackageManager.INSTALL_FAILED_INTERNAL_ERROR, null);
                        return;
                    }
                }, 100);
                mCancelButton.setEnabled(false);
                setFinishOnTouchOutside(false);
            } else {