Commit Graph

90 Commits

Author SHA1 Message Date
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
Jeremy Sim
6e0f34cc0a Merge "App Pairs (behind flag): Add new ItemInfo types and DB save functionality" into udc-dev 2023-04-22 03:21:17 +00:00
Jeremy Sim
7cf0dd9e03 App Pairs (behind flag): Add new ItemInfo types and DB save functionality
This is the second of several patches implementing the App Pairs feature behind a flag.

This patch includes:
- AppPairsController, a new controller that will handle creation, launching, and deletion of app pairs
- ITEM_TYPE_APP_PAIR is a new type of FolderInfo (FolderInfo now can be either a folder or an app pair, and should probably be renamed to CollectionInfo or something more generic in future)
- Necessary plumbing for these new types
- Database code that handles saving a new app pair to the database with the correct schema

Flag: ENABLE_APP_PAIRS (set to false)
Bug: 274189428
Test: Not included in this CL, but will follow
Change-Id: Ie3aefd4eb9171f471789f54876de742849d3013b
2023-04-21 14:23:54 -07:00
Sunny Goyal
348e518b2c Merge "Using a runtime generated layout for tests instead of defining xml" into udc-dev 2023-04-14 18:12:57 +00:00
Sunny Goyal
ab2f808196 Using a runtime generated layout for tests instead of defining xml
This allows support for easily setting up default layouts

Bug: 277345535
Test: Presubmit
Flag: N/A
Change-Id: I1c089d60ac3f8add8d7e1060d343e04d30afe094
2023-04-12 22:54:14 +00:00
Sunny Goyal
eb27546cc3 Removing remaining code around ENABLE_DATABASE_RESTORE
ENABLE_DATABASE_RESTORE feature is already removed
Also migrating some tests from BackupRestoreTest to RestoreDbTaskTest

Bug: 270392706
Test: Presubmit
Flag: N/A
Change-Id: I71822bbc2232008b3d2b4b9fbed0db5d889591e4
2023-04-12 15:52:35 -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
895392e923 Removing some obsolete features:ENABLE_MINIMAL_DEVICE, ENABLE_DATABASE_RESTORE
Bug: 270392984
Bug: 270392706
Test: Presubmit
Flag: N/A
Change-Id: I58c3e76de521e702fb44ccfc14c9b5a731b1d511
2023-04-07 13:59:08 -07:00
Hyunyoung Song
a38aab93b9 Revert "Revert "Hide the splash icon when launching with no view..."
Revert submission 21916962-revert-21447384-no-splash-UILAXIUPKJ

Reason for revert: Retry errorprone target

Reverted changes: /q/submissionid:21916962-revert-21447384-no-splash-UILAXIUPKJ
Flag: production issue. Not hidden behind flag
Bug: 269343536
Test: manual

Change-Id: Ia365f886d39d63472d72afc2033fc67e19109f57
2023-03-20 23:33:11 -07:00
Sebastian Franco
239ae0a995 Making sure there is a propper Chrome icon for the test to long press
In some cases, the test was long pressing on a recommendation for
google chrome and not a regular chrome icon and the events didn't
match. I don't think is good to relly on chrome getting recommended
so I'm making sure there is always a chrome app icon on the hotseat

Fix: 269163620
Test: atest TaplTestsLauncher3:testWorkspace (run on pixel 7 pro)
Change-Id: Ic8ee744a9af18d60de9bbedd42043f5abbbd7356
2023-03-09 14:59:21 -08:00
Eddie Lan
293688a9a0 Revert "Hide the splash icon when launching with no view and no ..."
Revert submission 21447384-no-splash

Reason for revert: build break
Bug: 272383391

Reverted changes: /q/submissionid:21447384-no-splash

Change-Id: I73565b1f4e5dd969237980b2b5dbeee7b563abcb
2023-03-09 09:00:29 +00:00
Luca Zuccarini
f295e3a85a Hide the splash icon when launching with no view and no item.
This is achieved by instead creating an empty item info that only
specifies the splash type to be solid color.

Bug: 269343536
Test: manual
Change-Id: Ibf5c8f1c949e26af207b8c6e382f71677b9acc2d
2023-03-02 18:19:38 +00:00
Luca Zuccarini
2098381808 [Toast] Introduce SysUI's animation library to the transition manager.
Bug: 250588519
Test: manual, see videos in bug
Change-Id: Iccc440c95ecc14d39e35d911798e239b698b950a
2023-01-27 13:49:40 +00:00
Sunny Goyal
eae7e58b20 Merge "Removing some unused container IDs" into tm-qpr-dev 2022-12-20 18:19:57 +00:00
Sunny Goyal
9ce4382b34 Removing some unused container IDs
Bug: 260012466
Test: Presubmit
Change-Id: I3d6cff0e5b31928ba8e27ac02c0d1f63156d1bfb
2022-12-16 13:02:48 -08:00
Alex Chau
f8b79d4235 Use overridden default xml for TwoPanelWorkspaceTest
- Partially reverted TAPL and TwoPanelWorkspaceTest changes on http://ag/19195512

