Java Code Examples for android.accounts.AccountAuthenticatorResponse

The following are top voted examples for showing how to use android.accounts.AccountAuthenticatorResponse. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: LaravelNewsApp   File: Authenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle addAccount(
        AccountAuthenticatorResponse r,
        String s,
        String s2,
        String[] strings,
        Bundle bundle) throws NetworkErrorException {
    return null;
}
 
Example 2
Project: LaravelNewsApp   File: Authenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle confirmCredentials(
        AccountAuthenticatorResponse r,
        Account account,
        Bundle bundle) throws NetworkErrorException {
    return null;
}
 
Example 3
Project: LaravelNewsApp   File: Authenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle getAuthToken(
        AccountAuthenticatorResponse r,
        Account account,
        String s,
        Bundle bundle) throws NetworkErrorException {
    throw new UnsupportedOperationException();
}
 
Example 4
Project: LaravelNewsApp   File: Authenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle updateCredentials(
        AccountAuthenticatorResponse r,
        Account account,
        String s, Bundle bundle) throws NetworkErrorException {
    throw new UnsupportedOperationException();
}
 
Example 5
Project: FBEventSync   File: Authenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType,
                         String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException {
    final Intent intent = new Intent(mContext, AuthenticatorActivity.class);
    intent.setAction(Intent.ACTION_VIEW);
    intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, accountType);
    intent.putExtra(AuthenticatorActivity.ARG_AUTH_TOKEN_TYPE, authTokenType);
    intent.putExtra(AuthenticatorActivity.ARG_IS_ADDING_NEW_ACCOUNT, true);
    intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);

    final Bundle bundle = new Bundle();
    bundle.putParcelable(AccountManager.KEY_INTENT, intent);
    return bundle;
}
 
Example 6
Project: FBEventSync   File: Authenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account,
                          String[] features) throws NetworkErrorException {
    final Bundle result = new Bundle();
    result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, false);
    return result;
}
 
Example 7
Project: PeSanKita-android   File: AccountAuthenticatorService.java   View source code 5 votes vote down vote up
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType,
                         String[] requiredFeatures, Bundle options)
    throws NetworkErrorException
{
  return null;
}
 
Example 8
Project: EasyAppleSyncAdapter   File: ICalAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType,
                         String[] requiredFeatures, Bundle options) throws NetworkErrorException {
    final Intent intent = new Intent(context, loginActivity);
    intent.putExtra(GlobalConstant.ACCOUNT_TYPE, accountType);
    intent.putExtra(GlobalConstant.AUTH_TYPE, authTokenType);
    intent.putExtra(IS_ADDING_NEW_ACCOUNT, true);
    intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
    final Bundle bundle = new Bundle();
    bundle.putParcelable(AccountManager.KEY_INTENT, intent);
    return bundle;
}
 
Example 9
Project: Phony-Android   File: PhonyAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException {
    Log.d(TAG, "addAccount: called.");

    final Intent intent = new Intent(mContext, AuthenticatorActivity.class);
    intent.putExtra(AccountManager.KEY_ACCOUNT_TYPE, accountType);
    intent.putExtra(AuthenticatorActivity.ARG_IS_ADDING_NEW_ACCOUNT, true);
    intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);

    final Bundle bundle = new Bundle();
    bundle.putParcelable(AccountManager.KEY_INTENT, intent);
    return bundle;
}
 
Example 10
Project: react-native-sync-adapter   File: DummyAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle addAccount(
        AccountAuthenticatorResponse r,
        String s,
        String s2,
        String[] strings,
        Bundle bundle) throws NetworkErrorException {
    return null;
}
 
Example 11
Project: react-native-sync-adapter   File: DummyAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle confirmCredentials(
        AccountAuthenticatorResponse r,
        Account account,
        Bundle bundle) throws NetworkErrorException {
    return null;
}
 
Example 12
Project: react-native-sync-adapter   File: DummyAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle getAuthToken(
        AccountAuthenticatorResponse r,
        Account account,
        String s,
        Bundle bundle) throws NetworkErrorException {
    throw new UnsupportedOperationException();
}
 
