Commit Graph

62 Commits

Author SHA1 Message Date
fbaron
c0e687bad8 Add smartspace removal option as a toggle
Bug: 303471576
Test: try removing smartspace by going to home settings and turning it off
Flag: ENABLE_SMARTSPACE_REMOVAL
Change-Id: Idd95da1b302927885a8c469e38db6d3c5130f8c1
2023-10-05 17:26:03 +00:00
fbaron
e58aaf1802 Add smartspace as a widget to first page (implementation 2)
Flag: SMARTSPACE_AS_A_WIDGET
Test: verify that the smartspace gets replaced with a smartspace widget
Bug: 300140279
Change-Id: I42c170de5e2a9fd3d24d99bb8b09cf412c55e3a5
2023-09-29 18:16:09 +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
Sunny Goyal
7bc6cdee56 Revert "Revert "Revert "Revert "Revert "Revert "Changing GridMigrationTask to use ModelDbController directly""""""
This reverts commit 09905cfa90.

Reason for revert: Fixed the crashing issue

Change-Id: Ibcfc28a89356d262e67e8842d6bae37e230a70f5
2023-05-13 01:59:19 -07:00
Sunny Goyal
09905cfa90 Revert "Revert "Revert "Revert "Revert "Changing GridMigrationTask to use ModelDbController directly"""""
This reverts commit bca4e694f0.

Reason for revert: post submit broken

Change-Id: I8afc63b5aa67ee14127f79e2245ef543bff8cf31
2023-05-11 22:22:16 +00:00
Sunny Goyal
bca4e694f0 Revert "Revert "Revert "Revert "Changing GridMigrationTask to use ModelDbController directly""""
This reverts commit 3772b246c2.

Reason for revert: Fixed the test failure

Change-Id: Ibdc9e184fcb32c7caa4ab25d8753a46fa322b703
2023-05-10 17:49:16 +00:00
Sunny Goyal
3772b246c2 Revert "Revert "Revert "Changing GridMigrationTask to use ModelDbController directly"""
This reverts commit 8d9e468dbb.

Reason for revert: b/281179368

Change-Id: Ibfc5329f72cdbcb37d01a8bf3dac2ba0724b9faf
2023-05-06 18:18:07 +00:00
Sunny Goyal
8d9e468dbb Revert "Revert "Changing GridMigrationTask to use ModelDbController directly""
This reverts commit 30bb3a247a.

Reason for revert: Fixed original issue

Change-Id: I02d85d604631795d96f0379eb94b7b6789102ea9
2023-05-05 16:00:49 +00:00
Charlie Anderson
30bb3a247a Revert "Changing GridMigrationTask to use ModelDbController directly"
This reverts commit 9ef41413e0.

Reason for revert: This was the only launcher CL during the time  b/280669657 and 280680602 occurred

Change-Id: Id7107f0935f84908ca87e1ae4c62ab05efe41a24
2023-05-04 15:19:58 +00:00
Sunny Goyal
9ef41413e0 Changing GridMigrationTask to use ModelDbController directly
instead of using content uris

Bug: 277345535
Test: Updated tests
Flag: Presubmit
Change-Id: Ib62db3334c01d9e7d27ae7b02ea703d046e2bcaa
2023-05-03 08:54:14 -07:00
Sunny Goyal
ce953a36ec Moving ModelDbController from LauncehrProvider to LauncherModel
Migrating some of the class to use the controller directly, will
update the remaining calls in follow up cls

Bug: 277345535
Test: Presubmit
Change-Id: I8edc7c43665f94702ac64bd92932d6c94cb544a4
2023-04-14 14:13:17 -07:00
Sunny Goyal
84b48d8deb Removing support for adding legacy shortcuts.
All existing legacy shortcuts will be migrated one-time to deep shortcuts
This shortcuts are pinned under the Launcher package, with custom badging

