Commit Graph

8097 Commits

Author SHA1 Message Date
markchien
a0f8fd92fd Replace ConnectivityManager constants to TetheringManager
Replace some ConnectivityManager constants as TetheringManager inside
tethering module. No API change, will have follow up CL to delete
@hide tethering constants in ConnectivityManager and replace caller
to using TetheringManager.

Bug: 144753389
Test: build
Change-Id: Ia1b963669722c32d147375763205ed2f3af52fed
2020-01-08 15:06:09 +00:00
Lorenzo Colitti
78185eae90 Refactor NetworkFactoryInfo to hide implementation details.
This is in preparation for introducing NetworkProvider, which
will initially share ConnectivityService code with NetworkFactory.

Bug: 138306002
Test: atest FrameworksNetTests
Change-Id: Ic6f888621f473342ee3fe8fedf9411552111342b
2020-01-08 23:40:42 +09:00
Artur Satayev
9c2add6fcc Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I0c336de56bc4a041dc97ff9b7927f62f0b44b457
Merged-In: I0c336de56bc4a041dc97ff9b7927f62f0b44b457
2020-01-08 14:04:40 +00:00
Automerger Merge Worker
3ab3ff6156 Merge "Add FrameworksNetIntegrationTests to postsubmit" am: 9a00f5be3b am: f4767ccfc0
Change-Id: I9e25954eb1ebe7bfd2525c32d2edb6a8b47a66f1
2020-01-07 13:18:35 +00:00
Remi NGUYEN VAN
f4767ccfc0 Merge "Add FrameworksNetIntegrationTests to postsubmit"
am: 9a00f5be3b

Change-Id: I3384970a0a961dfaaf10229ed9e5d39c4f552256
2020-01-07 05:05:45 -08:00
Remi NGUYEN VAN
9a00f5be3b Merge "Add FrameworksNetIntegrationTests to postsubmit" 2020-01-07 12:16:34 +00:00
Automerger Merge Worker
e7294ecb17 Merge "Change tetheroffloadjni to tetheringutilsjni" am: 0af9d37eca am: d248c13bda
Change-Id: I913f33213bf208ef7733871222e57a21f0d460e6
2020-01-07 09:25:49 +00:00
markchien
d248c13bda Merge "Change tetheroffloadjni to tetheringutilsjni"
am: 0af9d37eca

Change-Id: I48207d95cf6f512ec038fb5dc9ba4009c01d676d
2020-01-07 01:12:30 -08:00
Treehugger Robot
0af9d37eca Merge "Change tetheroffloadjni to tetheringutilsjni" 2020-01-07 09:05:43 +00:00
markchien
d53edf736f Change tetheroffloadjni to tetheringutilsjni
Rename tetheroffloadjni to tetheringutilsjni and move setupRaSocket
jni method from NetUtils into tetheringutilsjni.

Bug: 143195885
Test: -build, flash, boot
      -atest TetheringTests
      -Off/On hotspot with ipv6 upstream

Change-Id: Ib68eb6999bbe2d3ca97e68712f22b105311ef800
2020-01-07 07:42:13 +00:00
Automerger Merge Worker
2a55907ecf Merge changes If28f0be6,If0f80067 am: 96529ad7fc am: 21dd220d3e
Change-Id: I3d554c7ac0cf77aa2a80655d77c0e5bfb737dbdc
2020-01-07 07:16:15 +00:00
Lorenzo Colitti
21dd220d3e Merge changes If28f0be6,If0f80067
am: 96529ad7fc

Change-Id: I108d3c36ce11af544ccfed9291dc38c690724915
2020-01-06 23:03:04 -08:00
Lorenzo Colitti
279a1d6620 Make LinkPropertiesTest pass, and fix an NPE.
aosp/973686 added the DHCP server address to LinkProperties, but
it did not have any tests, and would throw NPE when parceling a
LinkProperties that did not have a DHCP server.

Add tests and fix the bug.

Bug: 134098566
Test: unit test now passes
Change-Id: If28f0be650963e8d9af7eb53f6940824582a2db3
2020-01-07 13:02:32 +09:00
ruibin zhang
ca75bc897d Add the DHCP server address to LinkProperties.
Bug: 134098566
Test: see subsequent CL in topic
Change-Id: If0f80067934189137c87cd379e7ae47b187562fd
2020-01-07 01:21:07 +09:00
Remi NGUYEN VAN
0b197df422 Add FrameworksNetIntegrationTests to postsubmit
After checking flake metrics for this test, it can be added in
presubmit.

