summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/WidgetPreviewLoader.java
Commit message (Collapse)AuthorAgeFilesLines
* Prevent widget previews from showing empty images.Artem Shvadskiy2016-05-031-78/+160
| | | | | | | | | | | | | | | | | | | | When scrolling through the widget drawer, we submit multiple AsyncTasks to load and display preview images. On certain devices, attempting to load these images from AppWidgetManagerCompat (when we are generating previews for the first time) on a multi-threaded executor can cause us to receive empty images. To avoid this, we allow preview loading from the cache on a multi-threaded executor, but defer preview generation to a single-threaded executor. Additionally, the read and write db methods were not using the same ComponentName output (flattenToString vs flattenToSimpleString), which was resulting in consistent cache misses that forced unnecessary preview regeneration. This has been unified so we properly load from the cache. Change-Id: I3a90cf88fed531713e5d2df876f4ede822f7d569 issue-id: FEIJ-346
* Handle theme changesClark Scheff2015-12-161-1/+8
| | | | | | | issue-id: CYNGNOS-1434 NIGHTLIES-2149 Change-Id: I85208f3d6b572fb7a161db79cd3b74c1102dbba2 (cherry picked from commit 50f78e36b079bbe14bcb50064d28940358d42544)
* Refreshing widget list when a package containing a widget changesSunny Goyal2015-08-111-1/+1
| | | | | Bug: 20698931 Change-Id: I50bafac1fc0a855edb1ace633a8a6f87a5c3040e
* Using a reverse hashmap instead of indexOfValue in userManagerSunny Goyal2015-08-051-10/+1
| | | | | Bug: 22980139 Change-Id: I87b633d194ff4e1529dd679dc02da573ed374207
* Calculating widget minSpans and spans statically/independent of orientationSunny Goyal2015-08-031-2/+2
| | | | | | | | | > 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
* Prevent from widget cell preview image from being cut off.Hyunyoung Song2015-07-301-2/+2
| | | | | | | | | | b/22541466 >TL;DR;; when introducing mProfileBadgeMargin to correctly place > work profile badge. Drawing origin of the preview image resulted > to the left of (0, 0). Change-Id: Ic52fc2e17c55c76f4f57aa833451ffa19bbbeb09
* Fixing nullpointer when creating new DBSunny Goyal2015-06-161-2/+2
| | | | | LauncherProvider is not ready until the DBHelper is created Change-Id: Iabd61005892f15fd4a31d882100d87df2b2a7b85
* Merge "Fix last bit of WidgetTray jank issue b/21133230" into ↵Hyunyoung Song2015-06-161-8/+20
|\ | | | | | | ub-launcher3-burnaby
| * Fix last bit of WidgetTray jank issueHyunyoung Song2015-06-161-8/+20
| | | | | | | | | | | | b/21133230 Change-Id: Ic198b8d21be1b0f3465cd4efc30a240e3ec4304a
* | Removing ContentObserver in launcherSunny Goyal2015-06-161-1/+2
|/ | | | | | | > Using callback insted of using a content observer > Setting the listener in LauncherAppState to prevent resource leak Change-Id: Id23a4d5c8812e86178997e536226e09ec3740f84
* Work profile badge alignmentHyunyoung Song2015-06-151-4/+6
| | | | | | b/21336417 Change-Id: Icd54320fa0d0976cac0ae66d180cc2c99ddd0c1c
* Improve AyncTask throughput inside WidgetPreviewLoaderHyunyoung Song2015-06-051-10/+10
| | | | | | | | | | | | | | | | b/21133230 > Synchronized block was creating a bottleneck for the AsyncTasks. > Remove calls that doesn't need to be synchronized outside synchronized block. > Also removed setAlpha call as after the bottleneck was removed, Inefficient alpha view usage alert started popping up in traceview. Due to less jankness, removing the fadein animation doesn't have any visible effect. Link to lock congestion visualization: https://x20web.corp.google.com/~hyunyoungs/no_crawl/traceview/traceview_lockcontention.html Result: gfx-avg-jank delta = "-1" Change-Id: If12817df0730f346cdba7e2f38f232eb9a4336c0
* Removing some synthetic method creationSunny Goyal2015-06-021-10/+9
| | | | | | > Make package-private and @Thunk all private methods and constructors accessed from inner classes. Change-Id: Ie5913860a0c33e48e9bf68f9b5b1699f64c2f174
* Moving all apps code into sub package.Winson Chung2015-05-221-2/+0
| | | | | | | - Renaming resources, dimens, etc to be more consistent - Removing old AppsCustomize resources and other unused code Change-Id: I15ce35e7cb7a9b9344fc7103963e4e4c9e45d89a
* Refactoring DeviceProfileAdam Cohen2015-05-211-22/+20
| | | | | | | | | | | | | | | | | | | | -> 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
* Load PackageItemInfo in background thread to prevent ANRHyunyoung Song2015-05-211-2/+1
| | | | | | | | | | | - 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
* Reducing delay in applying widget previews loaded in the background.Winson Chung2015-05-201-26/+74
| | | | | | | | | | | - 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
* Removing some dead code and extra view creation.Winson Chung2015-05-151-1/+1
| | | b/21133230
* Place the work profile badge in the correct bottom right (left for RTL)Hyunyoung Song2015-05-141-1/+1
| | | | | | | | | | | | location Also: - clean up of some code - remove requestLayout() method call that is not needed. b/20338602 Change-Id: I65e0e1ac40da2e3fa85af4d3aca54bed3f200a99
* WidgetTray performance improvement (less sorting): Part 1Hyunyoung Song2015-05-041-2/+9
| | | | | | | | | | - 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
* WidgetPreviewLoader concurrency issue / Caching improvementHyunyoung Song2015-04-281-45/+20
| | | | | | | | | | | | | | 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
* WidgetTray revamp workHyunyoung Song2015-04-081-5/+11
| | | | | | | | | | | | | | | | | | | | | | | - 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
* Rewrite: Widget preview loader logicSunny Goyal2015-03-201-381/+377
| | | | | | | | | > 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
* Reducing method count by eliminating synthetic accessorsAdam Cohen2015-03-201-3/+4
| | | | | | | | | | | 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
* Cleaning up widget preview loaderSunny Goyal2015-03-181-225/+95
| | | | | | | > Removing unnecessary canvas cache > Removing unnecessary new bitmap creation Change-Id: Ic9f45c5a204ea4d32dbf93c21a6a7fd6baea4b51
* Initial changes to break out AllApps into its own view.Winson Chung2015-03-101-2/+2
| | | | | | | | - 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
* Merge "Supporting custom widgets provided by launcher" into ub-now-masterAdam Cohen2014-12-061-10/+8
|\
| * Supporting custom widgets provided by launcherAdam Cohen2014-12-051-10/+8
| | | | | | | | | | | | | | -> This change provides integration for widgets provided by the launcher package which can run arbitrary code. Change-Id: I6052da5c4afed7ee72e3b44d045b9c46f2d84c42
* | Avoid db exception on L and aboveAdam Cohen2014-12-041-4/+2
| | | | | | | | | | | | Bug 18554839 Change-Id: I43f391b7cc376f697ce7b5b363e8be3aa85814b5
* | Ignoring specific db exception to workaround Bug. 18554839.Winson Chung2014-12-011-8/+21
|/ | | | Change-Id: I80f2dd62297eea671f2d129ae22263e72e506ae4
* Fixing some IconCache methods not thread safeSunny Goyal2014-10-161-1/+1
| | | | | Bug: 17981568 Change-Id: I0d49604c2e38bc9017cba527d87e24e8b086f1da
* Create a central list of files the Launcher writes to the app directoryHelena Josol2014-10-061-2/+2
| | | | | | | Replace hardcoded Launcher filenames with the defined constants. Bug: 12753154 Change-Id: I072f202d9388a703b9e6851bde64ea7fafe4b10a
* Source change to get code compiling on google3Sameer Padala2014-09-221-2/+2
| | | | Change-Id: Ib16df8dd9caa04903a664d8cf92767107fe57628
* Adding support for managed profiles in widgetSunny Goyal2014-08-201-111/+96
| | | | | | issue: 16892811 Change-Id: If8c81f2a5a3bc846b02a5d225c5a8f27b1382dab
* Fix NPE in WidgetPreviewLoaderAdrian Roos2014-05-141-5/+8
| | | | Change-Id: Ic746f2a5e4237a9ea82abf5f9532307d40432ac1
* Dump open files if we run out of file descriptorsAdrian Roos2014-04-291-0/+98
| | | | | Bug: 12782843 Change-Id: I7254c2cb6c3f721a06b9301d674c9560f86dfde6
* Fix skia crash in widget preview loadingAdrian Roos2014-04-161-3/+24
| | | | | | | | | 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
* Fix concurrent drawable usage resulting in native crashAdrian Roos2014-03-191-3/+12
| | | | | | | | One of widget preview drawables was drawn concurrently from a thread pool, causing a native Skia crash. Bug: 12525890 Change-Id: I2dea7b86ba8b32237f40feff225657dcb2b0061b
* Clean up dead, ugly and wrong code in icon and widget preview loadingAdrian Roos2014-03-191-29/+25
| | | | | | | | | 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
* Recover when widget preview database is deletedMichael Jurka2014-01-091-20/+47
| | | | | | Bug: 12109621 Change-Id: I8d59700d31d6856d6151b965786c87585801317b
* Clear widget preview cache when system is updatedMichael Jurka2013-11-011-0/+22
| | | | Bug: 11325218
* backup widget assets.Chris Wren2013-10-031-4/+3
| | | | | Bug: 10778984 Change-Id: I842a88c517401fa4eb3798fd03e0fbc3634e3144
* Tweaking the front cling to support more verbose languages. (Bug 11015051)Winson Chung2013-10-021-1/+1
|
* Updating widget preview tile.Winson Chung2013-10-021-1/+1
|
* Recover when reading corrupted widget previewsMichael Jurka2013-09-261-5/+22
| | | | Bug: 10785722
* Initial Changes for Dynamic GridWinson Chung2013-08-201-2/+4
| | | | Change-Id: I9e6f1e5167791cf8dc140778dfa447f86424e9bf
* Lazily instantiate LauncherAppState.Daniel Sandler2013-06-271-2/+0
| | | | | | | | The application context for LauncherAppState is supplied by the application whenever it starts; don't ask for an instance before that. Change-Id: I1ca8ea04238a357a682f79250f08813ead7ae532
* Move LauncherApplication's state and code to LauncherAppState.Daniel Sandler2013-06-111-1/+1
| | | | | | | | 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
* Launcher2 is now Launcher3.Daniel Sandler2013-06-051-0/+610
Changes include - moving from com.android.launcher{,2} to com.android.launcher3 - removing wallpapers - new temporary icon Change-Id: I1eabd06059e94a8f3bdf6b620777bd1d2b7c212b