1 /* |
1 /* |
2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
32 { |
32 { |
33 public void execute(ExeBall aBall) |
33 public void execute(ExeBall aBall) |
34 { |
34 { |
35 UninstallBall ball = (UninstallBall)aBall; |
35 UninstallBall ball = (UninstallBall)aBall; |
36 |
36 |
37 // If any Jsr plugins, notify plugins. |
37 // If any Jsr plugins, notify plugins |
38 if (ball.iJsrPluginNotifier.anyJsrPlugins()) |
38 if (ball.iJsrPluginNotifier.anyJsrPlugins()) |
39 { |
39 { |
40 ball.iJsrPluginNotifier.notifyUninstallation( |
40 // Create info object to be passed to plugins |
41 createInstallerExtensionInfo(ball)); |
41 InstallerExtensionInfo info = new InstallerExtensionInfo(); |
|
42 info.iUid = ball.iSuite.getUid(); |
|
43 info.iUpgrade = false; |
|
44 info.iSilent = ball.isSilent(); |
|
45 info.iAttributes = ball.iSuite.getAttributes(); |
|
46 |
|
47 ball.iJsrPluginNotifier.notifyUninstallation(info); |
42 } |
48 } |
43 } |
49 } |
44 |
50 |
45 public void cancel(ExeBall aBall) |
51 public void cancel(ExeBall aBall) |
46 { |
52 { |
47 UninstallBall ball = (UninstallBall)aBall; |
53 UninstallBall ball = (UninstallBall)aBall; |
48 |
54 |
49 // Notify possible plugins that uninstallation has been cancelled. |
55 // Notify possible plugins that uninstallation can been cancelled |
50 if (ball.iJsrPluginNotifier.anyJsrPlugins()) |
56 if (ball.iJsrPluginNotifier.anyJsrPlugins()) |
51 { |
57 { |
52 ball.iJsrPluginNotifier.notifyRollbackUninstall( |
58 // Create info object to be passed to plugins |
53 createInstallerExtensionInfo(ball)); |
59 InstallerExtensionInfo info = new InstallerExtensionInfo(); |
|
60 // Beware, it is possible that aBall has not been fully |
|
61 // initialized |
|
62 if (null == ball.iSuite) |
|
63 { |
|
64 info.iUid = null; |
|
65 info.iAttributes = null; |
|
66 } |
|
67 else |
|
68 { |
|
69 info.iUid = ball.iSuite.getUid(); |
|
70 info.iAttributes = ball.iSuite.getAttributes(); |
|
71 } |
|
72 info.iUpgrade = false; |
|
73 info.iSilent = ball.isSilent(); |
|
74 |
|
75 ball.iJsrPluginNotifier.notifyRollbackUninstall(info); |
54 } |
76 } |
55 } |
77 } |
56 |
|
57 private InstallerExtensionInfo createInstallerExtensionInfo(UninstallBall aBall) |
|
58 { |
|
59 InstallerExtensionInfo info = new InstallerExtensionInfo(); |
|
60 // Beware, it is possible that aBall has not been fully initialized. |
|
61 if (aBall.iSuite != null) |
|
62 { |
|
63 info.iUid = aBall.iSuite.getUid(); |
|
64 info.iAppUids = aBall.iSuite.getApplicationUids(); |
|
65 info.iAttributes = aBall.iSuite.getAttributes(); |
|
66 info.iRootPath = aBall.iSuite.getRootDir(); |
|
67 } |
|
68 info.iUpgrade = false; |
|
69 info.iSilent = aBall.isSilent(); |
|
70 if (aBall.iStorageHandler != null) |
|
71 { |
|
72 info.iStorageSession = aBall.iStorageHandler.getSession(); |
|
73 } |
|
74 return info; |
|
75 } |
|
76 } |
78 } |