Commit Graph

1445 Commits

Author SHA1 Message Date
Salvador Martinez
25041bcec8 Merge "Update triggering to not double trigger at severe threshold" 2018-10-02 19:52:17 +00:00
Salvador Martinez
88b0d501de Update triggering to not double trigger at severe threshold
If the low threshold is not shown for any reason and we reach the
severe threshold and it does show it will double trigger. This CL
just makes it so both are marked as "shown" if the severe warning
is shown regardless of whether the low warning was shown or not.

Test: runtest systemui
Bug: 116716293
Change-Id: I7fff2d7beba7b37312b9a4c4951a68c3d1f1ba3f
2018-10-01 14:48:41 -07:00
Fabian Kozynski
cca4ee0895 Merge "Fixes NPE when trying to expand QSPanel with wrong name of tile" 2018-10-01 20:16:35 +00:00
Fabian Kozynski
e3137e35a4 Fixes NPE when trying to expand QSPanel with wrong name of tile
Fixes promise of StatusBarManager#expandSettingsPanel to document what
happens on invalid tile name.

Added test to verify correct behavior.

Change-Id: I057210eb47411cf2a7dfefdd4efe49b96fd33f69
Fixes: 111128728
Test: runtest && manual
2018-10-01 12:21:30 -04:00
Tony Wickham
023cb195be Move plugin support to shared lib
In addition to changing imports, this required some changes to use java
7, since that's what the shared lib needs to be for launcher.

See bug for more details on this project.

Test: "atest com.android.systemui.shared.plugins"
  build succeeds and all tests pass

Bug: 115877296
Change-Id: Ib79ede0a61664df0ba1a194632a345d2229777fc
2018-09-28 10:04:09 -07:00
TreeHugger Robot
7913b20eb0 Merge "Fix test failure in NonPhoneDependencyTest.java." 2018-09-27 22:32:23 +00:00
TreeHugger Robot
328099b0ad Merge "Extract NotificationSwipeHelper and related state from NSSL." 2018-09-27 20:54:28 +00:00
Aaron Heuckroth
45d20bed1d Extract NotificationSwipeHelper and related state from NSSL.
Change-Id: Ic0a1178e4f3d6f2addd9bae1c31ec57dffee8eba
Test: Automated tests should pass. Manual testing should also show that notifications behave the same as before (swiping, tapping, dismissing, snapping/unsnapping menu, etc.)
2018-09-27 15:25:42 -04:00
Kevin
c87a66b1cc Fix test failure in NonPhoneDependencyTest.java.
The recent change to NotificationGroupManager to use
HeadsUpManager.isAlerting over the row causes a NPE to occasionally
surface if NonPhoneDependencyTest runs long enough.  When it sets up
the listener, it eventually gets a callback that adds a notification and
calls into NotificationGroupManager even though it hasn't had its
dependencies properly set up.  This CL fixes that by setting its
HeadsUpManager to the mock.

Test: ensure in all tests that NotificationGroupManager has its
dependencies set when NotificationEntryManager adds a notification
Fixes: 116495228

Change-Id: I7b82eedbf46fde5c8709dd03fdd36059041ef911
2018-09-26 16:28:57 -07:00
Winson Chung
67f5c8b2d0 Removing dependencies on recents-specific code in SysUI
- Removing references to SystemServicesProxy (to be removed) for
  AM/WMWrapper
- Removing unused code for old nav bar swiping logic, and also unused
  and quickstep-incompatible code for dragging in recents
- Removing all event bus logic from outside recents subpackage
- Exposing PipUI component for bridge caller

Bug: 114137554
Test: Can still swipe up
Change-Id: Ibcfbe06acae06ea5950615cabd52243279fee16d
2018-09-26 14:14:08 -07:00
Lucas Dupin
e0f7f211d5 Merge "Debug hook for changing display brightness" 2018-09-25 22:46:15 +00:00
Lucas Dupin
92e6c89fbb Debug hook for changing display brightness
adb command that allows the AOD brightness to be changed:
adb shell am broadcast -p com.android.systemui
-a com.android.systemui.doze.AOD_BRIGHTNESS
--ei brightness_bucket {BUCKET_HERE}

Fixes: 116060647
Test: adb shell am broadcast -p com.android.systemui -a com.android.systemui.doze.AOD_BRIGHTNESS --ei brightness_bucket 2
Test: atest DozeScreenBrightnessTest
Change-Id: I57de0801aac17a3df466899aec2cf4f37a017d33
2018-09-25 09:43:38 -07:00
Lucas Dupin
b16030f305 Merge "Clear pattern message when showing it again" 2018-09-25 16:19:27 +00:00
TreeHugger Robot
deaeae425d Merge "Checks keyguard earlier when blocking notifications." 2018-09-25 15:40:26 +00:00
TreeHugger Robot
d79170be26 Merge "Remove updatePublicMode from StatusBar.java" 2018-09-25 14:48:29 +00:00
Lucas Dupin
1fc01dcd49 Clear pattern message when showing it again
Change-Id: Ic68d78babbbd5f2c3fa2b97f49847c7f028c4210
Fixes: 111850911
Test: atest KeyguardPatternViewTest
Test: manual
2018-09-24 16:46:50 -07:00
Selim Cinek
63cc5a6466 Merge "Fixed an issue where a notification may not be updated" 2018-09-24 22:39:22 +00:00
Gus Prevas
533836ac72 Checks keyguard earlier when blocking notifications.
This change modifies NotificationInfo to call the provided keyguard
callback when the "Stop notifications" button is tapped, rather than
when trying to save the new importance value after the undo timeout.

Test: updated test cases in NotificationInfoTest.
Bug: 111416533
Change-Id: I89b4715d0d41be4587753f554862e51c4e1d43c3
2018-09-24 17:28:31 -04:00
TreeHugger Robot
4d2eeb5bf9 Merge "Refactored the contextual group of buttons that appear on the nav bar" 2018-09-22 02:26:30 +00:00
Selim Cinek
4a38f23240 Fixed an issue where a notification may not be updated
When timing out, we need to update the notifications in
case any of the updates have been blocked.

Change-Id: Idea862f7faae136feea650d292694475973fd3cf
Fixes: 80571494
Test: use test app provided
Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/ActivityLaunchAnimatorTest.java
2018-09-21 19:05:00 -07:00
TreeHugger Robot
a48d662edd Merge "Allow whitelisted plugins on user builds" 2018-09-22 01:12:30 +00:00
Matthew Ng
25593cc9b8 Refactored the contextual group of buttons that appear on the nav bar
Refactored NavigationBarView's contextual buttons to keep track of just
one button's visiblity with its container group. The visiblity is
determined by the priority of the buttons. For example, accessibility
has the highest priority, if that is visible, no other buttons can take
its place, however if menu button is visible, then rotation can appear
instead.

Bug: 116041410
Test: atest NavigationBarContextTest
Change-Id: Ic0762c7b7121a313b7c08989f9ab761426372c5c
2018-09-21 17:40:27 -07:00
Aaron Heuckroth
b981efa912 Merge "Remove references to SwipeHelper from NotificationMenuRow." 2018-09-21 15:30:30 +00:00
Aaron Heuckroth
266cb3485c Remove references to SwipeHelper from NotificationMenuRow.
The intent here is to move gesture processing out of NotificationMenuRow and into NotificationSwipeHelper.

Test: Automated tests should pass, and manual experimentation with dismissing/tapping/replying to notifications should work as expected.
Change-Id: Icd32f14769f1b494ecc1dedb2cc37ee129ed21f7
2018-09-20 15:54:16 -04:00
TreeHugger Robot
7f1d0dc731 Merge "Split ambient pulse notif logic from heads up." 2018-09-20 17:42:46 +00:00
Kevin
a97ea059b5 Split ambient pulse notif logic from heads up.
This CL aims to split the ambient pulse logic from the heads up logic as
a lot of the logic is specific to one or the other.  This CL introduces
the following major changes.

1. Introduces AmbientPulseManager which manages notifications that pulse
while the screen is dozing or on AOD and manages their lifetime.

2. Ties pulse duration for notifications more tightly with the lifetime.
This means DozeScrimController does not control the pulse time but
instead AmbientPulseManager.  This is because previously, having two
separate lifetimes (one for the pulse, one for the notification) caused
some strange issues to occur if one ended before the other.

3. Divide out logic for heads up and ambient pulse, so they are no
longer both tied to shouldPeek in NotificationEntryManager.

4. Multiple naming refactors for readability (e.g. contains ->
isAlerting, mShowAmbient -> mOnAmbient, etc.).

Although this is a refactor, some of the behavior does change in some
places where I thought the current behavior was not intended.  In
particular:

* Ambient notifications are no longer marked as seen immediately on
pulsing.  We should reserve this for when we are confident the user has
seen the notification.
* Ambient notifications are no longer disabled or snoozed when heads up
notifications are disabled or snoozed respectively.
* Removing/cancelling a notification that is pulsing no longer keeps
the pulse going awkwardly with no notification in the middle.  Instead,
the pulse ends (provided it was shown for a minimum amount of time).

