[DK2]Add new SocketKeepalive.start to dynamically control keepalive
Add SocketKeepalive.start with parameter to enable dynamic keepalive mode based on the existence of TCP connections. This supports IPSec mode to notify KeepaliveTracker to disable keepalive when keepalive is unnecessary to improve battery life. Keepalive is controlled by periodically TCP socket status check for both enable and disable. This is a transition commit and is expected to be updated based on the socket creation or destroy. Bug: 259000745 Test: m ; atest FrameworksNetTests Change-Id: Ie4d598d69a73c4931c7d0b6dfde0e459e5dca6b4
This commit is contained in:
committed by
Chalard Jean
parent
3d60bacfa0
commit
9ef4ffe8d4
@@ -50,7 +50,11 @@ public final class TcpSocketKeepalive extends SocketKeepalive {
|
||||
* acknowledgement.
|
||||
*/
|
||||
@Override
|
||||
protected void startImpl(int intervalSec) {
|
||||
protected void startImpl(int intervalSec, int flags) {
|
||||
if (0 != flags) {
|
||||
throw new IllegalArgumentException("Illegal flag value for "
|
||||
+ this.getClass().getSimpleName() + " : " + flags);
|
||||
}
|
||||
mExecutor.execute(() -> {
|
||||
try {
|
||||
mService.startTcpKeepalive(mNetwork, mPfd, intervalSec, mCallback);
|
||||
|
||||
Reference in New Issue
Block a user