Read idle timer configurations from the boot namespace
The values are only read during startup so moving these to a boot namespace. This will ensure that the values are committed to logs only after a boot. The boot namespace is already provisioned, but going forward the string constants for the namespace do not need to be defined in the DeviceConfig module. Test: atest ConnectivityCoverageTests:\ android.net.connectivity.com.android.server.CSNetworkActivityTest Test: Manually using shell commands. E.g.: adb shell device_config put tethering_boot \ cellular_data_inactivity_timeout 4 Bug: 377759682 Change-Id: Icd4bd3da288e5dfde620d779bd0708319da90be9
This commit is contained in:
parent
2fa511bdc2
commit
392336b50d
2 changed files with 8 additions and 3 deletions
|
|
@ -121,7 +121,6 @@ import static android.net.connectivity.ConnectivityCompatChanges.ENABLE_SELF_CER
|
|||
import static android.net.connectivity.ConnectivityCompatChanges.NETWORK_BLOCKED_WITHOUT_INTERNET_PERMISSION;
|
||||
import static android.os.Process.INVALID_UID;
|
||||
import static android.os.Process.VPN_UID;
|
||||
import static android.provider.DeviceConfig.NAMESPACE_TETHERING;
|
||||
import static android.system.OsConstants.ETH_P_ALL;
|
||||
import static android.system.OsConstants.IPPROTO_TCP;
|
||||
import static android.system.OsConstants.IPPROTO_UDP;
|
||||
|
|
@ -149,6 +148,7 @@ import static com.android.server.ConnectivityStatsLog.CONNECTIVITY_STATE_SAMPLE;
|
|||
import static com.android.server.connectivity.ConnectivityFlags.CELLULAR_DATA_INACTIVITY_TIMEOUT;
|
||||
import static com.android.server.connectivity.ConnectivityFlags.DELAY_DESTROY_SOCKETS;
|
||||
import static com.android.server.connectivity.ConnectivityFlags.INGRESS_TO_VPN_ADDRESS_FILTERING;
|
||||
import static com.android.server.connectivity.ConnectivityFlags.NAMESPACE_TETHERING_BOOT;
|
||||
import static com.android.server.connectivity.ConnectivityFlags.QUEUE_CALLBACKS_FOR_FROZEN_APPS;
|
||||
import static com.android.server.connectivity.ConnectivityFlags.REQUEST_RESTRICTED_WIFI;
|
||||
import static com.android.server.connectivity.ConnectivityFlags.WIFI_DATA_INACTIVITY_TIMEOUT;
|
||||
|
|
@ -1615,13 +1615,13 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
|
||||
/** Returns the data inactivity timeout to be used for cellular networks */
|
||||
public int getDefaultCellularDataInactivityTimeout() {
|
||||
return DeviceConfigUtils.getDeviceConfigPropertyInt(NAMESPACE_TETHERING,
|
||||
return DeviceConfigUtils.getDeviceConfigPropertyInt(NAMESPACE_TETHERING_BOOT,
|
||||
CELLULAR_DATA_INACTIVITY_TIMEOUT, 10);
|
||||
}
|
||||
|
||||
/** Returns the data inactivity timeout to be used for WiFi networks */
|
||||
public int getDefaultWifiDataInactivityTimeout() {
|
||||
return DeviceConfigUtils.getDeviceConfigPropertyInt(NAMESPACE_TETHERING,
|
||||
return DeviceConfigUtils.getDeviceConfigPropertyInt(NAMESPACE_TETHERING_BOOT,
|
||||
WIFI_DATA_INACTIVITY_TIMEOUT, 15);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ import com.android.server.ConnectivityService;
|
|||
* Collection of constants for the connectivity module.
|
||||
*/
|
||||
public final class ConnectivityFlags {
|
||||
/**
|
||||
* Boot namespace for this module. Values from this should only be read at boot.
|
||||
*/
|
||||
public static final String NAMESPACE_TETHERING_BOOT = "tethering_boot";
|
||||
|
||||
/**
|
||||
* Minimum module version at which to avoid rematching all requests when a network request is
|
||||
* registered, and rematch only the registered requests instead.
|
||||
|
|
|
|||
Loading…
Reference in a new issue