Merge "Process all responses if the network is null in MdnsServiceTypeClient" am: 49078d7b0f am: 01d80a9fe2
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2489415
Change-Id: Ia39beb14c50b853aa28a1295e3e5a1a481fb7111
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/nearby/tests/integration/ui/src/android/nearby/integration/ui/CheckNearbyHalfSheetUiTest.kt b/nearby/tests/integration/ui/src/android/nearby/integration/ui/CheckNearbyHalfSheetUiTest.kt
index 5a3538e..1b9e8f1 100644
--- a/nearby/tests/integration/ui/src/android/nearby/integration/ui/CheckNearbyHalfSheetUiTest.kt
+++ b/nearby/tests/integration/ui/src/android/nearby/integration/ui/CheckNearbyHalfSheetUiTest.kt
@@ -17,6 +17,7 @@
package android.nearby.integration.ui
import android.content.Context
+import android.content.pm.PackageManager
import android.os.Bundle
import android.platform.test.rule.ScreenRecordRule.ScreenRecord
import androidx.test.core.app.ApplicationProvider
@@ -34,6 +35,7 @@
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
import org.junit.AfterClass
+import org.junit.Assume.assumeFalse
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -50,6 +52,8 @@
*/
@RunWith(AndroidJUnit4::class)
class CheckNearbyHalfSheetUiTest : BaseUiTest() {
+ private val appContext = ApplicationProvider.getApplicationContext<Context>()
+
private var waitHalfSheetPopupTimeoutMs: Long
private var halfSheetTitleText: String
private var halfSheetSubtitleText: String
@@ -81,7 +85,8 @@
@Before
fun setUp() {
- val appContext = ApplicationProvider.getApplicationContext<Context>()
+ assumeFalse("Halfsheets not supported on Wear OS devices", isWatch())
+
val locator = Locator(appContext).apply {
overrideBindingForTest(EventLoop::class.java, EventLoop.newInstance("test"))
overrideBindingForTest(
@@ -134,6 +139,10 @@
assertThat(infoButton).isNotNull()
}
+ private fun isWatch(): Boolean {
+ return appContext.packageManager.hasSystemFeature(PackageManager.FEATURE_WATCH)
+ }
+
companion object {
private const val DEFAULT_WAIT_HALF_SHEET_POPUP_TIMEOUT_MS = 30 * 1000L
private const val DEFAULT_HALF_SHEET_TITLE_TEXT = "Fast Pair Provider Simulator"