Additional changes to SubscriptionManager API as per API council.

bug: 17575308
Change-Id: Idd98aa46c15a9219ccf28091c62602ac8bf16c62
diff --git a/src/com/android/providers/telephony/MmsSmsDatabaseHelper.java b/src/com/android/providers/telephony/MmsSmsDatabaseHelper.java
index 7fd127c..996217e 100644
--- a/src/com/android/providers/telephony/MmsSmsDatabaseHelper.java
+++ b/src/com/android/providers/telephony/MmsSmsDatabaseHelper.java
@@ -593,7 +593,7 @@
                    Mms.DELIVERY_TIME + " INTEGER," +
                    Mms.DELIVERY_REPORT + " INTEGER," +
                    Mms.LOCKED + " INTEGER DEFAULT 0," +
-                   Mms.SUB_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID + ", " +
+                   Mms.SUBSCRIPTION_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUBSCRIPTION_ID + ", " +
                    Mms.SEEN + " INTEGER DEFAULT 0," +
                    Mms.CREATOR + " TEXT," +
                    Mms.TEXT_ONLY + " INTEGER DEFAULT 0" +
@@ -838,7 +838,7 @@
                    "body TEXT," +
                    "service_center TEXT," +
                    "locked INTEGER DEFAULT 0," +
-                   "sub_id INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID + ", " +
+                   "sub_id INTEGER DEFAULT " + SubscriptionManager.INVALID_SUBSCRIPTION_ID + ", " +
                    "error_code INTEGER DEFAULT 0," +
                    "creator TEXT," +
                    "seen INTEGER DEFAULT 0" +
@@ -856,7 +856,7 @@
                    "sequence INTEGER," + // the part number of this message
                    "destination_port INTEGER," +
                    "address TEXT," +
-                   "sub_id INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID + ", " +
+                   "sub_id INTEGER DEFAULT " + SubscriptionManager.INVALID_SUBSCRIPTION_ID + ", " +
                    "pdu TEXT);"); // the raw PDU for this part
 
         db.execSQL("CREATE TABLE attachments (" +
@@ -924,8 +924,8 @@
                    PendingMessages.ERROR_CODE + " INTEGER," +
                    PendingMessages.RETRY_INDEX + " INTEGER NOT NULL DEFAULT 0," +
                    PendingMessages.DUE_TIME + " INTEGER," +
-                   PendingMessages.SUB_ID + " INTEGER DEFAULT " +
-                   SubscriptionManager.INVALID_SUB_ID + ", " +
+                   PendingMessages.SUBSCRIPTION_ID + " INTEGER DEFAULT " +
+                   SubscriptionManager.INVALID_SUBSCRIPTION_ID + ", " +
                    PendingMessages.LAST_TRY + " INTEGER);");
 
     }
@@ -1533,13 +1533,13 @@
 
     private void upgradeDatabaseToVersion58(SQLiteDatabase db) {
         db.execSQL("ALTER TABLE " + MmsProvider.TABLE_PDU +" ADD COLUMN "
-                + Mms.SUB_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID);
+                + Mms.SUBSCRIPTION_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUBSCRIPTION_ID);
         db.execSQL("ALTER TABLE " + MmsSmsProvider.TABLE_PENDING_MSG +" ADD COLUMN "
-                + "pending_sub_id" + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID);
+                + "pending_sub_id" + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUBSCRIPTION_ID);
         db.execSQL("ALTER TABLE " + SmsProvider.TABLE_SMS +" ADD COLUMN "
-                + Sms.SUB_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID);
+                + Sms.SUBSCRIPTION_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUBSCRIPTION_ID);
         db.execSQL("ALTER TABLE " + SmsProvider.TABLE_RAW +" ADD COLUMN "
-                + Sms.SUB_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID);
+                + Sms.SUBSCRIPTION_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUBSCRIPTION_ID);
     }
 
     private void upgradeDatabaseToVersion59(SQLiteDatabase db) {
@@ -1831,7 +1831,7 @@
                 Mms.DELIVERY_TIME + " INTEGER," +
                 Mms.DELIVERY_REPORT + " INTEGER," +
                 Mms.LOCKED + " INTEGER DEFAULT 0," +
-                Mms.SUB_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID + ", " +
+                Mms.SUBSCRIPTION_ID + " INTEGER DEFAULT " + SubscriptionManager.INVALID_SUBSCRIPTION_ID + ", " +
                 Mms.SEEN + " INTEGER DEFAULT 0," +
                 Mms.TEXT_ONLY + " INTEGER DEFAULT 0" +
                 ");");
