--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="org.tizen.nativecore.config.sbi.gcc45.app.debug.213939385">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.213939385" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.tizen.nativecore.NativeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="smartmanager-data" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.213939385" name="Debug" parent="org.tizen.nativecore.config.sbi.gcc45.app.debug">
+ <folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.debug.213939385." name="/" resourcePath="">
+ <toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug.1553881876" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug">
+ <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.625882023" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
+ <builder autoBuildTarget="all" buildPath="${workspace_loc:/smartmanager-data}/Debug" enableAutoBuild="true" id="org.tizen.nativecore.target.sbi.gnu.builder.707294528" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecore.target.sbi.gnu.builder"/>
+ <tool command="i586-linux-gnueabi-ar" id="org.tizen.nativecore.tool.sbi.gnu.archiver.2032334548" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
+ <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.397606660" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
+ <option id="gnu.cpp.compiler.option.optimization.level.856799377" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option defaultValue="gnu.cpp.compiler.debugging.level.max" id="sbi.gnu.cpp.compiler.option.debugging.level.core.879352235" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
+ <option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.348172367" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
+ <option id="sbi.gnu.cpp.compiler.option.7686148" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
+ <listOptionValue builtIn="false" value="mobile-4.0-emulator.core_llvm40.i386"/>
+ </option>
+ <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.951787232" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/attach-panel""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cairo""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/calendar-service2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cbhm""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/chromium-ewk""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ckm""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/contacts-svc""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/content""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/context-service""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/csr""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali-toolkit""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dbus-1.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dlog""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-buffer-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-con-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-file-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-ipc-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ector-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/e_dbus-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/edje-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eet-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-extension""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efreet-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1/eina""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eio-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eldbus-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/elementary-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/embryo-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/emile-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eo-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eom""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-client-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/feedback""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/fontconfig""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/freetype2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/geofence""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/gio-unix-2.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/glib-2.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/harfbuzz""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotcon""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/json-glib-1.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/location""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/maps""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media-content""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/messaging""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/metadata-editor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minicontrol""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minizip""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/network""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/service-adaptor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui-viewmgr""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vulkan""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/web""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_service""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_dali""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_evas""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/wifi-direct""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/yaca""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/dbus-1.0/include""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/glib-2.0/include""/>
+ </option>
+ <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.247852579" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
+ <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
+ <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
+ <listOptionValue builtIn="false" value=" -fPIE"/>
+ <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
+ </option>
+ <option id="gnu.cpp.compiler.option.include.paths.1864801607" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
+ </option>
+ <option id="sbi.gnu.cpp.compiler.option.frameworks.core.1700686400" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
+ <listOptionValue builtIn="false" value="Native_API"/>
+ </option>
+ <option id="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation.31260982" name="Defined symbols (-D)" superClass="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
+ <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
+ <listOptionValue builtIn="false" value="_DEBUG"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1388667394" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool command="clang" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.1821622204" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.179879606" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option defaultValue="gnu.c.debugging.level.max" id="sbi.gnu.c.compiler.option.debugging.level.core.2089529840" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
+ <option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.482937667" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
+ <option id="sbi.gnu.c.compiler.option.730421593" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
+ <listOptionValue builtIn="false" value="mobile-4.0-emulator.core_llvm40.i386"/>
+ </option>
+ <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.39817900" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/attach-panel""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cairo""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/calendar-service2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cbhm""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/chromium-ewk""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ckm""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/contacts-svc""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/content""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/context-service""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/csr""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali-toolkit""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dbus-1.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dlog""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-buffer-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-con-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-file-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-ipc-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ector-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/e_dbus-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/edje-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eet-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-extension""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efreet-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1/eina""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eio-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eldbus-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/elementary-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/embryo-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/emile-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eo-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eom""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-client-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/feedback""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/fontconfig""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/freetype2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/geofence""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/gio-unix-2.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/glib-2.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/harfbuzz""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotcon""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/json-glib-1.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/location""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/maps""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media-content""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/messaging""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/metadata-editor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minicontrol""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minizip""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/network""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/service-adaptor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui-viewmgr""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vulkan""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/web""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_service""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_dali""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_evas""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/wifi-direct""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/yaca""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/dbus-1.0/include""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/glib-2.0/include""/>
+ </option>
+ <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.1045237008" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" valueType="stringList">
+ <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
+ <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
+ <listOptionValue builtIn="false" value=" -fPIE"/>
+ <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
+ </option>
+ <option id="gnu.c.compiler.option.include.paths.33226905" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
+ </option>
+ <option id="sbi.gnu.c.compiler.option.frameworks.core.2030370598" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
+ <listOptionValue builtIn="false" value="Native_API"/>
+ </option>
+ <option id="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation.907415836" name="Defined symbols (-D)" superClass="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
+ <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
+ <listOptionValue builtIn="false" value="_DEBUG"/>
+ <listOptionValue builtIn="false" value="_TZ_SYS_RO_APP=TZ_SYS_RO_APP"/>
+ <listOptionValue builtIn="false" value=""TZ_SYS_RO_APP=\"/usr/apps/\""/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1428510647" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.320305403" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
+ <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.linker.1355870635" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
+ <option defaultValue="false" id="sbi.gnu.cpp.link.option.strip.346149581" name="Omit all symbol information (-s)" superClass="sbi.gnu.cpp.link.option.strip" valueType="boolean"/>
+ <option defaultValue="false" id="sbi.gnu.cpp.linker.option.shared_flag.core.333499792" name="Linker.Shared" superClass="sbi.gnu.cpp.linker.option.shared_flag.core" valueType="boolean"/>
+ <option defaultValue="false" id="sbi.gnu.cpp.linker.option.noundefined.core.14803724" name="Report unresolved symbol references (-Wl,--no-undefined)" superClass="sbi.gnu.cpp.linker.option.noundefined.core" valueType="boolean"/>
+ <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.1878576916" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
+ <listOptionValue builtIn="false" value="${TC_LINKER_MISC}"/>
+ <listOptionValue builtIn="false" value="${RS_LINKER_MISC}"/>
+ <listOptionValue builtIn="false" value="-pie -lpthread "/>
+ <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
+ <listOptionValue builtIn="false" value="-Xlinker --version-script="${PROJ_PATH}/.exportMap""/>
+ <listOptionValue builtIn="false" value="-L"${SBI_SYSROOT}/usr/lib""/>
+ <listOptionValue builtIn="false" value="$(RS_LIBRARIES)"/>
+ </option>
+ <option id="gnu.cpp.link.option.paths.861272078" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/>
+ </option>
+ <option id="gnu.cpp.link.option.libs.360594437" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="setting-common"/>
+ <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="setting-smartmanager"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1882329523" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool command="#{PLATFORM_DEFAULT_GCC_PREFIX}as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1895238645" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1440972565" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ <tool id="org.tizen.nativecore.tool.fnmapgen.1994774041" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
+ <tool id="org.tizen.nativecore.tool.fnmapgen.cpp.1923586224" name="C++ FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen.cpp"/>
+ <tool id="org.tizen.nativecore.tool.ast.619962996" name="C Static Analyzer" superClass="org.tizen.nativecore.tool.ast"/>
+ <tool id="org.tizen.nativecore.tool.ast.cpp.602382468" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
+ <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.1221973430" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
+ <tool id="org.tizen.nativecore.tool.sbi.po.compiler.48353731" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
+ <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.17772167" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="res"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="shared"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="org.tizen.nativecore.config.sbi.gcc45.app.release.99329696">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecore.config.sbi.gcc45.app.release.99329696" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.tizen.nativecore.NativeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="smartmanager-data" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.release.99329696" name="Release" parent="org.tizen.nativecore.config.sbi.gcc45.app.release">
+ <folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.release.99329696." name="/" resourcePath="">
+ <toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.release.1612317360" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.release">
+ <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.1853890380" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
+ <builder buildPath="${workspace_loc:/smartmanager-data}/Release" id="org.tizen.nativecore.target.sbi.gnu.builder.1174735954" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecore.target.sbi.gnu.builder"/>
+ <tool command="i586-linux-gnueabi-ar" id="org.tizen.nativecore.tool.sbi.gnu.archiver.226865184" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
+ <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.1004008062" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
+ <option id="gnu.cpp.compiler.option.optimization.level.1589332810" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+ <option defaultValue="gnu.cpp.compiler.debugging.level.none" id="sbi.gnu.cpp.compiler.option.debugging.level.core.259083073" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
+ <option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.594966886" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
+ <option id="sbi.gnu.cpp.compiler.option.2102244639" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
+ <listOptionValue builtIn="false" value="mobile-4.0-emulator.core_llvm40.i386"/>
+ </option>
+ <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.511355570" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/attach-panel""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cairo""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/calendar-service2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cbhm""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/chromium-ewk""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ckm""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/contacts-svc""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/content""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/context-service""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/csr""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali-toolkit""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dbus-1.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dlog""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-buffer-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-con-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-file-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-ipc-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ector-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/e_dbus-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/edje-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eet-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-extension""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efreet-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1/eina""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eio-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eldbus-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/elementary-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/embryo-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/emile-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eo-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eom""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-client-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/feedback""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/fontconfig""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/freetype2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/geofence""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/gio-unix-2.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/glib-2.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/harfbuzz""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotcon""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/json-glib-1.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/location""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/maps""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media-content""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/messaging""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/metadata-editor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minicontrol""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minizip""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/network""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/service-adaptor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui-viewmgr""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vulkan""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/web""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_service""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_dali""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_evas""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/wifi-direct""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/yaca""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/dbus-1.0/include""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/glib-2.0/include""/>
+ </option>
+ <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.1263608023" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
+ <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
+ <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
+ <listOptionValue builtIn="false" value=" -fPIE"/>
+ <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
+ </option>
+ <option id="gnu.cpp.compiler.option.include.paths.1990197436" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
+ </option>
+ <option id="sbi.gnu.cpp.compiler.option.frameworks.core.329584643" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
+ <listOptionValue builtIn="false" value="Native_API"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.994946033" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+ </tool>
+ <tool command="clang" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.1124724445" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
+ <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.1200355834" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+ <option defaultValue="gnu.c.debugging.level.none" id="sbi.gnu.c.compiler.option.debugging.level.core.1594502196" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
+ <option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.948895546" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
+ <option id="sbi.gnu.c.compiler.option.299844545" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
+ <listOptionValue builtIn="false" value="mobile-4.0-emulator.core_llvm40.i386"/>
+ </option>
+ <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.1897189570" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/attach-panel""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cairo""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/calendar-service2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cbhm""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/chromium-ewk""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ckm""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/contacts-svc""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/content""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/context-service""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/csr""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali-toolkit""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dbus-1.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dlog""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-buffer-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-con-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-file-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-ipc-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ector-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/e_dbus-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/edje-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eet-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-extension""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efreet-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1/eina""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eio-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eldbus-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/elementary-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/embryo-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/emile-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eo-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eom""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-client-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/evas-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/feedback""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/fontconfig""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/freetype2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/geofence""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/gio-unix-2.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/glib-2.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/harfbuzz""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotcon""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/json-glib-1.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/location""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/maps""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media-content""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/messaging""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/metadata-editor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minicontrol""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minizip""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/network""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/service-adaptor""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/telephony""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui-viewmgr""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vulkan""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/web""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_service""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_dali""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_evas""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/wifi-direct""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/yaca""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/dbus-1.0/include""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/glib-2.0/include""/>
+ </option>
+ <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.1746494977" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" valueType="stringList">
+ <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
+ <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
+ <listOptionValue builtIn="false" value=" -fPIE"/>
+ <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
+ </option>
+ <option id="gnu.c.compiler.option.include.paths.488570234" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
+ </option>
+ <option id="sbi.gnu.c.compiler.option.frameworks.core.268228879" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
+ <listOptionValue builtIn="false" value="Native_API"/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.326808675" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.915826056" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
+ <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.linker.2036141875" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
+ <option defaultValue="true" id="sbi.gnu.cpp.link.option.strip.225822441" name="Omit all symbol information (-s)" superClass="sbi.gnu.cpp.link.option.strip" valueType="boolean"/>
+ <option defaultValue="false" id="sbi.gnu.cpp.linker.option.shared_flag.core.690821972" name="Linker.Shared" superClass="sbi.gnu.cpp.linker.option.shared_flag.core" valueType="boolean"/>
+ <option defaultValue="false" id="sbi.gnu.cpp.linker.option.noundefined.core.1097791980" name="Report unresolved symbol references (-Wl,--no-undefined)" superClass="sbi.gnu.cpp.linker.option.noundefined.core" valueType="boolean"/>
+ <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.1661599518" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
+ <listOptionValue builtIn="false" value="${TC_LINKER_MISC}"/>
+ <listOptionValue builtIn="false" value="${RS_LINKER_MISC}"/>
+ <listOptionValue builtIn="false" value="-pie -lpthread "/>
+ <listOptionValue builtIn="false" value="--sysroot="${SBI_SYSROOT}""/>
+ <listOptionValue builtIn="false" value="-Xlinker --version-script="${PROJ_PATH}/.exportMap""/>
+ <listOptionValue builtIn="false" value="-L"${SBI_SYSROOT}/usr/lib""/>
+ <listOptionValue builtIn="false" value="$(RS_LIBRARIES)"/>
+ </option>
+ <option id="gnu.cpp.link.option.paths.558868948" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+ <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/>
+ </option>
+ <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1840028725" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool command="#{PLATFORM_DEFAULT_GCC_PREFIX}as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1068175745" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.441939856" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ <tool id="org.tizen.nativecore.tool.fnmapgen.1467701993" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
+ <tool id="org.tizen.nativecore.tool.fnmapgen.cpp.718684985" name="C++ FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen.cpp"/>
+ <tool id="org.tizen.nativecore.tool.ast.109033317" name="C Static Analyzer" superClass="org.tizen.nativecore.tool.ast"/>
+ <tool id="org.tizen.nativecore.tool.ast.cpp.117083379" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
+ <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.1120500962" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
+ <tool id="org.tizen.nativecore.tool.sbi.po.compiler.1278544836" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
+ <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.1336991750" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler"/>
+ </toolChain>
+ </folderInfo>
+ <sourceEntries>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="res"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="shared"/>
+ <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+ </sourceEntries>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="smartmanager-data.org.tizen.nativecore.target.sbi.gcc45.app.558594991" name="Tizen Native Application" projectType="org.tizen.nativecore.target.sbi.gcc45.app"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="org.tizen.nativecore.config.sbi.gcc45.app.debug.213939385">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="org.tizen.nativecore.config.sbi.gcc45.app.release.99329696">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+ <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
+ <storageModule moduleId="refreshScope"/>
+</cproject>
--- /dev/null
+{
+ global: main;
+ _IO_*;
+ local: *;
+};
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>smartmanager-data</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+ <filteredResources>
+ <filter>
+ <id>1525957086798</id>
+ <name></name>
+ <type>26</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-projectRelativePath-matches-false-false-*/.tpk</arguments>
+ </matcher>
+ </filter>
+ <filter>
+ <id>1525957086799</id>
+ <name></name>
+ <type>6</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-project_def.prop</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
+</projectDescription>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<tproject xmlns="http://www.tizen.org/tproject">
+ <platforms>
+ <platform>
+ <name>mobile-4.0</name>
+ </platform>
+ </platforms>
+ <package>
+ <blacklist/>
+ <resFallback autoGen="true"/>
+ </package>
+</tproject>
--- /dev/null
+# Appendix\r
--- /dev/null
+# Add inputs and outputs from these tool invocations to the build variables
+
+
+OS_NAME := $(shell $(UNAME))
+
+
+#ifeq ($(origin BUILD_CONFIG), undefined)
+BUILD_CONFIG ?= Debug
+#endif
+
+#ifeq ($(origin ARCH), undefined)
+ARCH ?= i386
+#endif
+
+#ifeq ($(origin PROJPATH), undefined)
+PROJPATH ?= .
+#endif
+
+
+#ifeq ($(origin PROJ_PATH), undefined)
+PROJ_PATH ?= $(PROJPATH)
+#endif
+
+#ifeq ($(strip $(OUTPUT_DIR)),)
+#OUTPUT_DIR ?= $(PROJ_PATH)/$(BUILD_CONFIG)
+#endif
+
+#ifeq ($(strip $(BUILD_ARCH)),)
+BUILD_ARCH ?= $(ARCH)
+#endif
+
+#ifeq ($(strip $(ENVENTOR_PATH)),)
+ENVENTOR_PATH ?= $(SDK_TOOLPATH)/enventor
+#endif
--- /dev/null
+# C/C++ build script
+
+
+_FUNC_EXT2O = $(patsubst %.$(3),$(1)/%.o,$(2))
+_FUNC_C2O = $(call _FUNC_EXT2O,$(1),$(2),c)
+_FUNC_CPP2O = $(call _FUNC_EXT2O,$(1),$(2),cpp)
+
+
+# parameter :
+# $(1) - C/C++ soruce file
+# $(2) - output path
+# $(3) - .ext
+# $(4) - unique id
+CONVERT_ESC_EXT_TO_O = $(addprefix $(2)/,$(notdir $(patsubst %.$(3),%-$(4).o,$(1))))
+
+#CONVERT_ESC_C_TO_O = $(call CONVERT_ESC_EXT_TO_O,$(1),$(2),c)
+#CONVERT_ESC_CPP_TO_O = $(call CONVERT_ESC_EXT_TO_O,$(1),$(2),cpp)
+
+
+# parameter :
+# $(1) - encoded one C/C++ soruce file
+# $(2) - output path
+# $(3) - ext title (C/C++)
+# $(4) - ext (c/cpp)
+# $(5) - compiler ($(CC)/$(CXX))
+# $(6) - build opt
+# $(7) - build opt file
+# output :
+# $(8) - output files list
+define C_BUILD_PROC_RAW
+$(call CONVERT_ESC_EXT_TO_O,$(1),$(2),$(4),$(8)) : $(call DECODE_4MAKE,$(1)) $(7)
+ @echo ' Building file: $$<'
+ @echo ' Invoking: $(3) Compiler'
+ $$(call MAKEDIRS,$$(@D))
+ $(5) -c "$$<" -o "$$@" $(6) -Wp,@$(7)
+ @echo ' Finished building: $$<'
+$(9) += $(call CONVERT_ESC_EXT_TO_O,$(1),$(2),$(4),$(8))
+endef
+
+
+# parameter :
+# $(1) - output paths
+# $(2) - src paths
+# $(3) - inc paths
+# $(4) - inc files
+# $(5) - Defs
+# $(6) - UnDefs
+# $(7) - compiler opt
+# $(8) - compiler opt file
+# $(9) - ext title (C/C++)
+# $(10) - ext (c/cpp)
+# $(11) - compiler ($(CC)/$(CXX))
+# output :
+# $(12) - OBJS
+# return :
+# none
+define C_PROC_RAW
+
+_OUTPUT_DIR := $$(strip $(1))#
+_SRCS := $(2)#
+_INCS := $(3)#
+_INC_FILES := $(4)#
+_DEFS := $(5)#
+_UNDEFS := $(6)#
+
+_OPT := $(7)
+_OPT_FILE := $(8)
+
+_EXT_TITLE := $(9)
+_EXT := $(10)
+_COMPILER := $(11)
+
+#_OUTPUT_FILES := $(12)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_SRCS))
+_ENC_SRCS := $$(filter %.$$(_EXT),$$(_ENC_SRCS))
+
+ifneq ($$(strip $$(_SRCS)),)
+
+_NORMAL_SRCS := $$(filter-out %*.$$(_EXT),$$(_ENC_SRCS))
+_WIDLCARD_SRCS := $$(filter %*.$$(_EXT),$$(_ENC_SRCS))
+
+_ALL_SRCS := $$(call DECODE_4MAKE,$$(_NORMAL_SRCS)) \
+ $$(foreach var,$$(_WIDLCARD_SRCS),$$(call FIND_FILES_4MAKE,$$(call DECODE_4MAKE,$$(var))))
+
+ifneq ($$(strip $$(_ALL_SRCS)),)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_ALL_SRCS))
+
+_CDEFS := $$(CDEFS)
+_CDEFS += $$(addprefix -D,$$(_DEFS))
+_CDEFS += $$(addprefix -U,$$(_UNDEFS))
+
+_ENC_C_INCS := $$(call ENCODE_4MAKE,$$(_INCS))
+_ENC_C_INCS := $$(addprefix -I,$$(_ENC_C_INCS))
+
+_ENC_INC_FILES := $$(call ENCODE_4MAKE,$$(_INC_FILES))
+_ENC_INC_FILES += $$(addprefix -include,$$(_ENC_INC_FILES))
+
+_C_INCS := $$(call DECODE_4MAKE,$$(_ENC_C_INCS) $$(_ENC_C_INC_FILES))
+
+_DEFS := $$(_CDEFS) $$(_C_INCS) -I"pch" $$(_OPT)
+
+_UNIQUE_ID = $$(firstword $$(shell echo $$(var) | $$(CKSUM)))
+
+$$(foreach var,$$(_ENC_SRCS),$$(eval $$(call C_BUILD_PROC_RAW,$$(var),$$(_OUTPUT_DIR),$$(_EXT_TITLE),$$(_EXT),$$(_COMPILER),$$(_DEFS),$$(_OPT_FILE),$$(_UNIQUE_ID),$(12))))
+
+endif # (_(strip _(_ALL_SRCS)),)
+
+endif # (_(strip _(_SRCS)),)
+
+
+endef
--- /dev/null
+# EDC build script
+
+
+FUNC_EDC2EDJ = $(patsubst %.edc,$(2)/%.edj,$(1))
+
+# parameter :
+# $(1) - C/C++ soruce file
+# $(2) - output path
+CONVERT_ESC_EDC_TO_EDJ = $(call CONVERT_4MAKE_TO_OUT,$(call FUNC_EDC2EDJ,$(1),$(2)))
+
+
+# parameter :
+# $(1) - encoded one C/C++ soruce file
+# $(2) - output path
+# $(3) - build opt
+# output :
+# $(4) - output files list
+define EDJ_BUILD_PROC_RAW
+$(call CONVERT_ESC_EDC_TO_EDJ,$(1),$(2)) : $(call DECODE_4MAKE,$(1))
+ @echo ' Building file: $$<'
+ @echo ' Invoking: EDC Resource Compiler'
+ $$(call MAKEDIRS,$$(@D))
+ $$(EDJE_CC) $(3) "$$<" "$$@"
+ @echo ' Finished building: $$<'
+$(4) += $(call CONVERT_ESC_EDC_TO_EDJ,$(1),$(2))
+endef
+
+
+# parameter :
+# $(1) - output paths
+# $(2) - src paths
+# $(3) - image inc paths
+# $(4) - sound inc paths
+# $(5) - font inc paths
+# output :
+# $(6) - OBJS
+# return :
+# none
+define EDJ_PROC_RAW
+
+_OUTPUT_DIR := $$(strip $(1))#
+_SRCS := $(2)#
+_IMAGE_DIRS := $(3)#
+_SOUND_DIRS := $(4)#
+_FONT_DIRS := $(5)#
+
+ifneq ($$(strip $$(_SRCS)),)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_SRCS))
+
+_NORMAL_SRCS := $$(filter-out %*.edc,$$(_ENC_SRCS))
+_WIDLCARD_SRCS := $$(filter %*.edc,$$(_ENC_SRCS))
+
+_ALL_SRCS := $$(call DECODE_4MAKE,$$(_NORMAL_SRCS)) \
+ $$(foreach var,$$(_WIDLCARD_SRCS),$$(call FIND_FILES_4MAKE,$$(call DECODE_4MAKE,$$(var))))
+
+ifneq ($$(strip $$(_ALL_SRCS)),)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_ALL_SRCS))
+
+_COMPILER_FLAGS := -id "$$(ENVENTOR_SHARED_RES_PATH)/images"
+_COMPILER_FLAGS += -sd "$$(ENVENTOR_SHARED_RES_PATH)/sounds"
+_COMPILER_FLAGS += -fd "$$(ENVENTOR_SHARED_RES_PATH)/fonts"
+
+ifneq ($$(strip $$(_IMAGE_DIRS)),)
+_COMPILER_FLAGS += $$(addprefix -id ,$$(_IMAGE_DIRS))
+endif
+ifneq ($$(strip $$(_SOUND_DIRS)),)
+_COMPILER_FLAGS += $$(addprefix -sd ,$$(_SOUND_DIRS))
+endif
+ifneq ($$(strip $$(_FONT_DIRS)),)
+_COMPILER_FLAGS += $$(addprefix -fd ,$$(_FONT_DIRS))
+endif
+
+$$(foreach var,$$(_ENC_SRCS),$$(eval $$(call EDJ_BUILD_PROC_RAW,$$(var),$$(_OUTPUT_DIR),$$(_COMPILER_FLAGS),$(6))))
+
+endif # (_(strip _(_ALL_SRCS)),)
+
+endif # (_(strip _(_SRCS)),)
+
+endef
--- /dev/null
+# PO build script
+
+
+_FUNC_PO2MO = $(patsubst %.po,$(2)/res/locale/%/LC_MESSAGES/$(3).mo,$(notdir $(1)))
+
+
+# parameter :
+# $(1) - C/C++ soruce file
+# $(2) - output path
+# $(3) - app name
+CONVERT_ESC_PO_TO_MO = $(call CONVERT_4MAKE_TO_OUT,$(call _FUNC_PO2MO,$(1),$(2),$(3)))
+
+
+# parameter :
+# $(1) - encoded one C/C++ soruce file
+# $(2) - output path
+# $(3) - app name
+# output :
+# $(4) - output files list
+define MO_BUILD_PROC_RAW
+$(call CONVERT_ESC_PO_TO_MO,$(1),$(2),$(3)) : $(call DECODE_4MAKE,$(1))
+ @echo ' Building file: $$<'
+ @echo ' Invoking: msgfmt String Formatter'
+ $$(call MAKEDIRS,$$(@D))
+ $$(MSGFMT) -o "$$@" "$$<"
+ @echo ' Finished building: $$<'
+$(4) += $(call CONVERT_ESC_PO_TO_MO,$(1),$(2),$(3))
+endef
+
+
+# parameter :
+# $(1) - output dir
+# $(2) - src paths
+# $(3) - app name
+# output :
+# $(4) - OBJS
+
+define MO_PROC_RAW
+
+_OUTPUT_DIR := $(1)
+_SRCS := $(2)
+_APPNAME := $(3)
+
+ifneq ($$(strip $$(_SRCS)),)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_SRCS))
+
+_NORMAL_SRCS := $$(filter-out %*.po,$$(_ENC_SRCS))
+_WIDLCARD_SRCS := $$(filter %*.po,$$(_ENC_SRCS))
+
+_ALL_SRCS := $$(call DECODE_4MAKE,$$(_NORMAL_SRCS)) \
+ $$(foreach var,$$(_WIDLCARD_SRCS),$$(call FIND_FILES_4MAKE,$$(call DECODE_4MAKE,$$(var))))
+
+ifneq ($$(strip $$(_ALL_SRCS)),)
+
+_ENC_SRCS := $$(call ENCODE_4MAKE,$$(_ALL_SRCS))
+
+$$(foreach var,$$(_ENC_SRCS),$$(eval $$(call MO_BUILD_PROC_RAW,$$(var),$$(_OUTPUT_DIR),$$(_APPNAME),$(4))))
+
+endif # (_(strip _(_ALL_SRCS)),)
+
+endif # (_(strip _(_SRCS)),)
+
+endef
--- /dev/null
+
+DEBUG_OP = -g3 -D_DEBUG
+CPP_DEBUG_OP = -D_DEBUG
+
+OPTIMIZATION_OP = -O0
+CPP_OPTIMIZATION_OP =
+
+COMPILE_FLAGS = $(DEBUG_OP) $(OPTIMIZATION_OP) -Wall -c -fmessage-length=0
+
+CPP_COMPILE_FLAGS = $(CPP_DEBUG_OP) $(CPP_OPTIMIZATION_OP)
+
+LINK_FLAGS =
+
+AR_FLAGS =
+
+EDC_COMPILE_FLAGS =
\ No newline at end of file
--- /dev/null
+
+BSLASH := \\#
+NULL_CHAR := #
+SPACE := \ #
+COLON := :#
+DOTDOT := ..#
+SPACE_ESC := &sp;#
+COLON_ESC := &co;#
+SPACE_OUT := ~sp~#
+COLON_OUT := ~co~#
+DOTDOT_OUT := ~dtdt~#
+
+BSLASH2SLASH = $(subst $(BSLASH),/,$(1))
+
+REMOVE_TAIL = $(patsubst %/,%,$(1))
+
+#LOWER_CASE = $(shell echo translit($(1),[A-Z],[a-z])|$(M4))
+LOWER_CASE = $(shell echo $(1)|$(TR) [A-Z] [a-z])
+
+#ifneq ($(findstring Windows,$(OS)),)
+# ...
+#endif
+
+FIND_FILES = $(shell $(FIND) $(1)/$(2) | $(SED) 's/^$(subst /,$(BSLASH)/,$(1))$(BSLASH)///')
+FIND_FILES_ESC = $(shell $(FIND) $(1)/$(2) | $(SED) 's/^$(subst /,$(BSLASH)/,$(1))$(BSLASH)///' -e 's/:/$(BSLASH)&co;/g' -e 's/$(BSLASH) /$(BSLASH)&sp;/g')
+FIND_FILES_4MAKE = $(shell $(FIND) $(1)/$(2) | $(SED) 's/^$(subst /,$(BSLASH)/,$(1))$(BSLASH)///')
+
+FIND_FILES_ABS = $(shell $(FIND) $(1))
+FIND_FILES_ABS_4MAKE = $(shell $(FIND) $(1) -e 's/$(BSLASH) /$(BSLASH)&sp;/g')
+FIND_FILES_ABS_ESC = $(shell $(FIND) $(1) -e 's/:/$(BSLASH)&co;/g' -e 's/$(BSLASH) /$(BSLASH)&sp;/g')
+
+FIND_FILES_4MAKE = $(shell $(FIND) $(1) | $(SED) 's/ /\\\ /g')
+
+#ENCODE_ESC = $(shell echo $(1) | $(SED) -e 's/:/$(BSLASH)&co;/g' -e 's/$(BSLASH) /$(BSLASH)&sp;/g')
+#DECODE_ESC = $(shell echo $(1) | $(SED) -e 's/$(BSLASH)&co;/:/g' -e 's/$(BSLASH)&sp;/$(BSLASH) / g')
+ENCODE_ESC = $(subst $(SPACE),$(SPACE_ESC),$(subst $(COLON),$(COLON_ESC),$(1)))
+DECODE_ESC = $(subst $(COLON_ESC),$(COLON),$(subst $(SPACE_ESC),$(SPACE),$(1)))
+ENCODE_4MAKE = $(subst $(SPACE),$(SPACE_ESC),$(1))
+DECODE_4MAKE = $(subst $(SPACE_ESC),$(SPACE),$(1))
+
+CONVERT_TO_OUT = $(subst $(DOTDOT),$(DOTDOT_OUT),$(subst $(COLON),$(COLON_OUT),$(subst $(SPACE),$(SPACE_OUT),$(1))))
+CONVERT_ESC_TO_OUT = $(subst $(DOTDOT),$(DOTDOT_OUT),$(subst $(COLON_ESC),$(COLON_OUT),$(subst $(SPACE_ESC),$(SPACE_OUT),$(1))))
+CONVERT_4MAKE_TO_OUT = $(subst $(DOTDOT),$(DOTDOT_OUT),$(subst $(COLON),$(COLON_OUT),$(subst $(SPACE_ESC),$(SPACE_OUT),$(1))))
+
+PROC_NO_EXIST = $(if $(wildcard $(1)),,$(call $(2),$(1)))
+define MAKEDIRS0
+ @echo ' Building directory: $(1)'
+ @$(MKDIR) $(MKDIR_OP) $(subst $(BSLASH),/,$(1))
+endef
+MAKEDIRS = $(call PROC_NO_EXIST,$(1),MAKEDIRS0)
--- /dev/null
+#
+# Usege : make -f <proj_root>/Build/makefile -C <proj_root>
+#
+
+BUILD_SCRIPT_VERSION := 1.1.0
+
+.PHONY : app_version app_build app_clean build_version
+
+
+all : app_build
+
+clean : app_clean
+
+version : build_version
+
+#PROJ_ROOT = .
+#BUILD_ROOT := $(PROJ_PATH)/Build#
+
+ifeq ($(MAKE_NAME),mingw32-make)
+ifneq ($(SHELL),)
+OPTIONS += --eval="SHELL=$(SHELL)"
+endif
+endif
+
+app_build :
+ @echo $(MAKE) -f "$(BUILD_ROOT)/makefile.mk"
+ @$(MAKE_BIN) -f "$(BUILD_ROOT)/makefile.mk" -C "$(PROJ_PATH)" $(OPTIONS)
+
+app_clean :
+ @$(MAKE) -f "$(BUILD_ROOT)/makefile.mk" -C "$(PROJ_PATH)" $(OPTIONS) clean
+
+build_version :
+ @echo makefile : $(BUILD_SCRIPT_VERSION)
+ @$(MAKE) -f "$(BUILD_ROOT)/makefile.mk" -C "$(PROJ_PATH)" $(OPTIONS) version
--- /dev/null
+#
+# Usege : make -f <proj_root>/Build/makefile -C <proj_root>
+#
+
+BUILD_SCRIPT_VERSION := 1.2.3
+
+.PHONY : app_version app_clean build_version
+
+
+all : app_build
+
+clean : app_clean
+
+version : build_version
+
+_BLANK :=#
+_SPACE := $(_BLANK) $(_BLANK)#
+_SPACE_4MAKE := \$(_SPACE)#
+
+NULL_CHAR :=#
+SPACE := $(NULL_CHAR) $(NULL_CHAR)#
+
+PROJ_ROOT := .
+_PROJ_ROOT_4MAKE := $(subst $(_SPACE),$(_SPACE_4MAKE),$(PROJ_ROOT))#
+PROJ_ROOT=$(_PROJ_ROOT_4MAKE)
+_BUILD_ROOT_4MAKE := $(subst $(_SPACE),$(_SPACE_4MAKE),$(BUILD_ROOT))#
+BUILD_ROOT=$(_BUILD_ROOT_4MAKE)
+
+include $(BUILD_ROOT)/basedef.mk
+
+include $(PROJ_ROOT)/project_def.prop
+-include $(PROJ_ROOT)/build_def.prop
+
+include $(BUILD_ROOT)/funcs.mk
+
+-include $(BUILD_ROOT)/tooldef.mk
+-include $(BUILD_ROOT)/flags.mk
+-include $(BUILD_ROOT)/platform.mk
+
+
+APPTYPE := $(type)
+
+OUTPUT_DIR := $(PROJ_ROOT)/$(BUILD_CONFIG)
+OBJ_OUTPUT := $(OUTPUT_DIR)/objs
+
+LOWER_APPNAME := $(call LOWER_CASE,$(APPNAME))
+APPID2 := $(subst $(basename $(APPID)).,,$(APPID))
+
+ifeq ($(strip $(APPTYPE)),app)
+APPFILE := $(OUTPUT_DIR)/$(LOWER_APPNAME)
+endif
+ifeq ($(strip $(APPTYPE)),staticLib)
+APPFILE := $(OUTPUT_DIR)/lib$(LOWER_APPNAME).a
+endif
+ifeq ($(strip $(APPTYPE)),sharedLib)
+APPFILE := $(OUTPUT_DIR)/lib$(LOWER_APPNAME).so
+endif
+
+ifneq ($(strip $(PLATFORM_INCS)),)
+PLATFORM_INCS_FILE := $(OBJ_OUTPUT)/platform_incs_file.inc
+endif
+
+include $(BUILD_ROOT)/build_c.mk
+
+
+ifeq ($(strip $(APPTYPE)),app)
+EXT_OP := -fPIE
+endif
+ifeq ($(strip $(APPTYPE)),staticLib)
+EXT_OP := -fPIE
+endif
+ifeq ($(strip $(APPTYPE)),sharedLib)
+EXT_OP := -fPIC
+endif
+
+C_OPT := $(COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) $(EXT_OP) --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) $(USER_C_OPTS)
+CPP_OPT := $(CPP_COMPILE_FLAGS) $(TC_COMPILER_MISC) $(RS_COMPILER_MISC) $(EXT_OP) --sysroot="$(SYSROOT)" -Werror-implicit-function-declaration $(M_OPT) $(USER_CPP_OPTS)
+C_OPT_FILE := $(PLATFORM_INCS_FILE)
+
+OBJS := #
+
+# Global C/C++
+ifeq ($(strip $(USER_ROOT)),)
+USER_ROOT := $(PROJ_ROOT)
+endif
+$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_SRCS),$(USER_INC_DIRS),$(USER_INC_FILES),$(USER_DEFS),$(USER_UNDEFS),$(C_OPT),$(C_OPT_FILE),C,c,$(CC),OBJS))
+$(foreach ext,cpp cxx cc c++ C,$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_SRCS),$(USER_INC_DIRS),$(USER_CPP_INC_FILES),$(USER_CPP_DEFS),$(USER_CPP_UNDEFS),$(CPP_OPT),$(C_OPT_FILE),C++,$(ext),$(CXX),OBJS)))
+
+# Individual C/C++
+ifneq ($(strip $(USER_EXT_C_KEYS)),)
+$(foreach var,$(USER_EXT_C_KEYS),$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_EXT_$(var)_SRCS),$(USER_EXT_$(var)_INC_DIRS),$(USER_EXT_$(var)_INC_FILES),$(USER_EXT_$(var)_DEFS),$(USER_EXT_$(var)_UNDEFS),$(C_OPT),$(C_OPT_FILE),C,c,$(CC),OBJS)))
+$(foreach ext,cpp cxx cc c++ C,$(foreach var,$(USER_EXT_C_KEYS),$(eval $(call C_PROC_RAW,$(OBJ_OUTPUT),$(USER_EXT_$(var)_SRCS),$(USER_EXT_$(var)_INC_DIRS),$(USER_EXT_$(var)_CPP_INC_FILES),$(USER_EXT_$(var)_CPP_DEFS),$(USER_EXT_$(var)_CPP_UNDEFS),$(CPP_OPT),$(C_OPT_FILE),C++,$(ext),$(CXX),OBJS))))
+endif
+
+
+ifneq ($(strip $(USER_LIB_DIRS)),)
+_ENC_USER_LIB_DIRS := $(call ENCODE_4MAKE,$(USER_LIB_DIRS))
+_ENC_USER_LIB_DIRS := $(addprefix -L,$(_ENC_USER_LIB_DIRS))
+LIBPATHS := $(call DECODE_4MAKE,$(_ENC_USER_LIB_DIRS))
+endif
+
+LIBS += $(addprefix -l,$(USER_LIBS))
+
+UOBJS += $(USER_OBJS)
+
+M_OPT = -MMD -MP -MF"$(@:%.o=%.d)"
+
+DEPS := $(OBJS:.o=.d)
+
+ifneq ($(strip $(DEPS)),)
+-include $(PROJ_ROOT)/Build/$(DEPS)
+endif
+
+
+ifeq ($(strip $(APPTYPE)),app)
+$(APPFILE) : $(OBJS) $(UOBJS)
+ @echo ' Building target: $@'
+ @echo ' Invoking: C/C++ Linker'
+ $(call MAKEDIRS,$(@D))
+ $(CXX) -o $(APPFILE) $(OBJS) $(UOBJS) $(LIBPATHS) -Xlinker --as-needed $(LIBS) $(LINK_FLAGS) $(TC_LINKER_MISC) $(RS_LINKER_MISC) -pie -lpthread --sysroot="$(SYSROOT)" -Xlinker --version-script="$(PROJ_ROOT)/.exportMap" $(RS_LIB_PATHS) $(RS_LIBRARIES) -Xlinker -rpath='$$ORIGIN/../lib' -Werror-implicit-function-declaration $(USER_LINK_OPTS)
+ @echo ' Finished building target: $@'
+endif
+ifeq ($(strip $(APPTYPE)),staticLib)
+$(APPFILE) : $(OBJS) $(UOBJS)
+ @echo ' Building target: $@'
+ @echo ' Invoking: Archive utility'
+ $(call MAKEDIRS,$(@D))
+ $(AR) -r $(APPFILE) $(OBJS) $(UOBJS) $(AR_FLAGS) $(USER_LINK_OPTS)
+ @echo ' Finished building target: $@'
+endif
+ifeq ($(strip $(APPTYPE)),sharedLib)
+$(APPFILE) : $(OBJS) $(UOBJS)
+ @echo ' Building target: $@'
+ @echo ' Invoking: C/C++ Linker'
+ $(call MAKEDIRS,$(@D))
+ $(CXX) -o $(APPFILE) $(OBJS) $(UOBJS) $(LIBPATHS) -Xlinker --as-needed $(LIBS) $(LINK_FLAGS) $(TC_LINKER_MISC) $(RS_LINKER_MISC) -shared -lpthread --sysroot="$(SYSROOT)" $(RS_LIB_PATHS) $(RS_LIBRARIES) $(USER_LINK_OPTS)
+ @echo ' Finished building target: $@'
+endif
+
+
+$(OBJ_OUTPUT) :
+ $(call MAKEDIRS,$@)
+
+$(OUTPUT_DIR) :
+ $(call MAKEDIRS,$@)
+
+
+#ifneq ($(strip $(PLATFORM_INCS)),)
+#$(PLATFORM_INCS_FILE) : $(OBJ_OUTPUT)
+# @echo ' Building inc file: $@'
+#ifneq ($(findstring Windows,$(OS)),)
+#ifneq ($(findstring 3.82,$(MAKE_VERSION)),)
+# $(file > $@,$(PLATFORM_INCS))
+#else
+# @echo $(PLATFORM_INCS) > $@
+#endif
+#else
+# @echo '$(PLATFORM_INCS)' > $@
+#endif
+#endif
+
+
+include $(BUILD_ROOT)/build_edc.mk
+
+#ifeq ($(strip $(ENVENTOR_SHARED_RES_PATH)),)
+ENVENTOR_SHARED_RES_PATH ?= $(ENVENTOR_PATH)/share/enventor
+#endif
+
+EDJ_FILES :=
+
+# Global EDCs
+ifneq ($(strip $(USER_EDCS)),)
+$(eval $(call EDJ_PROC_RAW,$(OUTPUT_DIR),$(USER_EDCS),$(USER_EDCS_IMAGE_DIRS),$(USER_EDCS_SOUND_DIRS),$(USER_EDCS_FONT_DIRS),EDJ_FILES))
+endif
+
+# Individual EDCs
+ifneq ($(strip $(USER_EXT_EDC_KEYS)),)
+$(foreach var,$(USER_EXT_EDC_KEYS),$(eval $(call EDJ_PROC_RAW,$(OUTPUT_DIR),$(USER_EXT_$(var)_EDCS),$(USER_EXT_$(var)_EDCS_IMAGE_DIRS),$(USER_EXT_$(var)_EDCS_SOUND_DIRS),$(USER_EXT_$(var)_EDCS_FONT_DIRS),EDJ_FILES)))
+endif
+
+
+include $(BUILD_ROOT)/build_po.mk
+
+MO_FILES :=
+
+# Global POs
+ifneq ($(strip $(USER_POS)),)
+$(eval $(call MO_PROC_RAW,$(OUTPUT_DIR),$(USER_POS),$(APPID2),MO_FILES))
+endif
+
+
+secondary-outputs : $(EDJ_FILES) $(MO_FILES)
+
+-include appendix.mk
+
+app_build : $(OUTPUT_DIR) $(APPFILE) secondary-outputs
+ @echo ========= done =========
+
+
+app_clean :
+ rm -f $(APPFILE)
+ rm -rf $(OUTPUT_DIR)
+
+build_version :
+ @echo makefile.mk : $(BUILD_SCRIPT_VERSION)
--- /dev/null
+# Add inputs and outputs from these tool invocations to the build variables
+
+SYSROOT = $(SBI_SYSROOT)
+
+#USR_INCS := $(addprefix -I "$(SYSROOT),$(PLATFORM_INCS_EX))
+USR_INCS1 := $(addsuffix ",$(PLATFORM_INCS_EX))
+USR_INCS := $(addprefix -I "$(SYSROOT),$(USR_INCS1))
+
+ifeq ($(strip $(PLATFORM_LIB_PATHS)),)
+RS_LIB_PATHS := "$(SYSROOT)/usr/lib"
+else
+RS_LIB_PATHS1 := $(addsuffix ",$(PLATFORM_LIB_PATHS))
+RS_LIB_PATHS := $(addprefix -L "$(SYSROOT),$(RS_LIB_PATHS1))
+endif
+
+RS_LIBRARIES := $(addprefix -l,$(RS_LIBRARIES_EX))
+
+PLATFORM_INCS = $(USR_INCS) -I "$(SDK_PATH)/library"
--- /dev/null
+# Add inputs and outputs from these tool invocations to the build variables
+
+ifneq ($(strip $(SHELL_BIN)),)
+SHELL = $(SHELL_BIN)
+else
+SHELL = sh
+endif
+
+ifneq ($(strip $(MKDIR_BIN)),)
+MKDIR = $(MKDIR_BIN)
+MKDIR_OP = -p
+else
+MKDIR = mkdir
+MKDIR_OP = -p
+endif
+
+ifneq ($(strip $(UNAME_BIN)),)
+UNAME = $(UNAME_BIN)
+else
+UNAME = uname
+endif
+
+ifneq ($(strip $(M4_BIN)),)
+M4 = $(M4_BIN)
+else
+M4 = m4
+endif
+
+ifneq ($(strip $(TR_BIN)),)
+TR = $(TR_BIN)
+else
+TR = tr
+endif
+
+ifneq ($(strip $(FIND_BIN)),)
+FIND = $(FIND_BIN)
+else
+FIND = find
+endif
+
+ifneq ($(strip $(SED_BIN)),)
+SED = $(SED_BIN)
+else
+SED = sed
+endif
+
+ifneq ($(strip $(GREP_BIN)),)
+GREP = $(GREP_BIN)
+else
+GREP = grep
+endif
+
+ifneq ($(strip $(EDJE_CC_BIN)),)
+EDJE_CC = $(EDJE_CC_BIN)
+else
+EDJE_CC = edje_cc
+endif
+
+ifneq ($(strip $(MSGFMT_BIN)),)
+MSGFMT = $(MSGFMT_BIN)
+else
+MSGFMT = msgfmt
+endif
+
+ifneq ($(strip $(CKSUM_BIN)),)
+CKSUM = $(CKSUM_BIN)
+else
+CKSUM = cksum
+endif
+
--- /dev/null
+
+# Add pre/post build process
+PREBUILD_DESC =
+PREBUILD_COMMAND =
+POSTBUILD_DESC =
+POSTBUILD_COMMAND =
--- /dev/null
+#ifndef SM_DATA_MAIN_VIEW_H_
+#define SM_DATA_MAIN_VIEW_H_
+
+#include "smartmanager-data.h"
+
+void init_main_view(SmartMgrData *ad);
+
+#endif /* SM_DATA_MAIN_VIEW_H_ */
--- /dev/null
+#ifndef SM_DATA_USAGE_MOBILE_SETTINGS_H
+#define SM_DATA_USAGE_MOBILE_SETTINGS_H
+
+#include "smartmanager-data.h"
+
+void init_mobile_settings_view(SmartMgrData *smd);
+
+#endif // SM_DATA_USAGE_MOBILE_SETTINGS_H
--- /dev/null
+#ifndef SM_DATA_USAGE_WIFI_SETTINGS_H
+#define SM_DATA_USAGE_WIFI_SETTINGS_H
+
+#include "smartmanager-data.h"
+
+void init_wifi_settings_view(SmartMgrData *smd);
+
+#endif // SM_DATA_USAGE_MOBILE_SETTINGS_H
--- /dev/null
+/*
+ * sm-data-main.h
+ *
+ * Created on: Aug 24, 2016
+ * Author: r.kintop
+ */
+
+#ifndef SM_DATA_H_
+#define SM_DATA_H_
+
+#include <app.h>
+#include <dlog.h>
+#include <telephony.h>
+#include <stc.h>
+#include <app_info.h>
+#include <app_manager.h>
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "SmartManager-Data"
+
+#if !defined(PACKAGE)
+#define PACKAGE "org.tizen.setting"
+#endif
+
+#include <setting-common/setting-common-init.h>
+#include <setting-common/setting-common-view.h>
+
+typedef enum {
+ MV_UPDATE_APPEND_NONE = 0,
+ MV_UPDATE_SIM_STATE_CHANGED,
+ MV_UPDATE_SIM_1_TOTAL_DATA_USAGE,
+ MV_UPDATE_SIM_2_TOTAL_DATA_USAGE,
+ MV_UPDATE_WIFI_TOTAL_DATA_USAGE,
+ MV_UPDATE_SIM_1_WARN_N_LIMIT,
+ MV_UPDATE_SIM_2_WARN_N_LIMIT,
+ MV_UPDATE_WIFI_WARN_N_LIMIT,
+ MV_UPDATE_CLEAR_ALL_SIM_1_APPS,
+ MV_UPDATE_CLEAR_ALL_SIM_2_APPS,
+ MV_UPDATE_CLEAR_ALL_WIFI_APPS,
+ MV_UPDATE_APPEND_SIM_1_APP,
+ MV_UPDATE_APPEND_SIM_2_APP,
+ MV_UPDATE_APPEND_WIFI_APP
+} mv_update_type;
+
+typedef enum {
+ CYCLE_MODE_MONTHLY = 0,
+ CYCLE_MODE_WEEKLY,
+ CYCLE_MODE_DAILY,
+ CYCLE_MODE_CUSTOM
+} Cycle_Mode_E;
+
+typedef struct {
+ int64_t total_data_used;
+ int64_t warning;
+ int64_t limit;
+ Cycle_Mode_E cycle_mode;
+ time_t interval_from;
+ time_t interval_to;
+ int custom_mode_interval;
+ int cycle_start;
+} Data_Limits_T;
+
+typedef struct {
+ MainData md;
+ Evas_Object *toolbar;
+
+ telephony_handle_list_s telephony_handles;
+ int num_sim_cards_available; /* Number of SIM cards available.
+ Necessary for the main view. */
+ char *subscriber_id_1; /* Subscriber ID numbers of sim cards*/
+ char *subscriber_id_2;
+
+ /* These are lists of application items *
+ * returned by Data Usage API (model).
+ * They contain elements of type data_usage_app_item_t :
+ * */
+ Eina_List *sim_1_apps;
+ Eina_List *sim_2_apps;
+ Eina_List *wifi_apps;
+
+ /* Main view data: */
+ Ecore_Timer *main_view_update_timer; /* This timer schedules an update
+ * for the progress bar item and apps
+ * list.
+ */
+ mv_update_type main_view_update_type;
+ setting_view *main_view;
+ Elm_Gen_Item_Class gl_header_itc;
+ Elm_Gen_Item_Class gl_data_usage_itc;
+ Elm_Gen_Item_Class gl_text_itc;
+ Elm_Gen_Item_Class gl_application_itc;
+
+ Elm_Widget_Item *toolbar_item_sim_1; /* Toolbar item for SIM1 */
+ Elm_Widget_Item *toolbar_item_sim_2; /* Toolbar item for SIM2 */
+ Elm_Widget_Item *toolbar_item_wifi; /* Toolbar item for WIFI */
+
+ Evas_Object *sim_1_genlist; /* Genlist for SIM1 */
+ Elm_Object_Item *item_sim_1_data_amount; /* The genlist item with
+ progress bar */
+ Elm_Object_Item *item_sim_1_data_usage_set; /* The genlist item which allows
+ the user to enter data
+ settings view */
+ Elm_Object_Item *item_sim_1_first_app_info; /* The first application */
+ /* item on the list */
+ Evas_Object *sim_2_genlist; /* Genlist for SIM2 */
+ Elm_Object_Item *item_sim_2_data_amount; /* The genlist item with
+ progress bar */
+ Elm_Object_Item *item_sim_2_data_usage_set; /* The genlist item which
+ allows the user to enter
+ data settings view */
+ Elm_Object_Item *item_sim_2_first_app_info; /* The first application */
+ /* item on the list */
+ Evas_Object *wifi_genlist; /* Genlist for WIFI */
+ Elm_Object_Item *item_wifi_data_amount; /* The genlist item with
+ progress bar */
+ Elm_Object_Item *item_wifi_data_usage_set; /* The genlist item which
+ allows the user to enter
+ data settings view */
+ Elm_Object_Item *item_wifi_first_app_info; /* The first application */
+
+ /* Wifi view data usage settings: */
+ setting_view *wifi_view;
+ Evas_Object *wifi_data_setting_genlist;
+
+ /* Mobile view data usage settings: */
+ setting_view *mobile_view;
+ const char *selected_sim_subscriber_id;
+ Data_Limits_T *selected_sim_limits;
+
+ /* Data statistics and settings: */
+ stc_h stc;
+
+ /* Data limits: */
+ Data_Limits_T sim_1_limits;
+ Data_Limits_T sim_2_limits;
+ Data_Limits_T wifi_limits;
+} SmartMgrData;
+
+typedef struct {
+ char *appid;
+ char *pkgid;
+ char *icon;
+ char *label;
+ long long data_usage_bytes;
+ const SmartMgrData *ad;
+} data_usage_app_item_t;
+
+void smartmanager_stc_get_all_data(void);
+void smartmanager_stc_get_sim_total_and_apps_data(void);
+void smartmanager_stc_get_wifi_total_and_apps_data(void);
+
+#endif /* SM_DATA_H_ */
--- /dev/null
+/*
+ * setting
+ *
+ * Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef SMARTMANAGER_UTILS_H_
+#define SMARTMANAGER_UTILS_H_
+
+#include <stc.h>
+#include <stc_internal.h>
+#include <stdbool.h>
+#include <telephony.h>
+
+typedef enum {
+ DATA_RESTRICTION_LIMIT,
+ DATA_RESTRICTION_WARNING_LIMIT
+} data_restriction_type;
+
+typedef enum {
+ RESTRICTIONS_OK = 0,
+ RESTRICTIONS_ERROR = 1
+} restrictions_result;
+
+int get_days_in_current_month();
+
+void get_data_amount_str(const char *prefix, int64_t num_bytes, char *txt_out,
+ int len_max);
+
+void get_data_int_amount_str(int64_t num_bytes, char *int_amount_str,
+ int len_max);
+
+void get_data_unit_str(int64_t num_bytes, char *unit_str, int len_max);
+
+/**
+ * @brief Formats string composed of number and ordinal number postfix
+ *
+ * @param[in] number Number to format with postfix
+ * @param[in] output Formatted string composed of number and postfix
+ * @param[in] max_len Max len of formatted string
+ *
+ * @return
+ */
+
+void create_number_with_postfix(int number, char *output, int max_len);
+
+/**
+ * @brief Gets total statistics for SIM type interface
+ *
+ * @param[in] stc The statistics rule handle
+ * @param[in] stats_cb Callback to be called asynchronously
+ * @param[in] subscriber_id The SIM subscriber id to be passed to stats_cb
+ * in return from STC API calls
+ * @param[in] t_from The start of the time interval
+ * @param[in] t_to The end of the time interval
+ *
+ * @return true on success, otherwise false
+ *
+ */
+
+bool get_sim_total_stats(stc_h stc, stc_stats_info_cb stats_cb,
+ const char *subscriber_id, time_t t_from, time_t t_to);
+
+/**
+ * @brief Gets total statistics for WiFi type interface
+ *
+ * @param[in] stc The statistics rule handle
+ * @param[in] stats_cb Callback to be called asynchronously
+ * @param[in] t_from The start of the time interval
+ * @param[in] t_to The end of the time interval
+ *
+ * @return true on success, otherwise false
+ *
+ */
+bool get_wifi_total_stats(stc_h stc, stc_stats_info_cb stats_cb, time_t t_from,
+ time_t t_to);
+
+/**
+ * @brief Gets a list of all apps and their data usage statistics
+ * for SIM type interface.
+ *
+ * @param[in] stc The statistics rule handle
+ * @param[in] stats_cb Callback to be called asynchronously
+ * @param[in] subscriber_id The SIM subscriber id to be passed to stats_cb
+ * in return from STC API calls
+ * @param[in] t_from The start of the time interval
+ * @param[in] t_to The end of the time interval
+ *
+ * @return true on success, otherwise false
+ *
+ */
+bool get_sim_apps_list(stc_h stc, stc_stats_info_cb stats_cb,
+ const char *subscriber_id, time_t t_from, time_t t_to);
+
+/**
+ * @brief Gets a list of all apps and their data usage statistics
+ * for WiFi type interface.
+ *
+ * @param[in] stc The statistics rule handle
+ * @param[in] stats_cb Callback to be called asynchronously
+ * @param[in] t_from The start of the time interval
+ * @param[in] t_to The end of the time interval
+ *
+ * @return true on success, otherwise false
+ *
+ */
+bool get_wifi_apps_list(stc_h stc, stc_stats_info_cb stats_cb, time_t t_from,
+ time_t t_to);
+
+bool get_sim_restrictions(stc_h stc, stc_restriction_info_cb restrictions_cb);
+bool get_wifi_restrictions(stc_h stc, stc_restriction_info_cb restrictions_cb);
+bool get_subscriber_id_from_telephony_handle(telephony_h handle,
+ char **subscriber_id);
+bool compare_subscriber_ids(const char *id_a, const char *id_b);
+
+restrictions_result set_mobile_limit_restrictions(stc_h stc_handle,
+ const char *subscriber_id, int64_t limit, int64_t warning_limit);
+restrictions_result set_mobile_restriction_rule_parameters(
+ stc_restriction_rule_h rule, const char *subscriber_id, int64_t limit,
+ int64_t warning_limit);
+bool unset_mobile_limit_restrictions(stc_h stc_handle,
+ stc_restriction_info_cb restrictions_cb, void *data);
+
+bool write_sim_1_cycle_start(int cycle_start_value);
+bool write_sim_1_cycle_interval(int cycle_interval_value);
+bool write_sim_1_cycle_mode(int cycle_mode);
+bool write_sim_2_cycle_start(int cycle_start_value);
+bool write_sim_2_cycle_interval(int cycle_interval_value);
+bool write_sim_2_cycle_mode(int cycle_mode);
+bool write_wifi_cycle_start(int cycle_start_value);
+bool write_wifi_cycle_interval(int cycle_interval_value);
+bool write_wifi_cycle_mode(int cycle_mode);
+
+bool read_sim_1_cycle_start(int *cycle_start_value);
+bool read_sim_1_cycle_interval(int *cycle_interval_value);
+bool read_sim_1_cycle_mode(int *cycle_mode);
+bool read_sim_2_cycle_start(int *cycle_start_value);
+bool read_sim_2_cycle_interval(int *cycle_interval_value);
+bool read_sim_2_cycle_mode(int *cycle_mode);
+bool read_wifi_cycle_start(int *cycle_start_value);
+bool read_wifi_cycle_interval(int *cycle_interval_value);
+bool read_wifi_cycle_mode(int *cycle_mode);
+
+
+#endif /* SMARTMANAGER_UTILS_H_ */
--- /dev/null
+
+# Project Name
+APPNAME = smartmanager-data
+
+# Project Type
+type = app
+
+# Project Profile
+profile = mobile-4.0
+
+# C/CPP Sources
+USER_SRCS = src/smartmanager-utils.c src/smartmanager-data.c src/smartmanager-data-usage-wifi-settings.c src/smartmanager-data-main-view.c src/smartmanager-data-usage-mobile-settings.c
+
+# EDC Sources
+USER_EDCS =
+
+# PO Sources
+USER_POS =
+
+# User Defines
+USER_DEFS = TIZEN_DEPRECATION DEPRECATION_WARNING _TZ_SYS_RO_APP=TZ_SYS_RO_APP TZ_SYS_RO_APP=\"/usr/apps/\"
+USER_CPP_DEFS =
+
+# User Undefines
+USER_UNDEFS =
+USER_CPP_UNDEFS =
+
+# User Libraries
+USER_LIBS = setting-common setting-smartmanager
+
+# User Objects
+USER_OBJS =
+
+# User Includes
+## C Compiler
+USER_C_INC_DIRS = inc
+USER_INC_FILES =
+## C++ Compiler
+USER_CPP_INC_DIRS =
+USER_CPP_INC_FILES =
+
+USER_INC_DIRS = $(USER_C_INC_DIRS) $(USER_CPP_INC_DIRS)
+
+# User Library Path
+USER_LIB_DIRS = lib
+
+# EDC Resource Path
+USER_EDCS_IMAGE_DIRS = ${OUTPUT_DIR}
+USER_EDCS_SOUND_DIRS = ${OUTPUT_DIR}
+USER_EDCS_FONT_DIRS = ${OUTPUT_DIR}
+
+# EDC Flags
+USER_EXT_EDC_KEYS =
+
+# Resource Filter
+USER_RES_INCLUDE =
+USER_RES_EXCLUDE =
+
--- /dev/null
+#include <setting-common/setting-common-init.h>
+#include <setting-common/setting-common-draw-widget.h>
+#include <setting-smartmanager/setting-smartmanager-utils.h>
+#include <utils_i18n.h>
+#include <system_settings.h>
+#include <Elementary.h>
+
+#include "smartmanager-data-main-view.h"
+#include "smartmanager-data-usage-mobile-settings.h"
+#include "smartmanager-data-usage-wifi-settings.h"
+#include "smartmanager-data.h"
+#include "smartmanager-utils.h"
+
+#define MSG_ID_LIMITS 2
+#define MSG_ID_BAR_VALUES 3
+
+setting_view smartmanager_view_data_main;
+
+static int _create(void *data);
+static int _update(void *data);
+static int _destroy(void *data);
+
+static Eina_Bool _hw_back_cb(void *data, Elm_Object_Item *it);
+static void _softkey_back_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void _toolbar_item_click(void *data, Evas_Object *toolbar,
+ void *event_info);
+static void _data_usage_sett_click_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void _app_item_click(void *data, Evas_Object *genlist, void *event_info);
+
+static void _generate_list(SmartMgrData *ad, Evas_Object *genlist,
+ const Elm_Genlist_Item_Class *itc_data_usage_graph,
+ const Elm_Genlist_Item_Class *itc_data_usage_setting,
+ Elm_Object_Item **item_data_amount,
+ Elm_Object_Item **item_data_usage_setting,
+ const char *data_usage_setting_txt);
+static void _append_app(SmartMgrData *ad, Elm_Object_Item **first_app_item,
+ Eina_List *model_list, Evas_Object *genlist,
+ Elm_Genlist_Item_Class *header_itc,
+ Elm_Genlist_Item_Class *app_item_itc);
+
+static void _redraw_toolbar_buttons(SmartMgrData *ad);
+static void _get_time_interval_str(const time_t from, const time_t to, char *txt_out, int len_max);
+
+/** Genlist items class functions: **/
+/* graph: */
+static Evas_Object *_data_usage_item_get(void *data, Evas_Object *genlist,
+ const char *part);
+static char *_apps_header_text_get(void *data, Evas_Object *genlist,
+ const char *part);
+/* application items: */
+static Evas_Object *_aplication_item_get(void *data, Evas_Object *genlist,
+ const char *part);
+
+static Eina_Bool _update_timer_cb(void *data);
+
+static int _create(void *data)
+{
+ SETTING_TRACE_BEGIN;
+ SmartMgrData *ad = data;
+ Evas_Object *back_btn = NULL;
+
+ retv_if(NULL == data, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
+
+ elm_theme_extension_add(NULL,
+ _TZ_SYS_RO_APP"/org.tizen.setting/res/edje/setting-theme.edj");
+ elm_theme_extension_add(NULL,
+ _TZ_SYS_RO_APP"/org.tizen.setting/res/edje/setting-genlist.edj");
+ elm_theme_extension_add(NULL,
+ _TZ_SYS_RO_APP"/org.tizen.setting/res/edje/settings.edj");
+
+ ad->gl_header_itc.item_style = "group_index";
+ ad->gl_header_itc.func.text_get = _apps_header_text_get;
+
+ ad->gl_data_usage_itc.item_style = "full";
+ ad->gl_data_usage_itc.func.content_get = _data_usage_item_get;
+
+ ad->gl_application_itc.item_style = "full";
+ ad->gl_application_itc.func.content_get = _aplication_item_get;
+
+ setting_create_Gendial_itc(SETTING_GENLIST_ICON_1LINE_STYLE,
+ &(ad->gl_text_itc));
+
+ if (
+ SETTING_RETURN_SUCCESS != app_init(&ad->md, "Data usage") ||
+ SETTING_RETURN_SUCCESS != view_init(&ad->md, "Data usage")
+ )
+ return -1;
+
+ elm_naviframe_item_style_set(ad->md.naviframe_it, "tabbar");
+ elm_naviframe_item_pop_cb_set(ad->md.naviframe_it, _hw_back_cb, ad);
+ back_btn = setting_create_button(ad->md.naviframe,
+ NULL, NAVI_BACK_ARROW_BUTTON_STYLE,
+ _softkey_back_cb, ad);
+ elm_layout_content_set(ad->md.naviframe, "prev_btn", back_btn);
+
+ ad->toolbar = elm_toolbar_add(ad->md.naviframe);
+ elm_toolbar_shrink_mode_set(ad->toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
+ elm_toolbar_select_mode_set(ad->toolbar, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ elm_toolbar_reorder_mode_set(ad->toolbar, EINA_FALSE);
+ elm_toolbar_transverse_expanded_set(ad->toolbar, EINA_TRUE);
+ elm_object_item_part_content_set(ad->md.naviframe_it, "tabbar",
+ ad->toolbar);
+ evas_object_show(ad->toolbar);
+ _redraw_toolbar_buttons(ad);
+
+ ad->sim_1_genlist = ad->md.genlist;
+ ad->wifi_genlist = elm_genlist_add(ad->md.layout);
+ elm_genlist_mode_set(ad->wifi_genlist, ELM_LIST_COMPRESS);
+ ad->sim_2_genlist = elm_genlist_add(ad->md.layout);
+ elm_genlist_mode_set(ad->sim_2_genlist, ELM_LIST_COMPRESS);
+
+ evas_object_show(ad->md.window);
+
+ if (ad->num_sim_cards_available < 1)
+ _toolbar_item_click(ad, ad->toolbar, ad->toolbar_item_wifi);
+ if (ad->num_sim_cards_available >= 1)
+ _toolbar_item_click(ad, ad->toolbar, ad->toolbar_item_sim_1);
+
+ /* Init sub views */
+ init_mobile_settings_view(ad);
+ setting_view_node_table_register(ad->mobile_view, ad->main_view);
+ init_wifi_settings_view(ad);
+ setting_view_node_table_register(ad->wifi_view, ad->main_view);
+ smartmanager_view_data_main.is_create = 1;
+
+ ad->main_view_update_timer = ecore_timer_add(4.0, _update_timer_cb, ad);
+ if (!ad->main_view_update_timer)
+ SETTING_TRACE_ERROR("ad->main_view_update_timer creation failure");
+
+ SETTING_TRACE_END;
+ return 0;
+}
+
+/* Internal functions: */
+
+static void _toolbar_item_click(void *data, Evas_Object *toolbar,
+ void *event_info)
+{
+ SmartMgrData *ad = data;
+ Evas_Object *genlist_to_set = NULL;
+ Evas_Object *genlist_to_unset = NULL;
+
+ ret_if(!data);
+
+ genlist_to_unset = elm_layout_content_unset(ad->md.layout,
+ "elm.swallow.content");
+ evas_object_hide(genlist_to_unset);
+
+ if (event_info == ad->toolbar_item_sim_1)
+ genlist_to_set = ad->sim_1_genlist;
+
+ if (event_info == ad->toolbar_item_sim_2)
+ genlist_to_set = ad->sim_2_genlist;
+
+ if (event_info == ad->toolbar_item_wifi)
+ genlist_to_set = ad->wifi_genlist;
+
+ elm_layout_content_set(ad->md.layout, "elm.swallow.content",
+ genlist_to_set);
+ evas_object_show(genlist_to_set);
+ elm_toolbar_item_selected_set(event_info, EINA_TRUE);
+}
+
+static void _data_usage_sett_click_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ SmartMgrData *ad = data;
+ ret_if(!data);
+
+ elm_genlist_item_selected_set(event_info, EINA_FALSE);
+
+ if (event_info == ad->item_sim_1_data_usage_set) {
+ ad->selected_sim_subscriber_id = ad->subscriber_id_1;
+ ad->selected_sim_limits = &ad->sim_1_limits;
+ setting_view_change(&smartmanager_view_data_main, ad->mobile_view, ad);
+ }
+
+ if (event_info == ad->item_sim_2_data_usage_set) {
+ ad->selected_sim_subscriber_id = ad->subscriber_id_2;
+ ad->selected_sim_limits = &ad->sim_2_limits;
+ setting_view_change(&smartmanager_view_data_main, ad->mobile_view, ad);
+ }
+
+ if (event_info == ad->item_wifi_data_usage_set)
+ setting_view_change(&smartmanager_view_data_main, ad->wifi_view, ad);
+}
+
+static void _set_warning_limit_value(Evas_Object *layout, float warn, float limit)
+{
+ Edje_Message_Float_Set *msg = calloc(1, sizeof(Edje_Message_Float_Set) + sizeof(double));
+
+ if (!msg)
+ return;
+
+ msg->count = 2;
+ msg->val[0] = warn;
+ msg->val[1] = limit;
+
+ edje_object_message_send(elm_layout_edje_get(layout), EDJE_MESSAGE_FLOAT_SET, MSG_ID_LIMITS, msg);
+ edje_object_message_signal_process(elm_layout_edje_get(layout));
+
+ free(msg);
+}
+
+static void _set_progress_value(Evas_Object *layout, float value)
+{
+ Edje_Message_Float msg = {
+ .val = value,
+ };
+
+ edje_object_message_send(elm_layout_edje_get(layout), EDJE_MESSAGE_FLOAT, MSG_ID_BAR_VALUES, &msg);
+ edje_object_message_signal_process(elm_layout_edje_get(layout));
+}
+
+static void _graph_layout_fill(SmartMgrData *ad, Evas_Object *layout,
+ long long total_data, long long warning_data,
+ long long hard_limit_data,
+ time_t interval_from, time_t interval_to)
+{
+ int64_t gigs_multiplier = 0;
+ char buff[64] = {'\0',};
+ _get_time_interval_str(interval_from, interval_to, buff, sizeof(buff));
+ elm_layout_text_set(layout, "timespan_txt", buff);
+
+ get_data_amount_str("", total_data, buff, sizeof(buff));
+ elm_layout_text_set(layout, "quantity_txt", buff);
+
+ if (warning_data > 0) {
+ get_data_amount_str("Warning: ", warning_data, buff, sizeof(buff));
+ elm_layout_text_set(layout, "warning_txt", buff);
+ } else {
+ elm_layout_text_set(layout, "warning_txt", "");
+ }
+
+ if (hard_limit_data > 0) {
+ get_data_amount_str("Limit: ", hard_limit_data, buff, sizeof(buff));
+ elm_layout_text_set(layout, "limit_txt", buff);
+ if (warning_data > 0) {
+ _set_warning_limit_value(layout,
+ (float)warning_data / hard_limit_data,
+ 1.0);
+ } else {
+ _set_warning_limit_value(layout, -1.0, 1.0);
+ }
+ _set_progress_value(layout, (float)total_data / hard_limit_data);
+ } else {
+ elm_layout_text_set(layout, "limit_txt", "");
+ if (warning_data > 0) {
+ _set_warning_limit_value(layout, 1.0, -1.0);
+ _set_progress_value(layout, (float)total_data / warning_data);
+ } else {
+ /* Smart Manager UI v1.0 page 14.
+ * This is display logic in case when no limit
+ * nor warning had been set: */
+ _set_warning_limit_value(layout, -1.0, -1.0);
+ gigs_multiplier = total_data / 1073741824;
+ gigs_multiplier++;
+ _set_progress_value(layout,
+ (float)total_data / (gigs_multiplier * 1073741824));
+ }
+ }
+}
+
+static Evas_Object *_data_usage_item_get(void *data, Evas_Object *genlist, const char *part)
+{
+ Evas_Object *layout = NULL;
+ SmartMgrData *ad = data;
+
+ if (!ad)
+ return NULL;
+
+ if (safeStrCmp(part, "elm.swallow.content"))
+ return NULL;
+
+ layout = elm_layout_add(genlist);
+
+ elm_layout_file_set(layout,
+ _TZ_SYS_RO_APP"/org.tizen.setting/res/edje/"
+ "genlist_item_mobile_data_usage.edj",
+ "genlist_item_mobile_data_usage");
+
+ if (ad->sim_1_genlist == genlist)
+ _graph_layout_fill(ad, layout,
+ ad->sim_1_limits.total_data_used,
+ ad->sim_1_limits.warning, ad->sim_1_limits.limit,
+ ad->sim_1_limits.interval_from,
+ ad->sim_1_limits.interval_to);
+
+ if (ad->sim_2_genlist == genlist)
+ _graph_layout_fill(ad, layout,
+ ad->sim_2_limits.total_data_used,
+ ad->sim_2_limits.warning, ad->sim_2_limits.limit,
+ ad->sim_2_limits.interval_from,
+ ad->sim_2_limits.interval_to);
+
+ if (ad->wifi_genlist == genlist)
+ _graph_layout_fill(ad, layout,
+ ad->wifi_limits.total_data_used,
+ ad->wifi_limits.warning, ad->wifi_limits.limit,
+ ad->wifi_limits.interval_from,
+ ad->wifi_limits.interval_to);
+
+ return layout;
+}
+
+static char *_apps_header_text_get(void *data, Evas_Object *genlist,
+ const char *part)
+{
+ if (!strcmp("elm.text", part))
+ return strdup("Data Usage Details");
+ return NULL;
+}
+
+static Evas_Object *_aplication_item_get(
+ void *data, Evas_Object *genlist, const char *part)
+{
+ Evas_Object *layout = NULL;
+ data_usage_app_item_t *app_item = data;
+ Evas_Object *progress_bar = NULL;
+ Evas_Object *icon = NULL;
+ char buff[64] = {'\0',};
+
+ if (!app_item || !app_item->ad)
+ return NULL;
+
+ if (safeStrCmp(part, "elm.swallow.content"))
+ return NULL;
+
+ layout = elm_layout_add(genlist);
+ elm_layout_file_set(layout,
+ _TZ_SYS_RO_APP"/org.tizen.setting/res/edje/setting-theme.edj",
+ "gl_custom_item_icon");
+
+ elm_object_part_text_set(layout, "elm.text", app_item->label);
+
+ progress_bar = elm_progressbar_add(layout);
+ evas_object_size_hint_weight_set(progress_bar, EVAS_HINT_EXPAND, 0.0);
+ evas_object_size_hint_align_set(progress_bar, EVAS_HINT_FILL, 0.5);
+ if (app_item->ad->sim_1_genlist == genlist)
+ elm_progressbar_value_set(progress_bar,
+ ((double)app_item->data_usage_bytes /
+ (double)app_item->ad->sim_1_limits.total_data_used));
+ if (app_item->ad->sim_2_genlist == genlist)
+ elm_progressbar_value_set(progress_bar,
+ ((double)app_item->data_usage_bytes /
+ (double)app_item->ad->sim_2_limits.total_data_used));
+ if (app_item->ad->wifi_genlist == genlist)
+ elm_progressbar_value_set(progress_bar,
+ ((double)app_item->data_usage_bytes /
+ (double)app_item->ad->wifi_limits.total_data_used));
+
+ evas_object_pass_events_set(progress_bar, EINA_TRUE);
+ evas_object_propagate_events_set(progress_bar, EINA_FALSE);
+ elm_object_part_content_set(layout, "elm.swallow.content", progress_bar);
+
+ if (app_item->icon) {
+ icon = elm_icon_add(layout);
+ elm_image_file_set(icon, app_item->icon, NULL);
+ elm_image_resizable_set(icon, EINA_TRUE, EINA_TRUE);
+ evas_object_size_hint_min_set(icon, 98, 98);
+ elm_object_part_content_set(layout, "elm.swallow.icon", icon);
+ }
+ get_data_amount_str("", app_item->data_usage_bytes, buff, sizeof(buff));
+ elm_object_part_text_set(layout, "elm.text.sub", buff);
+
+ return layout;
+}
+
+static Eina_Bool _update_timer_cb(void *data)
+{
+ Elm_Widget_Item *item = NULL;
+ SmartMgrData *ad = data;
+ if (!data)
+ return ECORE_CALLBACK_RENEW;
+
+ item = elm_toolbar_selected_item_get(ad->toolbar);
+
+ if (item == ad->toolbar_item_sim_1 || item == ad->toolbar_item_sim_2)
+ smartmanager_stc_get_sim_total_and_apps_data();
+ if (item == ad->toolbar_item_wifi)
+ smartmanager_stc_get_wifi_total_and_apps_data();
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+static void _generate_list(SmartMgrData *ad, Evas_Object *genlist,
+ const Elm_Genlist_Item_Class *itc_data_usage_graph,
+ const Elm_Genlist_Item_Class *itc_data_usage_setting,
+ Elm_Object_Item **item_data_amount,
+ Elm_Object_Item **item_data_usage_setting,
+ const char *data_usage_setting_txt)
+{
+ SETTING_TRACE_BEGIN;
+ Setting_GenGroupItem_Data *item = NULL;
+
+ if (!genlist || !ad) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "NULL argument");
+ return;
+ }
+
+ elm_genlist_clear(genlist);
+
+ *item_data_amount = elm_genlist_item_append(genlist, itc_data_usage_graph,
+ ad, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_select_mode_set((*item_data_amount),
+ ELM_OBJECT_SELECT_MODE_NONE);
+ if (!(*item_data_amount)) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "gl item == NULL");
+ return;
+ }
+
+ item = setting_create_Gendial_field_def(genlist, itc_data_usage_setting,
+ _data_usage_sett_click_cb, ad,
+ SWALLOW_Type_INVALID, NULL, NULL, 0,
+ "Data usage settings",
+ data_usage_setting_txt,
+ NULL);
+ if (!item) {
+ dlog_print(DLOG_ERROR, LOG_TAG, "gl item == NULL");
+ return;
+ }
+ *item_data_usage_setting = item->item;
+
+ SETTING_TRACE_END;
+}
+
+static void _app_item_click(void *data, Evas_Object *genlist, void *event_info)
+{
+ data_usage_app_item_t *app_info = data;
+
+ if (!app_info)
+ return;
+
+ elm_genlist_item_selected_set(event_info, EINA_FALSE);
+ smart_manger_utils_launch_appinfo(app_info->pkgid);
+}
+
+static void _append_app(SmartMgrData *ad, Elm_Object_Item **first_app_item,
+ Eina_List *model_list, Evas_Object *genlist,
+ Elm_Genlist_Item_Class *header_itc,
+ Elm_Genlist_Item_Class *app_item_itc)
+{
+ Elm_Object_Item *it = NULL;
+ data_usage_app_item_t *app_info = NULL;
+
+ if (!genlist || !ad || !model_list) {
+ SETTING_TRACE_ERROR("appending app ui item: NULL argument");
+ return;
+ }
+
+ if (!(*first_app_item)) {
+ it = elm_genlist_item_append(genlist, header_itc, NULL, NULL,
+ ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_NONE);
+ }
+
+ app_info = eina_list_last_data_get(model_list);
+
+ it = elm_genlist_item_append(genlist,
+ app_item_itc, app_info,
+ NULL, ELM_GENLIST_ITEM_NONE,
+ _app_item_click, app_info);
+
+ if (!(*first_app_item))
+ *first_app_item = it;
+}
+
+void init_main_view(SmartMgrData *ad)
+{
+ SETTING_TRACE_BEGIN;
+ ret_if(!ad);
+ ret_if(ad->main_view);
+
+ smartmanager_view_data_main.create = _create;
+ smartmanager_view_data_main.destroy = _destroy;
+ smartmanager_view_data_main.update = _update;
+ smartmanager_view_data_main.cleanup = NULL;
+
+ ad->main_view = &smartmanager_view_data_main;
+ SETTING_TRACE_END;
+}
+
+static Eina_Bool _hw_back_cb(void *data, Elm_Object_Item *it)
+{
+ ui_app_exit();
+
+ return EINA_FALSE;
+}
+
+static void _softkey_back_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ SmartMgrData *ad = data;
+ ret_if(!ad);
+ elm_naviframe_item_pop(ad->md.naviframe);
+}
+
+static void _redraw_toolbar_buttons(SmartMgrData *ad)
+{
+ elm_object_item_del(ad->toolbar_item_sim_1);
+ ad->toolbar_item_sim_1 = NULL;
+ elm_object_item_del(ad->toolbar_item_sim_2);
+ ad->toolbar_item_sim_2 = NULL;
+ elm_object_item_del(ad->toolbar_item_wifi);
+ ad->toolbar_item_wifi = NULL;
+
+ if (ad->num_sim_cards_available <= 1)
+ ad->toolbar_item_sim_1 = elm_toolbar_item_append(ad->toolbar, NULL,
+ "Mobile", _toolbar_item_click, ad);
+
+ if (ad->num_sim_cards_available > 1) {
+ ad->toolbar_item_sim_1 = elm_toolbar_item_append(ad->toolbar, NULL,
+ "SIM1", _toolbar_item_click, ad);
+ ad->toolbar_item_sim_2 = elm_toolbar_item_append(ad->toolbar, NULL,
+ "SIM2", _toolbar_item_click, ad);
+ }
+
+ ad->toolbar_item_wifi = elm_toolbar_item_append(ad->toolbar, NULL, "Wi-Fi",
+ _toolbar_item_click, ad);
+}
+
+static void _get_time_interval_str(const time_t from, const time_t to,
+ char *txt_out, int len_max)
+{
+ i18n_udate date1 = 1000.0 * (i18n_udate)from;
+ i18n_udate date2 = 1000.0 * (i18n_udate)to;
+ i18n_uchar result1[128] = {0,};
+ i18n_uchar result2[128] = {0,};
+ char result1_str[128] = {'\0',};
+ char result2_str[128] = {'\0',};
+ int32_t buf_size_needed = 0;
+ i18n_udatepg_h pttrn_gen = NULL;
+ i18n_udate_format_h formatter = NULL;
+ i18n_uchar best_pattern[128] = {0,};
+ int32_t best_pattern_result_len = 0;
+ i18n_uchar format[128] = {0,};
+ char *country_iso = NULL;
+
+ if (0 == from || 0 == to) {
+ if (txt_out && len_max > 0)
+ txt_out[0] = '\0';
+ return;
+ }
+
+ system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY,
+ &country_iso);
+
+ i18n_udatepg_create(country_iso, &pttrn_gen);
+ i18n_ustring_copy_ua_n(format, "dd MMM", strlen("dd MMM"));
+ i18n_udatepg_get_best_pattern(pttrn_gen, format,
+ i18n_ustring_get_length(format),
+ best_pattern,
+ (sizeof(best_pattern) / sizeof(i18n_uchar)),
+ &best_pattern_result_len);
+
+ i18n_udatepg_destroy(pttrn_gen);
+ i18n_udate_create(I18N_UDATE_PATTERN, I18N_UDATE_PATTERN, country_iso,
+ NULL, -1, best_pattern, -1, &formatter);
+ i18n_udate_format_date(formatter, date1,
+ result1, (sizeof(result1) / sizeof(i18n_uchar)),
+ NULL, &buf_size_needed);
+ i18n_udate_format_date(formatter, date2,
+ result2, (sizeof(result2) / sizeof(i18n_uchar)),
+ NULL, &buf_size_needed);
+ i18n_udate_destroy(formatter);
+
+ i18n_ustring_copy_au(result1_str, result1);
+ i18n_ustring_copy_au(result2_str, result2);
+ snprintf(txt_out, len_max, "%s - %s", result1_str, result2_str);
+}
+
+static int _update(void *data)
+{
+ SETTING_TRACE_BEGIN;
+ SmartMgrData *ad = data;
+ retv_if(NULL == data, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
+
+ if (MV_UPDATE_APPEND_NONE == ad->main_view_update_type)
+ return 0;
+
+ switch (ad->main_view_update_type) {
+ case MV_UPDATE_SIM_1_WARN_N_LIMIT:
+ elm_genlist_item_update(ad->item_sim_1_data_amount);
+ break;
+ case MV_UPDATE_SIM_2_WARN_N_LIMIT:
+ elm_genlist_item_update(ad->item_sim_2_data_amount);
+ break;
+ case MV_UPDATE_WIFI_WARN_N_LIMIT:
+ elm_genlist_item_update(ad->item_wifi_data_amount);
+ break;
+ case MV_UPDATE_SIM_STATE_CHANGED:
+ _redraw_toolbar_buttons(ad);
+ if (ad->num_sim_cards_available > 0) {
+ elm_genlist_clear(ad->sim_1_genlist);
+ ad->item_sim_1_data_amount = NULL;
+ ad->item_sim_1_data_usage_set = NULL;
+ ad->item_sim_1_first_app_info = NULL;
+ _generate_list(ad, ad->sim_1_genlist,
+ &ad->gl_data_usage_itc, &ad->gl_text_itc,
+ &ad->item_sim_1_data_amount,
+ &ad->item_sim_1_data_usage_set,
+ "Set Data usage cycle, and Warning, Limit value");
+ _toolbar_item_click(ad, ad->toolbar, ad->toolbar_item_sim_1);
+ }
+ if (ad->num_sim_cards_available > 1) {
+ elm_genlist_clear(ad->sim_2_genlist);
+ ad->item_sim_2_data_amount = NULL;
+ ad->item_sim_2_data_usage_set = NULL;
+ ad->item_sim_2_first_app_info = NULL;
+ _generate_list(ad, ad->sim_2_genlist,
+ &ad->gl_data_usage_itc, &ad->gl_text_itc,
+ &ad->item_sim_2_data_amount,
+ &ad->item_sim_2_data_usage_set,
+ "Set Data usage cycle, and Warning, Limit value");
+ }
+ break;
+ case MV_UPDATE_SIM_1_TOTAL_DATA_USAGE:
+ elm_genlist_item_update(ad->item_sim_1_data_amount);
+ break;
+ case MV_UPDATE_SIM_2_TOTAL_DATA_USAGE:
+ elm_genlist_item_update(ad->item_sim_2_data_amount);
+ break;
+ case MV_UPDATE_WIFI_TOTAL_DATA_USAGE:
+ elm_genlist_item_update(ad->item_wifi_data_amount);
+ break;
+ case MV_UPDATE_CLEAR_ALL_SIM_1_APPS:
+ elm_genlist_clear(ad->sim_1_genlist);
+ ad->item_sim_1_data_amount = NULL;
+ ad->item_sim_1_data_usage_set = NULL;
+ ad->item_sim_1_first_app_info = NULL;
+ _generate_list(ad, ad->sim_1_genlist,
+ &ad->gl_data_usage_itc, &ad->gl_text_itc,
+ &ad->item_sim_1_data_amount,
+ &ad->item_sim_1_data_usage_set,
+ "Set Data usage cycle, and Warning, Limit value");
+ break;
+ case MV_UPDATE_CLEAR_ALL_SIM_2_APPS:
+ elm_genlist_clear(ad->sim_2_genlist);
+ ad->item_sim_2_data_amount = NULL;
+ ad->item_sim_2_data_usage_set = NULL;
+ ad->item_sim_2_first_app_info = NULL;
+ _generate_list(ad, ad->sim_2_genlist,
+ &ad->gl_data_usage_itc, &ad->gl_text_itc,
+ &ad->item_sim_2_data_amount,
+ &ad->item_sim_2_data_usage_set,
+ "Set Data usage cycle, and Warning, Limit value");
+ break;
+ case MV_UPDATE_CLEAR_ALL_WIFI_APPS:
+ elm_genlist_clear(ad->wifi_genlist);
+ ad->item_wifi_data_amount = NULL;
+ ad->item_wifi_data_usage_set = NULL;
+ ad->item_wifi_first_app_info = NULL;
+ _generate_list(ad, ad->wifi_genlist,
+ &ad->gl_data_usage_itc, &ad->gl_text_itc,
+ &ad->item_wifi_data_amount,
+ &ad->item_wifi_data_usage_set,
+ "Set Wi-Fi usage cycle");
+ break;
+ case MV_UPDATE_APPEND_SIM_1_APP:
+ _append_app(ad, &ad->item_sim_1_first_app_info,
+ ad->sim_1_apps, ad->sim_1_genlist,
+ &ad->gl_header_itc, &ad->gl_application_itc);
+ break;
+ case MV_UPDATE_APPEND_SIM_2_APP:
+ _append_app(ad, &ad->item_sim_2_first_app_info,
+ ad->sim_2_apps, ad->sim_2_genlist,
+ &ad->gl_header_itc, &ad->gl_application_itc);
+ break;
+ case MV_UPDATE_APPEND_WIFI_APP:
+ _append_app(ad, &ad->item_wifi_first_app_info,
+ ad->wifi_apps, ad->wifi_genlist,
+ &ad->gl_header_itc, &ad->gl_application_itc);
+ break;
+ default:
+ break;
+ }
+
+ ad->main_view_update_type = MV_UPDATE_APPEND_NONE;
+
+ SETTING_TRACE_END;
+ return 0;
+}
+
+static int _destroy(void *data)
+{
+ SETTING_TRACE_BEGIN;
+ SmartMgrData *ad = data;
+ retv_if(NULL == data, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
+ ecore_timer_del(ad->main_view_update_timer);
+ ad->main_view_update_timer = NULL;
+ evas_object_del(ad->md.window);
+ smartmanager_view_data_main.is_create = 0;
+
+ SETTING_TRACE_END;
+ return 0;
+}
--- /dev/null
+#include <setting-common/setting-common-draw-widget.h>
+
+#include <Efl.h>
+#include <Elementary.h>
+#include <efl_extension_events.h>
+#include <math.h>
+
+#include "smartmanager-data-usage-mobile-settings.h"
+#include "smartmanager-utils.h"
+
+#define MAX_LIMIT_IN_BYTES (((int64_t)LONG_MAX+1)*50)
+
+static int _create(void *data);
+static int _destroy(void *data);
+static int _update(void* data);
+static int _cleanup();
+
+static void _create_warning_popup(void *data, Evas_Object *obj,
+ void *event_info);
+static void _create_limit_popup(void *data, Evas_Object *obj,
+ void *event_info);
+static void _create_cycle_list_popup(void *data, Evas_Object *obj,
+ void *event_info);
+
+static void _create_monthly_start_date_popup(void *data, Evas_Object *obj,
+ void *event_info);
+static void _create_start_weekday_list_popup(void *data, Evas_Object *obj,
+ void *event_info);
+static void create_custom_start_date_popup(void *data, Evas_Object *obj,
+ void *event_info);
+
+static Evas_Object *_genlist_cycle_radio_content_get(void *data,
+ Evas_Object *obj, const char *part);
+static Evas_Object *_genlist_start_weekday_radio_content_get(void *data,
+ Evas_Object *obj, const char *part);
+static char *_genlist_radio_text_get(void *data, Evas_Object *obj,
+ const char *part);
+static void _genlist_radio_del(void *data, Evas_Object *obj);
+
+static void _softkey_back_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static Eina_Bool _pop_view_cb(void *data, Elm_Object_Item *it);
+
+static char *_warning_item_label_get(void *data, Evas_Object *obj,
+ const char *part);
+static char *_limit_item_label_get(void *data, Evas_Object *obj,
+ const char *part);
+static char *_cycle_item_label_get(void *data, Evas_Object *obj,
+ const char *part);
+static char *_start_date_item_label_get(void *data, Evas_Object *obj,
+ const char *part);
+static char *_description_item_label_get(void *data, Evas_Object *obj,
+ const char *part);
+
+setting_view sm_view_data_usage_mobile;
+
+static const char date_format[] = "%a, %d/%m/%Y";
+
+typedef enum {
+ DATE_MIN = 0,
+ DATE_MAX,
+} margin_date_type;
+
+typedef struct {
+ SmartMgrData *smd;
+ Evas_Object *popup;
+ char *text;
+ int radio_value;
+} Radio_List_Item_T;
+
+typedef struct {
+ Evas_Object *popup;
+ Evas_Object *unit_btn;
+ Evas_Object *content;
+} Popup_Info;
+
+static char *elements_cycle_initial_values[] = {
+ "Monthly",
+ "Weekly",
+ "Daily",
+ "Custom"
+};
+
+static char *elements_cycle_day_of_week[] = {
+ "Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday"
+};
+
+static Evas_Smart_Cb create_start_popup_functions[] = {
+ _create_monthly_start_date_popup,
+ _create_start_weekday_list_popup,
+ NULL,
+ create_custom_start_date_popup
+};
+
+static Popup_Info popup_info = {0};
+
+static Evas_Object *mobile_genlist = NULL;
+static Evas_Object *cycle_mode_radio_group = NULL;
+static Evas_Object *start_weekday_radio_group = NULL;
+
+static Elm_Genlist_Item_Class itc_warning_element = {
+ .item_style = "type2",
+ .func.text_get = _warning_item_label_get
+};
+
+static Elm_Genlist_Item_Class itc_limit_element = {
+ .item_style = "type2",
+ .func.text_get = _limit_item_label_get
+};
+
+static Elm_Genlist_Item_Class itc_cycle_element = {
+ .item_style = "type2",
+ .func.text_get = _cycle_item_label_get
+};
+
+static Elm_Genlist_Item_Class itc_start_date_element = {
+ .item_style = "type2",
+ .func.text_get = _start_date_item_label_get
+};
+
+static Elm_Genlist_Item_Class itc_description_element = {
+ .item_style = "multiline",
+ .func.text_get = _description_item_label_get
+};
+
+static Elm_Genlist_Item_Class itc_cycle_list = {
+ .item_style = "type1",
+ .func.content_get = _genlist_cycle_radio_content_get,
+ .func.text_get = _genlist_radio_text_get,
+ .func.del = _genlist_radio_del
+};
+
+static Elm_Genlist_Item_Class itc_start_weekday_list = {
+ .item_style = "type1",
+ .func.content_get = _genlist_start_weekday_radio_content_get,
+ .func.text_get = _genlist_radio_text_get,
+ .func.del = _genlist_radio_del
+};
+
+static Elm_Entry_Filter_Limit_Size limit_size = {
+ .max_char_count = 9
+};
+
+static void generate_list(Evas_Object *genlist, SmartMgrData *smd)
+{
+ Elm_Object_Item *last_item = NULL;
+
+ elm_genlist_clear(genlist);
+ elm_genlist_item_append(genlist, &itc_warning_element,
+ smd, NULL, ELM_GENLIST_ITEM_NONE, _create_warning_popup , smd);
+ elm_genlist_item_append(genlist, &itc_limit_element,
+ smd, NULL, ELM_GENLIST_ITEM_NONE, _create_limit_popup, smd);
+ elm_genlist_item_append(genlist, &itc_cycle_element,
+ smd, NULL, ELM_GENLIST_ITEM_NONE, _create_cycle_list_popup, smd);
+
+ if (smd->selected_sim_limits->cycle_mode != CYCLE_MODE_DAILY)
+ elm_genlist_item_append(genlist, &itc_start_date_element,
+ smd, NULL, ELM_GENLIST_ITEM_NONE,
+ create_start_popup_functions[smd->selected_sim_limits->cycle_mode],
+ smd);
+
+ last_item = elm_genlist_item_append(genlist, &itc_description_element,
+ smd, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ elm_genlist_item_select_mode_set(last_item, ELM_OBJECT_SELECT_MODE_NONE);
+
+ evas_object_show(mobile_genlist);
+
+}
+
+static Evas_Object *_create_generic_popup_button(Evas_Object *parent,
+ char *part, char *title, float weight_x, float weight_y,
+ bool editfield_clear_style, Evas_Smart_Cb cb, void *callback_data)
+{
+ Evas_Object *btn = elm_button_add(parent);
+ if (!btn) {
+ SETTING_TRACE_ERROR("btn == NULL");
+ return NULL;
+ }
+
+ if (editfield_clear_style) {
+ elm_object_style_set(btn, "editfield_clear");
+ } else {
+ elm_object_text_set(btn, title);
+ }
+
+ evas_object_smart_callback_add(btn, "clicked", cb, callback_data);
+
+ evas_object_size_hint_weight_set(btn, weight_x, weight_y);
+ evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ elm_object_part_content_set(parent, part, btn);
+
+ evas_object_show(btn);
+
+ return btn;
+}
+
+static Evas_Object *create_editfield_clear_popup_button(Evas_Object *parent,
+ char *part, char *title, float weight_x, float weight_y, Evas_Smart_Cb cb,
+ void *callback_data)
+{
+ return _create_generic_popup_button(parent, part, title,
+ weight_x, weight_y, true, cb, callback_data);
+}
+
+static Evas_Object *_create_popup_button(Evas_Object *parent, char *part,
+ char *title, float weight_x, float weight_y, Evas_Smart_Cb cb,
+ void *callback_data)
+{
+ return _create_generic_popup_button(parent, part, title,
+ weight_x, weight_y, false, cb, callback_data);
+}
+
+static void _entry_set_displayed_value(Evas_Object *entry, Evas_Object *button,
+ int64_t value)
+{
+ char int_amount_buf[256] = {0};
+ char unit_buf[256] = {0};
+ if (value > 0) {
+ get_data_int_amount_str(value, int_amount_buf, sizeof(int_amount_buf));
+ elm_object_text_set(entry, int_amount_buf);
+ elm_entry_cursor_end_set(entry);
+ }
+
+ elm_object_focus_set(entry, EINA_TRUE);
+ get_data_unit_str(value, unit_buf, sizeof(unit_buf));
+ elm_object_text_set(button, unit_buf);
+}
+
+static void _data_unit_type_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ const char *unit_text = elm_object_text_get(obj);
+ elm_object_text_set(obj, (unit_text && !strcmp(unit_text, "GB")) ? "MB" : "GB");
+}
+
+static void create_toast_popup(Evas_Object *parent, char *text)
+{
+ Evas_Object *popup = elm_popup_add(parent);
+ elm_object_style_set(popup, "toast");
+ elm_object_text_set(popup, text);
+ evas_object_show(popup);
+ elm_popup_timeout_set(popup, 3.5);
+}
+
+static stc_callback_ret_e _get_and_unset_limit_restrictions_cb(
+ stc_error_e result, stc_restriction_info_h info, void *user_data)
+{
+ int ret = STC_ERROR_NONE;
+ char *app_id = NULL;
+ char *subscriber_id = NULL;
+ int64_t limit = 0;
+ int64_t warning_limit = 0;
+ stc_iface_type_e iface_type = STC_IFACE_UNKNOWN;
+ stc_restriction_status_e status = STC_RESTRICTION_UNKNOWN;
+ stc_restriction_rule_h rule = NULL;
+ restrictions_result restrictions_res = RESTRICTIONS_ERROR;
+ SmartMgrData *smd = (SmartMgrData *)user_data;
+
+ SETTING_TRACE_DEBUG("_get_restrictions_to_unset_cb:");
+ if (STC_ERROR_NONE != result) {
+ SETTING_TRACE_ERROR("_get_restrictions_to_unset_cb error: %s",
+ get_error_message(result));
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ ret = stc_restriction_info_get_app_id(info, &app_id);
+ if (STC_ERROR_NONE != ret || !app_id || strcmp("TOTAL_DATACALL", app_id)) {
+ free(app_id);
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ free(app_id);
+
+ ret = stc_restriction_info_get_status(info, &status);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("stc_restriction_info_get_status error: %s",
+ get_error_message(ret));
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ ret = stc_restriction_info_get_iface_type(info, &iface_type);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("stc_restriction_info_get_iface_type error: %s",
+ get_error_message(ret));
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ if (iface_type != STC_IFACE_DATACALL)
+ return STC_CALLBACK_CONTINUE;
+
+ ret = stc_restriction_info_get_subscriber_id(info, &subscriber_id);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("stc_restriction_info_get_subscriber_id error: %s",
+ get_error_message(ret));
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ if (compare_subscriber_ids(smd->selected_sim_subscriber_id,
+ subscriber_id)) {
+ ret = stc_restriction_info_get_limit(info, &limit);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("stc_restriction_info_get_limit() error: %s",
+ get_error_message(ret));
+ free(subscriber_id);
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ ret = stc_restriction_info_get_warning_limit(info, &warning_limit);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR(
+ "stc_restriction_info_get_warning_limit() error: %s",
+ get_error_message(ret));
+ free(subscriber_id);
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ ret = stc_restriction_rule_create(smd->stc, &rule);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("stc_restriction_rule_create() error: %s",
+ get_error_message(ret));
+ free(subscriber_id);
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ restrictions_res = set_mobile_restriction_rule_parameters(rule,
+ subscriber_id, limit, warning_limit);
+ if (restrictions_res != RESTRICTIONS_OK) {
+ SETTING_TRACE_ERROR(
+ "set_mobile_restriction_rule_parameters() error");
+ free(subscriber_id);
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ ret = stc_unset_restriction(smd->stc, rule);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("stc_unset_restriction() error: %s",
+ get_error_message(ret));
+ free(subscriber_id);
+ return STC_CALLBACK_CONTINUE;
+ }
+ }
+ free(subscriber_id);
+
+ SETTING_TRACE_ERROR(
+ "stc_unset_restriction() successful unset restriction");
+ return STC_CALLBACK_CONTINUE;
+}
+
+static void _popup_cancel_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ Evas_Object *popup = (Evas_Object *)data;
+ evas_object_del(popup);
+}
+
+static void _clean_entry_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ Evas_Object *entry = (Evas_Object *)data;
+ elm_object_text_set(entry, "");
+ elm_object_focus_set(entry, EINA_TRUE);
+}
+
+static Evas_Object *_create_entry(Evas_Object *parent)
+{
+ Evas_Object *entry = elm_entry_add(parent);
+ elm_entry_single_line_set(entry, EINA_TRUE);
+
+ elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size,
+ &limit_size);
+ elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBERONLY);
+ elm_entry_input_panel_show(entry);
+
+ evas_object_size_hint_weight_set(entry, 0.73, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ evas_object_show(entry);
+
+ return entry;
+}
+
+static Evas_Object *_create_label(Evas_Object *parent, char *title)
+{
+ Evas_Object *label = elm_label_add(parent);
+ retv_if(!label, NULL);
+
+ evas_object_size_hint_weight_set(label, 0.15, EVAS_HINT_EXPAND);
+ elm_object_text_set(label, title);
+ evas_object_show(label);
+
+ return label;
+}
+
+static Evas_Object *_create_box(Evas_Object *parent)
+{
+ Evas_Object *box = elm_box_add(parent);
+ retv_if(!box, NULL);
+
+ elm_box_horizontal_set(box, EINA_TRUE);
+ elm_object_content_set(parent, box);
+ evas_object_show(box);
+
+ return box;
+}
+
+static Evas_Object *_create_datetime(Evas_Object *parent, time_t start_date)
+{
+ Evas_Object *datetime = elm_datetime_add(parent);
+ elm_object_style_set(datetime, "date_layout");
+ elm_datetime_format_set(datetime, "%d/%b/%Y");
+ elm_datetime_value_set(datetime,
+ (Efl_Time *)localtime(&start_date));
+ elm_object_content_set(parent, datetime);
+ evas_object_show(datetime);
+
+ return datetime;
+}
+
+static void _popup_back_cb(void *data, Evas_Object *popup, void *event_info)
+{
+ evas_object_del(popup);
+}
+
+static Evas_Object *_create_popup(SmartMgrData *smd, char *title)
+{
+ Evas_Object *popup = elm_popup_add(smd->md.window);
+ retv_if(!popup, NULL);
+ elm_object_part_text_set(popup, "title,text", title);
+ elm_popup_align_set(popup, 0.5, 0.5);
+ eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _popup_back_cb,
+ NULL);
+ return popup;
+}
+
+static void write_cycle_info(SmartMgrData *smd)
+{
+ if (smd->selected_sim_subscriber_id == smd->subscriber_id_1) {
+ write_sim_1_cycle_mode(smd->selected_sim_limits->cycle_mode);
+ write_sim_1_cycle_start(smd->selected_sim_limits->cycle_start);
+ write_sim_1_cycle_interval(
+ smd->selected_sim_limits->custom_mode_interval);
+ }
+ if (smd->selected_sim_subscriber_id == smd->subscriber_id_2) {
+ write_sim_2_cycle_mode(smd->selected_sim_limits->cycle_mode);
+ write_sim_2_cycle_start(smd->selected_sim_limits->cycle_start);
+ write_sim_2_cycle_interval(
+ smd->selected_sim_limits->custom_mode_interval);
+ }
+}
+
+static void _custom_cycle_popup_ok_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ int value = 0;
+ const char *value_str = elm_object_text_get(
+ popup_info.content);
+ SmartMgrData *smd = (SmartMgrData *)data;
+
+ if (value_str) {
+ value = atoi(value_str);
+ if (value < 1) {
+ create_toast_popup(popup_info.popup,
+ _("Minimum value allowed is 1. Value changed to 1"));
+ smd->selected_sim_limits->custom_mode_interval = 1;
+ elm_object_text_set(popup_info.content, "1");
+ }
+ if (value > 90) {
+ create_toast_popup(popup_info.popup,
+ _("Maximum value allowed is 90. Value changed to 90"));
+ smd->selected_sim_limits->custom_mode_interval = 90;
+ elm_object_text_set(popup_info.content, "90");
+ }
+ if (value >= 1 && value <= 90) {
+ smd->selected_sim_limits->cycle_mode = CYCLE_MODE_CUSTOM;
+ smd->selected_sim_limits->cycle_start = 1;
+ smd->selected_sim_limits->custom_mode_interval = value;
+ elm_radio_value_set(cycle_mode_radio_group,
+ smd->selected_sim_limits->cycle_mode);
+ write_cycle_info(smd);
+ generate_list(mobile_genlist, smd);
+ evas_object_del(popup_info.popup);
+ elm_genlist_realized_items_update(mobile_genlist);
+ }
+ }
+}
+
+static void _create_custom_cycle_popup(SmartMgrData *smd, char *title,
+ int days)
+{
+ char buf[256] = {0};
+ char label_buf[256] = {0};
+ popup_info.popup = _create_popup(smd, title);
+ Evas_Object *box = _create_box(popup_info.popup);
+ popup_info.content = _create_entry(box);
+ snprintf(label_buf, sizeof(label_buf), "<font_size=35>%s</font_size>",
+ _("Days"));
+ Evas_Object *label = _create_label(box, label_buf);
+
+ elm_box_pack_end(box, popup_info.content);
+ elm_box_pack_end(box, label);
+
+ snprintf(buf, sizeof(buf), "%d", days);
+ elm_object_text_set(popup_info.content, buf);
+
+ _create_popup_button(popup_info.popup, "button1", "Cancel",
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND, _popup_cancel_cb,
+ popup_info.popup);
+ _create_popup_button(popup_info.popup, "button2", "Done",
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND, _custom_cycle_popup_ok_cb,
+ smd);
+
+ evas_object_show(popup_info.popup);
+}
+
+static struct tm _get_margin_date(margin_date_type date_type)
+{
+ time_t now = {0};
+ struct tm time_tm = {0};
+ time(&now);
+ time_tm = *localtime(&now);
+ if (date_type == DATE_MIN) {
+ time_tm.tm_mon -= 3;
+ time_tm.tm_hour = 0;
+ time_tm.tm_min = 0;
+ time_tm.tm_sec = 0;
+ mktime(&time_tm);
+ }
+
+ return time_tm;
+}
+
+static void _custom_start_date_popup_ok_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ char buf[256] = {0};
+ char margin_date_buf[256] = {0};
+ time_t set_date = 0;
+ struct tm set_date_tm = {0};
+ struct tm min_date = {0};
+ struct tm max_date = {0};
+ time_t min_date_time_t = 0;
+ time_t max_date_time_t = 0;
+ SmartMgrData *smd = (SmartMgrData *)data;
+
+ elm_datetime_value_get(popup_info.content,
+ (Efl_Time *)&set_date_tm);
+ set_date = mktime(&set_date_tm);
+ min_date = _get_margin_date(DATE_MIN);
+ min_date_time_t = mktime(&min_date);
+ max_date = _get_margin_date(DATE_MAX);
+ max_date_time_t = mktime(&max_date);
+
+ if (set_date < min_date_time_t) {
+ strftime(margin_date_buf, sizeof(margin_date_buf), date_format,
+ &min_date);
+ snprintf(buf, sizeof(buf), "%s %s. %s %s.",
+ _("Start date can't be before"), margin_date_buf,
+ _("Start date changed to"), margin_date_buf);
+ create_toast_popup(popup_info.popup, buf);
+ smd->selected_sim_limits->cycle_start = mktime(&min_date);
+ elm_datetime_value_set(popup_info.content, (Efl_Time *)
+ &min_date);
+ }
+ if (set_date > max_date_time_t) {
+ strftime(margin_date_buf, sizeof(margin_date_buf), date_format,
+ &max_date);
+ snprintf(buf, sizeof(buf), "%s %s. %s",
+ _("Start date can't be after"), margin_date_buf,
+ _("Start date changed to current date."));
+ create_toast_popup(popup_info.popup, buf);
+ smd->selected_sim_limits->cycle_start = mktime(&max_date);
+ elm_datetime_value_set(popup_info.content,
+ (Efl_Time *)&max_date);
+ }
+ if (set_date >= min_date_time_t && set_date <= max_date_time_t) {
+ smd->selected_sim_limits->cycle_start = set_date;
+ write_cycle_info(smd);
+ evas_object_del(popup_info.popup);
+ elm_genlist_realized_items_update(mobile_genlist);
+ }
+}
+
+static void _warning_popup_done_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ ret_if(!smd);
+
+ const char *value_text = elm_object_text_get(popup_info.content);
+ float value = atof(value_text);
+ const char *unit_text = elm_object_text_get(popup_info.unit_btn);
+
+ if (unit_text != NULL && !strcmp(unit_text, "GB")) {
+ value *= pow(1024, 3);
+ } else {
+ value *= pow(1024, 2);
+ }
+
+ if (value > 0) {
+ if (value < smd->selected_sim_limits->limit) {
+ if (value <= MAX_LIMIT_IN_BYTES) {
+ if (set_mobile_limit_restrictions(smd->stc,
+ smd->selected_sim_subscriber_id,
+ smd->selected_sim_limits->limit,
+ (int64_t)value) == RESTRICTIONS_ERROR)
+ SETTING_TRACE_DEBUG("Warning limit not writen to stc.");
+
+ smd->selected_sim_limits->warning = (int64_t)value;
+ evas_object_del(popup_info.popup);
+ } else {
+ create_toast_popup(popup_info.popup,
+ _("Maximum value allowed is 100GB.\
+ Value changed to 100GB"));
+ smd->selected_sim_limits->warning = MAX_LIMIT_IN_BYTES;
+ _entry_set_displayed_value(popup_info.content,
+ popup_info.unit_btn, smd->selected_sim_limits->warning);
+ }
+ } else {
+ create_toast_popup(popup_info.popup,
+ _("Value must be lower than limit value"));
+ }
+ } else {
+ unset_mobile_limit_restrictions(smd->stc,
+ _get_and_unset_limit_restrictions_cb, smd);
+ smd->selected_sim_limits->warning = 0;
+ evas_object_del(popup_info.popup);
+ }
+
+ elm_genlist_realized_items_update(mobile_genlist);
+}
+
+static void _create_warning_popup(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+
+ popup_info.popup = _create_popup(smd, _("Set data usage warning level"));
+ Evas_Object *box = _create_box(popup_info.popup);
+ popup_info.content = _create_entry(box);
+ Evas_Object *clean = create_editfield_clear_popup_button(box, NULL, NULL,
+ 0.02, EVAS_HINT_EXPAND, _clean_entry_cb, popup_info.content);
+
+ popup_info.unit_btn = _create_popup_button(box, NULL, _("GB"),
+ 0.25, EVAS_HINT_EXPAND, _data_unit_type_cb, NULL);
+
+ elm_box_pack_end(box, popup_info.content);
+ elm_box_pack_end(box, clean);
+ elm_box_pack_end(box, popup_info.unit_btn);
+
+ _entry_set_displayed_value(popup_info.content,
+ popup_info.unit_btn, smd->selected_sim_limits->warning);
+
+ _create_popup_button(popup_info.popup, "button1", _("Cancel"),
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND,
+ _popup_cancel_cb, popup_info.popup);
+ _create_popup_button(popup_info.popup, "button2", _("Done"),
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND,
+ _warning_popup_done_cb, smd);
+
+ evas_object_show(popup_info.popup);
+}
+
+static void _limit_popup_done_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ ret_if(!smd);
+
+ const char *value_text = elm_object_text_get(popup_info.content);
+ float value = atof(value_text);
+ const char *unit_text = elm_object_text_get(popup_info.unit_btn);
+
+ if (unit_text != NULL && !strcmp(unit_text, "GB")) {
+ value *= pow(1024, 3);
+ } else {
+ value *= pow(1024, 2);
+ }
+
+ if (value > 0) {
+ if (value <= MAX_LIMIT_IN_BYTES) {
+ if (value > smd->selected_sim_limits->warning) {
+ if (set_mobile_limit_restrictions(smd->stc,
+ smd->selected_sim_subscriber_id,
+ (int64_t)value,
+ smd->selected_sim_limits->warning) ==
+ RESTRICTIONS_ERROR)
+ SETTING_TRACE_DEBUG("Limit not writen to stc.");
+ smd->selected_sim_limits->limit = (int64_t)value;
+ evas_object_del(popup_info.popup);
+ } else {
+ create_toast_popup(popup_info.popup,
+ _("Value must be higher than warning level value"));
+ }
+ } else {
+ create_toast_popup(popup_info.popup,
+ _("Maximum value allowed is 100GB. Value changed to 100GB"));
+ smd->selected_sim_limits->limit = MAX_LIMIT_IN_BYTES;
+ _entry_set_displayed_value(popup_info.content, popup_info.unit_btn,
+ smd->selected_sim_limits->limit);
+ }
+ } else {
+ unset_mobile_limit_restrictions(smd->stc,
+ _get_and_unset_limit_restrictions_cb, smd);
+ smd->selected_sim_limits->limit = 0;
+ smd->selected_sim_limits->warning = 0;
+ evas_object_del(popup_info.popup);
+ }
+
+ elm_genlist_realized_items_update(mobile_genlist);
+}
+
+static void _create_limit_popup(void *data, Evas_Object *obj, void *event_info)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+
+ popup_info.popup = _create_popup(smd, _("Set data usage limit"));
+ Evas_Object *box = _create_box(popup_info.popup);
+ popup_info.content = _create_entry(box);
+ Evas_Object *clean = create_editfield_clear_popup_button(box, NULL, NULL,
+ 0.02, EVAS_HINT_EXPAND, _clean_entry_cb, popup_info.content);
+
+ popup_info.unit_btn = _create_popup_button(box, NULL, _("GB"), 0.25,
+ EVAS_HINT_EXPAND, _data_unit_type_cb, NULL);
+
+ elm_box_pack_end(box, popup_info.content);
+ elm_box_pack_end(box, clean);
+ elm_box_pack_end(box, popup_info.unit_btn);
+
+ _entry_set_displayed_value(popup_info.content, popup_info.unit_btn,
+ smd->selected_sim_limits->limit);
+
+ _create_popup_button(popup_info.popup, "button1", _("Cancel"),
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND, _popup_cancel_cb,
+ popup_info.popup);
+ _create_popup_button(popup_info.popup, "button2", _("Done"),
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND, _limit_popup_done_cb, smd);
+
+ evas_object_show(popup_info.popup);
+}
+
+static char *_genlist_radio_text_get(void *data, Evas_Object *obj,
+ const char *part)
+{
+ int len = strlen("elm.text");
+ Radio_List_Item_T *item_data = (Radio_List_Item_T *)data;
+
+ if (len != strlen(part) || strncmp("elm.text", part, len))
+ return NULL;
+
+ return strdup(item_data->text);
+}
+
+static void _genlist_radio_del(void *data, Evas_Object *obj)
+{
+ Radio_List_Item_T *item_data = (Radio_List_Item_T *)data;
+ free(item_data->text);
+ free(item_data);
+}
+
+static void _handle_radio_cycle_item(Radio_List_Item_T *item_data)
+{
+ if (item_data->radio_value != CYCLE_MODE_CUSTOM) {
+ if (item_data->smd->selected_sim_limits->cycle_mode !=
+ item_data->radio_value) {
+ item_data->smd->selected_sim_limits->cycle_mode =
+ item_data->radio_value;
+ item_data->smd->selected_sim_limits->cycle_start = 1;
+ item_data->smd->selected_sim_limits->custom_mode_interval = 1;
+ elm_radio_value_set(cycle_mode_radio_group,
+ item_data->smd->selected_sim_limits->cycle_mode);
+ generate_list(mobile_genlist, item_data->smd);
+ write_cycle_info(item_data->smd);
+ }
+ } else {
+ _create_custom_cycle_popup(item_data->smd, _("Set data usage cycle"),
+ item_data->smd->selected_sim_limits->custom_mode_interval);
+ }
+
+ evas_object_del(item_data->popup);
+ elm_genlist_realized_items_update(mobile_genlist);
+}
+
+static void _radio_cycle_list_item_selected_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ _handle_radio_cycle_item((Radio_List_Item_T *)data);
+}
+
+static Elm_Widget_Item *_append_item_to_radio_list(SmartMgrData *smd,
+ Evas_Object *popup, Evas_Object *genlist, Elm_Gen_Item_Class *itc,
+ const char *text, int radio_value, bool is_first,
+ Evas_Smart_Cb select_cb)
+{
+ Radio_List_Item_T *item_data = calloc(1, sizeof(Radio_List_Item_T));
+ retv_if(!item_data, NULL);
+
+ item_data->radio_value = radio_value;
+ item_data->text = strdup(text);
+ item_data->smd = smd;
+ item_data->popup = popup;
+
+ Elm_Widget_Item *item = elm_genlist_item_append(genlist, itc, item_data,
+ NULL, ELM_GENLIST_ITEM_NONE, select_cb, item_data);
+ if (!item) {
+ SETTING_TRACE_ERROR("item == NULL");
+ free(item_data->text);
+ free(item_data);
+ return NULL;
+ }
+
+ return item;
+}
+
+static void _radio_cycle_selected_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ _handle_radio_cycle_item((Radio_List_Item_T *)data);
+}
+
+static Evas_Object *_genlist_cycle_radio_content_get(void *data,
+ Evas_Object *obj, const char *part)
+{
+ int len = strlen("elm.swallow.end");
+ Evas_Object *radio = NULL;
+ Radio_List_Item_T *item_data = (Radio_List_Item_T *)data;
+
+ if (len != strlen(part) || strncmp("elm.swallow.end", part, len))
+ return NULL;
+
+ radio = elm_radio_add(obj);
+ retv_if(!radio, NULL);
+
+ elm_radio_group_add(radio, cycle_mode_radio_group);
+ elm_radio_state_value_set(radio, item_data->radio_value);
+ evas_object_smart_callback_add(radio, "changed",
+ _radio_cycle_selected_cb, data);
+
+ elm_radio_value_set(start_weekday_radio_group,
+ item_data->smd->selected_sim_limits->cycle_mode);
+
+ return radio;
+}
+
+static void _create_cycle_list_popup(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ int i;
+ Evas_Object *genlist = NULL;
+ SmartMgrData *smd = (SmartMgrData *)data;
+
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+ Evas_Object *popup = setting_create_popup_with_list(&genlist, NULL,
+ smd->md.naviframe, _("Select data usage cycle"), NULL, 0,
+ EINA_TRUE, EINA_FALSE, 0);
+
+ cycle_mode_radio_group = elm_radio_add(genlist);
+ elm_radio_value_set(cycle_mode_radio_group,
+ smd->selected_sim_limits->cycle_mode);
+
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(elements_cycle_initial_values); ++i) {
+ _append_item_to_radio_list(smd, popup, genlist, &itc_cycle_list,
+ elements_cycle_initial_values[i],
+ i, !i, _radio_cycle_list_item_selected_cb);
+ }
+}
+
+static void _monthly_start_date_popup_done_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+
+ smd->selected_sim_limits->cycle_start =
+ elm_spinner_value_get(popup_info.content);
+ write_cycle_info(smd);
+ evas_object_del(popup_info.popup);
+ elm_genlist_realized_items_update(mobile_genlist);
+}
+
+static void _create_monthly_start_date_popup(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ Evas_Object *date_time = NULL;
+ Evas_Object *box = NULL;
+ SmartMgrData *smd = (SmartMgrData *)data;
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+
+ popup_info.popup = _create_popup(smd, _("Select start date"));
+ box = _create_box(popup_info.popup);
+ date_time = elm_spinner_add(box);
+ popup_info.content = date_time;
+ elm_object_style_set(date_time, "vertical");
+ elm_spinner_value_set(date_time, smd->selected_sim_limits->cycle_start);
+ elm_spinner_min_max_set(date_time, 1, get_days_in_current_month());
+ elm_spinner_interval_set(date_time, 1.0);
+ elm_object_content_set(box, date_time);
+ evas_object_show(date_time);
+
+ elm_box_pack_end(box, date_time);
+
+ _create_popup_button(popup_info.popup, "button1", _("Cancel"),
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND,
+ _popup_cancel_cb, popup_info.popup);
+ _create_popup_button(popup_info.popup, "button2", _("Done"),
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND,
+ _monthly_start_date_popup_done_cb, smd);
+
+ evas_object_show(popup_info.popup);
+}
+
+static void _radio_start_weekday_list_item_selected_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ Radio_List_Item_T *item_data = (Radio_List_Item_T *)data;
+ item_data->smd->selected_sim_limits->cycle_start = item_data->radio_value;
+ elm_radio_value_set(start_weekday_radio_group,
+ item_data->smd->selected_sim_limits->cycle_start);
+
+ write_cycle_info(item_data->smd);
+ evas_object_del(item_data->popup);
+ elm_genlist_realized_items_update(mobile_genlist);
+}
+
+static void _radio_start_weekday_selected_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ Radio_List_Item_T *item_data = (Radio_List_Item_T *)data;
+
+ item_data->smd->selected_sim_limits->cycle_start = item_data->radio_value;
+ elm_radio_value_set(start_weekday_radio_group,
+ item_data->smd->selected_sim_limits->cycle_start);
+
+ evas_object_del(item_data->popup);
+ elm_genlist_realized_items_update(mobile_genlist);
+}
+
+static Evas_Object *_genlist_start_weekday_radio_content_get(void *data,
+ Evas_Object *obj, const char *part)
+{
+ Evas_Object *radio = NULL;
+ int len = strlen("elm.swallow.end");
+ Radio_List_Item_T *item_data = (Radio_List_Item_T *)data;
+
+ if (len != strlen(part) || strncmp("elm.swallow.end", part, len))
+ return NULL;
+
+ radio = elm_radio_add(obj);
+ retv_if(!radio, NULL);
+
+ elm_radio_group_add(radio, start_weekday_radio_group);
+ elm_radio_state_value_set(radio, item_data->radio_value);
+ evas_object_smart_callback_add(radio, "changed",
+ _radio_start_weekday_selected_cb, data);
+
+ elm_radio_value_set(start_weekday_radio_group,
+ item_data->smd->selected_sim_limits->cycle_start);
+
+ write_cycle_info(item_data->smd);
+
+ return radio;
+}
+
+static void _create_start_weekday_list_popup(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+
+ int i;
+ Evas_Object *genlist = NULL;
+ Evas_Object *popup = setting_create_popup_with_list(&genlist,
+ NULL, smd->md.naviframe, _("Select start day"),
+ NULL, 0, EINA_TRUE, EINA_FALSE, 0);
+
+ start_weekday_radio_group = elm_radio_add(genlist);
+ elm_radio_value_set(start_weekday_radio_group,
+ smd->selected_sim_limits->cycle_mode);
+
+ for (i = 0; i < EINA_C_ARRAY_LENGTH(elements_cycle_day_of_week); ++i) {
+ _append_item_to_radio_list(smd, popup, genlist,
+ &itc_start_weekday_list, elements_cycle_day_of_week[i],
+ i+1, !i, _radio_start_weekday_list_item_selected_cb);
+ }
+}
+
+static void create_custom_start_date_popup(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ Elm_Object_Item *item = (Elm_Object_Item *)event_info;
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+
+ popup_info.popup = _create_popup(smd, _("Select start date"));
+ Evas_Object *box = _create_box(popup_info.popup);
+ Evas_Object *datetime = _create_datetime(box, (time_t)
+ smd->selected_sim_limits->cycle_start);
+ popup_info.content = datetime;
+ elm_box_pack_end(box, datetime);
+
+ _create_popup_button(popup_info.popup, "button1", _("Cancel"),
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND,
+ _popup_cancel_cb, popup_info.popup);
+ _create_popup_button(popup_info.popup, "button2", _("Done"),
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND,
+ _custom_start_date_popup_ok_cb, smd);
+
+ evas_object_show(popup_info.popup);
+}
+
+static int _create(void *data)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ Evas_Object *back_btn = NULL;
+ Elm_Object_Item *nf_it = NULL;
+
+ back_btn = elm_button_add(smd->md.naviframe);
+ elm_object_style_set(back_btn, NAVI_BACK_ARROW_BUTTON_STYLE);
+ evas_object_smart_callback_add(back_btn, "clicked", _softkey_back_cb, smd);
+
+ mobile_genlist = elm_genlist_add(smd->md.naviframe);
+ generate_list(mobile_genlist, smd);
+
+ nf_it = elm_naviframe_item_push(smd->md.naviframe,
+ _("Data usage settings"), back_btn, NULL, mobile_genlist, NULL);
+ elm_naviframe_item_style_set(nf_it, "tabbar");
+ elm_naviframe_item_pop_cb_set(nf_it, _pop_view_cb, smd);
+
+ sm_view_data_usage_mobile.is_create = 1;
+
+ return true;
+}
+
+static int _destroy(void *data)
+{
+ sm_view_data_usage_mobile.is_create = 0;
+ return 0;
+}
+
+static int _update(void* data)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ retv_if(NULL == smd, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
+
+ generate_list(mobile_genlist, smd);
+
+ return 0;
+}
+
+static int _cleanup(void* data)
+{
+ return _destroy(data);
+}
+
+void init_mobile_settings_view(SmartMgrData *ad)
+{
+ ret_if(!ad);
+ ret_if(ad->mobile_view);
+
+ sm_view_data_usage_mobile.create = _create;
+ sm_view_data_usage_mobile.destroy = _destroy;
+ sm_view_data_usage_mobile.update = _update;
+ sm_view_data_usage_mobile.cleanup = _cleanup;
+
+ ad->mobile_view = &sm_view_data_usage_mobile;
+}
+
+static void _softkey_back_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ ret_if(!smd);
+
+ elm_naviframe_item_pop(smd->md.naviframe);
+}
+
+static Eina_Bool _pop_view_cb(void *data, Elm_Object_Item *it)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ retv_if(!smd, FALSE);
+
+ smd->selected_sim_subscriber_id = NULL;
+ smd->selected_sim_limits = NULL;
+ smartmanager_stc_get_all_data();
+
+ setting_view_change(smd->mobile_view, smd->main_view, smd);
+
+ return EINA_TRUE;
+}
+
+static char *_warning_item_label_get(void *data, Evas_Object *obj,
+ const char *part)
+{
+ char buf[256] = {0};
+ char int_amount_buf[256] = {0};
+ char unit_buf[256] = {0};
+ SmartMgrData *smd = (SmartMgrData *)data;
+ retv_if(!smd, NULL);
+ retv_if(!part, NULL);
+
+ if (!strcmp(part, "elm.text")) {
+ if (smd->selected_sim_limits->warning > 0) {
+ get_data_int_amount_str(smd->selected_sim_limits->warning,
+ int_amount_buf, sizeof(int_amount_buf));
+ get_data_unit_str(smd->selected_sim_limits->warning, unit_buf,
+ sizeof(unit_buf));
+ snprintf(buf, sizeof(buf), "%s%s", int_amount_buf, unit_buf);
+ } else {
+ snprintf(buf, sizeof(buf), "%s", _("None"));
+ }
+
+ return strdup(buf);
+ }
+ if (!strcmp(part, "elm.text.sub")) {
+ return strdup(_("Warning level"));
+ }
+
+ return NULL;
+}
+
+static char *_limit_item_label_get(void *data, Evas_Object *obj,
+ const char *part)
+{
+ char buf[256] = {0};
+ char int_amount_buf[256] = {0};
+ char unit_buf[256] = {0};
+ SmartMgrData *smd = (SmartMgrData *)data;
+ retv_if(!smd, NULL);
+ retv_if(!part, NULL);
+
+ if (!strcmp(part, "elm.text")) {
+ if (smd->selected_sim_limits->limit > 0) {
+ get_data_int_amount_str(smd->selected_sim_limits->limit,
+ int_amount_buf, sizeof(int_amount_buf));
+ get_data_unit_str(smd->selected_sim_limits->limit, unit_buf,
+ sizeof(unit_buf));
+ snprintf(buf, sizeof(buf), "%s%s", int_amount_buf, unit_buf);
+ } else {
+ snprintf(buf, sizeof(buf), "%s", _("None"));
+ }
+ return strdup(buf);
+ }
+
+ if (!strcmp(part, "elm.text.sub"))
+ return strdup(_("Limit"));
+ return NULL;
+}
+
+static char *_cycle_item_label_get(void *data, Evas_Object *obj,
+ const char *part)
+{
+ char buf[256] = {0};
+ SmartMgrData *smd = (SmartMgrData *)data;
+ retv_if(!smd, NULL);
+ retv_if(!part, NULL);
+
+ if (!strcmp(part, "elm.text")) {
+ if (smd->selected_sim_limits->custom_mode_interval &&
+ smd->selected_sim_limits->cycle_mode == CYCLE_MODE_CUSTOM) {
+ snprintf(buf, sizeof(buf), "%d %s",
+ smd->selected_sim_limits->custom_mode_interval,
+ smd->selected_sim_limits->custom_mode_interval == 1 ?
+ _("Day") : _("Days"));
+ } else {
+ snprintf(buf, sizeof(buf), "%s",
+ elements_cycle_initial_values[
+ smd->selected_sim_limits->cycle_mode]);
+ }
+
+ return strdup(buf);
+ }
+ if (!strcmp(part, "elm.text.sub"))
+ return strdup(_("Cycle"));
+ return NULL;
+}
+
+static char *_start_date_item_label_get(void *data, Evas_Object *obj,
+ const char *part)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ retv_if(!smd, NULL);
+ retv_if(!part, NULL);
+
+ char buf[256] = {0};
+ struct tm time = {0};
+
+ if (!strcmp(part, "elm.text")) {
+ switch (smd->selected_sim_limits->cycle_mode) {
+ case CYCLE_MODE_MONTHLY:
+ snprintf(buf, sizeof(buf), "%d",
+ smd->selected_sim_limits->cycle_start);
+ break;
+ case CYCLE_MODE_WEEKLY:
+ snprintf(buf, sizeof(buf), "%s",
+ elements_cycle_day_of_week[
+ smd->selected_sim_limits->cycle_start-1]);
+ break;
+ case CYCLE_MODE_DAILY:
+ break;
+ case CYCLE_MODE_CUSTOM:
+ if (smd->selected_sim_limits->cycle_start > 1) {
+ time = *localtime(
+ (time_t*)&smd->selected_sim_limits->cycle_start);
+ } else {
+ time = _get_margin_date(DATE_MAX);
+ smd->selected_sim_limits->cycle_start = (int)mktime(&time);
+ }
+
+ strftime(buf, sizeof(buf), date_format, &time);
+ write_cycle_info(smd);
+ break;
+ }
+
+ return strdup(buf);
+ }
+
+ if (!strcmp(part, "elm.text.sub"))
+ return strdup(_("Start date"));
+ return NULL;
+}
+
+static char *_description_item_label_get(void *data, Evas_Object *obj,
+ const char *part)
+{
+ char buf[256] = {0};
+ char number_with_postfix[256] = {0};
+ SmartMgrData *smd = (SmartMgrData *)data;
+ retv_if(!smd, NULL);
+ retv_if(!part, NULL);
+
+ if (!strcmp(part, "elm.text.multiline")) {
+ switch (smd->selected_sim_limits->cycle_mode) {
+ case CYCLE_MODE_MONTHLY:
+ create_number_with_postfix(smd->selected_sim_limits->cycle_start,
+ number_with_postfix, sizeof(number_with_postfix));
+ snprintf(buf, sizeof(buf), "%s %s %s",
+ _("The data usage info will be reset on the"),
+ number_with_postfix,
+ _("day of every month."));
+ break;
+ case CYCLE_MODE_WEEKLY:
+ snprintf(buf, sizeof(buf), "%s %s.",
+ _("The data usage info will be reset every"),
+ elements_cycle_day_of_week[
+ smd->selected_sim_limits->cycle_start-1]);
+ break;
+ case CYCLE_MODE_DAILY:
+ snprintf(buf, sizeof(buf), "%s",
+ _("The data usage info will be reset at midnight every day."));
+ break;
+ case CYCLE_MODE_CUSTOM:
+ snprintf(buf, sizeof(buf), "%s %d %s %s",
+ _("The data usage info will be reset every"),
+ smd->selected_sim_limits->custom_mode_interval,
+ smd->selected_sim_limits->custom_mode_interval == 1 ?
+ _("day") : _("days"),
+ _("from the start date."));
+ break;
+ }
+
+ return strdup(buf);
+ }
+
+ return NULL;
+}
--- /dev/null
+#include <Efl.h>
+#include <Elementary.h>
+#include <efl_extension_events.h>
+#include <setting-common/setting-common-draw-widget.h>
+
+#include "smartmanager-data-usage-wifi-settings.h"
+#include "smartmanager-utils.h"
+
+static int _create(void *data);
+static int _destroy(void *data);
+static int _update(void *data);
+static int _cleanup(void *data);
+
+/* Widget interaction callbacks: */
+static void _custom_cycle_days_popup_cancel_click_cb(void *data,
+ Evas_Object *button, void *event_info);
+static void _custom_cycle_days_popup_done_click_cb(void *data,
+ Evas_Object *button, void *event_info);
+static void _cycle_item_click_cb(void *data, Evas_Object *obj,
+ void *event_info);
+static void _cycle_popup_radio_changed_cb(void *data, Evas_Object *radio,
+ void *event_info);
+static void _cycle_popup_item_selected_cb(void *ix, Evas_Object *genlist,
+ void *event_info);
+
+static void _start_date_item_click_cb(void *data, Evas_Object *obj,
+ void *event_info);
+
+static Eina_Bool _pop_view_cb(void *data, Elm_Object_Item *it);
+static void _softkey_back_cb(void *data, Evas_Object *obj,
+ void *event_info);
+
+/* Genlist items classes and functions: */
+static char *_cycle_item_text_get(void *data, Evas_Object *genlist,
+ const char *part);
+static char *_start_date_item_text_get(void *data, Evas_Object *genlist,
+ const char *part);
+static char *_info_item_text_get(void *data, Evas_Object *genlist,
+ const char *part);
+static char *_cycle_popup_radio_item_text_get(void *data, Evas_Object *genlist,
+ const char *part);
+static Evas_Object *_cycle_popup_radio_item_content_get(void *data,
+ Evas_Object *genlist, const char *part);
+static char *_start_day_popup_radio_item_text_get(void *ix,
+ Evas_Object *genlist, const char *part);
+static Evas_Object *_start_day_popup_radio_item_content_get(void *ix,
+ Evas_Object *genlist, const char *part);
+
+static void _generate_list(SmartMgrData *ad, Evas_Object *genlist);
+static Evas_Object *_create_popup(SmartMgrData *smd, char *title);
+static Evas_Object *_create_custom_cycle_days_popup(SmartMgrData *smd);
+
+static Elm_Genlist_Item_Class cycle_itc = {
+ .item_style = "type2",
+ .func.text_get = _cycle_item_text_get
+};
+static Elm_Genlist_Item_Class start_date_itc = {
+ .item_style = "type2",
+ .func.text_get = _start_date_item_text_get
+};
+static Elm_Genlist_Item_Class info_itc = {
+ .item_style = "multiline",
+ .func.text_get = _info_item_text_get
+};
+static Elm_Genlist_Item_Class cycle_radio_itc = {
+ .item_style = "type1",
+ .func.text_get = _cycle_popup_radio_item_text_get,
+ .func.content_get = _cycle_popup_radio_item_content_get
+};
+static Elm_Genlist_Item_Class start_day_radio_itc = {
+ .item_style = "type1",
+ .func.text_get = _start_day_popup_radio_item_text_get,
+ .func.content_get = _start_day_popup_radio_item_content_get
+};
+
+setting_view sm_view_data_usage_wifi;
+
+static Evas_Object *cycle_popup_radio_group = NULL;
+static Evas_Object *cycle_popup = NULL;
+static Evas_Object *start_date_popup = NULL;
+static Evas_Object *start_date_popup_radio_group = NULL;
+static Evas_Object *start_date_popup_datetime = NULL;
+static Evas_Object *start_date_popup_month_day_spinner = NULL;
+static Elm_Object_Item *gl_start_date_item = NULL;
+
+const static char *cycle_names[] = {
+ "Monthly",
+ "Weekly",
+ "Daily",
+ "Custom"
+};
+
+const static char *weekday_names[] = {
+ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
+};
+
+static void _popup_back_cb(void *data, Evas_Object *popup, void *event_info)
+{
+ evas_object_del(popup);
+}
+
+static int _create(void *data)
+{
+ Evas_Object *back_btn = NULL;
+ Elm_Object_Item *nf_it = NULL;
+ SmartMgrData *smd = (SmartMgrData *)data;
+
+ back_btn = elm_button_add(smd->md.naviframe);
+ elm_object_style_set(back_btn, "naviframe/end_btn/default");
+ evas_object_smart_callback_add(back_btn, "clicked", _softkey_back_cb, smd);
+
+ smd->wifi_data_setting_genlist = elm_genlist_add(smd->md.naviframe);
+ _generate_list(smd, smd->wifi_data_setting_genlist);
+ nf_it = elm_naviframe_item_push(smd->md.naviframe,
+ _("Data usage settings"), back_btn, NULL,
+ smd->wifi_data_setting_genlist, NULL);
+ elm_naviframe_item_pop_cb_set(nf_it, _pop_view_cb, smd);
+
+ sm_view_data_usage_wifi.is_create = 1;
+ return 0;
+}
+
+static int _destroy(void *data)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ retv_if(NULL == smd, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
+ gl_start_date_item = NULL;
+ cycle_popup = NULL;
+ start_date_popup = NULL;
+ cycle_popup_radio_group = NULL;
+ start_date_popup_datetime = NULL;
+ start_date_popup_radio_group = NULL;
+ start_date_popup_month_day_spinner = NULL;
+ sm_view_data_usage_wifi.is_create = 0;
+ return 0;
+}
+
+static int _update(void *data)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ retv_if(NULL == smd, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
+
+ return 0;
+}
+
+static int _cleanup(void *data)
+{
+ return _destroy(data);
+}
+
+void init_wifi_settings_view(SmartMgrData *ad)
+{
+ ret_if(!ad);
+ ret_if(ad->wifi_view);
+
+ sm_view_data_usage_wifi.create = _create;
+ sm_view_data_usage_wifi.destroy = _destroy;
+ sm_view_data_usage_wifi.update = _update;
+ sm_view_data_usage_wifi.cleanup = _cleanup;
+
+ ad->wifi_view = &sm_view_data_usage_wifi;
+}
+
+static void _softkey_back_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ SmartMgrData *smd = (SmartMgrData *)data;
+ ret_if(!smd);
+
+ elm_naviframe_item_pop(smd->md.naviframe);
+}
+
+static Eina_Bool _pop_view_cb(void *data, Elm_Object_Item *it)
+{
+ SmartMgrData *smd = (SmartMgrData*)data;
+ retv_if(!smd, FALSE);
+
+ smartmanager_stc_get_all_data();
+ setting_view_change(smd->wifi_view, smd->main_view, smd);
+
+ return EINA_TRUE;
+}
+
+static void _custom_cycle_days_popup_cancel_click_cb(void *data,
+ Evas_Object *button, void *event_info)
+{
+ Evas_Object *popup = evas_object_data_get(button, "popup");
+ evas_object_del(popup);
+}
+
+static void _custom_cycle_days_popup_done_click_cb(void *data,
+ Evas_Object *button, void *event_info)
+{
+ SmartMgrData *smd = data;
+ Evas_Object *entry = evas_object_data_get(button, "entry");
+ Evas_Object *popup = evas_object_data_get(button, "popup");
+ Elm_Widget_Item *first_gl_item = NULL;
+
+ if (!data)
+ return;
+
+ elm_object_item_del(gl_start_date_item);
+ gl_start_date_item = NULL;
+
+ /* Validate: */
+ smd->wifi_limits.custom_mode_interval = atoi(elm_entry_entry_get(entry));
+ if (smd->wifi_limits.custom_mode_interval <= 0) {
+ smd->wifi_limits.custom_mode_interval = 1;
+ setting_create_toast_popup(
+ _("Minimum value allowed is 1. Value set to 1"),
+ smd->md.window);
+ }
+
+ if (smd->wifi_limits.custom_mode_interval > 90) {
+ smd->wifi_limits.custom_mode_interval = 90;
+ setting_create_toast_popup(
+ _("Maximum value allowed is 90. Value set to 90"),
+ smd->md.window);
+
+ }
+
+ smd->wifi_limits.cycle_mode = CYCLE_MODE_CUSTOM;
+ elm_radio_value_set(cycle_popup_radio_group, smd->wifi_limits.cycle_mode);
+ if (!write_wifi_cycle_mode(smd->wifi_limits.cycle_mode)) {
+ SETTING_TRACE_ERROR("Failed to write wifi cycle mode");
+ } else {
+ /* It is necessary to reset start cycle values: */
+ smd->wifi_limits.cycle_start = time(NULL);
+ if (!write_wifi_cycle_start(smd->wifi_limits.cycle_start))
+ SETTING_TRACE_ERROR("Failed to write wifi cycle start");
+ if (!write_wifi_cycle_interval(smd->wifi_limits.custom_mode_interval))
+ SETTING_TRACE_ERROR("Failed to write wifi cycle interval");
+ }
+
+ first_gl_item = elm_genlist_first_item_get(smd->wifi_data_setting_genlist);
+ gl_start_date_item = elm_genlist_item_insert_after(
+ smd->wifi_data_setting_genlist,
+ &start_date_itc, smd, NULL,
+ first_gl_item, ELM_GENLIST_ITEM_NONE,
+ _start_date_item_click_cb, smd);
+ elm_genlist_item_update(gl_start_date_item);
+
+ evas_object_del(popup);
+ evas_object_del(cycle_popup);
+ cycle_popup = NULL;
+ cycle_popup_radio_group = NULL;
+ elm_genlist_realized_items_update(smd->wifi_data_setting_genlist);
+}
+
+static Evas_Object *_create_custom_cycle_days_popup(SmartMgrData *smd)
+{
+ char buff[64] = {'\0'};
+ Evas_Object *entry = NULL;
+ Evas_Object *button = NULL;
+ Evas_Object *popup = NULL;
+
+ if (!smd)
+ return NULL;
+
+ popup = _create_popup(smd, _("Set data usage cycle"));
+ elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
+
+ snprintf(buff, sizeof(buff), "%d", smd->wifi_limits.custom_mode_interval);
+ entry = elm_entry_add(popup);
+ elm_entry_single_line_set(entry, EINA_TRUE);
+ elm_entry_entry_set(entry, buff);
+ elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NUMBERONLY);
+ elm_entry_input_panel_show(entry);
+ elm_object_content_set(popup, entry);
+
+ button = elm_button_add(popup);
+ elm_object_text_set(button, _("Cancel"));
+ elm_object_part_content_set(popup, "button1", button);
+ evas_object_data_set(button, "popup", popup);
+ evas_object_smart_callback_add(button, "clicked",
+ _custom_cycle_days_popup_cancel_click_cb, smd);
+
+ button = elm_button_add(popup);
+ evas_object_data_set(button, "entry", entry);
+ evas_object_data_set(button, "popup", popup);
+ elm_object_text_set(button, _("Done"));
+ elm_object_part_content_set(popup, "button2", button);
+ evas_object_smart_callback_add(button, "clicked",
+ _custom_cycle_days_popup_done_click_cb, smd);
+
+ return popup;
+}
+
+static void _cycle_popup_item_selected_cb(void *ix, Evas_Object *genlist,
+ void *event_info)
+{
+ SmartMgrData *smd = evas_object_data_get(genlist, "SmartMgrData");
+ Elm_Widget_Item *first_gl_item = NULL;
+
+ if (!smd)
+ return;
+
+ elm_genlist_item_selected_set(event_info, EINA_FALSE);
+
+ if (CYCLE_MODE_CUSTOM == (int)ix) {
+ _create_custom_cycle_days_popup(smd);
+ return;
+ }
+
+ elm_object_item_del(gl_start_date_item);
+ gl_start_date_item = NULL;
+
+ smd->wifi_limits.cycle_mode = (int)ix;
+ elm_radio_value_set(cycle_popup_radio_group, smd->wifi_limits.cycle_mode);
+
+ if (!write_wifi_cycle_mode(smd->wifi_limits.cycle_mode)) {
+ SETTING_TRACE_ERROR("Failed to write wifi cycle mode");
+ } else {
+ /* It is necessary to reset start cycle values: */
+ if (CYCLE_MODE_CUSTOM == smd->wifi_limits.cycle_mode) {
+ smd->wifi_limits.cycle_start = time(NULL);
+ } else {
+ smd->wifi_limits.cycle_start = 1;
+ }
+
+ if (!write_wifi_cycle_start(smd->wifi_limits.cycle_start))
+ SETTING_TRACE_ERROR("Failed to write wifi cycle start week day");
+ }
+
+ if (CYCLE_MODE_DAILY != smd->wifi_limits.cycle_mode) {
+ first_gl_item = elm_genlist_first_item_get(
+ smd->wifi_data_setting_genlist);
+ gl_start_date_item = elm_genlist_item_insert_after(
+ smd->wifi_data_setting_genlist,
+ &start_date_itc, smd, NULL,
+ first_gl_item, ELM_GENLIST_ITEM_NONE,
+ _start_date_item_click_cb, smd);
+ elm_genlist_item_update(gl_start_date_item);
+ }
+
+ evas_object_del(cycle_popup);
+ cycle_popup = NULL;
+ cycle_popup_radio_group = NULL;
+ elm_genlist_realized_items_update(smd->wifi_data_setting_genlist);
+}
+
+static void _cycle_popup_radio_changed_cb(void *data, Evas_Object *radio,
+ void *event_info)
+{
+ SmartMgrData *smd = data;
+ Elm_Widget_Item *first_gl_item = NULL;
+
+ smd->wifi_limits.cycle_mode = elm_radio_state_value_get(radio);
+
+ if (CYCLE_MODE_CUSTOM == smd->wifi_limits.cycle_mode) {
+ _create_custom_cycle_days_popup(smd);
+ return;
+ }
+
+ elm_object_item_del(gl_start_date_item);
+ gl_start_date_item = NULL;
+
+ if (!write_wifi_cycle_mode(smd->wifi_limits.cycle_mode)) {
+ SETTING_TRACE_ERROR("Failed to write wifi cycle mode");
+ } else {
+ /* It is necessary to reset start cycle values: */
+ if (CYCLE_MODE_CUSTOM == smd->wifi_limits.cycle_mode)
+ smd->wifi_limits.cycle_start = time(NULL);
+ else
+ smd->wifi_limits.cycle_start = 1;
+ if (!write_wifi_cycle_start(smd->wifi_limits.cycle_start))
+ SETTING_TRACE_ERROR("Failed to write wifi cycle start week day");
+ }
+
+ if (CYCLE_MODE_DAILY != smd->wifi_limits.cycle_mode) {
+ first_gl_item = elm_genlist_first_item_get(
+ smd->wifi_data_setting_genlist);
+ gl_start_date_item = elm_genlist_item_insert_after(
+ smd->wifi_data_setting_genlist,
+ &start_date_itc, smd, NULL,
+ first_gl_item, ELM_GENLIST_ITEM_NONE,
+ _start_date_item_click_cb, smd);
+ elm_genlist_item_update(gl_start_date_item);
+ }
+
+ evas_object_del(cycle_popup);
+ cycle_popup = NULL;
+ cycle_popup_radio_group = NULL;
+ elm_genlist_realized_items_update(smd->wifi_data_setting_genlist);
+}
+
+static char *_cycle_popup_radio_item_text_get(void *ix, Evas_Object *genlist,
+ const char *part)
+{
+ if (!safeStrCmp(part, "elm.text"))
+ return strdup(cycle_names[(int)ix]);
+ return NULL;
+}
+
+static Evas_Object *_cycle_popup_radio_item_content_get(void *ix,
+ Evas_Object *genlist, const char *part)
+{
+ Evas_Object *radio = NULL;
+ SmartMgrData *smd = evas_object_data_get(genlist, "SmartMgrData");
+
+ if (!safeStrCmp(part, "elm.swallow.end")) {
+ radio = elm_radio_add(genlist);
+ evas_object_propagate_events_set(radio, EINA_FALSE);
+ elm_radio_state_value_set(radio, (int)ix);
+ elm_radio_group_add(radio, cycle_popup_radio_group);
+ evas_object_smart_callback_add(radio, "changed",
+ _cycle_popup_radio_changed_cb, smd);
+ return radio;
+ }
+
+ return NULL;
+}
+
+static Evas_Object *_create_popup(SmartMgrData *smd, char *title)
+{
+ Evas_Object *popup = elm_popup_add(smd->md.window);
+ elm_popup_align_set(popup, ELM_NOTIFY_ALIGN_FILL, 1.0);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_object_part_text_set(popup, "title,text", title);
+ eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK, _popup_back_cb,
+ NULL);
+ evas_object_show(popup);
+
+ return popup;
+}
+
+static void _cycle_item_click_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ int ix = 0;
+ SmartMgrData *smd = data;
+ Evas_Object *genlist = NULL;
+
+ elm_genlist_item_selected_set(event_info, EINA_FALSE);
+ cycle_popup = _create_popup(smd, _("Select data usage cycle"));
+
+ genlist = elm_genlist_add(cycle_popup);
+ evas_object_data_set(genlist, "SmartMgrData", smd);
+ elm_object_content_set(cycle_popup, genlist);
+
+ cycle_popup_radio_group = elm_radio_add(genlist);
+
+ for (ix = 0; ix < sizeof(cycle_names) / sizeof(char *); ix++)
+ elm_genlist_item_append(genlist, &cycle_radio_itc, (void *)ix, NULL,
+ ELM_GENLIST_ITEM_NONE,
+ _cycle_popup_item_selected_cb, (void *)ix);
+
+ elm_radio_value_set(cycle_popup_radio_group, smd->wifi_limits.cycle_mode);
+}
+
+static void _start_date_popup_cancel_click_cb(void *data, Evas_Object *button,
+ void *event_info)
+{
+ evas_object_del(start_date_popup);
+ start_date_popup = NULL;
+ start_date_popup_datetime = NULL;
+ start_date_popup_month_day_spinner = NULL;
+}
+
+static void _start_date_popup_set_click_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ struct tm start_date = {0};
+ Eina_Bool time_res = EINA_FALSE;
+ SmartMgrData *smd = data;
+ double time_delta = 0.0;
+ time_t now = time(NULL);
+ struct tm *now_tm = NULL;
+ time_t past_max = 0;
+ struct tm *past_max_tm = NULL;
+ char txt_buff[256] = {'\0',};
+ char past_date_txt_buff[80] = {'\0',};
+
+ /* set'now' to second past midnight: */
+ now_tm = localtime(&now);
+ now_tm->tm_sec = 1;
+ now_tm->tm_min = 0;
+ now_tm->tm_hour = 0;
+ now = mktime(now_tm);
+ now_tm = NULL;
+ past_max = now - (3600.0 * 24.0 * 90.0);
+
+ smd->wifi_limits.cycle_start = 1;
+
+ if (CYCLE_MODE_MONTHLY == smd->wifi_limits.cycle_mode) {
+ smd->wifi_limits.cycle_start =
+ (int)elm_spinner_value_get(start_date_popup_month_day_spinner);
+ }
+
+ if (CYCLE_MODE_CUSTOM == smd->wifi_limits.cycle_mode) {
+ time_res = elm_datetime_value_get(start_date_popup_datetime,
+ &start_date);
+ start_date.tm_sec = 1;
+ start_date.tm_min = 0;
+ start_date.tm_hour = 0;
+ if (EINA_TRUE == time_res) {
+ smd->wifi_limits.cycle_start = mktime(&start_date);
+ time_delta = difftime(smd->wifi_limits.cycle_start, now);
+
+ if (time_delta > 1.0) {
+ setting_create_toast_popup(_("Start date can't be after "\
+ "current date. Start date changed to current date."),
+ smd->md.window);
+ smd->wifi_limits.cycle_start = now;
+ }
+
+ if (time_delta < -(3600.0 * 24.0 * 90.0)) {
+ past_max_tm = localtime(&past_max);
+ strftime(past_date_txt_buff, sizeof(past_date_txt_buff),
+ "%a, %d/%m/%Y", past_max_tm);
+ snprintf(txt_buff, sizeof(txt_buff), "%s %s. %s %s.",
+ _("Start date can't be before"), past_date_txt_buff,
+ _("Start date changed to"),
+ past_date_txt_buff);
+ setting_create_toast_popup(txt_buff, smd->md.window);
+ smd->wifi_limits.cycle_start = past_max;
+ }
+
+ } else {
+ SETTING_TRACE_ERROR("Failed to obtain data from datetime %p",
+ start_date_popup_datetime);
+ }
+ }
+
+ if (!write_wifi_cycle_start(smd->wifi_limits.cycle_start))
+ SETTING_TRACE_ERROR("Failed to write wifi cycle start");
+
+ evas_object_del(start_date_popup);
+ start_date_popup = NULL;
+ start_date_popup_datetime = NULL;
+ start_date_popup_month_day_spinner = NULL;
+ elm_genlist_realized_items_update(smd->wifi_data_setting_genlist);
+}
+
+static void _start_day_popup_radio_changed_cb(void *data, Evas_Object *radio,
+ void *event_info)
+{
+ SmartMgrData *smd = data;
+
+ smd->wifi_limits.cycle_start = elm_radio_state_value_get(radio);
+ if (!write_wifi_cycle_start(smd->wifi_limits.cycle_start))
+ SETTING_TRACE_ERROR("Failed to write wifi cycle start week day");
+
+ evas_object_del(start_date_popup);
+ start_date_popup = NULL;
+ start_date_popup_radio_group = NULL;
+ elm_genlist_realized_items_update(smd->wifi_data_setting_genlist);
+}
+
+static void _start_day_popup_item_selected_cb(void *ix, Evas_Object *genlist,
+ void *event_info)
+{
+ SmartMgrData *smd = evas_object_data_get(genlist, "SmartMgrData");
+ elm_genlist_item_selected_set(event_info, EINA_FALSE);
+
+ if (!smd)
+ return;
+
+ smd->wifi_limits.cycle_start = (int)ix;
+ elm_radio_value_set(start_date_popup_radio_group,
+ smd->wifi_limits.cycle_start);
+ if (!write_wifi_cycle_start(smd->wifi_limits.cycle_start))
+ SETTING_TRACE_ERROR("Failed to write wifi cycle start week day");
+
+ evas_object_del(start_date_popup);
+ start_date_popup = NULL;
+ start_date_popup_radio_group = NULL;
+ elm_genlist_realized_items_update(smd->wifi_data_setting_genlist);
+}
+
+static char *_start_day_popup_radio_item_text_get(void *ix,
+ Evas_Object *genlist, const char *part)
+{
+ if (!safeStrCmp(part, "elm.text"))
+ return strdup(weekday_names[(int)ix]);
+
+ return NULL;
+}
+
+static Evas_Object *_start_day_popup_radio_item_content_get(void *ix,
+ Evas_Object *genlist, const char *part)
+{
+ Evas_Object *radio = NULL;
+ SmartMgrData *smd = evas_object_data_get(genlist, "SmartMgrData");
+
+ if (!safeStrCmp(part, "elm.swallow.end")) {
+ radio = elm_radio_add(genlist);
+ evas_object_propagate_events_set(radio, EINA_FALSE);
+ elm_radio_state_value_set(radio, (int)ix);
+ elm_radio_group_add(radio, start_date_popup_radio_group);
+ evas_object_smart_callback_add(radio, "changed",
+ _start_day_popup_radio_changed_cb, smd);
+ return radio;
+ }
+
+ return NULL;
+}
+
+static void _start_date_item_click_cb(void *data, Evas_Object *genlist,
+ void *event_info)
+{
+ SmartMgrData *smd = data;
+ Evas_Object *button = NULL;
+ Evas_Object *week_days_genlist = NULL;
+ int ix = 0;
+ time_t now = time(NULL);
+
+ elm_genlist_item_selected_set(event_info, EINA_FALSE);
+
+ if (!smd)
+ return;
+
+ if (CYCLE_MODE_CUSTOM == smd->wifi_limits.cycle_mode ||
+ CYCLE_MODE_MONTHLY == smd->wifi_limits.cycle_mode) {
+ start_date_popup = _create_popup(smd, _("Select start date"));
+ elm_popup_align_set(start_date_popup, 0.5, 0.5);
+
+ if (CYCLE_MODE_CUSTOM == smd->wifi_limits.cycle_mode) {
+ start_date_popup_datetime = elm_datetime_add(start_date_popup);
+ elm_object_style_set(start_date_popup_datetime, "date_layout");
+ elm_datetime_format_set(start_date_popup_datetime, "%d/%b/%Y");
+ if (smd->wifi_limits.cycle_start <= 0) {
+ elm_datetime_value_set(start_date_popup_datetime,
+ (Efl_Time *)localtime(&now));
+ } else {
+ elm_datetime_value_set(start_date_popup_datetime,
+ (Efl_Time *)localtime((time_t *)(
+ &(smd->wifi_limits.cycle_start))
+ )
+ );
+ }
+ elm_object_content_set(start_date_popup, start_date_popup_datetime);
+ }
+
+ if (CYCLE_MODE_MONTHLY == smd->wifi_limits.cycle_mode) {
+ start_date_popup_month_day_spinner =
+ elm_spinner_add(start_date_popup);
+ elm_object_style_set(start_date_popup_month_day_spinner,
+ "vertical");
+ elm_spinner_value_set(start_date_popup_month_day_spinner,
+ smd->wifi_limits.cycle_start);
+ elm_spinner_min_max_set(start_date_popup_month_day_spinner, 1, 31);
+ elm_object_content_set(start_date_popup,
+ start_date_popup_month_day_spinner);
+ }
+
+ button = elm_button_add(start_date_popup);
+ elm_object_text_set(button, _("Cancel"));
+ elm_object_part_content_set(start_date_popup, "button1", button);
+ evas_object_smart_callback_add(button, "clicked",
+ _start_date_popup_cancel_click_cb, smd);
+
+ button = elm_button_add(start_date_popup);
+ elm_object_text_set(button, _("Set"));
+ elm_object_part_content_set(start_date_popup, "button2", button);
+ evas_object_smart_callback_add(button, "clicked",
+ _start_date_popup_set_click_cb, smd);
+ }
+
+ if (CYCLE_MODE_WEEKLY == smd->wifi_limits.cycle_mode) {
+ start_date_popup = _create_popup(smd, _("Select start day"));
+ week_days_genlist = elm_genlist_add(start_date_popup);
+ evas_object_data_set(week_days_genlist, "SmartMgrData", smd);
+ elm_object_content_set(start_date_popup, week_days_genlist);
+ start_date_popup_radio_group = elm_radio_add(week_days_genlist);
+
+ for (ix = 0; ix < sizeof(weekday_names) / sizeof(char *); ix++)
+ elm_genlist_item_append(week_days_genlist, &start_day_radio_itc,
+ (void *)ix, NULL, ELM_GENLIST_ITEM_NONE,
+ _start_day_popup_item_selected_cb, (void *)ix);
+
+ elm_radio_value_set(start_date_popup_radio_group,
+ smd->wifi_limits.cycle_start);
+ }
+}
+
+static char *_cycle_item_text_get(void *data, Evas_Object *genlist,
+ const char *part)
+{
+ SmartMgrData *ad = data;
+ char txt_buff[256] = {'\0',};
+
+ if (!ad)
+ return NULL;
+
+ if (!safeStrCmp(part, "elm.text")) {
+ if (CYCLE_MODE_CUSTOM == ad->wifi_limits.cycle_mode) {
+
+ snprintf(txt_buff, sizeof(txt_buff), "%d %s",
+ ad->wifi_limits.custom_mode_interval, _("Days"));
+ return strdup(txt_buff);
+ }
+ return strdup(
+ cycle_names[ad->wifi_limits.cycle_mode]
+ );
+ }
+
+ if (!safeStrCmp(part, "elm.text.sub"))
+ return strdup(_("Cycle"));
+
+ return NULL;
+}
+
+static char *_start_date_item_text_get(void *data, Evas_Object *genlist,
+ const char *part)
+{
+ SmartMgrData *smd = data;
+ char buff[128] = {'\0',};
+ struct tm *tm = NULL;
+
+ if (!data || CYCLE_MODE_DAILY == smd->wifi_limits.cycle_mode)
+ return NULL;
+
+ if (!safeStrCmp(part, "elm.text")) {
+ switch (smd->wifi_limits.cycle_mode) {
+ case CYCLE_MODE_MONTHLY:
+
+ snprintf(buff, sizeof(buff), "%d", smd->wifi_limits.cycle_start);
+ break;
+ case CYCLE_MODE_WEEKLY:
+ if ((smd->wifi_limits.cycle_start >=
+ sizeof(weekday_names) / sizeof(char *)) ||
+ smd->wifi_limits.cycle_start < 0) {
+ SETTING_TRACE_ERROR("Cycle start is put of bounds %d"\
+ " setting to 0",
+ smd->wifi_limits.cycle_start);
+ smd->wifi_limits.cycle_start = 0;
+ }
+ snprintf(buff, sizeof(buff), "%s",
+ _(weekday_names[smd->wifi_limits.cycle_start]));
+ break;
+ case CYCLE_MODE_DAILY:
+ break;
+ case CYCLE_MODE_CUSTOM:
+ tm = localtime((time_t *)(&(smd->wifi_limits.cycle_start)));
+ strftime(buff, sizeof(buff), "%a, %d/%m/%Y", tm);
+ break;
+ default:
+ break;
+ }
+
+ return strdup(buff);
+ }
+
+ if (!safeStrCmp(part, "elm.text.sub"))
+ return strdup(_("Start date"));
+
+ return NULL;
+}
+
+static char *_info_item_text_get(void *data, Evas_Object *genlist,
+ const char *part)
+{
+ SmartMgrData *smd = data;
+ char buff[256] = {'\0',};
+
+ if (!data)
+ return NULL;
+
+ if (!safeStrCmp(part, "elm.text.multiline")) {
+ switch (smd->wifi_limits.cycle_mode) {
+ case CYCLE_MODE_MONTHLY:
+ snprintf(buff, sizeof(buff), "%s %d %s",
+ _("The data usage info will be reset on the"),
+ smd->wifi_limits.cycle_start,
+ _("day of every month."));
+ break;
+ case CYCLE_MODE_WEEKLY:
+ if ((smd->wifi_limits.cycle_start >=
+ sizeof(weekday_names) / sizeof(char *)) ||
+ smd->wifi_limits.cycle_start < 0) {
+ SETTING_TRACE_ERROR("Cycle start is put of bounds %d"\
+ " setting to 0",
+ smd->wifi_limits.cycle_start);
+ smd->wifi_limits.cycle_start = 0;
+ }
+ snprintf(buff, sizeof(buff), "%s %s%s",
+ _("The data usage info will be reset every"),
+ _(weekday_names[smd->wifi_limits.cycle_start]),
+ ".");
+ break;
+ case CYCLE_MODE_DAILY:
+ snprintf(buff, sizeof(buff), "%s",
+ _("The data usage info will be reset at midnight every day."));
+ break;
+ case CYCLE_MODE_CUSTOM:
+ snprintf(buff, sizeof(buff), "%s %d %s",
+ _("The data usage info will be reset every"),
+ smd->wifi_limits.custom_mode_interval,
+ "days.");
+ break;
+ default:
+ break;
+ }
+ return strdup(buff);
+ }
+ return NULL;
+}
+
+static void _generate_list(SmartMgrData *ad, Evas_Object *genlist)
+{
+ Elm_Object_Item *info_item = NULL;
+ gl_start_date_item = NULL;
+
+ elm_genlist_item_append(genlist, &cycle_itc, ad, NULL,
+ ELM_GENLIST_ITEM_NONE, _cycle_item_click_cb, ad);
+ /* This item is only valid for cycles other than 'daily': */
+ if (CYCLE_MODE_DAILY != ad->wifi_limits.cycle_mode)
+ gl_start_date_item = elm_genlist_item_append(genlist, &start_date_itc,
+ ad, NULL, ELM_GENLIST_ITEM_NONE,
+ _start_date_item_click_cb, ad);
+ info_item = elm_genlist_item_append(genlist, &info_itc, ad, NULL,
+ ELM_GENLIST_ITEM_NONE, NULL, ad);
+ elm_genlist_item_select_mode_set(info_item, ELM_OBJECT_SELECT_MODE_NONE);
+}
--- /dev/null
+#include <Elementary.h>
+#include <system_settings.h>
+#include <stdlib.h>
+#include <setting-common/setting-common-data-type.h>
+
+#include "smartmanager-data.h"
+#include "smartmanager-data-main-view.h"
+#include "smartmanager-utils.h"
+
+static void _lang_changed(app_event_info_h event_info, void *data);
+static bool _create_app(void *data);
+static void _pause_app(void *user_data);
+static void _resume_app(void *user_data);
+static void _terminate_app(void *data);
+static void _app_controll(app_control_h app_control, void *user_data);
+static void _sim_state_change_cb(telephony_h handle, telephony_noti_e noti_id,
+ void *data, void *user_data);
+static void _count_available_sim_cards(SmartMgrData *ad);
+static bool _append_stats_list_item(Eina_List **list, char *app_id, long long data_usage_bytes);
+static void _clear_all_stat_lists(SmartMgrData *ad);
+static void _delete_stat_item(data_usage_app_item_t *item);
+
+static stc_callback_ret_e _stc_stats_info_cb(stc_error_e result,
+ stc_stats_info_h info, void *user_data);
+static stc_callback_ret_e _total_stats_cb(stc_error_e result,
+ stc_stats_info_h info, void *user_data);
+static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
+ stc_restriction_info_h info, void *user_data);
+
+static void _initialize_cycle(Data_Limits_T *limits);
+static void _read_all_stat_cycles(void);
+static void _set_stats_time_frame_from_cycle(Data_Limits_T *limits);
+
+static Eina_Bool _delayed_timer_cb(void *data);
+
+static SmartMgrData ad = {0,};
+
+static bool wifi_stats_checked = false;
+static bool sim_1_stats_checked = false;
+static bool sim_2_stats_checked = false;
+static bool wifi_total_stats_checked = false;
+static bool sim_1_total_stats_checked = false;
+static bool sim_2_total_stats_checked = false;
+static bool wifi_restrictions_checked = false;
+static bool sim_restrictions_checked = false;
+static bool all_stat_cycles_checked = false;
+static Ecore_Timer *periodic_update_timer = NULL;
+
+static void _lang_changed(app_event_info_h event_info, void *data)
+{
+ SETTING_TRACE_BEGIN;
+
+ char *locale = NULL;
+ system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
+ elm_language_set(locale);
+ free(locale);
+
+ SETTING_TRACE_END;
+}
+
+static Eina_Bool _delayed_timer_cb(void *data)
+{
+ data_usage_app_item_t *item = NULL;
+
+ if (!all_stat_cycles_checked) {
+ _read_all_stat_cycles();
+ all_stat_cycles_checked = true;
+ }
+
+ if (!sim_1_total_stats_checked) {
+ ad.sim_1_limits.total_data_used = 0;
+ sim_1_total_stats_checked = get_sim_total_stats(ad.stc,
+ _total_stats_cb, ad.subscriber_id_1,
+ ad.sim_1_limits.interval_from,
+ ad.sim_1_limits.interval_to);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (!sim_2_total_stats_checked) {
+ ad.sim_2_limits.total_data_used = 0;
+ sim_2_total_stats_checked = get_sim_total_stats(ad.stc,
+ _total_stats_cb, ad.subscriber_id_2,
+ ad.sim_2_limits.interval_from,
+ ad.sim_2_limits.interval_to);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (!wifi_total_stats_checked) {
+ ad.wifi_limits.total_data_used = 0;
+
+ wifi_total_stats_checked = get_wifi_total_stats(ad.stc, _total_stats_cb,
+ ad.wifi_limits.interval_from,
+ ad.wifi_limits.interval_to);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (!sim_1_stats_checked) {
+ ad.main_view_update_type = MV_UPDATE_CLEAR_ALL_SIM_1_APPS;
+ setting_view_update(ad.main_view, &ad);
+ EINA_LIST_FREE(ad.sim_1_apps, item)
+ _delete_stat_item(item);
+ sim_1_stats_checked = get_sim_apps_list(ad.stc,
+ _stc_stats_info_cb, ad.subscriber_id_1,
+ ad.sim_1_limits.interval_from,
+ ad.sim_1_limits.interval_to);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (!sim_2_stats_checked) {
+ ad.main_view_update_type = MV_UPDATE_CLEAR_ALL_SIM_2_APPS;
+ setting_view_update(ad.main_view, &ad);
+ EINA_LIST_FREE(ad.sim_2_apps, item)
+ _delete_stat_item(item);
+ sim_2_stats_checked = get_sim_apps_list(ad.stc,
+ _stc_stats_info_cb, ad.subscriber_id_2,
+ ad.sim_2_limits.interval_from,
+ ad.sim_2_limits.interval_to);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (!wifi_stats_checked) {
+ ad.main_view_update_type = MV_UPDATE_CLEAR_ALL_WIFI_APPS;
+ setting_view_update(ad.main_view, &ad);
+ EINA_LIST_FREE(ad.wifi_apps, item)
+ _delete_stat_item(item);
+
+ wifi_stats_checked = get_wifi_apps_list(ad.stc, _stc_stats_info_cb,
+ ad.wifi_limits.interval_from,
+ ad.wifi_limits.interval_to);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (!sim_restrictions_checked) {
+ ad.sim_1_limits.limit = 0;
+ ad.sim_1_limits.warning = 0;
+ ad.sim_2_limits.limit = 0;
+ ad.sim_2_limits.warning = 0;
+ sim_restrictions_checked = get_sim_restrictions(ad.stc,
+ _get_restrictions_cb);
+
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ if (!wifi_restrictions_checked) {
+ ad.wifi_limits.limit = 0;
+ ad.wifi_limits.warning = 0;
+ wifi_restrictions_checked = get_wifi_restrictions(ad.stc,
+ _get_restrictions_cb);
+ return ECORE_CALLBACK_RENEW;
+ }
+
+ periodic_update_timer = NULL;
+ return ECORE_CALLBACK_CANCEL;
+}
+
+void smartmanager_stc_get_all_data(void)
+{
+ if (periodic_update_timer)
+ return;
+
+ wifi_stats_checked = false;
+ sim_1_stats_checked = false;
+ sim_2_stats_checked = false;
+ wifi_total_stats_checked = false;
+ sim_1_total_stats_checked = false;
+ sim_2_total_stats_checked = false;
+ wifi_restrictions_checked = false;
+ sim_restrictions_checked = false;
+ all_stat_cycles_checked = false;
+
+ periodic_update_timer = ecore_timer_add(0.2, _delayed_timer_cb, NULL);
+ if (!periodic_update_timer)
+ SETTING_TRACE_ERROR("delayed_timer creation failure");
+}
+
+void smartmanager_stc_get_sim_total_and_apps_data(void)
+{
+ if (periodic_update_timer)
+ return;
+
+ /*sim_stats_checked = false; TODO: figure out way to update without
+ * blinking*/
+ sim_1_total_stats_checked = false;
+
+ periodic_update_timer = ecore_timer_add(0.2, _delayed_timer_cb, NULL);
+ if (!periodic_update_timer)
+ SETTING_TRACE_ERROR("delayed_timer creation failure");
+}
+
+void smartmanager_stc_get_wifi_total_and_apps_data(void)
+{
+ if (periodic_update_timer)
+ return;
+
+ /*wifi_stats_checked = false; TODO: figure out way to update without
+ * blinking*/
+ wifi_total_stats_checked = false;
+
+ periodic_update_timer = ecore_timer_add(0.2, _delayed_timer_cb, NULL);
+ if (!periodic_update_timer)
+ SETTING_TRACE_ERROR("delayed_timer creation failure");
+}
+
+static bool _create_app(void *data)
+{
+ SETTING_TRACE_BEGIN;
+
+ SmartMgrData *ad = data;
+ int ret = TELEPHONY_ERROR_NONE;
+
+ SETTING_TRACE("==========================================================");
+ SETTING_TRACE("==========================================================");
+ SETTING_TRACE("==========================================================");
+ SETTING_TRACE("BUILD: %s %s", __DATE__, __TIME__);
+ SETTING_TRACE("==========================================================");
+ SETTING_TRACE("==========================================================");
+ SETTING_TRACE("==========================================================");
+
+ if (!ad)
+ return false;
+
+ SETTING_TRACE("_create_app");
+
+ bindtextdomain(SETTING_PACKAGE, SETTING_LOCALEDIR);
+
+ ret = telephony_init(&ad->telephony_handles);
+ if (TELEPHONY_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("telephony init error %s", get_error_message(ret));
+ } else {
+ SETTING_TRACE_DEBUG("telephony init %s", get_error_message(ret));
+ ret = telephony_set_noti_cb(ad->telephony_handles.handle[0],
+ TELEPHONY_NOTI_SIM_STATUS, _sim_state_change_cb, ad);
+ SETTING_TRACE_DEBUG("telephony_set_noti_cb[0] %s",
+ get_error_message(ret));
+ if (get_subscriber_id_from_telephony_handle(
+ ad->telephony_handles.handle[0], &ad->subscriber_id_1)
+ )
+ SETTING_TRACE_DEBUG("SUBSCRIBER_ID_1 %s", ad->subscriber_id_1);
+
+ if (ad->telephony_handles.count > 1) {
+ ret = telephony_set_noti_cb(ad->telephony_handles.handle[1],
+ TELEPHONY_NOTI_SIM_STATUS, _sim_state_change_cb, ad);
+ SETTING_TRACE_DEBUG("telephony_set_noti_cb[1] %s",
+ get_error_message(ret));
+ if (get_subscriber_id_from_telephony_handle(
+ ad->telephony_handles.handle[1], &ad->subscriber_id_2)
+ )
+ SETTING_TRACE_DEBUG("SUBSCRIBER_ID_2 %s", ad->subscriber_id_2);
+ }
+ _count_available_sim_cards(ad);
+ }
+
+ _read_all_stat_cycles();
+
+ ret = stc_initialize(&ad->stc);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_initialize() error: %s", get_error_message(ret));
+ return false;
+ }
+
+ SETTING_TRACE("STC INITIALIZED");
+
+ init_main_view(ad);
+ setting_view_node_table_intialize();
+ setting_view_node_table_register(ad->main_view, NULL);
+ setting_view_create(ad->main_view, ad);
+ setting_view_node_set_cur_view(ad->main_view);
+
+ ad->main_view_update_type = MV_UPDATE_CLEAR_ALL_WIFI_APPS;
+ setting_view_update(ad->main_view, ad);
+ ad->main_view_update_type = MV_UPDATE_CLEAR_ALL_SIM_1_APPS;
+ setting_view_update(ad->main_view, ad);
+ ad->main_view_update_type = MV_UPDATE_CLEAR_ALL_SIM_2_APPS;
+ setting_view_update(ad->main_view, ad);
+
+ SETTING_TRACE_END;
+ return true;
+}
+
+static void _pause_app(void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ ecore_timer_del(periodic_update_timer);
+ periodic_update_timer = NULL;
+ SETTING_TRACE_END;
+}
+
+static void _resume_app(void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ smartmanager_stc_get_all_data();
+ SETTING_TRACE_END;
+}
+
+static void _terminate_app(void *data)
+{
+ SETTING_TRACE_BEGIN;
+ SmartMgrData *ad = data;
+
+ if (!ad)
+ return;
+
+ setting_view_destroy(ad->main_view, ad);
+ stc_deinitialize(ad->stc);
+ telephony_deinit(&ad->telephony_handles);
+ _clear_all_stat_lists(ad);
+ free(ad->subscriber_id_1);
+ free(ad->subscriber_id_2);
+
+ SETTING_TRACE_END;
+}
+
+static void _app_controll(app_control_h app_control, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ SETTING_TRACE_END;
+}
+
+static void _sim_state_change_cb(telephony_h handle, telephony_noti_e noti_id,
+ void *data, void *user_data)
+{
+ SETTING_TRACE_BEGIN;
+ SmartMgrData *ad = data;
+
+ if (!ad)
+ return;
+
+ _count_available_sim_cards(ad);
+
+ free(ad->subscriber_id_1);
+ free(ad->subscriber_id_2);
+ ad->subscriber_id_1 = ad->subscriber_id_2 = NULL;
+
+ if (get_subscriber_id_from_telephony_handle(
+ ad->telephony_handles.handle[0],
+ &ad->subscriber_id_1)
+ )
+ SETTING_TRACE_DEBUG("SUBSCRIBER_ID_1 %s", ad->subscriber_id_1);
+
+ if (ad->num_sim_cards_available > 1)
+ if (get_subscriber_id_from_telephony_handle(
+ ad->telephony_handles.handle[1],
+ &ad->subscriber_id_2)
+ )
+ SETTING_TRACE_DEBUG("SUBSCRIBER_ID_2 %s", ad->subscriber_id_2);
+
+ if (setting_view_node_get_cur_view() == ad->main_view) {
+ SETTING_TRACE_DEBUG("_sim_state_change_cb: updating main view");
+ ad->main_view_update_type = MV_UPDATE_SIM_STATE_CHANGED;
+ setting_view_update(ad->main_view, ad);
+ } else {
+ SETTING_TRACE_DEBUG("_sim_state_change_cb: going back to main view");
+ setting_view_change(setting_view_node_get_cur_view(), ad->main_view,
+ ad);
+ }
+
+ SETTING_TRACE_END;
+}
+
+static void _count_available_sim_cards(SmartMgrData *ad)
+{
+ SETTING_TRACE_BEGIN;
+
+ telephony_sim_state_e sim_state = TELEPHONY_SIM_STATE_UNKNOWN;
+ int ret = TELEPHONY_ERROR_NONE;
+ ad->num_sim_cards_available = 0;
+
+ SETTING_TRACE_DEBUG("Number of available SIM card SLOTS: %d",
+ ad->telephony_handles.count);
+
+ if (ad->telephony_handles.count > 0)
+ ret = telephony_sim_get_state(ad->telephony_handles.handle[0],
+ &sim_state);
+ SETTING_TRACE_DEBUG("get SIM1 state: %s state: %d",
+ get_error_message(ret), sim_state);
+
+ if (TELEPHONY_ERROR_NONE == ret &&
+ TELEPHONY_SIM_STATE_AVAILABLE == sim_state)
+ ad->num_sim_cards_available++;
+
+ sim_state = TELEPHONY_SIM_STATE_UNKNOWN;
+
+ if (ad->telephony_handles.count > 1)
+ ret = telephony_sim_get_state(ad->telephony_handles.handle[1],
+ &sim_state);
+ SETTING_TRACE_DEBUG("get SIM2 state: %s state: %d",
+ get_error_message(ret), sim_state);
+
+ if (TELEPHONY_ERROR_NONE == ret &&
+ TELEPHONY_SIM_STATE_AVAILABLE == sim_state)
+ ad->num_sim_cards_available++;
+ SETTING_TRACE_DEBUG("Number of available SIM cards: %d",
+ ad->num_sim_cards_available);
+
+ SETTING_TRACE_END;
+}
+
+int main(int argc, char *argv[])
+{
+ app_event_handler_h handlers[5] = {NULL, };
+ ui_app_lifecycle_callback_s ops = {
+ .create = _create_app,
+ .pause = _pause_app,
+ .resume = _resume_app,
+ .terminate = _terminate_app,
+ .app_control = _app_controll
+ };
+
+ ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY],
+ APP_EVENT_LOW_MEMORY, NULL, NULL);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY],
+ APP_EVENT_LOW_BATTERY, NULL, NULL);
+ ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED],
+ APP_EVENT_LANGUAGE_CHANGED, _lang_changed, NULL);
+ ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED],
+ APP_EVENT_REGION_FORMAT_CHANGED, NULL, NULL);
+ ui_app_add_event_handler(
+ &handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED],
+ APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL);
+
+ return ui_app_main(argc, argv, &ops, &ad);
+}
+
+static bool _append_stats_list_item(Eina_List **list, char *app_id, long long data_usage_bytes)
+{
+ SETTING_TRACE_BEGIN;
+ data_usage_app_item_t *dua = calloc(1, sizeof(data_usage_app_item_t));
+ app_info_h app_info = NULL;
+
+ if (!dua)
+ return false;
+
+ int ret = app_info_create(app_id, &app_info);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ SETTING_TRACE_ERROR("app_info_create() for %s error: %s",
+ app_id, get_error_message(ret));
+ _delete_stat_item(dua);
+ return false;
+ }
+
+ dua->ad = &ad;
+ dua->appid = strdup(app_id);
+ dua->data_usage_bytes = data_usage_bytes;
+
+ ret = app_info_get_package(app_info, &dua->pkgid);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ SETTING_TRACE_ERROR("app_info_get_package() error: %s", get_error_message(ret));
+ _delete_stat_item(dua);
+ return false;
+ }
+
+ ret = app_info_get_label(app_info, &dua->label);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ SETTING_TRACE_ERROR("app_info_get_label() error: %s", get_error_message(ret));
+ _delete_stat_item(dua);
+ return false;
+ }
+
+ ret = app_info_get_icon(app_info, &dua->icon);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ SETTING_TRACE_ERROR("app_info_get_package() error: %s", get_error_message(ret));
+ _delete_stat_item(dua);
+ return false;
+ }
+
+ *list = eina_list_append(*list, dua);
+
+ SETTING_TRACE_END;
+
+ return true;
+}
+
+static void _clear_all_stat_lists(SmartMgrData *ad)
+{
+ data_usage_app_item_t *item = NULL;
+
+ EINA_LIST_FREE(ad->sim_1_apps, item)
+ _delete_stat_item(item);
+ EINA_LIST_FREE(ad->sim_2_apps, item)
+ _delete_stat_item(item);
+ EINA_LIST_FREE(ad->wifi_apps, item)
+ _delete_stat_item(item);
+}
+
+static void _delete_stat_item(data_usage_app_item_t *item)
+{
+ free(item->appid);
+ free(item->pkgid);
+ free(item->icon);
+ free(item->label);
+ free(item);
+}
+
+static stc_callback_ret_e _stc_stats_info_cb(stc_error_e result,
+ stc_stats_info_h info, void *user_data)
+{
+ char *app_id = NULL;
+ char *subscriber_id = NULL;
+ const char *subscriber_id_to_look_for = user_data;
+ int64_t incoming = 0;
+ int64_t outgoing = 0;
+ stc_iface_type_e iface = STC_IFACE_UNKNOWN;
+
+ SETTING_TRACE_DEBUG("per app cb, looking for subscriber id: %s",
+ subscriber_id_to_look_for);
+
+ if (STC_ERROR_NONE != result) {
+ SETTING_TRACE_ERROR("Error in callback: %s", get_error_message(result));
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ int ret = stc_stats_info_get_app_id(info, &app_id);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_stats_info_get_app_id() error: %s",
+ get_error_message(ret));
+ return STC_CALLBACK_CONTINUE;
+ }
+ SETTING_TRACE_DEBUG("App name: %s", app_id);
+
+ ret = stc_stats_info_get_counter(info, &incoming, &outgoing);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_stats_info_get_counter() error: %s",
+ get_error_message(ret));
+ free(app_id);
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ ret = stc_stats_info_get_iface_type(info, &iface);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_stats_info_get_iface_type() error: %s",
+ get_error_message(ret));
+ free(app_id);
+ return STC_CALLBACK_CONTINUE;
+ }
+ SETTING_TRACE_DEBUG("Obtained iface: %d", iface);
+
+ if (iface == STC_IFACE_WIFI) {
+ if (_append_stats_list_item(&ad.wifi_apps, app_id, incoming + outgoing)
+ ) {
+ ad.main_view_update_type = MV_UPDATE_APPEND_WIFI_APP;
+ setting_view_update(ad.main_view, &ad);
+ }
+ }
+ if (iface == STC_IFACE_DATACALL) {
+ ret = stc_stats_info_get_subscriber_id(info, &subscriber_id);
+ if (STC_ERROR_NONE == ret &&
+ compare_subscriber_ids(subscriber_id,
+ subscriber_id_to_look_for)
+ ) {
+ SETTING_TRACE_DEBUG("Obtained subscriber ID: %s", subscriber_id);
+ if (compare_subscriber_ids(ad.subscriber_id_1, subscriber_id))
+ if (_append_stats_list_item(&ad.sim_1_apps, app_id, incoming + outgoing)) {
+
+ ad.main_view_update_type = MV_UPDATE_APPEND_SIM_1_APP;
+ setting_view_update(ad.main_view, &ad);
+ }
+
+ if (compare_subscriber_ids(ad.subscriber_id_2, subscriber_id))
+ if (_append_stats_list_item(&ad.sim_2_apps, app_id, incoming + outgoing)) {
+ ad.main_view_update_type = MV_UPDATE_APPEND_SIM_2_APP;
+ setting_view_update(ad.main_view, &ad);
+ }
+ } else {
+ SETTING_TRACE_ERROR("stc_stats_info_get_subscriber_id() error:"\
+ " %s , subscriber id: %s , subscriber id to look for: %s",
+ get_error_message(ret),
+ subscriber_id,
+ subscriber_id_to_look_for);
+ }
+ free(subscriber_id);
+ }
+
+ free(app_id);
+ return STC_CALLBACK_CONTINUE;
+}
+
+static stc_callback_ret_e _total_stats_cb(stc_error_e result,
+ stc_stats_info_h info, void *user_data)
+{
+ int64_t incoming = 0;
+ int64_t outgoing = 0;
+ char *subscriber_id = NULL;
+ const char *subscriber_id_to_look_for = user_data;
+ int ret = STC_ERROR_NONE;
+ stc_iface_type_e iface_type = STC_IFACE_UNKNOWN;
+
+ SETTING_TRACE_DEBUG("total stats cb, looking for subscriber id: %s",
+ subscriber_id_to_look_for);
+
+ if (STC_ERROR_NONE != result) {
+ SETTING_TRACE_ERROR("Error in cb: %s", get_error_message(result));
+ return STC_CALLBACK_CANCEL;
+ }
+
+ ret = stc_stats_info_get_iface_type(info, &iface_type);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("get interface error: %s", get_error_message(ret));
+ return STC_CALLBACK_CANCEL;
+ }
+ SETTING_TRACE_DEBUG("Obtained iface: %d", iface_type);
+ ret = stc_stats_info_get_counter(info, &incoming, &outgoing);
+
+ if (STC_ERROR_NONE == ret) {
+ if (iface_type == STC_IFACE_DATACALL) {
+ ret = stc_stats_info_get_subscriber_id(info, &subscriber_id);
+
+ if (STC_ERROR_NONE == ret &&
+ compare_subscriber_ids(subscriber_id,
+ subscriber_id_to_look_for)
+ ) {
+
+ SETTING_TRACE_DEBUG("Obtained SUBSCRIBER ID: %s",
+ subscriber_id);
+ if (compare_subscriber_ids(ad.subscriber_id_1, subscriber_id)) {
+ ad.main_view_update_type = MV_UPDATE_SIM_1_TOTAL_DATA_USAGE;
+ ad.sim_1_limits.total_data_used = incoming + outgoing;
+ SETTING_TRACE("SIM 1 total in: %lld out: %lld", incoming, outgoing);
+ }
+ if (compare_subscriber_ids(ad.subscriber_id_2, subscriber_id)) {
+ ad.main_view_update_type = MV_UPDATE_SIM_2_TOTAL_DATA_USAGE;
+ ad.sim_2_limits.total_data_used = incoming + outgoing;
+ SETTING_TRACE("SIM 2 total in: %lld out: %lld", incoming, outgoing);
+ }
+ } else {
+ SETTING_TRACE_ERROR("stc_stats_info_get_subscriber_id() error: %s",
+ get_error_message(ret));
+ }
+ free(subscriber_id);
+ }
+ if (iface_type == STC_IFACE_WIFI) {
+ ad.main_view_update_type = MV_UPDATE_WIFI_TOTAL_DATA_USAGE;
+ ad.wifi_limits.total_data_used = incoming + outgoing;
+ SETTING_TRACE("WIFI total in: %lld out: %lld", incoming, outgoing);
+ }
+ setting_view_update(ad.main_view, &ad);
+ } else {
+ SETTING_TRACE_ERROR("get counter error: %s", get_error_message(ret));
+ return STC_CALLBACK_CANCEL;
+ }
+ return STC_CALLBACK_CONTINUE;
+}
+
+static stc_callback_ret_e _get_restrictions_cb(stc_error_e result,
+ stc_restriction_info_h info, void *user_data)
+{
+ int ret = STC_ERROR_NONE;
+ char *app_id = NULL;
+ char *subscriber_id = NULL;
+ stc_iface_type_e iface_type = STC_IFACE_UNKNOWN;
+ stc_restriction_status_e status = STC_RESTRICTION_UNKNOWN;
+
+ SETTING_TRACE_DEBUG("restriction cb:");
+ if (STC_ERROR_NONE != result) {
+ SETTING_TRACE_ERROR("_get_restrictions_cb error: %s",
+ get_error_message(result));
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ (void)stc_restriction_info_get_app_id(info, &app_id);
+ if (!app_id ||
+ (strcmp("TOTAL_DATACALL", app_id) && strcmp("TOTAL_WIFI", app_id))) {
+ free(app_id);
+ return STC_CALLBACK_CONTINUE;
+ }
+ SETTING_TRACE_DEBUG("Obtaining restrictions for: %s", app_id);
+ free(app_id);
+
+ ret = stc_restriction_info_get_status(info, &status);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("stc_restriction_info_get_status error: %s",
+ get_error_message(ret));
+ return STC_CALLBACK_CONTINUE;
+ }
+
+ (void)stc_restriction_info_get_iface_type(info, &iface_type);
+ SETTING_TRACE_DEBUG("Obtained iface: %d", iface_type);
+ if (iface_type == STC_IFACE_DATACALL) {
+
+ ret = stc_restriction_info_get_subscriber_id(info, &subscriber_id);
+
+ if (STC_ERROR_NONE == ret) {
+ SETTING_TRACE_DEBUG("Obtained Subscriber ID: %s", subscriber_id);
+ if (compare_subscriber_ids(ad.subscriber_id_1, subscriber_id)) {
+ (void)stc_restriction_info_get_limit(info,
+ &(ad.sim_1_limits.limit));
+ (void)stc_restriction_info_get_warning_limit(info,
+ &(ad.sim_1_limits.warning));
+ ad.main_view_update_type = MV_UPDATE_SIM_1_WARN_N_LIMIT;
+ }
+ if (compare_subscriber_ids(ad.subscriber_id_2, subscriber_id)) {
+ (void)stc_restriction_info_get_limit(info,
+ &(ad.sim_2_limits.limit));
+ (void)stc_restriction_info_get_warning_limit(info,
+ &(ad.sim_2_limits.warning));
+ ad.main_view_update_type = MV_UPDATE_SIM_2_WARN_N_LIMIT;
+ }
+ setting_view_update(ad.main_view, &ad);
+ } else {
+ SETTING_TRACE_ERROR("stc_stats_info_get_subscriber_id() error: %s",
+ get_error_message(ret));
+ }
+ free(subscriber_id);
+ }
+
+ if (iface_type == STC_IFACE_WIFI) {
+ (void)stc_restriction_info_get_limit(info,
+ &(ad.wifi_limits.limit));
+ (void)stc_restriction_info_get_warning_limit(info,
+ &(ad.wifi_limits.warning));
+ ad.main_view_update_type = MV_UPDATE_WIFI_WARN_N_LIMIT;
+ setting_view_update(ad.main_view, &ad);
+ }
+
+ return STC_CALLBACK_CONTINUE;
+}
+
+static void _initialize_cycle(Data_Limits_T *limits)
+{
+ limits->custom_mode_interval = 1;
+ limits->cycle_mode = CYCLE_MODE_MONTHLY;
+ limits->cycle_start = 1;
+}
+
+static void _read_all_stat_cycles(void)
+{
+ _initialize_cycle(&ad.sim_1_limits);
+ _initialize_cycle(&ad.sim_2_limits);
+ _initialize_cycle(&ad.wifi_limits);
+
+ if (!read_sim_1_cycle_mode((int *)&(ad.sim_1_limits.cycle_mode)))
+ SETTING_TRACE_ERROR("sim1 cycle mode read error");
+
+ read_sim_1_cycle_start(&(ad.sim_1_limits.cycle_start));
+ read_sim_1_cycle_interval(&(ad.sim_1_limits.custom_mode_interval));
+
+ if (!read_sim_2_cycle_mode((int *)&(ad.sim_2_limits.cycle_mode)))
+ SETTING_TRACE_ERROR("sim2 cycle mode read error");
+
+ read_sim_2_cycle_start(&(ad.sim_2_limits.cycle_start));
+ read_sim_2_cycle_interval(&(ad.sim_2_limits.custom_mode_interval));
+
+ if (!read_wifi_cycle_mode((int *)&(ad.wifi_limits.cycle_mode)))
+ SETTING_TRACE_ERROR("wifi cycle mode read error");
+
+ read_wifi_cycle_start(&(ad.wifi_limits.cycle_start));
+ read_wifi_cycle_interval(&(ad.wifi_limits.custom_mode_interval));
+
+ _set_stats_time_frame_from_cycle(&ad.sim_1_limits);
+ _set_stats_time_frame_from_cycle(&ad.sim_2_limits);
+ _set_stats_time_frame_from_cycle(&ad.wifi_limits);
+}
+
+static void _set_stats_time_frame_from_cycle(Data_Limits_T *limits)
+{
+ time_t now = 0;
+ long long custom_cycles_reminder = 0;
+ struct tm tm_past_delta = {0,};
+ struct tm tm_future_delta = {0,};
+ time(&now);
+ struct tm *tm_now = localtime(&now);
+ tm_now->tm_sec = 1;
+ tm_now->tm_min = 0;
+ tm_now->tm_hour = 0;
+ tm_past_delta = *tm_now;
+ tm_future_delta = *tm_now;
+
+ switch (limits->cycle_mode) {
+ case CYCLE_MODE_MONTHLY:
+ tm_past_delta.tm_mday = limits->cycle_start;
+ if (tm_now->tm_mday >= limits->cycle_start) {
+ tm_future_delta.tm_mon++;
+ tm_future_delta.tm_sec = 0;
+ tm_future_delta.tm_min = 0;
+ tm_future_delta.tm_hour = 0;
+ tm_future_delta.tm_mday = limits->cycle_start + 1;
+ } else {
+ tm_past_delta.tm_mon--;
+ tm_future_delta.tm_mday = limits->cycle_start;
+ }
+ break;
+ case CYCLE_MODE_WEEKLY:
+ tm_now->tm_wday--;
+ if (tm_now->tm_wday < 0)
+ tm_now->tm_wday = 6;
+ if (tm_now->tm_wday >= limits->cycle_start) {
+ tm_past_delta.tm_mday -= (tm_now->tm_wday + 1 - limits->cycle_start);
+ tm_future_delta.tm_mday += (7 + limits->cycle_start - tm_now->tm_wday);
+ } else {
+ tm_past_delta.tm_mday -= (7 + tm_now->tm_wday - limits->cycle_start);
+ tm_future_delta.tm_mday += (limits->cycle_start - tm_now->tm_wday);
+ }
+ break;
+ case CYCLE_MODE_DAILY:
+ tm_future_delta.tm_sec = 0;
+ tm_future_delta.tm_min = 0;
+ tm_future_delta.tm_hour = 0;
+ tm_future_delta.tm_mday++;
+ break;
+ case CYCLE_MODE_CUSTOM:
+ if (limits->custom_mode_interval <= 0) {
+ SETTING_TRACE_ERROR("Error: custom mode interval is %d",
+ limits->custom_mode_interval);
+ return;
+ }
+ custom_cycles_reminder = (now - (time_t)limits->cycle_start) %
+ (limits->custom_mode_interval * 24 * 60 * 60);
+ limits->interval_from = now - custom_cycles_reminder;
+ limits->interval_to = limits->interval_from +
+ (((time_t)limits->custom_mode_interval) * 24 * 60 * 60);
+ return;
+ default:
+ return;
+ }
+
+ limits->interval_from = mktime(&tm_past_delta);
+ limits->interval_to = mktime(&tm_future_delta);
+}
--- /dev/null
+#include <stdio.h>
+#include <stdlib.h>
+#include <app_preference.h>
+#include <setting-common/setting-common-general-func.h>
+#include <setting-common/setting-debug.h>
+
+#include "smartmanager-utils.h"
+
+#define TH_POSTFIX_IDX 0
+
+static char *number_postfixes[] = {
+ "th", "st", "nd", "rd"
+};
+
+static bool _create_stats_list(stc_h stc, stc_iface_type_e iface,
+ stc_stats_info_cb stats_cb,
+ void *cb_data, time_t t_from,
+ time_t t_to);
+static bool _get_total_stats(stc_h stc, stc_iface_type_e iface_type,
+ stc_stats_info_cb stats_cb, void *cb_data,
+ time_t t_from, time_t t_to);
+static bool _get_restrictions(stc_h stc, stc_iface_type_e iface_type,
+ stc_restriction_info_cb restrictions_cb,
+ void *restriction_info_cb_data);
+
+int get_days_in_current_month()
+{
+ time_t now = 0;
+ struct tm now_tm = {0};
+ time(&now);
+ now_tm = *localtime(&now);
+ now_tm.tm_mon += 1;
+ now_tm.tm_mday = 0;
+ mktime(&now_tm);
+
+ return now_tm.tm_mday;
+}
+
+void get_data_amount_str(const char *prefix, int64_t num_bytes, char *txt_out,
+ int len_max)
+{
+ float amount = 0.0;
+
+ if (num_bytes < 1024) {
+ snprintf(txt_out, len_max, "%s%lldB", prefix, num_bytes);
+ return;
+ }
+ /*KB:*/
+ amount = ((float)num_bytes) / 1024.0;
+ if (amount >= 1024) {
+ /*MB:*/
+ if ((amount / 1024.0) >= 1024) {
+ amount = amount / 1024.0;
+ snprintf(txt_out, len_max, "%s%0.2fGB", prefix, (amount / 1024.0));
+ return;
+ } else {
+ snprintf(txt_out, len_max, "%s%0.2fMB", prefix, (amount / 1024.0));
+ return;
+ }
+ } else {
+ snprintf(txt_out, len_max, "%s%0.2fKB", prefix, amount);
+ }
+}
+
+void get_data_int_amount_str(int64_t num_bytes, char *int_amount_str,
+ int len_max)
+{
+ int amount = 0;
+
+ if (num_bytes < 1024) {
+ snprintf(int_amount_str, len_max, "%lld", num_bytes);
+ return;
+ }
+ /*KB:*/
+ amount = num_bytes / 1024;
+ if (amount >= 1024) {
+ /*MB:*/
+ if ((amount / 1024) >= 1024) {
+ amount = amount / 1024;
+ if (amount % 1024 == 0) {
+ snprintf(int_amount_str, len_max, "%d", (amount / 1024));
+ return;
+ } else {
+ snprintf(int_amount_str, len_max, "%d", (amount));
+ return;
+ }
+ } else {
+ snprintf(int_amount_str, len_max, "%d", (amount / 1024));
+ return;
+ }
+ } else {
+ snprintf(int_amount_str, len_max, "%d", amount);
+ }
+}
+
+void get_data_unit_str(int64_t num_bytes, char *unit_str, int len_max)
+{
+ int amount = 0;
+
+ if (num_bytes == 0) {
+ snprintf(unit_str, len_max, "MB");
+ return;
+ }
+ if (num_bytes < 1024) {
+ snprintf(unit_str, len_max, "B");
+ return;
+ }
+
+ /*KB:*/
+ amount = num_bytes / 1024;
+ if (amount >= 1024) {
+ /*MB:*/
+ if ((amount / 1024) >= 1024) {
+ amount = amount / 1024;
+ if (amount % 1024 == 0) {
+ snprintf(unit_str, len_max, "GB");
+ return;
+ } else {
+ snprintf(unit_str, len_max, "MB");
+ return;
+ }
+ } else {
+ snprintf(unit_str, len_max, "MB");
+ return;
+ }
+ } else {
+ snprintf(unit_str, len_max, "KB");
+ }
+}
+
+void create_number_with_postfix(int number, char *output, int max_len)
+{
+ int temp = number % 100;
+
+ if (temp >= 20)
+ temp = temp % 10;
+
+ if (temp < 4) {
+ snprintf(output, max_len, "%d%s", number, number_postfixes[temp]);
+ } else {
+ snprintf(output, max_len, "%d%s", number,
+ number_postfixes[TH_POSTFIX_IDX]);
+ }
+}
+
+bool get_sim_total_stats(stc_h stc, stc_stats_info_cb stats_cb,
+ const char *subscriber_id, time_t t_from, time_t t_to)
+{
+ return _get_total_stats(stc, STC_IFACE_DATACALL, stats_cb,
+ (void *)subscriber_id, t_from, t_to);
+}
+
+bool get_wifi_total_stats(stc_h stc, stc_stats_info_cb stats_cb, time_t t_from,
+ time_t t_to)
+{
+ return _get_total_stats(stc, STC_IFACE_WIFI, stats_cb, NULL, t_from, t_to);
+}
+
+bool get_sim_apps_list(stc_h stc, stc_stats_info_cb stats_cb,
+ const char *subscriber_id, time_t t_from, time_t t_to)
+{
+ return _create_stats_list(stc, STC_IFACE_DATACALL, stats_cb,
+ (void *)subscriber_id, t_from, t_to);
+}
+
+bool get_wifi_apps_list(stc_h stc, stc_stats_info_cb stats_cb, time_t t_from,
+ time_t t_to)
+{
+ return _create_stats_list(stc, STC_IFACE_WIFI, stats_cb,
+ NULL, t_from, t_to);
+}
+
+bool get_sim_restrictions(stc_h stc, stc_restriction_info_cb restrictions_cb)
+{
+ return _get_restrictions(stc, STC_IFACE_DATACALL, restrictions_cb, NULL);
+}
+
+bool get_wifi_restrictions(stc_h stc, stc_restriction_info_cb restrictions_cb)
+{
+ return _get_restrictions(stc, STC_IFACE_WIFI, restrictions_cb, NULL);
+}
+
+static bool _create_stats_list(stc_h stc, stc_iface_type_e iface,
+ stc_stats_info_cb stats_cb,
+ void *cb_data, time_t t_from,
+ time_t t_to)
+{
+ stc_stats_rule_h rule = NULL;
+
+ int ret = stc_stats_rule_create(stc, &rule);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_stats_rule_create() error: %s",
+ get_error_message(ret));
+ stc_stats_rule_destroy(rule);
+ return true;
+ }
+
+ ret = stc_stats_rule_set_time_interval(rule, t_from, t_to);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_stats_rule_set_time_interval() error: %s",
+ get_error_message(ret));
+ stc_stats_rule_destroy(rule);
+ return true;
+ }
+
+ ret = stc_stats_rule_set_iface_type(rule, iface);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_stats_rule_set_iface_type() error: %s",
+ get_error_message(ret));
+ stc_stats_rule_destroy(rule);
+ return true;
+ }
+
+ SETTING_TRACE_DEBUG("\033[1;33mObtaining per app data usage for ifce: %d",
+ iface);
+ ret = stc_foreach_stats(stc, rule, stats_cb, cb_data);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_get_stats() error: %s",
+ get_error_message(ret));
+ if (STC_ERROR_IN_PROGRESS == ret) {
+ stc_stats_rule_destroy(rule);
+ return false;
+ }
+ stc_stats_rule_destroy(rule);
+ return true;
+ }
+
+ stc_stats_rule_destroy(rule);
+
+ return true;
+}
+
+static bool _get_total_stats(stc_h stc, stc_iface_type_e iface_type,
+ stc_stats_info_cb stats_cb, void *cb_data,
+ time_t t_from, time_t t_to)
+{
+ stc_stats_rule_h rule = NULL;
+ int ret = STC_ERROR_NONE;
+
+ ret = stc_stats_rule_create(stc, &rule);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_stats_rule_create() error: %s",
+ get_error_message(ret));
+ return true;
+ }
+
+ ret = stc_stats_rule_set_time_interval(rule, t_from, t_to);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_stats_rule_set_time_interval() error: %s",
+ get_error_message(ret));
+ (void)stc_stats_rule_destroy(rule);
+ return true;
+ }
+
+ ret = stc_stats_rule_set_iface_type(rule, iface_type);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_stats_rule_set_iface_type() error: %s",
+ get_error_message(ret));
+ (void)stc_stats_rule_destroy(rule);
+ return true;
+ }
+
+ SETTING_TRACE_DEBUG("\033[1;34mObtaining total stats for ifce: %d",
+ iface_type);
+ ret = stc_get_total_stats(stc, rule, stats_cb, cb_data);
+ if (ret != STC_ERROR_NONE) {
+ SETTING_TRACE_ERROR("stc_get_total_stats() error: %s",
+ get_error_message(ret));
+ (void)stc_stats_rule_destroy(rule);
+ if (STC_ERROR_IN_PROGRESS == ret)
+ return false;
+ return true;
+ }
+
+ (void)stc_stats_rule_destroy(rule);
+
+ return true;
+}
+
+static bool _get_restrictions(stc_h stc, stc_iface_type_e iface_type,
+ stc_restriction_info_cb restrictions_cb,
+ void *restriction_info_cb_data)
+{
+ int ret = STC_ERROR_NONE;
+ stc_restriction_rule_h rule = NULL;
+
+ ret = stc_restriction_rule_create(stc, &rule);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("stc_restriction_rule_create() error: %s",
+ get_error_message(ret));
+ return true;
+ }
+
+ if (STC_IFACE_DATACALL == iface_type)
+ ret = stc_restriction_rule_set_app_id(rule, "TOTAL_DATACALL");
+ if (STC_IFACE_WIFI == iface_type)
+ ret = stc_restriction_rule_set_app_id(rule, "TOTAL_WIFI");
+
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("stc_restriction_rule_set_app_id() error: %s",
+ get_error_message(ret));
+ stc_restriction_rule_destroy(rule);
+ return true;
+ }
+
+ ret = stc_restriction_rule_set_iface_type(rule, iface_type);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("stc_restriction_rule_get_iface_type() error: %s",
+ get_error_message(ret));
+ stc_restriction_rule_destroy(rule);
+ return true;
+ }
+
+ SETTING_TRACE_DEBUG("\033[1;35mObtaining restrictions for ifce: %d",
+ iface_type);
+ ret = stc_foreach_restriction(stc, rule, restrictions_cb,
+ restriction_info_cb_data);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("SIM stc_foreach_restriction() error: %s",
+ get_error_message(ret));
+ (void)stc_restriction_rule_destroy(rule);
+ if (STC_ERROR_IN_PROGRESS == ret)
+ return false;
+ return true;
+ }
+ (void)stc_restriction_rule_destroy(rule);
+
+ return true;
+}
+
+bool get_subscriber_id_from_telephony_handle(telephony_h handle,
+ char **subscriber_id)
+{
+ int ret = TELEPHONY_ERROR_NONE;
+
+ ret = telephony_sim_get_subscriber_id(handle, subscriber_id);
+ if (TELEPHONY_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("telephony_sim_get_msin(%p) %s",
+ handle, get_error_message(ret));
+ return false;
+ }
+
+ return true;
+}
+
+bool compare_subscriber_ids(const char *id_a, const char *id_b)
+{
+ return (0 == safeStrNCmp(id_a, id_b, 128));
+}
+
+restrictions_result set_mobile_restriction_rule_parameters(
+ stc_restriction_rule_h rule,
+ const char *subscriber_id,
+ int64_t limit,
+ int64_t warning_limit)
+{
+ SETTING_TRACE_BEGIN;
+ int ret = STC_ERROR_NONE;
+
+ ret = stc_restriction_rule_set_app_id(rule, "TOTAL_DATACALL");
+ if (STC_ERROR_NONE != ret) {
+ (void)stc_restriction_rule_destroy(rule);
+ SETTING_TRACE_ERROR("stc_restriction_rule_set_app_id() error: %s",
+ get_error_message(ret));
+ return RESTRICTIONS_ERROR;
+ }
+
+ ret = stc_restriction_rule_set_iface_type(rule, STC_IFACE_DATACALL);
+ if (STC_ERROR_NONE != ret) {
+ (void)stc_restriction_rule_destroy(rule);
+ SETTING_TRACE_ERROR("stc_restriction_rule_set_iface_type() error: %s",
+ get_error_message(ret));
+ return RESTRICTIONS_ERROR;
+ }
+
+ ret = stc_restriction_rule_set_subscriber_id(rule, subscriber_id);
+ if (STC_ERROR_NONE != ret) {
+ (void)stc_restriction_rule_destroy(rule);
+ SETTING_TRACE_ERROR("stc_restriction_rule_set_subscriber_id() error:"\
+ "%s", get_error_message(ret));
+
+ return RESTRICTIONS_ERROR;
+ }
+
+ ret = stc_restriction_rule_set_limit(rule, limit);
+ if (STC_ERROR_NONE != ret) {
+ (void)stc_restriction_rule_destroy(rule);
+ SETTING_TRACE_ERROR("stc_restriction_rule_set_limit() error: %s",
+ get_error_message(ret));
+ return RESTRICTIONS_ERROR;
+ }
+
+ ret = stc_restriction_rule_set_warning_limit(rule, warning_limit);
+ if (STC_ERROR_NONE != ret) {
+ (void)stc_restriction_rule_destroy(rule);
+ SETTING_TRACE_ERROR(
+ "stc_restriction_rule_set_warning_limit() error: %s",
+ get_error_message(ret));
+ return RESTRICTIONS_ERROR;
+ }
+
+ SETTING_TRACE_END;
+ return RESTRICTIONS_OK;
+}
+
+restrictions_result set_mobile_limit_restrictions(stc_h stc_handle,
+ const char *subscriber_id, int64_t limit, int64_t warning_limit)
+{
+ SETTING_TRACE_BEGIN;
+ int ret = STC_ERROR_NONE;
+ stc_restriction_rule_h rule = NULL;
+ restrictions_result result = RESTRICTIONS_OK;
+
+ ret = stc_restriction_rule_create(stc_handle, &rule);
+ if (STC_ERROR_NONE != ret) {
+ SETTING_TRACE_ERROR("stc_restriction_rule_create() error: %s",
+ get_error_message(ret));
+ return RESTRICTIONS_ERROR;
+ }
+
+ result = set_mobile_restriction_rule_parameters(rule, subscriber_id, limit,
+ warning_limit);
+ if (RESTRICTIONS_OK != result) {
+ SETTING_TRACE_ERROR("set_restriction_rule_parameters() error");
+ return result;
+ }
+
+ ret = stc_set_restriction(stc_handle, rule);
+ if (STC_ERROR_NONE != ret) {
+ (void)stc_restriction_rule_destroy(rule);
+ SETTING_TRACE_ERROR("stc_set_restriction() error: %s",
+ get_error_message(ret));
+ return RESTRICTIONS_ERROR;
+ }
+
+ (void)stc_restriction_rule_destroy(rule);
+ SETTING_TRACE_END;
+ return RESTRICTIONS_OK;
+}
+
+bool unset_mobile_limit_restrictions(stc_h stc_handle,
+ stc_restriction_info_cb _get_and_unset_limit_restrictions_cb, void *data)
+{
+ return _get_restrictions(stc_handle, STC_IFACE_DATACALL,
+ _get_and_unset_limit_restrictions_cb, data);
+}
+
+static bool _read_int_value(const char *key, int *value)
+{
+ bool existing = false;
+ int res = preference_is_existing(key, &existing);
+ if (PREFERENCE_ERROR_NONE != res || !existing) {
+ SETTING_TRACE_ERROR("Preferences: checking if %s key exists %d," \
+ " err: %s", key, existing, get_error_message(res));
+ return false;
+ }
+ res = preference_get_int(key, value);
+ if (PREFERENCE_ERROR_NONE != res) {
+ SETTING_TRACE_ERROR("Preferences: reading %s key" \
+ " err: %s", key, get_error_message(res));
+ return false;
+ }
+ return true;
+}
+
+static bool _write_int_value(const char *key, int value)
+{
+ int res = preference_set_int(key, value);
+ SETTING_TRACE_DEBUG("Preferences: writing %s key %d value, result: %s",
+ key, value, get_error_message(res));
+ return (PREFERENCE_ERROR_NONE == res);
+}
+
+bool write_sim_1_cycle_start(int cycle_start_value)
+{
+ return _write_int_value("sim_1_cycle_start", cycle_start_value);
+}
+
+bool write_sim_1_cycle_interval(int cycle_interval_value)
+{
+ return _write_int_value("sim_1_cycle_interval", cycle_interval_value);
+}
+
+bool write_sim_1_cycle_mode(int cycle_mode)
+{
+ return _write_int_value("sim_1_cycle_mode", cycle_mode);
+}
+
+bool write_sim_2_cycle_start(int cycle_start_value)
+{
+ return _write_int_value("sim_2_cycle_start", cycle_start_value);
+}
+
+bool write_sim_2_cycle_interval(int cycle_interval_value)
+{
+ return _write_int_value("sim_2_cycle_interval", cycle_interval_value);
+}
+
+bool write_sim_2_cycle_mode(int cycle_mode)
+{
+ return _write_int_value("sim_2_cycle_mode", cycle_mode);
+}
+
+bool write_wifi_cycle_start(int cycle_start_value)
+{
+ return _write_int_value("wifi_cycle_start", cycle_start_value);
+}
+
+bool write_wifi_cycle_interval(int cycle_interval_value)
+{
+ return _write_int_value("wifi_cycle_interval", cycle_interval_value);
+}
+
+bool write_wifi_cycle_mode(int cycle_mode)
+{
+ return _write_int_value("wifi_cycle_mode", cycle_mode);
+}
+
+bool read_sim_1_cycle_start(int *cycle_start_value)
+{
+ return _read_int_value("sim_1_cycle_start", cycle_start_value);
+}
+
+bool read_sim_1_cycle_interval(int *cycle_interval_value)
+{
+ return _read_int_value("sim_1_cycle_interval", cycle_interval_value);
+}
+
+bool read_sim_1_cycle_mode(int *cycle_mode)
+{
+ return _read_int_value("sim_1_cycle_mode", cycle_mode);
+}
+
+bool read_sim_2_cycle_start(int *cycle_start_value)
+{
+ return _read_int_value("sim_2_cycle_start", cycle_start_value);
+}
+
+bool read_sim_2_cycle_interval(int *cycle_interval_value)
+{
+ return _read_int_value("sim_2_cycle_interval", cycle_interval_value);
+}
+
+bool read_sim_2_cycle_mode(int *cycle_mode)
+{
+ return _read_int_value("sim_2_cycle_mode", cycle_mode);
+}
+
+bool read_wifi_cycle_start(int *cycle_start_value)
+{
+ return _read_int_value("wifi_cycle_start", cycle_start_value);
+}
+
+bool read_wifi_cycle_interval(int *cycle_interval_value)
+{
+ return _read_int_value("wifi_cycle_interval", cycle_interval_value);
+}
+
+bool read_wifi_cycle_mode(int *cycle_mode)
+{
+ return _read_int_value("wifi_cycle_mode", cycle_mode);
+}
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="4.0" package="org.tizen.smartmanager-data" version="1.0.0">
+ <profile name="mobile" />
+ <ui-application appid="org.tizen.smartmanager-data" exec="smartmanager-data" type="capp" multiple="false" taskmanage="true" nodisplay="false" launch_mode="single">
+ <icon>smartmanager-data.png</icon>
+ <label>smartmanager-data</label>
+ </ui-application>
+</manifest>