summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2017-01-26 07:21:20 -0800
committerEtan Cohen <etancohen@google.com>2017-01-27 01:21:41 +0000
commit5282e08d98fa5c18b77ecf8b40de015bcd092a44 (patch)
tree15a477d82f4794c131cdea588d2b67ddf9713c59 /service
parent69dfa6e3f6657d5505c881133fe1320edd066589 (diff)
Add HalDeviceManager to WifiInjector
Need to share a singleton HalDeviceManager. Bug: 34474043 Test: builds Change-Id: I264ec83412938537c051f3fe16d340a1626cd8f1
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiInjector.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiInjector.java b/service/java/com/android/server/wifi/WifiInjector.java
index 637da634d..ddbbd2745 100644
--- a/service/java/com/android/server/wifi/WifiInjector.java
+++ b/service/java/com/android/server/wifi/WifiInjector.java
@@ -103,6 +103,7 @@ public class WifiInjector {
private final PasspointManager mPasspointManager;
private final SIMAccessor mSimAccessor;
private HandlerThread mWifiAwareHandlerThread;
+ private HalDeviceManager mHalDeviceManager;
private final boolean mUseRealLogger;
@@ -412,4 +413,16 @@ public class WifiInjector {
}
return mWifiAwareHandlerThread;
}
+
+ /**
+ * returns a single instance of HalDeviceManager for injection. Uses lazy instantiation
+ * and initialization.
+ */
+ public HalDeviceManager getHalDeviceManager() {
+ if (mHalDeviceManager == null) {
+ mHalDeviceManager = new HalDeviceManager();
+ mHalDeviceManager.initialize();
+ }
+ return mHalDeviceManager;
+ }
}