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

Commit ae71b6c0 authored by Gary Mai's avatar Gary Mai
Browse files

Special case Tachyon mimetype am: acda280a

Change-Id: I2046d1a37c8a9d99f7c4972a2cead15778f58c56
parents f9d76aab acda280a
Loading
Loading
Loading
Loading
+20 −10
Original line number Diff line number Diff line
@@ -250,6 +250,8 @@ public class QuickContactActivity extends ContactsActivity {

    public static final String MIMETYPE_TACHYON =
            "vnd.android.cursor.item/com.google.android.apps.tachyon.phone";
    private static final String TACHYON_CALL_ACTION =
            "com.google.android.apps.tachyon.action.CALL";
    private static final String MIMETYPE_GPLUS_PROFILE =
            "vnd.android.cursor.item/vnd.googleplus.profile";
    private static final String GPLUS_PROFILE_DATA_5_VIEW_PROFILE = "view";
@@ -443,7 +445,13 @@ public class QuickContactActivity extends ContactsActivity {
                final String thirdPartyAction = intent.getStringExtra(EXTRA_THIRD_PARTY_ACTION);
                Logger.logQuickContactEvent(mReferrer, mContactType,
                        CardType.UNKNOWN_CARD, actionType, thirdPartyAction);
                ImplicitIntentsUtil.startActivityInAppIfPossible(QuickContactActivity.this, intent);
                // For the tachyon call action, we need to use startActivityForResult.
                if (TACHYON_CALL_ACTION.equals(intent.getAction())) {
                    QuickContactActivity.this.startActivityForResult(intent, /* requestCode */ 0);
                } else {
                    ImplicitIntentsUtil.startActivityInAppIfPossible(QuickContactActivity.this,
                            intent);
                }
            } catch (SecurityException ex) {
                Toast.makeText(QuickContactActivity.this, R.string.missing_app,
                        Toast.LENGTH_SHORT).show();
@@ -1457,6 +1465,7 @@ public class QuickContactActivity extends ContactsActivity {
                final String mimeType = dataItem.getMimeType();
                if (mimeType == null) continue;

                if (!MIMETYPE_TACHYON.equals(mimeType)) {
                    final AccountType accountType = rawContact.getAccountType(this);
                    final DataKind dataKind = AccountTypeManager.getInstance(this)
                            .getKindOrFallback(accountType, mimeType);
@@ -1468,6 +1477,7 @@ public class QuickContactActivity extends ContactsActivity {
                            dataKind));

                    if (isMimeExcluded(mimeType) || !hasData) continue;
                }

                List<DataItem> dataItemListByType = dataItemsMap.get(mimeType);
                if (dataItemListByType == null) {
@@ -1814,7 +1824,7 @@ public class QuickContactActivity extends ContactsActivity {
                        && ((PhoneDataItem) dataItem).isTachyonReachable()) {
                    thirdIcon = res.getDrawable(R.drawable.quantum_ic_videocam_vd_theme_24);
                    thirdAction = Entry.ACTION_INTENT;
                    thirdIntent = new Intent("com.google.android.apps.tachyon.action.CALL");
                    thirdIntent = new Intent(TACHYON_CALL_ACTION);
                    thirdIntent.setData(
                            Uri.fromParts(PhoneAccount.SCHEME_TEL, phone.getNumber(), null));
                    thirdContentDescription = ((PhoneDataItem) dataItem).getReachableDataItem()