Commit graph

10858 commits

Author SHA1 Message Date
Eric House
bad3274c9c fix broken noSMS variant
needed SMS permissions in a new xw4 manifest
2019-02-21 21:30:59 -08:00
Eric House
283bf2e285 remove SMS_BANNED stuff for now 2019-02-21 11:28:13 -08:00
Eric House
7df3d6ad9f up changelog 2019-02-21 10:51:11 -08:00
Eric House
f72a88f46e exit thread when BT turned off
(The test was in the thread this replaced.)
2019-02-21 10:45:50 -08:00
Eric House
cf8fe20e48 put back SMS permissions
March 9's the deadline, so let's not remove it yet!
2019-02-21 10:24:02 -08:00
Eric House
7d48fdd00a 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-02-20 21:54:51 -08:00
Eric House
89338f43dc each message gets a localID so logs can show progress
And rewrite toString()
2019-02-20 12:50:29 -08:00
Eric House
3e1503e6a6 add another DeadlockWatch (and import already) 2019-02-20 12:20:39 -08:00
Eric House
c822f4b1a6 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-02-20 11:22:51 -08:00
Eric House
274e7c6c4b fix NPE (by inspection, from crashlytics report) 2019-02-20 10:38:27 -08:00
Eric House
c2a4c07746 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-02-20 10:29:24 -08:00
Eric House
87a27e7630 update status more often (as old code did) 2019-02-19 21:25:28 -08:00
Eric House
1a6b325722 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-02-19 21:25:28 -08:00
Eric House
76e8876df2 change key to force new value
fixes what was probably a crash only for me, but....
2019-02-19 21:25:20 -08:00
Eric House
68db5145ec report invitation success even if dict download needed 2019-02-19 20:56:24 -08:00
Eric House
d33593339f use https scheme for dict downloads 2019-02-19 20:55:31 -08:00
Eric House
e970659b9d 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-02-19 18:31:20 -08:00
Eric House
1d0ed70f9c add not-again checkbox to BAD_BT_PROTO dialog
Won't help the old-build side of the exchange of course.
2019-02-19 08:56:58 -08:00
Eric House
a38a31837b 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-02-19 08:31:49 -08:00
Eric House
ff5d25a53c 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-02-18 22:12:43 -08:00
Eric House
4c9f619a19 exit threads when BT off; add util to report deadlocks
I've seen a deadlock in the BT stuff. Now they'll be caught and reported
via Crashlytics on DEBUG builds.
2019-02-17 12:49:17 -08:00
Eric House
276abe6441 always increment failure count on send failure 2019-02-16 10:07:29 -08:00
Eric House
b5659f0e5c Rewrite BT proto to batch messages
Lots of changes. Old BT proto is no longer compatible. New one
batches messages per device and sends all on a single connection.
The queue (now a single buffer) is now a static global and the thread
that services it doesn't die (but gloms onto whatever Service instance
is most recent.) Code to pack and unpack the protocol can probably be
reused for wifi-direct or any other pass-through transport.
2019-02-16 09:07:20 -08:00
Eric House
4f4deec7ba replace some firing asserts with log messages
I'm getting crashes on a device with an iffy wifi connection and no SIM.
May need to look into these.
2019-02-16 07:28:14 -08:00
Eric House
41aef60878 don't open game just because it was created
Posting a notification is enough. And existing code already handles the
missing dict case, so GamesListDelegate doesn't even need to know.
2019-02-13 08:46:06 -08:00
Eric House
01533e6897 double scan progress time
Since the BT stuff tends to timeout late when failing, this looks better.
2019-02-13 07:29:18 -08:00
Eric House
273e66fd07 add env to map immediately, in initGame()
I'm seeing an assertion failure in cleanup that could be explained by
the cleanup happening when initGame() has been called but no subsequent
jni method that would have added the env to the map. So let's add it
immediately so that can't happen.
2019-02-13 07:13:54 -08:00
naofum
bd631db7d2 Translated using Weblate (Japanese)
Currently translated at 74.3% (568 of 764 strings)
2019-02-12 18:40:16 -08:00
Eric House
0a5d74ab2f unselect any game moved into a closed group
Fixes GameOver game moved via "archive" checkbox remaining selected
2019-02-12 18:14:57 -08:00
Eric House
b5ff337381 don't move selected games via context menu
Both ways of invoking move-to-group were working on the set of selected
games. Instead pass what's meant to be operated on as a parameter.
2019-02-12 07:51:21 -08:00
Eric House
0f8e55a260 put GameOver view layout into a ScrollView
When device in landscape the archive box is otherwise unreachable on a
four-player game
2019-02-12 07:47:57 -08:00
Eric House
eafe6cd06f make GamePtr AutoCloseable and use where possible 2019-02-12 06:13:36 -08:00
Eric House
b1a4b1a030 Make JNIThread autoclosable and use everywhere
JNIThread is somehow sticking around sometimes and holding the lock for
a game so that that game can never be opened again. On the theory that
there's some place retain() was called but not release(), use the thing
in try-with-resources wherever possible. Which is pretty much
everywhere.

