* @since 2.0
* @privlevel public
* @privilege %http://tizen.org/privilege/application.launch
+ * @feature %http://tizen.org/feature/network.nfc for L¡±NFC=¡¯command¡¯¡± or %http://tzen.org/feature/usb.accessory for L¡±Serial=¡¯command¡¯¡± in the value of @c condition
*
* @return An error code
* @param[in] condition The launch condition for the application @n
* @exception E_MAX_EXCEEDED The size of @c pArguments has exceeded the maximum limit.
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. For more information, see <a href=¡±../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm¡±>Application Filtering</a>. @b Since: @b 2.1
*
* @remarks When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
* @remarks The newly introduced launch condition does not work on the previous SDK version and the E_INVALID_CONDITION exception is returned.
* @remarks The launch period requires more consideration because an inappropriate short period value may lead
* to an adverse effect on the device battery.
* @remarks For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of the %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
+ * @remarks Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
* @see UnregisterAppLaunch()
* @see IsAppLaunchRegistered()
* @see LaunchApplication(const AppId&, LaunchOption);
* @since 2.0
* @privlevel partner
* @privilege %http://tizen.org/privilege/appmanager.launch
+ * @feature %http://tizen.org/feature/network.nfc for L¡±NFC=¡¯command¡¯¡± or %http://tzen.org/feature/usb.accessory for L¡±Serial=¡¯command¡¯¡± in the value of @c condition
*
* @return An error code
* @param[in] appId The ID of the application registered for launch
* @exception E_MAX_EXCEEDED The size of @c pArguments has exceeded the maximum limit.
* @exception E_SYSTEM A system error has occurred.
* @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+ * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. For more information, see <a href=¡±../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm¡±>Application Filtering</a>. @b Since: @b 2.1
*
* @remarks When the registered application is about to be launched, the registered launch condition and arguments are given as parameters to IAppLaunchConditionEventListener::OnAppLaunchConditionMetN().
* @remarks The newly introduced launch condition does not work on the previous SDK version and the @c E_INVALID_CONDITION exception is returned.
* @remarks The launch period requires more consideration because an inappropriate short period value may lead
* to an adverse effect on the device battery.
* @remarks For the NFC launch condition, the detected NDEF message can be acquired using the @c pExtraData parameter of the %IAppLaunchConditionEventListener::OnAppLaunchConditionMetN() method.
+ * @remarks Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue() methods.
* @see UnregisterAppLaunch()
* @see IsAppLaunchRegistered()
* @see LaunchApplication(const AppId&, LaunchOption);
#include "FAppPkg_PackageInfoImpl.h"
#include "FApp_AppControlManager.h"
#include "FApp_Aul.h"
+#include "FSys_SystemInfoImpl.h"
using namespace Tizen::App::Package;
using namespace Tizen::Base;
_ConditionManagerProxy* pProxy = GetConditionManagerProxy();
SysTryReturnResult(NID_APP, null != pProxy, E_INVALID_STATE, "ConditionManager instance must not be null.");
+ Tizen::Base::Utility::StringTokenizer strTok(condition, L"=");
+ SysTryReturnResult(NID_APP, strTok.GetTokenCount() > 0, E_INVALID_ARG, "Condition string is invalid.(%ls)", condition.GetPointer());
+
+ String key;
+ result r = strTok.GetNextToken(key);
+ SysTryReturnResult(NID_APP, !IsFailed(r), E_INVALID_ARG, "Condition string is invalid.(%ls)", condition.GetPointer());
+
+ bool ret = true;
+ if (key == L"Serial")
+ {
+ r = Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/usb.accessory", ret);
+ }
+ else if (key == L"NFC")
+ {
+ r = Tizen::System::_SystemInfoImpl::GetSysInfo(L"http://tizen.org/feature/network.nfc", ret);
+ }
+ SysTryReturnResult(NID_APP, ret != false, E_UNSUPPORTED_OPERATION, "Condition(%ls)", condition.GetPointer());
+
return pProxy->RegisterAppLaunch(appId, condition, pArguments, option);
}