Commit Graph

7768 Commits

Author SHA1 Message Date
Bernardo Rufino
f6f7faacb6 Run BundleTest on @Presubmit
Bug: 201501487
Change-Id: Ie3ab09dc8aedd8018acf6a0ac4685e6afd848eb4
Test: TH passes
2021-12-22 18:09:30 +00:00
Joshua Trask
6a17cc1c6f Merge "Use runtime-resolved resource IDs in tests." 2021-12-21 22:10:50 +00:00
Joshua Trask
6084b7a987 Use runtime-resolved resource IDs in tests.
As described in b/211615608, the resource IDs asserted in the tests
didn't always align with those used in the ChooserWrapperActivity
(which inherits from the framework, and may not have been updated
since the last change to the resources -- even though that change
*is* picked up by the test). After this change, the tests no longer
depend on the framework version being up-to-date.

I'm not sure of a better way to solve this problem -- perhaps
we could either require the framework to be up-to-date before
the test is run, or else somehow write our tests in terms of the
last-built resource IDs on the device (instead of rebuilding those
IDs from source).

Bug: 211615608,208803748
Test: Manual test steps:
1. Add a new resource to the top of
frameworks/base/res/res/values/strings.xml. (May need to be
alphabetically early to disrupt existing ordering? I used
`aaapp_name`)
2. Run `atest ChooserActivityTest` and confirm that some UI
tests fail to find views for the `onText(int)` matcher (the
error message will show that it failed because it was using
a different resource name than the test asked for).
3. Either:
    a. Patch this CL for a fix, or
    b. `mp droid` to confirm this is because the framework was
        out-of-date.
4. Re-run `atest ChooserActivityTest`; failures are fixed.

Change-Id: I3c1c4bf434d3a7fdc8e498cf112feb7d6ffbb016
2021-12-21 13:33:36 -05:00
Treehugger Robot
17832397d1 Merge "[MS14] Move isPersistable to NetworkPolicy" am: f421f1dd68 am: 3c4a90eda1 am: 3dd00d784f am: fe17ca0a4b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925762

Change-Id: I63fab97dc3c78143854055427c939aa1f6d674c3
2021-12-21 17:24:02 +00:00
Treehugger Robot
fe17ca0a4b Merge "[MS14] Move isPersistable to NetworkPolicy" am: f421f1dd68 am: 3c4a90eda1 am: 3dd00d784f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1925762

Change-Id: Iff7f2e8f21941603daa8479d78024caddff79325
2021-12-21 17:02:02 +00:00
Junyu Lai
96a19bcaba [MS14] Move isPersistable to NetworkPolicy
Since the NetworkTemplate serialization is done in the platform
code. To decide whether the template is persistable should be
also inside the platform along with the serialization logic.

Test: atest NetworkPolicyTest
Bug: 204830222
Change-Id: I15d17dda77e6a3e1ae11275915e3d2f6e2888639
2021-12-21 10:05:47 +00:00
Joshua Trask
3f265b798e Merge "Decompose ChooserActivityTest for reuse." 2021-12-20 20:20:42 +00:00
Joshua Trask
33501f3823 Decompose ChooserActivityTest for reuse.
Prepare build targets and set up design to share test suite
across different ChooserActivity subclasses. (This was
somewhat tricky because the tests need to use wrapped
activities for instrumentation; those activities need to
have the same inheritance relationship with ChooserActivity
as the chooser-under-test would normally have; and shared
test code needs to use a common type to refer to the
wrapped activities.)

Test: `atest ChooserActivityTest` (modulo standing flakes);
also tested a proof-of-concept unbundled version locally
(CL to follow).
Bug: 202166045

Change-Id: I8dc317ed9fac7195e525d62fdd386dcf11ef7dba
2021-12-16 21:55:54 +00:00
Prabir Pradhan
57b654fcaa Merge "Use SOURCE_CLASS_POINTER as the default source for MotionEvent" into sc-v2-dev am: 72e278d976 am: 0e229b7f33
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16432384

Change-Id: I8a3495d162b6957263febbc291265e9bd37fa0e5
2021-12-16 20:45:23 +00:00
Prabir Pradhan
0e229b7f33 Merge "Use SOURCE_CLASS_POINTER as the default source for MotionEvent" into sc-v2-dev am: 72e278d976
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16432384

Change-Id: I7916149c7abb1e940558383155e2b4cca3a88f2e
2021-12-16 19:40:16 +00:00
Dmitri Plotnikov
553429ae39 Merge "Attribution of modem power per process state" 2021-12-16 18:59:50 +00:00
Prabir Pradhan
b1d3e076af Use SOURCE_CLASS_POINTER as the default source for MotionEvent
This CL also adds a test to ensure that a pointer source is used by
default when obtaining a MotionEvent, and that offsets are only applied
to pointer sources.

