Commit Graph

42743 Commits

Author SHA1 Message Date
Treehugger Robot
22b3daf4e5 Merge "Use appId for looking up allowed on restricted networks uids list" am: 02d7eb2abe am: 7d0eb2b22a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1773886

Change-Id: I3e65e9b03981ef0e470ab605c57154dfe214b705
2021-07-22 02:56:25 +00:00
Treehugger Robot
7d0eb2b22a Merge "Use appId for looking up allowed on restricted networks uids list" am: 02d7eb2abe
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1773886

Change-Id: I0a853cfa3abfec8588dc0bdc97aef60230206bb8
2021-07-22 02:21:16 +00:00
Treehugger Robot
02d7eb2abe Merge "Use appId for looking up allowed on restricted networks uids list" 2021-07-22 01:48:45 +00:00
Aaron Huang
4e0f5a50d9 [automerger skipped] Move battery unplug command to the beginning of the test am: 9a2f096870 -s ours
am skip reason: Merged-In I08b38d9955c8cbb2d680e268c29368a4c0a7d144 with SHA-1 a3debae1eb is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15344537

Change-Id: I15813be64ebdbb75ef1ec5eb7709562b4aba19e5
2021-07-21 14:27:50 +00:00
paulhu
25094906ff Use appId for looking up allowed on restricted networks uids list
aosp/1770606 change uid to appId when filling allowed on
restricted networks uids list. So add UserHandle.getAppId() to
ensure that uses appId for looking up the list.

Bug: 192116643
Test: atest FrameworksNetTests
Change-Id: I04fe3a77464d4cb02e7d53026f8f9a10bd0829e1
2021-07-21 17:45:38 +08:00
Paul Hu
be402a2c9d Merge "Change the url in testDownloadWithDownloadManagerDisallowed" am: 42cbf4ebab am: ca4a4a1b86
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1771008

Change-Id: I8544d24607cdab4d2e786d3a3c5646909a0e34f5
2021-07-21 07:29:01 +00:00
Aaron Huang
9a2f096870 Move battery unplug command to the beginning of the test
The test failed because the test generated traffic
before the unplug command really done.

The unplug command will eventually have onBattery changed
to true. If the traffic is generated before onBattery changed
to true, then the cellular stats won't be updated. And then,
when BatteryStatsService schedules a sync task to update the
stats which will get no delta because the stats on cellular
has already added to mLastModemNetworkStats. Thus, the test
will finally get failed.

Currently, the battery unplug command is executed after connecting
to cellular network and making sure wifi is disconnected which may
trigger battery stats service schedules sync tasks. If there are
too many tasks need to run, then change onBattery to true would
be later. Thus, move the unplug command to the beginning of the
test and add "dumpsys batterystats --write" which will wait for the
worker to finish the task before continuing. Thus, it can make sure
the batterystats are synced.

Also, the stats will be reset when the devices are unplugging after
the battery was last full or the level is 100, or have gone through
a significant charge. So, enable no-auto-reset to avoid the stats
getting reset during the test.

Bug: 192808200
Test: atest CtsNetTestCases:BatteryStatsManagerTest
Original-Change: https://android-review.googlesource.com/1769295
Merged-In: I08b38d9955c8cbb2d680e268c29368a4c0a7d144
Change-Id: I08b38d9955c8cbb2d680e268c29368a4c0a7d144
2021-07-21 07:25:55 +00:00
Paul Hu
ca4a4a1b86 Merge "Change the url in testDownloadWithDownloadManagerDisallowed" am: 42cbf4ebab
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1771008

Change-Id: I2546f362d5b338aad56afec489742a0b79ec0ca8
2021-07-21 07:11:49 +00:00
Paul Hu
42cbf4ebab Merge "Change the url in testDownloadWithDownloadManagerDisallowed" 2021-07-21 06:59:15 +00:00
Mark Chien
37600adae5 Merge "Replace throwErrnoException with JNIHelp jniThrowException" am: 7d36391ba4 am: 48c9201d28
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1769765

Change-Id: Iab62b2724d6a1187099b3e9b29ad7e96a0cd924c
2021-07-21 06:44:20 +00:00
Aaron Huang
0d80b279fe Merge "Move battery unplug command to the beginning of the test" am: 7691152162 am: ef23d08eed
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1769295

Change-Id: Ib85a821e6391b6b984d852ca79f2443f418de9c5
2021-07-21 06:44:14 +00:00
Mark Chien
48c9201d28 Merge "Replace throwErrnoException with JNIHelp jniThrowException" am: 7d36391ba4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1769765

Change-Id: I89b051b54202df96192dea0d868acce2b12159c6
2021-07-21 06:36:07 +00:00
Aaron Huang
ef23d08eed Merge "Move battery unplug command to the beginning of the test" am: 7691152162
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1769295

Change-Id: Idc76e3cc8268579f52ab98fbbc17aed34205ce99
2021-07-21 06:36:01 +00:00
Mark Chien
7d36391ba4 Merge "Replace throwErrnoException with JNIHelp jniThrowException" 2021-07-21 06:30:23 +00:00
Aaron Huang
7691152162 Merge "Move battery unplug command to the beginning of the test" 2021-07-21 06:18:08 +00:00
Junyu Lai
d92c090c61 Temporarily disable the test since prebuilt module is not updated am: c42a54f2a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15328937

Change-Id: I46fb4cad43fee89a6d4453c84db867cfc6374493
2021-07-21 03:04:50 +00:00
Junyu Lai
4e02bc437b [automerger skipped] Consider NetworkOffer is unneeded if it cannot satisfy the request am: 135f50679f -s ours
am skip reason: Merged-In Ie3ea59f980c3767782b8e6b03e401c02f664f9bd with SHA-1 dc3a7a39d4 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14730722

Change-Id: Ief6154e012e61ca879674eee8d664bcaf80d495d
2021-07-21 03:04:47 +00:00
Aaron Huang
a3debae1eb Move battery unplug command to the beginning of the test
The test failed because the test generated traffic
before the unplug command really done.

The unplug command will eventually have onBattery changed
to true. If the traffic is generated before onBattery changed
to true, then the cellular stats won't be updated. And then,
when BatteryStatsService schedules a sync task to update the
stats which will get no delta because the stats on cellular
has already added to mLastModemNetworkStats. Thus, the test
will finally get failed.

Currently, the battery unplug command is executed after connecting
to cellular network and making sure wifi is disconnected which may
trigger battery stats service schedules sync tasks. If there are
too many tasks need to run, then change onBattery to true would
be later. Thus, move the unplug command to the beginning of the
test and add "dumpsys batterystats --write" which will wait for the
worker to finish the task before continuing. Thus, it can make sure
the batterystats are synced.

Also, the stats will be reset when the devices are unplugging after
the battery was last full or the level is 100, or have gone through
a significant charge. So, enable no-auto-reset to avoid the stats
getting reset during the test.

Bug: 192808200
Test: atest CtsNetTestCases:BatteryStatsManagerTest
Change-Id: I08b38d9955c8cbb2d680e268c29368a4c0a7d144
2021-07-21 02:14:03 +08:00
Treehugger Robot
0305762d6c Merge changes I6e6b40b0,I6a0d93e0,Ie26f6e52 am: 1004c23b35 am: ef7274ca97
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1772430

Change-Id: Ib1c4033e9416f3295529b75ae3e6de8e0e105425
2021-07-20 15:08:39 +00:00
Remi NGUYEN VAN
d1a4e1b4c4 Merge "Bump Tethering apex version code for S" am: 8b3213f38e am: 8ea56369dc
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1768350

Change-Id: I702d805bd124b592ff1c44362872837b530a3fc9
2021-07-20 15:08:33 +00:00
Remi NGUYEN VAN
8dbbe19d37 [automerger skipped] Bump Tethering apex version code for R am: 4d535a4e51 -s ours
am skip reason: Merged-In Ia3d5f2201ce67308df8e2689f6c99e28049a4877 with SHA-1 997838cf13 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15334992

Change-Id: Id8222cd6629a3ca36c678dbd9d5f38c889311c6b
2021-07-20 15:08:27 +00:00
Treehugger Robot
ef7274ca97 Merge changes I6e6b40b0,I6a0d93e0,Ie26f6e52 am: 1004c23b35
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1772430

Change-Id: I5283354f545ef3f9b01f9327e2558314aab1f8f0
2021-07-20 14:56:44 +00:00
Remi NGUYEN VAN
8ea56369dc Merge "Bump Tethering apex version code for S" am: 8b3213f38e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1768350

Change-Id: I04242193776c2a35a6bfc91a4c966a52a30aaceb
2021-07-20 14:56:34 +00:00
Remi NGUYEN VAN
4d535a4e51 Bump Tethering apex version code for R
The version code in the manifest is only used for development
builds, as release builds dynamically replace it.

Tethering should have been using 309999900 during S development. That
version was used in many downstream branches, so make it consistent so
it can be bumped for S in all branches.

