summaryrefslogtreecommitdiff
path: root/src/com/android/launcher3/util/DisplayController.java
AgeCommit message (Collapse)Author
2021-11-22Log the display state when number of screen bounds is inconsistentAlex Chau
- If the number of screen bounds a.k.a. number of displays has changed, it should be a bug from system and add a log for that Bug: 198965093 Test: manual Change-Id: I74612e6c0d2f3cfd52b509e43ea16adf0eec76de
2021-10-07Use displayId to determine CHANGE_ACTIVE_SCREENAlex Chau
- Currently CHANGE_ACTIVE_SCREEN is dispatched when rotating too, which is incorrect. mScreenSizeDp is different in portrait and landscape, and varies more than swapping width/height due to different insets applied. Therefore, use the change of unique display id as a signal instead. Fix: 202366729 Test: Rotate device, overview stays Test: Unfold devices, overview goes away Change-Id: Id8a7d4a1e237717521bfc5a5a67f23c4ee801c61
2021-09-30Ignoring display size change when display is offSunny Goyal
Bug: 198965093 Test: Verified with the script provided on the bug Change-Id: I0efaa5a9b7be94f406a9c283219c715a6c430256
2021-09-23Consolidate isTablet logic across Launcher and SysUITracy Zhou
Fixes: 197960261 Test: Change display size; no nav bar and task bar showing at the same time Change-Id: I56753e9389a49ca3ee455b248a041b3c1569f153
2021-08-31Merge "Revert "Revert "Migrating all model tests to Instrumentation tests""" ↵TreeHugger Robot
into sc-v2-dev
2021-08-31Revert "Revert "Migrating all model tests to Instrumentation tests""Sunny Goyal
This reverts commit 7a4a30d86d471e6c45adc2a9907efb27e9b1799b. Test: Presubmit Reason for revert: Fixing original bug Bug: 196825541 Change-Id: Id4b1eb24a89564d264266d305aebea52917dfcd9
2021-08-26Do not reload launcher when changing active displaySunny Goyal
> Updating IDP to use fixed bitmap sizes, so that the cache stays valid > Caching last known windowMetrices for non-active displays and using estimation only when the cache is not available > Only reloading model if IDP change could have affected the model > Remove unnecessary listeners from IDP which are already controlled by model lifecycle Bug: 191657065 Test: Manual Change-Id: Ia8e6dfafd0977e62aa3fcf367ad79f7a49b2df51
2021-08-24Revert "Migrating all model tests to Instrumentation tests"Alex Chau
This reverts commit 455ba62b5db7a8415e0f250d62c30e9c24ebbb6b. Reason for revert: Breaks tests on all targets Bug: 196825541 Bug: 197570389 Change-Id: Ida6792a09c54dee46105b6b914a0dd1545bdf48d
2021-08-23Migrating all model tests to Instrumentation testsSunny Goyal
Bug: 196825541 Test: Presubmit Change-Id: Iebd46eb41eb46c187d569197f4b97b4fddc0f6f7
2021-05-06Use mWindowContext instead of re-creating to avoid stale ResourceAlex Chau
- ag/14286682 changed to re-create window context in onConfigChange, which regressed the stale Resource problem, changed back to use mWindowContext instead - Removed unnecessary extraInternalDisplays empty check, as empty / before S is already handled inside Display Info CTOR Test: Change display size between default and large, taskbar is enabled/disabled correctly Bug: 181215299 Change-Id: I7397d2dc1a1ce8e132e706e9de592558df6a18e7
2021-05-03Adding support for determining split layout for launcher.Sunny Goyal
> Simulating the windo wmanager API to get available device profiles until final API > When a device has multiple internal displays, and with both tablet and phone possibilities, it uses a split workspace layout Bug: 186160341 Bug: 175782275 Test: Manual Change-Id: Ieff2329acac7cdd6b9abe6f96cd459cd45bd0efe
2021-04-23Pass WindowContext to DisplayInfoChangeListenerAlex Chau
- 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-22Using WindowContext for listening to configuration changesSunny Goyal
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-02-19Merge changes Id68b6c37,I16d39d3e into sc-devTreeHugger Robot
* changes: Fix a couple of crashes when taskbar isn't yet attached Subtract taskbar size from DeviceProfile#availableHeight
2021-02-18Subtract taskbar size from DeviceProfile#availableHeightTony Wickham
Normally availableHeight excludes system insets, but taskbar is added after availableHeight is calculated. This discrepency causes some bad calculations such as TaskView size. Test: touch nav bar when in an app with taskbar present, ensure the task doesn't jump due to incorrect calculation Fixes: 179478728 Bug: 171917176 Change-Id: I16d39d3e1d9708e2a64c81b1ac24466f9567d1b9
2021-02-17Refresh DisplayContext to prevent getting stale DisplayMetricsAlex Chau
Bug: 176656141 Test: Change font size or display size, it should reflect on home screen icon/text sizes. Change-Id: I39bb9d11d246c7ccea1ea4d5af37fba3ce0001be
2021-01-29Fix launcher flicker when unlocking on seascape.Schneider Victor-tulias
Test: manual Fixes: 160544577 Launcher flickers if it is locked on portrait, then unlocked on seascape. DisplayController.Info was consistenly being updated late causing launcher to unlock in lanscape then switching to seascape with enough frames in-between for the user to notice. Updated DisplayController to properly update its rotation info and updated DeviceProfile to force an info update when checking if the device is in seascape orientation. demo: https://drive.google.com/file/d/1JBCvK3brLwOSTC4k56GSxeYozl5x0k7X/view?usp=sharing Change-Id: Idce139f0e16cb686684c0d3a460c4ec9e5ae466a
2021-01-26Revert "Use Diplay.getMetrics in DisplayController"Alex Chau
This reverts commit acfac6187dd9d13d55b566a77a5da867a1813573. Reason for revert: b/176656141 Bug: 176656141 Change-Id: Ic28e50779811d18450000efc2cdfd8184a931bbb
2020-10-20Use Diplay.getMetrics in DisplayControllerAlex Chau
- This is a workaround of b/163815566, where DisplayMetrics is stale when onDisplayChanged is called. - Instead of relying on stale DisplayConext, get the DisplayMetrics from the Display directly. - Also optimized how DisplayController.Info is created by passing in Display only - Use mDisplayContext.getDisplay directly if availalbe Bug: 163815566, 160544577 Test: DPI looks correct on device boot Change-Id: I2a7454bb8cf2073ce592e8662781b87fc998444f (cherry picked from commit 177c38243dc3bf245d1f7db3c265dfb56522f441)
2020-08-20Prevent crash when display is already removed by the time we get displayAddedSunny Goyal
Bug: 165165662 Change-Id: I5486b17a0a7235c922c4b5ebfa2cdc39303a8243
2020-08-12Wrapping display properties in a wrapper classSunny Goyal
This would allow us to support gestures on multiple-displays Change-Id: I8f426bbdf04520f4189cadce2bde6aab4933c8d9