/* ownCloud Android client application\r
* Copyright (C) 2012 Bartek Przybylski\r
+ * Copyright (C) 2012-2013 ownCloud Inc.\r
*\r
* This program is free software: you can redistribute it and/or modify\r
* it under the terms of the GNU General Public License as published by\r
- * the Free Software Foundation, either version 3 of the License, or\r
+ * the Free Software Foundation, either version 2 of the License, or\r
* (at your option) any later version.\r
*\r
* This program is distributed in the hope that it will be useful,\r
intent.putExtra(KEY_AUTH_TOKEN_TYPE, authTokenType);\r
intent.putExtra(KEY_REQUIRED_FEATURES, requiredFeatures);\r
intent.putExtra(KEY_LOGIN_OPTIONS, options);\r
+ intent.putExtra(AuthenticatorActivity.EXTRA_ACTION, AuthenticatorActivity.ACTION_CREATE);\r
\r
setIntentFlags(intent);\r
\r
return result;\r
}\r
\r
- /// if not stored, return Intent to access the AuthenticatorActivity\r
+ /// if not stored, return Intent to access the AuthenticatorActivity and UPDATE the token for the account\r
final Intent intent = new Intent(mContext, AuthenticatorActivity.class);\r
intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);\r
intent.putExtra(KEY_AUTH_TOKEN_TYPE, authTokenType);\r
intent.putExtra(KEY_LOGIN_OPTIONS, options);\r
intent.putExtra(AuthenticatorActivity.EXTRA_ACCOUNT, account);\r
+ intent.putExtra(AuthenticatorActivity.EXTRA_ACTION, AuthenticatorActivity.ACTION_UPDATE_TOKEN);\r
+ \r
\r
final Bundle bundle = new Bundle();\r
bundle.putParcelable(AccountManager.KEY_INTENT, intent);\r
public Bundle hasFeatures(AccountAuthenticatorResponse response,\r
Account account, String[] features) throws NetworkErrorException {\r
final Bundle result = new Bundle();\r
- result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, false);\r
+ result.putBoolean(AccountManager.KEY_BOOLEAN_RESULT, true);\r
return result;\r
}\r
\r
\r
private void setIntentFlags(Intent intent) {\r
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r
- intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);\r
- intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); // incompatible with the authorization code grant in OAuth\r
+ //intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);\r
+ //intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); // incompatible with the authorization code grant in OAuth\r
intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);\r
intent.addFlags(Intent.FLAG_FROM_BACKGROUND);\r
}\r