Commit graph

10851 commits

Author SHA1 Message Date
Eric House
bdb31224e9 new method stub to fix fdroid build crash 2019-06-23 10:16:59 -07:00
Eric House
e70dc45fb1 script to build all possible variants 2019-06-23 10:16:59 -07:00
Eric House
ff7f4655f7 removing permissions from the Play Store version 2019-06-23 10:16:59 -07:00
Eric House
5bdc473e02 use NBSProxy if available
Lots of work dealing with banned permissions (SEND_SMS and
RECEIVE_SMS). First, if they're banned and NBSProxy is installed, just
use it as if the permissions had been granted. When it's not there,
explain at various points where users will otherwise be confused: when
they try to invite using data sms, or when they open a game that already
uses it.)
2019-06-23 10:16:59 -07:00
Eric House
c59e86b724 support setActionPair() for okOnly alerts too 2019-06-23 10:14:16 -07:00
Eric House
4493f9d9cd cut some logging 2019-06-23 10:14:16 -07:00
Eric House
039e50ecff remove misplaced assert
It's an error to use an env with the wrong thread, but it IS possible
for more than one thread to be associated with the same env. So don't
assert to the contrary.
2019-06-23 10:14:16 -07:00
Eric House
d5ae8356b4 fixing refcounting and adding logging
Seeing the occasional crash and trying to plug leaks that might be
contributing. I think I fixed the Gameptr.finalize() assertions I've
been seeing forever but the thread match assertion remains. Logs will
help catch that.
2019-06-23 10:14:16 -07:00
Eric House
7f8b3c1820 remove logging and reformat: no change 2019-06-23 10:14:16 -07:00
Eric House
8ace884d56 return supported types as list, not set
I was seeing them displayed in different orders where I want to control
the order instead.
2019-06-23 10:14:16 -07:00
Eric House
451d2a271e use constant APPLICATION_ID instead of method call 2019-06-23 10:14:16 -07:00
Eric House
89c103ab4c remove some logging 2019-06-23 10:14:16 -07:00
Eric House
aa8296f829 make setActionPair work for confirmThen alerts too
(To be used shortly)
2019-06-23 10:14:16 -07:00
Eric House
4297b3c2c3 recast SMSService as a JobIntentService
Didn't think it was required, but once the app started getting messages
in the background it stoped working or crashed. Changes are minimal
because this service isn't responsible for receiving messages: it
doesn't have the long-lived threads of the BT and Relay services.
2019-06-23 10:14:16 -07:00
Eric House
1e397d07f4 add debug-only checking for thread safety
Lots of threads call the smsproto code now so the existing check was
failing. Replace it with one that ensures that only one thread at a time
is running the code. Debug-builds only.
2019-06-23 10:14:16 -07:00
Eric House
2b87d60cba Let's test this jitpack stuff on Travis
Importing a library but not using it yet
2019-06-23 10:14:16 -07:00
Eric House
bec37536f6 more data with my SMS
And catch an exception starting SMSService in background
2019-06-23 10:14:16 -07:00
Eric House
713d2e5634 make result -1 if will otherwise trip asserts. 2019-06-23 10:13:32 -07:00
Eric House
c05d8c43d2 logging toward finding who's sending or reporting 0 2019-06-23 10:13:32 -07:00
Eric House
89a5ccf4bc pull nbs port-checking over from NBSProxy 2019-06-23 10:13:32 -07:00
Eric House
7bee8120a8 logging toward tracking a rare assertion failure 2019-06-23 10:13:32 -07:00
Eric House
8fb1a8405a add extra explanatory text to phone number invite dialog
Set different expectations based on whether the invitation's by NBS or a
launch of the messaging app.
2019-06-23 10:13:32 -07:00
Eric House
13b789847c distinguish between NBS and SMS
What I've been calling SMS is now "data sms" (or "nbs", in
code). There's a new way of inviting, called "User Sms" or somesuch,
that launches the user's SMS app with a URL and phone number, much like
email (save that no addressing is required by the inviter.) This new way
won't be involved in the ban on SMS permissions. (But play by NBS is
still awesome and will stay where it can.)
2019-06-23 10:13:32 -07:00
Eric House
15a1dad5ea that's already done 2019-06-23 10:13:31 -07:00
Eric House
a187fdca64 put back the nbs port 2019-06-23 10:13:31 -07:00
Eric House
a3d6dc809b some cleanup, e.g. to assert my signals are valid 2019-06-23 10:13:31 -07:00
Eric House
d5e68141bd comment out dead code I keep reading 2019-06-23 10:13:31 -07:00
Eric House
0ad1697607 fix valgrind-noted empty array cruft. 2019-06-23 10:13:31 -07:00
Eric House
8be4bd5f51 fix defines and compile that then broke 2019-06-23 10:13:31 -07:00
Eric House
27e33dda62 new version code to replace bad upload 2019-06-23 10:13:31 -07:00
Eric House
a400a62753 fix broken noSMS variant
needed SMS permissions in a new xw4 manifest
2019-06-23 10:13:31 -07:00
Eric House
f5d92735be remove SMS_BANNED stuff for now 2019-06-23 10:13:31 -07:00
Eric House
3a41be0051 up changelog 2019-06-23 10:13:31 -07:00
Eric House
9baffc93e3 exit thread when BT turned off
(The test was in the thread this replaced.)
2019-06-23 10:13:31 -07:00
Eric House
23739f57b9 put back SMS permissions
March 9's the deadline, so let's not remove it yet!
2019-06-23 10:13:31 -07:00
Eric House
5897e4c59e make packet accumulator a thread that sends
Get rid of the single sender thread and the complexity of querying
individual queues for their state (and the slowdown that happened when
successful writes had to wait for those to devices that weren't
responding). Instead each PacketAccumulator does its own waiting with
timeouts and backoffs, wakes itself when appropriate, and periodically
sends if it can make a connection. Now when there are a bunch of
messages ready they'll get sent pretty quickly once connections to the
remote device start to be successful.
2019-06-23 10:13:31 -07:00
Eric House
183b221a2e each message gets a localID so logs can show progress
And rewrite toString()
2019-06-23 10:13:31 -07:00
Eric House
156c05d54c add another DeadlockWatch (and import already) 2019-06-23 10:13:31 -07:00
Eric House
614b4d3610 put Killer back: device can receive but never process
A device where the OS isn't servicing enqueueWork() requests won't write
back to sockets it accept()s, causing the sender's writer to block
forever. So give it 30 seconds then kill the socket.
2019-06-23 10:13:31 -07:00
Eric House
9bd95d2ccf fix NPE (by inspection, from crashlytics report) 2019-06-23 10:13:31 -07:00
Eric House
e73f1b5b88 don't enqueue dupes of messages already in queue
No point in giving a spot to something the receiver will drop as a
duplicate.
2019-06-23 10:13:31 -07:00
Eric House
0133459114 update status more often (as old code did) 2019-06-23 10:13:31 -07:00
Eric House
9eef188ebe fix concurrent access exception and too-slow sends
if we successfully send, we should reset the backoff so we try again
quickly. Especially at a time when only one message is sent per connection.
2019-06-23 10:13:31 -07:00
Eric House
a8241cc085 change key to force new value
fixes what was probably a crash only for me, but....
2019-06-23 10:13:31 -07:00
Eric House
0d757c605f report invitation success even if dict download needed 2019-06-23 10:13:31 -07:00
Eric House
d907b4201c use https scheme for dict downloads 2019-06-23 10:13:31 -07:00
Eric House
9915c464af Move back to old one-msg-per-connect() model
Add support for the old protocol, and define to use it. After the next
release has been adopted and everybody can read the new protocol another
release will turn it on.
2019-06-23 10:13:31 -07:00
Eric House
31d8345e6b add not-again checkbox to BAD_BT_PROTO dialog
Won't help the old-build side of the exchange of course.
2019-06-23 10:13:31 -07:00
Eric House
341293dc55 prune only those messages successfully sent
Fix race condition that would have cleared all messages including those
added after a send began. In the process, move to storing outbound
messages individually rather than concatenated in their stream format.
2019-06-23 10:13:31 -07:00
Eric House
ff2a06592f add alert to launch app when OS not scheduling service
Set a boolean every time app's upgraded, and clear it on first launch of
MainActivity. In between, if we try to launch the BTService but the OS
doesn't schedule it, post a notification asking user to launch the app.
2019-06-23 10:13:31 -07:00