hide internal bundle key for AppControl
authorYoung Ik Cho <youngik.cho@samsung.com>
Mon, 22 Jul 2013 07:26:11 +0000 (16:26 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Wed, 24 Jul 2013 04:07:00 +0000 (13:07 +0900)
Change-Id: I3bfee830b9a7a403cbf182a62210468044cc8d6c
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
src/app/FApp_AppArg.cpp
src/app/FApp_AppImpl.cpp
src/app/inc/FApp_AppArg.h
src/app/inc/FApp_Types.h

index 3d5c714..9109aad 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <cstdio>
 #include <cstdlib>
-#include <vector>
 #include <new>
 #include <typeinfo>
 #include <unique_ptr.h>
 #include "FApp_AppArg.h"
 #include "FApp_AppMessageImpl.h"
 #include "FApp_Aul.h"
-#include "FAppPkg_PackageManagerImpl.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Base::Utility;
-using namespace Tizen::App::Package;
 
 
 extern "C" int appsvc_allow_transient_app(bundle*, Ecore_X_Window);
@@ -76,7 +73,9 @@ static const char OSP_V_VERSION_2_1_0_3[] = "ver_2.1.0.3";
 static const char BUNDLE_KEY_PREFIX_AUL[] = "__AUL_";
 static const char BUNDLE_KEY_PREFIX_SERVICE[] = "__APP_SVC_";
 static const char BUNDLE_KEY_PREFIX_OSP[] = "__OSP_";
+static const char BUNDLE_KEY_PREFIX_UG[] = "__UG_";
 const char TIZEN_NOTIFICATION_DATA[] = "http://tizen.org/appcontrol/data/notification";
+const wchar_t LEGACY_OPERATION_MAIN[] = L"osp.operation.MAIN";
 
 
 _AppArg::_AppArg(void)
@@ -100,7 +99,7 @@ _AppArg::Construct(const String& argText)
        __pBundle = bundle_create();
        SysTryReturnResult(NID_APP, __pBundle != null, E_OUT_OF_MEMORY, "Bundle creation failure.");
 
-       return CreateLaunchArg(__pBundle, argText);
+       return CreateNotificationArg(__pBundle, argText);
 }
 
 
@@ -288,7 +287,7 @@ _AppArg::GetArgListN(int num) const
 
        case _APP_HANDLER_LAUNCH_NORMAL:
                pList->Add(*new (std::nothrow) String(LEGACY_LAUNCH_REASON_NORMAL));
-               pList->Add(*new (std::nothrow) String(L"osp.operation.MAIN"));
+               pList->Add(*new (std::nothrow) String(LEGACY_OPERATION_MAIN));
                break;
 
        default:
@@ -359,6 +358,11 @@ IsInternalKey(const char* pKey)
                return true;
        }
 
+       if (strncmp(BUNDLE_KEY_PREFIX_UG, pKey, strlen(BUNDLE_KEY_PREFIX_UG)) == 0)
+       {
+               return true;
+       }
+
        return false;
 }
 
@@ -824,7 +828,7 @@ _AppArg::GetListN(bundle* b, const char* key)
 
 
 result
-_AppArg::CreateLaunchArg(bundle* b, const String& arg)
+_AppArg::CreateNotificationArg(bundle* b, const String& arg)
 {
        SysAssertf(b != null, "Valid bundle should be supplied");
 
@@ -832,15 +836,8 @@ _AppArg::CreateLaunchArg(bundle* b, const String& arg)
 
        if (!arg.IsEmpty())
        {
-               const char** pSa = new (std::nothrow) const char*[1];
-               SysTryReturnResult(NID_APP, pSa != null, E_OUT_OF_MEMORY, "Insufficient memory.");
-               pSa[0] = _StringConverter::CopyToCharArrayN(arg);
-               bundle_add_str_array(pb, OSP_K_ARG, pSa, 1);
-
-               bundle_add(pb, TIZEN_NOTIFICATION_DATA, pSa[0]);
-
-               delete[] pSa[0];
-               delete[] pSa;
+               std::unique_ptr<char[]> pStr(_StringConverter::CopyToCharArrayN(arg));
+               bundle_add(pb, TIZEN_NOTIFICATION_DATA, pStr.get());
        }
 
        bundle_add(pb, OSP_K_LAUNCH_TYPE, OSP_V_LAUNCH_TYPE_LAUNCH);
index 60d73ac..9a197d9 100644 (file)
@@ -439,7 +439,7 @@ _AppImpl::GetAppArgumentListN(void) const
                SysTryReturn(NID_APP, pList != null, null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
                String* pData = new (std::nothrow) String(LEGACY_LAUNCH_REASON_NORMAL);
                SysTryReturn(NID_APP, pData != null, null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
-               String* pData2 = new (std::nothrow) String(L"osp.operation.MAIN");
+               String* pData2 = new (std::nothrow) String(LEGACY_OPERATION_MAIN);
                SysTryReturn(NID_APP, pData2 != null, null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
 
                pList->Construct();
index 444fb5e..8ae5b2c 100644 (file)
@@ -201,7 +201,7 @@ private:
 
        _AppArg& operator =(const _AppArg& source);
 
-       static result CreateLaunchArg(bundle* b, const Tizen::Base::String& arg);
+       static result CreateNotificationArg(bundle* b, const Tizen::Base::String& arg);
 
        static result CreateLaunchArg(bundle* b, const Tizen::Base::Collection::IList* pList);
 
index 1ea292e..0bb75b5 100755 (executable)
@@ -107,6 +107,7 @@ const int LAUNCH_ARG_META_COUNT = 3;
 
 _OSP_LOCAL_ extern const wchar_t LEGACY_LAUNCH_REASON_NORMAL[];
 _OSP_LOCAL_ extern const wchar_t LEGACY_LAUNCH_REASON_CONDITIONAL[];
+_OSP_LOCAL_ extern const wchar_t LEGACY_OPERATION_MAIN[];
 _OSP_LOCAL_ extern const wchar_t TIZEN_OPERATION_MAIN[];
 _OSP_EXPORT_ extern const wchar_t TIZEN_OPERATION_PICK[];
 _OSP_LOCAL_ extern const char TIZEN_NOTIFICATION_DATA[];