Change-Id: I26af6f7e7ad7fa71d2d43f7c4d86fb34551151b0
Test: manual, runtest systemui
2018-09-19 17:48:03 -07:00
TreeHugger Robot
500420ce55 Merge "Fixes tapping home button on right edge with quickstep layout" 2018-09-18 23:49:32 +00:00
TreeHugger Robot
4648bd2527 Merge "Fix broken NSSL tests" 2018-09-18 22:44:27 +00:00
Lucas Dupin
c293d8fe5b Allow whitelisted plugins on user builds
Plugins should only run on user builds if explicitly whitelisted.
It's also necessary to hold a signature permission:
  com.android.systemui.permission.PLUGIN

Test: atest PluginInstanceManagerTest
Test: atest PluginManagerTest
Test: manually try to install plugin on user build (whitelisted or not)
Bug: 111414690
Change-Id: If17b13f4caef677d641cba84b491b65c8135679b
2018-09-18 15:26:56 -07:00
Matthew Ng
a099cc8bb1 Fixes tapping home button on right edge with quickstep layout
Reverted ag/4731597 since it was causing issue and instead hides the
menu container when none of its children are visible.

Change-Id: Ie48ef32f8a66392796cb0330faed6dff499bc1b1
Fixes: 114099654
Test: tap around the right edge
2018-09-18 14:54:07 -07:00
Evan Laird
db601aa2e6 Remove updatePublicMode from StatusBar.java
There is still one place where status bar needs to notify
NotificationLockScreenUserManager to updatePublicMode (for the
notification showing sensitive info bug).

Otherwise, this commit removes udpatePublicMode from StatusBar and
should have the exact same call semantics as before.

Test: `atest SystemUITests`
Bug: 112656929
Change-Id: I4fe6bc1d6519ae12581f3c17f14c2fcb505eb5f5
2018-09-18 17:47:46 -04:00
Evan Laird
fec7766594 Fix broken NSSL tests
I don't see a reason why we would constrain mBarState.addListener to
happen only once, because the whole point is that other classes listen
to those changes as well, and will subscribe unless we mock literally
everything.

Change-Id: Id6aed68c48fbc4f94f78fcd38b9fe0ec83d49c7e
Fixes: 115742174
Test: `atest NotificationStackScrollLayoutTest`
2018-09-18 17:28:08 -04:00
Lucas Dupin
fdbfc545d4 Defer theme flags when view isn't attached
Change-Id: Ie042da18b8c84d9067bb4d951f9dd35fe4ea9d19
Fixes: 113530582
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java
2018-09-17 16:06:16 -07:00
Lucas Dupin
7c6ca76793 Allow protected broadcasts in tests
SysUI must send protected broadcasts to avoid system impersonation.
Our tests should also allow these types of broadcasts, otherwise
they will be dropped/skipped on -user builds and functionality
will be broken.

This CL also protects the flashlight broadcast.

Fixes: 110825884
Test: atest com.android.systemui.qs.external.TileServicesTest
Change-Id: I5a3dfc569c1695366e5f0e48cda8a7a32e287e7d
2018-09-14 17:18:54 +00:00
Kevin Han
d4092c1897 Merge "Add NotificationGroupManagerTest" 2018-09-14 01:16:36 +00:00
Kevin
96eed64a09 Add NotificationGroupManagerTest
Add some unit tests for NotificationGroupManager testing some basic
functionality and also some of the complex heads up logic.

Bug: 79705024
Test: runtest systemui

Change-Id: I73f01827063d2704a4e1b1d18d479d4e9375447e
2018-09-11 15:49:27 -07:00
Ying Zheng
4fd6b783e3 Migrate sysUI and carSysUI to the separated car user lib.
Bug: 113868873
Test: build
Change-Id: I48fb69aab7092d256c6839377c905340f9059165
2018-09-11 13:51:49 -07:00
Kevin
e9e938c945 Rename setShouldExtendLifetime in LifetimeExtender
Rename NotificationLifetimeExtender.setShouldExtendLifetime to
setShouldManageLifetime.  This is more clear in what the logic actually
is and reads better.

Test: runtest systemui
Change-Id: Ic5792322ef0a557812d58f07285acee32cce0c1a
2018-09-06 13:52:39 -07:00
Lucas Dupin
90a38dd7f7 Removed shade drawing optimization
Why?
- This optimization has caused many glitches, it easy to break and
  we've done so a few times (technical debt.)
