Commit Graph

508 Commits

Author SHA1 Message Date
Hyunyoung Song
c1d53ef81c Merge "Widgets model should respect AppFilter." into ub-launcher3-burnaby 2015-06-18 04:29:52 +00:00
Hyunyoung Song
eaf291b9fe Widgets model should respect AppFilter.
> This pattern is already used in AllAppsList
> mBgWidgetsModel variable cleanup inside LauncherModel.

b/21739736

Change-Id: I03a05064ce3c3e5effb09055af9f4d4de2811c95
2015-06-17 21:12:44 -07:00
Sunny Goyal
b1622cc30f Deleting empty folders based on DB state
> Previously folders were getting deleted based on in-memory
loader state. If for some reason, an item failed to load, we would
delete the folder from DB as well.

Bug: 21354058
Change-Id: I5318ee8a99afa9cafd93ed2b9ef0e155f502a41b
2015-06-12 12:38:16 -07:00
Hyunyoung Song
3abd5488cc Catch TransactionTooLargeException when loading widget provider list
b/19904873

Change-Id: Ic0d13ee7513731706bc0f9fde8502acba0899cb3
Note: fix for almonte will be separate due to diff btw the branches..
2015-06-08 18:41:04 -07:00
Sunny Goyal
4f3e9383eb Code cleanup
> Removing obsolete logging
> Removing unused methods
> Removing resource leak warning due to non-static handler class in launcher

Change-Id: Ic38cc8aea82899b0b5ee3235f04e5964e49245fb
2015-06-05 00:34:06 -07:00
Sunny Goyal
091f0ffd92 Updating widget list when iconCache updates
> Fixing bug where items were not getting removed from the memcache
> Fixing bug where package entries were not getting removing because
of component mismatch.

Bug: 21612532
Change-Id: Ie56f3272f7fb7e1a37c5ff9bfa523d814edc1a02
2015-06-04 15:21:23 -07:00
Sunny Goyal
53d7ee4285 Fixing different bitmap sizes in different orientations
> Using a single bitmap icon size
> Picking up appropriate density for satisfy the required icon size
> Fixing some icon size assumptions during icon animations

Bug: 19514688
Change-Id: Ia7a1d0d2c03a9d39ccc241fa4ae3eb8a0f374585
2015-06-03 19:07:44 -07:00
Sunny Goyal
316490e636 Removing some synthetic method creation
> Make package-private and @Thunk all private methods and constructors accessed from inner classes.

Change-Id: Ie5913860a0c33e48e9bf68f9b5b1699f64c2f174
2015-06-02 10:04:59 -07:00
Hyunyoung Song
8f10dc21a0 Merge "Fix widget tray crash on screen rotation introduced by ag/694693" into ub-launcher3-burnaby 2015-05-22 21:51:57 +00:00
Hyunyoung Song
9110d485fa Fix widget tray crash on screen rotation introduced by
ag/694693

b/21402209

Change-Id: Idae97fca971d90f5fbba658411491147cb023c8d
2015-05-22 14:49:23 -07:00
Adam Cohen
2e6da1539b Refactoring DeviceProfile
-> Pulling out the parts of device profile which can (and need to be)
   initialized and accessed without access to an Activity context,
   ie. the invariant bits.
-> The invariant bits are stored in InvariantDeviceProfile which is
   initialized statically from LauncherAppState.
-> The DeviceProfile contains the Activity context-dependent bits,
   and we will create one of these for each Activity instance, and
   this instance is accessed through the Launcher activity.
-> It's possible that we can continue to refactor this such that
   all appropriate dimensions can be computed without an Activity
   context (by only specifying orientation). This would be an
   extension of this CL and allow us to know exactly how launcher
   will look in both orientations from any context.

Sets the stage for some improvements around b/19514688

