Add event for storage full
[platform/framework/native/appfw.git] / src / app / package / FAppPkg_PackageManagerImpl.cpp
index 09ef6be..39cac0d 100755 (executable)
@@ -88,15 +88,26 @@ _PackageManagerEvent::FireImpl(IEventListener& listener, const IEventArg& arg)
                }
                else
                {
-                       if (pArg->__install)
+                       if (pArg->__install == false)
                        {
-                               SysLog(NID_APP, "Installation is Completed(Error). [Package = %ls]", pArg->__packageId.GetPointer());
-                               pListener->OnPackageInstallationCompleted(pArg->__packageId, PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE);
+                               SysLog(NID_APP, "Uninstallation is Completed(Error). [Package = %ls]", pArg->__packageId.GetPointer());
+                               pListener->OnPackageUninstallationCompleted(pArg->__packageId, false);
+                       }
+               }
+       }
+       else if (pArg->__eventKey == L"error")
+       {
+               if (pArg->__install)
+               {
+                       if (pArg->__eventValue == L"62")
+                       {
+                               SysLog(NID_APP, "Installation is Completed(Error = STORAGE_FULL(62)). [Package = %ls]", pArg->__packageId.GetPointer());
+                               pListener->OnPackageInstallationCompleted(pArg->__packageId, PACKAGE_INSTALLATION_RESULT_STORAGE_FULL);
                        }
                        else
                        {
-                               SysLog(NID_APP, "Uninstallation is Completed(Error). [Package = %ls]", pArg->__packageId.GetPointer());
-                               pListener->OnPackageUninstallationCompleted(pArg->__packageId, false);
+                               SysLog(NID_APP, "Installation is Completed(Error). [Package = %ls]", pArg->__packageId.GetPointer());
+                               pListener->OnPackageInstallationCompleted(pArg->__packageId, PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE);
                        }
                }
        }
@@ -668,13 +679,21 @@ _PackageManagerImpl::InstallationEventHandler(int reqId, const char* pType, cons
                                pListener->OnPackageInstallationResponseReceived(pPackageId, PACKAGE_INSTALLATION_RESULT_SUCCESS);
                                SysLog(NID_APP, "OnPackageInstallationResponseReceived(PACKAGE_INSTALLATION_RESULT_SUCCESS)");
                        }
+
+                       delete pListener;
+               }
+               else if (strcmp(pKey, "error") == 0)
+               {
+                       if (strcmp(pVal, "62") == 0)
+                       {
+                               pListener->OnPackageInstallationResponseReceived(pPackageId, PACKAGE_INSTALLATION_RESULT_STORAGE_FULL);
+                               SysLog(NID_APP, "OnPackageInstallationResponseReceived(PACKAGE_INSTALLATION_RESULT_STORAGE_FULL)");
+                       }
                        else
                        {
                                pListener->OnPackageInstallationResponseReceived(pPackageId, PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE);
                                SysLog(NID_APP, "OnPackageInstallationResponseReceived(PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE)");
                        }
-
-                       delete pListener;
                }
                else if (strcmp(pKey, "install_percent") == 0)
                {