Commit graph

9859 commits

Author SHA1 Message Date
Eric House
4990d31eda fix assertion on emulator 2016-12-31 14:21:00 -08:00
Eric House
f88ac1a9d0 another changelog tweak 2016-12-30 20:38:24 -08:00
Eric House
5260c3de90 catch -dbg build up with SDK 23 2016-12-30 20:12:23 -08:00
Eric House
250f4b0139 get rid of raw-string toast error messages
They were hacks for debugging SMS early on, probably infrequently
seen. Instead post messages. BUT: they aren't being received because of
how listeners get cleared in onPause(). Needs to be fixed, but there's
no harm in having them dangle for now.
2016-12-30 20:11:02 -08:00
Eric House
62aabc8cbc replace %{d,s} in german strings 2016-12-30 19:44:41 -08:00
Eric House
04a39f9251 force re-layout of board when toolbar populated
Sometimes when a new game is created the board winds up with the toolbar
drawn over the tray. That's because when it was laid out the game wasn't
running yet and so none of the toolbar buttons was enabled, giving the
toolbar a height of 0. So now the first time the updated toolbar reports
that at least one button is enabled we force the board to lay itself out
again.
2016-12-30 13:53:18 -08:00
Eric House
f488e727f8 fix invitations!
Little hack to dismiss a game when the invitations dialog was cancelled
broke invitations altogether. Revert that change, and simply check on
getting focus whether all players are present; if they're not, put up
the "invite or wait" dialog. This is a big change, but in 10 minutes of
testing I can't get the wrong thing to happen.
2016-12-30 13:09:51 -08:00
Eric House
ee042ff3cd better test for GSM phone
This one doesn't think a wifi-only tablet can send SMS messages.
2016-12-30 11:40:15 -08:00
Eric House
e5166a62e8 tweak string 2016-12-30 11:02:04 -08:00
Eric House
39828bfaf8 fix problems with localized files
Remove strings that no longer exist in English, add missing "other"
quantities in Japanese (taking a guess from context that it's ok to use
generic counters), and in a couple of languages fix typos in format
specifiers that would have caused crashes.
2016-12-30 11:01:51 -08:00
Eric House
fea31e9e3b fix script checking localized strings
It wasn't even checking all languages. Now it does, lets you specify
which ones if a subset's desired, and differentiates between sets of
format specifiers mismatching in a way that'll cause a
crash (e.g. expecting int in one and string in another) and just having
some missing.
2016-12-30 09:57:33 -08:00
Eric House
83fbbdc3ee fix compile-time warning
Flag has a different name in clang. Debug-only, so no risk.
2016-12-30 06:49:52 -08:00
Eric House
096fff1f4c Merge branch 'android_translate' into android_release 2016-12-30 06:49:06 -08:00
Eric House
f5db80e43f Merge android_translate
merge remote-tracking branch 'weblate/android_translate' into
android_translate
2016-12-30 06:42:14 -08:00
Eric House
7b30a0229a add button to launch BT settings
Let's make it easier to add to the set of available BT devices from the
place where the user sees the need. TODO: update the descriptive text,
but not this release since it'll break existing localizations.
2016-12-30 06:35:45 -08:00
Eric House
74d1967f23 cleanup from code review
Mostly removing TAG where isn't being used in the file, but other tweaks
too, none of which changes executed code.
2016-12-29 21:07:00 -08:00
Eric House
4cdc917cf5 tweak changelog 2016-12-29 17:27:33 -08:00
Eric House
c0784fe8b7 fix crash on Android 2.3
Channel wasn't a thing back then. Catch the ClassNotFound exception and
set the same boolean as when permissions aren't available (in manifest),
which means nothing else tries to run.
2016-12-29 17:17:27 -08:00
Eric House
531f30aae8 cleanup: use import more for new class 2016-12-28 13:52:04 -08:00
Eric House
497567ac2d check items newly imported from contacts
I figure if you just brought it in it's probably to send an invitation
to it, and this is how it worked before the refactoring anyway.
2016-12-27 13:23:39 -08:00
Eric House
0fc528a074 cleanup up logging 2016-12-27 13:22:37 -08:00
Eric House
57c71f4c82 invitations: disable remove when nothing checked
Subclass needs to do this one: overrides tryEnable() to handle its
button-bar buttons.
2016-12-27 11:46:15 -08:00
Eric House
216dc757ad up version strings and changelog for release 2016-12-27 11:17:03 -08:00
Eric House
f989212926 close pending game's board when invite cancelled
Add cancelled notification to invite choices dialog. Look for that in
board delegate and close the game. Makes the inviting experience more
consistent, the goal being that you never look at a game that's missing
players without some intervening dialog preventing you from trying to
play.
2016-12-26 16:06:44 -08:00
Eric House
84e8f0927c invitations cleanup: layout and reinvite
Fix a layout to be centered when one string not displayed. Fix to
pre-check by default the most recent device choice when re-inviting.
2016-12-26 15:21:10 -08:00
Eric House
f9f872695d improve checkbox handling in invite dialogs
Use an array of actual objects rather than indices, and add an equals()
method, so checkbox status can survive changes in the set of available
items and even be reproduced when the objects backing them change (as
happens after a new BT scan finishes.)
2016-12-24 12:51:39 -08:00
Joan Montané
b59d7bc3c9 Translated using Weblate (Catalan)
Currently translated at 70.1% (523 of 746 strings)
2016-12-24 15:44:15 +01:00
Eric House
92029b2443 fix to build with CURSES_ONLY flag 2016-12-22 08:57:54 -08:00
Eric House
e945bde663 Merge branch 'android_branch' into android_translate 2016-12-21 08:29:06 -08:00
Eric House
432b738257 wifi: move setting into build.xml
Control whether wifi direct is enabled from build.xml, a file that's
already different for the two variants. The point here is to do a
release with permissions changes but without having to fix everything
wrong with wifi direct.
2016-12-21 08:25:57 -08:00
Eric House
ecdec9cfd8 build system change for sdk version 23 2016-12-21 07:48:19 -08:00
Eric House
68104bcf83 remove logging 2016-12-19 22:21:51 -08:00
Eric House
994de23145 perms: use stored pairs when don't have
If user hasn't granted READ_CONTACTS permission, use the pairing of
numbers/names that's come from Contacts via the SMS invitation dialog.
Sometimes it'll have names for numbers that arrived via invitations. Do
some cleanup while at it to prevent stored BT mac addresses from being
looked up as phone numbers.
2016-12-19 22:11:26 -08:00
Eric House
f8ec19b35c perms: use remove to avoid leak 2016-12-19 21:14:45 -08:00
Eric House
2a1c7de18b permissions: get rid of instance variables
I think the params mechanism for DlgDelegate does the same thing better.
2016-12-19 06:48:13 -08:00
Eric House
f199aef738 permissions: ask for READ_CONTACTS
On launching SMS invite dialog, ask for READ_CONTACTS permission. Where
it's needed, though, is for the user-invisible process of translating
phone numbers to names (not launching the Contacts app via an
Intent). This just seems like the best place to ask since the user's
thinking about contacts and phone numbers.
2016-12-19 06:34:20 -08:00
Eric House
09188bc704 Merge branch 'android_branch' into android_sdk_23_take_3 2016-12-17 16:38:39 -08:00
Eric House
f59918bf50 cleanup: remove unnecessary methods
InviteDelegate superclass now tracks whether something is checked,
though it's not doing as well as subclasses did before, e.g. when SMS
would uncheck everything but a newly added contact.
2016-12-17 16:36:17 -08:00
Eric House
29afb19cb4 permissions: ask when opening SMS game
Add post-open test for SMS and then ask for SMS permission, giving
rationale if the OS says I should. Meant adding a new interface for
rationales and wiring that in. It's a bit spaghetti and I may think of a
cleaner way later.
2016-12-16 21:04:15 -08:00
Eric House
3a53abce52 add params option to showOKOnlyDialogThen 2016-12-16 20:57:30 -08:00
Eric House
52c2973d8f remove compile-time switch
SMS rocks and I won't be removing it.
2016-12-16 07:44:55 -08:00
Eric House
5f6cf35d93 permissions: move opening game to BoardDelegate
When opening a game that sends via SMS, check if it has permission and
offer to remove the config if it doesn't, removing a similar check from
pre-opening code. (Here it'll catch e.g. games opened from the
GameConfig process.) Sends/receives without SMS permission are already
caught by existing catch{} blocks, so there's no crash.
2016-12-16 07:35:30 -08:00
Eric House
e9d0b61254 Merge branch 'android_branch' into android_sdk_23_take_3 2016-12-15 08:10:06 -08:00
Eric House
ca0ee429bb logging and string changes 2016-12-15 08:09:28 -08:00
Eric House
9503491890 invitations: tweak file and class names
No behavior changes, just cleanup
2016-12-15 08:02:06 -08:00
Eric House
9f7975d471 rename file
And change something that was using custom layout for just its checkbox
to just use a checkbox.
2016-12-15 07:28:44 -08:00
Eric House
f8bba60798 invitations: track multiple per device in superclass 2016-12-15 07:10:54 -08:00
Eric House
502888ee03 wifi: add reset() that will help troubleshoot 2016-12-15 06:44:40 -08:00
Eric House
721ee381a5 wifi: fix invitation dialog 2016-12-15 06:40:45 -08:00
Eric House
4f43acf9cb remove unused variable 2016-12-14 08:16:05 -08:00
Eric House
cd14001db1 start rewrite of invitation dialogs
Moving stuff into superclass and trying in general to simplify
things. BT and SMS invitation work, but the option to have more than one
player per device isn't available. RelayID invitation is a mess, but was
before I think.  WiDir invitation crashes in assert because I can't
debug it on this branch. Lots of work and cleanup still required.
2016-12-14 08:14:00 -08:00
Bernard Massot
d85733f97f Translated using Weblate (French)
Currently translated at 100.0% (746 of 746 strings)
2016-12-13 15:44:46 +01:00
PapaPedro
cc2594986f Translated using Weblate (Czech)
Currently translated at 14.7% (110 of 746 strings)
2016-12-13 03:44:23 +01:00
Eric House
c398af2ac9 perms: ask for the set needed to open a game
rewrite perms23 class to use Builder pattern, making it easier to pass
more than one required permission. Use that (with hard-coded set for
now) to check and ask for permissions a game needs to communicate. Offer
to remove the comms methods the user doesn't want to permit (but that's
not implemented yet.)
2016-12-11 20:54:24 -08:00
Eric House
dfb22c13fa make gradle's suggested config changes 2016-12-11 13:33:57 -08:00
Eric House
36a0737654 fix ant build for sdk 23
pull in new version of support library .jar
2016-12-11 13:33:06 -08:00
Bernard Massot
980ac33604 Translated using Weblate (French)
Currently translated at 100.0% (746 of 746 strings)
2016-12-11 11:33:30 +01:00
Eric House
d136dd65e6 check phone permission before putting up sms choice
First, needed to remove some state caching since though a non-SMS
phone will never become one my ability to ask changes over time. Then
changed population of communication options to first ask for the
permission needed in order to find out what's supported, then to find
out what's supported via methods that will return false without
permission. Can't think of a better way right now....
2016-12-10 16:06:18 -08:00
Eric House
3389e928cc check for phone permission on boot to avoid crash
Some permission checks won't fall back to asking if it doesn't make
sense given what the user's doing at the time.
2016-12-10 15:08:09 -08:00
Eric House
39f08bd3d3 remove verbose flag 2016-12-10 14:58:24 -08:00
Eric House
bec5ad82c0 query before loading saved games too 2016-12-10 14:03:25 -08:00
Eric House
a3ccce00fa starting requesting permissions
Before writing to storage, ask permission. This adds basic ability to
query and route the OS's callback back to the code that asked.
2016-12-10 13:49:51 -08:00
Eric House
b6194f6986 Merge remote-tracking branch 'maidu2/android_branch' into android_sdk_23_take_3 2016-12-09 22:01:48 -08:00
Eric House
a1e4d4da0e pass TAG to printStack() and logex
So they'll show up when using logcat filtering
2016-12-09 07:34:51 -08:00
Eric House
25c2fd16ef use cmd strings; log discovery running or not
Add a compile-time option to send commands in json as strings rather
than ordinals (ints) for easier reading of logs. And log/keep track of
when discovery's turned off or on in case it's useful for making all
this work.
2016-12-09 07:20:27 -08:00
Eric House
2b120959ae new debug option for games list title: connection method 2016-12-06 19:39:14 -08:00
Eric House
3d5479565e wifi: send for open game too
In handling resend for a newly available transport, if the lock can't be
obtained see if that's because the game's currently open and if so post
to its thread.
2016-12-06 09:03:33 -08:00
Eric House
2c6ce5c1a8 interface name change only 2016-12-06 08:20:58 -08:00
Eric House
dc2cd239a1 wifi: send pending messages on getting connected
Each time we get a socket to a peer, try sending all pending wifi direct
messages. It's a hack, but trying to send isn't that expensive and the
experience is much improved.
2016-12-06 08:15:09 -08:00
Eric House
6eb2a7b71b wifi: pay attention to wifi being enabled
Don't keep trying to connect if wifi's off, and start trying when it's
turned on.
2016-12-05 20:23:52 -08:00
Eric House
19bb3ef7dd check standalone before iterating on addresses
New crash deleting non-networked games: needed to test first.
2016-12-05 07:35:54 -08:00
Eric House
9c14e0e858 rename method: sendResult -> postEvent 2016-12-05 07:24:25 -08:00
Eric House
aa420ce4d1 notify remote when BT game deleted 2016-12-05 07:12:22 -08:00
Eric House
ef0eeaae2e improve dead game notification
When contacting opponents, iterate over opponent addresses rather than
information cached in the summary. Start implementing for BT, but that
needs more work. Change enum names in WiDirService state machine.  P2p
opponent notification untested because apparently an open hotspot, which
you can't prevent devices from connecting to, breaks P2P connectivity.
2016-12-03 10:28:24 -08:00
Eric House
bc9baa2e79 wifi: don't crash when don't have permissions 2016-12-03 08:15:08 -08:00
Eric House
eecae536ec add missing log levels: was dropping before 2016-12-02 20:03:44 -08:00
Eric House
f9d352cb25 wifi: notify when game deleted 2016-12-02 08:17:03 -08:00
Eric House
54ed327406 wifi: notify when game missing
Rewrite to use new XWPacket class that wraps JSONObject but could later
support a binary format, and reply with new message when packet arrives
for a game that does not exist. Code already present turns that into an
invitation to delete the game.
2016-12-01 07:48:03 -08:00
Eric House
54d02e0fb2 wifi: update status on first connect
And remove the hack pretending on lack of permission that support was
compiled out.
2016-12-01 06:11:51 -08:00
Eric House
bf83741393 track and log failure counts
Later will likely want to restart when get above some threshold
2016-11-30 07:55:25 -08:00
Eric House
0a26496e73 wifi: tweaks
fix race condition in accept thread; only call wifimgr.connect() on
guest side. Connectivity now works reliably if the guest starts, or is
restarted, when the group owner is running. If owner is restarted the
guest seems never to connect (without restart.)
2016-11-30 07:06:59 -08:00
Eric House
a686541f96 merge recent manifest changes 2016-11-30 06:58:56 -08:00
Eric House
a3bc4f0a75 fix compile error from merge 2016-11-28 20:21:40 -08:00
Eric House
0237403a26 Merge branch 'android_release' into android_branch
This will probably not compile...
2016-11-28 20:19:54 -08:00
Eric House
6171d9ce90 prep a quick-fix release, with string changes
Two crashes reported on the Google Play store in the 112 version have at
least easy work-arounds: catching exceptions and doing nothing. In both
cases that should be harmless, so assuming the causes are rare it's a
good move.
2016-11-28 20:02:38 -08:00
Eric House
f415cf22ca change strings for next release 2016-11-28 19:19:03 -08:00
Eric House
1a513e8b02 add a bit of logging 2016-11-28 07:40:09 -08:00
Eric House
2fa47f057d use TAG instead of class for logging
Moving to the traditional use of Log class, with TAG defined in every
class that logs. It's just easier to use all the facilities built into
logcat.
2016-11-27 21:24:21 -08:00
Eric House
49d75d5d91 converting to use standard TAG-based logging
First files done manually: add TAG to file and pass it rather than class
to log wrapper. Rest will be done with a script.
2016-11-27 21:22:51 -08:00
Eric House
97c1091d0c add TAG everywhere
results of running a script that adds TAG to every top-level class. It
compiles, but I'm not using them yet.
2016-11-22 22:10:05 -08:00
Eric House
927c181ccc rename variable
TAG has conventional meaning I'm about to take advantage of, so rename
the one variable that would conflict.
2016-11-22 21:46:42 -08:00
Eric House
b8844a0e2d rewrite connection logic
Make it a trivial state machine that implements Runnable and
ActionListener so it can be scheduled and notified easily. Removes a
bunch of code. Connecting still happens unreliably, but it should be
easier to tweak things now.
2016-11-22 19:28:10 -08:00
Eric House
bff03617e5 wifi: hide unused buttons
Refactoring isn't perfect. Need to hide in subclass buttons that other
subclasses assume.
2016-11-22 00:17:49 -08:00
Eric House
e0f0666b1c wifi: make invitations work
Add UI, minor thanks to recent refactoring, to allow invitations via
wifi direct. Uses a mapping of all currently known device mac addresses
to names, with only the latter shown to users. Works well, though
something I changed seems to have causes devices to start losing track
of their connections to each other.
2016-11-21 21:10:16 -08:00
Eric House
3f0bef48f6 refactor invite UI
In order that wifi direct invitation dialog isn't another near-copy of
an existing file move a bunch of stuff into the common superclass.
2016-11-21 20:54:29 -08:00
Eric House
a67f2205bb log thread starts/stops 2016-11-18 20:13:48 -08:00
Eric House
930146cf11 wifi tweaks
Show net status as failing when no sockets available, and notice when
they're closed.
2016-11-17 23:22:28 -08:00
Eric House
4389c63718 wifi: fix compile; do less work on release build
The group info stuff I'm polling for is used only to log interesting
information, so drop it.
2016-11-17 22:22:08 -08:00
Eric House
14c34f3e70 wifi: get rematch working
required hooking up invitations, so the user-visible part of that should
be easy to do once device names are being communicated.
2016-11-17 22:14:36 -08:00
Eric House
9cfbb3c45b wifi: add status update on successful write 2016-11-17 20:17:13 -08:00