Commit Graph

11579 Commits

Author SHA1 Message Date
Treehugger Robot
e42273a5f7 Merge "[Mainline] Network netId to getNetId() migration" am: cd20ac9243 am: 249e8cab99
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1520637

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ifd1771c329d6b4c45f85d32cf44a7499efddcbfb
2020-12-10 09:43:15 +00:00
Treehugger Robot
249e8cab99 Merge "[Mainline] Network netId to getNetId() migration" am: cd20ac9243
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1520637

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I65d8843281e3c3fe15141ad2583955e069339413
2020-12-10 09:11:10 +00:00
Lorenzo Colitti
5bbcd79710 Merge changes I6eb6d92b,I638e29fd,I2348b7a3 am: 0da448710c am: 3ff54c739f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1521657

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6de299ec480f1a34042d2ef2ee86f00d030510e8
2020-12-10 09:02:40 +00:00
Treehugger Robot
cd20ac9243 Merge "[Mainline] Network netId to getNetId() migration" 2020-12-10 08:47:27 +00:00
Lorenzo Colitti
3ff54c739f Merge changes I6eb6d92b,I638e29fd,I2348b7a3 am: 0da448710c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1521657

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I87704813daaf2a0b4495a835abde950e683993e5
2020-12-10 08:32:15 +00:00
Lorenzo Colitti
0da448710c Merge changes I6eb6d92b,I638e29fd,I2348b7a3
* changes:
  Add a convenience method to update a network's capabilities.
  Disallow NetworkAgents from changing the owner UID.
  Observe mOwnerUID in NetworkCapabilities#equals.
2020-12-10 08:11:52 +00:00
Xin Li
8fdc3926b5 [automerger skipped] Merge "DO NOT MERGE - Merge Android R QPR1" am: 0ee91db1db -s ours am: 13e5f8e80d -s ours
am skip reason: Change-Id Ib81ba3288a986546bc570c3759c55d026add591a with SHA-1 3cfbcbee16 is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1520888

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ic11fc264d783e729729854a5f7f7b03d38d43e3e
2020-12-10 03:47:00 +00:00
Xin Li
13e5f8e80d [automerger skipped] Merge "DO NOT MERGE - Merge Android R QPR1" am: 0ee91db1db -s ours
am skip reason: Change-Id Ib81ba3288a986546bc570c3759c55d026add591a with SHA-1 3cfbcbee16 is in history

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1520888

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1158b1e4f70b018504c963a76782c8773f698118
2020-12-10 03:05:40 +00:00
Xin Li
0ee91db1db Merge "DO NOT MERGE - Merge Android R QPR1" 2020-12-10 02:18:27 +00:00
Xin Li
033b5e8ba3 DO NOT MERGE - Merge Android R QPR1
Bug: 172690556
Merged-In: Ib81ba3288a986546bc570c3759c55d026add591a
Change-Id: I2acfeb6cfc83a80056a685355cc367a5514da069
2020-12-09 17:55:44 -08:00
Serik Beketayev
402f439ac1 Merge "[Mainline Migration] Migrate NetworkUtils" am: 8339b3ded3 am: 59f81edbdb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1498168

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I4f91f6de3af919fff42383ba86617112624c8292
2020-12-10 00:49:48 +00:00
Serik Beketayev
59f81edbdb Merge "[Mainline Migration] Migrate NetworkUtils" am: 8339b3ded3
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1498168

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Icc0a49e76f87a741f4410b53e9a40012e37fde36
2020-12-10 00:08:03 +00:00
Serik Beketayev
8339b3ded3 Merge "[Mainline Migration] Migrate NetworkUtils" 2020-12-09 23:47:05 +00:00
Lorenzo Colitti
00e0f5af3e Add a convenience method to update a network's capabilities.
Almost all calls to ConnectivityService#updateCapabilities use
all the current data in the network, and thus call the method
like this:

    updateCapabilities(nai.getCurrentScore(), nai, nai.networkCapabilities);

