Commit Graph

313 Commits

Author SHA1 Message Date
Priyank Singh
f80e815c1f Removing the privacy chip code completely
Bug: 135440861
Test: Manual
Change-Id: I99aaee22d313eaaeb73b5f1f88983abd761eac81
2019-11-15 22:35:17 +00:00
Dave Mankoff
76939b7e6f Merge changes from topics "b142537875-remove-get-component", "b144284870-get-component-heads-up-manager"
* changes:
  Remove SysUiServiceProvider and mComponents.
  Remove calls to getComponent(HeadsUpManager.class)
2019-11-15 14:40:00 +00:00
Ned Burns
77050aa834 Add NotifListBuilder to new notif pipeline
Adds the NotifListBuilder, the second half of the new notification
pipeline. The NLB is responsible for building the "notif list", the list
of notifications that are currently visible to the user. This differs
from the current list that is generated by the NEM/NotificationData in a
couple ways:

- It's grouped. Children have already been collected into their parent
groups. This means that the notif list now contains only "top-level
entries" -- i.e. either notification groups or notifications that aren't
part of a group.

- It's completely filtered. Previously, we did some filtering in
NEM/NotificationData and some filtering in ViewHierarchyManager. Now,
all filtering should take place in NotifListBuilder.

In order to build the final list, the NLB executes four distinct stages
of its pipeline:

  1. Filtering: Notifications that shouldn't be shown right now are
     excluded.
  2. Grouping: Notifications that are part of a group are clumped
     together into a single object (GroupEntry).
  3. Group transform: Groups are optionally transformed by splitting
     them apart or promoting single entries to top-level.
  4. Section assignment & sorting: top-level entries are divided into
     major "sections" (e.g. silent notifications vs. people
     notifications vs. ...) and then the contents of each section are
     sorted (as well as the contents of each group).

The NLB tries to avoid having any "business" logic in its own
implementation of the pipeline. Instead, parties that want to
participate in building the notif list can register "pluggables" that
can take part in stages 1, 2, and 4. These are:

  * NotifFilter (stage 1): A pluggable for filtering out notifs from
    the final notif list.
  * NotifPromoter (stage 3): A pluggable for "promoting" a child
    notification out of its enclosing group and up to top-level.
  * SectionsProvider (stage 4): A pluggable for determining the
    overall section that an entry belongs to.
  * NotifComparator (stage 4): A pluggable for sorting notifications
    within sections.

Whenever something about a pluggable changes so that it would like to
give a different answer than the one it gave previously, it should call
invalidate() on itself. This will trigger a new run of the pipeline.

In order to represent a list of top-level entries that might be either
single notifications or groups, this CL introduces a new object
hierarchy:

 - ListEntry (superclass)
   - NotificationEntry (subclass, pre-existing)
   - GroupEntry (subclass, new)

Thus, the output of the NLB is a List<ListEntry>. Consumers will need to
do instanceof checks on each entry to discover if it is a
NotificationEntry or a GroupEntry. We could have just allowed
NotificationEntry to have children and skipped the need for GroupEntry,
but it's usually important to force code to think about whether it needs
to examine just the summary or also the children. Some code just cares
about the summary but some really should look at the children as well,
and it's too easy to forget to think about groups if everything is a
NotificationEntry.

Test: atest
Change-Id: I86ffe97611b0cc9792b6c96f3196061b170f56b7
2019-11-14 14:05:38 -05:00
Dave Mankoff
ff63780fd0 Remove calls to getComponent(HeadsUpManager.class)
Bug: 144284870
Test: atest SystemUITests
Change-Id: I08566fdc9a9b52716857dcecc0de65d105530811
2019-11-14 11:06:43 -05:00
TreeHugger Robot
bc657ffff4 Merge "Remove NotificationData" 2019-11-14 15:10:24 +00:00
Jun Wang
fa3116d20b Merge "add HomeHelperTest to check SystemUI" 2019-11-13 21:22:49 +00:00
Evan Laird
181de6242c Remove NotificationData
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
2019-11-13 15:46:06 -05:00
Jun
8dcc06c3f6 add HomeHelperTest to check SystemUI
Test: cd to Master directory, lunch target <hawk-userdebug>
cd frameworks/base/packages/CarSystemUI/src/com/android/systemui
run `atest :auto-end-to-end-postsubmit`
test would fail if SystemUI is broken or any element is missing on
homepage

