--- a/frameworks/opt/net/wifi/service/java/com/mediatek/server/wifi/MtkSoftApManager.java
+++ b/frameworks/opt/net/wifi/service/java/com/mediatek/server/wifi/MtkSoftApManager.java
@@ -759,6 +759,11 @@ public class MtkSoftApManager extends SoftApManager {
private boolean getValue() {
boolean enabled = mFrameworkFacade.getIntegerSetting(mContext,
Settings.Global.SOFT_AP_TIMEOUT_ENABLED, 1) == 1;
+ //返回false禁止超时自动关闭wifi热点
+ if (SystemProperties.getInt("persist.cyg.always.open.wifiap", 0) == 1) {
+ Log.d(TAG, "can't close, always open wifi ap!");
+ return false;
+ }
return enabled;
}
}
@@ -770,6 +775,11 @@ public class MtkSoftApManager extends SoftApManager {
delay = MIN_SOFT_AP_TIMEOUT_DELAY_MS;
Log.w(TAG, "Overriding timeout delay with minimum limit value");
}
+ //自定义时间
+ if (SystemProperties.getInt("persist.cyg.wifiap.delaytime", 0) != 0) {
+ delay = SystemProperties.getInt("persist.cyg.wifiap.delaytime", 0) * 60000;
+ Log.d(TAG, "use custom delay time, delay = " + delay);
+ }
Log.d(TAG, "Timeout delay: " + delay);
return delay;
}
Android rom开发:framework中wifi热点定时关闭的源码实现
最新推荐文章于 2023-04-05 00:30:00 发布