Introduce a convenience method to simplify this frequent use case.

Bug: 173331190
Test: passes existing ConnectivityService tests
Change-Id: I6eb6d92bd159f2575d10a929bd59f6dd1b7a4b4e
2020-12-10 00:41:06 +09:00
Lorenzo Colitti
39b4c5b2da Disallow NetworkAgents from changing the owner UID.
The current behaviour with regards to changing the owner UID is
bizarre and arguably incorrect. A NetworkAgent can change the
owner to whatever other app it wants, regardless of signatures,
at any time. This includes, for example, transferring ownership
to another UID and then recovering it.

Fortunately no existing NetworkAgent appears to do this:
- ClientModeImpl sets it to the UID of the app that created the
  configuration. It doesn't look like it can change while the
  network is connected.
- Vpn sets it to the UID of the VPN owner. That also can't change.
- Telephony does not appear to set it at all, it only sets the
  administrator UIDs (and updates them whenever it gets
  EVENT_CARRIER_PRIVILEGED_UIDS_CHANGED).

Disallow this now before code is written that depends on it.

Bug: 175188445
Test: modified tests in ConnectivityServiceTest
Change-Id: I638e29fda2481ec3bf4fff562ea66a73322881df
2020-12-09 19:47:17 +09:00
Lorenzo Colitti
cb9bbf2c80 Observe mOwnerUID in NetworkCapabilities#equals.
Currently, NetworkCapabilities's equals and hashCode methods
ignore mOwnerUID. This is confusing because it is inconsistent
with pretty much every other member of this class.

Bug: 175188445
Test: atest CtsNetTestCases:NetworkAgentTest \
            CtsNetTestCases:Ikev2VpnTest \
	    CtsNetTestCases:VpnServiceTest HostsideVpnTests \
	    CtsNetTestCases:android.net.cts.ConnectivityDiagnosticsManagerTest \
	    ConnectivityServiceTest com.android.server.connectivity.VpnTest
Change-Id: I2348b7a35f32a931687f2d3c2fa57620a12fe06f
2020-12-09 19:33:32 +09:00
Serik Beketayev
284cb871fa [Mainline] Network netId to getNetId() migration
Bug: 175085315
Test: atest
Change-Id: I3d7366ba1e60be3ff7c6dd6c589db760b182136b
2020-12-08 16:34:38 -08:00
Cody Kesting
1338b6c158 [automerger skipped] Merge "Allow the System UID to unregister ConnDiags CBs." into rvc-qpr-dev am: 07dd48319d -s ours
am skip reason: Change-Id I20d0cad5f902708d366aa703c2893b0ea3e55052 with SHA-1 054451e170 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13169565

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I9cdd7edda3f94d66aa7e0bdc6daaaf5a08b360c0
2020-12-08 19:52:11 +00:00
Lorenzo Colitti
8e44d9d778 Merge "Test for the current behaviour of updating a network's owner UID." am: aafcaa9fb5 am: 62976a3a26
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512690

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7ed6c0ba300b34e84db911cbe9554f63712e2a1c
2020-12-08 10:47:15 +00:00
Lorenzo Colitti
62976a3a26 Merge "Test for the current behaviour of updating a network's owner UID." am: aafcaa9fb5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512690

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I35a50be2f748177cde9400449386465d77a21556
2020-12-08 09:55:56 +00:00
Lorenzo Colitti
aafcaa9fb5 Merge "Test for the current behaviour of updating a network's owner UID." 2020-12-08 09:10:08 +00:00
Lorenzo Colitti
4c0f2da4ea Merge "Add comments to the process*FromAgent methods." am: 300f6e7669 am: cba9e716fc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519518

Change-Id: I9d3d9d49fe6118edc4357edc1350d1f2b89f4b2a
2020-12-07 17:34:04 +00:00
Lorenzo Colitti
cba9e716fc Merge "Add comments to the process*FromAgent methods." am: 300f6e7669
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519518

