Update TestProtocol.REQUEST_CLEAR_DATA to properly clear the workspace

Flag: not needed
Fixes: 287097473
Test: TaplTestsLauncher3
Change-Id: I980a68dff8b475ce8f7b86284663f697b7bc2b57
This commit is contained in:
Schneider Victor-tulias
2023-06-27 11:31:32 -07:00
parent d2d1942b27
commit 67ca528591
5 changed files with 40 additions and 5 deletions

View File

@@ -188,12 +188,27 @@ public class DebugTestInformationHandler extends TestInformationHandler {
return response;
}
case TestProtocol.REQUEST_REINITIALIZE_DATA: {
final long identity = Binder.clearCallingIdentity();
try {
MODEL_EXECUTOR.execute(() -> {
LauncherModel model = LauncherAppState.getInstance(mContext).getModel();
model.getModelDbController().createEmptyDB();
MAIN_EXECUTOR.execute(model::forceReload);
});
return response;
} finally {
Binder.restoreCallingIdentity(identity);
}
}
case TestProtocol.REQUEST_CLEAR_DATA: {
final long identity = Binder.clearCallingIdentity();
try {
MODEL_EXECUTOR.execute(() -> {
LauncherModel model = LauncherAppState.getInstance(mContext).getModel();
model.getModelDbController().createEmptyDB();
model.getModelDbController().clearEmptyDbFlag();
MAIN_EXECUTOR.execute(model::forceReload);
});
return response;