Bug: 193853555
Change-Id: Ia0e4edaa4fce24e9600fa1d47445b5109d8ee51e
Test: m com.google.android.tethering, check version code
Merged-In: Ia3d5f2201ce67308df8e2689f6c99e28049a4877
Merged-In: I0d4bd06e79adedbf582d2fed551d9f1bde521fd1
Merged-In: Ie3a058b904cb2e3704c3a0725c8f720f81bb235e
2021-07-20 13:18:12 +00:00
Treehugger Robot
1004c23b35 Merge changes I6e6b40b0,I6a0d93e0,Ie26f6e52
* changes:
  Revert "[CTT-5] Stop update TCP conntrack entry timeout"
  Revert "[CTT-6] Update TCP conntrack entry timeout while adding rules"
  Revert "[CTT-7] Delete the rules while half-closing tcp state entered"
2021-07-20 10:49:18 +00:00
markchien
083606292b Replace throwErrnoException with JNIHelp jniThrowException
Rather than adding throwErrnoException local function, using standard
jniThrowException in JNIHelp.h.

Also improve the readability:
1. Use throwIOException for
    jniThrowExceptionFmt(env, "java/io/IOException", ...);
2. Use throwSoecktException for
    jniThrowExceptionFmt(env, "java/net/SocketException", ...);
then the code can fit to one line.

Test: atest TetheringPrivilegedTests (ErrnoException is
test in BpfMapTest)
Change-Id: I396771e2c68e319f510d7a4ea5f263d18d7fad9d
2021-07-20 10:15:01 +00:00
paulhu
971c5fc0f8 Change the url in testDownloadWithDownloadManagerDisallowed
In China, "https://www.google.com" will redirect to url
"http://www.google.cn" but cleartext traffic is default disabled
for an app. So the testDownloadWithDownloadManagerDisallowed
would failed by cleartext traffic is not permitted. Thus, change
the url in the test which is reachable in China.

Bug: 192978910
Test: atest HostsideVpnTests#testDownloadWithDownloadManagerDisallowed
Change-Id: I992c3240f0e133f5b00468cbe85d1545bcf786b0
2021-07-20 17:44:26 +08:00
Remi NGUYEN VAN
88ce5927f8 [automerger skipped] Merge "Bump Tethering apex version code for R" am: 5bd49caf78 -s ours am: 35448220a6 -s ours
am skip reason: Merged-In Ia3d5f2201ce67308df8e2689f6c99e28049a4877 with SHA-1 997838cf13 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1771185

Change-Id: If2aae37b3e20ab114b880d1a3f256f29bf9fe04f
2021-07-20 09:26:01 +00:00
Remi NGUYEN VAN
35448220a6 [automerger skipped] Merge "Bump Tethering apex version code for R" am: 5bd49caf78 -s ours
am skip reason: Merged-In Ia3d5f2201ce67308df8e2689f6c99e28049a4877 with SHA-1 997838cf13 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1771185

Change-Id: Ic87443891c06402e68c6999af7c606f271f63107
2021-07-20 09:12:50 +00:00
Remi NGUYEN VAN
8b3213f38e Merge "Bump Tethering apex version code for S" 2021-07-20 09:00:45 +00:00
Remi NGUYEN VAN
5bd49caf78 Merge "Bump Tethering apex version code for R" 2021-07-20 09:00:37 +00:00
Nucca Chen
199e86dcb3 Revert "[CTT-5] Stop update TCP conntrack entry timeout"
This reverts commit a5c742be69.

Reason for revert:
Stop releasing this commit because it needs more test coverage.

Bug: 190783768
Bug: 192804833
Change-Id: I6e6b40b0f6207ed197d01bfabb616f1afa31fb70
Test: atest TetheringCoverageTests
2021-07-20 08:52:38 +00:00
Nucca Chen
254ba6b235 Revert "[CTT-6] Update TCP conntrack entry timeout while adding rules"
This reverts commit 299a81157c.

Reason for revert:
Stop releasing this commit because it needs more test coverage.

Bug: 190783768
Bug: 192804833
Change-Id: I6a0d93e04814ae73e1ec7d6fd4df19e1d2787207
Test: atest TetheringCoverageTests
2021-07-20 08:50:49 +00:00
Nucca Chen
7abf514272 Revert "[CTT-7] Delete the rules while half-closing tcp state entered"
This reverts commit 118b5b578a.

Reason for revert: 
Stop releasing this commit because it needs more test coverage.