bug:144112416
Change-Id: I71c61a5361f69a87d91684bf1905b6dc5866e446
2019-11-13 10:40:00 -08:00
Heemin Seog
fb35ab5e28 Fix constantly spinning hvac views
Also clean up some things w.r.t. CarFacetButtonController

Bug: 143610340
Test: manual, atest HvacControllerTest
Change-Id: Idca6f5731704da893fb530deefe2e695281c6f60
2019-11-13 09:00:05 -08:00
Heemin Seog
d59786b99a Clean up nav bar logic from StatusBar
Bug: 143725341
Test: manual
Change-Id: Iaceff2ba8299273653982411932bf9b8583114c6
2019-11-11 17:13:14 -08:00
Heemin Seog
eeca9a9fd6 Create a single car service to share in sysui
Using this as an opportunity to daggerize related classes.

Bug: 144189328
Test: manual, atest CarNavigationBarControllerTest
Change-Id: I58d142bf20b50dca509d84fce6b6258e7d47e98e
2019-11-11 17:13:14 -08:00
Greg Kaiser
e8ed32f81d Merge "Remove circular depdendency in VolumdDialogControllerImpl." 2019-11-11 23:34:15 +00:00
Dave Mankoff
4b07009c7a Merge "Final calls to getComponent(Recents.class) removed." 2019-11-11 22:16:56 +00:00
Dave Mankoff
afc242bddf Remove circular depdendency in VolumdDialogControllerImpl.
This was affecting CarSystemUI.

Bug: 144289426
Test: atest SystemUITests
Change-Id: I9c3b682dd8b68f458a515b173ec52b81c81a1d1b
2019-11-11 16:59:16 -05:00
Dave Mankoff
3a4b8675ec Merge "Remove last call to getComponent(VolumeComponent.class)" 2019-11-11 17:49:51 +00:00
Dave Mankoff
6c64d1f206 Final calls to getComponent(Recents.class) removed.
Had to reformat a block of code because linter was complaining.
Bug: 143972303
Test: atest SystemUITests
Change-Id: I96c163b09217671fcbd3f20133c3a13b696afc75
2019-11-11 12:47:59 -05:00
Dave Mankoff
4dd47fa597 Remove all calls to getComponent(StatusBar.class)
Bug: 143224715
Test: atest SystemUITests && manual
Change-Id: I349836eed9c1e988205681b93f86e967156f90a9
2019-11-11 11:04:51 -05:00
TreeHugger Robot
e4cd28aeca Merge "Add missing components to Dagger component map" 2019-11-07 23:42:50 +00:00
Dave Mankoff
a30b88ba31 Remove last call to getComponent(VolumeComponent.class)
Bug: 143982852
Test: atest SystemUITests
Change-Id: I4f23bda8148a8b484035c19f7745a3e2a40ba436
2019-11-07 18:09:23 -05:00
Heemin Seog
97f35dfce0 Add missing components to Dagger component map
Bug: 144100389
Test: manual
Change-Id: Id7174a9006a7be5b0981b817be363db03d787abc
2019-11-07 13:36:22 -08:00
Heemin Seog
032075cb93 Inject StatusBarKeyguardViewManager into StatusBar
Test: manual (sdk_gphone_x86, hawk), atest SystemUITests
Change-Id: Ib65efeca27971ece2da5af37836ad0b095ebc6af
2019-11-07 12:52:55 -08:00
Heemin Seog
acea497645 Make StatusBarKeyguardViewManager injectable
There is a circular dependency between KeyguardViewMediator and
StatusBarKeyguardViewManager which is addressed via Lazy<> for the
ViewMediatorCallback.

Test: manual (sdk_gphone_x86 and hawk), atest SystemUITests
Change-Id: I10e37a40ba966a9f458155fff2957f5534cb9f91
2019-11-07 12:52:18 -08:00
TreeHugger Robot
427a923619 Merge "Some StatusBar cleanup" 2019-11-07 20:42:03 +00:00
Dave Mankoff
ae3b432a8e Remove Recents from components.
Bug: 143972303
Test: atest SystemUITests && manual
Change-Id: If430d99b2a8b8721cc3ec753a85685d2485fa16b
2019-11-07 13:25:10 -05:00
Beverly
482ad6a5d1 Some StatusBar cleanup
- Remove AppOpsManager + ForegroundServiceController from status bar, instead
register for appOps directly in the ForegroundServiceController
- Remove DozeLog from status bar - it's dumped via DumpController
- Remove ZenController from status bar - only NSSL used it and NSSL can
get it via injection
- Remove NotifLog from StatusBar - move the notifLog for inflation from
NotificationRowBinderImpl to NEM's onAsyncInflationFinished method

