am a13a2f2a: Fixing issue where defered unbind was running after synchronous bind. (Bug 6858398, Bug 6863181)
* commit 'a13a2f2a7bd0550d1ad973f760ff25e1a4137c43': Fixing issue where defered unbind was running after synchronous bind. (Bug 6858398, Bug 6863181)
This commit is contained in:
@@ -98,6 +98,18 @@ public class DeferredHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Runs all queued Runnables from the calling thread. */
|
||||||
|
public void flush() {
|
||||||
|
LinkedList<Runnable> queue = new LinkedList<Runnable>();
|
||||||
|
synchronized (mQueue) {
|
||||||
|
queue.addAll(mQueue);
|
||||||
|
mQueue.clear();
|
||||||
|
}
|
||||||
|
for (Runnable r : queue) {
|
||||||
|
r.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void scheduleNextLocked() {
|
void scheduleNextLocked() {
|
||||||
if (mQueue.size() > 0) {
|
if (mQueue.size() > 0) {
|
||||||
Runnable peek = mQueue.getFirst();
|
Runnable peek = mQueue.getFirst();
|
||||||
|
|||||||
@@ -918,6 +918,11 @@ public class LauncherModel extends BroadcastReceiver {
|
|||||||
// data structures, we can't allow any other thread to touch that data, but because
|
// data structures, we can't allow any other thread to touch that data, but because
|
||||||
// this call is synchronous, we can get away with not locking).
|
// this call is synchronous, we can get away with not locking).
|
||||||
|
|
||||||
|
// The LauncherModel is static in the LauncherApplication and mHandler may have queued
|
||||||
|
// operations from the previous activity. We need to ensure that all queued operations
|
||||||
|
// are executed before any synchronous binding work is done.
|
||||||
|
mHandler.flush();
|
||||||
|
|
||||||
// Divide the set of loaded items into those that we are binding synchronously, and
|
// Divide the set of loaded items into those that we are binding synchronously, and
|
||||||
// everything else that is to be bound normally (asynchronously).
|
// everything else that is to be bound normally (asynchronously).
|
||||||
bindWorkspace(synchronousBindPage);
|
bindWorkspace(synchronousBindPage);
|
||||||
|
|||||||
Reference in New Issue
Block a user