Skip to content

Commit

Permalink
Merge pull request #2514 from square/py/late_init
Browse files Browse the repository at this point in the history
Tag InputManager.mLateInitContext leak
  • Loading branch information
pyricau authored May 18, 2023
2 parents 2d45a79 + ac5a163 commit b3abcd9
Show file tree
Hide file tree
Showing 2 changed files with 14 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 @@ -100,6 +100,7 @@ public abstract class shark/AndroidReferenceMatchers : java/lang/Enum {
public static final field HUAWEI Ljava/lang/String;
public static final field IMM_CURRENT_INPUT_CONNECTION Lshark/AndroidReferenceMatchers;
public static final field IMM_LAST_FOCUS_VIEW Lshark/AndroidReferenceMatchers;
public static final field INPUT_MANAGER__M_LATE_INIT_CONTEXT Lshark/AndroidReferenceMatchers;
public static final field INPUT_METHOD_MANAGER_IS_TERRIBLE Lshark/AndroidReferenceMatchers;
public static final field INSTRUMENTATION_RECOMMEND_ACTIVITY Lshark/AndroidReferenceMatchers;
public static final field IREQUEST_FINISH_CALLBACK Lshark/AndroidReferenceMatchers;
Expand Down
13 changes: 13 additions & 0 deletions shark-android/src/main/java/shark/AndroidReferenceMatchers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,19 @@ enum class AndroidReferenceMatchers {
}
},

INPUT_MANAGER__M_LATE_INIT_CONTEXT {
override fun add(
references: MutableList<ReferenceMatcher>
) {
references += instanceFieldLeak(
"android.hardware.input.InputManager", "mLateInitContext",
description = "InputManager singleton leaks its init context which is an activity"
) {
sdkInt == 33
}
}
},

LAYOUT_TRANSITION {
override fun add(
references: MutableList<ReferenceMatcher>
Expand Down

0 comments on commit b3abcd9

Please sign in to comment.