diff options
author | Yorke Lee <yorkelee@google.com> | 2015-09-10 15:53:43 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2015-09-10 16:06:35 -0700 |
commit | 49aa5bf33be8b96d6409168cddbb819bc7539fab (patch) | |
tree | fda15abd5242057885319a539519be1943e15ce7 /src/com/android/dialer/DialtactsActivity.java | |
parent | a3b4676fe2bf93387333cb1ee789388265f7aac1 (diff) |
Improve jump to tab via intent logic
Respect the EXTRA_CALL_FILTER_TYPE extra if provided in an
intent extra
Fix bug where trying to jump to the voicemail tab for the
first time before active voicemail sources were detected
would not work.
Bug: 23947505
Bug: 23388120
Change-Id: Ib4fcaf486ae01d023f21fd2fc3bfc78f1a0cf609
Diffstat (limited to 'src/com/android/dialer/DialtactsActivity.java')
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/com/android/dialer/DialtactsActivity.java b/src/com/android/dialer/DialtactsActivity.java index 4ade04af1..2589956bc 100644 --- a/src/com/android/dialer/DialtactsActivity.java +++ b/src/com/android/dialer/DialtactsActivity.java @@ -536,13 +536,21 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O mDialerDatabaseHelper.startSmartDialUpdateThread(); mFloatingActionButtonController.align(getFabAlignment(), false /* animate */); - if (getIntent().hasExtra(EXTRA_SHOW_TAB)) { + if (Calls.CONTENT_TYPE.equals(getIntent().getType())) { + // Externally specified extras take precedence to EXTRA_SHOW_TAB, which is only + // used internally. + final Bundle extras = getIntent().getExtras(); + if (extras != null + && extras.getInt(Calls.EXTRA_CALL_TYPE_FILTER) == Calls.VOICEMAIL_TYPE) { + mListsFragment.showTab(ListsFragment.TAB_INDEX_VOICEMAIL); + } else { + mListsFragment.showTab(ListsFragment.TAB_INDEX_HISTORY); + } + } else if (getIntent().hasExtra(EXTRA_SHOW_TAB)) { int index = getIntent().getIntExtra(EXTRA_SHOW_TAB, ListsFragment.TAB_INDEX_SPEED_DIAL); if (index < mListsFragment.getTabCount()) { mListsFragment.showTab(index); } - } else if (Calls.CONTENT_TYPE.equals(getIntent().getType())) { - mListsFragment.showTab(ListsFragment.TAB_INDEX_HISTORY); } setSearchBoxHint(); |