Commit Graph

75 Commits

Author SHA1 Message Date
Annie Chin
17f85951a5 Introduce IconProvider.
Bug: 27506625

-Move managing of SystemState to IconProvider

Change-Id: I3417f0b7d0664c2255c7cc2a88f6c65822b5fb98
2016-03-28 14:07:22 -07:00
Sunny Goyal
2ae7736d09 Embedding the icon pixel size in the cache DB version.
This causes the cache to get reset when the icon size changes,
for eg, in case of display scale changes

Bug: 27701193
Change-Id: Ib11144757a93cb50fb233d855902c0b2c15afbed
2016-03-22 14:34:16 -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
499bbfa2ef Fixing black lowres icons
Bug: 27598858
Change-Id: Ib7c9b1e3abe54b94741e154bc8327d06f83e439c
2016-03-10 19:53:05 -08:00
Sunny Goyal
531cda693d Using a negative flag for icon notmalization
Change-Id: Iaa94aea730d2b5cc3f15f3578f240127ca0eef63
2016-03-03 13:30:57 -08:00
Sunny Goyal
d3b53c3fa4 Merge "Preventing launcher crashes due to low disk space." into ub-launcher3-burnaby-polish
am: 60acb943c6

* commit '60acb943c68e2f949fc8ad4703c9156549263897':
  Preventing launcher crashes due to low disk space.
2015-12-18 22:32:36 +00:00
Sunny Goyal
6f70936f7f Preventing launcher crashes due to low disk space.
In case of low disk space, all write operations to the IconCache are
silently ignored. This will not affect the Launcher behavior and
user will still see the latest icons, but in some cases, icon loading
would appear slow

Bug: 24585352
Change-Id: I85ccc519046fc3708403388bba89e019a3f2ce3d
2015-12-18 10:20:52 -08:00
Sunny Goyal
619c21e87b resolve merge conflicts of d896ee43cd to ub-launcher3-master.
Change-Id: If09db8d99e7065c08fcb81b8d97a68a2557d53d7
2015-12-17 12:32:54 -08:00
Sunny Goyal
d896ee43cd Protecting Icon normalization behind a feature flag
Change-Id: I91b7126765049372a3ffec3ad6f661715dc83bab
2015-12-17 11:24:46 -08:00
Sunny Goyal
6ef0f76939 Reverting the cache version change, so that users on release version do not get the cache reset
am: 2b84b652b3

* commit '2b84b652b33977d82e0af4ab9fdc7a97cb8d5a33':
  Reverting the cache version change, so that users on release version do not get the cache reset
2015-12-16 01:30:07 +00:00
Sunny Goyal
2b84b652b3 Reverting the cache version change, so that users on release version do not get the cache reset
Change-Id: I61b06ca001e6ae47693e8d6f467565314d66f1b4
2015-12-15 17:12:22 -08:00
Sunny Goyal
2d2b42ba3c resolve merge conflicts of 39b700fcc5 to ub-launcher3-master.
Change-Id: I394258be0c75289cab2f5141c0fb765504527420
2015-12-04 10:04:54 -08:00
Sunny Goyal
fc21830e6b Normalizing app icons based on the standard icon guidelines
Bug: 18245189
Change-Id: Iaadcddbe3f966733a13b2e1fb60ba09a8b3aef9a
2015-12-02 19:46:36 -08:00
Sunny Goyal
0b621156f3 Scaling down the icon before applying the user badge
> This also saves memory only create one new bitmap while loading instead of two

Bug: 25027252
Change-Id: Ia594dd65a30f32e99404190f649b334615c9e17f
2015-11-25 11:25:25 -08:00
Sunny Goyal
b84046dacf Scaling down the icon before applying the user badge
> This also saves memory only create one new bitmap while loading instead of two

Bug: 25027252
Change-Id: Ia594dd65a30f32e99404190f649b334615c9e17f
2015-10-19 14:05:25 -07:00
Winson
25f3604490 Prevent full sized icons from being stored when low-res icons are requested.
- When LauncherModel loads for the first time, the full set of widget package
  icons are loaded, which loads and stores full resolution icons even if low-res
  icons are requested.  This CL ensures that if we query for package icons, the
  low res icon is returned if it is requested, only loading the high-res icons
  when the user goes into the widgets tray.

Bug: 22797443
Change-Id: I45cd23c302c5e654ba7e0306a4b07b2fbeb70d2b
2015-08-31 14:36:32 -07:00
Sunny Goyal
a8b244e5b8 Using GET_UNINSTALLED_PACKAGES flag when getting packageInfo for a managed profile app
Bug: 23515512
Change-Id: I60678eccd4b60225ff30960f7197d633f72c7659
2015-08-28 10:27:41 -07:00
Sunny Goyal
3ba922aa62 Merge "Fixing widget restore" into ub-launcher3-burnaby 2015-07-21 00:42:42 +00:00
Sunny Goyal
df6ccf8196 Resizing the bitmap before caching it in the DB
> The icon size in the backup can be different that what is
  required by the device. We should resize the icon, before
  caching it.

