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

Commit ae274c05 authored by Jay Shrauner's avatar Jay Shrauner
Browse files

Use framework scheme definitions

Use PhoneAccount defined values for SCHEME_{TEL, SIP, VOICEMAIL}.

Bug:17398074
Change-Id: I77dfa539646b9c5ae5dca220bbc906048a17b383
parent 8be85c82
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -368,7 +368,7 @@ public class CallDetailActivity extends AnalyticsActivity implements ProximitySe
                        getSystemService(Context.TELEPHONY_SERVICE);
                if (tm.getCallState() == TelephonyManager.CALL_STATE_IDLE) {
                    DialerUtils.startActivityWithErrorToast(this,
                            CallUtil.getCallIntent(Uri.fromParts(CallUtil.SCHEME_TEL, mNumber,
                            CallUtil.getCallIntent(Uri.fromParts(PhoneAccount.SCHEME_TEL, mNumber,
                                    null)), R.string.call_not_available);
                    return true;
                }
+2 −1
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Intents;
import android.speech.RecognizerIntent;
import android.support.v4.view.ViewPager;
import android.telecomm.PhoneAccount;
import android.telecomm.TelecommManager;
import android.telephony.TelephonyManager;
import android.text.Editable;
@@ -817,7 +818,7 @@ public class DialtactsActivity extends TransactionSafeActivity implements View.O
        }
        if (Intent.ACTION_VIEW.equals(action)) {
            final Uri data = intent.getData();
            if (data != null && CallUtil.SCHEME_TEL.equals(data.getScheme())) {
            if (data != null && PhoneAccount.SCHEME_TEL.equals(data.getScheme())) {
                return true;
            }
        }
+5 −3
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.provider.Contacts.People;
import android.provider.Contacts.Phones;
import android.provider.Contacts.PhonesColumns;
import android.provider.Settings;
import android.telecomm.PhoneAccount;
import android.telecomm.TelecommManager;
import android.telephony.PhoneNumberUtils;
import android.telephony.PhoneStateListener;
@@ -67,6 +68,7 @@ import android.widget.RelativeLayout;
import android.widget.TextView;

import com.android.contacts.common.CallUtil;
import com.android.contacts.common.ContactsUtils;
import com.android.contacts.common.GeoUtil;
import com.android.contacts.common.util.PhoneNumberFormatter;
import com.android.contacts.common.util.StopWatch;
@@ -258,7 +260,7 @@ public class DialpadFragment extends AnalyticsFragment
     * Return an Intent for launching voicemail screen.
     */
    private static Intent getVoicemailIntent() {
        return CallUtil.getCallIntent(Uri.fromParts("voicemail", "", null));
        return CallUtil.getCallIntent(Uri.fromParts(PhoneAccount.SCHEME_VOICEMAIL, "", null));
    }

    private TelephonyManager getTelephonyManager() {
@@ -415,7 +417,7 @@ public class DialpadFragment extends AnalyticsFragment
        if (Intent.ACTION_DIAL.equals(action) || Intent.ACTION_VIEW.equals(action)) {
            Uri uri = intent.getData();
            if (uri != null) {
                if (CallUtil.SCHEME_TEL.equals(uri.getScheme())) {
                if (PhoneAccount.SCHEME_TEL.equals(uri.getScheme())) {
                    // Put the requested number into the input area
                    String data = uri.getSchemeSpecificPart();
                    // Remember it is filled via Intent.
@@ -1431,7 +1433,7 @@ public class DialpadFragment extends AnalyticsFragment
            case R.id.menu_send_message: {
                final CharSequence digits = mDigits.getText();
                final Intent smsIntent = new Intent(Intent.ACTION_SENDTO,
                        Uri.fromParts(CallUtil.SCHEME_SMSTO, digits.toString(), null));
                        Uri.fromParts(ContactsUtils.SCHEME_SMSTO, digits.toString(), null));
                smsIntent.setComponent(mSmsPackageComponentName);
                DialerUtils.startActivityWithErrorToast(getActivity(), smsIntent);
                return true;
+2 −2
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.android.contacts.common.CallUtil;
import com.android.contacts.common.ContactsUtils;
import com.android.contacts.common.interactions.TouchPointManager;
import com.android.dialer.R;
import com.android.incallui.CallCardFragment;
@@ -98,7 +98,7 @@ public class DialerUtils {
        if (smsPackage != null) {
            final PackageManager packageManager = context.getPackageManager();
            final Intent intent = new Intent(Intent.ACTION_SENDTO,
                    Uri.fromParts(CallUtil.SCHEME_SMSTO, "", null));
                    Uri.fromParts(ContactsUtils.SCHEME_SMSTO, "", null));
            final List<ResolveInfo> resolveInfos = packageManager.queryIntentActivities(intent, 0);
            for (ResolveInfo resolveInfo : resolveInfos) {
                if (smsPackage.equals(resolveInfo.activityInfo.packageName)) {