X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/ms2-fixes/blobdiff_plain/f297054c1bfe38a7b55ed9becce37144e7b070ca..f2b5155d2d9182c8f84d481ca73702b0b6d9c3d9:/MS2Debounce/src/de/rmdir/ms2debounce/DebounceModuleHelper.java diff --git a/MS2Debounce/src/de/rmdir/ms2debounce/DebounceModuleHelper.java b/MS2Debounce/src/de/rmdir/ms2debounce/DebounceModuleHelper.java index 2b088d7..56698dc 100644 --- a/MS2Debounce/src/de/rmdir/ms2debounce/DebounceModuleHelper.java +++ b/MS2Debounce/src/de/rmdir/ms2debounce/DebounceModuleHelper.java @@ -82,10 +82,18 @@ public class DebounceModuleHelper } public synchronized boolean _loadModule() throws NotRootedException,ShellException { + Log.i(TAG, "Loading module"); + + if (isLoaded()) { + Log.i(TAG, "Module already loaded"); + return true; + } + File insmod = new File("/system/bin/insmod"); if (!insmod.exists()) { insmod = new File("/system/xbin/insmod"); if (!insmod.exists()) { + Log.e(TAG, "insmod not found"); return false; } } @@ -111,12 +119,14 @@ public class DebounceModuleHelper try { Thread.sleep(100); } catch (Exception e) { + Log.e(TAG, "Got Exception: " + e.getMessage() + " (" + e.getCause() + ")"); return false; } cnt--; } if (!isLoaded()) { + Log.e(TAG, "Module doesn't appear to be correctly loaded"); return false; } @@ -128,15 +138,24 @@ public class DebounceModuleHelper editor.putBoolean("safe_to_load", true); editor.commit(); + Log.i(TAG, "Module loaded successfully"); return true; } public synchronized void unloadModule() throws NotRootedException,ShellException { + Log.i(TAG, "Unloading module"); + + if (!isLoaded()) { + Log.i(TAG, "Module not loaded"); + return; + } + File rmmod = new File("/system/bin/rmmod"); if (!rmmod.exists()) { rmmod = new File("/system/xbin/rmmod"); if (!rmmod.exists()) { + Log.e(TAG, "rmmod not found"); return; } }