380 Commits

Author SHA1 Message Date
Chris Wren
6f6c0cd4b8 avoid race condition on very fast tests
most of the use cases for this involve uiautomator tests,
which are slow anyway. In this case it may be possible for
the checkpoint to record the current time, and then the
test event arrive before the clock ticks over to the
next millisecond, which would cause them to be ignored.

If this fixes the flakiness we should consider a more gneeral fix.

Test: runtest --path frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarTest.java
Bug: 35138327
Change-Id: Idc4aec50df1a75be710c5a69522af058f7e68ec1
2017-02-09 09:51:50 -05: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
TreeHugger Robot
ba89ed754f Merge "Move the logic of batteryMeterDrawable to settingslib" 2017-02-08 10:14:28 +00:00
jackqdyulei
597b10f6db Move the logic of batteryMeterDrawable to settingslib
In Settings, we also need a BatteryMeterDrawable to show battery meter,
that's why I move it to settingslib.

In this cl, what I have changed is listed below:
1. Create BatteryMeterDrawableLib that contains logic of battery
drawing.
2. Still Keep the battery control logic in systemui.
3. Remove hardcoded battery color by using the color state lists.
4. Move some tests to settingslib

Bug: 34771849
Test: make SettingsLibTests

Change-Id: I39c0f0e31ca5e1b958467298db1d0590d16c9f6d
2017-02-07 17:27:00 -08:00
Jason Monk
d8df1b083d Merge "QS: Fix brightness/edit disappearing with too few tiles" 2017-02-07 18:23:54 +00:00
Jason Monk
cedcb945f7 QS: Fix brightness/edit disappearing with too few tiles
- Make sure the tile layout doesn't have negative height

Test: runtest systemui
Fixes: 34593873
Change-Id: I392aa925cde1b2147a86cda63cd9e84cd3026a90
2017-02-06 15:06:01 -08:00
Selim Cinek
e373313bd5 Merge changes If0edccf8,I086b7bae,I043011c6,I4b05f340,I309097ef, ...
* changes:
  Disabling animations now when the screen is off
  Fixed a quick flash of the icon when adding a notification
  Fixed a bug where the notification icons wouldn't match
  Fixed weirdness about last icon in shelf
  Fixed a regression where custom notification where unreadable
  Fixed a wrong translation calculation on first pull down
2017-02-06 21:59:08 +00:00
TreeHugger Robot
cd1d343ffd Merge "StatusBar: Clean up buzzBeepBlinked and friends" 2017-02-06 21:17:03 +00:00
Selim Cinek
245090f060 Fixed a regression where custom notification where unreadable
Because custom notifications don't have their background
Color reapplied, we need to ensure that the color is saved.

Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationCustomViewWrapperTest.java
Change-Id: I309097ef8abe18706479d64c6048521f941a26f5
Fixes: 34861088
2017-02-03 17:14:46 -08:00
Adrian Roos
48a18ad206 Merge "StatusBar: Catch OOM caused by third-party icons" 2017-02-04 01:00:40 +00:00
Jason Monk
e750748404 Add better method test handlers/loopers in sysui
Test: runtest systemui
Change-Id: I94014afab12d385f38a9d1d4a8595bb37cfe0688
2017-02-03 19:42:10 -05:00
Adrian Roos
fb2d0cc090 StatusBar: Catch OOM caused by third-party icons
Bug: 31825355
Test: runtest -x packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarIconViewTest.java
Change-Id: I3e2a8c3da43a572a026ea0bbe1d39234035a4801
2017-02-03 14:23:50 -08:00
Jason Monk
7d6fa83a99 Fix the tests
Window types changed, need to use a different one

Test: runtest systemui
Change-Id: Iac2641feb49e54af98ac523363d387647552eb0a
2017-02-03 15:16:21 -05:00
Selim Cinek
2a12324268 Merge "Fixed the background for low-priority legacy notifications" 2017-02-03 19:03:06 +00:00
Selim Cinek
f868efedd5 Fixed the background for low-priority legacy notifications
The background color could be calculated wrong in case we
Had a legacy notification with a dark background.

Test: install legacy custom notification with background, observe
Change-Id: Ie2a8ba4012f30719c05115f51bfddbdc8e33e551
Fixes: 34856700
2017-02-02 15:53:08 -08:00
Geoffrey Pitsch
580f32d7b0 Merge "SystemUI uses Builder API with NotificationChannel" 2017-02-02 20:25:48 +00:00
TreeHugger Robot
e70ef857fb Merge "Fix leaks in sysui" 2017-02-02 18:08:29 +00:00
Geoffrey Pitsch
1dc93bc407 SystemUI uses Builder API with NotificationChannel
Some changes to channels based on UX feedback.

