Just yesterday I bought noname device called Hisense U30
with Android 9 and it works bad. It killing background apps VERY AGGRESSIVELY. Like I start music in Yandex.Music
(russian analog Spotify), switch off screen and in 1-2 minutes something kills player. It kills everything.
What I already tried:
- Disable every preinstalled battery savers;
- Disable battery optimization for certain apps;
- Tried everything from Background apps get killed (by something other than battery optimization)
Nothing. Player still get killed. OS looks pretty close to stock Android (at least not much preinstalled apps). So my guess is that OS is somehow incorrectly configured.
I looked into logcat
and what I got:
- It starts with
MemoryDetectService
like this
MemoryDetectService: onStartCommand()---> action = screen_off_app_clear
MemoryDetectService: AutoClearState -----> begin
- Then this service scan through all (I presume) running apps and find mine player too
MemoryDetectService: getRunningAppPackageName()---> begin
...
MemoryDetectService: RunningAppProcessInfo: cur.processName = ru.yandex.music:Metrica, pkgName = ru.yandex.music, uid = 10123, uid % 10000 = 123
MemoryDetectService: RunningPkgList---> pkgName = ru.yandex.music
...
MemoryDetectService: getCurrentHomePackages(): recentTasks = ru.yandex.music
- And then, SOMEHOW, decide to kill my player
MemoryDetectService: mRunningPkgList: pkgName = ru.yandex.music
MemoryDetectService: mNeedForceStopPkgList---> pkgName = ru.yandex.music
...
MemoryDetectService: currentPkgName---> ru.yandex.music
MemoryDetectService: hasPkgNeedClean(): currentPkgName(New Method: mRecent2PkgList.get(0)) = ru.yandex.music
MemoryDetectService: getWhiteListFromFile: String = null
MemoryDetectService: hasPkgNeedClean(): memBefore = 3894, mWhiteListStr =
- And then it start to kill processes
MemoryDetectService: clearMemory-----> begin
MemoryDetectService: clearMemory(): sendBroadcast hmct.intent.action.CLEAR_CACHE: null;
MemoryDetectService: screen on cleaning open = true , screen off cleaning open = true
MemoryDetectService: killPackage---> begin
...
MemoryDetectService: forceStopPackage---> begin
MemoryDetectService: clearMemory(forceStopPackage): isScreenOn = false
ActivityManager: Force stopping ru.yandex.music appid=10123 user=0: from pid 1972
ANDR-IOP: IOP HAL: Received pkg_name = ru.yandex.music pid = 0
ActivityManager: kill app.info.packageName=ru.yandex.music minOomAdj=-10000 packageName=ru.yandex.music
ActivityManager: kill app.info.packageName=ru.yandex.music minOomAdj=-10000 packageName=ru.yandex.music
ActivityManager: Killing 6673:ru.yandex.music:Metrica/u0a123 (adj 200): stop ru.yandex.music
ANDR-IOP: IOP HAL: Received pkg_name = ru.yandex.music:Metrica pid = 0
ActivityManager: Scheduling restart of crashed service ru.yandex.music/com.yandex.metrica.MetricaService in 20937ms
Zygote : Process 7489 exited due to signal (9)
...
ActivityManager: Killing 6616:ru.yandex.music/u0a123 (adj 200): stop ru.yandex.music
ANDR-IOP: IOP HAL: Received pkg_name = ru.yandex.music pid = 0
libprocessgroup: kill(-7799, 9) failed: No such process
ActivityManager: Scheduling restart of crashed service ru.yandex.music/.common.service.player.MediaSessionService in 20929ms
ActivityManager: Scheduling restart of crashed service ru.yandex.music/.common.service.player.AppForegrounderService in 20929ms
...
ActivityManager:
Force finishing activity ActivityRecord{
ba18734 u0 ru.yandex.music/.main.MainScreenActivity t248
}
MemoryDetectService: setPackageAliveState start----packageName = ru.yandex.music
MemoryDetectService: setPackageAliveState end----packageName = ru.yandex.music, aInfo.processName = ru.yandex.music
MemoryDetectService: mClearAppList---> pkgName = ru.yandex.music, mClearApp++--->1
Any idea how to fix this?
P.S. AFAIK there is no other ROM like Linage OS for my phone, and I am not a big fan of root
cuz this will break Google Pay, so it would be great to deal with it without rooting device.
Update 1
I looked up for this service in dumpsys
, and I have an idea: disable this service via adb shell am stopservice com.android.systemui/com.hmct.systemui.taskmanager.detectmemory.MemoryDetectService
. Will be back with results.