Bug: 22413328
Change-Id: Id77c53edf8ea5e95a2d32dbe22be553120279ebd
2015-07-20 14:34:30 -07:00
Sunny Goyal
53f9672b30 Fixing widget restore
> Widget restore active flag was not cleared when the app was downloaded
> Icon from session info was not getting cached

Bug: 22413379
Change-Id: Ie096b929252200675a76dadd8c25cc3aa433671b
2015-07-20 12:00:22 -07:00
Sunny Goyal
09d70195d7 Using highres icons for backup
Bug: 22410445
Change-Id: I0fbc2d1217127556af806f12dbb5960712627ab7
2015-07-15 10:18:09 -07:00
Sunny Goyal
360bc25ab6 Using RGB_565 for low-res icons
> Using a non-transparent image with flat background for low-res icons
> Changing the scale factor from 8 to 5
> The overall size change is 1/50 instead of 1/64

Bug: 22204941
Change-Id: I6cda4b4b3450c23a7bb8218ebd2de2b09af9c414
2015-07-01 12:00:07 -07:00
Sunny Goyal
4e5cc64eaf Fixing backup restore
> Not deleting icons from cache, which have not been restored yet
> Not checking if activity exists during DB migration. Missing
components are removed during loader anyway
> Backing up and restoring bitmaps even when iconType is resource.
This allows us to show a proper bitmap icon, until the correct
resource is available.
> Loading proper shortcutResource icon for promiseIcons
> Checking against promise intent when verifying duplicates
> A launcher App intent can contain EXTRA_PROFILE

Bug: 22094970
Change-Id: I982971338846733833ec133119393af0bea0eb08
2015-06-25 17:41:06 -07:00
Sunny Goyal
2003c75ac4 Cancelling launcher reload on mcc change
Bug: 21022833
Change-Id: Iccd477e7b1638d162e1a500cdb7a52b8d359c657
2015-06-18 14:04:00 -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
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
Winson Chung
0b06875971 Merge "Ensuring that each CacheEntry has a default title and content description." into ub-launcher3-burnaby 2015-05-28 22:48:50 +00:00
Winson Chung
cdefc631f8 Ensuring that each CacheEntry has a default title and content description.
- Also defer adding entry to cache until we know that it has correctly loaded

Bug: 21446070

Change-Id: Ia7aae65ecdc5d9d7741f75d3fb6e7b85daeafeff
2015-05-28 15:25:45 -07:00
Sunny Goyal
f0e1fd9938 Removing file IO used for checking configuration change
> This check was used for flushing the cache, but since the cache
is backed by a DB, this has no effect as same icons are loaded again

Change-Id: Ib7d8a8598c5d225d922e095c899dc11ad06f2b7a
2015-05-26 09:14:49 -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
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
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
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
9ff980833d Avoiding blocking worker thread when adding icons to DB
Bug: 20945600
Change-Id: If12b21ac62c55c769838ce17d5421f147c396256
2015-05-19 12:19:38 -07:00
Sunny Goyal
0e08f166fa Using BubbleTextView for widget section headers
> Loading highres icons on the worker thread.

Change-Id: I5b68a86820aa4c132c156339e497354cf57f0fca
2015-05-12 11:40: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
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
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
ece6c8b20b Wrong icon getting set for an app on secondary user during updates
Bug: 20163841
Change-Id: Ief91db56f7831f89e34c4540981a9d2db96b8bed
2015-04-13 11:48:46 -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
d405693ca2 Merge "Adding support for loading package icon in iconCache" into ub-launcher3-burnaby 2015-04-06 21:07:47 +00:00
Sunny Goyal
d180cf7e16 Adding support for loading package icon in iconCache
> package icons need to be retrieved from IconCache for the new widget tray

Bug: 19897708
Change-Id: Iaafc5e16477aaa4e9a7c46b5abf8146cd1101ffd
2015-04-06 13:51:28 -07:00
Sunny Goyal
0c9a354c97 Adding a system status column in icon cache & invalidating items based on it
Bug: 20034430
Change-Id: Icd6c6426fc7ed26cd104bf22a9d2b0263cb0fa67
2015-04-01 16:05: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
8758ea050a Using MainThreadExecuter instead of View.post
Change-Id: Ie7ba88bd3bb412d998ecb51095cbaa74b3b39c10
2015-03-18 10:09:10 -07:00
Sunny Goyal
34b6527cef Lazy loading high res icons
> Loading low-res icons for icons which are not visible on
the homescreen.

Change-Id: I8ac7bf09f6030ed554cb60a4cd402f3f36ffe12b
2015-03-17 15:05:23 -07:00
Sunny Goyal
b4cd42a1df Extracting out CacheKey to a separate class
Change-Id: Ifdd7cc79668b34298e3f788ee684080cecb86c3e
2015-03-16 14:54:50 -07:00