Commit Graph

508 Commits

Author SHA1 Message Date
Sunny Goyal
ff4ba2d995 Refactoring out grid occupancy management in a separate class
Change-Id: I37a830c0f2eb0a0dd4f5fc78fa29127cb18cb3c2
2016-05-27 09:12:26 -07:00
Sunny Goyal
ded0fdba52 Removing logic for workspace migration from Launcher2
Change-Id: I8a121d74862f665c58406f8d5c7eb1263e7ccff3
2016-05-23 16:00:09 -07:00
Sunny Goyal
1acb9e9e29 Rearranging the provider checks to avoid packagemanager lookups
whenever launcher starts

Bug: 28737985
Change-Id: I3ce3e2741b3224fa5419d7ceca496e1bb91f065c
2016-05-18 09:41:27 -07:00
Sunny Goyal
aaf7d1d13b instead of unbinding items from the loader, unregistering listeners
in activity.onDestroy()

Bug: 28740269
Change-Id: I6bf2ad6aca43970fd10cfbcc113e609c227e07bf
2016-05-17 14:42:10 -07:00
Sunny Goyal
eb4b79935e Removing icon_type column
Icon type is not used consistently. It is used initially
during the loader. Afterwards, we save both the icon and resource to the db.
Instead of changing the logic to always read the shortcut-resource first, and fallback to the bitmap if the resource is not available,
always write the bitmap to DB whenever the shortcut is edited.

Change-Id: I0ea5e88f8904bd3250ca669220b3e5d6aeef1bfd
2016-05-11 15:21:42 -07:00
Sunny Goyal
713edfce26 Adding a utility class for persistant logging.
The logs are kept for at max 48 hours. It uses two log files and switches
between the two based on the day of the year.

Change-Id: I9a99499b3445a62f29f62a5cd13db20b1783bcd3
2016-05-09 12:47:42 -07:00
Sunny Goyal
d09c37052e Removing dependency on getApplicationInfo method added in N
This method is goiing away. We don't need this method anyway
since LauncherActivityInfo already has the information

Change-Id: Ic6afa1df14958b894925d730e01a2e2d2a6fb98c
2016-04-07 11:38:10 -07:00
Sunny Goyal
c52ba71005 Fixing folder icon not getting redrawn when the contents change
> Removing parent from ItemOperator as inconsistant values were
being passed in workspace and folderPagedView
> Fixing itemChanged causing multiple redraws, by passing a
'animate' parameter to explicitely request animation

Bug:27740161
Bug:28015426

Change-Id: Ide7b266bde9aad5f450a3f808a59182fe01a5110
2016-04-06 12:46:36 -07:00
Sunny Goyal
e1f1c34c09 Merge "Fixing bug where folders on the first screen and hotseat are not registered by the Launcher if there are folders on other screens" into ub-launcher3-calgary 2016-04-06 00:49:22 +00:00
Rubin Xu
ac6e5d7956 Listen on new broadcasts for profile changes.
The change is due to API review comments on the platform side.

Bug: 27532254
Change-Id: I44133fbb5c3ee13d0523a72b25d2e1c5d1eba6a0
2016-04-04 16:13:35 +01:00
Sunny Goyal
44c06437e2 Fixing bug where folders on the first screen and hotseat are not
registered by the Launcher if there are folders on other screens

Instead of maintaing a static map of folder items, searching it
in the workspace during item removal.

Change-Id: I8aa93b3aa1d0bd812204471e3103f4bd29d1cd3d
2016-04-02 11:00:56 -07:00
Sunny Goyal
8ab8fe9441 Merge "No need to differentiate package event into app or updated based on a package is being updated or not" into ub-launcher3-calgary 2016-04-01 22:51:54 +00:00
Tony Wickham
6ed21eebb4 Merge "Added ColorExtractionService and ExtractedColors." into ub-launcher3-calgary 2016-04-01 22:44:58 +00: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
93f878c168 Fixing the loader to bind the first screen as well as the hotseat together
When the loader ran for the first time (or when called due to force-reload),
it was binding with page = -1 (invalid pageId is -1001). This was causing loader
to assume the workspace to be on a valid screen, and causing the loader to
only bind the hotseat first.

