* @exception E_SYSTEM A system error has occurred. @n
* Either the file operation or the DB operation has failed.
* @remarks The specific error code can be accessed using the GetLastResult() method.
- * @remarks For the delivered launch arguments, see App::GetAppArgumentListN().
*/
static Tizen::Base::Collection::IList* FindAppControlsN(const Tizen::Base::String* pOperationId, const Tizen::Base::String* pCategory, const Tizen::Base::String* pDataType, const Tizen::Base::String* pUriPattern);
* @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()
+ * @see LaunchApplication(const AppId&, LaunchOption);
* @see Tizen::Base::DateTime::ToString()
* @see Tizen::Io::SerialPort
*
* @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()
+ * @see LaunchApplication(const AppId&, LaunchOption);
* @see IAppLaunchConditionEventListener::OnAppLaunchConditionMetN()
* @see Tizen::Base::DateTime::ToString()
* @see Tizen::Io::SerialPort
*
* @since 2.0
*
- * @privlevel partner
+ * @privlevel platform
* @privilege %http://tizen.org/privilege/appsetting
*
* @return A pointer to the %AppResource instance, @n
*
* @since 2.0
*
- * @privlevel partner
+ * @privlevel platform
* @privilege %http://tizen.org/privilege/appsetting
*
* @return An error code
*
* @since 2.0
*
- * @privlevel partner
+ * @privlevel platform
* @privilege %http://tizen.org/privilege/appsetting
*
* @return A pointer to the %AppSetting instance, @n
*
* @since 2.0
*
- * @privlevel partner
+ * @privlevel platform
* @privilege %http://tizen.org/privilege/appsetting
*
* @return An error code
* @exception E_SUCCESS The method is successful.
* @exception E_NUM_FORMAT The specified string does not contain a number that can be parsed.
* @remarks This method guarantees that the original value of out-parameter is not changed when the method returns error.
+ * @remarks The behavior of this method is dependent on the system default locale setting.
*/
static result Parse(const String& s, double& ret);
* @remarks If the value of the current instance is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
* produces the result "Infinity". @n
* 6 digits are given for the precision of this method. Use String::Format() to set the specific precision.
+ * @remarks The behavior of this method is dependent on the system default locale setting.
*/
virtual String ToString(void) const;
* @remarks If the input value is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
* produces the result "Infinity". @n
* 6 digits are given for the precision of this method. Use String::Format() to set the specific precision.
+ * @remarks The behavior of this method is dependent on the system default locale setting.
*/
static String ToString(double value);
* @exception E_SUCCESS The method is successful.
* @exception E_NUM_FORMAT The specified string does not contain a number that can be parsed.
* @remarks This method guarantees that the original value of out-parameter is not changed when the method returns error.
+ * @remarks The behavior of this method is dependent on the system default locale setting.
* @see Tizen::Base::Double::Parse()
*/
static result Parse(const String& s, float& ret);
* @remarks If the value is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
* produces the result "Infinity". @n
* 6 digits are given for the precision of this method. Use String::Format() to set the specific precision.
+ * @remarks The behavior of this method is dependent on the system default locale setting.
*/
virtual String ToString(void) const;
* @remarks If the value is Not-a-Number (NaN), the result is the string "NaN". Furthermore, infinity
* produces the result "Infinity". @n
* 6 digits are given for the precision of this method. Use String::Format() to set the specific precision.
+ * @remarks The behavior of this method is dependent on the system default locale setting.
*/
static String ToString(float value);
<value>3GP</value>\r
<value>MP4</value>\r
</MediaContainerType>\r
+ <Device>\r
+ <fps>50</fps>\r
+ </Device>\r
</AudioRecorder>\r
\r
<Camera>\r
<value>3GP</value>\r
<value>MP4</value>\r
</MediaContainerType>\r
+ <Device>\r
+ <fps>50</fps>\r
+ </Device>\r
</VideoRecorder>\r
\r
</MediaCapability>\r
<value>3GP</value>\r
<value>MP4</value>\r
</MediaContainerType>\r
+ <Device>\r
+ <fps>50</fps>\r
+ </Device>\r
</AudioRecorder>\r
\r
<Camera>\r
<value>3GP</value>\r
<value>MP4</value>\r
</MediaContainerType>\r
+ <Device>\r
+ <fps>50</fps>\r
+ </Device>\r
</VideoRecorder>\r
\r
</MediaCapability>\r
_AppControlImpl* pImpl = _AppControlImpl::GetInstance(*pAc);
pImpl->SetProperty(_APPCONTROL_PROPERTY_ALIAS);
- _AppControlAliasEntry* pEntry = new (std::nothrow) _AppControlAliasEntry(aId, oId, *pAppId, *pOperation);
- if (pEntry)
+ const _AppControlAliasEntry* pLookupEntry = GetReverseRuntimeAliasEntry(*pAppId, *pOperation);
+ if (pLookupEntry == null)
{
- // may fail
- __runtimeAlias.Add(pEntry);
- SysLog(NID_APP, "Setting alias appId (%ls -> %ls).", aId.GetPointer(), pAppId->GetPointer());
+ // no entry found : add new one
+ _AppControlAliasEntry* pEntry = new (std::nothrow) _AppControlAliasEntry(aId, oId, *pAppId, *pOperation);
+ if (pEntry)
+ {
+ // may fail
+ __runtimeAlias.Add(pEntry);
+ SysLog(NID_APP, "Setting alias appId (%ls -> %ls).", aId.GetPointer(), pAppId->GetPointer());
+ }
}
}
else
#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);
}
if( (platformDebug == false) && (appDebug == 0) )
{
snprintf(logBody, LOG_LEN_MAX, "%s(%d) > App assertion passed due to debug mode off!", pFunction, lineNumber);
- ALOG(LOG_ERROR, logTag, logBody);
+ ALOG(LOG_ERROR, logTag, "%s", logBody);
return;
}
snprintf(logBody, LOG_LEN_MAX, "%s(%d) > AppAssert!", pFunction, lineNumber);
- ALOG(LOG_ERROR, logTag, logBody);
+ ALOG(LOG_ERROR, logTag, "%s", logBody);
assert(false);
}
snprintf(logBody, LOG_LEN_MAX, "%s(%d) > SysAssert!", pFunction, lineNumber);
- ALOG(LOG_ERROR, LOG_TAG_ASSERT, logBody);
+ ALOG(LOG_ERROR, LOG_TAG_ASSERT, "%s", logBody);
assert(false);
}
char logTag[LOG_MODULE_NAME_LEN_MAX];
snprintf(logTag, LOG_MODULE_NAME_LEN_MAX, "%s", __GetModuleName(static_cast<LogID>(nid)));
- ALOG(LOG_ERROR, logTag, logBody);
+ ALOG(LOG_ERROR, logTag, "%s", logBody);
}
void
g_io_channel_set_encoding(__pEventFdIo, null, &pGError);
g_io_channel_set_flags(__pEventFdIo, G_IO_FLAG_NONBLOCK, &pGError);
+ g_io_channel_set_close_on_unref(__pEventFdIo, TRUE);
+ eventFd = -1;
+
__pEventFdSource = g_io_create_watch(__pEventFdIo, G_IO_IN);
SysTryCatch(NID_BASE_RT, __pEventFdSource != null, r = E_SYSTEM, E_SYSTEM,
"[E_SYSTEM] Failed to create a gsource for a channel.");
if (__pEventFdSource)
{
+ g_source_destroy(__pEventFdSource);
g_source_unref(__pEventFdSource);
__pEventFdSource = null;
}
__pEventFdIo = null;
}
+ if (eventFd != -1)
+ {
+ close(eventFd);
+ }
+
return r;
}
if (__pSource)
{
+ g_source_destroy(__pSource);
g_source_unref(__pSource);
__pSource = null;
}
g_io_channel_set_encoding(__pChannel, null, &pGError);
g_io_channel_set_flags(__pChannel, G_IO_FLAG_NONBLOCK, &pGError);
+ g_io_channel_set_close_on_unref(__pChannel, TRUE);
+ eventFd = -1;
+
__pSource = g_io_create_watch(__pChannel, G_IO_IN);
SysTryCatch(NID_BASE_RT, __pSource != null, r = E_SYSTEM, E_SYSTEM,
"[E_SYSTEM] Failed to create a gsource for a channel.");
if (__pSource)
{
+ g_source_destroy(__pSource);
g_source_unref(__pSource);
__pSource = null;
}
__pChannel = null;
}
+ if (eventFd != -1)
+ {
+ close(eventFd);
+ }
return r;
}
: __pReverseSource(null)
, __fdCount(0)
, __pFdLock(null)
- , __name("")
, __pListener(null)
{
__messageBuffer[0] = '\0';
return E_SUCCESS;
CATCH:
- __name = "";
+ __name.Clear();
__pListener = null;
__pFdLock = null;
return r;
}
+String
+_IpcClient::GetName(void) const
+{
+ return __name;
+}
+
struct HelloMessage
{
int pid;
FD_ZERO(&rset);
FD_SET(client, &rset);
wset = rset;
- timeout.tv_sec = 10; // FIXME: replace 10 with const int
+ timeout.tv_sec = 10;
timeout.tv_usec = 0;
- // FIXME:
- // replace select with poll
while (true)
{
ret = select(client+1, &rset, &wset, NULL, &timeout);
if (condition & G_IO_HUP)
{
+ SysLog(NID_IO, "G_IO_HUP, the connection is closed.");
+
g_source_destroy(__pReverseSource);
g_source_unref(__pReverseSource);
__pReverseSource = null;
+ if (__pListener)
+ {
+ __pListener->OnIpcServerDisconnected(*this);
+ }
+
return FALSE;
}
else if (condition & G_IO_IN)
{
pGError = null;
status = g_io_channel_read_chars(source, (char*) __messageBuffer, __MAX_MESSAGE_BUFFER_SIZE, &readSize, &pGError);
- if (status == G_IO_STATUS_EOF)
+ if (status == G_IO_STATUS_EOF || status == G_IO_STATUS_ERROR)
{
+ if (status == G_IO_STATUS_EOF)
+ {
+ SysLog(NID_IO, "G_IO_STATUS_EOF, the connection is closed.");
+ }
+ else
+ {
+ SysLog(NID_IO, "G_IO_STATUS_ERROR, the connection is closed. ");
+ }
+
pGError = null;
g_io_channel_shutdown(source, FALSE, &pGError);
g_source_unref(__pReverseSource);
__pReverseSource = null;
+ if (__pListener)
+ {
+ __pListener->OnIpcServerDisconnected(*this);
+ }
+
return FALSE;
}
/**
* @interface _IIpcClientEventListener
* @brief This interface provides the listener method for the response from IPC server.
- * since 3.0
*/
class _OSP_EXPORT_ _IIpcClientEventListener
: Tizen::Base::Runtime::IEventListener
/**
* This is the destructor for this class.
*
- * @since 2.1
*/
virtual ~_IIpcClientEventListener(void);
/**
* Called when an IPC response message received.
*
- * @since 2.1
* @param[in] client The IPC client
* @param[in] message The response message
*/
virtual void OnIpcResponseReceived(_IpcClient& client, const IPC::Message& message) = 0;
+
+ /**
+ * Called when an IPC server disconnected.
+ *
+ * @param[in] client The IPC client
+ */
+ virtual void OnIpcServerDisconnected(_IpcClient& client) {}
}; // _IIpcClientEventListener
/**
* @interface _IIpcServerEventListener
* @brief This interface provides listener method for the request event from an IPC client.
- * since 3.0
*/
class _OSP_EXPORT_ _IIpcServerEventListener
: virtual Tizen::Base::Runtime::IEventListener
public:
/**
* This is the destructor for this class.
- *
- * @since 2.1
*/
virtual ~_IIpcServerEventListener(void);
/**
* Called when an IPC server started.
*
- * @since 2.1
* @param[in] server The IPC server
*/
virtual void OnIpcServerStarted(const _IpcServer& server) = 0;
/**
* Called when an IPC server stopped.
*
- * @since 2.1
* @param[in] server The IPC server
*/
virtual void OnIpcServerStopped(const _IpcServer& server) = 0;
/**
* Called when an IPC client connected.
*
- * @since 2.1
* @param[in] server The IPC server
*/
virtual void OnIpcClientConnected(const _IpcServer& server, int clientId) = 0;
/**
* Called when an IPC client disconnected.
*
- * @since 2.1
* @param[in] server The IPC server
* @param[in] clientId The id of the connected IPC client
*/
/**
* Called when an IPC request message received.
*
- * @since 2.1
* @code
*
* bool
result Construct(const Tizen::Base::String& serverName, const _IIpcClientEventListener* pListener = null);
/**
+ * Returns the name of the IPC server.
+ *
+ * @return The name of the IPC server.
+ */
+ Tizen::Base::String GetName(void) const;
+
+ /**
* Sends a request message to an IPC server.
*
* @code
ConnectivityNfcServiceMsgStart,
ConnectivityTelephonyServiceMsgStart,
UiManagerServiceStart,
- TrustZoneServiceStart
+ TrustZoneServiceStart,
+ LockManagerServiceStart
//LastIPCMsgStart // Must come last.
};
{ Tizen::Base::_API_VISIBILITY_PARTNER }, // application.kill
{ Tizen::Base::_API_VISIBILITY_PUBLIC }, // application.launch
{ Tizen::Base::_API_VISIBILITY_PARTNER }, // appmanager.launch
- { Tizen::Base::_API_VISIBILITY_PARTNER }, // appsetting
+ { Tizen::Base::_API_VISIBILITY_PLATFORM }, // appsetting
{ Tizen::Base::_API_VISIBILITY_PARTNER }, // appusage
{ Tizen::Base::_API_VISIBILITY_PARTNER }, // audiomanager.route
{ Tizen::Base::_API_VISIBILITY_PARTNER }, // audiomanager.session
}
_IpcServer::_IpcServer(void)
- : __name("")
- , __runOnCallerThread(false)
+ : __runOnCallerThread(false)
, __pEventDispatcher(null)
, __pListener(null)
, __handlerThread(0)
return E_SUCCESS;
CATCH:
+ __name.Clear();
+
if (pGIOChannel != null)
{
g_io_channel_unref(pGIOChannel);
if (condition & G_IO_HUP)
{
- SysLog(NID_IO, "Connection closed");
+ SysLog(NID_IO, "G_IO_HUP, the connection is closed.");
+
int clientId = pClientInfo->clientId;
g_io_channel_shutdown(source, FALSE, &pGError);