Merge "Updated owners"
diff --git a/src/com/android/providers/telephony/TelephonyProvider.java b/src/com/android/providers/telephony/TelephonyProvider.java
index 37dc0ea..c9f4ee7 100644
--- a/src/com/android/providers/telephony/TelephonyProvider.java
+++ b/src/com/android/providers/telephony/TelephonyProvider.java
@@ -145,7 +145,7 @@
private static final boolean DBG = true;
private static final boolean VDBG = false; // STOPSHIP if true
- private static final int DATABASE_VERSION = 44 << 16;
+ private static final int DATABASE_VERSION = 45 << 16;
private static final int URL_UNKNOWN = 0;
private static final int URL_TELEPHONY = 1;
private static final int URL_CURRENT = 2;
@@ -464,7 +464,8 @@
+ Telephony.SimInfo.DATA_ENABLED_OVERRIDE_RULES + " TEXT,"
+ Telephony.SimInfo.IMSI + " TEXT,"
+ Telephony.SimInfo.UICC_APPLICATIONS_ENABLED + " INTEGER DEFAULT 1,"
- + Telephony.SimInfo.ALLOWED_NETWORK_TYPES + " BIGINT DEFAULT -1 "
+ + Telephony.SimInfo.ALLOWED_NETWORK_TYPES + " BIGINT DEFAULT -1,"
+ + Telephony.SimInfo.IMS_RCS_UCE_ENABLED + " INTEGER DEFAULT 0"
+ ");";
}
@@ -1459,6 +1460,21 @@
oldVersion = 44 << 16 | 6;
}
+ if (oldVersion < (45 << 16 | 6)) {
+ try {
+ // Try to update the siminfo table. It might not be there.
+ db.execSQL("ALTER TABLE " + SIMINFO_TABLE + " ADD COLUMN "
+ + Telephony.SimInfo.IMS_RCS_UCE_ENABLED
+ + " INTEGER DEFAULT 0;");
+ } catch (SQLiteException e) {
+ if (DBG) {
+ log("onUpgrade skipping " + SIMINFO_TABLE + " upgrade. " +
+ "The table will get created in onOpen.");
+ }
+ }
+ oldVersion = 45 << 16 | 6;
+ }
+
if (DBG) {
log("dbh.onUpgrade:- db=" + db + " oldV=" + oldVersion + " newV=" + newVersion);
}
@@ -3852,6 +3868,12 @@
SubscriptionManager.WFC_ROAMING_ENABLED_CONTENT_URI,
usingSubId, subId), null, true, UserHandle.USER_ALL);
}
+ if (values.containsKey(Telephony.SimInfo.IMS_RCS_UCE_ENABLED)) {
+ getContext().getContentResolver().notifyChange(getNotifyContentUri(
+ Uri.withAppendedPath(Telephony.SimInfo.CONTENT_URI,
+ Telephony.SimInfo.IMS_RCS_UCE_ENABLED), usingSubId, subId),
+ null, true, UserHandle.USER_ALL);
+ }
break;
default:
getContext().getContentResolver().notifyChange(
diff --git a/tests/src/com/android/providers/telephony/TelephonyDatabaseHelperTest.java b/tests/src/com/android/providers/telephony/TelephonyDatabaseHelperTest.java
index 8ddd7f7..0146f23 100644
--- a/tests/src/com/android/providers/telephony/TelephonyDatabaseHelperTest.java
+++ b/tests/src/com/android/providers/telephony/TelephonyDatabaseHelperTest.java
@@ -185,6 +185,21 @@
assertTrue(Arrays.asList(upgradedColumns).contains(SubscriptionManager.SUBSCRIPTION_TYPE));
}
+ @Test
+ public void databaseHelperOnUpgrade_hasImsRcsUceEnabledField() {
+ Log.d(TAG, "databaseHelperOnUpgrade_hasImsRcsUceEnabledField");
+ // (5 << 16 | 6) is the first upgrade trigger in onUpgrade
+ SQLiteDatabase db = mInMemoryDbHelper.getWritableDatabase();
+ mHelper.onUpgrade(db, (4 << 16), TelephonyProvider.getVersion(mContext));
+
+ // the upgraded db must have the SubscriptionManager.SUBSCRIPTION_TYPE field
+ Cursor cursor = db.query("siminfo", null, null, null, null, null, null);
+ String[] upgradedColumns = cursor.getColumnNames();
+ Log.d(TAG, "siminfo columns: " + Arrays.toString(upgradedColumns));
+
+ assertTrue(Arrays.asList(upgradedColumns).contains(Telephony.SimInfo.IMS_RCS_UCE_ENABLED));
+ }
+
/**
* Helper for an in memory DB used to test the TelephonyProvider#DatabaseHelper.
*