Don't dial any number if DIAL intent is not supported.

Bug: 30868123
Change-Id: Ieb971fdd86011ef0699fdbcfec1ecce2112d0209
This commit is contained in:
Fan Zhang
2016-08-15 13:22:42 -07:00
parent 404104a6a8
commit 6098913d4b
2 changed files with 21 additions and 6 deletions

View File

@@ -450,9 +450,15 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
final SupportPhone phone = mSupportFeatureProvider
.getSupportPhones(mSelectedCountry, true /* isTollFree */);
if (phone != null) {
MetricsLogger.action(mActivity,
MetricsProto.MetricsEvent.ACTION_SUPPORT_DAIL_TOLLFREE);
mActivity.startActivity(phone.getDialIntent());
final Intent intent = phone.getDialIntent();
final boolean canDial = !mActivity.getPackageManager()
.queryIntentActivities(intent, 0)
.isEmpty();
if (canDial) {
MetricsLogger.action(mActivity,
MetricsProto.MetricsEvent.ACTION_SUPPORT_DAIL_TOLLFREE);
mActivity.startActivity(intent);
}
}
break;
}