Commit Graph

4542 Commits

Author SHA1 Message Date
Paul Hu
973a925ff9 Merge "Replace the permission of internal connectivity checks" am: 6be69420df
am: 3256e731e3

Change-Id: I461936789b24940cc81146e9d0fc6c4c455206ed
2019-12-04 08:51:28 -08:00
paulhu
59148b7938 Replace the permission of internal connectivity checks
A number of connectivity checks that protect system-only methods
check for CONNECTIVITY_INTERNAL, but CONNECTIVITY_INTERNAL is a
signature|privileged permission. We should audit the permission
checks, and convert checks that protect code that should not be
called outside the system to a signature permission. So replace
all CONNECTIVITY_INTERNAL to other proper permissions.

Bug: 32963470
Test: atest FrameworksNetTests NetworkPolicyManagerServiceTest
Change-Id: I8f2dd1cd0609056494eaf612d39820e273ae093f
Merged-In: I8f2dd1cd0609056494eaf612d39820e273ae093f
2019-12-04 11:44:45 +08:00
Chalard Jean
36abe134c0 Merge "Give apps access to the NAT64 prefix." am: ce149dba87
am: 7dfd758583

Change-Id: I251c5ac17fb728d6f0fe91fd96c115c8b8d1879c
2019-12-01 18:27:36 -08:00
Chalard Jean
f9e2215cc4 Give apps access to the NAT64 prefix.
Apps that do their own DNS queries need to know the NAT64 prefix
to resolve v4 addresses on v6-only networks.

Test: FrameworksNetTests NetworkStackTests
Bug: 144877069
Change-Id: I5a255b7afc2038646b93a0ab893f8ad62d0fb34f
2019-11-30 10:25:02 +00:00
Aaron Huang
3262be5183 Merge "Add IpConfiguration parcelable interface implementation to system API" am: 76101baf9a
am: 21d23db938

Change-Id: Ic5b8e360cb33cdd18f32a4d2c17beb996584ebda
2019-11-28 02:14:56 -08:00
Aaron Huang
42daacaea7 Add IpConfiguration parcelable interface implementation to system API
API lint robot warnings that parcelable requires writeToParcel
and describeContents.

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

Change-Id: I7acf000c468788c3fdcb47f8601762e7804ab940
2019-11-28 07:25:40 +00:00
Jayachandran Chinnakkannu
f72d5dbbf1 Merge "Remove usage of hidden API TelephonyManager.getNetworkTypeName(int)" am: 9dcbd6de87
am: c0ea72cf10

Change-Id: I916e810b6350be9c1a6b24f2a652e05a1fa444fa
2019-11-26 09:31:33 -08:00
Jayachandran Chinnakkannu
9dcbd6de87 Merge "Remove usage of hidden API TelephonyManager.getNetworkTypeName(int)" 2019-11-26 17:17:38 +00:00
Jayachandran C
f823445e53 Remove usage of hidden API TelephonyManager.getNetworkTypeName(int)
This CL deletes the reference to this API as its used in a dead code
which is used for debugging only.

Bug: 140908357
Test: Build
Change-Id: I9fa1996ab5fdb5ab884128d06c2e92bab164dea7
2019-11-25 15:19:47 -08:00
Roshan Pius
126fb85c29 Merge "NetworkScoreManager: Add @SystemApi for wifi mainline module" am: 5b57190f08
am: 0564779e76

Change-Id: I04580ad32eefb2ce4c8df8f1037b8457238c30eb
2019-11-25 06:05:07 -08:00
Roshan Pius
9518866c53 NetworkScoreManager: Add @SystemApi for wifi mainline module
Add formal API's for API's that the wifi mainline module uses:
a) NetworkScoreManager.requestNetworkScores - Request new network scores.
b) NetworkScoreManager.registerNetworkScoreCallback - @SystemApi wrapper
over the existing registerNetworkScoreCache.
c) NetworkKey.createFromScanResult - Create NetworkKey from ScanResult.

Also,
a) Converted the existing WifiNetworkScoreCache callback implementation to
support both the new @SystemApi (used by wifi) and the old @hide API
(used by settings).
b) Stopped invoking dump on all the callbacks from NetworkScoreService.
The dump of each callback should be invoked at their client site (i.e
wifi service should dump state of the callback it registers with the
service).
c) Added a helper method |dumpWithLatestScanResults| to help dump the
state of the WifiNetworkScoreCache from wifi service.

