AlexLiuSheng / CheckVersionLib

版本检测升级(更新)库。an auto check version library(app update) on Android
https://github.com/AlexLiuSheng/CheckVersionLib
2.66k stars 483 forks source link

setCustomVersionDialogListener在拒绝权限后再次请求就无效了 #339

Closed lindan83 closed 3 years ago

lindan83 commented 3 years ago

setCustomVersionDialogListener设置了自定义Dialog后,点击确认更新,此时如果未授予STORAGE权限,将会自动弹出系统权限对话框,在此点击拒绝之后,再次发起请求,就变成系统默认的AlertDialog了,setCustomVersionDialogListener的自定义Dialog无效了。

本人分析是VersionService这个服务 1、有下载任务时会调用VersionService#enqueueWork 2、enqueueWork又会调用 AllenVersionChecker.getInstance().cancelAllMission()清除之前任务 3、cancelAllMission方法中发送了一个停止服务的EventBus事件,导致Service销毁 4、Service销毁又调用了onDestroy,在这里把builder给destroy了,所以之前设置的所有自定义参数就没了

AlexLiuSheng commented 3 years ago

2.4.1