improve logging and prevent some accidental soft reboots
This commit is contained in:
parent
1150ac3bc7
commit
198f89a368
2 changed files with 7 additions and 2 deletions
|
|
@ -23,11 +23,11 @@ private fun parseLog(level: Int, tag: String, msg: String, cause: Throwable? = n
|
|||
|
||||
private fun log(level: Int, tag: String, msg: String, cause: Throwable? = null) {
|
||||
if (level <= Log.DEBUG && HMAService.instance?.config?.detailLog == false) return
|
||||
val parsedLog = parseLog(level, tag, msg, cause)
|
||||
HMAService.instance?.executor?.execute {
|
||||
val parsedLog = parseLog(level, tag, msg, cause)
|
||||
HMAService.instance?.addLog(parsedLog)
|
||||
XposedBridge.log(parsedLog)
|
||||
}
|
||||
XposedBridge.log(parsedLog)
|
||||
}
|
||||
|
||||
fun logD(tag: String, msg: String, cause: Throwable? = null) = log(Log.DEBUG, tag, msg, cause)
|
||||
|
|
|
|||
|
|
@ -19,6 +19,11 @@ object UserService {
|
|||
|
||||
private val uidObserver = object : UidObserverAdapter() {
|
||||
override fun onUidActive(uid: Int) {
|
||||
if (HMAService.instance == null) {
|
||||
logE(TAG, "HMAService instance is not available, maybe stopped")
|
||||
return
|
||||
}
|
||||
|
||||
if (uid != appUid) return
|
||||
try {
|
||||
val provider = ActivityManagerApis.getContentProviderExternal(Constants.PROVIDER_AUTHORITY, 0, null, null)
|
||||
|
|
|
|||
Loading…
Reference in a new issue