免费不收费网站有哪些,广东网站备案查询,国内永久免费crm不实名认证,2020事件营销成功案例文章目录 开发平台基本信息问题描述解决方法 开发平台基本信息
芯片: MT8766 版本: Android 12 kernel: msm-4.19
问题描述
之前有个需求要设备默认开启WIFI热点#xff0c;默认开启usb共享网络#xff1b;而热点在原生的设定里面有个超时机制#xff0c;如果在限定时间内… 文章目录 开发平台基本信息问题描述解决方法 开发平台基本信息
芯片: MT8766 版本: Android 12 kernel: msm-4.19
问题描述
之前有个需求要设备默认开启WIFI热点默认开启usb共享网络而热点在原生的设定里面有个超时机制如果在限定时间内没有任何设备连接共享出来的网络则会自动关闭热点。但是客户的需求是一直保持共享网络开启。
解决方法
热点超时时间是读取config文件中config_wifiFrameworkSoftApShutDownTimeoutMilliseconds的值这个在低版本是写在framework目录下而在Android12中则是放在了packages/modules/Wifi/service/ServiceWifiResources/res/values/config.xml默认值是 600000也就是10分钟所以改大这个默认值也可以实现默认不关闭但是最大也就是int类型的最大值2147483647大概是10天左右。
还有一种做法就是在触发超时关闭共享网络的地方跳过关闭的步骤具体实现如下
--- a/packages/modules/Wifi/service/java/com/android/server/wifi/SoftApManager.javab/packages/modules/Wifi/service/java/com/android/server/wifi/SoftApManager.java-1424,21 1424,21 public class SoftApManager implements ActiveModeManager {// Already started, ignore this command.break;case CMD_NO_ASSOCIATED_STATIONS_TIMEOUT:
- if (!mTimeoutEnabled) {
- Log.wtf(getTag(), Timeout message received while timeout is disabled.
- Dropping.);
- break;
- }
- if (getConnectedClientList().size() ! 0) {
- Log.wtf(getTag(), Timeout message received but has clients.
- Dropping.);
- break;
- }
- mSoftApNotifier.showSoftApShutdownTimeoutExpiredNotification();
- Log.i(getTag(), Timeout message received. Stopping soft AP.);
- updateApState(WifiManager.WIFI_AP_STATE_DISABLING,
- WifiManager.WIFI_AP_STATE_ENABLED, 0);
- quitNow();// if (!mTimeoutEnabled) {// Log.wtf(getTag(), Timeout message received while timeout is disabled.// Dropping.);// break;// }// if (getConnectedClientList().size() ! 0) {// Log.wtf(getTag(), Timeout message received but has clients. // Dropping.);// break;// }// mSoftApNotifier.showSoftApShutdownTimeoutExpiredNotification();// Log.i(getTag(), Timeout message received. Stopping soft AP.);// updateApState(WifiManager.WIFI_AP_STATE_DISABLING,// WifiManager.WIFI_AP_STATE_ENABLED, 0);// quitNow();break;case CMD_NO_ASSOCIATED_STATIONS_TIMEOUT_ON_ONE_INSTANCE:if (!isBridgedMode() || mCurrentSoftApInfoMap.size() ! 2) {