Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 236cb1ab authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6445537 from 6650884c to rvc-release

Change-Id: Idbcb6abfa9c8ac76153c5c4362e28f2ed1c01a4b
parents 9f7e1871 6650884c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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.
@@ -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();
+0 −1
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@ cc_library {
    ],

    shared_libs: [
        "libhardware",
        "libcutils",
        "liblog",
        "libutils",
+8 −0
Original line number Diff line number Diff line
@@ -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) {
@@ -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) {
+40 −9
Original line number Diff line number Diff line
@@ -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;
        }
    }
@@ -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;
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -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