Fix: 262627208
Fix: 262632384
Test: TwoPanelWorkspaceTest
Change-Id: I8b793bfb3874cc6305ce8b0f9f7b0a116d01222b
2022-12-15 15:48:09 +00:00
Andy Wickham
9345681737 Fixes ITEM_TYPE_SEARCH_ACTION to have a unique value.
It previously was the same as ITEM_TYPE_TASK.

Test: N/A
Bug: 254138853
Bug: 254140269
Change-Id: I6f09818e3c5c05cbcbb451147cf310d59c7064e0
2022-10-17 17:11:25 -07:00
Schneider Victor-tulias
fb252e7ce1 Add taskbar TAPL tests
- Added TAPL objects to support TAPL tests for taskbar features
- Added tests for major taskbar features: hiding/showing the taskbar, opening all apps, lauching apps and app deep shortcuts from the taskbar/all apps page, launching apps and app deep shortcuts in splitscreen
- These tests should only run for large devices

Design: go/taskbar-tapl-tests
Test: ran tests locally with invalid configurations and remotely
Bug: 215218813
Change-Id: I3c28c339707467414aa47fa633f87fa0c1fdee57
2022-03-10 13:02:35 -08:00
Alex Chau
9b3dd6c0b9 Revert "Clear only workspace shortcut / widget related tests"
This reverts commit 22be1a47f4.

Reason for revert: Breaks another test
Bug: 202546679

Change-Id: I796c508a6d7c00ec8c1d48e3517453f9eca0616c
2021-10-18 17:52:12 +00:00
Alex Chau
22be1a47f4 Clear only workspace shortcut / widget related tests
- This ensure hotseat to be populated with default items, so it won't result in an empty taskbar which get stashed in apps
- Workspace needs to be cleared because shortcut / widget dragging won't always work if there are items in workspace. It only happens in test due to the way we drag items.

Fix: 202546679
Test: NexusLauncherTests:com.android.launcher3.ui.widget.RequestPinItemTest
Change-Id: Ib3ded6a685eaa1b169b75fd179c9e29ca4be1e72
2021-10-15 16:01:44 +01:00
sfufa@google.com
ca76de0e6e Support drag/drop on search results
Bug: 199341710
Test: manual
Change-Id: I9879c2a3769d4f930ab0289d2f26e4757971549d
2021-10-04 13:14:12 -07:00
Brian Isganitis
f0ca4ae750 Add CONTAINER_WALLPAPERS for storing wallpaper info.
Test: No
Bug: 188222480
Change-Id: Id85bd46cdd384b359de82f47530a269eee99dd02
2021-09-13 16:41:46 -04:00
Yogisha Dixit
658c5dafd4 Log widgets source.
Test: manual
(1) Upgrading to new DB version is successful (no errors thrown in logcat)
(2) Widgets that were added with the old DB version have CONTAINER_UNKNOWN as their source container
(3) Widgets that are added with the new DB version still log source container after reboot
Bug: 185778648
Change-Id: Iaa38f0be6bc4cb0d29842f9a2ea0d08de000c930
2021-06-30 17:48:14 +00:00
Steven Ng
3a8353256a Widgets recommendation backend
Add a widgets recommendation mechanism based on AiAI app predication
ranking with the following changes:

1. Only one widget is picked from one app.
2. Widgets that are already added to the workspace are excluded from
   the recommendation.

Test: run PredicationUpdateTaskTest

Bug: 179797520
Change-Id: Ia697bc6df0bae75969e68b7b3de32d57901f7461
2021-03-08 23:37:51 +00:00
Andy Wickham
19ab177d1b Adds CONTAINER_QSB to be used for QSB data.
Also updates some related generics definitions for
better/simpler compile-time checks.

Bug: 178536734
Test: Manual
Change-Id: If439b64ad968f62674f856fd3ff465bf21cc9204
2021-02-11 22:16:24 -08:00
thiruram
73821a9c6d [AA+] Fixes wrong container for LAUNCHER_ITEM_DROP_COMPLETED log event.
Bug: 179529616

Change-Id: Id35c952c94d8a10743f147b194d3c27e22bc5062
2021-02-08 10:11:32 -08:00
Pinyao Ting
f39f351a0d fix the issue widget id can be wrong after restore
Bug: 171774227
Test: manual testing
1. randomly add/remove widgets to workspace
2. create a backup (Settings > System > Backup)
3. reset the device
4. restore from the backup
5. verify all of the widgets are restored properly

