diff options
author | mukesh agrawal <quiche@google.com> | 2016-05-03 11:38:07 -0700 |
---|---|---|
committer | mukesh agrawal <quiche@google.com> | 2016-05-03 17:31:37 -0700 |
commit | f74a1cfd50d7b44aa7e4b598eb229cd464983dfe (patch) | |
tree | 44ec8f8e9f5573fd4885c7e7027cb442c4193e3d /tests | |
parent | 3d0be5a31795cb4cd74a2793bcd1c8c52aa8bfca (diff) |
wifi service: abstract away access to SystemProperties
We want the ability to modify the value of a system property,
so that we can dynamically change the logging level for WifiHAL.
This ability depends on permissions that are not available to
the test runner. For example, the process that is running the
wifi service code needs the ability to connect to the
|property_service| socket.
To resolve the problem, we do the following:
- add a PropertyService interface, which abstracts away access
to SystemProperties
- add PropertyService to the dependencies managed by WifiInjector
- add SystemPropertyService, which routes property requests
to android.os.SystemProperties
- update WifiStateMachine, to access properties via PropertyService
- update WifiStateMachineTest, to use a mock implementation of
PropertyService
BUG=27857554
TEST=unit tests
Change-Id: Ic930337a6a8f6a600ae7b4da2ca2eaf5c9e6c2cb
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java index 6f635e72d..b69d6cd65 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java @@ -354,6 +354,7 @@ public class WifiStateMachineTest { when(mWifiInjector.getWifiMetrics()).thenReturn(mWifiMetrics); when(mWifiInjector.getClock()).thenReturn(mock(Clock.class)); when(mWifiInjector.getWifiLastResortWatchdog()).thenReturn(mWifiLastResortWatchdog); + when(mWifiInjector.getPropertyService()).thenReturn(mock(PropertyService.class)); FrameworkFacade factory = getFrameworkFacade(); Context context = getContext(); |