Commit Graph

1672 Commits

Author SHA1 Message Date
Alex Chau ccc430e2c1 Detect potential WindowConfiguration change at onApplyWindowInsets
- Invoke onConfiguration when receiving inset changes
- In Laucnher/RecentsActivity onConfiguration, additionally detect for windowConfiguration's rotation change; if Configuration stays the same, it'll be ignored.

Bug: 240730723
Test: manual on 90/180 degree rotation in Launcher and RecentsActivity
Change-Id: I7087878af847d62e1c715a4f52a18818d1a6c258
2022-08-09 19:09:42 +01:00
Sunny Goyal a30cf8b7e1 Dumping view capture directly to file instead of loading it
all in memory

This avoid OOM when processing large data

Bug: 241600398
Test: Verified on device
Change-Id: I76072d52e47bea3a2f9802ce3b23ddae58fe8d23
2022-08-05 16:30:01 -07:00
TreeHugger Robot f47491bdf8 Merge "Remove unused logs" into tm-qpr-dev 2022-08-01 20:29:53 +00:00
Pat Manning 5f74bfd76d Refactor DeviceProfile tests based on dump() and use real device dimensions for tests.
- Added roundPxValueFromFloat when converting dp/sp to px to deterministically round up values around .5

Fix: 240133465
Bug: 237542518
Test: DeviceProfileTest.kt
Change-Id: If4239f714487fe5bf2ef44274e2ce415bd75c86d
2022-08-01 17:54:43 +00:00
Schneider Victor-tulias 1dbffe0af7 Remove unused logs
Fixes: 240173459
Test: Started launcher
Change-Id: I853d9a50a0c34a7fdda87ea20d46a9f7ac7542e3
2022-07-29 13:06:24 -07:00
TreeHugger Robot f49287d627 Merge "Listen to DisplayController for ignoreAutoRotateSettings" into tm-qpr-dev 2022-07-29 18:05:17 +00:00
Alex Chau 6209af67d3 Listen to DisplayController for ignoreAutoRotateSettings
- Also skip most of initDeviceProfile/onIdpChanged if DeviceProfile didn't actually change to effectively skip the 2nd unexpected onConfigurationChangeded caused by setRequestedOrientation (b/211763738)

Test: Change display size while in app or at home screen
Fix: 240019605
Change-Id: If307742639bd269622140a7da0dc900887c67937
2022-07-29 13:09:17 +01: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
Alex Chau 62572c04e2 Revert "Move BaseActivityInterface task size methods to DevicePr..."
Revert "Move BaseActivityInterface task size methods to DevicePr..."

Revert submission 19279487-baseactivityinterface

Reason for revert: As per discussion in ag/19341332, make sure DeviceProfile can properly react to inset changes before moving task size calculations there
Reverted Changes:
I30324d34c:Move BaseActivityInterface task size methods to De...
Ia9c1d0387:Move BaseActivityInterface task size methods to De...

Bug: 238593212
Change-Id: I0d40fdd4a5d4468494e30cef32a284479ddd2feb
2022-07-25 18:38:03 +00:00
Pat Manning 4e73e5e352 Move BaseActivityInterface task size methods to DeviceProfile.
Fix: 238593212
Test: DeviceProfilePhoneTest.kt
Test: DeviceProfileVerticalBarTest.kt
Test: DeviceProfilePhone3ButtonTest.kt
Test: DeviceProfileVerticalBar3ButtonTest.kt
Test: DeviceProfileTabletLandscapeTest.kt
Test: DeviceProfileTabletPortraitTest.kt
Test: DeviceProfileTabletLandscape3ButtonTest.kt
Test: DeviceProfileTabletPortrait3ButtonTest.kt
Test: DeviceProfileTwoPanelLandscapeTest.kt
Test: DeviceProfileTwoPanelPortraitTest.kt
Test: DeviceProfileTwoPanelLandscape3ButtonTest.kt
Test: DeviceProfileTwoPanelPortrait3ButtonTest.kt
Change-Id: I30324d34ca119a467f530b590949743c2ba7b91a
2022-07-18 16:35:02 +01:00
Alex Chau fbd9ebd0a0 Merge "Make workspace and hotseat scale down in widgets picker" into tm-qpr-dev 2022-07-12 10:08:20 +00:00
Sunny Goyal 25972b1f2f Adding support for continously capturing view hierarcy in Launcher
Bug: 238243939
Test: Verified data being captured and dumped
Change-Id: Ibe069d39ccf728f7b953f85085e58976be6e05ac
2022-07-11 15:43:54 -07:00
Alex Chau 0c4e11b479 Make workspace and hotseat scale down in widgets picker
- Also centralized workspace content scale percentage to DeviceProfile

