Commit Graph

255 Commits

Author SHA1 Message Date
Jon Spivack 58905b4f0a NIU Actions: Add privacy confirmation dialog
This adds a dialog to inform the user that the NIU Actions buttons need to send data to Google in order to function. The user can accept or reject this. The dialog will block use of the feature until the user accepts.

Bug: 191818216
Test: Manual (Pixel 3A with multiple user profiles)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: Iedd056ce239de5269d02a31d28a9778efae34ede
2021-06-29 18:29:22 -07:00
Bill Yi ce114e05f3 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ib7e8679556fb83c611f7fccbf7bf2d7664cd9621
2021-06-24 19:50:04 +00:00
Rajeev Kumar deeab12791 Merge "NIU Actions: More specific permissions error codes" into sc-dev 2021-06-22 03:50:26 +00:00
Jon Spivack 02bbd80ee9 NIU Actions: More specific permissions error codes
The user must enable two different Assistant permissions for the NIU Actions feature to function. Previously, a single error code was sent if either permission was missing. Now a different code is sent depending on which permission is missing, allowing Google Go to better direct the user to the proper setting.

Bug: 191109150
Test: Manual (Pixel 3A)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: Id301ffddf36b992b5722c52ccc6e597e003942dd
2021-06-21 16:49:40 -07:00
Jon Spivack 2a2eee1949 NIU Actions: Update background and dark mode colors
This updates the Recents screen to use the default background colors and updates the NIU Actions buttons to better contrast with the background in dark mode.

Bug: 191049004
Test: Manual (Pixel 3A)
Change-Id: I8aef9968623be373fb71a729a0b99a7b9899cff1
2021-06-21 15:54:05 -07:00
Jon Spivack 77edb686d7 Send NIU Actions Intents to default Assistant
This changes the recipient for NIU Actions from a package hard-coded in a config file to the currently selected default Assistant. The user can change this under Settings -> Default apps.

ImageActionUtils has also been updated to handle the case where its
Intents cannot be resolved, preventing a crash if the user sets the
default Assistant to something that cannot receive NIU Actions.

Bug: 186655099
Test: Manual (Pixel 3A, set default Assistant to Google Go and None)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: I03b93597092575902d507615f32b63f4050c4c69
2021-06-11 13:58:57 -07:00
Jon Spivack 1bd7ccd90b TaskOverlayFactoryGo: Keep persistent instance of AssistContentRequester
Holding a reference to AssistContentRequester prevents it from being deleted by the garbage collector while it is still in use.

Bug: 189985872
Test: Manual (Pixel 3A)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: I204aab907175a171c496c3bd146a8b23d2bbcf16
2021-06-02 16:40:09 -07:00
Rajeev Kumar f6e138cf21 Merge "NIU Actions: Support Dark Mode and Landscape" into sc-dev 2021-06-01 17:43:43 +00:00
Jon Spivack 55cca920e0 Merge "NIU Actions: Do not send image URI when sending error code" into sc-dev 2021-05-28 01:14:21 +00:00
Jon Spivack 1e1f85beff NIU Actions: Support Dark Mode and Landscape
This adds light and dark color variants for the UI elements on the Go Recents screen. Toggling Dark Mode will switch between the themes. Additionally, the button spacing definitions have been updated to better support Landscape orientation.

Bug: 187866121
Bug: 183714277
Test: Manual (Pixel 3A)
Change-Id: Ia2c0cbf372882aad87e4018d10d8f85bd92842e0
2021-05-27 16:23:51 -07:00
Jon Spivack 6eb0186616 NIU Actions: Do not send image URI when sending error code
In the case of a permissions denial, we do not send a screenshot in the NIU Actions Intent. Previously, we sent a fake URI to fit with existing recipient Intent filters, but the recipients have been updated to no longer require this.

Bug: 186780965
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: I7cf92a03946e1663150f963fcea7f6b92833da68
2021-05-27 14:39:16 -07:00
Bill Yi 1276d7b8d7 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I49ec409fe6df98ada02d378db1f652f5a7e0b278
2021-05-25 22:37:31 +00:00
Jon Spivack fea72152fd Merge "Disable NIU Actions on Work Profile apps" into sc-dev 2021-05-20 21:16:22 +00:00
Jon Spivack cdbaea4486 Disable NIU Actions on Work Profile apps
If the currently selected Recent app belongs to a Work Profile, do not allow the user to invoke any of the overview actions. Instead, show the standard blocked by policy message (R.string.blocked_by_policy).

