} app_match[] = {
{ APP_DEFAULT , POPUP_BUS_NAME, POPUP_PATH_SYSTEM , POPUP_INTERFACE_SYSTEM , POPUP_METHOD },
{ APP_POWERKEY, POPUP_BUS_NAME, POPUP_PATH_POWERKEY, POPUP_INTERFACE_POWERKEY, POPUP_METHOD },
+ { APP_OVERHEAT, POPUP_BUS_NAME, POPUP_PATH_OVERHEAT, POPUP_INTERFACE_OVERHEAT, POPUP_METHOD },
};
int launch_system_app(char *type, int num, ...)
#include "display/poll.h"
#define APP_POWERKEY "powerkey"
+#define APP_OVERHEAT "overheat"
#define APP_DEFAULT "system"
#define APP_KEY_TYPE "_SYSPOPUP_CONTENT_"
/* System */
#define POPUP_PATH_SYSTEM POPUP_OBJECT_PATH"/System"
#define POPUP_INTERFACE_SYSTEM POPUP_INTERFACE_NAME".System"
+/* Overheat */
+#define POPUP_PATH_OVERHEAT POPUP_OBJECT_PATH"/Overheat"
+#define POPUP_INTERFACE_OVERHEAT POPUP_INTERFACE_NAME".Overheat"
/* Crash */
#define POPUP_PATH_CRASH POPUP_OBJECT_PATH"/Crash"
#define POPUP_INTERFACE_CRASH POPUP_INTERFACE_NAME".Crash"
#include <Ecore.h>
#include <hw/thermal.h>
+#include "apps/apps.h"
#include "core/devices.h"
#include "core/log.h"
#include "core/device-notifier.h"
static struct thermal_device *thermal_dev;
+static int noti;
+
+static void thermal_remove_noti(void)
+{
+ if (noti) {
+ remove_notification("TempCooldownNotiOff", noti);
+ noti = 0;
+ }
+}
+
+static void thermal_add_noti(void)
+{
+ if (!noti)
+ noti = add_notification("TempCooldownNotiOn");
+}
+
+static void thermal_add_popup(void)
+{
+ launch_system_app(APP_OVERHEAT, 2,
+ APP_KEY_TYPE, "overheat");
+}
+
static void thermal_action(struct thermal_info *info, void *data)
{
if (!info)
switch (info->state) {
case THERMAL_STATE_LOW:
_E("THERMAL: temparature LOW");
+ thermal_remove_noti();
break;
case THERMAL_STATE_NORMAL:
_I("THERMAL: temparature normal");
+ thermal_remove_noti();
break;
case THERMAL_STATE_HIGH:
- if (info->level == THERMAL_LEVEL_WARNING)
+ if (info->level == THERMAL_LEVEL_WARNING) {
_E("THERMAL: temparature HIGH (warning)");
- else if (info->level == THERMAL_LEVEL_CRITICAL)
+ thermal_add_noti();
+ } else if (info->level == THERMAL_LEVEL_CRITICAL) {
_E("THERMAL: temparature HIGH (critical)");
- else if (info->level == THERMAL_LEVEL_POWEROFF)
+ thermal_remove_noti();
+ thermal_add_popup();
+ } else if (info->level == THERMAL_LEVEL_POWEROFF) {
_E("THERMAL: temparature HIGH (poweroff)");
- else
+ thermal_remove_noti();
+ thermal_add_popup();
+ } else
_E("THERMAL: temparature HIGH");
break;
default: