Loading cmds/dumpstate/dumpstate.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ void add_mountinfo(); #define OTA_METADATA_DIR "/metadata/ota" #define SNAPSHOTCTL_LOG_DIR "/data/misc/snapshotctl_log" #define LINKERCONFIG_DIR "/linkerconfig" #define PACKAGE_DEX_USE_LIST "/data/system/package-dex-usage.list" // TODO(narayan): Since this information has to be kept in sync // with tombstoned, we should just put it in a common header. Loading Loading @@ -1612,6 +1613,7 @@ Dumpstate::RunStatus Dumpstate::DumpstateDefaultAfterCritical() { if (!PropertiesHelper::IsUserBuild()) { ds.AddDir(PROFILE_DATA_DIR_CUR, true); ds.AddDir(PROFILE_DATA_DIR_REF, true); ds.AddZipEntry(ZIP_ROOT_DIR + PACKAGE_DEX_USE_LIST, PACKAGE_DEX_USE_LIST); } ds.AddDir(PREREBOOT_DATA_DIR, false); add_mountinfo(); Loading libs/nativewindow/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ cc_library { ], shared_libs: [ "libhardware", "libcutils", "liblog", "libutils", Loading libs/ui/Region.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -306,6 +306,10 @@ void Region::addRectUnchecked(int l, int t, int r, int b) // ---------------------------------------------------------------------------- Region& Region::orSelf(const Rect& r) { if (isEmpty()) { set(r); return *this; } return operationSelf(r, op_or); } Region& Region::xorSelf(const Rect& r) { Loading @@ -326,6 +330,10 @@ Region& Region::operationSelf(const Rect& r, uint32_t op) { // ---------------------------------------------------------------------------- Region& Region::orSelf(const Region& rhs) { if (isEmpty()) { *this = rhs; return *this; } return operationSelf(rhs, op_or); } Region& Region::xorSelf(const Region& rhs) { Loading services/inputflinger/dispatcher/InputDispatcher.cpp +40 −9 Original line number Diff line number Diff line Loading @@ -1986,18 +1986,49 @@ bool InputDispatcher::checkInjectionPermission(const sp<InputWindowHandle>& wind return true; } /** * Indicate whether one window handle should be considered as obscuring * another window handle. We only check a few preconditions. Actually * checking the bounds is left to the caller. */ static bool canBeObscuredBy(const sp<InputWindowHandle>& windowHandle, const sp<InputWindowHandle>& otherHandle) { // Compare by token so cloned layers aren't counted if (haveSameToken(windowHandle, otherHandle)) { return false; } auto info = windowHandle->getInfo(); auto otherInfo = otherHandle->getInfo(); if (!otherInfo->visible) { return false; } else if (info->ownerPid == otherInfo->ownerPid && otherHandle->getToken() == nullptr) { // In general, if ownerPid is the same we don't want to generate occlusion // events. This line is now necessary since we are including all Surfaces // in occlusion calculation, so if we didn't check PID like this SurfaceView // would occlude their parents. On the other hand before we started including // all surfaces in occlusion calculation and had this line, we would count // windows with an input channel from the same PID as occluding, and so we // preserve this behavior with the getToken() == null check. return false; } else if (otherInfo->isTrustedOverlay()) { return false; } else if (otherInfo->displayId != info->displayId) { return false; } return true; } bool InputDispatcher::isWindowObscuredAtPointLocked(const sp<InputWindowHandle>& windowHandle, int32_t x, int32_t y) const { int32_t displayId = windowHandle->getInfo()->displayId; const std::vector<sp<InputWindowHandle>> windowHandles = getWindowHandlesLocked(displayId); for (const sp<InputWindowHandle>& otherHandle : windowHandles) { if (otherHandle == windowHandle) { break; if (windowHandle == otherHandle) { break; // All future windows are below us. Exit early. } const InputWindowInfo* otherInfo = otherHandle->getInfo(); if (otherInfo->displayId == displayId && otherInfo->visible && !otherInfo->isTrustedOverlay() && otherInfo->frameContainsPoint(x, y)) { if (canBeObscuredBy(windowHandle, otherHandle) && otherInfo->frameContainsPoint(x, y)) { return true; } } Loading @@ -2009,13 +2040,13 @@ bool InputDispatcher::isWindowObscuredLocked(const sp<InputWindowHandle>& window const std::vector<sp<InputWindowHandle>> windowHandles = getWindowHandlesLocked(displayId); const InputWindowInfo* windowInfo = windowHandle->getInfo(); for (const sp<InputWindowHandle>& otherHandle : windowHandles) { if (otherHandle == windowHandle) { break; if (windowHandle == otherHandle) { break; // All future windows are below us. Exit early. } const InputWindowInfo* otherInfo = otherHandle->getInfo(); if (otherInfo->displayId == displayId && otherInfo->visible && !otherInfo->isTrustedOverlay() && otherInfo->overlaps(windowInfo)) { if (canBeObscuredBy(windowHandle, otherHandle) && otherInfo->overlaps(windowInfo)) { return true; } } Loading services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h +1 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ public: MOCK_METHOD4(setDisplayContentSamplingEnabled, status_t(DisplayId, bool, uint8_t, uint64_t)); MOCK_METHOD4(getDisplayedContentSample, status_t(DisplayId, uint64_t, uint64_t, DisplayedFrameStats*)); MOCK_METHOD2(setDisplayBrightness, status_t(DisplayId, float)); MOCK_METHOD2(setDisplayBrightness, std::future<status_t>(DisplayId, float)); MOCK_METHOD2(getDisplayBrightnessSupport, status_t(DisplayId, bool*)); MOCK_METHOD2(onHotplug, Loading Loading
cmds/dumpstate/dumpstate.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ void add_mountinfo(); #define OTA_METADATA_DIR "/metadata/ota" #define SNAPSHOTCTL_LOG_DIR "/data/misc/snapshotctl_log" #define LINKERCONFIG_DIR "/linkerconfig" #define PACKAGE_DEX_USE_LIST "/data/system/package-dex-usage.list" // TODO(narayan): Since this information has to be kept in sync // with tombstoned, we should just put it in a common header. Loading Loading @@ -1612,6 +1613,7 @@ Dumpstate::RunStatus Dumpstate::DumpstateDefaultAfterCritical() { if (!PropertiesHelper::IsUserBuild()) { ds.AddDir(PROFILE_DATA_DIR_CUR, true); ds.AddDir(PROFILE_DATA_DIR_REF, true); ds.AddZipEntry(ZIP_ROOT_DIR + PACKAGE_DEX_USE_LIST, PACKAGE_DEX_USE_LIST); } ds.AddDir(PREREBOOT_DATA_DIR, false); add_mountinfo(); Loading
libs/nativewindow/Android.bp +0 −1 Original line number Diff line number Diff line Loading @@ -59,7 +59,6 @@ cc_library { ], shared_libs: [ "libhardware", "libcutils", "liblog", "libutils", Loading
libs/ui/Region.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -306,6 +306,10 @@ void Region::addRectUnchecked(int l, int t, int r, int b) // ---------------------------------------------------------------------------- Region& Region::orSelf(const Rect& r) { if (isEmpty()) { set(r); return *this; } return operationSelf(r, op_or); } Region& Region::xorSelf(const Rect& r) { Loading @@ -326,6 +330,10 @@ Region& Region::operationSelf(const Rect& r, uint32_t op) { // ---------------------------------------------------------------------------- Region& Region::orSelf(const Region& rhs) { if (isEmpty()) { *this = rhs; return *this; } return operationSelf(rhs, op_or); } Region& Region::xorSelf(const Region& rhs) { Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +40 −9 Original line number Diff line number Diff line Loading @@ -1986,18 +1986,49 @@ bool InputDispatcher::checkInjectionPermission(const sp<InputWindowHandle>& wind return true; } /** * Indicate whether one window handle should be considered as obscuring * another window handle. We only check a few preconditions. Actually * checking the bounds is left to the caller. */ static bool canBeObscuredBy(const sp<InputWindowHandle>& windowHandle, const sp<InputWindowHandle>& otherHandle) { // Compare by token so cloned layers aren't counted if (haveSameToken(windowHandle, otherHandle)) { return false; } auto info = windowHandle->getInfo(); auto otherInfo = otherHandle->getInfo(); if (!otherInfo->visible) { return false; } else if (info->ownerPid == otherInfo->ownerPid && otherHandle->getToken() == nullptr) { // In general, if ownerPid is the same we don't want to generate occlusion // events. This line is now necessary since we are including all Surfaces // in occlusion calculation, so if we didn't check PID like this SurfaceView // would occlude their parents. On the other hand before we started including // all surfaces in occlusion calculation and had this line, we would count // windows with an input channel from the same PID as occluding, and so we // preserve this behavior with the getToken() == null check. return false; } else if (otherInfo->isTrustedOverlay()) { return false; } else if (otherInfo->displayId != info->displayId) { return false; } return true; } bool InputDispatcher::isWindowObscuredAtPointLocked(const sp<InputWindowHandle>& windowHandle, int32_t x, int32_t y) const { int32_t displayId = windowHandle->getInfo()->displayId; const std::vector<sp<InputWindowHandle>> windowHandles = getWindowHandlesLocked(displayId); for (const sp<InputWindowHandle>& otherHandle : windowHandles) { if (otherHandle == windowHandle) { break; if (windowHandle == otherHandle) { break; // All future windows are below us. Exit early. } const InputWindowInfo* otherInfo = otherHandle->getInfo(); if (otherInfo->displayId == displayId && otherInfo->visible && !otherInfo->isTrustedOverlay() && otherInfo->frameContainsPoint(x, y)) { if (canBeObscuredBy(windowHandle, otherHandle) && otherInfo->frameContainsPoint(x, y)) { return true; } } Loading @@ -2009,13 +2040,13 @@ bool InputDispatcher::isWindowObscuredLocked(const sp<InputWindowHandle>& window const std::vector<sp<InputWindowHandle>> windowHandles = getWindowHandlesLocked(displayId); const InputWindowInfo* windowInfo = windowHandle->getInfo(); for (const sp<InputWindowHandle>& otherHandle : windowHandles) { if (otherHandle == windowHandle) { break; if (windowHandle == otherHandle) { break; // All future windows are below us. Exit early. } const InputWindowInfo* otherInfo = otherHandle->getInfo(); if (otherInfo->displayId == displayId && otherInfo->visible && !otherInfo->isTrustedOverlay() && otherInfo->overlaps(windowInfo)) { if (canBeObscuredBy(windowHandle, otherHandle) && otherInfo->overlaps(windowInfo)) { return true; } } Loading
services/surfaceflinger/CompositionEngine/tests/MockHWComposer.h +1 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ public: MOCK_METHOD4(setDisplayContentSamplingEnabled, status_t(DisplayId, bool, uint8_t, uint64_t)); MOCK_METHOD4(getDisplayedContentSample, status_t(DisplayId, uint64_t, uint64_t, DisplayedFrameStats*)); MOCK_METHOD2(setDisplayBrightness, status_t(DisplayId, float)); MOCK_METHOD2(setDisplayBrightness, std::future<status_t>(DisplayId, float)); MOCK_METHOD2(getDisplayBrightnessSupport, status_t(DisplayId, bool*)); MOCK_METHOD2(onHotplug, Loading