summaryrefslogtreecommitdiff
path: root/core/java/android/net/LinkProperties.java
Commit message (Collapse)AuthorAgeFilesLines
* Move module sources to packages/ConnectivityRemi NGUYEN VAN2021-02-011-1823/+0
| | | | | | | | | | | | | | Files that are planned to be part of the connectivity module are grouped in packages/Connectivity, so they can be built separately and moved in one operation with their history into packages/modules/Connectivity. This places the files in the existing framework-connectivity-sources filegroup instead of the current framework-core-sources filegroup. Both are used the same way in framework-non-updatable-sources. Bug: 171540887 Test: m Change-Id: I62d9d91574ace6f5c4624035d190260c3126b91e
* Move module utils to the module package.Chalard Jean2020-12-161-1/+2
| | | | | | Test: FrameworksWifiTest FrameworksNetTest Change-Id: If5d1e4a58fb2d6d9544e6d01995dabe445cf1f25 Merged-In: I067eeecd458c34b7f2fbfa439072682661ac750c
* Use IPV6_MIN_MTU from NetworkConstants in Ikev2VpnRemi NGUYEN VAN2020-11-301-2/+1
| | | | | | | | | | | | | Instead of sharing the constant from LinkProperties, use the already defined constant in the NetworkConstants class. This allows Ikev2VpnProfile to allow depending on non-public LinkProperties APIs, as LinkProperties is planned to move to framework-connectivity. Bug: 174436414 Test: m Change-Id: I594bb7e81bc7681799c16eff621a5ffd1b29624c
* Expose MIN_MTU_V6 as a public, @hide constantBenedict Wong2020-11-191-2/+4
| | | | | | | | | MIN_MTU_V6 is increasingly used, and the LinkProperties version is used as a source of truth for the constant. Bug: 163602123 Test: atest FrameworksNetTests Change-Id: I67134cd4fb7e2cf59c36947b62f681ac9b94ea4a
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-11-041-3/+3
| | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Merged-In: I626caf7c1fe46c5ab1f39c2895b42a34319f771a Change-Id: I54e5ecd11e76ca1de3c5893e3a98b0108e735413
* Merge "Remove @TestApi from @SystemApi symbols"Anton Hansson2020-10-201-27/+0
|\
| * Remove @TestApi from @SystemApi symbolsAnton Hansson2020-10-191-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | I ran these commands: cd frameworks/base grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \ 's/\@SystemApi[\s\n]+(\@\w+[\s\n]+)?\@TestApi/\@SystemApi\1/gs' grep -rl '@TestApi' --include '*.java' | xargs perl -i -p0e \ 's/\@TestApi[\s\n]+(\@\w+[\s\n]+)?\@SystemApi/\1\@SystemApi/gs' Bug: 171179806 Test: m checkapi Change-Id: I772790b783b0a8730b8bf680c9e569a886b8d789 Merged-In: I772790b783b0a8730b8bf680c9e569a886b8d789
* | Remove unused methods from LinkProperties.Chalard Jean2020-10-161-73/+0
|/ | | | | | | | LinkProperties.compare{Dnses,ValidatedPrivateDnses,AllRoutes, AllInterfaceNames} actually have no users. Test: LinkPropertiesTest Change-Id: Ic54ab3c5520fbbc2be1309aeaf1e5a7857dbd194
* Only apply VPN isolation if it's fully routedRubin Xu2020-04-011-0/+30
| | | | | | | | | VPN is considered fully routed if both IPv4 and IPv6 have either a default route or a prohibit route. Bug: 145332510 Test: atest FrameworksNetTests Change-Id: I59cf48552bca98092d1212e3d718fd420add5458
* Fix addRoute replace default route unexpectedlyjunyulai2020-03-241-8/+8
| | | | | | | | | | | | | | | | | | | | | | In aosp/1203789, if two routes are with the same destination, it will be replaced instead of added when calling addRoute. This breaks scenarios which rely on the ability to add multiple default routes, such as multiple IPv6 default routes learned via address autoconfiguration. This change treats the route is an update if the destination and nexthop are the same, but different in other properties. Test: atest OffloadControllerTest#testSetUpstreamLinkPropertiesWorking Test: atest LinkPropertiesUtilsTest#testLinkPropertiesIdenticalEqual Test: atest ConnectivityServiceTest#testStackedLinkProperties Test: atest ConnectivityServiceTest#testRouteAddDeleteUpdate (only directly related tests are listed) Fix: 152170074 Fix: 151911339 Bug: 142892223 Change-Id: I7153ec9866f14a109ba8155c905e5d9e4f85eb64
* Merge "mtu: Add MTU parameter to Routes"Lorenzo Colitti2020-03-181-7/+29
|\
| * mtu: Add MTU parameter to RoutesTyler Wear2020-03-111-7/+29
| | | | | | | | | | | | | | | | | | - Change route to update existing route - MTU parameter added to AddRoute Bug: 142892223 Test: unit test Change-Id: Ie339d0cee5be12c2232a4631fed61219a0facc64
* | Move sensitive field parceling bool to constructorRemi NGUYEN VAN2020-03-171-17/+13
|/ | | | | | | | | | This addresses API review comments recommending to use a copy constructor with additional parameters instead of a dedicated method. makeSensitiveFieldsParcelingCopy becomes LinkProperties(base, true). Bug: 150877475 Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests Change-Id: Ib145ca7f36dcbee6ef47d09862a181fc04a28f03
* Remove framework code that has moved to frameworks/libs/netAaron Huang2020-03-101-69/+7
| | | | | | | | | | | | | | | Add srcs to framework and change import path. Remove the codes which are moved to frameworks/libs/net. Bug: 139268426 Bug: 135998869 Bug: 138306002 Bug: 143925787 Test: atest FrameworksNetTests atest FrameworksTelephonyTests ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: Ia5692aade490fbc8a037186fcdfc453e0dd8045b Merged-In: Ibf2f370c97a602f186e37ea9ffbe177dd2ee0f1c
* Revert "Remove framework code that has moved to frameworks/libs/net"Isabelle Taylor2020-02-141-7/+69
| | | | | | | | | | | | | | | | Revert "Use createRandomUnicastAddress from MacAddressUtils" Revert "Add net-utils-framework-net to telephony-common" Revert submission 1191997-net-utils-framework-net Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=git_qt-qpr1-dev-plus-aosp&target=aosp_taimen-userdebug&lkgb=6208131&lkbb=6208273&fkbb=6208273, bug b/149551544 Reverted Changes: Ib1c807d64:Use createRandomUnicastAddress from MacAddressUtil... I9e0f297e0:Add net-utils-framework-net to telephony-common Ieb8927f9a:Remove framework code that has moved to frameworks... Change-Id: I2824f781babd9f7e0bb9df524dadf6b8397dcaa1
* Remove framework code that has moved to frameworks/libs/netAaron Huang2020-02-031-69/+7
| | | | | | | | | | | | | | | Add srcs to framework and change import path. Remove the codes which are moved to frameworks/libs/net. Bug: 139268426 Bug: 135998869 Bug: 138306002 Bug: 143925787 Test: atest FrameworksNetTests atest FrameworksTelephonyTests ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: Ieb8927f9af7f87a5ae038bd6c7daeb3d70117fef Merged-In: Ieb8927f9af7f87a5ae038bd6c7daeb3d70117fef
* Add Ikev2VpnProfile as public APIBenedict Wong2020-01-221-1/+2
| | | | | | | | | | | | | | | | This change adds configuration classes for Platform VPNs, with the extensibility for further platform VPNs to be added in future. Profile validity is checked upon construction, and upon changing conversion from VpnProfile instances. Internal storage and method calls all use VpnProfiles to allow for reuse of existing infrastructure. However, when Platform VPN implementations are started, the internal VpnProfile will be converted back into the respective PlatformVpnProfile for validity checking. Bug: 143325939 Test: Compiles, FrameworksNetTests passing. Change-Id: I3c375fb08c132fc062e893c375f5c36460122162
* Add API for CaptivePortalDataRemi NGUYEN VAN2020-01-221-21/+148
| | | | | | | | | | | | | | | | CaptivePortalData will be used to hold data advertised by the network following RFC7710bis. To fetch the CaptivePortalData, the API URL is added to LinkProperties, to be provided by the NetworkAgent. Because CaptivePortalData can be used to guess user location (especially from the URLs provided by the portal), it is only exposed to applications that have privileged permissions. Test: atest FrameworksNetTests Bug: 139269711 Change-Id: I341175b5fece8ee00e19898af5e8eabe66cefbf3
* Use new UnsupportedAppUsage annotation.Artur Satayev2020-01-081-1/+1
| | | | | | | | | 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
* Make LinkPropertiesTest pass, and fix an NPE.Lorenzo Colitti2020-01-071-4/+7
| | | | | | | | | | | | 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
* Add the DHCP server address to LinkProperties.ruibin zhang2020-01-071-0/+44
| | | | | | Bug: 134098566 Test: see subsequent CL in topic Change-Id: If0f80067934189137c87cd379e7ae47b187562fd
* Merge "Add LinkProperties methods to system APIs"Aaron Huang2019-12-191-8/+9
|\
| * Add LinkProperties methods to system APIsAaron Huang2019-12-021-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The exposed methods are used by telephony, wifi and tethering. For mainline support, making the methods @SystemApi. 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: Ib16a838cf9f748e1c5b045d6c2f17678f16af28c
* | Fix parceling of LinkProperties Inet6AddrRemi NGUYEN VAN2019-12-181-16/+37
|/ | | | | | | | | | 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
* Give apps access to the NAT64 prefix.Chalard Jean2019-11-301-6/+0
| | | | | | | | | 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
* Add @UnsupportedAppUsage annotations for greylist.Artur Satayev2019-11-081-0/+2
| | | | | | | | | | | | 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
* API to detect which network interfaces support wake-on-lanValentin Iftime2019-10-081-2/+45
| | | | | | | | | | 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
* Merge "Address leftover comments on 923337 and 930217." am: 1e97aab6f4 am: ↵Paul Hu2019-04-021-7/+1
|\ | | | | | | | | | | | | | | 55a22b5d17 am: 1d7b92b9d5 Change-Id: I75eadb66c81d72c768e77feddd383d60f8accd65
| * Address leftover comments on 923337 and 930217.paulhu2019-04-011-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Restrict unprivileged apps to use NetworkRequest.Builder#setSignalStrength. - Remove the "throws NullPointerException" in CaptivePortalProbeSpec constructor. - Remove the null check in LinkProperties. - Add annotataion into all ConnectivityManager.NetworkCallback methods. Change-Id: Id275cac1d6a30d7515cd7b113394f5e8a0179314 Fix: 129097486 Test: atest FrameworksNetTests
* | Merge "Fix Automated API Review issues." am: 43c1ade661 am: 9e3f29037bPaul Hu2019-03-211-142/+201
|\| | | | | | | | | | | am: ce18c5a1ec Change-Id: Iba1630161579571d4975aba9bbd5c767f82c8a98
| * Fix Automated API Review issues.paulhu2019-03-211-142/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Some API's argument/return value must be marked either @NonNull or @Nullable. 2. Change some system APIs to public APIs. 3. Modify the method name Bug: 126700123 Bug: 126702339 Bug: 126699682 Bug: 118296575 Bug: 126699216 Bug: 126699675 Bug: 126699429 Bug: 126699193 Bug: 123586045 Test: atest FrameworksNetTests Change-Id: Iaa2832cdcf83758ed0fec81b954a0c63bc5a7bf6
* | All Parcelable CREATOR fields are @NonNull.Jeff Sharkey2019-02-281-1/+1
|/ | | | | | | | | If they were null, then the Parcelable would fail to work. Bug: 126726802 Test: manual Change-Id: I7929ffa2f20e5de1c8e68e8263cca99496e9d014 Exempt-From-Owner-Approval: Trivial API annotations
* Add NetworkUtils utilities to SystemApiRemi NGUYEN VAN2019-01-291-1/+4
| | | | | | | | | | | | attach*Filter and addArpEntry are necessary for the NetworkStack but are only usable for apps that have system permissions. Also includes system API for IpPrefix, LinkAddress, LinkProperties, Network, and static modifier in ApfCapabilities that were missed in previous CLs. Test: Builds, flashed, WiFi works Bug: 112869080 Change-Id: If141ae6a2f9145f5af64ba002ca44938f39b90a9
* Add additional SystemApi for NetworkStackRemi NGUYEN VAN2019-01-241-1/+10
| | | | | | | | | Members in this CL were missed in earlier changes. Test: m Bug: 112869080 Merged-In: I8b5b80ea7b267357eb0387d504a2f78358d6d502 Change-Id: I8b9b15f8b91962f3ef554fd222a825e471806c9e
* Add LinkProps and NetworkCaps methods to SystemApiRemi NGUYEN VAN2019-01-221-11/+33
| | | | | | | | Added methods are used by the NetworkStack. Test: atest FrameworksNetTests NetworkStackTests Bug: 112869080 Change-Id: I8822d43c1a4981ca39289525685b3f975fb0e8d5
* Add Nat64Prefix to LinkProperties copy constructorRemi NGUYEN VAN2019-01-161-0/+1
| | | | | | | | The attribute is copied when parceling/unparceling so should also be preserved in the copy constructor. Test: tests based on this pass Change-Id: Ia48d94fc075e6414f537dad181a236be5a32b41b
* Add the NAT64 prefix to LinkProperties.Lorenzo Colitti2019-01-121-2/+51
| | | | | | | | | Currently we support exactly one NAT64 prefix. This matches what other components in the system (Dns64Configuration, clatd, etc.) support. Test: atest FrameworksNetTests Change-Id: I45a11cebe43a5e1c60d50eca7889cb317565b598
* Merge "Add PCSCF to LinkProperties."Chalard Jean2019-01-101-0/+119
|\
| * Add PCSCF to LinkProperties.Hongshik2018-12-051-0/+119
| | | | | | | | | | | | | | | | | | | | | | Some applications or services are needed PCSCF address to register IMS server but there is no way to get it on Android Framework. We have added PCSCF address to LinkProperties like attached diff files. Test: get Linkproperties and check Pcscf addresses. atest FrameworksNetTests Change-Id: Ic2341a4ce2ed88d560325721766fc21f85f7ff86 Signed-off-by: Hongshik <hshik.kim@samsung.com>
* | Limit access to suspected false positives.Mathew Inwood2018-12-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Members modified herein are suspected to be false positives: i.e. things that were added to the greylist in P, but subsequent data analysis suggests that they are not, in fact, used after all. Add a maxTargetSdk=P to these APIs. This is lower-risk that simply removing these things from the greylist, as none of out data sources are perfect nor complete. For APIs that are not supported yet by annotations, move them to hiddenapi-greylist-max-p.txt instead which has the same effect. Exempted-From-Owner-Approval: Automatic changes to the codebase affecting only @UnsupportedAppUsage annotations, themselves added without requiring owners approval earlier. Bug: 115609023 Test: m Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0 Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
* | Unhide LinkProperties, NetworkCapabilities, NetworkRequest APIspaulhu2018-12-181-11/+10
| | | | | | | | | | | | | | | | | | | | | | These methods are marked to @UnsupportedAppUsage APIs since Android Q. But some system apps still need them to set/get necessary network or request information. Hence, make them to be public or system APIs. Bug: 120448492 Test: atest FrameworksNetTests Change-Id: I95a44daef5615e290b40d0796ca183b88ad8a63f
* | Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-141-0/+46
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For packages: android.net.wimax android.net.wifi.p2p.nsd android.net.wifi.p2p android.net.wifi.hotspot2.pps android.net.wifi.hotspot2.omadm android.net.wifi.hotspot2 android.net.wifi.aware android.net.wifi android.net.util android.net.sip android.net.rtp android.net.nsd android.net.metrics android.net.lowpan android.net.http android.net.captiveportal android.net This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Ie25423113ee1a8071cd5039382c00de6ce0af7fd Merged-In: I520be7a4c79e68310c12e4f55bf66acaa94145a1
* Cleanup of LinkProperties.Chalard Jean2018-06-121-87/+98
| | | | | Test: runtest Change-Id: I7299de93a79901635ce755a2d933666ee43767d5
* Bugfixes in LinkProperties#toStringChalard Jean2018-06-111-2/+2
| | | | | | | We should stop trying to use a human brain to write code Test: manual Change-Id: Ifd7d73ad65de0f671466080beacbd97287e17bfe
* Add the list of private DNS addresses to LinkPropertiesChalard Jean2018-04-271-24/+136
| | | | | | | | | | (clean cherry-pick from ag/3874803) Test: atest android.net.LinkPropertiesTest, also new tests pass Bug: 73641539 Change-Id: If33a35b1354a67db09411ff098f20064797296ad Merged-In: I4b739c56e658690532ae9deb0b9a3bc9b2adf8b0 Merged-In: I6bdbef78d078d68534c8e07e9af031ce374560ef
* Add public API methods for private DNS.dalyk2018-01-171-11/+99
| | | | | | Test: Small modifications to LinkProperties test. Bug: 71828272 Change-Id: Id2f5acb5469132ec4a917837739f42085c71498e
* LinkProperties: fix some indentation issuesHugo Benichi2017-10-101-15/+15
| | | | | Test: no functional change Change-Id: I469bba154feb382156e56043d83f066a5bd658aa
* Refactor CompareResult<> class and its call sitesRubin Xu2017-09-081-49/+23
| | | | | | | | Move all corner case logic from call sites to CompareResult's implementation, add a constructor to directly do the comparison. Test: runtest frameworks-core -c android.net.LinkPropertiesTest Change-Id: I95bba82ec38d295b18c49c025dffab5f17271cbd
* Always add local subnet routes to the interface's routing tableRubin Xu2017-09-071-4/+14
| | | | | | | | | | | | | | | | | | | | | For some networks such as mobile data connections, its LinkProperties does not contain routes for the local subnet so no such route is added to the interface's routing table. This can be problematic especially if the device is in VPN lockdown mode where there exists high-priority PROHIBIT routing rule which in turn blocks the network's default gateway route from being added (next hop address hitting the prohibit rule). We fix this by patching LinkProperties to always include direct connected routes when they are received by ConnectivityService. This has the added advantage that when apps get LinkProperties, they see the directly connected routes as well. Bug: 63662962 Test: runtest frameworks-core -c android.net.LinkPropertiesTest Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest Test: Start with device with mobile data, set up ics-OpenVPN in always-on lockdown mode. Turn off mobile data then turn it back on, observe mobile data connectivity is restored and VPN successfully reconnects. Change-Id: I35b614eebccfd22c4a5270f40256f9be1e25abfb
* Also treat loss of IPv6 as a loss of provisioning.Erik Kline2015-10-271-2/+6
| | | | | Bug: 23226635 Change-Id: Icebb7d83ed5b3b796901b9f023909a02eb461941