Commit Graph

169 Commits

Author SHA1 Message Date
Geoffrey Pitsch
4e7ae02ce0 Do not select an importance for unspecified notifications
Test: runtest systemui-notification
Bug: 34164846
Change-Id: I4988ce26264853fd9ab84ae02e995641edf933cd
2017-01-11 12:48:09 -05:00
Jason Monk
b5b0920170 Allow CommandQueue to have multiple callbacks
Allow for multiple callbacks to be added to CommandQueue.
This will allow PhoneStatusBar to be broken up into pieces
that make more sense.

Test: runtest systemui
Change-Id: I73a7da1c23c8e45a291e5957e7341f3930abc334
2017-01-09 12:51:56 -05:00
Chris Wren
5e6c0ffd3e Create a global registry for system message IDs
Port all system UI notifications to use the registry.  Retain stable
integer IDs where they exist. Assign new stable IDs where resource IDs
were previously used.

Using "message" rather than "notification" since we may eventually
want to include dialogs and toasts.

Bug: 32584866
Bug: 30995038
Test: runtest systemui
Change-Id: Iec4d7cebbd88683e339ada29a279315222699942
2017-01-06 09:22:02 -05:00
Jason Monk
26bc8996c8 Add notifications for incorrect plugin versions
Test: runtest systemui
Change-Id: Ic59a583202a8a20fbfc6fb504e6ab60ecc71ce78
2017-01-04 15:57:30 -05:00
Andrew Sapperstein
9625b4fce1 Merge changes from topics 'thermal-notif-2', 'thermal-notif'
* changes:
  Add VR mode check for thermal notification
  Show notif when device reaches throttling temp
2017-01-04 19:18:24 +00:00
Lei Yu
c71f5b34ce Merge "Add TileColorPicker to remove hardcoded tile state color" 2017-01-03 22:15:11 +00:00
jackqdyulei
76471a5d9e Add TileColorPicker to remove hardcoded tile state color
1. Remove hardcoded color qs_tile_tint_* in colors.xml
2. Add tint_color_selector.xml which uses colorForeground and alpha
to tint.
3. Use TileColorPicker to grab tile state colors from
tint_color_selector.xml and provide them to customTile and BatteryTile

Bug: 32592245
Test: make -j40 SystemUITests
Change-Id: Ie5fc828c3c6d4e1f192643592c034f462fae5313
2017-01-03 11:21:59 -08:00
Geoffrey Pitsch
4dd5006ff5 Change Notification Inline Settings for Channels
Removes slider advanced settings.
Move more Guts internals out of BaseStatusBar.

Test: runtest systemui
Change-Id: I0cf7f144859d1248bd54e281cfe0b35a817376a6
2016-12-28 10:13:02 -05:00
Selim Cinek
45e63815e7 Merge changes Ic88e8094,I4253bf4b,Iba4ebd3c,I943b6352,If88c0b08, ...
* changes:
  Made it easier to use updatable Animators
  Improved the interpolators of the icon appearing
  Modified the way icons merge into the shelf
  Fixed a potential heads up crash
  Fixed a bug where the notifications would close on back
  Bye bye veto button
  Only requiring 2 taps for accessibility on lock screen
  Fixed a bug where systemui could crash
  Introduced the visual stability manager
  Removing notifications always immediately when swiping them away
2016-12-21 12:23:05 +00:00
Selim Cinek
f082fe2319 Made it easier to use updatable Animators
The existing system is extended such that AnimationProperties
can be easier animated and running animations updated.

As a first sample this animates the scale of the
icons in the shelf.

Change-Id: Ic88e8094d53f37ab13f5e9e00796b63d229a5114
Test: runtest systemui
Bug: 32437839
2016-12-21 12:12:31 +01:00
Andrew Sapperstein
b7caf1d06d Show notif when device reaches throttling temp
Adds logic to SystemUI that shows a notification alerting the user
that their phone has reached a certain temperature and has throttled
itself in order to cool down.

The logic is controlled by a configuration resource:
R.bool.config_showTemperatureWarning. If false, no action is taken.

When true, PowerUI checks every 30 seconds if the current temp of
HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN is greater than
the throttling temp of HardwarePropertiesManager.DEVICE_TEMPERATURE_SKIN.
If any one of the temperatures returned is greater, a notification is shown.

Clicking on the notification will show a dialog explaining more details
about what the device is doing in response to the high temperature.

The notification will disappear once the temperature drops below
the throttling temperature.

In order to check the temperature in SystemUI, HardwarePropertiesManager
has been updated to also allow any calls made by callers holding the
signature-level DEVICE_POWER permission.

Test: runtest systemui
Bug: 30995038

Change-Id: I1b3f122341911c68e90c8a49ad35267ac382b356
2016-12-20 18:19:03 -08:00
Selim Cinek
a7d4f82c05 Introduced the visual stability manager
Notifications used to roam around and reorder whenever
they wished. Those little beasts must be tamed, hence
a new visual stability manager is introduced that
dictates the terms of their interplay.

Test: manual: add heads-up and see if they correctly appear
Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/notification/VisualStabilityManagerTest.java
Bug: 32442500
Change-Id: I8d7596fa7c14e0df68459a77d445f618d517ad51
2016-12-20 13:19:36 +01:00
Jason Monk
3cfedd78b1 Speed up sysui tests
Shave a few seconds off the tests by adding capabilities to
TestableContext and removing mocks from some large classes
(like Context and PhoneStatusBar)

Test: runtest systemui
Change-Id: Ib9c30cf895bd9f24a5a26e24ffe2498ca6fe2f6e
2016-12-19 16:06:38 -05:00
phweiss
9e450e1233 Rework Device Monitoring Dialog in Quicksettings
If a device owner is active, the layout is changed from a
standard AlertDialog with only one string to a custom dialog
that includes information on Device Owners, and VPN and Network Logging,
if enabled.

BUG: 29748723
BUG: 33126622
Test: Manual, CTS-Verifier tests will be added later

Change-Id: I2bfca9d9d02a42d9c3b17683625eda29e9369666
2016-12-19 17:53:00 +01:00
Manu Cornet
cfcbf118b2 Merge "Delete the separate grid recents activity and related code" 2016-12-17 02:23:25 +00:00
Manu Cornet
8e17342610 Delete the separate grid recents activity and related code
Bug: 32101881
Test: Made sure everything builds & boots on sw600dp device and checked recents
Change-Id: I1236a1ec5f5d2f485d9825c39702130bbfc243ca
2016-12-16 16:31:19 -08:00
Adrian Roos
a1b19a2c39 Merge "Doze: Fix crash when suppressing pulse" 2016-12-17 00:07:02 +00:00
Adrian Roos
cd139a6df1 Doze: Fix crash when suppressing pulse
Fixes a crash due to an overzealous state validation.

Change-Id: I363c13206c890a2be56615663f89d80ac256a991
Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/doze/DozeMachineTest.java
Fixes: 33463320
2016-12-16 12:56:07 -08:00
Jason Monk
b1ca4f84e4 Merge "Turn on dexmaker sharing classloaders for sysui tests" 2016-12-16 20:34:26 +00:00
Jason Monk
556cfb6a36 Turn on dexmaker sharing classloaders for sysui tests
This will allow us to mock package private things. It also happens
to speed up the tests, a lot.

Test: runtest systemui
Change-Id: I48f39ee282a4ea3163c642c8290f302428c4a5f4
2016-12-16 14:01:25 -05:00
Jason Monk
1a80b03595 Merge "Switch sysui to updated mockito target" 2016-12-15 20:15:49 +00:00
phweiss
9d945d90a4 Add implementation of isNetworkLoggingEnabled to FakeSecurityController
Fix build breakage introduced by ag/1666505.

Test: Did a local build.

Change-Id: Ie3c2d8cc89f71583b546a6085c3f991e0affaa61
2016-12-09 17:49:31 +01:00
Philipp Weiß
9498f5a81b Merge "Add network logging icon to Quicksettings when enabled" 2016-12-09 16:31:41 +00:00
Jason Monk
26ad85a646 Switch sysui to updated mockito target
Some updates required for tests to pass. Also did a little cleanup
of bad verify matching.

Test: runtest systemui
Change-Id: I75b9f34ab7e9af111dafd5a648840893e1cee434
2016-12-08 15:32:13 -05:00
Jason Monk
89377bb609 Fix sysui crashlooping
Fix startup lifecycle on header.

Test: runtest systemui
Change-Id: I732cc2fb6693b9857c14534154d02a9b18e7d44a
2016-12-08 15:32:07 -05:00
Jason Monk
9abca5e9f8 Cleanup and refactoring of test utilities
- Make leak checking faster by converting to fakes
    - Requires making clean interfaces for all CallbackControllers
 - Integrate leak checking into the TestableContext

