cellbroadcast provider refactor
1. expose proper APIs to query framework cellbroadcast provider
2. export framework cellbroadcast provider
3. new URI with proper permission check
Bug: 135956699
Test: Build & Manual
Change-Id: I2f0ab939eb0e041900c112386117e90404b37452
diff --git a/src/com/android/cellbroadcastservice/GsmCellBroadcastHandler.java b/src/com/android/cellbroadcastservice/GsmCellBroadcastHandler.java
index abcbc20..051d963 100644
--- a/src/com/android/cellbroadcastservice/GsmCellBroadcastHandler.java
+++ b/src/com/android/cellbroadcastservice/GsmCellBroadcastHandler.java
@@ -110,7 +110,7 @@
ContentResolver resolver = mContext.getContentResolver();
for (CellBroadcastIdentity identity : geoFencingTriggerMessage.cbIdentifiers) {
- try (Cursor cursor = resolver.query(CELL_BROADCAST_URI,
+ try (Cursor cursor = resolver.query(CellBroadcasts.CONTENT_URI,
CellBroadcasts.QUERY_COLUMNS_FWK,
where,
new String[] { Integer.toString(identity.messageIdentifier),
@@ -120,7 +120,7 @@
if (cursor != null) {
while (cursor.moveToNext()) {
cbMessages.add(SmsCbMessage.createFromCursor(cursor));
- cbMessageUris.add(ContentUris.withAppendedId(CELL_BROADCAST_URI,
+ cbMessageUris.add(ContentUris.withAppendedId(CellBroadcasts.CONTENT_URI,
cursor.getInt(cursor.getColumnIndex(CellBroadcasts._ID))));
}
}