admin 管理员组

文章数量: 887021

wifi提示连接受限,网络连接可以正常使用

我找了以前前辈写的方法,使用adb改权限的方法可以解决问题,但不能让客户自己都这样操作,而改源码的方法,因为版本更新或者文件调用的相互覆盖,试了几个方法,并没有生效

我这是另辟蹊径,我想着去掉图标的感叹号和信息提示,让客户感觉不到差别

frameworks/base/packages/SettingsLib/src/com/android/settingslib/wifi/WifiStatusTracker.java

} else if (networkCapabilities.hasCapability(NET_CAPABILITY_PARTIAL_CONNECTIVITY)) {
-                statusLabel = mContext.getString(R.string.wifi_limited_connection);
+                statusLabel = "";//mContext.getString(R.string.wifi_limited_connection);
                 return;
             } else if (!networkCapabilities.hasCapability(NET_CAPABILITY_VALIDATED)) {
                 final String mode = Settings.Global.getString(mContext.getContentResolver(),

frameworks/opt/net/wifi/libs/WifiTrackerLib/src/com/android/wifitrackerlib/Utils.java

if (networkCapabilities.hasCapability(
                 NetworkCapabilities.NET_CAPABILITY_PARTIAL_CONNECTIVITY)) {
-            return context.getString(R.string.wifitrackerlib_wifi_limited_connection);
+            return "";//context.getString(R.string.wifi_limited_connection);

vendor/mediatek/proprietary/packages/apps/SettingsProvider/res/values/defaults.xml

文件末尾添加
 +    <bool name="def_hdmiControlAutoDeviceOff">false</bool>
+    <string name="def_captive_portal_https_url">https://connect.rom.miui/generate_204</string>
+    <string name="def_captive_portal_http_url">http://connect.rom.miui/generate_204</string>

system_mssi_t0/vendor/mediatek/proprietary/packages/apps/SettingsProvider/src/com/android/providers/settings/DatabaseHelper.java

loadBooleanSetting(stmt, Settings.Global.WIFI_DISPLAY_ON,
                     R.bool.def_wifi_display_on);

+            loadStringSetting(stmt, Settings.Global.CAPTIVE_PORTAL_HTTPS_URL,
+                    R.string.def_captive_portal_https_url);
+            loadStringSetting(stmt, Settings.Global.CAPTIVE_PORTAL_HTTP_URL,
+                    R.string.def_captive_portal_http_url);

loadStringSetting(stmt, Settings.Global.LOCK_SOUND,
                     R.string.def_lock_sound);

绿色文件是添加的,红色是去掉的文件,黑色是上下文方便定位的

本文标签: 内网 提示 手机 网络