Test: runtest systemui
Change-Id: I1b2f661ba145d6926035f992231dc3c2f8cbf844
2017-02-02 11:12:05 -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
Chris Wren
27a52fa86b port status bar logs to Tron V2
Bug: 33303260
Test: runtest --path frameworks/base/core/tests/coretests/src/com/android/internal/logging/legacy/ && runtest --path frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone
Change-Id: I7746b846247e930617f0b440217635e71ed58bb5
2017-02-02 07:47:16 -05:00
Adrian Roos
643e51e3a1 StatusBar: Clean up buzzBeepBlinked and friends
Test: mmm frameworks/base/packages/SystemUI
Change-Id: Idcd1fe02e825c18782880d8d12345776a3928ddf
2017-02-01 21:06:01 +00:00
Mady Mellor
ab3070fd6d Merge "Fix NotificationGuts tests" 2017-01-31 17:58:36 +00:00
Mady Mellor
0a66e0791d Fix NotificationGuts tests
- NPE’s ‘cause there was no interaction listener set in the tests, added
  this to test set up
- Failures with saving importance because closeControls no longer saves
  any changes, it just closes the controls now. Updated those tests to
  use saveImportance instead.
- Removed the test ensuring that closeControls wouldn’t save importance
  if it was passed save = false, since closeControls no longer does that.

Test: NotificationGuts tests no longer fail (runtest systemui)
Change-Id: I3251f4f379654f4cc9eb3a506b722e515c6fe971
2017-01-30 14:06:22 -08:00
Jason Monk
f58cc5768a Add separate roaming icon for status bar + QS
am: f62e889394

Change-Id: I065c6420e0ed379f44d7789e77590e5a39c2a5ec
2017-01-27 15:14:53 +00:00
TreeHugger Robot
5c7700f8b7 Merge "Create Settings Flags to Disable Scoring UI changes." 2017-01-26 22:07:17 +00:00
Jason Monk
2a6ea9c2a1 Delete BaseStatusBar
It is a relic of a more complex time, but has passed out of all
knowledge for too long.

Test: manual testing on phones and TV
Change-Id: I62a15d9413ea4bda3ac82bf6f7d22c096e2c1cdc
2017-01-26 15:17:45 -05:00
Sundeep Ghuman
e869d83ea8 Create Settings Flags to Disable Scoring UI changes.
When disabled, this will prevent badges from being shown in the status
bar or wifi picker as well as prevent access points in the picker from
being rearranged based on ranking scores.

Fix missing permission dropped from previous CL to run
NetworkControllerWifiTest and refactored tests to enable new setting.

Bug: 34712533
Test: runtest --path
frameworks/base/packages/SettingsLib/tests/integ/src/com/android/settingslib/wifi/WifiTrackerTest.java
and runtest --path
frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerWifiTest.java

Change-Id: I79c97f2205ebb70c0f7f5b1f66f7207055e5769b
2017-01-26 12:09:04 -08:00
Jason Monk
f62e889394 Add separate roaming icon for status bar + QS
Now data + roaming will be shown at the same time.

Test: runtest systemui
Bug: 31205845
Change-Id: I8fe167a0909c952ad0824e24e178857df2541554
2017-01-26 13:48:16 -05:00
Jason Monk
0f0de13c37 Add separate roaming icon for status bar + QS
Now data + roaming will be shown at the same time.

Test: runtest systemui
Bug: 31205845
Change-Id: I8fe167a0909c952ad0824e24e178857df2541554
2017-01-26 10:04:32 -05:00
Dan Sandler
8e032e15e6 Notification Channels come to SystemUI's own notifications.
There are five channels at present:
    ALERTS - low battery etc.
    SCREENSHOTS - progress & result
    SECURITY - notifications hidden due to policy
    STORAGE - disk low
    STATUS - basically everything else

The importance for each channel should match the legacy
priority of the notifications it carries.

Bug: 34250937
Test: runtest systemui
Change-Id: I5915ca453258caea63b0d9bd756893db05e8d600
2017-01-25 23:37:06 -05:00
Mady Mellor
1bfd08f233 Merge changes from topic 'nmr-plugin'
* changes:
  Add snooze to notification menu row
  Add snooze listener so that a plugin can snooze a notification
  Change NotificationGuts to contain a view
  Rename notification settings icon row / gear to notification menu row
  Create + implement plugin for NotificationSettingsIconRow
2017-01-26 00:49:13 +00:00
Mady Mellor
87d7945f06 Change NotificationGuts to contain a view
NotificationGuts is now given a view to display, the notification
management controls have been moved into their own view.

NotificationGuts is provided a view to show via a MenuItem.

This allows configuration via the NotificationMenuRowProvider Plugin.