Example 13
Project: Udacity_Sunshine   File: SunshineAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle addAccount(
        AccountAuthenticatorResponse r,
        String s,
        String s2,
        String[] strings,
        Bundle bundle) throws NetworkErrorException {
    return null;
}
 
Example 14
Project: Udacity_Sunshine   File: SunshineAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle confirmCredentials(
        AccountAuthenticatorResponse r,
        Account account,
        Bundle bundle) throws NetworkErrorException {
    return null;
}
 
Example 15
Project: FuelUp   File: Authenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle addAccount(
        AccountAuthenticatorResponse r,
        String s,
        String s2,
        String[] strings,
        Bundle bundle) throws NetworkErrorException {
    return null;
}
 
Example 16
Project: FuelUp   File: Authenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle confirmCredentials(
        AccountAuthenticatorResponse r,
        Account account,
        Bundle bundle) throws NetworkErrorException {
    return null;
}
 
Example 17
Project: FuelUp   File: Authenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle getAuthToken(
        AccountAuthenticatorResponse r,
        Account account,
        String s,
        Bundle bundle) throws NetworkErrorException {
    throw new UnsupportedOperationException();
}
 
Example 18
Project: EasyAppleSyncAdapter   File: ICalAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features)
        throws NetworkErrorException {
    final Bundle result = new Bundle();
    result.putBoolean(KEY_BOOLEAN_RESULT, false);
    return result;
}
 
Example 19
Project: EasyAppleSyncAdapter   File: ICalAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType,
                           Bundle options) throws NetworkErrorException {
    final AccountManager am = AccountManager.get(context);
    String authToken = am.peekAuthToken(account, authTokenType);

    // get new token if there is no one
    if (TextUtils.isEmpty(authToken)) {
        String password = am.getPassword(account);
        if (password != null) {
            try {
                password = Crypto.armorDecrypt(password, context);
                authToken = serverHandler.userSignIn(account.name, password);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    // there is new token, return it
    if (!TextUtils.isEmpty(authToken)) {
        final Bundle result = new Bundle();
        result.putString(AccountManager.KEY_ACCOUNT_NAME, account.name);
        result.putString(AccountManager.KEY_ACCOUNT_TYPE, account.type);
        result.putString(AccountManager.KEY_AUTHTOKEN, authToken);
        return result;
    }

    // no token and no password, show login screen
    final Intent intent = new Intent(context, loginActivity);
    intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
    intent.putExtra(GlobalConstant.ACCOUNT_TYPE, account.type);
    intent.putExtra(GlobalConstant.ACCOUNT_NAME, account.name);
    intent.putExtra(IS_ADDING_NEW_ACCOUNT, false);
    final Bundle bundle = new Bundle();
    bundle.putParcelable(AccountManager.KEY_INTENT, intent);
    return bundle;
}
 
Example 20
Project: ChatExchange-old   File: Authenticator.java   View source code 5 votes vote down vote up
/**
 * Return a bundle with the information necessary to create a new account
 */
private Bundle newAccount(AccountAuthenticatorResponse response)
{
    Intent intent = new Intent(mContext, AuthenticatorActivity.class);
    intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
    Bundle bundle = new Bundle();
    bundle.putParcelable(AccountManager.KEY_INTENT, intent);
    return bundle;
}
 
Example 21
Project: ChatExchange-old   File: Authenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) throws NetworkErrorException
{
    AccountManager accountManager = AccountManager.get(mContext);
    String authToken = accountManager.peekAuthToken(account, authTokenType);
    if (!authToken.isEmpty())
    {
        Bundle bundle = new Bundle();
        bundle.putString(AccountManager.KEY_ACCOUNT_NAME, account.name);
        bundle.putString(AccountManager.KEY_AUTHTOKEN, authToken);
        return bundle;
    }
    return newAccount(response);
}
 
Example 22
Project: Cable-Android   File: AccountAuthenticatorService.java   View source code 5 votes vote down vote up
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType,
                         String[] requiredFeatures, Bundle options)
    throws NetworkErrorException
{
  return null;
}
 
Example 23
Project: leoapp-sources   File: StubAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle confirmCredentials(
        AccountAuthenticatorResponse r,
        Account account,
        Bundle bundle) throws NetworkErrorException {
    return null;
}
 
Example 24
Project: leoapp-sources   File: StubAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle getAuthToken(
        AccountAuthenticatorResponse r,
        Account account,
        String s,
        Bundle bundle) throws NetworkErrorException {
    throw new UnsupportedOperationException();
}
 
Example 25
Project: leoapp-sources   File: StubAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle updateCredentials(
        AccountAuthenticatorResponse r,
        Account account,
        String s,
        Bundle bundle) throws NetworkErrorException {
    throw new UnsupportedOperationException();
}
 
Example 26
Project: TVGuide   File: TvGuideAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle confirmCredentials(
        AccountAuthenticatorResponse r,
        Account account,
        Bundle bundle) throws NetworkErrorException {
    return null;
}
 
Example 27
Project: TVGuide   File: TvGuideAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle getAuthToken(
        AccountAuthenticatorResponse r,
        Account account,
        String s,
        Bundle bundle) throws NetworkErrorException {
    throw new UnsupportedOperationException();
}
 
Example 28
Project: TVGuide   File: TvGuideAuthenticator.java   View source code 5 votes vote down vote up
@Override
public Bundle updateCredentials(
        AccountAuthenticatorResponse r,
        Account account,
        String s, Bundle bundle) throws NetworkErrorException {
    throw new UnsupportedOperationException();
}
 
Example 29
Project: LaravelNewsApp   File: Authenticator.java   View source code 4 votes vote down vote up
@Override
public Bundle editProperties(
        AccountAuthenticatorResponse r, String s) {
    throw new UnsupportedOperationException();
}
 
Example 30
Project: LaravelNewsApp   File: Authenticator.java   View source code 4 votes vote down vote up
@Override
public Bundle hasFeatures(
        AccountAuthenticatorResponse r,
        Account account, String[] strings) throws NetworkErrorException {
    throw new UnsupportedOperationException();
}
 
Example 31
Project: FBEventSync   File: Authenticator.java   View source code 4 votes vote down vote up
@Override
public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account,
                                 Bundle options) throws NetworkErrorException {
    Log.d(TAG, "Confirm credentials");
    return null;
}
 
