@Test public void testChannelWithSystemContentProvider() { if (!Utils.hasTvInputFramework(InstrumentationRegistry.getContext())) { return; } Channel channel = new Channel.Builder() .setInputId("TestInputService") .setType(TvContractCompat.Channels.TYPE_OTHER) .build(); ContentResolver resolver = InstrumentationRegistry.getContext().getContentResolver(); Uri channelUri = resolver.insert(Channels.CONTENT_URI, channel.toContentValues()); assertNotNull(channelUri); Program fullyPopulatedProgram = createFullyPopulatedProgram(ContentUris.parseId(channelUri)); Uri programUri = resolver.insert(Programs.CONTENT_URI, fullyPopulatedProgram.toContentValues()); Program programFromSystemDb = loadProgramFromContentProvider(resolver, programUri); compareProgram(fullyPopulatedProgram, programFromSystemDb, false); }
@Override public ContentValues toContentValues() { ContentValues values = super.toContentValues(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { values.remove(Programs.COLUMN_RECORDING_PROHIBITED); } return values; }
Program extends BaseProgram implements Comparable<Program> { @Override public ContentValues toContentValues() { ContentValues values = super.toContentValues(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { values.remove(Programs.COLUMN_RECORDING_PROHIBITED); } return values; } }
Program extends BaseProgram implements Comparable<Program> { @Override public ContentValues toContentValues() { ContentValues values = super.toContentValues(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { values.remove(Programs.COLUMN_RECORDING_PROHIBITED); } return values; } private  Program(Builder builder); }
Program extends BaseProgram implements Comparable<Program> { @Override public ContentValues toContentValues() { ContentValues values = super.toContentValues(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { values.remove(Programs.COLUMN_RECORDING_PROHIBITED); } return values; } private  Program(Builder builder); long getChannelId(); long getStartTimeUtcMillis(); long getEndTimeUtcMillis(); String[] getBroadcastGenres(); boolean isRecordingProhibited(); @Override int hashCode(); @Override boolean equals(Object other); @Override int compareTo(@NonNull Program other); @Override String toString(); @Override ContentValues toContentValues(); static Program fromCursor(Cursor cursor); }
Program extends BaseProgram implements Comparable<Program> { @Override public ContentValues toContentValues() { ContentValues values = super.toContentValues(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { values.remove(Programs.COLUMN_RECORDING_PROHIBITED); } return values; } private  Program(Builder builder); long getChannelId(); long getStartTimeUtcMillis(); long getEndTimeUtcMillis(); String[] getBroadcastGenres(); boolean isRecordingProhibited(); @Override int hashCode(); @Override boolean equals(Object other); @Override int compareTo(@NonNull Program other); @Override String toString(); @Override ContentValues toContentValues(); static Program fromCursor(Cursor cursor); @RestrictTo(LIBRARY_GROUP)
    static final String[] PROJECTION; }