Commit Graph

94 Commits

Author SHA1 Message Date
Pavel Maltsev
11d2d05db6 Merge "Add missing features to static IP config"
am: a80cdd187b

Change-Id: I7be794ac92702945a0f91948438a14f537e13b53
2018-06-01 11:23:58 -07:00
Treehugger Robot
a80cdd187b Merge "Add missing features to static IP config" 2018-06-01 17:21:27 +00:00
Pavel Maltsev
8d5e3e989a Add missing features to static IP config
In addition to IP address, OEMs should be able to set gateway, DNS and
domains.

Bug: 80090920
Test: runtest -x frameworks/opt/net/ethernet/tests

Cherry picked without conflicts.

Merged-in: I4e3d51a6955d7bfe5ca4e8079936ea10c28832e4
(cherry picked from commit e28118d0c3)

Change-Id: Ia8f095fbbcd414c070be4d5ce79dbc70bb9b1937
2018-05-31 11:51:07 -07:00
Pavel Maltsev
07de1385c3 Fix overriding ip configurtion with default one
am: 6c61d1013d

Change-Id: I98f742a008ede5078fca2cdbdb937d4d659dea80
2018-05-15 21:45:28 -07:00
Pavel Maltsev
6c61d1013d Fix overriding ip configurtion with default one
EthernetConfigStore should return 'null' for default interface if the
default interface hasn't been configured otherwise it would be hard to
distinguish not-configured vs configured with default values.

Bug: 79415136
Test: verified w/o .xml overlay Ethernet continues to work
Test: verified that ip config from overlay is not getting overriden
Merged-In: I82933a83a7d13903bbce9a85d6e8dae1a492bf24
Merged-In: I98133ad41229b93f51ea3976d311f9896456a56c
Change-Id: I4eb914923f3664b12b6af0ae05f45b60c5312b02
(cherry picked from commit a8f3c01be9)
2018-05-16 11:36:28 +09:00
Pavel Maltsev
a8ed3da6b5 Fix NPE during dumpsys ethernet
am: aea0136d01

Change-Id: Iaba04ea0a6ffc07a289b93cc3bf2192fcf9fb1c2
2018-05-08 03:32:27 -07:00
Pavel Maltsev
aea0136d01 Fix NPE during dumpsys ethernet
Handle the case when IpClient wasn't created for network interface which
may happen for virtual device

Bug: 78482534
Test: dumpsys ethernet
Merged-In: I374a91265660e814b4f0f033b3970fd98921ca84
Merged-In: Id4ab7c9a8a5238491c8405ae260862e76a7671c1
Change-Id: I3405dd4f72d4a6444448f0d6ec0497aead07bade
(cherry picked from commit 97446b8978)
2018-05-08 16:48:32 +09:00
Erik Kline
206f8c6993 Wait for IpClient to shutdown
am: 7048285cb3

Change-Id: I82d6635bac0836852bff74005ce75a6c36c570db
2018-02-23 07:40:03 +00:00
Erik Kline
7048285cb3 Wait for IpClient to shutdown
This makes sure that we never accidentally have two IpClients vying
for control of the same interface.

Test: as follows
    - built
    - flashed
    - booted
Bug: 62476366
Change-Id: Iab4ca7c2445e70b6f8beaf5dc6921cb0c6cd56ed
2018-02-21 15:10:01 -08:00
Luis Hector Chavez
e340642858 Avoid re-creating an IpClient if the network has already started
am: de93b3eb05

Change-Id: Id4f8fa2fa3c4c929cdc777125f6e85dce9187bff
2018-02-21 20:33:31 +00:00
Luis Hector Chavez
de93b3eb05 Avoid re-creating an IpClient if the network has already started
This change avoids calling start() on needNetworkFor() if an IpClient
object has already been created. This is the case when the interface is
connected from boot, as is the case in Chrome OS.

Bug: 73396557
Test: Networking is 100% stable in Chrome OS
Change-Id: Iaa073d6477aadca2e4e5233b333d717ad82c1f3d
2018-02-21 20:25:20 +00:00
Pavel Maltsev
aaeb281ee3 Enable multiple active Ethernet interfaces
am: 52d046eb8a

Change-Id: I0cbd8de0f1bafb2579f51d8c3ad7af9c165db565
2018-02-03 00:08:08 +00:00
Pavel Maltsev
52d046eb8a Enable multiple active Ethernet interfaces
- reworked EthernetNetworkFactory to support multiple active Ethernet
interfaces
- allow vendors to specify network capabilities + ip config through XML
config overlay

Test: manual using hikey960 + multiple usb->eth adapters
Change-Id: Ie39bcb0d2a3f960f497222159c7bd5797accaa68
2018-01-25 14:56:40 -08:00
Jeff Sharkey
fa151c0ef9 Merge "Add "not congested" network capability."
am: a289c9eb47