Bug: 275875209
Test: Updated unit tests
Flag: N/A
Change-Id: I7da001f724776ad8d6c807517b7e4e259de626c2
2023-04-10 12:28:52 -07:00
Sunny Goyal
efad3c2f92 Using internal format cache for loading user badged label
Bug: 267683009
Test: Manual
Change-Id: I7d1df2704c4513bd80e2b6adb7a3921637fa617b
2023-02-17 18:05:25 +00:00
Stefan Andonian
05ca3a8089 Refactor Workspace Loading / Processing code.
There are no behavioral changes (other than we no longer are recycling
objects while processing workspace items), but this refactor will setup
the next change to load the first workspace page before other workspace
pages.

Bug: 251502424
Test: Workspace, app widgets, and containers loaded properly.
Change-Id: I437aab40000d841d7fcc4380d05ab4a8f5d5c2ad
2023-02-15 17:36:27 +00:00
Sunny Goyal
c5c7da9a8b Removing some obsolete features
PROMISE_APPS_NEW_INSTALLS = true
ENABLE_QUICKSTEP_WIDGET_APP_START = true
FOLDER_NAME_SUGGEST = true
ENABLE_PREDICTION_DISMISS = true
HOTSEAT_MIGRATE_TO_FOLDER = false
ENABLE_DEEP_SHORTCUT_ICON_CACHE = true
ENABLE_THEMED_ICONS = true
ENABLE_ALL_APPS_EDU = true
EXPANDED_SMARTSPACE = false

Bug: 241141733
Test: Presubmit
Change-Id: I72c0c20ab7e214994dc3c3665c90e85d45991a7a
2022-08-02 13:38:38 -07:00
Sunny Goyal
412f0d26fa Fixing icon label not updated during bulk load
The label was being updated to default in Loader cursor
which prevented eventual final update of the label

Bug: 220645719
Test: Verified on device
Change-Id: I2559804eb885663387bd1f5afe9e3337130a9fe3
2022-07-25 17:24:34 +00:00
Andy Wickham
56be73be80 Utilities.trim never returns null.
This fixes a crash loop I was seeing on my device and also
preemptively fixes similar NullPointerExceptions.

Bug: 213931730
Test: Manually verified crash loop stopped with this change.
Change-Id: I8d2fc8475d42ac60b7fdc9219421a8c9733c7b9f
2022-01-18 09:13:43 -08:00
Alex Chau
e09067c2f4 Allow items to be added alongside smartspace
- Allow icons to be added to first row where search container does not occupy
- On upgrade, clean up first row of screen 0 which may have junk data, as we used to assume first forw of screen 0 is always occupied

Bug: 210127246
Test: manual
Change-Id: I835a321964984e02632c8a70474a6551b5e360f7
2022-01-10 18:24:15 +00:00
Schneider Victor-tulias
c817dac4cd Merge ag/16307859 into master without bug fix.
- Copied ag/16307859, with a modification to QuickstepModelDelegate#getContainer. This allows the crash from b/173838775 to continue occuring with additional debuging logs.

Bug: 173838775
Test: manual
Change-Id: Ic96a25665457c80f5c9ab45a896fada34a3a68ff
2021-11-30 12:08:23 -08:00
Schneider Victor-tulias
8664cb1261 Revert "Fix ClassCastException in QuickstepModelDelegate"
This reverts commit 380f8fd890.

Reason for revert: remove bug fix on master

Bug: 173838775
Change-Id: I3cbb3e383c52095a10b3e22ea4c586c0c3c8d7a9
2021-11-29 22:34:04 +00:00
Schneider Victor-tulias
380f8fd890 Fix ClassCastException in QuickstepModelDelegate
- Added a casting check as an immediate fix to b/173838775
- Added logging to help debug the corrupt state where an item of type other than FolderInfo is used as an other item's container.
- Added LoaderMemoryLogger for adding large logs that are only conditionally printed.

Bug: 173838775
Test: manually checked logs
Change-Id: I9491cb421b9fb807d5fb110b04ad069481de768f
2021-11-24 14:26:45 -08:00
Pinyao Ting
35c5755b71 Fix the fallback logic for shortcut icons when icons are missing
The icons of shortcuts in general are not persisted in backup payload
and thus are not available on the new device, apps are reposponsible for
republishing those shortcuts on the new device, with the only exception
being pinned shortcuts, whose icons are stored in launcher.db as a
fallback when icons are not avaialble in the shortcut themselves.

