Merge branch 'root' of github.com:limelight-stream/limelight-android into root

This commit is contained in:
Cameron Gutman 2014-09-17 19:31:07 -07:00
commit 9d4ca6293f
2 changed files with 12 additions and 2 deletions

View File

@ -10,6 +10,7 @@ public class EvdevHandler {
private String absolutePath;
private EvdevListener listener;
private boolean shutdown = false;
private int fd = -1;
private Thread handlerThread = new Thread() {
@Override
@ -19,7 +20,7 @@ public class EvdevHandler {
// system-wide input problems.
// Open the /dev/input/eventX file
int fd = EvdevReader.open(absolutePath);
fd = EvdevReader.open(absolutePath);
if (fd == -1) {
LimeLog.warning("Unable to open "+absolutePath);
return;
@ -130,7 +131,6 @@ public class EvdevHandler {
}
} finally {
// Close the file
LimeLog.warning("Evdev handler is terminating for: "+absolutePath);
EvdevReader.close(fd);
}
}
@ -146,6 +146,13 @@ public class EvdevHandler {
}
public void stop() {
// Close the fd. It doesn't matter if this races
// with the handler thread. We'll close this out from
// under the thread to wake it up
if (fd != -1) {
EvdevReader.close(fd);
}
shutdown = true;
handlerThread.interrupt();

View File

@ -67,6 +67,9 @@ public class EvdevWatcher {
// Rundown existing files
File devInputDir = new File(PATH);
File[] files = devInputDir.listFiles();
if (files == null) {
return new File[0];
}
// Set desired permissions
String[] filePaths = new String[files.length];