Bug: 144487252
Test: a) Device boots up and connects to wifi network.
b) Manually verified that network scores are being requested & updated
with the new interface.

Change-Id: Id5a66189150e7a088127519373a832f63bdd12ac
Merged-In: Id5a66189150e7a088127519373a832f63bdd12ac
(cherry-picked from c278f80c28)
2019-11-24 07:04:30 +00:00
Chalard Jean
eb24ef664f Merge changes I195d894e,I7069c111 am: 87ed7d7816
am: aab1364ef9

Change-Id: Ia75369ad6b360644392766296542efa4a5fdf0ce
2019-11-22 06:33:34 -08:00
Chalard Jean
87ed7d7816 Merge changes I195d894e,I7069c111
* changes:
  [NS A10] Cleanup
  [NS A09] Always rematch all networks to requests
2019-11-22 14:08:09 +00:00
Aaron Huang
d78b2a0b67 Merge "Expose IpConfiguration and ProxyInfo APIs" am: 920a4a5b1b
am: 4082917f46

Change-Id: I9ef7325d73b1df9b1a3eb32e419e4cd1caeb7729
2019-11-22 01:47:14 -08:00
Aaron Huang
920a4a5b1b Merge "Expose IpConfiguration and ProxyInfo APIs" 2019-11-22 09:25:16 +00:00
David Su
02076c7a01 Merge "NetworkKey: migrate from ScanResult.wifiSsid to SSID" am: 1124e240c0
am: c4df6668bb

Change-Id: I6e50821d3fdd5e6ff5fc4cd238ccd186dd1ff94c
2019-11-21 11:58:10 -08:00
David Su
1124e240c0 Merge "NetworkKey: migrate from ScanResult.wifiSsid to SSID" 2019-11-21 18:44:46 +00:00
Chalard Jean
72cd1fa27a Merge "Cut the dependency to APN constants" am: 8f0513bd0b
am: 28df771bd4

Change-Id: I97f01b82916e66673339bef437d80927e78282ee
2019-11-21 04:52:31 -08:00
Chalard Jean
c06d788ec9 Cut the dependency to APN constants
With Telephony moving to Mainline these constants are not accessible
any more, and should not be made public. As they are only used by
a deprecated method that can only be called by apps with a target
SDK < M and only for one of the features it used to handle, copying
the constants until this method is completely removed is the simplest
way to go.

Test: FrameworksNetTests
Bug: 144454341
Change-Id: Iea18c8d2f2c8a40f04db9383d3f74b917267ba25
2019-11-21 14:48:00 +09:00
Meng Wang
33be3a80ea Merge "Use TelephonyManager instead of ITelephony Binder" am: de953fd5f2
am: f1b067c671

Change-Id: Iba67484246e81361ed540592558371cd7f2352c6
2019-11-20 20:51:54 -08:00
Meng Wang
de953fd5f2 Merge "Use TelephonyManager instead of ITelephony Binder" 2019-11-21 04:36:10 +00:00
David Su
e51ae1566b NetworkKey: migrate from ScanResult.wifiSsid to SSID
wifiSsid is an @hide field, migrate to getter method.

Bug: 144311098
Test: atest NetworkKeyTest
Change-Id: Ic689e12b8de4af52fae26c25bc90c8eb093ad3fe
Merged-In: Ic689e12b8de4af52fae26c25bc90c8eb093ad3fe
2019-11-20 10:41:59 -08:00
Meng Wang
a73bed81ae Use TelephonyManager instead of ITelephony Binder
Bug: 140908357
Test: make
Change-Id: If3be915329cc27c560af3fd71a903984a626aca8
2019-11-20 10:05:33 -08:00
Aaron Huang
6763aec94c Expose IpConfiguration and ProxyInfo APIs
Moving IpConfiguration methods to system API
for mainline support.

Public copy constructors of ProxyInfo and add
buildPacProxy(Uri, int) to create a new proxy
properties.

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

Change-Id: I07bcd2a34a222ea2b3cf0d8b497f051011c41c2c
2019-11-20 20:07:05 +08:00
Chalard Jean
1a4548cdd4 [NS A09] Always rematch all networks to requests
This is a regression in performance but it is necessary for
the sake of refactoring ; when the refactoring is over, the
performance will be improved back.

Test: ConnectivityServiceTest
Change-Id: I7069c11193dccb7dce6af65cfb731c0f4ad93629
2019-11-20 20:42:40 +09:00
Roshan Pius
d3e4bc9004 Merge "StaticIpConfiguration: Couple of minor fixes" am: 5c4c9872c5
am: 402e33e6e7

