# HG changeset patch # User William Roberts # Date 1279033552 -3600 # Node ID 3182bd6adebbe115f5f919c5ba77061f5268a6ff # Parent e0d6e9bd3ca79a459b643700e3eee282f8c0edd9# Parent 0105bdca6f9c999bf38b8830f36464f1cd0ff6d4 Remerge fix for Big 3029 diff -r 0105bdca6f9c -r 3182bd6adebb build/Makefile.comp --- a/build/Makefile.comp Wed Jun 30 15:21:28 2010 +0100 +++ b/build/Makefile.comp Tue Jul 13 16:05:52 2010 +0100 @@ -119,7 +119,7 @@ # Symbian ---------------------------------- ifeq ($(BUILDENV),symbian) -all: qmake java native +all: qmake java native codescanner # Extract basename of current component BASENAME = $(basename $(PRO_FILE)) @@ -170,6 +170,12 @@ 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 +codescanner: +ifneq ($(call PATHSEARCH,codescanner.exe),) + $(call CODESCANNER,..) +endif + # Symbian SBS ------------------------------ ifdef USESBS diff -r 0105bdca6f9c -r 3182bd6adebb build/Makefile.defs --- a/build/Makefile.defs Wed Jun 30 15:21:28 2010 +0100 +++ b/build/Makefile.defs Tue Jul 13 16:05:52 2010 +0100 @@ -57,6 +57,7 @@ MKDIR = if [ ! -d $(1)]; then mkdir $(1); fi RMDIR = if [ -d $(1)]; then rmdir $(1); fi DELTREE = if [ -d $(1)]; then rm -fr $(1); fi + PATHSEARCH = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(PATH))))) else # CMD.exe definitions @@ -74,6 +75,7 @@ MKDIR = if not exist $(1) mkdir $(1) RMDIR = if exist $(1) rmdir $(1) DELTREE = if exist $(1) rmdir /S/Q $(1) + PATHSEARCH = $(firstword $(wildcard $(addsuffix /$(1),$(subst ;, ,$(PATH))))) endif @@ -103,6 +105,7 @@ export ANT_OPTS= BLDMAKE = perl -S bldmake.pl ABLDMAKE = set MAKELEVEL=&&set MAKEFLAGS=&&set MFLAGS=&&make -r + CODESCANNER = codescanner -c $(JAVA_SRC_ROOT)/build/codescanner_high.xml -o std $(1) | perl -ne "print if /error:/;" ifdef NODEP # Makmake does not make dependency checks with this flag diff -r 0105bdca6f9c -r 3182bd6adebb build/Makefile.nonqt --- a/build/Makefile.nonqt Wed Jun 30 15:21:28 2010 +0100 +++ b/build/Makefile.nonqt Tue Jul 13 16:05:52 2010 +0100 @@ -43,19 +43,24 @@ # Symbian ---------------------------------- ifeq ($(BUILDENV),symbian) -all: native +all: native codescanner javareleasables: makestubs: +codescanner: +ifneq ($(call PATHSEARCH,codescanner.exe),) + $(call CODESCANNER,..) +endif + # Symbian SBS ------------------------------ ifdef USESBS # BUILD combines commands EXPORT MAKEFILE BITMAP RESOURCE LIBRARY TARGET FINAL native: $(PHASEINFO) - $(SBS) -c $(PLATFORM)_$(CFG) BUILD + $(SBS) -c $(PLATFORM)_$(CFG) clean_java: diff -r 0105bdca6f9c -r 3182bd6adebb build/Makefile.project --- a/build/Makefile.project Wed Jun 30 15:21:28 2010 +0100 +++ b/build/Makefile.project Tue Jul 13 16:05:52 2010 +0100 @@ -174,13 +174,6 @@ ifdef RD_JAVA_USIF_ENABLED SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK = 1 PROJECT_DEFINES += SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - # Following flag enables application registrations to USIF - # and disables application registrations to AppArc. - PROJECT_DEFINES += RD_JAVA_USIF_APP_REG - # Following flag enables application notifications to AppArc. - PROJECT_DEFINES += RD_JAVA_USIF_NOTIFY_APP_ARC - # Following flag enables installation progress notifications through USIF. - PROJECT_DEFINES += RD_JAVA_USIF_NOTIFY_PROGRESS endif # Java proximity Listener support exsist in 9.2 only(can not be used if 5.0 untill IAD dependecy mentioned) diff -r 0105bdca6f9c -r 3182bd6adebb build/Makefile.subsystem --- a/build/Makefile.subsystem Wed Jun 30 15:21:28 2010 +0100 +++ b/build/Makefile.subsystem Tue Jul 13 16:05:52 2010 +0100 @@ -188,6 +188,11 @@ bld.inf: $(MAKE) -f subsystem.mk makestubs qmake +# Use Carbide CodeScanner to list high-level issues +codescanner: +ifneq ($(call PATHSEARCH,codescanner.exe),) + $(call CODESCANNER,.) +endif # Symbian SBS ------------------------------ ifdef USESBS diff -r 0105bdca6f9c -r 3182bd6adebb build/bld.inf --- a/build/bld.inf Wed Jun 30 15:21:28 2010 +0100 +++ b/build/bld.inf Tue Jul 13 16:05:52 2010 +0100 @@ -50,7 +50,7 @@ #else // RD_JAVA_UI_QT -../rom/java_2_1.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) +../rom/java_2_2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) // Export ODC list files ../rom/midpodclist /epoc32/release/winscw/udeb/z/resource/java/midpodclist diff -r 0105bdca6f9c -r 3182bd6adebb build/codescanner_high.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/codescanner_high.xml Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,61 @@ + + + + + + + .*\.au + .*\.avi + .*\.bmp + .*\.dll + .*\.doc + .*\.exe + .*\.gif + .*\.jpg + .*\.mbm + .*\.mp3 + .*\.mpg + .*\.png + .*\.raw + .*\.rtf + .*\.tif + .*\.wav + .*\.wbmp + .*\.wmf + .*\.xls + + .*\\ts_.* + .*\\tsrc\\.* + .*\\tsrc.s60\\.* + .*\\test\\.* + .*\\internal\\.* + .*\\Internal\\.* + .*\\.svn\\.* + \\tools\\.* + + + + + + + + + + diff -r 0105bdca6f9c -r 3182bd6adebb build/exports.inf --- a/build/exports.inf Wed Jun 30 15:21:28 2010 +0100 +++ b/build/exports.inf Tue Jul 13 16:05:52 2010 +0100 @@ -48,7 +48,7 @@ #else // RD_JAVA_UI_QT -../rom/java_2_1.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) +../rom/java_2_2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) // Export ODC list files ../rom/midpodclist /epoc32/release/winscw/udeb/z/resource/java/midpodclist diff -r 0105bdca6f9c -r 3182bd6adebb build/loc/resources.jar Binary file build/loc/resources.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb build/loc/resources_qt.jar Binary file build/loc/resources_qt.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb build/makefile.javaversion --- a/build/makefile.javaversion Wed Jun 30 15:21:28 2010 +0100 +++ b/build/makefile.javaversion Tue Jul 13 16:05:52 2010 +0100 @@ -1,2 +1,2 @@ # Set Java version (must be dot separated, without spaces) -JAVA_VERSION = 2.2.1 +JAVA_VERSION = 2.2.3 diff -r 0105bdca6f9c -r 3182bd6adebb build/omj.pri --- a/build/omj.pri Wed Jun 30 15:21:28 2010 +0100 +++ b/build/omj.pri Tue Jul 13 16:05:52 2010 +0100 @@ -73,7 +73,7 @@ include(symbian_uids.pri) DEFINES += __SYMBIAN32__ - DEFINES += J9EPOC32 RD_JAVA_OMJ_FSERVER + DEFINES += J9EPOC32 LIBS += -llibpthread diff -r 0105bdca6f9c -r 3182bd6adebb build/sis/incompatible_openc.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/sis/incompatible_openc.txt Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,3 @@ +OpenC version 1.5 or later is not found. Some Java applications may not work properly. Make sure that latest device firmware is used. + +Continue installation? \ No newline at end of file diff -r 0105bdca6f9c -r 3182bd6adebb build/sis/incompatible_platform.txt --- a/build/sis/incompatible_platform.txt Wed Jun 30 15:21:28 2010 +0100 +++ b/build/sis/incompatible_platform.txt Tue Jul 13 16:05:52 2010 +0100 @@ -1,1 +1,1 @@ -Unfortunately Java Runtime 2.0 Alpha is not compatible with your device. Java Runtime 2.0 Alpha works only on S60 5.0 devices. +Java Runtime is not compatible with your device. Java Runtime requires S60 5th Edition device. \ No newline at end of file diff -r 0105bdca6f9c -r 3182bd6adebb build/sis/java_2_0.pkg --- a/build/sis/java_2_0.pkg Wed Jun 30 15:21:28 2010 +0100 +++ b/build/sis/java_2_0.pkg Tue Jul 13 16:05:52 2010 +0100 @@ -43,6 +43,17 @@ ; Popup error on Non-S60 v 5.0 platforms. Do not allow continuing. "incompatible_platform.txt"-"", FILETEXT, FORCEABORT ENDIF + +; Check OpenC versions +; 0x10282872 = Standard C++ library +; 0x10281F34 = Open C LIBSSL +; 0x20009a80 = Symbian OS PIPS +IF( version(0x10282872, <, 1, 5, 0) ) OR + ( version(0x10281F34, <, 1, 5, 0) ) OR + ( version(0x20009a80, <, 1, 5, 0) ) + "incompatible_openc.txt"-"", FT, TA +ENDIF + #endif // RD_JAVA_S60_RELEASE_5_0_IAD @@ -95,6 +106,7 @@ "\epoc32\release\armv5\urel\javacaptain.exe"-"c:\sys\bin\javacaptain.exe" "\epoc32\release\armv5\urel\javalauncher.exe"-"c:\sys\bin\javalauncher.exe" +"\epoc32\release\armv5\urel\javaupgradeapp.exe"-"c:\sys\bin\javaupgradeapp.exe" @@ -493,6 +505,7 @@ "\epoc32\release\armv5\urel\javacaptain_ext_storageserverplugin.dll" -"c:\sys\bin\javacaptain_ext_storageserverplugin.dll" "\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" ; 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 RD_JAVA_MIDPRMS_DB diff -r 0105bdca6f9c -r 3182bd6adebb build/sis/java_3_1.pkg --- a/build/sis/java_3_1.pkg Wed Jun 30 15:21:28 2010 +0100 +++ b/build/sis/java_3_1.pkg Tue Jul 13 16:05:52 2010 +0100 @@ -50,6 +50,7 @@ "\epoc32\release\armv5\urel\javabackup.exe"-"c:\sys\bin\javabackup.exe" "\epoc32\release\armv5\urel\javacaptain.exe"-"c:\sys\bin\javacaptain.exe" "\epoc32\release\armv5\urel\javalauncher.exe"-"c:\sys\bin\javalauncher.exe" +"\epoc32\release\armv5\urel\javaupgradeapp.exe"-"c:\sys\bin\javaupgradeapp.exe" ;Odc file lists "\epoc32\data\z\resource\java\midpodclist"-"c:\resource\java\midpodclist" @@ -180,7 +181,6 @@ "\epoc32\release\armv5\urel\javapushcontroller.dll"-"c:\sys\bin\javapushcontroller.dll" "\epoc32\release\armv5\urel\javaregistryclient.dll"-"c:\sys\bin\javaregistryclient.dll" "\epoc32\release\armv5\urel\javaruntimestarterutils.dll"-"c:\sys\bin\javaruntimestarterutils.dll" -"\epoc32\release\armv5\urel\javasidchecker.dll"-"c:\sys\bin\javasidchecker.dll" "\epoc32\release\armv5\urel\javasizehelperclient.dll"-"c:\sys\bin\javasizehelperclient.dll" "\epoc32\release\armv5\urel\javasizehelperserver.dll"-"c:\sys\bin\javasizehelperserver.dll" "\epoc32\release\armv5\urel\javasocketscplugin.dll"-"c:\sys\bin\javasocketscplugin.dll" @@ -204,6 +204,7 @@ "\epoc32\release\armv5\urel\javacaptain_ext_storageserverplugin.dll" -"c:\sys\bin\javacaptain_ext_storageserverplugin.dll" "\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" ; 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 @@ -221,9 +222,9 @@ "\epoc32\data\z\private\10003a3f\apps\javainstaller_reg.rsc"-"c:\private\10003a3f\import\apps\javainstaller_reg.rsc" "\epoc32\data\z\resource\apps\javainstaller_loc.rsc"-"c:\resource\apps\javainstaller_loc.rsc" "\epoc32\data\z\resource\apps\javainstaller_icon.mif"-"c:\resource\apps\javainstaller_icon.mif" -"\epoc32\data\z\resource\java\java_trusted.png"-"c:\resource\java\java_trusted.png" -"\epoc32\data\z\resource\java\java_untrusted.png"-"c:\resource\java\java_untrusted.png" -"\epoc32\data\z\resource\plugins\javasidchecker.rsc" -"c:\resource\plugins\javasidchecker.rsc" +"\epoc32\data\z\resource\java\java_3_trusted.png"-"c:\resource\java\java_3_trusted.png" +"\epoc32\data\z\resource\java\java_3_untrusted.png"-"c:\resource\java\java_3_untrusted.png" +"\epoc32\data\z\resource\java\javaapplicationinstaller.css"-"c:\resource\java\javaapplicationinstaller.css" "\epoc32\data\z\resource\plugins\javaunicertstoreplugin.rsc" -"c:\resource\plugins\javaunicertstoreplugin.rsc" "\epoc32\data\z\resource\plugins\midp2backupplugin.rsc"-"c:\resource\plugins\midp2backupplugin.rsc" #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK @@ -317,14 +318,16 @@ ;"\epoc32\release\armv5\urel\javacoreui.dll"-"c:\sys\bin\javacoreui.dll" ;"\epoc32\data\z\resource\apps\javastartscreen.mif"-"c:\resource\apps\javastartscreen.mif" -;"\epoc32\release\armv5\urel\javaamms.dll"-"c:\sys\bin\javaamms.dll" -;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javaamms.odc"-"c:\resource\java\jvm\lib\jrt\javaamms.odc" +"\epoc32\release\armv5\urel\javaamms.dll"-"c:\sys\bin\javaamms.dll" +"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javaamms.odc"-"c:\resource\java\jvm\lib\jrt\javaamms.odc" ;"\epoc32\release\armv5\urel\javalegacyutils.dll"-"c:\sys\bin\javalegacyutils.dll" ;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javalegacyutils.odc"-"c:\resource\java\jvm\lib\jrt\javalegacyutils.odc" -;"\epoc32\release\armv5\urel\javamobilemedia.dll"-"c:\sys\bin\javamobilemedia.dll" -;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javamobilemedia.odc"-"c:\resource\java\jvm\lib\jrt\javamobilemedia.odc" +"\epoc32\release\armv5\urel\javamobilemedia.dll"-"c:\sys\bin\javamobilemedia.dll" +"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javamobilemedia.odc"-"c:\resource\java\jvm\lib\jrt\javamobilemedia.odc" +"\epoc32\release\armv5\urel\z\system\sounds\digital\CamcorderJavaCapture.wav"-"c:\System\Sounds\Digital\CamcorderJavaCapture.wav" +"\epoc32\release\armv5\urel\z\system\sounds\digital\CamcorderJavaStart.wav"-"c:\System\Sounds\Digital\CamcorderJavaStart.wav" ;"\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" @@ -339,9 +342,11 @@ ;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javasoftnotification.odc"-"c:\resource\java\jvm\lib\jrt\javasoftnotification.odc" "\epoc32\release\armv5\urel\eswtqt.dll"-"c:\sys\bin\eswtqt.dll" +"\epoc32\release\armv5\urel\eswtqtwebkit.dll"-"c:\sys\bin\eswtqtwebkit.dll" "\epoc32\release\armv5\urel\openlcdui.dll"-"c:\sys\bin\openlcdui.dll" "\epoc32\release\armv5\urel\javanokiaui.dll"-"c:\sys\bin\javanokiaui.dll" "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\eswtqt.odc"-"c:\resource\java\jvm\lib\jrt\eswtqt.odc" +"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\eswtqtwebkit.odc"-"c:\resource\java\jvm\lib\jrt\eswtqtwebkit.odc" "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\openlcdui.odc"-"c:\resource\java\jvm\lib\jrt\openlcdui.odc" "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javanokiaui.odc"-"c:\resource\java\jvm\lib\jrt\javanokiaui.odc" diff -r 0105bdca6f9c -r 3182bd6adebb build/symbian_uids.pri --- a/build/symbian_uids.pri Wed Jun 30 15:21:28 2010 +0100 +++ b/build/symbian_uids.pri Tue Jul 13 16:05:52 2010 +0100 @@ -116,6 +116,7 @@ contains(TARGET, openlcdui): TARGET.UID3 = 0x2002DCE2 contains(TARGET, tckrunner): TARGET.UID3 = 0x2002DCE3 +contains(TARGET, javacaptain_ext_settingslistener): TARGET.UID3 = 0x200315D8 contains(TARGET, javacaptain_ext_scrupdater): TARGET.UID3 = 0x2002DD10 contains(TARGET, javacaptain_ext_ondemand_2): TARGET.UID3 = 0x2002DD01 contains(TARGET, javanokiaui): TARGET.UID3 = 0x2002E697 diff -r 0105bdca6f9c -r 3182bd6adebb inc/build_defines.hrh --- a/inc/build_defines.hrh Wed Jun 30 15:21:28 2010 +0100 +++ b/inc/build_defines.hrh Tue Jul 13 16:05:52 2010 +0100 @@ -15,7 +15,7 @@ * */ -#define RD_JAVA_VERSION 2,2,1 +#define RD_JAVA_VERSION 2,2,2 #define RD_JAVA_SYMBIAN_TARGET #define RD_JAVA_S60_RELEASE_10_1 #define RD_JAVA_S60_RELEASE_10_1_ONWARDS @@ -27,9 +27,6 @@ #define RD_JAVA_HTTP_EMC_ENABLED #define RD_JAVA_NGA_ENABLED #define SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK -#define RD_JAVA_USIF_APP_REG -#define RD_JAVA_USIF_NOTIFY_APP_ARC -#define RD_JAVA_USIF_NOTIFY_PROGRESS #define RD_JAVA_PROXIMITY_LISTENER_ENABLED #define RD_JAVA_OPENC_BETA_PATCH #define OPENLCDUI_ENABLED diff -r 0105bdca6f9c -r 3182bd6adebb inc/build_defines.pri --- a/inc/build_defines.pri Wed Jun 30 15:21:28 2010 +0100 +++ b/inc/build_defines.pri Tue Jul 13 16:05:52 2010 +0100 @@ -13,4 +13,4 @@ # # Description: Generated file - do not edit manually # -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_USIF_APP_REG RD_JAVA_USIF_NOTIFY_APP_ARC RD_JAVA_USIF_NOTIFY_PROGRESS 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 +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 diff -r 0105bdca6f9c -r 3182bd6adebb inc/java.txt --- a/inc/java.txt Wed Jun 30 15:21:28 2010 +0100 +++ b/inc/java.txt Tue Jul 13 16:05:52 2010 +0100 @@ -1,1 +1,1 @@ -2.2.1 +2.2.3 diff -r 0105bdca6f9c -r 3182bd6adebb inc/project_defines.hrh --- a/inc/project_defines.hrh Wed Jun 30 15:21:28 2010 +0100 +++ b/inc/project_defines.hrh Tue Jul 13 16:05:52 2010 +0100 @@ -26,9 +26,6 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK -MACRO RD_JAVA_USIF_APP_REG -MACRO RD_JAVA_USIF_NOTIFY_APP_ARC -MACRO RD_JAVA_USIF_NOTIFY_PROGRESS MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO OPENLCDUI_ENABLED diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/comms/tsrc/Makefile --- a/javacommons/comms/tsrc/Makefile Wed Jun 30 15:21:28 2010 +0100 +++ /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: -# - -include $(JAVA_SRC_ROOT)/build/Makefile.defs - -COMPONENTS = build -SUBSYSTEMS = javaapi - -include ${JAVA_SRC_ROOT}/build/Makefile.subsystem diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/comms/tsrc/javaapi/Makefile --- a/javacommons/comms/tsrc/javaapi/Makefile Wed Jun 30 15:21:28 2010 +0100 +++ /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: -# - -include $(JAVA_SRC_ROOT)/build/Makefile.defs - -COMPONENTS = \ - build - -include ${JAVA_SRC_ROOT}/build/Makefile.subsystem - -run: default_target diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/comms/tsrc/javaapi/build/build.xml --- a/javacommons/comms/tsrc/javaapi/build/build.xml Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/comms/tsrc/javaapi/build/build.xml Tue Jul 13 16:05:52 2010 +0100 @@ -27,7 +27,6 @@ - @@ -41,9 +40,9 @@ - - - + + + @@ -64,7 +63,7 @@ - + diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/comms/tsrc/javaapi/build/javacaptain_ext_ondemand_101.pro --- a/javacommons/comms/tsrc/javaapi/build/javacaptain_ext_ondemand_101.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/comms/tsrc/javaapi/build/javacaptain_ext_ondemand_101.pro Tue Jul 13 16:05:52 2010 +0100 @@ -25,5 +25,6 @@ symbian { SOURCES += ../src.s60/lookup.cpp + TARGET.UID3 = 0xE0000055 } include(../../../../../build/omj.pri) diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/comms/tsrc/javaapi/subsystem.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/comms/tsrc/javaapi/subsystem.mk Tue Jul 13 16:05:52 2010 +0100 @@ -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: +# + +include $(JAVA_SRC_ROOT)/build/Makefile.defs + +COMPONENTS = \ + build + +include ${JAVA_SRC_ROOT}/build/Makefile.subsystem + +run: default_target diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/comms/tsrc/subsystem.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/comms/tsrc/subsystem.mk Tue Jul 13 16:05:52 2010 +0100 @@ -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: +# + +include $(JAVA_SRC_ROOT)/build/Makefile.defs + +COMPONENTS = build +SUBSYSTEMS = javaapi + +include ${JAVA_SRC_ROOT}/build/Makefile.subsystem diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/connectionmanager/inc.s60/connectionmanager.h --- a/javacommons/connectionmanager/inc.s60/connectionmanager.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/connectionmanager/inc.s60/connectionmanager.h Tue Jul 13 16:05:52 2010 +0100 @@ -163,6 +163,7 @@ static HBufC8 * PromptUserSelectNetworkAccessPointL(); static HBufC8 * CreateDescriptorL(const int aType, const int id); + static bool checkIapDefaultL(TUint32 aMatchIapId, TUint32 aDestId, bool aDefault); diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/build/testapnsettings.mmp --- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/build/testapnsettings.mmp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/build/testapnsettings.mmp Tue Jul 13 16:05:52 2010 +0100 @@ -22,7 +22,9 @@ #include <../../../../../../inc/java_stdcpp_support_for_exe.hrh> #include -USERINCLUDE /epoc32/include/cpputest +USERINCLUDE /epoc32/include/cpputest // Due to TestHarness.h + +USERINCLUDE ../../inc.s60 USERINCLUDE ../../../../../../inc // Using main() as entry point diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/AllTests.h --- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/AllTests.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/AllTests.h Tue Jul 13 16:05:52 2010 +0100 @@ -15,7 +15,7 @@ * */ -#include "Utest.h" +#include "cpputest/Utest.h" //Include this in the test main to execute these tests IMPORT_TEST_GROUP(TestAPNSettings); diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/testapnsettings.cpp --- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/testapnsettings.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/testapnsettings.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -16,11 +16,9 @@ */ #include - -#include "TestHarness.h" +#include -#include "../../inc.s60/mapnsettings.h" - +#include "mapnsettings.h" #include "javastorage.h" #include "javastorageexception.h" #include "javastoragenames.h" diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/connectionmanager/src.s60/connectionmanager.cpp --- a/javacommons/connectionmanager/src.s60/connectionmanager.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/connectionmanager/src.s60/connectionmanager.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -65,7 +65,21 @@ EXPORT_C bool ConnectionManager::isIapDefault(TUint32 aMatchIapId, TUint32 aDestId, bool aDefault) { - LOG(ESOCKET,EInfo,"+ConnectionManager::getDefualtId"); + LOG(ESOCKET,EInfo,"+ConnectionManager::isIapDefault"); + bool retVal = false; + TRAPD(err,retVal = checkIapDefaultL(aMatchIapId,aDestId,aDefault)); + if(err!=KErrNone) + { + // error occured + return false; + } + return retVal; +} + +bool ConnectionManager::checkIapDefaultL(TUint32 aMatchIapId, TUint32 aDestId, bool aDefault) +{ + + LOG(ESOCKET,EInfo,"+ConnectionManager::checkIapDefaultL"); TUint32 id = aDestId; TUint32 tmpapId; TCmDefConnType type; @@ -104,8 +118,9 @@ return true; } } - return false; - + return false; + + } // --------------------------------------------------------------------------- diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/fileutils/src/fileutilities.cpp --- a/javacommons/fileutils/src/fileutilities.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/fileutils/src/fileutilities.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -18,6 +18,7 @@ #include #include +#include #include #include #include diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/fileutils/src/nativefileiohandler.cpp --- a/javacommons/fileutils/src/nativefileiohandler.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/fileutils/src/nativefileiohandler.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #include diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/fileutils/tsrc/fileutilstestinit/build/javafileutilstestinit.pro --- a/javacommons/fileutils/tsrc/fileutilstestinit/build/javafileutilstestinit.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/fileutils/tsrc/fileutilstestinit/build/javafileutilstestinit.pro Tue Jul 13 16:05:52 2010 +0100 @@ -21,7 +21,6 @@ symbian { TARGET.CAPABILITY = all -tcb - INCLUDEPATH += /epoc32/include/caf LIBS += -lcaf -lcafutils -lefsrv -lDrmParsers -lDRMServerInterfaces } diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfbase/javasrc/com/nokia/mj/impl/gcf/PushRegistryPermissionImpl.java --- a/javacommons/gcfbase/javasrc/com/nokia/mj/impl/gcf/PushRegistryPermissionImpl.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfbase/javasrc/com/nokia/mj/impl/gcf/PushRegistryPermissionImpl.java Tue Jul 13 16:05:52 2010 +0100 @@ -115,7 +115,7 @@ */ public String toString() { - return "javax.microedition.io.PushRegistryPermission"; + return "javax.microedition.io.PushRegistry"; } /** diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/file/javasrc/com/nokia/mj/impl/file/FileInternalPermission.java --- a/javacommons/gcfprotocols/file/javasrc/com/nokia/mj/impl/file/FileInternalPermission.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/file/javasrc/com/nokia/mj/impl/file/FileInternalPermission.java Tue Jul 13 16:05:52 2010 +0100 @@ -95,7 +95,17 @@ public String toString() { - return "javax.microedition.io.FileProtocolPermission"; + if (intent.equals("read")) + { + return "javax.microedition.io.Connector.file.read"; + } + + if (intent.equals("write")) + { + return "javax.microedition.io.Connector.file.write"; + } + + return null; } /** diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/file/tsrc/mt/filetestinit/build/javafiletestinit.pro --- a/javacommons/gcfprotocols/file/tsrc/mt/filetestinit/build/javafiletestinit.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/file/tsrc/mt/filetestinit/build/javafiletestinit.pro Tue Jul 13 16:05:52 2010 +0100 @@ -21,7 +21,6 @@ symbian { TARGET.CAPABILITY = all -tcb - INCLUDEPATH += /epoc32/include/caf LIBS += -lcaf -lcafutils -lefsrv -lDrmParsers -lDRMServerInterfaces } diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/http/build/javahttp.pro --- a/javacommons/gcfprotocols/http/build/javahttp.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/http/build/javahttp.pro Tue Jul 13 16:05:52 2010 +0100 @@ -13,16 +13,31 @@ # # Description: # +include(../../../../inc/build_defines.pri) TARGET=javahttp TEMPLATE=lib CONFIG += omj java stl -CONFIG -= qt symbian { - LIBS += -leuser -lhttp -lecom -lbafl -linetprotutil -lhttpfiltercommon -lx509 -lx500 -lcrypto -lesock -lcommdb -lcentralrepository -lwebutils + + LIBS += -leuser -lhttp -lecom -lbafl -linetprotutil -lhttpfiltercommon -lx509 -lx500 -lcrypto -lesock -lcommdb -lcentralrepository + + contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) { + QT += webkit + QT -= gui + LIBS += -lQtWebKit -lplatformEnv -ljavaenvinfo + } + else { + LIBS += -lwebutils + } + + contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_5_0) { + LIBS += -lcommdb + } + contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_9_2_ONWARDS) { + LIBS += -lextendedconnpref -lnetmeta + } } - - include(../../../../build/omj.pri) diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/http/inc.s60/javauseragent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/gcfprotocols/http/inc.s60/javauseragent.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,31 @@ +/* +* 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: +* +*/ + +#ifndef GETUSERAGENT_H +#define GETUSERAGENT_H + +#include + +class JavaUserAgent +{ + +public: + static HBufC* GetUserAgentL(); + +}; + +#endif /* GETUSERAGENT_H */ diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/gcf/protocol/http/HttpPermissionImpl.java --- a/javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/gcf/protocol/http/HttpPermissionImpl.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/gcf/protocol/http/HttpPermissionImpl.java Tue Jul 13 16:05:52 2010 +0100 @@ -45,7 +45,7 @@ public String toString() { - return "javax.microedition.io.HttpProtocolPermission"; + return "javax.microedition.io.Connector.http"; } public boolean implies(Permission p) diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/http/HttpConnectionNative.java --- a/javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/http/HttpConnectionNative.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/http/HttpConnectionNative.java Tue Jul 13 16:05:52 2010 +0100 @@ -194,7 +194,7 @@ iTransactionBlock = new BlockingOperation(); iNativeDataReadyForRead = new BlockingOperation(); iNativeDataReadyForRead.setResult(BlockingOperation.BLOCKED); - iFinalizer = registerForFinalization(); + iFinalizer = registerForFinalization(); Logger.LOG(Logger.ESOCKET, Logger.EInfo, "- HttpConnectionNative new "); ApplicationInfo appInfo = ApplicationInfo.getInstance(); @@ -253,9 +253,9 @@ { close(); } - catch(Exception e) + catch (Exception e) { - + } Logger.LOG(Logger.ESOCKET, Logger.EInfo, "--HttpConnectionNative::doFinalize "); diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/http/src.s60/chttpsessionclient.cpp --- a/javacommons/gcfprotocols/http/src.s60/chttpsessionclient.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/chttpsessionclient.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -22,7 +22,13 @@ #include #include #include "logger.h" + +#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS +#include // extended connection preference +#include +#else #include +#endif #include #include @@ -146,10 +152,19 @@ *apnerr = ret; return; } - +#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS + TConnPrefList prefList; + TExtendedConnPref prefs; + prefs.SetSnapId(aAPNId); + prefList.AppendL(&prefs); + ret = iConnection.Start(prefList); +#else TCommSnapPref connPref; connPref.SetSnap(aAPNId); ret = iConnection.Start(connPref); +#endif + + LOG(ESOCKET,EInfo,"+HttpSessionClient:: using extended connection prefernce in snap case"); LOG1(ESOCKET,EInfo,"iConnection.Start returned %d",ret); if (ret < 0) { @@ -172,6 +187,7 @@ { if (aType == 3) // IAP Id { + LOG(ESOCKET,EInfo,"+HttpSessionClient:: in iap case"); if (aAPNId != -1) { // Creates connection with selected IAP ID @@ -189,18 +205,35 @@ *apnerr = ret; return; } + +#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS + // Create connection preferences + TConnPrefList prefList; + TExtendedConnPref prefs; + prefs.SetIapId(aAPNId); + prefList.AppendL(&prefs); + ret = iConnection.Start(prefList); + LOG(ESOCKET,EInfo,"+HttpSessionClient:: using extended connection prefernce in iap case"); +#else TCommDbConnPref pref; pref.SetIapId(aAPNId); pref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt); ret = iConnection.Start(pref); +#endif + if (ret < 0) { *apnerr = ret; //return; } RHTTPConnectionInfo connInfo = iHttpSession.ConnectionInfo(); + //connInfo.SetPropertyL(iHttpSession.StringPool().StringF( + // HttpFilterCommonStringsExt::EAccessPointID, HttpFilterCommonStringsExt::GetTable()), aAPNId); connInfo.SetPropertyL(iHttpSession.StringPool().StringF( - HttpFilterCommonStringsExt::EAccessPointID, HttpFilterCommonStringsExt::GetTable()), aAPNId); + HTTP::EHttpSocketServ, RHTTPSession::GetTable()), THTTPHdrVal(iSocketServ.Handle())); + TInt connPtr = REINTERPRET_CAST(TInt, &iConnection); + connInfo.SetPropertyL(iHttpSession.StringPool().StringF( + HTTP::EHttpSocketConnection, RHTTPSession::GetTable()), THTTPHdrVal(connPtr)); } // end of if ( aAPNId != -1) } // end of if(aType == 4) else @@ -210,7 +243,7 @@ } // end of else - LOG1(ESOCKET,EInfo,"apnerr = ",*apnerr); + LOG1(ESOCKET,EInfo,"apnerr = %d",*apnerr); // This is special case when that IAP/SNAP is not found // Override the http stack's feaute of using device default @@ -219,9 +252,19 @@ LOG(ESOCKET,EInfo,"ECommDbDialogPrefPrompt set for the http session"); int ret = iSocketServ.Connect(); ret = iConnection.Open(iSocketServ); +#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS + TConnPrefList prefList; + TExtendedConnPref prefs; + prefs.SetConnSelectionDialog(ETrue); + prefList.AppendL(&prefs); + ret = iConnection.Start(prefList); + LOG(ESOCKET,EInfo,"+HttpSessionClient:: using extended connection prefernce - error case "); +#else TCommDbConnPref pref; pref.SetDialogPreference(ECommDbDialogPrefPrompt); ret = iConnection.Start(pref); + LOG(ESOCKET,EInfo,"+HttpSessionClient:: using commdb con pref - error case "); +#endif RHTTPConnectionInfo connInfo = iHttpSession.ConnectionInfo(); connInfo.SetPropertyL(iHttpSession.StringPool().StringF( @@ -296,10 +339,25 @@ iConnection.Close(); TInt ret = iConnection.Open(iSocketServ); + //TCommSnapPref connPref; +#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS + TConnPrefList prefList; + TExtendedConnPref prefs; + + if (iApnId!=-1) + prefs.SetSnapId(iApnId); + TRAPD(err,prefList.AppendL(&prefs)); + if (err == KErrNone) + ret = iConnection.Start(prefList); + else + ret = iConnection.Start(); +#else TCommSnapPref connPref; if (iApnId!=-1) connPref.SetSnap(iApnId); ret = iConnection.Start(connPref); + +#endif LOG(ESOCKET,EInfo,"+HttpSessionClient::RestartConnection + "); } diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/http/src.s60/chttptransactionclient.cpp --- a/javacommons/gcfprotocols/http/src.s60/chttptransactionclient.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/chttptransactionclient.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -626,14 +626,14 @@ iStatus = CHttpTransactionClient::ERequestNextBodayData; break; } - + case THTTPEvent::EReceiveTimeOut: { - ELOG(ESOCKET,"MHFRunL EReceiveTimeOut"); - NotifyErrorL(KErrTimedOut); // send timeout error to java - break; - - } + ELOG(ESOCKET,"MHFRunL EReceiveTimeOut"); + NotifyErrorL(KErrTimedOut); // send timeout error to java + break; + + } /* * -j2me expects the http stack to be able to post body data with no content type * the native stack default validation filter does not allow this. diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/http/src.s60/javauseragent.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/gcfprotocols/http/src.s60/javauseragent.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,74 @@ +/* +* 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: +* +*/ + +#include "javauseragent.h" +#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS +#include +#include "javaenvinfo.h" +#else +#include +#endif + +#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS +class Page: public QWebPage +{ +public: + QString userAgentForUrl ( const QUrl & url ) const; + +}; + +QString Page::userAgentForUrl ( const QUrl & url ) const +{ + return url.toString(); +} +#endif + +HBufC* JavaUserAgent::GetUserAgentL() +{ +#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS + /*QApplication app(); + QUrl uri; + Page page; + QString webUserAgent = page.userAgentForUrl(uri); + HBufC* agent = HBufC::NewMaxLC(webUserAgent.length()); + agent->Des().Copy(webUserAgent.utf16()); + agent->Des().Append(*(Java::JavaEnvInfo::GetUserAgentHeaderL())); + return agent; + */ + _LIT(KString,"null"); + HBufC* agent = HBufC::NewLC(5); + *agent = KString; + CleanupStack::Pop(agent); + return agent; + +#else + + CUserAgent* userAgent = CUserAgent::NewL(); + CleanupStack::PushL(userAgent); + + HBufC8* agent8 = userAgent->UserAgentL(); + CleanupStack::PushL(agent8); + + HBufC* agent = HBufC::NewMaxLC(agent8->Length()); + agent->Des().Copy(*agent8); + + CleanupStack::Pop(agent); + CleanupStack::PopAndDestroy(agent8); + CleanupStack::PopAndDestroy(userAgent); + return agent; +#endif +} diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/http/src.s60/nativehttpsession.cpp --- a/javacommons/gcfprotocols/http/src.s60/nativehttpsession.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/nativehttpsession.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -49,10 +49,10 @@ TInt NativeHttpSession::NewL(JNIEnv& aJni, jobject aPeer,/* TJavaEventServer aServer,*/ TInt aType, TInt aAPNId, TInt * aErr, TInt * apnerr) { NativeHttpSession* self = new(ELeave) NativeHttpSession(); - + *aErr = self->ConstructL(aJni, aPeer /* aServer*/, aType, aAPNId, apnerr); LOG1(ESOCKET,EInfo,"NativeHttpSession::NewL - aErr : %d",*aErr); - + self->attachToVm(aJni,aPeer); // Pop the cleanup of the object and create a handle: return reinterpret_cast(self); //selfCleanup.GetHandle(); @@ -119,17 +119,17 @@ void NativeHttpSession::doSubmitCallback(TInt aStatus,jobject &aPeer) { - LOG(ESOCKET,EInfo,"+doSubmitCallback1"); + LOG(ESOCKET,EInfo,"+doSubmitCallback1"); jobject localPeerObject = mJniEnv->NewLocalRef(aPeer); - if(localPeerObject) + if (localPeerObject) { - // java side peer object may be GC'ed when this call is being made. - mJniEnv->CallVoidMethod(aPeer,iSubmitCallbackMethodID,aStatus); + // java side peer object may be GC'ed when this call is being made. + mJniEnv->CallVoidMethod(aPeer,iSubmitCallbackMethodID,aStatus); } else { - ELOG(ESOCKET,"NativeHttpSession::doSubmitCallback: Error!! java peer object not found "); - } + ELOG(ESOCKET,"NativeHttpSession::doSubmitCallback: Error!! java peer object not found "); + } LOG(ESOCKET,EInfo,"-doSubmitCallback1"); } @@ -137,14 +137,14 @@ { LOG(ESOCKET,EInfo,"+doReadCallback1"); jobject localPeerObject = mJniEnv->NewLocalRef(aPeer); - if(localPeerObject) + if (localPeerObject) { - mJniEnv->CallVoidMethod(aPeer,iReadCallbackMethodID,aStatus); + mJniEnv->CallVoidMethod(aPeer,iReadCallbackMethodID,aStatus); } else { - ELOG(ESOCKET,"NativeHttpSession::doReadCallback: Error!! java peer object not found "); - } + ELOG(ESOCKET,"NativeHttpSession::doReadCallback: Error!! java peer object not found "); + } LOG(ESOCKET,EInfo,"-doReadCallback1"); } diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp --- a/javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -57,7 +57,7 @@ NativeHttpTransaction::NativeHttpTransaction(HttpSessionClient& aSession, FunctionServer* aFuncServer) :iSessionClient(aSession) //, java::util::FunctionServer("MyhttpServer2") { - + iFuncServer = aFuncServer; } @@ -72,7 +72,7 @@ { NativeHttpTransaction* self = new(ELeave) NativeHttpTransaction(aSession,aFuncServer); - + self->ConstructL(aJni, aPeer, /*aServer, */ aUri, aRequestMethod); @@ -93,9 +93,9 @@ int urihandle = reinterpret_cast(aUri); int methodhandle = reinterpret_cast(aRequestMethod); //open the transaction - + CallMethodL(this, &NativeHttpTransaction::ExecuteCreateTransactionL,handle,urihandle , methodhandle, iFuncServer); - + } void NativeHttpTransaction::ExecuteCreateTransactionL(int aSelfhandle, int aUrihandle, int aMethodhandle) @@ -115,7 +115,7 @@ RPointerArray rawHeaderArray; CleanupStack::PushL(TCleanupItem(CleanUpResetAndDestroy,&rawHeaderArray)); iJniObject = aJni; - + if (aHeaders!=NULL) { @@ -173,7 +173,7 @@ void NativeHttpTransaction::ExecuteSubmitL(int aSelfhandle , int aRawHeadershandle , int aPostBufhandle, int aResponseTimeout) { - + NativeHttpTransaction *aSelf = reinterpret_cast(aSelfhandle); RPointerArray* aRawHeaders = reinterpret_cast*>(aRawHeadershandle); HBufC8* aPostBuf = reinterpret_cast(aPostBufhandle); @@ -186,12 +186,12 @@ jobjectArray objArray=NULL; RPointerArray rawHeaders(KResponseGranularity); CleanupStack::PushL(TCleanupItem(CleanUpResetAndDestroy,&rawHeaders)); - + int handle = reinterpret_cast(this); int arrayhandle = reinterpret_cast(&rawHeaders); CallMethodL(this, &NativeHttpTransaction::ExecuteGetResponseL,handle,arrayhandle , iFuncServer); - + const TInt headerCount = rawHeaders.Count(); if (headerCount>KErrNone) { @@ -232,7 +232,7 @@ */ TInt NativeHttpTransaction::ReadBytes(TUint8* aBytes, TInt aLength) { - + int handle = reinterpret_cast(this); int uinthandle = reinterpret_cast(aBytes); @@ -240,7 +240,7 @@ CallMethod(ret,this, &NativeHttpTransaction::ExecuteReadBytes,handle,uinthandle,aLength,iFuncServer); return ret; - + } TInt NativeHttpTransaction::ExecuteReadBytes(int aSelfhandle, int aByteshandle, TInt aLength) diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp --- a/javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -19,18 +19,13 @@ #include #include -#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS -#include -#else -#include -#endif - #include "com_nokia_mj_impl_http_HttpConnectionNative.h" #include "nativehttptransaction.h" #include "nativehttpsession.h" #include "monitor.h" #include "logger.h" #include "s60commonutils.h" +#include "javauseragent.h" using namespace java::util; @@ -69,15 +64,15 @@ NativeHttpTransaction* tran = reinterpret_cast(aNativeHttpTransaction); tran->iJniPeer = aJni->NewWeakGlobalRef(aPeer); try - { + { tran->Dispose(); - } - catch(...) - { - // function server usage may throw an exception. - // ignore, called when transcation is closed - ELOG(ESOCKET,"Http JNI Error, exception caught!: _closeTransaction"); - } + } + catch (...) + { + // function server usage may throw an exception. + // ignore, called when transcation is closed + ELOG(ESOCKET,"Http JNI Error, exception caught!: _closeTransaction"); + } delete tran; } @@ -88,7 +83,7 @@ jstring aUri, jstring aRequestMethod) { - LOG(ESOCKET,EInfo,"http jni _createNativeTransaction()"); + LOG(ESOCKET,EInfo,"http jni _createNativeTransaction()"); NativeHttpSession* session = reinterpret_cast(aNativeHttpSession); //tran->iJniPeer = aJni->NewGlobalRef(aPeer); try @@ -96,13 +91,13 @@ TRAPD(handle, handle = session->CreateTransactionL(aJni, aPeer , aUri, aRequestMethod);); return handle; } - catch(...) + catch (...) { - // function server usage may throw an exception. - ELOG(ESOCKET,"Http JNI Error, exception caught!: _createTransaction"); - return -1; + // function server usage may throw an exception. + ELOG(ESOCKET,"Http JNI Error, exception caught!: _createTransaction"); + return -1; } - + } JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_http_HttpConnectionNative__1submitTransaction( @@ -114,7 +109,7 @@ jint aPostDataLength, jint aResponseTimeout) { - LOG(ESOCKET,EInfo,"http jni _submitTransaction"); + LOG(ESOCKET,EInfo,"http jni _submitTransaction"); NativeHttpTransaction* tran = reinterpret_cast(aNativeHttpTransaction); int respTimeOut = aResponseTimeout; tran->iJniPeer = aJni->NewWeakGlobalRef(aPeer); @@ -123,11 +118,11 @@ TRAPD(err,tran->SubmitL(aJni, &aPeer,aHeaders, aPostData, aPostDataLength, respTimeOut)); return err; } - catch(...) + catch (...) { - ELOG(ESOCKET,"Http JNI Error, exception caught!: _submitTransaction"); - return -1; - } + ELOG(ESOCKET,"Http JNI Error, exception caught!: _submitTransaction"); + return -1; + } } JNIEXPORT jobjectArray JNICALL Java_com_nokia_mj_impl_http_HttpConnectionNative__1getResponse( @@ -135,24 +130,24 @@ jobject aPeer, jint aNativeHttpTransaction) { - LOG(ESOCKET,EInfo,"http jni _getResponse"); + LOG(ESOCKET,EInfo,"http jni _getResponse"); jobjectArray rawHeaders=NULL; NativeHttpTransaction* tran = reinterpret_cast(aNativeHttpTransaction); tran->iJniPeer = aJni->NewWeakGlobalRef(aPeer); try { - TRAPD(err, rawHeaders = tran->GetResponseL(aJni)); - if (err!=KErrNone) - { - rawHeaders=NULL; - } - } - catch(...) - { - rawHeaders=NULL; - ELOG(ESOCKET,"Http JNI Error, exception caught!: _getResponse"); - - } + TRAPD(err, rawHeaders = tran->GetResponseL(aJni)); + if (err!=KErrNone) + { + rawHeaders=NULL; + } + } + catch (...) + { + rawHeaders=NULL; + ELOG(ESOCKET,"Http JNI Error, exception caught!: _getResponse"); + + } return rawHeaders; } @@ -164,27 +159,27 @@ jbyteArray aBytes, jint aLength) { - LOG(ESOCKET,EInfo,"http jni _getBytes"); + LOG(ESOCKET,EInfo,"http jni _getBytes"); jbyte* bytes = aEnv->GetByteArrayElements(aBytes, NULL); if (bytes == NULL) { return -1; } - try - { - NativeHttpTransaction* tran = reinterpret_cast(aNativeHttpTransaction); - tran->iJniPeer = aEnv->NewWeakGlobalRef(aPeer); - TInt length = tran->ReadBytes(reinterpret_cast(bytes), aLength); - - aEnv->ReleaseByteArrayElements(aBytes, bytes, NULL); - return length; - } - catch(...) - { - ELOG(ESOCKET,"Http JNI Error, exception caught!: _getBytes"); - return -1; - } + try + { + NativeHttpTransaction* tran = reinterpret_cast(aNativeHttpTransaction); + tran->iJniPeer = aEnv->NewWeakGlobalRef(aPeer); + TInt length = tran->ReadBytes(reinterpret_cast(bytes), aLength); + + aEnv->ReleaseByteArrayElements(aBytes, bytes, NULL); + return length; + } + catch (...) + { + ELOG(ESOCKET,"Http JNI Error, exception caught!: _getBytes"); + return -1; + } } JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_http_HttpConnectionNative__1available( @@ -196,12 +191,12 @@ tran->iJniPeer = aJni->NewWeakGlobalRef(aPeer); try { - return tran->Available(); + return tran->Available(); } - catch(...) + catch (...) { - ELOG(ESOCKET,"Http JNI Error, exception caught!: _available"); - return -1; + ELOG(ESOCKET,"Http JNI Error, exception caught!: _available"); + return -1; } } @@ -220,24 +215,14 @@ jstring GetUserAgentL(JNIEnv *aJni, jboolean aMidpRuntime) { - + LOG(ESOCKET,EInfo,"GetUserAgentL() +"); jstring header = NULL; if (aMidpRuntime == false) { - CUserAgent* userAgent = CUserAgent::NewL(); - CleanupStack::PushL(userAgent); - - HBufC8* agent8 = userAgent->UserAgentL(); - CleanupStack::PushL(agent8); - HBufC* agent = HBufC::NewMaxLC(agent8->Length()); - agent->Des().Copy(*agent8); - header = S60CommonUtils::NativeToJavaString(*aJni, agent->Des()); - - CleanupStack::PopAndDestroy(agent); - CleanupStack::PopAndDestroy(agent8); - CleanupStack::PopAndDestroy(userAgent); - + HBufC* stringBufPtr = JavaUserAgent::GetUserAgentL(); + header = S60CommonUtils::NativeToJavaString(*aJni,stringBufPtr->Des()); + delete stringBufPtr; return header; } @@ -257,18 +242,9 @@ { case KHTTPUserAgentBrowserHeader: { - CUserAgent* userAgent = CUserAgent::NewL(); - CleanupStack::PushL(userAgent); - - HBufC8* agent8 = userAgent->UserAgentL(); - CleanupStack::PushL(agent8); - HBufC* agent = HBufC::NewMaxLC(agent8->Length()); - agent->Des().Copy(*agent8); - header = S60CommonUtils::NativeToJavaString(*aJni, agent->Des()); - - CleanupStack::PopAndDestroy(agent); - CleanupStack::PopAndDestroy(agent8); - CleanupStack::PopAndDestroy(userAgent); + HBufC* stringBufPtr = (JavaUserAgent::GetUserAgentL()); + header = S60CommonUtils::NativeToJavaString(*aJni, stringBufPtr->Des()); + delete stringBufPtr; } break; @@ -291,6 +267,6 @@ CleanupStack::PopAndDestroy(repository); } - + LOG(ESOCKET,EInfo,"GetUserAgentL() -"); return header; } diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/https/javasrc.s60/com/nokia/mj/impl/gcf/protocol/https/HttpsPermissionImpl.java --- a/javacommons/gcfprotocols/https/javasrc.s60/com/nokia/mj/impl/gcf/protocol/https/HttpsPermissionImpl.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/https/javasrc.s60/com/nokia/mj/impl/gcf/protocol/https/HttpsPermissionImpl.java Tue Jul 13 16:05:52 2010 +0100 @@ -51,7 +51,7 @@ public String toString() { - return "javax.microedition.io.HttpsProtocolPermission"; + return "javax.microedition.io.Connector.https"; } public boolean implies(Permission p) diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/gcf/protocol/ssl/SSLPermissionImpl.java --- a/javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/gcf/protocol/ssl/SSLPermissionImpl.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/gcf/protocol/ssl/SSLPermissionImpl.java Tue Jul 13 16:05:52 2010 +0100 @@ -55,7 +55,7 @@ public String toString() { - return "javax.microedition.io.SSLProtocolPermission"; + return "javax.microedition.io.Connector.ssl"; } public boolean implies(Permission p) diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/ssl/SecureConnectionImpl.java --- a/javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/ssl/SecureConnectionImpl.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/ssl/SecureConnectionImpl.java Tue Jul 13 16:05:52 2010 +0100 @@ -35,6 +35,7 @@ import com.nokia.mj.impl.rt.ui.ConfirmData; import com.nokia.mj.impl.connectionmanager.ConnectionManager; import com.nokia.mj.impl.connectionmanager.AccessPoint; +import com.nokia.mj.impl.utils.Id; import com.nokia.mj.impl.utils.ResourceLoader; /** @@ -74,7 +75,7 @@ private static final String LOCALISED_STRING_ID = "qtn_ssl_prompt_"; - private static final String UNTRUSTED_CERTIFICATE_WARNING = "untrusted_certificate"; + private static final Id UNTRUSTED_CERTIFICATE_WARNING = new Id("untrusted_certificate", "N/A"); /** * Constructs the SecureConnectionImpl. diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/socket/socket/build/bwins/javasocketu.def --- a/javacommons/gcfprotocols/socket/socket/build/bwins/javasocketu.def Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/build/bwins/javasocketu.def Tue Jul 13 16:05:52 2010 +0100 @@ -1,5 +1,5 @@ EXPORTS - ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) + ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) ?readBytes@NativeSocketConnection@java@@UAEHAAUJNIEnv_@@PAV_jbyteArray@@@Z @ 2 NONAME ; int java::NativeSocketConnection::readBytes(struct JNIEnv_ &, class _jbyteArray *) ?setSocketOption@NativeSocketConnection@java@@QAEHHH@Z @ 3 NONAME ; int java::NativeSocketConnection::setSocketOption(int, int) ?socketClose@NativeSocketConnection@java@@QAEHXZ @ 4 NONAME ; int java::NativeSocketConnection::socketClose(void) @@ -16,5 +16,5 @@ ?getLocalPort@NativeSocketConnection@java@@QAEHXZ @ 15 NONAME ; int java::NativeSocketConnection::getLocalPort(void) ?getPort@NativeSocketConnection@java@@QAEHXZ @ 16 NONAME ; int java::NativeSocketConnection::getPort(void) ?getSocketOption@NativeSocketConnection@java@@QAEHH@Z @ 17 NONAME ; int java::NativeSocketConnection::getSocketOption(int) - + ?getLocalAddress@SocketLocalHostInfo@@SAHHPADHH@Z @ 18 NONAME ; int SocketLocalHostInfo::getLocalAddress(int, char *, int, int) diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/socket/socket/build/eabi/javasocketu.def --- a/javacommons/gcfprotocols/socket/socket/build/eabi/javasocketu.def Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/build/eabi/javasocketu.def Tue Jul 13 16:05:52 2010 +0100 @@ -20,4 +20,5 @@ _ZN4java22NativeSocketConnectionD2Ev @ 19 NONAME _ZTIN4java22NativeSocketConnectionE @ 20 NONAME ; ## _ZTVN4java22NativeSocketConnectionE @ 21 NONAME ; ## + _ZN19SocketLocalHostInfo15getLocalAddressEiPcii @ 22 NONAME diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/socket/socket/build/exports.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/gcfprotocols/socket/socket/build/exports.inf Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,21 @@ +/* +* 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: +* +*/ + +PRJ_EXPORTS + +../inc/socketlocalhostinfo.h |../../../../../inc/socketlocalhostinfo.h + diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/socket/socket/inc/socketlocalhostinfo.h --- a/javacommons/gcfprotocols/socket/socket/inc/socketlocalhostinfo.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/inc/socketlocalhostinfo.h Tue Jul 13 16:05:52 2010 +0100 @@ -19,12 +19,14 @@ #ifndef SOCKETLOCALHOSTINFO_H #define SOCKETLOCALHOSTINFO_H +#include "javaosheaders.h" + class SocketLocalHostInfo { public: - static int getLocalAddress(int aSd, char *aLocalAddr, int aMidletIapId, int aApType); + OS_IMPORT static int getLocalAddress(int aSd, char *aLocalAddr, int aMidletIapId, int aApType); }; diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/gcf/protocol/socket/SocketPermissionImpl.java --- a/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/gcf/protocol/socket/SocketPermissionImpl.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/gcf/protocol/socket/SocketPermissionImpl.java Tue Jul 13 16:05:52 2010 +0100 @@ -55,7 +55,7 @@ public String toString() { - return "javax.microedition.io.SocketProtocolPermission"; + return "javax.microedition.io.Connector.socket"; } public boolean implies(Permission p) diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/socket/ServerSocketConnectionImpl.java --- a/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/socket/ServerSocketConnectionImpl.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/socket/ServerSocketConnectionImpl.java Tue Jul 13 16:05:52 2010 +0100 @@ -141,8 +141,7 @@ apId = -1; } Logger.LOG(Logger.ESOCKET, Logger.EInfo, - "+SocketServerConnectionImpl:: getApplicationDefault returned, \n"+apn.getNapId()+" type = "+apn.getType()); - System.out.println(" type = "+apn.getType()+" id = "+apId); + "+SocketServerConnectionImpl:: getApplicationDefault returned, \n"+apn.getNapId()+" type = "+apn.getType()); } } catch (Exception e) diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/gcfprotocols/socket/socket/src.s60/socketlocalhostinfo.cpp --- a/javacommons/gcfprotocols/socket/socket/src.s60/socketlocalhostinfo.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/src.s60/socketlocalhostinfo.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -24,7 +24,7 @@ int GetlocalIPAdressL(char *localaddr, int aMidletIapId, int aApType); -int SocketLocalHostInfo::getLocalAddress(int /* aSd */, char *aLocalAddr, +OS_EXPORT int SocketLocalHostInfo::getLocalAddress(int /* aSd */, char *aLocalAddr, int aMidletIapId, int aApType) { TRAPD(err,GetlocalIPAdressL(aLocalAddr,aMidletIapId, aApType);); @@ -32,6 +32,77 @@ } +int getIPAddressL(const int aIapId, char *ipAddress) +{ + RSocketServ socketServ; + RSocket sock; + User::LeaveIfError(socketServ.Connect()); + User::LeaveIfError(sock.Open(socketServ, KAfInet, KSockStream, + KProtocolInetTcp)); + + // find the ip address of the active interface + TSoInetInterfaceInfo ifInfo; + TPckg ifInfoPkg(ifInfo); + TSoInetIfQuery ifQuery; + TPckg ifQueryPkg(ifQuery); + + // To find out which interfaces are using our current IAP, we must + // enumerate and go through all of them and make a query by name for each. + ILOG(ESOCKET, "Looping thru all the destinations and ap \n\n"); + User::LeaveIfError(sock.SetOpt(KSoInetEnumInterfaces, + KSolInetIfCtrl)); + + while (sock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, ifInfoPkg) + == KErrNone) + { + ifQuery.iName = ifInfo.iName; + TInt err = sock.GetOpt(KSoInetIfQueryByName, KSolInetIfQuery, + ifQueryPkg); + if ((err == KErrNone) && (ifQuery.iZone[1] == aIapId)) + { + ILOG2(ESOCKET, "Network id = %d, IAP id = %d ",(TUint32)(ifQuery.iZone[15]),(TUint32)ifQuery.iZone[1]); + + // IAP ID is index 1 of iZone + // We have found an interface using the IAP we are interested in. + if (ifInfo.iAddress.Address() > 0) + { + if (!ifInfo.iAddress.IsUnspecified() + && !ifInfo.iAddress.IsLoopback() + && !ifInfo.iAddress.IsLinkLocal()) + { + // found a IPv4 address + TBuf8<20> aIP8; + TBuf<20> aIP; + TInetAddr aAddr; + aAddr = ifInfo.iAddress; + aAddr.ConvertToV4(); + aAddr.Output(aIP); + aIP8.Copy(aIP); + + strncpy(ipAddress, (char*) aIP8.Ptr(), + aIP8.Length()); + ipAddress[aIP8.Length()] = '\0'; + ILOG1(ESOCKET, "GetlocalIPAdressLLL , ip = %s", + ipAddress); + sock.Close(); + socketServ.Close(); + ILOG(ESOCKET, "returning from getIpAddr"); + return KErrNone; + } + } // end if addr > 0 + else if (err != KErrNone) + { + sock.Close(); + return err; // return with error + } + } + } // end while + sock.Close(); + socketServ.Close(); + return KErrNone; + +} + /** *In Symbian, when a server connection is opened, it is not bound to any interface *so the openC calls returns "0.0.0.0" as the local address. @@ -43,7 +114,7 @@ int GetlocalIPAdressL(char *localaddr, int aMidletIapId, int aType) { JELOG2(ESOCKET); - + int err = KErrNone; TUint32 activeIapId = 0; TConnectionInfoBuf connectionInfo; TUint count = 0; @@ -103,66 +174,19 @@ continue; // go to the next active IAP } - // find the ip address of the active interface - - TSoInetInterfaceInfo ifInfo; - TPckg ifInfoPkg(ifInfo); - TSoInetIfQuery ifQuery; - TPckg ifQueryPkg(ifQuery); - // To find out which interfaces are using our current IAP, we must - // enumerate and go through all of them and make a query by name for each. - ILOG(ESOCKET, "Looping thru all the destinations and ap \n\n"); - User::LeaveIfError(sock.SetOpt(KSoInetEnumInterfaces, - KSolInetIfCtrl)); - while (sock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, ifInfoPkg) - == KErrNone) - { - ifQuery.iName = ifInfo.iName; - TInt err = sock.GetOpt(KSoInetIfQueryByName, KSolInetIfQuery, - ifQueryPkg); + // find the ip address of the active IAP + err = getIPAddressL(activeIapId,localaddr); + break; // once we find the IP addr, return - if ((err == KErrNone) && (ifQuery.iZone[1] == activeIapId)) - { - //TUint32 t5 = (TUint32)(ifQuery.iZone[15]); - ILOG2(ESOCKET, "Network id = %d, IAP id = %d ",(TUint32)(ifQuery.iZone[15]),(TUint32)ifQuery.iZone[1]); - - // IAP ID is index 1 of iZone - // We have found an interface using the IAP we are interested in. - if (ifInfo.iAddress.Address() > 0) - if (!ifInfo.iAddress.IsUnspecified() - && !ifInfo.iAddress.IsLoopback() - && !ifInfo.iAddress.IsLinkLocal()) - { - // found a IPv4 address - TBuf8<20> aIP8; - TBuf<20> aIP; - TInetAddr aAddr; - aAddr = ifInfo.iAddress; - aAddr.ConvertToV4(); - aAddr.Output(aIP); - aIP8.Copy(aIP); - - strncpy(localaddr, (char*) aIP8.Ptr(), - aIP8.Length()); - localaddr[aIP8.Length()] = '\0'; - ILOG1(ESOCKET, "GetlocalIPAdressL , ip = %s", - localaddr); - sock.Close(); - return KErrNone; - } - } - else if (err != KErrNone) - { - sock.Close(); - return err; // return with error - } - } // end while } // end for loop } // end else active connection - + ILOG(ESOCKET, "GetlocalIPAdressL , got ip "); + conn.Close(); sock.Close(); - return KErrNotFound; // return with KErrNotFound + socketServ.Close(); + + return err; // return with KErrNotFound } diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/javaenv/tsrc/build/alltests.mmp --- a/javacommons/javaenv/tsrc/build/alltests.mmp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/javaenv/tsrc/build/alltests.mmp Tue Jul 13 16:05:52 2010 +0100 @@ -20,14 +20,12 @@ CAPABILITY all -tcb -allfiles -drm #include <../../../../inc/java_stdcpp_support_for_exe.hrh> -#include - -//SYSTEMINCLUDE /epoc32/include +#include USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc USERINCLUDE ../../../../tools/cpputest/include/cpputest USERINCLUDE ../../../../tools/cpputest/include/platforms/symbian -USERINCLUDE ../../../../inc STATICLIBRARY cpputest.lib diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/javastorage/tsrc/storageclient/build/alltests.mmp --- a/javacommons/javastorage/tsrc/storageclient/build/alltests.mmp Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/javastorage/tsrc/storageclient/build/alltests.mmp Tue Jul 13 16:05:52 2010 +0100 @@ -22,7 +22,7 @@ #include <../../../../../inc/java_stdcpp_support_for_exe.hrh> #include -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE USERINCLUDE ../../../inc USERINCLUDE ../../../../../tools/cpputest/include/cpputest diff -r 0105bdca6f9c -r 3182bd6adebb javacommons/security/build/build.xml --- a/javacommons/security/build/build.xml Wed Jun 30 15:21:28 2010 +0100 +++ b/javacommons/security/build/build.xml Tue Jul 13 16:05:52 2010 +0100 @@ -1,5 +1,5 @@ CScrBackupUtil: NewL()"); + + CScrBackupUtil *self = CScrBackupUtil::NewLC(); + + CleanupStack::Pop(self); + + LOG(EBackup,EInfo," <--- CScrBackupUtil: NewL()"); + return self; + } + + +CScrBackupUtil* CScrBackupUtil::NewLC() + { + LOG(EBackup,EInfo," ---> CScrBackupUtil: NewLC"); + CScrBackupUtil *self = new(ELeave) CScrBackupUtil(); + CleanupStack::PushL(self); + self->ConstructL(); + LOG(EBackup,EInfo," <--- CScrBackupUtil: NewLC"); + return self; + } + +CScrBackupUtil::CScrBackupUtil():iPtrToWriteBuffer(NULL,0) + { + LOG(EBackup,EInfo," ---> CScrBackupUtil: CScrBackupUtil"); + LOG(EBackup,EInfo," <--- CScrBackupUtil: CScrBackupUtil"); + } + + +void CScrBackupUtil::ConstructL() + { + LOG(EBackup,EInfo," ---> CScrBackupUtil: ConstructL "); + + //will be incremented as and when needed + iRemainingInfo = HBufC8::NewL(4096);//TODO :need to change it to the total size of the the attribute + //iPtrToWriteBuffer = ((const_cast(iRemainingInfo->Ptr())));// need to do this coz when fun end and goes to fetch next 4096 bytes i lose it + iPtrToWriteBuffer.Set(iRemainingInfo->Des()); + iIsFristCall = ETrue; + + iState = EIsFetchCompleteInfo; + iIsToWriteInStream = ETrue; + LOG(EBackup,EInfo," <--- CScrBackupUtil: ConstructL()"); + } +void CScrBackupUtil::ConnectScrL() + { + LOG(EBackup,EInfo," ---> CScrBackupUtil: ConnectScrL()"); + iScr = new RSoftwareComponentRegistry(); + if (NULL == iScr) + { + ELOG(EBackup,"Creating RSoftwareComponentRegistry failed"); + User::Leave(KErrGeneral); + } + + TInt err = iScr->Connect(); + if (KErrNone != err) + { + ELOG1(EBackup,"Connecting to RSoftwareComponentRegistry failed, error %d",err); + //TODO need to see can we afford leaving here ;) + User::Leave(err); + } + LOG(EBackup,EInfo," <--- CScrBackupUtil: ConnectScrL()"); + } +void CScrBackupUtil::ExtractUidAndComponentIdL(RArray& componentIds,RArray& uids,TInt& ComponentsCount) + { + LOG(EBackup,EInfo," ---> CScrBackupUtil: ExtractUidAndComponentId()"); + CComponentFilter* filter; + CPropertyEntry* property; + filter = CComponentFilter::NewLC(); + //Set the filter for software type Usif::KSoftwareTypeJava and ftech the Ids + filter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); + TRAPD(error,iScr->GetComponentIdsL(componentIds,filter)); + if(error) + { + ELOG(EBackup,"Failed to get the components ID"); + } + CleanupStack::PopAndDestroy(filter); + // fetch the no. of component from the given RArray + ComponentsCount = componentIds.Count(); + // No use of Component Ids as such as they are used by SCR internally + //so exctracted the UID of of each component + for(TInt i = 0 ;i < ComponentsCount ; i++) + { + + property = iScr->GetComponentPropertyL(componentIds.operator [](i),KUid()); + if (property->PropertyType() == CPropertyEntry::EIntProperty) + { + TInt uid = ((CIntPropertyEntry*)property)->IntValue(); + uids.AppendL(uid); + + } + else + { + //Error + } + + delete property; + property = NULL; + + } + LOG(EBackup,EInfo," <--- CScrBackupUtil: ExtractUidAndComponentId()"); + } +void CScrBackupUtil::BackupScrDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft) + { + LOG(EBackup,EInfo," ---> CScrBackupUtil: BackupScrDataL()"); + + iBufferSpaceLeft = aBufferSpaceLeft ; + + if(iIsFristCall) + { + + // to get no. of components need to keep a flag that its called only once + ConnectScrL(); + + ExtractUidAndComponentIdL(iComponentIds,iUids,iNumberOfComponents); + + //write the no. of components so that it will help us in restoration time + aStream.WriteInt32L(iNumberOfComponents); + iBufferSpaceLeft -= sizeof(TInt32); + + //all the ids of the midlets that are to be backedup and the size of the rarray with holds the Ids + TPckgBuf > ids(iUids); + TInt size = ComputeSizeL(ids); + aStream.WriteInt32L(size); + iBufferSpaceLeft -= sizeof(TInt32); + + aStream.WriteL(ids); + + iBufferSpaceLeft = iBufferSpaceLeft - size; + + iIsFristCall = EFalse; + } + + for( i ; i < iComponentIds.Count() ;) + { + if(iState == EIsFetchCompleteInfo) + { + + TInt at = iComponentIds.operator[](i); + + //Temp stream in which all attributes are backed up + RDesWriteStream writeStream; + writeStream.Open(iPtrToWriteBuffer); + + GetComponentInfoL(at,writeStream); + + writeStream.CommitL(); + iLengthOfString = iPtrToWriteBuffer.Length(); + + iWriteToStream = ETrue; + + // write the size, Used while restoring + aStream.WriteInt32L(iLengthOfString); + iBufferSpaceLeft = iBufferSpaceLeft - sizeof(TInt); + + + } + if(iState == EIsWriteCompleteInfo) + { + + //writing the remaining information into the new buffer + if(iBufferToWriteNextTime) + { + aStream.WriteL(iPtrToWriteBuffer,iRemainingBuffer); + aStream.CommitL(); + LOG(EBackup, EInfo, "attributes written fully in the stream fetching for next component"); + + iBufferSpaceLeft = iBufferSpaceLeft - iRemainingBuffer; + + iBufferToWriteNextTime = EFalse; + iState = EIsFetchCompleteInfo; + + iLengthOfString = 0; // to maintain the loop + + iWriteToStream = EFalse; + i++; + } + // if the whole string cannot be writen, write part of it + if (iLengthOfString > iBufferSpaceLeft && !iBufferToWriteNextTime) + { + + iRemainingBuffer = iLengthOfString - iBufferSpaceLeft; + + aStream.WriteL(iPtrToWriteBuffer,iBufferSpaceLeft); + aStream.CommitL(); + + iBufferToWriteNextTime = ETrue; + break; + } + // else write the complete string + else if(iWriteToStream) + { aStream.WriteL(iPtrToWriteBuffer,iLengthOfString); + + aStream.CommitL(); + iBufferSpaceLeft = iBufferSpaceLeft - iLengthOfString; + iState = EIsFetchCompleteInfo; + iLengthOfString = 0; // to maintain the loop + i++; + } + + } + } + // making it false to backup next component next time + if(i >= iComponentIds.Count()) + aBackupNotFinished = EFalse; + + } + +template +TInt CScrBackupUtil::ComputeSizeL(const T &aObject) + { + LOG(EBackup,EInfo," ---> computeSize() "); + TInt size(0); + RNullWriteStream nullstream; + CleanupClosePushL(nullstream); + nullstream << aObject; + nullstream.CommitL(); + size = nullstream.BytesWritten(); + + CleanupStack::PopAndDestroy(&nullstream); + LOG(EBackup,EInfo," <--- computeSize() "); + return size; + + + } +void CScrBackupUtil::GetComponentInfoL(TComponentId aComponentId ,RDesWriteStream& aStream ) + { + + LOG(EBackup,EInfo," ---> GetComponentInfo() "); + + TInt j = 0 ; + CPropertyEntry* property; + CComponentEntry* entries = CComponentEntry::NewL(); + CleanupStack::PushL(entries); + TLanguage language =KNonLocalized; + + TBool result = iScr->GetComponentL(aComponentId,*entries,language); + entries->ExternalizeL(aStream); + + CleanupStack::PopAndDestroy(entries); + TBool isComponentPresent = iScr->IsComponentPresentL(aComponentId); + aStream.WriteInt8L(isComponentPresent); + + + // Localizable Component info + RPointerArray localizableComponentInfo; + iScr->GetComponentLocalizedInfoL(aComponentId,localizableComponentInfo); + aStream.WriteInt32L(localizableComponentInfo.Count()); + + + for(j ; j < localizableComponentInfo.Count(); j++) + { + (localizableComponentInfo.operator [](j))->ExternalizeL(aStream); + + } + + // Properties + // extracted the UID + property = iScr->GetComponentPropertyL(aComponentId,KUid()); + if (NULL != property) + { + property->ExternalizeL(aStream); + + + delete property; + property = NULL; + } + else + { + // need to return or have to proceed + } + // Exctracted Domain - Category + property = iScr->GetComponentPropertyL(aComponentId,KDomainCategory()); + if (NULL != property) + { + property->ExternalizeL(aStream); + + delete property; + property = NULL; + } + // Exctracted Media ID + property = iScr->GetComponentPropertyL(aComponentId,KMediaId()); + if (NULL != property) + { + property->ExternalizeL(aStream); + + + delete property; + property = NULL; + } + // Exctracted Setings plugin name + property = iScr->GetComponentPropertyL(aComponentId,KSettingsPlugin()); + if (NULL != property) + { + property->ExternalizeL(aStream); + + + delete property; + property = NULL; + } + + // Optional Properties + // extracted info URL + property = iScr->GetComponentPropertyL(aComponentId,KMIDletInfoURL()); + if (NULL != property) + { + property->ExternalizeL(aStream); + + + delete property; + property = NULL; + } + else // as its optional property so could be NULL + { + aStream.WriteInt8L(NULL); + } + + // extracted midlet description + property = iScr->GetComponentPropertyL(aComponentId,KMIDletDescription()); + if (NULL != property) + { + property->ExternalizeL(aStream); + + + delete property; + property = NULL; + } + else // as its optional property so could be NULL + { + aStream.WriteInt8L(NULL); + } + // extracted midlet DeletionConformation + property = iScr->GetComponentPropertyL(aComponentId,KMIDletDeletionConformation()); + if (NULL != property) + { + property->ExternalizeL(aStream); + + + delete property; + property = NULL; + } + else // as its optional property so could be NULL + { + aStream.WriteInt8L(NULL); + } + //extracted midlet DN URL + property = iScr->GetComponentPropertyL(aComponentId,KDownloadURL()); + if (NULL != property) + { + property->ExternalizeL(aStream); + + + delete property; + property = NULL; + } + else // as its optional property so could be NULL + { + aStream.WriteInt8L(NULL); + } + + + // backing up files corresponds to component + RSoftwareComponentRegistryFilesList fileList; + CleanupClosePushL(fileList); + TInt count = iScr->GetComponentFilesCountL(aComponentId); + TInt k = 0; + RPointerArray files; + fileList.OpenListL(*iScr,aComponentId); + fileList.NextFileSetL(count,files); + aStream.WriteInt32L(files.Count()); + CleanupStack::PopAndDestroy(&fileList);//filelist + + for( k ; k < files.Count(); k++) + { + HBufC* temp = files.operator [](k); + aStream.WriteInt32L(temp->Length()); + aStream.WriteL(temp->Des()); + } + + + RArray noOfApps; + HBufC* appIcon; + TAppRegInfo appInfo; + iScr->GetAppUidsForComponentL(aComponentId,noOfApps); + RRegistrationInfoForApplication regInfoIcon; + CleanupClosePushL(regInfoIcon); + RApplicationRegistrationInfo regInfoCaption; + CleanupClosePushL(regInfoCaption); + + + //backing up the no. of apps + aStream.WriteInt32L(noOfApps.Count()); + + + for(j = 0 ; j < noOfApps.Count(); j++ ) + { + regInfoIcon.OpenL(*iScr,noOfApps.operator [](j)); + regInfoCaption.OpenL(*iScr); + + //check if language is imp to give as an argument\ + // Language extracted + TLanguage language = regInfoIcon.ApplicationLanguageL(); + // Language backed up + aStream.WriteInt32L(language); + + // AppUID extracted + TUid appUid = noOfApps[j]; + // AppUID backed up + aStream.WriteInt32L(appUid.iUid); + + //App caption extracted + regInfoCaption.GetAppInfoL(appUid,appInfo,language); + TAppCaption caption = appInfo.Caption(); + caption.Trim();// would give the acctual size of content + //App caption backed up + aStream.WriteL(caption); + + //AppIcon path extracted + regInfoIcon.GetAppIconL(appIcon); + //AppIcon path backed up + aStream.WriteL(appIcon->Des()); + + + //need to backup no. of icons to needed for registrating application + TInt noOfIcons = regInfoIcon.NumberOfOwnDefinedIconsL(); + aStream.WriteInt32L(noOfIcons); + } + CleanupStack::PopAndDestroy();//regInfoIcon + CleanupStack::PopAndDestroy();//regInfoCaption + //regInfoIcon.Close(); + //regInfoCaption.Close(); + + iState = EIsWriteCompleteInfo; + + LOG(EBackup,EInfo," <--- GetComponentInfo() "); + + } +void CScrBackupUtil::RestoreScrDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft) + { + LOG(EBackup,EInfo," ---> RestoreScrDataL() "); + if(iIsFristCall) + { + ConnectScrL(); + TInt j = 0; + TInt presentComponentsCount; + RArray presentComponentsIds; + iBufferSpaceLeft = aBufferSpaceLeft; + //aStream.r + //reading components count + iNumberOfComponents = aStream.ReadInt32L(); + iBufferSpaceLeft = iBufferSpaceLeft - sizeof(TInt32); + + //reading the size of the TPckgBuf> + TInt size = aStream.ReadInt32L(); + iBufferSpaceLeft = iBufferSpaceLeft - sizeof(TInt32); + + //reading TPckgBuf> + HBufC* temp = HBufC::NewLC(aStream , size); + + TPckgBuf > ids; + //extracting RArray from TPckgBuf> + ids.Append(temp->Des()); + CleanupStack::PopAndDestroy(temp); + iUids = ids.operator ()();// populated iUids + iBufferSpaceLeft = iBufferSpaceLeft - size; + iNumberOfComponents = iUids.Count(); + + + ExtractUidAndComponentIdL(presentComponentsIds,iPresentUids,presentComponentsCount); + + // calculating the midlets to be deleted from SCR + for(j ; j <= iNumberOfComponents ; j++ ) + { + TInt id = NULL; + TInt index = 0; + id = iUids.operator [](j); + index = iPresentUids.Find(iUids.operator [](j)); + if(index != NULL) + { + presentComponentsIds.Remove(index);// removeing the app that is present in SCr and backed up too + iPresentUids.Remove(index);// TODO : check if right component Id is removed + } + } + + + iPresentUids.Compress(); // need to see if this works + presentComponentsIds.Compress();// contains the uids that has to be deleted + //Updated the count + presentComponentsCount = iPresentUids.Count(); + for(j = 0 ; j <= presentComponentsCount ; j++ ) + { + TRAPD(err ,iScr->DeleteApplicationEntriesL(presentComponentsIds.operator [](j))); + if (KErrNone == err) + { + iScr->DeleteComponentL(presentComponentsIds.operator [](j)); + } + + } + + + } + RDesReadStream readStream; + readStream.Open(iPtrToWriteBuffer); + for( i ; i < iComponentIds.Count() ;) + { + if(iState == EIsFetchCompleteInfo) + { + TUid uid ; + uid.iUid = iUids.operator [](i); + SetDataInScrL(uid,readStream); + i++; + } + if(iState == EIsWriteCompleteInfo) + { + RDesReadStream readStream; + readStream.Open(iPtrToWriteBuffer); + iLengthOfString = aStream.ReadInt32L(); + + + //Reading the remaining information into the new buffer + if(iBufferToWriteNextTime) + { + //appened it in the remaing + HBufC* remainingBuff = HBufC::NewL(iRemainingBuffer); + TPtr ptr(remainingBuff->Des()); + aStream.ReadL(ptr,iRemainingBuffer); + iPtrToWriteBuffer.Append(ptr); + iState = EIsFetchCompleteInfo; + iLengthOfString = 0; // to maintain the loop + iWriteToStream = EFalse; + + + } + if (iLengthOfString > iBufferSpaceLeft && !iBufferToWriteNextTime) + { + iRemainingBuffer = iLengthOfString - iBufferSpaceLeft; + aStream.ReadL(iPtrToWriteBuffer,iBufferSpaceLeft); + iBufferToWriteNextTime = ETrue; + break ; + } + // Read the complete string + else if(iWriteToStream) + { + aStream.ReadL(iPtrToWriteBuffer,iLengthOfString); + iBufferSpaceLeft = iBufferSpaceLeft - iLengthOfString; + iState = EIsFetchCompleteInfo; + iLengthOfString = 0; // to maintain the loop + + } + + } + } + //take care of restorestate + // SCR restore is over; Set state to EAppArc + if(i >= iComponentIds.Count()) + { + aRestoreState = EAppArc; + aBufferSpaceLeft = iBufferSpaceLeft;// need to to this coz of last iteration + } + + LOG(EBackup,EInfo," <--- RestoreScrDataL() "); + } +void CScrBackupUtil::SetDataInScrL(TUid aUid , RDesReadStream& aStream) + { + LOG(EBackup,EInfo," ---> SetDataInScrL() "); + TInt tempSize = NULL; + TInt j = 0; + tempSize = aStream.ReadInt32L(); + CComponentEntry* entries; + entries = CComponentEntry::NewL(); + CleanupStack::PushL( entries); + entries->InternalizeL(aStream); + + + TBool isComponentPresent = aStream.ReadInt8L(); + + // Localizable Component info + RPointerArray localizableComponentInfoArray; // Not owned by me nee to delete in last + TInt temp = aStream.ReadInt32L(); + for(j ; j <= temp; j++) + { + CLocalizableComponentInfo* componentinfo = CLocalizableComponentInfo::NewL(aStream); + localizableComponentInfoArray.Append(componentinfo); + } + + // now need to set all the properties + // extracted the UID + CIntPropertyEntry* property; + property = (CIntPropertyEntry*)CPropertyEntry::NewL(aStream); + TInt64 id = property->Int64Value(); + delete property; + + //extracted midlet Domain-Catogary + CLocalizablePropertyEntry* propertyString; + propertyString =(CLocalizablePropertyEntry*) CPropertyEntry::NewL(aStream); + HBufC* domainCategory = (propertyString->StrValue()).Alloc(); + delete propertyString; + + // Exctracted Media ID + property = (CIntPropertyEntry*)CPropertyEntry::NewL(aStream); + TInt64 mediaID = property->Int64Value(); + delete property; + + //extracted midlet SettingsValue + propertyString =(CLocalizablePropertyEntry*) CPropertyEntry::NewL(aStream); + HBufC* SettingsValue = (propertyString->StrValue()).Alloc(); + delete propertyString; + + // Optional Properties + // extracted info URL + propertyString = propertyString = (CLocalizablePropertyEntry*)CPropertyEntry::NewL(aStream); + HBufC* url = (propertyString->StrValue()).Alloc(); + delete propertyString; + + + // extracted midlet description + propertyString = (CLocalizablePropertyEntry*)CPropertyEntry::NewL(aStream); + HBufC* midletDescription = (propertyString->StrValue()).Alloc(); + delete propertyString; + + // midlet deletion conformation has to be here + CBinaryPropertyEntry* propertyBinary = (CBinaryPropertyEntry*)CPropertyEntry::NewL(aStream); + HBufC8* midletDeletionConformation = (propertyBinary->BinaryValue()).Alloc(); + delete propertyBinary; + + //extracted midlet DN URL + propertyString =(CLocalizablePropertyEntry*) CPropertyEntry::NewL(aStream); + HBufC* dnUrl = (propertyString->StrValue()).Alloc(); + delete propertyString; + + //Extracting no. of files registered with a component + //1st the no. of files + RPointerArray componentFilesArray; + + TInt fileCount = aStream.ReadInt32L(); + //now the files + for(TInt k = 0 ; k < fileCount ; k++) + { + TInt size = aStream.ReadInt32L(); + HBufC* componentFile = HBufC::NewL(aStream,size); + CleanupStack::PushL( componentFile); + componentFilesArray.AppendL(componentFile); + CleanupStack::Pop( componentFile); + } + + //Extracting no. of apps with a component + TInt noOfApps = aStream.ReadInt32L(); + RPointerArray appinfoArray; + for(j = 0 ; j < noOfApps ; j++ ) + { + CAppInfo* appinfo = CAppInfo::NewL(); + CleanupStack::PushL( appinfo);// i will not own it after using has to be destroyed + TLanguage language; + language = (TLanguage)(aStream.ReadInt32L()); + TUid uid; + uid.Uid(aStream.ReadInt32L()); + + TAppCaption caption ; + aStream.ReadL(caption); + HBufC* appIcon ; + TPtr temp(appIcon->Des()); + aStream.ReadL(temp); + TInt noOfIcons = aStream.ReadInt32L(); + + appinfo->Set(language,uid,caption,temp,noOfIcons);// TODO: check if it works + appinfoArray.Append(appinfo); + + + + } + + + TInt index = iPresentUids.Find(aUid.iUid); + if(index != NULL) + { CComponentEntry* entry = CComponentEntry::NewLC(); + TUid uid ; + uid.Uid(iPresentUids.operator [](index)); + TComponentId componentId = iScr->GetComponentIdForAppL(uid); + iScr->GetComponentL(componentId,*entry); + HBufC* versionPresent = entry->Version().AllocLC(); + CleanupStack::PopAndDestroy(entry); + HBufC* versionBackUpComponent = entries->Version().AllocLC(); + if((versionPresent->CompareC(versionBackUpComponent->Des())))//check version + { + //ignore Write a log statement as the midlet is same no need to do any thing :) + } + else + { + // delete it and thn register it + TRAPD(err ,iScr->DeleteApplicationEntriesL(componentId)); + if (KErrNone == err) + { + iScr->DeleteComponentL(componentId); + } + // call register + TComponentId newComponentId = RegisterComponentL(*entries,uid,url->Des(),midletDescription->Des(),midletDeletionConformation->Des(),dnUrl->Des(),mediaID,domainCategory->Des(),SettingsValue->Des(),componentFilesArray,isComponentPresent,localizableComponentInfoArray); + for(j=0; j < appinfoArray.Count() ; j++) + { + CAppInfo* appInfo = appinfoArray.operator [](j); + + RegisterApplicationL(newComponentId,appInfo->GetAppUid(),appInfo->GetCaption(),appInfo->GetAppIcon()->Des(),appInfo->NoOfIcons(),appInfo->GetLanguage()); + CleanupStack::PopAndDestroy(appInfo); + } + } + CleanupStack::PopAndDestroy(versionPresent); + CleanupStack::PopAndDestroy(versionBackUpComponent); + } + else + { + //just go register it as its not there in the phone + TComponentId newComponentId = RegisterComponentL(*entries,aUid,url->Des(),midletDescription->Des(),midletDeletionConformation->Des(),dnUrl->Des(),mediaID,domainCategory->Des(),SettingsValue->Des(),componentFilesArray,isComponentPresent,localizableComponentInfoArray); + for(j=0; j < appinfoArray.Count() ; j++) + { + CAppInfo* appInfo = appinfoArray.operator [](j); + + RegisterApplicationL(newComponentId,appInfo->GetAppUid(),appInfo->GetCaption(),appInfo->GetAppIcon()->Des(),appInfo->NoOfIcons(),appInfo->GetLanguage()); + CleanupStack::PopAndDestroy(appInfo); + } + } + + //CleanupStack::Pop();//componentFilesArray + CleanupStack::PopAndDestroy( entries); + + LOG(EBackup,EInfo," <--- SetDataInScrL() "); + } + + +TComponentId CScrBackupUtil::RegisterComponentL(CComponentEntry& aEntry ,TUid aUid,TPtr aMidletInfoUrl, + TPtr aMidletDescription,TPtr8 aMidletDeletionConformation, TPtr aDownloadUrl,TInt64 aMediaId,TPtr aDomainCatogary , TPtr aSettingValue, + RPointerArray& aComponentFilesArray, TBool aIsComponentPresent,RPointerArray& aLocalizableComponentInfoArray) +{ + LOG(EBackup,EInfo," ---> RegisterComponentL() "); + HBufC* globalId =( aEntry.GlobalId()).AllocLC(); + + TComponentId componentId = iScr->AddComponentL(aLocalizableComponentInfoArray,Usif::KSoftwareTypeJava,globalId); + + + + iScr->SetComponentVersionL(componentId, aEntry.Version()); + //LOG1(EJavaInstaller, EInfo, "RegisterComponentL: version set %s",*version); + + iScr->SetIsComponentRemovableL(componentId, aEntry.IsRemovable()); + + + iScr->SetIsComponentDrmProtectedL(componentId, aEntry.IsDrmProtected()); + + + iScr->SetIsComponentKnownRevokedL(componentId,aEntry.IsKnownRevoked()); + + + iScr->SetIsComponentOriginVerifiedL(componentId, aEntry.IsOriginVerified()); + + + iScr->SetComponentSizeL(componentId, aEntry.ComponentSize()); + + + iScr->SetScomoStateL(componentId,aEntry.ScomoState()); + + + iScr->SetIsComponentPresentL(componentId,aIsComponentPresent); + + + + iScr->SetComponentPropertyL(componentId,KUid(), aUid.iUid); + + + iScr->SetComponentPropertyL(componentId,KMIDletInfoURL(),aMidletInfoUrl); + + iScr->SetComponentPropertyL(componentId, KMIDletDescription(), aMidletDescription); + + iScr->SetComponentPropertyL(componentId,KMIDletDeletionConformation(),aMidletDeletionConformation); + + iScr->SetComponentPropertyL(componentId, KDownloadURL(), aDownloadUrl); + + iScr->SetComponentPropertyL(componentId,KDomainCategory(),aDomainCatogary); + + iScr->SetComponentPropertyL(componentId, KMediaId(), aMediaId); + + + iScr->SetComponentPropertyL(componentId, KSettingsPlugin(), aSettingValue); + + + CleanupStack::PopAndDestroy(globalId); + + TInt fileCount = aComponentFilesArray.Count(); + for (TInt i = 0; i < fileCount; i++) + { + HBufC *componentFile = aComponentFilesArray.operator [](i); + iScr->RegisterComponentFileL(componentId, *componentFile); + CleanupStack::PopAndDestroy(componentFile); + } + LOG(EBackup,EInfo," <--- RegisterComponentL() "); + return componentId; +} + +void CScrBackupUtil::RegisterApplicationL(TInt aComponentId, TUid aAppUid, + TAppCaption aAppName, TDesC aIconFilename, TInt aNumberOfIcons, + TLanguage aLanguages) + { + LOG(EBackup,EInfo," ---> RegisterApplicationL() "); + TFileName appName; + RPointerArray ownedFileArray; // codescanner::resourcenotoncleanupstack + RPointerArray serviceArray; // codescanner::resourcenotoncleanupstack + RPointerArray appPropertiesArray; // codescanner::resourcenotoncleanupstack + RPointerArray viewDataList; // codescanner::resourcenotoncleanupstack + + RPointerArray opaqueDataArray; + CleanupResetAndDestroyPushL(opaqueDataArray); + // Write application Uid to opaque data (needed by MIDlet launcher). + TBuf8<4> opaqueDataBuf; // Opaque data will contain one signed 32-bit int. + RDesWriteStream writeStream(opaqueDataBuf); + writeStream.WriteInt32L(aAppUid.iUid); + writeStream.CommitL(); + + + + COpaqueData *opaqueData = COpaqueData::NewLC(opaqueDataBuf, KUnspecifiedLocale); + opaqueDataArray.AppendL(opaqueData); + CleanupStack::Pop(opaqueData); + + RPointerArray localizableAppInfoList; + CleanupResetAndDestroyPushL(localizableAppInfoList); + // Add non-localized application name (caption) and icon. + + CCaptionAndIconInfo *captionAndIconInfo = CCaptionAndIconInfo::NewLC(aAppName,aIconFilename,aNumberOfIcons); + + CLocalizableAppInfo *locAppInfo = CLocalizableAppInfo::NewLC(/*aShortCaption=*/ KNullDesC,KNonLocalized, + /*aGroupName=*/ KNullDesC,captionAndIconInfo,viewDataList); + localizableAppInfoList.AppendL(locAppInfo); + + CleanupStack::Pop(locAppInfo); + CleanupStack::Pop(captionAndIconInfo); + + CCaptionAndIconInfo *tmpCaptionAndIconInfo =CCaptionAndIconInfo::NewLC(aAppName,/*aIconFileName=*/ KNullDesC,/*aNumOfAppIcons=*/ 0); + CLocalizableAppInfo *tmpLocAppInfo = CLocalizableAppInfo::NewLC(/*aShortCaption=*/ KNullDesC,aLanguages,/*aGroupName=*/ KNullDesC, + tmpCaptionAndIconInfo,/*aViewDataList=*/ viewDataList); + localizableAppInfoList.AppendL(tmpLocAppInfo); + + CleanupStack::Pop(tmpLocAppInfo); + CleanupStack::Pop(tmpCaptionAndIconInfo); + + + + // Create application registration data objects. + TApplicationCharacteristics appCharacteristics; + appCharacteristics.iAttributes = TApaAppCapability::ENonNative; + appCharacteristics.iEmbeddability = TApplicationCharacteristics::ENotEmbeddable; + appCharacteristics.iSupportsNewFile = EFalse; + appCharacteristics.iAppIsHidden = EFalse; + appCharacteristics.iLaunchInBackground = EFalse; + + CApplicationRegistrationData *appRegData = + CApplicationRegistrationData::NewLC(ownedFileArray, serviceArray,localizableAppInfoList,appPropertiesArray,opaqueDataArray, + /*aAppUid=*/ aAppUid, /*aAppFile=*/ appName,/*aCharacteristics=*/ appCharacteristics,/*aDefaultScreenNumber=*/ 0); + + LOG(EJavaInstaller, EInfo,"RegisterApplicationL : Called AddApplicationEntryL >>>>>>>>>>>> "); + iScr->AddApplicationEntryL(aComponentId, *appRegData); + CleanupStack::PopAndDestroy(appRegData); + + + CleanupStack::Pop(&localizableAppInfoList); // deleted in appRegData destructor + CleanupStack::Pop(&opaqueDataArray); // deleted in appRegData destructor + + LOG(EBackup,EInfo," <--- RegisterApplicationL() "); + } + +CScrBackupUtil::~CScrBackupUtil() + { + LOG(EBackup,EInfo," ---> ~CScrBackupUtil() "); + + if(iScr) + { + iScr->Close(); + delete iScr; + iScr = NULL; + } + if(iRemainingInfo) + { + delete iRemainingInfo; + iRemainingInfo = NULL; + } + + LOG(EBackup,EInfo," <--- ~CScrBackupUtil() "); + } + +CAppInfo* CAppInfo::NewL() + { + LOG(EBackup,EInfo," ---> CAppInfo:NewL()"); + CAppInfo *self = CAppInfo::NewLC(); + CleanupStack::Pop(self); + LOG(EBackup,EInfo," <--- CAppInfo:NewL()"); + return self; + } + + +CAppInfo* CAppInfo::NewLC() + { + LOG(EBackup,EInfo," ---> CAppInfo:NewLC"); + CAppInfo *self = new(ELeave) CAppInfo(); + CleanupStack::PushL(self); + self->ConstructL(); + LOG(EBackup,EInfo," <---CAppInfo:NewLC"); + return self; + } +CAppInfo::CAppInfo() + { + + } +void CAppInfo::ConstructL() + { + LOG(EBackup,EInfo," ---> CAppInfo:ConstructL "); + + + + LOG(EBackup,EInfo," <--- CAppInfo:ConstructL()"); + } +CAppInfo::~CAppInfo() + { + LOG(EBackup,EInfo," ---> CAppInfo:~CAppInfo() "); + if(iAppIcon) + { + delete iAppIcon; + } + LOG(EBackup,EInfo," <--- CAppInfo:~CAppInfo() "); + } + +void CAppInfo::Set(TLanguage language,TUid appUid,Usif::TAppCaption caption,TDesC& appIcon,TInt aNoOfIcons) + { + LOG(EBackup,EInfo," ---> CAppInfo:Set() "); + iLanguage = language; + iAppUid = appUid; + iCaption = caption; + iAppIcon->Des().Copy(appIcon); + iNoOfIcons = aNoOfIcons; + LOG(EBackup,EInfo," <--- CAppInfo:Set() "); + + } +TLanguage CAppInfo::GetLanguage() + { + LOG(EBackup,EInfo," ---> CAppInfo:GetLanguage() "); + LOG(EBackup,EInfo," <--- CAppInfo:GetLanguage() "); + return iLanguage; + } +TUid CAppInfo::GetAppUid() + { + LOG(EBackup,EInfo," ---> CAppInfo:GetAppUid() "); + LOG(EBackup,EInfo," <--- CAppInfo:GetAppUid() "); + return iAppUid; + } +Usif::TAppCaption CAppInfo::GetCaption() + { + LOG(EBackup,EInfo," ---> CAppInfo:GetCaption() "); + LOG(EBackup,EInfo," <--- CAppInfo:GetCaption() "); + return iCaption; + + } +HBufC* CAppInfo::GetAppIcon() + { + LOG(EBackup,EInfo," ---> CAppInfo:GetAppIcon() "); + LOG(EBackup,EInfo," <--- CAppInfo:GetAppIcon() "); + return iAppIcon; + + } + +TInt CAppInfo::NoOfIcons() + { + LOG(EBackup,EInfo," ---> CAppInfo:NoOfIcons() "); + LOG(EBackup,EInfo," <--- CAppInfo:NoOfIcons() "); + return iNoOfIcons; + } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,266 @@ +/* +* 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: Header file for CScrBackupUtil class +* +*/ + +#ifndef JAVASCRBACKUPUTIL_H_ +#define JAVASCRBACKUPUTIL_H_ + + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include //for TAppCaption +#include + +#include +#include + +namespace java + { +namespace backup + { + +class CScrBackupUtil : public CBase + { +public: + static CScrBackupUtil* NewL(); + + ~CScrBackupUtil(); + + static CScrBackupUtil* NewLC(); + + /* + * filling the data with the SCR value one by one + */ + void BackupScrDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft); + + void GetComponentInfoL(Usif::TComponentId aComponentId,RDesWriteStream& aStream); + void WriteToActualStream(RDesWriteStream& aStream); + + void RestoreScrDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft); + void SetDataInScrL(TUid aUid ,RDesReadStream& aStream); + +private: //fun + void ConstructL(); + void ConnectScrL(); + void writeRemainingData(); + void RegisterApplicationL(TInt aComponentId, TUid aAppUid, + Usif::TAppCaption aAppName, TDesC aIconFilename, TInt aNumberOfIcons, + TLanguage aLanguages); + + template + TInt ComputeSizeL(const T &aObject); + void ExtractUidAndComponentIdL(RArray& componentIds,RArray& uids,TInt& ComponentsCount); + Usif::TComponentId RegisterComponentL(Usif::CComponentEntry& aEntry ,TUid aUid,TPtr aMidletInfoUrl, TPtr aMidletDescription, TPtr8 aMidletDeletionConformation,TPtr aDownloadUrl,TInt64 aMediaId,TPtr aDomainCatogary , TPtr aSettingValue,RPointerArray& aComponentFilesArray, TBool aIsComponentPresent,RPointerArray& aLocalizableComponentInfoArray); + CScrBackupUtil(); +private://members + + enum TState + { + EIsFetchCompleteInfo, + EIsWriteCompleteInfo + }; + TState iState; + HBufC8* iRemainingInfo; + // to check if the previous attribte claims that he cant + //write in stream because of space so all other attribute + //down the lane should be in the remaining info buffer to maintain the sequence + TBool iIsToWriteInStream; + TBool iBufferToWriteNextTime; + TBool iWriteToStream; + TInt i ; + TInt iLengthOfString; + Usif::RSoftwareComponentRegistry* iScr; + RArray iComponentIds; + RArray iUids; + RArray iPresentUids; + + TInt iNumberOfComponents; + TInt iBufferSpaceLeft; + + TInt iRemainingBuffer; + TPtr8 iPtrToWriteBuffer; + + TBool iIsFristCall; + + }; + +// Helper class pass the info of midlet with in midletSuite +class CAppInfo : public CBase + { +public: + static CAppInfo* NewL(); + + ~CAppInfo(); + + static CAppInfo* NewLC(); + void ConstructL(); + void Set(TLanguage language,TUid appUid,Usif::TAppCaption caption,TDesC& appIcon,TInt aNoOfIcons); + TLanguage GetLanguage(); + TUid GetAppUid(); + Usif::TAppCaption GetCaption(); + HBufC* GetAppIcon(); + TInt NoOfIcons(); +protected: + + CAppInfo(); + + +private: + TLanguage iLanguage; + TUid iAppUid; + Usif::TAppCaption iCaption; + HBufC* iAppIcon; + TInt iNoOfIcons; + }; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +class CJavaBackupEntries : public CBase + { +public: + ~CJavaBackupEntries(); + static CJavaBackupEntries* NewL(Usif::TComponentId aId); + + static CJavaBackupEntries* NewLC(Usif::TComponentId aId); + + + //used to get the below info + /* + * will get all the entries in this API + * called when restoring + */ + void GetEntries(); + + /* + * to set all the entries + * + */ + void SetEntries(); +private : + + void ConstructL(Usif::TComponentId aId); + +private: + //check if this duplication can be removed as the same variable is in ccomponentEntry + Usif::TComponentId iComponentId; ///< The unique id of the software component. + //HBufC* iName; ///< Name of the software component. + //HBufC* iVendor; ///< Vendor of the software component. + //HBufC* iSwType; ///< Software type name of the component. + //HBufC* iGlobalId; ///< Globally unique component identifier. + //TBool iRemovable; ///< Whether the component is removable. + //TInt64 iSize; ///< The total size of the component at installation time in bytes. + //TScomoState iScomoState; ///< SCOMO state of the component. + //TDriveList iInstalledDrives; ///< The set of drives that files for the software component were installed to. + //HBufC* iVersion; ///< Version identifier of the software component + //HBufC* iInstallTime; ///< The install time of the component. + //TBool iDrmProtected; ///< Whether the component is DRM protected. + //TBool iHidden; ///< Whether the component is hidden in the list of installed components. + //TBool iKnownRevoked; ///< Whether the component has been revoked. + //TBool iOriginVerified; ///< Whether the installer has verified the originator of the component. + + + // TODO Can we keep a pointer here + Usif::CComponentEntry iEntries; + TBool iIsComponentPresent; + // component property + TInt iMidletSuitId; + HBufC *iMidletInfoUrl; + HBufC *iMidletDescription; + TBool iMidletDeletetionConfirmation; // Didnt got any thing for it + HBufC *iMidletDownloadUrl; + HBufC *iDomainCatagory;// didnt got any thing for it + TInt iMediaId; + //addtion to CcomponentEntry Class + RPointerArray &iCompLocalizedInfoArray; + + + Usif::RSoftwareComponentRegistry *iScr; + + + + }; + } + + } + + + +#endif /* JAVASCRBACKUPUTIL_H_ */ diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,2084 @@ +/* +* 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: Implementation of CStorageBackupUtil +* +*/ + + +#include "javastoragebackuputil.h" +#include "midp2backupplugin.h" +#include "midp2backupdataids.h" + +#include "javastorageentry.h" +#include "javastorage.h" +#include "javastoragenames.h" + +#include "logger.h" +#include "javauid.h" +#include "javaoslayer.h" +#include "javacommonutils.h" +#include "s60commonutils.h" +#include "javasymbianoslayer.h" + +#include +#include + +using namespace std; +using namespace java::storage; +using namespace java::backup; + +// ======== MEMBER FUNCTIONS ======== + +CStorageBackupUtil::CStorageBackupUtil() +{ + LOG(EBackup, EInfo, "CStorageBackupUtil constructor"); +} + +void CStorageBackupUtil::ConstructL() +{ + LOG(EBackup, EInfo, "CStorageBackupUtil::ConstructL"); + + iFirstCalltoBackupStorageData = ETrue; + iFirstCalltoRestoreStorageData = ETrue; + + iBufferSpaceLeft = 0; + + iRemainingString = EFalse; + iStrCount = 0; + + for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; tableNumber++) + { + iTableSize[tableNumber] = 0; + } +} + +CStorageBackupUtil* CStorageBackupUtil::NewL() +{ + LOG(EBackup, EInfo, "CStorageBackupUtil::NewL"); + + CStorageBackupUtil* self = new(ELeave) CStorageBackupUtil(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +CStorageBackupUtil::~CStorageBackupUtil() +{ + LOG(EBackup, EInfo, "CStorageBackupUtil Destructor"); + + // clear the vectors to free all the heap data. + iStringVector.clear(); +} + + +void CStorageBackupUtil::BackupStorageDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CStorageBackupUtil::BackupStorageDataL"); + + iBufferSpaceLeft = aBufferSpaceLeft; + + if (iFirstCalltoBackupStorageData) + { + int err = FillVectorWithStorageData(); + + if (err != KErrNone) + { + User::Leave(err); + } + LOG1(EBackup, EInfo, "Total no of rows in vector: %d", iStringVector.size()); + + // First write the total no of rows in the vector to the stream + + aStream.WriteInt32L(iStringVector.size()); + iBufferSpaceLeft -= sizeof(TInt32); + + /* Then write the number of rows in each table to the stream. + This will be used while writing the data to storage. */ + + for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; tableNumber++) + { + aStream.WriteInt16L(iTableSize[tableNumber]); + iBufferSpaceLeft -= sizeof(TInt16); + } + + iFirstCalltoBackupStorageData = EFalse; + } + + // Now write the actual string data into the stream. + + while (iBufferSpaceLeft > 0 && iStrCount < iStringVector.size()) + { + WriteStringtoStreamL(aStream, iStringVector[iStrCount]); + LOG1(EBackup, EInfo, "StrCount = %d", iStrCount); + } + + if (iStrCount >= iStringVector.size()) + { + LOG(EBackup, EInfo, "Backup of storage data finished"); + aBackupNotFinished = EFalse; + } +} + +void CStorageBackupUtil::RestoreStorageDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CStorageBackupUtil::RestoreStorageDataL()"); + + iBufferSpaceLeft = aBufferSpaceLeft; + + if (iFirstCalltoRestoreStorageData) + { + // the no of strings in the stream + iStrCount = aStream.ReadInt32L(); + iBufferSpaceLeft -= sizeof(TInt32); + + // read the number of rows in each table + for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; tableNumber++) + { + iTableSize[tableNumber] = aStream.ReadInt16L(); + iBufferSpaceLeft -= sizeof(TInt16); + } + iFirstCalltoRestoreStorageData = EFalse; + } + + while (iBufferSpaceLeft > 0 && iStrCount > 0) + { + ReadStringfromStreamL(aStream); + } + + if (iStrCount == 0) + { + LOG1(EBackup, EInfo, "Finished reading from stream, row count = %d", iStringVector.size()); + + + int err = WriteDataToStorage(); + + if (err != KErrNone) + { + CleanupStack::PopAndDestroy(&aStream); + User::Leave(KErrGeneral); + } + + // Storage restore is over; Change the state +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + aRestoreState = EScr; +#else + aRestoreState = EAppArc; +#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + + aBufferSpaceLeft = iBufferSpaceLeft; + } +} + + +void CStorageBackupUtil::WriteStringtoStreamL(RDesWriteStream& aStream, wstring aStr) +{ + iLenOfString = aStr.length(); + + // if length of string is 0, do not write any string to the stream. + if (iLenOfString == 0) + { + aStream.WriteInt16L(iLenOfString*2); + iBufferSpaceLeft -= sizeof(TInt16); + iStrCount++; + } + + else + { + /* if space is not enough for writing the complete string, + do not write it. Could be written next time. */ + if (((iLenOfString*2) + sizeof(TInt16)) > iBufferSpaceLeft) + { + LOG(EBackup, EInfo, "Stream size is not enough to hold the string"); + // set the bufferspaceleft to zero + iBufferSpaceLeft = 0; + } + // stream has enough space for the length and the string data. + else + { + aStream.WriteInt16L(iLenOfString*2); + iBufferSpaceLeft -= sizeof(TInt16); + + HBufC* tempstr = java::util::S60CommonUtils::wstringToDes(aStr.c_str()); + TPtrC tempStr = tempstr->Des(); + aStream.WriteL(tempStr); + iBufferSpaceLeft -= (iLenOfString*2); + delete tempstr; + + iStrCount++; + } + } +} + +void CStorageBackupUtil::ReadStringfromStreamL(RDesReadStream& aStream) +{ + wstring emptyString; + + /* if only part of the string was read last time, + read the remaining and append it to that string. */ + if (iRemainingString) + { + // if the whole string cannot be read, read part of it and store it. + if (iLenOfString > iBufferSpaceLeft) + { + LOG(EBackup, EInfo, "Cant read the full string; read only part of it"); + + HBufC* data = HBufC::NewL(iBufferSpaceLeft/2+1); + TPtr pdata = data->Des(); + + aStream.ReadL(pdata, iBufferSpaceLeft/2); + iLenOfString -= iBufferSpaceLeft; + iBufferSpaceLeft = 0; + + wchar_t* str = desToWstring(pdata); + wstring stringData(str); + iHalfReadString += stringData; + + delete data; + iRemainingString = ETrue; + } + // else read the complete string + else + { + HBufC* data = HBufC::NewL(iLenOfString/2+1); + TPtr pdata = data->Des(); + + aStream.ReadL(pdata, iLenOfString/2); + iBufferSpaceLeft -= (iLenOfString); + + wchar_t* str = desToWstring(pdata); + wstring stringData(str); + iHalfReadString += stringData; + + iStringVector.push_back(iHalfReadString); + + delete data; + iStrCount--; + iRemainingString = EFalse; + iHalfReadString = emptyString; + } + } + + else + { + iLenOfString = aStream.ReadInt16L(); + iBufferSpaceLeft -= sizeof(TInt16); + + if (iLenOfString > 0) + { + // if full string cannot be read, read only part of it. + if (iLenOfString > iBufferSpaceLeft) + { + /* if the stream does not have even part of the string, + just set the iRemainingFlag to ETrue so that the + string can be read next time. */ + + if (iBufferSpaceLeft == 0) + { + iRemainingString = ETrue; + iHalfReadString = emptyString; + } + // else stream contains part of the stream. Read it + else + { + LOG(EBackup, EInfo, "Cant read the full string; read only part of it"); + + HBufC* data = HBufC::NewL(iBufferSpaceLeft/2+1); + TPtr pdata = data->Des(); + + aStream.ReadL(pdata, iBufferSpaceLeft/2); + iLenOfString -= iBufferSpaceLeft; + iBufferSpaceLeft = 0; + + wchar_t* str = desToWstring(pdata); + wstring stringData(str); + iHalfReadString = stringData; + delete data; + iRemainingString = ETrue; + } + } + // else full string can be read + else + { + HBufC* data = HBufC::NewL(iLenOfString/2+1); + TPtr pdata = data->Des(); + + aStream.ReadL(pdata, iLenOfString/2); + iBufferSpaceLeft -= (iLenOfString); + + wchar_t* str = desToWstring(pdata); + wstring stringData(str); + + iStringVector.push_back(stringData); + iStrCount--; + delete data; + } + } + /* if length of string is 0, do not read anything from the stream; + just push an empty string into the vector */ + else + { + iStringVector.push_back(emptyString); + iStrCount--; + } + } +} + + +int CStorageBackupUtil::FillVectorWithStorageData() +{ + // get data from storage + + LOG(EBackup, EInfo, "CStorageBackupUtil::FillVectorsWithData"); + + auto_ptr js(JavaStorage::createInstance()); + LOG(EBackup, EInfo, "Opening connection to JAVA_DATABASE"); + + try + { + js->open(JAVA_DATABASE_NAME); + LOG(EBackup, EInfo, "Opening commection succeeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Opening JAVA_DATABASE failed; %S", jse.toString().c_str()); + return KErrGeneral; + } + + JavaStorageEntry attribute; + JavaStorageApplicationEntry_t findPattern; + JavaStorageApplicationList_t foundEntries; + + + // table 1 : Application package table + { + LOG(EBackup, EInfo, "Read entries from APPLICATION_PACKAGE_TABLE"); + + try + { + js->search(APPLICATION_PACKAGE_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[0] = FillVectorwithAppPackageTableData(foundEntries); + foundEntries.clear(); + + if (iTableSize[0] == 0) + { + LOG(EBackup, EInfo, "No data in Storage; So no midlets in system;"); + return KErrGeneral; + } + } + + + // table 2: Application table + { + LOG(EBackup, EInfo, "Read entries from APPLICATION_TABLE"); + + try + { + js->search(APPLICATION_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[1] = FillVectorwithAppTableData(foundEntries); + + foundEntries.clear(); + } + + // table 3: Application package attributes table + + /* for this table, since there are very large number of rows, + read the data from the table suite-by-suite + ie. read entries for the first suite, then read entries for the + second suite. This would prevent stack overflow */ + { + LOG(EBackup, EInfo, "Read entries from APPLICATION_PACKAGE_ATTRIBUTES_TABLE"); + + int rowCount = 0; + + for (int suiteNumber = 0; suiteNumber < iTableSize[0]; suiteNumber++) + { + attribute.setEntry(ID, iStringVector[suiteNumber*14]); + findPattern.insert(attribute); + + try + { + js->search(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + rowCount += FillVectorwithAppPackageAttTableData(foundEntries); + + foundEntries.clear(); + findPattern.clear(); + } + iTableSize[2] = rowCount; + } + + // table 4: Midp package table + { + LOG(EBackup, EInfo, "Read entries from MIDP_PACKAGE_TABLE"); + + try + { + js->search(MIDP_PACKAGE_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[3] = FillVectorwithMidpPackageTableData(foundEntries); + + foundEntries.clear(); + } + + // table 5: Midp permissions table + + /* for this table, since there are very large number of rows, + read the data from the table suite-by-suite + ie. read entries for the first suite, then read entries for the + second suite. This would prevent stack overflow */ + { + LOG(EBackup, EInfo, "Read entries from MIDP_PERMISSIONS_TABLE"); + + int rowCount = 0; + + for (int suiteNumber = 0; suiteNumber < iTableSize[0]; suiteNumber++) + { + attribute.setEntry(ID, iStringVector[suiteNumber*14]); + findPattern.insert(attribute); + + try + { + js->search(MIDP_PERMISSIONS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + rowCount += FillVectorwithMidpPermTableData(foundEntries); + + foundEntries.clear(); + findPattern.clear(); + } + iTableSize[4] = rowCount; + } + + // table 6: Midp function group settings table + { + LOG(EBackup, EInfo, "Read entries from MIDP_FUNC_GRP_SETTINGS_TABLE"); + + try + { + js->search(MIDP_FUNC_GRP_SETTINGS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[5] = FillVectorwithMidpFuncGrpSetTableData(foundEntries); + + foundEntries.clear(); + } + + // table 7: push registration table + { + LOG(EBackup, EInfo, "Read entries from PUSH_REGISTRATIONS_TABLE"); + + try + { + js->search(PUSH_REGISTRATIONS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[6] = FillVectorwithPushRegTableData(foundEntries); + + foundEntries.clear(); + } + + // table 8: alarm registration table + { + LOG(EBackup, EInfo, "Read entries from ALARM_REGISTRATIONS_TABLE"); + + try + { + js->search(ALARM_REGISTRATIONS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[7] = FillVectorwithAlarmRegTableData(foundEntries); + + foundEntries.clear(); + } + + // table 9: runtime settings table + { + LOG(EBackup, EInfo, "Read entries from RUNTIME_SETTINGS_TABLE"); + + try + { + js->search(RUNTIME_SETTINGS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[8] = FillVectorwithRuntimeSetTableData(foundEntries); + + foundEntries.clear(); + } + + // table 10: pre-install table + { + LOG(EBackup, EInfo, "Read entries from PREINSTALL_TABLE"); + + try + { + js->search(PREINSTALL_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[9] = FillVectorwithPreinstallTableData(foundEntries); + + foundEntries.clear(); + } + + // Data read from JAVA_DATABASE; So close the connection + js->close(); + + // table 11: ota status table + /* Stored in another database called javaotadatabase. + so open a new connection to that database. */ + { + LOG(EBackup, EInfo, "Read entries from OTA_STATUS_TABLE"); + + auto_ptr jos(JavaStorage::createInstance()); + + try + { + jos->open(JAVA_OTA_DATABASE_NAME); + ILOG(EBackup, "Opening connection to OTA database succeeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Opening OTA database failed: %s", jse.toString().c_str()); + return KErrGeneral; + } + + try + { + jos->search(OTA_STATUS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %s", jse.toString().c_str()); + jos->close(); + return KErrGeneral; + } + + iTableSize[10] = FillVectorwithOtaStatusTableData(foundEntries); + + foundEntries.clear(); + jos->close(); + } + + //################ printing the vectors ############# + //printVector(); + //################################################### + + ILOG(EBackup, "Vector filled with data"); + return KErrNone; +} + + +int CStorageBackupUtil::WriteDataToStorage() +{ + JELOG2(EBackup); + ILOG(EBackup, "Create instance of JAVA_DATABASE_NAME and open the database"); + + auto_ptr js(JavaStorage::createInstance()); + + try + { + js->open(JAVA_DATABASE_NAME); + ILOG(EBackup, "Opening database succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Opening database failed: %S", jse.toString().c_str()); + return KErrGeneral; + } + + try + { + js->startTransaction(); + ILOG(EBackup, "Transaction started"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "startTransaction() failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + ILOG(EBackup, "Before writing data to storage, existing data must be cleared"); + + // call delete * from table one-by-one + { + JavaStorageApplicationEntry_t emptyEntry; + + try + { + js->remove(APPLICATION_PACKAGE_TABLE, emptyEntry); + js->remove(APPLICATION_TABLE, emptyEntry); + js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, emptyEntry); + js->remove(MIDP_PACKAGE_TABLE, emptyEntry); + js->remove(MIDP_PERMISSIONS_TABLE, emptyEntry); + js->remove(MIDP_FUNC_GRP_SETTINGS_TABLE, emptyEntry); + js->remove(PUSH_REGISTRATIONS_TABLE, emptyEntry); + js->remove(ALARM_REGISTRATIONS_TABLE, emptyEntry); + js->remove(RUNTIME_SETTINGS_TABLE, emptyEntry); + js->remove(PREINSTALL_TABLE, emptyEntry); + + ILOG(EBackup, "Data removed successfully from table"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Failed during removal of entries from table: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + } + + JavaStorageEntry attribute; + JavaStorageApplicationEntry_t insertEntry; + + ILOG(EBackup, "Start transaction for writing into the database"); + + int count = 0; + // table 1 : Application package table + { + LOG(EBackup, EInfo, "Writing to APPLICATION_PACKAGE_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[0]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(PACKAGE_NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VENDOR, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VERSION, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ROOT_PATH, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(MEDIA_ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(INITIAL_SIZE, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(JAD_PATH, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(JAR_PATH, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(JAD_URL, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(JAR_URL, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ACCESS_POINT, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CONTENT_INFO, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CONTENT_ID, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(APPLICATION_PACKAGE_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 2: Application table + { + LOG(EBackup, EInfo, "Writing to APPLICATION_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[1]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(PACKAGE_ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(MAIN_CLASS, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(AUTORUN, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(APPLICATION_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 3: Application package attributes table + { + LOG(EBackup, EInfo, "Writing to APPLICATION_PACKAGE_ATTRIBUTES_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[2]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VALUE, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(TRUSTED, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 4: Midp package table + { + LOG(EBackup, EInfo, "Writing to MIDP_PACKAGE_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[3]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(TYPE, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(SECURITY_DOMAIN, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(SECURITY_DOMAIN_CATEGORY, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(HASH, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CERT_HASH, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(RMS, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VALID_CERTS, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ON_SCREEN_KEYPAD, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(SECURITY_WARNINGS, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(MIDP_PACKAGE_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 5: Midp permissions table + { + LOG(EBackup, EInfo, "Writing to MIDP_PERMISSIONS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[4]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CLASS, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ACTION, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(FUNCTION_GROUP, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(MIDP_PERMISSIONS_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 6: Midp function group settings table + { + LOG(EBackup, EInfo, "MIDP_FUNC_GRP_SETTINGS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[5]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(FUNCTION_GROUP, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ALLOWED_SETTINGS, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CURRENT_SETTING, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(BLANKET_PROMPT, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(MIDP_FUNC_GRP_SETTINGS_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 7: push registration table + { + LOG(EBackup, EInfo, "Writing to PUSH_REGISTRATIONS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[6]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(URL, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(FILTER, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(REGISTRATION_TYPE, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(PUSH_REGISTRATIONS_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 8: alarm registration table + { + LOG(EBackup, EInfo, "Writing to ALARM_REGISTRATIONS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[7]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ALARM_TIME, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(ALARM_REGISTRATIONS_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + + // table 9: runtime settings table + { + LOG(EBackup, EInfo, "Writing to RUNTIME_SETTINGS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[8]; rowNumber++) + { + attribute.setEntry(EXTENSIONS, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(RUNTIME_SETTINGS_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 10: pre-install table + { + LOG(EBackup, EInfo, "Writing to PREINSTALL_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[9]; rowNumber++) + { + attribute.setEntry(NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VENDOR, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VERSION, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(INSTALL_STATE, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(PREINSTALL_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + ILOG(EBackup, "Data written to JAVA_DATABASE; So Commit the transaction and close the database"); + ILOG(EBackup, "Committing the transaction"); + + try + { + js->commitTransaction(); + ILOG(EBackup, "Transaction committed successfully"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Committing the transaction failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + ILOG(EBackup, "Close the database"); + + // close the JAVA_DATABASE + js->close(); + + + // table 11: ota status table + /* stored in another database called javaotadatabase. + so open a new connection to that database */ + + { + ILOG(EBackup, "Create instance of JAVA_OTA_DATABASE_NAME and open the database"); + auto_ptr jos(JavaStorage::createInstance()); + + try + { + jos->open(JAVA_OTA_DATABASE_NAME); + ILOG(EBackup, "Opening database succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Opening database failed: %S", jse.toString().c_str()); + return KErrGeneral; + } + + ILOG(EBackup, "Start a transaction for writing to this database"); + + try + { + jos->startTransaction(); + ILOG(EBackup, "Transaction started"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "startTransaction() failed: %S", jse.toString().c_str()); + jos->close(); + return KErrGeneral; + } + + ILOG(EBackup, "Before writing data to this database, existing data must be cleared"); + + try + { + JavaStorageApplicationEntry_t emptyEntry; + jos->remove(OTA_STATUS_TABLE, emptyEntry); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Removing data from OTA database failed: %S", jse.toString().c_str()); + jos->close(); + return KErrGeneral; + } + + LOG(EBackup, EInfo, "Writing to OTA_STATUS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[10]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CREATION_TIME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(TYPE, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(OTA_CODE, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(URL, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(LATEST_RETRY_TIME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(RETRY_COUNT, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + jos->write(OTA_STATUS_TABLE, insertEntry); + LOG(EBackup, EInfo, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + jos->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + + ILOG(EBackup, "Data written to JAVA_OTA_DATABASE; commit the transaction and close the database"); + ILOG(EBackup, "Committing the transaction"); + + try + { + jos->commitTransaction(); + LOG(EBackup, EInfo, "Transaction committed successfully"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Committing the transaction failed: %S", jse.toString().c_str()); + jos->close(); + return KErrGeneral; + } + + LOG(EBackup, EInfo, "Close the database"); + + // close the OTA_DATABASE + jos->close(); + } + + LOG(EBackup, EInfo, "Data written to Storage"); + return KErrNone; +} + + +int CStorageBackupUtil::FillVectorwithAppPackageTableData(JavaStorageApplicationList_t& foundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = foundEntries.begin(); applications != foundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(PACKAGE_NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VENDOR, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VERSION, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ROOT_PATH, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(MEDIA_ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(INITIAL_SIZE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(JAD_PATH, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(JAR_PATH, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(JAD_URL, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(JAR_URL, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ACCESS_POINT, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CONTENT_INFO, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CONTENT_ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithAppTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(PACKAGE_ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(MAIN_CLASS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(AUTORUN, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithAppPackageAttTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VALUE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(TRUSTED, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithMidpPackageTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(TYPE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(SECURITY_DOMAIN, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(SECURITY_DOMAIN_CATEGORY, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(HASH, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CERT_HASH, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(RMS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VALID_CERTS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ON_SCREEN_KEYPAD, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(SECURITY_WARNINGS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithMidpPermTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CLASS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ACTION, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(FUNCTION_GROUP, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithMidpFuncGrpSetTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(FUNCTION_GROUP, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ALLOWED_SETTINGS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CURRENT_SETTING, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(BLANKET_PROMPT, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithPushRegTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(URL, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(FILTER, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(REGISTRATION_TYPE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithAlarmRegTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ALARM_TIME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithRuntimeSetTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(EXTENSIONS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithPreinstallTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VENDOR, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VERSION, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(INSTALL_STATE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithOtaStatusTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CREATION_TIME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(TYPE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(OTA_CODE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(URL, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(LATEST_RETRY_TIME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(RETRY_COUNT, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,404 @@ +/* +* 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: Header file for CStorageBackupUtil class +* +*/ + + +#ifndef JAVASTORAGEBACKUPUTIL_H +#define JAVASTORAGEBACKUPUTIL_H + +#include +#include + +#include +#include +#include + +#include "javastorageentry.h" +#include "javastorage.h" +#include "javastoragenames.h" + +#define NUMBER_OF_TABLES 11 + +class RDesWriteStream; +class RDesReadStream; + +namespace java +{ +namespace backup +{ + + +/** +-------------------------------------------------------------------------------- + +* CStorageBackupUtil class is handling backup and restore of Java Storage data +* This class is instantiated when a BUR operation is starting. + +Example Data that could be present in JavaStorage which is backed up and restored by this class. + +Application Package Data +ID | PACKAGE_NAME | VENDOR | VERSION | ROOT_PATH | MEDIA_ID | INITIAL_SIZE | JAD_PATH | JAR_PATH | JAD_URL | JAR_URL | ACCESS_POINT | CONTENT_INFO | CONTENT_ID +788463512 | HelloWorld? | Nokia | 1.1 | \C\Private\102033E6\MIDlets\[101e59d8] | 123456 | 200 | \C\Private\102033E6\MIDlets\[101e59d8]\HelloWorld.jad | \C\Private\102033E6\MIDlets\[101e59d8]\HelloWorld.jar | http://getjar.com/MyGreatApp.jad | http://getjar.com/MyGreatApp2.jar | IAP:2 | 0 | 78d78sd89f789 + + +Application Data +ID | PACKAGE_ID | NAME | MAIN_CLASS | AUTORUN +788463616 | 788463512 | HelloWorld | HelloWorld | 0 + + +Application Package Attributes Data +ID | NAME | VALUE | TRUSTED +788463512 | MIDlet-Name | HelloWorld | 00 +788463512 | MIDlet-Version | 1.0 | 10 +788463512 | MIDlet-Vendor | Nokia | 10 + + +MIDP Application Package Data +ID | TYPE | SECURITY_DOMAIN | HASH | CERT_HASH | RMS | VALID_CERTS | ON_SCREEN_KEYPAD +788463512 | MIDletSuite? | Trusted | 123456789 | 123456789 | \C\Private\102033E6\MIDlets\[101e59d8]\RMSdata.bin | 1,3,5 | 0 + + +MIDP Permissions Data +ID | CLASS | NAME | ACTION | FUNCTION_GROUP +788463616 | javax.microedition.io.HttpProtocolPermission | http://server/index.html | read | HTTP + + +MIDP Function Group Settings Data +ID | FUNCTION_GROUP | ALLOWED_SETTINGS | CURRENT_SETTING | BLANKET_PROMPT +788463616 | HTTP | 111 (e.g. BLANKET, SESSION, ONESHOT) | 001 (ONESHOT) | 0 + +The allowed settings could be a an encoded integer based on the binary representation of 3 bits (e.g. 100 if only BLANKET is allowed, 011 if SESSION and ONESHOT are allowed). + + +MIDP Push Registrations Data +ID | URL | NAME | FILTER | REGISTRATION_TYPE +788463616 | sip:*;type=""application/test"", SIPPushReceiver? | SIPPushReceiver? | * | 1 +788463616 | btspp://localhost:99999999999999999999999999999999;*;authenticated;blacklist=00E001234567 | BTPushReceiver? | * | 0 + + +MIDP Alarm Push Registrations Data +ID | ALARM_TIME +788463616 | 2008-09-13;15:20:30 + + +MIDP Runtime Settings Data +EXTENSIONS +\C\Private\102033E6\Extenstions\12345678\Location.jar + + +Preinstall Data +NAME | VENDOR | VERSION | INSTALL_STATE +TestMIDletSuite | TestVendor | 1.2.3 | 2 + + +MIDP OTA Status Data table +ID | CREATION_TIME | TYPE | OTA_CODE | URL | LATEST_RETRY_TIME | RETRY_COUNT +788463616 | 2008-09-13;12:20:30 | 1 | 900 | http://www.moo.com/MIDLETS.js | 2008-09-13;15:20:30 | 2 + +----------------------------------------------------------------------------------------------------------------------------- +*/ + +class CStorageBackupUtil : public CBase +{ +public: + + /** + * Instantiates an object of this type + */ + static CStorageBackupUtil* NewL(); + + ~CStorageBackupUtil(); + + /** + * This method requests a section of Java Storage data. + * Called by the function GetBackupDataSectionL from midp2backupplugin + * The data is filled into the stream till it is full. + * The data returned may be base or incremental depending + * on the type of backup and the capability of the data owner. + * + * @param aBuffer a pointer to the base of the location where data + * can be copied. + * @param aBackupNotFinished on return EFalse if all data has + * been returned for this drive, else ETrue. + */ + void BackupStorageDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft); + + /** + * This method receives a section of base restore data. + * Stores the restore data in the vector so that it can be + * written to Java Storage when all data have come. + * + * @param stream holds the restore data + * @param aRestoreState EFirstBuffer if all data has been returned + * for this drive, else remains at EStorage. + * @param aBufferSpaceLeft the space left in the buffer + */ + void RestoreStorageDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft); + +private: + + // Default constructor for the class + + CStorageBackupUtil(); + + // Second phase constructor function + + void ConstructL(); + + /** + * This method fills the vector with Java Storage data. + * Data is read from JavaStorage tables and put inside the vector + * which will later be put into the buffer stream. + * The reason for having vector to store the data is that connection to + * Java Storage cannot be open for a long period of time + * ie writing into buffer stream's time + * + * @return returns an integer value telling whether the operation + * was completed successfully or not. + */ + int FillVectorWithStorageData(); + + /** + * A utility function which converts a wstring into a TDesC + * and writes it into the stream. + * + * @param stream an RDesWriteStream into which the converted + * string is written + * @param tempString the wstring which is to be converted. + */ + void WriteStringtoStreamL(RDesWriteStream& aStream, std::wstring aTempString); + + /** + * A utility function which reads a TDesC from the stream, converts it + * to a wstring and writes it into the vector. + * + * @param stream an RDesReadStream from which the TDesC data is read + */ + void ReadStringfromStreamL(RDesReadStream& aStream); + + /** + * This method writes the data to storage. + * Gets called after FillVectorsWithStreamDataL() function is called. + * This function opens a transaction to Storage and writes + * the vector's data into storage row-by-row, and then commits + * the transaction. + * + * @return returns an integer specifying whether the operation + * has completed successfully or not. + */ + int WriteDataToStorage(); +public: + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only APPLICATION_PACKAGE_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithAppPackageTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only APPLICATION_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithAppTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only APPLICATION_PACKAGE_ATTRIBUTES_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithAppPackageAttTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only MIDP_PACKAGE_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithMidpPackageTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only MIDP_PERMISSIONS_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithMidpPermTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only MIDP_FUNCTION_GROUP_SETTINGS_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithMidpFuncGrpSetTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only PUSH_REGISTRATION_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithPushRegTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only ALARM_REGISTRATION_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithAlarmRegTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only RUNTIME_SETTINGS_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithRuntimeSetTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only PREINSTALL_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithPreinstallTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only OTA_STATUS_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithOtaStatusTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Prints the vectors + */ + void printVector(); + +private: + + /** + * The actual wstring vector which holds the data during a B&R operation. + * During a backup, this vector is filled with storage data and then + * written to the stream. + * During a restore, this vector is filled with data from the stream + * before it is written to storage. + * Own + */ + std::vector< std::wstring > iStringVector; + + /** + * An integer which holds the length of the string. + * When only half the data is read from the stream, this holds the + * length of the remaining data which is to be read. + * Own + */ + int iLenOfString; + + /** + * An integer which holds the count of the number of strings + * in the vector. Used during a B&R operation. + * Own + */ + int iStrCount; + + /** + * An integer array which holds the number of rows of each table + * present in storage. + * This information is written to stream and is used when the + * restored data is written back to storage. + * Own + */ + int iTableSize[NUMBER_OF_TABLES]; + + /** + * A Boolean value which says if a string was only + * half read during a previous iteration. + * Own + */ + TBool iRemainingString; + + /** + * A wstring which holds the half read string so that the + * completed string can be appended to it during the next iteration + * before it is put into the vector. + * Own + */ + std::wstring iHalfReadString; + + /** + * Shows if it's the fill call to backup storage data. + * Vectors filled only at the first call. + * Own + */ + TBool iFirstCalltoBackupStorageData; + + /** + * Shows if it's the fill call to restore storage data. + * Own + */ + TBool iFirstCalltoRestoreStorageData; + + /** + * Shows the remaining number of bytes available in the stream. + * Own + */ + int iBufferSpaceLeft; +}; + +} // namespace backup +} // namespace java + +#endif // JAVASTORAGEBACKUPUTIL_H diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,150 @@ +/* +* 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: Implementation of JavaVersionBackupUtil +* +*/ + + +#include +#include "javaversionbackuputil.h" +#include "logger.h" + + +#include +#include + +#define KOMJIdentifier 0x20000F3D + +using namespace Java; +using namespace java::backup; + +// ======== MEMBER FUNCTIONS ======== + +void JavaVersionBackupUtil::WriteJavaVersionL(RDesWriteStream& aStream) +{ + JELOG2(EBackup); + + // Get the Java version number from the environment API's + + TVersion version = Java::JavaEnvInfo::Version(); + + PLOG3(EBackup, "JavaEnvInfo::Version: major = %d, minor = %d, build = %d", + version.iMajor, version.iMinor, version.iBuild); + + /* Put OMJ Package UID in the front indicating that it is an + OMJ environment from which backup was taken. */ + aStream.WriteInt32L(KOMJIdentifier); + + // write the version numbers to the stream + aStream.WriteInt8L(version.iMajor); + aStream.WriteInt8L(version.iMinor); + aStream.WriteInt16L(version.iBuild); + + ILOG(EBackup, "Version information written to stream"); +} + +TUint JavaVersionBackupUtil::CheckJavaVersionL(RDesReadStream& aStream, TDriveNumber aDrive, TBool versionCheck) +{ + JELOG2(EBackup); + TInt32 omjID = 0; + if (versionCheck) + { + // Read the OMJSpecific ID only on first call + omjID = aStream.ReadInt32L(); + } + + if (omjID != KOMJIdentifier) + { + _LIT(KJavaRestoreConverterExe, "javarestoreconverter.exe"); + + RProcess rProcess; + + TChar targetDrive; + _LIT(KText , ""); + TBuf<15> commandLine(KText); + RFs session; + TInt err = session.Connect(); + if (KErrNone != err) + { + ELOG1(EBackup, + "JavaVersionBackupUtil::CheckJavaVersionL: Session Connection failed, error %d", err); + CleanupStack::PopAndDestroy(&aStream); + User::Leave(err); + } + + err = session.DriveToChar(aDrive, targetDrive); + if (KErrNone == err) + { + _LIT(KDrive, " -drive"); + commandLine.Append(KDrive); + commandLine.Append(targetDrive); + } + + err = rProcess.Create(KJavaRestoreConverterExe, commandLine); + if (KErrNone == err) + { + TRequestStatus status; + rProcess.Logon(status); + rProcess.Resume(); + + // now wait until javarestoreconverter exits + User::WaitForRequest(status); + if (status.Int() != KErrNone) + { + // Installing old JRT 1.x MIDlets to JRT 2.x failed + err = status.Int(); + ELOG1(EBackup, + "JavaVersionBackupUtil::CheckJavaVersionL: Installation failed, error %d", err); + CleanupStack::PopAndDestroy(&aStream); + User::Leave(err); + } + else + { + LOG(EBackup,EInfo, + "JavaVersionBackupUtil::CheckJavaVersionL: Installing Midlets successful"); + } + } + else + { + // Cannot even start javarestoreconverter + ELOG1(EBackup, + "JavaVersionBackupUtil::CheckJavaVersionL: Cannot start Installer, error %d", err); + CleanupStack::PopAndDestroy(&aStream); + User::Leave(err); + } + rProcess.Close(); + return 1; + + } + else + { + TInt8 major = aStream.ReadInt8L(); + TInt8 minor = aStream.ReadInt8L(); + TInt16 build = aStream.ReadInt16L(); + + TVersion version(major, minor, build); + + PLOG3(EBackup, "JavaVersion read from Stream: major = %d, minor = %d, build = %d", + version.iMajor, version.iMinor, version.iBuild); + + // read current version and compare it with the read version + TVersion curVersion = Java::JavaEnvInfo::Version(); + + PLOG3(EBackup," Current JavaVersion: major = %d, minor = %d, build = %d", + curVersion.iMajor, curVersion.iMinor, curVersion.iBuild); + return 0; + + } +} + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,83 @@ +/* +* 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: Header file for JavaVersionBackupUtil class +* +*/ + + +#ifndef JAVAVERSIONBACKUPUTIL_H +#define JAVAVERSIONBACKUPUTIL_H + +#include +#include +#include + +class RDesReadStream; +class RDesWriteStream; + +namespace java +{ +namespace backup +{ +/** + * JavaVersionBackupUtil class is used for checking the java version + * during a B&R operation. This class writes the current java version + * while backing up and then checks whether the backed up version + * is compatible with the currnet version while doing a restore. + * If it is not compatible, then the backup process is gracefully exited. + */ + +class JavaVersionBackupUtil +{ + +public: + + /** + * This method writes the current java version into the SBE buffer. + * This functions is called when a backup process is started. + * + * @param aBuffer the buffer which is sent by the SBE + */ + static void WriteJavaVersionL(RDesWriteStream& aStream); + + /** + * This method reads the java version from the stream. If there is no + * Java version or if the Java version is not compatible with the + * current version, then the restore process is exited gracefully. + * + * @param aStream an RDesReadStream on the buffer which is sent + * by the SBE + * @param aDrive current drive to be backed up + * @return status + */ + static TUint CheckJavaVersionL(RDesReadStream& aStream, TDriveNumber aDrive, TBool versionCheck); + +private: + + /** + * This method is used to compare the current java version with the + * one read from the stream. + * This method is not used presently. Logic may be added in the future + * + * @param aVersion the java version read from the stream + * @param aCurVersion the current java version + */ + void CompareL(TVersion aVersion, TVersion aCurVersion); + +}; + +} // namespace backup +} // namespace java + +#endif // JAVAVERSIONBACKUPUTIL_H diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javabackup/midp2backup_usif/src.s60/midp2backupdataids.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupdataids.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,45 @@ +/* +* 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: midp2backupdataids definition +* +*/ + +#include + +#ifndef MIDP2BACKUPDATAIDS_H +#define MIDP2BACKUPDATAIDS_H + +namespace java +{ +namespace backup +{ +/** + * State of streaming during restore + */ +enum TRestoreState +{ + EVersion = 0, + EStorage, + EAppArc, + EInIcon, + EInSize, + EInstall, + EScr +}; + +} //namespace backup +} //namespace java + + +#endif // MIDP2BACKUPDATAIDS_H diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,637 @@ +/* +* 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: Implementation of Midp2BackupPlugin +* +*/ + + +#include "midp2backupplugin.h" +#include "midp2backupdataids.h" +#include "apparcbackuputil.h" +#include "javastoragebackuputil.h" +#include "javaversionbackuputil.h" + +#include "javastoragenames.h" +#include "javastorageentry.h" +#include "javastorage.h" + +#include "javacommonutils.h" +#include "logger.h" + +#include +#include +#include +#include +#include + + +using namespace std; +using namespace java::storage; +using namespace java::backup; + +// ======== MEMBER FUNCTIONS ======== + +CMidp2BackupPlugin::CMidp2BackupPlugin() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin constructor"); +} + +void CMidp2BackupPlugin::ConstructL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ConstructL"); + + iIconDescIndex = 0; + iBufferSpaceLeft = 0; + iFirstCallToGetBackupDataSection = ETrue; + iStorageDataBackup = ETrue; + iStorageDataRestore = ETrue; + iJavaVersionInfoWritten = EFalse; + iRestoreState = EVersion; + + User::LeaveIfError(iFs.Connect()); + // to share file handles with AppArc + User::LeaveIfError(iFs.ShareProtected()); + + iStorageBackupUtil = CStorageBackupUtil::NewL(); + iAppArcUtil = CAppArcBackupUtil::NewL(iFs); +} + +CMidp2BackupPlugin* CMidp2BackupPlugin::NewL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::NewL"); + + CMidp2BackupPlugin* self = new(ELeave) CMidp2BackupPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +CMidp2BackupPlugin::~CMidp2BackupPlugin() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin destructor"); + + iFs.Close(); + iIconUidArray.Close(); + delete iAppArcUtil; + delete iIconDesc; + delete iRestoreIconDesc; + delete iStorageBackupUtil; +} + +// from base class CBackupPlugin + +void CMidp2BackupPlugin::PrepareForBURL(TInt aBackupStateValue) +{ + (void)aBackupStateValue; // Just to suppress a warning in release builds + LOG1(EBackup, EInfo, "CMidp2BackupPlugin::PrepareForBURL, BUR state: %d", aBackupStateValue); +} + +void CMidp2BackupPlugin::ReceiveSnapshotDataL(TDriveNumber /* aDrive */, TDesC8& /* aBuffer */, TBool /* aLastSection */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +TUint CMidp2BackupPlugin::GetExpectedDataSize(TDriveNumber /* aDrive */) +{ + JELOG2(EBackup); + return 0; +} + +void CMidp2BackupPlugin::GetSnapshotDataL(TDriveNumber /* aDrive */, TPtr8& /* aBuffer */, TBool& /* aFinished */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::InitialiseGetBackupDataL(TDriveNumber aDrive) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseGetBackupDataL"); + iDrive = aDrive; +} + +void CMidp2BackupPlugin::GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::GetBackupDataSectionL"); + + iBufferSpaceLeft = aBuffer.MaxLength(); + RDesWriteStream stream(aBuffer); + CleanupClosePushL(stream); + + if (!iJavaVersionInfoWritten) + { + JavaVersionBackupUtil::WriteJavaVersionL(stream); + iJavaVersionInfoWritten = ETrue; + iBufferSpaceLeft -= 8; + } + + if (iStorageDataBackup) + { + iStorageBackupUtil->BackupStorageDataL(stream, iStorageDataBackup, iBufferSpaceLeft); + aFinished = EFalse; + } + + else + { + if (iFirstCallToGetBackupDataSection) + { + LOG(EBackup, EInfo, "First Call To GetBackupDataSection"); + // Get the uids of midlets whose icons are to be backed up + iIconFilePointer = 0; + ResetIconArray(); + iAppArcUtil->GetMidletsFromAppArcL(iIconUidArray, iDrive); + + /* Streaming MMC's unique Id, if current drive is MMC + and there's at least one midlet on the drive*/ + if (iIconUidArray.Count() > 0 && iDrive >= EDriveE && iDrive <= EDriveZ) + { + TUint32 mmcId = MmcIdL(); + + if (mmcId != 0) + { + LOG1(EBackup,EInfo, "Write MMC id: %u", mmcId); + stream.WriteUint32L(mmcId); + iBufferSpaceLeft -= sizeof(mmcId); + } + } + // Setting flag to EFalse + iFirstCallToGetBackupDataSection = EFalse; + } + + // Next icon uid and filename + TUid currentUid; + HBufC* fullFileName = NULL; + + // Streaming leftover part of icon file + if (iIconDescIndex) + { + LOG(EBackup, EInfo, "Streaming leftover part of icon file"); + + /* if the icon file is bigger than the space in the buffer, write only + part of it and fill iLeftover with remaining part. */ + if (iIconDesc->Size() - iIconDescIndex > iBufferSpaceLeft) + { + stream.WriteL(iIconDesc->Mid(iIconDescIndex), iBufferSpaceLeft); + iIconDescIndex += iBufferSpaceLeft; + } + else + { + stream.WriteL(iIconDesc->Mid(iIconDescIndex)); + iIconDescIndex = 0; + } + + aFinished = EFalse; + } + + // Get new icon file + else if (NextIcon(currentUid, fullFileName)) + { + LOG1(EBackup, EInfo, "New icon file, id: %d", currentUid.iUid); + + // Readstream for icon file + RFileReadStream fileStream; + + User::LeaveIfError(fileStream.Open(iFs, *fullFileName, EFileRead)); + CleanupClosePushL(fileStream); + + TEntry* entry = new(ELeave) TEntry(); + CleanupStack::PushL(entry); + + iFs.Entry(*fullFileName, *entry); + TInt32 size = entry->iSize; + + // Write icon file content into iIconDesc + LOG(EBackup, EInfo, "Write icon file content into iIconDesc"); + delete iIconDesc; + iIconDesc = NULL; + iIconDesc = HBufC8::NewL(size); + + TPtr8 buf = iIconDesc->Des(); + fileStream.ReadL(buf, size); + + // get the group name of the midlet from AppArc + TBuf< KApaMaxAppGroupName >groupName(iAppArcUtil->GetMidletGroupName(currentUid)); + TInt groupNameSize = groupName.Size(); + + // Write the size of the data + LOG(EBackup,EInfo, "Write the size of the data"); + + TParsePtrC parse(*fullFileName); + TPtrC fileName = parse.NameAndExt(); + TInt32 fileNameSize = fileName.Size(); + + stream.WriteInt32L(sizeof(TUid) // Uid + + sizeof(TInt32) // fileNameSize + + fileNameSize // filename + + sizeof(TInt32) // number of icons + + sizeof(TInt32) // groupnamesize + + groupNameSize + + size // icon file + ); + iBufferSpaceLeft -= sizeof(TInt32); + + // Write the Uid of the midlet + LOG(EBackup, EInfo, "Write the Uid of the midlet"); + stream.WriteInt32L(currentUid.iUid); + iBufferSpaceLeft -= sizeof(TUid); + + // Write the size of the icon filename + LOG(EBackup, EInfo, "Write the size of the icon filename"); + stream.WriteInt32L(fileNameSize); + iBufferSpaceLeft -= sizeof(TInt32); + + // Write icon filename + LOG(EBackup, EInfo, "Write icon filename"); + stream.WriteL(fileName); + iBufferSpaceLeft -= fileNameSize; + + // Write number of icons in midlet + LOG(EBackup, EInfo, "Write number of icons in midlet"); + TInt iconCount; + iAppArcUtil->NumberOfOwnDefinedIcons(TUid::Uid(currentUid.iUid), iconCount); + stream.WriteInt32L(iconCount); + iBufferSpaceLeft -= sizeof(TInt32); + + // TPtr8 groupName(iAppArcUtil->GetMidletGroupName(currentUid)); + LOG(EBackup, EInfo, "Write the size of the Group name of the midlet"); + stream.WriteInt32L(groupNameSize); + iBufferSpaceLeft -= sizeof(TInt32); + + if (groupNameSize != 0) + { + LOG(EBackup, EInfo, "Write the Group name of the midlet"); + stream.WriteL(groupName); + iBufferSpaceLeft -= groupNameSize; + } + + /* if the icon file is bigger than the space in the buffer, + write only part of it and fill iLeftover with remaining part */ + LOG(EBackup, EInfo, "Write icon"); + if (size > iBufferSpaceLeft) + { + stream.WriteL(buf, iBufferSpaceLeft); + iIconDescIndex = iBufferSpaceLeft; + } + else + { + stream.WriteL(buf, size); + iIconDescIndex = 0; + } + + aFinished = EFalse; + + CleanupStack::PopAndDestroy(&fileStream); + CleanupStack::PopAndDestroy(entry); + } + + else + { + aFinished = ETrue; + iFirstCallToGetBackupDataSection = ETrue; + iStorageDataBackup = ETrue; + } + + delete fullFileName; + } + CleanupStack::PopAndDestroy(&stream); +} + + +void CMidp2BackupPlugin::InitialiseRestoreBaseDataL(TDriveNumber aDrive) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseRestoreBaseDataL"); + iDrive = aDrive; +} + +void CMidp2BackupPlugin::RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreBaseDataSectionL"); + + iBufferSpaceLeft = aBuffer.Size(); + RDesReadStream stream(aBuffer); + CleanupClosePushL(stream); + TBool versionCheck = ETrue; + + if (((iRestoreState == EVersion) || (iRestoreState == EInstall)) && iBufferSpaceLeft >= 8) + { + if (iRestoreState == EInstall) + { + versionCheck = EFalse; + } + TUint ret = JavaVersionBackupUtil::CheckJavaVersionL(stream,iDrive,versionCheck); + if (1==ret) + { + // Here set the satus to restore finished, so that control goes back to SBE & SBE calls B&R for another drive + iRestoreState = EInstall; + } + else + { + /* version information has been written to stream. + So change restore state to restore storage data */ + iRestoreState = EStorage; + } + // version information is of length 8 bytes. + iBufferSpaceLeft -= 8; + } + + if (iRestoreState == EStorage) + { + iStorageBackupUtil -> RestoreStorageDataL(stream, iRestoreState, iBufferSpaceLeft); + } + + // Only at first call + if ((iRestoreState != EStorage && iRestoreState != EVersion) && (iRestoreState != EInstall)) + { + if (iRestoreState == EAppArc) + { + // Making AppArc deregistrations + TRAPD(err, iAppArcUtil->DeregisterAppsL(iDrive)); + + if (err) + { + ELOG(EBackup, "Leave in deregistering apps"); + } + } + + // Process the data buffer for restore + ProcessBufferL(stream); + + if (aFinished) + { + // Set state to EStorage + iRestoreState = EStorage; + } + } + + aFinished = ETrue; + CleanupStack::PopAndDestroy(&stream); +} + +void CMidp2BackupPlugin::InitialiseRestoreIncrementDataL(TDriveNumber /* aDrive */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::RestoreIncrementDataSectionL(TDesC8& /* aBuffer */, TBool /* aFinished */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::RestoreComplete(TDriveNumber /* aDrive */) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreComplete"); +} + +TUint CMidp2BackupPlugin::MmcIdL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::MmcIdL()"); + + TVolumeInfo* volumeInfo = new(ELeave) TVolumeInfo(); + + TInt err = iFs.Volume(*volumeInfo, iDrive); + + if (!err) + { + TUint mmcId = volumeInfo->iUniqueID; + return mmcId; + } + else + { + return 0; + } + + +} + +void CMidp2BackupPlugin::ProcessBufferL(RDesReadStream& stream) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessBuffer()"); + + // Cycle until there's data in the buffer + while (iBufferSpaceLeft > 0) + { + switch (iRestoreState) + { + case EAppArc: + ProcessFirstBufferL(stream, iBufferSpaceLeft); + break; + + case EInIcon: + ProcessInIconL(stream, iBufferSpaceLeft); + break; + + case EInSize: + ProcessInSizeL(stream, iBufferSpaceLeft); + break; + + default: + CleanupStack::PopAndDestroy(&stream); + User::Leave(KErrNotSupported); + } + } +} + + +_LIT(KStarWildCard, "*.*"); + +void CMidp2BackupPlugin::RestoreMmcRegistryL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreMmcRegistry()"); + + /* If backed up MMC is not the same as the current MMC, copy the entries + from the directory of the backed up MMC to the directory + of the current MMC */ + TUint32 mmc = MmcIdL(); + + if (iBackupMmc != mmc) + { + // Create path to old place + TPath path_old; + CreateMmcPath(path_old, iDrive, iBackupMmc); + + // Create path to new place + TPath path_new; + CreateMmcPath(path_new, iDrive, mmc); + + // Get old files list + CFileMan* fileMan = CFileMan::NewL(iFs); + + CleanupStack::PushL(fileMan); + + // Copy to new place + iFs.MkDir(path_new); + path_old.Append(KStarWildCard); + TInt err = fileMan->Copy(path_old, path_new); + + ILOG1(EBackup, "File copy, status: %d", err); + + User::LeaveIfError(err); + + CleanupStack::PopAndDestroy(); + } +} + +_LIT(KPrivatePath, "C:\\private\\"); + +void CMidp2BackupPlugin::CreateMmcPath(TDes& aPathName, TInt aDrive, TUint aUniqueId) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::CreateMmcPath()"); + + aPathName.Zero(); + aPathName.Append(KPrivatePath); + aPathName.AppendNum(KRegistryServerUid, EHex); + aPathName.Append(KPathDelimiter); + + // append drive name + TDriveUnit driveUnit(aDrive); + aPathName.Append(driveUnit.Name().Left(1)); + aPathName.Append(KPathDelimiter); + + TUint64 id = aUniqueId; + aPathName.AppendNum(id, EHex); + aPathName.Append(KPathDelimiter); +} + +TBool CMidp2BackupPlugin::NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::NextIcon()"); + + if (iIconUidArray.Count() > iIconFilePointer) + { + aCurrentUid = iIconUidArray[iIconFilePointer]; + iAppArcUtil->GetIconFilename(iIconUidArray[iIconFilePointer], aFullFileName); + iIconFilePointer++; + return ETrue; + } + else + { + // There are no more icon files + return EFalse; + } +} + +void CMidp2BackupPlugin::ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessFirstBuffer()"); + + if (iDrive >= EDriveE && iDrive <= EDriveZ) + { + // Read MMC id and restore MMC entries if needed + iBackupMmc = aStream.ReadUint32L(); + aBufferSpaceLeft -= sizeof(iBackupMmc); + LOG1(EBackup, EInfo, "Read MMC Id: %u", iBackupMmc); + RestoreMmcRegistryL(); + } + if (aBufferSpaceLeft >= sizeof(TInt32)) + { + iIconFileSizeLeft = aStream.ReadInt32L(); + aBufferSpaceLeft -= sizeof(iIconFileSizeLeft); + iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft); + iRestoreState = EInIcon; + } + else + { + // No more data to read + aBufferSpaceLeft = 0; + } +} + +void CMidp2BackupPlugin::ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInIcon()"); + + TPtr8 restoreIconPtr = iRestoreIconDesc->Des(); + HBufC8* tempDesc = HBufC8::NewL(iIconFileSizeLeft); + CleanupStack::PushL(tempDesc); + TPtr8 tempPtr = tempDesc->Des(); + + // Icon cannot be read fully + if (iIconFileSizeLeft > aBufferSpaceLeft) + { + aStream.ReadL(tempPtr, aBufferSpaceLeft); + restoreIconPtr.Append(tempPtr); + iIconFileSizeLeft -= aBufferSpaceLeft; + aBufferSpaceLeft = 0; + iRestoreState = EInIcon; + } + // Icon can be read fully + else + { + aStream.ReadL(tempPtr, iIconFileSizeLeft); + restoreIconPtr.Append(tempPtr); + aBufferSpaceLeft -= iIconFileSizeLeft; + iRestoreState = EInSize; + + TRAPD(err, iAppArcUtil->RegisterAppL(restoreIconPtr, iDrive)); + + if (err) + { + ELOG(EBackup, "Registerin application to AppArc failed."); + } + } + + CleanupStack::PopAndDestroy(tempDesc); +} + +void CMidp2BackupPlugin::ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInSize()"); + + if (aBufferSpaceLeft >= sizeof(TInt32)) + { + if (iSizeBuffer.Size() != 0) + { + // Read leftover part of size + TInt readData = sizeof(TInt32) - iSizeBuffer.Size(); + aStream.ReadL(iSizeBuffer, readData); + RMemReadStream sizeStream(iSizeBuffer.Ptr(), 4); + CleanupClosePushL(sizeStream); + iIconFileSizeLeft = sizeStream.ReadInt32L(); + CleanupStack::PopAndDestroy(&sizeStream); + aBufferSpaceLeft -= sizeof(readData); + } + else + { + // Read size in full + iIconFileSizeLeft = aStream.ReadInt32L(); + aBufferSpaceLeft -= sizeof(iIconFileSizeLeft); + } + + delete iRestoreIconDesc; + iRestoreIconDesc = NULL; + iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft); + iRestoreState = EInIcon; + } + else + { + // Read first byte(s) of size + aStream.ReadL(iSizeBuffer, aBufferSpaceLeft); + aBufferSpaceLeft = 0; + } +} + +void CMidp2BackupPlugin::ResetIconArray() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ResetIconArray()"); + + // Remove all entries + while (iIconUidArray.Count()) + { + iIconUidArray.Remove(0); + } +} diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,412 @@ +/* +* 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: Header file for CMidp2BackupPlugin class +* +*/ + + +#ifndef MIDP2BACKUPPLUGIN_H +#define MIDP2BACKUPPLUGIN_H + +#include "backupplugin.h" +#include +#include "logger.h" + +class RDesWriteStream; +class RDesReadStream; + + + +namespace java +{ +namespace backup +{ + +class CAppArcBackupUtil; +class CJavaVersionBackupUtil; +class CStorageBackupUtil; + + + +/** + * CMidp2BackupPlugin class is handling backup and restore operations + * for MIDlets + * + * This class is instantiated when a BUR operation is starting. + */ +class CMidp2BackupPlugin : public CBackupPlugin +{ + +public: + + /** + * Instantiates an object of this type + */ + static CMidp2BackupPlugin* NewL(); + + ~CMidp2BackupPlugin(); + + + // from base class CBackupPlugin + + /** + * This method is called when a backup or restore operation is + * starting. Preparations can be done to prepare for BUR. + * + * @param aBackupStateValue the value of the current backup state + */ + void PrepareForBURL(TInt aBackupStateValue); + + /** + * This method receives all or part of a snapshot of data to allow + * calculation of an incremental backup. The snapshot is one that + * was previously supplied by the data owner. The snapshot data + * should be read from the location supplied. The snapshot data may + * be larger than the location supplied in which case the routine + * will be called repeatedly until all data has been supplied. + * + * Snapshot data will also be supplied as part of a restore operation + * + * @param aDrive the drive being backed up + * @param aBuffer a pointer to the base of the location from whence + * data can be copied. + * @param aLastSection ETrue if this is the last section of snapshot + * data, else EFalse. + */ + void ReceiveSnapshotDataL(TDriveNumber aDrive, + TDesC8& aBuffer, + TBool aLastSection); + + /** + * This method returns the expected size of backup data that will be + * supplied. If an incremental backup is underway then this method + * will not be called until after ReceiveSnapshotDataL(). + * The size data will be used for the purpose of tracking progess + * during a backup. If it is inaccurate then the user may see + * irregular progress but the actual backup data will not be + * affected so it is acceptable to return an estimated value. + * + * @param aDrive the drive being backed up. + * @return the size of the data that will be returned + */ + TUint GetExpectedDataSize(TDriveNumber aDrive); + + /** + * This method returns a snapshot of data to accompany a backup. The + * snapshot is expected to contain details on files / data being + * backed up. The format of the snapshot is only meaningful to the + * data owner. The snapshot will be supplied if the data owner is + * asked for an incremental backup and for a restore operation. The + * snapshot data should be copied to the location supplied. + * + * The snapshot data may be larger than the location supplied in + * which case the routine will be called repeatedly until all data + * has been retrieved. + * + * @param aDrive the drive being backed up + * @param aBuffer a pointer to the base of the location where data + * can be copied. + * @param aFinished on return ETrue if all data has been returned + * for this drive, else EFalse. + */ + void GetSnapshotDataL(TDriveNumber aDrive, + TPtr8& aBuffer, + TBool& aFinished); + + /** + * This method prepares the implementor to return backup data. It + * will be followed by a sequence of calls to request the actual + * data. + * + * @param aDrive the drive being backed up. + */ + void InitialiseGetBackupDataL(TDriveNumber aDrive); + + /** + * This method requests a section of backup data. + * InitialiseGetBackupDataL() will have been called previously to + * specify the drive concerned. The data returned may be base or + * incremental depending on the type of backup and the capability of + * the data owner. + * + * @param aBuffer a pointer to the base of the location where data + * can be copied. + * @param aFinished on return ETrue if all data has been returned + * for this drive, else EFalse. + */ + void GetBackupDataSectionL(TPtr8& aBuffer, + TBool& aFinished); + + /** + * This method prepares the implementor to receive base restore data + * for a drive. It will be followed by a sequence of calls to supply + * the actual data. + * + * @param aDrive the drive being restored. + */ + void InitialiseRestoreBaseDataL(TDriveNumber aDrive); + + /** + * This method receives a section of base restore data. + * InitialiseRestoreBaseDataL() will have been called previously to + * specify the drive concerned. + * + * @param aBuffer a pointer to the base of the location whence data + * can be read. + * @param aFinished ETrue if all data has been returned for this + * drive, else EFalse. + */ + void RestoreBaseDataSectionL(TDesC8& aBuffer, + TBool aFinished); + + /** + * This method prepares the implementor to receive incremental + * restore data for a drive. It will be followed by a sequence + * of calls to supply the actual data. If multiple increments + * are supplied then this methid will be called before each increment + * + * @param aDrive the drive being restored. + */ + void InitialiseRestoreIncrementDataL(TDriveNumber aDrive); + + /** + * This method receives a section of increment restore data. + * InitialiseRestoreIncrementDataL() will have been called + * previously to specify the drive concerned. + * + * @param aBuffer a pointer to the base of the location whence data + * can be read. + * @param aFinished ETrue if all data has been returned for this + * increment, else EFalse. + */ + void RestoreIncrementDataSectionL(TDesC8& aBuffer, + TBool aFinished); + + /** + * This method is called when all data to be restored has been + * supplied. + * + * @param aDrive the drive being restored. + */ + void RestoreComplete(TDriveNumber aDrive); + +private: + + CMidp2BackupPlugin(); + + void ConstructL(); + + /** + * This method is called to get the unique Id of the current MMC + * + * @return The Id of the MMC, or 0, if no MMC is inserted + */ + TUint MmcIdL(); + + /** + * This method is called to process the content of the buffer + * provided in active phase of restore + * + * @param aBuffer the buffer to process + */ + void ProcessBufferL(RDesReadStream& stream); + + /** + * This method is called to restore the Java Registry entries + * on the MMC, if needed + */ + void RestoreMmcRegistryL(); + + /** + * This method creates the path for the Java Registry entries on + * the specified MMC + * + * @param [out] aPathName path of the entries of the MMC + * @param aDrive drive of the MMC + * @param aUniqueId Unique Id of the MMC + */ + void CreateMmcPath(TDes& aPathName, + TInt aDrive, + TUint aUniqueId); + + /** + * This method gets the path for the next icon file to be backed up + * + * @param [out] aCurrentUid Uid of the next icon + * @param [out] aFullFileName path of the next icon + * @return EFalse if there are no more icons in the array, ETrue + * otherwise + */ + TBool NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName); + + /** + * Process buffer when restore state is EFirstBuffer + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + void ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Process buffer when restore state is EInIcon + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + void ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Process buffer when restore state is EInSize + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + void ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Resets the array of icons to be backed up + */ + void ResetIconArray(); + +private: // data + + /** + * File session + * Own. + */ + RFs iFs; + + /** + * AppArcBackupUtil object for AppArc operations + * Own. + */ + CAppArcBackupUtil* iAppArcUtil; + + /** + * StorageBackupUtil object for storage B&R + * Own. + */ + CStorageBackupUtil* iStorageBackupUtil; + /** + * The drive that is backed up or restored currently + * Own. + */ + TDriveNumber iDrive; + + /** + * Id of backed up drive, gets its value from restored data + * Own. + */ + TInt32 iBackupDrive; + + /** + * Id of backed up MMC, gets its value from restored data + * Own. + */ + TUint32 iBackupMmc; + + /** + * State of streaming during restore + * Own. + */ + TInt iRestoreState; + + /** + * Shows if it's the first call to GetBackupDataSectionL + * Own. + */ + TBool iFirstCallToGetBackupDataSection; + + /** + * Shows if Backup of storage data is finished or not + * Own. + */ + TBool iStorageDataBackup; + + /** + * Shows if Restore of storage data is finished or not + * Own. + */ + TBool iStorageDataRestore; + + /** + * Shows if Java version information is already written or not + * Own + */ + TBool iJavaVersionInfoWritten; + + /** + * Shows if its the first call to restore data or not. + * Own. + */ + TBool iFirstCallToRestoreBackupDataSection; + + /** + * Stores the uids of the midlets whose icons are to be backed up. + * Own. + */ + RArray iIconUidArray; + + /** + * The current index in the icon file array + * Own. + */ + TInt iIconFilePointer; + + /** + * Stores the current icon file for streaming + * This descriptor will be streamed at subsequent calls of + * GetBackupDataSectionL() + * Own. + */ + HBufC8* iIconDesc; + + /** + * Stores the current icon file being restored + * Own. + */ + HBufC8* iRestoreIconDesc; + + /** + * Size of the icon to be still read during restore + * Own. + */ + TInt32 iIconFileSizeLeft; + + /** + * Current index of iIconDesc + * Own. + */ + TInt iIconDescIndex; + + /** + * Holds the remaining bytes in the buffer + * Own + */ + + TInt iBufferSpaceLeft; + + /** + * Buffer for storing data size in restore + * Own. + */ + TBuf8<4> iSizeBuffer; +}; + + + +} //namespace backup +} //namespace java + +#endif // MIDP2BACKUPPLUGIN_H diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,490 @@ +/* +* 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: Implementation of Midp2BackupPlugin with USIF +* +*/ + +#include +#include +#include +#include +#include + +#include "midp2backuppluginusif.h" +#include "midp2backupdataids.h" +#include "javastoragebackuputil.h" +#include "javaversionbackuputil.h" +#include "javascrbackuputil.h" + +#include "javastoragenames.h" +#include "javastorageentry.h" +#include "javastorage.h" + + +#include "javacommonutils.h" +#include "logger.h" + + +using namespace std; +using namespace java::storage; +using namespace java::backup; + +// ======== MEMBER FUNCTIONS ======== + +CMidp2BackupPlugin::CMidp2BackupPlugin() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin constructor"); +} + +void CMidp2BackupPlugin::ConstructL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ConstructL"); + + iIconDescIndex = 0; + iBufferSpaceLeft = 0; + iFirstCallToGetBackupDataSection = ETrue; + iStorageDataBackup = ETrue; + iScrDataBackup = ETrue; + iStorageDataRestore = ETrue; + iJavaVersionInfoWritten = EFalse; + iRestoreState = EVersion; + + User::LeaveIfError(iFs.Connect()); + // to share file handles with AppArc + User::LeaveIfError(iFs.ShareProtected()); + + iStorageBackupUtil = CStorageBackupUtil::NewL(); + + //iAppArcUtil = CAppArcBackupUtil::NewL(iFs); + + iScrBackupUtil = CScrBackupUtil::NewL(); +} + +CMidp2BackupPlugin* CMidp2BackupPlugin::NewL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::NewL"); + + CMidp2BackupPlugin* self = new(ELeave) CMidp2BackupPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +CMidp2BackupPlugin::~CMidp2BackupPlugin() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin destructor"); + + iFs.Close(); + iIconUidArray.Close(); + //delete iAppArcUtil; + delete iIconDesc; + delete iRestoreIconDesc; + delete iStorageBackupUtil; +} + +// from base class CBackupPlugin + +void CMidp2BackupPlugin::PrepareForBURL(TInt aBackupStateValue) +{ + (void)aBackupStateValue; // Just to suppress a warning in release builds + LOG1(EBackup, EInfo, "CMidp2BackupPlugin::PrepareForBURL, BUR state: %d", aBackupStateValue); +} + +void CMidp2BackupPlugin::ReceiveSnapshotDataL(TDriveNumber /* aDrive */, TDesC8& /* aBuffer */, TBool /* aLastSection */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +TUint CMidp2BackupPlugin::GetExpectedDataSize(TDriveNumber /* aDrive */) +{ + JELOG2(EBackup); + return 0; +} + +void CMidp2BackupPlugin::GetSnapshotDataL(TDriveNumber /* aDrive */, TPtr8& /* aBuffer */, TBool& /* aFinished */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::InitialiseGetBackupDataL(TDriveNumber aDrive) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseGetBackupDataL"); + iDrive = aDrive; +} + +void CMidp2BackupPlugin::GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::GetBackupDataSectionL"); + + iBufferSpaceLeft = aBuffer.MaxLength(); + RDesWriteStream stream(aBuffer); + CleanupClosePushL(stream); + + if (!iJavaVersionInfoWritten) + { + JavaVersionBackupUtil::WriteJavaVersionL(stream); + iJavaVersionInfoWritten = ETrue; + iBufferSpaceLeft -= 8; + } + + if (iStorageDataBackup) + { + iStorageBackupUtil->BackupStorageDataL(stream, iStorageDataBackup, iBufferSpaceLeft); + aFinished = EFalse; + } + else if(iScrDataBackup) + { + iScrBackupUtil->BackupScrDataL(stream,iScrDataBackup,iBufferSpaceLeft); + aFinished = EFalse; + } + + CleanupStack::PopAndDestroy(&stream); +} + + +void CMidp2BackupPlugin::InitialiseRestoreBaseDataL(TDriveNumber aDrive) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseRestoreBaseDataL"); + iDrive = aDrive; +} + +void CMidp2BackupPlugin::RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreBaseDataSectionL"); + + iBufferSpaceLeft = aBuffer.Size(); + RDesReadStream stream(aBuffer); + CleanupClosePushL(stream); + TBool versionCheck = ETrue; + + if (((iRestoreState == EVersion) || (iRestoreState == EInstall)) && iBufferSpaceLeft >= 8) + { + if (iRestoreState == EInstall) + { + versionCheck = EFalse; + } + TUint ret = JavaVersionBackupUtil::CheckJavaVersionL(stream,iDrive,versionCheck); + if (1==ret) + { + // Here set the satus to restore finished, so that control goes back to SBE & SBE calls B&R for another drive + iRestoreState = EInstall; + } + else + { + /* version information has been written to stream. + So change restore state to restore storage data */ + iRestoreState = EStorage; + } + // version information is of length 8 bytes. + iBufferSpaceLeft -= 8; + } + + if (iRestoreState == EStorage) + { + iStorageBackupUtil -> RestoreStorageDataL(stream, iRestoreState, iBufferSpaceLeft); + } + + if(iRestoreState == EScr) + { + iScrBackupUtil->RestoreScrDataL(stream,iRestoreState,iBufferSpaceLeft); + } + // Only at first call + if ((iRestoreState != EScr && iRestoreState != EVersion) && (iRestoreState != EInstall)) + {/* + if (iRestoreState == EAppArc) + { + // Making AppArc deregistrations + TRAPD(err, iAppArcUtil->DeregisterAppsL(iDrive)); + + if (err) + { + ELOG(EBackup, "Leave in deregistering apps"); + } + } + + // Process the data buffer for restore + ProcessBufferL(stream); + + if (aFinished) + { + // Set state to EStorage + iRestoreState = EStorage; + } + */ } + + aFinished = ETrue; + CleanupStack::PopAndDestroy(&stream); +} + +void CMidp2BackupPlugin::InitialiseRestoreIncrementDataL(TDriveNumber /* aDrive */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::RestoreIncrementDataSectionL(TDesC8& /* aBuffer */, TBool /* aFinished */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::RestoreComplete(TDriveNumber /* aDrive */) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreComplete"); +} + +TUint CMidp2BackupPlugin::MmcIdL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::MmcIdL()"); + + TVolumeInfo* volumeInfo = new(ELeave) TVolumeInfo(); + + TInt err = iFs.Volume(*volumeInfo, iDrive); + + if (!err) + { + TUint mmcId = volumeInfo->iUniqueID; + return mmcId; + } + else + { + return 0; + } + + +} +/* +void CMidp2BackupPlugin::ProcessBufferL(RDesReadStream& stream) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessBuffer()"); + + // Cycle until there's data in the buffer + while (iBufferSpaceLeft > 0) + { + switch (iRestoreState) + { + case EAppArc: + ProcessFirstBufferL(stream, iBufferSpaceLeft); + break; + + case EInIcon: + ProcessInIconL(stream, iBufferSpaceLeft); + break; + + case EInSize: + ProcessInSizeL(stream, iBufferSpaceLeft); + break; + + default: + CleanupStack::PopAndDestroy(&stream); + User::Leave(KErrNotSupported); + } + } +} +*/ + +_LIT(KStarWildCard, "*.*"); + +void CMidp2BackupPlugin::RestoreMmcRegistryL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreMmcRegistry()"); + + /* If backed up MMC is not the same as the current MMC, copy the entries + from the directory of the backed up MMC to the directory + of the current MMC */ + TUint32 mmc = MmcIdL(); + + if (iBackupMmc != mmc) + { + // Create path to old place + TPath path_old; + CreateMmcPath(path_old, iDrive, iBackupMmc); + + // Create path to new place + TPath path_new; + CreateMmcPath(path_new, iDrive, mmc); + + // Get old files list + CFileMan* fileMan = CFileMan::NewL(iFs); + + CleanupStack::PushL(fileMan); + + // Copy to new place + iFs.MkDir(path_new); + path_old.Append(KStarWildCard); + TInt err = fileMan->Copy(path_old, path_new); + + ILOG1(EBackup, "File copy, status: %d", err); + + User::LeaveIfError(err); + + CleanupStack::PopAndDestroy(); + } +} + +_LIT(KPrivatePath, "C:\\private\\"); + +void CMidp2BackupPlugin::CreateMmcPath(TDes& aPathName, TInt aDrive, TUint aUniqueId) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::CreateMmcPath()"); + + aPathName.Zero(); + aPathName.Append(KPrivatePath); + aPathName.AppendNum(KRegistryServerUid, EHex); + aPathName.Append(KPathDelimiter); + + // append drive name + TDriveUnit driveUnit(aDrive); + aPathName.Append(driveUnit.Name().Left(1)); + aPathName.Append(KPathDelimiter); + + TUint64 id = aUniqueId; + aPathName.AppendNum(id, EHex); + aPathName.Append(KPathDelimiter); +} +/* +TBool CMidp2BackupPlugin::NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::NextIcon()"); + + if (iIconUidArray.Count() > iIconFilePointer) + { + aCurrentUid = iIconUidArray[iIconFilePointer]; + iAppArcUtil->GetIconFilename(iIconUidArray[iIconFilePointer], aFullFileName); + iIconFilePointer++; + return ETrue; + } + else + { + // There are no more icon files + return EFalse; + } +} + +void CMidp2BackupPlugin::ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessFirstBuffer()"); + + if (iDrive >= EDriveE && iDrive <= EDriveZ) + { + // Read MMC id and restore MMC entries if needed + iBackupMmc = aStream.ReadUint32L(); + aBufferSpaceLeft -= sizeof(iBackupMmc); + LOG1(EBackup, EInfo, "Read MMC Id: %u", iBackupMmc); + RestoreMmcRegistryL(); + } + if (aBufferSpaceLeft >= sizeof(TInt32)) + { + iIconFileSizeLeft = aStream.ReadInt32L(); + aBufferSpaceLeft -= sizeof(iIconFileSizeLeft); + iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft); + iRestoreState = EInIcon; + } + else + { + // No more data to read + aBufferSpaceLeft = 0; + } +} + +void CMidp2BackupPlugin::ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInIcon()"); + + TPtr8 restoreIconPtr = iRestoreIconDesc->Des(); + HBufC8* tempDesc = HBufC8::NewL(iIconFileSizeLeft); + CleanupStack::PushL(tempDesc); + TPtr8 tempPtr = tempDesc->Des(); + + // Icon cannot be read fully + if (iIconFileSizeLeft > aBufferSpaceLeft) + { + aStream.ReadL(tempPtr, aBufferSpaceLeft); + restoreIconPtr.Append(tempPtr); + iIconFileSizeLeft -= aBufferSpaceLeft; + aBufferSpaceLeft = 0; + iRestoreState = EInIcon; + } + // Icon can be read fully + else + { + aStream.ReadL(tempPtr, iIconFileSizeLeft); + restoreIconPtr.Append(tempPtr); + aBufferSpaceLeft -= iIconFileSizeLeft; + iRestoreState = EInSize; + + TRAPD(err, iAppArcUtil->RegisterAppL(restoreIconPtr, iDrive)); + + if (err) + { + ELOG(EBackup, "Registerin application to AppArc failed."); + } + } + + CleanupStack::PopAndDestroy(tempDesc); +} + +void CMidp2BackupPlugin::ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInSize()"); + + if (aBufferSpaceLeft >= sizeof(TInt32)) + { + if (iSizeBuffer.Size() != 0) + { + // Read leftover part of size + TInt readData = sizeof(TInt32) - iSizeBuffer.Size(); + aStream.ReadL(iSizeBuffer, readData); + RMemReadStream sizeStream(iSizeBuffer.Ptr(), 4); + CleanupClosePushL(sizeStream); + iIconFileSizeLeft = sizeStream.ReadInt32L(); + CleanupStack::PopAndDestroy(&sizeStream); + aBufferSpaceLeft -= sizeof(readData); + } + else + { + // Read size in full + iIconFileSizeLeft = aStream.ReadInt32L(); + aBufferSpaceLeft -= sizeof(iIconFileSizeLeft); + } + + delete iRestoreIconDesc; + iRestoreIconDesc = NULL; + iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft); + iRestoreState = EInIcon; + } + else + { + // Read first byte(s) of size + aStream.ReadL(iSizeBuffer, aBufferSpaceLeft); + aBufferSpaceLeft = 0; + } +} + +void CMidp2BackupPlugin::ResetIconArray() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ResetIconArray()"); + + // Remove all entries + while (iIconUidArray.Count()) + { + iIconUidArray.Remove(0); + } +} +*/ + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,411 @@ +/* +* 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: Header file for CMidp2BackupPlugin class with USIF changes +* +*/ +#ifndef MIDP2BACKUPPLUGINUSIF_H_ +#define MIDP2BACKUPPLUGINUSIF_H_ + +#include "backupplugin.h" +#include +#include "logger.h" + +class RDesWriteStream; +class RDesReadStream; + +namespace java +{ +namespace backup +{ + + +class CJavaVersionBackupUtil; +class CStorageBackupUtil; +class CScrBackupUtil; + + +/** + * CMidp2BackupPlugin class is handling backup and restore operations + * for MIDlets + * + * This class is instantiated when a BUR operation is starting. + */ +class CMidp2BackupPlugin : public CBackupPlugin +{ + +public: + + /** + * Instantiates an object of this type + */ + static CMidp2BackupPlugin* NewL(); + + ~CMidp2BackupPlugin(); + + + // from base class CBackupPlugin + + /** + * This method is called when a backup or restore operation is + * starting. Preparations can be done to prepare for BUR. + * + * @param aBackupStateValue the value of the current backup state + */ + void PrepareForBURL(TInt aBackupStateValue); + + /** + * This method receives all or part of a snapshot of data to allow + * calculation of an incremental backup. The snapshot is one that + * was previously supplied by the data owner. The snapshot data + * should be read from the location supplied. The snapshot data may + * be larger than the location supplied in which case the routine + * will be called repeatedly until all data has been supplied. + * + * Snapshot data will also be supplied as part of a restore operation + * + * @param aDrive the drive being backed up + * @param aBuffer a pointer to the base of the location from whence + * data can be copied. + * @param aLastSection ETrue if this is the last section of snapshot + * data, else EFalse. + */ + void ReceiveSnapshotDataL(TDriveNumber aDrive, + TDesC8& aBuffer, + TBool aLastSection); + + /** + * This method returns the expected size of backup data that will be + * supplied. If an incremental backup is underway then this method + * will not be called until after ReceiveSnapshotDataL(). + * The size data will be used for the purpose of tracking progess + * during a backup. If it is inaccurate then the user may see + * irregular progress but the actual backup data will not be + * affected so it is acceptable to return an estimated value. + * + * @param aDrive the drive being backed up. + * @return the size of the data that will be returned + */ + TUint GetExpectedDataSize(TDriveNumber aDrive); + + /** + * This method returns a snapshot of data to accompany a backup. The + * snapshot is expected to contain details on files / data being + * backed up. The format of the snapshot is only meaningful to the + * data owner. The snapshot will be supplied if the data owner is + * asked for an incremental backup and for a restore operation. The + * snapshot data should be copied to the location supplied. + * + * The snapshot data may be larger than the location supplied in + * which case the routine will be called repeatedly until all data + * has been retrieved. + * + * @param aDrive the drive being backed up + * @param aBuffer a pointer to the base of the location where data + * can be copied. + * @param aFinished on return ETrue if all data has been returned + * for this drive, else EFalse. + */ + void GetSnapshotDataL(TDriveNumber aDrive, + TPtr8& aBuffer, + TBool& aFinished); + + /** + * This method prepares the implementor to return backup data. It + * will be followed by a sequence of calls to request the actual + * data. + * + * @param aDrive the drive being backed up. + */ + void InitialiseGetBackupDataL(TDriveNumber aDrive); + + /** + * This method requests a section of backup data. + * InitialiseGetBackupDataL() will have been called previously to + * specify the drive concerned. The data returned may be base or + * incremental depending on the type of backup and the capability of + * the data owner. + * + * @param aBuffer a pointer to the base of the location where data + * can be copied. + * @param aFinished on return ETrue if all data has been returned + * for this drive, else EFalse. + */ + void GetBackupDataSectionL(TPtr8& aBuffer, + TBool& aFinished); + + /** + * This method prepares the implementor to receive base restore data + * for a drive. It will be followed by a sequence of calls to supply + * the actual data. + * + * @param aDrive the drive being restored. + */ + void InitialiseRestoreBaseDataL(TDriveNumber aDrive); + + /** + * This method receives a section of base restore data. + * InitialiseRestoreBaseDataL() will have been called previously to + * specify the drive concerned. + * + * @param aBuffer a pointer to the base of the location whence data + * can be read. + * @param aFinished ETrue if all data has been returned for this + * drive, else EFalse. + */ + void RestoreBaseDataSectionL(TDesC8& aBuffer, + TBool aFinished); + + /** + * This method prepares the implementor to receive incremental + * restore data for a drive. It will be followed by a sequence + * of calls to supply the actual data. If multiple increments + * are supplied then this methid will be called before each increment + * + * @param aDrive the drive being restored. + */ + void InitialiseRestoreIncrementDataL(TDriveNumber aDrive); + + /** + * This method receives a section of increment restore data. + * InitialiseRestoreIncrementDataL() will have been called + * previously to specify the drive concerned. + * + * @param aBuffer a pointer to the base of the location whence data + * can be read. + * @param aFinished ETrue if all data has been returned for this + * increment, else EFalse. + */ + void RestoreIncrementDataSectionL(TDesC8& aBuffer, + TBool aFinished); + + /** + * This method is called when all data to be restored has been + * supplied. + * + * @param aDrive the drive being restored. + */ + void RestoreComplete(TDriveNumber aDrive); + +private: + + CMidp2BackupPlugin(); + + void ConstructL(); + + /** + * This method is called to get the unique Id of the current MMC + * + * @return The Id of the MMC, or 0, if no MMC is inserted + */ + TUint MmcIdL(); + + /** + * This method is called to process the content of the buffer + * provided in active phase of restore + * + * @param aBuffer the buffer to process + */ + void ProcessBufferL(RDesReadStream& stream); + + /** + * This method is called to restore the Java Registry entries + * on the MMC, if needed + */ + void RestoreMmcRegistryL(); + + /** + * This method creates the path for the Java Registry entries on + * the specified MMC + * + * @param [out] aPathName path of the entries of the MMC + * @param aDrive drive of the MMC + * @param aUniqueId Unique Id of the MMC + */ + void CreateMmcPath(TDes& aPathName, + TInt aDrive, + TUint aUniqueId); + + /** + * This method gets the path for the next icon file to be backed up + * + * @param [out] aCurrentUid Uid of the next icon + * @param [out] aFullFileName path of the next icon + * @return EFalse if there are no more icons in the array, ETrue + * otherwise + */ + //TBool NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName); + + /** + * Process buffer when restore state is EFirstBuffer + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + // void ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Process buffer when restore state is EInIcon + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + // void ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Process buffer when restore state is EInSize + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + //void ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Resets the array of icons to be backed up + */ + //void ResetIconArray(); + +private: // data + + /** + * File session + * Own. + */ + RFs iFs; + + /** + * StorageBackupUtil object for storage B&R + * Own. + */ + CStorageBackupUtil* iStorageBackupUtil; + /** + * CScrBackupUtil object for SCR B&R + * Own. + */ + CScrBackupUtil* iScrBackupUtil; + /** + * The drive that is backed up or restored currently + * Own. + */ + TDriveNumber iDrive; + + /** + * Id of backed up drive, gets its value from restored data + * Own. + */ + TInt32 iBackupDrive; + + /** + * Id of backed up MMC, gets its value from restored data + * Own. + */ + TUint32 iBackupMmc; + + /** + * State of streaming during restore + * Own. + */ + TInt iRestoreState; + + /** + * Shows if it's the first call to GetBackupDataSectionL + * Own. + */ + TBool iFirstCallToGetBackupDataSection; + + /** + * Shows if Backup of storage data is finished or not + * Own. + */ + TBool iStorageDataBackup; + /** + * Shows if Backup of SCR is finished or not + * Own. + */ + TBool iScrDataBackup; + + /** + * Shows if Restore of storage data is finished or not + * Own. + */ + TBool iStorageDataRestore; + + /** + * Shows if Java version information is already written or not + * Own + */ + TBool iJavaVersionInfoWritten; + + /** + * Shows if its the first call to restore data or not. + * Own. + */ + TBool iFirstCallToRestoreBackupDataSection; + + /** + * Stores the uids of the midlets whose icons are to be backed up. + * Own. + */ + RArray iIconUidArray; + + /** + * The current index in the icon file array + * Own. + */ + TInt iIconFilePointer; + + /** + * Stores the current icon file for streaming + * This descriptor will be streamed at subsequent calls of + * GetBackupDataSectionL() + * Own. + */ + HBufC8* iIconDesc; + + /** + * Stores the current icon file being restored + * Own. + */ + HBufC8* iRestoreIconDesc; + + /** + * Size of the icon to be still read during restore + * Own. + */ + TInt32 iIconFileSizeLeft; + + /** + * Current index of iIconDesc + * Own. + */ + TInt iIconDescIndex; + + /** + * Holds the remaining bytes in the buffer + * Own + */ + + TInt iBufferSpaceLeft; + + /** + * Buffer for storing data size in restore + * Own. + */ + TBuf8<4> iSizeBuffer; +}; + + + +} //namespace backup +} //namespace java +#endif /* MIDP2BACKUPPLUGINUSIF_H_ */ diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javabackup/midp2backup_usif/src.s60/proxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/proxy.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,39 @@ +/* +* 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: This module contains the ECom plugin UID and mappings. +* +*/ + + +// system include files +#include +#include + +#include "midp2backupplugin.h" + + + +// Map the interface UIDs to implementation factory functions +const TImplementationProxy ImplementationTable[] = +{ + IMPLEMENTATION_PROXY_ENTRY(KBackupEcomImplUid, CMidp2BackupPlugin::NewL) +}; + +// Exported proxy for instantiation method resolution +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) +{ + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; +} + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter.pro --- a/javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter.pro Tue Jul 13 16:05:52 2010 +0100 @@ -21,6 +21,6 @@ CONFIG -= qt -LIBS += -ljavacomms -ljavastorage +LIBS += -ljavacomms -ljavastorage -lapparc -lapgrfx include(../../../../../build/omj.pri) diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/autostarter/inc/autostarter.h --- a/javamanager/javacaptain/extensionplugins/autostarter/inc/autostarter.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/autostarter/inc/autostarter.h Tue Jul 13 16:05:52 2010 +0100 @@ -52,6 +52,7 @@ virtual EventConsumerInterface* getEventConsumer(); private: + bool isMIDletPresent(const std::wstring& aUid); bool startMIDletL(const std::wstring& aUid); void checkMIDletsToBeStartedL(); diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/autostarter/src.s60/autostarter.cpp --- a/javamanager/javacaptain/extensionplugins/autostarter/src.s60/autostarter.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/autostarter/src.s60/autostarter.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -17,6 +17,7 @@ * */ +#include // for RApaLsSession #include #include #include @@ -28,6 +29,7 @@ #include "coreinterface.h" #include "javaprocessconstants.h" #include "javasymbianoslayer.h" +#include "javauid.h" #include "javauids.h" #include "logger.h" #include "preinstallerstartermessages.h" @@ -50,9 +52,9 @@ return new java::captain::AutoStarter(); } -namespace java +namespace java // codescanner::namespace { -namespace captain +namespace captain // codescanner::namespace { /** @@ -123,13 +125,6 @@ ELOG1(EJavaCaptain, "AutoStarter::checkMIDletsToBeStartedL: leaved (%d)", err); } } -/* - else if ( MESSAGE TELLS THAT NEW MIDLET HAS BEEN INSTALLED ) - { - // Auto-start the new MIDlet if it is auto-start MIDlet - } -*/ - } /** @@ -138,15 +133,13 @@ */ void AutoStarter::checkMIDletsToBeStartedL() { - - // Find all MIDlets with Nokia-MIDlet-auto-start // APPLICATION_TABLE, if (AUTORUN == AUTOSTART_TRUE) || (AUTORUN == AUTOSTART_ONCE), // call startMIDletL(ID) LOG(EJavaCaptain, EInfo, "AutoStarter::checkMIDletsToBeStartedL called"); - std::auto_ptr js(JavaStorage::createInstance()); + std::auto_ptr js(JavaStorage::createInstance()); try { js->open(JAVA_DATABASE_NAME); @@ -246,7 +239,14 @@ */ bool AutoStarter::startMIDletL(const std::wstring& aUid) { - // start MIDlet + // Try to check whether the MIDlet is present (or whether it has been + // installed to a removable media that is not present now) + if (!isMIDletPresent(aUid)) + { + return false; + } + + // Start MIDlet rtcLaunchInfo launchInfo(aUid); bool launchSuccess = mCore->getRtc()->launch(launchInfo); @@ -259,5 +259,70 @@ } +/** + * Try to check whether the MIDlet is present (or whether it has been + * installed to a removable media that is not present now) + * + * @return false if it is certain that the MIDlet is not present, true otherwise + */ +bool AutoStarter::isMIDletPresent(const std::wstring& aUid) +{ + RApaLsSession apaSession; + TInt err = apaSession.Connect(); + if (KErrNone != err) + { + // Cannot check presence from AppArc, try to start the MIDlet anyway + ELOG1(EJavaCaptain, + "AutoStarter::isMIDletPresent: RApaLsSession Connect error %d", err); + return true; + } + CleanupClosePushL(apaSession); + + TUid appUid; + Uid javaUid(aUid); + err = uidToTUid(javaUid, appUid); + if (KErrNone != err) + { + WLOG1(EJavaCaptain, + "AutoStarter::isMIDletPresent: Cannot convert %S to TUid", aUid.c_str()); + CleanupStack::PopAndDestroy(&apaSession); // apaSession + return true; + } + + TUid appTypeUid; + err = apaSession.GetAppType(appTypeUid, appUid); + if (KErrNone != err) + { + if (KErrNotFound == err) + { + // The application is not present + WLOG1(EJavaCaptain, + "AutoStarter::isMIDletPresent: trying to start MIDlet %S that is not present", + aUid.c_str()); + CleanupStack::PopAndDestroy(&apaSession); // apaSession + return false; + } + + // Cannot check presence from AppArc, try to start the MIDlet anyway + ELOG1(EJavaCaptain, + "AutoStarter::isMIDletPresent: RApaLsSession GetAppType error %d", err); + CleanupStack::PopAndDestroy(&apaSession); // apaSession + return true; + } + else if (appTypeUid.iUid != KMidletApplicationTypeUid) + { + // The application is present but it is NOT a MIDlet + WLOG1(EJavaCaptain, + "AutoStarter::isMIDletPresent: tried to start application %S that is not MIDlet", + aUid.c_str()); + CleanupStack::PopAndDestroy(&apaSession); // apaSession + return false; + } + + CleanupStack::PopAndDestroy(&apaSession); // apaSession + return true; +} + + } // namespace captain } // namespace java diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/boot/src/booteventprovider.cpp --- a/javamanager/javacaptain/extensionplugins/boot/src/booteventprovider.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/boot/src/booteventprovider.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -17,6 +17,8 @@ #include #include +#include +#include #include #include diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp --- a/javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -80,6 +80,7 @@ #endif // __SYMBIAN32__ mCore->loadExtensionPlugin("boot"); mCore->loadExtensionPlugin("mmc"); + mCore->loadExtensionPlugin("settingslistener"); } } // namespace captain diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/javasmartcardcertsunittests.mmp --- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/javasmartcardcertsunittests.mmp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/javasmartcardcertsunittests.mmp Tue Jul 13 16:05:52 2010 +0100 @@ -14,9 +14,8 @@ * Description: * */ -// #include + #include -//#include #include #include <../../../../../../inc/java_stdcpp_support_for_exe.hrh> diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp --- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp Tue Jul 13 16:05:52 2010 +0100 @@ -29,9 +29,6 @@ CAPABILITY CAP_ECOM_PLUGIN VENDORID VID_DEFAULT -systeminclude /epoc32/include -systeminclude /epoc32/include/ecom - sourcepath ../src source testsmartcardtokenplugin.cpp diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/src/101F5B72.rss --- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/src/101F5B72.rss Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/src/101F5B72.rss Tue Jul 13 16:05:52 2010 +0100 @@ -14,7 +14,7 @@ * Description: * */ -#include +#include #include // True diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/scrupdater/inc/scrupdater.h --- a/javamanager/javacaptain/extensionplugins/scrupdater/inc/scrupdater.h Wed Jun 30 15:21:28 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* 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: ScrUpdater is Java Captain Symbian plugin that updates -* presence information of Java Applications in USIF SCR -* when removable drive is added or removed to the device. -* -*/ - -#ifndef SCRUPDATER_H -#define SCRUPDATER_H - -#include -#include - -#include "javaosheaders.h" - -#include "eventconsumerinterface.h" -#include "extensionplugininterface.h" - -namespace java -{ - -namespace captain -{ - -class CoreInterface; - -OS_NONSHARABLE_CLASS(ScrUpdater) : public EventConsumerInterface, - public ExtensionPluginInterface -{ -public: - ScrUpdater(); - virtual ~ScrUpdater(); - - // PluginInterface - virtual void startPlugin(CoreInterface* aCore); - virtual void stopPlugin(); - - // EventConsumerInterface - virtual void event(const std::string& eventProvider, - java::comms::CommsMessage& aMsg); - - // ExtensionPluginInterface methods - virtual EventConsumerInterface* getEventConsumer(); - -private: - void removeScrPresencesL(driveInfo *aInfo); - void addScrPresencesL(driveInfo *aInfo); - void initializeScrPresenceInfoL(); - - Usif::RSoftwareComponentRegistry *createScrL(); - - - CoreInterface* mCore; -}; - -} // namespace captain -} // namespace java - -#endif // SCRUPDATER_H diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/scrupdater/src.s60/lookup.cpp --- a/javamanager/javacaptain/extensionplugins/scrupdater/src.s60/lookup.cpp Wed Jun 30 15:21:28 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* 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: lookup -* -*/ - -#include //For strcmp - -#include "javasymbianoslayer.h" -#include "logger.h" - -#include "extensionplugininterface.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, - "scrupdater extensionplugin findDllMethod() funcName == null"); - } - return ptr; -} diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/scrupdater/src.s60/scrupdater.cpp --- a/javamanager/javacaptain/extensionplugins/scrupdater/src.s60/scrupdater.cpp Wed Jun 30 15:21:28 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,705 +0,0 @@ -/* -* 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: ScrUpdater is Java Captain Symbian plugin that updates -* presence information of Java Applications in USIF SCR -* when removable drive is added or removed to the device. -* -*/ - -#include -#include -#include - -#include "javaprocessconstants.h" -#include "javasymbianoslayer.h" -#include "javauids.h" -#include "logger.h" -#include "coreinterface.h" -#include "booteventprovidermessages.h" -#include "mmceventprovidermessages.h" - -#include "scrupdater.h" - -// Enable notifying AppArc for USIF Phase 2. -//#define RD_JAVA_USIF_NOTIFY_APP_ARC - - -using namespace Usif; - -/** - * Return pointer to ExtensionPluginInterface implementation for this - * extension dll - */ -java::captain::ExtensionPluginInterface* getExtensionPlugin() -{ - return new java::captain::ScrUpdater(); -} - -namespace java -{ -namespace captain -{ - -using java::fileutils::driveInfo; -using java::fileutils::DriveListenerInterface; - -/** - * Empty contructor - */ -ScrUpdater::ScrUpdater() : mCore(0) -{ -} - -/** - * Empty destructor - */ -ScrUpdater::~ScrUpdater() -{ -} - -/** - * Implement PluginInterface method - */ -void ScrUpdater::startPlugin(CoreInterface* core) -{ - LOG(EJavaCaptain, EInfo, "ScrUpdater plugin started"); - - mCore = core; -} - -/** - * Implement PluginInterface method - */ -void ScrUpdater::stopPlugin() -{ - mCore = 0; -} - -/** - * Implement ExtensionPluginInterface method - */ -EventConsumerInterface* ScrUpdater::getEventConsumer() -{ - return this; -} - -/** - * Handle Java Captain events sent by Boot event provider or - * MMC event provider. - * - * Implement EventConsumerInterface method - */ -void ScrUpdater::event(const std::string& eventProvider, - java::comms::CommsMessage& aMsg) -{ - if (eventProvider == BOOT_EVENT_PROVIDER) - { - int bootType = NORMAL_BOOT_C; - getBootMessageParams(aMsg, bootType); - LOG1( - EJavaCaptain, - EInfo, - "ScrUpdater::event() boot event received (type=%d)", - bootType); - switch (bootType) - { - case IAD_BOOT_C: - case FIRST_DEVICE_BOOT_C: - case NORMAL_BOOT_C: - { - // Update presence information - TRAPD(err, initializeScrPresenceInfoL()) - if (KErrNone != err) - { - ELOG1(EJavaCaptain, "initializeScrPresenceInfoL: leaved (%d)", err); - } - } - break; - - default: - { - WLOG1(EJavaCaptain, - "DriveListenerInterface: event() unknown boot event (type=%d)", bootType); - } - break; - } - } - else if (eventProvider == MMC_EVENT_PROVIDER) - { - int operation = 0; - driveInfo di; - getMmcChangedMessageParams(aMsg, operation, di); - LOG1( - EJavaCaptain, - EInfo, - "ScrUpdater::event() mmc event received (operation=%d)", - operation); - - switch (operation) - { - case DriveListenerInterface::REMOVABLE_MEDIA_REMOVED_C: - { - // All Java applications in the removed drive are set - // to 'not present' state - TRAPD(err, removeScrPresencesL(&di)); - if (KErrNone != err) - { - ELOG1(EJavaCaptain, "removeScrPresencesL leaved (%d)", err); - } - } - break; - - case DriveListenerInterface::REMOVABLE_MEDIA_INSERTED_C: - { - // Those Java applications in the drive to where the media - // (e.g. memory card) was added are set to 'present' state - // IF the media id is correct (in other words if the same - // memory card that they have been installed to is added - // to the drive). - TRAPD(err, addScrPresencesL(&di)); - if (KErrNone != err) - { - ELOG1(EJavaCaptain, "addScrPresencesL leaved (%d)", err); - } - } - break; - } - } -} - -/** - * Set the presence state of all Java applications installed - * to the removable drive specified in aInfo to not present - */ -void ScrUpdater::removeScrPresencesL(driveInfo *aInfo) -{ - __UHEAP_MARK; - LOG1WSTR(EJavaCaptain, EInfo, - "removeScrPresencesL: driveInfo root path is %s", aInfo->iRootPath); - - RSoftwareComponentRegistry *pScr = createScrL(); - CleanupStack::PushL(pScr); - - // Get ids of all Java components in scr - RArray componentIdList; - CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); - pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); - - pScr->GetComponentIdsL(componentIdList); - CleanupStack::PopAndDestroy(pJavaSwTypeFilter); - CleanupClosePushL(componentIdList); - - // For each component check whether it has been installed - // to the removed drive - TInt nComponents = componentIdList.Count(); - TUint removedDrive = (TUint)(aInfo->iRootPath[0]); - // Now removedDrive contains the drive letter, convert it to drive number 0-25 - if ((removedDrive > 64) && (removedDrive < 91)) - { - // 'A' - 'Z' - removedDrive -= 65; - } - else if ((removedDrive > 96) && (removedDrive < 123)) - { - // 'a' - 'z' - removedDrive -= 97; - } - else - { - ELOG1WSTR(EJavaCaptain, - "removeScrPresencesL: Unexpected root path in remove drive info %s", - aInfo->iRootPath); - CleanupStack::PopAndDestroy(pScr); - return; - } - - LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, removed drive is %d", - nComponents, removedDrive); - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - // TEMP TEST - TBool fPresenceChange = EFalse; - RArray removedApps; - CleanupClosePushL(removedApps); -#endif - - for (TInt nInd = 0; nInd < nComponents; nInd++) - { - CComponentEntry *pEntry = CComponentEntry::NewLC(); - if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) - { - ELOG1(EJavaCaptain, - "removeScrPresencesL: SCR GetComponentIdsL returned id %d " - "but GetComponentL does not find it", componentIdList[nInd]); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - TInt nInstalledDrives = pEntry->InstalledDrives().Length(); - if (nInstalledDrives <= removedDrive) - { - // SCR InstalledDrives should be array of 26 elements (value 0 or 1) - ELOG2(EJavaCaptain, - "removeScrPresencesL: The length of InstalledDrives array (%d) " - "is smaller than removedDrive (%d)", nInstalledDrives, removedDrive); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]); - - if (pEntry->InstalledDrives()[removedDrive]) - { - // This component has been installed to the drive - // that has just been removed - pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); - - LOG1(EJavaCaptain, EInfo, - "removeScrPresencesL: set component %d to not present", - componentIdList[nInd]); - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - fPresenceChange = ETrue; - - // Gather the Uids of all applications that are no longer present - RArray appsInComponent; - CleanupClosePushL(appsInComponent); - pScr->GetAppUidsForComponentL( - componentIdList[nInd], appsInComponent); - for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++) - { - TApaAppUpdateInfo appInfo; - appInfo.iAppUid = appsInComponent[nInd2]; - appInfo.iAction = TApaAppUpdateInfo::EAppNotPresent; - (void)removedApps.Append(appInfo); - } - CleanupStack::PopAndDestroy(&appsInComponent); -#endif - } - - CleanupStack::PopAndDestroy(pEntry); - } - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - // Tell AppArc which applications are no longer present - while (fPresenceChange) - { - if (removedApps.Count() == 0) - { - ELOG(EJavaCaptain, "removeScrPresencesL: Uids of the removed apps are not known"); - break; - } - - RApaLsSession apaSession; - TInt err = apaSession.Connect(); - if (KErrNone != err) - { - ELOG1(EJavaCaptain, "removeScrPresencesL: Error %d when connecting AppArc", err); - break; - } - else - { - CleanupClosePushL(apaSession); - apaSession.UpdateAppListL(removedApps); - CleanupStack::PopAndDestroy(); // closes apaSession - fPresenceChange = EFalse; - } - } - - CleanupStack::PopAndDestroy(); // Close removedApps -#endif - CleanupStack::PopAndDestroy(); // Close componentIdList - CleanupStack::PopAndDestroy(pScr); - __UHEAP_MARKEND; -} - - -/** - * Set the presence state of all Java applications installed - * to the removable drive specified in aInfo to present - */ -void ScrUpdater::addScrPresencesL(driveInfo *aInfo) -{ - __UHEAP_MARK; - LOG1WSTR(EJavaCaptain, EInfo, - "addScrPresencesL: driveInfo root path is %s", aInfo->iRootPath); - - RSoftwareComponentRegistry *pScr = createScrL(); - CleanupStack::PushL(pScr); - - // Get ids of all Java components in scr - RArray componentIdList; - CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); - pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); - - pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter); - CleanupStack::PopAndDestroy(pJavaSwTypeFilter); - CleanupClosePushL(componentIdList); - - - // For each component check whether it has been installed - // to the added drive AND whether the media id is correct - // (in other words if the actual memory card where the component - // has been installed to is added to the drive). - TInt nComponents = componentIdList.Count(); - TUint addedMediaId = (TUint)(aInfo->iId); - TUint addedDrive = (TUint)(aInfo->iRootPath[0]); - // Now addedDrive contains the drive letter, convert it to drive number 0-25 - if ((addedDrive > 64) && (addedDrive < 91)) - { - // 'A' - 'Z' - addedDrive -= 65; - } - else if ((addedDrive > 96) && (addedDrive < 123)) - { - // 'a' - 'z' - addedDrive -= 97; - } - else - { - ELOG1WSTR(EJavaCaptain, - "addScrPresencesL: Unexpected root path in add drive info %s", - aInfo->iRootPath); - CleanupStack::PopAndDestroy(pScr); - return; - } - - LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, added drive is %d", - nComponents, addedDrive); - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - TBool fPresenceChange = EFalse; - RArray addedApps; - CleanupClosePushL(addedApps); -#endif - - for (TInt nInd = 0; nInd < nComponents; nInd++) - { - CComponentEntry *pEntry = CComponentEntry::NewLC(); - if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) - { - ELOG1(EJavaCaptain, - "addScrPresencesL: SCR GetComponentIdsL returned id %d " - "but GetComponentL does not find it", componentIdList[nInd]); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - // When Java Installer registers Java app to SCR it stores also - // the media id using SetComponentPropertyL(TComponentId aComponentId, - // _L("Media-Id")), TInt64 aValue); (aValue is actually 32 bit int) - CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *) - pScr->GetComponentPropertyL(componentIdList[nInd],_L("Media-Id")); - if (NULL == pMediaIdProperty) - { - ELOG1(EJavaCaptain, - "addScrPresencesL: media_id property not found for component %d", - componentIdList[nInd]); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - CleanupStack::PushL(pMediaIdProperty); - - TInt nInstalledDrives = pEntry->InstalledDrives().Length(); - if (nInstalledDrives <= addedDrive) - { - // SCR InstalledDrives should be array of 26 elements (value 0 or 1) - ELOG2(EJavaCaptain, - "addScrPresencesL: The length of InstalledDrives array (%d) " - "is smaller than addedDrive (%d)", nInstalledDrives, addedDrive); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]); - - if (pEntry->InstalledDrives()[addedDrive]) - { - // This component has been installed to the drive - // that has just been added. - // Now check whether the media id of the added media - // is OK for this component. - if (addedMediaId == pMediaIdProperty->IntValue()) - { - pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue); - - LOG1(EJavaCaptain, EInfo, - "addScrPresencesL: set component %d to present", - componentIdList[nInd]); - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - fPresenceChange = ETrue; - - // Gather the Uids of all 'new' applications that are now present - RArray appsInComponent; - CleanupClosePushL(appsInComponent); - pScr->GetAppUidsForComponentL( - componentIdList[nInd], appsInComponent); - for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++) - { - TApaAppUpdateInfo appInfo; - appInfo.iAppUid = appsInComponent[nInd2]; - appInfo.iAction = TApaAppUpdateInfo::EAppPresent; - (void)addedApps.Append(appInfo); - } - CleanupStack::PopAndDestroy(&appsInComponent); -#endif - } - } - - CleanupStack::PopAndDestroy(pMediaIdProperty); - CleanupStack::PopAndDestroy(pEntry); - } - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - // Tell AppArc which 'new' applications are now present - while (fPresenceChange) - { - if (addedApps.Count() == 0) - { - ELOG(EJavaCaptain, "addScrPresencesL: Uids of the 'new' apps are not known"); - break; - } - - RApaLsSession apaSession; - TInt err = apaSession.Connect(); - if (KErrNone != err) - { - ELOG1(EJavaCaptain, "addScrPresencesL: Error %d when connecting AppArc", err); - break; - } - else - { - CleanupClosePushL(apaSession); - apaSession.UpdateAppListL(addedApps); - CleanupStack::PopAndDestroy(); // closes apaSession - fPresenceChange = EFalse; - } - } - - CleanupStack::PopAndDestroy(); // Close addedApps -#endif - CleanupStack::PopAndDestroy(); // Close componentIdList - CleanupStack::PopAndDestroy(pScr); - __UHEAP_MARKEND; -} - - -/** - * Loop through all removable drives and get the media id of - * the memory card or other removable media in the drive and update - * presence information of all Java applications installed - * to removable drives accordingly. - */ -void ScrUpdater::initializeScrPresenceInfoL() -{ - __UHEAP_MARK; - RFs fs; - User::LeaveIfError(fs.Connect()); - CleanupClosePushL(fs); - - // Which drives are present and what is the media id of - // each removable volume - TInt err = KErrNone; - TInt err2 = KErrNone; - TBool drivePresent[EDriveZ + 1]; - TUint driveMediaId[EDriveZ + 1]; - TVolumeInfo volumeInfo; - TDriveInfo driveInfo; - - for (TInt nInd = EDriveA; nInd < EDriveZ; nInd++) - { - err = fs.Volume(volumeInfo, nInd); - if (KErrNone == err) - { - drivePresent[nInd] = ETrue; - driveMediaId[nInd] = volumeInfo.iUniqueID; - // If the media is not removable, media id is not checked - err2 = fs.Drive(driveInfo, nInd); - if (KErrNone != err2) - { - ELOG1(EJavaCaptain, - "initializeScrPresenceInfoL: error (%d) when trying to get drive info", - err2); - User::Leave(err2); - } - else - { - if (!(driveInfo.iDriveAtt & KDriveAttRemovable)) - { - driveMediaId[nInd] = 0; - } - } - } - else if (KErrNotReady == err) - { - // no volume in this drive - drivePresent[nInd] = EFalse; - driveMediaId[nInd] = 0; - } - else - { - ELOG1(EJavaCaptain, - "initializeScrPresenceInfoL: error (%d) when trying to get volume info", - err); - User::Leave(err); - } - } - CleanupStack::PopAndDestroy(); // close RFs - - - RSoftwareComponentRegistry *pScr = createScrL(); - CleanupStack::PushL(pScr); - - // Get ids of all Java components in scr - RArray componentIdList; - CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); - pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); - - pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter); - CleanupStack::PopAndDestroy(pJavaSwTypeFilter); - CleanupClosePushL(componentIdList); - - // For each component check whether the drive it has been installed - // to is present AND whether the media id is correct - TInt nComponents = componentIdList.Count(); - - LOG1(EJavaCaptain, EInfo, "initializeScrPresenceInfoL: Number of Java components is %d", - nComponents); - - for (TInt nInd = 0; nInd < nComponents; nInd++) - { - CComponentEntry *pEntry = CComponentEntry::NewLC(); - if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) - { - ELOG1(EJavaCaptain, - "initializeScrPresenceInfoL: SCR GetComponentIdsL returned id %d " - "but GetComponentL does not find it", componentIdList[nInd]); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *) - pScr->GetComponentPropertyL(componentIdList[nInd],_L("Media-Id")); - if (NULL == pMediaIdProperty) - { - ELOG1(EJavaCaptain, - "initializeScrPresenceInfoL: media_id property not found for component %d", - componentIdList[nInd]); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - CleanupStack::PushL(pMediaIdProperty); - - TInt nInstalledDrives = pEntry->InstalledDrives().Length(); - if (nInstalledDrives > (EDriveZ + 1)) - { - WLOG2(EJavaCaptain, - "initializeScrPresenceInfoL: too big (%d) installed drives array for " - "component %d", nInstalledDrives, componentIdList[nInd]); - nInstalledDrives = EDriveZ; - } - // When Java components are installed, only one installed drive - // and corresponding media id are registered. - TInt installationDrive = -1; - - for (TInt driveNumber = EDriveA; driveNumber < nInstalledDrives; driveNumber++) - { - if (pEntry->InstalledDrives()[driveNumber]) - { - installationDrive = driveNumber; - break; - } - } - - if (installationDrive == -1) - { - ELOG1(EJavaCaptain, - "initializeScrPresenceInfoL: component (id %d) did not have installed drive info", - componentIdList[nInd]); - CleanupStack::PopAndDestroy(pMediaIdProperty); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - if (drivePresent[installationDrive]) - { - // Check also the media id - if (driveMediaId[installationDrive] == pMediaIdProperty->IntValue()) - { - LOG1(EJavaCaptain, EInfo, - "initializeScrPresenceInfoL: set component %d to present", - componentIdList[nInd]); - - pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue); - } - else - { - LOG1(EJavaCaptain, EInfo, - "initializeScrPresenceInfoL: set component %d to NOT present", - componentIdList[nInd]); - - pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); - } - } - else - { - LOG1(EJavaCaptain, EInfo, - "initializeScrPresenceInfoL: set component %d to NOT present", - componentIdList[nInd]); - - // drive is not present -> Java component installed to that - // drive is not present - pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); - } - - CleanupStack::PopAndDestroy(pMediaIdProperty); - CleanupStack::PopAndDestroy(pEntry); - } - - CleanupStack::PopAndDestroy(); // Close componentIdList - CleanupStack::PopAndDestroy(pScr); // Also closes RSoftwareComponentRegistry - - __UHEAP_MARKEND; -} - - -/** - * Creates an instance of RSoftwareComponentRegistry and connects to it. - */ -RSoftwareComponentRegistry *ScrUpdater::createScrL() -{ - RSoftwareComponentRegistry *pScr = new RSoftwareComponentRegistry; - if (NULL == pScr) - { - ELOG(EJavaInstaller, - "CreateScrL: Creating RSoftwareComponentRegistry failed"); - User::Leave(KErrGeneral); - } - TInt err = pScr->Connect(); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "CreateScrL: Connecting to RSoftwareComponentRegistry failed, error %d", - err); - delete pScr; - User::Leave(err); - } - - return pScr; -} - - -} // namespace captain -} // namespace java diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/scrupdater/src/lookup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/scrupdater/src/lookup.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,45 @@ +/* +* 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: lookup +* +*/ + +#include //For strcmp + +#include "javasymbianoslayer.h" +#include "logger.h" + +#include "extensionplugininterface.h" + +using namespace java::captain; + +ExtensionPluginInterface* getExtensionPlugin(); + +EXPORT_C FuncPtr findDllMethod(const char* funcName) +{ + FuncPtr ptr = 0; + if (funcName) + { + if (strcmp(funcName, "getExtensionPlugin") == 0) + { + ptr = (FuncPtr)getExtensionPlugin; + } + } + else + { + ELOG(EJavaCaptain, + "scrupdater extensionplugin findDllMethod() funcName == null"); + } + return ptr; +} diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,666 @@ +/* +* 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: ScrUpdater is Java Captain Symbian plugin that updates +* presence information of Java Applications in USIF SCR +* when removable drive is added or removed to the device. +* +*/ + +#include +#include +#include + +#include "javaprocessconstants.h" +#include "javasymbianoslayer.h" +#include "javauids.h" +#include "logger.h" +#include "coreinterface.h" +#include "booteventprovidermessages.h" +#include "mmceventprovidermessages.h" + +#include "scrupdater.h" + +using namespace Usif; + +_LIT(KMediaId, "Media-Id"); + +/** + * Return pointer to ExtensionPluginInterface implementation for this + * extension dll + */ +java::captain::ExtensionPluginInterface* getExtensionPlugin() +{ + return new java::captain::ScrUpdater(); +} + +namespace java // codescanner::namespace +{ +namespace captain // codescanner::namespace +{ + +using java::fileutils::driveInfo; +using java::fileutils::DriveListenerInterface; + +/** + * Empty contructor + */ +ScrUpdater::ScrUpdater() +{ +} + +/** + * Empty destructor + */ +ScrUpdater::~ScrUpdater() +{ +} + +/** + * Implement PluginInterface method + */ +void ScrUpdater::startPlugin(CoreInterface* /* aCore */) +{ + LOG(EJavaCaptain, EInfo, "ScrUpdater plugin started"); +} + +/** + * Implement PluginInterface method + */ +void ScrUpdater::stopPlugin() +{ +} + +/** + * Implement ExtensionPluginInterface method + */ +EventConsumerInterface* ScrUpdater::getEventConsumer() +{ + return this; +} + +/** + * Handle Java Captain events sent by Boot event provider or + * MMC event provider. + * + * Implement EventConsumerInterface method + */ +void ScrUpdater::event(const std::string& aEventProvider, + java::comms::CommsMessage& aMsg) +{ + if (aEventProvider == BOOT_EVENT_PROVIDER) + { + int bootType = NORMAL_BOOT_C; + getBootMessageParams(aMsg, bootType); + LOG1( + EJavaCaptain, + EInfo, + "ScrUpdater::event() boot event received (type=%d)", + bootType); + switch (bootType) + { + case IAD_BOOT_C: + case FIRST_DEVICE_BOOT_C: + case NORMAL_BOOT_C: + { + // Update presence information + TRAPD(err, initializeScrPresenceInfoL()) + if (KErrNone != err) + { + ELOG1(EJavaCaptain, "initializeScrPresenceInfoL: leaved (%d)", err); + } + } + break; + + default: + { + WLOG1(EJavaCaptain, + "DriveListenerInterface: event() unknown boot event (type=%d)", bootType); + } + break; + } + } + else if (aEventProvider == MMC_EVENT_PROVIDER) + { + int operation = 0; + driveInfo di; + getMmcChangedMessageParams(aMsg, operation, di); + LOG1( + EJavaCaptain, + EInfo, + "ScrUpdater::event() mmc event received (operation=%d)", + operation); + + switch (operation) + { + case DriveListenerInterface::REMOVABLE_MEDIA_REMOVED_C: + { + // All Java applications in the removed drive are set + // to 'not present' state + TRAPD(err, removeScrPresencesL(&di)); + if (KErrNone != err) + { + ELOG1(EJavaCaptain, "removeScrPresencesL leaved (%d)", err); + } + } + break; + + case DriveListenerInterface::REMOVABLE_MEDIA_INSERTED_C: + { + // Those Java applications in the drive to where the media + // (e.g. memory card) was added are set to 'present' state + // IF the media id is correct (in other words if the same + // memory card that they have been installed to is added + // to the drive). + TRAPD(err, addScrPresencesL(&di)); + if (KErrNone != err) + { + ELOG1(EJavaCaptain, "addScrPresencesL leaved (%d)", err); + } + } + break; + } + } +} + +/** + * Set the presence state of all Java applications installed + * to the removable drive specified in aInfo to not present + */ +void ScrUpdater::removeScrPresencesL(driveInfo *aInfo) +{ + __UHEAP_MARK; + LOG1WSTR(EJavaCaptain, EInfo, + "removeScrPresencesL: driveInfo root path is %s", aInfo->iRootPath); + + RSoftwareComponentRegistry *pScr = createScrL(); + CleanupStack::PushL(pScr); + + // Get ids of all Java components in scr + RArray componentIdList; + CleanupClosePushL(componentIdList); + + CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); + pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); + + pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter); + CleanupStack::PopAndDestroy(pJavaSwTypeFilter); + + // For each component check whether it has been installed + // to the removed drive + TInt nComponents = componentIdList.Count(); + TUint removedDrive = (TUint)(aInfo->iRootPath[0]); + // Now removedDrive contains the drive letter, convert it to drive number 0-25 + if ((removedDrive > 64) && (removedDrive < 91)) // codescanner::magicnumbers + { + // 'A' - 'Z' + removedDrive -= 65; // codescanner::magicnumbers + } + else if ((removedDrive > 96) && (removedDrive < 123)) // codescanner::magicnumbers + { + // 'a' - 'z' + removedDrive -= 97; // codescanner::magicnumbers + } + else + { + ELOG1WSTR(EJavaCaptain, + "removeScrPresencesL: Unexpected root path in remove drive info %s", + aInfo->iRootPath); + CleanupStack::PopAndDestroy(pScr); + return; + } + + LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, removed drive is %d", + nComponents, removedDrive); + + RArray removedApps; + CleanupClosePushL(removedApps); + + for (TInt nInd = 0; nInd < nComponents; nInd++) + { + CComponentEntry *pEntry = CComponentEntry::NewLC(); + if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) + { + ELOG1(EJavaCaptain, + "removeScrPresencesL: SCR GetComponentIdsL returned id %d " + "but GetComponentL does not find it", componentIdList[nInd]); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + TInt nInstalledDrives = pEntry->InstalledDrives().Length(); + if (nInstalledDrives <= removedDrive) + { + // SCR InstalledDrives should be array of 26 elements (value 0 or 1) + ELOG2(EJavaCaptain, + "removeScrPresencesL: The length of InstalledDrives array (%d) " + "is smaller than removedDrive (%d)", nInstalledDrives, removedDrive); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]); + + if (pEntry->InstalledDrives()[removedDrive]) + { + // This component has been installed to the drive + // that has just been removed + pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); + + LOG1(EJavaCaptain, EInfo, + "removeScrPresencesL: set component %d to not present", + componentIdList[nInd]); + + // Gather the Uids of all applications that are no longer present + RArray appsInComponent; + CleanupClosePushL(appsInComponent); + pScr->GetAppUidsForComponentL( + componentIdList[nInd], appsInComponent); + for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++) + { + TApaAppUpdateInfo appInfo; + appInfo.iAppUid = appsInComponent[nInd2]; + appInfo.iAction = TApaAppUpdateInfo::EAppNotPresent; + removedApps.AppendL(appInfo); + } + CleanupStack::PopAndDestroy(&appsInComponent); + } + + CleanupStack::PopAndDestroy(pEntry); + } + + // Tell AppArc which applications are no longer present + if (removedApps.Count() > 0) + { + RApaLsSession apaSession; + TInt err = apaSession.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaCaptain, "removeScrPresencesL: Error %d when connecting AppArc", err); + } + else + { + CleanupClosePushL(apaSession); + apaSession.UpdateAppListL(removedApps); + CleanupStack::PopAndDestroy(); // closes apaSession + } + } + + CleanupStack::PopAndDestroy(); // Close removedApps + CleanupStack::PopAndDestroy(); // Close componentIdList + CleanupStack::PopAndDestroy(pScr); + __UHEAP_MARKEND; +} + + +/** + * Set the presence state of all Java applications installed + * to the removable drive specified in aInfo to present + */ +void ScrUpdater::addScrPresencesL(driveInfo *aInfo) +{ + __UHEAP_MARK; + LOG1WSTR(EJavaCaptain, EInfo, + "addScrPresencesL: driveInfo root path is %s", aInfo->iRootPath); + + RSoftwareComponentRegistry *pScr = createScrL(); + CleanupStack::PushL(pScr); + + // Get ids of all Java components in scr + RArray componentIdList; + CleanupClosePushL(componentIdList); + + CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); + pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); + + pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter); + CleanupStack::PopAndDestroy(pJavaSwTypeFilter); + + // For each component check whether it has been installed + // to the added drive AND whether the media id is correct + // (in other words if the actual memory card where the component + // has been installed to is added to the drive). + TInt nComponents = componentIdList.Count(); + TUint addedMediaId = (TUint)(aInfo->iId); + TUint addedDrive = (TUint)(aInfo->iRootPath[0]); + // Now addedDrive contains the drive letter, convert it to drive number 0-25 + if ((addedDrive > 64) && (addedDrive < 91)) // codescanner::magicnumbers + { + // 'A' - 'Z' + addedDrive -= 65; // codescanner::magicnumbers + } + else if ((addedDrive > 96) && (addedDrive < 123)) // codescanner::magicnumbers + { + // 'a' - 'z' + addedDrive -= 97; // codescanner::magicnumbers + } + else + { + ELOG1WSTR(EJavaCaptain, + "addScrPresencesL: Unexpected root path in add drive info %s", + aInfo->iRootPath); + CleanupStack::PopAndDestroy(pScr); + return; + } + + LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, added drive is %d", + nComponents, addedDrive); + + RArray addedApps; + CleanupClosePushL(addedApps); + + for (TInt nInd = 0; nInd < nComponents; nInd++) + { + CComponentEntry *pEntry = CComponentEntry::NewLC(); + if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) + { + ELOG1(EJavaCaptain, + "addScrPresencesL: SCR GetComponentIdsL returned id %d " + "but GetComponentL does not find it", componentIdList[nInd]); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + // When Java Installer registers Java app to SCR it stores also + // the media id using SetComponentPropertyL(TComponentId aComponentId, + // _L("Media-Id"), TInt64 aValue); (aValue is actually 32 bit int) + CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *) + pScr->GetComponentPropertyL(componentIdList[nInd], KMediaId); + if (NULL == pMediaIdProperty) + { + ELOG1(EJavaCaptain, + "addScrPresencesL: media_id property not found for component %d", + componentIdList[nInd]); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + CleanupStack::PushL(pMediaIdProperty); + + TInt nInstalledDrives = pEntry->InstalledDrives().Length(); + if (nInstalledDrives <= addedDrive) + { + // SCR InstalledDrives should be array of 26 elements (value 0 or 1) + ELOG2(EJavaCaptain, + "addScrPresencesL: The length of InstalledDrives array (%d) " + "is smaller than addedDrive (%d)", nInstalledDrives, addedDrive); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]); + + if (pEntry->InstalledDrives()[addedDrive]) + { + // This component has been installed to the drive + // that has just been added. + // Now check whether the media id of the added media + // is OK for this component. + if (addedMediaId == pMediaIdProperty->IntValue()) + { + pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue); + + LOG1(EJavaCaptain, EInfo, + "addScrPresencesL: set component %d to present", + componentIdList[nInd]); + + // Gather the Uids of all 'new' applications that are now present + RArray appsInComponent; + CleanupClosePushL(appsInComponent); + pScr->GetAppUidsForComponentL( + componentIdList[nInd], appsInComponent); + for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++) + { + TApaAppUpdateInfo appInfo; + appInfo.iAppUid = appsInComponent[nInd2]; + appInfo.iAction = TApaAppUpdateInfo::EAppPresent; + addedApps.AppendL(appInfo); + } + CleanupStack::PopAndDestroy(&appsInComponent); + } + } + + CleanupStack::PopAndDestroy(pMediaIdProperty); + CleanupStack::PopAndDestroy(pEntry); + } + + // Tell AppArc which 'new' applications are now present + if (addedApps.Count() > 0) + { + RApaLsSession apaSession; + TInt err = apaSession.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaCaptain, "addScrPresencesL: Error %d when connecting AppArc", err); + } + else + { + CleanupClosePushL(apaSession); + apaSession.UpdateAppListL(addedApps); + CleanupStack::PopAndDestroy(); // closes apaSession + } + } + + CleanupStack::PopAndDestroy(); // Close addedApps + CleanupStack::PopAndDestroy(); // Close componentIdList + CleanupStack::PopAndDestroy(pScr); + __UHEAP_MARKEND; +} + + +/** + * Loop through all removable drives and get the media id of + * the memory card or other removable media in the drive and update + * presence information of all Java applications installed + * to removable drives accordingly. + */ +void ScrUpdater::initializeScrPresenceInfoL() +{ + __UHEAP_MARK; + RFs fs; // codescanner::rfs + User::LeaveIfError(fs.Connect()); + CleanupClosePushL(fs); + + // Which drives are present and what is the media id of + // each removable volume + TInt err = KErrNone; + TInt err2 = KErrNone; + TBool drivePresent[EDriveZ + 1]; + TUint driveMediaId[EDriveZ + 1]; + TVolumeInfo volumeInfo; + TDriveInfo driveInfo; + + for (TInt nInd = EDriveA; nInd < EDriveZ; nInd++) + { + err = fs.Volume(volumeInfo, nInd); + if (KErrNone == err) + { + drivePresent[nInd] = ETrue; // codescanner::accessArrayElementWithoutCheck2 + driveMediaId[nInd] = volumeInfo.iUniqueID; // codescanner::accessArrayElementWithoutCheck2 + // If the media is not removable, media id is not checked + err2 = fs.Drive(driveInfo, nInd); + if (KErrNone != err2) + { + ELOG1(EJavaCaptain, + "initializeScrPresenceInfoL: error (%d) when trying to get drive info", + err2); + User::Leave(err2); + } + else + { + if (!(driveInfo.iDriveAtt & KDriveAttRemovable)) + { + driveMediaId[nInd] = 0; // codescanner::accessArrayElementWithoutCheck2 + } + } + } + else if (KErrNotReady == err) + { + // no volume in this drive + drivePresent[nInd] = EFalse; // codescanner::accessArrayElementWithoutCheck2 + driveMediaId[nInd] = 0; // codescanner::accessArrayElementWithoutCheck2 + } + else + { + ELOG1(EJavaCaptain, + "initializeScrPresenceInfoL: error (%d) when trying to get volume info", + err); + User::Leave(err); + } + } + CleanupStack::PopAndDestroy(); // close RFs + + + RSoftwareComponentRegistry *pScr = createScrL(); + CleanupStack::PushL(pScr); + + // Get ids of all Java components in scr + RArray componentIdList; + CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); + pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); + + pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter); + CleanupStack::PopAndDestroy(pJavaSwTypeFilter); + CleanupClosePushL(componentIdList); + + // For each component check whether the drive it has been installed + // to is present AND whether the media id is correct + TInt nComponents = componentIdList.Count(); + + LOG1(EJavaCaptain, EInfo, "initializeScrPresenceInfoL: Number of Java components is %d", + nComponents); + + for (TInt nInd = 0; nInd < nComponents; nInd++) + { + CComponentEntry *pEntry = CComponentEntry::NewLC(); + if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) + { + ELOG1(EJavaCaptain, + "initializeScrPresenceInfoL: SCR GetComponentIdsL returned id %d " + "but GetComponentL does not find it", componentIdList[nInd]); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *) + pScr->GetComponentPropertyL(componentIdList[nInd], KMediaId); + if (NULL == pMediaIdProperty) + { + ELOG1(EJavaCaptain, + "initializeScrPresenceInfoL: media_id property not found for component %d", + componentIdList[nInd]); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + CleanupStack::PushL(pMediaIdProperty); + + TInt nInstalledDrives = pEntry->InstalledDrives().Length(); + if (nInstalledDrives > (EDriveZ + 1)) + { + WLOG2(EJavaCaptain, + "initializeScrPresenceInfoL: too big (%d) installed drives array for " + "component %d", nInstalledDrives, componentIdList[nInd]); + nInstalledDrives = EDriveZ; + } + // When Java components are installed, only one installed drive + // and corresponding media id are registered. + TInt installationDrive = -1; + + for (TInt driveNumber = EDriveA; driveNumber < nInstalledDrives; driveNumber++) + { + if (pEntry->InstalledDrives()[driveNumber]) + { + installationDrive = driveNumber; + break; + } + } + + if (installationDrive == -1) + { + ELOG1(EJavaCaptain, + "initializeScrPresenceInfoL: component (id %d) did not have installed drive info", + componentIdList[nInd]); + CleanupStack::PopAndDestroy(pMediaIdProperty); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + if (drivePresent[installationDrive]) // codescanner::accessArrayElementWithoutCheck2 + { + // Check also the media id + if (driveMediaId[installationDrive] == pMediaIdProperty->IntValue()) // codescanner::accessArrayElementWithoutCheck2 + { + LOG1(EJavaCaptain, EInfo, + "initializeScrPresenceInfoL: set component %d to present", + componentIdList[nInd]); + + pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue); + } + else + { + LOG1(EJavaCaptain, EInfo, + "initializeScrPresenceInfoL: set component %d to NOT present", + componentIdList[nInd]); + + pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); + } + } + else + { + LOG1(EJavaCaptain, EInfo, + "initializeScrPresenceInfoL: set component %d to NOT present", + componentIdList[nInd]); + + // drive is not present -> Java component installed to that + // drive is not present + pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); + } + + CleanupStack::PopAndDestroy(pMediaIdProperty); + CleanupStack::PopAndDestroy(pEntry); + } + + CleanupStack::PopAndDestroy(); // Close componentIdList + CleanupStack::PopAndDestroy(pScr); // Also closes RSoftwareComponentRegistry + + __UHEAP_MARKEND; +} + + +/** + * Creates an instance of RSoftwareComponentRegistry and connects to it. + */ +RSoftwareComponentRegistry *ScrUpdater::createScrL() +{ + RSoftwareComponentRegistry *pScr = new RSoftwareComponentRegistry; // codescanner::nonleavenew + if (NULL == pScr) + { + ELOG(EJavaInstaller, + "CreateScrL: Creating RSoftwareComponentRegistry failed"); + User::Leave(KErrGeneral); + } + TInt err = pScr->Connect(); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "CreateScrL: Connecting to RSoftwareComponentRegistry failed, error %d", + err); + delete pScr; + User::Leave(err); + } + + return pScr; +} + + +} // namespace captain +} // namespace java diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,68 @@ +/* +* 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: ScrUpdater is Java Captain Symbian plugin that updates +* presence information of Java Applications in USIF SCR +* when removable drive is added or removed to the device. +* +*/ + +#ifndef SCRUPDATER_H +#define SCRUPDATER_H + +#include +#include + +#include "javaosheaders.h" + +#include "eventconsumerinterface.h" +#include "extensionplugininterface.h" + +namespace java // codescanner::namespace +{ + +namespace captain // codescanner::namespace +{ + +class CoreInterface; + +OS_NONSHARABLE_CLASS(ScrUpdater) : public EventConsumerInterface, + public ExtensionPluginInterface +{ +public: + ScrUpdater(); + virtual ~ScrUpdater(); + + // PluginInterface + virtual void startPlugin(CoreInterface* aCore); + virtual void stopPlugin(); + + // EventConsumerInterface + virtual void event(const std::string& aEventProvider, + java::comms::CommsMessage& aMsg); + + // ExtensionPluginInterface methods + virtual EventConsumerInterface* getEventConsumer(); + +private: + void removeScrPresencesL(driveInfo *aInfo); + void addScrPresencesL(driveInfo *aInfo); + void initializeScrPresenceInfoL(); + + Usif::RSoftwareComponentRegistry *createScrL(); +}; + +} // namespace captain +} // namespace java + +#endif // SCRUPDATER_H diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/build/bwins/javacaptain_ext_settingslisteneru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/bwins/javacaptain_ext_settingslisteneru.def Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?findDllMethod@@YAP6APAXXZPBD@Z @ 1 NONAME ; void * (*)(void) findDllMethod(char const *) + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/build/eabi/javacaptain_ext_settingslisteneru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/eabi/javacaptain_ext_settingslisteneru.def Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z13findDllMethodPKc @ 1 NONAME + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/build/exports.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/exports.inf Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,19 @@ +/* +* 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: +* +*/ + +PRJ_EXPORTS +../inc/settingschangeeventsprovidermessages.h |../../../inc/settingschangeeventsprovidermessages.h diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,35 @@ +# +# 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_settingslistener +CONFIG += omj stl +CONFIG -= qt + +symbian { + SOURCES += ../src/*.cpp ../src.s60/*.cpp + LIBS += -lcommonengine \ + -lcentralrepository \ + -lcenrepnotifhandler \ + -ljavacomms +} + +!symbian { + SOURCES += ../src/*.cpp ../src.linux/*.cpp +} + + +include(../../../../../build/omj.pri) diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/inc/settingschangeeventsprovidermessages.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/inc/settingschangeeventsprovidermessages.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,69 @@ +/* +* 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: BootEventProviderMessages +* +*/ + +#ifndef SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H +#define SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H + +#include "commsmessage.h" +#include "logger.h" + +namespace java +{ +namespace captain +{ + +using namespace java::util; +using namespace java::comms; + +const int SETTINGS_CHANGE_EVENT_MESSAGE_ID_C = 1; + +const char* const SETTINGS_CHANGE_EVENT_PROVIDER = "settingslistener"; + +typedef enum +{ + UNDEFINED_CHANGE = 0x00, + MIDP_CLASS_PATH_CHANGE = 0x01, + +} SettingsChangeEventType_t; + + +inline void setSettingsChangeEventMessageParams(CommsMessage& aMessage, + const int& aChangeEventType) +{ + aMessage.setMessageId(SETTINGS_CHANGE_EVENT_MESSAGE_ID_C); + aMessage << aChangeEventType; +} + +inline void getSettingsChangeEventMessageParams(CommsMessage& aMessage, + int& aChangeEventType) +{ + if (aMessage.getMessageId() == SETTINGS_CHANGE_EVENT_MESSAGE_ID_C) + { + aMessage >> aChangeEventType; + } + else + { + ELOG2(EJavaCaptain, "Received Settings Change Event with wrong MessageId!: %d should be %d", + aMessage.getMessageId(), SETTINGS_CHANGE_EVENT_MESSAGE_ID_C); + aChangeEventType = 0; + } +} + +} // namespace captain +} // namespace java + +#endif // SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/inc/settingslistenerextension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/inc/settingslistenerextension.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,56 @@ +/* +* 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: Sample +* +*/ + +#ifndef SETTINGSLISTENEREXTENSION_H +#define SETTINGSLISTENEREXTENSION_H + +#include "javaosheaders.h" + +#include "extensionplugininterface.h" +#include "settingslistenerinterface.h" + +using namespace java::comms; + +namespace java +{ +namespace captain +{ + +class CoreInterface; + +OS_NONSHARABLE_CLASS(SettingsListenerExtension) : public ExtensionPluginInterface +{ +public: + SettingsListenerExtension(); + virtual ~SettingsListenerExtension(); + + // ExtensionPluginInterface + virtual void startPlugin(CoreInterface* aCore); + virtual void stopPlugin(); + +protected: + +private: + CoreInterface* mCore; // resource not owned + SettingsListenerInterface* mSettingsListenerImpl; // resource owned +}; + +} // namespace captain +} // namespace java + +#endif // SETTINGSLISTENEREXTENSION_H + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/inc/settingslistenerinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/inc/settingslistenerinterface.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,43 @@ +/* +* 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: ExtensionPluginInterface +* +*/ + +#ifndef SETTINGSLISTENERINTERFACE_H +#define SETTINGSLISTENERINTERFACE_H + +namespace java +{ + +namespace captain +{ + +class CoreInterface; + +class SettingsListenerInterface +{ +public: + virtual ~SettingsListenerInterface() {} + + virtual void StartListening() = 0; + virtual void StopListening() = 0; + +}; + +} // namespace captain +} // namespace java + +#endif // SETTINGSLISTENERINTERFACE_H + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/src.s60/cenreplistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/cenreplistener.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,182 @@ +/* +* 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: +* +*/ + +#include "coreinterface.h" +#include "eventconsumerinterface.h" + +#include "logger.h" +#include "cenreplistener.h" +#include "settingschangeeventsprovidermessages.h" + +#include +#include + +namespace java +{ +namespace captain +{ + + // General listener used as a base value indicating that whole repository is being + // listened instead of individual key. + CenRepListener::CenRepListener() : mKeyType(CenRepListener::GENERAL_LISTENER) + { + JELOG2(EJavaCaptain); + } + + CenRepListener::~CenRepListener() + { + JELOG2(EJavaCaptain); + Close(); + } + + void CenRepListener::Close() + { + JELOG2(EJavaCaptain); + if (mNotifyHandler ) { + mNotifyHandler->StopListening(); + delete mNotifyHandler; + mNotifyHandler = 0; + } + if ( mCenRepSession ) { + delete mCenRepSession; + mCenRepSession = 0; + } + } + + CenRepListener* CenRepListener::NewLC(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType) + { + JELOG2(EJavaCaptain); + CenRepListener* crListener = new (ELeave) CenRepListener(); + CleanupStack::PushL(crListener); + crListener->ConstructL(aCore, aRepoId, aKeyId, aKeyType); + return (crListener); + } + + CenRepListener* CenRepListener::NewL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType) + { + JELOG2(EJavaCaptain); + CenRepListener* crListener = CenRepListener::NewLC(aCore, aRepoId, aKeyId, aKeyType); + CleanupStack::Pop(crListener); + return (crListener); + } + + CenRepListener* CenRepListener::NewLC(CoreInterface* aCore, TUid aRepoId) + { + JELOG2(EJavaCaptain); + CenRepListener* crListener = new (ELeave) CenRepListener(); + CleanupStack::PushL(crListener); + crListener->ConstructL(aCore, aRepoId); + return (crListener); + } + + CenRepListener* CenRepListener::NewL(CoreInterface* aCore, TUid aRepoId) + { + JELOG2(EJavaCaptain); + CenRepListener* crListener = CenRepListener::NewLC(aCore, aRepoId); + CleanupStack::Pop(crListener); + return (crListener); + } + + void CenRepListener::ConstructL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType) + { + JELOG2(EJavaCaptain); + mCore = aCore; + mRepoId = aRepoId; + mKeyType = aKeyType; + mCenRepSession = CRepository::NewL(mRepoId); + mNotifyHandler = CCenRepNotifyHandler::NewL(*this, *mCenRepSession, + aKeyType, aKeyId); + mNotifyHandler->StartListeningL(); + } + + void CenRepListener::ConstructL(CoreInterface* aCore, TUid aRepoId) + { + JELOG2(EJavaCaptain); + mCore = aCore; + mRepoId = aRepoId; + mCenRepSession = CRepository::NewL(mRepoId); + mNotifyHandler = CCenRepNotifyHandler::NewL(*this, *mCenRepSession); + mNotifyHandler->StartListeningL(); + } + + void CenRepListener::HandleNotifyInt(TUint32 aKeyId, TInt /*aNewValue*/) + { + JELOG2(EJavaCaptain); + WLOG1(EJavaCaptain, "Change in Unrecognised cenrep TInt key noticed! " + "CR Key= %0x", aKeyId); + } + + void CenRepListener::HandleNotifyReal( TUint32 aKeyId, TReal /*aNewValue*/ ) + { + JELOG2(EJavaCaptain); + WLOG1(EJavaCaptain, "Change in Unrecognised cenrep TReal key noticed! " + "CR Key= %0x", aKeyId); + } + + void CenRepListener::HandleNotifyBinary( TUint32 aKeyId, const TDesC8& /*aNewValue*/ ) + { + JELOG2(EJavaCaptain); + WLOG1(EJavaCaptain, "Change in Unrecognised cenrep Binary key noticed! " + "CR Key= %0x", aKeyId); + } + + void CenRepListener::HandleNotifyGeneric(TUint32 aKeyId) + { + JELOG2(EJavaCaptain); + WLOG1(EJavaCaptain, "Change in Unrecognised cenrep key noticed! " + "CR Key= %0x", aKeyId); + } + + void CenRepListener::HandleNotifyString( TUint32 aKeyId, const TDesC16& /*aNewValue*/ ) + { + JELOG2(EJavaCaptain); + if ( KCRUidJavaRuntime == mRepoId && KJavaRuntimeMIDPClasspath == aKeyId ) { + ILOG(EJavaCaptain, "CenRepListener::HandleNotifyString: change notified " + "in key KJavaRuntimeMIDPClasspath"); + dispatchEvent(SETTINGS_CHANGE_EVENT_PROVIDER, + MIDP_CLASS_PATH_CHANGE); + } else { + WLOG1(EJavaCaptain, "Change in Unrecognised cenrep string key noticed! " + "CR Key= %0x", aKeyId); + } + } + + void CenRepListener::HandleNotifyError(TUint32 aKeyId, TInt error, CCenRepNotifyHandler* /* aHandler */) + { + JELOG2(EJavaCaptain); + ELOG2(EJavaCaptain, "Error (code: %d) occured when listening changes on " + "Cenrep key (Key ID: %0x). Listening stopped!", error, aKeyId); + Close(); + } + + void CenRepListener::dispatchEvent(const std::string& aEvent, + const SettingsChangeEventType_t& aType) const + { + JELOG2(EJavaCaptain); + ILOG2(EJavaCaptain, "CenRepListener::dispatchEvent: dispatching event=%s " + "type=%d", aEvent.c_str(), aType); + CommsMessage eventMsg; + setSettingsChangeEventMessageParams(eventMsg, aType); + mCore->getEventDispatcher()->event(aEvent, eventMsg); + } + +} // namespace captain +} // namespace java + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/src.s60/cenreplistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/cenreplistener.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,94 @@ +/* +* 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: Class is used for listening changes in various Symbian Central +* repository keys. +* +*/ + +#ifndef CENREP_LISTENER_H +#define CENREP_LISTENER_H + +#include "javaosheaders.h" +#include "settingschangeeventsprovidermessages.h" + +#include +#include + +namespace java +{ +namespace captain +{ + +/** + * Java Runtime environment Central Repository UID + */ +const TUid KCRUidJavaRuntime = { 0x10282DFD }; + +/** + * Indicates classpath for MIDP runtimes. This key value is generated + * from the values defined by extension libraries. + */ +const TUint32 KJavaRuntimeMIDPClasspath = 0x00000001; + + +class CoreInterface; + +OS_NONSHARABLE_CLASS(CenRepListener) : +public CBase, public MCenRepNotifyHandlerCallback +{ +public: + enum TListenerType {GENERAL_LISTENER = -1}; + + static CenRepListener* NewLC(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType); + static CenRepListener* NewL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType); + static CenRepListener* NewLC(CoreInterface* aCore, TUid aRepoId); + static CenRepListener* NewL(CoreInterface* aCore, TUid aRepoId); + + virtual ~CenRepListener(); + + // MCenRepNotifyHandlerCallback + // These handler methods must know what to do in each case, i.e + // how to handle the change in each particular key. + virtual void HandleNotifyString( TUint32 aKeyId, const TDesC16& aNewValue ); + virtual void HandleNotifyInt(TUint32 aKeyId, TInt aNewValue); + virtual void HandleNotifyReal( TUint32 aId, TReal aNewValue ); + virtual void HandleNotifyBinary( TUint32 aId, const TDesC8& aNewValue ); + virtual void HandleNotifyGeneric(TUint32 aKeyId); + virtual void HandleNotifyError(TUint32 aKeyId, TInt error, + CCenRepNotifyHandler* aHandler); +protected: + CenRepListener(); + + void dispatchEvent(const std::string& aEvent, + const SettingsChangeEventType_t& aType) const; + +private: + void ConstructL(CoreInterface* aCore, TUid aRepoId); + void ConstructL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType); + void Close(); + TInt mKeyType; + CoreInterface* mCore; + TUid mRepoId; + CCenRepNotifyHandler* mNotifyHandler; + CRepository* mCenRepSession; +}; + +} // namespace captain +} // namespace java + +#endif // CENREP_LISTENER_H + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/src.s60/lookup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/lookup.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,45 @@ +/* +* 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: lookup +* +*/ + +#include //For strcmp + +#include "javasymbianoslayer.h" +#include "logger.h" + +#include "extensionplugininterface.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, "settingslistener extensionplugin findDllMethod() funcName == null"); + } + return ptr; +} diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/src.s60/settingslistenerimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/settingslistenerimpl.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,98 @@ +/* +* 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: +* +*/ + +#include "settingslistenerimpl.h" +#include "cenreplistener.h" +#include "logger.h" + +namespace java +{ +namespace captain +{ + + SettingsListenerImpl::SettingsListenerImpl(CoreInterface* aCore) : + mCore(aCore) + { + JELOG2(EJavaCaptain); + + } + + SettingsListenerImpl::~SettingsListenerImpl() + { + JELOG2(EJavaCaptain); + cleanUp(); + } + + void SettingsListenerImpl::StartListening() + { + JELOG2(EJavaCaptain); + // All "listeners" must be created&started here. + + // Currently there is just this one CenRep key to be listened + std::auto_ptr cRMidpClassPathChangeListener; + int error = createCenRepKeyListener(KCRUidJavaRuntime, KJavaRuntimeMIDPClasspath, + CCenRepNotifyHandler::EStringKey, + cRMidpClassPathChangeListener); + if ( KErrNone == error ) { + mCenRepListeners.push_back(cRMidpClassPathChangeListener.release()); + } else { + ELOG4(EJavaCaptain, "Error (code: %d) occured when starting " + "CenRepListener (repo=%0x, key=%0x, keytype=%d)", + error, KCRUidJavaRuntime.iUid, KJavaRuntimeMIDPClasspath, + CCenRepNotifyHandler::EStringKey); + } + } + + void SettingsListenerImpl::StopListening() + { + JELOG2(EJavaCaptain); + cleanUp(); + } + + int SettingsListenerImpl::createCenRepKeyListener(TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType, + std::auto_ptr& aListener) + { + JELOG2(EJavaCaptain); + TRAPD( error, aListener.reset(CenRepListener::NewL(mCore, aRepoId, aKeyId, aKeyType)) ); + return error; + } + + int SettingsListenerImpl::createCenRepListener(TUid aRepoId, CenRepListener*& aListener) + { + JELOG2(EJavaCaptain); + TRAPD( error, aListener = CenRepListener::NewL(mCore, aRepoId)); + return error; + } + + // Clean up owned resources + void SettingsListenerImpl::cleanUp() + { + JELOG2(EJavaCaptain); + + for ( crListeners_t::iterator listenersIter = mCenRepListeners.begin(); + listenersIter != mCenRepListeners.end(); ++listenersIter ) + { + delete *listenersIter; + *listenersIter = 0; + } + mCenRepListeners.clear(); + } + +} // namespace captain +} // namespace java + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/src.s60/settingslistenerimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/settingslistenerimpl.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,66 @@ +/* +* 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: Platform specific component which manages all the listeners +* listening changes in system configuration. Currently only Central +* Repository listening is supported. +* +*/ + +#ifndef SETTINGSLISTENERIMPL_H +#define SETTINGSLISTENERIMPL_H + +#include "javaosheaders.h" + +#include "settingslistenerinterface.h" + +#include +#include +#include + +namespace java +{ +namespace captain +{ + +class CoreInterface; +class CenRepListener; + +OS_NONSHARABLE_CLASS(SettingsListenerImpl) : public SettingsListenerInterface +{ +public: + SettingsListenerImpl(CoreInterface* aCore); + virtual ~SettingsListenerImpl(); + + // SystemSettingsChangeListenerInterface + virtual void StartListening(); + virtual void StopListening(); + +private: + void cleanUp(); + int createCenRepKeyListener(TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType, + std::auto_ptr& aListener); + int createCenRepListener(TUid aRepoId, CenRepListener*& aListener); + + CoreInterface* mCore; // resource not owned + typedef std::vector crListeners_t; + crListeners_t mCenRepListeners; // listeners are owned resources. + +}; + +} // namespace captain +} // namespace java + +#endif // SETTINGSLISTENERIMPL_H + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/extensionplugins/settingslistener/src/settingslistenerextension.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src/settingslistenerextension.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,80 @@ +/* +* 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: Sample +* +*/ + +#include "logger.h" + +#include "settingslistenerextension.h" +#include "settingslistenerimpl.h" + +#ifdef __SYMBIAN32__ +java::captain::ExtensionPluginInterface* getExtensionPlugin() +{ +#else +extern "C" java::captain::ExtensionPluginInterface* getExtensionPlugin() +{ +#endif + return new java::captain::SettingsListenerExtension(); +} + +namespace java +{ +namespace captain +{ + + SettingsListenerExtension::SettingsListenerExtension() : mCore(0), mSettingsListenerImpl(0) +{ + JELOG2(EJavaCaptain); + ILOG(EJavaCaptain, "SettingsListenerExtension::SettingsListenerExtension()"); +} + +SettingsListenerExtension::~SettingsListenerExtension() +{ + JELOG2(EJavaCaptain); + ILOG(EJavaCaptain, "SettingsListenerExtension::~SettingsListenerExtension()"); +} + +void SettingsListenerExtension::startPlugin(CoreInterface* core) +{ + JELOG2(EJavaCaptain); + ILOG(EJavaCaptain, "SettingsListenerExtension::startPlugin()"); + if ( mSettingsListenerImpl || mCore ) + { + WLOG(EJavaCaptain, "Settingslistener plugin already running, terminating previous instance first!"); + stopPlugin(); + } + mCore = core; + mSettingsListenerImpl = new SettingsListenerImpl(mCore); + mSettingsListenerImpl->StartListening(); +} + +void SettingsListenerExtension::stopPlugin() +{ + JELOG2(EJavaCaptain); + ILOG(EJavaCaptain, "SettingsListenerExtension::stopPlugin()"); + mCore = 0; + if ( mSettingsListenerImpl ) + { + mSettingsListenerImpl->StopListening(); + delete mSettingsListenerImpl; + mSettingsListenerImpl = 0; + } +} + + +} // namespace captain +} // namespace java + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/inc/settingschangeeventsprovidermessages.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/inc/settingschangeeventsprovidermessages.h Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,69 @@ +/* +* 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: BootEventProviderMessages +* +*/ + +#ifndef SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H +#define SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H + +#include "commsmessage.h" +#include "logger.h" + +namespace java +{ +namespace captain +{ + +using namespace java::util; +using namespace java::comms; + +const int SETTINGS_CHANGE_EVENT_MESSAGE_ID_C = 1; + +const char* const SETTINGS_CHANGE_EVENT_PROVIDER = "settingslistener"; + +typedef enum +{ + UNDEFINED_CHANGE = 0x00, + MIDP_CLASS_PATH_CHANGE = 0x01, + +} SettingsChangeEventType_t; + + +inline void setSettingsChangeEventMessageParams(CommsMessage& aMessage, + const int& aChangeEventType) +{ + aMessage.setMessageId(SETTINGS_CHANGE_EVENT_MESSAGE_ID_C); + aMessage << aChangeEventType; +} + +inline void getSettingsChangeEventMessageParams(CommsMessage& aMessage, + int& aChangeEventType) +{ + if (aMessage.getMessageId() == SETTINGS_CHANGE_EVENT_MESSAGE_ID_C) + { + aMessage >> aChangeEventType; + } + else + { + ELOG2(EJavaCaptain, "Received Settings Change Event with wrong MessageId!: %d should be %d", + aMessage.getMessageId(), SETTINGS_CHANGE_EVENT_MESSAGE_ID_C); + aChangeEventType = 0; + } +} + +} // namespace captain +} // namespace java + +#endif // SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/javacaptain.pro --- a/javamanager/javacaptain/javacaptain.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javacaptain/javacaptain.pro Tue Jul 13 16:05:52 2010 +0100 @@ -18,6 +18,7 @@ SUBDIRS += extensionplugins/config/build/javacaptain_ext_config.pro SUBDIRS += extensionplugins/javacertstore/build/javacaptain_ext_javacertstore.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 SUBDIRS += extensionplugins/autostarter/build/javacaptain_ext_autostarter.pro SUBDIRS += extensionplugins/scrupdater/build/javacaptain_ext_scrupdater.pro diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/src/rtc.cpp --- a/javamanager/javacaptain/src/rtc.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javacaptain/src/rtc.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -36,6 +36,8 @@ #include "javastorage.h" #include "javastoragenames.h" +#include "settingschangeeventsprovidermessages.h" + #include "midprtcplugin.h" #ifdef RD_JAVA_CAPTAIN_TESTRUNTIME #include "testrtcplugin.h" @@ -498,15 +500,31 @@ } void Rtc::event(const std::string& eventProvider, - java::comms::CommsMessage& /* aMsg */) + java::comms::CommsMessage& aMsg ) { ILOG(EJavaCaptain, "+Rtc::event()"); if (BOOT_EVENT_PROVIDER == eventProvider) { if (mSupportPreWarming && isThereInstalledMidlets()) { - ILOG(EJavaCaptain, "Rtc::event() - Boot event received, Starting prewarm VM since found Installed MIDlets"); - launchPrewarm(); //New prewarm VM instance is will be created only if it did not exist already + ILOG(EJavaCaptain, "Rtc::event() - Boot event received, Starting " + "prewarm VM since found Installed MIDlets"); + launchPrewarm(); //New prewarm VM instance is will be created only + //if it did not exist already + } + } else if ( SETTINGS_CHANGE_EVENT_PROVIDER == eventProvider ) + { + int changeEventType = 0; + getSettingsChangeEventMessageParams(aMsg, changeEventType); + if ( MIDP_CLASS_PATH_CHANGE == changeEventType && + (mRuntimes.find(PREWARM_UID) != mRuntimes.end()) ) + { + // Java libraries have been modified in the system. + //Prewarm instance must be restarted + ILOG(EJavaCaptain, "Rtc::event() - Restarting prewarm VM instance " + "since MIDP classpath has changed"); + stopPrewarm(); + launchPrewarm(); } } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javacaptain/subsystem.mk --- a/javamanager/javacaptain/subsystem.mk Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javacaptain/subsystem.mk Tue Jul 13 16:05:52 2010 +0100 @@ -22,6 +22,7 @@ extensionplugins/config/build \ extensionplugins/javacertstore/build \ extensionplugins/storageserver/build \ + extensionplugins/settingslistener/build \ $(LINUX_ONLY) diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp --- a/javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp Tue Jul 13 16:05:52 2010 +0100 @@ -52,8 +52,6 @@ USERINCLUDE ../inc USERINCLUDE ../../../../inc -SYSTEMINCLUDE ../../../../inc - // Libraries LIBRARY charconv.lib LIBRARY cone.lib diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/build/javainstaller.pro --- a/javamanager/javainstaller/installer/build/javainstaller.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/build/javainstaller.pro Tue Jul 13 16:05:52 2010 +0100 @@ -61,11 +61,7 @@ contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) { CONFIG += hb - LIBS += -lxqservice - } - - contains(PROJECT_DEFINES,RD_JAVA_USIF_NOTIFY_PROGRESS) { - LIBS += -lsifnotification + LIBS += -lsifnotification -lxqservice } MMP_RULES += \ diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifNotifier.java --- a/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifNotifier.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifNotifier.java Tue Jul 13 16:05:52 2010 +0100 @@ -107,19 +107,15 @@ iIconDir = aIconDir; iComponentIcon = aComponentIcon; - if (iHandle == 0) - { - InstallerException.internalError( - "SifNotifier.notifyStart: notifier has not been initialized"); - } + checkHandle(); int ret = _notifyStart( iHandle, aGlobalComponentId, aComponentName, aApplicationNames, aApplicationIcons, aComponentSize, aIconDir, aComponentIcon); if (ret < 0) { - Log.logError("Notifying SIF start failed with code " + ret + - ", " + getInfoString()); + Log.log("Notifying SIF start failed with code " + ret + + ", " + getInfoString()); InstallerException.internalError( "Notifying SIF start failed with code " + ret); } @@ -138,11 +134,7 @@ public void notifyEnd( int aErrCategory, int aErrCode, String aErrMsg, String aErrMsgDetails) { - if (iHandle == 0) - { - InstallerException.internalError( - "SifNotifier.notifyEnd: notifier has not been initialized"); - } + checkHandle(); if (aErrCategory == 0 && iLastProgressSent < MAX_PROGRESS) { // Before sending end notification, update progress to max if @@ -162,8 +154,8 @@ ", ErrMsgDetails: " + aErrMsgDetails; if (ret < 0) { - Log.logError("Notifying SIF end failed with code " + ret + - ", " + getInfoString() + ", " + logMsg); + Log.log("Notifying SIF end failed with code " + ret + + ", " + getInfoString() + ", " + logMsg); InstallerException.internalError( "Notifying SIF end failed with code " + ret); } @@ -184,11 +176,7 @@ { return; } - if (iHandle == 0) - { - InstallerException.internalError( - "SifNotifier.notifyProgress: notifier has not been initialized"); - } + checkHandle(); if (aSubOperation == SUB_OP_NO) { iLastProgressSent = aCurrent; @@ -202,8 +190,8 @@ ", Total: " + aTotal; if (ret < 0) { - Log.logError("Notifying SIF progress failed with code " + ret + - ", " + getInfoString() + ", " + logMsg); + Log.log("Notifying SIF progress failed with code " + ret + + ", " + getInfoString() + ", " + logMsg); InstallerException.internalError( "Notifying SIF progress failed with code " + ret); } @@ -221,11 +209,7 @@ */ public void destroy() { - if (iHandle == 0) - { - InstallerException.internalError( - "SifNotifier.destroy: notifier has not been initialized"); - } + checkHandle(); int ret = _destroy(iHandle); if (ret < 0) { @@ -265,6 +249,19 @@ /*** ----------------------------- PRIVATE ---------------------------- */ /** + * Checks if notifier instance has been initialized. + * @throws InstallerException if notifier has not been initialized + */ + private void checkHandle() + { + if (iHandle == 0) + { + InstallerException.internalError( + "SifNotifier.destroy: notifier has not been initialized"); + } + } + + /** * Returns notification info string used in logging. */ private String getInfoString() diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifRegistrator.java --- a/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifRegistrator.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifRegistrator.java Tue Jul 13 16:05:52 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -60,6 +60,14 @@ } /** + * Returns SIF specific error category from given error id. + */ + public static int getErrorCategory(int aErrorId) + { + return _getErrorCategory(aErrorId); + } + + /** * Launches the application view. If launching application view * fails this method does not throw exception but produces an * error log entry. @@ -157,7 +165,7 @@ if (ret < 0) { InstallerException.internalError( - "Creating session failed with code " + ret); + "Creating SIF session failed with code " + ret); } //Log.log("SifRegistrator session started"); iSessionHandle = ret; @@ -176,36 +184,18 @@ */ public void registerSuite(SuiteInfo aSuiteInfo, boolean aIsUpdate) { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } + checkSession(); Log.log("SifRegistrator registering application suite " + aSuiteInfo.getGlobalId()); - if (_getUsifMode() > 0) + // Register suite as a component. + registerComponent(aSuiteInfo, aIsUpdate); + registerLocalizedComponentName(aSuiteInfo, -1); + // Register applications within the component. + Vector apps = aSuiteInfo.getApplications(); + for (int i = 0; i < apps.size(); i++) { - // USIF Phase 2 registration. - // Register suite as a component. - registerComponent(aSuiteInfo, aIsUpdate); - registerLocalizedComponentName(aSuiteInfo, -1); - // Register applications within the component. - Vector apps = aSuiteInfo.getApplications(); - for (int i = 0; i < apps.size(); i++) - { - registerApplication(aSuiteInfo, i); - } - } - else - { - // USIF Phase 1 registration. - // Register each application in the suite. - Vector apps = aSuiteInfo.getApplications(); - for (int i = 0; i < apps.size(); i++) - { - registerComponent(aSuiteInfo, i, aIsUpdate); - registerLocalizedComponentName(aSuiteInfo, i); - } + registerApplication(aSuiteInfo, i); } registerLocalizedProperties(aSuiteInfo); } @@ -221,29 +211,12 @@ */ public void unregisterSuite(SuiteInfo aSuiteInfo) { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } + checkSession(); Log.log("SifRegistrator unregistering application suite " + aSuiteInfo.getGlobalId()); - if (_getUsifMode() > 0) - { - // USIF Phase 2 unregistration. - // Unregister suite as a component. - unregisterComponent(aSuiteInfo); - } - else - { - // USIF Phase 1 unregistration. - // Unregister each application in the suite. - Vector apps = aSuiteInfo.getApplications(); - for (int i = 0; i < apps.size(); i++) - { - unregisterComponent(aSuiteInfo, i); - } - } + // Unregister suite as a component. + unregisterComponent(aSuiteInfo); } /** @@ -256,15 +229,11 @@ */ public void commitSession() { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } - + checkSession(); int err = _commitSession(iSessionHandle); if (err < 0) { - InstallerException.internalError("Commiting session failed with code " + err); + InstallerException.internalError("Commiting SIF session failed with code " + err); } // Current session has been closed iSessionHandle = 0; @@ -279,17 +248,13 @@ */ public void rollbackSession() { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } - + checkSession(); int err = _rollbackSession(iSessionHandle); // Session is closed always when rollback is called iSessionHandle = 0; if (err < 0) { - InstallerException.internalError("Rolling back the session failed with code " + err); + InstallerException.internalError("Rolling back SIF session failed with code " + err); } //Log.log("SifRegistrator session rolled back"); } @@ -305,7 +270,6 @@ { return; } - _closeSession(iSessionHandle); // Current session has been closed iSessionHandle = 0; @@ -322,11 +286,7 @@ */ public ComponentId getComponentId(String aGlobalId) { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } - + checkSession(); ComponentId result = new ComponentId(); int ret = _getComponentId(iSessionHandle, aGlobalId, result); if (-1 == ret) @@ -354,11 +314,7 @@ */ public ComponentId getComponentId(Uid aAppUid) { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } - + checkSession(); ComponentId result = new ComponentId(); int ret = _getComponentIdForApp( iSessionHandle, ((PlatformUid)aAppUid).getIntValue(), result); @@ -384,15 +340,12 @@ */ public void logComponent(String aGlobalId) { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } - + checkSession(); int ret = _logComponent(iSessionHandle, aGlobalId); if (ret < -1) { - Log.logError("SifRegistrator logComponent failed with code " + ret); + Log.logError("SifRegistrator logComponent for " + aGlobalId + + " failed with code " + ret); } } @@ -400,120 +353,19 @@ /*** ----------------------------- PRIVATE ---------------------------- */ /** - * Registers one Java application to S60 USIF as a component. - * Used with USIF Phase 1. - * - * @param aSuiteInfo Information needed to register the application - * @param aIndex index of the application in the suite - * @param aIsUpdate true in case of an update, false in case of a new - * installation - * @throws InstallerException if registration cannot done or - * startSession has not been called successfully - * @see startSession - * @see SuiteInfo + * Checks if SifRegistrator session has been started. + * @throws InstallerException if SifRegistrator session has not been started */ - private void registerComponent( - SuiteInfo aSuiteInfo, int aIndex, boolean aIsUpdate) + private void checkSession() { - String globalId = aSuiteInfo.getGlobalId(aIndex); - if (globalId == null) - { - Log.logWarning("SifRegistrator: Application with index " + aIndex + - " not found from " + aSuiteInfo.getGlobalId()); - return; - } - ApplicationInfo appInfo = - (ApplicationInfo)aSuiteInfo.getApplications().elementAt(aIndex); - String suiteName = aSuiteInfo.getName(); - String vendor = aSuiteInfo.getVendor(); - String version = aSuiteInfo.getVersion().toString(); - String name = appInfo.getName(); - int uid = ((PlatformUid)appInfo.getUid()).getIntValue(); - String[] componentFiles = getComponentFiles(aSuiteInfo); - long componentSize = aSuiteInfo.getInitialSize(); - String attrValue = aSuiteInfo.getAttributeValue("Nokia-MIDlet-Block-Uninstall"); - boolean isRemovable = !(attrValue != null && attrValue.equalsIgnoreCase("true")); - boolean isDrmProtected = (aSuiteInfo.getContentInfo() == aSuiteInfo.CONTENT_INFO_DRM); - boolean isOriginVerified = aSuiteInfo.isTrusted(); - String midletInfoUrl = aSuiteInfo.getAttributeValue("MIDlet-Info-URL"); - String midletDescription = aSuiteInfo.getAttributeValue("MIDlet-Description"); - String downloadUrl = aSuiteInfo.getAttributeValue("Nokia-MIDlet-Download-URL"); - ComponentId componentId = new ComponentId(); - int err = _registerComponent( - iSessionHandle, uid, - getScrString(suiteName), getScrString(vendor), - getScrString(version), getScrString(name), - getScrString(globalId), componentFiles, - componentSize, isRemovable, isDrmProtected, - isOriginVerified, aIsUpdate, aSuiteInfo.getMediaId(), - getScrString(midletInfoUrl), - getScrString(midletDescription), - getScrString(downloadUrl), - componentId); - if (err < 0) + if (iSessionHandle == 0) { - InstallerException.internalError( - "Registering component " + globalId + - " failed with code " + err); - } - else - { - appInfo.setComponentId(componentId); - Log.log("SifRegistrator registered component " + globalId + - " with id " + componentId.getId()); - } - } - - /** - * Unregisters one Java application from being S60 USIF component. - * Used with USIF Phase 1. - * - * @param aSuiteInfo Information needed to unregister the application, - * @param aIndex index of the application in the suite - * @throws InstallerException if unregistration cannot done or - * startSession has not been called successfully - * @see startSession - * @see SuiteInfo - */ - private void unregisterComponent(SuiteInfo aSuiteInfo, int aIndex) - { - String globalId = aSuiteInfo.getGlobalId(aIndex); - if (globalId == null) - { - Log.logWarning("SifRegistrator: Application with index " + aIndex + - " not found from " + aSuiteInfo.getGlobalId()); - return; - } - ComponentId componentId = getComponentId(globalId); - if (componentId == null) - { - Log.logWarning( - "SifRegistrator unregistration failed, application " + - globalId + " does not exist"); - return; - } - // Save component id to ApplicationInfo. - ApplicationInfo appInfo = - (ApplicationInfo)aSuiteInfo.getApplications().elementAt(aIndex); - appInfo.setComponentId(componentId); - // Unregister application. - int err = _unregisterComponent(iSessionHandle, componentId.getId()); - if (err < 0) - { - InstallerException.internalError( - "Unregistering component " + globalId + - " failed with code " + err); - } - else - { - Log.log("SifRegistrator unregistered component " + globalId + - " with id " + componentId.getId()); + InstallerException.internalError("No valid SIF session."); } } /** * Registers Java application suite to S60 USIF as a component. - * Used with USIF Phase 2. * * @param aSuiteInfo Suite information * @param aIsUpdate true in case of an update, false in case of a new @@ -529,7 +381,6 @@ String suiteName = aSuiteInfo.getName(); String vendor = aSuiteInfo.getVendor(); String version = aSuiteInfo.getVersion().toString(); - String name = null; // Set name to null so that suite name will be used. int uid = ((PlatformUid)aSuiteInfo.getUid()).getIntValue(); String[] componentFiles = getComponentFiles(aSuiteInfo); long componentSize = aSuiteInfo.getInitialSize(); @@ -540,17 +391,20 @@ String midletInfoUrl = aSuiteInfo.getAttributeValue("MIDlet-Info-URL"); String midletDescription = aSuiteInfo.getAttributeValue("MIDlet-Description"); String downloadUrl = aSuiteInfo.getAttributeValue("Nokia-MIDlet-Download-URL"); + String updateUrl = aSuiteInfo.getAttributeValue("Nokia-Update"); ComponentId componentId = new ComponentId(); int err = _registerComponent( iSessionHandle, uid, getScrString(suiteName), getScrString(vendor), - getScrString(version), getScrString(name), - getScrString(globalId), componentFiles, - componentSize, isRemovable, isDrmProtected, - isOriginVerified, aIsUpdate, aSuiteInfo.getMediaId(), + getScrString(version), getScrString(globalId), + componentFiles, componentSize, + isRemovable, isDrmProtected, + isOriginVerified, aIsUpdate, + aSuiteInfo.getMediaId(), getScrString(midletInfoUrl), getScrString(midletDescription), getScrString(downloadUrl), + getScrString(updateUrl), componentId); if (err < 0) { @@ -568,7 +422,6 @@ /** * Unregisters Java application suite from being S60 USIF component. - * Used with USIF Phase 2. * * @param aSuiteInfo suite information * @throws InstallerException if unregistration cannot done or @@ -610,7 +463,6 @@ * from given SuiteInfo object. The SuiteInfo must already have * been registered to USIF as a component with registerComponent() * method before this method is called. - * Used with USIF Phase 2. * * @param aSuiteInfo information needed to register the application * @param aIndex index of the application in the suite @@ -816,51 +668,41 @@ // Register Domain-Category property. String protectionDomainProperty = "Domain-Category"; String protectionDomainName = aSuite.getProtectionDomainName(); - if (protectionDomainName != null) + err = _setLocalizedComponentProperty( + iSessionHandle, cid, protectionDomainProperty, + getProtectionDomainPropertyValue(protectionDomainName), + UNSPECIFIED_LOCALE); + if (err < 0) { - err = _setLocalizedComponentProperty( - iSessionHandle, cid, protectionDomainProperty, - getProtectionDomainPropertyValue(protectionDomainName), - UNSPECIFIED_LOCALE); - if (err < 0) - { - InstallerException.internalError( - "Adding property " + protectionDomainProperty + - " value " + protectionDomainName + " for component " + - cid + " failed with code " + err); - } - } - else - { - Log.logWarning( - "SifRegistrator.registerLocalizedProperties: " + - protectionDomainProperty + " not set"); + InstallerException.internalError( + "Adding property " + protectionDomainProperty + + " value " + protectionDomainName + " for component " + + cid + " failed with code " + err); } } /** * Returns the "Domain-Category" property value which contains * the text id and text file name for the localized domain category - * text. + * text. This method must never return null. */ private String getProtectionDomainPropertyValue(String aProtectionDomain) { - String textId = null; - if (aProtectionDomain.equals("Manufacturer")) - { - textId = "txt_java_inst_setlabel_cert_domain_val_manufacturer"; - } - else if (aProtectionDomain.equals("Operator")) + String textId = "txt_java_inst_setlabel_cert_domain_val_untrusted_third_party"; + if (aProtectionDomain != null) { - textId = "txt_java_inst_setlabel_cert_domain_val_operator"; - } - else if (aProtectionDomain.equals("IdentifiedThirdParty")) - { - textId = "txt_java_inst_setlabel_cert_domain_val_trusted_third_party"; - } - else if (aProtectionDomain.equals("UnidentifiedThirdParty")) - { - textId = "txt_java_inst_setlabel_cert_domain_val_untrusted_third_party"; + if (aProtectionDomain.equals("Manufacturer")) + { + textId = "txt_java_inst_setlabel_cert_domain_val_manufacturer"; + } + else if (aProtectionDomain.equals("Operator")) + { + textId = "txt_java_inst_setlabel_cert_domain_val_operator"; + } + else if (aProtectionDomain.equals("IdentifiedThirdParty")) + { + textId = "txt_java_inst_setlabel_cert_domain_val_trusted_third_party"; + } } return textId + ",javaapplicationinstaller"; } @@ -894,6 +736,13 @@ "SifRegistrator ignored unknown locale: " + name + ": " + localizedName); } + else if (localizedName.getName() == null || + localizedName.getName().length() == 0) + { + Log.logWarning( + "SifRegistrator ignored empty localized text: " + + name + ": " + localizedName); + } else { Log.log("SifRegistrator found localized text " + @@ -1015,7 +864,6 @@ * @param aSuiteName * @param aVendor * @param aVersion - * @param aName * @param aGlobalId * @param aComponentFiles * @param aComponentSize @@ -1027,17 +875,19 @@ * @param aMidletInfoUrl * @param aMidletDescription * @param aDownloadUrl + * @param aUpdateUrl * @param aComponentId upon successful execution contains the * component id for the registered component * @return 0 if registration succeeded or Symbian error code */ private static native int _registerComponent( int aSessionHandle, int aUid, String aSuiteName, String aVendor, - String aVersion, String aName, String aGlobalId, + String aVersion, String aGlobalId, String[] aComponentFiles, long aComponentSize, boolean aIsRemovable, boolean aIsDrmProtected, boolean aIsOriginVerified, boolean aIsUpdate, int aMediaId, - String aMidletInfoUrl, String aMidletDescription, String aDownloadUrl, + String aMidletInfoUrl, String aMidletDescription, + String aDownloadUrl, String aUpdateUrl, ComponentId aComponentId); /** @@ -1145,4 +995,9 @@ * @return 1 if application data should be registered to USIF, 0 otherwise */ private static native int _getUsifMode(); + + /** + * Returns SIF specific error category from given error id. + */ + private static native int _getErrorCategory(int aErrorId); } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/SysUtil.java --- a/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/SysUtil.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/SysUtil.java Tue Jul 13 16:05:52 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 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" @@ -359,11 +359,12 @@ " drives failed with code " + ret); } // Save the drives so that next time they are not fetched again. - iUserVisibleDrives = new Vector(); + Vector drivesVector = new Vector(); for (int i = 0; i < aVisibleDrives.size(); i++) { - iUserVisibleDrives.addElement(aVisibleDrives.elementAt(i)); + drivesVector.addElement(aVisibleDrives.elementAt(i)); } + iUserVisibleDrives = drivesVector; } /** diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/GetComponentInfo.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/GetComponentInfo.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/GetComponentInfo.java Tue Jul 13 16:05:52 2010 +0100 @@ -480,6 +480,15 @@ suiteUid, null, iSecurityAttributes.getAuthenticationAttributes()); + if (authenticationCredentials != null) + { + for (int i = 0; i < authenticationCredentials.length; i++) + { + String domain = authenticationCredentials[i] + .getProtectionDomainCategory(); + Log.log("Protection domain: " + domain); + } + } if (iJarFilename != null) { // Authenticate jar. diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java Tue Jul 13 16:05:52 2010 +0100 @@ -46,6 +46,8 @@ // Maximum number of progress updates to SysUtil.setProperty(). private static final int MAX_PROPERTY_PROGRESS_UPDATES = 5; + // Maximum number of progress updates to SIF. + private static final int MAX_SIF_PROGRESS_UPDATES = 5; // Maximum number of progress updates to UI. private static final int MAX_UI_PROGRESS_UPDATES = 20; @@ -61,11 +63,16 @@ private int iMaxValue = 1; // Tells how often property progress should be updated. private int iPropertyProgressStep = 1; + // Tells how often SIF progress should be updated. + private int iSifProgressStep = 1; // Tells how often UI progress should be updated. private int iUiProgressStep = 1; // Point between 0 and iMaxValue where the last property // update has been made. private int iLastPropertyUpdate = 0; + // Point between 0 and iMaxValue where the last SIF update + // has been made. + private int iLastSifUpdate = 0; // Point between 0 and iMaxValue where the last UI update // has been made. private int iLastUiUpdate = 0; @@ -203,6 +210,11 @@ { iPropertyProgressStep = 1; } + iSifProgressStep = iMaxValue / MAX_SIF_PROGRESS_UPDATES; + if (iSifProgressStep == 0) + { + iSifProgressStep = 1; + } iUiProgressStep = iMaxValue / MAX_UI_PROGRESS_UPDATES; if (iUiProgressStep == 0) { @@ -241,29 +253,44 @@ Log.log("InstallationNotifier.set: progress " + currentPercentage); defineProperties(); - if (aCurrentValue == 0 || - aCurrentValue == iMaxValue || - aCurrentValue >= iLastPropertyUpdate + iPropertyProgressStep || - aCurrentValue <= iLastPropertyUpdate - iPropertyProgressStep) + if (isUpdateNeeded(aCurrentValue, iMaxValue, + iLastPropertyUpdate, iPropertyProgressStep)) { iLastPropertyUpdate = aCurrentValue; Log.log("InstallationNotifier.set: update property to " + currentPercentage); // Update property values: progress. - SysUtil.setPropertyValue - (SysUtil.PROP_CATEGORY_SYSTEM, - SysUtil.PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS, - currentPercentage); + SysUtil.setPropertyValue( + SysUtil.PROP_CATEGORY_SYSTEM, + SysUtil.PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS, + currentPercentage); } - if (aCurrentValue == 0 || - aCurrentValue == iMaxValue || - aCurrentValue >= iLastUiUpdate + iUiProgressStep || - aCurrentValue <= iLastUiUpdate - iUiProgressStep) + if (isUpdateNeeded(aCurrentValue, iMaxValue, + iLastSifUpdate, iSifProgressStep)) { - iLastUiUpdate = aCurrentValue; + if (iSifNotifier != null) + { + iLastSifUpdate = aCurrentValue; + try + { + iSifNotifier.notifyProgress( + iSifNotifier.SUB_OP_NO, currentPercentage, 100); + } + catch (Throwable t) + { + Log.logError( + "InstallationNotifier: SifNotifier.notifyProgress threw exception", t); + } + } + } + + if (isUpdateNeeded(aCurrentValue, iMaxValue, + iLastUiUpdate, iUiProgressStep)) + { if (iInstallerUi != null) { + iLastUiUpdate = aCurrentValue; Log.log("InstallationNotifier.set: update ui to " + currentPercentage); try @@ -276,19 +303,6 @@ "InstallationNotifier: InstallerUi.updateProgress threw exception", t); } } - if (iSifNotifier != null) - { - try - { - iSifNotifier.notifyProgress( - iSifNotifier.SUB_OP_NO, currentPercentage, 100); - } - catch (Throwable t) - { - Log.logError( - "InstallationNotifier: SifNotifier.notifyProgress threw exception", t); - } - } } } @@ -380,4 +394,24 @@ "InstallationNotifier: Deleting property failed", ex); } } + + /** + * Returns true if progress update is needed, false otherwise. + * + * @param aCurrent current progress value + * @param aMax maximum progress value + * @param aPrevious previously updated progress value + * @param aStep step between progress updates + */ + private static boolean isUpdateNeeded( + int aCurrent, int aMax, int aPrevious, int aStep) + { + if (aCurrent == 0 || aCurrent == aMax || + aCurrent >= aPrevious + aStep || + aCurrent <= aPrevious - aStep) + { + return true; + } + return false; + } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java Tue Jul 13 16:05:52 2010 +0100 @@ -99,6 +99,11 @@ */ static final int RET_NO_SYSTEM_EXIT = 100; + /** Id for installer cancel Comms message. */ + private static final int INSTALLER_CANCEL_MESSAGE_ID = 603; + /** Id for installer cancel Comms response message. */ + private static final int INSTALLER_CANCEL_RESPONSE_MESSAGE_ID = 604; + // ThreadDumper instance. private static ThreadDumper iThreadDumper = null; @@ -1235,6 +1240,8 @@ " -commsresult=endpoint In the end of operation, send\n"+ " InstallerResultMessage to specified comms\n"+ " endpoint.\n"+ + " -base64=base64options Comma separated list of base64 encoded\n"+ + " options.\n"+ "\n"+ "Either -jad or -jar must be specified, other options are optional.\n"; @@ -1264,10 +1271,13 @@ " -captainmsgs=yes|no If set to no, JavaInstaller will not send\n"+ " any messages to JavaCaptain during\n"+ " uninstallation. Default is yes.\n"+ + " -resetpreinstall Reset preinstall state.\n"+ " -skipotastatus Skip OTA status handling.\n"+ " -commsresult=endpoint In the end of operation, send\n"+ " InstallerResultMessage to specified comms\n"+ " endpoint.\n"+ + " -base64=base64options Comma separated list of base64 encoded\n"+ + " options.\n"+ "\n"+ "The -uid option must be specified, other options are optional.\n"; @@ -1466,7 +1476,7 @@ if (aMessage.hasPermission(CommsPermission.INSTALL_APPLICATION)) { int msgId = aMessage.getMessageId(); - if (msgId == 603) + if (msgId == INSTALLER_CANCEL_MESSAGE_ID) { Installer.cancel(); result = ERR_NONE; @@ -1479,7 +1489,7 @@ } CommsMessage response = new CommsMessage(); response.replyTo(aMessage); - response.setMessageId(604); + response.setMessageId(INSTALLER_CANCEL_RESPONSE_MESSAGE_ID); response.write(result); iInstallerServer.send(response); Log.log("InstallerListener sent " + response); diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallerResultMessage.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallerResultMessage.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallerResultMessage.java Tue Jul 13 16:05:52 2010 +0100 @@ -21,12 +21,14 @@ import com.nokia.mj.impl.comms.CommsEndpoint; import com.nokia.mj.impl.comms.CommsMessage; import com.nokia.mj.impl.installer.applicationregistrator.SifNotifier; +import com.nokia.mj.impl.installer.applicationregistrator.SifRegistrator; import com.nokia.mj.impl.installer.storagehandler.ApplicationInfo; import com.nokia.mj.impl.installer.storagehandler.SuiteInfo; import com.nokia.mj.impl.installer.utils.InstallerException; import com.nokia.mj.impl.installer.utils.Log; import com.nokia.mj.impl.installer.utils.PlatformUid; import com.nokia.mj.impl.utils.exception.ExceptionBase; +import com.nokia.mj.impl.utils.ErrorMessageBase; import com.nokia.mj.impl.utils.InstallerErrorMessage; import com.nokia.mj.impl.utils.Tokenizer; import com.nokia.mj.impl.utils.Uid; @@ -37,30 +39,77 @@ /** * InstallerResultMessage contains information about install, uninstall - * and componentinfo operations. It is sent to Comms endpoint specified - * at JavaInstaller startup. + * and componentinfo operation results. JavaInstaller sends it at the end + * of operation to Comms endpoint specified at JavaInstaller startup with + * -commsresult option. + *

+ * InstallerResultMessage contains name-value pairs: name is a string, + * value can be either a string or an int. Message syntax: + *

+ *

+ * message := length named_int_value* length named_string_value*
+ * named_int_value := name int_value
+ * named_string_value := name string_value
+ * name := <string>
+ * int_value := <int>
+ * string_value := <string>
+ * length := <int telling the length of the table that follows>
+ * 
+ *

*/ public class InstallerResultMessage { + /** Operation type. Value type: int. + Possible values: 0: install, 1: uninstall, 2: componentinfo. */ public static final String NAME_OPERATION = "operation"; + /** Status code indicating operation result. Value type: int. */ public static final String NAME_RESULT = "result"; + /** SIF error category. Value type: int. */ public static final String NAME_ERROR_CATEGORY = "error-category"; + /** Java runtime specific error code. Value type: int. */ + public static final String NAME_ERROR_CODE = "error-code"; + /** Localized error message. Value type: string. */ public static final String NAME_ERROR_MSG = "error-message"; + /** Localized message with more details of the error reason. Value type: string. */ public static final String NAME_ERROR_DETAILS = "error-details"; + /** Suite UID. Value type: int. */ public static final String NAME_SUITE_UID = "suite-uid"; + /** Midlet-n UID. Value type: int. */ public static final String NAME_MIDLET_UID = "midlet-uid-"; + /** Suite component id. Value type: int. */ public static final String NAME_SUITE_CID = "suite-cid"; + /** Midlet-n component id. Value type: int. */ public static final String NAME_MIDLET_CID = "midlet-cid-"; + /** Suite global id. Value type: string. */ public static final String NAME_SUITE_GID = "suite-gid"; + /** Midlet-n global id. Value type: string. */ public static final String NAME_MIDLET_GID = "midlet-gid-"; + /** Suite name. Value type: string. */ public static final String NAME_SUITE_NAME = "suite-name"; + /** Midlet-n name. Value type: string. */ public static final String NAME_MIDLET_NAME= "midlet-name-"; + /** Suite vendor. Value type: string. */ public static final String NAME_VENDOR = "vendor"; + /** Suite version. Value type: string. */ public static final String NAME_VERSION = "version"; + /** Component installation status. Value type: int. Possible values: + 0: new component, + 1: upgrade, + 2: already installed, + 3: newer version already installed, + 4: invalid package, cannot be installed. */ public static final String NAME_INSTALL_STATUS = "install-status"; + /** Component authenticity. Value type: int. Possible values: + 0: component is not authenticated, 1: component is authenticated. */ public static final String NAME_AUTHENTICITY = "authenticity"; + /** Size of the files owned by the component at the time of the + installation. Calculated from MIDlet-Data-Size and + MIDlet-Jar-Size attributes. Value type: int. */ public static final String NAME_COMPONENT_SIZE = "component-size"; + /** Id for installer result Comms message. */ + private static final int INSTALLER_RESULT_MESSAGE_ID = 601; + private Hashtable iNamedIntValues = null; private Hashtable iNamedStringValues = null; @@ -165,7 +214,7 @@ { addValue(NAME_ERROR_DETAILS, msg); } - addErrorCategory(eb); + addErrorCodes(eb); } if (aException instanceof InstallerException) { @@ -193,25 +242,24 @@ } /** - * Get a string value from this message. - * @throws IllegalArgumentException if value with given name is not found + * Returns a string value from this message, or null + * if string value is not present. */ - public String getStringValue(String aName) + String getStringValue(String aName) { Object value = iNamedStringValues.get(aName); if (value instanceof String) { return (String)value; } - throw new IllegalArgumentException( - "InstallerResultMessage: string value " + aName + " not found"); + return null; } /** * Get an int value from this message. * @throws IllegalArgumentException if value with given name is not found */ - public int getIntValue(String aName) + int getIntValue(String aName) { Object value = iNamedIntValues.get(aName); if (value instanceof Integer) @@ -225,7 +273,7 @@ /** * Removes a value from this message. */ - public void removeValue(String aName) + void removeValue(String aName) { iNamedStringValues.remove(aName); iNamedIntValues.remove(aName); @@ -255,19 +303,20 @@ } if (iSifNotifier != null) { - int errCategory = 0; - int errCode = 0; - String errMsg = null; - String errDetails = null; - if (getIntValue(NAME_RESULT) != Installer.ERR_NONE) - { - errCategory = getIntValue(NAME_ERROR_CATEGORY); - errCode = Installer.ERR_GENERAL; - errMsg = getStringValue(NAME_ERROR_MSG); - errDetails = getStringValue(NAME_ERROR_DETAILS); - } try { + int result = getIntValue(NAME_RESULT); + int errCategory = 0; + int errCode = 0; + String errMsg = null; + String errDetails = null; + if (result != Installer.ERR_NONE) + { + errCategory = getIntValue(NAME_ERROR_CATEGORY); + errCode = getIntValue(NAME_ERROR_CODE); + errMsg = getStringValue(NAME_ERROR_MSG); + errDetails = getStringValue(NAME_ERROR_DETAILS); + } iSifNotifier.notifyEnd(errCategory, errCode, errMsg, errDetails); } catch (Throwable t) @@ -298,7 +347,7 @@ { comms.connect(aEndpoint); CommsMessage msg = new CommsMessage(); - msg.setMessageId(601); + msg.setMessageId(INSTALLER_RESULT_MESSAGE_ID); // Initialise the message data. msg.write(iNamedIntValues.size()); Enumeration e = iNamedIntValues.keys(); @@ -318,7 +367,7 @@ } // Send the message. Log.log("Sending InstallerResultMessage to " + aEndpoint); - CommsMessage installerResultResponse = comms.sendReceive(msg, 5); + comms.sendReceive(msg, 5); comms.disconnect(); Log.log("Received InstallerResultResponse from " + aEndpoint); } @@ -385,48 +434,34 @@ } /** - * Adds error category to the result message. + * Adds error codes to the result message. */ - private void addErrorCategory(ExceptionBase aEb) + private void addErrorCodes(ExceptionBase aEb) { - switch (aEb.getShortMessageId()) + if (aEb.getShortMessageId() >= ErrorMessageBase.INSTALLER_RANGE_START && + aEb.getShortMessageId() <= ErrorMessageBase.INSTALLER_RANGE_END) { - case InstallerErrorMessage.INST_NO_MEM: - addValue(NAME_ERROR_CATEGORY, 2); // ELowDiskSpace - break; - case InstallerErrorMessage.INST_NO_NET: - addValue(NAME_ERROR_CATEGORY, 3); // ENetworkUnavailable - break; - case InstallerErrorMessage.INST_CORRUPT_PKG: - addValue(NAME_ERROR_CATEGORY, 5); // ECorruptedPackage - break; - case InstallerErrorMessage.INST_COMPAT_ERR: - addValue(NAME_ERROR_CATEGORY, 6); // EApplicationNotCompatible - break; - case InstallerErrorMessage.INST_AUTHORIZATION_ERR: - // fall through - case InstallerErrorMessage.INST_AUTHENTICATION_ERR: - addValue(NAME_ERROR_CATEGORY, 7); // ESecurityError - break; - case InstallerErrorMessage.INST_PUSH_REG_ERR: - // fall through - case InstallerErrorMessage.INST_UNEXPECTED_ERR: - // fall through - case InstallerErrorMessage.UNINST_UNEXPECTED_ERR: - // fall through - case InstallerErrorMessage.OTHER_UNEXPECTED_ERR: - addValue(NAME_ERROR_CATEGORY, 8); // EUnexpectedError - break; - case InstallerErrorMessage.INST_CANCEL: - // fall through - case InstallerErrorMessage.UNINST_CANCEL: - addValue(NAME_ERROR_CATEGORY, 9); // EUserCancelled - break; - case InstallerErrorMessage.UNINST_NOT_ALLOWED: - addValue(NAME_ERROR_CATEGORY, 10); // EUninstallationBlocked - break; - default: - addValue(NAME_ERROR_CATEGORY, 8); // EUnexpectedError + addValue(NAME_ERROR_CATEGORY, + SifRegistrator.getErrorCategory(aEb.getShortMessageId())); + addValue(NAME_ERROR_CODE, + aEb.getShortMessageId() + aEb.getDetailedMessageId()); + } + else if (aEb.getShortMessageId() >= ErrorMessageBase.SECURITY_RANGE_START && + aEb.getShortMessageId() <= ErrorMessageBase.SECURITY_RANGE_END) + { + addValue(NAME_ERROR_CATEGORY, + SifRegistrator.getErrorCategory( + InstallerErrorMessage.INST_AUTHORIZATION_ERR)); + addValue(NAME_ERROR_CODE, + aEb.getShortMessageId() + aEb.getDetailedMessageId()); + } + else + { + addValue(NAME_ERROR_CATEGORY, + SifRegistrator.getErrorCategory( + InstallerErrorMessage.INST_UNEXPECTED_ERR)); + addValue(NAME_ERROR_CODE, + aEb.getShortMessageId()*1000 + aEb.getDetailedMessageId()); } } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckJarPackages.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckJarPackages.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckJarPackages.java Tue Jul 13 16:05:52 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 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" @@ -73,7 +73,7 @@ // Application touch support detection is not needed // if Nokia-MIDlet-On-Screen-Keypad has been defined. boolean touchDetection = true; - if (ball.getAttributeValue("Nokia-MIDlet-On-Screen-Keypad") != null) + if (ball.iSuite.getOnScreenKeypad() != SuiteInfo.OSK_UNDEFINED) { touchDetection = false; } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/FinalizeInstallation.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/FinalizeInstallation.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/FinalizeInstallation.java Tue Jul 13 16:05:52 2010 +0100 @@ -304,7 +304,14 @@ if (ball.iSifRegistrator.getSifMode() > 0 && launchApp) { - ball.iSifRegistrator.launchAppView(); + ball.getInstallerUi().syncExec(new Runnable() + { + // launchAppView() must be called in the UI thread. + public void run() + { + ball.iSifRegistrator.launchAppView(); + } + }); } else if (ball.iCaptainMsgs && launchApp && diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/HandleCustomAttributes.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/HandleCustomAttributes.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/HandleCustomAttributes.java Tue Jul 13 16:05:52 2010 +0100 @@ -56,7 +56,7 @@ { if (aBall.iApplicationRegistrator.isOnDeviceKeypadNeeded()) { - // default value when on-screen-keypad is needed + // Default value when on-screen-keypad is needed. aBall.iSuite.setOnScreenKeypad(SuiteInfo.OSK_GAMEACTIONS); String attrName = "Nokia-MIDlet-On-Screen-Keypad"; @@ -77,13 +77,16 @@ } else { - Log.logWarning("Invalid " + attrName + " value " + attrValue); + // Ignore on-screen-keypad attribute with invalid value. + aBall.iSuite.setOnScreenKeypad(SuiteInfo.OSK_UNDEFINED); + Log.logWarning("Ignoring invalid " + attrName + + " value " + attrValue); } } } else { - // If the device does not need on-screen-keypad, the value is not set at all + // If the device does not need on-screen-keypad, the value is not set at all. aBall.iSuite.setOnScreenKeypad(SuiteInfo.OSK_UNDEFINED); } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/InstallBall.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/InstallBall.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/InstallBall.java Tue Jul 13 16:05:52 2010 +0100 @@ -20,6 +20,7 @@ import java.util.Hashtable; +import com.nokia.mj.impl.installer.Installer; import com.nokia.mj.impl.installer.InstallationNotifier; import com.nokia.mj.impl.installer.applicationregistrator.ApplicationRegistrator; import com.nokia.mj.impl.installer.applicationregistrator.SifNotifier; @@ -303,10 +304,11 @@ Log.logWarning("checkForCancel: Stopping downloader failed", t); } } - throw new InstallerException - (InstallerErrorMessage.INST_CANCEL, null, - InstallerDetailedErrorMessage.NO_MSG, null, - OtaStatusCode.USER_CANCELLED); + throw new InstallerException( + Installer.ERR_CANCEL, + InstallerErrorMessage.INST_CANCEL, null, + InstallerDetailedErrorMessage.INST_CANCEL, null, + OtaStatusCode.USER_CANCELLED); } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/StartProgressNotifications.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/StartProgressNotifications.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/StartProgressNotifications.java Tue Jul 13 16:05:52 2010 +0100 @@ -36,6 +36,12 @@ InstallBall ball = (InstallBall)aBall; Log.log("Starting progress notifications..."); + if (ball.iPreinstallation) + { + Log.log("SifNotifier disabled during preinstallation."); + return; + } + if (!SifNotifier.enabled()) { Log.log("SifNotifier disabled."); @@ -99,7 +105,7 @@ } catch (Throwable t) { - Log.logError("StartProgressNotifications: SifNotifier.notifyStart failed", t); + Log.log("StartProgressNotifications: SifNotifier.notifyStart failed", t); try { ball.iSifNotifier.destroy(); diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/GetFromStorage.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/GetFromStorage.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/GetFromStorage.java Tue Jul 13 16:05:52 2010 +0100 @@ -54,6 +54,15 @@ // Check if debug attribute has been defined for this suite. ball.setDebug(ball.iSuite.getAttributeValue("Nokia-MIDlet-Install-Debug")); + // Check from arguments if preinstall state should be reset. + String arg = ball.iArgs.get("resetpreinstall"); + if (arg != null) + { + ball.iSuite.setResetPreinstall(true); + ball.log("ResetPreinstall set"); + } + + // Log all suite info. //ball.log(ball.iSuite.toString()); } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/UninstallBall.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/UninstallBall.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/UninstallBall.java Tue Jul 13 16:05:52 2010 +0100 @@ -21,6 +21,7 @@ import java.util.Hashtable; import java.util.Vector; +import com.nokia.mj.impl.installer.Installer; import com.nokia.mj.impl.installer.InstallationNotifier; import com.nokia.mj.impl.installer.applicationregistrator.ApplicationRegistrator; import com.nokia.mj.impl.installer.applicationregistrator.SifNotifier; @@ -124,10 +125,11 @@ super.checkForCancel(); if (isCancelled()) { - throw new InstallerException - (InstallerErrorMessage.UNINST_CANCEL, null, - InstallerDetailedErrorMessage.NO_MSG, null, - OtaStatusCode.USER_CANCELLED); + throw new InstallerException( + Installer.ERR_CANCEL, + InstallerErrorMessage.UNINST_CANCEL, null, + InstallerDetailedErrorMessage.UNINST_CANCEL, null, + OtaStatusCode.USER_CANCELLED); } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandler.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandler.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandler.java Tue Jul 13 16:05:52 2010 +0100 @@ -925,13 +925,23 @@ } else { - // Not an update ==> user is making uninstallation. + // Not an update ==> suite is being uninstalled. int oldPreinstallState = readPreinstallState(aSuiteInfo); if (oldPreinstallState == aSuiteInfo.STATE_PREINSTALLED) { - // User is uninstalling a preinstalled application, - // set preinstall state to STATE_NO_PREINSTALL. - setNoPreinstallState(aSuiteInfo); + if (aSuiteInfo.getResetPreinstall()) + { + // Preinstallation state should be reset, + // remove existing data from + // StorageNames.PREINSTALL_TABLE table. + removePreinstallState(aSuiteInfo); + } + else + { + // User is uninstalling a preinstalled application, + // set preinstall state to STATE_NO_PREINSTALL. + setNoPreinstallState(aSuiteInfo); + } } else if (oldPreinstallState == aSuiteInfo.STATE_INSTALLED) { @@ -1081,13 +1091,11 @@ /** * Removes preinstall state for given suite from - * preinstall table but only if preinstall state - * in given SuiteInfo is SuiteInfo.STATE_INSTALLED. + * preinstall table */ private void removePreinstallState(SuiteInfo aSuiteInfo) { - if (aSuiteInfo == null || - aSuiteInfo.iPreinstallState != aSuiteInfo.STATE_INSTALLED) + if (aSuiteInfo == null) { return; } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/SuiteInfo.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/SuiteInfo.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/SuiteInfo.java Tue Jul 13 16:05:52 2010 +0100 @@ -73,6 +73,9 @@ private String iAccessPoint = null; // Flag telling if application suite is trusted private boolean iTrusted = false; + // Flag telling if preinstallation state should be + // reseted in uninstallation. + private boolean iResetPreinstall = false; /** Flag telling if default icon should be used. */ private boolean iUseDefaultIcon = false; @@ -783,6 +786,24 @@ } /** + * Get the flag telling if preinstallation state should be reset. + * Used only in uninstallation. + */ + public boolean getResetPreinstall() + { + return iResetPreinstall; + } + + /** + * Set the flag telling if preinstallation state should be reset. + * Used only in uninstallation. + */ + public void setResetPreinstall(boolean aResetPreinstall) + { + iResetPreinstall = aResetPreinstall; + } + + /** * Calculates initial size from MIDlet-Data-Size and * MIDlet-Jar-Size attributes, or if they are not present * from jar file size. @@ -865,6 +886,7 @@ buf.append(" MediaId: ").append(getMediaId()).append("\n"); buf.append(" InitialSize: ").append(getInitialSize()).append("\n"); buf.append(" PreinstallState: ").append(iPreinstallState).append("\n"); + buf.append(" ResetPreinstall: ").append(getResetPreinstall()).append("\n"); buf.append(" OnScreenKeypad: ").append(getOnScreenKeypad()).append("\n"); buf.append(" ConvertedIcon: ").append(getConvertedIconPath()).append("\n"); buf.append(" Group: ").append(getInstallationGroup()).append("\n"); diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/Args.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/Args.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/Args.java Tue Jul 13 16:05:52 2010 +0100 @@ -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" @@ -20,6 +20,7 @@ import com.nokia.mj.impl.installer.utils.InstallerException; import com.nokia.mj.impl.installer.utils.Log; +import com.nokia.mj.impl.utils.Base64; import com.nokia.mj.impl.utils.Tokenizer; import java.util.Hashtable; @@ -59,6 +60,7 @@ //Log.log("Args: " + arg + "=" + value); } } + decodeBase64Args(); } /** @@ -203,7 +205,59 @@ } drive = aDrive.toLowerCase().charAt(0) - 'a'; } - Log.log("Parsed drive " + aDrive + " --> " + drive); + Log.log("Args: Parsed drive " + aDrive + " --> " + drive); return drive; } + + /** + * Decodes base64 encoded arguments. + * In Symbian environment the decoded argument is UTF-16LE string. + * + * @see /sf/app/jrt/javacommons/utils/inc/javacommonutils.h, + * wbase64encode() + */ + private void decodeBase64Args() + { + String base64Value = get("base64"); + if (base64Value == null || base64Value.length() == 0) + { + return; + } + String[] tokens = Tokenizer.split(base64Value, ","); + String name = null; + String value = null; + for (int i = 0; i < tokens.length; i++) + { + name = tokens[i]; + value = null; + if (name != null && name.length() > 0) + { + value = get(name); + } + if (value != null && value.length() > 0) + { + try + { + byte[] valueBytes = Base64.decode(value); + if (valueBytes != null && valueBytes.length > 0) + { + value = new String(valueBytes, "UTF-16LE"); + Log.log("Args: Base64 decoded option " + + name + "=" + value); + iArgs.put(name, value); + } + else + { + Log.logError("Args: Base64 decoding failed for " + + name + "=" + value); + } + } + catch (Throwable t) + { + Log.logError("Args: Base64 decoding failed for " + + name + "=" + value, t); + } + } + } + } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/AutoStartPermission.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/AutoStartPermission.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/AutoStartPermission.java Tue Jul 13 16:05:52 2010 +0100 @@ -67,7 +67,7 @@ */ public String toString() { - return "javax.microedition.midlet.AutoStartPermission"; + return "AutoStartPermission"; } /** diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/rt/installer/ApplicationUtilsImpl.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/rt/installer/ApplicationUtilsImpl.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/rt/installer/ApplicationUtilsImpl.java Tue Jul 13 16:05:52 2010 +0100 @@ -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" @@ -85,6 +85,11 @@ Installer.cancel(); } + public void uiDisposed() + { + Log.log("ApplicationUtilsImpl.uiDisposed"); + } + public void checkPermission(Permission aPermission) throws AccessControlException, NullPointerException { @@ -112,7 +117,7 @@ boolean userPromptAllowed = false; if (aPermission.toString().equals( - "javax.microedition.io.PushRegistryPermission")) + "javax.microedition.io.PushRegistry")) { // PushRegistryPermission is the only permission which // must be prompted from the user during installation. diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/src.s60/applicationregistrator/applicationregistrator.cpp --- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/applicationregistrator.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/applicationregistrator.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -51,6 +51,7 @@ // NAMESPACE DECLARATION using namespace java; +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /** * MIDP Stub SIS file UID. The application type Uid for MIDlets in S60 */ @@ -80,14 +81,6 @@ jboolean aBackground); /** - * Internal helper method for checking whether Application Shell is already running - * Used JNI method ...1startAppShellUi - * - * @return ETrue if AppShell is running - */ -TBool isAppShellUiRunning(); - -/** * Internal helper method for checking whether this code is executing in * a device that has correctly working version of * RApaLsSession::ForceCommitNonNativeApplicationsUpdatesL() @@ -95,6 +88,15 @@ * @return ETrue if force commit works well */ TBool isForceCommitSupported(); +#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + +/** + * Internal helper method for checking whether Application Shell is already running + * Used JNI method ...1startAppShellUi + * + * @return ETrue if AppShell is running + */ +TBool isAppShellUiRunning(); /** * Internal helper method for starting menu application @@ -129,7 +131,7 @@ return err; } -#ifndef RD_JAVA_USIF_APP_REG +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK // Delete any pending (un)registrations (possible if // e.g. device rebooted before commit). // This call does nothing if there is no pending registrations. @@ -144,7 +146,7 @@ pApaSession->Close(); return err; } -#endif // RD_JAVA_USIF_APP_REG +#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK // Return handle to session. Utilize the fact that in Symbian // all pointer addresses are MOD 4 so the last 2 bits are 0 @@ -168,7 +170,7 @@ * @param[in] aBackground * @return 0 if registration succeeded or Symbian error code */ -#ifdef RD_JAVA_USIF_APP_REG +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1registerApplication (JNIEnv */*aEnv*/, jclass /*aClass*/, jint /*aSessionHandle*/, jint /*aUid*/, jstring /*aGroupName*/, jstring /*aMIDletName*/, jstring /*aTargetDrive*/, jstring /*aIconFileName*/, @@ -176,7 +178,7 @@ { return KErrNone; } -#else +#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1registerApplication (JNIEnv *aEnv, jclass aClass, jint aSessionHandle, jint aUid, jstring aGroupName, jstring aMIDletName, jstring aTargetDrive, jstring aIconFileName, @@ -343,7 +345,6 @@ return err; } -#endif // RD_JAVA_USIF_APP_REG /** @@ -475,6 +476,7 @@ return err; } +#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /** @@ -484,13 +486,13 @@ * @param[in] aUid The Uid of the application to be unregistered.. * @return 0 if unregistration succeeded or Symbian error code */ -#ifdef RD_JAVA_USIF_APP_REG +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1unregisterApplication (JNIEnv *, jclass, jint /*aSessionHandle*/, jint /*aUid*/) { return KErrNone; } -#else +#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1unregisterApplication (JNIEnv *, jclass, jint aSessionHandle, jint aUid) { @@ -503,7 +505,7 @@ TRAPD(err, pApaSession->DeregisterNonNativeApplicationL(appUid)); return err; } -#endif // RD_JAVA_USIF_APP_REG +#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /** @@ -524,7 +526,7 @@ TInt err = KErrNone; -#ifndef RD_JAVA_USIF_APP_REG +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK if (aSynchronous) { // Make synchronous commit @@ -552,12 +554,12 @@ // Use always this synchronous commit when running in emulator // to make writing autotest cases easier. TRAP(err, pApaSession->CommitNonNativeApplicationsUpdatesL()); -#else +#else // __WINS__ // asynchronous commit TRAP(err, pApaSession->ForceCommitNonNativeApplicationsUpdatesL()); #endif // __WINS__ } -#endif // RD_JAVA_USIF_APP_REG +#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK if (KErrNone == err) { @@ -582,9 +584,9 @@ reinterpret_cast(aSessionHandle<<2); TInt err = KErrNone; -#ifndef RD_JAVA_USIF_APP_REG +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK err = pApaSession->RollbackNonNativeApplicationsUpdates(); -#endif // RD_JAVA_USIF_APP_REG +#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK pApaSession->Close(); delete pApaSession; @@ -925,6 +927,7 @@ } +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /** * Internal helper method for checking whether this code is executing in * a device that has correctly working version of @@ -969,3 +972,4 @@ return EFalse; } } +#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp --- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -21,21 +21,11 @@ #include "javasymbianoslayer.h" // for CleanupResetAndDestroyPushL #include "logger.h" -#if defined(SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK) && defined(RD_JAVA_USIF_NOTIFY_PROGRESS) +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK #include #include -// Helper macro for logging a TDesC. -#define LOG_TDESC_L(compIdParam, logLevelParam, msgParam, tdescParam) \ - { \ - HBufC8* tdescBuf = HBufC8::NewLC(tdescParam.Length() + 1); \ - TPtr8 tdescPtr(tdescBuf->Des()); \ - tdescPtr.Append(tdescParam); \ - LOG1(compIdParam, logLevelParam, msgParam, tdescPtr.PtrZ());\ - CleanupStack::PopAndDestroy(tdescBuf); \ - } - // NAMESPACE DECLARATION using namespace java; using namespace Usif; @@ -101,6 +91,7 @@ HBufC *appIcon = CreateHBufCFromJavaStringLC(aEnv, tmpAppIcon); applicationIcons.AppendL(appIcon); CleanupStack::Pop(appIcon); + aEnv->DeleteLocalRef(tmpAppIcon); } else { @@ -306,7 +297,7 @@ return KErrNone; } -#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK && RD_JAVA_USIF_NOTIFY_PROGRESS +#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /* * Class: com_nokia_mj_impl_installer_applicationregistrator_SifNotifier @@ -390,4 +381,4 @@ return KErrNone; } -#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK && RD_JAVA_USIF_NOTIFY_PROGRESS +#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp --- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -24,6 +24,7 @@ #include #include "com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator.h" +#include "com_nokia_mj_impl_utils_InstallerErrorMessage.h" #include "javacommonutils.h" #include "javasymbianoslayer.h" // for CleanupResetAndDestroyPushL #include "logger.h" @@ -33,19 +34,15 @@ #include #include -#ifdef RD_JAVA_USIF_APP_REG #include -#endif // RD_JAVA_USIF_APP_REG +#include #include // Helper macro for logging a TDesC. #define LOG_TDESC_L(compIdParam, logLevelParam, msgParam, tdescParam) \ - { \ - HBufC8* tdescBuf = HBufC8::NewLC(tdescParam.Length() + 1); \ - TPtr8 tdescPtr(tdescBuf->Des()); \ - tdescPtr.Append(tdescParam); \ - LOG1(compIdParam, logLevelParam, msgParam, tdescPtr.PtrZ());\ - CleanupStack::PopAndDestroy(tdescBuf); \ + { \ + std::wstring ws((wchar_t*)tdescParam.Ptr(), tdescParam.Length()); \ + LOG1(compIdParam, logLevelParam, msgParam, ws.c_str()); \ } // NAMESPACE DECLARATION @@ -55,21 +52,19 @@ IMPORT_C HBufC* CreateHBufCFromJavaStringLC(JNIEnv* aEnv, jstring aString); // Properties registered to SCR. -_LIT(KMIDletName, "MIDlet-Name"); _LIT(KUid, "Uid"); _LIT(KMediaId, "Media-Id"); _LIT(KMIDletInfoURL, "MIDlet-Info-URL"); _LIT(KMIDletDescription, "MIDlet-Description"); _LIT(KDownloadURL, "Download-URL"); +_LIT(KUpdateURL, "Update-URL"); _LIT(KSettingsPlugin, "SettingsName"); _LIT(KSettingsPluginValue, "javaapplicationsettingsview"); -#ifdef RD_JAVA_USIF_APP_REG // Symbian file path separator. _LIT(KPathSeperator, "\\"); // Postfix for the fake application name generated for AppArc. _LIT(KAppPostfix, ".fakeapp"); -#endif // RD_JAVA_USIF_APP_REG /** * Internal helper method for checking if specified application @@ -179,7 +174,6 @@ * See JNI method __1notifyAppChange. * This method makes calls that may leave (the actual registering). */ -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC void NotifyAppChangeL(JNIEnv *aEnv, jintArray aAppUids, jint aAppChange) { RApaLsSession apaSession; @@ -212,11 +206,6 @@ CleanupStack::PopAndDestroy(&apaSession); LOG(EJavaInstaller, EInfo, "NotifyAppChangeL completed"); } -#else -void NotifyAppChangeL(JNIEnv *, jintArray, jint) -{ -} -#endif // RD_JAVA_USIF_NOTIFY_APP_ARC /* * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator @@ -227,12 +216,6 @@ (JNIEnv *aEnv, jclass, jintArray aAppUids, jint aAppChange) { TRAPD(err, NotifyAppChangeL(aEnv, aAppUids, aAppChange)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "notifyAppChange: notifying AppArc failed, error %d", - err); - } return err; } @@ -257,14 +240,21 @@ QUrl openRecentView("appto://20022F35?activityname=AppLibRecentView"); XQApplicationManager applicationManager; XQAiwRequest *request = applicationManager.create(openRecentView); - if (request) { + if (request) + { + LOG(EJavaInstaller, EInfo, "launchAppView: launching AppLib"); bool result = request->send(); - if (!result) { + if (!result) + { int error = request->lastError(); ELOG1(EJavaInstaller, "launchAppView: launching AppLib failed, error %d", error); err = KErrGeneral; } + else + { + LOG(EJavaInstaller, EInfo, "launchAppView: launching AppLib succeeded"); + } delete request; } @@ -354,12 +344,6 @@ TRAPD(err, pScr->RollbackTransactionL()); pScr->Close(); delete pScr; - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "rollbackSession: Rolling back transaction failed, error %d", - err); - } return err; } @@ -389,9 +373,9 @@ HBufC *valueBuf = CreateHBufCFromJavaStringLC(aEnv, aValue); aScr->SetComponentPropertyL(aComponentId, aName, *valueBuf); //LOG_TDESC_L(EJavaInstaller, EInfo, - // "SetComponentPropertyL: name %s", aName); + // "SetComponentPropertyL: name %S", aName); //LOG_TDESC_L(EJavaInstaller, EInfo, - // "SetComponentPropertyL: value %s", valueBuf->Des()); + // "SetComponentPropertyL: value %S", valueBuf->Des()); CleanupStack::PopAndDestroy(valueBuf); } } @@ -402,23 +386,14 @@ */ TComponentId RegisterComponentL( JNIEnv *aEnv, RSoftwareComponentRegistry *aScr, jint aUid, - jstring aSuiteName, jstring aVendor, jstring aVersion, - jstring aName, jstring aGlobalId, + jstring aSuiteName, jstring aVendor, jstring aVersion, jstring aGlobalId, jobjectArray aComponentFiles, TInt64 aComponentSize, TBool aIsRemovable, TBool aIsDrmProtected, TBool aIsOriginVerified, TBool aIsUpdate, jint aMediaId, - jstring aMidletInfoUrl, jstring aMidletDescription, jstring aDownloadUrl) + jstring aMidletInfoUrl, jstring aMidletDescription, + jstring aDownloadUrl, jstring aUpdateUrl) { - HBufC *name = NULL; - if (NULL == aName) - { - // If name is not specified, use suite name. - name = CreateHBufCFromJavaStringLC(aEnv, aSuiteName); - } - else - { - name = CreateHBufCFromJavaStringLC(aEnv, aName); - } + HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aSuiteName); HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor); HBufC *version = CreateHBufCFromJavaStringLC(aEnv, aVersion); HBufC *globalId = CreateHBufCFromJavaStringLC(aEnv, aGlobalId); @@ -445,14 +420,10 @@ aScr->SetComponentPropertyL(componentId, KSettingsPlugin(), KSettingsPluginValue()); //LOG(EJavaInstaller, EInfo, "RegisterComponentL: Settings plugin property set"); - if (NULL != aName) - { - // If name is specified, store suite name as property. - SetComponentPropertyL(aEnv, aScr, componentId, KMIDletName(), aSuiteName); - } SetComponentPropertyL(aEnv, aScr, componentId, KMIDletInfoURL(), aMidletInfoUrl); SetComponentPropertyL(aEnv, aScr, componentId, KMIDletDescription(), aMidletDescription); SetComponentPropertyL(aEnv, aScr, componentId, KDownloadURL(), aDownloadUrl); + SetComponentPropertyL(aEnv, aScr, componentId, KUpdateURL(), aUpdateUrl); CleanupStack::PopAndDestroy(globalId); CleanupStack::PopAndDestroy(version); @@ -478,21 +449,22 @@ */ JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1registerComponent (JNIEnv *aEnv, jclass, jint aSessionHandle, jint aUid, jstring aSuiteName, - jstring aVendor, jstring aVersion, jstring aName, jstring aGlobalId, + jstring aVendor, jstring aVersion, jstring aGlobalId, jobjectArray aComponentFiles, jlong aComponentSize, jboolean aIsRemovable, jboolean aIsDrmProtected, jboolean aIsOriginVerified, jboolean aIsUpdate, jint aMediaId, jstring aMidletInfoUrl, jstring aMidletDescription, - jstring aDownloadUrl, jobject aComponentId) + jstring aDownloadUrl, jstring aUpdateUrl, jobject aComponentId) { __UHEAP_MARK; RSoftwareComponentRegistry *pScr = reinterpret_cast(aSessionHandle<<2); TComponentId componentId = -1; TRAPD(err, componentId = RegisterComponentL( - aEnv, pScr, aUid, aSuiteName, aVendor, aVersion, aName, aGlobalId, + aEnv, pScr, aUid, aSuiteName, aVendor, aVersion, aGlobalId, aComponentFiles, aComponentSize, aIsRemovable, aIsDrmProtected, aIsOriginVerified, aIsUpdate, aMediaId, - aMidletInfoUrl, aMidletDescription, aDownloadUrl)); + aMidletInfoUrl, aMidletDescription, + aDownloadUrl, aUpdateUrl)); __UHEAP_MARKEND; if (KErrNone == err) { @@ -515,9 +487,7 @@ RSoftwareComponentRegistry *pScr = reinterpret_cast(aSessionHandle<<2); TInt err = KErrNone; -#ifdef RD_JAVA_USIF_APP_REG TRAP(err, pScr->DeleteApplicationEntriesL(aComponentId)); -#endif // RD_JAVA_USIF_APP_REG if (KErrNone == err) { TRAP(err, pScr->DeleteComponentL(aComponentId)); @@ -530,7 +500,6 @@ * See JNI method __1registerApplication. * This method makes calls that may leave. */ -#ifdef RD_JAVA_USIF_APP_REG void RegisterApplicationL( JNIEnv *aEnv, RSoftwareComponentRegistry *aScr, jint aComponentId, jint aAppUid, @@ -598,47 +567,36 @@ RPointerArray captionsArray; CleanupResetAndDestroyPushL(captionsArray); TInt langCount = aEnv->GetArrayLength(aLanguages); - TInt captionCount = aEnv->GetArrayLength(aAppNames); - if (langCount == captionCount) + jint* languages = aEnv->GetIntArrayElements(aLanguages, NULL); + for (TInt i = 0; i < langCount; i++) { - jint* languages = aEnv->GetIntArrayElements(aLanguages, NULL); - for (TInt i = 0; i < langCount; i++) - { - TLanguage tmpLanguage = (TLanguage)languages[i]; - HBufC *tmpCaption = - CreateHBufCFromJavaStringLC( - aEnv, (jstring)aEnv->GetObjectArrayElement(aAppNames, i)); - captionsArray.AppendL(tmpCaption); - CleanupStack::Pop(tmpCaption); - //LOG1(EJavaInstaller, EInfo, - // "RegisterApplicationL: language %d", tmpLanguage); - //LOG_TDESC_L(EJavaInstaller, EInfo, - // "RegisterApplicationL: caption %s", tmpCaption->Des()); - CCaptionAndIconInfo *tmpCaptionAndIconInfo = - CCaptionAndIconInfo::NewLC( - /*aCaption=*/ *tmpCaption, - /*aIconFileName=*/ KNullDesC, - /*aNumOfAppIcons=*/ 0); - CLocalizableAppInfo *tmpLocAppInfo = - CLocalizableAppInfo::NewLC( - /*aShortCaption=*/ KNullDesC, - /*aApplicationLanguage=*/ tmpLanguage, - /*aGroupName=*/ KNullDesC, - /*aCaptionAndIconInfo=*/ tmpCaptionAndIconInfo, - /*aViewDataList=*/ viewDataList); - localizableAppInfoList.AppendL(tmpLocAppInfo); - CleanupStack::Pop(tmpLocAppInfo); - CleanupStack::Pop(tmpCaptionAndIconInfo); - } - aEnv->ReleaseIntArrayElements(aLanguages, languages, 0); + TLanguage tmpLanguage = (TLanguage)languages[i]; + HBufC *tmpCaption = + CreateHBufCFromJavaStringLC( + aEnv, (jstring)aEnv->GetObjectArrayElement(aAppNames, i)); + captionsArray.AppendL(tmpCaption); + CleanupStack::Pop(tmpCaption); + //LOG1(EJavaInstaller, EInfo, + // "RegisterApplicationL: language %d", tmpLanguage); + //LOG_TDESC_L(EJavaInstaller, EInfo, + // "RegisterApplicationL: caption %S", tmpCaption->Des()); + CCaptionAndIconInfo *tmpCaptionAndIconInfo = + CCaptionAndIconInfo::NewLC( + /*aCaption=*/ *tmpCaption, + /*aIconFileName=*/ KNullDesC, + /*aNumOfAppIcons=*/ 0); + CLocalizableAppInfo *tmpLocAppInfo = + CLocalizableAppInfo::NewLC( + /*aShortCaption=*/ KNullDesC, + /*aApplicationLanguage=*/ tmpLanguage, + /*aGroupName=*/ KNullDesC, + /*aCaptionAndIconInfo=*/ tmpCaptionAndIconInfo, + /*aViewDataList=*/ viewDataList); + localizableAppInfoList.AppendL(tmpLocAppInfo); + CleanupStack::Pop(tmpLocAppInfo); + CleanupStack::Pop(tmpCaptionAndIconInfo); } - else - { - WLOG2(EJavaInstaller, - "RegisterApplicationL: localisation not made because language " \ - "count does not match to caption count (%d != %d)", - langCount, captionCount); - } + aEnv->ReleaseIntArrayElements(aLanguages, languages, 0); // Create application registration data objects. TApplicationCharacteristics appCharacteristics; @@ -674,13 +632,6 @@ CleanupStack::PopAndDestroy(caption); __UHEAP_MARKEND; } -#else -void RegisterApplicationL( - JNIEnv *, RSoftwareComponentRegistry *, jint, jint, jstring, - jstring, jstring, jstring, jint, jintArray, jobjectArray) -{ -} -#endif // RD_JAVA_USIF_APP_REG /* * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator @@ -710,19 +661,13 @@ JNIEnv *aEnv, RSoftwareComponentRegistry *aScr, jint aComponentId, jstring aName, jstring aVendor, jint aLanguage) { - if (NULL != aName) - { - HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aName); - aScr->SetComponentNameL(aComponentId, *name, (TLanguage)aLanguage); - CleanupStack::PopAndDestroy(name); - } + HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aName); + aScr->SetComponentNameL(aComponentId, *name, (TLanguage)aLanguage); + CleanupStack::PopAndDestroy(name); - if (NULL != aVendor) - { - HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor); - aScr->SetVendorNameL(aComponentId, *vendor, (TLanguage)aLanguage); - CleanupStack::PopAndDestroy(vendor); - } + HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor); + aScr->SetVendorNameL(aComponentId, *vendor, (TLanguage)aLanguage); + CleanupStack::PopAndDestroy(vendor); } /* @@ -827,7 +772,6 @@ * Method: _getComponentIdForApp * Signature: (IILcom/nokia/mj/impl/installer/applicationregistrator/ComponentId;)I */ -#ifdef RD_JAVA_USIF_APP_REG JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getComponentIdForApp (JNIEnv *aEnv, jclass, jint aSessionHandle, jint aAppUid, jobject aComponentId) { @@ -847,13 +791,6 @@ } return err; } -#else -JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getComponentIdForApp -(JNIEnv *, jclass, jint, jint, jobject) -{ - return KErrNone; -} -#endif // RD_JAVA_USIF_APP_REG /** * See JNI method __1getuid. @@ -866,20 +803,8 @@ CleanupClosePushL(*pScr); TInt uid = 0; CPropertyEntry *property = pScr->GetComponentPropertyL(aCid, KUid()); - if (NULL != property) - { - if (property->PropertyType() == CPropertyEntry::EIntProperty) - { - uid = ((CIntPropertyEntry*)property)->IntValue(); - } - else - { - ELOG2(EJavaInstaller, - "GetUidL: Incorrect property type %d for cid %d", - property->PropertyType(), aCid); - } - delete property; - } + uid = ((CIntPropertyEntry*)property)->IntValue(); + delete property; // Close and delete the temporary RSoftwareComponentRegistry. CleanupStack::PopAndDestroy(pScr); delete pScr; // For some reason PopAndDestroy does not delete this. @@ -916,23 +841,16 @@ HBufC *globalId = CreateHBufCFromJavaStringLC(aEnv, aGlobalId); CComponentEntry *componentEntry = aScr->GetComponentL(*globalId, Usif::KSoftwareTypeJava, aLanguage); - if (NULL == componentEntry) - { - //LOG_TDESC_L(EJavaInstaller, EInfo, - // "Component not found for GlobalId %s", globalId->Des()); - CleanupStack::PopAndDestroy(globalId); - return; - } CleanupStack::PopAndDestroy(globalId); // Log component entry. TComponentId componentId = componentEntry->ComponentId(); - LOG_TDESC_L(EJavaInstaller, EInfo, "GlobalId: %s", componentEntry->GlobalId()); + LOG_TDESC_L(EJavaInstaller, EInfo, "GlobalId: %S", componentEntry->GlobalId()); LOG1(EJavaInstaller, EInfo, "ComponentId: %d", componentId); - LOG_TDESC_L(EJavaInstaller, EInfo, "SoftwareType: %s", componentEntry->SoftwareType()); - LOG_TDESC_L(EJavaInstaller, EInfo, "Name: %s", componentEntry->Name()); - LOG_TDESC_L(EJavaInstaller, EInfo, "Vendor: %s", componentEntry->Vendor()); - LOG_TDESC_L(EJavaInstaller, EInfo, "Version: %s", componentEntry->Version()); + LOG_TDESC_L(EJavaInstaller, EInfo, "SoftwareType: %S", componentEntry->SoftwareType()); + LOG_TDESC_L(EJavaInstaller, EInfo, "Name: %S", componentEntry->Name()); + LOG_TDESC_L(EJavaInstaller, EInfo, "Vendor: %S", componentEntry->Vendor()); + LOG_TDESC_L(EJavaInstaller, EInfo, "Version: %S", componentEntry->Version()); LOG1(EJavaInstaller, EInfo, "ComponentSize: %d", componentEntry->ComponentSize()); LOG1(EJavaInstaller, EInfo, "ScomoState: %d", componentEntry->ScomoState()); LOG1(EJavaInstaller, EInfo, "IsDrmProtected: %d", componentEntry->IsDrmProtected()); @@ -960,42 +878,37 @@ switch (propertyEntry->PropertyType()) { case CPropertyEntry::EBinaryProperty: - LOG_TDESC_L(EJavaInstaller, EInfo, "BinaryProperty: %s", + LOG_TDESC_L(EJavaInstaller, EInfo, "BinaryProperty: %S", propertyEntry->PropertyName()); break; case CPropertyEntry::EIntProperty: - LOG_TDESC_L(EJavaInstaller, EInfo, "IntProperty: %s", + LOG_TDESC_L(EJavaInstaller, EInfo, "IntProperty: %S", propertyEntry->PropertyName()); LOG2(EJavaInstaller, EInfo, " = 0x%x (%d)", ((CIntPropertyEntry*)propertyEntry)->IntValue(), ((CIntPropertyEntry*)propertyEntry)->IntValue()); break; case CPropertyEntry::ELocalizedProperty: - LOG_TDESC_L(EJavaInstaller, EInfo, "LocalizedProperty: %s", + LOG_TDESC_L(EJavaInstaller, EInfo, "LocalizedProperty: %S", propertyEntry->PropertyName()); - LOG_TDESC_L(EJavaInstaller, EInfo, " = %s", + LOG_TDESC_L(EJavaInstaller, EInfo, " = %S", ((CLocalizablePropertyEntry*)propertyEntry)->StrValue()); break; } } CleanupStack::PopAndDestroy(&properties); -#ifdef RD_JAVA_USIF_APP_REG // Log uids of applications associated to component. RArray appUids; CleanupClosePushL(appUids); aScr->GetAppUidsForComponentL(componentId, appUids); - if (appUids.Count() == 0) - { - LOG(EJavaInstaller, EInfo, "No component appUids found from SCR"); - } + LOG1(EJavaInstaller, EInfo, "Number of AppUids found: %d", appUids.Count()); for (TInt i = 0; i < appUids.Count(); i++) { LOG2(EJavaInstaller, EInfo, "AppUid [%x] (%d)", appUids[i].iUid, appUids[i].iUid); } CleanupStack::PopAndDestroy(&appUids); -#endif // RD_JAVA_USIF_APP_REG } /** @@ -1047,11 +960,51 @@ JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getUsifMode (JNIEnv *, jclass) { -#ifdef RD_JAVA_USIF_APP_REG return 1; -#else - return 0; -#endif // RD_JAVA_USIF_APP_REG +} + +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator + * Method: _getErrorCategory + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getErrorCategory +(JNIEnv *, jclass, jint aErrorId) +{ + int errorCategory = Usif::EUnexpectedError; + switch (aErrorId) + { + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_NO_MEM: + errorCategory = Usif::ELowDiskSpace; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_NO_NET: + errorCategory = Usif::ENetworkUnavailable; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_CORRUPT_PKG: + errorCategory = Usif::ECorruptedPackage; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_COMPAT_ERR: + errorCategory = Usif::EApplicationNotCompatible; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_AUTHORIZATION_ERR: + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_AUTHENTICATION_ERR: + errorCategory = Usif::ESecurityError; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_PUSH_REG_ERR: + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_UNEXPECTED_ERR: + case com_nokia_mj_impl_utils_InstallerErrorMessage_UNINST_UNEXPECTED_ERR: + case com_nokia_mj_impl_utils_InstallerErrorMessage_OTHER_UNEXPECTED_ERR: + errorCategory = Usif::EUnexpectedError; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_CANCEL: + case com_nokia_mj_impl_utils_InstallerErrorMessage_UNINST_CANCEL: + errorCategory = Usif::EUserCancelled; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_UNINST_NOT_ALLOWED: + errorCategory = Usif::EUninstallationBlocked; + break; + } + return errorCategory; } #else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK @@ -1127,9 +1080,9 @@ * Signature: (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;JZZZZLcom/nokia/mj/impl/installer/applicationregistrator/ComponentId;)I */ JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1registerComponent -(JNIEnv *, jclass, jint, jint, jstring, jstring, jstring, jstring, jstring, - jobjectArray, jlong, jboolean, jboolean, jboolean, jboolean, jint, jstring, - jstring, jstring, jobject) +(JNIEnv *, jclass, jint, jint, jstring, jstring, jstring, jstring, + jobjectArray, jlong, jboolean, jboolean, jboolean, jboolean, jint, + jstring, jstring, jstring, jstring, jobject) { return KErrNone; } @@ -1233,4 +1186,15 @@ return 0; } +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator + * Method: _getErrorCategory + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getErrorCategory +(JNIEnv *, jclass, jint) +{ + return 0; +} + #endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/build/jiut.bat --- a/javamanager/javainstaller/installer/tsrc/build/jiut.bat Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/build/jiut.bat Tue Jul 13 16:05:52 2010 +0100 @@ -1,5 +1,5 @@ @rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). @rem All rights reserved. @rem This component and the accompanying materials are made available @rem under the terms of "Eclipse Public License v1.0" @@ -16,8 +16,8 @@ rem Script for running JavaInstaller unit tests from S60 eshell rem Start SifServer before running any tests sifserver -rem javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.NotificationPosterTest -rem javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.DownloaderTest +javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.NotificationPosterTest +javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.DownloaderTest javainstaller test -mainclass=com.nokia.mj.impl.installer.storagehandler.OtaStatusHandlerTest javainstaller test -mainclass=com.nokia.mj.impl.installer.integrityservice.IntegrityServiceTest javainstaller test -mainclass=com.nokia.mj.impl.installer.jadjarmatcher.JadJarMatcherTest @@ -34,4 +34,7 @@ javainstaller test -mainclass=com.nokia.mj.impl.installer.utils.AttributeReaderTest javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerResultMessageTest javainstaller test -mainclass=com.nokia.mj.impl.installer.GetComponentInfoTest -rem javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest +javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run1 +javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run2 +javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run3 +javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run4 diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/GetComponentInfoTest.java --- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/GetComponentInfoTest.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/GetComponentInfoTest.java Tue Jul 13 16:05:52 2010 +0100 @@ -856,15 +856,11 @@ try { String value = aMsg.getStringValue(aName); - assertTrue("Unexpected value " + aName + "=" + value, false); - } - catch (IllegalArgumentException iae) - { - // Expected exception. + assertTrue("Unexpected value " + aName + "=" + value, value == null); } catch (Throwable t) { - assertTrue("Incorrect exception for string value " + aName + + assertTrue("Unexpected exception for string value " + aName + ": " + t, false); } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/InstallerEngineTest.java --- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/InstallerEngineTest.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/InstallerEngineTest.java Tue Jul 13 16:05:52 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 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" @@ -52,6 +52,8 @@ { TestSuite suite = new TestSuite(this.getClass().getName()); + String runIndex = System.getProperty("com.nokia.mj.impl.installer.test.param1"); + if (Platform.isLinux()) { // In S60 this would be interactive test, so disable it there. @@ -64,6 +66,8 @@ })); } + if (runIndex == null || runIndex.equalsIgnoreCase("run1")) + { // Run 1 suite.addTest(new InstallerEngineTest("testMidletMessageOk", new TestMethod() { @@ -104,7 +108,11 @@ ((InstallerEngineTest)tc).test3AppsOk(); } })); + } + if (runIndex == null || runIndex.equalsIgnoreCase("run2")) + { + // Run 2 suite.addTest(new InstallerEngineTest("testDownloadJadOk", new TestMethod() { public void run(TestCase tc) @@ -113,7 +121,6 @@ } })); - // Run 2 suite.addTest(new InstallerEngineTest("testDownloadJarOk", new TestMethod() { public void run(TestCase tc) @@ -217,7 +224,11 @@ ((InstallerEngineTest)tc).testNoJavaBinRoot(); } })); + } + if (runIndex == null || runIndex.equalsIgnoreCase("run3")) + { + // Run 3 suite.addTest(new InstallerEngineTest("testBlockUninstall", new TestMethod() { public void run(TestCase tc) @@ -241,8 +252,11 @@ ((InstallerEngineTest)tc).testApplicationInfo(); } })); + } - // Run 3 + if (runIndex == null || runIndex.equalsIgnoreCase("run4")) + { + // Run 4 suite.addTest(new InstallerEngineTest("testInstallOptions", new TestMethod() { public void run(TestCase tc) @@ -258,6 +272,7 @@ ((InstallerEngineTest)tc).testInstallAuthAndBig(); } })); + } com.nokia.mj.impl.utils.OmjTestRunner.run(suite); } @@ -313,6 +328,15 @@ } /** + */ + public String getTestServer() + { + String server = System.getProperty("com.nokia.mj.impl.installer.test.server"); + assertNotNull("-server=

: argument required.", server); + return server; + } + + /** * Makes installation, update and uninstallation for given application. * Does the following steps: * install with cancellation and check that app is not installed, @@ -413,12 +437,12 @@ assertNoIsDir(); // List. - Log.logOut("InstallerEngineTest.doInstallUninstall: list -v"); - result = Installer.mainWithResult(new String[] { "list", "-v" }); - assertResult(result, Installer.ERR_NONE); - Log.logOut("InstallerEngineTest.doInstallUninstall: list -otastatus"); - result = Installer.mainWithResult(new String[] { "list", "-otastatus" }); - assertResult(result, Installer.ERR_NONE); + //Log.logOut("InstallerEngineTest.doInstallUninstall: list -v"); + //result = Installer.mainWithResult(new String[] { "list", "-v" }); + //assertResult(result, Installer.ERR_NONE); + //Log.logOut("InstallerEngineTest.doInstallUninstall: list -otastatus"); + //result = Installer.mainWithResult(new String[] { "list", "-otastatus" }); + //assertResult(result, Installer.ERR_NONE); // Update with cancellation. Log.logOut("InstallerEngineTest.doInstallUninstall: update with cancellation " + aFilename); @@ -573,38 +597,38 @@ public void testDownloadJadOk() { Log.logOut("InstallerEngineTest.testDownloadJadOk begins"); - SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); - doInstallUninstall(suite, "http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_gcf.jsp", true, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("HelloWorld", "Nokia"); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/HelloWorld_ota.jad", true, iDefaultOptions); } public void testDownloadJarOk() { Log.logOut("InstallerEngineTest.testDownloadJarOk begins"); - SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); - doInstallUninstall(suite, "http://195.134.231.83:7070/omjserver/resources/omj/JBenchmark2.jar", false, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("HelloWorld", "Nokia"); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/HelloWorld.jar", false, iDefaultOptions); } public void testDownloadJadHttpRedirectOk() { Log.logOut("InstallerEngineTest.testDownloadJadHttpRedirectOk begins"); - SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); - doInstallUninstall(suite, "http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jad&count=5", true, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("HelloWorld_redirect", "Nokia"); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jad&count=5", true, iDefaultOptions); } public void testDownloadJarHttpRedirectOk() { Log.logOut("InstallerEngineTest.testDownloadJarHttpRedirectOk begins"); - SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); - doInstallUninstall(suite, "http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jar", false, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("HelloWorld_redirect", "Nokia"); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jar", false, iDefaultOptions); } public void testDownloadJadHttpAuthOk() { Log.logOut("InstallerEngineTest.testDownloadJadHttpAuthOk begins"); - SuiteInfo suite = new SuiteInfo("DS_Snow_http_auth", "DS_Effects"); + SuiteInfo suite = new SuiteInfo("HelloWorld_http_auth", "Nokia"); iDefaultOptions.addElement("-username=guest"); iDefaultOptions.addElement("-password=guest"); - doInstallUninstall(suite, "http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", true, iDefaultOptions); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", true, iDefaultOptions); } public void testDownloadJadHttpAuthNok() @@ -614,7 +638,7 @@ { "install", "-silent", - "-jad=http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", + "-jad=http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", }; int result = Installer.mainWithResult(args); // Check result code. @@ -637,7 +661,7 @@ { "install", "-silent", - "-jad=http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jad&count=6", + "-jad=http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jad&count=6", }; int result = Installer.mainWithResult(args); // Check result code. @@ -680,7 +704,7 @@ { "install", "-silent", - "-jad=http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_8mb_gcf.jsp", + "-jad=http://" + getTestServer() + "/installertest/HelloWorld_8mb.jad", }; Log.log("InstallerEngineTest.testDownloadJadCancel: installation starts"); int result = Installer.mainWithResult(args); @@ -1109,10 +1133,10 @@ { Log.logOut("InstallerEngineTest.testInstallAuthAndBig begins"); // Do first installation with doInstallUninstall helper - SuiteInfo suite = new SuiteInfo("DS_Snow_http_auth", "DS_Effects"); + SuiteInfo suite = new SuiteInfo("HelloWorld_http_auth", "Nokia"); iDefaultOptions.addElement("-username=guest"); iDefaultOptions.addElement("-password=guest"); - doInstallUninstall(suite, "http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", true, iDefaultOptions); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", true, iDefaultOptions); // Then start installation which downloads a large file. Log.log("InstallerEngineTest.testInstallAuthAndBig begin to install big app"); @@ -1120,7 +1144,7 @@ { "install", "-silent", - "-jad=http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_8mb_gcf.jsp", + "-jad=http://" + getTestServer() + "/installertest/HelloWorld_8mb.jad", }; int result = Installer.mainWithResult(args); // Check result code. diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/SifRegistratorTest.java --- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/SifRegistratorTest.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/SifRegistratorTest.java Tue Jul 13 16:05:52 2010 +0100 @@ -203,11 +203,23 @@ { SuiteInfo si = getTestSuite(); ComponentId cid = getComponentId(si.getGlobalId()); + // Check for USIF Phase 2 registration. Uid uid = sifReg.getUid(cid.getId()); assertTrue("Suite uid " + si.getUid() + " does not match" + " to uid " + uid + " from SCR", si.getUid().equals(uid)); + + Uid appUid = PlatformUid.createUid("[e0001001]"); + sifReg.startSession(false); + ComponentId cidForApp = sifReg.getComponentId(appUid); + sifReg.closeSession(); + assertTrue("Null component id from SCR for application uid " + + appUid, cidForApp != null); + assertTrue("Component id " + cid + " does not match" + + " to uid " + cidForApp + " from SCR", + cid.getId() == cidForApp.getId()); + // Check for USIF Phase 1 registration. //Vector apps = si.getApplications(); //for (int i = 0; i < apps.size(); i++) diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/customisationproperties/CustomisationPropertiesTest.java --- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/customisationproperties/CustomisationPropertiesTest.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/customisationproperties/CustomisationPropertiesTest.java Tue Jul 13 16:05:52 2010 +0100 @@ -212,18 +212,18 @@ String drive = (String)value.firstElement(); assertTrue("PossibleInstallationDrives is null", (drive != null)); - assertTrue("First PossibleInstallationDrive is not C:", drive.equals("C:")); + assertTrue("First PossibleInstallationDrive is not C:, it is " + drive, drive.equals("C:")); // second possible drive drive = (String)value.get(1); assertTrue("PossibleInstallationDrives is null", (drive != null)); - assertTrue("Second PossibleInstallationDrive is not E:", drive.equals("E:")); + assertTrue("Second PossibleInstallationDrive is not E:, it is " + drive, drive.equals("E:")); value = cust.getIntegerProperty(CustomisationProperties.PossibleInstallationDrives); assertTrue("PossibleInstallationDrives value is null", (value != null)); assertTrue("PossibleInstallationDrives value does not contain any integers", (value.size() > 0)); Integer idrive = (Integer)value.get(1); - assertTrue("Second PossibleInstallationDrive is E:", idrive.intValue() == 4); + assertTrue("Second PossibleInstallationDrive is not E:, it is " + idrive, idrive.intValue() == 4); } public void testTypesOfPossibleInstallationDrives() diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/DownloaderTest.java --- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/DownloaderTest.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/DownloaderTest.java Tue Jul 13 16:05:52 2010 +0100 @@ -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" @@ -37,8 +37,8 @@ */ public class DownloaderTest extends TestCase implements InstallerMain { - private static final String TEST_URL = "http://195.134.231.83:7070/java-server/resources/DS_Snow.jar"; - private static final int TEST_URL_SIZE = 10241; // test data file size + private static final String TEST_URL = "/installertest/HelloWorld.jar"; + private static final int TEST_URL_SIZE = 1511; // test data file size // Begin j2meunit test framework setup @@ -172,10 +172,15 @@ public void testBasicDownload(Downloader downloader, TestDlListener listener) { + String server = System.getProperty( + "com.nokia.mj.impl.installer.test.server"); + assertNotNull("-server=
: argument required.", server); + try { String filename = "test.dat"; - DownloadInfo dlInfo = new DownloadInfo(TEST_URL, filename); + DownloadInfo dlInfo = new DownloadInfo("http://" + server + + TEST_URL, filename); downloader.start(dlInfo); downloader.waitForCompletion(); assertTrue("Result DlInfo is null", diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/NotificationPosterTest.java --- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/NotificationPosterTest.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/NotificationPosterTest.java Tue Jul 13 16:05:52 2010 +0100 @@ -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" @@ -36,7 +36,7 @@ */ public class NotificationPosterTest extends TestCase implements InstallerMain { - private static final String TEST_URL = "http://195.134.231.83:7070/java-server/getresult.jsp?phone=CE0CBA106ADB77A9298A143E5136CD2B&tID=900_success"; + private static final String TEST_URL = "/installertest/notify?tID=900_success"; // Begin j2meunit test framework setup @@ -361,13 +361,18 @@ testNotifyPendingFailureLimit(poster); } - private static OtaStatusNotification createNotification(int aIndex) + private OtaStatusNotification createNotification(int aIndex) { + String server = System.getProperty( + "com.nokia.mj.impl.installer.test.server"); + assertNotNull("-server=
: argument required.", server); + OtaStatusNotification notification = new OtaStatusNotification (PlatformUid.createUid(Integer.toString(aIndex)), System.currentTimeMillis(), OtaStatusNotification.TYPE_INSTALL, OtaStatusCode.SUCCESS, - TEST_URL + aIndex, System.currentTimeMillis(), 0); + "http://" + server + TEST_URL + aIndex, System.currentTimeMillis(), + 0); return notification; } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/utils/SysUtilTest.java --- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/utils/SysUtilTest.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/utils/SysUtilTest.java Tue Jul 13 16:05:52 2010 +0100 @@ -167,6 +167,41 @@ } })); + if (Platform.isS60()) + { + suite.addTest(new SysUtilTest("testGetProcessState", new TestMethod() + { + public void run(TestCase tc) + { + ((SysUtilTest)tc).testGetProcessState(); + } + })); + + suite.addTest(new SysUtilTest("testDriveGetters", new TestMethod() + { + public void run(TestCase tc) + { + ((SysUtilTest)tc).testDriveGetters(); + } + })); + + suite.addTest(new SysUtilTest("testGetScreenSize", new TestMethod() + { + public void run(TestCase tc) + { + ((SysUtilTest)tc).testGetScreenSize(); + } + })); + + suite.addTest(new SysUtilTest("testIsoToLang", new TestMethod() + { + public void run(TestCase tc) + { + ((SysUtilTest)tc).testIsoToLang(); + } + })); + } + com.nokia.mj.impl.utils.OmjTestRunner.run(suite); } @@ -198,11 +233,11 @@ { try { - // Test PS keys defined in ScreensaverInternalPSKeys.h - Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver - int key = 0x00000001; // KScreenSaverPreviewMode + // Test PS keys defined in hwrmpowerstatesdkpskey.h + Uid uid = PlatformUid.createUid("0x10205041"); // KPSUidHWRMPowerState + int key = 0x00000003; // KHWRMChargingStatus int value = SysUtil.getPropertyValue(uid, key); - assertTrue("KScreenSaverPreviewMode(!=0): " + value, value == 0); + assertTrue("KHWRMChargingStatus(!=0): " + value, value == 0); } catch (InstallerException ie) { @@ -215,8 +250,8 @@ { try { - // Test PS keys defined in ScreensaverInternalPSKeys.h - Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver + // Test PS keys defined in hwrmpowerstatesdkpskey.h + Uid uid = PlatformUid.createUid("0x10205041"); // KPSUidHWRMPowerState int key = 0x00000010; // Undefined key int value = SysUtil.getPropertyValue(uid, key); assertTrue("Getting undefined property value did not fail", false); @@ -573,4 +608,51 @@ // OK, expected exception. } } + + public void testGetProcessState() + { + int state = SysUtil.getProcessState(PlatformUid.createUid("[102033e6]")); + assertTrue("installer process state is " + state + + ", not " + SysUtil.PROC_STATE_ALIVE, + SysUtil.PROC_STATE_ALIVE == state); + state = SysUtil.getProcessState(PlatformUid.createUid("[e0001001]")); + assertTrue("nonexisting process state is " + state + ", not 0", + 0 == state); + } + + public void testDriveGetters() + { + int defMem = SysUtil.getDefaultPhoneMemory(); + int defMassStorage = SysUtil.getDefaultMassStorage(); + Log.log("testDriveGetter: defaultPhoneMemory = " + defMem); + Log.log("testDriveGetter: defaultMassStorage = " + defMassStorage); + } + + public void testGetScreenSize() + { + int screenWidth = SysUtil.getScreenWidth(); + int screenHeight = SysUtil.getScreenHeight(); + Log.log("testGetScreenSize: screenWidth = " + screenWidth); + Log.log("testGetScreenSize: screenHeight = " + screenHeight); + assertTrue("screenWidth <= 0", screenWidth > 0); + assertTrue("screenHeight <= 0", screenHeight > 0); + } + + public void testIsoToLang() + { + testIsoToLang("unknown", -1); // unknown locale is indicated with -1 + testIsoToLang("fi", 9); // ELangFinnish, Finnish + testIsoToLang("fi_FI", 9); // ELangFinnish, Finnish + testIsoToLang("sv", 6); // ELangSwedish, Swedish + testIsoToLang("sv_FI", 85); // ELangFinlandSwedish, Finland Swedish + testIsoToLang("en", 1); // ELangEnglish, UK English + testIsoToLang("en_US", 10); // ELangAmerican, American + testIsoToLang("en_AU", 20); // ELangAustralian, Australian English + } + + private void testIsoToLang(String aLocale, int aLang) + { + assertTrue("SysUtil.isoToLang " + aLocale + " != " + aLang, + SysUtil.isoToLang(aLocale) == aLang); + } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000019.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000019.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000046.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000046.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000058.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000058.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000070.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000070.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000090.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000090.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000150.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000150.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000172.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000172.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000175.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000175.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000182.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000182.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000189.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000189.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000250.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000250.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000305.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000305.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000390.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000390.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000500.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000500.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000582.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000582.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000618.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000618.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/00000703.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000703.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/3DSpaceShooter.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/3DSpaceShooter.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,18 @@ + +MIDlet-1: 3DSpaceShooter, /icon.png, Sapce3D + + +MIDlet-Jar-Size: 240229 + + +MIDlet-Jar-URL: 3DSpaceShooter.jar +MIDlet-Name: 3DSpaceShooter +MIDlet-Vendor: Innovative Ideas From Outer Space Ltd. + + + + +  +MIDlet-Version: 1.0.4 +Nokia-MIDlet-Original-Display-Size: 176,208 +Nokia-MIDlet-On-Screen-Keypad: navigationkeys \ No newline at end of file diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/800_x_N97_64GB_fr_speed_v5_32_01.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/800_x_N97_64GB_fr_speed_v5_32_01.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,99 @@ +RepositoryContentType: text/plain +UserAgent: NokiaN95/J2ME-IMPS +ShowStatusTextInCL: 0 +SpaceBetweenFriendsNameAndHisIcon: 3 +ShowDomain: 0 +MIDlet-Icon: /img/App.png +NormalPollRate: 12000 +TCPCIREnabled: 1 +Images: http://download.ko.mysite.fr/koi/j2me/enc/1111/ +SpecialKeys: -12 +Host: koi.ko.mysite.fr +TCPPingRate: 1560000 +EnableCommunitySelector: 1 +BackgoundImgPos: 0 +ScrollBarWidth: 5 +MIDlet-Vendor: Vodafone +BillingURL: http://koi.ko.mysite.fr/koi/sq.dll/awo_buy +UseTemplate: 1 +MaxFriendsNumber: 150 +StopTCPCIR: 1 +MIDlet-Version: 4.5.27 +SelectCommand: 1 +KeepAlive: 1500000 +SMSCIREnabled: 1 +MultiTrans: 5 +DefaultDomain: gmaeam1.com +EnableBackgroundImage: 0 +MicroEdition-Profile: MIDP-2.0 +TermsAndConditions: 1 +SeamlessLogin: 0 +GlobalMsgLength: 600 +MIDlet-Push-1: sms://:3716, ui.Main, * +RegisterConnection: 1 +ViewType: 0 +HTTPCIREnabled: 1 +IsTabFontBold: 1 +AboutNaming: PrerryLake_h_N97_fr_speed_v4_5_27 +InitMessage: 1 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-Jar-URL: 800€_x_N97_64GB_fr_speed_v5_32_01.jar +AnimationRate: 300 +Multitask: 0 +EnableSemitransparentHighlight: 0 +CheckContentType: 1 +MaxMsgNumber: 30 +Port: 80 +LoginURL: http:/koi.ko.mysite.fr/koi/sq.dll/dsw_daas +UseKeepAlive: 0 +MIDlet-Install-Notify: http://download.ko.mysite.fr/InstallNotify?c= +SelfUpgrade: 1 +MIDlet-Data-Size: 500 +AnimationEnabled: 1 +TitleUpdateRate: 7000 +EnableRenameFriend: 0 +SystemMessageUserTimeout: 25000 +Help: http://download.ko.mysite.fr/koi/j2me/enc/help/fr/ +UseDeviceTimeForIncomingMsg: 1 +TCPCIRReconnectCount: 3 +DefaultLanguage: de +MIDlet-1: Messenger,/img/App.png,ui.Main +MsgListHeightTuner: 8 +MIDlet-Name: Messenger +FontSize: 0 +WVExtension: /web/wv.dll/msn_imgw +RefreshChoiceOnStateChange: 0 +MIDlet-Permissions: javax.microedition.io.Connector.http,javax.microedition.io.Connector.https,javax.microedition.io.Connector.socket,javax.microedition.io.Connector.sms,javax.wireless.messaging.sms.receive,javax.microedition.io.PushRegistry,javax.microedition.media.control.VideoControl.getSnapshot,javax.microedition.io.Connector.file.read,javax.microedition.io.Connector.file.write +MaxConversations: 20 +SubscribePresence: 1 +PersistencyEnabled: 1 +RepositoryAlertMessage: Error loading application data. Please try again later. +GlobalMaxCharCount: 5000 +EnableEmoticonsSelector: 1 +IdleMode: 1 +SpacerHeight: 5 +TCPCIRReconnectRate: 3000 +MIDlet-Jar-Size: 502719 +BackgroundEnabled: 1 +IsCaseInsensitive: 1 +AlertToneMsg: http://download.ko.mysite.fr/koi/j2me/enc/dingdong.mp3 +NormalNoPollTransition: 1800000 +AlertToneContact: http://download.ko.mysite.fr/koi/j2me/enc/alalal.mp3 +NoPollStateEnabled: 0 +Device: 3 +SupportCustomUTF8: 0 +MIDlet-Info-URL: www.koikoikoi.com +MsgListWidthTuner: 15 +CommandsType: 1;4;2;4;3;8;5;4;6;2;8;2;9;7;10;4;11;8;23;4;24;3;37;2;68;2;69;7;76;4;80;2;86;6;87;1 +IdleModeTimeOut: 900000 +ShowAboutLogo: 1 +TopMarginFriendName: 2 +ContentLanguage: fr +FastPollRate: 7000 +NokiaTimeOut: 100 +FastNormalTransition: 20000 +EnableShortProfile: 1 +RepositoryVersion: 1 +MIDlet-Jar-RSA-SHA1: QhSjP7F1q3TGmmNC45cUGclVWB537GtcMLpplIJGe+TyDwJ1Mx5VssNHpp3Qs3C1WHLycvcfOkDT0CscStI0lV/5Xy33z192qEHIT5lkGVz1Rd1nfBHqrIBqv77H7dHW1tdU6RiVajx8jrYYXz+Yh/7U2kskmGXd0bLSYq2cuZZgkiT9YDOLa8OJ1Xn2U4/AYzonM1tjGQvkOniCvwqv0DXDW3GAial5w7hzB4txSopBgWiCO7sEPgkssJIvWQ2dsuLnwb3nU8gsUYWuRqidSI5Dm8mSOEA0zjRoREjTJjkqRZXX3r27rtp+omYh+VNCkXDneiNcaihWpkW5TgMhVg== +MIDlet-Certificate-1-1: MIIEOTCCAyGgAwIBAgILAQAAAAABFIeLkAEwCQYJKoZIhvcNAQEFBQAwUDELNAkGA1UEBhMCVVsxFzAVBgNVBAoIDlZvZGFmb25lIEdyb3VwMSgwJgYDVQQDEx9Wb2RhZm9uZSAoVHJ1c3RlZCBBcHBsaWNhdGlvbnMpMB4XDTA3MDgyMTA4MzA0NFoXDTEyMDgyMT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XBraS5jb20vY3JsLnYvVm9kYWZvbmVPcGVyYXRvckRvbWFpbi5jcmwwHQYDVR0lBBYwFAYIKwYBBQUHAwMGCCsGAQUFBwMJMB8GA1UdIwQYMBaAFEjdPe/gPJzfErEw/ZHhwen7l9wIMA0GCSqGSIb3DQEBBQUAA4IBAQCaehJEHzna6onjE8bCCsi7A5NxcQ2Cx85PYs67yxQZ0wMQq1khzxsOJPB7H4SoXlceNMvIxpgPFm/ZcLNdeyjoYOQccH+aS6GRSerYX3COdbtWA4Gjq/sB6ghoUZ74+VbXD3t9Rhrnt7fOMe1llWOcf/eoMmvOrJOrBPrC3ZxZEwyHAgyqEJDn2Z8KXTMUr41jge3KyhxRehflRcYhdXzwmE+8LOHaN7xLEZauOuafyBEVpjVN5UaaOm/v8mTn0TymV2j9R7D8Nycbz1gVeMrOhNW2GODxjvu5IoEHQh/myul28EecKGx05Xprcodr0a8Q6LKJg+ihJMxMrS3YEylp diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,10 @@ +MIDlet-Jar-URL: https://uljava.gjmptw.de/midlets/harmonized/Local%20Connectivity%20(BT%20and%20IrDa)/BCExchanger/BCExchanger.jar +MIDlet-Install-Notify: https://uljava.gjmptw.de/Index/Index.php/BCExchanger.jad?installed=BCExchanger_harmony +MIDlet-1: BCExchangerMIDlet, /icon.png, bcexchanger.BCExchangerMIDlet +MIDlet-Description: Demonstrates the usage of the JSR-82 Bluetooth OBEX API by exchanging business cards between devices. +MIDlet-Jar-Size: 29967 +MIDlet-Name: BCExchanger +MIDlet-Vendor: Forum Nokia +MIDlet-Version: 1.0.0 +MicroEdition-Configuration: CLDC-1.1 +MicroEdition-Profile: MIDP-2.0 diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.zip Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.zip has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/DevCertTestMIDlet.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/DevCertTestMIDlet.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,14 @@ +MIDlet-1: DevCertTestMIDlet, , com.nokia.midp.test.devcerttests.DevCertTestMIDlet +MIDlet-Jar-Size: 3152 +MIDlet-Jar-URL: DevCertTestMIDlet.jar +MIDlet-Name: DevCertTestMIDlet +MIDlet-Permissions: javax.microedition.pim.ContactList.read,javax.microedition.pim.ContactList.write,javax.microedition.io.Connector.http +MIDlet-Permissions-Opt: javax.microedition.io.Connector.https +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +httpUrl: http://www.google.com +httpsUrl: https://www.google.com +MIDlet-Certificate-1-1: MIJs7jCCbFegAwIBAgIJAPNUaScSr5cxMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9EZXZpY2VfTWFudWZhY3R1cmVyMB4XDTA5MDkxNjExNDk1M1oXDTEwMDkxNjExNDk1M1owNTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFDASBgNVBAMTC0phdmFEZXZDZXJ0MIGfMA0GCSqGSIb3DQEBAQUAA4GN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jIzNTY3NAwPNDA3NDc4Mzg0MTExMzQxDA8xNDgxMDI1NzU3MzA3MjEMDzY1MDY1ODI2MTQ1MzE3MQwPMDgyMzU0MjIwNzQ2NzU3DA82MjQ4MjY2NDc4MTE1ODIMDzI3MjI2MTI3Mjc0NDA0NAwPNTIwMjIwNzgwMTc2MTY2DA81MDE1MzI4MDE0MDgxMjUMDzI1NDMwMzcwMDQyODgyOAwPNjc0NDc4ODY4MzQ4MjgxDA80NjMzMTY3NDU1MjcyNzUMDzQ3MTE4NTQ1MDIwMzEyMgwPNjM1NDgwMjg2MTEzNjUyDA82MTM0MzE4MjI4NTI3NzMMDzIyMTYzNDczNDg2MTA4NgwPNjE4NjU3NDcxNzUyMTE0DA8zMjg1MjU1MTIzMTgwNzAMDzQ2MTAzMTQ0NDAzMDMyNAwPNTc2ODU4NDI3MjE0MTg2DA82NjU0MDAwNjgwMjgxMzEMDzMwNTcyMzIxODQ0MTgxMwwPNTQ1MTg0NDYwMDg4NTQ2DA82ODExMDczNDM4Njg3MzgwDQYJKoZIhvcNAQEFBQADgYEAQq6zHN8SP8w71Yyq+cwwNQ2VZ4UMPRw/9JkW8ZUJWC4gae2lOfeyyjtN3akXaT+p+vETtfoPuCpPjvzPYoN1RZieyJnpSVzUrNw/lM6kSP5DjGg5K/WKWYad0VkQg56Kynp2YVX4yKUhBydd7iBeSGP900LAHRWCR++xq+r98mI= +MIDlet-Jar-RSA-SHA1: PRpjLFh81oAjHdPSZ/9lTe64ICSSHOk/MQMdRSqwsoGMSPID91mBRFEYOIQ/5nocEscacSi81o089Y0gMpEIP8V/EWBD7WDP6xqjC0gSyac+QjZm1Bu7Pzav+JC5J3KEkKOGy4wgQKJx02bArR/P9LhYAe7T6LVVFbfFyw2lhJA= diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/Empty.jad diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/EmptyLines.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/EmptyLines.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + +  +  + +  \ No newline at end of file diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/FL_Rocks.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/FL_Rocks.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,6 @@ +MIDlet-Version: 1.0 +MIDlet-Vendor: Standing Still Limited +MIDlet-Jar-URL: http://195.114.231.97:7001/dls/delivery/ds/01AAvJ1WX3jmZsurMwoC/1/FL_Rocks.dm +MIDlet-Install-Notify: http://195.114.231.97:7001/dls/delivery/ds/01AAvJ1WX3jmZsurMwoC/2/FL_Rocks/status +MIDlet-Name: Rocks +MIDlet-Jar-Size: 28196 diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/NDRM.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/NDRM.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,10 @@ +MIDlet-Jar-URL: NDRM.jar +MIDlet-Install-Notify: http://uljava.gjmptw.de:8080/Index/Index/NDRM.jad? nstalled=NDRM_harmony +MIDlet-Name: DRMonitor +MIDlet-Vendor: m-internet.com Limited +MIDlet-Version: 1.0 +MIDlet-Jar-Size: 24472 +MIDlet-Icon: /icon.png +MIDlet-1: NDRM, /icon.png, ndrm.NDRMMIDlet + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/PlatformReqHTTP.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/PlatformReqHTTP.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,11 @@ +MIDlet-1: PlatformReqHTTP, , com.nokia.midp.test.securitytests.PlatformReqHTTP +MIDlet-Jar-Size: 2272 +MIDlet-Jar-URL: PlatformReqHTTP.jar +MIDlet-Name: PlatformReqHTTP +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +URL: http://tcktest3.extra.wirelessfuture.com:8080/axis/servlet/marika.GetServlet +MIDlet-Certificate-1-1: MIICPDCCAaUCBD+zblMwDQYJKoZIhvcNAQEEBQAwZTELMAkGA1UEBhMCZmkxEDAOBgNVBAgTB1Vua25vd24xEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQwwCgYDVQQLEwNKQ0YxFDASBgNVBAMTC01hcmlrYSBGYWJlMB4XDTAzMTExMzExNDMxNVoXDTEzMTExMDExNDMxNVowZTELMAkGA1UEBhMCZmkxEDAOBgNVBAgTB1Vua25vd24xEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQwwCgYDVQQLEwNKQ0YxFDASBgNVBAMTC01hcmlrYSBGYWJlMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDsUJbYMb9GlP99Ax9n6m2AIAg+b2zC0u6h7OuLP+ls9OpI0sLtE1uBABCePloS0uKwmjtsdFc1zLyA/bpbi644xDw3PMIEhppeuKbLrog5uMk5wD1bFk5kJXYwYEorWVrFpLDmqFwEMig2a+Uhf7eTq1Ze/JgMHoUDXRo0eVsnFwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBACuTqh37N34NnVzziuj66gmiE3rt7fKDTUCiqoHGfv7dpr4M0e8+y6FvtXtUXEajxX/DZbZuy0E9mZqmXsYyP2DDKbCg4cBJ23uOCffuYYVQFSnv4RQFVrQr4jMUHgX7wT5Ox4Ee8xcpsvWWfOgTY4zyEznOBUj6Uw4Xj7F+1yk8 +MIDlet-Jar-RSA-SHA1: UfQMdprNMMmJOk9INrJXe+Y06tnuL+zOJz4gJNEKnLPOzb6UwR2zczNddwfdBxENKbhw2RVp3GBQD2OZjB6UEU4kiw2S956RMlk5OVfqwXB5wvYPCePX6/8qgKSUmsBjNiEpXBGE2UT7MqbRApxmsf/OaDnzzd9Tlr9jUw+YU3w= diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-Name: SimpleRMS +Created-By: 1.5.0_12 (Sun Microsystems Inc.) +MIDlet-Vendor: Unknown +MIDlet-1: SimpleRMS, SimpleRMS.png, SimpleRMS +MIDlet-Version: 1.0 +MicroEdition-Profile: MIDP-2.0 + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,24 @@ +IGP-BS: MP3D=MP3D_BS;SCDA=SCDA_BS;ASP3=ASP3_BS;PSDK=PSDK_BS; +IGP-CATEGORIES: WN=WN;BS=BS;PROMO=0;OP=OP; +IGP-DEMOS: DEMOPG=DEL; +IGP-PROMOS: MB3D=MB3D;PB07=PB07;BBRK=BBRK; +IGP-VERSION: 2.5.0 +IGP-WN: RBPF=RBPF_WN;MMN=MMN_WN;BRBO=BRBO_WN;ASCR=ASCR_WN; +MIDLET-FULLVERSION-URL: http://advers.bestgamfts.com/redir/?from=D725&game=MD3D&op=GONG&game_type=DM&lg=EN +MIDlet-1: Sun Shines 3D Demo, /icon.png, HightS3D +MIDlet-Data-Size: 8192 +MIDlet-Description: Sun Shines 3D, Emulated sun shine in full 3D! +MIDlet-Icon: /icon.png +MIDlet-Jar-Size: 754864 +MIDlet-Jar-URL: SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.jar +MIDlet-Name: Sun Shines 3D Demo +MIDlet-Vendor: Celedons Two +MIDlet-Version: 1.0.4 +Nokia-MIDlet-Block-Uninstall: true +Nokia-MIDlet-Category: Applications +Nokia-MIDlet-UID-1: 0x20012293 +Nokia-Scalable-Icon: /icon.svg +Nokia-Scalable-Icon-MIDlet-1: /icon.svg +URL-OPERATOR: http://bestgamfts.hereis.com/redir/?from=D725&op=GONG&game_type=DM&lg=EN&ver=2.5.0 +URL-PT: 0 +URL-TEMPLATE-GAME: http://bestgamfts.hereis.com/redir/?from=D725&op=GONG&game=XXXX&game_type=DM&lg=EN&emb=1&ver=2.5.0 diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.zip Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.zip has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,14 @@ +MIDlet-1: TestMidlet, TestMidlet.png, TestMidlet +MIDlet-Jar-Size: 3674 +MIDlet-Jar-URL: TestMidlet.jar +MIDlet-Name: TestMidlet +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +: Empty attribute name + : White space only attribute name + : White space only attribute name 2 +a<>: separators in attribute name +bo: control characters in attribute name +c: diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet2.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet2.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,3 @@ +a<>: separators in attribute name +bo: control characters in attribute name +c: diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet3.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet3.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,9 @@ +MIDlet-1: TestMidlet, TestMidlet.png, TestMidlet +MIDlet-Jar-Size: 3674 +MIDlet-Jar-URL: TestMidlet.jar +MIDlet-Name: TestMidlet +MIDlet-Vendor: Nokia +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +o: attribute name starts with CTL characters +MIDlet-Version: 1.0 diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,32 @@ +MIDlet-1: Calculator, i.png,common.control.CalculatorMIDlet +MIDlet-Name: Calculator +MIDlet-Vendor: Nokia +MIDlet-Version: 1.5 +MIDlet-Jar-Size: 123 +Nokia-MIDlet-Category: Application +Nokia-UI-Enhancement: CanvasHasBackground +MIDlet-Data-Size: 150 +Vertical-Move-Delta: 10 +Vertical-Move-Period: 2 +Inline-Editing-Supported: true +Nokia-Platform: Nokia* +Nokia-MIDlet-Category: Games +Nokia-MIDlet-Name-en: Calculator +Nokia-MIDlet-Name-de: Rechner +Nokia-MIDlet-Name-es-ES: Calculadora +Nokia-MIDlet-Name-fr: Calculatrice +Nokia-MIDlet-Name-it: Calcolatrice +Nokia-MIDlet-Name-tr-TR: Hesaplamalar +Nokia-MIDlet-Name-nl-NL: Rekenmachine +Nokia-MIDlet-Name-pt-PT: Calculadora +Nokia-MIDlet-1-en: Calculator +Nokia-MIDlet-1-de: Rechner +Nokia-MIDlet-1-es-ES: Calculadora +Nokia-MIDlet-1-fr: Calculatrice +Nokia-MIDlet-1-it: Calcolatrice +Nokia-MIDlet-1-tr-TR: Hesaplamalar +Nokia-MIDlet-1-nl-NL: Rekenmachine +Nokia-MIDlet-1-pt-PT: Calculadora +MIDlet-Jar-Size: 84713 +MIDlet-Jar-URL: calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.jar +Nokia-MIDlet-Category: Best-Sellers diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.zip Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.zip has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/ceac00.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceac00.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ASCII +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceac00/bin/CEAC00.jar +MIDlet-Jar-Size: 1494 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ASCII,,USASCII.CEAC00_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=9F732D83F3B6AF98EB6577EA92366D95&tID=ceac00 + + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/cecn02.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cecn02.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ùÓùÔùÕ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cecn02/bin/CECN02.jar +MIDlet-Jar-Size: 1417 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ùÓùÔùÕ, ,Big5.CECN02_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=C9EABB544D0A47788C684D71A5A1C8C9&tID=cecn02 + + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/cecn06.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cecn06.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ‚X‚Y‚Z‚[ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cecn06/bin/CECN06.jar +MIDlet-Jar-Size: 1415 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ‚X‚Y‚Z‚[,,GBK.CECN06_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=79CD95B6352F8388513D6DDB699817CF&tID=cecn06 + + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/ceis00.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis00.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,19 @@ +MIDlet-Name: ÷ùø + +MIDlet-Vendor: Nokia + +MIDlet-Version: 1.0 + +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceis00/bin/CEIS00.jar + +MIDlet-Jar-Size: 1450 + +MIDlet-1: ÷ùø, , ISO8859_1.CEIS00_01 + +MicroEdition-Configuration: CLDC-1.0 + +MicroEdition-Profile: MIDP-2.0 + +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=1D11AB7B2A1E2BC200165EB4CF554232&tID=ceis00 + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/ceis09.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis09.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,11 @@ +MIDlet-Name: ¢£¤ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceis09/bin/CEIS09.jar +MIDlet-Jar-Size: 1457 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ¢£¤, ,ISO8859_15.CEIS09_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=7F914DE931B9D04E5F731F1ADCD163F6&tID=ceis09 + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/ceis14.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis14.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ??» +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceis14/bin/CEIS14.jar +MIDlet-Jar-Size: 1456 +MIDlet-1: ??», ,ISO8859_16.CEIS14_01 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=336AA79A2E085DC20583865B841DBE6B&tID=ceis14 + + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/cejp04.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cejp04.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,4 @@ +MIDlet"DNa"De:"D"D@!"D"D"D"D"D"D"DMIDlet"DVe"Ddo"D"D"DNoki"D"D"DMIDlet"DVe"D"Dio"D"D"D1."D"D"DMIDlet"DJa"D"DURL:"DCEJP04"Dja"D"D"DMIDlet"DJa"D"DSi"De:"D1439"D"DMIDlet"D1:"D"D@!"D"D"D"D"D"D"D"DJISX0208"DCEJP04_0"D"D"DMicr"DEditio"D"DCo"Dfigu"Datio"D"D"DCLDC"D1."D"D"DMicr"DEditio"D"DPr"Dfile"D"DMIDP"D2."D"D"D +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=CF0B99F53572032690A4D26E0CB83D02&tID=cejp04 + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/ceko01.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceko01.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,11 @@ +MIDlet-Name: ÍÎÏÐ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceko01/bin/CEKO01.jar +MIDlet-Jar-Size: 1429 +MIDlet-1: ÍÎÏÐ, ,KOI8_R.CEKO01_01 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=64E5A88BE41622497EDF05039C15F26C&tID=ceko01 + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/cems01.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cems01.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ýþ€ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cems01/bin/CEMS01.jar +MIDlet-Jar-Size: 1465 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ýþ€, ,windows_1250.CEMS01_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=3F627BEFBC6E8A0FB9510BA4EB42AE6F&tID=cems01 + + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/cems11.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cems11.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ýþÿ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cems11/bin/CEMS11.jar +MIDlet-Jar-Size: 1467 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ýþÿ, ,windows_1256.CEMS11_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=3EBDFC736561D6876CF9ED93D3BF1B36&tID=cems11 + + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/ceut03.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut03.jad has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/ceut04.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut04.jad has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/ceut08.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut08.jad has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/ceut09.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut09.jad has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/einstein_EN_FR_IT_DE_ES_N97_v2942.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/einstein_EN_FR_IT_DE_ES_N97_v2942.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/javahelper.mif Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/javahelper.mif has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/mine_en_fr_de_it_es_ES_pt_PT.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/mine_en_fr_de_it_es_ES_pt_PT.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,33 @@ +MIDlet-Name: HecticMine +MIDlet-1: HecticMine,/images/icon.png,com.nokia.mid.appl.mine.common.MineMIDlet +Nokia-MIDlet-Category: Game +MIDlet-Icon: /images/icon.png +MIDlet-Vendor: Nokia +MIDlet-Version: 3.0.4 +MIDlet-Description: HecticMine +Period-Speed-ms: 100 +Vertical-Text-Offset: -2 +Nokia-Platform: Nokia* +Nokia-MIDlet-Name-en: +Nokia-MIDlet-Name-fr: Hectic Mine +Nokia-MIDlet-Name-de: Hectic Mine +Nokia-MIDlet-Name-it: Hectic Mine +Nokia-MIDlet-Name-es-ES: Hectic Mine +Nokia-MIDlet-Name-pt-PT: Hectic Mine +MIDlet-Jar-Size: 233616 +MIDlet-Jar-URL: mine_en_fr_de_it_es-ES_pt-PT.jar +MIDlet-Certificate-1-1: MIIDhDCCAmygAwIBAgIEQhnyeTANBgkqhkiG9w0BAQUFADAzMQ4wDAYDVQQKEwVOb2tpYTEhMB8 + GA1UEAxMYTm9raWEgQ29udGVudCBTaWduaW5nIENBMB4XDTA1MDIyMTE0Mzg0OVoXDTE2MDEwMjExMDUwNFowKDEOMAwGA1UEC + hMFTm9raWExFjAUBgNVBAMTDU5va2lhIENvbnRlbnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAK2PV8KLVSZ9OePe4k + 78GeQ0MiujbMd1wU9/xqhUFPst50drxhKzH+fMxvXgQOJ7viReolqWyq+ZmKpikGa+6SdqHysnVBhAqo9SLMNjlMfoOXVJ/lvM + gOk9k5oyVhBqFonw/FDDHmINC6w9o83e3gRq1C1m2T368yHbZtKifiVdAgMBAAGjggEtMIIBKTAOBgNVHQ8BAf8EBAMCB4AwEw + YDVR0lBAwwCgYIKwYBBQUHAwMwggEABgNVHSAEgfgwgfUwgfIGCysGAQQBXgExAQMBMIHiMIHRBggrBgEFBQcCAjCBxBqBwVJl + bGlhbmNlIG9uIHRoaXMgY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0YW5jZSBvZiB0aGUgc3RhbmRhcm + QgdGVybXMgYW5kIGNvbmRpdGlvbnMgYW5kIGxpbWl0YXRpb25zIG9mIHVzZSwgYXMgZGV0YWlsZWQgaW4gdGhlIENlcnRpZmlj + YXRlIFByYWN0aWNlIFN0YXRlbWVudCBhdmFpbGFibGUgZnJvbSBOb2tpYS4wDAYIKwYBBQUHAgEWADANBgkqhkiG9w0BAQUFAA + OCAQEAvXtgKSffVjD52zHgUEFBBmXFq3QjgWNh8+cQTD23wnPYgfA4GBomMmznLiV3X03SOOI42DUUenQ9baPb78iU8AngF6xd + oOpFYlNtVka9YdD9mA0jtkoe4YEmykxPabSKDS50xVYgQG+5Y9H8nO9EyIiviP6drFmpRv635mf8Trlao63XIx4geoCMb9v8vS + dfs0louKB9DrjwFki/uHAQvRcVYnFNtAwHdri22UMx+GMppuY4/oPVvQqxgzfP+1AX/w2lgG7pi3lbVVUB4MLhG36kZIk8/J7B + lmATAL1/G5t19HR3+9doz5H94y3WQG7ClWN1eoQtjLlvLfZO/iu20g== +MIDlet-Jar-RSA-SHA1: ncuy0soEPUB4OPGHNyLn1ldXU2FvKvs0bUKGn/aPQefKI15aOlrczlapIWreUukE3ArQImU/xwxWh0 + Q8LROEULJKXRIYyoGCCblM6o6EPYn+YT+CDd/HV8JlHS6OO+sAV//9vWuo9orIwSwdKN8wGl0g1JmPl8LF8V5/MjSmyh8= \ No newline at end of file diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testdata/utils/utf8bom.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/utf8bom.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,8 @@ +MIDlet-Name: ışÿ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: utf8bom.jar +MIDlet-Jar-Size: 1417 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ışÿ, ,UTF8BOM.UTF8BOM diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/build/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/build/build.xml Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/build/readme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/build/readme.txt Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,41 @@ +Building +-------- + +Requirements: + * Apache Ant. + * Apache Tomcat. (Tested with 6.0.26) + +Change "catalina.home" property in build.xml file to match your Tomcat +installation directory. Default is as follows: + + + +To compile the project and to create .war archive just use either of following +commands: + + ant + ant dist + +To compile only use: + + ant compile + +And to clean all build artifacts use: + + ant clean + +Deployment +---------- + +After build is complete, "installertest.war" file is created into the "build" +directory. Deploy it to Tomcat instance as any other .war file. For HTTP +authentication tests it is assumed that user named "guest" with password +"guest" and with role "guest" exits. + +Running the tests +----------------- + +Before running tests add option "-server=server_ip_address:port" to +NotificationPosterTest, DownloaderTest and InstallerEngineTest +test suites in jiut.bat (for S60) or in build.xml (for Linux) +in "javainstaller\installer\tsrc\build" directory. diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,8 @@ +MIDlet-1: HelloWorld, , helloworld.HelloWorld +MIDlet-Jar-Size: 1511 +MIDlet-Jar-URL: HelloWorld.jar +MIDlet-Name: HelloWorld +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 \ No newline at end of file diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jar Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,10 @@ +MIDlet-1: HelloWorld, , helloworld.HelloWorld +MIDlet-Jar-Size: 7867927 +MIDlet-Jar-URL: HelloWorld_8mb.jar +MIDlet-Name: HelloWorld_8mb +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +MIDlet-Install-Notify: http:///notify?tID=900_success +MIDlet-Delete-Notify: http:///notify?tID=912_deletion diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jar Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_ota.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_ota.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,10 @@ +MIDlet-1: HelloWorld, , helloworld.HelloWorld +MIDlet-Jar-Size: 1511 +MIDlet-Jar-URL: HelloWorld.jar +MIDlet-Name: HelloWorld +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +MIDlet-Install-Notify: http:///notify?tID=900_success +MIDlet-Delete-Notify: http:///notify?tID=912_deletion diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,9 @@ +MIDlet-1: HelloWorld, , helloworld.HelloWorld +MIDlet-Jar-Size: 1719 +MIDlet-Jar-URL: http:///redirect?name=HelloWorld_redirect.jar +MIDlet-Name: HelloWorld_redirect +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +MIDlet-Install-Notify: http:///notify?tID=900_success diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jar Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/MANIFEST.MF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/MANIFEST.MF Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/context.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/context.xml Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/WEB-INF/web.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/WEB-INF/web.xml Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,73 @@ + + + + installertest + + + + redirect + redirect + com.nokia.mj.impl.installer.testserver.RedirectServlet + + + redirect + /redirect + + + + + jad + jad + com.nokia.mj.impl.installer.testserver.JadServlet + + + jad + *.jad + + + + + notify + notify + com.nokia.mj.impl.installer.testserver.NotifyServlet + + + notify + /notify + + + + + + /httpauth/* + + + guest + + + + BASIC + httpauth + + + + guest + + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/httpauth/HelloWorld_http_auth.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/httpauth/HelloWorld_http_auth.jad Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,8 @@ +MIDlet-1: HelloWorld, , helloworld.HelloWorld +MIDlet-Jar-Size: 1721 +MIDlet-Jar-URL: HelloWorld_http_auth.jar +MIDlet-Name: HelloWorld_http_auth +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 \ No newline at end of file diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/content/httpauth/HelloWorld_http_auth.jar Binary file javamanager/javainstaller/installer/tsrc/testserver/content/httpauth/HelloWorld_http_auth.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/JadServlet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/JadServlet.java Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,104 @@ +/* +* 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.installer.testserver; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.FileNotFoundException; +import java.io.IOException; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class JadServlet + */ +public class JadServlet extends HttpServlet +{ + private static final long serialVersionUID = 1L; + + protected void processRequest(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + ServletContext context = getServletContext(); + String localPath = context.getRealPath(request.getServletPath()); + + response.setContentType("text/vnd.sun.j2me.app-descriptor"); + + BufferedReader in = null; + ServletOutputStream out = null; + + try + { + in = new BufferedReader(new FileReader(localPath)); + out = response.getOutputStream(); + + String line = in.readLine(); + while (line != null) + { + if (line.startsWith("MIDlet-Jar-URL:") + || line.startsWith("MIDlet-Install-Notify:") + || line.startsWith("MIDlet-Delete-Notify:")) + { + line = line.replaceAll("", request.getServerName() + + ":" + request.getServerPort()); + line = line.replaceAll("", + request.getContextPath()); + } + out.println(line); + line = in.readLine(); + } + } + catch (FileNotFoundException e) + { + response.sendError(HttpServletResponse.SC_NOT_FOUND, + request.getServletPath()); + } + finally + { + if (out != null) + { + out.close(); + } + if (in != null) + { + in.close(); + } + } + } + + protected void doGet(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + + protected void doPost(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + +} diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/NotifyServlet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/NotifyServlet.java Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,54 @@ +/* +* 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.installer.testserver; + +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class NotifyServlet + */ +public class NotifyServlet extends HttpServlet +{ + private static final long serialVersionUID = 1L; + + protected void processRequest(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + response.setStatus(HttpServletResponse.SC_OK); + } + + protected void doGet(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + + protected void doPost(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + +} diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/RedirectServlet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/RedirectServlet.java Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,84 @@ +/* +* 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.installer.testserver; + +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class RedirectServlet + */ +public class RedirectServlet extends HttpServlet +{ + private static final long serialVersionUID = 1L; + + protected void processRequest(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + int redirectCount = 1; + String redirectUrl = "http://" + request.getServerName() + ":" + + request.getServerPort() + + request.getContextPath(); + + String countParam = request.getParameter("count"); + String nameParam = request.getParameter("name"); + + if (countParam != null) + { + try + { + redirectCount = Integer.parseInt(countParam); + } + catch (NumberFormatException nfe) + { + } + } + + if (redirectCount > 1) + { + redirectUrl += request.getServletPath() + "?count=" + + (redirectCount - 1) + "&name="; + } + else + { + redirectUrl += "/"; + } + + redirectUrl += nameParam; + response.sendRedirect(redirectUrl); + } + + protected void doGet(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + + protected void doPost(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + +} diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/build/build.xml --- a/javamanager/javainstaller/installerui/build/build.xml Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/build/build.xml Tue Jul 13 16:05:52 2010 +0100 @@ -1,6 +1,6 @@ @@ -50,6 +50,16 @@ + + + + + + + + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/data/java_3_trusted.png Binary file javamanager/javainstaller/installerui/data/java_3_trusted.png has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/data/java_3_untrusted.png Binary file javamanager/javainstaller/installerui/data/java_3_untrusted.png has changed diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/data/javaapplicationinstaller.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installerui/data/javaapplicationinstaller.css Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,196 @@ +/* +* 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: +* +*/ + +QScrollArea#dialogArea { + /* General size parameters for all installer dialogs */ + + /* this depends on display; NHD portrait width:360px and height:640px used */ + /* Note that popup width and height is according to portrait dimensions, and is the same in portrait and landscape */ + width: 346.6px; /*expr(var(hb-param-screen-short-edge)- 2*var(hb-param-margin-gene-screen)); /* 2un*/ + /*height: /*the size of MessageBox with 3-5 rows of text? */ + max-height: 626.6px; /*expr(var(hb-param-long-edge)-2*var(hb-param-margin-gene-screen)); + /*position: vertically and horizontally centre of screen - is this needed?*/ +} + +QScrollArea#appInfoArea { + /* This is valid for all installation query application details, + * and also for application details in short error message */ + /* (ViewBase) */ + /* Note: this text area becomes scrollable if there are more text + * that can be displayed at one time (this could be also QAbstractScrollArea?)*/ + margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ +} + +QLabel#heading { + /* Any installation query heading text: its text size, and top/left margins */ + font-size: 26.8px; /*hb-param-text-height-primary;/*4un*/ + font-weight: bold; + max-height: 53.6px; /*expr(var(hb-param-text-height-primary)+2*var(hb-param-margin-gene-popup)) - same as hb-param-widget-popup-heading-height;*/ + margin-top: 13.4px; /*hb-param-margin-gene-top; /*2un*/ + margin-left: 13.4px; /*hb-param-margin-gene-left; /*2un*/ +} + +QLabel#contentIcon { + /* This is valid for all icons displayed in the installation query content area */ + /* Application icon, question icon, error icon in installation error dialog etc */ + margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + /* size of icon - fixed size */ + min-width: 53.6px; /*hb-param-graphic-size-primary-large;/*8un*/ + max-width: 53.6px; /*hb-param-graphic-size-primary-large;/*8un*/ + min-height: 53.6px; /* hb-param-graphic-size-primary-large;/*8un*/ + max-height: 53.6px; /* hb-param-graphic-size-primary-large;/*8un*/ +} + +QComboBox#driveSelector{ + /* Combo box in installationquery. Need to define the top margin at least (InstallConfirmationView). */ + margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/ +} + +QProgressBar#progressBar{ + /* Progress bar in installationquery. Need to define the top margin at least (ProgressView). */ + margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/ +} + +QLabel#permissionDetails{ + /* String that requests access for protected functionality in permission query */ + /* (PermissionInfo) */ + margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ +} + +QLabel#errorLabel{ + /* short error message from USIF (note: this is not Java specific error message but + * common to all installers), (ErrorView) */ + font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/ + margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/ +} + +QLabel#detailsWarningLabel{ + /* Application is certified / is not certified views and permission details + * view texts (CertificateDetailsView, PermissionDetailsView) */ + font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/ +} + +QLabel#authLabel{ + /* Text in authentication dialog (UsernamePasswordView) */ + /* Note that this dialog is always in portrait */ + font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/ + margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ +} + +QLabel#usernamePasswordLabel{ + /* Label of username and password input fields in authentication dialog (UsernamePasswordView) */ + /* Note that this dialog is always in portrait */ + font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/ + margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ +} + +QLabel#usernamePasswordInputField{ + /* Input fields of username and password in authentication dialog (UsernamePasswordView) */ + /* Note that this dialog is always in portrait */ + font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/ + margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/ + margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-bottom: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ +} + +/* --- Buttons --- */ + +QPushButton { + font-size: 20.1px;/* hb-param-text-height-tiny; /*3un*/ +} + +QPushButton#softKeyButton{ + /* Installation query OK button (ConfirmationViewBase) */ + margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + height: 50.25px; /*hb-param-widget-popup-softkey-height;/*7.5un*/ + /* this depends on display; NHD portrait width:360px and height:640px used */ + width: 173.3px; /*expr((var(hb-param-screen-short-edge)-2*var(hb-param-margin-gene-screen))/2); /* width of one button is half of popup width*/ +} + +QPushButton#softKeyButtonWide{ + /* Ok button to go back from a details view (application is certified / not certified views + * and permission details view) (CertificateDetailsView, PermissionDetailsView)*/ + /* this ok button has different top margin otherwise the same as OkCommand button with max-width */ + margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/ + height: 50.25px; /*hb-param-widget-popup-softkey-height;/*7.5un*/ +} + +QPushButton#securityButton{ + /* Security lock icon button in installation query heading (ViewBase.createSecurityButton) */ + margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + /* size of icon */ + min-width: 26.8px; /* hb-param-graphic-size-primary-small; /*4un*/ + max-width: 26.8px; /* hb-param-graphic-size-primary-small; /*4un*/ + min-height: 26.8px; /* hb-param-graphic-size-primary-small; /*4un*/ + max-height: 26.8px; /* hb-param-graphic-size-primary-small; /*4un*/ + +} + +QPushButton#detailsLink{ + /* Button in permission query to view details (PermissionConfirmationView) */ + margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-left: 13.4px; /*hb-param-margin-gene-left; /*2un*/ + margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ +} + +QPushButton#allowButton{ + /* Allow always function button in permission query */ + /* (PermissionConfirmationView) */ + margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + +} + +QPushButton#denyButton{ + /* Ask me later function buttons in permission query */ + /* (PermissionConfirmationView) */ + margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/ +} + +QPushButton#cancelButton{ + /* Cancel installing function button in permission query */ + /* (PermissionConfirmationView) */ + margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/ + margin-bottom: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + +} + +QCheckBox#retainDataButton { + /* Retain user data check box button in update query */ + /* Note that there is 2*hb-param-margin-gene-middle-vertical margin at the top as this check box is placed + * after drive selector combo */ + /* (InstallConfirmationView) */ + margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/ + margin-top: 10.05px; /*expr(2*var(hb-param-margin-gene-middle-vertical)); +} + +/* --- End Buttons --- */ diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUi.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUi.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUi.java Tue Jul 13 16:05:52 2010 +0100 @@ -385,6 +385,13 @@ } /** + * Executes given Runnable synchronously in the UI thread. + */ + public void syncExec(Runnable aRunnable) + { + } + + /** * Writes an info log entry to JavaInstaller log. * * @param aMsg message to be logged diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUiFactory.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUiFactory.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUiFactory.java Tue Jul 13 16:05:52 2010 +0100 @@ -50,9 +50,9 @@ installerUi = (InstallerUi)clazz.newInstance(); installerUi.init(aMode, aListener); } - catch (Exception ex) + catch (Throwable t) { - logError("Instantiating " + className + " failed", ex); + logError("Instantiating " + className + " failed", t); } return installerUi; } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallDetailsView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallDetailsView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallDetailsView.java Tue Jul 13 16:05:52 2010 +0100 @@ -124,16 +124,11 @@ new String[] { iInstallInfo.getName() }), horizontalSpan, labelStyle); - if (identified) - { - // Vendor information must be displayed only for - // identified applications. - Label vendorLabel = createLabel - (InstallerUiTexts.get - (InstallerUiTexts.VENDOR, - new String[] { iInstallInfo.getVendor() }), - horizontalSpan, labelStyle); - } + Label vendorLabel = createLabel + (InstallerUiTexts.get + (InstallerUiTexts.VENDOR, + new String[] { iInstallInfo.getVendor() }), + horizontalSpan, labelStyle); Label versionLabel = createLabel (InstallerUiTexts.get diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallerUiEswt.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallerUiEswt.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallerUiEswt.java Tue Jul 13 16:05:52 2010 +0100 @@ -126,7 +126,6 @@ // Create a hashtable for icons. iImageTable = new Hashtable(); // Create a new thread to be the UI main thread. - iUiThreadExists = true; UIThreadSupport.startInUIThread(new Runnable() { public void run() @@ -145,6 +144,7 @@ private void uiMain() { log("uiMain: thread started"); + iUiThreadExists = true; try { // Create the necessary views. @@ -512,6 +512,12 @@ // updating it. synchronized (iProgressSyncObject) { + if (iDlProgressView != null && iDlProgressView.isVisible()) + { + // If download progress is being displayed, + // do not display installation progress. + return; + } if (iDisplayProgress && !iProgressView.isVisible()) { iProgressView.setVisible(true); @@ -994,6 +1000,14 @@ } /** + * Executes given Runnable synchronously in the UI thread. + */ + public void syncExec(Runnable aRunnable) + { + iParent.getDisplay().syncExec(aRunnable); + } + + /** * Returns string title basing on mode of this InstallerUi. */ protected String getTitle() diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/UninstallConfirmationView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/UninstallConfirmationView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/UninstallConfirmationView.java Tue Jul 13 16:05:52 2010 +0100 @@ -119,16 +119,11 @@ new String[] { iUninstallInfo.getName() }), horizontalSpan, labelStyle); - if (identified) - { - // Vendor information must be displayed only for - // identified applications. - Label vendorLabel = createLabel - (InstallerUiTexts.get - (InstallerUiTexts.VENDOR, - new String[] { iUninstallInfo.getVendor() }), - horizontalSpan, labelStyle); - } + Label vendorLabel = createLabel + (InstallerUiTexts.get + (InstallerUiTexts.VENDOR, + new String[] { iUninstallInfo.getVendor() }), + horizontalSpan, labelStyle); Label versionLabel = createLabel (InstallerUiTexts.get diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/CertificateDetailsView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/CertificateDetailsView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/CertificateDetailsView.java Tue Jul 13 16:05:52 2010 +0100 @@ -79,7 +79,7 @@ Label detailsLabel = createLabel( InstallerUiTexts.get(InstallerUiTexts.NOT_CERTIFIED_TITLE), horizontalSpan, labelStyle); - detailsLabel.setFont(iInstallerUi.getBoldFont()); + setCssId(detailsLabel, "heading"); // Add domain category label. createLabel("", horizontalSpan, labelStyle); @@ -103,6 +103,7 @@ new String[] { appName }), horizontalSpan, labelStyle); + setCssId(warningLabel, "detailsWarningLabel"); } /** @@ -118,7 +119,7 @@ (InstallerUiTexts.get (InstallerUiTexts.CERTIFICATE_TITLE), horizontalSpan, labelStyle); - detailsLabel.setFont(iInstallerUi.getBoldFont()); + setCssId(detailsLabel, "heading"); SigningCertificate certificate = iCerts[iCertIndex]; diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ConfirmationViewBase.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ConfirmationViewBase.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ConfirmationViewBase.java Tue Jul 13 16:05:52 2010 +0100 @@ -100,6 +100,7 @@ createCommands(); setDefaultCommand(); } + iInstallerUi.loadCss(); setVisible(true); iInstallerUi.unhide(); } @@ -184,6 +185,14 @@ if (iOkText != null) { iOkCommand = new Button(getCommandComposite(), SWT.PUSH); + if (iCancelText != null) + { + setCssId(iOkCommand, "softKeyButton"); + } + else + { + setCssId(iOkCommand, "softKeyButtonWide"); + } GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; iOkCommand.setLayoutData(gridData); @@ -230,6 +239,14 @@ if (iCancelText != null) { iCancelCommand = new Button(getCommandComposite(), SWT.PUSH); + if (iOkText != null) + { + setCssId(iCancelCommand, "softKeyButton"); + } + else + { + setCssId(iCancelCommand, "softKeyButtonWide"); + } GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; iCancelCommand.setLayoutData(gridData); diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorDetailsView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorDetailsView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorDetailsView.java Tue Jul 13 16:05:52 2010 +0100 @@ -69,20 +69,20 @@ protected void createView() { // Add title. + Label titleLabel = null; String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_FAILED); if (iInstallerUi.getInstallInfo() != null) { - Label titleLabel = createLabel(title, getColumns() - 1, SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); + titleLabel = createLabel(title, getColumns() - 1, SWT.WRAP); // Add security icon. iCertificates = iInstallerUi.getInstallInfo().getCertificates(); createSecurityButton(); } else { - Label titleLabel = createLabel(title, getColumns(), SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); + titleLabel = createLabel(title, getColumns(), SWT.WRAP); } + setCssId(titleLabel, "heading"); int horizontalSpan = getColumns(); int labelStyle = SWT.WRAP; @@ -90,6 +90,7 @@ // Begin widgets creation. Label errorLabel = createLabel( iException.getDetailedMessage(), horizontalSpan, labelStyle); + setCssId(errorLabel, "errorLabel"); // End of widgets creation. } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorView.java Tue Jul 13 16:05:52 2010 +0100 @@ -78,7 +78,7 @@ else { Label titleLabel = createLabel(title, getColumns(), SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); + setCssId(titleLabel, "heading"); } int horizontalSpan = getColumns(); @@ -87,6 +87,7 @@ // Begin widgets creation. Label errorLabel = createLabel( iException.getShortMessage(), horizontalSpan, labelStyle); + setCssId(errorLabel, "errorLabel"); // End of widgets creation. if (iInstallerUi.getInstallInfo() != null) diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallConfirmationView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallConfirmationView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallConfirmationView.java Tue Jul 13 16:05:52 2010 +0100 @@ -106,15 +106,7 @@ protected void createView() { // Add header. - String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY); - if (iInstallInfo != null) - { - if (iInstallInfo.getOldVersion() != null) - { - title = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY); - } - } - addHeader(title, iInstallInfo, null); + addHeader(null, iInstallInfo, null); GridData gridData = null; int horizontalSpan = getColumns(); @@ -126,6 +118,7 @@ { // Add installation drive selector. iDriveSelector = new Combo(getComposite(), SWT.READ_ONLY); + setCssId(iDriveSelector, "driveSelector"); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; iDriveSelector.setLayoutData(gridData); @@ -155,6 +148,7 @@ { // Add retain user data option. iRetainDataButton = new Button(getComposite(), SWT.CHECK); + setCssId(iRetainDataButton, "retainDataButton"); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; iRetainDataButton.setLayoutData(gridData); diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java Tue Jul 13 16:05:52 2010 +0100 @@ -27,7 +27,6 @@ import com.nokia.mj.impl.installer.ui.LaunchAppInfo; import com.nokia.mj.impl.installer.ui.PermissionInfo; import com.nokia.mj.impl.installer.ui.UninstallInfo; -import com.nokia.mj.impl.installer.ui.eswt.MinimalUi; import com.nokia.mj.impl.rt.ui.ConfirmData; import com.nokia.mj.impl.rt.ui.RuntimeUi; import com.nokia.mj.impl.rt.ui.RuntimeUiFactory; @@ -47,10 +46,10 @@ import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.ImageLoader; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.internal.extension.DisplayExtension; +import org.eclipse.swt.internal.qt.BaseCSSEngine; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Composite; @@ -62,10 +61,15 @@ */ public class InstallerUiEswt extends InstallerUi { + /** Disable UI temporarily. */ + private static final boolean DISABLE_UI = + (System.getProperty("com.nokia.mj.impl.installer.ui.disableui") + == null? false: true); /** Default shell style. */ private static final int SHELL_STYLE = SWT.BORDER | SWT.APPLICATION_MODAL | SWT.ON_TOP; + private BaseCSSEngine iCssEngine = null; private Shell iParent = null; private Shell iDialog = null; private ProgressView iProgressView = null; @@ -98,8 +102,6 @@ private boolean iDisplayProgress = false; /** Flag telling if the first progress bar update has been traced. */ private boolean iProgressBarUpdateTraced = false; - /** Flag telling if MinimalUi should be used if UI creation fails. */ - private boolean iMinimalUiEnabled = true; /** Hashtable for storing the loaded icons. */ private static Hashtable iImageTable = null; @@ -135,7 +137,6 @@ // Create a hashtable for icons. iImageTable = new Hashtable(); // Create a new thread to be the UI main thread. - iUiThreadExists = true; UIThreadSupport.startInUIThread(new Runnable() { public void run() @@ -154,12 +155,14 @@ private void uiMain() { log("uiMain: thread started"); + iUiThreadExists = true; try { // Create the necessary views. DisplayExtension display = new DisplayExtension(); StartUpTrace.doTrace("InstallerUiEswt display created"); display.setAppName(""); // Remove display title. + iCssEngine = new BaseCSSEngine(display); iParent = new Shell(display); iDialog = new Shell(iParent, SHELL_STYLE); iDefaultShellBounds = iDialog.internal_getDefaultBounds(); @@ -182,10 +185,10 @@ }); // Initialize best icon size. - iBestIconSize = new Point( - display.getBestImageWidth(DisplayExtension.ALERT), - display.getBestImageHeight(DisplayExtension.ALERT)); - log("Best icon size: " + iBestIconSize); + //iBestIconSize = new Point( + // display.getBestImageWidth(DisplayExtension.ALERT), + // display.getBestImageHeight(DisplayExtension.ALERT)); + //log("Best icon size: " + iBestIconSize); synchronized (iInitWaitObject) { @@ -302,24 +305,14 @@ super.confirm(aInstallInfo); waitForUi(); - boolean result = true; if (!isUiReady()) { - result = false; - if (iMinimalUiEnabled) - { - result = MinimalUi.confirmStatic(aInstallInfo); - log("MinimalUi installation confirmation returns " + result); - return result; - } - else - { - // If UI is not ready by the time confirmation is requested, - // throw an exception. - throw new RuntimeException("JavaInstallerUi not ready"); - } + // If UI is not ready by the time confirmation is requested, + // throw an exception. + throw new RuntimeException("JavaInstallerUi not ready"); } + boolean result = true; if (result) { StartUpTrace.doTrace("InstallerUiEswt confirm"); @@ -463,7 +456,7 @@ public void updateProgress(int aProgress) { super.updateProgress(aProgress); - if (true) return; // Disable UI temporarily. + if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -474,6 +467,12 @@ // updating it. synchronized (iProgressSyncObject) { + if (iDlProgressView != null && iDlProgressView.isVisible()) + { + // If download progress is being displayed, + // do not display installation progress. + return; + } if (iDisplayProgress && !iProgressView.isVisible()) { // Re-create iProgressView here so that it gets @@ -510,7 +509,7 @@ public void ended() { super.ended(); - if (true) return; // Disable UI temporarily. + if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -555,7 +554,7 @@ public void started(DownloadInfo aDownloadInfo) { super.started(aDownloadInfo); - if (true) return; // Disable UI temporarily. + if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -582,7 +581,7 @@ public void updateProgress(DownloadInfo aDownloadInfo) { super.updateProgress(aDownloadInfo); - if (true) return; // Disable UI temporarily. + if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -632,7 +631,7 @@ public void ended(DownloadInfo aDownloadInfo) { super.ended(aDownloadInfo); - if (true) return; // Disable UI temporarily. + if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -659,7 +658,7 @@ public void setOcspIndicator(boolean aOn) { super.setOcspIndicator(aOn); - if (true) return; // Disable UI temporarily. + if (DISABLE_UI) return; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { @@ -760,7 +759,7 @@ public void error(InstallerExceptionBase aInstallerException) { super.error(aInstallerException); - if (true) return; // Disable UI temporarily. + if (DISABLE_UI) return; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { @@ -857,7 +856,7 @@ */ public boolean confirm(String aAppName, ConfirmData aConfirmData) { - if (true) return true; // Disable UI temporarily. + if (DISABLE_UI) return true; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { return true; @@ -896,7 +895,7 @@ */ public String[] getUsernamePassword(String aUrl) { - if (true) return new String[] { "", "" }; // Disable UI temporarily. + if (DISABLE_UI) return new String[] { "", "" }; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { @@ -952,7 +951,7 @@ */ public boolean launchAppQuery(LaunchAppInfo aLaunchAppInfo) { - if (true) return false; // Disable UI temporarily. + if (DISABLE_UI) return false; // Disable UI temporarily. waitForUi(); if (!isUiReady() || iConfirmationsCanceled || getInstallInfo() == null) { @@ -974,19 +973,31 @@ }); } boolean result = iLaunchAppQueryView.launchAppQuery(aLaunchAppInfo); - iParent.getDisplay().syncExec(new Runnable() + iLaunchAppQueryView.dispose(); + iLaunchAppQueryView = null; + if (!result) { - public void run() + iParent.getDisplay().syncExec(new Runnable() { - iParent.dispose(); - } - }); - iLaunchAppQueryView = null; + public void run() + { + iParent.dispose(); + } + }); + } log("LaunchAppQuery returns " + result + " for " + aLaunchAppInfo); return result; } /** + * Executes given Runnable synchronously in the UI thread. + */ + public void syncExec(Runnable aRunnable) + { + iParent.getDisplay().syncExec(aRunnable); + } + + /** * Hides or unhides InstallerUi. */ public void hide(boolean aHide) @@ -1054,10 +1065,10 @@ { return iSecurityIcon; } - String iconFilename = ResourceUtil.UNTRUSTED_ICON_NAME; + String iconFilename = "java_3_untrusted.png"; if (aIdentified) { - iconFilename = ResourceUtil.TRUSTED_ICON_NAME; + iconFilename = "java_3_trusted.png"; } String resourceDir = ResourceUtil.getResourceDir(0); for (int i = 1; iSecurityIcon == null && resourceDir != null; i++) @@ -1154,19 +1165,21 @@ try { long startTime = System.currentTimeMillis(); - ImageData[] imageDatas = new ImageLoader().load(aInputStream); - ImageData imageData = imageDatas[0]; + Image image = new Image(aDisplay, aInputStream); + ImageData imageData = image.getImageData(); if (aScaleImage) { Point bestSize = getBestImageSize( - imageData.width, imageData.height); + imageData.width, imageData.height); if (bestSize.x != imageData.width || bestSize.y != imageData.height) { + Point oldSize = + new Point(imageData.width, imageData.height); imageData = imageData.scaledTo(bestSize.x, bestSize.y); log("Image " + aImageName + " scaled from " + - imageDatas[0].width + "x" + imageDatas[0].height + - " to " + bestSize.x + "x" + bestSize.y); + oldSize.x + "x" + oldSize.y + " to " + + bestSize.x + "x" + bestSize.y); } } result = new Image(aDisplay, imageData); @@ -1188,8 +1201,8 @@ */ private static Point getBestImageSize(int aWidth, int aHeight) { - final int MAX_WIDTH = iBestIconSize.x; - final int MAX_HEIGHT = iBestIconSize.y; + final int MAX_WIDTH = (iBestIconSize == null? 50: iBestIconSize.x); + final int MAX_HEIGHT = (iBestIconSize == null? 50: iBestIconSize.y); Point result = new Point(aWidth, aHeight); if (result.x > MAX_WIDTH || result.y > MAX_HEIGHT) { @@ -1317,4 +1330,37 @@ { return iActiveView; } + + /** + * Loads JavaInstaller UI stylesheet. + */ + void loadCss() + { + String cssFilename = "javaapplicationinstaller.css"; + String cssPath = null; + try + { + if (iCssEngine != null) + { + boolean loaded = false; + String resourceDir = ResourceUtil.getResourceDir(0); + for (int i = 1; !loaded && resourceDir != null; i++) + { + cssPath = resourceDir + cssFilename; + FileUtility cssFile = new FileUtility(cssPath); + if (cssFile.exists()) + { + iCssEngine.loadCSS(cssPath); + log("CSS loaded from " + cssPath); + break; + } + resourceDir = ResourceUtil.getResourceDir(i); + } + } + } + catch (Throwable t) + { + logError("Loading CSS from " + cssPath + " failed", t); + } + } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/LaunchAppQueryView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/LaunchAppQueryView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/LaunchAppQueryView.java Tue Jul 13 16:05:52 2010 +0100 @@ -18,12 +18,9 @@ package com.nokia.mj.impl.installer.ui.eswt2; -import com.nokia.mj.impl.installer.ui.InstallInfo; import com.nokia.mj.impl.installer.ui.LaunchAppInfo; -import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Button; /** * LaunchAppQueryView asks from the user if the installed @@ -31,9 +28,6 @@ */ public class LaunchAppQueryView extends ConfirmationViewBase { - private LaunchAppInfo iLaunchAppInfo = null; - private Button iDefaultButton = null; - /** Constructor */ protected LaunchAppQueryView() { @@ -58,7 +52,6 @@ return false; } - iLaunchAppInfo = aLaunchAppInfo; // Use confirm() from super class to display the view. boolean result = confirm(); // Return the result to the client. @@ -81,26 +74,4 @@ { // User selection data is initialized in button listeners. } - - /** - * Returns SWT style for this view. - */ - protected int getStyle() - { - return SWT.V_SCROLL; - } - - /** - * Called after view and commands have been created. Subclasses - * can overrride this method to set focus to their own default - * commands. - */ - protected void setDefaultCommand() - { - if (iDefaultButton != null) - { - iDefaultButton.setFocus(); - getShell().setDefaultButton(iDefaultButton); - } - } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionConfirmationView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionConfirmationView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionConfirmationView.java Tue Jul 13 16:05:52 2010 +0100 @@ -61,7 +61,7 @@ protected PermissionConfirmationView( InstallerUiEswt aInstallerUi, Composite aParent) { - super(aInstallerUi, aParent, 8, true); + super(aInstallerUi, aParent, 8); setTitle(InstallerUiTexts.get(InstallerUiTexts.INSTALLING)); setCommands(null, null); } @@ -92,17 +92,7 @@ protected void createView() { // Add header. - String title = "Install?"; - String appName = ""; - if (iInstallInfo != null) - { - if (iInstallInfo.getOldVersion() != null) - { - title = "Update?"; - } - appName = iInstallInfo.getName(); - } - addHeader(title, iInstallInfo, null); + addHeader(null, iInstallInfo, null); GridData gridData = null; int labelStyle = SWT.WRAP; @@ -110,10 +100,10 @@ // Add permission query label. int detailsColumns = 2; int horizontalSpan = getColumns() - detailsColumns; - Label domainLabel = createLabel( - InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY, - new String[] { appName }), + Label permissionQueryLabel = createLabel( + InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY), horizontalSpan, labelStyle); + setCssId(permissionQueryLabel, "permissionDetails"); // Add link for permission details. if (iPermissionInfo != null && @@ -122,6 +112,7 @@ { horizontalSpan = detailsColumns; Button detailsButton = new Button(getComposite(), SWT.NONE); + setCssId(detailsButton, "detailsLink"); detailsButton.setText( InstallerUiTexts.get(InstallerUiTexts.PERM_VIEW_DETAILS)); detailsButton.addListener(SWT.Selection, new Listener() @@ -139,11 +130,9 @@ horizontalSpan = getColumns(); - // Number of pixels on top of the buttons. - int verticalIndent = 5; - // Add allow button. iAllowButton = new Button(getComposite(), SWT.NONE); + setCssId(iAllowButton, "allowButton"); iAllowButton.setText(InstallerUiTexts.get( InstallerUiTexts.PERM_ALLOW_ALWAYS)); iAllowButton.addListener(SWT.Selection, new Listener() @@ -170,13 +159,13 @@ }); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; - gridData.verticalIndent = verticalIndent; iAllowButton.setLayoutData(gridData); iAllowButton.setFocus(); addSoftKeyListenerFor(iAllowButton); // Add deny button. iDenyButton = new Button(getComposite(), SWT.NONE); + setCssId(iDenyButton, "denyButton"); iDenyButton.setText(InstallerUiTexts.get( InstallerUiTexts.PERM_ASK_ME_LATER)); iDenyButton.addListener(SWT.Selection, new Listener() @@ -203,12 +192,12 @@ }); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; - gridData.verticalIndent = verticalIndent; iDenyButton.setLayoutData(gridData); addSoftKeyListenerFor(iDenyButton); // Add cancel button. iCancelButton = new Button(getComposite(), SWT.NONE); + setCssId(iCancelButton, "cancelButton"); iCancelButton.setText(InstallerUiTexts.get(InstallerUiTexts.PERM_CANCEL)); iCancelButton.addListener(SWT.Selection, new Listener() { @@ -233,7 +222,6 @@ }); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; - gridData.verticalIndent = verticalIndent; iCancelButton.setLayoutData(gridData); addSoftKeyListenerFor(iCancelButton); diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionDetailsView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionDetailsView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionDetailsView.java Tue Jul 13 16:05:52 2010 +0100 @@ -64,7 +64,7 @@ (InstallerUiTexts.get (InstallerUiTexts.PERM_VIEW_DETAILS_TITLE), horizontalSpan, labelStyle); - detailsLabel.setFont(iInstallerUi.getBoldFont()); + setCssId(detailsLabel, "heading"); // Add permission names. String[] permNames = iPermissionInfo.getPermissionNames(); @@ -84,6 +84,7 @@ Label permissionDetailsLabel = createLabel( iPermissionInfo.getPermissionsDetails(), horizontalSpan, labelStyle); + setCssId(permissionDetailsLabel, "detailsWarningLabel"); } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ProgressView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ProgressView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ProgressView.java Tue Jul 13 16:05:52 2010 +0100 @@ -86,6 +86,7 @@ { setTitle(iMsg); iLabel = createLabel(iMsg, SWT.WRAP); + setCssId(iLabel, "heading"); } iIndeterminate = aIndeterminate; @@ -102,6 +103,7 @@ iProgressBar.setMaximum(100); iProgressBar.setSelection(iValue); } + setCssId(iProgressBar, "progressBar"); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = getColumns(); iProgressBar.setLayoutData(gridData); @@ -115,6 +117,8 @@ // By default add cancel command to all progress bars. addCancelCommand(); + + iInstallerUi.loadCss(); } /** Update text for this progress bar. */ @@ -169,13 +173,18 @@ { public void run() { + // Set horizontalSpan to 2 for one button, + // and to 1 for one two buttons. + int horizontalSpan = 2; + GridData gridData = null; + /* iHideCommand = new Button(getCommandComposite(), SWT.PUSH); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.horizontalSpan = 1; + setCssId(iHideCommand, "softKeyButton"); + gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.horizontalSpan = horizontalSpan; iHideCommand.setLayoutData(gridData); iHideCommand.setText(InstallerUiTexts.get(InstallerUiTexts.HIDE)); - iHideCommand.addSelectionListener - (new SelectionListener() + iHideCommand.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent aEvent) { @@ -187,15 +196,16 @@ } }); addSoftKeyListenerFor(iHideCommand); + */ iCancelCommand = new Button(getCommandComposite(), SWT.PUSH); + setCssId(iCancelCommand, "softKeyButtonWide"); gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.horizontalSpan = 1; + gridData.horizontalSpan = horizontalSpan; iCancelCommand.setLayoutData(gridData); iCancelCommand.setText( InstallerUiTexts.get(InstallerUiTexts.CANCEL)); - iCancelCommand.addSelectionListener - (new SelectionListener() + iCancelCommand.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent aEvent) { @@ -234,8 +244,11 @@ public void run() { getShell().setDefaultButton(null); - iHideCommand.dispose(); - iHideCommand = null; + if (iHideCommand != null) + { + iHideCommand.dispose(); + iHideCommand = null; + } iCancelCommand.dispose(); iCancelCommand = null; } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/RuntimeConfirmationView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/RuntimeConfirmationView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/RuntimeConfirmationView.java Tue Jul 13 16:05:52 2010 +0100 @@ -57,10 +57,18 @@ String[] answerOptions = iConfirmData.getAnswerOptions(); switch (answerOptions.length) { - case 1: setCommands(answerOptions[0], null); break; - case 2: setCommands(answerOptions[0], answerOptions[1]); break; + //case 1: setCommands(answerOptions[0], null); break; + case 1: + setCommands(InstallerUiTexts.get(InstallerUiTexts.OK), null); + break; + //case 2: setCommands(answerOptions[0], answerOptions[1]); break; + case 2: + setCommands(InstallerUiTexts.get(InstallerUiTexts.OK), + InstallerUiTexts.get(InstallerUiTexts.CANCEL)); + break; default: setCommands(null, null); break; } + } /** @@ -68,27 +76,13 @@ */ protected void createView() { - // Add title. - if (iInstallerUi.getInstallInfo() != null) - { - Label titleLabel = createLabel(iAppName, getColumns() - 1, SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); - // Add security icon. - iCertificates = iInstallerUi.getInstallInfo().getCertificates(); - createSecurityButton(); - } - else - { - Label titleLabel = createLabel(iAppName, getColumns(), SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); - } + // Add header. + addHeader(null, iInstallerUi.getInstallInfo(), null); GridData gridData = null; int horizontalSpan = getColumns(); int labelStyle = SWT.WRAP; - // Begin widgets creation. - // Add question label. Label errorLabel = createLabel( iConfirmData.getQuestion(), horizontalSpan, labelStyle); @@ -132,7 +126,9 @@ iAnswerButtons[iConfirmData.getAnswerSuggestion()].setFocus(); } - // End of widgets creation. + // After other widgets have been added, add content to + // application info Composite. + addAppInfo(iInstallerUi.getInstallInfo(), false); } /** diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/UsernamePasswordView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/UsernamePasswordView.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/UsernamePasswordView.java Tue Jul 13 16:05:52 2010 +0100 @@ -110,7 +110,7 @@ Label titleLabel = createLabel (InstallerUiTexts.get(InstallerUiTexts.CONNECT_TO), labelStyle); - titleLabel.setFont(iInstallerUi.getBoldFont()); + setCssId(titleLabel, "heading"); Label urlLabel = createLabel(iUrl, labelStyle); @@ -118,18 +118,23 @@ (InstallerUiTexts.get (InstallerUiTexts.DOWNLOAD_APPLICATION, new String[] { iAppName }), labelStyle); + setCssId(authLabel, "authLabel"); Label usernameLabel = createLabel (InstallerUiTexts.get(InstallerUiTexts.USERNAME), labelStyle); + setCssId(usernameLabel, "usernamePasswordLabel"); iUsernameText = new Text(getComposite(), SWT.BORDER); + setCssId(iUsernameText, "usernamePasswordInputField"); iUsernameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); addSoftKeyListenerFor(iUsernameText); Label passwordLabel = createLabel (InstallerUiTexts.get(InstallerUiTexts.PASSWORD), labelStyle); + setCssId(passwordLabel, "usernamePasswordLabel"); iPasswordText = new Text(getComposite(), SWT.PASSWORD | SWT.BORDER); + setCssId(iPasswordText, "usernamePasswordInputField"); iPasswordText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); addSoftKeyListenerFor(iPasswordText); } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java Tue Jul 13 16:05:52 2010 +0100 @@ -34,6 +34,7 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.internal.qt.WidgetConstant; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -42,6 +43,7 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Widget; /** * Base class for different InstallerUi views. @@ -101,6 +103,7 @@ iParent = (Shell)aParent; iContainer = new Composite(iParent, 0); + setCssId(iContainer, "dialogArea"); iContainer.setVisible(false); iColumns = aColumns; @@ -438,6 +441,14 @@ } /** + * Sets CSS id for given widget. + */ + protected void setCssId(Widget aWidget, String aCssId) + { + aWidget.setData(WidgetConstant.CSS_ID, aCssId); + } + + /** * Adds header used in installation views. */ protected void addHeader( @@ -454,26 +465,28 @@ boolean aSecurityButton) { // Add title. - String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY); + if (aTitle == null) + { + aTitle = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY); + if (aInstallInfo != null && aInstallInfo.getOldVersion() != null) + { + aTitle = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY); + } + } + Label titleLabel = createLabel(aTitle, getColumns() - 1, SWT.WRAP); + setCssId(titleLabel, "heading"); + if (aInstallInfo != null) { - if (aInstallInfo.getOldVersion() != null) - { - title = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY); - } iCertificates = aInstallInfo.getCertificates(); } - if (aUninstallInfo != null) + else if (aUninstallInfo != null) { - title = "Uninstall?"; iCertificates = aUninstallInfo.getCertificates(); } - Label titleLabel = createLabel(aTitle, getColumns() - 1, SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); - if (aSecurityButton) { - // Add security icon. + // Add security button. createSecurityButton(); } else @@ -505,11 +518,12 @@ { iconColumns = 2; Label iconLabel = createLabel(iSuiteIcon, iconColumns, SWT.NONE); + setCssId(iconLabel, "contentIcon"); } // Create a Composite for displaying application info. iAppInfoScrolledComposite = - new ScrolledComposite(getComposite(), SWT.H_SCROLL | SWT.V_SCROLL); + new ScrolledComposite(getComposite(), SWT.V_SCROLL); iAppInfoScrolledComposite.setAlwaysShowScrollBars(false); iAppInfoScrolledComposite.setExpandHorizontal(true); GridData gridData = new GridData(GridData.FILL_BOTH); @@ -518,6 +532,7 @@ iAppInfoComposite = new Composite(iAppInfoScrolledComposite, SWT.NONE); iAppInfoComposite.setLayout(new GridLayout(1, true)); iAppInfoScrolledComposite.setContent(iAppInfoComposite); + setCssId(iAppInfoScrolledComposite, "appInfoArea"); } /** @@ -540,15 +555,10 @@ if (aFull) { // Add vendor. - if (aInstallInfo.getCertificates() != null) - { - // Vendor information must be displayed only for - // identified applications. - createAppInfoLabel( - InstallerUiTexts.get( - InstallerUiTexts.SUITE_VENDOR, - new String[] { aInstallInfo.getVendor() })); - } + createAppInfoLabel( + InstallerUiTexts.get( + InstallerUiTexts.SUITE_VENDOR, + new String[] { aInstallInfo.getVendor() })); } // Add size. long size = 0; @@ -658,7 +668,7 @@ GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = aColumns; gridData.horizontalAlignment = SWT.CENTER; - gridData.verticalAlignment = SWT.CENTER; + gridData.verticalAlignment = SWT.TOP; label.setLayoutData(gridData); return label; } @@ -690,6 +700,7 @@ protected Label createSecurityLabel(boolean aIdentified) { Label label = createLabel((Image)null, 1, SWT.NONE); + setCssId(label, "securityLabel"); Image securityIcon = null; if (iInstallerUi != null) { @@ -710,6 +721,7 @@ protected Button createSecurityButton() { Button button = new Button(getComposite(), SWT.PUSH); + setCssId(button, "securityButton"); GridData gridData = new GridData( GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); gridData.horizontalSpan = 1; diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp --- a/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp Tue Jul 13 16:05:52 2010 +0100 @@ -52,9 +52,6 @@ USERINCLUDE ../inc USERINCLUDE ../../../../inc -SYSTEMINCLUDE ../../../../inc -SYSTEMINCLUDE /epoc32/include/mw/usif - // Libraries LIBRARY apgrfx.lib LIBRARY apmime.lib diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/javasifplugin/inc/javasifplugin.h --- a/javamanager/javainstaller/javasifplugin/inc/javasifplugin.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/inc/javasifplugin.h Tue Jul 13 16:05:52 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -25,7 +25,8 @@ #include #include "f32file.h" -#include "resultsserver.h" + +class ResultsServer; using namespace Usif; @@ -36,9 +37,9 @@ const int INSTALLER_CANCEL_MESSAGE_ID = 603; const int INSTALLER_CANCEL_RESPONSE_MESSAGE_ID = 604; -namespace Java +namespace java { -namespace Installer +namespace installer { /** @@ -222,6 +223,69 @@ void CopyFilesIfNeededL(TFileName &aFileName); /** + * Check if the file is Jad file. Argument KSifInParam_MimeType is + * used for check if it exists. + * + * @param[in] aFileHandle the file to be checked + * @param[in] aArguments Install request arguments + * @param[out] aIsJad set to ETrue if the file is Jad file + * @return KErrNone or Symbian error code + */ + TInt IsJadFile(RFile& aFileHandle, const COpaqueNamedParams& aArguments, TBool& aIsJad); + + /** + * Check if the file is Jad file. + * + * @param[in] aFileHandle the file to be checked + * @param[out] aIsJad set to ETrue if the file is Jad file + * @return KErrNone or Symbian error code + */ + TInt IsJadFile(RFile& aFileHandle, TBool& aIsJad); + + /** + * Uses the information in aArguments to create the correct command line for + * Java Installer. + * + * @param[in][out] aCommandLine the buffer to be filled with command line arguments + * @param[in] aArguments The array of opaque params for the plug-in. An empty + * array may be passed. The following param is defined for the "SCOMO Install + * Inactive" operation: + * Name: InstallInactive, Type: Int, Value: ETrue + * If a plug-in receives this param, it must install a component normally but the SCOMO + * State should remain EDeactivated. + */ + void BuildInstallCommandLine( + TPtr& aCommandLine, + const COpaqueNamedParams& aArguments); + + /** + * Returns the value of int param found from aArguments or -1 if + * the param is not found. Must be called only for int params + * that have positive value range! + * + * @param[in] aName The name of the integer param to be obtained. + * @param[in] aArguments The array of opaque params for the plug-in. + * @return -1 if the named param if not found, otherwise the value of the + */ + TInt GetPositiveIntParam( + const TDesC& aName, + const COpaqueNamedParams& aArguments); + + /** + * Start ResultsServer for receiving Comms message(s) from + * Java Installer + * + * @param[in][out] aResults If Comms message contains installation or + * uninstallation operation results, they will be stored in this variable + * @param[in][out] aComponentInfo If Comms message contains contains details of + * a component, they will be stored into this variable + * @return + */ + TInt StartResultsServer( + COpaqueNamedParams& aResults, + CComponentInfo& aComponentInfo); + + /** * If Java Installer is already running, set error category EInstallerBusy etc * to aResults, set aStatus to KErrAlreadyExists and return ETrue * @param[in][out] aResults @@ -232,23 +296,14 @@ COpaqueNamedParams& aResults, TRequestStatus& aStatus); - /** - * If Java Installer is already running, - * set aStatus to KErrAlreadyExists and return ETrue - * @param[in][out] aStatus - * @return ETrue if Java Installer is running - */ - TBool ExitIfJavaInstallerRunning(TRequestStatus& aStatus); - private: // Data - TRequestStatus* iStatus; - RFs iRFs; - RArray iHandlesToClose; - ResultsServer* iResultsServer; + RFs mRFs; + RArray mHandlesToClose; + ResultsServer* mResultsServer; - COpaqueNamedParams* iDummyResults; - CComponentInfo* iDummyInfo; + COpaqueNamedParams* mDummyResults; + CComponentInfo* mDummyInfo; }; } // Installer diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/javasifplugin/inc/resultsserver.h --- a/javamanager/javainstaller/javasifplugin/inc/resultsserver.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/inc/resultsserver.h Tue Jul 13 16:05:52 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* 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 the License "Eclipse Public License v1.0" @@ -65,18 +65,19 @@ CommsEndpoint* getComms() { - return &iComms; + return &mComms; } private: void clearData(); void setComponentInfoL(); + void resetDefaultErrorValues(); + void setCommonErrorInfo(); private: - int iRunning; // 1 if running, 0 if not running - CommsServerEndpoint iComms; - COpaqueNamedParams &iResults; - CComponentInfo &iInfo; + CommsServerEndpoint mComms; + COpaqueNamedParams &mResults; + CComponentInfo &mInfo; std::map iIntPairs; std::map iStringPairs; diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp --- a/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -20,34 +20,75 @@ #include #include -#include -#include #include #include -#include +#include +#include +#include +#include #include "comms.h" +#include "commsclientendpoint.h" #include "commsmessage.h" -#include "commsclientendpoint.h" -#include "javasifplugin.h" -#include "javauids.h" -#include "logger.h" +#include "javacommonutils.h" #include "javaoslayer.h" #include "javaprocessconstants.h" #include "javasymbianoslayer.h" +#include "javauids.h" +#include "logger.h" +#include "resultsserver.h" #include "runtimeexception.h" +#include "javasifplugin.h" -using namespace Java::Installer; + +using namespace java::installer; using namespace java::util; using namespace java::comms; _LIT(KPrivateDataCage, "\\private\\"); _LIT(KInboxDataCage, "\\private\\1000484b\\"); -_LIT(KJavaInstallerProcess, "Installer"); +_LIT(KJavaInstallerProcess, "Installer*"); _LIT(KJavaInstallerDataCage, "\\private\\102033e6\\"); _LIT(KJavaInstallerTmp, "\\private\\102033E6\\installer\\tmp\\"); _LIT(KAnyExtension, ".*"); +_LIT(KComponentInfo, " componentinfo"); +_LIT(KCommsResult, " -commsresult="); +_LIT(KJad, " -jad="); +_LIT(KJar, " -jar="); +_LIT(KDoubleQuote, "\""); +_LIT(KInstall, " install"); +_LIT(KSilent, " -silent"); +_LIT(KUninstall, " uninstall"); +_LIT(KCid, " -cid="); +_LIT(KDrive, " -drive="); +_LIT(KYes, "yes"); +_LIT(KNo, "no"); +_LIT(KOcsp, " -ocsp="); +_LIT(KIgnoreOcspWarnings, " -ignore_ocsp_warnings="); +_LIT(KUpgrade, " -upgrade="); +_LIT(KUpgradeData, " -upgrade_data="); +_LIT(KUntrusted, " -untrusted="); +_LIT(KOverwrite, " -overwrite="); +_LIT(KDownload, " -download="); +_LIT(KIap, " -iap="); +_LIT(KSnap, " -snap="); +_LIT(KForceCancel, " -forcecancel"); +_LIT(KBase64, " -base64="); +_LIT(KUsername, " -username="); +_LIT(KPassword, " -password="); +_LIT(KSourceUrl, " -sourceurl="); +_LIT(KCharSet, " -charset="); + +_LIT(KJadMimeType, "text/vnd.sun.j2me.app-descriptor"); +_LIT8(K8JadMimeType, "text/vnd.sun.j2me.app-descriptor"); + +// Long Java Installer command lines contain max 2 path names (512 chars max) and +// some options -> 1536 is long enough buffer +const TInt KLongCmdLineLen = 1536; + +// When starting Java Installer for uninstallation the command line is much shorter +const TInt KShortCmdLineLen = 256; // Java Installer is executed with same Uid as Java Runtime _LIT_SECURE_ID(KJavaInstallerSecureID, KJavaMidpSecureId); @@ -67,24 +108,24 @@ CJavaSifPlugin::~CJavaSifPlugin() { - iRFs.Close(); + mRFs.Close(); - TInt nHandles = iHandlesToClose.Count(); + TInt nHandles = mHandlesToClose.Count(); while (nHandles > 0) { nHandles--; - iHandlesToClose[nHandles].Close(); + mHandlesToClose[nHandles].Close(); } - iHandlesToClose.Reset(); + mHandlesToClose.Reset(); - delete iResultsServer; - iResultsServer = NULL; + delete mResultsServer; + mResultsServer = NULL; - delete iDummyResults; - iDummyResults = NULL; + delete mDummyResults; + mDummyResults = NULL; - delete iDummyInfo; - iDummyInfo = NULL; + delete mDummyInfo; + mDummyInfo = NULL; } CJavaSifPlugin::CJavaSifPlugin() @@ -93,11 +134,11 @@ void CJavaSifPlugin::ConstructL() { - User::LeaveIfError(iRFs.Connect()); - User::LeaveIfError(iRFs.ShareProtected()); - iResultsServer = NULL; - iDummyResults = COpaqueNamedParams::NewL(); - iDummyInfo = CComponentInfo::NewL(); + User::LeaveIfError(mRFs.Connect()); + User::LeaveIfError(mRFs.ShareProtected()); + mResultsServer = NULL; + mDummyResults = COpaqueNamedParams::NewL(); // codescanner::forgottoputptroncleanupstack + mDummyInfo = CComponentInfo::NewL(); } void CJavaSifPlugin::GetComponentInfo( @@ -107,7 +148,7 @@ TRequestStatus& aStatus) { RFile fileHandle; - TInt err = fileHandle.Open(iRFs, aFileName, EFileShareReadersOnly | EFileRead); + TInt err = fileHandle.Open(mRFs, aFileName, EFileShareReadersOnly | EFileRead); if (KErrNone != err) { ELOG1(EJavaInstaller, @@ -128,27 +169,37 @@ CComponentInfo& aComponentInfo, TRequestStatus& aStatus) { - if (ExitIfJavaInstallerRunning(aStatus)) + if (ExitIfJavaInstallerRunning(*mDummyResults, aStatus)) { return; } RProcess rJavaInstaller; TFileName fileName; - TBuf<1536> commandLine; + HBufC* pBufCommandLine = NULL; + TRAPD(err, pBufCommandLine = HBufC::NewL(KLongCmdLineLen)) + if (KErrNone != err) + { + TRequestStatus *statusPtr(&aStatus); + User::RequestComplete(statusPtr, err); + return; + } + std::auto_ptr bufCommandLine(pBufCommandLine); + TPtr commandLine = pBufCommandLine->Des(); // Build command line used to pass all necessary info to Java Installer std::auto_ptr installerStarterDll( stringToDes(java::runtime::JAVA_INSTALLER_STARTER_DLL)); commandLine = installerStarterDll->Des(); - commandLine.Append(_L(" componentinfo")); + commandLine.Append(KComponentInfo); // Ask Java Installer to send component info back // as Comms message. 11000 is IPC_ADDRESS_JAVA_SIF_PLUGIN_C Comms endpoint // that our ResultsServer will listen to. - commandLine.Append(_L(" -commsresult=11000")); + commandLine.Append(KCommsResult); + commandLine.AppendNum(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); - TInt err = aFileHandle.FullName(fileName); + err = aFileHandle.FullName(fileName); // Java Installer does not have AllFiles capability. // So if the .jad/.jar file is in the private data cage of @@ -165,42 +216,30 @@ } // Check whether the file is .jad or .jar - RApaLsSession apaSession; - err = apaSession.Connect(); + TBool isJad; + err = IsJadFile(aFileHandle, isJad); if (KErrNone != err) { - ELOG1(EJavaInstaller, - "CJavaSifPlugin::GetComponentInfo RApaLsSession Connect error %d", err); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; } - TDataType jadFileMimeType(_L8("text/vnd.sun.j2me.app-descriptor")); - TBool isJad = EFalse; - err = apaSession.RecognizeSpecificData(aFileHandle, jadFileMimeType, isJad); - apaSession.Close(); - if (KErrNone != err) - { - // Just log the error - ELOG1(EJavaInstaller, - "CJavaSifPlugin::GetComponentInfo RApaLsSession RecognizeSpecificData error %d", - err); - } if (isJad) { // Installation should be started from JAD file - commandLine.Append(_L(" -jad=")); + commandLine.Append(KJad); } else { // from JAR file - commandLine.Append(_L(" -jar=")); + commandLine.Append(KJar); } + // Filename parameter must be surrounded in double quotes to // ensure that spaces in filename are passed correctly. - commandLine.Append(_L("\"")); + commandLine.Append(KDoubleQuote); commandLine.Append(fileName); - commandLine.Append(_L("\"")); + commandLine.Append(KDoubleQuote); // Start JavaInstaller std::auto_ptr installerProcess( @@ -208,21 +247,7 @@ err = rJavaInstaller.Create(installerProcess->Des(), commandLine); if (KErrNone == err) { - // Destroy old Comms server if it exists - delete iResultsServer; - iResultsServer = NULL; - // Start new Comms server that receives component info and sets it to - // to aComponentInfo. - iResultsServer = new ResultsServer(*iDummyResults, aComponentInfo); - if (NULL == iResultsServer) - { - err = KErrNoMemory; - } - else - { - // Start the server - err = iResultsServer->start(); - } + err = StartResultsServer(*mDummyResults, aComponentInfo); if (KErrNone != err) { // server cannot be started @@ -252,7 +277,7 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - iHandlesToClose.Append(rJavaInstaller); + mHandlesToClose.Append(rJavaInstaller); } void CJavaSifPlugin::Install( @@ -263,11 +288,12 @@ TRequestStatus& aStatus) { RFile fileHandle; - TInt err = fileHandle.Open(iRFs, aFileName, EFileShareReadersOnly | EFileRead); + TInt err = fileHandle.Open(mRFs, aFileName, EFileShareReadersOnly | EFileRead); if (KErrNone != err) { ELOG1(EJavaInstaller, "CJavaSifPlugin::Install Opening file for reading failed with error %d", err); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; @@ -289,16 +315,24 @@ return; } - RProcess rJavaInstaller; - TFileName fileName; - // Max two path names and some options -> 1536 is enough - TBuf<1536> commandLine; + // Create buffer for Java Installer command line + HBufC* pBufCommandLine = NULL; + TRAPD(err, pBufCommandLine = HBufC::NewL(KLongCmdLineLen)) + if (KErrNone != err) + { + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ELowMemory)); + TRequestStatus *statusPtr(&aStatus); + User::RequestComplete(statusPtr, err); + return; + } + std::auto_ptr bufCommandLine(pBufCommandLine); + TPtr commandLine = pBufCommandLine->Des(); // Build command line used to pass all necessary info to Java Installer std::auto_ptr installerStarterDll( stringToDes(java::runtime::JAVA_INSTALLER_STARTER_DLL)); commandLine = installerStarterDll->Des(); - commandLine.Append(_L(" install")); + commandLine.Append(KInstall); // Check whether this is silent installation TInt silentInstall = 0; @@ -310,195 +344,25 @@ { ELOG(EJavaInstaller, "CJavaSifPlugin::Install The caller did not have TrustedUI capability"); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ESecurityError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, KErrPermissionDenied); return; } - commandLine.Append(_L(" -silent")); - } - - TBool paramFound = EFalse; - TInt intValue = 0; - TDesC desValue = KNullDesC; - - // KSifInParam_Drive -> -drive=install_target_drive (A, B, C, ..., Z) - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_Drive, intValue)); - if (paramFound) - { - // Value 0 is 'A:' drive and value 25 is 'Z:' drive - if ((intValue > -1) && (intValue < 26)) - { - commandLine.Append(_L(" -drive=")); - TChar drive('A'); - drive += intValue; - commandLine.Append(drive); - } - else - { - WLOG1(EJavaInstaller, - "CJavaSifPlugin::Install Ignoring illegal KSifInParam_Drive param (value %d)", - intValue); - } - } - - // KSifInParam_PerformOCSP Yes/No/AskUser -> -ocsp=yes|no - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_PerformOCSP, intValue)); - if (paramFound) - { - if (intValue == 0) // Yes - { - commandLine.Append(_L(" -ocsp=yes")); - } - else if (intValue == 1) // No - { - commandLine.Append(_L(" -ocsp=no")); - } - // AskUser is not supported - } - - // KSifInParam_IgnoreOCSPWarnings Yes/No/AskUser -> -ignore_ocsp_warnings=yes|no - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_IgnoreOCSPWarnings, intValue)); - if (paramFound) - { - if (intValue == 0) // Yes - { - commandLine.Append(_L(" -ignore_ocsp_warnings=yes")); - } - else if (intValue == 1) // No - { - commandLine.Append(_L(" -ignore_ocsp_warnings=no")); - } - // AskUser is not supported - } - - // KSifInParam_AllowUpgrade Yes/No/AskUser -> -upgrade=yes|no - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_AllowUpgrade, intValue)); - if (paramFound) - { - if (intValue == 0) // Yes - { - commandLine.Append(_L(" -upgrade=yes")); - } - else if (intValue == 1) // No - { - commandLine.Append(_L(" -upgrade=no")); - } - // AskUser is not supported + commandLine.Append(KSilent); } - - // TODO: activate this code block when KSifInParam_UpgradeData has been - // defined in sifcommon.h -/* - // KSifInParam_UpgradeData Yes/No/AskUser -> -upgrade_data=yes|no - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_UpgradeData, intValue)); - if (paramFound) - { - if (intValue == 0) // Yes - { - commandLine.Append(_L(" -upgrade_data=yes")); - } - else if (intValue == 1) // No - { - commandLine.Append(_L(" -upgrade_data=no")); - } - // AskUser is not supported - } -*/ - - // KSifInParam_AllowUntrusted Yes/No/AskUser -> -untrusted=yes|no - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_AllowUntrusted, intValue)); - if (paramFound) - { - if (intValue == 0) // Yes - { - commandLine.Append(_L(" -untrusted=yes")); - } - else if (intValue == 1) // No - { - commandLine.Append(_L(" -untrusted=no")); - } - // AskUser is not supported - } - - // KSifInParam_AllowOverwrite Yes/No/AskUser -> -overwrite=yes|no - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_AllowOverwrite, intValue)); - if (paramFound) - { - if (intValue == 0) // Yes - { - commandLine.Append(_L(" -overwrite=yes")); - } - else if (intValue == 1) // No - { - commandLine.Append(_L(" -overwrite=no")); - } - // AskUser is not supported - } - - // KSifInParam_AllowDownload Yes/No/AskUser -> -download=yes|no - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_AllowDownload, intValue)); - if (paramFound) - { - if (intValue == 0) // Yes - { - commandLine.Append(_L(" -download=yes")); - } - else if (intValue == 1) // No - { - commandLine.Append(_L(" -download=no")); - } - // AskUser is not supported - } - - // KSifInParam_UserName -> -username=download_username - TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_UserName)); - if (desValue.Length() > 0) - { - commandLine.Append(_L(" -username=")); - commandLine.Append(desValue); - } - - // KSifInParam_Password -> -password=download_password - TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_Password)); - if (desValue.Length() > 0) - { - commandLine.Append(_L(" -password=")); - commandLine.Append(desValue); - } - - // KSifInParam_SourceUrl -> -sourceurl=original (HTTP) URL of the JAD or JAR file - TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_SourceUrl)); - if (desValue.Length() > 0) - { - commandLine.Append(_L(" -sourceurl=")); - commandLine.Append(desValue); - } - - // KSifInParam_IAP -> -iap=IAP_ID (internet access point id) - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_IAP, intValue)); - if (paramFound) - { - commandLine.Append(_L(" -iap=")); - commandLine.AppendNum(intValue); - } - - // KSifInParam_Charset -> -charset=Internet-standard character set name - TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_Charset)); - if (desValue.Length() > 0) - { - commandLine.Append(_L(" -charset=")); - commandLine.Append(desValue); - } - + BuildInstallCommandLine(commandLine, aArguments); // Ask Java Installer to send installation results back // as Comms message. 11000 is IPC_ADDRESS_JAVA_SIF_PLUGIN_C Comms endpoint // that our ResultsServer will listen to. - commandLine.Append(_L(" -commsresult=11000")); + commandLine.Append(KCommsResult); + commandLine.AppendNum(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); - TInt err = aFileHandle.FullName(fileName); + TFileName fileName; + err = aFileHandle.FullName(fileName); // Java Installer does not have AllFiles capability. // So if the .jad/.jar file is in the private data cage of @@ -509,74 +373,53 @@ TRAP(err, CopyFilesIfNeededL(fileName)); if (KErrNone != err) { + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; } // Check whether the file is .jad or .jar - RApaLsSession apaSession; - err = apaSession.Connect(); + TBool isJad = EFalse; + err = IsJadFile(aFileHandle, aArguments, isJad); if (KErrNone != err) { - ELOG1(EJavaInstaller, - "CJavaSifPlugin::Install RApaLsSession Connect error %d", err); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; } - TDataType jadFileMimeType(_L8("text/vnd.sun.j2me.app-descriptor")); - TBool isJad = EFalse; - err = apaSession.RecognizeSpecificData(aFileHandle, jadFileMimeType, isJad); - apaSession.Close(); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "CJavaSifPlugin::Install RApaLsSession RecognizeSpecificData error %d", err); - } if (isJad) { // Installation should be started from JAD file - commandLine.Append(_L(" -jad=")); + commandLine.Append(KJad); } else { // from JAR file - commandLine.Append(_L(" -jar=")); + commandLine.Append(KJar); } // Filename parameter must be surrounded in double quotes to // ensure that spaces in filename are passed correctly. - commandLine.Append(_L("\"")); + commandLine.Append(KDoubleQuote); commandLine.Append(fileName); - commandLine.Append(_L("\"")); + commandLine.Append(KDoubleQuote); // Start JavaInstaller std::auto_ptr installerProcess( stringToDes(java::runtime::JAVA_PROCESS)); + RProcess rJavaInstaller; err = rJavaInstaller.Create(installerProcess->Des(), commandLine); if (KErrNone == err) { - // Destroy old Comms server if it exists - delete iResultsServer; - iResultsServer = NULL; - // Start new Comms server that receives component ids, sets them - // to aResults. - iResultsServer = new ResultsServer(aResults, *iDummyInfo); - if (NULL == iResultsServer) - { - err = KErrNoMemory; - } - else - { - // Start the server - err = iResultsServer->start(); - } + err = StartResultsServer(aResults, *mDummyInfo); if (KErrNone != err) { // server cannot be started rJavaInstaller.Close(); ELOG1(EJavaInstaller, "CJavaSifPlugin::Install: Cannot start results server, err %d", err); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; @@ -591,6 +434,7 @@ rJavaInstaller.Close(); ELOG1(EJavaInstaller, "CJavaSifPlugin::Install: starting JavaInstaller failed, err=%d", err); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; @@ -600,7 +444,7 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - iHandlesToClose.Append(rJavaInstaller); + mHandlesToClose.Append(rJavaInstaller); } void CJavaSifPlugin::Uninstall( @@ -615,18 +459,26 @@ return; } - RProcess rJavaInstaller; - TFileName fileName; - // Max one uid and some options -> 256 is enough - TBuf<256> commandLine; + // Allocate buffer for Java Installer command line + HBufC* pBufCommandLine = NULL; + TRAPD(err, pBufCommandLine = HBufC::NewL(KShortCmdLineLen)) + if (KErrNone != err) + { + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ELowMemory)); + TRequestStatus *statusPtr(&aStatus); + User::RequestComplete(statusPtr, err); + return; + } + std::auto_ptr bufCommandLine(pBufCommandLine); + TPtr commandLine = pBufCommandLine->Des(); // Build command line used to pass all necessary info to Java Installer std::auto_ptr installerStarterDll( stringToDes(java::runtime::JAVA_INSTALLER_STARTER_DLL)); commandLine = installerStarterDll->Des(); - commandLine.Append(_L(" uninstall")); + commandLine.Append(KUninstall); - commandLine.Append(_L(" -cid=")); + commandLine.Append(KCid); commandLine.AppendNum(aComponentId); // Check whether this is silent uninstallation @@ -639,24 +491,35 @@ { ELOG(EJavaInstaller, "CJavaSifPlugin::Uninstall The caller did not have TrustedUI capability"); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ESecurityError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, KErrPermissionDenied); return; } - commandLine.Append(_L(" -silent")); + commandLine.Append(KSilent); } - // No need to start iResultsServer because Uninstall() does not - // return anything usefull in aResults. We could return extended - // error code there. - // start JavaInstaller std::auto_ptr installerProcess( stringToDes(java::runtime::JAVA_PROCESS)); - TInt err = rJavaInstaller.Create(installerProcess->Des(), commandLine); + RProcess rJavaInstaller; + err = rJavaInstaller.Create(installerProcess->Des(), commandLine); if (KErrNone == err) { + err = StartResultsServer(aResults, *mDummyInfo); + if (KErrNone != err) + { + // server cannot be started + rJavaInstaller.Close(); + ELOG1(EJavaInstaller, + "CJavaSifPlugin::Uninstall: Cannot start results server, err %d", err); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); + TRequestStatus *statusPtr(&aStatus); + User::RequestComplete(statusPtr, err); + return; + } + // the exit status of Java Installer will be passed to // the asynch caller through aStatus rJavaInstaller.Logon(aStatus); @@ -668,6 +531,7 @@ rJavaInstaller.Close(); ELOG1(EJavaInstaller, "CJavaSifPlugin::Uninstall: starting JavaInstaller failed, err=%d", err); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; @@ -675,7 +539,7 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - iHandlesToClose.Append(rJavaInstaller); + mHandlesToClose.Append(rJavaInstaller); } void CJavaSifPlugin::Activate( @@ -705,7 +569,7 @@ // Send cancel message to Java Installer // Check whether there is anything to cancel - if (iHandlesToClose.Count() < 1) + if (mHandlesToClose.Count() < 1) { // No Java Installer process running, do nothing WLOG(EJavaInstaller, @@ -713,64 +577,47 @@ return; } - try - { - CommsMessage message; - message.setModuleId(PLUGIN_ID_SAMPLE_C); - message.setReceiver(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C); - message.setSender(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); - message.setMessageId(INSTALLER_CANCEL_MESSAGE_ID); + CommsMessage message; + message.setReceiver(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C); + message.setSender(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); + message.setMessageId(INSTALLER_CANCEL_MESSAGE_ID); - CommsMessage replyMessage; - int timeout = 10; // 10 seconds + CommsMessage replyMessage; + int timeout = 10; // 10 seconds // codescanner::magicnumbers - CommsClientEndpoint comms; - int err = comms.connect(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C); - if (KErrNone == err) - { - err = comms.sendReceive(message, replyMessage, timeout); - } - else - { - // Cannot connect to Java Installer Comms end point, - // for example Java Installer is still starting up or - // already exiting - WLOG1(EJavaInstaller, - "CJavaSifPlugin:CancelOperation: Cannot connect to Java Installer " - "Comms end point, err %d", err); - return; - } - if (err != 0) - { - // Sending message to Java Installer failed. - ELOG1(EJavaInstaller, - "CJavaSifPlugin:CancelOperation: Cannot send message to Java Installer, err %d", - err); - // Ignore possible errors in disconnect - (void)comms.disconnect(); - return; - } - - // Ignore the cancel result returned in replyMessage - // because current SIF API does not return cancel result - - // Ignore possible errors in disconnect - (void)comms.disconnect(); + CommsClientEndpoint comms; + int err = comms.connect(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C); + if (KErrNone == err) + { + err = comms.sendReceive(message, replyMessage, timeout); } - catch (ExceptionBase& e) + else { - ELOG1(EJavaInstaller, - "CJavaSifPlugin: Send cancel msg failed: ExceptionBase caught: %s ", - e.toString().c_str()); + // Cannot connect to Java Installer Comms end point, + // for example Java Installer is still starting up or + // already exiting + WLOG1(EJavaInstaller, + "CJavaSifPlugin:CancelOperation: Cannot connect to Java Installer " + "Comms end point, err %d", err); return; } - catch (std::exception& e) + if (err != 0) { + // Sending message to Java Installer failed. ELOG1(EJavaInstaller, - "CJavaSifPlugin: Send cancel msg failed: Exception %s caught", e.what()); + "CJavaSifPlugin:CancelOperation: Cannot send message to Java Installer, err %d", + err); + // Ignore possible errors in disconnect + (void)comms.disconnect(); // codescanner::voidparameter return; } + // Ignore the cancel result returned in replyMessage + // because current SIF API does not return cancel result + + // Ignore possible errors in disconnect + (void)comms.disconnect(); // codescanner::voidparameter + // It takes some time before Java Installer had really cancelled // the operation and exited. Wait for it to happen because this function // must return only after the original asynchronous call is completed. @@ -778,14 +625,14 @@ // This array contains process handles for all Java Installer processes // started from this sif plugin. The last handle is the active one. // Check if it is still running - if (iHandlesToClose[iHandlesToClose.Count()-1].ExitReason() != 0) + if (mHandlesToClose[mHandlesToClose.Count()-1].ExitReason() != 0) { // Process has already closed return; } // Wait until it exits - iHandlesToClose[iHandlesToClose.Count()-1].Logon(status); - User::WaitForRequest(status); + mHandlesToClose[mHandlesToClose.Count()-1].Logon(status); + User::WaitForRequest(status); // codescanner::userWaitForRequest // Ignore the exit status of Java Installer because current SIF API // does not return cancel result @@ -796,7 +643,7 @@ { // Check if the file is in the private data cage of some process TInt idx = aFileName.FindF(KPrivateDataCage); - if ((idx != KErrNotFound) && (idx < 3)) + if ((idx != KErrNotFound) && (idx < 3)) // codescanner::magicnumbers { // In case of device Inbox or Java Installer itself do nothing if ((aFileName.FindF(KInboxDataCage) != KErrNotFound) || @@ -811,9 +658,9 @@ // (aFileName is \., copy \.* // to Java Installer tmp dir.) TParse fp; - iRFs.Parse(aFileName, fp); + mRFs.Parse(aFileName, fp); - CFileMan* fm = CFileMan::NewL(iRFs); + CFileMan* fm = CFileMan::NewL(mRFs); TFileName filesToCopy = fp.DriveAndPath(); filesToCopy.Append(fp.Name()); filesToCopy.Append(KAnyExtension); @@ -836,6 +683,359 @@ return; } + +TInt CJavaSifPlugin::IsJadFile( + RFile& aFileHandle, + const COpaqueNamedParams& aArguments, + TBool& aIsJad) +{ + TBool mimeTypeGiven = EFalse; + + TRAP_IGNORE( + const TDesC &desValue = aArguments.StringByNameL(KSifInParam_MimeType); + if (desValue.Length() > 0) + { + mimeTypeGiven = ETrue; + if (!desValue.Compare(KJadMimeType)) + { + aIsJad = ETrue; + } + else + { + aIsJad = EFalse; + } + } + ) + if (mimeTypeGiven) + { + return KErrNone; + } + + // Mime type was not given in the input arguments, must check the contents + // of the file itself + return IsJadFile(aFileHandle, aIsJad); +} + + +TInt CJavaSifPlugin::IsJadFile( + RFile& aFileHandle, + TBool& aIsJad) +{ + RApaLsSession apaSession; + TInt err = apaSession.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "CJavaSifPlugin::IsJadFile RApaLsSession Connect error %d", err); + return err; + } + + TDataType jadFileMimeType(K8JadMimeType); + err = apaSession.RecognizeSpecificData(aFileHandle, jadFileMimeType, aIsJad); + apaSession.Close(); + if (KErrNone != err) + { + // Just log the error + ELOG1(EJavaInstaller, + "CJavaSifPlugin::IsJadFile RApaLsSession RecognizeSpecificData error %d", + err); + return err; + } + + return KErrNone; +} + + +void CJavaSifPlugin::BuildInstallCommandLine( + TPtr& aCommandLine, + const COpaqueNamedParams& aArguments) +{ + // KSifInParam_Drive -> -drive=install_target_drive (A, B, C, ..., Z) + TInt intValue = GetPositiveIntParam(KSifInParam_Drive, aArguments); + // Value 0 is 'A:' drive and value 25 is 'Z:' drive + if ((intValue > -1) && (intValue < 26)) // codescanner::magicnumbers + { + aCommandLine.Append(KDrive); + TChar drive('A'); + drive += intValue; + aCommandLine.Append(drive); + } + + // KSifInParam_PerformOCSP Yes/No/AskUser -> -ocsp=yes|no + intValue = GetPositiveIntParam(KSifInParam_PerformOCSP, aArguments); + if (intValue == 0) // Yes + { + aCommandLine.Append(KOcsp); + aCommandLine.Append(KYes); + } + else if (intValue == 1) // No + { + aCommandLine.Append(KOcsp); + aCommandLine.Append(KNo); + } + // AskUser is not supported + + // KSifInParam_IgnoreOCSPWarnings Yes/No/AskUser -> -ignore_ocsp_warnings=yes|no + intValue = GetPositiveIntParam(KSifInParam_IgnoreOCSPWarnings, aArguments); + if (intValue == 0) // Yes + { + aCommandLine.Append(KIgnoreOcspWarnings); + aCommandLine.Append(KYes); + } + else if (intValue == 1) // No + { + aCommandLine.Append(KIgnoreOcspWarnings); + aCommandLine.Append(KNo); + } + // AskUser is not supported + + // KSifInParam_AllowUpgrade Yes/No/AskUser -> -upgrade=yes|no + intValue = GetPositiveIntParam(KSifInParam_AllowUpgrade, aArguments); + if (intValue == 0) // Yes + { + aCommandLine.Append(KUpgrade); + aCommandLine.Append(KYes); + } + else if (intValue == 1) // No + { + aCommandLine.Append(KUpgrade); + aCommandLine.Append(KNo); + } + // AskUser is not supported + + + + // TODO: activate this code block when KSifInParam_UpgradeData has been + // defined in sifcommon.h +/* + // KSifInParam_UpgradeData Yes/No/AskUser -> -upgrade_data=yes|no + intValue = GetPositiveIntParam(KSifInParam_UpgradeData, aArguments); + if (intValue == 0) // Yes + { + aCommandLine.Append(KUpgradeData); + aCommandLine.Append(KYes); + } + else if (intValue == 1) // No + { + aCommandLine.Append(KUpgradeData); + aCommandLine.Append(KNo); + } + // AskUser is not supported +*/ + + // KSifInParam_AllowUntrusted Yes/No/AskUser -> -untrusted=yes|no + intValue = GetPositiveIntParam(KSifInParam_AllowUntrusted, aArguments); + if (intValue == 0) // Yes + { + aCommandLine.Append(KUntrusted); + aCommandLine.Append(KYes); + } + else if (intValue == 1) // No + { + aCommandLine.Append(KUntrusted); + aCommandLine.Append(KNo); + } + // AskUser is not supported + + // KSifInParam_AllowOverwrite Yes/No/AskUser -> -overwrite=yes|no + intValue = GetPositiveIntParam(KSifInParam_AllowOverwrite, aArguments); + if (intValue == 0) // Yes + { + aCommandLine.Append(KOverwrite); + aCommandLine.Append(KYes); + } + else if (intValue == 1) // No + { + aCommandLine.Append(KOverwrite); + aCommandLine.Append(KNo); + } + // AskUser is not supported + + // KSifInParam_AllowDownload Yes/No/AskUser -> -download=yes|no + intValue = GetPositiveIntParam(KSifInParam_AllowDownload, aArguments); + if (intValue == 0) // Yes + { + aCommandLine.Append(KDownload); + aCommandLine.Append(KYes); + } + else if (intValue == 1) // No + { + aCommandLine.Append(KDownload); + aCommandLine.Append(KNo); + } + // AskUser is not supported + + // KSifInParam_IAP -> -iap=IAP_ID (internet access point id) + intValue = GetPositiveIntParam(KSifInParam_IAP, aArguments); + if (intValue > -1) + { + // IAP ids are always positive + aCommandLine.Append(KIap); + aCommandLine.AppendNum(intValue); + } + + // KSifInParam_SNAP -> -snap=SNAP_ID (service network access point id) + intValue = GetPositiveIntParam(KSifInParam_SNAP, aArguments); + if (intValue > -1) + { + // SNAP ids are always positive + aCommandLine.Append(KSnap); + aCommandLine.AppendNum(intValue); + } + + // When this param is given, Java Installer will cancel installation + // before committing anything. This option is for debugging purposes only. + // KForceCancel -> -forcecancel + // The value of parameter is ignored + TRAP_IGNORE( + const TDesC &desValue = aArguments.StringByNameL(KForceCancel); + if (desValue.Length() > 0) + { + aCommandLine.Append(KForceCancel); + } + ) + + std::wstring base64EncodedArgs; + // KSifInParam_UserName -> -username=download_username + TRAP_IGNORE( + const TDesC &desValue = aArguments.StringByNameL(KSifInParam_UserName); + if (desValue.Length() > 0) + { + try + { + std::wstring value((wchar_t *)(desValue.Ptr()), desValue.Length()); + std::wstring encodedValue = JavaCommonUtils::wbase64encode(value); + aCommandLine.Append(KUsername); + aCommandLine.Append( + (const unsigned short *)encodedValue.c_str(), (int)encodedValue.length()); + base64EncodedArgs.append(L"username,"); + } + catch (std::exception& e) + { + ELOG1(EJavaInstaller, + "CJavaSifPlugin::BuildInstallCommandLine Base64 encoding user " + "name failed, err %s", e.what()); + } + } + ) + + // KSifInParam_Password -> -password=download_password + TRAP_IGNORE( + const TDesC &desValue = aArguments.StringByNameL(KSifInParam_Password); + if (desValue.Length() > 0) + { + try + { + std::wstring value((wchar_t *)(desValue.Ptr()), desValue.Length()); + std::wstring encodedValue = JavaCommonUtils::wbase64encode(value); + aCommandLine.Append(KPassword); + aCommandLine.Append( + (const unsigned short *)encodedValue.c_str(), (int)encodedValue.length()); + base64EncodedArgs.append(L"password,"); + } + catch (std::exception& e) + { + ELOG1(EJavaInstaller, + "CJavaSifPlugin::BuildInstallCommandLine Base64 encoding password " + "failed, err %s", e.what()); + } + } + ) + + // KSifInParam_SourceUrl -> -sourceurl=original (HTTP) URL of the JAD or JAR file + TRAP_IGNORE( + const TDesC &desValue = aArguments.StringByNameL(KSifInParam_SourceUrl); + if (desValue.Length() > 0) + { + try + { + std::wstring value((wchar_t *)(desValue.Ptr()), desValue.Length()); + std::wstring encodedValue = JavaCommonUtils::wbase64encode(value); + aCommandLine.Append(KSourceUrl); + aCommandLine.Append( + (const unsigned short *)encodedValue.c_str(), (int)encodedValue.length()); + base64EncodedArgs.append(L"sourceurl,"); + } + catch (std::exception& e) + { + ELOG1(EJavaInstaller, + "CJavaSifPlugin::BuildInstallCommandLine Base64 encoding source " + "url failed, err %s", e.what()); + } + } + ) + + // KSifInParam_Charset -> -charset=Internet-standard character set name + TRAP_IGNORE( + const TDesC &desValue = aArguments.StringByNameL(KSifInParam_Charset); + if (desValue.Length() > 0) + { + try + { + std::wstring value((wchar_t *)(desValue.Ptr()), desValue.Length()); + std::wstring encodedValue = JavaCommonUtils::wbase64encode(value); + aCommandLine.Append(KCharSet); + aCommandLine.Append( + (const unsigned short *)encodedValue.c_str(), (int)encodedValue.length()); + base64EncodedArgs.append(L"charset,"); + } + catch (std::exception& e) + { + ELOG1(EJavaInstaller, + "CJavaSifPlugin::BuildInstallCommandLine Base64 encoding charset " + "failed, err %s", e.what()); + } + } + ) + + if (base64EncodedArgs.length() > 0) + { + // Tell Java Installer which arguments have been Base64 encoded + aCommandLine.Append(KBase64); + aCommandLine.Append( + (const unsigned short *)base64EncodedArgs.c_str(), (int)base64EncodedArgs.length()); + } + + return; +} + +TInt CJavaSifPlugin::GetPositiveIntParam( + const TDesC& aName, + const COpaqueNamedParams& aArguments) +{ + // Assume that the value will not be found + TInt intValue = -1; + + // If the value can be read, intValue will be set, otherwise this function + // returns -1 + TRAP_IGNORE((void)aArguments.GetIntByNameL(aName, intValue)); // codescanner::voidparameter + + return intValue; +} + + +TInt CJavaSifPlugin::StartResultsServer( + COpaqueNamedParams& aResults, + CComponentInfo& aComponentInfo) +{ + // Destroy old Comms server if it exists + delete mResultsServer; + mResultsServer = NULL; + + // Start new Comms server + mResultsServer = new ResultsServer(aResults, aComponentInfo); // codescanner::nonleavenew + if (NULL == mResultsServer) + { + return KErrNoMemory; + } + else + { + // Start the server + return mResultsServer->start(); + } +} + + TBool CJavaSifPlugin::ExitIfJavaInstallerRunning( COpaqueNamedParams& aResults, TRequestStatus& aStatus) @@ -902,39 +1102,4 @@ } -TBool CJavaSifPlugin::ExitIfJavaInstallerRunning(TRequestStatus& aStatus) -{ - // If Java Installer is already running, set aStatus to KErrInUse - // and return ETrue - - RProcess proc; - TFindProcess finder(KJavaInstallerProcess); - TFullName procName; - - // Java Installer process SID is 0x102033E6 and name is "Installer" - while (finder.Next(procName) == KErrNone) - { - if (proc.Open(finder) != KErrNone) - { - continue; - } - if (proc.SecureId() == KJavaInstallerSecureID) - { - if (proc.ExitType() == EExitPending) - { - // Java Installer process is already running - proc.Close(); - - // return error information - TRequestStatus *statusPtr(&aStatus); - User::RequestComplete(statusPtr, KErrInUse); - return ETrue; - } - } - proc.Close(); - } - - return EFalse; -} - // End of File diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/javasifplugin/src/proxy.cpp --- a/javamanager/javainstaller/javasifplugin/src/proxy.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/src/proxy.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -26,7 +26,7 @@ // CONSTANTS const TImplementationProxy KImplementationTable[] = { IMPLEMENTATION_PROXY_ENTRY(KJavaSifPluginEcomImplUid, - Java::Installer::CJavaSifPlugin::NewL) + java::installer::CJavaSifPlugin::NewL) }; // ----------------------------------------------------------------------------- diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/javasifplugin/src/resultsserver.cpp --- a/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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 the License "Eclipse Public License v1.0" @@ -11,15 +11,18 @@ * * Contributors: * -* Description: Comms server, -* part of Java platform 2.0 javarestoreconverter process +* Description: Comms server, part of Java Sif plugin. +* When started in 'commsresult' mode from Java Sif plugin +* Java Installer sends the results of the operation +* it executes (install, uninstall or component info) +* to this server. * */ #include #include -#include +#include #include "comms.h" #include "javasymbianoslayer.h" @@ -30,7 +33,7 @@ using namespace std; ResultsServer::ResultsServer(COpaqueNamedParams& aResults, CComponentInfo& aInfo) : - iResults(aResults), iInfo(aInfo) + mResults(aResults), mInfo(aInfo) { } @@ -45,50 +48,43 @@ int ResultsServer::start() { - // Write reasonable error codes to iResults that can be used if + // Write reasonable error codes to mResults that can be used if // Java Installer never returns InstallerResultMessage. // If InstallerResultMessage is received the values will be overwritten. - TRAPD(err, iResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); + TRAPD(err, mResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); if (KErrNone != err) { ELOG1(EJavaInstaller, - "ResultsServer::start iResults.AddIntL ErrCategory err %d", err); + "ResultsServer::start mResults.AddIntL ErrCategory err %d", err); } - TRAP(err, iResults.AddIntL(KSifOutParam_ErrCode, KErrUnknown)); + TRAP(err, mResults.AddIntL(KSifOutParam_ErrCode, KErrUnknown)); if (KErrNone != err) { ELOG1(EJavaInstaller, - "ResultsServer::start iResults.AddIntL ErrCode err %d", err); + "ResultsServer::start mResults.AddIntL ErrCode err %d", err); } - TRAP(err, iResults.AddIntL(KSifOutParam_ExtendedErrCode, 0)); + TRAP(err, mResults.AddIntL(KSifOutParam_ExtendedErrCode, 0)); if (KErrNone != err) { ELOG1(EJavaInstaller, - "ResultsServer::start iResults.AddIntL ExtendedErrCode err %d", err); + "ResultsServer::start mResults.AddIntL ExtendedErrCode err %d", err); } - // TODO: return also localized error message from usif + // TODO: return also localized error message (KSifOutParam_ErrMessage and + // perhaps also KSifOutParam_ErrMessageDetails) from usif // common localization file after the localized strings are available - iRunning = 1; - iComms.registerDefaultListener(this); - return iComms.start(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); + + mComms.registerDefaultListener(this); + return mComms.start(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); } int ResultsServer::stop() { - if (iRunning > 0) - { - iRunning = 0; - iComms.unregisterDefaultListener(this); - return iComms.stop(); - } - else - { - return 0; - } + mComms.unregisterDefaultListener(this); + return mComms.stop(); } /** @@ -145,58 +141,8 @@ if (KErrNone != result) { - // return common error information - TRAP(err, iResults.AddIntL(KSifOutParam_ErrCode, result)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "ResultsServer::processMessage iResults.AddIntL ErrCode err %d", err); - } - - TRAP(err, iResults.AddIntL( - KSifOutParam_ErrCategory, iIntPairs[L"error-category"])); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "ResultsServer::processMessage iResults.AddIntL ErrCategory err %d", - err); - } - - HBufC *message = wstringToBuf(iStringPairs[L"error-message"]); - if (message == NULL) - { - ELOG(EJavaInstaller, - "ResultsServer::processMessage iResults.wstringToBuf returned NULL "); - } - else - { - TRAP(err, iResults.AddStringL(KSifOutParam_ErrMessage, *message)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "ResultsServer::processMessage iResults.AddStringL ErrMessage err %d", - err); - } - delete message; - } - - message = wstringToBuf(iStringPairs[L"error-details"]); - if (message == NULL) - { - ELOG(EJavaInstaller, - "ResultsServer::processMessage iResults.wstringToBuf 2 returned NULL "); - } - else - { - TRAP(err, iResults.AddStringL(KSifOutParam_ErrMessageDetails, *message)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "ResultsServer::processMessage iResults.AddStringL ErrMessageDetails " - "err %d", err); - } - delete message; - } + // return common error information; + setCommonErrorInfo(); if (INSTALL_OPERATION == operation) { @@ -221,30 +167,17 @@ // Overwrite (reset) the default error values set for the case where no // InstallerResultMessage is never received - TRAPD(err, iResults.AddIntL(KSifOutParam_ErrCategory, 0)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "ResultsServer::processMessage iResults.AddIntL ErrCategory err %d", err); - } - - TRAP(err, iResults.AddIntL(KSifOutParam_ErrCode, 0)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "ResultsServer::processMessage iResults.AddIntL ErrCode err %d", err); - } - + resetDefaultErrorValues(); if (INSTALL_OPERATION == operation) { // Return the component ids of the installed Java application. TComponentId resultComponentId = iIntPairs[L"suite-cid"]; - TRAP(err, iResults.AddIntL(KSifOutParam_ComponentId, resultComponentId)); + TRAP(err, mResults.AddIntL(KSifOutParam_ComponentId, resultComponentId)); if (KErrNone != err) { ELOG1(EJavaInstaller, - "ResultsServer::processMessage iResults.AddIntL cid error %d", err); + "ResultsServer::processMessage mResults.AddIntL cid error %d", err); } } else if (UNINSTALL_OPERATION == operation) @@ -276,7 +209,7 @@ reply.setMessageId(INSTALLER_RESULT_RESPONSE_MESSAGE_ID); reply << 0; - int err = iComms.send(reply); + int err = mComms.send(reply); if (err != 0) { ELOG1(EJavaInstaller, @@ -299,6 +232,95 @@ } +/** + * Set common error information. + * Note that the information is in member variables + * iIntPairs and iStringPairs + */ +void ResultsServer::setCommonErrorInfo() +{ + // return common error information + TRAPD(err, mResults.AddIntL(KSifOutParam_ErrCode, iIntPairs[L"error-code"])); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.AddIntL ErrCode err %d", err); + } + + TRAP(err, mResults.AddIntL( + KSifOutParam_ErrCategory, iIntPairs[L"error-category"])); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.AddIntL ErrCategory err %d", + err); + } + + HBufC *message = wstringToBuf(iStringPairs[L"error-message"]); + if (!message) + { + ELOG(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.wstringToBuf returned NULL "); + } + else + { + TRAP(err, mResults.AddStringL(KSifOutParam_ErrMessage, *message)); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.AddStringL ErrMessage err %d", + err); + } + delete message; + } + + message = wstringToBuf(iStringPairs[L"error-details"]); + if (!message) + { + ELOG(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.wstringToBuf 2 returned NULL "); + } + else + { + TRAP(err, mResults.AddStringL(KSifOutParam_ErrMessageDetails, *message)); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.AddStringL ErrMessageDetails " + "err %d", err); + } + delete message; + } +} + + +/** + * Overwrite (reset) the default error values to 'no error'. + * The default error values were originally set for the case + * where no InstallerResultMessage is never received and we must + * return sensible error information. + */ +void ResultsServer::resetDefaultErrorValues() +{ + TRAPD(err, mResults.AddIntL(KSifOutParam_ErrCategory, 0)); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::resetDefaultErrorValues mResults.AddIntL ErrCategory err %d", err); + } + + TRAP(err, mResults.AddIntL(KSifOutParam_ErrCode, 0)); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::resetDefaultErrorValues mResults.AddIntL ErrCode err %d", err); + } + + // TODO: reset also localized error message KSifOutParam_ErrMessage and + // perhaps also KSifOutParam_ErrMessageDetails if they have been set in start() +} + + void ResultsServer::clearData() { iIntPairs.clear(); @@ -337,7 +359,7 @@ ss >> midletUidN; //LOG1WSTR(EJavaInstaller, EInfo, - // "ResultsServer::processMessage: checking %s", midletUidN.c_str()); + // "ResultsServer::processMessage: checking %S", midletUidN.c_str()); int uid = iIntPairs[midletUidN]; if (uid == 0) @@ -363,8 +385,8 @@ CleanupStack::Pop(applicationInfo); n++; - } - while (n < 10000); // sanity check: no suite can have 10000 midlets + } // sanity check: no suite can have 10000 midlets + while (n < 10000); // codescanner::magicnumbers CComponentInfo::CNode *rootNode = NULL; rootNode = CComponentInfo::CNode::NewLC( @@ -385,7 +407,7 @@ ); // Store whole component info tree - iInfo.SetRootNodeL(rootNode); + mInfo.SetRootNodeL(rootNode); CleanupStack::Pop(rootNode); CleanupStack::PopAndDestroy(&applications); } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/javasifplugin/tsrc/build/testsifapi.pro --- a/javamanager/javainstaller/javasifplugin/tsrc/build/testsifapi.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/tsrc/build/testsifapi.pro Tue Jul 13 16:05:52 2010 +0100 @@ -23,7 +23,7 @@ symbian { TARGET.UID2 = 0 TARGET.UID3 = 0xE0E5E262 - TARGET.CAPABILITY = WriteDeviceData TrustedUI + TARGET.CAPABILITY = all -tcb -drm LIBS += -lestor -lapparc -lapgrfx -lefsrv -lsif diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp --- a/javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -31,7 +31,16 @@ using namespace Usif; _LIT(KTestMIDlet, "E:\\stopwatch10midp2.jad"); -//_LIT(KTestMIDlet, "C:\\data\\installs\\DS_Snow.jad"); +_LIT(KTestMIDlet2, "E:\\stopwatch11midp2.jar"); +_LIT(KTestMIDlet3, "E:\\Private\\10281e17\\SimpleRMS.jar"); +_LIT(KUserName, "user"); +_LIT(KPassWord, "password"); +_LIT(KEmptyString, ""); +_LIT(KSourceUrl, "\\sourceurl\\foo"); +_LIT(KCharSet, "charset"); +_LIT(KJadMimeType, "text/vnd.sun.j2me.app-descriptor"); +_LIT(KJarMimeType, "application/java-archive"); + /** * Installs a component by file name @@ -64,6 +73,82 @@ CleanupStack::PopAndDestroy(1); } + +/** + * This test case requires that you start Java Installer + * manually before executing this one and keep it running + * this test case ends. + * + * + * Keep the installer running until 1) installation has failed + * 2) uninstallation has failed and 3) getComponentInfo had failed + * because the installer is already running. + */ +static void sifInstallerAlreadyRunningL() +{ + LOG(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: Called"); + + RSoftwareInstall installer; + TInt err = installer.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaConverters, + "testsifapi: sifInstallerAlreadyRunningL: Cannot connect to RSoftwareInstall, err %d", err); + User::Leave(err); + } + CleanupClosePushL(installer); + +/* + LOG(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: Starting the first installer process"); + TRequestStatus status; + installer.Install(KTestMIDlet, status); + + // wait for second + User::After(1000000); +*/ + + LOG(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: Starting the concurrent installation"); + // Try to start concurrent installation, will fail + TRequestStatus status2; + installer.Install(KTestMIDlet2, status2, EFalse); + User::WaitForRequest(status2); + LOG1(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: The return status of concurrent install operation was %d", status2.Int()); + + LOG(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: Starting the concurrent uninstallation"); + // Try to start concurrent uninstallation, will fail + TRequestStatus status3; + installer.Uninstall(15, status3, EFalse); + User::WaitForRequest(status3); + LOG1(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: The return status of concurrent uninstall operation was %d", status3.Int()); + + LOG(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: Starting the concurrent get component info"); + // Try to start concurrent GetComponentInfo, will fail + TRequestStatus status4; + CComponentInfo *info = CComponentInfo::NewL(); + installer.GetComponentInfo(KTestMIDlet, *info, status4); + User::WaitForRequest(status4); + delete info; + LOG1(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: The return status of concurrent GetComponentInfo operation was %d", status4.Int()); + +/* + User::WaitForRequest(status); + + LOG1(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: The return status of install operation was %d", status.Int()); +*/ + + // free resources before returning + CleanupStack::PopAndDestroy(1); +} + /** * Installs a component by file handle using opaque arguments/results */ @@ -89,8 +174,9 @@ User::Leave(err); } +// TEMP TEST RFile installFile; - err = installFile.Open(fs, KTestMIDlet, EFileShareReadersOnly | EFileRead); + err = installFile.Open(fs, KTestMIDlet3, EFileShareReadersOnly | EFileRead); if (KErrNone != err) { ELOG1(EJavaConverters, @@ -125,6 +211,32 @@ // Silent installation request arguments->AddIntL(KSifInParam_InstallSilently, 1); + // drive E: + arguments->AddIntL(KSifInParam_Drive, 4); + + // 0 is TSifPolicy::EUserAllowed == Yes + arguments->AddIntL(KSifInParam_PerformOCSP, 0); + arguments->AddIntL(KSifInParam_IgnoreOCSPWarnings, 0); + + arguments->AddIntL(KSifInParam_AllowUpgrade, 0); + arguments->AddIntL(KSifInParam_AllowUntrusted, 0); + arguments->AddIntL(KSifInParam_AllowOverwrite, 0); + arguments->AddIntL(KSifInParam_AllowDownload, 0); + + +// TEMP TEST prevent overflow +// arguments->AddStringL(KSifInParam_UserName, KUserName); +// arguments->AddStringL(KSifInParam_Password, KPassWord); + + arguments->AddStringL(KSifInParam_SourceUrl, KSourceUrl); + + arguments->AddIntL(KSifInParam_IAP, 3); + + arguments->AddStringL(KSifInParam_Charset, KEmptyString); + + arguments->AddStringL(KSifInParam_MimeType, KJadMimeType); + + LOG(EJavaConverters, EInfo, "testsifapi: sifByHandleAndArgsAndResultsInstallL: arguments created"); @@ -155,6 +267,90 @@ return componentId; } +/** + * Installs a component by file handle using other opaque arguments than + * sifByHandleAndArgsAndResultsInstallL() + */ +static TInt secondSifByFileAndArgsAndResultsInstallL() +{ + RSoftwareInstall installer; + TInt err = installer.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaConverters, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: Cannot connect to RSoftwareInstall, err %d", err); + User::Leave(err); + } + CleanupClosePushL(installer); + + LOG(EJavaConverters, EInfo, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: RSoftwareInstall connected"); + + TRequestStatus status; + COpaqueNamedParams *arguments = COpaqueNamedParams::NewL(); + CleanupStack::PushL(arguments); + COpaqueNamedParams *results = COpaqueNamedParams::NewL(); + CleanupStack::PushL(results); + + // Silent installation request + arguments->AddIntL(KSifInParam_InstallSilently, 1); + + // illegal drive number 33 + arguments->AddIntL(KSifInParam_Drive, 33); + + // 1 is No + arguments->AddIntL(KSifInParam_PerformOCSP, 1); + arguments->AddIntL(KSifInParam_IgnoreOCSPWarnings, 1); + + arguments->AddIntL(KSifInParam_AllowUpgrade, 1); + arguments->AddIntL(KSifInParam_AllowUntrusted, 1); + arguments->AddIntL(KSifInParam_AllowOverwrite, 1); + arguments->AddIntL(KSifInParam_AllowDownload, 1); + +// TEMP TEST prevent overflow +// arguments->AddStringL(KSifInParam_UserName, KEmptyString); +// arguments->AddStringL(KSifInParam_Password, KEmptyString); + + arguments->AddStringL(KSifInParam_SourceUrl, KEmptyString); + + arguments->AddIntL(KSifInParam_SNAP, 8); + + arguments->AddStringL(KSifInParam_Charset, KCharSet); + + arguments->AddStringL(KSifInParam_MimeType, KJarMimeType); + + // forcecancel argument value is ignored, forcecancel is set if the value length > 0 + arguments->AddStringL(_L("-forcecancel"), KCharSet); + + LOG(EJavaConverters, EInfo, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: arguments created"); + + installer.Install(KTestMIDlet2, *arguments, *results, status); + + User::WaitForRequest(status); + + LOG1(EJavaConverters, EInfo, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: The return status of install operation was %d", status.Int()); + + + TInt componentId = 0; + TBool idExisted = results->GetIntByNameL(KSifOutParam_ComponentId, componentId); + if ( idExisted ) + { + LOG1(EJavaConverters, EInfo, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: Component id was %d", componentId); + } + else + { + LOG(EJavaConverters, EInfo, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: No component id was returned"); + } + + // free resources before returning + CleanupStack::PopAndDestroy(3); + + return componentId; +} static void sifUninstallL(TInt &aComponentId) { @@ -296,8 +492,50 @@ logApplicationInfo(*(info->RootNodeL().Applications()[nInd])); } + CleanupStack::PopAndDestroy(info); + + + User::After(1000000); + + // Get component info also from jar + TRequestStatus status2; + CComponentInfo *info2 = CComponentInfo::NewL(); + CleanupStack::PushL(info2); + + installer.GetComponentInfo(KTestMIDlet2, *info2, status2); + + User::WaitForRequest(status2); + + LOG1(EJavaConverters, EInfo, + "testsifapi: sifGetComponentInfoL: The return status of get " + "component info operation 2 was %d", status.Int()); + + LOG(EJavaConverters, EInfo, + "testsifapi: sifGetComponentInfoL: Logging root node (suite2)"); + + logComponentInfoNode(info2->RootNodeL()); + + LOG(EJavaConverters, EInfo, + "testsifapi: sifGetComponentInfoL: Logging child nodes (MIDlets2)"); + + TInt nMIDlets2 = info2->RootNodeL().Children().Count(); + TInt nInd2; + for (nInd2 = 0; nInd2 < nMIDlets2; nInd2++) + { + logComponentInfoNode(*(info2->RootNodeL().Children()[nInd2])); + } + + nMIDlets2 = info2->RootNodeL().Applications().Count(); + for (nInd2 = 0; nInd2 < nMIDlets2; nInd2++) + { + logApplicationInfo(*(info2->RootNodeL().Applications()[nInd2])); + } + + CleanupStack::PopAndDestroy(info2); + + // free resources before returning - CleanupStack::PopAndDestroy(2); + CleanupStack::PopAndDestroy(1); } @@ -350,6 +588,12 @@ LOG(EJavaConverters, EInfo, "testsifapi: cancelFunction: Called"); + // TEMP TEST + // This thread does not have active scheduler, + // create and install it + CActiveScheduler* as = new(ELeave) CActiveScheduler(); + CActiveScheduler::Install(as); + // Wait for 6 seconds so that the operation to be cancelled // has had time to really do something already User::After(6000000); @@ -359,9 +603,13 @@ ((RSoftwareInstall *)installer)->CancelOperation(); + LOG(EJavaConverters, EInfo, "testsifapi: cancelFunction: Starting CActiveScheduler"); + CActiveScheduler::Start(); + LOG(EJavaConverters, EInfo, "testsifapi: cancelFunction: CancelOperation() was called"); + delete as; return 0; } @@ -399,6 +647,7 @@ "testsifapi: cancelFromSameThread: CancelOperation() returned"); } + static void cancelInstallL() { LOG(EJavaConverters, EInfo, @@ -438,6 +687,30 @@ } +static void cancelNoOperationL() +{ + LOG(EJavaConverters, EInfo, + "testsifapi: cancelNoOperationL: Called"); + + RSoftwareInstall installer; + TInt err = installer.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaConverters, + "testsifapi: cancelNoOperationL: Cannot connect to RSoftwareInstall, err %d", err); + User::Leave(err); + } + CleanupClosePushL(installer); + + cancelFromSameThread(installer); + + LOG(EJavaConverters, EInfo, + "testsifapi: cancelNoOperationL: cancelFromThread returned"); + + // free resources before returning + CleanupStack::PopAndDestroy(1); + +} /** * Create cleanup stack and run the cleaner code inside TRAP harness @@ -445,35 +718,35 @@ */ TInt E32Main() { -/* - ELOG2(EJavaConverters, - "testsifapi: Starting testing long long long long long long long long long long " - "long long long long long long long long long long long long long long long long " - "long long long long long long long long long long long long long long long long " - "long long long long long long long long long long long long long buffer %d %d", 0, 1); - - LOG(EJavaConverters, EInfo, - "testsifapi: sifByHandleAndArgsAndResultsInstallL: Called"); -*/ - - __UHEAP_MARK; +// __UHEAP_MARK; CTrapCleanup* cleanupStack = CTrapCleanup::New(); TInt err = KErrNone; - /* - TRAP(err, cancelInstallL()); - if (KErrNone != err) - { - ELOG1(EJavaConverters, "testsifapi: cancelInstallL leaved with err %d", err); - } + LOG(EJavaConverters, EInfo, "testsifapi: starting cancelNoOperationL"); + TRAP(err, cancelNoOperationL()); + if (KErrNone != err) + { + ELOG1(EJavaConverters, "testsifapi: cancelNoOperationL leaved with err %d", err); + } - // Wait for a moment - User::After(500000); - */ + // Wait for a moment + User::After(500000); + LOG(EJavaConverters, EInfo, "testsifapi: starting cancelInstallL"); + TRAP(err, cancelInstallL()); + if (KErrNone != err) + { + ELOG1(EJavaConverters, "testsifapi: cancelInstallL leaved with err %d", err); + } + + // Wait for a moment + User::After(500000); + + + LOG(EJavaConverters, EInfo, "testsifapi: starting sifSimplestInstallL"); TRAP(err, sifSimplestInstallL()); if (KErrNone != err) { @@ -484,8 +757,25 @@ User::After(500000); + + // This test case must be executed sepatately, while manually started + // Java Installer is running + LOG(EJavaConverters, EInfo, "testsifapi: starting sifInstallerAlreadyRunningL"); + TRAP(err, sifInstallerAlreadyRunningL()); + if (KErrNone != err) + { + ELOG1(EJavaConverters, "testsifapi: sifInstallerAlreadyRunningL leaved with err %d", err); + } + + // Wait for a moment + User::After(500000); + + TInt componentId = 0; + TInt componentId2 = 0; + + LOG(EJavaConverters, EInfo, "testsifapi: starting sifByHandleAndArgsAndResultsInstallL"); TRAP(err, componentId = sifByHandleAndArgsAndResultsInstallL()); if (KErrNone != err) { @@ -495,7 +785,22 @@ // Wait for a moment User::After(500000); - // TODO: if this fails, it leaks memory + + // This installation will fail because MIDlet is untrusted and installing + // untrusted is denied AND because charset is illegal + LOG(EJavaConverters, EInfo, "testsifapi: starting secondSifByFileAndArgsAndResultsInstallL"); + TRAP(err, componentId2 = secondSifByFileAndArgsAndResultsInstallL()); + if (KErrNone != err) + { + ELOG1(EJavaConverters, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL leaved with err %d", err); + } + // Wait for a moment + User::After(500000); + + + // if this fails, it leaks memory + LOG(EJavaConverters, EInfo, "testsifapi: starting sifGetComponentInfoL"); TRAP(err, sifGetComponentInfoL()); if (KErrNone != err) { @@ -505,6 +810,7 @@ // Wait for a moment User::After(500000); + LOG(EJavaConverters, EInfo, "testsifapi: starting sifActivationTestL"); TRAP(err, sifActivationTestL(componentId)); if (KErrNone != err) { @@ -519,6 +825,7 @@ // TODO: if this fails, it leaks memory if (0 != componentId) { + LOG(EJavaConverters, EInfo, "testsifapi: starting sifUninstallL"); TRAP(err, sifUninstallL(componentId)); if (KErrNone != err) { @@ -530,8 +837,9 @@ User::After(500000); } + delete cleanupStack; // __UHEAP_MARKEND; - __UHEAP_MARKENDC(1); +// __UHEAP_MARKENDC(1); return KErrNone; } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javalauncher/src.s60/javalauncher.cpp --- a/javamanager/javalauncher/src.s60/javalauncher.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javalauncher/src.s60/javalauncher.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -92,7 +92,7 @@ JavaStorageApplicationList_t foundEntries; - // Get MIDlet-n from APPLICATION_PACKAGE_ATTRIBUTES_TABLE based on + // Get MIDlet-n from APPLICATION_PACKAGE_ATTRIBUTES_TABLE based on // PACKAGE_ID and NAME. attribute.setEntry(ID, aPackageId); findPattern.insert(attribute); @@ -107,7 +107,7 @@ return KErrNotFound; } - // Found the MIDlet-n argument. Now getting the MIDlet name and + // Found the MIDlet-n argument. Now getting the MIDlet name and // main class. Name is the first argument and main class is the last // in the comma separated list. std::wstring value = foundEntries.front().begin()->entryValue(); @@ -549,6 +549,10 @@ err = getUidFromCommandLine(cmdLineBuf, uid); if (KErrNone != err) { + ELOG1WSTR(EJavaCaptain, + "JavaLauncher: process command line was %s", + (wchar_t *)(cmdLineBuf.PtrZ())); + CleanupStack::PopAndDestroy(pBufCmdLine); CleanupStack::PopAndDestroy(commandLine); return err; @@ -773,6 +777,8 @@ "javalauncher: OMJ app launch: Exception %s caught", e.what()); } + delete pBufCmdLine; + return err; } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javamanager.pro --- a/javamanager/javamanager.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javamanager.pro Tue Jul 13 16:05:52 2010 +0100 @@ -17,12 +17,12 @@ SUBDIRS += preinstaller/build/javapreinstaller.pro SUBDIRS += debugapi/build/debugapi.pro SUBDIRS += javalauncher/build/javalauncher.pro +SUBDIRS += javaupgradeapp/build/javaupgradeapp.pro SUBDIRS += javacaptain SUBDIRS += javainstaller SUBDIRS += javaregistry SUBDIRS += javabackup SUBDIRS += javasettings -BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javasidchecker/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javarecognizer/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javaappschemeplugin/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javarecognizer/build/recjar.mmp --- a/javamanager/javarecognizer/build/recjar.mmp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javarecognizer/build/recjar.mmp Tue Jul 13 16:05:52 2010 +0100 @@ -32,7 +32,11 @@ // Use bytepair compression to enable code paging PAGED +APP_LAYER_SYSTEMINCLUDE + USERINCLUDE ../inc +USERINCLUDE ../../../inc + SOURCEPATH ../src SOURCE recjar.cpp @@ -40,9 +44,6 @@ TARGET recjar.rsc END -SYSTEMINCLUDE ../../../inc -APP_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/ecom LIBRARY euser.lib apmime.lib efsrv.lib diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/build/eabi/javaregistryclientu.def --- a/javamanager/javaregistry/build/eabi/javaregistryclientu.def Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/build/eabi/javaregistryclientu.def Tue Jul 13 16:05:52 2010 +0100 @@ -209,4 +209,12 @@ _ZNK4Java7Manager8Registry34CWriteableJavaRegistryPackageEntry17UsedUserDiskSpaceEv @ 208 NONAME _ZNK4Java7Manager8Registry34CWriteableJavaRegistryPackageEntry14IsPreinstalledEv @ 209 NONAME _ZNK4Java25CJavaRegistryPackageEntry14IsPreinstalledEv @ 210 NONAME + _ZN4Java14CJavaAttributeD0Ev @ 211 NONAME + _ZN4Java14CJavaAttributeD1Ev @ 212 NONAME + _ZN4Java14CJavaAttributeD2Ev @ 213 NONAME + _ZN4Java18CJavaRegistryEntryD0Ev @ 214 NONAME + _ZN4Java18CJavaRegistryEntryD1Ev @ 215 NONAME + _ZN4Java18CJavaRegistryEntryD2Ev @ 216 NONAME + _ZThn4_N4Java14CJavaAttributeD0Ev @ 217 NONAME + _ZThn4_N4Java14CJavaAttributeD1Ev @ 218 NONAME diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/client/src/javaattribute.cpp --- a/javamanager/javaregistry/client/src/javaattribute.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/client/src/javaattribute.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -92,7 +92,7 @@ // --------------------------------------------------------------------------- // CJavaAttribute::~MJavaAttribute // --------------------------------------------------------------------------- -CJavaAttribute::~CJavaAttribute() +EXPORT_C CJavaAttribute::~CJavaAttribute() { delete iName; delete iValue; diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/client/src/javaregistryentry.cpp --- a/javamanager/javaregistry/client/src/javaregistryentry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/client/src/javaregistryentry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -115,7 +115,7 @@ // CJavaRegistryEntry::~CJavaRegistryEntry // --------------------------------------------------------------------------- // -CJavaRegistryEntry::~CJavaRegistryEntry() +EXPORT_C CJavaRegistryEntry::~CJavaRegistryEntry() { if (iWritableEntry) { diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/client/src/writeablejavaregistry.cpp --- a/javamanager/javaregistry/client/src/writeablejavaregistry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/client/src/writeablejavaregistry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -414,7 +414,7 @@ } } } - catch (ExceptionBase) + catch (ExceptionBase& ee) { ELOG1WSTR(EJavaStorage, "MediaId conversion failed: '%s'", value); } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/client/src/writeablejavaregistryentry.cpp --- a/javamanager/javaregistry/client/src/writeablejavaregistryentry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/client/src/writeablejavaregistryentry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -303,19 +303,15 @@ AttributesL(); } - CJavaAttribute* regAttr = NULL; for (TInt i = 0; i < iAttributes.Count(); i++) { if (0 == (iAttributes[i])->Name().Compare(aName)) { - regAttr = CJavaAttribute::NewL((iAttributes[i])->Name(), - (iAttributes[i])->Value(), - (iAttributes[i])->Trusted()); - break; + return iAttributes[i]; } } - return regAttr; + return NULL; } // --------------------------------------------------------------------------- diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/legacy/tsrc/build/testlegacyregistry.mmp --- a/javamanager/javaregistry/legacy/tsrc/build/testlegacyregistry.mmp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/build/testlegacyregistry.mmp Tue Jul 13 16:05:52 2010 +0100 @@ -20,9 +20,10 @@ CAPABILITY all -tcb -allfiles -drm #include <../../../../../inc/java_stdcpp_support_for_exe.hrh> -#include +#include -USERINCLUDE /epoc32/include/cpputest +USERINCLUDE /epoc32/include/CppUTest // Due to TestHarness.h et al + USERINCLUDE ../src/utils USERINCLUDE ../../../../../inc // == (JAVA_SRC_ROOT)/inc USERINCLUDE ../../../../../jrt_plat/java_registry_api/inc diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/legacy/tsrc/src/AllTests.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/AllTests.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/AllTests.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -15,8 +15,8 @@ * */ -#include "Platform.h" -#include "CommandLineTestRunner.h" +#include +#include int main(int ac, char** av) { diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include "TestHarness.h" +#include #include "javastorage.h" #include "javastorageexception.h" diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistryentry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistryentry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistryentry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include "TestHarness.h" +#include #include "javastorage.h" #include "javastorageexception.h" diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/legacy/tsrc/src/testlegacyregistry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testlegacyregistry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testlegacyregistry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include "TestHarness.h" +#include #include "javacommonutils.h" #include "javaoslayer.h" diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/legacy/tsrc/src/testmidletentry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testmidletentry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testmidletentry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include "TestHarness.h" +#include #include "javacommonutils.h" #include "javaoslayer.h" diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/legacy/tsrc/src/testsuiteentry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testsuiteentry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testsuiteentry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include "TestHarness.h" +#include #include "javacommonutils.h" #include "javaoslayer.h" diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/tsrc/build/alltests.mmp --- a/javamanager/javaregistry/tsrc/build/alltests.mmp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/tsrc/build/alltests.mmp Tue Jul 13 16:05:52 2010 +0100 @@ -21,12 +21,12 @@ #include <../../../../inc/java_stdcpp_support_for_exe.hrh> #include - APP_LAYER_SYSTEMINCLUDE -MW_LAYER_SYSTEMINCLUDE + +APP_LAYER_SYSTEMINCLUDE -USERINCLUDE /epoc32/include/cpputest +USERINCLUDE /epoc32/include/CppUTest // Due to TestHarness.h et al + USERINCLUDE ../src/utils - USERINCLUDE ../../../../inc // == (JAVA_SRC_ROOT)/inc // Using main() as entry point diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/tsrc/src/AllTests.cpp --- a/javamanager/javaregistry/tsrc/src/AllTests.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/AllTests.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -15,8 +15,8 @@ * */ -#include "Platform.h" -#include "CommandLineTestRunner.h" +#include +#include int main(int ac, char** av) { diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/tsrc/src/AllTests.h --- a/javamanager/javaregistry/tsrc/src/AllTests.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/AllTests.h Tue Jul 13 16:05:52 2010 +0100 @@ -15,7 +15,7 @@ * */ -#include "Utest.h" +#include //Include this in the test main to execute these tests IMPORT_TEST_GROUP(TestRegistry); diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/tsrc/src/testregistry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -19,7 +19,7 @@ #include #include -#include "TestHarness.h" +#include #include "javastorage.h" #include "javastorageexception.h" diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/tsrc/src/testregistryapplicationentry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistryapplicationentry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistryapplicationentry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -19,7 +19,7 @@ #include #include -#include "TestHarness.h" +#include #include "javaregistry.h" #include "javaregistryapplicationentry.h" diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/tsrc/src/testregistryentry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistryentry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistryentry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -20,7 +20,7 @@ #include #include -#include "TestHarness.h" +#include #include "javastorage.h" #include "javastorageexception.h" diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaregistry/tsrc/src/testregistrypackageentry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistrypackageentry.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistrypackageentry.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -19,7 +19,7 @@ #include #include -#include "TestHarness.h" +#include #include "javaprocessconstants.h" #include "javaregistry.h" diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javasettings/appsettingsview_qt/build/javaapplicationsettingsview.pro --- a/javamanager/javasettings/appsettingsview_qt/build/javaapplicationsettingsview.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javasettings/appsettingsview_qt/build/javaapplicationsettingsview.pro Tue Jul 13 16:05:52 2010 +0100 @@ -15,8 +15,9 @@ # TEMPLATE = lib TARGET = javaapplicationsettingsview -CONFIG += qt hb stl plugin -LIBS += -ljavastorage -lcmapplsettingsui -ljavaconnectionmanager -lqtbearer -ljavautils +CONFIG += qt hb stl plugin mobility +MOBILITY += bearer +LIBS += -ljavastorage -lcmapplsettingsui -ljavaconnectionmanager -ljavautils TRANSLATIONS = javaruntimeapplicationsettings.ts INCLUDEPATH += ../inc ../../../../inc diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javasettings/appsettingsview_qt/src/javaapplicationsettingsview_p.cpp --- a/javamanager/javasettings/appsettingsview_qt/src/javaapplicationsettingsview_p.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javasettings/appsettingsview_qt/src/javaapplicationsettingsview_p.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -142,7 +142,7 @@ if (mainForm) { // do the connect for the main form - iPublicView->connect(mainForm, SIGNAL(activated(const QModelIndex)), + iPublicView->connect(mainForm, SIGNAL(itemShown(const QModelIndex)), iPublicView, SLOT(_q_dataItemDisplayed(const QModelIndex))); // set the form as view's widget @@ -231,7 +231,7 @@ localizedSettingsNames[QString::fromStdWString(BROADCAST_SETTINGS)] = QString(hbTrId("txt_java_sett_setlabel_broadcast")); localizedSettingsNames[QString::fromStdWString(NFC_WRITE_ACCESS_SETTINGS)] = QString(hbTrId("txt_java_sett_setlabel_nfc_write_access")); localizedSettingsNames[QString::fromStdWString(URL_START_SETTINGS)] = QString(hbTrId("txt_java_sett_setlabel_url_start")); - vector allSecuritySettings = readFromStorage(FUNCTION_GROUP, MIDP_FUNC_GRP_SETTINGS_TABLE); + vector allSecuritySettings = readFromStorage(FUNCTION_GROUP, MIDP_FUNC_GRP_SETTINGS_TABLE, MIDP_PERMISSIONS_TABLE); // sort the security settings according to how they should be displayed std::sort(allSecuritySettings.begin(), allSecuritySettings.end(), AscendingSort()); QHash settingsIndexes; @@ -382,10 +382,9 @@ == BLANKET) { QString secWarning = SENSITIVE_SETTINGS; - if (settings.getName() == NET_ACCESS - || highRiskList[i]->getName() == NET_ACCESS - || settings.getName() == LOW_LEVEL_NET_ACCESS - || highRiskList[i]->getName() == LOW_LEVEL_NET_ACCESS) + QString LOCAL_CONNECTIVITY = QString(hbTrId("txt_java_sett_setlabel_local_conn")); + if (settings.getName() != LOCAL_CONNECTIVITY + && highRiskList[i]->getName() != LOCAL_CONNECTIVITY) { secWarning = SENSITIVE_SETTINGS_NET_USAGE; } @@ -574,15 +573,23 @@ HbWidget * widget = (qobject_cast (mainForm->itemByIndex(dataItemIndex)))->dataItemContentWidget(); JavaApplicationSettings* settings = findSettings(widget); - if (settings == NULL || settings->isConnectedToUi()) + if (settings == NULL) { + // stop right here return; } - settings->connectToUi(); switch(HbDataFormModelItem::DataItemType(itemType)) { case HbDataFormModelItem::ComboBoxItem: comboBox = static_cast(widget); + if (settings->isConnectedToUi()) + { + // need to do a reconnect: disconnect followed by a connect + iPublicView->disconnect(comboBox, + SIGNAL(currentIndexChanged(const QString &)), + iPublicView, + SLOT(_q_settingsChanged(const QString &))); + } iPublicView->connect(comboBox, SIGNAL(currentIndexChanged(const QString &)), iPublicView, SLOT(_q_settingsChanged(const QString &)), @@ -590,12 +597,21 @@ break; case HbDataFormModelItem::ToggleValueItem: pushButton = static_cast< HbPushButton*>(widget); + if (settings->isConnectedToUi()) + { + // need to do a reconnect: disconnect followed by a connect + iPublicView->disconnect(pushButton, + SIGNAL(clicked(bool)), + iPublicView, + SLOT(_q_settingsChanged(bool))); + } iPublicView->connect(pushButton, SIGNAL(clicked(bool)), iPublicView, SLOT(_q_settingsChanged(bool)), Qt::UniqueConnection); break; } + settings->connectToUi(); } void JavaApplicationSettingsViewPrivate::netConnSelected(uint netConnSelectionStatus) @@ -965,7 +981,7 @@ return value; } -vector JavaApplicationSettingsViewPrivate::readFromStorage(const std::wstring& aColumnName, const std::string& aTableName) +vector JavaApplicationSettingsViewPrivate::readFromStorage(const std::wstring& aColumnName, const std::string& aPrimaryTableName, const std::string& aSecondaryTableName) { vector values; @@ -991,7 +1007,7 @@ settingsNamesIndexes[QString::fromStdWString(NFC_WRITE_ACCESS_SETTINGS)] = 15; settingsNamesIndexes[QString::fromStdWString(URL_START_SETTINGS)] = 16; int last_index = 16; - + JavaStorageApplicationEntry_t query; JavaStorageApplicationList_t queryResult; JavaStorageEntry attr; @@ -1002,8 +1018,10 @@ try { - iStorage->search(aTableName, query, queryResult); + iStorage->search(aPrimaryTableName, query, queryResult); + JavaStorageApplicationList_t::const_iterator iterator; + JavaStorageApplicationList_t secondaryQueryResult; for (iterator = queryResult.begin(); iterator != queryResult.end(); iterator++) { std::wstring name = L""; @@ -1011,22 +1029,32 @@ JavaStorageEntry findPattern; findPattern.setEntry(aColumnName, L""); JavaStorageApplicationEntry_t::const_iterator findIterator = - entry.find(findPattern); + entry.find(findPattern); if (findIterator != entry.end()) { name = findIterator->entryValue(); - } - + } if (name.size() > 0) { - IndexedSettingsName value; - value.name = name; - value.index = last_index + 1; - if (settingsNamesIndexes.contains(QString::fromStdWString(name))) + entry.clear(); + query.clear(); + attr.setEntry(ID, iSuiteUid); + query.insert(attr); + attr.setEntry(aColumnName, name); + query.insert(attr); + secondaryQueryResult.clear(); + iStorage->search(aSecondaryTableName, query, secondaryQueryResult); + if (secondaryQueryResult.size() > 0) { - value.index = settingsNamesIndexes.value(QString::fromStdWString(name)); + IndexedSettingsName value; + value.name = name; + value.index = last_index + 1; + if (settingsNamesIndexes.contains(QString::fromStdWString(name))) + { + value.index = settingsNamesIndexes.value(QString::fromStdWString(name)); + } + values.push_back(value); } - values.push_back(value); } } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javasettings/appsettingsview_qt/src/javaapplicationsettingsview_p.h --- a/javamanager/javasettings/appsettingsview_qt/src/javaapplicationsettingsview_p.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javasettings/appsettingsview_qt/src/javaapplicationsettingsview_p.h Tue Jul 13 16:05:52 2010 +0100 @@ -80,7 +80,7 @@ void writeToStorage(JavaApplicationSettings& settings); bool findFromStorage(const std::wstring&, const std::wstring&, const std::wstring&, const std::string&); std::wstring readFromStorage(const std::wstring&, const std::wstring&, const std::wstring&, const std::string&); - std::vector readFromStorage(const std::wstring& aColumnName, const std::string& aTableName); + std::vector readFromStorage(const std::wstring& aColumnName, const std::string& aPrimaryTableName,const std::string& aSecondaryTableName); void filterSecuritySettings(JavaApplicationSettings& settings); void findEntry(const java::storage::JavaStorageApplicationList_t&, const std::wstring&, std::wstring& eValue); void readSuiteUid(const QString& aAppUid); diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javasidchecker/build/bld.inf --- a/javamanager/javasidchecker/build/bld.inf Wed Jun 30 15:21:28 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +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: Build information file for Java SID Checker component -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_MMPFILES -javasidchecker.mmp diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javasidchecker/build/javasidchecker.mmp --- a/javamanager/javasidchecker/build/javasidchecker.mmp Wed Jun 30 15:21:28 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +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: This is an ECOM plugin for Symbian AppArc (database that contains -* info on all applications installed to the device) -* This plugin tells AppArc whether Java application installed -* to a removable storage media is present and can be executed. -* -*/ - - -// INCLUDES -#include <../../../inc/project_defines.hrh> -#include <../../../inc/build_defines.hrh> -#include -#include - -#include <../../../inc/java_stdcpp_support_for_dll.hrh> - -TARGET javasidchecker.dll -CAPABILITY All -Tcb -TARGETTYPE plugin - -UID 0x10009d8d 0x10281FBE - -// Use bytepair compression to enable code paging -PAGED - -// Includes -USERINCLUDE . -USERINCLUDE ../inc -USERINCLUDE ../../../inc - -// Sources -SOURCEPATH ../src -SOURCE javasidchecker.cpp - -start RESOURCE ../data/10281FBE.rss -target javasidchecker.rsc -end - -#ifdef RD_JAVA_OLD_SIDCHECKER_LIBRARY -LIBRARY apfile.lib -#else -LIBRARY aplist.lib -#endif - -LIBRARY ecom.lib -LIBRARY javaregistryclient.lib diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javasidchecker/data/10281FBE.rss --- a/javamanager/javasidchecker/data/10281FBE.rss Wed Jun 30 15:21:28 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +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: Java Sid Checker is an ECOM plugin for Symbian AppArc -* (database that contains info on all applications installed -* to the device) -* It tells AppArc whether Java application installed -* to a removable storage media is present and can be executed. -* -*/ - - -// Registry file for the CApparcVerifierInterface JavaRegistry implementation - -#include -#include "javauids.h" - -RESOURCE REGISTRY_INFO r_registry -{ - resource_format_version = RESOURCE_FORMAT_VERSION_2; - dll_uid = KJavaSidCheckerDllUid; // must match the name of this file - interfaces = - { - INTERFACE_INFO - { - interface_uid = KSidCheckerEcomIfUid; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = KSidCheckerEcomImplUid; - // Version number is 2 so that this implementation should override the old one in ROM - version_no = 2; - display_name = "JavaVerify"; - default_data = "[10210e26]"; - opaque_data = ""; - rom_only = 0; - } - }; - } - }; -} diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javasidchecker/inc/javasidchecker.h --- a/javamanager/javasidchecker/inc/javasidchecker.h Wed Jun 30 15:21:28 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +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: Java Sid Checker is an ECOM plugin for Symbian AppArc - * (database that contains info on all applications installed - * to the device) - * It tells AppArc whether Java application installed - * to a removable storage media is present and can be executed. - * -*/ - - -#ifndef JAVASIDCHECKER_H -#define JAVASIDCHECKER_H - -#include -#include - -NONSHARABLE_CLASS(CJavaSidChecker) : public CAppSidChecker - /** Java Sid checker. - - This is an implementation of CAppSidChecker for checking native application Sids - - This instance of the CAppSidChecker is used to verify that a native application - installed and can be launched. - */ -{ -public: - static CJavaSidChecker* NewL(); - ~CJavaSidChecker(); - - // From CAppSidChecker - TBool AppRegisteredAt(const TUid& aSid, TDriveUnit aDrive); - - void SetRescanCallBackL(const TCallBack &aCallback); - -private: - CJavaSidChecker(); - TBool AppRegisteredAtL(const TUid& aSid, TDriveUnit aDrive); - - Java::CJavaRegistry* iJavaRegistry; -}; - -#endif // JAVASIDCHECKER_H diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javasidchecker/src/javasidchecker.cpp --- a/javamanager/javasidchecker/src/javasidchecker.cpp Wed Jun 30 15:21:28 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +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: Java Sid Checker is an ECOM plugin for Symbian AppArc - * (database that contains info on all applications installed - * to the device) - * It tells AppArc whether Java application installed - * to a removable storage media is present and can be executed. - * -*/ - - -#include -#include -#include - -#include "javauids.h" -#include "javasidchecker.h" -#include "logger.h" - - -// DLL Entry point -TBool E32Dll() -{ - return ETrue; -} - -// ECOM Implementation Table -const TImplementationProxy ImplementationTable[] = -{ - IMPLEMENTATION_PROXY_ENTRY(KSidCheckerEcomImplUid, CJavaSidChecker::NewL) -}; - -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) -{ - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - return ImplementationTable; -} - - -CJavaSidChecker* CJavaSidChecker::NewL() -{ - // Minimal construction (we don't want this to fail) - return new(ELeave) CJavaSidChecker; -} - -CJavaSidChecker::CJavaSidChecker() -{ - iJavaRegistry = NULL; - LOG(EUtils, EInfo, "CJavaSidChecker: Constructor called"); -} - -CJavaSidChecker::~CJavaSidChecker() -{ - if (NULL != iJavaRegistry) - { - delete iJavaRegistry; - iJavaRegistry = NULL; - } - LOG(EUtils, EInfo, "CJavaSidChecker: Destructor called"); -} - -TBool CJavaSidChecker::AppRegisteredAt(const TUid& aSid, TDriveUnit aDrive) -{ - TBool installed = EFalse; - - LOG1(EUtils, EInfo, "CJavaSidChecker: AppRegisteredAt called, %x", aSid.iUid); - - // No Java application can have Uid 0 - if (aSid.iUid == 0) - { - return installed; - } - - TRAPD(err, installed = AppRegisteredAtL(aSid, aDrive)); - if (KErrNone != err) - { - ELOG1(EUtils, "CJavaSidChecker: AppRegisteredAt error %d", err); - } - - return installed; -} - -TBool CJavaSidChecker::AppRegisteredAtL(const TUid& aSid, TDriveUnit /*aDrive*/) -{ - // Create the Java Registry if it has not been created already - if (NULL == iJavaRegistry) - { - iJavaRegistry = Java::CJavaRegistry::NewL(); - } - - // JavaRegistry does not return entries that are not present. - return iJavaRegistry->RegistryEntryExistsL(aSid); -} - -void CJavaSidChecker::SetRescanCallBackL(const TCallBack &/*aCallBack*/) -{ - // Do nothing - return; -} diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/javaupgradeapp/src.s60/javaupgradeapp.cpp --- a/javamanager/javaupgradeapp/src.s60/javaupgradeapp.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/javaupgradeapp/src.s60/javaupgradeapp.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -26,6 +26,7 @@ #include "exceptionbase.h" #include "javaoslayer.h" +#include "javacommonutils.h" #include "javaprocessconstants.h" #include "javasymbianoslayer.h" #include "javauids.h" @@ -35,10 +36,10 @@ using namespace java::util; -_LIT(KHexValueStart, "0x"); -_LIT(KSemiColon, ";"); -_LIT(KUidArg, "uid="); -_LIT(KFileArg, "file="); +_LIT8(KHexValueStart, "0x"); +_LIT8(KSemiColon, ";"); +_LIT8(KUidArg, "uid="); +_LIT8(KFileArg, "file="); const TInt KExtraLenForLogging = 2; const TInt KArgumentValueMaxLen = 1568; @@ -53,9 +54,9 @@ * @param aArgName the name of the argument * @param aArgValue the value parsed from command line will be returned here */ -static void getArgValueL(const TPtrC &aCmdLine, const TDesC &aArgName, HBufC **aArgValue) +static void getArgValueL(const TPtrC8 &aCmdLine, const TDesC8 &aArgName, HBufC **aArgValue) { - TBuf valueBuf; + TBuf8 valueBuf; TInt argPos = aCmdLine.FindF(aArgName); if (argPos >= 0) { @@ -81,9 +82,14 @@ valueBuf = aCmdLine.Mid(argPos + aArgName.Length(), argLen); } - // Allocate new HBufC and return it + // Allocate new HBufC HBufC *pBufValue = HBufC::NewL(valueBuf.Length() + 2); - *pBufValue = valueBuf; + + // Convert argument from UTF8 to UCS-2 (UTF16) + std::wstring tmp = JavaCommonUtils::utf8ToWstring((const char *)valueBuf.PtrZ()); + + // Return the argument inside the new HBufC + *pBufValue = (const TUint16 *)(tmp.c_str()); *aArgValue = pBufValue; } @@ -96,7 +102,7 @@ * ;file=YYY; * @param aFileName will contain the name parsed from command line */ -static void getNameFromCommandLineL(const TPtrC &aCmdLine, HBufC **aFileName) +static void getNameFromCommandLineL(const TPtrC8 &aCmdLine, HBufC **aFileName) { TInt err = aCmdLine.FindF(KFileArg); User::LeaveIfError(err); @@ -113,14 +119,14 @@ * uid=YYY; * @param aUid will contain the Uid parsed from command line */ -static void getUidFromCommandLineL(const TPtrC &aCmdLine, TInt32 &aUid) +static void getUidFromCommandLineL(const TPtrC8 &aCmdLine, TInt32 &aUid) { TInt err(KErrNone); TInt argPos = aCmdLine.FindF(KUidArg); if (KErrNotFound != argPos) { - TPtrC uidToParse = aCmdLine.Mid(argPos + KUidArg.iTypeLength); - TLex parseUid(uidToParse); + TPtrC8 uidToParse = aCmdLine.Mid(argPos + KUidArg.iTypeLength); + TLex8 parseUid(uidToParse); if (uidToParse.FindF(KHexValueStart) == 0) { parseUid.Inc(2); // skip hex prefix @@ -163,16 +169,31 @@ */ void getFileAndUidL(HBufC **aFileName, TInt32 *aUid) { - HBufC *pBufCmdLine = - HBufC::NewLC(User::CommandLineLength() + KExtraLenForLogging); - TPtr cmdLineBuf = pBufCmdLine->Des(); - User::CommandLine(cmdLineBuf); + CApaCommandLine* commandLine; + + // CApaCommandLine command line is used when this application has been + // launched using AppArc APIs. + TInt err = CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine); + if (KErrNone != err) + { + ELOG1(EUtils, "javaupgradeapp: Getting CApaCommandLine failed, err %d", err); + User::Leave(err); + } + CleanupStack::PushL(commandLine); - if (cmdLineBuf.Length() > 0) + // Get the value of _application-args_ + TPtrC8 args = commandLine->TailEnd(); + HBufC8 *pBufCmdLine = + HBufC8::NewLC(args.Length() + KExtraLenForLogging); + if (args.Length() > 0) { - LOG1WSTR(EUtils, EInfo, - "javaupgradeapp: full java application cmd line is : %s", - (wchar_t *)(cmdLineBuf.PtrZ())); + // Copy the arguments to the new HBufC8 + TPtr8 cmdLineBuf = pBufCmdLine->Des(); + cmdLineBuf = args; + + LOG1(EUtils, EInfo, + "javaupgradeapp: full cmd line is : %s", + cmdLineBuf.PtrZ()); // Get the midlet uid from the commandline TRAPD(err, getUidFromCommandLineL(cmdLineBuf, *aUid)); @@ -208,6 +229,7 @@ } CleanupStack::PopAndDestroy(pBufCmdLine); + CleanupStack::PopAndDestroy(commandLine); } @@ -233,7 +255,7 @@ // be preinstalled again if the user uninstalls it commandLine.Append(_L(" uninstall -uid=")); commandLine.AppendNum(aUid); - commandLine.Append(_L(" -forceuninstall -silent -preinstall_always")); + commandLine.Append(_L(" -forceuninstall -silent -resetpreinstall")); LOG1WSTR(EUtils, EInfo, "javaupgradeapp:uninstallJavaAppL Java Installer command line is %s", @@ -304,7 +326,7 @@ retryCounter--; if (retryCounter > 0) { - User::After(KDelayWhenWaitingAppArc); + User::After(KDelayWhenWaitingAppArc); // codescanner::userafter continue; } else @@ -344,22 +366,27 @@ if (uid != 0) { - LOG1( - EUtils, - EInfo, - "javaupgradeapp uninstalling app uid %d", uid); + PLOG1(EUtils, "javaupgradeapp uninstalling app uid %x", uid); uninstallJavaAppL(uid); } + else + { + WLOG(EUtils, "javaupgradeapp: uid argument was not given"); + } if (pBufFileName != NULL) { - LOG1WSTR(EUtils, EInfo, + PLOG1WSTR(EUtils, "javaupgradeapp: installing new app package %s", (wchar_t *)(pBufFileName->Des().PtrZ())); installAppPackageL(pBufFileName); delete pBufFileName; } + else + { + WLOG(EUtils, "javaupgradeapp: file argument was not given"); + } } diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/preinstaller/build/javapreinstaller.pro --- a/javamanager/preinstaller/build/javapreinstaller.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/preinstaller/build/javapreinstaller.pro Tue Jul 13 16:05:52 2010 +0100 @@ -27,7 +27,9 @@ -lPlatformEnv \ -ljavacomms \ -lcharconv \ - -ljavastorage + -ljavastorage \ + -lapparc \ + -lapgrfx } include(../../../build/omj.pri) diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/preinstaller/src.s60/silentmidletinstall.cpp --- a/javamanager/preinstaller/src.s60/silentmidletinstall.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/preinstaller/src.s60/silentmidletinstall.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: OMJ S60 preinstaller process +* Description: OMJ Symbian preinstaller process * */ @@ -26,6 +26,8 @@ #include "silentmidletinstall.h" #include "javacommonutils.h" +#include "javauid.h" +#include "javauids.h" #include "logger.h" #include "javaprocessconstants.h" #include "javasymbianoslayer.h" @@ -51,6 +53,7 @@ _LIT(KMidletName, "MIDlet-Name"); _LIT(KMidletVendor, "MIDlet-Vendor"); _LIT(KMidletVersion, "MIDlet-Version"); +_LIT(KMidletUid, "Nokia-MIDlet-UID-1"); _LIT(KJadExtension, "*.jad"); @@ -96,9 +99,9 @@ */ void CSilentMIDletInstall::ConstructL() { - JELOG2(EJavaPreinstaller); iMIDletName = HBufC::NewL(KMaxBufferSize); iMIDletVendor = HBufC::NewL(KMaxBufferSize); + iMIDletUid = HBufC::NewL(KMaxBufferSize); iPreinstallServer = new(ELeave) PreinstallCommsServer(); iNumberOfAppsToInstall = 0; @@ -111,7 +114,6 @@ */ CSilentMIDletInstall::~CSilentMIDletInstall() { - JELOG2(EJavaPreinstaller); iJadFiles.ResetAndDestroy(); iJadFiles.Close(); @@ -124,6 +126,9 @@ delete iMIDletVendor; iMIDletVendor = NULL; + delete iMIDletUid; + iMIDletUid = NULL; + delete iPreinstallServer; iPreinstallServer = NULL; } @@ -133,7 +138,6 @@ */ void CSilentMIDletInstall::Start() { - JELOG2(EJavaPreinstaller); iState = EFindOutDeviceDrives; // Check if an explicit roll-back of a previous installation is needed @@ -187,8 +191,6 @@ */ void CSilentMIDletInstall::CompleteRequest() { - JELOG2(EJavaPreinstaller); - TRequestStatus *status = &iStatus; User::RequestComplete(status, KErrNone); if (!IsActive()) @@ -241,8 +243,6 @@ */ void CSilentMIDletInstall::RunL() { - JELOG2(EJavaPreinstaller); - switch (iState) { case EFindOutDeviceDrives: @@ -580,13 +580,12 @@ /** * Parse MIDlet-Name, MIDlet-Vendor and MIDlet-Version parameters from JAD file. * Parameters are used to determine whether to pre-install MIDlet or not. + * Parse also optional Nokia-MIDlet-UID-1 in case it is needed. * * @param ETrue if parsing succeeds otherwise EFalse. */ TBool CSilentMIDletInstall::ParseJadL(const TDesC& aJadFileName) { - JELOG2(EJavaPreinstaller); - HBufC *jadContent = NULL; // Trap leave thrown if reading jad content fails TRAPD(err, jadContent = GetJadContentL(aJadFileName)); @@ -647,6 +646,23 @@ "CSilentMIDletInstall::ParseJadL MIDlet-Version is %d.%d.%d", iMIDletVersion.iMajor, iMIDletVersion.iMinor, iMIDletVersion.iBuild); + HBufC *midletUid = ParseAttribute(jadContent, KMidletUid); + if (NULL == midletUid) + { + // Ok, all MIDlets do not predefine Symbian Uid + iMIDletUid->Des().Zero(); + } + else + { + // store midlet Uid to member variable and log it + TPtr uidPtr(iMIDletUid->Des()); + uidPtr.Copy(*midletUid); + LOG1WSTR(EJavaPreinstaller, EInfo, + "CSilentMIDletInstall::ParseJadL Nokia-MIDlet-UID-1 %s", + (wchar_t *)(uidPtr.PtrZ())); + delete midletUid; + } + CleanupStack::PopAndDestroy(jadContent); return ETrue; } @@ -727,10 +743,17 @@ // Do not preinstall application if it is found from this table // and the version number of the application is the same or less // than the version number in the table. + // If the application has been removed by javaupgradeupp or it has + // not yet been installed, the application is not in the table at all. + // Do not preinstall the application if there is a native application + // with the same Uid as the predefined Uid of the first Java + // application in the application suite. + TBool apaSessionConnected(EFalse); + RApaLsSession apaSession; JavaStorageEntry attribute; JavaStorageApplicationEntry_t findPattern; - JavaStorageApplicationList_t foundEntries; + JavaStorageApplicationList_t foundEntries; for (TInt i = 0; i < iJadFiles.Count(); i++) { @@ -778,8 +801,8 @@ { // This application must not be preinstalled LOG1WSTR(EJavaPreinstaller, EInfo, - "CheckWhichAppsShouldBeInstalledL: User has removed application %s " - "It must not be preinstalled again.", desToWstring(namePtr)); + "CheckWhichAppsShouldBeInstalledL: User has removed application %s " + "It must not be preinstalled again.", desToWstring(namePtr)); } else { @@ -817,9 +840,34 @@ else { skipInstall = EFalse; + LOG(EJavaPreinstaller, EInfo, "CheckWhichAppsShouldBeInstalledL: Application has not " "been installed previously"); + + // Check whether there is a native application installed + // with the same Uid as the predefined Uid of the first + // Java application in the suite. + + // The string value of attribute Nokia-MIDlet-UID-1 from + // Jad file is in iMIDletUid if it was defined. + TInt err = KErrNone; + if (iMIDletUid->Length() > 0) + { + if (!apaSessionConnected) + { + err = apaSession.Connect(); + apaSessionConnected = ETrue; + } + + // If the presence of a possible native app cannot be + // determined, let Java Installer try to install + // the Java application + if (KErrNone == err) + { + skipInstall = IsNativeAppPresent(apaSession); + } + } } foundEntries.clear(); @@ -830,8 +878,8 @@ skipInstall = ETrue; TPtr16 ptrJadName = iJadFiles[i]->Des(); ELOG1WSTR(EJavaPreinstaller, - "CheckWhichAppsShouldBeInstalledL: Parsing JAD %s failed", - desToWstring(ptrJadName)); + "CheckWhichAppsShouldBeInstalledL: Parsing JAD %s failed", + desToWstring(ptrJadName)); } if (skipInstall) @@ -845,6 +893,11 @@ } } + if (apaSessionConnected) + { + apaSession.Close(); + } + js->close(); } @@ -1165,3 +1218,53 @@ return midletVersion; } // DesToAppVersion + + +/** + * Parses the Uid in iMIDletUid and returns ETrue if there is a native + * application with the same Uid installed into the device. + * Returns EFalse in case of any error. + * + * @param[in] aApaSession open AppArc session + * @return EFalse if no native application with Uid in iMIDletUid + */ +TBool CSilentMIDletInstall::IsNativeAppPresent(const RApaLsSession& aApaSession) +{ + std::wstring uidValue((wchar_t *)(iMIDletUid->Ptr()), iMIDletUid->Length()); + TUid appUid; + Uid javaUid(uidValue); + TInt err = uidToTUid(javaUid, appUid); + + if (KErrNone != err) + { + WLOG1(EJavaPreinstaller, + "CSilentMIDletInstall::IsNativeAppPresent: Cannot convert %S to TUid", + uidValue.c_str()); + return EFalse; + } + + TUid appTypeUid; + err = aApaSession.GetAppType(appTypeUid, appUid); + if (KErrNone != err) + { + if (KErrNotFound == err) + { + // No such application in device + return EFalse; + } + + // Cannot check presence from AppArc + ELOG1(EJavaPreinstaller, + "CSilentMIDletInstall::IsNativeAppPresent: RApaLsSession GetAppType error %d", err); + return EFalse; + } + + if (appTypeUid.iUid != KMidletApplicationTypeUid) + { + // The application is present and it is not a MIDlet + return ETrue; + } + + return EFalse; +} // IsNativeAppPresent + diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/preinstaller/src.s60/silentmidletinstall.h --- a/javamanager/preinstaller/src.s60/silentmidletinstall.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/preinstaller/src.s60/silentmidletinstall.h Tue Jul 13 16:05:52 2010 +0100 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: OMJ S60 preinstaller process +* Description: OMJ Symbian preinstaller process * */ @@ -19,6 +19,7 @@ #ifndef SILENTMIDLETINSTALL_H #define SILENTMIDLETINSTALL_H +#include // for RApaLsSession #include #include #include @@ -101,6 +102,9 @@ // Parses the application version string given in aAppVersionString // and returns the corresponding Symbian TAppVersion. TAppVersion DesToAppVersion(const HBufC *aAppVersionString); + // Parses the Uid in iMIDletUid and returns ETrue if there is a native + // application with the same Uid installed into the device + TBool IsNativeAppPresent(const RApaLsSession& aApaSession); private: @@ -123,6 +127,8 @@ HBufC* iMIDletVendor; // Variable used for parsing midlet version from jad file TAppVersion iMIDletVersion; + // Buffer used for parsing Uid of the first midlet from jad file + HBufC* iMIDletUid; // Drive status info for each non-remote, non-substed drive on device TUint iDriveStatuses[KMaxDrives]; diff -r 0105bdca6f9c -r 3182bd6adebb javamanager/subsystem.mk --- a/javamanager/subsystem.mk Wed Jun 30 15:21:28 2010 +0100 +++ b/javamanager/subsystem.mk Tue Jul 13 16:05:52 2010 +0100 @@ -26,23 +26,31 @@ COMPONENTS = \ preinstaller/build \ debugapi/build \ - javalauncher/build + javalauncher/build \ + javaupgradeapp/build NONQTSUBSYSTEMS = \ - javasidchecker/build \ javarecognizer/build \ javaappschemeplugin/build SYMBIAN_ONLY = \ javaregistry \ javalauncher/build \ + javaupgradeapp/build \ javabackup \ - javasidchecker/build \ javarecognizer/build \ preinstaller/build \ debugapi/build \ javaappschemeplugin/build +ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS +NONQTSUBSYSTEMS += javasidchecker/build +SYMBIAN_ONLY += javasidchecker/build javasidchecker/build : javaregistry +endif + +# Declare that release preparation removes subdirectories not in build, except +# listed special cases +REMOVE_NOTBUILT_EXCLUDING = inc include ${JAVA_SRC_ROOT}/build/Makefile.subsystem diff -r 0105bdca6f9c -r 3182bd6adebb javaruntimes/installer/starterdll/src/main.cpp --- a/javaruntimes/installer/starterdll/src/main.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javaruntimes/installer/starterdll/src/main.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -369,7 +369,12 @@ jvm->appendSystemProperty( L"-Dcom.nokia.mj.impl.rt.ui=" L"com.nokia.mj.impl.installer.ui.eswt2.InstallerRuntimeUi"); -#else +#ifdef __SYMBIAN32__ +#ifndef __WINS__ + jvm->appendSystemProperty(L"-Dcom.nokia.mj.impl.installer.ui.disableui=1"); +#endif //__WINS__ +#endif // __SYMBIAN32__ +#else // RD_JAVA_S60_RELEASE_10_1_ONWARDS jvm->appendSystemProperty( L"-Dcom.nokia.mj.impl.installer.ui=" L"com.nokia.mj.impl.installer.ui.eswt.InstallerUiEswt"); diff -r 0105bdca6f9c -r 3182bd6adebb javaruntimes/javaruntimes.pro --- a/javaruntimes/javaruntimes.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javaruntimes/javaruntimes.pro Tue Jul 13 16:05:52 2010 +0100 @@ -19,6 +19,6 @@ SUBDIRS += installer/starterdll/build/javainstallerstarter.pro SUBDIRS += installer/starterexe/build/javainstaller.pro SUBDIRS += jvmargmodifier/file/build/javajvmargsmodifierfile.pro -SUBDIRS += starter/build/java.pro +SUBDIRS += starter/build/javamidp.pro SUBDIRS += midp BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 0105bdca6f9c -r 3182bd6adebb javaruntimes/midp/runtime/build/javamidpruntime.pro --- a/javaruntimes/midp/runtime/build/javamidpruntime.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javaruntimes/midp/runtime/build/javamidpruntime.pro Tue Jul 13 16:05:52 2010 +0100 @@ -23,7 +23,7 @@ symbian { - INCLUDEPATH += /epoc32/include/ecom + INCLUDEPATH += /epoc32/include/ecom # Due to schemehandler.inl in S60 5.0 2009w18 and SPB 10.1 LIBS += -lecom -lflogger -lDrmRightsInfo -lcaf -lDrmHelper -lapgrfx -lapparc -ljavautils } diff -r 0105bdca6f9c -r 3182bd6adebb javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/Main.java --- a/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/Main.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/Main.java Tue Jul 13 16:05:52 2010 +0100 @@ -38,12 +38,14 @@ { // Do the start up trace. StartUpTrace.doTrace("Midp runtime ready"); - if (Log.mOn) Log.logI("Starting MIDP runtime"); - - System.out.println("java.version: " + - System.getProperty("java.version")); - System.out.println("java.fullversion: " + - System.getProperty("java.fullversion")); + if (Log.mOn) + { + Log.logI("Starting MIDP runtime"); + Log.logI("java.version: " + + System.getProperty("java.version")); + Log.logI("java.fullversion: " + + System.getProperty("java.fullversion")); + } boolean ok = true; try diff -r 0105bdca6f9c -r 3182bd6adebb javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/MidletLifeCycle.java --- a/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/MidletLifeCycle.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/MidletLifeCycle.java Tue Jul 13 16:05:52 2010 +0100 @@ -27,6 +27,8 @@ import java.security.AccessControlException; +import com.nokia.mj.impl.gcf.PushSecurityUtils; + import com.nokia.mj.impl.rt.utils.ExtensionUtil; import com.nokia.mj.impl.rt.utils.CmdLineArgsPermission; @@ -992,16 +994,35 @@ DrmUtil.consumeRightsStart(); } - // If the MIDlet launch is a result of auto invocation we need to + // If the MIDlet launch is a result of push auto invocation we need to // ensure that user allows the start up. - if ((mMainArgs.findArgument("-autoinvocation") != null) || - mAutoinvocationFromUrl) + if (mMainArgs.findArgument("-autoinvocation") != null) { - if (Log.mOn) Log.logI("Ensuring autoinvocation."); + if (Log.mOn) Log.logI("Ensuring push autoinvocation."); String pushAdditionalInfo = mMainArgs.findArgument("-autoInvocationAdditional"); if (Log.mOn) Log.logI(" addInfo: '" + pushAdditionalInfo + "'"); + try + { + PushSecurityUtils.ensurePermission("autoinvocation", + pushAdditionalInfo); + }catch(SecurityException e) + { + // The user didn't allow starting. Throw StartupException and + // mark it as non fatal. + if (Log.mOn) Log.logI("Push autoinvocation NOT allowed."); + throw new StartupException(e.toString(), + false); + } + } + + // If the MIDlet launch is triggered from url we need to + // ensure that user allows the start up. + if (mAutoinvocationFromUrl) + { + if (Log.mOn) Log.logI("Ensuring web start invocation."); + // ensure security try { @@ -1009,10 +1030,10 @@ CmdLineArgsPermission cmdLineArgsPermission = new CmdLineArgsPermission(); appUtils.checkPermission(cmdLineArgsPermission); - if (Log.mOn) Log.logI("Autoinvocation allowed."); + if (Log.mOn) Log.logI("Web start invocation allowed."); }catch(AccessControlException e) { - if (Log.mOn) Log.logI("Autoinvocation NOT allowed."); + if (Log.mOn) Log.logI("Web start invocation NOT allowed."); throw new StartupException(e.toString(), false); } diff -r 0105bdca6f9c -r 3182bd6adebb javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java --- a/javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java Tue Jul 13 16:05:52 2010 +0100 @@ -31,6 +31,7 @@ import com.nokia.mj.impl.security.midp.authorization.AccessControllerImpl; import com.nokia.mj.impl.security.utils.SecurityPromptMessage; +import com.nokia.mj.impl.utils.Id; import com.nokia.mj.impl.utils.Logger; /** @@ -282,7 +283,7 @@ } - private boolean showNote(String aAppName,String aConfirmationQueryId) + private boolean showNote(String aAppName, Id aConfirmationQueryId) { SecurityPromptMessage msg = SecurityPromptMessage.getInstance(); String queryTxt = msg.getText(aConfirmationQueryId,null); diff -r 0105bdca6f9c -r 3182bd6adebb javaruntimes/starter/build/java.pro --- a/javaruntimes/starter/build/java.pro Wed Jun 30 15:21:28 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +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=javamidp -CONFIG += omj no_icon stl -CONFIG -= qt - -include(../../../inc/build_defines.pri) - -symbian { - -contains(PROJECT_DEFINES,RD_JAVA_UI_QT) { - TARGET.EPOCSTACKSIZE = 81920 -} - -!contains(PROJECT_DEFINES,RD_JAVA_UI_QT) { - TARGET.EPOCSTACKSIZE = 16384 -} - - TARGET.EPOCHEAPSIZE = 0x00001000 0x02000000 - - TARGET.UID2 = 0x102033E6 - TARGET.UID3 = 0x102033E6 - - TARGET.SID = 0x102033E6 - TARGET.VID = 0x101FB657 - - TARGET.CAPABILITY = \ - LocalServices NetworkServices ProtServ WriteDeviceData \ - ReadDeviceData ReadUserData WriteUserData UserEnvironment \ - SwEvent Location MultiMediaDD NetworkControl TrustedUI -} - -include(../../../build/omj.pri) diff -r 0105bdca6f9c -r 3182bd6adebb javaruntimes/starter/build/javamidp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaruntimes/starter/build/javamidp.pro Tue Jul 13 16:05:52 2010 +0100 @@ -0,0 +1,48 @@ +# +# 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=javamidp +CONFIG += omj no_icon stl +CONFIG -= qt + +include(../../../inc/build_defines.pri) + +symbian { + +contains(PROJECT_DEFINES,RD_JAVA_UI_QT) { + TARGET.EPOCSTACKSIZE = 81920 +} + +!contains(PROJECT_DEFINES,RD_JAVA_UI_QT) { + TARGET.EPOCSTACKSIZE = 16384 +} + + TARGET.EPOCHEAPSIZE = 0x00001000 0x02000000 + + TARGET.UID2 = 0x102033E6 + TARGET.UID3 = 0x102033E6 + + TARGET.SID = 0x102033E6 + TARGET.VID = 0x101FB657 + + TARGET.CAPABILITY = \ + LocalServices NetworkServices ProtServ WriteDeviceData \ + ReadDeviceData ReadUserData WriteUserData UserEnvironment \ + SwEvent Location MultiMediaDD NetworkControl TrustedUI +} + +include(../../../build/omj.pri) diff -r 0105bdca6f9c -r 3182bd6adebb javatools/javacontrolpanel/controlpanel/src/javacaptain.cpp --- a/javatools/javacontrolpanel/controlpanel/src/javacaptain.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javatools/javacontrolpanel/controlpanel/src/javacaptain.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -24,6 +24,7 @@ #include #endif +#include #include #include "logger.h" diff -r 0105bdca6f9c -r 3182bd6adebb javatools/javasecuritycustomization/policyeditor/bin/securitypolicyeditor.jar Binary file javatools/javasecuritycustomization/policyeditor/bin/securitypolicyeditor.jar has changed diff -r 0105bdca6f9c -r 3182bd6adebb javatools/javasecuritycustomization/policyeditor/javasrc/com/nokia/mj/tools/security/midp/PolicyEditor.java --- a/javatools/javasecuritycustomization/policyeditor/javasrc/com/nokia/mj/tools/security/midp/PolicyEditor.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javatools/javasecuritycustomization/policyeditor/javasrc/com/nokia/mj/tools/security/midp/PolicyEditor.java Tue Jul 13 16:05:52 2010 +0100 @@ -18,6 +18,7 @@ package com.nokia.mj.tools.security.midp; import java.util.Vector; +import java.util.Hashtable; import java.io.IOException; import java.io.FileInputStream; import java.util.StringTokenizer; @@ -46,7 +47,7 @@ * domain: 'domain' Identifier ';' grant+; * grant: 'grant' (grant_user | grant_allowed | grant_assigned); * grant_allowed: 'allowed' permissions; - * grant_assigned: 'assigned' permissions; + * grant_assigned: 'assigned' grant_name? (initial_mode other_modes permissions)? permissions; * grant_user: 'user' grant_name initial_mode other_modes permissions; * grant_name: '"' Identifier '"'; * permissions: '{' permission+ '}'; @@ -70,6 +71,7 @@ private SecurityPolicy securityPolicy; private static String destPath; private static final String POLICY_FILE_EXTENSION = ".txt"; + private Hashtable allSettings = new Hashtable(); public static void main(String[] args) { @@ -159,14 +161,17 @@ } domain = extractToken(';'); Vector perms = new Vector(); + Vector unconfirmedPerms = new Vector(); find("grant"); while (offset < policy.length) { SecurityPolicyPermissionSettings settings = null; + SecurityPolicyPermissionSettings unconfirmedSettings = null; int type = getType(extractToken()); + String settingsName = null; if (type == PolicyBasedPermission.USER_TYPE) { - String settingsName = extractToken('"', '"'); + settingsName = extractToken('"', '"'); check(settingsName, "User grant group without name"); // trim off the leading and trailing double-quotes if (settingsName.startsWith("\"")) @@ -192,6 +197,44 @@ interactionModes); settings = new SecurityPolicyPermissionSettings(settingsName, currentInteractionMode, allowedInteractionModes); + allSettings.put(settingsName, settings); + } + else if (type == PolicyBasedPermission.ASSIGNED_TYPE) + { + settingsName = extractToken('"', '"'); + if (settingsName != null + && settingsName.length() > 0 + && settingsName.indexOf("{") == -1) + { + type = PolicyBasedPermission.USER_ASSIGNED_TYPE; + settings = (SecurityPolicyPermissionSettings)allSettings.get( + settingsName); + if (settings == null) + { + // parse the rest of the settings and store it as + // unconfirmed settings: after all the parsing is + // done go through the unconfirmed settings and + // replace them with settings from user permissions + // (if found) or use the unconfirmed settings if no + // other user settings were found + String strInteractionModes = extractToken('{'); + String[] interactionModes = split(strInteractionModes,","); + if (interactionModes != null && interactionModes.length > 0) + { + int currentInteractionMode = getInteractionMode( + interactionModes[0]); + int[] allowedInteractionModes = getInteractionModes( + interactionModes); + unconfirmedSettings = new SecurityPolicyPermissionSettings( + settingsName, currentInteractionMode, allowedInteractionModes); + } + else + { + unconfirmedSettings = new SecurityPolicyPermissionSettings( + settingsName); + } + } + } } find("permission"); while (offset < policy.length && policy[offset] != '}') @@ -246,28 +289,75 @@ // return multiple permissions with simple actions. This step is // to be removed when APIs support composite actions String[] actions = split(pActionList,","); + if (unconfirmedSettings != null + && unconfirmedSettings.getCurrentInteractionMode() + == UserSecuritySettings.UNDEFINED_INTERACTION_MODE) + { + // discard the settings since they are not vald + unconfirmedSettings = null; + } if (actions != null) { for (int i=0; i + // if found then use those settings, otherwise use the unconfirmed settings + for(int i=0; iGetArrayLength(aArgs); char** installerArgs = new char*[args]; diff -r 0105bdca6f9c -r 3182bd6adebb javauis/amms_qt/build/javaamms.pro --- a/javauis/amms_qt/build/javaamms.pro Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/amms_qt/build/javaamms.pro Tue Jul 13 16:05:52 2010 +0100 @@ -25,9 +25,7 @@ DEFINES += __JAVA_JSR234_TUNER -INCLUDEPATH += /epoc32/include/mmf/common \ - /epoc32/include/caf \ - ../ammscontrol/inc \ +INCLUDEPATH += ../ammscontrol/inc \ ../ammscontrol/audio3D/inc \ ../ammscontrol/audioeffect/inc \ ../mmacontrol/inc \ @@ -36,8 +34,7 @@ ../src_tuner/native/inc \ ../ammscontrol/inc \ ../../mmapi_qt/baseline/inc \ - ../../mmapi_qt/utils/inc \ - /epoc32/include/mw/Qt + ../../mmapi_qt/utils/inc SOURCES += ../ammscontrol/src/*.cpp \ diff -r 0105bdca6f9c -r 3182bd6adebb javauis/amms_qt/mmacontrol/inc.emc/cammspancontrol.h --- a/javauis/amms_qt/mmacontrol/inc.emc/cammspancontrol.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/amms_qt/mmacontrol/inc.emc/cammspancontrol.h Tue Jul 13 16:05:52 2010 +0100 @@ -21,7 +21,7 @@ // INCLUDES #include -#include +#include #include #include "cammscontrol.h" diff -r 0105bdca6f9c -r 3182bd6adebb javauis/amms_qt/mmacontrol/inc.mmf/cammspancontrol.h --- a/javauis/amms_qt/mmacontrol/inc.mmf/cammspancontrol.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/amms_qt/mmacontrol/inc.mmf/cammspancontrol.h Tue Jul 13 16:05:52 2010 +0100 @@ -21,8 +21,8 @@ // INCLUDES #include -#include -#include +#include +#include #include "CAMMSControl.h" // CONSTANTS diff -r 0105bdca6f9c -r 3182bd6adebb javauis/amms_qt/mmacontrol/inc/cammscustomcommandutility.h --- a/javauis/amms_qt/mmacontrol/inc/cammscustomcommandutility.h Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/amms_qt/mmacontrol/inc/cammscustomcommandutility.h Tue Jul 13 16:05:52 2010 +0100 @@ -22,7 +22,7 @@ // INCLUDES #include #include -#include +#include // CLASS DECLARATION diff -r 0105bdca6f9c -r 3182bd6adebb javauis/amms_qt/mmacontrol/src.emc/cammsprioritycontrol.cpp --- a/javauis/amms_qt/mmacontrol/src.emc/cammsprioritycontrol.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/amms_qt/mmacontrol/src.emc/cammsprioritycontrol.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include diff -r 0105bdca6f9c -r 3182bd6adebb javauis/amms_qt/mmacontrol/src.mmf/cammsprioritycontrol.cpp --- a/javauis/amms_qt/mmacontrol/src.mmf/cammsprioritycontrol.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/amms_qt/mmacontrol/src.mmf/cammsprioritycontrol.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -24,7 +24,7 @@ #include "CAMMSPriorityControl.h" #include #include -#include +#include #include diff -r 0105bdca6f9c -r 3182bd6adebb javauis/amms_qt/mmacontrol/src/cammsaudiooutputcontrol.cpp --- a/javauis/amms_qt/mmacontrol/src/cammsaudiooutputcontrol.cpp Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/amms_qt/mmacontrol/src/cammsaudiooutputcontrol.cpp Tue Jul 13 16:05:52 2010 +0100 @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff -r 0105bdca6f9c -r 3182bd6adebb javauis/eswt_qt/build/eswtqtwebkit/build.xml --- a/javauis/eswt_qt/build/eswtqtwebkit/build.xml Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/eswt_qt/build/eswtqtwebkit/build.xml Tue Jul 13 16:05:52 2010 +0100 @@ -26,7 +26,7 @@ - + diff -r 0105bdca6f9c -r 3182bd6adebb javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/MobileShellExtension.java --- /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 Tue Jul 13 16:05:52 2010 +0100 @@ -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); + } +} diff -r 0105bdca6f9c -r 3182bd6adebb javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/OS.java --- a/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/OS.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/eswt_qt/com.nokia.swt.extensions/extensions/org/eclipse/swt/internal/extension/OS.java Tue Jul 13 16:05:52 2010 +0100 @@ -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(); } diff -r 0105bdca6f9c -r 3182bd6adebb javauis/eswt_qt/eswtuitestutils/javasrc/com/nokia/mj/impl/uitestutils/S60Utils.java --- a/javauis/eswt_qt/eswtuitestutils/javasrc/com/nokia/mj/impl/uitestutils/S60Utils.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/eswt_qt/eswtuitestutils/javasrc/com/nokia/mj/impl/uitestutils/S60Utils.java Tue Jul 13 16:05:52 2010 +0100 @@ -6,7 +6,7 @@ static { // Should use vmport, this is CDC/J2SE API //System.loadLibrary("s60uitestutils"); - org.eclipse.swt.internal.Library.loadLibrary("s60uitestutils"); + org.eclipse.swt.internal.Library.loadLibrary("eswtuitestutils"); } /** diff -r 0105bdca6f9c -r 3182bd6adebb javauis/eswt_qt/org.eclipse.swt.qt.linux.x86.me/build.xml --- a/javauis/eswt_qt/org.eclipse.swt.qt.linux.x86.me/build.xml Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/eswt_qt/org.eclipse.swt.qt.linux.x86.me/build.xml Tue Jul 13 16:05:52 2010 +0100 @@ -263,7 +263,7 @@ - + diff -r 0105bdca6f9c -r 3182bd6adebb javauis/eswt_qt/org.eclipse.swt.qt.linux.x86.se/build.xml --- a/javauis/eswt_qt/org.eclipse.swt.qt.linux.x86.se/build.xml Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/eswt_qt/org.eclipse.swt.qt.linux.x86.se/build.xml Tue Jul 13 16:05:52 2010 +0100 @@ -244,7 +244,7 @@ - + diff -r 0105bdca6f9c -r 3182bd6adebb javauis/eswt_qt/org.eclipse.swt/Eclipse SWT Browser/qt/org/eclipse/swt/browser/QtWebKit.java --- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT Browser/qt/org/eclipse/swt/browser/QtWebKit.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT Browser/qt/org/eclipse/swt/browser/QtWebKit.java Tue Jul 13 16:05:52 2010 +0100 @@ -12,7 +12,7 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.internal.qt.OS; -import org.eclipse.swt.internal.qt.webkit.OS_webkit; +import org.eclipse.swt.internal.qt.webkit.WebkitOS; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; @@ -39,7 +39,7 @@ // At this point, browser.handle is the view port of QScrollArea, set by Composite int scrollAreaHandle = Internal_PackageSupport.topHandle(browser); int viewPortHandle = Internal_PackageSupport.handle(browser); - webViewHandle = OS_webkit.QWebView_new(); + webViewHandle = WebkitOS.QWebView_new(); OS.QWidget_setParent(webViewHandle, scrollAreaHandle); int layout = OS.QVBoxLayout_new(0); @@ -111,10 +111,10 @@ * @see WebBrowser */ public boolean back() { - if (OS_webkit.QWebView_swt_canGoBack(webViewHandle)) { + if (WebkitOS.QWebView_swt_canGoBack(webViewHandle)) { if (sendLocationEventChanging((int)System.currentTimeMillis(), - OS_webkit.QWebView_swt_backUrl(webViewHandle))) { - OS_webkit.QWebView_back(webViewHandle); + WebkitOS.QWebView_swt_backUrl(webViewHandle))) { + WebkitOS.QWebView_back(webViewHandle); return true; } } @@ -125,17 +125,17 @@ * @see WebBrowser */ public boolean execute(String script) { - return OS_webkit.QWebView_swt_evaluateJavaScript(webViewHandle, script); + return WebkitOS.QWebView_swt_evaluateJavaScript(webViewHandle, script); } /** * @see WebBrowser */ public boolean forward() { - if (OS_webkit.QWebView_swt_canGoForward(webViewHandle)) { + if (WebkitOS.QWebView_swt_canGoForward(webViewHandle)) { if (sendLocationEventChanging((int)System.currentTimeMillis(), - OS_webkit.QWebView_swt_forwardUrl(webViewHandle))) { - OS_webkit.QWebView_forward(webViewHandle); + WebkitOS.QWebView_swt_forwardUrl(webViewHandle))) { + WebkitOS.QWebView_forward(webViewHandle); return true; } } @@ -160,21 +160,21 @@ * @see WebBrowser */ public String getUrl() { - return OS_webkit.QWebView_url(webViewHandle); + return WebkitOS.QWebView_url(webViewHandle); } /** * @see WebBrowser */ public boolean isBackEnabled() { - return OS_webkit.QWebView_swt_canGoBack(webViewHandle); + return WebkitOS.QWebView_swt_canGoBack(webViewHandle); } /** * @see WebBrowser */ public boolean isForwardEnabled() { - return OS_webkit.QWebView_swt_canGoForward(webViewHandle); + return WebkitOS.QWebView_swt_canGoForward(webViewHandle); } /** @@ -182,8 +182,8 @@ */ public void refresh() { if (sendLocationEventChanging((int)System.currentTimeMillis(), - OS_webkit.QWebView_url(webViewHandle))) { - OS_webkit.QWebView_reload(webViewHandle); + WebkitOS.QWebView_url(webViewHandle))) { + WebkitOS.QWebView_reload(webViewHandle); } } @@ -192,7 +192,7 @@ */ public boolean setText(String html) { if (sendLocationEventChanging((int)System.currentTimeMillis(), "about:blank")) { - OS_webkit.QWebView_setHtml(webViewHandle, html); + WebkitOS.QWebView_setHtml(webViewHandle, html); return true; } else { @@ -205,7 +205,7 @@ */ public boolean setUrl(String url) { if (sendLocationEventChanging((int)System.currentTimeMillis(), url)) { - OS_webkit.QWebView_setUrl(webViewHandle, url); + WebkitOS.QWebView_setUrl(webViewHandle, url); return true; } else { @@ -217,7 +217,7 @@ * @see WebBrowser */ public void stop() { - OS_webkit.QWebView_stop(webViewHandle); + WebkitOS.QWebView_stop(webViewHandle); } final boolean eventProcess( int widgetHandle, int eventType, int time, diff -r 0105bdca6f9c -r 3182bd6adebb javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/MobileDevice.java --- a/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/MobileDevice.java Wed Jun 30 15:21:28 2010 +0100 +++ b/javauis/eswt_qt/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/ercp/swt/mobile/MobileDevice.java Tue Jul 13 16:05:52 2010 +0100 @@ -44,521 +44,524 @@ */ public class MobileDevice { - private static int handleMobileDevice; - private Vector mobileDeviceListeners; - private Screen[] screens; - private Input[] inputs; - private int alertLevel; - private boolean isOpen; - private static int desktopWidgetHandle; + private static int handleMobileDevice; + private Vector mobileDeviceListeners; + private Screen[] screens; + private Input[] inputs; + private int alertLevel; + private boolean isOpen; + private static int desktopWidgetHandle; static MobileDevice currentMobileDevice; - private int activeScreenId; + private int activeScreenId; /** * feature which is permanently attached to the mobile device and always available - */ + */ public static final int LOCAL = 0; - /** - * local feature which is only available when mobile device is opened - */ - public static final int INTERNAL = 1; + /** + * local feature which is only available when mobile device is opened + */ + public static final int INTERNAL = 1; - /** - * local feature which is only available when mobile device is closed - */ - public static final int EXTERNAL = 2; - - /** - * feature which is not part of the mobile device unless connected via wire or wireless signal - */ - public static final int REMOTE = 3; - - /** - * alert level indicating simple notification (ex. e-mail arrival) - */ - public static final int ALERT_LOW_IMPORTANCE = 1; - - /** - * alert level indicating user attention desired (ex. instant message arrival) - */ - public static final int ALERT_HIGH_IMPORTANCE = 2; - - /** - * alert level indicating immediate attention is required (ex. battery level at 1%) - */ - public static final int ALERT_CRITICAL = 3; + /** + * local feature which is only available when mobile device is closed + */ + public static final int EXTERNAL = 2; + + /** + * feature which is not part of the mobile device unless connected via wire or wireless signal + */ + public static final int REMOTE = 3; + + /** + * alert level indicating simple notification (ex. e-mail arrival) + */ + public static final int ALERT_LOW_IMPORTANCE = 1; + + /** + * alert level indicating user attention desired (ex. instant message arrival) + */ + public static final int ALERT_HIGH_IMPORTANCE = 2; + + /** + * alert level indicating immediate attention is required (ex. battery level at 1%) + */ + public static final int ALERT_CRITICAL = 3; /** * virtual keyboard status indicating normal show and hide operation */ - public static final int VK_NORMAL = 1; + public static final int VK_NORMAL = 1; - /** - * virtual keyboard status indicating keyboard is always visible - */ - public static final int VK_ALWAYS_ON = 2; + /** + * virtual keyboard status indicating keyboard is always visible + */ + public static final int VK_ALWAYS_ON = 2; - /** - * virtual keyboard status indicating keyboard is always hidden - */ - public static final int VK_ALWAYS_OFF = 3; - - /** - * Constructs a new instance of this class. Non-public to prevent - * instantiation outside this package. - * - */ - MobileDevice () { - - (getDisplay()).syncExec(new Runnable() { - public void run() { - handleMobileDevice = Internal_PackageSupport.initializeMobileDevice( - Internal_PackageSupport.getDisplayInstance()); - OS.MobileDevice_createFlipWatch(handleMobileDevice); - } - }); - mobileDeviceListeners = new Vector(); - isOpen = true; - } - - private static Display getDisplay(){ - Display display = Internal_PackageSupport.getDisplayInstance(); - - // Following if-statement (getting default display) should be removed - // if agreed that MobileDevice shouldn't create the display. - if(display==null){ - display = Display.getDefault(); - } - - if(display == null || display.isDisposed()){ - SWT.error(SWT.ERROR_DEVICE_DISPOSED); - } - return display; - } - - private void sendMobileDeviceChangedEvent(int eventType) { - // MobileDevice changed event for open and closed - int count = mobileDeviceListeners.size(); - for (int i = 0; i 0 && activeScreenId aCount){ - // screen removed - int screenHandle = 0; - for(int j=0; j