Change-Id: Ia7daccf14d8ca2b9cb340b8780b684769e9f1892
2015-05-21 16:16:40 -07:00
Sunny Goyal
5c97f51fd9 Icons are not updated to TYPE_APPLICATION during restore
> Use low res only for app shortcuts
> Running icon migration after restore
> Running icon migration again for all users
> Deduping shortcuts added from widget tray

Bug: 20945600
Change-Id: I3bb47545fdd9832510069026fbae8966d2311cc1
2015-05-21 13:34:07 -07:00
Sunny Goyal
324d78358c Merge "Breaking icon update task so that it doesn't block worker thread" into ub-launcher3-burnaby 2015-05-21 20:31:37 +00:00
Hyunyoung Song
edc9c05644 Merge "Load PackageItemInfo in background thread to prevent ANR" into ub-launcher3-burnaby 2015-05-21 20:25:16 +00:00
Hyunyoung Song
2bd3d7d1cb Load PackageItemInfo in background thread to prevent ANR
- Decoupled widget model from widget view, and placed the
creation to LauncherModel.
- As a result packagemanager operation, iconcache retrieval is all done inside
LauncherModel on background thread
b/21311085
b/21325319

Change-Id: I294698527db58b89f3da558090a367530c058776
2015-05-21 13:04:53 -07:00
Sunny Goyal
a508e4f804 Do not trim folder title
Bug: 21297281
Change-Id: I633780f8207aabc8362f016e6b5a6e720cee1b86
2015-05-21 09:33:57 -07:00
Sunny Goyal
75b0f552ae Breaking icon update task so that it doesn't block worker thread
Bug: 20945600
Change-Id: Iaf516577898b51ad6e8a813d7f018ecad969c100
2015-05-21 09:18:27 -07:00
Sunny Goyal
f3a21c8ca2 Merge "Moving LauncherAccessibilityDelegate to accessibility package" into ub-launcher3-burnaby 2015-05-20 04:15:34 +00:00
Hyunyoung Song
0b493c86c5 Unify sorting between all apps and widget tray
- selected locale names are shown before latin
- case independent sorting
- main app > enterprise app

Future possible refactoring:
- Move all the *ItemInfo data structures to model package
- Rename the comparator based on NOT what data structure it supports
but what functionality it supports (locale? case independent?
main app > enterprise app?)

b/21271658
b/20339403

Change-Id: I8a776467392e21d5014e85cd3f51931a3ef89724
2015-05-19 13:39:44 -07:00
Sunny Goyal
83a8f042ad Moving LauncherAccessibilityDelegate to accessibility package
Change-Id: I510204a5a12abf2da2757f3e3f8b0e8869a6b04a
2015-05-19 12:52:30 -07:00
Sunny Goyal
2bba4c37c6 Removing some thread priority management logic
> Not saving folder id in onSaveInstance as it is not used.

Change-Id: I176beb77cafe27ec4b7500d65dc86287d2f2e0cb
2015-05-18 15:57:14 -07:00
Sunny Goyal
f5cd998c25 Starting the loader if the previous loader is not complete, instead of binding page synchronously
Bug: 21107637
Change-Id: If04952c7d5c8a38a739ce5536ecac394011ab61a
2015-05-18 15:22:47 -07:00
Sunny Goyal
a214a63bfe Preventing homscreen getting filled with secondary user apps, when launcher
starts for the first time

> Sorting the apps in the work folder by install time

Change-Id: Ia475b4ff3197d90e6dffe070c12c0aa16be9e292
2015-05-15 11:53:10 -07:00
Sunny Goyal
1936ec048c Removing empty folders in loader
Bug: 21050720
Change-Id: Id174bb1e18b070e32273d66649f0e286e3546f89
2015-05-12 11:03:24 -07:00
Winson Chung
82b016cb56 Trim all whitespace from titles and labels.
Bug: 20953160

Change-Id: I1610df5e445a4139522226f68fa6439926bc70c6
2015-05-08 22:22:39 -07:00
Hyunyoung Song
219d048711 Widgets should also be bound when binding all apps.
b/20915830

