Commit Graph

120 Commits

Author SHA1 Message Date
Dave Mankoff
1becd8179a Merge "Include all flags in our flag list." into tm-qpr-dev am: 8fd3032fce
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20318731

Change-Id: I02c36fb40401663a7028b8f745dc6e5ff4f06405
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-06 14:38:44 +00:00
Dave Mankoff
8fd3032fce Merge "Include all flags in our flag list." into tm-qpr-dev 2022-11-06 14:12:44 +00:00
Dave Mankoff
9f825a8ba1 Include all flags in our flag list.
This improves the use of reflection to include all the flags listed
in Flags.kt. One interseting finding: I can't figure out how to
get the value of a field marked with just `@Keep`. It needs to
also have `@JvmField` or not have any annotations at all.

More changes to this code will come in follow up cls, using string
names where appropriate, but this improves existing functionality.

Key takeaways:
- Reflection is terrible
- Reflection in Kotlin is worse
- Reflection on `object` instances is worse still
- Reflection mixing Java with Kotlin follows the trend line
- Reflection on annotated fields is nigh impossible

Bug: 249121873
Test: adb shell cmd statusbar flag
Change-Id: I69a96501876b01570233c3fd80b6bc7334d9fe73
2022-11-05 23:57:51 +00:00
Omar Miatello
bfb8c6855a Merge "Add support for Predictive Back in CreateUserActivity" into tm-qpr-dev am: 78b5de4a42
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20257566

Change-Id: I520bce546449d17df380b6fe2f2a54468c0d6bf1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-05 08:57:54 +00:00
omarmt
d1c43eaa15 Add support for Predictive Back in CreateUserActivity
Test: atest CreateUserActivityTest
Bug: 254840316
Change-Id: I9d00c114ae38e72f11678dab93d3feaf222463d1
2022-11-04 15:56:02 +00:00
Johannes Gallmann
f1501b0096 Merge "Implement MotionTool Interface using ViewCapture library" into tm-qpr-dev am: e95b375dd1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20111438

Change-Id: Ib636895770d74eb505d55f056c65a18d0238010d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-03 17:27:03 +00:00
Johannes Gallmann
0d5183cb9d Implement MotionTool Interface using ViewCapture library
Bug: 255929005
Test: atest frameworks/libs/systemui/motiontoollib/tests/com/android/app/motiontool
Change-Id: I2e7de355d7749a273b9454b8bbee117059ee7a10
2022-11-03 10:28:37 +00:00
Daniel Peykov
dfe7fc99a3 Merge "Update uiautomator references in frameworks/base" am: b6d9367bc9 am: 089f7d6380
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2219973

Change-Id: Idd3875bea82b67b9f2d03c7cbbcdb18b2bb39175
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-11 18:09:05 +00:00
Daniel Peykov
089f7d6380 Merge "Update uiautomator references in frameworks/base" am: b6d9367bc9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2219973

Change-Id: I486de09a1db184012ae42d1e9c923e443bbd2dfd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-11 17:59:25 +00:00
Hongwei Wang
4222f4e320 Merge "Save ProtoLog viewer configuration in WMShell" into tm-qpr-dev am: a1db600e04
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19830265

Change-Id: Ib965ad51cc660f55c24fb90c59888454d4635e88
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-10-06 17:38:13 +00:00
Daniel Peykov
6d91c980e3 Update uiautomator references in frameworks/base
* Replace "androidx.test.uiautomator" (v2.2.0) with
  "androidx.test.uiautomator_uiautomator" (v2.3.0).

Bug: 247008528
Test: presubmit
Change-Id: I3d4de8bd97144d44f6b699a5c4e0acde380d9d60
2022-10-05 16:58:37 +00:00
Hongwei Wang
2b227ee11d Save ProtoLog viewer configuration in WMShell
In this changeset topic
- Build WMShell with protolog viewer config
    - it's built with SystemUI{,Google} packages and installed as
      /system_ext/etc/wmshell.protolog.json.gz
- Deprecated the viewer configuration as a bundled resource
- The `required` keyword in Android.bp does not propagate, need to add
  it in individual Android.bp file such as SystemUIGoogle/Android.bp
- Push the generated viewer config file onto device in makepush script
  (in a separate CL)

Bug: 244642224
Test: mp sysuig
Change-Id: Ib7f37ec55d12493d6beec3aba66883415966b521
2022-10-05 09:36:42 -07:00
Lucas Silva
09217538b9 Merge "Hide the status bar dream overlay when low light is active." into tm-qpr-dev am: 2da886cb7d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19993591

Change-Id: Idd4f82b99bbe8dacb59568c44ebe9f65e7712d23
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-23 20:49:46 +00:00
Lucas Silva
0bfb405bd3 Hide the status bar dream overlay when low light is active.
We pipe the component name of the currently active dream into the
overlay service, and when the active dream is lowlight, we hide the
status bar.

Test: atest DreamOverlayStateControllerTest
Test: atest DreamOverlayStatusBarViewControllerTest
Test: manually on device by entering/exiting low light and ensuring the
status bar is hidden
Fixes: 245386662

Change-Id: I22973538bea19ef108360a319c70c878cfd81800
2022-09-22 13:12:53 -04:00
TreeHugger Robot
ef50a0d697 Merge "Log UiEvents whenever FaceAuth is triggered." into tm-qpr-dev am: f506a90735
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/19867009

Change-Id: Ie5be18841ae62cca9546fd3c0133efbe4fa62083
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-09-07 21:09:32 +00:00
Chandru
917e4bc214 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
Merged-In: I6cb04f7cccdaf92e77b8e5691bf5ac458928ff86
2022-09-07 18:51: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
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
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
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
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
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
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