Test: this change is to check results in postsubmit
Change-Id: I70cb149629a3e959e29cfd21048e7b148bd29fe9
2020-01-06 22:03:43 +09:00
Automerger Merge Worker
94cf06f1db Merge "Add permissions for FrameworksNetIntegrationTests" am: eb1eac5931 am: 5263193189
Change-Id: Ied4f6bbefbe81032e3cadca667771b5a64e75304
2020-01-06 05:19:54 +00:00
Paul Hu
5263193189 Merge "Add permissions for FrameworksNetIntegrationTests"
am: eb1eac5931

Change-Id: I27ecd6182ff3794098b6486cb48736df7a849b0e
2020-01-05 21:07:51 -08:00
paulhu
6c3b3a494f Add permissions for FrameworksNetIntegrationTests
The protected permissions were changed in some connectivity APIs
since aosp/1099096. Add required permissions for
FrameworksNetIntegrationTests.

Bug: 147121740
Test: atest FrameworksNetIntegrationTests
Change-Id: I38ba5c8e93fd5bc94371b2a02a280f503f2e1367
2020-01-06 09:30:03 +08:00
Cody Kesting
457a1ad289 Add API surface for ConnectivityDiagnostics API.
ConnectivityDiagnostics API will be used to provide callbacks to
permissioned applications for notifications on network connectivity
events.

Bug: 143187964
Test: compiles
Change-Id: Ib3c0b93f534a9c540e577891aa8aa0a2ad6de71f
2020-01-02 10:51:17 -08:00
Automerger Merge Worker
bd94fca597 Merge "Expose NetworkCapabilities methods to system/public APIs" am: 9290dc1179 am: 5d77a84faf
Change-Id: Id97144cf1421f5256748a196df37f58ffd006859
2019-12-27 08:45:44 +00:00
Aaron Huang
5d77a84faf Merge "Expose NetworkCapabilities methods to system/public APIs"
am: 9290dc1179

Change-Id: Icb3d0559475a14130dea64a5ca49a6259d5a2eb9
2019-12-27 00:38:46 -08:00
Aaron Huang
9290dc1179 Merge "Expose NetworkCapabilities methods to system/public APIs" 2019-12-27 08:32:50 +00:00
Aaron Huang
e435d2aeb1 Expose NetworkCapabilities methods to system/public APIs
Add methods to system/public APIs for mainline support.

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest FrameworksNetTests
      atest NetworkStackTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
      atest FrameworksTelephonyTests
      atest android.net.cts
      atest android.net.wifi.cts
      atest android.telephony.cts

Change-Id: I6ec333309172edaf5aa976f83cfbe63512043594
2019-12-27 08:31:06 +00:00
Automerger Merge Worker
7a377fcbd9 Merge "Remove tlsFingerprints init value" am: 2a479ab133 am: 28112be9d7
Change-Id: I5f5948c707abf2eb3c301d6eb8b63e867acd6e05
2019-12-26 07:26:08 +00:00
Wayne Ma
28112be9d7 Merge "Remove tlsFingerprints init value"
am: 2a479ab133

Change-Id: Ib29fe2d356c6faab809d95233f0b9771a6053191
2019-12-25 23:15:59 -08:00
Wayne Ma
2a479ab133 Merge "Remove tlsFingerprints init value" 2019-12-26 07:13:05 +00:00
Automerger Merge Worker
9e13b3c8d7 Merge "[Tether13] Move TetheringManager into framework" am: 2410d67357 am: fc8e151780
Change-Id: I9ec25eb984e3b534ddcc9313836a319b21526998
2019-12-20 14:00:29 +00:00
Mark Chien
fc8e151780 Merge "[Tether13] Move TetheringManager into framework"
am: 2410d67357

Change-Id: I05c79a1cf07e7679ea2a2c9221e541fb1c9a5a23
2019-12-20 05:47:01 -08:00
Automerger Merge Worker
cb311216fc [automerger skipped] Merge "Fix parceling of LinkProperties Inet6Addr" into qt-qpr1-dev am: 6b6a9b1972 -s ours
am skip reason: Change-Id Ie5b7782d788717dd1cc440e502d6cdf2d1c18eaa with SHA-1 f72923e980 is in history

Change-Id: I6c41b293e04f275dce38ee073f75e3be1e433d71
2019-12-20 08:42:19 +00:00
markchien
5776f96096 [Tether13] Move TetheringManager into framework
Move tethering out of ConnectivityService. All client would
use TetheringManager to talk with TetheringService directly.

