Added Commons AccountManager (Authentication Provider!)

Also updated version of java-mwapi to support cookie based auth
This commit is contained in:
YuviPanda 2012-10-15 00:41:14 +05:30
parent d59b1700c8
commit 802e6aa9ed
8 changed files with 227 additions and 38 deletions

View file

@ -0,0 +1,23 @@
package org.wikimedia.commons.auth;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
public class WikiAccountAuthenticatorService extends Service{
private static WikiAccountAuthenticator wikiAccountAuthenticator = null;
@Override
public IBinder onBind(Intent intent) {
if (!intent.getAction().equals(android.accounts.AccountManager.ACTION_AUTHENTICATOR_INTENT)) {
return null;
}
if(wikiAccountAuthenticator == null) {
wikiAccountAuthenticator = new WikiAccountAuthenticator(this);
}
return wikiAccountAuthenticator.getIBinder();
}
}