Bug: 187491010
Test: Manual (Pixel 3A)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: I552da9512ab19993eb4bb65fe9269d2aee9f0c4e
2021-05-19 14:58:27 -07:00
TreeHugger Robot 30df7e2205 Merge "Import translations. DO NOT MERGE ANYWHERE" into sc-dev 2021-05-19 02:43:31 +00:00
Bill Yi 0a044199ec Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I638f862f37915af69371535dd0792ae5d59c2c3b
2021-05-18 23:10:48 +00:00
Jon Spivack a44bb71d95 Merge "NIU Actions and Recents UI updates on Go" into sc-dev 2021-05-18 18:05:19 +00:00
Jon Spivack f90db8a8eb NIU Actions and Recents UI updates on Go
This tweaks the layout and fonts in the Go Overview. It also adds rounded corners to the task snapshots in the Recents view on Go by adding an overrideable value to the base Quickstep Launcher.

Bug: 186004471
Test: Manual (Pixel 3A)
Change-Id: I220836a95a6416b85bdb71d88822d25d939cf205
2021-05-17 11:57:01 -07:00
Bill Yi 8132baf3de Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I71372d68317892f9044ff5c8f9397f8f6fd70e71
2021-05-17 10:50:49 +00:00
Bill Yi 6b2be3789c Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: Ia6bc84a966d24fa30a9a5d812c76bd18066acf31
2021-05-13 07:39:28 +00:00
Jon Spivack 9e0189bac6 Default screen context permissions for NIU Actions
This updates the checks for ASSIST_STRUCTURE_ENABLED and ASSIST_SCREENSHOT_ENABLED to return 1 if the settings do not exist. This matches the logic in the Settings app iself, which has the toggle boxes on by default but does not actually initialize those values until they are toggled for the first time.

Bug: 187868947
Test: Manual (tested on Pixel 3A)
Change-Id: I4ef067dcf21b40eea71199e057d7a00d1d8fb2b3
2021-05-11 19:02:58 -07:00
Jon Spivack 4ff2f7697c Merge "Rework NIU Actions buttons UI" into sc-dev 2021-05-11 22:29:12 +00:00
Bill Yi c28b75b8eb Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I384f2a0b04475aed1587f685e6046b14ffaa9240
2021-05-11 04:19:24 +00:00
Jon Spivack 6a7094d43a Rework NIU Actions buttons UI
The shapes, colors, icons, and layout of the NIU Actions buttons have been updated to match the latest UI specs. The icons also no longer overlap with the layout above them, which solves a picking issue.

Bug: 186004471
Bug: 187460625
Test: Manual (tried on Wembley and Pixel 3A)
Change-Id: Ie7a0ca0c21805fc0f126053ec791fd2460710d33
2021-05-10 18:22:52 -07:00
Bill Yi 14980fe0dd Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I67cae1b3cc2fd0e16750dd31f762b9d480792595
2021-05-09 10:50:07 -07:00
Bill Yi 2ca3f98921 Import translations. DO NOT MERGE ANYWHERE
Auto-generated-cl: translation import
Change-Id: I432d4ee0276275401879ce050f9600e2319ef883
2021-05-07 14:43:37 +00:00
Jon Spivack bdf64e79bd Add app package names to NIU Actions Intents
This adds the package name of the currently suspended app to the NIU Actions Intents, for logging purposes.

Bug: 186388671
Test: Manual (printed out the Intent extras while trying various apps)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: I8180347675c8940c960e4aa4c47dec508207c780
2021-04-30 17:37:16 -07:00
Jon Spivack c5919749ea Check screen context permissions for NIU Actions
This checks for the ASSIST_STRUCTURE_ENABLED and ASSIST_SCREENSHOT_ENABLED permissions before sending NIU Actions Intents. If either permission is absent, the screenshot is not sent, and an error code is added to the Intent.

Bug: 182010359
Test: Manual (toggled permissions and clicked NIU Actions buttons on Wembley device)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: Icf0db739f5010862cc2bac496f5410665625f3be
2021-04-28 18:26:13 -07:00
Jon Spivack 23a76dae18 Go Launcher: Update Overview Actions buttons
This updates the layout of the overview buttons to better match more recent UX mocks. It also restores the buttons' captions, which had gone missing.

