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

Commit 29d5e6d8 authored by Chavi Weingarten's avatar Chavi Weingarten Committed by Automerger Merge Worker
Browse files

Merge "Add focusTransferTarget in WindowInfo" into udc-dev am: 2f1a74e5

parents 461bd38a 2f1a74e5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ status_t WindowInfo::writeToParcel(android::Parcel* parcel) const {
        parcel->writeBool(replaceTouchableRegionWithCrop) ?:
        parcel->writeStrongBinder(touchableRegionCropHandle.promote()) ?:
        parcel->writeStrongBinder(windowToken);
        parcel->writeStrongBinder(focusTransferTarget);
    // clang-format on
    return status;
}
@@ -175,7 +176,9 @@ status_t WindowInfo::readFromParcel(const android::Parcel* parcel) {
        parcel->read(touchableRegion) ?:
        parcel->readBool(&replaceTouchableRegionWithCrop) ?:
        parcel->readNullableStrongBinder(&touchableRegionCropHandleSp) ?:
        parcel->readNullableStrongBinder(&windowToken);
        parcel->readNullableStrongBinder(&windowToken) ?:
        parcel->readNullableStrongBinder(&focusTransferTarget);

    // clang-format on

    if (status != OK) {
+0 −9
Original line number Diff line number Diff line
@@ -23,15 +23,6 @@ parcelable FocusRequest {
     */
    @nullable IBinder token;
    @utf8InCpp String windowName;
    /**
     * The token that the caller expects currently to be focused. If the
     * specified token does not match the currently focused window, this request will be dropped.
     * If the specified focused token matches the currently focused window, the call will succeed.
     * Set this to "null" if this call should succeed no matter what the currently focused token
     * is.
     */
    @nullable IBinder focusedToken;
    @utf8InCpp String focusedWindowName;
    /**
     * SYSTEM_TIME_MONOTONIC timestamp in nanos set by the client (wm) when requesting the focus
     * change. This determines which request gets precedence if there is a focus change request
+5 −0
Original line number Diff line number Diff line
@@ -236,6 +236,11 @@ struct WindowInfo : public Parcelable {
    Type layoutParamsType = Type::UNKNOWN;
    ftl::Flags<Flag> layoutParamsFlags;

    // The input token for the window to which focus should be transferred when this input window
    // can be successfully focused. If null, this input window will not transfer its focus to
    // any other window.
    sp<IBinder> focusTransferTarget;

    void setInputConfig(ftl::Flags<InputConfig> config, bool value);

    void addTouchableRegion(const Rect& region);
+0 −2
Original line number Diff line number Diff line
@@ -272,8 +272,6 @@ public:
        FocusRequest request;
        request.token = mInputInfo.token;
        request.windowName = mInputInfo.name;
        request.focusedToken = nullptr;
        request.focusedWindowName = "";
        request.timestamp = systemTime(SYSTEM_TIME_MONOTONIC);
        request.displayId = displayId;
        t.setFocusedWindow(request);
+2 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ TEST(WindowInfo, Parcelling) {
    i.applicationInfo.name = "ApplicationFooBar";
    i.applicationInfo.token = new BBinder();
    i.applicationInfo.dispatchingTimeoutMillis = 0x12345678ABCD;
    i.focusTransferTarget = new BBinder();

    Parcel p;
    i.writeToParcel(&p);
@@ -101,6 +102,7 @@ TEST(WindowInfo, Parcelling) {
    ASSERT_EQ(i.replaceTouchableRegionWithCrop, i2.replaceTouchableRegionWithCrop);
    ASSERT_EQ(i.touchableRegionCropHandle, i2.touchableRegionCropHandle);
    ASSERT_EQ(i.applicationInfo, i2.applicationInfo);
    ASSERT_EQ(i.focusTransferTarget, i2.focusTransferTarget);
}

TEST(InputApplicationInfo, Parcelling) {
Loading