- It's unclear if not calling glClear() is still an optimization.
  Most graphics cards actually expect a glClear and are optimized
  to discard old frame buffers when the method is invoked

Change-Id: If1bb9b8bf4c907ca907dc1205ad05dabfefeba1b
Fixes: 113286511
Test: manual
Test: shalac@ is keeping an eye on the performance dashboard
2018-09-05 09:37:37 -07:00
Amin Shaikh
32d786fb73 Do not animate QS state changes when not in view.
Skip QS state change animations when the target view is not fully
visible on screen.

Some tiles require extra time before the status is fully changed and
therefore will be animated later.

Change-Id: I08e76e0fdeab2b260cb7a41a117a6ff484ca3329
Fixes: 111680760
Test: visual and runtest systemui
2018-09-04 21:48:10 -04:00
TreeHugger Robot
efc032f61e Merge "Refactor managers that defer notification removal" 2018-09-04 23:46:58 +00:00
Kevin
a5ff1fafb3 Refactor managers that defer notification removal
This CL introduces NotificationLifetimeExtender, an interface for the
various notification managers to implement to say that a notification
should stay around even after being removed.  This provides greater
consistency/standardization as opposed to having the same
implementation done differently and scattered throughout different
classes.

Also implements small refactors to try to reduce coupling where possible
(in particular reduce references to NotificationEntryManager) and move
logic to more appropriate locations (in particular move a lot of remote
input logic from NotificationEntryManager to
NotificationRemoteInputManager.)

Test: manual (see below); runtest systemui
* heads up + cancel
* guts active + cancel
* ambient pulse + cancel (UI here is janky even on master)
* have a remote input active + cancel
* have remote history, send, see that the notification stays
Change-Id: I24d345a1f2d8751827e367d1432918b3db7fa5f3
2018-08-31 15:17:28 -07:00
Valentin Iftime
6239e53794 Resize image wallpaper surface to match bitmap size in order to optimize memory
(on AndroidTV there is no need for wallpaper and RAM is wasted)

Bug: 74517029
Test: Push a low resolution wallpaper to the device (adb push new_wallpaper /data/system/users/0/wallpaper),
reboot and check the buffer size for com.android.systemui.ImageWallpaper (adb shell dumpsys SurfaceFlinger)

Change-Id: I992175997ed09360e8fc9c2cabf354fb4fabd1f9
2018-08-31 14:36:33 +02:00
Jason Monk
ae7ced2f95 First kotlin
Convert one class to kotlin and provide a slight amount of guidance.

Test: existing tests
Change-Id: Ie8659765b674ac7b2d82ed3d343f387195c07d83
2018-08-23 12:49:08 -04:00
Jason Monk
e59dc4040a Remove stack scroller references from StatusBar
Try to move as much logic up over into stack scroller as possible.

Things that can't move, funnel through NotificationPanel to make the
interface between StatusBar and NotificationPanel more explicit.

Test: Existing tests

Change-Id: I5fa36a9d5d0a8c7f76b9d1843c0733a5758b5838
2018-08-22 20:42:53 -04:00
Jason Monk
1fd3fc3e64 Refactor StatusBarState out of StatusBar
Test: tests gonna test
Change-Id: Id8d8eb5124e542eac9f3b785a7011a22e758e20b
2018-08-22 12:32:30 -04:00
Jorim Jaggi
af7a8f48b2 Merge "ScreenDecorations: Update corner radius when configuration changes" into pi-dev am: 2c9fd5fbbb
am: 1f90c98891

Change-Id: I5304f627f5fe4577ee4b68317bb94b2b1ac645a4
2018-08-21 18:42:13 -07:00
Lucas Dupin
c892e59dcd Merge changes Ib6e4bbd4,I22f9b929
* changes:
  Hide system overlays on AOD
  Rename StatusBarWindowManager to  StatusBarWindowController
2018-08-21 22:52:52 +00:00
Lucas Dupin
a3e3627375 Hide system overlays on AOD
Test: atest packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarWindowControllerTest.java
Change-Id: Ib6e4bbd4652f8c01460884602def97eb65ad4e98
Fixes: 110990354
2018-08-21 13:22:33 -07:00
Lucas Dupin
1a8588d19f Rename StatusBarWindowManager to StatusBarWindowController
For consistency with the rest of the system since StatusBarWindowManager
isn't neither a system service or part of Window Manager.

Test: sysuitests
Change-Id: I22f9b929cb3e2fb0c68e1960267855f5e56b2a01
2018-08-21 13:20:30 -07:00