Commit Graph

8003 Commits

Author SHA1 Message Date
Jorim Jaggi
8dc835316a Merge "Add OnControllableInsetsChangedListener" into rvc-dev 2020-03-11 13:33:33 +00:00
Chiachang Wang
28aa900400 Merge "Skip Route tests that are R-specific on Q" into rvc-dev 2020-03-11 09:36:23 +00:00
Lorenzo Colitti
fa2f88e25f Merge "Merge NetworkStatsService handler changes." into rvc-dev 2020-03-11 06:19:18 +00:00
Rob Carr
2832f868d7 Merge "TaskOrganizer: Send newest TaskInfo in taskVanished" into rvc-dev 2020-03-10 23:43:49 +00:00
Rob Carr
ab17978c71 TaskOrganizer: Send newest TaskInfo in taskVanished
When leaving PIP SysUI might need to know the target mode
and bounds to animate correctly. taskInfoChanged may
not have yet been dispatched though. A simple solution is
to provide the info in TaskVanished.

Bug: 150716630
Test: Existing tests pass
Change-Id: I871f745198d6b4bc92cc5701128c5489c154f4f9
2020-03-10 14:34:51 -07:00
Gavin Corkery
1714207393 Merge "Only sync requests when there are changes to report" into rvc-dev 2020-03-10 17:49:41 +00:00
Automerger Merge Worker
965be4e3f4 Skip Route tests that are R-specific on Q
MTU was added in R so test for it should be run on Q. Also
revise test to adopt rule.

Test: atest CtsNetTestCasesLatestSdk:android.net.LinkAddressTest
      on both devices
Bug: 150918852
Change-Id: Ibab9cfae0d35b26c6e4ca0defbb89769b04201d4
Merged-In: Ibab9cfae0d35b26c6e4ca0defbb89769b04201d4
(cherry picked from commit 09e5726e15)
2020-03-10 12:47:19 +00:00
Jorim Jaggi
ed35b1779b Add OnControllableInsetsChangedListener
It's useful for apps to know which inset types they can currently
control, as otherwise they have to poll by calling
controlInsetsAnimation repeatedly.

This can be used when apps want to apply a custom animation
immediately during startup as soon as possible.

Fixes: 150780468
Test: InsetsControllerTest
Test: CTS will be added soon
Test: WindowInsetsActivity
Change-Id: Ic0388c11d759843d3ac9edd8ef23904c9ce05c46
2020-03-10 12:23:58 +00:00
Lucas Lin
2221a86262 Merge "Remove redundant connected notification" into rvc-dev 2020-03-10 02:21:07 +00:00
JW Wang
0cb85d1a48 Merge "Rewrite testBadApkOnly (1/n)" into rvc-dev 2020-03-10 01:40:49 +00:00
Remi NGUYEN VAN
853abf0355 Merge "Ignore NetworkAgentConfigTest on Q" into rvc-dev 2020-03-10 00:59:50 +00:00
Remi NGUYEN VAN
b6b1ef5693 Merge "Skip LinkAddress tests that are R-specific on Q" into rvc-dev 2020-03-10 00:59:32 +00:00
Remi NGUYEN VAN
b6b0aee60d Merge "Ignore testReevaluateNetwork until Q" into rvc-dev 2020-03-10 00:59:12 +00:00
Gavin Corkery
d70fa94a0d Merge "Add test for ExplicitHealthCheckService" into rvc-dev 2020-03-09 19:57:05 +00:00
Gavin Corkery
68713d9830 Only sync requests when there are changes to report
Instead of periodically syncing requests with the same information,
only call into the ExplicitHealthCheckController when the set
of packages with pending health checks has changed. Add tests to
verify that duplicate calls are not made.

