Commit Graph

42788 Commits

Author SHA1 Message Date
TreeHugger Robot
a542e19999 [automerger skipped] Merge "Update Tethering development module version numbers to 319999900" into sc-dev am: 5e0a824bb5 -s ours
am skip reason: Merged-In Ib8905a641780bed490a38327facee4a76e7770a3 with SHA-1 1d6e7d5117 is already in history

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

Change-Id: I66f7f31a0d6808f7a3d01034d17e6fc9cd58b819
2021-07-28 04:25:37 +00:00
TreeHugger Robot
5e0a824bb5 Merge "Update Tethering development module version numbers to 319999900" into sc-dev 2021-07-28 04:04:07 +00:00
Chiachang Wang
750b190d08 Merge "Retry and ignore ConcurrentModificationException" am: 93bda73970 am: 8a47dfb768
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1772444

Change-Id: I1e449a74117b45fe752decdc02ad3966ded36ef2
2021-07-27 09:35:51 +00:00
Chiachang Wang
8a47dfb768 Merge "Retry and ignore ConcurrentModificationException" am: 93bda73970
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1772444

Change-Id: Iffac4efceaac6b8d27b794c638ecb3358aeeff0a
2021-07-27 09:18:12 +00:00
Chiachang Wang
93bda73970 Merge "Retry and ignore ConcurrentModificationException" 2021-07-27 09:02:56 +00:00
Chiachang Wang
eb25674b5c Retry and ignore ConcurrentModificationException
The flaky callstack shows that it hits the exception in the
initialization of HashSet. The mNetworkRequests is accessed in
the ConnectivityService handler thread except dump(). The
ConcurrentModificationException should not happen in the other
flow. Thus, retry to get the current requests when the dump()
hits the ConcurrentModificationException to prevent flaky test.

Bug: 188373832
Test: atest ConnectivityServiceTest#testDumpDoesNotCrash\
      --iteration 100
Change-Id: I9625919faf947c9488764b92093ed8105271c927
2021-07-27 15:13:52 +08:00
Sudheer Shanka
35c7136ded Merge "Verify apps cannot receive ACTION_SNOOZE_WARNING broadcast." into sc-dev am: 69fbdff0ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/14824710

Change-Id: I44f18fc11d7113dec10f8cbd3b18fe7e1f97554f
2021-07-27 05:27:20 +00:00
Sudheer Shanka
69fbdff0ed Merge "Verify apps cannot receive ACTION_SNOOZE_WARNING broadcast." into sc-dev 2021-07-27 05:13:23 +00:00
Chalard Jean
0a5b0b19e5 Merge "Fix a possible system server crash" am: 51176d0a67 am: d79bd5c622
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1771187

Change-Id: Id71b3d6e530a053b1950ed9cecbf74a83b36b4e8
2021-07-27 05:12:15 +00:00
Chalard Jean
d79bd5c622 Merge "Fix a possible system server crash" am: 51176d0a67
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1771187

Change-Id: Iddab205cf2754d326be816e6e8e92c2cc0b95771
2021-07-27 04:54:52 +00:00
Chalard Jean
51176d0a67 Merge "Fix a possible system server crash" 2021-07-27 04:37:43 +00:00
Chalard Jean
5bcc838f4e Fix a possible system server crash
The scenario is as follows : an app registers a network callback,
then unregisters it and dies immediately after. In this scenario,
the system server will receive a notification of the binder death
and enqueue a call to handleRemoveNetworkRequest. If the callback
unregister message has been process first, this call would result
in unlinkToDeath being called twice on the same Binder, crashing.
This patch fixes the problem by using handleReleaseNetworkRequest
instead of Remove, which looks up the NRI in a map on the handler
thread before calling Remove, returning without doing anything if
the NRI has already been removed.

Test: ConnectivityServiceTest
Test: New test for this
Bug: 194394697
Change-Id: I82a28c37450146838410bf5a059aac295a985fca
2021-07-27 04:37:29 +00:00
Chalard Jean
8d83bc0aed Merge "Remove a useless comment" am: c486f0248b am: dcd4438dfa
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1777769

