-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关于Andriod11权限申请失败,程序崩溃 #142
Comments
感谢反馈,后面会处理 |
Hi, is there any update on this issue? |
太忙,暂未处理 |
崩溃发生在项目的NetWorkUtils类,里面对网络状态的访问,引起READ_PHONE_STATE权限检查,在安卓11上会报安全异常,解决办法有两个 1、如果你自定义开发没用到网络事件,不启用即可 2、自己拷贝一份NetworkEventProducer,把NetWorkUtils类加个tryCatch即可 另外项目中ErrorCover 也直接引用了NetWorkUtils类,需要把相关方法增加tryCatch
|
good |
第二种自己拷贝一份NetworkEventProducer修改要怎么覆盖默认设置呢,直接依赖源码修改源码吗 |
TelephonyManager.getNetworkType()
在Android11上面需要动态申请READ_PHONE_STATE
,但是当用户拒绝该权限后,在播放视频时会造成应用崩溃,这里是不是应该改成相关功能无法正常使用而不是直接崩溃?还是我使用的姿势不对?下面是崩溃详情↓
Caused by: java.lang.SecurityException: getDataNetworkTypeForSubscriber
at android.os.Parcel.createExceptionOrNull(Parcel.java:2385)
at android.os.Parcel.createException(Parcel.java:2369)
at android.os.Parcel.readException(Parcel.java:2352)
at android.os.Parcel.readException(Parcel.java:2294)
at com.android.internal.telephony.ITelephony$Stub$Proxy.getNetworkTypeForSubscriber(ITelephony.java:8762)
at java.lang.reflect.Method.invoke(Native Method)
at com.jg.bh.b.a.a.invoke(Native Method)
at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
at $Proxy3.getNetworkTypeForSubscriber(Unknown Source)
at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3706)
at android.telephony.TelephonyManager.getNetworkType(TelephonyManager.java:3670)
at com.kk.taurus.playerbase.utils.NetworkUtils.getNetworkState(NetworkUtils.java:75)
at com.kk.taurus.playerbase.extension.NetworkEventProducer.onAdded(NetworkEventProducer.java:100)
at com.kk.taurus.playerbase.extension.ProducerGroup.addEventProducer(ProducerGroup.java:43)
at com.kk.taurus.playerbase.widget.SuperContainer.addEventProducer(SuperContainer.java:161)
at com.kk.taurus.playerbase.widget.BaseVideoView.onCreateSuperContainer(BaseVideoView.java:140)
at com.kk.taurus.playerbase.widget.BaseVideoView.init(BaseVideoView.java:112)
at com.kk.taurus.playerbase.widget.BaseVideoView.(BaseVideoView.java:102)
at com.kk.taurus.playerbase.widget.BaseVideoView.(BaseVideoView.java:97)
at com.kk.taurus.playerbase.widget.BaseVideoView.(BaseVideoView.java:93)
The text was updated successfully, but these errors were encountered: