summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authormukesh agrawal <quiche@google.com>2016-06-23 11:49:29 -0700
committermukesh agrawal <quiche@google.com>2016-07-11 16:06:47 -0700
commit367a496587a34be0aec60765eeb1365baadf03bc (patch)
tree61d314f192122994dc1e53fa7a66eecbca5ba6af /service
parent450fee26a21eb56d536df147d3e88d3549f807c0 (diff)
WifiNative: make getLocalLog() an instance method
We want to add some tests that mock out WifiNative.getLocalLog(). To do that, we need getLocalLog() to be an instance method. Make it so. While there: add @NonNull annotation to getLocalLog(), to make the semantics clearer. BUG=29424414 TEST=unit tests Change-Id: Ifb224104cf54b42a945258967dcaf50541849abc
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiMonitor.java7
-rw-r--r--service/java/com/android/server/wifi/WifiNative.java3
2 files changed, 6 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/WifiMonitor.java b/service/java/com/android/server/wifi/WifiMonitor.java
index 2c1bde10d..1f2b39713 100644
--- a/service/java/com/android/server/wifi/WifiMonitor.java
+++ b/service/java/com/android/server/wifi/WifiMonitor.java
@@ -594,7 +594,7 @@ public class WifiMonitor {
while (true) {
if (mWifiNative.connectToSupplicant()) {
mConnected = true;
- new MonitorThread().start();
+ new MonitorThread(mWifiNative.getLocalLog()).start();
return true;
}
if (connectTries++ < 5) {
@@ -723,10 +723,11 @@ public class WifiMonitor {
}
private class MonitorThread extends Thread {
- private final LocalLog mLocalLog = mWifiNative.getLocalLog();
+ private final LocalLog mLocalLog;
- public MonitorThread() {
+ public MonitorThread(LocalLog localLog) {
super("WifiMonitor");
+ mLocalLog = localLog;
}
public void run() {
diff --git a/service/java/com/android/server/wifi/WifiNative.java b/service/java/com/android/server/wifi/WifiNative.java
index f268f62f6..73765eeb7 100644
--- a/service/java/com/android/server/wifi/WifiNative.java
+++ b/service/java/com/android/server/wifi/WifiNative.java
@@ -16,6 +16,7 @@
package com.android.server.wifi;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.AlarmManager;
import android.app.PendingIntent;
@@ -104,7 +105,7 @@ public class WifiNative {
private static final LocalLog sLocalLog = new LocalLog(8192);
- public static LocalLog getLocalLog() {
+ public @NonNull LocalLog getLocalLog() {
return sLocalLog;
}