@@ -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),
@@ -3164,8 +3163,8 @@ InputDispatcher::DispatcherWindowInfo::computeTouchOcclusionInfo(
31643163 return info;
31653164}
31663165
3167- bool InputDispatcher::isTouchTrustedLocked (
3168- const DispatcherWindowInfo:: TouchOcclusionInfo& occlusionInfo) const {
3166+ bool InputDispatcher::DispatcherWindowInfo::isTouchTrusted (
3167+ const TouchOcclusionInfo& occlusionInfo) const {
31693168 if (occlusionInfo.hasBlockingOcclusion ) {
31703169 ALOGW (" Untrusted touch due to occlusion by %s/%s" , occlusionInfo.obscuringPackage .c_str (),
31713170 occlusionInfo.obscuringUid .toString ().c_str ());
@@ -5271,8 +5270,9 @@ std::string InputDispatcher::DispatcherWindowInfo::dumpDisplayAndWindowInfo() co
52715270 return dump;
52725271}
52735272
5274- bool InputDispatcher::canWindowReceiveMotionLocked (const sp<WindowInfoHandle>& window,
5275- const MotionEntry& motionEntry) const {
5273+ bool InputDispatcher::canWindowReceiveMotionLocked (
5274+ const sp<android::gui::WindowInfoHandle>& window,
5275+ const android::inputdispatcher::MotionEntry& motionEntry) const {
52765276 const WindowInfo& info = *window->getInfo ();
52775277
52785278 // Skip spy window targets that are not valid for targeted injection.
@@ -5307,7 +5307,7 @@ bool InputDispatcher::canWindowReceiveMotionLocked(const sp<WindowInfoHandle>& w
53075307 const auto [x, y] = resolveTouchedPosition (motionEntry);
53085308 DispatcherWindowInfo::TouchOcclusionInfo occlusionInfo =
53095309 mWindowInfos .computeTouchOcclusionInfo (window, x, y);
5310- if (!isTouchTrustedLocked (occlusionInfo)) {
5310+ if (!mWindowInfos . isTouchTrusted (occlusionInfo)) {
53115311 if (DEBUG_TOUCH_OCCLUSION) {
53125312 ALOGD (" Stack of obscuring windows during untrusted touch (%.1f, %.1f):" , x, y);
53135313 for (const auto & log : occlusionInfo.debugInfo ) {
@@ -5751,13 +5751,8 @@ bool InputDispatcher::recentWindowsAreOwnedByLocked(gui::Pid pid, gui::Uid uid)
57515751}
57525752
57535753void InputDispatcher::setMaximumObscuringOpacityForTouch (float opacity) {
5754- if (opacity < 0 || opacity > 1 ) {
5755- LOG_ALWAYS_FATAL (" Maximum obscuring opacity for touch should be >= 0 and <= 1" );
5756- return ;
5757- }
5758-
57595754 std::scoped_lock lock (mLock );
5760- mMaximumObscuringOpacityForTouch = opacity;
5755+ mWindowInfos . setMaximumObscuringOpacityForTouch ( opacity) ;
57615756}
57625757
57635758std::tuple<const TouchState*, const TouchedWindow*, ui::LogicalDisplayId>
@@ -7362,4 +7357,11 @@ std::string InputDispatcher::ConnectionManager::dump(nsecs_t currentTime) const
73627357 return dump;
73637358}
73647359
7360+ void InputDispatcher::DispatcherWindowInfo::setMaximumObscuringOpacityForTouch (float opacity) {
7361+ if (opacity < 0 || opacity > 1 ) {
7362+ LOG_ALWAYS_FATAL (" Maximum obscuring opacity for touch should be >= 0 and <= 1" );
7363+ }
7364+ mMaximumObscuringOpacityForTouch = opacity;
7365+ }
7366+
73657367} // namespace android::inputdispatcher
0 commit comments