Change-Id: Iee5b6d1b5f7d080f4b31f4a65950f0c326f6908c
2018-01-18 03:58:19 +00:00
Jeff Sharkey
a289c9eb47 Merge "Add "not congested" network capability." 2018-01-18 03:28:34 +00:00
Jeff Sharkey
efe4af4926 Add "not congested" network capability.
Can be used by a network to indicate when it's congested, meaning that
apps should defer network traffic that could be done at a later time.

Test: bit FrameworksNetTests:android.net.,com.android.server.net.,com.android.server.connectivity.VpnTest,com.android.server.ConnectivityServiceTest
Bug: 64133169
Change-Id: I97664d041920c8d6e3f9fb7c9e8638925b15c30e
2018-01-17 02:30:28 -07:00
Xin Li
7e00d1d04c Merge commit 'a1081715561b15daf2018c74e9aff434f602fcc9' into HEAD
Change-Id: I1da9335d26d418de026c25d59aa6ee43af6d602c
2017-11-13 14:35:38 -08:00
Jeff Sharkey
497505d690 Define NOT_ROAMING network capability.
am: 30b747ef95

Change-Id: Iffb3dad690a7986c6842976cfe39b1fbf7e68057
2017-11-03 22:52:18 +00:00
Jeff Sharkey
30b747ef95 Define NOT_ROAMING network capability.
The "roaming" state of a network really belongs on NetworkCapabilities
instead of being published through NetworkInfo.isRoaming().  One major
reason is to support developers creating NetworkRequests for a
non-roaming network.

Test: bit FrameworksNetTests:android.net.,com.android.server.net.,com.android.server.connectivity.
Bug: 68397798, 16207332
Change-Id: I0722d7b38d0478de3834b869552f48403af9d553
2017-10-30 12:02:14 -06:00
Elvis Chien
726e301e7b ethernet: Fix the connect fail issue when switch DHCP to Static config at Ethernet interface.
am: 89ffed793f

Change-Id: Ieaade184b2a88f9eb6c8ceb821a54f3db006f261
2017-10-19 07:45:43 +00:00
Elvis Chien
89ffed793f ethernet: Fix the connect fail issue when switch DHCP to Static config at Ethernet interface.
add different logic to handle static ip configuration.

Bug: b/64914694 <http://b/issue?id=64914694&query=64914694>
Test: follow the following steps to switch ethernet config
1.Plug Ethernet cable ,Ethernet succeed to access internet with DHCP mode
2.Change Ethernet IP settings to Static
3.Input correct ip , gateway, prefix length, DNS
4.UI show Connected, but failed to access Internet.

Change-Id: I223bca85814e94745fbb8b50ca677eb7032e9bb3
(cherry picked from commit 44a107bc8f058c6ac1aab6fbfbf60bf8f3474711)
2017-10-19 14:50:00 +09:00
Lorenzo Colitti
a108171556 Don't crash if the interface disappears just after appearing. am: f851d0347e am: cbb7d86209
am: febd78ae31

Change-Id: I3d917339c80f0ff6a90813b598399f3cc415bbf4
2017-06-23 06:54:17 +00:00
Lorenzo Colitti
78e7dbe3f9 Don't crash if the interface disappears just after appearing. am: f851d0347e am: 74681472c8
am: 3b5a2422fc

Change-Id: I061c5f6e6c738035d57d999ae91c07d0d3ea0924
2017-06-23 06:54:04 +00:00
Lorenzo Colitti
febd78ae31 Don't crash if the interface disappears just after appearing. am: f851d0347e
am: cbb7d86209

Change-Id: I4957474a965553a03874f73dd1649d78646872ad
2017-06-23 06:50:48 +00:00
Lorenzo Colitti
3b5a2422fc Don't crash if the interface disappears just after appearing. am: f851d0347e
am: 74681472c8

Change-Id: I34a4314b5d2e2a9ea591a64ac5dcc3fd9ef677c6
2017-06-23 06:49:33 +00:00
Lorenzo Colitti
74681472c8 Don't crash if the interface disappears just after appearing.
am: f851d0347e

Change-Id: If202c458162b6b89d5bef07a5bdc31a7ffea2d17
2017-06-23 06:46:10 +00:00
Lorenzo Colitti
cbb7d86209 Don't crash if the interface disappears just after appearing.
am: f851d0347e

Change-Id: Icd22bf44b00acc2f94ee916c2e2a43c6b5962c6f
2017-06-23 06:45:04 +00:00
Lorenzo Colitti
1ccfb0b70c Don't crash if the interface disappears just after appearing. am: 17f4e4a027 am: b131ddc5fd am: 0f5a6a6bd2
am: c44ff6cd15

