Commit Graph

40 Commits

Author SHA1 Message Date
Sunny Goyal
eb18d3986f Separating packageName from the AndroidManifest
Test: Verified everything builds
Change-Id: Icd425e004d8420b8c7a5d221ef98ffbc22723f04
2020-02-20 03:07:52 +00:00
Automerger Merge Worker
2a7b367d06 Merge "Replace CONNECTIVITY_INTERNAL in SystemUI" am: 3950a24dca am: 8d82c3cbd9 am: 8e92458626
Change-Id: Id94e38dafad3dd6a5316c53ba357a8004a7d7b9e
2020-01-16 07:58:53 +00:00
paulhu
ceb5a89284 Replace CONNECTIVITY_INTERNAL in SystemUI
Since CONNECTIVITY_INTERNAL has been deprecated from Android R
and replace by other permissions. Change CONNECTIVITY_INTERNAL to
another proper peremission.

Bug: 32963470
Test: atest SystemUITests
Change-Id: Ibdaee8c3c06caa3aaf6944d4b258cb5b1d078179
2019-12-10 15:56:18 +08:00
Colin Cross
86952a4819 Set android:largeheap="true" SystemUITests
SystemUITests seems to have multiple leaks, causing it to OOM.  Give
it a larger heap to fix presubmit.

Bug: 135715570
Test: atest SystemUITests
Change-Id: I45598fa2d6239dbcbd2a9f68237849ca0d0a0efe
2019-06-21 23:25:38 -07:00
Mark Renouf
a9fbb6ed90 Adds a valid Activity target for Bubble metadata
Test: atest BubbleControllerTest
Bug: 123631037
Change-Id: Ied0e686febd2d1a7478e84faade958e187db0ef7
2019-02-14 14:10:06 -05:00
Lucas Dupin
7c6ca76793 Allow protected broadcasts in tests
SysUI must send protected broadcasts to avoid system impersonation.
Our tests should also allow these types of broadcasts, otherwise
they will be dropped/skipped on -user builds and functionality
will be broken.

This CL also protects the flashlight broadcast.

Fixes: 110825884
Test: atest com.android.systemui.qs.external.TileServicesTest
Change-Id: I5a3dfc569c1695366e5f0e48cda8a7a32e287e7d
2018-09-14 17:18:54 +00:00
Jason Monk
ae7ced2f95 First kotlin
Convert one class to kotlin and provide a slight amount of guidance.

Test: existing tests
Change-Id: Ie8659765b674ac7b2d82ed3d343f387195c07d83
2018-08-23 12:49:08 -04:00
Jason Monk
a2f2d82f26 Convert sysui to bp
Test: tests gonna test, builds gonna build
Change-Id: I7f1ef2e82ce2c74253c57de8d73079dcfe2d2264
2018-08-16 19:40:39 -04:00
Alison Cichowlas
5f5ad2e627 Add process-lifecycle-owner-initializer to tests.
Bug: 112587252
Test: This is to fix the tests.
Change-Id: I083db4e2eb4efd8d4a914f33ac259aa317e568de
2018-08-14 14:23:49 -04:00
Winson Chung
6b0f1a3d77 Expose DockedStackListener for logging purposes in Launcher
Bug: 111077107
Test: Implement listener in Launcher and verify the callbacks are made

Change-Id: I4017c8e139242c2b0875f8222c99396d55b1be04
Signed-off-by: Winson Chung <winsonc@google.com>
2018-08-03 15:19:36 -07:00
Jason Monk
0b5e52ccd8 Add way to use sysui as a broadcast relay for slices
Test: runtest systemui
Bug: 78139069
Change-Id: I64c4d56cca005cec7204bf45215bb7b0015f4571
2018-04-20 12:36:31 +00:00
Jason Monk
1fc931a38a Switch to inline mockito for a bunch of tests
So we can mock final stuff

Test: The tests
Change-Id: Ia3a47c6655c4b0b9af0aea0ee6f8f6cb9ebaab09
2018-02-18 13:02:25 -05:00
Rohan Shah
e4071127a6 [QS] Add secondary label to Hotspot tile
Added info to callback and leveraged WifiManager API to get the number
of connected devices. There's some minor state cleanup done and the
fire callback mechanism was slightly updated.

The secondary label is updated based on the connected devices & enabled
state.

Screenshot: https://screenshot.googleplex.com/jHMKmg2nO08

Test: manual
Bug:68058038
Change-Id: Iafcebd3476d2c13e25939b45e78f32a5bd24cb68
2018-01-23 15:49:45 -08:00
Julia Reynolds
5daa47270b Update output chooser for calls
- Hide media routes while in call
- Change the title while in call
- Add a title while not in call, too

Bug: 63096355
Test: manual
Change-Id: Ib7bcd314efb010fe903327dd4d9bdbfe521c1f73
2018-01-20 15:29:41 +00:00
Winson Chung
16e185e60b Restore legacy recents package check to unblock quickstep development
- We added a recents component to allow the development of the recents
  activity without exposing more privileged permissions, however, SysUI
  needs to point to the old activity until the new one is ready (it
  already has the existing priveleged permissions).  For the time being,
  restore the original check for the recents package (to be removed
  immediately after we switch SysUI to launch the quickstep overview),
  so that we can both enable the recents component overlay (for
  development) without the existing recents activity going being given
  the wrong activity type (for now both the legacy and new recents
  component will have ACTIVITY_TYPE_RECENTS).
- Add a sysui test to ensure that the current recents activity also has
  the right activity type

Bug: 68774229
Test: com.android.server.am.RecentTasksTest#testRecentsComponentActivityType
Test: com.android.systemui.recents.RecentsTest#testRecentsActivityType

