Commit Graph

92 Commits

Author SHA1 Message Date
Fabian Kozynski
9a560e068d DO NOT MERGE Remove Privacy Indicators
Bug: 133257910
Test: build and check that behavior is as P
Change-Id: I24bfc3806e2d12f6a1cc968d6979107e7002a3c4
2019-05-31 20:43:21 +00:00
Dave Mankoff
468d4f6f79 Add support for FalsingPlugin to supply a replacement FalsingManager.
Bug: 130256776
Test: Manual
Change-Id: Icdf150e6e23d216f04a9243fe57919aa622706d5
2019-05-10 12:14:27 -04:00
Evan Laird
47dc4546ec Create notification channel interstitial shelf
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
2019-05-09 11:13:19 -04:00
Lucas Dupin
d7221351c6 Do not show padlock when charging
Also migrated DockManager to dagger

Bug: 123606744
Test: visual
Change-Id: I4061638fd0239fbd0b0b13da199dda4e6f7d166d
2019-04-30 09:42:23 -07:00
Winson Chung
1aa24b9b5e Ensure we get the right nav bar mode for the current user in sysui
- 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
2019-04-24 16:51:26 -07:00
Winson Chung
e8e4bdba18 Add ability to dump specific dependency controller
Bug: 130804868
Test: adb shell dumpsys activity service SystemUIService Dependency OverviewProxyService
Change-Id: Ie88f62d0d0b17ded6f8ff5d3d850f1f444eed444
2019-04-18 17:13:52 +00:00
Fabian Kozynski
d67cffdba0 Adds a DumpController to SystemUI Dependencies
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
2019-04-10 17:28:31 -04:00
Michael Groover
a51ea81f44 Add Sensors Off QS tile and display status bar icon when active
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
2019-03-20 11:48:23 -07:00
Evan Laird
4a47aeea77 One fewer DependencyProvider
`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
2019-03-06 17:00:58 -05:00
Gustav Sennton
5a4fc2122f Only show smart actions for whitelisted apps in lock task mode.
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
2019-03-01 11:54:58 +00:00
Ned Burns
c586467ea5 Invert dependency between NEM and RowBinder
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
2019-02-21 21:15:01 -05:00
Beverly
8fdb533e08 Make StatusBarStateController available to plugins
Test: atest SystemUITests
Bug: 115322193
Change-Id: I46e4b23c9839720a3eb10e381d7aaf79a74c6b33
2019-02-07 14:44:54 -05:00
Christine Franks
71e003eb84 Replace ColorDisplayController references
with ColorDisplayManager, where possible

Bug: 123352608
Test: atest FrameworksServicesTests:ColorDisplayServiceTest

Change-Id: I4feb67197462d49002582931aee285abe85054e6
2019-02-04 14:28:55 -08:00
Fabian Kozynski
04f83eb5f0 Convert PrivacyItemController to Dependency
This makes sure that PIC is a Singleton and prevents memory leak.

Bug: 121388507
Test: atest PrivacyItemControllerTest

Change-Id: Ib5c2a8790157034e1937c8037650ac047478d005
2019-01-24 16:24:40 -05:00
Robert Snoeberger
15b4af1943 Move plugin and settings logic out of KeyguardClockSwitch.
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
2019-01-22 11:32:40 -05:00
Chris Wren
1acdb5e6bb remove status bar icon logs
partial revert of Ife5ce988

Bug: 122451213
Test: runtest systemui
Change-Id: I026217ea8e95ba0805b05e62a5d527c8c3a1d9ce
2019-01-11 10:53:51 -05:00
Ned Burns
f81c4c405f Extract NotificationData.Entry to top-level
NotificationData.Entry -> NotificationEntry

Both NotificationData and NotificationEntry moved
`notification.collection` package.

Test: atest
Change-Id: Ia7158eb732711ddb324e514edb9884d518edab87
2019-01-07 16:31:21 -05:00
TreeHugger Robot
bf435d53ac Merge changes from topic "foreground-service-controller-2"
* changes:
  Factors out notification listening from ForegroundServiceController.
  Collapses ForegroundServiceControllerImpl into interface.
2019-01-04 22:20:45 +00:00
Gus Prevas
eb4e2e1139 Factors out notification listening from ForegroundServiceController.
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
2019-01-04 14:05:43 -05:00
Gus Prevas
59ec2ff443 Eliminates NotificationEntryManager.getNotificationLongClicker().
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
2019-01-04 10:57:20 -05:00
Charles Chen
68b5a35cec Merge changes from topic "commandQueue"
* changes:
  Introduce AutoHideController to centralize call to WMS (4/N)
  Make Some APIs in CommandQueue aware of multi-display (3/N)
2019-01-04 06:39:25 +00:00
TreeHugger Robot
709797647d Merge "Fix tuner crash from dependencies" 2019-01-03 23:18:54 +00:00
Jason Monk
c29c2020a0 Fix tuner crash from dependencies
Test: atest SystemUITests
Change-Id: I530ac3fa5d7dc2a044feab81de9587a21a3bcef7
Fixes: 122320435
2019-01-03 16:52:37 -05:00
Charles Chen
8c9a83fe54 Introduce AutoHideController to centralize call to WMS (4/N)
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
2019-01-03 22:12:38 +08:00
Charles Chen
10ca70b075 Move all logic of navigation bar to NavigationBarController(2/N)
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
2019-01-03 22:12:03 +08:00
Beverly
1be62f46ab Make DarkIconDispatcher visible to plugins
Test: manual
Bug: 115322193
Change-Id: I6204d771e476c504e9070ebc88dd8fd44b268635
2019-01-02 16:13:34 -05:00
Gus Prevas
b43dc65641 Combines NotificationEntryManager listener interfaces (part 2).
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
2018-12-27 09:24:50 -05:00
Jason Monk
7fc1f9bbd5 Remove Dependency#get from ExtensionControllerImpl
Also deprecate Dependency#get.

Test: Updated existing tests
Change-Id: Ibdca61a4971e786c21f5a8bab215bc7a0b8ce7cb
2018-12-21 09:02:18 -05:00
TreeHugger Robot
377749e2f1 Merge "Update SysUi dependency injection to allow for a null LocalBluetoothManager" 2018-12-20 23:29:21 +00:00
Brad Stenning
32cedc1907 Update SysUi dependency injection to allow for a null LocalBluetoothManager
Test: emulator with automotive target
Change-Id: I487b473fe8cca28ad05ed97e1d5bb7c4b29464f2
2018-12-20 11:25:06 -08:00
Gus Prevas
ec9e1f09c7 Extracts heads-up/pulsing logic from NotificationEntryManager.
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
2018-12-20 13:17:17 -05:00
Gus Prevas
8ba88a8eb1 Extracts row binding logic from NotificationEntryManager.
This change introduces the NotificationRowBinder component, which
contains the logic around inflating and binding notification row views
which previously lived in NotificationEntryManager.  Separating this out
to its own component allows us to make the dependencies from other logic
in NEM explicit, and eventually to decouple them once we're not
immediately inflating views for every notification.

Test: atest SystemUITests, manually
Change-Id: Ic74108e92abb402c7aa9524b7a7c5f504879546c
2018-12-19 16:38:25 -05:00
Jason Monk
27d01a624d Start using some dagger 2
Early days as we start migration, so lots of duplication between
Dependency and dagger2, but can be removed when migration is done.

Test: existing tests.
Change-Id: I00c3da6ebbd46a26e512d8a7aa1e2b828e08f33f
2018-12-19 09:47:37 -05:00
Chad Brubaker
90f391fe87 Prototype Spaceship mode qstile
Initial prototype disabling location/sensors and enabling airplane mode.
Camera/Mic will come in a followup.

Test: manual
Bug: 110842805
Change-Id: I26132fcc9ffea83e3e78a0e54882d23c99ee590c
2018-12-14 20:46:04 +00:00
Riddle Hsu
19607774dd Use display context to inflate navbar on external display
- Disable rotation suggestion button if the navbar is on
  non-default display because there is no accelerometer sensor.
- Avoid leakage by removing navbar fragment from fragment
  host when display is removed.

Bug: 117746225
Bug: 117744614
Test: atest SystemUITests
Test: manual - create a virtual display with system decoration.
      The navbar on the virtual display should not change when
      rotating or changing density of default display.
      And after releasing the display, use command "dumpsys
      activity service com.android.systemui/.SystemUIService |
      grep NavigationBarFragment" to check the number of instances.

Change-Id: Icdc8634628ace21395b7eb9d77c6b1067850d1b2
2018-11-14 15:04:44 +08:00
Charles Chen
61325fb32f Introduce DisplayNavigationBarController
DisplayNavigationBarController is a class to control everything related
to external navigation bars. Belows are its tasks:
1. create external nav bars when:
   a. StatusBar.createNavigationBar()
   b. A system decoration supported display added
2. remove external nav bars when display is removed.
3. remove all external nav bars when StatusBar.destroy()

(Following Tasks)
1. Support SystemUiVisualibility for external nav bars
   (corresponding to b/117478341#3)
2. A design doc for refactor

Bug: 115978725
Bug: 117478341
Test: atest SystemUITests
Test: Manual - external nav bars still works

Change-Id: I17084c1be287ae7ccfb94b2d1302072a5d620e29
2018-11-09 16:01:41 +08:00
Winson Chung
2dbcf0973b Moving SysUI with legacy Recents to another build target
- Move all legacy recents code out of the core sysui code
- Add separate target for products which still depend on it
- Move overview proxy implementation into another implementation of the
  recents interface

Test: atest SystemUITests
Test: Push SystemUiWithLegacyRecents to the system image
      adb shell pm disable com.google.android.apps.nexuslauncher/com.android.quickstep.TouchInteractionService
      and ensure that the old recents implementation still works (and split
      screen)

Change-Id: Iad67218ec37c13c79b6393d87f6bdc4f3996e2c6
Signed-off-by: Winson Chung <winsonc@google.com>
2018-10-26 10:15:50 -07:00
Jovana Knezevic
f95d6a17f5 Merge "Makes LocalBluetoothManager multi-user aware." 2018-10-26 16:43:13 +00:00
jovanak
206d6e4475 Makes LocalBluetoothManager multi-user aware.
It enables LocalBluetoothManager to receive broadcasts for a specific
UserHandle, not just the one that created it, by exposing an additional create
method.

To pass in UserHandle different from the one returned in context.getUser(),
one must have INTERACT_ACROSS_USERS_FULL permission.

Should be used by singletons with adequate permissions to be able to monitor
bluetooth state across all users.

For monitoring the state across all users, pass in UserHandle.ALL.

Change-Id: Id89d73b05bfebc2f9e8673c5610b3ff8f70dba0c
Fixes: 117517726
Test: working on them
2018-10-25 14:08:51 -07:00
Fabian Kozynski
1f32cf0c09 Adds a AppOpsController that can be suscribed to.
This is a dependency that replaces AppOpsListener asuming all its
responsibilities and functions. Additionally, it can handle arbitrary
callbacks for an activeChanged notification indicating the uid that had
a change.

In the case of location updates, they are removed if they haven't been
updated in 5 sec.

Test: atest
Change-Id: I647e86418e552721f1a1098d611538ef09654243
2018-10-25 11:23:07 -04:00
Jason Monk
297c04ee53 Make StatusBar not be a NotificationPresenter
Break the NotificationPresenter out of the StatusBar and most of
the logic with it.

 - Break RemoteInput Callbacks out of NotificationPresenter
 - Break Environment Callbacks out of NotificationPresenter
 - Add ShadeController interface for StatusBar (abstraction
   layer from StatusBar)
 - Add InitController to allow for post-init tasks (dependency
 resolution should not go here)
 - Make some dependencies (ShadeController, NotificationEntryManager,
 NotificationLockscreenUserManager usually) lazily-resolved to break
 some dependency cycles

 - Lots of other cleanup

Test: Existing tests do not pass
Change-Id: Ic043c6b15a4ffe551fc27f99b25d5c3caa1be582
2018-10-23 11:19:15 -04:00
Kevin Chyn
ac56f746f0 SensorManager Plugin for trigger events
Bug: 111414690
Bug: 111479454

Test: atest AsyncSensorManagerTest

Change-Id: I141d756e9184418d494285ad1a6ce801c00581c0
2018-10-09 20:09:57 -07: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
Amin Shaikh
947f76d7a1 Remove BluetoothEventManager#setReceiverHandler
Make BluetoothEventManager fields final and remove the method to
unregister receivers unnecessarily (introduced in b/35415158).

Bug: 113122466
Test: runtest systemui && make RunSettingsLibRoboTests
Change-Id: I8f34ab1a809638959ab4096a829c72b3d1ac3a23
2018-08-29 17:19:58 -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
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
Rohan Shah
20790b89c7 Organize notification classes in row/stack
No functional changes. Reorganized logic under either row, stack,
logging, or row/wrapper. Haven't moved all classes over since there's
some classes that create conflicts due to weird use of
package-private/protected (primarily waiting for HUN and shelf classes).

Test: built, ran, used notifications
Bug: 110802404
Change-Id: Ia2152603bdbeb12c522360193511946c843b9266
2018-07-18 11:20:32 -07:00
Alison Cichowlas
fa7614dfd4 Set static Dependency ref after all the Deps are set up.
Test: atest SystemUITests
Bug: 79444334
Change-Id: I1a0cb5a25f4cf13b876a9cad66fc74f82ebdc143
2018-05-22 17:02:30 -04:00
Dan Sandler
4d90d1ede7 SystemUI heap monitor & hprof dump tile.
Adding the tile to your active set will start a continuous memory tracker,
updating the tile every minute with the latest pss value. Tapping the tile
will pull a full heap dump, zip it, and share it via ACTION_SEND.

Additionally, @integer/watch_heap_limit can be set to the heap size (in KB)
at which ActivityManager will automatically generate a heap dump and notify
the user when it's ready.

Available only on IS_DEBUGGABLE builds. Supplies limited. Order now!

Bug: 76208386
Test: atest com.android.systemui.util.leak.GarbageMonitorTest
Test: runtest systemui
Change-Id: I0434dd7dc330784c750469b013e40b31ef92638d
2018-05-01 21:51:15 +00:00
Kenny Guy
a0f6de8ab2 Add spinner for smart replies.
Add a spinner to MessagingGroup that is enabled
when the user has clicked on a smart reply.

Bug: 73607490
Test: atest SystemUiTests

Change-Id: I4d892c19b5df2b443761819929a83f016967e217
2018-04-23 18:58:19 +01:00