am skip reason: Change-Id Idff3b05a193a80c581d80d0e4fe9c2d3fc0d8a25 with SHA-1 bc7ff5d89f is in history
Change-Id: Ieba7b5f26d5d260a771aa68adc6d836f72f36416
am skip reason: Change-Id Idff3b05a193a80c581d80d0e4fe9c2d3fc0d8a25 with SHA-1 dd397f58c7 is in history
Change-Id: I2635edf03e157c0c139e7539c72fd80d41292767
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: Icceed0b6b2054b28d8e3ad07728fcbb53b31262d
am skip reason: Change-Id I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d with SHA-1 876e5e16a9 is in history
Change-Id: I2193378052b1309503b77023da14917810e48e41
am skip reason: Change-Id I015219cbd03626c38fb5156d0cb2991ba7d7def7 with SHA-1 0c30d949df is in history
Change-Id: Idfd895c4ffb29b3caa15b5a7f86f9ff9758c30de
am skip reason: Change-Id I015219cbd03626c38fb5156d0cb2991ba7d7def7 with SHA-1 165b456d92 is in history
Change-Id: Ifadbf3a7cc72bc3dd0067519571e80e669b010d1
am skip reason: Change-Id I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d with SHA-1 876e5e16a9 is in history
Change-Id: If9d19fa5ad7ea5a49c5c0fc8d2fb53ef90283d7b
am skip reason: Change-Id I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d with SHA-1 e81f99d532 is in history
Change-Id: I47dbc0ccdf9357ef85f2d9e389e0fe47a774b1bd
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)