1 package de
.rmdir
.ms2debounce
;
3 import android
.app
.Service
;
4 import android
.content
.Intent
;
5 import android
.content
.Context
;
6 import android
.os
.IBinder
;
7 import android
.os
.AsyncTask
;
8 import android
.util
.Log
;
10 public class DebounceBootService
extends Service
12 private static final String TAG
= "DebounceBootService";
14 public IBinder
onBind(Intent intent
)
20 public void onCreate()
22 Log
.i(TAG
, "Starting AsyncTask");
23 new AsyncTask
<DebounceBootService
, Void
, Void
>() {
25 protected Void
doInBackground(DebounceBootService
... svc
) {
26 Context context
= getApplicationContext();
27 DebounceModuleHelper module
= new DebounceModuleHelper(context
);
29 Log
.i(TAG
, "Loading Module");
33 } catch (Exception e
) {
34 Log
.e(TAG
, "Got Exception: " + e
.getMessage() + " (" + e
.getCause() + ")");
45 public int onStartCommand(Intent intent
, int flags
, int startId
)
47 Log
.i(TAG
, "Creating STICKY service");
52 public void onDestroy()
54 Log
.i(TAG
, "Destroying service");