Commit Graph

1772 Commits

Author SHA1 Message Date
Sunny Goyal 50c9126cc3 Merge "Adding main thread binder tracing in development build." into udc-qpr-dev 2023-06-01 17:27:21 +00:00
Sunny Goyal 3db98b1152 Adding main thread binder tracing in development build.
> Unifying multiple binder tracing implementations
> Removing wallpaper customization check as it has been rolled out
  few years ago, this avoids additional RPC to check for wallpaper
> Removing RaceConditionReproducer as it is not used anywhere and
  is not integrated with this tracing anymore

Bug: 273718665
Test: Presubmit
Flag: N/A
Change-Id: I801af5d039a9d38d5d39e803723ec6da50a9d59f
2023-06-01 09:39:50 -07:00
Schneider Victor-tulias 807f6d1828 Merge "Fix flaky null pointer in LauncherWidgetHolder" into udc-dev am: 2b06cbc748 am: d9a7a143f8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23454674

Change-Id: I12c4749ee9b9740796bf4380a728b678757ebdf3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-31 23:43:51 +00:00
Kateryna Ivanova 7120373bbc Migrate Interpolators from Launcher3 to the public animation library
Test: atest
Bug: 271850966
Change-Id: Iba999f2e753764a37d35e508e707df02388432e9
2023-05-30 07:20:38 +00:00
Schneider Victor-tulias fb2affac5f Fix flaky null pointer in LauncherWidgetHolder
- LauncherWidgetHolder.startListening is called before Launcher.setupView, so it's possible for getWorkspace() to be called as part of the appWidgetRemovedCallback. Reordered these calls to fix this null pointer

Flag: not needed
Fixes: 283850341
Test: Screenshot tests
Change-Id: Ied1f23647721fc4199eab2a5a79def1e306b00f3
2023-05-26 15:09:41 -07: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
Charlie Anderson afb447ee0d Merge "Adding a new Edit Mode LauncherState" into udc-dev 2023-05-16 18:42:34 +00:00
Sunny Goyal 4fdc9181dd Adding support for listening to end callbacks when launching an intent from Launcher
Also moving various state handling to these end callbacks enstead of relying on resume

Bug: 265134143
Test: Verified that the end callback is received
Change-Id: I326a99c80154d244c0e49f678717c476602b6240
2023-05-15 10:31:06 -07:00
Charlie Anderson 438d405aab Adding a new Edit Mode LauncherState
- Edit Mode doesn't close after dragging / dropping an app
	- Edit Mode can be entered through options popup menu, Spring Loaded still entered by dragging items
	- Adds new onLeavingState call to launcher states to cleanup changes

Bug: 279590398
Flag: MULTI_SELECT_EDIT_MODE
Test: manually tested the new state with flag on/off

Change-Id: If4550037f9659dcb8cd8b1943388d1ec5d55fa29
2023-05-12 14:54:45 -04:00
Xiaowen Lei 7c8aeffa4e Merge "Add Lifecycle and SavedState support in Launcher ActivityContext." into udc-dev 2023-05-09 22:07:40 +00:00
Xiaowen Lei 3c0f30a2bb Add Lifecycle and SavedState support in Launcher ActivityContext.
And call initCompose() in Launcher.java. Therefore there is no behavior
change for BaseActivity, or other ActivityContext subtypes that don't
call initCompose().

This should work for non-activity subtypes of ActivityContext. It's
likely that the Launcher activity will require more complete supoort for
Lifecycle and SavedState.

Note: In order to test the ComposeView, need to build this CL together
with ag/22461463.

1. `ViewTreeLifecycleOwner.set(..., ...);` is necessary to fix the
   following crash:

java.lang.IllegalStateException: ViewTreeLifecycleOwner not found

This error comes from WindowRecomposer.android.kt
  - http://cs/androidx-platform-dev/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/WindowRecomposer.android.kt;l=351-354;rcl=5673af1441ebe04c776f528193dfc5f85c0c9a66

2. `ViewTreeSavedStateRegistryOwner.set(..., ...);` is necessary to fix
   the following crash:

