I am trying to monitor the "/sys/class/udc" folder by using FileObserver
. My app is a system-priv app, so there should not be a permission issue. I am unable to detect the change event.
String path = "/sys/class/udc";
static final int mask = (
FileObserver.CREATE |
FileObserver.DELETE |
FileObserver.DELETE_SELF |
FileObserver.MODIFY |
FileObserver.MOVED_FROM |
FileObserver.MOVED_TO |
FileObserver.MOVE_SELF
);
public UsbCableDisconncetEvent(String path) {
super(path, mask);
Log.d(TAG, "DisconnectEventHandler modified");
}
public void onEvent(int event, String path) {
Log.d(TAG, "recieved moified event " + event);
}
Does FileObserver
support the monitoring of "/sys/class" files?