Bug: 207251886
Test: atest MotionEventTests
Change-Id: Id40accc6d1238c940f139a18b26fa277dd6e11f9
2021-12-16 09:19:29 +00:00
Neharika Jali
fa21499347 Merge "Change reserved cache space as sum of cache quotas of all uids" 2021-12-16 05:57:46 +00:00
Dmitri Plotnikov
fa84b666d1 Merge "Fix MeasuredEnergyStats.reset() for per-process-state counters" 2021-12-16 01:26:35 +00:00
Yinglei Wang
ebbe319446 Merge "Add new setInputMethodEnabled API" 2021-12-15 19:23:34 +00:00
Dmitri Plotnikov
2cb00ccc8f Fix MeasuredEnergyStats.reset() for per-process-state counters
Bug: 191921016
Test: atest FrameworksCoreTests:MeasuredEnergyStatsTest
Change-Id: I8a05503a31d07535d5d14907c8b145dd3dc20491
2021-12-14 18:37:21 -08:00
Dmitri Plotnikov
9bf5b2f104 Attribution of modem power per process state
Bug: 191921016
Test: atest FrameworksCoreTests:BatteryStatsTests

Change-Id: I43bde25785e246340dffe87a15fa960771fa1ec5
2021-12-14 10:23:03 -08:00
TreeHugger Robot
a7cc168d0e Merge "Add cheap aidl tracing suitable for always-on-tracing (1/3)" 2021-12-13 13:55:32 +00:00
Christine Franks
c74e2e0ee7 Merge "Remote input interfaces, events, and injection" 2021-12-10 23:38:02 +00:00
yingleiw
b5f3d34def Add new setInputMethodEnabled API
Make accessibility services able to enable/disable a specified
IME in the same package for the current user.

Bug: 195476910
Fix: 191386474

Test: atest AccessibilitySoftKeyboardTest. Also tested with
modified talkback (use the swith input method API for enable
ime), and self created empty a11y service with an empty ime.
Mananged device and profile which set limit on user 0 are also
tested.

Change-Id: I4187468076705ac597d680f2f5dc32d7b166da1f
2021-12-10 15:20:44 -08:00
Junyu Lai
456b39de58 Merge "[MS01] Move NetworkTemplate cloud backup functions to NetworkPolicy" am: 40eb40302d am: 895f993439 am: 522e497231 am: b2afbc4490
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1878037

Change-Id: I9a4e8607e9500f427bfad716ddbce0bacd468fd8
2021-12-10 23:20:41 +00:00
Junyu Lai
b2afbc4490 Merge "[MS01] Move NetworkTemplate cloud backup functions to NetworkPolicy" am: 40eb40302d am: 895f993439 am: 522e497231
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1878037

Change-Id: Idb67d09324626e24d261d65963df92084093de13
2021-12-10 23:01:23 +00:00
Junyu Lai
895f993439 Merge "[MS01] Move NetworkTemplate cloud backup functions to NetworkPolicy" am: 40eb40302d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1878037

Change-Id: I86a23381b25fba2512c2ad1d3ffeb60d12947202
2021-12-10 22:30:19 +00:00
Christine Franks
c4cf03b162 Remote input interfaces, events, and injection
Bug: 204081582
CTS-Coverage-Bug: 208247880
Test: atest FrameworksServicesTests:VirtualDeviceManagerServiceTest
and atest FrameworksCoreTests:android.hardware.input

Change-Id: Ic10e62b0d95d563aed59ed9bb8caba6d506176b7
2021-12-10 10:17:31 -08:00
Junyu Lai
650ee7a1d1 [MS01] Move NetworkTemplate cloud backup functions to NetworkPolicy
Since NetworkTemplate will be moved into the mainline module.
It is necessary to remove hidden BackupUtil usage from
NetworkTemplate. Also, it is also a hazard to maintain
compatibility for byte buffer interfaces.

Thus, move out these cloud backup functions to NetworkPolicy
to address these concerns.

Test: atest NetworkPolicyTest NetworkPolicyManagerServiceTest
Bug: 204830222
Change-Id: I3ec55f7e419ea13db535acff2457d8e7aaebdce8
2021-12-10 16:11:09 +00:00
Jorim Jaggi
794720fbd2 Add cheap aidl tracing suitable for always-on-tracing (1/3)
Instead of having only one switch to enable all binder tracing,
we seperate between stack tracking and tracing. Stack tracking
still works as before. However, the more lightweight option,
tracing using android.os.Trace, is toggleable separately and will
work on the receiver side without dumping the entire stack trace.

We also make the tracing more efficient by caching
getTransactionName and concatting the class name.

