Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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(() -> {
// 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;
}
} 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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment