Commit Graph

234 Commits

Author SHA1 Message Date
Jagrut Desai
d2140ba498 Taskbar System Action with Broadcast Receiver.
Test: Manual
Bug: 265618836
Change-Id: I734402ef277a09cf5e41aa63f8be09375706c17a
2023-03-29 10:37:45 -07:00
Jon Miranda
085c53869f Merge "Add taskbarIconSize to GridOption/DisplayOptions" into tm-qpr-dev 2023-03-24 21:51:42 +00:00
Jon Miranda
9c478b6c29 Add taskbarIconSize to GridOption/DisplayOptions
- Renamed variables to make it more clear what they represent
- DeviceProfile will be source of truth for taskbar
  sizes

Bug: 265144213
Test: phone, multi-display, tablet
Change-Id: Id9c19d15a65894fd7645e0f876a4b6527b713c34
Flag: ENABLE_TRANSIENT_TASKBAR=true
2023-03-24 12:29:11 -07:00
Johannes Gallmann
c2e5bfca50 Fix taskbar linger above notification shade
Remarks:
1. I think the correct fix for this would be to have the Taskbar z-ordered below the notification shade. That however seems to be difficult because there are cases when the taskbar window must be above the notification shade.
2. This CL improves the behaviour by starting the taskbar disappear animation when the notification panel is half expanded instead of waiting for the full expansion. This improves the UX when expanding the shade slowly. When expanding the shade quickly, this CL does unfortunately not significantly improve the UX.
3. I believe that the `SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED` and `SYSUI_STATE_QUICK_SETTINGS_EXPANDED` flags can be replaced by the newly introduced one. But since this would pose the risk of introducing new bugs, I did not do that in this CL. It is my intention to create a CL with that replacement in udc.

Bug: 272621219
Test: Manual, i.e. observe Taskbar behaviour when pulling down notification shade and expanding quick settings
Change-Id: Ic79d3f41ed224cb1abdbac9011c6d27e0f458ec2
2023-03-23 10:31:25 +01:00
Mike Schneider
94f46e14f4 Do not play unstash animation when unlocking the device
The unstash is ignored by TaskbarStashController, while the TaskbarLauncherStateController positions the hotseat on the launcher correctly without animation.

Since the TaskbarStashController is used even with 3p launchers, both of these actors keep track of whether the device is locked independently, based on the SysUI flags.

Bug: 270139677, 266890635, 274084408
Test: manually, Tapl
Change-Id: Iae94522b5d57cc89c9a4d219ad1254b150a3400d
2023-03-22 09:10:03 +01:00
Mike Schneider
42a8fe91db Merge "Do not perform invisible transitions while the screen is off." into tm-qpr-dev 2023-03-22 08:04:09 +00:00
Jon Miranda
ba85154590 Merge "Add spring animation when stashing transient taskbar." into tm-qpr-dev 2023-03-22 02:34:46 +00:00
Jeremy Sim
3c8def9f88 Merge "Fix bug where Taskbar was not auto-hiding after splitscreen launch from icon menu" into tm-qpr-dev 2023-03-21 23:34:34 +00:00
Jeremy Sim
8eed87ac89 Fix bug where Taskbar was not auto-hiding after splitscreen launch from icon menu
This patch fixes a bug where the transient Taskbar was not hiding properly after splitscreen was initiated. When the user is inside an app and launches splitscreen by longpressing on a Taskbar icon and selecting the split button, the transient Taskbar should hide right away. This is an equivalent action to dragging the Taskbar icon up to create a split, and should hide the Taskbar so that other UI elements (like system-level toasts and error messages) can be seen.

The bug occurred because updateAndAnimateTransientTaskbar() is not being called in this specific code path to stash the Taskbar.

Fixed by adding a new call to updateAndAnimateTransientTaskbar upon clicking the splitscreen menu button.

Fixes: 272292897
Test: Manual
Change-Id: I64a9acfc41ddcaba4d9f43eb216458de44b4c9a4
2023-03-21 14:35:36 -07:00
Mike Schneider
308b7849db Do not perform invisible transitions while the screen is off.
This change caches whether launcher was active at the time of the screen
off, and assumes this last state when the screen is actually off.

While trying to understand the code, I renamed a couple class-internal
methods and flags, plus added comments. If they are not accurate, its
due to a misunderstanding on my part, and I will gladly revisit and
check whether all the assumptions I made still hold.

Bug: 261418621
Test: manually

Change-Id: I2ad25caf478100781a063c356c5fd2d20d3e1917
Merged-In: I2ad25caf478100781a063c356c5fd2d20d3e1917
2023-03-21 21:02:55 +00:00
Jon Miranda
3344ec7004 Add spring animation when stashing transient taskbar.
Bug: 273961611
Change-Id: I35a658a5e30a155094a48effdefc3895f45e0483
Flag: ENABLE_TRANSIENT_TASKBAR
Test: stash transient taskbar
2023-03-21 10:25:48 -07:00
Brian Isganitis
201a8f5ea3 Merge "Log when FLAG_STASHED_IN_APP_AUTO changes." into tm-qpr-dev 2023-03-14 17:16:43 +00:00
Brian Isganitis
84261f9d9b Ensure taskbar background always transparent in notification tray.
Persistent, taskbar can be in light or dark modes. Since notification
tray has its own background color, we should hide ours to avoid clashing
with it.

Test: Manual
Fix: 270758899
Change-Id: Iedc6aae42aac30987af3259ccee11c5998e10517
2023-03-08 23:51:34 +00:00
Brian Isganitis
c762ef68d4 Log when taskbar is in task switcher container.
Test: wwdebug & wwlogcat
Bug: 261177876
Change-Id: Id4eda7ee7e4e2c1aa60e07d5b65410b3847d9ac6
2023-03-07 03:29:21 +00:00
Brian Isganitis
cdc13fc4e8 Log when FLAG_STASHED_IN_APP_AUTO changes.
Bug: 261177876
Test: wwdebug & wwlogcat
Change-Id: If2d2a3d38f3128a60d551bca9f4cdf64f2bcb032
2023-03-07 03:12:45 +00:00
Brian Isganitis
d2d2913812 Merge changes from topic "running-in-test-camel" into tm-qpr-dev
* changes:
  Expose IS_RUNNING_IN_TEST_HARNESS as static method.
  Make isTooltipEnabled a getter due to its mutable dependencies.
2023-03-03 23:15:38 +00:00
Vinit Nayak
f51426a6ee Merge "Add null check for recents when tapping on Taskbar icons" into tm-qpr-dev 2023-03-03 21:33:52 +00:00
Nick Chameyev
c7ab991818 Merge "Do not use private APIs in unfold module" into tm-qpr-dev 2023-03-03 13:22:03 +00:00
Vinit Nayak
26c893603f Add null check for recents when tapping on Taskbar icons
Fixes: 270669636
Test: Couldn't repro, but visually we have checks for
recentsView != null && OTHER_CONDITION, but in the else
case we don't check if recentsView being null is the reason
the if-block didn't get triggered

Change-Id: I72e7480bac56c7e7b7edb73edac4309e9923d302
2023-03-02 18:18:11 -08: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
Jeremy Sim
e35d112693 Fix bug with Taskbar not differentiating between user profiles
This patch fixes a bug where Taskbar would not differentiate between user profiles when selecting an app to launch from Overview.

The bug occurred because findLastActiveTaskAndRunCallback(), which checks for already-running tasks when launching an app from the Taskbar, only checks for a ComponentName match and not a userId match.

Fixed by making the findLastActiveTaskAndRunCallback() also check for a userId match.

Fixes: 270456926
Test: Manual
Change-Id: I43ff06083a5dce775fdbd0b0ed951beaae34c0ab
2023-03-01 10:57:41 -08:00
Vinit Nayak
54c262cd67 Merge "Move split functions from RecentsView to SplitSelectStateController" into tm-qpr-dev 2023-02-22 02:15:46 +00:00
Nick Chameyev
dd2311e7f7 Do not use private APIs in unfold module
Removes usages of the private/hidden APIs
in unfold module so it could be easily
reused in 1p/3p apps.

Bug: 258828766
Test: manual fold/unfold with a full screen
 app and in split screen
Change-Id: I79618af5f1e4bd7da66b840e321403bb33cf7e95
2023-02-21 18:26:46 +00:00
Vinit Nayak
c97bb4600f Move split functions from RecentsView to SplitSelectStateController
* Moving things out of RecentsView to avoid
dependency on a non-testable class
* Also helping prevent bloating RecentsView.java

Bug: 266482558
Test: Single Chrome instance in recents. Initiate split
with Chrome from workspace, tap on Chrome again in Taskbar,
ensure no crash.

Change-Id: I99ec704479ffaa860f4d80c2cb9f54182f31f41a
2023-02-17 17:28:08 -08:00
Jon Miranda
ddb909603a Remove setImeIsVisible/setTouchesEnabled as its already handled by insets.
Bug: 260101467
Test: manual
Change-Id: Iba22a6db61abd4be0b2a15b2e4099d9bc03ddbc9
2023-02-18 00:27:03 +00:00
Jagrut Desai
4ffc71262d Merge "Making taskbar to stay stashed if user launches app for split screen view from all apps view" into tm-qpr-dev 2023-02-15 23:03:19 +00:00
Schneider Victor-tulias
de7ceba80b Add the KeyboardQuickSwitchView (2/2)
Adding KeyboardQuickSwitchView and associated flows.

Test: Manually tested alt-tab and alt-shift-tab in and out of overview on a tablet and phone
Bug: 258854035
Change-Id: Ifb48b005067b3a9c66acfd5ecdbae144b359d3be
2023-02-14 13:34:37 -08:00
Winson Chung
c5180384d5 Merge "Update region sampling to account for window visibility" into tm-qpr-dev 2023-02-14 04:48:02 +00:00
Winson Chung
b41d15b5f6 Merge "Have Taskbar report left/right gesture insets" into tm-qpr-dev 2023-02-14 04:45:24 +00:00
Tony Wickham
fc97f74e82 Have Taskbar report left/right gesture insets
Fixes: 231648761
Test: output from adb shell dumpsys activity service
TouchInteractionService, specifically TaskbarInsetsController

Change-Id: I8ed7fefb482bd4f73d2b2026ccb4ac369b6321ab
2023-02-14 04:43:01 +00:00
Winson Chung
8bce18a562 Update region sampling to account for window visibility
- Similar to the nav bar, we should also disable region sampling then
  the window is no longer visible (ie. when in immersive mode) otherwise
  we fall back into gpu composition which consumes more battery

Fixes: 268280575
Test: Enter immersive mode and verify region sampling is disabled
Change-Id: I99bf8986c6f22fd8d480d255d10cfcd39cfb79e3
2023-02-11 01:02:35 +00:00
Winson Chung
8fe24e0893 Reapply previous states when recreating the task bar
- When the taskbar is recreated (ie. from a display config change),
  the previous states sent from SysUI need to be reapplied to the
  new controllers

Fixes: 267664948
Test: Wipe device, in SUW accessibility settings change the display
      density and verify it properly tints the back button
Change-Id: I837a67ced2941d4545359b8231026044b5479767
2023-02-11 00:25:01 +00:00
Tony Wickham
ef03a14980 Making taskbar to stay stashed if user launches app for split screen view from all apps view
Test: Visual
Fix: 263058045

Change-Id: Idcbc4ce90e8d4ff1084780bf331f2cea8b9335ca
2023-02-08 21:53:37 +00:00
Tony Wickham
632e9a84c4 Merge "Don't applyState if taskbar is already destroyed" into tm-qpr-dev 2023-02-03 17:55:30 +00:00
Jon Miranda
5903751ee3 Merge "Update notification dot renderer when we update the taskbar icon size." into tm-qpr-dev 2023-02-03 01:34:05 +00:00
Tony Wickham
9fb8883017 Don't applyState if taskbar is already destroyed
Test: Open overview while unfolded, then fold; ensure hotseat remains
visible
Fixes: 260135164

Change-Id: I788a9a682a7d5fabbea7c478231fc7abe92e95b9
2023-02-03 01:00:21 +00:00
Jon Miranda
2b25ded506 Update notification dot renderer when we update the taskbar icon size.
Test: swipe to home with an app that has a notification dot
      observe no jump in dot size
Bug: 264709741

Change-Id: I5d56fe57e74ed7b094477ecd8727152f3f522042
2023-02-02 23:10:42 +00:00
TreeHugger Robot
6e21d310c1 Merge changes I865871e5,Ie655de7a into tm-qpr-dev
* changes:
  Fixes to VoiceInteractionWindowController
  Fix TaskbarBackgroundRenderer not being applied correctly in 2 cases
