Commit Graph

99 Commits

Author SHA1 Message Date
Riddle Hsu
a3c17fc075 Use rotation hint to update layout
The info from DisplayController is the rotation of display.
While the rotation hint is from the current configuration of
the activity. Because system supports to display activities
with individual rotation at the same time, it is more accurate
to use the hint for layout.

Because there are 4 DeviceProfile instances for 4 rotations.
The instance will be used for corresponding rotation. So the seascape
attributes is a final state which no longer needs to be updated.

Bug: 356164050
Flag: EXEMPT bugfix
Test: Enable auto rotation. Enable home rotation.
      Launch a fixed portrait activity.
      Rotate device to 270 degree (seascape).
      Swipe navigation to return to home.
      Home should use 270 layout directly instead of 90
      and then change to 270 after animation is finished.

Change-Id: Iad0f6ada0ec1cb7f0b5281b508d58276332076fb
2024-08-02 16:40:24 +08:00
Sihua Ma
a44f4ac861 Push a potential fix for hotseat aggregation
This could be caused by landscape layout not receiving inset changes

Adding logs for hotseat layout info as well

Bug: 335141365
Flag: EXEMPT bugfix
Test: N/A
Change-Id: I987f8622907a10fac5375ddddac3db2c5eba41c1
2024-06-05 18:58:23 +00:00
Randy Pfohl
819b835519 Revert "Revert "abtracting Activity from recentsView through rec..."
Revert submission 26911513-revert-26414135-RecentsViewContainer-MEROZZOKJQ

Reason for revert: Fix for issue has been found and will be included in this revert.

Reverted changes: /q/submissionid:26911513-revert-26414135-RecentsViewContainer-MEROZZOKJQ

Change-Id: I517e7d2fc0d82d250a6ed40862dd31c194d0a302
2024-04-11 08:58:08 -07:00
Priyanka Advani
3c71346147 Revert "abtracting Activity from recentsView through recentsview..."
Revert submission 26414135-RecentsViewContainer

Reason for revert: Probable culprit for b/333767026. Will be verifying through ABTD for confirmation and before submitting the revert.

Reverted changes: /q/submissionid:26414135-RecentsViewContainer

Change-Id: I25775cd6531355f1dc042ddb7a8d442ee0b36e58
2024-04-10 21:31:07 +00:00
randypfohl
547d6fc472 abtracting Activity from recentsView through recentsviewcontainer and basecontainerinterface interfaces
This change will let us move from activity to other parent views for recent views.

Summary: In prep for new recentsview containers outside of activity we needed to decouple recentsview from activity and state.
This change will let us move from activity to other parent views for recent views.

Test: Built and tested locally for 1p and 3p launchers on tablet, and portrait modes. Verified working functionality.

Bug: 292269949

Flag: NONE

Change-Id: I5c72745f438d466362ece988c35a97d829e9c1b4
2024-04-10 09:14:28 -07:00
Andy Wickham
b922dccbf5 Cleanup API checks for P, Q, and R.
Test: Build with gradle
Flag: NA
Change-Id: I3ef17090741d14bebd76cf09cf3dc5ac4f11e686
2024-01-24 14:58:08 -08:00
Sunny Goyal
31e27ed934 Moving widget inflation logic to a separate class
This allows us to reuse this logic at other places

Bug: 318539160
Test: atest TaplBinderTests
Flag: None
Change-Id: I2e19aad207efb3a99bb3b70ba71c076699dba2bc
2024-01-10 10:41:44 -08:00
Sunny Goyal
e82a20a44d Removing some dependencies on Activity
> Removing activtiy from overlay callbacks
> Removing usage on activtiyLifecycleCallbacks and managing the callbacks ourselves

Bug: 306225896
Test: Existing tests cover the lifecycle changes
Flag: N/A
Change-Id: I79941e364328eecdc8a72cac4d35b75d50a25319
2023-10-30 08:23:15 -07:00
Stefan Andonian
24a963b268 Move WallpaperColorHints RPC calls to a background thread.
Bug: 251502424
Test: Theme behavior still works fine. Compilation worked well.
Change-Id: I18d0b2094f3ba841846ff98567acc7327a7bd220
2023-08-21 20:10:41 +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
Stefan Andonian
efcff6ceb6 Move Wallpaper RPC call to background thread.
Bug: 251502424
Test: Used logs to time it. This was taking anywhere from 3ms to 19ms on my Pixel 7 Pro device.
Change-Id: I4e9ce55c1269a31f15e910628153c3dfdfd26649
2023-04-27 21:29:39 +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
adb364a104 Unifying multiple all-apps implementations
> Using a single layout for the all-apps content
> Removing some unnecessary themes
> Fixing search chashes in SecondaryDisplayLauncher

