<icon>org.tizen.contacts.png</icon>
</ui-application>
<ui-application appid="org.tizen.phone" exec="contacts-app" hw-acceleration="on" multiple="false" nodisplay="false" process-pool="true" taskmanage="true" type="capp">
+ <metadata key="http://tizen.org/metadata/effective-appid" value="org.tizen.contacts"/>
<label>Phone</label>
<label xml:lang="ar-ae">الهاتف</label>
<label xml:lang="az-az">Telefon</label>
<icon>org.tizen.contacts.png</icon>
</ui-application>
<ui-application appid="org.tizen.phone" exec="contacts-app" hw-acceleration="on" multiple="false" nodisplay="false" process-pool="true" taskmanage="true" type="capp">
+ <metadata key="http://tizen.org/metadata/effective-appid" value="org.tizen.contacts"/>
<label>Phone</label>
<label xml:lang="ar-ae">الهاتف</label>
<label xml:lang="az-az">Telefon</label>
private:
virtual Evas_Object *onCreate(Evas_Object *parent) override;
virtual void onCreated() override;
+ virtual void onNavigation(bool isCurrentView) override;
virtual void onMenuPressed() override;
virtual void onSelectAllInsert(Ui::GenlistItem *item) override;
+ void resetMissedCalls();
void fillLayout();
void updateLayout(bool isEmpty);
Evas_Object *createNoContentsLayout(Evas_Object *parent);
void unsetInsertCallback();
/**
+ * @brief Mark all unseen missed calls as seen in database.
+ */
+ static void resetMissedCalls();
+
+ /**
* @brief Compare dates
* @param[in] firstDate First date
* @param[in] secondDate Second date
#include "Utils/Logger.h"
#include "Utils/Callback.h"
+#include <badge.h>
+#include <notification.h>
+
+#define PHONE_APPID "org.tizen.phone"
+
using namespace Ux;
using namespace Logs::Model;
using namespace Logs::List;
fillLayout();
}
+void LogsView::onNavigation(bool isCurrentView)
+{
+ if (isCurrentView) {
+ resetMissedCalls();
+ }
+}
+
void LogsView::onMenuPressed()
{
if (getSelectMode() != SelectNone) {
m_Genlist->insert(item, nullptr, nullptr, Ui::Genlist::After);
}
+void LogsView::resetMissedCalls()
+{
+ unsigned count = 0;
+ badge_get_count(PHONE_APPID, &count);
+
+ if (count > 0) {
+ badge_set_count(PHONE_APPID, 0);
+ notification_delete_all(NOTIFICATION_TYPE_NOTI);
+ LogProvider::resetMissedCalls();
+ }
+}
+
void LogsView::fillLayout()
{
if (m_Genlist) {
m_InsertCallback = nullptr;
}
+void LogProvider::resetMissedCalls()
+{
+ contacts_filter_h filter = nullptr;
+ contacts_filter_create(_contacts_phone_log._uri, &filter);
+ contacts_filter_add_int(filter, _contacts_phone_log.log_type,
+ CONTACTS_MATCH_EQUAL, CONTACTS_PLOG_TYPE_VOICE_INCOMING_UNSEEN);
+
+ contacts_query_h query = nullptr;
+ contacts_query_create(_contacts_phone_log._uri, &query);
+ contacts_query_set_filter(query, filter);
+
+ contacts_list_h list = nullptr;
+ contacts_db_get_records_with_query(query, 0, 0, &list);
+ for (auto &&record : makeRange(list)) {
+ contacts_record_set_int(record, _contacts_phone_log.log_type,
+ CONTACTS_PLOG_TYPE_VOICE_INCOMING_SEEN);
+ }
+
+ contacts_db_update_records(list);
+ contacts_list_destroy(list, true);
+ contacts_query_destroy(query);
+ contacts_filter_destroy(filter);
+}
+
bool LogProvider::compareDate(const tm &firstDate, const tm &secondDate)
{
if (firstDate.tm_year == secondDate.tm_year &&