Also, enable this selectively for SysUI+Launcher, which is
currently the focus of always-on-tracing effort to figure out
what kind of binder calls these processes are calling which seems
to contribute a huge amount of jank (long binder calls are in
>= 50% of janky traces).

Test: external/perfetto/tools/record_android_trace gfx view freq sched wm am aidl
Test: atest aidl_unittests
Bug: 202278427
Change-Id: I4d803d073cc4b69d07fa433bfef7e1c7f45132b7
2021-12-10 17:03:24 +01:00
Joshua Trask
dbe355b4e4 Merge "Update goldens for ChooserActivity logging tests." 2021-12-09 15:26:25 +00:00
Victor Chang
6fa65b01b0 Merge changes from topic "icu70" am: da0880a0fe am: 4bd88f5cd6 am: fd779286da am: 14682b1f76
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914692

Change-Id: I0fc0a3a2afb0f3ec796cdcc686a8796daa194a16
2021-12-09 11:40:59 +00:00
Victor Chang
14682b1f76 Merge changes from topic "icu70" am: da0880a0fe am: 4bd88f5cd6 am: fd779286da
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914692

Change-Id: Ic1df8684bec29041368790400232c42599b11188
2021-12-09 11:11:30 +00:00
Neharika Jali
f0bb51b185 Change reserved cache space as sum of cache quotas of all uids
Bug: 203650406
Test: atest
frameworks/base/core/tests/coretests/src/android/os/storage/StorageManagerBaseTest
atest
cts/tests/tests/os/src/android/os/storage/cts/StorageManagerTest#testComputeStorageCacheBytes
Change-Id: I72710c89961ecc16b27ebb0647798f28e2e810ca
2021-12-09 10:43:28 +00:00
Victor Chang
4bd88f5cd6 Merge changes from topic "icu70" am: da0880a0fe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1914692

Change-Id: Ibbdc18a918397f831eac512394bd31e9f1038c18
2021-12-09 10:20:52 +00:00
Joshua Trask
bae0966fc1 Merge "Use a valid mime type in ChooserActivityTest cases" 2021-12-08 23:38:34 +00:00
Naomi Musgrave
07cad8890e Merge "Introduce WindowManagerState field for sandboxing" into sc-v2-dev am: f5284f89be am: f6340cbbf3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16340536

Change-Id: If930f6fd7eca64bd02109f7d57077ea5cd418b75
2021-12-08 23:18:37 +00:00
Naomi Musgrave
f6340cbbf3 Merge "Introduce WindowManagerState field for sandboxing" into sc-v2-dev am: f5284f89be
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16340536

Change-Id: I4b2fd3e47e9cbb2e873fa0db37eed74f6badb734
2021-12-08 23:00:26 +00:00
Joshua Trask
7c56f2466a Update goldens for ChooserActivity logging tests.
The asserted sequence of events got out-of-date while the
tests were disabled, and needed to be updated to reflect
the new events that have been added to our flows. I didn't
want to update the asserted sequence until I addressed the
invalid-mime-type dependence (b/209804664) and the
double-querying (b/209018315); with those fixed, I think
the remaining event sequences seem correct.

Bug: 208803748,208837849
Test: `atest ChooserActivityTest`
Change-Id: I14cbf11570384495fec2172625f97c2fd7f50e97
2021-12-08 17:33:01 -05:00
Naomi Musgrave
f5284f89be Merge "Introduce WindowManagerState field for sandboxing" into sc-v2-dev 2021-12-08 21:52:51 +00:00
Joshua Trask
ae6ad95ee0 Use a valid mime type in ChooserActivityTest cases
This doesn't affect any of our currently-enabled tests,
but as in b/208837849 it can apparently cause behavioral
changes in our currently-disabled logging tests; in order
to re-enable those tests for b/208803748, we'll need to
specify one of these behavior cases and should prefer to
match what happens when the mime type *is* valid. "Golden"
event sequences can be re-recorded for those tests after
this CL is merged, and that should be sufficient to
re-enable them.

More concerningly, an earlier attempt to re-enable some
ChooserActivityTest cases resulted in flakes when an
exception was thrown parsing the invalid mime types
(b/208898133). It's unclear why this wouldn't fail more
consistently, and perhaps that's why these tests were
disabled in the first place -- but if we have specific
intentions in this case, we should test them explicitly
instead of allowing them to interfere with test cases
that were simply trying to set up "typical" conditions.

