Commit Graph

43 Commits

Author SHA1 Message Date
Andras Kloczl
88716645cd Fix icon adding issue on two panel home
Test: manual & PromiseIconUITest & RequestPinItemTest
Bug: 192431856
Change-Id: I4a6319fa33c9359057f87d9c008eb139410593b5
2021-07-06 17:41:26 +02:00
Schneider Victor-tulias
9617332f60 Remove expensive logging.
Removed expensive logs added for debugging. Removed unused code.

Fixes: 168788486
Test: none
Change-Id: I0579275633361d2d67399c773e6376af74c9f1b1
2021-06-25 11:48:15 -07:00
Schneider Victor-tulias
12e9345f4f Skip item infos that fail session info verification.
trichromelibrary.canary is failing session info verification, but is still being added as blank icon on the workspace in some cases. Added logic to skip apps that fail this verification until the root cause can be found.

Bug: 168788486
Test: none

Change-Id: I8a7fe76f321de493b2c6c67ba6922eae23067ff3
2021-06-15 12:12:07 -07:00
Schneider Victor-tulias
344b200710 Updated launcher logging.
Updated logging to help track down b/168788486

Bug: 168788486
Test: manual
Change-Id: I064f0eb70f0281fb09083b95c321857d17e31a7d
2021-05-06 21:39:05 +00:00
Schneider Victor-tulias
94a3642099 Add logging for adding pending icons to the workspace.
Added more logging to help track down b/168788486

Bug: 168788486

Test: manual
Change-Id: I309ad3abbedaeb538c97dd4929bedf6407fdfcf1
2021-04-22 13:09:22 -07:00
Schneider Victor-tulias
bf694d61ee Add logging for adding pending icons to the workspace.
Added logging to help track down b/168788486

Bug: 168788486

Test: manual
Change-Id: I96b38be7c02793f1b6649e6c0de5cdf47dca6edb
2021-04-06 12:10:50 -07:00
Schneider Victor-tulias
6a5f431a7b Revert "Revert "Add UI updates for incremental app installs.""
This reverts commit 229497d182.

Reason for revert: Patching bugs

Fixes: 176901235, 176992421, 176884453

Test: manual

Change-Id: I57e13a15e72284564a10761966732ee31d15fd08
2021-01-12 12:22:33 -08:00
Schneider Victor-tulias
229497d182 Revert "Add UI updates for incremental app installs."
This reverts commit 84269d349d.

Reason for revert: causes b/176884453 and b/176992421

Change-Id: I3398674a0acbad8329df5d341ae074ac073a6bf9
2021-01-07 19:44:44 +00:00
Schneider Victor-tulias
84269d349d Add UI updates for incremental app installs.
1. Changed Preload Icon UI to be grayscale while the app is not startable.
2. Added progress bar for when app is installed but still ownloading.
3. Updated Preload Icon progress and click handling to use new incremental api.

Progress bar color updates will follow in a separate CL.

Demo: https://drive.google.com/file/d/1H1EvtTorLeJwC1eiq10tm-TT81YZ6osk/view?usp=sharing

Bug: 171008815

Test: manual

Change-Id: I5874a5146d79a8c91d7d90ff0b9c1c427a3c95dd
2021-01-05 15:17:26 -05:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Sunny Goyal
73b5a27b14 Updating some non-final static objects
Updating various static objects to use a standard pattern so that
it is easier to track and cleanup those objects

Bug: 141376165
Change-Id: Ia539cbfa338d544dddad771c5027b6748762768b
2019-12-11 13:22:58 -08:00
Jon Miranda
e6691f34c1 Add additional shortcutExists check to prevent same app from being auto added.
am: f788bbb0c4

Change-Id: I42f0c4d75f8be38b9e81c5932fc1def710a68f36
2019-11-04 17:32:56 -08:00
Jon Miranda
f788bbb0c4 Add additional shortcutExists check to prevent same app from being auto added.
Since we made the change to treat all auto added workspace items as promise
icons, the initial shortcutExists check breaks since its comparing the promise
intent to the actual app intent. This additional shortcutExists check can
compare the proper intents.

Bug: 143803446
Change-Id: Ifa27b15205d6e17f83a4437ac175d51815688c84
2019-11-04 14:19:17 -08:00
Jon Miranda
6173355db1 Merge "Fix bug where Files app keeps getting added to the workspace." into ub-launcher3-qt-future-dev
am: 23df556ec4

Change-Id: I408d6c3d537124b8c8bfa4670261435d004eb7d3
2019-10-30 10:54:26 -07:00
Jon Miranda
a8109fb98c Fix bug where Files app keeps getting added to the workspace.
Caused by mainline updates where Files app session commit is broadcasted.
Launcher workaround is to not auto-add system apps to the workspace.

