-
Notifications
You must be signed in to change notification settings - Fork 702
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: run formatter * chore: fix line lengths
- Loading branch information
Showing
151 changed files
with
3,629 additions
and
3,782 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,25 +37,22 @@ | |
import java.util.Collection; | ||
|
||
/** | ||
* {@link Beta} <br/> | ||
* {@link Beta} <br> | ||
* Manages authorization and account selection for Google accounts. | ||
* | ||
* <p> | ||
* When fetching a token, any thrown {@link GoogleAuthException} would be wrapped: | ||
* <p>When fetching a token, any thrown {@link GoogleAuthException} would be wrapped: | ||
* | ||
* <ul> | ||
* <li>{@link GooglePlayServicesAvailabilityException} would be wrapped inside of | ||
* {@link GooglePlayServicesAvailabilityIOException}</li> | ||
* <li>{@link UserRecoverableAuthException} would be wrapped inside of | ||
* {@link UserRecoverableAuthIOException}</li> | ||
* <li>{@link GoogleAuthException} when be wrapped inside of {@link GoogleAuthIOException}</li> | ||
* <li>{@link GooglePlayServicesAvailabilityException} would be wrapped inside of {@link | ||
* GooglePlayServicesAvailabilityIOException} | ||
* <li>{@link UserRecoverableAuthException} would be wrapped inside of {@link | ||
* UserRecoverableAuthIOException} | ||
* <li>{@link GoogleAuthException} when be wrapped inside of {@link GoogleAuthIOException} | ||
* </ul> | ||
* </p> | ||
* | ||
* <p> | ||
* Upgrade warning: in prior version 1.14 exponential back-off was enabled by default when I/O | ||
* <p>Upgrade warning: in prior version 1.14 exponential back-off was enabled by default when I/O | ||
* exception was thrown inside {@link #getToken}, but starting with version 1.15 you need to call | ||
* {@link #setBackOff} with {@link ExponentialBackOff} to enable it. | ||
* </p> | ||
* | ||
* @since 1.12 | ||
* @author Yaniv Inbar | ||
|
@@ -106,7 +103,6 @@ public GoogleAccountCredential(Context context, String scope) { | |
* @param context context | ||
* @param scopes non empty OAuth 2.0 scope list | ||
* @return new instance | ||
* | ||
* @since 1.15 | ||
*/ | ||
public static GoogleAccountCredential usingOAuth2(Context context, Collection<String> scopes) { | ||
|
@@ -128,8 +124,8 @@ public static GoogleAccountCredential usingAudience(Context context, String audi | |
} | ||
|
||
/** | ||
* Sets the selected Google account name (e-mail address) -- for example | ||
* {@code "[email protected]"} -- or {@code null} for none. | ||
* Sets the selected Google account name (e-mail address) -- for example {@code | ||
* "[email protected]"} -- or {@code null} for none. | ||
*/ | ||
public final GoogleAccountCredential setSelectedAccountName(String accountName) { | ||
selectedAccount = accountManager.getAccountByName(accountName); | ||
|
@@ -141,9 +137,7 @@ public final GoogleAccountCredential setSelectedAccountName(String accountName) | |
/** | ||
* Sets the selected Google {@link Account} or {@code null} for none. | ||
* | ||
* <p> | ||
* Caller must ensure the given Google account exists. | ||
* </p> | ||
* <p>Caller must ensure the given Google account exists. | ||
*/ | ||
public final GoogleAccountCredential setSelectedAccount(Account selectedAccount) { | ||
this.selectedAccount = selectedAccount; | ||
|
@@ -184,8 +178,8 @@ public final Account getSelectedAccount() { | |
} | ||
|
||
/** | ||
* Returns the back-off policy which is used when an I/O exception is thrown inside | ||
* {@link #getToken} or {@code null} for none. | ||
* Returns the back-off policy which is used when an I/O exception is thrown inside {@link | ||
* #getToken} or {@code null} for none. | ||
* | ||
* @since 1.15 | ||
*/ | ||
|
@@ -224,8 +218,8 @@ public final GoogleAccountCredential setSleeper(Sleeper sleeper) { | |
} | ||
|
||
/** | ||
* Returns the selected Google account name (e-mail address), for example | ||
* {@code "[email protected]"}, or {@code null} for none. | ||
* Returns the selected Google account name (e-mail address), for example {@code | ||
* "[email protected]"}, or {@code null} for none. | ||
*/ | ||
public final String getSelectedAccountName() { | ||
return accountName; | ||
|
@@ -235,12 +229,11 @@ public final String getSelectedAccountName() { | |
* Returns an intent to show the user to select a Google account, or create a new one if there are | ||
* none on the device yet. | ||
* | ||
* <p> | ||
* Must be run from the main UI thread. | ||
* </p> | ||
* <p>Must be run from the main UI thread. | ||
*/ | ||
public final Intent newChooseAccountIntent() { | ||
return AccountPicker.newChooseAccountIntent(selectedAccount, | ||
return AccountPicker.newChooseAccountIntent( | ||
selectedAccount, | ||
null, | ||
new String[] {GoogleAccountManager.ACCOUNT_TYPE}, | ||
true, | ||
|
@@ -253,9 +246,7 @@ public final Intent newChooseAccountIntent() { | |
/** | ||
* Returns an OAuth 2.0 access token. | ||
* | ||
* <p> | ||
* Must be run from a background thread, not the main UI thread. | ||
* </p> | ||
* <p>Must be run from a background thread, not the main UI thread. | ||
*/ | ||
public String getToken() throws IOException, GoogleAuthException { | ||
if (backOff != null) { | ||
|
@@ -278,12 +269,12 @@ public String getToken() throws IOException, GoogleAuthException { | |
} | ||
} | ||
|
||
|
||
@Beta | ||
class RequestHandler implements HttpExecuteInterceptor, HttpUnsuccessfulResponseHandler { | ||
|
||
/** Whether we've received a 401 error code indicating the token is invalid. */ | ||
boolean received401; | ||
|
||
String token; | ||
|
||
@Override | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.