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:
@@ -234,7 +234,7 @@ public final class ChatActivity extends BaseActivity {
|
||||
private void updateCounter() {
|
||||
int len = Phone.charCount(input.getText().toString().trim());
|
||||
boolean gv = Config.get(this).isGv(did);
|
||||
boolean show = !gv && len > 0;
|
||||
boolean show = !gv && !Sim.isSim(did) && len > 0;
|
||||
counter.setVisibility(show ? View.VISIBLE : View.GONE);
|
||||
if (show) counter.setText(len > Phone.SMS_TEXT_LIMIT || !photos.isEmpty() ? "MMS · " + len + "/2048" : len + "/160");
|
||||
}
|
||||
@@ -325,12 +325,12 @@ public final class ChatActivity extends BaseActivity {
|
||||
// A conversation with nothing in it yet can still pick its number.
|
||||
Config cfg = Config.get(this);
|
||||
List<Config.Did> choices = new ArrayList<>();
|
||||
for (Config.Did d : cfg.dids) if (!group || d.gv) choices.add(d);
|
||||
for (Config.Did d : cfg.dids) if (!group || d.gv || d.sim) choices.add(d);
|
||||
if (msgs.isEmpty() && choices.size() > 1 && fromRow.getVisibility() != View.VISIBLE) {
|
||||
List<String> labels = new ArrayList<>();
|
||||
int sel = 0;
|
||||
for (int i = 0; i < choices.size(); i++) {
|
||||
labels.add(Phone.format(choices.get(i).did) + (choices.get(i).gv ? " — Google Voice" : ""));
|
||||
labels.add(Ui.didLabel(this, choices.get(i)));
|
||||
if (choices.get(i).did.equals(did)) sel = i;
|
||||
}
|
||||
ArrayAdapter<String> a = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, labels);
|
||||
@@ -353,7 +353,7 @@ public final class ChatActivity extends BaseActivity {
|
||||
private void submit() {
|
||||
String text = input.getText().toString().trim();
|
||||
if (text.isEmpty() && photos.isEmpty()) return;
|
||||
if (!Config.get(this).isGv(did) && Phone.charCount(text) > 2048) {
|
||||
if (!Config.get(this).isGv(did) && !Sim.isSim(did) && Phone.charCount(text) > 2048) {
|
||||
Toast.makeText(this, "Too long for an MMS (2048 characters max).", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user