Deflake NotificationEntryManagerInflationTest by moving back
to the countdown latch approach and providing our own executor
to AsyncInflationTask.
It was infeasible to depend on the exact number of main thread messages
as other main thread messages from other tests could interfere. Thus.
we move back to the countdown latch for when NotificationEntryManager
finishes inflation. This makes us dependent on the listener API for
determining when inflation is finished, but it's unlikely we can do
better unless we can inject an executor into RowInflaterTask.
In addition, using AsyncTask's SERIAL_EXECUTOR on hwasan builds seemed
to be much slower than normal. This lead to other tests' AysncTask
work delaying the work in this test and leading to the timeout
happening before inflation finished. By providing a test executor
instead and synchronously controlling its execution, we avoid this
issue.
Bug: 150618180
Test: atest --iterations 100 NotificationEntryManagerInflationTest
Test: atest SystemUITests
Test: A forrest run coming soon!
Change-Id: I87c6e2d216c8f26aaf340d311f618c9dccaba8af
This CL adds a way to track BroadcastReceivers that are leaking in test
cases that use SysuiTestCase (all of SystemUITests). Every receiver that
is registered with Context is recorded and those that are not
unregistered are logged as a Warning. After each test, receivers are
unregistered so they don't polute following tests.
Additionally, if a BroadcastDispatcher is instantiated, a Fake is
provided that will also track leaked receivers and log them as Info (as
BroadcastDispatcher will only keep WeakReferences).
This is a separate tracker done directly in SysuiTestableContext instead
of using LeakCheckedTest or a LeakChecker as that is usually pretty
stringent (it will fail the test).
Test: SystemUITests
Bug: 151614195
Change-Id: I11afb49ce3bbc51d98fa069ba4074c852d07bcce
It is less than ideal to see subtitles popping in. Persist and restore them.
Bug: 150876640
Test: atest ControlsControllerImplTest AllModelTest ControlsBindingControllerImplTest ControlsFavoritePersistenceWrapperTest
Change-Id: I449ac020ccdd03f8c42b0a29eef21764514470a0
When no controls have been loaded, and a preferred package has been
set, bind to the preferred service and ask it for suggested controls
to seed the stored favorites.
Bug: 151817620
Test: atest StatefulControlSubscriberTest ControlsBindingControllerImplTest ControlsControllerImplTest ControlsProviderLifecycleManagerTest ServiceWrapperTest
Change-Id: I1e51b8998b8379f08c2b995b7cbe23d1037bd840
A *real* LocalBluetoothManager was being used in the tests and
registering (and not unregistering) multiple broadcast receivers which
was causing the systemui.tests package to exceed its limit for
registered receivers.
Test: atest SystemUITests
Bug: 151614195
Change-Id: I6976abf8ea4f3e984be7aa5393dd7aac5a3ee509
NewNotifPipeline spits out a 2d list of notifications with new/improved
filtering, sorting, and grouping. This CL is an effort to plug that new
hotness into the NSSL, and make it testable hopefully.
Bug: 112656837
Test: not yet
Change-Id: I0ad159295cc9825f8ebbe219b4823dde82ef4621
An animation race condition would cause the blur radius to not be
reset, and the user would get stuck with an unlocked blurred screen.
Test: atest NotificationShadeDepthControllerTest
Fixes: 151527807
Change-Id: I7c3bb7fc9323045c2346adaddd9ab3abf4ed1a2c
It's been on the list of things to remove for a while and now the
conversations feature has some extra needs that can't be addressed by
the existing system.
Moves all logic into IconManager. Icons are still stored on the
NotificationEntry (boo) but they're all encapsulated in a getIcons()
object. All of this logic should eventually move into the content
inflation pipeline (probably?) but for now at least it's self-contained.
Bug: 112656837
Test: atest SystemUITests
Change-Id: Iecbd8999c2c866c7217ad9d0e090fb1db7ddd690
The following CL needs to be able to iterate through all current
notifications, so we need this method.
Adds a method, getAllNotifs() to CommonNotifCollection. This means that
both NotifCollection and NotificationEntryManager must now implement
this method.
NotifCollection previously had the (confusingly-named)
getActiveNotifs(). Now renamed to getAllNotifs().
NotificationEntryManager previously had
getPendingAndActiveNotifications(), which wasn't very efficient.
Restructured to the class to not need to rebuild the collection every
time it was called. Moved the (one) existing client over to use it.
Bug: 112656837
Test: atest SystemUITests
Change-Id: Ic2d5860e080fff8cb11c37ccc1a92f0af761caab
Whenever some change needs to be applied to the NotifCollection (adding
a notification, a lifetime expiring, etc), we'd ideally like to first
make any appropriate changes to our internal state and only after all
changes have been made emit events to any listeners. This ensure that we
never emit an event while our internal state is in some inconsistent or
half-transitioned form.
Previously, we sidestepped this problem by carefully arranging
the order of our internal method calls so that things tended to work
out, but with the introduction of a new collection event,
onRankingApplied(), that is no longer a viable approach.
Now, whenever we need to emit a change event to listeners, we first push
that event to an event queue (mEventQueue). Only once the entire
mutation has been applied to our state do we then emit any events that
have built up in the queue (dispatchEventsAndRebuildList()).
In this CL:
- Move to event queue system for emitting events
- Add new event, onRankingApplied()
- Rearrange how and in what order applyRanking() is called. It is now
always called after the main mutation event. This means, for example,
that the order of events for adding a new notification is (initEntry,
addEntry, applyRanking).
- Clean up some minor test nits
Bug: 112656837
Test: atest SystemUITests
Change-Id: If1b69c19b3303718443dfe91fcde3e03113eea8c
Previously, only changes to the "allowBubbles" on the channel or
package would trigger a ranking change. This bit only indicates that
the notification is allowed to bubble -- it doesn't indicate that
the notification *is* a bubble. To allow active notifications to
become bubbles if the user changes the setting, we need to
flag them in response to ranking changes.
This CL moves the bubble flagging code into BubbleExtractor that
way the flag is always updated during ranking changes.
BubbleController listens to ranking changes and adds / removes bubbles
based on the ranking. The ranking needs to have an isBubble bit on
it because ranking changes won't pipe flag updates through. SysUI
uses this bit to flag the entry on SysUI's side.
Moves the shortcut getting / validating code into a helper class.
Also removes the inline reply requirement.
Test: NotificationManagerTest NotificationManagerServiceTest BubbleExtractorTest ShortcutHelperTest BubbleCheckerTest
Bug: 149736441
Change-Id: Ib5b62923c123187ae5f7073ec7ca50d7e20c04b1
Merged-In: Ib5b62923c123187ae5f7073ec7ca50d7e20c04b1
We now have a spring animation, and the window must be expanded
until the animation is over.
Bug: 149792636
Test: manual
Test: atest NotificationShadeWindowControllerTest
Change-Id: I621813a04136c7bcb01b76f74a7e20d854434258
This is the minimum value required for meeting the accessibility
guidelines, having a contrast ration of 4:1.
Test: visual
Test: atest ScrimControllerTest
Bug: 149792636
Change-Id: I7ae534001983b9b6bb3ccede60f5fb4f43092ed6
Per discussion, enabling round corner for PiP now would force PiP into
gl composition instead of hardware one, which may cause battery drain.
Changed also in this CL:
- Infer destination bounds from TaskInfo in taskVanished
- Add a new helper class to abstract leash transactions
- Remove redundant Objects.requireNonNull
Bug: 151391111
Test: atest PinnedStackTests PipAnimationControllerTest
Change-Id: Iafa9d5ee18fa339f2e2ceb702c21eb025ede2561
Rename the method to setBlockable. Also rename isBlockableSystem in the
same way.
Fixes: 151311073
Test: atest NotificationChannelTest
Change-Id: Ie25f8aed3c22b74d9ad2329863c4ffebbace03f7
Previously, there were only mNormalMovementBounds and
mExpandedMovementBounds since these were the only two sizes PIP window
can be in (on a per-onMovementBoundsChanged call, that is). With the
ability to resize PIP on the horizon, we will need to update the
movement bound as it resizes, and also calculcate this movement with the
new bound on the fly.
Bug: 147361175
Test: Manually. Resize PIP, and then drag around and off-screen, let go
- see PIP window snaps back.
Resize PIP, tap window (see it expands), and wait for timeout. Restores
to previously resized PIP bound.
Change-Id: Iaec103d3964e6141fe4b769879c91159e57f7546
Per CDD change proposal, will honor the layout dimensions such as
AndroidManifest_minWidth / AndroidManifest_minHeight specified by an
activity. Specs in detail: go/cdd-proposal-pip-size
Bug: 147360777
Test: atest PinnedStackTests PipBoundsHandlerTest
Change-Id: I9752aa272968eff15eb7dd2a46ae4591c1c5727f
Home button was showing because it inadvertently got caught in a change
making the home handle stay visible. This change adds a check for the
navigation mode to guard against changing nav bar button visibility when
not in gestural navigation mode.
Test: Tested locally
BUG: 148945635
FIX: 148945635
Change-Id: I15c17b771751a1e1f851b3250169f70aacfd1005