1 /* 2 * Copyright 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.media.tv.tuner.filter; 18 19 import android.annotation.BytesLong; 20 import android.annotation.SystemApi; 21 22 /** 23 * Filter event sent from {@link Filter} objects with section type. 24 * 25 * @hide 26 */ 27 @SystemApi 28 public class SectionEvent extends FilterEvent { 29 private final int mTableId; 30 private final int mVersion; 31 private final int mSectionNum; 32 private final long mDataLength; 33 34 // This constructor is used by JNI code only SectionEvent(int tableId, int version, int sectionNum, long dataLength)35 private SectionEvent(int tableId, int version, int sectionNum, long dataLength) { 36 mTableId = tableId; 37 mVersion = version; 38 mSectionNum = sectionNum; 39 mDataLength = dataLength; 40 } 41 42 /** 43 * Gets table ID of filtered data. 44 */ getTableId()45 public int getTableId() { 46 return mTableId; 47 } 48 49 /** 50 * Gets version number of filtered data. 51 */ getVersion()52 public int getVersion() { 53 return mVersion; 54 } 55 56 /** 57 * Gets section number of filtered data. 58 */ getSectionNumber()59 public int getSectionNumber() { 60 return mSectionNum; 61 } 62 63 /** 64 * Gets data size in bytes of filtered data. 65 * 66 * @deprecated Use {@link #getDataLengthLong()} 67 */ 68 @Deprecated getDataLength()69 public int getDataLength() { 70 return (int) getDataLengthLong(); 71 } 72 73 /** 74 * Gets data size in bytes of filtered data. 75 */ 76 @BytesLong getDataLengthLong()77 public long getDataLengthLong() { 78 return mDataLength; 79 } 80 } 81