History log of /frameworks/base/services/net/java/android/net/ip/IpClient.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3f8306b8c56b58054800a576912204e8bf66f9f4 01-May-2018 Erik Kline <ek@google.com> Add static IpClient logging

Support keeping IpClient logs around and dumping them
during dumpsys. Previously we got this benefit for
wifi by virtue of WifiStateMachine's long-lived nature.
Now that this is changing we need to be sure we have
logs, and this method gets us Ethernet logs as well.

Bug: 62476366
Bug: 77999594
Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
- dumpsys connmetrics [ipclient] works
Change-Id: I1136a83de8097fdb4130debe1eaf689be7132fe5
/frameworks/base/services/net/java/android/net/ip/IpClient.java
3cc40ea6c50c976dd4e6485574a8be899867f610 23-Apr-2018 Bernie Innocenti <codewiz@google.com> apf: Add counters for dropped / passed packets

ApfFilter maintains separate counters for each reason why a packet was
passed or dropped by the filter logic.

There's also a total which should match the individual counters,
*unless* the APF interpreter aborted execution early due to an illegal
instruction or an out-of-bounds access.

Test: both on APFv2 and APFv4-capable device:
runtest -x tests/net/java/android/net/ip/IpClientTest.java
runtest -x tests/net/java/android/net/apf/ApfTest.java
manual tests connected to an AP
Bug: 73804303
Change-Id: I54b17fcbb95dfaea5db975d282314ce73d79d6ec
/frameworks/base/services/net/java/android/net/ip/IpClient.java
bb2193bf5877b7a93aebefdb74a8c7f410a17907 16-Apr-2018 Bernie Innocenti <codewiz@google.com> Add support for reading a snapshot of the APF data

No functional change yet, since startReadPacketFilter() has no callers
at this time. In the future, this new hook will be used to take
periodic snapshots of the APF memory (for instance, when the device
wakes up).

Design note: WifiStateMachine grabs the APF data synchronously
from another thread, but then the data snapshot is delivered to IpClient
via an asynchronous reply, following the same pattern used by other
commands. This means that there's no (practical) way for IpClient to
read the APF data just before replacing the APF program.

Even with this limitation, it's still possible to reliably decode packet
counters and compute deltas relative to the last snapshot, provided that
the address range isn't cleared when installing a new APF filter.

Bug: 73804303
Test: Manual - called the new code and inspected 'dumpsys wifi' output.
Change-Id: Ia0923d71cf3ee4128fb1c381557316300adac1a3
/frameworks/base/services/net/java/android/net/ip/IpClient.java
d7375ac9d79b86ffae9fc1e0d92505b6bfa57eb0 12-Mar-2018 Erik Kline <ek@google.com> Support bluetooth not using MultinetworkPolicyTracker

This required advancing the IpManager to IpClient refactoring
(Bluetooth used IpManager and friends). Most importantly, the
Bluetooth code used WaitForProvisioningCallback, so this is
moved into IpClient proper now. Also: some more renaming
cleanup.

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 62476366
Bug: 72663849

Merged-In: I5e5b2c59ad3ea9ad574e8e683bcab3b09cfe0791
Merged-In: I89b45310181d952129fb2294db63654da9b4057f
Change-Id: I9eee2a9d5c31cdd48a054a7edc3403584efb1864
(cherry picked from commit 8d1fe54be1b605846cca9dfe4a966b3c5e739caa)
/frameworks/base/services/net/java/android/net/ip/IpClient.java
5be71dcb03ff689098d992c5455f0a1766c8a2e0 28-Mar-2018 Bernie Innocenti <codewiz@google.com> APF: drop multicast ICMPv6 while in doze mode

Some WiFi hotspots send excessive multicast IPv6 ping requests which
cause considerable power drain. Thus, drop all multicast ICMPv6 ping
requests while the device is in doze mode.

Bug: 66930077
Test: runtest -x tests/net/java/android/net/apf/ApfTest.java
Test: manual - compared generated APF bytecode using apf_disassembler
Test: manual - force idle mode while sending multicast pings to device
Change-Id: I25dbf99985cf4413b4d0e3920d281fe6d663197a
(cherry picked from commit e2c70f8a6092f740ea10e7476b33860d756cf94f)
/frameworks/base/services/net/java/android/net/ip/IpClient.java
ea1b8bd5a5647dd1cb65cac0100bac29e41ddc48 02-Mar-2018 Erik Kline <ek@google.com> Fail if the interface is not available when starting

