全部。
我通常为我使用的每个 Android 版本编写自己的启用/禁用 USB 系绳脚本,但 11 让我难住了。看起来他们已将网络共享模块移动到不同的位置,并且似乎不再可以从“连接”(IConnectivityManager.aidl)调用网络共享。
安卓 10:
第 113 行:int setUsbTethering(boolean enable, String callerPkg);
11的变化:
https://source.android.com/devices/architecture/modular-system/tethering
“服务列表”参考我在下面找到的“android.net.ITetheringConnector”在第 191 行显示了网络共享。
11 中与 Tether 相关的参考文献:
第 29 行 Void setUsbTethering(boolean enable, String callerPkg, IIntResultListener receiver); 上面似乎是命令,但我不知道在“IIntResultListener 接收器”字段中需要发生什么。我认为首先必须在这个包中发生一些事情:
单程
interface IIntResultListener {
void onResult(int resultCode);
}
太多的新手来解决这个问题。任何帮助表示赞赏。