2023-01-31 17:52:55 +00:00
Tony Wickham
c3963a7ff4 Fixes to VoiceInteractionWindowController
- Make temporary taskbar background behind assistant non-touchable
  (fail-safe in case the window isn't removed for some reason)
- Give temporary taskbar background a different window title and
  add a couple more dump statements to help debugging
- Only show the taskbar background for persistent taskbar; transient
  taskbar can skip most of the special casing and just hide it
- Fix bug where we weren't drawing the separate taskbar background in 3
  button mode
- Fix bug where we weren't actually synchronizing
  separateWindowForTaskbarBackground with TaskbarDragLayer, since the
  former wasn't attached to the window yet; now we wait until it is
  attached before calling synchronizeNextDraw()
- Also added dump logs for TaskbarDragLayerController alpha channels

Test: manual in 3 button and gesture nav (with and without
FORCE_PERSISTENT_TASKBAR enabled)
Fixes: 243652789
Bug: 262664266

Change-Id: I865871e57dd4cb255a916317a7e5d35cfde97df5
2023-01-31 00:58:22 +00:00
Tony Wickham
d9dd02b451 Merge "Remove ALPHA_INDEX_IME_BUTTON_NAV" into tm-qpr-dev 2023-01-30 19:11:47 +00:00
Vinit Nayak
49dc6d2712 Launch initial split from taskbar in overview app menu
* Consolidated init calls in SplitSelectStateController
* Also add support to launch from taskbar all apps
* Add logic in SplitSelectStateController to know whether
or not we need to dismiss existing TaskView vs relying
on mSplitHiddenTaskView null check
* Default click handling for SplitShortcut is to start
split selection mode

Bug: 251747761
Test: Initiated split from smart actions, thumbnail app
icon, home, taskbar in overview, all apps. Saw it choose
the latest thumbnail

Change-Id: Ib4f64e619c97615af458a19a9c0efd86c92979d9
2023-01-27 16:46:14 -08:00
Tony Wickham
602f3074f9 Remove ALPHA_INDEX_IME_BUTTON_NAV
Taskbar already stashes when IME is showing, which hides the taskbar
icons in 3 button mode. Hence this extra flag seems redundant and breaks
Transient Taskbar, which allows unstashing taskbar over IME

Test: Install 3P keyboard, swiping taskbar up over IME still shows icons
Test: Connect physical keyboard, icons still hide in 3 button nav when
the IME switcher is showing
Fixes: 264723145

Change-Id: Iafb89e765668d70a1bfad2e136957a2ef8924514
2023-01-27 17:24:46 +00:00
Brian Isganitis
b21ad2da8c Implement initial transient Taskbar EDU tooltips.
Since this tooltip looks and behaves differently than the existing EDU
sheet, it has its own view and controller implementations (I also may
have wanted to write some Kotlin).

To keep transient taskbar open while on the second EDU step, another
autohide suspend flag is defined. Additionally, special casing is added
to avoid hiding transient taskbar if autohiding is currently suspended.

Tooltips use the same assets as the bottom sheet for now, and are scaled
down to fit the tooltip dimensions.

Reset `Taskbar Education` in Developer Options to try EDU again.

[Demos]
- First: https://screenshot.googleplex.com/ASBeGvrb2EA5wEF.png
- Second: https://screenshot.googleplex.com/7fnfcTh9bMYezDc.png

Test: Manual
Test: Open app, see swipe-up tooltip.
Test: Swipe up to show transient taskbar, see features tooltip.
Bug: 263157739
Fix: 258460203
Change-Id: I473f5fccbae279db0614763b640da0a120b6b7f7
2023-01-20 15:16:12 -08:00
Nicolò Mazzucato
1207e773e2 Merge changes I2c1e440b,I805d56d4 into tm-qpr-dev
* changes:
  Add OPTIMIZE_MEASURE flag to QuickSteplauncher window
  Log device profile changes in perfetto traces
2023-01-19 19:42:26 +00:00
Jeremy Sim
bc1fa1e6a4 Merge "Fix bug with Taskbar launches in Overview" into tm-qpr-dev 2023-01-19 02:23:32 +00:00
Nicolo' Mazzucato
cb7bd50247 Log device profile changes in perfetto traces
This is needed to easily spot unwanted DeviceProfile changes in perfetto traces, as each one causes many new inflation and slows down the ui thread considerably.

Test: recorded trace with this log
Bug: 258214245
Change-Id: I805d56d4dfe1c08d7f28215c0462d01fcaece84e
2023-01-17 14:54:11 +00:00
Jeremy Sim
2842bc72fd Fix bug with Taskbar launches in Overview
This patch fixes a bug where Taskbar launches (tapping an icon on the Taskbar) were not executing correctly in Overview.

Now that Taskbar is always present in Overview, we need to handle cases where the user taps to launch an app, but the app is already visible to the user in Overview. This was breaking in a noticeable way with split apps, where the Taskbar simply wouldn't respond when the tapped app was already visible as a live tile.

Fixed by polling RecentsModel for already-running tasks, checking to see if the associated TaskView is visible to the user or not, and calling launchTasks() on the TaskView if so. If the tile is not visible to the user, the app will launch normally.

Fixes: 261952204
Test: Work in progress
Change-Id: If761546913bde7451a22456a272ba6c31942c5f8
2023-01-17 13:54:47 +08:00
Vinit Nayak
1d7e050bc6 Respect nav button tinting in SUW
* Check was originally added with rationale in
b/204384193#comment26, however presently we
do provide insets to SUW as of b/253538830
so looks like now we are getting the correct
info from SysUI
* There is a possibly related issue where buttons
are not tinted correctly on the final page of
SUW (b/265238238)

Test: Went through setup manually via adb
and observed that on light theme with dark
dialog scrim the button changes color
adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.SetupWizardTestActivity
Bug: 256521774

Change-Id: I080033e21d22fbc366b7248b2d647fec610a5fb9
2023-01-11 21:29:37 -08:00
Alex Chau
1b276a1ba7 Add transientTaskbarMargin above taskbar in overview
- Also removed transient_taskbar_two_panels_size and use sw720dp override instead, to be consistent with how we handle small vs large tablet in overview
- Also made isTransientTaskbar mockable so we can test that in DeviceProfileDumpTest

Bug: 260596114
Test: DeviceProfileDumpTest
Change-Id: I3c2236b95d91246e9581531478e3c97601cfb2ec
2022-12-19 17:23:27 +00:00
Alex Chau
4537638dfd Merge "Polish hotseat and taskbar with 3 buttons" into tm-qpr-dev 2022-12-19 11:37:39 +00:00