Bug: 139663018
Change-Id: Id61532bd0df2cd5f3bdfc28a3616ba5e5ff3d18a
2019-10-30 09:56:44 -07:00
Sunny Goyal
3808a69a6c Storing BitmapInfo instead of icon and color directly in itemInfo
This will allow subclassing BitmapInfo to support custom icon/dynamic
icons which can be loaded on the background thread instead of going
through IconFactory which runs on UiThread

Change-Id: Ieced6e91330bdff1b505826d097a8df711dfe967
2019-10-28 11:12:47 -07:00
Jon Miranda
7c76a33243 Add support for work profile promise icons.
- We were not getting callbacks for sessions created under work profile.
- We did not pass in the user when creating the workspace item infos.
- Added check for if app is installed before adding item to workspace
  to prevent any stale promise icons. This seems to happen when uninstalling
  and then immediately reinstalling an application.

Bug: 141556707
Change-Id: Ie0320f3ede70b6c7543cb60c3b95a2fe398eecb5
Merged-In: I2db2d8da449c37eb248a59fbc9e7b517f50855c1
2019-10-24 23:07:04 +00:00
Jon Miranda
26256f79c3 Fix work profile promise icon bugs.
- We did not pass in the user when creating the workspace item infos.
- Added check for if app is installed before adding item to workspace
  to prevent any stale promise icons. This seems to happen when uninstalling
  and then immediately reinstalling an application.

Bug: 141556707
Change-Id: I2db2d8da449c37eb248a59fbc9e7b517f50855c1
2019-10-24 13:27:41 -07:00
Sunny Goyal
e7b00128c7 Removing static instance of LauncherAppsCompat and unnecessary wrapper classes
Bug: 141376165
Change-Id: I8c1f1ab7d83ec50fe9c7bf39960ef9c360025ec7
2019-10-02 16:20:22 -07:00
Sunny Goyal
045b4fab76 Removing static listeners from PackageInstallerCompat
Bug: 141376165
Change-Id: I2b49d53a05a04c622ed5a7b723109a6cc230d230
2019-09-30 23:17:15 -07:00
Jon Miranda
14f3936c92 Fix RequestPinItemTest, broken by my manual merge.
Bug: 139880994
Change-Id: I7f6e1dda6cf4497bccf7ea682739bacd12079d4d
2019-08-22 13:37:29 -07:00
Jon Miranda
c84168df80 Add support for adding promise icons for new install sessions by user.
- Added flag PROMISE_APPS_NEW_INSTALLS
- Promise icons only added if flag (above) is on, as well as the setting
  for "Add icon to Home screen"
- Maintains a list of session ids of promise icons that have been added to the
  home screen, so that if the user manually removes the icon, we do not add
  it back to the home screen when the install is completed.
- Queues all applications as promise icons, and replaces with actual
  app info when its being added to the workspace.

Bug: 135633159
Change-Id: I411db59f9bd1b346d98b9bb73f5376a5983b8de5
2019-08-22 10:28:14 -07:00
Sunny Goyal
87dcde6d6c Separating apps list callback from model callback and simplifying various events
Bug: 137568159
Change-Id: I4d8bb5c01cabe642731ebd3f57fe15bdc5a569b7
2019-07-25 11:29:16 -07:00
Sunny Goyal
9dbb27c09c Moving some utilities methods to separate class
Change-Id: I5094b22ddc77c45590cea1a5f5dead0dc7580abf
2019-07-17 15:15:07 -07:00
Sunny Goyal
9589916418 ShortcutInfo renamed to WorkspaceItemInfo
Will get rid of ShortcutInfoCompat in a follow up cl

Change-Id: I7d7d9c938635f59b216290ba28bea9d0e0721a7d
2019-04-16 00:08:24 -07:00
Sunny Goyal
c3f4dc6c6a Fixing workspace screens not including page 0
Instead of maintaining a workspace screen array, calculating it from
the current set of items as needed.

Bug: 122262946
Bug: 119500058
Change-Id: I85bb0e55a4442ab9bcac390a601da0cb2583c26a
2019-01-07 12:14:06 -08:00
Sunny Goyal
c5939393a9 Bye bye workspace screens table
Removing a separate table for workspace screens. List of screens are
automatically parsed using the items in the favorites DB. Order of the
screen based on the screen id and rearranging screens is no longer
supported. In case the screens need to be rearranged, all the items
in the favorites db will need to be updated with new screen ids.

This makes backing up the DB (in the same database) easier as only
one table needs to be duplicates.

Change-Id: I8ba947a898f637d780e2f49925e78604263126e8
2018-12-10 11:43:35 -08:00
Sunny Goyal
efb7e84242 Converting long item IDs to int
> Items ids were already being typecasted to int when being bound on the UI
> Using a consistent type allow better use of platform data-structures
> Adding IntArray and IntSet as a replacement for various Collection classes

Change-Id: Id3c650ed2420c2bfca3bd7671d2b705b56112371
2018-10-08 14:52:39 -07:00
Tony Mak
1b6826c53c Deprecate work folder
FIX: 73876183

