#include <FApp_ServiceAppImpl.h>
#include <FAppPkg_PackageManagerImpl.h>
#include <FBase_StringConverter.h>
+#include <FSec_AccessController.h>
#include <FShellAppWidgetProviderInfo.h>
#include <FShellAppWidgetProvider.h>
using namespace Tizen::Base::Collection;
using namespace Tizen::App;
using namespace Tizen::App::Package;
+using namespace Tizen::Security;
using namespace Tizen::Graphics;
,__pAppWidgetPopupProviderFactory(null)
,__pAppWidgetPopupProvider(null)
,__AppWidgetPopupTouchEventListener(null)
+ ,__isAppWidgetFrameReady(false)
+ ,__pPendingTouchEvent(null)
{
SysLog(NID_APP, "");
}
result
_AppWidgetProviderManagerImpl::AddAppWidget(const Tizen::App::AppId& providerAppId, const Tizen::Base::String& providerName, const Tizen::Base::String& text, const Tizen::Base::String& userInfo)
{
+ result r = _AccessController::CheckUserPrivilege(_PRV_SHORTCUT_INSTALL);
+ SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
+
SysTryReturnResult(NID_APP, providerAppId.IsEmpty()==false, E_INVALID_ARG, "The providerAppId is empty.");
SysTryReturnResult(NID_APP, providerAppId.GetLength() < NATIVE_APP_MAX_APPID_LENGTH, E_INVALID_ARG, "The providerAppId is too long (Maximum %d bytes).", NATIVE_APP_MAX_APPID_LENGTH);
SysTryReturnResult(NID_APP, Tizen::App::_Aul::IsInstalled(providerAppId) == true, E_APP_NOT_INSTALLED, "The application(%ls) is not installed.", providerAppId.GetPointer());
- //TODO :: check privilege
String providerId;
if( providerAppId.StartsWith(L"com.samsung", 0) == true )
{
providerId = providerAppId + "." + providerName;
}
-
- result r = E_SUCCESS;
-
PackageAppInfo* pPackageInfo = _PackageManagerImpl::GetInstance()->GetPackageAppInfoN(providerAppId);
- SysTryReturn(NID_APP, pPackageInfo != null, r, r, "[%s] Propagating.", GetErrorMessage(r));
+ SysTryReturn(NID_APP, pPackageInfo != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(r));
String iconPath = pPackageInfo->GetAppMenuIconPath();
delete pPackageInfo;
SysTryReturnResult(NID_APP, pValue, E_FAILURE, "Failed to GetValue(%ls)", ARG_KEY_Y.GetPointer() );
Double::Parse(*pValue, y);
- this->ForwardTouchEvent(*pInstanceId, eventType, timeStamp, x, y);
+ if( __isAppWidgetFrameReady == false )
+ {
+ delete __pPendingTouchEvent;
+ __pPendingTouchEvent = new PendingTouchEvent(eventType, timeStamp, x, y);
+ }
+ else
+ {
+ this->ForwardTouchEvent(*pInstanceId, eventType, timeStamp, x, y);
+ }
}
SysLog(NID_APP, "Exit");
return E_SUCCESS;
_AppWidgetManagerProxy* pProxy = _AppWidgetManagerProxy::GetInstance();
SysTryReturnResult(NID_APP, pProxy, E_SYSTEM, "Failed to get proxy instance!");
- return pProxy->RequestSyncSharedMemory(instanceId, width, height);
+ result r = pProxy->RequestSyncSharedMemory(instanceId, width, height);
+
+ if( __isAppWidgetFrameReady == false)
+ {
+ __isAppWidgetFrameReady = true;
+ if( __pPendingTouchEvent)
+ {
+ this->ForwardTouchEvent(instanceId, __pPendingTouchEvent->eventType, __pPendingTouchEvent->timeStamp, __pPendingTouchEvent->x, __pPendingTouchEvent->y);
+ delete __pPendingTouchEvent;
+ __pPendingTouchEvent = null;
+ }
+ }
+
+ return r;
}
result
#include <FApp_Types.h>
#include <FApp_AppInfo.h>
#include <FBase_StringConverter.h>
+#include <FSec_AccessController.h>
#include <FShell_ShortcutManagerImpl.h>
using namespace Tizen::App;
using namespace Tizen::Base;
-
+using namespace Tizen::Security;
namespace Tizen { namespace Shell
{
result
ShortcutManager::AddShortcut(const AppId& appId, const String& displayName, const String& iconFilePath, const String& uriData, bool allowDuplication)
{
+ result r = _AccessController::CheckUserPrivilege(_PRV_SHORTCUT_INSTALL);
+ SysTryReturnResult(NID_APP, !IsFailed(r), E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
+
if( allowDuplication )
{
SysLog(NID_APP, "This feature(allowDuplication) is not yet implemented!");
result HandleAppWidgetRequest(const Tizen::Base::String& operationId, const Tizen::Base::Collection::IMap* pArgs);
result HandleAppWidgetPopupRequest(const Tizen::Base::String& operationId, const Tizen::Base::Collection::IMap* pArgs);
+ struct PendingTouchEvent
+ {
+ public:
+ PendingTouchEvent(int eventType, double timeStamp, double x, double y)
+ : eventType(eventType), timeStamp(timeStamp), x(x), y(y) { }
+
+ int eventType;
+ double timeStamp;
+ double x;
+ double y;
+ };
+
private:
// for AppWidget
IAppWidgetProviderFactory* __pAppWidgetFactory;
AppWidgetPopupProvider* __pAppWidgetPopupProvider;
_IAppWidgetTouchEventListener* __AppWidgetPopupTouchEventListener;
-// bool __messageReceived;
+ bool __isAppWidgetFrameReady;
+ PendingTouchEvent* __pPendingTouchEvent;
};
}} // Tizen::Shell