Remove unused battery related notification code 58/237858/4 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_unified tizen tizen_6.0 tizen_6.0_hotfix tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/6.0/unified/20201030.113528 accepted/tizen/6.0/unified/hotfix/20201103.001453 accepted/tizen/6.5/unified/20211028.115959 accepted/tizen/7.0/unified/20221110.062120 accepted/tizen/7.0/unified/hotfix/20221116.105816 accepted/tizen/8.0/unified/20231005.093858 accepted/tizen/unified/20200820.133543 submit/tizen/20200819.040524 submit/tizen_6.0/20201029.205105 submit/tizen_6.0_hotfix/20201102.192505 submit/tizen_6.0_hotfix/20201103.114805 submit/tizen_6.5/20211028.162501 tizen_6.0.m2_release tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release
authorlokilee73 <changjoo.lee@samsung.com>
Mon, 6 Jul 2020 07:09:34 +0000 (16:09 +0900)
committerlokilee73 <changjoo.lee@samsung.com>
Mon, 6 Jul 2020 11:07:45 +0000 (20:07 +0900)
Change-Id: Ied65063d3b01049ed69817b5efb3d2c040faa56e
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
data/noti_charging_battery_low.png [deleted file]
packaging/system-servant.spec
src/launcher/CMakeLists.txt
src/launcher/launcher.c
src/launcher/launcher.h
src/launcher/noti.c

diff --git a/data/noti_charging_battery_low.png b/data/noti_charging_battery_low.png
deleted file mode 100644 (file)
index 954d929..0000000
Binary files a/data/noti_charging_battery_low.png and /dev/null differ
index 6c57c7b..81fec37 100644 (file)
@@ -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
index 5f1f4ab..38b991e 100644 (file)
@@ -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)
index f131603..7f465e8 100644 (file)
@@ -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                      },
index ab776dd..d194bae 100644 (file)
@@ -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"
 
 
index d2ddccf..05b830d 100644 (file)
@@ -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;