diff --git a/src/com/android/providers/telephony/MmsSmsProvider.java b/src/com/android/providers/telephony/MmsSmsProvider.java
index 8b451a6..457e472 100644
--- a/src/com/android/providers/telephony/MmsSmsProvider.java
+++ b/src/com/android/providers/telephony/MmsSmsProvider.java
@@ -120,7 +120,7 @@
     // SMS ("sms") message tables.
     private static final String[] MMS_SMS_COLUMNS =
             { BaseColumns._ID, Mms.DATE, Mms.DATE_SENT, Mms.READ, Mms.THREAD_ID, Mms.LOCKED,
-                    Mms.SUB_ID };
+                    Mms.SUBSCRIPTION_ID };
 
     // These are the columns that appear only in the MMS message
     // table.
diff --git a/src/com/android/providers/telephony/TelephonyProvider.java b/src/com/android/providers/telephony/TelephonyProvider.java
index 884ea0e..35e070e 100644
--- a/src/com/android/providers/telephony/TelephonyProvider.java
+++ b/src/com/android/providers/telephony/TelephonyProvider.java
@@ -188,9 +188,9 @@
         private void createSimInfoTable(SQLiteDatabase db) {
             if (DBG) log("dbh.createSimInfoTable:+");
             db.execSQL("CREATE TABLE " + SIMINFO_TABLE + "("
-                    + "_id INTEGER PRIMARY KEY AUTOINCREMENT,"
+                    + SubscriptionManager.UNIQUE_KEY_SUBSCRIPTION_ID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
                     + SubscriptionManager.ICC_ID + " TEXT NOT NULL,"
-                    + SubscriptionManager.SIM_ID + " INTEGER DEFAULT " + SubscriptionManager.SIM_NOT_INSERTED + ","
+                    + SubscriptionManager.SIM_SLOT_INDEX + " INTEGER DEFAULT " + SubscriptionManager.SIM_NOT_INSERTED + ","
                     + SubscriptionManager.DISPLAY_NAME + " TEXT,"
                     + SubscriptionManager.CARRIER_NAME + " TEXT,"
                     + SubscriptionManager.NAME_SOURCE + " INTEGER DEFAULT " + SubscriptionManager.NAME_SOURCE_DEFAULT_SOURCE + ","
@@ -231,7 +231,7 @@
                     "bearer INTEGER," +
                     "mvno_type TEXT," +
                     "mvno_match_data TEXT," +
-                    "sub_id INTEGER DEFAULT " + SubscriptionManager.INVALID_SUB_ID + "," +
+                    "sub_id INTEGER DEFAULT " + SubscriptionManager.INVALID_SUBSCRIPTION_ID + "," +
                     "profile_id INTEGER default 0," +
                     "modem_cognitive BOOLEAN default 0," +
                     "max_conns INTEGER default 0," +
@@ -340,7 +340,7 @@
             if (oldVersion < (9 << 16 | 6)) {
                 db.execSQL("ALTER TABLE " + CARRIERS_TABLE +
                         " ADD COLUMN sub_id INTEGER DEFAULT " +
-                        SubscriptionManager.INVALID_SUB_ID + ";");
+                        SubscriptionManager.INVALID_SUBSCRIPTION_ID + ";");
                 oldVersion = 9 << 16 | 6;
             }
             if (oldVersion < (10 << 16 | 6)) {
@@ -594,8 +594,8 @@
             }
 
             int subId = SubscriptionManager.getDefaultSubId();
-            if (!values.containsKey(Telephony.Carriers.SUB_ID)) {
-                values.put(Telephony.Carriers.SUB_ID, subId);
+            if (!values.containsKey(Telephony.Carriers.SUBSCRIPTION_ID)) {
+                values.put(Telephony.Carriers.SUBSCRIPTION_ID, subId);
             }
 
             if (!values.containsKey(Telephony.Carriers.PROFILE_ID)) {