Commit 54894bc4 authored by avayvod's avatar avayvod Committed by Commit bot

[Cast,Android] Fix the RuntimeException crasher

Seems like throwing a RuntimeException is quite an overkill.
In particular, we still seem to get onResult() callback even if the GMS core connection is suspended.
Replaced the exception with a warning message in a cherrypickable way (the crash happens in M48).

BUG=579718

Review URL: https://codereview.chromium.org/1614833003

Cr-Commit-Position: refs/heads/master@{#370687}
parent b4bc1f2d
...@@ -169,7 +169,10 @@ public class CreateRouteRequest implements GoogleApiClient.ConnectionCallbacks, ...@@ -169,7 +169,10 @@ public class CreateRouteRequest implements GoogleApiClient.ConnectionCallbacks,
@Override @Override
public void onResult(Cast.ApplicationConnectionResult result) { public void onResult(Cast.ApplicationConnectionResult result) {
if (mState != STATE_LAUNCHING_APPLICATION) throwInvalidState(); if (mState != STATE_LAUNCHING_APPLICATION
&& mState != STATE_API_CONNECTION_SUSPENDED) {
throwInvalidState();
}
Status status = result.getStatus(); Status status = result.getStatus();
if (!status.isSuccess()) { if (!status.isSuccess()) {
......
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