Test: manual
Fix: 231699666
Change-Id: I3f8dcb9921e0cd93ad391d51120b189005ad07df
2022-07-08 19:03:48 +01:00
Jeremy Sim e19aab9010 Merge "Allows Launcher to recover gracefully into OverviewSplitSelect state" into tm-qpr-dev 2022-07-01 21:40:34 +00:00
Jeremy Sim c94f4b779b Allows Launcher to recover gracefully into OverviewSplitSelect state
When Launcher restarts (as the result of a UiModeChange or something else), it attempts to recover its previous state. However, the OverviewSplitSelect state is unique because it requires some additional information to recover properly (the taskId of the staged task and so on). This change makes it so that the relevant information is passed forward in the recovery bundle. Launcher will now restart in the base Overview state, and then immediately apply the saved data to recover the OverviewSplitSelect state.

Fixes: 233019928
Test: Manual
Change-Id: Ie6123ef9c374be000268f82857b696c49213c541
Merged-In: Ie6123ef9c374be000268f82857b696c49213c541
2022-07-01 00:07:54 +00:00
Abhilasha Chahal cb32935281 Allow overriding DragController and drag use cases
Test: Manually verified Launcher3 works fine
Bug: 233864888
Change-Id: Ifb2fe19c0a2b332862b36b1ac0100e0f5301a5a6
2022-06-29 17:29:47 +00:00
Sunny Goyal 24d7de43fb Merge "Fixing nullpointer exception when accessing StatsLogger before initialization" into tm-qpr-dev 2022-06-29 16:17:55 +00:00
Sunny Goyal 977838b568 Fixing nullpointer exception when accessing StatsLogger before initialization
Bug: 236227523
Test: Manual
Change-Id: I2caaa143ab2ddd4442d5c56152c7b4a7c723b92b
2022-06-27 13:16:19 -07:00
Vinit Nayak d18304ca15 Close all open views for 1P and 3P launchers
* Previously TaskView was closing task menu view, but
that got removed since launcher was doing that on
state transition.
* Only 1P launcher was doing that and not 3P launcher,
moved call to remove open views to parent class

Test: Invoking split on 3P launcher doesn't result in a crash
Bug: 199342537
Change-Id: I6afbe7640ede362a677e15a33409a7cabdb8cca9
2022-06-15 14:09:49 -07:00
Jon Miranda f26bdcb4c1 Fix NPE when user swipes back in All Apps and no matching view found
This crash will occur every time user swipes back and
there is not a view to return to

Introduced in I56cda07f3eccc11e8909f7fb28210f65cc6e0f1d

Bug: 235494234
Test: manual
Change-Id: I1261afcefec8fed4be20ab9ef439a50bc706d464
2022-06-10 16:00:18 +00:00
Jon Miranda 2dac4f7f4c Merge "Pause expensive view updates before setting hw/sw layers." into tm-dev 2022-06-08 00:15:35 +00:00
Jon Miranda f58db150af Play fallback animation if icon in All Apps is covered by header.
Bug: 230707341
Test: enter all apps
      scroll so icon is covered by header
      open app, swipe back to return to all apps
      confirm fallback animation plays

      repeat but scroll so icon is not covered by header
      confirm normal animation plays

