Commit Graph

1773 Commits

Author SHA1 Message Date
markchien
d2751e09d2 Expose netId to SystemApi
Tethering will be build as unblundled APP. It can't use @hide
API anymore. Expose netId for tethering because it need to set
proxy dns server with netId.

Bug: 144758139
Test: build
Change-Id: Ifefa791940874617bb479f5c23488d14be87f45e
2019-12-04 14:33:51 +08:00
Aaron Huang
4c1dd06339 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
Chalard Jean
3d59a27d1c 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
c2df0b68c4 Merge "Expose IpConfiguration and ProxyInfo APIs" 2019-11-22 09:25:16 +00:00
Chalard Jean
afaed1a5e0 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
138728da9a Merge "Use TelephonyManager instead of ITelephony Binder" 2019-11-21 04:36:10 +00:00
Meng Wang
ed6f441315 Use TelephonyManager instead of ITelephony Binder
Bug: 140908357
Test: make
Change-Id: If3be915329cc27c560af3fd71a903984a626aca8
2019-11-20 10:05:33 -08:00
Aaron Huang
fb8581aac0 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
b0b3bc6d3d [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
90a81fedc5 Merge "StaticIpConfiguration: Couple of minor fixes" 2019-11-18 15:05:31 +00:00
Jayachandran C
2092850198 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
32b898bb6d 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
96639a6e4e 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
Artur Satayev
56cb6bb2a9 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
8124713528 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
lucaslin
17e9c67315 [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
Lucas Lin
f42f3830ec Merge "Better notification to user when DNS-over-TLS is broken" 2019-10-23 09:20:09 +00:00
lucaslin
e117e2e8d7 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
baf9025bbf Merge "p2p: mirgrate p2p into tethering modes" 2019-10-18 05:42:31 +00:00
Aaron Huang
10b90974ac Expose MacAddress methods to public API
To support mainline modules, adding the methods which
are used by wifi.

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

Change-Id: I49856863c15b6b3b59aa867a77b0f137003149ef
2019-10-15 17:33:05 +08:00
Chalard Jean
c1ea43fa1c Merge "Improve documentation for NetworkCallbacks." 2019-10-10 05:56:59 +00:00
Chalard Jean
01378b64ac Improve documentation for NetworkCallbacks.
Bug: 139570489
Test: m doc-comment-check-docs
Change-Id: I9e13057b7e46908863156986429ff2ce93d4be78
2019-10-09 18:33:09 +09:00
Valentin Iftime
9fa3509a51 API to detect which network interfaces support wake-on-lan
Add a new method in LinkProperties, isWakeOnLanEnabled() which returns
true if network interface is defined in config_wakeonlan_enabled_interfaces
string-array (config.xml)

Bug: 132705025
Test: atest LinkPropertiesTest & atest ConnectivityServiceTest
Change-Id: I3f7803aafd2f8eaf8aa18419b21339e15d4b7a0b
2019-10-08 13:03:30 +02:00
Jimmy Chen
dd31bc4429 p2p: mirgrate p2p into tethering modes
Bug: 137602441
Bug: 139783330
Test: atest FrameworksNetTests
Test: atest FrameworksWifiTests
Test: CtsVerifier - Wi-Fi Direct
Test: Enable hotspot when P2P GO is running
      * P2P GO is terminated
      * hotspot is running
Test: Enable P2P GO when hotspot is running
      * hotspot is intact
      * P2P GO could not be launched
Test: Verify P2P functions with legacy WifiP2pService

Change-Id: Icb2e2b106ae52b19af29b7a1ebc55d3cdf80db9c
2019-10-08 14:37:19 +08:00
Oscar Shu
f8b0fcbc6c Merge "Followup to CL 1103896" 2019-09-24 22:06:27 +00:00
xshu
7e625b9802 Followup to CL 1103896
Optimizes the logic that ensures the default randomized MAC is not
returned.

Bug: 137796328
Test: atest MacAddressTest
Change-Id: Ie95d7a020bfac8850b8a67e4d396de77db22e1db
2019-09-20 16:56:54 -07:00
Aurimas Liutikas
9fe20bf048 Merge "Add missing nullability annotations." into stage-aosp-master 2019-08-30 15:19:45 +00:00
Remi NGUYEN VAN
904ee8f635 Merge "Run callbacks on ConnectivityService thread"
am: 08e1dae42f

Change-Id: I7a8d035ec7453c5351eb2646c631c19964cb0f88
2019-08-30 03:36:26 -07:00
Aurimas Liutikas
8fae993514 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Merged-In: I109260842cfc25f06e40694997fcbb4afa02c867
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-30 00:14:44 +00:00
Remi NGUYEN VAN
96521fb87d Run callbacks on ConnectivityService thread
Run MultinetworkPolicyTracker and DataConnectionStats callbacks on the
ConnectivityService handler thread.

Previously the callbacks would be using the SystemServer foreground
thread (Looper.myLooper()), or the broadcast thread for the
MultinetworkPolicyTracker BroadcastReceiver. This is error-prone, can
cause threading issues and makes it difficult to test the components.

Test: atest FrameworksNetTests
Change-Id: I189213dd363004abed294659165bf5430d153bba
2019-08-28 10:10:04 +09:00
Oscar Shu
6fcb2696cd Merge "avoid generating reserved local MACs"
am: 464e1b5e6f

Change-Id: Ia6d0eb0c5e8101d9c4b4bc63de79157f7d1c2284
2019-08-23 02:24:15 -07:00
Oscar Shu
464e1b5e6f Merge "avoid generating reserved local MACs" 2019-08-21 17:45:00 +00:00
xshu
8438a85683 avoid generating reserved local MACs
Avoid generating WifiInfo.DEFAULT_MAC_ADDRESS as a randomized MAC
address since it's being used for another purpose.

Bug: 137796328
Test: atest MacAddressTest
Change-Id: Ia7beef0d0af5d7b39845e662cd343d81aef97702
2019-08-16 10:20:22 -07:00
Chiachang Wang
85ff8a6902 Merge "Get resource based on subId for multi-SIM"
am: 55752cf8d4

Change-Id: I020c2546fa4432d05cf27b20fdb1943508aac671
2019-08-14 04:30:57 -07:00
Chiachang Wang
5fed8d9ee3 Get resource based on subId for multi-SIM
The resource loading is done based on the last SIM to come up
which is not a deterministic design. Thus, update the way to get
the resource based on the subId.

Test: atest FrameworksNetTests
Test: manually test with avoid bad wifi feature supported sim
Bug: 138956509
Change-Id: Ib5b085d97103889600773d269e03b939c29ca47d
2019-08-14 13:56:37 +08:00
Fedor Kudasov
26f1ab857b Return NonNull and other imports
Change-Id: Ia38b13209b45d8228ac02f06663e4dc12be9de60
2019-07-09 14:19:04 +00:00
Fedor Kudasov
da2257cea2 Merge changes from topic "fix_master_build"
am: 2e5319117a

Change-Id: If49999e7ce6149e847a678b03ccf8b4549f8365b
2019-07-09 06:10:01 -07:00
Fedor Kudasov
2559cb3953 Revert "Cherry-pick the relevant parts of master change"
This reverts commit 5a4844e307.

Reason for revert: multiple build breakages b/137069068

Change-Id: If48bfa2d2cab0877a053743b3ec53820d0c4ed6b
2019-07-09 09:29:17 +00:00
Fedor Kudasov
496a313f47 Revert "Remove providesRoutesToMostDestinations."
This reverts commit 92bd90fa0b.

Reason for revert: multiple build breakages b/137069068

Change-Id: I60a4f71e13fe82f970b177a07c0b58439cbc64ff
2019-07-09 09:23:25 +00:00
Chalard Jean
4896785b0b Merge changes Ia43f8811,I7de4f672
am: 3ef04b8e3c

Change-Id: Ifcacd81d343a29b17fdb79f4c8b54c89a293a2b8
2019-07-09 00:56:57 -07:00
Chalard Jean
92bd90fa0b Remove providesRoutesToMostDestinations.
This function is not used any more.

Test: FrameworksNetTests
Change-Id: Ia43f8811cb9d575e16735b0f4b76d91e7cd42ebc
2019-07-08 20:36:33 +09:00
Chalard Jean
5a4844e307 Cherry-pick the relevant parts of master change
I566437e4fe10e1346858149120c50b3c20ca073f to avoid a conflict

Test: atest FrameworksNetTests
Change-Id: I7de4f67234bf97d58bddffa22272c7670398f56d
2019-07-08 20:25:45 +09:00
Lorenzo Colitti
c3bb7285f4 Merge "Unit tests for new explicitlySelected behaviour." am: d1379a4a80
am: 10c1a704c0

Change-Id: Id77a5d6a58e7ab4fdaa0b7c15b824270863b83fd
2019-06-29 02:01:55 -07:00
Lorenzo Colitti
f255e047b7 Unit tests for new explicitlySelected behaviour.
ag/7905088 added the ability to pass in acceptUnvalidated without
passing in explicitlySelected. Add unit tests for that code.

While I'm at it, convert a couple of "== 1"s to toBool(), and
update the comments in NetworkAgent.

Bug: 130766237
Test: atest FrameworksNetTests
Change-Id: I6b550bd621e3596975f83464c7b4b8a14269120b
2019-06-28 23:57:22 +09:00
Junyu Lai
59cc58b295 Merge "Move the test of minimum supported keepalive slots to CTS" am: c961e03526
am: 6ff00fee75

Change-Id: Ib9b06d3458782a648a2f5b8fd5a9ca1d34bd11f9
2019-06-19 07:29:11 -07:00
Junyu Lai
bafc7c9b8f Merge "Correct value of supported keepalive count for cellular" am: 7423873ac8
am: 056eeae27c

Change-Id: If833b813ba00eeff913160598f1ea9c74e6e35d8
2019-06-19 07:28:53 -07:00
Junyu Lai
c961e03526 Merge "Move the test of minimum supported keepalive slots to CTS" 2019-06-19 14:08:31 +00:00
Junyu Lai
7423873ac8 Merge "Correct value of supported keepalive count for cellular" 2019-06-19 14:08:31 +00:00
junyulai
5b3b486b8f Move the test of minimum supported keepalive slots to CTS
This change also enables log when keepalive is started.

Bug: 134352656
Test: 1. atest android.net.cts.ConnectivityManagerTest#testSocketKeepaliveLimitTelephony
      2. atest FrameworksNetTests
Change-Id: I408750fa0bceb0c1c26afb5fead4e44fb824fbc1
2019-06-19 16:25:19 +08:00
Chalard Jean
649a5747ef Merge "Remove the <= P restriction for WIFI_P2P" am: 43a52d0aaa
am: bb754c9c8d

Change-Id: I14f5865249740587d550ac31b59883f4a87fd4a1
2019-06-17 08:20:18 -07:00