Bug: 259733681
Test: Existing TAPL tests verify that Launcher/AllApps work properly
Change-Id: Icd5310316499cd421bc039cdbd4d398b813cd477
2022-12-14 11:27:12 -08:00
Brian Isganitis
5eb66d8abb Refactor ActivityAllAppsContainerView to depend on ActivityContext.
All of the all apps search support is in this class which is also being
refactored to depend on ActivityContext. At the end of this refactor,
this class can be merged with BaseAllAppsContainerView.

Test: Manual
Bug: 216683257
Change-Id: I8cbf21c8d9ce97cc60e9846cfe8c2a7bcb800a01
2022-03-18 10:36:15 -07: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
Sunny Goyal
187b16cb91 Updating window manager estimation logic:
> Moving the code from ApiWrapper to Resource overlays for better maintainability
> Accounting for display cutouts in insets estimation
> Using same logic in display controller and view inset dispatching

Test: Verified on device
Bug: 221961069
Change-Id: I78466353563692ce3f7512b0146ef8b61ef14bc0
2022-03-09 11:15:58 -08:00
Brian Isganitis
1664c9f418 Refactor all apps to depend on activity context.
The current AllAppsContainerView has been split into a base class and a
subclass for activities. The base class allows using all apps with an
activity context. A-Z and work profile tabs are supported, but search
and the hotseat still require an Activity.

Test: Manual. All apps should work the same.
Bug: 204696617
Change-Id: I3b146714bc11b3b3555d97623aab5d78ac836482
2022-01-24 20:24:20 -05:00
Iris Yang
55f74d675c Set launch display id to an action performed on BaseQuickStepLauncher
Without this change, tapping all apps of work profile wouldn't bring
the work profile app back to phone.
Add ActivityOptions#setLaunchDisplayId to the display that the given
view is currently on. So the activity will be launched to the display
as the user is interacting with.

This change also modified BaseDraggingActivity which is the parent
class of BaseQuickstepLauncher. And the RecentsActivity is extending
BaseDraggingActivity.

Bug: 204164763
Test: Manually tested using Exo. Open work appliction(e.g.Calendar)
on Exo virtual display, and tapping on the phone's Calendar on work
profile to bring the application back to phone.
Demo video: https://drive.google.com/file/d/18LWMyDz5kYj8IwAwu5EOsBk3PsjEx1zf/view?usp=sharing&resourcekey=0-7eGtqiWZDciSCfFce29MtA

Change-Id: I31d822f6df7222939413f13da850230f46ba8001
2022-01-11 11:04:05 +00:00
Schneider Victor-tulias
16e04e29d2 Generalize the icon popup menu types.
Generalized popup menu types and logic to allow wider uses outside of launcher.

Bug: 198438631
Test: long pressed launcher icons and pressed menu options
Change-Id: Iadcbb1796496c0061dcee362784e426ff55dc94a
2021-10-19 16:06:16 -07:00
Tony Wickham
2a10e62e92 Add logs for taskbar and overview split action
Log:
- Taskbar app launch (also from foldeR)
- Taskbar app drag (also from folder)
- Taskbar folder open
- Long press to hide taskbar
- Long press to show taskbar
- Overview Split screen action

Also add support for ActivityContext to overwrite/add to LauncherAtom.ItemInfo, which TaskbarActivityContext does to change HotseatContainer and PredictedHotseatContainer to TaskBarContainer

Test: enable logcat locally
Bug: 193009817
Change-Id: Ia82c846a727fecb8cbfd0a069c8af1276083bf83
2021-09-13 17:25:15 -07:00
Sunny Goyal
4ed0fb5074 Removing dependency on wallpaper colors and using theme resources
Bug: 184676715
Test: Manual
Change-Id: Ie9a9a784c4a8a8cd484bfd8ea463deedcd4deed6
2021-04-27 16:29:08 -07:00
Alex Chau
fd6d942220 Pass WindowContext to DisplayInfoChangeListener
- WindowContext (or updated DisplayContext for Pre-S) contains updated Resources to be used for the listener

Fixes: 181215299
Fixes: 176656141
Test: Swap between large/small screen, large sreen UI is seen
Test: Swap between font size, launcher icon text is updated
Test: Start secondary home
Test: Repeat the above tests with Utilities.ATLEAST_S hardcoded to false
Change-Id: Ib33025ac0276c84fe2b3213e9946721e5988e3da
2021-04-23 19:14:20 +01:00
Winson Chung
2b093941e1 Add support for swiping back to the shortcut that launched the activity
Bug: 129067201
Test: Open a shortcut on the workspace, go home

