Add an indicator icon that shows foreground app is in krate 32/85832/2
authorSungbae Yoo <sungbae.yoo@samsung.com>
Mon, 29 Aug 2016 07:41:31 +0000 (16:41 +0900)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Mon, 29 Aug 2016 08:15:39 +0000 (01:15 -0700)
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Change-Id: I0fefb395ecaf8f40f34b2c2f7456c378135ef24b

server/manager.cpp

index 0bf09d0..ec6f58a 100644 (file)
@@ -226,7 +226,7 @@ void krateProcessCallback(GDBusConnection *connection,
        static runtime::User owner(KRATE_DEFAULT_OWNER);
        int pid, status;
 
-//     notification_h noti = reinterpret_cast<notification_h>(userData);
+       notification_h noti = reinterpret_cast<notification_h>(userData);
 
        g_variant_get(params, "(ii)", &status, &pid);
 
@@ -240,20 +240,18 @@ void krateProcessCallback(GDBusConnection *connection,
                return;
        }
 
-       // this will have been commented until notification_delete_for_uid can work
-       /*
-       if (owner.getUid() != st.st_uid) {
+       if (st.st_uid == owner.getUid() || st.st_uid == 0) {
+               if (isKrateForeground) {
+                       notification_delete_for_uid(noti, owner.getUid());
+                       isKrateForeground = false;
+               }
+       } else {
                if (!isKrateForeground) {
                        notification_set_text(noti, NT_CONTENT, NT_APPINFO, NULL, NT_NONE);
                        notification_post_for_uid(noti, owner.getUid());
                        isKrateForeground = true;
                }
-       } else {
-               if (isKrateForeground) {
-                       notification_delete_for_uid(noti, owner.getUid());
-                       isKrateForeground = false;
-               }
-       }*/
+       }
 }
 
 notification_h createNotification()