Test: atest SystemUiTests
Change-Id: I9fba540c0d8af40b1d1939ff8cb06ee1f5dcc534
2019-11-07 11:33:53 -05:00
Beverly
ea2010c1ec LightsOut has its own controller
Apps can request a low profile mode where status bar and
navigation icons dim. In this mode, a notification dot appears
where the notification icons would appear if they would be there
outside of this mode.

This CL moves the logic for this dot to its own controller

Test: manual (ie: NY times app)
Test: atest LightsOutNotifControllerTest
Change-Id: I46dfab2c7f83cc26c25c257ee02d84058b127036
2019-11-07 09:21:33 -05:00
Dave Mankoff
613c7c6c8a Remove Divider from Components.
This removes all calls to getComponent(Divider.class) and
replaced them with dependency injection.

Bug: 143777499
Test: atest SystemUITests
Change-Id: Ib3704a282593b694fe08bd7228e87f75d18920ed
2019-11-05 20:48:13 -05:00
Heemin Seog
afb3dbc69d Make LayoutInflation a separate injectable class
Next step would be move ShadeController into a separate injectable
object outside of StatusBar to remove circular dependency in
StatusBarWindowViewController.

Bug: 138786270
Test: manual on sdk_gphone_x86-userdebug, atest SystemUITests
Change-Id: I4064278d33d3ae5652e70e109deaa20db86512b3
2019-11-05 15:07:38 -08:00
Dave Mankoff
22ebf3c78d Merge "Make CommandQueue optional." 2019-11-05 22:15:57 +00:00
Dave Mankoff
e951335096 Make CommandQueue optional.
This CL reorgnized providers of StatusBar related classes into
StatusBarModule and StatusBarDependenciesModule. The latter only
contains a provider for CommandQueue, but other common StatusBar
related classes can be added to it in the future. In this way,
changes to CommandQueue construction (or related classes) do
not need to be repeated across multiple projects.

Bug: 143844964
Test: atest SystemUITests
Change-Id: If7e5fcf17eb4c3fee35ac48cc3565d650a916d6b
2019-11-05 15:31:34 -05:00
TreeHugger Robot
ef6649e842 Merge "Fix missing dependency injection" 2019-11-05 17:59:59 +00:00
Aran Ink
2b041061e3 Merge "Track and destroy inline URI grants separately from Notification URIs." 2019-11-04 20:31:06 +00:00
Heemin Seog
4a68948eb3 Fix missing dependency injection
A recent change was made to inject CommandQueue rather than using
Dependency.get. This change missed one of our usages of Dependency.get.

Bug: 143883030
Test: manual, atest CarNavigationBarControllerTest
Change-Id: I6ad888b178071121ac6000f0f622add58db0ca59
2019-11-04 10:52:56 -08:00
Aran Ink
979c9766df Track and destroy inline URI grants separately from Notification URIs.
Bug: 142492493
Bug: 137398133

Test: Unit tests pass. Manual testing with an app configured to receive images via RemoteInput can access and display image URIs after the notification has been canceled, but before the notification entry has been removed from the shade.

Change-Id: If64ae7eff7293df3317a1f629977aaaccd866b32
2019-11-04 12:56:41 -05:00
Fabian Kozynski
5ca7a51c11 Finish migrating to BroadcastDispatcher
This CL migrates most of the remaining classes to use
BroadcastDispatcher. Some classes left are Views or created before the
BroadcastDispatcher can be injected.

Adds docs for instructions on using the BroadcastDispatcher.

Using the broadcast dispatcher, the time system_server spends
dispatching common intents to SystemUI like SCREEN_OFF and SCREEN_ON can
be seen to decrease from ~70-150ms (in a Q build) to ~2-4ms.

Additionally, once a broadcast is received by the dispatcher, time
until it is fully dispatched inside SystemUI is not impacted greatly.
Most broadcasts are fully dispatched after ~20ms with a few of them
taking ~100ms.

Test: atest SystemUITests no regressions
Test: build and boot
Test: tried some random broadcasts and they are properly dispatched
Test: BroadcastDispatch dump
Test: adb shell dumpsys activity broadcasts
Bug: 134566046

Change-Id: I26a592be66b053f25669b5481b58bf7f07bfd0da
2019-11-04 10:53:26 -05:00
Dave Mankoff
aefb346f51 Make BroadcastReceivers Injectable.
GlobalScreenshot.ActionProxyReceiver was calling
getComponent(context, StatusBar.class). With this change, StatusBar is now
injected into the constructor of that class.