Test: atest PackageWatchdogTest#testSyncHealthCheckRequests
Bug: 150114865
Bug: 146767850
Change-Id: Ic99038db0b58eecac467e62eadb8daaa6ed87e26
2020-03-09 11:29:45 +00:00
Automerger Merge Worker
ce07d8db04 Merge NetworkStatsService handler changes.
=====
Remove the need of accessing handler in NSS unit test

Currently, to wait for handler becomes idle, specific message
is used and the test would wait for condition variable to be
open when the message is processed.

However, this is already done in the HandlerUtils. Thus,
there is no need to post such message manually in the handler.

Test: atest FrameworksNetTests
Bug: 150664039

Change-Id: Iab32b2dbab01634ca159dcb90fc9f929d1fed1a2
=====
Remove setHandler in NetworkStatsService

Currently, internal handler is set by setHandler after
constructing NSS object. This was introduced in ag/866187 to
access the handler in the unit test.

However, the design put NSS in a bad situation where all classes
that need handler or executor could not be final and need to be
dynamically allocated in order to get a valid handler.

Thus, since the usage of handler is removed in previous patch,
this change eliminate setHandler by initializing the handler in
the constructor.

Test: atest FrameworksNetTests
Bug: 150664039

Change-Id: I794a24d00b0ca9fdc78091e7b9ab7307e0f034b7
=====

Bug: 150664039
Change-Id: If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7
Merged-In: If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7
(cherry picked from commit 2a6439d7e2)
2020-03-09 07:59:27 +00:00
Automerger Merge Worker
f2e3a9ce39 Ignore testReevaluateNetwork until Q
The method did not exist until Q, so the test is not relevant on such
devices.

Test: atest CtsNetTestCasesLatestSdk:android.net.CaptivePortalTest on Q
          and R devices
Bug: 150918852
Merged-In: I913b6eaa61bfd4f1964b324dcb4dd272aa8cc583
(cherry picked from commit 4d166d7bd9)

Change-Id: I2ddeee53d4ef63f01b791e3e95161194e29d3978
2020-03-09 06:34:01 +00:00
Automerger Merge Worker
be5d07953f Skip LinkAddress tests that are R-specific on Q
Address lifetime was added in R so tests for it should not be run on Q.

Test: CtsNetTestCasesLatestSdk:android.net.LinkAddressTest on both
          devices
Bug: 150918852
Merged-In: I98b14727eabcf569829eee8df34afc057eba6f93
(cherry picked from commit 4e00259d22)

Change-Id: I9599afa8ae64bb13c93d5f26ebedf3f8dedff6d9
2020-03-09 06:33:28 +00:00
Automerger Merge Worker
615fb51af9 Ignore NetworkAgentConfigTest on Q
NetworkAgentConfig did not exist on Q.

Test: atest CtsNetTestCasesLatestSdk:android.net.NetworkAgentConfigTest
          on Q and R devices
Bug: 150918852
Merged-In: I5414d7767c39327ff41673ff13ccd34982e10742
(cherry picked from commit d7fedf26d0)

Change-Id: I868398148d80afb73659df4d7312f1c2e245ead9
2020-03-09 06:32:14 +00:00
Chalard Jean
842b8d727d Merge "Remove the NetworkScore class." into rvc-dev 2020-03-09 05:54:30 +00:00
Automerger Merge Worker
7d66c267e7 Add more assertions to testStackedLinkProperties.
Check all routes that are added and removed instead of just some
of them. This is in preparation of an upcoming change that
switches to adding and creating routes by issuing direct calls to
netd.

Also rename the misleading ipv4Default route variable to
ipv4Subnet, which is what it actually is.

Bug: 142892223
Test: test-only change
Change-Id: I7d111382be215a926a7d7d4701bd3c3e94372b99
Merged-In: I7d111382be215a926a7d7d4701bd3c3e94372b99
(cherry picked from commit dcb35cb9a5)
2020-03-09 03:48:15 +00:00
Automerger Merge Worker
3d40f57841 Remove the NetworkScore class.
This class is useless at this point and introduces overhead.

