38 Commits

Author SHA1 Message Date
Jason Monk
1cbf5fbd7a Switch cast over to support library dialog
Makes UI more consistent and removes the cast detail panel from QS.

Test: visual
Change-Id: I9a70b9695511c5f1e4235a838a071079506963a6
Fixes: 35407111
2017-03-30 15:23:43 -04:00
Paul Duffin
a7773c2fb1 Change dependency to standard mockito-target-minus-junit4
The mockito-updated-target-minus-junit4 target was added because
some tests needed a later version of mockito than was available
through mockito-target-minus-junit4. Since the latter has now
been upgraded to 2.7.13 that is no longer true and so users of
mockito-updated-target-minus-junit4 can be switched to use
mockito-target-minus-junit4 instead.

Bug: 32912773
Test: make checkbuild && runtest systemui
Change-Id: If7e4dd26d7d0e93731856e9739a048c89a835333
2017-03-17 13:52:15 +00:00
TreeHugger Robot
587b60282e Merge "frameworks/base: Add APCT tests to the device-tests suite." 2017-03-16 17:35:12 +00:00
Simran Basi
473a16e492 frameworks/base: Add APCT tests to the device-tests suite.
This CL adds the APCT tests within this project to
a similar suite as CTS known as device-tests.

The current method of running APCT tests in the infrastructure
is unaffected.

Bug: 35882476
Test: `make dist device-tests -j` and local builds of
      continuous_instrumentation_tests & continuous_native_tests

Change-Id: Ifa382fe691842c1cd76897775b9e2a1653449eb5
2017-03-15 14:46:27 -07: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
Colin Cross
af736c9e99 resolve merge conflicts of e86b78a57404 to master
Test: none
Change-Id: I8bf02f8198d003c4453cc59b7a3bccdff688ca15
2017-02-17 15:05:37 -08:00
Colin Cross
254a418e97 Enable multidex for SystemUITests
Test: builds
Change-Id: I82aa81405f635165716c39191082836dae8ce819
2017-02-16 17:34:45 -08:00
Jason Monk
23f85ec14d Move Keyguard to SystemUI
Test: make
Change-Id: I3abb67e2b022737d2aa0226bb07f3966ad68fff7
2017-02-10 07:45:58 -08: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
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
8aeb59ebcd 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.

Bug: 30188076
Test: make checkbuild
Change-Id: I13e88297731253420e4e5f5291d503f13a39a156
2017-01-18 16:39:34 +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
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
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
Jason Monk
fcdcf7f636 Merge "Plugins for sysui" 2016-09-19 16:54:12 +00:00
Jason Monk
86bc331889 Plugins for sysui
Why this is safe:
 - To never ever be used in production code, simply for rapid
   prototyping (multiple checks in place)
 - Guarded by signature level permission checks, so only matching
   signed code will be used
 - Any crashing plugins are auto-disabled and sysui is allowed
   to continue in peace

Now on to what it actually does.  Plugins are separate APKs that
are expected to implement interfaces provided by SystemUI.  Their
code is dynamically loaded into the SysUI process which can allow
for multiple prototypes to be created and run on a single android
build.

-------

PluginLifecycle:

plugin.onCreate(Context sysuiContext, Context pluginContext);
 --- This is always called before any other calls

pluginListener.onPluginConnected(Plugin p);
 --- This lets the plugin hook know that a plugin is now connected.

** Any other calls back and forth between sysui/plugin **

pluginListener.onPluginDisconnected(Plugin p);
 --- Lets the plugin hook know that it should stop interacting with
     this plugin and drop all references to it.

plugin.onDestroy();
 --- Finally the plugin can perform any cleanup to ensure that its not
     leaking into the SysUI process.

Any time a plugin APK is updated the plugin is destroyed and recreated
to load the new code/resources.

-------

Creating plugin hooks:

To create a plugin hook, first create an interface in
frameworks/base/packages/SystemUI/plugin that extends Plugin.
Include in it any hooks you want to be able to call into from
sysui and create callback interfaces for anything you need to
pass through into the plugin.

