diff options
-rw-r--r-- | src/com/android/dialer/DialtactsActivity.java | 14 | ||||
-rw-r--r-- | src/com/android/dialer/list/ListsFragment.java | 2 |
2 files changed, 12 insertions, 4 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(); diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java index 09a4cb21e..7ae202f35 100644 --- a/src/com/android/dialer/list/ListsFragment.java +++ b/src/com/android/dialer/list/ListsFragment.java @@ -265,7 +265,7 @@ public class ListsFragment extends Fragment // Try to show the voicemail tab after the voicemail status returns. mShowVoicemailTabAfterVoicemailStatusIsFetched = true; } - } else { + } else if (index < getTabCount()){ mViewPager.setCurrentItem(getRtlPosition(index)); } } |