.debounce.o.cmd
.tmp_versions/
Module.symvers
-debounce.ko
+./debounce.ko
debounce.mod.c
debounce.mod.o
debounce.o
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
- <service android:name=".DebounceService"/>
<receiver android:name=".DebounceBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
@Override
public void onReceive(Context context, Intent intent) {
if("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
- Intent debouncesvc = new Intent(context, DebounceService.class);
- context.startService(debouncesvc);
+ DebounceModuleHelper.loadModule();
}
}
}
--- /dev/null
+package de.rmdir.ms2debounce;
+
+public class DebounceModuleHelper
+{
+ static public void loadModule() {
+ try {
+ Process insmod = Runtime.getRuntime().exec(new String[]{"su","-c","/system/bin/insmod /system/lib/modules/debounce.ko"});
+ insmod.waitFor();
+ } catch (Exception e) {}
+ }
+
+ static public boolean isLoaded() {
+ return false;
+ }
+}
+++ /dev/null
-package de.rmdir.ms2debounce;
-
-import android.content.Intent;
-import android.app.IntentService;
-
-public class DebounceService extends IntentService {
-
- // Create worker thread
- public DebounceService() {
- super("DebounceService");
- }
-
- @Override
- protected void onHandleIntent(Intent intent) {
- }
-
- @Override
- public void onCreate() {
- try {
- Process insmod = Runtime.getRuntime().exec(new String[]{"su","-c","/system/bin/insmod /system/lib/modules/debounce.ko"});
- insmod.waitFor();
- } catch (Exception e) {}
- super.onCreate();
- }
-}
{
super.onCreate(savedInstanceState);
- Intent debouncesvc = new Intent(this, DebounceService.class);
- startService(debouncesvc);
+ if (!DebounceModuleHelper.isLoaded()) {
+ DebounceModuleHelper.loadModule();
+ }
setContentView(R.layout.main);
}