Commit Graph

273 Commits

Author SHA1 Message Date
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
Sunny Goyal
d5bf4ab5f7 Merge "Refactoring max id logic to a common method" into ub-launcher3-burnaby 2015-03-09 17:08:20 +00:00
Sunny Goyal
323f47f8bf am c6c8fef3: Clearing DB if necessary, when applying the default layout
* commit 'c6c8fef3e90f84b26c3b8550ec6a1d668ca9200d':
  Clearing DB if necessary, when applying the default layout
2015-03-05 04:32:48 +00:00
Sunny Goyal
c6c8fef3e9 Clearing DB if necessary, when applying the default layout
Bug: 19574498
Change-Id: I34850d9a7f7316bcc2cb9fc8a5be57d2488c16a6
2015-03-04 15:20:24 -08:00
Sunny Goyal
fe4e4b91dc Refactoring max id logic to a common method
Change-Id: I1f649b570ee43d6c0540a207693d2cbee4538fb8
2015-03-04 10:43:45 -08:00
Sunny Goyal
8dbf0fff1f Merge "Setting workspace id as primary key" into ub-launcher3-burnaby 2015-03-02 23:28:06 +00:00
Sunny Goyal
f30e99b2dc am e72f3d53: Fixing wronk rowID check.
* commit 'e72f3d53f8c35b94aece6fafa6fd12cce9d09fe5':
  Fixing wronk rowID check.
2015-03-02 22:43:52 +00:00
Sunny Goyal
e72f3d53f8 Fixing wronk rowID check.
Since screenId is changed to primary key, the rowId can now be 0 (earlier
it was auto-increment and never 0)

Bug: 19566734
Change-Id: Icf0e4294a581039101df1ad1756fdb6e581c4cba
2015-03-02 14:26:31 -08:00
Sunny Goyal
d2f3819c34 Setting workspace id as primary key
Bug: 19475231
Change-Id: I0385e97868db73dafe148ce45af7dda4555ee593
2015-02-27 14:05:26 -08:00
Sunny Goyal
633325c4c2 DO NOT MERGE: Setting workspace id as primary key
Bug: 19475231
Change-Id: I0385e97868db73dafe148ce45af7dda4555ee593
2015-02-25 16:56:54 -08:00
Sunny Goyal
14334bda03 Merge "Removing code for the unused 'upgrade path'" into ub-launcher3-master 2015-02-12 18:23:28 +00:00
Sunny Goyal
d3f035797e am c87775d8: Fixing rank migration code to handle null values correctly.
* commit 'c87775d8e63c7b5722c23ef95c782f574b847d73':
  Fixing rank migration code to handle null values correctly.
2015-02-11 23:01:53 +00:00
Sunny Goyal
66cfdc2549 Removing code for the unused 'upgrade path'
Change-Id: Ib9eca92284b0eabbe36ffaaf26c62a6ce3cfd3e9
2015-02-11 11:55:36 -08:00
Sunny Goyal
c87775d8e6 Fixing rank migration code to handle null values correctly.
Bug: 19297508
Change-Id: I652ef30ab37f5b09204f0388de8e065d64b7724d
2015-02-10 19:53:41 -08:00
Nilesh Agrawal
7034f1467d am a258f812: Modify strict mode thread policy for LauncherProvider.
* commit 'a258f812fac21767d1f2e61ee7a7a58bfe6da582':
  Modify strict mode thread policy for LauncherProvider.
2015-01-26 22:28:49 +00:00
Nilesh Agrawal
a258f812fa Modify strict mode thread policy for LauncherProvider.
Allowing thread writes too as SQLiteOpenHelper.getWritableDatabase needs it.

Bug: 19094644
Change-Id: I39fe97a9e7fc07c38a4f8e5c5979196b742e36bf
2015-01-26 14:07:29 -08:00
Nilesh Agrawal
d8c2a43efa am fde11852: Add strict mode exception in LauncherProvider.
* commit 'fde11852cf0f91c4500a93dfffb44c1b86991e6e':
  Add strict mode exception in LauncherProvider.
2015-01-21 21:17:07 +00:00
Nilesh Agrawal
fde11852cf Add strict mode exception in LauncherProvider.
Content providers are created during process startup (before Application.onCreate),
and we should not be doing expensive stuff in Provider.onCreate

Adding an exception for now as it looks like LauncherProvider initialization is needed
before we can show meaningful UI.

Bug: 19094644
Change-Id: I860c2934c110d3a43f1a3afa00729077dc64796c
2015-01-21 11:50:57 -08:00
Sunny Goyal
a2cc624e75 Changing DB upgrade path to use swith case statement.
> This allows to cancel the whole upgrade path if any one step fails
and reset the DB

Change-Id: I645b74af8afcd21dda0d619691a5fb3dbf1a04c0
2015-01-21 11:05:00 -08:00
Sunny Goyal
08f7261d11 Adding a rank column for itemInfo
> Rank is used to determine position of an item
in a folder.

Bug: 18590192
Change-Id: I2826a7c570b4cc58e719d685f17a24ec6133804f
2015-01-13 22:19:56 +00:00
Sunny Goyal
e87e6abc36 Removing dead code from Launcher provider
> Removing DB upgrade logic for versions before 12. Launcher3
was forked off Launcher2 when DB version was already 12, so, there
can never be a lower version of the DB.
> Removing logic for auto import of launcher2 DB. This flow had
been permanently disabled by a flag, and we show a confirmation
prompt/cling before migration

Change-Id: I2ac2f21fefc41ee247164566a088927263b09459
2015-01-05 12:48:11 -08:00