Bug 1880805 - Suppress ComponentCallbacks2 levels deprecation. r=android-reviewers,kaya

Differential Revision: https://phabricator.services.mozilla.com/D217435
This commit is contained in:
mcarare 2024-08-06 17:38:55 +00:00
Родитель 6ac91e5519
Коммит 87c60cfa48
3 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -341,6 +341,8 @@ class BrowserIcons constructor(
sharedMemoryCache.clear()
}
@Suppress("DEPRECATION") // Apps are not notified of these levels since API level 34.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1909473
override fun onTrimMemory(level: Int) {
val shouldClearMemoryCache = when (level) {
// Foreground: The device is running much lower on memory. The app is running and not killable, but the

Просмотреть файл

@ -77,6 +77,8 @@ internal class TrimMemoryMiddleware : Middleware<BrowserState, BrowserAction> {
}
}
@Suppress("DEPRECATION") // Apps are not notified of these levels since API level 34.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1909473
private fun shouldCloseEngineSessions(level: Int): Boolean {
return when (level) {
// Foreground: The device is running extremely low on memory. The app is not yet considered a killable

Просмотреть файл

@ -192,6 +192,8 @@ class TrimMemoryMiddlewareTest {
@Test
fun `TrimMemoryMiddleware - TRIM_MEMORY_RUNNING_CRITICAL`() {
@Suppress("DEPRECATION") // Apps are not notified of these levels since API level 34.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1909473
store.dispatch(
SystemAction.LowMemoryAction(
level = ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL,