Commit 0b32422b authored by Pâris MEULEMAN's avatar Pâris MEULEMAN Committed by Commit Bot

[Signin][Android] Rename OAuth2TokenService JNI method

This CL initially changed the JNI interface to its modern form.
https://crrev.com/c/1814696 was landed first, also containing this
change, so this one now renames simply renames oAuth2TokenFetched to
onOAuth2TokenFetched as discussed with Boris in the comments.

Bug: 934688
Change-Id: I90a8f19ef643f0a15f5d8140932be6f15d898636
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1760294
Commit-Queue: Pâris Meuleman <pmeuleman@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Reviewed-by: default avatarSylvain Defresne <sdefresne@chromium.org>
Auto-Submit: Pâris Meuleman <pmeuleman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701085}
parent bd145026
......@@ -135,21 +135,21 @@ public final class OAuth2TokenService
String username, String scope, final long nativeCallback) {
Account account = getAccountOrNullFromUsername(username);
if (account == null) {
ThreadUtils.postOnUiThread(()
-> OAuth2TokenServiceJni.get().oAuth2TokenFetched(
null, false, nativeCallback));
ThreadUtils.postOnUiThread(() -> {
OAuth2TokenServiceJni.get().onOAuth2TokenFetched(null, false, nativeCallback);
});
return;
}
String oauth2Scope = OAUTH2_SCOPE_PREFIX + scope;
getAccessToken(account, oauth2Scope, new GetAccessTokenCallback() {
@Override
public void onGetTokenSuccess(String token) {
OAuth2TokenServiceJni.get().oAuth2TokenFetched(token, false, nativeCallback);
OAuth2TokenServiceJni.get().onOAuth2TokenFetched(token, false, nativeCallback);
}
@Override
public void onGetTokenFailure(boolean isTransientError) {
OAuth2TokenServiceJni.get().oAuth2TokenFetched(
OAuth2TokenServiceJni.get().onOAuth2TokenFetched(
null, isTransientError, nativeCallback);
}
});
......@@ -398,7 +398,8 @@ public final class OAuth2TokenService
@NativeMethods
interface Natives {
void oAuth2TokenFetched(String authToken, boolean isTransientError, long nativeCallback);
void onOAuth2TokenFetched(
String authToken, boolean isTransientError, long nativeCallback);
void updateAccountList(long nativeOAuth2TokenServiceDelegateAndroid,
OAuth2TokenService caller, String currentlySignedInAccount);
}
......
......@@ -488,7 +488,7 @@ CoreAccountId OAuth2TokenServiceDelegateAndroid::MapAccountNameToAccountId(
// Called from Java when fetching of an OAuth2 token is finished. The
// |authToken| param is only valid when |result| is true.
void JNI_OAuth2TokenService_OAuth2TokenFetched(
void JNI_OAuth2TokenService_OnOAuth2TokenFetched(
JNIEnv* env,
const JavaParamRef<jstring>& authToken,
jboolean isTransientError,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment