blob: a4d13f242077a447478b4cea5cdfa1d1ce733534 [file] [log] [blame]
Santos Cordon00d7a432013-09-17 14:07:14 -07001/*
2 * Copyright (C) 2013 The Android Open Source Project
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17package com.android.phone;
18
19import android.app.Service;
20import android.content.Intent;
21import android.os.IBinder;
22import android.util.Log;
23
24/**
25 * Service for performing HfaActivation without any UI.
26 */
27public class HfaService extends Service {
28 private static final String TAG = HfaService.class.getSimpleName();
29
30 @Override
31 public void onCreate() {
32 new HfaLogic(this, new HfaLogic.HfaLogicCallback() {
33 @Override
34 public void onSuccess() {
35 Log.i(TAG, "onSuccess");
36 onComplete();
37 }
38
39 @Override
40 public void onError(String msg) {
41 Log.i(TAG, "onError: " + msg);
42 // We do not respond from this service. On success or failure
43 // we do the same thing...finish.
44 onComplete();
45 }
46 }).start();
47
48 Log.i(TAG, "service started");
49 }
50
51 @Override
52 public IBinder onBind(Intent intent) {
53 return null;
54 }
55
56 private void onComplete() {
57 stopSelf();
58 }
59}