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