Change-Id: I56cda07f3eccc11e8909f7fb28210f65cc6e0f1d
2022-06-02 16:06:37 -07:00
Jon Miranda 46ecc0ca08 Pause expensive view updates before setting hw/sw layers.
Prevents widgets from updating mid animation.
Also pauses view updates during app close animation.

Bug: 220939231
Bug: 230617085
Bug: 226171754
Test: manual

Change-Id: I0138d57e6a7b2c22fd9a029e971b3e27c7e9f22e
2022-06-02 12:21:01 -07:00
Stefan Andonian 45fc301b0e Change accessibility announcement for workspace from "Pixel Launcher" to "Home".
Bug: 228410736
Test: Verified correct talkback announcements.
Change-Id: Ic0a5295cde3cd23d2fc5a6fcd19b6cf8e0f3e386
(cherry picked from commit 83bc5f5050)
2022-05-24 18:21:33 +00:00
Sunny Goyal a292987030 Merge "Adding support for extending back behavior in Launcher" into tm-dev 2022-05-17 23:02:50 +00:00
Sunny Goyal 3f2637faee Adding support for extending back behavior in Launcher
Bug: 231224820
Test: Manual
Change-Id: I9accc30c01dce5f6920b611cfeed9fa0584d2846
2022-05-16 14:40:19 -07:00
Pinyao Ting 6a41d56b50 Log the reason why a WorkspaceItemInfo was removed
In the past we've seen a WorkspaceItem disappeared from the workspace
but wasn't able to determine why it was removed. This CL includes the
reason why it was removed in the error log, which hopefully would help
us debugging similar issues in the future.

Bug: 231239260
Test: make
Change-Id: Iba3d57568c9b3e011a6b65b26f0d4170d42fe1a5
2022-05-16 20:17:47 +00:00
Jon Miranda a82a7dc205 Clear all DragView in onResume
- Multiple users reports view getting stuck on screen. This CL
  clears all DragView when user leaves launcher.
- Moved to onResume to not interfere with start up time,
  and also aligned with when we remove AbstractFloatingView.
- Root cause still undetermined, but happens enough that it warrants
  a temp fix.

Bug: 162636845
Test: drag and drop configurable widget
      (widget that gets dropped then opens up a
       configuration activity)
Change-Id: I532b5274a1308c53f67c23c5c8ca07f2b7f9802c
2022-05-10 11:48:32 -07:00
Schneider Victor-tulias a78e070a2e Merge changes from topic "presubmit-am-1224af9ca3f341a895e4bc19976e2bb8" into tm-dev
* changes:
  Fix recents animation flicker
  Fix janky overview animation.
2022-05-06 18:48:29 +00:00
Schneider Victor-tulias 9f922d3598 Fix recents animation flicker
The recents animation can sometimes start before launcher has started when started with 3-button mode. This causes the animation to start before the recents UI has been initialized by Launcher. Added a callback to properly synchronize launcher start and the recents animation.

Fixes: 229360539
Test: started the recents animation and checked logs (order of operations), when the recents animation or launcher started first
Change-Id: I5938bbba778a2886b4a1e4ee4844eaf28c6fac0e
2022-05-04 22:27:50 +00:00
Sunny Goyal f76524151d Merge "Replacing ItemInfoMatcher with predicate" into tm-dev 2022-05-03 20:04:55 +00:00
Sunny Goyal 32084d49d3 Replacing ItemInfoMatcher with predicate
This removed unnecessary componentName lookups when it
is not required. Many checks just rely on IDs and
userHandle