Change-Id: Id65e474dd9349aca715d7e6b88f8d58bc63066ae
2020-10-28 22:04:35 -07:00
Pinyao Ting
702ed27886 Fix the issue where shortcuts are removed in minimal device mode
When loading the workspace, Launcher pins/unpins shortcuts in comply
with the loaded workspace. Since minimal device mode creates a mostly
empty workspace, existing shortcuts are getting unpinned as a result.

To mitigate the issue this CL compares the db name and only invoke
sanitizeData when it matches the one defined in InvariantDeviceProfile.

Bug: 170611866
Test: manual
1. add some deep shortcut in workspace (e.g. long tap on chrome, drag
"incognito tab" to workspace)
2. opt-in to sunshine fishfood (g/sunshine-teamfood)
3. enable bedtime mode with minimal device in Settings -> Digital
Wellbeing -> Show Your Data -> Bedtime mode -> Customize -> minimal
device
4. toggle bedtime mode, wait for apps in minimal device to show, then
toggle off bedtime mode
5. verify the deep shortcut still exist

Change-Id: Ie18216ecb288e7481aa2404c4cb3ea418aee85cb
2020-10-15 12:56:44 -07:00
Pinyao Ting
96186aff87 Minimal Phone Mode (part-3)
Introduces a separate database for minimal device mode.

When minimal device mode is enabled/disabled:
1. WellbeingModel receives onChange event from ContentObserver
2. WellbeingModel called DWB's ContentProvider for latest state in
minimal device mode
3. Based on the state, WellbeingModel calls LauncherProvider to put
launcher into normal/minimal mode.
4. When going from normal -> minimal, Launcher switches to a different
database, namely minimal.db, then proceed to database initialization.
5. If the database hasn't been initialized yet, Launcher will call
ContentResolver#openInputStream with following uri:
content://com.google.android.apps.wellbeing.api/launcher_layout
to get the default layout xml.
6. The default layout is then saved in database, and the database is
considered initialized and doesn't need to go through step 5 again in
the future.
7. In case of minimal -> normal, Launcher switches back to its original
database (e.g. launcher.db if the grid size is 5x5), then reload launcher.

Bug: 161462256
Change-Id: I6bafa66440da23281f63454b698ea56b15960022
2020-08-19 14:58:20 -07:00
Hyunyoung Song
13c2bc7303 LAUNCHER_APP_LAUNCH_TAP should log correctly for icons inside folder
Bug: 137777105

Change-Id: I5c1552481fc1b788ba41c57bfe97f126f55e5b16
2020-06-11 23:51:17 -07:00
Hyunyoung Song
f26c7930de Fix double logging for wallpaper settings icon activation
Bug: 137957099

Change-Id: Id95fa026c1e6f177ffbb03e99cc18ef03e9a37b5
2020-06-07 22:03:06 -07:00
TreeHugger Robot
9f365cb782 Merge "Restore hotseat when user turns off suggestions immediately after migration" into ub-launcher3-rvc-dev 2020-06-03 20:56:24 +00:00
Samuel Fufa
f667a1352d Restore hotseat when user turns off suggestions immediately after migration
- Creates a backup table `hybrid_hotseat_restore` and copies current workspace layout before hotseat migration
- restores to back up when user turns off suggestions and launcher receives empty predicted items
- deletes hybrid_hotseat_restore table if there's a layout change

Test: Manual
Bug: 157688471
Change-Id: Iaf7ddb33799493d36dbcd12408b57224162221d9
2020-06-03 13:15:21 -07:00
thiruram
63bf8eedf9 Add WW log for drag events from longpress popup window.
Bug: 157765763
Sample Log: https://docs.google.com/document/d/1CBP2yTcXdFhPdNG5ZmWFKSgd8mDbMevY-akVlUXPLDo/edit#bookmark=id.368csp9y1pwc

Change-Id: I73024f2c8010e77b6f89829fda64130f54ff81f1
2020-06-01 21:55:25 +00:00
thiruram
62c7b5c8f7 Adds WW logging for QSB search results & all-apps predicted row.
SearchResultContainer represents apps rows displayed within QSB search results for both default scenario(without search term) and actual search result(with search term).

SearchResultContainer is used for both homescreen QSB and all-apps QSB.

Follow up CLs will add searchOrigin and queryLength in SearchResultContainer

Bug: 152978018
Change-Id: Id5f96490686c4141e3e6b2516907ac0505a777e6
2020-05-27 20:29:40 -07:00
thiruram
6bf6848951 Introduces CONTAINER_WIDGETS_TRAY to LauncherSettings.Favorites.
This would log LAUNCHER_ITEM_DRAG_STARTED event when an item is dragged from widgets tray. This also fixes empty component with widget logs.

