Merge "Add default implementation for setTvMessageEnabled" into udc-dev
This commit is contained in:
commit
b85319ccd7
2 changed files with 12 additions and 1 deletions
|
@ -68,7 +68,13 @@ void TvInput::init() {
|
|||
::ndk::ScopedAStatus TvInput::setTvMessageEnabled(int32_t deviceId, int32_t streamId,
|
||||
TvMessageEventType in_type, bool enabled) {
|
||||
ALOGV("%s", __FUNCTION__);
|
||||
// TODO: Implement this
|
||||
|
||||
if (mStreamConfigs.count(deviceId) == 0) {
|
||||
ALOGW("Device with id %d isn't available", deviceId);
|
||||
return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS);
|
||||
}
|
||||
|
||||
mTvMessageEventEnabled[deviceId][streamId][in_type] = enabled;
|
||||
return ::ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <aidl/android/hardware/tv/input/TvMessageEventType.h>
|
||||
#include <fmq/AidlMessageQueue.h>
|
||||
#include <map>
|
||||
#include <unordered_map>
|
||||
#include "TvInputDeviceInfoWrapper.h"
|
||||
#include "TvStreamConfigWrapper.h"
|
||||
|
||||
|
@ -38,6 +39,9 @@ namespace hardware {
|
|||
namespace tv {
|
||||
namespace input {
|
||||
|
||||
using TvMessageEnabledMap = std::unordered_map<
|
||||
int32_t, std::unordered_map<int32_t, std::unordered_map<TvMessageEventType, bool>>>;
|
||||
|
||||
class TvInput : public BnTvInput {
|
||||
public:
|
||||
TvInput();
|
||||
|
@ -62,6 +66,7 @@ class TvInput : public BnTvInput {
|
|||
shared_ptr<ITvInputCallback> mCallback;
|
||||
map<int32_t, shared_ptr<TvInputDeviceInfoWrapper>> mDeviceInfos;
|
||||
map<int32_t, map<int32_t, shared_ptr<TvStreamConfigWrapper>>> mStreamConfigs;
|
||||
TvMessageEnabledMap mTvMessageEventEnabled;
|
||||
};
|
||||
|
||||
} // namespace input
|
||||
|
|
Loading…
Reference in a new issue