Skip to content

Commit afc122e

Browse files
lucaslinandroid-build-team Robot
authored andcommitted
Remove sendNetworkConditionsBroadcast
sendNetworkConditionsBroadcast is removed, so TestNetworkStackService.kt cannot override it anymore, otherwise there will be a build break when running this test. Also add a comment for NETWORK_CONDITIONS_MEASURED in AndroidManifest.xml. Bug: 175213041 Test: atest FrameworksNetIntegrationTests Change-Id: I7b43940dc32826c70fa82f471b35bc5cb8394aad Merged-In: I7b43940dc32826c70fa82f471b35bc5cb8394aad (cherry picked from commit c737926795a8cedab091cf01c30914a1bf844da1)
1 parent dd4cd2c commit afc122e

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

core/res/AndroidManifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,8 @@
389389
<protected-broadcast android:name="android.net.wifi.p2p.action.WIFI_P2P_PERSISTENT_GROUPS_CHANGED" />
390390
<protected-broadcast android:name="android.net.conn.TETHER_STATE_CHANGED" />
391391
<protected-broadcast android:name="android.net.conn.INET_CONDITION_ACTION" />
392+
<!-- This broadcast is no longer sent in S but it should stay protected to avoid third party
393+
apps broadcasting this and confusing old system apps that may not have been updated. -->
392394
<protected-broadcast android:name="android.net.conn.NETWORK_CONDITIONS_MEASURED" />
393395
<protected-broadcast
394396
android:name="android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSED" />

tests/net/integration/src/com/android/server/net/integrationtests/TestNetworkStackService.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class TestNetworkStackService : Service() {
5959
private class NetworkMonitorDeps(private val privateDnsBypassNetwork: Network) :
6060
NetworkMonitor.Dependencies() {
6161
override fun getPrivateDnsBypassNetwork(network: Network?) = privateDnsBypassNetwork
62-
override fun sendNetworkConditionsBroadcast(context: Context, broadcast: Intent) = Unit
6362
}
6463

6564
private inner class TestNetworkStackConnector(context: Context) : NetworkStackConnector(
@@ -94,4 +93,4 @@ class TestNetworkStackService : Service() {
9493
cb.onNetworkMonitorCreated(NetworkMonitorConnector(nm, TestPermissionChecker()))
9594
}
9695
}
97-
}
96+
}

0 commit comments

Comments
 (0)