javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/NotifyJsrPlugins.java
branchRCL_3
changeset 77 7cee158cb8cd
parent 24 0fd27995241b
child 83 26b2b12093af
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/NotifyJsrPlugins.java	Tue Sep 14 21:06:50 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/NotifyJsrPlugins.java	Wed Sep 15 12:05:25 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -34,17 +34,11 @@
     {
         InstallBall ball = (InstallBall)aBall;
 
-        // If any Jsr plugins, notify plugins
+        // If any Jsr plugins, notify plugins.
         if (ball.iJsrPluginNotifier.anyJsrPlugins())
         {
-            // Create info object to be passed to plugins
-            InstallerExtensionInfo info = new InstallerExtensionInfo();
-            info.iUid = ball.iSuite.getUid();
-            info.iUpgrade = (ball.iOldSuite != null);
-            info.iSilent = ball.isSilent();
-            info.iAttributes = ball.iCombinedAttributes;
-
-            ball.iJsrPluginNotifier.notifyInstallation(info);
+            ball.iJsrPluginNotifier.notifyInstallation(
+                createInstallerExtensionInfo(ball));
         }
     }
 
@@ -52,26 +46,31 @@
     {
         InstallBall ball = (InstallBall)aBall;
 
-        // Notify possible plugins that installation can been cancelled
+        // Notify possible plugins that installation has been cancelled.
         if (ball.iJsrPluginNotifier.anyJsrPlugins())
         {
-            // Create info object to be passed to plugins
-            InstallerExtensionInfo info = new InstallerExtensionInfo();
-            // Beware, it is possible that aBall has not been fully
-            // initialized
-            if (null == ball.iSuite)
-            {
-                info.iUid = null;
-            }
-            else
-            {
-                info.iUid = ball.iSuite.getUid();
-            }
-            info.iUpgrade = (ball.iOldSuite != null);
-            info.iSilent = ball.isSilent();
-            info.iAttributes = ball.iCombinedAttributes;
-
-            ball.iJsrPluginNotifier.notifyRollbackInstall(info);
+            ball.iJsrPluginNotifier.notifyRollbackInstall(
+                createInstallerExtensionInfo(ball));
         }
     }
+
+    private InstallerExtensionInfo createInstallerExtensionInfo(InstallBall aBall)
+    {
+        InstallerExtensionInfo info = new InstallerExtensionInfo();
+        // Beware, it is possible that aBall has not been fully initialized.
+        if (aBall.iSuite != null)
+        {
+            info.iUid = aBall.iSuite.getUid();
+            info.iAppUids = aBall.iSuite.getApplicationUids();
+            info.iRootPath = aBall.iSuite.getRootDir();
+        }
+        info.iUpgrade = (aBall.iOldSuite != null);
+        info.iSilent = aBall.isSilent();
+        info.iAttributes = aBall.iCombinedAttributes;
+        if (aBall.iStorageHandler != null)
+        {
+            info.iStorageSession = aBall.iStorageHandler.getSession();
+        }
+        return info;
+    }
 }