Skip to content

Commit

Permalink
Add known UiModeManager memory leak from Android OS
Browse files Browse the repository at this point in the history
Fixes #2559
  • Loading branch information
EpicDima authored and pyricau committed Apr 18, 2024
1 parent 0cfd00a commit 3968bee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions shark-android/api/shark-android.api
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public abstract class shark/AndroidReferenceMatchers : java/lang/Enum {
public static final field TEXT_TO_SPEECH Lshark/AndroidReferenceMatchers;
public static final field TEXT_VIEW__MLAST_HOVERED_VIEW Lshark/AndroidReferenceMatchers;
public static final field TOAST_TN Lshark/AndroidReferenceMatchers;
public static final field UI_MODE_MANAGER Lshark/AndroidReferenceMatchers;
public static final field USER_MANAGER__SINSTANCE Lshark/AndroidReferenceMatchers;
public static final field VIEWLOCATIONHOLDER_ROOT Lshark/AndroidReferenceMatchers;
public static final field VIEW_CONFIGURATION__MCONTEXT Lshark/AndroidReferenceMatchers;
Expand Down
19 changes: 19 additions & 0 deletions shark-android/src/main/java/shark/AndroidReferenceMatchers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,25 @@ enum class AndroidReferenceMatchers {
}
},

UI_MODE_MANAGER {
override fun add(
references: MutableList<ReferenceMatcher>
) {
references += nativeGlobalVariableLeak(
"android.app.UiModeManager\$1",
description = """
UiModeManager$1 is an anonymous class of the IUiModeManagerCallback.Stub that is
stored in memory native code. `this$0` is an instance of the UiModeManager that
contains the `mContext` field, which is why retain this reference.
Introduced in Android 14.0.0_r11: https://cs.android.com/android/_/android/platform/frameworks/base/+/cbbc772a41d20645ae434d74c482f3f4ad377e2c
Fixed in Android 14.0.0_r16: https://cs.android.com/android/_/android/platform/frameworks/base/+/2bc364179327022d0f60224a1f2420349074c5d2
""".trimIndent()
) {
sdkInt == 34
}
}
},

// ######## Manufacturer specific known leaks ########

// SAMSUNG
Expand Down

0 comments on commit 3968bee

Please sign in to comment.