Test: runtest systemui
Change-Id: Ic57a06360d01a0323ef26735a543e9d1805459e2
2016-12-08 11:41:59 -05:00
phweiss
a4e169ed68 Add network logging icon to Quicksettings when enabled
Add the network logging icon in Quick Settings' footer if
network logging is enabled, possible next to the VPN icon.
Quicksettings has to be able to tell that network logging
is enabled, so this CL changes DPM.isNetworkLoggingEnabled() to be
callable from the device owner or from any app with the MANAGE_USERS
permission.

The icon is only a placeholder until the official icon is finished.

CTS Verifier tests will be added when all Network logging UX changes are
done.

BUG: 33126618
BUG: 29748723
Test: runtest --path frameworks/base/packages/SystemUI/tests
Change-Id: Ib35d323605ab11f883a4b6199d1db79b9e53c49b
2016-12-08 16:34:25 +01:00
Bartosz Fabianowski
b272e91202 Merge "Link from Quick Settings to Enterprise Privacy page" 2016-12-06 15:09:31 +00:00
Bartosz Fabianowski
46bea2e685 Link from Quick Settings to Enterprise Privacy page
This CL updates the information shown in Quick Settings when a device
is managed by a Device Owner and adds a "learn more" link that takes
the user to the Enterprise Privacy page in Settings.

Bug: 32692748
Bug: 25779452
Test: runtest --path frameworks/base/packages/SystemUI/tests &
      runtest --path frameworks/base/core/tests/coretests

Change-Id: I8cbb6f2bb5c6da29ae581b6dcf7a01b1a4f2af2b
2016-12-06 08:13:30 +01:00
Adrian Roos
b84dc1866a DozeMachine: Improve resilience against out-of-order pulse requests
Fixes a class of bugs that arise from requesting to pulse at
inopportune times. Also improves logging such that we know what
state transition failed to validate.

Test: runtest -x frameworks/base/packages/SystemUI/tests/src/com/android/systemui/doze/DozeMachineTest.java
Change-Id: If0bbe003c4805fd180d013dadbc28addc5bb0dd4
Fixes: 32869355
2016-12-05 22:09:25 +00:00
Bartosz Fabianowski
5f045007e0 Add enterprise disclosure to Keyguard screen
With this CL, a disclosure text is shown on the Keyguard screen when
a Device Owner is managing the device.

Bug: 32692748
Test: runtest --path frameworks/base/packages/SystemUI/tests

Change-Id: I7a48df7dc010c39b2db94fcd26b75313a7ceee08
2016-12-01 10:36:18 +01:00
TreeHugger Robot
d25cf04e98 Merge "Add explicit method to dismiss Keyguard" 2016-11-29 14:30:46 +00:00
Manu Cornet
e138bd1955 Change the task layout to better match mocks, add "in" animation
This only adds an animation when transitioning into recents. "Out"
animations will come later as they need to be run in parallel with
launching the activity not to introduce any latency.

Test: Open recents on sw600dp device, check recents layout/animations
Bug: 32101881
Change-Id: I367f8e5c106cd06d2a7833c165ecb960a7821ed9
2016-11-23 14:48:30 -08:00
Jorim Jaggi
241ae10b21 Add explicit method to dismiss Keyguard
The flag is a bit clunky for most cases, and a method is more
clear.

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
android.server.cts.KeyguardTests

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test
android.server.cts.KeyguardLockedTests

Test: runtest systemui -c
com.android.systemui.keyguard.DismissCallbackRegistryTest

Bug: 30961403
Bug: 27422134
Change-Id: I39de90c7cfecd99350a74f72cd76418e337f2b79
2016-11-23 16:27:35 +01:00
TreeHugger Robot
8068bfeae2 Merge "Doze: Fix WakeLock bug" 2016-11-17 20:57:33 +00:00
Adrian Roos
ae0c5e8d2c Doze: Fix WakeLock bug
Change-Id: I3d687bbf82173723c420058867531a970d1f46cb
Fixes: 32857549
Test: runtest -x $(gettop)/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/doze/DozeMachineTest.java
2016-11-16 20:15:09 -08:00
Jason Monk
3713151425 Merge changes I52007c69,I6503947e,Icf677f4a,I2ae7ed61
* changes:
  Unit testing for fragments.
  Plugin fragment support
  Move QS to a fragment
  Fragments in SysUI!
2016-11-11 16:38:57 +00:00
Jason Monk
8852905b0b Unit testing for fragments.
Set up a base class for testing fragments that will generate the host
and run the fragment through some lifecycle checks to make sure it
does ok with standard lifecycle.

