1273399bf829133a8385332ad43add3c34c889102Chiao Cheng/*
2273399bf829133a8385332ad43add3c34c889102Chiao Cheng * Copyright (C) 2011 The Android Open Source Project
3273399bf829133a8385332ad43add3c34c889102Chiao Cheng *
4273399bf829133a8385332ad43add3c34c889102Chiao Cheng * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5273399bf829133a8385332ad43add3c34c889102Chiao Cheng * use this file except in compliance with the License. You may obtain a copy of
6273399bf829133a8385332ad43add3c34c889102Chiao Cheng * the License at
7273399bf829133a8385332ad43add3c34c889102Chiao Cheng *
8273399bf829133a8385332ad43add3c34c889102Chiao Cheng * http://www.apache.org/licenses/LICENSE-2.0
9273399bf829133a8385332ad43add3c34c889102Chiao Cheng *
10273399bf829133a8385332ad43add3c34c889102Chiao Cheng * Unless required by applicable law or agreed to in writing, software
11273399bf829133a8385332ad43add3c34c889102Chiao Cheng * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12273399bf829133a8385332ad43add3c34c889102Chiao Cheng * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13273399bf829133a8385332ad43add3c34c889102Chiao Cheng * License for the specific language governing permissions and limitations under
14273399bf829133a8385332ad43add3c34c889102Chiao Cheng * the License.
15273399bf829133a8385332ad43add3c34c889102Chiao Cheng */
16273399bf829133a8385332ad43add3c34c889102Chiao Cheng
17273399bf829133a8385332ad43add3c34c889102Chiao Chengpackage com.android.contacts.common.tests.testauth;
18273399bf829133a8385332ad43add3c34c889102Chiao Cheng
19273399bf829133a8385332ad43add3c34c889102Chiao Chengimport android.app.Service;
20273399bf829133a8385332ad43add3c34c889102Chiao Chengimport android.content.Intent;
21273399bf829133a8385332ad43add3c34c889102Chiao Chengimport android.os.IBinder;
22273399bf829133a8385332ad43add3c34c889102Chiao Chengimport android.util.Log;
23273399bf829133a8385332ad43add3c34c889102Chiao Cheng
24273399bf829133a8385332ad43add3c34c889102Chiao Chengpublic abstract class TestAuthenticationService extends Service {
25273399bf829133a8385332ad43add3c34c889102Chiao Cheng
26273399bf829133a8385332ad43add3c34c889102Chiao Cheng    private TestAuthenticator mAuthenticator;
27273399bf829133a8385332ad43add3c34c889102Chiao Cheng
28273399bf829133a8385332ad43add3c34c889102Chiao Cheng    @Override
29273399bf829133a8385332ad43add3c34c889102Chiao Cheng    public void onCreate() {
30273399bf829133a8385332ad43add3c34c889102Chiao Cheng        Log.v(TestauthConstants.LOG_TAG, this + " Service started.");
31273399bf829133a8385332ad43add3c34c889102Chiao Cheng        mAuthenticator = new TestAuthenticator(this);
32273399bf829133a8385332ad43add3c34c889102Chiao Cheng    }
33273399bf829133a8385332ad43add3c34c889102Chiao Cheng
34273399bf829133a8385332ad43add3c34c889102Chiao Cheng    @Override
35273399bf829133a8385332ad43add3c34c889102Chiao Cheng    public void onDestroy() {
36273399bf829133a8385332ad43add3c34c889102Chiao Cheng        Log.v(TestauthConstants.LOG_TAG, this + " Service stopped.");
37273399bf829133a8385332ad43add3c34c889102Chiao Cheng    }
38273399bf829133a8385332ad43add3c34c889102Chiao Cheng
39273399bf829133a8385332ad43add3c34c889102Chiao Cheng    @Override
40273399bf829133a8385332ad43add3c34c889102Chiao Cheng    public IBinder onBind(Intent intent) {
41273399bf829133a8385332ad43add3c34c889102Chiao Cheng        Log.v(TestauthConstants.LOG_TAG, this + " getBinder() intent=" + intent);
42273399bf829133a8385332ad43add3c34c889102Chiao Cheng        return mAuthenticator.getIBinder();
43273399bf829133a8385332ad43add3c34c889102Chiao Cheng    }
44273399bf829133a8385332ad43add3c34c889102Chiao Cheng
45273399bf829133a8385332ad43add3c34c889102Chiao Cheng    public static class Basic extends TestAuthenticationService {
46273399bf829133a8385332ad43add3c34c889102Chiao Cheng    }
47273399bf829133a8385332ad43add3c34c889102Chiao Cheng}
48