Change-Id: I832ce1a318425617aed7f684bf2d5ed8905b8960
2017-06-23 05:02:47 +00:00
Lorenzo Colitti
c44ff6cd15 Don't crash if the interface disappears just after appearing. am: 17f4e4a027 am: b131ddc5fd
am: 0f5a6a6bd2

Change-Id: I80d20a76367a03e4990a0b59bda81c2d21d90d20
2017-06-23 04:59:37 +00:00
Lorenzo Colitti
0f5a6a6bd2 Don't crash if the interface disappears just after appearing. am: 17f4e4a027
am: b131ddc5fd

Change-Id: Ib35b0a5c3e7bcd44c8033ae53ce0fbb5c7d86bec
2017-06-23 04:54:35 +00:00
Lorenzo Colitti
f851d0347e Don't crash if the interface disappears just after appearing.
If the interface disappears between interfaceAdded() and
setInterfaceUp, we'll crash with an IllegalStateException in
NetworkManagementService#setInterfaceConfig.

Ignore the error instead. This should be safe because we don't
modify any state unless our calls succeed.

(cherry picked from commit 17f4e4a027)

Bug: 62870779
Test: builds aosp_bullhead-eng
Test: builds marlin-eng
Test: exception is logged and device doesn't crash when unplugging USB ethernet adapter while it's being initialized
Change-Id: If8c2375f7fffe25a9fa79dc4f1981c745384a276
2017-06-23 13:54:27 +09:00
Lorenzo Colitti
b131ddc5fd Don't crash if the interface disappears just after appearing.
am: 17f4e4a027

Change-Id: I9f591c6d3136ebdab13051c30f02888320e2b309
2017-06-23 04:50:13 +00:00
Lorenzo Colitti
17f4e4a027 Don't crash if the interface disappears just after appearing.
If the interface disappears between interfaceAdded() and
setInterfaceUp, we'll crash with an IllegalStateException in
NetworkManagementService#setInterfaceConfig.

Ignore the error instead. This should be safe because we don't
modify any state unless our calls succeed.

Bug: 62870779
Test: builds aosp_bullhead-eng
Change-Id: If8c2375f7fffe25a9fa79dc4f1981c745384a276
2017-06-23 01:41:47 +09:00
Lorenzo Colitti
8555952a34 Make Ethernet more robust. am: 62d5e744c3 am: 042561637c am: 315c859e8a
am: e0d41d9626

Change-Id: I05e3f094afaa45e282b0433eba8190088ae198b0
2017-06-19 06:23:57 +00:00
Lorenzo Colitti
e0d41d9626 Make Ethernet more robust. am: 62d5e744c3 am: 042561637c
am: 315c859e8a

Change-Id: I5b41e68577950ba16557427e552e6d03d983dba0
2017-06-19 06:18:52 +00:00
Lorenzo Colitti
315c859e8a Make Ethernet more robust. am: 62d5e744c3
am: 042561637c

Change-Id: I134d6c7d9769eca8bb157d9833181df09e8e8e38
2017-06-19 06:13:47 +00:00
Lorenzo Colitti
042561637c Make Ethernet more robust.
am: 62d5e744c3

Change-Id: I290626b64fa6009b7365a2f7957ddb0776777683
2017-06-19 06:04:17 +00:00
Lorenzo Colitti
62d5e744c3 Make Ethernet more robust.
1. Remove the IP provisioning thread and just attempt
   provisioning indefinitely whenever we have an interface.
2. Make all methods run on the passed-in handler thread. This
   makes it easier to verify correctness by code inspection.
3. Remove the code that changes the factory score depending on
   whether we're tracking an interface and have link. This is
   unnecessary complexity, as there is no penalty to accepting a
   request even if we don't have an interface.
4. Remove code duplication and only have one codepath for
   stopping layer 3.

Tested the following are tested with this CL:
- Booting with an interface connected.
- Disconnecting/reconnecting the Ethernet cable repeatedly,
  particularly at inconvenient times (e.g., during provisioning).
- Similarly, disconnecting/reconnecting USB Ethernet interfaces.
- Falling back to another Ethernet interface if the currently
  tracked Ethernet interface is unplugged.
- Disconnecting and restarting provisioning when provisioning is
  lost (e.g., if the default route is deleted).
- Crashing the system server causes Ethernet to reconnect on
  restart.
- The above while running watch -n 0.1 adb shell dumpsys ethernet

(cherry picked from commit 9effed6f9e)

Bug: 62308954
Test: tested on marlin with USB ethernet adapters, as described
Test: smoketested on aosp_bullhead
Change-Id: Ie3041f1d453d15c81eee81adfc8593269c499d79
2017-06-19 12:31:42 +09:00
Lorenzo Colitti
26fd808c6b Merge "Make Ethernet more robust. am: 9effed6f9e am: 00f803738d" into oc-dr1-dev-plus-aosp
am: c9eddcde9c

