OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chromoting; | 5 package org.chromium.chromoting; |
6 | 6 |
7 import android.accounts.Account; | 7 import android.accounts.Account; |
8 import android.accounts.AccountManager; | 8 import android.accounts.AccountManager; |
9 import android.accounts.AccountManagerCallback; | 9 import android.accounts.AccountManagerCallback; |
10 import android.accounts.AccountManagerFuture; | 10 import android.accounts.AccountManagerFuture; |
11 import android.accounts.AuthenticatorException; | 11 import android.accounts.AuthenticatorException; |
12 import android.accounts.OperationCanceledException; | 12 import android.accounts.OperationCanceledException; |
13 import android.annotation.SuppressLint; | 13 import android.annotation.SuppressLint; |
14 import android.app.ActionBar; | 14 import android.app.ActionBar; |
15 import android.app.Activity; | 15 import android.app.Activity; |
16 import android.app.AlertDialog; | 16 import android.app.AlertDialog; |
17 import android.app.ProgressDialog; | 17 import android.app.ProgressDialog; |
18 import android.content.DialogInterface; | 18 import android.content.DialogInterface; |
19 import android.content.Intent; | 19 import android.content.Intent; |
20 import android.content.SharedPreferences; | 20 import android.content.SharedPreferences; |
21 import android.content.res.Configuration; | 21 import android.content.res.Configuration; |
22 import android.os.Build; | |
23 import android.os.Bundle; | 22 import android.os.Bundle; |
24 import android.provider.Settings; | 23 import android.provider.Settings; |
25 import android.util.Log; | 24 import android.util.Log; |
26 import android.view.Menu; | 25 import android.view.Menu; |
27 import android.view.MenuItem; | 26 import android.view.MenuItem; |
28 import android.view.View; | 27 import android.view.View; |
29 import android.widget.ArrayAdapter; | 28 import android.widget.ArrayAdapter; |
30 import android.widget.ListView; | 29 import android.widget.ListView; |
31 import android.widget.Toast; | 30 import android.widget.Toast; |
32 | 31 |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
390 explanation = getString(R.string.error_authentication_failed); | 389 explanation = getString(R.string.error_authentication_failed); |
391 Toast.makeText(this, explanation, Toast.LENGTH_LONG).show(); | 390 Toast.makeText(this, explanation, Toast.LENGTH_LONG).show(); |
392 setHostListProgressVisible(false); | 391 setHostListProgressVisible(false); |
393 } | 392 } |
394 } | 393 } |
395 | 394 |
396 /** | 395 /** |
397 * Updates the infotext and host list display. | 396 * Updates the infotext and host list display. |
398 */ | 397 */ |
399 private void updateUi() { | 398 private void updateUi() { |
400 mRefreshButton.setEnabled(mAccount != null); | 399 if (mRefreshButton != null) { |
Lambros
2014/06/02 17:07:22
Looks like there's a race between updateUi() and o
| |
401 | 400 mRefreshButton.setEnabled(mAccount != null); |
401 } | |
402 ArrayAdapter<HostInfo> displayer = new HostListAdapter(this, R.layout.ho st, mHosts); | 402 ArrayAdapter<HostInfo> displayer = new HostListAdapter(this, R.layout.ho st, mHosts); |
403 Log.i("hostlist", "About to populate host list display"); | 403 Log.i("hostlist", "About to populate host list display"); |
404 mHostListView.setAdapter(displayer); | 404 mHostListView.setAdapter(displayer); |
405 } | 405 } |
406 | 406 |
407 @Override | 407 @Override |
408 public void onConnectionState(JniInterface.ConnectionListener.State state, | 408 public void onConnectionState(JniInterface.ConnectionListener.State state, |
409 JniInterface.ConnectionListener.Error error) { | 409 JniInterface.ConnectionListener.Error error) { |
410 boolean dismissProgress = false; | 410 boolean dismissProgress = false; |
411 switch (state) { | 411 switch (state) { |
(...skipping 28 matching lines...) Expand all Loading... | |
440 // Unreachable, but required by Google Java style and findbugs. | 440 // Unreachable, but required by Google Java style and findbugs. |
441 assert false : "Unreached"; | 441 assert false : "Unreached"; |
442 } | 442 } |
443 | 443 |
444 if (dismissProgress && mProgressIndicator != null) { | 444 if (dismissProgress && mProgressIndicator != null) { |
445 mProgressIndicator.dismiss(); | 445 mProgressIndicator.dismiss(); |
446 mProgressIndicator = null; | 446 mProgressIndicator = null; |
447 } | 447 } |
448 } | 448 } |
449 } | 449 } |
OLD | NEW |