diff options
author | 2023-08-25 13:45:39 -0700 | |
---|---|---|
committer | 2023-08-25 13:45:39 -0700 | |
commit | 1b988a4ee33de9cab9740ddc1ee70b1734c8e622 (patch) | |
tree | c4240b01ae5e973213d6532885fcc00fac6f9e0b /services/inputflinger/InputThread.cpp | |
parent | 13da0f9a0f2d5fcb70418fcdceb0d184313d7f48 (diff) | |
parent | b7bc7af7daca55a85bcc993c45c9be354d48f89a (diff) |
Merge Android U (ab/10368041)
Bug: 291102124
Merged-In: I9b175092d433fc6d7b22b437a09d76d3d2e0ce14
Change-Id: If8a2897a99b111ba107f33c19537d40bcbdc802e
Diffstat (limited to 'services/inputflinger/InputThread.cpp')
-rw-r--r-- | services/inputflinger/InputThread.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/services/inputflinger/InputThread.cpp b/services/inputflinger/InputThread.cpp index b87f7a1243..e74f258168 100644 --- a/services/inputflinger/InputThread.cpp +++ b/services/inputflinger/InputThread.cpp @@ -41,7 +41,7 @@ private: InputThread::InputThread(std::string name, std::function<void()> loop, std::function<void()> wake) : mName(name), mThreadWake(wake) { - mThread = new InputThreadImpl(loop); + mThread = sp<InputThreadImpl>::make(loop); mThread->run(mName.c_str(), ANDROID_PRIORITY_URGENT_DISPLAY); } @@ -54,7 +54,13 @@ InputThread::~InputThread() { } bool InputThread::isCallingThread() { +#if defined(__ANDROID__) return gettid() == mThread->getTid(); +#else + // Assume that the caller is doing everything correctly, + // since thread information is not available on host + return false; +#endif } } // namespace android
\ No newline at end of file |