v2.2.17_1 PDK_4.0.a
authorhgs
Mon, 04 Oct 2010 11:29:25 +0300
changeset 78 71ad690e91f5
parent 72 1f0034e370aa
child 80 d6dafc5d983f
v2.2.17_1
build/Makefile.comp
build/Makefile.defs
build/Makefile.nonqt
build/Makefile.project
build/Makefile.subsystem
build/bldjava.inf
build/buildutils/checkjava.py
build/buildutils/distribution.policy.s60.configuration.txt
build/buildutils/omake.bat
build/loc/resources_qt.jar
build/makefile
build/makefile.javaversion
build/nativejava.flm
build/nativejava.xml
build/omj.pri
build/properties.xml
build/sis/java_3_1.pkg
build/symbian_uids.pri
inc/build_defines.hrh
inc/build_defines.pri
inc/java.txt
inc/project_defines.hrh
javacommons/comms/comms.pro
javacommons/comms/ipclib/clientserver/build/ipc.pro
javacommons/comms/ipclib/clientserver/build/javaipc.pro
javacommons/comms/ipclib/socket/build/ipc.pro
javacommons/comms/ipclib/socket/build/javaipc.pro
javacommons/connectionmanager/legacysupport/apnsettings/build/apnsettings.pro
javacommons/connectionmanager/legacysupport/apnsettings/build/midp2cenrep.pro
javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileOutputStream.java
javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileStreamHandler.java
javacommons/fileutils/src/filestreamhandlerjni.cpp
javacommons/fileutils/src/nativefileiohandler.cpp
javacommons/fileutils/src/nativefileiohandler.h
javacommons/javacommons.pro
javacommons/javaenv/build/javaenv.pro
javacommons/javaenv/build/javaenvinfo.pro
javacommons/javaenv/src.s60/javaenvinfo.cpp
javacommons/javastorage/inc/javastoragenames.h
javacommons/javastorage/javasrc/com/nokia/mj/impl/storage/StorageNames.java
javacommons/javastorage/src.s60/client/javadataaccessimpl.cpp
javacommons/javastorage/src/javastoragetables.h
javacommons/javastorage/src/server/storagedbhandler.cpp
javacommons/jvms/jvms.pro
javacommons/jvms/subsystem.mk
javacommons/security/data/att_manufacturer.txt
javacommons/security/data/att_operator.txt
javacommons/security/data/att_operatorextra.txt
javacommons/security/data/msa_manufacturer.txt
javacommons/security/data/msa_operator.txt
javacommons/security/data/msa_trustedthirdparty.txt
javacommons/security/data/msa_untrusted.txt
javacommons/security/data/s60_manufacturer.txt
javacommons/security/data/s60_operator.txt
javacommons/security/data/s60_trustedthirdparty.txt
javacommons/security/data/s60_untrusted.txt
javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authorization/PermissionResolver.java
javacommons/security/src/utils/securityutils.cpp
javacommons/security/tsrc/build/build.xml
javacommons/security/tsrc/build/cleanup.bat
javacommons/security/tsrc/build/compile.bat
javacommons/security/tsrc/data/midprootslist
javacommons/security/tsrc/data/policies/test_manufacturer.txt
javacommons/security/tsrc/data/policies/test_operator.txt
javacommons/security/tsrc/data/policies/test_trustedthirdparty.txt
javacommons/security/tsrc/data/policies/test_untrusted.txt
javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/OMJSecurityTests.java
javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authentication/InteractiveAuthenticationModuleTests.java
javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/AccessControllerTests.java
javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/InteractiveAccessControllerTests.java
javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/PermissionGranterTests.java
javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/SecurityPolicyModuleTests.java
javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/common/SecurityExtensionsTests.java
javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java
javaextensions/globalindicators/build/build.xml
javaextensions/globalindicators/build/bwins/javaglobalindicatorsu.def
javaextensions/globalindicators/build/eabi/javaglobalindicatorsu.def
javaextensions/globalindicators/build/javaglobalindicators.pro
javaextensions/globalindicators/inc/CGlobalIndicators.h
javaextensions/globalindicators/javasrc/com/nokia/mid/ui/GlobalIndicators.java
javaextensions/globalindicators/javasrc/com/nokia/mid/ui/GlobalIndicatorsException.java
javaextensions/globalindicators/javasrc/com/nokia/mj/impl/globalindicators/GlobalIndicatorsImpl.java
javaextensions/globalindicators/src/CGlobalIndicators.cpp
javaextensions/globalindicators/src/GlobalIndicators.cpp
javaextensions/javaextensions.pro
javaextensions/location/landmarks/javasrc.s60/com/nokia/mj/impl/location/LandmarkStoreManager.java
javaextensions/midprms_db/tsrc/rmsbenchmark/javasrc/BenchmarkRunner.java
javaextensions/midprms_db/tsrc/rmsbenchmark/javasrc/RMSBenchmark.java
javaextensions/midprms_db/tsrc/rmsbenchmark/javasrc/Storage.java
javaextensions/mobinfo/build/build.xml
javaextensions/mobinfo/build/javamobinfo.pro
javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoPermission.java
javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoProperties.java
javaextensions/mobinfo/src.s60/javamobinfo.cpp
javaextensions/mobinfo/src.s60/mobinfoconstants.h
javaextensions/pim/javasrc.s60/com/nokia/mj/impl/pim/utils/NativeError.java
javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMManager.java
javaextensions/subsystem.mk
javaextensions/webservices/build/build.xml
javaextensions/webservices/build/bwins/javawebservicesu.def
javaextensions/webservices/build/eabi/javawebservicesu.def
javaextensions/webservices/build/javawebservices.pro
javaextensions/wma/mms/build/build.xml
javaextensions/wma/mms/javasrc/com/nokia/mj/impl/gcf/protocol/mms/PushValidatorImpl.java
javaextensions/wma/mms/javasrc/com/nokia/mj/impl/mms/MMSConnectionImpl.java
javaextensions/wma/mms/javasrc/com/nokia/mj/impl/mms/MMSInstallerPlugin.java
javaextensions/wma/mms/pushplugin/inc/mmsserverconnection.h
javaextensions/wma/mms/pushplugin/inc/mmsserverconnectionfactory.h
javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp
javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.h
javaextensions/wma/mms/pushplugin/src/mmsserverconnectionfactory.cpp
javaextensions/wma/mms/src.s60/cjavammsmessagehandler.cpp
javaextensions/wma/mms/src.s60/cmmsplatformservices60impl.cpp
javaextensions/wma/mms/src.s60/mmsinstallerpluginjni.cpp
javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/sms/SMSConnectionImpl.java
javaextensions/wma/sms_cbs/pushplugin/cbs/src.s60/cbsserverconnection.cpp
javaextensions/wma/sms_cbs/pushplugin/inc/serverconnectionbase.h
javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp
javaextensions/wma/sms_cbs/pushplugin/src/serverconnectionbase.cpp
javaextensions/wma/sms_cbs/src.s60/csmsplatformservices60impl.cpp
javaextensions/wma/sms_cbs/src/smsconnectionimpljni.cpp
javamanager/debugapi/build/debugapi.pro
javamanager/debugapi/build/javadebugapi.pro
javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp
javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore.pro
javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_ondemand_7.pro
javamanager/javacaptain/javacaptain.pro
javamanager/javainstaller/installer/conf/javainstaller.confml
javamanager/javainstaller/installer/data/inst_plugins.cfg
javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckDiskSpace.java
javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConfirmInstallation.java
javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java
javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp
javamanager/javainstaller/javasifplugin/src/resultsserver.cpp
javamanager/javamanager.pro
javamanager/javaregistry/legacy/server/build/javaregistry.pro
javamanager/javaregistry/legacy/server/build/javaregistryserver.pro
javamanager/javasettings_qt/src/javaapplicationsettingsview_p.h
javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/ApplicationUI.java
javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/ApplicationUIListener.java
javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/GraphicsUtil.java
javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/ImageUtil.java
javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/InternalUI.java
javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/LabelExtension.java
javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/MobileShellExtension.java
javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/OS.java
javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/Toolkit.java
javauis/eswt_qt/com.nokia.swt.extensions/midp/org/eclipse/ercp/swt/midp/UIThreadSupport.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT Animation/qt/org/eclipse/swt/animation/internal/qt/OS.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/CLDCCompatibilityDelegate.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/CompatibilityDelegate.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java
javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Display.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/ApplicationUidWrapper.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/CommandPresentationStrategyWrapper.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/ExitNotificationWrapper.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/qt/ApplicationUIListener.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/qt/EventLoop.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/qt/UIThreadHandOverManager.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2se/org/eclipse/swt/internal/ApplicationUidWrapper.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2se/org/eclipse/swt/internal/CommandPresentationStrategyWrapper.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2se/org/eclipse/swt/internal/ExitNotificationWrapper.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/linux/org/eclipse/swt/internal/ApplicationUidWrapper.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/linux/org/eclipse/swt/internal/qt/s60/S60CommandPresentationStrategy.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/ApplicationUIListener.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/BaseCSSEngine.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/CommandArranger.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/CommandPresentationStrategy.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/DesktopCommandPresentationStrategy.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/OS.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/SymbianWindowVisibilityListener.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/UIThreadManager.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/GraphicsContext.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/Image.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/ImageLoader.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/JavaCommandBuffer.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/OS.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/WindowSurface.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/s60/org/eclipse/swt/internal/ApplicationUidWrapper.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/s60/org/eclipse/swt/internal/qt/s60/S60CommandPresentationStrategy.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/webkit/org/eclipse/swt/internal/qt/webkit/OS_webkit.java
javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/webkit/org/eclipse/swt/internal/qt/webkit/WebkitOS.java
javauis/lcdui_qt/src/com/nokia/mj/impl/nokialcdui/LCDUIInvoker.java
javauis/lcdui_qt/src/javax/microedition/lcdui/Buffer.java
javauis/lcdui_qt/src/javax/microedition/lcdui/CanvasKeypad.java
javauis/lcdui_qt/src/javax/microedition/lcdui/EventDispatcher.java
javauis/lcdui_qt/src/javax/microedition/lcdui/Graphics.java
javauis/lcdui_qt/src/javax/microedition/lcdui/Image.java
javauis/lcdui_qt/src/javax/microedition/lcdui/LCDUIInvokerImpl.java
javauis/lcdui_qt/src/javax/microedition/lcdui/game/GameCanvas.java
javauis/lcdui_qt/tsrc/build.xml
javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/AllTests.java
javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/game/GameCanvasTest.java
javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/softnotification/SoftNotificationTest.java
javauis/m3g_qt/javasrc/javax/microedition/m3g/Graphics3D.java
javauis/nokiauiapi_qt/build/build.pro
javauis/nokiauiapi_qt/build/nokiauiapiqt/build.xml
javauis/nokiauiapi_qt/build/nokiauiapiqt/javanokiaui.pro
javauis/nokiauiapi_qt/build/softindicatorplugin/javasoftindicatorplugin.pro
javauis/nokiauiapi_qt/build/softnoteplugin/bwins/javacaptain_ext_javasoftnotepluginu.def
javauis/nokiauiapi_qt/build/softnoteplugin/eabi/javacaptain_ext_javasoftnotepluginu.def
javauis/nokiauiapi_qt/build/softnoteplugin/javacaptain_ext_javasoftnoteplugin.pro
javauis/nokiauiapi_qt/build/subsystem.mk
javauis/nokiauiapi_qt/inc/CGlobalIndicators.h
javauis/nokiauiapi_qt/inc/CSoftNotification.h
javauis/nokiauiapi_qt/javasrc/com/nokia/mid/ui/GlobalIndicators.java
javauis/nokiauiapi_qt/javasrc/com/nokia/mid/ui/GlobalIndicatorsException.java
javauis/nokiauiapi_qt/javasrc/com/nokia/mid/ui/SoftNotification.java
javauis/nokiauiapi_qt/javasrc/com/nokia/mid/ui/SoftNotificationImpl.java
javauis/nokiauiapi_qt/javasrc/com/nokia/mj/impl/nokiauiapi/GlobalIndicatorsImpl.java
javauis/nokiauiapi_qt/javasrc/com/nokia/mj/impl/nokiauiapi/OS.java
javauis/nokiauiapi_qt/javasrc/com/nokia/mj/impl/nokiauiapi/SoftNotificationImpl.java
javauis/nokiauiapi_qt/javasrc_j2me/com/nokia/mid/ui/TactileFeedback.java
javauis/nokiauiapi_qt/softindicatorplugin/inc/javasoftindicator.h
javauis/nokiauiapi_qt/softindicatorplugin/src/javasoftindicator.cpp
javauis/nokiauiapi_qt/softnoteplugin/inc/javasoftnotehandler.h
javauis/nokiauiapi_qt/softnoteplugin/src.s60/lookup.cpp
javauis/nokiauiapi_qt/softnoteplugin/src/javasoftnotehandler.cpp
javauis/nokiauiapi_qt/src/CGlobalIndicators.cpp
javauis/nokiauiapi_qt/src/CSoftNotification.cpp
javauis/nokiauiapi_qt/src/os.cpp
javauis/runtimeui_qt/build/bwins/javaruntimeuiu.def
javauis/runtimeui_qt/build/eabi/javaruntimeuiu.def
javauis/runtimeui_qt/javasrc.s60/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQt.java
javauis/runtimeui_qt/src.s60/jni.cpp
javauis/runtimeui_qt/src.s60/runtimeuiqt.cpp
javauis/runtimeui_qt/src.s60/runtimeuiqt.h
javauis/runtimeui_qt/tsrc.s60/javasrc/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQtTests.java
javauis/tsrc/fute/lcdui/Midp_Graphics_01/build.xml
javauis/tsrc/fute/lcdui/Midp_Graphics_01/src/CanvasTests_01.java
javauis/tsrc/fute/lcdui/Midp_Graphics_01/src/Midp_Graphics_01.java
javauis/tsrc/fute/lcdui/Midp_TextBox_01/build.xml
javauis/tsrc/fute/lcdui/Midp_TextBox_01/src/ScreenTextBoxTests.java
javauis/tsrc/fute/lcdui/Midp_Ticker_01/build.xml
rom/installerodclist
rom/java_2_2.iby
rom/java_3_1.iby
rom/midpodclist
subsystem.mk
--- a/build/Makefile.comp	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/Makefile.comp	Mon Oct 04 11:29:25 2010 +0300
@@ -170,8 +170,9 @@
 clean_qmake:
 	-$(call RMFILES,abld.bat bld.inf* Makefile* $(BASENAME).mmp $(BASENAME)_*.mmp $(BASENAME)_*.pkg $(BASENAME)_reg.rss eabi_stl4/*)
 
-# Use Carbide CodeScanner to list high-level issues
+# Use Carbide CodeScanner to list high-level issues, and checkjava.py for Java issues
 codescanner:
+	python $(JAVA_SRC_ROOT)/build/buildutils/checkjava.py --exclude tsrc ..
 ifneq ($(call PATHSEARCH,codescanner.exe),)
 	$(call CODESCANNER,..)
 endif
@@ -181,27 +182,27 @@
 
 export: 
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG) EXPORT
+	$(SBS) -c $(SBSCONFIG) EXPORT
 
 build_native:
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG)
+	$(SBS) -c $(SBSCONFIG)
 
 fastbuild: java
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG)
+	$(SBS) -c $(SBSCONFIG)
 
 build_clean_native:
 	$(PHASEINFO)
-	-$(SBS) -c $(PLATFORM)_$(CFG) clean
+	-$(SBS) -c $(SBSCONFIG) clean
 
 really_clean_native:
 	$(PHASEINFO)
-	-$(SBS) -c $(PLATFORM)_$(CFG) reallyclean
+	-$(SBS) -c $(SBSCONFIG) reallyclean
 
 cleanexport:
 	$(PHASEINFO)
-	-$(SBS) -c $(PLATFORM)_$(CFG) CLEANEXPORT
+	-$(SBS) -c $(SBSCONFIG) CLEANEXPORT
 
 
 # Symbian ABLD MAKEFILE --------------------
--- a/build/Makefile.defs	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/Makefile.defs	Mon Oct 04 11:29:25 2010 +0300
@@ -28,8 +28,11 @@
   endif
 endif
 
+# Determine if we're building jrt or jrtext
+GEN_BUILD_FILES_DIR = $(if $(JRTEXT_SRC_ROOT),$(JRTEXT_SRC_ROOT),$(JAVA_SRC_ROOT))
+
 # S60 release file (written if release is given explicitly on commandline)
-RD_JAVA_S60_RELEASE_FILE = $(JAVA_SRC_ROOT)/inc/java_s60_release.hrh
+RD_JAVA_S60_RELEASE_FILE = $(GEN_BUILD_FILES_DIR)/inc/java_s60_release.hrh
 
 include $(JAVA_SRC_ROOT)/build/Makefile.project
 
@@ -40,6 +43,7 @@
   $(error The environment variable JAVA_6_HOME is not defined)
   endif
   export JAVA_HOME=$(JAVA_6_HOME)
+  HASH_CHAR=\#
 
   ifeq ($(notdir $(basename $(SHELL))),sh)
     # Cygwin & Linux definitions
@@ -121,6 +125,7 @@
   export PLATFORM = linux
   QMAKE = qmake
   ANT := ant
+  HASH_CHAR=\\\#
 
   ifndef JAVA_BIN_ROOT
   export JAVA_BIN_ROOT=$(JAVA_SRC_ROOT)/bin
@@ -185,6 +190,22 @@
 
 export VARIANT
 
+# Specify RVCT version explicitly by default
+OVERRIDE_RVCT = 1
+SBSCONFIG = $(PLATFORM)_$(CFG)
+ifeq ($(OVERRIDE_RVCT),1)
+  ifeq ($(PLATFORM),armv5)
+    ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
+      SBSCONFIG = $(PLATFORM)_$(CFG).rvct4_0
+      RVCTBIN = $(RVCT40BIN)
+    else 
+      SBSCONFIG = $(PLATFORM)_$(CFG).rvct2_2
+      RVCTBIN = $(RVCT22BIN)
+    endif
+    export PATH:=$(RVCTBIN);$(subst $(RVCT40BIN),,$(subst $(RVCT22BIN),,$(PATH)))
+  endif
+endif
+
 ANT_PROJECT_DEFINES = $(foreach d,$(PROJECT_DEFINES),-D$d=1)
 
 COMPONENT_NAME ?= $(notdir $(CURDIR))
@@ -217,13 +238,16 @@
 # Common ----------------------------------
 
 # Export files need a build_defines file
-BUILDDEFINEFILE := $(JAVA_SRC_ROOT)/inc/build_defines.hrh
-QBUILDDEFINEFILE := $(JAVA_SRC_ROOT)/inc/build_defines.pri
-JAVAVERSIONFILE := $(JAVA_SRC_ROOT)/inc/java.txt
+BUILDDEFINEFILE := $(GEN_BUILD_FILES_DIR)/inc/build_defines.hrh
+QBUILDDEFINEFILE := $(GEN_BUILD_FILES_DIR)/inc/build_defines.pri
 
 # Project define file is needed by export and native phases of nonqt components
 # Native builds require project_defines.hrh for nonqt-mmp-files
-PROJECTDEFINEFILE = $(JAVA_SRC_ROOT)/inc/project_defines.hrh
+PROJECTDEFINEFILE = $(GEN_BUILD_FILES_DIR)/inc/project_defines.hrh
+
+# Java version file
+JAVAVERSIONFILE := $(GEN_BUILD_FILES_DIR)/inc/java.txt
+
 
 ifndef FIRSTTIME_FLAG
 export FIRSTTIME_FLAG = 1
@@ -237,7 +261,7 @@
 ifeq ($(BUILDENV),symbian)
 all init export configure qmake java native releasebuild test: echo_s60_release
 echo_s60_release:
-	@echo Building on top of S60 $(RD_JAVA_S60_RELEASE)
+	@echo Building on top of S60 $(RD_JAVA_S60_RELEASE), PLATFORM=$(PLATFORM) VARIANT=$(VARIANT)
 endif
 
 include $(JAVA_SRC_ROOT)/build/makefile.javaversion
@@ -245,13 +269,17 @@
 COMMA = ,
 JAVA_VERSION_ = $(subst .,$(COMMA),$(JAVA_VERSION))
 
-configure: generateconffiles generatereleasefile
+configure: create_inc_dir generateconffiles generatereleasefile
+
+create_inc_dir:
+	$(call MKDIR, $(call PATHFIX,$(GEN_BUILD_FILES_DIR)/inc))
+
 generateconffiles:
 	@echo Writing $(BUILDDEFINEFILE) ... \
 	$(shell $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/generated_header.txt) > $(BUILDDEFINEFILE)) \
-	$(shell echo #define RD_JAVA_VERSION $(JAVA_VERSION_)>> $(BUILDDEFINEFILE)) \
-	$(shell echo #define RD_JAVA_BIN_VERSION_NONQT $(shell python $(JAVA_SRC_ROOT)/build/buildutils/ver2binver.py mmp $(JAVA_VERSION))>> $(BUILDDEFINEFILE)) \
-	$(foreach d, $(PROJECT_DEFINES), $(shell echo #define $d >> $(BUILDDEFINEFILE)))
+	$(shell echo $(HASH_CHAR)define RD_JAVA_VERSION $(JAVA_VERSION_)>> $(BUILDDEFINEFILE)) \
+	$(shell echo $(HASH_CHAR)define RD_JAVA_BIN_VERSION_NONQT $(shell python $(JAVA_SRC_ROOT)/build/buildutils/ver2binver.py mmp $(JAVA_VERSION))>> $(BUILDDEFINEFILE)) \
+	$(foreach d, $(PROJECT_DEFINES), $(shell echo $(HASH_CHAR)define $d>> $(BUILDDEFINEFILE)))
 	@echo Writing $(QBUILDDEFINEFILE) ... \
 	$(shell $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/generated_header_hash.txt) > $(QBUILDDEFINEFILE)) \
 	$(shell echo RD_JAVA_BIN_VERSION = $(shell python $(JAVA_SRC_ROOT)/build/buildutils/ver2binver.py qmake $(JAVA_VERSION))>> $(QBUILDDEFINEFILE)) \
--- a/build/Makefile.nonqt	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/Makefile.nonqt	Mon Oct 04 11:29:25 2010 +0300
@@ -60,25 +60,25 @@
 # BUILD combines commands EXPORT MAKEFILE BITMAP RESOURCE LIBRARY TARGET FINAL
 native:
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG)
+	$(SBS) -c $(SBSCONFIG)
 
 clean_java:
 
 clean_native:
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG) clean
+	$(SBS) -c $(SBSCONFIG) clean
 
 reallyclean:
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG) reallyclean
+	$(SBS) -c $(SBSCONFIG) reallyclean
 
 export: 
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG) EXPORT
+	$(SBS) -c $(SBSCONFIG) EXPORT
 
 cleanexport:
 	$(PHASEINFO)
-	-$(SBS) -c $(PLATFORM)_$(CFG) CLEANEXPORT
+	-$(SBS) -c $(SBSCONFIG) CLEANEXPORT
 
 
 # Symbian ABLD MAKEFILE --------------------
--- a/build/Makefile.project	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/Makefile.project	Mon Oct 04 11:29:25 2010 +0300
@@ -110,6 +110,13 @@
   UI = QT
 endif
 
+ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
+  RD_JAVA_PKG_SPLIT = 1
+endif
+ifeq ($(RD_JAVA_PKG_SPLIT),1)
+  PROJECT_DEFINES += RD_JAVA_PKG_SPLIT
+endif
+
 ifeq ($(UI),QT)
   RD_JAVA_UI_QT = 1
   PROJECT_DEFINES += RD_JAVA_UI_QT
--- a/build/Makefile.subsystem	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/Makefile.subsystem	Mon Oct 04 11:29:25 2010 +0300
@@ -123,7 +123,7 @@
 # Symbian ----------------------------------
 ifeq ($(BUILDENV),symbian)
 
-ifeq ($(COMPONENT_NAME),jrt)
+ifdef COMPONENT_ROOT
 # When building from top level, the native compilation does also export, java and finalactions
 all: configure qmake native
 clean: clean_native clean_generated
@@ -135,7 +135,7 @@
 # On top level symbian build, the java building happens always during native
 # phase, through bld.inf -file, so no direct Java building is done (unless it 
 # building _is_ made from the bld.inf).
-ifeq ($(COMPONENT_NAME),jrt)
+ifdef COMPONENT_ROOT
 ifndef BLD_INF_JAVA
 NOJAVA=1
 endif
@@ -162,7 +162,12 @@
 	$(call RMFILES,bld.inf* Makefile*)
 	$(MAKE) -f subsystem.mk TARGET_PHASE=qmakefix subtargets
 	$(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/bld.inf) > bld.inf \
-	$(foreach d, $(REALTARGETS), && echo #include "$d/bld.inf" >> bld.inf )
+	$(foreach d, $(filter-out $(SKIP_IN_SF),$(REALTARGETS)), && echo #include "$d/bld.inf" >> bld.inf )
+ifdef SKIP_IN_SF
+	echo #ifndef RD_JAVA_SF_BUILD >> bld.inf \
+	$(foreach d, $(filter $(SKIP_IN_SF),$(REALTARGETS)), && echo #include "$d/bld.inf" >> bld.inf )
+	echo #endif >> bld.inf
+endif
 
 build_all: configure qmake
 ifdef USESBS
@@ -188,8 +193,9 @@
 bld.inf:
 	$(MAKE) -f subsystem.mk makestubs qmake
 
-# Use Carbide CodeScanner to list high-level issues
+# Use Carbide CodeScanner to list high-level issues, and checkjava.py for Java issues
 codescanner:
+	-python $(JAVA_SRC_ROOT)/build/buildutils/checkjava.py --exclude tsrc .
 ifneq ($(call PATHSEARCH,codescanner.exe),)
 	$(call CODESCANNER,.)
 endif
@@ -199,28 +205,28 @@
 
 export:
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG) EXPORT
+	$(SBS) -c $(SBSCONFIG) EXPORT
 
 cleanexport:
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG) CLEANEXPORT
+	$(SBS) -c $(SBSCONFIG) CLEANEXPORT
 
 # BUILD combines commands EXPORT MAKEFILE BITMAP RESOURCE LIBRARY TARGET FINAL
 native:
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG)
+	$(SBS) -c $(SBSCONFIG)
 
 fastbuild: export java
-	$(SBS) -c $(PLATFORM)_$(CFG)
+	$(SBS) -c $(SBSCONFIG)
 
 clean_native:
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG) clean
+	$(SBS) -c $(SBSCONFIG) clean
 
 reallyclean: reallyclean_native clean_java clean_generated
 reallyclean_native: bld.inf
 	$(PHASEINFO)
-	$(SBS) -c $(PLATFORM)_$(CFG) reallyclean
+	$(SBS) -c $(SBSCONFIG) reallyclean
 
 
 # Symbian ABLD MAKEFILE --------------------
--- a/build/bldjava.inf	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/bldjava.inf	Mon Oct 04 11:29:25 2010 +0300
@@ -26,6 +26,7 @@
 
   PRJ_EXTENSIONS
   START EXTENSION java/nativejava
+  OPTION NAME jrt
   END
 #endif
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/build/buildutils/checkjava.py	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,75 @@
+#
+# Copyright (c) 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"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Check Java source code for inconsistencies. Includes following checks
+#              - is package defined and matching with file path
+#
+#! /usr/bin/python
+
+import os, fnmatch, re, sys
+from optparse import OptionParser
+
+RE_PACKAGE = re.compile(r"package\s+([\w.]+)\s*;")
+
+
+def getPackage(f):
+    ''' Return the package of Java source file, or None if not defined '''
+    fin = file(f, "r")
+    for l in fin.readlines():
+        match = RE_PACKAGE.search(l)
+        if match:
+            return match.group(1)
+
+    return None
+
+def checkPackage(f, package):
+    ''' Check if package is correct in file path. Return True if incorrect. '''
+
+    if not package:
+        print "%s(0): error: no package defined" % f
+        return True
+
+    dir = os.path.dirname(f).replace("\\", "/")
+    if not dir.endswith(package.replace(".", "/")):
+        print "%s(0): error: package \"%s\" does not match filepath" % (f, package)
+        return True
+
+    return False
+
+def checkHierarchy(root, exclude = None):
+    failures = False
+    for path, dirs, files in os.walk(root):
+        if exclude and exclude in path.replace("\\", "/").split("/"):
+            continue
+
+        filenames = [os.path.join(path, f) for f in fnmatch.filter(files, "*.java")]
+        for f in filenames:
+            result = checkPackage(f, getPackage(f))
+            failures = failures or result
+
+    return failures
+        
+def main():
+    parser = OptionParser()
+    parser.add_option("--exclude", dest = "exclude", 
+                      help = "Exclude paths having this directory component, e.g. tsrc")
+    (options, args) = parser.parse_args()
+
+    failures = False
+    for root in args:
+        failures = failures or checkHierarchy(root, options.exclude)
+
+    sys.exit(failures and 1 or 0)
+
+if __name__ == "__main__":
+    main()
--- a/build/buildutils/distribution.policy.s60.configuration.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/buildutils/distribution.policy.s60.configuration.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -14,13 +14,14 @@
 
 /.svn                              : IGNORE
 /swt/internal                      : 7
+/swt/animation/internal            : 7
 /swt/expanded/internal             : 7
 /swt/mobile/internal               : 7
-/nokiauiapi_qt/src/com/nokia/mid/ui/internal    : 7
+/nokiauiapi_qt/javasrc/com/nokia/mid/ui/internal    : 7
 /internal                          : 1
 /releng                            : 1
 ROOT/tools                         : 1
-ROOT/jrt_info			   : 1
+ROOT/jrt_info                      : 1
 ROOT/javacommons/jvms/j9/s60       : 810
 /midprms                           : 102
 /webservices/javasrc               : 102
@@ -30,3 +31,4 @@
 /broadcast_stub/javasrc            : 1
 DEFAULT_POLICY                     : 7
 ROOT_POLICY                        : 7
+ROOT/javaextensions/ccapi          : 0
--- a/build/buildutils/omake.bat	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/buildutils/omake.bat	Mon Oct 04 11:29:25 2010 +0300
@@ -14,12 +14,29 @@
 rem 
 rem  Description: Helper utility for building by developers
 rem 
+
 rem -------------------
 rem Determine java root
 setlocal
 set JAVA_SRC_ROOT=
+
+rem See if we are within jrt package (indepent of actual location)
 for %%a in (. .. ..\.. ..\..\.. ..\..\..\.. ..\..\..\..\.. ..\..\..\..\..\.. ..\..\..\..\..\..\..) do if "%JAVA_SRC_ROOT%" == "" if exist %%a\build\Makefile.comp call :setroot %%a
+if not "%JAVA_SRC_ROOT%" == "" goto resolved
 
+rem See if we are within jrtext package co-located with jrt (indepent of actual location)
+for %%a in (. .. ..\.. ..\..\.. ..\..\..\.. ..\..\..\..\.. ..\..\..\..\..\.. ..\..\..\..\..\..\..) do if "%JAVA_SRC_ROOT%" == "" if "%%~nxa" == "jrtext" if exist %%a\build\omj.pri if exist %%a\..\jrt\build\Makefile.comp call :setroot %%a\..\jrt
+if not "%JAVA_SRC_ROOT%" == "" goto resolved
+
+rem See if this is subdirectory within \ext\app\jrtext
+if "%JAVA_SRC_ROOT%" == "" for /F "delims=\ tokens=2-4" %%a in ("%CD%") do if "%%a\%%b\%%c" == "ext\app\jrtext" set JAVA_SRC_ROOT=\sf\app\jrt
+if not "%JAVA_SRC_ROOT%" == "" goto :resolved
+
+echo Could not determine JAVA_SRC_ROOT.
+goto :EOF
+
+
+:resolved
 echo JAVA_SRC_ROOT=%JAVA_SRC_ROOT%
 
 rem Make sbs to flush stdout immediately
Binary file build/loc/resources_qt.jar has changed
--- a/build/makefile	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/makefile	Mon Oct 04 11:29:25 2010 +0300
@@ -94,7 +94,9 @@
 	$(ANT) -f $(JAVA_SRC_ROOT)/build/utilities.xml -q -Dtarget.platform=$(PLATFORM) -Dtarget.cfg=$(VARIANT) clean.api.jars
 
 # Release build for build automation (sbs case is optimized to build on one go)
-releasebuild: build_all
+releasebuild: build_all sis
+
+sis:
 ifeq ($(BUILDENV),symbian)
 	$(MAKE) -C $(JAVA_SRC_ROOT)/build/sis all deploy
 endif
--- a/build/makefile.javaversion	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/makefile.javaversion	Mon Oct 04 11:29:25 2010 +0300
@@ -1,2 +1,2 @@
 # Set Java version (must be dot separated, without spaces)
-JAVA_VERSION = 2.2.15
+JAVA_VERSION = 2.2.17
--- a/build/nativejava.flm	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/nativejava.flm	Mon Oct 04 11:29:25 2010 +0300
@@ -15,15 +15,16 @@
 #              The file destinations are relative to EPOCROOT
 #
 
-# Find Java build dir by going up from $(TO_BLDINF). 
+# Find Java build dir of component $(NAME) from $(TO_BLDINF). 
 # (TO_BLDINF refers to the directory having initial bld.inf, i.e.
-#  - jrt/group (9.2 S60)
-#  - jrt/group/sf (9.2 SF)
-#  - jrt (10.1 SF/S60) 
-#  therefore the jrt-directory is found from finding first directory having
-#  subsystem.mk, going up to max. three directory levels)
+#  - combined build root, which contains directory $(NAME)
+#  - $(NAME)/group (9.2 S60)
+#  - $(NAME)/group/sf (9.2 SF)
+#  - $(NAME) (10.1 SF/S60) 
+#  therefore the $(NAME)-directory is found from finding first directory having
+#  subsystem.mk, going first down to $(NAME) and then up to max. three directory levels)
 
-JAVABUILDDIR:= $(dir $(firstword $(wildcard $(TO_BLDINF)/subsystem.mk $(TO_BLDINF)/../subsystem.mk $(TO_BLDINF)/../../subsystem.mk)))
+JAVABUILDDIR:= $(dir $(firstword $(wildcard $(TO_BLDINF)/$(NAME)/subsystem.mk $(TO_BLDINF)/subsystem.mk $(TO_BLDINF)/../subsystem.mk $(TO_BLDINF)/../../subsystem.mk)))
 
 # General Java makefile command
 JAVACMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \
@@ -35,7 +36,7 @@
 
 # Marker file to prevent multiple Java compilations of the
 # same platform/cfg, when building e.g. device variants.
-NATIVEJAVAMARKER := $(EPOCBLD)/nativejavamarker_$(PLATFORM)_$(CFG).done
+NATIVEJAVAMARKER := $(EPOCBLD)/nativejavamarker_$(NAME)_$(PLATFORM)_$(CFG).done
 
 # Java build artifact file source and target
 JAVABUILD_ARTIFACT_SRC := $(EPOCROOT)/epoc32/release/armv5/urel
@@ -44,15 +45,30 @@
 define compilenativejava
 
 # This is the general Java compilation, done once for the component
-ifeq ($(GUARD_nativejavatarget),)
-GUARD_nativejavatarget:=1
-.PHONY:: nativejavatarget
-nativejavatarget:
+ifeq ($(GUARD_nativejavatarget_$(NAME)),)
+GUARD_nativejavatarget_$(NAME):=1
+.PHONY:: nativejavatarget_$(NAME)
+nativejavatarget_$(NAME):
 	$(call startrule,compilenativejava,,javasources) \
 	$(JAVABUILDCMD) \
 	$(call endrule,compilenativejava)
+
+# If component depends on some other Java compilation, do the dependant
+# first (if on same build sequence)
+ifneq ($(DEPENDS),)
+.PHONY:: nativejavatarget_$(DEPENDS)
+nativejavatarget_$(NAME): nativejavatarget_$(DEPENDS)
+nativejavatarget_$(DEPENDS): ignored_dependency
+endif
 endif 
 
+# Phony ignored dependency, just so that we have something to use when needed
+ifeq ($(GUARD_ignored_dependency),)
+GUARD_ignored_dependency:=1
+.PHONY:: ignored_dependency
+ignored_dependency:
+endif
+
 # Actual resource target, one for each platform/cfg variant
 ifeq ($(GUARD_$(call sanitise,$(NATIVEJAVAMARKER))),)
 GUARD_$(call sanitise,$(NATIVEJAVAMARKER)):=1
@@ -60,7 +76,7 @@
 RESOURCE:: $(NATIVEJAVAMARKER)
 
 # Copy the build artifacts to target
-$(NATIVEJAVAMARKER): nativejavatarget
+$(NATIVEJAVAMARKER): nativejavatarget_$(NAME)
 ifeq ($(filter armv5_urel ARMV5_urel ARMV5_UREL,$(PLATFORM)_$(CFG)),)
 	$(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/jvm/lib/jrt)
 	$(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/security)
@@ -85,5 +101,3 @@
 $(eval $(call whatmacro,$(RELEASABLES),WHATRESOURCES))
 
 $(eval $(call GenerateStandardCleanTarget,$(NATIVEJAVAMARKER)))
-
-
--- a/build/nativejava.xml	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/nativejava.xml	Mon Oct 04 11:29:25 2010 +0300
@@ -23,5 +23,7 @@
 
     <interface name="java.nativejava" extends="Symbian.UserFLM" flm="nativejava.flm">
       <param name='BLDINF_PATH' default='$(TO_BLDINF)' />
+      <param name='NAME' />
+      <param name='DEPENDS' default=''/>
     </interface>
 </build>
--- a/build/omj.pri	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/omj.pri	Mon Oct 04 11:29:25 2010 +0300
@@ -20,6 +20,12 @@
   # Load project defines (if not already loaded). Fail if can not loaded.
   !include(../inc/build_defines.pri):error(Could not load build_defines.pri)
 
+  # Sanity check - otherwise components may fail e.g. with ODC file "what" target
+  PRO_FILE_BASE = $$basename(_PRO_FILE_)
+  !contains(PRO_FILE_BASE,$${TARGET}.pro) {
+     error(Target name $${TARGET} does not match file name of $${_PRO_FILE_})
+  }
+
   # Allow JAVATARGET to be used for defining the Java project name (java artifacts)
   isEmpty(JAVATARGET): JAVATARGET = $${TARGET}
 
@@ -154,7 +160,7 @@
   TRY_DIR=$${_PRO_FILE_PWD_}
   for(a, 1..10): {
      TRY_DIR = $$join(TRY_DIR,,,/..)
-     exists($${TRY_DIR}/build/Makefile.comp) DEPTH=$${a}
+     exists($${TRY_DIR}/build/omj.pri) DEPTH=$${a}
   }
 
   # Make include paths
--- a/build/properties.xml	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/properties.xml	Mon Oct 04 11:29:25 2010 +0300
@@ -46,7 +46,7 @@
     <isset property="env.EPOCROOT"/>
   </condition>
 
-  <!--The cldc/cdc class file locations, within the sources -->
+  <!-- Internal cldc/cdc class file location, within the sources, if available -->
   <available file="${java.src.root}/inc/classes.cldc.zip" property="bootclasspath.cldc"
              value="${java.src.root}/inc/classes.cldc.zip" />
   <available file="${java.src.root}/inc/classes.cdc.zip" property="bootclasspath.cdc"
@@ -54,7 +54,15 @@
   <available file="${java.src.root}/inc/classes.fp.zip" property="bootclasspath.fp"
              value="${java.src.root}/inc/classes.fp.zip" />
 
-  <!--The cldc/cdc class file locations, external if not found in default places -->
+  <!-- New common cldc/cdc class file location, in the platform API directory -->
+  <available file="${epocroot}epoc32/include/platform/app/classes.cldc.zip" property="bootclasspath.cldc"
+             value="${epocroot}epoc32/include/platform/app/classes.cldc.zip" />
+  <available file="${epocroot}epoc32/include/platform/app/classes.cdc.zip" property="bootclasspath.cdc"
+             value="${epocroot}epoc32/include/platform/app/classes.cdc.zip" />
+  <available file="${epocroot}epoc32/include/platform/app/classes.fp.zip" property="bootclasspath.fp"
+             value="${epocroot}epoc32/include/platform/app/classes.fp.zip" />
+                          
+  <!-- Old SF cldc/cdc class file location -->
   <property name="bootclasspath.cldc" location="${epocroot}epoc32/jrt/classes.cldc.zip"/>
   <property name="bootclasspath.cdc"  location="${epocroot}epoc32/jrt/classes.cdc.zip"/>
   <property name="bootclasspath.fp"   location="${epocroot}epoc32/jrt/classes.fp.zip"/>
--- a/build/sis/java_3_1.pkg	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/sis/java_3_1.pkg	Mon Oct 04 11:29:25 2010 +0300
@@ -85,9 +85,6 @@
 "\epoc32\release\armv5\urel\javagcf.dll"-"c:\sys\bin\javagcf.dll"
 "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javagcf.odc"-"c:\resource\java\jvm\lib\jrt\javagcf.odc"
 
-"\epoc32\release\armv5\urel\javaglobalindicators.dll"-"c:\sys\bin\javaglobalindicators.dll"
-"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javaglobalindicators.odc"-"c:\resource\java\jvm\lib\jrt\javaglobalindicators.odc"
-
 "\epoc32\release\armv5\urel\javafile.dll"-"c:\sys\bin\javafile.dll"
 "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javafile.odc"-"c:\resource\java\jvm\lib\jrt\javafile.odc"
 
@@ -209,6 +206,7 @@
 "\epoc32\release\armv5\urel\javacaptain_ext_btdeviceclassmanager.dll"   -"c:\sys\bin\javacaptain_ext_btdeviceclassmanager.dll"
 "\epoc32\release\armv5\urel\javacaptain_ext_autostarter.dll"            -"c:\sys\bin\javacaptain_ext_autostarter.dll"
 "\epoc32\release\armv5\urel\javacaptain_ext_settingslistener.dll"       -"c:\sys\bin\javacaptain_ext_settingslistener.dll"
+"\epoc32\release\armv5\urel\javacaptain_ext_javasoftnoteplugin.dll"     -"c:\sys\bin\javacaptain_ext_javasoftnoteplugin.dll"
 ; PLUGIN_ID_JAVA_CERT_STORE_EXTENSION_C = 7
 "\epoc32\release\armv5\urel\javacaptain_ext_ondemand_7.dll"             -"c:\sys\bin\javacaptain_ext_ondemand_7.dll"
 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
@@ -330,8 +328,8 @@
 ;"\epoc32\release\armv5\urel\javam2g.dll"-"c:\sys\bin\javam2g.dll"
 ;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javam2g.odc"-"c:\resource\java\jvm\lib\jrt\javam2g.odc"
 
-;"\epoc32\release\armv5\urel\javam3g.dll"-"c:\sys\bin\javam3g.dll"
-;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javam3g.odc"-"c:\resource\java\jvm\lib\jrt\javam3g.odc"
+"\epoc32\release\armv5\urel\javam3g.dll"-"c:\sys\bin\javam3g.dll"
+"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javam3g.odc"-"c:\resource\java\jvm\lib\jrt\javam3g.odc"
 
 "\epoc32\release\armv5\urel\javanokiasound.dll"-"c:\sys\bin\javanokiasound.dll"
 "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javanokiasound.odc"-"c:\resource\java\jvm\lib\jrt\javanokiasound.odc"
--- a/build/symbian_uids.pri	Fri Sep 17 16:44:34 2010 +0300
+++ b/build/symbian_uids.pri	Mon Oct 04 11:29:25 2010 +0300
@@ -126,7 +126,11 @@
 contains(TARGET, javaopengles): TARGET.UID3 = 0x20031DD1
 contains(TARGET, javacentrep): TARGET.UID3 = 0x2002DCE1
 contains(TARGET, javachapi): TARGET.UID3 = 0x2002DCE4
+contains(TARGET, javaccapi): TARGET.UID3 = 0x200345B9
+contains(TARGET, javaccapiext): TARGET.UID3 = 0x200345BA
+contains(TARGET, javandefscplugin): TARGET.UID3 = 0x200345BB
 contains(TARGET, javasoftindicatorplugin): TARGET.UID3 = 0x20031E8E
+contains(TARGET, javacaptain_ext_javasoftnoteplugin): TARGET.UID3 = 0x20034596
 
 isEmpty(TARGET.UID3): error($${TEMPLATE} $${TARGET} : UID3 not defined. Please allocate UID3 and configure it either on $${TARGET}.pro file or in command symbian_uids.pri)
 
--- a/inc/build_defines.hrh	Fri Sep 17 16:44:34 2010 +0300
+++ b/inc/build_defines.hrh	Mon Oct 04 11:29:25 2010 +0300
@@ -15,25 +15,26 @@
 *
 */
 
-#define RD_JAVA_VERSION 2,2,15
-#define RD_JAVA_BIN_VERSION_NONQT 10.527
-#define RD_JAVA_SYMBIAN_TARGET 
-#define RD_JAVA_S60_RELEASE_10_1 
-#define RD_JAVA_S60_RELEASE_10_1_ONWARDS 
-#define RD_JAVA_S60_RELEASE_9_2_ONWARDS 
-#define RD_JAVA_S60_RELEASE_5_0_ONWARDS 
-#define RD_JAVA_UI_QT 
-#define RD_JAVA_STDCPPV5 
-#define RD_JAVA_EPOCALLOWDLLDATA_FIX 
-#define RD_JAVA_HTTP_EMC_ENABLED 
-#define RD_JAVA_NGA_ENABLED 
-#define SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK 
-#define RD_JAVA_PROXIMITY_LISTENER_ENABLED 
-#define RD_JAVA_OPENC_BETA_PATCH 
-#define OPENLCDUI_ENABLED 
-#define RD_JAVA_OPENLCDUI_ENABLED 
-#define RD_JAVA_INSTALLERUI_ENABLED 
-#define RD_JAVA_PREWARM 
-#define RD_JAVA_ADVANCED_TACTILE_FEEDBACK 
-#define RD_JAVA_APPLICATION_SETTINGS_QT 
-#define RD_JAVA_MIDPRMS_DB 
+#define RD_JAVA_VERSION 2,2,17
+#define RD_JAVA_BIN_VERSION_NONQT 10.529
+#define RD_JAVA_SYMBIAN_TARGET
+#define RD_JAVA_S60_RELEASE_10_1
+#define RD_JAVA_S60_RELEASE_10_1_ONWARDS
+#define RD_JAVA_S60_RELEASE_9_2_ONWARDS
+#define RD_JAVA_S60_RELEASE_5_0_ONWARDS
+#define RD_JAVA_PKG_SPLIT
+#define RD_JAVA_UI_QT
+#define RD_JAVA_STDCPPV5
+#define RD_JAVA_EPOCALLOWDLLDATA_FIX
+#define RD_JAVA_HTTP_EMC_ENABLED
+#define RD_JAVA_NGA_ENABLED
+#define SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+#define RD_JAVA_PROXIMITY_LISTENER_ENABLED
+#define RD_JAVA_OPENC_BETA_PATCH
+#define OPENLCDUI_ENABLED
+#define RD_JAVA_OPENLCDUI_ENABLED
+#define RD_JAVA_INSTALLERUI_ENABLED
+#define RD_JAVA_PREWARM
+#define RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+#define RD_JAVA_APPLICATION_SETTINGS_QT
+#define RD_JAVA_MIDPRMS_DB
--- a/inc/build_defines.pri	Fri Sep 17 16:44:34 2010 +0300
+++ b/inc/build_defines.pri	Mon Oct 04 11:29:25 2010 +0300
@@ -13,5 +13,5 @@
 #
 # Description: Generated file - do not edit manually
 #
-RD_JAVA_BIN_VERSION = 10.2.15
-PROJECT_DEFINES *= RD_JAVA_SYMBIAN_TARGET RD_JAVA_S60_RELEASE_10_1 RD_JAVA_S60_RELEASE_10_1_ONWARDS RD_JAVA_S60_RELEASE_9_2_ONWARDS RD_JAVA_S60_RELEASE_5_0_ONWARDS RD_JAVA_UI_QT RD_JAVA_STDCPPV5 RD_JAVA_EPOCALLOWDLLDATA_FIX RD_JAVA_HTTP_EMC_ENABLED RD_JAVA_NGA_ENABLED SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK RD_JAVA_PROXIMITY_LISTENER_ENABLED RD_JAVA_OPENC_BETA_PATCH OPENLCDUI_ENABLED RD_JAVA_OPENLCDUI_ENABLED RD_JAVA_INSTALLERUI_ENABLED RD_JAVA_PREWARM RD_JAVA_ADVANCED_TACTILE_FEEDBACK RD_JAVA_APPLICATION_SETTINGS_QT RD_JAVA_MIDPRMS_DB 
+RD_JAVA_BIN_VERSION = 10.2.17
+PROJECT_DEFINES *= RD_JAVA_SYMBIAN_TARGET RD_JAVA_S60_RELEASE_10_1 RD_JAVA_S60_RELEASE_10_1_ONWARDS RD_JAVA_S60_RELEASE_9_2_ONWARDS RD_JAVA_S60_RELEASE_5_0_ONWARDS RD_JAVA_PKG_SPLIT RD_JAVA_UI_QT RD_JAVA_STDCPPV5 RD_JAVA_EPOCALLOWDLLDATA_FIX RD_JAVA_HTTP_EMC_ENABLED RD_JAVA_NGA_ENABLED SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK RD_JAVA_PROXIMITY_LISTENER_ENABLED RD_JAVA_OPENC_BETA_PATCH OPENLCDUI_ENABLED RD_JAVA_OPENLCDUI_ENABLED RD_JAVA_INSTALLERUI_ENABLED RD_JAVA_PREWARM RD_JAVA_ADVANCED_TACTILE_FEEDBACK RD_JAVA_APPLICATION_SETTINGS_QT RD_JAVA_MIDPRMS_DB 
--- a/inc/java.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/inc/java.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -1,1 +1,1 @@
-2.2.15
+2.2.17
--- a/inc/project_defines.hrh	Fri Sep 17 16:44:34 2010 +0300
+++ b/inc/project_defines.hrh	Mon Oct 04 11:29:25 2010 +0300
@@ -20,6 +20,7 @@
 MACRO RD_JAVA_S60_RELEASE_10_1_ONWARDS 
 MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS 
 MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS 
+MACRO RD_JAVA_PKG_SPLIT 
 MACRO RD_JAVA_UI_QT 
 MACRO RD_JAVA_STDCPPV5 
 MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX 
--- a/javacommons/comms/comms.pro	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/comms/comms.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -14,7 +14,7 @@
 # Description: Generated file - do not edit manually
 #
 TEMPLATE = subdirs
-SUBDIRS += ipclib/clientserver/build/ipc.pro 
+SUBDIRS += ipclib/clientserver/build/javaipc.pro 
 SUBDIRS += build/javacomms.pro 
 BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"ipclib/build/bld.inf\""  
 BLD_INF_RULES.prj_extensions += "prj_extensions" 
--- a/javacommons/comms/ipclib/clientserver/build/ipc.pro	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#
-# Copyright (c) 2009 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"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-TEMPLATE=lib
-TARGET=javaipc
-CONFIG += omj stl
-CONFIG -= qt
-
-include(../../../../../build/omj.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/comms/ipclib/clientserver/build/javaipc.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2009 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"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE=lib
+TARGET=javaipc
+CONFIG += omj stl
+CONFIG -= qt
+
+include(../../../../../build/omj.pri)
--- a/javacommons/comms/ipclib/socket/build/ipc.pro	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#
-# Copyright (c) 2009 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"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-TEMPLATE=lib
-TARGET=javaipc
-CONFIG += omj stl
-CONFIG -= qt
-
-include(../../../../../build/omj.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/comms/ipclib/socket/build/javaipc.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,22 @@
+#
+# Copyright (c) 2009 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"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE=lib
+TARGET=javaipc
+CONFIG += omj stl
+CONFIG -= qt
+
+include(../../../../../build/omj.pri)
--- a/javacommons/connectionmanager/legacysupport/apnsettings/build/apnsettings.pro	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-#
-# Copyright (c) 2009 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"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-TEMPLATE=lib
-TARGET=midp2cenrep
-CONFIG += omj stl
-CONFIG -= qt
-
-LIBS += -ljavastorage
-
-symbian {
-    INCLUDEPATH += ../inc.s60 \
-                   ../../../inc.s60
-    
-    LIBS += -ljavaconnectionmanager
-    
-    SOURCES += ../src.s60/*.cpp
-}
-
-include(../../../../../build/omj.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/connectionmanager/legacysupport/apnsettings/build/midp2cenrep.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2009 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"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE=lib
+TARGET=midp2cenrep
+CONFIG += omj stl
+CONFIG -= qt
+
+LIBS += -ljavastorage
+
+symbian {
+    INCLUDEPATH += ../inc.s60 \
+                   ../../../inc.s60
+    
+    LIBS += -ljavaconnectionmanager
+    
+    SOURCES += ../src.s60/*.cpp
+}
+
+include(../../../../../build/omj.pri)
--- a/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileOutputStream.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileOutputStream.java	Mon Oct 04 11:29:25 2010 +0300
@@ -64,7 +64,10 @@
 
     public synchronized void flush() throws IOException
     {
-        // Data written to native side immediately. Nothing to flush.
+        if (iDataSink != null)
+        {
+            iDataSink.flush();
+        }
     }
 
     public void close() throws IOException
--- a/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileStreamHandler.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileStreamHandler.java	Mon Oct 04 11:29:25 2010 +0300
@@ -240,6 +240,11 @@
         _writeData(iNativeHandle, aBytes, aOffset, aLength);
     }
 
+    protected void flush()
+    {
+        _flush(iNativeHandle);
+    }
+    
     /**
      * Closes all output streams.
      *
@@ -332,6 +337,8 @@
     private native void _writeData(int aNativePeer, byte[] aBytes, int aOffset,
                                    int aLength);
 
+    private native void _flush(int aNativePeer);
+
     private native void _closeFileStream(int aHandle);
 
     private native void _openFileForReading(int aHandle);
--- a/javacommons/fileutils/src/filestreamhandlerjni.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/fileutils/src/filestreamhandlerjni.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -187,6 +187,35 @@
 
 /*
  * Class:     com_nokia_mj_impl_fileutils_FileStreamHandler
+* Method:    _flush
+* Signature: (I)V
+*/
+JNIEXPORT void JNICALL Java_com_nokia_mj_impl_fileutils_FileStreamHandler__1flush
+(JNIEnv *aJni, jobject, jint aHandle)
+{
+    try
+    {
+        NativeFileIOHandler* handler =
+            reinterpret_cast<NativeFileIOHandler*>(aHandle);
+        handler->flush();
+    }
+    catch (int error)
+    {
+        WLOG1(EJavaFile, "FileStreamHandler: JNI: flush error : Error: %d",
+              error);
+        JniUtils::throwNewException(aJni, "java/io/IOException",
+                                    "Flush failed.");
+    }
+    catch (...)
+    {
+        ELOG(EJavaFile, "FileStreamHandler: JNI: flush: Unknown error.");
+        JniUtils::throwNewException(aJni, "java/io/IOException",
+                                    "Flush failed.");
+    }
+}
+
+/*
+ * Class:     com_nokia_mj_impl_fileutils_FileStreamHandler
  * Method:    _closeFileStream
  * Signature: (I)V
  */
--- a/javacommons/fileutils/src/nativefileiohandler.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/fileutils/src/nativefileiohandler.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -179,6 +179,19 @@
     closeStream();
 }
 
+void NativeFileIOHandler::flush()
+{
+    JELOG2(EJavaFile);
+    int ret = fsync(mFileDescriptor);
+    if (ret < 0)
+    {
+        ELOG1(EJavaFile, "NativeFileIOHandler::flush() error %d", ret);
+        int error = errno;
+        throw error;
+    }
+
+}
+
 void NativeFileIOHandler::closeStream()
 {
     JELOG2(EJavaFile);
--- a/javacommons/fileutils/src/nativefileiohandler.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/fileutils/src/nativefileiohandler.h	Mon Oct 04 11:29:25 2010 +0300
@@ -95,6 +95,11 @@
      */
     virtual long available();
 
+    /**
+     * Flush the contents to the permanent storage.
+     */
+    virtual void flush();
+
 protected:
     virtual void handleReopenCase();
 
--- a/javacommons/javacommons.pro	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/javacommons.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -22,6 +22,6 @@
 SUBDIRS += security 
 SUBDIRS += gcfbase/build/javagcf.pro 
 SUBDIRS += connectionmanager/build/javaconnectionmanager.pro 
-SUBDIRS += javaenv/build/javaenv.pro 
+SUBDIRS += javaenv/build/javaenvinfo.pro 
 SUBDIRS += gcfprotocols 
 BLD_INF_RULES.prj_extensions += "prj_extensions" 
--- a/javacommons/javaenv/build/javaenv.pro	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#
-# Copyright (c) 2009 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"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-TEMPLATE=lib
-TARGET=javaenvinfo
-CONFIG += omj stl
-CONFIG -= qt
-
-symbian {
-    TARGET.UID2 = 0x1000008d
-    TARGET.UID3 = 0x2001B2A5
-    SOURCES += ../src.s60/*.cpp
-    LIBS += -lplatformenv -lefsrv
-}
-
-include(../../../build/omj.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/javaenv/build/javaenvinfo.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,29 @@
+#
+# Copyright (c) 2009 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"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE=lib
+TARGET=javaenvinfo
+CONFIG += omj stl
+CONFIG -= qt
+
+symbian {
+    TARGET.UID2 = 0x1000008d
+    TARGET.UID3 = 0x2001B2A5
+    SOURCES += ../src.s60/*.cpp
+    LIBS += -lplatformenv -lefsrv
+}
+
+include(../../../build/omj.pri)
--- a/javacommons/javaenv/src.s60/javaenvinfo.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/javaenv/src.s60/javaenvinfo.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -26,7 +26,7 @@
 namespace Java
 {
 
-TInt ParseVersionL(TLex& aVersionText,TBool aLastVersionNumber);
+TInt ParseVersionL(TLex& aVersionText, TBool aLastVersionNumber, TUint aVersionNumMaxValue);
 
 // User-agent header substring
 _LIT(KUserAgentJavaString, "Configuration/CLDC-1.1 Profile/MIDP-2.1");
@@ -40,12 +40,10 @@
 // Length of temporary buffer for string manipulation
 const TUint KBufferSize = 32;
 
-// The min and max values for each version number
-// const TUint KMajorVersionMinValue = 1;
+// The max values for each field of version number (from TVersion)
 const TUint KMajorVersionMaxValue = 127;
-// const TUint KMinorVersionMaxValue = 9;
-// const TUint KBuildVersionMinValue = 1;
-// const TUint KBuildVersionMaxValue = 32767;
+const TUint KMinorVersionMaxValue = 99;
+const TUint KBuildVersionMaxValue = 32767;
 
 
 // ======== MEMBER FUNCTIONS ========
@@ -161,9 +159,9 @@
     // parse the version numbers (major, minor, build) from the string
     // leave if  error occurs in string or in its format (e.g.: missing dot char, wrong value)
     TLex versionText(buffer16->Des());
-    TUint32 majorVersion = ParseVersionL(versionText,EFalse);
-    TUint32 minorVersion = ParseVersionL(versionText,EFalse);
-    TUint32 buildVersion = ParseVersionL(versionText,ETrue);
+    TUint32 majorVersion = ParseVersionL(versionText,EFalse, KMajorVersionMaxValue);
+    TUint32 minorVersion = ParseVersionL(versionText,EFalse, KMinorVersionMaxValue);
+    TUint32 buildVersion = ParseVersionL(versionText,ETrue, KBuildVersionMaxValue);
 
     TVersion version(majorVersion, minorVersion, buildVersion);
 
@@ -178,7 +176,7 @@
 //
 //
 //
-TInt ParseVersionL(TLex& aVersionText,TBool aLastVersionNumber)
+TInt ParseVersionL(TLex& aVersionText, TBool aLastVersionNumber, TUint aVersionNumMaxValue)
 {
     JELOG2(EUtils);
 
@@ -192,9 +190,9 @@
     TUint32 version(0);
     if (partialVersionText.BoundedVal(version,
                                       EDecimal,
-                                      Java::KMajorVersionMaxValue) != KErrNone)
+                                      aVersionNumMaxValue) != KErrNone)
     {
-        LOG(EUtils,EInfo, " GetJavaVersionL: format of value is corrupted (major version)");
+        LOG(EUtils,EInfo, " GetJavaVersionL: format of value is corrupted");
         User::Leave(KErrCorrupt);
     }
     // check format
@@ -207,7 +205,7 @@
         }
         else
         {
-            LOG(EUtils,EInfo, " GetJavaVersionL: format of value is corrupted");
+            LOG(EUtils,EInfo, " GetJavaVersionL: format of value is corrupted2");
             User::Leave(KErrCorrupt);
         }
     }
--- a/javacommons/javastorage/inc/javastoragenames.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/javastorage/inc/javastoragenames.h	Mon Oct 04 11:29:25 2010 +0300
@@ -81,6 +81,11 @@
 const char PREINSTALL_TABLE[] = "PREINSTALL";
 
 /**
+ * SoftNote related data.
+ */
+const char JAVA_SOFTNOTE_TABLE[] = "JAVA_SOFTNOTE";
+
+/**
  * Java platform storage name. All Java platform related attributes and
  * settings are stored to this database.
  */
@@ -321,6 +326,31 @@
  */
 const wchar_t INSTALL_STATE[] = L"INSTALL_STATE";
 
+/**
+ * MIDlet ID of the softnote.
+ */
+const wchar_t SOFTNOTE_MIDLET_ID[] = L"SOFTNOTE_MIDLET_ID";
+
+/**
+ * Softnote ID.
+ */
+const wchar_t SOFTNOTE_ID[] = L"SOFTNOTE_ID";
+
+/**
+ * Softnote Primary Text.
+ */
+const wchar_t SOFTNOTE_PRIMARY_TEXT[] = L"SOFTNOTE_PRIMARY_TEXT";
+
+/**
+ * Softnote Secondary Text.
+ */
+const wchar_t SOFTNOTE_SECONDARY_TEXT[] = L"SOFTNOTE_SECONDARY_TEXT";
+
+/**
+ * Softnote Image Path.
+ */
+const wchar_t SOFTNOTE_IMAGE_PATH[] = L"SOFTNOTE_IMAGE_PATH";
+
 }    // java
 }    // storage
 
--- a/javacommons/javastorage/javasrc/com/nokia/mj/impl/storage/StorageNames.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/javastorage/javasrc/com/nokia/mj/impl/storage/StorageNames.java	Mon Oct 04 11:29:25 2010 +0300
@@ -81,6 +81,11 @@
      * Preinstall related data.
      */
     public static final String PREINSTALL_TABLE = "PREINSTALL";
+    
+    /**
+     * SoftNote related data.
+     */
+    public static final String JAVA_SOFTNOTE_TABLE = "JAVA_SOFTNOTE";
 
     /**
      * Java platform storage name. All Java platform related attributes and
@@ -323,4 +328,29 @@
      * Application suite intall state.
      */
     public static final String INSTALL_STATE = "INSTALL_STATE";
+    
+    /**
+     * MIDlet ID of the softnote.
+     */
+    public static final String SOFTNOTE_MIDLET_ID = "SOFTNOTE_MIDLET_ID";
+
+    /** 
+     * Softnote ID.
+     */
+    public static final String SOFTNOTE_ID = "SOFTNOTE_ID";
+
+    /**
+     * Softnote Primary Text.
+     */
+    public static final String SOFTNOTE_PRIMARY_TEXT = "SOFTNOTE_PRIMARY_TEXT";
+
+    /**
+     * Softnote Secondary Text.
+     */
+    public static final String SOFTNOTE_SECONDARY_TEXT = "SOFTNOTE_SECONDARY_TEXT";
+
+    /**
+     * Softnote Image Path.
+     */
+    public static final String SOFTNOTE_IMAGE_PATH = "SOFTNOTE_IMAGE_PATH";
 }
--- a/javacommons/javastorage/src.s60/client/javadataaccessimpl.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/javastorage/src.s60/client/javadataaccessimpl.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -100,8 +100,8 @@
 
     if (JAVA_DATABASE_NAME == aStorageName)
     {
-        sqlStatement.append("NAME FROM ");
-        sqlStatement.append(PREINSTALL_TABLE);
+        sqlStatement.append("SOFTNOTE_MIDLET_ID FROM ");
+        sqlStatement.append(JAVA_SOFTNOTE_TABLE);
     }
     else if (JAVA_OTA_DATABASE_NAME == aStorageName)
     {
@@ -180,6 +180,10 @@
         sqlDes.reset(stringToDes(PREINSTALL));
         LOG(EJavaStorage, EInfo, "Creating PREINSTALL");
         createTable(sqlDes->Des());
+        
+        sqlDes.reset(stringToDes(JAVA_SOFTNOTE));
+        LOG(EJavaStorage, EInfo, "Creating JAVA_SOFTNOTE");
+        createTable(sqlDes->Des());
     }
     else if (JAVA_OTA_DATABASE_NAME == aStorageName
              && !isDBInitialized(aStorageName))
--- a/javacommons/javastorage/src/javastoragetables.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/javastorage/src/javastoragetables.h	Mon Oct 04 11:29:25 2010 +0300
@@ -71,6 +71,11 @@
 const char PREINSTALL[] = "CREATE TABLE PREINSTALL ( NAME VARCHAR(50), \
 VENDOR VARCHAR(50), VERSION VARCHAR(50), INSTALL_STATE INT(1));";
 
+const char JAVA_SOFTNOTE[] = "CREATE TABLE JAVA_SOFTNOTE ( \
+SOFTNOTE_MIDLET_ID VARCHAR(12), SOFTNOTE_ID INT(10), \
+SOFTNOTE_PRIMARY_TEXT VARCHAR(256), SOFTNOTE_SECONDARY_TEXT VARCHAR(256), \
+SOFTNOTE_IMAGE_PATH VARCHAR(256), PRIMARY KEY(SOFTNOTE_MIDLET_ID,SOFTNOTE_ID));";
+
 }    // java
 }    // storage
 
--- a/javacommons/javastorage/src/server/storagedbhandler.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/javastorage/src/server/storagedbhandler.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -374,6 +374,7 @@
         executeStandalone(ALARM_REGISTRATIONS);
         executeStandalone(RUNTIME_SETTINGS);
         executeStandalone(PREINSTALL);
+        executeStandalone(JAVA_SOFTNOTE);
     }
     else if (JAVA_OTA_DATABASE_NAME == aDbName)
     {
--- a/javacommons/jvms/jvms.pro	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/jvms/jvms.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -16,5 +16,4 @@
 TEMPLATE = subdirs
 SUBDIRS += nativeportlayer/build/jvmnativeport.pro 
 SUBDIRS += j9utils/threaddump/build/javathreaddumper.pro 
-SUBDIRS += j9/j9.pro 
 BLD_INF_RULES.prj_extensions += "prj_extensions" 
--- a/javacommons/jvms/subsystem.mk	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/jvms/subsystem.mk	Mon Oct 04 11:29:25 2010 +0300
@@ -18,10 +18,19 @@
 
 COMPONENTS = \
 	nativeportlayer/build \
-	j9utils/threaddump/build \
-	j9
+	j9utils/threaddump/build
+
+# Component j9 is needed only if the package hasn't been split
+ifndef RD_JAVA_PKG_SPLIT
+   COMPONENTS += j9
+endif    
 
 SYMBIAN_ONLY = nativeportlayer/build
 LINUX_ONLY = 
 
+# Declare that release preparation removes subdirectories not in build, except
+# listed special cases
+REMOVE_NOTBUILT_EXCLUDING = 
+
+
 include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- a/javacommons/security/data/att_manufacturer.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/data/att_manufacturer.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -38,5 +38,7 @@
     permission javax.microedition.PropertyPermission "mobinfo.cellid" "read";
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
     permission javax.microedition.midlet.AutoStartPermission;
 }
--- a/javacommons/security/data/att_operator.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/data/att_operator.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -59,3 +59,8 @@
 grant assigned {
     permission javax.microedition.midlet.AutoStartPermission;
 }
+
+grant assigned "Read User Data Access" {
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
+}
--- a/javacommons/security/data/att_operatorextra.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/data/att_operatorextra.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -38,5 +38,7 @@
     permission javax.microedition.PropertyPermission "mobinfo.cellid" "read";
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
     permission javax.microedition.midlet.AutoStartPermission;
 }
\ No newline at end of file
--- a/javacommons/security/data/msa_manufacturer.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/data/msa_manufacturer.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -44,5 +44,7 @@
     permission javax.microedition.PropertyPermission "mobinfo.cellid" "read";
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
     permission javax.microedition.midlet.AutoStartPermission;
 }
--- a/javacommons/security/data/msa_operator.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/data/msa_operator.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -44,5 +44,7 @@
     permission javax.microedition.PropertyPermission "mobinfo.cellid" "read";
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
     permission javax.microedition.midlet.AutoStartPermission;
 }
--- a/javacommons/security/data/msa_trustedthirdparty.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/data/msa_trustedthirdparty.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -86,3 +86,8 @@
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
 }
+
+grant assigned "Read User Data Access" {
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
+}
--- a/javacommons/security/data/msa_untrusted.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/data/msa_untrusted.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -75,3 +75,8 @@
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
 }
+
+grant assigned "Read User Data Access" {
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
+}
--- a/javacommons/security/data/s60_manufacturer.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/data/s60_manufacturer.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -44,5 +44,7 @@
     permission javax.microedition.PropertyPermission "mobinfo.cellid" "read";
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
     permission javax.microedition.midlet.AutoStartPermission;
 }
--- a/javacommons/security/data/s60_operator.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/data/s60_operator.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -44,5 +44,7 @@
     permission javax.microedition.PropertyPermission "mobinfo.cellid" "read";
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
     permission javax.microedition.midlet.AutoStartPermission;
 }
--- a/javacommons/security/data/s60_trustedthirdparty.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/data/s60_trustedthirdparty.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -87,3 +87,9 @@
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
 }
+
+grant assigned "Read User Data Access" {
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
+}
+
--- a/javacommons/security/data/s60_untrusted.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/data/s60_untrusted.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -22,7 +22,7 @@
     permission javax.microedition.io.FileProtocolPermission "*" "read";
     permission javax.microedition.pim.ContactList "pim://*" "read_contacts";
     permission javax.microedition.pim.EventList "pim://*" "read_events";
-    permission javax.microedition.pim.ToDoList "pim://*" "read_todos";
+    permission javax.microedition.pim.ToDoList "pim://*" "read_todos";    
 }
 
 grant user "Write User Data Access" oneshot,session,no {
@@ -75,3 +75,8 @@
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
 }
+
+grant assigned "Read User Data Access" {
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
+}
--- a/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authorization/PermissionResolver.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authorization/PermissionResolver.java	Mon Oct 04 11:29:25 2010 +0300
@@ -447,6 +447,15 @@
         return resolvedPermissions;
     }
 
+    /**
+     * Cleans the cache
+     */
+    public static void cleanup()
+    {
+        policyPermissionInstances.clear();
+        grantedPermissionInstances.clear();
+    }
+    
     private static Vector resolvePermission(
         Uid msUID,
         Permission requestedPermission,
--- a/javacommons/security/src/utils/securityutils.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/src/utils/securityutils.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -16,6 +16,7 @@
 */
 #include <string.h>
 #include "securityutils.h"
+#include <openssl/bn.h>
 #include "telutils.h"
 #include "fileutils.h"
 #include "com_nokia_mj_impl_security_utils_TelUtils.h"
@@ -307,20 +308,10 @@
     details->notAfter[14] = '\0';
     ASN1_TIME_free(gTimeAfter);
     // serial number
-    ASN1_INTEGER* serial_number = X509_get_serialNumber(&cert);
-    details->serial_number = new char[10];
-    unsigned char * int_serial_number = new unsigned char[20];
-    unsigned char * tmp_serial_number = int_serial_number;
-    int len = i2c_ASN1_INTEGER(serial_number, &tmp_serial_number);
-    if (len > 0)
-    {
-        // format it as hex
-        sprintf(details->serial_number,"%08lX",int_serial_number);
-        details->serial_number[8] = '\0';
-    }
-    delete[] int_serial_number;
-    int_serial_number = NULL;
-    tmp_serial_number = NULL;
+    BIGNUM *bn = BN_new();
+    ASN1_INTEGER_to_BN(X509_get_serialNumber(&cert), bn);
+    details->serial_number = BN_bn2hex(bn);
+    BN_free(bn);
     // fingerprint
     const EVP_MD * SHA1=EVP_sha1();
     unsigned int n;
--- a/javacommons/security/tsrc/build/build.xml	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/build/build.xml	Mon Oct 04 11:29:25 2010 +0300
@@ -51,6 +51,7 @@
   <property name="jvmargsmodifier.default.dll" location="/epoc32/release/winscw/udeb/javajvmargsmodifier.dll"/>
   <property name="jvmargsmodifier.filebased.dll" location="/epoc32/release/winscw/udeb/javajvmargsmodifierfile.dll"/>
   <property name="external.policy.editor.tool.lib" location="../tmp/engine.jar"/>
+  <property name="trustrootslist.dir" location="/epoc32/winscw/c/resource/java/security/trustroots/"/>
   <property name="javac.source" value="1.3"/>
   <property name="javac.target" value="1.3"/>
 
@@ -67,6 +68,7 @@
       <copy todir="${certs.dest.dir}">
           <fileset dir="${certs.src.dir}"/>
       </copy>
+      <copy file="../data/midprootslist" todir="${trustrootslist.dir}" overwrite="true"/>
       <!--move file="${s60.networking.dir}/ip.tcpip.esk" todir="${test.tmp.dir}/networking"/>
       <move file="${s60.networking.dir2}/cccccc00.cre" todir="${test.tmp.dir}/networking"/>
       <unzip src="../data/wsock.zip" dest="/"/-->      
@@ -83,6 +85,7 @@
       <copy todir="${certs.state.dest.dir}">
           <fileset dir="${test.tmp.dir}/state"/>
       </copy>
+      <delete dir="${trustrootslist.dir}"/>
       <!--move file="${test.tmp.dir}/networking/ip.tcpip.esk" todir="${s60.networking.dir}"/>
       <move file="${test.tmp.dir}/networking/cccccc00.cre" todir="${s60.networking.dir2}"/>
       <delete file="/epoc32/release/winscw/udeb/wsock6.lib"/>
--- a/javacommons/security/tsrc/build/cleanup.bat	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/build/cleanup.bat	Mon Oct 04 11:29:25 2010 +0300
@@ -15,4 +15,4 @@
 @rem
 
 call ant clean
-call abld clean winscw udeb
+call sbs -c winscw_udeb reallyclean
--- a/javacommons/security/tsrc/build/compile.bat	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/build/compile.bat	Mon Oct 04 11:29:25 2010 +0300
@@ -16,5 +16,4 @@
 
 call ../data/ocspresponder/startResponder.bat ../data/ocspresponder/index.txt ../data/ocspresponder/CA.pem ../data/ocspresponder/CA.key
 call ant
-call bldmake bldfiles
-call abld build winscw udeb
\ No newline at end of file
+call sbs -c winscw_udeb
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/security/tsrc/data/midprootslist	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,3 @@
+test_manufacturer.der
+test_operator.der
+test_trustedthirdparty.der
\ No newline at end of file
--- a/javacommons/security/tsrc/data/policies/test_manufacturer.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/data/policies/test_manufacturer.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -31,11 +31,19 @@
     permission javax.microedition.io.Connector.rtsp "*";
     permission javax.microedition.PropertyPermission "mobinfo.imsi" "read";
     permission javax.microedition.midlet.CmdLineArgsPermission;
+    permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write";
+    permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance";
+    permission javax.microedition.io.Connector.ndef "ndef://*" "open";
+    permission javax.microedition.io.Connector.rf "rf://*" "open";
+    permission javax.microedition.io.Connector.sc "sc://*" "open";
+    permission javax.microedition.io.Connector.vtag "vtag://*" "open";
 }
 grant assigned {
     permission javax.microedition.PropertyPermission "mobinfo.msisdn" "read";
     permission javax.microedition.PropertyPermission "mobinfo.cellid" "read";
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
     permission javax.microedition.midlet.AutoStartPermission;
 }
--- a/javacommons/security/tsrc/data/policies/test_operator.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/data/policies/test_operator.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -31,11 +31,19 @@
     permission javax.microedition.io.Connector.rtsp "*";
     permission javax.microedition.PropertyPermission "mobinfo.imsi" "read";
     permission javax.microedition.midlet.CmdLineArgsPermission;
+    permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write";
+    permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance";
+    permission javax.microedition.io.Connector.ndef "ndef://*" "open";
+    permission javax.microedition.io.Connector.rf "rf://*" "open";
+    permission javax.microedition.io.Connector.sc "sc://*" "open";
+    permission javax.microedition.io.Connector.vtag "vtag://*" "open";
 }
 grant assigned {
     permission javax.microedition.PropertyPermission "mobinfo.msisdn" "read";
     permission javax.microedition.PropertyPermission "mobinfo.cellid" "read";
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
     permission javax.microedition.midlet.AutoStartPermission;
 }
--- a/javacommons/security/tsrc/data/policies/test_trustedthirdparty.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/data/policies/test_trustedthirdparty.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -67,10 +67,19 @@
     permission javax.microedition.midlet.CmdLineArgsPermission;
 }
 
+grant user "NFC Write Access" session,blanket,oneshot,no {
+    permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write";
+}
+
 grant allowed {
     permission javax.microedition.io.Connector.sms "sms://*" "open,receive";
     permission javax.microedition.io.Connector.mms "mms://*" "open,receive";
     permission javax.microedition.io.Connector.cbs "cbs://*" "open,receive";
+    permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance";
+    permission javax.microedition.io.Connector.ndef "ndef://*" "open";
+    permission javax.microedition.io.Connector.rf "rf://*" "open";
+    permission javax.microedition.io.Connector.sc "sc://*" "open";
+    permission javax.microedition.io.Connector.vtag "vtag://*" "open";
 }
 
 grant assigned "Location" {
@@ -78,3 +87,8 @@
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
 }
+
+grant assigned "Read User Data Access" {
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
+}
--- a/javacommons/security/tsrc/data/policies/test_untrusted.txt	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/data/policies/test_untrusted.txt	Mon Oct 04 11:29:25 2010 +0300
@@ -55,10 +55,19 @@
     permission javax.microedition.location.LocationPermission "landmarks://*" "read,write,category,management";
 }
 
+grant user "NFC Write Access" oneshot,session,no {
+    permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write";
+}
+
 grant allowed {
     permission javax.microedition.io.Connector.sms "sms://*" "open,receive";
     permission javax.microedition.io.Connector.mms "mms://*" "open,receive";
     permission javax.microedition.io.Connector.cbs "cbs://*" "open,receive";
+    permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance";
+    permission javax.microedition.io.Connector.ndef "ndef://*" "open";
+    permission javax.microedition.io.Connector.rf "rf://*" "open";
+    permission javax.microedition.io.Connector.sc "sc://*" "open";
+    permission javax.microedition.io.Connector.vtag "vtag://*" "open";
 }
 
 grant assigned "Location" {
@@ -66,3 +75,8 @@
     permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read";
     permission javax.microedition.PropertyPermission "mobinfo.networkid" "read";
 }
+
+grant assigned "Read User Data Access" {
+    permission javax.microedition.PropertyPermission "mobinfo.spn" "read";
+    permission javax.microedition.PropertyPermission "mobinfo.ons" "read";
+}
--- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/OMJSecurityTests.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/OMJSecurityTests.java	Mon Oct 04 11:29:25 2010 +0300
@@ -162,7 +162,7 @@
     {
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         StorageEntry appPackageEntry = new StorageEntry();
         appPackageEntry.addAttribute(new StorageAttribute(
                                          StorageAttribute.ID,
@@ -185,7 +185,7 @@
         // Legacy signed MIDlet, no permissions requested -> any checkPermission must fail
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwA0wDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX0RldmljZV9NYW51ZmFjdHVyZXIwHhcNMDgwNjEyMDYxOTU3WhcNMTgwNjEwMDYxOTU3WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfRGV2aWNlX01hbnVmYWN0dXJlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApi3ipIPj8O33/rZre1euh7Itd9d6ZVf2mvQ/tLpHEsFJe5XLOsVViMvFskhhKUzmDsRbP4J03L6827/vEDIi/1i8kJGLaoFqJYaLGFWI2Zmxlj6aJV8cfZyOjmQPWJn1IDEe1ZAWbvMSp8xibWRsCLNEGKIkxQvAr/QDK/6iS+kCAwEAATANBgkqhkiG9w0BAQQFAAOBgQCDXt6klAs6yKvdTab3D2wkdoi3Lu4YFsMgLexJOu5HhAUJ/9VYO+Q2+mjd95MRsTa5rWQ2Jjvhn57Z3z/KBOwfHbymmNtMk6Gl14H0vQRoHa31jh3mTuAy5KotDVthaDp30aOizk473NU68wY1WdP4gFk5ZhrpNea9q3st13BxIQ=="));
@@ -229,7 +229,7 @@
         // legacy signed MIDlet, some permissions requested -> checkPermission for not granted perms fails
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwA0wDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX0RldmljZV9NYW51ZmFjdHVyZXIwHhcNMDgwNjEyMDYxOTU3WhcNMTgwNjEwMDYxOTU3WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfRGV2aWNlX01hbnVmYWN0dXJlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApi3ipIPj8O33/rZre1euh7Itd9d6ZVf2mvQ/tLpHEsFJe5XLOsVViMvFskhhKUzmDsRbP4J03L6827/vEDIi/1i8kJGLaoFqJYaLGFWI2Zmxlj6aJV8cfZyOjmQPWJn1IDEe1ZAWbvMSp8xibWRsCLNEGKIkxQvAr/QDK/6iS+kCAwEAATANBgkqhkiG9w0BAQQFAAOBgQCDXt6klAs6yKvdTab3D2wkdoi3Lu4YFsMgLexJOu5HhAUJ/9VYO+Q2+mjd95MRsTa5rWQ2Jjvhn57Z3z/KBOwfHbymmNtMk6Gl14H0vQRoHa31jh3mTuAy5KotDVthaDp30aOizk473NU68wY1WdP4gFk5ZhrpNea9q3st13BxIQ=="));
@@ -315,7 +315,7 @@
         // 2 legacy unsigned MIDlets, install from JAD -> checkPermission succeeds
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         securityAttributes = new SecurityAttributes();
@@ -336,7 +336,7 @@
         // legacy unsigned MIDlet, install from JAR -> checkPermission suceeds (with showing the prompts except for assigned perms)
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         securityAttributes = new SecurityAttributes();
@@ -354,7 +354,7 @@
         // update from trusted to untrusted fails
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwA0wDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX0RldmljZV9NYW51ZmFjdHVyZXIwHhcNMDgwNjEyMDYxOTU3WhcNMTgwNjEwMDYxOTU3WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfRGV2aWNlX01hbnVmYWN0dXJlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApi3ipIPj8O33/rZre1euh7Itd9d6ZVf2mvQ/tLpHEsFJe5XLOsVViMvFskhhKUzmDsRbP4J03L6827/vEDIi/1i8kJGLaoFqJYaLGFWI2Zmxlj6aJV8cfZyOjmQPWJn1IDEe1ZAWbvMSp8xibWRsCLNEGKIkxQvAr/QDK/6iS+kCAwEAATANBgkqhkiG9w0BAQQFAAOBgQCDXt6klAs6yKvdTab3D2wkdoi3Lu4YFsMgLexJOu5HhAUJ/9VYO+Q2+mjd95MRsTa5rWQ2Jjvhn57Z3z/KBOwfHbymmNtMk6Gl14H0vQRoHa31jh3mTuAy5KotDVthaDp30aOizk473NU68wY1WdP4gFk5ZhrpNea9q3st13BxIQ=="));
@@ -372,7 +372,7 @@
         authenticationModule.addSecurityData(session, appUID, null);
         storage.removeAuthenticationStorageData(appUID2);
         permissionGranter.removeSecurityData(session,appUID2);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         securityAttributes = new SecurityAttributes();
@@ -391,7 +391,7 @@
         // update from untrusted to trusted fails for MIDP3 MIDlets
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
         securityAttributes = new SecurityAttributes();
@@ -408,7 +408,7 @@
         permissionGranter.addSecurityData(session, appUID, null);
         storage.removeAuthenticationStorageData(appUID2);
         permissionGranter.removeSecurityData(session,appUID2);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwA0wDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX0RldmljZV9NYW51ZmFjdHVyZXIwHhcNMDgwNjEyMDYxOTU3WhcNMTgwNjEwMDYxOTU3WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfRGV2aWNlX01hbnVmYWN0dXJlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApi3ipIPj8O33/rZre1euh7Itd9d6ZVf2mvQ/tLpHEsFJe5XLOsVViMvFskhhKUzmDsRbP4J03L6827/vEDIi/1i8kJGLaoFqJYaLGFWI2Zmxlj6aJV8cfZyOjmQPWJn1IDEe1ZAWbvMSp8xibWRsCLNEGKIkxQvAr/QDK/6iS+kCAwEAATANBgkqhkiG9w0BAQQFAAOBgQCDXt6klAs6yKvdTab3D2wkdoi3Lu4YFsMgLexJOu5HhAUJ/9VYO+Q2+mjd95MRsTa5rWQ2Jjvhn57Z3z/KBOwfHbymmNtMk6Gl14H0vQRoHa31jh3mTuAy5KotDVthaDp30aOizk473NU68wY1WdP4gFk5ZhrpNea9q3st13BxIQ=="));
@@ -431,7 +431,7 @@
         // update from untrusted to trusted succeeds for MIDP2 MIDlets
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         securityAttributes = new SecurityAttributes();
@@ -448,7 +448,7 @@
         permissionGranter.addSecurityData(session, appUID, null);
         storage.removeAuthenticationStorageData(appUID2);
         permissionGranter.removeSecurityData(session,appUID2);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwA0wDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX0RldmljZV9NYW51ZmFjdHVyZXIwHhcNMDgwNjEyMDYxOTU3WhcNMTgwNjEwMDYxOTU3WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfRGV2aWNlX01hbnVmYWN0dXJlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApi3ipIPj8O33/rZre1euh7Itd9d6ZVf2mvQ/tLpHEsFJe5XLOsVViMvFskhhKUzmDsRbP4J03L6827/vEDIi/1i8kJGLaoFqJYaLGFWI2Zmxlj6aJV8cfZyOjmQPWJn1IDEe1ZAWbvMSp8xibWRsCLNEGKIkxQvAr/QDK/6iS+kCAwEAATANBgkqhkiG9w0BAQQFAAOBgQCDXt6klAs6yKvdTab3D2wkdoi3Lu4YFsMgLexJOu5HhAUJ/9VYO+Q2+mjd95MRsTa5rWQ2Jjvhn57Z3z/KBOwfHbymmNtMk6Gl14H0vQRoHa31jh3mTuAy5KotDVthaDp30aOizk473NU68wY1WdP4gFk5ZhrpNea9q3st13BxIQ=="));
@@ -461,7 +461,7 @@
         // update from untrusted to untrusted succeeds
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         securityAttributes = new SecurityAttributes();
@@ -478,7 +478,7 @@
         permissionGranter.addSecurityData(session, appUID, null);
         storage.removeAuthenticationStorageData(appUID2);
         permissionGranter.removeSecurityData(session,appUID2);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         appPackageEntry = new StorageEntry();
         appPackageEntry.addAttribute(new StorageAttribute(
                                          StorageAttribute.ID,
@@ -502,7 +502,7 @@
         // update from manufacturer to operator succeeds for legacy suites
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwA0wDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX0RldmljZV9NYW51ZmFjdHVyZXIwHhcNMDgwNjEyMDYxOTU3WhcNMTgwNjEwMDYxOTU3WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfRGV2aWNlX01hbnVmYWN0dXJlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApi3ipIPj8O33/rZre1euh7Itd9d6ZVf2mvQ/tLpHEsFJe5XLOsVViMvFskhhKUzmDsRbP4J03L6827/vEDIi/1i8kJGLaoFqJYaLGFWI2Zmxlj6aJV8cfZyOjmQPWJn1IDEe1ZAWbvMSp8xibWRsCLNEGKIkxQvAr/QDK/6iS+kCAwEAATANBgkqhkiG9w0BAQQFAAOBgQCDXt6klAs6yKvdTab3D2wkdoi3Lu4YFsMgLexJOu5HhAUJ/9VYO+Q2+mjd95MRsTa5rWQ2Jjvhn57Z3z/KBOwfHbymmNtMk6Gl14H0vQRoHa31jh3mTuAy5KotDVthaDp30aOizk473NU68wY1WdP4gFk5ZhrpNea9q3st13BxIQ=="));
@@ -520,7 +520,7 @@
         authenticationModule.addSecurityData(session, appUID, null);
         storage.removeAuthenticationStorageData(appUID2);
         permissionGranter.removeSecurityData(session,appUID2);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICUDCCAbkCBEhQwIgwDQYJKoZIhvcNAQEEBQAwbzELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExGzAZBgNVBAMMEkpQX09wZXJhdG9yX0RvbWFpbjAeFw0wODA2MTIwNjIyMDBaFw0xODA2MTAwNjIyMDBaMG8xCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMRswGQYDVQQDDBJKUF9PcGVyYXRvcl9Eb21haW4wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOrj7mg2cR2J0QKpdpOgEwSLoXnYed/fMS9JCYkcLuG0yfsZCYBMkfp+kiGhLi2RHrx2urKMBNDjlSbIlVxO8k/6wo48FSFiplRJoXRhi3hdGqA4SlommIRfPdpwInc6pC033BR9qEQZ6ZD/Mfxt9nIlwPT3jsjoh5s0QHUf+C3TAgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAEHBGtEXorJ2meJm/lNwCw1NksPrFlCmlxnemBc5Whd+tv4e82A2ZoLQ0HiZVIhk6aV/2RyZkYRD/yhaJHmWadHXqxgScD9v0o1kVWzxTtUwE8YRaQw3X+FgYs3P+eiaI47JYswv+LnsCa+Z0IqbGHB8bdN6cspqiQxAZcc/ugRY="));
@@ -533,7 +533,7 @@
         // update from identified third party to identified third party but with different organization for signing certificate succeeds for legacy MIDlets
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICyjCCAjOgAwIBAgIJAJ3QIjIE4oVvMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDIwNTExMDYxNVoXDTE1MDIwNDExMDYxNVowVzELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk15IENvbW1vbiBOYW1lMR0wGwYDVQQKExRNeSBPcmdhbml6YXRpb24gTmFtZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM92j3+xb30PW1+/yHtSys24JPKJ0FxJp2K2vCtLnFh7HZnFQLnwNKKBZinU67qOTW4bdYdKxFt8FfYbX6Yx0Em9A8UYuyPGyzY8zmji5THyWu4bqjnAsNjwCwCAR+qgIp6bvQ9NYy+24GlLWnMagCwfIQXAhElQVzw35E/sIMTTVBMS1+syYAmgBn+wjR+OogYNPn8OGueIr+hwrMcCgWbcMPrByGBVJ8dU6/+zn4CXxg12O1u3RDoMmGjq+2iVUrfPks3ucUJ7A/9n+OwfpAwMMHCzpelvSSmrvM50GSiE/WnWYv2CUndjhOcShy9mu0wsz6I/On6tdUoXI9r05jUCAwEAATANBgkqhkiG9w0BAQUFAAOBgQAx+t+Z+tAqGVZGxyXJ956OqqHKkCMvCC79S/BYFPCayfIfEwB8BbrQlNpZrTdpuAnJ0kQAqI/FHJ/hfyzU9llLwMA1Jr2CjeY828ehR0nprQ/C3GJwDW2HWGKTmTarRFf1a1ehiP0fQN4Wvemv+2ntjBNMFmXV+3S4usooDcWMiQ=="));
@@ -566,7 +566,7 @@
         session.write(StorageNames.APPLICATION_PACKAGE_ATTRIBUTES_TABLE, appPackageEntry);
         storage.removeAuthenticationStorageData(appUID2);
         permissionGranter.removeSecurityData(session,appUID2);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIIC0DCCAjmgAwIBAgIJAI9pBHmi/8HTMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDIwNTExMTcxM1oXDTE1MDIwNDExMTcxM1owXTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk15IENvbW1vbiBOYW1lMSMwIQYDVQQKExpNeSBPdGhlciBPcmdhbml6YXRpb24gTmFtZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOxmRgiapQXW0j52cXwnGCMEk6Wsr/2iF6Ao0qlesxrFvPJB4eUgZ5/wNknwjyw0baTJgg/lYG4kT3wce7g8HU1CwnVxpmVNtQe0kuF8uP55LoqH24b4azy+WTnWXSfh0XGO2Z3yVWTmljzEvppLL95k7krqfn0UlwdWYCHZHVBSWILcRoIFu7uSaeJswhte4wnnhPh5+xEWnPZhCVbY6TI4kNhV7vje7Ugg6/LSSiHZ5NZYOhb/0M8noI5x5WWhMgJBw8UAGb0F1x9AqF4oZiTK9Qp01lDL37e4kV04TJg1QpvP5cMJNQWZWv9JW/OZbC+P9R6brIwX7lOXiPfZ8KUCAwEAATANBgkqhkiG9w0BAQUFAAOBgQA5pPk5+bkvQzldNfmedKLPdnInn4294t8QwAXfxvLI7+g7UqLO08c+iWI/IJdta2oE7tSUPqvVRuz37wnLCnWsOfmV3NliQsM7KcvrVXIN5onkyLUAQluake7HXq5Pu1U6y/3ggWxWalfnK1lKCKCfRGOt2qax13kWAKPSVJYHHg=="));
@@ -588,7 +588,7 @@
         // update from identified third party to identified third party but with different organization for signing certificate fails for MIDP3 MIDlets
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICyjCCAjOgAwIBAgIJAJ3QIjIE4oVvMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDIwNTExMDYxNVoXDTE1MDIwNDExMDYxNVowVzELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk15IENvbW1vbiBOYW1lMR0wGwYDVQQKExRNeSBPcmdhbml6YXRpb24gTmFtZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM92j3+xb30PW1+/yHtSys24JPKJ0FxJp2K2vCtLnFh7HZnFQLnwNKKBZinU67qOTW4bdYdKxFt8FfYbX6Yx0Em9A8UYuyPGyzY8zmji5THyWu4bqjnAsNjwCwCAR+qgIp6bvQ9NYy+24GlLWnMagCwfIQXAhElQVzw35E/sIMTTVBMS1+syYAmgBn+wjR+OogYNPn8OGueIr+hwrMcCgWbcMPrByGBVJ8dU6/+zn4CXxg12O1u3RDoMmGjq+2iVUrfPks3ucUJ7A/9n+OwfpAwMMHCzpelvSSmrvM50GSiE/WnWYv2CUndjhOcShy9mu0wsz6I/On6tdUoXI9r05jUCAwEAATANBgkqhkiG9w0BAQUFAAOBgQAx+t+Z+tAqGVZGxyXJ956OqqHKkCMvCC79S/BYFPCayfIfEwB8BbrQlNpZrTdpuAnJ0kQAqI/FHJ/hfyzU9llLwMA1Jr2CjeY828ehR0nprQ/C3GJwDW2HWGKTmTarRFf1a1ehiP0fQN4Wvemv+2ntjBNMFmXV+3S4usooDcWMiQ=="));
@@ -615,7 +615,7 @@
         session.write(StorageNames.APPLICATION_PACKAGE_ATTRIBUTES_TABLE, appPackageEntry);
         storage.removeAuthenticationStorageData(appUID2);
         permissionGranter.removeSecurityData(session,appUID2);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIIC0DCCAjmgAwIBAgIJAI9pBHmi/8HTMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDIwNTExMTcxM1oXDTE1MDIwNDExMTcxM1owXTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk15IENvbW1vbiBOYW1lMSMwIQYDVQQKExpNeSBPdGhlciBPcmdhbml6YXRpb24gTmFtZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOxmRgiapQXW0j52cXwnGCMEk6Wsr/2iF6Ao0qlesxrFvPJB4eUgZ5/wNknwjyw0baTJgg/lYG4kT3wce7g8HU1CwnVxpmVNtQe0kuF8uP55LoqH24b4azy+WTnWXSfh0XGO2Z3yVWTmljzEvppLL95k7krqfn0UlwdWYCHZHVBSWILcRoIFu7uSaeJswhte4wnnhPh5+xEWnPZhCVbY6TI4kNhV7vje7Ugg6/LSSiHZ5NZYOhb/0M8noI5x5WWhMgJBw8UAGb0F1x9AqF4oZiTK9Qp01lDL37e4kV04TJg1QpvP5cMJNQWZWv9JW/OZbC+P9R6brIwX7lOXiPfZ8KUCAwEAATANBgkqhkiG9w0BAQUFAAOBgQA5pPk5+bkvQzldNfmedKLPdnInn4294t8QwAXfxvLI7+g7UqLO08c+iWI/IJdta2oE7tSUPqvVRuz37wnLCnWsOfmV3NliQsM7KcvrVXIN5onkyLUAQluake7HXq5Pu1U6y/3ggWxWalfnK1lKCKCfRGOt2qax13kWAKPSVJYHHg=="));
@@ -636,7 +636,7 @@
         // update from identified third party to identified third party with same signer succeeds
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwOgwDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX1RoaXJkX1BhcnR5X1RydXN0ZWQwHhcNMDgwNjEyMDYyMzM2WhcNMTgwNjEwMDYyMzM2WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfVGhpcmRfUGFydHlfVHJ1c3RlZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArAesh03rswICRUjexWMoIH9ZZqUtlx+tfhZhuzuYhiL6cLdhxNlU8yuIdw4f17XP3yxVIB8rz1EEagCMd0Y5ZleNFZ992ReLcf9VH13RxaZ88PRxBLLROm1jcwTknYSS6AxGMup77DMwwFSN8XPnOHWt4aLGUrecMeUyI2c5UbsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAylJ+3aSq6a7AAL7UM8V8JhGZlLneErF7A/BJGDi7Vmr5gmlGyf6RCJJIg4qCp+J3Tv3eCRNNuphQaSRdFpaulwCmtfCzSZNtvZg0VhMOVsZqTwQgmP6NzKoIbqqzlgm5U+yUJw8FmX17vgdeSEdJ/oL/WT4AKrWFJYl8MdQ9ZnQ=="));
@@ -669,7 +669,7 @@
         session.write(StorageNames.APPLICATION_PACKAGE_ATTRIBUTES_TABLE, appPackageEntry);
         storage.removeAuthenticationStorageData(appUID2);
         permissionGranter.removeSecurityData(session,appUID2);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwOgwDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX1RoaXJkX1BhcnR5X1RydXN0ZWQwHhcNMDgwNjEyMDYyMzM2WhcNMTgwNjEwMDYyMzM2WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfVGhpcmRfUGFydHlfVHJ1c3RlZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArAesh03rswICRUjexWMoIH9ZZqUtlx+tfhZhuzuYhiL6cLdhxNlU8yuIdw4f17XP3yxVIB8rz1EEagCMd0Y5ZleNFZ992ReLcf9VH13RxaZ88PRxBLLROm1jcwTknYSS6AxGMup77DMwwFSN8XPnOHWt4aLGUrecMeUyI2c5UbsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAylJ+3aSq6a7AAL7UM8V8JhGZlLneErF7A/BJGDi7Vmr5gmlGyf6RCJJIg4qCp+J3Tv3eCRNNuphQaSRdFpaulwCmtfCzSZNtvZg0VhMOVsZqTwQgmP6NzKoIbqqzlgm5U+yUJw8FmX17vgdeSEdJ/oL/WT4AKrWFJYl8MdQ9ZnQ=="));
@@ -691,7 +691,7 @@
         // update from identified third party to identified third party succeeds (V1 requests P1 (Net), P2 (Messaging), P3 (Messaging), V2 requests P2 (Messaging), P4 (UserData), P5 (Net)) -> check that P1 is removed, P2 is retained (with old settings), P3 is removed, P4 and P5 are added with brand new settings
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwOgwDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX1RoaXJkX1BhcnR5X1RydXN0ZWQwHhcNMDgwNjEyMDYyMzM2WhcNMTgwNjEwMDYyMzM2WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfVGhpcmRfUGFydHlfVHJ1c3RlZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArAesh03rswICRUjexWMoIH9ZZqUtlx+tfhZhuzuYhiL6cLdhxNlU8yuIdw4f17XP3yxVIB8rz1EEagCMd0Y5ZleNFZ992ReLcf9VH13RxaZ88PRxBLLROm1jcwTknYSS6AxGMup77DMwwFSN8XPnOHWt4aLGUrecMeUyI2c5UbsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAylJ+3aSq6a7AAL7UM8V8JhGZlLneErF7A/BJGDi7Vmr5gmlGyf6RCJJIg4qCp+J3Tv3eCRNNuphQaSRdFpaulwCmtfCzSZNtvZg0VhMOVsZqTwQgmP6NzKoIbqqzlgm5U+yUJw8FmX17vgdeSEdJ/oL/WT4AKrWFJYl8MdQ9ZnQ=="));
@@ -724,7 +724,7 @@
         session.write(StorageNames.APPLICATION_PACKAGE_ATTRIBUTES_TABLE, appPackageEntry);
         // change the settings of Messaging
         storage.writeUserSecuritySettings(appUID, "Messaging", UserSecuritySettings.BLANKET_INTERACTION_MODE);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwOgwDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX1RoaXJkX1BhcnR5X1RydXN0ZWQwHhcNMDgwNjEyMDYyMzM2WhcNMTgwNjEwMDYyMzM2WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfVGhpcmRfUGFydHlfVHJ1c3RlZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArAesh03rswICRUjexWMoIH9ZZqUtlx+tfhZhuzuYhiL6cLdhxNlU8yuIdw4f17XP3yxVIB8rz1EEagCMd0Y5ZleNFZ992ReLcf9VH13RxaZ88PRxBLLROm1jcwTknYSS6AxGMup77DMwwFSN8XPnOHWt4aLGUrecMeUyI2c5UbsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAylJ+3aSq6a7AAL7UM8V8JhGZlLneErF7A/BJGDi7Vmr5gmlGyf6RCJJIg4qCp+J3Tv3eCRNNuphQaSRdFpaulwCmtfCzSZNtvZg0VhMOVsZqTwQgmP6NzKoIbqqzlgm5U+yUJw8FmX17vgdeSEdJ/oL/WT4AKrWFJYl8MdQ9ZnQ=="));
@@ -795,12 +795,26 @@
                                                                                                                          UserSecuritySettings.NO_INTERACTION_MODE,
                                                                                                                          UserSecuritySettings.ONESHOT_INTERACTION_MODE,
                                                                                                                          UserSecuritySettings.SESSION_INTERACTION_MODE})),
+                                                    new PolicyBasedPermissionImpl(p4.getName(), "mobinfo.spn", "read",
+                                                                                  new UserSecuritySettingsImpl("Read User Data Access",
+                                                                                                               UserSecuritySettings.SESSION_INTERACTION_MODE,
+                                                                                                               new int[]{UserSecuritySettings.BLANKET_INTERACTION_MODE,
+                                                                                                                         UserSecuritySettings.NO_INTERACTION_MODE,
+                                                                                                                         UserSecuritySettings.ONESHOT_INTERACTION_MODE,
+                                                                                                                         UserSecuritySettings.SESSION_INTERACTION_MODE})),
+                                                    new PolicyBasedPermissionImpl(p4.getName(), "mobinfo.ons", "read",
+                                                                                  new UserSecuritySettingsImpl("Read User Data Access",
+                                                                                                               UserSecuritySettings.SESSION_INTERACTION_MODE,
+                                                                                                               new int[]{UserSecuritySettings.BLANKET_INTERACTION_MODE,
+                                                                                                                         UserSecuritySettings.NO_INTERACTION_MODE,
+                                                                                                                         UserSecuritySettings.ONESHOT_INTERACTION_MODE,
+                                                                                                                         UserSecuritySettings.SESSION_INTERACTION_MODE})),
                                                     new PolicyBasedPermissionImpl("com.nokia.ext2.internal.Ext2Perm", "ext2.target4", "ext2.action4", null),
                                                 }));
         // getBlanketPermissions: while installing V1 the permissions are not put to blanket, while installing V2 there are some blanket permissions returned
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwOgwDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX1RoaXJkX1BhcnR5X1RydXN0ZWQwHhcNMDgwNjEyMDYyMzM2WhcNMTgwNjEwMDYyMzM2WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfVGhpcmRfUGFydHlfVHJ1c3RlZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArAesh03rswICRUjexWMoIH9ZZqUtlx+tfhZhuzuYhiL6cLdhxNlU8yuIdw4f17XP3yxVIB8rz1EEagCMd0Y5ZleNFZ992ReLcf9VH13RxaZ88PRxBLLROm1jcwTknYSS6AxGMup77DMwwFSN8XPnOHWt4aLGUrecMeUyI2c5UbsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAylJ+3aSq6a7AAL7UM8V8JhGZlLneErF7A/BJGDi7Vmr5gmlGyf6RCJJIg4qCp+J3Tv3eCRNNuphQaSRdFpaulwCmtfCzSZNtvZg0VhMOVsZqTwQgmP6NzKoIbqqzlgm5U+yUJw8FmX17vgdeSEdJ/oL/WT4AKrWFJYl8MdQ9ZnQ=="));
@@ -836,7 +850,7 @@
                                          "MIICWDCCAcECBEhQwOgwDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX1RoaXJkX1BhcnR5X1RydXN0ZWQwHhcNMDgwNjEyMDYyMzM2WhcNMTgwNjEwMDYyMzM2WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfVGhpcmRfUGFydHlfVHJ1c3RlZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArAesh03rswICRUjexWMoIH9ZZqUtlx+tfhZhuzuYhiL6cLdhxNlU8yuIdw4f17XP3yxVIB8rz1EEagCMd0Y5ZleNFZ992ReLcf9VH13RxaZ88PRxBLLROm1jcwTknYSS6AxGMup77DMwwFSN8XPnOHWt4aLGUrecMeUyI2c5UbsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAylJ+3aSq6a7AAL7UM8V8JhGZlLneErF7A/BJGDi7Vmr5gmlGyf6RCJJIg4qCp+J3Tv3eCRNNuphQaSRdFpaulwCmtfCzSZNtvZg0VhMOVsZqTwQgmP6NzKoIbqqzlgm5U+yUJw8FmX17vgdeSEdJ/oL/WT4AKrWFJYl8MdQ9ZnQ=="));
         session.write(StorageNames.APPLICATION_PACKAGE_ATTRIBUTES_TABLE, appPackageEntry);
         permissionGranter.cleanup();
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwOgwDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX1RoaXJkX1BhcnR5X1RydXN0ZWQwHhcNMDgwNjEyMDYyMzM2WhcNMTgwNjEwMDYyMzM2WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfVGhpcmRfUGFydHlfVHJ1c3RlZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArAesh03rswICRUjexWMoIH9ZZqUtlx+tfhZhuzuYhiL6cLdhxNlU8yuIdw4f17XP3yxVIB8rz1EEagCMd0Y5ZleNFZ992ReLcf9VH13RxaZ88PRxBLLROm1jcwTknYSS6AxGMup77DMwwFSN8XPnOHWt4aLGUrecMeUyI2c5UbsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAylJ+3aSq6a7AAL7UM8V8JhGZlLneErF7A/BJGDi7Vmr5gmlGyf6RCJJIg4qCp+J3Tv3eCRNNuphQaSRdFpaulwCmtfCzSZNtvZg0VhMOVsZqTwQgmP6NzKoIbqqzlgm5U+yUJw8FmX17vgdeSEdJ/oL/WT4AKrWFJYl8MdQ9ZnQ=="));
@@ -863,7 +877,7 @@
         // getBlanketPermissions: while installing V1 the permissions are put to blanket, while installing V2  -> only the permissions which ould be put to Blanket are returned
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwOgwDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX1RoaXJkX1BhcnR5X1RydXN0ZWQwHhcNMDgwNjEyMDYyMzM2WhcNMTgwNjEwMDYyMzM2WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfVGhpcmRfUGFydHlfVHJ1c3RlZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArAesh03rswICRUjexWMoIH9ZZqUtlx+tfhZhuzuYhiL6cLdhxNlU8yuIdw4f17XP3yxVIB8rz1EEagCMd0Y5ZleNFZ992ReLcf9VH13RxaZ88PRxBLLROm1jcwTknYSS6AxGMup77DMwwFSN8XPnOHWt4aLGUrecMeUyI2c5UbsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAylJ+3aSq6a7AAL7UM8V8JhGZlLneErF7A/BJGDi7Vmr5gmlGyf6RCJJIg4qCp+J3Tv3eCRNNuphQaSRdFpaulwCmtfCzSZNtvZg0VhMOVsZqTwQgmP6NzKoIbqqzlgm5U+yUJw8FmX17vgdeSEdJ/oL/WT4AKrWFJYl8MdQ9ZnQ=="));
@@ -1113,7 +1127,7 @@
         boolean success2 = false;
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         authenticationModule.cleanup();
         StorageEntry appPackageEntry = new StorageEntry();
         appPackageEntry.addAttribute(new StorageAttribute(
@@ -1169,7 +1183,7 @@
         domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID);
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         assertWithTrace(domainCategory.equals(domain2.getCategory()));
     }
 
--- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authentication/InteractiveAuthenticationModuleTests.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authentication/InteractiveAuthenticationModuleTests.java	Mon Oct 04 11:29:25 2010 +0300
@@ -238,8 +238,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICgTCCAeqgAwIBAgIJAIROWRW4DjXyMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDc1M1oXDTEwMDUyODA4NDc1M1owgZExCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRcwFQYDVQQDEw5PQ1NQIEdPT0QgQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHoWvDNxIjGzm2J9OmYJtVrUPZJoIXzFVAXpSztxUcsxq18K1y/wsQcxyrjMD4C6eMkxygaDun0sZSHV8MDvt36A9gjoshhRWsV+yXrM3I3XjAFKP/fLrS4nnNJM9OEOpld7kjA+xgV51/Yn3kJyFKQjqbv/WZon7rozt82MspKQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADMn5WNp0pA7Z/4GRGIk2JMShEvtuHDnYvFg0xWk90rEQoAB6XsMe8IL8e7le9sPvppjiuyImjFTK6bOQYhGAVmjHDlkxlxf5SfRmhRilOl5ZHJKeGIeI696orXiqPiuL6ltb+W9hc0ymu2yZGew1Ptt9+tlYZRT0DuM7zqW3hip"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "s3Z/MqNA0EXP8le8s5806RbzyNfLgD3DqX+0Tr2LjTJIa5ent1QcP1sqWrJm4XieprCGv3ja7upiVp/rfDYiS7kcXQwVxZy5nxCV0MfpT+wlf42vwE3cd6rbfoAyTH3ErSeQK6VoIyYwoaFIzOZKCIwkplc6+etacxLpCZn26to="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICuTCCAiKgAwIBAgIJAKdHK8lkGvSqMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3Mzk0M1oXDTE1MDkxOTA3Mzk0M1owRjELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk9DU1AgR09PRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRHWZYToWVP8is/TWKzRQaRc0SmPNOKdFqkjJYF2NjPmz/EABJLKps4m2BZzN2kMIBRkTuirLKjnsdSelI8itekzZBJJMPgtBvsXn+wa3fPaHa3Lqhp9oa8rr/DaCCnp/B4Id/x6HV53uA8e4qs3PeDnagvomBCQsVApWpL1tcnIow1vMEHIA5uqTOVhCKgwXnnoWfl7AWmh6Tu+SbMYALj8fGzvDhPmxIhVte9NaF462Cxf0B6EuCEEdh0xEWw4qLakWpH9QlwZnshfYFaoSYLqLp83E84Md8SkcraLZed8nDS93Gh++rEjgQSldzkf0MIvZyrmKwf+vgNU+WpvzJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEACgN//8SRGqi50c5gmqZdH0YVC7ABUpBNMP1mP9z3+qadtHOOqIKn3q34rvKzyiZEndufZAt3vUQ1s+wlaJKQTUgAm7G8K8cYYCkexJoQVdfVTyJn2ZKTOkCdfoY9k/uxu3DmHhHteU7j0mmp1LVXrvrSGLtXmpzy+kHvVeH/UMw="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "NL+t9rmzVP7MFfYomU0pb/daz27COxIJ4qMxToYs4oHOn8hk4vwvdm//ORJZnLmk84gfnJRufassInIkwCszsxVoPx47jTi+tqSxFF398kT8MJdFNhr/F1CDQR6vPwMdW5CsRefPGBpr2IaL8oZRfzBDgEZL0bu8PPOOrFZCJbw69SACucYvsReQ1vHJf9XPu4eGEkIZHd9If2Bj/G8rxqUGzQ/ltVhUhhLj8rqrDghRF3+UeB1UPcCd6slKHQ+EyxKU/o2iuMe3B5rmcjDaoj52KsB+gk0puizvEgKn3F15a430u4/feKpqszDvFCWd8qxbWwBDDbLC92P2rc3T8g=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -262,8 +262,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIIChDCCAe2gAwIBAgIJAN1kvjmXKegVMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDkwOVoXDTEwMDUyODA4NDkwOVowgZQxCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRowGAYDVQQDExFPQ1NQIFVOS05PV04gQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIbnFJT2y3ID0lwBix+gGbByuocroHp3preSrSmGG5OC/rZLnp21wdyjMuvo1Ga5WSfzDY6YNaSIlKKxrjYLBW+HJUJaQ0A3w3T38xCAwULEiU8e/hcK3mawlL/llNGqVnRIbpu2cuSD+ICTt7oqVvlo/TQyflRGeWT2WQ3ZBTgwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABXIPy6FpATzxN2A8Sb8rEowoTDXNK1O4DMQ26Ri+otWDt1iThirqTl3RcuLi6PzkyXElc1VXTYKiUu3MFy5Wq5qCt6Fwntbcwx21MgnuceNqMdksMRDF1YVmZHhIb1ee/MzkuR8y8iSn+xALH+YfKO3faBwVQ9ly1ZQAgil/eBd"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "dgTivrr4heaBCvnX7aCcAgO0T5reljSYhuX95Rh7+SeDKNQCYqn6q860daWxCP/tk+QceBaGK1ISghzSf1PIPuKPiKhA0ia+dFLYJUjkxYJRZc8XJSRczBaF7eks3rVh5TTQGwzIG0C3w1p4OpSL+pBSO+pMrogWBgq9IL2Pe5c="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICvDCCAiWgAwIBAgIJAKrSZo9qYhM/MA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTMzNVoXDTE1MDkxOTA3NTMzNVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgVU5LTk9XTiBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCaZ4VDJjntiOeNKbRd8BIkEjW/Z6k/fLzbiM5hQL/xHQC1PM1spLgnr4pf7Nf+F/bJbDq2eE1jDar6wmtJPcXFFkChl1eS5yJAyY/bhswyzbqNwTcwo1Lu64TSfC4gTdthEmUPNEhzxMcdCj6myrv8hNyhv6dhkcHvZgBwFgS4Pf1DXRmr/PPjCZxyMaoLoKzjezBXVgTC9rViN7moL715HrpO1jkIB2LRY93fzBmPa1leNdiqUqachFtkzYQuuO1MLlmHXKlNmNLOGqlreB/58q5PTPbIGOIzNiN+n0RYMkVSBVImLBQeepO2ICi/DSFW0yi70LpZvebx736P0yF1AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAGBzUyF4Cb/DN4lWY5yxd1/EI/6osAHySIgMEu5ClzyIqULc3QIvjhLrbLV/JKsVYT3h/gFZxwxoTGWdE1dApWj+Hja23TlLmo0uDDL/L3NOB/n041/gI2MQYw1Z9ME2sFzzWIli1P02JciykUQba/b0fRjPsY3ctzDS7QU2EFFs="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "UknTEEInZKDV9RCXnhv8W9KrXYppmRCUL/kSYXtdiiD3OmiwK0/4Nu0N8ix/Olo/IuWNLyPR+YZt6GLUQhw/AlWGd1mq8odlpiulFdB+e8ClkPvOW+3/KMvBO74ajyD2/PreEzCPYouM8YBqdpb49+TffnNQmEdaIpZ659ODppSNzMPmFpCcO6J2SoaU+KOp9uYdNab+JQfkGwrhF4F3FPYsQdPJAgS8Wt//khjQzAGFyOFIWmZ1ZwTbLxyf2QMHPrvtDWWH6h9qaR+2O9A90tF0PM2VUjznEOvBNigKwYTqBAW2j5oF6ZOQ4zyujqpQsm0pF6aPzaVjtZmfnpaCfA=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -287,8 +287,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIIChDCCAe2gAwIBAgIJAN0+hRIgND0QMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDg0MFoXDTEwMDUyODA4NDg0MFowgZQxCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRowGAYDVQQDExFPQ1NQIFJFVk9LRUQgQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNss9Gx9Wo7LXBEQSCkIpjwNZlOUEBzByeZ1GjwaEblL+RIlXQfq2DtercXxa9gJlryWIze/9vPX1V0wpEO9+M1fDY7Ro6E59kxfZtBnDoEFjITzChZfwqAxLo+EQUpQ2lN8sjyEW0apy73Odqkikwufzlrr9h/utDcSoED0RIMwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAJMYPjz8Q6DHsnUEva3RS2Yyjk0XcY+ldq4GGpOauY1cbZD5A/fmk/TKJahB1uV5XnuYs65vrJUuxAEzGuTzMOnMwJgAncSXFp2AQL4o02ETrp493BhOi825iwbwaHqqx2ijxJ6Jy84t1Rj+mwkwiLsFsJFMxViV0dxjbwLNQzho"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "r1aZCR/spVeK4eDOp1awTbas0muOpDI7y1Bz7l5OipxyZqZI4T8vy+e3q/w263bSchhOWZryPbuE6IuaeThE9qa/daK29oxR5JmmfttrlyGTsEap11NCpTCsK03HS8jwzACOD02m9hOS+EIqIdhNmoBB8ZhWdlNirTHw2UgEk/4="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICvDCCAiWgAwIBAgIJAM/3P7mVjkjRMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTcxMVoXDTE1MDkxOTA3NTcxMVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgUkVWT0tFRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGIt32Ki+UkQYc/rswY4Bho/ygLyqV8UTVob4yH4k9AQTegIkdjw+AqgfU0LcqMdXguok2PS0sdkgEDPqCMawSMsQRQMsFYcab/LL/i7haWULQL33VI8Wt9grgzFZSpeuhFgr3YgWV0iyMHpKwb4ORiJvWhhvseCK+iI4sAOIhmQZ12HLhvBla5KXTyslLUoXA7V0CuRYqkB3SXn/RARk7GHcoVM+PIk6MtPUkHlyZzqXbHeNOAxGhSEbIp6WJTG2Bg/5OmdSg/kJ44ZSKMk0K2djNTgx70s83B+/vOU81Zxo+SUGiaOC/uw9Irh51WlZl8joq3A+gefO+fPSKCJZDAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAnk5fcldVed5INUs3djxRF9BZ1+ZFdgIjclysYB6B2mSvIdnxnT9H66oKnPeyDqbwcWYfdyDwyeBgsLIk4oOF85lWs5ItjKKcViLbZDPi9J3B+Av/qCWkrkWQokJ5Tkyw8K/sBQrNTM5kH1WrapcKsplcv8FgorE7FC57Ozpli48="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "KXg8rbURv+eZ75Cg0+8KPgaxhhrHqyf26nLFweLWKE7rgkX6aHHfmHirpt/LGzFqQt+516bbkVhG7DLJIshb3qoZBlgzKOqjvJoYwMnVw0CaIMoYjcevortyKk8jbeFnrYU34pp8v0pz3NEKzVgnYAdEnTtl88X+TBgcVDteVUOaz2IGB4JtPKWWRhG7kaOJdYXmCRuNeExv1gHqLYNq0Mr6rmECoMpV1ksrTJK7bJeWwOHRgtVo55rb6bI2MmzE5/Eo4LWg9MKjzmHnCbBWKvFyy5RuEZu5XHAzCJlLO52rfh6dJOq5yuPyB+L87bsgehWFyj1ptq+2jESw0KXuHQ=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -312,8 +312,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICgTCCAeqgAwIBAgIJAIROWRW4DjXyMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDc1M1oXDTEwMDUyODA4NDc1M1owgZExCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRcwFQYDVQQDEw5PQ1NQIEdPT0QgQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHoWvDNxIjGzm2J9OmYJtVrUPZJoIXzFVAXpSztxUcsxq18K1y/wsQcxyrjMD4C6eMkxygaDun0sZSHV8MDvt36A9gjoshhRWsV+yXrM3I3XjAFKP/fLrS4nnNJM9OEOpld7kjA+xgV51/Yn3kJyFKQjqbv/WZon7rozt82MspKQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADMn5WNp0pA7Z/4GRGIk2JMShEvtuHDnYvFg0xWk90rEQoAB6XsMe8IL8e7le9sPvppjiuyImjFTK6bOQYhGAVmjHDlkxlxf5SfRmhRilOl5ZHJKeGIeI696orXiqPiuL6ltb+W9hc0ymu2yZGew1Ptt9+tlYZRT0DuM7zqW3hip"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "s3Z/MqNA0EXP8le8s5806RbzyNfLgD3DqX+0Tr2LjTJIa5ent1QcP1sqWrJm4XieprCGv3ja7upiVp/rfDYiS7kcXQwVxZy5nxCV0MfpT+wlf42vwE3cd6rbfoAyTH3ErSeQK6VoIyYwoaFIzOZKCIwkplc6+etacxLpCZn26to="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICuTCCAiKgAwIBAgIJAKdHK8lkGvSqMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3Mzk0M1oXDTE1MDkxOTA3Mzk0M1owRjELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk9DU1AgR09PRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRHWZYToWVP8is/TWKzRQaRc0SmPNOKdFqkjJYF2NjPmz/EABJLKps4m2BZzN2kMIBRkTuirLKjnsdSelI8itekzZBJJMPgtBvsXn+wa3fPaHa3Lqhp9oa8rr/DaCCnp/B4Id/x6HV53uA8e4qs3PeDnagvomBCQsVApWpL1tcnIow1vMEHIA5uqTOVhCKgwXnnoWfl7AWmh6Tu+SbMYALj8fGzvDhPmxIhVte9NaF462Cxf0B6EuCEEdh0xEWw4qLakWpH9QlwZnshfYFaoSYLqLp83E84Md8SkcraLZed8nDS93Gh++rEjgQSldzkf0MIvZyrmKwf+vgNU+WpvzJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEACgN//8SRGqi50c5gmqZdH0YVC7ABUpBNMP1mP9z3+qadtHOOqIKn3q34rvKzyiZEndufZAt3vUQ1s+wlaJKQTUgAm7G8K8cYYCkexJoQVdfVTyJn2ZKTOkCdfoY9k/uxu3DmHhHteU7j0mmp1LVXrvrSGLtXmpzy+kHvVeH/UMw="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "NL+t9rmzVP7MFfYomU0pb/daz27COxIJ4qMxToYs4oHOn8hk4vwvdm//ORJZnLmk84gfnJRufassInIkwCszsxVoPx47jTi+tqSxFF398kT8MJdFNhr/F1CDQR6vPwMdW5CsRefPGBpr2IaL8oZRfzBDgEZL0bu8PPOOrFZCJbw69SACucYvsReQ1vHJf9XPu4eGEkIZHd9If2Bj/G8rxqUGzQ/ltVhUhhLj8rqrDghRF3+UeB1UPcCd6slKHQ+EyxKU/o2iuMe3B5rmcjDaoj52KsB+gk0puizvEgKn3F15a430u4/feKpqszDvFCWd8qxbWwBDDbLC92P2rc3T8g=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -332,8 +332,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIIChDCCAe2gAwIBAgIJAN0+hRIgND0QMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDg0MFoXDTEwMDUyODA4NDg0MFowgZQxCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRowGAYDVQQDExFPQ1NQIFJFVk9LRUQgQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNss9Gx9Wo7LXBEQSCkIpjwNZlOUEBzByeZ1GjwaEblL+RIlXQfq2DtercXxa9gJlryWIze/9vPX1V0wpEO9+M1fDY7Ro6E59kxfZtBnDoEFjITzChZfwqAxLo+EQUpQ2lN8sjyEW0apy73Odqkikwufzlrr9h/utDcSoED0RIMwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAJMYPjz8Q6DHsnUEva3RS2Yyjk0XcY+ldq4GGpOauY1cbZD5A/fmk/TKJahB1uV5XnuYs65vrJUuxAEzGuTzMOnMwJgAncSXFp2AQL4o02ETrp493BhOi825iwbwaHqqx2ijxJ6Jy84t1Rj+mwkwiLsFsJFMxViV0dxjbwLNQzho"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "r1aZCR/spVeK4eDOp1awTbas0muOpDI7y1Bz7l5OipxyZqZI4T8vy+e3q/w263bSchhOWZryPbuE6IuaeThE9qa/daK29oxR5JmmfttrlyGTsEap11NCpTCsK03HS8jwzACOD02m9hOS+EIqIdhNmoBB8ZhWdlNirTHw2UgEk/4="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICvDCCAiWgAwIBAgIJAM/3P7mVjkjRMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTcxMVoXDTE1MDkxOTA3NTcxMVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgUkVWT0tFRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGIt32Ki+UkQYc/rswY4Bho/ygLyqV8UTVob4yH4k9AQTegIkdjw+AqgfU0LcqMdXguok2PS0sdkgEDPqCMawSMsQRQMsFYcab/LL/i7haWULQL33VI8Wt9grgzFZSpeuhFgr3YgWV0iyMHpKwb4ORiJvWhhvseCK+iI4sAOIhmQZ12HLhvBla5KXTyslLUoXA7V0CuRYqkB3SXn/RARk7GHcoVM+PIk6MtPUkHlyZzqXbHeNOAxGhSEbIp6WJTG2Bg/5OmdSg/kJ44ZSKMk0K2djNTgx70s83B+/vOU81Zxo+SUGiaOC/uw9Irh51WlZl8joq3A+gefO+fPSKCJZDAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAnk5fcldVed5INUs3djxRF9BZ1+ZFdgIjclysYB6B2mSvIdnxnT9H66oKnPeyDqbwcWYfdyDwyeBgsLIk4oOF85lWs5ItjKKcViLbZDPi9J3B+Av/qCWkrkWQokJ5Tkyw8K/sBQrNTM5kH1WrapcKsplcv8FgorE7FC57Ozpli48="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "KXg8rbURv+eZ75Cg0+8KPgaxhhrHqyf26nLFweLWKE7rgkX6aHHfmHirpt/LGzFqQt+516bbkVhG7DLJIshb3qoZBlgzKOqjvJoYwMnVw0CaIMoYjcevortyKk8jbeFnrYU34pp8v0pz3NEKzVgnYAdEnTtl88X+TBgcVDteVUOaz2IGB4JtPKWWRhG7kaOJdYXmCRuNeExv1gHqLYNq0Mr6rmECoMpV1ksrTJK7bJeWwOHRgtVo55rb6bI2MmzE5/Eo4LWg9MKjzmHnCbBWKvFyy5RuEZu5XHAzCJlLO52rfh6dJOq5yuPyB+L87bsgehWFyj1ptq+2jESw0KXuHQ=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -357,8 +357,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICgTCCAeqgAwIBAgIJAIROWRW4DjXyMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDc1M1oXDTEwMDUyODA4NDc1M1owgZExCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRcwFQYDVQQDEw5PQ1NQIEdPT0QgQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHoWvDNxIjGzm2J9OmYJtVrUPZJoIXzFVAXpSztxUcsxq18K1y/wsQcxyrjMD4C6eMkxygaDun0sZSHV8MDvt36A9gjoshhRWsV+yXrM3I3XjAFKP/fLrS4nnNJM9OEOpld7kjA+xgV51/Yn3kJyFKQjqbv/WZon7rozt82MspKQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADMn5WNp0pA7Z/4GRGIk2JMShEvtuHDnYvFg0xWk90rEQoAB6XsMe8IL8e7le9sPvppjiuyImjFTK6bOQYhGAVmjHDlkxlxf5SfRmhRilOl5ZHJKeGIeI696orXiqPiuL6ltb+W9hc0ymu2yZGew1Ptt9+tlYZRT0DuM7zqW3hip"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "s3Z/MqNA0EXP8le8s5806RbzyNfLgD3DqX+0Tr2LjTJIa5ent1QcP1sqWrJm4XieprCGv3ja7upiVp/rfDYiS7kcXQwVxZy5nxCV0MfpT+wlf42vwE3cd6rbfoAyTH3ErSeQK6VoIyYwoaFIzOZKCIwkplc6+etacxLpCZn26to="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICuTCCAiKgAwIBAgIJAKdHK8lkGvSqMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3Mzk0M1oXDTE1MDkxOTA3Mzk0M1owRjELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk9DU1AgR09PRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRHWZYToWVP8is/TWKzRQaRc0SmPNOKdFqkjJYF2NjPmz/EABJLKps4m2BZzN2kMIBRkTuirLKjnsdSelI8itekzZBJJMPgtBvsXn+wa3fPaHa3Lqhp9oa8rr/DaCCnp/B4Id/x6HV53uA8e4qs3PeDnagvomBCQsVApWpL1tcnIow1vMEHIA5uqTOVhCKgwXnnoWfl7AWmh6Tu+SbMYALj8fGzvDhPmxIhVte9NaF462Cxf0B6EuCEEdh0xEWw4qLakWpH9QlwZnshfYFaoSYLqLp83E84Md8SkcraLZed8nDS93Gh++rEjgQSldzkf0MIvZyrmKwf+vgNU+WpvzJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEACgN//8SRGqi50c5gmqZdH0YVC7ABUpBNMP1mP9z3+qadtHOOqIKn3q34rvKzyiZEndufZAt3vUQ1s+wlaJKQTUgAm7G8K8cYYCkexJoQVdfVTyJn2ZKTOkCdfoY9k/uxu3DmHhHteU7j0mmp1LVXrvrSGLtXmpzy+kHvVeH/UMw="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "NL+t9rmzVP7MFfYomU0pb/daz27COxIJ4qMxToYs4oHOn8hk4vwvdm//ORJZnLmk84gfnJRufassInIkwCszsxVoPx47jTi+tqSxFF398kT8MJdFNhr/F1CDQR6vPwMdW5CsRefPGBpr2IaL8oZRfzBDgEZL0bu8PPOOrFZCJbw69SACucYvsReQ1vHJf9XPu4eGEkIZHd9If2Bj/G8rxqUGzQ/ltVhUhhLj8rqrDghRF3+UeB1UPcCd6slKHQ+EyxKU/o2iuMe3B5rmcjDaoj52KsB+gk0puizvEgKn3F15a430u4/feKpqszDvFCWd8qxbWwBDDbLC92P2rc3T8g=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -377,8 +377,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIIChDCCAe2gAwIBAgIJAN1kvjmXKegVMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDkwOVoXDTEwMDUyODA4NDkwOVowgZQxCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRowGAYDVQQDExFPQ1NQIFVOS05PV04gQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIbnFJT2y3ID0lwBix+gGbByuocroHp3preSrSmGG5OC/rZLnp21wdyjMuvo1Ga5WSfzDY6YNaSIlKKxrjYLBW+HJUJaQ0A3w3T38xCAwULEiU8e/hcK3mawlL/llNGqVnRIbpu2cuSD+ICTt7oqVvlo/TQyflRGeWT2WQ3ZBTgwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABXIPy6FpATzxN2A8Sb8rEowoTDXNK1O4DMQ26Ri+otWDt1iThirqTl3RcuLi6PzkyXElc1VXTYKiUu3MFy5Wq5qCt6Fwntbcwx21MgnuceNqMdksMRDF1YVmZHhIb1ee/MzkuR8y8iSn+xALH+YfKO3faBwVQ9ly1ZQAgil/eBd"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "dgTivrr4heaBCvnX7aCcAgO0T5reljSYhuX95Rh7+SeDKNQCYqn6q860daWxCP/tk+QceBaGK1ISghzSf1PIPuKPiKhA0ia+dFLYJUjkxYJRZc8XJSRczBaF7eks3rVh5TTQGwzIG0C3w1p4OpSL+pBSO+pMrogWBgq9IL2Pe5c="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICvDCCAiWgAwIBAgIJAKrSZo9qYhM/MA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTMzNVoXDTE1MDkxOTA3NTMzNVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgVU5LTk9XTiBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCaZ4VDJjntiOeNKbRd8BIkEjW/Z6k/fLzbiM5hQL/xHQC1PM1spLgnr4pf7Nf+F/bJbDq2eE1jDar6wmtJPcXFFkChl1eS5yJAyY/bhswyzbqNwTcwo1Lu64TSfC4gTdthEmUPNEhzxMcdCj6myrv8hNyhv6dhkcHvZgBwFgS4Pf1DXRmr/PPjCZxyMaoLoKzjezBXVgTC9rViN7moL715HrpO1jkIB2LRY93fzBmPa1leNdiqUqachFtkzYQuuO1MLlmHXKlNmNLOGqlreB/58q5PTPbIGOIzNiN+n0RYMkVSBVImLBQeepO2ICi/DSFW0yi70LpZvebx736P0yF1AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAGBzUyF4Cb/DN4lWY5yxd1/EI/6osAHySIgMEu5ClzyIqULc3QIvjhLrbLV/JKsVYT3h/gFZxwxoTGWdE1dApWj+Hja23TlLmo0uDDL/L3NOB/n041/gI2MQYw1Z9ME2sFzzWIli1P02JciykUQba/b0fRjPsY3ctzDS7QU2EFFs="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "UknTEEInZKDV9RCXnhv8W9KrXYppmRCUL/kSYXtdiiD3OmiwK0/4Nu0N8ix/Olo/IuWNLyPR+YZt6GLUQhw/AlWGd1mq8odlpiulFdB+e8ClkPvOW+3/KMvBO74ajyD2/PreEzCPYouM8YBqdpb49+TffnNQmEdaIpZ659ODppSNzMPmFpCcO6J2SoaU+KOp9uYdNab+JQfkGwrhF4F3FPYsQdPJAgS8Wt//khjQzAGFyOFIWmZ1ZwTbLxyf2QMHPrvtDWWH6h9qaR+2O9A90tF0PM2VUjznEOvBNigKwYTqBAW2j5oF6ZOQ4zyujqpQsm0pF6aPzaVjtZmfnpaCfA=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -402,8 +402,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIIChDCCAe2gAwIBAgIJAN0+hRIgND0QMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDg0MFoXDTEwMDUyODA4NDg0MFowgZQxCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRowGAYDVQQDExFPQ1NQIFJFVk9LRUQgQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNss9Gx9Wo7LXBEQSCkIpjwNZlOUEBzByeZ1GjwaEblL+RIlXQfq2DtercXxa9gJlryWIze/9vPX1V0wpEO9+M1fDY7Ro6E59kxfZtBnDoEFjITzChZfwqAxLo+EQUpQ2lN8sjyEW0apy73Odqkikwufzlrr9h/utDcSoED0RIMwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAJMYPjz8Q6DHsnUEva3RS2Yyjk0XcY+ldq4GGpOauY1cbZD5A/fmk/TKJahB1uV5XnuYs65vrJUuxAEzGuTzMOnMwJgAncSXFp2AQL4o02ETrp493BhOi825iwbwaHqqx2ijxJ6Jy84t1Rj+mwkwiLsFsJFMxViV0dxjbwLNQzho"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "r1aZCR/spVeK4eDOp1awTbas0muOpDI7y1Bz7l5OipxyZqZI4T8vy+e3q/w263bSchhOWZryPbuE6IuaeThE9qa/daK29oxR5JmmfttrlyGTsEap11NCpTCsK03HS8jwzACOD02m9hOS+EIqIdhNmoBB8ZhWdlNirTHw2UgEk/4="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICvDCCAiWgAwIBAgIJAM/3P7mVjkjRMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTcxMVoXDTE1MDkxOTA3NTcxMVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgUkVWT0tFRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGIt32Ki+UkQYc/rswY4Bho/ygLyqV8UTVob4yH4k9AQTegIkdjw+AqgfU0LcqMdXguok2PS0sdkgEDPqCMawSMsQRQMsFYcab/LL/i7haWULQL33VI8Wt9grgzFZSpeuhFgr3YgWV0iyMHpKwb4ORiJvWhhvseCK+iI4sAOIhmQZ12HLhvBla5KXTyslLUoXA7V0CuRYqkB3SXn/RARk7GHcoVM+PIk6MtPUkHlyZzqXbHeNOAxGhSEbIp6WJTG2Bg/5OmdSg/kJ44ZSKMk0K2djNTgx70s83B+/vOU81Zxo+SUGiaOC/uw9Irh51WlZl8joq3A+gefO+fPSKCJZDAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAnk5fcldVed5INUs3djxRF9BZ1+ZFdgIjclysYB6B2mSvIdnxnT9H66oKnPeyDqbwcWYfdyDwyeBgsLIk4oOF85lWs5ItjKKcViLbZDPi9J3B+Av/qCWkrkWQokJ5Tkyw8K/sBQrNTM5kH1WrapcKsplcv8FgorE7FC57Ozpli48="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "KXg8rbURv+eZ75Cg0+8KPgaxhhrHqyf26nLFweLWKE7rgkX6aHHfmHirpt/LGzFqQt+516bbkVhG7DLJIshb3qoZBlgzKOqjvJoYwMnVw0CaIMoYjcevortyKk8jbeFnrYU34pp8v0pz3NEKzVgnYAdEnTtl88X+TBgcVDteVUOaz2IGB4JtPKWWRhG7kaOJdYXmCRuNeExv1gHqLYNq0Mr6rmECoMpV1ksrTJK7bJeWwOHRgtVo55rb6bI2MmzE5/Eo4LWg9MKjzmHnCbBWKvFyy5RuEZu5XHAzCJlLO52rfh6dJOq5yuPyB+L87bsgehWFyj1ptq+2jESw0KXuHQ=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -427,8 +427,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICgTCCAeqgAwIBAgIJAIROWRW4DjXyMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDc1M1oXDTEwMDUyODA4NDc1M1owgZExCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRcwFQYDVQQDEw5PQ1NQIEdPT0QgQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHoWvDNxIjGzm2J9OmYJtVrUPZJoIXzFVAXpSztxUcsxq18K1y/wsQcxyrjMD4C6eMkxygaDun0sZSHV8MDvt36A9gjoshhRWsV+yXrM3I3XjAFKP/fLrS4nnNJM9OEOpld7kjA+xgV51/Yn3kJyFKQjqbv/WZon7rozt82MspKQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADMn5WNp0pA7Z/4GRGIk2JMShEvtuHDnYvFg0xWk90rEQoAB6XsMe8IL8e7le9sPvppjiuyImjFTK6bOQYhGAVmjHDlkxlxf5SfRmhRilOl5ZHJKeGIeI696orXiqPiuL6ltb+W9hc0ymu2yZGew1Ptt9+tlYZRT0DuM7zqW3hip"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "s3Z/MqNA0EXP8le8s5806RbzyNfLgD3DqX+0Tr2LjTJIa5ent1QcP1sqWrJm4XieprCGv3ja7upiVp/rfDYiS7kcXQwVxZy5nxCV0MfpT+wlf42vwE3cd6rbfoAyTH3ErSeQK6VoIyYwoaFIzOZKCIwkplc6+etacxLpCZn26to="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICuTCCAiKgAwIBAgIJAKdHK8lkGvSqMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3Mzk0M1oXDTE1MDkxOTA3Mzk0M1owRjELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk9DU1AgR09PRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRHWZYToWVP8is/TWKzRQaRc0SmPNOKdFqkjJYF2NjPmz/EABJLKps4m2BZzN2kMIBRkTuirLKjnsdSelI8itekzZBJJMPgtBvsXn+wa3fPaHa3Lqhp9oa8rr/DaCCnp/B4Id/x6HV53uA8e4qs3PeDnagvomBCQsVApWpL1tcnIow1vMEHIA5uqTOVhCKgwXnnoWfl7AWmh6Tu+SbMYALj8fGzvDhPmxIhVte9NaF462Cxf0B6EuCEEdh0xEWw4qLakWpH9QlwZnshfYFaoSYLqLp83E84Md8SkcraLZed8nDS93Gh++rEjgQSldzkf0MIvZyrmKwf+vgNU+WpvzJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEACgN//8SRGqi50c5gmqZdH0YVC7ABUpBNMP1mP9z3+qadtHOOqIKn3q34rvKzyiZEndufZAt3vUQ1s+wlaJKQTUgAm7G8K8cYYCkexJoQVdfVTyJn2ZKTOkCdfoY9k/uxu3DmHhHteU7j0mmp1LVXrvrSGLtXmpzy+kHvVeH/UMw="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "NL+t9rmzVP7MFfYomU0pb/daz27COxIJ4qMxToYs4oHOn8hk4vwvdm//ORJZnLmk84gfnJRufassInIkwCszsxVoPx47jTi+tqSxFF398kT8MJdFNhr/F1CDQR6vPwMdW5CsRefPGBpr2IaL8oZRfzBDgEZL0bu8PPOOrFZCJbw69SACucYvsReQ1vHJf9XPu4eGEkIZHd9If2Bj/G8rxqUGzQ/ltVhUhhLj8rqrDghRF3+UeB1UPcCd6slKHQ+EyxKU/o2iuMe3B5rmcjDaoj52KsB+gk0puizvEgKn3F15a430u4/feKpqszDvFCWd8qxbWwBDDbLC92P2rc3T8g=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -447,8 +447,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIIChDCCAe2gAwIBAgIJAN1kvjmXKegVMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDkwOVoXDTEwMDUyODA4NDkwOVowgZQxCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRowGAYDVQQDExFPQ1NQIFVOS05PV04gQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIbnFJT2y3ID0lwBix+gGbByuocroHp3preSrSmGG5OC/rZLnp21wdyjMuvo1Ga5WSfzDY6YNaSIlKKxrjYLBW+HJUJaQ0A3w3T38xCAwULEiU8e/hcK3mawlL/llNGqVnRIbpu2cuSD+ICTt7oqVvlo/TQyflRGeWT2WQ3ZBTgwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABXIPy6FpATzxN2A8Sb8rEowoTDXNK1O4DMQ26Ri+otWDt1iThirqTl3RcuLi6PzkyXElc1VXTYKiUu3MFy5Wq5qCt6Fwntbcwx21MgnuceNqMdksMRDF1YVmZHhIb1ee/MzkuR8y8iSn+xALH+YfKO3faBwVQ9ly1ZQAgil/eBd"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "dgTivrr4heaBCvnX7aCcAgO0T5reljSYhuX95Rh7+SeDKNQCYqn6q860daWxCP/tk+QceBaGK1ISghzSf1PIPuKPiKhA0ia+dFLYJUjkxYJRZc8XJSRczBaF7eks3rVh5TTQGwzIG0C3w1p4OpSL+pBSO+pMrogWBgq9IL2Pe5c="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICvDCCAiWgAwIBAgIJAKrSZo9qYhM/MA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTMzNVoXDTE1MDkxOTA3NTMzNVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgVU5LTk9XTiBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCaZ4VDJjntiOeNKbRd8BIkEjW/Z6k/fLzbiM5hQL/xHQC1PM1spLgnr4pf7Nf+F/bJbDq2eE1jDar6wmtJPcXFFkChl1eS5yJAyY/bhswyzbqNwTcwo1Lu64TSfC4gTdthEmUPNEhzxMcdCj6myrv8hNyhv6dhkcHvZgBwFgS4Pf1DXRmr/PPjCZxyMaoLoKzjezBXVgTC9rViN7moL715HrpO1jkIB2LRY93fzBmPa1leNdiqUqachFtkzYQuuO1MLlmHXKlNmNLOGqlreB/58q5PTPbIGOIzNiN+n0RYMkVSBVImLBQeepO2ICi/DSFW0yi70LpZvebx736P0yF1AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAGBzUyF4Cb/DN4lWY5yxd1/EI/6osAHySIgMEu5ClzyIqULc3QIvjhLrbLV/JKsVYT3h/gFZxwxoTGWdE1dApWj+Hja23TlLmo0uDDL/L3NOB/n041/gI2MQYw1Z9ME2sFzzWIli1P02JciykUQba/b0fRjPsY3ctzDS7QU2EFFs="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "UknTEEInZKDV9RCXnhv8W9KrXYppmRCUL/kSYXtdiiD3OmiwK0/4Nu0N8ix/Olo/IuWNLyPR+YZt6GLUQhw/AlWGd1mq8odlpiulFdB+e8ClkPvOW+3/KMvBO74ajyD2/PreEzCPYouM8YBqdpb49+TffnNQmEdaIpZ659ODppSNzMPmFpCcO6J2SoaU+KOp9uYdNab+JQfkGwrhF4F3FPYsQdPJAgS8Wt//khjQzAGFyOFIWmZ1ZwTbLxyf2QMHPrvtDWWH6h9qaR+2O9A90tF0PM2VUjznEOvBNigKwYTqBAW2j5oF6ZOQ4zyujqpQsm0pF6aPzaVjtZmfnpaCfA=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -472,8 +472,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIIChDCCAe2gAwIBAgIJAN0+hRIgND0QMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDg0MFoXDTEwMDUyODA4NDg0MFowgZQxCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRowGAYDVQQDExFPQ1NQIFJFVk9LRUQgQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNss9Gx9Wo7LXBEQSCkIpjwNZlOUEBzByeZ1GjwaEblL+RIlXQfq2DtercXxa9gJlryWIze/9vPX1V0wpEO9+M1fDY7Ro6E59kxfZtBnDoEFjITzChZfwqAxLo+EQUpQ2lN8sjyEW0apy73Odqkikwufzlrr9h/utDcSoED0RIMwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAJMYPjz8Q6DHsnUEva3RS2Yyjk0XcY+ldq4GGpOauY1cbZD5A/fmk/TKJahB1uV5XnuYs65vrJUuxAEzGuTzMOnMwJgAncSXFp2AQL4o02ETrp493BhOi825iwbwaHqqx2ijxJ6Jy84t1Rj+mwkwiLsFsJFMxViV0dxjbwLNQzho"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "r1aZCR/spVeK4eDOp1awTbas0muOpDI7y1Bz7l5OipxyZqZI4T8vy+e3q/w263bSchhOWZryPbuE6IuaeThE9qa/daK29oxR5JmmfttrlyGTsEap11NCpTCsK03HS8jwzACOD02m9hOS+EIqIdhNmoBB8ZhWdlNirTHw2UgEk/4="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICvDCCAiWgAwIBAgIJAM/3P7mVjkjRMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTcxMVoXDTE1MDkxOTA3NTcxMVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgUkVWT0tFRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGIt32Ki+UkQYc/rswY4Bho/ygLyqV8UTVob4yH4k9AQTegIkdjw+AqgfU0LcqMdXguok2PS0sdkgEDPqCMawSMsQRQMsFYcab/LL/i7haWULQL33VI8Wt9grgzFZSpeuhFgr3YgWV0iyMHpKwb4ORiJvWhhvseCK+iI4sAOIhmQZ12HLhvBla5KXTyslLUoXA7V0CuRYqkB3SXn/RARk7GHcoVM+PIk6MtPUkHlyZzqXbHeNOAxGhSEbIp6WJTG2Bg/5OmdSg/kJ44ZSKMk0K2djNTgx70s83B+/vOU81Zxo+SUGiaOC/uw9Irh51WlZl8joq3A+gefO+fPSKCJZDAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAnk5fcldVed5INUs3djxRF9BZ1+ZFdgIjclysYB6B2mSvIdnxnT9H66oKnPeyDqbwcWYfdyDwyeBgsLIk4oOF85lWs5ItjKKcViLbZDPi9J3B+Av/qCWkrkWQokJ5Tkyw8K/sBQrNTM5kH1WrapcKsplcv8FgorE7FC57Ozpli48="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "KXg8rbURv+eZ75Cg0+8KPgaxhhrHqyf26nLFweLWKE7rgkX6aHHfmHirpt/LGzFqQt+516bbkVhG7DLJIshb3qoZBlgzKOqjvJoYwMnVw0CaIMoYjcevortyKk8jbeFnrYU34pp8v0pz3NEKzVgnYAdEnTtl88X+TBgcVDteVUOaz2IGB4JtPKWWRhG7kaOJdYXmCRuNeExv1gHqLYNq0Mr6rmECoMpV1ksrTJK7bJeWwOHRgtVo55rb6bI2MmzE5/Eo4LWg9MKjzmHnCbBWKvFyy5RuEZu5XHAzCJlLO52rfh6dJOq5yuPyB+L87bsgehWFyj1ptq+2jESw0KXuHQ=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -497,8 +497,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICgTCCAeqgAwIBAgIJAIROWRW4DjXyMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDc1M1oXDTEwMDUyODA4NDc1M1owgZExCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRcwFQYDVQQDEw5PQ1NQIEdPT0QgQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDHoWvDNxIjGzm2J9OmYJtVrUPZJoIXzFVAXpSztxUcsxq18K1y/wsQcxyrjMD4C6eMkxygaDun0sZSHV8MDvt36A9gjoshhRWsV+yXrM3I3XjAFKP/fLrS4nnNJM9OEOpld7kjA+xgV51/Yn3kJyFKQjqbv/WZon7rozt82MspKQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADMn5WNp0pA7Z/4GRGIk2JMShEvtuHDnYvFg0xWk90rEQoAB6XsMe8IL8e7le9sPvppjiuyImjFTK6bOQYhGAVmjHDlkxlxf5SfRmhRilOl5ZHJKeGIeI696orXiqPiuL6ltb+W9hc0ymu2yZGew1Ptt9+tlYZRT0DuM7zqW3hip"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "s3Z/MqNA0EXP8le8s5806RbzyNfLgD3DqX+0Tr2LjTJIa5ent1QcP1sqWrJm4XieprCGv3ja7upiVp/rfDYiS7kcXQwVxZy5nxCV0MfpT+wlf42vwE3cd6rbfoAyTH3ErSeQK6VoIyYwoaFIzOZKCIwkplc6+etacxLpCZn26to="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICuTCCAiKgAwIBAgIJAKdHK8lkGvSqMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3Mzk0M1oXDTE1MDkxOTA3Mzk0M1owRjELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk9DU1AgR09PRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRHWZYToWVP8is/TWKzRQaRc0SmPNOKdFqkjJYF2NjPmz/EABJLKps4m2BZzN2kMIBRkTuirLKjnsdSelI8itekzZBJJMPgtBvsXn+wa3fPaHa3Lqhp9oa8rr/DaCCnp/B4Id/x6HV53uA8e4qs3PeDnagvomBCQsVApWpL1tcnIow1vMEHIA5uqTOVhCKgwXnnoWfl7AWmh6Tu+SbMYALj8fGzvDhPmxIhVte9NaF462Cxf0B6EuCEEdh0xEWw4qLakWpH9QlwZnshfYFaoSYLqLp83E84Md8SkcraLZed8nDS93Gh++rEjgQSldzkf0MIvZyrmKwf+vgNU+WpvzJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEACgN//8SRGqi50c5gmqZdH0YVC7ABUpBNMP1mP9z3+qadtHOOqIKn3q34rvKzyiZEndufZAt3vUQ1s+wlaJKQTUgAm7G8K8cYYCkexJoQVdfVTyJn2ZKTOkCdfoY9k/uxu3DmHhHteU7j0mmp1LVXrvrSGLtXmpzy+kHvVeH/UMw="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "NL+t9rmzVP7MFfYomU0pb/daz27COxIJ4qMxToYs4oHOn8hk4vwvdm//ORJZnLmk84gfnJRufassInIkwCszsxVoPx47jTi+tqSxFF398kT8MJdFNhr/F1CDQR6vPwMdW5CsRefPGBpr2IaL8oZRfzBDgEZL0bu8PPOOrFZCJbw69SACucYvsReQ1vHJf9XPu4eGEkIZHd9If2Bj/G8rxqUGzQ/ltVhUhhLj8rqrDghRF3+UeB1UPcCd6slKHQ+EyxKU/o2iuMe3B5rmcjDaoj52KsB+gk0puizvEgKn3F15a430u4/feKpqszDvFCWd8qxbWwBDDbLC92P2rc3T8g=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -517,8 +517,8 @@
         authenticationModule.registerOcspEventListener(appUID, oscpEventListener);
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3));
-        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIIChDCCAe2gAwIBAgIJAN1kvjmXKegVMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTA5MDUyODA4NDkwOVoXDTEwMDUyODA4NDkwOVowgZQxCzAJBgNVBAYTAkZJMRAwDgYDVQQHEwdUYW1wZXJlMRowGAYDVQQDExFPQ1NQIFVOS05PV04gQ2VydDEMMAoGA1UEChMDT3JnMSMwIQYDVR0PExpjcml0aWNhbCwgZGlnaXRhbFNpZ25hdHVyZTEkMCIGA1UdJRMbMS4zLjYuMS40LjEuOTQuMS40OS4xLjIuMi4zMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIbnFJT2y3ID0lwBix+gGbByuocroHp3preSrSmGG5OC/rZLnp21wdyjMuvo1Ga5WSfzDY6YNaSIlKKxrjYLBW+HJUJaQ0A3w3T38xCAwULEiU8e/hcK3mawlL/llNGqVnRIbpu2cuSD+ICTt7oqVvlo/TQyflRGeWT2WQ3ZBTgwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABXIPy6FpATzxN2A8Sb8rEowoTDXNK1O4DMQ26Ri+otWDt1iThirqTl3RcuLi6PzkyXElc1VXTYKiUu3MFy5Wq5qCt6Fwntbcwx21MgnuceNqMdksMRDF1YVmZHhIb1ee/MzkuR8y8iSn+xALH+YfKO3faBwVQ9ly1ZQAgil/eBd"));
-        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "dgTivrr4heaBCvnX7aCcAgO0T5reljSYhuX95Rh7+SeDKNQCYqn6q860daWxCP/tk+QceBaGK1ISghzSf1PIPuKPiKhA0ia+dFLYJUjkxYJRZc8XJSRczBaF7eks3rVh5TTQGwzIG0C3w1p4OpSL+pBSO+pMrogWBgq9IL2Pe5c="));
+        allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICvDCCAiWgAwIBAgIJAKrSZo9qYhM/MA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTMzNVoXDTE1MDkxOTA3NTMzNVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgVU5LTk9XTiBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCaZ4VDJjntiOeNKbRd8BIkEjW/Z6k/fLzbiM5hQL/xHQC1PM1spLgnr4pf7Nf+F/bJbDq2eE1jDar6wmtJPcXFFkChl1eS5yJAyY/bhswyzbqNwTcwo1Lu64TSfC4gTdthEmUPNEhzxMcdCj6myrv8hNyhv6dhkcHvZgBwFgS4Pf1DXRmr/PPjCZxyMaoLoKzjezBXVgTC9rViN7moL715HrpO1jkIB2LRY93fzBmPa1leNdiqUqachFtkzYQuuO1MLlmHXKlNmNLOGqlreB/58q5PTPbIGOIzNiN+n0RYMkVSBVImLBQeepO2ICi/DSFW0yi70LpZvebx736P0yF1AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAGBzUyF4Cb/DN4lWY5yxd1/EI/6osAHySIgMEu5ClzyIqULc3QIvjhLrbLV/JKsVYT3h/gFZxwxoTGWdE1dApWj+Hja23TlLmo0uDDL/L3NOB/n041/gI2MQYw1Z9ME2sFzzWIli1P02JciykUQba/b0fRjPsY3ctzDS7QU2EFFs="));
+        allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "UknTEEInZKDV9RCXnhv8W9KrXYppmRCUL/kSYXtdiiD3OmiwK0/4Nu0N8ix/Olo/IuWNLyPR+YZt6GLUQhw/AlWGd1mq8odlpiulFdB+e8ClkPvOW+3/KMvBO74ajyD2/PreEzCPYouM8YBqdpb49+TffnNQmEdaIpZ659ODppSNzMPmFpCcO6J2SoaU+KOp9uYdNab+JQfkGwrhF4F3FPYsQdPJAgS8Wt//khjQzAGFyOFIWmZ1ZwTbLxyf2QMHPrvtDWWH6h9qaR+2O9A90tF0PM2VUjznEOvBNigKwYTqBAW2j5oF6ZOQ4zyujqpQsm0pF6aPzaVjtZmfnpaCfA=="));
         securityAttributes = new SecurityAttributes();
         securityAttributes.addDescriptorAttributes(allAttributes);
         authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes());
@@ -536,6 +536,14 @@
 
     public static void showGuidelines(String guidelines)
     {
+        System.setProperty("com.nokia.mj.impl.rt.ui", "com.nokia.mj.impl.rt.ui.avkon.RuntimeUiAvkon");
+        try
+        {
+            Class.forName("com.nokia.mj.impl.rt.ui.qt.RuntimeUiQt");
+            System.setProperty("com.nokia.mj.impl.rt.ui", "com.nokia.mj.impl.rt.ui.qt.RuntimeUiQt");
+        }catch(Throwable t)
+        {
+        }
         RuntimeUi ui = RuntimeUiFactory.getRuntimeUi(
                            true /* aIdentified */);
         ConfirmData cData = new ConfirmData(
--- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/AccessControllerTests.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/AccessControllerTests.java	Mon Oct 04 11:29:25 2010 +0300
@@ -138,7 +138,7 @@
         storage.removeGrantedPermissions(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
         // check null values
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         try
         {
             ac.checkPermission((Permission)null);
@@ -150,7 +150,7 @@
         }
         assertWithTrace(ac.checkPermission((String)null) == 0);
         // check permission which is not granted
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         try
         {
             ac.checkPermission(new CommProtocolPermission("comm://"));
@@ -170,7 +170,7 @@
             assertWithTrace(true);
         }
         // check allowed permission which is granted
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "javax.microedition.io.CommProtocolPermission",
@@ -191,7 +191,7 @@
         }
         storage.removeGrantedPermissions(appUID);
         // check permission not allowed
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.CommProtocolPermissionImpl",
@@ -217,7 +217,7 @@
         }
         storage.removeGrantedPermissions(appUID);
         // check user permission with NO as interaction mode -> security exception thrown
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.HttpProtocolPermissionImpl",
@@ -254,7 +254,7 @@
         // check the named permissions: unknown permission
         assertWithTrace(ac.checkPermission("unknownPermission") == 0);
         // check the named permissions: allowed permission
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.gcf.protocol.socket.SocketPermissionImpl",
@@ -265,7 +265,7 @@
         storage.writeGrantedPermissions(appUID, null, grantedPermissions);
         assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.socket") == 1);
         // check the named permissions: user permission with NO interaction mode
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.gcf.protocol.http.HttpPermissionImpl",
@@ -282,7 +282,7 @@
         storage.writeGrantedPermissions(appUID, null, grantedPermissions);
         assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.http") == 0);
         // check the named permissions: user permission with ONESHOT interaction mode
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.gcf.protocol.http.HttpPermissionImpl",
@@ -299,7 +299,7 @@
         storage.writeGrantedPermissions(appUID, null, grantedPermissions);
         assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.http") == -1);
         // check the named permissions: user permission with BLANKET interaction mode (blanket prompt not shown yet)
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.gcf.protocol.http.HttpPermissionImpl",
@@ -316,7 +316,7 @@
         storage.writeGrantedPermissions(appUID, null, grantedPermissions);
         assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.http") == -1);
         // check the named permissions: user permission with BLANKET interaction mode (blanket prompt shown already)
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.gcf.protocol.http.HttpPermissionImpl",
@@ -334,7 +334,7 @@
         storage.writeUserSecuritySettingsPromptFlag(appUID, "Net Access", true);
         assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.http") == 1);
         // check the named permissions: user permission with SESSION interaction mode (session prompt not shown already)
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.gcf.protocol.http.HttpPermissionImpl",
@@ -352,7 +352,7 @@
         storage.writeUserSecuritySettingsPromptFlag(appUID, "Net Access", true);
         assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.http") == -1);
         // check the named permissions: denied permission
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.gcf.protocol.datagram.DatagramPermissionImpl",
--- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/InteractiveAccessControllerTests.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/InteractiveAccessControllerTests.java	Mon Oct 04 11:29:25 2010 +0300
@@ -109,11 +109,11 @@
     {
         TestSuite suite = new TestSuite(this.getClass().getName());
 
-        suite.addTest(new InteractiveAccessControllerTests("testAVKONSecurityPrompts", new TestMethod()
+        suite.addTest(new InteractiveAccessControllerTests("testSecurityPrompts", new TestMethod()
         {
             public void run(TestCase tc)
             {
-                ((InteractiveAccessControllerTests)tc).testAVKONSecurityPrompts();
+                ((InteractiveAccessControllerTests)tc).testSecurityPrompts();
             }
         }));
 
@@ -146,13 +146,20 @@
     {
     }
 
-    private void testAVKONSecurityPrompts()
+    private void testSecurityPrompts()
     {
         System.setProperty("com.nokia.mj.impl.rt.ui", "com.nokia.mj.impl.rt.ui.avkon.RuntimeUiAvkon");
-        testSecurityPrompts();
+        try
+        {
+            Class.forName("com.nokia.mj.impl.rt.ui.qt.RuntimeUiQt");
+            System.setProperty("com.nokia.mj.impl.rt.ui", "com.nokia.mj.impl.rt.ui.qt.RuntimeUiQt");
+        }catch(Throwable t)
+        {
+        }
+        runTests();
     }
 
-    private void testSecurityPrompts()
+    private void runTests()
     {
         // init the new mapping & policies
         //initMappingTable();
@@ -182,7 +189,7 @@
         session.write(StorageNames.MIDP_PACKAGE_TABLE, entry);
         // prompts for composite actions
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.USER_SECURITY_MODE);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.PermissionWithCompositeActionsImpl",
@@ -230,7 +237,7 @@
         assertTrue(true);
         // for NORMAL security mode, in case of identical prompts, only show one (even though they are part of different function groups)
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.DEFAULT_SECURITY_MODE);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.CommProtocolPermissionImpl",
@@ -262,7 +269,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.USER_SECURITY_MODE);
         AccessControllerFactoryImpl.destroyAccessController(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.CommProtocolPermissionImpl",
@@ -294,7 +301,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.USER_SECURITY_MODE);
         AccessControllerFactoryImpl.destroyAccessController(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.CommProtocolPermissionImpl",
@@ -335,7 +342,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.DEFAULT_SECURITY_MODE);
         AccessControllerFactoryImpl.destroyAccessController(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.HttpProtocolPermissionImpl",
@@ -361,7 +368,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.USER_SECURITY_MODE);
         AccessControllerFactoryImpl.destroyAccessController(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.HttpProtocolPermissionImpl",
@@ -403,7 +410,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.DEFAULT_SECURITY_MODE);
         AccessControllerFactoryImpl.destroyAccessController(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.HttpProtocolPermissionImpl",
@@ -443,7 +450,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.USER_SECURITY_MODE);
         AccessControllerFactoryImpl.destroyAccessController(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.HttpProtocolPermissionImpl",
@@ -482,7 +489,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.DEFAULT_SECURITY_MODE);
         AccessControllerFactoryImpl.destroyAccessController(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.FileProtocolPermissionImpl",
@@ -530,7 +537,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.USER_SECURITY_MODE);
         AccessControllerFactoryImpl.destroyAccessController(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.FileProtocolPermissionImpl",
@@ -579,7 +586,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.DEFAULT_SECURITY_MODE);
         AccessControllerFactoryImpl.destroyAccessController(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.FileProtocolPermissionImpl",
@@ -612,7 +619,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.DEFAULT_SECURITY_MODE);
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwOgwDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX1RoaXJkX1BhcnR5X1RydXN0ZWQwHhcNMDgwNjEyMDYyMzM2WhcNMTgwNjEwMDYyMzM2WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfVGhpcmRfUGFydHlfVHJ1c3RlZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArAesh03rswICRUjexWMoIH9ZZqUtlx+tfhZhuzuYhiL6cLdhxNlU8yuIdw4f17XP3yxVIB8rz1EEagCMd0Y5ZleNFZ992ReLcf9VH13RxaZ88PRxBLLROm1jcwTknYSS6AxGMup77DMwwFSN8XPnOHWt4aLGUrecMeUyI2c5UbsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAylJ+3aSq6a7AAL7UM8V8JhGZlLneErF7A/BJGDi7Vmr5gmlGyf6RCJJIg4qCp+J3Tv3eCRNNuphQaSRdFpaulwCmtfCzSZNtvZg0VhMOVsZqTwQgmP6NzKoIbqqzlgm5U+yUJw8FmX17vgdeSEdJ/oL/WT4AKrWFJYl8MdQ9ZnQ=="));
@@ -647,7 +654,7 @@
                                          StorageNames.VALUE,
                                          "MIICWDCCAcECBEhQwOgwDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX1RoaXJkX1BhcnR5X1RydXN0ZWQwHhcNMDgwNjEyMDYyMzM2WhcNMTgwNjEwMDYyMzM2WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfVGhpcmRfUGFydHlfVHJ1c3RlZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArAesh03rswICRUjexWMoIH9ZZqUtlx+tfhZhuzuYhiL6cLdhxNlU8yuIdw4f17XP3yxVIB8rz1EEagCMd0Y5ZleNFZ992ReLcf9VH13RxaZ88PRxBLLROm1jcwTknYSS6AxGMup77DMwwFSN8XPnOHWt4aLGUrecMeUyI2c5UbsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAylJ+3aSq6a7AAL7UM8V8JhGZlLneErF7A/BJGDi7Vmr5gmlGyf6RCJJIg4qCp+J3Tv3eCRNNuphQaSRdFpaulwCmtfCzSZNtvZg0VhMOVsZqTwQgmP6NzKoIbqqzlgm5U+yUJw8FmX17vgdeSEdJ/oL/WT4AKrWFJYl8MdQ9ZnQ=="));
         session.write(StorageNames.APPLICATION_PACKAGE_ATTRIBUTES_TABLE, appPackageEntry);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwOgwDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX1RoaXJkX1BhcnR5X1RydXN0ZWQwHhcNMDgwNjEyMDYyMzM2WhcNMTgwNjEwMDYyMzM2WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfVGhpcmRfUGFydHlfVHJ1c3RlZDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEArAesh03rswICRUjexWMoIH9ZZqUtlx+tfhZhuzuYhiL6cLdhxNlU8yuIdw4f17XP3yxVIB8rz1EEagCMd0Y5ZleNFZ992ReLcf9VH13RxaZ88PRxBLLROm1jcwTknYSS6AxGMup77DMwwFSN8XPnOHWt4aLGUrecMeUyI2c5UbsCAwEAATANBgkqhkiG9w0BAQQFAAOBgQAylJ+3aSq6a7AAL7UM8V8JhGZlLneErF7A/BJGDi7Vmr5gmlGyf6RCJJIg4qCp+J3Tv3eCRNNuphQaSRdFpaulwCmtfCzSZNtvZg0VhMOVsZqTwQgmP6NzKoIbqqzlgm5U+yUJw8FmX17vgdeSEdJ/oL/WT4AKrWFJYl8MdQ9ZnQ=="));
@@ -669,7 +676,7 @@
         ac.checkPermission(new HttpProtocolPermissionImpl("http://", "\n(IF YOU SEE THIS PROMPT THE TEST FAILED)"));
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         assertTrue(blanketPromptShown);
         // Add check user permission with prompt shown in blanket interaction mode -> no user prompts
         // legacy signed MIDlet, some permissions requested -> checkPermission for the granted perms succeeds and checkPermission for not granted perms fails
@@ -677,7 +684,7 @@
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
         storage.removeAuthenticationStorageData(appUID);
         storage.removeGrantedPermissions(appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwA0wDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX0RldmljZV9NYW51ZmFjdHVyZXIwHhcNMDgwNjEyMDYxOTU3WhcNMTgwNjEwMDYxOTU3WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfRGV2aWNlX01hbnVmYWN0dXJlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApi3ipIPj8O33/rZre1euh7Itd9d6ZVf2mvQ/tLpHEsFJe5XLOsVViMvFskhhKUzmDsRbP4J03L6827/vEDIi/1i8kJGLaoFqJYaLGFWI2Zmxlj6aJV8cfZyOjmQPWJn1IDEe1ZAWbvMSp8xibWRsCLNEGKIkxQvAr/QDK/6iS+kCAwEAATANBgkqhkiG9w0BAQQFAAOBgQCDXt6klAs6yKvdTab3D2wkdoi3Lu4YFsMgLexJOu5HhAUJ/9VYO+Q2+mjd95MRsTa5rWQ2Jjvhn57Z3z/KBOwfHbymmNtMk6Gl14H0vQRoHa31jh3mTuAy5KotDVthaDp30aOizk473NU68wY1WdP4gFk5ZhrpNea9q3st13BxIQ=="));
@@ -721,7 +728,7 @@
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
         storage.removeAuthenticationStorageData(appUID);
         storage.removeGrantedPermissions(appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         securityAttributes = new SecurityAttributes();
@@ -759,7 +766,7 @@
                 GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.DEFAULT_SECURITY_MODE);
                 AccessControllerFactoryImpl.destroyAccessController(appUID);
                 ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-                PermissionResolver.testClearCache();
+                PermissionResolver.cleanup();
                 grantedPermissions = new Vector();
                 grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                     "something",
@@ -802,7 +809,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.DEFAULT_SECURITY_MODE);
         AccessControllerFactoryImpl.destroyAccessController(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.CommProtocolPermissionImpl",
@@ -830,7 +837,7 @@
         GeneralSecuritySettings.setSecurityWarningsMode(session, appUID, GeneralSecuritySettings.DEFAULT_SECURITY_MODE);
         AccessControllerFactoryImpl.destroyAccessController(appUID);
         ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         grantedPermissions = new Vector();
         grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                                           "com.nokia.mj.impl.security.midp.authorization.FileProtocolPermissionImpl",
@@ -864,7 +871,7 @@
                 ui.error("myMIDlet", exc);
                 ui.destroy();
                 ac = AccessControllerFactoryImpl.getAccessController(appUID, appName);
-                PermissionResolver.testClearCache();
+                PermissionResolver.cleanup();
                 grantedPermissions = new Vector();
                 grantedPermissions.addElement(new PolicyBasedPermissionImpl(
                     "com.nokia.mj.impl.security.midp.authorization.FileProtocolPermissionImpl",
--- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/PermissionGranterTests.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/PermissionGranterTests.java	Mon Oct 04 11:29:25 2010 +0300
@@ -1125,12 +1125,14 @@
 
     private static MIDPPermission[] getDefaultPermissions()
     {
-        MIDPPermission[] defaultPerms = new MIDPPermission[5];
+        MIDPPermission[] defaultPerms = new MIDPPermission[7];
         defaultPerms[0] = new MIDPPermission("java.util.PropertyPermission", "microedition.*", "read");
         defaultPerms[1] = new MIDPPermission("javax.microedition.PropertyPermission", "mobinfo.publicinfo", "read");
         defaultPerms[2] = new MIDPPermission("javax.microedition.PropertyPermission", "mobinfo.cellid", "read");
         defaultPerms[3] = new MIDPPermission("javax.microedition.PropertyPermission", "mobinfo.countrycode", "read");
         defaultPerms[4] = new MIDPPermission("javax.microedition.PropertyPermission", "mobinfo.networkid", "read");
+        defaultPerms[5] = new MIDPPermission("javax.microedition.PropertyPermission", "mobinfo.spn", "read");
+        defaultPerms[6] = new MIDPPermission("javax.microedition.PropertyPermission", "mobinfo.ons", "read");
         return defaultPerms;
     }
 
--- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/SecurityPolicyModuleTests.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/SecurityPolicyModuleTests.java	Mon Oct 04 11:29:25 2010 +0300
@@ -90,9 +90,18 @@
         new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.cellid","read",PolicyBasedPermission.ASSIGNED_TYPE),
         new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.countrycode","read",PolicyBasedPermission.ASSIGNED_TYPE),
         new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.networkid","read",PolicyBasedPermission.ASSIGNED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.spn","read",PolicyBasedPermission.ASSIGNED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.ons","read",PolicyBasedPermission.ASSIGNED_TYPE),
         new SecurityPolicyPermission(getPermissionName("javax.microedition.midlet.AutoStartPermission"),null,null,PolicyBasedPermission.ASSIGNED_TYPE),
         new SecurityPolicyPermission(getPermissionName("javax.microedition.midlet.CmdLineArgsPermission"),null,null,PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.contactless.ndef.NDEFTagConnection.write"),"ndef://*","write",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.contactless.DiscoveryManager"),"DiscoveryManager","get_instance",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.ndef"),"ndef://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.rf"),"rf://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.sc"),"sc://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.vtag"),"vtag://*","open",PolicyBasedPermission.ALLOWED_TYPE),
     };
+
     static final SecurityPolicyPermission[] OPERATOR_PERMS =
     {
         new SecurityPolicyPermission(getPermissionName("javax.microedition.io.HttpProtocolPermission"),"http://*", null, PolicyBasedPermission.ALLOWED_TYPE),
@@ -146,8 +155,16 @@
         new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.cellid","read",PolicyBasedPermission.ASSIGNED_TYPE),
         new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.countrycode","read",PolicyBasedPermission.ASSIGNED_TYPE),
         new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.networkid","read",PolicyBasedPermission.ASSIGNED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.spn","read",PolicyBasedPermission.ASSIGNED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.ons","read",PolicyBasedPermission.ASSIGNED_TYPE),
         new SecurityPolicyPermission(getPermissionName("javax.microedition.midlet.AutoStartPermission"),null,null,PolicyBasedPermission.ASSIGNED_TYPE),
         new SecurityPolicyPermission(getPermissionName("javax.microedition.midlet.CmdLineArgsPermission"),null,null,PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.contactless.ndef.NDEFTagConnection.write"),"ndef://*","write",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.contactless.DiscoveryManager"),"DiscoveryManager","get_instance",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.ndef"),"ndef://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.rf"),"rf://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.sc"),"sc://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.vtag"),"vtag://*","open",PolicyBasedPermission.ALLOWED_TYPE),
     };
     static final SecurityPolicyPermission[] IDENTIFIED_THIRD_PARTY_PERMS =
     {
@@ -279,9 +296,24 @@
         new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.networkid","read",PolicyBasedPermission.USER_ASSIGNED_TYPE,
                                      new SecurityPolicyPermissionSettings("Location",UserSecuritySettings.SESSION_INTERACTION_MODE,
                                                                           new int[]{UserSecuritySettings.BLANKET_INTERACTION_MODE,UserSecuritySettings.ONESHOT_INTERACTION_MODE,UserSecuritySettings.NO_INTERACTION_MODE,UserSecuritySettings.SESSION_INTERACTION_MODE})),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.spn","read",PolicyBasedPermission.USER_ASSIGNED_TYPE,
+                                     new SecurityPolicyPermissionSettings("Read User Data Access",UserSecuritySettings.SESSION_INTERACTION_MODE,
+                                                                          new int[]{UserSecuritySettings.BLANKET_INTERACTION_MODE,UserSecuritySettings.ONESHOT_INTERACTION_MODE,UserSecuritySettings.NO_INTERACTION_MODE,UserSecuritySettings.SESSION_INTERACTION_MODE})),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.ons","read",PolicyBasedPermission.USER_ASSIGNED_TYPE,
+                                     new SecurityPolicyPermissionSettings("Read User Data Access",UserSecuritySettings.SESSION_INTERACTION_MODE,
+                                                                          new int[]{UserSecuritySettings.BLANKET_INTERACTION_MODE,UserSecuritySettings.ONESHOT_INTERACTION_MODE,UserSecuritySettings.NO_INTERACTION_MODE,UserSecuritySettings.SESSION_INTERACTION_MODE})),
         new SecurityPolicyPermission(getPermissionName("javax.microedition.midlet.CmdLineArgsPermission"),null, null,
                                      new SecurityPolicyPermissionSettings("Url start",UserSecuritySettings.SESSION_INTERACTION_MODE,
                                                                           new int[]{UserSecuritySettings.ONESHOT_INTERACTION_MODE,UserSecuritySettings.NO_INTERACTION_MODE,UserSecuritySettings.SESSION_INTERACTION_MODE})),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.contactless.ndef.NDEFTagConnection.write"),"ndef://*","write",
+                                     new SecurityPolicyPermissionSettings("NFC Write Access",UserSecuritySettings.SESSION_INTERACTION_MODE,
+                                                                          new int[]{UserSecuritySettings.BLANKET_INTERACTION_MODE,UserSecuritySettings.ONESHOT_INTERACTION_MODE,UserSecuritySettings.NO_INTERACTION_MODE,UserSecuritySettings.SESSION_INTERACTION_MODE})),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.contactless.DiscoveryManager"),"DiscoveryManager","get_instance",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.ndef"),"ndef://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.rf"),"rf://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.sc"),"sc://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.vtag"),"vtag://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+    
     };
     static final SecurityPolicyPermission[] UNIDENTIFIED_THIRD_PARTY_PERMS =
     {
@@ -407,6 +439,20 @@
         new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.networkid","read",PolicyBasedPermission.USER_ASSIGNED_TYPE,
                                      new SecurityPolicyPermissionSettings("Location",UserSecuritySettings.ONESHOT_INTERACTION_MODE,
                                                                           new int[]{UserSecuritySettings.ONESHOT_INTERACTION_MODE,UserSecuritySettings.NO_INTERACTION_MODE,UserSecuritySettings.SESSION_INTERACTION_MODE})),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.spn","read",PolicyBasedPermission.USER_ASSIGNED_TYPE,
+                                     new SecurityPolicyPermissionSettings("Read User Data Access",UserSecuritySettings.ONESHOT_INTERACTION_MODE,
+                                                                          new int[]{UserSecuritySettings.ONESHOT_INTERACTION_MODE,UserSecuritySettings.NO_INTERACTION_MODE,UserSecuritySettings.SESSION_INTERACTION_MODE})),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.PropertyPermission"),"mobinfo.ons","read",PolicyBasedPermission.USER_ASSIGNED_TYPE,
+                                     new SecurityPolicyPermissionSettings("Read User Data Access",UserSecuritySettings.ONESHOT_INTERACTION_MODE,
+                                                                          new int[]{UserSecuritySettings.ONESHOT_INTERACTION_MODE,UserSecuritySettings.NO_INTERACTION_MODE,UserSecuritySettings.SESSION_INTERACTION_MODE})),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.contactless.ndef.NDEFTagConnection.write"),"ndef://*","write",
+                                     new SecurityPolicyPermissionSettings("NFC Write Access",UserSecuritySettings.ONESHOT_INTERACTION_MODE,
+                                                                          new int[]{UserSecuritySettings.ONESHOT_INTERACTION_MODE,UserSecuritySettings.NO_INTERACTION_MODE,UserSecuritySettings.SESSION_INTERACTION_MODE})),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.contactless.DiscoveryManager"),"DiscoveryManager","get_instance",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.ndef"),"ndef://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.rf"),"rf://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.sc"),"sc://*","open",PolicyBasedPermission.ALLOWED_TYPE),
+        new SecurityPolicyPermission(getPermissionName("javax.microedition.io.Connector.vtag"),"vtag://*","open",PolicyBasedPermission.ALLOWED_TYPE),
     };
 
     // Begin j2meunit test framework setup
--- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/common/SecurityExtensionsTests.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/common/SecurityExtensionsTests.java	Mon Oct 04 11:29:25 2010 +0300
@@ -121,7 +121,7 @@
     {
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
     }
 
     protected void test()
@@ -144,7 +144,7 @@
         // policies (unsigned suite, check that ext1 perms are granted and the base permissions were not altered)
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         securityAttributes = new SecurityAttributes();
@@ -173,7 +173,7 @@
         {
             storage.removeAuthenticationStorageData(appUID);
             permissionGranter.removeSecurityData(session,appUID);
-            PermissionResolver.testClearCache();
+            PermissionResolver.cleanup();
             allAttributes.clear();
             allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
             allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwA0wDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX0RldmljZV9NYW51ZmFjdHVyZXIwHhcNMDgwNjEyMDYxOTU3WhcNMTgwNjEwMDYxOTU3WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfRGV2aWNlX01hbnVmYWN0dXJlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApi3ipIPj8O33/rZre1euh7Itd9d6ZVf2mvQ/tLpHEsFJe5XLOsVViMvFskhhKUzmDsRbP4J03L6827/vEDIi/1i8kJGLaoFqJYaLGFWI2Zmxlj6aJV8cfZyOjmQPWJn1IDEe1ZAWbvMSp8xibWRsCLNEGKIkxQvAr/QDK/6iS+kCAwEAATANBgkqhkiG9w0BAQQFAAOBgQCDXt6klAs6yKvdTab3D2wkdoi3Lu4YFsMgLexJOu5HhAUJ/9VYO+Q2+mjd95MRsTa5rWQ2Jjvhn57Z3z/KBOwfHbymmNtMk6Gl14H0vQRoHa31jh3mTuAy5KotDVthaDp30aOizk473NU68wY1WdP4gFk5ZhrpNea9q3st13BxIQ=="));
@@ -198,7 +198,7 @@
         {
             storage.removeAuthenticationStorageData(appUID);
             permissionGranter.removeSecurityData(session,appUID);
-            PermissionResolver.testClearCache();
+            PermissionResolver.cleanup();
             allAttributes.clear();
             allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
             allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICWDCCAcECBEhQwA0wDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX0RldmljZV9NYW51ZmFjdHVyZXIwHhcNMDgwNjEyMDYxOTU3WhcNMTgwNjEwMDYxOTU3WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfRGV2aWNlX01hbnVmYWN0dXJlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApi3ipIPj8O33/rZre1euh7Itd9d6ZVf2mvQ/tLpHEsFJe5XLOsVViMvFskhhKUzmDsRbP4J03L6827/vEDIi/1i8kJGLaoFqJYaLGFWI2Zmxlj6aJV8cfZyOjmQPWJn1IDEe1ZAWbvMSp8xibWRsCLNEGKIkxQvAr/QDK/6iS+kCAwEAATANBgkqhkiG9w0BAQQFAAOBgQCDXt6klAs6yKvdTab3D2wkdoi3Lu4YFsMgLexJOu5HhAUJ/9VYO+Q2+mjd95MRsTa5rWQ2Jjvhn57Z3z/KBOwfHbymmNtMk6Gl14H0vQRoHa31jh3mTuAy5KotDVthaDp30aOizk473NU68wY1WdP4gFk5ZhrpNea9q3st13BxIQ=="));
@@ -223,7 +223,7 @@
         {
             storage.removeAuthenticationStorageData(appUID);
             permissionGranter.removeSecurityData(session,appUID);
-            PermissionResolver.testClearCache();
+            PermissionResolver.cleanup();
             allAttributes.clear();
             allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
             allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICyjCCAjOgAwIBAgIJANglmaqnbnYRMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDIwNTEzMTMzN1oXDTE1MDIwNDEzMTMzN1owVzELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk15IENvbW1vbiBOYW1lMR0wGwYDVQQKExRNeSBPcmdhbml6YXRpb24gTmFtZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMkJNh9P28KvJCgoJ3rwlpl0mVSpEVrl9UikxvBCqccQCJNuvcVKy8N06l8CGvwNVDhFb3eLyg5aUA8BsdcsTNfCxkItrbdyj7rNvvrPRztt42gFY1ZBSJKzkAMzXe1+d8SsjzwUxwA0xqhmA8PGVEhCruLtgAL3OPy3Y382SGmaQgiSBlYl/lkS8o8w6yNHXUUs/NC+1fQ7FRpb9VBueDT4neOhZopNZH+9VFH1vGT4oZPIn+fJY+Ue69WwDXXnHSNrrr5pDx+H882Fh7Z1Lswq3FVPzQCN69QqUpzGwaGF4NaMGywJYHnD6t3DHtGZwHnVZoCJx/L/P58JOWmNqz0CAwEAATANBgkqhkiG9w0BAQUFAAOBgQBgbsN4vL4Vh/NVmAACVqcIKrbYp6SiRA72a9P4cusyShq+ogkTweas9DMyX/DkEtbnjSEkRPnvcKydsux7fARBg+fzk/AJ6Q8vH9RMSxwbwygoqieHID68ahGnx0/E1KUuw78Og2zQScvoE7xn9jCiWoTzA5qfOKZJ445wonS0dw=="));
@@ -246,7 +246,7 @@
         // policies (trusted third party suite which requests ext2 public perms
         storage.removeAuthenticationStorageData(appUID);
         permissionGranter.removeSecurityData(session,appUID);
-        PermissionResolver.testClearCache();
+        PermissionResolver.cleanup();
         allAttributes.clear();
         allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2));
         allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("",        "MIICyjCCAjOgAwIBAgIJANglmaqnbnYRMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDIwNTEzMTMzN1oXDTE1MDIwNDEzMTMzN1owVzELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk15IENvbW1vbiBOYW1lMR0wGwYDVQQKExRNeSBPcmdhbml6YXRpb24gTmFtZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMkJNh9P28KvJCgoJ3rwlpl0mVSpEVrl9UikxvBCqccQCJNuvcVKy8N06l8CGvwNVDhFb3eLyg5aUA8BsdcsTNfCxkItrbdyj7rNvvrPRztt42gFY1ZBSJKzkAMzXe1+d8SsjzwUxwA0xqhmA8PGVEhCruLtgAL3OPy3Y382SGmaQgiSBlYl/lkS8o8w6yNHXUUs/NC+1fQ7FRpb9VBueDT4neOhZopNZH+9VFH1vGT4oZPIn+fJY+Ue69WwDXXnHSNrrr5pDx+H882Fh7Z1Lswq3FVPzQCN69QqUpzGwaGF4NaMGywJYHnD6t3DHtGZwHnVZoCJx/L/P58JOWmNqz0CAwEAATANBgkqhkiG9w0BAQUFAAOBgQBgbsN4vL4Vh/NVmAACVqcIKrbYp6SiRA72a9P4cusyShq+ogkTweas9DMyX/DkEtbnjSEkRPnvcKydsux7fARBg+fzk/AJ6Q8vH9RMSxwbwygoqieHID68ahGnx0/E1KUuw78Og2zQScvoE7xn9jCiWoTzA5qfOKZJ445wonS0dw=="));
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java	Mon Oct 04 11:29:25 2010 +0300
@@ -45,11 +45,12 @@
  * package com.nokia.mj.impl.mypackage;
  *
  * import com.nokia.mj.impl.rt.support.ApplicationUtils;
- *      public void myClass()
+ * import com.nokia.mj.impl.rt.support.ShutdownListener;
+ *      public MyClass
  *      {
  *          public void myMethod()
  *          {
- *              // Get the insatnce of ApplicationUtils.
+ *              // Get the instance of ApplicationUtils.
  *              ApplicationUtils appUtils = ApplicationUtils.getInstance();
  *
  *              // Get the name of the application.
@@ -236,7 +237,11 @@
      * calls are made in a loop in one thread, so if some listener blocks the
      * call the rest of the listeners don't get the notification.
      * <p>
-     * There can be more than one listener.
+     * There can be more than one listener, but it is recommended that there
+     * is only one listener per component.
+     * <p>
+     * The implementation stores a strong reference to object which prevents
+     * garbage collection of the listener unless the listener is removed.
      *
      * @param listener the new listener.
      */
@@ -249,6 +254,25 @@
         mListeners.addElement(listener);
     }
 
+    /**
+     * Removes the registered shutdown listener.
+     *
+     * @param listener the listener to be removed. If the listener is not
+     *                 found nothing happens. If the key is null, a 
+     * @throws NullPointerException if the listener is null.
+     */
+    public void removeShutdownListener(ShutdownListener listener)
+    {
+        if (listener == null)
+        {
+            throw new 
+              NullPointerException("Listener was null when trying to remove");
+        }
+        if (mListeners != null)
+        {
+            mListeners.removeElement(listener);
+        }
+    }
 
     /**
      * Waits (if needed) until the application to be started is known.
--- a/javaextensions/globalindicators/build/build.xml	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-<!--
-#
-# Copyright (c) 2008-2009 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"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
--->
-
-<project name="javaglobalindicators" default="deploy" basedir=".">
-
-  <import file="../../../build/utilities.xml"/>
-
-  <!-- Needed by the utilities.xml. See the description form the utilities.xml
-       file -->
-
-  <property name="javah.classnames" 
-            value="com.nokia.mj.impl.globalindicators.GlobalIndicatorsImpl,
-                   com.nokia.mid.ui.GlobalIndicators"/>
-
-
-  <target name="create.public.api.jar">
-      <omj.public.apis includes="com/nokia/mid/ui/GlobalIndicatorsException.class, 
-                                 com/nokia/mid/ui/GlobalIndicators.class"/>
-  </target>
-
-</project>
--- a/javaextensions/globalindicators/build/bwins/javaglobalindicatorsu.def	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *)
-
--- a/javaextensions/globalindicators/build/eabi/javaglobalindicatorsu.def	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	_Z10jni_lookupPKc @ 1 NONAME
-
--- a/javaextensions/globalindicators/build/javaglobalindicators.pro	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-#
-# Copyright (c) 2009 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"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-TARGET=javaglobalindicators
-TEMPLATE=lib
-CONFIG += omj java stl
-CONFIG -= qt
-          
-LIBS += -laknnotify \
-        -laknnotifyplugin \
-        -lbafl \
-        -lefsrv \
-        -lflogger
-
-
-include(../../../build/omj.pri)
--- a/javaextensions/globalindicators/inc/CGlobalIndicators.h	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* Copyright (c) 2008 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Controls the native global indicators.
-*
-*/
-
-
-#ifndef CGLOBALINDICATORS_H
-#define CGLOBALINDICATORS_H
-
-// CLASS DECLARATION
-
-class CGlobalIndicators: public CBase
-{
-public:
-    /**
-     * Sets the value of the given global indicator.
-     *
-     * @param aIndicator id of the indicator
-     *
-     * @param aValue the value to set for the global indicator.
-     *
-     * @return the value that is currently set for the indicator,
-     * or a native error value.
-     */
-    static TInt SetGlobalIndicator(TInt aIndicator, TInt aValue);
-
-    /**
-     * Gets the value of the given global indicator.
-     *
-     * @param aIndicator id of the indicator
-     *
-     * @return the value that is currently set for the indicator,
-     * or a native error value.
-     */
-    static TInt GlobalIndicator(TInt aIndicator);
-};
-#endif // CGLOBALINDICATORS_H
-
-
--- a/javaextensions/globalindicators/javasrc/com/nokia/mid/ui/GlobalIndicators.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,143 +0,0 @@
-/*
-* Copyright (c) 2008 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Public interface of the GlobalIndicator API.
- *
-*/
-
-package com.nokia.mid.ui;
-
-import com.nokia.mj.impl.globalindicators.GlobalIndicatorsImpl;
-
-/**
- * The <code>GlobalIndicators</code> is a class to handle the device global
- * indicators. Global indicators are small icons that appear to the device
- * status indicator area indicating for example the arrival of a new email or
- * chat message. These indicators remain in the status indicator area even if
- * the midlet is closed but rebooting the device will remove them, so the
- * indicators are not fully persistent.<P>
- *
- * These global indicators are common and also used by the native applications.
- * This means that at any time it is possible for any application to turn an
- * indicator on or off. For that reason it is good practice to query the state
- * of the indicator before setting the value.<P>
- *
- * There are also other indicators besides these <code>MAIL_INDICATOR</code> or
- * <code>CHAT_INDICATOR</code> defined in this API. GlobalIndicators API allows
- * to access those indicators too but the exact values of both the indicator and
- * its value need to be given as accurate integer parameters (as some of those
- * more complex indicators support a larger range of input parameters than just
- * <code>INDICATOR_HIDE</code> or <code>INDICATOR_SHOW</code>).<P>
- *
- * Example of API usage:<P>
- * <code>
- * int retVal = GlobalIndicators.getGlobalIndicator(<BR>
- * &nbsp;&nbsp;&nbsp;&nbsp;GlobalIndicators.MAIL_INDICATOR);<P>
- * if(retVal != GlobalIndicators.INDICATOR_SHOW)<BR>
- * &nbsp;&nbsp;&nbsp;&nbsp;{<BR>
- * &nbsp;&nbsp;&nbsp;&nbsp;retVal = GlobalIndicators.setGlobalIndicator(<BR>
- * &nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;GlobalIndicators.MAIL_INDICATOR,<BR>
- * &nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;GlobalIndicators.INDICATOR_SHOW);<BR>
- * &nbsp;&nbsp;&nbsp;&nbsp;}
- * </code>
- */
-public final class GlobalIndicators
-{
-
-    private static GlobalIndicatorsImpl sInstance;
-
-    static
-    {
-        sInstance = GlobalIndicatorsImpl.getInstance();
-    }
-
-    /**
-     * A constant for email indicator.
-     */
-    public static final int MAIL_INDICATOR = 274;
-
-    /**
-     * A constant for chat message indicator.
-     */
-    public static final int CHAT_INDICATOR = 260;
-
-    /**
-     * A constant for indicator's default value uninitialized.
-     */
-    public static final int INDICATOR_UNINITIALIZED = 0;
-
-    /**
-     * A constant for indicator's value when the indicator is hidden.
-     */
-    public static final int INDICATOR_HIDE = 1;
-
-    /**
-     * A constant for indicator's value when the indicator is displayed.
-     */
-    public static final int INDICATOR_SHOW = 2;
-
-    /**
-     * Private constructor.
-     */
-    private GlobalIndicators()
-    {
-    }
-
-    /**
-     * Sets the value of the given global indicator.
-     *
-     * @param indicator <code>MAIL_INDICATOR</code>,
-     * <code>CHAT_INDICATOR</code> or a specific other indicator given as
-     * an integer.
-     *
-     * @param value the value to set: <code>INDICATOR_SHOW</code>,
-     * <code>INDICATOR_HIDE</code> or a specific other value given as
-     * an integer.
-     *
-     * @return the value that is currently set for the indicator:
-     * <code>INDICATOR_UNINITIALIZED</code>, <code>INDICATOR_SHOW</code> or
-     * <code>INDICATOR_HIDE</code>. For the other specific indicators the
-     * return value is the integer value that is set for that indicator.
-     *
-     * @throws GlobalIndicatorsException if the given indicator or the
-     * given value is not supported, or there occurs an error while trying to
-     * access the indicator.
-     */
-    public static int setGlobalIndicator(int indicator, int value)
-    throws GlobalIndicatorsException
-    {
-        return sInstance.setGlobalIndicator(indicator, value);
-    }
-
-    /**
-     * Gets the value of the given global indicator.
-     *
-     * @param indicator <code>MAIL_INDICATOR</code>,
-     * <code>CHAT_INDICATOR</code> or a specific other indicator given as
-     * an integer.
-     *
-     * @return the value that is currently set for the indicator:
-     * <code>INDICATOR_UNINITIALIZED</code>, <code>INDICATOR_SHOW</code> or
-     * <code>INDICATOR_HIDE</code>. For the other specific indicators the
-     * return value is the integer value that is currently set for that
-     * indicator.
-     *
-     * @throws GlobalIndicatorsException if there occurs an error while trying
-     * to access the indicator.
-     */
-    public static int getGlobalIndicator(int indicator)
-    throws GlobalIndicatorsException
-    {
-        return sInstance.getGlobalIndicator(indicator);
-    }
-}
--- a/javaextensions/globalindicators/javasrc/com/nokia/mid/ui/GlobalIndicatorsException.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,76 +0,0 @@
-/*
-* Copyright (c) 2008 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Exception for Global Indicators
- *
-*/
-
-package com.nokia.mid.ui;
-
-public class GlobalIndicatorsException extends Exception
-{
-
-
-    private int errorCode;
-
-    /**
-     * Default constructor is not allowed.
-     */
-    protected GlobalIndicatorsException() {}
-
-    /**
-     * Constructs an exception instance with a textual information.
-     * @param info human readable information about the exception.
-     */
-    public GlobalIndicatorsException(String info)
-    {
-        super(info);
-    }
-
-    /**
-     * Constructs an exception instance with a textual information and the
-     * error code of the native call.
-     * @param info human readable information about the exception.
-     * @param errorCode the error code received from native side.
-     */
-    public GlobalIndicatorsException(String info, int errorCode)
-    {
-        super(info);
-        this.errorCode = errorCode;
-    }
-
-    /**
-     * Constructs human readable textual information
-     * @return String the human readable textual information
-     */
-    public String toString()
-    {
-        if (errorCode == 0)
-        {
-            return super.toString();
-        }
-        else
-        {
-            return super.toString() + " Native error: " + errorCode;
-        }
-    }
-
-    /**
-     * Returns the native error code
-     * @return the native error code
-     */
-    public int getErrorCode()
-    {
-        return errorCode;
-    }
-}
--- a/javaextensions/globalindicators/javasrc/com/nokia/mj/impl/globalindicators/GlobalIndicatorsImpl.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
-* Copyright (c) 2008 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Implementation class of GlobalIndicators API.
- *
-*/
-
-package com.nokia.mj.impl.globalindicators;
-
-import com.nokia.mid.ui.GlobalIndicators;
-import com.nokia.mid.ui.GlobalIndicatorsException;
-import com.nokia.mj.impl.utils.OsErrorMessage;
-import com.nokia.mj.impl.rt.support.ApplicationInfo;
-
-
-public class GlobalIndicatorsImpl
-{
-
-    // Static instance, can be got with getInstace method
-    private static GlobalIndicatorsImpl sGlobalIndicator;
-    // Static block of the class.
-
-    static
-    {
-        com.nokia.mj.impl.rt.support.Jvm.loadSystemLibrary("javaglobalindicators");
-
-        // This is called when class is loaded for the first time
-        sGlobalIndicator = new GlobalIndicatorsImpl();
-    }
-
-    /**
-     * This private constructor can be called only from static block.
-     */
-    private GlobalIndicatorsImpl()
-    {
-    }
-
-    /**
-     * Return GlobalIndicatorsImpl instance
-     */
-    public static GlobalIndicatorsImpl getInstance()
-    {
-        return sGlobalIndicator;
-    }
-
-    /**
-     * See class GlobalIndicators for comments
-     */
-    public int setGlobalIndicator(int aIndicator, int aValue)
-    throws GlobalIndicatorsException
-    {
-        int ret;
-        String protectionDomain = ApplicationInfo.getInstance().getProtectionDomain();
-        if (protectionDomain == null)
-        {
-            throw new GlobalIndicatorsException(
-                "Failed to set global indicator for unidentified domain");
-        }
-        else
-        {
-            // For mail and chat indicators only show and hide are supported
-            if (((aIndicator == GlobalIndicators.MAIL_INDICATOR) ||
-                    (aIndicator == GlobalIndicators.CHAT_INDICATOR)) &&
-                    ((aValue != GlobalIndicators.INDICATOR_SHOW) &&
-                     (aValue != GlobalIndicators.INDICATOR_HIDE)))
-            {
-                throw new GlobalIndicatorsException(
-                    "Value is not supported for global indicator");
-            }
-
-            //int ret = _setGlobalIndicator( aIndicator, aValue );
-            ret = _setGlobalIndicator(aIndicator, aValue);
-            if (ret < OsErrorMessage.SUCCESS)
-            {
-                throw new GlobalIndicatorsException(
-                    "Failed to set global indicator", ret);
-            }
-        }
-        return ret;
-    }
-
-    /**
-     * See class GlobalIndicators for comments
-     */
-    public int getGlobalIndicator(int aIndicator)
-    throws GlobalIndicatorsException
-    {
-        int ret = _getGlobalIndicator(aIndicator);
-        if (ret < OsErrorMessage.SUCCESS)
-        {
-            throw new GlobalIndicatorsException(
-                "Failed to get global indicator value", ret);
-        }
-        return ret;
-    }
-
-    /**
-     * Native methods.
-     */
-    private static native int _setGlobalIndicator(
-        int aIndicator, int aValue);
-
-    private static native int _getGlobalIndicator(
-        int aIndicator);
-}
--- a/javaextensions/globalindicators/src/CGlobalIndicators.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +0,0 @@
-/*
-* Copyright (c) 2007 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Controls the native global indicators.
-*
-*/
-
-
-// INCLUDE FILES
-#include <e32base.h>
-#include <e32property.h> // Publish & Subscribe
-#include <coreapplicationuisdomainpskeys.h>
-#include "CGlobalIndicators.h"
-#include "com_nokia_mid_ui_GlobalIndicators.h"
-#include "logger.h"
-
-//  CONSTANTS
-namespace
-{
-// These constants are from JNI header, just defined shorter names here
-// If any other values are used for the indicator or its value, they are
-// passed directly to P&S.
-const TInt KPropertyGlobalMailIndicator =
-    com_nokia_mid_ui_GlobalIndicators_MAIL_INDICATOR;
-
-const TInt KPropertyGlobalChatIndicator =
-    com_nokia_mid_ui_GlobalIndicators_CHAT_INDICATOR;
-
-const TInt KPropertyGlobalIndicatorUninitialized =
-    com_nokia_mid_ui_GlobalIndicators_INDICATOR_UNINITIALIZED;
-
-const TInt KPropertyGlobalIndicatorHide =
-    com_nokia_mid_ui_GlobalIndicators_INDICATOR_HIDE;
-
-const TInt KPropertyGlobalIndicatorShow =
-    com_nokia_mid_ui_GlobalIndicators_INDICATOR_SHOW;
-}
-
-// Required capabilites
-// WriteDeviceData  // for setting the email status using RProperty::Set()
-// ReadDeviceData   // for retrieving the email status using RProperty::Get()
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// SetGlobalIndicator
-// Sets the value for given global indicator.
-// -----------------------------------------------------------------------------
-//
-TInt CGlobalIndicators::SetGlobalIndicator(TInt aIndicator, TInt aValue)
-{
-
-    LOG2(EJavaGlobalInd, EInfo,
-         "GlobalIndicators::SetGlobalIndicator indicator:%d, value:%d",
-         aIndicator, aValue);
-
-
-    // Make sure that indicator JNI constants match into P&S definitions used
-    // in platform.
-    TUint32 convertedIndicator = aIndicator;
-    if (aIndicator == KPropertyGlobalMailIndicator)
-    {
-        convertedIndicator = KCoreAppUIsNewEmailStatus;
-    }
-    if (aIndicator == KPropertyGlobalChatIndicator)
-    {
-        convertedIndicator = KCoreAppUIsUipInd;
-    }
-
-    TInt readValue = KPropertyGlobalIndicatorUninitialized;
-    RProperty property;
-
-    TInt ret = property.Attach(KPSUidCoreApplicationUIs, convertedIndicator);
-    if (KErrNone == ret)
-    {
-        ret = property.Get(readValue);
-        TInt setValue = KPropertyGlobalIndicatorUninitialized;
-
-        // For Email and Chat indicators, use the specific known P&S values
-        if (convertedIndicator == KCoreAppUIsNewEmailStatus ||
-                convertedIndicator == KCoreAppUIsUipInd)
-        {
-            if (aValue == KPropertyGlobalIndicatorShow)
-            {
-                // Always ok to turn on - just check if is was already on
-                if (readValue != ECoreAppUIsNewEmail &&
-                        readValue != ECoreAppUIsShow)
-                {
-                    if (convertedIndicator == KCoreAppUIsNewEmailStatus)
-                    {
-                        setValue = ECoreAppUIsNewEmail;
-                    }
-                    if (convertedIndicator == KCoreAppUIsUipInd)
-                    {
-                        setValue = ECoreAppUIsShow;
-                    }
-
-                    ret = property.Set(setValue);
-                    readValue = KPropertyGlobalIndicatorShow;
-                    LOG1(EJavaGlobalInd, EInfo,
-                         "GlobalIndicators::SetGlobalIndicator ON, value:%D",
-                         setValue);
-                }
-            }
-            else if (aValue == KPropertyGlobalIndicatorHide)
-            {
-                // When turning email inficator off bear in mind that there is
-                // no way to know for sure if some other application still would
-                // like to have the indicator turned on.
-                if (readValue != ECoreAppUIsNoNewEmail &&
-                        readValue != ECoreAppUIsDoNotShow)
-                {
-                    if (convertedIndicator == KCoreAppUIsNewEmailStatus)
-                    {
-                        setValue = ECoreAppUIsNoNewEmail;
-                    }
-                    if (convertedIndicator == KCoreAppUIsUipInd)
-                    {
-                        setValue = ECoreAppUIsDoNotShow;
-                    }
-
-                    ret = property.Set(setValue);
-                    readValue = KPropertyGlobalIndicatorHide;
-                    LOG1(EJavaGlobalInd, EInfo,
-                         "GlobalIndicators::SetGlobalIndicator OFF, value:%D",
-                         setValue);
-                }
-            }
-            else
-            {
-                // Value is not HIDE or SHOW. Try to set it anyway.
-                ret = property.Set(aValue);
-                readValue = aValue;
-                LOG1(EJavaGlobalInd, EInfo,
-                     "GlobalIndicators::SetGlobalIndicator value:%D",
-                     aValue);
-            }
-        }
-
-        else // other than Email or Chat indicator
-        {
-            ret = property.Set(aValue);
-            readValue = aValue;
-            LOG1(EJavaGlobalInd, EInfo,
-                 "GlobalIndicators::SetGlobalIndicator [user defined] value:%D",
-                 aValue);
-        }
-
-    }
-    property.Close();
-    if (KErrNone != ret)
-    {
-        LOG1(EJavaGlobalInd, EInfo,
-             "GlobalIndicators::SetGlobalIndicator property error :%D",
-             ret);
-        readValue = ret;
-    }
-
-    // return the property value or an error code
-    return readValue;
-}
-
-// -----------------------------------------------------------------------------
-// GlobalIndicator
-// Gets the value of given global indicator.
-// -----------------------------------------------------------------------------
-//
-TInt CGlobalIndicators::GlobalIndicator(TInt aIndicator)
-{
-    LOG(EJavaGlobalInd, EInfo, "GlobalIndicators::GlobalIndicator");
-    RProperty property;
-    TInt readValue = 0;
-    TInt ret = KErrNotFound;
-
-    if (aIndicator == KPropertyGlobalMailIndicator)
-    {
-        ret = property.Attach(
-                  KPSUidCoreApplicationUIs, KCoreAppUIsNewEmailStatus);
-    }
-    else if (aIndicator == KPropertyGlobalChatIndicator)
-    {
-        ret = property.Attach(
-                  KPSUidCoreApplicationUIs, KCoreAppUIsUipInd);
-    }
-    else
-    {
-        // A specific indicator (other than mail or chat indicator)
-        ret = property.Attach(
-                  KPSUidCoreApplicationUIs, aIndicator);
-    }
-
-    // If Attach has succeeded, try reading the Property value
-    if (KErrNone == ret)
-    {
-        ret = property.Get(readValue);
-        property.Close();
-    }
-
-    // If also reading has succeeded, return the Property value
-    if (KErrNone == ret)
-    {
-        return readValue ;
-    }
-    else
-    {
-        return ret;
-    }
-}
-
-//  End of File
--- a/javaextensions/globalindicators/src/GlobalIndicators.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
-* Copyright (c) 2008 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"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-#include <e32base.h>
-#include "com_nokia_mj_impl_globalindicators_GlobalIndicatorsImpl.h"
-#include "CGlobalIndicators.h"
-
-/*
- * Class: com_nokia_mid_ui_GlobalIndicators
- * Method: _setGlobalIndicator
- */
-JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_globalindicators_GlobalIndicatorsImpl__1setGlobalIndicator(
-    JNIEnv*,
-    jclass,
-    jint aIndicator,
-    jint aValue)
-{
-    return CGlobalIndicators::SetGlobalIndicator(
-               (TInt) aIndicator,
-               (TInt) aValue);
-}
-
-/*
- * Class: com_nokia_mid_ui_GlobalIndicators
- * Method: _getGlobalIndicator
- */
-JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_globalindicators_GlobalIndicatorsImpl__1getGlobalIndicator(
-    JNIEnv*,
-    jclass,
-    jint aIndicator)
-{
-    return CGlobalIndicators::GlobalIndicator((TInt) aIndicator);
-}
-//  End of File
--- a/javaextensions/javaextensions.pro	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/javaextensions.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -17,8 +17,6 @@
 SUBDIRS += iapinfo/build/javaiapinfo.pro 
 SUBDIRS += mobinfo/build/javamobinfo.pro 
 SUBDIRS += comm/build/javacomm.pro 
-SUBDIRS += globalindicators/build/javaglobalindicators.pro 
-SUBDIRS += webservices/build/javawebservices.pro 
 SUBDIRS += satsa/build/javasatsa.pro 
 SUBDIRS += location/build/javalocation.pro 
 SUBDIRS += sensor/build/javasensor.pro 
--- a/javaextensions/location/landmarks/javasrc.s60/com/nokia/mj/impl/location/LandmarkStoreManager.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/location/landmarks/javasrc.s60/com/nokia/mj/impl/location/LandmarkStoreManager.java	Mon Oct 04 11:29:25 2010 +0300
@@ -192,7 +192,7 @@
      * @return NativeError.KErrNone if no error occured. Otherwise one of the
      *         system-wide error codes
      */
-    public int deleteStore(Locator aLocator)
+    synchronized public int deleteStore(Locator aLocator)
     {
         if (aLocator == null)
         {
@@ -213,7 +213,7 @@
      * Removes a native side landmark store peer object from this class
      * @param aStoreHandle A handle to the store which is to be removed
      */
-    public void removeStore(String aStoreUri, int aStoreHandle)
+    synchronized public void removeStore(String aStoreUri, int aStoreHandle)
     {
         // Unregister the landmark store if there is an open store. This
         // quarantees that the closed store will not be provided to any
--- a/javaextensions/midprms_db/tsrc/rmsbenchmark/javasrc/BenchmarkRunner.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/midprms_db/tsrc/rmsbenchmark/javasrc/BenchmarkRunner.java	Mon Oct 04 11:29:25 2010 +0300
@@ -23,11 +23,11 @@
 
     public static final String TESTNAMES = "RMS,,,,\n";
     public static final String TESTS =
-        "10 byte record create,10 byte enumerated read,10 byte random read,create enums,10 byte record set,open,close,10 byte record delete" +
-        ",,100 byte record create,100 byte enumerated read,100 byte random read,create enums,100 byte record set,open,close,100 byte record delete" +
-        ",,1000 byte record create,1000 byte enumerated read,1000 byte random read,create enums,1000 byte record set,open,close,1000 byte record delete" +
-        ",,10000 byte record create,10000 byte enumerated read,10000 byte random read,create enums,10000 byte record set,open,close,10000 byte record delete" +
-        ",,100000 byte record create,100000 byte enumerated read,100000 byte random read,create enums,100000 byte record set,open,close,100000 byte record delete\n";
+        "10 byte record create,10 byte enumerated read,10 byte random read,create enums,10 byte record set,open,close,10 byte record delete,open multiple,close multiple,open-close" +
+        ",,100 byte record create,100 byte enumerated read,100 byte random read,create enums,100 byte record set,open,close,100 byte record delete,open multiple,close multiple,open-close" +
+        ",,1000 byte record create,1000 byte enumerated read,1000 byte random read,create enums,1000 byte record set,open,close,1000 byte record delete,open multiple,close multiple,open-close" +
+        ",,10000 byte record create,10000 byte enumerated read,10000 byte random read,create enums,10000 byte record set,open,close,10000 byte record delete,open multiple,close multiple,open-close" +
+        ",,100000 byte record create,100000 byte enumerated read,100000 byte random read,create enums,100000 byte record set,open,close,100000 byte record delete,open multiple,close multiple,open-close\n";
 
     public static StringBuffer SCORES;
 
--- a/javaextensions/midprms_db/tsrc/rmsbenchmark/javasrc/RMSBenchmark.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/midprms_db/tsrc/rmsbenchmark/javasrc/RMSBenchmark.java	Mon Oct 04 11:29:25 2010 +0300
@@ -24,7 +24,7 @@
     private static final int[] fullTest = {10, 100, 1000, 10000, 100000};
     private int[] testSet;
 
-    private int NUMBER_OF_TESTS = 9;
+    private int NUMBER_OF_TESTS = 12;
     private int NUMBER_OF_SCORES;// = NUMBER_OF_TESTS * testSet.length;
 
     RMSBenchmark(boolean aRunFullTests)
@@ -64,7 +64,10 @@
             myScores[i*NUMBER_OF_TESTS + 5].append(storage.openStore());
             myScores[i*NUMBER_OF_TESTS + 6].append(storage.closeStore());
             myScores[i*NUMBER_OF_TESTS + 7].append(storage.deleteRecord());
-            myScores[i*NUMBER_OF_TESTS + 8].append(""); // spacer
+            myScores[i*NUMBER_OF_TESTS + 8].append(storage.openMultipleStores());
+            myScores[i*NUMBER_OF_TESTS + 9].append(storage.closeMultipleStores());
+            myScores[i*NUMBER_OF_TESTS + 10].append(storage.openCloseMultipleStores());
+            myScores[i*NUMBER_OF_TESTS + 11].append(""); // spacer
             storage.clean();
             System.out.println("loop done: "+i);
         }
--- a/javaextensions/midprms_db/tsrc/rmsbenchmark/javasrc/Storage.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/midprms_db/tsrc/rmsbenchmark/javasrc/Storage.java	Mon Oct 04 11:29:25 2010 +0300
@@ -25,6 +25,8 @@
     private int LENGTH;
 
     private RecordStore recordStore;
+    private String[] STORE_NAMES;
+
 
     public Storage(int aLength)
     {
@@ -32,6 +34,7 @@
         try
         {
             recordStore = RecordStore.openRecordStore(STORAGE_NAME, true);
+            createMultiStores();
         }
         catch (RecordStoreException _ex)
         {
@@ -40,12 +43,33 @@
         Utils.initRandom();
     }
 
+    private void createMultiStores() throws RecordStoreException
+    {
+        STORE_NAMES = new String[REPEAT];
+        // create stores
+        for(int i = 0; i < STORE_NAMES.length; i++)
+        {
+            STORE_NAMES[i] = "multistore" + i;
+            RecordStore r = RecordStore.openRecordStore(STORE_NAMES[i], true);
+            r.closeRecordStore();
+        }
+    }
+
+    private void deleteMultiStores() throws RecordStoreException
+    {
+        for(int i = 0; i < STORE_NAMES.length; i++)
+        {
+            RecordStore.deleteRecordStore(STORE_NAMES[i]);
+        }
+    }
+
     public void clean()
     {
         try
         {
             recordStore.closeRecordStore();
             RecordStore.deleteRecordStore(STORAGE_NAME);
+            deleteMultiStores();
         }
         catch (RecordStoreException _ex)
         {
@@ -330,4 +354,85 @@
         return score;
     }
 
+    public String openMultipleStores()
+    {
+        String score = "";
+        try
+        {
+            RecordStore[] stores = new RecordStore[STORE_NAMES.length];
+            // open stores
+            Utils.startTiming();
+            for (int i = 0; i < STORE_NAMES.length; i++)
+            {
+                stores[i] = RecordStore.openRecordStore(STORE_NAMES[i], false);
+            }
+            Utils.stopTiming();
+            score = Utils.getTime(Utils.getDiff());
+
+            // close stores
+            for (int i = 0; i < STORE_NAMES.length; i++)
+            {
+                stores[i].closeRecordStore();
+            }
+
+        }
+        catch (RecordStoreException _ex)
+        {
+            System.out.println("RecordStoreException: " + _ex.toString());
+        }
+        return score;
+    }
+
+    public String closeMultipleStores()
+    {
+        String score = "";
+        try
+        {
+            RecordStore[] stores = new RecordStore[STORE_NAMES.length];
+            // open stores
+            for (int i = 0; i < STORE_NAMES.length; i++)
+            {
+                stores[i] = RecordStore.openRecordStore(STORE_NAMES[i], false);
+            }
+
+            // close stores
+            Utils.startTiming();
+            for (int i = 0; i < STORE_NAMES.length; i++)
+            {
+                stores[i].closeRecordStore();
+            }
+            Utils.stopTiming();
+            score = Utils.getTime(Utils.getDiff());
+
+        }
+        catch (RecordStoreException _ex)
+        {
+            System.out.println("RecordStoreException: " + _ex.toString());
+        }
+        return score;
+    }
+
+    public String openCloseMultipleStores()
+    {
+        String score = "";
+        try
+        {
+            // open /close one store at a time
+            Utils.startTiming();
+            for (int i = 0; i < STORE_NAMES.length; i++)
+            {
+                RecordStore r = RecordStore.openRecordStore(STORE_NAMES[i], false);
+                r.closeRecordStore();
+            }
+            Utils.stopTiming();
+            score = Utils.getTime(Utils.getDiff());
+
+        }
+        catch (RecordStoreException _ex)
+        {
+            System.out.println("RecordStoreException: " + _ex.toString());
+        }
+        return score;
+    }
+
 }
--- a/javaextensions/mobinfo/build/build.xml	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/mobinfo/build/build.xml	Mon Oct 04 11:29:25 2010 +0300
@@ -47,6 +47,8 @@
         com.nokia.mid.dateformat=:mobinfo.MobileInfoProperties
         com.nokia.mid.timeformat=:mobinfo.MobileInfoProperties
         com.nokia.mid.networkstatus=:mobinfo.MobileInfoProperties
+        com.nokia.mid.spn=:mobinfo.MobileInfoProperties
+        com.nokia.mid.ons=:mobinfo.MobileInfoProperties
     </properties>
   </target>
 
--- a/javaextensions/mobinfo/build/javamobinfo.pro	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/mobinfo/build/javamobinfo.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -20,7 +20,8 @@
 CONFIG -= qt
 
 symbian {
-    LIBS += -leuser -letel -letelmm -lesock -lconnmon -lcommdb -lcommsdat -lcmmanager -ljavaconnectionmanager  
+    LIBS += -leuser -letel -letelmm -lesock -lconnmon -lcommdb -lcommsdat 
+    LIBS += -lcmmanager -ljavaconnectionmanager -lcentralrepository -letel3rdparty
 }
 
 include(../../../build/omj.pri)
--- a/javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoPermission.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoPermission.java	Mon Oct 04 11:29:25 2010 +0300
@@ -31,6 +31,8 @@
     private static final String COUNTRYCODE_TARGET_NAME = "mobinfo.countrycode";
     private static final String NETWORKID_TARGET_NAME = "mobinfo.networkid";
     private static final String PUBLIC_INFO_TARGET_NAME = "mobinfo.publicinfo";
+    private static final String ONS_TARGET_NAME = "mobinfo.ons";
+    private static final String SPN_TARGET_NAME = "mobinfo.spn";
 
     private String iTarget = null;
     private String iAction = null;
@@ -44,7 +46,9 @@
                 || CELLID_TARGET_NAME.equals(aUri)
                 || PUBLIC_INFO_TARGET_NAME.equals(aUri)
                 || COUNTRYCODE_TARGET_NAME.equals(aUri)
-                || NETWORKID_TARGET_NAME.equals(aUri))
+                || NETWORKID_TARGET_NAME.equals(aUri)
+                || SPN_TARGET_NAME.equals(aUri)
+                || ONS_TARGET_NAME.equals(aUri))
         {
             // aUri contains a known target name -> save it as such
             iTarget = aUri;
@@ -74,6 +78,14 @@
             {
                 iTarget = NETWORKID_TARGET_NAME;
             }
+            else if (MobileInfoProperties.SERVICE_PROVIDER_NAME.equals(aUri))
+            {
+                iTarget = SPN_TARGET_NAME;
+            }
+            else if (MobileInfoProperties.OPERATOR_NAME.equals(aUri))
+            {
+                iTarget = ONS_TARGET_NAME;
+            }
             else
             {
                 iTarget = PUBLIC_INFO_TARGET_NAME;
@@ -90,14 +102,22 @@
      */
     public String getSecurityPromptQuestion(int aInteractionMode)
     {
-        if (CELLID_TARGET_NAME.equals(iTarget) 
-            || COUNTRYCODE_TARGET_NAME.equals(iTarget) 
+        if (CELLID_TARGET_NAME.equals(iTarget)
+            || COUNTRYCODE_TARGET_NAME.equals(iTarget)
             || NETWORKID_TARGET_NAME.equals(iTarget))
         {
             return SecurityPromptMessage.getInstance().getText(
                 SecurityPromptMessage.QUESTION_ID_READING_LOCATION_DATA,
                 null);
         }
+        if (SPN_TARGET_NAME.equals(iTarget)
+            || ONS_TARGET_NAME.equals(iTarget))
+        {
+            return SecurityPromptMessage.getInstance().getText(
+                SecurityPromptMessage.QUESTION_ID_READING_USER_DATA,
+                null);
+        }
+
         return null;
     }
 
@@ -123,6 +143,14 @@
         {
             return "com.nokia.mid.Mobinfo.networkid";
         }
+        else if (SPN_TARGET_NAME.equals(iTarget))
+        {
+            return "com.nokia.mid.Mobinfo.SPN";
+        }
+        else if (ONS_TARGET_NAME.equals(iTarget))
+        {
+            return "com.nokia.mid.Mobinfo.ONS";
+        }
         return null;
     }
 
--- a/javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoProperties.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoProperties.java	Mon Oct 04 11:29: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"
@@ -77,6 +77,10 @@
 
     private static final String NETWORKSTATUS = "com.nokia.mid.networkstatus";
 
+    static final String SERVICE_PROVIDER_NAME = "com.nokia.mid.spn";
+
+    static final String OPERATOR_NAME = "com.nokia.mid.ons";
+
     private static final int APP_DEFAULT_APN_NOT_SPECIFIED = -1;
 
     // Constants associated with the strings
@@ -110,26 +114,32 @@
 
     private static final int NETWORKSTATUS_V = 15;
 
+    private static final int SERVICE_PROVIDER_NAME_V = 16;
+
+    private static final int OPERATOR_NAME_V = 17;
+
     private static Hashtable iPropertyKeys;
 
     static
     {
         iPropertyKeys = new Hashtable();
-        iPropertyKeys.put(NETWORK_ACCESS,       new Integer(NETWORK_ACCESS_V));
-        iPropertyKeys.put(BATTERY_LEVEL,        new Integer(BATTERY_LEVEL_V));
-        iPropertyKeys.put(COUNTRY_CODE,         new Integer(COUNTRY_CODE_V));
-        iPropertyKeys.put(IMEI,                 new Integer(IMEI_V));
-        iPropertyKeys.put(IMSI,                 new Integer(IMSI_V));
-        iPropertyKeys.put(NETWORK_AVAILABILITY, new Integer(NETWORK_AVAILABILITY_V));
-        iPropertyKeys.put(NETWORK_ID,           new Integer(NETWORK_ID_V));
-        iPropertyKeys.put(NETWORK_SIGNAL,       new Integer(NETWORK_SIGNAL_V));
+        iPropertyKeys.put(NETWORK_ACCESS,         new Integer(NETWORK_ACCESS_V));
+        iPropertyKeys.put(BATTERY_LEVEL,          new Integer(BATTERY_LEVEL_V));
+        iPropertyKeys.put(COUNTRY_CODE,           new Integer(COUNTRY_CODE_V));
+        iPropertyKeys.put(IMEI,                   new Integer(IMEI_V));
+        iPropertyKeys.put(IMSI,                   new Integer(IMSI_V));
+        iPropertyKeys.put(NETWORK_AVAILABILITY,   new Integer(NETWORK_AVAILABILITY_V));
+        iPropertyKeys.put(NETWORK_ID,             new Integer(NETWORK_ID_V));
+        iPropertyKeys.put(NETWORK_SIGNAL,         new Integer(NETWORK_SIGNAL_V));
         iPropertyKeys.put(EMAIL_RECIEVE_SETTINGS, new Integer(EMAIL_RECIEVE_SETTINGS_V));
-        iPropertyKeys.put(EMAIL_SEND_SETTINGS,  new Integer(EMAIL_SEND_SETTINGS_V));
-        iPropertyKeys.put(CELLID,               new Integer(CELLID_V));
-        iPropertyKeys.put(MSISDN,               new Integer(MSISDN_V));
-        iPropertyKeys.put(DATEFORMAT,           new Integer(DATEFORMAT_V));
-        iPropertyKeys.put(TIMEFORMAT,           new Integer(TIMEFORMAT_V));
-        iPropertyKeys.put(NETWORKSTATUS,        new Integer(NETWORKSTATUS_V));
+        iPropertyKeys.put(EMAIL_SEND_SETTINGS,    new Integer(EMAIL_SEND_SETTINGS_V));
+        iPropertyKeys.put(CELLID,                 new Integer(CELLID_V));
+        iPropertyKeys.put(MSISDN,                 new Integer(MSISDN_V));
+        iPropertyKeys.put(DATEFORMAT,             new Integer(DATEFORMAT_V));
+        iPropertyKeys.put(TIMEFORMAT,             new Integer(TIMEFORMAT_V));
+        iPropertyKeys.put(NETWORKSTATUS,          new Integer(NETWORKSTATUS_V));
+        iPropertyKeys.put(SERVICE_PROVIDER_NAME,  new Integer(SERVICE_PROVIDER_NAME_V));
+        iPropertyKeys.put(OPERATOR_NAME,          new Integer(OPERATOR_NAME_V));
     }
 
     public String getProperty(String aKey)
--- a/javaextensions/mobinfo/src.s60/javamobinfo.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/mobinfo/src.s60/javamobinfo.cpp	Mon Oct 04 11:29: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"
@@ -24,6 +24,9 @@
 #include <commdb.h>
 #include <rconnmon.h>
 
+#include <CoreApplicationUIsSDKCRKeys.h>
+#include <etel3rdparty.h>
+
 #include <cmmanager.h>
 #include <cmconnectionmethoddef.h>
 #include <cmpluginpacketdatadef.h>
@@ -71,9 +74,12 @@
 
 _LIT(KMSISDNSeparator, " "); // separator MSISDN numbers
 
+_LIT(KNameNotAvailable, "");
+
 const TInt KMaxPropertySize = 50;
 const TInt KJVMProcessUid = KJavaMidp;
 
+
 // ---------------------------------------------------------------------------
 //    forward declarations
 // ---------------------------------------------------------------------------
@@ -516,7 +522,7 @@
         }
         LOG(ESOCKET, EInfo, "MOBINFO  returning property NetworkStatus");
     }
-    else // NETWORK_AVAILABILITY
+    else if (aProperty == NETWORK_AVAILABILITY)
     {
         // Check NetworkAvailability related Caps
         TUint32 indCaps;
@@ -554,6 +560,74 @@
             }
         }
     }
+    else if (aProperty == OPERATOR_NAME)
+    {
+        // Get Service Provider Name
+        LOG(ESOCKET, EInfo, "MOBINFO  Getting Operator Name");
+
+        TUint32 networkCaps;
+        User::LeaveIfError(aMobilePhone.GetNetworkCaps(networkCaps));
+
+        // If the device is in 'offline' mode, the current network
+        // cannot be queried. Try to check the mode from cenrep.
+        TBool networkConnAllowed (ETrue);
+        CRepository* repository = CRepository::NewL(KCRUidCoreApplicationUIs);
+        // Ignore the return value
+        (void)repository->Get(KCoreAppUIsNetworkConnectionAllowed, networkConnAllowed);
+        delete repository;
+
+        if ((networkCaps & RMobilePhone::KCapsGetCurrentNetwork) && networkConnAllowed)
+        {
+            RMobilePhone::TMobilePhoneNetworkInfoV2 currInfo;
+            RMobilePhone::TMobilePhoneNetworkInfoV2Pckg currInfoPckg(currInfo);
+            RMobilePhone::TMobilePhoneLocationAreaV1 area;
+
+            TRequestStatus status;
+            aMobilePhone.GetCurrentNetwork(status, currInfoPckg, area);
+            User::WaitForRequest(status);
+            User::LeaveIfError(status.Int());
+
+            if (currInfo.iLongName.Length() > 0)
+            {
+                telephonyProperty = HBufC::NewL(currInfo.iLongName.Length() + 1);
+                telephonyProperty->Des().Append(currInfo.iLongName);
+            }
+            else if (currInfo.iDisplayTag.Length() > 0)
+            {
+                currInfo.iLongName = currInfo.iDisplayTag.Left( currInfo.iLongName.MaxLength() );
+                telephonyProperty = HBufC::NewL(currInfo.iLongName.Length() + 1);
+                telephonyProperty->Des().Append(currInfo.iLongName);
+            }
+        }
+    }
+    else if (aProperty == SERVICE_PROVIDER_NAME)
+    {
+        // Get Service Provider Name
+        LOG(ESOCKET, EInfo, "MOBINFO  Getting Service Provider Name");
+
+        RMobilePhone::TMobilePhoneServiceProviderNameV2 serviceProviderName;
+        RMobilePhone::TMobilePhoneServiceProviderNameV2Pckg
+            serviceProviderNamePckg( serviceProviderName );
+
+        TRequestStatus status;
+
+        aMobilePhone.GetServiceProviderName(status, serviceProviderNamePckg);
+        User::WaitForRequest(status);
+
+        // Operator name, service provider
+        if (serviceProviderName.iSPName.Length() > 0)
+        {
+            telephonyProperty = HBufC::NewL(serviceProviderName.iSPName.Length() + 1);
+            telephonyProperty->Des().Append(serviceProviderName.iSPName);
+        }
+        else
+        {
+            // API call failed or empty service provider name
+            telephonyProperty = HBufC::NewL(KNameNotAvailable().Length() + 1);
+            telephonyProperty->Des().Append(KNameNotAvailable);
+        }
+    }
+
 
     LOG(ESOCKET, EInfo, "MOBINFO  - GetNetworkPropertyL()");
     return telephonyProperty;
@@ -776,6 +850,8 @@
     case COUNTRY_CODE:
     case CELLID:
     case NETWORKSTATUS:
+    case SERVICE_PROVIDER_NAME:
+    case OPERATOR_NAME:
         telephonyProperty = GetNetworkPropertyL(mobilePhone, aProperty);
         break;
     }
--- a/javaextensions/mobinfo/src.s60/mobinfoconstants.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/mobinfo/src.s60/mobinfoconstants.h	Mon Oct 04 11:29:25 2010 +0300
@@ -51,5 +51,8 @@
 
 #define NETWORKSTATUS           com_nokia_mj_impl_properties_mobinfo_MobileInfoProperties_NETWORKSTATUS_V
 
+#define SERVICE_PROVIDER_NAME   com_nokia_mj_impl_properties_mobinfo_MobileInfoProperties_SERVICE_PROVIDER_NAME_V
+
+#define OPERATOR_NAME           com_nokia_mj_impl_properties_mobinfo_MobileInfoProperties_OPERATOR_NAME_V
 
 #endif // MOBINFOCONSTANTS_H
--- a/javaextensions/pim/javasrc.s60/com/nokia/mj/impl/pim/utils/NativeError.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/pim/javasrc.s60/com/nokia/mj/impl/pim/utils/NativeError.java	Mon Oct 04 11:29:25 2010 +0300
@@ -647,8 +647,6 @@
     public static void handleCreateCalendarError(int aNativeErrorCode, String aCalName) 
     throws PIMException
     {
-
-
         if (aNativeErrorCode == OsErrorMessage.SUCCESS)
         {
             return; // OK
@@ -670,7 +668,7 @@
         }
         case OsErrorMessage.KERR_ALREADY_EXISTS:
         {
-             throw new PIMException(ErrorString.CALENDAR_ALREADY_EXISTS, PIMException.GENERAL_ERROR);
+             throw new PIMException(ErrorString.CALENDAR_ALREADY_EXISTS, aNativeErrorCode);
         }
         default:
         {
@@ -679,7 +677,7 @@
         }
     }
 
-    public static void handleDeleteCalendarError(int aNativeErrorCode, String aCalName)
+    public static void handleDeleteCalendarError(int aNativeErrorCode, String aCalName) throws PIMException
     {
 
 
@@ -692,8 +690,7 @@
         {
         case OsErrorMessage.KERR_ACCESS_DENIED:
         {
-            throw new IllegalArgumentException(
-                "Deletion of calendar failed: phone default calendar cannot be deleted");
+            throw new PIMException("The default calendar cannot be deleted",  aNativeErrorCode);
         }
         case OsErrorMessage.KERR_ARGUMENT:
         {
--- a/javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMManager.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMManager.java	Mon Oct 04 11:29:25 2010 +0300
@@ -430,7 +430,7 @@
         NativeError.handleCreateCalendarError(error, aCalName);
     }
 
-    private synchronized void deleteCalendar(String aCalName)
+    private synchronized void deleteCalendar(String aCalName) throws PIMException
     {
         // security check
         ApplicationUtils appUtils = ApplicationUtils.getInstance();
@@ -464,12 +464,16 @@
                 break;
             }
         }
-        int error = _deleteCalendar(iManagerHandle, fileName);
-        NativeError.handleDeleteCalendarError(error, aCalName);
         if (isCalPresent)
         {
+            int error = _deleteCalendar(iManagerHandle, fileName);
+            NativeError.handleDeleteCalendarError(error, aCalName);        	
             iCalInfo.removeElementAt(index);
         }
+        else
+        {
+        	throw new PIMException("Can't delete specified calendar as calendar does not exist ", PIMException.LIST_NOT_ACCESSIBLE);
+        }
     }
 
     /**
--- a/javaextensions/subsystem.mk	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/subsystem.mk	Mon Oct 04 11:29:25 2010 +0300
@@ -20,22 +20,26 @@
 	iapinfo/build \
 	mobinfo/build \
 	comm/build \
-	globalindicators/build \
-	webservices/build \
 	satsa/build \
 	location/build \
 	sensor/build
 
+# Component webservices is needed only if the package hasn't been split
+ifndef RD_JAVA_PKG_SPLIT
+   COMPONENTS += webservices/build
+endif        	
+
 ifeq ($(UI),AVKON)
 # Broadcast stub is available for now only on AVKON environments (where also MMAPI exists)
 COMPONENTS += \
 	broadcast_stub/build
 endif
 
-SYMBIAN_ONLY = pim wma bluetooth satsa/build location/build sensor/build iapinfo/build mobinfo/build globalindicators/build comm/build broadcast_stub/build
+SYMBIAN_ONLY = pim wma bluetooth satsa/build location/build sensor/build iapinfo/build mobinfo/build comm/build broadcast_stub/build ccapi
 
 LINUX_ONLY =
 
+SKIP_IN_SF = ccapi
 
 SUBSYSTEMS = \
     midppush \
@@ -54,6 +58,17 @@
     COMPONENTS += midprms/build
 endif
 
+# Include old globalindicator only TB 9.2 and older releases
+ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
+    COMPONENTS += globalindicators/build
+    SYMBIAN_ONLY += globalindicators/build
+endif
+
+# Include CCAPI JSR 257 and CCAPI extensions only on 9.2 java PS2
+ifdef RD_JAVA_S60_RELEASE_9_2
+    SUBSYSTEMS += ccapi		                  
+endif
+
 # Declare that release preparation removes subdirectories not in build, except
 # listed special cases
 REMOVE_NOTBUILT_EXCLUDING = inc
--- a/javaextensions/webservices/build/build.xml	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-<!--
-#
-# Copyright (c) 2008-2009 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"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
--->
-
-<project name="javawebservices" default="deploy" basedir=".">
-  <description>
-    Builds WebServices API
-  </description>
-
-  <import file="../../../build/utilities.xml"/>
-
-  <!-- If there is no ../javasrc then this component is variated away from 
-       current release, and nothing is compiled. The component is kept so
-       that no other places need to be varied except the sources. -->
-  <available property="sources.exist" file="../javasrc" />
-  <target name="compile" if="sources.exist">
-    <omj.javac />
-  </target>
-
-  <!-- Needed by the utilities.xml. See the description form the utilities.xml
-       file -->
-
-  <target name="create.public.api.jar">
-      <omj.public.apis includes="
-          org/xml/sax/Attributes.class,
-          org/xml/sax/InputSource.class,
-          org/xml/sax/Locator.class,
-          org/xml/sax/SAXException.class,
-          org/xml/sax/SAXNotRecognizedException.class,
-          org/xml/sax/SAXNotSupportedException.class,
-          org/xml/sax/SAXParseException.class,
-          org/xml/sax/helpers/DefaultHandler.class,
-          java/rmi/MarshalException.class,
-          java/rmi/Remote.class,
-          java/rmi/RemoteException.class,
-          java/rmi/ServerException.class,
-          javax/xml/parsers/FactoryConfigurationError.class,
-          javax/xml/parsers/ParserConfigurationException.class,
-          javax/xml/parsers/SAXParser.class,
-          javax/xml/parsers/SAXParserFactory.class,
-          javax/xml/namespace/QName.class,
-          javax/xml/rpc/JAXRPCException.class,
-          javax/xml/rpc/NamespaceConstants.class,
-          javax/xml/rpc/Stub.class,
-          javax/microedition/xml/rpc/ComplexType.class,
-          javax/microedition/xml/rpc/Element.class,
-          javax/microedition/xml/rpc/FaultDetailException.class,
-          javax/microedition/xml/rpc/FaultDetailHandler.class,
-          javax/microedition/xml/rpc/Operation.class,
-          javax/microedition/xml/rpc/Type.class"/>
-  </target>
-
-  <target name="system.properties">
-    <properties>
-        xml.rpc.subset.version=1.0
-        xml.jaxp.subset.version=1.0
-    </properties>
-  </target>
-</project>
--- a/javaextensions/webservices/build/bwins/javawebservicesu.def	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *)
-
--- a/javaextensions/webservices/build/eabi/javawebservicesu.def	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
-	_Z10jni_lookupPKc @ 1 NONAME
-
--- a/javaextensions/webservices/build/javawebservices.pro	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#
-# Copyright (c) 2009 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"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-TEMPLATE=lib
-TARGET=javawebservices
-CONFIG += omj java javaonly stl
-CONFIG -= qt
-
-include(../../../build/omj.pri)
--- a/javaextensions/wma/mms/build/build.xml	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/mms/build/build.xml	Mon Oct 04 11:29:25 2010 +0300
@@ -27,7 +27,8 @@
        file -->
   <property name="javah.classnames" 
             value="com.nokia.mj.impl.mms.MMSConnectionImpl,
-                   com.nokia.mj.impl.mms.MmsPropertyRetriever"/>
+                   com.nokia.mj.impl.mms.MmsPropertyRetriever,
+                   com.nokia.mj.impl.mms.MMSInstallerPlugin"/>
 
 
   <target name="system.properties">
--- a/javaextensions/wma/mms/javasrc/com/nokia/mj/impl/gcf/protocol/mms/PushValidatorImpl.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/mms/javasrc/com/nokia/mj/impl/gcf/protocol/mms/PushValidatorImpl.java	Mon Oct 04 11:29: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"
@@ -18,6 +18,7 @@
 package com.nokia.mj.impl.gcf.protocol.mms;
 
 import java.lang.String;
+import java.io.IOException;
 import com.nokia.mj.impl.utils.Uid;
 import com.nokia.mj.impl.gcf.PushValidator;
 import com.nokia.mj.impl.mms.MMSPermissionImpl;
@@ -43,6 +44,7 @@
      */
     public void validate(String aUri, String aFilter, Uid aSuiteUid,
                          String aMidletName, boolean aIsStaticRegistration)
+                         throws IOException
     {
         if (!(aUri.startsWith(MMS_PREFIX)))
         {
@@ -67,6 +69,29 @@
             throw new IllegalArgumentException("Invalid Filter");
 
         }
+        Uid suiteUid = null;
+        String commsName = null;
+        if (aIsStaticRegistration)
+        {
+            suiteUid = aSuiteUid;
+            commsName = PushValidator.INSTALLER_COMMS;
+        }
+        else
+        {
+            commsName = PushValidator.RUNTIME_COMMS;
+        }
+        if (PushValidator.isRegisteredPushUriStartingWith(aUri, suiteUid,
+                commsName))
+        {
+            if (aIsStaticRegistration)
+            {
+                throw new IllegalArgumentException();
+            }
+            else
+            {
+                throw new IOException("connection already exists");
+            }
+        }
         ApplicationUtils appUtils = ApplicationUtils.getInstance();
         MMSPermissionImpl permission = new MMSPermissionImpl("mms://*","open");
         appUtils.checkPermission(permission);
--- a/javaextensions/wma/mms/javasrc/com/nokia/mj/impl/mms/MMSConnectionImpl.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/mms/javasrc/com/nokia/mj/impl/mms/MMSConnectionImpl.java	Mon Oct 04 11:29: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"
@@ -21,10 +21,14 @@
 import java.io.IOException;
 import java.io.InterruptedIOException;
 import javax.wireless.messaging.*;
+import java.lang.ref.WeakReference;
 
 import com.nokia.mj.impl.utils.Logger;
+import com.nokia.mj.impl.gcf.PushValidator;
+import com.nokia.mj.impl.rt.support.Finalizer;
 import com.nokia.mj.impl.mms.MmsPropertyRetriever;
 import com.nokia.mj.impl.rt.support.ShutdownListener;
+import com.nokia.mj.impl.rt.support.ApplicationInfo;
 import com.nokia.mj.impl.rt.support.ApplicationUtils;
 
 public final class MMSConnectionImpl implements MessageConnection
@@ -78,7 +82,10 @@
 
     // Application Id
     private String iAppID = null;
+    
+    private Finalizer iFinalizer;
 
+    private ShutdownListener iShutDownListener;
     // the listener used for messages receiving notifications
     private MessageListener iMessageListener;
 
@@ -90,6 +97,18 @@
         iUri = aUri;
         iState = INITIAL;
         iServerConnection = aServerConnection;
+        if (iServerConnection)
+        {
+            // Check if this url is push registered by other application 
+            // Get the insatnce of ApplicationInfo.
+            ApplicationInfo appInfo = ApplicationInfo.getInstance();
+            if (PushValidator.isRegisteredPushUriStartingWith(aUri, 
+                 appInfo.getSuiteUid(), PushValidator.RUNTIME_COMMS))
+            {
+                throw new IOException("Connection already exists");
+            }
+            iAppID = aUri.substring("mms://:".length());
+        }
         // create the native side peer
         iNativeHandle = _createPeer(iServerConnection, iUri);
         iReadLock = new Object();
@@ -98,30 +117,21 @@
         iMessageLock = new Object();
         iSendLock = new Object();
         // register for shutdown listening
-        setShutdownListener();
-        if (iServerConnection)
-        {
-            iAppID = aUri.substring("mms://:".length());
-        }
+        iShutDownListener = new MmsShutDownListener(this);
+        // register for finalization
+        iFinalizer = registerForFinalization();
         Logger.LOG(Logger.EWMA, Logger.EInfo,
                    "- MMSConnectionImpl::MMSConnectionImpl()");
     }
 
     /*
-    * This function registers this object for shutDown.
-    */
-    private void setShutdownListener()
+    * This function registers this object for Finalization.
+    */ 
+    public Finalizer registerForFinalization()
     {
-        Logger.LOG(Logger.EWMA, Logger.EInfo,
-                   "+ MMSConnectionImpl::setShutdownListener()");
-        // Get the insatnce of ApplicationUtils.
-        ApplicationUtils appUtils = ApplicationUtils.getInstance();
-
-        // Get the name of the application.
-        appUtils.addShutdownListener(new ShutdownListener()
+        return new Finalizer()
         {
-            //The method that gets called when Application is shutting down
-            public void shuttingDown()
+            public void finalizeImpl()
             {
                 try
                 {
@@ -133,9 +143,45 @@
                     Logger.LOG(Logger.EWMA, Logger.EInfo, e.toString());
                 }
             }
-        });
-        Logger.LOG(Logger.EWMA, Logger.EInfo,
-                   "- MMSConnectionImpl::setShutdownListener()");
+        };
+    }
+    
+    /*
+    * Registering for shutDown Listener.
+    */
+    private static class MmsShutDownListener implements ShutdownListener
+    {
+        private final WeakReference iImpl;
+
+        private MmsShutDownListener(MMSConnectionImpl impl)
+        {
+            // Get the instance of ApplicationUtils.
+            ApplicationUtils appUtils = ApplicationUtils.getInstance();
+            
+            // Add the listener.
+            appUtils.addShutdownListener(this);
+            
+            // Create weak reference to impl object.
+            iImpl = new WeakReference(impl);
+        }
+
+        public void shuttingDown()
+        {
+            // Get a strong reference to impl class if it is not yet GC'ed.
+            MMSConnectionImpl impl = (MMSConnectionImpl)iImpl.get();
+            if (impl != null)
+            {
+                try
+                {
+                    impl.close();
+                }
+                catch (IOException e)
+                {
+                    //Nothing to do, just ignore
+                    Logger.LOG(Logger.EWMA, Logger.EInfo, e.toString());
+                }
+            }
+        }
     }
 
     /**
@@ -197,6 +243,9 @@
                     iReadLock.notify();
                 }
                 _dispose(iNativeHandle);
+                // Remove the shutdown listener.
+                ApplicationUtils.getInstance().removeShutdownListener(
+                                                          iShutDownListener);
             }
         }
         Logger.LOG(Logger.EWMA, Logger.EInfo,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javaextensions/wma/mms/javasrc/com/nokia/mj/impl/mms/MMSInstallerPlugin.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.mj.impl.mms; 
+
+import com.nokia.mj.impl.utils.Logger;
+import com.nokia.mj.impl.rt.support.Jvm;
+import com.nokia.mj.impl.push.PushUtil;
+import com.nokia.mj.impl.push.PushUtil.PushRegInfo;
+import com.nokia.mj.impl.installer.jsrpluginnotifier.InstallerExtension;
+import com.nokia.mj.impl.installer.jsrpluginnotifier.InstallerExtensionInfo;
+
+public final class MMSInstallerPlugin implements InstallerExtension
+{
+    static
+    {
+        try
+        {
+            Jvm.loadSystemLibrary("javawmamms");
+        }
+        catch (Throwable Th)
+        {
+            Logger.ELOG(Logger.EWMA, "Loading WMA protocol failed", Th);
+        }
+    }
+  /**
+     * This method is called when installation has been done
+     * nearly completely (only committing changes is left).
+     * @param aInstallerExtensionInfo installation info
+     * @return true if installation can be finished
+     *              false if installation must be cancelled
+     */
+    public boolean install(InstallerExtensionInfo aInstallerExtensionInfo){
+        return true;
+    }
+
+    /**
+     * This method is called when uninstallation is starting
+     * (all information is still available in databases).
+     * @param aInstallerExtensionInfo uninstallation info
+     * @return true if uninstallation can be finished
+     *              false if uninstallation must be cancelled
+     */
+    public boolean uninstall(InstallerExtensionInfo aInstallerExtensionInfo){
+        PushRegInfo[] pushRegArray = PushUtil.getPushRegs(
+         aInstallerExtensionInfo.iStorageSession ,aInstallerExtensionInfo.iUid);
+         for(int i = 0;i < pushRegArray.length;i++)
+         {
+             String url =  pushRegArray[i].getUrl();
+             if (url.startsWith("mms://:"))
+             {
+                 int err = _unregisterFromMMSEngine(url.substring(7));
+                 if (0 != err)
+                    return false;
+             }
+         }
+         return true;
+    }
+
+    /**
+     * Called when installation has failed and will be rolled back.
+     * Called after install().
+     *
+     * @param aInstallerExtensionInfo installation info
+     */
+    public void rollbackInstall(InstallerExtensionInfo aInstallerExtensionInfo){
+    }
+
+    /**
+     * Called when uninstallation has failed and will be rolled back.
+     * Called after uninstall().
+     *
+     * @param aInstallerExtensionInfo installation info
+     */
+    public void rollbackUninstall(InstallerExtensionInfo aInstallerExtensionInfo){
+    }
+    
+    private native int _unregisterFromMMSEngine(String aUri);
+    
+}
\ No newline at end of file
--- a/javaextensions/wma/mms/pushplugin/inc/mmsserverconnection.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/mms/pushplugin/inc/mmsserverconnection.h	Mon Oct 04 11:29:25 2010 +0300
@@ -44,6 +44,10 @@
     }
 
     virtual void setOpen() = 0;
+    
+    virtual void setUnregister() =0;
+    
+    virtual void clearUnregister() =0;
 };
 
 }//end of namespace wma
--- a/javaextensions/wma/mms/pushplugin/inc/mmsserverconnectionfactory.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/mms/pushplugin/inc/mmsserverconnectionfactory.h	Mon Oct 04 11:29:25 2010 +0300
@@ -61,7 +61,11 @@
      * @return MmsServerConnectionFactory
      */
     OS_IMPORT static MmsServerConnectionFactory& getFactory();
-
+    void deletePushConnection(const std::wstring& aUri);
+    ServerConnection& createPushServerConn(const std::wstring& aUri,
+            const std::wstring& aFilter,
+            ConnectionListener* aListener,
+            PendingConnectionListener* aPendingConnListener);
 };
 
 #endif // MMSSERVERCONNECTIONFACTORY_H
--- a/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -38,7 +38,8 @@
 OS_EXPORT S60MmsServerConnection::S60MmsServerConnection(const wstring& aUri,
         const wstring& aFilter)
         :CActive(EPriorityStandard), mUri(aUri), mFilter(aFilter),
-        mActiveConnection(false), mIsAppLaunched(false),mListener(0)
+        mActiveConnection(false), mIsAppLaunched(false),mListener(0),
+		mUnregister(0)
 
 {
     JELOG2(EWMA);
@@ -69,6 +70,18 @@
         mUri, false);
 }
 
+void S60MmsServerConnection::setUnregister()
+{
+    LOG(EWMA, EInfo,"S60MmsServerConnection::setUnregister");
+    mUnregister = true;
+}
+
+void S60MmsServerConnection::clearUnregister()
+{
+    LOG(EWMA, EInfo, "S60MmsServerConnection::clearUnregister");
+    mUnregister = false;
+}
+
 OS_EXPORT void S60MmsServerConnection::open(ConnectionListener* aListener)
 {
     JELOG2(EWMA);
@@ -112,7 +125,11 @@
     mSession = CMsvSession::OpenSyncL(*this);
     mApplicationId = S60CommonUtils::wstringToDes(mAppId.c_str());
     TMsvId folderId;
-    mMmsApplicationAdapter->RegisterL(*mApplicationId, folderId);
+    TBool isRegistered = mMmsApplicationAdapter->RegisteredL(*mApplicationId);
+    if (!isRegistered)
+    { 
+       mMmsApplicationAdapter->RegisterL(*mApplicationId, folderId);
+    }
     TMsvId tmsvId = mMmsApplicationAdapter->FolderIdL(*mApplicationId);
     if (tmsvId != KErrNone)
     {
@@ -320,15 +337,20 @@
     }
     case ENotifyingClose:
     {
-        mClientEntry->RemoveObserver(*this);
-        if (mMmsApplicationAdapter)
-        {
-            mMmsApplicationAdapter->UnregisterL(*mApplicationId);
-            delete mMmsApplicationAdapter;
-            mMmsApplicationAdapter = NULL;
-        }
         if (mClientEntry)
         {
+           mClientEntry->RemoveObserver(*this);
+           if (mMmsApplicationAdapter)
+           {
+              if (mUnregister)
+              {
+                  LOG(EWMA, EInfo, "Unregistering");
+                  mMmsApplicationAdapter->UnregisterL(*mApplicationId);
+              }
+              delete mMmsApplicationAdapter;
+              mMmsApplicationAdapter = NULL;
+           }
+        
             delete mClientEntry;
             mClientEntry = NULL;
         }
--- a/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.h	Mon Oct 04 11:29:25 2010 +0300
@@ -92,6 +92,8 @@
      * @return
      */
     OS_IMPORT void setOpen();
+    void setUnregister();
+    void clearUnregister();
 private:
     //Constructor
     S60MmsServerConnection();
@@ -189,6 +191,7 @@
     bool mIsAppLaunched;
     //listener to be notified for incoming messages
     ConnectionListener* mListener;
+    bool mUnregister;
     // handle to monitor object
     java::util::Monitor* mOpenMonitor;
     // reference to application adapter
--- a/javaextensions/wma/mms/pushplugin/src/mmsserverconnectionfactory.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/mms/pushplugin/src/mmsserverconnectionfactory.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -90,6 +90,40 @@
     JELOG2(EWMA);
 }
 
+ServerConnection&
+MmsServerConnectionFactory::createPushServerConn(const std::wstring& aUri,
+        const std::wstring& aFilter,
+        ConnectionListener* aListener,
+        PendingConnectionListener* aPendingConnListener)
+{
+    JELOG2(EWMA);
+    ScopedLock lockObj(mMutex);
+
+    SrvConnContainerIter_t iter = mServerConnections.find(aUri);
+    if (iter != mServerConnections.end())
+    {
+        if ((SrvConnContainerData::NORMAL == iter->second.connType()))
+        {
+            LOG(EWMA,EInfo,"Clearing Unregister flag");
+            MmsServerConnection* serverConn = 0;
+            serverConn = reinterpret_cast<MmsServerConnection*>(iter->second.getConn());
+            serverConn->clearUnregister();
+        }
+    }
+    return ServerConnectionFactoryBase::createPushServerConn(aUri,aFilter,
+                                           aListener,aPendingConnListener);
+}
+
+void MmsServerConnectionFactory::deletePushConnection(const std::wstring& aUri)
+{
+    JELOG2(EWMA);
+    LOG1(EWMA,EInfo,"MmsServerConnection on ID %S", aUri.c_str());
+    MmsServerConnection* serverConn = 0;
+    serverConn = reinterpret_cast<MmsServerConnection*>(getPushConnection(aUri));
+    if (0 != serverConn)
+       serverConn->setUnregister();
+    ServerConnectionFactoryBase::deletePushConnection(aUri);
+}
 /**
  *
  */
--- a/javaextensions/wma/mms/src.s60/cjavammsmessagehandler.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/mms/src.s60/cjavammsmessagehandler.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -42,7 +42,7 @@
 const TInt KToFieldIndex = 4;
 const TInt KBccFieldIndex = 5;
 const TInt KCcFieldIndex = 6;
-const TInt KBufFlatGranularity = 10;
+const TInt KBufFlatGranularity = 20;
 
 // ============================ MEMBER FUNCTIONS ===============================
 
--- a/javaextensions/wma/mms/src.s60/cmmsplatformservices60impl.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/mms/src.s60/cmmsplatformservices60impl.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -26,7 +26,8 @@
 #include "s60commonutils.h"
 #include "cmmsmessageattachment.h"
 #include "cmmsplatformservices60impl.h"
-
+#include "mmsserverconnection.h"
+#include "mmsserverconnectionfactory.h"
 //constants
 const TInt KMaxAppIDLength = 34;
 
@@ -1269,10 +1270,19 @@
             delete mReceivedMsgArray;
             mReceivedMsgArray = NULL;
         }
-        // Unregistering from MMS Engine.
-        LOG(EWMA, EInfo , "CMMSPlatformServiceS60Impl::Close() Unregistering"
-            "from MMS Engine");
-        mMmsApplicationAdapter->UnregisterL(*mServerApplicationId);
+        ServerConnectionFactory* serverConnectionFactory = 0;
+        ServerConnection* serverConn = 0;
+        serverConnectionFactory = &MmsServerConnectionFactory::getFactory();
+        std::wstring Uri(L"mms://:");
+        Uri += std::wstring((wchar_t*)mServerApplicationId->Ptr(),mServerApplicationId->Length());
+        serverConn = serverConnectionFactory->getPushConnection(Uri);
+        if (0 == serverConn)
+        {
+           // Unregistering from MMS Engine.
+           LOG(EWMA, EInfo , "CMMSPlatformServiceS60Impl::Close() Unregistering"
+               "from MMS Engine");
+           mMmsApplicationAdapter->UnregisterL(*mServerApplicationId);
+        }
         if (mServerApplicationId)
         {
             delete mServerApplicationId;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javaextensions/wma/mms/src.s60/mmsinstallerpluginjni.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  ?Description
+*
+*/
+
+
+#include "logger.h"
+#include "jstringutils.h"
+#include <mmsapplicationadapter.h>
+#include "com_nokia_mj_impl_mms_MMSInstallerPlugin.h"
+
+//using namespace java::wma;
+
+/*
+ * Class:     com_nokia_mj_impl_mms_MMSInstallerPlugin
+ * Method:    _markForUnregister
+ * Signature: (Ljava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_mms_MMSInstallerPlugin__1unregisterFromMMSEngine
+(JNIEnv* aJni, jobject /*aPeer*/, jstring aUri)
+{
+    JELOG2(EWMA);
+    TRAPD(Error,
+    {
+       CActiveScheduler* activeScheduler = new(ELeave) CActiveScheduler();
+       CleanupStack::PushL(activeScheduler);
+       CActiveScheduler::Install(activeScheduler);
+       CMmsApplicationAdapter* mmsApplicationAdapter = CMmsApplicationAdapter::NewL();
+       CleanupStack::PushL(mmsApplicationAdapter);
+       JStringUtils applicationId(*aJni,aUri);
+       LOG1(EWMA,EInfo,"_markForUnregister - ApplicationId = %S",applicationId.Ptr());
+       TBool isRegistered = mmsApplicationAdapter->RegisteredL(applicationId);
+       if (isRegistered)
+       { 
+          LOG(EWMA,EInfo,"Unregistering from MMSEngine");
+          mmsApplicationAdapter->UnregisterL(applicationId);
+       }
+       CleanupStack::PopAndDestroy(mmsApplicationAdapter);
+       CleanupStack::PopAndDestroy(activeScheduler);
+    });
+    LOG1(EWMA,EInfo,"Unregistering status : %d",Error);
+    return Error;
+}
--- a/javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/sms/SMSConnectionImpl.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/sms/SMSConnectionImpl.java	Mon Oct 04 11:29: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"
@@ -28,7 +28,7 @@
 
 import com.nokia.mj.impl.utils.Logger;
 import com.nokia.mj.impl.smscbs.utils.WmaUrl;
-import com.nokia.mj.impl.rt.support.ShutdownListener;
+import com.nokia.mj.impl.rt.support.Finalizer;
 import com.nokia.mj.impl.rt.support.ApplicationUtils;
 /**
  * The SMSConnectionImpl used for sending and receiving Binary/Text Messages. It
@@ -96,6 +96,8 @@
     private MessageListener iMessageListener;
 
     private WmaUrl iUri;
+    
+    private Finalizer iFinalizer;
 
     public SMSConnectionImpl(WmaUrl aMsgUri, boolean aServerMode)
     throws IOException
@@ -113,41 +115,34 @@
         iCloseLock = new Object();
         iMessageLock = new Object();
         iSendLock = new Object();
-        //register for shutdown listening
-        setShutdownListener();
+        //register for Finalization
+        iFinalizer = registerForFinalization();
         Logger.LOG(Logger.EWMA, Logger.EInfo,
                    "- SMSConnectionImpl::SMSConnectionImpl");
     }
 
     /*
-     * This function registers this object for shutDown.
+     * This function registers for Finalization.
      */
-    private void setShutdownListener()
+
+
+    public Finalizer registerForFinalization()
     {
-        Logger.LOG(Logger.EWMA, Logger.EInfo,
-                   "+ SMSConnectionImpl::setShutdownListener");
-        // Get the insatnce of ApplicationUtils.
-        ApplicationUtils appUtils = ApplicationUtils.getInstance();
-
-        // Get the name of the application.
-        appUtils.addShutdownListener(new ShutdownListener()
+        return new Finalizer()
         {
-            //The method that gets called when Application is shutting down
-            public void shuttingDown()
+            public void finalizeImpl()
             {
                 try
                 {
                     close();
                 }
-                catch (IOException ex)
+                catch (IOException e)
                 {
                     //Nothing to do, just ignore
-                    Logger.ELOG(Logger.EWMA, ex.toString(), ex);
+                    Logger.LOG(Logger.EWMA, Logger.EInfo, e.toString());
                 }
             }
-        });
-        Logger.LOG(Logger.EWMA, Logger.EInfo,
-                   "- SMSConnectionImpl::setShutdownListener");
+        };
     }
 
     /**
--- a/javaextensions/wma/sms_cbs/pushplugin/cbs/src.s60/cbsserverconnection.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/sms_cbs/pushplugin/cbs/src.s60/cbsserverconnection.cpp	Mon Oct 04 11:29: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"
@@ -61,7 +61,6 @@
 OS_EXPORT CbsServerConnection::~CbsServerConnection()
 {
     JELOG2(EWMA);
-    removeDir(mMessageStoreDirName);
 }
 
 void CbsServerConnection::initializeL()
@@ -192,7 +191,8 @@
         const java::runtime::ApplicationInfo& appInf =
             java::runtime::ApplicationInfo::getInstance();
         const std::wstring& root = appInf.getRootPath();
-        error = createMessageStore(root + CBS_STORE_PATH);
+        // At this point mIsAppLaunched will be true if it not push connection.
+        error = createMessageStore(root + CBS_STORE_PATH, mIsAppLaunched);
         if (error != KErrNone)
         {
             ELOG1(EWMA,"CBS : create message store failed : %d",error);
@@ -214,12 +214,6 @@
         }
 
         mOpenMonitor->wait();
-        // If there are any messages already available in the message store
-        // notify the listener
-        if (mMessagesOnStore > 0)
-        {
-            mListener->msgArrived();
-        }
         mIsListening = true;
     }
 }
@@ -319,7 +313,7 @@
         readStream.close();
         return KErrGeneral;
     }
-    catch (ExceptionBase ex)
+    catch (ExceptionBase &ex)
     {
         delete[] messagePath;
         return KErrGeneral;
@@ -697,7 +691,7 @@
         writeStream.close();
         User::Leave(KErrGeneral);
     }
-    catch (ExceptionBase ex)
+    catch (ExceptionBase &ex)
     {
         User::Leave(KErrGeneral);
     }
--- a/javaextensions/wma/sms_cbs/pushplugin/inc/serverconnectionbase.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/sms_cbs/pushplugin/inc/serverconnectionbase.h	Mon Oct 04 11:29: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"
@@ -109,7 +109,7 @@
      * @param path:the message store path
      * @returns SUCCESS or FAILURE
      */
-    int createMessageStore(std::wstring aPath);
+    int createMessageStore(std::wstring aPath, bool aDeleteStore);
 
     /**
      * Removes the directory specified.
--- a/javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp	Mon Oct 04 11:29: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"
@@ -64,9 +64,7 @@
 OS_EXPORT SmsServerConnection::~SmsServerConnection()
 {
     JELOG2(EWMA);
-    // As per internal spec the message store should be removed only when
-    // Application is uninstalled / UnRegistered from push
-    removeDir(mMessageStoreDirName);
+
     delete mMessage;
     delete mFilterDes;
     delete mOpenMonitor;
@@ -148,7 +146,9 @@
                     java::runtime::ApplicationInfo::getInstance();
                 const std::wstring& root = appInf.getRootPath();
                 LOG1(EWMA, EInfo,"SMS Store path %S",root.c_str());
-                error = createMessageStore(root + SMS_STORE_PATH);
+                // At this point mIsAppLaunched will be true if it not
+                // push connection.
+                error = createMessageStore(root + SMS_STORE_PATH , mIsAppLaunched);
                 mState = EReceivingMessageForNotify;
                 if (KErrNone == error)
                 {
@@ -165,10 +165,6 @@
                                 __FUNCTION__,__LINE__);
         }
         mOpenMonitor->wait();
-        if (mMessagesOnStore > 0)
-        {
-            mListener->msgArrived();
-        }
         mIsListening = true;
     }
 }
@@ -374,7 +370,7 @@
         readStream.close();
         return KErrGeneral;
     }
-    catch (ExceptionBase ex)
+    catch (ExceptionBase &ex)
     {
         delete[] messagePath;
         return KErrGeneral;
@@ -455,7 +451,7 @@
             writeStream.close();
             User::Leave(KErrGeneral);
         }
-        catch (ExceptionBase ex)
+        catch (ExceptionBase &ex)
         {
             User::Leave(KErrGeneral);
         }
--- a/javaextensions/wma/sms_cbs/pushplugin/src/serverconnectionbase.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/sms_cbs/pushplugin/src/serverconnectionbase.cpp	Mon Oct 04 11:29: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"
@@ -82,19 +82,21 @@
     return mMessagesOnStore;
 }
 
-int ServerConnectionBase::createMessageStore(std::wstring aDirectoryPath)
+int ServerConnectionBase::createMessageStore(std::wstring aDirectoryPath, bool aDeleteStore)
 {
     JELOG2(EWMA);
     aDirectoryPath += JavaCommonUtils::intToWstring(mPort);
-    aDirectoryPath +=L"\\" ;
-    mMessageStoreDirName = aDirectoryPath;
+    // If not push connection delete the message store.
+    if (aDeleteStore)
+       removeDir(aDirectoryPath);
+    mMessageStoreDirName = aDirectoryPath + L"\\";
     LOG1(EWMA, EInfo , " Creating message store in path %S",
          mMessageStoreDirName.c_str());
     // See if directory is present
-    if (FileUtilities::isDirectory(mMessageStoreDirName))
+    if (FileUtilities::isDirectory(aDirectoryPath))
     {
         std::list<std::wstring> dirList = FileUtilities::getDirContentsList
-                                          (mMessageStoreDirName);
+                                          (aDirectoryPath);
         mMessagesOnStore = dirList.size();
         if (mMessagesOnStore> 0)
         {
@@ -138,7 +140,7 @@
         {
            dirName = JavaCommonUtils::wstringToUtf8(path);
         }
-        catch (ExceptionBase ex)
+        catch (ExceptionBase &ex)
         {
            delete[] stringToTokenize;
            return -1;
@@ -198,7 +200,7 @@
         {
             for (it = dirList.begin(); it != dirList.end(); it++)
             {
-                std::wstring element(aDirPath);
+                std::wstring element(aDirPath + L"\\");
                 element += *it;
                 char *fileName = JavaCommonUtils::wstringToUtf8(element);
                 if ((error = remove(fileName)) != 0)
@@ -219,7 +221,7 @@
         }
         delete[] path;
     }
-    catch (ExceptionBase ex)
+    catch (ExceptionBase &ex)
     {
         delete[] path;
         ELOG(EWMA,"WMA : Cought an exception while removing Dir");
--- a/javaextensions/wma/sms_cbs/src.s60/csmsplatformservices60impl.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/sms_cbs/src.s60/csmsplatformservices60impl.cpp	Mon Oct 04 11:29: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"
@@ -48,6 +48,7 @@
     {
         mSmsSendSocket.CancelAll();
         mSmsSendSocket.Close();
+        mSocketServer.Close();
         delete mSendMessage;
     }
     delete mMessageParameters;
--- a/javaextensions/wma/sms_cbs/src/smsconnectionimpljni.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javaextensions/wma/sms_cbs/src/smsconnectionimpljni.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -68,7 +68,7 @@
         JniUtils::throwNewException(aJni, "java/lang/OutOfMemoryError" ,
                                     "Out of memory");
     }
-    catch (ExceptionBase ex)
+    catch (ExceptionBase &ex)
     {
         ELOG(EWMA,"WMA : Caught an ExceptionBase exception");
         JniUtils::throwNewException(aJni, "java/io/IOException" ,
@@ -136,7 +136,7 @@
         numberOfSegments = msgConn->numberOfDataSegments(aType,len,hostPort,
                            hostaddress,messageData);
     }
-    catch (ExceptionBase ex)
+    catch (ExceptionBase &ex)
     {
         JniUtils::throwNewException(aJni, "java/lang/RuntimeException" ,
                                     "Calculating number of segments failed");
@@ -187,7 +187,7 @@
         numberOfSegments = msgConn->numberOfDataSegments(aType,length,hostPort,
                            hostaddress,(const char*)nativeString);
     }
-    catch (ExceptionBase ex)
+    catch (ExceptionBase &ex)
     {
         JniUtils::throwNewException(aJni, "java/lang/RuntimeException" ,
                                     "Calculating number of segments failed");
--- a/javamanager/debugapi/build/debugapi.pro	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#
-# Copyright (c) 2009 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"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-TEMPLATE=lib
-TARGET=javadebugapi
-
-CONFIG += omj stl
-CONFIG -= qt
-LIBS += -ljavacomms
-
-include(../../../build/omj.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/debugapi/build/javadebugapi.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2009 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"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE=lib
+TARGET=javadebugapi
+
+CONFIG += omj stl
+CONFIG -= qt
+LIBS += -ljavacomms
+
+include(../../../build/omj.pri)
--- a/javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -71,6 +71,7 @@
     // when the device boots
     mCore->loadExtensionPlugin("preinstallerstarter");
     mCore->loadExtensionPlugin("btdeviceclassmanager");
+    mCore->loadExtensionPlugin("javasoftnoteplugin");
 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
     mCore->loadExtensionPlugin("scrupdater");
 #endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
--- a/javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore.pro	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-#
-# Copyright (c) 2009 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"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-TEMPLATE=lib
-TARGET=javacaptain_ext_ondemand_7
-CONFIG += omj stl
-CONFIG -= qt
-
-LIBS += -ljavacomms
-
-symbian {
-    SOURCES += ../src/*.cpp ../src.s60/*.cpp
-    LIBS += -lctframework \
-            -lctfinder \
-            -lefsrv \
-            -llibcrypto \
-            -lwimclient
-}
-
-!symbian {
-    SOURCES += ../src/*.cpp ../src.linux/*.cpp
-}
-
-include(../../../../../build/omj.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_ondemand_7.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2009 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"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE=lib
+TARGET=javacaptain_ext_ondemand_7
+CONFIG += omj stl
+CONFIG -= qt
+
+LIBS += -ljavacomms
+
+symbian {
+    SOURCES += ../src/*.cpp ../src.s60/*.cpp
+    LIBS += -lctframework \
+            -lctfinder \
+            -lefsrv \
+            -llibcrypto \
+            -lwimclient
+}
+
+!symbian {
+    SOURCES += ../src/*.cpp ../src.linux/*.cpp
+}
+
+include(../../../../../build/omj.pri)
--- a/javamanager/javacaptain/javacaptain.pro	Fri Sep 17 16:44:34 2010 +0300
+++ b/javamanager/javacaptain/javacaptain.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -16,7 +16,7 @@
 TEMPLATE = subdirs
 SUBDIRS += build/javacaptain.pro 
 SUBDIRS += extensionplugins/config/build/javacaptain_ext_config.pro 
-SUBDIRS += extensionplugins/javacertstore/build/javacaptain_ext_javacertstore.pro 
+SUBDIRS += extensionplugins/javacertstore/build/javacaptain_ext_ondemand_7.pro 
 SUBDIRS += extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin.pro 
 SUBDIRS += extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro 
 SUBDIRS += extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter.pro 
Binary file javamanager/javainstaller/installer/conf/javainstaller.confml has changed
--- a/javamanager/javainstaller/installer/data/inst_plugins.cfg	Fri Sep 17 16:44:34 2010 +0300
+++ b/javamanager/javainstaller/installer/data/inst_plugins.cfg	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,1 @@
+com.nokia.mj.impl.mms.MMSInstallerPlugin
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckDiskSpace.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckDiskSpace.java	Mon Oct 04 11:29:25 2010 +0300
@@ -132,7 +132,7 @@
     /**
      * Chooses the default installation drive from given DriveInfo vector.
      * Default installation drive is the first INTERNAL_MASS_STORAGE,
-     * PHONE_MEMORY or MEMORY_CARD drive that has enough free space for
+     * MEMORY_CARD or PHONE_MEMORY drive that has enough free space for
      * the application.
      * @param aDrives DriveInfo objects.
      * @param aSizeInBytes application size.
@@ -170,10 +170,10 @@
 
     /**
      * Sorts DriveInfos in given vector to drive priority order.
-     * Priority order for the drives is USER_CHOSEN, INTERNAL_MASS_STORAGE,
-     * PHONE_MEMORY, MEMORY_CARD. If there is more than one drive
-     * of the same type, the ones which have more free space have
-     * higher priority.
+     * Priority order for the drives is CONFIGURED_DEFAULT,
+     * INTERNAL_MASS_STORAGE, MEMORY_CARD, PHONE_MEMORY.
+     * If there is more than one drive of the same type,
+     * the ones which have more free space have higher priority.
      */
     private static void sortDrives(Vector aDrives)
     {
@@ -192,14 +192,14 @@
                 }
             }
         }
-        // Move user chosen drive to be the first.
-        int userChosen = getUserChosenDrive();
-        if (userChosen != -1)
+        // Move the configured default installation drive to be the first.
+        int configuredDefault = getConfiguredDefaultDrive();
+        if (configuredDefault != -1)
         {
             for (int i = 0; i < aDrives.size(); i++)
             {
                 DriveInfo d = (DriveInfo)aDrives.elementAt(i);
-                if (d.getNumber() == userChosen)
+                if (d.getNumber() == configuredDefault)
                 {
                     aDrives.removeElementAt(i);
                     aDrives.insertElementAt(d, 0);
@@ -226,10 +226,10 @@
     }
 
     /**
-     * Returns the installation drive the user has chosen last.
-     * If user selection is not available, returns -1.
+     * Returns the configured default installation drive.
+     * If it is not available, returns -1.
      */
-    private static int getUserChosenDrive()
+    private static int getConfiguredDefaultDrive()
     {
         int result = -1;
         try
@@ -244,9 +244,9 @@
         }
         catch (Throwable t)
         {
-            Log.log("Getting user chosen drive from repository failed", t);
+            Log.log("Getting default installation drive from repository failed", t);
         }
-        Log.log("Last user chosen drive from repository: " + result);
+        Log.log("Default installation drive from repository: " + result);
         return result;
     }
 
@@ -276,16 +276,16 @@
         }
         if (!result &&
                 type1 != DriveInfo.INTERNAL_MASS_STORAGE &&
-                type1 != DriveInfo.PHONE_MEMORY &&
-                type2 == DriveInfo.PHONE_MEMORY)
+                type1 != DriveInfo.MEMORY_CARD &&
+                type2 == DriveInfo.MEMORY_CARD)
         {
             result = true;
         }
         if (!result &&
                 type1 != DriveInfo.INTERNAL_MASS_STORAGE &&
+                type1 != DriveInfo.MEMORY_CARD &&
                 type1 != DriveInfo.PHONE_MEMORY &&
-                type1 != DriveInfo.MEMORY_CARD &&
-                type2 == DriveInfo.MEMORY_CARD)
+                type2 == DriveInfo.PHONE_MEMORY)
         {
             result = true;
         }
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConfirmInstallation.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConfirmInstallation.java	Mon Oct 04 11:29:25 2010 +0300
@@ -211,7 +211,6 @@
 
         // Now that user has answered to confirmation dialog, take into
         // use user selections: driveId and retainData.
-        int oldInstallationDrive = ball.iInstallationDrive;
         ball.iInstallationDrive = installInfo.getDriveId();
         if (ball.iUpgradeData == null)
         {
@@ -221,23 +220,6 @@
         Log.log("UserConfirmation: " + ball.iUserConfirmation);
         Log.log("InstallationDrive: " + ball.iInstallationDrive);
         Log.log("UpgradeData: " + ball.iUpgradeData);
-        if (oldInstallationDrive != ball.iInstallationDrive)
-        {
-            try
-            {
-                // Save user selection.
-                SysUtil.setRepositoryStringValue(
-                    SysUtil.REPO_ID_JAVA_INST_VARIATION,
-                    SysUtil.REPO_KEY_JAVA_INST_DEF_INST_DRIVE,
-                    FileUtils.getDriveName(ball.iInstallationDrive));
-                Log.log("Updated user chosen drive to repository: " +
-                        ball.iInstallationDrive);
-            }
-            catch (Throwable t)
-            {
-                Log.log("Updating user chosen drive to repository failed", t);
-            }
-        }
 
         // Log all suite info.
         //ball.log(ball.iSuite.toString());
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java	Mon Oct 04 11:29:25 2010 +0300
@@ -169,6 +169,7 @@
             display.setAppName(""); // Remove display title.
             iCssEngine = new BaseCSSEngine(display);
             iParent = new Shell(display);
+            iParent.open(); // remove this line after Qt can display child Shells even when parent Shell is not open
             iDialog = new Shell(iParent, SHELL_STYLE);
             iDefaultShellBounds = iDialog.internal_getDefaultBounds();
             iDefaultShellClientBounds = iDialog.getClientArea();
--- a/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -1173,14 +1173,6 @@
                         "ErrCode err %d", err);
                 }
 
-                TRAP(err, aResults.AddIntL(KSifOutParam_ExtendedErrCode, 0));
-                if (KErrNone != err)
-                {
-                    ELOG1(EJavaInstaller,
-                        "CJavaSifPlugin::ExitIfJavaInstallerRunning aResults.AddIntL "
-                        "ExtendedErrCode err %d", err);
-                }
-
                 // TODO: return also localized error message from usif
                 // common localization file after the localized strings are available
 
--- a/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -65,13 +65,6 @@
             "ResultsServer::start mResults.AddIntL ErrCode err %d", err);
     }
 
-    TRAP(err, mResults.AddIntL(KSifOutParam_ExtendedErrCode, 0));
-    if (KErrNone != err)
-    {
-        ELOG1(EJavaInstaller,
-            "ResultsServer::start mResults.AddIntL ExtendedErrCode err %d", err);
-    }
-
     // TODO: return also localized error message (KSifOutParam_ErrMessage and
     // perhaps also KSifOutParam_ErrMessageDetails) from usif
     // common localization file after the localized strings are available
--- a/javamanager/javamanager.pro	Fri Sep 17 16:44:34 2010 +0300
+++ b/javamanager/javamanager.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -15,7 +15,7 @@
 #
 TEMPLATE = subdirs
 SUBDIRS += preinstaller/build/javapreinstaller.pro 
-SUBDIRS += debugapi/build/debugapi.pro 
+SUBDIRS += debugapi/build/javadebugapi.pro 
 SUBDIRS += javalauncher/build/javalauncher.pro 
 SUBDIRS += javaupgradeapp/build/javaupgradeapp.pro 
 SUBDIRS += javaappscheme/build/javaappscheme.pro 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javaregistry/legacy/server/build/javaregistry.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,39 @@
+#
+# Copyright (c) 2009 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"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE=app
+TARGET=javaregistry
+CONFIG += omj no_icon stl
+CONFIG -= qt
+
+
+symbian {
+    INCLUDEPATH += ../inc \
+                   ../inc/FromLegacy \
+                   ../../../client/inc \
+                   ../../../inc \
+                   ../../../util/inc
+
+    SOURCES += ../src/*.cpp
+    TARGET.UID2 = 0x1000008d
+    TARGET.UID3 = 0x10282475
+    TARGET.CAPABILITY = ProtServ
+
+    LIBS += -ljavaregistryclient -lefsrv -lestor -ljavastorage -ljavafileutils
+}
+
+
+include(../../../../../build/omj.pri)
--- a/javamanager/javaregistry/legacy/server/build/javaregistryserver.pro	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-#
-# Copyright (c) 2009 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"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description: 
-#
-
-TEMPLATE=app
-TARGET=javaregistry
-CONFIG += omj no_icon stl
-CONFIG -= qt
-
-
-symbian {
-    INCLUDEPATH += ../inc \
-                   ../inc/FromLegacy \
-                   ../../../client/inc \
-                   ../../../inc \
-                   ../../../util/inc
-
-    SOURCES += ../src/*.cpp
-    TARGET.UID2 = 0x1000008d
-    TARGET.UID3 = 0x10282475
-    TARGET.CAPABILITY = ProtServ
-
-    LIBS += -ljavaregistryclient -lefsrv -lestor -ljavastorage -ljavafileutils
-}
-
-
-include(../../../../../build/omj.pri)
--- a/javamanager/javasettings_qt/src/javaapplicationsettingsview_p.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javamanager/javasettings_qt/src/javaapplicationsettingsview_p.h	Mon Oct 04 11:29:25 2010 +0300
@@ -57,8 +57,8 @@
 const char* const ID_NETWORK_CONNECTION = "txt_occ_title_network_connection";
 const char* const ID_SETTINGS_TITLE = "txt_java_sett_title_settings";
 const char* const ID_SETTINGS_NOT_AVAILABLE = "txt_java_sett_info_settings_not_available";
-const char* const ID_GENERAL_GROUP_TITLE = "txt_java_sett_subtitle_general";
-const char* const ID_SECURITY_GROUP_TITLE = "txt_java_sett_subtitle_security";
+const char* const ID_GENERAL_GROUP_TITLE = "txt_java_sett_subhead_general";
+const char* const ID_SECURITY_GROUP_TITLE = "txt_java_sett_subhead_security";
 const char* const ID_OSK_NO = "txt_java_sett_setlabel_osk_val_no";
 const char* const ID_OSK_GAME = "txt_java_sett_setlabel_osk_val_game";
 const char* const ID_OSK_NAVIGATION = "txt_java_sett_setlabel_osk_val_navigation";
--- a/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/ApplicationUI.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Nokia Corporation - initial implementation
- *******************************************************************************/
-
-package org.eclipse.swt.internal.extension;
-
-import org.eclipse.swt.internal.qt.UIThreadManager;
-
-/**
- * A class that provides services for transferring the control over the
- * execution of the UI thread to the application, and services for obtaining
- * notifications of the state of the UI until the UI thread will return back to the
- * caller.
- * 
- * @see InternalUI
- * @see ApplicationUIListener
- */
-public final class ApplicationUI {
-	
-	/**
-	 * Hand over the execution of the UI thread to the application. If the
-	 * application has not yet requested the UI thread then it will be waiting
-	 * until that happens. The waiting can be aborted by calling
-	 * <code>abortWait()</code>.
-	 * 
-	 * The control of the thread will be passed to the application. If the
-	 * application allows the UI thread to return then this method will also
-	 * return.
-	 * 
-	 * After calling this method and before the method has returned the state of
-	 * the UI thread can be tracked by setting an
-	 * <code>ApplicationUIListener</code>.
-	 */
-	public static void run() {
-		UIThreadManager.runApplicationUI();
-	}
-	
-	/**
-	 * Aborts waiting the application to request the UI thread. This waiting can
-	 * occur after <code>run()</code> has been called if the application has not
-	 * yet at that point requested the UI thread and thus has not provided the
-	 * Runnable to call back. Aborting the waiting will cause the UI thread to
-	 * return from <code>run()</code>. If the application already obtained the
-	 * control of the UI thread then this method does nothing. 
-	 */
-	public static void abortWait() {
-		UIThreadManager.abortWait();
-	}
-	
-	/**
-	 * Sets the listener that will be notified of the state of the UI during its
-	 * life-cycle under the application's control. 
-	 * 
-	 * @param listener The listener, or null to disable the notifications
-	 */	
-	public static void setListener(ApplicationUIListener listener) {
-		final ApplicationUIListener applicationUIListener = listener;
-		org.eclipse.swt.internal.qt.ApplicationUIListener internalListener; 
-		if(listener != null) {
-			internalListener = new org.eclipse.swt.internal.qt.ApplicationUIListener() {
-				public void applicationUIThreadRequest() {
-					applicationUIListener.applicationUIThreadRequest();
-				}
-			};
-		} else {
-			internalListener = null;
-		}
-		UIThreadManager.setApplicationUIListener(internalListener);
-	}
-}
--- a/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/ApplicationUIListener.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Nokia Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.swt.internal.extension;
-
-/**
- * An interface for providing notifications about the state of the UI during the
- * life-time of the application.
- */
-public interface ApplicationUIListener {
-	/**
-	 * Called when the application requests the UI thread to call back a
-	 * Runnable that the application provided.
-	 */
-	public void applicationUIThreadRequest();
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/GraphicsUtil.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Nokia Corporation - initial implementation 
+ *******************************************************************************/
+
+package org.eclipse.swt.internal.extension;
+
+import org.eclipse.swt.graphics.Internal_GfxPackageSupport;
+import org.eclipse.swt.widgets.Internal_PackageSupport;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.internal.qt.graphics.WindowSurface;
+
+public final class GraphicsUtil {
+
+    /**
+     * Ends window surface session started with startExternalRendering() -call.
+     * Must be called after the rendering of external renderer has finished.
+     *
+     * @param gc The gc instance where the rendering is targeted
+     */
+    public static void endExternalRendering(GC gc) {
+        Internal_GfxPackageSupport.endExternalRendering(gc);          
+    }	
+
+    /**
+     * Returns the WindowSurface instance that is the ultimate target of the
+     * rendering for the given gc instance.
+     *
+     * @param gc The gc instance asossiated with the WindowSurface
+     * @return The WindowSurface instance that is the target of given gc instance
+     */
+    public static WindowSurface getWindowSurface(GC gc) {
+        return Internal_GfxPackageSupport.getWindowSurface(gc);
+    }
+
+    /**
+     * Start a window surface rendering session on the surface that is the 
+     * target of the given gc instance. This method must be called before 
+     * rendering to the window surface from external rendering APIs like m3g and m2g. 
+     * The caller must not render outside the area defined by the returned rectangle, 
+     * as it may result in rendering on top of other controls.
+     *
+     * @param gc The gc instance where the rendering is targeted
+     * @return The current clip of the gc in window surface coordinates or
+     *         null if the target of given gc is not a Control
+     */
+    public static Rectangle startExternalRendering(GC gc) {
+        return Internal_GfxPackageSupport.startExternalRendering(gc);          
+    }	
+    
+    /**
+     * Converts the given rectangle to window surface coordinates. 
+     *
+     * @param c The Control instance on which coordinates the conversion is done 
+     * @param rect The rectangle to be converted
+     * @return Rectangcular area in window surface coordinates
+     */
+    public static Rectangle toWindowSurface(Control c, Rectangle rect) {
+        return Internal_PackageSupport.toWindowSurface(c, rect);
+    }
+}
\ No newline at end of file
--- a/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/ImageUtil.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/ImageUtil.java	Mon Oct 04 11:29:25 2010 +0300
@@ -13,11 +13,83 @@
 
 import org.eclipse.swt.graphics.Device;
 import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Internal_GfxPackageSupport;
+import java.io.InputStream;
 
 public final class ImageUtil{
     
     public static Image createImageWithoutSecurityCheck(Device device, String filename) {
         return Internal_GfxPackageSupport.createImageWithoutSecurityCheck(device, filename);
-     }
+    }
+    
+    /**
+     * @deprecated Use createImageFromTheme(Device device, String name) instead.
+     * @param device
+     * @param id
+     * @return
+     */
+    public static Image createImageFromTheme(Device device, int id) {
+        return null;
+    }
+    
+    /**
+     * Creates an eSWT Image from a theme icon.
+     * Example:
+     *      Image image = ImageUtil.createImageFromTheme(display, "qtg_fr_rocker_normal_c");
+     * @param device
+     * @param name
+     * @return
+     */
+    public static Image createImageFromTheme(Device device, String name) {
+        Image res = null;
+        int iconHandle = org.eclipse.swt.internal.qt.OS.HbIcon_new(name);
+        org.eclipse.swt.internal.qt.graphics.Image cgImage = 
+            org.eclipse.swt.internal.qt.graphics.Image.createImageFromPixmap(
+                    org.eclipse.swt.internal.qt.OS.HbIcon_pixmap(iconHandle));
+        res = Internal_GfxPackageSupport.new_Image(device, cgImage);
+        org.eclipse.swt.internal.qt.OS.HbIcon_delete(iconHandle);
+        return res;
+    }
+    
+    /**
+     * Returns the bounds of an Image without creating an actual Image instance.
+     * Useful if there's a need to check the bounds of large collection of images
+     * to choose one that gets initialized.
+     *
+     * For bitmap files the function returns the size of the bitmap. For SVG
+     * the default size of the image is returned.
+     *
+     * Note that contents of the file are loaded to memory even when using
+     * this function. If you are going to load the image anyway, using this 
+     * function is not efficient.
+     *
+     * @param device The device to use when loading
+     * @param filename Filename from where to read the image data from. File is loaded from the classpath, not from the file system. 
+     * @return Size of the image
+     * @throws IOException if image cannot be loaded
+     */
+    public static Point getImageSize(Device device, String filename) {
+        return Internal_GfxPackageSupport.getImageSize(device, filename);
+    }
+    
+    /**
+     * Returns the bounds of an Image without creating an actual Image instance.
+     * Useful if there's a need to check the bounds of large collection of images
+     * to choose one that gets initialized.
+     *
+     * For bitmap files the function returns the size of the bitmap. For SVG
+     * the default size of the image is returned.
+     *
+     * Note that contents of the file are loaded to memory even when using
+     * this function. If you are going to load the image anyway, using this 
+     * function is not efficient.
+     *
+     * @param is The InputStream from where to read the image data from
+     * @return Size of the image
+     * @throws IOException if image cannot be loaded
+     */
+    public static Point getImageSize(InputStream stream) {
+        return Internal_GfxPackageSupport.getImageSize(stream);
+    }
 }
--- a/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/InternalUI.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Nokia Corporation - initial implementation
- *******************************************************************************/
-
-package org.eclipse.swt.internal.extension;
-
-import org.eclipse.swt.internal.qt.midp.UIThreadLauncher;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Internal_PackageSupport;
-
-/**
- * A class that encapsulates services that enable the use of eSWT UI before the
- * application has initialized its UI. This is achieved by utilizing an
- * 'internal' instance of the Display class. I.e. an instance that is not
- * revealed to the application but is only used internally within the API
- * implementation.
- * 
- * The same rules apply to the internal Display instance that apply to the
- * Display normally. When the Display is created then the creating thread
- * becomes the UI thread of the process. The application needs to be able to
- * obtain control of the UI thread. The services for interfacing with the
- * application are provided by the class ApplicationUI.
- * 
- * @see ApplicationUI
- */
-public final class InternalUI {
-	/**
-	 * Obtains the platform specific UI thread where SWT UI APIs can be accessed
-	 * in and calls the provided Runnable in it. This method instantly returns
-	 * leaving two threads running concurrently: the calling thread and the UI
-	 * thread. Only one UI thread can exist per process and this method can be
-	 * called only once to obtain it. Subsequent calls will result in an
-	 * exception being thrown. This method can be called by any thread.
-	 * 
-	 * @param runnable
-	 *            A Runnable to call back in the UI thread.
-	 * @exception RuntimeException
-	 *                If starting the UI thread fails
-	 */
-	public static void startInUIThread(Runnable runnable) {
-		if(!UIThreadLauncher.startInUIThread(runnable)) {
-			throw new RuntimeException("Failed to start the UI thread");
-		}
-	}
-	
-	/**
-	 * Creates the internal instance of Display. Must be called only once.
-	 * 
-	 * This means that the native resources required by the eSWT UI will be
-	 * initialized and a Display instance is returned that can be used to access
-	 * them normally via the public eSWT APIs. 
-	 * 
-	 * @return The internal Display instance
-	 * @see getInternalDisplayInstance
-	 */
-	public synchronized static Display createInternalDisplay() {
-		if(getInternalDisplayInstance() != null) {
-			throw new RuntimeException("Display already exists");
-		}
-		return Internal_PackageSupport.internalInstance();
-	}
-	
-	/**
-	 * Returns the internal Display instance or null if it doesn't exist. 
-	 * @return The internal Display instance or null
-	 */
-	public synchronized static Display getInternalDisplayInstance() {
-		return Internal_PackageSupport.getInternalDisplayInstance();
-	}
-}
--- a/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/LabelExtension.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/LabelExtension.java	Mon Oct 04 11:29:25 2010 +0300
@@ -63,4 +63,8 @@
         
         Internal_PackageSupport.setStandardIcon(this, standardIcon, iconWidth, iconHeight);
     }
+    
+    public void setThemeIcon(String iconName) {        
+        Internal_PackageSupport.setThemeIcon(this, iconName);
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/MobileShellExtension.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+
+package org.eclipse.swt.internal.extension;
+
+import org.eclipse.ercp.swt.mobile.MobileShell;
+import org.eclipse.swt.internal.qt.SymbianWindowVisibilityListener;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Internal_PackageSupport;
+
+public class MobileShellExtension extends MobileShell {
+
+    public MobileShellExtension(Display display, int style) {
+        super(display, style);
+    }
+    
+    public void addSymbianWindowVisibilityListener(SymbianWindowVisibilityListener listener) {
+        Internal_PackageSupport.addSymbianWindowVisibilityListener(this, listener);
+    }
+
+    public void removeSymbianWindowVisibilityListener(SymbianWindowVisibilityListener listener) {
+        Internal_PackageSupport.removeSymbianWindowVisibilityListener(this, listener);
+    }
+}
--- a/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/OS.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/OS.java	Mon Oct 04 11:29:25 2010 +0300
@@ -33,4 +33,6 @@
     //
     public static final native int XQCallInfo_create();
     public static final native boolean XQCallInfo_swt_hasCalls(int handle);
+    
+    public static final native int HbInputSettingProxy_availableHwKeyboard();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/Toolkit.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+
+package org.eclipse.swt.internal.extension;
+
+import org.eclipse.swt.internal.qt.EventLoop;
+import org.eclipse.swt.widgets.Display;
+
+/**
+ * This class enables eSWT UI services to be used independently of the 
+ * application's UI life-cycle in the implementation of the APIs. I.e. without 
+ * having to know if the application has created a UI toolkit yet, if it has 
+ * already destroyed it, or if it will ever create it. 
+ * <p>
+ * This is achieved by creating an 'internal' instance of the eSWT Display 
+ * class. I.e. an instance that is not revealed to the application but is only 
+ * used internally within the platform implementation. The application can 
+ * create the actual 'public' Display instance. Thus there can be two Display 
+ * objects but there's always only one set of UI resources such as  the native 
+ * application, UI thread, native widgets, etc. These same resources are used 
+ * by both the Displays. 
+ * <p>
+ * The users of the internal Display instance must take into account that 
+ * the public eSWT APIs can never provide references to the internal Display 
+ * instance. This has the implication that any other means of obtaining 
+ * the Display besides the methods of this class will always use a reference 
+ * to the public Display instance or null if it doesn't exist. E.g. 
+ * Display.getCurrent() or Display.getDefault() can't be used to obtain the 
+ * internal Display instance because they will return null if the application 
+ * hasn't explicitly created the public Display instance. 
+ * 
+ * @see ApplicationUI
+ */
+final public class Toolkit {
+    
+    private static Display internalDisplay;
+
+    /**
+     * Returns an object reference to the internal Display instance. There's 
+     * only one internal Display object in the process. The caller does not own 
+     * the Display and must not dispose it. 
+     * <p>
+     * The returned Display shares the UI resources in the process with the
+     * possibly existing public Display instance owned by the application. The
+     * UI thread and the event loop maybe under control of the application.
+     * <p>
+     * This method is thread safe. 
+     * 
+     * @return The internal Display instance
+     * 
+     * @throws RuntimeException
+     *             If the UI creation has failed and the Display can't be
+     *             obtained.
+     */
+    static public synchronized Display getInternalDisplay() {
+        if(internalDisplay == null) {
+            internalDisplay = EventLoop.getInternalDisplay();
+        }
+        return internalDisplay;
+    }
+}
--- a/javauis/eswt_qt/com.nokia.swt.extensions/midp/org/eclipse/ercp/swt/midp/UIThreadSupport.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/com.nokia.swt.extensions/midp/org/eclipse/ercp/swt/midp/UIThreadSupport.java	Mon Oct 04 11:29:25 2010 +0300
@@ -11,7 +11,7 @@
 package org.eclipse.ercp.swt.midp;
 
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.internal.qt.UIThreadManager;
+import org.eclipse.swt.internal.qt.UIThreadHandOverManager;
 
 /**
  * <p>
@@ -71,16 +71,16 @@
  * @see MIDlet#startApp
  */
 public static void startInUIThread(Runnable runnable) {
-	if(runnable == null) {
-		SWT.error(SWT.ERROR_NULL_ARGUMENT);
-	}
+    if(runnable == null) {
+        SWT.error(SWT.ERROR_NULL_ARGUMENT);
+    }
     synchronized(UIThreadSupport.class) {
         if(started) {
             SWT.error(SWT.ERROR_FAILED_EXEC);
         }
         started = true;
     }
-    if(!UIThreadManager.startInUIThread(runnable)) {
+    if(!UIThreadHandOverManager.startInUIThread(runnable)) {
         SWT.error(SWT.ERROR_NO_HANDLES);
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT Animation/qt/org/eclipse/swt/animation/internal/qt/OS.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,47 @@
+package org.eclipse.swt.animation.internal.qt;
+
+
+public final class OS {
+	
+	static {
+		System.loadLibrary("swt-animations");    
+	}
+
+	// QAbstractAnimation
+	public static final native void QAbstractAnimation_start(int handle);
+	public static final native void QAbstractAnimation_stop(int handle) ;
+	public static final native void QAbstractAnimation_setLoopCount(int handle, int repeatCount) ;
+	public static final native int QAbstractAnimation_duration(int handle);
+
+	// QPropertyAnimation 
+	public static final native int QPropertyAnimation_new(int parent);
+	public static final native void QPropertyAnimation_setTargetObject(int handle, int target);
+	public static final native void QPropertyAnimation_setPropertyName(int handle, String string);
+	
+	// QVariantAnimation
+	public static final native void QVariantAnimation_setDuration(int handle, int duration);
+	public static final native void QVariantAnimation_setEasingCurve(int handle, int interpolator) ;
+	public static final native void QVariantAnimation_swt_setEndValuePoint(int handle, int x, int y) ;
+	public static final native void QVariantAnimation_swt_setStartValuePoint(int propertyType, int x, int y);
+	public static final native void QVariantAnimation_swt_setEndValueDouble(int handle,	double doubleValue);
+	public static final native void QVariantAnimation_swt_setStartValueDouble(int handle, double doubleValue);
+	
+	// QEasingCurve
+	public static final native int QEasingCurve_new(int type) ;
+	
+	// QAnimationGroup
+	public static final native void QAnimationGroup_addAnimation(int handle, int child);
+
+	// QSequentialAnimationGroup
+	public static final native int QSequentialAnimationGroup_new(int i) ;
+	public static final native void QSequentialAnimationGroup_addPause(int handle, int msecs) ;
+
+	// QParallelAnimationGroup
+	public static final native int QParallelAnimationGroup_new(int i);
+
+
+
+
+
+
+}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/CLDCCompatibilityDelegate.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/CLDCCompatibilityDelegate.java	Mon Oct 04 11:29:25 2010 +0300
@@ -42,24 +42,34 @@
         return inputStream;
     }
 
-    public String convertPathToSpecific(String path) {
-        String jsr75Path = path;
-        if (!jsr75Path.startsWith("file:///")) {
-            // In JSR 75 the file separator is '/' and not '\'
-            jsr75Path = jsr75Path.replace('\\', '/');
-            jsr75Path = "file:///" + jsr75Path;
+    public String convertPathToSpecific(String path) {        
+        String res = path;
+        
+        // In JSR 75 the file separator is '/' and not '\'
+        res = res.replace('\\', '/');
+        
+        if (res.startsWith("file:///")) {
+            res = res.substring(8);
         }
         
-        return jsr75Path;
-    }
+        boolean hasDrive = false;
+        if (res.length() >= 2) {
+            char drive = res.charAt(0);
+            hasDrive = ((drive >= 'A' && drive <= 'Z') || (drive >= 'a' && drive <= 'z')) 
+                && (res.charAt(1) == ':');
+        }
 
-    public String convertPathFromSpecific(String jsr75Path) {
-        String stdPath = jsr75Path;
-        if (jsr75Path.startsWith("file:///")) {
-            stdPath = stdPath.replace('/', '\\');
-            stdPath = stdPath.substring(8, stdPath.length()).replace('/', '\\');;
+        if (!hasDrive) {
+            res = System.getProperty("fileconn.dir.private") + res; // may start now as file:///
         }
-        return stdPath;
+
+        if (!res.startsWith("file:///")) {
+            res = "file:///" + res;
+        }
+        
+        // The format now should be: file:///<drive>:/<path>
+        
+        return res;
     }
     
     public boolean canOpenFile(String path) throws SecurityException {
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/CompatibilityDelegate.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/CompatibilityDelegate.java	Mon Oct 04 11:29:25 2010 +0300
@@ -18,6 +18,5 @@
     public boolean canOpenFile(String path) throws SecurityException;
     public InputStream getInputStreamFromFile(String path) throws IOException;
     public String convertPathToSpecific(String path);
-    public String convertPathFromSpecific(String path);
     public OutputStream getOutStreamFromFile(String path) throws IOException;
 }
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java	Mon Oct 04 11:29:25 2010 +0300
@@ -877,7 +877,6 @@
     if (isFocusControl())
         return true;
     shell.setSavedFocus(null);
-    shell.bringToTop(false);
 
     // Wait for requests sent in bringToTop to complete. This doesn't guarantee
     // that focus has moved after this.
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Display.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Display.java	Mon Oct 04 11:29:25 2010 +0300
@@ -1624,6 +1624,9 @@
 public int internal_new_GC (GCData data) {
     checkDevice ();
 
+    // GC creation on Display is not currently supported
+    SWT.error (SWT.ERROR_NOT_IMPLEMENTED);
+    
     setScreenPaintingAttributes(true);
 
     data.internalGc = new GraphicsContext();
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/ApplicationUidWrapper.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009,2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Nokia Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.swt.internal;
-
-import com.nokia.mj.impl.rt.support.ApplicationInfo;
-
-
-public final class ApplicationUidWrapper {
-
-	public static int uid() {
-        int midletUid = -1;
-        try{
-            String uidS = ApplicationInfo.getInstance().getUid().getStringValue();
-            // In Symbian the UID is in format '[<uid>]' where <uid> is in hex
-            // format. So wee need to take the brackets away.
-            // Long is needed in conversion because UIDs greater than 0x80000000
-            // would fail if Integer would be used. However typecast from long
-            // to int is safe since UID in Symbian is 32 bit.
-            long uidL = Long.parseLong(uidS.substring(1,uidS.length()-1), 16);
-            return (int)uidL;
-        }
-        catch (Throwable t) {/* Not handled*/ }
-        return midletUid;
-    }
-}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/CommandPresentationStrategyWrapper.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     Nokia Corporation - initial implementation 
- *******************************************************************************/
-package org.eclipse.swt.internal;
-
-public final class CommandPresentationStrategyWrapper {
-	public static org.eclipse.swt.internal.qt.CommandPresentationStrategy createStrategy() {
-    	return new org.eclipse.swt.internal.qt.s60.S60CommandPresentationStrategy();	
-    	}
-}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/ExitNotificationWrapper.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/ExitNotificationWrapper.java	Mon Oct 04 11:29:25 2010 +0300
@@ -14,10 +14,13 @@
  * Note that this might be called directly from native code. 
  * Be careful renaming or moving it.
  */ 
-public class ExitNotificationWrapper {  
+public final class ExitNotificationWrapper {  
     
     public static void notifyExit() {
         com.nokia.mj.impl.rt.support.ApplicationUtils.getInstance().notifyExitCmd();
     }
     
+    public static void uiDisposed() {
+        com.nokia.mj.impl.rt.support.ApplicationUtils.getInstance().uiDisposed();
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/qt/ApplicationUIListener.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.qt;
+
+/**
+ * An internal interface for providing notifications about the state of the UI
+ * during the life-time of the application.
+ */
+public interface ApplicationUIListener {
+	/**
+	 * Called when the application requests the UI thread to call back a
+	 * Runnable that the application provided.
+	 */
+	public void applicationUIThreadRequest();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/qt/EventLoop.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,287 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+
+package org.eclipse.swt.internal.qt;
+
+import org.eclipse.swt.internal.qt.midp.UIThreadLauncher;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Internal_PackageSupport;
+
+import com.nokia.mj.impl.rt.support.ApplicationUtils;
+import com.nokia.mj.impl.rt.support.ShutdownListener;
+
+/**
+ * The internal event loop which will run until the application requests the UI 
+ * thread. Then UI thread is handed over to the application which will continue
+ * running the loop as it pleases. If the application exits cleanly the UI 
+ * thread will return back to here and the event loop can continue to run
+ * until the runtime signals shutdown. 
+ * 
+ * This class is the owner of the internal Display instance. 
+ */
+public final class EventLoop {
+
+    /*
+     * The internal Display instance. Owned by this class. 
+     */
+    private static Display internalDisplay;
+
+    /*
+     * Event loop can run here before the application's loop and after the UI
+     * thread exits from the application's loop. These states are identifying
+     * which of the two loops is currently running. 
+     */
+    private static final int PRE_APPLICATION = 0;
+    private static final int POST_APPLICATION = 1;
+    
+    /*
+     * Boolean used to detect when application has requested the UI thread and
+     * the hand-over must begin. 
+     */
+    private static volatile boolean applicationRequestedUIThread;
+
+    /*
+     * Boolean used to detect when the runtime wants to bring the UI down and
+     * the event loop must come down also. 
+     */
+    private static volatile boolean shuttingDownReceived;
+
+    /*
+     * Boolean used to store if starting has been attempted already. 
+     */
+    private static boolean started;
+    
+    /*
+     * Runnable that gets called in the UI thread when starting up. Named 
+     * class declared to be able to make it static. 
+     */
+    private static final class LoopRunner implements Runnable {
+        public void run() {
+            EventLoop.run();
+        }       
+    }
+    
+    /*
+     * Not to be instantiated. 
+     */
+    private EventLoop() {
+    }
+    
+    /**
+     * Returns the internal Display owned by the EventLoop class. Caller must 
+     * not dispose it. 
+     * @return The internal Display instance
+     * @throws RuntimeException
+     */
+    public static Display getInternalDisplay() {
+        synchronized(EventLoop.class) {
+            ensureStartedOrThrow();
+            return internalDisplay;
+        }
+    }
+
+    /*
+     * Starts the event loop. If this returns without throwing then the 
+     * internal Display instance has been successfully created and can be 
+     * asked with getInternalDisplay().
+     * 
+     * Any calls after the first successful call are ignored. Any calls after
+     * the first failed call will not retry but will throw.
+     */
+    private static void ensureStartedOrThrow() {
+        // This is called synchronized with the Display creation that takes 
+        // place in the UI thread. 
+        
+        if(!started) {
+            started = true;
+            
+            // Start the UI thread
+            if(!UIThreadLauncher.startInUIThread(new LoopRunner())) {
+                // Failed to create the UI thread, release the starting thread
+                EventLoop.class.notify();
+            }
+            
+            // Wait until the Display gets created in the UI thread
+            try {
+                EventLoop.class.wait();
+            } catch(InterruptedException e) {
+                // Nothing to do
+            }
+        }
+        
+        // Check Display creation status
+        if(internalDisplay == null) {
+            throw new RuntimeException("Failed to start");
+        }
+    }
+    
+    /*
+     * Start listening for the application requesting the UI thread via the
+     * eSWT's UIThreadSupport API. 
+     */
+    private static void listenApplicationUIThreadRequest() {
+        UIThreadHandOverManager.setApplicationUIListener(new ApplicationUIListener() {
+            /*
+             * Can get called in any thread but the UI thread. 
+             */
+            public void applicationUIThreadRequest() {
+                // Synchronized with the Display creation and destruction
+                synchronized(EventLoop.class) {
+                    applicationRequestedUIThread = true;
+                    // It's ok to skip wake if Display has not been created yet
+                    if(internalDisplay != null && !internalDisplay.isDisposed()) {
+                        internalDisplay.wake();
+                    }
+                }
+            }
+        });
+    }
+    
+    /*
+     * Start listening for the runtime's shutting down message. 
+     */
+    private static void listenRuntimeShutdownRequest() {
+        ApplicationUtils.getInstance().addShutdownListener(
+            /*
+             * Can get called in any thread but the UI thread. 
+             */
+            new ShutdownListener() {
+                public void shuttingDown() {
+                    // Synchronized with the Display creation and destruction
+                    synchronized(EventLoop.class) {
+                        shuttingDownReceived = true;
+                        // It's ok to skip wake if Display has not been created yet
+                        if(internalDisplay != null && !internalDisplay.isDisposed()) {
+                            internalDisplay.wake();
+                        }       
+                    }
+                }
+            });
+    }
+    
+    /*
+     * Creates the internal Display and runs the event loop. Called in the UI 
+     * thread. 
+     */
+    private static void run() {
+        try {
+            // Add the appropriate listeners. 
+            listenRuntimeShutdownRequest();
+            listenApplicationUIThreadRequest();
+            
+            // Create the internal Display. 
+            createInternalDisplay();
+    
+            // Run event loop until the application wants to take over or the 
+            // runtime signals shutdown. In the latter case exit from the UI 
+            // thread immediately. 
+            loop(PRE_APPLICATION);
+            if(shuttingDownReceived) {
+                return;
+            }
+            
+            // Hand over the UI thread to the application. The application is
+            // responsible of the event loop until it allows the UI thread to
+            // return back here. 
+            UIThreadHandOverManager.runApplicationUI();
+            
+            // Application allowed its event loop to exit. Continue 
+            // dispatching the events until the runtime wants to shut down. 
+            loop(POST_APPLICATION);
+            
+        } finally {
+            destroy();
+        }
+    }
+    
+    /* 
+     * Creates the Display. Synchronized with the starting thread that 
+     * waits until the Display has been created. 
+     */
+    private static void createInternalDisplay() {
+        synchronized(EventLoop.class) {
+            try {
+                // Will throw if fails
+                internalDisplay = Internal_PackageSupport.internalInstance();
+            } finally {
+                // Release the starting thread
+                EventLoop.class.notify();
+            }
+        }
+    }
+    
+    /*
+     * Frees all the owned resources when shutting down. Ideally this would be
+     * executed only after all the application's threads have been finalized. 
+     * If the application's threads are still running it's possible that 
+     * someone would try to access the internal Display after this. This would 
+     * cause an exception with "device is disposed".
+     */
+    private static void destroy() {
+        // Synchronized with the shutting down message and the application UI 
+        // thread request. 
+        synchronized(EventLoop.class) {
+            if(internalDisplay != null) {
+                // If this throws then Display.dispose() was called on the 
+                // internal Display by someone who doesn't own it. 
+                if(internalDisplay.isDisposed()) {
+                    throw new RuntimeException(
+                            "Internal Display has been disposed by someone who " +
+                            "doesn't own it");
+                }
+                
+                // If the application's Display has been disposed then 
+                // disposing also the internal Display here would destroy the 
+                // QApplication and all the UI resources tied to it. Disposing 
+                // is not done but the resources are allowed to leak on 
+                // purpose:
+                //
+                // In MIDP many of the related APIs are thread-safe and are 
+                // exclusively using garbage collection for memory management. 
+                // Disposing the UI resources of API objects that still may be 
+                // referenced would create a deviation from the pattern and 
+                // that would need special handling all around the API 
+                // implementations. That handling is not attempted but instead 
+                // the internal Display instance is allowed to live until the 
+                // process terminates. 
+            }
+        }
+    }
+    
+    /*
+     * The event loop that can run before and after the application's loop. 
+     * State parameter tells which one of the two this is. The exit 
+     * condition depends on the state. 
+     */
+    private static void loop(final int state) {
+        while(!loopExitCondition(state)) {
+            if(!internalDisplay.readAndDispatch()) {
+                internalDisplay.sleep();
+            }
+        }
+    }
+    
+    /*
+     * Checks if the loop exit condition is met. The condition is different
+     * depending on if the loop is running before or after the application's
+     * loop.
+     */
+    private static boolean loopExitCondition(final int state) {
+        switch(state) {
+        case PRE_APPLICATION:
+            return shuttingDownReceived || applicationRequestedUIThread;
+        case POST_APPLICATION:
+            return shuttingDownReceived;
+        default:
+            return true;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2me/org/eclipse/swt/internal/qt/UIThreadHandOverManager.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,198 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+
+package org.eclipse.swt.internal.qt;
+
+import org.eclipse.swt.internal.qt.ApplicationUIListener;
+import org.eclipse.swt.internal.qt.midp.UIThreadLauncher;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Internal_PackageSupport;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * A class that manages the UI thread hand-over from the internal UI event 
+ * loop to the application. 
+ */
+public final class UIThreadHandOverManager {
+    private static Object lock = new Object();
+    private static boolean threadWaitingForApplication;
+    private static Runnable applicationRunnable;
+    private static ApplicationUIListener applicationUIListener;
+    
+    /**
+     * Pass the control of the thread to the application by calling a Runnable
+     * provided by the application. If the Runnable has not yet been provided
+     * then the thread waits until it becomes available, or the wait is aborted
+     * by calling <code>abortWait()</code>. 
+     */
+    public static void runApplicationUI() {
+        synchronized(lock) {
+            if(!applicationWaiting()) {
+                waitForApplication();
+            } else {
+                // Release the waiting application thread
+                lock.notify();
+            }
+        }
+        callback();
+    }
+
+    /**
+     * If the UI thread is waiting for the application to request the callback
+     * in the UI thread then calling this will abort the wait and make the UI
+     * thread to return back from the <code>runApplicationUI()</code>.
+     */
+    public static void abortWait() {
+        synchronized(lock) {
+            if(threadWaitingForApplication) {
+                lock.notify();
+            }
+        }
+    }
+
+    /**
+     * Called indirectly by the application when it's requesting the UI thread. 
+     * Application will pass a Runnable as a parameter and expects it to get called
+     * in the UI thread. 
+     * 
+     * @param runnable
+     *            The Runnable to call in the UI thread.
+     * @return True if obtaining the UI thread was successful and the runnable
+     *         will be called.
+     */
+    public static boolean startInUIThread(Runnable runnable) {
+        // Make sure that the internal event loop is started. 
+        EventLoop.getInternalDisplay();
+        
+        synchronized(lock) {
+            applicationRunnable = runnable;
+            if(threadWaitingForApplication) {
+                lock.notify();
+            } else {
+                if(!waitForUIThread()) {
+                    // If the internal UI has not been created then it can't be
+                    // signaled and we can't wait for it. This must mean there's
+                    // no UI thread yet in the process and we can create it here.
+                    if(!UIThreadLauncher.startInUIThread(runnable)) {
+                        return false;
+                    }   
+                }
+            }
+        }
+        return true;
+    }
+    
+    /**
+     * Sets the listener that will be notified of the state of the UI during its
+     * life-time.
+     */
+    public static void setApplicationUIListener(ApplicationUIListener listener) {
+        synchronized(lock) {
+            applicationUIListener = listener;
+        }
+    }
+    
+    /*
+     * Signal the internal UI loop and wait until it passes the control of the
+     * UI thread into runApplicationUI(). Return false if the internal UI can't
+     * be signaled. 
+     */
+    private static boolean waitForUIThread() {
+        if(signalUIThreadRequest()) {
+            try {
+                lock.wait();
+            } catch(InterruptedException e) {
+                // Nothing to do
+            }
+            return true;
+        }
+        return false;
+    }
+
+    /*
+     * Wait until signaled by the application requesting the callback to its
+     * Runnable, or by abortWait().
+     */
+    private static void waitForApplication() {
+        threadWaitingForApplication = true;
+        try {
+            lock.wait();
+        } catch(InterruptedException e) {
+            // Nothing to do
+        } finally {
+            threadWaitingForApplication = false;
+        }       
+    }
+    
+    /*
+     * Returns true if application has provided the Runnable and is thus waiting
+     * for the callback.
+     */
+    private static boolean applicationWaiting() {
+        return (applicationRunnable != null);
+    }
+    
+    /*
+     * Post an event to the internal Display to request the control of the UI
+     * thread. After this runApplication() should get called in the UI thread.
+     */
+    private static boolean signalUIThreadRequest() {
+        Display internalDisplay = Internal_PackageSupport.getInternalDisplayInstance();
+        if(internalDisplay != null) {
+            if(applicationUIListener != null) {
+                applicationUIListener.applicationUIThreadRequest();
+            }
+            return true;
+        }
+        return false;
+    }
+
+    /*
+     * Call back the application's runnable
+     */
+    private static void callback() {
+        try {
+            boolean runnableOk;
+            synchronized(lock) {
+                runnableOk = (applicationRunnable != null);
+            }
+            if(runnableOk) {
+                flushInternals();
+                applicationRunnable.run();
+            }
+        } finally {
+            synchronized(lock) {
+                applicationRunnable = null;
+            }
+        }
+    }
+    
+    /*
+     * Clear any events or other items possibly left over by any previous usage
+     * of the UI resources. There must not be anything that can interfere with
+     * the application. It must appear as the application starts with an
+     * uninitialized UI.
+     */
+    private static void flushInternals() {
+        Display internalDisplay = Internal_PackageSupport.getInternalDisplayInstance();
+        
+        // Dispose all widgets
+        Shell[] shells = internalDisplay.getShells();
+        for(int i = 0; i < shells.length; ++i) {
+            if(shells[i] != null && !shells[i].isDisposed()) {
+                shells[i].dispose();
+            }
+        }
+        
+        // Flush the event queue
+        while(internalDisplay.readAndDispatch()) {}
+    }
+}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2se/org/eclipse/swt/internal/ApplicationUidWrapper.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     Nokia Corporation - initial implementation 
- *******************************************************************************/
-package org.eclipse.swt.internal;
-
-public final class ApplicationUidWrapper {
-    public static int uid() {
-        return 0;
-    }
-}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2se/org/eclipse/swt/internal/CommandPresentationStrategyWrapper.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials 
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     Nokia Corporation - initial implementation 
- *******************************************************************************/
-package org.eclipse.swt.internal;
-
-public final class CommandPresentationStrategyWrapper {
-	public static org.eclipse.swt.internal.qt.CommandPresentationStrategy createStrategy() {
-    	return new org.eclipse.swt.internal.qt.DesktopCommandPresentationStrategy();
-        }
-}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2se/org/eclipse/swt/internal/ExitNotificationWrapper.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/common_j2se/org/eclipse/swt/internal/ExitNotificationWrapper.java	Mon Oct 04 11:29:25 2010 +0300
@@ -12,13 +12,16 @@
 import org.eclipse.swt.widgets.Display;
 
 
-public class ExitNotificationWrapper {	
-	
-	public static void notifyExit() {
-	    Display display = Display.getCurrent();
-	    if(display != null) {
-	        display.dispose();
-		}
- 	}
-	
+public final class ExitNotificationWrapper {	
+    
+    public static void notifyExit() {
+        Display display = Display.getCurrent();
+        if(display != null) {
+            display.dispose();
+        }
+    }
+    
+    public static void uiDisposed() {
+        notifyExit();
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/linux/org/eclipse/swt/internal/ApplicationUidWrapper.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     Nokia Corporation - initial implementation 
+ *******************************************************************************/
+package org.eclipse.swt.internal;
+
+public final class ApplicationUidWrapper {
+    public static int uid() {
+        return 0;
+    }
+}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/linux/org/eclipse/swt/internal/qt/s60/S60CommandPresentationStrategy.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-package org.eclipse.swt.internal.qt.s60;
-
-import org.eclipse.ercp.swt.mobile.Command;
-import org.eclipse.swt.internal.qt.CommandPresentationStrategy;
-import org.eclipse.swt.internal.qt.CommandUtils;
-import org.eclipse.swt.internal.qt.OS;
-import org.eclipse.swt.internal.qt.CommandArranger.CommandCollection;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Internal_PackageSupport;
-import org.eclipse.swt.widgets.Widget;
-
-public class S60CommandPresentationStrategy extends CommandPresentationStrategy {
-    private Command[] positiveKeyCommands;
-    private Command negativeKeyCommand;
-    private Command defaultCommand;
-
-    public S60CommandPresentationStrategy() {
-        super();
-    }
-
-    protected void dispose() {
-        positiveKeyCommands = null;
-        negativeKeyCommand = null;
-        defaultCommand =null;
-    }
-
-
-    protected void handleCommandListChange(Command added, Command removed,
-            CommandCollection commands) {
-        cleanNegativeCommand();
-        cleanPositiveCommands();
-        updateCommandPositions(commands.getCommands(null));
-        placeNegativeCommand();
-        placePositiveCommands();
-    }
-
-    protected void handleDefaultCommandChange(Command defaultCommand) {
-        this.defaultCommand = defaultCommand;
-        cleanPositiveCommands();
-        placePositiveCommands();
-    }
-
-
-    protected void handleFocusChange(Control focused,
-            CommandCollection oldCommands, CommandCollection commands) {
-
-        //Clean-up the existing commands
-        cleanPositiveCommands();
-        cleanNegativeCommand();
-        //determine where the commands go
-        if( commands != null && commands.getSize()>0 ){
-            Command[] add = commands.getCommands(null);
-            updateCommandPositions(add);
-        }
-        //Place them to their places
-        placePositiveCommands();
-        placeNegativeCommand();
-
-    }
-
-    private void updateCommandPositions(Command[] commands) {
-        positiveKeyCommands = new Command[commands.length];
-        int  positiveKeyIndex=0;
-        for (int i = 0; i < commands.length; i++) {
-            Command cmd = commands[i];
-            if ( cmd.isDefaultCommand()){
-                defaultCommand = cmd;
-                continue;
-            }
-            if( CommandUtils.isNegativeType(cmd.type) ){
-                if (negativeKeyCommand == null || negativeKeyCommand.isDisposed()){
-                    negativeKeyCommand = cmd;
-                }else
-                if( negativeKeyCommand.getPriority() <= cmd.getPriority() ){
-                    positiveKeyCommands[positiveKeyIndex] = negativeKeyCommand;
-                    positiveKeyIndex++;
-                    negativeKeyCommand = cmd;
-                }else{
-                    positiveKeyCommands[positiveKeyIndex] = cmd;
-                    positiveKeyIndex++;
-                }
-                continue;
-            }
-            positiveKeyCommands[positiveKeyIndex]=cmd;
-            positiveKeyIndex++;
-        }
-        if ((positiveKeyIndex) < positiveKeyCommands.length ){// needs to shrink
-            Command[] rightSized = new Command[positiveKeyIndex];
-            System.arraycopy(positiveKeyCommands, 0, rightSized, 0, rightSized.length);
-            positiveKeyCommands = rightSized;
-        }
-    }
-
-
-    private void cleanPositiveCommands() {
-        boolean useBar = false;
-        if ( (positiveKeyCommands != null && positiveKeyCommands.length >1) ||
-                (defaultCommand != null && positiveKeyCommands != null) ){
-            useBar = true;
-        }
-        if (defaultCommand != null && !defaultCommand.isDisposed()
-                && !defaultCommand.control.isDisposed()) {
-            if (useBar) {
-                OS.QWidget_removeAction(defaultCommand.control.getShell()
-                        .internal_getOwnMenuBar(), topHandle(defaultCommand));
-            }
-            else{
-                 OS.QWidget_removeAction(topHandle(defaultCommand.control), topHandle(defaultCommand));
-            }
-        }
-        if (positiveKeyCommands != null) {
-            for (int i = 0; i < positiveKeyCommands.length; i++) {
-                Command cmd = positiveKeyCommands[i];
-                if (cmd == null || cmd.isDisposed()  || cmd.control.isDisposed()){
-                	continue;
-                }
-                int handle = 0;
-                if (useBar) {
-                    handle = cmd.control.getShell().internal_getOwnMenuBar();
-                } else {
-                    handle = topHandle(positiveKeyCommands[0].control);
-                }
-                OS.QWidget_removeAction(handle, topHandle(cmd));
-
-            }
-        }
-    }
-
-   private void cleanNegativeCommand() {
-        if(negativeKeyCommand != null && !negativeKeyCommand.isDisposed() && !negativeKeyCommand.control.isDisposed() ){
-            OS.QWidget_removeAction(topHandle(negativeKeyCommand.control), topHandle(negativeKeyCommand));
-        }
-    }
-
-    private void placeNegativeCommand() {
-        if(negativeKeyCommand != null ){
-            OS.QWidget_addAction(Internal_PackageSupport.topHandle(negativeKeyCommand.control),
-                    topHandle(negativeKeyCommand));
-        }
-    }
-
-    private void placePositiveCommands() {
-        if (defaultCommand != null ) {
-            int defaultCmdHandle = topHandle(defaultCommand);
-            if (positiveKeyCommands != null) {
-                OS.QMenuBar_addAction(defaultCommand.control.getShell()
-                        .internal_getOwnMenuBar(), defaultCmdHandle);
-            } else {
-                OS.QWidget_addAction(Internal_PackageSupport
-                        .topHandle(defaultCommand.control), defaultCmdHandle);
-            }
-        }
-        if (positiveKeyCommands != null) {
-            if (positiveKeyCommands.length == 1 && defaultCommand == null) {
-                OS.QWidget_addAction(Internal_PackageSupport
-                        .topHandle(positiveKeyCommands[0].control),
-                        topHandle(positiveKeyCommands[0]));
-            } else {
-                CommandUtils.sort(positiveKeyCommands);
-                for (int i = 0; i < positiveKeyCommands.length; i++) {
-                    OS.QMenuBar_addAction(positiveKeyCommands[i].control
-                            .getShell().internal_getOwnMenuBar(),
-                            topHandle(positiveKeyCommands[i]));
-                }
-            }
-        }
-    }
-
-    protected void handleMenuBarChanged(int newMenuBar,
-            CommandCollection commands) {
-        placePositiveCommands();
-    }
-
-
-    private static final int topHandle(Widget w) {
-        return Internal_PackageSupport.topHandle(w);
-    }
-}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/ApplicationUIListener.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Nokia Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.swt.internal.qt;
-
-/**
- * An internal interface for providing notifications about the state of the UI
- * during the life-time of the application.
- */
-public interface ApplicationUIListener {
-	/**
-	 * Called when the application requests the UI thread to call back a
-	 * Runnable that the application provided.
-	 */
-	public void applicationUIThreadRequest();
-}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/BaseCSSEngine.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/BaseCSSEngine.java	Mon Oct 04 11:29:25 2010 +0300
@@ -19,6 +19,7 @@
  * <p><b>NOTE:</b> This class is intended for internal use only.</p>
  */
 public final class BaseCSSEngine {
+	private static final String FILE_SCHEME = "file:///";
 	private Display parent;
 
 	/**
@@ -63,7 +64,7 @@
 	public void applyCSS( String style ){
 		checkEngine();
 		if( style == null ) SWT.error (SWT.ERROR_NULL_ARGUMENT);
-		if( style.startsWith("file:///") ) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+		if( style.startsWith(FILE_SCHEME) ) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
 		OS.QApplication_setStyleSheet(style);
 	}
 
@@ -90,7 +91,7 @@
 		if( style == null ) SWT.error (SWT.ERROR_NULL_ARGUMENT);
 		if( widget == null ) SWT.error (SWT.ERROR_NULL_ARGUMENT);
 		if( widget.isDisposed() ) SWT.error( SWT.ERROR_WIDGET_DISPOSED);
-		if( style.startsWith("file:///") ) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
+		if( style.startsWith(FILE_SCHEME) ) SWT.error (SWT.ERROR_INVALID_ARGUMENT);
 		OS.QWidget_setStyleSheet(Internal_PackageSupport.handle(widget), style);
 	}
 	/**
@@ -111,7 +112,7 @@
 	public void loadCSS( String filename ){
 		checkEngine();
 		if (filename == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
-		OS.QApplication_setStyleSheet("file:///"+filename);
+		OS.QApplication_setStyleSheet(FILE_SCHEME+filename);
 	}
 
 	/**
@@ -134,7 +135,7 @@
 		if (filename == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
 		if( widget == null ) SWT.error (SWT.ERROR_NULL_ARGUMENT);
 		if( widget.isDisposed() ) SWT.error( SWT.ERROR_WIDGET_DISPOSED);
-		OS.QWidget_setStyleSheet(Internal_PackageSupport.handle(widget), "file:///"+filename);
+		OS.QWidget_setStyleSheet(Internal_PackageSupport.handle(widget), FILE_SCHEME+filename);
 	}
 
 	/**
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/CommandArranger.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/CommandArranger.java	Mon Oct 04 11:29:25 2010 +0300
@@ -11,12 +11,14 @@
 package org.eclipse.swt.internal.qt;
 
 import org.eclipse.ercp.swt.mobile.Command;
-import org.eclipse.swt.internal.CommandPresentationStrategyWrapper;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Decorations;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Internal_PackageSupport;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Widget;
+
 /**
  * Manages the Command presentation cycle. This is a singleton object that gets
  * notified about the events that can have an effect on the way the Commands are
@@ -24,298 +26,424 @@
  * context with the help of {@link CommandCollection}. It also notifies the
  * currently active {@link CommandPresentationStrategy} so that the presentation
  * is updated if necessary.
- *
+ * 
  * @see Command
  * @see CommandCollection
  * @see CommandPresentationStrategy
  */
 public class CommandArranger {
-    Control focusedControl;
 
-    /**
-     * A helper for keeping an ordered list of {@link Command}s in the current focus context.
-     * The Commands are ordered according to their proximity to the currently focused control.
-     * The ordered list starts with Commands from the currently focused Control if any and ends with
-     * the active Shell and includes all the Commands in between. If a Control has more
-     * than one Command they are ordered among themselves according to creation order.
-     */
-    public class CommandCollection{
+/**
+ * A helper for keeping an ordered list of {@link Command}s in the current focus
+ * context. The Commands are ordered according to their proximity to the
+ * currently focused control. The ordered list starts with Commands from the
+ * currently focused Control if any and ends with the active Shell and includes
+ * all the Commands in between. If a Control has more than one Command they are
+ * ordered among themselves according to creation order.
+ */
+public class CommandCollection {
 
-        private Command[] fCommands;
+private Command[] fCommands;
 
-        CommandCollection(){
-            super();
-        }
+CommandCollection() {
+    super();
+}
 
-        /**
-         * Adds the command to the collection.
-         * Warning: This does not make duplicate control.
-         * @param command
-         */
-        void addCommand(Command command) {
-            if (command == null)
-                return;
-            if (fCommands == null) {
-                fCommands = new Command[1];
-                fCommands[0] = command;
-                return;
-            }
-            int size = fCommands.length + 1;
-            Command[] newList = new Command[size];
-            // find the insertion point so that the order is correct
-            int insertPoint = 0;
-            Shell activeShell = display.getActiveShell();
-            Control ctrl = display.getFocusControl();
-            while (ctrl != null && ctrl != activeShell) {
-                if (ctrl == command.control) {
-                    // Adding a command to focused control increment by one.
-                    // adding Command.internal_getCommands(ctrl).length will
-                    // just duplicate the count for Commands already in array.
-                    insertPoint++;
-                    break;
-                }
-                insertPoint += Command.internal_getCommands(ctrl).length;
-                ctrl = ctrl.getParent();
-            }
-            System.arraycopy(fCommands, 0, newList, 0, insertPoint);
-            System.arraycopy(fCommands, insertPoint, newList, insertPoint + 1,
-                    fCommands.length - insertPoint);
-            newList[insertPoint] = command;
-            fCommands = newList;
+/**
+ * Adds the command to the collection. Warning: This does not make duplicate
+ * control.
+ * 
+ * @param command
+ */
+void addCommand(Command command) {
+    if (command == null)
+        return;
+    if (fCommands == null) {
+        fCommands = new Command[1];
+        fCommands[0] = command;
+        return;
+    }
+    int size = fCommands.length + 1;
+    Command[] newList = new Command[size];
+    // find the insertion point so that the order is correct
+    int insertPoint = 0;
+    Shell activeShell = display.getActiveShell();
+    Control ctrl = display.getFocusControl();
+    while (ctrl != null && ctrl != activeShell) {
+        if (ctrl == command.control) {
+            // Adding a command to focused control increment by one.
+            // adding Command.internal_getCommands(ctrl).length will
+            // just duplicate the count for Commands already in array.
+            insertPoint++;
+            break;
         }
+        insertPoint += Command.internal_getCommands(ctrl).length;
+        ctrl = ctrl.getParent();
+    }
+    System.arraycopy(fCommands, 0, newList, 0, insertPoint);
+    System.arraycopy(fCommands, insertPoint, newList, insertPoint + 1, fCommands.length
+        - insertPoint);
+    newList[insertPoint] = command;
+    fCommands = newList;
+}
 
-        /**
-         * Adds the list of Commands to the collection.
-         * @param commands
-         */
-        void addCommand( Command[] commands ){
-            if (commands == null || commands.length == 0 ) return;
-            if (fCommands == null ){
-                fCommands = new Command[ commands.length ];
-                System.arraycopy(commands, 0, fCommands, 0, commands.length );
-                return;
-            }
-            int size = commands.length + fCommands.length;
-            Command[] newList = new Command[ size ];
-            System.arraycopy(fCommands, 0, newList, 0, fCommands.length);
-            System.arraycopy(commands, 0, newList, fCommands.length , commands.length );
-            fCommands = newList;
-        }
+/**
+ * Adds the list of Commands to the collection.
+ * 
+ * @param commands
+ */
+void addCommand(Command[] commands) {
+    if (commands == null || commands.length == 0)
+        return;
+    if (fCommands == null) {
+        fCommands = new Command[commands.length];
+        System.arraycopy(commands, 0, fCommands, 0, commands.length);
+        return;
+    }
+    int size = commands.length + fCommands.length;
+    Command[] newList = new Command[size];
+    System.arraycopy(fCommands, 0, newList, 0, fCommands.length);
+    System.arraycopy(commands, 0, newList, fCommands.length, commands.length);
+    fCommands = newList;
+}
 
-        /**
-         * Removes the command from the list.
-         * @param command
-         */
-        void removeCommand( Command command ){
-            if ( command == null ) return;
-            if (fCommands == null || fCommands.length == 0 ) return;
-            int removeIndex = -1;
-            for (int i = 0; i < fCommands.length; i++) {
-                if(fCommands[i] == command ){
-                    removeIndex = i;
-                }
-            }
-            if ( removeIndex == -1 ) return;
-            Command[] newList = new Command[ fCommands.length -1 ];
-            System.arraycopy( fCommands, 0, newList, 0, removeIndex);
-            System.arraycopy( fCommands, removeIndex + 1, newList, removeIndex, (fCommands.length - removeIndex -1) );
-            fCommands = newList;
+/**
+ * Removes the command from the list.
+ * 
+ * @param command
+ */
+void removeCommand(Command command) {
+    if (command == null)
+        return;
+    if (fCommands == null || fCommands.length == 0)
+        return;
+    int removeIndex = -1;
+    for (int i = 0; i < fCommands.length; i++) {
+        if (fCommands[i] == command) {
+            removeIndex = i;
         }
+    }
+    if (removeIndex == -1)
+        return;
+    Command[] newList = new Command[fCommands.length - 1];
+    System.arraycopy(fCommands, 0, newList, 0, removeIndex);
+    System.arraycopy(fCommands, removeIndex + 1, newList, removeIndex, (fCommands.length
+        - removeIndex - 1));
+    fCommands = newList;
+}
 
-        /**
-         * Returns the number of the Commands
-         *
-         * @return boolean
-         */
-        public int getSize(){
-            int size = 0;
-            if (fCommands != null ) size = fCommands.length;
-            return size;
-        }
+/**
+ * Returns the number of the Commands
+ * 
+ * @return boolean
+ */
+int getSize() {
+    int size = 0;
+    if (fCommands != null)
+        size = fCommands.length;
+    return size;
+}
 
-        /**
-         * Retrieves the Commands of the types indicated by the commandTypes array.
-         * The order of the commandTypes array has no significance. Passing a null parameter
-         * or an empty array retrieves all the available Commands.
-         *
-         * @param commandTypes
-         * @return Command list
-         */
-        public Command[] getCommands( int[] commandTypes ){
-            if ( commandTypes == null || commandTypes.length == 0 ){
-                return fCommands;
+/**
+ * Retrieves the Commands of the types indicated by the commandTypes array. The
+ * order of the commandTypes array has no significance. Passing a null parameter
+ * or an empty array retrieves all the available Commands.
+ * 
+ * @param commandTypes
+ * @return Command list
+ */
+Command[] getCommands(int[] commandTypes) {
+    if (commandTypes == null || commandTypes.length == 0) {
+        return fCommands;
+    }
+    int size = getSize();
+    Command[] filteredCommands = new Command[size];
+    int index = 0;
+    for (int i = 0; i < fCommands.length; i++) {
+        for (int j = 0; j < commandTypes.length; j++) {
+            if (fCommands[i].type == commandTypes[j]) {
+                filteredCommands[index] = fCommands[i];
+                index++;
+                break;
             }
-            int size = getSize();
-            Command[] filteredCommands = new Command[size];
-            int index = 0;
-            for (int i = 0; i < fCommands.length ; i++) {
-                for(int j = 0; j<commandTypes.length; j++){
-                    if ( fCommands[i].type == commandTypes[j] ){
-                        filteredCommands[index]=fCommands[i];
-                        index++;
-                        break;
-                    }
-                }
-            }
-            if( size > (index) ){// Some commands filtered resize the Array
-                Command[] shrunk = new Command[index];
-                System.arraycopy( filteredCommands, 0, shrunk, 0, index);
-                return shrunk;
-            }
-            return filteredCommands;
         }
-    }// CommandCollection
+    }
+    if (size > (index)) {// Some commands filtered resize the Array
+        Command[] shrunk = new Command[index];
+        System.arraycopy(filteredCommands, 0, shrunk, 0, index);
+        return shrunk;
+    }
+    return filteredCommands;
+}
+
+}// CommandCollection
+
+private CommandCollection currentCommands;
+private Command defaultCommand;
+private Display display;
+Control focusedControl;
+Shell lastKnownActiveShell;
+private Command[] positiveKeyCommands;
+private Command negativeKeyCommand;
+
+
+public CommandArranger(Display display) {
+    super();
+    this.display = display;
+    currentCommands = new CommandCollection();
+}
 
-    private CommandCollection currentCommands;
-    private CommandPresentationStrategy strategy;
-    private Command defaultCommand;
-    private Display display;
+/**
+ * Called when the application changes the QMenuBar. This method does not handle
+ * the cases when the QMenuBar may change when the active top-level Shell
+ * changes. Since this does not cause a menu bar change on all platforms.
+ * 
+ * @see org.eclipse.swt.widgets.Decorations#setMenuBar(Menu)
+ * 
+ **/
+public void menuBarChanged(Decorations decorations) {
+    if (currentCommands == null || currentCommands.getSize() < 1)
+        return;
+    // if the changed menu bar is not on the active shell ignore and leave
+    // it to focus change.
+    if (decorations.getShell() != decorations.getDisplay().getActiveShell())
+        return;
+    // Call internal_getOwnMenuBar because the menu bar can be set to null
+    // in Decorations and
+    // we may need to create the internal one.
+    int menuBarHandle = decorations.internal_getOwnMenuBar();
 
-    public CommandArranger(Display display){
-        super();
-        this.display = display;
-        currentCommands = new CommandCollection();
-        strategy = CommandPresentationStrategyWrapper.createStrategy();
+    handleMenuBarChanged(menuBarHandle, currentCommands);
+}
+
+/**
+ * Called when a new Shell becomes active.
+ * 
+ * @see Control#qt_swt_event_focusWasGained() //TODO
+ */
+public void shellActivityChanged() {
+    if (display == null) {
+        return;
     }
 
-
-
-    /**
-     * Called when the application changes the QMenuBar.
-     * This method does not handle the cases when the QMenuBar
-     * may change when the active top-level Shell changes. Since
-     * this does not cause a menu bar change on all platforms.
-     *
-     * @see org.eclipse.swt.widgets.Decorations#setMenuBar(Menu)
-     *
-     **/
-    public void menuBarChanged( Decorations decorations ){
-
-        if ( currentCommands == null || currentCommands.getSize() < 1 ) return;
-        // if the changed menu bar is not on the active shell ignore and leave it to focus change.
-        if (decorations.getShell() != decorations.getDisplay().getActiveShell() )return;
-        // Call internal_getOwnMenuBar because the menu bar can be set to null in Decorations and
-        // we may need to create the internal one.
-        int menuBarHandle = decorations.internal_getOwnMenuBar();
-
-        strategy.handleMenuBarChanged( menuBarHandle, currentCommands );
+    Shell activeShell = display.getActiveShell();
+    
+    if (activeShell == lastKnownActiveShell) {
+        return;
     }
+    lastKnownActiveShell = activeShell;
+    
+    cleanPositiveCommands();
+    cleanNegativeCommand();
+    
+    currentCommands = new CommandCollection();
 
-    /**
-     * Called when a new Control gains focus.
-     *
-     * @see Control#qt_swt_event_focusWasGained()
-     */
-    public void focusedControlChanged(){
-        Control focusControl = display.getFocusControl();
-        if (focusControl == focusedControl) {
-            return;
-        }
-        focusedControl = focusControl;
-
-        Shell activeShell = display.getActiveShell();
-        CommandCollection oldCollection = currentCommands;
-        currentCommands = new CommandCollection();
-
-        Control ctrl = focusControl;
-        while ( ctrl!= null && ctrl != activeShell ){
-            if ( Command.internal_getCommands(ctrl).length > 0 ){
-                currentCommands.addCommand( Command.internal_getCommands(ctrl) );
-            }
-            ctrl = ctrl.getParent();
-        }
-        if (activeShell != null && Command.internal_getCommands(activeShell).length > 0 ){
-            currentCommands.addCommand( Command.internal_getCommands(activeShell) );
-        }
-
-        if (strategy != null) {
-            strategy.handleFocusChange(focusControl, oldCollection, currentCommands);
-        }
-    }
-
-    /**
-     * Called when a new Command is created
-     * @param command
-     */
-    public void commandAdded( Command command ){
-        if( isInFocusContext(command.control)){
-            currentCommands.addCommand(command);
-            strategy.handleCommandListChange(command, null, currentCommands);
-        }
+    if (activeShell != null && Command.internal_getCommands(activeShell).length > 0) {
+        currentCommands.addCommand(Command.internal_getCommands(activeShell));
     }
 
-    /**
-     * Called when a Command is disposed
-     * @param command
-     */
-    public void commandRemoved( Command command ){
-        if ( command == defaultCommand ) defaultCommand = null;
-        if (isInFocusContext(command.control)){
-            currentCommands.removeCommand( command );
-            strategy.handleCommandListChange(null, command, currentCommands);
-        }
+    // Determine where the commands go
+    if (currentCommands.getSize() > 0) {
+        Command[] add = currentCommands.getCommands(null);
+        updateCommandPositions(add);
+        placePositiveCommands();
+        placeNegativeCommand();
+    }
+}
+
+/**
+ * Called when a new Command is created
+ * 
+ * @param command
+ */
+public void commandAdded(Command command) {
+    if (isInFocusContext(command.control)) {
+        currentCommands.addCommand(command);
+        handleCommandListChange(command, null, currentCommands);
     }
+}
+
+/**
+ * Called when a Command is disposed
+ * 
+ * @param command
+ */
+public void commandRemoved(Command command) {
+    if (command == defaultCommand)
+        defaultCommand = null;
+    if (isInFocusContext(command.control)) {
+        currentCommands.removeCommand(command);
+        handleCommandListChange(null, command, currentCommands);
+    }
+}
+
+/**
+ * Called when the Display is getting disposed.
+ */
+public void dispose() {
+    currentCommands = null;
+    display = null;
+    positiveKeyCommands = null;
+    negativeKeyCommand = null;
+    defaultCommand = null;
+    lastKnownActiveShell = null;
+}
+
+/**
+ * Called when a Command is set default
+ * 
+ * @param command
+ * @see Command#setDefaultCommand();
+ */
+public void setDefaultCommand(Command command) {
+    defaultCommand = command;
+    if (isInFocusContext(command.control)) {
+        handleDefaultCommandChange(command);
+    }
+}
 
-    /**
-     * Called when the Display is getting disposed.
-     */
-    public void dispose(){
-        strategy.dispose();
-        strategy = null;
-        currentCommands = null;
-        display = null;
+/**
+ * Returns the default command or null if there is none.
+ * 
+ * @return
+ * @see Command#isDefaultCommand()
+ */
+public Command getDefaultCommand() {
+    return defaultCommand;
+}
+
+
+private boolean isInFocusContext(Control control) {
+    Display display = control.getDisplay();
+    Shell activeShell = display.getActiveShell();
+    return control == activeShell;
+}
+
+private void handleCommandListChange(Command added, Command removed, CommandCollection commands) {
+    cleanNegativeCommand();
+    cleanPositiveCommands();
+    updateCommandPositions(commands.getCommands(null));
+    placeNegativeCommand();
+    placePositiveCommands();
+}
+
+private void handleDefaultCommandChange(Command defaultCommand) {
+    this.defaultCommand = defaultCommand;
+    cleanPositiveCommands();
+    placePositiveCommands();
+}
+
+private void updateCommandPositions(Command[] commands) {
+    positiveKeyCommands = new Command[commands.length];
+    int positiveKeyIndex = 0;
+    for (int i = 0; i < commands.length; i++) {
+        Command cmd = commands[i];
+        if (cmd.isDefaultCommand()) {
+            defaultCommand = cmd;
+            continue;
+        }
+        if (CommandUtils.isNegativeType(cmd.type)) {
+            if (negativeKeyCommand == null || negativeKeyCommand.isDisposed()) {
+                negativeKeyCommand = cmd;
+            } else if (negativeKeyCommand.getPriority() <= cmd.getPriority()) {
+                positiveKeyCommands[positiveKeyIndex] = negativeKeyCommand;
+                positiveKeyIndex++;
+                negativeKeyCommand = cmd;
+            } else {
+                positiveKeyCommands[positiveKeyIndex] = cmd;
+                positiveKeyIndex++;
+            }
+            continue;
+        }
+        positiveKeyCommands[positiveKeyIndex] = cmd;
+        positiveKeyIndex++;
     }
-    /**
-     * Called when a Command is set default
-     *
-     * @param command
-     * @see Command#setDefaultCommand();
-     */
-    public void setDefaultCommand(Command command ){
-        defaultCommand = command;
-        if(isInFocusContext(command.control)){
-            strategy.handleDefaultCommandChange(command);
+    if ((positiveKeyIndex) < positiveKeyCommands.length) {// needs to shrink
+        Command[] rightSized = new Command[positiveKeyIndex];
+        System.arraycopy(positiveKeyCommands, 0, rightSized, 0, rightSized.length);
+        positiveKeyCommands = rightSized;
+    }
+}
+
+private void cleanPositiveCommands() {
+    boolean useBar = false;
+    if ((positiveKeyCommands != null && positiveKeyCommands.length > 1)
+        || (defaultCommand != null && positiveKeyCommands != null)) {
+        useBar = true;
+    }
+    if (defaultCommand != null && !defaultCommand.isDisposed()
+        && !defaultCommand.control.isDisposed()) {
+        if (useBar) {
+            OS.QWidget_removeAction(defaultCommand.control.getShell().internal_getOwnMenuBar(),
+                topHandle(defaultCommand));
+        } else {
+            OS.QWidget_removeAction(topHandle(defaultCommand.control), topHandle(defaultCommand));
         }
     }
-
-    /**
-     * Returns the default command or null if there is none.
-     *
-     * @return
-     * @see Command#isDefaultCommand()
-     */
-    public Command getDefaultCommand(){
-        return defaultCommand;
-    }
+    if (positiveKeyCommands != null) {
+        for (int i = 0; i < positiveKeyCommands.length; i++) {
+            Command cmd = positiveKeyCommands[i];
+            if (cmd == null || cmd.isDisposed() || cmd.control.isDisposed()) {
+                continue;
+            }
+            int handle = 0;
+            if (useBar) {
+                handle = cmd.control.getShell().internal_getOwnMenuBar();
+            } else {
+                handle = topHandle(positiveKeyCommands[0].control);
+            }
+            OS.QWidget_removeAction(handle, topHandle(cmd));
 
-    /**
-     * Sets a new {@link CommandPresentationStrategy}. It also disposes to old one.
-     *
-     * @param commandPresentationStrategy
-     */
-    public void setPresentationStrategy( CommandPresentationStrategy commandPresentationStrategy ){
-        CommandPresentationStrategy oldStrategy = strategy;
-        strategy = commandPresentationStrategy;
-        if (oldStrategy != null ){
-            oldStrategy.dispose();
         }
     }
+}
 
-    private boolean isInFocusContext(Control control){
-        Display display = control.getDisplay();
-        Shell activeShell = display.getActiveShell();
-        Control focused = display.getFocusControl();
-        if( focused == null )return false;
-        if(control.getShell() != activeShell) return false;
-        if( control == focused ) return true;
-        return isFocusAncestor(focused, control);
+private void cleanNegativeCommand() {
+    if (negativeKeyCommand != null && !negativeKeyCommand.isDisposed()
+        && !negativeKeyCommand.control.isDisposed()) {
+        OS.QWidget_removeAction(topHandle(negativeKeyCommand.control),
+            topHandle(negativeKeyCommand));
+    }
+}
+
+private void placeNegativeCommand() {
+    if (negativeKeyCommand != null) {
+        OS.QWidget_addAction(Internal_PackageSupport.topHandle(negativeKeyCommand.control),
+            topHandle(negativeKeyCommand));
     }
+}
 
-    private boolean isFocusAncestor(Control node, Control parent){
-        Control nodeParent = node.getParent();
-        if( nodeParent == parent )return true;
-        if (nodeParent == null || nodeParent == node.getShell() )return false;
-        return isFocusAncestor(nodeParent, parent);
+private void placePositiveCommands() {
+    if (defaultCommand != null) {
+        int defaultCmdHandle = topHandle(defaultCommand);
+        if (positiveKeyCommands != null) {
+            OS.QMenuBar_addAction(defaultCommand.control.getShell().internal_getOwnMenuBar(),
+                defaultCmdHandle);
+        } else {
+            OS.QWidget_addAction(Internal_PackageSupport.topHandle(defaultCommand.control),
+                defaultCmdHandle);
+        }
     }
+    if (positiveKeyCommands != null) {
+        if (positiveKeyCommands.length == 1 && defaultCommand == null) {
+            OS.QWidget_addAction(Internal_PackageSupport.topHandle(positiveKeyCommands[0].control),
+                topHandle(positiveKeyCommands[0]));
+        } else {
+            CommandUtils.sort(positiveKeyCommands);
+            for (int i = 0; i < positiveKeyCommands.length; i++) {
+                OS.QMenuBar_addAction(positiveKeyCommands[i].control.getShell()
+                    .internal_getOwnMenuBar(), topHandle(positiveKeyCommands[i]));
+            }
+        }
+    }
+}
+
+private void handleMenuBarChanged(int newMenuBar, CommandCollection commands) {
+    placePositiveCommands();
+}
+
+private static final int topHandle(Widget w) {
+    return Internal_PackageSupport.topHandle(w);
+}
 
 }
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/CommandPresentationStrategy.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Nokia Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.swt.internal.qt;
-
-import org.eclipse.ercp.swt.mobile.Command;
-import org.eclipse.swt.internal.qt.CommandArranger.CommandCollection;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-/**
- * This is the interface that all the {@link Command} presentation is delegated to.
- * The implementations of this abstract class are expected to provide the
- * presentation logic for their respective uses.
- *
- * The implementations of this class can be specific to a platform, toolkit or a
- * combination of factors. Refer to {@link CommandArranger} on the loading mechanism
- * of the {@link CommandPresentationStrategy} implementation.
- *
- * Since the implementations can be specific to a toolkit implementations are expected to
- * handle the following.
- * <ul>
- * 	<li>Ordering of the {@link Command}s</li>
- * 	<li>Positioning {@link Command}s to correct soft keys or menus so that they are accessible</li>
- * </ul>
- *
- */
-public abstract class CommandPresentationStrategy {
-
-
-    /**
-     * CommandArranger delegates to this method when the currently active menu bar has changed.
-     * This does not include the cases where menu bar changes due to active window change which
-     * causes the menu bar to change on some platforms.
-     *
-     * @param newMenuBar
-     * @param commands
-     */
-    protected abstract void handleMenuBarChanged( int newMenuBar, CommandCollection commands );
-
-    /**
-     * CommandArranger delegates to this method when the currently focused control has changed.
-     * On some platforms a focus change can also be accompanied with a menu bar change. Such menu bar
-     * changes due to active window change must be handled here.
-     *
-     * @param focused-currently focused control
-     * @param oldCommands-the commands of the previous focus context
-     * @param commands-of the current focus context
-     *
-     * @see CommandArranger#focusedControlChanged()
-     */
-    protected abstract void handleFocusChange( Control focused, CommandCollection oldCommands, CommandCollection commands );
-
-    /**
-     * CommandArranger delegates to this method, an added or removed Command is in the current
-     * focus context and needs to be presented. In other words, this method does not get notification of
-     * all added or removed Commands but only those that has some impact on the representation.
-     *
-     * @param added Command
-     * @param removed Command
-     * @param commands including the added/removed command
-     *
-     * @see CommandArranger#commandAdded(Command)
-     * @see CommandArranger#commandRemoved(Command)
-     */
-    protected abstract void handleCommandListChange(Command added, Command removed, CommandCollection commands );
-
-    /**
-     * CommandArranger reports the default command changes to this method. However implementations
-     * should take into account default commands on focus changes.
-     *
-     * @param defaultCommand
-     */
-    protected abstract void handleDefaultCommandChange( Command defaultCommand );
-    /**
-     * This method is called when the CommandArranger is disposed as part of
-     * the disposal of the {@link Display} or
-     * if it is replaced by a new one on the CommandArranger.
-     *
-     * On Display dispose, the method is called after all the Shells are disposed but before the Display is cleaned.
-     *
-     * @see CommandArranger#setPresentationStrategy(CommandPresentationStrategy)
-     */
-    protected abstract void dispose();
-
-}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/DesktopCommandPresentationStrategy.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Nokia Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.swt.internal.qt;
-
-import org.eclipse.ercp.swt.mobile.Command;
-import org.eclipse.swt.internal.qt.CommandArranger.CommandCollection;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Internal_PackageSupport;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Widget;
-
-public class DesktopCommandPresentationStrategy extends
-        CommandPresentationStrategy {
-
-    private int commandsMenu;
-    private int commandsMenuAction;
-    private Control previousFocus;
-
-    public DesktopCommandPresentationStrategy(){
-        super();
-        initCommandsMenu();
-    }
-
-    protected void handleCommandListChange(Command added, Command removed,
-            CommandCollection commands) {
-
-        Shell shell = null;
-        if ( added != null ){
-            shell = added.control.getShell();
-            OS.QMenu_addAction(commandsMenu, handle(added) );
-        }
-        else{
-            shell = removed.control.getShell();
-            OS.QWidget_removeAction(commandsMenu, handle(removed) );
-        }
-
-        OS.QMenuBar_addAction(shell.internal_getOwnMenuBar(), commandsMenuAction );
-    }
-
-    protected void handleFocusChange(Control focused,
-            CommandCollection oldCommands, CommandCollection commands) {
-        Shell shell = focused.getShell();
-
-        if( oldCommands != null && oldCommands.getSize() >0 ){
-            Command[] remove = oldCommands.getCommands(null);
-            for(int i=0; i< remove.length; i++){
-                if (previousFocus!= null && remove[i].control == previousFocus){
-                    OS.QWidget_removeAction(handle(previousFocus), handle(remove[i]));
-                }else{
-                    OS.QWidget_removeAction(commandsMenu, handle(remove[i]));
-                }
-            }
-        }
-
-        if ( commands != null && commands.getSize() > 0 ){
-            OS.QMenuBar_addAction(shell.internal_getOwnMenuBar(), commandsMenuAction );
-            Command[] add = commands.getCommands(null);
-            CommandUtils.sort(add);
-            for(int i=0 ; i < add.length; i++){
-                if ( add[i].control != focused ){
-                    OS.QMenu_addAction( commandsMenu, handle(add[i]) );
-                }
-                else{
-                    OS.QWidget_addAction(handle(focused), handle(add[i]));
-                }
-                if (add[i].isDefaultCommand() )OS.QMenu_setDefaultAction( commandsMenu, handle(add[i]) );
-            }
-        }
-        //Store for use next time.
-        previousFocus=focused;
-    }
-
-    protected void handleMenuBarChanged(int newMenuBar,
-            CommandCollection commands) {
-        OS.QMenuBar_addAction(newMenuBar, commandsMenuAction );
-    }
-
-
-    protected void dispose() {
-        if (commandsMenu != 0 ){
-            QObjectDeleteWrapper.deleteSafely( commandsMenu );
-            commandsMenu = 0;
-        }
-        if (commandsMenuAction != 0 ){
-            QObjectDeleteWrapper.deleteSafely( commandsMenuAction );
-            commandsMenuAction = 0;
-        }
-    }
-
-    private void initCommandsMenu (){
-        commandsMenuAction = OS.QAction_new( 0 );
-        OS.QAction_setText( commandsMenuAction, "Commands");
-        commandsMenu = OS.QMenu_new( 0 );
-        OS.QAction_setMenu( commandsMenuAction, commandsMenu );
-    }
-
-    protected void handleDefaultCommandChange(Command defaultCommand) {
-        int handle = 0;
-        if (defaultCommand != null ) handle = handle(defaultCommand);
-        OS.QMenu_setDefaultAction( commandsMenu, handle );
-    }
-
-
-    private final int handle(Widget w) {
-        return Internal_PackageSupport.handle(w);
-    }
-}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/OS.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/OS.java	Mon Oct 04 11:29:25 2010 +0300
@@ -236,6 +236,9 @@
     public static final int QSWTEVENT_MOBILEDEVICECLOSED = QSWTEVENT_ID_RANGE_FIRST + 8;
     public static final int QSWTEVENT_SCREENACTIVATED = QSWTEVENT_ID_RANGE_FIRST + 9;
     public static final int QSWTEVENT_SCREENDEACTIVATED = QSWTEVENT_ID_RANGE_FIRST + 10;
+    public static final int QSWTEVENT_SYMBIAN_WINDOW_FULLY_VISIBLE = QSWTEVENT_ID_RANGE_FIRST + 11;
+    public static final int QSWTEVENT_SYMBIAN_WINDOW_PARTIALLY_VISIBLE = QSWTEVENT_ID_RANGE_FIRST + 12;
+    public static final int QSWTEVENT_SYMBIAN_WINDOW_NOT_VISIBLE = QSWTEVENT_ID_RANGE_FIRST + 13;
 
     // Qt connection types for signal-slot connections
     public static final int QT_AUTOCONNECTION = 0;
@@ -547,6 +550,8 @@
     public static final int QT_WA_PAINTONSCREEN = 8;
     public static final int QT_WA_PAINTUNCLIPPED = 52;
     public static final int QT_WA_INPUTMETHODENABLED = 14;
+    public static final int QT_WA_NOMOUSEPROPAGATION = 73;
+    public static final int QT_WA_SHOWWITHOUTACTIVATING = 98;
 
     // QStyle::StandardPixmap
     public static final int QSTYLE_SP_MESSAGEBOXINFORMATION = 9;
@@ -1056,7 +1061,14 @@
     public static final native int QIcon_new();
     public static final native void QIcon_delete(int handle);
     public static final native int QIcon_pixmap(int handle, int w, int h);
-
+    
+    // 
+    // HbIcon
+    // 
+    public static final native int HbIcon_new(String name);
+    public static final native int HbIcon_pixmap(int handle);
+    public static final native void HbIcon_delete(int handle);
+    
     //
     // AbstractListModel
     //
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/SymbianWindowVisibilityListener.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+
+package org.eclipse.swt.internal.qt;
+
+import org.eclipse.swt.widgets.Widget;
+
+public interface SymbianWindowVisibilityListener {
+    /**
+     * Notifies the listeners when the visibility of a window owing widget is changing.
+     * May be sent either before or after the actual visibility is changed.
+     * @param widget - the window owing widget who's visibility is being changed.
+     * @param visible - true when the widget is becoming visible.
+     */
+    public abstract void handleSymbianWindowVisibilityChange(Widget widget, boolean visible);
+}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/UIThreadManager.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Nokia Corporation - initial implementation
- *******************************************************************************/
-
-package org.eclipse.swt.internal.qt;
-
-import org.eclipse.swt.internal.qt.ApplicationUIListener;
-import org.eclipse.swt.internal.qt.midp.UIThreadLauncher;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Internal_PackageSupport;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * A class that manages the UI thread hand-over from the internal UI event loop
- * to the application.
- */
-public final class UIThreadManager {
-	private static Object lock = new Object();
-	private static boolean threadWaitingForApplication;
-	private static Runnable applicationRunnable;
-	private static ApplicationUIListener applicationUIListener;
-		
-	/**
-	 * Pass the control of the thread to the application by calling a Runnable
-	 * provided by the application. If the Runnable has not yet been provided
-	 * then the thread waits until it becomes available, or the wait is aborted
-	 * by calling <code>abortWait()</code>. 
-	 */
-	public static void runApplicationUI() {
-		synchronized(lock) {
-			if(!applicationWaiting()) {
-				waitForApplication();
-			}
-			callback();
-		}
-	}
-
-	/**
-	 * If the UI thread is waiting for the application to request the callback
-	 * in the UI thread then calling this will abort the wait and make the UI
-	 * thread to return back from the <code>runApplicationUI()</code>.
-	 */
-	public static void abortWait() {
-		synchronized(lock) {
-			lock.notify();
-		}
-	}
-
-	/**
-	 * Called indirectly by the application when it's requesting the UI thread. 
-	 * Application will pass a Runnable as a parameter and expects it to get called
-	 * in the UI thread. 
-	 * 
-	 * @param runnable
-	 *            The Runnable to call in the UI thread.
-	 * @return True if obtaining the UI thread was successful and the runnable
-	 *         will be called.
-	 */
-	public static boolean startInUIThread(Runnable runnable) {
-		synchronized(lock) {
-			applicationRunnable = runnable;
-			if(threadWaitingForApplication) {
-				lock.notify();
-			} else {
-				if(!waitForUIThread()) {
-					// If the internal UI has not been created then it can't be
-					// signaled and we can't wait for it. This must mean there's
-					// no UI thread yet in the process and we can create it here.
-					if(!UIThreadLauncher.startInUIThread(runnable)) {
-				    	return false;
-				    }	
-				}
-			}
-		}
-		return true;
-	}
-	
-	/**
-	 * Sets the listener that will be notified of the state of the UI during its
-	 * life-time.
-	 */
-	public static void setApplicationUIListener(ApplicationUIListener listener) {
-		synchronized(lock) {
-			applicationUIListener = listener;
-		}
-	}
-	
-	/*
-	 * Signal the internal UI loop and wait until it passes the control of the
-	 * UI thread into runApplicationUI(). Return false if the internal UI can't
-	 * be signaled. 
-	 */
-	private static boolean waitForUIThread() {
-		if(signalUIThreadRequest()) {
-			try {
-				lock.wait();
-			} catch(InterruptedException e) {
-				// Nothing to do
-			}
-			return true;
-		}
-		return false;
-	}
-
-	/*
-	 * Wait until signaled by the application requesting the callback to its
-	 * Runnable, or by abortWait().
-	 */
-	private static void waitForApplication() {
-		threadWaitingForApplication = true;
-		try {
-			lock.wait();
-		} catch(InterruptedException e) {
-			// Nothing to do
-		} finally {
-			threadWaitingForApplication = false;
-		}		
-	}
-	
-	/*
-	 * Returns true if application has provided the Runnable and is thus waiting
-	 * for the callback.
-	 */
-	private static boolean applicationWaiting() {
-		return (applicationRunnable != null);
-	}
-	
-	/*
-	 * Post an event to the internal Display to request the control of the UI
-	 * thread. After this runApplication() should get called in the UI thread.
-	 */
-	private static boolean signalUIThreadRequest() {
-		Display internalDisplay = Internal_PackageSupport.getInternalDisplayInstance();
-		if(internalDisplay != null) {
-			if(applicationUIListener != null) {
-				applicationUIListener.applicationUIThreadRequest();
-			}
-			return true;
-		}
-		return false;
-	}
-
-	/*
-	 * Call back the application's runnable
-	 */
-	private static void callback() {
-		try {
-			if(applicationRunnable != null) {
-				flushInternals();
-				applicationRunnable.run();
-			}
-		} finally {
-			applicationRunnable = null;
-		}
-	}
-	
-	/*
-	 * Clear any events or other items possibly left over by any previous usage
-	 * of the UI resources. There must not be anything that can interfere with
-	 * the application. It must appear as the application starts with an
-	 * uninitialized UI.
-	 */
-	private static void flushInternals() {
-		Display internalDisplay = Internal_PackageSupport.getInternalDisplayInstance();
-		
-		// Dispose all widgets
-		Shell[] shells = internalDisplay.getShells();
-		for(int i = 0; i < shells.length; ++i) {
-			if(shells[i] != null && !shells[i].isDisposed()) {
-				shells[i].dispose();
-			}
-		}
-		
-		// Flush the event queue
-		while(internalDisplay.readAndDispatch()) {}
-	}
-}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/GraphicsContext.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/GraphicsContext.java	Mon Oct 04 11:29:25 2010 +0300
@@ -340,7 +340,7 @@
      */
     public void bindTarget(org.eclipse.swt.widgets.Control target) {
         if(target == null) {
-        	throw new NullPointerException("target is null");
+            throw new NullPointerException("target is null");
         }
         if(target.isDisposed())
             throw new IllegalArgumentException("Target already disposed");
@@ -361,7 +361,7 @@
      */
     public void bindTarget(org.eclipse.swt.widgets.Display target) {
         if(target == null) {
-        	throw new NullPointerException("target is null");
+            throw new NullPointerException("target is null");
         }
         if(target.isDisposed())
             throw new IllegalArgumentException("Target already disposed");
@@ -383,7 +383,7 @@
      */
     public void bindTarget(org.eclipse.swt.internal.qt.graphics.Image target) {
         if(target == null) {
-        	throw new NullPointerException("target is null");
+            throw new NullPointerException("target is null");
         }
         if(target.isDisposed())
             throw new IllegalArgumentException("Target already disposed");
@@ -406,10 +406,10 @@
      */
     public void bindTarget(org.eclipse.swt.internal.qt.graphics.NativeCommandBuffer target, org.eclipse.swt.widgets.Control flushTarget) {
         if(target == null) {
-        	throw new NullPointerException("target is null");
+            throw new NullPointerException("target is null");
         }
         if(flushTarget == null) {
-        	throw new NullPointerException("flushTarget is null");
+            throw new NullPointerException("flushTarget is null");
         }
         if(target.isDisposed())
             throw new IllegalArgumentException("Target already disposed");
@@ -444,7 +444,7 @@
      */
     public void bindTarget(org.eclipse.swt.internal.qt.graphics.NativeCommandBuffer target) {
         if(target == null) {
-        	throw new NullPointerException("Target is null");
+            throw new NullPointerException("Target is null");
         }
         if(target.isDisposed()) {
             throw new IllegalArgumentException("target already disposed");
@@ -464,12 +464,12 @@
      */
     public void bindTarget(org.eclipse.swt.internal.qt.graphics.WindowSurface target) {
         if(target == null) {
-        	throw new NullPointerException("target is null");
+            throw new NullPointerException("target is null");
         }
-    	if(target.isDisposed()) {
+        if(target.isDisposed()) {
             throw new IllegalArgumentException("target already disposed");
         }
-    	bindTarget(target, TARGET_WINDOWSURFACE, target.handle, 0); 
+        bindTarget(target, TARGET_WINDOWSURFACE, target.handle, 0); 
     }
     
     /**
@@ -560,6 +560,10 @@
         }
         // if buffer does not contain data do nothing
         if(buffer.containsData()) {
+            // Notify the image that it will get modified. This affects any existing shallow copies of it. 
+            if(targetData.type == GraphicsContext.TARGET_IMAGE) {
+                ((Image)targetData.target).pixelDataModified();
+            }
             processBuffer(buffer);
         }
     }
@@ -1149,11 +1153,11 @@
      * @throws NullPointerException if surface is null
      */
     public void drawWindowSurface(WindowSurface surface, int x, int y, int width, int height) {
-    	if(surface == null) 
-    	{
-    	    throw new NullPointerException("surface is null");
-    	}
-    	OS.graphicsContext_drawWindowSurface(handle, surface.handle, x, y, width, height);
+        if(surface == null) 
+        {
+            throw new NullPointerException("surface is null");
+        }
+        OS.graphicsContext_drawWindowSurface(handle, surface.handle, x, y, width, height);
     }
     
     
@@ -2094,19 +2098,21 @@
                         }
                         case JavaCommandBuffer.OP_DRAWIMAGE1:
                         {
-                            Image img = (Image)images.elementAt(imageCount++);
+                            Image img = (Image)images.elementAt(imageCount);
+                            images.setElementAt(null, imageCount++);
                             OS.graphicsContext_drawImage(handle, 
                                                          img.handle, 
                                                          intParams[i++], 
                                                          intParams[i++]);
                             // As we made a shallow copy of the image in buffer
                             // its safe to delete that here
-                            img.dispose(); 
+                            img.freeCommandBufferCopy();
                             break;
                         }
                         case JavaCommandBuffer.OP_DRAWIMAGE2:
                         {
-                            Image img = (Image)images.elementAt(imageCount++);  
+                            Image img = (Image)images.elementAt(imageCount);
+                            images.setElementAt(null, imageCount++);
                             OS.graphicsContext_drawImage(handle, 
                                                          img.handle, 
                                                          intParams[i++], 
@@ -2120,7 +2126,7 @@
                                                          intParams[i++]);
                             // As we made a shallow copy of the image in buffer
                             // its safe to delete that here
-                            img.dispose(); 
+                            img.freeCommandBufferCopy();
                             break;
                         }
                         case JavaCommandBuffer.OP_DRAWFOCUS:
@@ -2227,7 +2233,7 @@
                         }
                         case JavaCommandBuffer.OP_DRAWROUNDRECT:
                         {
-                            OS.graphicsContext_fillRoundRect(handle, 
+                            OS.graphicsContext_drawRoundRect(handle, 
                                                              intParams[i++], 
                                                              intParams[i++], 
                                                              intParams[i++], 
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/Image.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/Image.java	Mon Oct 04 11:29:25 2010 +0300
@@ -12,6 +12,8 @@
 
 
 import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Internal_PackageSupport;
 
 public final class Image {
 
@@ -128,6 +130,17 @@
     // GraphicsContext bound to this image
     private GraphicsContext boundingGc = null;
 
+    // Image manages copies of itself for command buffering of drawImage and drawRegion. 
+    private Image commandBufferCopy;
+    private int commandBufferCopyRefs;
+    private boolean commandBufferCopyDirty;
+
+    // A copy-constructed Image remembers what it's a copy of
+    private Image whatAmIACopyOf;
+
+    private Image() {
+    }
+    
     /**
      * Constructs new image with given native image handle.
      *
@@ -135,7 +148,7 @@
      * @throws OutOfMemoryError if imgHandlde is invalid
      */
     Image(int imgHandle) {
-    	Utils.validateUiThread();
+        Utils.validateUiThread();
         // validate handle
         if(imgHandle == 0) {
             throw new OutOfMemoryError();
@@ -218,10 +231,7 @@
         if (sourceImage == null) {
             throw new NullPointerException("img is null");
         }
-        // Construct image in native side and store the handle
-        handle = OS.image_create(sourceImage.handle, x, y, width, height); // may throw outOfMemoryError
-        // set dimensions
-        updateSize();
+        createCopy(sourceImage, x, y, width, height);
     }
 
     /**
@@ -269,7 +279,7 @@
      * releaseTarget() of binding gc is called automatically.
      */
     public void dispose() {
-    	Utils.validateUiThread();
+        Utils.validateUiThread();
         if (handle != 0 || !disposed) {
             // If this instance is being disposed while
             // gc is still bound, release binding before disposing.
@@ -285,6 +295,8 @@
             // it is created for this instance
             SurfaceCache.getInstance().deleteSurface(this);
 
+            whatAmIACopyOf = null;
+
             // dispose native peer
             OS.image_dispose(handle);
             handle = 0;
@@ -308,10 +320,10 @@
      * @return image format
      */
     public int getFormat() {
-    	checkState();
-    	if (pixelFormat == FORMAT_IMG_NONE) {
-    		pixelFormat = OS.image_getFormat(handle);
-    	}
+        checkState();
+        if (pixelFormat == FORMAT_IMG_NONE) {
+            pixelFormat = OS.image_getFormat(handle);
+        }
         return pixelFormat;
     }
     /**
@@ -593,7 +605,7 @@
      */
     public int getHandle()
     {
-    	checkState();
+        checkState();
         return handle;
     }
 
@@ -603,7 +615,7 @@
      */
     synchronized public int getNativePixmapHandle()
     {
-    	checkState();
+        checkState();
         if(pixmapHandle == 0)
         {
             // In the current implementation this will return
@@ -621,7 +633,7 @@
      * @return New object
      */
     public ImageData getImageData() {
-    	checkState();
+        checkState();
         return OS.image_getImageData(handle);
     }
 
@@ -629,7 +641,7 @@
      * Private helper to check the state of the current instance.
      */
     private void checkState() {
-    	Utils.validateUiThread();
+        Utils.validateUiThread();
         if(disposed) {
             throw new IllegalStateException("Image already disposed");
         }
@@ -657,4 +669,112 @@
         int imageHandle = OS.image_create(imageData);
         return new Image(imageHandle);
     }
+    
+    /**
+     * Constructs new image with given native QPixmap handle.
+     * @param pixmapHandle Handle of native QPixmap.
+     * @return Instance of loaded image.
+     */
+    public static Image createImageFromPixmap(int pixmapHandle) {
+        // input validation
+        if(pixmapHandle <= 0) {
+            throw new IllegalArgumentException("Invalid pixmap handle");
+        }
+        // Construct an ge in native side and store the handle
+        int handle = OS.image_create(pixmapHandle);
+        return new Image(handle);
+    }
+
+    /**
+     * Obtains a shallow copy of this Image to be placed in the command buffer.
+     * The returned copy must be marked as free by calling freeCommandBufferCopy
+     * when it's no longer needed.
+     * 
+     * @return The copy
+     */
+    Image getCommandBufferCopy() {
+        if(commandBufferCopyDirty) {
+            return copyInUIThread();
+        }
+        if(commandBufferCopy == null) {
+            commandBufferCopyDirty = false;
+            commandBufferCopy = copyInUIThread();
+            commandBufferCopyRefs = 0;
+        }
+        commandBufferCopyRefs++;
+        return commandBufferCopy;
+    }
+
+    /**
+     * Marks a copy returned from getCommandBufferCopy as free.
+     * 
+     * @param image
+     *            The image returned from getShallowCopy.
+     */
+    void freeCommandBufferCopy() {
+        if(disposed) {
+            throw new RuntimeException("Image referenced by command buffer has been disposed");
+        }
+        if(whatAmIACopyOf == null) {
+            throw new RuntimeException("Image not a copy");
+        }
+        whatAmIACopyOf.freeCommandBufferCopyOfMe(this);
+    }
+    
+    /**
+     * Tells to the Image that it has been modified and any copies returned from
+     * getShallowCopy() have thus become deep copies.
+     */
+    void pixelDataModified() {
+        if(commandBufferCopy != null) {
+            commandBufferCopyDirty = true;
+        }
+    }
+    
+    /*
+     * Copy-construction
+     */
+    private void createCopy(Image sourceImage, int x, int y, int width, int height) {
+        // Construct image in native side and store the handle
+        handle = OS.image_create(sourceImage.handle, x, y, width, height); // may throw outOfMemoryError
+        // set dimensions
+        updateSize();
+        whatAmIACopyOf = sourceImage;
+    }
+
+    /*
+     * Called on the Image when a copy it has returned from getCommandBufferCopy
+     * is being freed by a call to freeCommandBufferCopy. The Image may be
+     * disposed at this point while the copy is not.
+     */
+    private void freeCommandBufferCopyOfMe(Image copy) {
+        if(copy != commandBufferCopy) {
+            throw new RuntimeException("Copy doesn't exist, freed multiple times?");
+        } else {
+            commandBufferCopyRefs--;
+            if(commandBufferCopyRefs <= 0) {
+                commandBufferCopy.dispose();
+                commandBufferCopy = null;
+            }
+        }
+    }
+    
+    /*
+     * Creates a shallow copy of the Image in the UI thread. 
+     */
+    private Image copyInUIThread() {
+        Display d = Internal_PackageSupport.getDisplayInstance();
+        final Image copy = new Image();
+        if(d != null) {
+            d.syncExec(new Runnable() {
+                public void run() {
+                    copy.createCopy(Image.this, 0, 0, 0, 0);
+                }
+            });
+        }
+        if(copy.handle == 0) {
+            return null;
+        }
+        return copy;
+    }
 }
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/ImageLoader.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/ImageLoader.java	Mon Oct 04 11:29:25 2010 +0300
@@ -13,6 +13,7 @@
 import java.io.*;
 
 import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Device;
 
 /**
  * ImageLoader is class for image loading from various data formats.
@@ -230,6 +231,33 @@
     }
 
     /**
+     * Returns the bounds of an Image without creating an actual Image instance.
+     *
+     * @param is The InputStream from where to read the image data from
+     * @return Bounds of the image
+     */
+    public static Point getImageSize(InputStream is) throws IOException {
+
+        if (is == null) {
+            throw new NullPointerException("InputStream is null");
+        }
+
+        int bytesAvailable = is.available(); // may throw IOException
+
+        if (bytesAvailable == 0) {
+            throw new IllegalArgumentException("Empty file");
+        }
+
+        byte [] data = new byte[bytesAvailable];
+        
+        if (is.read(data, 0, data.length) != bytesAvailable) {
+            throw new IOException("Could not load data from InputStream");
+        }
+        
+        return OS.imageLoader_getImageSize(data);
+    }
+
+    /**
      * Private helper to check the state of the current instance.
      */
     private void checkState() {
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/JavaCommandBuffer.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/JavaCommandBuffer.java	Mon Oct 04 11:29: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 program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -8,11 +8,13 @@
  * Contributors:
  *     Nokia Corporation - initial implementation
  *******************************************************************************/
+
 package org.eclipse.swt.internal.qt.graphics;
 
 import java.util.Vector;
 import java.util.Enumeration;
 
+
 /**
  * This class implements a command buffer that can be bound by GraphicsContext
  * to collect the drawing operations. Contents of the command buffer can be replayed to
@@ -26,628 +28,627 @@
  */
 public final class JavaCommandBuffer {
 
-	// All collected drawing operations and their parameters
-	private int[] intParams;
-	private int intCount;
-	private StringBuffer strParams;
+    // All collected drawing operations and their parameters
+    private int[] intParams;
+    private int intCount;
+    private StringBuffer strParams;
 
-	// Holder for images
-	private Vector images;
+    // Container for images
+    private Vector images;
 
-	// holder for rgbData
-	private Vector rgbData;
+    // Container for rgbData
+    private Vector rgbData;
 
-	// This flag is indicates if this buffer is bound by some GraphicsContext
-	private boolean bound;
+    // This flag is indicates if this buffer is bound by some GraphicsContext
+    private boolean bound;
 
     // This flag indicates if this buffer is empty or not
-	private boolean containsData;
-	
-	// This flag indicates if this buffer has any draw commands in it
-	private boolean containsPrimitiveData;
+    private boolean containsData;
+
+    // This flag indicates if this buffer has any draw commands in it
+    private boolean containsPrimitiveData;
 
     // Memory management configuration constants
-	private static final int INT_BUF_GRANULARITY     	 = 10;
-	private static final int INT_BUF_INITIAL_SIZE    	 = 250;
-	private static final int IMAGE_BUF_INITIAL_SIZE 	 = 3;
-	private static final int IMAGE_BUF_GRANULARITY  	 = 2;
-	private static final int STRING_BUFFER_INITIAL_SIZE = 10;
+    private static final int INT_BUF_GRANULARITY         = 2560; // 10kB
+    private static final int INT_BUF_INITIAL_SIZE        = 256; // 1kB
+    private static final int IMAGE_BUF_INITIAL_SIZE      = 256; // 1kB
+    private static final int IMAGE_BUF_GRANULARITY       = 256; // 1kB
+    private static final int STRING_BUFFER_INITIAL_SIZE  = 256; // 1kB
 
-	// Prefixes for different categories of op codes, stored in MSB
-	final static int DRAW_PREFIX = 0;
-	final static int FILL_PREFIX = 1;
-	final static int SET_PREFIX = 2;
-	final static int MISC_PREFIX = 3;
+    // Prefixes for different categories of op codes, stored in MSB
+    final static int DRAW_PREFIX = 0;
+    final static int FILL_PREFIX = 1;
+    final static int SET_PREFIX = 2;
+    final static int MISC_PREFIX = 3;
 
-	// Unique operation codes for all the gc operations that can be buffered.
-	static final int OP_DRAWARC            = ((DRAW_PREFIX << 24) | 1);
-	static final int OP_DRAWFOCUS          = ((DRAW_PREFIX << 24) | 2);
-	static final int OP_DRAWIMAGE1         = ((DRAW_PREFIX << 24) | 3);
-	static final int OP_DRAWIMAGE2         = ((DRAW_PREFIX << 24) | 4);
-	static final int OP_DRAWLINE           = ((DRAW_PREFIX << 24) | 5);
-	static final int OP_DRAWELLIPSE        = ((DRAW_PREFIX << 24) | 6);
-	static final int OP_DRAWPOINT          = ((DRAW_PREFIX << 24) | 7);
-	static final int OP_DRAWPOLYGON        = ((DRAW_PREFIX << 24) | 8);
-	static final int OP_DRAWPOLYLINE       = ((DRAW_PREFIX << 24) | 9);
-	static final int OP_DRAWRECT           = ((DRAW_PREFIX << 24) | 10);
-	static final int OP_DRAWRGB_INT        = ((DRAW_PREFIX << 24) | 11);
-	static final int OP_DRAWRGB_BYTE       = ((DRAW_PREFIX << 24) | 12);
-	static final int OP_DRAWRGB_SHORT      = ((DRAW_PREFIX << 24) | 13);
-	static final int OP_DRAWROUNDRECT      = ((DRAW_PREFIX << 24) | 14);
-	static final int OP_DRAWSTRING         = ((DRAW_PREFIX << 24) | 15);
-	static final int OP_FILLARC            = ((FILL_PREFIX << 24) | 16);
-	static final int OP_FILLGRADIENTRECT   = ((FILL_PREFIX << 24) | 17);
-	static final int OP_FILLELLIPSE        = ((FILL_PREFIX << 24) | 18);
-	static final int OP_FILLPOLYGON        = ((FILL_PREFIX << 24) | 19);
-	static final int OP_FILLRECT           = ((FILL_PREFIX << 24) | 20);
-	static final int OP_FILLROUNDRECT      = ((FILL_PREFIX << 24) | 21);
-	static final int OP_SETBACKGROUNDALPHA = ((SET_PREFIX << 24) | 22);
-	static final int OP_SETBACKGROUNDCOLOR = ((SET_PREFIX << 24) | 23);
-	static final int OP_SETBLENDINGMODE    = ((SET_PREFIX << 24) | 24);
-	static final int OP_SETCLIP            = ((SET_PREFIX << 24) | 25);
-	static final int OP_CANCELCLIPPING     = ((SET_PREFIX << 24) | 26);
-	static final int OP_SETFONT            = ((SET_PREFIX << 24) | 27);
-	static final int OP_SETFOREGROUNDALPHA = ((SET_PREFIX << 24) | 28);
-	static final int OP_SETFOREGROUNDCOLOR = ((SET_PREFIX << 24) | 29);
-	static final int OP_SETSTROKESTYLE     = ((SET_PREFIX << 24) | 30);
-	static final int OP_SETSTROKEWIDTH     = ((SET_PREFIX << 24) | 31);
-	static final int OP_TRANSLATE          = ((MISC_PREFIX << 24) | 32);
-	static final int OP_SCALE              = ((MISC_PREFIX << 24) | 33);
-	static final int OP_RESETTRANSFORM     = ((MISC_PREFIX << 24) | 34);
-	static final int OP_COPYAREA1          = ((MISC_PREFIX << 24) | 35);
-	static final int OP_COPYAREA2          = ((MISC_PREFIX << 24) | 36);
+    // Unique operation codes for all the gc operations that can be buffered.
+    static final int OP_DRAWARC            = ((DRAW_PREFIX << 24) | 1);
+    static final int OP_DRAWFOCUS          = ((DRAW_PREFIX << 24) | 2);
+    static final int OP_DRAWIMAGE1         = ((DRAW_PREFIX << 24) | 3);
+    static final int OP_DRAWIMAGE2         = ((DRAW_PREFIX << 24) | 4);
+    static final int OP_DRAWLINE           = ((DRAW_PREFIX << 24) | 5);
+    static final int OP_DRAWELLIPSE        = ((DRAW_PREFIX << 24) | 6);
+    static final int OP_DRAWPOINT          = ((DRAW_PREFIX << 24) | 7);
+    static final int OP_DRAWPOLYGON        = ((DRAW_PREFIX << 24) | 8);
+    static final int OP_DRAWPOLYLINE       = ((DRAW_PREFIX << 24) | 9);
+    static final int OP_DRAWRECT           = ((DRAW_PREFIX << 24) | 10);
+    static final int OP_DRAWRGB_INT        = ((DRAW_PREFIX << 24) | 11);
+    static final int OP_DRAWRGB_BYTE       = ((DRAW_PREFIX << 24) | 12);
+    static final int OP_DRAWRGB_SHORT      = ((DRAW_PREFIX << 24) | 13);
+    static final int OP_DRAWROUNDRECT      = ((DRAW_PREFIX << 24) | 14);
+    static final int OP_DRAWSTRING         = ((DRAW_PREFIX << 24) | 15);
+    static final int OP_FILLARC            = ((FILL_PREFIX << 24) | 16);
+    static final int OP_FILLGRADIENTRECT   = ((FILL_PREFIX << 24) | 17);
+    static final int OP_FILLELLIPSE        = ((FILL_PREFIX << 24) | 18);
+    static final int OP_FILLPOLYGON        = ((FILL_PREFIX << 24) | 19);
+    static final int OP_FILLRECT           = ((FILL_PREFIX << 24) | 20);
+    static final int OP_FILLROUNDRECT      = ((FILL_PREFIX << 24) | 21);
+    static final int OP_SETBACKGROUNDALPHA = ((SET_PREFIX << 24) | 22);
+    static final int OP_SETBACKGROUNDCOLOR = ((SET_PREFIX << 24) | 23);
+    static final int OP_SETBLENDINGMODE    = ((SET_PREFIX << 24) | 24);
+    static final int OP_SETCLIP            = ((SET_PREFIX << 24) | 25);
+    static final int OP_CANCELCLIPPING     = ((SET_PREFIX << 24) | 26);
+    static final int OP_SETFONT            = ((SET_PREFIX << 24) | 27);
+    static final int OP_SETFOREGROUNDALPHA = ((SET_PREFIX << 24) | 28);
+    static final int OP_SETFOREGROUNDCOLOR = ((SET_PREFIX << 24) | 29);
+    static final int OP_SETSTROKESTYLE     = ((SET_PREFIX << 24) | 30);
+    static final int OP_SETSTROKEWIDTH     = ((SET_PREFIX << 24) | 31);
+    static final int OP_TRANSLATE          = ((MISC_PREFIX << 24) | 32);
+    static final int OP_SCALE              = ((MISC_PREFIX << 24) | 33);
+    static final int OP_RESETTRANSFORM     = ((MISC_PREFIX << 24) | 34);
+    static final int OP_COPYAREA1          = ((MISC_PREFIX << 24) | 35);
+    static final int OP_COPYAREA2          = ((MISC_PREFIX << 24) | 36);
 
-	/**
-	 * Constructs empty command buffer with defined buffer sizes.
-	 */
-	public JavaCommandBuffer() {
-		intParams = new int[INT_BUF_INITIAL_SIZE];
-		strParams = new StringBuffer(STRING_BUFFER_INITIAL_SIZE);
-		images = new Vector(IMAGE_BUF_INITIAL_SIZE, IMAGE_BUF_GRANULARITY);
-		rgbData = new Vector(IMAGE_BUF_INITIAL_SIZE, IMAGE_BUF_GRANULARITY);
-	}
+    /**
+     * Constructs empty command buffer with defined buffer sizes.
+     */
+    public JavaCommandBuffer() {
+        intParams = new int[INT_BUF_INITIAL_SIZE];
+        strParams = new StringBuffer(STRING_BUFFER_INITIAL_SIZE);
+        images = new Vector(IMAGE_BUF_INITIAL_SIZE, IMAGE_BUF_GRANULARITY);
+        rgbData = new Vector(IMAGE_BUF_INITIAL_SIZE, IMAGE_BUF_GRANULARITY);
+    }
 
-	/**
-	 * Resets the buffer, i.e. removes all recorded commands and related data. The integer array containing
-	 * the actual operation codes is not deleted, only the index pointer is rested, thus the memory consumption of that is not freed.
-	 * CommandBuffer can be reseted only if it is not bound by any GraphicsContext
-	 * @throws IllegalStateException if this CommandBuffer is bound while calling reset
-	 */
-	public void reset() {
-		if(bound) {
-			throw new IllegalStateException("CommandBuffer is still bound by gc");
-		}
-		intCount = 0;
-		strParams.setLength(0);
+    /**
+     * Resets the buffer, i.e. removes all recorded commands and related data. The integer array containing
+     * the actual operation codes is not deleted, only the index pointer is rested, thus the memory consumption of that is not freed.
+     * CommandBuffer can be reseted only if it is not bound by any GraphicsContext
+     * @throws IllegalStateException if this CommandBuffer is bound while calling reset
+     */
+    public void reset() {
+        if(bound) {
+            throw new IllegalStateException("CommandBuffer is still bound by gc");
+        }
+        intCount = 0;
+        strParams.setLength(0);
 
-		Enumeration allImages = images.elements();
-		while(allImages.hasMoreElements()) {
-			Image image = (Image)allImages.nextElement();
-			if(!image.isDisposed()) {
-				image.dispose();
-			}
-		}
-		images.removeAllElements();
-		rgbData.removeAllElements();
-		containsData = false;
-		containsPrimitiveData = false;
-	}
+        Enumeration allImages = images.elements();
+        while(allImages.hasMoreElements()) {
+            Image image = (Image)allImages.nextElement();
+            if(image != null) {
+                image.freeCommandBufferCopy();
+            }
+        }
+        images.removeAllElements();
+        rgbData.removeAllElements();
+        containsData = false;
+        containsPrimitiveData = false;
+    }
 
-	/**
-	 * Checks that does this buffer contain any commands
-	 * @return true if any command has been written to buffer otherwise false
-	 */
-	public boolean containsData() {
-		return containsData;
-	}
-	
-	/**
-	 * Checks that does this buffer contain any draw commands, i.e. any setters etc. 
-	 * that does to cause any pixels to be rendered are ignored 
-	 * @return true if any draw command has been written to buffer otherwise false
-	 */
-	public boolean containsDrawnPrimitives() {
-		return containsPrimitiveData;
-	}
-	
-	/**
-	 * Binds this buffer
-	 */
-	void bind() {
-		bound = true;
-	}
+    /**
+     * Checks that does this buffer contain any commands
+     * @return true if any command has been written to buffer otherwise false
+     */
+    public boolean containsData() {
+        return containsData;
+    }
+
+    /**
+     * Checks that does this buffer contain any draw commands, i.e. any setters etc.
+     * that does to cause any pixels to be rendered are ignored
+     * @return true if any draw command has been written to buffer otherwise false
+     */
+    public boolean containsDrawnPrimitives() {
+        return containsPrimitiveData;
+    }
 
-	/**
-	 * Provides the binding status of this buffer
-	 * @return true if this buffer has been already bound otherwise false
-	 */
-	boolean isBound() {
-		return bound;
-	}
+    /**
+     * Binds this buffer
+     */
+    void bind() {
+        bound = true;
+    }
 
-	/**
-	 * Releases this buffer, i.e. it can be bound by some other GraphicsContext
-	 */
-	void release() {
-		bound = false;
-	}
+    /**
+     * Provides the binding status of this buffer
+     * @return true if this buffer has been already bound otherwise false
+     */
+    boolean isBound() {
+        return bound;
+    }
+
+    /**
+     * Releases this buffer, i.e. it can be bound by some other GraphicsContext
+     */
+    void release() {
+        bound = false;
+    }
 
-	/**
-	 * Writes an integer to given array.
-	 * @param item The item to be added to the array
-	 * @param array The array where to append given item
-	 * @param elementsUsed The size of slots used in given array
-	 * @param granularity The granularity used if the array needs to be enlarged
-	 * @return Array containing the added item
-	 */
-	private int[] writeToArray(int item, int[] array, int elementsUsed, int granularity) {
-		if( array.length < elementsUsed + 1) {
-			int[] src = array;
-			int[] dst = new int[array.length + granularity];
-			System.arraycopy(src, 0, dst, 0, src.length);
-			array = dst;
-		}
-		array[elementsUsed] = item;
-		return array;
-	}
+    private void ensureIntArraySpace(final int items) {
+        if( intParams.length < intCount + items) {
+            int[] dst = new int[intParams.length + Math.max(INT_BUF_GRANULARITY, items)];
+            System.arraycopy(intParams, 0, dst, 0, intParams.length);
+            intParams = dst;
+        }
+        containsData = true;
+    }
+
+    private void reportNotSupported() {
+        throw new RuntimeException("Intenal: Operation not supported with JavaCommandBuffer");
+    }
 
-	private void writeInt(int param) {
-		intParams = writeToArray(param, intParams, intCount++, INT_BUF_GRANULARITY);
-		containsData = true;
-	}
+//    private void printBufferInfo() {
+//        System.out.println("CommandBuffer Info: " +this);
+//        System.out.println("intParamCount: " + intCount);
+//        System.out.println("intBuffer Size: " + intParams.length);
+//        System.out.println("StringBuffer Size: " + strParams.length());
+//    }
 
-	private void writeImage(Image image) {
-		images.addElement(image);
-	}
+    private void raisePrimitiveFlag() {
+        containsPrimitiveData = true;
+    }
+
+    int[] intParams() {
+        return intParams;
+    }
 
-	private void writeStr(String string) {
-    	strParams.append(string);
-	}
+    int intParamCount() {
+        return intCount;
+    }
 
-	private void writeRgb(int[] rgb) {
-		rgbData.addElement(rgb);
-	}
-	private void writeRgb(byte[] rgb) {
-		rgbData.addElement(rgb);
-	}
+    Vector rgbParams() {
+        return rgbData;
+    }
 
-	private void writeRgb(short[] rgb) {
-		rgbData.addElement(rgb);
-	}
+    Vector images() {
+        return images;
+    }
 
-	private void reportNotSupported() {
-		throw new RuntimeException("Intenal: Operation not supported with JavaCommandBuffer");
-	}
+    String strParams() {
+        return strParams.toString();
+    }
 
-	private void printBufferInfo() {
-		System.out.println("CommandBuffer Info: " +this);
-		System.out.println("intParamCount: " + intCount);
-		System.out.println("intBuffer Size: " + intParams.length);
-		System.out.println("StringBuffer Size: " + strParams.length());
-	}
-
-	private void raisePrimitiveFlag() {
-		containsPrimitiveData = true;
-	}
-	
-	int[] intParams() {
-		return intParams;
-	}
+    void drawArc (final int x, final int y, final int width, final int height, final int startAngle, final int arcAngle) {
+        ensureIntArraySpace(7);
+        intParams[intCount++] = OP_DRAWARC;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        intParams[intCount++] = startAngle;
+        intParams[intCount++] = arcAngle;
+        raisePrimitiveFlag();
+    }
 
-	int intParamCount() {
-        return intCount;
-	}
-
-	Vector rgbParams() {
-		return rgbData;
-	}
-
-	Vector images() {
-		return images;
-	}
+    void drawFocus (final int x, final int y, final int width, final int height) {
+        ensureIntArraySpace(5);
+        intParams[intCount++] = OP_DRAWFOCUS;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        raisePrimitiveFlag();
+    }
 
-	String strParams() {
-		return strParams.toString();
-	}
-
-	void drawArc (int x, int y, int width, int height, int startAngle, int arcAngle) {
-		writeInt(OP_DRAWARC);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		writeInt(startAngle);
-		writeInt(arcAngle);
-		raisePrimitiveFlag();
-	}
+    // Must be called from UI thread as images cannot be creates outside that
+    void drawImage(final Image image, final int x, final int y) {
+        ensureIntArraySpace(3);
+        intParams[intCount++] = OP_DRAWIMAGE1;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        // creating copy of image here uses implicit data sharing,
+        // thus only a shallow copy is made
+        images.addElement(image.getCommandBufferCopy());
+        raisePrimitiveFlag();
+    }
 
-	void drawFocus (int x, int y, int width, int height) {
-		writeInt(OP_DRAWFOCUS);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		raisePrimitiveFlag();
-	}
+    // must be called from UI thread as images cannot be creates outside that
+    void drawImage(final Image image, final int tx, final int ty, final int tw, final int th, final int sx, final int sy, final int sw, final int sh, final int manipulation) {
+        ensureIntArraySpace(10);
+        intParams[intCount++] = OP_DRAWIMAGE2;
+        intParams[intCount++] = tx;
+        intParams[intCount++] = ty;
+        intParams[intCount++] = tw;
+        intParams[intCount++] = th;
+        intParams[intCount++] = sx;
+        intParams[intCount++] = sy;
+        intParams[intCount++] = sw;
+        intParams[intCount++] = sh;
+        intParams[intCount++] = manipulation;
+        // creating copy of image here uses implicit data sharing,
+        // thus only a shallow copy is made
+        images.addElement(image.getCommandBufferCopy());
+        raisePrimitiveFlag();
+    }
 
-	// must be called from UI thread as images cannot be creates outside that
-	void drawImage(Image image, int x, int y) {
-		writeInt(OP_DRAWIMAGE1);
-		writeInt(x);
-		writeInt(y);
-		// creating copy of image here uses implicit data sharing,
-		// thus only a shallow copy is made
-		writeImage(new Image(image));
-		raisePrimitiveFlag();
-	}
+    void drawLine (final int x1, final int y1, final int x2, final int y2) {
+        ensureIntArraySpace(5);
+        intParams[intCount++] = OP_DRAWLINE;
+        intParams[intCount++] = x1;
+        intParams[intCount++] = y1;
+        intParams[intCount++] = x2;
+        intParams[intCount++] = y2;
+        raisePrimitiveFlag();
+    }
 
-	// must be called from UI thread as images cannot be creates outside that
-	void drawImage(Image image, int tx, int ty, int tw, int th,int sx, int sy, int sw, int sh, int manipulation) {
-		writeInt(OP_DRAWIMAGE2);
-		writeInt(tx);
-		writeInt(ty);
-		writeInt(tw);
-		writeInt(th);
-		writeInt(sx);
-		writeInt(sy);
-		writeInt(sw);
-		writeInt(sh);
-		writeInt(manipulation);
-		// creating copy of image here uses implicit data sharing,
-		// thus only a shallow copy is made
-		writeImage(new Image(image));
-		raisePrimitiveFlag();
-	}
+    void drawEllipse (final int x, final int y, final int width, final int height) {
+        ensureIntArraySpace(5);
+        intParams[intCount++] = OP_DRAWELLIPSE;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        raisePrimitiveFlag();
+    }
+
+    void drawPoint (final int x, final int y) {
+        ensureIntArraySpace(3);
+        intParams[intCount++] = OP_DRAWPOINT;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        raisePrimitiveFlag();
+    }
 
-	void drawLine (int x1, int y1, int x2, int y2) {
-		writeInt(OP_DRAWLINE);
-		writeInt(x1);
-		writeInt(y1);
-		writeInt(x2);
-		writeInt(y2);
-		raisePrimitiveFlag();
-	}
+    void drawPolygon(final int[] pointArray) {
+        ensureIntArraySpace(2 + pointArray.length);
+        intParams[intCount++] = OP_DRAWPOLYGON;
+        intParams[intCount++] = pointArray.length;
+        for(int i = 0; i < pointArray.length; ++i) {
+            intParams[intCount++] = pointArray[i];
+        }
+        raisePrimitiveFlag();
+    }
 
-	void drawEllipse (int x, int y, int width, int height) {
-		writeInt(OP_DRAWELLIPSE);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		raisePrimitiveFlag();
-	}
+    void drawPolyline(final int[] pointArray) {
+        ensureIntArraySpace(2 + pointArray.length);
+        intParams[intCount++] = OP_DRAWPOLYLINE;
+        intParams[intCount++] = pointArray.length;
+        for(int i = 0; i < pointArray.length; ++i) {
+            intParams[intCount++] = pointArray[i];
+        }
+        raisePrimitiveFlag();
+    }
 
-	void drawPoint (int x, int y) {
-		writeInt(OP_DRAWPOINT);
-		writeInt(x);
-		writeInt(y);
-		raisePrimitiveFlag();
-	}
+    void drawRect (final int x, final int y, final int width, final int height) {
+        ensureIntArraySpace(5);
+        intParams[intCount++] = OP_DRAWRECT;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        raisePrimitiveFlag();
+    }
 
-	void drawPolygon(int[] pointArray) {
-		writeInt(OP_DRAWPOLYGON);
-		writeInt(pointArray.length);
-		for(int i = 0; i < pointArray.length; ++i) {
-			writeInt(pointArray[i]);
-		}
-		raisePrimitiveFlag();
-	}
+    void drawRGB(final int[] rgb, final int offset, final int scanlength, final int x, final int y, final int width, final int height, final boolean processAlpha, final int manipulation) {
+        ensureIntArraySpace(9);
+        intParams[intCount++] = OP_DRAWRGB_INT;
+        intParams[intCount++] = offset;
+        intParams[intCount++] = scanlength;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        intParams[intCount++] = processAlpha? 1 : 0;
+        intParams[intCount++] = manipulation;
+        rgbData.addElement(rgb);
+        raisePrimitiveFlag();
+    }
 
-	void drawPolyline(int[] pointArray) {
-		writeInt(OP_DRAWPOLYLINE);
-		writeInt(pointArray.length);
-		for(int i = 0; i < pointArray.length; ++i) {
-			writeInt(pointArray[i]);
-		}
-		raisePrimitiveFlag();
-	}
-
-	void drawRect (int x, int y, int width, int height) {
-		writeInt(OP_DRAWRECT);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		raisePrimitiveFlag();
-	}
+    void drawRGB(final byte[] rgb, final byte[] transparencyMask, final int offset, final int scanlength, final int x, final int y, final int width, final int height, final int manipulation, final int format) {
+        ensureIntArraySpace(9);
+        intParams[intCount++] = OP_DRAWRGB_BYTE;
+        intParams[intCount++] = offset;
+        intParams[intCount++] = scanlength;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        intParams[intCount++] = manipulation;
+        intParams[intCount++] = format;
+        rgbData.addElement(rgb);
+        rgbData.addElement(transparencyMask);
+        raisePrimitiveFlag();
+    }
 
-	void drawRGB(int[] rgbData, int offset, int scanlength, int x, int y, int width, int height, boolean processAlpha, int manipulation) {
-		writeInt(OP_DRAWRGB_INT);
-		writeInt(offset);
-		writeInt(scanlength);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		writeInt(processAlpha? 1 : 0);
-		writeInt(manipulation);
-		writeRgb(rgbData);
-		raisePrimitiveFlag();
-	}
+    void drawRGB(final short[] rgb, final int offset, final int scanlength, final int x, final int y, final int width, final int height, final boolean processAlpha, final int manipulation, final int format) {
+        ensureIntArraySpace(10);
+        intParams[intCount++] = OP_DRAWRGB_SHORT;
+        intParams[intCount++] = offset;
+        intParams[intCount++] = scanlength;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        intParams[intCount++] = processAlpha? 1 : 0;
+        intParams[intCount++] = manipulation;
+        intParams[intCount++] = format;
+        rgbData.addElement(rgb);
+        raisePrimitiveFlag();
+    }
 
-	void drawRGB(byte[] rgbData, byte[] transparencyMask,int offset, int scanlength, int x, int y, int width, int height, int manipulation, int format) {
-		writeInt(OP_DRAWRGB_BYTE);
-		writeInt(offset);
-		writeInt(scanlength);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		writeInt(manipulation);
-		writeInt(format);
-		writeRgb(rgbData);
-		writeRgb(transparencyMask);
-		raisePrimitiveFlag();
-	}
+    void drawRoundRect (final int x, final int y, final int width, final int height, final int arcWidth, final int arcHeight) {
+        ensureIntArraySpace(7);
+        intParams[intCount++] = OP_DRAWROUNDRECT;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        intParams[intCount++] = arcWidth;
+        intParams[intCount++] = arcHeight;
+        raisePrimitiveFlag();
+    }
 
-	void drawRGB(short[] rgbData, int offset, int scanlength, int x, int y, int width, int height, boolean processAlpha, int manipulation, int format) {
-		writeInt(OP_DRAWRGB_SHORT);
-		writeInt(offset);
-		writeInt(scanlength);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		writeInt(processAlpha? 1 : 0);
-		writeInt(manipulation);
-		writeInt(format);
-		writeRgb(rgbData);
-		raisePrimitiveFlag();
-	}
+    void drawString(final String string, final int x, final int y, final int width, final int height, final int alignments, final int flags, final boolean isTransparent) {
+        ensureIntArraySpace(9);
+        intParams[intCount++] = OP_DRAWSTRING;
+        intParams[intCount++] = string.length();
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        intParams[intCount++] = alignments;
+        intParams[intCount++] = flags;
+        intParams[intCount++] = isTransparent? 1 : 0;
+        strParams.append(string);
+        raisePrimitiveFlag();
+    }
 
-	void drawRoundRect (int x, int y, int width, int height, int arcWidth, int arcHeight) {
-		writeInt(OP_DRAWROUNDRECT);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		writeInt(arcWidth);
-		writeInt(arcHeight);
-		raisePrimitiveFlag();
-	}
+    void fillArc (final int x, final int y, final int width, final int height, final int startAngle, final int arcAngle) {
+        ensureIntArraySpace(7);
+        intParams[intCount++] = OP_FILLARC;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        intParams[intCount++] = startAngle;
+        intParams[intCount++] = arcAngle;
+        raisePrimitiveFlag();
+    }
 
-	void drawString(String string, int x, int y, int width, int height, int alignments, int flags, boolean isTransparent) {
-		writeInt(OP_DRAWSTRING);
-		writeStr(string);
-		writeInt(string.length());
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		writeInt(alignments);
-		writeInt(flags);
-		writeInt(isTransparent? 1 : 0);
-		raisePrimitiveFlag();
-	}
+    void fillGradientRect(final int x, final int y, final int width, final int height, final boolean vertical, final boolean swapColors) {
+        ensureIntArraySpace(7);
+        intParams[intCount++] = OP_FILLGRADIENTRECT;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        intParams[intCount++] = vertical ? 1 : 0;
+        intParams[intCount++] = swapColors ? 1 : 0;
+        raisePrimitiveFlag();
+    }
 
-	void fillArc (int x, int y, int width, int height, int startAngle, int arcAngle) {
-		writeInt(OP_FILLARC);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		writeInt(startAngle);
-		writeInt(arcAngle);
-		raisePrimitiveFlag();
-	}
+    void fillEllipse (final int x, final int y, final int width, final int height) {
+        ensureIntArraySpace(5);
+        intParams[intCount++] = OP_FILLELLIPSE;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        raisePrimitiveFlag();
+    }
 
-	void fillGradientRect(int x, int y, int width, int height, boolean vertical, boolean swapColors) {
-		writeInt(OP_FILLGRADIENTRECT);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		writeInt(vertical ? 1 : 0);
-		writeInt(swapColors ? 1 : 0);
-		raisePrimitiveFlag();
-	}
+    void fillPolygon (final int[] pointArray) {
+        ensureIntArraySpace(2 + pointArray.length);
+        intParams[intCount++] = OP_FILLPOLYGON;
+        intParams[intCount++] = pointArray.length;
+        for(int i = 0; i < pointArray.length; ++i) {
+            intParams[intCount++] = pointArray[i];
+        }
+        raisePrimitiveFlag();
+    }
 
-	void fillEllipse (int x, int y, int width, int height) {
-		writeInt(OP_FILLELLIPSE);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		raisePrimitiveFlag();
-	}
+    void fillRect (final int x, final int y, final int width, final int height) {
+        ensureIntArraySpace(5);
+        intParams[intCount++] = OP_FILLRECT;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        raisePrimitiveFlag();
+    }
 
-	void fillPolygon (int[] pointArray) {
-		writeInt(OP_FILLPOLYGON);
-		writeInt(pointArray.length);
-		for(int i = 0; i < pointArray.length; ++i) {
-			writeInt(pointArray[i]);
-		}
-		raisePrimitiveFlag();
-	}
+    void fillRoundRectangle (final int x, final int y, final int width, final int height, final int arcWidth, final int arcHeight) {
+        ensureIntArraySpace(7);
+        intParams[intCount++] = OP_FILLROUNDRECT;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        intParams[intCount++] = arcWidth;
+        intParams[intCount++] = arcHeight;
+        raisePrimitiveFlag();
+    }
 
-	void fillRect (int x, int y, int width, int height) {
-		writeInt(OP_FILLRECT);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		raisePrimitiveFlag();
-	}
+    public void setBackgroundAlpha(final int alpha) {
+        ensureIntArraySpace(2);
+        intParams[intCount++] = OP_SETBACKGROUNDALPHA;
+        intParams[intCount++] = alpha;
+    }
 
-	void fillRoundRectangle (int x, int y, int width, int height, int arcWidth, int arcHeight) {
-		writeInt(OP_FILLROUNDRECT);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		writeInt(arcWidth);
-		writeInt(arcHeight);
-		raisePrimitiveFlag();
-	}
+    void setBackgroundColor(final int argb, final boolean updateAlpha) {
+        ensureIntArraySpace(3);
+        intParams[intCount++] = OP_SETBACKGROUNDCOLOR;
+        intParams[intCount++] = argb;
+        intParams[intCount++] = updateAlpha? 1 : 0;
+    }
 
-	public void setBackgroundAlpha(int alpha) {
-		writeInt(OP_SETBACKGROUNDALPHA);
-		writeInt(alpha);
-	}
+    void setBlendingMode(final int mode) {
+        ensureIntArraySpace(2);
+        intParams[intCount++] = OP_SETBLENDINGMODE;
+        intParams[intCount++] = mode;
+    }
 
-	void setBackgroundColor(int argb, boolean updateAlpha) {
-		writeInt(OP_SETBACKGROUNDCOLOR);
-		writeInt(argb);
-		writeInt(updateAlpha? 1 : 0);
-	}
+    void setClip(final int x, final int y, final int width, final int height, final boolean intersects) {
+        ensureIntArraySpace(6);
+        intParams[intCount++] = OP_SETCLIP;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        intParams[intCount++] = intersects? 1 : 0;
+    }
 
-	void setBlendingMode(int mode) {
-		writeInt(OP_SETBLENDINGMODE);
-		writeInt(mode);
-	}
+    void cancelClipping () {
+        ensureIntArraySpace(1);
+        intParams[intCount++] = OP_CANCELCLIPPING;
+    }
 
-	void setClip(int x, int y, int width, int height, boolean intersects) {
-		writeInt(OP_SETCLIP);
-		writeInt(x);
-		writeInt(y);
-		writeInt(width);
-		writeInt(height);
-		writeInt(intersects? 1 : 0 );
-	}
+    void setFont(final int fontHandle) {
+        ensureIntArraySpace(2);
+        intParams[intCount++] = OP_SETFONT;
+        intParams[intCount++] = fontHandle;
+    }
 
-	void cancelClipping () {
-		writeInt(OP_CANCELCLIPPING);
-	}
+    void setForegroundAlpha(final int alpha) {
+        ensureIntArraySpace(2);
+        intParams[intCount++] = OP_SETFOREGROUNDALPHA;
+        intParams[intCount++] = alpha;
+    }
 
-	void setFont(int fontHandle) {
-		writeInt(OP_SETFONT);
-		writeInt(fontHandle);
-	}
-
-	void setForegroundAlpha(int alpha) {
-		writeInt(OP_SETFOREGROUNDALPHA);
-		writeInt(alpha);
-	}
+    void setForegroundColor(final int argb, final boolean updateAlpha) {
+        ensureIntArraySpace(3);
+        intParams[intCount++] = OP_SETFOREGROUNDCOLOR;
+        intParams[intCount++] = argb;
+        intParams[intCount++] = updateAlpha? 1 : 0;
+    }
 
-	void setForegroundColor(int argb, boolean updateAlpha) {
-		writeInt(OP_SETFOREGROUNDCOLOR);
-		writeInt(argb);
-		writeInt(updateAlpha? 1 : 0);
-	}
+    void setStrokeStyle(final int style) {
+        ensureIntArraySpace(2);
+        intParams[intCount++] = OP_SETSTROKESTYLE;
+        intParams[intCount++] = style;
+    }
 
-	void setStrokeStyle(int style) {
-		writeInt(OP_SETSTROKESTYLE);
-		writeInt(style);
-	}
-
-	void setStrokeWidth(int width) {
-		writeInt(OP_SETSTROKEWIDTH);
-		writeInt(width);
-	}
+    void setStrokeWidth(final int width) {
+        ensureIntArraySpace(2);
+        intParams[intCount++] = OP_SETSTROKEWIDTH;
+        intParams[intCount++] = width;
+    }
 
-	void translate(int x, int y) {
-		writeInt(OP_TRANSLATE);
-		writeInt(x);
-		writeInt(y);
-	}
+    void translate(final int x, final int y) {
+        ensureIntArraySpace(3);
+        intParams[intCount++] = OP_TRANSLATE;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+    }
 
-	void scale(int x, int y) {
-		writeInt(OP_SCALE);
-		writeInt(x);
-		writeInt(y);
-	}
+    void scale(final int x, final int y) {
+        ensureIntArraySpace(3);
+        intParams[intCount++] = OP_SCALE;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
+    }
 
-	void resetTransform() {
-		writeInt(OP_RESETTRANSFORM);
-	}
+    void resetTransform() {
+        ensureIntArraySpace(1);
+        intParams[intCount++] = OP_RESETTRANSFORM;
+    }
 
-	void copyArea(Image image, int x, int y) {
-		writeInt(OP_COPYAREA1);
-        writeInt(x);
-        writeInt(y);
+    void copyArea(final Image image, final int x, final int y) {
+        ensureIntArraySpace(3);
+        intParams[intCount++] = OP_COPYAREA1;
+        intParams[intCount++] = x;
+        intParams[intCount++] = y;
         // TODO does this need flushing on the image
         images.addElement(new Image(image));
         raisePrimitiveFlag();
     }
 
-	void copyArea(int srcX, int srcY, int width, int height, int destX, int destY, boolean paint) {
-        writeInt(OP_COPYAREA2);
-        writeInt(srcX);
-        writeInt(srcY);
-        writeInt(width);
-        writeInt(height);
-        writeInt(destX);
-        writeInt(destY);
-        writeInt(paint? 1 : 0);
+    void copyArea(final int srcX, final int srcY, final int width, final int height, final int destX, final int destY, final boolean paint) {
+        ensureIntArraySpace(8);
+        intParams[intCount++] = OP_COPYAREA2;
+        intParams[intCount++] = srcX;
+        intParams[intCount++] = srcY;
+        intParams[intCount++] = width;
+        intParams[intCount++] = height;
+        intParams[intCount++] = destX;
+        intParams[intCount++] = destY;
+        intParams[intCount++] = paint? 1 : 0;
         raisePrimitiveFlag();
     }
 
-	// Unsupported operations
-	int getAdvancedCharacterWidth(char ch, boolean isAdvanced) {
-		reportNotSupported();
-		return 0;
-	}
+    // Unsupported operations
+    int getAdvancedCharacterWidth(final char ch, final boolean isAdvanced) {
+        reportNotSupported();
+        return 0;
+    }
 
-	void getFontMetricsData(int[] data, int fontHandle) {
-		reportNotSupported();
-	}
+    void getFontMetricsData(final int[] data, final int fontHandle) {
+        reportNotSupported();
+    }
 
-	int getBackgroundAlpha() {
-		reportNotSupported();
-		return 0;
-	}
+    int getBackgroundAlpha() {
+        reportNotSupported();
+        return 0;
+    }
 
-	int getBackgroundColor() {
-		reportNotSupported();
-		return 0;
-	}
-
-	int getBlendingMode() {
-		reportNotSupported();
-		return 0;
-	}
+    int getBackgroundColor() {
+        reportNotSupported();
+        return 0;
+    }
 
-	void getClip(int[] clip) {
-		reportNotSupported();
-	}
+    int getBlendingMode() {
+        reportNotSupported();
+        return 0;
+    }
 
-	int getForegroundAlpha() {
-		reportNotSupported();
-		return 0;
-	}
+    void getClip(final int[] clip) {
+        reportNotSupported();
+    }
 
-	int getForegroundColor() {
-		reportNotSupported();
-		return 0;
-	}
+    int getForegroundAlpha() {
+        reportNotSupported();
+        return 0;
+    }
 
-	void getTextBoundingBox(int[] boundingBox, String string, int alignments, int flags, int rectX, int rectY, int rectWidth, int rectHeight) {
-		reportNotSupported();
-	}
+    int getForegroundColor() {
+        reportNotSupported();
+        return 0;
+    }
 
-	int getStrokeWidth() {
-		reportNotSupported();
-		return 0;
-	}
+    void getTextBoundingBox(final int[] boundingBox, final String string, final int alignments, final int flags, final int rectX, final int rectY, final int rectWidth, final int rectHeight) {
+        reportNotSupported();
+    }
 
-	int getStrokeStyle() {
-		reportNotSupported();
-		return 0;
-	}
+    int getStrokeWidth() {
+        reportNotSupported();
+        return 0;
+    }
 
-	int getTranslateX() {
-		reportNotSupported();
-		return 0;
-	}
+    int getStrokeStyle() {
+        reportNotSupported();
+        return 0;
+    }
 
-	int getTranslateY() {
-		reportNotSupported();
-		return 0;
-	}
+    int getTranslateX() {
+        reportNotSupported();
+        return 0;
+    }
 
-	boolean hasClipping() {
-		reportNotSupported();
-		return false;
-	}
+    int getTranslateY() {
+        reportNotSupported();
+        return 0;
+    }
 
-	void saveSettings() {
-		reportNotSupported();
-	}
+    boolean hasClipping() {
+        reportNotSupported();
+        return false;
+    }
 
-	void restoreSettings() {
-		reportNotSupported();
-	}
+    void saveSettings() {
+        reportNotSupported();
+    }
 
-
-
+    void restoreSettings() {
+        reportNotSupported();
+    }
 }
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/OS.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/OS.java	Mon Oct 04 11:29:25 2010 +0300
@@ -11,6 +11,7 @@
 package org.eclipse.swt.internal.qt.graphics;
 
 import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
 
 final class OS {    
     // Graphics Context
@@ -78,10 +79,11 @@
     static final native void graphicsContext_restoreSettings(int handle);
 
     // Image
-    static final native int image_create(int width, int Height, int fillColor); 
+    static final native int image_create(int width, int height, int fillColor); 
     static final native int image_create(int imageHandle, int x, int y, int width, int height);
     static final native int image_create(ImageData imageData);
     static final native int image_create(int[] argbData, int width, int height, boolean hasAlpha);
+    static final native int image_create(int pixmapHandle);
     static final native int image_getFormat(int handle);
     static final native int image_getHeight(int handle);
     static final native int image_getWidth(int handle);
@@ -103,6 +105,7 @@
     static final native void imageLoader_dispose(int handle);
     static final native int imageLoader_load(int handle, String fileName);
     static final native void imageLoader_setLoadSize(int handle, int width, int height);
+    static final native Point imageLoader_getImageSize(byte[] data);
     
     // FontUtils
     static final native int  fontUtils_getAscent(int fontHandle);
@@ -125,4 +128,5 @@
     static final native int windowsurface_getType(int handle);
     static final native void windowsurface_dispose(int handle);
     static final native void windowsurface_refresh(int handle);
+    static final native void windowsurface_handleSymbianWindowVisibilityChange(int handle, boolean visible);
 }
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/WindowSurface.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/qt/org/eclipse/swt/internal/qt/graphics/WindowSurface.java	Mon Oct 04 11:29:25 2010 +0300
@@ -160,6 +160,17 @@
     	OS.windowsurface_refresh(handle);
     }
     
+    /**
+     * Switch to software rendering when the window is going invisible 
+     * and back to hardware accelerated rendering when going visible.
+     * @param goingVisible True if the window is about to become visible (partially or fully).
+     *                     False if the window is about to become invisible (fully).
+     */
+    public void handleSymbianWindowVisibilityChange(boolean goingVisible)
+    {
+        OS.windowsurface_handleSymbianWindowVisibilityChange(handle, goingVisible);
+    }
+    
     private void checkState() {
     	Utils.validateUiThread();
     	if (disposed) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/s60/org/eclipse/swt/internal/ApplicationUidWrapper.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2009,2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal;
+
+import com.nokia.mj.impl.rt.support.ApplicationInfo;
+
+
+public final class ApplicationUidWrapper {
+
+	public static int uid() {
+        int midletUid = -1;
+        try{
+            String uidS = ApplicationInfo.getInstance().getUid().getStringValue();
+            // In Symbian the UID is in format '[<uid>]' where <uid> is in hex
+            // format. So wee need to take the brackets away.
+            // Long is needed in conversion because UIDs greater than 0x80000000
+            // would fail if Integer would be used. However typecast from long
+            // to int is safe since UID in Symbian is 32 bit.
+            long uidL = Long.parseLong(uidS.substring(1,uidS.length()-1), 16);
+            return (int)uidL;
+        }
+        catch (Throwable t) {/* Not handled*/ }
+        return midletUid;
+    }
+}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/s60/org/eclipse/swt/internal/qt/s60/S60CommandPresentationStrategy.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-package org.eclipse.swt.internal.qt.s60;
-
-import org.eclipse.ercp.swt.mobile.Command;
-import org.eclipse.swt.internal.qt.CommandPresentationStrategy;
-import org.eclipse.swt.internal.qt.CommandUtils;
-import org.eclipse.swt.internal.qt.OS;
-import org.eclipse.swt.internal.qt.CommandArranger.CommandCollection;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Internal_PackageSupport;
-import org.eclipse.swt.widgets.Widget;
-
-public class S60CommandPresentationStrategy extends CommandPresentationStrategy {
-    private Command[] positiveKeyCommands;
-    private Command negativeKeyCommand;
-    private Command defaultCommand;
-
-    public S60CommandPresentationStrategy() {
-        super();
-    }
-
-    protected void dispose() {
-        positiveKeyCommands = null;
-        negativeKeyCommand = null;
-        defaultCommand =null;
-    }
-
-
-    protected void handleCommandListChange(Command added, Command removed,
-            CommandCollection commands) {
-        cleanNegativeCommand();
-        cleanPositiveCommands();
-        updateCommandPositions(commands.getCommands(null));
-        placeNegativeCommand();
-        placePositiveCommands();
-    }
-
-    protected void handleDefaultCommandChange(Command defaultCommand) {
-        this.defaultCommand = defaultCommand;
-        cleanPositiveCommands();
-        placePositiveCommands();
-    }
-
-
-    protected void handleFocusChange(Control focused,
-            CommandCollection oldCommands, CommandCollection commands) {
-
-        //Clean-up the existing commands
-        cleanPositiveCommands();
-        cleanNegativeCommand();
-        //determine where the commands go
-        if( commands != null && commands.getSize()>0 ){
-            Command[] add = commands.getCommands(null);
-            updateCommandPositions(add);
-        }
-        //Place them to their places
-        placePositiveCommands();
-        placeNegativeCommand();
-
-    }
-
-    private void updateCommandPositions(Command[] commands) {
-        positiveKeyCommands = new Command[commands.length];
-        int  positiveKeyIndex=0;
-        for (int i = 0; i < commands.length; i++) {
-            Command cmd = commands[i];
-            if ( cmd.isDefaultCommand()){
-                defaultCommand = cmd;
-                continue;
-            }
-            if( CommandUtils.isNegativeType(cmd.type) ){
-                if (negativeKeyCommand == null || negativeKeyCommand.isDisposed()){
-                    negativeKeyCommand = cmd;
-                }else
-                if( negativeKeyCommand.getPriority() <= cmd.getPriority() ){
-                    positiveKeyCommands[positiveKeyIndex] = negativeKeyCommand;
-                    positiveKeyIndex++;
-                    negativeKeyCommand = cmd;
-                }else{
-                    positiveKeyCommands[positiveKeyIndex] = cmd;
-                    positiveKeyIndex++;
-                }
-                continue;
-            }
-            positiveKeyCommands[positiveKeyIndex]=cmd;
-            positiveKeyIndex++;
-        }
-        if ((positiveKeyIndex) < positiveKeyCommands.length ){// needs to shrink
-            Command[] rightSized = new Command[positiveKeyIndex];
-            System.arraycopy(positiveKeyCommands, 0, rightSized, 0, rightSized.length);
-            positiveKeyCommands = rightSized;
-        }
-    }
-
-
-    private void cleanPositiveCommands() {
-        boolean useBar = false;
-        if ( (positiveKeyCommands != null && positiveKeyCommands.length >1) ||
-                (defaultCommand != null && positiveKeyCommands != null) ){
-            useBar = true;
-        }
-        if (defaultCommand != null && !defaultCommand.isDisposed()
-                && !defaultCommand.control.isDisposed()) {
-            if (useBar) {
-                OS.QWidget_removeAction(defaultCommand.control.getShell()
-                        .internal_getOwnMenuBar(), topHandle(defaultCommand));
-            }
-            else{
-                 OS.QWidget_removeAction(topHandle(defaultCommand.control), topHandle(defaultCommand));
-            }
-        }
-        if (positiveKeyCommands != null) {
-            for (int i = 0; i < positiveKeyCommands.length; i++) {
-                Command cmd = positiveKeyCommands[i];
-                if (cmd == null || cmd.isDisposed()  || cmd.control.isDisposed()){
-                	continue;
-                }
-                int handle = 0;
-                if (useBar) {
-                    handle = cmd.control.getShell().internal_getOwnMenuBar();
-                } else {
-                    handle = topHandle(positiveKeyCommands[0].control);
-                }
-                OS.QWidget_removeAction(handle, topHandle(cmd));
-
-            }
-        }
-    }
-
-   private void cleanNegativeCommand() {
-        if(negativeKeyCommand != null && !negativeKeyCommand.isDisposed() && !negativeKeyCommand.control.isDisposed() ){
-            OS.QWidget_removeAction(topHandle(negativeKeyCommand.control), topHandle(negativeKeyCommand));
-        }
-    }
-
-    private void placeNegativeCommand() {
-        if(negativeKeyCommand != null ){
-            OS.QWidget_addAction(Internal_PackageSupport.topHandle(negativeKeyCommand.control),
-                    topHandle(negativeKeyCommand));
-        }
-    }
-
-    private void placePositiveCommands() {
-        if (defaultCommand != null ) {
-            int defaultCmdHandle = topHandle(defaultCommand);
-            if (positiveKeyCommands != null) {
-                OS.QMenuBar_addAction(defaultCommand.control.getShell()
-                        .internal_getOwnMenuBar(), defaultCmdHandle);
-            } else {
-                OS.QWidget_addAction(Internal_PackageSupport
-                        .topHandle(defaultCommand.control), defaultCmdHandle);
-            }
-        }
-        if (positiveKeyCommands != null) {
-            if (positiveKeyCommands.length == 1 && defaultCommand == null) {
-                OS.QWidget_addAction(Internal_PackageSupport
-                        .topHandle(positiveKeyCommands[0].control),
-                        topHandle(positiveKeyCommands[0]));
-            } else {
-                CommandUtils.sort(positiveKeyCommands);
-                for (int i = 0; i < positiveKeyCommands.length; i++) {
-                    OS.QMenuBar_addAction(positiveKeyCommands[i].control
-                            .getShell().internal_getOwnMenuBar(),
-                            topHandle(positiveKeyCommands[i]));
-                }
-            }
-        }
-    }
-
-    protected void handleMenuBarChanged(int newMenuBar,
-            CommandCollection commands) {
-        placePositiveCommands();
-    }
-
-
-    private static final int topHandle(Widget w) {
-        return Internal_PackageSupport.topHandle(w);
-    }
-}
--- a/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/webkit/org/eclipse/swt/internal/qt/webkit/OS_webkit.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Nokia Corporation - initial implementation
- *******************************************************************************/
-package org.eclipse.swt.internal.qt.webkit;
-
-import org.eclipse.swt.internal.Library;
-
-/**
- * Native methods requiring QtWebkit. They are separated to avoid
- * loading the related libraries until they are needed. 
- */
-public final class OS_webkit {
-    static {
-        Library.loadLibrary("eswtqtwebkit");
-    }
-
-    //
-    // QWebView
-    //
-    public static final native int QWebView_new();
-    public static final native void QWebView_back(int handle);
-    public static final native void QWebView_forward(int handle);
-    public static final native void QWebView_reload(int handle);
-    public static final native void QWebView_setHtml(int handle, String html);
-    public static final native void QWebView_setUrl(int handle, String url);
-    public static final native void QWebView_stop(int handle);
-    public static final native String QWebView_swt_backUrl(int handle);
-    public static final native boolean QWebView_swt_canGoBack(int handle);
-    public static final native boolean QWebView_swt_canGoForward(int handle);
-    public static final native boolean QWebView_swt_evaluateJavaScript(int handle, String script);
-    public static final native String QWebView_swt_forwardUrl(int handle);
-    public static final native String QWebView_url(int handle);
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse_SWT_PI/webkit/org/eclipse/swt/internal/qt/webkit/WebkitOS.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+package org.eclipse.swt.internal.qt.webkit;
+
+import org.eclipse.swt.internal.Library;
+
+/**
+ * Native methods requiring QtWebkit. They are separated to avoid
+ * loading the related libraries until they are needed. 
+ */
+public final class WebkitOS {
+    static {
+        Library.loadLibrary("eswtqtwebkit");
+    }
+
+    //
+    // QWebView
+    //
+    public static final native int QWebView_new();
+    public static final native void QWebView_back(int handle);
+    public static final native void QWebView_forward(int handle);
+    public static final native void QWebView_reload(int handle);
+    public static final native void QWebView_setHtml(int handle, String html);
+    public static final native void QWebView_setUrl(int handle, String url);
+    public static final native void QWebView_stop(int handle);
+    public static final native String QWebView_swt_backUrl(int handle);
+    public static final native boolean QWebView_swt_canGoBack(int handle);
+    public static final native boolean QWebView_swt_canGoForward(int handle);
+    public static final native boolean QWebView_swt_evaluateJavaScript(int handle, String script);
+    public static final native String QWebView_swt_forwardUrl(int handle);
+    public static final native String QWebView_url(int handle);
+}
--- a/javauis/lcdui_qt/src/com/nokia/mj/impl/nokialcdui/LCDUIInvoker.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/src/com/nokia/mj/impl/nokialcdui/LCDUIInvoker.java	Mon Oct 04 11:29:25 2010 +0300
@@ -17,10 +17,9 @@
 package com.nokia.mj.impl.nokialcdui;
 
 import javax.microedition.lcdui.*;
-
 import org.eclipse.swt.internal.qt.graphics.GraphicsContext;
-
 import com.nokia.mid.ui.DirectGraphics;
+import org.eclipse.swt.graphics.Rectangle;
 
 /**
  * Abstract class providing the interface to internal LCDUI resources.
@@ -95,8 +94,12 @@
 
     /**
      * Returns the WindowSurface where g will be drawing.
+     * 
+     * startExternalRendering ensures that the WindowSurface instance is created, thus
+     * it must be called before WindowSurface is queried with this method.
+     * 
      * @param g The graphics object
-     * @return WindowSurface where g will be drawing.
+     * @return WindowSurface where g will be drawing or null if the instance hasn't been initialized
      */
     public static org.eclipse.swt.internal.qt.graphics.WindowSurface getWindowSurface(Graphics g)
     {
@@ -213,9 +216,9 @@
 
     /**
      * Synchronizes any pending buffered draw commands to the target of the 
-     * graphics object.
+     * graphics object. Does not open surface session for external renderer's like m2g or m3g.
      *
-     * Must be called from UI-thread.
+     * Must not be called from UI-thread!
      *
      * @param graphics The object to synchronize
      */
@@ -229,20 +232,21 @@
      * could be, for example,  M3G renderer. The opened rendering session must be
      * ended by calling the endExternalRendering().
      *
-     * This function must be called from UI-thread only.
+     * This method must not be called from UI-thread!
      *
      * @param g Graphics where the rendering session starts.
+	 * @return The clip of the given graphics instance converted to window surface coordinates
      */
-    public static void startExternalRendering(Graphics g)
+    public static Rectangle startExternalRendering(Graphics g)
     {
-        invokerInstance.doStartExternalRendering(g);
+        return invokerInstance.doStartExternalRendering(g);
     }
     
     /**
      * Ends the external rendering session on given Graphics that was started
      * by calling startExternalRendering().
      *
-     * This function must be called from UI-thread only.
+     * This method must not be called from UI-thread!
      *
      * @param g The Graphics instance.
      */
@@ -319,7 +323,7 @@
 
     protected abstract void doSync(Object graphics);
     
-    protected abstract void doStartExternalRendering(Graphics g);
+    protected abstract Rectangle doStartExternalRendering(Graphics g);
     
     protected abstract void doEndExternalRendering(Graphics g);
     
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/Buffer.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/Buffer.java	Mon Oct 04 11:29:25 2010 +0300
@@ -335,9 +335,15 @@
             return;
         }
         
-        // if there's nothing to flush return
+        // if there's nothing to flush, just leave the surface session open
+        //  if so requested and return. Surface session needs to be left open
+        // if the call came from external renderer like m3g or m2g
         if(!commandBuffer.containsDrawnPrimitives())
         {
+        	if(!closeSurfaceSession)
+        	{
+        		startFrame(hostBounds.x, hostBounds.y , hostBounds.width , hostBounds.height);
+        	}
             return;
         }
         
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/CanvasKeypad.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/CanvasKeypad.java	Mon Oct 04 11:29:25 2010 +0300
@@ -343,27 +343,28 @@
         cssEngine.applyCSS(gameA, "QPushButton" + "{" + "background-color:white;"
             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
-            + "image: url(" + RESOURCE_PATH + "qtg_mono_game_a.svg);" + "}"
-            + "QPushButton:pressed { image: url(" + RESOURCE_PATH + "qtg_mono_game_a.svg);"
-            + " border-style: inset;" + "}");
+            + "}"
+            + "QPushButton:pressed { border-style: inset;" + "}");
         cssEngine.applyCSS(gameB, "QPushButton" + "{" + "background-color:white;"
             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
-            + "image: url(" + RESOURCE_PATH + "qtg_mono_game_b.svg);" + "}"
-            + "QPushButton:pressed { image: url(" + RESOURCE_PATH + "qtg_mono_game_b.svg);"
-            + " border-style: inset;" + "}");
+            + "}"
+            + "QPushButton:pressed { border-style: inset;" + "}");
         cssEngine.applyCSS(gameC, "QPushButton" + "{" + "background-color:white;"
             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
-            + "image: url(" + RESOURCE_PATH + "qtg_mono_game_c.svg);" + "}"
-            + "QPushButton:pressed { image: url(" + RESOURCE_PATH + "qtg_mono_game_c.svg);"
-            + " border-style: inset;" + "}");
+            + "}"
+            + "QPushButton:pressed { border-style: inset;" + "}");
         cssEngine.applyCSS(gameD, "QPushButton" + "{" + "background-color:white;"
             + "border-style: outset;" + "border-width: 1px; " + "border-color: black;"
             + "border-radius: 2px;" + "font: bold 14px;" + "min-height: 2em;" + "min-width: 5.1em;"
-            + "image: url(" + RESOURCE_PATH + "qtg_mono_game_d.svg);" + "}"
-            + "QPushButton:pressed { image: url(" + RESOURCE_PATH + "qtg_mono_game_d.svg);"
-            + " border-style: inset;" + "}");
+            + "}"
+            + "QPushButton:pressed { border-style: inset;" + "}");
+            
+        gameA.setText("A");
+		    gameB.setText("B");
+		    gameC.setText("C");
+		    gameD.setText("D");
 
         // layout the game Keys
         FormData gameAFormData = new FormData();
@@ -441,18 +442,17 @@
                 cssEngine.applyCSS(skright, "QPushButton" + "{" + "background-color:white;"
                     + "border-style: outset;" + "border-width: 1px; "
                     + "border-bottom-left-radius: 22px;" + "border-color: black;"
-                    + "font: bold 14px;" + "min-width: 3em;" + "min-height: 2em;" + "image: url("
-                    + RESOURCE_PATH + "qtg_mono_rsk_horizontal.svg);" + "}"
-                    + "QPushButton:pressed { image: url(" + RESOURCE_PATH
-                    + "qtg_mono_rsk_horizontal.svg);" + " border-style: inset;" + "}");
+                    + "font: bold 14px;" + "min-width: 3em;" + "min-height: 2em;" + "}"
+                    + "QPushButton:pressed { border-style: inset;" + "}");
 
                 cssEngine.applyCSS(skleft, "QPushButton" + "{" + "background-color:white;"
                     + "border-style: outset;" + "border-width: 1px; "
                     + "border-bottom-right-radius: 22px;" + "border-color: black;"
-                    + "font: bold 14px;" + "min-width: 3em;" + "min-height: 2em;" + "image: url("
-                    + RESOURCE_PATH + "qtg_mono_lsk_horizontal.svg);" + "}"
-                    + "QPushButton:pressed { image: url(" + RESOURCE_PATH
-                    + "qtg_mono_lsk_horizontal.svg);" + " border-style: inset;" + "}");
+                    + "font: bold 14px;" + "min-width: 3em;" + "min-height: 2em;" + "}"
+                    + "QPushButton:pressed { border-style: inset;" + "}");
+                    
+                skleft.setText("LSK");
+                skright.setText("RSK");
 
                 FormData sklFormData = new FormData();
                 sklFormData.top = new FormAttachment(0, 0);
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/EventDispatcher.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/EventDispatcher.java	Mon Oct 04 11:29:25 2010 +0300
@@ -32,8 +32,10 @@
     private static EventQueue eventQueue;
     private static Thread dispatcherThread;
     private static boolean terminated;
+    private static boolean terminateCalled;
     private static Object wakeLock;
     private static Object callbackLock;
+    private static Object terminationLock;
     private static boolean pendingWake;
     private static Runnable terminatedNotification;
     private final static String logName = "LCDUI event dispatcher: ";
@@ -177,18 +179,22 @@
             }
             finally
             {
-                if(noException)
-                {
-                    Logger.info(logName + "Dispatcher thread exiting normally");
-                }
-                else
+                synchronized(terminationLock)
                 {
-                    Logger.error(logName + "Dispatcher thread exiting abnormally");
-                }
-                if(terminatedNotification != null)
-                {
-                    terminatedNotification.run();
-                    terminatedNotification = null;
+                    terminated = true;
+                    if(noException)
+                    {
+                        Logger.info(logName + "Dispatcher thread exiting normally");
+                    }
+                    else
+                    {
+                        Logger.error(logName + "Dispatcher thread exiting abnormally");
+                    }
+                    if(terminatedNotification != null)
+                    {
+                        terminatedNotification.run();
+                        terminatedNotification = null;
+                    }
                 }
             }
         }
@@ -198,6 +204,7 @@
     {
         wakeLock = new Object();
         callbackLock = new Object();
+        terminationLock = new Object();
         eventQueue = new EventQueue();
         dispatcherThread = new Thread(new EventLoop(), this.toString());
         dispatcherThread.start();
@@ -264,11 +271,32 @@
      */
     synchronized void terminate(Runnable runnable)
     {
-        synchronized(wakeLock)
+        synchronized(terminationLock)
         {
-            wake();
-            terminatedNotification = runnable;
-            terminated = true;
+            // Only the first call does something
+            if(!terminateCalled)
+            {
+                terminateCalled = true;
+                if(terminated)
+                {
+                    // Already terminated. Dispatcher thread is not available
+                    // anymore for the asynchronous notification callback. Do
+                    // the callback in the current thread.
+                    if(runnable != null)
+                    {
+                        runnable.run();
+                    }
+                } 
+                else
+                {
+                    synchronized(wakeLock)
+                    {
+                        wake();
+                        terminatedNotification = runnable;
+                        terminated = true;
+                    }
+                }
+            }
         }
     }
 
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/Graphics.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/Graphics.java	Mon Oct 04 11:29:25 2010 +0300
@@ -1001,24 +1001,60 @@
      * @param h - height of the rectangle to be rendered.
      * @param alpha - true if alpha values should be rendered, false otherwise.
      */
-    public void drawRGB(int[] rgb,
-                        int offset,
-                        int scanlength,
-                        int x,
-                        int y,
-                        int w,
-                        int h,
-                        boolean alpha)
+    public void drawRGB(int[] aRgbData,
+                        int aOffset,
+                        int aScanLength,
+                        int aX,
+                        int aY,
+                        int aWidth,
+                        int aHeight,
+                        boolean aProcessAlpha)
     {
 
-        if(rgb == null)
+        if(aRgbData == null)
         {
             throw new NullPointerException(
                 MsgRepository.IMAGE_EXCEPTION_DATA_IS_NULL);
         }
+
+        // setting of help variables
+        int len = aRgbData.length;
+        int width = aWidth >= 0 ? aWidth : -aWidth;
+        int height = aHeight >= 0 ? aHeight : -aHeight;
+
+        int scanLength;
+
+        long end64 = (long)len - 1;
+        long offset64;
+        long scanLength64;
+
+        if(aScanLength >= 0)
+        {
+            // If aScanLength is positive, we can use RGB data forward.
+            scanLength = aScanLength;
+            offset64   = (long)aOffset;
+        }
+        else
+        {
+            // If aScanlength is negative, we have to use RGB data backward.
+            scanLength = -aScanLength;
+            offset64 = (long)aOffset - (long)scanLength * ((long)height - 1);
+        }
+
+        scanLength64 = (long)scanLength;
+        long min64 = offset64;
+        long max64 = offset64 + scanLength64 * ((long)height - 1) + (long)width - 1;
+
+        // Check for incorrect data.
+        if ((min64 < 0) || (max64 > end64))
+        {
+            throw new ArrayIndexOutOfBoundsException();
+        }
+
         synchronized(graphicsBuffer)
         {
-            graphicsBuffer.drawRGB(rgb, offset, scanlength, x, y, w, h, alpha, this);
+            graphicsBuffer.drawRGB(aRgbData, aOffset, aScanLength, aX, aY, aWidth,
+                aHeight, aProcessAlpha, this);
         }
     }
 
@@ -1074,9 +1110,17 @@
         }
         synchronized(graphicsBuffer)
         {
+            /*
+             * Silently ignore - even if the source point is out of bounds.
+             */
+            if (w <= 0 || h <= 0)
+            {
+                return;
+            }
+
             Image image = (Image)graphicsBuffer.getHost();
-            if(!javax.microedition.lcdui.Image.validateRegion(image
-                    .getWidth(), image.getHeight(), xFrom, yFrom, w, h))
+            if(!javax.microedition.lcdui.Image.validateRegion(image.getWidth(), 
+                image.getHeight(), xFrom, yFrom, w, h))
             {
                 throw new IllegalArgumentException(
                     MsgRepository.IMAGE_EXCEPTION_INVALID_REGION);
@@ -1204,30 +1248,6 @@
             }
         }
     }
-
-    /**
-     * Performs synchronization on the graphics buffer, i.e.
-     * the buffered draw commands are rasterized to the surface.
-     */
-    void sync()
-    {
-        synchronized(graphicsBuffer) 
-        {
-            if(syncStrategy == SYNC_LEAVE_SURFACE_SESSION_OPEN)
-            {
-                // This instance is used only with paint callbacks, thus  
-                // sync is called with the indication that surface paint  
-                // session can be left open as it will be closed when the 
-                // callback returns.
-                graphicsBuffer.sync(false);
-            }
-            else 
-            {
-                graphicsBuffer.sync(true);
-            } 
-        }
-    }
-    
     
     /**
      * Return DirectGraphics associated with this instance.
@@ -1267,6 +1287,78 @@
         return INVALID_STROKE_STYLE;
     }
 
+    /*
+     * External renderer support.
+     * Closes surface session opened by startExternalRendering -call.
+     */
+    void endExternalRendering()
+    {
+        synchronized(graphicsBuffer) 
+        {
+        	ESWTUIThreadRunner.safeSyncExec(new Runnable()
+            {
+                public void run()
+                {
+                    graphicsBuffer.endFrame();
+                }
+            });
+        }	
+    }
+    
+    /*
+     * External renderer support.
+     * Flushes any pending draw commands to the surface and
+     * leaves the surface session open for external renderer.
+     */
+    void startExternalRendering()
+    {
+        synchronized(graphicsBuffer) 
+        {
+        	ESWTUIThreadRunner.safeSyncExec(new Runnable()
+            {
+                public void run()
+                {
+                    graphicsBuffer.sync(false);
+                }
+            });
+        }	
+    }
+    
+    /*
+     * Flushes any pending draw commands to surface.
+     */
+    void sync()
+    {
+        synchronized(graphicsBuffer) 
+        {
+        	ESWTUIThreadRunner.safeSyncExec(new Runnable()
+            {
+                public void run()
+                {
+                	if(syncStrategy == SYNC_LEAVE_SURFACE_SESSION_OPEN)
+                	{
+                        graphicsBuffer.sync(false);
+                	}
+                	else 
+                	{
+                		graphicsBuffer.sync(true);
+                	}
+                }
+            });
+        }	
+    }
+    
+    Rectangle getClipInWindowCoordinates() 
+    {
+    	synchronized(graphicsBuffer) 
+        {
+    		return graphicsBuffer.toWindowCoordinates(currentClip[0] + translateX, 
+    		                                          currentClip[1] + translateY, 
+    		                                          currentClip[2], 
+    		                                          currentClip[3]);
+        }
+    }
+    
     //
     // Nokia UI API support
     //
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/Image.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/Image.java	Mon Oct 04 11:29:25 2010 +0300
@@ -393,40 +393,41 @@
      *             image or if w or h is zero or less or if transform is not one
      *             defined in Sprite-class.
      */
-    public static Image createImage(Image srcImage,
-                                    int x,
-                                    int y,
-                                    int w,
-                                    int h,
-                                    int transform)
+    public static Image createImage(Image aImage,
+                                    int aX,
+                                    int aY,
+                                    int aWidth,
+                                    int aHeight,
+                                    int aTransform)
     {
-        if(srcImage == null)
+        if(aImage == null)
         {
             throw new NullPointerException(
                 MsgRepository.IMAGE_EXCEPTION_IS_NULL);
         }
-        if(w <= 0 || h <= 0)
+        if(aWidth <= 0 || aHeight <= 0)
         {
             throw new IllegalArgumentException(
                 MsgRepository.IMAGE_EXCEPTION_INVALID_DIMENSIONS);
         }
-        if(!validateTransform(transform))
+        if(!validateTransform(aTransform))
         {
             throw new IllegalArgumentException(
                 MsgRepository.IMAGE_EXCEPTION_INVALID_TRANSFORM);
         }
-        if(!validateRegion(srcImage.getWidth(), srcImage.getHeight(), x, y, w, h))
+
+        if(!validateRegion(aImage.getWidth(), aImage.getHeight(), aX, aY, aWidth, aHeight))
         {
             throw new IllegalArgumentException(
                 MsgRepository.IMAGE_EXCEPTION_INVALID_REGION);
         }
 
-        final Image fImage = srcImage;
-        final int fx = x;
-        final int fy = y;
-        final int fw = w;
-        final int fh = h;
-        final int fTransform = transform;
+        final Image fImage = aImage;
+        final int fx = aX;
+        final int fy = aY;
+        final int fw = aWidth;
+        final int fh = aHeight;
+        final int fTransform = aTransform;
         ESWTUIThreadRunner.safeSyncExec(new Runnable()
         {
             public void run()
@@ -463,12 +464,39 @@
      * Validates that a specified region is fully located within the image
      * bounds. Method is package-private, used by Graphics.drawRegion as well.
      */
-    static boolean validateRegion(int srcWidth, int srcHeight, int x, int y,
-                                  int w, int h)
+    static boolean validateRegion(int aSrcWidth,
+                                  int aSrcHeight,
+                                  int aX,
+                                  int aY,
+                                  int aWidth,
+                                  int aHeight)
     {
-        return x >= 0 && y >= 0 && w <= srcWidth && h <= srcHeight;
+        boolean result = true;
+
+        final int width  = aSrcWidth;
+        final int height = aSrcHeight;
+        
+        final int sx1  = aX;            // left column
+        final int sx2  = aX + aWidth;   // right column
+
+        final int sy1  = aY;            // top row 
+        final int sy2  = aY + aHeight;  // bottom row (exclusive)
+
+        //
+        // Check source x range lies within source image
+        //
+        final boolean xRangeError = (sx1 < 0) || (sx1 >= width) || (sx2 < 0) || 
+            (sx2 > width);
+        final boolean yRangeError = (sy1 < 0) || (sy1 >= height) || (sy2 < 0) || 
+            (sy2 > height);
+
+        if (xRangeError || yRangeError)
+        {
+            result = false;
+        }
+        return result;
     }
-
+        
     /**
      * Validates if transform has a valid value. Method is package-private, used
      * by Graphics.drawRegion as well.
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/LCDUIInvokerImpl.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/LCDUIInvokerImpl.java	Mon Oct 04 11:29:25 2010 +0300
@@ -18,8 +18,10 @@
 
 import org.eclipse.swt.graphics.Internal_GfxPackageSupport;
 import org.eclipse.swt.internal.qt.graphics.GraphicsContext;
+import org.eclipse.swt.internal.qt.graphics.WindowSurface;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.graphics.Rectangle;
 import com.nokia.mid.ui.DirectGraphics;
 import com.nokia.mj.impl.nokialcdui.LCDUIInvoker;
 import com.nokia.mj.impl.nokialcdui.ItemControlStateChangeListener;
@@ -152,7 +154,7 @@
         return ((Canvas) canvas).getGameBufferGraphics();
     }
 
-    protected org.eclipse.swt.internal.qt.graphics.WindowSurface doGetWindowSurface( Graphics g )
+    protected WindowSurface doGetWindowSurface( Graphics g )
     {
         if( g != null )
         {
@@ -188,19 +190,16 @@
     	((Graphics)graphics).sync();
     } 
     
-    protected void doStartExternalRendering(Graphics g)
+    protected Rectangle doStartExternalRendering(Graphics g)
     {
-        // Flush any pending 2D graphics.
-        g.sync();
-        g.getGraphicsBuffer().startFrame( g.getClipX(),
-                                          g.getClipY(),
-                                          g.getClipWidth(),
-                                          g.getClipHeight() );
+        // Flush any pending 2D graphics and open surface session
+        g.startExternalRendering();
+        return g.getClipInWindowCoordinates();
     }
     
     protected void doEndExternalRendering(Graphics g)
     {
-        g.getGraphicsBuffer().endFrame();
+        g.endExternalRendering();
     }
     
     protected String doGetDynamicProperty(String key)
--- a/javauis/lcdui_qt/src/javax/microedition/lcdui/game/GameCanvas.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/src/javax/microedition/lcdui/game/GameCanvas.java	Mon Oct 04 11:29:25 2010 +0300
@@ -105,12 +105,19 @@
     /**
      * By default this renders the frameBuffer at (0,0).
      *
-     * @param g Graphics object
+     * @param aGraphics Graphics object
+     * @throws NullPointerException if aGraphics is null
      */
-    public void paint(javax.microedition.lcdui.Graphics g)
+    public void paint(javax.microedition.lcdui.Graphics aGraphics)
     {
+        // Graphics can not be null
+        if (aGraphics == null)
+        {
+            throw new NullPointerException();
+        }
+
         // If the Graphics doesn't belong to the frame buffer
-        LCDUIInvoker.renderGraphics(this, g);
+        LCDUIInvoker.renderGraphics(this, aGraphics);
     }
 
     /**
--- a/javauis/lcdui_qt/tsrc/build.xml	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/tsrc/build.xml	Mon Oct 04 11:29:25 2010 +0300
@@ -16,13 +16,13 @@
 	<!-- Classpath -->
 	<path id="openlcdui.classpath">
 		<pathelement location="\epoc32\RELEASE\WINSCW\udeb\java_impl_cldc.jar" />
-		<pathelement location="..\..\..\inc\classes.cldc.zip" />
+		<pathelement location="\epoc32\include\platform\app\classes.cldc.zip" />
 		<pathelement location="\epoc32\RELEASE\WINSCW\udeb\Z\resource\java\jvm\lib\common\s60uitestutils.jar" />
 	</path>
 	
 	<path id="openlcdui.armv5.classpath">
 		<pathelement location="${epoc.root}\epoc32\RELEASE\ARMV5\urel\java_impl_cldc.jar" />
-		<pathelement location="..\..\..\inc\classes.cldc.zip" />
+		<pathelement location="${epoc.root}\epoc32\include\platform\app\classes.cldc.zip" />
 		<pathelement location="${epoc.root}\epoc32\RELEASE\ARMV5\urel\Z\resource\java\jvm\lib\common\s60uitestutils.jar" />
 	</path>
 
--- a/javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/AllTests.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/AllTests.java	Mon Oct 04 11:29:25 2010 +0300
@@ -197,6 +197,8 @@
         addTest(com.nokia.openlcdui.mt.textfield.TextFieldTest.suite());
         addTest(com.nokia.openlcdui.mt.ticker.TickerTest.suite());
         addTest(com.nokia.openlcdui.mt.devicecontrol.DeviceControlTest.suite());
+        // enable the test after qt fixes are in
+        //addTest(com.nokia.openlcdui.mt.softnotification.SoftNotificationTest.suite());
         if(enableUIRobotTests)
         {
             addTest(com.nokia.openlcdui.mt_uirobot.alert.AlertUITest.suite());
--- a/javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/game/GameCanvasTest.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/game/GameCanvasTest.java	Mon Oct 04 11:29:25 2010 +0300
@@ -198,6 +198,23 @@
         };
         testPaint("paint with translation and clip",
                   canvas, image, imageGraphics, compare4);
+
+        // Test paint when graphics is null
+        MyGameCanvas gameCvs1 = new MyGameCanvas(false);
+        Graphics g = null;
+        String msg = "";
+
+        try
+        {
+            gameCvs1.paint(g);
+            msg = " NullPointerException wa not thrown when graphics was set to null";
+            msg = "FAILED \n" + msg;
+            fail(msg);
+        }
+        catch (NullPointerException ne)
+        {
+            //test pass
+        }
     }
 
     /**
@@ -327,4 +344,17 @@
         }
     }
 
+    class MyGameCanvas extends GameCanvas 
+    {
+
+        public MyGameCanvas(boolean s) 
+        {
+            super(s);
+        }
+
+        public Graphics getGraphics() 
+        {
+            return super.getGraphics();
+        }
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/lcdui_qt/tsrc/src/com/nokia/openlcdui/mt/softnotification/SoftNotificationTest.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,191 @@
+/*
+* Copyright (c) 2009,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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+package com.nokia.openlcdui.mt.softnotification;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import com.nokia.openlcdui.mt.SWTTestCase;
+
+import com.nokia.mid.ui.SoftNotification;
+import com.nokia.mid.ui.SoftNotificationException;
+
+public class SoftNotificationTest extends SWTTestCase {
+	/**
+	 * Constructor.
+	 */
+
+	/**
+	 * @param testName
+	 *            Test name.
+	 * @param testMethod
+	 *            Test method.
+	 */
+	public SoftNotificationTest(String testName) {
+		super(testName);
+	}
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite();
+
+		java.util.Vector methodNames;
+		java.util.Enumeration e;
+
+		// Add tests
+		methodNames = SoftNotificationTest.methodNames();
+		e = methodNames.elements();
+		while (e.hasMoreElements()) {
+			suite.addTest(new SoftNotificationTest((String) e.nextElement()));
+		}
+
+		return suite;
+	}
+
+	public static java.util.Vector methodNames() {
+		java.util.Vector methodNames = new java.util.Vector();
+		methodNames.addElement("test_newInstance");
+		methodNames.addElement("test_getId");
+		methodNames.addElement("test_setImage");
+		methodNames.addElement("test_setText");
+		methodNames.addElement("test_post");
+		methodNames.addElement("test_remove");
+		return methodNames;
+	}
+
+	protected void runTest() throws Throwable {
+		if (getName().equals("test_newInstance"))
+			test_newInstance();
+		else if (getName().equals("test_setText"))
+			test_getId();
+		else if (getName().equals("test_setImage"))
+			test_setImage();
+		else if (getName().equals("test_setText"))
+			test_setText();
+		else if (getName().equals("test_post"))
+			test_post();
+		else if (getName().equals("test_remove"))
+			test_remove();
+		else
+			super.runTest();
+	}
+
+	SoftNotification sn1;
+	SoftNotification sn2;
+
+	private byte[] getImage(String aImageName) throws IOException {
+		byte imageData[] = null;
+		if (aImageName != null) {
+			InputStream is = this.getClass().getResourceAsStream(
+					"/" + aImageName);
+			ByteArrayOutputStream out = new ByteArrayOutputStream();
+			try {
+				byte[] buf = new byte[1024];
+				for (int readNum; (readNum = is.read(buf)) != -1;) {
+					out.write(buf, 0, readNum);
+				}
+
+			} catch (Throwable e) {
+				e.printStackTrace();
+			}
+			imageData = out.toByteArray();
+			is.close();
+		}
+		return imageData;
+	}
+
+	public void test_newInstance() {
+		try {
+			sn1 = SoftNotification.newInstance();
+		} catch (Exception e) {
+			fail("Exception - in newInstance - " + e.getMessage());
+		}
+
+		try {
+			sn2 = SoftNotification.newInstance(101);
+		} catch (Exception e) {
+			fail("Exception - in newInstance - " + e.getMessage());
+		}
+	}
+
+	public void test_getId() {
+		sn2 = SoftNotification.newInstance(101);
+		if (sn2.getId() != 101) {
+			fail(" SoftNotification getId() is not correct");
+		}
+	}
+
+	public void test_setImage() {
+		sn2 = SoftNotification.newInstance(101);
+
+		try {
+			sn2.setImage(null);
+			sn2.setImage(getImage("200x200.png"));
+			sn2.setImage(null);
+			
+		} catch (IOException e) {
+			fail(" Exception in setImage() " + e.getMessage());
+		} catch (SoftNotificationException e) {
+			fail(" Exception in setImage() " + e.getMessage());
+		}
+	}
+
+	public void test_setText() {
+		sn2 = SoftNotification.newInstance(101);
+		try {
+			sn2.setText(null, null);
+			sn2.setText("Primary Text", "Secondary Text");
+			sn2.setText(null, "Changed Secondary Text");
+			sn2.setText("Changed Primary Text", null);
+		} catch (SoftNotificationException e) {
+			fail(" Exception in setText() " + e.getMessage());
+		}
+	}
+
+	public void test_post() {
+		sn2 = SoftNotification.newInstance(101);
+		try {
+			sn2.post();
+		} catch (SoftNotificationException e) {
+			fail(" Exception in post() " + e.getMessage());
+		}
+		try {
+			sn2.remove();
+			sn2.post();
+			fail("Expected exception not thrown post");
+		} catch (SoftNotificationException e) {
+			assertTrue("Expected Exception", true);
+		}
+	}
+
+	public void test_remove() {
+		sn2 = SoftNotification.newInstance(101);
+		try {
+			sn2.remove();
+		} catch (SoftNotificationException e) {
+			fail(" Exception in remove() " + e.getMessage());
+		}
+		try {
+			sn2.remove();
+			fail("Expected exception not thrown remove");
+		} catch (SoftNotificationException e) {
+			assertTrue("Expected Exception", true);
+		}
+	}
+}
--- a/javauis/m3g_qt/javasrc/javax/microedition/m3g/Graphics3D.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/m3g_qt/javasrc/javax/microedition/m3g/Graphics3D.java	Mon Oct 04 11:29:25 2010 +0300
@@ -23,8 +23,7 @@
 import java.util.Vector;
 import org.eclipse.swt.widgets.*;
 import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.internal.qt.graphics.*;
-import org.eclipse.swt.internal.qt.GCData;
+import org.eclipse.swt.internal.extension.GraphicsUtil;
 import com.nokia.mj.impl.rt.support.ShutdownListener;
 import com.nokia.mj.impl.rt.support.ApplicationUtils;
 import com.nokia.mj.impl.nokialcdui.LCDUIInvoker;
@@ -150,7 +149,6 @@
         {
             throw new IllegalStateException();
         }
-
         if (target == null)
         {
             throw new NullPointerException();
@@ -161,72 +159,59 @@
 
         if (target instanceof org.eclipse.swt.graphics.GC)
         {
-            Rectangle clip = ((org.eclipse.swt.graphics.GC)target).getClipping();
-            final int clipW = clip.width;
-            final int clipH = clip.height;
-            final int clipX = clip.x;
-            final int clipY = clip.y;
-
-            if (clipW > Defs.MAX_VIEWPORT_WIDTH ||
-                    clipH > Defs.MAX_VIEWPORT_HEIGHT)
+            final GC finalGc = (GC)target;
+            Rectangle clip = finalGc.getClipping();
+            if (clip.width > Defs.MAX_VIEWPORT_WIDTH ||
+                    clip.height > Defs.MAX_VIEWPORT_HEIGHT)
             {
                 throw new IllegalArgumentException();
             }
 
-            final Object finalTarget = target;
-            Platform.executeInUIThread(
-                new M3gRunnable()
-            {
-                public void doRun()
-                {
-                    GCData gcData = ((org.eclipse.swt.graphics.GC)finalTarget).getGCData();
-                    iSurfaceHandle = gcData.internalGc.getWindowSurface().getHandle();
-                    iIsImageTarget = _bindGraphics(
-                                         handle,
-                                         iSurfaceHandle,
-                                         clipX, clipY,
-                                         clipW, clipH,
-                                         finalDepth, finalFlags,
-                                         iIsProperRenderer);
-                }
-            });
-            currentTarget = target;
-        }
-
-        else if (target instanceof Graphics)
-        {
-
-            Graphics g = (Graphics) target;
-            //Platform.sync(g);
-
-            if (g.getClipWidth() > Defs.MAX_VIEWPORT_WIDTH ||
-                    g.getClipHeight() > Defs.MAX_VIEWPORT_HEIGHT)
-            {
-                throw new IllegalArgumentException();
-            }
-
-            offsetX = g.getTranslateX();
-            offsetY = g.getTranslateY();
-
-            final Graphics finalG = g;
-
             Platform.executeInUIThread(
                 new M3gRunnable()
             {
                 public void doRun()
                 {
-                    LCDUIInvoker.startExternalRendering( finalG );
-                    iSurfaceHandle = LCDUIInvoker.getWindowSurface(finalG).getHandle();
+                    Rectangle windowClip = GraphicsUtil.startExternalRendering(finalGc);
+                    iSurfaceHandle = GraphicsUtil.getWindowSurface(finalGc).getHandle();
                     iIsImageTarget = _bindGraphics(
                                          handle,
                                          iSurfaceHandle,
-                                         finalG.getClipX() + offsetX, finalG.getClipY() + offsetY,
-                                         finalG.getClipWidth(), finalG.getClipHeight(),
+                                         windowClip.x, windowClip.y,
+                                         windowClip.width, windowClip.height,
                                          finalDepth, finalFlags,
                                          iIsProperRenderer);
                 }
             });
-            currentTarget = g;
+            currentTarget = finalGc;
+        }
+        else if (target instanceof Graphics)
+        {
+            final Graphics finalG = (Graphics) target;
+            if (finalG.getClipWidth() > Defs.MAX_VIEWPORT_WIDTH ||
+                    finalG.getClipHeight() > Defs.MAX_VIEWPORT_HEIGHT)
+            {
+                throw new IllegalArgumentException();
+            }
+
+            final Rectangle windowClip = LCDUIInvoker.startExternalRendering(finalG);            
+            iSurfaceHandle = LCDUIInvoker.getWindowSurface(finalG).getHandle();
+
+            Platform.executeInUIThread(
+                new M3gRunnable()
+            {
+                public void doRun()
+                {
+                    iIsImageTarget = _bindGraphics(
+                                         handle,
+                                         iSurfaceHandle,
+                                         windowClip.x, windowClip.y,
+                                         windowClip.width, windowClip.height,
+                                         finalDepth, finalFlags,
+                                         iIsProperRenderer);
+                }
+            });
+            currentTarget = finalG;
         }
         else if (target instanceof Image2D)
         {
@@ -274,6 +259,7 @@
                 {
                     _releaseGraphics(handle,
                                      iSurfaceHandle, iIsImageTarget, iIsProperRenderer);
+                    GraphicsUtil.endExternalRendering((GC)currentTarget);
                 }
             });
         }
@@ -286,23 +272,10 @@
                     public void doRun()
                     {
                         _releaseGraphics(handle,
-                                         iSurfaceHandle, iIsImageTarget, iIsProperRenderer);
-                        LCDUIInvoker.endExternalRendering( finalG );
+                                         iSurfaceHandle, iIsImageTarget, iIsProperRenderer);                        
                     }
                 });
-            /*
-            Graphics g = (Graphics) currentTarget;
-
-            //ToolkitInvoker invoker = ToolkitInvoker.getToolkitInvoker();
-
-            Platform.getUIThread().syncExec(
-                    new Runnable() {
-                        public void run() {
-                                        _releaseGraphics( handle,
-                                        invoker.graphicsGetHandle(g), iIsImageTarget, iIsProperRenderer );
-                                }
-                        });
-                        */
+                LCDUIInvoker.endExternalRendering( finalG );
         }
         else if (currentTarget instanceof Image2D)
         {
--- a/javauis/nokiauiapi_qt/build/build.pro	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/build/build.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -16,4 +16,5 @@
 TEMPLATE = subdirs
 SUBDIRS += nokiauiapiqt/javanokiaui.pro 
 SUBDIRS += softindicatorplugin/javasoftindicatorplugin.pro 
+SUBDIRS += softnoteplugin/javacaptain_ext_javasoftnoteplugin.pro 
 BLD_INF_RULES.prj_extensions += "prj_extensions" 
--- a/javauis/nokiauiapi_qt/build/nokiauiapiqt/build.xml	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/build/nokiauiapiqt/build.xml	Mon Oct 04 11:29:25 2010 +0300
@@ -29,14 +29,16 @@
 
     <property name="java.src.paths" value="../../javasrc:../../javasrc_j2me"/>
 
-    <property name="javah.classnames" value="com.nokia.mid.ui.internal.OS"/>
+    <property name="javah.classnames" value="com.nokia.mj.impl.nokiauiapi.OS"/>
 
     <target name="create.public.api.jar">
          <omj.public.apis includes="com/nokia/mid/ui/TactileFeedback.class, 
                                     com/nokia/mid/ui/DeviceControl.class,
                                     com/nokia/mid/ui/SoftNotificationException.class, 
                                     com/nokia/mid/ui/SoftNotification.class, 
-                                    com/nokia/mid/ui/SoftNotificationListener.class"/>
+                                    com/nokia/mid/ui/SoftNotificationListener.class,
+                                    com/nokia/mid/ui/GlobalIndicators.class,
+                                    com/nokia/mid/ui/GlobalIndicatorsException.class"/>
     
     </target>
 
--- a/javauis/nokiauiapi_qt/build/nokiauiapiqt/javanokiaui.pro	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/build/nokiauiapiqt/javanokiaui.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -16,9 +16,7 @@
 
 TEMPLATE=lib
 TARGET=javanokiaui
-CONFIG += omj java
-
-QT += core
+CONFIG += omj java stl
 
 symbian {
     
@@ -26,8 +24,8 @@
    
     INCLUDEPATH += ../../inc ../../../../inc
 
-    HEADERS += ../../inc/CSoftNotification.h ../../inc/autorelease.h
-    SOURCES += ../../src/os.cpp ../../src/CSoftNotification.cpp
+    HEADERS += ../../inc/CSoftNotification.h ../../inc/autorelease.h ../../inc/CGlobalindicators.h
+    SOURCES += ../../src/os.cpp ../../src/CSoftNotification.cpp ../../src/CGlobalIndicators.cpp
    
     LIBS += -lcone
     LIBS += -ltouchfeedback
@@ -35,7 +33,10 @@
     LIBS += -lbafl
     LIBS += -lws32
     LIBS += -lapparc
-    LIBS += -lapgrfx  
+    LIBS += -lapgrfx
+    LIBS += -ljavastorage
+    LIBS += -llibstdcpp
+    LIBS += -ljavautils
 }
 
 include(../../../../build/omj.pri)
--- a/javauis/nokiauiapi_qt/build/softindicatorplugin/javasoftindicatorplugin.pro	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/build/softindicatorplugin/javasoftindicatorplugin.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -16,7 +16,7 @@
 
 TEMPLATE=lib
 TARGET=javasoftindicatorplugin
-CONFIG += plugin 
+CONFIG += plugin stl
 QT += core
 symbian : plugin {
     
@@ -46,7 +46,9 @@
         LIBS += -lws32
         LIBS += -lapparc
         LIBS += -lapgrfx
-        LIBS += -lefsrv
+        LIBS += -ljavastorage
+        LIBS += -llibstdcpp
+        LIBS += -ljavautils
                 
     
     include(../../../../build/symbian_uids.pri)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/build/softnoteplugin/bwins/javacaptain_ext_javasoftnotepluginu.def	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,5 @@
+EXPORTS
+	?findDllMethod@@YAP6APAXXZPBD@Z @ 1 NONAME ; void * (*)(void) findDllMethod(char const *)
+	??0javasoftnotehandler@@QAE@XZ @ 2 NONAME ; javasoftnotehandler::javasoftnotehandler(void)
+	??1javasoftnotehandler@@UAE@XZ @ 3 NONAME ; javasoftnotehandler::~javasoftnotehandler(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/build/softnoteplugin/eabi/javacaptain_ext_javasoftnotepluginu.def	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,12 @@
+EXPORTS
+	_Z13findDllMethodPKc @ 1 NONAME
+	_ZN19javasoftnotehandlerC1Ev @ 2 NONAME
+	_ZN19javasoftnotehandlerC2Ev @ 3 NONAME
+	_ZN19javasoftnotehandlerD0Ev @ 4 NONAME
+	_ZN19javasoftnotehandlerD1Ev @ 5 NONAME
+	_ZN19javasoftnotehandlerD2Ev @ 6 NONAME
+	_ZThn4_N19javasoftnotehandlerD0Ev @ 7 NONAME
+	_ZThn4_N19javasoftnotehandlerD1Ev @ 8 NONAME
+	_ZThn8_N19javasoftnotehandlerD0Ev @ 9 NONAME
+	_ZThn8_N19javasoftnotehandlerD1Ev @ 10 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/build/softnoteplugin/javacaptain_ext_javasoftnoteplugin.pro	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,37 @@
+#
+# Copyright (c) 2009 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"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+
+TEMPLATE=lib
+TARGET=javacaptain_ext_javasoftnoteplugin
+CONFIG += omj stl 
+
+symbian {
+    
+    CONFIG +=hb
+    
+	INCLUDEPATH += ../../softnoteplugin/inc ../../../../inc
+                
+ 	HEADERS += ../../softnoteplugin/inc/javasoftnotehandler.h
+  	SOURCES += ../../softnoteplugin/src.s60/lookup.cpp ../../softnoteplugin/src/javasoftnotehandler.cpp
+    
+    LIBS += -lHbCore
+    LIBS += -ljavastorage
+    LIBS += -llibstdcpp
+    LIBS += -ljavautils
+    LIBS += -lbafl
+}
+    
+include(../../../../build/omj.pri)
\ No newline at end of file
--- a/javauis/nokiauiapi_qt/build/subsystem.mk	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/build/subsystem.mk	Mon Oct 04 11:29:25 2010 +0300
@@ -18,6 +18,8 @@
 
 COMPONENTS = \
         nokiauiapiqt \
-        softindicatorplugin
+        softindicatorplugin \
+        softnoteplugin 
+        
 
 include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/inc/CGlobalIndicators.h	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2008 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Controls the native global indicators.
+*
+*/
+
+
+#ifndef CGLOBALINDICATORS_H
+#define CGLOBALINDICATORS_H
+
+// CLASS DECLARATION
+
+class CGlobalIndicators: public CBase
+{
+public:
+    /**
+     * Sets the value of the given global indicator.
+     *
+     * @param aIndicator id of the indicator
+     *
+     * @param aValue the value to set for the global indicator.
+     *
+     * @return the value that is currently set for the indicator,
+     * or a native error value.
+     */
+    static TInt SetGlobalIndicator(TInt aIndicator, TInt aValue);
+
+    /**
+     * Gets the value of the given global indicator.
+     *
+     * @param aIndicator id of the indicator
+     *
+     * @return the value that is currently set for the indicator,
+     * or a native error value.
+     */
+    static TInt GlobalIndicator(TInt aIndicator);
+};
+#endif // CGLOBALINDICATORS_H
+
+
--- a/javauis/nokiauiapi_qt/inc/CSoftNotification.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/inc/CSoftNotification.h	Mon Oct 04 11:29:25 2010 +0300
@@ -15,9 +15,10 @@
 #include <e32base.h>
 #include <jni.h>
 #include <HbIndicatorsymbian.h>
+#include <HbDeviceNotificationDialogsymbian.h>
 
 NONSHARABLE_CLASS(CSoftNotification) : public CBase,
-        MHbIndicatorSymbianObserver
+        MHbIndicatorSymbianObserver, MHbDeviceNotificationDialogObserver
     {
 public:
   
@@ -39,6 +40,21 @@
      */
     void IndicatorUserActivated(const TDesC &aType,
             CHbSymbianVariantMap &aData);
+    
+    /**
+     * Notification dialog is touched by the user.
+     *
+     * @param aDialog Notification dialog
+     */
+    void NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* aDialog);
+    
+    /**
+     * Notification dialog is closed.
+     *
+     * @param aDialog Notification dialog
+     * @param aCompletionCode Notification dialog completion code
+     */
+    void NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* aDialog, TInt aCompletionCode);
 
 public:
     // New functions
@@ -106,14 +122,20 @@
     /**
      * Set assigned member data to custom notification parameters
      *
-     * @param aParam custom soft notification params to fill
+     * @return aParam custom soft notification params to fill
      */
     CHbSymbianVariant* NotificationParamsL();
+    
+    /**
+     * Storing softnotification to database
+     */
+    void AddorUpdateSoftNotificationToStorage();
 
 private:
     // Data
 
     CHbIndicatorSymbian* iIndicator;
+    CHbDeviceNotificationDialogSymbian* iNotificationDialog; 
     TUid iMidletId;
     TInt iNotificationId;
     HBufC* iPrimaryText;
@@ -122,6 +144,7 @@
     jobject iPeer;
     jmethodID iMethodId;
     JNIEnv* iJniEnv;
+    bool iIsNoteExist;
     };
 
 #endif // CSOFTNOTIFICATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/javasrc/com/nokia/mid/ui/GlobalIndicators.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,143 @@
+/*
+* Copyright (c) 2008 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Public interface of the GlobalIndicator API.
+ *
+*/
+
+package com.nokia.mid.ui;
+
+import com.nokia.mj.impl.nokiauiapi.GlobalIndicatorsImpl;
+
+/**
+ * The <code>GlobalIndicators</code> is a class to handle the device global
+ * indicators. Global indicators are small icons that appear to the device
+ * status indicator area indicating for example the arrival of a new email or
+ * chat message. These indicators remain in the status indicator area even if
+ * the midlet is closed but rebooting the device will remove them, so the
+ * indicators are not fully persistent.<P>
+ *
+ * These global indicators are common and also used by the native applications.
+ * This means that at any time it is possible for any application to turn an
+ * indicator on or off. For that reason it is good practice to query the state
+ * of the indicator before setting the value.<P>
+ *
+ * There are also other indicators besides these <code>MAIL_INDICATOR</code> or
+ * <code>CHAT_INDICATOR</code> defined in this API. GlobalIndicators API allows
+ * to access those indicators too but the exact values of both the indicator and
+ * its value need to be given as accurate integer parameters (as some of those
+ * more complex indicators support a larger range of input parameters than just
+ * <code>INDICATOR_HIDE</code> or <code>INDICATOR_SHOW</code>).<P>
+ *
+ * Example of API usage:<P>
+ * <code>
+ * int retVal = GlobalIndicators.getGlobalIndicator(<BR>
+ * &nbsp;&nbsp;&nbsp;&nbsp;GlobalIndicators.MAIL_INDICATOR);<P>
+ * if(retVal != GlobalIndicators.INDICATOR_SHOW)<BR>
+ * &nbsp;&nbsp;&nbsp;&nbsp;{<BR>
+ * &nbsp;&nbsp;&nbsp;&nbsp;retVal = GlobalIndicators.setGlobalIndicator(<BR>
+ * &nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;GlobalIndicators.MAIL_INDICATOR,<BR>
+ * &nbsp;&nbsp;&nbsp;&nbsp&nbsp;&nbsp;&nbsp;&nbsp;GlobalIndicators.INDICATOR_SHOW);<BR>
+ * &nbsp;&nbsp;&nbsp;&nbsp;}
+ * </code>
+ */
+public final class GlobalIndicators
+{
+
+    private static GlobalIndicatorsImpl sInstance;
+
+    static
+    {
+        sInstance = GlobalIndicatorsImpl.getInstance();
+    }
+
+    /**
+     * A constant for email indicator.
+     */
+    public static final int MAIL_INDICATOR = 274;
+
+    /**
+     * A constant for chat message indicator.
+     */
+    public static final int CHAT_INDICATOR = 260;
+
+    /**
+     * A constant for indicator's default value uninitialized.
+     */
+    public static final int INDICATOR_UNINITIALIZED = 0;
+
+    /**
+     * A constant for indicator's value when the indicator is hidden.
+     */
+    public static final int INDICATOR_HIDE = 1;
+
+    /**
+     * A constant for indicator's value when the indicator is displayed.
+     */
+    public static final int INDICATOR_SHOW = 2;
+
+    /**
+     * Private constructor.
+     */
+    private GlobalIndicators()
+    {
+    }
+
+    /**
+     * Sets the value of the given global indicator.
+     *
+     * @param indicator <code>MAIL_INDICATOR</code>,
+     * <code>CHAT_INDICATOR</code> or a specific other indicator given as
+     * an integer.
+     *
+     * @param value the value to set: <code>INDICATOR_SHOW</code>,
+     * <code>INDICATOR_HIDE</code> or a specific other value given as
+     * an integer.
+     *
+     * @return the value that is currently set for the indicator:
+     * <code>INDICATOR_UNINITIALIZED</code>, <code>INDICATOR_SHOW</code> or
+     * <code>INDICATOR_HIDE</code>. For the other specific indicators the
+     * return value is the integer value that is set for that indicator.
+     *
+     * @throws GlobalIndicatorsException if the given indicator or the
+     * given value is not supported, or there occurs an error while trying to
+     * access the indicator.
+     */
+    public static int setGlobalIndicator(int indicator, int value)
+    throws GlobalIndicatorsException
+    {
+        return sInstance.setGlobalIndicator(indicator, value);
+    }
+
+    /**
+     * Gets the value of the given global indicator.
+     *
+     * @param indicator <code>MAIL_INDICATOR</code>,
+     * <code>CHAT_INDICATOR</code> or a specific other indicator given as
+     * an integer.
+     *
+     * @return the value that is currently set for the indicator:
+     * <code>INDICATOR_UNINITIALIZED</code>, <code>INDICATOR_SHOW</code> or
+     * <code>INDICATOR_HIDE</code>. For the other specific indicators the
+     * return value is the integer value that is currently set for that
+     * indicator.
+     *
+     * @throws GlobalIndicatorsException if there occurs an error while trying
+     * to access the indicator.
+     */
+    public static int getGlobalIndicator(int indicator)
+    throws GlobalIndicatorsException
+    {
+        return sInstance.getGlobalIndicator(indicator);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/javasrc/com/nokia/mid/ui/GlobalIndicatorsException.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,76 @@
+/*
+* Copyright (c) 2008 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Exception for Global Indicators
+ *
+*/
+
+package com.nokia.mid.ui;
+
+public class GlobalIndicatorsException extends Exception
+{
+
+
+    private int errorCode;
+
+    /**
+     * Default constructor is not allowed.
+     */
+    protected GlobalIndicatorsException() {}
+
+    /**
+     * Constructs an exception instance with a textual information.
+     * @param info human readable information about the exception.
+     */
+    public GlobalIndicatorsException(String info)
+    {
+        super(info);
+    }
+
+    /**
+     * Constructs an exception instance with a textual information and the
+     * error code of the native call.
+     * @param info human readable information about the exception.
+     * @param errorCode the error code received from native side.
+     */
+    public GlobalIndicatorsException(String info, int errorCode)
+    {
+        super(info);
+        this.errorCode = errorCode;
+    }
+
+    /**
+     * Constructs human readable textual information
+     * @return String the human readable textual information
+     */
+    public String toString()
+    {
+        if (errorCode == 0)
+        {
+            return super.toString();
+        }
+        else
+        {
+            return super.toString() + " Native error: " + errorCode;
+        }
+    }
+
+    /**
+     * Returns the native error code
+     * @return the native error code
+     */
+    public int getErrorCode()
+    {
+        return errorCode;
+    }
+}
--- a/javauis/nokiauiapi_qt/javasrc/com/nokia/mid/ui/SoftNotification.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/javasrc/com/nokia/mid/ui/SoftNotification.java	Mon Oct 04 11:29:25 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 package com.nokia.mid.ui;
-
+import com.nokia.mj.impl.nokiauiapi.SoftNotificationImpl;
 
 /**
  * <p>The <code>SoftNotification</code> is a class to manage soft
--- a/javauis/nokiauiapi_qt/javasrc/com/nokia/mid/ui/SoftNotificationImpl.java	Fri Sep 17 16:44:34 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,353 +0,0 @@
-/*
- * Copyright (c) 2009 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"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-package com.nokia.mid.ui;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import org.eclipse.swt.internal.extension.DisplayExtension;
-import org.eclipse.swt.widgets.Internal_PackageSupport;
-
-import com.nokia.mid.ui.internal.OS;
-import com.nokia.mid.ui.SoftNotificationException;
-import com.nokia.mid.ui.SoftNotificationListener;
-import com.nokia.mj.impl.fileutils.FileUtility;
-import com.nokia.mj.impl.rt.support.Finalizer;
-import com.nokia.mj.impl.rt.support.ApplicationInfo;
-
-/**
- * SoftNotificationImpl implements the functionality specified in
- * com.nokia.mid.ui.SoftNotification class.
- */
-final class SoftNotificationImpl extends com.nokia.mid.ui.SoftNotification {
-
-	// Native CSoftNotification handle
-	private int iSoftNotificationHandle = 0;
-
-	// Observer of this class set by the API user. An array is used to allow
-	// listener synchronization.
-	private SoftNotificationListener[] iListener;
-
-	// Listener event when user accepted notification
-	private final static int EVENT_ACCEPT = 1;
-
-	// Listener event when user dismissed notification
-	private final static int EVENT_DISMISS = 2;
-
-	// Error message prefix for exceptions.
-	private final static String ERROR_MESSAGE_PREFIX = "Failed to ";
-
-	// The class will have native resources so register it for
-	// finalization.
-	private Finalizer mFinalizer;
-
-	private int err;
-
-	private int id;
-	
-	private int midletUid;
-
-	/**
-	 * Constructor. New instance with old identifier.
-	 * 
-	 * @param aNotificationId
-	 *            Identification of previous soft notification.
-	 */
-	public SoftNotificationImpl(int aNotificationId) {
-		initialize(aNotificationId);
-	}
-
-	/**
-	 * Constructor. New instance.
-	 */
-	public SoftNotificationImpl() {
-		initialize(0);
-	}
-
-	/**
-	 * Initializes the instance.
-	 * 
-	 * @param aNotificationId
-	 *            Id of the soft notification.
-	 */
-	protected void initialize(int aNotificationId) {
-		final int iNotificationId = aNotificationId;
-		iListener = new SoftNotificationListener[1];
-
-		Runnable r = new Runnable() {
-			public void run() {
-				String uidString = ApplicationInfo.getInstance().getUid().toString();
-				// removing "[" and "]" brackets
-				uidString = uidString.substring(1,uidString.length()-1);
-				// converting to decimal
-				midletUid =(int)Long.parseLong(uidString,16);
-				iSoftNotificationHandle = OS.createNativePeer(midletUid, iNotificationId,
-						SoftNotificationImpl.this);
-			}
-		};
-		// if display is created already, execute it in UI thread no matter
-		// what thread it is called from. Otherwise assume LCDUI application is
-		// called
-		// and create a display. eSWT is not allowed to call before display
-		// creation
-		if (DisplayExtension.getDisplayInstance() != null) {
-			DisplayExtension.getDisplayInstance().syncExec(r);
-		} else {
-			com.nokia.mj.impl.nokialcdui.LCDUIInvoker
-					.eSWTUIThreadRunnerSyncExec(r);
-		}
-
-		if (iSoftNotificationHandle <= 0) {
-			throw new OutOfMemoryError();
-		}
-
-		mFinalizer = ((mFinalizer != null) ? mFinalizer : new Finalizer() {
-			public void finalizeImpl() {
-				close();
-			}
-		});
-	}
-
-	/**
-	 * Called when the object is finalized by the garbage collector.
-	 */
-	public void close() {
-		if (DisplayExtension.getDisplayInstance() != null) {
-			Internal_PackageSupport.getDisplayInstance().syncExec(new Runnable() {
-				public void run() {
-					if (mFinalizer != null) {
-						OS.destroy(iSoftNotificationHandle);
-					}
-					mFinalizer = null;
-				}
-			});
-		}
-	}
-
-	/**
-	 * Notification callback, called from the native side.
-	 * 
-	 * @param aEventArg
-	 *            Occurred event.
-	 */
-	private void notificationCallback(int aEventArg) {
-		// Synchronize the listener usage since the user may want to set it
-		// to null during execution of this function.
-		synchronized (iListener) {
-			SoftNotificationListener listener = iListener[0];
-
-			if (listener != null) {
-				if (aEventArg == EVENT_ACCEPT) {
-					listener.notificationSelected(this);
-				} else if (aEventArg == EVENT_DISMISS) {
-					listener.notificationDismissed(this);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Checks the given error value. Throws SoftNotificationException if the
-	 * given error value is other than NativeError.KErrNone.
-	 * 
-	 * @param aError
-	 *            Error value to be checked.
-	 * @param aErrorMessage
-	 *            Message to be included in the exception.
-	 */
-	private final void checkError(int aError, String aErrorMessage)
-			throws SoftNotificationException {
-		if (aError != 0) {
-			throw new SoftNotificationException(ERROR_MESSAGE_PREFIX
-					+ aErrorMessage, aError);
-		}
-	}
-
-	// Functions from the base class.
-
-	/**
-	 * See class SoftNotification for comments
-	 */
-	public int getId() {
-		if (DisplayExtension.getDisplayInstance() != null) {
-			Internal_PackageSupport.getDisplayInstance().syncExec(
-					new Runnable() {
-						public void run() {
-							id = 0;
-							id = OS.getId(iSoftNotificationHandle);
-						}
-					});
-		}
-		return id;
-	}
-
-	/**
-	 * See class SoftNotification for comments
-	 */
-	public void post() throws SoftNotificationException {
-		if (DisplayExtension.getDisplayInstance() != null) {
-			Internal_PackageSupport.getDisplayInstance().syncExec(
-					new Runnable() {
-						public void run() {
-							err = 0;
-							err = OS
-									.showSoftNotification(iSoftNotificationHandle);
-						}
-					});
-		}
-		checkError(err, "add soft notification");
-	}
-
-	/**
-	 * See class SoftNotification for comments
-	 */
-	public void remove() throws SoftNotificationException {
-		if (DisplayExtension.getDisplayInstance() != null) {
-			Internal_PackageSupport.getDisplayInstance().syncExec(
-					new Runnable() {
-						public void run() {
-							err = 0;
-							err = OS
-									.removeSoftNotification(iSoftNotificationHandle);
-						}
-					});
-		}
-		checkError(err, "remove notification");
-	}
-
-	/**
-	 * See class SoftNotification for comments
-	 */
-	public void setListener(SoftNotificationListener aListener) {
-		// Synchronize the listener setting since the user may set it
-		// to null during it is used elsewhere in this class.
-		synchronized (iListener) {
-			iListener[0] = aListener;
-		}
-	}
-
-	/**
-	 * See class SoftNotification for comments
-	 */
-	public void setText(String aPrimaryText, String aSecondaryText)
-			throws SoftNotificationException {
-		final String iPrimaryText = aPrimaryText;
-		final String iSecondaryText = aSecondaryText;
-
-		if (DisplayExtension.getDisplayInstance() != null) {
-			Internal_PackageSupport.getDisplayInstance().syncExec(
-					new Runnable() {
-						public void run() {
-							err = 0;
-							err = OS.setText(iSoftNotificationHandle,
-									iPrimaryText == null ? "" : iPrimaryText,
-									iSecondaryText == null ? ""
-											: iSecondaryText);
-						}
-					});
-		}
-		checkError(err, "set note text");
-	}
-
-	/**
-	 * See class SoftNotification for comments
-	 */
-	public void setSoftkeyLabels(String aSoftkey1Label, String aSoftkey2Label)
-			throws SoftNotificationException {
-		int err = 0;
-		checkError(err, "set softkeys");
-	}
-
-	private String stringReplace(String source, String searchStr,
-			String replacementStr) {
-		StringBuffer strBuffer = new StringBuffer();
-		int pos = source.indexOf(searchStr);
-
-		while (pos != -1) {
-			strBuffer.append(source.substring(0, pos)).append(replacementStr);
-			source = source.substring(pos + searchStr.length());
-			pos = source.indexOf(searchStr);
-		}
-		strBuffer.append(source);
-		return strBuffer.toString();
-	}
-
-	/**
-	 * See class SoftNotification for comments
-	 */
-	public void setImage(byte[] aImageData) throws SoftNotificationException {
-		if (aImageData != null) {
-			final byte[] iImageData = aImageData;
-			if (DisplayExtension.getDisplayInstance() != null) {
-				Internal_PackageSupport.getDisplayInstance().syncExec(
-						new Runnable() {
-							public void run() {
-								err = 0;
-								String imagePath = "";
-								try {
-									String directoryPath = ApplicationInfo
-											.getInstance().getRootPath();
-									// Replace "\private\102033e6\apps" with
-									// "resource\apps\java"
-									directoryPath = stringReplace(
-											directoryPath, "private", "public");
-									directoryPath = directoryPath
-											+ "softnotification\\"
-											+ midletUid + "_"
-											+ getId();
-									String imageName = midletUid
-											+ "_" + getId();
-									FileUtility target = new FileUtility(
-											directoryPath);
-									if (!target.exists()) {
-										target.mkdirs();
-									}
-									target = new FileUtility(directoryPath
-											+ "\\" + imageName);
-									if (!target.exists()) {
-										target.createNewFile();
-									}
-									OutputStream fos = target
-											.openOutputStream();
-									ByteArrayInputStream in = new ByteArrayInputStream(
-											iImageData);
-									byte[] buf = new byte[1024];
-									int len;
-									while ((len = in.read(buf)) > 0) {
-										fos.write(buf, 0, len);
-									}
-									in.close();
-									fos.close();
-									target = null;
-									imagePath = directoryPath + "\\"
-											+ imageName;
-								} catch (IOException ex) {
-									ex.printStackTrace();
-								} catch (Throwable t) {
-									t.printStackTrace();
-								}
-								err = OS.setImagePath(iSoftNotificationHandle,
-										imagePath);
-							}
-						});
-			}
-		}
-		checkError(err, "set image");
-	}
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/javasrc/com/nokia/mj/impl/nokiauiapi/GlobalIndicatorsImpl.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2008 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation class of GlobalIndicators API.
+ *
+*/
+
+package com.nokia.mj.impl.nokiauiapi;
+
+import com.nokia.mid.ui.GlobalIndicators;
+import com.nokia.mid.ui.GlobalIndicatorsException;
+import com.nokia.mj.impl.utils.OsErrorMessage;
+import com.nokia.mj.impl.rt.support.ApplicationInfo;
+
+
+public class GlobalIndicatorsImpl
+{
+
+    // Static instance, can be got with getInstace method
+    private static GlobalIndicatorsImpl sGlobalIndicator;
+    // Static block of the class.
+
+    static
+    {
+//        com.nokia.mj.impl.rt.support.Jvm.loadSystemLibrary("javaglobalindicators");
+
+        // This is called when class is loaded for the first time
+        sGlobalIndicator = new GlobalIndicatorsImpl();
+    }
+
+    /**
+     * This private constructor can be called only from static block.
+     */
+    private GlobalIndicatorsImpl()
+    {
+    }
+
+    /**
+     * Return GlobalIndicatorsImpl instance
+     */
+    public static GlobalIndicatorsImpl getInstance()
+    {
+        return sGlobalIndicator;
+    }
+
+    /**
+     * See class GlobalIndicators for comments
+     */
+    public int setGlobalIndicator(int aIndicator, int aValue)
+    throws GlobalIndicatorsException
+    {
+        int ret;
+        String protectionDomain = ApplicationInfo.getInstance().getProtectionDomain();
+        if (protectionDomain == null)
+        {
+            throw new GlobalIndicatorsException(
+                "Failed to set global indicator for unidentified domain");
+        }
+        else
+        {
+            // For mail and chat indicators only show and hide are supported
+            if (((aIndicator == GlobalIndicators.MAIL_INDICATOR) ||
+                    (aIndicator == GlobalIndicators.CHAT_INDICATOR)) &&
+                    ((aValue != GlobalIndicators.INDICATOR_SHOW) &&
+                     (aValue != GlobalIndicators.INDICATOR_HIDE)))
+            {
+                throw new GlobalIndicatorsException(
+                    "Value is not supported for global indicator");
+            }
+
+            //int ret = _setGlobalIndicator( aIndicator, aValue );
+            ret = 0;//_setGlobalIndicator(aIndicator, aValue);
+            if (ret < OsErrorMessage.SUCCESS)
+            {
+                throw new GlobalIndicatorsException(
+                    "Failed to set global indicator", ret);
+            }
+        }
+        return ret;
+    }
+
+    /**
+     * See class GlobalIndicators for comments
+     */
+    public int getGlobalIndicator(int aIndicator)
+    throws GlobalIndicatorsException
+    {
+        int ret = 0;//_getGlobalIndicator(aIndicator);
+        if (ret < OsErrorMessage.SUCCESS)
+        {
+            throw new GlobalIndicatorsException(
+                "Failed to get global indicator value", ret);
+        }
+        return ret;
+    }
+   
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/javasrc/com/nokia/mj/impl/nokiauiapi/OS.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+package com.nokia.mj.impl.nokiauiapi;
+
+import org.eclipse.swt.internal.Library;
+
+public final class OS
+{
+    static
+    {
+        Library.loadLibrary("javanokiaui");
+    }
+
+    native public static final void MTouchFeedback_InstantFeedback(int style);
+    native public static final boolean MTouchFeedback_TouchFeedbackSupported();
+    native public static final void MTouchFeedback_SetFeedbackArea(int controlHandle, int id, int x, int y, int width, int height, int style);
+    native public static final void MTouchFeedback_RemoveFeedbackArea(int controlHandle, int aAreaIndex);
+    native public static final void MTouchFeedback_RemoveFeedbackForControl(int controlHandle);
+    native public static final void MTouchFeedback_MoveFeedbackAreaToFirstPriority(int controlHandle, int id);
+    
+    //softnotification
+    native public static final int createNativePeer(int mideletUid, int notificationID, Object peer);
+    native public static final void destroy(int softNotificationHandle);
+    native public static final int getId(int softNotificationHandle);
+    native public static final int setText(int softNotificationHandle, String primaryText, String secondaryText);
+    native public static final int removeSoftNotification(int softNotificationHandle);
+    native public static final int showSoftNotification(int softNotificationHandle);
+    native public static final int setImagePath(int softNotificationHandle, String imagePath);
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/javasrc/com/nokia/mj/impl/nokiauiapi/SoftNotificationImpl.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,353 @@
+/*
+ * Copyright (c) 2009 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"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+package com.nokia.mj.impl.nokiauiapi;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.eclipse.swt.internal.extension.DisplayExtension;
+import org.eclipse.swt.widgets.Internal_PackageSupport;
+
+import com.nokia.mj.impl.nokiauiapi.OS;
+import com.nokia.mid.ui.SoftNotificationException;
+import com.nokia.mid.ui.SoftNotificationListener;
+import com.nokia.mj.impl.fileutils.FileUtility;
+import com.nokia.mj.impl.rt.support.Finalizer;
+import com.nokia.mj.impl.rt.support.ApplicationInfo;
+
+/**
+ * SoftNotificationImpl implements the functionality specified in
+ * com.nokia.mid.ui.SoftNotification class.
+ */
+public final class SoftNotificationImpl extends com.nokia.mid.ui.SoftNotification {
+
+	// Native CSoftNotification handle
+	private int iSoftNotificationHandle = 0;
+
+	// Observer of this class set by the API user. An array is used to allow
+	// listener synchronization.
+	private SoftNotificationListener[] iListener;
+
+	// Listener event when user accepted notification
+	private final static int EVENT_ACCEPT = 1;
+
+	// Listener event when user dismissed notification
+	private final static int EVENT_DISMISS = 2;
+
+	// Error message prefix for exceptions.
+	private final static String ERROR_MESSAGE_PREFIX = "Failed to ";
+
+	// The class will have native resources so register it for
+	// finalization.
+	private Finalizer mFinalizer;
+
+	private int err;
+
+	private int id;
+	
+	private int midletUid;
+
+	/**
+	 * Constructor. New instance with old identifier.
+	 * 
+	 * @param aNotificationId
+	 *            Identification of previous soft notification.
+	 */
+	public SoftNotificationImpl(int aNotificationId) {
+		initialize(aNotificationId);
+	}
+
+	/**
+	 * Constructor. New instance.
+	 */
+	public SoftNotificationImpl() {
+		initialize(0);
+	}
+
+	/**
+	 * Initializes the instance.
+	 * 
+	 * @param aNotificationId
+	 *            Id of the soft notification.
+	 */
+	protected void initialize(int aNotificationId) {
+		final int iNotificationId = aNotificationId;
+		iListener = new SoftNotificationListener[1];
+
+		Runnable r = new Runnable() {
+			public void run() {
+				String uidString = ApplicationInfo.getInstance().getUid().toString();
+				// removing "[" and "]" brackets
+				uidString = uidString.substring(1,uidString.length()-1);
+				// converting to decimal
+				midletUid =(int)Long.parseLong(uidString,16);
+				iSoftNotificationHandle = OS.createNativePeer(midletUid, iNotificationId,
+						SoftNotificationImpl.this);
+			}
+		};
+		// if display is created already, execute it in UI thread no matter
+		// what thread it is called from. Otherwise assume LCDUI application is
+		// called
+		// and create a display. eSWT is not allowed to call before display
+		// creation
+		if (DisplayExtension.getDisplayInstance() != null) {
+			DisplayExtension.getDisplayInstance().syncExec(r);
+		} else {
+			com.nokia.mj.impl.nokialcdui.LCDUIInvoker
+					.eSWTUIThreadRunnerSyncExec(r);
+		}
+
+		if (iSoftNotificationHandle <= 0) {
+			throw new OutOfMemoryError();
+		}
+
+		mFinalizer = ((mFinalizer != null) ? mFinalizer : new Finalizer() {
+			public void finalizeImpl() {
+				close();
+			}
+		});
+	}
+
+	/**
+	 * Called when the object is finalized by the garbage collector.
+	 */
+	public void close() {
+		if (DisplayExtension.getDisplayInstance() != null) {
+			Internal_PackageSupport.getDisplayInstance().syncExec(new Runnable() {
+				public void run() {
+					if (mFinalizer != null) {
+						OS.destroy(iSoftNotificationHandle);
+					}
+					mFinalizer = null;
+				}
+			});
+		}
+	}
+
+	/**
+	 * Notification callback, called from the native side.
+	 * 
+	 * @param aEventArg
+	 *            Occurred event.
+	 */
+	private void notificationCallback(int aEventArg) {
+		// Synchronize the listener usage since the user may want to set it
+		// to null during execution of this function.
+		synchronized (iListener) {
+			SoftNotificationListener listener = iListener[0];
+
+			if (listener != null) {
+				if (aEventArg == EVENT_ACCEPT) {
+					listener.notificationSelected(this);
+				} else if (aEventArg == EVENT_DISMISS) {
+					listener.notificationDismissed(this);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Checks the given error value. Throws SoftNotificationException if the
+	 * given error value is other than NativeError.KErrNone.
+	 * 
+	 * @param aError
+	 *            Error value to be checked.
+	 * @param aErrorMessage
+	 *            Message to be included in the exception.
+	 */
+	private final void checkError(int aError, String aErrorMessage)
+			throws SoftNotificationException {
+		if (aError != 0) {
+			throw new SoftNotificationException(ERROR_MESSAGE_PREFIX
+					+ aErrorMessage, aError);
+		}
+	}
+
+	// Functions from the base class.
+
+	/**
+	 * See class SoftNotification for comments
+	 */
+	public int getId() {
+		if (DisplayExtension.getDisplayInstance() != null) {
+			Internal_PackageSupport.getDisplayInstance().syncExec(
+					new Runnable() {
+						public void run() {
+							id = 0;
+							id = OS.getId(iSoftNotificationHandle);
+						}
+					});
+		}
+		return id;
+	}
+
+	/**
+	 * See class SoftNotification for comments
+	 */
+	public void post() throws SoftNotificationException {
+		if (DisplayExtension.getDisplayInstance() != null) {
+			Internal_PackageSupport.getDisplayInstance().syncExec(
+					new Runnable() {
+						public void run() {
+							err = 0;
+							err = OS
+									.showSoftNotification(iSoftNotificationHandle);
+						}
+					});
+		}
+		checkError(err, "add soft notification");
+	}
+
+	/**
+	 * See class SoftNotification for comments
+	 */
+	public void remove() throws SoftNotificationException {
+		if (DisplayExtension.getDisplayInstance() != null) {
+			Internal_PackageSupport.getDisplayInstance().syncExec(
+					new Runnable() {
+						public void run() {
+							err = 0;
+							err = OS
+									.removeSoftNotification(iSoftNotificationHandle);
+						}
+					});
+		}
+		checkError(err, "remove notification");
+	}
+
+	/**
+	 * See class SoftNotification for comments
+	 */
+	public void setListener(SoftNotificationListener aListener) {
+		// Synchronize the listener setting since the user may set it
+		// to null during it is used elsewhere in this class.
+		synchronized (iListener) {
+			iListener[0] = aListener;
+		}
+	}
+
+	/**
+	 * See class SoftNotification for comments
+	 */
+	public void setText(String aPrimaryText, String aSecondaryText)
+			throws SoftNotificationException {
+		final String iPrimaryText = aPrimaryText;
+		final String iSecondaryText = aSecondaryText;
+
+		if (DisplayExtension.getDisplayInstance() != null) {
+			Internal_PackageSupport.getDisplayInstance().syncExec(
+					new Runnable() {
+						public void run() {
+							err = 0;
+							err = OS.setText(iSoftNotificationHandle,
+									iPrimaryText == null ? "" : iPrimaryText,
+									iSecondaryText == null ? ""
+											: iSecondaryText);
+						}
+					});
+		}
+		checkError(err, "set note text");
+	}
+
+	/**
+	 * See class SoftNotification for comments
+	 */
+	public void setSoftkeyLabels(String aSoftkey1Label, String aSoftkey2Label)
+			throws SoftNotificationException {
+		int err = 0;
+		checkError(err, "set softkeys");
+	}
+
+	private String stringReplace(String source, String searchStr,
+			String replacementStr) {
+		StringBuffer strBuffer = new StringBuffer();
+		int pos = source.indexOf(searchStr);
+
+		while (pos != -1) {
+			strBuffer.append(source.substring(0, pos)).append(replacementStr);
+			source = source.substring(pos + searchStr.length());
+			pos = source.indexOf(searchStr);
+		}
+		strBuffer.append(source);
+		return strBuffer.toString();
+	}
+
+	/**
+	 * See class SoftNotification for comments
+	 */
+	public void setImage(byte[] aImageData) throws SoftNotificationException {
+		if (aImageData != null) {
+			final byte[] iImageData = aImageData;
+			if (DisplayExtension.getDisplayInstance() != null) {
+				Internal_PackageSupport.getDisplayInstance().syncExec(
+						new Runnable() {
+							public void run() {
+								err = 0;
+								String imagePath = "";
+								try {
+									String directoryPath = ApplicationInfo
+											.getInstance().getRootPath();
+									// Replace "\private\102033e6\apps" with
+									// "resource\apps\java"
+									directoryPath = stringReplace(
+											directoryPath, "private", "public");
+									directoryPath = directoryPath
+											+ "softnotification\\"
+											+ midletUid + "_"
+											+ getId();
+									String imageName = midletUid
+											+ "_" + getId();
+									FileUtility target = new FileUtility(
+											directoryPath);
+									if (!target.exists()) {
+										target.mkdirs();
+									}
+									target = new FileUtility(directoryPath
+											+ "\\" + imageName);
+									if (!target.exists()) {
+										target.createNewFile();
+									}
+									OutputStream fos = target
+											.openOutputStream();
+									ByteArrayInputStream in = new ByteArrayInputStream(
+											iImageData);
+									byte[] buf = new byte[1024];
+									int len;
+									while ((len = in.read(buf)) > 0) {
+										fos.write(buf, 0, len);
+									}
+									in.close();
+									fos.close();
+									target = null;
+									imagePath = directoryPath + "\\"
+											+ imageName;
+								} catch (IOException ex) {
+									ex.printStackTrace();
+								} catch (Throwable t) {
+									t.printStackTrace();
+								}
+								err = OS.setImagePath(iSoftNotificationHandle,
+										imagePath);
+							}
+						});
+			}
+		}
+		checkError(err, "set image");
+	}
+}
--- a/javauis/nokiauiapi_qt/javasrc_j2me/com/nokia/mid/ui/TactileFeedback.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/javasrc_j2me/com/nokia/mid/ui/TactileFeedback.java	Mon Oct 04 11:29:25 2010 +0300
@@ -18,7 +18,7 @@
 package com.nokia.mid.ui;
 
 import org.eclipse.swt.widgets.Internal_PackageSupport;
-import com.nokia.mid.ui.internal.OS;
+import com.nokia.mj.impl.nokiauiapi.OS;
 
 
 /**
--- a/javauis/nokiauiapi_qt/softindicatorplugin/inc/javasoftindicator.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/softindicatorplugin/inc/javasoftindicator.h	Mon Oct 04 11:29:25 2010 +0300
@@ -49,6 +49,7 @@
 private:
 
     void StartJavaMidletL() const;
+    void RemoveSoftNoteFromStorage();
 
 private:
 
--- a/javauis/nokiauiapi_qt/softindicatorplugin/src/javasoftindicator.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/softindicatorplugin/src/javasoftindicator.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -11,8 +11,19 @@
 
 #include <apgtask.h>
 #include <apgcli.h>
+#include <memory>
+#include <javastorageentry.h>
+#include <javastorage.h>
+#include <javastoragenames.h>
+#include <JavaCommonUtils.h>
+#include <logger.h>
+#include <QFile.h>
 
-#include "javasoftindicator.h" 
+#include "javasoftindicator.h"
+
+using namespace std;
+using namespace java::storage;
+using namespace java::util;
 
 // ----------------------------------------------------------------------------
 // JavaSoftIndicator::JavaSoftIndicator
@@ -41,16 +52,27 @@
     bool handled = false;
     if (type == InteractionActivated)
         {
+        // get midlet to foreground or lauch if it is not open
         TRAP_IGNORE(StartJavaMidletL());
         QVariantMap variantMap;
         if (iParameter.isValid() && iParameter.canConvert(QVariant::List))
             {
             variantMap.insert("MidletId",iParameter.toList()[0].toUInt());
-            variantMap.insert("NotificationId",iParameter.toList()[1]);
+            variantMap.insert("NotificationId",iParameter.toList()[1].toInt());
             }
+        // send user activated signal to indicator observer
         emit userActivated(variantMap);
         handled = true;
+        // remove softnote from database
+        RemoveSoftNoteFromStorage();
+        // remove indicator from status menu
         emit deactivate();
+        // remove image from public directoy
+        QFile imgFile(iParameter.toList()[4].toString());
+        if(imgFile.exists())
+            {
+            imgFile.remove();
+            }
         }
     return handled;
     }
@@ -125,7 +147,13 @@
             break;
         case RequestDeactivate:
             {
+            RemoveSoftNoteFromStorage();
             emit deactivate();
+            QFile imgFile(iParameter.toList()[4].toString());
+            if(imgFile.exists())
+                {
+                imgFile.remove();
+                }
             }
             break;
         default:
@@ -143,12 +171,12 @@
         {
         if (iParameter.toList()[0].isValid())
             {
-            TUint KJavaMidletUid = iParameter.toList()[0].toUInt();
+            TUint javaMidletUid = iParameter.toList()[0].toUInt();
 
             RWsSession ws;
             User::LeaveIfError(ws.Connect() == KErrNone);
             TApaTaskList tasklist(ws);
-            TApaTask task = tasklist.FindApp(TUid::Uid(KJavaMidletUid));
+            TApaTask task = tasklist.FindApp(TUid::Uid(javaMidletUid));
             if (task.Exists())
                 {
                 task.BringToForeground();
@@ -161,10 +189,44 @@
                 User::LeaveIfError(appArcSession.Connect());
                 TThreadId threadId;
                 appArcSession.StartDocument(_L(""),
-                TUid::Uid(KJavaMidletUid), threadId);
+                TUid::Uid(javaMidletUid), threadId);
                 appArcSession.Close();
                 }
             }
         }
     }
 
+// ----------------------------------------------------------
+// JavaSoftIndicator::RemoveSoftNoteFromStorage()
+// ----------------------------------------------------------
+void JavaSoftIndicator::RemoveSoftNoteFromStorage()
+    {
+    std::auto_ptr<JavaStorage> js(JavaStorage::createInstance());
+    try
+        {
+        js->open(JAVA_DATABASE_NAME);
+
+        JavaStorageApplicationEntry_t entries;
+        JavaStorageEntry attribute;
+
+        std::wstring midletId = JavaCommonUtils::intToWstring(
+                iParameter.toList()[0].toUInt());
+        attribute.setEntry(SOFTNOTE_MIDLET_ID, midletId,
+                JavaStorageEntry::STRING);
+        entries.insert(attribute);
+
+        std::wstring notificationId = JavaCommonUtils::intToWstring(
+                iParameter.toList()[1].toInt());
+        attribute.setEntry(SOFTNOTE_ID, notificationId, JavaStorageEntry::INT);
+        entries.insert(attribute);
+
+        js->remove(JAVA_SOFTNOTE_TABLE, entries);
+        js->close();
+        entries.clear();
+        }
+    catch (JavaStorageException& ex)
+        {
+        LOG1(EJavaStorage, EInfo," JavaSoftNote Exception %s", ex.toString());
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/softnoteplugin/inc/javasoftnotehandler.h	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+
+#ifndef JAVASOFTNOTEHANDLER_H
+#define JAVASOFTNOTEHANDLER_H
+
+#include <extensionplugininterface.h>
+#include <eventconsumerinterface.h>
+#include <applicationmanagementeventsinterface.h>
+
+using namespace java::captain;
+
+OS_NONSHARABLE_CLASS(javasoftnotehandler) :  public ExtensionPluginInterface,
+        public EventConsumerInterface,
+        public ApplicationManagementEventsInterface
+{
+public:
+    OS_IMPORT javasoftnotehandler();
+    OS_IMPORT virtual ~javasoftnotehandler();
+
+    // PluginInterface
+    virtual void startPlugin(CoreInterface* aCore);
+    virtual void stopPlugin();
+  
+    // ExtensionPluginInterface methods
+    virtual EventConsumerInterface* getEventConsumer();
+    virtual ApplicationManagementEventsInterface* getApplicationManagementListener();
+  
+    // EventConsumerInterface
+    virtual void event(const std::string& eventProvider,
+                       java::comms::CommsMessage& aMsg);
+
+    // ApplicationManagementEventsInterface
+    virtual void amAdded(const uids_t& uids);
+    virtual void amUpdated(const uids_t& uids);
+    virtual void amDeleted(const uids_t& uids);
+
+private:
+    void createIndicatorsL();
+    void deleteIndicatorsL(const uids_t& aUids);
+};
+
+#endif // JAVASOFTNOTEHANDLER_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/softnoteplugin/src.s60/lookup.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+
+#include <string> //For strcmp
+#include <javasymbianoslayer.h>
+#include <logger.h>
+
+#include "javasoftnotehandler.h"
+
+using namespace java::captain;
+
+ExtensionPluginInterface* getExtensionPlugin();
+
+EXPORT_C FuncPtr findDllMethod(const char* funcName)
+    {
+    JELOG2(EJavaCaptain);
+    FuncPtr ptr = 0;
+    if (funcName)
+        {
+        if (strcmp(funcName, "getExtensionPlugin") == 0)
+            {
+            ptr = (FuncPtr) getExtensionPlugin;
+            }
+        }
+    else
+        {
+        ELOG(EJavaCaptain, "javasoftnoteplugin findDllMethod() funcName == null");
+        }
+    return ptr;
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/softnoteplugin/src/javasoftnotehandler.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,300 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nokia Corporation - initial implementation
+ *******************************************************************************/
+
+#include <memory>
+#include <badesca.h>
+#include <hbsymbianvariant.h>
+#include <HbIndicatorsymbian.h>
+
+#include <javastorageentry.h>
+#include <javastorage.h>
+#include <javastoragenames.h>
+#include <JavaCommonUtils.h>
+#include <JavaUid.h>
+#include <javasymbianoslayer.h>
+#include <booteventprovidermessages.h>
+#include <logger.h>
+
+#include "javasoftnotehandler.h"
+
+using namespace std;
+using namespace java::storage;
+using namespace java::util;
+_LIT(KIndicatorTypeJavaSoftNote,"com.nokia.javasoftnotification.indicatorplugin/1.0_%u_%i");
+const TInt KIndicatorTypeStringLength = 250;
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::getExtensionPlugin
+// ----------------------------------------------------------------------------
+#ifdef __SYMBIAN32__
+ExtensionPluginInterface* getExtensionPlugin()
+    {
+#else
+    extern "C" ExtensionPluginInterface* getExtensionPlugin()
+        {
+#endif
+    return new javasoftnotehandler();
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::javasoftnotehandler
+// ----------------------------------------------------------------------------
+OS_EXPORT javasoftnotehandler::javasoftnotehandler() 
+    {
+    JELOG2(EJavaCaptain);
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::~javasoftnotehandler
+// ----------------------------------------------------------------------------
+OS_EXPORT javasoftnotehandler::~javasoftnotehandler()
+    {
+    JELOG2(EJavaCaptain);
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::startPlugin
+// ----------------------------------------------------------------------------
+void javasoftnotehandler::startPlugin(CoreInterface* /*core*/)
+    {
+    JELOG2(EJavaCaptain);
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::stopPlugin
+// ----------------------------------------------------------------------------
+ void javasoftnotehandler::stopPlugin()
+    {
+    JELOG2(EJavaCaptain);
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::getEventConsumer
+// ----------------------------------------------------------------------------
+EventConsumerInterface* javasoftnotehandler::getEventConsumer()
+    {
+    JELOG2(EJavaCaptain);
+    return this;
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::getApplicationManagementListener
+// ----------------------------------------------------------------------------
+ApplicationManagementEventsInterface* javasoftnotehandler::getApplicationManagementListener()
+    {
+    JELOG2(EJavaCaptain);
+    return this;
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::event
+// ----------------------------------------------------------------------------
+void javasoftnotehandler::event(const std::string& eventProvider,
+        java::comms::CommsMessage& /*aMsg*/)
+    {
+    LOG1(EJavaCaptain, EInfo, "javasoftnotehandler::event(), aEvent.event = %s", eventProvider.c_str());
+    if (eventProvider == BOOT_EVENT_PROVIDER)
+        {
+        TRAP_IGNORE(createIndicatorsL());
+        }
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::amAdded
+// ----------------------------------------------------------------------------
+void javasoftnotehandler::amAdded(const uids_t& aUids)
+    {
+    JELOG2(EJavaCaptain);
+    LOG1(EJavaCaptain, EInfo, "javasoftnotehandler::amAdded, %d uids", aUids.size());
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::amUpdated
+// ----------------------------------------------------------------------------
+void javasoftnotehandler::amUpdated(const uids_t& aUids)
+    {
+    JELOG2(EJavaCaptain);
+    LOG1(EJavaCaptain, EInfo, "javasoftnotehandler::amUpdated, %d uids", aUids.size());
+    TRAP_IGNORE(deleteIndicatorsL(aUids));
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::amDeleted
+// ----------------------------------------------------------------------------
+void javasoftnotehandler::amDeleted(const uids_t& aUids)
+    {
+    JELOG2(EJavaCaptain);
+    LOG1(EJavaCaptain, EInfo, "javasoftnotehandler::amDeleted, %d uids", aUids.size());
+    TRAP_IGNORE(deleteIndicatorsL(aUids));
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::createIndicatorsL
+// ----------------------------------------------------------------------------
+void javasoftnotehandler::createIndicatorsL()
+    {
+    std::auto_ptr<JavaStorage> js(JavaStorage::createInstance());
+    try
+        {
+        js->open(JAVA_DATABASE_NAME);
+        JavaStorageApplicationEntry_t findPattern;
+        JavaStorageApplicationList_t foundEntries;
+        // Reading all java based softnotes from database 
+        js->search(JAVA_SOFTNOTE_TABLE, findPattern, foundEntries);
+        js->close();
+
+        if (foundEntries.size() > 0)
+            {
+            JavaStorageApplicationList_t::const_iterator applications;
+            JavaStorageApplicationEntry_t::const_iterator findIterator;
+            JavaStorageEntry attribute;
+            CDesC16ArrayFlat* array = NULL;
+            // Reading all sfotNotes data  from database and 
+            // adding to status menu.
+            for (applications = foundEntries.begin(); applications
+                    != foundEntries.end(); applications++)
+                {
+                // Only 5 columns in the softNote table. So, create array with size 5.
+                array = new CDesC16ArrayFlat(5);
+                CleanupStack::PushL(array);
+                TUid midletId;
+                TInt notificationId;
+                attribute.setEntry(SOFTNOTE_MIDLET_ID, L"");
+                findIterator = (*applications).find(attribute);
+                // no need to check null midlet id, as it is a primary key in the table.
+                        midletId = TUid::Uid(JavaCommonUtils::wstringToInt(
+                                        (*findIterator).entryValue()));
+                array->AppendL(wstringToBuf((*findIterator).entryValue())->Des());
+
+                attribute.setEntry(SOFTNOTE_ID, L"");
+                findIterator = (*applications).find(attribute);
+                // no ned to check for null notification id, as it is a primary key in the table.
+                notificationId = JavaCommonUtils::wstringToInt(
+                        (*findIterator).entryValue());
+                array->AppendL(wstringToBuf((*findIterator).entryValue())->Des());
+
+                // if no entry is found for primary text, appends Null desc to array 
+                // to keep all variable positions correctly.
+                attribute.setEntry(SOFTNOTE_PRIMARY_TEXT, L"");
+                findIterator = (*applications).find(attribute);
+                if (findIterator != (*applications).end())
+                    {
+                    array->AppendL(wstringToBuf((*findIterator).entryValue())->Des());
+                    }
+                else
+                    {
+                    array->AppendL(KNullDesC);
+                    }
+
+                attribute.setEntry(SOFTNOTE_SECONDARY_TEXT, L"");
+                findIterator = (*applications).find(attribute);
+                if (findIterator != (*applications).end())
+                    {
+                    array->AppendL(wstringToBuf((*findIterator).entryValue())->Des());
+                    }
+                else
+                    {
+                    array->AppendL(KNullDesC);
+                    }
+
+                attribute.setEntry(SOFTNOTE_IMAGE_PATH, L"");
+                findIterator = (*applications).find(attribute);
+                if (findIterator != (*applications).end())
+                    {
+                    array->AppendL(wstringToBuf((*findIterator).entryValue())->Des());
+                    }
+                else
+                    {
+                    array->AppendL(KNullDesC);
+                    }
+
+                MDesCArray* marray = static_cast<MDesCArray*>(array);
+                CHbSymbianVariant* varValues = CHbSymbianVariant::NewL( marray, CHbSymbianVariant::EDesArray);
+                CleanupStack::PushL(varValues);
+
+                TBuf<KIndicatorTypeStringLength> indicatorType;
+                indicatorType.Format(KIndicatorTypeJavaSoftNote, midletId, notificationId);
+                // creating indicator and adding to status menu
+                CHbIndicatorSymbian* indicator = CHbIndicatorSymbian::NewL();
+                CleanupStack::PushL(indicator);
+                indicator->Activate(indicatorType, varValues);
+                CleanupStack::PopAndDestroy(indicator);
+
+                CleanupStack::PopAndDestroy(varValues);
+                CleanupStack::PopAndDestroy(array);
+                array = NULL;
+                }
+            }
+        }
+    catch(JavaStorageException& ex)
+        {
+        LOG1(EJavaStorage, EInfo," JavaSoftNote Exception %s", ex.toString());
+        }   
+    }
+
+// ----------------------------------------------------------------------------
+// javasoftnotehandler::deleteIndicatorsL
+// ----------------------------------------------------------------------------
+void javasoftnotehandler::deleteIndicatorsL(const uids_t& aUids)
+    {
+
+    std::auto_ptr<JavaStorage> js(JavaStorage::createInstance());
+    try        
+        {
+        js->open(JAVA_DATABASE_NAME);
+        JavaStorageEntry attribute;
+        JavaStorageApplicationEntry_t findPattern;
+        JavaStorageApplicationList_t foundEntries;
+        // Search all softnotes for each given midlet UID in the softNote table 
+        // and notify to the indicator in status mentu to delete/clear them.
+        for (uids_t::const_iterator iter = aUids.begin(); iter != aUids.end(); ++iter)
+            {
+            TUid aMidletId;
+            uidToTUid(*iter, aMidletId);
+            attribute.setEntry(SOFTNOTE_MIDLET_ID, JavaCommonUtils::intToWstring(aMidletId.iUid));
+            findPattern.insert(attribute);
+            // search for all softnotes for single midlet UID 
+            js->search(JAVA_SOFTNOTE_TABLE, findPattern, foundEntries);
+            findPattern.clear();
+
+            if (foundEntries.size() > 0)
+                {
+                attribute.setEntry(SOFTNOTE_ID, L"");
+                JavaStorageApplicationList_t::const_iterator applications;
+                // Deletes all softnotes for single midlet UID
+                for(applications = foundEntries.begin(); applications !=foundEntries.end(); applications++)
+                    {
+                    // Get softnote ID.
+                    JavaStorageApplicationEntry_t::const_iterator findIterator = (*applications).find(attribute);
+                    if (findIterator != (*applications).end())
+                        {
+                        TBuf<KIndicatorTypeStringLength> type;
+                        type.Format(KIndicatorTypeJavaSoftNote, aMidletId,
+                                JavaCommonUtils::wstringToInt((*findIterator).entryValue()));
+                        // create reference to Indicator
+                        CHbIndicatorSymbian* indicator = CHbIndicatorSymbian::NewL();
+                        CleanupStack::PushL(indicator);
+                        //Inform to clear from status menu and database.
+                        indicator->Deactivate(type);
+                        CleanupStack::PopAndDestroy(indicator);
+                        }
+                    }
+                }
+            foundEntries.clear();
+            }
+        js->close();
+        }
+    catch(JavaStorageException& ex)
+        {
+        LOG1(EJavaStorage, EInfo," JavaSoftNote Exception %s", ex.toString());
+        }
+    }
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiauiapi_qt/src/CGlobalIndicators.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,220 @@
+/*
+* Copyright (c) 2007 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Controls the native global indicators.
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32base.h>
+#include <e32property.h> // Publish & Subscribe
+//#include <coreapplicationuisdomainpskeys.h>
+#include "CGlobalIndicators.h"
+//#include "com_nokia_mid_ui_GlobalIndicators.h"
+#include <logger.h>
+
+//  CONSTANTS
+namespace
+{
+// These constants are from JNI header, just defined shorter names here
+// If any other values are used for the indicator or its value, they are
+// passed directly to P&S.
+const TInt KPropertyGlobalMailIndicator = 0;
+    //com_nokia_mid_ui_GlobalIndicators_MAIL_INDICATOR;
+
+const TInt KPropertyGlobalChatIndicator = 0;
+    //com_nokia_mid_ui_GlobalIndicators_CHAT_INDICATOR;
+
+const TInt KPropertyGlobalIndicatorUninitialized = 0;
+    //com_nokia_mid_ui_GlobalIndicators_INDICATOR_UNINITIALIZED;
+
+const TInt KPropertyGlobalIndicatorHide = 0;
+    //com_nokia_mid_ui_GlobalIndicators_INDICATOR_HIDE;
+
+const TInt KPropertyGlobalIndicatorShow = 0;
+    //com_nokia_mid_ui_GlobalIndicators_INDICATOR_SHOW;
+}
+
+// Required capabilites
+// WriteDeviceData  // for setting the email status using RProperty::Set()
+// ReadDeviceData   // for retrieving the email status using RProperty::Get()
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// SetGlobalIndicator
+// Sets the value for given global indicator.
+// -----------------------------------------------------------------------------
+//
+TInt CGlobalIndicators::SetGlobalIndicator(TInt aIndicator, TInt aValue)
+{
+
+    LOG2(EJavaGlobalInd, EInfo,
+         "GlobalIndicators::SetGlobalIndicator indicator:%d, value:%d",
+         aIndicator, aValue);
+
+
+    // Make sure that indicator JNI constants match into P&S definitions used
+    // in platform.
+    TUint32 convertedIndicator = aIndicator;
+    if (aIndicator == KPropertyGlobalMailIndicator)
+    {
+        //convertedIndicator = KCoreAppUIsNewEmailStatus;
+    }
+    if (aIndicator == KPropertyGlobalChatIndicator)
+    {
+        //convertedIndicator = KCoreAppUIsUipInd;
+    }
+
+    TInt readValue = KPropertyGlobalIndicatorUninitialized;
+    RProperty property;
+
+   /* TInt ret = property.Attach(KPSUidCoreApplicationUIs, convertedIndicator);
+    if (KErrNone == ret)
+    {
+        ret = property.Get(readValue);
+        TInt setValue = KPropertyGlobalIndicatorUninitialized;
+
+        // For Email and Chat indicators, use the specific known P&S values
+        if (convertedIndicator == KCoreAppUIsNewEmailStatus ||
+                convertedIndicator == KCoreAppUIsUipInd)
+        {
+            if (aValue == KPropertyGlobalIndicatorShow)
+            {
+                // Always ok to turn on - just check if is was already on
+                if (readValue != ECoreAppUIsNewEmail &&
+                        readValue != ECoreAppUIsShow)
+                {
+                    if (convertedIndicator == KCoreAppUIsNewEmailStatus)
+                    {
+                        setValue = ECoreAppUIsNewEmail;
+                    }
+                    if (convertedIndicator == KCoreAppUIsUipInd)
+                    {
+                        setValue = ECoreAppUIsShow;
+                    }
+
+                    ret = property.Set(setValue);
+                    readValue = KPropertyGlobalIndicatorShow;
+                    LOG1(EJavaGlobalInd, EInfo,
+                         "GlobalIndicators::SetGlobalIndicator ON, value:%D",
+                         setValue);
+                }
+            }
+            else if (aValue == KPropertyGlobalIndicatorHide)
+            {
+                // When turning email inficator off bear in mind that there is
+                // no way to know for sure if some other application still would
+                // like to have the indicator turned on.
+                if (readValue != ECoreAppUIsNoNewEmail &&
+                        readValue != ECoreAppUIsDoNotShow)
+                {
+                    if (convertedIndicator == KCoreAppUIsNewEmailStatus)
+                    {
+                        setValue = ECoreAppUIsNoNewEmail;
+                    }
+                    if (convertedIndicator == KCoreAppUIsUipInd)
+                    {
+                        setValue = ECoreAppUIsDoNotShow;
+                    }
+
+                    ret = property.Set(setValue);
+                    readValue = KPropertyGlobalIndicatorHide;
+                    LOG1(EJavaGlobalInd, EInfo,
+                         "GlobalIndicators::SetGlobalIndicator OFF, value:%D",
+                         setValue);
+                }
+            }
+            else
+            {
+                // Value is not HIDE or SHOW. Try to set it anyway.
+                ret = property.Set(aValue);
+                readValue = aValue;
+                LOG1(EJavaGlobalInd, EInfo,
+                     "GlobalIndicators::SetGlobalIndicator value:%D",
+                     aValue);
+            }
+        }
+
+        else // other than Email or Chat indicator
+        {
+            ret = property.Set(aValue);
+            readValue = aValue;
+            LOG1(EJavaGlobalInd, EInfo,
+                 "GlobalIndicators::SetGlobalIndicator [user defined] value:%D",
+                 aValue);
+        }
+
+    }
+    property.Close();
+    if (KErrNone != ret)
+    {
+        LOG1(EJavaGlobalInd, EInfo,
+             "GlobalIndicators::SetGlobalIndicator property error :%D",
+             ret);
+        readValue = ret;
+    }*/
+
+    // return the property value or an error code
+    return readValue;
+}
+
+// -----------------------------------------------------------------------------
+// GlobalIndicator
+// Gets the value of given global indicator.
+// -----------------------------------------------------------------------------
+//
+TInt CGlobalIndicators::GlobalIndicator(TInt aIndicator)
+{
+    LOG(EJavaGlobalInd, EInfo, "GlobalIndicators::GlobalIndicator");
+    RProperty property;
+    TInt readValue = 0;
+    TInt ret = KErrNotFound;
+
+    if (aIndicator == KPropertyGlobalMailIndicator)
+    {
+        //ret = property.Attach(
+          //        KPSUidCoreApplicationUIs, KCoreAppUIsNewEmailStatus);
+    }
+    else if (aIndicator == KPropertyGlobalChatIndicator)
+    {
+      //  ret = property.Attach(
+        //          KPSUidCoreApplicationUIs, KCoreAppUIsUipInd);
+    }
+    else
+    {
+        // A specific indicator (other than mail or chat indicator)
+        //ret = property.Attach(
+          //        KPSUidCoreApplicationUIs, aIndicator);
+    }
+
+    // If Attach has succeeded, try reading the Property value
+    if (KErrNone == ret)
+    {
+        ret = property.Get(readValue);
+        property.Close();
+    }
+
+    // If also reading has succeeded, return the Property value
+    if (KErrNone == ret)
+    {
+        return readValue ;
+    }
+    else
+    {
+        return ret;
+    }
+}
+
+//  End of File
--- a/javauis/nokiauiapi_qt/src/CSoftNotification.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/src/CSoftNotification.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -9,11 +9,17 @@
  *     Nokia Corporation - initial implementation
  *******************************************************************************/
 
-
-#include <w32std.h>
 #include <apgtask.h>
 #include <hbdevicenotificationdialogsymbian.h>
 #include <hbsymbianvariant.h>
+
+#include <memory>
+#include <javastorageentry.h>
+#include <javastorage.h>
+#include <javastoragenames.h>
+#include <JavaCommonUtils.h>
+#include <logger.h>
+
 #include "CSoftNotification.h"
 
 _LIT(KMidletId, "MidletId");
@@ -25,6 +31,10 @@
 // Event id when user accepted notification
 const TInt KEventNoteAccepted = 1;
 
+using namespace std;
+using namespace java::storage;
+using namespace java::util;
+
 // ============================ MEMBER FUNCTIONS ===============================
 // -----------------------------------------------------------------------------
 // CSoftNotification::NewLC
@@ -48,7 +58,7 @@
 // -----------------------------------------------------------------------------
 //
 CSoftNotification::CSoftNotification(TInt aAppId, TInt aNotificationId) :
-    iNotificationId(aNotificationId)
+    iNotificationId(aNotificationId),iIsNoteExist(EFalse)
     {
     iMidletId = TUid::Uid(aAppId);
     }
@@ -60,8 +70,60 @@
 //
 void CSoftNotification::ConstructL()
     {
-    iIndicator = CHbIndicatorSymbian::NewL();
-    iIndicator->SetObserver(this);
+    std::auto_ptr<JavaStorage> js(JavaStorage::createInstance());
+    TInt maxValue = 0;
+    try
+        {
+        js->open(JAVA_DATABASE_NAME);
+        JavaStorageEntry attribute;
+        JavaStorageApplicationEntry_t findPattern;
+        JavaStorageApplicationList_t foundEntries;
+
+        std::wstring midletId = JavaCommonUtils::intToWstring(iMidletId.iUid);
+        attribute.setEntry(SOFTNOTE_MIDLET_ID, midletId);
+        findPattern.insert(attribute);
+
+        js->search(JAVA_SOFTNOTE_TABLE, findPattern, foundEntries);
+        js->close();
+        findPattern.clear();
+
+        // like to know softnote id.
+        attribute.setEntry(SOFTNOTE_ID, L"");
+        // Iterate through all rows matched with search patterns.
+        JavaStorageApplicationList_t::const_iterator applications;
+        for(applications = foundEntries.begin(); applications !=foundEntries.end(); applications++)
+            {
+            // Get softnote ID from its parameters.
+            JavaStorageApplicationEntry_t::const_iterator findIterator = (*applications).find(attribute);
+            if (findIterator != (*applications).end())
+                {
+                TInt id = JavaCommonUtils::wstringToInt((*findIterator).entryValue());
+                if(iNotificationId == id)
+                    {
+                    iIsNoteExist = true;
+                    }
+                if(maxValue<id)
+                    {
+                    maxValue = id;
+                    }
+                }
+            }
+        foundEntries.clear();
+        }
+    catch (JavaStorageException& ex)
+        {
+        LOG1(EJavaStorage, EInfo," JavaSoftNote Exception %s", ex.toString());
+        }
+    
+    if(!iIsNoteExist && iNotificationId == 0)
+        {
+        iNotificationId = maxValue + 1;
+        }
+    if(iIndicator == NULL)
+        {
+        iIndicator = CHbIndicatorSymbian::NewL();
+        iIndicator->SetObserver(this);
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -90,6 +152,11 @@
         delete iIndicator;
         }
     
+    if(iNotificationDialog)
+        {
+        delete iNotificationDialog;
+        }
+    
     if (iPeer)
         {
         iJniEnv->DeleteWeakGlobalRef((jweak)iPeer);
@@ -99,6 +166,7 @@
     iSecondaryText = NULL;
     iImagePath = NULL;
     iIndicator = NULL;
+    iNotificationDialog = NULL;
     iPeer = NULL;
     iMethodId = NULL;
     }
@@ -110,36 +178,40 @@
 //
 bool CSoftNotification::ShowSoftNotificationL()
     {
-    CHbDeviceNotificationDialogSymbian* dialog =
-            CHbDeviceNotificationDialogSymbian::NewL();
-    CleanupStack::PushL(dialog);
+    AddorUpdateSoftNotificationToStorage();
+    
+    if(iNotificationDialog == NULL)
+        {
+        iNotificationDialog = CHbDeviceNotificationDialogSymbian::NewL(this);
+        }
     
     if(iPrimaryText != NULL)
         {
-        dialog->SetTitleL(iPrimaryText->Des());
+        iNotificationDialog->SetTitleL(iPrimaryText->Des());
         }
 
     if(iSecondaryText != NULL)
         {
-        dialog->SetTextL(iSecondaryText->Des());
+        iNotificationDialog->SetTextL(iSecondaryText->Des());
         }
     
     if (iImagePath != NULL)
         {
-        dialog->SetIconNameL(iImagePath->Des());
+        iNotificationDialog->SetIconNameL(iImagePath->Des());
         }
-
-    dialog->ShowL();
+    iNotificationDialog->EnableTouchActivation(ETrue);
+    iNotificationDialog->ShowL();
   
+    // reading Softnote data
     CHbSymbianVariant* varValues = NotificationParamsL();
     CleanupStack::PushL(varValues);
     
+    // creating indicator in status menu
     TBuf<KIndicatorTypeStringLength> indicatorType;
     indicatorType.Format(KIndicatorTypeJavaSoftNote, iMidletId, iNotificationId);
     bool indStatus = iIndicator->Activate(indicatorType, varValues);
     
     CleanupStack::PopAndDestroy(varValues);
-    CleanupStack::PopAndDestroy(dialog);
     return indStatus;
     }
 
@@ -232,20 +304,53 @@
     }
 
 // -----------------------------------------------------------------------------
+// CSoftNotification::NotificationDialogActivated
+// Dynamic soft notification was accepted by user.
+// -----------------------------------------------------------------------------
+//
+void CSoftNotification::NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* /*aDialog*/)
+  {
+    RWsSession ws;
+    User::LeaveIfError(ws.Connect() == KErrNone);
+    TApaTaskList tasklist(ws);
+    TApaTask task = tasklist.FindApp(iMidletId);
+    if (task.Exists())
+        {
+        task.BringToForeground();
+        ws.Close();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// CSoftNotification::NotificationDialogClosed
+// Dynamic soft notification was closed.
+// -----------------------------------------------------------------------------
+//
+void CSoftNotification::NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* /*aDialog*/,
+        TInt /*aCompletionCode*/)
+    {
+    
+    }
+
+// -----------------------------------------------------------------------------
 // CSoftNotification::FillNotificationParams
 // -----------------------------------------------------------------------------
 //
 CHbSymbianVariant* CSoftNotification::NotificationParamsL()
     {
-    //only five parameter, so creat the array 
-    //for five parameters to fit and append them
+    //only five parameter, so creat the array with size 5.
     CDesC16ArrayFlat* array = new CDesC16ArrayFlat(5);
     CleanupStack::PushL(array);
     TBuf<KMidletUidLength> midletId;
     _LIT(MidletId,"%u");
     midletId.Format(MidletId,iMidletId);
     array->AppendL(midletId);
-    array->AppendL(reinterpret_cast<TDesC16&>(iNotificationId));
+    
+    TBuf<10> noteId;
+    _LIT(NoteId,"%d");
+    noteId.Format(NoteId,iNotificationId);
+    array->AppendL(noteId);
+
     if(iPrimaryText != NULL)
         {
         array->AppendL(iPrimaryText->Des());
@@ -277,3 +382,93 @@
     CleanupStack::PopAndDestroy(array);
     return varValues;
     }
+
+// -----------------------------------------------------------------------------
+// CSoftNotification::AddSoftNotificationToStorage
+// -----------------------------------------------------------------------------
+//
+void CSoftNotification::AddorUpdateSoftNotificationToStorage()
+    {
+    std::auto_ptr<JavaStorage> js(JavaStorage::createInstance());
+    try
+        {
+        js->open(JAVA_DATABASE_NAME);
+        JavaStorageApplicationEntry_t newEntries;
+        JavaStorageApplicationEntry_t matchEntries;
+        JavaStorageEntry attribute;
+
+        if (!iIsNoteExist)
+            {
+            // if Softnote is not created, add midletId and notificationId to storage
+            std::wstring midletId = JavaCommonUtils::intToWstring(
+                    iMidletId.iUid);
+            attribute.setEntry(SOFTNOTE_MIDLET_ID, midletId,
+                    JavaStorageEntry::STRING);
+            newEntries.insert(attribute);
+
+            std::wstring notificationId = JavaCommonUtils::intToWstring(
+                    iNotificationId);
+            attribute.setEntry(SOFTNOTE_ID, notificationId,
+                    JavaStorageEntry::INT);
+            newEntries.insert(attribute);
+            }
+        else
+            {
+            // if Softnote is already in the storage, just aupdate the data.
+            std::wstring midletId = JavaCommonUtils::intToWstring(
+                    iMidletId.iUid);
+            attribute.setEntry(SOFTNOTE_MIDLET_ID, midletId,
+                    JavaStorageEntry::STRING);
+            matchEntries.insert(attribute);
+
+            std::wstring notificationId = JavaCommonUtils::intToWstring(
+                    iNotificationId);
+            attribute.setEntry(SOFTNOTE_ID, notificationId,
+                    JavaStorageEntry::INT);
+            matchEntries.insert(attribute);
+            }
+
+        if (iPrimaryText)
+            {
+            std::wstring primaryText((wchar_t*) iPrimaryText->Ptr(),
+                    iPrimaryText->Length());
+            attribute.setEntry(SOFTNOTE_PRIMARY_TEXT, primaryText,
+                    JavaStorageEntry::STRING);
+            newEntries.insert(attribute);
+            }
+        if (iSecondaryText)
+            {
+            std::wstring secondaryText((wchar_t*) iSecondaryText->Ptr(),
+                    iSecondaryText->Length());
+            attribute.setEntry(SOFTNOTE_SECONDARY_TEXT, secondaryText,
+                    JavaStorageEntry::STRING);
+            newEntries.insert(attribute);
+            }
+        if (iImagePath)
+            {
+            std::wstring imagePath((wchar_t*) iImagePath->Ptr(),
+                    iImagePath->Length());
+            attribute.setEntry(SOFTNOTE_IMAGE_PATH, imagePath,
+                    JavaStorageEntry::STRING);
+            newEntries.insert(attribute);
+            }
+
+        if (!iIsNoteExist)
+            {
+            // create new entry in storage if softnote is not created earlier
+            js->write(JAVA_SOFTNOTE_TABLE, newEntries);
+            }
+        else
+            {
+            // update data for softNote. 
+            js->update(JAVA_SOFTNOTE_TABLE, newEntries, matchEntries);
+            }
+        js->close();
+        newEntries.clear();
+        matchEntries.clear();
+        }
+    catch (JavaStorageException& ex)
+        {
+        LOG1(EJavaStorage, EInfo," JavaSoftNote Exception %s", ex.toString());
+        }
+    }
--- a/javauis/nokiauiapi_qt/src/os.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/nokiauiapi_qt/src/os.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -12,7 +12,7 @@
 #include <QWidget>
 #include <coecntrl.h>
 #include <touchfeedback.h>
-#include <com_nokia_mid_ui_internal_OS.h>
+#include <com_nokia_mj_impl_nokiauiapi_OS.h>
 #include "autorelease.h"
 #include "csoftnotification.h"
 
@@ -26,7 +26,7 @@
     return control;
     }
 
-JNIEXPORT void JNICALL Java_com_nokia_mid_ui_internal_OS_MTouchFeedback_1InstantFeedback(
+JNIEXPORT void JNICALL Java_com_nokia_mj_impl_nokiauiapi_OS_MTouchFeedback_1InstantFeedback(
         JNIEnv *, jclass, jint aStyle)
     {
     MTouchFeedback* feedback = MTouchFeedback::Instance();
@@ -36,7 +36,7 @@
         }
     }
 
-JNIEXPORT jboolean JNICALL Java_com_nokia_mid_ui_internal_OS_MTouchFeedback_1TouchFeedbackSupported(
+JNIEXPORT jboolean JNICALL Java_com_nokia_mj_impl_nokiauiapi_OS_MTouchFeedback_1TouchFeedbackSupported(
         JNIEnv *, jclass)
     {
     jboolean enabled = JNI_FALSE;
@@ -48,7 +48,7 @@
     return enabled;
     }
 
-JNIEXPORT void JNICALL Java_com_nokia_mid_ui_internal_OS_MTouchFeedback_1SetFeedbackArea(
+JNIEXPORT void JNICALL Java_com_nokia_mj_impl_nokiauiapi_OS_MTouchFeedback_1SetFeedbackArea(
         JNIEnv *, jclass, jint aControl, jint aAreaIndex, jint aX, jint aY,
         jint aWidth, jint aHeight, jint aStyle)
     {
@@ -64,7 +64,7 @@
         }
     }
 
-JNIEXPORT void JNICALL Java_com_nokia_mid_ui_internal_OS_MTouchFeedback_1RemoveFeedbackArea(
+JNIEXPORT void JNICALL Java_com_nokia_mj_impl_nokiauiapi_OS_MTouchFeedback_1RemoveFeedbackArea(
         JNIEnv *, jclass, jint aControl, jint aAreaIndex)
     {
     MTouchFeedback* feedback = MTouchFeedback::Instance();
@@ -76,7 +76,7 @@
         }
     }
 
-JNIEXPORT void JNICALL Java_com_nokia_mid_ui_internal_OS_MTouchFeedback_1RemoveFeedbackForControl(
+JNIEXPORT void JNICALL Java_com_nokia_mj_impl_nokiauiapi_OS_MTouchFeedback_1RemoveFeedbackForControl(
         JNIEnv *, jclass, jint aControl)
     {
     MTouchFeedback* feedback = MTouchFeedback::Instance();
@@ -88,7 +88,7 @@
         }
     }
 
-JNIEXPORT void JNICALL Java_com_nokia_mid_ui_internal_OS_MTouchFeedback_1MoveFeedbackAreaToFirstPriority(
+JNIEXPORT void JNICALL Java_com_nokia_mj_impl_nokiauiapi_OS_MTouchFeedback_1MoveFeedbackAreaToFirstPriority(
         JNIEnv *, jclass, jint aControl, jint aAreaIndex)
     {
     MTouchFeedback* feedback = MTouchFeedback::Instance();
@@ -101,7 +101,7 @@
         }
     }
 
-JNIEXPORT jint JNICALL Java_com_nokia_mid_ui_internal_OS_createNativePeer(
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_nokiauiapi_OS_createNativePeer(
         JNIEnv* aJniEnv, jclass /*aClazz*/, jint aMidletId,
         jint aNotificationId, jobject aPeer)
     {
@@ -130,7 +130,7 @@
     }
 
 JNIEXPORT jint JNICALL
-Java_com_nokia_mid_ui_internal_OS_getId(JNIEnv* /*aJniEnv*/,
+Java_com_nokia_mj_impl_nokiauiapi_OS_getId(JNIEnv* /*aJniEnv*/,
         jclass /*aPeer*/, jint aSoftNotificationHandle)
     {
     CSoftNotification* softNotification =
@@ -169,7 +169,7 @@
     }
 
 JNIEXPORT jint JNICALL
-Java_com_nokia_mid_ui_internal_OS_setText(JNIEnv* aJniEnv, jclass /*aPeer*/,
+Java_com_nokia_mj_impl_nokiauiapi_OS_setText(JNIEnv* aJniEnv, jclass /*aPeer*/,
         jint aSoftNotificationHandle, jstring aPrimaryText, jstring aSecondaryText)
     {
     CSoftNotification* softNotification =
@@ -200,7 +200,7 @@
     }
 
 JNIEXPORT jint JNICALL
-Java_com_nokia_mid_ui_internal_OS_removeSoftNotification(JNIEnv* /*aJniEnv*/,
+Java_com_nokia_mj_impl_nokiauiapi_OS_removeSoftNotification(JNIEnv* /*aJniEnv*/,
         jclass /*aPeer*/, jint aSoftNotificationHandle)
     {
     CSoftNotification* softNotification =
@@ -211,7 +211,7 @@
     }
 
 JNIEXPORT jint JNICALL
-Java_com_nokia_mid_ui_internal_OS_showSoftNotification(JNIEnv* /*aJniEnv*/,
+Java_com_nokia_mj_impl_nokiauiapi_OS_showSoftNotification(JNIEnv* /*aJniEnv*/,
         jclass /*aPeer*/, jint aSoftNotificationHandle)
     {
     CSoftNotification* softNotification =
@@ -229,7 +229,7 @@
     }
 
 JNIEXPORT jint JNICALL
-Java_com_nokia_mid_ui_internal_OS_setImagePath(JNIEnv* aJniEnv,
+Java_com_nokia_mj_impl_nokiauiapi_OS_setImagePath(JNIEnv* aJniEnv,
         jclass /*aPeer*/, jint aSoftNotificationHandle, jstring aImagePath )
     {
     CSoftNotification* softNotification =
@@ -249,7 +249,7 @@
     }
 
 JNIEXPORT void JNICALL
-Java_com_nokia_mid_ui_internal_OS_destroy(JNIEnv* /*aJniEnv*/,
+Java_com_nokia_mj_impl_nokiauiapi_OS_destroy(JNIEnv* /*aJniEnv*/,
         jclass /*clazz*/, jint aSoftNotificationHandle)
     {
     if (aSoftNotificationHandle > KErrNone)
--- a/javauis/runtimeui_qt/build/bwins/javaruntimeuiu.def	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/runtimeui_qt/build/bwins/javaruntimeuiu.def	Mon Oct 04 11:29:25 2010 +0300
@@ -1,5 +1,5 @@
 EXPORTS
 	?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *)
-	?confirmL@RuntimeUiQt@runtimeui@java@@SAHABVTDesC16@@0@Z @ 2 NONAME ; int java::runtimeui::RuntimeUiQt::confirmL(class TDesC16 const &, class TDesC16 const &)
-	?errorL@RuntimeUiQt@runtimeui@java@@SAXABVTDesC16@@00@Z @ 3 NONAME ; void java::runtimeui::RuntimeUiQt::errorL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &)
+	?confirmL@RuntimeUiQt@runtimeui@java@@SAHABVTDesC16@@0ABVConfirmData@23@_N@Z @ 2 NONAME ; int java::runtimeui::RuntimeUiQt::confirmL(class TDesC16 const &, class TDesC16 const &, class java::runtimeui::ConfirmData const &, bool)
+	?errorL@RuntimeUiQt@runtimeui@java@@SAXABVTDesC16@@0000@Z @ 3 NONAME ; void java::runtimeui::RuntimeUiQt::errorL(class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &, class TDesC16 const &)
 
--- a/javauis/runtimeui_qt/build/eabi/javaruntimeuiu.def	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/runtimeui_qt/build/eabi/javaruntimeuiu.def	Mon Oct 04 11:29:25 2010 +0300
@@ -1,5 +1,5 @@
 EXPORTS
 	_Z10jni_lookupPKc @ 1 NONAME
-	_ZN4java9runtimeui11RuntimeUiQt6errorLERK7TDesC16S4_S4_ @ 2 NONAME
-	_ZN4java9runtimeui11RuntimeUiQt8confirmLERK7TDesC16S4_ @ 3 NONAME
+	_ZN4java9runtimeui11RuntimeUiQt6errorLERK7TDesC16S4_S4_S4_S4_ @ 2 NONAME
+	_ZN4java9runtimeui11RuntimeUiQt8confirmLERK7TDesC16S4_RKNS0_11ConfirmDataEb @ 3 NONAME
 
--- a/javauis/runtimeui_qt/javasrc.s60/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQt.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/runtimeui_qt/javasrc.s60/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQt.java	Mon Oct 04 11:29:25 2010 +0300
@@ -23,12 +23,23 @@
 import com.nokia.mj.impl.utils.exception.ExceptionBase;
 import com.nokia.mj.impl.rt.support.Jvm;
 
+import com.nokia.mj.impl.utils.Id;
+import com.nokia.mj.impl.utils.ResourceLoader;
+
 /**
  * Runtime UI QT implementation.
  *
  */
 public class RuntimeUiQt extends RuntimeUi
 {
+    private static final Id ALLOW_BUTTON = new Id(null, "prompt_allow");
+    private static final Id DENY_BUTTON = new Id(null, "prompt_deny");
+    private static final Id DETAILS_BUTTON = new Id(null, "error_details");
+    private static final Id OK_BUTTON = new Id(null, "prompt_ok");
+    private static final String QT_LOC_FILE = "javaapplicationsecuritymessages";
+    private static final String QT_PREFIX = "txt_java_secur_button_";
+
+    private static ResourceLoader iRes = null;
 
     static
     {
@@ -56,16 +67,31 @@
      */
     public boolean confirm(String aAppName, ConfirmData aConfirmData)
     {
-        if (aConfirmData != null)
-        {
-            return _confirm(aAppName, aConfirmData, isIdentified());
-        }
-        else
+
+        if (aConfirmData == null)
         {
             Logger.LOG(Logger.EJavaRuntime,
                        Logger.EError, "RuntimeUi: ConfirmData null");
+            return false;
         }
-        return true;
+
+        // If no localized button text provided load default ones.
+        if (aConfirmData.getAnswerOptions() == null)
+        {
+            if (iRes == null)
+            {
+                iRes = ResourceLoader.getInstance(null, null, QT_LOC_FILE, QT_PREFIX);
+            }
+
+            String allowButton = iRes.format(ALLOW_BUTTON, null);
+            String denyButton = iRes.format(DENY_BUTTON, null);
+
+            aConfirmData = new ConfirmData(aConfirmData.getQuestion(),
+                                           new String[] {allowButton, denyButton},
+                                           aConfirmData.getAnswerSuggestion());
+        }
+
+        return _confirm(aAppName, aConfirmData, isIdentified());
     }
 
     /**
@@ -80,15 +106,22 @@
     {
         if (aException != null)
         {
-            _error(aAppName, aException.getShortMessage(), aException.getDetailedMessage());
-        }
-        else
-        {
-            Logger.LOG(Logger.EJavaRuntime,
-                       Logger.EError, "RuntimeUi: Error null");
+            if (iRes == null)
+            {
+                iRes = ResourceLoader.getInstance(null, null, QT_LOC_FILE, QT_PREFIX);
+            }
+
+            String detailsButton = iRes.format(DETAILS_BUTTON, null);
+            String okButton = iRes.format(OK_BUTTON, null);
+
+            _error(aAppName,
+                   aException.getShortMessage(),
+                   aException.getDetailedMessage(),
+                   detailsButton,
+                   okButton);
         }
     }
 
     private native boolean _confirm(String aAppName, ConfirmData aConfirmData, boolean aIdentifiedApp);
-    private native void _error(String aAppName, String aShortMessage, String aDetailedMessage);
+    private native void _error(String aAppName, String aShortMessage, String aDetailedMessage, String aDetailsButton, String aOkButton);
 }
--- a/javauis/runtimeui_qt/src.s60/jni.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/runtimeui_qt/src.s60/jni.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007-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"
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:
+* Description: RuntimeUI JNI interface.
 *
 */
 
@@ -26,11 +26,8 @@
 using namespace java::runtimeui;
 
 JNIEXPORT jboolean JNICALL Java_com_nokia_mj_impl_rt_ui_qt_RuntimeUiQt__1confirm
-(JNIEnv * aEnv, jobject, jstring aAppName, jobject aConfirmData, jboolean /*aIdentified*/)
+(JNIEnv * aEnv, jobject, jstring aAppName, jobject aConfirmData, jboolean aIdentified)
 {
-    // Identified parameter is not used. It was earlier used to add icon to query header
-    // and that is currently not supported.
-
     CActiveScheduler* newScheduler = 0;
 
     if (CActiveScheduler::Current() == 0)
@@ -49,10 +46,32 @@
                             aConfirmData, getQuestionMethod);
     JStringUtils question(*aEnv, jQuestion);
 
-    int answer = -1;
+    std::vector<HBufC*> answerOptions;
+    jmethodID getAnswerOptionsMethod = aEnv->GetMethodID(
+                                           confirmDataClass,"getAnswerOptions", "()[Ljava/lang/String;");
+    jobjectArray jAnswerOptions = (jobjectArray)aEnv->CallObjectMethod(
+                                      aConfirmData, getAnswerOptionsMethod);
+    if (jAnswerOptions != NULL)
+    {
+        int len = aEnv->GetArrayLength(jAnswerOptions);
+        answerOptions.reserve(len);
+
+        for (int i=0; i<len; i++)
+        {
+            jstring jAnswerOption = (jstring)aEnv->GetObjectArrayElement(
+                                        jAnswerOptions, i);
+            JStringUtils answerOption(*aEnv, jAnswerOption);
+            answerOptions.push_back(answerOption.Alloc()); // If alloc fails NULL is added.
+        }
+    }
+
+    // Answer suggestion is not supported because of touch UIs.
+    ConfirmData confirmData(question, answerOptions, -1);
+
+    int answer = ConfirmData::NO_ANSWER;
     bool result = false;
 
-    TRAPD(err, answer = RuntimeUiQt::confirmL(appName, question));
+    TRAPD(err, answer = RuntimeUiQt::confirmL(appName, question, confirmData, aIdentified));
 
     if (KErrNone != err)
     {
@@ -66,12 +85,20 @@
         result = true;
     }
 
+    for (int i=0; i<answerOptions.size(); i++)
+    {
+        delete answerOptions.at(i);
+    }
+
+    // cleanup the vector
+    answerOptions.clear();
     delete newScheduler;
+
     return result;
 }
 
 JNIEXPORT void JNICALL Java_com_nokia_mj_impl_rt_ui_qt_RuntimeUiQt__1error
-(JNIEnv * aEnv, jobject, jstring aAppName, jstring aShortMsg, jstring aDetailedMsg)
+(JNIEnv * aEnv, jobject, jstring aAppName, jstring aShortMsg, jstring aDetailedMsg, jstring aDetailsButton, jstring aOkButton)
 {
     CActiveScheduler* newScheduler = 0;
 
@@ -86,9 +113,11 @@
     JStringUtils appName(*aEnv, aAppName);
     JStringUtils shortMsg(*aEnv, aShortMsg);
     JStringUtils detailedMsg(*aEnv, aDetailedMsg);
+    JStringUtils detailsButton(*aEnv, aDetailsButton);
+    JStringUtils okButton(*aEnv, aOkButton);
 
     // delegate the UI implementation to handle the error operation
-    TRAPD(err, RuntimeUiQt::errorL(appName, shortMsg, detailedMsg));
+    TRAPD(err, RuntimeUiQt::errorL(appName, shortMsg, detailedMsg, detailsButton, okButton));
 
     if (KErrNone != err)
     {
--- a/javauis/runtimeui_qt/src.s60/runtimeuiqt.cpp	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/runtimeui_qt/src.s60/runtimeuiqt.cpp	Mon Oct 04 11:29:25 2010 +0300
@@ -24,7 +24,8 @@
 
 using namespace java::runtimeui;
 
-OS_EXPORT void RuntimeUiQt::errorL(const TDesC& /*aAppName*/, const TDesC& aShortMsg, const TDesC& aDetailedMsg)
+OS_EXPORT void RuntimeUiQt::errorL(const TDesC& /*aAppName*/, const TDesC& aShortMsg,
+    const TDesC& aDetailedMsg, const TDesC& aDetailsButton, const TDesC& aOkButton)
 {
     CHbDeviceMessageBoxSymbian* messageBox
     = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning);
@@ -33,16 +34,11 @@
     messageBox->SetTextL(aShortMsg);
     messageBox->SetTimeout(HbPopup::NoTimeout);
 
-    // Read localised versions instead of hard coded values.
-    _LIT(KOkButtonText, "OK");
-
     if (aDetailedMsg.Size() > 0)
     {
-        _LIT(KDetailsButtonText, "Details");
-
-        messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::EAcceptButton, KOkButtonText);
+        messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::EAcceptButton, aOkButton);
         messageBox->SetButton(CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue);
-        messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::ERejectButton, KDetailsButtonText);
+        messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::ERejectButton, aDetailsButton);
         messageBox->SetButton(CHbDeviceMessageBoxSymbian::ERejectButton, ETrue);
 
         if (messageBox->ExecL() == CHbDeviceMessageBoxSymbian::ERejectButton)
@@ -54,7 +50,7 @@
     }
     else
     {
-        messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::EAcceptButton, KOkButtonText);
+        messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::EAcceptButton, aOkButton);
         messageBox->SetButton(CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue);
         (void)messageBox->ExecL();
     }
@@ -62,33 +58,38 @@
     CleanupStack::PopAndDestroy(messageBox);
 }
 
-OS_EXPORT int RuntimeUiQt::confirmL(const TDesC& /*aAppName*/, const TDesC& aQuestion)
+OS_EXPORT int RuntimeUiQt::confirmL(const TDesC& /*aAppName*/, const TDesC& aQuestion,
+    const ConfirmData& aConfirmData, bool /*aIdentified*/)
 {
     CHbDeviceMessageBoxSymbian* messageBox
-    = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning);
+        = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning);
     CleanupStack::PushL(messageBox);
 
     messageBox->SetTextL(aQuestion);
     messageBox->SetTimeout(HbPopup::NoTimeout);
 
-    // Read localised versions instead of hard coded values.
-    _LIT(KAllowButtonText, "Allow");
-    _LIT(KDenyButtonText, "Deny");
+    // Deny by default.
+    int result = 1;
 
-    messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::EAcceptButton, KAllowButtonText);
-    messageBox->SetButton(CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue);
-    messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::ERejectButton, KDenyButtonText);
-    messageBox->SetButton(CHbDeviceMessageBoxSymbian::ERejectButton, ETrue);
+    // ConfirmData must always have two entries. If not confirmation is denied.
+    if (aConfirmData.iAnswerOptions.size() >= 2)
+    {
+        // Button 1 localized text.
+        messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::EAcceptButton, (aConfirmData.iAnswerOptions.at(0))->Des());
+        messageBox->SetButton(CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue);
 
-    // by default the answer is Allow
-    int result = 0;
-    if (messageBox->ExecL() == CHbDeviceMessageBoxSymbian::ERejectButton)
-    {
-        // change the answer to Deny
-        result = 1;
+        // Button 2 localized text.
+        messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::ERejectButton, (aConfirmData.iAnswerOptions.at(1))->Des());
+        messageBox->SetButton(CHbDeviceMessageBoxSymbian::ERejectButton, ETrue);
+
+        if (messageBox->ExecL() == CHbDeviceMessageBoxSymbian::EAcceptButton)
+        {
+            // AcceptButton selected.
+            result = 0;
+        }
+
+        messageBox->Close();
     }
-
-    messageBox->Close();
     CleanupStack::PopAndDestroy(messageBox);
     return result;
 }
--- a/javauis/runtimeui_qt/src.s60/runtimeuiqt.h	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/runtimeui_qt/src.s60/runtimeuiqt.h	Mon Oct 04 11:29:25 2010 +0300
@@ -26,6 +26,23 @@
 {
 namespace runtimeui
 {
+
+class ConfirmData
+{
+public:
+    inline ConfirmData(const TDesC& aQuestion, std::vector<HBufC*> aAnswerOptions, int aAnswerSuggestion)
+            : iQuestion(aQuestion), iAnswerOptions(aAnswerOptions), iAnswerSuggestion(aAnswerSuggestion), iAnswer(NO_ANSWER) {}
+
+    // constant identifying that the answer is not available
+    static const int NO_ANSWER = -1;
+
+    // public members
+    const TDesC& iQuestion;
+    std::vector<HBufC*> iAnswerOptions;
+    int iAnswerSuggestion;
+    int iAnswer;
+};
+
 class RuntimeUiQt
 {
 public:
@@ -36,8 +53,14 @@
      * @param aAppName Application name error occurred.
      * @param aShortMesg Short error description.
      * @param aDetailedMsg Detailed error description.
+     * @param aDetailsButton Localized name for details button.
+     * @param aOkButton Localized name for OK button.
      */
-    OS_IMPORT static void errorL(const TDesC& aAppName, const TDesC& aShortMsg, const TDesC& aDetailedMsg);
+    OS_IMPORT static void errorL(const TDesC& aAppName,
+                                 const TDesC& aShortMsg,
+                                 const TDesC& aDetailedMsg,
+                                 const TDesC& aDetailsButton,
+                                 const TDesC& aOkButton);
 
     /**
      * Request permission to user. This is blocking call and execution does not proceed until
@@ -45,9 +68,14 @@
      *
      * @param aAppName Application name requesting confirmation.
      * @param aQuestion Security question.
-     * @return 1 if user accepts the request, 0 otherwise.
+     * @param aConfirmData Localized texts for dialog buttons.
+     * @param aIdentified if caller is identified i.e. trusted lock icon is shown on the dialog.
+     * @return user selection.
      */
-    OS_IMPORT static int confirmL(const TDesC& aAppName, const TDesC& aQuestion);
+    OS_IMPORT static int confirmL(const TDesC& aAppName,
+                                  const TDesC& aQuestion,
+                                  const ConfirmData& aConfirmData,
+                                  bool aIdentified);
 };
 
 } //end namespace runtimeui
--- a/javauis/runtimeui_qt/tsrc.s60/javasrc/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQtTests.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/runtimeui_qt/tsrc.s60/javasrc/com/nokia/mj/impl/rt/ui/qt/RuntimeUiQtTests.java	Mon Oct 04 11:29:25 2010 +0300
@@ -106,18 +106,26 @@
         boolean answerAvailable = false;
 
         // Test confirm
-        ConfirmData confirmData = new ConfirmData("Confirm dialog. Select Allow", new String[] {"answerOpt1", "answerOpt2", "answerOption3"}, 1);
+        ConfirmData confirmData = new ConfirmData("Confirm dialog. Select Allow", new String[] {"ALLOW", "de_ny", "answerOption3"}, 1);
+        answerAvailable = runtimeUi.confirm("MyFavouriteAplication", confirmData);
+        assertTrue(answerAvailable && confirmData.getAnswer() == 0);
+
+        confirmData = new ConfirmData("Confirm dialog. Select Deny", new String[] {"SALLI", "deny", "answerOption3"}, 1);
         answerAvailable = runtimeUi.confirm("MyFavouriteAplication", confirmData);
         assertTrue(answerAvailable && confirmData.getAnswer() == 1);
 
-        confirmData = new ConfirmData("Confirm dialog. Select Deny", new String[] {"answerOpt1", "answerOpt2", "answerOption3"}, 1);
-        answerAvailable = runtimeUi.confirm("MyFavouriteAplication", confirmData);
-        assertTrue(answerAvailable && confirmData.getAnswer() == 0);
-
         confirmData = new ConfirmData("Null Answer options", null /*Not Supported*/, 1);
         answerAvailable = runtimeUi.confirm("Null answer options", confirmData);
         assertTrue(answerAvailable);
 
+        confirmData = new ConfirmData("Empty string", new String[] {"", "y"}, 1);
+        answerAvailable = runtimeUi.confirm("MyFavouriteAplication", confirmData);
+        assertTrue(answerAvailable);
+
+        confirmData = new ConfirmData("Long button text", new String[] {"loonglooongloongButoonTextloongloonglonng", "DENY"}, 1);
+        answerAvailable = runtimeUi.confirm("MyFavouriteAplication", confirmData);
+        assertTrue(answerAvailable);
+
         ConfirmData nullConf = null;
         runtimeUi.confirm("Null Application", nullConf);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/tsrc/fute/lcdui/Midp_Graphics_01/build.xml	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,37 @@
+<!--
+#
+# Copyright (c) 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"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: 
+#
+-->
+
+<project name="Midp_Graphics_01" default="pack">
+
+    <!-- Get general settings for MIDlet projects. -->
+    <import file="../../properties.xml"/>
+
+    <!-- Set properties for this project. -->
+    <property name="midlet1.name" value="Midp_Graphics_01"/>
+    <property name="midlet1.icon.name" value=""/>
+    <property name="midlet1.package.name" value="Midp_Graphics_01"/>
+    <property name="midlet.permissions" value=""/>
+    <property name="package.name" value="Midp_Graphics_01"/>
+    <property name="company.name" value="Nokia"/>
+    <property name="midlet.version" value="1.0"/>
+    <property name="midlet.description" value=""/>
+
+    <!-- Get settings for a basic MIDlet. -->
+    <import file="../../properties-basic-midlet.xml"/>
+
+</project>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/tsrc/fute/lcdui/Midp_Graphics_01/src/CanvasTests_01.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,125 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+import javax.microedition.lcdui.*;
+import javax.microedition.midlet.*;
+
+/**
+ * This class tests fillArc() method functionality.
+ */
+
+public class CanvasTests_01 extends Canvas implements CommandListener
+{
+
+    // Reference to MIDlet
+    private MIDlet parent = null;
+    // Commands for the canvas
+    private Command cmdReset = new Command("Reset values", Command.SCREEN, 1);
+    private Command cmdSize = new Command("Toggle size", Command.SCREEN, 1);
+    private Command cmdExit = new Command("Exit", Command.EXIT, 1);
+
+    private int startAngle = 0;
+    private int arcAngle = 0;
+    private int size = 30;
+
+    /**
+     *
+     * @param parent The parent MIDlet
+     */
+    public CanvasTests_01(MIDlet parent)
+    {
+        this.parent = parent;
+        addCommand(cmdReset);
+        addCommand(cmdSize);
+        addCommand(cmdExit);
+        setCommandListener(this);
+
+        setFullScreenMode(true);
+        Display.getDisplay(parent).setCurrent(this);
+    }
+
+    protected void paint(Graphics g)
+    {
+        g.setGrayScale(255);
+        g.fillRect(0, 0, getWidth(), getHeight());
+        int height = g.getFont().getHeight();
+
+        g.setGrayScale(0);
+        g.drawString("fillArc function test", 0, 0, Graphics.TOP|Graphics.LEFT);
+
+        g.drawString("fillArc(30,60," + size + "," + size + "," + startAngle + "," + arcAngle + ")", 0, 30, Graphics.TOP|Graphics.LEFT);
+        g.fillArc(30, 60, size, size, startAngle, arcAngle);
+    }
+
+    public void commandAction(Command c, Displayable s)
+    {
+        if(c == cmdReset)
+        {
+            startAngle = 0;
+            arcAngle = 0;
+            size = 30;
+        }
+        else if(c == cmdSize)
+        {
+            size += 10;
+            if(size > 300)
+                size = 10;
+        }
+        else if(c == cmdExit)
+        {
+            parent.notifyDestroyed();
+        }
+    }
+
+    protected void keyPressed(int kyCode)
+    {
+        handleKeyPress(kyCode);
+    }
+
+    protected void keyRepeated(int kyCode)
+    {
+        handleKeyPress(kyCode);
+    }
+
+    protected void handleKeyPress(int kyCode)
+    {
+        if(getGameAction(kyCode) == Canvas.UP)
+        {
+            startAngle++;
+        }
+        else if(getGameAction(kyCode) == Canvas.DOWN)
+        {
+            startAngle--;
+        }
+        else if(getGameAction(kyCode) == Canvas.LEFT)
+        {
+            arcAngle--;
+        }
+        else if(getGameAction(kyCode) == Canvas.RIGHT)
+        {
+            arcAngle++;
+        }
+        else if(getGameAction(kyCode) == Canvas.GAME_A)
+        {
+            size += 10;
+            if(size > 300)
+                size = 10;
+        }
+        repaint();
+        serviceRepaints();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/tsrc/fute/lcdui/Midp_Graphics_01/src/Midp_Graphics_01.java	Mon Oct 04 11:29:25 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* Copyright (c) 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"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+ * import midp classes.
+ */
+import javax.microedition.midlet.*;
+
+/**
+ * This is the main class for Canvas tests.
+ */
+
+public class Midp_Graphics_01 extends MIDlet
+{
+
+    /**
+     * Signals the MIDlet to start and enter the Active state.
+     */
+    protected void startApp()
+    {
+        new CanvasTests_01(this);
+    }
+
+    /**
+     *  Signals the MIDlet to terminate and enter the Destroyed state.
+     *
+     */
+    protected void destroyApp(boolean unconditional)
+    {
+        System.out.println("destroyApp is called");
+    }
+
+    /**
+     *  Signals the MIDlet to stop and enter the Paused state.
+     */
+    protected void pauseApp()
+    {
+    }
+}
--- a/javauis/tsrc/fute/lcdui/Midp_TextBox_01/build.xml	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/tsrc/fute/lcdui/Midp_TextBox_01/build.xml	Mon Oct 04 11:29:25 2010 +0300
@@ -28,7 +28,7 @@
     <property name="midlet.permissions" value=""/>
     <property name="package.name" value="Midp_TextBox_01"/>
     <property name="company.name" value="Nokia"/>
-    <property name="midlet.version" value="1.1"/>
+    <property name="midlet.version" value="1.2"/>
     <property name="midlet.description" value=""/>
 
     <!-- Get settings for a basic MIDlet. -->
--- a/javauis/tsrc/fute/lcdui/Midp_TextBox_01/src/ScreenTextBoxTests.java	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/tsrc/fute/lcdui/Midp_TextBox_01/src/ScreenTextBoxTests.java	Mon Oct 04 11:29:25 2010 +0300
@@ -109,6 +109,14 @@
     //maximum size which is specified while creating TextBox
     private final int MAX_SIZE = 100;
 
+    //Commands for the item specific options menu.
+    private Command cmdScreen1 = new Command("1 item cmd", Command.SCREEN, 1);
+    private Command cmdScreen2 = new Command("1 ok cmd", Command.SCREEN, 1);
+    private Command cmdScreen3 = new Command("1 item 1 ok cmd", Command.SCREEN, 1);
+    private Command cmdScreen4 = new Command("0 item 0 ok cmd", Command.SCREEN, 1);
+    private Command cmdItemC = new Command("Item command", Command.ITEM, 1);
+    private Command cmdOkC = new Command("Ok command", Command.OK, 1);
+
     /**
      *
      * @param parent The parent MIDlet of this class
@@ -331,6 +339,12 @@
                 addUneditableTextBoxTest2("EMAILADDR|PWD|UNDEDITABLE", TextField.EMAILADDR|TextField.PASSWORD|TextField.UNEDITABLE);
             else if (element.equals(listElements[27]))
                 addNumericUneditableTextBoxTest2("PNO|PWD|UNDEDITABLE", TextField.PHONENUMBER|TextField.PASSWORD|TextField.UNEDITABLE);
+
+            tb2.addCommand(cmdScreen1);
+            tb2.addCommand(cmdScreen2);
+            tb2.addCommand(cmdScreen3);
+            tb2.addCommand(cmdScreen4);
+            tb2.setCommandListener(this);
         }
         else if (c == cmdTest3)
             addFormTest3();
@@ -350,6 +364,38 @@
             tb3.setTitle(titleT.getString());
             Display.getDisplay(parent).setCurrent(tb3);
         }
+        else if (c == cmdScreen1)
+        {
+            tb2.removeCommand(cmdOkC);
+            tb2.addCommand(cmdItemC);
+            tb2.setTitle("TextBox");
+        }
+        else if (c == cmdScreen2)
+        {
+            tb2.removeCommand(cmdItemC);
+            tb2.addCommand(cmdOkC);
+            tb2.setTitle("TextBox");
+        }
+        else if (c == cmdScreen3)
+        {
+            tb2.addCommand(cmdItemC);
+            tb2.addCommand(cmdOkC);
+            tb2.setTitle("TextBox");
+        }
+        else if (c == cmdScreen4)
+        {
+            tb2.removeCommand(cmdItemC);
+            tb2.removeCommand(cmdOkC);
+            tb2.setTitle("TextBox");
+        }
+        else if (c == cmdItemC)
+        {
+            tb2.setTitle("Item command executed.");
+        }
+        else if (c == cmdOkC)
+        {
+            tb2.setTitle("Ok command executed.");
+        }
         else if (c == cmdExit)
         {
             parent.destroyApp(false);
--- a/javauis/tsrc/fute/lcdui/Midp_Ticker_01/build.xml	Fri Sep 17 16:44:34 2010 +0300
+++ b/javauis/tsrc/fute/lcdui/Midp_Ticker_01/build.xml	Mon Oct 04 11:29:25 2010 +0300
@@ -31,7 +31,35 @@
     <property name="midlet.version" value="1.1"/>
     <property name="midlet.description" value=""/>
 
-    <!-- Get settings for a basic MIDlet. -->
-    <import file="../../properties-basic-midlet.xml"/>
+    <!-- Package Preverifed classes, resources and MANIFEST file -->
+    <target name="pack" depends="preverify">
+        <wtkjad jadfile="${bin}/${package.name}.jad"
+            jarfile="${bin}/${package.name}.jar"
+            update="true"
+            config="1.1"
+            profile="2.1"
+            manifest="${bin}/MANIFEST.MF"
+            name="${package.name}"
+            vendor="${company.name}">
+            <attribute name="MIDlet-Permissions" value="${midlet.permissions}"/>
+            <attribute name="MicroEdition-Profile" value="MIDP-2.1"/>
+            <attribute name="MicroEdition-Configuration" value="CLDC-1.1"/>
+            <attribute name="MIDlet-Version" value="${midlet.version}"/>
+            <attribute name="MIDlet-Description" value="${midlet.description}"/>
+            <attribute name="Nokia-UI-Enhancement" value="FullScreenTextBox"/>
+            <midlet name="${midlet1.name}" icon="${midlet1.icon.name}" class="${midlet1.package.name}" />
+        </wtkjad>
+
+        <wtkpackage
+            jarfile="${bin}/${package.name}.jar"
+            jadfile="${bin}/${package.name}.jad"
+            classpath="${project.class.path}"
+            basedir="${prever}"
+            autoversion="false">
+            <exclude_from_manifest name="Nokia-UI-Enhancement"/>
+            <fileset dir="${res}"
+                excludes="**/distribution.policy.s60" />
+        </wtkpackage>
+    </target>
 
 </project>
\ No newline at end of file
--- a/rom/installerodclist	Fri Sep 17 16:44:34 2010 +0300
+++ b/rom/installerodclist	Mon Oct 04 11:29:25 2010 +0300
@@ -25,4 +25,5 @@
 javabluetooth.odc
 javawma.odc
 javawmamms.odc
+javaccapi.odc
 resources.jar
--- a/rom/java_2_2.iby	Fri Sep 17 16:44:34 2010 +0300
+++ b/rom/java_2_2.iby	Mon Oct 04 11:29:25 2010 +0300
@@ -349,6 +349,17 @@
 file=ABI_DIR\BUILD_DIR\javacentrep.dll                                      SHARED_LIB_DIR\javacentrep.dll
 data=JAVA_VM_RES_BLD\javacentrep.odc                                        JAVA_VM_RES_IMG\javacentrep.odc
 
+#ifdef FF_NEAR_FIELD_COMMUNICATION
+
+//Contactless Communications API JSR 257
+file=ABI_DIR\BUILD_DIR\javandefscplugin.dll                                 SHARED_LIB_DIR\javandefscplugin.dll
+file=ABI_DIR\BUILD_DIR\javaccapi.dll                                      	SHARED_LIB_DIR\javaccapi.dll
+file=ABI_DIR\BUILD_DIR\javaccapiext.dll                                     SHARED_LIB_DIR\javaccapiext.dll
+data=JAVA_VM_RES_BLD\javaccapi.odc                                        	JAVA_VM_RES_IMG\javaccapi.odc
+data=JAVA_VM_RES_BLD\javaccapiext.odc                                       JAVA_VM_RES_IMG\javaccapiext.odc
+
+#endif //FF_NEAR_FIELD_COMMUNICATION
+
 ///////////////////
 // Miscellaneous //
 ///////////////////
--- a/rom/java_3_1.iby	Fri Sep 17 16:44:34 2010 +0300
+++ b/rom/java_3_1.iby	Mon Oct 04 11:29:25 2010 +0300
@@ -38,10 +38,10 @@
 
 // Application settings
 file=ABI_DIR\BUILD_DIR\javaapplicationsettingsview.dll                              SHARED_LIB_DIR\javaapplicationsettingsview.dll
-data=DATAZ_\resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin 		resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin
+data=DATAZ_\resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin    resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin
 
 // Captain
-file=ABI_DIR\BUILD_DIR\javacaptain_ext_autostarter.dll             	        SHARED_LIB_DIR\javacaptain_ext_autostarter.dll
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_autostarter.dll                      SHARED_LIB_DIR\javacaptain_ext_autostarter.dll
 file=ABI_DIR\BUILD_DIR\javacaptain_ext_btdeviceclassmanager.dll             SHARED_LIB_DIR\javacaptain_ext_btdeviceclassmanager.dll
 file=ABI_DIR\BUILD_DIR\javacaptain_ext_config.dll                           SHARED_LIB_DIR\javacaptain_ext_config.dll
 file=ABI_DIR\BUILD_DIR\javacaptain_ext_ondemand_2.dll                       SHARED_LIB_DIR\javacaptain_ext_ondemand_2.dll
@@ -50,6 +50,7 @@
 file=ABI_DIR\BUILD_DIR\javacaptain_ext_pushregistryplugin.dll               SHARED_LIB_DIR\javacaptain_ext_pushregistryplugin.dll
 file=ABI_DIR\BUILD_DIR\javacaptain_ext_storageserverplugin.dll              SHARED_LIB_DIR\javacaptain_ext_storageserverplugin.dll
 file=ABI_DIR\BUILD_DIR\javacaptain_ext_settingslistener.dll                 SHARED_LIB_DIR\javacaptain_ext_settingslistener.dll
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_javasoftnoteplugin.dll               SHARED_LIB_DIR\javacaptain_ext_javasoftnoteplugin.dll
 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
 file=ABI_DIR\BUILD_DIR\javacaptain_ext_scrupdater.dll                       SHARED_LIB_DIR\javacaptain_ext_scrupdater.dll
 #endif
@@ -122,10 +123,6 @@
 file=ABI_DIR\BUILD_DIR\javamobinfo.dll                                      SHARED_LIB_DIR\javamobinfo.dll
 data=JAVA_VM_RES_BLD\javamobinfo.odc                                        JAVA_VM_RES_IMG\javamobinfo.odc
 
-// GlobalIndicators API
-file=ABI_DIR\BUILD_DIR\javaglobalindicators.dll                             SHARED_LIB_DIR\javaglobalindicators.dll
-data=JAVA_VM_RES_BLD\javaglobalindicators.odc                               JAVA_VM_RES_IMG\javaglobalindicators.odc
-
 // SoftNotification API
 /*file=ABI_DIR\BUILD_DIR\javasoftnotification.dll                             SHARED_LIB_DIR\javasoftnotification.dll
 data=JAVA_VM_RES_BLD\javasoftnotification.odc                               JAVA_VM_RES_IMG\javasoftnotification.odc
@@ -224,7 +221,6 @@
 data=JAVA_POLICY_BLD\att_untrusted.ser                                      JAVA_POLICY_IMG\att_untrusted.ser
 data=JAVA_POLICY_BLD\all.ser                                                JAVA_POLICY_IMG\all.ser
 
-
 // Java environment info
 file=ABI_DIR\BUILD_DIR\javaenvinfo.dll                                      SHARED_LIB_DIR\javaenvinfo.dll
 data=ABI_DIR\BUILD_DIR\Z\Resource\versions\java.txt                         RESOURCE_FILES_DIR\versions\java.txt
@@ -303,10 +299,6 @@
 file=ABI_DIR\BUILD_DIR\javasensor.dll                                       SHARED_LIB_DIR\javasensor.dll
 data=JAVA_VM_RES_BLD\javasensor.odc                                         JAVA_VM_RES_IMG\javasensor.odc
 
-// Web services API
-file=ABI_DIR\BUILD_DIR\javawebservices.dll                                  SHARED_LIB_DIR\javawebservices.dll
-data=JAVA_VM_RES_BLD\javawebservices.odc                                    JAVA_VM_RES_IMG\javawebservices.odc
-
 // PIM API
 file=ABI_DIR\BUILD_DIR\javapim.dll                                          SHARED_LIB_DIR\javapim.dll
 data=JAVA_VM_RES_BLD\javapim.odc                                            JAVA_VM_RES_IMG\javapim.odc
@@ -328,19 +320,20 @@
 data=JAVA_VM_RES_BLD\javaiapinfo.odc                                        JAVA_VM_RES_IMG\javaiapinfo.odc
 
 // MMAPI
-file=ABI_DIR\BUILD_DIR\javamobilemedia.dll                                      SHARED_LIB_DIR\javamobilemedia.dll
-data=JAVA_VM_RES_BLD\javamobilemedia.odc                                        JAVA_VM_RES_IMG\javamobilemedia.odc
+file=ABI_DIR\BUILD_DIR\javamobilemedia.dll                                  SHARED_LIB_DIR\javamobilemedia.dll
+data=JAVA_VM_RES_BLD\javamobilemedia.odc                                    JAVA_VM_RES_IMG\javamobilemedia.odc
 data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaCapture.wav     \System\Sounds\Digital\CamcorderJavaCapture.wav
 data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaStart.wav       \System\Sounds\Digital\CamcorderJavaStart.wav
 
 // AMMS
-file=ABI_DIR\BUILD_DIR\javaamms.dll                                      SHARED_LIB_DIR\javaamms.dll
-data=JAVA_VM_RES_BLD\javaamms.odc                                        JAVA_VM_RES_IMG\javaamms.odc
+file=ABI_DIR\BUILD_DIR\javaamms.dll                                         SHARED_LIB_DIR\javaamms.dll
+data=JAVA_VM_RES_BLD\javaamms.odc                                           JAVA_VM_RES_IMG\javaamms.odc
 
 // CentralRepository API
 file=ABI_DIR\BUILD_DIR\javacentrep.dll                                      SHARED_LIB_DIR\javacentrep.dll
 data=JAVA_VM_RES_BLD\javacentrep.odc                                        JAVA_VM_RES_IMG\javacentrep.odc
 
+
 ///////////////////
 // Miscellaneous //
 ///////////////////
--- a/rom/midpodclist	Fri Sep 17 16:44:34 2010 +0300
+++ b/rom/midpodclist	Mon Oct 04 11:29:25 2010 +0300
@@ -42,4 +42,6 @@
 javawma.odc
 javawmamms.odc
 javacentrep.odc
+javaccapi.odc
+javaccapiext.odc
 resources.jar
--- a/subsystem.mk	Fri Sep 17 16:44:34 2010 +0300
+++ b/subsystem.mk	Mon Oct 04 11:29:25 2010 +0300
@@ -17,4 +17,6 @@
 override JAVA_SRC_ROOT = $(CURDIR)
 export JAVA_SRC_ROOT
 
+COMPONENT_ROOT = 1
+
 include $(JAVA_SRC_ROOT)/build/makefile