diff --git a/library/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidExcludedRefs.java b/library/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidExcludedRefs.java index 0853d59abb..6109ce6b8d 100644 --- a/library/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidExcludedRefs.java +++ b/library/leakcanary-android/src/main/java/com/squareup/leakcanary/AndroidExcludedRefs.java @@ -245,6 +245,13 @@ public static ExcludedRefs.Builder createAppDefaults() { excluded.instanceField("android.view.ViewConfiguration", "mContext"); } + if (SAMSUNG.equals(MANUFACTURER) && SDK_INT == KITKAT) { + // Samsung added a static mContext_static field to AudioManager, holds a reference to the + // activity. + // Observed here: https://github.com/square/leakcanary/issues/32 + excluded.staticField("android.media.AudioManager", "mContext_static"); + } + return excluded; }