应用程序在锁屏后冻结/崩溃

时间:2017-12-20 13:30:26

标签: android crash lockscreen onpause ondestroy

我的应用程序在运行时锁定屏幕时出现问题。手动或自动锁定没有区别。我的许多测试设备都没有从锁屏(例如三星S4Mini,三星S3)回来,其他人(三星标签a9)。手机冻结了几分钟。有时他们永远不会从锁屏退出,设备崩溃如此之大,只有重置或移除电池才能重新启动它。我认为这与在onDestroy()之后恢复应用程序有关。该应用程序尝试恢复,但没有成功。顺便说一句,onPause()之后的恢复工作正常。

谁有这方面的经验? 当屏幕被锁定时,是否有办法强制应用程序完全退出,以便在锁定屏幕后不会尝试恢复?

我尝试添加一些日志,但错误很难确定:

于21.14.367我的应用程序调用onDestroy() 在21.16.122,Windowmanager讲述了appfreeze 在21.16.487 WM告诉锁屏显示! 在21.19.317 WM告诉屏幕冻结了+ 5s298ms {keyguard}

//Use this before the alerts appear. I am doing it before app.launch()

let allowButtonPredicate = NSPredicate(format: "label == 'Always Allow' || label == 'Allow'")
//1st alert
_ = addUIInterruptionMonitor(withDescription: "Allow to access your location?") { (alert) -> Bool in
    let alwaysAllowButton = alert.buttons.matching(allowButtonPredicate).element.firstMatch
    if alwaysAllowButton.exists {
        alwaysAllowButton.tap()
        return true
    }
    return false
}
//Copy paste if there are more than one alerts to handle in the app

0 个答案:

没有答案