本文整理匯總了Java中com.google.android.gms.auth.GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE屬性的典型用法代碼示例。如果您正苦於以下問題:Java GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE屬性的具體用法?Java GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE怎麽用?Java GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.google.android.gms.auth.GoogleAuthUtil
的用法示例。
在下文中一共展示了GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE屬性的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onAuthSuccess
/**
* Called when authentication succeeds. This may either happen because the user just
* authenticated for the first time (and went through the sign in flow), or because it's
* a returning user.
*
* @param accountName name of the account that just authenticated successfully.
* @param newlyAuthenticated If true, this user just authenticated for the first time.
* If false, it's a returning user.
*/
@Override
public void onAuthSuccess(String accountName, boolean newlyAuthenticated) {
Account account = new Account(accountName, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
LOGD(TAG, "onAuthSuccess, account " + accountName + ", newlyAuthenticated="
+ newlyAuthenticated);
refreshAccountDependantData();
if (newlyAuthenticated) {
LOGD(TAG, "Enabling auto sync on content provider for account " + accountName);
SyncHelper.updateSyncInterval(this, account);
SyncHelper.requestManualSync(account);
}
setupAccountBox();
populateNavDrawer();
registerGCMClient();
}
示例2: getAccountType
/**
* Get the account type associated with the install location of the app
*
* @return the account type
*/
public static String getAccountType() {
if (DEBUG) {
MyLog.i(CLS_NAME, "getAccountType");
}
switch (Global.installLocation) {
case PLAYSTORE:
if (DEBUG) {
MyLog.i(CLS_NAME, "getAccountType PLAYSTORE");
}
return GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE;
case AMAZON:
if (DEBUG) {
MyLog.i(CLS_NAME, "getAccountType AMAZON");
}
return "";
default:
return "";
}
}
示例3: onAuthSuccess
/**
* Called when authentication succeeds. This may either happen because the user just
* authenticated for the first time (and went through the sign in flow), or because it's
* a returning user.
* @param accountName name of the account that just authenticated successfully.
* @param newlyAuthenticated If true, this user just authenticated for the first time.
* If false, it's a returning user.
*/
@Override
public void onAuthSuccess(String accountName, boolean newlyAuthenticated) {
Account account = new Account(accountName, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
LogUtils.LOGD(TAG, "onAuthSuccess, account " + accountName + ", newlyAuthenticated=" + newlyAuthenticated);
refreshAccountDependantData();
if (newlyAuthenticated) {
LogUtils.LOGD(TAG, "Enabling auto sync on content provider for account " + accountName);
SyncHelper.updateSyncInterval(this, account);
SyncHelper.requestManualSync(account);
}
setupAccountBox();
populateNavDrawer();
registerGCMClient();
}
示例4: onAuthSuccess
/**
* Called when authentication succeeds. This may either happen because the user just
* authenticated for the first time (and went through the sign in flow), or because it's
* a returning user.
* @param accountName name of the account that just authenticated successfully.
* @param newlyAuthenticated If true, this user just authenticated for the first time.
* If false, it's a returning user.
*/
@Override
public void onAuthSuccess(String accountName, boolean newlyAuthenticated) {
Account account = new Account(accountName, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
LOGD(TAG, "onAuthSuccess, account " + accountName + ", newlyAuthenticated=" + newlyAuthenticated);
refreshAccountDependantData();
if (newlyAuthenticated) {
LOGD(TAG, "Enabling auto sync on content provider for account " + accountName);
SyncHelper.updateSyncInterval(this, account);
SyncHelper.requestManualSync(account);
}
setupAccountBox();
populateNavDrawer();
registerGCMClient();
}
示例5: getToken
protected void getToken() throws OperationCanceledException,
AuthenticatorException, IOException {
// activity.token = null;
Account account = new Account(toDoFragment.userName,
GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
AccountManagerFuture<Bundle> accountManagerFuture = AccountManager.get(
toDoFragment.getActivity()).getAuthToken(account,
"oauth2:" + TasksScopes.TASKS, null,
toDoFragment.getActivity(), null, null);
toDoFragment.token = accountManagerFuture.getResult().getString(
AccountManager.KEY_AUTHTOKEN);
// Users user = activity.userDataSource.selectUser(activity.userName);
// user.setPwd(activity.token);
if (toDoFragment.token != null && !toDoFragment.token.isEmpty()) {
// activity.userDataSource.updateUsers(user);
toDoFragment.credential = (new GoogleCredential())
.setAccessToken(toDoFragment.token);
}
}
示例6: signin
@Kroll.method
public void signin(KrollDict props)
{
if (props.containsKey("success")) {
successCallback = (KrollFunction) props.get("success");
}
if (props.containsKey("error")) {
errorCallback = (KrollFunction) props.get("error");
}
String[] accountTypes = new String[] { GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE };
Intent intent = AccountPicker.newChooseAccountIntent(null, null,
accountTypes, false, null, null, null, null);
Activity activity = TiApplication.getAppCurrentActivity();
TiActivitySupport support = (TiActivitySupport) activity;
requestCode = support.getUniqueResultCode();
support.launchActivityForResult(intent, requestCode, this);
}
示例7: getActiveAccount
/**
* Return the {@code Account} the app is using as the active Google Account.
*
* @param context Context used to lookup {@link SharedPreferences} the value is stored with.
*/
public static Account getActiveAccount(final Context context) {
String account = getActiveAccountName(context);
if (account != null) {
return new Account(account, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
} else {
return null;
}
}
示例8: getActiveAccount
public static Account getActiveAccount(final Context context) {
String account = getActiveAccountName(context);
if (account != null) {
return new Account(account, GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE);
} else {
return null;
}
}
示例9: pickUserAccount
private void pickUserAccount() {
String[] accountTypes = new String[]{GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE};
Intent intent = AccountPicker.newChooseAccountIntent(null, null,
accountTypes, false, null, null, null, null);
startActivityForResult(intent, REQUEST_CODE_PICK_ACCOUNT);
}
示例10: getAccountType
/**
* @return
*/
protected String getAccountType() {
return GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE;
}