2 * Copyright (C) 2015 The Android Open Source Project
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
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
;
29 * A generic stub account authenticator service often used for sync adapters that do not directly
34 public class AuthenticatorService
extends Service
{
35 private static Authenticator mAuthenticator
;
38 public void onCreate() {
39 mAuthenticator
= new Authenticator(this);
43 public IBinder
onBind(Intent intent
) {
44 return mAuthenticator
.getIBinder();
48 * Stub account authenticator. All methods either return null or throw an exception.
50 public class Authenticator
extends AbstractAccountAuthenticator
{
51 public Authenticator(Context context
) {
56 public Bundle
editProperties(AccountAuthenticatorResponse accountAuthenticatorResponse
,
58 throw new UnsupportedOperationException();
62 public Bundle
addAccount(AccountAuthenticatorResponse accountAuthenticatorResponse
,
63 String s
, String s2
, String
[] strings
, Bundle bundle
)
64 throws NetworkErrorException
{
69 public Bundle
confirmCredentials(AccountAuthenticatorResponse accountAuthenticatorResponse
,
70 Account account
, Bundle bundle
)
71 throws NetworkErrorException
{
76 public Bundle
getAuthToken(AccountAuthenticatorResponse accountAuthenticatorResponse
,
77 Account account
, String s
, Bundle bundle
)
78 throws NetworkErrorException
{
79 throw new UnsupportedOperationException();
83 public String
getAuthTokenLabel(String s
) {
84 throw new UnsupportedOperationException();
88 public Bundle
updateCredentials(AccountAuthenticatorResponse accountAuthenticatorResponse
,
89 Account account
, String s
, Bundle bundle
)
90 throws NetworkErrorException
{
91 throw new UnsupportedOperationException();
95 public Bundle
hasFeatures(AccountAuthenticatorResponse accountAuthenticatorResponse
,
96 Account account
, String
[] strings
)
97 throws NetworkErrorException
{
98 throw new UnsupportedOperationException();