diff --git a/tests/Android.bp b/tests/Android.bp
index 39bd307..7144d65 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -117,3 +117,15 @@
     test_config: "Launcher3Tests.xml",
     data: [":Launcher3"]
 }
+
+// Shared between tests and launcher
+android_library {
+    name: "launcher-testing-shared",
+    srcs: [
+        "shared/com/android/launcher3/testing/shared/**/*.java"
+    ],
+    resource_dirs: [ ],
+    manifest: "shared/AndroidManifest.xml",
+    sdk_version: "current",
+    min_sdk_version: min_launcher3_sdk_version,
+ }
\ No newline at end of file
diff --git a/tests/shared/AndroidManifest.xml b/tests/shared/AndroidManifest.xml
new file mode 100644
index 0000000..1cd0cb3
--- /dev/null
+++ b/tests/shared/AndroidManifest.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2023, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+<manifest package="com.android.launcher3.testing.shared">
+</manifest>
diff --git a/tests/shared/com/android/launcher3/testing/shared/HotseatCellCenterRequest.java b/tests/shared/com/android/launcher3/testing/shared/HotseatCellCenterRequest.java
new file mode 100644
index 0000000..7eb035a
--- /dev/null
+++ b/tests/shared/com/android/launcher3/testing/shared/HotseatCellCenterRequest.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.testing.shared;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Request object for querying a hotseat cell region in Rect.
+ */
+public class HotseatCellCenterRequest implements TestInformationRequest {
+    public final int cellInd;
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeInt(cellInd);
+    }
+
+    @Override
+    public String getRequestName() {
+        return TestProtocol.REQUEST_HOTSEAT_CELL_CENTER;
+    }
+
+    public static final Parcelable.Creator<HotseatCellCenterRequest> CREATOR =
+            new Parcelable.Creator<HotseatCellCenterRequest>() {
+
+                @Override
+                public HotseatCellCenterRequest createFromParcel(Parcel source) {
+                    return new HotseatCellCenterRequest(source);
+                }
+
+                @Override
+                public HotseatCellCenterRequest[] newArray(int size) {
+                    return new HotseatCellCenterRequest[size];
+                }
+            };
+
+    private HotseatCellCenterRequest(int cellInd) {
+        this.cellInd = cellInd;
+    }
+
+    private HotseatCellCenterRequest(Parcel in) {
+        this(in.readInt());
+    }
+
+    /**
+     * Create a builder for HotseatCellCenterRequest.
+     *
+     * @return HotseatCellCenterRequest builder.
+     */
+    public static HotseatCellCenterRequest.Builder builder() {
+        return new HotseatCellCenterRequest.Builder();
+    }
+
+    /**
+     * HotseatCellCenterRequest Builder.
+     */
+    public static final class Builder {
+        private int mCellInd;
+
+        private Builder() {
+            mCellInd = 0;
+        }
+
+        /**
+         * Set the index of hotseat cells.
+         */
+        public HotseatCellCenterRequest.Builder setCellInd(int i) {
+            this.mCellInd = i;
+            return this;
+        }
+
+        /**
+         * build the HotseatCellCenterRequest.
+         */
+        public HotseatCellCenterRequest build() {
+            return new HotseatCellCenterRequest(mCellInd);
+        }
+    }
+}
diff --git a/tests/shared/com/android/launcher3/testing/shared/ResourceUtils.java b/tests/shared/com/android/launcher3/testing/shared/ResourceUtils.java
new file mode 100644
index 0000000..d0ae258
--- /dev/null
+++ b/tests/shared/com/android/launcher3/testing/shared/ResourceUtils.java
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.testing.shared;
+
+import android.content.res.Resources;
+import android.util.DisplayMetrics;
+import android.util.TypedValue;
+
+public class ResourceUtils {
+    private static final float EPSILON = 0.0001f;
+    public static final int DEFAULT_NAVBAR_VALUE = 48;
+    public static final int INVALID_RESOURCE_HANDLE = -1;
+    public static final String NAVBAR_LANDSCAPE_LEFT_RIGHT_SIZE = "navigation_bar_width";
+    public static final String NAVBAR_BOTTOM_GESTURE_SIZE = "navigation_bar_gesture_height";
+    public static final String NAVBAR_BOTTOM_GESTURE_LARGER_SIZE =
+            "navigation_bar_gesture_larger_height";
+
+    public static final String NAVBAR_HEIGHT = "navigation_bar_height";
+    public static final String NAVBAR_HEIGHT_LANDSCAPE = "navigation_bar_height_landscape";
+
+    public static final String STATUS_BAR_HEIGHT = "status_bar_height";
+    public static final String STATUS_BAR_HEIGHT_LANDSCAPE = "status_bar_height_landscape";
+    public static final String STATUS_BAR_HEIGHT_PORTRAIT = "status_bar_height_portrait";
+
+    public static final String NAV_BAR_INTERACTION_MODE_RES_NAME = "config_navBarInteractionMode";
+
+    public static int getNavbarSize(String resName, Resources res) {
+        return getDimenByName(resName, res, DEFAULT_NAVBAR_VALUE);
+    }
+
+    public static int getDimenByName(String resName, Resources res, int defaultValue) {
+        final int frameSize;
+        final int frameSizeResID = res.getIdentifier(resName, "dimen", "android");
+        if (frameSizeResID != 0) {
+            frameSize = res.getDimensionPixelSize(frameSizeResID);
+        } else {
+            frameSize = pxFromDp(defaultValue, res.getDisplayMetrics());
+        }
+        return frameSize;
+    }
+
+    public static boolean getBoolByName(String resName, Resources res, boolean defaultValue) {
+        final boolean val;
+        final int resId = res.getIdentifier(resName, "bool", "android");
+        if (resId != 0) {
+            val = res.getBoolean(resId);
+        } else {
+            val = defaultValue;
+        }
+        return val;
+    }
+
+    public static int getIntegerByName(String resName, Resources res, int defaultValue) {
+        int resId = res.getIdentifier(resName, "integer", "android");
+        return resId != 0 ? res.getInteger(resId) : defaultValue;
+    }
+
+    public static int pxFromDp(float size, DisplayMetrics metrics) {
+        return pxFromDp(size, metrics, 1f);
+    }
+
+    public static int pxFromDp(float size, DisplayMetrics metrics, float scale) {
+        float value = scale * TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, size, metrics);
+        return size < 0 ? INVALID_RESOURCE_HANDLE : roundPxValueFromFloat(value);
+    }
+
+    /**
+     * Rounds a pixel value, taking into account floating point errors.
+     *
+     * <p>If a dp (or sp) value typically returns a half pixel, such as 20dp at a 2.625 density
+     * returning 52.5px, there is a small chance that due to floating-point errors, the value will
+     * be stored as 52.499999. As we round to the nearest pixel, this could cause a 1px difference
+     * in final values, which we correct for in this method.
+     */
+    public static int roundPxValueFromFloat(float value) {
+        float fraction = (float) (value - Math.floor(value));
+        if (Math.abs(0.5f - fraction) < EPSILON) {
+            // Note: we add for negative values as well, as Math.round brings -.5 to the next
+            // "highest" value, e.g. Math.round(-2.5) == -2 [i.e. (int)Math.floor(a + 0.5d)]
+            value += EPSILON;
+        }
+        return Math.round(value);
+    }
+}
diff --git a/tests/shared/com/android/launcher3/testing/shared/TestInformationRequest.java b/tests/shared/com/android/launcher3/testing/shared/TestInformationRequest.java
new file mode 100644
index 0000000..38282032
--- /dev/null
+++ b/tests/shared/com/android/launcher3/testing/shared/TestInformationRequest.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.testing.shared;
+
+import android.os.Parcelable;
+
+/**
+ * A Request sent to TestInformationHandler can implement this interface to carry more information.
+ */
+public interface TestInformationRequest extends Parcelable {
+    /**
+     * The name for handler to dispatch request.
+     */
+    String getRequestName();
+}
diff --git a/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
new file mode 100644
index 0000000..11363a2
--- /dev/null
+++ b/tests/shared/com/android/launcher3/testing/shared/TestProtocol.java
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.testing.shared;
+
+/**
+ * Protocol for custom accessibility events for communication with UI Automation tests.
+ */
+public final class TestProtocol {
+    public static final String STATE_FIELD = "state";
+    public static final String SWITCHED_TO_STATE_MESSAGE = "TAPL_SWITCHED_TO_STATE";
+    public static final String SCROLL_FINISHED_MESSAGE = "TAPL_SCROLL_FINISHED";
+    public static final String PAUSE_DETECTED_MESSAGE = "TAPL_PAUSE_DETECTED";
+    public static final String DISMISS_ANIMATION_ENDS_MESSAGE = "TAPL_DISMISS_ANIMATION_ENDS";
+    public static final String FOLDER_OPENED_MESSAGE = "TAPL_FOLDER_OPENED";
+    public static final int NORMAL_STATE_ORDINAL = 0;
+    public static final int SPRING_LOADED_STATE_ORDINAL = 1;
+    public static final int OVERVIEW_STATE_ORDINAL = 2;
+    public static final int OVERVIEW_MODAL_TASK_STATE_ORDINAL = 3;
+    public static final int QUICK_SWITCH_STATE_ORDINAL = 4;
+    public static final int ALL_APPS_STATE_ORDINAL = 5;
+    public static final int BACKGROUND_APP_STATE_ORDINAL = 6;
+    public static final int HINT_STATE_ORDINAL = 7;
+    public static final int HINT_STATE_TWO_BUTTON_ORDINAL = 8;
+    public static final int OVERVIEW_SPLIT_SELECT_ORDINAL = 9;
+    public static final String TAPL_EVENTS_TAG = "TaplEvents";
+    public static final String SEQUENCE_MAIN = "Main";
+    public static final String SEQUENCE_TIS = "TIS";
+    public static final String SEQUENCE_PILFER = "Pilfer";
+
+    public static String stateOrdinalToString(int ordinal) {
+        switch (ordinal) {
+            case NORMAL_STATE_ORDINAL:
+                return "Normal";
+            case SPRING_LOADED_STATE_ORDINAL:
+                return "SpringLoaded";
+            case OVERVIEW_STATE_ORDINAL:
+                return "Overview";
+            case OVERVIEW_MODAL_TASK_STATE_ORDINAL:
+                return "OverviewModal";
+            case QUICK_SWITCH_STATE_ORDINAL:
+                return "QuickSwitch";
+            case ALL_APPS_STATE_ORDINAL:
+                return "AllApps";
+            case BACKGROUND_APP_STATE_ORDINAL:
+                return "Background";
+            case HINT_STATE_ORDINAL:
+                return "Hint";
+            case HINT_STATE_TWO_BUTTON_ORDINAL:
+                return "Hint2Button";
+            case OVERVIEW_SPLIT_SELECT_ORDINAL:
+                return "OverviewSplitSelect";
+            default:
+                return "Unknown";
+        }
+    }
+
+    public static final String TEST_INFO_REQUEST_FIELD = "request";
+    public static final String TEST_INFO_RESPONSE_FIELD = "response";
+
+    public static final String REQUEST_HOME_TO_OVERVIEW_SWIPE_HEIGHT =
+            "home-to-overview-swipe-height";
+    public static final String REQUEST_BACKGROUND_TO_OVERVIEW_SWIPE_HEIGHT =
+            "background-to-overview-swipe-height";
+    public static final String REQUEST_HOME_TO_ALL_APPS_SWIPE_HEIGHT =
+            "home-to-all-apps-swipe-height";
+    public static final String REQUEST_ICON_HEIGHT =
+            "icon-height";
+    public static final String REQUEST_IS_LAUNCHER_INITIALIZED = "is-launcher-initialized";
+    public static final String REQUEST_FREEZE_APP_LIST = "freeze-app-list";
+    public static final String REQUEST_UNFREEZE_APP_LIST = "unfreeze-app-list";
+    public static final String REQUEST_ENABLE_MANUAL_TASKBAR_STASHING = "enable-taskbar-stashing";
+    public static final String REQUEST_DISABLE_MANUAL_TASKBAR_STASHING = "disable-taskbar-stashing";
+    public static final String REQUEST_ENABLE_BLOCK_TIMEOUT = "enable-block-timeout";
+    public static final String REQUEST_DISABLE_BLOCK_TIMEOUT = "disable-block-timeout";
+    public static final String REQUEST_ENABLE_TRANSIENT_TASKBAR = "enable-transient-taskbar";
+    public static final String REQUEST_DISABLE_TRANSIENT_TASKBAR = "disable-transient-taskbar";
+    public static final String REQUEST_UNSTASH_TASKBAR_IF_STASHED = "unstash-taskbar-if-stashed";
+    public static final String REQUEST_STASHED_TASKBAR_HEIGHT = "stashed-taskbar-height";
+    public static final String REQUEST_RECREATE_TASKBAR = "recreate-taskbar";
+    public static final String REQUEST_APP_LIST_FREEZE_FLAGS = "app-list-freeze-flags";
+    public static final String REQUEST_APPS_LIST_SCROLL_Y = "apps-list-scroll-y";
+    public static final String REQUEST_WIDGETS_SCROLL_Y = "widgets-scroll-y";
+    public static final String REQUEST_TARGET_INSETS = "target-insets";
+    public static final String REQUEST_WINDOW_INSETS = "window-insets";
+    public static final String REQUEST_PID = "pid";
+    public static final String REQUEST_FORCE_GC = "gc";
+    public static final String REQUEST_VIEW_LEAK = "view-leak";
+    public static final String REQUEST_RECENT_TASKS_LIST = "recent-tasks-list";
+    public static final String REQUEST_START_EVENT_LOGGING = "start-event-logging";
+    public static final String REQUEST_GET_TEST_EVENTS = "get-test-events";
+    public static final String REQUEST_GET_HAD_NONTEST_EVENTS = "get-had-nontest-events";
+    public static final String REQUEST_STOP_EVENT_LOGGING = "stop-event-logging";
+    public static final String REQUEST_CLEAR_DATA = "clear-data";
+    public static final String REQUEST_USE_TEST_WORKSPACE_LAYOUT = "use-test-workspace-layout";
+    public static final String REQUEST_USE_TEST2_WORKSPACE_LAYOUT = "use-test2-workspace-layout";
+    public static final String REQUEST_USE_DEFAULT_WORKSPACE_LAYOUT =
+            "use-default-workspace-layout";
+    public static final String REQUEST_HOTSEAT_ICON_NAMES = "get-hotseat-icon-names";
+    public static final String REQUEST_IS_TABLET = "is-tablet";
+    public static final String REQUEST_IS_TWO_PANELS = "is-two-panel";
+    public static final String REQUEST_START_DRAG_THRESHOLD = "start-drag-threshold";
+    public static final String REQUEST_GET_ACTIVITIES_CREATED_COUNT =
+            "get-activities-created-count";
+    public static final String REQUEST_GET_ACTIVITIES = "get-activities";
+    public static final String REQUEST_HAS_TIS = "has-touch-interaction-service";
+    public static final String REQUEST_TASKBAR_ALL_APPS_TOP_PADDING =
+            "taskbar-all-apps-top-padding";
+    public static final String REQUEST_ALL_APPS_TOP_PADDING = "all-apps-top-padding";
+    public static final String REQUEST_ALL_APPS_BOTTOM_PADDING = "all-apps-bottom-padding";
+
+    public static final String REQUEST_WORKSPACE_CELL_LAYOUT_SIZE = "workspace-cell-layout-size";
+    public static final String REQUEST_WORKSPACE_CELL_CENTER = "workspace-cell-center";
+    public static final String REQUEST_WORKSPACE_COLUMNS_ROWS = "workspace-columns-rows";
+
+    public static final String REQUEST_HOTSEAT_CELL_CENTER = "hotseat-cell-center";
+
+    public static final String REQUEST_GET_FOCUSED_TASK_HEIGHT_FOR_TABLET =
+            "get-focused-task-height-for-tablet";
+    public static final String REQUEST_GET_GRID_TASK_SIZE_RECT_FOR_TABLET =
+            "get-grid-task-size-rect-for-tablet";
+    public static final String REQUEST_GET_OVERVIEW_PAGE_SPACING = "get-overview-page-spacing";
+    public static final String REQUEST_ENABLE_ROTATION = "enable_rotation";
+    public static final String REQUEST_ENABLE_SUGGESTION = "enable-suggestion";
+    public static final String REQUEST_MODEL_QUEUE_CLEARED = "model-queue-cleared";
+
+    public static boolean sDebugTracing = false;
+    public static final String REQUEST_ENABLE_DEBUG_TRACING = "enable-debug-tracing";
+    public static final String REQUEST_DISABLE_DEBUG_TRACING = "disable-debug-tracing";
+
+
+    public static boolean sDisableSensorRotation;
+    public static final String REQUEST_MOCK_SENSOR_ROTATION = "mock-sensor-rotation";
+
+    public static final String PERMANENT_DIAG_TAG = "TaplTarget";
+    public static final String NO_DROP_TARGET = "b/195031154";
+    public static final String NULL_INT_SET = "b/200572078";
+    public static final String MISSING_PROMISE_ICON = "b/202985412";
+    public static final String TASKBAR_IN_APP_STATE = "b/227657604";
+    public static final String NPE_TRANSIENT_TASKBAR = "b/257549303";
+
+    public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
+    public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";
+    public static final String REQUEST_IS_EMULATE_DISPLAY_RUNNING = "is-emulate-display-running";
+    public static final String REQUEST_EMULATE_PRINT_DEVICE = "emulate-print-device";
+}
diff --git a/tests/shared/com/android/launcher3/testing/shared/WorkspaceCellCenterRequest.java b/tests/shared/com/android/launcher3/testing/shared/WorkspaceCellCenterRequest.java
new file mode 100644
index 0000000..e2cd8ea
--- /dev/null
+++ b/tests/shared/com/android/launcher3/testing/shared/WorkspaceCellCenterRequest.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.launcher3.testing.shared;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Request object for querying a workspace cell region in Rect.
+ */
+public class WorkspaceCellCenterRequest implements TestInformationRequest {
+    public final int cellX;
+    public final int cellY;
+    public final int spanX;
+    public final int spanY;
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeInt(cellX);
+        dest.writeInt(cellY);
+        dest.writeInt(spanX);
+        dest.writeInt(spanY);
+    }
+
+    public static final Parcelable.Creator<WorkspaceCellCenterRequest> CREATOR =
+            new Parcelable.Creator<WorkspaceCellCenterRequest>() {
+
+                @Override
+                public WorkspaceCellCenterRequest createFromParcel(Parcel source) {
+                    return new WorkspaceCellCenterRequest(source);
+                }
+
+                @Override
+                public WorkspaceCellCenterRequest[] newArray(int size) {
+                    return new WorkspaceCellCenterRequest[size];
+                }
+            };
+
+    private WorkspaceCellCenterRequest(int cellX, int cellY, int spanX, int spanY) {
+        this.cellX = cellX;
+        this.cellY = cellY;
+        this.spanX = spanX;
+        this.spanY = spanY;
+    }
+
+    private WorkspaceCellCenterRequest(Parcel in) {
+        this(in.readInt(), in.readInt(), in.readInt(), in.readInt());
+    }
+
+    /**
+     * Create a builder for WorkspaceCellRectRequest.
+     *
+     * @return WorkspaceCellRectRequest builder.
+     */
+    public static WorkspaceCellCenterRequest.Builder builder() {
+        return new WorkspaceCellCenterRequest.Builder();
+    }
+
+    @Override
+    public String getRequestName() {
+        return TestProtocol.REQUEST_WORKSPACE_CELL_CENTER;
+    }
+
+    /**
+     * WorkspaceCellRectRequest Builder.
+     */
+    public static final class Builder {
+        private int mCellX;
+        private int mCellY;
+        private int mSpanX;
+        private int mSpanY;
+
+        private Builder() {
+            this.mCellX = 0;
+            this.mCellY = 0;
+            this.mSpanX = 1;
+            this.mSpanY = 1;
+        }
+
+        /**
+         * Set X coordinate of upper left corner expressed as a cell position
+         */
+        public WorkspaceCellCenterRequest.Builder setCellX(int x) {
+            this.mCellX = x;
+            return this;
+        }
+
+        /**
+         * Set Y coordinate of upper left corner expressed as a cell position
+         */
+        public WorkspaceCellCenterRequest.Builder setCellY(int y) {
+            this.mCellY = y;
+            return this;
+        }
+
+        /**
+         * Set span Width in cells
+         */
+        public WorkspaceCellCenterRequest.Builder setSpanX(int x) {
+            this.mSpanX = x;
+            return this;
+        }
+
+        /**
+         * Set span Height in cells
+         */
+        public WorkspaceCellCenterRequest.Builder setSpanY(int y) {
+            this.mSpanY = y;
+            return this;
+        }
+
+        /**
+         * build the WorkspaceCellRectRequest.
+         */
+        public WorkspaceCellCenterRequest build() {
+            return new WorkspaceCellCenterRequest(mCellX, mCellY, mSpanX, mSpanY);
+        }
+    }
+}
