Commit Graph

56 Commits

Author SHA1 Message Date
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
Matthew Ng
e2b4d79fe5 Moved VibrateHelper as a dependency
VibrateHelper is a dependency to minimize number of event listeners.
This is related to the change ag/3711731.

Bug: 73942704
Test: manual, press home button when quick step is enabled
Change-Id: Ic982cd16d88224003aa53847daaa04372898ef22
2018-03-13 18:16:21 +00:00
Julia Reynolds
fc64001126 Tag foreground notis that use certain services
- Draw over other apps
- Camera
- Microphone

The icons are not yet clickable, and the system 'drawing over
other apps' notification still appears even when the app's
notification is tagged.

Test: runtest systemui
Bug: 64085448
Change-Id: Ib3b0cdd9adced82f562f256cb81af80dc395440d
2018-02-28 18:48:58 +00:00
Salvador Martinez
f9e4750af7 Refactor code to support overridden low battery warning
This adds support for enabling the hybrid notification using data
from Device Health Services.

Test: SystemUITests
Bug: 27567513
Change-Id: I5fae3d85f2d4956210bb067ff7c8b14146c8c89c
2018-01-11 09:14:56 -08:00
Christine Franks
5397f0353a Rename NightDisplayController and -Service
Bug: 68258004
Test: make -j100 && runtest -x
frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java
&& runtest -c com.android.server.ColorDisplayServiceTest
frameworks-services
Change-Id: I2b89942bd412e4d6958e65b62bc345fb1e60176f
2017-11-08 10:29:01 -08:00
Matthew Ng
13dbf878bd Started code to pipe overview events and info to launcher
The first event will have navigationbar send its x and y touch events
with no delay (upon vsync) to launcher so that launcher can detect and
animate a drag gesture.

If the user has provisioned setup, the connection between overview to
launcher service will be establish to send any information as a proxy
through binder calls. Connection will be reattached if device switches
between users. Each failure to connect to launcher service will have an
exponential backoff timeout to reconnect.

To implement call Dependency.get(OverviewProxyService.class) and then
getProxy() to get the proxy to pipe events or other information across
to launcher.

Test: manual
Bug: 67957962
Change-Id: I3828474147c37b2c514a682f9124e29a5e142736
2017-11-02 15:45:45 -07:00
Jason Monk
ca1b2ee217 Merge "Auto-dim refinements" into oc-mr1-dev am: 2806975bfb
am: a739d220fc

Change-Id: I4c0fb646b7f2593cf579b0958fa1222dd1c55864
2017-10-16 21:37:54 +00:00
Jason Monk
2044e6e377 Auto-dim refinements
- Don't auto-dim while wallpaper is showing
 - Up alpha to 60%

Change-Id: Ie5fc33279ca46f7de37befacbbd7b42b7d4e5d15
Fixes: 67735001
Test: manual
2017-10-16 11:21:38 -04:00
Evan Laird
f12a1f10ee Log number of known dependencies if Dependency throws an exception
This can provide a modicum of insight into why Dependency may be failing
to retrieve the required class. If, for instance, there is a race
condition then we would expect to see a smaller number of known
dependencies.

Dependency.

Bug: 65560049
Test: request a non-registered depdency from Depdency.java, then read
the logs.

Change-Id: I583287d0b59da321ab590f53a86c2d9b357304b2
2017-09-13 15:33:29 -04:00
Jason Monk
73112d39ea Fix nav bar color while QS customizing.
Test: visual
Change-Id: Ida232817ea1f4419264c3befaa2d14d763fc49a3
Fixes: 64273179
2017-09-07 11:52:20 -04:00
Jason Monk
f8c2f7bd7b Add metrics for status bar
Test: runtest systemui
Fixes: 65289824
Change-Id: Ife5ce98862fc6a92740eaf80cdc0b74cb01dd04e
2017-09-06 15:03:41 -04:00
Dan Sandler
f6e33b1b33 Revert "Add plugin to swap out recents"
This reverts commit 0ea67d82e3.

Bug: 64345190
Change-Id: I353c064db7bfaf91e98b5fd0d3e7180381a1b2b8
Test: n/a
2017-08-15 16:45:07 -04:00
Jason Monk
d819c31050 Change default temp threshold to use shutdown temp
Base the temp threshold to be based on the shutdown temp lowered
by some amount to ensure the warning can be seen before a shutdown.

Test: runtest systemui
Change-Id: I033a776e874d76018592954932ed5127e1b228ae
Fixes: 62845934
2017-08-11 14:44:51 -04:00
Adrian Roos
7a8ae8a4b2 SysUI: Move all sensor operations to the background thread
Registering / unregistering listeners for sensors now frequently takes several hundred
miliseconds. Work around this by moving all sensor operations off the main thread.

