Revert "Merge "[SystemInfo] Throwing NOT_SUPPORTED_ERR added" into tizen_3.0" 57/130857/1
authorPiotr Kosko <p.kosko@samsung.com>
Wed, 24 May 2017 07:28:31 +0000 (09:28 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Wed, 24 May 2017 07:34:17 +0000 (09:34 +0200)
This reverts commit 419840dd69b04b96c04d7e1eadc0b00638416d2b, reversing
changes made to 1bd2aeb95e97cded73f308ec47daaf845eb2ab07.

Change-Id: I1ce726dccc97afd5d5d2423e85a053db4bedbd50

42 files changed:
packaging/webapi-plugins.spec
src/alarm/alarm.gyp
src/alarm/alarm_api.js
src/alarm/alarm_instance.cc
src/alarm/alarm_manager.cc
src/alarm/alarm_manager.h
src/alarm/alarm_utils.cc
src/alarm/alarm_utils.h
src/application/application.gyp
src/application/application_api.js
src/application/application_instance.cc
src/application/application_instance.h
src/application/application_manager.cc
src/application/application_manager.h
src/bluetooth/bluetooth.gyp
src/common/common.gyp
src/convergence/convergence_instance.cc
src/convergence/convergence_remote_app_control_service.cc
src/convergence/convergence_service.cc
src/convergence/convergence_service.h
src/convergence/convergence_utils.cc
src/humanactivitymonitor/gesture_manager.cc [deleted file]
src/humanactivitymonitor/gesture_manager.h [deleted file]
src/humanactivitymonitor/humanactivitymonitor.gyp
src/humanactivitymonitor/humanactivitymonitor_api.js
src/humanactivitymonitor/humanactivitymonitor_instance.cc
src/humanactivitymonitor/humanactivitymonitor_instance.h
src/nfc/nfc.gyp
src/notification/notification.gyp
src/notification/notification_api.js
src/notification/notification_instance.cc
src/notification/notification_instance.h
src/notification/notification_manager.cc
src/notification/notification_manager.h
src/notification/status_notification.cc
src/notification/status_notification.h
src/preference/preference.gyp
src/push/push.gyp
src/systeminfo/systeminfo.gyp
src/systeminfo/systeminfo_api.js
src/systeminfo/systeminfo_device_capability.cc
src/systeminfo/systeminfo_properties_manager.cc

index 10d57c00f9690f30996c0a3515127c9bb5de8a9a..48dd7eea3e3754bede5889d511b832148975d64e 100644 (file)
@@ -1,5 +1,7 @@
 %bcond_with wayland
 
+%{!?profile:%define profile tv}
+
 %define _manifestdir %{TZ_SYS_RW_PACKAGES}
 %define _desktop_icondir %{TZ_SYS_SHARE}/icons/default/small
 
 %define crosswalk_extensions_path %{_libdir}/%{crosswalk_extensions}
 
 Name:       webapi-plugins
-Version:    1.84
+Version:    1.83
 Release:    0
 License:    Apache-2.0 and BSD-3-Clause and MIT
 Group:      Development/Libraries
 Summary:    Tizen Web APIs implemented
 Source0:    %{name}-%{version}.tar.gz
 
+%ifarch %{arm} aarch64
+# ARM
+%define tizen_is_emulator           0
+%else
+# I586
+%define tizen_is_emulator           1
+%endif
+
+%if "%{_repository}" == "arm64-wayland"
+# 64bit
+%define tizen_is_arm64           1
+%else
+# 32bit
+%define tizen_is_arm64           0
+%endif
+
 ####################################################################
 #       Common Profile : artik                                     #
 ####################################################################
-
-%define tizen_common_privilege_engine                        CYNARA
-
-%define tizen_common_feature_account_support                 0
-%define tizen_common_feature_alarm_support                   1
-%define tizen_common_feature_app_control_settings_support    1
-%define tizen_common_feature_application_support             1
-%define tizen_common_feature_archive_support                 0
-%define tizen_common_feature_badge_support                   0
-%define tizen_common_feature_bluetooth_support               1
-%define tizen_common_feature_bookmark_support                0
-%define tizen_common_feature_calendar_support                0
-%define tizen_common_feature_contact_support                 0
-%define tizen_common_feature_content_support                 1
-%define tizen_common_feature_datacontrol_support             0
-%define tizen_common_feature_datasync_support                0
-%define tizen_common_feature_download_support                1
-%define tizen_common_feature_exif_support                    1
-%define tizen_common_feature_feedback_support                0
-%define tizen_common_feature_filesystem_support              1
-%define tizen_common_feature_fm_radio_support                0
-%define tizen_common_feature_ham_support                     0
-%define tizen_common_feature_iotcon_support                  0
-%define tizen_common_feature_location_batch                  0
-%define tizen_common_feature_key_manager_support             0
-%define tizen_common_feature_media_controller_support        0
-%define tizen_common_feature_media_key_support               0
-%define tizen_common_feature_message_port_support            1
-%define tizen_common_feature_messaging_support               0
-%define tizen_common_feature_nfc_emulation_support           0
-%define tizen_common_feature_nfc_support                     0
-%define tizen_common_feature_notification_support            0
-%define tizen_common_feature_package_support                 1
-%define tizen_common_feature_player_util_support             0
-%define tizen_common_feature_power_support                   0
-%define tizen_common_feature_preference_support              0
-%define tizen_common_feature_push_support                    0
-%define tizen_common_feature_se_support                      0
-%define tizen_common_feature_sensor_support                  0
-%define tizen_common_feature_sound_support                   1
-%define tizen_common_feature_system_info_support             1
-%define tizen_common_feature_system_setting_support          0
-%define tizen_common_feature_telephony_support               0
-%define tizen_common_feature_time_support                    1
-%define tizen_common_feature_web_setting_support             0
-%define tizen_common_feature_widget_service_support          0
-%define tizen_common_feature_wi_fi_support                   1
-%define tizen_common_feature_inputdevice_support             0
-%define tizen_common_feature_callhistory_support             0
-%define tizen_common_feature_nbs_support                     0
-%define tizen_common_feature_tvinputdevice_support           0
-
+%if "%{?profile}" == "common"
+
+%define tizen_privilege_engine                        CYNARA
+
+%define tizen_feature_account_support                 0
+%define tizen_feature_alarm_support                   1
+%define tizen_feature_app_control_settings_support    1
+%define tizen_feature_application_support             1
+%define tizen_feature_archive_support                 0
+%define tizen_feature_badge_support                   0
+%define tizen_feature_bluetooth_support               1
+%define tizen_feature_bookmark_support                0
+%define tizen_feature_calendar_support                0
+%define tizen_feature_contact_support                 0
+%define tizen_feature_content_support                 1
+%define tizen_feature_datacontrol_support             0
+%define tizen_feature_datasync_support                0
+%define tizen_feature_download_support                1
+%define tizen_feature_exif_support                    1
+%define tizen_feature_feedback_support                0
+%define tizen_feature_filesystem_support              1
+%define tizen_feature_fm_radio_support                0
+%define tizen_feature_ham_support                     0
+%define tizen_feature_iotcon_support                  0
+%define tizen_feature_location_batch                  0
+%define tizen_feature_key_manager_support             0
+%define tizen_feature_media_controller_support        0
+%define tizen_feature_media_key_support               0
+%define tizen_feature_message_port_support            1
+%define tizen_feature_messaging_support               0
+%define tizen_feature_nfc_emulation_support           0
+%define tizen_feature_nfc_support                     0
+%define tizen_feature_notification_support            0
+%define tizen_feature_package_support                 1
+%define tizen_feature_player_util_support             0
+%define tizen_feature_power_support                   0
+%define tizen_feature_preference_support              0
+%define tizen_feature_push_support                    0
+%define tizen_feature_se_support                      0
+%define tizen_feature_sensor_support                  0
+%define tizen_feature_sound_support                   1
+%define tizen_feature_system_info_support             1
+%define tizen_feature_system_setting_support          0
+%define tizen_feature_telephony_support               0
+%define tizen_feature_time_support                    1
+%define tizen_feature_web_setting_support             0
+%define tizen_feature_widget_service_support          0
+%define tizen_feature_wi_fi_support                   1
+%define tizen_feature_inputdevice_support             0
+%define tizen_feature_callhistory_support             0
+%define tizen_feature_nbs_support                     0
+%define tizen_feature_tvinputdevice_support           0
+
+%endif # tizen_profile_common
 
 ####################################################################
 #       Mobile Profile :  TM1(32bit), Redwood(SM-Z910F), KIRAN(Z130H)          #
 #                         TM2(64bit)
 ####################################################################
+%if "%{?profile}" == "mobile"
+
+%define tizen_privilege_engine                        CYNARA
+
+%define tizen_feature_account_support                 1
+%define tizen_feature_alarm_support                   1
+%define tizen_feature_app_control_settings_support    1
+%define tizen_feature_application_support             1
+%define tizen_feature_archive_support                 1
+%define tizen_feature_badge_support                   1
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_bluetooth_support               0
+%else
+%define tizen_feature_bluetooth_support               1
+%endif
+%define tizen_feature_bookmark_support                1
+%define tizen_feature_calendar_support                1
+%define tizen_feature_contact_support                 1
+%define tizen_feature_content_support                 1
+%define tizen_feature_datacontrol_support             1
+%define tizen_feature_datasync_support                0
+%define tizen_feature_download_support                1
+%define tizen_feature_exif_support                    1
+%define tizen_feature_feedback_support                1
+%define tizen_feature_filesystem_support              1
 
-%define tizen_mobile_privilege_engine                        CYNARA
-
-%define tizen_mobile_feature_account_support                 1
-%define tizen_mobile_feature_alarm_support                   1
-%define tizen_mobile_feature_app_control_settings_support    1
-%define tizen_mobile_feature_application_support             1
-%define tizen_mobile_feature_archive_support                 1
-%define tizen_mobile_feature_badge_support                   1
-%define tizen_mobile_feature_bluetooth_support               1
-%define tizen_mobile_feature_bookmark_support                1
-%define tizen_mobile_feature_calendar_support                1
-%define tizen_mobile_feature_contact_support                 1
-%define tizen_mobile_feature_content_support                 1
-%define tizen_mobile_feature_datacontrol_support             1
-%define tizen_mobile_feature_datasync_support                0
-%define tizen_mobile_feature_download_support                1
-%define tizen_mobile_feature_exif_support                    1
-%define tizen_mobile_feature_feedback_support                1
-%define tizen_mobile_feature_filesystem_support              1
-
-%ifarch aarch64
-%define tizen_mobile_feature_fm_radio_support                0
+# FM radio feature
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_fm_radio_support                1
+%else
+%if 0%{?tizen_is_arm64}
+%define tizen_feature_fm_radio_support                0
 %else
-%define tizen_mobile_feature_fm_radio_support                1
+%define tizen_feature_fm_radio_support                1
+%endif
 %endif
 
-%define tizen_mobile_feature_ham_support                     0
-
-%define tizen_mobile_feature_iotcon_support                  1
-%define tizen_mobile_feature_location_batch                  0
-%define tizen_mobile_feature_key_manager_support             1
-%define tizen_mobile_feature_media_controller_support        1
-
-%define tizen_mobile_feature_media_key_support               1
-
-%define tizen_mobile_feature_message_port_support            1
-%define tizen_mobile_feature_messaging_support               1
-
-%define tizen_mobile_feature_nfc_emulation_support           0
-%define tizen_mobile_feature_nfc_support                     0
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_ham_support                     1
+%else
+%define tizen_feature_ham_support                     0
+%endif
+%define tizen_feature_iotcon_support                  1
+%define tizen_feature_location_batch                  0
+%define tizen_feature_key_manager_support             1
+%define tizen_feature_media_controller_support        1
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_media_key_support               0
+%else
+%define tizen_feature_media_key_support               1
+%endif
+%define tizen_feature_message_port_support            1
+%define tizen_feature_messaging_support               1
 
-%define tizen_mobile_feature_notification_support            1
-%define tizen_mobile_feature_package_support                 1
-%define tizen_mobile_feature_player_util_support             1
-%define tizen_mobile_feature_power_support                   1
-%define tizen_mobile_feature_preference_support              1
-%define tizen_mobile_feature_push_support                    1
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_nfc_emulation_support           0
+%define tizen_feature_nfc_support                     1
+%else
+%define tizen_feature_nfc_emulation_support           0
+%define tizen_feature_nfc_support                     0
+%endif
+%define tizen_feature_notification_support            1
+%define tizen_feature_package_support                 1
+%define tizen_feature_player_util_support             1
+%define tizen_feature_power_support                   1
+%define tizen_feature_preference_support              1
+%define tizen_feature_push_support                    1
 
 # secure element feature
-%ifarch aarch64
-%define tizen_mobile_feature_se_support                      0
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_se_support                      0
+%else
+%if 0%{?tizen_is_arm64}
+%define tizen_feature_se_support                      0
 %else
-%define tizen_mobile_feature_se_support                      1
+%define tizen_feature_se_support                      1
+%endif
 %endif
 
-%define tizen_mobile_feature_sensor_support                  1
-%define tizen_mobile_feature_sound_support                   1
-%define tizen_mobile_feature_system_info_support             1
-%define tizen_mobile_feature_system_setting_support          1
+%define tizen_feature_sensor_support                  1
+%define tizen_feature_sound_support                   1
+%define tizen_feature_system_info_support             1
+%define tizen_feature_system_setting_support          1
 
 # telephony feature
-%ifarch aarch64
-%define tizen_mobile_feature_telephony_support               0
-%define tizen_mobile_feature_callhistory_support             0
-%define tizen_mobile_feature_nbs_support                     0
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_telephony_support               1
 %else
-%define tizen_mobile_feature_telephony_support               1
-%define tizen_mobile_feature_callhistory_support             1
-%define tizen_mobile_feature_nbs_support                     1
+%if 0%{?tizen_is_arm64}
+%define tizen_feature_telephony_support               0
+%else
+%define tizen_feature_telephony_support               1
+%endif
 %endif
 
-%define tizen_mobile_feature_time_support                    1
-%define tizen_mobile_feature_web_setting_support             1
-%define tizen_mobile_feature_widget_service_support          1
-
-%define tizen_mobile_feature_wi_fi_support                   1
+%define tizen_feature_time_support                    1
+%define tizen_feature_web_setting_support             1
+%define tizen_feature_widget_service_support          1
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_wi_fi_support                   0
+%else
+%define tizen_feature_wi_fi_support                   1
+%endif
+%define tizen_feature_inputdevice_support             1
 
-%define tizen_mobile_feature_inputdevice_support             1
+%if 0%{?tizen_feature_telephony_support}
+%define tizen_feature_callhistory_support             1
+%define tizen_feature_nbs_support                     1
+%else
+%define tizen_feature_callhistory_support             0
+%define tizen_feature_nbs_support                     0
+%endif
 
-%define tizen_mobile_feature_tvinputdevice_support           0
+%define tizen_feature_tvinputdevice_support           0
 
-%define tizen_mobile_feature_convergence_support             1
+%define tizen_feature_convergence_support             1
 
+%endif # tizen_profile_mobile
 
 ####################################################################
 #       Wearable Profile :  B2 / TW1                      #
 ####################################################################
+%if "%{?profile}" == "wearable"
 
-%define tizen_wearable_privilege_engine                        CYNARA
+%define tizen_privilege_engine                        CYNARA
 
 # Account API is optional in Tizen Wearable Profile.
-%define tizen_wearable_feature_account_support                 0
+%define tizen_feature_account_support                 0
 
-%define tizen_wearable_feature_alarm_support                   1
-%define tizen_wearable_feature_app_control_settings_support    1
-%define tizen_wearable_feature_application_support             1
+%define tizen_feature_alarm_support                   1
+%define tizen_feature_app_control_settings_support    1
+%define tizen_feature_application_support             1
 
 # Archive API is optional in Tizen Wearable Profile.
-%define tizen_wearable_feature_archive_support                 1
+%define tizen_feature_archive_support                 1
 
 # Badge API is mandatory in Tizen Wearable Profile.
-%define tizen_wearable_feature_badge_support                   1
+%define tizen_feature_badge_support                   1
 
-%define tizen_wearable_feature_bluetooth_support               1
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_bluetooth_support               0
+%else
+%define tizen_feature_bluetooth_support               1
+%endif
 
 # Bookmark API is optional in Tizen Wearable Profile.
-%define tizen_wearable_feature_bookmark_support                0
+%define tizen_feature_bookmark_support                0
 
 # Calendar API is mandatory in Tizen Wearable Profile.
-%define tizen_wearable_feature_calendar_support                0
-%define tizen_wearable_feature_contact_support                 0
-%define tizen_wearable_feature_content_support                 1
-%define tizen_wearable_feature_datacontrol_support             1
-%define tizen_wearable_feature_datasync_support                0
-%define tizen_wearable_feature_download_support                1
-%define tizen_wearable_feature_exif_support                    1
-%define tizen_wearable_feature_feedback_support                1
-%define tizen_wearable_feature_filesystem_support              1
-%define tizen_wearable_feature_fm_radio_support                0
-%define tizen_wearable_feature_ham_support                     1
-%define tizen_wearable_feature_iotcon_support                  1
-%define tizen_wearable_feature_location_batch                  0
-%define tizen_wearable_feature_media_controller_support        1
+%define tizen_feature_calendar_support                0
+%define tizen_feature_contact_support                 0
+%define tizen_feature_content_support                 1
+%define tizen_feature_datacontrol_support             1
+%define tizen_feature_datasync_support                0
+%define tizen_feature_download_support                1
+%define tizen_feature_exif_support                    1
+%define tizen_feature_feedback_support                1
+%define tizen_feature_filesystem_support              1
+%define tizen_feature_fm_radio_support                0
+%define tizen_feature_ham_support                     1
+%define tizen_feature_iotcon_support                  1
+%define tizen_feature_location_batch                  0
+%define tizen_feature_media_controller_support        1
 
 # MediayKey API is optional in Tizen Wearable Profile.
 # tizen.org/feature/network.bluetooth.audio.media is required for MediayKey API
-%define tizen_wearable_feature_media_key_support               1
-%define tizen_wearable_feature_key_manager_support             1
-%define tizen_wearable_feature_message_port_support            1
-%define tizen_wearable_feature_messaging_support               0
-%define tizen_wearable_feature_nfc_emulation_support           0
-%define tizen_wearable_feature_nfc_support                     1
-%define tizen_wearable_feature_notification_support            1
-%define tizen_wearable_feature_package_support                 1
-%define tizen_wearable_feature_player_util_support             1
-%define tizen_wearable_feature_power_support                   1
-%define tizen_wearable_feature_preference_support              1
-%define tizen_wearable_feature_push_support                    1
-%define tizen_wearable_feature_se_support                      1
-%define tizen_wearable_feature_sensor_support                  1
-%define tizen_wearable_feature_sound_support                   1
-%define tizen_wearable_feature_system_info_support             1
-%define tizen_wearable_feature_system_setting_support          1
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_media_key_support               0
+%else
+%define tizen_feature_media_key_support               1
+%endif
+%define tizen_feature_key_manager_support             1
+%define tizen_feature_message_port_support            1
+%define tizen_feature_messaging_support               0
+%define tizen_feature_nfc_emulation_support           0
+%define tizen_feature_nfc_support                     1
+%define tizen_feature_notification_support            1
+%define tizen_feature_package_support                 1
+%define tizen_feature_player_util_support             1
+%define tizen_feature_power_support                   1
+%define tizen_feature_preference_support              1
+%define tizen_feature_push_support                    1
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_se_support                      0
+%else
+%define tizen_feature_se_support                      1
+%endif
+%define tizen_feature_sensor_support                  1
+%define tizen_feature_sound_support                   1
+%define tizen_feature_system_info_support             1
+%define tizen_feature_system_setting_support          1
+%if 0%{?tizen_is_emulator}
+%define tizen_feature_telephony_support               1
+%else
+%define tizen_feature_telephony_support               0
+%endif
+%define tizen_feature_time_support                    1
+%define tizen_feature_web_setting_support             0
+%define tizen_feature_widget_service_support          1
+%define tizen_feature_wi_fi_support                   1
+%define tizen_feature_inputdevice_support             1
+%define tizen_feature_tvinputdevice_support           0
 
 #- telephony related APIs
 # CallHistory API is optional in Tizen Wearable Profile.
 # NetworkBearerSelection API is optional in Tizen Wearable Profile.
-%define tizen_wearable_feature_telephony_support               0
-%define tizen_wearable_feature_callhistory_support             0
-%define tizen_wearable_feature_nbs_support                     0
-
-%define tizen_wearable_feature_time_support                    1
-%define tizen_wearable_feature_web_setting_support             0
-%define tizen_wearable_feature_widget_service_support          1
-%define tizen_wearable_feature_wi_fi_support                   1
-%define tizen_wearable_feature_inputdevice_support             1
-%define tizen_wearable_feature_tvinputdevice_support           0
+%if 0%{?tizen_feature_telephony_support}
+%define    tizen_feature_callhistory_support          1
+%define    tizen_feature_nbs_support                  1
+%else
+%define    tizen_feature_callhistory_support          0
+%define    tizen_feature_nbs_support                  0
+%endif
 
-%define tizen_wearable_feature_convergence_support             1
+%define tizen_feature_convergence_support             1
 
+%endif # tizen_profile_wearable
 
 ####################################################################
 #       TV Profile                                                 #
 ####################################################################
-
-%define tizen_tv_privilege_engine                        CYNARA
-
-%define tizen_tv_feature_account_support                 0
-%define tizen_tv_feature_alarm_support                   1
-%define tizen_tv_feature_app_control_settings_support    0
-%define tizen_tv_feature_application_support             1
-%define tizen_tv_feature_archive_support                 1
-%define tizen_tv_feature_badge_support                   0
-%define tizen_tv_feature_bluetooth_support               0
-%define tizen_tv_feature_bookmark_support                0
-%define tizen_tv_feature_calendar_support                0
-%define tizen_tv_feature_callhistory_support             0
-%define tizen_tv_feature_contact_support                 0
-%define tizen_tv_feature_content_support                 1
-%define tizen_tv_feature_datacontrol_support             1
-%define tizen_tv_feature_datasync_support                0
-%define tizen_tv_feature_download_support                1
-%define tizen_tv_feature_exif_support                    1
-%define tizen_tv_feature_feedback_support                0
-%define tizen_tv_feature_filesystem_support              1
-%define tizen_tv_feature_fm_radio_support                0
-%define tizen_tv_feature_ham_support                     0
-%define tizen_tv_feature_iotcon_support                  1
-%define tizen_tv_feature_key_manager_support             1
-%define tizen_tv_feature_media_controller_support        0
-%define tizen_tv_feature_media_key_support               1
-%define tizen_tv_feature_message_port_support            1
-%define tizen_tv_feature_messaging_support               0
-%define tizen_tv_feature_nbs_support                     0
-%define tizen_tv_feature_nfc_emulation_support           0
-%define tizen_tv_feature_nfc_support                     0
-%define tizen_tv_feature_notification_support            0
-%define tizen_tv_feature_package_support                 1
-%define tizen_tv_feature_player_util_support             0
-%define tizen_tv_feature_power_support                   0
-%define tizen_tv_feature_preference_support              0
-%define tizen_tv_feature_push_support                    1
-%define tizen_tv_feature_se_support                      0
-%define tizen_tv_feature_sensor_support                  0
-%define tizen_tv_feature_sound_support                   0
-%define tizen_tv_feature_system_info_support             1
-%define tizen_tv_feature_system_setting_support          0
-%define tizen_tv_feature_telephony_support               0
-%define tizen_tv_feature_time_support                    1
-%define tizen_tv_feature_web_setting_support             1
-%define tizen_tv_feature_widget_service_support          0
-%define tizen_tv_feature_wi_fi_support                   1
-%define tizen_tv_feature_inputdevice_support             0
-%define tizen_tv_feature_tvinputdevice_support           1
-%define tizen_tv_feature_convergence_support             1
-
-# common, or "unified (undefined)"
-%define unified_build   1
-# GBM Product Build Optimization. Not for 4.0 Public Unified Build.
-%if "%{?profile}" == "tv" || "%{?profile}" == "mobile" || "%{?profile}" == "wearable" || "%{?profile}" == "ivi"
-%define unified_build  0
-%endif
-
-# GBM Product Build Optimization. Not for 4.0 Public Unified Build.
-%if "%{?profile}" == "tv" || "%{?profile}" == "mobile" || "%{?profile}" == "wearable" || "%{?profile}" == "common"
-%define tizen_privilege_engine                        %{expand:%tizen_%{?profile}_privilege_engine}
-
-%define tizen_feature_account_support                 %{expand:%tizen_%{?profile}_feature_account_support}
-%define tizen_feature_alarm_support                   %{expand:%tizen_%{?profile}_feature_alarm_support}
-%define tizen_feature_app_control_settings_support    %{expand:%tizen_%{?profile}_feature_app_control_settings_support}
-%define tizen_feature_application_support             %{expand:%tizen_%{?profile}_feature_application_support}
-%define tizen_feature_archive_support                 %{expand:%tizen_%{?profile}_feature_archive_support}
-%define tizen_feature_badge_support                   %{expand:%tizen_%{?profile}_feature_badge_support}
-%define tizen_feature_bluetooth_support               %{expand:%tizen_%{?profile}_feature_bluetooth_support}
-%define tizen_feature_bookmark_support                %{expand:%tizen_%{?profile}_feature_bookmark_support}
-%define tizen_feature_calendar_support                %{expand:%tizen_%{?profile}_feature_calendar_support}
-%define tizen_feature_contact_support                 %{expand:%tizen_%{?profile}_feature_contact_support}
-%define tizen_feature_content_support                 %{expand:%tizen_%{?profile}_feature_content_support}
-%define tizen_feature_datacontrol_support             %{expand:%tizen_%{?profile}_feature_datacontrol_support}
-%define tizen_feature_datasync_support                %{expand:%tizen_%{?profile}_feature_datasync_support}
-%define tizen_feature_download_support                %{expand:%tizen_%{?profile}_feature_download_support}
-%define tizen_feature_exif_support                    %{expand:%tizen_%{?profile}_feature_exif_support}
-%define tizen_feature_feedback_support                %{expand:%tizen_%{?profile}_feature_feedback_support}
-%define tizen_feature_filesystem_support              %{expand:%tizen_%{?profile}_feature_filesystem_support}
-%define tizen_feature_fm_radio_support                %{expand:%tizen_%{?profile}_feature_fm_radio_support}
-%define tizen_feature_ham_support                     %{expand:%tizen_%{?profile}_feature_ham_support}
-%define tizen_feature_iotcon_support                  %{expand:%tizen_%{?profile}_feature_iotcon_support}
-%define tizen_feature_location_batch                  %{expand:%tizen_%{?profile}_feature_location_batch}
-%define tizen_feature_key_manager_support             %{expand:%tizen_%{?profile}_feature_key_manager_support}
-%define tizen_feature_media_controller_support        %{expand:%tizen_%{?profile}_feature_media_controller_support}
-%define tizen_feature_media_key_support               %{expand:%tizen_%{?profile}_feature_media_key_support}
-%define tizen_feature_message_port_support            %{expand:%tizen_%{?profile}_feature_message_port_support}
-%define tizen_feature_messaging_support               %{expand:%tizen_%{?profile}_feature_messaging_support}
-%define tizen_feature_nfc_emulation_support           %{expand:%tizen_%{?profile}_feature_nfc_emulation_support}
-%define tizen_feature_nfc_support                     %{expand:%tizen_%{?profile}_feature_nfc_support}
-%define tizen_feature_notification_support            %{expand:%tizen_%{?profile}_feature_notification_support}
-%define tizen_feature_package_support                 %{expand:%tizen_%{?profile}_feature_package_support}
-%define tizen_feature_player_util_support             %{expand:%tizen_%{?profile}_feature_player_util_support}
-%define tizen_feature_power_support                   %{expand:%tizen_%{?profile}_feature_power_support}
-%define tizen_feature_preference_support              %{expand:%tizen_%{?profile}_feature_preference_support}
-%define tizen_feature_push_support                    %{expand:%tizen_%{?profile}_feature_push_support}
-%define tizen_feature_se_support                      %{expand:%tizen_%{?profile}_feature_se_support}
-%define tizen_feature_sensor_support                  %{expand:%tizen_%{?profile}_feature_sensor_support}
-%define tizen_feature_sound_support                   %{expand:%tizen_%{?profile}_feature_sound_support}
-%define tizen_feature_system_info_support             %{expand:%tizen_%{?profile}_feature_system_info_support}
-%define tizen_feature_system_setting_support          %{expand:%tizen_%{?profile}_feature_system_setting_support}
-%define tizen_feature_telephony_support               %{expand:%tizen_%{?profile}_feature_telephony_support}
-%define tizen_feature_time_support                    %{expand:%tizen_%{?profile}_feature_time_support}
-%define tizen_feature_web_setting_support             %{expand:%tizen_%{?profile}_feature_web_setting_support}
-%define tizen_feature_widget_service_support          %{expand:%tizen_%{?profile}_feature_widget_service_support}
-%define tizen_feature_wi_fi_support                   %{expand:%tizen_%{?profile}_feature_wi_fi_support}
-%define tizen_feature_inputdevice_support             %{expand:%tizen_%{?profile}_feature_inputdevice_support}
-%define tizen_feature_callhistory_support             %{expand:%tizen_%{?profile}_feature_callhistory_support}
-%define tizen_feature_nbs_support                     %{expand:%tizen_%{?profile}_feature_nbs_support}
-%define tizen_feature_tvinputdevice_support           %{expand:%tizen_%{?profile}_feature_tvinputdevice_support}
-%define tizen_feature_convergence_support             %{expand:%tizen_%{?profile}_feature_convergence_support}
-%endif
+%if "%{?profile}" == "tv"
+
+%define tizen_privilege_engine                        CYNARA
+
+%define tizen_feature_account_support                 0
+%define tizen_feature_alarm_support                   1
+%define tizen_feature_app_control_settings_support    0
+%define tizen_feature_application_support             1
+%define tizen_feature_archive_support                 1
+%define tizen_feature_badge_support                   0
+%define tizen_feature_bluetooth_support               0
+%define tizen_feature_bookmark_support                0
+%define tizen_feature_calendar_support                0
+%define tizen_feature_callhistory_support             0
+%define tizen_feature_contact_support                 0
+%define tizen_feature_content_support                 1
+%define tizen_feature_datacontrol_support             1
+%define tizen_feature_datasync_support                0
+%define tizen_feature_download_support                1
+%define tizen_feature_exif_support                    1
+%define tizen_feature_feedback_support                0
+%define tizen_feature_filesystem_support              1
+%define tizen_feature_fm_radio_support                0
+%define tizen_feature_ham_support                     0
+%define tizen_feature_iotcon_support                  1
+%define tizen_feature_key_manager_support             1
+%define tizen_feature_media_controller_support        0
+%define tizen_feature_media_key_support               1
+%define tizen_feature_message_port_support            1
+%define tizen_feature_messaging_support               0
+%define tizen_feature_nbs_support                     0
+%define tizen_feature_nfc_emulation_support           0
+%define tizen_feature_nfc_support                     0
+%define tizen_feature_notification_support            0
+%define tizen_feature_package_support                 1
+%define tizen_feature_player_util_support             0
+%define tizen_feature_power_support                   0
+%define tizen_feature_preference_support              0
+%define tizen_feature_push_support                    1
+%define tizen_feature_se_support                      0
+%define tizen_feature_sensor_support                  0
+%define tizen_feature_sound_support                   0
+%define tizen_feature_system_info_support             1
+%define tizen_feature_system_setting_support          0
+%define tizen_feature_telephony_support               0
+%define tizen_feature_time_support                    1
+%define tizen_feature_web_setting_support             1
+%define tizen_feature_widget_service_support          0
+%define tizen_feature_wi_fi_support                   1
+%define tizen_feature_inputdevice_support             0
+%define tizen_feature_tvinputdevice_support           1
+%define tizen_feature_convergence_support             1
+
+%endif # tizen_profile_tv
 
 BuildRequires: pkgconfig(security-privilege-manager)
 BuildRequires: ninja
@@ -384,7 +401,7 @@ BuildRequires: pkgconfig(capi-network-bluetooth)
 BuildRequires: pkgconfig(capi-network-wifi-manager)
 BuildRequires: pkgconfig(tapi)
 BuildRequires: pkgconfig(libpcrecpp)
-BuildRequires: pkgconfig(capi-appfw-app-common)
+BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires: pkgconfig(capi-appfw-app-manager)
 BuildRequires: pkgconfig(capi-appfw-package-manager)
 BuildRequires: pkgconfig(capi-content-media-content)
@@ -405,236 +422,142 @@ BuildRequires: pkgconfig(wayland-client)
 BuildRequires: pkgconfig(security-privilege-checker)
 %endif
 
-%if "%{?tizen_privilege_engine}" == "CYNARA" || "%{?unified_build}" == "1"
+%if "%{?tizen_privilege_engine}" == "CYNARA"
 BuildRequires: pkgconfig(cynara-client)
 BuildRequires: pkgconfig(libsmack)
 %endif
 
-%if "%{?tizen_feature_account_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_account_support}
 BuildRequires: pkgconfig(accounts-svc)
 %endif
 
-%if "%{?tizen_feature_alarm_support}" == "1" || "%{?unified_build}" == "1"
-BuildRequires: pkgconfig(capi-appfw-app-control)
-BuildRequires: pkgconfig(capi-appfw-application)
+%if 0%{?tizen_feature_alarm_support}
 BuildRequires: pkgconfig(capi-appfw-alarm)
 BuildRequires: pkgconfig(alarm-service)
 %endif
 
-%if "%{?tizen_feature_application_support}" == "1" || "%{?unified_build}" == "1"
-BuildRequires: pkgconfig(capi-appfw-app-control)
-BuildRequires: pkgconfig(capi-appfw-event)
-
-%if "%{?unified_build}" == "1" || "%{?profile}" == "mobile"
-BuildRequires: pkgconfig(capi-context)
-%endif
-
-%endif
-
-%if "%{?tizen_feature_bluetooth_support}" == "1" || "%{?unified_build}" == "1"
-BuildRequires: pkgconfig(capi-appfw-app-control)
-%endif
-
-%if "%{?tizen_feature_bookmark_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_bookmark_support}
 BuildRequires: pkgconfig(capi-web-bookmark)
 BuildRequires: pkgconfig(bookmark-adaptor)
 %endif
 
-%if "%{?tizen_feature_datacontrol_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_datacontrol_support}
 BuildRequires: pkgconfig(capi-data-control)
 %endif
 
-%if "%{?tizen_feature_download_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_download_support}
 BuildRequires: pkgconfig(capi-web-url-download)
 %endif
 
-%if "%{?tizen_feature_ham_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_ham_support}
 BuildRequires: pkgconfig(motion)
 BuildRequires: pkgconfig(capi-system-sensor)
 BuildRequires: pkgconfig(capi-location-manager)
 BuildRequires: pkgconfig(sensor)
 %endif
 
-%if "%{?tizen_feature_iotcon_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_iotcon_support}
 BuildRequires: pkgconfig(iotcon)
 %endif
 
-%if "%{?tizen_feature_player_util_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_player_util_support}
 BuildRequires: pkgconfig(chromium-efl)
 %endif
 
-%if "%{?tizen_feature_power_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_power_support}
 BuildRequires: pkgconfig(deviced)
 %endif
 
-%if "%{?tizen_feature_power_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_power_support}
 BuildRequires: pkgconfig(capi-appfw-application)
 %endif
 
-%if "%{?tizen_feature_push_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_push_support}
 BuildRequires: pkgconfig(push)
-BuildRequires: pkgconfig(capi-appfw-app-control)
 %endif
 
-%if "%{?tizen_feature_key_manager_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_key_manager_support}
 BuildRequires: pkgconfig(key-manager)
 %endif
 
-%if "%{?tizen_feature_media_controller_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_media_controller_support}
 BuildRequires: pkgconfig(capi-media-controller)
 %endif
 
-%if "%{?tizen_feature_messaging_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_messaging_support}
 BuildRequires:  pkgconfig(ecore-file)
 BuildRequires:  pkgconfig(email-service)
 BuildRequires:  pkgconfig(msg-service)
 BuildRequires:  pkgconfig(db-util)
 %endif
 
-%if "%{?tizen_feature_badge_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_badge_support}
 BuildRequires:  pkgconfig(badge)
 %endif
 
-%if "%{?tizen_feature_calendar_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_calendar_support}
 BuildRequires:  pkgconfig(calendar-service2)
 %endif
 
-%if "%{?tizen_feature_contact_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_contact_support}
 BuildRequires:  pkgconfig(contacts-service2)
 %endif
 
-%if "%{?tizen_feature_callhistory_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_callhistory_support}
 BuildRequires:  pkgconfig(contacts-service2)
 %endif
 
-%if "%{?tizen_feature_exif_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_exif_support}
 BuildRequires:  pkgconfig(libexif)
 %endif
 
-%if "%{?tizen_feature_nfc_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_nfc_support}
 BuildRequires:  pkgconfig(capi-network-nfc)
-BuildRequires:  pkgconfig(capi-appfw-app-control)
 %endif
 
-%if "%{?tizen_feature_fm_radio_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_fm_radio_support}
 BuildRequires: pkgconfig(capi-media-radio)
 %endif
 
-%if "%{?tizen_feature_feedback_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_feedback_support}
 BuildRequires: pkgconfig(feedback)
 %endif
 
-%if "%{?tizen_feature_se_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_se_support}
 BuildRequires:  pkgconfig(capi-network-smartcard)
 %endif
 
-%if "%{?tizen_feature_message_port_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_message_port_support}
 BuildRequires: pkgconfig(capi-message-port)
 %endif
 
-%if "%{?tizen_feature_notification_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_notification_support}
 BuildRequires: pkgconfig(notification)
-BuildRequires: pkgconfig(capi-appfw-app-control)
 %endif
 
-%if "%{?tizen_feature_preference_support}" == "1" || "%{?unified_build}" == "1"
-BuildRequires: pkgconfig(capi-appfw-preference)
-%endif
-
-%if "%{?tizen_feature_sound_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_sound_support}
 BuildRequires:  pkgconfig(capi-media-sound-manager)
 %endif
 
-%if "%{?tizen_feature_sensor_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_sensor_support}
 BuildRequires: pkgconfig(capi-system-sensor)
 %endif
 
-%if "%{?tizen_feature_media_key_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_media_key_support}
 BuildRequires:  pkgconfig(capi-system-media-key)
 %endif
 
-%if "%{?tizen_feature_convergence_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_convergence_support}
 BuildRequires: pkgconfig(d2d-conv-manager)
 %endif
 
-%if "%{?tizen_feature_widget_service_support}" == "1" || "%{?unified_build}" == "1"
+%if 0%{?tizen_feature_widget_service_support}
 BuildRequires: pkgconfig(widget_service)
 %endif
 
-Requires:      %{name}-compat = %{version}-%{release}
-%if "%{?unified_build}" == "1"
-Recommends:    %{name}-profile_common = %{version}-%{release}
-%endif
-
 %description
 Tizen Web APIs implemented.
 
-%package profile_common
-Summary:       webapi-plugin binaries for common profile
-Provides:      %{name}-compat = %{version}-%{release}
-Conflicts:     %{name}-profile_mobile
-Conflicts:     %{name}-profile_wearable
-Conflicts:     %{name}-profile_tv
-Conflicts:     %{name}-profile_ivi
-%description profile_common
-Tizen Web API implementation binaries for Tizen common profile.
-
-%package profile_mobile
-Summary:       webapi-plugin binaries for mobile profile
-Provides:      %{name}-compat = %{version}-%{release}
-Conflicts:     %{name}-profile_common
-Conflicts:     %{name}-profile_wearable
-Conflicts:     %{name}-profile_tv
-Conflicts:     %{name}-profile_ivi
-%description profile_mobile
-Tizen Web API implementation binaries for Tizen mobile profile.
-
-%ifarch %{ix86} x86_64
-%package mobile-extension-emulator
-Summary:       webapi-plugin binaries for mobile emulator
-Requires:      %{name}-profile_mobile = %{version}-%{release}
-%description mobile-extension-emulator
-Tizen Web API implementation binaries for Tizen mobile emulator.
-%endif
-
-%package profile_wearable
-Summary:       webapi-plugin binaries for wearable profile
-Provides:      %{name}-compat = %{version}-%{release}
-Conflicts:     %{name}-profile_mobile
-Conflicts:     %{name}-profile_common
-Conflicts:     %{name}-profile_tv
-Conflicts:     %{name}-profile_ivi
-%description profile_wearable
-Tizen Web API implementation binaries for Tizen wearable profile.
-
-%ifarch %{ix86} x86_64
-%package wearable-extension-emulator
-Summary:       webapi-plugin binaries for wearable emulator
-Requires:      %{name}-profile_wearable = %{version}-%{release}
-%description wearable-extension-emulator
-Tizen Web API implementation binaries for Tizen wearable emulator.
-%endif
-
-%package profile_tv
-Summary:       webapi-plugin binaries for tv profile
-Provides:      %{name}-compat = %{version}-%{release}
-Conflicts:     %{name}-profile_mobile
-Conflicts:     %{name}-profile_wearable
-Conflicts:     %{name}-profile_common
-Conflicts:     %{name}-profile_ivi
-%description profile_tv
-Tizen Web API implementation binaries for Tizen tv profile.
-
-%package profile_ivi
-Summary:       webapi-plugin binaries for ivi profile
-Provides:      %{name}-compat = %{version}-%{release}
-Conflicts:     %{name}-profile_mobile
-Conflicts:     %{name}-profile_wearable
-Conflicts:     %{name}-profile_tv
-Conflicts:     %{name}-profile_common
-%description profile_ivi
-Tizen Web API implementation binaries for Tizen ivi profile.
-
 %package devel
 Summary:    webapi-plugins development headers
 Group:      Development/Libraries
@@ -649,382 +572,12 @@ webapi-plugins development headers
 %build
 
 export GYP_GENERATORS='ninja'
-
-%if "%{?unified_build}" == "1"
-# Build All Profiles
-
-# Mobile
-GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=mobile -Dprivilege_engine=%{tizen_mobile_privilege_engine}"
-GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
-GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
-
-# feature flags
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_mobile_feature_account_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_mobile_feature_alarm_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_mobile_feature_app_control_settings_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_mobile_feature_application_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_mobile_feature_archive_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_mobile_feature_badge_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_mobile_feature_bluetooth_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_mobile_feature_bookmark_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_mobile_feature_calendar_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_mobile_feature_callhistory_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_mobile_feature_contact_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_mobile_feature_content_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_mobile_feature_datacontrol_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_mobile_feature_datasync_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_mobile_feature_download_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_mobile_feature_exif_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_mobile_feature_feedback_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_mobile_feature_filesystem_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_mobile_feature_fm_radio_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_mobile_feature_ham_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_mobile_feature_iotcon_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_mobile_feature_location_batch}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_mobile_feature_key_manager_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_mobile_feature_media_controller_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_mobile_feature_media_key_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_mobile_feature_message_port_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_mobile_feature_messaging_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_mobile_feature_nbs_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_mobile_feature_nfc_emulation_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_mobile_feature_nfc_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_mobile_feature_notification_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_mobile_feature_package_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_mobile_feature_player_util_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_mobile_feature_power_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_mobile_feature_preference_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_mobile_feature_push_support}"
-#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_mobile_feature_sap_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_mobile_feature_sensor_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_mobile_feature_se_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_mobile_feature_sound_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_mobile_feature_system_info_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_mobile_feature_system_setting_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_mobile_feature_telephony_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_mobile_feature_time_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_mobile_feature_inputdevice_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_mobile_feature_web_setting_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_mobile_feature_widget_service_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_mobile_feature_wi_fi_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_mobile_feature_tvinputdevice_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_mobile_feature_convergence_support}"
-
-./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
-
-ninja -C out/Default %{?_smp_mflags}
-pushd out
-mv Default bin_mobile
-popd
-
-# mobile-extension-emulator
-%ifarch %{ix86} x86_64
-
-%define tizen_mobile_feature_bluetooth_support               0
-
-# FM radio feature
-%define tizen_mobile_feature_fm_radio_support                1
-
-%define tizen_mobile_feature_ham_support                     1
-%define tizen_mobile_feature_media_key_support               0
-%define tizen_mobile_feature_nfc_emulation_support           0
-%define tizen_mobile_feature_nfc_support                     1
-
-# secure element feature
-%define tizen_mobile_feature_se_support                      0
-
-# telephony feature
-%define tizen_mobile_feature_telephony_support               1
-%define tizen_mobile_feature_callhistory_support             1
-%define tizen_mobile_feature_nbs_support                     1
-
-%define tizen_mobile_feature_wi_fi_support                   0
-
-GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=mobile -Dprivilege_engine=%{tizen_mobile_privilege_engine}"
-GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
-GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
-
-# feature flags
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_mobile_feature_account_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_mobile_feature_alarm_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_mobile_feature_app_control_settings_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_mobile_feature_application_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_mobile_feature_archive_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_mobile_feature_badge_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_mobile_feature_bluetooth_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_mobile_feature_bookmark_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_mobile_feature_calendar_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_mobile_feature_callhistory_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_mobile_feature_contact_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_mobile_feature_content_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_mobile_feature_datacontrol_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_mobile_feature_datasync_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_mobile_feature_download_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_mobile_feature_exif_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_mobile_feature_feedback_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_mobile_feature_filesystem_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_mobile_feature_fm_radio_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_mobile_feature_ham_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_mobile_feature_iotcon_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_mobile_feature_location_batch}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_mobile_feature_key_manager_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_mobile_feature_media_controller_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_mobile_feature_media_key_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_mobile_feature_message_port_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_mobile_feature_messaging_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_mobile_feature_nbs_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_mobile_feature_nfc_emulation_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_mobile_feature_nfc_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_mobile_feature_notification_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_mobile_feature_package_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_mobile_feature_player_util_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_mobile_feature_power_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_mobile_feature_preference_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_mobile_feature_push_support}"
-#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_mobile_feature_sap_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_mobile_feature_sensor_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_mobile_feature_se_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_mobile_feature_sound_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_mobile_feature_system_info_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_mobile_feature_system_setting_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_mobile_feature_telephony_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_mobile_feature_time_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_mobile_feature_inputdevice_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_mobile_feature_web_setting_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_mobile_feature_widget_service_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_mobile_feature_wi_fi_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_mobile_feature_tvinputdevice_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_mobile_feature_convergence_support}"
-
-./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
-
-ninja -C out/Default %{?_smp_mflags}
-pushd out
-mv Default bin_mobile_emulator
-popd
-%endif
-
-# WEARABLE
-GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=wearable -Dprivilege_engine=%{tizen_wearable_privilege_engine}"
-GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
-GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
-
-# feature flags
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_wearable_feature_account_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_wearable_feature_alarm_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_wearable_feature_app_control_settings_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_wearable_feature_application_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_wearable_feature_archive_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_wearable_feature_badge_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_wearable_feature_bluetooth_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_wearable_feature_bookmark_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_wearable_feature_calendar_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_wearable_feature_callhistory_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_wearable_feature_contact_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_wearable_feature_content_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_wearable_feature_datacontrol_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_wearable_feature_datasync_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_wearable_feature_download_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_wearable_feature_exif_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_wearable_feature_feedback_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_wearable_feature_filesystem_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_wearable_feature_fm_radio_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_wearable_feature_ham_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_wearable_feature_iotcon_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_wearable_feature_location_batch}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_wearable_feature_key_manager_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_wearable_feature_media_controller_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_wearable_feature_media_key_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_wearable_feature_message_port_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_wearable_feature_messaging_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_wearable_feature_nbs_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_wearable_feature_nfc_emulation_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_wearable_feature_nfc_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_wearable_feature_notification_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_wearable_feature_package_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_wearable_feature_player_util_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_wearable_feature_power_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_wearable_feature_preference_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_wearable_feature_push_support}"
-#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_wearable_feature_sap_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_wearable_feature_sensor_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_wearable_feature_se_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_wearable_feature_sound_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_wearable_feature_system_info_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_wearable_feature_system_setting_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_wearable_feature_telephony_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_wearable_feature_time_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_wearable_feature_inputdevice_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_wearable_feature_web_setting_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_wearable_feature_widget_service_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_wearable_feature_wi_fi_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_wearable_feature_tvinputdevice_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_wearable_feature_convergence_support}"
-
-./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
-
-ninja -C out/Default %{?_smp_mflags}
-pushd out
-mv Default bin_wearable
-popd
-
-# wearable-extension-emulator
-%ifarch %{ix86} x86_64
-
-%define tizen_wearable_feature_bluetooth_support             0
-
-# MediayKey API is optional in Tizen Wearable Profile.
-# tizen.org/feature/network.bluetooth.audio.media is required for MediayKey API
-%define tizen_wearable_feature_media_key_support             0
-
-#- telephony related APIs
-# CallHistory API is optional in Tizen Wearable Profile.
-# NetworkBearerSelection API is optional in Tizen Wearable Profile.
-%define tizen_wearable_feature_se_support                    0
-%define tizen_wearable_feature_telephony_support             1
-%define tizen_wearable_feature_callhistory_support           1
-%define tizen_wearable_feature_nbs_support                   1
-
-GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=wearable -Dprivilege_engine=%{tizen_wearable_privilege_engine}"
-GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
-GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
-
-# feature flags
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_wearable_feature_account_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_wearable_feature_alarm_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_wearable_feature_app_control_settings_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_wearable_feature_application_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_wearable_feature_archive_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_wearable_feature_badge_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_wearable_feature_bluetooth_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_wearable_feature_bookmark_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_wearable_feature_calendar_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_wearable_feature_callhistory_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_wearable_feature_contact_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_wearable_feature_content_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_wearable_feature_datacontrol_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_wearable_feature_datasync_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_wearable_feature_download_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_wearable_feature_exif_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_wearable_feature_feedback_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_wearable_feature_filesystem_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_wearable_feature_fm_radio_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_wearable_feature_ham_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_wearable_feature_iotcon_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_wearable_feature_location_batch}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_wearable_feature_key_manager_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_wearable_feature_media_controller_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_wearable_feature_media_key_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_wearable_feature_message_port_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_wearable_feature_messaging_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_wearable_feature_nbs_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_wearable_feature_nfc_emulation_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_wearable_feature_nfc_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_wearable_feature_notification_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_wearable_feature_package_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_wearable_feature_player_util_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_wearable_feature_power_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_wearable_feature_preference_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_wearable_feature_push_support}"
-#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_wearable_feature_sap_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_wearable_feature_sensor_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_wearable_feature_se_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_wearable_feature_sound_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_wearable_feature_system_info_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_wearable_feature_system_setting_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_wearable_feature_telephony_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_wearable_feature_time_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_wearable_feature_inputdevice_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_wearable_feature_web_setting_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_wearable_feature_widget_service_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_wearable_feature_wi_fi_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_wearable_feature_tvinputdevice_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_wearable_feature_convergence_support}"
-
-./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
-
-ninja -C out/Default %{?_smp_mflags}
-pushd out
-mv Default bin_wearable_emulator
-popd
-%endif
-
-# TV
-GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=tv -Dprivilege_engine=%{tizen_tv_privilege_engine}"
-GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
-GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
-
-# feature flags
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_tv_feature_account_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_tv_feature_alarm_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_tv_feature_app_control_settings_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_application_support=%{?tizen_tv_feature_application_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_archive_support=%{?tizen_tv_feature_archive_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_badge_support=%{?tizen_tv_feature_badge_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bluetooth_support=%{?tizen_tv_feature_bluetooth_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_bookmark_support=%{?tizen_tv_feature_bookmark_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_calendar_support=%{?tizen_tv_feature_calendar_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_callhistory_support=%{?tizen_tv_feature_callhistory_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_contact_support=%{?tizen_tv_feature_contact_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_content_support=%{?tizen_tv_feature_content_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datacontrol_support=%{?tizen_tv_feature_datacontrol_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_datasync_support=%{?tizen_tv_feature_datasync_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_download_support=%{?tizen_tv_feature_download_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_exif_support=%{?tizen_tv_feature_exif_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_feedback_support=%{?tizen_tv_feature_feedback_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_filesystem_support=%{?tizen_tv_feature_filesystem_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_fm_radio_support=%{?tizen_tv_feature_fm_radio_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_ham_support=%{?tizen_tv_feature_ham_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_iotcon_support=%{?tizen_tv_feature_iotcon_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_location_batch=%{?tizen_tv_feature_location_batch}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_key_manager_support=%{?tizen_tv_feature_key_manager_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_controller_support=%{?tizen_tv_feature_media_controller_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_media_key_support=%{?tizen_tv_feature_media_key_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_message_port_support=%{?tizen_tv_feature_message_port_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_messaging_support=%{?tizen_tv_feature_messaging_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nbs_support=%{?tizen_tv_feature_nbs_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_emulation_support=%{?tizen_tv_feature_nfc_emulation_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_nfc_support=%{?tizen_tv_feature_nfc_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_notification_support=%{?tizen_tv_feature_notification_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_package_support=%{?tizen_tv_feature_package_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_tv_feature_player_util_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_tv_feature_power_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_tv_feature_preference_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_tv_feature_push_support}"
-#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_tv_feature_sap_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_tv_feature_sensor_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_tv_feature_se_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_tv_feature_sound_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_info_support=%{?tizen_tv_feature_system_info_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_system_setting_support=%{?tizen_tv_feature_system_setting_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_telephony_support=%{?tizen_tv_feature_telephony_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_time_support=%{?tizen_tv_feature_time_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_inputdevice_support=%{?tizen_tv_feature_inputdevice_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_web_setting_support=%{?tizen_tv_feature_web_setting_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_widget_service_support=%{?tizen_tv_feature_widget_service_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_wi_fi_support=%{?tizen_tv_feature_wi_fi_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_tvinputdevice_support=%{?tizen_tv_feature_tvinputdevice_support}"
-GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_tv_feature_convergence_support}"
-
-./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
-
-ninja -C out/Default %{?_smp_mflags}
-pushd out
-mv Default bin_tv
-popd
-
-%endif
-
-# Unified: common/ Others: its own profile
-%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
-GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=common -Dprivilege_engine=%{tizen_privilege_engine}"
-%else
 GYP_OPTIONS="--depth=. -Dtizen=1 -Dextension_build_type=Debug -Dextension_host_os=%{profile} -Dprivilege_engine=%{tizen_privilege_engine}"
-%endif
 GYP_OPTIONS="$GYP_OPTIONS -Ddisplay_type=%{display_type}"
 GYP_OPTIONS="$GYP_OPTIONS -Dcrosswalk_extensions_path=%{crosswalk_extensions_path}"
 
 # feature flags
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_is_emulator=%{?tizen_is_emulator}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_account_support=%{?tizen_feature_account_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_alarm_support=%{?tizen_feature_alarm_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_app_control_settings_support=%{?tizen_feature_app_control_settings_support}"
@@ -1061,7 +614,7 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_player_util_support=%{?tizen_feature_p
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_power_support=%{?tizen_feature_power_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_preference_support=%{?tizen_feature_preference_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_push_support=%{?tizen_feature_push_support}"
-#GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_feature_sap_support}"
+GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sap_support=%{?tizen_feature_sap_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sensor_support=%{?tizen_feature_sensor_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_se_support=%{?tizen_feature_se_support}"
 GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_sound_support=%{?tizen_feature_sound_support}"
@@ -1078,117 +631,17 @@ GYP_OPTIONS="$GYP_OPTIONS -Dtizen_feature_convergence_support=%{?tizen_feature_c
 
 ./tools/gyp/gyp $GYP_OPTIONS src/tizen-wrt.gyp
 
-%if "%{?profile}" != "mobile" && "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?profile}" != "ivi"
 ninja -C out/Default %{?_smp_mflags}
-pushd out
-mv Default bin_common
-ln -sf bin_common Default
-
-# IVI does not have independent configurations, yet.
-# Copying the whole result in order to support ivi subpacakge
-cp -R bin_common bin_ivi
-
-popd
-%else
-ninja -C out/Default %{?_smp_mflags}
-pushd out
-mv Default bin_%{?profile}
-ln -sf bin_%{?profile} Default
-popd
-%endif
 
 %install
+mkdir -p %{buildroot}/usr/share/license
+cp LICENSE %{buildroot}/usr/share/license/%{name}
+cat LICENSE.BSD-3-Clause >> %{buildroot}/usr/share/license/%{name}
+cat LICENSE.MIT >> %{buildroot}/usr/share/license/%{name}
 
 # Extensions.
 mkdir -p %{buildroot}%{crosswalk_extensions_path}
-
-%if "%{?unified_build}" == "1" || "%{?profile}" == "common"
-mkdir -p %{buildroot}%{crosswalk_extensions_path}/common
-install -p -m 644 out/bin_common/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/common
-# execute desc_gentool
-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/common out/Default/desc_gentool \
-       %{crosswalk_extensions_path}/common \
-       %{buildroot}%{crosswalk_extensions_path}/common > plugins.json
-
-# temporary plugins description for lazy loading
-install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/common/plugins.json
-%endif
-
-%if "%{?unified_build}" == "1" || "%{?profile}" == "mobile"
-mkdir -p %{buildroot}%{crosswalk_extensions_path}/mobile
-install -p -m 644 out/bin_mobile/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/mobile
-# execute desc_gentool
-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/mobile out/Default/desc_gentool \
-       %{crosswalk_extensions_path}/mobile \
-       %{buildroot}%{crosswalk_extensions_path}/mobile > plugins.json
-
-# temporary plugins description for lazy loading
-install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/mobile/plugins.json
-
-# mobile-extension-emulator
-%ifarch %{ix86} x86_64
-mkdir -p %{buildroot}%{crosswalk_extensions_path}/mobile_emulator
-install -p -m 644 out/bin_mobile_emulator/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/mobile_emulator
-# execute desc_gentool
-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/mobile_emulator out/Default/desc_gentool \
-       %{crosswalk_extensions_path}/mobile_emulator \
-       %{buildroot}%{crosswalk_extensions_path}/mobile_emulator > plugins.json
-
-# temporary plugins description for lazy loading
-install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/mobile_emulator/plugins.json
-%endif // mobile-extension-emulator
-
-%endif // mobile
-
-%if "%{?unified_build}" == "1" || "%{?profile}" == "wearable"
-mkdir -p %{buildroot}%{crosswalk_extensions_path}/wearable
-install -p -m 644 out/bin_wearable/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/wearable
-# execute desc_gentool
-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/wearable out/Default/desc_gentool \
-       %{crosswalk_extensions_path}/wearable \
-       %{buildroot}%{crosswalk_extensions_path}/wearable > plugins.json
-
-# temporary plugins description for lazy loading
-install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/wearable/plugins.json
-
-# wearable-extension-emulator
-%ifarch %{ix86} x86_64
-mkdir -p %{buildroot}%{crosswalk_extensions_path}/wearable_emulator
-install -p -m 644 out/bin_wearable_emulator/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/wearable_emulator
-# execute desc_gentool
-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/mobile_emulator out/Default/desc_gentool \
-       %{crosswalk_extensions_path}/wearable_emulator \
-       %{buildroot}%{crosswalk_extensions_path}/wearable_emulator > plugins.json
-
-# temporary plugins description for lazy loading
-install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/wearable_emulator/plugins.json
-%endif // wearable-extension-emulator
-
-%endif // wearable
-
-%if "%{?unified_build}" == "1" || "%{?profile}" == "tv"
-mkdir -p %{buildroot}%{crosswalk_extensions_path}/tv
-install -p -m 644 out/bin_tv/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/tv
-# execute desc_gentool
-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/tv out/Default/desc_gentool \
-       %{crosswalk_extensions_path}/tv \
-       %{buildroot}%{crosswalk_extensions_path}/tv > plugins.json
-
-# temporary plugins description for lazy loading
-install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/tv/plugins.json
-%endif
-
-%if "%{?unified_build}" == "1" || "%{?profile}" == "ivi"
-mkdir -p %{buildroot}%{crosswalk_extensions_path}/ivi
-install -p -m 644 out/bin_ivi/libtizen*.so %{buildroot}%{crosswalk_extensions_path}/ivi
-# execute desc_gentool
-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path}/ivi out/Default/desc_gentool \
-       %{crosswalk_extensions_path}/ivi \
-       %{buildroot}%{crosswalk_extensions_path}/ivi > plugins.json
-
-# temporary plugins description for lazy loading
-install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/ivi/plugins.json
-%endif
+install -p -m 644 out/Default/libtizen*.so %{buildroot}%{crosswalk_extensions_path}
 
 # devel files
 mkdir -p %{buildroot}%{_libdir}/pkgconfig
@@ -1209,123 +662,20 @@ cp -a tools/gyp %{buildroot}%{_includedir}/%{name}/tools/gyp
 cp -a tools/slimit %{buildroot}%{_includedir}/%{name}/tools/slimit
 cp -a out/Default/desc_gentool %{buildroot}%{_includedir}/%{name}/tools/desc_gentool
 
-%files
-%manifest webapi-plugins.manifest
-%license LICENSE
-
-%if "%{?unified_build}" == "1" || "%{?profile}" == "common"
-%post profile_common
-ln -sf %{crosswalk_extensions_path}/common/* %{crosswalk_extensions_path}
-%preun profile_common
-# This is an un-installation.
-if [ "$1" == "0" ]; then
-  rm %{crosswalk_extensions_path}/libtizen*.so
-  rm %{crosswalk_extensions_path}/plugins.json
-fi
-%files profile_common
-%dir %{crosswalk_extensions_path}/common/
-%{crosswalk_extensions_path}/common/libtizen*.so
-%{crosswalk_extensions_path}/common/plugins.json
-%manifest webapi-plugins.manifest
-%endif
+# execute desc_gentool
+LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{crosswalk_extensions_path} out/Default/desc_gentool \
+       %{crosswalk_extensions_path} \
+       %{buildroot}%{crosswalk_extensions_path} > plugins.json
 
-%if "%{?unified_build}" == "1" || "%{?profile}" == "mobile"
-%post profile_mobile
-ln -sf %{crosswalk_extensions_path}/mobile/* %{crosswalk_extensions_path}
-%preun profile_mobile
-# This is an un-installation.
-if [ "$1" == "0" ]; then
-  rm %{crosswalk_extensions_path}/libtizen*.so
-  rm %{crosswalk_extensions_path}/plugins.json
-fi
-%files profile_mobile
-%dir %{crosswalk_extensions_path}/mobile/
-%{crosswalk_extensions_path}/mobile/libtizen*.so
-%{crosswalk_extensions_path}/mobile/plugins.json
-%manifest webapi-plugins.manifest
+# temporary plugins description for lazy loading
+install -p -m 644 plugins.json %{buildroot}%{crosswalk_extensions_path}/plugins.json
 
-# mobile-extension-emulator
-%ifarch %{ix86} x86_64
-%post mobile-extension-emulator
-ln -sf %{crosswalk_extensions_path}/mobile_emulator/* %{crosswalk_extensions_path}
-%preun mobile-extension-emulator
-# This is an un-installation.
-if [ "$1" == "0" ]; then
-  rm %{crosswalk_extensions_path}/libtizen*.so
-  rm %{crosswalk_extensions_path}/plugins.json
-fi
-%files mobile-extension-emulator
-%dir %{crosswalk_extensions_path}/mobile_emulator/
-%{crosswalk_extensions_path}/mobile_emulator/libtizen*.so
-%{crosswalk_extensions_path}/mobile_emulator/plugins.json
-%manifest webapi-plugins.manifest
-%endif // mobile-extension-emulator
-%endif // mobile
-
-%if "%{?unified_build}" == "1" || "%{?profile}" == "wearable"
-%post profile_wearable
-ln -sf %{crosswalk_extensions_path}/wearable/* %{crosswalk_extensions_path}
-%preun profile_wearable
-# This is an un-installation.
-if [ "$1" == "0" ]; then
-  rm %{crosswalk_extensions_path}/libtizen*.so
-  rm %{crosswalk_extensions_path}/plugins.json
-fi
-%files profile_wearable
-%dir %{crosswalk_extensions_path}/wearable/
-%{crosswalk_extensions_path}/wearable/libtizen*.so
-%{crosswalk_extensions_path}/wearable/plugins.json
-%manifest webapi-plugins.manifest
 
-# wearable-extension-emulator
-%ifarch %{ix86} x86_64
-%post wearable-extension-emulator
-ln -sf %{crosswalk_extensions_path}/wearable_emulator/* %{crosswalk_extensions_path}
-%preun wearable-extension-emulator
-# This is an un-installation.
-if [ "$1" == "0" ]; then
-  rm %{crosswalk_extensions_path}/libtizen*.so
-  rm %{crosswalk_extensions_path}/plugins.json
-fi
-%files wearable-extension-emulator
-%dir %{crosswalk_extensions_path}/wearable_emulator/
-%{crosswalk_extensions_path}/wearable_emulator/libtizen*.so
-%{crosswalk_extensions_path}/wearable_emulator/plugins.json
-%manifest webapi-plugins.manifest
-%endif // wearable-extension-emulator
-%endif // wearable
-
-%if "%{?unified_build}" == "1" || "%{?profile}" == "tv"
-%post profile_tv
-ln -sf %{crosswalk_extensions_path}/tv/* %{crosswalk_extensions_path}
-%preun profile_tv
-# This is an un-installation.
-if [ "$1" == "0" ]; then
-  rm %{crosswalk_extensions_path}/libtizen*.so
-  rm %{crosswalk_extensions_path}/plugins.json
-fi
-%files profile_tv
-%dir %{crosswalk_extensions_path}/tv/
-%{crosswalk_extensions_path}/tv/libtizen*.so
-%{crosswalk_extensions_path}/tv/plugins.json
-%manifest webapi-plugins.manifest
-%endif
-
-%if "%{?unified_build}" == "1" || "%{?profile}" == "ivi"
-%post profile_ivi
-ln -sf %{crosswalk_extensions_path}/ivi/* %{crosswalk_extensions_path}
-%preun profile_ivi
-# This is an un-installation.
-if [ "$1" == "0" ]; then
-  rm %{crosswalk_extensions_path}/libtizen*.so
-  rm %{crosswalk_extensions_path}/plugins.json
-fi
-%files profile_ivi
-%dir %{crosswalk_extensions_path}/ivi/
-%{crosswalk_extensions_path}/ivi/libtizen*.so
-%{crosswalk_extensions_path}/ivi/plugins.json
+%files
+%{crosswalk_extensions_path}/libtizen*.so
+%{crosswalk_extensions_path}/plugins.json
+%{_datadir}/license/%{name}
 %manifest webapi-plugins.manifest
-%endif
 
 %files devel
 %{_includedir}/*
index 5d212ec6e579adbd008e8bf0dce9f3bc63b92e41..dc1135a183686030353c54c5dd69160c12a40c62 100644 (file)
@@ -8,7 +8,6 @@
       'type': 'loadable_module',
       'dependencies': [
         '../common/common.gyp:tizen_common',
-        '../notification/notification.gyp:tizen_notification',
       ],
       'sources': [
         'alarm_api.js',
@@ -26,8 +25,6 @@
           'variables': {
             'packages': [
               'capi-appfw-alarm',
-              'capi-appfw-app-control',
-              'capi-appfw-application',
             ]
           },
         }],
index 278719bb0d11518c3e47c5cdd7b0f0a24403f4a6..47725dc998a736e31a8510fc44a1436c125c2538 100755 (executable)
@@ -66,20 +66,6 @@ function UpdateInternalData_(internal, data) {
     }
 }
 
-var LogManager = function() {
-    this.enableLog = true;
-};
-
-LogManager.prototype.allow = function() {
-    this.enableLog = true;
-};
-
-LogManager.prototype.disallow = function() {
-    this.enableLog = false;
-};
-
-var _warningLogs = new LogManager();
-
 //class AlarmManager ////////////////////////////////////////////////////
 AlarmManager.prototype.add = function () {
     var args = AV.validateMethod(arguments, [
@@ -130,44 +116,6 @@ AlarmManager.prototype.add = function () {
     }
 };
 
-AlarmManager.prototype.addAlarmNotification = function() {
-    var args = AV.validateMethod(arguments, [
-    {
-        name: 'alarm',
-        type: AV.Types.PLATFORM_OBJECT,
-        values: [tizen.AlarmRelative, tizen.AlarmAbsolute]
-    }, {
-        name: 'notification',
-        type: AV.Types.PLATFORM_OBJECT,
-        values: tizen.StatusNotification
-    }]);
-
-    var type = null, milliseconds = 0;
-    if (args.alarm instanceof tizen.AlarmRelative) {
-        type = 'AlarmRelative';
-    } else if (args.alarm instanceof tizen.AlarmAbsolute) {
-        type = 'AlarmAbsolute';
-        milliseconds = args.alarm.date.getTime();
-    }
-
-    var callArgs = {};
-    callArgs.alarm = args.alarm;
-    callArgs.type = type;
-    callArgs.notification = args.notification;
-    callArgs.milliseconds = Converter.toString(milliseconds);
-    callArgs.isPeriodSet = !T.isNullOrUndefined(args.alarm.period);
-
-    var result = native.callSync('AlarmManager_addAlarmNotification', callArgs);
-    if (native.isFailure(result)) {
-        throw native.getErrorObject(result);
-    }
-    else {
-        _edit.allow();
-        UpdateInternalData_(args.alarm, native.getResultObject(result));
-        _edit.disallow();
-    }
-};
-
 AlarmManager.prototype.remove = function () {
     var args = AV.validateMethod(arguments, [
         {
@@ -205,46 +153,14 @@ AlarmManager.prototype.get = function () {
         throw native.getErrorObject(result);
     } else {
         result = native.getResultObject(result);
-
-        var alarm;
-        _warningLogs.disallow();
         if ('AlarmRelative' === result.type) {
-            alarm = new tizen.AlarmRelative(result.delay, result.period, InternalData_(result));
+            return new tizen.AlarmRelative(result.delay, result.period, InternalData_(result));
         } else {
             var date = new Date(result.year, result.month, result.day,
                     result.hour, result.min, result.sec);
 
-            alarm = new tizen.AlarmAbsolute(date, result.second, InternalData_(result));
-        }
-        _warningLogs.allow();
-        return alarm;
-    }
-};
-
-AlarmManager.prototype.getAlarmNotification = function () {
-    var args = AV.validateMethod(arguments, [
-        {
-            name : 'id',
-            type : AV.Types.STRING,
-        }
-    ]);
-
-    var result = native.callSync('AlarmManager_getAlarmNotification', {id: Number(args.id)});
-
-    if (native.isFailure(result)) {
-        throw native.getErrorObject(result);
-    } else {
-        var noti = native.getResultObject(result);
-        if(!T.isNullOrUndefined(noti.appControl.operation)){
-            noti.appControl = new tizen.ApplicationControl(
-                    noti.appControl.operation,
-                    noti.appControl.uri,
-                    noti.appControl.mime,
-                    noti.appControl.category,
-                    noti.appControl.data,
-                    noti.appControl.launchMode);
+            return new tizen.AlarmAbsolute(date, result.second, InternalData_(result));
         }
-        return new tizen.StatusNotification('SIMPLE', noti.title, noti);
     }
 };
 
@@ -256,7 +172,6 @@ AlarmManager.prototype.getAll = function () {
     } else {
         var data = native.getResultObject(result);
         var md = [];
-        _warningLogs.disallow();
         data.forEach(function (i) {
             if ('AlarmRelative'=== i.type) {
                 md.push(new tizen.AlarmRelative(i.delay, i.period, InternalData_(i)));
@@ -266,7 +181,6 @@ AlarmManager.prototype.getAll = function () {
                 md.push(new tizen.AlarmAbsolute(date, i.second, InternalData_(i)));
             }
         });
-        _warningLogs.allow();
         return md;
     }
 };
@@ -388,10 +302,6 @@ tizen.AlarmAbsolute = function(date, second, internal) {
             } else {
                 if(!T.isNullOrUndefined(second)){
                     m_period = Converter.toLong(second);
-                    if(_warningLogs.enableLog){
-                        privUtils_.warn("This Constructor is deprecated since Tizen 4.0." +
-                        " Please consider using other constructors or other type of an alarm.");
-                    }
                 }
             }
         }
index a9e6d0052416f50c5cc71f94dc834782ae5b9ecc..8f33bc35482abca12b236f457fd674d34630191c 100755 (executable)
@@ -30,16 +30,12 @@ AlarmInstance::AlarmInstance() {
 
   RegisterSyncHandler("AlarmManager_add",
                       std::bind(&AlarmManager::Add, &manager_, _1, _2));
-  RegisterSyncHandler("AlarmManager_addAlarmNotification",
-                      std::bind(&AlarmManager::AddAlarmNotification, &manager_, _1, _2));
   RegisterSyncHandler("AlarmManager_remove",
                       std::bind(&AlarmManager::Remove, &manager_, _1, _2));
   RegisterSyncHandler("AlarmManager_removeAll",
                       std::bind(&AlarmManager::RemoveAll, &manager_, _1, _2));
   RegisterSyncHandler("AlarmManager_get",
                       std::bind(&AlarmManager::Get, &manager_, _1, _2));
-  RegisterSyncHandler("AlarmManager_getAlarmNotification",
-                      std::bind(&AlarmManager::GetAlarmNotification, &manager_, _1, _2));
   RegisterSyncHandler("AlarmManager_getAll",
                       std::bind(&AlarmManager::GetAll, &manager_, _1, _2));
   //AlarmRelative
index 306988612064c11f59eb16327938c01189fcfed1..3dc9f21cb481bb4e4ce020fe0086c93588aa0d2c 100755 (executable)
@@ -20,7 +20,6 @@
 #include <app.h>
 #include <app_alarm.h>
 #include <app_control_internal.h>
-#include <notification_internal.h>
 
 #include "common/logger.h"
 #include "common/converter.h"
@@ -30,8 +29,6 @@
 #include "alarm_instance.h"
 #include "alarm_utils.h"
 
-#include "notification/status_notification.h"
-
 using namespace common;
 using namespace common::tools;
 
@@ -41,7 +38,6 @@ namespace alarm {
 namespace {
 const int kDateSize = 22; //"yyy mm dd hh mm ss dd" e.g 115 11 28 11 25 50 -1
 const std::string kPrivilegeAlarm = "http://tizen.org/privilege/alarm";
-const std::string kPrivilegeNotification = "http://tizen.org/privilege/notification";
 
 const std::string kAlarmRelative = "AlarmRelative";
 const std::string kAlarmAbsolute = "AlarmAbsolute";
@@ -58,6 +54,15 @@ const char* kAlarmTypeValueAbsolute = "ABSOLUTE";
 const char* kAlarmTypeValueRelative = "RELATIVE";
 
 const char* kAlarmRelativeDelayKey = "RELATIVE_DELAY";
+
+const char* kSundayShort = "SU";
+const char* kMondayShort = "MO";
+const char* kTuesdayShort = "TU";
+const char* kWednesdayShort = "WE";
+const char* kThuesdayShort = "TH";
+const char* kFridayShort = "FR";
+const char* kSaturdayShort = "SA";
+
 }
 
 AlarmManager::AlarmManager() {
@@ -213,12 +218,29 @@ void AlarmManager::Add(const picojson::value& args, picojson::object& out) {
         !(it_daysOfTheWeek->second.get<picojson::array>()).empty()) {
       app_control_add_extra_data(
           app_control, kAlarmAbsoluteRecurrenceTypeKey, kAlarmAbsoluteReccurrenceTypeByDayValue);
-      const picojson::array &days_of_the_week = it_daysOfTheWeek->second.get<picojson::array>();
+      picojson::array days_of_the_week = it_daysOfTheWeek->second.get<picojson::array>();
       int repeat_value = 0;
-      PlatformResult result = util::ArrayDaysToMask(days_of_the_week, &repeat_value);
-      if (!result) {
-        LogAndReportError(PlatformResult(result.error_code(), result.message()), &out);
-        return;
+      for (auto iter = days_of_the_week.begin(); iter != days_of_the_week.end(); ++iter) {
+        auto day = (*iter).get<std::string>();
+        if (kSundayShort == day) {
+          repeat_value |= ALARM_WEEK_FLAG_SUNDAY;
+        } else if (kMondayShort == day) {
+          repeat_value |= ALARM_WEEK_FLAG_MONDAY;
+        } else if (kTuesdayShort == day) {
+          repeat_value |= ALARM_WEEK_FLAG_TUESDAY;
+        } else if (kWednesdayShort == day) {
+          repeat_value |= ALARM_WEEK_FLAG_WEDNESDAY;
+        } else if (kThuesdayShort == day) {
+          repeat_value |= ALARM_WEEK_FLAG_THURSDAY;
+        } else if (kFridayShort == day) {
+          repeat_value |= ALARM_WEEK_FLAG_FRIDAY;
+        } else if (kSaturdayShort == day) {
+          repeat_value |= ALARM_WEEK_FLAG_SATURDAY;
+        } else {
+          LogAndReportError(PlatformResult(
+              ErrorCode::TYPE_MISMATCH_ERR, "Invalid days of the week value."), &out);
+          return;
+        }
       }
       ret = alarm_schedule_with_recurrence_week_flag(
                 app_control, &start_date, repeat_value, &alarm_id);
@@ -240,223 +262,6 @@ void AlarmManager::Add(const picojson::value& args, picojson::object& out) {
   ReportSuccess(result, out);
 }
 
-void AlarmManager::AddAlarmNotification(const picojson::value& args, picojson::object& out) {
-  using namespace extension::notification;
-  LoggerD("Entered");
-  CHECK_PRIVILEGE_ACCESS(kPrivilegeAlarm, &out);
-  CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out);
-
-  if (!args.contains("alarm") || !args.contains("notification")) {
-    LogAndReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid parameter passed."),
-                      &out);
-    return;
-  }
-
-  const picojson::object& alarm = args.get("alarm").get<picojson::object>();
-
-  std::string alarm_type;
-  if (args.contains("type")) {
-    alarm_type = args.get("type").get<std::string>();
-  }
-
-  notification_h notification_handle = nullptr;
-  app_control_h app_control = nullptr;
-
-  SCOPE_EXIT {
-    notification_free(notification_handle);
-    app_control_destroy(app_control);
-  };
-
-  PlatformResult platform_result = StatusNotification::GetNotiHandleFromJson(
-      args.get<picojson::object>(),
-      false,
-      &notification_handle);
-
-  if (!platform_result) {
-    LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, platform_result.message().c_str()),
-                      &out);
-  }
-
-  platform_result = StatusNotification::GetAppControl(notification_handle, &app_control);
-
-  if (!platform_result) {
-    LogAndReportError(
-        PlatformResult(platform_result.error_code(), platform_result.message().c_str()), &out);
-  }
-
-  int alarm_id = 0;
-  int ret = 0;
-
-  if (kAlarmRelative == alarm_type) {
-    ret = app_control_add_extra_data(app_control, kAlarmKeyType, kAlarmTypeValueRelative);
-    if (ret != APP_CONTROL_ERROR_NONE) {
-      LogAndReportError(
-          PlatformResult(ErrorCode::ABORT_ERR, "Fail to add data from app_control."), &out,
-          ("Fail to add data from app_control: %d (%s)", ret, get_error_message(ret)));
-      return;
-    }
-
-    const auto it_period = alarm.find("period");
-    const auto it_delay = alarm.find("delay");
-
-    if (alarm.end() == it_delay || alarm.end() == it_period || !it_delay->second.is<double>()) {
-      LogAndReportError(PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid parameter passed."),
-                        &out);
-      return;
-    }
-
-    int delay = static_cast<int>(it_delay->second.get<double>());
-
-    std::string delay_str = std::to_string(delay);
-    ret = app_control_add_extra_data(app_control, kAlarmRelativeDelayKey, delay_str.c_str());
-    if (APP_CONTROL_ERROR_NONE != ret) {
-      LogAndReportError(
-          PlatformResult(ErrorCode::ABORT_ERR, "Fail to add data from app_control."), &out,
-          ("Fail to add data from app_control: %d (%s)", ret, get_error_message(ret)));
-      return;
-    }
-
-    platform_result = StatusNotification::SetAppControl(notification_handle, app_control);
-
-    if (!platform_result) {
-      LogAndReportError(
-          PlatformResult(platform_result.error_code(), platform_result.message().c_str()), &out);
-    }
-
-    int period = 0;
-    if (it_period->second.is<double>()) {
-      period = static_cast<int>(it_period->second.get<double>());
-    }
-
-    bool isPeriodSet = false;
-    if (args.contains("isPeriodSet")) {
-      isPeriodSet = args.get("isPeriodSet").get<bool>();
-    }
-
-    if (!isPeriodSet) {
-      ret = alarm_schedule_noti_once_after_delay(notification_handle, delay, &alarm_id);
-    } else {
-      ret = alarm_schedule_noti_after_delay(notification_handle, delay, period, &alarm_id);
-    }
-  } else {
-    if (alarm.find("period")->second.is<double>()) {
-      LogAndReportError(
-          PlatformResult(ErrorCode::INVALID_VALUES_ERR,
-                         "AlarmAbsolute constructed by deprecated constructor."),
-          &out);
-      return;
-    }
-
-    ret = app_control_add_extra_data(app_control, kAlarmKeyType, kAlarmTypeValueAbsolute);
-    if (APP_CONTROL_ERROR_NONE != ret) {
-      LogAndReportError(
-          PlatformResult(ErrorCode::ABORT_ERR, "Fail to add data from app_control."), &out,
-          ("Fail to add data from app_control: %d (%s)", ret, get_error_message(ret)));
-      return;
-    }
-
-    const auto it_daysOfTheWeek = alarm.find("daysOfTheWeek");
-    long long int milliseconds = 0;
-
-    if (args.contains("milliseconds")) {
-      milliseconds = strtoll(args.get("milliseconds").get<std::string>().c_str(), nullptr, 10);
-    }
-
-    time_t second = milliseconds / 1000;
-    struct tm start_date = { 0 };
-
-    tzset();
-    if (nullptr == localtime_r(&second, &start_date)) {
-      LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Invalid date."), &out);
-      return;
-    }
-
-    mktime(&start_date);
-
-    char str_date[kDateSize];
-
-    snprintf(str_date, sizeof(str_date), "%d %d %d %d %d %d %d", start_date.tm_year,
-             start_date.tm_mon, start_date.tm_mday, start_date.tm_hour, start_date.tm_min,
-             start_date.tm_sec, start_date.tm_isdst);
-
-    ret = app_control_add_extra_data(app_control, kAlarmAbsoluteDateKey, str_date);
-    if (APP_CONTROL_ERROR_NONE != ret) {
-      LogAndReportError(
-          PlatformResult(ErrorCode::ABORT_ERR, "Fail to add data from app_control."), &out,
-          ("Fail to add data from app_control: %d (%s)", ret, get_error_message(ret)));
-      return;
-    }
-
-    if (alarm.end() != it_daysOfTheWeek && it_daysOfTheWeek->second.is<picojson::array>()
-        && !(it_daysOfTheWeek->second.get<picojson::array>()).empty()) {
-      app_control_add_extra_data(app_control, kAlarmAbsoluteRecurrenceTypeKey,
-                                 kAlarmAbsoluteReccurrenceTypeByDayValue);
-
-      const picojson::array &days_of_the_week = it_daysOfTheWeek->second.get<picojson::array>();
-      int repeat_value = 0;
-      util::ArrayDaysToMask(days_of_the_week, &repeat_value);
-
-      platform_result = StatusNotification::SetAppControl(notification_handle, app_control);
-      if (!platform_result) {
-        LogAndReportError(
-            PlatformResult(platform_result.error_code(), platform_result.message().c_str()), &out);
-      }
-
-      ret = alarm_schedule_noti_with_recurrence_week_flag(notification_handle, &start_date,
-                                                          repeat_value, &alarm_id);
-    } else {
-      ret = app_control_add_extra_data(app_control, kAlarmAbsoluteRecurrenceTypeKey,
-                                       kAlarmAbsoluteRecurrenceTypeNone);
-      if (APP_CONTROL_ERROR_NONE != ret) {
-        LogAndReportError(
-            PlatformResult(ErrorCode::ABORT_ERR, "Fail to add data from app_control."), &out,
-            ("Fail to add data from app_control: %d (%s)", ret, get_error_message(ret)));
-        return;
-      }
-
-      platform_result = StatusNotification::SetAppControl(notification_handle, app_control);
-      if (!platform_result) {
-        LogAndReportError(
-            PlatformResult(platform_result.error_code(), platform_result.message().c_str()), &out);
-      }
-
-      ret = alarm_schedule_noti_once_at_date(notification_handle, &start_date, &alarm_id);
-    }
-  }
-
-  if (ALARM_ERROR_NONE != ret) {
-    if (ALARM_ERROR_INVALID_TIME == ret || ALARM_ERROR_INVALID_DATE == ret
-        || ALARM_ERROR_INVALID_PARAMETER == ret) {
-      platform_result = PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid data.");
-    } else {
-      platform_result = PlatformResult(ErrorCode::ABORT_ERR, "Error while adding alarm to server.");
-    }
-
-    LogAndReportError(platform_result, &out,
-                      ("Error while add alarm to server: %d (%s)", ret, get_error_message(ret)));
-    return;
-  }
-
-  picojson::value result = picojson::value(picojson::object());
-  picojson::object& result_obj = result.get<picojson::object>();
-
-  if (alarm_type == kAlarmRelative) {
-    int period = 0;
-    ret = alarm_get_scheduled_period(alarm_id, &period);
-    if (ALARM_ERROR_NONE != ret) {
-      LogAndReportError(PlatformResult(ErrorCode::UNKNOWN_ERR, "Unknown error occurred."), &out,
-                        ("Unknown error occurred: %d (%s)", ret, get_error_message(ret)));
-      return;
-    }
-    if (0 != period) {
-      result_obj.insert(std::make_pair("period", picojson::value(std::to_string(period))));
-    }
-  }
-
-  result_obj.insert(std::make_pair("id", picojson::value(std::to_string(alarm_id))));
-  ReportSuccess(result, out);
-}
-
 void AlarmManager::Remove(const picojson::value& args, picojson::object& out) {
   LoggerD("Entered");
   CHECK_PRIVILEGE_ACCESS(kPrivilegeAlarm, &out);
@@ -513,31 +318,18 @@ PlatformResult AlarmManager::GetAlarm(int id, picojson::object& obj) {
   char* alarm_type = nullptr;
   char* date_string = nullptr;
   char* delay_string = nullptr;
-  notification_h notification_handle = nullptr;
 
   SCOPE_EXIT {
     app_control_destroy(app_control);
     free(alarm_type);
     free(date_string);
     free(delay_string);
-    notification_free(notification_handle);
   };
 
-  if (ALARM_ERROR_NONE != alarm_get_app_control(id, &app_control)) {
-    if (ALARM_ERROR_NONE != alarm_get_notification(id, &notification_handle)) {
-      return LogAndCreateResult(ErrorCode::NOT_FOUND_ERR, "Alarm not found.",
-                                ("Alarm not found: %d (%s)", ret, get_error_message(ret)));
-    } else {
-      PlatformResult platform_result = extension::notification::StatusNotification::GetAppControl(
-          notification_handle, &app_control);
-      if (!platform_result) {
-        return LogAndCreateResult(
-            platform_result.error_code(),
-            platform_result.message().c_str(),
-            ("Failed to get AppControl: %d (%s)", platform_result.error_code(),
-                platform_result.message().c_str()));
-      }
-    }
+  ret = alarm_get_app_control(id, &app_control);
+  if (ALARM_ERROR_NONE != ret) {
+    return LogAndCreateResult(ErrorCode::NOT_FOUND_ERR, "Alarm not found.",
+                              ("Alarm not found: %d (%s)", ret, get_error_message(ret)));
   }
 
   ret = app_control_get_extra_data(app_control, kAlarmKeyType, &alarm_type);
@@ -595,7 +387,6 @@ PlatformResult AlarmManager::GetAlarm(int id, picojson::object& obj) {
           obj.insert(std::make_pair("second", picojson::value(picojson::array())))
           .first->second.get<picojson::array>();
 
-      using namespace util;
       if (byDayValue & ALARM_WEEK_FLAG_SUNDAY)
         array.push_back(picojson::value(kSundayShort));
       if (byDayValue & ALARM_WEEK_FLAG_MONDAY)
@@ -664,54 +455,6 @@ void AlarmManager::Get(const picojson::value& args, picojson::object& out) {
   }
 }
 
-void AlarmManager::GetAlarmNotification(const picojson::value& args, picojson::object& out) {
-  using namespace extension::notification;
-  LoggerD("Entered");
-
-  int alarm_id = 0;
-  int ret = ALARM_ERROR_NONE;
-  notification_h notification_handle = nullptr;
-  PlatformResult platform_result = PlatformResult(ErrorCode::NO_ERROR);
-
-  SCOPE_EXIT {
-    notification_free(notification_handle);
-  };
-
-  if (args.contains("id") && args.get("id").is<double>()) {
-    alarm_id = static_cast<int>(args.get("id").get<double>());
-  }
-
-  ret = alarm_get_notification(alarm_id, &notification_handle);
-
-  if (ALARM_ERROR_NONE != ret) {
-    if (ALARM_ERROR_INVALID_PARAMETER == ret) {
-      platform_result = PlatformResult(ErrorCode::NOT_FOUND_ERR,
-                                       "Alarm with given ID was not found.");
-    } else {
-      platform_result = PlatformResult(ErrorCode::ABORT_ERR, "Failed to get notification.");
-    }
-    LogAndReportError(platform_result, &out);
-  }
-
-  app_control_h app_control = nullptr;
-  platform_result = StatusNotification::GetAppControl(notification_handle, &app_control);
-
-  if (!platform_result) {
-    LogAndReportError(platform_result, &out);
-  }
-
-  picojson::value result = picojson::value(picojson::object());
-  picojson::object& result_obj = result.get<picojson::object>();
-
-  platform_result = StatusNotification::ToJson(-1, notification_handle, app_control, &result_obj);
-
-  if (ALARM_ERROR_NONE != ret) {
-    LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed ToJson()."), &out);
-  }
-
-  ReportSuccess(result, out);
-}
-
 static bool AlarmIterateCB(int alarm_id, void *user_data) {
   LoggerD("Enter");
 
index 292078711ffc41071a80ab915e68f1d6aae8ce76..1ad2701f7a38cef08b207cffb5a042fa951919bd 100755 (executable)
@@ -29,11 +29,9 @@ class AlarmManager {
   virtual ~AlarmManager();
 
   void Add(const picojson::value& args, picojson::object& out);
-  void AddAlarmNotification(const picojson::value& args, picojson::object& out);
   void Remove(const picojson::value& args, picojson::object& out);
   void RemoveAll(const picojson::value& args, picojson::object& out);
   void Get(const picojson::value& args, picojson::object& out);
-  void GetAlarmNotification(const picojson::value& args, picojson::object& out);
   void GetAll(const picojson::value& args, picojson::object& out);
 
   //AlarmRelative
index 5d725447e1c8b31971e92e6fe8e80ef29603abb9..1c9ee9d58b824d9829ac2c7c85613258ce41cea3 100755 (executable)
@@ -22,14 +22,6 @@ namespace extension {
 namespace alarm {
 namespace util {
 
-const char* kSundayShort = "SU";
-const char* kMondayShort = "MO";
-const char* kTuesdayShort = "TU";
-const char* kWednesdayShort = "WE";
-const char* kThuesdayShort = "TH";
-const char* kFridayShort = "FR";
-const char* kSaturdayShort = "SA";
-
 using namespace common;
 
 PlatformResult AppControlToService(const picojson::object& obj, app_control_h *app_control) {
@@ -136,31 +128,6 @@ PlatformResult AppControlToServiceExtraData(const picojson::object& app_obj,
   return PlatformResult(ErrorCode::NO_ERROR);
 }
 
-PlatformResult ArrayDaysToMask(const picojson::array &days_of_the_week, int *repeat_value) {
-  LoggerD("Entered");
-  for (auto iter = days_of_the_week.begin(); iter != days_of_the_week.end(); ++iter) {
-    auto day = (*iter).get<std::string>();
-    if (kSundayShort == day) {
-      *repeat_value |= ALARM_WEEK_FLAG_SUNDAY;
-    } else if (kMondayShort == day) {
-      *repeat_value |= ALARM_WEEK_FLAG_MONDAY;
-    } else if (kTuesdayShort == day) {
-      *repeat_value |= ALARM_WEEK_FLAG_TUESDAY;
-    } else if (kWednesdayShort == day) {
-      *repeat_value |= ALARM_WEEK_FLAG_WEDNESDAY;
-    } else if (kThuesdayShort == day) {
-      *repeat_value |= ALARM_WEEK_FLAG_THURSDAY;
-    } else if (kFridayShort == day) {
-      *repeat_value |= ALARM_WEEK_FLAG_FRIDAY;
-    } else if (kSaturdayShort == day) {
-      *repeat_value |= ALARM_WEEK_FLAG_SATURDAY;
-    } else {
-      return LogAndCreateResult(ErrorCode::TYPE_MISMATCH_ERR, "Invalid days of the week value.");
-    }
-  }
-  return PlatformResult(ErrorCode::NO_ERROR);
-}
-
 } // util
 } // alarm
 } // extension
index 048fea325662e3985eb13c128fad527df3eef1f8..a513f0d84ed2fa8c6109e8f77cc8852cf24ef4a3 100755 (executable)
@@ -18,7 +18,6 @@
 #define ALARM_ALARM_UTILS_H_
 
 #include <app_control.h>
-#include <app_alarm.h>
 
 #include "common/picojson.h"
 #include "common/platform_result.h"
@@ -27,19 +26,9 @@ namespace extension {
 namespace alarm {
 namespace util {
 
-extern const char* kSundayShort;
-extern const char* kMondayShort;
-extern const char* kTuesdayShort;
-extern const char* kWednesdayShort;
-extern const char* kThuesdayShort;
-extern const char* kFridayShort;
-extern const char* kSaturdayShort;
-
 common::PlatformResult AppControlToService(const picojson::object& obj, app_control_h *app_control);
 common::PlatformResult AppControlToServiceExtraData(const picojson::object& app_obj,
                                                     app_control_h *app_control);
-common::PlatformResult ArrayDaysToMask(const picojson::array &days_of_the_week,
-                                                    int *repeat_value);
 } // util
 } // alarm
 } // extension
index 38d04d045fcc5df0f909ed8fba12bd019b903c50..40b614fb8e2a6222f9c15240f4f2be4f5e76312e 100644 (file)
@@ -33,8 +33,7 @@
             'packages': [
               'aul',
               'capi-appfw-app-manager',
-              'capi-appfw-app-control',
-              'capi-appfw-event',
+              'capi-appfw-application',
               'capi-appfw-package-manager',
               'pkgmgr',
               'pkgmgr-info',
             ]
           },
         }],
-        ['extension_host_os == "mobile"', {
-          'variables': {
-            'packages': [
-              'capi-context',
-            ]
-          }
-        }],
       ],
     },
   ],
index d1e57ebb3d27b54c60a48fe20d70456186ae0b3e..b668dbbb8e331b411745608f3dceb9555a39739d 100755 (executable)
@@ -496,44 +496,6 @@ ApplicationManager.prototype.getAppMetaData = function() {
   }
 };
 
-ApplicationManager.prototype.getBatteryUsageInfo = function() {
-  var args = AV.validateMethod(arguments, [
-  {
-    name: 'days',
-    type: AV.Types.LONG,
-    optional: true,
-    nullable: true
-  },
-  {
-    name: 'limit',
-    type: AV.Types.LONG,
-    optional: true,
-    nullable: true
-  }]);
-
-  var callArgs = {};
-
-  if (!T.isNullOrUndefined(args.days)) {
-    callArgs.days = args.days;
-  }
-
-  if (!T.isNullOrUndefined(args.limit)) {
-    callArgs.limit = args.limit;
-  }
-
-  var result = native.callSync('ApplicationManager_getBatteryUsageInfo', callArgs);
-  if (native.isFailure(result)) {
-    throw native.getErrorObject(result);
-  } else {
-    var metaData = native.getResultObject(result);
-    var data = [];
-    metaData.forEach(function(i) {
-      data.push(new ApplicationBatteryUsage(i));
-    });
-    return data;
-  }
-};
-
 function ListenerManager(native, listenerName) {
   this.listeners = {};
   this.nextId = 1;
@@ -631,110 +593,6 @@ ApplicationManager.prototype.removeAppInfoEventListener = function() {
   applicationEventListener.removeListener(args.watchId);
 };
 
-function StatusListenerManager(native, listenerName) {
-  this.listeners = {};
-  this.listenersCount = 0;
-  this.nextId = 1;
-  this.nativeSet = false;
-  this.native = native;
-  this.listenerName = listenerName;
-};
-
-StatusListenerManager.prototype.onListenerCalled = function(msg) {
-  var statusType = msg.statusType;
-  var app_id = msg.appId;
-
-  for (var watchId in this.listeners) {
-    if (this.listeners.hasOwnProperty(watchId)) {
-      var listener = this.listeners[watchId];
-      if (!listener.appId || listener.appId === app_id) {
-        listener.callback(app_id, statusType);
-      }
-    }
-  }
-};
-
-StatusListenerManager.prototype.addListener = function(callback, appId) {
-  if (!this.nativeSet) {
-    var result = this.native.callSync('ApplicationManager_addAppStatusChangeListener');
-    if (this.native.isFailure(result)) {
-      throw this.native.getErrorObject(result);
-    }
-
-    this.native.addListener(this.listenerName, this.onListenerCalled.bind(this));
-    this.nativeSet = true;
-  }
-
-  var listener = {
-    'callback' : callback,
-    'appId' : appId
-  };
-
-  var id = this.nextId++;
-  this.listeners[id] = listener;
-  this.listenersCount++;
-
-  return id;
-};
-
-StatusListenerManager.prototype.removeListener = function(watchId) {
-  if (this.listeners.hasOwnProperty(watchId)) {
-    if (this.listenersCount > 1) {
-      delete this.listeners[watchId];
-      this.listenersCount--;
-      return;
-    }
-
-    if (this.nativeSet) {
-      var result = this.native.callSync('ApplicationManager_removeStatusChangeListener');
-      if (this.native.isFailure(result)) {
-        throw this.native.getErrorObject(result);
-      }
-
-      delete this.listeners[watchId];
-      this.listenersCount--;
-
-      this.native.removeListener(this.listenerName);
-      this.nativeSet = false;
-    }
-  }
-};
-
-var APP_STATUS_CHANGE_LISTENER = 'AppStatusChangeListener';
-var appStatusChangeListener = new StatusListenerManager(native, APP_STATUS_CHANGE_LISTENER);
-
-ApplicationManager.prototype.addAppStatusChangeListener = function() {
-  var args = AV.validateMethod(arguments, [
-      {
-        name : 'statusChangeListener',
-        type : AV.Types.FUNCTION,
-      },
-      {
-        name : 'appId',
-        type : AV.Types.STRING,
-        optional : true,
-        nullable : true
-      }
-  ]);
-
-  if (args.appId !== undefined && args.appId !== null && !args.appId.length) {
-    throw new WebAPIException(WebAPIException.INVALID_VALUES_ERR, 'Application id is empty');
-  }
-
-  return appStatusChangeListener.addListener(args.statusChangeListener, args.appId);
-};
-
-ApplicationManager.prototype.removeAppStatusChangeListener = function() {
-  var args = AV.validateMethod(arguments, [
-      {
-        name : 'watchId',
-        type : AV.Types.LONG
-      }
-  ]);
-
-  appStatusChangeListener.removeListener(args.watchId);
-};
-
 // class Application ////////////////////////////////////////////////////
 
 function Application(data) {
@@ -1265,21 +1123,5 @@ function ApplicationMetaData(data) {
   });
 }
 
-//class ApplicationBatteryUsage ////////////////////////////////////////////////////
-function ApplicationBatteryUsage(data) {
-  Object.defineProperties(this, {
-    appId : {
-      value : data.appId,
-      writable : false,
-      enumerable : true
-    },
-    batteryUsage : {
-      value : data.batteryUsage,
-      writable : false,
-      enumerable : true
-    }
-  });
-}
-
 // exports ////////////////////////////////////////////////////
 exports = new ApplicationManager();
index eb4ee2ddb41d10beb9ad69eff78c865f56c60948..cb8d850ae56785343748ccdf27fcfddaddca77db 100755 (executable)
@@ -32,7 +32,6 @@ const std::string kPrivilegeAppManagerCertificate = "http://tizen.org/privilege/
 const std::string kPrivilegeAppManagerKill = "http://tizen.org/privilege/appmanager.kill";
 const std::string kPrivilegeApplicationInfo = "http://tizen.org/privilege/application.info";
 const std::string kPrivilegeApplicationLaunch = "http://tizen.org/privilege/application.launch";
-const std::string kPrivilegeAppHistoryRead = "http://tizen.org/privilege/apphistory.read";
 }  // namespace
 
 using namespace common;
@@ -60,11 +59,8 @@ ApplicationInstance::ApplicationInstance() :
   REGISTER_SYNC("ApplicationManager_getAppCerts", GetAppCerts);
   REGISTER_SYNC("ApplicationManager_getAppSharedURI", GetAppSharedURI);
   REGISTER_SYNC("ApplicationManager_getAppMetaData", GetAppMetaData);
-  REGISTER_SYNC("ApplicationManager_getBatteryUsageInfo", GetBatteryUsageInfo);
   REGISTER_SYNC("ApplicationManager_addAppInfoEventListener", AddAppInfoEventListener);
   REGISTER_SYNC("ApplicationManager_removeAppInfoEventListener", RemoveAppInfoEventListener);
-  REGISTER_SYNC("ApplicationManager_addAppStatusChangeListener", AddStatusListener);
-  REGISTER_SYNC("ApplicationManager_removeStatusChangeListener", RemoveStatusListener);
 
   //Application
   REGISTER_SYNC("Application_getRequestedAppControl", GetRequestedAppControl);
@@ -161,13 +157,6 @@ void ApplicationInstance::GetAppMetaData(const picojson::value& args, picojson::
   manager_.GetAppMetaData(app_id, &out);
 }
 
-void ApplicationInstance::GetBatteryUsageInfo(const picojson::value& args, picojson::object& out) {
-  LoggerD("Entered");
-  CHECK_PRIVILEGE_ACCESS(kPrivilegeAppHistoryRead, &out);
-
-  manager_.GetBatteryUsageInfo(args, &out);
-}
-
 void ApplicationInstance::AddAppInfoEventListener(const picojson::value& args, picojson::object& out) {
   LoggerD("Entered");
   LoggerW("DEPRECATION WARNING: addAppInfoEventListener() is deprecated and will be removed from next release. "
@@ -298,31 +287,5 @@ void ApplicationInstance::RemoveEventListener(const picojson::value& args, picoj
   manager_.StopEventListener(event_name);
 }
 
-void ApplicationInstance::AddStatusListener(const picojson::value& args, picojson::object& out) {
-  LoggerD("Entered");
-
-  JsonCallback cb = [this](picojson::value* event) -> void {
-    Instance::PostMessage(this, event->serialize().c_str());
-  };
-
-  PlatformResult result = manager_.StartStatusListener(cb);
-  if (result) {
-    ReportSuccess(out);
-  } else {
-    LogAndReportError(result, &out);
-  }
-}
-
-void ApplicationInstance::RemoveStatusListener(const picojson::value& args, picojson::object& out) {
-  LoggerD("Entered");
-
-  PlatformResult result = manager_.StopStatusChangeListener();
-  if (result) {
-    ReportSuccess(out);
-  } else {
-    LogAndReportError(result, &out);
-  }
-}
-
 }  // namespace application
 }  // namespace extension
index 3ae6c32640a102d105029db4feb9f06fc7de4094..cb99cbb4e99b65abddfc3517b52c0ac973df9af9 100755 (executable)
@@ -38,7 +38,6 @@ class ApplicationInstance: public common::ParsedInstance {
   void GetAppCerts(const picojson::value& args, picojson::object& out);
   void GetAppSharedURI(const picojson::value& args, picojson::object& out);
   void GetAppMetaData(const picojson::value& args, picojson::object& out);
-  void GetBatteryUsageInfo(const picojson::value& args, picojson::object& out);
   void AddAppInfoEventListener(const picojson::value& args, picojson::object& out);
   void RemoveAppInfoEventListener(const picojson::value& args, picojson::object& out);
   void GetRequestedAppControl(const picojson::value& args, picojson::object& out);
@@ -55,8 +54,6 @@ class ApplicationInstance: public common::ParsedInstance {
   void BroadcastTrustedEvent(const picojson::value& args, picojson::object& out);
   void AddEventListener(const picojson::value& args, picojson::object& out);
   void RemoveEventListener(const picojson::value& args, picojson::object& out);
-  void AddStatusListener(const picojson::value& args, picojson::object& out);
-  void RemoveStatusListener(const picojson::value& args, picojson::object& out);
 
   ApplicationManager manager_;
   Application current_application_;
index 8af357a9324637b3d6d1c931d687a5fe4db5607f..0d8ed503ef93f9be943b46e0d48c2aab5fe69c65 100755 (executable)
@@ -20,6 +20,7 @@
 #include <unistd.h>
 
 #include <app_info.h>
+#include <app_manager.h>
 #include <app_manager_extension.h>
 #include <aul.h>
 #include <pkgmgr_installer.h>
@@ -29,9 +30,6 @@
 #include <bundle_internal.h>
 #include <appsvc.h>
 #include <app_control_internal.h>
-#ifdef TIZEN_MOBILE
-#include <context-service/context_history.h>
-#endif
 
 #include "common/current_application.h"
 #include "common/logger.h"
@@ -70,10 +68,6 @@ const std::string kOnInstalled = "oninstalled";
 const std::string kOnUpdated = "onupdated";
 const std::string kOnUninstalled = "onuninstalled";
 const std::string kData = "data";
-const std::string kStatusType = "statusType";
-const std::string kAppId = "appId";
-const std::string kListenerId = "listenerId";
-const std::string kAppStatusChangeListener = "AppStatusChangeListener";
 
 const std::map<std::string, std::string> event_map_ = {
   {SYSTEM_EVENT_BATTERY_CHARGER_STATUS, EVENT_KEY_BATTERY_CHARGER_STATUS},
@@ -104,22 +98,13 @@ const std::map<std::string, std::string> event_map_ = {
 ApplicationManager::ApplicationManager(ApplicationInstance& instance) :
   pkgmgr_client_handle_(nullptr),
   pkgmgr_client_uninstall_handle_(nullptr),
-  instance_(instance),
-  app_status_handle_(nullptr) {
+  instance_(instance) {
     LoggerD("Enter");
 }
 
 ApplicationManager::~ApplicationManager() {
   LoggerD("Enter");
   StopAppInfoEventListener();
-  StopStatusChangeListener();
-
-  if (app_status_handle_) {
-    int ret = app_manager_event_destroy(app_status_handle_);
-    if (APP_MANAGER_ERROR_NONE != ret) {
-      LoggerE ("app_manager_event_destroy failed, error: %d", ret);
-    }
-  }
 }
 
 void ApplicationManager::GetCurrentApplication(const std::string& app_id,
@@ -1158,132 +1143,6 @@ void ApplicationManager::GetAppSharedUri(const std::string& app_id, picojson::ob
   ReportSuccess(result, *out);
 }
 
-void ApplicationManager::GetBatteryUsageInfo(const picojson::value& args, picojson::object* out) {
-  LoggerD("Entered");
-
-#ifdef TIZEN_MOBILE
-  context_history_list_h list = nullptr;
-  context_history_h handle = nullptr;
-  context_history_filter_h filter = nullptr;
-
-  SCOPE_EXIT {
-    context_history_list_destroy(list);
-    context_history_destroy(handle);
-    context_history_filter_destroy(filter);
-  };
-
-  int ret = context_history_create(&handle);
-  if (CONTEXT_HISTORY_ERROR_NONE != ret) {
-    LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to create context handle."), out,
-                      ("Failed to create context handle: %d (%s)", ret, get_error_message(ret)));
-    return;
-  }
-
-  ret = context_history_filter_create(&filter);
-  if (CONTEXT_HISTORY_ERROR_NONE != ret) {
-    LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to create filter handle."), out,
-                      ("Failed to create filter handle: %d (%s)", ret, get_error_message(ret)));
-    return;
-  }
-
-  if (args.contains("limit")) {
-    const int limit = static_cast<int>(args.get("limit").get<double>());
-    ret = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_RESULT_SIZE, limit);
-
-    if (CONTEXT_HISTORY_ERROR_NONE != ret) {
-      LogAndReportError(
-          PlatformResult(ErrorCode::INVALID_VALUES_ERR, "limit given with invalid value."), out,
-          ("limit given with invalid value: %d (%s)", ret, get_error_message(ret)));
-      return;
-    }
-  }
-
-  context_history_data_e date_type = CONTEXT_HISTORY_RECENT_BATTERY_USAGE;
-  if (args.contains("days")) {
-    const int days = static_cast<int>(args.get("days").get<double>());
-    date_type = CONTEXT_HISTORY_BATTERY_USAGE;
-    ret = context_history_filter_set_int(filter, CONTEXT_HISTORY_FILTER_TIME_SPAN, days);
-
-    if (CONTEXT_HISTORY_ERROR_NONE != ret) {
-      LogAndReportError(
-          PlatformResult(ErrorCode::INVALID_VALUES_ERR, "days given with invalid value."), out,
-          ("days given with invalid value: %d (%s)", ret, get_error_message(ret)));
-      return;
-    }
-  }
-
-  ret = context_history_get_list(handle, date_type, filter, &list);
-  if (CONTEXT_HISTORY_ERROR_NONE != ret) {
-    LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to get list."), out,
-                      ("Failed to get list: %d (%s)", ret, get_error_message(ret)));
-    return;
-  }
-
-  int size = 0;
-  ret = context_history_list_get_count(list, &size);
-  if (CONTEXT_HISTORY_ERROR_NONE != ret) {
-    LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to get list size."), out,
-                      ("Failed to get list size: %d (%s)", ret, get_error_message(ret)));
-    return;
-  }
-
-  double amount;
-  char* app_id;
-
-  context_history_record_h record;
-  picojson::value result_array = picojson::value(
-      picojson::array(size, picojson::value(picojson::object())));
-  picojson::array& array_obj = result_array.get<picojson::array>();
-
-  for (int i = 0; i < size; ++i) {
-    SCOPE_EXIT {
-      free(app_id);
-      context_history_record_destroy(record);
-    };
-
-    app_id = nullptr;
-    record = nullptr;
-
-    picojson::object& object = array_obj[i].get<picojson::object>();
-
-    ret = context_history_list_get_current(list, &record);
-    if (CONTEXT_HISTORY_ERROR_NONE != ret) {
-      LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to current record."), out,
-                        ("Failed to get current record: %d (%s)", ret, get_error_message(ret)));
-      return;
-    }
-
-    ret = context_history_record_get_string(record, CONTEXT_HISTORY_APP_ID, &app_id);
-    if (CONTEXT_HISTORY_ERROR_NONE != ret) {
-      LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to get string."), out,
-                        ("Failed to get string: %d (%s)", ret, get_error_message(ret)));
-      return;
-    }
-    object.insert(std::make_pair("appId", picojson::value(app_id)));
-
-    ret = context_history_record_get_double(record, CONTEXT_HISTORY_TOTAL_AMOUNT, &amount);
-    if (CONTEXT_HISTORY_ERROR_NONE != ret) {
-      LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to get amount."), out,
-                        ("Failed to get amount: %d (%s)", ret, get_error_message(ret)));
-      return;
-    }
-    object.insert(std::make_pair("batteryUsage", picojson::value(amount)));
-
-    ret = context_history_list_move_next(list);
-    if (CONTEXT_HISTORY_ERROR_NONE != ret && CONTEXT_HISTORY_ERROR_NO_DATA != ret) {
-      LogAndReportError(PlatformResult(ErrorCode::ABORT_ERR, "Failed to move iterator."), out,
-                        ("Failed to move iterator: %d (%s)", ret, get_error_message(ret)));
-      return;
-    }
-  }
-  ReportSuccess(result_array, *out);
-#else
-  // 20170510 Context API is supported only for mobile profile, other ones would result with NotSupportedError
-  LogAndReportError(PlatformResult(ErrorCode::NOT_SUPPORTED_ERR, "This feature is not supported on this profile."), out,
-                    ("NOT_SUPPORTED_ERR: This feature is not supported on this profile"));
-#endif
-}
-
 void ApplicationManager::GetAppMetaData(const std::string& app_id, picojson::object* out) {
   LoggerD("Entered");
 
@@ -1767,89 +1626,5 @@ void ApplicationManager::StopEventListener(const std::string& event_name) {
   }
 }
 
-void ApplicationManager::OnStatusEvent(const char *type, const char *app_id,
-                                       app_manager_event_type_e event_type,
-                                       app_manager_event_state_e event_state,
-                                       app_manager_event_h handle, void *user_data) {
-  LoggerD("Entered");
-
-  if (APP_MANAGER_EVENT_STATE_COMPLETED != event_state) {
-    LoggerD("State different from completed");
-    return;
-  }
-
-  ApplicationManager* manager = static_cast<ApplicationManager*>(user_data);
-
-  if (!manager || !manager->status_callback_) {
-    LoggerD("No event listener registered, skipping.");
-    return;
-  }
-
-  bool status_type;
-  switch (event_type) {
-    case APP_MANAGER_EVENT_ENABLE_APP:
-      status_type = true;
-      break;
-    case APP_MANAGER_EVENT_DISABLE_APP:
-      status_type = false;
-      break;
-    default:
-      LoggerD("Uknown status type skipping.");
-      return;
-  }
-
-  picojson::value event = picojson::value(picojson::object());
-  picojson::object& event_o = event.get<picojson::object>();
-
-  event_o[kStatusType] = picojson::value(status_type);
-  event_o[kAppId] = picojson::value(app_id);
-  event_o[kListenerId] = picojson::value(kAppStatusChangeListener);
-
-  manager->status_callback_(&event);
-}
-
-PlatformResult ApplicationManager::StartStatusListener(const JsonCallback& callback) {
-  LoggerD("Entered");
-
-  int ret = APP_MANAGER_ERROR_NONE;
-
-  if (!app_status_handle_) {
-    ret = app_manager_event_create(&app_status_handle_);
-    if (APP_MANAGER_ERROR_NONE != ret) {
-      return LogAndCreateResult(ErrorCode::ABORT_ERR, "Error while creating event handle",
-                                ("app_manager_event_create failed, error: %d", ret));
-    }
-
-    ret = app_manager_event_set_status(app_status_handle_, APP_MANAGER_EVENT_STATUS_TYPE_ALL);
-    if (APP_MANAGER_ERROR_NONE != ret) {
-      return LogAndCreateResult(ErrorCode::ABORT_ERR, "Error while setting status type",
-                                ("app_manager_event_set_status failed, error: %d", ret));
-    }
-  }
-
-  status_callback_ = callback;
-  ret = app_manager_set_event_cb(app_status_handle_, OnStatusEvent, this);
-  if (APP_MANAGER_ERROR_NONE != ret) {
-    return LogAndCreateResult(ErrorCode::ABORT_ERR, "Error while setting status listener",
-                              ("app_manager_set_event_cb failed, error: %d", ret));
-  }
-
-  return PlatformResult(ErrorCode::NO_ERROR);
-}
-
-PlatformResult ApplicationManager::StopStatusChangeListener() {
-  LoggerD("Entered");
-
-  if (app_status_handle_) {
-    int ret = app_manager_unset_event_cb(app_status_handle_);
-    if (APP_MANAGER_ERROR_NONE != ret) {
-      return LogAndCreateResult(ErrorCode::ABORT_ERR, "Error while removing status listener",
-                                ("app_manager_unset_event_cb failed, error: %d", ret));
-    }
-  }
-
-  return PlatformResult(ErrorCode::NO_ERROR);
-}
-
 } // namespace application
 } // namespace extension
index f80ddc1b2ee2a64cbcdc1ae97f8574b8f83ef40a..f5585b3c13fe2fbcf1e6fe8239993c9cf84bd34f 100755 (executable)
@@ -18,7 +18,6 @@
 #define SRC_APPLICATION_APPLICATION_MANAGER_H__
 
 #include <app_event.h>
-#include <app_manager.h>
 #include <bundle.h>
 #include <functional>
 #include <memory>
@@ -53,7 +52,6 @@ class ApplicationManager {
   void GetAppCerts(const std::string& app_id, picojson::object* out);
   void GetAppSharedUri(const std::string& app_id, picojson::object* out);
   void GetAppMetaData(const std::string& app_id, picojson::object* out);
-  void GetBatteryUsageInfo(const picojson::value& args, picojson::object* out);
   void StartAppInfoEventListener(picojson::object* out);
   void StopAppInfoEventListener();
   void GetApplicationInformationSize(const picojson::value& args, picojson::object* out);
@@ -63,8 +61,6 @@ class ApplicationManager {
   common::PlatformResult StartEventListener(const std::string& event_name,
                                             const JsonCallback& callback);
   void StopEventListener(const std::string& event_name);
-  common::PlatformResult StartStatusListener(const JsonCallback& callback);
-  common::PlatformResult StopStatusChangeListener();
 
  private:
   char* GetPackageId(const std::string& app_id);
@@ -72,19 +68,12 @@ class ApplicationManager {
   pkgmgr_client* pkgmgr_client_handle_;
   pkgmgr_client* pkgmgr_client_uninstall_handle_;
   ApplicationInstance& instance_;
-  app_manager_event_h app_status_handle_;
 
   JsonCallback event_callback_;
-  JsonCallback status_callback_;
   std::map<std::string, event_handler_h> event_handler_map_;
   static void OnEvent(const char* event_name,
                       bundle* event_data,
                       void* user_data);
-  static void OnStatusEvent(const char *type, const char *app_id,
-                            app_manager_event_type_e event_type,
-                            app_manager_event_state_e event_state,
-                            app_manager_event_h handle,
-                            void *user_data);
 };
 
 } // namespace application
index 8981306356549b430fe181517db3a263a3f06aa7..72eb206832d188bda084cd2fbf20661a77d0f642 100644 (file)
@@ -50,7 +50,6 @@
          'variables': {
             'packages': [
               'capi-network-bluetooth',
-              'capi-appfw-app-control',
               'capi-system-info',
               'libpcrecpp',
             ]
index 64404f8e3468c89044f089f62bdfd52dff2cbb9b..7f4e78e7e0f55df939c808f5cfa128a31a841e05 100644 (file)
@@ -68,7 +68,7 @@
           'variables': {
             'packages': [
               'capi-appfw-app-manager',
-              'capi-appfw-app-common',
+              'capi-appfw-application',
               'capi-appfw-package-manager',
               'storage',
               'security-privilege-manager',
index 86343755b159c94b182ed19a55fc87238bf85b6f..4ad3807ba55fb9e29f3c98ff975e71fb906d3237 100644 (file)
@@ -412,11 +412,7 @@ common::TizenResult ConvergenceInstance::RemoteAppControlServiceLaunchAppControl
                                          static_cast<int>(ConvergenceUtils::GetArg(args, kJSCurrentListenerId).get<double>()));
     }
 
-    //only in case of failure call callback
-    //other cases are handled by conv_service_listener_cb()
-    if (!result) {
-      this->Post(token, result);
-    }
+    this->Post(token, result);
   };
 
   std::thread(launch_app_control, token).detach();
@@ -453,7 +449,7 @@ common::TizenResult ConvergenceInstance::AppCommunicationServiceStart(const pico
       auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel);
       std::vector<ConvergenceChannel*>::iterator channel_it = service->GetChannel(channel_arg);
 
-      if (service->opened_channels.end() != channel_it) {
+      if (service->IsChannelStarted(channel_it)) {
         result = LogAndCreateTizenError(InvalidStateError, "Service is already started for the channel.",
           ("Service is already started for the channel."));
       } else {
@@ -505,7 +501,7 @@ common::TizenResult ConvergenceInstance::AppCommunicationServiceSend(const picoj
       auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel);
       std::vector<ConvergenceChannel*>::iterator channel_it = service->GetChannel(channel_arg);
 
-      if (service->opened_channels.end() == channel_it) {
+      if (!service->IsChannelStarted(channel_it)) {
         result = LogAndCreateTizenError(InvalidStateError, "Service is not started for the channel.",
           ("Service is not started for the channel."));
       } else {
@@ -556,7 +552,7 @@ common::TizenResult ConvergenceInstance::AppCommunicationServiceStop(const picoj
       auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel);
       std::vector<ConvergenceChannel*>::iterator channel_it = service->GetChannel(channel_arg);
 
-      if (service->opened_channels.end() == channel_it) {
+      if (!service->IsChannelStarted(channel_it)) {
         result = LogAndCreateTizenError(InvalidStateError, "Service is not started for the channel.",
           ("Service is not started for the channel."));
       } else {
@@ -609,7 +605,7 @@ common::TizenResult ConvergenceInstance::AppCommunicationServiceGetClientList(co
       auto channel_arg = ConvergenceUtils::GetArg(args, kJSArgumentChannel);
       std::vector<ConvergenceChannel*>::iterator channel_it = service->GetChannel(channel_arg);
 
-      if (service->opened_channels.end() == channel_it) {
+      if (!service->IsChannelStarted(channel_it)) {
         result = LogAndCreateTizenError(InvalidStateError, "Service is not started for the channel.",
           ("Service is not started for the channel."));
       } else {
index 70f00c9ff98c3f09e7d391d8da80a44bfa6481c0..7116645dc2efa2e6fe321e8a02073846d6306edb 100644 (file)
@@ -128,7 +128,6 @@ TizenResult ConvergenceRemoteAppControlService::Disconnect() {
   }
 
   int error = conv_service_disconnect(service);
-
   if (CONV_ERROR_NONE != error) {
     return LogAndCreateTizenError(AbortError, "conv_service_disconnect [Fail]");
   } else {
index f2b2bbe2cbd6fa38379c23626dd55fb0c9632fa1..29992d7bba655de07980f5e163400f65c2ef396e 100644 (file)
@@ -203,6 +203,11 @@ std::vector<ConvergenceChannel*>::iterator ConvergenceService::GetChannel(const
   return opened_channels.end();
 }
 
+bool ConvergenceService::IsChannelStarted(std::vector<ConvergenceChannel*>::iterator it) {
+  ScopeLogger();
+  return it != opened_channels.end();
+}
+
 void ConvergenceService::RemoveChannel(std::vector<ConvergenceChannel*>::iterator it) {
   ScopeLogger();
   opened_channels.erase(it);
index 9f4b4e452bb2e77b0155a3bbe10e03e720a1bd44..42ff0a6544d51f05fa05ed68c418417b07d4b21f 100644 (file)
@@ -46,13 +46,13 @@ class ConvergenceService {
  public:
   void Refresh();
   std::vector<ConvergenceChannel*>::iterator GetChannel(const picojson::value &channel_json);
+  bool IsChannelStarted(std::vector<ConvergenceChannel*>::iterator);
   void RemoveChannel(std::vector<ConvergenceChannel*>::iterator);
 
  public:
   //conv_service_e get_type() const { return type_; }
   //conv_device_h get_device() const {return device_; }
   picojson::value ToJson() const;
-  std::vector<ConvergenceChannel*> opened_channels;
 
  protected:
   conv_service_h FindServiceHandle() const;
@@ -68,6 +68,7 @@ class ConvergenceService {
   conv_device_h device_; // TODO rename to device_handle_
   conv_service_e type_;
   mutable conv_service_h service_handle_;
+  std::vector<ConvergenceChannel*> opened_channels;
   friend class ConvergenceAppCommunicationServerService; // It is needed to register the local service
  private:
   conv_service_connection_state_e connection_state_;
index f14cac2044042d76336b683735aaf8631a67ad6a..bbe9a7c0bd93ada9e26636d7d40962674005feb7 100644 (file)
@@ -97,7 +97,6 @@ common::TizenResult ConvergenceUtils::ConvertConvergenceError(int error) {
   }
 
   return common::TizenSuccess();
-
 }
 
 } // namespace convergence
diff --git a/src/humanactivitymonitor/gesture_manager.cc b/src/humanactivitymonitor/gesture_manager.cc
deleted file mode 100644 (file)
index 050d79e..0000000
+++ /dev/null
@@ -1,413 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    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.
- */
-
-#include "humanactivitymonitor/gesture_manager.h"
-
-#include <gesture_recognition.h>
-
-#include "common/logger.h"
-#include "common/optional.h"
-#include "common/picojson.h"
-#include "common/tools.h"
-#include "common/scope_exit.h"
-#include "common/extension.h"
-
-namespace extension {
-namespace humanactivitymonitor {
-
-using common::PlatformResult;
-using common::ErrorCode;
-using common::tools::ReportError;
-using common::tools::ReportSuccess;
-
-namespace {
-
-const std::string kListenerId = "listenerId";
-const std::string kListener = "GestureRecognitionListener";
-const std::string kType = "type";
-const std::string kTimestamp = "timestamp";
-const std::string kAlwayOn = "alwaysOn";
-const std::string kAction = "action";
-const std::string kEvent = "event";
-const std::string kError = "error";
-const std::string kOnError = "onerror";
-const std::string kOnDetect = "ondetect";
-
-ErrorCode getErrorCode(int error) {
-  switch (error) {
-    case GESTURE_ERROR_NONE:
-      return ErrorCode::NO_ERROR;
-    case GESTURE_ERROR_INVALID_PARAMETER:
-      return ErrorCode::INVALID_VALUES_ERR;
-    case GESTURE_ERROR_OPERATION_FAILED:
-      return ErrorCode::IO_ERR;
-    case GESTURE_ERROR_NOT_SUPPORTED:
-      return ErrorCode::NOT_SUPPORTED_ERR;
-    case GESTURE_ERROR_INVALID_OPERATION:
-    case GESTURE_ERROR_OUT_OF_MEMORY:
-    case GESTURE_ERROR_PERMISSION_DENIED:
-    case GESTURE_ERROR_ALREADY_STARTED:
-    case GESTURE_ERROR_NOT_STARTED:
-    default:
-      return ErrorCode::ABORT_ERR;
-  }
-}
-
-PlatformResult StrToGestureType(const std::string& type, gesture_type_e* type_e) {
-  if ("GESTURE_DOUBLE_TAP" == type) {
-    *type_e = GESTURE_DOUBLE_TAP;
-  } else if ("GESTURE_MOVE_TO_EAR" == type) {
-    *type_e = GESTURE_MOVE_TO_EAR;
-  } else if ("GESTURE_NO_MOVE" == type) {
-    *type_e = GESTURE_NO_MOVE;
-  } else if ("GESTURE_PICK_UP" == type) {
-    *type_e = GESTURE_PICK_UP;
-  } else if ("GESTURE_SHAKE" == type) {
-    *type_e = GESTURE_SHAKE;
-  } else if ("GESTURE_SNAP" == type) {
-    *type_e = GESTURE_SNAP;
-  } else if ("GESTURE_TILT" == type) {
-    *type_e = GESTURE_TILT;
-  } else if ("GESTURE_TURN_FACE_DOWN" == type) {
-    *type_e = GESTURE_TURN_FACE_DOWN;
-  } else if ("GESTURE_WRIST_UP" == type) {
-    *type_e = GESTURE_WRIST_UP;
-  } else {
-    return PlatformResult(ErrorCode::TYPE_MISMATCH_ERR, "Unknown gesture type");
-  }
-
-  return PlatformResult(ErrorCode::NO_ERROR);
-}
-
-std::string GestureTypeToStr(gesture_type_e type) {
-  switch (type) {
-    case GESTURE_DOUBLE_TAP:
-      return "GESTURE_DOUBLE_TAP";
-    case GESTURE_MOVE_TO_EAR:
-      return "GESTURE_MOVE_TO_EAR";
-    case GESTURE_NO_MOVE:
-      return "GESTURE_NO_MOVE";
-    case GESTURE_PICK_UP:
-      return "GESTURE_PICK_UP";
-    case GESTURE_SHAKE:
-      return "GESTURE_SHAKE";
-    case GESTURE_SNAP:
-      return "GESTURE_SNAP";
-    case GESTURE_TILT:
-      return "GESTURE_TILT";
-    case GESTURE_TURN_FACE_DOWN:
-      return "GESTURE_TURN_FACE_DOWN";
-    case GESTURE_WRIST_UP:
-      return "GESTURE_WRIST_UP";
-    default:
-      return "GESTURE_UNKNOWN_TYPE";
-  }
-}
-std::string GestureEventToStr(gesture_event_e event, gesture_type_e gesture) {
-  switch (event) {
-    // GESTURE_EVENT_DETECTED == GESTURE_SHAKE_DETECTED == GESTURE_SNAP_X_NEGATIVE == 1
-    case GESTURE_EVENT_DETECTED:
-      if (GESTURE_SHAKE == gesture) {
-        return "GESTURE_SHAKE_DETECTED";
-      } else if (GESTURE_SNAP == gesture) {
-        return "GESTURE_SNAP_X_NEGATIVE";
-      } else {
-        return "GESTURE_EVENT_DETECTED";
-      }
-    // GESTURE_SHAKE_FINISHED == GESTURE_SNAP_X_POSITIVE == 2
-    case GESTURE_SHAKE_FINISHED:
-      if (GESTURE_SHAKE == gesture) {
-        return "GESTURE_SHAKE_FINISHED";
-      } else {
-        return "GESTURE_SNAP_X_POSITIVE";
-      }
-    case GESTURE_SNAP_Y_NEGATIVE:
-      return "GESTURE_SNAP_Y_NEGATIVE";
-    case GESTURE_SNAP_Y_POSITIVE:
-      return "GESTURE_SNAP_Y_POSITIVE";
-    case GESTURE_SNAP_Z_NEGATIVE:
-      return "GESTURE_SNAP_Z_NEGATIVE";
-    case GESTURE_SNAP_Z_POSITIVE:
-      return "GESTURE_SNAP_Z_POSITIVE";
-    default:
-      return "GESTURE_EVENT_NONE";
-  }
-}
-
-void GestureRecognitionDefaultCb(gesture_type_e gesture, const gesture_data_h data,
-                                 double timestamp, gesture_error_e error, void *user_data) {
-  ScopeLogger();
-
-  GestureManager* manager = static_cast<GestureManager*>(user_data);
-  if (!manager) {
-    LoggerW("User data is null");
-    return;
-  }
-
-  manager->CompleteGestureListenerCb(gesture, data, timestamp, error, false);
-}
-
-void GestureRecognitionAlwaysOnCb(gesture_type_e gesture, const gesture_data_h data,
-                                  double timestamp, gesture_error_e error, void *user_data) {
-  ScopeLogger();
-  GestureManager* manager = static_cast<GestureManager*>(user_data);
-
-  if (!manager) {
-    LoggerW("User data is null");
-    return;
-  }
-
-  manager->CompleteGestureListenerCb(gesture, data, timestamp, error, true);
-}
-
-}  // namespace
-
-GestureManager::GestureManager() :
-    m_callback(nullptr),
-    m_recognition_default_map(),
-    m_recognition_always_on_map() {
-  ScopeLogger();
-}
-
-GestureManager::~GestureManager() {
-  ScopeLogger();
-
-  int ret = GESTURE_ERROR_NONE;
-
-  for (auto& it : m_recognition_default_map) {
-    ret = gesture_stop_recognition(it.second);
-    if (GESTURE_ERROR_NONE != ret) {
-      LoggerE("gesture_stop_recognition() failed");
-    }
-
-    ret = gesture_release(it.second);
-    if (GESTURE_ERROR_NONE != ret) {
-      LoggerE("gesture_release() failed");
-    }
-  }
-
-  for (auto& it : m_recognition_always_on_map) {
-    ret = gesture_stop_recognition(it.second);
-    if (GESTURE_ERROR_NONE != ret) {
-      LoggerE("gesture_stop_recognition() failed");
-    }
-
-    ret = gesture_release(it.second);
-    if (GESTURE_ERROR_NONE != ret) {
-      LoggerE("gesture_release() failed");
-    }
-  }
-
-  m_recognition_default_map.clear();
-  m_recognition_always_on_map.clear();
-}
-
-PlatformResult GestureManager::IsSupported(const std::string& type, bool* is_supported) {
-  ScopeLogger();
-
-  gesture_type_e type_e = GESTURE_DOUBLE_TAP;
-  PlatformResult result = StrToGestureType(type, &type_e);
-  if (!result) {
-    return result;
-  }
-
-  int ret = gesture_is_supported(type_e, is_supported);
-  if (GESTURE_ERROR_NONE != ret) {
-    return LogAndCreateResult(getErrorCode(ret),
-                              "Checking gesture failed",
-                              ("Checking gesture failed, error: %d (%s)", ret, get_error_message(ret)));
-  }
-
-  return PlatformResult(ErrorCode::NO_ERROR);
-}
-
-gesture_event_e GestureManager::GetGestureEvent(const gesture_data_h data) {
-  ScopeLogger();
-
-  gesture_event_e event = GESTURE_EVENT_NONE;
-  int ret = gesture_get_event(data, &event);
-  if (GESTURE_ERROR_NONE != ret) {
-    LoggerE("gesture_get_event() failed, error %d (%s)", ret, get_error_message(ret));
-  }
-
-  return event;
-}
-
-void GestureManager::FillTiltData(const gesture_data_h data, picojson::object* obj) {
-  ScopeLogger();
-
-  int x = 0;
-  int y = 0;
-
-  int ret = gesture_get_tilt(data, &x, &y);
-  if (GESTURE_ERROR_NONE != ret) {
-    LoggerE("gesture_get_tilt() failed, error %d (%s)", ret, get_error_message(ret));
-  }
-
-  obj->insert(std::make_pair("x", picojson::value(static_cast<double>(x))));
-  obj->insert(std::make_pair("y", picojson::value(static_cast<double>(y))));
-}
-
-void GestureManager::CompleteGestureListenerCb(gesture_type_e gesture,
-                                               const gesture_data_h data,
-                                               double timestamp,
-                                               gesture_error_e error,
-                                               bool always_on) {
-  ScopeLogger();
-
-  picojson::value response = picojson::value(picojson::object());
-  auto& obj = response.get<picojson::object>();
-
-  obj.insert(std::make_pair(kAlwayOn, picojson::value(always_on)));
-  obj.insert(std::make_pair(kListenerId, picojson::value(kListener)));
-
-  if (GESTURE_ERROR_NONE != error) {
-    obj.insert(std::make_pair(kAction, picojson::value(kOnError)));
-
-    PlatformResult result = LogAndCreateResult(getErrorCode(error), "Error occurred during recognition");
-    ReportError(result, &obj);
-  } else {
-    gesture_event_e event = GetGestureEvent(data);
-    if (GESTURE_EVENT_NONE == event) {
-      LoggerD("Gesture event none detected.");
-      return;
-    }
-
-    std::string gesture_str = GestureTypeToStr(gesture);
-    if ("GESTURE_UNKNOWN_TYPE" == gesture_str) {
-      LoggerE("Unknown gesture type");
-      return;
-    }
-
-    obj.insert(std::make_pair(kAction, picojson::value(kOnDetect)));
-
-    picojson::value result = picojson::value(picojson::object());
-    auto& result_obj = result.get<picojson::object>();
-
-    result_obj.insert(std::make_pair(kEvent, picojson::value(GestureEventToStr(event, gesture))));
-    result_obj.insert(std::make_pair(kTimestamp, picojson::value(timestamp)));
-    result_obj.insert(std::make_pair(kType, picojson::value(gesture_str)));
-
-    if (GESTURE_TILT == gesture) {
-      FillTiltData(data, &result_obj);
-    }
-
-    ReportSuccess(result, obj);
-  }
-
-  if (!m_callback) {
-    LoggerE("Callback is not defined");
-  } else {
-    m_callback(&response);
-  }
-}
-
-PlatformResult GestureManager::AddListener(gesture_type_e type, gesture_option_e option,
-                                           RecognitionMap& gesture_map,
-                                           gesture_recognition_cb callback) {
-  ScopeLogger();
-
-  gesture_h handle = nullptr;
-
-  int ret = gesture_create(&handle);
-  if (GESTURE_ERROR_NONE != ret) {
-    return LogAndCreateResult(getErrorCode(ret),
-                              "Creating handle failed",
-                              ("Creating handle failed, error: %d (%s)", ret, get_error_message(ret)));
-  }
-
-  ret = gesture_start_recognition(handle, type, option, callback, this);
-  if (GESTURE_ERROR_NONE != ret) {
-    gesture_release(handle);
-    return LogAndCreateResult(getErrorCode(ret),
-                              "Starting recognition failed",
-                              ("Starting recognition failed, error: %d (%s)", ret, get_error_message(ret)));
-  }
-
-  gesture_map[type] = handle;
-
-  return PlatformResult(ErrorCode::NO_ERROR);
-}
-
-
-PlatformResult GestureManager::AddGestureRecognitionListener(const std::string& type,
-                                                             bool always_on,
-                                                             JsonCallback cb) {
-  ScopeLogger();
-
-  gesture_type_e type_e = GESTURE_DOUBLE_TAP;
-  PlatformResult result = StrToGestureType(type, &type_e);
-  if (!result) {
-    return result;
-  }
-
-  gesture_option_e option = GESTURE_OPTION_DEFAULT;
-  gesture_recognition_cb callback = GestureRecognitionDefaultCb;
-  RecognitionMap* gesture_map = &m_recognition_default_map;
-
-  if (!m_callback) {
-    m_callback = cb;
-  }
-
-  if (always_on) {
-    option = GESTURE_OPTION_ALWAYS_ON;
-    callback = GestureRecognitionAlwaysOnCb;
-    gesture_map = &m_recognition_always_on_map;
-  }
-
-  return AddListener(type_e, option, *gesture_map, callback);
-}
-
-PlatformResult GestureManager::RemoveGestureRecognitionListener(const std::string& type,
-                                                                bool always_on) {
-  ScopeLogger();
-
-  auto& recognition_map = always_on ? m_recognition_always_on_map : m_recognition_default_map;
-  gesture_type_e type_e = GESTURE_DOUBLE_TAP;
-  PlatformResult result = StrToGestureType(type, &type_e);
-  if (!result) {
-    LoggerD("Unknown gesture type.");
-    return PlatformResult(ErrorCode::NO_ERROR);
-  }
-
-  gesture_h handle = nullptr;
-  RecognitionMap::iterator it = recognition_map.find(type_e);
-
-  if (recognition_map.end() != it) {
-    handle = it->second;
-  }
-
-  if (handle) {
-    int ret = gesture_stop_recognition(handle);
-    if (GESTURE_ERROR_NONE != ret) {
-      return LogAndCreateResult(getErrorCode(ret),
-                                "Stoping recognition failed",
-                                ("Stoping recognition failed, error: %d (%s)", ret, get_error_message(ret)));
-    }
-
-    ret = gesture_release(handle);
-    if (GESTURE_ERROR_NONE != ret) {
-      LoggerE("gesture_release() failed");
-    }
-
-    recognition_map.erase(it);
-  }
-
-  return PlatformResult(ErrorCode::NO_ERROR);
-}
-
-}  // namespace humanactivitymonitor
-}  // namespace extension
diff --git a/src/humanactivitymonitor/gesture_manager.h b/src/humanactivitymonitor/gesture_manager.h
deleted file mode 100644 (file)
index 081b81d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    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 HUMANACTIVITYMONITOR_GESTURE_MANAGER_H
-#define HUMANACTIVITYMONITOR_GESTURE_MANAGER_H
-
-#include <string>
-#include <functional>
-#include <gesture_recognition.h>
-
-#include "common/picojson.h"
-#include "common/platform_result.h"
-
-namespace extension {
-namespace humanactivitymonitor {
-
-using JsonCallback = std::function<void(picojson::value*)>;
-
-typedef std::map<gesture_type_e, gesture_h> RecognitionMap;
-
-class GestureManager {
- public:
-  GestureManager();
-  virtual ~GestureManager();
-
-  common::PlatformResult IsSupported(const std::string& types, bool* is_supported);
-  common::PlatformResult AddGestureRecognitionListener(const std::string& type, bool always_on,
-                                                       JsonCallback cb);
-  common::PlatformResult RemoveGestureRecognitionListener(const std::string& type, bool always_on);
-  void CompleteGestureListenerCb(gesture_type_e gesture, const gesture_data_h data,
-                                 double timestamp, gesture_error_e error, bool always_on);
-
- private:
-  gesture_event_e GetGestureEvent(const gesture_data_h data);
-  void FillTiltData(const gesture_data_h data, picojson::object* obj);
-  common::PlatformResult AddListener(gesture_type_e type, gesture_option_e option,
-                                  RecognitionMap& gesture_map, gesture_recognition_cb callback);
-
-  JsonCallback m_callback;
-  RecognitionMap m_recognition_default_map;
-  RecognitionMap m_recognition_always_on_map;
-};
-
-} // namespace humanactivitymonitor
-} // namespace extension
-
-#endif  // HUMANACTIVITYMONITOR_GESTURE_MANAGER_H
index c6b54a04c1efdce087a1c64eaaf070e6aae3fa54..6c250c1871c3f03aa8c66afe3eb55aded36d336c 100755 (executable)
@@ -17,8 +17,6 @@
         'humanactivitymonitor_instance.h',
         'humanactivitymonitor_manager.cc',
         'humanactivitymonitor_manager.h',
-        'gesture_manager.cc',
-        'gesture_manager.h',
       ],
       'conditions': [
         ['tizen == 1', {
index 7b3a8f7e86604c5f479420238a558d248f33614e..3f060040f6e0ffff5a3203265ad61604819d2678 100755 (executable)
@@ -78,18 +78,6 @@ var SleepStatus = {
   AWAKE: 'AWAKE'
 };
 
-var GestureType = {
-  GESTURE_DOUBLE_TAP : 'GESTURE_DOUBLE_TAP',
-  GESTURE_MOVE_TO_EAR : 'GESTURE_MOVE_TO_EAR',
-  GESTURE_NO_MOVE : 'GESTURE_NO_MOVE',
-  GESTURE_PICK_UP : 'GESTURE_PICK_UP',
-  GESTURE_SHAKE : 'GESTURE_SHAKE',
-  GESTURE_SNAP : 'GESTURE_SNAP',
-  GESTURE_TILT : 'GESTURE_TILT',
-  GESTURE_TURN_FACE_DOWN : 'GESTURE_TURN_FACE_DOWN',
-  GESTURE_WRIST_UP : 'GESTURE_WRIST_UP',
-};
-
 function convertActivityData(type, data) {
   switch (type) {
     case HumanActivityType.PEDOMETER:
@@ -524,157 +512,6 @@ HumanActivityMonitorManager.prototype.readRecorderData = function() {
   }
 };
 
-HumanActivityMonitorManager.prototype.isGestureSupported = function() {
-  var args = validator_.validateMethod(arguments, [{
-    name : 'type',
-    type: types_.ENUM,
-    values: Object.keys(GestureType)
-  }
-  ]);
-
-  var callArgs = {};
-  callArgs.type = args.type;
-
-  var result = native_.callSync('GestureManager_isGestureSupported', callArgs);
-  if (native_.isFailure(result)) {
-    throw native_.getErrorObject(result);
-  }
-
-  return native_.getResultObject(result);
-};
-
-function GestureListenerManager(native, listenerName) {
-  this.listeners = {};
-  //below maps keep information about number of registered listeners for the specific type
-  //there are two maps as one keeps information about listeners which should be always called
-  //and one keeps information about number of the listeners which should be called only
-  //if power-saving mode is off
-  this.typeCountMapDefault = {};
-  this.typeCountMapAlwaysOn = {};
-  this.nextId = 1;
-  this.nativeSet = false;
-  this.native = native;
-  this.listenerName = listenerName;
-  for (var type in GestureType) {
-    this.typeCountMapDefault[type] = this.typeCountMapAlwaysOn[type] = 0;
-  }
-};
-
-GestureListenerManager.prototype.onListenerCalled = function(msg) {
-  var d = undefined;
-  var result = undefined;
-  var alwaysOn = msg.alwaysOn;
-  switch (msg.action) {
-    case 'ondetect':
-      d = new GestureData(this.native.getResultObject(msg));
-      break;
-    case 'onerror':
-      d = this.native.getErrorObject(msg);
-      break;
-    default:
-      utils_.log('Unknown mode: ' + msg.action);
-      return;
-  }
-
-  for (var watchId in this.listeners) {
-    if (this.listeners.hasOwnProperty(watchId)) {
-      var listener = this.listeners[watchId];
-      var call = alwaysOn ? listener.alwaysOn : true;
-      if (call && listener[msg.action]) {
-        listener[msg.action](d);
-      }
-    }
-  }
-};
-
-GestureListenerManager.prototype.addListener = function(successCb, errorCb, type, alwaysOn) {
-  var listener = {
-      'type' : type,
-      'alwaysOn' : alwaysOn,
-      'ondetect' : successCb,
-      'onerror' : errorCb
-  };
-
-  var typeCountMap = alwaysOn ? this.typeCountMapAlwaysOn : this.typeCountMapDefault;
-  if (typeCountMap[type] === 0) {
-    var result = this.native.callSync('GestureManager_addGestureRecognitionListener', listener);
-    if (this.native.isFailure(result)) {
-      throw this.native.getErrorObject(result);
-    }
-  }
-
-  typeCountMap[type]++;
-  var id = this.nextId++;
-  this.listeners[id] = listener;
-
-  if (!this.nativeSet) {
-    this.native.addListener(this.listenerName, this.onListenerCalled.bind(this));
-    this.nativeSet = true;
-  }
-
-  return id;
-};
-
-GestureListenerManager.prototype.removeListener = function(watchId) {
-  if (this.listeners.hasOwnProperty(watchId)) {
-      var listener = this.listeners[watchId];
-      var typeCountMap = listener.alwaysOn ? this.typeCountMapAlwaysOn : this.typeCountMapDefault;
-
-      if (typeCountMap[listener.type] === 1) {
-        var result = this.native.callSync('GestureManager_removeGestureRecognitionListener', listener);
-        if (this.native.isFailure(result)) {
-          throw this.native.getErrorObject(result);
-        }
-      }
-
-      delete this.listeners[watchId];
-      typeCountMap[listener.type]--;
-  }
-
-  if (this.nativeSet && type_.isEmptyObject(this.listeners)) {
-    this.native.removeListener(this.listenerName);
-    this.nativeSet = false;
-  }
-};
-
-var GESTURE_RECOGNITION_LISTENER = 'GestureRecognitionListener';
-var gestureRecognitionListener = new GestureListenerManager(native_, GESTURE_RECOGNITION_LISTENER);
-
-HumanActivityMonitorManager.prototype.addGestureRecognitionListener = function() {
-  var args = validator_.validateMethod(arguments, [{
-    name : 'type',
-    type: types_.ENUM,
-    values: Object.keys(GestureType)
-  },
-  {
-    name : 'eventCallback',
-    type : types_.FUNCTION
-  },
-  {
-    name : 'errorCallback',
-    type : types_.FUNCTION,
-    optional: true,
-    nullable: true
-  },
-  {
-    name : 'alwaysOn',
-    type : types_.BOOLEAN,
-    optional : true,
-    nullable : true
-  }]);
-
-  return gestureRecognitionListener.addListener(args.eventCallback, args.errorCallback, args.type, args.alwaysOn);
-};
-
-HumanActivityMonitorManager.prototype.removeGestureRecognitionListener = function() {
-  var args = validator_.validateMethod(arguments, [{
-    name : 'watchId',
-    type : types_.LONG,
-  }]);
-
-  gestureRecognitionListener.removeListener(args.watchId);
-};
-
 function StepDifference(data) {
   SetReadOnlyProperty(this, 'stepCountDifference', data.stepCountDifference);
   SetReadOnlyProperty(this, 'timestamp', data.timestamp);
@@ -812,22 +649,6 @@ function HumanActivityRecorderPressureData(data) {
   SetReadOnlyProperty(this, 'average', data.average);
 }
 
-function GestureData(data) {
-  if (data) {
-    SetReadOnlyProperty(this, 'type', data.type);
-    SetReadOnlyProperty(this, 'event', data.event);
-    SetReadOnlyProperty(this, 'timestamp', data.timestamp);
-
-    if (data.type === 'GESTURE_TILT') {
-      SetReadOnlyProperty(this, 'x', data.x);
-      SetReadOnlyProperty(this, 'y', data.y);
-    } else {
-      SetReadOnlyProperty(this, 'x', null);
-      SetReadOnlyProperty(this, 'y', null);
-    }
-  }
-}
-
 HumanActivityRecorderPressureData.prototype = new HumanActivityRecorderData();
 HumanActivityRecorderPressureData.prototype.constructor = HumanActivityRecorderPressureData;
 
index 69c1c2acbd73e93dfe64253653bb817dcbedcc23..89eeb676af4d162ef3154a3465c0b5a3e2c510ed 100755 (executable)
@@ -43,8 +43,7 @@ using common::PlatformResult;
 using common::ErrorCode;
 using common::TaskQueue;
 
-HumanActivityMonitorInstance::HumanActivityMonitorInstance() :
-  gesture_manager_() {
+HumanActivityMonitorInstance::HumanActivityMonitorInstance() {
   LoggerD("Enter");
   using std::placeholders::_1;
   using std::placeholders::_2;
@@ -67,12 +66,6 @@ HumanActivityMonitorInstance::HumanActivityMonitorInstance() :
                 HumanActivityMonitorManagerStopRecorder);
   REGISTER_SYNC("HumanActivityMonitorManager_readRecorderData",
                  HumanActivityMonitorManagerReadRecorderData);
-  REGISTER_SYNC("GestureManager_isGestureSupported",
-                GestureManagerIsGestureSupported);
-  REGISTER_SYNC("GestureManager_addGestureRecognitionListener",
-                GestureManagerAddGestureRecognitionListener);
-  REGISTER_SYNC("GestureManager_removeGestureRecognitionListener",
-                GestureManagerRemoveGestureRecognitionListener);
 #undef REGISTER_SYNC
 }
 
@@ -388,65 +381,6 @@ void HumanActivityMonitorInstance::HumanActivityMonitorManagerReadRecorderData(
   ReportSuccess(out);
 }
 
-void HumanActivityMonitorInstance::GestureManagerIsGestureSupported(
-    const picojson::value& args, picojson::object& out) {
-  LoggerD("Enter");
-
-  CHECK_EXIST(args, "type", out)
-  const auto& type = args.get("type").get<std::string>();
-  bool is_supported = false;
-
-  PlatformResult result = gesture_manager_.IsSupported(type, &is_supported);
-  if (result) {
-    ReportSuccess(picojson::value(is_supported), out);
-  } else {
-    LogAndReportError(result, &out, ("Failed: gesture_manager_->IsSupported()"));
-  }
-}
-
-void HumanActivityMonitorInstance::GestureManagerAddGestureRecognitionListener(
-    const picojson::value& args, picojson::object& out) {
-  LoggerD("Enter");
-
-  CHECK_EXIST(args, "type", out)
-  CHECK_EXIST(args, "alwaysOn", out)
-  const auto& type = args.get("type").get<std::string>();
-  bool always_on = args.get("alwaysOn").get<bool>();
-
-  auto cb = [this](picojson::value* data) -> void {
-    if (!data) {
-      LoggerE("No data passed to json callback");
-      return;
-    }
-
-    Instance::PostMessage(this, data->serialize().c_str());
-  };
-
-  PlatformResult result = gesture_manager_.AddGestureRecognitionListener(type, always_on, cb);
-  if (result) {
-    ReportSuccess(out);
-  } else {
-    LogAndReportError(result, &out, ("Failed: gesture_manager_->AddGestureRecognitionListener()"));
-  }
-}
-
-void HumanActivityMonitorInstance::GestureManagerRemoveGestureRecognitionListener(
-    const picojson::value& args, picojson::object& out) {
-  LoggerD("Enter");
-
-  CHECK_EXIST(args, "type", out)
-  CHECK_EXIST(args, "alwaysOn", out)
-  const auto& type = args.get("type").get<std::string>();
-  bool always_on = args.get("alwaysOn").get<bool>();
-
-  PlatformResult result = gesture_manager_.RemoveGestureRecognitionListener(type, always_on);
-  if (result) {
-    ReportSuccess(out);
-  } else {
-    LogAndReportError(result, &out, ("Failed: gesture_manager_->RemoveGestureRecognitionListener()"));
-  }
-}
-
 #undef CHECK_EXIST
 
 }  // namespace humanactivitymonitor
index c58e37cf6f91007c9a491ee8a3838a4aa779a02f..1ab6829e02c2fda08d70abb46964f3cf218b5747 100755 (executable)
@@ -22,7 +22,6 @@
 #include "common/extension.h"
 #include "common/platform_result.h"
 #include "humanactivitymonitor/humanactivitymonitor_manager.h"
-#include "humanactivitymonitor/gesture_manager.h"
 
 namespace extension {
 namespace humanactivitymonitor {
@@ -49,15 +48,8 @@ class HumanActivityMonitorInstance : public common::ParsedInstance {
       const picojson::value& args, picojson::object& out);
   void HumanActivityMonitorManagerReadRecorderData(
       const picojson::value& args, picojson::object& out);
-  void GestureManagerIsGestureSupported(
-      const picojson::value& args, picojson::object& out);
-  void GestureManagerAddGestureRecognitionListener(
-      const picojson::value& args, picojson::object& out);
-  void GestureManagerRemoveGestureRecognitionListener(
-      const picojson::value& args, picojson::object& out);
 
   std::shared_ptr<HumanActivityMonitorManager> manager_;
-  GestureManager gesture_manager_;
   common::PlatformResult Init();
 };
 
index 79597cda1302e6a06592aa2fba6226ed901cb8e8..25b02f9e0024913e7c168411c0dea9725dcf4a53 100644 (file)
@@ -34,7 +34,7 @@
             'packages': [
                 'capi-system-info',
                 'capi-network-nfc',
-                'capi-appfw-app-control',
+                'capi-appfw-application'
             ]
           },
         }],
index 766fbb3907df9a752c92d0218062b8c9e49e2ce2..9c219a8c2e9524921b5a1a140476395a5847e2a0 100755 (executable)
             'packages': [
               'notification',
               'capi-system-device',
-              'capi-appfw-app-control',
             ]
           },
         }],
       ],
-      'direct_dependent_settings': {
-        'libraries' : [
-          '-ltizen_notification',
-        ],
-      },
     },
   ],
 }
index 5c7ce37594026b11ce9e2248d9fc57f8f69262bd..21bcadf5dc8c79e1c67f567f0ffe784a02d6f9e3 100644 (file)
@@ -242,42 +242,6 @@ NotificationManager.prototype.stopLEDCustomEffect = function() {
   }
 };
 
-NotificationManager.prototype.saveNotificationAsTemplate = function(name, notification) {
-  var args = validator_.validateArgs(arguments, [
-    {name: 'name', type: types_.STRING},
-    {name: 'notification', type: types_.PLATFORM_OBJECT, values: StatusNotification}
-  ]);
-
-  var result = native_.callSync('NotificationManager_saveNotificationAsTemplate', args);
-
-  if (native_.isFailure(result)) {
-    throw native_.getErrorObject(result);
-  }
-};
-
-NotificationManager.prototype.createNotificationFromTemplate = function(name) {
-  var args = validator_.validateArgs(arguments, [
-    {name: 'name', type: types_.STRING}
-  ]);
-
-  if (!arguments.length) {
-    throw new WebAPIException(WebAPIException.NOT_FOUND_ERR);
-  }
-
-  var result = native_.callSync('NotificationManager_createNotificationFromTemplate', args);
-
-  if (native_.isFailure(result)) {
-    throw native_.getErrorObject(result);
-  }
-  var n = native_.getResultObject(result);
-
-  _edit.allow();
-  var returnObject = new StatusNotification(n.statusType, n.title, n);
-  _edit.disallow();
-
-  return returnObject;
-};
-
 
 function NotificationInitDict(data) {
   var _iconPath = null;
index d4f06dac848a4148fbf1b7227f0f5aa45fc96795..ec92eb59627c6bf39608371398ffd5ef8143faeb 100644 (file)
@@ -52,8 +52,6 @@ NotificationInstance::NotificationInstance() {
       NotificationManagerPlayLEDCustomEffect);
   REGISTER_SYNC("NotificationManager_stopLEDCustomEffect",
       NotificationManagerStopLEDCustomEffect);
-  REGISTER_SYNC("NotificationManager_saveNotificationAsTemplate", NotificationManagerSaveTemplate);
-  REGISTER_SYNC("NotificationManager_createNotificationFromTemplate", NotificationManagerCreateFromTemplate);
 #undef REGISTER_SYNC
 
   manager_ = NotificationManager::GetInstance();
@@ -190,37 +188,6 @@ void NotificationInstance::NotificationManagerStopLEDCustomEffect(
   }
 }
 
-void NotificationInstance::NotificationManagerSaveTemplate(const picojson::value& args,
-                                                           picojson::object& out) {
-  LoggerD("Enter");
-  CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out);
-
-  PlatformResult status = manager_->SaveTemplate(args.get<picojson::object>());
-
-  if (status.IsSuccess()) {
-    ReportSuccess(out);
-  } else {
-    LogAndReportError(status, &out);
-  }
-}
-
-
-void NotificationInstance::NotificationManagerCreateFromTemplate(const picojson::value& args,
-                                                                 picojson::object& out) {
-  LoggerD("Enter");
-  CHECK_PRIVILEGE_ACCESS(kPrivilegeNotification, &out);
-  picojson::value val{picojson::object{}};
-
-  PlatformResult status =
-      manager_->CreateFromTemplate(args.get<picojson::object>(), val.get<picojson::object>());
-
-  if (status.IsSuccess()) {
-    ReportSuccess(val, out);
-  } else {
-    LogAndReportError(status, &out);
-  }
-}
-
 #undef CHECK_EXIST
 
 }  // namespace notification
index 4eef4f8406e7e5a2a93d5b7b03c31db835db6ba8..3a1e2e7637b012dd023d57d69b9e1a1cb523770d 100644 (file)
@@ -48,10 +48,6 @@ class NotificationInstance : public common::ParsedInstance {
                                               picojson::object& out);
   void NotificationManagerStopLEDCustomEffect(const picojson::value& args,
                                               picojson::object& out);
-  void NotificationManagerSaveTemplate(const picojson::value& args,
-                                       picojson::object& out);
-  void NotificationManagerCreateFromTemplate(const picojson::value& args,
-                                             picojson::object& out);
 };
 
 }  // namespace notification
index 84adcd9d5369aaac649f4c0900e94e3d1ee4efc3..93f0c090cad9b6713485559577f375db7f0f143e 100644 (file)
@@ -23,7 +23,6 @@
 #include <device/led.h>
 #include <notification_internal.h>
 #include <notification_list.h>
-#include <app_common.h>
 
 #include "common/converter.h"
 #include "common/logger.h"
@@ -245,64 +244,5 @@ PlatformResult NotificationManager::StopLEDCustomEffect() {
   return PlatformResult(ErrorCode::NO_ERROR);
 }
 
-common::PlatformResult NotificationManager::SaveTemplate(const picojson::object& args) {
-  LoggerD("Enter");
-  std::string name = FromJson<std::string>(args, "name");
-  notification_h noti_handle = nullptr;
-  int ret;
-  SCOPE_EXIT {
-    notification_free(noti_handle);
-  };
-
-  PlatformResult status = StatusNotification::GetNotiHandleFromJson(args, false, &noti_handle);
-
-  if (status.IsError()){
-    return status;
-  }
-
-  ret = notification_save_as_template(noti_handle, name.c_str());
-  if (ret != NOTIFICATION_ERROR_NONE) {
-    LoggerD("Error: %d (%s)", ret, get_error_message(ret));
-    if (ret == NOTIFICATION_ERROR_MAX_EXCEEDED) {
-      return LogAndCreateResult(ErrorCode::QUOTA_EXCEEDED_ERR,
-                                "Maximum number of templates exceeded",
-                                ("Maximum number of templates exceeded, error: %d", ret));
-    } else {
-      return LogAndCreateResult(ErrorCode::ABORT_ERR,
-                                "Saving template failed",
-                                ("Saving template failed, error: %d", ret));
-    }
-  }
-
-  return PlatformResult(ErrorCode::NO_ERROR);
-}
-
-
-common::PlatformResult NotificationManager::CreateFromTemplate(const picojson::object& args,
-                                                               picojson::object& out) {
-  LoggerD("Enter");
-  std::string name = FromJson<std::string>(args, "name");
-
-  notification_h noti_handle = nullptr;
-  noti_handle = notification_create_from_template(name.c_str());
-  if (!noti_handle) {
-    return LogAndCreateResult(ErrorCode::NOT_FOUND_ERR,
-                              "The template with given name not found",
-                              ("The template with given name not found, handle is NULL"));
-  }
-
-  SCOPE_EXIT {
-    notification_free(noti_handle);
-  };
-
-  PlatformResult status = StatusNotification::ToJson(0, noti_handle, nullptr, &out);
-  if (status.IsError())
-  {
-    LoggerE("Failed: ToJson");
-    return status;
-  }
-  return PlatformResult(ErrorCode::NO_ERROR);
-}
-
 }  // namespace notification
 }  // namespace extension
index 85cd85fa348f9b5106c00cacd2fe27f9d5215549..eaeac9f3763075d3c6fe7a8f6856214b5ad4421a 100644 (file)
@@ -41,10 +41,6 @@ class NotificationManager {
   common::PlatformResult PlayLEDCustomEffect(const picojson::object& args);
   common::PlatformResult StopLEDCustomEffect();
 
-  common::PlatformResult SaveTemplate(const picojson::object& args);
-  common::PlatformResult CreateFromTemplate(const picojson::object& args,
-                                            picojson::object& out);
-
  private:
   NotificationManager();
   virtual ~NotificationManager();
index 279182c381209b19d89448b5c016b29dcd66b776..1b55a50ca0662e9b6ed35ea24be0a61601448a62 100644 (file)
@@ -1088,21 +1088,19 @@ PlatformResult StatusNotification::ToJson(int id,
     return status;
   out["vibration"] = picojson::value(vibration);
 
-  if (app_handle) {
-    picojson::object app_control = picojson::object();
-    status = GetApplicationControl(app_handle, &app_control);
-    if (status.IsError())
-      return status;
-    if (app_control.size()) {
-      out["appControl"] = picojson::value(app_control);
-    }
+  picojson::object app_control = picojson::object();
+  status = GetApplicationControl(app_handle, &app_control);
+  if (status.IsError())
+    return status;
+  if (app_control.size()) {
+    out["appControl"] = picojson::value(app_control);
+  }
 
-    status = GetApplicationId(app_handle, &value_str);
-    if (status.IsError())
-      return status;
-    if (value_str.length()) {
-      out["appId"] = picojson::value(value_str);
-    }
+  status = GetApplicationId(app_handle, &value_str);
+  if (status.IsError())
+    return status;
+  if (value_str.length()) {
+    out["appId"] = picojson::value(value_str);
   }
 
   std::string progress_type;
@@ -1146,9 +1144,9 @@ PlatformResult StatusNotification::ToJson(int id,
   return PlatformResult(ErrorCode::NO_ERROR);
 }
 
-PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object& args,
-                                       bool is_update,
-                                       notification_h *noti_handle){
+PlatformResult StatusNotification::FromJson(const picojson::object& args,
+                                            bool is_update,
+                                            picojson::object* out_ptr) {
   LoggerD("Enter");
   picojson::object noti_obj =
       common::FromJson<picojson::object>(args, "notification");
@@ -1162,29 +1160,32 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
     return status;
 
   int id = NOTIFICATION_PRIV_ID_NONE;
+  int ret;
 
-  app_control_h app_control = nullptr;
+  notification_h noti_handle = nullptr;
+  app_control_h app_control = NULL;
 
   SCOPE_EXIT {
     if (app_control) {
       app_control_destroy(app_control);
     }
+    notification_free(noti_handle);
   };
 
   if (is_update) {
     id = std::stoi(common::FromJson<std::string>(noti_obj, "id"));
 
-    PlatformResult status = GetNotiHandle(id, noti_handle);
+    PlatformResult status = GetNotiHandle(id, &noti_handle);
     if (status.IsError())
       return status;
 
   } else {
-    status = Create(noti_type, noti_handle);
+    status = Create(noti_type, &noti_handle);
     if (status.IsError())
       return status;
   }
 
-  status = SetLayout(*noti_handle, status_type);
+  status = SetLayout(noti_handle, status_type);
   if (status.IsError()) {
     return status;
   }
@@ -1194,7 +1195,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
     const std::string& value_str = common::FromJson<std::string>(noti_obj, "iconPath");
     std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str);
 
-    status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_ICON, real_path);
+    status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_ICON, real_path);
     if (status.IsError()) {
       return status;
     }
@@ -1205,7 +1206,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
         common::FromJson<std::string>(noti_obj, "subIconPath");
     std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str);
 
-    status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_ICON_SUB, real_path);
+    status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_ICON_SUB, real_path);
     if (status.IsError()) {
       return status;
     }
@@ -1213,7 +1214,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
 
   if (val.contains("number") && !IsNull(noti_obj, "number")) {
     long number = (long)common::FromJson<double>(noti_obj, "number");
-    status = SetText(*noti_handle, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, std::to_string(number));
+    status = SetText(noti_handle, NOTIFICATION_TEXT_TYPE_EVENT_COUNT, std::to_string(number));
     if (status.IsError()) {
       return status;
     }
@@ -1221,28 +1222,28 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
 
   if (val.contains("detailInfo") && !IsNull(noti_obj, "detailInfo")) {
     status = SetDetailInfos(
-        *noti_handle, common::FromJson<picojson::array>(noti_obj, "detailInfo"));
+        noti_handle, common::FromJson<picojson::array>(noti_obj, "detailInfo"));
     if (status.IsError()) {
       return status;
     }
   }
 
   if (val.contains("ledColor") && !IsNull(noti_obj, "ledColor")) {
-    status = SetLedColor(*noti_handle,
+    status = SetLedColor(noti_handle,
                          common::FromJson<std::string>(noti_obj, "ledColor"));
     if (status.IsError()) {
       return status;
     }
   }
 
-  status = SetLedOnPeriod(*noti_handle,
+  status = SetLedOnPeriod(noti_handle,
                           static_cast<unsigned long>(common::FromJson<double>(
                               noti_obj, "ledOnPeriod")));
   if (status.IsError()) {
     return status;
   }
 
-  status = SetLedOffPeriod(*noti_handle,
+  status = SetLedOffPeriod(noti_handle,
                            static_cast<unsigned long>(common::FromJson<double>(
                                noti_obj, "ledOffPeriod")));
   if (status.IsError()) {
@@ -1254,7 +1255,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
     const std::string& value_str = common::FromJson<std::string>(noti_obj, "backgroundImagePath");
     std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str);
 
-    status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_BACKGROUND, real_path);
+    status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_BACKGROUND, real_path);
     if (status.IsError()) {
       return status;
     }
@@ -1262,7 +1263,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
 
   if (val.contains("thumbnails") && !IsNull(noti_obj, "thumbnails")) {
     status = SetThumbnails(
-        *noti_handle, common::FromJson<picojson::array>(noti_obj, "thumbnails"));
+        noti_handle, common::FromJson<picojson::array>(noti_obj, "thumbnails"));
     if (status.IsError()) {
       return status;
     }
@@ -1272,14 +1273,14 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
     const std::string& value_str = common::FromJson<std::string>(noti_obj, "soundPath");
     std::string real_path = common::FilesystemProvider::Create().GetRealPath(value_str);
 
-    status = SetSoundPath(*noti_handle, real_path);
+    status = SetSoundPath(noti_handle, real_path);
     if (status.IsError()) {
       return status;
     }
   }
 
   status =
-      SetVibration(*noti_handle, common::FromJson<bool>(noti_obj, "vibration"));
+      SetVibration(noti_handle, common::FromJson<bool>(noti_obj, "vibration"));
   if (status.IsError()) {
     return status;
   }
@@ -1308,7 +1309,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
 
   const std::string& progress_type =
       common::FromJson<std::string>(noti_obj, "progressType");
-  status = SetImage(*noti_handle, NOTIFICATION_IMAGE_TYPE_LIST_5, progress_type);
+  status = SetImage(noti_handle, NOTIFICATION_IMAGE_TYPE_LIST_5, progress_type);
   if (status.IsError()) {
     return status;
   }
@@ -1321,14 +1322,14 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
     progressValue = -1;
   }
 
-  status = SetProgressValue(*noti_handle, progress_type, progressValue,
+  status = SetProgressValue(noti_handle, progress_type, progressValue,
       is_update);
 
   if (status.IsError()) {
     return status;
   }
 
-  status = SetText(*noti_handle,
+  status = SetText(noti_handle,
                    NOTIFICATION_TEXT_TYPE_TITLE,
                    common::FromJson<std::string>(noti_obj, "title"));
   if (status.IsError()) {
@@ -1336,7 +1337,7 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
   }
 
   if (val.contains("content") && !IsNull(noti_obj, "content")) {
-    status = SetText(*noti_handle,
+    status = SetText(noti_handle,
                      NOTIFICATION_TEXT_TYPE_CONTENT,
                      common::FromJson<std::string>(noti_obj, "content"));
     if (status.IsError()) {
@@ -1344,31 +1345,11 @@ PlatformResult StatusNotification::GetNotiHandleFromJson(const picojson::object&
     }
   }
 
-  status = SetAppControl(*noti_handle, app_control);
-
-  return PlatformResult(ErrorCode::NO_ERROR);
-}
-
-PlatformResult StatusNotification::FromJson(const picojson::object& args,
-                                            bool is_update,
-                                            picojson::object* out_ptr) {
-  LoggerD("Enter");
-  notification_h noti_handle = nullptr;
-  int ret;
-  int id = NOTIFICATION_PRIV_ID_NONE;
-
-  SCOPE_EXIT {
-    notification_free(noti_handle);
-  };
-
-  PlatformResult status = GetNotiHandleFromJson(args, is_update, &noti_handle);
-
-  if (status.IsError()){
-    return status;
-  }
+  status = SetAppControl(noti_handle, app_control);
 
   if (is_update) {
     ret = notification_update(noti_handle);
+
   } else {
     ret = notification_insert(noti_handle, &id);
     if (NOTIFICATION_ERROR_NONE != ret) {
index 896abee222fcec1d18e4501468efaa0fda08f260..ae50e8d647dda7b99f9740da9bb647868e57fe21 100644 (file)
@@ -23,8 +23,6 @@
 #include "common/picojson.h"
 #include "common/platform_result.h"
 
-#include "common/XW_Extension.h"
-
 namespace extension {
 namespace notification {
 
@@ -33,22 +31,17 @@ typedef std::map<int, notification_image_type_e> ImageEnumMap;
 
 class StatusNotification {
  public:
-  XW_EXPORT static common::PlatformResult ToJson(int id,
+  static common::PlatformResult ToJson(int id,
                                        notification_h noti_handle,
                                        app_control_h app_handle,
                                        picojson::object* out_ptr);
-  XW_EXPORT static common::PlatformResult GetNotiHandleFromJson(const picojson::object& args,
-                                         bool is_update,
-                                         notification_h *noti_handle);
   static common::PlatformResult FromJson(const picojson::object& args,
                                          bool is_update,
                                          picojson::object* out_ptr);
-  XW_EXPORT static common::PlatformResult GetAppControl(notification_h noti_handle,
+  static common::PlatformResult GetAppControl(notification_h noti_handle,
                                               app_control_h* app_control);
   static common::PlatformResult GetNotiHandle(int id,
                                               notification_h* noti_handle);
-  XW_EXPORT static common::PlatformResult SetAppControl(notification_h noti_handle,
-                                              app_control_h app_control);
 
  private:
   StatusNotification();
@@ -132,6 +125,8 @@ class StatusNotification {
                                               time_t* posted_time);
   static common::PlatformResult SetLayout(notification_h noti_handle,
                                           const std::string& noti_type);
+  static common::PlatformResult SetAppControl(notification_h noti_handle,
+                                              app_control_h app_control);
   static common::PlatformResult CreateAppControl(app_control_h* app_control);
 
   static bool IsColorFormatNumberic(const std::string& color);
index eedd0f4b7eb77c25f825034dfac2bb7128ac69e6..0b5161b726ab9b2ccd8844fb7033dd1e262ef410 100644 (file)
@@ -22,7 +22,7 @@
         ['tizen == 1', {
           'variables': {
             'packages': [
-              'capi-appfw-preference',
+              'capi-appfw-application',
             ]
           },
         }],
index 60284656b250579ef46b46446f47d432a71bba5d..5cdb2ad16521bcee687b22d72d0b37a3945d94e3 100644 (file)
@@ -28,7 +28,7 @@
           'variables': {
             'packages': [
               'push',
-              'capi-appfw-app-control',
+              'capi-appfw-application',
               'libpcrecpp',
             ]
           },
index 5822c0085990511d87e0603387f501c46c39d0a7..ae9d39fb51784ff79e19e689a276d5ff8bc8c3a1 100644 (file)
@@ -47,6 +47,9 @@
             ]
           },
         }],
+        ['tizen_is_emulator == 1', {
+          'defines': ['TIZEN_IS_EMULATOR'],
+        }],
       ],
     },
   ],
index 38e48daef9dd7af04af0f15be2e18974d8c8b29f..e09c977d19818697ddc04a8837f94d69835d950c 100644 (file)
@@ -46,17 +46,6 @@ var SystemInfoPropertyId = {
         ADS : 'ADS'
 };
 
-var SystemInfoPropertyIdToFeature = {
-        BATTERY : 'http://tizen.org/feature/battery',
-        CAMERA_FLASH : 'http://tizen.org/feature/camera.back.flash',
-        CELLULAR_NETWORK : 'http://tizen.org/feature/network.telephony',
-        DISPLAY : 'http://tizen.org/feature/screen',
-        ETHERNET_NETWORK : 'http://tizen.org/feature/network.ethernet',
-        SIM : 'http://tizen.org/feature/network.telephony',
-        NET_PROXY_NETWORK : 'http://tizen.org/feature/network.net_proxy',
-        WIFI_NETWORK : 'http://tizen.org/feature/network.wifi'
-};
-
 //class SystemInfoDeviceCapability ////////////////////////////////////////////////////
 function SystemInfoDeviceCapability(data) {
     Object.defineProperties(this, {
@@ -424,16 +413,6 @@ function SystemInfoBattery(data) {
             value : data.isCharging,
             writable : false,
             enumerable : true
-        },
-        timeToDischarge : {
-            value : data.timeToDischarge,
-            writable : false,
-            enumerable : true
-        },
-        timeToFullCharge : {
-            value : data.timeToFullCharge,
-            writable : false,
-            enumerable : true
         }
     });
 }
@@ -811,15 +790,6 @@ var _createPropertyArray = function (property, data) {
     return propertyArray;
 };
 
-var _checkPropertySupported = function(property){
-    if (SystemInfoPropertyIdToFeature[property]) {
-        var supported = tizen.systeminfo.getCapability(SystemInfoPropertyIdToFeature[property]);
-        if (!supported) {
-            return false;
-        }
-    }
-    return true;
-};
 
 var getPropertyFunction = function(cppLabel, objectCreateFunction) {
     return function() {
@@ -848,16 +818,6 @@ var getPropertyFunction = function(cppLabel, objectCreateFunction) {
         if (!propObject) {
             throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR, 'Property with id: ' + args.property + ' is not supported.');
         }
-
-        if (_checkPropertySupported(args.property) === false) {
-            setTimeout(function() {
-                native_.callIfPossible(args.errorCallback,
-                    new WebAPIException(WebAPIException.NOT_SUPPORTED_ERR,
-                    'Property with id: ' + args.property + ' is not supported.'));
-            }, 0);
-            return;
-        }
-
         var callback = function(result) {
             if (native_.isFailure(result)) {
                 setTimeout(function() {
@@ -1369,15 +1329,6 @@ var getListenerFunction = function (isArray) {
                  }
                  ]);
 
-        if (_checkPropertySupported(args.property) === false) {
-            setTimeout(function() {
-                native_.callIfPossible(args.errorCallback,
-                    new WebAPIException(WebAPIException.NOT_SUPPORTED_ERR,
-                    'Property with id: ' + args.property + ' is not supported.'));
-            }, 0);
-            return;
-        }
-
         var listener = {
                 callback      : args.successCallback,
                 isArrayType     : isArray,
index cec92deff1e0db05f4ec9525cf6c3d2111f66848..65675fcafc6a22f864bc62b83bcb32444d1e0956 100644 (file)
@@ -566,44 +566,17 @@ bool SystemInfoDeviceCapability::IsScreen() {
   return true;
 }
 
-
-#define MODEL_NAME      "http://tizen.org/system/model_name"
-#define MODEL_EMULATOR  "Emulator"
-bool _is_emulator(void)
-{
-  int ret;
-  char *model_name = NULL;
-  static bool emul = false;
-  static int set = 0;
-
-  if (set)
-    return emul;
-
-  ret = system_info_get_platform_string(MODEL_NAME, &model_name);
-  if (ret < 0) {
-    LoggerD("Cannot get model name(%d)", ret);
-    return emul;
-  }
-
-  if (!strncmp(MODEL_EMULATOR, model_name, strlen(model_name) + 1))
-    emul = true;
-
-  set = 1;
-  free(model_name);
-
-  return emul;
-}
-
 PlatformResult SystemInfoDeviceCapability::GetPlatformCoreCpuFrequency(int* return_value) {
   LoggerD("Entered");
 
   std::string freq;
   std::string file_name;
 
-  if(_is_emulator())
-    file_name = "/proc/cpuinfo";
-  else
-    file_name = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq";
+#ifdef TIZEN_IS_EMULATOR
+  file_name = "/proc/cpuinfo";
+#else
+  file_name = "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq";
+#endif
 
   std::ifstream cpuinfo_freq(file_name);
   if (!cpuinfo_freq.is_open()) {
@@ -612,24 +585,24 @@ PlatformResult SystemInfoDeviceCapability::GetPlatformCoreCpuFrequency(int* retu
               ("Failed to get cpu frequency"));
   }
 
-  if(_is_emulator()) {
-    //get frequency value from cpuinfo file
-    //example entry for frequency looks like below
-    //cpu MHz   : 3392.046
-    std::size_t found;
-    do {
-      getline(cpuinfo_freq, freq);
-      found = freq.find("cpu MHz");
-    } while (std::string::npos == found && !cpuinfo_freq.eof());
-
-    found = freq.find(":");
-    if (std::string::npos != found) {
-      *return_value = std::stoi(freq.substr(found + 2));
-    }
-  } else {
+#ifdef TIZEN_IS_EMULATOR
+  //get frequency value from cpuinfo file
+  //example entry for frequency looks like below
+  //cpu MHz   : 3392.046
+  std::size_t found;
+  do {
     getline(cpuinfo_freq, freq);
-    *return_value = std::stoi(freq) / 1000; // unit: MHz
+    found = freq.find("cpu MHz");
+  } while (std::string::npos == found && !cpuinfo_freq.eof());
+
+  found = freq.find(":");
+  if (std::string::npos != found) {
+    *return_value = std::stoi(freq.substr(found + 2));
   }
+#else
+  getline(cpuinfo_freq, freq);
+  *return_value = std::stoi(freq) / 1000; // unit: MHz
+#endif
 
   cpuinfo_freq.close();
   LoggerD("cpu frequency : %d", *return_value);
index 955719b702d5fc6567b6968c8f4988b5d8a62b98..8a5c6e499ac80872d0a58fbc9e3f6b4283d13174 100644 (file)
@@ -32,7 +32,6 @@
 #include "common/scope_exit.h"
 #include "systeminfo/systeminfo-utils.h"
 #include "common/filesystem/filesystem_provider.h"
-#include "common/GDBus/connection.h"
 
 namespace extension {
 namespace systeminfo {
@@ -47,11 +46,6 @@ const double kDisplayInchToMillimeter = 2.54;
 //Battery
 const double kRemainingBatteryChargeMax = 100.0;
 const int kVconfErrorNone = 0;
-const char *kBatteryTarget = "org.tizen.resourced";
-const char *kBatteryObject = "/Org/Tizen/ResourceD/Logging";
-const char *kBatteryInterface = "org.tizen.resourced.logging";
-const char *kBatteryGetBatteryChargingTime = "GetBatteryChargingTime";
-const char *kBatteryGetBatteryRemainingTime = "GetBatteryRemainingTime";
 //Display
 const double kDisplayBrightnessDivideValue = 100;
 //Device Orientation
@@ -215,62 +209,7 @@ PlatformResult SysteminfoPropertiesManager::ReportBattery(picojson::object* out)
               ErrorCode::UNKNOWN_ERR, (log_msg + std::to_string(ret)),
               ("vconf_get_int error: %d (%s)", ret, get_error_message(ret)));
   }
-  bool isCharging = (0 != value);
-  out->insert(std::make_pair("isCharging", picojson::value(isCharging)));
-
-  if (nullptr == common::dbus::Connection::getInstance().getDBus()) {
-    return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "dbus wasn't initialized");
-  }
-
-  GError* error = nullptr;
-  GVariant *variant = nullptr;
-  if (isCharging) {
-    variant = g_dbus_connection_call_sync(common::dbus::Connection::getInstance().getDBus(),
-                                          kBatteryTarget,
-                                          kBatteryObject,
-                                          kBatteryInterface,
-                                          kBatteryGetBatteryChargingTime,
-                                          g_variant_new("()"),
-                                          NULL,
-                                           G_DBUS_CALL_FLAGS_NONE,
-                                          -1,
-                                          NULL,
-                                          &error);
-  } else {
-    variant = g_dbus_connection_call_sync(common::dbus::Connection::getInstance().getDBus(),
-                                          kBatteryTarget,
-                                          kBatteryObject,
-                                          kBatteryInterface,
-                                          kBatteryGetBatteryRemainingTime,
-                                          g_variant_new("(i)", 0),   // 0 - POWER_NORMAL_MODE
-                                          NULL,                      // 1 - POWER_SAVING_MODE
-                                          G_DBUS_CALL_FLAGS_NONE,    // 2 - ULTRA_SAVING_MODE
-                                          -1,                        // for now, only 0 is supported
-                                          NULL,
-                                          &error);
-  }
-
-  if (!variant || error) {
-    std::string message = error ? error->message : "";
-    g_error_free(error);
-    return LogAndCreateResult(
-        ErrorCode::UNKNOWN_ERR,
-        "DBus returned error",
-        ("Failed to call %s method - %s",
-        isCharging ? "GetBatteryChargingTime" : "GetBatteryRemainingTime", message.c_str()));
-  } else {
-    int time = 0;
-    g_variant_get(variant, "(i)", &time);
-    g_variant_unref(variant);
-    if (isCharging) {
-      out->insert(std::make_pair("timeToFullCharge", picojson::value(static_cast<double>(time))));
-      out->insert(std::make_pair("timeToDischarge", picojson::value()));
-    } else {
-      out->insert(std::make_pair("timeToFullCharge", picojson::value()));
-      out->insert(std::make_pair("timeToDischarge", picojson::value(static_cast<double>(time))));
-    }
-  }
-
+  out->insert(std::make_pair("isCharging", picojson::value(0 != value)));
   return PlatformResult(ErrorCode::NO_ERROR);
 }