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:
Daniel Sandler
2010-04-13 16:23:58 -04:00
parent 7018d8e327
commit dca661236c
7 changed files with 111 additions and 45 deletions

View File

@@ -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();