196279301Sopenharmony_ci/*
296279301Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
396279301Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
496279301Sopenharmony_ci * you may not use this file except in compliance with the License.
596279301Sopenharmony_ci * You may obtain a copy of the License at
696279301Sopenharmony_ci *
796279301Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
896279301Sopenharmony_ci *
996279301Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1096279301Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1196279301Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1296279301Sopenharmony_ci * See the License for the specific language governing permissions and
1396279301Sopenharmony_ci * limitations under the License.
1496279301Sopenharmony_ci */
1596279301Sopenharmony_ci
1696279301Sopenharmony_ci#include "notification.h"
1796279301Sopenharmony_ci
1896279301Sopenharmony_ci#include "notification_helper.h"
1996279301Sopenharmony_ci#include "ans_log_wrapper.h"
2096279301Sopenharmony_ci
2196279301Sopenharmony_ci#ifdef __cplusplus
2296279301Sopenharmony_ciextern "C" {
2396279301Sopenharmony_ci#endif
2496279301Sopenharmony_ci
2596279301Sopenharmony_cibool OH_Notification_IsNotificationEnabled(void)
2696279301Sopenharmony_ci{
2796279301Sopenharmony_ci    bool isEnable = false;
2896279301Sopenharmony_ci    int32_t result = OHOS::Notification::NotificationHelper::IsAllowedNotifySelf(isEnable);
2996279301Sopenharmony_ci    if (result != OHOS::ERR_OK) {
3096279301Sopenharmony_ci        ANS_LOGW("Get notification enable failed %{public}d", result);
3196279301Sopenharmony_ci        return false;
3296279301Sopenharmony_ci    }
3396279301Sopenharmony_ci    return isEnable;
3496279301Sopenharmony_ci}
3596279301Sopenharmony_ci
3696279301Sopenharmony_ci#ifdef __cplusplus
3796279301Sopenharmony_ci}
3896279301Sopenharmony_ci#endif
39