Fragment tests will also automatically check for any sort of leaks
related to bindings, receivers, or other callbacks in sysui. This
requires changing the statusbar.policy classes with callbacks to
have a common interface.

Lastly also fixes a few lifecycle bugs in QS found from the above
tests.

Bug: 32609190
Test: runtest systemui
Change-Id: I52007c696c2fd41914bba4ba9d8055f2b564a7d8
2016-11-11 11:20:10 -05:00
Jason Monk
e97892844a android.provider.Setting test utilities
Add a way to fake values for settings in tests. Since the content
provider is cached in the NameValueCache, there is one static
FakeSettingsProvider that passes through all values to the
real SettingsProvider by default. Values that are required for
the test can be acquired and locked for the duration of the test
easily.

Test: runtest systemui
Change-Id: Ibc31ac8509fb31a22c522358a9c1bae6ec63553b
2016-11-11 09:52:17 -05:00
Manu Cornet
c6f261b750 Merge "2-dimensional Recents activity." 2016-11-08 02:24:42 +00:00
Adrian Roos
ff2c4563cd Doze: Refactor v1
Pulls appart UI, state, power, display and trigger management
into individual components controlled by a state machine.

Also adds tests.

Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/doze/DozeMachineTest.java
Change-Id: I6ee7e79d58a5a3ebeb975775af44ad1e5aaccf93
2016-11-07 14:14:30 -08:00
Manu Cornet
1afcea499d 2-dimensional Recents activity.
This is a simple first version in the spirit of small, incremental CLs.
It is fully functional but the following will come in later changes:

* Split screen support
* Potential animations
* Alt-tab behavior
* Relayout on orientation changes

The new activity is only started when a specific system property is set.

Test: Locally on Ryu device. Added tests for layout logic.
Bug: 32101881
Change-Id: I550f6e7ea0de3937dbf80e5f0294676cfe567d47
2016-11-07 10:01:36 -08:00
Jason Monk
4f70b9cfd4 Faster plugin updating from UI control
Send a broadcast back and forth to speed up the rate at which plugins
are enabled or disabled.

Also update make files to handle exclude tests better.

Test: Manual
Change-Id: Ic8f45c663c3a5e5fd4b3e9e2f79480e155845c14
2016-10-28 10:13:56 -04:00
Adrian Roos
154b9ee638 Fix broken KeyguardMessageArea
Fixes a bug where the keyguard message area would reorder clears
after a new message was set, leading to the bouncer prompt reason
not showing.

Change-Id: I33001300d9175c521809cd4fdae5158269245c00
Fixes: 32306174
Test: runtest -x $T/frameworks/base/packages/SystemUI/tests/src/com/android/keyguard/KeyguardMessageAreaTest.java
2016-10-21 16:48:55 +00:00
Jorim Jaggi
d05651790a Add latency tracking for checking PIN (1/2)
Also move tags to Keyguard as we need it in Keyguard.

Change-Id: I718581cb4081830da1c3a2f4ad9b9f0ec6f09ae5
2016-10-07 16:18:00 +02:00
TreeHugger Robot
dfa1c6c8ff Merge "SysUI Plugin ClassLoader work" 2016-10-05 03:54:26 +00:00
Geoffrey Pitsch
959ee2278c Add tests for BatteryMeterDrawable
Not meant to be an attempt at full coverage, just an example of
testing a Drawable.
To go farther with this, I would wrap the "logic" of the battery
appearance in a separate class for testing and this class would
reduce to the drawing operations, which are strongly coupled to
design and don't need much testing.

Test: runtest systemui
Change-Id: I5630e25face9a3ab5e30935fb3d7bab8f162d107
2016-10-03 09:37:06 -04:00
Jason Monk
e96fa00e19 SysUI Plugin ClassLoader work
Cache ClassLoader by pkg so that Plugins can talk to each other.

Also add some filtering so that only classes from the plugins package
and sub-packages are included in plugin classloaders.

Test: Manual
Change-Id: I42aabb418168d5a5d0581b8133aa93f07cb7e977
2016-09-30 11:34:25 -04:00
TreeHugger Robot
0ed60b76e1 Merge "Add simple test for StatusBarIconList. Test: runtest --path frameworks/base/packages/SystemUI/tests" 2016-09-29 21:10:24 +00:00
Alison Cichowlas
87d5010dd3 Add simple test for StatusBarIconList.
Test: runtest --path frameworks/base/packages/SystemUI/tests

Change-Id: Ic65195624b42504d4f4b366f1c5386ee9b48a07f
2016-09-29 15:07:37 -04:00