<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.rmdir.ms2debounce"
- android:versionCode="7"
- android:versionName="1.7">
+ android:versionCode="8"
+ android:versionName="1.8">
<uses-sdk android:minSdkVersion="8" />
<uses-configuration android:reqKeyboardType="qwerty" />
<supports-screens android:smallScreens="false"
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
+ <service
+ android:name=".DebounceBootService"
+ android.label="DebounceBootService">
+ </service>
</application>
</manifest>
--- /dev/null
+package de.rmdir.ms2debounce;
+
+import android.app.Service;
+import android.content.Intent;
+import android.content.Context;
+import android.os.IBinder;
+import android.os.AsyncTask;
+import android.util.Log;
+
+public class DebounceBootService extends Service
+{
+ private static final String TAG = "DebounceBootService";
+
+ public IBinder onBind(Intent intent)
+ {
+ return null;
+ }
+
+ @Override
+ public void onCreate()
+ {
+ Log.i(TAG, "Starting AsyncTask");
+ new AsyncTask<DebounceBootService, Void, Void>() {
+ @Override
+ protected Void doInBackground(DebounceBootService... svc) {
+ Context context = getApplicationContext();
+ DebounceModuleHelper module = new DebounceModuleHelper(context);
+
+ Log.i(TAG, "Loading Module");
+
+ try {
+ module.loadModule();
+ } catch (Exception e) {
+ Log.e(TAG, "Got Exception: " + e.getMessage() + " (" + e.getCause() + ")");
+ }
+
+ svc[0].stopSelf();
+
+ return null;
+ }
+ }.execute(this);
+ }
+
+ @Override
+ public int onStartCommand(Intent intent, int flags, int startId)
+ {
+ Log.i(TAG, "Creating STICKY service");
+ return START_STICKY;
+ }
+
+ @Override
+ public void onDestroy()
+ {
+ Log.i(TAG, "Destroying service");
+ }
+}