Change-Id: Ic40a6d4221cdb39e40b895efbe313160b7ab0846
2019-11-18 07:14:08 -08:00
Roshan Pius
5c4c9872c5 Merge "StaticIpConfiguration: Couple of minor fixes" 2019-11-18 15:05:31 +00:00
Jayachandran Chinnakkannu
6d2b8e0d6a Merge "Remove usage of Telephonymanager getDefault() and from() hidden APIs" am: 73e22ad21d
am: 306f8cecf8

Change-Id: I7613a654dd726bcf5428a5a07ad4369f616bbcfa
2019-11-18 01:05:02 -08:00
Jayachandran C
43fa1be03a Remove usage of Telephonymanager getDefault() and from() hidden APIs
This CL replaces with getSystemService(TelephonyManager.class)

Bug: 140768340
Test: atest frameworks/base/tests/net
Change-Id: I0f14cc5440fa85c81ab90f3199e9e91c1b00f5e1
2019-11-15 19:26:33 -08:00
Roshan Pius
ae07689b94 StaticIpConfiguration: Couple of minor fixes
a) Ensure the Builder.build() does not crash if setDnsServers() is not
invoked.
b) Add a checkNotNull on setDnsServers() since it is marked @NonNull.

Bug: 144487020
Test: Compiles
Change-Id: I2b9f990efa0583c0f067c25e23d8c944ffbdf6a5
(cherry-picked from d0348339c50eeae0fe137c62476f6a01542f4163)
2019-11-14 18:13:26 -08:00
Artur Satayev
79aff5c601 Merge "Add @UnsupportedAppUsage to test apis that are known to be used by apps." am: a98026f7aa
am: 59318bab67

Change-Id: Ic691d764839ecf34daa8b53aa92497e013c9a2a7
2019-11-13 10:40:54 -08:00
Treehugger Robot
a98026f7aa Merge "Add @UnsupportedAppUsage to test apis that are known to be used by apps." 2019-11-13 18:20:08 +00:00
Artur Satayev
5a525851a8 Add @UnsupportedAppUsage to test apis that are known to be used by apps.
go/testapi-enforcement

Bug: 133832325
Test: m
Change-Id: Ifc8db120640a1554dcbf1722e61e09c7ddc65dd6
Merged-In: Ifc8db120640a1554dcbf1722e61e09c7ddc65dd6
2019-11-13 15:05:56 +00:00
Kevin Hufnagle
d277bd6b30 Merge "docs: Fix broken link to NPN protocol" am: cab84c8dd3
am: 7c28465f70

Change-Id: Iebaec6b05cb01fac5a9e89fd8c1690f771f2df32
2019-11-12 14:58:12 -08:00
Kevin Hufnagle
298a24cc84 docs: Fix broken link to NPN protocol
Test: make ds-docs -j32

Bug: 24072424
Change-Id: I499325e0656e54e0a185539ca76c7b6f62f3be5b
2019-11-12 18:07:02 +00:00
Artur Satayev
756d3b447a Merge "Add @UnsupportedAppUsage annotations for greylist." am: 423c3a32d6
am: 7a565c45b1

Change-Id: I48075ef4296e0b55c0055f7364c5129bbd60e9ed
2019-11-11 09:33:13 -08:00
Artur Satayev
3be4d59369 Merge "Add @UnsupportedAppUsage annotations for max-p." am: 8893f158c6
am: da4d6567c2

Change-Id: Iff80c388dec2c6f8184b739be6fb38b8ec8a1a49
2019-11-08 09:49:03 -08:00
Artur Satayev
fc46be7dbd Add @UnsupportedAppUsage annotations for greylist.
go/cleanup-greylist-txt

These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code.

Bug: 137350495
Test: m

Change-Id: Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09
Merged-In: Id6c1f5e403a0e66edb1102ee45f3bf19f244fb09
2019-11-08 16:17:13 +00:00
Artur Satayev
ee9c6e7571 Add @UnsupportedAppUsage annotations for max-p.
See go/UnsupportedAppUsage for more details.

These have already been greylisted, however due to bugs/omissions in the tooling have been kept in go/greylist-txt instead of being annotated in the code.

Bug: 137350495
Test: m
Change-Id: I5aa29a49b193db47aaee4d3a756c17f48cc9f0b1
Merged-In: I5aa29a49b193db47aaee4d3a756c17f48cc9f0b1
2019-11-08 16:17:13 +00:00
Lucas Lin
29ea077fda Merge "[NS01] Create NetworkScore" am: c000664c7c
am: 1f1c098ad9

