summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/contactsfragment/ContactsAdapter.java
diff options
context:
space:
mode:
authormaxwelb <maxwelb@google.com>2017-11-27 17:01:07 -0800
committerCopybara-Service <copybara-piper@google.com>2017-11-29 11:42:34 -0800
commit5e22e8009682c92b1b4bb44301da3c606b0090e8 (patch)
tree50c8e640eaadacfa9d750af7ebc2e29fc57ce60f /java/com/android/dialer/contactsfragment/ContactsAdapter.java
parentbadfdc429f77626fd7b28c7964de7cfd2981f219 (diff)
Refactor DialpadFragment's DtmfKeyListener
This change is the refactoring on DtmfKeyListener and adding tests. The class is an overridden version of DialerKeyListener, but it also supports direct onKeyDown and onKeyUp hooks from the DialpadFragment. There was a lot of duplicated code between these hooks and the overridden methods so the code was refactored to share more logic. The interesting part of this change is using EMPTY_SPANNABLE to call into super type methods instead of having to copy the implementation. This change may also help with OutOfMemoryExceptions because the DtmfKeyListener is promoted from a non-static inner class to a top level class. It no longer maintains an implicit reference to the DialpadFragment, holding onto the DialpadPresenter instead. To support testing this code, the ShadowCall had to be updated since it didn't support checking when a Dtmf tone was playing. Bug: 69133398 Test: DtmfKeyListenerTest, InCallActivityTest PiperOrigin-RevId: 177092841 Change-Id: I368083c71982e14db0ad936432a3a5bdf0dde5ee
Diffstat (limited to 'java/com/android/dialer/contactsfragment/ContactsAdapter.java')
0 files changed, 0 insertions, 0 deletions