free(uids);
return -1;
} else {
- if (!strncmp(state, "online", 6)) {
+ if (!strcmp(state, "online")) {
*uid = uids[i];
free(uids);
free(state);
__alarm_info_t *entry = NULL;
bool is_restored = false;
- if (key && strncmp(key, "end", 3) == 0 && val && strncmp(val, "ok", 2) == 0) {
+ if (key && strcmp(key, "end") == 0 && val && strcmp(val, "ok") == 0) {
SECURE_LOGD("Enable appid(%s)", appid);
for (gs_iter = g_disabled_alarm_list; gs_iter != NULL; ) {
entry = (__alarm_info_t *)gs_iter->data;
gs_iter = g_slist_next(gs_iter);
- if (strncmp(appid, entry->app_unique_name, strlen(appid)) == 0) {
+ if (strcmp(appid, entry->app_unique_name) == 0) {
_alarm_set_next_duetime(entry);
SECURE_LOGD("Restore alarm_id(%d) duetime(%d) appid(%s)",
entry->alarm_id, (int)(entry->due_time), appid);
__alarm_info_t *entry = NULL;
bool is_disabled = false;
- if (key && strncmp(key, "end", 3) == 0 && val && strncmp(val, "ok", 2) == 0) {
+ if (key && strcmp(key, "end") == 0 && val && strcmp(val, "ok") == 0) {
SECURE_LOGD("Disable appid(%s)", appid);
for (gs_iter = alarm_context.alarms; gs_iter != NULL; ) {
entry = (__alarm_info_t *)gs_iter->data;
gs_iter = g_slist_next(gs_iter);
- if (strncmp(appid, entry->app_unique_name, strlen(appid)) == 0) {
+ if (strcmp(appid, entry->app_unique_name) == 0) {
if (!(entry->base_info.alarm_type & ALARM_TYPE_VOLATILE))
_update_db_for_disabled_alarm(entry->alarm_id, true);
g_disabled_alarm_list = g_slist_append(g_disabled_alarm_list, entry);
if (using_rtc && GET_POWER_SAVING_MODE() == -1)
return ALARMMGR_RESULT_SUCCESS;
- if ((key && strncmp(key, "end", 3) != 0) || (val && strncmp(val, "ok", 2) != 0))
+ if ((key && strcmp(key, "end") != 0) || (val && strcmp(val, "ok") != 0))
return ALARMMGR_RESULT_SUCCESS;
if (g_slist_length(g_disabled_alarm_list) == 0)
const char *callee_pkgid = entry->callee_pkgid;
gs_iter = g_slist_next(gs_iter);
- if ((caller_pkgid && strncmp(pkgid, caller_pkgid, strlen(pkgid)) == 0) ||
- (callee_pkgid && strncmp(pkgid, callee_pkgid, strlen(pkgid)) == 0)) {
+ if ((caller_pkgid && strcmp(pkgid, caller_pkgid) == 0) ||
+ (callee_pkgid && strcmp(pkgid, callee_pkgid) == 0)) {
_alarm_set_next_duetime(entry);
alarm_context.alarms = g_slist_append(alarm_context.alarms, entry);
g_disabled_alarm_list = g_slist_remove(g_disabled_alarm_list, entry);
SECURE_LOGD("pkg_type(%s), pkgid(%s), key(%s), value(%s)", pkg_type, pkgid, key, val);
- if ((key && strncmp(key, "end", 3) != 0) || (val && strncmp(val, "ok", 2) != 0))
+ if ((key && strcmp(key, "end") != 0) || (val && strcmp(val, "ok") != 0))
return ALARMMGR_RESULT_SUCCESS;
if (using_rtc)
const char *callee_pkgid = entry->callee_pkgid;
gs_iter = g_slist_next(gs_iter);
- if ((caller_pkgid && strncmp(pkgid, caller_pkgid, strlen(pkgid)) == 0) ||
- (callee_pkgid && strncmp(pkgid, callee_pkgid, strlen(pkgid)) == 0)) {
+ if ((caller_pkgid && strcmp(pkgid, caller_pkgid) == 0) ||
+ (callee_pkgid && strcmp(pkgid, callee_pkgid) == 0)) {
if (_remove_from_scheduled_alarm_list(entry->uid, entry->alarm_id))
is_deleted = true;
entry = (__alarm_info_t*)gs_iter->data;
const char *tmp_appname = entry->app_unique_name;
SECURE_LOGD("Try to remove app_name[%s], alarm_id[%d]\n", tmp_appname, entry->alarm_id);
- if (tmp_appname && strncmp(app_name, tmp_appname, strlen(tmp_appname)) == 0) {
+ if (tmp_appname && strcmp(app_name, tmp_appname) == 0) {
if (_remove_from_scheduled_alarm_list(uid, entry->alarm_id))
is_deleted = true;
entry = (__alarm_info_t*)gs_iter->data;
SECURE_LOGD("app_name=%s, app_unique_name=%s", app_name, entry->app_unique_name);
if (entry->uid == uid &&
- strncmp(app_name, entry->app_unique_name, strlen(app_name)) == 0) {
+ strcmp(app_name, entry->app_unique_name) == 0) {
(_num_of_ids)++;
SECURE_LOGD("inc number of alarms of app (uid:%d, pid:%d, unique_name:%s) is %d.", uid, pid, app_name, _num_of_ids);
}
for (gs_iter = alarm_context.alarms; gs_iter != NULL; gs_iter = g_slist_next(gs_iter)) {
entry = (__alarm_info_t*)gs_iter->data;
if (entry->uid == uid &&
- strncmp(app_name, (entry->app_unique_name), strlen(app_name)) == 0) {
+ strcmp(app_name, (entry->app_unique_name)) == 0) {
g_variant_builder_add(alarm_array, "(i)", entry->alarm_id);
index++;
SECURE_LOGE("called for alarmid(%d), but max_number_of_ids(%d) index %d.", entry->alarm_id, max_number_of_ids, index);