Commit graph

11250 commits

Author SHA1 Message Date
Eric House
d3f4a729d7 remove dead code 2019-06-23 10:20:16 -07:00
Eric House
762e701a00 allow long-tap lookup of pending words too
When a word's been formed as part of the current turn, but not yet
committed, allow long-tap to trigger an offer to look it up online same
as for already-committed words. Allows checking the legality of
potential plays AND figuring WTF the hint feature just suggested.
2019-06-23 10:20:16 -07:00
Eric House
8f6026e633 add empty invitee list string for Bluetooth too 2019-06-23 10:20:16 -07:00
Eric House
c5efeb283a fix invite dialogs for landscape layout
Scrolling's needed in some cases, and you can't easily put a ListView
inside a ScrollView. So replace the ListView with a LinearLayout whose
contents I manage manually, and wrap the whole layout in a ScrollView.
2019-06-23 10:20:16 -07:00
Eric House
054ac325bb fix invite-how alert not scrolling
By setting a custom view I wasn't using I broke scrolling of the
AlertDialog's list view which I was using. Known bug apparently....
2019-06-23 10:20:16 -07:00
Eric House
84dc14ff78 get rid of DispatchNotify
All it did was forward intent's data to MainActivity. Only question is
whether making MainActivity singleTask is a problem. We'll see.
2019-06-23 10:20:16 -07:00
Eric House
c82081521f cleanup 2019-06-23 10:20:16 -07:00
Eric House
71af4d3187 make it a single thread 2019-06-23 10:20:16 -07:00
Eric House
bade9f6b40 move SMSPhoneInfo into its own class/file 2019-06-23 10:20:16 -07:00
Eric House
266c61f84b make a common superclass 2019-06-23 10:20:16 -07:00
Eric House
1c2a0ed994 Rename SMSService NBSProxy, and make it not a service
Just keep a thread for each
phone we're sending to or receiving from, and pass them packets and
other things to send or (incoming case) process. So far the threads
don't die, but they will soon once there's nothing in their queues. Just
need to be sure there's no racing there.

This is to work around the frequent failure of the OS to pass enqeued work
into the service within a reasonable amount of time (I expect seconds, but see
delays of minutes or even hours.)
2019-06-23 10:20:16 -07:00
Eric House
fe96a72a3e use mutex to synchronize access to smsproto apis
I'm seeing my simultaneous access assert fail, so might as well break
fix it the foolproof way. It's background threads only that are calling
this stuff on Android so blocking them shouldn't hurt.
2019-06-23 10:20:16 -07:00
Eric House
808a896fbf up strings for release
This is just to try yet again to get past the play store console's
past-permissions bug
2019-06-23 10:20:16 -07:00
Eric House
1ed9ad4aac reflect bt receipts in how long since saw device
Made no sense to use explicit scans only since typically you only do
that to get things going.
2019-06-23 10:20:16 -07:00
Eric House
06b9598414 add makefile for new wordlist 2019-06-23 10:20:16 -07:00
Eric House
7e9f75de0a remove separate marking of permissions as banned
It's enough to check manifest for their presence
2019-06-23 10:20:16 -07:00
Eric House
ed066f99a2 Up version code and string to try a new play store release 2019-06-23 10:20:16 -07:00
Eric House
fd0ec1d131 move SMSReceiver from main manifest to the others
Theory is that the store's buggy site is presenting its
banned-permissions interface because it's detecting a Receiver that
requires SMS_RECEIVE permission even though the permissions themselves
aren't there any more.
2019-06-23 10:20:16 -07:00
Eric House
70123e2cd3 up version name (but not code)
This will NOT be released on Google Play, so no need to up code.
2019-06-23 10:20:16 -07:00
Eric House
71e8132f55 fix broken symlink 2019-06-23 10:20:16 -07:00
Eric House
ffb3b19aef fix build script for new Play Store variant name 2019-06-23 10:20:16 -07:00
Eric House
c1c2c415dd changelog and cleanup 2019-06-23 10:20:16 -07:00
Eric House
1522463a3a fix multi-message aspect of smsproto
passes --run-sms-test now, and works on Android occasionally combining messages.
2019-06-23 10:20:16 -07:00
Eric House
9c1e7ac154 cut logging in test app 2019-06-23 10:20:16 -07:00
Eric House
e9bcf6a476 always respect user's local player name 2019-06-23 10:20:16 -07:00
Eric House
53d2aa8023 fix a couple of random crashes
a race condition and a misunderstanding
2019-06-23 10:20:16 -07:00
Eric House
3d5b4017e5 add useful stuff to build-info.txt inside .apk 2019-06-23 10:20:16 -07:00
Eric House
0f9fd24cb7 try to address one-time assert
and remove it from shipping build
2019-06-23 10:20:16 -07:00
Eric House
92a30249a6 show the stalled-service alert based on pref
Allow users to turn the notification on; otherwise skip it. And set
the default on/off based on DEBUG type of build.
2019-06-23 10:20:16 -07:00
Eric House
1b84878930 add a bool resource matching BuildConfig.DEBUG
I want to be able to have some boolean prefs default based on whether
it's a DEBUG build.
2019-06-23 10:20:15 -07:00
Eric House
d25041e8a0 fix null procptr crash in jni
I can't reproduce this, but while testing recovery from DatagramSocket
recreation in RelayService got enough to know that somehow a timer's
procptr's not set. So test before calling, and log instead of crashing.
2019-06-23 10:20:15 -07:00
Eric House
36cc181a5e get another DatagramSocket when ours goes bad
Fix longstanding bug triggered by something as simple as putting device
into and out of airplane mode. Once the class-variable socket was
created it was never replaced. Now respond to exceptions that mean it's
useless and set it to null so existing logic will recreate it.
2019-06-23 10:20:15 -07:00
Eric House
4354cbdc4f tweaks to logging and imports; should have no effect 2019-06-23 10:20:15 -07:00
Eric House
52891e8391 report inability to get locks in travis debug builds 2019-06-23 10:20:15 -07:00
Eric House
dbcec41450 track all pending service Intents; warn of stalls
When enqueuing Intents for any of the three services, cache the
Intent. When onHandleWork() is called, remove the equivalent cached
intent. Then periodically check for intents that have been stored for
more than 60 seconds, and post a Notification alerting user to
stall. The user will likely have noticed that messages aren't flowing,
so this will simply explain the problem. Includes an "email author"
button.
2019-06-23 10:20:15 -07:00
Eric House
7b04f8d4ed cleanup and refactor
Move some work into superclass where instrumentation can be added to
greater effect. And remove from BTService an earlier attempt (at stall
detection.)
2019-06-23 10:20:15 -07:00
Eric House
97a3c3a2d8 refactor: new constructor for common case 2019-06-23 10:20:15 -07:00
Eric House
0728d06c4d make msgNo reflect srcID, not channelNo
It's more useful if it's per-device unique within a game. (Just used for
debugging now, so no impact on anything.)
2019-06-23 10:20:15 -07:00
Eric House
c4bba7db74 additions for debugging
toward tracking down relay stalls, log a bit more in resend process and
add UI to support an option where there's no reliance on
polling (i.e. FCM only)
2019-06-23 10:20:15 -07:00
Eric House
f7444785ab replace assert with logging 2019-06-23 10:19:01 -07:00
Eric House
577fd3e560 Wait for ACK to remove stored message
Bringing in a change that's been on the production relay for a while but
apparently didn't pass tests locally. Now it does.
2019-06-23 10:19:01 -07:00
Eric House
da917c35f5 apply ordering and limit correctly 2019-06-23 10:19:01 -07:00
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