[Packagemanager] Fix bug on package event handling 39/163539/1
authorSangyoon Jang <jeremy.jang@samsung.com>
Fri, 8 Dec 2017 02:59:44 +0000 (11:59 +0900)
committerSangyoon Jang <jeremy.jang@samsung.com>
Tue, 12 Dec 2017 02:43:57 +0000 (02:43 +0000)
Fix wrong condition of event registering/unregistering.

Change-Id: Ie9be99622c7e6dc1d923d0f27bae7298b478d015
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
(cherry picked from commit 116bc27c699fa7754a21b92186635d63c07ba604)

src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs

index 2b10511..ed6e043 100644 (file)
@@ -1101,7 +1101,7 @@ namespace Tizen.Applications
 
         private static void RegisterPackageManagerEventIfNeeded()
         {
-            if (s_packageManagerEventCallback != null)
+            if (s_installEventHandler != null && s_uninstallEventHandler != null && s_updateEventHandler != null && s_moveEventHandler != null && s_clearDataEventHandler != null)
                 return;
 
             var err = Interop.PackageManager.ErrorCode.None;
@@ -1157,7 +1157,7 @@ namespace Tizen.Applications
 
         private static void UnregisterPackageManagerEventIfNeeded()
         {
-            if (Handle.IsInvalid || s_packageManagerEventCallback == null || s_installEventHandler != null || s_uninstallEventHandler != null || s_updateEventHandler != null || s_moveEventHandler != null || s_clearDataEventHandler != null)
+            if (s_packageManagerEventCallback == null || s_installEventHandler != null || s_uninstallEventHandler != null || s_updateEventHandler != null || s_moveEventHandler != null || s_clearDataEventHandler != null)
             {
                 return;
             }