Bug: 27705838
Change-Id: Ia8eb2543d8cee1268256b2d6bccf33828937c54a
2016-03-30 18:24:07 -07:00
Sunny Goyal
144154d435 No need to differentiate package event into app or updated based on
a package is being updated or not

Package update handling is a super set of package add handling  which
also updates the all-apps and package disabled state.
This also prevents addtion of a home screen icon when a managed profile
app on SD card become available.

Bug: 27877926
Change-Id: I9264e422fd30b94ce6ebb2e5adea820b3cda3063
2016-03-30 16:51:12 -07:00
Sunny Goyal
17763cb1d2 Fixing debug log
Change-Id: I85c1f7707a3ea9cae2701aa781b74d758602f643
2016-03-24 13:58:35 -07:00
Sunny Goyal
da891c1a22 Instead of reloading the launcher, updating items dynamically when
Quiet mode changes

Bug: 27632028,27763316
Change-Id: I55f018e855448df0abcbf4fd0fcb39344594980c
2016-03-24 12:19:29 -07:00
Sunny Goyal
3bbbabc54a Fixing model being updated on UI thread
> When package gets unavailable or suspended, the disabled flag was getting
updated on the UI thread. This could lead to inconsistent model if launcher
activity didn't exist.
> Fixing: When unsuspending one work profile apps, all work profile apps get
unsuspended

Bug: 27673573,27673373,27403236
Change-Id: I7fde3f79c36204e73ca66ccf8431fa0f0cce3d08
2016-03-18 15:13:28 -07:00
Sunny Goyal
2e1efb480a Changing the widget loading strategy
Widget is loaded only when the user enters the overview mode and we keep
the list updated as long as the user is in the overview mode. Once the user
leaves the overview mode, we stop responding to widget updates

Bug: 26077457
Change-Id: I9e4904b8f1300bfe0d77e2bc5f59aa6963fad8d1
2016-03-09 20:21:22 -08:00
Sunny Goyal
261194387b Revert "Reverting refactoring of Folder and FolderIcon to avoid dependencies breakage"
This reverts commit fc956e5a2a.

Change-Id: Ib3b5156b8fc3cad35c4634d61d5390c848ce1f93
2016-02-23 02:02:54 +00:00
Sunny Goyal
fc956e5a2a Reverting refactoring of Folder and FolderIcon to avoid dependencies breakage
Change-Id: Ifd0d717d70aff4c83c9eb5cba397d04500b2c869
2016-02-17 13:27:13 -08:00
Adam Cohen
f9c184a619 Refactor FolderIcon to separate the preview effect into it's own class
-> Created com.android.launcher3.folder package to house most folder-related files
   (aside from the FolderInfo) which is more related to the model than the UI.

Change-Id: I767063e1e4c775c01a799a3bede30cd94ac48ade
2016-02-12 17:28:31 -08:00
Hyunyoung Song
747a5bc486 WidgetsModel clone method should be called in worker thread
b/24582368

Change-Id: I7b1d2ccfa7d7ac8235e4aeccc2b6b1a8eeea6461
2016-02-08 18:14:17 -08:00
Kenny Guy
ff05f4375d Respond to managed profile availabilty Intents.
Grey out applications when managed profile is
not available.

Change-Id: I9bb9442cd0b3d0d207062716bfd6b179e3ba8489
2016-01-25 21:23:59 +00:00
Kenny Guy
44cba69638 Grey out suspended applications.
Grey out application shortcuts and all apps entries
for packages that are suspended.

Bug: 22776761
Change-Id: I1b63da1816aca1de52b9f9bee62d1b162d0cdf4d
2016-01-25 11:28:06 +00: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
f862a26347 Extending the grid migration logic to handle density changes
For hotseat migratino, we simply drop the items with least weight
If the workspace row/column decreases by 2 or more, we clear the whole workspace

Bug: 25958224
Change-Id: I7131b955023d185ed10955f593184b9238546dc8
2016-01-06 10:16:44 -08:00
Sunny Goyal
13f682f74e Fixing some invalid checks and cleaning some redundant conditions
am: b740f59c7d

* commit 'b740f59c7d572d54402e3a74fb2a23c0f1b1af48':
  Fixing some invalid checks and cleaning some redundant conditions