Bug: 144320246
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
Merged-In: Ib051bea724a256f9c4572b566e46ae7b9c4abe6e
2019-12-19 20:53:06 +08:00
Automerger Merge Worker
d47c98c15a Fix parceling of LinkProperties Inet6Addr
IPv6 addresses parceled for DNS servers, private DNS servers, PCSCF
servers were parceled without the scope. This causes issues with
link-local DNS servers.

Test: atest FrameworksNetTests
Bug: 145181158
(cherry picked from commit 091f1d790cffc7c0d3ea8c85f540755584df4077)
Merged-In: Ie5b7782d788717dd1cc440e502d6cdf2d1c18eaa

Change-Id: I51313f50de8220988c2c1d26981c27d07dfb55f9
2019-12-19 17:55:00 +09:00
Automerger Merge Worker
71b47b486d Merge "Add LinkProperties methods to system APIs" am: 5966c91e94 am: 2b7e2960e3
Change-Id: Ie0a102ceb853c9f61d3e1deb369938a48edcdcac
2019-12-19 08:22:11 +00:00
Aaron Huang
2b7e2960e3 Merge "Add LinkProperties methods to system APIs"
am: 5966c91e94

Change-Id: Ib6cc8dff09ed97bdcf8504f8318461e742c34f7a
2019-12-19 00:06:31 -08:00
Aaron Huang
5966c91e94 Merge "Add LinkProperties methods to system APIs" 2019-12-19 08:01:58 +00:00
Paul Hu
d73f6baa90 Fix PermissionMonitor issues
PermissionMonitor#hasPermission only checks permssions that app
requested but it doesn't check whether the permission can be
granted to this app. If requested permission doens't be granted
to app, this method still returns that app has this permission.
Then PermissionMonitor will pass this info to netd that means
this app still can use network even restricted network without
granted privileged permission like CONNECTIVITY_INTERNAL or
CONNECTIVITY_USE_RESTRICTED_NETWORKS.

PermissionMonitor#hasUseBackgroundNetworksPermission only uses
the first package name of the uid for checking permission.
This is incorrect since each package declared different
permissions. So using the mApps which already checked both
network and using restricted network permissions. If uid is in
the mApps list that means uid has one of permission at least.

Bug: 144679405
Test: Build, flash, manual test
      atest FrameworksNetTests

Change-Id: I2da730feda4d7ebed1f158b073167bb3964b3e7d
Merged-In: I8b03c9e23ffc9ff46264d6307fb841a7eda76a76
Merged-In: Ib08a940a6e5d3365c392ab7174d8484c197e0947
(cherry picked from commit 2e1da35b3b903f4aa01435c46b7014b88a41328d)
2019-12-19 13:43:40 +08:00
waynema
c4e888bf64 Remove tlsFingerprints init value
Initializing the value is no longer necessary because ResolverParamsParcel has
 a default value now

Bug:146100043
Test: FrameworksNetTests pass
Change-Id: Ieb151c0cbb330d25f887cbd2eba9db392699d36e
2019-12-19 11:39:44 +08:00
Automerger Merge Worker
f72923e980 Merge "Fix parceling of LinkProperties Inet6Addr" am: 98460b6863 am: d33931f634
Change-Id: Ie5b7782d788717dd1cc440e502d6cdf2d1c18eaa
2019-12-19 03:29:50 +00:00
Remi NGUYEN VAN
d33931f634 Merge "Fix parceling of LinkProperties Inet6Addr"
am: 98460b6863

Change-Id: I7e4de0ecf06d34f050a881250755c8c0456269fc
2019-12-18 19:12:04 -08:00
Remi NGUYEN VAN
98460b6863 Merge "Fix parceling of LinkProperties Inet6Addr" 2019-12-19 03:07:43 +00:00
Remi NGUYEN VAN
3a59a925e0 Fix parceling of LinkProperties Inet6Addr
IPv6 addresses parceled for DNS servers, private DNS servers, PCSCF
servers were parceled without the scope. This causes issues with
link-local DNS servers.

Test: atest FrameworksNetTests
Bug: 145181158
Change-Id: I0ed24e51d4d0656f4a1f932b5e9f646b35b4b971
2019-12-18 19:52:30 +09:00
paulhu
6c93075645 Fix security problem on PermissionMonitor#hasPermission
PermissionMonitor#hasPermission only checks permssions that app
requested but it doesn't check whether the permission can be
granted to this app. If requested permission doens't be granted
to app, this method still returns that app has this permission.
Then PermissionMonitor will pass this info to netd that means
this app still can use network even restricted network without
granted privileged permission like CONNECTIVITY_INTERNAL or
CONNECTIVITY_USE_RESTRICTED_NETWORKS.

Bug: 144679405
Test: Build, flash, manual test
Change-Id: Iae9c273af822b18c2e6fce04848a86f8dea6410a
Merged-In: I8a1575dedd6e3b7a8b60ee2ffd475d790aec55c4
Merged-In: I2da730feda4d7ebed1f158b073167bb3964b3e7d
2019-12-18 07:17:28 +00:00
paulhu
7307d27ff9 Fix security problem on PermissionMonitor#hasPermission
PermissionMonitor#hasPermission only checks permssions that app
requested but it doesn't check whether the permission can be
granted to this app. If requested permission doens't be granted
to app, this method still returns that app has this permission.
Then PermissionMonitor will pass this info to netd that means
this app still can use network even restricted network without
granted privileged permission like CONNECTIVITY_INTERNAL or
CONNECTIVITY_USE_RESTRICTED_NETWORKS.

Bug: 144679405
Test: Build, flash, manual test
Change-Id: I5eba4909e4c2e1d9f275f66be90ac36466b93e90
Merged-In: I8a1575dedd6e3b7a8b60ee2ffd475d790aec55c4
Merged-In: Iae9c273af822b18c2e6fce04848a86f8dea6410a
2019-12-18 03:47:28 +00:00
Aaron Huang
441e499861 Add keepalive related methods and fields to system APIs
Add KeepalivePacketData to system API for mainline support.
Also, remove InvalidPacketException class from SocketKeepalive
and create a new InvalidPacketException class in android.net

Bug: 139268426
Bug: 135998869
Bug: 138306002
Test: atest FrameworksNetTests
      atest NetworkStackTests
      atest FrameworksTelephonyTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
      atest android.net.cts
      atest android.net.wifi.cts
      atest android.telephony.cts

Change-Id: I2d982e8abb5cb6b4c74a20483550b18cf814320d
Merged-In: I2d982e8abb5cb6b4c74a20483550b18cf814320d
2019-12-17 16:21:19 +00:00
Automerger Merge Worker
814bfc5c14 Merge changes from topic "dec13_netrevert" am: 9ea156af87 am: 5ca4b7fbf7
Change-Id: I9f6e7079d8e5d2e978ba618800c98df6e19e022b
2019-12-14 08:20:21 +00:00
Andrew Chant
5ca4b7fbf7 Merge changes from topic "dec13_netrevert"
am: 9ea156af87

Change-Id: I45543535ee0a394adcb4474ae51a0ce803c01f33
2019-12-14 00:06:02 -08:00
Andrew Chant
9ea156af87 Merge changes from topic "dec13_netrevert"
* changes:
  Revert "[NS A24] Add an object to represent changes in assignment"
  Revert "[NS A25] Send all listen callbacks after all rematches"
  Revert "[NS A26] Move available callbacks out of the rematch computation"
  Revert "[NS A27] Remove useless logs and a useless var"
2019-12-14 07:10:08 +00:00
Andrew Chant
6b569b2d62 Revert "[NS A24] Add an object to represent changes in assignment"
This reverts commit c375dccad3.

Reason for revert: Toggling wifi on/off causes networking to
 stop working with these four patches applied.
Bug: 146230156

Change-Id: Ie0217796c89abf0dc86e6a4f8324811155dc57cd
2019-12-14 03:35:07 +00:00
Andrew Chant
9e299b5f30 Revert "[NS A25] Send all listen callbacks after all rematches"
This reverts commit b56e56916f.

Reason for revert: Toggling wifi on/off causes networking to
 stop working with these four patches applied.
Bug: 146230156

Change-Id: Icd368df5ef76991dd2b4c1fa530cbc5fae2f61fa
2019-12-14 03:33:51 +00:00
Andrew Chant
6f9f854916 Revert "[NS A26] Move available callbacks out of the rematch computation"
This reverts commit be083a195f.

Reason for revert: Toggling wifi on/off causes networking to
 stop working with these four patches applied.
Bug: 146230156

Change-Id: I9af7f8b9af1a6279f2b9f1249824da705164c6b5
2019-12-14 03:32:41 +00:00
Andrew Chant
06a8edd342 Revert "[NS A27] Remove useless logs and a useless var"
This reverts commit dbb4dff52e.

Reason for revert: Toggling wifi on/off causes networking to
 stop working with these four patches applied.
Bug: 146230156

Change-Id: I6c75ac179bcc08cc5979194eea69525b333e2ba7
2019-12-14 03:31:20 +00:00