Sample Log: https://docs.google.com/document/d/1CBP2yTcXdFhPdNG5ZmWFKSgd8mDbMevY-akVlUXPLDo/edit#bookmark=id.bk5w3n8uwhcl

Bug: 152978018
Change-Id: I51d16edae13973d5e62adda0e4efa861fa10dc1b
2020-05-18 16:44:46 -07:00
thiruram
261c3a6f6c Adds CONTAINER_ALL_APPS to LauncherSettings.Favorites.
Change-Id: I6ee81ef4e009ee99754545b5c8686dc0f9e261a2
2020-05-06 22:44:37 +00:00
Sunny Goyal
e396abf502 Moving model data structures to a separate file
Change-Id: I77ad7a5219e72d2e0d6c1803de2ac3ed6a65a8f7
2020-04-09 13:20:39 -07:00
Tracy Zhou
c0000450b5 Support grid preview with v2 migration algorithm
The focus of ag/10346770 is around the actual algorithm, while in the meantime our preview logic has changed during the code review of ag/10100264.

GridSizeMigrationTaskV2 addresses both cases, the difference being preview passes in constructed IDP while actual migration uses IDP from the current Context.

When doing actual migration, we call METHOD_UPDATE_CURRENT_OPEN_HELPER to update the current db helper and copy the favorites table from the previous db into the current db in favorites_tmp table. Then we do migration from there.

When calculating preview, I added METHOD_PREP_FOR_PREVIEW in this change to copy the favorites table from the intended grid setting to the current grid setting in favorites_preview table. Then we calculate migration from the current favorites table to favorites_preview table and save into favorites_preview table.

Bug: 144052802
Fixes: 144052839

Test: Manual

Change-Id: I64a8b61a4e0bf8399c0ae1af4ef9d2bde0f1ee2f
2020-03-25 21:58:19 -07:00
Tracy Zhou
f601872a0a The new grid migration algorithm
go/grid-migration-v2

When changing grid from option 1 to option 2, we calculate the diff and add the icons that are in option 1 but not option 2, to option 2's workspace, according to the reading order.

Test: manual and unit tests
Fixes: 144052802

Change-Id: Id01f69e90ce656a9b7c9051fed499807ee9ac0f7
2020-03-13 14:56:38 -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
Tracy Zhou
7df93d28d4 Setup infrastructure (multi-db support) for the new grid migration algorithm
We'll have a db for each grid option and a db for back up / restore.

TODO(pinyaoting): support back up / restore using the new infrastructure, particularly calls to GridBackupTable should use different DBs when the feature flag (NEW_GRID_MIGRATION_ALGORITHM) is on.

Bug: 144052802
Test: N/A

Change-Id: I644a3e70148bd78204a747a337446a3c038f616f
2020-02-05 19:55:05 -08:00
Pinyao Ting
ba9c557108 Initial support for restore workspace from last stable db entry.
(see go/play-launcher-plan-launcher-implementation)

1. When Launcher launches for the first time, creates a backup
   of the workspace before sanitizing db entries.
2. Creates a new path in LauncherProvider that triggers workspace
   restore using last stable db entry of the same grid size.
3. When restore from backup created this way, the table will be
   sanitized afterward.

Test:
1. apply on master, build & refresh on physical device
2. factory reset, go through SuW and perform restore
3. exit SuW without signing into Work Profile
4. run following commands in console
adb root
adb remount
adb pull
/data/data/com.google.android.apps.nexuslauncher/databases/launcher.db
sqlite3 ./launcher.db
.tables
SELECT * FROM favorites_bakup;

Bug: 141472083
Change-Id: I8032866a97eb333946d4f62352595d180364126b
2020-01-16 12:23:45 -08:00
Samuel Fufa
225ac27143 Predictive hotseat prototype
Supports filling hotseat with predicted apps, pinning of predicted apps
and manages replacing predicted apps with user drag.

Bug:142753423
Test:Manual
Change-Id: I224294f9353a64c46d28c22263a72332a79fddf4
2019-10-30 13:19:10 -07:00
Samuel Fufa
d3720c210b App title in Widget list shouldn't be actionable by a11y methods
Bug:139913027
Test:Manual
Change-Id: I2a5d5551d09ee2bc96444164ed77225a3b4a829a
2019-09-06 13:21:56 -07:00
Samuel Fufa
866ff00eb3 Add a "Dismiss" option for predicted apps in Launcher
Test: LongPress on a pridicted app to see dismiss options.
Bug:139020180
Change-Id: I877863c65def0d845c0ae2f0987fe7a4f6277565
2019-08-13 23:57:11 +00:00