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

Side by Side Diff: sync/android/java/src/org/chromium/sync/signin/AuthException.java

Issue 1440363002: Use GoogleAuthUtil's getToken instead of AccountManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: multidex Created 5 years 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.sync.signin;
6
7 import android.content.Intent;
8
9 /*
10 * AuthException abstracts away authenticator specific exceptions behind a singl e interface.
11 * It is used for passing information that is useful for better handling of erro rs.
12 */
13 public class AuthException extends Exception {
14 private final boolean mIsTransientError;
15 private final Intent mRecoveryIntent;
16
17 /*
18 * A simple constructor that stores all the error handling information and m akes it available to
19 * the handler.
20 * @param isTransientError Whether the error is transient and we can retry.
21 * @param recoveryIntent An intent that can be used to recover from this err or.
22 * Thus, a user recoverable error is not transient, since it requires explic it user handling
23 * before retry.
24 */
25 public AuthException(boolean isTransientError, Intent recoveryIntent, Except ion exception) {
26 super(exception);
27 assert !isTransientError || recoveryIntent == null;
28 mIsTransientError = isTransientError;
29 mRecoveryIntent = recoveryIntent;
30 }
31
32 /*
33 * @return Whether the error is transient and we can retry.
34 */
35 public boolean isTransientError() {
36 return mIsTransientError;
37 }
38
39 /*
40 * @return An intent that can be used to recover from this error if it is re coverabale by user
41 * intervention, else {@code null}.
42 */
43 public Intent getRecoveryIntent() {
44 return mRecoveryIntent;
45 }
46 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698