Commit Graph

143 Commits

Author SHA1 Message Date
Sunny Goyal
c190dbfb78 Adding full backup handler for launcher3
Bug: 28302573

Change-Id: If0889a3b00b88b134b19d7f790159dfafdcdb004
2016-05-10 15:27:24 -07:00
Sunny Goyal
b5b55c8012 Removing LauncherProvider dependency in DatabaseHeler
This will allow DatabaseHeler to easily be moved to an independent class

Change-Id: I9a3d5d3380ed0af246d7a01553a492467c3096b0
2016-05-10 12:30:47 -07:00
Sunny Goyal
745bad9da1 Chaning the behavior of settings activity.
> Making all twoState prefs backed by content provider
> Using the stadard intent defined in N for settings
> Using SharedPrefsListener instead of LauncherProvider

Change-Id: I8272f54aa780bc0436e3d0aa89096a4bd2a9194f
2016-05-02 12:00:51 -07:00
Sunny Goyal
cc8f9e0af7 Removing some deprecated columns.
Removing these columns will ensure that new installs do not
get this column, without affecting the upgrades.

Change-Id: If06edcd2f899f30b5427c07e72a170ccefc32dd6
2016-04-21 08:14:19 -07:00
Tony Wickham
827cef203f Added ColorExtractionService and ExtractedColors.
- Launcher has an instance of ExtractedColors, which is loaded from
  LauncherProvider in onCreate() and whenever the wallpaper changes.
  - When the wallpaper changes, the ColorExtractionService is started
    in the :wallpaper-chooser process.
  - ColorExtractionService builds an ExtractedColors instance and saves
    it as a String in LauncherProvider.
  - When the results are saved, Launcher gets a callback through
    LauncherProviderChangeListener and reloads the ExtractedColors.
- Whenever Launcher loads Extractecolors, it also re-colors items
  (currently a no-op).

Change-Id: I319e2cfe0a86abcbc6bb39ef6b9fbbcad54ad743
2016-04-01 15:40:57 -07:00
Sunny Goyal
7eab3cc374 Fixing broken instrumentation tests when run from command line
Change-Id: I923cdbaaaf18c9b765d1e70122b92cd2c1621e06
2016-03-18 17:48:53 -07:00
Sunny Goyal
bf67f3b184 Creating database without localized collators on NYC and above
Android automatically creates and maintains a metaData table to
store the current device locale. This is used when fetching
sorted results. Since Laucher does not require string based
sorting on its tables, we can avoid unnecessary IO by disabling
this feature

Bug: 24608776
Change-Id: I8bbf5ca3abd505be95a85cfc99dd0438966575e9
2016-03-17 11:40:04 -07:00
Sunny Goyal
8f3819bc51 Preserving the homescreen rotation setting on a tablet, when the display is scaled
Bug: 27040652
Change-Id: I07f5e02443379ac5b877f72d33cedf4f2feca926
2016-02-23 14:50:27 -08:00
Sunny Goyal
ad37152c14 resolve merge conflicts of b171e5675b to ub-launcher3-calgary.
Change-Id: I329c7518d8c3f0f43e96c6446d5b53a6f4439211
2016-01-29 14:30:08 -08:00
Sunny Goyal
b171e5675b Adding a method to throttle backup manager calls
Notifying backup manager when a boolean preference changes

Bug: 22885775
Change-Id: I105013af1841f6cd87472f558fa490670ed1ba24
2016-01-29 14:12:21 -08:00
Sunny Goyal
f076eae0ca Adding support for migrating the grid between any two valid screens sizes.
The grid is migrated in steps where each step consists of at max one column change and at max one row change.
Adding some unit tests for GridMigrationLogic

Bug: 25958224
Change-Id: Ie54e872ea0925cc4c463edbba0a7201d62b373a0
2016-01-20 11:58:09 -08:00
Sunny Goyal
d7d5bd878a resolve merge conflicts of ffa1237698 to ub-launcher3-master.
Change-Id: I65beecb5bbbfe9c4b33d6ca639118cb615c4120a
2015-12-18 15:04:13 -08:00
Sunny Goyal
d804398755 Using SharedPrefenrece.apply instead of commit to prevent disk IO on main thread
Bug: 25903149
Change-Id: Ib1ee3fd27cca14f147f704aec768a330c4f03b33
2015-12-17 22:24:51 -08:00
Sunny Goyal
aefc0c4dd0 resolve merge conflicts of e5ef3d2e9b to ub-launcher3-master.
Change-Id: I37cbbe4f51cc0a8de8071434020ec1553241da85
2015-12-10 17:46:12 -08:00
Sunny Goyal
d3849d191b Moving DB creation to background thread
Change-Id: I5404edd8df7160108c230d245f34bf8e24173619
2015-12-08 13:38:28 -08:00
Sunny Goyal
33f90e7b55 Clearing DB instead of deleting the DB file.
> Deleting a file/reinitializing the openHelper variable is not thread safe
and can cause the sqlite instance ot go in an invalid state

