diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DBUtils.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DBUtils.java index 11f9bd75a..5ac2fc34c 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DBUtils.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DBUtils.java @@ -49,6 +49,7 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; +import java.io.Serializable; import java.nio.channels.FileChannel; import java.sql.Timestamp; import java.util.ArrayList; @@ -446,13 +447,29 @@ public class DBUtils { return result; } - public static class SentInvitesInfo { + public static class SentInvitesInfo implements Serializable { public long m_rowid; private ArrayList m_means; private ArrayList m_targets; private ArrayList m_timestamps; private int m_cachedCount = 0; + @Override + public boolean equals( Object other ) + { + boolean result = null != other && other instanceof SentInvitesInfo; + if ( result ) { + SentInvitesInfo it = (SentInvitesInfo)other; + result = it.m_rowid == m_rowid + && it.m_means.equals(m_means) + && it.m_targets.equals(m_targets) + && it.m_timestamps.equals(m_timestamps) + && it.m_cachedCount == m_cachedCount; + } + // Log.d( TAG, "equals() => %b", result ); + return result; + } + private SentInvitesInfo( long rowID ) { m_rowid = rowID; m_means = new ArrayList(); diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgState.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgState.java index 3de4bc157..165e78760 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgState.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgState.java @@ -100,7 +100,7 @@ public class DlgState implements Parcelable { DlgState other = (DlgState)it; result = other != null && m_id.equals(other.m_id) - && m_msg.equals(other.m_msg) + && ((null == m_msg) ? (null == other.m_msg) : m_msg.equals(other.m_msg)) && m_posButton == other.m_posButton && m_negButton == other.m_negButton && m_action == other.m_action @@ -157,7 +157,10 @@ public class DlgState implements Parcelable { DlgState newState = DlgState.CREATOR.createFromParcel(parcel); Assert.assertFalse(newState == this); - Assert.assertTrue(this.equals(newState)); + if ( !this.equals(newState) ) { + Log.d( TAG, "restore failed!!: %s => %s", this, newState ); + Assert.fail(); + } } } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/GameSummary.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/GameSummary.java index 738b66a52..ec4f2a243 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/GameSummary.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/GameSummary.java @@ -439,7 +439,7 @@ public class GameSummary implements Serializable { Log.ex( TAG, ex ); } } - Log.i( TAG, "getStringExtra(%s) => %s", key, result ); + // Log.i( TAG, "getStringExtra(%s) => %s", key, result ); return result; }