Fix prevent issue
[platform/framework/native/appfw.git] / src / app / FApp_NotificationManagerImpl.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                FApp_NotificationManagerImpl.cpp
19  * @brief               This is the placeholder for _NotificationManagerImpl class.
20  */
21
22 #include <unique_ptr.h>
23
24 #include <appsvc/appsvc.h>
25 #include <bundle.h>
26 #include <badge.h>
27 #include <notification/notification.h>
28 #include <appfw/app.h>
29 #include <appfw/app_ui_notification.h>
30
31 #include <FBaseSysLog.h>
32 #include <FAppNotificationManager.h>
33
34 #include <FBaseInternalTypes.h>
35 #include <FBase_StringConverter.h>
36 #include "FApp_NotificationManagerImpl.h"
37 #include "FApp_AppInfo.h"
38 #include "FIoFile.h"
39 #include "FAppPkg_PackageManagerImpl.h"
40 #include "FApp_Aul.h"
41 #include "FApp_AppArg.h"
42 #include "FAppPkgPackageAppInfo.h"
43 #include "FAppPkg_PackageAppInfoImpl.h"
44
45 using namespace Tizen::Base;
46 using namespace Tizen::App;
47 using namespace Tizen::App::Package;
48 using namespace Tizen::Io;
49
50 extern "C" int service_create_request(bundle *data, service_h *service);
51
52 namespace
53 {
54
55 result
56 ConvertNotificationResult(int error)
57 {
58         switch (error)
59         {
60         case UI_NOTIFICATION_ERROR_NONE:
61                 return E_SUCCESS;
62         case UI_NOTIFICATION_ERROR_INVALID_PARAMETER:
63                 return E_INVALID_ARG;
64         case UI_NOTIFICATION_ERROR_OUT_OF_MEMORY:
65                 return E_OUT_OF_MEMORY;
66         case UI_NOTIFICATION_ERROR_DB_FAILED:
67                 return E_DATABASE;
68         case UI_NOTIFICATION_ERROR_NO_SUCH_FILE:
69                 return E_SYSTEM;
70         case UI_NOTIFICATION_ERROR_INVALID_STATE:
71                 return E_SYSTEM;
72         default:
73                 return E_SYSTEM;
74         }
75 }
76
77 bool
78 IsPosted(ui_notification_h handle)
79 {
80         struct ui_notification_s
81         {
82                 void* raw_handle;
83                 bool ongoing;
84                 bool posted;
85                 bool removed;
86                 char *icon;
87                 struct tm *time;
88                 char *title;
89                 char *content;
90                 service_h service;
91                 char *sound;
92                 bool vibration;
93         };
94
95         if (handle == NULL)
96         {
97                 return false;
98         }
99
100         ui_notification_s* pStruct = reinterpret_cast<ui_notification_s*>(handle);
101
102         return pStruct->posted;
103 }
104
105 }
106
107 namespace Tizen { namespace App
108 {
109
110 _NotificationManagerImpl::_NotificationManagerImpl(void)
111 {
112 }
113
114 _NotificationManagerImpl::~_NotificationManagerImpl(void)
115 {
116 }
117
118 result
119 _NotificationManagerImpl::Construct(void)
120 {
121         return E_SUCCESS;
122 }
123
124 const _NotificationManagerImpl*
125 _NotificationManagerImpl::GetInstance(const NotificationManager& notiMgr)
126 {
127         return notiMgr.__pNotificationManagerImpl;
128 }
129
130 _NotificationManagerImpl*
131 _NotificationManagerImpl::GetInstance(NotificationManager& notiMgr)
132 {
133         return notiMgr.__pNotificationManagerImpl;
134 }
135
136 int
137 _NotificationManagerImpl::GetBadgeNumber(void) const
138 {
139         unsigned int count = 0;
140
141         const AppId appId = _AppInfo::GetApplicationId();
142
143         std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
144
145         badge_error_e badgeError = badge_get_count(pAppId.get(), &count);
146
147         if (badgeError == BADGE_ERROR_NONE)
148         {
149                 SysLog(NID_APP, "badge_get_count(%d)", count);
150         }
151         else
152         {
153                 SysLog(NID_APP, "badge_get_count failed(%d).", badgeError);
154                 return -1;
155         }
156         return count;
157 }
158
159 result
160 _NotificationManagerImpl::OngoingImpl(const String& messageText, const String& launchArguments) const
161 {
162         return NotifyImpl(messageText, -1, launchArguments, true);
163 }
164
165 result
166 _NotificationManagerImpl::OngoingImpl(const AppId& appId, const String& messageText, const String& launchArguments) const
167 {
168
169         return NotifyImpl(appId, messageText, -1, launchArguments, true);
170 }
171
172 result
173 _NotificationManagerImpl::NotifyImpl(const String& messageText, int badgeNumber,
174                                                                          const String& launchArguments,
175                                                                          bool isOngoing) const
176 {
177         result r = E_SUCCESS;
178         int retcode = 0;
179         char* pMsg = null;
180         char* pkgname = NULL;
181         char* pIcon = NULL;
182         bundle* pKb = NULL;
183         service_h svc = NULL;
184         _AppArg arg;
185         String iconPath;
186         ui_notification_h core = NULL;
187         PackageAppInfo* pPackageAppInfo = NULL;
188
189         if (!messageText.IsEmpty())
190         {
191                 SysTryReturnResult(NID_APP,
192                                           messageText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
193                                           "MessageText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
194
195                 retcode = ui_notification_create(isOngoing, &core);
196                 SysTryReturnResult(NID_APP, retcode == UI_NOTIFICATION_ERROR_NONE, E_SYSTEM, "Notification creation error : 0x%x.", retcode);
197
198                 pMsg = _StringConverter::CopyToCharArrayN(messageText);
199
200                 int ret = ui_notification_set_content(core, pMsg);
201                 SysTryLog(NID_APP, ret == UI_NOTIFICATION_ERROR_NONE, "Setting notification content failure : %d.", ret);
202
203                 const String& currappId = _AppInfo::GetApplicationId();
204
205                 pPackageAppInfo = _PackageManagerImpl::GetInstance()->GetPackageAppInfoN(currappId);
206                 iconPath = _PackageAppInfoImpl::GetInstance(pPackageAppInfo)->GetAppNotificationIconPath();
207
208                 if (!iconPath.IsEmpty() && File::IsFileExist(iconPath))
209                 {
210                         pIcon = _StringConverter::CopyToCharArrayN(iconPath);
211                         r = ConvertNotificationResult(ui_notification_set_icon(core, pIcon));
212                         SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set icon failed.", GetErrorMessage(r));
213                 }
214
215                 app_get_package(&pkgname);
216                 SysTryCatch(NID_APP, pkgname != NULL, r = E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] Cannot acquire package name for current application.");
217
218                 r = arg.Construct(launchArguments);
219                 SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
220
221                 pKb = arg.GetBundle();
222                 service_create_request(pKb, &svc);
223
224                 service_set_package(svc, pkgname);
225                 r = ConvertNotificationResult(ui_notification_set_service(core, svc));
226                 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set service failed.", GetErrorMessage(r));
227
228                 SysLog(NID_APP, "Sending notification[%ls] for package %s.", messageText.GetPointer(), pkgname);
229
230                 r = ConvertNotificationResult(ui_notification_post(core));
231                 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
232         }
233
234         if (badgeNumber >= 0)
235         {
236                 const AppId appId = _AppInfo::GetApplicationId();
237                 std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
238                 badge_error_e badgeError = badge_set_count(pAppId.get(), badgeNumber);
239                 SysTryLog(NID_APP, badgeError == BADGE_ERROR_NONE, "badge_set_count failed(%d).", badgeError);
240         }
241
242 CATCH:
243         delete pPackageAppInfo;
244         delete[] pMsg;
245         delete[] pIcon;
246
247         if (pkgname)
248         {
249                 free(pkgname);
250         }
251         if (core)
252         {
253                 ui_notification_destroy(core);
254         }
255         service_destroy(svc);
256         return r;
257 }
258
259 result
260 _NotificationManagerImpl::NotifyImpl(const AppId& appId, const String& messageText, int badgeNumber,
261                                                                          const String& launchArguments,
262                                                                          bool isOngoing) const
263 {
264         result r = E_SUCCESS;
265         int retcode = 0;
266         String iconPath;
267         char* pMsg = null;
268         char* pIcon = null;
269         char* pName = null;
270         ui_notification_h core = NULL;
271         char buffer[256];
272         bundle* pKb = NULL;
273         service_h svc = NULL;
274         _AppArg arg;
275         PackageAppInfo* pPackageAppInfo = null;
276
277         memset(buffer, 0, 256);
278
279         bool inInstalled = _Aul::IsInstalled(appId);
280         SysTryReturnResult(NID_APP, inInstalled == true, E_APP_NOT_INSTALLED, "The application %ls is not installed", appId.GetPointer());
281
282         if (!isOngoing || !messageText.IsEmpty())
283         {
284                 SysTryReturnResult(NID_APP,
285                                           messageText.GetLength() <= MAX_NOTIFICATION_MESSAGE_LENGTH, E_INVALID_ARG,
286                                           "MessageText is greater than MAX_NOTIFICATION_MESSAGE_LENGTH.");
287
288                 retcode = ui_notification_create(isOngoing, &core);
289                 SysTryReturnResult(NID_APP, retcode == UI_NOTIFICATION_ERROR_NONE, E_SYSTEM, "Notification creation error : 0x%x.", retcode);
290
291                 pMsg = _StringConverter::CopyToCharArrayN(messageText);
292
293                 int ret = ui_notification_set_content(core, pMsg);
294                 SysTryLog(NID_APP, ret == UI_NOTIFICATION_ERROR_NONE, "Setting notification content failure : %d.", ret);
295
296                 snprintf(buffer, 256, "%ls", appId.GetPointer());
297
298                 pPackageAppInfo = _PackageManagerImpl::GetInstance()->GetPackageAppInfoN(appId);
299                 if (pPackageAppInfo)
300                 {
301                         iconPath = pPackageAppInfo->GetAppNotificationIconPath();
302
303                         if (!iconPath.IsEmpty() && File::IsFileExist(iconPath))
304                         {
305                                 pIcon = _StringConverter::CopyToCharArrayN(iconPath);
306                                 r = ConvertNotificationResult(ui_notification_set_icon(core, pIcon));
307                                 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set icon failed.", GetErrorMessage(r));
308                         }
309                         else
310                         {
311                                 iconPath = pPackageAppInfo->GetAppMenuIconPath();
312                                 pIcon = _StringConverter::CopyToCharArrayN(iconPath);
313                                 r = ConvertNotificationResult(ui_notification_set_icon(core, pIcon));
314                                 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification Set icon path  failed.", GetErrorMessage(r));
315                         }
316
317                         const String& displayName = pPackageAppInfo->GetAppDisplayName();
318                         pName = _StringConverter::CopyToCharArrayN(displayName);
319
320                         r = ConvertNotificationResult(ui_notification_set_title(core, pName));
321                         SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set title failed.", GetErrorMessage(r));
322                 }
323                 else
324                 {
325                         SysLog(NID_APP, "No packageInfo found for %ls", appId.GetPointer());
326                 }
327
328
329                 r = arg.Construct(launchArguments);
330                 SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Propagating.", GetErrorMessage(r));
331
332                 pKb = arg.GetBundle();
333                 service_create_request(pKb, &svc);
334
335                 service_set_app_id(svc, buffer);
336                 r = ConvertNotificationResult(ui_notification_set_service(core, svc));
337                 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification set service failed.", GetErrorMessage(r));
338
339                 SysLog(NID_APP, "Sending notification[%ls] for package %s.", messageText.GetPointer(), buffer);
340
341                 r = ConvertNotificationResult(ui_notification_post(core));
342                 SysTryLog(NID_APP, !IsFailed(r), "[%s] Notification post failure.", GetErrorMessage(r));
343         }
344
345         if (badgeNumber >= 0)
346         {
347                 badge_error_e badgeError = badge_set_count(buffer, badgeNumber);
348                 SysTryLog(NID_APP, badgeError == BADGE_ERROR_NONE, "badge_set_count failed(%d).", badgeError);
349         }
350
351 CATCH:
352         delete pPackageAppInfo;
353         delete[] pMsg;
354         delete[] pIcon;
355         delete[] pName;
356         
357         if (core)
358         {
359                 ui_notification_destroy(core);
360         }
361         service_destroy(svc);
362         return r;
363 }
364
365
366 result
367 _NotificationManagerImpl::RemoveImpl(const char* pAppId, notification_type_e type)
368 {
369         result r = E_SUCCESS;
370
371         notification_error_e err = notification_delete_all_by_type(pAppId, type);
372         switch (err)
373         {
374         case NOTIFICATION_ERROR_NONE:
375                 r = E_SUCCESS;
376                 break;
377
378         case NOTIFICATION_ERROR_INVALID_DATA:
379                 r = E_INVALID_ARG;
380                 break;
381
382         default:
383                 r = E_SYSTEM;
384                 break;
385         }
386
387         return r;
388 }
389
390
391 result
392 _NotificationManagerImpl::RemoveImpl(const AppId& appId, bool isOngoing)
393 {
394         const bool isValidAppId = _Aul::IsInstalled(appId);
395         SysTryReturnResult(NID_APP, isValidAppId, E_APP_NOT_INSTALLED, "The application %ls is not installed", appId.GetPointer());
396
397         std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
398         const notification_type_e notiType = (isOngoing) ? NOTIFICATION_TYPE_ONGOING : NOTIFICATION_TYPE_NOTI;
399
400         return RemoveImpl(pAppId.get(), notiType);
401 }
402
403 result
404 _NotificationManagerImpl::Notify(int badgeNumber) const
405 {
406         SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
407
408         if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
409         {
410                 badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
411         }
412
413         String messageText = String(L"");
414         String appMessage = String(L"");
415
416         return NotifyImpl(messageText, badgeNumber, appMessage, false);
417 }
418
419 result
420 _NotificationManagerImpl::Notify(const String& messageText) const
421 {
422         SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
423
424         String appMessage = String(L"");
425
426         return NotifyImpl(messageText, -1, appMessage, false);
427 }
428
429 result
430 _NotificationManagerImpl::Notify(const String& messageText, int badgeNumber) const
431 {
432         SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
433         SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
434
435         if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
436         {
437                 badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
438         }
439
440         String appMessage = String(L"");
441
442         return NotifyImpl(messageText, badgeNumber, appMessage, false);
443 }
444
445 result
446 _NotificationManagerImpl::Notify(const String& messageText, int badgeNumber, const String& launchArguments) const
447 {
448         SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
449         SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
450         SysTryReturnResult(NID_APP,
451                                           launchArguments != null && launchArguments.GetLength() > 0, E_INVALID_ARG,
452                                           "launchArguments is less than 0.");
453
454         SysTryReturnResult(NID_APP,
455                                           launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
456                                           "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
457
458         if (badgeNumber > MAX_NOTIFICATION_BADGE_NUMBER)
459         {
460                 badgeNumber = MAX_NOTIFICATION_BADGE_NUMBER;
461         }
462
463         return NotifyImpl(messageText, badgeNumber, launchArguments, false);
464 }
465
466 int
467 _NotificationManagerImpl::GetBadgeNumber(const AppId& appId) const
468 {
469         bool b = _Aul::IsInstalled(appId);
470
471         SysTryReturn(NID_APP, b == true, -1, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] The application %ls is not installed",
472                                 appId.GetPointer());
473
474         char buffer[256];
475         unsigned int count = 0;
476
477         memset(buffer, 0, 256);
478
479         snprintf(buffer, 256, "%ls", appId.GetPointer());
480
481         std::unique_ptr<char[]> pAppId(_StringConverter::CopyToCharArrayN(appId));
482
483         badge_error_e badgeError = badge_get_count(pAppId.get(), &count);
484
485         if (badgeError == BADGE_ERROR_NONE)
486         {
487                 SysLog(NID_APP, "badge_get_count(%d)", count);
488         }
489         else
490         {
491                 SysLog(NID_APP, "badge_get_count failed(%d).", badgeError);
492                 return -1;
493         }
494
495         return count;
496 }
497
498
499 result
500 _NotificationManagerImpl::NotifyOnBehalf(const AppId& appId, int badgeNumber) const
501 {
502         SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
503
504         String messageText = String(L"");
505         String appMessage = String(L"");
506         return NotifyImpl(appId, messageText, badgeNumber, appMessage);
507 }
508
509 result
510 _NotificationManagerImpl::NotifyOnBehalf(const AppId& appId, const String& messageText) const
511 {
512         SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
513
514         return NotifyImpl(appId, messageText, -1, String(L""));
515 }
516
517 result
518 _NotificationManagerImpl::NotifyOnBehalf(const AppId& appId, const String& messageText, int badgeNumber) const
519 {
520         SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
521         SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
522
523         return NotifyImpl(appId, messageText, badgeNumber, String(L""));
524 }
525
526 result
527 _NotificationManagerImpl::NotifyOnBehalf(const AppId& appId, const String& messageText, const String& launchArguments) const
528 {
529         SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
530         SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
531         SysTryReturnResult(NID_APP,
532                                           launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
533                                           "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
534
535         return NotifyImpl(appId, messageText, -1, launchArguments);
536 }
537
538 result
539 _NotificationManagerImpl::NotifyOnBehalf(const AppId& appId, const String& messageText, int badgeNumber,
540                                                                                  const String& launchArguments) const
541 {
542         SysTryReturnResult(NID_APP, badgeNumber >= 0, E_INVALID_ARG, "BadgeNumber is less than 0.");
543         SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
544         SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
545         SysTryReturnResult(NID_APP,
546                                           launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
547                                           "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
548
549         return NotifyImpl(appId, messageText, badgeNumber, launchArguments);
550 }
551
552 result
553 _NotificationManagerImpl::NotifyOngoingActivity(const String& messageText) const
554 {
555         SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
556
557         return OngoingImpl(messageText, String(L""));
558 }
559
560 result
561 _NotificationManagerImpl::NotifyOngoingActivity(const String& messageText, const String& launchArguments) const
562 {
563         SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
564         SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
565         SysTryReturnResult(NID_APP,
566                                           launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
567                                           "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
568
569         return OngoingImpl(messageText, launchArguments);
570 }
571
572 result
573 _NotificationManagerImpl::NotifyOngoingActivityOnBehalf(const AppId& appId, const String& messageText) const
574 {
575         SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
576
577         return OngoingImpl(appId, messageText, String(L""));
578 }
579
580 result
581 _NotificationManagerImpl::NotifyOngoingActivityOnBehalf(const AppId& appId, const String& messageText,
582                                                                                                                 const String& launchArguments) const
583 {
584         SysTryReturnResult(NID_APP, messageText.GetLength() > 0, E_INVALID_ARG, "MessageText is less than 0.");
585         SysTryReturnResult(NID_APP, launchArguments.GetLength() > 0, E_INVALID_ARG, "launchArguments is less than 0.");
586         SysTryReturnResult(NID_APP,
587                                           launchArguments.GetLength() <= MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH, E_INVALID_ARG,
588                                           "launchArguments is greater than MAX_NOTIFICATION_LAUNCH_ARGUMENTS_LENGTH.");
589
590         return OngoingImpl(appId, messageText, launchArguments);
591 }
592
593 result
594 _NotificationManagerImpl::RemoveOngoingActivityNotification(void)
595 {
596         return RemoveImpl(NULL, NOTIFICATION_TYPE_ONGOING);
597 }
598
599 result
600 _NotificationManagerImpl::RemoveOngoingActivityNotificationOnBehalf(const AppId& appId)
601 {
602         return RemoveImpl(appId, true);
603 }
604
605 result
606 _NotificationManagerImpl::RemoveNotification(void)
607 {
608         return RemoveImpl(NULL, NOTIFICATION_TYPE_NOTI);
609 }
610
611 result
612 _NotificationManagerImpl::RemoveNotificationOnBehalf(const AppId& appId)
613 {
614         return RemoveImpl(appId, false);
615 }
616
617 };
618 };    // Tizen::App