Change-Id: If5d3c3e8e93f09af50aa4994094657347890ef45
Signed-off-by: Winson Chung <winsonc@google.com>
2021-04-22 17:00:47 -07:00
Sunny Goyal
35c7b19fa8 Using WindowContext for listening to configuration changes
Pre-S: Continue to use config-changed broadcast for configuration changes
and display-changed event for rotation changes
S+: Use WindowContext#componentCallbacks for config and rotation changes, and
continue to use display listener for frame-rate changes

Bug: 179308296
Test: Manual and presubmit
Change-Id: I533e69068b5fa6c052a02759ef309dd075ee6a4b
2021-04-22 00:23:02 -07:00
Winson Chung
80988abae3 Merge "Expose the full task info with the remote animation target" into sc-dev 2021-04-01 03:56:56 +00:00
Hyunyoung Song
c07e3b3c28 Remove AA+ decorator logic from aosp code
Bug: 179495850
Test: manual

Change-Id: I7e029e4970f45a0f7c410533f85335a95e4e448c
2021-03-29 00:29:09 -07:00
Winson Chung
cbfbc7493b Expose the full task info with the remote animation target
Bug: 129067201
Test: Manual

Change-Id: Ife60b31a5798f43b55634dbb0f75dbc0c9795560
2021-03-22 20:02:49 +00:00
Sunny Goyal
b65d766d88 Adding support for listening for app launch animation completion
Bug: 181165935
Bug: 179065491
Test: Verified on device
Change-Id: Ifa6a91560cb31b4dfb72a0f582607e873d8a002d
2021-03-10 15:53:21 -08:00
Samuel Fufa
a60d1f9be7 Migrate from Plugin SearchTarget to API search Target [2/3]
- Adds support for android.app.search.SearchTarget in plugin while maintaining plugin SearchTarget support
- Introduces SEARCH_TARGET_LEGACY temporary to switch between plugin and sdk variants.
- Maps resultType and layoutType pairs to the appropriate view

Bug: 177223401
Test: Manual
Change-Id: If8d4bb7c21c47a12447dcb0c56eed8781bd21e54
2021-01-13 12:35:51 -06:00
Samuel Fufa
fd58d23cdf Migrate from Plugin SearchTarget to API search Target [1/3]
Setup architecture for separation between aosp and quickstep search as setup for switch to android.app.SearchTarget

Bug: 177223401
Test: manual
Change-Id: Iefd069a34d5e5551bf731e9171958e93377774aa
2021-01-12 19:46:25 -06:00
Winson Chung
c4bef358b0 DO NOT MERGE Revert "Defer recreation until resumed"
Bug: 171707437
Test: Repro steps in bug

This reverts commit 3f8d868110.

Change-Id: I909ab701c674fe975982a7de06dc9e89dcd03aea
(cherry picked from commit 272f4541f9)
2020-12-09 02:50:37 +00:00
Hyunyoung Song
6b670d62df Good riddance UserEventDispatcher [1/n]
Bug: 165675920
Change-Id: I237ed4243e1724b3c370c5660673bb3966bf4811
2020-08-24 21:19:09 -07:00
Sunny Goyal
fd58da6a75 Wrapping display properties in a wrapper class
This would allow us to support gestures on multiple-displays

Change-Id: I8f426bbdf04520f4189cadce2bde6aab4933c8d9
2020-08-12 13:43:56 -07:00
Winson Chung
c226adb384 Defer recreation until resumed am: 3f8d868110
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12309024

Change-Id: I814a6cab9046b82d66426fbe19636087cfd3e2b6
2020-08-05 06:02:28 +00:00
Winson Chung
3f8d868110 Defer recreation until resumed
- Temporarily work around issue with activity recreation while started
  but not resumed by deferring recreating the activity on theme
  change until after launcher has resumed.

Bug: 162812884
Test: Switch dark mode via QuickSettings, Settings
Test: Change system theme
Change-Id: Ifbc0d538907a30d6b23176cd67353a81b6f8c617
2020-08-04 14:03:42 -07:00
Sunny Goyal
5d09b2e358 Updating some comments and variables
Change-Id: Ib3223c66e9ce187cebc6ce26a46b228f95787778
2020-07-17 18:58:49 +00:00
Sunny Goyal
852537fd98 Using StatsLog for notifyingAppPredictor
> Adding a listener in StartsLogManager for listening to events.
  This allows events to be directored to the predictor only if
  it is already running, instead of creating it.
> Unifying the event format to be same as hotseat predictor

