Commit Graph

55 Commits

Author SHA1 Message Date
Rohit Goyal
25ef2e1eca UI Improvement: Do not add archived app icon to workspace when unarchival starts in case the icon already doesn't exist.
Test: verified bugfix locally.
Bug: 319213296
Flag: ACONFIG com.android.launcher3.enable_support_for_archiving DEVELOPMENT
Change-Id: Iad3cc1a254b1543511976469c444eeaf869c7d50
2024-02-01 20:52:19 +00:00
Sunny Goyal
e274d97fe5 Removing support for lagacy shortcuts
> Addition/removal of  shortcus is already removed. This just
  cleans up the unused code path

Bug: 275875209
Test: Updated tests
Flag: N/A
Change-Id: I8ab7f57b693f996920e50e8beecafcffab5167e9
2023-05-17 09:20:45 -07:00
Schneider Victor-tulias
fff7cef9f1 Remove unused debug logs
Removing debug logs for bugs that have already been closed. These logs are filling up the logcat buffer and impeding in other test investigations.

Flag: not needed
Test: Tapl tests
Bug: 260260325
Change-Id: I4d69b904f2ea79d758cf6bef7d90d172f2eb2a91
2023-04-25 11:00:37 -07:00
Pinyao Ting
777c13eb00 Explicit Nullbility in Launcher (Part 5)
This CL addresses the nullbility in LauncherModel and update tasks.

Bug: 242895652
Test: manual
Change-Id: Ied635c944c3656f0d493b295f772aa0329b354b9
2022-09-16 17:17:16 -07:00
vadimt
f6ef879cf4 Moving all sources that are shared between Launcher and TAPL in one directory
This will help SysUI test team (who uses TAPL) to set up Gradle build for their tests.

Bug: 202567877, 234414088
Test: presubmit
Change-Id: I3d923ea4b54d1a4c3d2b345be09692727d30433e
2022-07-27 20:18:46 +00:00
Sunny Goyal
f0ff70a2a5 Adding support for easily extending Launcher DragAndDrop support
Bug: 232165524
Test: Verified locally
Change-Id: I3b4f37bc9914de55330662edd678e6fdd0eafece
2022-05-11 21:34:08 +00:00
Andras Kloczl
68e1af2bc2 Separate workspace item finding logic
Extract the item finding logic from AddWorkspaceItemsTask
to a separate class and write tests.

Test: AddWorkspaceItemsTaskTest.kt , WorkspaceItemSpaceFinderTest.kt
Bug: 199160559
Change-Id: Ie1bc4fcd4f94cd7cb0601c21bbdf273452b9dd1f
2022-03-29 13:31:31 +01:00
Jon Miranda
701774d021 Add debug logs for testPromiseIcon_addedFromEligibleSession
Bug: 202985412
Test: PromiseIconUiTest
Change-Id: I160b9229bebe07015575f8184ac2d53bcbf2bad0
2022-02-10 17:26:11 -08:00
Andras Kloczl
953eb8041e Fix LauncherProvider newScreenId issue
Remove maxScreenId from LauncherProvider and whenever we need
a new screenId, query the database to calculate a new screenId.
Also converted and refactored AddWorkspaceItemsTaskTest
and added some extra test cases.

Test: manual & AddWorkspaceItemsTaskTest.kt
Bug: 199160559
Change-Id: I185f6823fed171d778af0130497f5ffaf89c0a70
2021-11-12 19:56:07 +00:00
Andras Kloczl
8c574de97f Two panel home empty page removing logic change
- Don't remove a single page if it's empty, only if both pages are empty.
- Add back empty pages after they were removed while the phone
  was on single panel home.
- On two panel home don't add new workspace items onto the second screen

Test: manual
Bug: 196376162
Change-Id: I4c54ffa3b359a236deb3ab67adb54111e77ec896
2021-08-26 12:06:50 +01:00
Alex Chau
1e4484669d Remove widget panel
- Remove all usage of LEFT_PANEL_ID and fixed left panel code
- For preview renderer, load screen 0 + screen 1 instead
- Added a split display specific default workspace layout, with a placeholder app to pass test before we implement page pairing(b/196376162)
- Known issue: If screenId 1 is deleted, right panel will disappear from Wallpaepr & Style because there is no screenId 1. Will be resovled after page pairing(b/196376162)

Bug: 175939730
Test: manual and TaplTestsLauncher3#testWorkSpace
Change-Id: Icac1c94165c14a49c17897c45355b6cdc4d87e91
2021-08-13 21:48:35 +01:00
Sunny Goyal
12e3f1f2f7 Removing UI dependency from LauncherModel in case of 2-panel layout
Bug: 175939730
Bug: 192431856
Bug: 185515153
Test: Manual
Change-Id: I8baa1cf9e5a8a04d5b8bc38c1f4b0755265cd8a9
2021-07-22 10:34:25 -07:00
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