Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: remoting/android/java/src/org/chromium/chromoting/Chromoting.java

Issue 273313003: Fix lint issues with Chromoting for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | remoting/android/java/src/org/chromium/chromoting/Desktop.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.TargetApi;
13 import android.app.ActionBar; 14 import android.app.ActionBar;
14 import android.app.Activity; 15 import android.app.Activity;
15 import android.app.AlertDialog; 16 import android.app.AlertDialog;
16 import android.app.ProgressDialog; 17 import android.app.ProgressDialog;
17 import android.content.DialogInterface; 18 import android.content.DialogInterface;
18 import android.content.Intent; 19 import android.content.Intent;
19 import android.content.SharedPreferences; 20 import android.content.SharedPreferences;
20 import android.content.res.Configuration; 21 import android.content.res.Configuration;
22 import android.os.Build;
21 import android.os.Bundle; 23 import android.os.Bundle;
22 import android.provider.Settings; 24 import android.provider.Settings;
23 import android.util.Log; 25 import android.util.Log;
24 import android.view.Menu; 26 import android.view.Menu;
25 import android.view.MenuItem; 27 import android.view.MenuItem;
26 import android.view.View; 28 import android.view.View;
27 import android.widget.ArrayAdapter; 29 import android.widget.ArrayAdapter;
28 import android.widget.ListView; 30 import android.widget.ListView;
29 import android.widget.Toast; 31 import android.widget.Toast;
30 32
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 * used to request the host list a second time. 93 * used to request the host list a second time.
92 */ 94 */
93 boolean mTriedNewAuthToken; 95 boolean mTriedNewAuthToken;
94 96
95 /** Shows a warning explaining that a Google account is required, then close s the activity. */ 97 /** Shows a warning explaining that a Google account is required, then close s the activity. */
96 private void showNoAccountsDialog() { 98 private void showNoAccountsDialog() {
97 AlertDialog.Builder builder = new AlertDialog.Builder(this); 99 AlertDialog.Builder builder = new AlertDialog.Builder(this);
98 builder.setMessage(R.string.noaccounts_message); 100 builder.setMessage(R.string.noaccounts_message);
99 builder.setPositiveButton(R.string.noaccounts_add_account, 101 builder.setPositiveButton(R.string.noaccounts_add_account,
100 new DialogInterface.OnClickListener() { 102 new DialogInterface.OnClickListener() {
103 @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
101 @Override 104 @Override
102 public void onClick(DialogInterface dialog, int id) { 105 public void onClick(DialogInterface dialog, int id) {
103 Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT); 106 Intent intent = new Intent(Settings.ACTION_ADD_ACCOUNT);
104 intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES, 107 intent.putExtra(Settings.EXTRA_ACCOUNT_TYPES,
garykac 2014/05/12 17:37:14 Doesn't this code need a if (Build.VERSION.SDK
Lambros 2014/05/12 20:39:29 I'm not sure. It works fine on an older device wit
newt (away) 2014/05/13 04:04:47 Correct. Constants on Android are typically static
105 new String[] { ACCOUNT_TYPE }); 108 new String[] { ACCOUNT_TYPE });
106 if (intent.resolveActivity(getPackageManager()) != null) { 109 if (intent.resolveActivity(getPackageManager()) != null) {
107 startActivity(intent); 110 startActivity(intent);
108 } 111 }
109 finish(); 112 finish();
110 } 113 }
111 }); 114 });
112 builder.setNegativeButton(R.string.close, new DialogInterface.OnClickLis tener() { 115 builder.setNegativeButton(R.string.close, new DialogInterface.OnClickLis tener() {
113 @Override 116 @Override
114 public void onClick(DialogInterface dialog, int id) { 117 public void onClick(DialogInterface dialog, int id) {
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 // Unreachable, but required by Google Java style and findbugs. 440 // Unreachable, but required by Google Java style and findbugs.
438 assert false : "Unreached"; 441 assert false : "Unreached";
439 } 442 }
440 443
441 if (dismissProgress && mProgressIndicator != null) { 444 if (dismissProgress && mProgressIndicator != null) {
442 mProgressIndicator.dismiss(); 445 mProgressIndicator.dismiss();
443 mProgressIndicator = null; 446 mProgressIndicator = null;
444 } 447 }
445 } 448 }
446 } 449 }
OLDNEW
« no previous file with comments | « no previous file | remoting/android/java/src/org/chromium/chromoting/Desktop.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698