https://bugs.kde.org/show_bug.cgi?id=514984

            Bug ID: 514984
           Summary: Group MMS sending fails when KDE Connect is not the
                    default SMS app - configOverrides not passed to
                    sendMultimediaMessage()
    Classification: Applications
           Product: kdeconnect
      Version First unspecified
       Reported In:
          Platform: Pop!_OS
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: android-application
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

### Problem

When sending MMS messages to group conversations (multiple recipients) from the
desktop, the message appears to send successfully but never arrives on the
phone or in the group conversation. This only occurs when KDE Connect is
**not** set as the default SMS app on Android.

### Root Cause

In `SmsMmsUtils.kt`, the `sendMmsMessageNative()` function creates a
`configOverrides` Bundle with `MMS_CONFIG_GROUP_MMS_ENABLED` but then passes
`null` instead of `configOverrides` to `SmsManager.sendMultimediaMessage()`.

**Current code:**
```kotlin
val configOverrides = Bundle()
configOverrides.putBoolean(SmsManager.MMS_CONFIG_GROUP_MMS_ENABLED,
klinkerSettings.group)

// ... later ...

mSmsManager.sendMultimediaMessage(context, contentUri, null, null, null)
//                                                          ^^^^ should be
configOverrides
```

**The fix:**
```kotlin
mSmsManager.sendMultimediaMessage(context, contentUri, null, configOverrides,
null)
```

### Why This Causes Device-Specific Behavior

KDE Connect Android has two code paths for sending MMS:

1. **Klinker library path** (when KDE Connect IS the default SMS app):
Correctly passes `configOverrides` to `sendMultimediaMessage()` - group MMS
works.

2. **Native path via `sendMmsMessageNative()`** (when KDE Connect is NOT the
default SMS app): Creates `configOverrides` but passes `null` instead - group
MMS fails on some devices.

Some Android ROMs/devices handle missing `MMS_CONFIG_GROUP_MMS_ENABLED`
gracefully, while others require it to be explicitly set. This explains why the
bug is device-specific (works on OnePlus, fails on Pixel/Samsung/LineageOS).

### Related Code References

- **File:** `src/org/kde/kdeconnect/Plugins/SMSPlugin/SmsMmsUtils.kt`
- **Function:** `sendMmsMessageNative()`
- **Comparison:** The klinker library's `Transaction.java` correctly passes
`configOverrides`:
  ```java
  SmsManagerFactory.createSmsManager(settings).sendMultimediaMessage(
      context, contentUri, null, configOverrides, pendingIntent);
  ```

## Steps to Reproduce

1. Ensure KDE Connect is **not** set as the default SMS app on Android
2. Have a group MMS conversation (3+ participants) on the phone
3. From the desktop (via KDE Connect SMS app, kdeconnect-cli, or any D-Bus
client), send a message to that group conversation
4. Observe: D-Bus call returns success, but message never appears in the group
conversation on the phone

## Expected Behavior

Message should be sent to all group recipients and appear in the group
conversation.

## Actual Behavior

Message appears to send (no error returned) but silently fails - never arrives
in the group conversation.

## Affected Versions

- KDE Connect Android: Current master (also affects released versions)
- Affected devices: Pixel 4a5G, Pixel 2 XL, Samsung XCover6, various LineageOS
devices
- Working devices: OnePlus Fold (likely because it handles missing config
gracefully)

## Proposed Fix

Change line in `sendMmsMessageNative()` from:
```kotlin
mSmsManager.sendMultimediaMessage(context, contentUri, null, null, null)
```

To:
```kotlin
mSmsManager.sendMultimediaMessage(context, contentUri, null, configOverrides,
null)
```

This is a one-line fix with low risk - the `configOverrides` Bundle is already
being created correctly, it just needs to be passed to the API.

## Related Bugs

- Bug 501835: Group SMS not registering on Android from PC (likely same root
cause)
- Bug 464555: Fixed receiving group messages, but sending still affected
- Bug 415531: Group conversation detection issues (related but different)

## Additional Context

This bug was discovered while developing a third-party KDE Connect client. The
analysis involved tracing the code path from D-Bus through to the Android SMS
APIs and comparing the klinker library implementation (which works) with the
native implementation (which has this bug).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to