This moves the activities to the new Predictive Back dispatch mechanism.
Added unit tests for each (note: used a latch to synchronize the test and ui threads)
Bug: 255355028
Test: Passed atest <testname>
Change-Id: I775f636f8679abfd50a595dd56fb8fa3f23e0fef
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
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
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
This reverts commit 81fe7f64d7.
Reason for revert: Broke the build on master while still having presubmit-verified +1 :(
Change-Id: I2cf6a05b7187552d9df43fe96cda458b1fdd7631
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
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
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
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
Reason for revert: CtsTileServiceTestCases failures
have been addressed.
8e7e99759f
Change-Id: Ifb91730f5df6d5bc9bc533c7762f7b9ed1388dab
Bug: 215530220