@@ -954,7 +954,6 @@ InputDispatcher::InputDispatcher(InputDispatcherPolicyInterface& policy,
954954 mDispatchEnabled(false ),
955955 mDispatchFrozen(false ),
956956 mInputFilterEnabled(false ),
957- mMaximumObscuringOpacityForTouch(1 .0f ),
958957 mFocusedDisplayId(ui::LogicalDisplayId::DEFAULT),
959958 mWindowTokenWithPointerCapture(nullptr ),
960959 mAwaitedApplicationDisplayId(ui::LogicalDisplayId::INVALID),
@@ -3161,8 +3160,8 @@ InputDispatcher::DispatcherWindowInfo::computeTouchOcclusionInfo(
31613160 return info;
31623161}
31633162
3164- bool InputDispatcher::isTouchTrustedLocked (
3165- const DispatcherWindowInfo:: TouchOcclusionInfo& occlusionInfo) const {
3163+ bool InputDispatcher::DispatcherWindowInfo::isTouchTrusted (
3164+ const TouchOcclusionInfo& occlusionInfo) const {
31663165 if (occlusionInfo.hasBlockingOcclusion ) {
31673166 ALOGW (" Untrusted touch due to occlusion by %s/%s" , occlusionInfo.obscuringPackage .c_str (),
31683167 occlusionInfo.obscuringUid .toString ().c_str ());
@@ -5268,8 +5267,9 @@ std::string InputDispatcher::DispatcherWindowInfo::dumpDisplayAndWindowInfo() co
52685267 return dump;
52695268}
52705269
5271- bool InputDispatcher::canWindowReceiveMotionLocked (const sp<WindowInfoHandle>& window,
5272- const MotionEntry& motionEntry) const {
5270+ bool InputDispatcher::canWindowReceiveMotionLocked (
5271+ const sp<android::gui::WindowInfoHandle>& window,
5272+ const android::inputdispatcher::MotionEntry& motionEntry) const {
52735273 const WindowInfo& info = *window->getInfo ();
52745274
52755275 // Skip spy window targets that are not valid for targeted injection.
@@ -5304,7 +5304,7 @@ bool InputDispatcher::canWindowReceiveMotionLocked(const sp<WindowInfoHandle>& w
53045304 const auto [x, y] = resolveTouchedPosition (motionEntry);
53055305 DispatcherWindowInfo::TouchOcclusionInfo occlusionInfo =
53065306 mWindowInfos .computeTouchOcclusionInfo (window, x, y);
5307- if (!isTouchTrustedLocked (occlusionInfo)) {
5307+ if (!mWindowInfos . isTouchTrusted (occlusionInfo)) {
53085308 if (DEBUG_TOUCH_OCCLUSION) {
53095309 ALOGD (" Stack of obscuring windows during untrusted touch (%.1f, %.1f):" , x, y);
53105310 for (const auto & log : occlusionInfo.debugInfo ) {
@@ -5748,13 +5748,8 @@ bool InputDispatcher::recentWindowsAreOwnedByLocked(gui::Pid pid, gui::Uid uid)
57485748}
57495749
57505750void InputDispatcher::setMaximumObscuringOpacityForTouch (float opacity) {
5751- if (opacity < 0 || opacity > 1 ) {
5752- LOG_ALWAYS_FATAL (" Maximum obscuring opacity for touch should be >= 0 and <= 1" );
5753- return ;
5754- }
5755-
57565751 std::scoped_lock lock (mLock );
5757- mMaximumObscuringOpacityForTouch = opacity;
5752+ mWindowInfos . setMaximumObscuringOpacityForTouch ( opacity) ;
57585753}
57595754
57605755std::tuple<const TouchState*, const TouchedWindow*, ui::LogicalDisplayId>
@@ -7354,4 +7349,11 @@ std::string InputDispatcher::ConnectionManager::dump(nsecs_t currentTime) const
73547349 return dump;
73557350}
73567351
7352+ void InputDispatcher::DispatcherWindowInfo::setMaximumObscuringOpacityForTouch (float opacity) {
7353+ if (opacity < 0 || opacity > 1 ) {
7354+ LOG_ALWAYS_FATAL (" Maximum obscuring opacity for touch should be >= 0 and <= 1" );
7355+ }
7356+ mMaximumObscuringOpacityForTouch = opacity;
7357+ }
7358+
73577359} // namespace android::inputdispatcher
0 commit comments