Test: manual
Change-Id: I68cb23ea2cada30cc6e930fa8c03e0aa4014dfe2
2017-01-25 12:34:11 -08:00
Jason Monk
d5e96800d2 Merge "Fix up the tests (yet again)" 2017-01-25 19:55:37 +00:00
Sundeep Ghuman
d57f324776 Update Status Bar with Badged Wifi Icons.
This change inserts badged wifi icons into the status bar to indicate
historical network strength. The existing callback handler was modified
to explicitly pass the drawable as currently the icon is a rendered from
two separate resources, composited together in a LayeredDrawable.

Badging is controlled by Settings.Global.NETWORK_RECOMMENDATIONS_ENABLED
and can be enabled from the Wifi Settings page.

Bug: 34056846
Test: runtest --path
frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerWifiTest.java
Change-Id: I33b736d4543e380887513cbb5937f49945794c09
2017-01-24 15:18:32 -08:00
Jason Monk
685db72eb7 Fix up the tests (yet again)
Turns out there was an actual bug in QSFooter where it was using
the wrong handler class (and not showing any of its security features),
and it would have been caught by presubmit if it was working...

Test: runtest systemui
Change-Id: Icbb19db1cc6f3f2a5f984618428ceb2899af69ab
2017-01-24 12:34:23 -05:00
Julia Reynolds
924eed1ca6 Add updatable fields to Ranking
- NotificationChannel
- Badging

Test: runtest systemuinotification & cts

Change-Id: I7fd1f2dc06148927e9a4bd5b760d436e2c5e8a98
2017-01-24 08:43:38 -05:00
TreeHugger Robot
70a1a72eff Merge "PhoneStatusBar: Add test for executeRunnableDismissingKeyguard with null runnable" 2017-01-23 23:27:59 +00:00
Adrian Roos
ef7a402268 PhoneStatusBar: Add test for executeRunnableDismissingKeyguard with null runnable
Adds a regression test for NPEs around executeRunnableDismissingKeyguard when
a null runnable is passed.

The bug was fixed in I89477a8a0067e285e5d0122e918fac45274c57ad.

Fixes: 33489225
Test: runtest systemui
Change-Id: Ia8981bc4c2a1a0f6d8c48e6d66e2af801d6cddac
2017-01-23 13:43:59 -08:00
Jason Monk
20ff3f9255 SysUI fragments: Integrate new support for constructing
Use a new system for constructing fragments so they can be swapped
out in place maintaining state. This will allow easier integration
with plugin lifecycle as parents who have child plugin fragments
can depend on the class existing and won't have to listen to
the lifecycle.

Test: runtest systemui
Change-Id: I517f4ce3d114abd49b1b5baca388d19e929b8f90
2017-01-23 16:28:03 -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
TreeHugger Robot
b6ea3988a0 Merge "Fix up the tests." 2017-01-19 21:52:36 +00:00
Jason Monk
a075479746 Merge "Fix crash from AssistManager" 2017-01-19 20:39:16 +00:00
Jason Monk
21380738ea Fix up the tests.
They got broken because the pre-submits were broken :(

Test: runtest systemui
Change-Id: I45d5b2d3e8614cd1d3fa7eb24da57c26588120ff
2017-01-19 15:13:31 -05:00
Jason Monk
865246dc9a Fix crash from AssistManager
It expects to have onConfiguration called at least once, so
make sure it has.

Test: runtest systemui
Bug: 34377261
Change-Id: Iba980b020ef2c175c7ffebedf946edb282be464c
2017-01-19 14:47:45 -05:00
Paul Duffin
43267b4b9e Merge "Prepare for removal of legacy-test from default targets" am: c74ccf1588 am: ab62fd67d8
am: 56a2ae1056

Change-Id: I0ede6895eb25f72a74af3ac4431a21960500bec5
2017-01-19 11:49:28 +00:00
Paul Duffin
ccb0445027 Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

(cherry picked from 6387604f9e672ece85e07c4bcbd7be396867f06f)

Bug: 30188076
Test: make checkbuild
Merged-In: I13e88297731253420e4e5f5291d503f13a39a156
Change-Id: I58446eb8c45d8ac2bcdbc9fa40d1321e811bdd4b
2017-01-19 09:43:05 +00:00
Paul Duffin
648abd31e8 Merge "Prepare for removal of legacy-test from default targets" 2017-01-19 09:34:19 +00:00
Adrian Roos
e18033cbb9 Notifications: Clear animation start visible type when not animating
Fixes an issue where the animation start visible type could
be stale if the animation was cancelled.

Bug: 30876804
Test: runtest systemui
Change-Id: I8e6ac6ba0bcd785f980b22529d83ba86da744f00
2017-01-18 13:21:02 -08:00