Change-Id: I54d992c7e3daee82e6dad38d6bfbfcbf8ede506c
2015-11-30 11:48:16 -08:00
Sunny Goyal
0c34443406 resolve merge conflicts of 7bce5f7988 to ub-launcher3-master.
Change-Id: Id352ce219bed7701956bb462ea2dd0a5aebe7317
2015-11-24 13:12:32 -08:00
Sunny Goyal
7bce5f7988 Tying LauncherAppState lifecycle with LauncherProvider
The content provider is the first component started with the main process,
which makes it ideal for initiating LauncherAppState

Change-Id: I03db82a8949ad1376af53a0033592f421dbf0b15
2015-11-24 12:06:42 -08:00
Sunny Goyal
d249748abf Making all provider calls using content resolver.
This will allow us to easily move db creation out of onCreate

Change-Id: Idd949624b0a9c95e4451e48db7764b7b7922c40a
2015-10-20 11:04:44 -07:00
Sunny Goyal
f912beb2ee resolve merge conflicts of fe3db428ab to ub-launcher3-master.
Change-Id: Icc60a61f621fefe9db67b178921e62f7d72d7e5a
2015-10-20 10:37:15 -07:00
Sunny Goyal
f725824fa2 Refactoring getPreferenceKey method
This method was returnning a constant and getting inlined by proguard.

Change-Id: I87348e25b21483adc1b27d16f99dec4b73205701
2015-10-20 09:41:04 -07:00
Sunny Goyal
6280893534 am 6fb929e0: Verifying that the table was successfully created during initialzation
* commit '6fb929e0038a9d03b60540fdbf6b6914146f7b21':
  Verifying that the table was successfully created during initialzation
2015-10-07 20:45:50 +00:00
Sunny Goyal
6fb929e003 Verifying that the table was successfully created during initialzation
Table creation sometimes fails scilently, which leads to a crash loop.
This way, we will try to create a table every time after crash, so
the device would eventually be able to recover.

Bug: 24263894
Change-Id: Ic0169d33f4092042423afa24320182786c544d47
2015-10-06 16:47:14 -07:00
Sunny Goyal
a13654529c Adding some information in bug reports
> Dumping workspace items
  > Dumping loader logs for crashes and data deletion
  > Removing unnecessary log dumps

Change-Id: Ia320988c2e3665e4d605d6e88bca77738e749273
2015-10-01 15:48:35 -07:00
Sunny Goyal
4cffb0c466 am c74e4197: Restoring provider behavior for reloading app on old devices > For older devices, launcher will only reload in case of inserts with specific query parameters > For older devices, launcehr will notify content observers of any internal inserts > Chani
* commit 'c74e41973a74aa416e16aeadaa2f491153da26bc':
  Restoring provider behavior for reloading app on old devices   > For older devices, launcher will only reload in case of inserts with specific query parameters   > For older devices, launcehr will notify content observers of any internal inserts   > Chaning TAG for Launcher provider as max logging tag is only 23 characters
2015-09-09 17:07:57 +00:00
Sunny Goyal
c74e41973a Restoring provider behavior for reloading app on old devices
> For older devices, launcher will only reload in case of inserts with specific query parameters
  > For older devices, launcehr will notify content observers of any internal inserts
  > Chaning TAG for Launcher provider as max logging tag is only 23 characters

Bug: 23821706
Change-Id: I32891387612d967c41ddae848c43dc4b1de1b0e9
2015-09-09 09:38:52 -07:00
Sunny Goyal
c268148f06 resolved conflicts for merge of 9fc953b9 to ub-launcher3-master
Change-Id: Ia3e845a2e336c846cceefdc2d1e8c6786753f1b1
2015-08-17 14:43:41 -07:00
Sunny Goyal
9fc953b94d Version code cleanup
> Renaming Lmp to Lollipop
  > Lollipop_MR1 instead of directly using 22
  > Using M APIs directly instead of reflection