Also added age to the lock-holder report being uploaded.
2019-02-11 20:39:17 -08:00
Eric House
9fe01047b1 include stack of lock owner when logging failure to lock 2019-02-11 07:52:22 -08:00
Eric House
88838d6c0c Fix NPE when url for delete game has changed
I think it's only an issue for debug builds where I've manually pointed
at a different server, but just in case.
2019-02-11 07:32:17 -08:00
Eric House
ec4711f3ba make text in new GameOver alert bigger
To match how it was when using the system-provided view.
2019-02-11 07:29:34 -08:00
Eric House
7f2e3207be report stack of lock owner to crashlytics when can't get it
I'm seeing something permanently lock a game so it can't be opened. So
add code to report the stack of the owner to Crashlytics when opening
fails 3 times in a row. It's stubbed out for non-debug builds.
2019-02-10 20:02:43 -08:00
Eric House
813cf4f961 Add custom GameOver alert for GameOver with Archive checkbox
I didn't like having to re-open a game to archive it after
rematching, so now there's a checkbox that lets you archive it after
either rematching OR just using OK to dismiss the alert. Also fixed
rematch of a solo game causing new game to be created in Archive
group if that's where the source game was.

squash me
2019-02-10 14:22:22 -08:00
Eric House
ab69cd8b1f Merge remote-tracking branch 'weblate/android_translate' into android_translate 2019-02-10 09:01:14 -08:00
Eric House
d53ea5c433 up copyright year 2019-02-09 16:16:54 -08:00
Eric House
2eaf86ed14 add git rev to crashlytics reports 2019-02-09 11:13:32 -08:00
Eric House
01d74e91de plug leak 2019-02-08 22:29:18 -08:00
Eric House
8f6745a308 avoid crashes when BT turned off
Test at enqueueWork() and onHandleWorkImpl(). Seems to do it. Maybe
turning it off mid-send will still crash...
2019-02-08 22:22:03 -08:00
João Vitor Ferreira Cavalcante
cfc9466efd
Translated using Weblate (Portuguese)
Currently translated at 51.6% (394 of 764 strings)
2019-02-09 02:09:26 +01:00
Eric House
30f70db59b don't create threads we won't use 2019-02-08 14:37:58 -08:00
Eric House
6b449bb079 null listener thread ref so will be restarted
Once it died it stayed dead: bad.
2019-02-08 14:11:35 -08:00
Eric House
3023ae1af6 cleanup 2019-02-08 13:48:40 -08:00
Eric House
fe721edb97 Recast BTService as a JobIntentService
Got tired of the space the forground-service notification icons were
taking. So now BT sends and receives are done via static threads and
onHandleWork(). The send thread times itself out quickly. The receive
thread doesn't yet. We'll see how long the OS lets it run and what
needs to be done to deal with that.
2019-02-08 13:23:07 -08:00
Eric House
e6b59ea11d add debug-only option for invitee players to be robots
It's useful when testing to have the remote device play without human
interaction. So add an option, and UI to trigger it, for the players
created remotely in response to an invitation to be robots. There are
guards in place to catch the feature slipping into a release build.
2019-02-07 08:17:54 -08:00
Eric House
c97e167e1e remove some logging 2019-02-06 22:55:31 -08:00
Eric House
ff45340eb8 remove methods overridden just for logging
looks like I've fixed the crash I wanted to diagnose.
2019-02-06 22:37:52 -08:00
Eric House
9a4fb44e72 fix relay interactions again
Eliminate the writer thread, since onHandleWork() is already getting
called on a thread and can process the outbound queue itself. And get
rid of reader thread needing to wait for an instance of the RelayService
to be available to process a packet (which was taking 5-10 seconds all
the time): just post received packets via an enqueueWork() call using
the app context that's always available.
2019-02-06 22:32:46 -08:00
Eric House
e62e51f9cd pass context and use to post lock-failure toast 2019-02-06 19:43:54 -08:00
Eric House
f5c9962b66 tweak/reduce logging 2019-02-06 19:36:17 -08:00
Eric House
895b19a097 move constant from XWApp to build.gradle 2019-02-06 10:44:21 -08:00
Eric House
f92b0d7ac0 avoid NPE (and log to root-cause it later) 2019-02-06 09:06:25 -08:00
Eric House
ab0469fe39 ensure writer gets run every time OS schedules via onHandleWork() 2019-02-05 09:58:39 -08:00
Eric House
bf2ab49c20 remove some logging 2019-02-05 09:37:39 -08:00
Eric House
bd35503daa fix NPE and let GameSummary stay until replaced
GameListItem was clearing its summary when kicking off a replacement
load. Instead keep the old around in case somebody wants it (e.g. to
figure out what menus to enable) until the reload finishes.

