diff options
author | Oscar Shu <xshu@google.com> | 2018-08-08 19:31:39 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-08-08 19:31:39 +0000 |
commit | c2cbed93bf225cfa8e473b69e9130e4c74b0b862 (patch) | |
tree | ed2f48a7c28065328d8dc5683c945a2f2408faa7 /service | |
parent | 553438e468dbfe74b7efa03b6551c42d72497d09 (diff) | |
parent | f37bc8f53c7294dbed1180865dd6470a559b4f67 (diff) |
Merge "[LastMileLogger] cleanup obsolete field"
Diffstat (limited to 'service')
4 files changed, 9 insertions, 28 deletions
diff --git a/service/java/com/android/server/wifi/BaseWifiDiagnostics.java b/service/java/com/android/server/wifi/BaseWifiDiagnostics.java index b9f138539..2090cac1e 100644 --- a/service/java/com/android/server/wifi/BaseWifiDiagnostics.java +++ b/service/java/com/android/server/wifi/BaseWifiDiagnostics.java @@ -37,10 +37,9 @@ public class BaseWifiDiagnostics { /** * Inform the diagnostics module of a connection event. - * @param connectionId A strictly increasing, non-negative, connection identifier * @param event The type of connection event (see CONNECTION_EVENT_* constants) */ - public synchronized void reportConnectionEvent(long connectionId, byte event) {} + public synchronized void reportConnectionEvent(byte event) {} public synchronized void captureBugReportData(int reason) { } diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index f316b504d..3c5f75ca9 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -2903,22 +2903,18 @@ public class ClientModeImpl extends StateMachine { @VisibleForTesting public static final long DIAGS_CONNECT_TIMEOUT_MILLIS = 60 * 1000; - private long mDiagsConnectionStartMillis = -1; /** * Inform other components that a new connection attempt is starting. */ private void reportConnectionAttemptStart( WifiConfiguration config, String targetBSSID, int roamType) { mWifiMetrics.startConnectionEvent(config, targetBSSID, roamType); - mDiagsConnectionStartMillis = mClock.getElapsedSinceBootMillis(); - mWifiDiagnostics.reportConnectionEvent( - mDiagsConnectionStartMillis, WifiDiagnostics.CONNECTION_EVENT_STARTED); + mWifiDiagnostics.reportConnectionEvent(WifiDiagnostics.CONNECTION_EVENT_STARTED); mWrongPasswordNotifier.onNewConnectionAttempt(); // TODO(b/35329124): Remove CMD_DIAGS_CONNECT_TIMEOUT, once ClientModeImpl // grows a proper CONNECTING state. removeMessages(CMD_DIAGS_CONNECT_TIMEOUT); - sendMessageDelayed(CMD_DIAGS_CONNECT_TIMEOUT, - mDiagsConnectionStartMillis, DIAGS_CONNECT_TIMEOUT_MILLIS); + sendMessageDelayed(CMD_DIAGS_CONNECT_TIMEOUT, DIAGS_CONNECT_TIMEOUT_MILLIS); } /** @@ -2940,8 +2936,7 @@ public class ClientModeImpl extends StateMachine { // // TODO(b/34181219): Fix the above. removeMessages(CMD_DIAGS_CONNECT_TIMEOUT); - mWifiDiagnostics.reportConnectionEvent( - mDiagsConnectionStartMillis, WifiDiagnostics.CONNECTION_EVENT_SUCCEEDED); + mWifiDiagnostics.reportConnectionEvent(WifiDiagnostics.CONNECTION_EVENT_SUCCEEDED); break; case WifiMetrics.ConnectionEvent.FAILURE_REDUNDANT_CONNECTION_ATTEMPT: case WifiMetrics.ConnectionEvent.FAILURE_CONNECT_NETWORK_FAILED: @@ -2950,10 +2945,8 @@ public class ClientModeImpl extends StateMachine { break; default: removeMessages(CMD_DIAGS_CONNECT_TIMEOUT); - mWifiDiagnostics.reportConnectionEvent( - mDiagsConnectionStartMillis, WifiDiagnostics.CONNECTION_EVENT_FAILED); + mWifiDiagnostics.reportConnectionEvent(WifiDiagnostics.CONNECTION_EVENT_FAILED); } - mDiagsConnectionStartMillis = -1; } private void handleIPv4Success(DhcpResults dhcpResults) { @@ -3593,7 +3586,7 @@ public class ClientModeImpl extends StateMachine { break; case CMD_DIAGS_CONNECT_TIMEOUT: mWifiDiagnostics.reportConnectionEvent( - (Long) message.obj, BaseWifiDiagnostics.CONNECTION_EVENT_TIMEOUT); + BaseWifiDiagnostics.CONNECTION_EVENT_TIMEOUT); break; case CMD_GET_ALL_MATCHING_CONFIGS: replyToMessage(message, message.what, new ArrayList<WifiConfiguration>()); diff --git a/service/java/com/android/server/wifi/LastMileLogger.java b/service/java/com/android/server/wifi/LastMileLogger.java index 12277f412..1269638b3 100644 --- a/service/java/com/android/server/wifi/LastMileLogger.java +++ b/service/java/com/android/server/wifi/LastMileLogger.java @@ -45,31 +45,21 @@ public class LastMileLogger { /** * Informs LastMileLogger that a connection event has occurred. - * @param connectionId A non-negative connection identifier, or -1 to indicate unknown * @param event an event defined in BaseWifiDiagnostics */ - public void reportConnectionEvent(long connectionId, byte event) { - if (connectionId < 0) { - mLog.warn("Ignoring negative connection id: %").c(connectionId).flush(); - return; - } - + public void reportConnectionEvent(byte event) { switch (event) { case BaseWifiDiagnostics.CONNECTION_EVENT_STARTED: - mPendingConnectionId = connectionId; enableTracing(); return; case BaseWifiDiagnostics.CONNECTION_EVENT_SUCCEEDED: - mPendingConnectionId = -1; disableTracing(); return; case BaseWifiDiagnostics.CONNECTION_EVENT_FAILED: - mPendingConnectionId = -1; disableTracing(); mLastMileLogForLastFailure = readTrace(); return; case BaseWifiDiagnostics.CONNECTION_EVENT_TIMEOUT: - mPendingConnectionId = -1; disableTracing(); mLastMileLogForLastFailure = readTrace(); return; @@ -99,7 +89,6 @@ public class LastMileLogger { private WifiLog mLog; private byte[] mLastMileLogForLastFailure; private FileInputStream mLastMileTraceHandle; - private long mPendingConnectionId = -1; private void enableTracing() { if (!ensureFailSafeIsArmed()) { diff --git a/service/java/com/android/server/wifi/WifiDiagnostics.java b/service/java/com/android/server/wifi/WifiDiagnostics.java index 224c7140e..37b02ed79 100644 --- a/service/java/com/android/server/wifi/WifiDiagnostics.java +++ b/service/java/com/android/server/wifi/WifiDiagnostics.java @@ -203,8 +203,8 @@ class WifiDiagnostics extends BaseWifiDiagnostics { } @Override - public synchronized void reportConnectionEvent(long connectionId, byte event) { - mLastMileLogger.reportConnectionEvent(connectionId, event); + public synchronized void reportConnectionEvent(byte event) { + mLastMileLogger.reportConnectionEvent(event); if (event == CONNECTION_EVENT_FAILED || event == CONNECTION_EVENT_TIMEOUT) { mPacketFatesForLastFailure = fetchPacketFates(); } |