Change-Id: Ie372ac7544afa86dd6c8f1298974e307e76f08b3
2021-07-27 03:25:33 +00:00
Chalard Jean
dcd4438dfa Merge "Remove a useless comment" am: c486f0248b
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1777769

Change-Id: Ie0e10e4d2f9500271cd83ef8498c5d13d8d338b0
2021-07-27 03:12:56 +00:00
Chalard Jean
c486f0248b Merge "Remove a useless comment" 2021-07-27 02:59:41 +00:00
Chalard Jean
f126170e98 Remove a useless comment
b/145383354 is obsolete and this works as is (or we'd have found
out by now). Also min SDK version is set in the bp file and
would be overridden anyway.

Test: comment-only change
Change-Id: I6ad3263557ef67aa642672863eed82a312c2ab40
2021-07-27 02:59:11 +00:00
Sudheer Shanka
7bbbdbd4f9 Verify apps cannot receive ACTION_SNOOZE_WARNING broadcast.
Bug: 177931370
Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Ignore-AOSP-First: Platform changes related to this are not in AOSP yet.
Change-Id: I6d525c4d88ba01838d51a873251593281b628898
2021-07-26 15:51:09 +00:00
Chiachang Wang
0fcf1cf17f Merge "Remove DISCONNECTING check from handleReportNetworkConnectivity" am: 9ad8acd76e am: ad07afc824
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1772439

Change-Id: I7a33259e571db42018d3f346bef4c3f71c586a0c
2021-07-26 11:21:48 +00:00
Chiachang Wang
ad07afc824 Merge "Remove DISCONNECTING check from handleReportNetworkConnectivity" am: 9ad8acd76e
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1772439

Change-Id: I66569d993972c82400eb5583f182bedea9d75a54
2021-07-26 11:11:30 +00:00
Chiachang Wang
9ad8acd76e Merge "Remove DISCONNECTING check from handleReportNetworkConnectivity" 2021-07-26 10:58:58 +00:00
Paul Hu
0ce97e66c6 Merge "Address aosp/1740740 leftover comments" am: 1975a57e83 am: 1e594fa4db
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1775928

Change-Id: Ia63b7b3720e73378ccb509116ce5366913392526
2021-07-26 10:21:28 +00:00
Paul Hu
1e594fa4db Merge "Address aosp/1740740 leftover comments" am: 1975a57e83
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1775928

Change-Id: I8a901187e66a5f6dade6dfe36951949dcf80d458
2021-07-26 10:09:26 +00:00
Paul Hu
1975a57e83 Merge "Address aosp/1740740 leftover comments" 2021-07-26 09:49:27 +00:00
TreeHugger Robot
38211c3850 [automerger skipped] Merge "Change the url in testDownloadWithDownloadManagerDisallowed" into sc-dev am: 26848924ea -s ours
am skip reason: Merged-In I992c3240f0e133f5b00468cbe85d1545bcf786b0 with SHA-1 971c5fc0f8 is already in history

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

Change-Id: I89dba015680f04db1d3da8d5660cbdcaaaac95e9
2021-07-26 09:19:21 +00:00
Treehugger Robot
e3e529150f Merge "Add TetheringPrivilegedTests to postsubmit" am: 94ef708b7d am: 6971e4811f
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1771186

Change-Id: I644b99720cf5af80c26f0f0ee12c49918f0895ef
2021-07-26 09:15:51 +00:00
TreeHugger Robot
26848924ea Merge "Change the url in testDownloadWithDownloadManagerDisallowed" into sc-dev 2021-07-26 09:04:54 +00:00
Treehugger Robot
6971e4811f Merge "Add TetheringPrivilegedTests to postsubmit" am: 94ef708b7d
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1771186

Change-Id: I7c3e01900da2ef73aed6d2cccb15d2ea9e789cb1
2021-07-26 08:59:37 +00:00
Treehugger Robot
94ef708b7d Merge "Add TetheringPrivilegedTests to postsubmit" 2021-07-26 08:50:07 +00:00
Paul Hu
deaebe4818 Merge "Rename PREFERENCE_PRIORITY_* to PREFERENCE_ORDER_*" am: 0e3b1e0b57 am: 02c83293d6
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1764732

