Commit 91574db9 authored by lambroslambrou's avatar lambroslambrou Committed by Commit bot

Android Chromoting: Remove duplicate code for fetching the host list.

A previous refactoring had left some duplicate code which fetched the
host list twice!

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

Cr-Commit-Position: refs/heads/master@{#295882}
parent 6a528cdd
...@@ -174,6 +174,7 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe ...@@ -174,6 +174,7 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
} }
} }
} }
/** /**
* Called when the activity becomes visible. This happens on initial launch and whenever the * Called when the activity becomes visible. This happens on initial launch and whenever the
* user switches to the activity, for example, by using the window-switcher or when coming from * user switches to the activity, for example, by using the window-switcher or when coming from
...@@ -306,12 +307,6 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe ...@@ -306,12 +307,6 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
try { try {
// Here comes our auth token from the Android system. // Here comes our auth token from the Android system.
result = future.getResult(); result = future.getResult();
String authToken = result.getString(AccountManager.KEY_AUTHTOKEN);
Log.i("auth", "Received an auth token from system");
mToken = authToken;
mHostListLoader.retrieveHostList(authToken, this);
} catch (OperationCanceledException ex) { } catch (OperationCanceledException ex) {
// User canceled authentication. No need to report an error. // User canceled authentication. No need to report an error.
} catch (AuthenticatorException ex) { } catch (AuthenticatorException ex) {
...@@ -327,12 +322,10 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe ...@@ -327,12 +322,10 @@ public class Chromoting extends Activity implements JniInterface.ConnectionListe
return; return;
} }
String authToken = result.getString(AccountManager.KEY_AUTHTOKEN); mToken = result.getString(AccountManager.KEY_AUTHTOKEN);
Log.i("auth", "Received an auth token from system"); Log.i("auth", "Received an auth token from system");
mToken = authToken; mHostListLoader.retrieveHostList(mToken, this);
mHostListLoader.retrieveHostList(authToken, this);
} }
@Override @Override
......
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