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

Commit 7accd8c5 authored by Gary Mai's avatar Gary Mai
Browse files

Use startActivityForResult when intenting Tachyon

Test: Manually verified video call can be started when pressing
the video icon

Bug: 36874501
Change-Id: I9d070b41b2eca05b5255b230dccde78be87d5ea0
parent edfce606
Loading
Loading
Loading
Loading
+10 −2
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();
@@ -1814,7 +1822,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()