Commit Graph

67 Commits

Author SHA1 Message Date
Joe Onorato ef2efcff5e When the launcher is paused and we reload stuff in the background, we need to re-re-load it in onResume.
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
2010-10-27 13:21:00 -07:00
Brad Fitzpatrick 76275ac1c5 resolved conflicts for merge of 700889f5 to master
Change-Id: I85320de6483e6820fe27b4012bfc323ccafa0e04
2010-10-12 13:52:44 -07:00
Brad Fitzpatrick adb4229c23 am 02e53429: Merge "Don\'t block the UI when rearranging icons." into gingerbread
Merge commit '02e53429c4ef01bee548e0eaba4aeeee99db35f4'

* commit '02e53429c4ef01bee548e0eaba4aeeee99db35f4':
  Don't block the UI when rearranging icons.
2010-10-11 17:43:21 -07:00
Brad Fitzpatrick 700889f504 Serialize background async db updates
Bug: 2983765
Change-Id: I1fdd33ea8ee4fbc79a75ce0450f04d8e18915975
2010-10-11 10:10:40 -07:00
Brad Fitzpatrick ade2f8122f Don't block the UI when rearranging icons.
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
2010-10-10 15:42:06 -07:00
Joe Onorato 5eb7fff487 am 673aefe8: Merge "When the SD card comes back, we need to show the apps on it." into gingerbread
Merge commit '673aefe8b2b27790d704cc15282c8989a132877b'

* commit '673aefe8b2b27790d704cc15282c8989a132877b':
  When the SD card comes back, we need to show the apps on it.
2010-10-10 11:26:02 -07:00
Joe Onorato cec583352c 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
2010-10-07 14:37:40 -04:00
Joe Onorato a249304572 am d98979b8: Merge "Reload everything when coming back from the SD being unmounted." into gingerbread
Merge commit 'd98979b8147065878719cd2adb039317ba3abe0a'

* commit 'd98979b8147065878719cd2adb039317ba3abe0a':
  Reload everything when coming back from the SD being unmounted.
2010-09-30 19:46:29 -07:00
Joe Onorato 789065d26e 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
2010-09-30 16:32:11 -07:00
Michael Jurka 845ba3b17b Fix: crash on portrait/landscape switch due to
duplicate View ids

Change-Id: I69d09823d4825dadd7f3e119f9248140256f91b3
2010-09-30 10:54:28 -07:00
Michael Jurka 0280c3be4d Adding support for drag and drop of folders and shortcuts.
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
2010-09-24 15:28:20 -07:00
Brad Fitzpatrick 98cf129f80 am 73013bf9: Make LauncherModel.deleteItemFromDatabase write to disk async.
Merge commit '73013bf94f49ffbacba2b8300f6a2dd4eeebbd13'

* commit '73013bf94f49ffbacba2b8300f6a2dd4eeebbd13':
  Make LauncherModel.deleteItemFromDatabase write to disk async.
2010-09-15 12:17:49 -07:00
Brad Fitzpatrick 73013bf94f Make LauncherModel.deleteItemFromDatabase write to disk async.
Fixes a bunch of StrictMode violations and removes TODOs.

Change-Id: I886bd071d4a8336c228d29c517a8ffc5223c0623
2010-09-14 12:33:35 -07:00
Joe Onorato ddc9c1fb1a DO NOT MERGE - Fix 2941495: Launcher short-cut icons don't work for apps on SD card after reboot
Bug: 2941495
Change-Id: Ie8e0e0c62259f8cf933e53b7aa2dc28a835110ae
2010-09-01 12:15:10 -07:00
Joe Onorato f5ed4f1141 DO NOT MERGE - Fix 2941495: Launcher short-cut icons don't work for apps on SD card after reboot
Bug: 2941495
Change-Id: Idf1869d33cd5c01abea5b059ca466529cee0ad93
2010-08-31 12:02:24 -07:00
Winson Chung 80baf5a6b3 Adding paging for the widget/shortcut/folder customization area and fixing bugs.
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
2010-08-16 15:51:43 -07:00
Adam Cohen d22015cd37 Cleaning up grid size specification in Launcher
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
2010-08-04 11:03:47 -07:00
Patrick Dubroy 3d605d5bbe Make tabs in all apps actually filter the list of apps. 2010-07-29 16:09:27 -07:00
Winson Chung aafa03cbb9 Allow for NxM layout and in-place rotation of items on homescreen.
Currently, rotation is disabled as designs are still in flux, but the NxM grid is enabled (8x4).

Change-Id: I0026f88c674719e3d67de6d6d481d2d4cd606362
2010-06-30 16:24:40 -07:00
Joe Onorato 3611578579 Make the loader thread a Looper and move the package manager
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
2010-06-18 14:40:26 -04:00
Joe Onorato 790c2d9fc5 This variable can be checked outside the lock because it's only
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
2010-06-11 00:14:11 -07:00
Joe Onorato 774b327991 Fix the folder bug. The change that had previously fixed this got reverted somehow.
Change-Id: I308656a5b1748e8aca254410b049110afaa7affc
2010-06-08 17:39:37 -07:00
Joe Onorato cc67f476c0 Improve launcher loading performance by only doing re-binds.
This always reloads the workspace, because I think it's a less risky change and that only adds
~100ms.

