Move to Android N-MR1 SDK.
[android_tools.git] / sdk / sources / android-25 / android / telecom / AuthenticatorService.java
blob1e43c71575802afac4550ffb55d7b26ad98f77e2
1 /*
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;
28 /**
29 * A generic stub account authenticator service often used for sync adapters that do not directly
30 * involve accounts.
32 * @hide
34 public class AuthenticatorService extends Service {
35 private static Authenticator mAuthenticator;
37 @Override
38 public void onCreate() {
39 mAuthenticator = new Authenticator(this);
42 @Override
43 public IBinder onBind(Intent intent) {
44 return mAuthenticator.getIBinder();
47 /**
48 * Stub account authenticator. All methods either return null or throw an exception.
50 public class Authenticator extends AbstractAccountAuthenticator {
51 public Authenticator(Context context) {
52 super(context);
55 @Override
56 public Bundle editProperties(AccountAuthenticatorResponse accountAuthenticatorResponse,
57 String s) {
58 throw new UnsupportedOperationException();
61 @Override
62 public Bundle addAccount(AccountAuthenticatorResponse accountAuthenticatorResponse,
63 String s, String s2, String[] strings, Bundle bundle)
64 throws NetworkErrorException {
65 return null;
68 @Override
69 public Bundle confirmCredentials(AccountAuthenticatorResponse accountAuthenticatorResponse,
70 Account account, Bundle bundle)
71 throws NetworkErrorException {
72 return null;
75 @Override
76 public Bundle getAuthToken(AccountAuthenticatorResponse accountAuthenticatorResponse,
77 Account account, String s, Bundle bundle)
78 throws NetworkErrorException {
79 throw new UnsupportedOperationException();
82 @Override
83 public String getAuthTokenLabel(String s) {
84 throw new UnsupportedOperationException();
87 @Override
88 public Bundle updateCredentials(AccountAuthenticatorResponse accountAuthenticatorResponse,
89 Account account, String s, Bundle bundle)
90 throws NetworkErrorException {
91 throw new UnsupportedOperationException();
94 @Override
95 public Bundle hasFeatures(AccountAuthenticatorResponse accountAuthenticatorResponse,
96 Account account, String[] strings)
97 throws NetworkErrorException {
98 throw new UnsupportedOperationException();