Merge "Replace subnet mask calculation to Inet4AddressUtils" into sc-dev
diff --git a/Android.bp b/Android.bp
index 2dfe3fd..2d4c42c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -110,3 +110,21 @@
name: "contextualcards",
aars: ["libs/contextualcards.aar"],
}
+
+filegroup {
+ name: "Settings_proguard_flags",
+ srcs: ["proguard.flags"],
+}
+
+// The sources for Settings need to be exposed to SettingsGoogle, etc.
+// so they can run the com.android.settingslib.search.IndexableProcessor
+// over all the sources together.
+filegroup {
+ name: "Settings_srcs",
+ srcs: ["src/**/*.java"],
+}
+
+filegroup {
+ name: "Settings_manifest",
+ srcs: ["AndroidManifest.xml"],
+}
diff --git a/tests/robotests/Android.bp b/tests/robotests/Android.bp
index a0e9820..337bad7 100644
--- a/tests/robotests/Android.bp
+++ b/tests/robotests/Android.bp
@@ -97,3 +97,15 @@
"SettingsLib-search",
],
}
+
+java_library {
+ name: "Settings-robo-testutils",
+ srcs: ["src/com/android/settings/testutils/**/*.java"],
+
+ libs: [
+ "Settings-core",
+ "Robolectric_all-target",
+ "mockito-robolectric-prebuilt",
+ "truth-prebuilt",
+ ],
+}
diff --git a/tests/robotests/src/com/android/settings/enterprise/GlobalHttpProxyPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/GlobalHttpProxyPreferenceControllerTest.java
index 11676a2..71eaffc 100644
--- a/tests/robotests/src/com/android/settings/enterprise/GlobalHttpProxyPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/GlobalHttpProxyPreferenceControllerTest.java
@@ -24,12 +24,9 @@
import android.net.ConnectivityManager;
import android.net.ProxyInfo;
-import androidx.preference.Preference;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.Answers;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
@@ -39,7 +36,7 @@
private static final String KEY_GLOBAL_HTTP_PROXY = "global_http_proxy";
- @Mock(answer = Answers.RETURNS_DEEP_STUBS)
+ @Mock
private Context mContext;
@Mock
private ConnectivityManager mCm;
@@ -49,6 +46,7 @@
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
+ when(mContext.getSystemService(ConnectivityManager.class)).thenReturn(mCm);
mController = new GlobalHttpProxyPreferenceController(mContext);
}
@@ -62,12 +60,6 @@
}
@Test
- public void testHandlePreferenceTreeClick() {
- assertThat(mController.handlePreferenceTreeClick(new Preference(mContext, null, 0, 0)))
- .isFalse();
- }
-
- @Test
public void testGetPreferenceKey() {
assertThat(mController.getPreferenceKey()).isEqualTo(KEY_GLOBAL_HTTP_PROXY);
}