Bug: 113554781
Test: FrameworksNetTests
Change-Id: Ib5f540070222865260c16c7182cc13c710a243c2
Merged-In: Ib5f540070222865260c16c7182cc13c710a243c2
(cherry picked from commit c3489ad3a6)
2020-03-09 03:46:34 +00:00
Automerger Merge Worker
d9375e4a5e test: ConnectivityService: Validate Route Add/Del
Validate route addition and deletion after linkProperties are
changed.

Bug: 142892223
Test: atest ConnectivityServiceTest#testStackedLinkProperties
Change-Id: I18296b933e856a0f8a4c1dbd75bd35024853bfbb
Merged-In: I18296b933e856a0f8a4c1dbd75bd35024853bfbb
(cherry picked from commit a22a979a0c)
2020-03-09 03:36:10 +00:00
Automerger Merge Worker
315e370184 test: LinkProperties: Unique Route Destinations
Routes will always have unique destinations. Update tests
to use unique destinations when adding multiple routes.

Bug: 142892223
Test: treehugger
Change-Id: I238899b0643407a1be29eb66d28728ca5d5dbc80
Merged-In: I238899b0643407a1be29eb66d28728ca5d5dbc80
(cherry picked from commit 891ea460b1)
2020-03-09 03:33:03 +00:00
JW Wang
45bf445ed4 Rewrite testBadApkOnly (1/n)
When tradefed fails to run a test, it will try to recover the device
which might lead to another reboot. This interferes with our test
flow which also involves reboot. See b/150749023#comment2 for more
details.

Let's rewrite the test to prevent auto-recovery of tradefed from kicking
in. Generally, it is a bad practice to depend our test flow on a failed
test due to reboot. We should call #waitForDeviceNotAvailable to wait
for reboot to happen and then call #waitForDeviceAvailable before
continuing next tests.

Bug: 150749023
Test: atest StagedRollbackTest#testBadApkOnly
Change-Id: Ia39630585c3b7344174a8c66d0a33f05a2d80cc7
2020-03-09 10:01:23 +08:00
Mathieu Chartier
644dac75e5 Merge "Make BootImageProfileTest less flaky" into rvc-dev 2020-03-06 19:45:05 +00:00
Mathieu Chartier
d5d442ddd9 Make BootImageProfileTest less flaky
Number one flake is when the system server process is killed before
SIGUSR1. Change this case to be non fatal.

Increase number of retry iterations in case the package manager
is very slow to start and get a JIT sample. Hopefully fixes the
other flake where PackageManagerService.<init> is not seen in the
profile.

Test: atest BootImageProfileTest
Bug: 149802360
Change-Id: I52ac80f15d8efe152dea81b75a82faa4da1b8600
2020-03-06 09:19:42 -08:00
Gavin Corkery
9d6ccbb6eb Add test for ExplicitHealthCheckService
Test the notifyHealthCheckPassed method to ensure that the expected
information is sent when an explicit health check passes.

Bug: 150638807
Test: atest ExplicitHealthCheckServiceTest
Change-Id: I98c1c3bf018a82ea769846b4212c295518814a18
2020-03-06 14:52:42 +00:00
Eugene Susla
47ca5d035e Generate @NonNull setter args and @MaySetToNull to opt out
Bug: 143653080
Test: source /usr/local/google/home/eugenesusla/android2/master/frameworks/base/tests/Codegen/runTest.sh
Change-Id: Iba8da34c91fd09e266429ab131add1d53449506b
(cherry picked from commit ab14c55c1f)
2020-03-05 23:54:43 +00:00
lucaslin
8c407bd646 Remove redundant connected notification
Remove the old connected notification since there is a new file
- NetworkStackNotifier.java which will send the connected
notification when captive portal validated.

Bug: 149883761
Test: 1. atest FrameworksNetTests
      2. Sign-in a captive portal and see if there is a redundant
      connected notification.

