am skip reason: Change-Id I5109d8da3aeb6c1f6523291d9e2ec92c64b5ad2d with SHA-1 e81f99d532 is in history
Change-Id: I3adadae13ef96c50e4083b8d826730e0fb4990fd
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 841195a103 is in history
Change-Id: I31d44b8c1a538f7c4573cf6fa476529326a9c0bf
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
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
This CL adds a setIncludeTestInterfaces method to EthernetManager
that, when called, causes the Ethernet service to recognize and
manage test interfaces created by TestNetworkManager.
Bug: 150644681
Test: Tested by EthernetTetheringTest in same topic
Change-Id: I86eef7a93267f800dbfc8eafd307effa76a344ca
Merged-In: I86eef7a93267f800dbfc8eafd307effa76a344ca
(cherry picked from commit 4978dbd5fb6592fc4e7be08d02783752245da634)
This CL adds a setIncludeTestInterfaces method to EthernetManager
that, when called, causes the Ethernet service to recognize and
manage test interfaces created by TestNetworkManager.
Bug: 150644681
Test: Tested by EthernetTetheringTest in same topic
Change-Id: I86eef7a93267f800dbfc8eafd307effa76a344ca
This reverts the parts of the above commit that have to do
with NetworkScore. The parts that convert the factory to the
new NetworkAgent API are conserved.
Bug: 113554781
Test: FrameworksNetTests
Change-Id: If2c368e084e29f9f358f43dcd547d42e8c7c4846
am skip reason: Change-Id I78f85bc36aaceb62ce274003a75ea99d0b6bc8b7 with SHA-1 c750566a77 is in history
Change-Id: I54f24efc6379337a48c54e8ef551117974d6ac04
Currently, Ethernet only supports interfaces in client mode
(e.g., to connect to the Internet). Add minimal support to
Ethernet to support interfaces in server mode. This simple
implementation only works on the default interface, which is the
first interface that is detected on boot (even if the interface
is later removed).
This also provides (but does not yet unhide) a simple API for
Tethering to request that the next-plugged-in interface to be
placed into server mode.
Test: Enabling tethering with change on top
Bug: 130840861
Merged-In: I78f85bc36aaceb62ce274003a75ea99d0b6bc8b7
Change-Id: I78f85bc36aaceb62ce274003a75ea99d0b6bc8b7
(clean cherry-pick from internal branch)
Currently, Ethernet only supports interfaces in client mode
(e.g., to connect to the Internet). Add minimal support to
Ethernet to support interfaces in server mode. This simple
implementation only works on the default interface, which is the
first interface that is detected on boot (even if the interface
is later removed).
This also provides (but does not yet unhide) a simple API for
Tethering to request that the next-plugged-in interface to be
placed into server mode.
Test: Enabling tethering with change on top
Bug: 130840861
Change-Id: I78f85bc36aaceb62ce274003a75ea99d0b6bc8b7
When releaseNetworkFor is called, refCount should be equal to 1 for
network.stop() to be called. This is the same logic that is followed by
WifiNetworkFactory also.
In the current code, when refCount is 2 and releaseNetworkFor() is called,
network.stop() will be executed and will stop Ethernet
Bug: 146089778
Test: build and boot OK
Change-Id: Ib7d1b488a2943364a8ba4a89eec5de4c33cf1d5a
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 permissions
checks, and convert checks that protect code that should not be
called outside the system to a signature permission. So replace
the permission to NETWORK_STACK.
Bug: 32963470
Test: atest EthernetServiceTests
Change-Id: I2a88d04bbdcd7e7e624b9065372a6603d2bb45a2
When this.mIpConfig is not initialized, it will cause a
java.lang.NullPointerException and put the device in a boot
loop with the following error:
FATAL EXCEPTION IN SYSTEM PROCESS: EthernetServiceThread
Test: passed pre-submit boot test.
Change-Id: I47df68071b4c07a4136c0abcbe69ee7ada7090e0