summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/testing/TestInformationHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/testing/TestInformationHandler.java')
-rw-r--r--src/com/android/launcher3/testing/TestInformationHandler.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/com/android/launcher3/testing/TestInformationHandler.java b/src/com/android/launcher3/testing/TestInformationHandler.java
index b8476aa1d..d2e196138 100644
--- a/src/com/android/launcher3/testing/TestInformationHandler.java
+++ b/src/com/android/launcher3/testing/TestInformationHandler.java
@@ -23,9 +23,13 @@ import com.android.launcher3.InvariantDeviceProfile;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAppState;
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;
+import java.util.concurrent.ExecutionException;
+
public class TestInformationHandler implements ResourceBasedOverride {
public static TestInformationHandler newInstance(Context context) {
@@ -77,6 +81,32 @@ public class TestInformationHandler implements ResourceBasedOverride {
case TestProtocol.REQUEST_DISABLE_DEBUG_TRACING:
TestProtocol.sDebugTracing = false;
break;
+
+ case TestProtocol.REQUEST_FREEZE_APP_LIST:
+ new MainThreadExecutor().execute(() ->
+ mLauncher.getAppsView().getAppsStore().enableDeferUpdates(
+ AllAppsStore.DEFER_UPDATES_TEST));
+ break;
+
+ case TestProtocol.REQUEST_UNFREEZE_APP_LIST:
+ new MainThreadExecutor().execute(() ->
+ mLauncher.getAppsView().getAppsStore().disableDeferUpdates(
+ AllAppsStore.DEFER_UPDATES_TEST));
+ break;
+
+ case TestProtocol.REQUEST_APP_LIST_FREEZE_FLAGS: {
+ try {
+ final int deferUpdatesFlags = new MainThreadExecutor().submit(() ->
+ mLauncher.getAppsView().getAppsStore().getDeferUpdatesFlags()).get();
+ response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD,
+ deferUpdatesFlags);
+ } catch (ExecutionException e) {
+ throw new RuntimeException(e);
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ break;
+ }
}
return response;
}