diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp
index 9eadb8c..4f34b8e 100644
--- a/tv/tuner/aidl/default/Dvr.cpp
+++ b/tv/tuner/aidl/default/Dvr.cpp
@@ -237,7 +237,7 @@
 }
 
 PlaybackStatus Dvr::checkPlaybackStatusChange(uint32_t availableToWrite, uint32_t availableToRead,
-                                              uint32_t highThreshold, uint32_t lowThreshold) {
+                                              int64_t highThreshold, int64_t lowThreshold) {
     if (availableToWrite == 0) {
         return PlaybackStatus::SPACE_FULL;
     } else if (availableToRead > highThreshold) {
@@ -252,9 +252,8 @@
 
 bool Dvr::readPlaybackFMQ(bool isVirtualFrontend, bool isRecording) {
     // Read playback data from the input FMQ
-    int size = mDvrMQ->availableToRead();
-    uint8_t playbackPacketSize =
-            static_cast<uint8_t>(mDvrSettings.get<DvrSettings::Tag::playback>().packetSize);
+    size_t size = mDvrMQ->availableToRead();
+    int64_t playbackPacketSize = mDvrSettings.get<DvrSettings::Tag::playback>().packetSize;
     vector<int8_t> dataOutputBuffer;
     dataOutputBuffer.resize(playbackPacketSize);
     // Dispatch the packet to the PID matching filter output buffer
@@ -461,7 +460,7 @@
 }
 
 RecordStatus Dvr::checkRecordStatusChange(uint32_t availableToWrite, uint32_t availableToRead,
-                                          uint32_t highThreshold, uint32_t lowThreshold) {
+                                          int64_t highThreshold, int64_t lowThreshold) {
     if (availableToWrite == 0) {
         return RecordStatus::OVERFLOW;
     } else if (availableToRead > highThreshold) {
diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h
index 68933ae..586f885 100644
--- a/tv/tuner/aidl/default/Dvr.h
+++ b/tv/tuner/aidl/default/Dvr.h
@@ -101,9 +101,9 @@
     void maySendPlaybackStatusCallback();
     void maySendRecordStatusCallback();
     PlaybackStatus checkPlaybackStatusChange(uint32_t availableToWrite, uint32_t availableToRead,
-                                             uint32_t highThreshold, uint32_t lowThreshold);
+                                             int64_t highThreshold, int64_t lowThreshold);
     RecordStatus checkRecordStatusChange(uint32_t availableToWrite, uint32_t availableToRead,
-                                         uint32_t highThreshold, uint32_t lowThreshold);
+                                         int64_t highThreshold, int64_t lowThreshold);
     /**
      * A dispatcher to read and dispatch input data to all the started filters.
      * Each filter handler handles the data filtering/output writing/filterEvent updating.
diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp
index 77ca2ee..9755e39 100644
--- a/tv/tuner/aidl/default/Filter.cpp
+++ b/tv/tuner/aidl/default/Filter.cpp
@@ -646,8 +646,8 @@
         DemuxFilterPesEvent pesEvent;
         pesEvent = {
                 // temp dump meta data
-                .streamId = static_cast<char16_t>(mPesOutput[3]),
-                .dataLength = static_cast<char16_t>(mPesOutput.size()),
+                .streamId = static_cast<int32_t>(mPesOutput[3]),
+                .dataLength = static_cast<int32_t>(mPesOutput.size()),
         };
         if (DEBUG_FILTER) {
             ALOGD("[Filter] assembled pes data length %d", pesEvent.dataLength);
@@ -793,7 +793,7 @@
             .tableId = 0,
             .version = 1,
             .sectionNum = 1,
-            .dataLength = static_cast<char16_t>(data.size()),
+            .dataLength = static_cast<int32_t>(data.size()),
     };
     mFilterEvents[size].set<DemuxFilterEvent::Tag::section>(secEvent);
     return true;
@@ -891,7 +891,7 @@
     mFilterEvents[size].get<DemuxFilterEvent::Tag::media>().avMemory =
             ::android::dupToAidl(nativeHandle);
     mFilterEvents[size].get<DemuxFilterEvent::Tag::media>().dataLength =
-            static_cast<int32_t>(output.size());
+            static_cast<int64_t>(output.size());
     mFilterEvents[size].get<DemuxFilterEvent::Tag::media>().avDataId = static_cast<int64_t>(dataId);
     if (mPts) {
         mFilterEvents[size].get<DemuxFilterEvent::Tag::media>().pts = mPts;
@@ -932,10 +932,9 @@
     mFilterEvents[size] = DemuxFilterEvent::make<DemuxFilterEvent::Tag::media>();
     mFilterEvents[size].get<DemuxFilterEvent::Tag::media>().avMemory =
             ::android::dupToAidl(nativeHandle);
-    mFilterEvents[size].get<DemuxFilterEvent::Tag::media>().offset =
-            static_cast<int32_t>(mSharedAvMemOffset);
+    mFilterEvents[size].get<DemuxFilterEvent::Tag::media>().offset = mSharedAvMemOffset;
     mFilterEvents[size].get<DemuxFilterEvent::Tag::media>().dataLength =
-            static_cast<int32_t>(output.size());
+            static_cast<int64_t>(output.size());
     if (mPts) {
         mFilterEvents[size].get<DemuxFilterEvent::Tag::media>().pts = mPts;
         mPts = 0;
diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h
index 30eb24b..3f40256 100644
--- a/tv/tuner/aidl/default/Filter.h
+++ b/tv/tuner/aidl/default/Filter.h
@@ -221,7 +221,7 @@
     // Shared A/V memory handle
     native_handle_t* mSharedAvMemHandle = nullptr;
     bool mUsingSharedAvMem = false;
-    uint32_t mSharedAvMemOffset = 0;
+    int64_t mSharedAvMemOffset = 0;
 
     uint32_t mAudioStreamType;
     uint32_t mVideoStreamType;
diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp
index 438f897..660d0bb 100644
--- a/tv/tuner/aidl/default/Frontend.cpp
+++ b/tv/tuner/aidl/default/Frontend.cpp
@@ -94,7 +94,7 @@
         return ::ndk::ScopedAStatus::ok();
     }
 
-    int32_t frequency = 0;
+    int64_t frequency = 0;
     switch (in_settings.getTag()) {
         case FrontendSettings::Tag::analog:
             frequency = in_settings.get<FrontendSettings::Tag::analog>().frequency;
@@ -133,7 +133,7 @@
 
     {
         FrontendScanMessage msg;
-        vector<int32_t> frequencies = {frequency};
+        vector<int64_t> frequencies = {frequency};
         msg.set<FrontendScanMessage::Tag::frequencies>(frequencies);
         mCallback->onScanMessage(FrontendScanMessageType::FREQUENCY, msg);
     }
@@ -165,21 +165,21 @@
 
     {
         FrontendScanMessage msg;
-        vector<uint8_t> plpIds = {2};
+        vector<int32_t> plpIds = {2};
         msg.set<FrontendScanMessage::Tag::plpIds>(plpIds);
         mCallback->onScanMessage(FrontendScanMessageType::PLP_IDS, msg);
     }
 
     {
         FrontendScanMessage msg;
-        vector<uint8_t> groupIds = {3};
+        vector<int32_t> groupIds = {3};
         msg.set<FrontendScanMessage::Tag::groupIds>(groupIds);
         mCallback->onScanMessage(FrontendScanMessageType::GROUP_IDS, msg);
     }
 
     {
         FrontendScanMessage msg;
-        vector<char16_t> inputStreamIds = {1};
+        vector<int32_t> inputStreamIds = {1};
         msg.set<FrontendScanMessage::Tag::inputStreamIds>(inputStreamIds);
         mCallback->onScanMessage(FrontendScanMessageType::INPUT_STREAM_IDS, msg);
     }
@@ -350,7 +350,7 @@
                 break;
             }
             case FrontendStatusType::PLP_ID: {
-                status.set<FrontendStatus::plpId>(101);  // type uint8_t
+                status.set<FrontendStatus::plpId>(101);
                 break;
             }
             case FrontendStatusType::EWBS: {
@@ -613,7 +613,7 @@
                 break;
             }
             case FrontendStatusType::ISDBT_SEGMENTS: {
-                vector<uint8_t> segments = {2, 3};
+                vector<int32_t> segments = {2, 3};
                 status.set<FrontendStatus::isdbtSegment>(segments);
                 break;
             }
diff --git a/tv/tuner/aidl/vts/functional/FilterTests.cpp b/tv/tuner/aidl/vts/functional/FilterTests.cpp
index 381475a..c53adb2 100644
--- a/tv/tuner/aidl/vts/functional/FilterTests.cpp
+++ b/tv/tuner/aidl/vts/functional/FilterTests.cpp
@@ -118,8 +118,8 @@
 }
 
 bool FilterCallback::dumpAvData(const DemuxFilterMediaEvent& event) {
-    int32_t length = event.dataLength;
-    int32_t offset = event.offset;
+    int64_t length = event.dataLength;
+    int64_t offset = event.offset;
     int av_fd;
     // read data from buffer pointed by a handle
     if (event.avMemory.fds.size() == 0) {
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
index 93b7976..7dce4fb 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
@@ -120,7 +120,7 @@
 
 void FrontendCallback::scanTest(std::shared_ptr<IFrontend>& frontend, FrontendConfig config,
                                 FrontendScanType type) {
-    int32_t targetFrequency = getTargetFrequency(config.settings);
+    int64_t targetFrequency = getTargetFrequency(config.settings);
     if (type == FrontendScanType::SCAN_BLIND) {
         // reset the frequency in the scan configuration to test blind scan. The settings param of
         // passed in means the real input config on the transponder connected to the DUT.
@@ -176,7 +176,7 @@
     mScanMsgProcessed = true;
 }
 
-int32_t FrontendCallback::getTargetFrequency(FrontendSettings& settings) {
+int64_t FrontendCallback::getTargetFrequency(FrontendSettings& settings) {
     switch (settings.getTag()) {
         case FrontendSettings::Tag::analog:
             return settings.get<FrontendSettings::Tag::analog>().frequency;
@@ -202,7 +202,7 @@
 }
 
 void FrontendCallback::resetBlindScanStartingFrequency(FrontendConfig& config,
-                                                       int32_t resetingFreq) {
+                                                       int64_t resetingFreq) {
     switch (config.settings.getTag()) {
         case FrontendSettings::Tag::analog:
             config.settings.get<FrontendSettings::Tag::analog>().frequency = resetingFreq;
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.h b/tv/tuner/aidl/vts/functional/FrontendTests.h
index b65704f..e5a9cd3 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.h
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.h
@@ -53,8 +53,8 @@
                   FrontendScanType type);
 
     // Helper methods
-    int32_t getTargetFrequency(FrontendSettings& settings);
-    void resetBlindScanStartingFrequency(FrontendConfig& config, int32_t resetingFreq);
+    int64_t getTargetFrequency(FrontendSettings& settings);
+    void resetBlindScanStartingFrequency(FrontendConfig& config, int64_t resetingFreq);
 
   private:
     void readFrontendScanMessage_Modulation(FrontendModulation modulation);
@@ -113,7 +113,7 @@
                 .lowThreshold = 0x1000,
                 .highThreshold = 0x07fff,
                 .dataFormat = DataFormat::ES,
-                .packetSize = static_cast<int8_t>(188),
+                .packetSize = static_cast<int64_t>(188),
         };
         dvrConfig.type = DvrType::PLAYBACK;
         dvrConfig.playbackInputFile = "/data/local/tmp/test.es";
diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
index 2d7be9e..b411011 100644
--- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
+++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
@@ -334,7 +334,7 @@
                 filterMap[id].settings = settings;
 
                 if (filterConfig.hasMonitorEventTypes()) {
-                    filterMap[id].monitorEventTypes = (uint32_t)filterConfig.getMonitorEventTypes();
+                    filterMap[id].monitorEventTypes = (int32_t)filterConfig.getMonitorEventTypes();
                 }
                 if (filterConfig.hasAvFilterSettings_optional()) {
                     auto av = filterConfig.getFirstAvFilterSettings_optional();
@@ -380,7 +380,7 @@
                         return;
                 }
                 dvrMap[id].type = type;
-                dvrMap[id].bufferSize = static_cast<uint32_t>(dvrConfig.getBufferSize());
+                dvrMap[id].bufferSize = static_cast<int32_t>(dvrConfig.getBufferSize());
                 if (dvrConfig.hasInputFilePath()) {
                     dvrMap[id].playbackInputFile = dvrConfig.getInputFilePath();
                 }
@@ -413,7 +413,7 @@
             for (auto descramblerConfig : descramblers.getDescrambler()) {
                 string id = descramblerConfig.getId();
                 descramblerMap[id].casSystemId =
-                        static_cast<uint32_t>(descramblerConfig.getCasSystemId());
+                        static_cast<int32_t>(descramblerConfig.getCasSystemId());
                 if (descramblerConfig.hasProvisionStr()) {
                     descramblerMap[id].provisionStr = descramblerConfig.getProvisionStr();
                 } else {
@@ -450,8 +450,7 @@
             auto timeFilters = *hardwareConfig.getFirstTimeFilters();
             for (auto timeFilterConfig : timeFilters.getTimeFilter()) {
                 string id = timeFilterConfig.getId();
-                timeFilterMap[id].timeStamp =
-                        static_cast<uint64_t>(timeFilterConfig.getTimeStamp());
+                timeFilterMap[id].timeStamp = static_cast<int64_t>(timeFilterConfig.getTimeStamp());
             }
         }
     }
@@ -625,14 +624,17 @@
     static FrontendDvbtSettings readDvbtFrontendSettings(Frontend feConfig) {
         ALOGW("[ConfigReader] fe type is dvbt");
         FrontendDvbtSettings dvbtSettings{
-                .frequency = (int32_t)feConfig.getFrequency(),
+                .frequency = (int64_t)feConfig.getFrequency(),
         };
+        if (feConfig.hasEndFrequency()) {
+            dvbtSettings.endFrequency = (int64_t)feConfig.getEndFrequency();
+        }
         if (!feConfig.hasDvbtFrontendSettings_optional()) {
             ALOGW("[ConfigReader] no more dvbt settings");
             return dvbtSettings;
         }
         auto dvbt = feConfig.getFirstDvbtFrontendSettings_optional();
-        uint32_t trans = static_cast<uint32_t>(dvbt->getTransmissionMode());
+        int32_t trans = static_cast<int32_t>(dvbt->getTransmissionMode());
         dvbtSettings.transmissionMode = static_cast<FrontendDvbtTransmissionMode>(trans);
         dvbtSettings.bandwidth = static_cast<FrontendDvbtBandwidth>(dvbt->getBandwidth());
         dvbtSettings.isHighPriority = dvbt->getIsHighPriority();
@@ -656,15 +658,18 @@
     static FrontendDvbsSettings readDvbsFrontendSettings(Frontend feConfig) {
         ALOGW("[ConfigReader] fe type is dvbs");
         FrontendDvbsSettings dvbsSettings{
-                .frequency = (int32_t)feConfig.getFrequency(),
+                .frequency = (int64_t)feConfig.getFrequency(),
         };
+        if (feConfig.hasEndFrequency()) {
+            dvbsSettings.endFrequency = (int64_t)feConfig.getEndFrequency();
+        }
         if (!feConfig.hasDvbsFrontendSettings_optional()) {
             ALOGW("[ConfigReader] no more dvbs settings");
             return dvbsSettings;
         }
-        dvbsSettings.symbolRate = static_cast<uint32_t>(
+        dvbsSettings.symbolRate = static_cast<int32_t>(
                 feConfig.getFirstDvbsFrontendSettings_optional()->getSymbolRate());
-        dvbsSettings.inputStreamId = static_cast<uint32_t>(
+        dvbsSettings.inputStreamId = static_cast<int32_t>(
                 feConfig.getFirstDvbsFrontendSettings_optional()->getInputStreamId());
         auto dvbs = feConfig.getFirstDvbsFrontendSettings_optional();
         if (dvbs->hasScanType()) {
@@ -968,11 +973,11 @@
     static PlaybackSettings readPlaybackSettings(Dvr dvrConfig) {
         ALOGW("[ConfigReader] dvr type is playback");
         PlaybackSettings playbackSettings{
-                .statusMask = static_cast<uint8_t>(dvrConfig.getStatusMask()),
-                .lowThreshold = static_cast<int32_t>(dvrConfig.getLowThreshold()),
-                .highThreshold = static_cast<int32_t>(dvrConfig.getHighThreshold()),
+                .statusMask = static_cast<int8_t>(dvrConfig.getStatusMask()),
+                .lowThreshold = static_cast<int64_t>(dvrConfig.getLowThreshold()),
+                .highThreshold = static_cast<int64_t>(dvrConfig.getHighThreshold()),
                 .dataFormat = static_cast<DataFormat>(dvrConfig.getDataFormat()),
-                .packetSize = static_cast<int8_t>(dvrConfig.getPacketSize()),
+                .packetSize = static_cast<int64_t>(dvrConfig.getPacketSize()),
         };
         return playbackSettings;
     }
@@ -980,11 +985,11 @@
     static RecordSettings readRecordSettings(Dvr dvrConfig) {
         ALOGW("[ConfigReader] dvr type is record");
         RecordSettings recordSettings{
-                .statusMask = static_cast<uint8_t>(dvrConfig.getStatusMask()),
-                .lowThreshold = static_cast<int32_t>(dvrConfig.getLowThreshold()),
-                .highThreshold = static_cast<int32_t>(dvrConfig.getHighThreshold()),
+                .statusMask = static_cast<int8_t>(dvrConfig.getStatusMask()),
+                .lowThreshold = static_cast<int64_t>(dvrConfig.getLowThreshold()),
+                .highThreshold = static_cast<int64_t>(dvrConfig.getHighThreshold()),
                 .dataFormat = static_cast<DataFormat>(dvrConfig.getDataFormat()),
-                .packetSize = static_cast<int8_t>(dvrConfig.getPacketSize()),
+                .packetSize = static_cast<int64_t>(dvrConfig.getPacketSize()),
         };
         return recordSettings;
     }
