Rename destroyAndAwaitReplacement to unregisterAfterReplacement.
Rename requested by API council.
Fix: 224764301
Test: existing CTS tests updated
Change-Id: Ibab9c9cd64bf0dde1e22705e81cff11d356fc719
diff --git a/service/ServiceConnectivityResources/res/values/config.xml b/service/ServiceConnectivityResources/res/values/config.xml
index 1af00c7..81782f9 100644
--- a/service/ServiceConnectivityResources/res/values/config.xml
+++ b/service/ServiceConnectivityResources/res/values/config.xml
@@ -176,7 +176,7 @@
NetworkMonitor will continue to attempt validation, and if it fails after this time has passed,
the network will be marked unvalidated.
- Only supported up to S. On T+, the Wi-Fi code should use destroyAndAwaitReplacement in order
+ Only supported up to S. On T+, the Wi-Fi code should use unregisterAfterReplacement in order
to ensure that apps see the network disconnect and reconnect. -->
<integer translatable="false" name="config_validationFailureAfterRoamIgnoreTimeMillis">-1</integer>
</resources>
diff --git a/service/src/com/android/server/ConnectivityService.java b/service/src/com/android/server/ConnectivityService.java
index e58160a..ab5f5d3 100644
--- a/service/src/com/android/server/ConnectivityService.java
+++ b/service/src/com/android/server/ConnectivityService.java
@@ -3648,7 +3648,7 @@
}
break;
}
- case NetworkAgent.EVENT_DESTROY_AND_AWAIT_REPLACEMENT: {
+ case NetworkAgent.EVENT_UNREGISTER_AFTER_REPLACEMENT: {
// If nai is not yet created, or is already destroyed, ignore.
if (!shouldDestroyNativeNetwork(nai)) break;
@@ -4213,7 +4213,7 @@
}
private boolean shouldIgnoreValidationFailureAfterRoam(NetworkAgentInfo nai) {
- // T+ devices should use destroyAndAwaitReplacement.
+ // T+ devices should use unregisterAfterReplacement.
if (SdkLevel.isAtLeastT()) return false;
final long blockTimeOut = Long.valueOf(mResources.get().getInteger(
R.integer.config_validationFailureAfterRoamIgnoreTimeMillis));
diff --git a/service/src/com/android/server/connectivity/NetworkAgentInfo.java b/service/src/com/android/server/connectivity/NetworkAgentInfo.java
index b73e2cc..1fc5a8f 100644
--- a/service/src/com/android/server/connectivity/NetworkAgentInfo.java
+++ b/service/src/com/android/server/connectivity/NetworkAgentInfo.java
@@ -736,8 +736,8 @@
}
@Override
- public void sendDestroyAndAwaitReplacement(final int timeoutMillis) {
- mHandler.obtainMessage(NetworkAgent.EVENT_DESTROY_AND_AWAIT_REPLACEMENT,
+ public void sendUnregisterAfterReplacement(final int timeoutMillis) {
+ mHandler.obtainMessage(NetworkAgent.EVENT_UNREGISTER_AFTER_REPLACEMENT,
new Pair<>(NetworkAgentInfo.this, timeoutMillis)).sendToTarget();
}
}