From a248130fc907ab78934eaeecc6cd0a486bd824ec Mon Sep 17 00:00:00 2001 From: Junyu Lai Date: Wed, 19 Jun 2019 07:28:53 -0700 Subject: [PATCH] Correct value of supported keepalive count for cellular Cellular only supports 1 keepalive connection so correct the default supported value to 1. Bug: 134037217 Bug: 134352656 Test: - atest FrameworksNetTests - atest android.net.cts.ConnectivityManagerTest \ #testSocketKeepaliveLimitTelephony Merged-In: Ia3761f2e78d54866bb2e156d58004396bbc8adc3 Change-Id: If833b813ba00eeff913160598f1ea9c74e6e35d8 (cherry picked from commit 680abbb591d9c084d1a1e3f9dea1ed8d4e3b1ae8) --- core/java/android/net/SocketKeepalive.java | 6 ++++-- core/res/res/values/config.xml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/java/android/net/SocketKeepalive.java b/core/java/android/net/SocketKeepalive.java index 46eddde968a03..ec73866a647df 100644 --- a/core/java/android/net/SocketKeepalive.java +++ b/core/java/android/net/SocketKeepalive.java @@ -44,9 +44,11 @@ import java.util.concurrent.Executor; * {@link SocketKeepalive.Callback#onStopped} if the operation was successful or * {@link SocketKeepalive.Callback#onError} if an error occurred. * - * The device SHOULD support keepalive offload. If it does not, it MUST reply with + * For cellular, the device MUST support at least 1 keepalive slot. + * + * For WiFi, the device SHOULD support keepalive offload. If it does not, it MUST reply with * {@link SocketKeepalive.Callback#onError} with {@code ERROR_UNSUPPORTED} to any keepalive offload - * request. If it does, it MUST support at least 3 concurrent keepalive slots per transport. + * request. If it does, it MUST support at least 3 concurrent keepalive slots. */ public abstract class SocketKeepalive implements AutoCloseable { static final String TAG = "SocketKeepalive"; diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index dd75c5604c603..d6604f42e6374 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -364,7 +364,7 @@ overridden by the device to present the capability of creating socket keepalives. --> - 0,3 + 0,1 1,3