From: lokilee73 Date: Mon, 6 Jul 2020 07:09:34 +0000 (+0900) Subject: Remove unused battery related notification code X-Git-Tag: submit/tizen/20200819.040524^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_6.0;p=platform%2Fcore%2Fsystem%2Fsystem-popup.git Remove unused battery related notification code Change-Id: Ied65063d3b01049ed69817b5efb3d2c040faa56e Signed-off-by: lokilee73 --- diff --git a/data/noti_charging_battery_low.png b/data/noti_charging_battery_low.png deleted file mode 100644 index 954d929..0000000 Binary files a/data/noti_charging_battery_low.png and /dev/null differ diff --git a/packaging/system-servant.spec b/packaging/system-servant.spec index 6c57c7b..81fec37 100644 --- a/packaging/system-servant.spec +++ b/packaging/system-servant.spec @@ -556,7 +556,6 @@ mv /%{TZ_SYS_RO_APP}/org.tizen.powerkey-syspopup/bin/powerkey-popup.wearable /%{ %{_bindir}/system-cooperator %{_datadir}/system-apps/res/icons/batt_full_icon.png %{_datadir}/system-apps/res/icons/batt_full_indicator.png -%{_datadir}/system-apps/res/icons/noti_charging_battery_low.png %{_datadir}/system-apps/res/icons/noti_cooling_down.png %{_datadir}/system-apps/res/icons/datausage_warning.png %{_datadir}/system-apps/res/icons/led_torch.png diff --git a/src/launcher/CMakeLists.txt b/src/launcher/CMakeLists.txt index 5f1f4ab..38b991e 100644 --- a/src/launcher/CMakeLists.txt +++ b/src/launcher/CMakeLists.txt @@ -55,7 +55,6 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/datausage_warning.png DESTINATION ${SYST INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/led_torch.png DESTINATION ${SYSTEM_ICONDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/batt_full_icon.png DESTINATION ${SYSTEM_ICONDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/batt_full_indicator.png DESTINATION ${SYSTEM_ICONDIR}) -INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/noti_charging_battery_low.png DESTINATION ${SYSTEM_ICONDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/usb_icon.png DESTINATION ${SYSTEM_ICONDIR}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/noti_cooling_down.png DESTINATION ${SYSTEM_ICONDIR}) ENDIF(NOTIFICATION_SERVICE STREQUAL on) diff --git a/src/launcher/launcher.c b/src/launcher/launcher.c index f131603..7f465e8 100644 --- a/src/launcher/launcher.c +++ b/src/launcher/launcher.c @@ -119,54 +119,6 @@ static DBusMessage *battery_charge_noti_on(E_DBus_Object *obj, DBusMessage *msg) return launch_system_servant_app(obj, msg, args); } -static DBusMessage *battery_low_noti_on(E_DBus_Object *obj, DBusMessage *msg) -{ - set_timer_to_terminate(); - return activate_notification_no_param(obj, msg, BATTERY_LOW); -} - -static DBusMessage *battery_critical_noti_on(E_DBus_Object *obj, DBusMessage *msg) -{ - set_timer_to_terminate(); - return activate_notification_no_param(obj, msg, BATTERY_CRITICAL); -} - -static DBusMessage *battery_low_actnoti_on(E_DBus_Object *obj, DBusMessage *msg) -{ - set_timer_to_terminate(); - return activate_notification_single_param(obj, msg, BATTERY_LOW_ACT); -} - -static DBusMessage *battery_critical_actnoti_on(E_DBus_Object *obj, DBusMessage *msg) -{ - set_timer_to_terminate(); - return activate_notification_single_param(obj, msg, BATTERY_CRITICAL_ACT); -} - -static DBusMessage *battery_low_actnoti_usb_on(E_DBus_Object *obj, DBusMessage *msg) -{ - set_timer_to_terminate(); - return activate_notification_no_param(obj, msg, BATTERY_LOW_USB_ACT); -} - -static DBusMessage *battery_critical_actnoti_usb_on(E_DBus_Object *obj, DBusMessage *msg) -{ - set_timer_to_terminate(); - return activate_notification_no_param(obj, msg, BATTERY_CRITICAL_USB_ACT); -} - -static DBusMessage *battery_low_actnoti_chg_on(E_DBus_Object *obj, DBusMessage *msg) -{ - set_timer_to_terminate(); - return activate_notification_no_param(obj, msg, BATTERY_LOW_CHG_ACT); -} - -static DBusMessage *battery_critical_actnoti_chg_on(E_DBus_Object *obj, DBusMessage *msg) -{ - set_timer_to_terminate(); - return activate_notification_no_param(obj, msg, BATTERY_CRITICAL_CHG_ACT); -} - /* Datausage */ static DBusMessage *data_warning_noti_on(E_DBus_Object *obj, DBusMessage *msg) { @@ -276,16 +228,6 @@ dbus_noti_methods[] = { { "BatteryFullNotiOn" , NULL , "i" , battery_full_noti_on }, { "BatteryFullNotiOff" , "i" , "i" , noti_off }, { "BatteryChargeNotiOn" , NULL , "i" , battery_charge_noti_on }, - { "BatteryLowNotiOn" , NULL , "i" , battery_low_noti_on }, - { "BatteryCriticalNotiOn" , NULL , "i" , battery_critical_noti_on }, - { "BatteryLowCriticalNotiOff" , "i" , "i" , noti_off }, - /* Battery Active noti*/ - { "BatteryLowActNotiOn" , "s" , "i" , battery_low_actnoti_on }, - { "BatteryCriticalActNotiOn", "s" , "i" , battery_critical_actnoti_on }, - { "BatteryLowActNotiUsbOn" , NULL , "i" , battery_low_actnoti_usb_on }, - { "BatteryCriticalActNotiUsbOn" , NULL , "i" , battery_critical_actnoti_usb_on }, - { "BatteryLowActNotiChgOn" , NULL , "i" , battery_low_actnoti_chg_on }, - { "BatteryCriticalActNotiChgOn" , NULL , "i" , battery_critical_actnoti_chg_on }, /* Temperature */ { "TempCooldownNotiOn" , NULL , "i" , cooldown_noti_on }, { "TempCooldownNotiOff" , "i" , "i" , noti_off }, diff --git a/src/launcher/launcher.h b/src/launcher/launcher.h index ab776dd..d194bae 100644 --- a/src/launcher/launcher.h +++ b/src/launcher/launcher.h @@ -56,7 +56,6 @@ #define USB_ICON SYSTEM_ICONDIR"/usb_icon.png" #define BATT_INDI_ICON SYSTEM_ICONDIR"/batt_full_indicator.png" #define BATT_NOTI_ICON SYSTEM_ICONDIR"/batt_full_icon.png" -#define BATT_LOW_INDI_ICON SYSTEM_ICONDIR"/noti_charging_battery_low.png" #define COOLDOWN_NOTI_ICON SYSTEM_ICONDIR"/noti_cooling_down.png" diff --git a/src/launcher/noti.c b/src/launcher/noti.c index d2ddccf..05b830d 100644 --- a/src/launcher/noti.c +++ b/src/launcher/noti.c @@ -70,26 +70,6 @@ static void set_language(void) free(lang); } -notification_error_e set_contents_for_lowbat_noti(char *title, notification_h noti, char *content, char *sig, va_list args) -{ - int var = 0; - notification_error_e noti_err = NOTIFICATION_ERROR_INVALID_PARAMETER; - - if (strncmp(sig, "i", 1)) - return noti_err; - - var = va_arg(args, int); - noti_err = notification_set_text(noti, - NOTIFICATION_TEXT_TYPE_CONTENT, - _(content), - content, - NOTIFICATION_VARIABLE_TYPE_INT, - var, - NOTIFICATION_VARIABLE_TYPE_NONE); - - return noti_err; -} - static int add_notification( int type, int layout, char *title, char *content, @@ -626,41 +606,6 @@ static int launch_usb_device_notification(char *dev, char *name) return ret; } -static int launch_battery_discharge_active_notification(void *data, int type) -{ - int ret; - bundle *b; - char *title = NULL; - int capacity = atoi(data); - - b = bundle_create(); - if (b) - appsvc_set_pkgname(b, SYSTEM_SIGNAL_SENDER); - - if (type == BATTERY_LOW_ACT) - title = "IDS_QP_HEADER_BATTERY_LOW_ABB"; - else if (type == BATTERY_CRITICAL_ACT) - title = "IDS_QP_HEADER_BATTERY_CRITICALLY_LOW_ABB"; - - ret = add_notification(NOTIFICATION_TYPE_NOTI, - NOTIFICATION_LY_ONGOING_EVENT, - title, - "IDS_QP_POP_YOUR_DEVICE_HAS_PDP_BATTERY_POWER_REMAINING_CONNECT_A_CHARGER_ABB", - BATT_LOW_INDI_ICON, - NULL, - b, - NOTIFICATION_PROP_VOLATILE_DISPLAY, - NOTIFICATION_DISPLAY_APP_ACTIVE, - set_contents_for_lowbat_noti, - "i", - capacity); - - if (b) - bundle_free(b); - - return ret; -} - static int launch_ticker_notification(void *data) { char *content, *input; @@ -723,10 +668,6 @@ static int launch_battery_notification(int type) { int ret = -EINVAL; -#ifndef PROFILE_MOBILE // event noti should be supported in mobile profile only - return ret; -#endif - if (type == BATTERY_FULL) { ret = add_notification(NOTIFICATION_TYPE_ONGOING, NOTIFICATION_LY_ONGOING_EVENT, @@ -739,88 +680,6 @@ static int launch_battery_notification(int type) NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY, NULL, NULL); - } else if (type == BATTERY_LOW) { - ret = add_notification(NOTIFICATION_TYPE_ONGOING, - NOTIFICATION_LY_ONGOING_EVENT, - "IDS_QP_HEADER_BATTERY_LOW_ABB", - "IDS_QP_SBODY_CONNECT_A_CHARGER_ABB", - BATT_LOW_INDI_ICON, - NULL, - NULL, - NOTIFICATION_PROP_DISABLE_APP_LAUNCH, - NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY, - NULL, - NULL); - } else if (type == BATTERY_CRITICAL) { - ret = add_notification(NOTIFICATION_TYPE_ONGOING, - NOTIFICATION_LY_ONGOING_EVENT, - "IDS_QP_HEADER_BATTERY_CRITICALLY_LOW_ABB", - "IDS_QP_SBODY_CONNECT_A_CHARGER_ABB", - BATT_LOW_INDI_ICON, - NULL, - NULL, - NOTIFICATION_PROP_DISABLE_APP_LAUNCH, - NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY, - NULL, - NULL); - } else - _E("Unknown type(%d).", type); - - return ret; -} - -static int launch_battery_active_notification(int type) -{ - int ret = -EINVAL; - - if (type == BATTERY_LOW_USB_ACT) { - ret = add_notification(NOTIFICATION_TYPE_NOTI, - NOTIFICATION_LY_ONGOING_EVENT, - "IDS_QP_HEADER_BATTERY_LOW_ABB", - "IDS_QP_POP_USE_A_PLUG_SOCKET_AND_CLOSE_UNUSED_APPS_FOR_QUICKER_CHARGING_ABB", - BATT_LOW_INDI_ICON, - NULL, - NULL, - NOTIFICATION_PROP_VOLATILE_DISPLAY, - NOTIFICATION_DISPLAY_APP_ACTIVE, - NULL, - NULL); - } else if (type == BATTERY_CRITICAL_USB_ACT) { - ret = add_notification(NOTIFICATION_TYPE_NOTI, - NOTIFICATION_LY_ONGOING_EVENT, - "IDS_QP_HEADER_BATTERY_CRITICALLY_LOW_ABB", - "IDS_QP_POP_USE_A_PLUG_SOCKET_AND_CLOSE_UNUSED_APPS_FOR_QUICKER_CHARGING_ABB", - BATT_LOW_INDI_ICON, - NULL, - NULL, - NOTIFICATION_PROP_VOLATILE_DISPLAY, - NOTIFICATION_DISPLAY_APP_ACTIVE, - NULL, - NULL); - } else if (type == BATTERY_LOW_CHG_ACT) { - ret = add_notification(NOTIFICATION_TYPE_NOTI, - NOTIFICATION_LY_ONGOING_EVENT, - "IDS_QP_HEADER_BATTERY_LOW_ABB", - "IDS_QP_POP_CONTINUED_USAGE_WHILE_CHARGING_MAY_PREVENT_EFFICIENT_CHARGING_ABB", - BATT_LOW_INDI_ICON, - NULL, - NULL, - NOTIFICATION_PROP_VOLATILE_DISPLAY, - NOTIFICATION_DISPLAY_APP_ACTIVE, - NULL, - NULL); - } else if (type == BATTERY_CRITICAL_CHG_ACT) { - ret = add_notification(NOTIFICATION_TYPE_NOTI, - NOTIFICATION_LY_ONGOING_EVENT, - "IDS_QP_HEADER_BATTERY_CRITICALLY_LOW_ABB", - "IDS_QP_POP_CONTINUED_USAGE_WHILE_CHARGING_MAY_PREVENT_EFFICIENT_CHARGING_ABB", - BATT_LOW_INDI_ICON, - NULL, - NULL, - NOTIFICATION_PROP_VOLATILE_DISPLAY, - NOTIFICATION_DISPLAY_APP_ACTIVE, - NULL, - NULL); } else _E("Unknown type(%d).", type); @@ -861,14 +720,7 @@ static int launch_notification_no_param_by_type(int type) case TIMA_PKM_DETECTION: return launch_tima_pkm_detection_notification(); case BATTERY_FULL: - case BATTERY_LOW: - case BATTERY_CRITICAL: return launch_battery_notification(type); - case BATTERY_LOW_USB_ACT: - case BATTERY_CRITICAL_USB_ACT: - case BATTERY_LOW_CHG_ACT: - case BATTERY_CRITICAL_CHG_ACT: - return launch_battery_active_notification(type); case MEDIA_DEVICE: return launch_media_device_notification(); case TEMP_COOLDOWN: @@ -893,9 +745,6 @@ static int launch_notification_single_param_by_type(int type, void *data) case USB_STORAGE: case USB_STORAGE_RO: return launch_usb_storage_notification(data, type); - case BATTERY_LOW_ACT: - case BATTERY_CRITICAL_ACT: - return launch_battery_discharge_active_notification(data, type); default: _E("Noti type is unknown."); return -EINVAL;