docs: private void showContactAsBarcode(Uri contactUri) {
      if (contactUri == null) {
        return; // Show error?
      }
      ContentResolver resolver = getContentResolver();
  
      String id;
      String name;
      boolean hasPhone;
      try (Cursor cursor = resolver.query(contactUri, null, null, null, null)) {
        if (cursor == null || !cursor.moveToFirst()) {
          return;
        }
        id = cursor.getString(cursor.getColumnIndex(BaseColumns._ID));
        name = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));
        hasPhone = cursor.getInt(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER)) > 0;
      }
  
      // Don't require a name to be present, this contact might be just a phone number.
      Bundle bundle = new Bundle();
      if (name != null && !name.isEmpty()) {
        bundle.putString(ContactsContract.Intents.Insert.NAME, massageContactData(name));
      }
  
      if (hasPhone) {
        try (Cursor phonesCursor = resolver.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
                                                  null,
                                                  ContactsContract.CommonDataKinds.Phone.CONTACT_ID + '=' + id,
                                                  null,
                                                  null)) {
          if (phonesCursor != null) {
            int foundPhone = 0;
            int phonesNumberColumn = phonesCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
            int phoneTypeColumn = phonesCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.TYPE);
            while (phonesCursor.moveToNext() && foundPhone < Contents.PHONE_KEYS.length) {
              String number = phonesCursor.getString(phonesNumberColumn);
              if (number != null && !number.isEmpty()) {
                bundle.putString(Contents.PHONE_KEYS[foundPhone], massageContactData(number));
              }
              int type = phonesCursor.getInt(phoneTypeColumn);
              bundle.putInt(Contents.PHONE_TYPE_KEYS[foundPhone], type);
              foundPhone++;
            }
          }
        }
      }
  
      try (Cursor methodsCursor = resolver.query(ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_URI,
                                                 null,
                                                 ContactsContract.CommonDataKinds.StructuredPostal.CONTACT_ID + '=' + id,
                                                 null,
                                                 null)) {
        if (methodsCursor != null && methodsCursor.moveToNext()) {
          String data = methodsCursor.getString(
              methodsCursor.getColumnIndex(ContactsContract.CommonDataKinds.StructuredPostal.FORMATTED_ADDRESS));
          if (data != null && !data.isEmpty()) {
            bundle.putString(ContactsContract.Intents.Insert.POSTAL, massageContactData(data));
          }
        }
      }
  
      try (Cursor emailCursor = resolver.query(ContactsContract.CommonDataKinds.Email.CONTENT_URI,
                                               null,
                                               ContactsContract.CommonDataKinds.Email.CONTACT_ID + '=' + id,
                                               null,
                                               null)) {
        if (emailCursor != null) {
          int foundEmail = 0;
          int emailColumn = emailCursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA);
          while (emailCursor.moveToNext() && foundEmail < Contents.EMAIL_KEYS.length) {
            String email = emailCursor.getString(emailColumn);
            if (email != null && !email.isEmpty()) {
              bundle.putString(Contents.EMAIL_KEYS[foundEmail], massageContactData(email));
            }
            foundEmail++;
          }
        }
      }
  
      Intent intent = new Intent(Intents.Encode.ACTION);
      intent.addFlags(Intents.FLAG_NEW_DOC);
      intent.putExtra(Intents.Encode.TYPE, Contents.Type.CONTACT);
      intent.putExtra(Intents.Encode.DATA, bundle);
      intent.putExtra(Intents.Encode.FORMAT, BarcodeFormat.QR_CODE.toString());
  
      startActivity(intent);
    }