Commit graph

10878 commits

Author SHA1 Message Date
Eric House
cf3d3bc156 cleanup from review of diffs (nothing significant) 2019-01-15 07:44:38 -08:00
Eric House
73a469a428 make logging respect force-on preference 2019-01-14 16:58:00 -08:00
Eric House
788113ee28 up versions strings for new release 2019-01-14 13:12:39 -08:00
Eric House
c976b3f595 show BT-troubleshooting hint when scan finds no devices 2019-01-14 12:20:27 -08:00
Eric House
23e58524a1 in invite dialog, confirm before deleting BT devices 2019-01-14 12:08:07 -08:00
Eric House
0da5d9dd28 improve gcm-debug toast message 2019-01-13 21:56:59 -08:00
Louies
1328f1a9a4
Added translation using Weblate (Chinese (Traditional)) 2019-01-13 14:15:27 +01:00
Eric House
e378647e36 put back explanatory progress text 2019-01-12 09:04:40 -08:00
Eric House
bfbf17252e use ProgressBar instead of Dialog for BT invite scans
I wanted to show progress, and it was just as easy to replace the
deprecated ProgressDialog as to add a timer to the thing.
2019-01-11 21:06:15 -08:00
Eric House
bdbd5bc1ee disable logging for tagged release builds 2019-01-09 20:00:20 -08:00
Eric House
1625ec9062 Merge branch 'android_branch' into android_translate 2019-01-09 19:03:21 -08:00
Eric House
48a9e830b8 remove empty string -- not legal 2019-01-09 19:02:29 -08:00
Eric House
d2cbcf1e71 tweak BT background notification icon and expl. text
The BT icon part was too thick. And the explanation was TMI.
2019-01-09 18:57:50 -08:00
Eric House
d257369639 use same invite prefix for all variants
I want to be able to invite one app to the other's games to better test
relay. Since I'm the only one using the Dbg variant should be no impact.
2019-01-09 18:25:52 -08:00
Eric House
011825e4a9 cleanup 2019-01-09 18:18:27 -08:00
Eric House
302a3a5025 accept invite even if same-gameID game open
more dev-only code, likely: if the game that's sending the invitation is
open when the invitation arrives, should still check if it's a dupe or
should be accepted.
2019-01-09 09:51:15 -08:00
Eric House
250583caea log when invite response comes back 2019-01-08 20:34:22 -08:00
Eric House
a665df7840 cleanup: test's done already 2019-01-08 20:31:27 -08:00
Eric House
f18a957ed5 kill progress when owner view goes away
BT Invite progress was sticking around when Board left because it wasn't
foreground.
2019-01-08 20:31:27 -08:00
Eric House
2c73f4ca77 don't handle duplicate invitations in DEBUG case
Was creating a second game in some cases in response to duplicated
invitations. Add a test for forceChannel: if there's already a game with
the same gameID *and* forceChannel assume the invitation is a dupe and
drop it.
2019-01-08 20:02:01 -08:00
Eric House
e0f4a028d1 remove a bunch of unused methods 2019-01-08 19:42:44 -08:00
Eric House
24fad52cd8 use second resolution in bt device display
Useful to see that a scan really did just happen
2019-01-08 11:52:31 -08:00
Eric House
7c7b80deae add net-stats dialog to log-tap games menu
So I don't have to open a game to see e.g. how it's connecting, refactor
the network status stuff so it can be called from both board and
gameslist views. Then add new context menuitem that calls it.
2019-01-08 11:37:57 -08:00
Eric House
e9e03a06a3 show toast when GameLock fails to lock (some cases) 2019-01-08 10:09:43 -08:00
Eric House
4fcc5fd99b turn off faker device (but make easy to enable) 2019-01-08 09:49:10 -08:00
Eric House
c87161307c When rematching an Archived game save in default new-game group 2019-01-08 09:41:23 -08:00
Eric House
db641c4664 log gameSeed; generate on linux too
I'm seeing a rare case where a game connectes to relay specifying a room
and somehow gets both slots, having provided different gameSeeds the two
times. This means an opponent won't connect, the room being full in that
game. I can't reproduce, so am logging seed changes better and switching
linux client to leave seed generation to comms as Android does.
2019-01-08 08:16:50 -08:00
Eric House
454e3da578 fix to compile when #define not defined 2019-01-08 07:41:22 -08:00
Eric House
7cccd1a1e6 make the fake result random 2019-01-06 17:12:11 -08:00
Eric House
59f1e1696e remove unused constant (enum) 2019-01-06 17:04:36 -08:00
Eric House
0953772673 cleanup: don't need wrapper around a List<> 2019-01-06 16:58:30 -08:00
Eric House
2a845da9b6 use List instead of array 2019-01-06 16:29:52 -08:00
Eric House
83340567b2 add and implement remove button for btinvite dialog 2019-01-06 15:20:36 -08:00
Eric House
853578eb7d don't drop known BT devices on every scan
Instead, keep them forever (for now), sorted by how long since they were
last seen. A Delete button's probably needed to prevent ex-partners from
sticking around too long. :-)
2019-01-06 14:34:43 -08:00
Eric House
c7f9fc465f persist and display most recent scan time 2019-01-06 13:40:49 -08:00
Eric House
2f508c0b5c persist BT invitee dev scan results
Only launch the scan automatically when the persisted list is empty.
2019-01-06 12:30:31 -08:00
Eric House
3a0e67c7b3 remove unreachable code 2019-01-06 12:05:30 -08:00
Eric House
d868fef0d2 revert space-only change 2019-01-06 12:04:51 -08:00
Eric House
aecce2826e revert change making userError() take an enum
The set's open-ended on the C side, meaning that an int can't be
converted to an enum reliably. Yay for asserts that caught this.
2019-01-06 11:12:59 -08:00
Eric House
5da32d93f7 fix double-launch of SMSInvite activity
Adding a second permission a while back resulted in two Actions being
received and acted on. Needed instead to group the two and receive a
single Action IFF both were granted.
2019-01-06 10:58:12 -08:00
Eric House
5a64b3b92f Fix problems inviting SMS on emulator
Likely no-ops on real devices
2019-01-06 08:59:38 -08:00
Eric House
105e8e2623 add logging
Keep some stuff added to debug problem with dict checksums on server.
2019-01-05 18:54:48 -08:00
Eric House
cace99818d remove dead code 2019-01-05 18:48:26 -08:00
Eric House
3cf8d7571b fix md5sum calc for non-utf8 wordlists
And use apache logging
2019-01-05 18:46:58 -08:00
Eric House
e77b830157 replace assert with what it was to remind me to add 2019-01-01 19:43:44 -08:00
Eric House
e30497f336 catch another exception 2018-12-29 19:56:56 -08:00
Eric House
5a7d5b80da punctuation 2018-12-29 19:52:11 -08:00
Eric House
4a90792dec If game's in Spanish, don't require 7 tiles for trade.
Put up an error message if too many tiles selected for trade
(a condition that couldn't exist when the pool was guaranteed to
have at least 7 in it.) (It's a hack: there's not even an enum
giving Spanish's code, and the lang_locale stuff in info.txt isn't
making it into the .xwd format.)
2018-12-29 18:47:48 -08:00
Eric House
e9ae36f68d fix invite via relayID (linux test app)
I broke it adding SMS invite support?
2018-12-29 07:41:03 -08:00
Eric House
e58f51a523 log, rather than toast, too-frequent debug message 2018-12-28 07:15:40 -08:00
Eric House
bdd92baf55 fix NPE when game isn't connected yet 2018-12-28 07:09:15 -08:00
Eric House
37a853c8a4 oops: use the first *remote* address 2018-12-27 22:10:24 -08:00
Eric House
320db700a9 add opponent address to net stat display
(Debug builds only)
2018-12-27 19:30:34 -08:00
Eric House
24386bd8c9 catch uncaught exception 2018-12-27 18:09:18 -08:00
Eric House
b0805b0b6a use tryLock() to avoid on-ui-thread assertions 2018-12-26 21:41:47 -08:00
Eric House
62cd90c183 remove unused interface 2018-12-26 17:45:42 -08:00
Eric House
0e2af6a836 rewrite GameLock to use wait()/notifyAll()
I've learned a bit about java since writing that class. Should be faster
now without the sleep/polling. Also making it illegal to use blocking
lock() call on UI thread. There may be some assertions to fix in the
next few days.
2018-12-26 17:41:21 -08:00
Eric House
891c73a1b7 make run() wait for gamePtr before starting loop
Was seeing race condition on slowest device where JNIThread init hadn't
finished before the event loop tried to use the gamePtr. So use
wait()/notifyAll() to fix.
2018-12-18 07:07:35 -08:00
Eric House
285f6ad34a revert diagnostic changes 2018-12-17 12:57:17 -08:00
Eric House
e10b17cec0 remove logging; diagnose git/travis problem 2018-12-17 12:35:40 -08:00
Eric House
5467941d45 start stuff when package replaced
And: Don't start the foreground service with its user-visible
notification, as that's too obtrusive and the ACL_CONNECTED stuff seems
to work well enough. Launching timers on a new install is mostly for my
own dev use, but won't hurt user experience either.
2018-12-17 08:26:39 -08:00
Eric House
d8d0065e90 remove some logging 2018-12-17 08:26:00 -08:00
Eric House
3b48ee0ed8 try a different command 2018-12-16 18:48:06 -08:00
Eric House
a2fe00368e more diagnosis 2018-12-16 18:11:09 -08:00
Eric House
b88bbcf443 diagnosing travis build problems 2018-12-16 17:53:18 -08:00
Eric House
d31c2f5513 trying another fix for travis 2018-12-16 17:43:12 -08:00
Eric House
3b0a523499 send successful pings back as they occur
rather than have the user see no feedback until the slowest-to-respond
paired device times out.
2018-12-16 13:34:28 -08:00
Eric House
2d91c133a8 new file (forgotten earlier) 2018-12-16 10:41:04 -08:00
Eric House
67fa27069a add a hint for when scan shows nothing 2018-12-15 07:20:29 -08:00
Eric House
e3f862a6eb shorten timeout for scan/ping 2018-12-15 07:07:54 -08:00
Eric House
e15fb84005 ask for SMS_RECEIVE on startup if have SMS_SEND
It's free (same group) but required on SDK_26 for invitations to work.
2018-12-14 19:33:03 -08:00
Eric House
f7ef1adcb5 add settings button to foreground service notification
On O and beyond it's possible to tweak notification channels separately,
meaning users can hide the new BT-is-running notification and still get
game event notifications. So add a button that takes you to the right
Settings app page.
2018-12-14 17:12:15 -08:00
Eric House
02897f6e36 use separate channel for background service notification
Since on newer OS versions users might want to hide it
2018-12-14 16:00:36 -08:00
Eric House
2ab04901a7 scan all paired devices at same time
One thread per device: brute force, but the threads live a few seconds
and the user just triggered the action so should be ok with it.
2018-12-12 22:32:14 -08:00
Eric House
61dc8e837e cleanup 2018-12-12 22:21:02 -08:00
Eric House
c2f5949623 use AutoCloseable rather than a hack of my own 2018-12-11 15:14:51 -08:00
Eric House
f7258f29e8 saw a crash, so gather more info if it happens again. 2018-12-11 14:40:57 -08:00
Eric House
68bb8a1268 fix bluetooth bootstrapping
Separate processing of sockets from accepting them so that when an ACL
CONN notification is received and we open a socket (but don't yet have a
Service running because the ACL thing is most likely for some other app)
we can set it aside to be processed once we do have a service. Use the
same block-until-non-null thing as in RelayService to keep that thread
free of NPEs.
2018-12-11 14:38:40 -08:00
Eric House
48c06acef5 new debug util method 2018-12-11 08:28:07 -08:00
Eric House
4f8f14c83b kill thread when wait() fires InterruptedException
Rather than just dropping it and going back to a wait that will likely
last forever. I *think* wait() throwing that exception means the
thread's being killed, in which case the exception should be thrown up
to the containing loop that will then exit.
2018-12-11 06:57:59 -08:00
Eric House
f2322d7e81 cleanup (no behavior change) 2018-12-11 06:57:18 -08:00
Eric House
bfad324bb4 add stop button to notification
And keep the service alive (and the notification present) for 15
minutes.
2018-12-10 19:17:05 -08:00
Eric House
ea03c855e4 cleanup: remove logs and unneeded code
pull too much logging and stuff starting service on going into
background. RelayService isn't that type of Service.
2018-12-10 11:56:40 -08:00
Eric House
e797a28a6d cleanup: use marker instance rather than instanceof 2018-12-10 10:14:17 -08:00
Eric House
0a4b8549cf Don't block UI thread until service instances released
I thought I had to stop using a service instance before returning from
its onDestroy(), but that made the UI incredibly laggy AND appears not
to be necessary. At least in a bit of testing things still work.
2018-12-10 09:45:24 -08:00
Eric House
fe6996b663 decouple networking threads from RelayService
Oreo's creating a new service instance for every single intent passed to
enqueueWork, meaning a brand new set of threads with a new queue, empty
set of messages to be retried, etc. was created every time, and all
attempts to optimize and retry were broken. So: make the threads a
static singleton that are given a Service instance from onCreate() and
told to drop it from onDestroy(). The threads proceed until they need an
instance, then block until one's available. Seems to work on Oreo and an
older Android as well.
2018-12-09 18:26:59 -08:00
Eric House
a2fa841947 new DebugUtils method 2018-12-09 18:26:59 -08:00
Eric House
c5c081e8bd make RelayService descend from JobIntentService
Required moving most of XWService into a class to which all services
could delegate what they used to inherit.

