summaryrefslogtreecommitdiffstats
path: root/flounder_6.0.0.xml
blob: 47ca9923991c3a94e61295b6520dea57aeae58c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <remote fetch="https://gerrit.automotivelinux.org/gerrit/" name="agl" pushurl="ssh://gerrit.automotivelinux.org:29418" review="https://gerrit.automotivelinux.org/gerrit/"/>
  <remote fetch="https://github.com/" name="github"/>
  <remote fetch="git://git.openembedded.org/" name="openembedded"/>
  <remote fetch="git://code.qt.io/" name="qt.io"/>
  <remote fetch="git://git.yoctoproject.org/" name="yocto"/>
  
  <default remote="agl" revision="refs/tags/flounder/6.0.0" sync-j="4"/>
  
  <project name="01org/meta-security-isafw" path="meta-security-isafw" remote="github" revision="489abdc65cefb566d696c8b218aa0b9b99a350ae" upstream="master"/>
  <project name="AGL/meta-agl" path="meta-agl"/>
  <project name="AGL/meta-agl-demo" path="meta-agl-demo"/>
  <project name="AGL/meta-agl-devel" path="meta-agl-devel"/>
  <project name="AGL/meta-agl-extra" path="meta-agl-extra"/>
  <project name="AGL/meta-renesas-rcar-gen3" path="meta-renesas-rcar-gen3"/>
  <project name="CogentEmbedded/meta-rcar" path="meta-rcar" remote="github" revision="a0551596548ef3a4c9132161f3d9c4ae538d6fdc" upstream="v3.7.0"/>
  <project name="advancedtelematic/meta-updater" path="meta-updater" remote="github" revision="ff555e8690eb47177ade42dc6912ae17a759cc45" upstream="rocko"/>
  <project name="advancedtelematic/meta-updater-qemux86-64" path="meta-updater-qemux86-64" remote="github" revision="697632ddd98ed7ae3dbd0bd84abb04079767bc56" upstream="rocko"/>
  <project name="boundarydevices/meta-boundary" path="meta-boundary" remote="github" revision="f96f41b2e5beda2b51acb702d082568898b36a68" upstream="rocko"/>
  <project name="kraj/meta-altera" path="meta-altera" remote="github" revision="14e08a419cb9d4017f40360c14fcc3c2c1ce8e42" upstream="rocko"/>
  <project name="meta-freescale" remote="yocto" revision="a4158e3425a79720ddc4c02e76251d567bdceb51" upstream="rocko"/>
  <project name="meta-gplv2" remote="yocto" revision="f875c60ecd6f30793b80a431a2423c4b98e51548" upstream="rocko"/>
  <project name="meta-intel" remote="yocto" revision="718bb384942675437c081f6795da7f421da1fee6" upstream="rocko"/>
  <project name="meta-oic" remote="yocto" revision="6e831e4bcdfa6ab8c26eb4fca4bdc98faf028818" upstream="1.2.1"/>
  <project name="meta-openembedded" remote="openembedded" revision="352531015014d1957d6444d114f4451e241c4d23" upstream="rocko"/>
  <project name="meta-qcom" remote="yocto" revision="955ce2625de5d8c7fe313bd4630c8a290e4b96f8" upstream="rocko"/>
  <project name="meta-qt5/meta-qt5" path="meta-qt5" remote="github" revision="682ad61c071a9710e9f9d8a32ab1b5f3c14953d1" upstream="rocko"/>
  <project name="meta-raspberrypi" remote="yocto" revision="8e4c537d84fdde8e3b4642d0dda2c0f4af76d52f" upstream="rocko"/>
  <project name="meta-security" remote="yocto" revision="8f6969a775fa6afbf553e72ba83e71197780b2d8" upstream="master"/>
  <project name="meta-ti" remote="yocto" revision="ed83a43c6a76875ee5f0388b3b60a28f2a373a10" upstream="rocko"/>
  <project name="meta-virtualization" remote="yocto" revision="bd77388f31929f38e7d4cc9c711f0f83f563007e" upstream="rocko"/>
  <project name="phongt/meta-sdl" path="meta-sdl" remote="github" revision="60c9fe8a4a9c6ca95f222685f8d6248f16236f2a" upstream="release/4.4.0"/>
  <project name="poky" remote="yocto" revision="refs/tags/yocto-2.4.3" upstream="rocko"/>
