am skip reason: Change-Id Ie7b70750ef0e17141080f4266dea6155c3601569 with SHA-1 79eb7ba87b is in history
Change-Id: I44fcf8f2fc9ffcf5b21ce0e3462019d6478584e3
am skip reason: Change-Id Ie7b70750ef0e17141080f4266dea6155c3601569 with SHA-1 79eb7ba87b is in history
Change-Id: Iba771d95f044ae505cdedf6c2a94ac057c0d05a2
am skip reason: Change-Id Ie7b70750ef0e17141080f4266dea6155c3601569 with SHA-1 79eb7ba87b is in history
Change-Id: Id73857a02ed1e4b3b30d5166451af59e7583cd72
This is a combination of ag/10147368 and ag/10438581.
ag/10147368 implemented this conversion together with
using the planned NetworkScore API, while ag/10438581
reverted the parts that had to do with NetworkScore.
This is just a squash of these two patches and it
brings the factory in line with the code in rvc-dev.
Test: FrameworksNetTests NetworkStackTests EthernetTetheringTest
Change-Id: Ib214fbbd042f2c0ebd01cf5b0ec33d922629677e
Merged-In: Ie7b70750ef0e17141080f4266dea6155c3601569
am skip reason: Change-Id Idff3b05a193a80c581d80d0e4fe9c2d3fc0d8a25 with SHA-1 bc7ff5d89f is in history
Change-Id: Ied9274f2513e7c49a267d0a9884784570eadd8fb
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