Bug: 143224715
Test: atest SystemUITests
Change-Id: I2f635ce98c1c0e2326784c4558b28ce51f347fa9
2019-11-01 20:58:34 -04:00
Dave Mankoff
2e484926ff Register OverlayPlugins in StatusBar directly.
This removes the last call to getComponent(StatusBar.class).
Prior to this change, we would register a listener for OverlayPlugins
inside the SystemUIApp. Because they are directly related to the
StatusBar, it is safe and appropriate to have the StatusBar register
with the PluginManager itself.

Bug: 143224715
Test: atest SystemUITests
Change-Id: I5ecdf6a4dae05ba674bcbcd940b9f2655d2b1cbb
2019-11-01 20:58:34 -04:00
Dave Mankoff
bcaca8a6cd Remove all calls to getComponent(CommandQueue.class).
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
2019-11-01 14:59:11 -04:00
Lucas Dupin
6ed7b37f39 Merge "implement Dumpable for some keyguard classes" 2019-11-01 16:31:33 +00:00
Kamaljeet Maini
d72d706dd8 Allow customization of display timeout value for volume dialog am: 4a1a68d36d
am: 13c3dc5be5

Change-Id: I4738da120ca7866f8362349d36338149c314e11a
2019-10-31 17:15:42 -07:00
Lucas Dupin
64171fe19e implement Dumpable for some keyguard classes
Test: adb shell dumpsys activity service com.android.systemui
Change-Id: I0f241ce6d26c36cc5b64d060ff21ce1986910dd0
2019-10-31 14:43:13 -07:00
Abhijoy Saha
8b884a1183 Merge "Switch CarVolumeItems when group volume changes." into qt-qpr1-dev am: be00e16458
am: 8ea941c086

Change-Id: I71046a20e5706e36d0ef75d23c3634692e4fc40d
2019-10-31 12:36:04 -07:00
Kamaljeet Maini
4a1a68d36d Allow customization of display timeout value for volume dialog
Bug: b/141850913
Test: Local build
Change-Id: I571df53bc458ecbe6c7d70759aa6129501bc03f2
2019-10-31 12:35:42 -07:00
TreeHugger Robot
c7f686a066 Merge "Update to use UserManager.getUserSwitchability()" 2019-10-31 18:40:34 +00:00
Abhijoy Saha
734511281d Switch CarVolumeItems when group volume changes.
If volume dialog is not expanded, then we just replace the old default
CarVolumeItem with the new group.

Bug: 141752233
Fixes: 141752233
Test: Manual
Change-Id: Idfa6ad3a1129e069a297f1c1cfd47b40a61773cc
2019-10-30 16:58:34 -07:00
Keun-young Park
eeb9a61f63 Merge "Migrate car sysui to use new createCar call and prevent crash" into qt-qpr1-dev 2019-10-30 16:37:28 +00:00
Dave Mankoff
a7ca1575a5 Remove call to getComponent(StatusBar) from OverviewProxyRecentsImpl.
StatusBar is now marked as an Optional component.

This also makes implementations of RecentsImplementation injectable.

Bug: 143224715
Test: atest SystemUITests && manual
Change-Id: I9a8c4af477693d133f06b8dbda2f08d904cfdb57
2019-10-30 11:40:42 -04:00
Dave Mankoff
eb0e643c68 Merge "Instances of SystemUI must now define their own ComponentBinder" 2019-10-30 13:50:24 +00:00
Keun-young Park
cefcf97730 Merge "Migrate car sysui to use new createCar call and prevent crash" 2019-10-30 02:56:54 +00:00
Anthony Hugh
4886465390 Update to use UserManager.getUserSwitchability()
Updated framework to handle user switchability cases, so use that
instead of CarUserManagerHelper.

Bug: 131776619
Test: Manually play with user picker.
Test: [1] Open User Picker
[2] Verify can switch to a different user user
[3] adb root && adb shell pm set-user-restriction --user 10 no_user_switch 1
[4] Verify can't switch to a different user
[5] adb root && adb shell pm set-user-restriction --user 10 no_user_switch 0
[6] adb root && adb shell pm set-user-restriction --user 0 no_user_switch 1
[7] Verify can user switch

Change-Id: Ie898723bd93a85d0ea01a9d0879af0c84e904c98
2019-10-29 15:08:28 -07:00