import java.io.InputStream;
import java.io.OutputStream;
import java.io.File;
+import java.io.FileReader;
+import java.io.BufferedReader;
import android.content.Context;
}
public boolean isLoaded() {
- return false;
+ boolean loaded = false;
+ try {
+ String read;
+
+ FileReader modules = new FileReader("/proc/modules");
+ BufferedReader modules_buf = new BufferedReader(modules);
+
+ while((read = modules_buf.readLine()) != null) {
+ if (read.regionMatches(0, "debounce", 0, 8)) {
+ loaded = true;
+ }
+ }
+
+ } catch (Exception e) {
+ loaded = false;
+ }
+
+ return loaded;
}
public int getDelay() {
- return 10;
+ int debounce_delay = -1;
+
+ try {
+ String read;
+
+ FileReader delay = new FileReader("/sys/module/debounce/parameters/debounce_delay");
+ BufferedReader delay_buf = new BufferedReader(delay);
+
+ read = delay_buf.readLine();
+ if (read != null) {
+ debounce_delay = Integer.parseInt(read.trim());
+ }
+ } catch (Exception e) {}
+
+ return debounce_delay;
}
private synchronized void extractModule() {