|
@@ -943,15 +943,13 @@ abstract class BaseReadAloudService : BaseService(),
|
|
|
* 更新通知
|
|
* 更新通知
|
|
|
*/
|
|
*/
|
|
|
override fun startForegroundNotification() {
|
|
override fun startForegroundNotification() {
|
|
|
- execute {
|
|
|
|
|
- try {
|
|
|
|
|
- val notification = createNotification()
|
|
|
|
|
- startForeground(NotificationId.ReadAloudService, notification.build())
|
|
|
|
|
- } catch (e: Exception) {
|
|
|
|
|
- AppLog.put("创建朗读通知出错,${e.localizedMessage}", e, true)
|
|
|
|
|
- //创建通知出错不结束服务就会崩溃,服务必须绑定通知
|
|
|
|
|
- stopSelf()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ val notification = createNotification()
|
|
|
|
|
+ startForeground(NotificationId.ReadAloudService, notification.build())
|
|
|
|
|
+ } catch (e: Exception) {
|
|
|
|
|
+ AppLog.put("创建朗读通知出错,${e.localizedMessage}", e, true)
|
|
|
|
|
+ //创建通知出错不结束服务就会崩溃,服务必须绑定通知
|
|
|
|
|
+ stopSelf()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|