Addresses a long-standing TODO. Now, when calling IpClient's
startProvisioning(), the interface has to be available (i.e.
InterfaceParams#getByName() must return non-null).

Also:
- add a test
- refactor for testability
- delete some constructors no longer used
- properly handle passed-in null IpClient.Callback
- some more IpManager -> IpClient renaming
- permit recording metrics before starting a provisioning
attempt (logging immediate errors) without Log.wtf().

Test: as follows
- built
- flashed
- booted
- runtest frameworks/opt/net/wifi/tests/wifitests/runtests.sh passes
- runtest frameworks-net passes
- basic WiFi IpClient connections works fine
Bug: 62476366
Bug: 73487570
Merged-In: I68e5e24122dc31e730cdbe8d75e33847e6332da4
Merged-In: Ifd27f5d908947cd7b4e1b8d54f9fa87e43ebb11b
Merged-In: Ief3c8e1652f69af0276fe35946ae1bf6e6b1b57e
Change-Id: Ic83ad2a65637277dcb273feb27b2d1bb7a11eb2b
(cherry picked from commit b152cd0aa4f333b721615bb17773b35a989245fb)
/frameworks/base/services/net/java/android/net/ip/IpClient.java
ce194e0659c92f4b4bc71d1842c449df1013be14 21-Feb-2018 Erik Kline <ek@google.com> Allow callers to synchronously block for shutdown

Add a simple CountDownLatch and a public method that callers can use
to block until IpClient has cleanly shutdown the state machine.

In cases where IpClients are created and destroyed dynamically for
the same interface name, this can be used to make sure only one
IpClient at a time is touching the given interface.

Test: as follows
- built
- flashed
- booted
- OTG ethernet works (i.e. client mode)
- removing and reinserting the ethernet dongle continues
to show the <-> Ethernet sysui icon and basic network
connectivity works
- removing and reinserting the cable (link up/down events)
also shows the <-> Ethernet sysui icon and basic network
connectivity works
Bug: 62476366

Change-Id: If4bffd54b7ebc088ec07cac10251e451f8161b6c
/frameworks/base/services/net/java/android/net/ip/IpClient.java
8bd00d5f7ced34a45173e45537dc3100d62ee6a5 08-Dec-2017 Erik Kline <ek@google.com> Refactor to InterfaceParams utility class

NetworkInterface throws Exceptions every time you look at it askance.
Try to make something we instantiate fully, once, and pass it around.

Partial MacAddress-ification as well, for good measure.

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
- basic IPv6 tethering works
Bug: 32163131
Bug: 62476366
Change-Id: I16c145fddb4e76387370338d792a438eed886d7f
/frameworks/base/services/net/java/android/net/ip/IpClient.java
652044a7db7a64bf39f18a306431767bdf886ac1 15-Dec-2017 Erik Kline <ek@google.com> Revert "Send empty LinkProperties when entering StoppedState."

This reverts commit 94209ab7686b202cfad6e42e07056bb9511006a8.

Reason for revert: should not have auto-submitted prior to more extensive wifi team testing.

Change-Id: Ie81b10473caf34971226948038bc20dc4fa6a1ae
/frameworks/base/services/net/java/android/net/ip/IpClient.java
94209ab7686b202cfad6e42e07056bb9511006a8 11-Dec-2017 Erik Kline <ek@google.com> Send empty LinkProperties when entering StoppedState.

Additionally, no longer try to transition from within a State's
enter() method (this can encounter Log.wtf()s). Introduce some
CMD_JUMP_* commands and use deferMessage().

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes (except for IpConnectivityMetricsTest failures)
- manual changing from DHCP to static configurations works:
2017-12-11T19:06:19.082 - INVOKE onLinkPropertiesChange({{InterfaceName: wlan0 LinkAddresses: [] Routes: [] DnsAddresses: [] Domains: null MTU: 0}})

Bug: 69800563
Bug: 70394432
Change-Id: Ice249a48b66806c0270ec3f11dd2e8e387d4e29b
/frameworks/base/services/net/java/android/net/ip/IpClient.java
e3396622478c7a6f9f5dbb240a403539d44b316e 09-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Revert "Send empty LinkProperties when entering StoppedState.""
f1967c4125f1f08f9ee4a45d68413a1c3a0e7d72 08-Dec-2017 Roshan Pius <rpius@google.com> Revert "Send empty LinkProperties when entering StoppedState."

This reverts commit b3f9f4a30502477e71fc93037dc58080fddb1853.

Reason for revert: Crash in WifiStateMachine (b/70394432)

Change-Id: I3a96c822eddcebcdd6621cee878b865171d094e8
/frameworks/base/services/net/java/android/net/ip/IpClient.java
b501e7e25b4f338d8d2e9dc87945a0376b78cd7d 08-Dec-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Refactor to IpNeighborMonitor and single-threaded semantics"
84714bffa1a58fe1f6a114ae015f8e38be46f32d 19-May-2017 Erik Kline <ek@google.com> Refactor to IpNeighborMonitor and single-threaded semantics

IpReachabilityMonitor (and IpNeighborMonitor) are only accessed from
the IpManager StateMachine's thread. Consequently lots of locking can
now be removed.

Additionally:
- rename BlockingSocketReader to PacketReader
- incorporate IpReachabilityMonitor output in dump()

Test: as follows
- runtest frameworks-net passes
- "adb shell ip neigh change <address> dev wlan0 nud failed"
triggers wifi to disconnect
Bug: 62476366
Bug: 67013397
Change-Id: I18aca29ae0019a72a7e559c2832e0d9b0e33d81e
/frameworks/base/services/net/java/android/net/ip/IpClient.java
b3f9f4a30502477e71fc93037dc58080fddb1853 06-Dec-2017 Erik Kline <ek@google.com> Send empty LinkProperties when entering StoppedState.

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
- changing from DHCPv4 to static while continuously pinging the
default gateway works jsut fine
- dumpsys log shows that during the change we send the empty LP:
12-06 08:46:51.085 - CMD_ON_QUIT wlan0/23 0 0 null [rcvd_in=StoppingState, proc_in=StoppingState]
12-06 08:46:51.092 - INVOKE onLinkPropertiesChange({{InterfaceName: wlan0 LinkAddresses: [] Routes: [] DnsAddresses: [] Domains: null MTU: 0}})

Bug: 69800563
Change-Id: I01047e9a72fce718a167c592bf14406c3bab3ba9
/frameworks/base/services/net/java/android/net/ip/IpClient.java
7216636a621d413453947c1d40feaec9948fed73 13-Oct-2017 Hugo Benichi <hugobenichi@google.com> Refactor ApfFilter creation

This patch introduces a helper ApfConfiguration class for passing filter
parameters to the constructor of ApfFilter. The benefits are:
- less parameter boilerplate across IpManager, ApfFilter, ApfTest
- easier to add more parameters in the future (useful for hardware
counters options and further gservices configurable options)

There is no functional changes otherwise.

Test: runtest frameworks-net
Change-Id: I47231c21df80bc36b6d4e15369748017b50b8da1
/frameworks/base/services/net/java/android/net/ip/IpClient.java
22526e0139bea1928d635c56c6d30ac22baa05d5 31-Oct-2017 Erik Kline <ek@google.com> Rename withIPv6AddrGenMode{Type}() methods to using{Type}MacAddress()

Callers of IpClient can tell it via the Builder whether a stable or
a random link-layer identifier is used. IpClient will make the
appropriate IP-layer adjustments (for now this means RFC 7217
addresses or not).

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
- ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh runs as well
as possible on AOSP (no new errors)
Bug: 62476366
Change-Id: Ic9d52ea4f2c6c3588852ed41c81f8664d5cc298a
/frameworks/base/services/net/java/android/net/ip/IpClient.java
1b2935806fbb3da7efda8d11bf8d00cdf4ec4c12 11-Oct-2017 Erik Kline <ek@google.com> Rename IpManager to IpClient

Test: as follows
- built
- flashed
- booted
- runtest frameworks-net passes
Bug: 62476366
Change-Id: I36255a2c8e1a2f52693716b445359cce0b4304af
/frameworks/base/services/net/java/android/net/ip/IpClient.java