Change-Id: Ic3537889e1d6e045149942bebb0211afe1192033
Fixes: 64103634
Test: Turn on phone from AOD2. Verify no jank.
2017-08-02 16:26:52 +02:00
Adrian Roos
369907f02e Keyguard: Factor out Screen and Wakefulness lifecycles
Test: runtest systemui
Bug: 62446740
Change-Id: Ife34c1f4299b152a6352445adc8c9fc3c757e87c
2017-07-19 18:26:51 +02:00
Lucas Dupin
75ec379067 WallpaperColors caching and synchronization
Making sure that colors are being cached in
WallpaperManagerService and that sysui won't
force a new color extraction.

Fixes: 62958267
Test: manual, reboot, look at systrace
Test: runtest -x cts/tests/app/src/android/app/cts/WallpaperManagerTest.java
Change-Id: Ic079a8e3d4d4ad65947b718dcc544f795c16f152
2017-07-05 16:10:29 -07:00
Jason Monk
0ea67d82e3 Add plugin to swap out recents
Adds new mechanism for activities in sysui to be replaced by plugins
and allows that to happen for recents.

Test: runtest systemui
Change-Id: I8b570ce7c57484c58a52afe5e247d24ebfa0c57f
2017-06-27 20:41:45 +00:00
Lucas Dupin
1ead7fc753 Scrims should be grey when in-app
Bug: 38164389
Test: runtest -x colorextraction/tests/src/com/google/android/colorextraction/ColorExtractorTest.java
Test: runtest -x tests/src/com/android/systemui/colorextraction/SysuiColorExtractorTests.java
Change-Id: Ifcc04a8562e46b4f65bce0470ccd6c02dffcf377
(cherry picked from commit e1571705e6)
2017-06-14 10:00:16 -07:00
Dan Sandler
f5aafb9e18 Hide redundant foreground service notifications.
If an app with a foreground service has (at least one)
FLAG_FOREGROUND notification shown to the user, we allow
that to satisfy the requirement that the user be informed
about such things. But if the fg notification or its channel
is blocked by the user, we show the NOTE_FOREGROUND_SERVICES
notification (a/k/a Dianne's Dungeon) provided to us by the
activity manager.

Note that if even one of the foreground processes for the
current user is missing its disclosure notification, the
user will see the whole dungeon.

Bug: 36891897
Test: runtest -x frameworks/base/packages/SystemUI/tests/src/com/android/systemui/ForegroundServiceControllerTest.java
Change-Id: I435b7c01e60f99da162c9ea61656e2991d2cb87c
2017-06-06 17:36:33 -04:00
Jorim Jaggi
fabc743bcf Optimize latency when unlocking phone
Latency when unlocking the phone regressed a bit for two reasons:
- For lockscreen -> app we now have to create a full starting
window containing the snapshot, while previously this was just
showing a surface.
- For lockscreen -> home, we can't use the saved surface anymore
because currently we don't support snapshotting translucent
activities. However, in the long term, we want home screen to be
more involved into transitions anyways, so we'll have to wait for
the first frame draw anyways.

However, crystal ball trainee developer Jorim added some
artificial latency in this transition 3 years ago, because he knew
that it is going to be an issue at some point so we have some
headroom to improve! Genius! On a more serious note, it was because
he didn't understand how to read systraces with binders involved (to
be fair, there was also no binder tracing).

Now, we can completely fix the introduces latencies above by
removing this latency of 100ms, and we are 30-70ms better than
before! However, this requires a lot of discipline in SystemUI.
Currently, the callback to dismiss Keyguard takes around 30ms. By
moving all non-essential binder calls of the main thread or to the
next frame, we bring this down to 5ms, such that window animation
and Keyguard animation starts about at the same time.

Test: Take systrace, unlock phone...profit!

Change-Id: I3ea672bc2eca47221bc6c9f3d7c56b6899df207d
Fixes: 38294347
2017-05-18 00:06:34 +02:00
Jason Monk
d4afe152bf Rounded corners support, off by default.
Test: runtest systemui
Bug: 33208650
Change-Id: I63e11e36268e277cc1c5e70651fa5248aa8b3fc0
2017-05-10 08:27:34 -04:00
Lucas Dupin
314d41f5c0 ColorExtractor available through Dependency
Having only one instance of ColorExtractor instead of
multiple. Also registering listeners since 1 won't be
enough anymore.

Test: set wallpaper, check scrim color
Change-Id: Ic7f08f98e0671f5b9b5d25d7f0263ad3a1443fa7
2017-05-08 15:52:58 -07:00
Jason Monk
0b80c4e518 Revert "Revert "Extend extension support""
This reverts commit e9f2d284ef.

