Commit Graph

4135 Commits

Author SHA1 Message Date
TreeHugger Robot
31ddf754dc Merge "Deflake NotificationEntryManagerInflationTest" into rvc-dev 2020-03-19 21:47:41 +00:00
Hall Liu
2227afaacb Merge "Rename NotificationChannel#setBlockableSystem" into rvc-dev 2020-03-19 21:06:53 +00:00
Fabian Kozynski
eae6bb56e4 Merge "Add warnings for leaked receivers in tests" into rvc-dev 2020-03-19 20:51:40 +00:00
Peter Wang
77bdf2a0c0 Merge "[API Review] APIs in SubscriptionManager" into rvc-dev 2020-03-19 20:07:38 +00:00
Kevin Han
a6d5bb4750 Deflake NotificationEntryManagerInflationTest
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
2020-03-19 11:27:57 -07:00
Steve Elliott
a7aededa7d Merge "Populate conversation notifs from shortcut info" into rvc-dev 2020-03-19 15:18:33 +00:00
TreeHugger Robot
6b70283f4e Merge "Controls UI - Persist subtitles" into rvc-dev 2020-03-19 14:35:54 +00:00
TreeHugger Robot
0e56c85768 Merge "Renamed DisplayInfo to TelephonyDisplayInfo" into rvc-dev 2020-03-19 14:29:24 +00:00
Fabian Kozynski
8116816493 Add warnings for leaked receivers in tests
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
2020-03-19 09:35:07 -04:00
Peter Wang
ff7f25ff88 [API Review] APIs in SubscriptionManager
Bug: 146362772
Bug: 148180034
Test: atest SubscriptionControllerTest, TelephonyDatabaseHelperTest, TelephonyProviderTest
Change-Id: I77cad8f828ac38976355b7a5f3e8d757b73694ca
2020-03-18 17:41:05 -07:00
Matt Pietal
85878269e6 Controls UI - Persist subtitles
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
2020-03-18 18:55:31 -04:00
TreeHugger Robot
653604d01b Merge "Controls UI - Suggested controls" into rvc-dev 2020-03-18 22:28:19 +00:00
Jack Yu
ac3ca33567 Renamed DisplayInfo to TelephonyDisplayInfo
To reduce ambiguity with android.view.DisplayInfo.

Test: Telephony sanity tests + unit tests
Bug: 151101989
Change-Id: Ic507b6bf082ca5510ff6d1dcde501f5be9ef074f
2020-03-18 15:11:31 -07:00
Matt Pietal
6126644083 Controls UI - Suggested controls
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
2020-03-18 14:19:28 -04:00
Steve Elliott
46bb2a10a2 Populate conversation notifs from shortcut info
Fixes: 151330577
Test: manual
Change-Id: Ib7b7037155fc1891935fcbe89ced9f1639378ba0
2020-03-18 13:23:51 -04:00
Beverly Tai
97bec1d928 Merge "Add HeadsUpCoordinator to new notif pipeline" into rvc-dev 2020-03-18 00:12:45 +00:00
Beverly Tai
927d128d4d Merge "Use mock dependency LocalBluetoothManager" into rvc-dev 2020-03-18 00:12:38 +00:00
Beth Thibodeau
a51c3140b8 Fixing stray NPEs
Fixes: 151539645
- no session activity

Fixes: 151054103
- no contentIntent

Fixes: 151566982
- no handler for mSeamless

Test: manual, existing tests pass
Change-Id: I543ac440d8185eeaaab7c8d937db30b10b56bc00
2020-03-17 17:39:38 -04:00
Beverly
2520ac32e0 Add HeadsUpCoordinator to new notif pipeline
Fixes: 150797570
Test: atest HeadsUpCoordinatorTest PreparationCoordinatorTest
Change-Id: I42aa9008deb930a3b647a81428c1911171a1fe10
2020-03-17 16:30:40 -04:00
Beverly
f5243333dd Use mock dependency LocalBluetoothManager
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
2020-03-17 16:09:37 -04:00
Ben Lin
fed10a3084 Merge "Reland: Track current resized bounds for resized PIP." into rvc-dev 2020-03-17 18:20:11 +00:00
Evan Laird
25f8496e7c Merge "Plugging in a new ViewHierarchyManager to the new pipeline" into rvc-dev 2020-03-17 17:17:48 +00:00
Evan Laird
9a9a6191e1 Plugging in a new ViewHierarchyManager to the new pipeline
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
2020-03-17 16:20:57 +00:00
John Li
4e3dddce35 Provide QSFactory
Bug: 145892579
Test: atest SystemUITests:CustomTileTest SystemUITests:QSTileHostTest
Change-Id: I3b676e6fc2ec3f3b779c13b7dc8214569cc427e5
Merged-In: I3b676e6fc2ec3f3b779c13b7dc8214569cc427e5
(cherry picked from commit 6fa10209d7)
2020-03-17 08:12:51 +00:00
Lucas Dupin
13dcbd321a Merge "Fix issue where blurs would get stuck" into rvc-dev 2020-03-17 04:04:40 +00:00
Lucas Dupin
60c9fcad57 Merge "Keep window expanded when blurring it" into rvc-dev 2020-03-17 03:26:23 +00:00
Ned Burns
72d9b17699 Merge changes Iecbd8999,Ic2d5860e,If1b69c19 into rvc-dev
* changes:
  Move icon logic out of NotificationEntry
  Add getAllNotifs() to CommonNotifCollection
  Change NotifCollection to use an event queue