squash me
2018-12-09 18:26:59 -08:00
Eric House
5f7e4aa1b9 refactor a tiny bit 2018-12-09 18:26:59 -08:00
Eric House
9c501b19a8 get RECEIVE_SMS permission with SEND_SMS
Apparently one of the newer Android SDK levels adds the requirement to
have RECEIVE_SMS permission in order for a broadcast receiver to get
called. Meaning receipt didn't work even if SEND_SMS had been
granted. Since they're both in the same group (for now) the OS will
grant the second silently if the first has been granted, but it still
has to be requested. So request both at the same time. This still leaves
the problem that a user who's never tried to create an SMS game won't
have been asked for either permission and so won't receive SMS
invitations, but fixing that is for a later release.
2018-12-09 18:26:59 -08:00
Eric House
3c861166de use TAG format that doesn't break logcat filtering 2018-12-09 18:26:59 -08:00
Eric House
e30466e096 include flavor in logged TAG
Tired of not being to tell variants' logs apart.
2018-12-09 18:26:59 -08:00
Eric House
7c804b9aad don't drop potential duplicate invitations after 5 seconds
Other code will take care of duplicates. This was meant to avoid a race
condition, for which 5 seconds is enough. Blocking forever complicates
testing.
2018-12-09 18:26:59 -08:00
Eric House
c4ac96ede8 fix NPE (race condition around deletion?)
Check for null. Not sure how I got it there, but there's little harm in
failing silently.
2018-12-09 18:26:59 -08:00
Eric House
95c11eec07 don't try to connect to non-phones
When a device is paired but not a phone (or computer, which is how
tablets identify), don't bother trying to scan it.
2018-12-09 18:26:59 -08:00
Eric House
051aeba57c fix crash by not creating Handler until on UI thread
Receiver is created and installed by a non-UI thread sometimes so can't
create the Handler there. onReceive() is called on an ok thread however
so create it there on demand. Fixes crash that showed when receiving
relay messages in background.
2018-12-09 18:26:59 -08:00
Eric House
68ae9790b4 launch service from ACTION_ACL_CONNECTED
Fire up the receiver thread, and start the service, on receipt of this
ACTION (if they're not already running.) On start, the service takes
over the thread and begins dispatching messages. Works to launch the app
when it's not running and in most cases, though messages received before
the service launches are currently dropped, things seem to work.
2018-12-09 18:26:59 -08:00
Eric House
3dbec328af fix NPE
It happened when too many timers were firing, but I think this code's
better anyway.
2018-12-09 18:26:59 -08:00
Eric House
271d43808f kill foreground service on a timer
reset timer on receiving meaningful data and on moving app to
background. If it fires and we're in background, kill the service.
(There's currently no way to restart it except bringing the app into the
foreground. Fixing that's coming.)
2018-12-09 18:26:59 -08:00
Eric House
c8fe57cc78 make listener thread static
remove relationship with BTService so it can be created independently.
2018-12-09 18:26:59 -08:00
Eric House
e984b10fea remove option of disabling foreground service
Since it's not going to be running all the time any more.
2018-12-09 18:26:59 -08:00
Eric House
d94821feb4 btinvite dlg shows results of scan not all paired devs
Moving toward a better BT invite experience: use BTService to scan for
ourselves on all paired devices, and only allow selecting from among
those on which we're running (and so likely to respond to an
invitation.)
2018-12-09 18:26:59 -08:00
Eric House
ece125c5dc change foreground-service notification text 2018-12-09 18:26:59 -08:00
Eric House
1e42156f4a remove assert
Constructor is called from JNI code and so not on the UI thread.
2018-12-09 18:26:59 -08:00
Eric House
faeaa60f87 replace junit's assert with my own
And have it log before throwing. Should be easier to track down asserts
coming from jni callbacks this way than in the C code.
2018-12-09 18:26:59 -08:00
Eric House
eaae9ed1c1 Always call startForeground after startForegroundService
It's an error to e.g. stopSelf() without having called startForeground,
so do it even when about to exit.
2018-12-09 18:26:59 -08:00
Eric House
0a0bd54ec7 include new permission to install third-party apks
Fixed upgrade of Dbg variant not working on Oreo.
2018-12-09 18:26:59 -08:00
Eric House
8bd4613c2a include X86 native library again
It's a pain to have to change code to run in Genymotion, and to have
upgrade not testable using Genymotion. Consider verting this change
before next release.
2018-12-09 18:26:59 -08:00
Eric House
50f448bb1f fix to contact relay in foreground on Oreo+
Background still needs a lot of work.
2018-12-09 18:26:59 -08:00
Eric House
ff2192f659 fix path name string causing JNI crash on emulator
And catch NPE that also seems to be emulator-only
2018-12-09 18:26:59 -08:00
ssantos
73ac713b89
Translated using Weblate (Portuguese)
Currently translated at 52.7% (395 of 750 strings)
2018-12-01 21:08:47 +01:00
Eric House
9eec5c37ef fix path name string causing JNI crash on emulator 2018-11-29 09:30:14 -08:00
Eric House
91828cb851 add more google()
still trying to fix travis builds
2018-11-28 21:21:48 -08:00
Eric House
b2bf3a6e80 move google() above maven (to fix travis?) 2018-11-28 20:38:43 -08:00
Eric House
ce3cb62f02 add reversed version of btservice notification icon
For the Dbg variant to match its normal notification icon.
2018-11-28 19:35:24 -08:00
Eric House
fc699caaa8 ensure channel id always setup before use 2018-11-28 19:27:32 -08:00
Eric House
7eb278033a revert change setting notifiction priority low 2018-11-28 19:20:43 -08:00
ssantos
f8c79efc60
Translated using Weblate (German)
Currently translated at 99.7% (748 of 750 strings)
2018-11-27 23:07:31 +01:00
Eric House
843c95e7ae new icon for omnipresent BTService notification 2018-11-27 11:27:18 -08:00
Eric House
988ac55eaa tweak apk-cmp script 2018-11-27 10:06:38 -08:00
Eric House
0dbc976561 Merge branch 'android_branch' into making-it-work-with-api26 2018-11-24 13:19:34 -08:00
Eric House
88fe2739c1 fix crashes (NPE and RelayService trying to run in background)
Still need to figure out what RelayService does. It needn't run for long
except where GCM isn't present.
2018-11-24 13:04:14 -08:00
Eric House
eb6831ea12 add bt-in-background preference
And clear it from a button in the alert that's posted when the
foreground service notification is selected.
2018-11-23 09:47:18 -08:00
Eric House
f8e15bd3a0 add explanation for foreground service notification 2018-11-23 08:21:52 -08:00
Eric House
2ba5982ddf use foregroundService on devices that can handle it
And show the notification regardless. Tested only on pre-Oreo device so far.
2018-11-22 15:18:57 -08:00
Eric House
6177914213 add lifecycle lib (events only logged only so far) 2018-11-22 08:13:49 -08:00
ssantos
9a80bacf66
Translated using Weblate (Portuguese)
Currently translated at 52.1% (391 of 750 strings)
2018-11-19 08:07:10 +01:00
Israa Zamzami
3eba8312d4
Translated using Weblate (Arabic)
Currently translated at 12.0% (90 of 750 strings)
2018-11-14 20:07:08 +01:00
Israa Zamzami
1b6139721d
Added translation using Weblate (Arabic) 2018-11-13 19:05:27 +01:00
WaldiS
b49e1289db
Translated using Weblate (Polish)
Currently translated at 1.2% (9 of 750 strings)
2018-10-27 20:38:05 +02:00
WaldiS
cb97fc5796
Translated using Weblate (Polish)
Currently translated at 0.9% (7 of 750 strings)
2018-10-21 21:35:02 +02:00
Allan Nordhøy
68a705a0a3
Translated using Weblate (Norwegian Bokmål)
Currently translated at 86.0% (645 of 750 strings)
2018-10-03 11:32:31 +02:00
Allan Nordhøy
1a89b2eee1
Translated using Weblate (German)
Currently translated at 99.0% (743 of 750 strings)
2018-10-03 10:28:13 +02:00
Allan Nordhøy
9ed3239fe2
Translated using Weblate (Norwegian Bokmål)
Currently translated at 81.6% (612 of 750 strings)
2018-10-02 09:31:31 +02:00
Allan Nordhøy
d6468499a3
Translated using Weblate (Norwegian Bokmål)
Currently translated at 77.3% (580 of 750 strings)
2018-09-30 10:31:48 +02:00
Allan Nordhøy
5bf337dcde
Translated using Weblate (Norwegian Bokmål)
Currently translated at 57.4% (431 of 750 strings)
2018-09-25 06:33:14 +02:00
Eric House
dfcac132c8 up strings for new translations-only release 2018-09-22 14:21:04 -07:00
Eric House
6bafbecd75 toward service working on Oreo
Did a bunch of stuff to inherit from JobIntentService and use enqueue(),
but doesn't work yet. OS is unable to bind, with this error:
09-21 17:20:51.678  3050  3050 W JobServiceContext: Time-out while trying to bind 2edee28 #u0a277/1111 org.eehouse.android.xw4dbg/org.eehouse.android.xw4.BTService, dropping.
2018-09-22 09:22:37 -07:00
Eric House
24440230ba refactor so startService can change (no behavior change yet) 2018-09-21 15:21:04 -07:00
Eric House
dbbeeb7519 Merge branch 'android_translate' into android_branch 2018-09-13 21:31:09 -07:00
Eric House
62dc885922 Merge remote-tracking branch 'weblate/android_translate' into android_translate 2018-09-13 21:29:44 -07:00
Eric House
45600a295a use NotificationChannel to work on O and beyond with SDK 26
Notifications don't work on Oreo without this change, which includes a
new Support Library in order to get NotificationChannel and creates and
uses that as docs describe. Requires that MinSDK be raised from 8 to 14,
which may lock some users out. It *should* be possible not to do this in
the fdroid variant since their app store doesn't requires SDK 26, but
I'll look at that later.
2018-09-13 19:49:49 -07:00
Eric House
6f6c3238d4 Merge branch 'android_branch' into making-it-work-with-api26 2018-09-13 14:11:30 -07:00
Eric House
54f3e57f7f Merge branch 'android_branch' into making-it-work-with-api26 2018-09-13 10:36:26 -07:00
naofum
13f617b0b5
Translated using Weblate (Japanese)
Currently translated at 74.1% (556 of 750 strings)
2018-08-27 02:42:19 +02:00
Bernard Massot
28b784fdb4
Translated using Weblate (French)
Currently translated at 98.4% (738 of 750 strings)
2018-08-26 21:37:54 +02:00
Eric House
dfa308c1f5 pull timestamp out of DB as a long
for better formatting, eventually.
2018-08-07 09:01:17 -07:00
Eric House
02781c5113 use different (older) crashlytics (untested)
For some reason my laptop wouldn't build without this change. No idea
what happened to the newer version I was using or if the change
works (beyond compiling). Should be easy to find the change later if
it's a problem.
2018-08-07 08:57:14 -07:00
Eric House
9fb8671ef0 Merge branch 'android_branch' into android_translate 2018-08-04 11:14:54 -07:00
Markus Enzenberger
5d729094c3
Translated using Weblate (German)
Currently translated at 99.0% (743 of 750 strings)
2018-08-03 09:38:07 +02:00
Eric House
d23307f0ef up strings for new release 2018-08-02 06:28:09 -07:00
Eric House
3d7d1b8ffd don't call tile picker more than once
Some devices, including my Moto, are apparently calling server_do() more
than most. When the game's supposed to be asking the user to pick tiles
that resulted in stacked TilePickAlerts. The stack of these
sending (taken together) too many picked tiles to the game made it
crash. So modify server to have only one pending tile-pick request going
at a time. Because the server can't know when the user dismisses the
alert in Android and so won't post again, respond to the dismissal by
closing the game. Reopening will put it in a state where the tile picker
can get called again.
2018-08-01 20:30:51 -07:00
Eric House
0cc7d21ecb fix race-condition NPE by inspection 2018-08-01 08:08:36 -07:00
Eric House
6a58a08bca remove redundant specifier 2018-08-01 07:50:34 -07:00
Eric House
8286c9c116 new script for when release builds required 2018-08-01 07:48:02 -07:00
Eric House
f1c2eb79d4 remove x86 from jni; that chip's dead on Android 2018-08-01 07:37:33 -07:00
Eric House
e0c6621bfe remove assert: messages not for me are common 2018-07-31 00:26:11 -07:00
Hosted Weblate
a44db6c942
Merge branch 'origin/android_translate' into Weblate 2018-07-31 08:56:08 +02:00
Eric House
803b4ff0f3 cleanup: load/initialize only when first needed 2018-07-30 08:00:00 -07:00
Eric House
bf06d4b4c2 fix not sending ACK_INVITE
Logic error meant it was never sent. Now always send on receipt of a
well-formed invitation, even if e.g. the recipient's missing a wordlist
and the game can't be started immediately.
2018-07-30 07:37:20 -07:00
Eric House
a23777bade move byte[]<->NetLaunchInfo convert into the class 2018-07-27 07:44:02 -07:00
Eric House
2f10712379 revert to old invite data format
Had inadventently changed how NetLaunchInfo was transmitted, and crashed
on receiving from older builds. Fix to not crash, and then fix to send
and recieve in the old format.
2018-07-27 07:24:27 -07:00
Joan Montané
2c9d619f71
Translated using Weblate (Catalan)
Currently translated at 96.6% (723 of 748 strings)
2018-07-27 10:35:25 +02:00
Eric House
e637f49b95 include port and proto
Pretty sure couldn't have played against an older build without this.
2018-07-26 21:13:09 -07:00
Eric House
dfd4a3f6f6 put the api-26 changes back
lost in a rebase apparently
2018-07-26 19:16:50 -07:00
Eric House
9ddc6e4b89 Move transision of cmd and gameid and port (pending) into smsproto
common code, simplifying and unifying what the platform-specific code
has to do. Seems to work.
2018-07-26 07:50:16 -07:00
Eric House
a65498c132 add missing Overrides -- in one file 2018-07-26 07:24:23 -07:00
Eric House
70b22f7d11 revert to sdk-23
Too much breaks with the upgrade and I don't have time to deal.
2018-07-21 21:36:51 -07:00
Eric House
affb13207e up sdk version in the second place 2018-07-20 08:24:48 -07:00
Eric House
e1ba676a8e Merge branch 'quick-bt-fix' into android_branch 2018-07-19 07:17:15 -07:00
Eric House
723e7d7953 update changes to include translations included 2018-07-19 06:57:21 -07:00
Allan Nordhøy
6abff25946 Translated using Weblate (Norwegian Bokmål)
Currently translated at 55.2% (413 of 748 strings)
2018-07-19 06:54:32 -07:00
Joan Montané
5ced000c8c Translated using Weblate (Catalan)
Currently translated at 94.3% (706 of 748 strings)
2018-07-19 06:54:14 -07:00
Eric House
a9701525b7 up version string for new release 2018-07-19 06:47:18 -07:00
Eric House
fcefa9ca97 dismiss the BT invite progress thing on success
Not sure how this broke in the reorg of XWService stuff, but let's be
agressive about dismissing that thing.
2018-07-19 06:33:05 -07:00
Eric House
4450a8d56c fix NPE by inspection
I'm not sure how it happened -- race condition -- but it's harmless to
drop the action when it does.
2018-07-19 06:33:00 -07:00
Eric House
7cb00b6266 fix assertion: return a f*ing sink
Messed this up in February apparently.
2018-07-19 06:32:48 -07:00
Eric House
b0cf3a795c fix NPE by inspection
fix crash reported by user. Looks like a race on the way out so check
for null first.
2018-07-19 06:32:36 -07:00
Eric House
d40b8b7cad dismiss the BT invite progress thing on success
Not sure how this broke in the reorg of XWService stuff, but let's be
agressive about dismissing that thing.
2018-07-19 06:29:59 -07:00
Eric House
e1fec99860 fix NPE by inspection
I'm not sure how it happened -- race condition -- but it's harmless to
drop the action when it does.
2018-07-19 06:29:03 -07:00
Eric House
67d09a79b5 fix assertion: return a f*ing sink
Messed this up in February apparently.
2018-07-19 06:07:26 -07:00
Eric House
a3fb82ebc4 Merge branch 'android_branch' into android_translate 2018-07-18 22:30:58 -07:00
Eric House
a3ac3c4c8a fix NPE by inspection
fix crash reported by user. Looks like a race on the way out so check
for null first.
2018-07-18 22:26:26 -07:00
Eric House
807fe8633f add forgotten file 2018-07-17 08:46:39 -07:00
Eric House
84f636cbd5 always resend via SMS when opening game
It's done for other comm types too, and is necessary to get linux test
script to pass once I make SMS delivery unreliable. But it may duplicate
the tickle that Android's doing and result in duplicate messages: test.
2018-07-17 07:05:33 -07:00
Eric House
8f9c9e0623 fix crash around uri permissions for new OS version
Use a FileProvider with all the necessary xml changes to pass apk to
installer without crashing it or myself.
2018-07-17 07:02:36 -07:00
Eric House
276ef38108 use sdk26 -- will be required soon anyway 2018-07-15 10:33:09 -07:00
Eric House
2d8ac995b7 add test case where (fake) sms messages never arrive 2018-07-14 15:43:42 -07:00
Joan Montané
cc714a96cb Translated using Weblate (Catalan)
Currently translated at 94.3% (706 of 748 strings)
2018-07-14 12:35:09 +02:00
Eric House
352d87a327 use stream to take apart untrusted message safely
add new stream getters that return false if reach EOS and use them to
exit early and safely if incoming SMS msg is misformatted. I'm getting
random garbage meant for other apps perhaps.
2018-07-13 22:41:52 -07:00
Eric House
019cc628e4 fix crash figuring md5sum of null bytes
Just return null String
2018-07-13 22:35:44 -07:00
Eric House
89ec7987e6 move test to after db's inited to avoid crash 2018-07-13 18:20:56 -07:00
Eric House
5d6c743087 fix (I hope) null jni array dereference 2018-07-13 18:20:05 -07:00
WaldiS
cf24b1e4a0 Translated using Weblate (Polish)
Currently translated at 0.2% (2 of 748 strings)
2018-07-13 21:41:10 +02:00
Eric House
669acdcd19 log checksum of messages into smsproto 2018-07-13 07:39:11 -07:00
Eric House
c45c9cd809 read format spec outside assert
since the read inside goes away in release builds!
2018-07-13 06:59:57 -07:00
Eric House
b8c2cd1dd5 don't assert when a stray message wanders in 2018-07-12 20:20:04 -07:00
WaldiS
2d53673ae5 Added translation using Weblate (Polish) 2018-07-12 20:57:43 +02:00
Eric House
df8558e071 delete partial messages when count mismatches
Had an assert fire when a message ID was reused with a different count.
It was likely because of messages crossing between two variants, but
still, fix: delete what's been saved so far when a new count shows up.
2018-07-12 08:13:32 -07:00
Eric House
bd1cc4276b cleanup and variable rename (no code changes) 2018-07-11 07:33:36 -07:00
Eric House
3477bcf7b6 fix release-build scripts for new gradle output paths 2018-07-11 06:48:42 -07:00
Eric House
af0ddaa0f7 up version code and strings 2018-07-11 06:41:36 -07:00
Eric House
6bab91803d fix release builds
(broken since 091299c 2 months ago)
2018-07-11 06:38:54 -07:00
Allan Nordhøy
3959c73a86 Translated using Weblate (Norwegian Bokmål)
Currently translated at 55.2% (413 of 748 strings)
2018-07-11 00:39:41 +02:00
Eric House
95ac66370c fix off-by-one preventing delayed messages from sending 2018-07-10 07:08:57 -07:00
Eric House
9c2a722cc5 change two method names 2018-07-10 07:07:30 -07:00
Eric House
8c14ccc0d2 add new dutil to store by ptr; use for smsproto msgID 2018-07-10 06:36:34 -07:00
Eric House
08c41ddd3e add debug preference controlling new smsproto format
Don't use the message-combining feature for sends unless this is
set. After a release the default value will switch to true.
2018-07-10 06:19:16 -07:00
Eric House
a9769efe1c implement load/store on android 2018-07-09 07:11:54 -07:00
Eric House
e898dc509c plug leaks 2018-07-07 23:03:26 -07:00
Eric House
13cc6c79f1 add save/restore of partial messages
Handles case where the app receives only a subset of the SMS messages
into which a larger game-level message has been broken. Now when it
restarts and the remaining parts come in the whole can be reassembled.
2018-07-07 22:56:32 -07:00
Eric House
1c58ab3d99 clean up linux db usage
For load/store I'll need more flexibility to store large values.
2018-07-06 08:04:53 -07:00
Eric House
1941642607 add load and store to dutils, and implement with stubs 2018-07-06 06:56:54 -07:00
Eric House
3437ae2ebc use smsproto in Android 2018-07-06 06:48:56 -07:00
Eric House
2e9fbb8204 add common implementation of the SMS proto stuff
And use in linux client. Goal here is to reproduce then improve the
Android SMS pre- and post-processing stuff with a common/ implementation
that can be tested on linux and used wherever.
2018-07-05 21:40:56 -07:00
Eric House
87418d63d1 fix linux "sms" and modify script to test it
My linux sms hack used inotify and didn't check for messages that were
there when the app launched. Replace inotify with a simple glib periodic
timer. A bit of latency mimics SMS better anyway. Update test script to
support SMS, and add params to and otherwise fix linux client so
everything works.
2018-07-05 21:22:20 -07:00
Eric House
ed90c9c16d implement util->dutil split for Android
So now all jni code uses a single dutil context, but also a single
mempool and jniutil instance instead of new instances of the latter two
per game and dict-iteration.
2018-07-05 08:32:19 -07:00
Eric House
d4436b7706 Break part of util into dutil
Trying to separate what's game-specific from what can be app/device
specific (i.e. with a long lifespan, and available when a game isn't
open.)

Android will be broken after this commit and fixed after the next
2018-07-05 07:58:50 -07:00
Eric House
d46a4d13ba use mem_stream_make_raw() where possible in common code 2018-06-27 23:42:50 -07:00
Eric House
d70b089835 use mem_stream_make_raw() where possible in linux code 2018-06-27 23:37:28 -07:00
Eric House
976db7b181 add mem_stream_make_raw 2018-06-27 23:24:45 -07:00
Eric House
9cdd5a7b72 share mpool and vtable in jni calls
A number of jni calls were "stateless", which meant they allocated their
own vtmgr and mpool instances each time invoked. Instead invoke them
with the global jni closure and add to it vtmgr (already has mpool) and
use these instead of allocating/freeing each time. To make sure no race
conditions are introduced (mpool, though debug-only, is probably not
thread-safe), guard these new uses with an in-use flag. If that fires
I'll need a mutex or something.
2018-06-27 21:17:44 -07:00
Eric House
d2ab796fac test script tweaks 2018-06-18 07:11:38 -07:00
Eric House
382718bcb0 init variable
This might have made valgrind happier, though it's been a while. Can't
hurt.
2018-06-13 14:34:31 +03:00
Eric House
80167fb2d9 one more assert 2018-06-01 05:58:04 -07:00
Eric House
b7981cc8da print based on time rather than number of iterations 2018-05-31 23:06:51 -07:00
Eric House
ffaa47f893 fix creation of bogus game
Snapshot can be the first write. Save the rowid if it's new.
2018-05-31 22:19:03 -07:00
Eric House
b24d60e7bf add assert to verify no need for mutex 2018-05-31 21:23:25 -07:00
Eric House
dff130d6c6 ignore log dir 2018-05-31 21:23:10 -07:00
Eric House
d240e30bf4 test script: log and show tiles left in tray
Once the pool count drops to 0, start showing the number of tiles left
in the user's tray. This prevents there being a long time when nothing
seems to be changing *and* the script from exiting early because it
thinks all games are hung.
2018-05-25 21:36:25 -07:00
Eric House
89f4246e83 track and log types of (un-acked) messages 2018-05-24 21:03:25 -07:00
Eric House
39a5ce92ee refactor a bit (no behavior change) 2018-05-23 22:03:16 -07:00
Eric House
1821d197b9 fix to compile on 32-bit system 2018-05-23 19:48:30 -07:00
Eric House
32c93786b3 fix assert when buffer too small
read directly into vector rather than first loading into a fixed-size
buffer that's apparently occasionally not big enough.
2018-05-21 21:19:32 -07:00
Eric House
40ce484a92 fix mistaken and very broken commit
(Fortunately I never ran a relay with this in it!)
2018-05-21 21:19:25 -07:00
Eric House
7fa0cb1b93 rewrite as Thread instead of AsyncTask
I want to be able to use it in contexts where AsyncTask doesn't make
sense, e.g. from timer in background.
2018-05-11 10:23:49 -07:00
Eric House
091299c030 upgrade AS and gradle and with luck travis will work 2018-05-06 14:33:10 -07:00
Eric House
32df1777d3 Merge branch 'android_branch' into android_translate 2018-05-03 06:46:44 -07:00
Eric House
82e6c5495b fix to delete dict even when loc is wrong
Somehow I got a wordlist into a location different from what was
recorded in the DB table and since the delete command matched on
location as well as name it was never deleted (which meant the checksum
was never updated and so upgrading never seemed to succeed.) Removing
the match on location fixed that problem, and since I don't see any harm
in cacheing only one version of a wordlist will simply leave it that
way.

Did a bunch of cleanup as well.
2018-05-01 07:22:59 -07:00
Eric House
a27e8c4c04 move static method into enum 2018-05-01 07:00:14 -07:00
Eric House
1e766ee52d show usage when no args provided 2018-04-29 20:12:22 -07:00
Eric House
535dc29646 silence warning 2018-04-18 21:54:51 -07:00
Eric House
681e2cd8a0 up version code and strings 2018-04-18 21:49:04 -07:00
Eric House
cee7d696fc fix stuff to make valgrind happy 2018-04-17 21:13:53 -07:00
Eric House
1b71198d4e add valgrind option to test script 2018-04-14 10:48:20 -07:00
Eric House
ca54371515 tweaks to test script
Make fewer games with > 2 players, as that's rare. Fix calculation of
total number of launches to include games that have ended.
2018-04-14 10:42:53 -07:00
Eric House
ff82aa4251 fix asserts that fire when test script includes undos
When I used the --undo-pct flag in discon_ok2.py asserts occasionally
fired. This fixes that, and seems not to break anything.
2018-04-14 10:42:53 -07:00
Eric House
317df71588 more valgrind fixes 2018-04-14 10:17:12 -07:00
Eric House
05892c630e lazy: use glib to avoid gcc warnings 2018-04-14 09:39:27 -07:00
Eric House
3bb6f842b2 fix valgrind-flagged errors 2018-04-14 09:13:43 -07:00