am skip reason: Change-Id Idff3b05a193a80c581d80d0e4fe9c2d3fc0d8a25 with SHA-1 bc7ff5d89f is in history
Change-Id: Ia5bd44f2cd6688e39545a25e9ec243d618c9b5f8
am skip reason: Change-Id Idff3b05a193a80c581d80d0e4fe9c2d3fc0d8a25 with SHA-1 dd397f58c7 is in history
Change-Id: Ibf33a1079bab67b51f51d68584e5236b7164361b
am skip reason: Change-Id Idff3b05a193a80c581d80d0e4fe9c2d3fc0d8a25 with SHA-1 bc7ff5d89f is in history
Change-Id: Ib0e588434a8dd04280ef0df1f8f2d3abdfeff7a3
am skip reason: Change-Id Idff3b05a193a80c581d80d0e4fe9c2d3fc0d8a25 with SHA-1 dd397f58c7 is in history
Change-Id: I535ef517fd18b84e1b4f1823c656ac14bc798f00
am skip reason: Change-Id Idff3b05a193a80c581d80d0e4fe9c2d3fc0d8a25 with SHA-1 dd397f58c7 is in history
Change-Id: I551191401ef145f60ce43992dc1130cda0d62838
Both EthernetManager#getAvailableInterfaces() and the no-arg
version of EthernetManager#isAvailable() end up calling
EthernetServiceImpl#getAvailableInterfaces. This method attempts
to filter out restricted interfaces if the caller does not have
the CONNECTIVITY_USE_RESTRICTED_NETWORKS permission.
Unfortunately EthernetNetworkFactory's notion of a restricted
interface is the opposite of what it should be. This means that
while privileged callers can see all interfaces, unprivileged
callers can only see restricted interfaces which they cannot use.
Fix this by correcting NetworkInterfaceState#isRestricted(), so
that unprivileged callers can see only unrestricted interfaces.
Privileged callers are unaffected.
This bug probably went unnoticed because restricted Ethernet
interfaces are rare (likely used only on auto devices) and
because the callers that care about those restricted interfaces
are generally privileged.
Bug: 148824036
Test: atest android.net.EthernetTetheringTest#testPhysicalEthernet
Merged-In: Idff3b05a193a80c581d80d0e4fe9c2d3fc0d8a25
Change-Id: Idff3b05a193a80c581d80d0e4fe9c2d3fc0d8a25
Both EthernetManager#getAvailableInterfaces() and the no-arg
version of EthernetManager#isAvailable() end up calling
EthernetServiceImpl#getAvailableInterfaces. This method attempts
to filter out restricted interfaces if the caller does not have
the CONNECTIVITY_USE_RESTRICTED_NETWORKS permission.
Unfortunately EthernetNetworkFactory's notion of a restricted
interface is the opposite of what it should be. This means that
while privileged callers can see all interfaces, unprivileged
callers can only see restricted interfaces which they cannot use.
Fix this by correcting NetworkInterfaceState#isRestricted(), so
that unprivileged callers can see only unrestricted interfaces.
Privileged callers are unaffected.
This bug probably went unnoticed because restricted Ethernet
interfaces are rare (likely used only on auto devices) and
because the callers that care about those restricted interfaces
are generally privileged.
Bug: 148824036
Test: atest android.net.EthernetTetheringTest#testPhysicalEthernet
Change-Id: Idff3b05a193a80c581d80d0e4fe9c2d3fc0d8a25
am skip reason: Change-Id I015219cbd03626c38fb5156d0cb2991ba7d7def7 with SHA-1 0c30d949df is in history
Change-Id: Ia636dce7ecaba574d55352391d99f88224221a49
am skip reason: Change-Id I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d with SHA-1 876e5e16a9 is in history
Change-Id: I7f7417ccca7c9cfac332954a6f6dea5a58a54239
am skip reason: Change-Id I015219cbd03626c38fb5156d0cb2991ba7d7def7 with SHA-1 0c30d949df is in history
Change-Id: I1b6127eb68cb3986726ea460c84352c8b23e1e2e
am skip reason: Change-Id I015219cbd03626c38fb5156d0cb2991ba7d7def7 with SHA-1 165b456d92 is in history
Change-Id: I9760fbf2fb0612ed6403c12c7cba213a2f460c74
am skip reason: Change-Id I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d with SHA-1 876e5e16a9 is in history
Change-Id: I53d8a9896257920d4a3db462a7f3a1c8974361fa
am skip reason: Change-Id I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d with SHA-1 e81f99d532 is in history
Change-Id: I9cea9b849fff6b292d81b6bd2a1c8338d3d271a1
am skip reason: Change-Id I015219cbd03626c38fb5156d0cb2991ba7d7def7 with SHA-1 0c30d949df is in history
Change-Id: I799d401c9dbb64031ee0601bfbb869588c2843dc
am skip reason: Change-Id I015219cbd03626c38fb5156d0cb2991ba7d7def7 with SHA-1 165b456d92 is in history
Change-Id: I36f91fca0d679a9673b743be953f191e16440330
am skip reason: Change-Id I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d with SHA-1 876e5e16a9 is in history
Change-Id: Ie8adbc5239fdf8343a9b0e4cd30eddc28e96caaa
am skip reason: Change-Id I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d with SHA-1 e81f99d532 is in history
Change-Id: I53102631b3030ba3307c2ffe04d340c9421fc50b
am skip reason: Change-Id I015219cbd03626c38fb5156d0cb2991ba7d7def7 with SHA-1 165b456d92 is in history
Change-Id: I798052af6ff6704c9088c3e0f2952b1ccc41d94b
am skip reason: Change-Id I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d with SHA-1 e81f99d532 is in history
Change-Id: I3adadae13ef96c50e4083b8d826730e0fb4990fd
Currently, callbacks for tethered interface availability are sent
based on interface link state. This is incorrect:
- It is acceptable and expected to be able to enable tethering on
an interface that does not yet have link up.
- It doesn't seem useful to disable Ethernet tethering if link
temporarily goes down.
Instead, only base the callbacks on whether an interface exists
or not.
Bug: 150644681
Test: WIP tests in aosp/1260100 pass
Change-Id: I015219cbd03626c38fb5156d0cb2991ba7d7def7
Merged-In: I015219cbd03626c38fb5156d0cb2991ba7d7def7
(cherry picked from commit 64d12ea20ce3cd822518e0f15ed7483a2fb91a50)
Currently, the default interface can only ever go from null to
non-null. This is correct for fixed interfaces (because they
don't get unplugged) and it's generally correct for USB
interfaces that use ethX as their device name (because when
they are unplugged and plugged in again, the device name won't
change). But it is not correct if, for example, the default
interface is a test interface. So, allow mDefaultInterface to go
back to null.
This CL also fixes a crash if a tethered interface request is
added and removed when there is no default interface.
Also, make dump() report tethered interface requests.
Also remove an unused variable that I missed in the previous CL.
Bug: 150644681
Test: tested by EthernetTetheringTest in same topic
Change-Id: I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d
Merged-In: I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d
(cherry picked from commit cc156c2f7793731b2699e194d4b164138ee4cf62)
am skip reason: Change-Id I86eef7a93267f800dbfc8eafd307effa76a344ca with SHA-1 fb336e9296 is in history
Change-Id: I4562315db7b0d4e933d22aa0872a989fa243e5fb
am skip reason: Change-Id I86eef7a93267f800dbfc8eafd307effa76a344ca with SHA-1 fb336e9296 is in history
Change-Id: Iecf35ecae75b28c4bb529b9baf17121ef7e9dea2
am skip reason: Change-Id I86eef7a93267f800dbfc8eafd307effa76a344ca with SHA-1 841195a103 is in history
Change-Id: Icff2a8f5a0ef5d3598cc7deb6e465b97a2c92f4e
am skip reason: Change-Id I86eef7a93267f800dbfc8eafd307effa76a344ca with SHA-1 841195a103 is in history
Change-Id: Iec8edbba782a10b8d5c2b8c740d265dc2c11e2a1