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

Commit a91eaf77 authored by naman14's avatar naman14 Committed by Gerrit Code Review
Browse files

fix crash in QuickContact on sending contact via sms

Open QuickContact for any contact->Send Contact via sms- ActivityNotFound Exception
This is still using the previous vnd.android-dir/mms-sms which
wouldn't work on kitkat above

Change-Id: I63dcf38c20f11d0ce023cf29138d49036500fcde
parent a8f6bffd
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -75,6 +75,7 @@ import android.provider.ContactsContract.DataUsageFeedback;
import android.provider.ContactsContract.Intents;
import android.provider.ContactsContract.Intents;
import android.provider.ContactsContract.QuickContact;
import android.provider.ContactsContract.QuickContact;
import android.provider.ContactsContract.RawContacts;
import android.provider.ContactsContract.RawContacts;
import android.provider.Telephony;
import android.support.v7.graphics.Palette;
import android.support.v7.graphics.Palette;
import android.telecom.PhoneAccount;
import android.telecom.PhoneAccount;
import android.telecom.TelecomManager;
import android.telecom.TelecomManager;
@@ -2421,9 +2422,13 @@ public class QuickContactActivity extends ContactsActivity {
                + ":" + organization + "\r\n";
                + ":" + organization + "\r\n";
        sipAddress = (sipAddress == null) ? "" : getString(R.string.label_sip_address) + ":"
        sipAddress = (sipAddress == null) ? "" : getString(R.string.label_sip_address) + ":"
                + sipAddress + "\r\n";
                + sipAddress + "\r\n";
        Intent intent = new Intent(Intent.ACTION_VIEW);
        String defaultSmsPackageName = Telephony.Sms.getDefaultSmsPackage(this);
        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.putExtra("sms_body", name + phone + email + postal + organization + sipAddress);
        intent.putExtra("sms_body", name + phone + email + postal + organization + sipAddress);
        intent.setType("vnd.android-dir/mms-sms");
        intent.setType("text/plain");
        if (defaultSmsPackageName != null) {
            intent.setPackage(defaultSmsPackageName);
        }
        startActivity(intent);
        startActivity(intent);
    }
    }