Android Wifi小记 (2)
程序员文章站
2022-06-24 19:07:16
Hostapd ACS 开关控制 public HostapdHal(Context context) { mEnableAcs = context.getResources().getBoolean(R.bool.config_wifi_softap_acs_supported); mEnableIeee80211AC = context.getResources().getBoolean(R.bool.config_wifi_sof...
Hostapd ACS 开关控制
public HostapdHal(Context context) {
mEnableAcs = context.getResources().getBoolean(R.bool.config_wifi_softap_acs_supported);
mEnableIeee80211AC =
context.getResources().getBoolean(R.bool.config_wifi_softap_ieee80211ac_supported);
}
采用了overlay,覆盖了aosp中设置的值。
// aosp
./frameworks/base/core/res/res/values/config.xml: <bool translatable="false" name="config_wifi_softap_acs_supported">false</bool>
./frameworks/base/core/res/res/values/symbols.xml: <java-symbol type="bool" name="config_wifi_softap_acs_supported" />
// overlay
./device/qcom/common/device/overlay/frameworks/base/core/res/res/values/config.xml: <bool translatable="false" name="config_wifi_softap_acs_supported">true</bool>
./device/qcom/common/automotive/device/overlay/frameworks/base/core/res/res/values/config.xml: <bool translatable="false" name="config_wifi_softap_acs_supported">true</bool>
./vendor/qcom/proprietary/resource-overlay/common/Frameworks/res/values/config.xml: <bool translatable="false" name="config_wifi_softap_acs_supported">true</bool>
其中device, automotive 代表手机和车机平台。选择哪个是根据宏定义TARGET_BOARD_AUTO决定的。
//file path: device/qcom/common/base.mk
# enable overlays to use our version of
# source/resources etc.
ifneq ($(strip $(TARGET_BOARD_AUTO)),true)
DEVICE_PACKAGE_OVERLAYS += device/qcom/common/device/overlay
PRODUCT_PACKAGE_OVERLAYS += device/qcom/common/product/overlay
else
DEVICE_PACKAGE_OVERLAYS += device/qcom/common/automotive/device/overlay
PRODUCT_PACKAGE_OVERLAYS += device/qcom/common/automotive/product/overlay
endif
endif
//file path device/qcom/msmnile_gvmq/msmnile_gvmq.mk
TARGET_BOARD_AUTO := true
hotspot 开关流程
两个步骤。
- 1 hotspot 开关不是直接操作WifiManage的 startSoftAp()打开的。
- 2 ap 相关的设置是通过WifiManage 更新的。不是随着startSoftAp传进的。
//Setting WifiTetherSettings.java
@Override
public void onTetherConfigUpdated() {
final WifiConfiguration config = buildNewConfig();
mPasswordPreferenceController.updateVisibility(config.getAuthType());
/**
* if soft AP is stopped, bring up
* else restart with new config
* TODO: update config on a running access point when framework support is added
*/
if (mWifiManager.getWifiApState() == WifiManager.WIFI_AP_STATE_ENABLED) {
Log.d("TetheringSettings",
"Wifi AP config changed while enabled, stop and restart");
mRestartWifiApAfterConfigChange = true;
mSwitchBarController.stopTether();
}
mWifiManager.setWifiApConfiguration(config);
}
//system_server WifiServiceImpl.java 需要权限
private boolean checkNetworkSettingsPermission(int pid, int uid) {
return mContext.checkPermission(android.Manifest.permission.NETWORK_SETTINGS, pid, uid)
== PackageManager.PERMISSION_GRANTED;
}
//Setting WifiTetherSwitchBarController.java
void stopTether() {
mSwitchBar.setEnabled(false);
mConnectivityManager.stopTethering(TETHERING_WIFI);
}
void startTether() {
mSwitchBar.setEnabled(false);
mConnectivityManager.startTethering(TETHERING_WIFI, true /* showProvisioningUi */,
mOnStartTetheringCallback, new Handler(Looper.getMainLooper()));
}
Wifi WireShare 标签
帧类型 | 过滤器语法 |
---|---|
Management frame | wlan.fc.type == 0 |
Control frame | wlan.fc.type == 1 |
Data frame | wlan.fc.type == 2 |
Association request | wlan.fc.type_subtype == 0x00 |
Association response | wlan.fc.type_subtype == 0x01 |
Reassociation request | wlan.fc.type_subtype == 0x02 |
Reassociation response | wlan.fc.type_subtype == 0x03 |
Probe request | wlan.fc.type_subtype == 0x04 |
Probe response | wlan.fc.type_subtype == 0x05 |
Beacon | wlan.fc.type_subtype == 0x08 |
Disassociate | wlan.fc.type_subtype == 0x0A |
Authentication | wlan.fc.type_subtype == 0x0B |
Deauthentication | wlan.fc.type_subtype == 0x0C |
Action frame | wlan.fc.type_subtype == 0x0D |
Block ACK requests | wlan.fc.type_subtype == 0x18 |
Block ACK | wlan.fc.type_subtype == 0x19 |
Power save poll | wlan.fc.type_subtype == 0x1A |
Request to send | wlan.fc.type_subtype == 0x1B |
Clear to send | wlan.fc.type_subtype == 0x1C |
ACK | wlan.fc.type_subtype == 0x1D |
Contention free period end | wlan.fc.type_subtype == 0x1E |
NULL data | wlan.fc.type_subtype == 0x24 |
QoS data | wlan.fc.type_subtype == 0x28 |
Null QoS data | wlan.fc.type_subtype == 0x2C |
本文地址:https://blog.csdn.net/github_33381613/article/details/108737015
上一篇: 关于axios请求原理分析
下一篇: java连接mysql数据库的五种方式
推荐阅读
-
Android RecyclerView网格布局(支持多种分割线)详解(2)
-
Android编程创建桌面快捷方式的常用方法小结【2种方法】
-
Android编程判断是否连接网络的方法【WiFi及3G判断】
-
Android Wifi的forget()操作实例详解
-
Android开发实现在Wifi下获取本地IP地址的方法
-
Android编程开发之TextView控件用法(2种方法)
-
Android使用 Retrofit 2.X 上传多文件和多表单示例
-
Android判断用户2G/3G/4G移动数据网络
-
Android判断用户的网络类型实例讲解(2/3/4G、wifi)
-
Android编程下拉菜单spinner用法小结(附2则示例)