Change-Id: Ia90b3ae008561b2ec3723770802815b46937022e
2020-12-07 17:07:08 +00:00
Lorenzo Colitti
300f6e7669 Merge "Add comments to the process*FromAgent methods." 2020-12-07 16:44:11 +00:00
Lorenzo Colitti
76a1031d33 Test for the current behaviour of updating a network's owner UID.
The current behaviour is at least bizarre and arguably incorrect.
Add a test to document the current behaviour so we can check that
any changes we make to this behaviour are correct.

Test: test-only change
Change-Id: I345bd320eced96316d92e520f576ae06b8020d9f
2020-12-08 01:40:47 +09:00
Lorenzo Colitti
3c75ca829e Add comments to the process*FromAgent methods.
Test: comment-only change
Change-Id: I5ebf6e21d79ed669f85ddf9bf466236d4bd59243
2020-12-08 01:17:17 +09:00
Serik Beketayev
88bf984e07 [Mainline Migration] Migrate NetworkUtils
Migrating makeStrings(), numericToInetAddress() APIs

Bug: 173089079
Test: atest FrameworksNetTests
Change-Id: Ie914fd41bc3ce16d07f5d2768b89ce805b9245a9
2020-12-06 22:33:04 -08:00
Lorenzo Colitti
964daa1a04 Merge "Add a test for TcpKeepalivePacketDataParcelable.toString()." am: ee3c193706 am: 4f4ac4840d
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1502382

Change-Id: Id6951382cd12dff2e4f1bd2fe47d063c8998fc2f
2020-12-07 05:18:13 +00:00
Lorenzo Colitti
4f4ac4840d Merge "Add a test for TcpKeepalivePacketDataParcelable.toString()." am: ee3c193706
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1502382

Change-Id: Ib92977574ffb28cd2e455328260f215352f24b32
2020-12-07 04:43:19 +00:00
Lorenzo Colitti
ee3c193706 Merge "Add a test for TcpKeepalivePacketDataParcelable.toString()." 2020-12-07 04:38:53 +00:00
Cody Kesting
8a1fc4cc51 Allow the System UID to unregister ConnDiags CBs.
This CL updates ConnectivityService to allow the System's UID to
unregister ConnectivityDiagnostics callbacks. Preivously, only the
registrant was allowed to unregister them - this caused problems for
callbacks that were attempted to be unregistered via binderDied() when
the registrant app dies.

Bug: 159912975
Bug: 174713659
Test: manually verified
Change-Id: I20d0cad5f902708d366aa703c2893b0ea3e55052
Merged-In: I20d0cad5f902708d366aa703c2893b0ea3e55052
(cherry picked from commit 6d675b48b2)
2020-12-04 20:46:52 +00:00
Cody Kesting
785ef9b4cd Merge "Allow the System UID to unregister ConnDiags CBs." am: 636f8cbced am: 5d0cc85448
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1515688

Change-Id: I5b6a900611b727ee58a5b1f2762ed10b5a24fe44
2020-12-04 18:01:04 +00:00
Cody Kesting
5d0cc85448 Merge "Allow the System UID to unregister ConnDiags CBs." am: 636f8cbced
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1515688

Change-Id: Ia82d68661c99ed5123f2a0668aec4afd5ea48cf5
2020-12-04 17:47:45 +00:00
Cody Kesting
636f8cbced Merge "Allow the System UID to unregister ConnDiags CBs." 2020-12-04 17:35:28 +00:00
Remi NGUYEN VAN
0249d5b5fa Merge "Use IPV6_MIN_MTU from NetworkConstants in Ikev2Vpn" am: ab2944488f am: 1ebf8bfe18
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512879

Change-Id: I516719d803ccd2b4cda91eb38ecd108babab50b8
2020-12-04 04:12:18 +00:00
Remi NGUYEN VAN
1ebf8bfe18 Merge "Use IPV6_MIN_MTU from NetworkConstants in Ikev2Vpn" am: ab2944488f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512879

