diff --git a/telephony/java/android/telephony/data/DataCallResponse.java b/telephony/java/android/telephony/data/DataCallResponse.java
index 8cdad3f..da51c86 100644
--- a/telephony/java/android/telephony/data/DataCallResponse.java
+++ b/telephony/java/android/telephony/data/DataCallResponse.java
@@ -116,7 +116,6 @@
      */
     public int getSuggestedRetryTime() { return mSuggestedRetryTime; }
 
-
     /**
      * @return The unique id of the data connection.
      */
@@ -183,16 +182,57 @@
            .append(" active=").append(mActive)
            .append(" type=").append(mType)
            .append(" ifname=").append(mIfname)
-           .append(" mtu=").append(mMtu)
            .append(" addresses=").append(mAddresses)
            .append(" dnses=").append(mDnses)
            .append(" gateways=").append(mGateways)
            .append(" pcscf=").append(mPcscfs)
+           .append(" mtu=").append(mMtu)
            .append("}");
         return sb.toString();
     }
 
     @Override
+    public boolean equals (Object o) {
+        if (this == o) return true;
+
+        if (o == null || !(o instanceof DataCallResponse)) {
+            return false;
+        }
+
+        DataCallResponse other = (DataCallResponse) o;
+        return this.mStatus == other.mStatus
+                && this.mSuggestedRetryTime == other.mSuggestedRetryTime
+                && this.mCid == other.mCid
+                && this.mActive == other.mActive
+                && this.mType.equals(other.mType)
+                && this.mIfname.equals(other.mIfname)
+                && mAddresses.size() == other.mAddresses.size()
+                && mAddresses.containsAll(other.mAddresses)
+                && mDnses.size() == other.mDnses.size()
+                && mDnses.containsAll(other.mDnses)
+                && mGateways.size() == other.mGateways.size()
+                && mGateways.containsAll(other.mGateways)
+                && mPcscfs.size() == other.mPcscfs.size()
+                && mPcscfs.containsAll(other.mPcscfs)
+                && mMtu == other.mMtu;
+    }
+
+    @Override
+    public int hashCode() {
+        return mStatus * 31
+                + mSuggestedRetryTime * 37
+                + mCid * 41
+                + mActive * 43
+                + mType.hashCode() * 47
+                + mIfname.hashCode() * 53
+                + mAddresses.hashCode() * 59
+                + mDnses.hashCode() * 61
+                + mGateways.hashCode() * 67
+                + mPcscfs.hashCode() * 71
+                + mMtu * 73;
+    }
+
+    @Override
     public int describeContents() {
         return 0;
     }
diff --git a/telephony/java/android/telephony/data/InterfaceAddress.java b/telephony/java/android/telephony/data/InterfaceAddress.java
index 947d0ff..00d212a 100644
--- a/telephony/java/android/telephony/data/InterfaceAddress.java
+++ b/telephony/java/android/telephony/data/InterfaceAddress.java
@@ -78,6 +78,23 @@
      */
     public int getNetworkPrefixLength() { return mPrefixLength; }
 
+    @Override
+    public boolean equals (Object o) {
+        if (this == o) return true;
+
+        if (o == null || !(o instanceof InterfaceAddress)) {
+            return false;
+        }
+
+        InterfaceAddress other = (InterfaceAddress) o;
+        return this.mInetAddress.equals(other.mInetAddress)
+                && this.mPrefixLength == other.mPrefixLength;
+    }
+
+    @Override
+    public int hashCode() {
+        return mInetAddress.hashCode() * 31 + mPrefixLength * 37;
+    }
 
     @Override
     public int describeContents() {
