#include "FApp_AppArg.h"
#include "FApp_IAppImpl.h"
#include "FApp_AppResourceImpl.h"
+#include <FSys_SettingInfoImpl.h>
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
_AppInfo::SetAppState(INITIALIZING);
+ r = _SettingInfoImpl::AddSettingEventListenerForInternal(*this);
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] failed to add setting event listener.", GetErrorMessage(r));
+
return E_SUCCESS;
}
state_handler.low_memory = &OnLowMemory;
state_handler.low_battery = NULL;
- state_handler.language_changed = &OnLanguageChanged;
+ state_handler.language_changed = NULL;
state_handler.region_format_changed = NULL;
_Aul::SetPowerOffNotiListener(OnPowerOffNotiReceived, this);
SysTryReturnVoidResult(NID_APP, pAppImpl != null, E_INVALID_STATE, "[E_INVALID_STATE] Getting App instance failed.");
SysTryReturnVoidResult(NID_APP, pAppImpl->__pIAppImpl != null, E_INVALID_STATE, "[E_INVALID_STATE] Getting App instance failed.");
+ result r = _SettingInfoImpl::RemoveSettingEventListenerForInternal(*pAppImpl);
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] failed to remove setting event listener.", GetErrorMessage(r));
+
__isTerminationRequested = true;
pAppImpl->__pIAppImpl->OnTerminate();
}
{
result r = E_SUCCESS;
+ SysLog(NID_APP, "Terminate() is called by application itself");
+
__isTerminationRequested = true;
app_efl_exit();
__pApp->OnBatteryLevelChanged(batteryLevel);
}
-void
-_AppImpl::OnLanguageChanged(void* user_data)
-{
- SysLog(NID_APP, "");
- _AppInfo::UpdatePackageInfo(true);
-
- _AppResourceImpl::Reinitialize();
- SysLog(NID_APP, "Language change done.");
-}
-
-
result
_AppImpl::SendUserEvent(RequestId requestId, const IList* pArgs, bool isPublic)
{
}
}
+void
+_AppImpl::OnSettingChanged(String& key)
+{
+ if (key == L"http://tizen.org/setting/locale.language")
+ {
+ _AppInfo::UpdatePackageInfo(true);
+ _AppResourceImpl::Reinitialize();
+ SysLog(NID_APP, "Reinitialized resources due to locale change.");
+ }
+}
+
bool
_AppImpl::IsForcedTermination(void)
{