History log of /frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d3be501437efd5f176e7541cace20b8db467eb47 04-May-2018 Roshan Pius <rpius@google.com> WifiDiagnostics: Fix alert handling

This is currently broken because |mWifiStateMachine| is always null in
WifiDiagnostics (was broken in a refactor of WifiDiagnostics in early O).

Changes in the CL:
a) Construct WifiDiagnostics directly in WifiInjector's constructor (No need
for makeWifiDiagnostics).
b) Directly handle the alert callback. This is already guaranteed to be
invoked from WifiStateMachine thread. There is no need for the extra hop
through WSM message handling.
c) Don't create 2 instances of WifiDiagnostics in WifiStateMachine &
WifiStateMachinePrime.

Some other related cleanups
1) Removed an unused binder object in WifiInjector.
2) Don't cache JavaRuntime instance in WifiInjector.

Bug: 79222338
Test: Unit tests
Test: Triggered an alert (each disconnect triggers an alert) and
verified that:
i) metrics are incremented, and
ii) dumpsys contains the alert data.

Change-Id: I59b157d57cc7ba234efa2dfe20fc59cc5834df2c
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
26e5eb3545a8d67c66e546f4ce413c0611573cfb 15-Mar-2018 Roshan Pius <rpius@google.com> SelfRecovery/WifiDiagnostics: Use a generic reason code for crash

These higher layer modules don't really need to know the exact daemon
that crashed. So, use a generic reason code for all native failures.

Bug: 70937289
Test: Unit tests
Change-Id: I8e88f69dd9017726e9f28cb7f14b7fdc4a9ec45c
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
8b546f06e20053fd4cbcc95e9ace46701c0179f8 09-Feb-2018 Oscar Shu <xshu@google.com> Merge "Enable ringbuffer logging fully"
a5a83f137409921fe95dc01214a0307838b8508c 30-Jan-2018 xshu <xshu@google.com> plumb reason for bugreport to autobug

Bug: 72653348
Test: compile, run ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh

Manual Test:
Flash build to device
connect to GoogleGuest

In terminal
adb shell
su
pkill -f 'wifi@'
Observe on device notification shows bugreport that has the appropriate title and
description.

In new terminal
adb pull bugreports
Inspect zip file and find wifi related reports

Change-Id: I18d3531897f60a43beb83281dbefe099e172030c
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
44615162b5796fdda59159bdc3a675b1964af9ef 02-Feb-2018 xshu <xshu@google.com> Enable ringbuffer logging fully

Start logging ringbuffer on userbuild and also when verbose logging is
off

Bug: 72835518
Test: compile, run ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh

Change-Id: I7788d430436bc28f04de52f04419833bdf4411ea
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
81659f852667dc4ff3904fb2f002ab8669b47410 30-Nov-2017 xshu <xshu@google.com> Automatically trigger bugreport on fatal conditions

Trigger a Wifi-specific bugreport on certain fatal
conditions. For example: if the Wifi HAL crashes.

The Wifi-specific bugreport is (much) quicker to
generate than a standard bugreport. The report
does not leave the device unless the user shares
the bugreport (e.g. using BetterBug).

Bug: 69934148
Test: tests/wifitests/runtests.sh (on walleye)

Manual test
-----------
- boot walleye
- enable wifi
- connect to googleguest
$ adb root
$ adb shell pkill -f 'wifi@'
- notice "Bug report #1 captured" notification
$ adb pull '/data/user_de/0/com.android.shell/files/bugreports
$ unzip bugreports/*.zip
$ grep "was the duration of 'DUMPSTATE'" bugreport*.txt
-> ------ 1.548s was the duration of 'DUMPSTATE' ------

Change-Id: I50982234182d3f7de532fa740b1383a2465893de
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
52ed1731664f7e0b76adb14eec7a76eaa95144c3 22-Dec-2017 Roshan Pius <rpius@google.com> WifiNative: Use iface name for WifiNative methods

Remove any hardcoded interface name throughout the wifi framework
codebase.
Interface name will now be retrieved from the HAL using the
WifiNative.setupInterfaceFor*Mode() methods. All interface specific
operations in WifiNative will now accept the interface name as handle.
The clients (WifiStateMachine, SoftApManager, etc) should use the
appropriate interface name retrieved fom the setup method.

The only exception is external clients like RttService,
WifiScanningService, WifiDiagnostics, etc which will retrieve the active
client interface name from WifiNative.

Bug: 69426063
Test: Manually toggled wifi/softap/airplane mode on/off multiple times.
Test: Unit tests.
Test: Will send for regression tests
Change-Id: If7b34f9c7714fcab8482e6f2cad9078d78229fe2
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
b7fb3f133446c41bdf64ab11e00656b794bed0e4 14-Dec-2017 mukesh agrawal <quiche@google.com> WifiDiagnostics: require verbose mode for ringbuffers

Only enable ringbuffers if the user has enabled verbose
mode via developer options. This is due to the CPU load
required to push the ringbuffers up to the framework,
with the current ringbuffer HAL.

Along the way:
1) Update some test comments to reflect new behavior
2) Remove unnecessary local variable in existing test

Bug: 68283533
Test: runtests.sh -e class com.android.server.wifi.WifiDiagnosticsTest (on walleye)
Manual Test:
- (enable verbose mode)
$ adb shell reboot
$ adb shell bugreport >/tmp/foo.bug 2>/dev/null; </tmp/foo.bug grep --text -A1 ring-buffer | egrep -v '^ring-buffer|^--$|^$' | wc -l
4
Manual Test:
- (disable verbose mode)
$ adb shell reboot
$ adb shell bugreport >/tmp/foo.bug 2>/dev/null; </tmp/foo.bug grep --text -A1 ring-buffer | egrep -v '^ring-buffer|^--$|^$' | wc -l
0
Change-Id: I3d68a80cb298ffee1b00cbc9b8c7756d08a7a943
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
ee66ce102f8cf140394f71baea332eebb47ff4ae 12-Sep-2017 Ningyuan Wang <nywang@google.com> capture BR on wificond or HAL crashes

This allows us to save the most recent kernel logs
when wificond or hal crashes.
This saved log could help us debug underlying driver/kernel
issues.

Bug: 65550505
Bug: 64934608
Test: compile
Test: run frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: manually kill wificond and take bugreport
Find if there is a "Bug dump" section with "reason = 8"

Change-Id: Id9311cee34b3fc25400e804bd96795c7f28f537a
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
31fb63c47b21d369059023532ff8959d12ae4235 06-May-2017 mukesh agrawal <quiche@google.com> WifiDiagnostics: disable ring-buffers on |user| builds

We've seen ring-buffer events cause a number of problems
due to overload or deadlock. While the ring-buffers events
aren't necessarily the root cause of these problems, the
ring-buffer events _are_ a significant factor.

Mitigate risk for end-users, by disabling ring-buffers
on |user| builds.

Note: this CL differs from the automerge-parent CL in
oc-dev. The difference is that we do not remove the
ringBufferSizeIsSmallByDefault() test. The reason for
this difference is to make it easier to revert
ag/2116039, when the time comes (b/36811399).

(When we revert ag/2116039, we might want to allow
ringbuffers for user builds on DR. And if we do allow
ringbuffers on user builds, we'll want to have the
ringBufferSizeIsSmallByDefault test.)

Bug: 37756562
Test: tests/wifitests/runtests.sh
Test: manual test (see below)

Manual test: (on bullhead)
1. install |user| build
2. connect to GoogleGuest
3. adb shell pgrep system_server
4. adb shell dumpsys wifi | grep "ring-buffer ="
-> expect no matching lines
5. adb shell pgrep system_server
6. PIDs from steps 3 and 5 should match
7. install |userdebug| build
8. connect to GoogleGuest
9. adb shell pgrep system_server
10. adb shell dumpsys wifi | grep "ring-buffer ="
-> expect at least one match
11. adb shell pgrep system_server
12. PIDs from steps 9 and 11 should match

Change-Id: Ib7cf1f9e9442ed3c3191d2b20b0812afbbf62930
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
4776ec875d92edd7ed00d739720ed08c7894bc8a 08-Apr-2017 mukesh agrawal <quiche@google.com> WifiDiagnostics: enlarge ring-buffers for dogfood

During early dogfooding, we need larger ring-buffers,
to help partners diagnose issues with the HAL, driver,
and firmware.

In particular, I'm hoping that the larger buffers
will help with any recurrences of b/36599054.

Make it so.

Bug: 36811396
Test: manual (see below)
Change-Id: I54b82407d130d387646bfa443f6dd78c7dfcce15

Manual test:
$ adb reboot bootloader && fastboot flashall
$ adb shell dumpsys wifi \
| awk '/driver_prints/ { found = 1; next }
/^$/ { found = 0 }
(found) { print }' \
| base64 --decode \
| pigz --zlib -d \
| wc -c
-> result should be >32768
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
b8b3fb8228a1f90106bad8c59ce006b81ef7921c 09-Mar-2017 Roshan Pius <rpius@google.com> Remove all legacy HAL usage from framework

WifiNative now just becomes a module to route calls into the appropriate
native module: WifiVendorHal, WificondControl, SupplicantStaIfaceHal,
SupplicantP2pIfaceHal.

Changes in the CL:
1. Cleanup WifiNative to remove the legacy HAL usage.
2. Remove the |HIDL*| flags in WifiNative.
3. Remove static instance of WifiNative/WifiMonitor.
4. Remove WifiMonitor code parsing the string events from
wpa_supplicant.
5. Remove all unused jni code used for legacy HAL interactions.
6. Remove dependency of libwifi-hal & libwifi-system from framework.

Notes:
a) We can now potentially split up WifiNative into separate chunks:
WifiStaNative, WifiP2pNative, WifiRttNative, etc instead of having a
monolithic WifiNative instance.
b) We may have to add back the local log in WifiNative (b/36059665).

Bug: 35702893
Bug: 34457880
Bug: 34884202
Bug: 35421721
Test: Compiles, existing unit tests pass.
Test: Device boots up and connects to wifi networks.
Test: Verified with wifi regression (b/36068282)

Change-Id: I3e13522c912242af8023471e029edb1ce47fd3e9
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
3bbf564af91515b33fcba33e7039ffe09c8c025c 17-Feb-2017 mukesh agrawal <quiche@google.com> WifiDiagnosticsTest: stub out call to logcat

WifiDiagnostics.captureBugReport() forks an external
process (logcat), to read data from logd. At present,
that external process is _not_ stubbed out for testing.

As a consequence, the time to run WifiDiagnosticsTest
depends on how busy logd happens to be. This causes
problems when, e.g., running a ToT build where other
subsystems are crashy.

Resolve this problem, by stubbing out the external
process for unit tests.

Along the way: update WifiInjector, so that it hosts
an instance of java.lang.Runtime.

Bug: 34971969
Test: runtests.sh
Test: manual

Manual test:
- install a build that's suffering from b/35400537
- run wifi unit tests 5 times
- verify that no run takes longer than 35 seconds

Change-Id: Icf2c36acc04713c5ead44b47a42fa9e80cf0a1fd
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
3f2187fdcc3ed55c909cb4cdee589744655d3243 01-Feb-2017 mukesh agrawal <quiche@google.com> last mile: add timeout support (1/2)

As preparation for adding timeout support, update
the reportConnectionEvent() methods to take a
|connectionId| parameter.

This new parameter will be used to ensure that
LastMileLogger ignores spurious timeouts.

The actual timeout logic, as well as real values
for the new parameter, will be added in the next
CL.

Bug: 34691329
Test: wifitests/runtests.sh
Change-Id: I849169e36ca1798ebd1c5fe57d14515f374a0d71
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
d3ab97d3cf26342610204b6492f082d62d3e51e3 07-Jan-2017 mukesh agrawal <quiche@google.com> WifiDiagnostics: propagate events to LastMileLogger

In order for LastMileLogger to actually be useful,
LML needs to receive notifications about connection
events.

Update WifiDiagnostics, to propagate events from
WifiStateMachine, to LastMileLogger.

While there: make the |mLog| field final. (I
probably should have made that field final in the
first place.)

Bug: 34362951
Test: tests/wifitests/runtests.sh and manual
Manual testing:
- boot with new code
- connect to GoogleGuest
$ adb shell dumpsys > >(egrep 'rdev_connect') 2>/dev/null
<...>-5220 [004] ...1 83.714720: rdev_connect: phy0, netdev:wlan0(5), bssid: 6c:f3:7f:ae:8b:f1, ssid: GoogleGuest, auth type: 0, privacy: false, wpa versions: 0, flags: 0

Change-Id: If1c6b50f866d892c4a95ac94398bfe0680e5a51a
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
cf99aa8a53e95f220fa0b627e712b4a4d87b6017 07-Jan-2017 mukesh agrawal <quiche@google.com> BaseWifiDiagnostics: generalize reportConnectionFailure()

Rename reportConnectionFailure() to reportConnectionEvent(),
and add an argument to the renamed method. Follow-on CLs will
use the new argument to report additional events.

Bug: 34179456
Test: tests/wifitests/runtests.sh (on angler)
Change-Id: Ifc62dcaa576f4d9355509922dfdc2c3aa0f330fd
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
f5d90be206db98bbd5894afc8d757dd32360b2d9 05-Aug-2016 mukesh agrawal <quiche@google.com> logging: add convenience APIs for literal messages

Literal messages are reasonably common, so we should make
them easy to log. Add APIs for that purpose, and migrate
WifiDiagnostics to use them.

Note that, functionally speaking, the LogcatLog implementations
of these APIs behave the same their corresponding legacy APIs.

However, we add these APIs for two reasons:
- To track which log messages have been audited, to determine
whether or not they contain parameters.
- So that the WifiLog implementation for the new backend can
inform the backend that these messages are clean (free of
any sensitive data).

Finally, we note that these convenience APIs may also provide
a performance benefit. (Because the message is parameter-less,
there's no need to create a LogMessage.)

While there: change the level of some WifiDiagnostics log
messages, to fit our new logging guidelines.

BUG=30737889
TEST=wifitests/runtests.sh

Change-Id: I3d39c1932800af6a818c59b6497c868f8399f8fa
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
f46c533931224296b11d98798344c049f88db9a1 06-Aug-2016 mukesh agrawal <quiche@google.com> WifiDiagnostics: migrate to chained logging API

Migrate parameterized log messages in WifiDiagnostics
to the new chained logging API.

Along the way: add DummyLogMessage and FakeLog, to
facilitate testing. (Alternatively, we could bake their
behavior into WifiDiagnosticsTest. But it seems likely
that other tests will want the same behavior.)

While there:
- fix ordering of imports (WifiDiagnostics, WifiDiagnosticsTest)
- remove unused imports (WifiDiagnostics)
- change the level of some WifiDiagnostics log message, to
fit our new guidelines

BUG=30736898
TEST=wifitests/runtests.sh

Change-Id: If60282adf40d58e80cdaa0d7e1e7008c490d545b
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
11064a5b4949a8e5bc275d1cd27c1971fadf1278 03-Aug-2016 mukesh agrawal <quiche@google.com> WifiDiagnostics: remove getAllRingBufferData()

This method is unused. Remove it.

BUG=27173141
TEST=wifitests/runtest.sh

Change-Id: I09a7f6f5eb9fcd60c9bd1841f7e7f2a1a2a0d5fa
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
5b06b91ac414e5c756e0974063f87e23cce8d68c 03-Aug-2016 mukesh agrawal <quiche@google.com> WifiDiagnostics: fix overly long line

Forgot to check the line length after the
search-and-replace. Fix that. :-)

BUG=30630020
TEST=wifitests/runtests.sh

Change-Id: Icbf8d8324e260727d0968b9be08df87acf1b7adc
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
63fad8b4722c94ce9107690b647cdbe7e8a1c4f9 29-Jul-2016 mukesh agrawal <quiche@google.com> WifiDiagnostics: test a log call

Use WifiDiagnosticss to add an example of how to
test logging calls.

And to facilitate this: add a makeLog() method
to WifiInjector.

BUG=30566702
TEST=wifitests/runtests.sh

Change-Id: I46ebd8e79c90bce4bb75c077a6e6cc2b0aa9d3ee
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
235d4d28542d8007c9609a84af0ac7b4c4bba02a 29-Jul-2016 mukesh agrawal <quiche@google.com> WifiDiagnostics: move to WifiLog API

As part of the log improvement effort, make
WifiDiagnostics the first user of the new WifiLog
API.

In this first step, the new API provides one
small benefit: eliminating the need to pass a
tag in to every log call.

More significant benefits will follow.

BUG=30564894
TEST=wifitests/runtests.sh

Change-Id: I9e32eff07c57bcdd30da2aa7295a59ddd96b6e2d
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java
019fda2109ea79daee3fb4442080b1b83be2e7b3 28-Jul-2016 mukesh agrawal <quiche@google.com> WifiLogger: rename to WifiDiagnostics

WifiLogger is a bit of a misnomer, as the module is
really about gathering diagnostics generally, and
not just logs in the strict sense.

Moreover, using "log" in the name might lead to
confusion with the logging code we're going to
add to the wifi service.

Rename WifiLogger, to minimize confusion.

BUG=30566052
TEST=wifitests/runtest.sh

Change-Id: I2c2e0a1c250e48f4ffcbf14b59b30ae0e3c6a68e
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/WifiDiagnostics.java