Commit Graph

37 Commits

Author SHA1 Message Date
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
Winson Chung
5f4e0fdd2e Moving all apps code into sub package.
- Renaming resources, dimens, etc to be more consistent
- Removing old AppsCustomize resources and other unused code

Change-Id: I15ce35e7cb7a9b9344fc7103963e4e4c9e45d89a
2015-05-22 12:21:40 -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
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
Winson Chung
05304db905 Reducing delay in applying widget previews loaded in the background.
- Push the writing of previews to the DB to the worker thread
  to ensure that we can apply the loaded preview as soon as
  possible.
- Reducing additional bitmap allocations from cancelled tasks
  that did not re-add their bitmaps to the unused set
  (happens when the list is scrolling quickly).

Change-Id: Ib7c2cfdfcc668c215b3a74271e1165235fbdf752
2015-05-20 10:56:54 -07:00
Winson Chung
78b19667da Removing some dead code and extra view creation.
b/21133230
2015-05-15 21:31:13 +00:00
Hyunyoung Song
6babf2e27e Place the work profile badge in the correct bottom right (left for RTL)
location

Also:
- clean up of some code
- remove requestLayout() method call that is not needed.

b/20338602

Change-Id: I65e0e1ac40da2e3fa85af4d3aca54bed3f200a99
2015-05-14 17:08:45 -07: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
Hyunyoung Song
559d90d0da WidgetPreviewLoader concurrency issue / Caching improvement
1) Concurrency issue: unused bitmap was not properly synchronized
which caused concurrency issue. Hence, leading current widget tray
implementation to not use it. (a.k.a. cancel(false)).
Issue fixed and now using the unused bitmap pool.

2) Caching improvement: LoadedBitmap cache was a legacy support system
for the old widget tray implementation. On our latest implementation,
cache and recycled view is completely being managed by the recycler view.
Hence removed.

Change-Id: I843e6a286b676f283172f2c1ef5cbeed0a9fb17f
2015-04-28 15:06:45 -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
Sunny Goyal
5b0e669169 Rewrite: Widget preview loader logic
> Widget previews are saved in data dir instead of cache dir
> Expiring widget previews similar to IconCache
> Removed support for setting thread priorities

Bug: 19865031
Change-Id: Ib6033c2b1ff8ae61bba8762ca994ccd8217d3c75
2015-03-20 17:31:11 -07:00
Adam Cohen
091440a9cb Reducing method count by eliminating synthetic accessors
Elimates 304 methods based on dex analysis

The java compiler generates sythetic accessor methods for all private
fields, methods and contructors accessed from inner classes. By marking them
package-private and @Thunk instead, sythentic accessor methods are no
longer needeed. These annotated elements should be treated as private.

Change-Id: Id0dc2c92733474250d8ff12fa793d3a8adeb1f26
2015-03-20 11:15:54 -07:00
Sunny Goyal
4cad7538c9 Cleaning up widget preview loader
> Removing unnecessary canvas cache
> Removing unnecessary new bitmap creation

Change-Id: Ic9f45c5a204ea4d32dbf93c21a6a7fd6baea4b51
2015-03-18 22:20:20 -07:00
Winson Chung
b745afbdd7 Initial changes to break out AllApps into its own view.
- Moves launcher state-transition code into its own class
- Moves all-apps related code into a separate view/set of classes
- Implements a basic list view for all apps

Change-Id: I68f174aa9e1bf82c4e46ce9549c78a8dc4623f46
2015-03-10 18:14:22 -07:00
Adam Cohen
30914ad14d Merge "Supporting custom widgets provided by launcher" into ub-now-master 2014-12-06 00:22:43 +00:00
Adam Cohen
5940042d39 Supporting custom widgets provided by launcher
-> This change provides integration for widgets provided by
   the launcher package which can run arbitrary code.

Change-Id: I6052da5c4afed7ee72e3b44d045b9c46f2d84c42
2014-12-05 16:18:41 -08:00
Adam Cohen
0250945759 Avoid db exception on L and above
Bug 18554839

Change-Id: I43f391b7cc376f697ce7b5b363e8be3aa85814b5
2014-12-04 10:35:52 -08:00
Winson Chung
5f05913f71 Ignoring specific db exception to workaround Bug. 18554839.
Change-Id: I80f2dd62297eea671f2d129ae22263e72e506ae4
2014-12-01 15:06:47 -08:00
Sunny Goyal
736f5af04c Fixing some IconCache methods not thread safe
Bug: 17981568
Change-Id: I0d49604c2e38bc9017cba527d87e24e8b086f1da
2014-10-16 14:08:47 -07:00
Helena Josol
4fbbb3e3e0 Create a central list of files the Launcher writes to the app directory
Replace hardcoded Launcher filenames with the defined constants.

