只做了"送去系统设置",没接"回来":用户开完开关回到对话框, 按钮还是「去开启安装权限」,而 openInstallPermission() 发现已授权就直接 return, 点了毫无反应——只能杀掉 App 重来。 现在点之前先复查 canInstall():权限开了就直接交给安装器,没开才跳设置页。 顺带补上模拟器上的全流程验证与截图(弹窗、权限提示、系统安装器、首页入口)。
This commit is contained in:
@@ -96,7 +96,15 @@ fun UpdateDialog(
|
||||
when (phase) {
|
||||
UpdatePhase.Denied -> PrimaryButton(
|
||||
text = "去开启安装权限",
|
||||
onClick = { updater.openInstallPermission() },
|
||||
onClick = {
|
||||
// 用户可能是刚从系统设置回来:权限开了就直接装,没开才把人送过去
|
||||
val downloaded = file
|
||||
if (downloaded != null && updater.canInstall()) {
|
||||
handToInstaller(downloaded)
|
||||
} else {
|
||||
updater.openInstallPermission()
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
UpdatePhase.Downloaded -> PrimaryButton(
|
||||
|
||||
Reference in New Issue
Block a user