Change-Id: Id11a9b99dd04772a92af8d527104906c47bf64cd
Merged-In: Id11a9b99dd04772a92af8d527104906c47bf64cd
2020-03-05 06:48:12 +00:00
JW Wang
dac57a3e53 Merge "Do cleanup before/after running the test" into rvc-dev 2020-03-04 01:46:02 +00:00
Victor Hsieh
37aa47398d Merge "Put ApkVerityTest in vts-core" into rvc-dev 2020-03-04 00:50:37 +00:00
Victor Hsieh
e85baf47c2 Put ApkVerityTest in vts-core
VTS provides rootable environment for ApkVerityTest to run.
ApkVerityTest needs to write block device to verify the failure case of
fs-verity.

Test: see ApkVerityTests and block_device_writer in `unzip -l
      out/host/linux-x86/vts-core/android-vts-core.zip`
Bug: 150641206
Change-Id: Idc71907a28f68fc873c5cac940aa706e0b79843e
2020-03-03 14:43:33 -08:00
Jorim Jaggi
57157ac5d8 Fix WindowInsetsController lifecycle
Provide a recording insets controller before the window gets
created, and replay the commands once a view gets attached. This
allows the client to use the controller in Activity.onCreate.

Test: WindowInsetsControllerTests
Bug: 118118435
Change-Id: I1a825ecc4367c02b27f2d08cd5442325315d4f89
2020-03-03 15:12:15 +01:00
JW Wang
757a3bad2c Do cleanup before/after running the test
Somehow rollbacks related to testappA are not cleaned before running the
test and cause test failures. See b/150653097#comment2 for more details.

Let's clean rollbacks manually to have a clean start.

Bug: 150653097
Test: atest MultiUserRollbackTest
Change-Id: I4eb126e193f76c821d26fc62115263b86066a215
2020-03-03 16:17:57 +08:00
Ryan Mitchell
b390818c60 Merge "Allow activities/services to have app loaders" into rvc-dev 2020-03-03 00:40:40 +00:00
Chalard Jean
543ff5f068 Merge "Revert "Add public fields to NetworkScore and make it @SystemApi"" into rvc-dev 2020-03-02 23:32:58 +00:00
Sudheer Shanka
a903ed0d7a Merge "Add more blobstore related CTS tets." into rvc-dev 2020-03-02 22:47:47 +00:00
Ryan Mitchell
0cbfd2b12c Allow activities/services to have app loaders
When a service or activity attaches to a base context, add the
loaders from the application context to the base context. Activity
and service contexts are created before creating the Application
context, so in order to add the app loaders before the component
onCreate method is called, we must add the app loaders to the
component after the app has been initialized.

Bug: 148630842
Test: launch AppResourcesLoaders
Change-Id: I44aa718779c574094590d25fd839f1d9f9134edb
2020-03-02 20:54:13 +00:00
Sudheer Shanka
96b45378fa Add more blobstore related CTS tets.
Bug: 150619869
Test: atest --test-mapping apex/blobstore
Change-Id: I73ced7e340dc863a7b5895be23def1a8df87b74e
2020-03-02 11:32:11 -08:00
JW Wang
6033dd2c58 Override phenotype flags during tests
https://g3doc.corp.google.com/experiments/g3doc/mobile/phenotype/android/testing.md?cl=head#hermetic

Phenotype talks to a server to override the device config changes made
by the tests. Therefore, watchdog timeout didn't happen as expected and
caused tests to fail.

We need to override the flags on our own during tests so the
device config values ('watchdog_request_timeout_millis' in this case)
won't be changed in an unexpected way.

See b/148042585#comment21 for more details.

Bug: 148042585
Test: atest NetworkStagedRollbackTest
Change-Id: I4d8944f7fef93445de8f971c6a96fef7c71872db
2020-03-02 14:57:56 +08:00
TreeHugger Robot
78481dce89 Merge "Throw ProtoParseException for incomplete values" into rvc-dev 2020-02-28 22:59:52 +00:00
Chalard Jean
a11593c24e Revert "Add public fields to NetworkScore and make it @SystemApi"
This reverts commit a27e1eef14.

