mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 00:06:47 +00:00
Fixing bug when model was not reflected properly on the UI.
If launcher submits a job, and then reloads before the job is executed, the correct model is not reflected on the Launcher. In that case, we simply rebind the launcher Change-Id: I380242a4de13e7b2bc326d1a076f0a974435999c
This commit is contained in:
@@ -29,7 +29,6 @@ import com.android.launcher3.util.ComponentKey;
|
||||
import com.android.launcher3.util.ItemInfoMatcher;
|
||||
import com.android.launcher3.util.MultiHashMap;
|
||||
import com.android.launcher3.widget.WidgetListRowEntry;
|
||||
import com.android.launcher3.widget.WidgetsListAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.Executor;
|
||||
@@ -80,19 +79,18 @@ public abstract class BaseModelUpdateTask implements ModelUpdateTask {
|
||||
*/
|
||||
public final void scheduleCallbackTask(final CallbackTask task) {
|
||||
final Callbacks callbacks = mModel.getCallback();
|
||||
mUiExecutor.execute(new Runnable() {
|
||||
public void run() {
|
||||
Callbacks cb = mModel.getCallback();
|
||||
if (callbacks == cb && cb != null) {
|
||||
task.execute(callbacks);
|
||||
}
|
||||
mUiExecutor.execute(() -> {
|
||||
Callbacks cb = mModel.getCallback();
|
||||
if (callbacks == cb && cb != null) {
|
||||
task.execute(callbacks);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public ModelWriter getModelWriter() {
|
||||
// Updates from model task, do not deal with icon position in hotseat.
|
||||
return mModel.getWriter(false /* hasVerticalHotseat */);
|
||||
// Updates from model task, do not deal with icon position in hotseat. Also no need to
|
||||
// verify changes as the ModelTasks always push the changes to callbacks
|
||||
return mModel.getWriter(false /* hasVerticalHotseat */, false /* verifyChanges */);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user