OSDN Git Service

Wificond ScannerImpl Unit testing Offload HAL
[android-x86/system-connectivity-wificond.git] / looper_backed_event_loop.cpp
index 6ab6fe6..b4f5c44 100644 (file)
@@ -114,12 +114,23 @@ bool LooperBackedEventLoop::WatchFileDescriptor(
   return true;
 }
 
+bool LooperBackedEventLoop::StopWatchFileDescriptor(int fd) {
+  if (looper_->removeFd(fd) == 1) {
+    return true;
+  }
+  return false;
+}
+
 void LooperBackedEventLoop::Poll() {
   while (should_continue_) {
     looper_->pollOnce(-1);
   }
 }
 
+void LooperBackedEventLoop::PollForOne(int timeout_millis) {
+  looper_->pollOnce(timeout_millis);
+}
+
 void LooperBackedEventLoop::TriggerExit() {
   PostTask([this](){ should_continue_ = false; });
 }