Skip to content

Commit

Permalink
Merge pull request #89 from square/py/speech
Browse files Browse the repository at this point in the history
Ignore SpeechRecognizer leak
  • Loading branch information
pyricau committed May 14, 2015
2 parents 0389ba7 + 9209d8f commit 5902beb
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ public enum AndroidExcludedRefs {
}
},

SPEECH_RECOGNIZER(SDK_INT == KITKAT) {
@Override void add(ExcludedRefs.Builder excluded) {
// Prior to Android 5, SpeechRecognizer.InternalListener was a non static inner class and
// leaked the SpeechRecognizer which leaked an activity context.
// Fixed in AOSP: https://github.com/android/platform_frameworks_base/commit
// /b37866db469e81aca534ff6186bdafd44352329b
excluded.instanceField("android.speech.SpeechRecognizer$InternalListener", "this$0");
}
},

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 5902beb

Please sign in to comment.