summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/android/dialer/CallDetailActivity.java7
-rw-r--r--src/com/android/dialer/calllog/CallLogListItemViewHolder.java7
-rw-r--r--src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java40
-rw-r--r--src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java1
-rw-r--r--src/com/android/dialer/list/BlockedListSearchFragment.java2
5 files changed, 15 insertions, 42 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java
index 690b3e10a..14279f15d 100644
--- a/src/com/android/dialer/CallDetailActivity.java
+++ b/src/com/android/dialer/CallDetailActivity.java
@@ -40,21 +40,21 @@ import android.widget.Toast;
import com.android.contacts.common.CallUtil;
import com.android.contacts.common.ClipboardUtils;
-import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest;
import com.android.contacts.common.ContactPhotoManager;
+import com.android.contacts.common.ContactPhotoManager.DefaultImageRequest;
import com.android.contacts.common.GeoUtil;
import com.android.contacts.common.interactions.TouchPointManager;
import com.android.contacts.common.preference.ContactsPreferences;
import com.android.contacts.common.testing.NeededForTesting;
import com.android.contacts.common.util.UriUtils;
import com.android.dialer.calllog.CallDetailHistoryAdapter;
-import com.android.dialer.calllog.CallLogAsyncTaskUtil.CallLogAsyncTaskListener;
import com.android.dialer.calllog.CallLogAsyncTaskUtil;
+import com.android.dialer.calllog.CallLogAsyncTaskUtil.CallLogAsyncTaskListener;
import com.android.dialer.calllog.CallTypeHelper;
import com.android.dialer.calllog.ContactInfoHelper;
import com.android.dialer.calllog.PhoneAccountUtils;
-import com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnCheckBlockedListener;
import com.android.dialer.database.FilteredNumberAsyncQueryHandler;
+import com.android.dialer.database.FilteredNumberAsyncQueryHandler.OnCheckBlockedListener;
import com.android.dialer.filterednumber.BlockNumberDialogFragment;
import com.android.dialer.filterednumber.FilteredNumbersUtil;
import com.android.dialer.util.DialerUtils;
@@ -367,7 +367,6 @@ 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 0ed409a5b..9cc8296b8 100644
--- a/src/com/android/dialer/calllog/CallLogListItemViewHolder.java
+++ b/src/com/android/dialer/calllog/CallLogListItemViewHolder.java
@@ -18,8 +18,8 @@ package com.android.dialer.calllog;
import android.app.Activity;
import android.content.Context;
-import android.content.res.Resources;
import android.content.Intent;
+import android.content.res.Resources;
import android.net.Uri;
import android.provider.CallLog;
import android.provider.CallLog.Calls;
@@ -34,8 +34,8 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
-import android.widget.QuickContactBadge;
import android.widget.ImageView;
+import android.widget.QuickContactBadge;
import android.widget.TextView;
import com.android.contacts.common.CallUtil;
@@ -54,8 +54,8 @@ import com.android.dialer.logging.Logger;
import com.android.dialer.logging.ScreenEvent;
import com.android.dialer.util.DialerUtils;
import com.android.dialer.util.PhoneNumberUtil;
-import com.android.dialer.voicemail.VoicemailPlaybackPresenter;
import com.android.dialer.voicemail.VoicemailPlaybackLayout;
+import com.android.dialer.voicemail.VoicemailPlaybackPresenter;
/**
* This is an object containing references to views contained by the call log list item. This
@@ -337,7 +337,6 @@ 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 91d4d121d..21746eecc 100644
--- a/src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java
+++ b/src/com/android/dialer/filterednumber/BlockNumberDialogFragment.java
@@ -41,8 +41,7 @@ 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
- implements VisualVoicemailEnabledChecker.Callback{
+public class BlockNumberDialogFragment extends DialogFragment {
/**
* Use a callback interface to update UI after success/undo. Favor this approach over other
@@ -72,10 +71,8 @@ public class BlockNumberDialogFragment extends DialogFragment
private View mParentView;
private VisualVoicemailEnabledChecker mVoicemailEnabledChecker;
private Callback mCallback;
- private AlertDialog mAlertDialog;
public static void show(
- Context context,
Integer blockId,
String number,
String countryIso,
@@ -84,14 +81,13 @@ public class BlockNumberDialogFragment extends DialogFragment
FragmentManager fragmentManager,
Callback callback) {
final BlockNumberDialogFragment newFragment = BlockNumberDialogFragment.newInstance(
- context, blockId, number, countryIso, displayNumber, parentViewId);
+ 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,
@@ -109,8 +105,6 @@ 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;
}
@@ -128,6 +122,11 @@ public class BlockNumberDialogFragment extends DialogFragment
}
mHandler = new FilteredNumberAsyncQueryHandler(getContext().getContentResolver());
+ mVoicemailEnabledChecker = new VisualVoicemailEnabledChecker(getActivity(), null);
+ /**
+ * Choose not to update VoicemailEnabledChecker, as checks should already been done in
+ * all current use cases.
+ */
mParentView = getActivity().findViewById(getArguments().getInt(ARG_PARENT_VIEW_ID));
CharSequence title;
@@ -162,16 +161,10 @@ public class BlockNumberDialogFragment extends DialogFragment
} else {
blockNumber();
}
- mAlertDialog = null;
}
})
- .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- mAlertDialog = null;
- }
- });
- mAlertDialog = builder.create();
- return mAlertDialog;
+ .setNegativeButton(android.R.string.cancel, null);
+ return builder.create();
}
@Override
@@ -300,19 +293,4 @@ 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 ce96b6711..a23e46d1e 100644
--- a/src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java
+++ b/src/com/android/dialer/filterednumber/BlockedNumbersAdapter.java
@@ -61,7 +61,6 @@ public class BlockedNumbersAdapter extends NumbersAdapter {
@Override
public void onClick(View view) {
BlockNumberDialogFragment.show(
- context,
id,
number,
countryIso,
diff --git a/src/com/android/dialer/list/BlockedListSearchFragment.java b/src/com/android/dialer/list/BlockedListSearchFragment.java
index daa384acf..306847850 100644
--- a/src/com/android/dialer/list/BlockedListSearchFragment.java
+++ b/src/com/android/dialer/list/BlockedListSearchFragment.java
@@ -172,7 +172,6 @@ public class BlockedListSearchFragment extends RegularSearchFragment
public void onCheckComplete(Integer id) {
if (id == null) {
BlockNumberDialogFragment.show(
- getContext(),
id,
number,
countryIso,
@@ -221,7 +220,6 @@ public class BlockedListSearchFragment extends RegularSearchFragment
}
BlockNumberDialogFragment.show(
- getContext(),
blockId,
number,
GeoUtil.getCurrentCountryIso(getContext()),