Always have an AutomaticOnOffKeepalive to manage a KI
Test: FrameworksNetTests 'CtsNetTestCases' CtsHostsideNetworkTests
Change-Id: Ic216b525d8297fce0f390daae327e667a14b7775
diff --git a/framework/src/android/net/ConnectivityManager.java b/framework/src/android/net/ConnectivityManager.java
index 40defd4..4224da9 100644
--- a/framework/src/android/net/ConnectivityManager.java
+++ b/framework/src/android/net/ConnectivityManager.java
@@ -2287,6 +2287,13 @@
mExecutor.execute(() -> {
try {
if (mSlot != null) {
+ // TODO : this is incorrect, because in the presence of auto on/off
+ // keepalive the slot associated with this keepalive can have
+ // changed. Also, this actually causes another problem where some other
+ // app might stop your keepalive if it just knows the network and
+ // the slot and goes through the trouble of grabbing the aidl object.
+ // This code should use the callback to identify what keepalive to
+ // stop instead.
mService.stopKeepalive(mNetwork, mSlot);
}
} catch (RemoteException e) {