Change-Id: I5e05dd306ae651aa75735d887c2a74e5f2fe4f6d
2017-06-09 07:38:38 +00:00
Lorenzo Colitti
e68d804b28 Make Ethernet more robust. am: 9effed6f9e am: 00f803738d
am: 11238e8984

Change-Id: I9cf638511ada7a0672d0b9a268d3ea082f162961
2017-06-09 07:38:29 +00:00
Android Build Merger (Role)
c9eddcde9c Merge "Make Ethernet more robust. am: 9effed6f9e am: 00f803738d" into oc-dr1-dev-plus-aosp 2017-06-09 07:34:37 +00:00
Lorenzo Colitti
92995a88e0 Make Ethernet more robust. am: 9effed6f9e
am: 00f803738d

Change-Id: I4dd010c8e49ac2d603f7ed617209bdc3759680fd
2017-06-09 07:34:32 +00:00
Lorenzo Colitti
11238e8984 Make Ethernet more robust. am: 9effed6f9e
am: 00f803738d

Change-Id: I03f9b28561e0fb1fd1c5e388820e02748c8580b3
2017-06-09 07:34:29 +00:00
Lorenzo Colitti
00f803738d Make Ethernet more robust.
am: 9effed6f9e

Change-Id: I1c531a142706d3cbe0da3adf810887cc221944ed
2017-06-09 07:32:59 +00:00
Lorenzo Colitti
9effed6f9e Make Ethernet more robust.
1. Remove the IP provisioning thread and just attempt
   provisioning indefinitely whenever we have an interface.
2. Make all methods run on the passed-in handler thread. This
   makes it easier to verify correctness by code inspection.
3. Remove the code that changes the factory score depending on
   whether we're tracking an interface and have link. This is
   unnecessary complexity, as there is no penalty to accepting a
   request even if we don't have an interface.
4. Remove code duplication and only have one codepath for
   stopping layer 3.

Tested the following are tested with this CL:
- Booting with an interface connected.
- Disconnecting/reconnecting the Ethernet cable repeatedly,
  particularly at inconvenient times (e.g., during provisioning).
- Similarly, disconnecting/reconnecting USB Ethernet interfaces.
- Falling back to another Ethernet interface if the currently
  tracked Ethernet interface is unplugged.
- Disconnecting and restarting provisioning when provisioning is
  lost (e.g., if the default route is deleted).
- Crashing the system server causes Ethernet to reconnect on
  restart.
- The above while running watch -n 0.1 adb shell dumpsys ethernet

Bug: 62308954
Test: tested on marlin with USB ethernet adapters, as described
Change-Id: Iad12a52a903bfaccf7e245dfe499652c752c31e9
2017-06-09 14:01:29 +09:00
Lorenzo Colitti
4c2a7142ff Merge "Disable the IpManager timeout on Ethernet. am: 0587321554 am: 8bb0952a05" into nyc-mr1-dev-plus-aosp
am: d40615e24e

* commit 'd40615e24ec0532a04ac76f45f2061f61a0e7ba1':

Change-Id: Ib7fbcd926f1a128d86e7710e7e1f7f800afa695a
2016-04-29 13:41:32 +00:00
Lorenzo Colitti
a7b9e2fdb5 Disable the IpManager timeout on Ethernet. am: 0587321554 am: 8facc75476
am: 5a1fe20b16

* commit '5a1fe20b16c0e7030b03c47136cccd9d62b1b966':
  Disable the IpManager timeout on Ethernet.

Change-Id: Idcc944d0edeedf648349e5268fddd724fe9d65bd
2016-04-29 13:41:32 +00:00
Android Build Merger (Role)
d40615e24e Merge "Disable the IpManager timeout on Ethernet. am: 0587321554 am: 8bb0952a05" into nyc-mr1-dev-plus-aosp 2016-04-29 13:39:14 +00:00
Lorenzo Colitti
5a1fe20b16 Disable the IpManager timeout on Ethernet. am: 0587321554
am: 8facc75476

* commit '8facc754767f09f15b7f99c82990c80df40d7014':
  Disable the IpManager timeout on Ethernet.

Change-Id: I46ab6959dce02c5f5da3324d7c4ed59303dcd1cb
2016-04-29 13:39:06 +00:00
Lorenzo Colitti
9b49b7f8b2 Disable the IpManager timeout on Ethernet. am: 0587321554
am: 8bb0952a05

* commit '8bb0952a059c20a47ea0747346f8afb896a6ab9d':
  Disable the IpManager timeout on Ethernet.

Change-Id: I698a59f0b897422b88c4f09f8116a6eab3c14701
2016-04-29 13:39:06 +00:00