Bug: 183448909
Test: Manual (verified on Wembley and Sargo)
Change-Id: I931df92cd0d255289168694d4a950649eec7da75
2021-04-14 18:46:32 -07:00
Sunny Goyal 11d7d34f0d Removing unnessary resource split in overview
Bug: 184169818
Test: Presubmit
Change-Id: Iff5a8510be337472f05acb5629712ec088361471
2021-04-02 11:43:29 -07:00
Alex Chau dfde4d96ea Focus running task in overview grid
- calculateTaskSize now returns the Rect for focused task
- Introduced calculateGridTaskSize for non-focused task, and translate non-focused tasks to fit the grid
- As Task Rect is now vertically centered, removed ClearAllButton's grid vertical translation
- When ClearAllButton is not shown (e.g. quickswitch), make sure ClearAllButton's scroll won't be used when page snapping. This happens when page scrolls are translated so they're negative.
- Added back ActionsView when task is focused below the TaskView, which become invisible as you scroll
- In Modal state, move the ActionsView down so it won't cover the TaskView

Bug: 175939487
Test: manual
Change-Id: Idfa94a51f856418adc0503cf04211dcb4b1814fe
2021-04-01 14:52:25 +01:00
Zak Cohen 733efa1bcd Overview - extract AssistContentRequester logic for reuse.
Extract the logic for fetching AssistContent into a common reusable place.

Bug: 179705864
Test: Local build of main launcher
Change-Id: Ife37a393d93f899fa1ae460bdcf0cadff6468b04
2021-03-27 14:53:34 -07:00
Alex Johnston ad4c83ad36 Merge "Block recent work profile apps content capture" into sc-dev 2021-03-25 09:14:05 +00:00
Jon Spivack 6914f93f8e Merge "TaskOverlayFactoryGo: Minor updates for testability" into sc-dev 2021-03-25 05:08:49 +00:00
Jon Spivack 387e65e3c4 Change label for Search button in Go Overview
The visual search button on the Recents screen (on Go devices) will be renamed to Lens.

Bug: 183618164
Test: Manual
Change-Id: I86371e604bd0204510737e5088c95404129818bb
2021-03-24 17:23:32 +00:00
Jon Spivack 375a1bbb92 TaskOverlayFactoryGo: Minor updates for testability
Made a few things public and marked them as @VisibleForTesting.

Bug: 179738220
Test: atest -v LauncherGoGoogleRoboTests
Change-Id: I231316ecf9282ad4d54038e218f44f062b3fa413
2021-03-24 04:05:03 -07:00
Alex Johnston 284aaba153 Block recent work profile apps content capture
Stop data exposure of work profile by blocking
content capture of recents apps when the work
profile is locked.

Manual testing steps
* Set up work profile
* Set personal and work pattern
* Open work app, enter work pattern and
  verify content capture is possible
* Lock device
* Go to Recents and select already opened
  work app. Verify content capture is not
  possible until work pattern is entered.

Bug: 168802517
Test: manual testing
Change-Id: I3e6ba1d8645335785e8e26cdc895ea9c0017a0fd
2021-03-23 16:09:39 +00:00
Jon Spivack 1de153c6e5 Merge "Pass Assistant web URI in NIU Actions" into sc-dev 2021-03-22 23:57:58 +00:00
Jon Spivack f0b702f61b Enable NIU Actions on Go devices
This flips the feature flag to enable the NIU Actions buttons in the Go Launcher Recents page.

Bug: 158157668
Test: Manual (on local wembley device)
Change-Id: Ifa49cbb8840556ce53a09f00e36b0f6a12eb8d60
2021-03-19 14:38:22 -07:00
Sreyas 8dbf38e30f Fixes OverviewActionsView height sizing.
By fixing the action buttons container height and allowing wrap content on overviewActionsView all views have enough room to be displayed and actions button container height can be calculated.
Bug: 182854439
Test: Manual

Change-Id: I34516ba42430d8fe6774e10215dd8ac1127920c8
2021-03-18 20:18:36 -07:00
Jon Spivack 840b42f66f Pass Assistant web URI in NIU Actions
The Task Overlay for the activity shown in Recents requests the AssistContent for that activity. If the content includes a web URI, this is added to the Intents sent by the NIU Actions buttons.

