OPTION(CSP_SUPPORT "Support for csp policy" ON)
OPTION(ALLOW_NAVIGATION_SUPPORT "Support for allow-navigation" ON)
OPTION(SCHEMA_VALIDATION_SUPPORT "Support for XML schema validation" OFF)
+OPTION(NFC_APP_CONTROL_EXCEPTION "Enable exception handling for NFC app-control" ON)
############################# compiler flags ##################################
MESSAGE(STATUS "XML Schema validation of installed app enabled")
ADD_DEFINITIONS("-DSCHEMA_VALIDATION_ENABLED")
ENDIF(SCHEMA_VALIDATION_SUPPORT)
+IF(NFC_APP_CONTROL_EXCEPTION)
+ MESSAGE(STATUS "Exception handling for NFC app-control is enabled")
+ ADD_DEFINITIONS("-DNFC_EXCEPTION_HANDLING_FOR_TIZEN_2_2_ONLY")
+ENDIF(NFC_APP_CONTROL_EXCEPTION)
# If supported for the target machine, emit position-independent code,suitable
# for dynamic linking and avoiding any limit on the size of the global offset
ThrowMsg(Exception::ParseError, "service element must be unique");
}
+#ifdef NFC_EXCEPTION_HANDLING_FOR_TIZEN_2_2_ONLY
+ // XXX This feature should be retained to Tizen 2.2 only.
+ // NFC exception handling which was requested from Tizen Device API team.
+
+ const DPL::String exceptionNfcOperation =
+ L"http://tizen.org/appcontrol/operation/nfc/transaction";
+ const DPL::String exceptionNfcUri = L"nfc://secure/aid/";
+ const DPL::String divertingNfcUri1 = L"nfc://secure/SIM1/aid/";
+ const DPL::String divertingNfcUri2 = L"nfc://secure/eSE/aid/";
+
+ if (m_appControl.m_operation == exceptionNfcOperation
+ && m_appControl.m_mimeList.empty()
+ && m_appControl.m_uriList.size() == 1
+ && (m_appControl.m_uriList.begin())->compare(0, exceptionNfcUri.length(), exceptionNfcUri) == 0)
+ {
+ DPL::String originalUri = *m_appControl.m_uriList.begin();
+ DPL::String newUri = originalUri;
+
+ newUri.replace(0, exceptionNfcUri.length(), divertingNfcUri1);
+ m_appControl.m_uriList.erase(m_appControl.m_uriList.begin());
+ m_appControl.m_uriList.insert(newUri);
+ m_data.appControlList.push_back(m_appControl);
+ _D("NFC exception : %ls -> %ls", originalUri.c_str(), newUri.c_str());
+
+ newUri = originalUri;
+ newUri.replace(0, exceptionNfcUri.length(), divertingNfcUri2);
+ m_appControl.m_uriList.erase(m_appControl.m_uriList.begin());
+ m_appControl.m_uriList.insert(newUri);
+ m_data.appControlList.push_back(m_appControl);
+ _D("NFC exception : %ls -> %ls", originalUri.c_str(), newUri.c_str());
+
+ return;
+ }
+#endif // NFC_EXCEPTION_HANDLING_FOR_TIZEN_2_2_ONLY
+
m_data.appControlList.push_back(m_appControl);
}