对于Android源生热点,如果10分钟内未连接任何设备,则具有热点将自动关闭的功能。
自动关闭超时时间设置在 config.xml。
<!-- Integer delay in milliseconds before shutting down soft AP when there
are no connected devices. Framework will enforce a minimum limit on
this value and this setting will be overridden if the provided value is
smaller than the limit. -->
<integer translatable="false" name="config_wifi_framework_soft_ap_timeout_delay">600000</integer>
禁用方法如下:
默认关闭超时关闭热点功能,参考源码Android P。
private boolean getValue() {
boolean enabled = mFrameworkFacade.getIntegerSetting(mContext,
//Settings.Global.SOFT_AP_TIMEOUT_ENABLED, 1) == 1;
Settings.Global.SOFT_AP_TIMEOUT_ENABLED, 0) == 1;
return enabled;
}