runAsRoot(insmod + " " + debounce_ko);
+ int cnt = 10;
+ while ((!isLoaded()) && (cnt > 0)) {
+ try {
+ Thread.sleep(100);
+ } catch (Exception e) {
+ return false;
+ }
+ cnt--;
+ }
+
if (!isLoaded()) {
return false;
}
public synchronized boolean isLoaded() {
boolean loaded = false;
+
try {
String read;
while((read = modules_buf.readLine()) != null) {
if (read.regionMatches(0, "debounce", 0, 8)) {
- loaded = true;
+ File sysdir = new File("/sys/devices/debounce");
+ if (sysdir.exists() && sysdir.isDirectory()) {
+ loaded = true;
+ break;
+ }
}
}
-
} catch (Exception e) {
loaded = false;
}