Change-Id: I9d15df247eed3500c679cba085c680b75581cffb
2018-02-27 17:47:22 +00:00
Sunny Goyal
91498abf75 Moving install queue updates to worker thread.
This avoids acquiring a lock for upating the sharedPrefs during onResume
as all the logic runs on a single thread.

Bug: 67305604
Change-Id: I1bbea382da9fafb403b4e9508f393f78db28478d
2017-10-06 11:33:43 -07:00
Sunny Goyal
b23980cc0e Fixing duplicate/inconsistent definitions for model and callbacks
> 2 implementations for filtering workspace items
> 2 implementations for binding widgets
> duplicate logic for add and update appInfo

Change-Id: Id68a49926af398478deca8ac85ab1f22341a9449
2017-08-17 11:05:56 -07:00
Rajeev Kumar
44c3ddcf49 Replace use of java.util.HashMap with android.util.ArrayMap in
AddWorkspaceItemsTask class
Bug: 62466540

Change-Id: Iae1e7a639754d08ad7dbb90b20e2e4e205a078f8
2017-06-14 17:50:51 -07:00
Sunny Goyal
e86f11fa38 Adding support for loading workspace in the absence of Launcher.
> LoadWorkspace can be called with a LoaderResult which does not bind anything.
> Synchronous bind does not look for a valid page id, and will fallback to the
  current pageId similar to full load flow

Bug: 37616877
Change-Id: If14491dc79c5b85ae1019cc93e4e08759df3387d
2017-06-08 09:39:34 -07:00
Sunny Goyal
a474a9bcf5 Simplifying logic for managed for icon addition
> Checking for duplicate icons before adding new icons

For O and above, icon addition is controlled using
SessionCommitReceiver.
As long as the Launcher is the default app, it will keep adding
icons on the homescreen. Apps installed while launcher was
not the default homescreen, no icons will be added.

For below O, icons are added based on package event. As long as
the Launcher process is running, it will keep adding icons on the
homescreen. Apps installed while the launcher app was dead, no
icons will be added.

Bug: 37528649
Bug: 37082950
Bug: 34112546
Change-Id: Ic99501fa476c00474a479f2a36c24614bfa3f4bf
2017-05-22 13:31:04 -07:00
Mario Bertschler
c06af333cb Minor Refactoring only: no functional change
- organizing imports
- remove redundant modifiers on LauncherCallback interface
- fix typos

Change-Id: I61eb985cac7c1379b6b804a67d4f234386d3d1b4
2017-03-28 12:23:22 -07:00
Mario Bertschler
bf2d46efad Enable Promise App Icon in All Apps.
- feature flag defaults to true
- avoid adding additional workspace shortcut if promise shortcut already
  exists
- handle promise app removal in package added callback for success case

Change-Id: I694701e35cc94481a9c337df3a17b1e5aa2c3b4c
2017-03-21 16:44:38 -07:00
Sunny Goyal
43bf11d9c9 Separating methods for updating the model to a sepatate class.
Removing static access to model update methods, to allow for better
access control and testing

Change-Id: I9afe004dbf1b2fe50df422fd28bceea9230a4704
2017-02-16 13:50:14 -08:00
Sunny Goyal
278359539c Adding support for requesting addition of shortcut/widget
on the workspace.

Bug: 33584624
Change-Id: I664366822fe8088742faff2cce006239ab0771bc
2017-01-18 18:38:34 -08:00
Sunny Goyal
e6e7200791 Removing promiseIntent property from ShortuctInfo
> Instead of checking promiseIntent != null, using isPromise() for consistency
> Fixing bug where clicking a pending icon does not launch anything
> Fixing bug where draging an icon on Info target, permanently hides the icon

Change-Id: Ic8f6b56042dba42d5ed9aedb0f5947186e1a4208
2017-01-12 18:54:21 -08:00
Sunny Goyal
7c74e4ae64 No more UserHandleCompat
Bug: 32745285
Change-Id: I762fb4e268c1afe48a1860ab12a4ccb3f626aa95
2016-12-15 22:06:10 -08:00
Sunny Goyal
3be633b82f Adding support for app widgets in the InstallQueue
Bug: 32904959
Change-Id: I0d07a0c59d266493ae30a42579c1fa69b805009e
2016-12-12 08:37:33 -08:00
Sunny Goyal
2bcbe13c64 Moving ShortcutInfo creation in InstallShortcutReceiver to background thread
> Creating shortcut info requires iconCache access

Bug: 21325319
Change-Id: I3317d8b6824aa05b836f3ed3626f169d4d34f783
2016-11-30 05:47:57 +05:30
Sunny Goyal
f0ba8b7ca1 Moving various runnables in LauncherModel to individual tasks
> Adding tests for some of the runnable

Change-Id: I1a315d38878857df3371f0e69d622a41fc3b081a
2016-11-09 15:50:08 -08:00