启动AP导致system_server挂掉
程序员文章站
2022-09-17 08:29:57
错误现象在Setting中打开AP开关,过一会AP关闭,无法连接。屏幕黑屏。错误分析屏幕黑屏,大概率是system_server 进行重启了。从log中看是获取android.hardware.tetheroffload.config@1.0::IOffloadConfig/default失败。然后watchdog直接拉掉system_server。至于AP关闭,则是system_server在重启过程中拉起WifiService。做初始的时候,将wlan0 节点给disable。//WifiSe...
错误现象
在Setting中打开AP开关,过一会AP关闭,无法连接。屏幕黑屏。
错误分析
屏幕黑屏,大概率是system_server 进行重启了。从log中看是获取android.hardware.tetheroffload.config@1.0::IOffloadConfig/default失败。然后watchdog直接拉掉system_server。
至于AP关闭,则是system_server在重启过程中拉起WifiService。做初始的时候,将wlan0 节点给disable。
//WifiService 起来的时候重新 disable wlan0
09-09 16:22:12.316 5483 5483 I WifiService: WifiService starting up with Wi-Fi disabled
09-09 16:22:12.316 0 0 I init : starting service 'vendor.netmgrd'...
09-09 16:22:12.320 5483 5606 I android_os_HwBinder: HwBinder: Starting thread pool for default::android.hidl.manager@1.0::IServiceManager
09-09 16:22:12.322 5483 5622 D HalDevMgr: IWifi registration notification: fqName=android.hardware.wifi@1.0::IWifi, name=default, preexisting=true
09-09 16:22:12.323 5483 5606 I android_os_HwBinder: HwBinder: Starting thread pool for default::android.hardware.wifi@1.0::IWifi
09-09 16:22:12.324 5483 5619 I am_proc_bound: [0,5625,com.android.car]
09-09 16:22:12.325 425 425 I WifiHAL : Sent msg on exit sock to unblock poll()
09-09 16:22:12.325 425 4344 I WifiHAL : exit_event_handler, buf=E
09-09 16:22:12.325 425 4344 E WifiHAL : 1 events were leftover without being freed
09-09 16:22:12.325 5483 5619 I service_manager_stats: [100,16,250848]
09-09 16:22:12.325 425 4344 I android.hardware.wifi@1.0-service: Legacy HAL stop complete callback received
09-09 16:22:12.337 656 738 I LOWI-8.6.0.46: [LOWIController] isWifiEnabled: Wifi is now disabled
09-09 16:22:12.337 5428 5439 E Netd : Removing unknown address fe80::2e7:9dff:fe73:17f/64 from ifindex 13
09-09 16:22:12.337 656 4345 I LOWI-8.6.0.46: [LOWIScanResultReceiver] Thread terminate was requested
09-09 16:22:12.338 4361 4361 I hostapd : wlan0: INTERFACE-DISABLED
//watchdog 直接挂了system_server
W ServiceManagement: Waited one second for android.hardware.tetheroffload.config@1.0::IOffloadConfig/default. Waiting another...
09-09 16:21:59.478 1881 2605 W Watchdog: *** WATCHDOG KILLING SYSTEM PROCESS: Blocked in handler on i/o thread (android.io)
09-09 16:21:59.478 1881 2605 W Watchdog: android.io annotated stack trace:
09-09 16:21:59.478 1881 2605 W Watchdog: at com.android.server.connectivity.tethering.OffloadHardwareInterface.configOffload(Native Method)
09-09 16:21:59.478 1881 2605 W Watchdog: at com.android.server.connectivity.tethering.OffloadHardwareInterface.initOffloadConfig(OffloadHardwareInterface.java:99)
09-09 16:21:59.478 1881 2605 W Watchdog: at com.android.server.connectivity.tethering.OffloadController.start(OffloadController.java:140)
09-09 16:21:59.478 1881 2605 W Watchdog: at com.android.server.connectivity.Tethering$TetherMasterSM$OffloadWrapper.start(Tethering.java:1742)
09-09 16:21:59.479 1881 2605 W Watchdog: at com.android.server.connectivity.Tethering$TetherMasterSM$TetherModeAliveState.enter(Tethering.java:1539)
09-09 16:21:59.479 1881 2605 W Watchdog: at com.android.internal.util.StateMachine$SmHandler.invokeEnterMethods(StateMachine.java:1037)
09-09 16:21:59.479 1881 2605 W Watchdog: at com.android.internal.util.StateMachine$SmHandler.performTransitions(StateMachine.java:879)
09-09 16:21:59.479 1881 2605 W Watchdog: at com.android.internal.util.StateMachine$SmHandler.handleMessage(StateMachine.java:819)
09-09 16:21:59.479 1881 2605 W Watchdog: at android.os.Handler.dispatchMessage(Handler.java:106)
09-09 16:21:59.479 1881 2605 W Watchdog: at android.os.Looper.loop(Looper.java:193)
09-09 16:21:59.479 1881 2605 W Watchdog: at android.os.HandlerThread.run(HandlerThread.java:65)
09-09 16:21:59.479 1881 2605 W Watchdog: at com.android.server.ServiceThread.run(ServiceThread.java:44)
09-09 16:21:59.479 1881 2605 W Watchdog: *** GOODBYE!
09-09 16:21:59.479 1881 2605 I Process : Sending signal. PID: 1881 SIG: 9
附此服务的作用说明
详细请移步Google官网:[网络共享硬件分流] (https://source.android.google.cn/devices/tech/connect/tethering-offload?hl=zh-cn)
解决方案
- 1
根据出错行,定位是在OffloadHardwareInterface.java 的 initOffloadConfig() 报错。然后发现在这之前会有开关,判断offload是否可行。而这个offload则是根据全局的数据库来决定了。那么就好办了,这个值大概率是在可以在Setting中设置的,然后再Setting中全局搜一下哪里设置这个属性。
最后发现是在开发者模式下面
Developer Options -> Networking -> Terthering hardware acceleration
代码跟踪:
// OffloadController.java
public boolean start() {
if (started()) return true;
// 拦截处
if (isOffloadDisabled()) {
mLog.i("tethering offload disabled");
return false;
}
if (!mConfigInitialized) {
// 出错处
mConfigInitialized = mHwInterface.initOffloadConfig();
if (!mConfigInitialized) {
mLog.i("tethering offload config not supported");
stop();
return false;
}
}
...
return isStarted;
}
private boolean isOffloadDisabled() {
final int defaultDisposition = mHwInterface.getDefaultTetherOffloadDisabled();
return (Settings.Global.getInt(
mContentResolver, TETHER_OFFLOAD_DISABLED, defaultDisposition) != 0);
}
//Setting Package TetheringHardwareAccelPreferenceController.java
public void updateState(Preference preference) {
final int tetheringMode = Settings.Global.getInt(
mContext.getContentResolver(),
Settings.Global.TETHER_OFFLOAD_DISABLED, 0 /* default */);
((SwitchPreference) mPreference).setChecked(tetheringMode != SETTING_VALUE_OFF);
}
本文地址:https://blog.csdn.net/github_33381613/article/details/108733399
上一篇: 牛客编程巅峰赛S1第10场 - 黄金&钻石(总结)
下一篇: 在电脑上怎么输入韩国文字(韩语)?