Commit 72b14736 authored by Wink Saville's avatar Wink Saville
Browse files

Additional changes to SubscriptionManager API as per API council.

bug: 17575308
Change-Id: Idd98aa46c15a9219ccf28091c62602ac8bf16c62
parent 9dd0bdea
......@@ -593,7 +593,7 @@ public class MmsSmsDatabaseHelper extends SQLiteOpenHelper {
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 @@ public class MmsSmsDatabaseHelper extends SQLiteOpenHelper {
"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 @@ public class MmsSmsDatabaseHelper extends SQLiteOpenHelper {
"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 @@ public class MmsSmsDatabaseHelper extends SQLiteOpenHelper {
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 @@ public class MmsSmsDatabaseHelper extends SQLiteOpenHelper {
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 @@ public class MmsSmsDatabaseHelper extends SQLiteOpenHelper {
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" +
");");
......
......@@ -120,7 +120,7 @@ public class MmsSmsProvider extends ContentProvider {
// 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.
......
......@@ -188,9 +188,9 @@ public class TelephonyProvider extends ContentProvider
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 @@ public class TelephonyProvider extends ContentProvider
"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 @@ public class TelephonyProvider extends ContentProvider
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 @@ public class TelephonyProvider extends ContentProvider
}
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)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment