Languages

Menu
Sites
Language
Alarm Manager not working

Tizen 4.0: Gear S3

I have included the following code to set the alarm after 20 seconds.According to the documentation,the app_control is called when alarm is triggered.But Iam getting the issue of  ALARM_ERROR_NOT_PERMITTED_APP .Please help

void
init_alarm()
{
    int ret;
    int DELAY = 20;
    int REMIND = 1;
    int alarm_id;

    app_control_h app_control = NULL;
    ret = app_control_create(&app_control);
    dlog_print(DLOG_ERROR, LOG_TAG,"Ret1=%d",ret);
    ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
    dlog_print(DLOG_ERROR, LOG_TAG,"Ret2=%d",ret);
    ret = app_control_set_app_id(app_control, "org.example.basicuiwithedc");
    dlog_print(DLOG_ERROR, LOG_TAG,"Ret3=%d",ret);
    ret = alarm_schedule_after_delay(app_control, DELAY, REMIND, &alarm_id);
    if(ret==ALARM_ERROR_INVALID_PARAMETER){
            dlog_print(DLOG_ERROR, LOG_TAG,"ALARM_ERROR_INVALID_PARAMETER");
    }else if(ret==ALARM_ERROR_INVALID_TIME){
        dlog_print(DLOG_ERROR, LOG_TAG,"ALARM_ERROR_INVALID_TIME");
    }else if(ret==ALARM_ERROR_CONNECTION_FAIL){
        dlog_print(DLOG_ERROR, LOG_TAG,"ALARM_ERROR_CONNECTION_FAIL");

    }else if(ret==ALARM_ERROR_PERMISSION_DENIED){
        dlog_print(DLOG_ERROR, LOG_TAG,"ALARM_ERROR_PERMISSION_DENIED");

    }else if(ret==ALARM_ERROR_NOT_PERMITTED_APP){
        dlog_print(DLOG_ERROR, LOG_TAG,"ALARM_ERROR_NOT_PERMITTED_APP");

    }
}

 

static void  app_control(app_control_h app_control, void *data){

       dlog_print(DLOG_ERROR, LOG_TAG,"Alarm Ringing");

}

Responses

1 Replies
GEUNSOO KIM

did you set privileges for alarm?