Change-Id: Ic729356933e2c6907d464a958f79accee3770c4e
Signed-off-by: jungmin76.park <jungmin76.park@samsung.com>
result RequestUpdateAllSuspened(void) const;
static void InitSingleton(void);
static void DestroySingleton(void);
result RequestUpdateAllSuspened(void) const;
static void InitSingleton(void);
static void DestroySingleton(void);
+ static bool SetSettingEventListener(Tizen::System::ISettingEventListener& listener);
private:
static AppWidgetManagerService* __pTheInstance;
private:
static AppWidgetManagerService* __pTheInstance;
-// provider.h
-enum instance_destroy_type
-{
- INSTANCE_DESTROY_DEFAULT,
- INSTANCE_DESTROY_PKGMGR,
- INSTANCE_DESTROY_TERMINATE,
- INSTANCE_DESTROY_FAULT,
- INSTANCE_DESTROY_UNKNOWN,
-};
-
static const char APPNAME_OSP_APPWIDGET_SERVICE[] = "osp-appwidget-service";
static const int TIMER_DURATION_PING = 120000;
//extern const int UPDATE_PERIOD_MSEC_MIN;
}
static const char APPNAME_OSP_APPWIDGET_SERVICE[] = "osp-appwidget-service";
static const int TIMER_DURATION_PING = 120000;
//extern const int UPDATE_PERIOD_MSEC_MIN;
}
AppWidgetManagerService* AppWidgetManagerService::__pTheInstance = null;
AppWidgetManagerService::AppWidgetManagerService(void)
AppWidgetManagerService* AppWidgetManagerService::__pTheInstance = null;
AppWidgetManagerService::AppWidgetManagerService(void)
SysTryReturnResult(NID_SHELL, !IsFailed(r), E_SYSTEM, "Failed to execute Construct.");
_AppWidgetManagerStub::StartIpcServer();
SysTryReturnResult(NID_SHELL, !IsFailed(r), E_SYSTEM, "Failed to execute Construct.");
_AppWidgetManagerStub::StartIpcServer();
+ InitializeCoreDaemonEventReceiver(pCoreDaemonId);
+
+ SetSettingEventListener(*this);
+
+ return E_SUCCESS;
+}
+
+bool
+AppWidgetManagerService::SetSettingEventListener(Tizen::System::ISettingEventListener& listener)
+{
+ const int MAX_TRY_COUNT = 10;
+ const int TRY_SLEEP_TIME = 250;
+ int count = 0;
+
+ while (true)
+ {
+ result r = SettingInfo::AddSettingEventListener(listener);
+ if (r == E_SUCCESS)
+ {
+ SysLog(NID_APP, "Succeeded to invoke AddSettingEventListener");
+ return true;
+ }
- SettingInfo::AddSettingEventListener(*this);
+ if (count >= MAX_TRY_COUNT)
+ {
+ SysLog(NID_APP, "Failed to invoke AddSettingEventListener");
+ break;
+ }
- return InitializeCoreDaemonEventReceiver(pCoreDaemonId);
+ count++;
+ Thread::Sleep(TRY_SLEEP_TIME);
+ SysLog(NID_APP, "%d th retry...", count);
+ }
+ return false;
SysAssertf(arg != null && arg->type == event_arg::EVENT_DELETE, "The status of data-provider-master is invalid.");
SysLog(NID_SHELL, "lb_destroy.type (%d)", arg->info.lb_destroy.type);
SysAssertf(arg != null && arg->type == event_arg::EVENT_DELETE, "The status of data-provider-master is invalid.");
SysLog(NID_SHELL, "lb_destroy.type (%d)", arg->info.lb_destroy.type);
- if (arg->info.lb_destroy.type == INSTANCE_DESTROY_PKGMGR)
+ if (arg->info.lb_destroy.type == event_arg::event_data::lb_destroy::INSTANCE_DESTROY_PKGMGR)
{
SysLog(NID_SHELL, "INSTANCE_DESTROY_PKGMGR type, ignored.");
return 0;
{
SysLog(NID_SHELL, "INSTANCE_DESTROY_PKGMGR type, ignored.");
return 0;