зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1880805 - Suppress ComponentCallbacks2 levels deprecation. r=android-reviewers,kaya
Differential Revision: https://phabricator.services.mozilla.com/D217435
This commit is contained in:
Родитель
6ac91e5519
Коммит
87c60cfa48
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче