summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Wills <mwills@google.com>2016-05-23 16:36:12 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-05-23 16:36:12 +0000
commit7c7c65c372b55da9e9662a708884fca18ddfebc0 (patch)
treef4d37e3c1e3dafe832d7b43fe6d5d1d4ecf0514f
parent8b2a62d9eab3acbeadfa8ff1327eb673357b35ac (diff)
parent1f9f7c109ca952884fb7bff7271669d879ce9b97 (diff)
Merge "Make sure that all ways a scan can fail get logged" into nyc-dev
am: 1f9f7c109c * commit '1f9f7c109ca952884fb7bff7271669d879ce9b97': Make sure that all ways a scan can fail get logged Change-Id: I85b86ce43407183513ed77dbd935cf89b8ccc12e
-rw-r--r--service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java7
-rw-r--r--tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java2
2 files changed, 8 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
index b732a6e77..a82ce1f25 100644
--- a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
+++ b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
@@ -535,8 +535,10 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
switch (msg.what) {
case WifiScanner.CMD_START_SINGLE_SCAN:
mWifiMetrics.incrementOneshotScanCount();
+ int handler = msg.arg2;
Bundle scanParams = (Bundle) msg.obj;
if (scanParams == null) {
+ logCallback("singleScanInvalidRequest", ci, handler, "null params");
replyFailed(msg, WifiScanner.REASON_INVALID_REQUEST, "params null");
return HANDLED;
}
@@ -545,7 +547,7 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
scanParams.getParcelable(WifiScanner.SCAN_PARAMS_SCAN_SETTINGS_KEY);
WorkSource workSource =
scanParams.getParcelable(WifiScanner.SCAN_PARAMS_WORK_SOURCE_KEY);
- if (validateAndAddToScanQueue(ci, msg.arg2, scanSettings, workSource)) {
+ if (validateAndAddToScanQueue(ci, handler, scanSettings, workSource)) {
replySucceeded(msg);
// If were not currently scanning then try to start a scan. Otherwise
// this scan will be scheduled when transitioning back to IdleState
@@ -554,6 +556,7 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
tryToStartNewScan();
}
} else {
+ logCallback("singleScanInvalidRequest", ci, handler, "bad request");
replyFailed(msg, WifiScanner.REASON_INVALID_REQUEST, "bad request");
mWifiMetrics.incrementScanReturnEntry(
WifiMetricsProto.WifiLog.SCAN_FAILURE_INVALID_CONFIGURATION, 1);
@@ -727,6 +730,8 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
void sendOpFailedToAllAndClear(RequestList<?> clientHandlers, int reason,
String description) {
for (RequestInfo<?> entry : clientHandlers) {
+ logCallback("singleScanFailed", entry.clientInfo, entry.handlerId,
+ "reason=" + reason + ", " + description);
entry.reportEvent(WifiScanner.CMD_OP_FAILED, 0,
new WifiScanner.OperationResult(reason, description));
}
diff --git a/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java b/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java
index 43dfc5523..dd5a1b949 100644
--- a/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java
@@ -515,6 +515,8 @@ public class WifiScanningServiceTest {
mLooper.dispatchAll();
verifyFailedResponse(order, handler, requestId,
WifiScanner.REASON_UNSPECIFIED, "Scan failed");
+ assertDumpContainsCallbackLog("singleScanFailed", requestId,
+ "reason=" + WifiScanner.REASON_UNSPECIFIED + ", Scan failed");
assertEquals(mWifiMetrics.getOneshotScanCount(), 1);
assertEquals(mWifiMetrics.getScanReturnEntry(WifiMetricsProto.WifiLog.SCAN_UNKNOWN), 1);
verify(mBatteryStats).noteWifiScanStoppedFromSource(eq(workSource));