summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNancy Chen <nancychen@google.com>2015-11-10 14:36:16 -0800
committerNancy Chen <nancychen@google.com>2015-11-10 17:01:41 -0800
commitb31bc53b2c756615ff4386ef40d808d7a783b198 (patch)
tree824c514f7a4852e2f122555aaee8a8c35314dc17
parent1febe8b1542d6038787754c0749527a66b58b01d (diff)
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
-rw-r--r--src/com/android/dialer/list/ListsFragment.java8
1 files changed, 7 insertions, 1 deletions
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,