Bug: 12753154
Change-Id: I072f202d9388a703b9e6851bde64ea7fafe4b10a
2014-10-06 17:08:10 +01:00
Sameer Padala
8fd74831de Source change to get code compiling on google3
Change-Id: Ib16df8dd9caa04903a664d8cf92767107fe57628
2014-09-22 15:17:18 -07:00
Sunny Goyal
ffe83f1331 Adding support for managed profiles in widget
issue: 16892811

Change-Id: If8c81f2a5a3bc846b02a5d225c5a8f27b1382dab
2014-08-20 17:09:18 -07:00
Adrian Roos
fa9ffc28fd Fix NPE in WidgetPreviewLoader
Change-Id: Ic746f2a5e4237a9ea82abf5f9532307d40432ac1
2014-05-14 13:06:47 +02:00
Adrian Roos
1f375ab633 Dump open files if we run out of file descriptors
Bug: 12782843
Change-Id: I7254c2cb6c3f721a06b9301d674c9560f86dfde6
2014-04-29 23:15:01 +02:00
Adrian Roos
65d60e21ec Fix skia crash in widget preview loading
This fix works making sure all drawables are mutated before drawing
them in the background. Mutation has to be executed on the main
thread because that operation is not thread safe.

Bug: 12525890
Change-Id: Id7bdf9cf48d3e7b7f31938bdea4a3bf1632cf337
2014-04-16 14:16:14 +02:00
Adrian Roos
fa4c799a9b Fix concurrent drawable usage resulting in native crash
One of widget preview drawables was drawn concurrently from a thread pool,
causing a native Skia crash.

Bug: 12525890
Change-Id: I2dea7b86ba8b32237f40feff225657dcb2b0061b
2014-03-19 16:29:30 +01:00
Adrian Roos
5d2704fbb0 Clean up dead, ugly and wrong code in icon and widget preview loading
Removed and fixed serveral instances of dead code and small
bugs that grew in the widget preloading logic, discovered
while chasing a bug.

Bug: 12525890
Change-Id: I22e03eccecc07b73388cfd3c8462d947601c6e54
2014-03-19 16:27:35 +01:00
Michael Jurka
6e27f642ae Recover when widget preview database is deleted
Bug: 12109621

Change-Id: I8d59700d31d6856d6151b965786c87585801317b
2014-01-09 14:41:32 +01:00
Michael Jurka
8ff02cac07 Clear widget preview cache when system is updated
Bug: 11325218
2013-11-01 14:20:57 +01:00
Chris Wren
fd13c714f4 backup widget assets.
Bug: 10778984
Change-Id: I842a88c517401fa4eb3798fd03e0fbc3634e3144
2013-10-03 12:57:52 -04:00
Winson Chung
45cab39eea Tweaking the front cling to support more verbose languages. (Bug 11015051) 2013-10-02 17:45:32 -07:00
Winson Chung
6706ed8266 Updating widget preview tile. 2013-10-02 11:00:28 -07:00
Michael Jurka
eb1bb92050 Recover when reading corrupted widget previews
Bug: 10785722
2013-09-26 11:29:06 -07:00
Winson Chung
5f8afe6280 Initial Changes for Dynamic Grid
Change-Id: I9e6f1e5167791cf8dc140778dfa447f86424e9bf
2013-08-20 10:56:05 -07:00
Daniel Sandler
e4f9891f01 Lazily instantiate LauncherAppState.
The application context for LauncherAppState is supplied by
the application whenever it starts; don't ask for an
instance before that.

Change-Id: I1ca8ea04238a357a682f79250f08813ead7ae532
2013-06-27 15:17:11 -04:00
Daniel Sandler
cc8befac35 Move LauncherApplication's state and code to LauncherAppState.
This removes Launcher's static data and other state out of
the Application object. Now LauncherApplication (extends
Application) exists only to instantiate LauncherAppState.

Change-Id: I4e323bd78b77536b92054105536a55c0c2c19ba8
2013-06-11 22:01:47 -04:00
Daniel Sandler
325dc23624 Launcher2 is now Launcher3.
Changes include
  - moving from com.android.launcher{,2} to
    com.android.launcher3
  - removing wallpapers
  - new temporary icon

Change-Id: I1eabd06059e94a8f3bdf6b620777bd1d2b7c212b
2013-06-05 23:30:20 -04:00