summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/util/Utils.java
Commit message (Collapse)AuthorAgeFilesLines
* [DO NOT MERGE] Add centralized DisplayTracker for SystemUIAlex Stetson2023-01-261-4/+4
| | | | | | | | | | | | In multi-user multi-display systems where there could be multiple SystemUI instances running, the concept of what displays are relevant for a particular SystemUI may change. By adding a DisplayTracker class to abstract away display retrieval and callbacks, these instances can return the information that is most accurate for them. Bug: 256236871 Test: atest SystemUITests Change-Id: I51c1a380a344fb45d5e0de2c5c6ba5610733a3a2
* Cache SHOW_MEDIA_ON_QUICK_SETTINGSPeter Kalauskas2022-05-041-5/+12
| | | | | | | | | | | | | | | Store value of SHOW_MEDIA_ON_QUICK_SETTINGS the first time it is queried to avoid binder calls on critical path. SHOW_MEDIA_ON_QUICK_SETTINGS should not change at runtime. Test: Ensure Settings.Global.getInt is not called during Lockscreen PIN disappear CUJ Test: adb shell settings put global qs_media_controls 1 && \ atest SystemUITests:NotificationSectionsFeatureManagerTest Test: adb shell settings put global qs_media_controls 0 && \ atest SystemUITests:MediaResumeListenerTest Bug: 230620480 Change-Id: Ie3264573071b6daa1cc7393d99aad5359bc2fd1a
* Revert^2 "[Media] Update background gradient scrim to use album theme colors."Caitlin Cassidy2022-04-281-19/+0
| | | | | | | | This reverts commit a95afa554cab13c1d32ad2df0e005fb6defc1f54. Reason for revert: Updated the original CL to fix failing MediaControlPanelTest. Change-Id: I41654ad490c8e4946e59fafbe4a48dc2cd332d97
* Revert "[Media] Update background gradient scrim to use album theme colors."Sam Dubey2022-04-281-0/+19
| | | | | | | | | This reverts commit 46956980554c91bea3cb6fa3148bb80febc2ff55. Reason for revert: Breaking MediaControlPanelTest Bug: 230679986 Change-Id: I1bfc2ca470a1c92da1111bbe8a39b2f870fa9302
* [Media] Update background gradient scrim to use album theme colors.Caitlin Cassidy2022-04-251-19/+0
| | | | | | Fixes: 220355621 Test: manual (see screenshots in bug) Change-Id: I5753a78d95e80ba65f77233f058c803aff0d4f70
* Showing wider header/status bar in shade on large screenMichal Brzezinski2022-03-221-100/+0
| | | | | | | | | | | | Note: Because this change is already huge, I’ll do proper renaming of split shade header to large screen header in the follow-up CL. - introducing new config flag: config_use_large_screen_shade_header and using it to determine which header should be visible - Several adjustments to paddings and margins and how they are calculated on the fly, mostly from notification scrim and motion perspective. Recalculating scrim bounds relative to view bounds - cleaning Utils.java which got very wide-reaching over time. Some things were not used at all and some could be moved. I extracted some functions to two separate utils classes (also open to better ideas): QSUtils and LargeScreenUtils. Not ideal but at least better than one big Util. Fixes: 222472794 Test: expand shade on large screen device in portrait and see one row QS header taking full width of the screen
Test: NotificationPanelViewControllerTest + NotificationQSContainerControllerTest Change-Id: I4988c09c367c721ea9a957df8d1442fc65a336de
* Fixing top notifications cut off on the lockscreenMichal Brzezinski2022-03-041-2/+5
| | | | | | | | | The main issue was split_shade_header_height referencing quick_qs_offset_height - I changed that relation for sw720dp-land, I can’t think of any good reason that should be still needed. Also simplifying getSplitShadeStatusBarHeight - it was assuming that split_shade_header_height would be always referencing quick_qs_offset_height. Fixes: 216919842 Test: Split shade lockscreen with notificaations - swipe up and see if top notification is clipped weirdly Change-Id: Iabedab351d88d732f9e4aeebb5ad3bacad35d677
* Add compact version of new layout for phone landscapeBeth Thibodeau2022-02-031-0/+8
| | | | | | | | | | | | | Splits the new session layout into collapsed and expanded versions. If the new layout is being used, the collapsed version will be used in landscape orientation on smaller devices, and everywhere else will use the expanded version. No change for the old layout (collapsed version still used always in QQS and keyguard) Bug: 209655299 Test: visual - toggle flag, rotate device Test: atest KeyguardMediaControllerTest QuickQSPanelControllerTest Change-Id: I5df62996a4823edd19b1bdc217e08cab13d5b7b0
* Add APIs to get system bar heightsShawn Lin2021-10-191-0/+37
| | | | | | | | | | | | | | | | | | | | | In multi-display devices, there might be differnt cutout on each display which also causes different status bar height. Now we no longer overlay the status_bar_height dimen and keep it as default value and add APIs to calculate the status bar size. - Add APIs for getting status_bar_height & quick_qs_offset_height in system. - Add APIs for getting split_shade_header_height and qs_header_system_icons_area_height in SystemUI. - Remove all resource overlay for status_bar_height & quick_qs_offset_height. Bug: 186604541 Test: atest SmallClockPositionTest DisplayLayoutTest HideDisplayCutoutOrganizerTest SizeCompatTests NotificationPanelViewControllerTest Change-Id: I5a6dfcc6ff06da8ea0fe119fc9d4c089f13b0dff
* Remove feature flag for split shadeAlex Florescu2021-07-201-7/+4
| | | | | | | | | This is still controlled by a config, that can be disabled in overlays if needed, but otherwise will be enabled by default for sw600dp-land Bug: 192077858 Test: manual Change-Id: I90eacc33bb05c954ca1015394110558fa911bb04
* Add recommendation setting and remove app settingsBeth Thibodeau2021-05-261-17/+8
| | | | | | | | | | - Add a new setting to control whether smartspace recommendations are enabled - Remove setting to block individual apps from resumption Bug: 187925818 Test: atest MediaDataManagerTest Change-Id: If1d5f4c5a204e655a90dd2cca6687acdfcd12fec
* Alternative workaround for using private attributeWinson Chung2021-04-191-0/+21
| | | | | | | | | | | | - SysUI studio has trouble referencing this private attribute directly, so move the resolving of the color to the code instead Bug: 152086714 Test: Studio builds, numpad colors still reflect the colorSurface color when changing dark/light & wallpapers Change-Id: I9a96c89010c41eaf6d14d5e1cfe86777cc30c8be
* Don't use horizontal layout for quicksettings when using 2-column shadeAlex Florescu2021-02-101-0/+14
| | | | | | Bug: 171917882 Test: atest SystemUITests + manual Change-Id: Ic059840244585a1f2989bdcd09d792d0968e53d1
* Allow user to block individual apps from resumingBeth Thibodeau2020-08-101-0/+20
| | | | | | | | | | | This adds a setting which stores a list of packages that will be prevented from persisting in QS as resumable media controls, even when resumption is enabled. If the user adds a new package to this list when it already has a resume control, that control will be removed. Bug: 161813143 Test: manual, atest Change-Id: I8c85bc937aeaf366954f2669eba8f6954640fe4c
* Support toggling resumption in SettingsBeth Thibodeau2020-06-201-1/+2
| | | | | | | | | | | | | | Moved setting so we can use Tunable: adb shell settings put secure qs_media_resumption 1 If setting is changed, removes all existing resume players Bug: 154039093 Test: manual Test: atest SettingsProviderTest Test: atest com.android.systemui.media Change-Id: Iad056fbad4520cfe762d9e9f5ed62d38ea1117b1
* Adding back media resumptionBeth Thibodeau2020-06-041-0/+9
| | | | | | | | | | | Behind a flag for now, while we work on animation issues and settings Enable with: adb shell settings put system qs_media_resumption 1 Bug: 156104922 Fixes: 154823185 Fixes: 156256312 Test: manual; atest com.android.systemui.media Change-Id: I77e3706031da820ea0d49c5dfd17f89ae7fb7db4
* Enable media resumptionLucas Dupin2020-05-121-1/+1
| | | | | | Bug: 156369996 Test: make Change-Id: I7d10591fd2bdca1b164cfb2a8e4d122b1a423562
* Move media setting to a constant, disabling itLucas Dupin2020-05-011-2/+3
| | | | | | | Test: manual Test: atest SettingsBackupTest Bug: 155315021 Change-Id: I2f96b1df5e635f3362352ef929e09d7d1ff4be66
* Turn on QS media player by defaultBeth Thibodeau2020-02-261-1/+2
| | | | | | | Test: manual; atest NotificationMediaTemplateViewWrapperTest Bug: 150285848 Change-Id: I1d692360f4f18b60ef34f2f18c9514a52ec88ea2
* Remove all control experimentsMatt Pietal2020-01-301-2/+0
| | | | | | | | And plugins, and flags, and any associated code Bug: 148207527 Test: atest SystemUiTests Change-Id: Id1b800d6ec96b5297e6ed4792ca003d45b61e53e
* Remove all calls to getComponent(CommandQueue.class).Dave Mankoff2019-11-011-6/+5
| | | | | | | | | | | | | | | Makes AuthController, GlobalActionsComponent, InstantAppNotifier, SizeCompatModeActivityController, and TvStatusBar all injectable. Prior to this CL, CommandQueue contained within it a SystemUI object that it used to start itself up and add itself to components. With this change, the SystemUI object is no longer necessary, as Dagger will ensure that a CommandQueue is available to those who need it. Bug: 143702229 Test: atest SystemUITests Change-Id: I2763a6d918b41fe27a2370fdd820da476654e14f
* Home Controls: Consolidate flags for QS media player/NPVMatt Pietal2019-10-301-0/+10
| | | | | | | | Use 'adb shell settings put system npv_plugin_flag X' to enable/disable media player as well as NPV Test: visual Change-Id: I0d889300b4b08c2d89ab75983e77ec3ba739783e
* Migrate NavigationBarView to use RegionSamplingHelperVinit Nayak2019-08-091-0/+14
| | | | | | | | | | | | | | RegionSamplingHelper was a dupe of NavBarTintController. Consolidate, extend, and migrate to use RegionSamplingHelper going forward. fixes: 138601292 Test: Tested phone with apps that have both light and dark backgrounds, tested locking/unlocking, tested livetime dynamic changes with the camera app with light and dark backgrounds, tested orientation changes Change-Id: Icbc34cdac5fce0befd0dfbde14e47c73fe22ed6e
* Changes to MediaProjection UX.Narayan Kamath2019-05-171-0/+23
| | | | | | | | | | Description strings are changed for privileged apps that hold the REMOTE_DISPLAY_PROVIDER permission. Test: Visual Bug: 132924545 Bug: 132924713 Change-Id: Ib9a3be6dc096124d5cec4769ed1f7e8e3eec63f5
* Make Some APIs in CommandQueue aware of multi-display (3/N)Charles Chen2019-01-031-2/+5
| | | | | | | | | | | | | | | By this CL, we could dispatch Callback to fragments on the specified display. I also add some annotations for documenting. TODO: 1. add tests for multi-display. 2. make registerStatusBar be an IStatusBar API to propagate the information when a display is added or in the initial step. 3. Introduce AutoHideController Test: atest SystemUiTests Bug: 117478341 Change-Id: I864600f929c1d0c8aa39274f30c17b213b754d86
* Make CommandQueue implement CallbackControllerJason Monk2018-12-041-2/+2
| | | | | | | For consistency and future utilities Test: existing tests pass Change-Id: If7bc2774452b01f2b3607d559f1f57e54ec06b6c
* Skip null values in Utils.safeForeachBeverly2018-06-151-2/+5
| | | | | | Test: ZenModeControllerImplTest.java Bug: 110209145 Change-Id: I4234be630c84444a70d8cb380ca6a692a4ff5cbc
* StatusBar: add DISABLE2_SYSTEM_ICONS flagCharles He2017-09-251-0/+53
| | | | | | | | | | | | | | | | | Add a StatusBarManager flag to control the visibility of system icons such as connectivity info, battery, etc. Note that the clock is controlled separately through DISABLE_CLOCK. Also note that this flag differs from DISABLE_SYSTEM_INFO, which controls the system icons and the clock as a whole, but only works for the collapsed status bar (CollapsedStatusBarFragment). Bug: 65813398 Test: runtest systemui Test: manual, by using a modified version of TestDPC and DevicePolicyManagerService Change-Id: Icb61c7bb1a625edd818be7a66d7f15c3e812237b
* Fix crash from concurrent modificationJason Monk2017-05-301-0/+31
Change zen callbacks to allow for concurrent modification. Test: runtest systemui Change-Id: I8233353f617c4537104be2ec7be13247ed7f6ae0 Fixes: 38449656