Merge branch 'android_branch' into android_groups

This commit is contained in:
Eric House 2012-11-20 07:02:27 -08:00
commit 48dd3bb72e
7 changed files with 43 additions and 22 deletions

View file

@ -22,7 +22,7 @@
to come from a domain that you own or have control over. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.eehouse.android.xw4"
android:versionCode="47"
android:versionCode="48"
android:versionName="@string/app_version"
>

View file

@ -5,13 +5,9 @@
</style>
</head>
<body>
<b>Crosswords 4.4 beta 55 release</b>
<b>Crosswords 4.4 beta 56 release</b>
<ul>New with this release
<li>Use "Google Cloud Messaging" for <em>much</em> faster relay move
notifications</li>
<li>Fix crashes on Kindle Fire</li>
</ul>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_version">4.4 beta 55</string>
<string name="app_version">4.4 beta 56</string>
</resources>

View file

@ -1233,11 +1233,20 @@
encodings for the greater-than and less-than symbols which
are not legal in xml strings.)-->
<string name="invite_htmf">\u003ca href=\"%1$s\"\u003ETap
here\u003c/a\u003E (%1$s) to accept my invitation and join this
game.\u003cbr\u003E \u003ca
href=\"http://eehouse.org/market_redir.php\"\u003E Tap
here\u003c/a\u003E (http://eehouse.org/market_redir.php) to
install Crosswords if you haven\'t already.</string>
here\u003c/a\u003E (or the raw link below) to accept my invitation and
join this game.
\u003cbr \\\u003E
\u003cbr \\\u003E
(raw link: %1$s)
\u003cbr \\\u003E
\u003cbr \\\u003E
\u003ca href=\"http://eehouse.org/market_redir.php\"\u003E Tap
here\u003c/a\u003E (or the raw link below) to
install Crosswords if you haven\'t already.
\u003cbr \\\u003E
\u003cbr \\\u003E
(raw link: http://eehouse.org/market_redir.php)
</string>
<!-- This is the body of the text version of the invitation. A URL
is created with parameters describing the game and

View file

@ -542,10 +542,12 @@ public class DBUtils {
synchronized( s_dbHelper ) {
SQLiteDatabase db = s_dbHelper.getReadableDatabase();
String[] columns = { ROW_ID };
String selection = DBHelper.ROOMNAME + "='" + nli.room + "' AND "
+ DBHelper.INVITEID + "='" + nli.inviteID + "' AND "
+ DBHelper.DICTLANG + "=" + nli.lang + " AND "
+ DBHelper.NUM_PLAYERS + "=" + nli.nPlayers;
String selection =
String.format( "%s='%s' AND %s='%s' AND %s=%d AND %s=%d",
DBHelper.ROOMNAME, nli.room,
DBHelper.INVITEID, nli.inviteID,
DBHelper.DICTLANG, nli.lang,
DBHelper.NUM_PLAYERS, nli.nPlayers );
Cursor cursor = db.query( DBHelper.TABLE_NAME_SUM, columns,
selection, null, null, null, null );
if ( 1 == cursor.getCount() && cursor.moveToFirst() ) {
@ -557,10 +559,14 @@ public class DBUtils {
return result;
}
public static boolean isNewInvite( Context context, Uri data )
public static long getRowIDForOpen( Context context, Uri data )
{
long rowid = ROWID_NOTFOUND;
NetLaunchInfo nli = new NetLaunchInfo( data );
return null != nli && -1 == getRowIDForOpen( context, nli );
if ( null != nli ) {
rowid = getRowIDForOpen( context, nli );
}
return rowid;
}
public static String[] getRelayIDs( Context context, boolean noMsgs )

View file

@ -29,6 +29,8 @@ import android.os.Bundle;
import java.util.HashSet;
import junit.framework.Assert;
import org.eehouse.android.xw4.jni.GameSummary;
public class DispatchNotify extends Activity {
public static final String RELAYIDS_EXTRA = "relayids";
@ -63,12 +65,20 @@ public class DispatchNotify extends Activity {
mustLaunch = true;
}
} else if ( null != data ) {
if ( DBUtils.isNewInvite( this, data ) ) {
long rowid = DBUtils.getRowIDForOpen( this, data );
if ( DBUtils.ROWID_NOTFOUND == rowid ) {
if ( !tryHandle( data ) ) {
mustLaunch = true;
}
} else {
DbgUtils.logf( "DispatchNotify: dropping duplicate invite" );
GameSummary summary = DBUtils.getSummary( this, rowid );
if ( null != summary ) {
gameID = summary.gameID;
if ( !tryHandle( gameID ) ) {
mustLaunch = true;
}
}
}
}

View file

@ -52,11 +52,11 @@ public class NetLaunchInfo {
public NetLaunchInfo( Bundle bundle )
{
lang = bundle.getInt( LANG );
lang = bundle.getInt( LANG );
room = bundle.getString( ROOM );
inviteID = bundle.getString( INVITEID );
nPlayers = bundle.getInt( NPLAYERS );
m_valid = bundle.getBoolean( VALID );
nPlayers = bundle.getInt( NPLAYERS );
m_valid = bundle.getBoolean( VALID );
}
public NetLaunchInfo( Uri data )