Commit Graph

119 Commits

Author SHA1 Message Date
Chandru S
997a17f0df Merge "Log UiEvents whenever FaceAuth is triggered." 2022-09-07 15:34:50 +00:00
TreeHugger Robot
01a7eb3c87 Merge "Update SystemUI R8 documentation" into tm-qpr-dev am: 5c2403298f am: 09ef09f8a1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19539265

Change-Id: I8bd8cbc8f58f64472dc3f81d5c00e19e32147499
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 22:52:51 +00:00
TreeHugger Robot
09ef09f8a1 Merge "Update SystemUI R8 documentation" into tm-qpr-dev am: 5c2403298f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19539265

Change-Id: I2b614aec2612ee11233b69ea66d18efce666236e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-06 21:56:26 +00:00
TreeHugger Robot
5c2403298f Merge "Update SystemUI R8 documentation" into tm-qpr-dev 2022-09-06 21:27:52 +00:00
Chandru
5a5e533fde Log UiEvents whenever FaceAuth is triggered.
Test: atest KeyguardUpdateMonitor passes
Test: $ANDROID_HOST_OUT/bin/statsd_testdrive -terse 90  shows the
Test: atest FaceAuthReaonTest passes
triggered face auth UI events.
Bug: 238809124

Change-Id: I6cb04f7cccdaf92e77b8e5691bf5ac458928ff86
2022-09-06 19:26:00 +00:00
Chandru S
03575ded69 Revert "Log UiEvents whenever FaceAuth is triggered."
This reverts commit 81fe7f64d7.

