From 6fa29e29cd31cbbfb8e629fae39c8c6b939fe347 Mon Sep 17 00:00:00 2001 From: Nancy Chen Date: Thu, 14 Jan 2016 16:04:42 -0800 Subject: Hide "copy" and "block" options for unknown numbers in Call Details. If the number string is unknown or can't be called, the call details screen should not show the "copy number" and "block number" options. Bug: 26445855 Change-Id: I219d99709de75e641e3603c52209fe362a20e6ba --- src/com/android/dialer/CallDetailActivity.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index c045967a2..56e29a9d7 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -153,6 +153,8 @@ public class CallDetailActivity extends AppCompatActivity final boolean canPlaceCallsTo = 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); final boolean isSipNumber = PhoneNumberUtil.isSipNumber(mNumber); final boolean isVoicemailNumber = @@ -221,6 +223,7 @@ public class CallDetailActivity extends AppCompatActivity private TextView mBlockNumberActionItem; private View mEditBeforeCallActionItem; private View mReportActionItem; + private View mCopyNumberActionItem; private Integer mBlockedNumberId; @@ -279,8 +282,8 @@ public class CallDetailActivity extends AppCompatActivity mReportActionItem = findViewById(R.id.call_detail_action_report); mReportActionItem.setOnClickListener(this); - View copyActionItem = findViewById(R.id.call_detail_action_copy); - copyActionItem.setOnClickListener(this); + mCopyNumberActionItem = findViewById(R.id.call_detail_action_copy); + mCopyNumberActionItem.setOnClickListener(this); if (getIntent().getBooleanExtra(EXTRA_FROM_NOTIFICATION, false)) { closeSystemDialogs(); -- cgit v1.2.3