Change-Id: I772156f8a8d361f485fb4d7edc447c2cee2edf23
2015-05-07 12:51:42 -07:00
Sunny Goyal
8a8f03d10a Merge "Skipping package update tasks if loader has not yet run." into ub-launcher3-burnaby 2015-05-07 17:08:24 +00:00
Sunny Goyal
c905efc89c Skipping package update tasks if loader has not yet run.
Bug: 20754508
Change-Id: Id2ddcff42cd41e4f9875ad6ef95f648365502b75
2015-05-06 16:59:02 -07:00
Sunny Goyal
77919b93b9 Updating the icon cache after all apps has been bound.
> Updating the cache DB version to reset existing cache.

Bug: 20834835
Change-Id: I298ca9ddcc4dd270b25b767447ecde01ef41a916
2015-05-06 16:54:08 -07:00
Sunny Goyal
deb189fd10 Merge "Adding workprofile shortcuts after the loader has completed" into ub-launcher3-burnaby 2015-05-06 16:48:47 +00:00
Hyunyoung Song
9892e58740 Use valid context inside LauncherModel when calling loadAndBindXXX
b/20851075

Change-Id: Ie3feb387a142d4e11a0a18bbcc4fd4932cfe4439
2015-05-05 10:08:29 -07:00
Hyunyoung Song
227239e7c0 update widgets model when package is updated
Fixing a bug where onProviderChanged is called before Package update.
And icon loaded on the widget tray is the default icon.

Change-Id: I4ffea846d057920fd894537432ac5881642bc570
2015-05-04 18:17:35 -07:00
Hyunyoung Song
80068f518c Merge "WidgetTray performance improvement (less sorting): Part 1" into ub-launcher3-burnaby 2015-05-04 23:28:55 +00:00
Hyunyoung Song
8821ca9a6a WidgetTray performance improvement (less sorting): Part 1
- No longer return sorted list from the package manager since, the only
time the widget list requires to be sorted is when recycler view renders
them.
- Made getWidgetsAndShortcuts private to guarantee that widgets are
being loaded in the worker thread.

Change-Id: I2c35973c1226e831514380dd38fc2f88b1b91d02
2015-05-04 16:28:20 -07:00
Sunny Goyal
756a28aeec Adding workprofile shortcuts after the loader has completed
Change-Id: Id466d8e164feeac427d969d6bc0ed3ca7a218ac4
2015-05-04 10:52:26 -07:00
Sunny Goyal
957c13f032 Handling managed profile creation in the model as the activity
can get killed in the background.

Change-Id: I95f62cf268fe642c9a2bb4975eb92bf8e12d23a9
2015-05-01 13:02:20 -07:00
Sunny Goyal
dfde999ccd Various managed profile fixes
> When matching existing shortcut, match the uri as intent doesn't implement equals
 > Fixing user matching when searching for apps in all-apps

Bug: 20749743
Change-Id: I14f3e2134e774727176e865d74108ef79de874d6
2015-05-01 12:32:31 -07:00
Sunny Goyal
a911672f45 Simplifying add to workspace by not going through the worker thread
Change-Id: I3260786bee257aea93ade49e6fa18008232addbe
2015-04-29 14:58:17 -07:00
Sunny Goyal
f7a29e83f0 Removing some unused method params from CellLayout
> Replacing various distance calculations with Math.hypot
> Moving findVacantCell to Utilities

