diff options
Diffstat (limited to 'src/com/android/dialer/CallDetailActivity.java')
-rw-r--r-- | src/com/android/dialer/CallDetailActivity.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 6c8d7708a..42bee1edf 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -59,7 +59,6 @@ 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.filterednumber.MigrateBlockedNumbersDialogFragment; import com.android.dialer.logging.InteractionEvent; import com.android.dialer.logging.Logger; import com.android.dialer.util.DialerUtils; @@ -156,7 +155,8 @@ public class CallDetailActivity extends AppCompatActivity PhoneNumberUtil.canPlaceCallsTo(mNumber, mDetails.numberPresentation); mCallButton.setVisibility(canPlaceCallsTo ? View.VISIBLE : View.GONE); mCopyNumberActionItem.setVisibility(canPlaceCallsTo ? View.VISIBLE : View.GONE); - mBlockNumberActionItem.setVisibility(canPlaceCallsTo ? View.VISIBLE : View.GONE); + + updateBlockActionItemVisibility(canPlaceCallsTo ? View.VISIBLE : View.GONE); final boolean isSipNumber = PhoneNumberUtil.isSipNumber(mNumber); final boolean isVoicemailNumber = @@ -277,7 +277,9 @@ public class CallDetailActivity extends AppCompatActivity } }); + mBlockNumberActionItem = (TextView) findViewById(R.id.call_detail_action_block); + updateBlockActionItemVisibility(View.VISIBLE); mBlockNumberActionItem.setOnClickListener(this); mEditBeforeCallActionItem = findViewById(R.id.call_detail_action_edit_before_call); mEditBeforeCallActionItem.setOnClickListener(this); @@ -292,6 +294,13 @@ public class CallDetailActivity extends AppCompatActivity } } + private void updateBlockActionItemVisibility(int visibility) { + if (!FilteredNumberCompat.canAttemptBlockOperations(mContext)) { + visibility = View.GONE; + } + mBlockNumberActionItem.setVisibility(visibility); + } + @Override public void onResume() { super.onResume(); @@ -468,8 +477,6 @@ public class CallDetailActivity extends AppCompatActivity mBlockNumberActionItem.setCompoundDrawablesRelativeWithIntrinsicBounds( R.drawable.ic_call_detail_unblock, 0, 0, 0); } - - mBlockNumberActionItem.setVisibility(View.VISIBLE); } private void closeSystemDialogs() { |