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

Commit 460e65ce authored by Sumedh Sen's avatar Sumedh Sen Committed by Android (Google) Code Review
Browse files

Merge "Catch exceptions thrown inside the Handler" into main

parents 722013c0 f3a6be3b
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 {