Change-Id: I0cb194b603e52b3bb2b29a095bb4da2bb408ab13
2015-04-24 15:28:20 -07:00
Sunny Goyal
e2df0620c1 Adding LongArrayMap as a replacement for HashMap<Long, E>
Change-Id: I4710e6db69abcdbd897a8401fc8b980c09e2ffef
2015-04-24 12:35:29 -07:00
Sunny Goyal
d33860f2cc Clearing all pending runnables when Launcher is destroyed.
Change-Id: I00596c11116b5579c1f013b268b6c0b5239f0aa7
2015-04-23 16:18:40 -07:00
Sunny Goyal
756adbc3e4 Fixing missing updates in package install sessions
> Ensure icon cache never returns null icon
> Enabling install shortuct receiver only after workspace has finished binding
> Making all the model changes for package installs on worker thread and only
posting the updaes on the UI
> Making shortcut exists check on the loaded items and not on the DB
> Explicitely using worker thread for PckageInstallListener
> Removing backward compatibility support from PackageInstallerCompat

Change-Id: I9592771b9670c1c1c84c8208cae8dafa7b393e65
2015-04-22 10:08:14 -07:00
Sunny Goyal
7372fc659e Merge "Using a different userManager class as getUserForSerialNumber gives a valid userHandle for deleted user." into ub-launcher3-burnaby 2015-04-22 01:44:56 +00:00
Hyunyoung Song
d4af148444 Remove duplicate calls to getSortedWidgetsAndShortcuts
Note: this is a manual CP of the CL that was submitted to ub-launcher3-almonte

b/19904873

Change-Id: I2e56bc0c7524caa2ef3c5fb00f35cb032cd1860b
2015-04-21 16:07:30 -07:00
Sunny Goyal
7f834d2b30 Using a different userManager class as getUserForSerialNumber gives
a valid userHandle for deleted user.

> Also chaching the user handles during loader to avoid multiple
calls for UserManager

Bug: 19389411
Change-Id: I95af3b41b2c9d2ea41d9a75b1020656f57f5e4c9
2015-04-21 10:13:03 -07:00
Sunny Goyal
fa401a10e7 Updating drop button targets
> Splitting DeleteDropTarget into delete and uninstall
> Showing UninstallDropTarget for app shortcuts on workspace
> Showing InfoDropTarget only when developer options is enabled

Change-Id: I4396571d2199d1581bb9c733aef88ab9b0ebd79d
2015-04-16 15:52:04 -07:00
Sunny Goyal
18bf8e2ffd Automatically adding managed profile shortcuts to homescreen.
When the managed profile is created, a "Work" folder is created
and added to the homescreen. All work profile apps are added to this
folder and icons for subsequent installs (withing a fixed time frame)
are automatically added to this folder.
If this folder get deleted or the time-frame expires, icon for any new
install is placed on the homescreen.

Bug: 17410319
Change-Id: I49f4e437707d5eabe4eec85320765bf6ba7fde97
2015-04-10 19:37:13 -07:00
Hyunyoung Song
3f471440a8 WidgetTray revamp work
- RecyclerView is rendering
- Animation is connected
- Drag and drop is now handled
- UI tweaking: background, margins, more to come.
- Flicker and preview not loading issue:
  fixed height for the horizontal scroll view.
- Shortcuts are added
- Widget Preview loading should support shortPress for drop
- UI tweaks left: overlay of arrow when there are more items to scroll
- icons are added in the section header
- Sorting of widget sections and widget horizontal list
- Adding all the padding constants to dimen.xml file
- RecyclerView should only support one view type

For items to be addressed in follow up patches OR CLs,
TODO is added to the comment.

b/19897708

Change-Id: Ibfc4da1696a23d20bada93db46e126706eb13cdc
2015-04-08 19:01:34 -07:00
Winson Chung
c517f4ce65 Ensuring that work-profile applications are mixed in with other apps.
Bug: 20046158
Change-Id: I833c1a1467889db07f9ec33ca77641322901958e
2015-04-06 14:51:13 -07:00
Sunny Goyal
1d4a2df091 Removing ContentObserver from LauncherModel, and calling reload
whereever necessary

Change-Id: Ia4a8abdfe2be9703f3217a60527d3a1220b33bdc
2015-04-01 10:20:18 -07:00