Bug: 160748731
Change-Id: Ib00e6249ff642c030f00bcad5b748255e704d16a
2020-07-16 14:12:15 -07:00
Sunny Goyal
29266c9ebe Updating some comments and variables
Change-Id: Ib3223c66e9ce187cebc6ce26a46b228f95787778
2020-07-09 12:31:49 -07:00
thiruram
c6a38ba5d8 Replaces StatsLogManager.log with StatsLogManager.logger()
Bug: 159170445
Change-Id: Ice6c8a9ae30d8e6b3843bfe42926053849bf9fe0
2020-06-17 17:32:54 +00:00
Samuel Fufa
e9c4f401bd [WW logging] Log rankings for app launches
Bug: 158219113
Change-Id: Ib6db4e73e48ff27ca9d3a5348eea42e1f534dba1
2020-06-15 17:17:47 -07:00
Hyunyoung Song
13c2bc7303 LAUNCHER_APP_LAUNCH_TAP should log correctly for icons inside folder
Bug: 137777105

Change-Id: I5c1552481fc1b788ba41c57bfe97f126f55e5b16
2020-06-11 23:51:17 -07:00
Hyunyoung Song
f26c7930de Fix double logging for wallpaper settings icon activation
Bug: 137957099

Change-Id: Id95fa026c1e6f177ffbb03e99cc18ef03e9a37b5
2020-06-07 22:03:06 -07:00
TreeHugger Robot
aaac3f1519 Merge "Fixing incorrect taskView size in multiwindow-landscape" into ub-launcher3-rvc-dev 2020-05-29 20:00:31 +00:00
Sunny Goyal
b46703d538 Fixing incorrect taskView size in multiwindow-landscape
RecentsView uses deviceProfile to calculate the padding.
Device profile had incorrect sizes in multiwindow mode as it
was not considering the insets.

Bug: 155816922
Change-Id: Iaa5b939624b4128ed634e6de1abf8453e2ae852b
2020-05-28 11:49:31 -07:00
thiruram
c85095b0e9 Fixes missing WW logs for drag and drop events.
Change-Id: I31f8aa132d70b42c3b8213daf0bbd5c555cf3895
2020-05-27 16:35:14 -07:00
Hyunyoung Song
7f7894e3b7 Hookup statsd for workspace layout logging
Bug: 144953948

Change-Id: I81bd42929b2d65a63c610e95e5e01179a3971493
2020-05-10 01:37:42 -07:00
thiruram
f81e8b002a Implement LAUNCHER_ITEM_DRAG_STARTED event.
* Fixes null component issue when ItemInfo object copiedFrom.
* Fixes missing container when item is dragged from hybrid hotseat.

Sample Logs:
2020-04-30 14:09:45.499 30472-30472/com.google.android.apps.nexuslauncher D/StatsLogManager: LAUNCHER_ITEM_DRAG_STARTED
    # com.android.launcher3.logger.LauncherAtom$ItemInfo@260f31f8
    application {
      component_name: "com.android.chrome/com.google.android.apps.chrome.Main"
      package_name: "com.android.chrome"
    }
    container_info {
      workspace {
        grid_x: 2
        grid_y: 2
        page_index: 2
      }
    }
    is_work: false

2020-04-30 14:23:15.230 31320-31320/com.google.android.apps.nexuslauncher D/StatsLogManager: LAUNCHER_ITEM_DRAG_STARTED
    # com.android.launcher3.logger.LauncherAtom$ItemInfo@608f101
    application {
      component_name: "com.google.android.gm/.ConversationListActivityGmail"
      package_name: "com.google.android.gm"
    }
    container_info {
      hotseat {
        index: 1
      }
    }
    is_work: false

Bug: 152978018

Change-Id: I3d3ce213fd2fc6eb5ffb239e048ceb7c0fa88b53
2020-04-30 15:03:43 -07:00
Sunny Goyal
0addbf0512 Various multi-window fixes
> Fixing scale up calculator for swipe-down
> Offsetting pivot so that the preview is aligned to bottom-right
> Allowing insets to be available in multi-window mode as well
> Offsetting taskViewSimulator appropriately in multi-window mode

Change-Id: I7da4c145efca72ef219a5ffcaf23d726812df270
2020-04-29 11:50:33 -07:00
TreeHugger Robot
7ccd2daa62 Merge "ItemInfo null check inside BaseDraggingActivity" into ub-launcher3-rvc-dev 2020-04-21 02:07:12 +00:00
Hyunyoung Song
103e8e36aa ItemInfo null check inside BaseDraggingActivity
Bug: 153611516
Change-Id: I0b9fed9134a103e3f7162756fd91ea4ad89e09bb
2020-04-20 16:29:04 -07:00