From edac95e737d65466d52e77be5ebef7e378f756ef Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Mon, 31 Jul 2017 20:33:41 -0700 Subject: DO NOT MERGE Remove window obscurement information. If ACTION_OUTSIDE_EVENTS contain information about whether the touch is obscured, then a pattern of invisible, untouchable, unfocusable SYSTEM_ALERT_WINDOWS can be placed across the screen to determine approximate locations of touch events without the user knowing. Bug: 31097064 Test: cts-tradefed run cts --class android.security.cts.MotionEventTest Change-Id: Ie30dcc2402d5422a19a43ffe7d1411d91681efc2 --- services/inputflinger/InputDispatcher.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/services/inputflinger/InputDispatcher.cpp b/services/inputflinger/InputDispatcher.cpp index c9e876fd29..ec3ec7bde3 100644 --- a/services/inputflinger/InputDispatcher.cpp +++ b/services/inputflinger/InputDispatcher.cpp @@ -1222,15 +1222,8 @@ int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime, if (maskedAction == AMOTION_EVENT_ACTION_DOWN && (flags & InputWindowInfo::FLAG_WATCH_OUTSIDE_TOUCH)) { - int32_t outsideTargetFlags = InputTarget::FLAG_DISPATCH_AS_OUTSIDE; - if (isWindowObscuredAtPointLocked(windowHandle, x, y)) { - outsideTargetFlags |= InputTarget::FLAG_WINDOW_IS_OBSCURED; - } else if (isWindowObscuredLocked(windowHandle)) { - outsideTargetFlags |= InputTarget::FLAG_WINDOW_IS_PARTIALLY_OBSCURED; - } - mTempTouchState.addOrUpdateWindow( - windowHandle, outsideTargetFlags, BitSet32(0)); + windowHandle, InputTarget::FLAG_DISPATCH_AS_OUTSIDE, BitSet32(0)); } } } -- cgit v1.2.3 From 5508ca2c191f8fdf29d8898890a58bf1a3a225b3 Mon Sep 17 00:00:00 2001 From: Siarhei Vishniakou Date: Fri, 4 Aug 2017 12:37:47 -0700 Subject: DO NOT MERGE Remove window obscurement information. If ACTION_OUTSIDE_EVENTS contain information about whether the touch is obscured, then a pattern of invisible, untouchable, unfocusable SYSTEM_ALERT_WINDOWS can be placed across the screen to determine approximate locations of touch events without the user knowing. Bug: 31097064 Test: cts-tradefed run cts --class android.security.cts.MotionEventTest Change-Id: Iebbb68231cbb76f87241201e7640a1fe3e188625 --- services/inputflinger/InputDispatcher.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/services/inputflinger/InputDispatcher.cpp b/services/inputflinger/InputDispatcher.cpp index 3f69d49f0b..e48c53a08e 100644 --- a/services/inputflinger/InputDispatcher.cpp +++ b/services/inputflinger/InputDispatcher.cpp @@ -1224,15 +1224,8 @@ int32_t InputDispatcher::findTouchedWindowTargetsLocked(nsecs_t currentTime, if (maskedAction == AMOTION_EVENT_ACTION_DOWN && (flags & InputWindowInfo::FLAG_WATCH_OUTSIDE_TOUCH)) { - int32_t outsideTargetFlags = InputTarget::FLAG_DISPATCH_AS_OUTSIDE; - if (isWindowObscuredAtPointLocked(windowHandle, x, y)) { - outsideTargetFlags |= InputTarget::FLAG_WINDOW_IS_OBSCURED; - } else if (isWindowObscuredLocked(windowHandle)) { - outsideTargetFlags |= InputTarget::FLAG_WINDOW_IS_PARTIALLY_OBSCURED; - } - mTempTouchState.addOrUpdateWindow( - windowHandle, outsideTargetFlags, BitSet32(0)); + windowHandle, InputTarget::FLAG_DISPATCH_AS_OUTSIDE, BitSet32(0)); } } } -- cgit v1.2.3 From 2924d01304dba0b714c556b14e45e34f70472e96 Mon Sep 17 00:00:00 2001 From: Thierry Strudel Date: Mon, 14 Aug 2017 15:19:37 -0700 Subject: Revert "Postpone color mode change until after boot animation" This reverts commit c53d3558d55dfd1d1c424b0d632fea693113e83e. To have better control on when the color shift is happening, the bootloader asset will be aligned with the Android OS applied saturation. So apply the color setting as soon as SF is up. Bug: 63520186 Bug: 63823274 Test: Verify that sRGB is applied at the start of boot animation Change-Id: I611eb61266c909fde50e7ea2b4c1314541228736 --- services/surfaceflinger/SurfaceFlinger.cpp | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 2703db8e93..8ed6686ebf 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -377,20 +377,10 @@ void SurfaceFlinger::bootFinished() LOG_EVENT_LONG(LOGTAG_SF_STOP_BOOTANIM, ns2ms(systemTime(SYSTEM_TIME_MONOTONIC))); - sp bootFinished = new LambdaMessage([&]() { - mBootFinished = true; - + sp readProperties = new LambdaMessage([&]() { readPersistentProperties(); - -#ifdef USE_HWC2 - sp hw(getDisplayDevice(mBuiltinDisplays[DisplayDevice::DISPLAY_PRIMARY])); - if (hw->getWideColorSupport()) { - hw->setCompositionDataSpace(HAL_DATASPACE_V0_SRGB); - setActiveColorModeInternal(hw, HAL_COLOR_MODE_SRGB); - } -#endif }); - postMessageAsync(bootFinished); + postMessageAsync(readProperties); } void SurfaceFlinger::deleteTextureAsync(uint32_t texture) { @@ -555,7 +545,7 @@ void SurfaceFlinger::init() { ALOGI( "SurfaceFlinger's main thread ready to run. " "Initializing graphics H/W..."); - ALOGI("Phase offset NS: %" PRId64 "", vsyncPhaseOffsetNs); + ALOGI("Phase offest NS: %" PRId64 "", vsyncPhaseOffsetNs); { // Autolock scope Mutex::Autolock _l(mStateLock); @@ -1224,7 +1214,11 @@ void SurfaceFlinger::createDefaultDisplayDevice() { token, fbs, producer, mRenderEngine->getEGLConfig(), hasWideColorModes && hasWideColorDisplay); mDisplays.add(token, hw); - setActiveColorModeInternal(hw, HAL_COLOR_MODE_NATIVE); + android_color_mode defaultColorMode = HAL_COLOR_MODE_NATIVE; + if (hasWideColorModes && hasWideColorDisplay) { + defaultColorMode = HAL_COLOR_MODE_SRGB; + } + setActiveColorModeInternal(hw, defaultColorMode); hw->setCompositionDataSpace(HAL_DATASPACE_UNKNOWN); } @@ -1870,12 +1864,7 @@ void SurfaceFlinger::setUpHWComposer() { } newColorMode = pickColorMode(newDataSpace); - // We want the color mode of the boot animation to match that of the bootloader - // To achieve this we suppress color mode changes until after the boot animation - if (mBootFinished) { - setActiveColorModeInternal(displayDevice, newColorMode); - displayDevice->setCompositionDataSpace(newDataSpace); - } + setActiveColorModeInternal(displayDevice, newColorMode); } } -- cgit v1.2.3