diff options
Diffstat (limited to 'src/com/android/launcher3/testing')
-rw-r--r-- | src/com/android/launcher3/testing/TestInformationHandler.java | 26 | ||||
-rw-r--r-- | src/com/android/launcher3/testing/TestProtocol.java | 5 |
2 files changed, 23 insertions, 8 deletions
diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java index 790a2e844..c6de9ca90 100644 --- a/src/com/android/launcher3/testing/TestInformationHandler.java +++ b/src/com/android/launcher3/testing/TestInformationHandler.java @@ -17,6 +17,8 @@ package com.android.launcher3.testing; import static android.graphics.Bitmap.Config.ARGB_8888; +import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; + import android.content.Context; import android.graphics.Bitmap; import android.graphics.Color; @@ -27,8 +29,8 @@ import com.android.launcher3.DeviceProfile; import com.android.launcher3.InvariantDeviceProfile; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; +import com.android.launcher3.LauncherModel; import com.android.launcher3.LauncherState; -import com.android.launcher3.MainThreadExecutor; import com.android.launcher3.R; import com.android.launcher3.allapps.AllAppsStore; import com.android.launcher3.util.ResourceBasedOverride; @@ -82,7 +84,7 @@ public class TestInformationHandler implements ResourceBasedOverride { } case TestProtocol.REQUEST_IS_LAUNCHER_INITIALIZED: { - response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, true); + response.putBoolean(TestProtocol.TEST_INFO_RESPONSE_FIELD, isLauncherInitialized()); break; } @@ -95,20 +97,20 @@ public class TestInformationHandler implements ResourceBasedOverride { break; case TestProtocol.REQUEST_FREEZE_APP_LIST: - new MainThreadExecutor().execute(() -> + MAIN_EXECUTOR.execute(() -> mLauncher.getAppsView().getAppsStore().enableDeferUpdates( AllAppsStore.DEFER_UPDATES_TEST)); break; case TestProtocol.REQUEST_UNFREEZE_APP_LIST: - new MainThreadExecutor().execute(() -> + MAIN_EXECUTOR.execute(() -> mLauncher.getAppsView().getAppsStore().disableDeferUpdates( AllAppsStore.DEFER_UPDATES_TEST)); break; case TestProtocol.REQUEST_APP_LIST_FREEZE_FLAGS: { try { - final int deferUpdatesFlags = new MainThreadExecutor().submit(() -> + final int deferUpdatesFlags = MAIN_EXECUTOR.submit(() -> mLauncher.getAppsView().getAppsStore().getDeferUpdatesFlags()).get(); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, deferUpdatesFlags); @@ -149,7 +151,19 @@ public class TestInformationHandler implements ResourceBasedOverride { mLeaks.add(bitmap); break; } + + case TestProtocol.REQUEST_ICON_HEIGHT: { + response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, + mDeviceProfile.allAppsCellHeightPx); + break; + } } return response; } -}
\ No newline at end of file + + protected boolean isLauncherInitialized() { + final LauncherModel model = LauncherAppState.getInstance(mContext).getModel(); + return model.getCallback() == null || model.isModelLoaded(); + } +} + diff --git a/src/com/android/launcher3/testing/TestProtocol.java b/src/com/android/launcher3/testing/TestProtocol.java index 232a764e0..07ddbdc4e 100644 --- a/src/com/android/launcher3/testing/TestProtocol.java +++ b/src/com/android/launcher3/testing/TestProtocol.java @@ -66,6 +66,8 @@ public final class TestProtocol { "all-apps-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_HOTSEAT_TOP = "hotseat-top"; public static final String REQUEST_IS_LAUNCHER_INITIALIZED = "is-launcher-initialized"; public static final String REQUEST_FREEZE_APP_LIST = "freeze-app-list"; @@ -84,6 +86,5 @@ public final class TestProtocol { public static final String NO_BACKGROUND_TO_OVERVIEW_TAG = "b/138251824"; public static final String NO_DRAG_TO_WORKSPACE = "b/138729456"; public static final String APP_NOT_DISABLED = "b/139891609"; - public static final String ALL_APPS_UPON_RECENTS = "b/139941530"; - public static final String STABLE_STATE_MISMATCH = "b/140311911"; + public static final String NO_CONTEXT_MENU = "b/141770616"; } |