diff options
Diffstat (limited to 'services/incremental/ServiceWrappers.cpp')
-rw-r--r-- | services/incremental/ServiceWrappers.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/services/incremental/ServiceWrappers.cpp b/services/incremental/ServiceWrappers.cpp index 85f744152ea4..08fb486c8058 100644 --- a/services/incremental/ServiceWrappers.cpp +++ b/services/incremental/ServiceWrappers.cpp @@ -113,6 +113,23 @@ private: JavaVM* const mJvm; }; +class RealLooperWrapper final : public LooperWrapper { +public: + int addFd(int fd, int ident, int events, android::Looper_callbackFunc callback, + void* data) final { + return mLooper.addFd(fd, ident, events, callback, data); + } + int removeFd(int fd) final { return mLooper.removeFd(fd); } + void wake() final { return mLooper.wake(); } + int pollAll(int timeoutMillis) final { return mLooper.pollAll(timeoutMillis); } + +private: + struct Looper : public android::Looper { + Looper() : android::Looper(/*allowNonCallbacks=*/false) {} + ~Looper() {} + } mLooper; +}; + class RealIncFs : public IncFsWrapper { public: RealIncFs() = default; @@ -203,6 +220,10 @@ std::unique_ptr<JniWrapper> RealServiceManager::getJni() { return std::make_unique<RealJniWrapper>(mJvm); } +std::unique_ptr<LooperWrapper> RealServiceManager::getLooper() { + return std::make_unique<RealLooperWrapper>(); +} + static JavaVM* getJavaVm(JNIEnv* env) { CHECK(env); JavaVM* jvm = nullptr; |