Then to attach to any plugins simply add a plugin listener and
onPluginConnected will get called whenever new plugins are installed,
updated, or enabled.  Like this example from SystemUIApplication:

PluginManager.getInstance(this).addPluginListener(OverlayPlugin.COMPONENT,
        new PluginListener<OverlayPlugin>() {
    @Override
    public void onPluginConnected(OverlayPlugin plugin) {
        PhoneStatusBar phoneStatusBar = getComponent(PhoneStatusBar.class);
        if (phoneStatusBar != null) {
            plugin.setup(phoneStatusBar.getStatusBarWindow(),
                    phoneStatusBar.getNavigationBarView());
        }
    }
}, OverlayPlugin.VERSION, true /* Allow multiple plugins */);

Note the VERSION included here.  Any time incompatible changes in the
interface are made, this version should be changed to ensure old plugins
aren't accidentally loaded.  Since the plugin library is provided by
SystemUI, default implementations can be added for new methods to avoid
version changes when possible.

-------

Implementing a Plugin:

See the ExamplePlugin for an example Android.mk on how to compile
a plugin.  Note that SystemUILib is not static for plugins, its classes
are provided by SystemUI.

Plugin security is based around a signature permission, so plugins must
hold the following permission in their manifest.

<uses-permission android:name="com.android.systemui.permission.PLUGIN" />

A plugin is found through a querying for services, so to let SysUI know
about it, create a service with a name that points at your implementation
of the plugin interface with the action accompanying it:

<service android:name=".TestOverlayPlugin">
    <intent-filter>
        <action android:name="com.android.systemui.action.PLUGIN_COMPONENT" />
    </intent-filter>
</service>

Change-Id: I42c573a94907ca7a2eaacbb0a44614d49b8fc26f
2016-09-02 11:33:22 -04:00
Allen Hair
fd61ccfb75 Fine tune code coverage filters for SystemUI tests. am: 8fef05f2c1 am: 2d0504edbf
am: dcb4f1aaaa

Change-Id: Ie817b5126c3d9e18385aa8ea8471fcd629bb7cfa
2016-09-01 01:39:24 +00:00
TreeHugger Robot
a946492d04 Merge "Fix systemui tests on APCT." 2016-08-31 19:14:16 +00:00
Geoffrey Pitsch
33c623677d Fix systemui tests on APCT.
Different mockito library for junit4.
This causes class loading failures for them but not our builds.

Change-Id: Iae4ba584f83e0ab78505fa822a74f5998fbca395
2016-08-31 12:47:29 -04:00
Allen Hair
8fef05f2c1 Fine tune code coverage filters for SystemUI tests.
Bug: 28269038
Change-Id: Iece993a76b39873170c4ae0b2d1cd2dd5445e3c2
2016-08-30 16:55:35 -07:00
Allen Hair
63180a0754 Configure code coverage filters. am: 02fd609460 am: 15b70213a4
am: 8b931e08d0

Change-Id: If94db4d01eb5ff4a9f463200d529b0054899bcd5
2016-08-30 17:13:01 +00: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
Allen Hair
02fd609460 Configure code coverage filters.
Bug: 28269038
Change-Id: If4dfb769d543e70faea7200dc1da15c50a83270f
2016-08-25 17:28:03 -07:00
Adam Lesinski
38e89667e3 Build SystemUI and Keyguard with AAPT2
Bug:29462255
Change-Id: I0bd6da7da21927d185ff230c81aac390cfa8029d
2016-07-07 12:23:02 -07:00
Adam Lesinski
8138058a46 Revert "Build SystemUI and Keyguard with AAPT2"
Looks like SystemUI's manifest may be corrupt.

This reverts commit 91f576081fe67f2742980f75c17d11e36f7c60e1.

