• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef AUDIO_SAFE_VOLUME_NOTIFICATION_H
17 #define AUDIO_SAFE_VOLUME_NOTIFICATION_H
18 
19 #include <cstdint>
20 #include <string>
21 
22 namespace OHOS {
23 namespace AudioStandard {
24 const uint32_t SAVE_VOLUME_SYS_ABILITY_ID = 1041;
25 const int32_t RESTORE_VOLUME_NOTIFICATION_ID = 116000;
26 const int32_t INCREASE_VOLUME_NOTIFICATION_ID = 116001;
27 const uint32_t NOTIFICATION_BANNER_FLAG = 1 << 9;
28 const uint32_t NOTIFICATION_CLOSE_SOUND_FLAG = 1 << 0;
29 const std::string AUDIO_RESTORE_VOLUME_EVENT = "AUDIO_RESTORE_VOLUME_EVENT";
30 const std::string AUDIO_INCREASE_VOLUME_EVENT = "AUDIO_INCREASE_VOLUME_EVENT";
31 const std::string SAVE_VOLUME_SYS_ABILITY_NAME = "audio_service";
32 
33 const std::string SAFE_VOLUME_ICON_ID = "safe_volume_notification_icon";
34 const std::string SAFE_VOLUME_MUSIC_TIMER_TITTLE_ID = "ohos_id_notification_restore_volume_tittle";
35 const std::string SAFE_VOLUME_INCREASE_VOLUME_TITTLE_ID = "ohos_id_notification_increase_volume_tittle";
36 const std::string SAFE_VOLUME_MUSIC_TIMER_TEXT_ID = "ohos_id_notification_restore_volume_context";
37 const std::string SAFE_VOLUME_INCREASE_VOLUME_TEXT_ID = "ohos_id_notification_increase_volume_context";
38 const std::string SAFE_VOLUME_RESTORE_VOL_BUTTON_ID = "ohos_id_notification_restore_volume_button";
39 const std::string SAFE_VOLUME_INCREASE_VOL_BUTTON_ID = "ohos_id_notification_increase_volume_button";
40 
41 const int32_t ICON_WIDTH = 220;
42 const int32_t ICON_HEIGHT = 220;
43 
44 class AudioSafeVolumeNotification {
45 public:
46     AudioSafeVolumeNotification() = default;
47     virtual ~AudioSafeVolumeNotification() = default;
48 
49     virtual void PublishSafeVolumeNotification(int32_t notificationId) = 0;
50     virtual void CancelSafeVolumeNotification(int32_t notificationId) = 0;
51 };
52 
53 typedef AudioSafeVolumeNotification* CreateSafeVolumeNotification();
54 } // namespace AudioStandard
55 } // namespace OHOS
56 #endif // AUDIO_SAFE_VOLUME_NOTIFICATION_H
57