Bug: 180157890
Test: Manual (tested with Chrome as the recent activity on local device)
Test: TODO (b/179738220)
Change-Id: I33c79e75678605693e0282e4ad82dc6af28957dd
2021-03-17 17:47:29 -07:00
Jon Spivack 3a1cfc9082 Add NIU Actions buttons to the Go Overview
The buttons send Intents to the designated app (specified by
niu_actions_package) to do the following:
Listen - Read the contents of the screen aloud
Translate - Translate the contents of the screen
Search - Perform a visual search on the contents of the screen

The Intents also include (via URI) the screenshot of current app used as
a thumbnail by Recents.

The feature is controlled by the enable_niu_actions flag, set to false
here. Both this flag and the niu_actions_package String must be set for
a given Launcher to use these buttons.

Bug: 177955244
Bug: 177955748
Test: Manual (enabled on LauncherGoGoogle and sent Intents to demo Lens
app)

Change-Id: I3d1f870bb176ed0cbae637a45c072bd8acac1d4b
2021-02-09 14:50:56 -08:00
Jon Spivack a89a5084f2 Add the Share App system shortcut to the Go Launcher
This shortcut allows users to initiate peer-to-peer app sharing from an app's long-press menu on the home screen. It does so by passing an intent to the specified component. In this base implementation, that specification in config.xml is left blank, and the button will not appear. In GMS Launchers such as LauncherGoGoogle, the config should be set to point to Nearby Sharing.

This also establishes Launcher3QuickStepGo as a distinct subclass of QuickstepLauncher instead of merely a build configuration.

Bug: 157515296
Bug: 174286192
Test: Manual (tested on local wembley devices)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: I826bd03721d2e7e963b15d5958e9a18a1cc16f1d
2020-11-30 18:53:56 -08:00
Peter Kalauskas 0842cf5f9d Remove Launcher3GoIconRecents
Bug: 144129431
Test: Build and check that Launcher3QuickStepGo is used instead
Change-Id: Ib2a30c9e1e78de7792f34c3505372c8af1cb307d
2019-12-11 12:18:52 -08:00
Sunny Goyal 337c81f664 Removing static instances of UserManagerCompat and AppWidgetManager
> Changing the lifecycle to follow other static objects in Launcher
> Removing compat interface and inlining everything to helpers

Bug: 141376165
Change-Id: I82bd5db1969101de9a7eac77f32728d70195bb35
2019-12-11 10:03:19 -08:00
Tony Wickham 37a0970bf5 Improve quick switch from home by tracking both x and y motion
- Add NoButtonQuickSwitchTouchController which uses
  BothAxesSwipeDetector to track horizontal and vertical motion.
- Initially, we only detect swipe left to right to quick switch
  (like before), but then we allow swipe up to either go to
  overview (if you hold) or back home (if you don't hold).
- xDisplacement transitions non-overview components out (e.g. shelf
  and workspace), and translates overview in.
- yDisplacement translates overview up and scales it down

Bug: 126596417
Change-Id: Id679ad84c08246e205c667a78ed5df00d7276258
2019-11-14 15:50:18 -08:00
Pinyao Ting 2cf2871392 include predicted_rank in app launch logging
Test:
1. . build/envsetup.sh && tapas NexusLauncher
2. ccdebug && cclogcat
3. launch from workspace any app that is also in predicted apps
4. verify in terminal it has correct predicted_rank

Bug: 143855018
Change-Id: I07a62f07057537a6c09384cf944bbc5aa5888d22
2019-11-12 16:40:34 -08:00
Tony Wickham 85d6f25016 Move shelf peeking anim code to ShelfPeekAnim class
Bug: 126596417
Change-Id: I5ba501b04b3eaf12a20ba1312ef362f9734761c3
2019-11-07 15:21:23 -08:00
Sunny Goyal 14168431bd Adding support for dynamic calendar and clock icons
Change-Id: Icdba34340a27a4f6dff7310d0bf9fd29aef1330c
2019-10-29 13:50:02 -07:00
Sunny Goyal 210e174c9c Subclassing Launcher instead of using UiFactory
Allows us to override only the required methods, instead of providing
a proxy method for everything

Change-Id: I816dcdb2a8d5432496050118ded0f2bbe7122cf7
2019-10-21 11:10:21 -07:00