Change-Id: I2458f7ab7ad2d65bf8c697b7a6aa40394cdc0605
2020-12-04 03:50:19 +00:00
Remi NGUYEN VAN
ab2944488f Merge "Use IPV6_MIN_MTU from NetworkConstants in Ikev2Vpn" 2020-12-04 02:05:01 +00:00
Cody Kesting
054451e170 Allow the System UID to unregister ConnDiags CBs.
This CL updates ConnectivityService to allow the System's UID to
unregister ConnectivityDiagnostics callbacks. Preivously, only the
registrant was allowed to unregister them - this caused problems for
callbacks that were attempted to be unregistered via binderDied() when
the registrant app dies.

Bug: 159912975
Bug: 174713659
Test: manually verified
Change-Id: I20d0cad5f902708d366aa703c2893b0ea3e55052
2020-12-03 17:43:50 -08:00
Patrick Rohr
5fda0bd0af Merge changes from topic "restricted-networking-mode" am: 1d156cb04e am: 83711b9a0b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1505234

Change-Id: I1ae2656e91f1fa6b35ea34177496bd9ad23daceb
2020-12-03 11:51:32 +00:00
Patrick Rohr
9653c209c6 Clean Up NetworkManagementService Tests am: e7c4a3e7b5 am: 34d43318e1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1505233

Change-Id: Icaee85a789737c2b10f01aa7d7a669e9f7385bd7
2020-12-03 11:51:31 +00:00
Aaron Huang
2f5372d922 Merge "Migrate Slog to Log used in connectivity service module" am: 78265b923a am: 6a36ac8b12
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1483963

Change-Id: I5ac218b548b138504d49c5f22dcf170ee0d07847
2020-12-03 11:50:59 +00:00
Patrick Rohr
83711b9a0b Merge changes from topic "restricted-networking-mode" am: 1d156cb04e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1505234

Change-Id: I5e1d114c34e185d0b7f9bc68772431065d852dd0
2020-12-03 11:41:07 +00:00
Patrick Rohr
34d43318e1 Clean Up NetworkManagementService Tests am: e7c4a3e7b5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1505233

Change-Id: Ia14b1784f36d54f0ba73d5841afedcf8a55a18f2
2020-12-03 11:36:15 +00:00
Aaron Huang
6a36ac8b12 Merge "Migrate Slog to Log used in connectivity service module" am: 78265b923a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1483963

Change-Id: Ifc655142710654983dc969398f75fd84a2bc0c6e
2020-12-03 10:58:16 +00:00
Patrick Rohr
1d156cb04e Merge changes from topic "restricted-networking-mode"
* changes:
  Add Restricted Mode Firewall Chain
  Clean Up NetworkManagementService Tests
2020-12-03 10:50:25 +00:00
Aaron Huang
78265b923a Merge "Migrate Slog to Log used in connectivity service module" 2020-12-03 10:17:45 +00:00
Xin Li
8cb242af98 [automerger skipped] Merge "Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855" into stage-aosp-master am: 93a76f8e40 -s ours
am skip reason: Change-Id I78222391b83a4add8e964340ec08bb8a1306e1c6 with SHA-1 07ec9b4dcb is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13120883

Change-Id: I72cd2486ff8473dcbdef76bc855e4fe45927b943
2020-12-03 04:25:31 +00:00
Xin Li
93a76f8e40 Merge "Merge rvc-qpr-dev-plus-aosp-without-vendor@6881855" into stage-aosp-master 2020-12-03 03:18:49 +00:00
Remi NGUYEN VAN
bcd4d930bc Merge "Do not query CS in NetworkProvider constructor" am: 6a6e5f8479 am: 0d1b3960e8
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512873

Change-Id: Ie9914abd1527c6478f69a0d27e64b69174badd5d
2020-12-03 02:51:19 +00:00
Remi NGUYEN VAN
0d1b3960e8 Merge "Do not query CS in NetworkProvider constructor" am: 6a6e5f8479
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1512873

Change-Id: I227076074a2d58a4b9e5e8aaa972c6338887f568
2020-12-03 02:17:16 +00:00