Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 34a52951 authored by Umashankar Godachi's avatar Umashankar Godachi Committed by Anil Kumar T.V
Browse files

Fix dialer force close.

If there is no activity to handle the intent
ACTION_RECOGNIZE_SPEECH, it leads to dialer force close
on tapping voice search button.
Add try catch statement to avoid the dialer force close.

Change-Id: Ie59f06608af913cee3f50a03ebceca9616e6bc8f
CRs-Fixed: 592572
parent c75cfd7e
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -454,8 +454,12 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
                }
                break;
            case R.id.voice_search_button:
                try {
                    final Intent voiceIntent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
                    startActivityForResult(voiceIntent, ACTIVITY_REQUEST_CODE_VOICE_SEARCH);
                } catch (ActivityNotFoundException e) {
                    Log.w(TAG, e.toString());
                }
                break;
            default: {
                Log.wtf(TAG, "Unexpected onClick event from " + view);