Commit graph

9927 commits

Author SHA1 Message Date
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