Bug:29939875
Change-Id: I06e5f3cbc4629a67d254a8fcfcb9749b317aef5f
2016-07-01 19:46:55 +00:00
Adam Lesinski
91f576081f Build SystemUI and Keyguard with AAPT2
Bug:29462255
Change-Id: I9a886b4d17a7dbc4cfd7b4f8d398138f00df04a7
2016-06-29 21:38:34 -07:00
Yao Chen
634acb9712 Add CarVolumeDialogController in SystemUI for Android Auto.
Cars usually have an external audio module. When Android is serving as
the car's headunit, users should be able to adjust the car's volume
through SystemUI. The following changes are made to make it work:

+ Load VolumeDialogController from SystemUIFactory
+ Added CarSystemUIFactory
+ Added CarVolumeDialogController which extends VolumeDialogController
  and it uses CarAudioManager as source of truth for volume controls.
+ Some refactor in VolumeDialogController to make it easier for
subclasses to override volume controls.

Note that CarAudioManager does not completely replace AudioManager.
Majority of code in VolumeDialogController still applies in the car use
case, so I made CarVolumeDialogController a subclass of
VolumeDialogController instead of making them peers.

Bug: 27595951

Change-Id: Id4adec7281e41aa71f3de034e5b88a32a89be305
2016-04-19 14:50:10 -07:00
Adrian Roos
4cc2a58ed2 Fix duplicate eventlogtags warnings
Moves the protos and event log tags into a library,
so the build system doesn't think they're duplicates.

Bug: 27151225
Change-Id: Ic96b6b811d4813a4c48940081ea77b12fb23f0bc
2016-02-25 09:28:13 -08:00
Sid Soundararajan
b58c46acec Initial Commit of a Horizontal Grid View based recents UI for TV.
Change-Id: I048210e6fc91abafa41300ccb219b7bb9c84e835
2016-01-28 11:13:23 -08:00
Jason Monk
87ccd55e8a Switch Tuner to support prefs (and some improvements)
Change-Id: I2ef62c0c56d4af69f9f34e1cfd297999d59b7da6
2015-12-16 19:41:25 +00:00
Winson
c29ff0025b Adding history view.
- Initial changes to show a history view within Overview (behind tuner
  flag)
- Restoring the task view dim in the stack

Change-Id: I0503d11768736c86f3145942404391dfacd0ddd6
2015-11-25 11:42:19 -08:00
Winson
190fe3bf88 Refactoring secondary user recents logic.
- Removing old broadcasts in favor of direct aidl interface between
  system and secondary users.  Also moving user specific implementation
  into RecentsImpl, allowing Recents to handle proxying between users.

Change-Id: I4bd5ef1d1ee47309b7c754f50a5e8b2e2aab988f
2015-10-22 12:26:21 -07:00
Blazej Magnowski
7232332dc9 System to track touch and sensor events before unlocking the phone
Added a new component which tracks touch and sensor events and
also events like showing the bouncer tapping a notification and
others. The collection is enabled when the screen is turned on and
is disabled after the phone is unlocked. The data is saved in a
protobuf file in internal storage in a directory called
"good_touches". There is also an option to collect events which
end with the screen turning off. These are saved in the
"bad_touches" file. Everything is hidden behind the
ENABLE_ANALYTICS flag which is set by default to false and can be
turned on only if Build.IS_DEBUGGABLE is true. Also
behind the ENFORCE_BOUNCER flag the class shows the bouncer before
expanding a notification, showing quick settings or launching an
affordance from one of the bottom corners.

Change-Id: Iaeae0fb7a0d9c707daf7a270201fa5b1cd84c74a
2015-08-20 16:05:14 -07:00
Jason Monk
2ba4ce6a06 Create SettingsLib
This will hold common code that SystemUI and Settings (and others)
will share.

Bug: 19180466
Change-Id: I6614b31d6c3b0a2d426a2aa8ce66725245339d22
2015-02-02 11:33:17 -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
f13b4b39f2 SysUI: Add basic test coverage for signal levels
Add some tests that verify for varios wifi, and mobile signal
strengths and types that the correct icons are sent out in the
callbacks. Still in prep for MSIM refactoring.

Bug: 18222975
Change-Id: I477bf9a90e5c32fb1cba9c150ec6314f4b707108
2014-11-12 15:42:15 -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