| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.chrome.browser.externalauth; | 5 package org.chromium.chrome.browser.externalauth; |
| 6 | 6 |
| 7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
| 8 import android.content.Context; | 8 import android.content.Context; |
| 9 import android.content.pm.ApplicationInfo; | 9 import android.content.pm.ApplicationInfo; |
| 10 import android.content.pm.PackageManager; | 10 import android.content.pm.PackageManager; |
| 11 import android.content.pm.PackageManager.NameNotFoundException; | 11 import android.content.pm.PackageManager.NameNotFoundException; |
| 12 import android.os.Binder; | 12 import android.os.Binder; |
| 13 import android.os.StrictMode; | 13 import android.os.StrictMode; |
| 14 import android.os.SystemClock; | 14 import android.os.SystemClock; |
| 15 import android.text.TextUtils; | 15 import android.text.TextUtils; |
| 16 | 16 |
| 17 import com.google.android.gms.common.ConnectionResult; | 17 import com.google.android.gms.common.ConnectionResult; |
| 18 import com.google.android.gms.common.GoogleApiAvailability; | 18 import com.google.android.gms.common.GoogleApiAvailability; |
| 19 | 19 |
| 20 import org.chromium.base.ContextUtils; | 20 import org.chromium.base.ContextUtils; |
| 21 import org.chromium.base.Log; | 21 import org.chromium.base.Log; |
| 22 import org.chromium.base.ThreadUtils; | 22 import org.chromium.base.ThreadUtils; |
| 23 import org.chromium.base.VisibleForTesting; | 23 import org.chromium.base.VisibleForTesting; |
| 24 import org.chromium.base.metrics.CachedMetrics.SparseHistogramSample; | |
| 25 import org.chromium.base.metrics.CachedMetrics.TimesHistogramSample; | |
| 26 import org.chromium.chrome.browser.ChromeApplication; | 24 import org.chromium.chrome.browser.ChromeApplication; |
| 25 import org.chromium.chrome.browser.metrics.LaunchMetrics.SparseHistogramSample; |
| 26 import org.chromium.chrome.browser.metrics.LaunchMetrics.TimesHistogramSample; |
| 27 | 27 |
| 28 import java.util.concurrent.TimeUnit; | 28 import java.util.concurrent.TimeUnit; |
| 29 import java.util.concurrent.atomic.AtomicReference; | 29 import java.util.concurrent.atomic.AtomicReference; |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * Utility class for external authentication tools. | 32 * Utility class for external authentication tools. |
| 33 * | 33 * |
| 34 * This class is safe to use on any thread. | 34 * This class is safe to use on any thread. |
| 35 */ | 35 */ |
| 36 public class ExternalAuthUtils { | 36 public class ExternalAuthUtils { |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 /** | 281 /** |
| 282 * Invokes whatever external code is necessary to obtain a textual descripti
on of an error | 282 * Invokes whatever external code is necessary to obtain a textual descripti
on of an error |
| 283 * code produced by {@link #checkGooglePlayServicesAvailable(Context)}. | 283 * code produced by {@link #checkGooglePlayServicesAvailable(Context)}. |
| 284 * @param errorCode The code to check | 284 * @param errorCode The code to check |
| 285 * @return a textual description of the error code | 285 * @return a textual description of the error code |
| 286 */ | 286 */ |
| 287 protected String describeError(final int errorCode) { | 287 protected String describeError(final int errorCode) { |
| 288 return GoogleApiAvailability.getInstance().getErrorString(errorCode); | 288 return GoogleApiAvailability.getInstance().getErrorString(errorCode); |
| 289 } | 289 } |
| 290 } | 290 } |
| OLD | NEW |