void cleanupInput() { if(inputfd != -1) { suinput_close(inputfd); } }
void closeInputWithoutRevertPermission(){ LOGD(LOGTAG, "Closing input device..."); if(inputFd==-1){ if(suinput_close(inputFd)==-1){ LOGD(LOGTAG, "Error closing input device.."); } LOGI(LOGTAG, "Device closed."); }else{ LOGI(LOGTAG, "Nothing to close."); } }
void closeInput(){ LOGD(LOGTAG, "Closing input device..."); if(inputFd!=-1){ if(suinput_close(inputFd)==-1){ LOGD(LOGTAG, "Error closing input device.."); } LOGI(LOGTAG, "Device closed."); system("su -c \"chmod 660 /dev/uinput\""); inputFd = -1; }else{ LOGI(LOGTAG, "Nothing to close. (Device has not opened)"); } }
static void uSynergyDisconnectDevice(uSynergyCookie cookie) { suinput_close(cookie->uinput_mouse); suinput_close(cookie->uinput_keyboard); }