Commit graph

9773 commits

Author SHA1 Message Date
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
Eric House
92029b2443 fix to build with CURSES_ONLY flag 2016-12-22 08:57:54 -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
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
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