A previous CL unexpected excluded deep shortcuts from loading their
fallback icons in launcher.db, causes pinned shortcut to fallback
further to default droid icons, this CL restores the original behavior.

Bug: 202346722
Test: manual
Change-Id: Ie09becd3a0dc1ca1e7c2573fe1b68b61a58c2091
2021-10-26 18:02:08 +00:00
Schneider Victor-tulias
b988ab77cb Improve workspace loading times.
Updated loadWorkspace to load all required icons in a series of bulk sql queries. This reduces the cost of SQL lookups (up to two lookups per user, rather than one lookup per icon)

Bug: 195674813
Test: Added all icons to workspace, added duplicate icons, added icons for same component name from different users

Change-Id: I56afaa04e7c7701f0d3c86b31c53f578dfa73fe6
2021-09-15 17:09:06 -07:00
Sunny Goyal
c86eb1abf4 Ignoring invalid deep shortcuts during load
Bug: 182728800
Test: Manual
Change-Id: I880c2c8898f7a968024bf7b95e763f4293ee19a0
2021-05-07 16:06:20 -07:00
Tony Wickham
b87f3cdc1c Add support for having more hotseat icons in the DB than we show
Split InvariantDeviceProfile#numHotseatIcons into two variables:
numDatabaseHotseatIcons and numShownHotseatIcons. These are generally
the same, but different DisplayOptions within the same GridOption
can choose to show different numbers of hotseat icons while sharing
the same database.

numDatabaseHotseatIcons is used for all reading/writing/migrating
purposes, while numShownHotseatIcons determines how many Hotseat
icons to show in the UI.

Test: Existing tests pass, added two new migration tests
Bug: 184789479
Bug: 171917176

Change-Id: I54583504f61a47a4444b6a637ebb7e3ab31528b7
2021-04-12 16:08:15 -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
alexmang
6c666fb196 Add a feature flag to expand smartspace to three rows
In order to experiment with presenting more predicted content to the
workspace I have added a flag to expand smartspace to two rows.

This CL does not include any app relocation. If an app lives in a space
the expanded smartspace will occupy, it will be removed from workspace.

Change-Id: I38354dc81a34a495828cf7a69ddb04cc137e2e4e
2020-10-20 09:32:29 -07:00
Sunny Goyal
762d06136c Caching last predictions and loading it with model
Adding support for persisting itemInfos on disk. This uses
a separate xml file. Unlike prefs, it does not keep the items
in memory and is just a wraper over reading/writing a file.

Bug: 160748731
Change-Id: Iaccab9928ab8f30127fb3c2d630ca8ca83f0bd05
2020-08-11 13:23:29 -07:00
Sunny Goyal
28daf4a76f Removing multiple system RPCs to packageMAnager and userManager from UI thread
Bug: 158427348
Change-Id: Ibb1837fe932000b69cf5683bb01727fc32abca91
2020-06-08 17:56:36 -07:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Hyunyoung Song
7ac0ef1cb1 ItemInfo supports lite proto builder (1/n)
Bug: 144953948
Bug: 137777105

The new lite proto builder is used to send two types of logging to statsd
1) Snapshot logging
2) App launch, task launch, task dismiss

Statsd will be connected once platform CL is submitted

Change-Id: If606cee5288fe4bd6c522605ae84eb0f24174f5b
2020-03-31 20:52:36 -07:00
Tracy Zhou
be13d109b7 Render user's actual workspace in ThemePicker preview (Part 3)
go/grid-migration-preview

With this change, we can see actual grid migration in wallpaper preview.

The approach here: we use a tmp table (favorites_preview) here specifically for this preview (to write off the migration results), and load from this tmp table workspace items if migration is necessary and successful. Otherwise, we load from the current workspace.

