Commit graph

11258 commits

Author SHA1 Message Date
Eric House
13d2917d85 up version strings 2019-06-23 10:19:01 -07:00
Eric House
c9d4df0cc4 add missing AndroidManifest.xml files for new variants 2019-06-23 10:19:01 -07:00
Eric House
b4aa6e2ae9 use latest nbsplib 2019-06-23 10:19:01 -07:00
Eric House
ae5b78e955 change to work with changed NBSProxy API 2019-06-23 10:19:01 -07:00
Eric House
5c243b3ff9 API's changed 2019-06-23 10:19:01 -07:00
Eric House
8b3c64b476 use the latest NBSProxy dev release 2019-06-23 10:19:01 -07:00
Eric House
da857e30e4 add logging of CurGameInfo
Trying to track down why some player names aren't preserved
2019-06-23 10:19:01 -07:00
Eric House
dfcb6272e3 override toString() for debugging 2019-06-23 10:19:01 -07:00
Eric House
4aee08b8d4 add missing consts 2019-06-23 10:19:01 -07:00
Eric House
94f7e13468 change emacs compile command (in comment)
No point defaulting to something that no longer exists
2019-06-23 10:19:01 -07:00
Eric House
edb0a8a8f7 fix symlinks post rename 2019-06-23 10:19:01 -07:00
Eric House
38775e4172 fix broken symlink 2019-06-23 10:19:01 -07:00
Eric House
be2ba7388d change name of variant -- it's not the main one anymore 2019-06-23 10:19:00 -07:00
Eric House
62c0292045 check if permission in manifest
I got bitten when creating a new variant leaving the permission out of
the manifest but using a config flag to claim it was there. Better to
have just one place to configure that. So check for presence in the
manifest and, for now, assert that that matches the isBanned flag. Soon
the isBanned flag can be removed.
2019-06-23 10:19:00 -07:00
Eric House
99eafd9c60 add retain()/release()
Seems to work but needs testing!
2019-06-23 10:19:00 -07:00
Eric House
16fccca3a8 up version code to try another gps release 2019-06-23 10:19:00 -07:00
Eric House
d925981666 add new Variant for github & sourceforge releases
and log permission check results
2019-06-23 10:19:00 -07:00
Eric House
acbbb7fc88 one less malloc 2019-06-23 10:19:00 -07:00
Eric House
0a249c8595 tweak UI with longer string 2019-06-23 10:19:00 -07:00
naofum
2c6f3f3794 Translated using Weblate (Japanese)
Currently translated at 75.9% (580 of 764 strings)
2019-06-23 10:19:00 -07:00
Eric House
8f51ee11df tweak string 2019-06-23 10:17:55 -07:00
Eric House
ffb768d75e don't capture lock stack in release builds 2019-06-23 10:17:55 -07:00
Eric House
937dd8081e unlock lock we won't be keeping
This might fix the occasional game permalock.
2019-06-23 10:17:55 -07:00
Eric House
7d8d584a85 fix a likely-fluke NPE with a test
It seems impossible for the menu to be getting update without init()
having been called, but that must be what happened. To check for null.
2019-06-23 10:17:55 -07:00
Eric House
4ba46e62f4 fix invite not coming up after perms warning dismissed
or when it's not shown at all because the not-again checkbox is checked
2019-06-23 10:17:55 -07:00
Eric House
f968994451 cleanup 2019-06-23 10:17:55 -07:00
Eric House
df3cab8c26 up version of NBSProxy lib 2019-06-23 10:17:55 -07:00
Eric House
da47316152 fix npe 2019-06-23 10:17:55 -07:00
Eric House
468da222de add not-again checkbox to remove-sms-from-game alert
Some people will decide to leave SMS comms in while I look for an
alternative. Maybe. Don't show them the same alert every time they open
the game. In the process removed what seemed to be a duplicate ivar.
2019-06-23 10:17:55 -07:00
Eric House
dfcf76f5cd refactor alerts code
Should be no change here, but the goal's to make it easier to mix
functionality, e.g. adding notagain checkbox to other types.
2019-06-23 10:17:55 -07:00
Eric House
a40c6f494f don't show sms-failed toast when permission is banned 2019-06-23 10:17:55 -07:00
Eric House
d31271e372 move constant 2019-06-23 10:17:55 -07:00
Eric House
712c61b9d5 add Overrides as part of sanity check 2019-06-23 10:17:55 -07:00
Eric House
2828744aa2 include name of game being deleted 2019-06-23 10:17:55 -07:00
Eric House
f8e840cf04 update web page (esp. fix style for device display) 2019-06-23 10:17:55 -07:00
Eric House
81fc21e0e5 cleanup 2019-06-23 10:17:55 -07:00
Eric House
dc9d05fc94 give new variant the right icons 2019-06-23 10:17:55 -07:00
Eric House
b8ed94b765 update changes log 2019-06-23 10:17:55 -07:00
Eric House
146d104e2b oops 2019-06-23 10:17:55 -07:00
Eric House
8456b9fd76 relay tracks variantCode int, not string 2019-06-23 10:17:55 -07:00
Eric House
6bc65476d0 add a case for Signal as default SMS app 2019-06-23 10:17:55 -07:00
Eric House
a093dae712 display the Banned alert from invite-choice dialog 2019-06-23 10:17:55 -07:00
Eric House
8cb53eb884 add non-mobile number if user confirms
Fix logic error that didn't proceed with the number-add in the
non-mobile case.
2019-06-23 10:17:55 -07:00
Eric House
9def95fed7 try various recipes for launching SMS app
There's no one way to launch an SMS app with a ready-to-send
invitation. So try the two that work on our two phone/app combinations,
iterating until startActivity() succeeds. The code's set up to have new
recipes added easily.
2019-06-23 10:17:55 -07:00
Eric House
390a59ee17 post a tip/warning when new invite-by-sms-app chosen 2019-06-23 10:17:55 -07:00
Eric House
8d3b9ac2d5 send an int code rather than a name 2019-06-23 10:17:55 -07:00
Eric House
3326fc90f2 warn when 'sms data' selected in build where it's banned 2019-06-23 10:17:55 -07:00
Eric House
c97905e11e more tweaks 2019-06-23 10:17:55 -07:00
Eric House
2ca85cc0b1 remove logging 2019-06-23 10:16:59 -07:00
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
Eric House
1505a443ac 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-06-23 10:13:31 -07:00
Eric House
e23129c0e7 always increment failure count on send failure 2019-06-23 10:13:31 -07:00
Eric House
5cb2be33d2 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-06-23 10:13:31 -07:00
Eric House
e13d90409c 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-06-23 10:13:31 -07:00
Eric House
997aad84ff 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-06-23 10:13:31 -07:00
Eric House
54fb43ec62 double scan progress time
Since the BT stuff tends to timeout late when failing, this looks better.
2019-06-23 10:13:31 -07:00
Eric House
de9b0851d5 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-06-23 10:13:31 -07:00
naofum
f8537c6a88 Translated using Weblate (Japanese)
Currently translated at 74.3% (568 of 764 strings)
2019-06-23 10:13:31 -07:00
Eric House
989f7524d6 unselect any game moved into a closed group
Fixes GameOver game moved via "archive" checkbox remaining selected
2019-06-23 10:12:05 -07:00
Eric House
76957fe4eb 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-06-23 10:12:05 -07:00
Eric House
682501814b put GameOver view layout into a ScrollView
When device in landscape the archive box is otherwise unreachable on a
four-player game
2019-06-23 10:12:05 -07:00
Eric House
dc1431fd08 make GamePtr AutoCloseable and use where possible 2019-06-23 10:12:05 -07:00
Eric House
c706205cd1 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-06-23 10:12:05 -07:00
Eric House
e56770ea29 include stack of lock owner when logging failure to lock 2019-06-23 10:12:05 -07:00
Eric House
ceb68b9787 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-06-23 10:12:05 -07:00
Eric House
58882fe52f make text in new GameOver alert bigger
To match how it was when using the system-provided view.
2019-06-23 10:12:05 -07:00
Eric House
25509c729a 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-06-23 10:12:05 -07:00
Eric House
babca4a696 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-06-23 10:12:05 -07:00
Eric House
0ad9b0f891 up copyright year 2019-06-23 10:12:05 -07:00
Eric House
fce0eb2acc add git rev to crashlytics reports 2019-06-23 10:12:05 -07:00
Eric House
0cd0bd4c03 plug leak 2019-06-23 10:12:05 -07:00
Eric House
2afce586a3 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-06-23 10:12:05 -07:00
Eric House
601eaf395c don't create threads we won't use 2019-06-23 10:12:05 -07:00
Eric House
7ba2f92645 null listener thread ref so will be restarted
Once it died it stayed dead: bad.
2019-06-23 10:12:05 -07:00
Eric House
ef602baa18 cleanup 2019-06-23 10:12:05 -07:00
Eric House
7ccb576214 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-06-23 10:12:05 -07:00
Eric House
438e134870 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-06-23 10:12:05 -07:00
Eric House
136fa6ac7d remove some logging 2019-06-23 10:12:05 -07:00
Eric House
842509d84a remove methods overridden just for logging
looks like I've fixed the crash I wanted to diagnose.
2019-06-23 10:12:05 -07:00
Eric House
29661d2a7e 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-06-23 10:12:05 -07:00
Eric House
34b462b97c pass context and use to post lock-failure toast 2019-06-23 10:12:05 -07:00
Eric House
888109ce4e tweak/reduce logging 2019-06-23 10:12:05 -07:00
Eric House
c4d21b7b59 move constant from XWApp to build.gradle 2019-06-23 10:12:05 -07:00
Eric House
781da8ccb6 avoid NPE (and log to root-cause it later) 2019-06-23 10:12:05 -07:00
Eric House
37085b0ba1 ensure writer gets run every time OS schedules via onHandleWork() 2019-06-23 10:12:05 -07:00
Eric House
130487f7df remove some logging 2019-06-23 10:12:05 -07:00
Eric House
122b270025 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-06-23 10:12:05 -07:00
Eric House
6193c376db move invite button above button bar.
(It's more frequently used)
2019-06-23 10:12:05 -07:00
Eric House
2a5c3b11a0 add context comment for new string 2019-06-23 10:12:05 -07:00
Eric House
4ce20a49a6 cleanup via new macro 2019-06-23 10:10:49 -07:00
Eric House
1e6fdd1f70 remove logging 2019-06-23 10:10:49 -07:00
Eric House
0a50a721dd fix malformed xml string
Weblate bug?
2019-06-23 10:10:49 -07:00
Eric House
aab36efdac 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-06-23 10:10:00 -07:00
Eric House
0ad21783b8 add rowid to NoSuchGameException 2019-06-23 10:10:00 -07:00
Eric House
8ff23294e6 fix NPE (and tweak logging) 2019-06-23 10:10:00 -07:00
Eric House
fd122148b8 add flavor to toasted got-fcm message
So I can tell the apps apart
2019-06-23 10:10:00 -07:00
Eric House
d067b867a2 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-06-23 10:10:00 -07:00
Eric House
b198091490 make script executable 2019-06-23 10:10:00 -07:00
Eric House
ac5cbea83f display latest FCM receipt as part of netstats for relay 2019-06-23 10:10:00 -07:00
Eric House
c67bda8683 use a constant jobID for enqueueWork()
That each VM instance had a different id might be why I was
crashing. We'll see.
2019-06-23 10:10:00 -07:00
Eric House
41bcaa69cb fix so success detected from new API 2019-06-23 10:10:00 -07:00