Change-Id: I10a307f46e3be15b3299f549a2fd7e0e215a6a1b
2015-08-17 13:26:01 -07:00
Sunny Goyal
42e28092b3 Removing some eclipse warnings
Change-Id: I160feaee81b262be02446885fae643c0be71b7af
2015-08-17 12:56:19 -07:00
Sunny Goyal
d106418dee Reloading launcher whenever there is an external update to contentprovider, irrespective of the uri
Change-Id: If1a06da57171be30adb74f09ac256a8b03ab8549
2015-08-13 14:09:43 -07:00
Sunny Goyal
e5bb705fb7 Homescreen migration from a larger grid to a smaller grid.
Adding support for restoring from a larger device, if the grid size
difference is not more that 1.
During restore add all the items in the DB, and run a one-time migration
the next time launcher starts.

The migration strategy is defined in ShrinkWorkspaceTask.java which involves
resizing, moving and removing some items.

Change-Id: I6ee411f6db5bf0152b527e16146a88c56dec2d97
2015-07-31 12:03:33 -07:00
Sunny Goyal
c22841bfd1 Fixing shortcuts not getting migrated to app icons
Bug: 22410445
Change-Id: I939c59270529daf51638aa30b30763c18a2ce6a5
2015-07-13 20:15:37 -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
27f03251ea Merge "Deleting empty folders based on DB state" into ub-launcher3-burnaby 2015-06-18 03:06:30 +00:00
Sunny Goyal
b4cbea4ad4 Fixing nullpointer when creating new DB
LauncherProvider is not ready until the DBHelper is created
Change-Id: Iabd61005892f15fd4a31d882100d87df2b2a7b85
2015-06-16 15:18:41 -07:00
Sunny Goyal
383c507c47 Removing ContentObserver in launcher
> Using callback insted of using a content observer
> Setting the listener in LauncherAppState to prevent resource leak

Change-Id: Id23a4d5c8812e86178997e536226e09ec3740f84
2015-06-16 10:31:43 -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
7779d62308 Using content provider to update launcher settings
> Removing cross process preference file
> Removed broadcast listener management for settings changes
> Defining content provider method to get/set laucnehr preferences

Change-Id: Ida36eac0ab17c1d48fedc9404817a53a89b36c4f
2015-06-12 11:16:20 -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
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
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
e2fba6cba1 Prevent work folder creation when launcher is upgraded.
Change-Id: If7a91e0852dae1bf5dcf21e89c1771b5f37629f3
2015-05-12 10:40:43 -07:00
Sunny Goyal
18b640c371 Removing LauncherProvider dependency from LauncherSettings
> This ensures that the classLoader does not need to load
LauncherProvider to access LauncherSettings
> Making a few fields public.

Change-Id: I2e8ee6e169552739f09e500d3b6acbcee7cd0718
2015-04-17 09:30:32 -07:00
Sunny Goyal
0b03778966 Deduping shortcuts to app-shortcuts if they have a valid intent
> Only deduping shortcuts for the primary user as custom shortcuts
for secondary users is not supported.

Change-Id: If129dee64a395602006ebb996d4b09b93b89084f
2015-04-10 19:01:32 -07:00
Sunny Goyal
35ca873bd9 Adding nullcheck when getting app restrictions
Bug: 20085185
Change-Id: I782a79a331a2d58287e34e24ed7730207bf260cb
2015-04-06 10:46:01 -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
Sunny Goyal
b2d46ceaaa Configuration of workspace through app restrictions
> Checking for a grid specific layout before loading the default layout

Change-Id: I1e8d4176341e61d0876b0a9bea9ad8010e3a0f6a
2015-03-27 13:00:44 -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
5d85c44fd8 Adding sort switch in FolderPagedView
> Adding options column in DB to store generation purpose flags
> Storing isSorted flag in FolderInfo
> Adding a switch for A-Z sorting (only visible if pageCount > 1)
> When in sorted mode, spring-load snaps to the target location for 1.5 seconds

Change-Id: I8c7c778d2cc3ccbd35a2890a1a705e1c1a7e9a66
2015-03-17 14:49:38 -07:00