</manifest>
o">= metaObject->enumerator(enumIndex); int value = mEnum.keyToValue(key.toUtf8().data()); return (value < 0) ? 0 : value; } Contact::Contact(QString name, QList<QObject *>numbers) { m_name = name; m_numbers = numbers; } Contact::~Contact() { } RecentCall::RecentCall(QString name, QString number, QString datetime, QString type) { m_name = name; m_number = number; m_datetime = datetime; m_type = stringToEnum(type); } RecentCall::~RecentCall() { } int RecentCall::stringToEnum(QString key) { const QMetaObject* metaObject = RecentCall::metaObject(); int enumIndex = metaObject->indexOfEnumerator("RecentCallType"); QMetaEnum mEnum = metaObject->enumerator(enumIndex); int value = mEnum.keyToValue(key.toUtf8().data()); return (value < 0) ? 0 : value; } Pbap::Pbap (QUrl &url, QQmlContext *context, QObject * parent) : QObject(parent), m_mloop(nullptr) { m_mloop = new MessageEngine(url); m_context = context; m_context->setContextProperty("RecentCallModel", QVariant::fromValue(m_calls)); qmlRegisterUncreatableType<RecentCall>("RecentCall", 1, 0, "RecentCall", "Enum"); QObject::connect(m_mloop, &MessageEngine::connected, this, &Pbap::onConnected); QObject::connect(m_mloop, &MessageEngine::disconnected, this, &Pbap::onDisconnected); QObject::connect(m_mloop, &MessageEngine::messageReceived, this, &Pbap::onMessageReceived); } Pbap::~Pbap() { delete m_mloop; } void Pbap::refreshContacts(int max_entries) { PbapMessage *tmsg = new PbapMessage(); QJsonObject parameter; if (max_entries >= 0) parameter.insert("max_entries", max_entries); tmsg->createRequest("contacts", parameter); m_mloop->sendMessage(tmsg); tmsg->deleteLater(); } void Pbap::refreshCalls(int max_entries) { PbapMessage *tmsg = new PbapMessage(); QJsonObject parameter; parameter.insert("list", "cch"); if (max_entries >= 0) parameter.insert("max_entries", max_entries); tmsg->createRequest("history", parameter); m_mloop->sendMessage(tmsg); tmsg->deleteLater(); } void Pbap::search(QString number) { PbapMessage *tmsg = new PbapMessage(); QJsonObject parameter; if (!number.isEmpty()) parameter.insert("number", number); parameter.insert("max_entries", 1); tmsg->createRequest("search", parameter); m_mloop->sendMessage(tmsg); tmsg->deleteLater(); } bool compareContactPtr(QObject *a, QObject *b) { Contact *contactA = qobject_cast<Contact *>(a); Contact *contactB = qobject_cast<Contact *>(b); return (*contactA < *contactB); } void Pbap::updateContacts(QString vcards) { QString name, number, type; QList<vCard> contacts_vcards = vCard::fromByteArray(vcards.toUtf8()); for (auto vcard : contacts_vcards) { vCardProperty name_prop = vcard.property(VC_FORMATTED_NAME); QStringList values = name_prop.values(); name = values.at(vCardProperty::DefaultValue); if (name.isEmpty() || name.startsWith('#')) continue; /* * libvcard has no member function to return a list of named * properties, so we iterate over all properties and parse * each identified VC_TELEPHONE property in the vCard. */ QList<QObject *> numbers; vCardPropertyList properties = vcard.properties(); for (auto property : properties) { if (property.isValid() && (property.name() == VC_TELEPHONE)) { QStringList values = property.values(); number = values.at(0); vCardParamList params = property.params(); // The first parameter is always the phone number type type = params.at(0).value(); numbers.append(new PhoneNumber(number, type)); } } m_contacts.append(new Contact(name, numbers)); } std::sort(m_contacts.begin(), m_contacts.end(), compareContactPtr); refreshCalls(100); } #define VC_DATETIME "X-IRMC-CALL-DATETIME" void Pbap::updateCalls(QString vcards) { QString name, number, datetime, type; m_calls.clear(); QList<vCard> history_vcards = vCard::fromByteArray(vcards.toUtf8()); for (auto vcard : history_vcards) { vCardProperty number_prop = vcard.property(VC_TELEPHONE); if (number_prop.isValid()) { QStringList values = number_prop.values(); number = values.at(0); } vCardProperty name_prop = vcard.property(VC_FORMATTED_NAME); QStringList values = name_prop.values(); name = values.at(0); // For calls with an empty name, fetch the name from contacts if (name.isEmpty()) { bool found = false; for (auto contact_obj : m_contacts) { Contact *contact = qobject_cast<Contact *>(contact_obj); QList<QObject *>numbers = contact->numbers(); for (auto number_obj : numbers) { PhoneNumber *phone_number = qobject_cast<PhoneNumber *>(number_obj); if (number.endsWith(phone_number->number())) { name = contact->name(); found = true; break; } } if (found == true) break; } if (!found) name = number; } vCardProperty datetime_prop = vcard.property(VC_DATETIME); if (datetime_prop.isValid()) { vCardParamList params = datetime_prop.params(); QStringList values = datetime_prop.values(); type = params.at(0).value(); datetime = values.at(0); // Convert the PBAP date/time to ISO 8601 format datetime.insert(4, '-'); datetime.insert(7, '-'); datetime.insert(13, ':'); datetime.insert(16, ':'); } m_calls.append(new RecentCall(name, number, datetime, type)); } // Refresh model m_context->setContextProperty("RecentCallModel", QVariant::fromValue(m_calls)); } void Pbap::sendSearchResults(QJsonArray results) { QString name; if (results.empty()) name = "Not Found"; else name = results.at(0).toObject().value("name").toString(); emit searchResults(name); } void Pbap::onConnected() { QStringListIterator eventIterator(events); PbapMessage *tmsg; while (eventIterator.hasNext()) { tmsg = new PbapMessage(); QJsonObject parameter; parameter.insert("value", eventIterator.next()); tmsg->createRequest("subscribe", parameter); m_mloop->sendMessage(tmsg); tmsg->deleteLater(); } } void Pbap::onDisconnected() { QStringListIterator eventIterator(events); PbapMessage *tmsg; while (eventIterator.hasNext()) { tmsg = new PbapMessage(); QJsonObject parameter; parameter.insert("value", eventIterator.next()); tmsg->createRequest("unsubscribe", parameter); m_mloop->sendMessage(tmsg); tmsg->deleteLater(); } } void Pbap::onMessageReceived(MessageType type, Message *msg) { if (msg->isEvent() && type == PbapEventMessage) { PbapMessage *tmsg = qobject_cast<PbapMessage*>(msg); if (tmsg->isStatusEvent()) { emit statusChanged(tmsg->connected()); if (tmsg->connected() == true) { refreshContacts(-1); } } } else if (msg->isReply() && type == ResponseRequestMessage) { ResponseMessage *tmsg = qobject_cast<ResponseMessage*>(msg); if (tmsg->requestVerb() == "contacts") { updateContacts(tmsg->replyData().value("vcards").toString()); } else if (tmsg->requestVerb() == "history") { updateCalls(tmsg->replyData().value("vcards").toString()); } else if (tmsg->requestVerb() == "search") { sendSearchResults(tmsg->replyData().value("results").toArray()); } } msg->deleteLater(); }