Commit Graph

21 Commits

Author SHA1 Message Date
Sunny Goyal
87f784c285 Removing static Context access using LauncherAppState
> This ensures that LauncherAppState is only accessed in the presence of
a valid context

Bug: 33032833
Change-Id: I955e5cb022f8bd6374681ae6c0720a2666d5b750
2017-01-11 12:52:03 -08:00
Sunny Goyal
a52ecb0390 Removing all compatibility code below Lollipop
Bug: 32745285
Change-Id: I62971908e3e4402941fab627bbdfd47be64473a3
2016-12-16 15:05:09 -08:00
Sunny Goyal
7c74e4ae64 No more UserHandleCompat
Bug: 32745285
Change-Id: I762fb4e268c1afe48a1860ab12a4ccb3f626aa95
2016-12-15 22:06:10 -08:00
Sunny Goyal
ab121c1715 Adding a generic method to initiate overridable objects
Change-Id: Ia433427c65ad38804f2eed9c6bc209df232758c0
2016-12-12 17:01:11 +00:00
Sunny Goyal
712ee53c67 Catching TransactionTooLargeException when binding widget.
A widget can potentially bypass binder size limit with remote views when
using partual updates (as the merging happens on the system service). In
such a case, show the widget in error state.

Bug: 32365088
Change-Id: Id1c4425958a06463273731464e31f05908c35ec7
2016-11-09 12:43:11 -08:00
Sunny Goyal
d164b7f4ab Fixing static instance of Indexer being created in the model
Indexer depends on the locale and should be created when ever the config
changes. Moving the widget indexing to the adapter (similar to allApps)
which gets created whenever the activity is recreated.
This fixes the bug where widgets indexing breaks if locale changes while launcher
process is alive
Also fixing the bug in widget model cloning where the HashMap was not cloning
the underlying ArrayList

Change-Id: I7dbe6290e73299c4c07aa7fa564077a2649e1a4c
2016-10-19 07:42:34 +01:00
Sunny Goyal
6388b2c61b Adding some utility methods for thread verification
Change-Id: I3fb6a1b860bba8a6efe413dd2698f972dc3e2506
2016-04-15 18:03:50 -07:00
Sunny Goyal
4ddc40130a Creating WidgetCellItem to wrap LauncherAppWidgetProviderInfo and resolveInfo
In PackageItemInfo,, using the user of the first item in the sub-list

Bug: 27585511
Change-Id: I8243f0e5c831af65661ae815489e53e9fcade837
2016-03-18 11:06:01 -07:00
Sunny Goyal
2e1efb480a Changing the widget loading strategy
Widget is loaded only when the user enters the overview mode and we keep
the list updated as long as the user is in the overview mode. Once the user
leaves the overview mode, we stop responding to widget updates

Bug: 26077457
Change-Id: I9e4904b8f1300bfe0d77e2bc5f59aa6963fad8d1
2016-03-09 20:21:22 -08:00
Hyunyoung Song
d31dcbcc7c Manual revert due to conflict:
Revert "Load label in bg thread to prevent ANR b/27238970"

This reverts commit b62fd09576.

Change-Id: Ia751e3414fb24a18bb8bb9ca09dcd93d0e4249f6
2016-02-23 11:36:21 -08:00
Hyunyoung Song
b62fd09576 Load label in bg thread to prevent ANR
b/27238970

Change-Id: Ic5d77df7d5276cee07861d59427a94fb19691d9c
(cherry picked from commit 72a9953cf4)
2016-02-23 00:45:56 +00:00
Sunny Goyal
6a706b1dd7 Preventing nullpointer exception when cloning rawList
Bug: 24299525
Change-Id: I92018a3da7d75afc2c6997302f8e0492eb78e62f
2015-09-22 16:56:55 -07:00
Sunny Goyal
233ee964a9 Calculating widget minSpans and spans statically/independent of orientation
> Filtering the widget list and excluding widgets which dont fit the grid
 > setting minSpans for the widget item when binding.

Bug: 22541314
Bug: 22559137
Change-Id: Ieda48b56c95bee0c7ec71dd691af7e23e2d43db6
2015-08-03 16:39:49 -07:00
Winson Chung
eea0225304 Fixing minor memory leak with name comparator.
- WidgetsAndShortcutNameComparator was using the actual widget and shortcut resolve
  infos as the key to the label cache.  Neither of these classes override hashCode()
  and we were retrieving a new set of widgets and shortcuts whenever packages changed
  so we would end up creating more and more entries in the cache.  This isn't a huge
  leak, but could lead to problems if Launcher is used for long periods without being
  killed.
- Now, we use a ComponentKey as the key, so that we don't keep a reference to the
  widget/shortcut infos and also ensures that they should hash to the same labels.

Change-Id: I91347ee72363adbc2b075b67dba331e35ab1fe34
2015-07-27 18:35:28 -07:00
Hyunyoung Song
f63dda5e15 Query the title and icon for app using correct user handle.
> Note: when there are corp and regular user profile widget providers,
it is guaranteed that regular user profile widget provider is always
queried first. Thsi is guaranteed because inside AppWidgetManagerCompat.getProviders(),
regular user always takes prescedence when iterating thru different providers
associated to different users.

Change-Id: I5e38e1fb30925ccba7e1e2925fd3e77c44a14901
2015-07-16 17:24:30 -07:00
Hyunyoung Song
f56513f6ba Hide spammy WidgetModel log behind a DEBUG flag
Change-Id: I0119855655516d9fdc114334a974b8766aabf674
2015-07-13 10:26:22 -07: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
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
Hyunyoung Song
ec84728b27 Consistent scrolling experience for All apps and widget tray
b/21375339

Change-Id: I8362b3ca94b7c4e75932d42cd09a989e0e3919c0
2015-06-04 11:37:46 -07: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
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