Test: runtest systemui
Change-Id: I6d1ca9af8ee2fb4b242ccd2f9772f7d23cc35866
2017-05-01 19:35:37 -04:00
Guang Zhu
e9f2d284ef Revert "Extend extension support"
Bug: 37785708

This reverts commit 9933c1cf93.

Change-Id: Ic96e178835f5a9bbd2416f0e573975c60172388c
2017-04-28 20:34:42 +00:00
Jason Monk
9933c1cf93 Extend extension support
- Add support for ui mode type selection
 - Convert plugin fragment listener over to extensions to be more
   versatile
 - Add tests

Test: runtest systemui
Change-Id: Id5f28aa14b16e5a12df0434c9792bce551011efb
2017-04-28 11:12:02 -04:00
Jason Monk
91e587ebbc Fix leak in nav bar
Test: runtest systemui
Change-Id: Ib082ef216f1541911acbed84942ddfd5dd065a7f
Fixes: 37220220
2017-04-13 13:41:23 -04:00
Jason Monk
e107202bdc Synchronize on sysui dependency references
Test: make
Change-Id: I913505241bef231dd0b80de7f1b38ed17fa87d69
Fixes: 36779051
2017-04-06 15:14:18 -04:00
Jason Monk
8c09ac7435 Clean up and cover more QS metrics
Change-Id: I4ab5e54398024c8b16ca8223f0639aadcdef4377
Fixes: 34801532
Test: runtest systemui
2017-03-27 12:36:25 -04:00
Jason Monk
782cd6711b Create plugin interface for volume dialog
Very few logic changes, mostly just breaking out certain interfaces
and classes to the plugin lib.

Test: make + volume keys
Change-Id: Ieabc6d35f6ef980842849236a0b8ffd5543b3a2c
2017-03-24 00:40:25 +00:00
Jason Monk
6a73e63463 Fix QS/status bar BT state
The adapter state doesn't always seem to be reported correctly, so
if in doubt, calculate the adapter state based on the list of devices
we have.

Test: runtest systemui
Change-Id: I25f68665cdcb411e6976c9efc6b61612fe81302c
Fixes: 34598634
2017-03-17 11:08:30 -04:00
Jason Monk
340b0e5216 Move out test utilities to a Testables library
Test: runtest --path frameworks/base/tests/testablets/tests
        && runtest systemui

Change-Id: Ideef4aef5f26136b1741c556b9be5884f38842a0
2017-03-14 17:17:54 -04:00
Christine Franks
69c2d1d752 Add QS tile for Night Display when first used
Bug: 30994985
Test: runtest systemui, and manual - verify that the quick settings
panel does not have a Night Display quick settings tile, then turn
Night Display on and verify that the tile has appeared. Multiuser
does NOT work and is tracked separately.

Change-Id: I997b4ca7952016fc703a6bb777e500f4eccce189
2017-03-01 20:35:06 +00:00
Jason Monk
ec34da8f6f Add method for plugins to reference global dependencies
The new annotation versioning system allows plugins to share common
global interfaces that can be versioned on their own. To facilitate
this add a static method for plugins to get a hold of dependencies.
To get any dependency a plugin must @Requires it so it can be version
checked.

Test: Plugin that uses the new call.
Change-Id: I8e01260f8fbc14465502d506a7aa08212795ad9b
2017-03-01 13:26:01 -05:00
Jason Monk
1d9632df97 New system for plugin + tuner integrations called extensions
An ExtensionController provides an easy way to say I need an
object of interface X. Then a plugin or a tuner factory can
actually provide X when needed or fallback to a default implementation.

Test: runtest systemui
Change-Id: I5e1b76def3c790d7f673867648ffeb13c4d0a829
2017-02-24 12:51:51 -05:00
Jason Monk
790442e4cd Tuner updates
Some UX updates to the tuner to feel better and align with settings
UX patterns.

Test: visual
Change-Id: I9c57194b9649c61e0d6d3f9e21a51d9c4a5c1286
2017-02-15 13:35:00 -05:00
Adrian Roos
9125068a99 SysUiLeaks: Add GarbageMonitor
Adds a service for monitoring the amount of tracked garbage.
If it exceeds reasonable levels, a notification with a leak
report is posted.

Test: runtest systemui
Change-Id: Ib55281f2aac557743b97c46bc616688261c72e9c
2017-02-11 21:57:10 +01:00
Adrian Roos
09c43c8743 Dependency: Make non-class dependencies type-safe
Introduces a new DependencyKey<V> type which allows
referring to non-class dependencies in a type-safe
way. This also improves performance because we no
longer need to perform string comparisons.

Test: runtest systemui
Change-Id: Idc948855a85a1899be41e7f0170c40e73e525024
2017-02-09 21:23:04 +01:00