fix(session): recognise Android 17 memory limiter kills (#3218)

This commit is contained in:
Ilya Danilkin authored and GitHub committed 2026-11-28 22:07:18 -05:00
1 parent 35b72669b6
commit a5d57469de
4 files changed
+30 -1

No files matched your search

@@ -11,6 +11,7 @@ class DeviceReportExitTest {
assertEquals("CRASH_NATIVE", DeviceReport.exitReasonName(5))
assertEquals("EXCESSIVE_RESOURCE_USAGE", DeviceReport.exitReasonName(9))
assertEquals("FREEZER", DeviceReport.exitReasonName(14))
assertEquals("MEMORY_LIMITER", DeviceReport.exitReasonName(17))
}
@Test fun anUnknownCodeStillShowsItsNumber() {
@@ -0,0 +1,18 @@
package com.droiddeck.launcher.session
import android.app.ApplicationExitInfo
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Test
class MemoryKillTest {
@Test
fun recognisesLowMemoryAndTheAndroid17Limiter() {
assertTrue(SessionArtifacts.memoryKill(ApplicationExitInfo.REASON_LOW_MEMORY, null))
assertTrue(SessionArtifacts.memoryKill(17, "kill"))
assertTrue(SessionArtifacts.memoryKill(ApplicationExitInfo.REASON_OTHER, "MemoryLimiter:AnonSwap"))
assertFalse(SessionArtifacts.memoryKill(ApplicationExitInfo.REASON_OTHER, "unstable content provider"))
assertFalse(SessionArtifacts.memoryKill(ApplicationExitInfo.REASON_OTHER, null))
assertFalse(SessionArtifacts.memoryKill(ApplicationExitInfo.REASON_USER_REQUESTED, "MemoryLimiter:AnonSwap"))
}
}