Commit Graph

46 Commits

Author SHA1 Message Date
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
TreeHugger Robot
5706614868 Merge "SysUiLeaks: Add LeakDetector" 2017-02-09 14:03:22 +00:00
Adrian Roos
e1e0b483be SysUiLeaks: Add LeakDetector
Bug: 34932615
Test: runtest -x $ANDROID_BUILD_TOP/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/util/leak/
Change-Id: Id4a9cbdaddc83ca3e25923eec33d53b6761c54cb
2017-02-09 10:33:02 +01:00
Jason Monk
aa573e9e86 Work on separating out the status bar management
Lots of stuff:
 - Make StatusBarIconController be a permanent dependency
 - Break out dark stuff into DarkIconDispatcher
 - Create StatusBarFragment
   - This bit is a bit ugly for now, but will be better later
 - Other stuff probably

Test: runtest systemui
Change-Id: I4973bc9f944e66af92731bf1edd2b39657f1782f
2017-02-08 19:51:41 -05:00
Jason Monk
421a9410b4 SysUI: Add method for plugins to keep status bar full screen
Lots of things detect overlays these days (installing apps) and the
only way to avoid the problems associated with this is to live in
the status bar window. So allow plugins to hold the window open
when they want to so they can have overlays be in that.

Move StatusBarWindowManager to Dependency to make things easier
as well.

Test: Install the example plugin, test can access QS and interact
      with apps

Change-Id: Ib2288bf56704960847217bad01a480ab407e0ffe
2017-02-07 18:58:14 -05:00
Jason Monk
de850bbcaa Fix leaks in sysui
Add support for testing for PluginManager and TunerService leaks
and add tests for the known leaks and fix them. Also port PluginManager
and TunerService to Dependency to make them easier to handle in
tests.

Test: runtest systemui
Change-Id: I5642539ee24dd72f802905106decd0c87b41b4eb
Fixes: 34846972
2017-02-02 10:58:18 -05:00
Jason Monk
9c7844cb91 Work on sysui dependencies
One of the many problems with PhoneStatusBar is that it holds
dependencies for many other parts of SysUI. Fix this by creating
a static method of grabbing dependencies that are global to sysui
this cleans up a lot of chains of interdependence.

Also add easy way to inject mocks of these dependencies for the
purpose of testing.

Test: runtest systemui
Change-Id: Ia0e947faea62d15b665facada47ac9916c99f895
2017-01-23 12:55:53 -05:00