Don't dial any number if DIAL intent is not supported. am: 6098913d4b
am: 9d478bef16
Change-Id: I6726f4551a1ca865c225d2c6d2bfb0b1e6a4f00a
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -15,9 +15,11 @@
|
||||
*/
|
||||
package com.android.settings.support;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.app.DialogFragment;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -68,9 +70,16 @@ public final class SupportPhoneDialogFragment extends DialogFragment implements
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
final SupportPhone phone = getArguments().getParcelable(EXTRA_PHONE);
|
||||
MetricsLogger.action(getActivity(),
|
||||
MetricsProto.MetricsEvent.ACTION_SUPPORT_DIAL_TOLLED);
|
||||
getActivity().startActivity(phone.getDialIntent());
|
||||
final Activity activity = getActivity();
|
||||
final Intent intent = phone.getDialIntent();
|
||||
final boolean canDial = !activity.getPackageManager()
|
||||
.queryIntentActivities(intent, 0)
|
||||
.isEmpty();
|
||||
if (canDial) {
|
||||
MetricsLogger.action(getActivity(),
|
||||
MetricsProto.MetricsEvent.ACTION_SUPPORT_DIAL_TOLLED);
|
||||
getActivity().startActivity(intent);
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user