projects
/
ms2-fixes
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6c3dd4b
)
make helper non-static
author
Michael Gernoth
<michael@gernoth.net>
Fri, 20 May 2011 19:25:44 +0000
(21:25 +0200)
committer
Michael Gernoth
<michael@gernoth.net>
Fri, 20 May 2011 19:25:44 +0000
(21:25 +0200)
MS2Debounce/res/layout/main.xml
patch
|
blob
|
blame
|
history
MS2Debounce/src/de/rmdir/ms2debounce/DebounceBootReceiver.java
patch
|
blob
|
blame
|
history
MS2Debounce/src/de/rmdir/ms2debounce/DebounceModuleHelper.java
patch
|
blob
|
blame
|
history
MS2Debounce/src/de/rmdir/ms2debounce/MS2Debounce.java
patch
|
blob
|
blame
|
history
diff --git
a/MS2Debounce/res/layout/main.xml
b/MS2Debounce/res/layout/main.xml
index 0a850ba5466a2a6fe480dfa6de8389fd30a05627..8fc51942b7bb62550da4e454523a67cb4c0ca7f7 100644
(file)
--- a/
MS2Debounce/res/layout/main.xml
+++ b/
MS2Debounce/res/layout/main.xml
@@
-7,7
+7,7
@@
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:text="
Hello World, MS2Debounce
"
+ android:text="
You will soon be able to set the debounce_delay here.
"
/>
</LinearLayout>
/>
</LinearLayout>
diff --git
a/MS2Debounce/src/de/rmdir/ms2debounce/DebounceBootReceiver.java
b/MS2Debounce/src/de/rmdir/ms2debounce/DebounceBootReceiver.java
index 3ab003d12999029efdf7189cdd7a9633c60eac25..de10592968112629aea666270927ea7c83f32074 100644
(file)
--- a/
MS2Debounce/src/de/rmdir/ms2debounce/DebounceBootReceiver.java
+++ b/
MS2Debounce/src/de/rmdir/ms2debounce/DebounceBootReceiver.java
@@
-8,7
+8,9
@@
public class DebounceBootReceiver extends BroadcastReceiver{
@Override
public void onReceive(Context context, Intent intent) {
if("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
@Override
public void onReceive(Context context, Intent intent) {
if("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
- DebounceModuleHelper.loadModule();
+ DebounceModuleHelper module = new DebounceModuleHelper(context.getFilesDir());
+
+ module.loadModule();
}
}
}
}
}
}
diff --git
a/MS2Debounce/src/de/rmdir/ms2debounce/DebounceModuleHelper.java
b/MS2Debounce/src/de/rmdir/ms2debounce/DebounceModuleHelper.java
index f4569a58b44cd9295a38e9eb4d18463b8104c76d..fe9ffa80d06a972c7a5548ec4bbb81a48ce1c96f 100644
(file)
--- a/
MS2Debounce/src/de/rmdir/ms2debounce/DebounceModuleHelper.java
+++ b/
MS2Debounce/src/de/rmdir/ms2debounce/DebounceModuleHelper.java
@@
-1,15
+1,33
@@
package de.rmdir.ms2debounce;
package de.rmdir.ms2debounce;
+import java.io.File;
+
public class DebounceModuleHelper
{
public class DebounceModuleHelper
{
- static public void loadModule() {
+ private File filesdir;
+
+ public DebounceModuleHelper(File appdir) {
+ filesdir = appdir;
+ }
+
+ public void loadModule() {
+ extractModule();
+
try {
Process insmod = Runtime.getRuntime().exec(new String[]{"su","-c","/system/bin/insmod /system/lib/modules/debounce.ko"});
insmod.waitFor();
} catch (Exception e) {}
}
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() {
+ public boolean isLoaded() {
return false;
}
return false;
}
+
+ private void extractModule() {
+ File debounce_ko = new File(filesdir + "/debounce.ko");
+
+ if (debounce_ko.exists()) {
+ return;
+ }
+ }
}
}
diff --git
a/MS2Debounce/src/de/rmdir/ms2debounce/MS2Debounce.java
b/MS2Debounce/src/de/rmdir/ms2debounce/MS2Debounce.java
index 85ec653a1b0960501cf27684fcd7a45d43680384..3f7814edd339c3ccd264cc80c01d2e71db4f31d9 100644
(file)
--- a/
MS2Debounce/src/de/rmdir/ms2debounce/MS2Debounce.java
+++ b/
MS2Debounce/src/de/rmdir/ms2debounce/MS2Debounce.java
@@
-6,16
+6,17
@@
import android.content.Intent;
public class MS2Debounce extends Activity
{
public class MS2Debounce extends Activity
{
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
- if (!DebounceModuleHelper.isLoaded()) {
- DebounceModuleHelper.loadModule();
- }
+ DebounceModuleHelper module = new DebounceModuleHelper(getFilesDir());
+
+ if (!module.isLoaded()) {
+ module.loadModule();
+ }
- setContentView(R.layout.main);
- }
+
setContentView(R.layout.main);
+
}
}
}
Impressum
,
Datenschutz