Also add logging of how long loading takes. I think a cache might be
called for.
2019-02-05 07:44:16 -08:00
Markus Enzenberger
7d8c013492
Translated using Weblate (German)
Currently translated at 100.0% (764 of 764 strings)
2019-02-05 10:09:17 +01:00
Eric House
38f0fc6fd1 move invite button above button bar.
(It's more frequently used)
2019-02-04 17:56:23 -08:00
Eric House
64c6d03392 add context comment for new string 2019-02-04 17:33:03 -08:00
Eric House
908f5a64e7 Merge branch 'android_branch' into android_translate 2019-02-04 17:28:06 -08:00
Eric House
ce03ab7532 cleanup via new macro 2019-02-04 14:38:40 -08:00
Eric House
3810d11e26 remove logging 2019-02-04 14:27:43 -08:00
Eric House
e1f03662c3 fix malformed xml string
Weblate bug?
2019-02-04 13:35:34 -08:00
Eric House
bdf1bd3b84 fix problems with RelayService
Darned thing was dropping packets, failing to connect games built in
response to invitations, and otherwise misbehaving. First was due to not
resheduling when exited with outbound packets in queue; second to not
overriding relayNoConnProc() (due to signature change.) Though it still
happens occasionally.... Also added timestamps to track how long it
takes a packet to be sent and ACK'd.
2019-02-04 13:28:05 -08:00
Eric House
328440abc3 add rowid to NoSuchGameException 2019-02-04 08:58:50 -08:00
Eric House
5886a97a53 fix NPE (and tweak logging) 2019-02-03 10:36:54 -08:00
Eric House
74cf4b0974 add flavor to toasted got-fcm message
So I can tell the apps apart
2019-02-02 22:39:57 -08:00
Eric House
e98519ea38 stop storing fcm keys and similar data in postgres arrays
Not sure why I was doing this, but it's not worth the
trouble (e.g. stopping updates of other data to fix an android bug
sending too many reregistration messages.) So now just use the first
element of arrays, replacing what's there instead of prepending. Ideally
those columns would not be arrays, but that's a harder change.
2019-02-02 21:49:50 -08:00
Eric House
23fe3a1dd6 make script executable 2019-02-02 15:50:17 -08:00
Eric House
49ef455e50 display latest FCM receipt as part of netstats for relay 2019-02-02 15:18:45 -08:00
Eric House
be6b74ab12 use a constant jobID for enqueueWork()
That each VM instance had a different id might be why I was
crashing. We'll see.
2019-02-02 13:35:38 -08:00
Eric House
4a335522d2 fix so success detected from new API 2019-02-01 20:51:07 -08:00
Eric House
b8dafb8178 remove debug-only assert I'm seeing
Good to know it's happening; now don't crash!
2019-02-01 19:39:23 -08:00
Eric House
1a3aa9f8d1 put back pref controlling whether FCM receives are Toasted 2019-02-01 19:27:12 -08:00
Eric House
9f7899cd7c make md5sum calculation available everywhere
I want to log sums to see when they arrive on relay. And also add some
missing @Overrides I noticed.
2019-02-01 17:01:32 -08:00
Eric House
236be21a78 put up toast when FCM message received
It's too useful to live without. So: tap into the static list of live
Delegates, and if any of them has an Activity available use it to run
Toast on UI thread. Otherwise there will be no display.
2019-02-01 16:49:12 -08:00
Your Name
cd777f3b9c pull and display new field 2019-02-02 00:20:35 +00:00
Eric House
c0783fba16 don't save duplicate devIDs
There's likely a bug in Android now where I'm registering over and
over though the fcm id hasn't been changed. That's wrong, but it's
also wrong (and filling up the db) to register a duplicate as if it
were new. So stop that.
2019-02-01 12:13:05 -08:00
Eric House
f6895aacff make https the default for prefs-alterable strings
And change the keys so all local changes get reset
2019-01-31 15:22:25 -08:00
Eric House
48c331fd56 use https everywhere. And rewrite URLs if necessary. 2019-01-31 12:57:31 -08:00
Mesut Akcan
8cd31b1250
Translated using Weblate (Turkish)
Currently translated at 0.8% (6 of 764 strings)
2019-01-31 14:09:09 +01:00
Mesut Akcan
c6ac53cb3f
Added translation using Weblate (Turkish) 2019-01-29 22:44:02 +01:00
Eric House
4c2e17064c add some logging around RelayService lifecycle 2019-01-29 11:15:46 -08:00
Eric House
e04f8d7fba fix just the warnings; VSIZE is safe 2019-01-29 09:15:56 -08:00
Eric House
15a2897112 Revert "toward compiling with gcc8"
This reverts commit d293517e7c.
2019-01-29 09:05:54 -08:00
Eric House
d293517e7c toward compiling with gcc8
My VSIZE is no longer legal, and apparently there's no workaround (no
way to safely figure the length of an array whose size is known at
compile time.) To avoid the risk of duplicating little constants, added
macros that define length in a way a new VSIZE can pick it up. Couldn't
make that work for struct field arrays, however, so there I'm using
constants.
2019-01-28 17:24:53 -08:00
Eric House
b616f79cfd remove the last critical error 2019-01-27 09:23:56 -08:00
Eric House
f7b6d30dc2 fix another critical warning 2019-01-27 09:12:58 -08:00
Eric House
2b5b4ba982 fix gtk critical errors 2019-01-27 08:46:51 -08:00
Eric House
a14b43bba0 communicate variant to relay, and store in new column 2019-01-27 06:31:21 -08:00
ssantos
8716832999
Translated using Weblate (Portuguese)
Currently translated at 51.6% (394 of 764 strings)
2019-01-27 10:04:36 +01:00
Eric House
316bf0060b fcm config file for xw4 variant 2019-01-25 11:36:24 -08:00
Eric House
96ad615a73 remove debug toast that can't work from that class 2019-01-25 09:24:21 -08:00
Eric House
b4096de8ca rewrite of gcm_loop.py to use FCM
Works on my test VM. Untested on production.
2019-01-25 09:21:37 -08:00
Eric House
a4152239f6 remove sms permissions from play store variant
and from a new debug variant so that can be tested. Add explanation to
be shown users who try to use the now-unavailable features.
2019-01-24 18:45:24 -08:00
Eric House
88a440acc3 add app-side support for firebase messaging
Works for xw4d variant only so far -- xw4 builds are broken!!!
2019-01-24 18:20:01 -08:00
Eric House
4ee76c72a6 add variant option to build scripts
xw4 won't build for a while...
2019-01-24 17:59:50 -08:00