Skip to content

Commit 4c6f9c3

Browse files
committed
Mark all pareters as final in AccountAuthenticator
1 parent 09c4274 commit 4c6f9c3

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

app/src/main/java/com/github/mobile/accounts/AccountAuthenticator.java

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,15 @@ public Bundle addAccount(final AccountAuthenticatorResponse response,
7878
}
7979

8080
@Override
81-
public Bundle confirmCredentials(AccountAuthenticatorResponse response,
82-
Account account, Bundle options) {
81+
public Bundle confirmCredentials(
82+
final AccountAuthenticatorResponse response, final Account account,
83+
final Bundle options) {
8384
return null;
8485
}
8586

8687
@Override
87-
public Bundle editProperties(AccountAuthenticatorResponse response,
88-
String accountType) {
88+
public Bundle editProperties(final AccountAuthenticatorResponse response,
89+
final String accountType) {
8990
return null;
9091
}
9192

@@ -107,7 +108,7 @@ private boolean isValidAuthorization(final Authorization auth,
107108
return scopes.containsAll(requiredScopes);
108109
}
109110

110-
private Intent createLoginIntent(AccountAuthenticatorResponse response) {
111+
private Intent createLoginIntent(final AccountAuthenticatorResponse response) {
111112
final Intent intent = new Intent(context, LoginActivity.class);
112113
intent.putExtra(PARAM_AUTHTOKEN_TYPE, ACCOUNT_TYPE);
113114
intent.putExtra(KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
@@ -122,8 +123,8 @@ private Intent createLoginIntent(AccountAuthenticatorResponse response) {
122123
* @return token or null if none found
123124
* @throws IOException
124125
*/
125-
private String getAuthorization(OAuthService service, List<String> scopes)
126-
throws IOException {
126+
private String getAuthorization(final OAuthService service,
127+
final List<String> scopes) throws IOException {
127128
for (Authorization auth : service.getAuthorizations())
128129
if (isValidAuthorization(auth, scopes))
129130
return auth.getToken();
@@ -138,8 +139,8 @@ private String getAuthorization(OAuthService service, List<String> scopes)
138139
* @return created token
139140
* @throws IOException
140141
*/
141-
private String createAuthorization(OAuthService service, List<String> scopes)
142-
throws IOException {
142+
private String createAuthorization(final OAuthService service,
143+
final List<String> scopes) throws IOException {
143144
Authorization auth = new Authorization();
144145
auth.setNote(APP_NOTE);
145146
auth.setNoteUrl(APP_NOTE_URL);
@@ -149,9 +150,9 @@ private String createAuthorization(OAuthService service, List<String> scopes)
149150
}
150151

151152
@Override
152-
public Bundle getAuthToken(AccountAuthenticatorResponse response,
153-
Account account, String authTokenType, Bundle options)
154-
throws NetworkErrorException {
153+
public Bundle getAuthToken(final AccountAuthenticatorResponse response,
154+
final Account account, final String authTokenType,
155+
final Bundle options) throws NetworkErrorException {
155156
Log.d(TAG, "Retrieving OAuth2 token");
156157

157158
final Bundle bundle = new Bundle();
@@ -193,24 +194,26 @@ public Bundle getAuthToken(AccountAuthenticatorResponse response,
193194
}
194195

195196
@Override
196-
public String getAuthTokenLabel(String authTokenType) {
197+
public String getAuthTokenLabel(final String authTokenType) {
197198
if (ACCOUNT_TYPE.equals(authTokenType))
198199
return authTokenType;
199200
else
200201
return null;
201202
}
202203

203204
@Override
204-
public Bundle hasFeatures(AccountAuthenticatorResponse response,
205-
Account account, String[] features) throws NetworkErrorException {
205+
public Bundle hasFeatures(final AccountAuthenticatorResponse response,
206+
final Account account, final String[] features)
207+
throws NetworkErrorException {
206208
final Bundle result = new Bundle();
207209
result.putBoolean(KEY_BOOLEAN_RESULT, false);
208210
return result;
209211
}
210212

211213
@Override
212-
public Bundle updateCredentials(AccountAuthenticatorResponse response,
213-
Account account, String authTokenType, Bundle options) {
214+
public Bundle updateCredentials(
215+
final AccountAuthenticatorResponse response, final Account account,
216+
final String authTokenType, final Bundle options) {
214217
final Intent intent = new Intent(context, LoginActivity.class);
215218
intent.putExtra(PARAM_AUTHTOKEN_TYPE, authTokenType);
216219
intent.putExtra(KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);

0 commit comments

Comments
 (0)