Bug: 113554781
Test: FrameworksNetTests FrameworksTelephonyTests FrameworksWifiTests
Change-Id: Ie1e84bd2a16f088307b195f924f4e49335cbe367
2020-02-28 06:26:27 +00:00
Michael Wachenschwanz
240896281b Throw ProtoParseException for incomplete values
Reading a corrupted stream/file could cause an infinite loop while
reading values. Throw an exception if unexpectedly reached the end of
the stream.

Bug: 150192344
Test: atest ProtoInputStreamTests
Change-Id: Ie660545152ba821be0c371dd1e3bf7235372bc6d
2020-02-27 17:44:14 -08:00
Mathieu Chartier
bdf7b312b2 Revert "Disable BootImageProfileTest presubmit"
This reverts commit 33b9bb815b.

Bug: 149802360
Reason for revert: Test is hopefully fixed

(cherry-picked from commit ac3eecfd8a)

Test: atest BootImageProfileTest

Merged-In: Ifc99b98d0b438f5c0d7ae29a9046c4fc5fe2cf21
Change-Id: Ifc99b98d0b438f5c0d7ae29a9046c4fc5fe2cf21
2020-02-27 10:06:12 -08:00
Mathieu Chartier
5c8a5051b3 Use shell commands instead of ITestDevice for BootImageProfile test
For some reason, ITestDevice property getting and setting is flaky on
GCE. This causes frequent test failures.

(cherry-picked from commit 94d9a21ccb)

Test: tested on cuddlefish device
Bug: 149802360

Merged-In: Iba48c173bdea2d55d8f2aa7f0fa382628582fe1c
Change-Id: Iba48c173bdea2d55d8f2aa7f0fa382628582fe1c
2020-02-25 12:44:02 -08:00
Mathieu Chartier
75446bc101 Make BootImageProfileTest less flaky
Use the system properties instead of phenotype since GMS can change the
values more arbitrarily for PH properties.

Test: manual
Bug: 149645847

(cherry-picked from commit 599079b381)

Merged-In: If0a716075597f45e95b8357480e4b4a7c52fbb2a
Change-Id: If0a716075597f45e95b8357480e4b4a7c52fbb2a
2020-02-25 12:41:38 -08:00
Gavin Corkery
025b96ee57 Merge "Ensure staged rollback status is logged on boot" into rvc-dev 2020-02-24 15:23:01 +00:00
Charles Chen
1ac295ec08 Revert "Revert "Always get window insets from server""
This reverts commit 288e1bd045.

The previous implementation of computeWindowInsets is to
use last view from WM#addView, which may be invalid because
the last added view is removed and throws NPE when getting
property from the invalid view.
In this CL, we change the approach to always obtain window
insets from server.

fixes: 148789183
fixes: 149480577
Test: atest FrameworksCoreTests:WindowMetricsTest
Test: atest WindowMetricsTests

Change-Id: I6db5970d14ac9eebe0ab0df65cb1300515ad1754
(cherry picked from commit 6bb2d4f68c)
2020-02-24 03:46:51 +00:00
Gavin Corkery
7c46fe3663 Ensure staged rollback status is logged on boot
In the cases that a logging parent cannot be found for any packages
in a rollback, the watchdog event should still be logged. Ensure
that the state of a rollback is captured on boot by removing the
condition of only saving a rollback id if there is a logging package,
and by adding a symbolic null package to the list of logging packages
on boot if none were found. Expand tests to verify.

Bug: 149957011
Test: atest StagedRollbackTest
Test: atest NetworkStagedRollbackTest
Change-Id: I56f8afb6730e59fbe67ea8747e0da3aca19a0d8a
2020-02-23 17:23:23 +00:00