Fixed the incorrect APN dedupling

Fixed that APN settings can't be merged when one APN
entry has MTU set, but the other doesn't. Also default
MTU unset value to 0 for backwards compatability.

Test: atest DataProfileManagerTest & Manual testing
Fix: 226563054
Change-Id: Ibf84657aa76d52c46ee45890a1af2c940553acd4
diff --git a/src/com/android/providers/telephony/TelephonyProvider.java b/src/com/android/providers/telephony/TelephonyProvider.java
index fea4ca8..45a2f0f 100644
--- a/src/com/android/providers/telephony/TelephonyProvider.java
+++ b/src/com/android/providers/telephony/TelephonyProvider.java
@@ -194,11 +194,6 @@
     private static final int URL_SIMINFO_SUW_RESTORE = 28;
     private static final int URL_SIMINFO_SIM_INSERTED_RESTORE = 29;
 
-    /**
-     * Default value for mtu_v4 and mtu_v6 if it's not set. Moved from PhoneConstants.
-     */
-    private static final int UNSPECIFIED_INT = -1;
-
     private static final String TAG = "TelephonyProvider";
     private static final String CARRIERS_TABLE = "carriers";
     private static final String CARRIERS_TABLE_TMP = "carriers_tmp";
@@ -488,8 +483,8 @@
                 WAIT_TIME_RETRY + " INTEGER DEFAULT 0," +
                 TIME_LIMIT_FOR_MAX_CONNECTIONS + " INTEGER DEFAULT 0," +
                 MTU + " INTEGER DEFAULT 0," +
-                MTU_V4 + " INTEGER DEFAULT " + UNSPECIFIED_INT + "," +
-                MTU_V6 + " INTEGER DEFAULT " + UNSPECIFIED_INT + "," +
+                MTU_V4 + " INTEGER DEFAULT 0," +
+                MTU_V6 + " INTEGER DEFAULT 0," +
                 EDITED_STATUS + " INTEGER DEFAULT " + UNEDITED + "," +
                 USER_VISIBLE + " BOOLEAN DEFAULT 1," +
                 USER_EDITABLE + " BOOLEAN DEFAULT 1," +
@@ -1763,10 +1758,10 @@
                     db.execSQL("ALTER TABLE " + CARRIERS_TABLE + " ADD COLUMN "
                             + ALWAYS_ON + " INTEGER DEFAULT 0;");
                     db.execSQL("ALTER TABLE " + CARRIERS_TABLE + " ADD COLUMN "
-                            + MTU_V4 + " INTEGER DEFAULT " + UNSPECIFIED_INT + ";");
+                            + MTU_V4 + " INTEGER DEFAULT 0;");
                     db.execSQL("ALTER TABLE " + CARRIERS_TABLE + " ADD COLUMN "
-                            + MTU_V6 + " INTEGER DEFAULT " + UNSPECIFIED_INT + ";");
-                    // Populate MTU_V4 with MTU values, using default value -1 instead of 0
+                            + MTU_V6 + " INTEGER DEFAULT 0;");
+                    // Populate MTU_V4 with MTU values
                     db.execSQL("UPDATE " + CARRIERS_TABLE + " SET " + MTU_V4 + " = "
                             + MTU + " WHERE " + MTU + " != 0;");
                 } catch (SQLiteException e) {
@@ -2129,9 +2124,9 @@
             whereArgs[i++] = values.containsKey(MTU) ?
                     values.getAsString(MTU) : "0";
             whereArgs[i++] = values.containsKey(MTU_V4) ?
-                    values.getAsString(MTU_V4) : String.valueOf(UNSPECIFIED_INT);
+                    values.getAsString(MTU_V4) : "0";
             whereArgs[i++] = values.containsKey(MTU_V6) ?
-                    values.getAsString(MTU_V6) : String.valueOf(UNSPECIFIED_INT);
+                    values.getAsString(MTU_V6) : "0";
 
             if (VDBG) {
                 log("deleteRow: where: " + where);