对于WLAN only的产品,请将属性ro.radio.noril设置为yes。
这样,在如下代码中,Connectivity相关的CTS测试会被跳过:
/cts/tests/tests/net/src/android/net/cts/ConnectivityManagerTest.java
@Override
112 protected void setUp() throws Exception {
113 super.setUp();
114 Looper.prepare();
115 mContext = getContext();
116 mCm = (ConnectivityManager) mContext.getSystemService(
Context.CONNECTIVITY_SERVICE);
117 mWifiManager = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE);
118 mPackageManager = mContext.getPackageManager();
119 mWifiConnectAttempted = false;
120
121 // Get com.android.internal.R.array.networkAttributes
122 int resId = mContext.getResources().getIdentifier("networkAttributes", "array", "android");
123 String[] naStrings = mContext.getResources().getStringArray(resId);
124 //TODO: What is the "correct" way to determine if this is a wifi only device?
125 boolean wifiOnly = SystemProperties.getBoolean("ro.radio.noril", false);
126 for (String naString : naStrings) {
127 try {
128 NetworkConfig n = new NetworkConfig(naString);
129 if (wifiOnly && ConnectivityManager.isNetworkTypeMobile(n.type)) {
130 continue;
131 }
132 mNetworks.put(n.type, n);
133 } catch (Exception e) {}
134 }
135 }
关于WLAN only GMS相关配置
最新推荐文章于 2024-04-24 14:24:02 发布