2015-12-18 11:20:41 -08:00
Sunny Goyal
b740f59c7d Fixing some invalid checks and cleaning some redundant conditions
Change-Id: I770ce2cc2eccbee105958634e81bbc9bc2e4cc48
2015-12-18 11:00:14 -08:00
Sunny Goyal
c3642d4509 Build fix
Change-Id: I0bf4241aa48f25f2b5774726d1d75dfb5a20a2e5
2015-10-30 10:27:08 -07:00
Sunny Goyal
4f63c76bfe Merge "Refactoring WallpaperOffsetInterpolator to a new file Removing some us unused methods" into ub-launcher3-master 2015-10-30 00:33:46 +00: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
9eba1fd75e Refactoring WallpaperOffsetInterpolator to a new file
Removing some us unused methods

Change-Id: Ife790e5ca6848fa13dc3fab1bba1e6220bf83743
2015-10-16 09:02:25 -07:00
Winson
722e85678a resolved conflicts for 1845049c to ub-launcher3-master
Change-Id: I25a01a0735be754f4c8daef5a4a04eaec651b95c
2015-10-07 13:04:30 -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
Winson
12fb9fc3c3 Replace Long.compare() with implementation.
- Long.compare() was added in API level 19.

Change-Id: Ic7020c941403c10daa6feacdc737c6a82676ada0
2015-10-01 15:34:08 -07:00
Winson
e993c4b275 resolved conflicts for 850de64c to ub-launcher3-master
Change-Id: Ica4893082f03afe76abd42dca44016eb9e436c35
2015-09-29 17:39:37 -07:00
Winson
46a06da01c Fixing other missing cases of truncated sorts.
Bug: 24505761
Change-Id: I9b9358e8b134f0c4aac32ac536d9c8a1f0629957
2015-09-29 16:58:02 -07:00
Winson
8660cf5d1b am 17e2d495: Use Long.compare() instead of truncating values for comparison.
* commit '17e2d49547eb8d068b1ba816c6226cf5ef77369d':
  Use Long.compare() instead of truncating values for comparison.
2015-09-25 23:23:56 +00:00
Winson
17e2d49547 Use Long.compare() instead of truncating values for comparison.
Bug: 24116808
2015-09-25 23:20:13 +00:00
Sunny Goyal
46a07220ad Merge "Build fix" into ub-launcher3-master 2015-09-18 17:18:46 +00:00
Sunny Goyal
877f92893a Build fix
Change-Id: Ic9c8872dbabbd52b902a5890e7213b7e450bbcfb
2015-09-18 10:18:25 -07:00
Sunny Goyal
b3cf2d789e Merge "Refactoring deferred bind logic" into ub-launcher3-master 2015-09-18 17:18:10 +00:00
Sunny Goyal
9b75b5f8dc am 31860581: Catching RemoteExceptions when calling packagemanager to get list of shortcuts
* commit '31860581536b3fee0221456a2dcc5d6d6f2b7e15':
  Catching RemoteExceptions when calling packagemanager to get list of shortcuts
2015-09-18 17:05:41 +00:00
Sunny Goyal
8c2fdd4c44 am 31860581: Catching RemoteExceptions when calling packagemanager to get list of shortcuts
* commit '31860581536b3fee0221456a2dcc5d6d6f2b7e15':
  Catching RemoteExceptions when calling packagemanager to get list of shortcuts
2015-09-18 17:05:39 +00:00
Sunny Goyal
3186058153 Catching RemoteExceptions when calling packagemanager to get list of shortcuts
Bug: 23796963
Change-Id: I5486c2916e981e7135edd5df360536a362bc2795
2015-09-18 09:15:22 -07:00
Sunny Goyal
1daf7f792a Merge "Build fix" into ub-launcher3-master 2015-09-17 22:07:19 +00:00
Sunny Goyal
05247be8aa am 0f196e69: Merge "Null check when getting list of widget receivers" into ub-launcher3-burnaby
* commit '0f196e6939ee9f23ea24d046e74fd1d1d3fc953f':
  Null check when getting list of widget receivers
2015-09-17 22:03:56 +00:00
Sunny Goyal
a0a311ec21 am 0f196e69: Merge "Null check when getting list of widget receivers" into ub-launcher3-burnaby
* commit '0f196e6939ee9f23ea24d046e74fd1d1d3fc953f':
  Null check when getting list of widget receivers
2015-09-17 22:03:09 +00:00