Change-Id: I215b1f741f022e47ce06e78b9cfdd9967a8f1b9d
2010-06-08 11:32:28 -07:00
Daniel Sandler 843e860e8e Load All Apps before the workspace if All Apps is showing.
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
2010-06-07 16:45:16 -04:00
Daniel Sandler 596c0e6dbb Don't perform collision checks for items in folders.
Bug: 2735146
Change-Id: Ie4d03b09cc75bfc176ec91be6f6f4369af5cc2a3
2010-06-02 13:34:01 -07:00
Daniel Sandler 8802e96049 Defend against overlapping items in the workspace.
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
2010-05-26 16:50:49 -04:00
Joe Onorato f3d5ea926d Have LauncherModel poke the gc after it's done, to give the
renderscript objects a chance to get deleted, since they aren't
in the java heap.

Bug 2685490

Change-Id: Ifff97b64585ac0f6faed0feb6362f6137682e32d
2010-05-18 18:44:36 -07:00
Joe Onorato fad1fb5ed4 Tweak locking in launcher so mLock isn't held while the slow stuff happens.
Bug 2652948

Change-Id: I9d386395278830ead5deda17b8b09e0dcfeff989
2010-05-04 14:43:16 -07:00
Romain Guy 0e74d9f057 Avoid ANR in Home by avoiding a sycnhronized call on the UI thread.
Bug #2614636

Change-Id: If9ded9a2e231a429e4d0a21626b486f76fd0a3a6
2010-04-28 13:32:43 -07:00
Joe Onorato 87d2ca8a66 Fix 2614384 - NPE in LauncherModel
Callbacks can be null.

Change-Id: I56462a54673b1804a6235d6d882008b453290542
2010-04-21 17:09:18 -04:00
Joe Onorato d65d08e709 Fix race in LauncherModel that causes it to show duplicate icons.
Change-Id: I78130d6f237f476bc33a4718ca5ef245fe502857
2010-04-21 11:43:04 -04:00
Daniel Sandler 2ff10b3b01 More Launcher performance improvements.
* 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
2010-04-16 15:17:01 -04:00
Daniel Sandler dca661236c 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
2010-04-14 14:36:10 -04:00
Joe Onorato ac03330c96 Fix 2583234 - It's ok for mCallbacks to be null.
Change-Id: Iec8df7b668a4657677f9c5421d00aa1b7df91015
2010-04-13 17:19:18 -07:00
Joe Onorato 8ddc4fdba0 Add a log message and some todos.
Change-Id: I948997d169d1833f2b61c620a02dbccae535e8de
2010-03-17 10:24:53 -07:00
Joe Onorato d8d22da5ca Bug 2509023 - NPE on upgrade to froyo
Change-Id: I07cb4f272948062b47da8826ca917fd74ad18404
2010-03-11 17:59:11 -08:00
Joe Onorato c131b74922 Eliminate a race where old Launcher objects will continue to get callbacks for loading if they go
away before they're done.

Change-Id: Id9f57be482da428750285c86d95114d2652064e6
2010-03-11 15:45:05 -08:00
Joe Onorato e74daedc3b Fix 2507267 - stack overflow when adding shortcut
Change-Id: Ife5bea443debd481854693b3924e72a04fb66f97
2010-03-11 12:32:24 -08:00
Joe Onorato 56d8291af6 Apps on SD card don't confuse the launcher any more. They show up properly after reboots,
mounting and unmounting.

Change-Id: Icd861dcd8ac6401c597e2f9c8e2c66dff1cf9c61
2010-03-10 15:11:45 -08:00
Joe Onorato 64e6be78dc Refactor the app updates so that it doesn't rely on the package name.
This will be needed for the upcoming change to update the icons with the
grayed out when the SD card goes away.
2010-03-10 13:42:32 -08:00
Romain Guy edcce099c9 Fix the build! 2010-03-04 13:03:17 -08:00
Joe Onorato 0589f0f66c Split ApplicationInfo into ApplicationInfo which is used for AllAppsView and ShortcutInfo which is
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.
2010-02-12 12:18:40 -05:00
Romain Guy 629de3ef73 Remove widgets when the corresponding apk is uninstalled.
Bug #2298872
2010-01-13 12:20:59 -08:00
Romain Guy 5c16f3ecd6 Remove LiveFolders when corresponding package is uninstalled.
Bug #2298872
2010-01-12 17:24:58 -08:00
Bjorn Bringert 7984c9496b Get rid of the built-in search widget in Launcher2
Uses the widget from packages/apps/QuickSearchBox instead.

Change-Id: I85d64defe155c0cad97fafef6a3db62c6cab504a
2009-12-09 21:48:38 +00:00
Joe Onorato b0c27f254a Bug 2290800 - Use a collator to sort the app labels.
SHAME ON ME for using String.compareTo().
2009-12-01 16:20:30 -08:00
Joe Onorato 418928e9d0 Fix bug 2223769 - Uninstalling app causes NPE.
The check for whether there is anything in these lists should be sufficient.  The other
variables don't need to also be checked.
2009-11-19 18:05:36 -08:00
Joe Onorato 0c4513e559 This might fix bug 2262272 - Apps list empty
I'm not sure how .added is empty, but the only way I see for this
to happen is if it is, so use .data instead, which ought to be the
same.
2009-11-19 12:24:48 -08:00
Joe Onorato be38609f87 Add a lot of logging that can be seen by doing adb shell setprop launcher2.dumpstate 1 and presssing volume down 2009-11-17 18:04:52 -08:00
Joe Onorato 1db7a972bf Fix 2260199 - App icons placed in folder widget are doubled after rebooting phone.
I don't know why I did this piecemeal instead of just fixing it for widgets items and folders all at
once.
2009-11-16 18:32:22 -08:00