diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-07-02 07:41:24 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-07-02 07:41:24 +0000 |
| commit | 26f1b51bfbd5e8d2d2e55247a8bae49ccd52872d (patch) | |
| tree | 0d99225e22e2956cf075fcf48527d0e17e872c0f /broadcastradio/common/utils2x/Utils.cpp | |
| parent | 3adfddb29552dbf79387c23e10a9960d1f9c2f79 (diff) | |
| parent | 8b76f6692c718c21272d3585541b72fed7ac93f0 (diff) | |
Merge "DO NOT MERGE - Merge qt-dev-plus-aosp-without-vendor (5699924) into stage-aosp-master" into stage-aosp-master
Diffstat (limited to 'broadcastradio/common/utils2x/Utils.cpp')
| -rw-r--r-- | broadcastradio/common/utils2x/Utils.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/broadcastradio/common/utils2x/Utils.cpp b/broadcastradio/common/utils2x/Utils.cpp index f292c0855f..43f272efdb 100644 --- a/broadcastradio/common/utils2x/Utils.cpp +++ b/broadcastradio/common/utils2x/Utils.cpp @@ -14,12 +14,10 @@ * limitations under the License. */ #define LOG_TAG "BcRadioDef.utils" -//#define LOG_NDEBUG 0 #include <broadcastradio-utils-2x/Utils.h> #include <android-base/logging.h> -#include <log/log.h> namespace android { namespace hardware { @@ -130,7 +128,7 @@ bool tunesTo(const ProgramSelector& a, const ProgramSelector& b) { case IdentifierType::SXM_SERVICE_ID: return haveEqualIds(a, b, IdentifierType::SXM_SERVICE_ID); default: // includes all vendor types - ALOGW("Unsupported program type: %s", toString(type).c_str()); + LOG(WARNING) << "unsupported program type: " << toString(type); return false; } } @@ -166,7 +164,7 @@ uint64_t getId(const ProgramSelector& sel, const IdentifierType type) { return val; } - ALOGW("Identifier %s not found", toString(type).c_str()); + LOG(WARNING) << "identifier not found: " << toString(type); return 0; } @@ -205,7 +203,7 @@ bool isValid(const ProgramIdentifier& id) { auto expect = [&valid](bool condition, std::string message) { if (!condition) { valid = false; - ALOGE("Identifier not valid, expected %s", message.c_str()); + LOG(ERROR) << "identifier not valid, expected " << message; } }; @@ -301,6 +299,20 @@ ProgramSelector make_selector_amfm(uint32_t frequency) { return sel; } +ProgramSelector make_selector_dab(uint32_t sidExt, uint32_t ensemble) { + ProgramSelector sel = {}; + // TODO(maryabad): Have a helper function to create the sidExt instead of + // passing the whole identifier here. Something like make_dab_sid_ext. + sel.primaryId = make_identifier(IdentifierType::DAB_SID_EXT, sidExt); + hidl_vec<ProgramIdentifier> secondaryIds = { + make_identifier(IdentifierType::DAB_ENSEMBLE, ensemble), + // TODO(maryabad): Include frequency here when the helper method to + // translate between ensemble and frequency is implemented. + }; + sel.secondaryIds = secondaryIds; + return sel; +} + Metadata make_metadata(MetadataKey key, int64_t value) { Metadata meta = {}; meta.key = static_cast<uint32_t>(key); |