Bug: 231153610
Test: Presubmit
Change-Id: Ief93954abc5861062a9f55dc2ef181d3de106c62
2022-05-03 10:07:22 -07:00
Schneider Victor-tulias 9b6babf839 Translate the 3 navigation buttons to/from their in-app position when animating to/from the -1 screen, all apps and widgets.
Bug: 221455508
Test: opened all apps, widgets, -1 screen, notifications shade and keyboard in various combinations and orders; locked screen, launched app, returned home with the back/home buttons, opened overview
Change-Id: Ia0b406aacf72b34bd6b7ff1c01278ab6895a7da4
Merged-In: Ia0b406aacf72b34bd6b7ff1c01278ab6895a7da4
(cherry picked from commit 9c1a452a1d)
2022-05-02 18:45:01 +00:00
Anushree Ganjam 5cc7ff0990 Revert "Refactors Search results into separate RV for Toast."
This reverts commit 6729f0b950.

Reason for revert: This change caused b/230648542.

Please see https://b.corp.google.com/issues/230648542#comment5 for the video after reverting this change.

Bug: 206905515
Bug: 230648542

Change-Id: I85f063c56cad137c05b810204244bba7e8f94ee7
2022-04-28 01:37:49 +00:00
Andy Wickham 6729f0b950 Refactors Search results into separate RV for Toast.
This will help enable transitions between A-Z apps lists and
search results because both can be seen simultaneously and
manipulated independently.

Some high level items of the refactor:
 - SearchRecyclerView is added; logic that populated the main
   (personal) tab with search results was simply redirected to
   this RV instead.
 - BaseAllAppsContainerView added isSearching() method. Returns
   false, and ActivityAllAppsContainerView overrides (as search
   is handled there).
 - Renamed BaseRecyclerView to FastScrollRecyclerView to better
   describe what it does. SearchRecyclerView extends this, but
   returns false for supportsFastScrolling().
 - AlphabeticalAppsList#mAllAppsStore is now optional, so the
   Search RV doesn't need to store/listen to apps. Note this
   doesn't affect the predicted app row which is still updated
   if one of the predicted apps is uninstalled (I tested this).

Future work:
 - Determine why dispatchRestoreInstanceState is not called for
   BaseAllAppsContainerView. Save is called, e.g. on rotation.
   Effect of restore not called: rotating while searching goes
   back to A-Z list.
 - Keep suggested apps in Header while searching. Currently they
   are rendered in the SearchRV above search results, as before.
 - Potentially extract Personal/Work tabs to move independently of
   header.
 - AlphabeticalAppsList is a misleading name because it can also
   contains search results. However, things are pretty intertwined
   between that and BaseAllAppsAdapter (effectively a circular
   dependency), so I figured cleaning all that up was out of the
   immediate scope of this refactor, which is mainly meant to
   unblock transition work.

Bug: 206905515
Test: Manually checked for regressions, ran tests.
Change-Id: I4d3757c8a8f9b774956ca6be541dd4fcdad1de13
2022-04-24 17:36:48 -07:00
Sunny Goyal 7b8d63fcf8 Removing fade in logic during load.
Launcher already blocks the draw during load, which ensures
that system draws the loading screen. Additional fade animation
is not visible since the Launcher window is already getting fade in

Bug: 199120420
Bug: 199120420
Test: Verified on device

Change-Id: I7089cea4c5f97f6ef92eabcba56451de407c98b8
2022-04-22 16:35:40 +00:00
Shikha Malhotra 2e255ed0ac Merge "Refactor code to be used in LauncherLily features" into tm-dev 2022-04-21 07:50:32 +00:00
Shikha Malhotra e957b600d3 Refactor code to be used in LauncherLily features
Refactor add to workspace code to be used in Lily Launcher.
Also utilising code swap feature to swap out functionality of sorting
items on workspaces and finding next vacant space.

Bug: b/218186705
Test: Manually tested Launcher3 works.
Change-Id: I42a44eabeb307e1d23ef333e0a169437f9062bb6
2022-04-20 07:22:20 +00:00
Sunny Goyal cd2ac0f3e9 Updating target SDK for Launcher
Bug: 229173942
Bug: 226461147
Test: Presubmit
Change-Id: Id9e303f113cba87adf26442f1417ed2814555c54
2022-04-18 13:55:01 -07:00
Shikha Malhotra f78da1bae3 Review comments followup
These are review comments followup from ag/17399997

