File tree 1 file changed +14
-0
lines changed
leakcanary-android/src/main/java/com/squareup/leakcanary
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,20 @@ public enum AndroidExcludedRefs {
221
221
}
222
222
},
223
223
224
+ USER_MANAGER__SINSTANCE (SDK_INT >= JELLY_BEAN && SDK_INT <= LOLLIPOP_MR1 ) {
225
+ @ Override void add (ExcludedRefs .Builder excluded ) {
226
+ // UserManager has a static sInstance field that creates an instance and caches it the first
227
+ // time UserManager.get() is called. This instance is created with the outer context (which
228
+ // is an activity base context).
229
+ // Tracked here: https://code.google.com/p/android/issues/detail?id=173789
230
+ // Introduced by: https://github.com/android/platform_frameworks_base/commit
231
+ // /27db46850b708070452c0ce49daf5f79503fbde6
232
+ // Fix: trigger a call to UserManager.get() in Application.onCreate(), so that the
233
+ // UserManager instance gets cached with a reference to the application context.
234
+ excluded .instanceField ("android.os.UserManager" , "mContext" );
235
+ }
236
+ },
237
+
224
238
DEVICE_POLICY_MANAGER__SETTINGS_OBSERVER (MOTOROLA .equals (MANUFACTURER ) && SDK_INT == KITKAT ) {
225
239
@ Override void add (ExcludedRefs .Builder excluded ) {
226
240
if (MOTOROLA .equals (MANUFACTURER ) && SDK_INT == KITKAT ) {
You can’t perform that action at this time.
0 commit comments