From b31bc53b2c756615ff4386ef40d808d7a783b198 Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Tue, 10 Nov 2015 14:36:16 -0800 Subject: Specify whether the voicemail tab should be removed or updated. When we refresh the voicemail tab information, we want to specify whether we will be removing the tab or refreshing the data, this plays along with the method change in ViewPagerTabs in ContactsCommon. Bug: 25620191 Change-Id: Iddc9739ab545a55c5bc375639fbde64302f22cd8 --- src/com/android/dialer/list/ListsFragment.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java index 9b1e41e5d..cf999e70c 100644 --- a/src/com/android/dialer/list/ListsFragment.java +++ b/src/com/android/dialer/list/ListsFragment.java @@ -181,6 +181,7 @@ public class ListsFragment extends Fragment public void onResume() { Trace.beginSection(TAG + " onResume"); super.onResume(); + mActionBar = ((AppCompatActivity) getActivity()).getSupportActionBar(); if (getUserVisibleHint()) { sendScreenViewForCurrentPosition(); @@ -304,7 +305,12 @@ public class ListsFragment extends Fragment if (hasActiveVoicemailProvider != mHasActiveVoicemailProvider) { mHasActiveVoicemailProvider = hasActiveVoicemailProvider; mViewPagerAdapter.notifyDataSetChanged(); - mViewPagerTabs.updateTab(TAB_INDEX_VOICEMAIL); + + if (hasActiveVoicemailProvider) { + mViewPagerTabs.updateTab(TAB_INDEX_VOICEMAIL); + } else { + mViewPagerTabs.removeTab(TAB_INDEX_VOICEMAIL); + } mPrefs.edit() .putBoolean(VisualVoicemailEnabledChecker.PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER, -- cgit v1.2.3