2020-03-17 01:48:25 +00:00
Lucas Dupin
b7685c57ac Fix issue where blurs would get stuck
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
2020-03-16 18:22:21 -07:00
Ned Burns
d8b5154b25 Move icon logic out of NotificationEntry
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
2020-03-16 19:50:57 -04:00
Mady Mellor
583092c980 Merge "Include bubble changes in ranking & move flagging to BubbleExtractor" into rvc-dev 2020-03-16 22:35:02 +00:00
Josh Tsuji
e3b5156923 Merge "Don't count overflow bubble in onChildAdded/Removed." into rvc-dev 2020-03-16 21:35:01 +00:00
Ned Burns
88aeaf7dc8 Add getAllNotifs() to CommonNotifCollection
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
2020-03-16 17:12:46 -04:00
Ned Burns
7342e3c3fe Change NotifCollection to use an event queue
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
2020-03-16 17:12:46 -04:00
Hongwei Wang
ca111769ac Merge "Get PiP bounds from layout dimensions if applicable" into rvc-dev 2020-03-16 20:59:09 +00:00
Mady Mellor
56515c4334 Include bubble changes in ranking & move flagging to BubbleExtractor
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
2020-03-16 20:19:39 +00:00
Joshua Tsuji
259c66b8b0 Don't count overflow bubble in onChildAdded/Removed.
Test: dismiss the stack with and without overflow enabled
Fixes: 150781959
Change-Id: Ic4cc9787dbb06dd3f5648d4b4b2fbd5c4dd5c32c
2020-03-16 15:09:27 -04:00
TreeHugger Robot
99596c6c69 Merge "Respect rounded.xml size in ScreenDecorations" into rvc-dev 2020-03-16 17:02:21 +00:00
TreeHugger Robot
d2b0f54cb8 Merge "Fixes home button showing on lockscreen in three button mode" into rvc-dev 2020-03-16 05:01:31 +00:00
Lucas Dupin
967c3dc8f9 Merge "New scrim values for shade and dialogs" into rvc-dev 2020-03-14 21:47:48 +00:00
TreeHugger Robot
14cbd79ec8 Merge "Move overflow bubble to stack on update" into rvc-dev 2020-03-14 03:14:32 +00:00
Lucas Dupin
1bd84d3d49 Keep window expanded when blurring it
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
2020-03-13 19:07:47 -07:00
Lucas Dupin
99f5fbadab New scrim values for shade and dialogs
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
2020-03-13 19:03:12 -07:00
TreeHugger Robot
8ff649e2da Merge "Add PiP round corner on/off switch" into rvc-dev 2020-03-14 00:58:47 +00:00
Kevin Chyn
6b7b2300c4 Merge "Pass operationId to LSS, add HAT to KeyStore" into rvc-dev 2020-03-13 23:53:16 +00:00
Fabian Kozynski
e55493727d Merge "Use Singleton LocalBluetoothManager in SystemUI" into rvc-dev 2020-03-13 22:47:17 +00:00
Hongwei Wang
ec3cb3c6f1 Add PiP round corner on/off switch
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
2020-03-13 15:14:41 -07:00
Hall Liu
9866aa8b70 Rename NotificationChannel#setBlockableSystem
Rename the method to setBlockable. Also rename isBlockableSystem in the
same way.

Fixes: 151311073
Test: atest NotificationChannelTest
Change-Id: Ie25f8aed3c22b74d9ad2329863c4ffebbace03f7
2020-03-13 13:50:48 -07:00
Ben Lin
094c77536b Reland: Track current resized bounds for resized PIP.
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
2020-03-13 12:58:38 -07:00
Hongwei Wang
2e725beeb3 Get PiP bounds from layout dimensions if applicable
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
2020-03-13 09:54:04 -07:00
Govinda Wasserman
22926670f9 Fixes home button showing on lockscreen in three button mode
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
2020-03-13 09:56:05 -04:00