java.lang.IllegalStateException: Composed into the View which doesn't propagateViewTreeSavedStateRegistryOwner!

This error comes from AndroidComposeView.android.kt.
  - http://cs/androidx-platform-dev/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt;l=1178-1183;rcl=5673af1441ebe04c776f528193dfc5f85c0c9a66

3. The lifecycle needs to be STARTED. Otherwise the ComposeView doesn't
   show up in its parent (i.e., isn't drawn).
  - In ComponentActivity, `onSaveInstanceState` starts the lifecycle.
  - In ComposeInitializeImpl (from SystemUI),
    ViewLifecycleOwner.updateState() starts the lifecycle when the
    window is visible and in focus.
The implementation in this CL does the same thing as the
ComposeInitializeImpl.

Bug: 275905704
Test: on device, trigger a card such as the timer
Test: RUN_ERROR_PRONE=True m out/soong/.intermediates/packages/apps/Launcher3/Launcher3/android_common/lint/lint-report.xml
Test: RUN_ERROR_PRONE=True m out/soong/.intermediates/vendor/google/gms/packages/SearchLauncher/SearchLauncher/android_common/lint/lint-report.html
Test: Presubmit
Change-Id: Ieced66ad5238916a82ea13c01f69146bbdcf287a
2023-05-09 09:40:03 -07:00
Sebastian Franco a64f3a6c98 Call getModelWriter() to get the newest version instead of using the old one
DropTargetHandler was calling getModelWriter() on a final variable
and the model writer it was using was and old one.

Fix: 280170665
Test: Manul test, delete widget and rotate the device, you have to do this twice.
Change-Id: I7b3ac4b272568fcc81438ffd5ac84cf7b64a62ea
2023-05-05 16:09:38 -06:00
Josep del Rio 1d976c6702 Close floating panels on Launcher when using Escape
This change will make the Escape key close floating panels in
Launcher.

Bug: 280801803
Test: Flashed on device, tried with physical keyboard and panels
will close.

Change-Id: Ie09e57716a7be74638037abe6272b47eec1b8a6c
2023-05-04 16:07:50 +00:00
Fengjiang Li 5a36c17a32 [1/n] Launcher Startup Latency: add StartupLatencyLogger to launcher3 and log startup latency
More details at "Log Startup Latency" section in go/launcher-startup-latency

Test: tested on phone, foldable and tablet, print latency logs in logcat
Bug: 278092752
Change-Id: Ibf269b0ecd6007d29b95e36f65ab6f02c45deb3a
2023-05-02 17:08:05 -07:00
Schneider Victor-tulias 8c1bffb24f Merge "Remove unused debug logs" into udc-dev 2023-04-27 17:44:42 +00: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
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
Fengjiang Li 5068718fe8 Merge "Check build version before using predicitve back API" into udc-dev 2023-04-21 20:22:09 +00:00
Fengjiang Li d0c2359a49 Check build version before using predicitve back API
Test: build and run app
Fix: 278798546
Change-Id: I4a7b226b1d710cc84ef40b59a33f50a84aca84bb
2023-04-21 09:38:59 -07:00
Andrew Cole 0d775d3508 Merge "Unit testing ButtonDropTarget" into udc-dev 2023-04-20 23:35:49 +00:00
Andrew Cole 44898c3db4 Unit testing ButtonDropTarget
Originally there was a bug in a method (isTextClippedVertically) in ButtonDropTarget. While attempting to write a unit test it became necessary to refactor ButtonDropTarget and DeleteDropTarget to decouple them from their dependency on launcher in order to allow for a unit test to be written

The pattern we are introducing here is to decouple Launcher from a controller, in order to facilitate easier testing.
Instead of calling Launcher.getLauncher() we call the method through ActivityContext, which has a testing wrapper already defined. Here is a diagram that explains the old and new pattern

Design Pattern: https://screenshot.googleplex.com/7apiE2DaGDrFzy9.png

Test: isTextClippedVerticallyTest
Bug: b/274402490

Change-Id: I1f3003d0b62dddbceb6e492b15aa5d7352d3a293
2023-04-20 11:22:27 -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 7b74a5c53f Merge "Revert "Revert "Revert "Simplifying some page indicator dots attributes so that it can"""" into udc-dev 2023-04-07 01:02:09 +00:00
Sunny Goyal 5cd1b198b0 Revert "Revert "Revert "Simplifying some page indicator dots attributes so that it can"""
This reverts commit 7025765c72.

Reason for revert: 274169859

Change-Id: I86a114bf2c713fea6ec7095f68816820ba5f7495
2023-04-06 22:33:11 +00:00
Tracy Zhou 7a8cbd3186 Merge "Support second meta key closing the all apps tray" into udc-dev 2023-04-04 20:13:23 +00:00
Tracy Zhou cb93ec5f21 Support second meta key closing the all apps tray
Bug: 270244718
Test: Tap meta key twice, see all apps tray open an close
Change-Id: I6db84aa16b7d21663053bf1b269af6ba36874e47
2023-04-03 20:26:39 -07:00
TreeHugger Robot 331ab34a2a Merge "Revert "Revert "Simplifying some page indicator dots attributes so that it can""" into udc-dev 2023-03-31 20:10:37 +00:00
Sunny Goyal 7025765c72 Revert "Revert "Simplifying some page indicator dots attributes so that it can""
This reverts commit 0263a679f2.

Reason for revert: Trying again to confirm if this was the actual cause of regression

Change-Id: I2a663015d7ecdcf315634d8a976bf8294b58981d
2023-03-31 17:10:15 +00:00
Schneider Victor-tulias f8f602d76c Merge "Fix TwoPanelWorkspaceTests" into tm-qpr-dev am: 90259a6db4 am: d8e5795131
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22185922

Change-Id: Ic5d6ce2a870f19c960baab3af8abfb1faee248f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-30 17:16:22 +00:00
Sunny Goyal 1fc1cd002f Merge "Revert "Simplifying some page indicator dots attributes so that it can"" into udc-dev 2023-03-29 21:22:10 +00:00
Sunny Goyal 0263a679f2 Revert "Simplifying some page indicator dots attributes so that it can"
This reverts commit a5ead45967.

Reason for revert: b/274169859

Change-Id: Id214694ae4f61cd70796c6f7e932c1fdef82d746
2023-03-29 19:11:03 +00:00
Schneider Victor-tulias 7cd0ae3f73 Fix TwoPanelWorkspaceTests
- Marking the hotseat long press edu as seen on setup to allow the popup menu to be shown immediately in tests
- Recording onWorkspaceItemLongClick on prediction item long click

Flag: not needed
Fixes: 273239675
Test: TwoPanelWorkspaceTest
Change-Id: I76354fd2e3adde11b2a428374fa9c8855ce2ece9
2023-03-27 14:24:35 -07:00
Sunny Goyal feca2d8700 Merge "Simplifying some page indicator dots attributes so that it can be easily modularized" into udc-dev 2023-03-17 19:02:01 +00:00
Sunny Goyal a5ead45967 Simplifying some page indicator dots attributes so that it can
be easily modularized

> Moving the color configuration to xml
> Moving auto-hide logic to a subclass as it doesn't
  need to be in the main library

Bug: 274011949
Test: Verified on device
Change-Id: Icf7bd5d1cbde3daa9441f2af51f98a931bcd6ee2
2023-03-16 15:57:06 -07:00
Fengjiang Li b7860bd85e [Predictive Back] Remove OnBackPressedHandler
OnBackPressedHandler was mimicking android.window.OnBackAnimationCallback because later one was hidden API to T.

Now that we have moved to U, we can remove the former handler.

Test: manual
Bug: 272797556
Change-Id: Ic5302cfa0a6fb15c4a64bdf5dc331834b1f06f38
2023-03-16 09:39:31 -07:00
Brian Isganitis fdd044e16e Expose IS_RUNNING_IN_TEST_HARNESS as static method.
This variable is now mutable, making the uppercase format misleading.
For instance, users might assume they can use this value in other
immutable properties, when they really should be accessing the latest
value every time they need it.

Context: https://source.android.com/docs/setup/contribute/code-style#follow-field-naming-conventions

Test: Manual
Bug: 271160958
Change-Id: Iaaa51d9153cb8a7d686c72e1210b1948029dcfd5
2023-03-03 00:17:33 +00:00
Schneider Victor-tulias cd17310656 Merge "Add debug logs to debug flaky workspace binding" into tm-qpr-dev 2023-02-24 21:12:41 +00:00
Sunny Goyal 171bb04407 Removing some obsolete features
Bug: 270386012
Test: Presubmit
Change-Id: I9d68b3d17e02d6e79ab726eb7c8da1e5a4d337ef
2023-02-22 23:17:15 +00:00
Schneider Victor-tulias 6b94a960c0 Add debug logs to debug flaky workspace binding
Bug: 270216650
Test: ReorderWidgets
Change-Id: I6fa2eab98c0268000ef4c44980c2917d5ef1bc89
2023-02-22 13:05:13 -08:00
Sunny Goyal 239d6e9b8d Adding support for customizing shortcut pinning logic
> Allowing support for overring shortcut badge
> Updating pendingShortcutInfo so that the
  handler can be easily overridden

Bug: 268253894
Test: Verified on device
Change-Id: I3184cb6494bc98c7eed33798b35b4e6e6a1e7ddc
2023-02-17 18:07:23 +00:00
Charlie Anderson 8ad9144ca2 adding the new Material U App Shortcut Popup design
Bug: 247880037
Test: tested manually
Change-Id: I66c291df54dfc2a76fc974082a19091deb167f73
2023-02-14 16:03:15 -05:00
Sebastián Franco 726e9acea4 Merge "Simulating a split screen CellLayout using one CellLayout" into tm-qpr-dev 2023-02-08 01:04:20 +00:00
Sebastian Franco 09589326db Simulating a split screen CellLayout using one CellLayout
Test: atest ReorderWidget
Fix: 188081026
Change-Id: I8eda5f77c11dc2625ae1f028d07539c28018fb55
2023-02-07 17:03:22 -08:00
Fengjiang Li d080b98b76 [Predictive Back] Revert all apps scale when exiting from search
Bug: b/267522879
Test: manual, see before after videos in bug
Change-Id: I7b14739fee23a22920d71841fc1c3c12b34a3d0c
2023-02-03 10:28:46 -08:00
Sunny Goyal 669b71f5b3 Introducing CellPosMapper which allows mapping between UI position
and model position

Test: atest CellPosMapperTest
Bug: 188081026
Change-Id: If5c6b3df5ad240317bb535c675f6ead94084238e
2023-01-30 12:17:09 -08:00
Sunny Goyal dbc5e56e07 Merge "Merging unnecessary subclass of ActivityAllAppsContainerView" into tm-qpr-dev 2023-01-25 06:37:15 +00:00
Fengjiang Li 6bb8d79549 Predictive back: widget to all apps
This CL adds a layer of OnBackPressedHanlderRouter to Launcher:
1. 4 OnBackPressedHandler(s) are added in such order: auto cancel action mode handler, drag handler, view handler and state handler
2. first handler who can handle back will handle the entire back gesture
3. Let WidgetsFullSheet to handle widget to all apps transition

Bug: b/260956481
Test: manual
Change-Id: Idbce3dcec746226dd68aaabaddc8fe01334e9673
2023-01-24 15:51:46 -08:00
Sunny Goyal 34c499dc84 Merging unnecessary subclass of ActivityAllAppsContainerView
Bug: 266605714
Test: Presubmit
Change-Id: I87272ee827055f58f91a4ad9fb25d5351d453cdb
2023-01-24 13:01:00 -08:00
Sunny Goyal a992ac9e8d Moving all intent receiver register calls to a single place
This is eventually allow us to move all register to background thread
Also creating a single ScreenOn tracked which is used at multiple places

Bug: 264465756
Test: Verified on device
Change-Id: Ibadf9ca43218e578954420d97a733adfa0a94fc7
Merged-In: Ib410e5bf02773cefde5bf0a0a1f2f1c108718d24
2023-01-22 05:24:48 +00:00