Change-Id: I4bb59efa3507d61ac86c75d3b9c80f2e32d2f7b9
2017-11-07 17:50:29 -08:00
Jason Monk
9c4faa85f1 Fix race condition crash
1 line fix
Lots of lines for test

Test: runtest systemui
Change-Id: I90b006b5d9c02025ecc600c2f10014a96cbf33f8
Fixes: 62573587
2017-08-15 09:32:27 -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
Lucas Dupin
e17ce5286f Fix jank when switching themes
Turning overlays on and off takes time,
it also doesn't allow us to have fine control
over which view is using which theme.
Lock screen colors are now driven by themes.

Change-Id: Ie8860d00dbb0705ed76edf60a9d3030618dd21ca
Fixes: 63751714
Test: Visual. Set wallpapers, unlock.
Test: runtest -x packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerTest.java
Test: runtest -x tests/Internal/src/com/android/internal/colorextraction/ColorExtractorTest.java
Test: systrace
2017-07-24 13:26:22 -07:00
Jason Monk
b05395f53c Try to work on test flakyness.
- Add bt permission
 - mock more BT stuff
 - Disable test that is causing crash on main thread

Test: runtest systemui
Change-Id: I5cddb71941cce4f9b595c65ef69919186addb6df
Fixes: 63568935
2017-07-11 10:05:03 -04:00
Jason Monk
c429f690e5 Add system to avoid a crash stopping tests from running
Add a system such that when a crash happens on the main thread, it is
delayed until the tests complete, then thrown.

Also mark some old flaky tests as not flaky as they should be good
now.

Test: runtest systemui
Change-Id: Ic18a38daf4a93dab63549d834fa00f295644fbf1
Fixes: 62935720, 62251903, 62529569
2017-06-27 14:48:45 -04:00
Jason Monk
b46a3c9634 Fix ConcurrentModificationException from LocationController
Test: runtest systemui
Change-Id: I0b7db7344217b3b7ad91f315100d1873e8167baf
Fixes: 62859544
2017-06-22 09:32:07 -04:00
Adrian Roos
c1b50324a2 AOD: Add wakelock for charging text while dozing
Also refactors the WakeLocks in SystemUI.

Bug: 30876804
Bug: 35850304
Test: runtest systemui
Change-Id: Ie17eedfd266deb3aa46dabd701bc784330b2e030
2017-03-09 14:31:24 -08: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
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
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
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
TreeHugger Robot
b6ea3988a0 Merge "Fix up the tests." 2017-01-19 21:52:36 +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
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
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
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
Geoffrey Pitsch
2c403db659 Convert SysUI tests to use JUnit4
Run tests with android.support.test.runner.AndroidJUnitRunner,
modification to runtest target in separate CL.

No longer inherit from TestCase, stripped unneeded code from
SysuiTestCase, which now assigns mContext via
InstrumentationRegistry.getTargetContext().

Can no longer create Handlers with default constructor,
Looper.myLooper() was never able to receive messages in tests
and it is now enforced that you pass the Looper.getMainLooper().

Change-Id: I13f499175a459cef1a554431911f4b21126e126e
2016-08-26 10:43:08 -04:00
Jason Monk
0c6e099482 Fix tests and tag them for continuous testage
Change-Id: I25d7d34ff8c12308755be6567aae1db009b59a4d
2016-03-29 15:49:02 -04:00
Jason Monk
f6a3cf9291 Add tests for TouchAnimator
Also fix existing tests

Bug: 27392084
Change-Id: I70299512e8fa3e0cb86c868b47df7703e04d6084
2016-02-29 13:01:08 -05:00
Jason Monk
d5a204f16e Better service management for QS 3rd party tiles
Better wrapper around the service that will handle rebinding
when it dies, binding when it becomes available, and forwarding
along all messages to the service once it binds.

Also better handling of too many services at a time.  Will only
ever bind to at most 3 tiles and will manage which ones are most
important to show based on pending clicks, last update, etc.

Change-Id: I5f4da0bc751f7eb25baa32e5c0bb9f1bc418f5bb
2016-01-04 14:46:11 -05:00
Jason Monk
c014decc74 Don't unregister MobileSignalControllers still used
Also add some more testing for this section of code that manages
when MobileSignalControllers are added/removed to make sure we
are all good.

Bug: 18728593
Change-Id: I9902854c54d2e1deb58b38b7bd97dac1617831c0
2015-01-05 15:53:00 -05:00
Jason Monk
29f7a7b0ae SysUI Tests: Make tests not break SysUI
Now you can run the tests without getting the blank broken sysui.
The tests instrument themselves so they include all of the source
they need to run rather than piggybacking on the sysui process.

A couple of changes were needed for this.  The xml files cannot
reference com.android.systemui, instead they must use res-auto.
The tests can no longer make privileged calls, so some restructuring
to avoid those calls was needed.

Bug: 18222975
Change-Id: I67b794af854f1420583d48960bd6e52ca753b56d
2014-11-17 14:46:11 -05:00
Jason Monk
e0cdb6079e Prepare for testing the NetworkControllerImpl
This will allow us to add some test cases to verify that under
certain phone/signal conditions we get out the icons we expect.
This will let us break less things when refactoring for MSIM.

Bug: 18222975
Change-Id: I7bd3e66e7de6b30fede72e40fb6aa37dd523336c
2014-11-07 20:08:47 +00:00
Brett Chabot
caf30a18b5 Add functional test for screenshots.
Change-Id: Ice2cbc656f9814da7d0634644a250c1af9243ad1
2011-07-28 19:52:49 -07:00