Otherwise we can load widgets and other resources from the wrong Configuration.
This doesn't completely fix the bug, but it makes it much less likely. We tell
the launcher once at the beginning of starting a reload because of SD cards coming
back, and once when we bind.
cherry pick of I99ee6af38bef91e261832bad4dec978a5d4a8b3d
Bug: 3126698
Change-Id: I917bdb3982e3eea4924c6e9a8f3c037fd493f415
The pause is mostly notable when a sync is happening at the same time.
The related function addItemToDatabase() is unchanged by this CL
though as it populates item.id and would need more invasive changes
elsewhere.
Change-Id: I6538445aeb15d9efedf99f262c39f6175f7f1e0e
Merge commit '673aefe8b2b27790d704cc15282c8989a132877b'
* commit '673aefe8b2b27790d704cc15282c8989a132877b':
When the SD card comes back, we need to show the apps on it.
The problem was that we were doing startLoader, but once the
apps are loaded, all that does is re-bind everything. Before
a recent change of mine, we were clearing mWorkspaceLoaded and
mAllAppsLoaded. But that's not good either, because it meant
that there needed to be a lock that the main thread and the
worker thread were both acquiring, which was causing ANRs.
Instead, now we schedule two messages - one to add the apps
back into the list, and one to update everything to use
those new icons.
Bug: 3065061
Change-Id: If9d36d4b55a7ba72fcf48a5ed8941bb9466bebe6
Merge commit 'd98979b8147065878719cd2adb039317ba3abe0a'
* commit 'd98979b8147065878719cd2adb039317ba3abe0a':
Reload everything when coming back from the SD being unmounted.
We could do this more efficiently by only updating the packages that
have changed, but that would involve a big rewrite.
Bug: 3020854
Change-Id: Ie7e3bee20f45dc5efa93d960902e9dfb79c4a3a5
also:
- Long press on empty space on workspace now brings up customization tray
- Fixed: while dragging, items appeared to be dropping on folders two cells to the right
- Fixed: Disabling drops on folders when the workspace is shrunken
- Fixed: account for scaling of dragged items when checking if they overlap
with shrunken workspace screens
- Making folder icons dimmable to match shortcuts and widgets
- When deciding with shrunken workspace screen we're dragging to, we now use the closest screen rather than the one that has been overlapped the most
- Refactored drag/add mechanism, removing array of occupied cells from CellInfo
- Removed dead code/variables
Merge commit '73013bf94f49ffbacba2b8300f6a2dd4eeebbd13'
* commit '73013bf94f49ffbacba2b8300f6a2dd4eeebbd13':
Make LauncherModel.deleteItemFromDatabase write to disk async.
Adding pages for customization drawer with initial implementation of proposed flow
layout for widgets. Fixes for keeping all apps, and widgets in sync with Launcher
Model, optimizations for reloading all apps pages when invalidating. Adding some
animations for tab transitions and feedback when long pressing to add certain items.
Change-Id: I8d51749f3a91c964bed35681f3a9192200b0d93e
This commit eliminates the notion of in-place rotations and a bunch of
associated complexities (including the notion of canonical coordinates).
Further, the number of x and y cells per workspace screen is now being stored
in a single location in the XML definition of Workspace. This fixes a couple
bugs where incorrect values were being used. Finally, eliminated the notion of
"shortAxis" and "longAxis" in terms of padding and cell count. These have been
translated to corresponding x and y axis values.
Change-Id: I30cfed66f82d739355b3f01730b28b6c0437989c
updates into that thread as well.
This gets rid of the ANRs that happened because both threads were
holding mAllAppsListLock. Now mAllAppsList should only be touched
from within the worker thread.
Change-Id: Ifc4ac27e0c0a927ac66c456d097fd3d4ef6c5e1e
set from the ui thread.
This will help the ANR in LauncherModel.onReceive because if
we're under contention, there's a good chance that we haven't loaded
yet. It won't completely fix it, but that will take a large refactoring.
Bug 2672967
Change-Id: I2c97a416767b4bb6aac0252f02e2aa2055ae8a4e
This always reloads the workspace, because I think it's a less risky change and that only adds
~100ms.
Change-Id: I215b1f741f022e47ce06e78b9cfdd9967a8f1b9d
This change reorganizes the increasingly Byzantine loader
thread so that the order of (workspace, allapps) can be
reversed if the user is currently looking at the all apps
view. The perceptual improvement in performance is huge if
you change the Launcher's orientation while All Apps is
visible (which forces a reload/bind of everything); now that
AA doesn't have to wait behind the workspace it
(specifically, its first batch of icons) appears much, much
faster.
Bug: 2722977
Change-Id: I07a9afd5f1cff4019f2640b082872176ba0a887e
Should the Launcher's database become corrupted by
mysterious forces (e.g.: third-party launchers; botched
upgrades; smoke monsters) in such a way as to cause two
items to share the same cell, we now ignore loading the
latter.
Prevents a runtime crash (http://b/2655516).
Bug: 2655516
Change-Id: Ia514746f04f0e51b2cd07e9290589a6eab75bdd2
* Removed another redundant sort
* Correctly set the thread priority to BACKGROUND for the
all apps loading step.
* Moved batch delay to a resource
* Reduced delay between loading batches of apps to 100ms
(we really just want to sleep a tiny bit between batches
to give the UI time to react)
Bug: 2562420
Bug: 2599979 (related)
Change-Id: I1ae72a68c1a47377a9eb62827fe7666bfc50caa5
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
used for the workspace.
Consolidate the three icon resampling functions into one.
Ensure that the icons stored in LauncherProvider are the right size, so we don't have to resample
them each time we load them.