Reason for revert: Broke the build on master while still having presubmit-verified +1 :( 

Change-Id: I2cf6a05b7187552d9df43fe96cda458b1fdd7631
2022-09-06 18:34:33 +00:00
Chandru
81fe7f64d7 Log UiEvents whenever FaceAuth is triggered.
Test: atest KeyguardUpdateMonitor passes
Test: $ANDROID_HOST_OUT/bin/statsd_testdrive -terse 90  shows the
Test: atest FaceAuthReaonTest passes
triggered face auth UI events.
Bug: 238809124

Change-Id: I0ed5151760ba7706bb5c937e4828e5d303b475b8
2022-09-05 09:39:25 +00:00
Jordan Demeulenaere
5dcaa51b7d Implementation of the FooterActions following the MAD (1/3) am: 6fb22d4b16 am: f8aaf7ab5f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19678215

Change-Id: I951b320e422e9171ae638bb0a93daa6009db5003
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 16:27:29 +00:00
Jordan Demeulenaere
f8aaf7ab5f Implementation of the FooterActions following the MAD (1/3) am: 6fb22d4b16
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19678215

Change-Id: I71cb9668445f277fadc69294e60bf2ff63a46cca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-26 07:09:54 +00:00
Jordan Demeulenaere
6fb22d4b16 Implementation of the FooterActions following the MAD (1/3)
This CL provides most of the implementation of the QS FooterActions
following the modern Android architecture. In particular, this CL
includes:
 - repositories in the data layer.
 - an interactor in the domain layer.
 - a view model in the ui layer.

The ViewBinder is added in ag/19674347, given that it comes together
with changes to the existing XML files.

Note that after this CL, the new implementation will still not be used
as it won't be wired yet. This is done in ag/19674347.

The highest value of the tests is in FooterActionsViewModelTest, which
focuses on testing the *state* (view model) of the footer actions using
the *real implementation* of the repositories, interactor and viewModel
all together. To do so, I implemented a FooterActionsUtils class that
allows to *easily* create real implementations of those repositories,
interactor and view model, without requiring the caller to provide any
parameter. I believe that this is even better than introducing new
fakes, and it should hopefully lead us towards using more and more of
the real implementations in our tests, and less and less of fakes/mocks,
making the tests much more useful. Of course, I still had to use fake &
mocks for the classes I'm calling to and for which instantiating the
actual object is too painful. As you can see, there are no test files
for the repositories: given that we already use the real implementations
in the ViewModel tests, they are defacto already tested.

I still added some tests on *interactions* (not *state*) in
FooterActionsInteractorTest. Even though I believe those tests don't
provide much value (they are merely a copy/paste of the implementation),
I preferred keeping the same coverage as the current tests (some of
which are going to be removed in ag/19674347).

Note that the business logic contained in this CL was mostly copy/pasted
from the current implementation, as I wanted to make sure that this is
going to be a pure refactoring that does not change the logic of this
feature. Still, I left some TODOs in the code for potential
improvements.

Bug: 242040009
Test: atest FooterActionsViewModelTest
Test: atest FooterActionsInteractorTest
Change-Id: Ia0bdf9824e098ad6604709f5db87576437b0a904
2022-08-25 16:24:00 +02:00
Cole Faust
43c6d3dd17 Merge "Mark SystemUI-tests as test code for lint" am: 0b33d054b3 am: f214872067 am: 5954744b9c am: d4e5c17068 am: 93e7ddd44e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2184008

Change-Id: Ibcc256aad0046eaedf631091bd07441328d9f9ad
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 22:55:10 +00:00
Cole Faust
93e7ddd44e Merge "Mark SystemUI-tests as test code for lint" am: 0b33d054b3 am: f214872067 am: 5954744b9c am: d4e5c17068
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2184008

Change-Id: Iecb83dcb0c2051141b8c1a7a173433da97918784
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-19 22:28:04 +00:00
Cole Faust
17f1e7268d Mark SystemUI-tests as test code for lint
Lint warns on usages of @VisibleForTesting methods from
non-test code. Since SystemUI-tests is just a regular
android_library instead of an android_test, it was warning
there. Mark it as a test module so lint knows not to warn.

Fixes: 235339747
Test: Presubmits
Change-Id: Ibf8e94c4f9582740e60e285cc918b2976c1fc19a
2022-08-17 19:57:44 +00:00
Jared Duke
84e94b3f99 Update SystemUI R8 documentation
Update guidance based on R8 optimizations now being opt-out.

Test: n/a
Bug: 203472868
Change-Id: I721dfb0ac5be2956c5a29d9b5ef63da36272a28c
2022-08-05 13:46:38 -07:00
Jordan Demeulenaere
eceafc93bb [conflict] Merge "Move SystemUI test utils to SystemUI/tests/utils/ (1/2)" into tm-qpr-dev am: 735edc275a am: 1f2b9269a4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19457110

Change-Id: Ie0186810c4b289811de9824a4a704c6d53c7b56e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-02 14:29:51 +00:00
Jordan Demeulenaere
735edc275a Merge "Move SystemUI test utils to SystemUI/tests/utils/ (1/2)" into tm-qpr-dev 2022-08-02 13:34:47 +00:00
Alejandro Nijamkin
9bfd66eb83 Merge "repeatWhenAttached" into tm-qpr-dev am: 768d148394 am: b9cf8d6ade
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19418384

Change-Id: I64012a7eafa258ef863271fd3ea0e79d951f5c59
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-31 22:05:38 +00:00
Alejandro Nijamkin
c738a8ccae repeatWhenAttached
This new View extension function replaces WindowAddedViewLifecycleOwner and is
intended for use with views that are not part of an activity.

It is more correct because it properly disposes itself and stops
all previously launched coroutines/jobs when the view is detached from
its view hierarchy.

Test: Extensive unit tests included. Also tested manually making sure that there are no
crashes and that jobs scheduled by a view-binder are properly cleaned up
when the view is detached and replaced by a different view when changing
device configuration using:

$ adb shell wm density 1000

Bug: 235403546
Change-Id: Ied36c9e1735333c482fc82cfbe28e665083795ae
2022-07-31 07:11:13 -07:00
Jordan Demeulenaere
f7fed3c20b Move SystemUI test utils to SystemUI/tests/utils/ (1/2)
This CL moves all the SystemUI-test-utils files to a separate
SystemUI/tests/utils/ directory. This paves the way towards making this
filegroup a reusable library instead.

The files have been move using a small bash script [1].

[1] https://paste.googleplex.com/5565628199993344

Bug: 240431193
Test: m SystemUI-tests SystemUIGoogleTests SystemUIGoogleScreenshotTests ArcSystemUI-test
Change-Id: I43ff578be211f1ef3f9c5bffd5c65771ef1492dc
2022-07-29 12:50:27 +02:00
Jared Duke
f090417ad3 Revert^2 "Enable R8 full mode by default with SystemUI"
Reason for revert: CtsTileServiceTestCases failures
have been addressed.

8e7e99759f

Change-Id: Ifb91730f5df6d5bc9bc533c7762f7b9ed1388dab
Bug: 215530220
2022-07-20 19:37:19 +00:00
Jordan Demeulenaere
8df3e6fe15 Merge changes from topics "people-space-screenshot", "screenshot-hardware" into tm-qpr-dev am: 9fcf0aac75 am: 55a4027966
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19268008

Change-Id: I5c33222da51ed096ee251f19bccfad8c76eaf235
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-20 09:10:58 +00:00
Jordan Demeulenaere
8a169ff03c Make the PeopleSpaceActivity screenshot testable
This CL makes the PeopleSpaceActivity screenshot testable by extracting
a ViewModel and ViewBinder out of it. See ag/19289788 for the associated
screenshot tests.

Note that I tried to change the code inflating and updating the View as
less as possible, to avoid introducing bugs. Once this CL and the
associated screenshots are submitted, I will go ahead and refactor this
code even more. This CL is meant to be an example of the kind of
refactoring required to make a UI screenshot testable, so I tried to not
make it too big.

Bug: 238993727
Test: atest PeopleSpaceScreenshotTest
Change-Id: Ib792bd5da41c9e8bdab6cba7108a249bab10ebd2
2022-07-19 10:21:51 +02:00
Alejandro Nijamkin
6f22abf6ed Adds core-ktx to SystemUI
This lets us use View extension functions like isGone, isVisible, etc.

Bug: b/235403546
Test: build still works
Merged-In: I0f1d06ee662f0fbc164ab1712b1e8dc90aac14c3
Change-Id: I0f1d06ee662f0fbc164ab1712b1e8dc90aac14c3
2022-06-28 16:40:09 +00:00
Alejandro Nijamkin
3885964933 Adds core-ktx to SystemUI
This lets us use View extension functions like isGone, isVisible, etc.

Test: build still works
Change-Id: I0f1d06ee662f0fbc164ab1712b1e8dc90aac14c3
2022-06-27 21:24:40 +00:00
Android Culprit Assistant
8e7e99759f Revert "Enable R8 full mode by default with SystemUI"
This is an Android Culprit Assistant revert, created as part of an culprit search session. We have identified the revert is valid. Refer to the bug for more details.

Bug: 233427840
Change-Id: I5b2863a48d02536359ada3ae1945b3993f354eab
2022-06-01 19:54:35 +00:00
Jared Duke
f0b6240b77 Enable R8 full mode by default with SystemUI
This shrinks SystemUI dex by another ~10%, both for optimized
and unoptimized (shrink-only) builds.

Bug: 203472868
Bug: 215530220
Test: m + atest SystemUITests
Change-Id: I975f0700336159e613d155cb05fee8573d94737b
2022-05-20 08:37:51 -07:00
Kevin Jeon
f2e7218dbd Enable dagger fastInit on SystemUI
This change enables fastInit mode on SystemUI, which should improve
initialization times.

SystemUIBootTiming was measured over three trials:
- 0ms -> 5ms (DependencyInjection)
- 545ms -> 490ms (StartServices)

Bug: 202327225
Test: - Build and check that sysui uses SwitchingProviders.
      - atest SystemUITests
Change-Id: I726bb1b39af1e26af55b89f7eff80741a31b8ca1
2022-04-05 18:31:35 +00:00
Jernej Virag
bb4ff3f645 Add an Android Lint check to prevent sendBroadcast calls on Main thread
This lint check verifies that BroadcastSender is always used in SystemUI for sending broadcasts. It should prevent main thread jank due to broadcast calls.

Bug: 223606115
Test: Included unit test for the linter.
Change-Id: I16b8b3471389ff2c59053c686c94cb9cb694ec42
2022-03-27 18:30:41 +00:00
Lucas Dupin
00c1a6040e Convert tonal palettes to MDC nomenclature
MDC was already included in sysui, but it was an implicit dependency,
now it's included in the Android.bp.

All Android dynamic palettes were renamed for clarity, so tones now
follow perceptual luminosity, from 0 to 100.

Test: m -j SystemUIGoogle
Test: make with AndroidStudio
Fixes: 220018210
Change-Id: I23bd9e71e3f2b7d949c04fd8ad78c85e3552b79f
2022-02-17 08:54:35 -08:00
Bryce Lee
436e42c60c Dream overlay touch management.
This changelist introduces the DreamOverlayTouchMonitor, a component for observing touches and gestures over the dream overlay and reporting them to a set of consumers. DreamOverlayTouchMonitor is responsible for enabling/disabling touch listening based on the dream overlay service state. It enables listening entities to isolate touches to just their listeners when appropriate and handles resetting listening state across touches.

Bug: 211506329
Test: atest DreamOverlayTouchMonitorTest
Change-Id: I44bcba982dd3a73ebef8cfa52e9ad65216316c08
2022-01-26 22:19:51 -08:00
Fabian Kozynski
dd9d854fd0 Merge "Add clean up to SysuiBaseFragmentTest" 2022-01-11 14:32:50 +00:00
TreeHugger Robot
6567afa17f Merge "Add some more fakes to the test dependencies" 2022-01-07 17:02:50 +00:00
Fabian Kozynski
d389df571e Add clean up to SysuiBaseFragmentTest
Also, set up AAA++ test for inheritance.

Test: atest SystemUITests
Fixes: 2133482724
Change-Id: If2484040f613b3112c224e8001d6e617dc5005b8
2022-01-07 10:06:36 -05:00
Fabian Kozynski
9ccb23428e Add some more fakes to the test dependencies
Test: atest SystemUITests
Bug: 213348724
Change-Id: Ifedd6a5895c4bb0df334a02afe6b582605b777b1
2022-01-06 13:25:24 -05:00
Jared Duke
9dfa77bfeb Update SystemUI build flag for optimization
Use the new `SYSTEMUI_OPTIMIZE_JAVA` build flag instead, decoupling
optimization opt-in from system_server. Note that this remains
opt-in and disabled by default.

Bug: 203472868
Test: SYSTEMUI_OPTIMIZE_JAVA=true m SystemUI (validate SystemUI.apk)
Change-Id: Ib0482324561939da806707aea860d040e9aa81ef
2022-01-05 18:24:59 +00:00
Jared Duke
2fee7409a2 Allow flag-guarded Java optimizations for SystemUI
Introduce a set of optional Java optimization settings for
SystemUI, based on the Soong variable added in aosp/1896612.

Opting in to optimizations can be achieved with either:
  * Env:
export SYSTEM_OPTIMIZE_JAVA=true
  * Make:
$(call add_soong_config_var_value,ANDROID,SYSTEM_OPTIMIZE_JAVA,true)

As these optimizations can change the resulting stack traces, a parallel
effort is working to simplify retracing of stack traces for more
accurate debugging and diagnostics. Additional stabilization and testing
will occur before any effort to enable these optimizations by default
for specific targets. Also note that there are no plans to enable
obfuscation.

Preliminary results (w/ `SYSTEM_OPTIMIZE_JAVA=true`):
  * SystemUI.apk (31MB -> 26MB)

Bug: 203472868
Test: SYSTEM_OPTIMIZE_JAVA=true m (validate SystemUI.apk)
Change-Id: Idd8d5ef32c06e992ad35846eb5fab67ecb58830a
2021-12-14 10:39:39 -08:00
Dave Mankoff
7bc36943ab Remove FeatureFlagReader. Allow resource overlays.
Removes the FeatureFlagReader which some "flags" still used because
they were read from resources instead of the flaggin system.

Flags can now specify a resource id where their default value can be
read from (if there is a resource definition for it).

Bug: 203548827
Test: atest SystemUITests && manual
Change-Id: Ifb895fd6c5b40d4adfe2997f4ce1f4d7d2145183
2021-11-08 21:33:46 -05:00
Dave Mankoff
08682b29f9 Merge "Add support for flag change listeners library." into sc-v2-dev am: c61d506a90 am: 6a9f7f79f6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16182385

Change-Id: Ic4e7ec1b6b80e6690d06c50e66751ee4162d48ae
2021-11-04 20:13:05 +00:00
Dave Mankoff
fe460af86b Merge "Add ability to read flag values to Flag Library." into sc-v2-dev am: 6c8ebb114f am: 96f9c9e5b5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16101192

Change-Id: Ib5032980723d93f83925139a332c14ebf353aa5d
2021-11-04 15:22:10 +00:00
Dave Mankoff
b0505162ca Revert "Revert "Merge "Add a shared library for setting flags in SysUI." into sc-v2-dev am: fdb01b6353 am: abef1d3d2b""
This reverts commit 4977c9aaec.

Reason for revert: Fixing this revert.

Change-Id: I65ada48df4b3a581a59115d4303c99ed6931b8b7
2021-11-04 06:01:54 +00:00
Dave Mankoff
4977c9aaec Revert "Merge "Add a shared library for setting flags in SysUI." into sc-v2-dev am: fdb01b6353 am: abef1d3d2b"
This reverts commit 31d5370b038e32894843c299350d2ecb15a4b55f.

Reason for revert: Bad merge

Change-Id: Ib721f4e00a1a78477c3f9af511a9abd89331f9f8
2021-11-04 05:00:11 +00:00
Dave Mankoff
6f7a0d6743 Merge "Add a shared library for setting flags in SysUI." into sc-v2-dev am: fdb01b6353 am: abef1d3d2b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16092692

Change-Id: I2debaf6ed83b2cbf72bbb1b578c8b30a8a58a4da
2021-11-04 04:48:37 +00:00
Dave Mankoff
72a5002956 Add support for flag change listeners library.
Bug: 203548827
Test: manual
Change-Id: I6f989e89a98c7c6643af762eb0263f81ce584dfa
2021-11-03 11:20:11 -04:00
Dave Mankoff
1a934e9aee Add ability to read flag values to Flag Library.
The FlagManager now partially implements the FlagReader interface.

The FeatureFlagManager, part of SystemUI proper, now uses the
FlagManager to read flag values, helping to ensure consistency between
the two separate systems.

Bug: 203548827
Test: manual
Change-Id: Ia3b103f783a846cfe9437cd8e6b987962cebabde
2021-11-03 10:28:22 -04:00
Dave Mankoff
93c9d9d665 Add a shared library for setting flags in SysUI.
This adds the FlagManager class which currently has 3 methods:
- #getFlagsFuture
- #setFlagValue
- #eraseFlag

The first makes an async call to SystemUI to retrieve the flags
it knows about. It returns a collection of Flag objects from which
one can get the id, type, and default values.

The other two are fairly self-explanatory, sending intents to
SystemUI telling to set or erase flags. Any app calling these
methods must have the FLAGS_PERMISSION defined in the FlagManager
library.

Only boolean flags are supported at the moment.

Bug: 203548827
Test: manual
Change-Id: Id15ff481edcb83c67ce4cdad6cdda27d28a40652
2021-11-02 11:27:55 -04:00
Jeff DeCew
bdbb7a0a3e Merge "Make gradle build use debuggable FeatureFlagManager" into sc-v2-dev am: d2984e95cf am: 6ef026a249
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16150895

Change-Id: Ideb147db421fcea6519fefb546dfbbe3b2eac420
2021-11-01 17:22:57 +00:00
Jeff DeCew
86b8e77bbf Make gradle build use debuggable FeatureFlagManager
Fixes: 204129347
Test: gradle build & dump
Change-Id: I06ba95f4cc21b06519e676afee4bb6ae9c44c03e
2021-10-30 14:08:45 -04:00
Jay Aliomer
722473e7ff Added a debug and release version of flag reader
Bug: 196602427
Test: manually tested with log statements
Change-Id: Ie01af22ef51504db5aadc0da1d367961b6aa42d4
Merged-In: Ie01af22ef51504db5aadc0da1d367961b6aa42d4
(cherry picked from commit 97d4fc7d15)
2021-10-12 19:01:53 +00:00
Bryce Lee
a5b0808814 Create SystemUI Test Concurrency Library.
This library allows outside components to use
the test helper classes surrounding concurrency,
such as FakeExecutor.

Bug: 202301343
Test: manual
Change-Id: I6b75a09bec5a3558d0e365580432d852c5672d49
2021-10-06 11:34:56 -07:00
Jay Aliomer
97d4fc7d15 Added a debug and release version of flag reader
Bug: 196602427
Test: manually tested with log statements
Change-Id: Ie01af22ef51504db5aadc0da1d367961b6aa42d4
2021-09-29 14:22:37 -04:00