summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2024-03-06 09:30:11 -0800
committerXin Li <delphij@google.com>2024-03-06 09:30:11 -0800
commit0889eda5505996f73baa5585853255bf6524abdf (patch)
tree52e3f3a748e1de22f19cd1d25b3c568c407640e1
parent6ada0e952de21ac09743a5c935288d7f8370b008 (diff)
parent3000ad618ff0bda9d66dc455258a046415de2c6c (diff)
downloadTvProvider-master.tar.gz
Merge Android 14 QPR2 to AOSP mainHEADmastermain
Bug: 319669529 Merged-In: Ia46c819a94ed448d0152b12a08a08275ca99e20d Change-Id: I95d9e8fb61345c48761ac703e48c0ff9edb9716a
-rw-r--r--src/com/android/providers/tv/TvProvider.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/providers/tv/TvProvider.java b/src/com/android/providers/tv/TvProvider.java
index ea7bc18..99b19c5 100644
--- a/src/com/android/providers/tv/TvProvider.java
+++ b/src/com/android/providers/tv/TvProvider.java
@@ -89,7 +89,7 @@ public class TvProvider extends ContentProvider {
private static final boolean DEBUG = false;
private static final String TAG = "TvProvider";
- static final int DATABASE_VERSION = 39;
+ static final int DATABASE_VERSION = 40;
static final String SHARED_PREF_BLOCKED_PACKAGES_KEY = "blocked_packages";
static final String CHANNELS_TABLE = "channels";
static final String PROGRAMS_TABLE = "programs";
@@ -248,6 +248,8 @@ public class TvProvider extends ContentProvider {
CHANNELS_TABLE + "." + Channels.COLUMN_CHANNEL_LIST_ID);
sChannelProjectionMap.put(Channels.COLUMN_BROADCAST_GENRE,
CHANNELS_TABLE + "." + Channels.COLUMN_BROADCAST_GENRE);
+ sChannelProjectionMap.put(Channels.COLUMN_BROADCAST_VISIBILITY_TYPE,
+ CHANNELS_TABLE + "." + Channels.COLUMN_BROADCAST_VISIBILITY_TYPE);
sProgramProjectionMap.clear();
sProgramProjectionMap.put(Programs._ID, Programs._ID);
@@ -873,6 +875,10 @@ public class TvProvider extends ContentProvider {
+ Channels.COLUMN_VIDEO_RESOLUTION + " TEXT,"
+ Channels.COLUMN_CHANNEL_LIST_ID + " TEXT,"
+ Channels.COLUMN_BROADCAST_GENRE + " TEXT,"
+ + Channels.COLUMN_BROADCAST_VISIBILITY_TYPE
+ + " INTEGER NOT NULL DEFAULT "
+ + Channels.BROADCAST_VISIBILITY_TYPE_VISIBLE
+ + ","
// Needed for foreign keys in other tables.
+ "UNIQUE(" + Channels._ID + "," + Channels.COLUMN_PACKAGE_NAME + ")"
+ ");");
@@ -1159,6 +1165,16 @@ public class TvProvider extends ContentProvider {
+ RecordedPrograms.COLUMN_INTERNAL_PROVIDER_ID + " TEXT;");
}
}
+ if (oldVersion <= 39) {
+ if (!getColumnNames(db, CHANNELS_TABLE)
+ .contains(Channels.COLUMN_BROADCAST_VISIBILITY_TYPE)) {
+ db.execSQL("ALTER TABLE " + CHANNELS_TABLE + " ADD "
+ + Channels.COLUMN_BROADCAST_VISIBILITY_TYPE
+ + " INTEGER NOT NULL DEFAULT "
+ + Channels.BROADCAST_VISIBILITY_TYPE_VISIBLE
+ + ";");
+ }
+ }
Log.i(TAG, "Upgrading from version " + oldVersion + " to " + newVersion + " is done.");
}