mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Fixing issue where defered unbind was running after synchronous bind. (Bug 6858398, Bug 6863181)
Change-Id: I03dc3ae18528901cc88c79638a8495c1ab8d61af
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() {
|
||||
if (mQueue.size() > 0) {
|
||||
Runnable peek = mQueue.getFirst();
|
||||
|
||||
Reference in New Issue
Block a user