Ye olde NotificationData class was responsible for a few general things:
- Keep a list of visible `NotificationEntry`s
- Filter / sort the visible entries
- Keep a sorted / filtered list of those entries
- Answer lots of questions about the entries themselves (rank,
isAmbient, list of entries for current user, etc.)
- Keep track of the current RankingMap
- Set priority buckets on entries
- Tell the group manager when things changed
The basic idea here is to remove NotificationData in favor of 3 other
changes:
1. Any place which needed to query NotificationData for info about the
entry (in particular its ranking) can just ask the entry for it now.
Entries all keep a reference to their rank
2. NotificationEntryManager now just maintains its own list of visible
notifications. It was already the point of contact to get a handle to
NotificationData so this makes call sites simpler.
3. Create a simpler NotificationRankingManager (maybe delete this
eventually) to encapsulate the sorting logic and hang on to the latest
RankingMap
Test: atest SystemUITests
Change-Id: I14073e103c6d50da37207ca8fd86828da0aaaff9
This adds support for registering a single DisplayRotationController
to WMS. It gives a chance for the controller to suggest some
task changes to be executed along with a display rotation. There
is only one because it's a 2-way communication and there is only
intended to be one client for now.
This allows us to move Split and PiP presentation/layout logic out
of WM into systemui because WM no-longer needs to be the one
calculating the new bounds of everything during rotation.
This uses the windowcontainer transaction because all the
configuration changes and the display rotation need to happen
synchronously; otherwise, relayouts can occur after the display
is rotated, but before the configuration changes are applied.
When this happens, apps get incorrect bounds/insets which can
trigger erroneous lifecycle events in the app.
The flow is like this:
1. DisplayContent/Rotation freezes screen
2. DisplayRotationController is notified of a rotation and provided a
callback.
3. The Controller then evaluates/queues some task changes in
a transaction and, when done, fires the provided callback.
4. The callback applies the config change transaction and continues
the rest of the rotation synchronously.
The DisplayWindowController is sys-ui piece that serves as an
interface between system-ui components and display-related wm
logic. For now it just facilitates the rotation calculation, but
in the future it will have more general utility for display logic
like inset/bounds calculation.
Bug: 124011688
Bug: 133381284
Test: Added some wmtests and coretests.
Change-Id: If10695f44fa076725ba17746842f6fbd64da5d20
Had to reformat a block of code because linter was complaining.
Bug: 143972303
Test: atest SystemUITests
Change-Id: I96c163b09217671fcbd3f20133c3a13b696afc75
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
This adds new Dagger qualifiers for BgHandler, BgLooper, MainHandler,
MainLooper, and MainResources, replacing the use of @Named for them.
Bug: 142954072
Test: atest SystemUITests
Change-Id: Ibbda8998e587474c26740ba8d49a8b3f90d89efa
This adds providers for some of the system level objects that we rely
on as well.
A handful of calls for Dependency.get() have been removed in this
cl, (though others are added where necessary).
Bug: 142536902
Test: atest SystemUITests && manual
Change-Id: Id9cb62deba5229895d487803124dd115b7288466
The view is just proxying to an underyling object. Query the object directly.
Bug: 140059518
Test: atest SystemUITests.
Change-Id: I797f7c6a3d8734795d8a34a3709eaeed2e571dfa
Merging UnlockMethodCache and KeyguardMonitor into KeyguardStateController,
making it injectable and introducing KeyguardStateController#isUnlocked
in order to make it easier to keep track of the lock screen state.
Test: atest SystemUiTests
Test: unlock with face, lock again
Test: unlock with password, lock again
Bug: 139363827
Change-Id: I37ac8c7826101852c61382559be9868125c15fac
Mocks out KeyguardUpdateMonitor in all tests, as our unit
tests shouldn't care about it (unless they're testing it directly).
Bug: 140430268
Test: atest SystemUITests
Change-Id: I6a2b5231c434d0f26319090340b9c2a0e903f4b6
This CL takes the features used in DozeSensors and applies
them to the publicly available util.sensors.ProximitySensor class.
It introduces a RateLimiter class for temprorarily suspending the
ProximitySensor as requested.
It introduces a ProximityCheck class for a quick, one time test
of the proximity sensor.
There is some reshuffling of Sensor related code to its own package
as well.
Bug: 141122220
Test: atest SystemUITests
Change-Id: If126be9a56c6966c1678ee70fa6f4623e51361a7
Test: presubmit setup on source branch
Bug: 130289146 Create a Gradle build for SystemUI
Bug: 136279712 Daggerize FalsingManager
Bug: 137324767 "Unable to instantiate service com.android.systemui.doze.DozeService" exception breaks launcher tests
Bug: 137563419 Remove Bouncer reveal delay from bypass flow
Bug: 138787339 Allow Services and Activities to be injected into directly.
Bug: 139128921 [AS 3.5 RC2, SDK API 29 rev 2] Overload resolution ambiguity: while removing element from HashMap
Bug: 64712476 Import translations for dev branches
Change-Id: Ib7fd4706c070907fd556c3532957f3b1b046de6d
Move all sysUi state flag handling into a
separate class.
fixes: 138601608
Test: atest SysUiStateFlagsContainerTest
Checked that callbacks were being sent in
OPS, EdgeHandler and in Launcher codebase via
debugger.
Change-Id: Ie8f7ef2e647db88d244af1062eb95dbb69a46919
Implements a UBR for SystemUI. All classes subscribing to Context should
subscribe here instead to reduce number of IPC into SystemUI.
Test: atest
Bug: 134566046
Change-Id: I6be24f62bd9b9b3a49a4efdf712e2e73c0d8d0ac
We only want a single pulse manager since notifications
need to dynamically switch from pulsing to heads up
in the future.
Bug: 130327302
Change-Id: I0cbf23a69f33850776df81c4616932409670fe67
From NotificationGuts, tapping "Turn off notifications" will now present
a half-shelf allowing the user to directly block up to 4 channels (the
one given from the notification guts + up to 3 other channels from
that app) or the app itself.
Test: visual (for now)
Bug: 130307442
Fixes: 131432719
Change-Id: I7e82928dfd56b9e25e5bef02607eede55b11d9e3
- Load resources from the current user's context to ensure the right
overlays are read
- Create a controller in sysui to dispatch mode change to prevent callers
from calling with the wrong user's context
- Clean up the quickstep contract to prevent launcher from calling methods
using the baked in fw resource ids
Bug: 130185871
Test: Switch to secondary user, ensure the mode is read correctly
Change-Id: I00d9276185777e340b3e758345a00d2e9b3e3e64
The DumpController allows any SystemUI Dumpable class to subscribe to it
and be dumped during dumpsys of Dependency.
Test: manual (dumpsys Dependency shows "DumpController state)
Test: atest DumpControllerTest
Bug: 129544734
Change-Id: If8d3ec667d99a523e5ae25db84173d9b04b6829c
This CL will replace the SensorPrivacyTile with a new tile that can be
enabled from the developer settings. When this new tile is enabled only
the camera, mic, and sensors controlled by the SensorManager will be
disabled; the location and airplane mode tiles will not be modified.
The user will be notified when this tile is enabled with the sensors
off icon in the status bar.
Fixes: 126618519
Test: Manually verified airplane and location are not modified when sensors
off is enabled; also verified icon is displayed when mode is active.
Change-Id: Iabf099d0d76c015015ce9859edc0b225ec554020
`grep -r "(class|interface) DependencyProvider" returns 3 separate
entities claming to be DependencyProvider, which is a little confusing
and unnecessary. Privatized and renamed Dependency.DependencyProvider to
Dependency.LazyDependencyCreator, since I think that's a little bit
closer to what it is
Test: build systemui; atest SystemUITests
Change-Id: I2eed5be889b6c75324c2cf5cfef5d55827dbd8c5
In lock task mode only apps from a specific whitelist can be started. To
avoid showing buttons that won't do anything when clicked we remove
smart actions linking to apps that are not whitelisted.
In this change we add several IPC calls during smart suggestions (in
notification) inflation - one in the common code flow, and several
others only for the case where lock task kiosk mode is enabled. This is
OK from a performance perspective because we inflate smart suggestions
on a background thread.
Bug: 117976013
Test: atest InflatedSmartRepliesTest
Test: start lock-task mode with 1. chrome whitelisted -> chrome actions
show up, 2. chrome not whitelisted -> chrome actions don't show up.
Test: ensure smart replies are still enabled in lock task mode.
Change-Id: I664ff2cdcfd1b212744d85d36d7a2b305bf4b3a9
NotificationEntryManager needs a NotificationRowBinder to inflate views
and bind them. Previously, it did this by calling Dependency.get(), but
this resulted in a circular dependency.
We can't fully break the circularity, but we can make it more explicit.
This CL inverts the dependency -- now the NEM needs someone else to give
it a row binder before it can function properly. Among other things,
this makes testing easier.
This CL allows us to isolate the interface between the NEM and NRB; in
later CLs we can make explicit the async inflation callback between the
NEM and the NRB and finally rewrite most of the NEM tests.
Test: atest
Change-Id: Ibb6ca4416456021a3c0a3679d1d74248fca18af6
with ColorDisplayManager, where possible
Bug: 123352608
Test: atest FrameworksServicesTests:ColorDisplayServiceTest
Change-Id: I4feb67197462d49002582931aee285abe85054e6
This makes sure that PIC is a Singleton and prevents memory leak.
Bug: 121388507
Test: atest PrivacyItemControllerTest
Change-Id: Ib5c2a8790157034e1937c8037650ac047478d005
This is in preparation for adding more logic related to docked state.
Bug: 122301289
Test: Used adb to switch between custom clock faces.
Change-Id: I0a13ef4e5894df1280a04c5a9df8bbed8054557b
NotificationData.Entry -> NotificationEntry
Both NotificationData and NotificationEntry moved
`notification.collection` package.
Test: atest
Change-Id: Ia7158eb732711ddb324e514edb9884d518edab87
This change introduces the ForegroundServiceNotificationListener
component, which contains the logic formerly in
ForegroundServiceController for updating its state in response to
notification events. ForegroundServiceNotificationListener adds a
standard NotificationEntryListener to the NotificationEntryManager,
allowing us to remove the explicit calls from NotificationEntryManager;
splitting this out to its own class prevents us from introducing a
circular dependency since NotificationEntryManager still needs to use
the query methods on ForegroundServiceController.
Test: atest SystemUITests, manual
Change-Id: Iec72aa3a9fd90e3f0079db3b2a3c4f1882e59731
This method always returned NotificationGutsManager::openGuts, and only
existed so that CarSystemUI could override it to disable long presses.
In this change we accomplish this by making
NotificationStackScrollLayout injectable and providing a named flag for
whether to enable long presses or not as a dependency. This means that
NotificationEntryManager is no longer involved in handling long presses,
and CarNotificationEntryManager no longer needs to exist.
Test: atest SystemUITests, manual
Change-Id: Iae78601fea498a37ed47ef9a114e50de1652b6a8
AutoHideController is a per-display controller and has following tasks:
1. Control all auto-hide logic in SystemUi
2. Update hide/unhide status to WMS
Bug: 117478341
Test: atest SystemUITests
Change-Id: I5066030c750f72e6e0b0d70cd377109458989c7d
Since we don't have status bar on external displays, we need to saparate
the logic to make some animations or transitions just work on external
navigation bars. When we set System UI visibility on an external display,
we could make the flag only effect navigation bar. Also, it can simplify
StatusBar code by moving navigation bar related fields into
NavigationBarController.
Test: atest SystemUITests
Bug: 117478341
Change-Id: I1cdf61f6eeb2c377e04a073401efa0cdb45b65cd
This change introduces the NotificationAlertingManager component, a
NotificationEntryListener which handles showing/hiding/updating alerts
(heads-up or ambient pulsing) in response to events from the
NotificationEntryManager. All code in the new component was moved out
of NotificationEntryManager proper.
Test: atest SystemUITests, manual
Change-Id: I46a046da6caf39b1d314b357e21ac6b4755c5796
This change introduces the NotificationInterruptionStateProvider
component, which contains all the logic around whether a notification
should heads-up or pulse previously contained in
NotificationEntryManager.
We also introduce the NotificationFilter component which extracts logic
about when to filter notifications from NotificationData, in order to
break a circular dependency that would otherwise be introduced. As part
of this, some additional fields from the notification ranking map are
denormalized on to the NotificationData.Entry object.
Test: atest SystemUITests, manually
Change-Id: Ic61edca966a3c3e0b01f1a6a9e7ce79c8701da4e