From 169df252e64b10e132510542875394d7901123df Mon Sep 17 00:00:00 2001 From: Joseph Werle Date: Tue, 31 Oct 2023 14:08:45 -0400 Subject: [PATCH] refactor(src/core/fs.cc): guard 'FileSystemWatcher' from android --- src/core/fs.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/core/fs.cc b/src/core/fs.cc index 5eceac8178..3edda1ef4c 100644 --- a/src/core/fs.cc +++ b/src/core/fs.cc @@ -1059,6 +1059,17 @@ namespace SSC { Module::Callback cb ) { this->core->dispatchEventLoop([=, this]() { + #if defined(__ANDROID__) + auto json = JSON::Object::Entries { + {"source", "fs.watch"}, + {"err", JSON::Object::Entries { + {"message", "Not supported"} + }} + }; + + cb(seq, json, Post{}); + return; + #else FileSystemWatcher* watcher; { Lock lock(this->mutex); @@ -1120,6 +1131,7 @@ namespace SSC { }; cb(seq, json, Post{}); + #endif }); } @@ -1248,6 +1260,17 @@ namespace SSC { Module::Callback cb ) { this->core->dispatchEventLoop([=, this]() { + #if defined(__ANDROID__) + auto json = JSON::Object::Entries { + {"source", "fs.stopWatch"}, + {"err", JSON::Object::Entries { + {"message", "Not supported"} + }} + }; + + cb(seq, json, Post{}); + return; + #else auto watcher = this->core->fs.watchers[id]; if (watcher != nullptr) { watcher->stop(); @@ -1271,6 +1294,7 @@ namespace SSC { cb(seq, json, Post{}); } + #endif }); }