Bug: b/218187058
Test: manually test thet Launcher3 features work correctly
Change-Id: I9865a37c1ed663370dc28e7678994f3d961e3cd1
2022-04-12 14:33:07 +00:00
Shikha Malhotra 6d6f62c462 Merge "Added provision to switch the PageIndicator in specific Launchers" into tm-dev 2022-04-08 20:17:44 +00:00
Shikha Malhotra 0f2e1b6714 Added provision to switch the PageIndicator in specific Launchers
Please see the related CL in LauncherLilyGoogle where pagination is
implemented as persistent dots.

Bug: b/218187058
Test: manually test thet Launcher3 features work correctly
Change-Id: Ic20aa92249b1bbe3c4ab7810683b54648a181722
2022-04-08 11:47:46 +00:00
Stefan Andonian d123fbd15d Simplify AbstractFloatingView.closeOpenViews usage.
This is a follow-up code review to ag/1754638 to address a comment that was missed before the CR was pushed.

Bug: 227142635
Test: Folders still close when launcher is paused.
Change-Id: Ib6724dc3a6ba49e259ba7de655f6810d6a692d16
2022-04-07 22:19:26 +00:00
Stefan Andonian 52eaebead4 Merge "Close open folders when pausing launcher." into tm-dev 2022-04-07 18:53:45 +00:00
Stefan Andonian 253c23b2e8 Close open folders when pausing launcher.
Previously, folders wouldn't close after launching an app and quickly navigating back the launcher.
This is because the onStop state which contains a call to AbstractFloatingView.closeViews() wasn't being called.
This change adds an additional call to specifically close any open folders when the Launcher enters a paused state.

Bug: 227142635
Test: Verified that the issue is fixed after code change.
I logged the Launcher's lifecycle state to ensure my manual testing was reliable.

Change-Id: I838f992f83afdd754672ebbe85d0eb2a7e894417
2022-04-06 21:47:35 +00:00
Sunny Goyal 5c20fdd73f Adding finish signal to GestureNavContract.
Also fixing also-closing behavior for FloatingSurfaceView for Android S

Bug: 228260232
Test: Verified manually on device
Change-Id: I83f6417a756c1459533294d681e83abba6ea58aa
2022-04-06 13:42:59 -07:00
Abhilasha Chahal dfd154f18d Use numAllAppsColumns to calculate height of all apps icons
Additionally opens up access of some fields to allow them to be overridden.

Test: Manually verified that Launcher3 layout does not change

Launcher3 APKs: https://drive.google.com/drive/folders/1hBcZU9xou4tZJxbTmkya_LyBbD2oYuwV?resourcekey=0-R0I1IQ2rSUIEfPjW8S_ppA&usp=sharing

Bug: 216150572

Change-Id: I4b97a7e9e15973fc5aa70a4b98f0b73dd5bf3c17
2022-03-23 21:09:54 +00:00
Brian Isganitis bde3c8b6bd Move activity starting logic into new ActivityContext extension.
This code branch is needed for taskbar, so needs to be moved from the
activity classes to an interface that both can share.

Test: Manual
Bug: 216683257
Change-Id: I042c0dcf08207d94847b9d7a1783acc14613ef5f
2022-03-16 13:59:03 -07:00
Jon Miranda e8b174482d Merge "Add debug logs for bad launcher state." into tm-dev 2022-03-10 22:03:37 +00:00
Jon Miranda 7ebe209c21 Add debug logs for bad launcher state.
Bug:223498680
Bug:221658803

Test: manual
Change-Id: I138a7ab031269009fa8ca492cd0bd48085aa4e68
2022-03-10 20:25:38 +00:00