Merge "Add idleTimer existence check before removing idleTimer"

This commit is contained in:
Motomu Utsumi
2023-06-20 00:45:03 +00:00
committed by Gerrit Code Review

View File

@@ -11285,6 +11285,10 @@ public class ConnectivityService extends IConnectivityManager.Stub
updateRadioPowerState(false /* isActive */, type);
synchronized (mActiveIdleTimers) {
final IdleTimerParams params = mActiveIdleTimers.remove(iface);
if (params == null) {
// IdleTimer is not added if the configured timeout is 0 or negative value
return;
}
// The call fails silently if no idle timer setup for this interface
mNetd.idletimerRemoveInterface(iface, params.timeout,
Integer.toString(params.transportType));