diff options
author | Ta-wei Yen <twyen@google.com> | 2015-11-05 14:13:12 -0800 |
---|---|---|
committer | Ta-wei Yen <twyen@google.com> | 2015-11-06 22:54:14 +0000 |
commit | a5437e6882bde69cb795ed8d929c1024a8fef16e (patch) | |
tree | 1778d022d1c44d7dba00dd50abb726de8f05238b /src/com | |
parent | 6e0fd6b77759baf43cb37d407041be051b4856b5 (diff) |
Call Blocking UI/String change
+ Adjusted UI/String according to new specifications.
+ Added class VisualVoicemailEnabledChecker
+ Block number dialog display different message depending
on whether VVM is activated.
Bug:25455707
Change-Id: I09425053c91a5517e309302d421beadcc2d81cd4
Diffstat (limited to 'src/com')
8 files changed, 232 insertions, 62 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 0d943e055..f63fcf3b0 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -358,6 +358,7 @@ public class CallDetailActivity extends AppCompatActivity switch(view.getId()) { case R.id.call_detail_action_block: BlockNumberDialogFragment.show( + this, mBlockedNumberId, mNumber, mDetails.countryIso, diff --git a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java index 12df6c6d3..0087506fd 100644 --- a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java +++ b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java @@ -328,6 +328,7 @@ public final class CallLogListItemViewHolder extends RecyclerView.ViewHolder switch (item.getItemId()) { case R.id.context_menu_block_number: BlockNumberDialogFragment.show( + mContext, blockId, number, countryIso, diff --git a/src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java b/src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java index 7a94eebb5..4cbd4ddb8 100644 --- a/src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java +++ b/src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java @@ -23,25 +23,26 @@ import android.app.FragmentManager; import android.content.ContentValues; import android.content.Context; import android.content.DialogInterface; -import android.content.res.Resources; import android.net.Uri; import android.os.Bundle; import android.support.design.widget.Snackbar; -import android.telephony.PhoneNumberUtils; import android.text.TextUtils; import android.view.View; import android.widget.Toast; +import com.android.contacts.common.util.ContactDisplayUtils; import com.android.dialer.R; import com.android.dialer.database.FilteredNumberAsyncQueryHandler; import com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnBlockNumberListener; import com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnUnblockNumberListener; +import com.android.dialer.voicemail.VisualVoicemailEnabledChecker; /** * Fragment for confirming and enacting blocking/unblocking a number. Also invokes snackbar * providing undo functionality. */ -public class BlockNumberDialogFragment extends DialogFragment { +public class BlockNumberDialogFragment extends DialogFragment + implements VisualVoicemailEnabledChecker.Callback{ /** * Use a callback interface to update UI after success/undo. Favor this approach over other @@ -69,9 +70,12 @@ public class BlockNumberDialogFragment extends DialogFragment { private FilteredNumberAsyncQueryHandler mHandler; private View mParentView; + private VisualVoicemailEnabledChecker mVoicemailEnabledChecker; private Callback mCallback; + private AlertDialog mAlertDialog; public static void show( + Context context, Integer blockId, String number, String countryIso, @@ -80,13 +84,14 @@ public class BlockNumberDialogFragment extends DialogFragment { FragmentManager fragmentManager, Callback callback) { final BlockNumberDialogFragment newFragment = BlockNumberDialogFragment.newInstance( - blockId, number, countryIso, displayNumber, parentViewId); + context, blockId, number, countryIso, displayNumber, parentViewId); newFragment.setCallback(callback); newFragment.show(fragmentManager, BlockNumberDialogFragment.BLOCK_DIALOG_FRAGMENT); } private static BlockNumberDialogFragment newInstance( + Context context, Integer blockId, String number, String countryIso, @@ -104,6 +109,8 @@ public class BlockNumberDialogFragment extends DialogFragment { args.putString(ARG_COUNTRY_ISO, countryIso); args.putString(ARG_DISPLAY_NUMBER, displayNumber); fragment.setArguments(args); + fragment.mVoicemailEnabledChecker = new VisualVoicemailEnabledChecker(context,fragment); + fragment.mVoicemailEnabledChecker.asyncUpdate(); return fragment; } @@ -123,17 +130,28 @@ public class BlockNumberDialogFragment extends DialogFragment { mHandler = new FilteredNumberAsyncQueryHandler(getContext().getContentResolver()); mParentView = getActivity().findViewById(getArguments().getInt(ARG_PARENT_VIEW_ID)); - String message; + CharSequence title; String okText; + String message; if (isBlocked) { - message = getString(R.string.unblockNumberConfirmation, mDisplayNumber); - okText = getString(R.string.unblockNumberOk); + title = getTtsSpannedPhoneNumberString(R.string.unblock_number_confirmation_title, + mDisplayNumber); + okText = getString(R.string.unblock_number_ok); + message = null; } else { - message = getString(R.string.blockNumberConfirmation, mDisplayNumber); - okText = getString(R.string.blockNumberOk); + title = getTtsSpannedPhoneNumberString(R.string.block_number_confirmation_title, + mDisplayNumber); + okText = getString(R.string.block_number_ok); + if (mVoicemailEnabledChecker.isVisualVoicemailEnabled()) { + message = getString(R.string.block_number_confirmation_message_vvm); + } else { + message = getString(R.string.block_number_confirmation_message_no_vvm); + } } + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()) + .setTitle(title) .setMessage(message) .setPositiveButton(okText, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { @@ -142,10 +160,16 @@ public class BlockNumberDialogFragment extends DialogFragment { } else { blockNumber(); } + mAlertDialog = null; } }) - .setNegativeButton(android.R.string.cancel, null); - return builder.create(); + .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int id) { + mAlertDialog = null; + } + }); + mAlertDialog = builder.create(); + return mAlertDialog; } @Override @@ -171,12 +195,17 @@ public class BlockNumberDialogFragment extends DialogFragment { mCallback = callback; } - private String getBlockedMessage() { - return getString(R.string.snackbar_number_blocked, mDisplayNumber); + private CharSequence getTtsSpannedPhoneNumberString(int id,String number){ + String msg = getString(id, mDisplayNumber); + return ContactDisplayUtils.getTelephoneTtsSpannable(msg,mDisplayNumber); + } + + private CharSequence getBlockedMessage() { + return getTtsSpannedPhoneNumberString(R.string.snackbar_number_blocked, mDisplayNumber); } - private String getUnblockedMessage() { - return getString(R.string.snackbar_number_unblocked, mDisplayNumber); + private CharSequence getUnblockedMessage() { + return getTtsSpannedPhoneNumberString(R.string.snackbar_number_unblocked, mDisplayNumber); } private int getActionTextColor() { @@ -184,8 +213,8 @@ public class BlockNumberDialogFragment extends DialogFragment { } private void blockNumber() { - final String message = getBlockedMessage(); - final String undoMessage = getUnblockedMessage(); + final CharSequence message = getBlockedMessage(); + final CharSequence undoMessage = getUnblockedMessage(); final Callback callback = mCallback; final int actionTextColor = getActionTextColor(); final Context context = getContext(); @@ -233,8 +262,8 @@ public class BlockNumberDialogFragment extends DialogFragment { } private void unblockNumber() { - final String message = getUnblockedMessage(); - final String undoMessage = getBlockedMessage(); + final CharSequence message = getUnblockedMessage(); + final CharSequence undoMessage = getBlockedMessage(); final Callback callback = mCallback; final int actionTextColor = getActionTextColor(); @@ -270,4 +299,19 @@ public class BlockNumberDialogFragment extends DialogFragment { } }, getArguments().getInt(ARG_BLOCK_ID)); } + + @Override + public void onVisualVoicemailEnabledStatusChanged(boolean newStatus){ + updateActiveVoicemailProvider(); + } + + private void updateActiveVoicemailProvider(){ + if(mAlertDialog != null) { + if (mVoicemailEnabledChecker.isVisualVoicemailEnabled()) { + mAlertDialog.setMessage(getString(R.string.block_number_confirmation_message_vvm)); + } else { + mAlertDialog.setMessage(getString(R.string.block_number_confirmation_message_no_vvm)); + } + } + } } diff --git a/src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java b/src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java index ad9e7a652..be83df723 100644 --- a/src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java +++ b/src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java @@ -16,8 +16,8 @@ package com.android.dialer.filterednumber; import android.app.FragmentManager; -import android.database.Cursor; import android.content.Context; +import android.database.Cursor; import android.view.View; import com.android.contacts.common.ContactPhotoManager; @@ -46,7 +46,7 @@ public class BlockedNumbersAdapter extends NumbersAdapter { } @Override - public void bindView(View view, Context context, Cursor cursor) { + public void bindView(View view, final Context context, Cursor cursor) { super.bindView(view, context, cursor); final Integer id = cursor.getInt(cursor.getColumnIndex(FilteredNumberColumns._ID)); final String countryIso = cursor.getString(cursor.getColumnIndex( @@ -60,6 +60,7 @@ public class BlockedNumbersAdapter extends NumbersAdapter { @Override public void onClick(View view) { BlockNumberDialogFragment.show( + context, id, number, countryIso, diff --git a/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java b/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java index a2a716fe3..881ec0497 100644 --- a/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java +++ b/src/com/android/dialer/filterednumber/BlockedNumbersFragment.java @@ -15,41 +15,40 @@ */ package com.android.dialer.filterednumber; -import android.app.Activity; import android.app.ListFragment; import android.app.LoaderManager; import android.content.Context; import android.content.CursorLoader; -import android.content.Intent; import android.content.Loader; import android.database.Cursor; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; -import android.widget.CompoundButton; -import android.widget.Switch; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.CompoundButton; -import android.widget.Switch; +import android.widget.ImageView; +import android.widget.TextView; +import com.android.contacts.common.lettertiles.LetterTileDrawable; import com.android.dialer.R; import com.android.dialer.database.FilteredNumberContract; import com.android.dialer.filterednumber.FilteredNumbersUtil.CheckForSendToVoicemailContactListener; import com.android.dialer.filterednumber.FilteredNumbersUtil.ImportSendToVoicemailContactsListener; -import com.android.dialer.voicemail.VoicemailStatusHelper; -import com.android.dialer.voicemail.VoicemailStatusHelperImpl; +import com.android.dialer.voicemail.VisualVoicemailEnabledChecker; public class BlockedNumbersFragment extends ListFragment - implements LoaderManager.LoaderCallbacks<Cursor>, View.OnClickListener { + implements LoaderManager.LoaderCallbacks<Cursor>, View.OnClickListener, + VisualVoicemailEnabledChecker.Callback { + private static final char ADD_BLOCKED_NUMBER_ICON_LETTER = '+'; private BlockedNumbersAdapter mAdapter; - private VoicemailStatusHelper mVoicemailStatusHelper; + private VisualVoicemailEnabledChecker mVoicemailEnabledChecker; private View mImportSettings; private View mBlockedNumbersDisabledForEmergency; + private View mBlockedNumberListDivider; @Override public void onActivityCreated(Bundle savedInstanceState) { @@ -58,6 +57,15 @@ public class BlockedNumbersFragment extends ListFragment LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); getListView().addHeaderView(inflater.inflate(R.layout.blocked_number_header, null)); + getListView().addFooterView(inflater.inflate(R.layout.blocked_number_footer, null)); + //replace the icon for add number with LetterTileDrawable(), so it will have identical style + ImageView addNumberIcon = (ImageView) getActivity().findViewById(R.id.add_number_icon); + LetterTileDrawable drawable = new LetterTileDrawable(getResources()); + drawable.setLetter(ADD_BLOCKED_NUMBER_ICON_LETTER); + drawable.setColor(getResources().getColor(R.color.add_blocked_number_icon_color, + getActivity().getTheme())); + drawable.setIsCircular(true); + addNumberIcon.setImageDrawable(drawable); if (mAdapter == null) { mAdapter = BlockedNumbersAdapter.newBlockedNumbersAdapter( @@ -65,15 +73,17 @@ public class BlockedNumbersFragment extends ListFragment } setListAdapter(mAdapter); - mVoicemailStatusHelper = new VoicemailStatusHelperImpl(); - - mImportSettings = getActivity().findViewById(R.id.import_settings); + mImportSettings = getListView().findViewById(R.id.import_settings); mBlockedNumbersDisabledForEmergency = - getActivity().findViewById(R.id.blocked_numbers_disabled_for_emergency); - - getActivity().findViewById(R.id.import_button).setOnClickListener(this);; - getActivity().findViewById(R.id.view_numbers_button).setOnClickListener(this); - getActivity().findViewById(R.id.add_number_textview).setOnClickListener(this); + getListView().findViewById(R.id.blocked_numbers_disabled_for_emergency); + mBlockedNumberListDivider = getActivity().findViewById(R.id.blocked_number_list_divider); + getListView().findViewById(R.id.import_button).setOnClickListener(this);; + getListView().findViewById(R.id.view_numbers_button).setOnClickListener(this); + getListView().findViewById(R.id.add_number_linear_layout).setOnClickListener(this); + + mVoicemailEnabledChecker = new VisualVoicemailEnabledChecker(getContext(),this); + mVoicemailEnabledChecker.asyncUpdate(); + updateActiveVoicemailProvider(); } @Override @@ -103,19 +113,21 @@ public class BlockedNumbersFragment extends ListFragment actionBar.setTitle(R.string.manage_blocked_numbers_label); FilteredNumbersUtil.checkForSendToVoicemailContact( - getActivity(), new CheckForSendToVoicemailContactListener() { - @Override - public void onComplete(boolean hasSendToVoicemailContact) { - final int visibility = hasSendToVoicemailContact ? View.VISIBLE : View.GONE; - mImportSettings.setVisibility(visibility); - } - }); + getActivity(), new CheckForSendToVoicemailContactListener() { + @Override + public void onComplete(boolean hasSendToVoicemailContact) { + final int visibility = hasSendToVoicemailContact ? View.VISIBLE : View.GONE; + mImportSettings.setVisibility(visibility); + } + }); if (FilteredNumbersUtil.hasRecentEmergencyCall(getContext())) { mBlockedNumbersDisabledForEmergency.setVisibility(View.VISIBLE); } else { mBlockedNumbersDisabledForEmergency.setVisibility(View.GONE); } + + mVoicemailEnabledChecker.asyncUpdate(); } @Override @@ -143,6 +155,11 @@ public class BlockedNumbersFragment extends ListFragment @Override public void onLoadFinished(Loader<Cursor> loader, Cursor data) { mAdapter.swapCursor(data); + if (data.getCount() == 0) { + mBlockedNumberListDivider.setVisibility(View.INVISIBLE); + } else { + mBlockedNumberListDivider.setVisibility(View.VISIBLE); + } } @Override @@ -158,7 +175,7 @@ public class BlockedNumbersFragment extends ListFragment } switch (view.getId()) { - case R.id.add_number_textview: + case R.id.add_number_linear_layout: activity.showSearchUi(); break; case R.id.view_numbers_button: @@ -175,4 +192,21 @@ public class BlockedNumbersFragment extends ListFragment break; } } + @Override + public void onVisualVoicemailEnabledStatusChanged(boolean newStatus){ + updateActiveVoicemailProvider(); + } + + private void updateActiveVoicemailProvider(){ + if (getActivity() == null || getActivity().isFinishing()) { + return; + } + TextView footerText = (TextView) getActivity().findViewById( + R.id.blocked_number_footer_textview); + if (mVoicemailEnabledChecker.isVisualVoicemailEnabled()) { + footerText.setText(R.string.block_number_footer_message_vvm); + } else { + footerText.setText(R.string.block_number_footer_message_no_vvm); + } + } } diff --git a/src/com/android/dialer/list/BlockedListSearchFragment.java b/src/com/android/dialer/list/BlockedListSearchFragment.java index 94036ae81..7f8f12c73 100644 --- a/src/com/android/dialer/list/BlockedListSearchFragment.java +++ b/src/com/android/dialer/list/BlockedListSearchFragment.java @@ -36,7 +36,6 @@ import com.android.dialer.R; import com.android.dialer.database.FilteredNumberAsyncQueryHandler; import com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnCheckBlockedListener; import com.android.dialer.filterednumber.BlockNumberDialogFragment; -import com.android.dialer.filterednumber.BlockedNumbersSettingsActivity; import com.android.dialer.widget.SearchEditTextLayout; public class BlockedListSearchFragment extends RegularSearchFragment @@ -177,6 +176,7 @@ public class BlockedListSearchFragment extends RegularSearchFragment public void onCheckComplete(Integer id) { if (id == null) { BlockNumberDialogFragment.show( + getContext(), id, number, countryIso, @@ -224,6 +224,7 @@ public class BlockedListSearchFragment extends RegularSearchFragment } BlockNumberDialogFragment.show( + getContext(), blockId, number, GeoUtil.getCurrentCountryIso(getContext()), diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java index 08a23732f..4735926e8 100644 --- a/src/com/android/dialer/list/ListsFragment.java +++ b/src/com/android/dialer/list/ListsFragment.java @@ -15,10 +15,8 @@ */ package com.android.dialer.list; -import android.animation.LayoutTransition; import android.app.Fragment; import android.app.FragmentManager; -import android.content.Context; import android.content.SharedPreferences; import android.database.Cursor; import android.os.Bundle; @@ -30,27 +28,21 @@ import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager.OnPageChangeListener; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.AbsListView; -import android.widget.ListView; -import com.android.contacts.common.GeoUtil; import com.android.contacts.common.list.ViewPagerTabs; -import com.android.contacts.commonbind.analytics.AnalyticsUtil; import com.android.dialer.DialtactsActivity; import com.android.dialer.R; import com.android.dialer.calllog.CallLogFragment; import com.android.dialer.calllog.CallLogQueryHandler; -import com.android.dialer.calllog.ContactInfoHelper; import com.android.dialer.logging.Logger; import com.android.dialer.util.DialerUtils; +import com.android.dialer.voicemail.VisualVoicemailEnabledChecker; import com.android.dialer.voicemail.VoicemailStatusHelper; import com.android.dialer.voicemail.VoicemailStatusHelperImpl; import com.android.dialer.widget.ActionBarController; -import com.android.dialerbind.ObjectFactory; import java.util.ArrayList; @@ -76,9 +68,6 @@ public class ListsFragment extends Fragment public static final int TAB_COUNT_DEFAULT = 3; public static final int TAB_COUNT_WITH_VOICEMAIL = 4; - private static final String PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER = - "has_active_voicemail_provider"; - public interface HostInterface { public ActionBarController getActionBarController(); } @@ -182,7 +171,7 @@ public class ListsFragment extends Fragment mPrefs = PreferenceManager.getDefaultSharedPreferences(getActivity()); mHasActiveVoicemailProvider = mPrefs.getBoolean( - PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER, false); + VisualVoicemailEnabledChecker.PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER, false); Trace.endSection(); } @@ -317,7 +306,8 @@ public class ListsFragment extends Fragment mViewPagerTabs.updateTab(TAB_INDEX_VOICEMAIL); mPrefs.edit() - .putBoolean(PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER, hasActiveVoicemailProvider) + .putBoolean(VisualVoicemailEnabledChecker.PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER, + hasActiveVoicemailProvider) .commit(); } diff --git a/src/com/android/dialer/voicemail/VisualVoicemailEnabledChecker.java b/src/com/android/dialer/voicemail/VisualVoicemailEnabledChecker.java new file mode 100644 index 000000000..3134b1486 --- /dev/null +++ b/src/com/android/dialer/voicemail/VisualVoicemailEnabledChecker.java @@ -0,0 +1,98 @@ +package com.android.dialer.voicemail; + + +import android.content.Context; +import android.content.SharedPreferences; +import android.database.Cursor; +import android.preference.PreferenceManager; +import android.support.annotation.Nullable; + +import com.android.dialer.calllog.CallLogQueryHandler; + +/** + * Helper class to check whether visual voicemail is enabled. + * + * Call isVisualVoicemailEnabled() to retrieve the result. + * + * The result is cached and saved in a SharedPreferences, stored as a boolean in + * PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER. Every time a new instance is created, it will try to + * restore the cached result from the SharedPreferences. + * + * Call asyncUpdate() to make a CallLogQuery to check the actual status. This is a async call so + * isVisualVoicemailEnabled() will not be affected immediately. + * + * If the status has changed as a result of asyncUpdate(), + * Callback.onVisualVoicemailEnabledStatusChanged() will be called with the new value. + */ +public class VisualVoicemailEnabledChecker implements CallLogQueryHandler.Listener { + + public static final String PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER = + "has_active_voicemail_provider"; + private SharedPreferences mPrefs; + private boolean mHasActiveVoicemailProvider; + private CallLogQueryHandler mCallLogQueryHandler; + private VoicemailStatusHelper mVoicemailStatusHelper; + private Context mContext; + + public interface Callback { + + /** + * Callback to notify enabled status has changed to the @param newValue + */ + void onVisualVoicemailEnabledStatusChanged(boolean newValue); + } + + private Callback mCallback; + + public VisualVoicemailEnabledChecker(Context context, @Nullable Callback callback) { + mContext = context; + mCallback = callback; + mPrefs = PreferenceManager.getDefaultSharedPreferences(mContext); + mVoicemailStatusHelper = new VoicemailStatusHelperImpl(); + mHasActiveVoicemailProvider = mPrefs.getBoolean(PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER, + false); + } + + /** + * @return whether visual voicemail is enabled. Result is cached, call asyncUpdate() to + * update the result. + */ + public boolean isVisualVoicemailEnabled() { + return mHasActiveVoicemailProvider; + } + + /** + * Perform an async query into the system to check the status of visual voicemail. + * If the status has changed, Callback.onVisualVoicemailEnabledStatusChanged() will be called. + */ + public void asyncUpdate() { + mCallLogQueryHandler = + new CallLogQueryHandler(mContext, mContext.getContentResolver(), this); + mCallLogQueryHandler.fetchVoicemailStatus(); + } + + @Override + public void onVoicemailStatusFetched(Cursor statusCursor) { + boolean hasActiveVoicemailProvider = + mVoicemailStatusHelper.getNumberActivityVoicemailSources(statusCursor) > 0; + if (hasActiveVoicemailProvider != mHasActiveVoicemailProvider) { + mHasActiveVoicemailProvider = hasActiveVoicemailProvider; + mPrefs.edit().putBoolean(PREF_KEY_HAS_ACTIVE_VOICEMAIL_PROVIDER, + mHasActiveVoicemailProvider); + if (mCallback != null) { + mCallback.onVisualVoicemailEnabledStatusChanged(mHasActiveVoicemailProvider); + } + } + } + + @Override + public void onVoicemailUnreadCountFetched(Cursor cursor) { + // Do nothing + } + + @Override + public boolean onCallsFetched(Cursor combinedCursor) { + // Do nothing + return false; + } +} |