mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Batch loading of icons for AllApps.
AllAppsList now maintains <data> and <added> in sorted order, to amortize the cost of sorting the apps list over multiple batches. Launcher boosts thread priority on first launch, but we now reduce thread priority to normal after the main workspace has been drawn but before all apps are loaded. Experimental feature: a short delay is introduced between batches to help free up the CPU (as well as to show that we are indeed batching apps). Bug: 2562420 Change-Id: I2035ec3e819b4e7993a80c6d03bfad3914c95a7a
This commit is contained in:
@@ -87,6 +87,12 @@ public class DeferredHandler {
|
||||
post(new IdleRunnable(runnable));
|
||||
}
|
||||
|
||||
public void cancelRunnable(Runnable runnable) {
|
||||
synchronized (mQueue) {
|
||||
while (mQueue.remove(runnable)) { }
|
||||
}
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
synchronized (mQueue) {
|
||||
mQueue.clear();
|
||||
|
||||
Reference in New Issue
Block a user