Example 32
Project: simplest-sync-adapter   File: StubAuthenticator.java   View source code 4 votes vote down vote up
@Override
public Bundle editProperties(AccountAuthenticatorResponse accountAuthenticatorResponse,
                             String s) {
    throw new UnsupportedOperationException();
}
 
Example 33
Project: FBEventSync   File: Authenticator.java   View source code 4 votes vote down vote up
@Override
public Bundle editProperties(AccountAuthenticatorResponse response, String accountType) {
    Log.d(TAG, "Edit properties");
    return null;
}
 
Example 34
Project: PeSanKita-android   File: AccountAuthenticatorService.java   View source code 4 votes vote down vote up
public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) {
  return null;
}
 
Example 35
Project: simplest-sync-adapter   File: StubAuthenticator.java   View source code 4 votes vote down vote up
@Override
public Bundle confirmCredentials(AccountAuthenticatorResponse accountAuthenticatorResponse,
                                 Account account, Bundle bundle)
        throws NetworkErrorException {
    return null;
}
 
Example 36
Project: PeSanKita-android   File: AccountAuthenticatorService.java   View source code 4 votes vote down vote up
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features)
    throws NetworkErrorException {
  return null;
}
 
Example 37
Project: PeSanKita-android   File: AccountAuthenticatorService.java   View source code 4 votes vote down vote up
@Override
public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType,
                                Bundle options) {
  return null;
}
 
Example 38
Project: airgram   File: AuthenticatorService.java   View source code 4 votes vote down vote up
@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options)
        throws NetworkErrorException {
    return null;
}
 
Example 39
Project: airgram   File: AuthenticatorService.java   View source code 4 votes vote down vote up
@Override
public Bundle getAccountRemovalAllowed(AccountAuthenticatorResponse response, Account account) throws NetworkErrorException {
    return super.getAccountRemovalAllowed(response, account);
}
 
Example 40
Project: gigreminder   File: Authenticator.java   View source code 4 votes vote down vote up
@Override
public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account,
                          String[] features) throws NetworkErrorException {
    throw new UnsupportedOperationException();
}