Change-Id: I59b79a72ae8237997eae4b23b1a91e2cb40674a8
2021-07-26 08:35:49 +00:00
Paul Hu
02c83293d6 Merge "Rename PREFERENCE_PRIORITY_* to PREFERENCE_ORDER_*" am: 0e3b1e0b57
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1764732

Change-Id: Ie77a33aedbb7e68c89c5aaf15fe6f4cce344f283
2021-07-26 08:24:20 +00:00
Paul Hu
0e3b1e0b57 Merge "Rename PREFERENCE_PRIORITY_* to PREFERENCE_ORDER_*" 2021-07-26 08:12:42 +00:00
Paul Hu
b08d0afb87 [automerger skipped] Merge "Temporarily change uid to appId" into sc-dev am: 9bcaabb91c -s ours
am skip reason: Merged-In Iadec66344d88bd80170cd5441270b768cdbe0917 with SHA-1 0433dd20b7 is already in history

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

Change-Id: I62d71d1ca1e9ce5b007542cfd21ead5239537cc4
2021-07-26 08:10:38 +00:00
Treehugger Robot
40c0c92867 [automerger skipped] Use appId for looking up allowed on restricted networks uids list am: 3c42fedeb5 -s ours
am skip reason: Merged-In I04fe3a77464d4cb02e7d53026f8f9a10bd0829e1 with SHA-1 25094906ff is already in history

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

Change-Id: I6978fce1b806ba94d38bf25d86fa482505fc5907
2021-07-26 08:10:33 +00:00
Paul Hu
9bcaabb91c Merge "Temporarily change uid to appId" into sc-dev 2021-07-26 07:55:56 +00:00
markchien
911cf8fecd Add TetheringPrivilegedTests to postsubmit
Also ignore DadProxyTest before S because it is only enabled from S.

To using ignore test rule, replace AndroidJunit with DevSdkIgnoreRunner.
It is fine because the we don't use the test UI (e.g. running test in UI
thread).

Test: atest TetheringPrivilegedTests
Change-Id: I701ee877520f78ded2394adbae1f4d9dd612d700
2021-07-26 02:17:19 +00:00
paulhu
fa2f7171af Address aosp/1740740 leftover comments
- Use SystemClock.sleep instead.
- Shorten the waiting time.

Bug: 185149952
Test: atest ConnectivityManagerTest#testUidsAllowedOnRestrictedNetworks
Change-Id: I82221a61bdddf6dc8147b3a29c873ca6c8b05e93
2021-07-23 15:20:06 +08:00
Luke Huang
227f003cbe Merge "Modify Nsd{Service,Manager}Test to conform to its change" into sc-dev am: 3c20df39d0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15320525

Change-Id: Ifd8002745d97881414c29faa05820328e4833ae6
2021-07-22 03:26:43 +00:00
Treehugger Robot
3c42fedeb5 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
Original-Change: https://android-review.googlesource.com/1773886
Merged-In: I04fe3a77464d4cb02e7d53026f8f9a10bd0829e1
Change-Id: I04fe3a77464d4cb02e7d53026f8f9a10bd0829e1
2021-07-22 03:19:56 +00:00
Luke Huang
3c20df39d0 Merge "Modify Nsd{Service,Manager}Test to conform to its change" into sc-dev 2021-07-22 03:00:35 +00:00
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
Paul Hu
92c911da01 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
Original-Change: https://android-review.googlesource.com/1771008
Merged-In: I992c3240f0e133f5b00468cbe85d1545bcf786b0
Change-Id: I992c3240f0e133f5b00468cbe85d1545bcf786b0
2021-07-21 10:17:38 +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
Luke Huang
952a55c62d Modify Nsd{Service,Manager}Test to conform to its change
Test: atest NsdManagerTest NsdServiceTest
Bug: 191844585
Change-Id: I3cf658498bef5755dcb01127a94fff913b6e6298
Ignore-AOSP-First: To avoid the side effect caused by automerger.
2021-07-21 08:02:26 +00: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