| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.telecom; |
| 18 |
import android.accounts.AbstractAccountAuthenticator; |
| 19 |
import android.accounts.Account; |
| 20 |
import android.accounts.AccountAuthenticatorResponse; |
| 21 |
import android.accounts.NetworkErrorException; |
| 22 |
import android.app.Service; |
| 23 |
import android.content.Context; |
| 24 |
import android.content.Intent; |
| 25 |
import android.os.Bundle; |
| 26 |
import android.os.IBinder; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
public class AuthenticatorService extends Service { |
| 35 |
private static Authenticator mAuthenticator; |
| 36 |
|
| 37 |
@Override |
| 38 |
public void onCreate() { |
| 39 |
mAuthenticator = new Authenticator(this); |
| 40 |
} |
| 41 |
|
| 42 |
@Override |
| 43 |
public IBinder onBind(Intent intent) { |
| 44 |
return mAuthenticator.getIBinder(); |
| 45 |
} |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
public class Authenticator extends AbstractAccountAuthenticator { |
| 51 |
public Authenticator(Context context) { |
| 52 |
super(context); |
| 53 |
} |
| 54 |
|
| 55 |
@Override |
| 56 |
public Bundle editProperties(AccountAuthenticatorResponse accountAuthenticatorResponse, |
| 57 |
String s) { |
| 58 |
throw new UnsupportedOperationException(); |
| 59 |
} |
| 60 |
|
| 61 |
@Override |
| 62 |
public Bundle addAccount(AccountAuthenticatorResponse accountAuthenticatorResponse, |
| 63 |
String s, String s2, String[] strings, Bundle bundle) |
| 64 |
throws NetworkErrorException { |
| 65 |
return null; |
| 66 |
} |
| 67 |
|
| 68 |
@Override |
| 69 |
public Bundle confirmCredentials(AccountAuthenticatorResponse accountAuthenticatorResponse, |
| 70 |
Account account, Bundle bundle) |
| 71 |
throws NetworkErrorException { |
| 72 |
return null; |
| 73 |
} |
| 74 |
|
| 75 |
@Override |
| 76 |
public Bundle getAuthToken(AccountAuthenticatorResponse accountAuthenticatorResponse, |
| 77 |
Account account, String s, Bundle bundle) |
| 78 |
throws NetworkErrorException { |
| 79 |
throw new UnsupportedOperationException(); |
| 80 |
} |
| 81 |
|
| 82 |
@Override |
| 83 |
public String getAuthTokenLabel(String s) { |
| 84 |
throw new UnsupportedOperationException(); |
| 85 |
} |
| 86 |
|
| 87 |
@Override |
| 88 |
public Bundle updateCredentials(AccountAuthenticatorResponse accountAuthenticatorResponse, |
| 89 |
Account account, String s, Bundle bundle) |
| 90 |
throws NetworkErrorException { |
| 91 |
throw new UnsupportedOperationException(); |
| 92 |
} |
| 93 |
|
| 94 |
@Override |
| 95 |
public Bundle hasFeatures(AccountAuthenticatorResponse accountAuthenticatorResponse, |
| 96 |
Account account, String[] strings) |
| 97 |
throws NetworkErrorException { |
| 98 |
throw new UnsupportedOperationException(); |
| 99 |
} |
| 100 |
} |
| 101 |
} |