UPDATED: this change should be completely compatible with the new multi-db grid migration algorithm. Here is why
1. In LauncherPreviewRender#renderScreenShot, I added a check to decide which grid migration preview method we should call. Once v2 preview method is implemented, it should be integrated with other parts of this change perfectly (the reason will be mentioned below).
2. While we have multiple DBs, mOpenHelper in LauncherProvider always points to the current db we are using. Queries using CONTENT_URI is routed to whatever DB mOpenHelper points to, so it works perfectly to directly operate on CONTENT_URI even when we use multi-db underneath the hood.
3. With 1 and 2 mentioned, I believe in order for this preview change to support multi-db, we only need to implement the V2 grid migration algorithm. Because most of what we are doing in this change is wrapped in GridSizeMigrationTask, it's perfectly safeguarded.

Bug: 144052839
Change-Id: Ie6d6048d77326f96546c8a180a7cd8f15b47e4c4
2020-02-21 15:49:00 -08:00
Sunny Goyal
18204e4eea Various icon cache fixes
> Multiple instances of LauncherIcon created when
    LauncherIcons refers IconCache which in turn creates new LauncherIcons
> Widget icons are never cached as they were using low res icons
> Shortcut drag icons are not loaded synchronously
    when using PinItemRequest flow
> Wrong lastUpdatedTime is used in iconCache for shortcuts
> IconUpdateHandler does not ignore managedUser promise icons

Change-Id: Ie7eed68a30fad11d1861b6c70c380953a15ae1cf
2020-02-06 14:16:34 -08: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
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
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
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
Jon Miranda
7143ba6fec Make QSB_ON_FIRST_SCREEN a boolean.
Bug: 118140522
Change-Id: Ic8e47e71f538b0b0caff6f630566665d05a65522
2019-03-15 09:11:54 -07: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
b891eebbb5 Fixing shortcut icons are not getting correct color extraction.
> Avoiding color extraction for icons which have already be evaluated
> Fixing color extraction from hardware bitmaps

Bug: 111343544
Change-Id: I624866e892465684871fbc130003e32945d86460
2018-11-30 01:41:56 -08:00
Sunny Goyal
d7239fcc52 Removing UserManagerCompat wrapper for getting baded label
This removes some crass dependency on Launcher compat implementation
making it easier to move iconCache to a separate library

Change-Id: If5fab0c82d98089cde6f54b6a374fb7bb2db5ae8
2018-11-05 17:33:15 -08:00
Hyunyoung Song
cda96a5b43 Setup make icon-loader library
Bug: 115891474

Test: make -j10 icon-loader
Next step: Launcher will depend on icon-loader in next CL

Change-Id: I797ddb857cf8be79f3be6ca2f174c593ca3713a5
2018-10-19 14:33:46 -07:00
Ryan Lothian
fa530cd23f Make flags UI available on release build of launcher
The UI will only be shown on eng/userdebug platform builds.

Bug: 117223984
Change-Id: I27843f2d856a4a19f3fe53c4d306606eaa5714a2
2018-10-15 17:24:48 -04: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
Ryan Lothian
688e9896fa Groundwork for runtime-toggleable feature flags
This is the first step in adding a flag toggler UI to launcher.
The change migrates a single flag (QSB_ON_FIRST_SCREEN) from a
boolean constant to a boolean method. In future, that will allow
us to return different values at runtime.

Bug: 117223984
Change-Id: I1e62c91dd941b8145166021bc0aa157733e62ea0
2018-10-08 13:17:30 -04:00
Hyunyoung Song
48cb7bc7a4 Move IconNormalizer/ShadowGenerator/LauncherIcons to icons package
Bug: 115891474

Sending out the package name changing CL first before I make
LauncherIconsHandler and tests around it.

Change-Id: Ic10479a06333e1435b392a7072cd08782e710cbd
2018-09-26 11:57:37 -07:00
Sunny Goyal
f840f10d50 Removing additional rpc due to icon cache update
When launcher loads, it fetches the list of apps twice, once for
loading all-apps and again for updating icons. Instead reusing
the previously fetched apps list.
Also moving the icon loading in a separate package for further
generalization

Change-Id: Ibd2dae56e6027a31b633da030bc6b43a90b27e1b
2018-09-21 15:27:03 -07:00
Sunny Goyal
36b54228fc Retiring some feature flags
Change-Id: I80a00ecaec0785ce2ba6a5f14a54c8a76f555d43
2018-07-10 13:52:17 -07:00