v0.3.0: bubble for Android 0.3.0 — texts over the Rabbit's own SIM card

A third source next to voip.ms and Google Voice, while bubble is Android's
default SMS app (Settings → SIM card asks for the role). SMS and MMS in and
out, group chats as MMS, the phone's existing texts imported, and Android's
message store kept as the record so another app still agrees.

- Sim: role check, sending (SmsManager, waits for the radio), receiving,
  chunked import from content://sms and content://mms
- Pdu: MMS wire format (notification-ind, retrieve-conf, send-req, ack)
- SmsReceiver, MmsReceiver, MmsDownloaded, MmsFiles, RespondService,
  SendToActivity: what Android requires of a default SMS app
- The import no longer shares a lock with Config.get, which froze the screens
  on the first copy of a long history
This commit is contained in:
2026-11-06 17:18:58 -08:00
parent cde8cc6c55
commit 5e5ef18e01
25 changed files with 1630 additions and 17 deletions
@@ -15,6 +15,7 @@ import android.widget.TextView;
/** Background checks, notifications, and what's connected. */
public final class SettingsActivity extends BaseActivity {
private static final int[] INTERVALS = {0, 5, 10, 15, 30, 60, 120};
private static final int ROLE = 1;
private LinearLayout box;
@Override
@@ -28,6 +29,16 @@ public final class SettingsActivity extends BaseActivity {
setContentView(scroll);
}
@Override
protected void onActivityResult(int req, int res, android.content.Intent data) {
super.onActivityResult(req, res, data);
if (req != ROLE) return;
Sim.recheck();
// Bring over the texts already on the phone.
Sim.syncSoon(this);
changed();
}
private static String intervalLabel(int m) {
if (m == 0) return "Never (pull to refresh)";
if (m < 60) return "Every " + m + " minutes";
@@ -78,6 +89,27 @@ public final class SettingsActivity extends BaseActivity {
: Sync.gvSignedOut ? "⚠ Signed out" : Sync.gvError != null ? "⚠ " + Sync.gvError : Phone.format(cfg.gvNumber));
note("Accounts come from the desktop app: Settings → Rabbit → Sync to Rabbit copies them here again (e.g. after reconnecting Google Voice there).");
section("SIM card");
Sim.recheck();
if (Sim.isDefault(c)) {
String carrier = Sim.carrier(c);
kv("Texting from the SIM", carrier.isEmpty() ? "On" : carrier);
note(cfg.sandbox ? "Not in the dev app's made-up data: the sandbox never texts for real."
: "bubble is the Rabbit's texting app: texts and MMS to the SIM come here, and chats can be sent \"via SIM\"."
+ " To stop, choose another app under Android Settings → Apps → Default apps → SMS app.");
} else {
row("Text from the SIM card", "Make bubble the texting app", v -> {
try {
startActivityForResult(Sim.roleRequest(c), ROLE);
} catch (Exception e) {
note("This Android won't let bubble become its texting app.");
}
});
note("Sends and receives texts and MMS over the Rabbit's own SIM, as a third number next to voip.ms and Google Voice."
+ " Android lets only its default texting app do that, so it takes over from the one you use now;"
+ " the texts already on the phone come over too.");
}
section("About");
String version = "?";
try {