From f74a1cfd50d7b44aa7e4b598eb229cd464983dfe Mon Sep 17 00:00:00 2001 From: mukesh agrawal Date: Tue, 3 May 2016 11:38:07 -0700 Subject: 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 --- tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') 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(); -- cgit v1.2.3