summaryrefslogtreecommitdiff
path: root/ext_tests
diff options
context:
space:
mode:
authorvadimt <vadimt@google.com>2020-06-22 15:01:49 -0700
committervadimt <vadimt@google.com>2020-06-22 15:39:19 -0700
commit839fb7b3aedee54065e3cba307c878df25cb3343 (patch)
tree7b48ac3fe04cf679a02358eca0e19ad9fd29bca3 /ext_tests
parent21cea8e55c9a7c56f407a0cd51f9ae29b1158c38 (diff)
downloadLauncher3-839fb7b3aedee54065e3cba307c878df25cb3343.tar.gz
Eliminating messages that launcher activity is frozen
They were ultimately caused by killing Launcher process from tests. Now having a test info handler request to clear db. Bug: 152629799 Change-Id: Ia81ddc3e338718c4cff08c7396b9fda1b7091024
Diffstat (limited to 'ext_tests')
-rw-r--r--ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
index ad21106759..0b7d4bf27e 100644
--- a/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
+++ b/ext_tests/src/com/android/launcher3/testing/DebugTestInformationHandler.java
@@ -18,6 +18,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;
@@ -28,6 +30,9 @@ import android.view.View;
import androidx.annotation.Keep;
+import com.android.launcher3.LauncherAppState;
+import com.android.launcher3.LauncherSettings;
+
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
@@ -165,6 +170,14 @@ public class DebugTestInformationHandler extends TestInformationHandler {
return response;
}
+ case TestProtocol.REQUEST_CLEAR_DATA: {
+ LauncherSettings.Settings.call(mContext.getContentResolver(),
+ LauncherSettings.Settings.METHOD_CREATE_EMPTY_DB);
+ MAIN_EXECUTOR.submit(() ->
+ LauncherAppState.getInstance(mContext).getModel().forceReload());
+ return response;
+ }
+
default:
return super.call(method);
}