Commit 07563bc2 authored by Joshua Pawlicki's avatar Joshua Pawlicki Committed by Commit Bot

Catch RuntimeException from runSynchronously.

Bug: 931177
Change-Id: Ie699786336d84ccde017466606d26073f9d1eb8b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1585961
Commit-Queue: Joshua Pawlicki <waffles@chromium.org>
Commit-Queue: Tommy Nyquist <nyquist@chromium.org>
Auto-Submit: Joshua Pawlicki <waffles@chromium.org>
Reviewed-by: default avatarTommy Nyquist <nyquist@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654505}
parent 096edb06
...@@ -198,10 +198,11 @@ public abstract class RequestGenerator { ...@@ -198,10 +198,11 @@ public abstract class RequestGenerator {
public int getNumGoogleAccountsOnDevice() { public int getNumGoogleAccountsOnDevice() {
// RequestGenerator may be invoked from JobService or AlarmManager (through OmahaService), // RequestGenerator may be invoked from JobService or AlarmManager (through OmahaService),
// so have to make sure AccountManagerFacade instance is initialized. // so have to make sure AccountManagerFacade instance is initialized.
PostTask.runSynchronously(UiThreadTaskTraits.DEFAULT,
() -> ProcessInitializationHandler.getInstance().initializePreNative());
int numAccounts = 0; int numAccounts = 0;
try { try {
// TODO(waffles@chromium.org): Ideally, this should be asynchronous.
PostTask.runSynchronously(UiThreadTaskTraits.DEFAULT,
() -> ProcessInitializationHandler.getInstance().initializePreNative());
numAccounts = AccountManagerFacade.get().getGoogleAccounts().size(); numAccounts = AccountManagerFacade.get().getGoogleAccounts().size();
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "Can't get number of accounts.", e); Log.e(TAG, "Can't get number of accounts.", e);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment