summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2019-10-15 08:11:01 -0700
committerRoshan Pius <rpius@google.com>2019-10-15 10:25:06 -0700
commita6667b502c515235ee4cfb31857476b3fed14fba (patch)
tree815afebd2ac5e0e33f6085912e5b6e2c9f6c2e3e /tests
parent9c3840ffef657a4199066366f3fb586dabd368e1 (diff)
WifiStack: Use ActivityManager.isLowRamDevice()
Bug: 142718153 Test: Compiles Change-Id: If21baea8e26838d54978d245799379ead3fb6859
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java3
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java3
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
index 8eba3639e..c64013044 100644
--- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
@@ -251,6 +251,9 @@ public class ClientModeImplTest extends WifiBaseTest {
when(context.getOpPackageName()).thenReturn(OP_PACKAGE_NAME);
+ when(context.getSystemService(ActivityManager.class)).thenReturn(
+ mock(ActivityManager.class));
+
return context;
}
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
index b98ed544e..690aa6fe5 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
@@ -20,6 +20,7 @@ import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import android.annotation.Nullable;
+import android.app.ActivityManager;
import android.app.test.MockAnswerUtil.AnswerWithArguments;
import android.content.Context;
import android.content.Intent;
@@ -187,6 +188,8 @@ public class WifiConfigManagerTest extends WifiBaseTest {
}
}).when(mPackageManager).getNameForUid(anyInt());
+ when(mContext.getSystemService(ActivityManager.class))
+ .thenReturn(mock(ActivityManager.class));
Context mockContext = mock(Context.class);
when(mContext.createPackageContextAsUser(
eq(WifiConfigManager.SYSUI_PACKAGE_NAME), anyInt(), any()))