]> cvs.zerfleddert.de Git - ms2-fixes/blame_incremental - MS2Debounce/src/de/rmdir/ms2debounce/DebounceBootService.java
improve error message when module-loading fails
[ms2-fixes] / MS2Debounce / src / de / rmdir / ms2debounce / DebounceBootService.java
... / ...
CommitLineData
1package de.rmdir.ms2debounce;
2
3import android.app.Service;
4import android.content.Intent;
5import android.content.Context;
6import android.os.IBinder;
7import android.os.AsyncTask;
8import android.util.Log;
9
10public class DebounceBootService extends Service
11{
12 private static final String TAG = "DebounceBootService";
13
14 public IBinder onBind(Intent intent)
15 {
16 return null;
17 }
18
19 @Override
20 public void onCreate()
21 {
22 Log.i(TAG, "Starting AsyncTask");
23 new AsyncTask<DebounceBootService, Void, Void>() {
24 @Override
25 protected Void doInBackground(DebounceBootService... svc) {
26 Context context = getApplicationContext();
27 DebounceModuleHelper module = new DebounceModuleHelper(context);
28
29 Log.i(TAG, "Loading Module");
30
31 try {
32 module.loadModule();
33 } catch (Exception e) {
34 Log.e(TAG, "Got Exception: " + e.getMessage() + " (" + e.getCause() + ")");
35 }
36
37 svc[0].stopSelf();
38
39 return null;
40 }
41 }.execute(this);
42 }
43
44 @Override
45 public int onStartCommand(Intent intent, int flags, int startId)
46 {
47 Log.i(TAG, "Creating STICKY service");
48 return START_STICKY;
49 }
50
51 @Override
52 public void onDestroy()
53 {
54 Log.i(TAG, "Destroying service");
55 }
56}
Impressum, Datenschutz