am c02a4a6a: am 1e86beae: am 82acf866: am a58acf30: Use INVALID_SUB_ID as default value for sub_id columns
* commit 'c02a4a6a2631abc379b4b46b92220d07fe0ab3e0':
Use INVALID_SUB_ID as default value for sub_id columns
diff --git a/src/com/android/providers/telephony/MmsSmsDatabaseHelper.java b/src/com/android/providers/telephony/MmsSmsDatabaseHelper.java
index a470bb1..7fd127c 100644
--- a/src/com/android/providers/telephony/MmsSmsDatabaseHelper.java
+++ b/src/com/android/providers/telephony/MmsSmsDatabaseHelper.java
@@ -42,6 +42,7 @@
import android.provider.Telephony.Mms.Part;
import android.provider.Telephony.Mms.Rate;
import android.provider.Telephony.MmsSms.PendingMessages;
+import android.telephony.SubscriptionManager;
import android.util.Log;
import com.google.android.mms.pdu.EncodedStringValue;
@@ -592,7 +593,7 @@
Mms.DELIVERY_TIME + " INTEGER," +
Mms.DELIVERY_REPORT + " INTEGER," +
Mms.LOCKED + " INTEGER DEFAULT 0," +
- Mms.SUB_ID + " INTEGER DEFAULT -1, " +
+ Mms.SUB_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID + ", " +
Mms.SEEN + " INTEGER DEFAULT 0," +
Mms.CREATOR + " TEXT," +
Mms.TEXT_ONLY + " INTEGER DEFAULT 0" +
@@ -837,7 +838,7 @@
"body TEXT," +
"service_center TEXT," +
"locked INTEGER DEFAULT 0," +
- "sub_id INTEGER DEFAULT -1, " +
+ "sub_id INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID + ", " +
"error_code INTEGER DEFAULT 0," +
"creator TEXT," +
"seen INTEGER DEFAULT 0" +
@@ -855,7 +856,7 @@
"sequence INTEGER," + // the part number of this message
"destination_port INTEGER," +
"address TEXT," +
- "sub_id INTEGER DEFAULT -1, " +
+ "sub_id INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID + ", " +
"pdu TEXT);"); // the raw PDU for this part
db.execSQL("CREATE TABLE attachments (" +
@@ -923,7 +924,8 @@
PendingMessages.ERROR_CODE + " INTEGER," +
PendingMessages.RETRY_INDEX + " INTEGER NOT NULL DEFAULT 0," +
PendingMessages.DUE_TIME + " INTEGER," +
- PendingMessages.SUB_ID + " INTEGER DEFAULT 0, " +
+ PendingMessages.SUB_ID + " INTEGER DEFAULT " +
+ SubscriptionManager.INVALID_SUB_ID + ", " +
PendingMessages.LAST_TRY + " INTEGER);");
}
@@ -1531,13 +1533,13 @@
private void upgradeDatabaseToVersion58(SQLiteDatabase db) {
db.execSQL("ALTER TABLE " + MmsProvider.TABLE_PDU +" ADD COLUMN "
- + Mms.SUB_ID + " INTEGER DEFAULT -1");
+ + Mms.SUB_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID);
db.execSQL("ALTER TABLE " + MmsSmsProvider.TABLE_PENDING_MSG +" ADD COLUMN "
- + "pending_sub_id" + " INTEGER DEFAULT 0");
+ + "pending_sub_id" + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID);
db.execSQL("ALTER TABLE " + SmsProvider.TABLE_SMS +" ADD COLUMN "
- + Sms.SUB_ID + " INTEGER DEFAULT -1");
+ + Sms.SUB_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID);
db.execSQL("ALTER TABLE " + SmsProvider.TABLE_RAW +" ADD COLUMN "
- + Sms.SUB_ID + " INTEGER DEFAULT -1");
+ + Sms.SUB_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID);
}
private void upgradeDatabaseToVersion59(SQLiteDatabase db) {
@@ -1829,7 +1831,7 @@
Mms.DELIVERY_TIME + " INTEGER," +
Mms.DELIVERY_REPORT + " INTEGER," +
Mms.LOCKED + " INTEGER DEFAULT 0," +
- Mms.SUB_ID + " INTEGER DEFAULT -1," +
+ Mms.SUB_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID + ", " +
Mms.SEEN + " INTEGER DEFAULT 0," +
Mms.TEXT_ONLY + " INTEGER DEFAULT 0" +
");");