Test: `atest ChooserActivityTest`
Bug: 209804664
Change-Id: I02854aac788d36165ad9e0eabd6f5e02e1d1204d
2021-12-08 15:05:34 -05:00
Dmitri Plotnikov
5ffeb52135 Merge "Run per procstate CPU time-in-state tracking on the main thread" 2021-12-08 18:05:36 +00:00
Naomi Musgrave
5acb031f31 Introduce WindowManagerState field for sandboxing
New field indicates if ActivityRecord#providesMaxBounds has
calculated that sandboxing of max bounds to match app bounds
should be applied.

Test: manual
Bug: 193514437
Change-Id: I91587ce1e1ded7435038e2d1a7d038be57ff0f2f
2021-12-08 17:36:03 +00:00
Victor Chang
93ae9cd316 Update DateIntervalFormatTest due to ICU 70 data change
Bug: 202948901
Test: atest android.text.format.DateIntervalFormatTest
Change-Id: I1b9a6654a9db8d1fb2ea2bbb426e36934604b4aa
2021-12-08 15:13:49 +00:00
Dmitri Plotnikov
3818a53e7e Run per procstate CPU time-in-state tracking on the main thread
Procstate tracking will now be enabled unconditionally
when eBPF is supported by the kernel. Otherwise, it will be disabled.

Bug: 197162116
Test: atest FrameworksCoreTests:BatteryStatsTests

Change-Id: I200ef51b92aa19d42a10966aa6fea6f99d741f3f
2021-12-07 19:09:05 -08:00
Minche Li
fc8cd1d68f Merge "Adds public APIs for AccessibilityService to control magnifier by setting MagnificationConfig" 2021-12-06 14:45:51 +00:00
mincheli
7c91f43c3a Adds public APIs for AccessibilityService to control magnifier by setting MagnificationConfig
See go/b200769372
AccessibilityService adds new magnificationController APIs,
setMagnificationConfig and getMagnificationConfig, to control
magnification on demand.
The service can set the magnification mode, scale, center postion
of the magnifier on the display to control magnification.
And the service controls the least recently activated magnifier
on the display if the config mode is not specified.

Bug: 199732498
Test: atest MagnificationProcessorTest,
    atest  AbstractAccessibilityServiceConnectionTest,
    atest AccessibilityMagnificationTest,
Change-Id: I51be2bbf96411c6c54c9da30873556d09533bb65
2021-12-06 18:24:32 +08:00
TreeHugger Robot
da4dcf706f Merge "Revert "Un-@Ignore 7 passing ChooserActivity tests."" 2021-12-03 21:47:03 +00:00
Joshua Trask
69f66f2d22 Revert "Un-@Ignore 7 passing ChooserActivity tests."
This reverts commit ec29931867.

Reason for revert: Test flakes around invalid mime type in the APS request. Switching tests to use valid mime types has unexpected consequences I'll address in future CLs.

Change-Id: I9f09d0ce1ddd0eb357cab5dc2cfb49238b18af45
2021-12-03 20:16:48 +00:00
Joshua Trask
943415466f Merge "Un-@Ignore 7 passing ChooserActivity tests." 2021-12-02 19:05:37 +00:00
Charles Chen
6af506dff2 Merge "Verify WindowContext gets custom Drawable" into sc-v2-dev am: 0ef22432a8 am: ef0bbb8f6e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16346904

Change-Id: Ib957e1d833f92abcbf98a1f6dacd8fa627f0222c
2021-12-02 18:56:20 +00:00
Joshua Trask
ec29931867 Un-@Ignore 7 passing ChooserActivity tests.
Of 69 ChooserActivityTest cases, 22 are currently
ignored, but should be restored in order to maximize
coverage in preparation for the new unbundled
implementation (but note that these tests are still
only run against the "bundled" system chooser for now).

Of the 22 ignored tests, 7 of them pass reliably and can
be un-ignored immediately (although it's not known whether
they were ignored for a reason other than failures/flakes).
The remaining 15 will require some changes to the test
and/or ChooserActivity code, to be investigated & completed
in future CLs.

Bug: 208803748
Test: `atest --iterations 100 ChooserActivityTest` (100
iterations ensures no regressions-to-flakiness.)

Change-Id: Iede5835b429cccfd65fdc114397460fc00781a75
2021-12-02 15:23:15 +00:00
Charles Chen
ef0bbb8f6e Merge "Verify WindowContext gets custom Drawable" into sc-v2-dev am: 0ef22432a8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16346904

Change-Id: I404ddba8f9886d169552c0853f1d86b29ec6af4d
2021-12-02 13:46:55 +00:00
Prabir Pradhan
3914e57d8b Add getSurfaceRotation API to MotionEvent
Add an API to get the current rotation value of the transform of the
MotionEvent.

Bug: 207771136
Test: atest MotionEventTest
Change-Id: I5ee11e7a0311bdbeefbb37251098ce63b7d22730
2021-12-01 06:05:16 -08:00