Skip to content

Commit

Permalink
Merge pull request square#103 from square/py/97
Browse files Browse the repository at this point in the history
Ignore AccountManager leak. Fixes square#97
  • Loading branch information
pyricau committed May 16, 2015
2 parents d7db7d0 + 9ebcf14 commit 71b8cd9
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static android.os.Build.MANUFACTURER;
import static android.os.Build.VERSION.SDK_INT;
import static android.os.Build.VERSION_CODES.ECLAIR;
import static android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH;
import static android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1;
import static android.os.Build.VERSION_CODES.JELLY_BEAN;
Expand Down Expand Up @@ -196,6 +197,19 @@ public enum AndroidExcludedRefs {
}
},

ACCOUNT_MANAGER(SDK_INT > ECLAIR && SDK_INT <= LOLLIPOP_MR1) {
@Override void add(ExcludedRefs.Builder excluded) {
// AccountManager$AmsTask$Response is a stub and is held in memory by native code, probably
// because the reference to the response in the other process hasn't been cleared.
// AccountManager$AmsTask is holding on to the activity reference to use for launching a new
// sub- Activity.
// Tracked here: https://code.google.com/p/android/issues/detail?id=173689
// Fix: Pass a null activity reference to the AccountManager methods and then deal with the
// returned future to to get the result and correctly start an activity when it's available.
excluded.instanceField("android.accounts.AccountManager$AmsTask$Response", "this$1");
}
},

DEVICE_POLICY_MANAGER__SETTINGS_OBSERVER(MOTOROLA.equals(MANUFACTURER) && SDK_INT == KITKAT) {
@Override void add(ExcludedRefs.Builder excluded) {
if (MOTOROLA.equals(MANUFACTURER) && SDK_INT == KITKAT) {
Expand Down

0 comments on commit 71b8cd9

Please sign in to comment.