Change-Id: I0ba5523bf80f949a148e53774a367de325853747
2019-11-07 16:59:11 -08:00
Lucas Lin
c000664c7c Merge "[NS01] Create NetworkScore" 2019-11-08 00:47:22 +00:00
lucaslin
c2bac51882 [NS01] Create NetworkScore
It's the first patch for refounding network selection. The new
network selection will try to compare the networks by more
factors, and will try to choose the best network after doing
the evaluation of trade-off.
Create the object that will serve to represent network quality
for more comprehensive ranking.

Bug: 143676287
Test: 1. Build pass.
      2. atest FrameworksNetTests

Change-Id: I4b6071d14365aa84d06be9802516fedf527e70f7
2019-11-07 16:47:56 +08:00
Joshua Baxter
a5fde3c266 docs: fix a couple of minor typos am: 9bc8e0cb53 am: 7cebef8505
am: ffcb948028

Change-Id: Id084d29a91ae1a68176439c403e7475b2d497f9d
2019-11-06 14:05:28 -08:00
Joshua Baxter
7cebef8505 docs: fix a couple of minor typos
am: 9bc8e0cb53

Change-Id: Id2139f5f685d2c4677d5e06ff7fda4b74e61a30c
2019-11-06 13:33:53 -08:00
Joshua Baxter
9bc8e0cb53 docs: fix a couple of minor typos
test: make ds-docs
Change-Id: Ia68f66980e447209efb8102a156f78314c199f56
bug: 36979979
Exempt-From-Owner-Approval: docs-only change
2019-11-06 21:13:25 +00:00
Ruoyao Liu (刘若尧)
51038e8b3c Add API to set the sll_protocol on PacketSocket
Problem & Root cause:
the mInterfaceBroadcastAddr.sll_protocol is not assigned when the
interface initializes, sll_protocol is 0x0000 by default.
This causes packets to be filtered incorrectly in packet capture,
typically with tcpdump. The previous API is used by DhcpClient, causing
DHCP tx messages to not be recognized properly.

Background: inside the kernel packets carry both an ethertype metadata
(skb->protocol) and may also carry a real ethertype in the mac header.

Previously skb->protocol would be inherited from the socket either from
the protocol from socket() creation or from bind().  This was zero,
so skb->protocol would end up 0, even though the DHCP packets we actually
wrote would have the right on-the-wire ethertype populated in the bytes
passed to send().

As such DHCP packets would look correctly on the wire, but were lacking
the skb->protocol metadata to correctly tag them as IPv4.

This results in 'tc' and packet hooks potentially not triggering
correctly, and can thus result in tcpdump 'ipv4' filters discarding
these packets leading to confusing/erroneous tcpdump output.

In newer kernels (somewhere around 5.3), if socket protocol is 0, we
actually parse out the right ethertype from the mac header during send().

However, for old kernels we can't rely on this kernel magic, and the
right fix is simply to make sure that socket bound protocol is correctly
set to ipv4 [htons(ETH_P_IP)] in the bind() system call.

Solution:
  Add a new constructor in SocketUtils to set the protocol parameter.
Bug: 133196453
Test: manual test
Change-Id: I07887b82e0e32aadb0cbb9f930f2b2fa3e277ca9
2019-10-30 06:26:10 +00:00
Lucas Lin
eb24608dbc Merge "Better notification to user when DNS-over-TLS is broken"
am: 81852c8481

Change-Id: I8be963e35ed5e5ba914c6d3504a52ccb789aaf29
2019-10-23 02:51:56 -07:00
Lucas Lin
81852c8481 Merge "Better notification to user when DNS-over-TLS is broken" 2019-10-23 09:20:09 +00:00
lucaslin
783f221065 Better notification to user when DNS-over-TLS is broken
Provide a specifc notification to let users know that device
has no internet is because it really doesn't have internet access
or it's caused by private DNS resolution failed.

Bug: 113242081
Test: atest FrameworksNetTests
Change-Id: I710c88a4742f5fd56c39fc797d7fa3ad36dba553
2019-10-22 18:27:33 +08:00
Jimmy Chen
58d08de0c6 Merge "p2p: mirgrate p2p into tethering modes"
am: 8a9a9adaeb

Change-Id: Ib8f43d77a5f57965fa217e6e92eb9773e7914b54
2019-10-17 23:06:04 -07:00