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
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
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
Initializing the value is no longer necessary because ResolverParamsParcel has
a default value now
Bug:146100043
Test: FrameworksNetTests pass
Change-Id: Ieb151c0cbb330d25f887cbd2eba9db392699d36e
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
* 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"
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
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
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
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
* changes:
[NS A27] Remove useless logs and a useless var
[NS A26] Move available callbacks out of the rematch computation
[NS A25] Send all listen callbacks after all rematches
[NS A24] Add an object to represent changes in assignment
These logs haven't found a bug in a long time and we now have
some structural guarantees that the conditions they check for
can't happen (like the checks that everything is happening on
the same thread).
Maybe we'll reinstate similar checks later, but for now they
are in the way and removing them is a small sacrifice for the
intended benefit.
The local was simply not used any more.
Test: FrameworksNetTests
Change-Id: I4b793e86039c204a038c1b0fecbf8a4927eef48d
The builder lets clients set it, and this may be useful for
unit tests of apps. It should be public.
The need arises from uses of this in WiFi and Telephony
network factories.
Test: build
Bug: 135998869
Change-Id: I57279cac139c28e8654d2066ba0c60edd1e6cd98
As the calls to this apparently need to be synchronized, let's
do it all in the same place instead of in all callers
Test: FrameworksNetTests
Change-Id: I0c097e7756fc155ba0243834b84626e86c68340e
The point of this is to be able to move parts of processListenRequests
independently.
Test: FrameworksNetTests
Change-Id: I6c889b15696123c1120221977b0f36fa3d91de56
A lot of this code can't be triggered at all.
• newNetwork.created in l.6488 is implied by newNetwork.everConnected
in l.6357
• !newNetwork.isVPN() in l.6488 is implied by the fact that VPNs are
always foreground, so oldPermission can't != newPermission in l.6488
• updateUids in l.6502 is useless because uids can't change during a
rematch (because there is no code doing that). Metered state and
roaming state similarly can't change during a rematch, so
meteredChanged and roamingChanged are always false
• updateAllVpnCapabilities in l.6537 is useless because VPN do not
inherit the foreground state of their underlying networks, which
would be the only reason to call that in l.6537
• Object.equals() in l.6480 is necessary false because at this line
it is known that the foreground state has changed, which must have
caused the NET_CAPABILITY_FOREGROUND to be different, so the objects
can't be equal
Test: FrameworksNetTests NetworkStackTest
Change-Id: I2a52f7f4a085f3eea22a1dd170af8f04671250ff
This annotation is mis-adding by aosp/929879, and now it also
makes compilation failure for Telephony Mainline.
Bug: 145755373
Test: atest FrameworksNetTests
Change-Id: Ic22ce6bf17c4300b8cd52217976bfb215a123f68
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
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
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
This is ugly, but it's a necessary step to improve the code.
Followups will clean this up. Importantly this kind of inlining
will let us break the very confusing apparent loop between
updateCapabilities and rematch.
Test: FrameworksNetTests
Change-Id: Ie756b9aa8066984264717f0b1e1f31606432f1a4
This is a long standing bug that happens to now be trivial
to fix, and also be beneficial for refactoring
Test: FrameworksNetTests NetworkStackTests
Change-Id: I38110f3a4a75936ea755788e7f9fee67863e14be
* changes:
[NS A14] Move code notifying battery stats in its right place
[NS A13] Move legacy broadcast handling after rematch.
[NS A12] Move some legacy type tracker handling to a function
Add tests for ConnectivityService → BatteryStats messages
Move LegacyTypeTracker work into a function for readability.
Test: FrameworksNetTests NetworkStackTests
Change-Id: I9539b8cc4422b3a0cc1d3d9b3a44d59dc1905b44