Split from home animation needs to originate from the app icon instead of the menu item icon. This can be useful for other animations in the future.
Bug: 226395821
Test: N/A
Change-Id: If45d80e347ba275bd550b6acd6ad81b319e753a3
This change improves the Work Profile use case in two ways:
1. When sharing is disabled for the profile, the Share App button is grayed out, and an appropriate message is displayed if the user taps it.
2. When sharing is enabled for the profile, it actually works.
Bug: 175159046
Bug: 210168826
Test: Manual (toggled DISALLOW_BLUETOOTH_SHARING via Test DPC on local device)
Test: m -j RunLauncherGoGoogleRoboTests ROBOTEST_FILTER=com.android.launcher3.AppSharingTest
Change-Id: Id7ba8efc587d0b94aa1f9b2004bf45254b39f992
Add @Nullable annotations for the fields that are expected
to be null at arbitrary lifecycle time and are their usage
is protected by null checks.
Bug: 205828770
Test: m LauncherGoResLib
Change-Id: I9c31e1dc0d01cdd68dfff0a005ba1f40c257f8ea
The Share App system shortcut is disabled for apps that are deemed unshareable. This updates the UX to gray out the shortcut instead of hiding it. When the user clicks on the grayed out shortcut, a Toast message is displayed. This update also enables the shareability check.
In order to properly gray out the shortcut, this also fixes a bug with BubbleTextView in which ColorStateLists weren't applied correctly.
Bug: 202556634
Bug: 204495363
Test: Manual (observed UX on Wembley device in regular and dark themes)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: Ieb04baf8c9cb9d325119cb97fceb96f2fc5a62ff
to be allowed.
This check existed before the user was able to rotate via the rotation
button while autorotate setting is off.
Test: manual
Fix: 201511975
Change-Id: I920886cb42ec5b8f4d3eb0bdd80b216cd7c3c849
This update allows Launcher to check with an external API to determine whether apps
are shareable before displaying the Share App button. To prevent
extraneous calls to the API, the retrieved shareability data
are cached. A job is scheduled to update this cache once a week.
This feature can be toggled with the ENABLE_SHAREABILITY_CHECK flag in
AppSharing.java. It is currently disabled, as the Play API has only been
partially rolled out.
More details on the design are available at go/app-shareability-cache-design
Bug: 168831749
Test: manual (local Wembley device)
Test: m -j RunLauncherGoGoogleRoboTests ROBOTEST_FILTER="AppShareabilityManagerTest|AppSharingTest"
Change-Id: I971a3776e09b6842dedf315ec592317050dd6790
This prevents overlay-specific dialogs (e.g. the privacy confirmation for NIU Actions) from staying open when the user closes the overlay. For example, the user can tap the Home button or lock the device while a dialog is open on the Recents screen. In these cases, the user is sent to the Home screen, so it wouldn't make sense to leave Recents-related dialogs open.
Bug: 194991283
Test: Manual (local Wembley device)
Change-Id: Ie922ddf5d503b8b9818ee7887021f4df8520ae00
Adding an optional callback to ImageActionUtils.persistBitmapAndStartActivity allows for external handling of the case in which the given intent cannot be resolved. The main use case is for NIU Actions when the user has chosen an assistant that does not support the feature. TaskOverlayFactoryGo provides a callback that shows a dialog in this case.
Various parts of TaskOverlayFactoryGo were also made public for better testability.
Bug: 196125662
Bug: 192406446
Bug: 195681795
Test: m -j RunLauncherGoGoogleRoboTests ROBOTEST_FILTER=TaskOverlayFactoryGoTest
Change-Id: I64f3a1274bc942a64e964dca20bd4245e336ad9d
This handles the case where Settings.Secure.ASSISTANT is null, which occurs when config_defaultAssistant is not set at build time.
Bug: 195600539
Test: Manual (built locally without config_defaultAssistant)
Test: b/195681795
Change-Id: Ie8da67be5f448847c07438a25b12e8b5b2022f05
Tooltip will hide only when the user tapped anywhere on the screen. Earlier tooltip was auto dismissed after 10 seconds.
Bug: 194775081
Test: Local build and run on Pixel 4a
Change-Id: I22f5cdd20e602fc261218d4fa801e80910083c62
(cherry picked from commit 89f7d40c217a81d17519ebf04bcb6b24c2c76b8a)
Overlay is getting updated multiple times, So If a tooltip is getting
shown then next overlay update call will trigger new tooltip regardless of current tooltip behavior.
If a tooltip is getting shown then other tooltips should not be triggered. Added a check for this.
Bug: 194458724
Test: Local build and run on Pixel 4a
Change-Id: I5266ddd7cfa84258b46dc14846d77872752ac442
(cherry picked from commit ced47f4ae652987f746daeec2367d184b1d63937)
Previously, only the buttons themselves were hidden when the feature was flagged off at build time. This adds the rest of the relevant layout UI (captions, spaces) to that logic.
Bug: 192692326
Test: Manual (Pixel 3A, enable_niu_actions on and off)
Change-Id: Ic58d9891887e3e0eb10d38af80b73f04cf66ea79
The NIU Actions buttons send intents to the user's default assistant. If the user clicks one of the buttons without an appropriate default assistant set, a dialog will appear to explain the situation and redirect the user to Settings.
The existing privacy confirmation dialog code has been refactored into a reusable dialog, which is used here.
Bug: 192505939
Test: Manual on local Pixel 3A (unit tests to be added in b/192406446)
Test: m -j RunLauncherGoGoogleRoboTests
Change-Id: I7b43e008aa74805b166c09936fa938a5834c8460
These tooltips are added to educate the user about NIU buttons actions. We have added tooltips for Translate and Listen NIU actions buttons.
Bug: 186006700
Test: Manual
Change-Id: Ib076c2a44055b62f2daf06bddf45aca220a28756
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
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
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
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
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
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
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
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
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
Extract the logic for fetching AssistContent into a common reusable place.
Bug: 179705864
Test: Local build of main launcher
Change-Id: Ife37a393d93f899fa1ae460bdcf0cadff6468b04
Made a few things public and marked them as @VisibleForTesting.
Bug: 179738220
Test: atest -v LauncherGoGoogleRoboTests
Change-Id: I231316ecf9282ad4d54038e218f44f062b3fa413
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
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
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
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
> Changing the lifecycle to follow other static objects in Launcher
> Removing compat interface and inlining everything to helpers
Bug: 141376165
Change-Id: I82bd5db1969101de9a7eac77f32728d70195bb35
- 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
Allows us to override only the required methods, instead of providing
a proxy method for everything
Change-Id: I816dcdb2a8d5432496050118ded0f2bbe7122cf7
- Require users of the activity interface to go through the interface to
get the raw activity
- Remove calls that pass in the activity since the interface already can
get the reference to it internally (and the interface always has the
reference before the caller)
Bug: 141886704
Change-Id: I13e52caba593db918e8a7764c751044142fe7ece
Signed-off-by: Winson Chung <winsonc@google.com>
- Add TaskAnimationManager which keeps track of the animation state whose
lifecycle can be longer than the gesture. Move some of the logic related
to cleaning up old animations into this class (called when the state is
shared across gestures).
- Instead of calling into the shared state directly via UIFactory, add
callback to cleanup the animation and shared state from Launcher
Bug: 141886704
Change-Id: Ib6140b37162f7460a20fa1046cfd4f4068e4a1c6
Signed-off-by: Winson Chung <winsonc@google.com>
- ActivityControlHelper -> BaseActivityInterface
LauncherActivityControlHelper -> LauncherActivityInterface
FallbackActivityControlHelper -> FallbackActivityInterface
QuickCaptureTouchConsumer -> QuickCaptureInputConsumer
- Move gestures to use the activity interface from the gesture state
Bug: 141886704
Change-Id: I6f12daeb03d564143404767dfe4576e3e5da2a1d
- Move the recents animation classes out of util into base quickstep pkg
- Clean up some local var names
Bug: 141886704
Change-Id: I1556179e203cbb43b77ea58e6fe520aa9944099b
- Feed the class down to the input consumers and related gesture classes
instead of specific sysui state flags
Bug: 141886704
Change-Id: I2ade7f48555c9d0ba0d3fac5c1f2dae694624224