2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file BrowserAppControlDllEntry.cpp
20 * @brief This is the implementation for the BrowserAppControlDllEntry.cpp class.
23 #include <appsvc/appsvc.h>
24 #include <appfw/app_service.h>
26 #include <FBaseSysLog.h>
27 #include <FAppAppControl.h>
28 #include <FBaseColHashMap.h>
30 #include <FBase_StringConverter.h>
31 #include <FApp_AppControlManager.h>
32 #include <FApp_AppMessageImpl.h>
33 #include <FApp_AppArg.h>
36 using namespace Tizen::App;
37 using namespace Tizen::Base;
38 using namespace Tizen::Base::Collection;
46 result _OSP_EXPORT_ StartAppControl(int req, const String&, const String&, const String*, const String*, const IMap*);
47 result _OSP_EXPORT_ TerminateAppControl(int req);
50 static const char __allowedAppControlTable[][2][96] =
52 {"osp.appcontrol.BROWSER", "osp.appcontrol.operation.DEFAULT"},
53 {"osp.appcontrol.provider.browser", "osp.appcontrol.operation.view"},
54 {"tizen.internet", "http://tizen.org/appcontrol/operation/view"},
58 StartAppControl(int req, const String& aId, const String& oId, const String* pUri, const String* pMime, const IMap* pMap)
60 SysLog(NID_APP, "StartAppControl: Entry to Browser AppControl");
62 const bool isAllowed = _AppControlManager::IsAllowedAppControl(__allowedAppControlTable, 3, aId, oId);
63 SysTryReturnResult(NID_APP, isAllowed, E_SYSTEM, "Invalid AppControl entry for (%ls, %ls).", aId.GetPointer(), oId.GetPointer());
67 const String* pActualUri = pUri;
76 // if there is not pUri, then search for "url" key.
77 const String* pData = static_cast<const String*>(pMap->GetValue(String(L"url")));
86 const String& package = _AppControlManager::GetAliasAppId(aId);
87 SysLog(NID_APP, "Actual packageId is %ls.", package.GetPointer());
89 int pid = _AppControlManager::GetInstance()->LaunchPkg(msg, package, String(SERVICE_OPERATION_VIEW), pActualUri, pMime, NULL, 0);
95 SysLog(NID_APP, "[%s] System error.", GetErrorMessage(r));
98 SysLog(NID_APP, "StartAppControl: Launching Browser AppControl succeeded");
104 TerminateAppControl(int req)