Bug: 190783768
Bug: 192804833
Change-Id: Ie26f6e528999da42cfa66a5f6c1f187ad2276ae1
Test: atest TetheringCoverageTests
2021-07-20 08:47:13 +00:00
Treehugger Robot
855d6cdf05 Merge "Correct log" am: 913dba8be3 am: 3f6e40dbd7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1772285

Change-Id: I295f07a5621e20ad4cf1bfeafd8a4f57f00d96dd
2021-07-20 08:45:41 +00:00
Treehugger Robot
3f6e40dbd7 Merge "Correct log" am: 913dba8be3
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1772285

Change-Id: Iaa5c67c3c56ee39fee590ff8c2bed5e8731ea38d
2021-07-20 08:32:38 +00:00
Treehugger Robot
913dba8be3 Merge "Correct log" 2021-07-20 08:20:37 +00:00
Junyu Lai
c42a54f2a7 Temporarily disable the test since prebuilt module is not updated
This CL is subject to be reverted in a few days when the prebuilt
Connectivity module is updated.

Ignore-AOSP-First: This is for sc-dev and its downstreams only
Test: android.net.NetworkProviderTest
Bug: 189074532
Change-Id: I512552400960668c0ba91a8d997d1e2747209538
2021-07-20 05:58:08 +00:00
Junyu Lai
135f50679f Consider NetworkOffer is unneeded if it cannot satisfy the request
Currently, to prevent from network connect-teardown-loops that
caused by inaccurate reports, e.g. the provider always provides
a better network than the offer, the NetworkOffer is considered
needed if its provider is currently serving the request. This
is because there is no accurate way to know whether the offer is
corresponding to the network that is currently serving the
request.

However, if the offer cannot even satisfies the request, consider
the offer is needed does not make any sense. Since it can
never be the one that currently serving the request, nor be
the one that might beat current satisfier.

Test: android.net.NetworkProviderTest
Bug: 189074532
Original-Change: https://android-review.googlesource.com/1731452
Merged-In: Ie3ea59f980c3767782b8e6b03e401c02f664f9bd
Change-Id: Ie3ea59f980c3767782b8e6b03e401c02f664f9bd
2021-07-20 05:43:44 +00:00
Chiachang Wang
525b07d28a Correct log
Log should print the taken parameter instead of the value of
current variable

Test: m
Bug: 192149168
Change-Id: Ia3b9e607fe8b661a7faea3b46b9697fa85016440
2021-07-20 13:16:57 +08:00
Chiachang Wang
795d0c3574 Merge "Specify which callback is unexpected in tests" am: 5251171b75 am: 12a042be77
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1769289

Change-Id: I48948a8f04a2053cd24f153e1322df00fcedbf64
2021-07-20 01:49:11 +00:00
Chiachang Wang
c79dce9599 Merge "Deflake test to ensure system default network as expected" am: 575fa2f103 am: 250cf2af8a
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1764308

Change-Id: I34d1a75250faed18b734c68d9a0326ac46c645b4
2021-07-20 01:49:05 +00:00
Chiachang Wang
12a042be77 Merge "Specify which callback is unexpected in tests" am: 5251171b75
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1769289

Change-Id: I05d42c13e430d9f76fe75e2e73ce4e41cb662820
2021-07-20 01:36:27 +00:00
Chiachang Wang
250cf2af8a Merge "Deflake test to ensure system default network as expected" am: 575fa2f103
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1764308

Change-Id: I7deef58610d456bdcf0f1c1a93b861bf45653164
2021-07-20 01:36:22 +00:00
Chiachang Wang
5251171b75 Merge "Specify which callback is unexpected in tests" 2021-07-20 01:20:16 +00:00
Chiachang Wang
575fa2f103 Merge "Deflake test to ensure system default network as expected" 2021-07-20 01:20:07 +00:00
Treehugger Robot
dd1bb19405 Merge "Temporarily change uid to appId" am: 1e4d4001f4 am: 28a6b24430
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1770606

Change-Id: I21f33adcb478800139621a6730ab4740647711a9
2021-07-19 14:17:27 +00:00
Treehugger Robot
28a6b24430 Merge "Temporarily change uid to appId" am: 1e4d4001f4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1770606

Change-Id: I2fb613b4f846605e4643c5b21dd7d5cfac2a3cc3
2021-07-19 14:03:12 +00:00
Treehugger Robot
1e4d4001f4 Merge "Temporarily change uid to appId" 2021-07-19 13:47:18 +00:00
Treehugger Robot
19eaa44e9f Merge "Fix a flake with mocking." am: 527f040944 am: ec050a37ab
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1762391

Change-Id: Ie146448d14695a88688a37e5993504d527de9404
2021-07-19 12:51:20 +00:00