mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Removing all usage of LauncherProvider
Also fixing a race condition in model when an item update/delete task gets queued and executed after the model has reloaded (making the old data obsolete) Bug: 277345535 Bug: 263079498 Test: Presubmit Flag: N/A Change-Id: Ibd4bdbb3eece05b38b73a22a4be5f368df3754f0
This commit is contained in:
@@ -31,7 +31,7 @@ import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.launcher3.BubbleTextView;
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.LauncherSettings;
|
||||
import com.android.launcher3.LauncherModel;
|
||||
import com.android.launcher3.ShortcutAndWidgetContainer;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
|
||||
@@ -189,10 +189,11 @@ public class DebugTestInformationHandler extends TestInformationHandler {
|
||||
case TestProtocol.REQUEST_CLEAR_DATA: {
|
||||
final long identity = Binder.clearCallingIdentity();
|
||||
try {
|
||||
LauncherSettings.Settings.call(mContext.getContentResolver(),
|
||||
LauncherSettings.Settings.METHOD_CREATE_EMPTY_DB);
|
||||
MAIN_EXECUTOR.submit(() ->
|
||||
LauncherAppState.getInstance(mContext).getModel().forceReload());
|
||||
MODEL_EXECUTOR.execute(() -> {
|
||||
LauncherModel model = LauncherAppState.getInstance(mContext).getModel();
|
||||
model.getModelDbController().createEmptyDB();
|
||||
MAIN_EXECUTOR.execute(model::forceReload);
|
||||
});
|
||||
return response;
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(identity);
|
||||
|
||||
Reference in New Issue
Block a user