michael@0: /** michael@0: * Copyright (c) 2012-2013, Gerald Garcia michael@0: * michael@0: * This file is part of Andoid Caldav Sync Adapter Free. michael@0: * michael@0: * Andoid Caldav Sync Adapter Free is free software: you can redistribute michael@0: * it and/or modify it under the terms of the GNU General Public License michael@0: * as published by the Free Software Foundation, either version 3 of the michael@0: * License, or at your option any later version. michael@0: * michael@0: * Andoid Caldav Sync Adapter Free is distributed in the hope that michael@0: * it will be useful, but WITHOUT ANY WARRANTY; without even the implied michael@0: * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the michael@0: * GNU General Public License for more details. michael@0: * michael@0: * You should have received a copy of the GNU General Public License michael@0: * along with Andoid Caldav Sync Adapter Free. michael@0: * If not, see . michael@0: * michael@0: */ michael@0: michael@0: package org.gege.caldavsyncadapter.authenticator; michael@0: michael@0: michael@0: michael@0: import android.accounts.AbstractAccountAuthenticator; michael@0: import android.accounts.Account; michael@0: import android.accounts.AccountAuthenticatorResponse; michael@0: import android.accounts.AccountManager; michael@0: import android.accounts.NetworkErrorException; michael@0: import android.content.Context; michael@0: import android.content.Intent; michael@0: import android.os.Bundle; michael@0: import android.util.Log; michael@0: michael@0: public class Authenticator extends AbstractAccountAuthenticator { michael@0: michael@0: private static final String TAG = "Authenticator"; michael@0: private Context mContext; michael@0: michael@0: public Authenticator(Context context) { michael@0: super(context); michael@0: michael@0: mContext = context; michael@0: } michael@0: michael@0: @Override michael@0: public Bundle addAccount(AccountAuthenticatorResponse response, michael@0: String accountType, String authTokenType, michael@0: String[] requiredFeatures, Bundle options) michael@0: throws NetworkErrorException { michael@0: michael@0: michael@0: Log.v(TAG, "addAccount()"); michael@0: michael@0: final Intent intent = new Intent(mContext, AuthenticatorActivity.class); michael@0: intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response); michael@0: final Bundle bundle = new Bundle(); michael@0: bundle.putParcelable(AccountManager.KEY_INTENT, intent); michael@0: return bundle; michael@0: michael@0: } michael@0: michael@0: @Override michael@0: public Bundle confirmCredentials(AccountAuthenticatorResponse response, michael@0: Account account, Bundle options) throws NetworkErrorException { michael@0: // TODO Auto-generated method stub michael@0: return null; michael@0: } michael@0: michael@0: @Override michael@0: public Bundle editProperties(AccountAuthenticatorResponse response, michael@0: String accountType) { michael@0: // TODO Auto-generated method stub michael@0: return null; michael@0: } michael@0: michael@0: @Override michael@0: public Bundle getAuthToken(AccountAuthenticatorResponse response, michael@0: Account account, String authTokenType, Bundle options) michael@0: throws NetworkErrorException { michael@0: // TODO Auto-generated method stub michael@0: return null; michael@0: } michael@0: michael@0: @Override michael@0: public String getAuthTokenLabel(String authTokenType) { michael@0: // TODO Auto-generated method stub michael@0: return null; michael@0: } michael@0: michael@0: @Override michael@0: public Bundle hasFeatures(AccountAuthenticatorResponse response, michael@0: Account account, String[] features) throws NetworkErrorException { michael@0: // TODO Auto-generated method stub michael@0: return null; michael@0: } michael@0: michael@0: @Override michael@0: public Bundle updateCredentials(AccountAuthenticatorResponse response, michael@0: Account account, String authTokenType, Bundle options) michael@0: throws NetworkErrorException { michael@0: // TODO Auto-generated method stub michael@0: return null; michael@0: } michael@0: michael@0: }