Prefer local state in dial click listener.

This commit is contained in:
Greyson Parrelli 2018-09-27 11:45:56 -07:00
parent bd38b96095
commit 616912d85f

View File

@ -598,8 +598,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item); super.onOptionsItemSelected(item);
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.menu_call_secure: case R.id.menu_call_secure: handleDial(getRecipient(), true); return true;
case R.id.menu_call_insecure: handleDial(getRecipient()); return true; case R.id.menu_call_insecure: handleDial(getRecipient(), false); return true;
case R.id.menu_view_media: handleViewMedia(); return true; case R.id.menu_view_media: handleViewMedia(); return true;
case R.id.menu_add_shortcut: handleAddShortcut(); return true; case R.id.menu_add_shortcut: handleAddShortcut(); return true;
case R.id.menu_add_to_contacts: handleAddToContacts(); return true; case R.id.menu_add_to_contacts: handleAddToContacts(); return true;
@ -940,10 +940,10 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
} }
} }
private void handleDial(final Recipient recipient) { private void handleDial(final Recipient recipient, boolean isSecure) {
if (recipient == null) return; if (recipient == null) return;
if (isSecureText) { if (isSecure) {
CommunicationActions.startVoiceCall(this, recipient); CommunicationActions.startVoiceCall(this, recipient);
} else { } else {
try { try {