# HG changeset patch # User Dario Sestito # Date 1287753836 -3600 # Node ID 0553e2305d00eef81ec780f694f43a3842c98258 # Parent 26b2b12093af2c02eeacd473d25345bbf63bf381# Parent 461e71b327da27318f868bc9686b5db2460b93f3 Remerge changes for bug 2896 and tweak for generatej9zips.py diff -r 461e71b327da -r 0553e2305d00 bld.inf --- a/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/bld.inf Fri Oct 22 14:23:56 2010 +0100 @@ -18,11 +18,11 @@ PRJ_PLATFORMS default -#include "build/bld.inf" -#include "jrt_plat/group/bld.inf" #include "javacommons/bld.inf" #include "javaruntimes/bld.inf" #include "javauis/bld.inf" #include "javamanager/bld.inf" #include "javatools/bld.inf" -#include "javaextensions/bld.inf" +#include "javaextensions/bld.inf" +#include "build/bld.inf" +#include "jrt_plat/group/bld.inf" diff -r 461e71b327da -r 0553e2305d00 build/Makefile.comp --- a/build/Makefile.comp Fri Sep 17 17:50:17 2010 +0100 +++ b/build/Makefile.comp Fri Oct 22 14:23:56 2010 +0100 @@ -151,11 +151,11 @@ echo #include "exports.inf" >> bld.inf endif -# Quick java releasables target -RELEASABLE_PATH = $(EPOCROOT)epoc32/release/$(PLATFORM)/$(CFG)/z/resource/java/jvm/lib/jrt javareleasables: ifneq ($(ANT_FILE),) - echo $(RELEASABLE_PATH)/$(BASENAME).odc + $(ANT) -q -Dtarget.platform=$(PLATFORM) -Dtarget.cfg=$(VARIANT) $(ANT_PROJECT_DEFINES) releasables > $(DEVNULL) + $(call CATCOMMAND,java_releasables_$(PLATFORM)_$(VARIANT).tmp) + $(call RMFILE,java_releasables_$(PLATFORM)_$(VARIANT).tmp) endif # Remove all generated build files @@ -185,11 +185,11 @@ build_native: $(PHASEINFO) - $(SBS) -c $(PLATFORM)_$(CFG) + $(SBS) -c $(PLATFORM)_$(CFG) BUILD -fastbuild: java +fastbuild: export java $(PHASEINFO) - $(SBS) -c $(PLATFORM)_$(CFG) + $(SBS) -c $(PLATFORM)_$(CFG) TARGET build_clean_native: $(PHASEINFO) diff -r 461e71b327da -r 0553e2305d00 build/Makefile.defs --- a/build/Makefile.defs Fri Sep 17 17:50:17 2010 +0100 +++ b/build/Makefile.defs Fri Oct 22 14:23:56 2010 +0100 @@ -262,9 +262,10 @@ endif generatereleasefile: +ifeq ($(origin RD_JAVA_S60_RELEASE),command line) @echo Writing $(RD_JAVA_S60_RELEASE_FILE) ... \ - $(shell $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/generated_header_hash.txt) > $(RD_JAVA_S60_RELEASE_FILE)) \ $(shell echo RD_JAVA_S60_RELEASE=$(RD_JAVA_S60_RELEASE)>$(RD_JAVA_S60_RELEASE_FILE)) +endif # Clean file on clean_generated clean_configure: clean_conffiles diff -r 461e71b327da -r 0553e2305d00 build/Makefile.project --- a/build/Makefile.project Fri Sep 17 17:50:17 2010 +0100 +++ b/build/Makefile.project Fri Oct 22 14:23:56 2010 +0100 @@ -174,6 +174,13 @@ 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 461e71b327da -r 0553e2305d00 build/Makefile.subsystem --- a/build/Makefile.subsystem Fri Sep 17 17:50:17 2010 +0100 +++ b/build/Makefile.subsystem Fri Oct 22 14:23:56 2010 +0100 @@ -211,7 +211,7 @@ $(SBS) -c $(PLATFORM)_$(CFG) fastbuild: export java - $(SBS) -c $(PLATFORM)_$(CFG) + $(SBS) -c $(PLATFORM)_$(CFG) TARGET clean_native: $(PHASEINFO) diff -r 461e71b327da -r 0553e2305d00 build/bld.inf --- a/build/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/build/bld.inf Fri Oct 22 14:23:56 2010 +0100 @@ -42,15 +42,11 @@ ../rom/tckrunnerodclist30 /epoc32/release/winscw/urel/z/resource/java/tckrunnerodclist ../rom/tckrunnerodclist30 /epoc32/data/z/resource/java/tckrunnerodclist -../rom/javacontrolpanelodclist30 /epoc32/release/winscw/udeb/z/resource/java/javacontrolpanelodclist -../rom/javacontrolpanelodclist30 /epoc32/release/winscw/urel/z/resource/java/javacontrolpanelodclist -../rom/javacontrolpanelodclist30 /epoc32/data/z/resource/java/javacontrolpanelodclist - ../rom/javalocalization_3_1.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(javalocalization.iby) #else // RD_JAVA_UI_QT -../rom/java_2_2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) +../rom/java_2_1.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) // Export ODC list files ../rom/midpodclist /epoc32/release/winscw/udeb/z/resource/java/midpodclist @@ -65,10 +61,6 @@ ../rom/tckrunnerodclist /epoc32/release/winscw/urel/z/resource/java/tckrunnerodclist ../rom/tckrunnerodclist /epoc32/data/z/resource/java/tckrunnerodclist -../rom/javacontrolpanelodclist /epoc32/release/winscw/udeb/z/resource/java/javacontrolpanelodclist -../rom/javacontrolpanelodclist /epoc32/release/winscw/urel/z/resource/java/javacontrolpanelodclist -../rom/javacontrolpanelodclist /epoc32/data/z/resource/java/javacontrolpanelodclist - ../rom/javalocalization_2_1.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(javalocalization.iby) #endif // RD_JAVA_UI_QT diff -r 461e71b327da -r 0553e2305d00 build/buildutils/checkfilenames.py --- a/build/buildutils/checkfilenames.py Fri Sep 17 17:50:17 2010 +0100 +++ b/build/buildutils/checkfilenames.py Fri Oct 22 14:23:56 2010 +0100 @@ -64,7 +64,6 @@ # Other peculiar filenames: "installerodclist", "installerodclist30", "midpodclist", "midpodclist30", "notice", "package-list", "tckrunnerodclist", "tckrunnerodclist30", "unknowncert","midprootslist", - "javacontrolpanelodclist", "javacontrolpanelodclist30", ] # Command line options. diff -r 461e71b327da -r 0553e2305d00 build/buildutils/checkjavapackages.py --- a/build/buildutils/checkjavapackages.py Fri Sep 17 17:50:17 2010 +0100 +++ b/build/buildutils/checkjavapackages.py Fri Oct 22 14:23:56 2010 +0100 @@ -16,17 +16,13 @@ # Checks that all the java source files declare a package and that # the directory within a java source file is located corresponds # properly to the package. -# -# Ignores tsrc directories unless the option -all is given. import sys, os, re def main(): - root = sys.argv[1] - all = len(sys.argv) > 2 and sys.argv[2] == '-all' - + files = [] # Create a reg exp matching to "package x.y.z;" with whitespace ignored regex = re.compile("\\s*package\\s*([\\w.]*);.*", re.IGNORECASE) @@ -35,12 +31,8 @@ # Skip SVN directories if dirname.find("\\.svn") != -1: - return + return names - # Skip tsrc - if not all and dirname.find("\\tsrc") != -1: - return - for f in names: if not f.endswith(".java"): continue @@ -71,7 +63,7 @@ except IOError: print "Error reading the file " + fname - os.path.walk(sys.argv[1], visitFun, None) + os.path.walk(sys.argv[1], visitFun, files) if __name__ == "__main__": diff -r 461e71b327da -r 0553e2305d00 build/buildutils/checkwarnings.py diff -r 461e71b327da -r 0553e2305d00 build/buildutils/distribution.policy.s60.configuration.txt diff -r 461e71b327da -r 0553e2305d00 build/buildutils/svnchangeids.py --- a/build/buildutils/svnchangeids.py Fri Sep 17 17:50:17 2010 +0100 +++ b/build/buildutils/svnchangeids.py Fri Oct 22 14:23:56 2010 +0100 @@ -59,7 +59,6 @@ re_change_id = re.compile("(\w+\#\d+)\s*,?", re.I | re.M) re_change_id_keyword = re.compile(change_id_keyword + "[:=]?\s*(\w+\#\d+)", re.I | re.M) - re_change_id_keyword_only = re.compile(change_id_keyword, re.I | re.M) svn_change_ids = {} cmd = "svn log -r " + rev_2 + ":" + rev_1 + " " + url #print cmd @@ -68,11 +67,6 @@ if rev: current_rev = rev[0] change_ids = re_change_id_keyword.findall(line) - change_id_keywords = re_change_id_keyword_only.findall(line) - if len(change_id_keywords) > len(change_ids): - print "WARNING: Rev " + current_rev + \ - " has more matching changeid keywords" + \ - " than matching change ids." while change_ids: for change_id in change_ids: if change_id in svn_change_ids: diff -r 461e71b327da -r 0553e2305d00 build/codescanner_high.xml --- a/build/codescanner_high.xml Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ - - - - - - - .*\.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 461e71b327da -r 0553e2305d00 build/exports.inf --- a/build/exports.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/build/exports.inf Fri Oct 22 14:23:56 2010 +0100 @@ -40,15 +40,11 @@ ../rom/tckrunnerodclist30 /epoc32/release/winscw/urel/z/resource/java/tckrunnerodclist ../rom/tckrunnerodclist30 /epoc32/data/z/resource/java/tckrunnerodclist -../rom/javacontrolpanelodclist30 /epoc32/release/winscw/udeb/z/resource/java/javacontrolpanelodclist -../rom/javacontrolpanelodclist30 /epoc32/release/winscw/urel/z/resource/java/javacontrolpanelodclist -../rom/javacontrolpanelodclist30 /epoc32/data/z/resource/java/javacontrolpanelodclist - ../rom/javalocalization_3_1.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(javalocalization.iby) #else // RD_JAVA_UI_QT -../rom/java_2_2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) +../rom/java_2_1.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) // Export ODC list files ../rom/midpodclist /epoc32/release/winscw/udeb/z/resource/java/midpodclist @@ -63,10 +59,6 @@ ../rom/tckrunnerodclist /epoc32/release/winscw/urel/z/resource/java/tckrunnerodclist ../rom/tckrunnerodclist /epoc32/data/z/resource/java/tckrunnerodclist -../rom/javacontrolpanelodclist /epoc32/release/winscw/udeb/z/resource/java/javacontrolpanelodclist -../rom/javacontrolpanelodclist /epoc32/release/winscw/urel/z/resource/java/javacontrolpanelodclist -../rom/javacontrolpanelodclist /epoc32/data/z/resource/java/javacontrolpanelodclist - ../rom/javalocalization_2_1.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(javalocalization.iby) #endif // RD_JAVA_UI_QT diff -r 461e71b327da -r 0553e2305d00 build/loc/resources_qt.jar Binary file build/loc/resources_qt.jar has changed diff -r 461e71b327da -r 0553e2305d00 build/makefile --- a/build/makefile Fri Sep 17 17:50:17 2010 +0100 +++ b/build/makefile Fri Oct 22 14:23:56 2010 +0100 @@ -61,9 +61,6 @@ javatools \ javaextensions -# Set order explicitly to get Java building as first -SUBTARGETS = $(COMPONENTS) $(NONQTSUBSYSTEMS) $(SUBSYSTEMS) - # ------------------------------------------------------- include ${JAVA_SRC_ROOT}/build/Makefile.subsystem diff -r 461e71b327da -r 0553e2305d00 build/makefile.javaversion --- a/build/makefile.javaversion Fri Sep 17 17:50:17 2010 +0100 +++ b/build/makefile.javaversion Fri Oct 22 14:23:56 2010 +0100 @@ -1,2 +1,6 @@ # Set Java version (must be dot separated, without spaces) -JAVA_VERSION = 2.2.11 +ifdef RD_JAVA_S60_RELEASE_5_0_IAD + JAVA_VERSION = 2.1.44 +else + JAVA_VERSION = 2.1.44 +endif diff -r 461e71b327da -r 0553e2305d00 build/nativejava.flm --- a/build/nativejava.flm Fri Sep 17 17:50:17 2010 +0100 +++ b/build/nativejava.flm Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +# 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" @@ -23,67 +23,23 @@ # therefore the jrt-directory is found from finding first directory having # subsystem.mk, going up to max. three directory levels) -JAVABUILDDIR:= $(dir $(firstword $(wildcard $(TO_BLDINF)/subsystem.mk $(TO_BLDINF)/../subsystem.mk $(TO_BLDINF)/../../subsystem.mk))) +JAVABUILDDIR = $(dir $(firstword $(wildcard $(TO_BLDINF)/subsystem.mk $(TO_BLDINF)/../subsystem.mk $(TO_BLDINF)/../../subsystem.mk))) -# General Java makefile command -JAVACMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ +JAVABUILDCMD = make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ PLATFORM=$(PLATFORM) CFG=$(CFG) BLD_INF_JAVA=1 -# General build command, targetting armv5 urel files -JAVABUILDCMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ - PLATFORM=armv5 CFG=urel BLD_INF_JAVA=1 java finalactions - -# Marker file to prevent multiple Java compilations of the -# same platform/cfg, when building e.g. device variants. -NATIVEJAVAMARKER := $(EPOCBLD)/nativejavamarker_$(PLATFORM)_$(CFG).done - -# Java build artifact file source and target -JAVABUILD_ARTIFACT_SRC := $(EPOCROOT)/epoc32/release/armv5/urel -JAVABUILD_ARTIFACT_DST := $(EPOCROOT)/epoc32/release/$(PLATFORM)/$(CFG) - -define compilenativejava - -# This is the general Java compilation, done once for the component -ifeq ($(GUARD_nativejavatarget),) -GUARD_nativejavatarget:=1 -.PHONY:: nativejavatarget -nativejavatarget: +define java_build +RESOURCE:: $(call startrule,compilenativejava,,javasources) \ - $(JAVABUILDCMD) \ + $(JAVABUILDCMD) java finalactions\ $(call endrule,compilenativejava) -endif - -# Actual resource target, one for each platform/cfg variant -ifeq ($(GUARD_$(call sanitise,$(NATIVEJAVAMARKER))),) -GUARD_$(call sanitise,$(NATIVEJAVAMARKER)):=1 - -RESOURCE:: $(NATIVEJAVAMARKER) - -# Copy the build artifacts to target -$(NATIVEJAVAMARKER): nativejavatarget -ifeq ($(filter armv5_urel ARMV5_urel ARMV5_UREL,$(PLATFORM)_$(CFG)),) - $(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/jvm/lib/jrt) - $(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/security) - $(call startrule,copynativejavaresults) \ - $(foreach f,java_impl_cdc.jar java_impl_cldc.jar java_platform_api.jar java_public_api.jar java_signature_test.jar, $(GNUCP) -v $(JAVABUILD_ARTIFACT_SRC)/$f $(JAVABUILD_ARTIFACT_DST) &&) \ - $(GNUCP) -Rv $(JAVABUILD_ARTIFACT_SRC)/z/resource/java/jvm/lib/jrt $(JAVABUILD_ARTIFACT_DST)/z/resource/java/jvm/lib && \ - $(GNUCP) -Rv $(JAVABUILD_ARTIFACT_SRC)/z/resource/java/security $(JAVABUILD_ARTIFACT_DST)/z/resource/java \ - $(call endrule,copynativejavaresults) -endif -endif - -# Use normal clean for all variants CLEAN:: $(call startrule,cleannativejava,,javasources) \ - $(JAVACMD) clean_java \ + $(JAVABUILDCMD) clean_java \ $(call endrule,cleannativejava) endef -$(eval $(compilenativejava)) +$(eval $(java_build)) -RELEASABLES:= $(shell $(JAVACMD) -s javareleasables) +RELEASABLES = $(shell $(JAVABUILDCMD) -s javareleasables) $(eval $(call whatmacro,$(RELEASABLES),WHATRESOURCES)) - -$(eval $(call GenerateStandardCleanTarget,$(NATIVEJAVAMARKER))) - - diff -r 461e71b327da -r 0553e2305d00 build/omj.pri --- a/build/omj.pri Fri Sep 17 17:50:17 2010 +0100 +++ b/build/omj.pri Fri Oct 22 14:23:56 2010 +0100 @@ -73,7 +73,7 @@ include(symbian_uids.pri) DEFINES += __SYMBIAN32__ - DEFINES += J9EPOC32 + DEFINES += J9EPOC32 RD_JAVA_OMJ_FSERVER LIBS += -llibpthread diff -r 461e71b327da -r 0553e2305d00 build/properties.xml --- a/build/properties.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/build/properties.xml Fri Oct 22 14:23:56 2010 +0100 @@ -41,23 +41,12 @@ for reason why this property is defined"/> --> - - - - - - - - - - - - - - + + + + + + @@ -71,6 +60,13 @@ + + + + + diff -r 461e71b327da -r 0553e2305d00 build/sis/incompatible_openc.txt --- a/build/sis/incompatible_openc.txt Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -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 461e71b327da -r 0553e2305d00 build/sis/incompatible_platform.txt --- a/build/sis/incompatible_platform.txt Fri Sep 17 17:50:17 2010 +0100 +++ b/build/sis/incompatible_platform.txt Fri Oct 22 14:23:56 2010 +0100 @@ -1,1 +1,1 @@ -Java Runtime is not compatible with your device. Java Runtime requires S60 5th Edition device. \ No newline at end of file +Unfortunately Java Runtime 2.0 Alpha is not compatible with your device. Java Runtime 2.0 Alpha works only on S60 5.0 devices. diff -r 461e71b327da -r 0553e2305d00 build/sis/java_2_0.pkg --- a/build/sis/java_2_0.pkg Fri Sep 17 17:50:17 2010 +0100 +++ b/build/sis/java_2_0.pkg Fri Oct 22 14:23:56 2010 +0100 @@ -43,17 +43,6 @@ ; 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 @@ -106,7 +95,6 @@ "\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" @@ -114,7 +102,6 @@ "\epoc32\data\z\resource\java\midpodclist"-"c:\resource\java\midpodclist" "\epoc32\data\z\resource\java\tckrunnerodclist"-"c:\resource\java\tckrunnerodclist" "\epoc32\data\z\resource\java\installerodclist"-"c:\resource\java\installerodclist" -"\epoc32\data\z\resource\java\javacontrolpanelodclist"-"c:\resource\java\javacontrolpanelodclist" @@ -391,7 +378,7 @@ "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javawmamms.odc"-"c:\resource\java\jvm\lib\jrt\javawmamms.odc" "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\tckrunner.odc"-"c:\resource\java\jvm\lib\jrt\tckrunner.odc" -"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javacontrolpanel.odc"-"c:\resource\java\jvm\lib\jrt\javacontrolpanel.odc" + ; Misc dlls @@ -488,7 +475,6 @@ "\epoc32\release\armv5\urel\jvmnativeport.dll"-"c:\sys\bin\jvmnativeport.dll" "\epoc32\release\armv5\urel\midp2backupplugin.dll"-"c:\sys\bin\midp2backupplugin.dll" "\epoc32\release\armv5\urel\javadebugapi.dll"-"c:\sys\bin\javadebugapi.dll" -"\epoc32\release\armv5\urel\javastarter.dll"-"c:\sys\bin\javastarter.dll" #ifdef RD_JAVA_S60_RELEASE_5_0_IAD "\epoc32\release\armv5\urel\midp2cenrep.dll"-"c:\sys\bin\midp2cenrep.dll" @@ -505,7 +491,6 @@ "\epoc32\release\armv5\urel\javacaptain_ext_pushregistryplugin.dll" -"c:\sys\bin\javacaptain_ext_pushregistryplugin.dll" "\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" diff -r 461e71b327da -r 0553e2305d00 build/sis/java_3_1.pkg --- a/build/sis/java_3_1.pkg Fri Sep 17 17:50:17 2010 +0100 +++ b/build/sis/java_3_1.pkg Fri Oct 22 14:23:56 2010 +0100 @@ -50,15 +50,12 @@ "\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\javaappscheme.exe"-"c:\sys\bin\javaappscheme.exe" -"\epoc32\release\armv5\urel\javaqtrequest.exe"-"c:\sys\bin\javaqtrequest.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" "\epoc32\data\z\resource\java\tckrunnerodclist"-"c:\resource\java\tckrunnerodclist" "\epoc32\data\z\resource\java\installerodclist"-"c:\resource\java\installerodclist" -"\epoc32\data\z\resource\java\javacontrolpanelodclist"-"c:\resource\java\javacontrolpanelodclist" + ; Dlls containing java byte code and their odc files "\epoc32\release\armv5\urel\javabluecove.dll"-"c:\sys\bin\javabluecove.dll" @@ -161,12 +158,13 @@ "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javawmamms.odc"-"c:\resource\java\jvm\lib\jrt\javawmamms.odc" "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\tckrunner.odc"-"c:\resource\java\jvm\lib\jrt\tckrunner.odc" -"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javacontrolpanel.odc"-"c:\resource\java\jvm\lib\jrt\javacontrolpanel.odc" ; Misc dlls +"\epoc32\release\armv5\urel\ifeui.dll"-"c:\sys\bin\ifeui.dll" +"\epoc32\release\armv5\urel\javaappschemeplugin.dll"-"c:\sys\bin\javaappschemeplugin.dll" "\epoc32\release\armv5\urel\javabtl2capscplugin.dll"-"c:\sys\bin\javabtl2capscplugin.dll" "\epoc32\release\armv5\urel\javabtsppscplugin.dll"-"c:\sys\bin\javabtsppscplugin.dll" "\epoc32\release\armv5\urel\javabtgoepscplugin.dll"-"c:\sys\bin\javabtgoepscplugin.dll" @@ -182,6 +180,7 @@ "\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" @@ -191,9 +190,7 @@ "\epoc32\release\armv5\urel\javadebugapi.dll"-"c:\sys\bin\javadebugapi.dll" #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK "\epoc32\release\armv5\urel\javasifplugin.dll"-"c:\sys\bin\javasifplugin.dll" -"\epoc32\release\armv5\urel\javainstallcopier.exe"-"c:\sys\bin\javainstallcopier.exe" #endif -"\epoc32\release\armv5\urel\javastarter.dll"-"c:\sys\bin\javastarter.dll" ; to enable JVM argument modifier - comment 1st line below and uncomment 2nd line below "\epoc32\release\armv5\urel\javajvmargsmodifier.dll"-"c:\sys\bin\javajvmargsmodifier.dll" @@ -206,7 +203,6 @@ "\epoc32\release\armv5\urel\javacaptain_ext_pushregistryplugin.dll" -"c:\sys\bin\javacaptain_ext_pushregistryplugin.dll" "\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" @@ -218,15 +214,17 @@ #endif ; resources +"\epoc32\data\z\resource\plugins\ifeui.rsc" -"c:\resource\plugins\ifeui.rsc" +"\epoc32\data\z\resource\plugins\javaappschemeplugin.rsc" -"c:\resource\plugins\javaappschemeplugin.rsc" "\epoc32\winscw\c\private\102033E6\installer\inst_plugins.cfg"-"c:\private\102033E6\installer\inst_plugins.cfg" "\epoc32\data\Z\Resource\versions\java.txt"-"c:\resource\versions\java.txt" "\epoc32\data\z\resource\java\java_app_92.mif"-"c:\resource\java\java_app.mif" "\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_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\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\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 @@ -320,16 +318,14 @@ ;"\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\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\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\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" @@ -337,20 +333,16 @@ ;"\epoc32\release\armv5\urel\javam3g.dll"-"c:\sys\bin\javam3g.dll" ;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javam3g.odc"-"c:\resource\java\jvm\lib\jrt\javam3g.odc" -"\epoc32\release\armv5\urel\javanokiasound.dll"-"c:\sys\bin\javanokiasound.dll" -"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javanokiasound.odc"-"c:\resource\java\jvm\lib\jrt\javanokiasound.odc" +;"\epoc32\release\armv5\urel\javanokiasound.dll"-"c:\sys\bin\javanokiasound.dll" +;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javanokiasound.odc"-"c:\resource\java\jvm\lib\jrt\javanokiasound.odc" ;"\epoc32\release\armv5\urel\javasoftnotification.dll"-"c:\sys\bin\javasoftnotification.dll" ;"\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" -"\epoc32\release\armv5\urel\javaapplicationsettingsview.dll"-"c:\sys\bin\javaapplicationsettingsview.dll" -"\epoc32\data\z\resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin"-"c:\resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin" diff -r 461e71b327da -r 0553e2305d00 build/sis/java_rnd_tools.pkg --- a/build/sis/java_rnd_tools.pkg Fri Sep 17 17:50:17 2010 +0100 +++ b/build/sis/java_rnd_tools.pkg Fri Oct 22 14:23:56 2010 +0100 @@ -31,6 +31,10 @@ ;to be installed on Series 60 v5.0 platforms [0x1028315F], 0, 0, 0, {"Series60ProductID"} +"\epoc32\release\armv5\urel\JavaCap.exe"-"c:\sys\bin\JavaCap.exe" +"\epoc32\data\z\private\10003a3f\apps\JavaCap_reg.rsc"-"c:\private\10003a3f\import\apps\JavaCap_reg.rsc" +"\epoc32\data\z\resource\apps\JavaCap.rsc" -"c:\resource\apps\JavaCap.rsc" + ;j9dmp23.dll is a J9 VM plugin that provides the thread dump utility. "\epoc32\release\armv5\urel\j9dmp23.dll"-"c:\sys\bin\j9dmp23.dll" ;javathreaddumper.dll provides the thread dump agent. @@ -42,8 +46,3 @@ ; javainstaller.exe is a command line tool for starting javainstaller for RnD purposes only "\epoc32\release\armv5\urel\javainstaller.exe"-"c:\sys\bin\javainst.exe" - - -"\epoc32\release\armv5\urel\javacontrolpanel.dll"-"c:\sys\bin\javacontrolpanel.dll" -"\epoc32\release\armv5\urel\javacontrolpanel.exe"-"c:\sys\bin\javacontrolpanel.exe" -"\epoc32\data\z\private\10003a3f\apps\javacontrolpanel_reg.rsc" -"c:\private\10003a3f\import\apps\javacontrolpanel_reg.rsc" diff -r 461e71b327da -r 0553e2305d00 build/symbian_uids.pri --- a/build/symbian_uids.pri Fri Sep 17 17:50:17 2010 +0100 +++ b/build/symbian_uids.pri Fri Oct 22 14:23:56 2010 +0100 @@ -120,10 +120,6 @@ contains(TARGET, javacaptain_ext_scrupdater): TARGET.UID3 = 0x2002DD10 contains(TARGET, javacaptain_ext_ondemand_2): TARGET.UID3 = 0x2002DD01 contains(TARGET, javanokiaui): TARGET.UID3 = 0x2002E697 -contains(TARGET, javacaptain_ext_autostarter): TARGET.UID3 = 0x2002EA7E -contains(TARGET, javacontrolpanel): TARGET.UID3 = 0x2002FF62 -contains(TARGET, eswtqtwebkit): TARGET.UID3 = 0x2002FFA9 -contains(TARGET, javaopengles): TARGET.UID3 = 0x20031DD1 isEmpty(TARGET.UID3): error($${TEMPLATE} $${TARGET} : UID3 not defined. Please allocate UID3 and configure it either on $${TARGET}.pro file or in command symbian_uids.pri) diff -r 461e71b327da -r 0553e2305d00 build/templates/10.1.layers.sysdef.xml --- a/build/templates/10.1.layers.sysdef.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/build/templates/10.1.layers.sysdef.xml Fri Oct 22 14:23:56 2010 +0100 @@ -12,12 +12,26 @@ qmakeArgs="-r" filter="!sf_build" /> + + + + + + + + + diff -r 461e71b327da -r 0553e2305d00 build/templates/9.2.layers.sysdef.xml --- a/build/templates/9.2.layers.sysdef.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/build/templates/9.2.layers.sysdef.xml Fri Oct 22 14:23:56 2010 +0100 @@ -10,10 +10,22 @@ + + + + + + + + + diff -r 461e71b327da -r 0553e2305d00 build/utilities.xml diff -r 461e71b327da -r 0553e2305d00 inc/build_defines.hrh --- a/inc/build_defines.hrh Fri Sep 17 17:50:17 2010 +0100 +++ b/inc/build_defines.hrh Fri Oct 22 14:23:56 2010 +0100 @@ -15,7 +15,7 @@ * */ -#define RD_JAVA_VERSION 2,2,11 +#define RD_JAVA_VERSION 2,1,44 #define RD_JAVA_SYMBIAN_TARGET #define RD_JAVA_S60_RELEASE_9_2 #define RD_JAVA_S60_RELEASE_9_2_ONWARDS diff -r 461e71b327da -r 0553e2305d00 inc/build_defines.pri diff -r 461e71b327da -r 0553e2305d00 inc/java.txt --- a/inc/java.txt Fri Sep 17 17:50:17 2010 +0100 +++ b/inc/java.txt Fri Oct 22 14:23:56 2010 +0100 @@ -1,1 +1,1 @@ -2.2.11 +2.1.44 diff -r 461e71b327da -r 0553e2305d00 inc/java_s60_release.hrh --- a/inc/java_s60_release.hrh Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -RD_JAVA_S60_RELEASE=9.2 diff -r 461e71b327da -r 0553e2305d00 inc/project_defines.hrh diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/build/bld.inf --- a/javacommons/comms/build/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/comms/build/bld.inf Fri Oct 22 14:23:56 2010 +0100 @@ -19,5 +19,5 @@ default PRJ_MMPFILES -javacomms_0x2002DCA6.mmp +comms_0x2002DCA6.mmp #include "exports.inf" diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/build/comms.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/comms/build/comms.pro Fri Oct 22 14:23:56 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: +# + +TEMPLATE=lib +TARGET=javacomms +CONFIG += omj java staticdata stl +CONFIG -= qt +LIBS += -ljavaipc + + +include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/build/comms_0x2002DCA6.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/comms/build/comms_0x2002DCA6.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,151 @@ +/* +* 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: Generated file - do not edit manually +* +*/ + +// ============================================================================== +// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) +// This file is generated by qmake and should not be modified by the +// user. +// Name : comms.mmp +// ============================================================================== + +TARGET javacomms.dll +TARGETTYPE DLL + +UID 0x1000008d 0x2002DCA6 +SECUREID 0x2002DCA6 + +EPOCALLOWDLLDATA + + +// Qt Macros +MACRO UNICODE +MACRO QT_KEYPAD_NAVIGATION +MACRO QT_SOFTKEYS_ENABLED +MACRO QT_USE_MATH_H_FLOATS +MACRO RD_JAVA_SYMBIAN_TARGET +MACRO RD_JAVA_S60_RELEASE_9_2 +MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS +MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS +MACRO RD_JAVA_STDCPPV5 +MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX +MACRO RD_JAVA_HTTP_EMC_ENABLED +MACRO RD_JAVA_NGA_ENABLED +MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_OPENC_BETA_PATCH +MACRO RD_JAVA_INSTALLERUI_ENABLED +MACRO RD_JAVA_PREWARM +MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK +MACRO RD_JAVA_MIDPRMS_DB +MACRO __SYMBIAN32__ +MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER + +SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian +SYSTEMINCLUDE ../inc +SYSTEMINCLUDE ../../inc +SYSTEMINCLUDE ../../../inc +SYSTEMINCLUDE ../src +SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 +SYSTEMINCLUDE /epoc32/include/mw +SYSTEMINCLUDE . + +SOURCEPATH ../src +SOURCE commsclientendpoint.cpp +SOURCE commscontext.cpp +SOURCE commsendpoint.cpp +SOURCE commsendpointnative.cpp +SOURCE commsmessage.cpp +SOURCE commsserverendpoint.cpp +SOURCE listeners.cpp + + +LIBRARY javaipc.lib +LIBRARY javautils.lib +LIBRARY libpthread.lib +LIBRARY libstdcppv5.lib +LIBRARY libc.lib +LIBRARY libm.lib +LIBRARY euser.lib +LIBRARY libdl.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY mediaclientaudio.lib +LIBRARY eikcoctl.lib +LIBRARY eiksrv.lib +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY efsrv.lib +LIBRARY charconv.lib +LIBRARY ws32.lib +LIBRARY hal.lib +LIBRARY gdi.lib +LIBRARY apgrfx.lib + +CAPABILITY all -tcb + +OPTION CW -wchar_t on +OPTION ARMCC --visibility_inlines_hidden +#if defined(ARMCC_4_0) +OPTION ARMCC --import_all_vtbl +#endif +OPTION GCCE -fvisibility-inlines-hidden + +VERSION 10.0 + +ARMFPU softvfp + +PAGED + +BYTEPAIRCOMPRESSTARGET + +USERINCLUDE . + +#include + + APP_LAYER_SYSTEMINCLUDE + + OS_LAYER_LIBC_SYSTEMINCLUDE + + OS_LAYER_SSL_SYSTEMINCLUDE + +deffile ./~/javacomms.def + + SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) + +SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah + +SOURCEPATH /epoc32/build/jrt/javabuild/javacomms + +SOURCE lookup.cpp + +SOURCEPATH /epoc32/build/jrt/javabuild/javacomms + +SOURCE jxe.c + +#ifdef WINSCW + +LIBRARY ewsd.lib + +#endif + +STDCPP + +#ifdef WINSCW +DEFFILE ./bwins/javacomms.def +#elif defined EABI +DEFFILE ./eabi/javacomms.def +#endif diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/build/javacomms.pro --- a/javacommons/comms/build/javacomms.pro Fri Sep 17 17:50:17 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: -# - -TEMPLATE=lib -TARGET=javacomms -CONFIG += omj java staticdata stl -CONFIG -= qt -LIBS += -ljavaipc - - -include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/build/javacomms_0x2002DCA6.mmp --- a/javacommons/comms/build/javacomms_0x2002DCA6.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +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: Generated file - do not edit manually -* -*/ - -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) -// This file is generated by qmake and should not be modified by the -// user. -// Name : javacomms.mmp -// ============================================================================== - -TARGET javacomms.dll -TARGETTYPE DLL - -UID 0x1000008d 0x2002DCA6 -SECUREID 0x2002DCA6 - -EPOCALLOWDLLDATA - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO RD_JAVA_SYMBIAN_TARGET -MACRO RD_JAVA_S60_RELEASE_9_2 -MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS -MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS -MACRO RD_JAVA_STDCPPV5 -MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX -MACRO RD_JAVA_HTTP_EMC_ENABLED -MACRO RD_JAVA_NGA_ENABLED -MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED -MACRO RD_JAVA_OPENC_BETA_PATCH -MACRO RD_JAVA_INSTALLERUI_ENABLED -MACRO RD_JAVA_PREWARM -MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK -MACRO RD_JAVA_MIDPRMS_DB -MACRO __SYMBIAN32__ -MACRO J9EPOC32 - -SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../inc -SYSTEMINCLUDE ../../inc -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE ../src -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE . - -SOURCEPATH ../src -SOURCE commsclientendpoint.cpp -SOURCE commscontext.cpp -SOURCE commsendpoint.cpp -SOURCE commsendpointnative.cpp -SOURCE commsmessage.cpp -SOURCE commsserverendpoint.cpp -SOURCE listeners.cpp - - -LIBRARY javaipc.lib -LIBRARY javautils.lib -LIBRARY libpthread.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib -LIBRARY apgrfx.lib - -CAPABILITY all -tcb - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden -#if defined(ARMCC_4_0) -OPTION ARMCC --import_all_vtbl -#endif -OPTION GCCE -fvisibility-inlines-hidden - -VERSION 10.0 - -ARMFPU softvfp - -PAGED - -BYTEPAIRCOMPRESSTARGET - -USERINCLUDE . - -#include - - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - -deffile ./~/javacomms.def - - SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) - -SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah - -SOURCEPATH /epoc32/build/jrt/javabuild/javacomms - -SOURCE lookup.cpp - -SOURCEPATH /epoc32/build/jrt/javabuild/javacomms - -SOURCE jxe.c - -#ifdef WINSCW - -LIBRARY ewsd.lib - -#endif - -STDCPP - -#ifdef WINSCW -DEFFILE ./bwins/javacomms.def -#elif defined EABI -DEFFILE ./eabi/javacomms.def -#endif diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/comms.pro --- a/javacommons/comms/comms.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/comms/comms.pro Fri Oct 22 14:23:56 2010 +0100 @@ -15,6 +15,6 @@ # TEMPLATE = subdirs SUBDIRS += ipclib/clientserver/build/ipc.pro -SUBDIRS += build/javacomms.pro +SUBDIRS += build/comms.pro BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"ipclib/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/ipclib/clientserver/build/ipc_0x2002DCB7.mmp --- a/javacommons/comms/ipclib/clientserver/build/ipc_0x2002DCB7.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/comms/ipclib/clientserver/build/ipc_0x2002DCB7.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/ipclib/clientserver/src.s60/commssession.cpp --- a/javacommons/comms/ipclib/clientserver/src.s60/commssession.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/comms/ipclib/clientserver/src.s60/commssession.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -87,10 +87,7 @@ } else { - if (rc != KErrOverflow) - { - WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc); - } + WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc); } } return 0; @@ -154,10 +151,7 @@ } else { - if (rc != KErrOverflow) - { - WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc); - } + WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc); } } } @@ -199,7 +193,7 @@ else { rc = KErrOverflow; - LOG3(EJavaComms, EInfo, "%s: allocated length for message is too small (required size=%d, allocated size=%d)", + WLOG3(EJavaComms, "%s: allocated length for message is too small (required size=%d, allocated size=%d)", __PRETTY_FUNCTION__, neededLength, allocatedLength); } diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/ipclib/clientserver/src.s60/creceiver.cpp --- a/javacommons/comms/ipclib/clientserver/src.s60/creceiver.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/comms/ipclib/clientserver/src.s60/creceiver.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -33,20 +33,8 @@ CReceiver::CReceiver(IpcClient& aParent, IpcListener& aListener, RComms& aSession) : CActive(EPriorityStandard), mParent(aParent), mListener(aListener), mSession(aSession) { -} - -CReceiver* CReceiver::NewLC(IpcClient& aParent, IpcListener& aListener, RComms& aSession) -{ - CReceiver* self = new(ELeave) CReceiver(aParent, aListener, aSession); - CleanupStack::PushL(self); - self->ConstructL(); - return self; -} - -void CReceiver::ConstructL() -{ CActiveScheduler::Add(this); - mBuffer.CreateL(DEFAULT_BUFFER_SIZE); + mBuffer.Create(DEFAULT_BUFFER_SIZE); } CReceiver::~CReceiver() @@ -78,7 +66,7 @@ // buffer was not big enough for the message so reallocate buffer with correct size mBuffer.Close(); mBuffer.ReAllocL(mRequiredLength()); - LOG2(EJavaComms, EInfo, "%s: increasing buffer size to %d", __PRETTY_FUNCTION__, mRequiredLength()); + WLOG2(EJavaComms, "%s: increasing buffer size to %d", __PRETTY_FUNCTION__, mRequiredLength()); Receive(); } break; diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/ipclib/clientserver/src.s60/creceiver.h --- a/javacommons/comms/ipclib/clientserver/src.s60/creceiver.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/comms/ipclib/clientserver/src.s60/creceiver.h Fri Oct 22 14:23:56 2010 +0100 @@ -31,16 +31,12 @@ NONSHARABLE_CLASS(CReceiver): public CActive { +public: CReceiver(IpcClient& aParent, IpcListener& aListener, RComms& aSession); -public: - static CReceiver* NewLC(IpcClient& aParent, IpcListener& aListener, RComms& aSession); - ~CReceiver(); void Receive(); private: - void ConstructL(); - virtual void RunL(); virtual void DoCancel(); virtual TInt RunError(TInt aError); diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/ipclib/clientserver/src.s60/ipcclient.cpp --- a/javacommons/comms/ipclib/clientserver/src.s60/ipcclient.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/comms/ipclib/clientserver/src.s60/ipcclient.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -176,7 +176,8 @@ User::LeaveIfError(mComms.Connect(serverName->Des())); LOG1(EJavaComms, EInfo, "IpcClient connected to %s", address.str().c_str()); - mReceiver = CReceiver::NewLC(*this, *mListener, mComms); + mReceiver = new(ELeave) CReceiver(*this, *mListener, mComms); + CleanupStack::PushL(mReceiver); mReceiver->Receive(); CActiveScheduler::Add(this); diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/tsrc/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/comms/tsrc/Makefile Fri Oct 22 14:23:56 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 461e71b327da -r 0553e2305d00 javacommons/comms/tsrc/javaapi/Makefile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/comms/tsrc/javaapi/Makefile Fri Oct 22 14:23:56 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 461e71b327da -r 0553e2305d00 javacommons/comms/tsrc/javaapi/build/build.xml --- a/javacommons/comms/tsrc/javaapi/build/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/comms/tsrc/javaapi/build/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -27,6 +27,7 @@ + @@ -40,9 +41,9 @@ - - - + + + @@ -63,7 +64,7 @@ - + diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/tsrc/javaapi/build/javacaptain_ext_ondemand_101.pro --- a/javacommons/comms/tsrc/javaapi/build/javacaptain_ext_ondemand_101.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/comms/tsrc/javaapi/build/javacaptain_ext_ondemand_101.pro Fri Oct 22 14:23:56 2010 +0100 @@ -25,6 +25,5 @@ symbian { SOURCES += ../src.s60/lookup.cpp - TARGET.UID3 = 0xE0000055 } include(../../../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javacommons/comms/tsrc/javaapi/subsystem.mk --- a/javacommons/comms/tsrc/javaapi/subsystem.mk Fri Sep 17 17:50:17 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 461e71b327da -r 0553e2305d00 javacommons/comms/tsrc/subsystem.mk --- a/javacommons/comms/tsrc/subsystem.mk Fri Sep 17 17:50:17 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 461e71b327da -r 0553e2305d00 javacommons/connectionmanager/build/javaconnectionmanager_0x2002DCA7.mmp --- a/javacommons/connectionmanager/build/javaconnectionmanager_0x2002DCA7.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/connectionmanager/build/javaconnectionmanager_0x2002DCA7.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javacommons/connectionmanager/inc.s60/connectionmanager.h --- a/javacommons/connectionmanager/inc.s60/connectionmanager.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/connectionmanager/inc.s60/connectionmanager.h Fri Oct 22 14:23:56 2010 +0100 @@ -163,7 +163,6 @@ static HBufC8 * PromptUserSelectNetworkAccessPointL(); static HBufC8 * CreateDescriptorL(const int aType, const int id); - static bool checkIapDefaultL(TUint32 aMatchIapId, TUint32 aDestId, bool aDefault); diff -r 461e71b327da -r 0553e2305d00 javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/build/testapnsettings.mmp --- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/build/testapnsettings.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/build/testapnsettings.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -22,9 +22,7 @@ #include <../../../../../../inc/java_stdcpp_support_for_exe.hrh> #include -USERINCLUDE /epoc32/include/cpputest // Due to TestHarness.h - -USERINCLUDE ../../inc.s60 +USERINCLUDE /epoc32/include/cpputest USERINCLUDE ../../../../../../inc // Using main() as entry point diff -r 461e71b327da -r 0553e2305d00 javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/AllTests.h --- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/AllTests.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/AllTests.h Fri Oct 22 14:23:56 2010 +0100 @@ -15,7 +15,7 @@ * */ -#include "cpputest/Utest.h" +#include "Utest.h" //Include this in the test main to execute these tests IMPORT_TEST_GROUP(TestAPNSettings); diff -r 461e71b327da -r 0553e2305d00 javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/testapnsettings.cpp --- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/testapnsettings.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/testapnsettings.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -16,9 +16,11 @@ */ #include -#include + +#include "TestHarness.h" -#include "mapnsettings.h" +#include "../../inc.s60/mapnsettings.h" + #include "javastorage.h" #include "javastorageexception.h" #include "javastoragenames.h" diff -r 461e71b327da -r 0553e2305d00 javacommons/connectionmanager/src.s60/connectionmanager.cpp --- a/javacommons/connectionmanager/src.s60/connectionmanager.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/connectionmanager/src.s60/connectionmanager.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -65,21 +65,7 @@ EXPORT_C bool ConnectionManager::isIapDefault(TUint32 aMatchIapId, TUint32 aDestId, bool aDefault) { - 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"); + LOG(ESOCKET,EInfo,"+ConnectionManager::getDefualtId"); TUint32 id = aDestId; TUint32 tmpapId; TCmDefConnType type; @@ -118,9 +104,8 @@ return true; } } - return false; - - + return false; + } // --------------------------------------------------------------------------- @@ -304,7 +289,7 @@ { JavaStorageApplicationEntry_t::const_iterator findIterator = entries.find(attribute); - if (findIterator != entries.end()) + if (findIterator != entries.end() && findIterator->entryValue().length()>0 ) { JavaStorageEntry sourceEntry = (*findIterator); temp.append(sourceEntry.entryValue().c_str()); diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/build/bld.inf --- a/javacommons/fileutils/build/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/fileutils/build/bld.inf Fri Oct 22 14:23:56 2010 +0100 @@ -19,5 +19,5 @@ default PRJ_MMPFILES -javafileutils_0x2002DCAD.mmp +fileutils_0x2002DCAD.mmp #include "exports.inf" diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/build/fileutils.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/fileutils/build/fileutils.pro Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,26 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TARGET=javafileutils +TEMPLATE=lib +CONFIG += omj java staticdata stl +CONFIG -= qt + +symbian : LIBS += -lefsrv -lPlatformEnv -lcaf + +LIBS+= -ljavautils -ljavacomms + +include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/build/fileutils_0x2002DCAD.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/fileutils/build/fileutils_0x2002DCAD.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,166 @@ +/* +* 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: Generated file - do not edit manually +* +*/ + +// ============================================================================== +// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) +// This file is generated by qmake and should not be modified by the +// user. +// Name : fileutils.mmp +// ============================================================================== + +TARGET javafileutils.dll +TARGETTYPE DLL + +UID 0x1000008d 0x2002DCAD +SECUREID 0x2002DCAD + +EPOCALLOWDLLDATA + + +// Qt Macros +MACRO UNICODE +MACRO QT_KEYPAD_NAVIGATION +MACRO QT_SOFTKEYS_ENABLED +MACRO QT_USE_MATH_H_FLOATS +MACRO RD_JAVA_SYMBIAN_TARGET +MACRO RD_JAVA_S60_RELEASE_9_2 +MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS +MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS +MACRO RD_JAVA_STDCPPV5 +MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX +MACRO RD_JAVA_HTTP_EMC_ENABLED +MACRO RD_JAVA_NGA_ENABLED +MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_OPENC_BETA_PATCH +MACRO RD_JAVA_INSTALLERUI_ENABLED +MACRO RD_JAVA_PREWARM +MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK +MACRO RD_JAVA_MIDPRMS_DB +MACRO __SYMBIAN32__ +MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER + +SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian +SYSTEMINCLUDE ../inc.s60 +SYSTEMINCLUDE ../inc +SYSTEMINCLUDE ../../inc +SYSTEMINCLUDE ../../../inc +SYSTEMINCLUDE ../src +SYSTEMINCLUDE ../src.s60 +SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 +SYSTEMINCLUDE /epoc32/include/mw +SYSTEMINCLUDE . + +SOURCEPATH ../src +SOURCE driveobserverclient.cpp +SOURCE driveobserverserver.cpp +SOURCE driveutilities.cpp +SOURCE fileextendedcommon.cpp +SOURCE filestreamhandlerjni.cpp +SOURCE fileutilities.cpp +SOURCE fileutilityjni.cpp +SOURCE nativefileiohandler.cpp + +SOURCEPATH ../src.s60 +SOURCE drivechangedeventgenerator.cpp +SOURCE filedrmcontenthandler.cpp +SOURCE filedrmhandlerjni.cpp +SOURCE filemanager.cpp +SOURCE fileplatformspecificsjni.cpp +SOURCE filesystemutils.cpp +SOURCE s60driveutilities.cpp +SOURCE s60filesystemutilities.cpp + + +LIBRARY efsrv.lib +LIBRARY PlatformEnv.lib +LIBRARY caf.lib +LIBRARY javautils.lib +LIBRARY javacomms.lib +LIBRARY libpthread.lib +LIBRARY libstdcppv5.lib +LIBRARY libc.lib +LIBRARY libm.lib +LIBRARY euser.lib +LIBRARY libdl.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY mediaclientaudio.lib +LIBRARY eikcoctl.lib +LIBRARY eiksrv.lib +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY charconv.lib +LIBRARY ws32.lib +LIBRARY hal.lib +LIBRARY gdi.lib +LIBRARY apgrfx.lib + +CAPABILITY all -tcb + +OPTION CW -wchar_t on +OPTION ARMCC --visibility_inlines_hidden +#if defined(ARMCC_4_0) +OPTION ARMCC --import_all_vtbl +#endif +OPTION GCCE -fvisibility-inlines-hidden + +VERSION 10.0 + +ARMFPU softvfp + +PAGED + +BYTEPAIRCOMPRESSTARGET + +USERINCLUDE . + +#include + + APP_LAYER_SYSTEMINCLUDE + + OS_LAYER_LIBC_SYSTEMINCLUDE + + OS_LAYER_SSL_SYSTEMINCLUDE + +deffile ./~/javafileutils.def + + SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) + +SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah + +SOURCEPATH /epoc32/build/jrt/javabuild/javafileutils + +SOURCE lookup.cpp + +SOURCEPATH /epoc32/build/jrt/javabuild/javafileutils + +SOURCE jxe.c + +#ifdef WINSCW + +LIBRARY ewsd.lib + +#endif + +STDCPP + +#ifdef WINSCW +DEFFILE ./bwins/javafileutils.def +#elif defined EABI +DEFFILE ./eabi/javafileutils.def +#endif diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/build/javafileutils.pro --- a/javacommons/fileutils/build/javafileutils.pro Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TARGET=javafileutils -TEMPLATE=lib -CONFIG += omj java staticdata stl -CONFIG -= qt - -symbian : LIBS += -lefsrv -lPlatformEnv -lcaf - -LIBS+= -ljavautils -ljavacomms - -include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/build/javafileutils_0x2002DCAD.mmp --- a/javacommons/fileutils/build/javafileutils_0x2002DCAD.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,165 +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: Generated file - do not edit manually -* -*/ - -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) -// This file is generated by qmake and should not be modified by the -// user. -// Name : javafileutils.mmp -// ============================================================================== - -TARGET javafileutils.dll -TARGETTYPE DLL - -UID 0x1000008d 0x2002DCAD -SECUREID 0x2002DCAD - -EPOCALLOWDLLDATA - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO RD_JAVA_SYMBIAN_TARGET -MACRO RD_JAVA_S60_RELEASE_9_2 -MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS -MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS -MACRO RD_JAVA_STDCPPV5 -MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX -MACRO RD_JAVA_HTTP_EMC_ENABLED -MACRO RD_JAVA_NGA_ENABLED -MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED -MACRO RD_JAVA_OPENC_BETA_PATCH -MACRO RD_JAVA_INSTALLERUI_ENABLED -MACRO RD_JAVA_PREWARM -MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK -MACRO RD_JAVA_MIDPRMS_DB -MACRO __SYMBIAN32__ -MACRO J9EPOC32 - -SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../inc.s60 -SYSTEMINCLUDE ../inc -SYSTEMINCLUDE ../../inc -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE ../src -SYSTEMINCLUDE ../src.s60 -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE . - -SOURCEPATH ../src -SOURCE driveobserverclient.cpp -SOURCE driveobserverserver.cpp -SOURCE driveutilities.cpp -SOURCE fileextendedcommon.cpp -SOURCE filestreamhandlerjni.cpp -SOURCE fileutilities.cpp -SOURCE fileutilityjni.cpp -SOURCE nativefileiohandler.cpp - -SOURCEPATH ../src.s60 -SOURCE drivechangedeventgenerator.cpp -SOURCE filedrmcontenthandler.cpp -SOURCE filedrmhandlerjni.cpp -SOURCE filemanager.cpp -SOURCE fileplatformspecificsjni.cpp -SOURCE filesystemutils.cpp -SOURCE s60driveutilities.cpp -SOURCE s60filesystemutilities.cpp - - -LIBRARY efsrv.lib -LIBRARY PlatformEnv.lib -LIBRARY caf.lib -LIBRARY javautils.lib -LIBRARY javacomms.lib -LIBRARY libpthread.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib -LIBRARY apgrfx.lib - -CAPABILITY all -tcb - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden -#if defined(ARMCC_4_0) -OPTION ARMCC --import_all_vtbl -#endif -OPTION GCCE -fvisibility-inlines-hidden - -VERSION 10.0 - -ARMFPU softvfp - -PAGED - -BYTEPAIRCOMPRESSTARGET - -USERINCLUDE . - -#include - - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - -deffile ./~/javafileutils.def - - SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) - -SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah - -SOURCEPATH /epoc32/build/jrt/javabuild/javafileutils - -SOURCE lookup.cpp - -SOURCEPATH /epoc32/build/jrt/javabuild/javafileutils - -SOURCE jxe.c - -#ifdef WINSCW - -LIBRARY ewsd.lib - -#endif - -STDCPP - -#ifdef WINSCW -DEFFILE ./bwins/javafileutils.def -#elif defined EABI -DEFFILE ./eabi/javafileutils.def -#endif diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileOutputStream.java --- a/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileOutputStream.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileOutputStream.java Fri Oct 22 14:23:56 2010 +0100 @@ -64,7 +64,10 @@ public synchronized void flush() throws IOException { - // Data written to native side immediately. Nothing to flush. + if (iDataSink != null) + { + iDataSink.flush(); + } } public void close() throws IOException diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileStreamHandler.java --- a/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileStreamHandler.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileStreamHandler.java Fri Oct 22 14:23:56 2010 +0100 @@ -240,6 +240,11 @@ _writeData(iNativeHandle, aBytes, aOffset, aLength); } + protected void flush() + { + _flush(iNativeHandle); + } + /** * Closes all output streams. * @@ -331,6 +336,8 @@ private native void _writeData(int aNativePeer, byte[] aBytes, int aOffset, int aLength); + + private native void _flush(int aNativePeer); private native void _closeFileStream(int aHandle); diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileURL.java --- a/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileURL.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileURL.java Fri Oct 22 14:23:56 2010 +0100 @@ -23,7 +23,7 @@ * differences between URL and Absolute path and make it transparent to use * from. */ -public final class FileURL +final class FileURL { private static String FILE_PREFIX = "file://"; diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/src.s60/filesystemutils.cpp --- a/javacommons/fileutils/src.s60/filesystemutils.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/fileutils/src.s60/filesystemutils.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -25,7 +25,6 @@ #include "s60filesystemutilities.h" #include "javasymbianoslayer.h" -#define BUF_LEN 255 using namespace std; using namespace java::util; using namespace java::fileutils; @@ -95,9 +94,8 @@ OS_EXPORT std::wstring FileUtilities::listRoots() { JELOG2(EJavaFile); - TBuf buf; - buf.Copy(S60FileSystemUtilities::GetSupportedDrives()); - std::wstring retString((wchar_t*)buf.Ptr()); + TDesC16 aDes(S60FileSystemUtilities::GetSupportedDrives()); + std::wstring retString((wchar_t*)aDes.Ptr()); return retString; } diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/src/filestreamhandlerjni.cpp --- a/javacommons/fileutils/src/filestreamhandlerjni.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/fileutils/src/filestreamhandlerjni.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -187,6 +187,35 @@ /* * Class: com_nokia_mj_impl_fileutils_FileStreamHandler +* Method: _flush +* Signature: (I)V +*/ +JNIEXPORT void JNICALL Java_com_nokia_mj_impl_fileutils_FileStreamHandler__1flush +(JNIEnv *aJni, jobject, jint aHandle) +{ + try + { + NativeFileIOHandler* handler = + reinterpret_cast(aHandle); + handler->flush(); + } + catch (int error) + { + WLOG1(EJavaFile, "FileStreamHandler: JNI: flush error : Error: %d", + error); + JniUtils::throwNewException(aJni, "java/io/IOException", + "Flush failed."); + } + catch (...) + { + ELOG(EJavaFile, "FileStreamHandler: JNI: flush: Unknown error."); + JniUtils::throwNewException(aJni, "java/io/IOException", + "Flush failed."); + } +} + +/* + * Class: com_nokia_mj_impl_fileutils_FileStreamHandler * Method: _closeFileStream * Signature: (I)V */ diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/src/fileutilities.cpp --- a/javacommons/fileutils/src/fileutilities.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/fileutils/src/fileutilities.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -18,7 +18,6 @@ #include #include -#include #include #include #include @@ -323,8 +322,7 @@ char *dirName = JavaCommonUtils::wstringToUtf8(path); if (ableToOpen) { - DIR* wDirHandle = opendir(dirName); - if (!wDirHandle) + if (!opendir(dirName)) { ableToOpen = false; if (mkdir(dirName,0666)<0) @@ -335,7 +333,6 @@ return -1; } } - closedir(wDirHandle); } else { diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/src/nativefileiohandler.cpp --- a/javacommons/fileutils/src/nativefileiohandler.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/fileutils/src/nativefileiohandler.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -18,8 +18,6 @@ #include #include #include -#include -#include #include #include @@ -179,6 +177,19 @@ closeStream(); } +void NativeFileIOHandler::flush() +{ + JELOG2(EJavaFile); + int ret = fsync(mFileDescriptor); + if (ret < 0) + { + ELOG1(EJavaFile, "NativeFileIOHandler::flush() error %d", ret); + int error = errno; + throw error; + } + +} + void NativeFileIOHandler::closeStream() { JELOG2(EJavaFile); diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/src/nativefileiohandler.h --- a/javacommons/fileutils/src/nativefileiohandler.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/fileutils/src/nativefileiohandler.h Fri Oct 22 14:23:56 2010 +0100 @@ -94,6 +94,11 @@ * Returns the amount of data available in the file from current read offset. */ virtual long available(); + + /** + * Flush the contents to the permanent storage. + */ + virtual void flush(); protected: virtual void handleReopenCase(); diff -r 461e71b327da -r 0553e2305d00 javacommons/fileutils/tsrc/fileutilstestinit/build/javafileutilstestinit.pro --- a/javacommons/fileutils/tsrc/fileutilstestinit/build/javafileutilstestinit.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/fileutils/tsrc/fileutilstestinit/build/javafileutilstestinit.pro Fri Oct 22 14:23:56 2010 +0100 @@ -21,6 +21,7 @@ symbian { TARGET.CAPABILITY = all -tcb + INCLUDEPATH += /epoc32/include/caf LIBS += -lcaf -lcafutils -lefsrv -lDrmParsers -lDRMServerInterfaces } diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfbase/build/javagcf_0x2002DCAE.mmp --- a/javacommons/gcfbase/build/javagcf_0x2002DCAE.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfbase/build/javagcf_0x2002DCAE.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/file/build/javafile.pro diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/file/build/javafile_0x2002DCAC.mmp --- a/javacommons/gcfprotocols/file/build/javafile_0x2002DCAC.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/file/build/javafile_0x2002DCAC.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/file/tsrc/mt/filetestinit/build/javafiletestinit.pro --- a/javacommons/gcfprotocols/file/tsrc/mt/filetestinit/build/javafiletestinit.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/file/tsrc/mt/filetestinit/build/javafiletestinit.pro Fri Oct 22 14:23:56 2010 +0100 @@ -21,6 +21,7 @@ symbian { TARGET.CAPABILITY = all -tcb + INCLUDEPATH += /epoc32/include/caf LIBS += -lcaf -lcafutils -lefsrv -lDrmParsers -lDRMServerInterfaces } diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/http/build/javahttp.pro --- a/javacommons/gcfprotocols/http/build/javahttp.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/http/build/javahttp.pro Fri Oct 22 14:23:56 2010 +0100 @@ -21,9 +21,7 @@ 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 -lcentralrepository -lwebutils contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_5_0) { LIBS += -lcommdb } @@ -32,4 +30,6 @@ } } + + include(../../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/http/build/javahttp_0x2002DCB1.mmp --- a/javacommons/gcfprotocols/http/build/javahttp_0x2002DCB1.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/http/build/javahttp_0x2002DCB1.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 @@ -82,7 +83,6 @@ LIBRARY x500.lib LIBRARY crypto.lib LIBRARY esock.lib -LIBRARY commdb.lib LIBRARY centralrepository.lib LIBRARY webutils.lib LIBRARY extendedconnpref.lib diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp --- a/javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -135,7 +135,7 @@ narrowBuffer = HBufC8::NewLC(length); TPtr8 narrowPtr = narrowBuffer->Des(); narrowPtr.Copy(rawHeader); - rawHeaderArray.AppendL(narrowBuffer); + rawHeaderArray.Append(narrowBuffer); CleanupStack::Pop(narrowBuffer); } aJni->DeleteLocalRef(jniString); diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp --- a/javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -220,6 +220,7 @@ jstring GetUserAgentL(JNIEnv *aJni, jboolean aMidpRuntime) { + jstring header = NULL; if (aMidpRuntime == false) @@ -290,6 +291,6 @@ CleanupStack::PopAndDestroy(repository); } - LOG(ESOCKET,EInfo,"GetUserAgentL() -"); + return header; } diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/https/build/javahttps_0x2002DCB2.mmp --- a/javacommons/gcfprotocols/https/build/javahttps_0x2002DCB2.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/https/build/javahttps_0x2002DCB2.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../http/inc.s60 diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/secureconnection/build/javassl_0x2002DCD7.mmp --- a/javacommons/gcfprotocols/secureconnection/build/javassl_0x2002DCD7.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/secureconnection/build/javassl_0x2002DCD7.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../socket/socket/inc diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/ssl/SecureConnectionImpl.java --- a/javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/ssl/SecureConnectionImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/ssl/SecureConnectionImpl.java Fri Oct 22 14:23:56 2010 +0100 @@ -35,7 +35,6 @@ 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; /** @@ -75,7 +74,7 @@ private static final String LOCALISED_STRING_ID = "qtn_ssl_prompt_"; - private static final Id UNTRUSTED_CERTIFICATE_WARNING = new Id("untrusted_certificate", "N/A"); + private static final String UNTRUSTED_CERTIFICATE_WARNING = "untrusted_certificate"; /** * Constructs the SecureConnectionImpl. diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/serverconnection/build/javasocketscplugin_0x2002DCD5.mmp --- a/javacommons/gcfprotocols/socket/serverconnection/build/javasocketscplugin_0x2002DCD5.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/serverconnection/build/javasocketscplugin_0x2002DCD5.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/socket/build/build.xml --- a/javacommons/gcfprotocols/socket/socket/build/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/build/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -41,8 +41,7 @@ + com.nokia.mj.impl.socket.ServerSocketConnectionImpl"/> - - - java.src.paths=${java.src.paths} - microedition.hostname=:socket.SocketDynamicPropertyHandler - - diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/socket/build/javasocket_0x2002DCD4.mmp --- a/javacommons/gcfprotocols/socket/socket/build/javasocket_0x2002DCD4.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/build/javasocket_0x2002DCD4.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/socket/inc/apnsettings.h --- a/javacommons/gcfprotocols/socket/socket/inc/apnsettings.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/inc/apnsettings.h Fri Oct 22 14:23:56 2010 +0100 @@ -27,7 +27,8 @@ public : static int setDefaultApn(int aType, int aApn); - + static void removeDefaultApn(); + static int retryConnection(int aErrCode,int aType, int aApn); }; diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/socket/inc/socketlocalhostinfo.h --- a/javacommons/gcfprotocols/socket/socket/inc/socketlocalhostinfo.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/inc/socketlocalhostinfo.h Fri Oct 22 14:23:56 2010 +0100 @@ -27,7 +27,7 @@ public: OS_IMPORT static int getLocalAddress(int aSd, char *aLocalAddr, int aMidletIapId, int aApType); - static char* getLocalHostName(); + }; diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/socket/javasrc.s60/com/nokia/mj/impl/gcf/protocol/socket/Protocol.java --- a/javacommons/gcfprotocols/socket/socket/javasrc.s60/com/nokia/mj/impl/gcf/protocol/socket/Protocol.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/javasrc.s60/com/nokia/mj/impl/gcf/protocol/socket/Protocol.java Fri Oct 22 14:23:56 2010 +0100 @@ -151,7 +151,7 @@ Logger.LOG(Logger.ESOCKET, Logger.EInfo, "socket - protocol class : server connection"); ApplicationUtils appUtils = ApplicationUtils.getInstance(); - SocketPermissionImpl per = new SocketPermissionImpl(SocketPermissionImpl.SERVER_TARGET); + SocketPermissionImpl per = new SocketPermissionImpl("socket://"); appUtils.checkPermission(per); /* security related stuff */ Logger.LOG(Logger.ESOCKET, Logger.EInfo, @@ -168,7 +168,7 @@ throw new IllegalArgumentException("Invalid URL: " + fullurl); } ApplicationUtils appUtils = ApplicationUtils.getInstance(); - SocketPermissionImpl per = new SocketPermissionImpl(SocketPermissionImpl.CLIENT_TARGET); + SocketPermissionImpl per = new SocketPermissionImpl("socket://*"); appUtils.checkPermission(per); /* security related stuff */ Logger.LOG(Logger.ESOCKET, Logger.EInfo, diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/gcf/protocol/socket/PushValidatorImpl.java --- a/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/gcf/protocol/socket/PushValidatorImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/gcf/protocol/socket/PushValidatorImpl.java Fri Oct 22 14:23:56 2010 +0100 @@ -127,7 +127,7 @@ Logger.LOG(Logger.ESOCKET, Logger.EInfo, "socket - push validator : before security check"); ApplicationUtils appUtils = ApplicationUtils.getInstance(); - SocketPermissionImpl per = new SocketPermissionImpl(SocketPermissionImpl.SERVER_TARGET); + SocketPermissionImpl per = new SocketPermissionImpl("socket://"); appUtils.checkPermission(per); /* security check */ Logger.LOG(Logger.ESOCKET, Logger.EInfo, diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/gcf/protocol/socket/SocketPermissionImpl.java Fri Oct 22 14:23:56 2010 +0100 @@ -25,13 +25,6 @@ public class SocketPermissionImpl extends PermissionBase { - /** - * Constants for identifying the target/uri of connection: client or server - */ - static String CLIENT_TARGET = "socket://*"; - static String SERVER_TARGET = "socket://"; - - private String iTarget; /** * Returns the question (as localized text) associated with the security @@ -43,7 +36,6 @@ public SocketPermissionImpl(String uri) { super(uri); - iTarget = uri; } public String getSecurityPromptQuestion(int aInteractionMode) @@ -63,10 +55,6 @@ public String toString() { - if (SERVER_TARGET.equals(iTarget)) - { - return "javax.microedition.io.Connector.serversocket"; - } return "javax.microedition.io.Connector.socket"; } @@ -74,12 +62,7 @@ { if (p instanceof SocketPermissionImpl) { - SocketPermissionImpl o = (SocketPermissionImpl)p; - if ((iTarget != null && iTarget.equals(o.getTarget())) - || (iTarget == null && o.getTarget() == null)) - { - return true; - } + return true; } return false; } @@ -104,8 +87,4 @@ return null; } - String getTarget() - { - return iTarget; - } } \ No newline at end of file diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/properties/socket/SocketDynamicPropertyHandler.java --- a/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/properties/socket/SocketDynamicPropertyHandler.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +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: -* -*/ - -package com.nokia.mj.impl.properties.socket; - -import java.util.Hashtable; -import java.io.IOException; -import com.nokia.mj.impl.rt.support.Jvm; -import com.nokia.mj.impl.rt.support.SystemPropertyProvider; -import com.nokia.mj.impl.utils.Logger; - -public final class SocketDynamicPropertyHandler implements SystemPropertyProvider -{ - static - { - try - { - Jvm.loadSystemLibrary("javasocket"); - } - catch (Exception e) - { - Logger.ELOG(Logger.ESOCKET, e.toString()); - } - } - - private static String SOCKET_LOCALHOST_NAME = "microedition.hostname"; - - private static final int LOCALHOST_NAME = 1; - - private static Hashtable iPropertyKeys; - - static - { - iPropertyKeys = new Hashtable(); - iPropertyKeys.put(SOCKET_LOCALHOST_NAME, new Integer( - LOCALHOST_NAME)); - - } - - /** - * Retrieves socket localhost system property. - * - * @param aKey - * The property to retrieve as defined in this class. - * @return The value of the property specified; null if the property is not - * defined - */ - public String getProperty(String aKey) - { - String propertyValue = null; - String propertyName = aKey; - - Object property = iPropertyKeys.get(propertyName); - if (null == property) - { - return "localhost"; - } - propertyValue = _getLocalhostname(); - - return propertyValue; - } - - public boolean isStatic(String aKey) - { - return true; - } - - private static native String _getLocalhostname(); -} diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/socket/src.s60/apnsettings.cpp --- a/javacommons/gcfprotocols/socket/socket/src.s60/apnsettings.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/src.s60/apnsettings.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -66,4 +66,29 @@ return def; } - +void ApnSettings::removeDefaultApn() +{ + #ifdef RD_JAVA_OPENC_BETA_PATCH + setdefaultif(0); + ILOG(ESOCKET, "sedefaultif called"); + ILOG1(ESOCKET, "remove default apn returned %d",setdefaultif(NULL)); + #endif +} +int ApnSettings::retryConnection(int aErrCode, int aType, int aApn) +{ + if ( aErrCode > __EMAXERRNO ) + { + // errno out of range, check for KErrNotReady + int errCode = -(aErrCode - __EMAXERRNO); + ELOG1(ESOCKET,"ApnSettings:: retryConnection symbian error : %d" , errCode); + if( (errCode == KErrNotReady) && (aType == 2) ) + { + // call reset and setDefaultif() again to make a new conn and use + ApnSettings::removeDefaultApn(); + int ret = ApnSettings::setDefaultApn(aType,aApn); + return ret; + } + } + return -(aErrCode); + +} diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/socket/src.s60/socketlocalhostinfo.cpp --- a/javacommons/gcfprotocols/socket/socket/src.s60/socketlocalhostinfo.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/src.s60/socketlocalhostinfo.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -22,24 +22,7 @@ #include "logger.h" #include "connectionmanager.h" -#define localhost_len 20 int GetlocalIPAdressL(char *localaddr, int aMidletIapId, int aApType); -char* GetlocalHostNameL(); - -char* SocketLocalHostInfo::getLocalHostName() -{ - char* localhostname =NULL; - TRAPD(err,localhostname = GetlocalHostNameL()); - ILOG1(ESOCKET, "err %d ", err); - if (err != KErrNone) - { - localhostname = new char[localhost_len]; - strcpy(localhostname,"localhost"); - return localhostname; - } - else - return localhostname; -} OS_EXPORT int SocketLocalHostInfo::getLocalAddress(int /* aSd */, char *aLocalAddr, int aMidletIapId, int aApType) @@ -207,41 +190,3 @@ } - -char* GetlocalHostNameL() -{ - TUint32 activeIapId = 0; - - TConnectionInfoBuf connectionInfo; - TUint count = 0; - RSocketServ socketServ; - RSocket sock; - RConnection conn; - - User::LeaveIfError(socketServ.Connect()); - User::LeaveIfError(sock.Open(socketServ, KAfInet, KSockStream, - KProtocolInetTcp)); - User::LeaveIfError(conn.Open(socketServ)); - User::LeaveIfError(conn.EnumerateConnections(count)); - - char* localhost = new char[localhost_len]; - - if (count <= 0) - { - strcpy(localhost,"localhost"); - } - else - { - - User::LeaveIfError(conn.GetConnectionInfo(1, connectionInfo)); - activeIapId = connectionInfo().iIapId; - getIPAddressL(activeIapId,localhost); - } - - conn.Close(); - sock.Close(); - socketServ.Close(); - - return localhost; -} - diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/socket/src/nativesocketconnection.cpp --- a/javacommons/gcfprotocols/socket/socket/src/nativesocketconnection.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/src/nativesocketconnection.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -187,7 +187,24 @@ struct hostent* hp = gethostbyname(mHost); if (hp == NULL) { - return -(h_errno); + //error condition, we have to handle -18 error. + ELOG1(ESOCKET,"NativeSocketConnection:: gthostbyname error : %d" , h_errno); + int tmp = ApnSettings::retryConnection(h_errno,aType,aApn); + if(tmp == 0) + { + // connection reset done, attempt once again + hp = gethostbyname(mHost); + if(hp == NULL) + { + return -(h_errno); + } + } + else + { + // retry not supported/failed + return tmp; + + } } addr.sin_addr.s_addr = ((struct in_addr*)(hp->h_addr))->s_addr; } diff -r 461e71b327da -r 0553e2305d00 javacommons/gcfprotocols/socket/socket/src/socketconnectionjni.cpp --- a/javacommons/gcfprotocols/socket/socket/src/socketconnectionjni.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/src/socketconnectionjni.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -17,10 +17,8 @@ #include "com_nokia_mj_impl_socket_SocketConnectionImpl.h" -#include "com_nokia_mj_impl_properties_socket_SocketDynamicPropertyHandler.h" #include "nativesocketconnection.h" -#include "socketlocalhostinfo.h" -#include "logger.h" + using namespace java; @@ -143,13 +141,3 @@ NativeSocketConnection* nativeConn = reinterpret_cast(aNativePeerHandle); delete nativeConn; } - -JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_properties_socket_SocketDynamicPropertyHandler__1getLocalhostname -(JNIEnv *aJni, jclass) -{ - char* addr; - addr = SocketLocalHostInfo::getLocalHostName(); - jstring jnistring = aJni->NewStringUTF(addr); - delete[] addr; - return jnistring; -} diff -r 461e71b327da -r 0553e2305d00 javacommons/javacommons.pro --- a/javacommons/javacommons.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/javacommons.pro Fri Oct 22 14:23:56 2010 +0100 @@ -18,7 +18,7 @@ SUBDIRS += utils/build/javautils.pro SUBDIRS += comms SUBDIRS += javastorage -SUBDIRS += fileutils/build/javafileutils.pro +SUBDIRS += fileutils/build/fileutils.pro SUBDIRS += security SUBDIRS += gcfbase/build/javagcf.pro SUBDIRS += connectionmanager/build/javaconnectionmanager.pro diff -r 461e71b327da -r 0553e2305d00 javacommons/javaenv/build/javaenv.pro diff -r 461e71b327da -r 0553e2305d00 javacommons/javaenv/build/javaenv_0x2001B2A5.mmp --- a/javacommons/javaenv/build/javaenv_0x2001B2A5.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/javaenv/build/javaenv_0x2001B2A5.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javacommons/javaenv/src.s60/javaenvinfo.cpp --- a/javacommons/javaenv/src.s60/javaenvinfo.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/javaenv/src.s60/javaenvinfo.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -113,7 +113,7 @@ { JELOG2(EUtils); - TInt size = 0; + TInt size; RFs rfs; User::LeaveIfError(rfs.Connect()); diff -r 461e71b327da -r 0553e2305d00 javacommons/javaenv/tsrc/build/alltests.mmp --- a/javacommons/javaenv/tsrc/build/alltests.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/javaenv/tsrc/build/alltests.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -20,12 +20,14 @@ CAPABILITY all -tcb -allfiles -drm #include <../../../../inc/java_stdcpp_support_for_exe.hrh> -#include +#include + +//SYSTEMINCLUDE /epoc32/include USERINCLUDE ../../../inc -USERINCLUDE ../../../../inc USERINCLUDE ../../../../tools/cpputest/include/cpputest USERINCLUDE ../../../../tools/cpputest/include/platforms/symbian +USERINCLUDE ../../../../inc STATICLIBRARY cpputest.lib diff -r 461e71b327da -r 0553e2305d00 javacommons/javastorage/build/javastorage_0x2002DCD8.mmp --- a/javacommons/javastorage/build/javastorage_0x2002DCD8.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/javastorage/build/javastorage_0x2002DCD8.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javacommons/javastorage/javasrc/com/nokia/mj/impl/storage/StorageSessionImpl.java --- a/javacommons/javastorage/javasrc/com/nokia/mj/impl/storage/StorageSessionImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/javastorage/javasrc/com/nokia/mj/impl/storage/StorageSessionImpl.java Fri Oct 22 14:23:56 2010 +0100 @@ -297,7 +297,7 @@ */ private void ensureNonEmpty(Uid aUid) throws StorageException { - if (aUid == null || aUid.toString().equals("")) + if (aUid == null || aUid.equals("")) { Logger.ELOG(Logger.EJavaStorage, "Invalid argument"); throw new StorageException("Invalid argument"); diff -r 461e71b327da -r 0553e2305d00 javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/impl/storage/TestStorageAttribute.java --- a/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/impl/storage/TestStorageAttribute.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/javastorage/tsrc/java_api/javasrc/com/nokia/mj/impl/storage/TestStorageAttribute.java Fri Oct 22 14:23:56 2010 +0100 @@ -136,10 +136,10 @@ * 2. Test with Name and Value. * 3. Test Name null throws StorageException * 4. Test Name "" throws StorageException - * 5. Test value null. It is allowed value. + * 5. Test value null. Type is not set SE thrown. * 6. Test value "". * 7. Test one len name and value. - * 8. Test value null, type STRING is allowed. + * 8. Test value null, type STRING throws StorageException. */ public void testNameValueConstructor() { @@ -195,10 +195,11 @@ String name = "AttrName"; String value = null; sa = new StorageAttribute(name, value); + assertTrue("No exp when value Null", false); } catch (StorageException se) { - assertTrue("SE thrown when null value: " + se.toString(), false); + // PASSED } catch (Throwable t) { @@ -245,10 +246,11 @@ String name = "A"; String value = null; sa = new StorageAttribute(name, value); + assertTrue("No exp thrown when null value, string type", false); } catch (StorageException se) { - assertTrue("SE thrown when null value: " + se.toString(), false); + // PASSED } catch (Throwable t) { diff -r 461e71b327da -r 0553e2305d00 javacommons/javastorage/tsrc/storageclient/build/alltests.mmp --- a/javacommons/javastorage/tsrc/storageclient/build/alltests.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/javastorage/tsrc/storageclient/build/alltests.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -22,7 +22,7 @@ #include <../../../../../inc/java_stdcpp_support_for_exe.hrh> #include -APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include USERINCLUDE ../../../inc USERINCLUDE ../../../../../tools/cpputest/include/cpputest diff -r 461e71b327da -r 0553e2305d00 javacommons/jvms/j9utils/threaddump/build/javathreaddumper_0x2002DCD9.mmp --- a/javacommons/jvms/j9utils/threaddump/build/javathreaddumper_0x2002DCD9.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/jvms/j9utils/threaddump/build/javathreaddumper_0x2002DCD9.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../../../../javaruntimes/inc diff -r 461e71b327da -r 0553e2305d00 javacommons/jvms/nativeportlayer/build/jvmnativeport_0x2002DCDE.mmp --- a/javacommons/jvms/nativeportlayer/build/jvmnativeport_0x2002DCDE.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/jvms/nativeportlayer/build/jvmnativeport_0x2002DCDE.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javacommons/security/build/build.xml --- a/javacommons/security/build/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/build/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ - + - Builds OMJ security and generates the policy files in their internal format + Builds OMJ security, generates the policy files in their internal format and copies the certificates and the metadata into right locations @@ -32,6 +32,7 @@ + @@ -47,7 +48,7 @@ - + @@ -61,10 +62,20 @@ + + + + + + + + + + diff -r 461e71b327da -r 0553e2305d00 javacommons/security/build/exports.inf --- a/javacommons/security/build/exports.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/build/exports.inf Fri Oct 22 14:23:56 2010 +0100 @@ -27,12 +27,9 @@ #include -// Configuration interface for javasecurity #ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS -// Public configuration interface is named as CI_javasecurity.confml -// and it is located outside of jrt package. The name of private -// configuration interface is javasecurity2.confml. ../conf/javasecurity2.confml APP_LAYER_CONFML(javasecurity.confml) +../conf/CI_javasecurity.confml APP_LAYER_CONFML(CI_javasecurity.confml) #else ../conf/javasecurity.confml APP_LAYER_CONFML(javasecurity.confml) #endif /* RD_JAVA_S60_RELEASE_10_1_ONWARDS */ diff -r 461e71b327da -r 0553e2305d00 javacommons/security/build/javasecurity_0x2002DCCF.mmp --- a/javacommons/security/build/javasecurity_0x2002DCCF.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/build/javasecurity_0x2002DCCF.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javacommons/security/conf/CI_javasecurity.confml Binary file javacommons/security/conf/CI_javasecurity.confml has changed diff -r 461e71b327da -r 0553e2305d00 javacommons/security/data/msa_manufacturer.txt diff -r 461e71b327da -r 0553e2305d00 javacommons/security/data/msa_operator.txt diff -r 461e71b327da -r 0553e2305d00 javacommons/security/data/msa_trustedthirdparty.txt diff -r 461e71b327da -r 0553e2305d00 javacommons/security/data/msa_untrusted.txt diff -r 461e71b327da -r 0553e2305d00 javacommons/security/data/s60_manufacturer.txt diff -r 461e71b327da -r 0553e2305d00 javacommons/security/data/s60_operator.txt diff -r 461e71b327da -r 0553e2305d00 javacommons/security/data/s60_trustedthirdparty.txt diff -r 461e71b327da -r 0553e2305d00 javacommons/security/data/s60_untrusted.txt diff -r 461e71b327da -r 0553e2305d00 javacommons/security/javasrc.cdc/com/nokia/mj/impl/security/midp/authorization/PermissionGranter.java --- a/javacommons/security/javasrc.cdc/com/nokia/mj/impl/security/midp/authorization/PermissionGranter.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/javasrc.cdc/com/nokia/mj/impl/security/midp/authorization/PermissionGranter.java Fri Oct 22 14:23:56 2010 +0100 @@ -17,7 +17,6 @@ package com.nokia.mj.impl.security.midp.authorization; -import com.nokia.mj.impl.utils.Id; import com.nokia.mj.impl.utils.Uid; import com.nokia.mj.impl.utils.exception.InvalidAttributeException; import com.nokia.mj.impl.security.midp.common.MIDPPermission; @@ -58,9 +57,6 @@ * different aplications being installed */ private Hashtable iBlanketPermissionsDetails = new Hashtable(); - - private static final int NOT_FOUND = -2; - private static final int REMOVED = -1; /** * Creates an instance of the PermissionGranter @@ -174,22 +170,23 @@ * SecurityAttributes.addManifestAttributes()) */ public void grantJarPermissions( + StorageSession storageSession, Uid msUID, Uid oldMSUID, - PermissionAttribute[] requestedPermissions, - AuthenticationCredentials[] authCredentials) + PermissionAttribute[] requestedPermissions) { - if (msUID == null) + if (storageSession == null + || msUID == null) { return; } + // take the domain from storage + SecurityStorage storage = new SecurityStorage(storageSession); + String protectionDomainName = storage.readProtectionDomain(msUID); // filter the already granted permissions - String protectionDomainName = authCredentials[0].getProtectionDomainName(); Object o = iGrantedPermissions.remove( - msUID.getStringValue() - + protectionDomainName); - + msUID.getStringValue() + protectionDomainName); Vector preGrantedPermissions = null; if (o != null) { @@ -217,15 +214,10 @@ } } } - // in case of update preserve the settings of the "old" suite - if (oldMSUID != null) - { - updateGrantedPermissions( - msUID, - oldMSUID, - resolvedPermissions); - } - + storage.writeGrantedPermissions( + msUID, + oldMSUID, + resolvedPermissions); // update the cache with the full set of permissions iGrantedPermissions.put(msUID.getStringValue() + protectionDomainName, resolvedPermissions); @@ -247,6 +239,7 @@ * the MIDlet suite. */ public void grantJarPermissions( + StorageSession storageSession, Uid uid, Uid oldUid, ProtectionDomain protectionDomain) @@ -271,17 +264,15 @@ protectionDomain.getName(), securityAttributes.getPermissionAttributes(), true /* add the assigned permissions */); - // in case of update preserve the settings - if (oldUid != null) - { - updateGrantedPermissions( - uid, - oldUid, - resolvedPermissions); - } - + + // store the permissions + SecurityStorage storage = new SecurityStorage(storageSession); + storage.writeGrantedPermissions( + uid, + oldUid, + resolvedPermissions); // update the cache with the full set of permissions - iGrantedPermissions.put(uid.getStringValue() + protectionDomain.getName(), + iGrantedPermissions.put(uid.getStringValue() + protectionDomain, resolvedPermissions); Logger.logGrantedPermissions(resolvedPermissions); } @@ -323,7 +314,7 @@ String key = (String)e.nextElement(); if (key.startsWith(msUidKey)) { - grantedPermissions = (Vector)iGrantedPermissions.get(key); + grantedPermissions = (Vector)iGrantedPermissions.remove(key); if (key.endsWith("UnidentifiedThirdParty")) { // if the suite is not signed, there is no blanket @@ -368,7 +359,7 @@ ((PolicyBasedPermission)grantedPermissions.elementAt(i)); UserSecuritySettings settings = permission.getUserSecuritySettings(); - if (permission.getType() != PolicyBasedPermission.USER_TYPE + if (permission.getType() != PolicyBasedPermission.USER_TYPE || settings == null) { // not a user permission -> move on to the next permission @@ -466,26 +457,15 @@ if (permissions_from_sensitive_combination_list_1 && permissions_from_sensitive_combination_list_2) { - /*String blanketPermissionsDetails = ( + String blanketPermissionsDetails = ( ((call_control == true && multimedia == true) - || (call_control == true && read_user_data == true) + || (call_control == true && read_user_data == true) || (net_access == true && multimedia == true) || (net_access == true && read_user_data == true) || (messaging == true && multimedia == true) - || (messaging == true && read_user_data == true)) ? - "settings_inst_query_perm_net" : - "settings_inst_query_perm_sec");*/ - - Id blanketPermissionsDetails = ( - ((call_control == true && multimedia == true) - || (call_control == true && read_user_data == true) - || (net_access == true && multimedia == true) - || (net_access == true && read_user_data == true) - || (messaging == true && multimedia == true) - || (messaging == true && read_user_data == true)) ? - new Id("settings_inst_query_perm_net", "N/A") : - new Id("settings_inst_query_perm_sec", "N/A")); - + || (messaging == true && read_user_data == true)) ? + "settings_inst_query_perm_net" : + "settings_inst_query_perm_sec"); iBlanketPermissionsDetails.put(msUidKey, UserSecuritySettingsImpl.getLocalizedString( blanketPermissionsDetails)); @@ -540,8 +520,6 @@ storage.writeUserSecuritySettings(msUID, UserSecuritySettings.BLANKET_INTERACTION_MODE, true /* blanket prompt shown */); - // cleanup the cache as well - cleanup(msUID); } /** @@ -554,7 +532,7 @@ iGrantedPermissions.clear(); iBlanketPermissionsDetails.clear(); } - + /** * Removes all the security data related to a certain MIDlet suite * @@ -569,25 +547,6 @@ SecurityStorage storage = new SecurityStorage(storageSession); storage.removeGrantedPermissions(msUID); // clear the cache - cleanup(msUID); - } - - /** - * Writes to storage all the security data related to a certain MIDlet suite - * - * @param sessionID the JavaStorage session to be used when - * writing the security data into storage - * @param msUID the UID if the MIDlet suite whose security data is - * being written - */ - public void addSecurityData(StorageSession storageSession, Uid msUID, Uid oldMsUID) - { - Logger.log("Write granted permissions to storage"); - if (storageSession == null || msUID == null) - { - return; - } - SecurityStorage storage = new SecurityStorage(storageSession); String msUidKey = msUID.getStringValue(); for (Enumeration e = iGrantedPermissions.keys() ; e.hasMoreElements() ;) @@ -595,13 +554,11 @@ String key = (String)e.nextElement(); if (key.startsWith(msUidKey)) { - storage.writeGrantedPermissions( - msUID, - oldMsUID, - (Vector)iGrantedPermissions.remove(key)); - return; + iGrantedPermissions.remove(key); + break; } } + iBlanketPermissionsDetails.remove(msUidKey); } private Vector resolvePermissions(Uid msUID, @@ -630,8 +587,8 @@ for (int i=0; i the runtime tamper detection is disabled"); - authStorageData.setJarHashValue(null); - iSelectedAuthCredentials.put(aMsUid, authStorageData); + AuthenticationStorageData authStorageData = + (AuthenticationStorageData)iSelectedAuthCredentials.get( + aMsUid); + if (authStorageData != null) + { + Logger.log("Suite installed on protected media -> the runtime tamper detection is disabled"); + authStorageData.setJarHashValue(null); + storage.writeAuthenticationStorageData(aMsUid, + authStorageData, + true /* this is an update */); + } } + finally + { + iSelectedAuthCredentials.remove(aMsUid); + } + } } @@ -841,23 +825,7 @@ && authStorageData.getJarHashValue().length() > 0) { Logger.log(" Doing tamper detection"); - String computedJarHash = null; - try - { - computedJarHash = _computeHash(authStorageData.getJarPath()); - }catch(AuthenticationException e) - { - if (e.getErrorCode() - == AuthenticationException.JAR_NOT_FOUND) - { - Logger.logWarning(" Jar not found while trying to compute hash"); - throw new RuntimeSecurityException( - SecurityErrorMessage.JAR_NOT_FOUND, - null, /* no params for short msg */ - SecurityDetailedErrorMessage.JAR_NOT_FOUND, - null /* no params for detailed msg */); - } - } + String computedJarHash = _computeHash(authStorageData.getJarPath()); // do the tampering check: compute the hash and compare it with the stored hash if (computedJarHash == null || !computedJarHash.equals( authStorageData.getJarHashValue())) @@ -1152,7 +1120,6 @@ private boolean isDriveProtected(int aMediaId) { DriveInfo[] allDrives = DriveUtilities.getAllDrives(); - boolean driveFound = false; if (allDrives != null) { for (int i=0; i 0) { + int rootHashLength = (data.getRootHashValue().length() > 8 + ? 8 : data.getRootHashValue().length()); entry.addAttribute(new StorageAttribute( StorageNames.CERT_HASH, - data.getRootHashValue())); + data.getRootHashValue().substring(0, + rootHashLength))); } String validCerts = encodeValidatedChainIndexes( data.getValidatedChainIndexes()); @@ -1244,6 +1249,146 @@ {/* move on with defaults */} } + + private void updateGrantedPermissions(Uid newAppUID, Uid oldAppUID, Vector grantedPermissions) + { + // the vector containing the newGrantedPermissions + Vector newGrantedPermissions = new Vector(); + + // get the old permissions & settings + Vector oldPermissions = readGrantedPermissions(oldAppUID); + + // filter out the the brand new permissions + // (permissions which are not found among the old permissions) + if (oldPermissions != null) + { + int index=0; + while (index < grantedPermissions.size()) + { + // instead of calling Vector.removeElement(p) we will do the + // remove manually, since the search is to be based on + // the permission without the settings + PolicyBasedPermission p = (PolicyBasedPermission) + grantedPermissions.elementAt(index); + int status = removeElement(oldPermissions, p); + switch (status) + { + case NOT_FOUND: + index++; + break; + case REMOVED: + grantedPermissions.removeElementAt(index); + break; + default: + // different settings + UserSecuritySettings oldSettings + = ((PolicyBasedPermission)oldPermissions + .elementAt(status)).getUserSecuritySettings(); + UserSecuritySettings newSettings + = p.getUserSecuritySettings(); + if (oldSettings != null + && newSettings != null) + { + boolean activeSettings = false; + if (oldSettings.isActive() + || newSettings.isActive()) + { + activeSettings = true; + } + newGrantedPermissions.addElement( + new PolicyBasedPermissionImpl( + p.getName(), + p.getTarget(), + p.getActionList(), + p.getType(), + new UserSecuritySettingsImpl( + newSettings.getName(), + oldSettings.getCurrentInteractionMode(), + newSettings.getAllowedInteractionModes(), + oldSettings.getBlanketPrompt(), + activeSettings))); + } + else + { + newGrantedPermissions.addElement(p); + } + grantedPermissions.removeElementAt(index); + break; + } + } + } + // write what's left from the granted permissions + writeGrantedPermissions(newAppUID, null, grantedPermissions, true /* preserveSettings */); + for (int i=0; i 0) + { + removePermissionQuery.addAttribute(new StorageAttribute( + StorageNames.NAME, + p.getTarget())); + } + if (p.getActionList() != null + && p.getActionList().length() > 0) + { + removePermissionQuery.addAttribute(new StorageAttribute( + StorageNames.ACTION, + p.getActionList())); + } + doStorageRemove(StorageNames.MIDP_PERMISSIONS_TABLE, + removePermissionQuery); + // remove the setting also if not used by some other permission + UserSecuritySettings settings = + p.getUserSecuritySettings(); + if (settings != null) + { + StorageEntry permissionsQuery = new StorageEntry(); + permissionsQuery.addAttribute(new StorageAttribute( + StorageAttribute.ID, + newAppUID.getStringValue())); + permissionsQuery.addAttribute(new StorageAttribute( + StorageNames.FUNCTION_GROUP, + settings.getName())); + StorageEntry[] permissions = doStorageSearch( + StorageNames.MIDP_PERMISSIONS_TABLE, permissionsQuery); + if (permissions == null || (permissions != null + && permissions.length == 0)) + { + // remove the orphaned settings from settings table + StorageEntry removeSettingsQuery = new StorageEntry(); + removeSettingsQuery.addAttribute(new StorageAttribute( + StorageAttribute.ID, + newAppUID.getStringValue())); + removeSettingsQuery.addAttribute(new StorageAttribute( + StorageNames.FUNCTION_GROUP, + settings.getName())); + doStorageRemove(StorageNames.MIDP_FUNC_GRP_SETTINGS_TABLE, + removeSettingsQuery); + } + } + } + } + // write the new permissions + writeGrantedPermissions(newAppUID, null, newGrantedPermissions, true /* preserveSettings */); + } + private AuthenticationStorageData readAuthenticationStorageData( Uid appUID, String aAppName, String aAppVersion, String aAppVendor, int readFilter) @@ -1696,6 +1841,41 @@ } return attrValue; } + + private int removeElement(Vector elements, PolicyBasedPermission element) + { + PolicyBasedPermissionImpl p1 = new PolicyBasedPermissionImpl( + element.getName(), + element.getTarget(), + element.getActionList(), + null); + for (int i=0; i +#include +#include +#include <../../../../inc/project_defines.hrh> +#include <../../../../inc/java_stdcpp_support_for_dll.hrh> + +target javaunicertstoreplugin.dll + +targettype PLUGIN + +uid 0x10009D8D 0x200213A3 + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +// Use bytepair compression to enable code paging +PAGED + +systeminclude /epoc32/include/ecom + +userinclude ../../../../inc + +sourcepath ../src.s60 + +source javacertstoreimpl.cpp +source javacertstoretoken.cpp +source javacertstoretokentype.cpp +source main.cpp + +start resource 200213A3.rss +target javaunicertstoreplugin.rsc +end + +START RESOURCE ../data/javausermessages.rss +HEADER +TARGETPATH /resource/java +LANGUAGE_IDS +END + +library ctframework.lib +library efsrv.lib +library estor.lib +library x509.lib +library javacomms.lib +LIBRARY CommonEngine.lib +LIBRARY aknnotify.lib + +#if defined(WINSCW) +deffile ./bwins/javaunicertstoreplugin.def +#else +deffile ./eabi/javaunicertstoreplugin.def +#endif diff -r 461e71b327da -r 0553e2305d00 javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin.pro --- a/javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin.pro Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,60 +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(../../../../inc/build_defines.pri) - -TEMPLATE=lib -TARGET=javaunicertstoreplugin -CONFIG += omj stl -CONFIG -= qt - -contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) { - CONFIG += qt hb - SOURCES += ../src.s60/confirmquery.cpp - HEADERS += ../src.s60/confirmquery.h -} -symbian { - TARGET.UID2 = 0x10009D8D - TARGET.UID3 = 0x200213A3 - TARGET.TARGETTYPE=PLUGIN - TARGET.CAPABILITY = CAP_ECOM_PLUGIN - MMP_RULES += "START RESOURCE 200213A3.rss" - MMP_RULES += "TARGETPATH /resource/plugins" - MMP_RULES += "TARGET javaunicertstoreplugin.rsc" - MMP_RULES += "END" - MMP_RULES += "START RESOURCE ../data/javausermessages.rss" - MMP_RULES += "HEADER" - MMP_RULES += "TARGETPATH /resource/java" - MMP_RULES += "LANGUAGE_IDS" - MMP_RULES += "END" - DEPENDPATH += ../src.s60 - INCLUDEPATH += ../src.s60 ../../../../inc - SOURCES += ../src.s60/javacertstoreimpl.cpp \ - ../src.s60/javacertstoretoken.cpp \ - ../src.s60/javacertstoretokentype.cpp \ - ../src.s60/main.cpp - LIBS += -lctframework \ - -lefsrv \ - -lestor \ - -lx509 \ - -ljavacomms \ - -lCommonEngine - !contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) { - LIBS += -laknnotify - } -} - -include(../../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin_0x200213A3.mmp --- a/javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin_0x200213A3.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,162 +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: Generated file - do not edit manually -* -*/ - -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) -// This file is generated by qmake and should not be modified by the -// user. -// Name : javaunicertstoreplugin.mmp -// ============================================================================== - -TARGET javaunicertstoreplugin.dll -TARGETTYPE DLL - -UID 0x10009D8D 0x200213A3 -SECUREID 0x200213A3 - -EPOCALLOWDLLDATA - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO RD_JAVA_SYMBIAN_TARGET -MACRO RD_JAVA_S60_RELEASE_9_2 -MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS -MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS -MACRO RD_JAVA_STDCPPV5 -MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX -MACRO RD_JAVA_HTTP_EMC_ENABLED -MACRO RD_JAVA_NGA_ENABLED -MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED -MACRO RD_JAVA_OPENC_BETA_PATCH -MACRO RD_JAVA_INSTALLERUI_ENABLED -MACRO RD_JAVA_PREWARM -MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK -MACRO RD_JAVA_MIDPRMS_DB -MACRO __SYMBIAN32__ -MACRO J9EPOC32 - -SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../src.s60 -SYSTEMINCLUDE ../../../../inc -SYSTEMINCLUDE ../../inc -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE . - -SOURCEPATH ../src.s60 -SOURCE javacertstoreimpl.cpp -SOURCE javacertstoretoken.cpp -SOURCE javacertstoretokentype.cpp -SOURCE main.cpp - - -LIBRARY ctframework.lib -LIBRARY efsrv.lib -LIBRARY estor.lib -LIBRARY x509.lib -LIBRARY javacomms.lib -LIBRARY CommonEngine.lib -LIBRARY aknnotify.lib -LIBRARY javautils.lib -LIBRARY libpthread.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib -LIBRARY apgrfx.lib - -CAPABILITY all -tcb - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden -#if defined(ARMCC_4_0) -OPTION ARMCC --import_all_vtbl -#endif -OPTION GCCE -fvisibility-inlines-hidden - -VERSION 10.0 - -ARMFPU softvfp - -PAGED - -BYTEPAIRCOMPRESSTARGET - -USERINCLUDE . - -START RESOURCE 200213A3.rss - -TARGETPATH /resource/plugins - -TARGET javaunicertstoreplugin.rsc - -END - -START RESOURCE ../data/javausermessages.rss - -HEADER - -TARGETPATH /resource/java - -LANGUAGE_IDS - -END - -#include - - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - -deffile ./~/javaunicertstoreplugin.def - - SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) - -SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah - -#ifdef WINSCW - -LIBRARY ewsd.lib - -#endif - -STDCPP - -#ifdef WINSCW -DEFFILE ./bwins/javaunicertstoreplugin.def -#elif defined EABI -DEFFILE ./eabi/javaunicertstoreplugin.def -#endif diff -r 461e71b327da -r 0553e2305d00 javacommons/security/javaunicertstoreplugin/src.s60/200213A3.rss --- a/javacommons/security/javaunicertstoreplugin/src.s60/200213A3.rss Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/javaunicertstoreplugin/src.s60/200213A3.rss Fri Oct 22 14:23:56 2010 +0100 @@ -18,7 +18,7 @@ // INCLUDES -#include +#include #include // Some defines of useful values for attributes to simplify diff -r 461e71b327da -r 0553e2305d00 javacommons/security/javaunicertstoreplugin/src.s60/confirmquery.cpp --- a/javacommons/security/javaunicertstoreplugin/src.s60/confirmquery.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +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: -* -*/ -#include "confirmquery.h" -#include -#include - -using namespace java::security; - -ConfirmQuery::ConfirmQuery() - : mAsyncToSyncCallEventLoop(0), mQueryAccepted(false) -{ - mAsyncToSyncCallEventLoop = new QEventLoop(); -} - -bool ConfirmQuery::accept(const QString& aQuery) -{ - HbMessageBox confirmQuery(HbMessageBox::MessageTypeQuestion); - confirmQuery.setDismissPolicy(HbDialog::NoDismiss); - confirmQuery.setTimeout(HbDialog::NoTimeout); - confirmQuery.setIconVisible(false); - confirmQuery.setText(aQuery); - confirmQuery.setAttribute(Qt::WA_DeleteOnClose); - confirmQuery.setStandardButtons(HbMessageBox::Yes | HbMessageBox::No); - confirmQuery.open(this,SLOT(queryDismissed(int))); - mAsyncToSyncCallEventLoop->exec(); - return mQueryAccepted; -} - -void ConfirmQuery::queryDismissed(int dismissAction) -{ - if (dismissAction == HbMessageBox::Yes) { - mQueryAccepted = true; - } - mAsyncToSyncCallEventLoop->exit(); -} - -ConfirmQuery::~ConfirmQuery() -{ - delete mAsyncToSyncCallEventLoop; -} - -#include "moc_confirmquery.cpp" diff -r 461e71b327da -r 0553e2305d00 javacommons/security/javaunicertstoreplugin/src.s60/confirmquery.h --- a/javacommons/security/javaunicertstoreplugin/src.s60/confirmquery.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +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: -* -*/ -#ifndef CONFIRMQUERY_H -#define CONFIRMQUERY_H - -#include - -namespace java -{ -namespace security -{ - -class ConfirmQuery: public QObject -{ - Q_OBJECT - -public: - ConfirmQuery(); - bool accept(const QString& aQuery); - virtual ~ConfirmQuery(); - -private slots: - void queryDismissed(int dismissAction); - -private: - // own event loop used for "translating" asynchronous calls into - // synchronous calls - QEventLoop* mAsyncToSyncCallEventLoop; - // boolean for carying the user's input in between two async calls - bool mQueryAccepted; -}; - -} // end namespace security -} // end namespace java - -#endif //CONFIRMQUERY_H diff -r 461e71b327da -r 0553e2305d00 javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.cpp --- a/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -20,6 +20,8 @@ #include +#include +#include #include #include #include @@ -41,12 +43,6 @@ #include "s60commonutils.h" #include "securitycommsmessagedefs.h" -#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS -#include "confirmquery.h" -#else -#include -#include -#endif //_LIT(KMIDP2TrustRoot, "J2ME MIDP2 Trust Root"); @@ -64,11 +60,8 @@ * */ CJavaCertStoreImpl::CJavaCertStoreImpl(CJavaCertStoreToken& aToken) - : CActive(EPriorityNormal),mToken(aToken),mClientStatus(NULL),mState(EInitial),mTempCertData(0) + : CActive(EPriorityNormal),mToken(aToken),mClientStatus(NULL),mState(EInitial),mQuery(0),mTempCertData(0) { -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS - mQuery.reset(0); -#endif } /** @@ -82,6 +75,7 @@ Cancel(); } + mComms.unregisterListener(PLUGIN_ID_JAVA_CERT_STORE_ECOM_C,this); mComms.unregisterDefaultListener(this); mComms.disconnect(); mCertsData.ResetAndDestroy(); @@ -182,7 +176,7 @@ case EPreDeleting: SendDeleteMsg(status); return; - + default: //Do nothing. break; @@ -257,7 +251,7 @@ User::RequestComplete(pRequestStatus,KErrArgument); return; } - + mState = EPreDeleting; mTempCertData = certData; HandleDeleteDisableQuery(aStatus, false /* disableCertQuery */); @@ -394,7 +388,7 @@ TBool validRequest = validateCertAttrFilter(aFilter); if (!validRequest) { - LOG(EJavaSecurity, EInfo, "No certificates matching the filter supplied"); + ELOG(EJavaSecurity,"No certificates matching the filter supplied"); User::RequestComplete(pRequestStatus,KErrNone); return; } @@ -496,13 +490,12 @@ return; } - TInt err = KErrNone; if (!certData->mIsDisabled) { - err = aApplications.Append(KMidletInstallApplicabilityUid); + aApplications.Append(KMidletInstallApplicabilityUid); } - User::RequestComplete(pRequestStatus, err); + User::RequestComplete(pRequestStatus,KErrNone); } /** @@ -843,7 +836,7 @@ User::RequestComplete(aRequestStatus,KErrCommsBreak); return EFalse; } - + return ETrue; } @@ -884,9 +877,7 @@ SetActive(); return; } -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS delete mQuery.release(); -#endif mState = EInitial; TRequestStatus* pRequestStatus = &aRequestStatus; User::RequestComplete(pRequestStatus,KErrCancel); @@ -903,24 +894,8 @@ std::auto_ptr reader(CStringResourceReader::NewL(resourceFileName)); std::auto_ptr queryPrompt(reader->ReadResourceString(resourceId).AllocL()); -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS mQuery.reset(CAknGlobalConfirmationQuery::NewL()); mQuery->ShowConfirmationQueryL(iStatus,queryPrompt->Des(),R_AVKON_SOFTKEYS_OK_CANCEL); -#else - int completeStatus = KErrCancel; - ConfirmQuery* query = new ConfirmQuery(); - QString queryText = QString::fromStdWString( - std::wstring((wchar_t*) queryPrompt->Ptr(), - queryPrompt->Length())); - if (query->accept(queryText)) - { - completeStatus = KErrNone; - } - delete query; query = NULL; - TRequestStatus* status = &iStatus; - User::RequestComplete(status, completeStatus); -#endif - } /** @@ -930,15 +905,9 @@ { mState = EInitial; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS delete mQuery.release(); -#endif mState = EInitial; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS if (EAknSoftkeyOk != aStatus) -#else - if (KErrNone != aStatus) -#endif { User::RequestComplete(mClientStatus,KErrCancel); return; @@ -953,15 +922,9 @@ { mState = EInitial; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS delete mQuery.release(); -#endif mState = EInitial; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS if (EAknSoftkeyOk != aStatus) -#else - if (KErrNone != aStatus) -#endif { User::RequestComplete(mClientStatus,KErrCancel); return; @@ -1009,7 +972,7 @@ //operation in the error situation. return; } - aCertDataObj.mDeleted = ETrue; + aCertDataObj.mDeleted = ETrue; User::RequestComplete(aRequestStatus,KErrNone); } diff -r 461e71b327da -r 0553e2305d00 javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.h --- a/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.h Fri Oct 22 14:23:56 2010 +0100 @@ -24,9 +24,7 @@ #include "commsclientendpoint.h" #include "commsmessage.h" -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS class CAknGlobalConfirmationQuery; -#endif namespace java { @@ -70,7 +68,8 @@ }; class CJavaCertStoreImpl: public CActive, public MCTWritableCertStore, - public java::comms::CommsListener + public java::comms::CommsListener, + public java::comms::CommsClientEndpoint { public: @@ -144,9 +143,7 @@ RPointerArray mCertsData; TState mState; RThread mUiThread; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS std::auto_ptr mQuery; -#endif //This class does not have ownership into this object. CJavaCertData* mTempCertData; diff -r 461e71b327da -r 0553e2305d00 javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/build/MIDP2SecurityPolicyV2Dll.mmp --- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/build/MIDP2SecurityPolicyV2Dll.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/build/MIDP2SecurityPolicyV2Dll.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -21,11 +21,9 @@ @SYMPurpose MIDP2SecurityPolicyV2.dll Java security policy interface implementation */ -#include + #include <../../../../../../../inc/project_defines.hrh> -APP_LAYER_SYSTEMINCLUDE - target MIDP2SecurityPolicyV2.dll targettype dll CAPABILITY CAP_GENERAL_DLL @@ -44,6 +42,10 @@ deffile ./midp2secrp/eabi/MIDP2SecurityPolicyV2.def #endif +systeminclude /epoc32/include +systeminclude /epoc32/include/libc + +systeminclude ../../../../../../../inc userinclude ../export userinclude ../../../../../../../inc diff -r 461e71b327da -r 0553e2305d00 javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.cpp --- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -61,9 +61,9 @@ } -void CBlanketPermissionPolicy::AddL(const CBlanketPermissionPolicyElement *aElement) +void CBlanketPermissionPolicy::Add(const CBlanketPermissionPolicyElement *aElement) { - iPolicyElements.AppendL(aElement); + iPolicyElements.Append(aElement); } diff -r 461e71b327da -r 0553e2305d00 javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.h --- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.h Fri Oct 22 14:23:56 2010 +0100 @@ -49,7 +49,7 @@ static CBlanketPermissionPolicy* NewL(); - void AddL(const CBlanketPermissionPolicyElement *); + void Add(const CBlanketPermissionPolicyElement *); // MBlanketPermissionPolicy virtual TInt GetPolicyElementCount() const ; diff -r 461e71b327da -r 0553e2305d00 javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/SimpleMapping.cpp --- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/SimpleMapping.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/SimpleMapping.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -61,7 +61,7 @@ for (TInt i = 0; i < count; i++) { - iMapping.AppendL(aMapping[i]); + iMapping.Append(aMapping[i]); } } diff -r 461e71b327da -r 0553e2305d00 javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/XPFParser.cpp --- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/XPFParser.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/XPFParser.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -385,8 +385,8 @@ //Add the sets and permission downgrade policy to the //CBlanketPermissionPolicy object for this domain - aBlanketPermissionPolicy->AddL(pe); CleanupStack::Pop(pe); + aBlanketPermissionPolicy->Add(pe); DEBUG("CXPFParser::ExclusionSetL() - Exit"); } diff -r 461e71b327da -r 0553e2305d00 javacommons/security/legacysupport/midp2userpreferences/build/midp2userpreferences.pro --- a/javacommons/security/legacysupport/midp2userpreferences/build/midp2userpreferences.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/legacysupport/midp2userpreferences/build/midp2userpreferences.pro Fri Oct 22 14:23:56 2010 +0100 @@ -19,7 +19,11 @@ CONFIG += omj stl CONFIG -= qt -INCLUDEPATH += ../../storageutils/inc +INCLUDEPATH += /epoc32/include/j2me/midp2/data \ + ../../../../../inc/j2me/midp2/security \ + ../../../../../inc/j2me/midp2/runtime \ + ../../../../../inc/j2me/midp2/dbv2 \ + ../../storageutils/inc SOURCES += ../../storageutils/src/*.cpp \ ../src/*.cpp diff -r 461e71b327da -r 0553e2305d00 javacommons/security/legacysupport/midp2userpreferences/src/MIDP2UserPreferences.cpp --- a/javacommons/security/legacysupport/midp2userpreferences/src/MIDP2UserPreferences.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/legacysupport/midp2userpreferences/src/MIDP2UserPreferences.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -22,8 +22,8 @@ #include "UserPreferencesIterator.h" #include "MIDletSuiteUserPreferences.h" #include "MIDletSuiteCustomAttributes.h" -#include "MUserSecurityPreferencesTable.h" -#include "j2me/midp2/security/MSecurityPolicyV2.h" +#include +#include #include "SecurityPreferences.h" #include "javauid.h" diff -r 461e71b327da -r 0553e2305d00 javacommons/security/legacysupport/tsrc/build/securitylegacysupportunittests.mmp --- a/javacommons/security/legacysupport/tsrc/build/securitylegacysupportunittests.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/legacysupport/tsrc/build/securitylegacysupportunittests.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -22,6 +22,11 @@ #include <../../../../../inc/java_stdcpp_support_for_exe.hrh> #include +SYSTEMINCLUDE /epoc32/include +SYSTEMINCLUDE ../../../../../inc/j2me/midp2/security +SYSTEMINCLUDE ../../../../../inc/j2me/midp2/data +SYSTEMINCLUDE ../../../../../inc/j2me/midp2/runtime + USERINCLUDE ../../../../../tools/cpputest/include/cpputest USERINCLUDE ../../../../../tools/cpputest/include/platforms/symbian USERINCLUDE ../../../../../inc diff -r 461e71b327da -r 0553e2305d00 javacommons/security/legacysupport/tsrc/src/testpermissiondb.cpp --- a/javacommons/security/legacysupport/tsrc/src/testpermissiondb.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/legacysupport/tsrc/src/testpermissiondb.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -23,7 +23,7 @@ #include "javastoragenames.h" #include "javauid.h" -#include "j2me/midp2/security/midp2permissiondb.h" +#include using namespace MIDP; using namespace java::storage; diff -r 461e71b327da -r 0553e2305d00 javacommons/security/legacysupport/tsrc/src/testsecuritypolicy.cpp --- a/javacommons/security/legacysupport/tsrc/src/testsecuritypolicy.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/legacysupport/tsrc/src/testsecuritypolicy.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -20,7 +20,7 @@ #include "TestHarness.h" -#include "j2me/midp2/security/msecuritypolicyv2.h" +#include using namespace MIDP; diff -r 461e71b327da -r 0553e2305d00 javacommons/security/legacysupport/tsrc/src/testuserpreferences.cpp --- a/javacommons/security/legacysupport/tsrc/src/testuserpreferences.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/legacysupport/tsrc/src/testuserpreferences.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -25,11 +25,11 @@ #include "javauid.h" #include "javasymbianoslayer.h" -#include "j2me/midp2/data/muserpreferences.h" -#include "j2me/midp2/data/mmidletsuiteuserpreferencesiterator.h" -#include "j2me/midp2/data/mmidletsuiteuserpreferences.h" -#include "j2me/midp2/data/mmidletsuitecustomattributes.h" -#include "j2me/midp2/security/msecuritypolicyv2.h" +#include +#include +#include +#include +#include using namespace MIDP; using namespace java::storage; diff -r 461e71b327da -r 0553e2305d00 javacommons/security/security.pro --- a/javacommons/security/security.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/security.pro Fri Oct 22 14:23:56 2010 +0100 @@ -15,5 +15,5 @@ # TEMPLATE = subdirs SUBDIRS += build/javasecurity.pro -SUBDIRS += javaunicertstoreplugin/build/javaunicertstoreplugin.pro +BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javaunicertstoreplugin/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 461e71b327da -r 0553e2305d00 javacommons/security/src.s60/fileutils.cpp --- a/javacommons/security/src.s60/fileutils.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/src.s60/fileutils.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -65,7 +65,7 @@ if (err == KErrNone) { // figure out the size of the file - TInt size = 0; + TInt size; if (drmContent) { TRAP(err, cafData->DataSizeL(size)); diff -r 461e71b327da -r 0553e2305d00 javacommons/security/src.s60/telutils.cpp --- a/javacommons/security/src.s60/telutils.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/src.s60/telutils.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -76,19 +76,6 @@ return sec.Int(); } -/** - * Return 0 if secure time has not been set - */ -int TelUtils::isSecureTimeSet() -{ - TTime t; - if (KErrNoSecureTime == t.UniversalTimeSecure()) - { - return 0; - } - return 1; -} - void TelUtils::ConstructL() { RMobilePhone::TMobilePhoneIdentityV1 phoneId; diff -r 461e71b327da -r 0553e2305d00 javacommons/security/src.s60/telutils.h --- a/javacommons/security/src.s60/telutils.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/src.s60/telutils.h Fri Oct 22 14:23:56 2010 +0100 @@ -36,7 +36,6 @@ void getNetworkCodes(std::string& mnc, std::string& mcc); void getImei(std::string& imei); static signed int getSecureTime(); - static int isSecureTimeSet(); virtual ~TelUtils(); private: //Methods diff -r 461e71b327da -r 0553e2305d00 javacommons/security/src/midpauthenticationmoduleimpl.cpp --- a/javacommons/security/src/midpauthenticationmoduleimpl.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/src/midpauthenticationmoduleimpl.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -40,7 +40,6 @@ #include #include #include -#include using namespace java::security; using namespace java::storage; @@ -54,7 +53,7 @@ /* forward declarations of local/private methods */ static int verify_callback(int, X509_STORE_CTX *); int getErrCode(int); -int verifyCertChain(char **, int, const unsigned char *, int, vector CAs, char *, char *, CERT_DETAILS*); +int verifyCertChain(char **, int, const unsigned char *, int, vector CAs, char *, char *, char *, CERT_DETAILS*); JNIEXPORT jobjectArray JNICALL Java_com_nokia_mj_impl_security_midp_authentication_AuthenticationModule__1validateChainsAndSignatures (JNIEnv * env, jobject, jobjectArray authInfos) @@ -77,6 +76,7 @@ AUTH_INFO* authInfo = NULL; char * jar_hash = NULL; char * root_hash = NULL; + char * root_id = NULL; int validation_result = KDefault; for (int i=0; icert_chain, authInfo->cert_chain_len, (const unsigned char *)authInfo->signature, authInfo->signature_len, CAs, jar_hash, - root_hash, details); + root_hash, root_id, details); if (chain_verification_result == KCertAndSignatureOk) { validation_result = KCertAndSignatureOk; auth_credentials = new AUTH_CREDENTIALS(); auth_credentials->jar_hash = new char[2*SHA_1_DIGEST_LEN + 1]; auth_credentials->root_hash = new char[MD5_DIGEST_LEN + 1]; + auth_credentials->root_id = new char[2*SHA_1_DIGEST_LEN + 1]; memmove(auth_credentials->jar_hash, jar_hash, 2*SHA_1_DIGEST_LEN + 1); memmove(auth_credentials->root_hash, root_hash, MD5_DIGEST_LEN + 1); + memmove(auth_credentials->root_id, root_id, 2*SHA_1_DIGEST_LEN + 1); auth_credentials->chain_index = i+1; auth_credentials->signing_cert = details; all_auth_credentials.push_back(auth_credentials); @@ -115,6 +119,8 @@ jar_hash = NULL; delete[] root_hash; root_hash = NULL; + delete[] root_id; + root_id = NULL; // just record the failure of the chain validation if (chain_verification_result > validation_result) { @@ -179,9 +185,19 @@ std::string protection_domain_name; std::string protection_domain_category; JavaCertStoreHandler::retrieveRootProtDomainInfo( - all_auth_credentials[i]->root_hash, + all_auth_credentials[i]->root_id, protection_domain_name, protection_domain_category); + if (strcmp(protection_domain_name.c_str(),"") == 0) + { + // clean up the root_id + delete[] all_auth_credentials[i]->root_id; + all_auth_credentials[i]->root_id = NULL; + JavaCertStoreHandler::retrieveRootProtDomainInfo( + all_auth_credentials[i]->root_hash, + protection_domain_name, + protection_domain_category); + } if (strcmp(protection_domain_name.c_str(),"")) { // DeveloperCertificates: if domain_category is manufacturer and we have predefined_domain_category use the predefined one @@ -253,13 +269,6 @@ jar_hash_value = NULL; return hash; } - else - { - if (errno == ENOENT) - { - SecurityUtils::throw_exception(env, "JAR_NOT_FOUND"); - } - } return NULL; } @@ -401,7 +410,7 @@ int verifyCertChain(char **cert_chain, int no_certs, const unsigned char * sig, int sig_len, vector CAs, char * jar_hash, - char * root_hash, CERT_DETAILS* details) + char * root_hash, char * root_id, CERT_DETAILS* details) { X509 *end_entity_cert; X509_STORE_CTX *x509_ctx = NULL; @@ -494,6 +503,7 @@ if (user_cert != NULL) { sprintf(root_hash,"%08lX",X509_issuer_name_hash(user_cert)); + SecurityUtils::computePublicKeyHash(user_cert, root_id); X509_free(user_cert); ret_code = KCertAndSignatureOk; } @@ -535,12 +545,18 @@ } // compute the root hash value if requested - if (x509_ctx->current_issuer != NULL) + if (x509_ctx->chain != NULL) { - sprintf(root_hash,"%08lX",X509_issuer_name_hash(x509_ctx->current_issuer)); + X509* root = sk_X509_value(x509_ctx->chain,sk_X509_num(x509_ctx->chain) - 1); + if (root != NULL) + { + sprintf(root_hash,"%08lX",X509_issuer_name_hash(root)); + SecurityUtils::computePublicKeyHash(root, root_id); + } } // add the '\0' root_hash[MD5_DIGEST_LEN] = '\0'; + root_id[SHA_1_DIGEST_LEN] = '\0'; // 1. get the public key of the signing cert // 2. decode the provided signature using the signing cert's public key diff -r 461e71b327da -r 0553e2305d00 javacommons/security/src/utils/securityutils.cpp --- a/javacommons/security/src/utils/securityutils.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/src/utils/securityutils.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -423,8 +423,17 @@ all_auth_credentials[i]->signing_cert = NULL; jstring j_jar_hash_value = env->NewStringUTF(all_auth_credentials[i]->jar_hash); - jstring j_root_hash_value = - env->NewStringUTF(all_auth_credentials[i]->root_hash); + jstring j_root_hash_value; + if (all_auth_credentials[i]->root_id != NULL) + { + j_root_hash_value = + env->NewStringUTF(all_auth_credentials[i]->root_id); + } + else + { + j_root_hash_value = + env->NewStringUTF(all_auth_credentials[i]->root_hash); + } jstring j_protection_domain_name = NULL; if (all_auth_credentials[i]->domain_name != NULL) { @@ -455,6 +464,11 @@ all_auth_credentials[i]->jar_hash = NULL; delete[] all_auth_credentials[i]->root_hash; all_auth_credentials[i]->root_hash = NULL; + if (all_auth_credentials[i]->root_id != NULL) + { + delete[] all_auth_credentials[i]->root_id; + all_auth_credentials[i]->root_id = NULL; + } delete all_auth_credentials[i]; all_auth_credentials[i] = NULL; env->SetObjectArrayElement(result, i, auth_credentials); @@ -464,6 +478,22 @@ return result; } +void SecurityUtils::computePublicKeyHash(X509 * x, char * pkey_hash) +{ + unsigned char tmp[SHA_1_DIGEST_LEN]; + EVP_Digest(x->cert_info->key->public_key->data, + x->cert_info->key->public_key->length, tmp, NULL, EVP_sha1(), NULL); + char * tmp_pkey_hash = NULL; + tmp_pkey_hash = pkey_hash; + for (int i=0; i); + static void computePublicKeyHash(X509 *, char *); private: static bool checkIMEI(const X509_EXTENSION *, const char *); static char * computeDigest1(const char*); diff -r 461e71b327da -r 0553e2305d00 javacommons/security/src/utils/storagehandler.cpp --- a/javacommons/security/src/utils/storagehandler.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/src/utils/storagehandler.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -163,7 +163,7 @@ { aCerts.push_back(JavaCommonUtils::wstringToInt(aValue)); } - catch (ExceptionBase& eb) + catch (ExceptionBase eb) { WLOG1WSTR(EJavaStorage, "Invalid cert index skipped: %s", aValue); diff -r 461e71b327da -r 0553e2305d00 javacommons/security/subsystem.mk --- a/javacommons/security/subsystem.mk Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/subsystem.mk Fri Oct 22 14:23:56 2010 +0100 @@ -17,14 +17,16 @@ include $(JAVA_SRC_ROOT)/build/Makefile.defs COMPONENTS = \ - build \ - javaunicertstoreplugin/build + build ifdef RD_JAVA_S60_RELEASE_5_0_IAD SUBSYSTEMS = \ legacysupport endif +NONQTSUBSYSTEMS = \ + javaunicertstoreplugin/build + SYMBIAN_ONLY = \ javaunicertstoreplugin/build ifdef RD_JAVA_S60_RELEASE_5_0_IAD diff -r 461e71b327da -r 0553e2305d00 javacommons/security/tsrc/data/ext1/ext1.odc --- a/javacommons/security/tsrc/data/ext1/ext1.odc Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/tsrc/data/ext1/ext1.odc Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ [properties] -Dcom.nokia.mj.addon.protected.ext1=com.nokia.mj.impl.,com.nokia.ext1.internal.,java.security. -Dcom.nokia.mj.addon.restricted.ext1=com.nokia.ext1.public.,com.nokia.mj.impl. --Dcom.nokia.mj.addon.permissions.ext1=com.nokia.ext1.public.Ext1Perm,com.nokia.mj.impl.gcf.protocol.socket.SocketPermissionImpl;javax.microedition.io.Connector.socket,com.nokia.ext1.internal.Ext1Perm;com.nokia.ext1.public.Ext1Perm,com.nokia.ext1.internal.Ext1Perm; +-Dcom.nokia.mj.addon.permissions.ext1=com.nokia.ext1.public.Ext1Perm,com.nokia.mj.impl.gcf.protocol.socket.SocketPermissionImpl;javax.microedition.io.Connector.socket,com.nokia.ext1.internal.Ext1Perm;com.nokia.ext1.public.Ext1Perm,com.nokia.ext1.internal.Ext1Perm,*; -Dcom.nokia.mj.addon.policies.ext1=c:\resource\java\security\extensions\ext1\policies\untrusted.ser;c:\resource\java\security\extensions\ext1\policies\trustedthirdparty.ser; \ No newline at end of file diff -r 461e71b327da -r 0553e2305d00 javacommons/security/tsrc/data/ext2/ext2.odc --- a/javacommons/security/tsrc/data/ext2/ext2.odc Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/tsrc/data/ext2/ext2.odc Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ [properties] -Dcom.nokia.mj.addon.protected.ext2=com.nokia.ext2.internal.,com.nokia.ext1.public -Dcom.nokia.mj.addon.restricted.ext2=com.nokia.ext2.public.,com.nokia.ext1.internal --Dcom.nokia.mj.addon.permissions.ext2=com.nokia.ext2.public.Ext2Perm,com.nokia.ext1.internal.Ext1Perm;com.nokia.ext1.public.Ext1Perm,com.nokia.ext2.internal.Ext2Perm;com.nokia.ext2.public.Ext2Perm,com.nokia.ext2.internal.Ext2Perm +-Dcom.nokia.mj.addon.permissions.ext2=com.nokia.ext2.public.Ext2Perm,com.nokia.ext1.internal.Ext1Perm;com.nokia.ext1.public.Ext1Perm,com.nokia.ext2.internal.Ext2Perm;com.nokia.ext2.public.Ext2Perm,com.nokia.ext2.internal.Ext2Perm,* -Dcom.nokia.mj.addon.policies.ext2=c:\resource\java\security\extensions\ext2\policies\trustedthirdparty.ser diff -r 461e71b327da -r 0553e2305d00 javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/OMJSecurityTests.java --- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/OMJSecurityTests.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/OMJSecurityTests.java Fri Oct 22 14:23:56 2010 +0100 @@ -196,11 +196,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); signingCerts = authenticationModule.getCertificatesDetails(session, appUID); assertWithTrace(signingCerts != null && signingCerts.length == 1 @@ -243,11 +241,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); signingCerts = authenticationModule.getCertificatesDetails(session, appUID); assertWithTrace(signingCerts != null && signingCerts.length == 1 @@ -289,11 +285,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICWDCCAcECBEhQwA0wDQYJKoZIhvcNAQEEBQAwczELMAkGA1UEBhMCZmkxEjAQBgNVBAgTCVBpcmthbm1hYTEQMA4GA1UEBxMHVGFtcGVyZTEOMAwGA1UEChMFTm9raWExDTALBgNVBAsTBEphdmExHzAdBgNVBAMMFkpQX0RldmljZV9NYW51ZmFjdHVyZXIwHhcNMDgwNjEyMDYxOTU3WhcNMTgwNjEwMDYxOTU3WjBzMQswCQYDVQQGEwJmaTESMBAGA1UECBMJUGlya2FubWFhMRAwDgYDVQQHEwdUYW1wZXJlMQ4wDAYDVQQKEwVOb2tpYTENMAsGA1UECxMESmF2YTEfMB0GA1UEAwwWSlBfRGV2aWNlX01hbnVmYWN0dXJlcjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApi3ipIPj8O33/rZre1euh7Itd9d6ZVf2mvQ/tLpHEsFJe5XLOsVViMvFskhhKUzmDsRbP4J03L6827/vEDIi/1i8kJGLaoFqJYaLGFWI2Zmxlj6aJV8cfZyOjmQPWJn1IDEe1ZAWbvMSp8xibWRsCLNEGKIkxQvAr/QDK/6iS+kCAwEAATANBgkqhkiG9w0BAQQFAAOBgQCDXt6klAs6yKvdTab3D2wkdoi3Lu4YFsMgLexJOu5HhAUJ/9VYO+Q2+mjd95MRsTa5rWQ2Jjvhn57Z3z/KBOwfHbymmNtMk6Gl14H0vQRoHa31jh3mTuAy5KotDVthaDp30aOizk473NU68wY1WdP4gFk5ZhrpNea9q3st13BxIQ==")); @@ -307,11 +301,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID2,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID2, null); - permissionGranter.grantJarPermissions( appUID2, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID2,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID2, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID2, null); // 2 legacy unsigned MIDlets, install from JAD -> checkPermission succeeds storage.removeAuthenticationStorageData(appUID); permissionGranter.removeSecurityData(session,appUID); @@ -325,11 +317,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); signingCerts = authenticationModule.getCertificatesDetails(session, appUID); assertWithTrace(signingCerts == null); ac.checkPermission(new java.util.PropertyPermission("microedition.version", "read")); @@ -341,11 +331,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); securityAttributes = new SecurityAttributes(); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); signingCerts = authenticationModule.getCertificatesDetails(session, appUID); assertWithTrace(signingCerts == null); ac.checkPermission(new java.util.PropertyPermission("microedition.version", "read")); @@ -368,8 +356,7 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); storage.removeAuthenticationStorageData(appUID2); permissionGranter.removeSecurityData(session,appUID2); PermissionResolver.testClearCache(); @@ -401,11 +388,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); storage.removeAuthenticationStorageData(appUID2); permissionGranter.removeSecurityData(session,appUID2); PermissionResolver.testClearCache(); @@ -441,11 +426,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); storage.removeAuthenticationStorageData(appUID2); permissionGranter.removeSecurityData(session,appUID2); PermissionResolver.testClearCache(); @@ -471,11 +454,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); storage.removeAuthenticationStorageData(appUID2); permissionGranter.removeSecurityData(session,appUID2); PermissionResolver.testClearCache(); @@ -494,11 +475,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID2,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID2, appUID); - permissionGranter.grantJarPermissions( appUID2, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID2,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID2, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID2, null); // update from manufacturer to operator succeeds for legacy suites storage.removeAuthenticationStorageData(appUID); permissionGranter.removeSecurityData(session,appUID); @@ -516,8 +495,7 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); storage.removeAuthenticationStorageData(appUID2); permissionGranter.removeSecurityData(session,appUID2); PermissionResolver.testClearCache(); @@ -547,11 +525,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); appPackageEntry = new StorageEntry(); appPackageEntry.addAttribute(new StorageAttribute( StorageAttribute.ID, @@ -580,11 +556,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID2,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID2, appUID); - permissionGranter.grantJarPermissions( appUID2, appUID, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID2,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID2, appUID, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID2, appUID); // update from identified third party to identified third party but with different organization for signing certificate fails for MIDP3 MIDlets storage.removeAuthenticationStorageData(appUID); permissionGranter.removeSecurityData(session,appUID); @@ -599,8 +573,7 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); appPackageEntry = new StorageEntry(); appPackageEntry.addAttribute(new StorageAttribute( StorageAttribute.ID, @@ -650,11 +623,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); appPackageEntry = new StorageEntry(); appPackageEntry.addAttribute(new StorageAttribute( StorageAttribute.ID, @@ -683,11 +654,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID2,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID2, appUID); - permissionGranter.grantJarPermissions( appUID2, appUID, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID2,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID2, appUID, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID2, appUID); // update from identified third party to identified third party succeeds (V1 requests P1 (Net), P2 (Messaging), P3 (Messaging), V2 requests P2 (Messaging), P4 (UserData), P5 (Net)) -> check that P1 is removed, P2 is retained (with old settings), P3 is removed, P4 and P5 are added with brand new settings storage.removeAuthenticationStorageData(appUID); permissionGranter.removeSecurityData(session,appUID); @@ -705,11 +674,10 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.wireless.messaging.sms.send,javax.wireless.messaging.mms.send")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.getBlanketPermissions(appUID); appPackageEntry = new StorageEntry(); appPackageEntry.addAttribute(new StorageAttribute( StorageAttribute.ID, @@ -738,11 +706,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.wireless.messaging.sms.send,javax.microedition.io.Connector.file.read,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, appUID); - permissionGranter.grantJarPermissions( appUID, appUID, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, appUID, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, appUID); grantedPermissions = storage.readGrantedPermissions(appUID); MIDPPermission p1 = PermissionMappingTable.get("javax.wireless.messaging.sms.send"); MIDPPermission p2 = PermissionMappingTable.get("javax.microedition.io.Connector.file.read"); @@ -758,7 +724,7 @@ UserSecuritySettings.NO_INTERACTION_MODE, UserSecuritySettings.ONESHOT_INTERACTION_MODE, UserSecuritySettings.SESSION_INTERACTION_MODE})), - new PolicyBasedPermissionImpl(p2.getName(), p2.getTarget(), p2.getActionList(), + new PolicyBasedPermissionImpl(p2.getName(), "*", p2.getActionList(), new UserSecuritySettingsImpl("Read User Data Access", UserSecuritySettings.SESSION_INTERACTION_MODE, new int[]{UserSecuritySettings.BLANKET_INTERACTION_MODE, @@ -814,11 +780,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.wireless.messaging.sms.send,javax.wireless.messaging.mms.send")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); assertWithTrace(checkStringArrays(blanketPermissions, new String[] {UserSecuritySettingsImpl.getLocalizedName(UserSecuritySettings.NET_ACCESS_SETTINGS), UserSecuritySettingsImpl.getLocalizedName(UserSecuritySettings.MESSAGING_SETTINGS) @@ -850,11 +814,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.wireless.messaging.sms.send,javax.microedition.io.Connector.file.read,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, appUID); - permissionGranter.grantJarPermissions( appUID, appUID, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, appUID, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, appUID); assertWithTrace(checkStringArrays(blanketPermissions, new String[] {UserSecuritySettingsImpl.getLocalizedName(UserSecuritySettings.NET_ACCESS_SETTINGS), UserSecuritySettingsImpl.getLocalizedName(UserSecuritySettings.MESSAGING_SETTINGS), @@ -877,11 +839,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.wireless.messaging.sms.send,javax.wireless.messaging.mms.send")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); assertWithTrace(checkStringArrays(blanketPermissions, new String[] {UserSecuritySettingsImpl.getLocalizedName(UserSecuritySettings.NET_ACCESS_SETTINGS), UserSecuritySettingsImpl.getLocalizedName(UserSecuritySettings.MESSAGING_SETTINGS) @@ -912,11 +872,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.wireless.messaging.sms.send,javax.microedition.io.Connector.file.read,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, appUID); - permissionGranter.grantJarPermissions( appUID, appUID, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, appUID, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, appUID); assertWithTrace(checkStringArrays(blanketPermissions, new String[] {UserSecuritySettingsImpl.getLocalizedName(UserSecuritySettings.NET_ACCESS_SETTINGS), UserSecuritySettingsImpl.getLocalizedName(UserSecuritySettings.READ_USER_DATA_ACCESS_SETTINGS) @@ -936,11 +894,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.wireless.messaging.sms.send,javax.microedition.io.Connector.file.read,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, appUID); - permissionGranter.grantJarPermissions( appUID, appUID, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, appUID, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, appUID); assertWithTrace(blanketPermissions == null); // change some settings to e.g. Session and reinstall the same suite with same permissions -> check that only the settings which are not Blanket (due to being changed) are returned storage.writeUserSecuritySettings(appUID, "Messaging", UserSecuritySettings.SESSION_INTERACTION_MODE); @@ -957,11 +913,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.wireless.messaging.sms.send,javax.microedition.io.Connector.file.read,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, appUID); - permissionGranter.grantJarPermissions( appUID, appUID, securityAttributes.getPermissionAttributes(), credentials); + authenticationModule.authenticateJar(session, appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, appUID, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, appUID); assertWithTrace(checkStringArrays(blanketPermissions, new String[] {UserSecuritySettingsImpl.getLocalizedName(UserSecuritySettings.MESSAGING_SETTINGS)})); // upgrade tests for legacy suites @@ -994,10 +948,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.http,javax.wireless.messaging.sms.send")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); assertTrue(permissionGranter.getBlanketPermissionsDetails(appUID) == null); - permissionGranter.addSecurityData(session, appUID, null); // getBlanketPermissionsDetails for Multimedia Read User Data -> no details permissionGranter.removeSecurityData(session, appUID); storage.removeAuthenticationStorageData(appUID); @@ -1018,9 +971,8 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.media.control.RecordControl,javax.microedition.io.Connector.file.read")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); assertTrue(permissionGranter.getBlanketPermissionsDetails(appUID) == null); // getBlanketPermissionsDetails for Multimedia, Local Connectivity -> privacy details permissionGranter.removeSecurityData(session, appUID); @@ -1042,11 +994,10 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.media.control.RecordControl,javax.microedition.io.Connector.bluetooth.client")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); String blanketDetails = permissionGranter.getBlanketPermissionsDetails(appUID); - assertTrue("qtn_java_settings_inst_query_perm_sec".equals(blanketDetails) + assertTrue("qtn_java_settings_inst_query_perm_sec".equals(blanketDetails) || "Allowing these permissions may result in compromised privacy".equals( blanketDetails)); // getBlanketPermissionsDetails for Messaging, Multimedia -> net details @@ -1069,11 +1020,10 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.media.control.RecordControl,javax.wireless.messaging.sms.send")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); blanketDetails = permissionGranter.getBlanketPermissionsDetails(appUID); - assertTrue("qtn_java_settings_inst_query_perm_net".equals(blanketDetails) + assertTrue("qtn_java_settings_inst_query_perm_net".equals(blanketDetails) || "Allowing these permissions may result in compromised privacy or increased network usage costs".equals( blanketDetails)); } @@ -1108,7 +1058,6 @@ private void upgradeDomain(ProtectionDomain domain1, ProtectionDomain domain2, boolean expectToFail, boolean legacySuite) { - AuthenticationCredentials[] credentials; boolean success1 = false; boolean success2 = false; storage.removeAuthenticationStorageData(appUID); @@ -1132,11 +1081,9 @@ StorageNames.VALUE, (legacySuite ? "MIDP-2.0" : "MIDP-3.0"))); session.write(StorageNames.APPLICATION_PACKAGE_ATTRIBUTES_TABLE, appPackageEntry); - credentials = authenticationModule.authenticateJar(appUID, null, domain1, TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar"); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions(appUID, null, domain1); + authenticationModule.authenticateJar(session, appUID, null, domain1, TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar"); + permissionGranter.grantJarPermissions(session, appUID, null, domain1); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); signingCerts = authenticationModule.getCertificatesDetails(session, appUID); success1 = (blanketPermissions == null && signingCerts == null); ac.checkPermission(new java.util.PropertyPermission("microedition.version", "read")); @@ -1146,8 +1093,7 @@ assertWithTrace(domainCategory.equals(domain1.getCategory())); try { - credentials = authenticationModule.authenticateJar(appUID, appUID, domain2, TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar"); - authenticationModule.addSecurityData(session, appUID, appUID); + authenticationModule.authenticateJar(session, appUID, appUID, domain2, TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar"); assertWithTrace(!expectToFail); } catch (InstallerSecurityException e) @@ -1158,9 +1104,8 @@ && e.getDetailedMessage().equals(detailedErrorMessage.get(InstallerDetailedErrorMessage.DIFFERENT_SIGNERS, null))); return; } - permissionGranter.grantJarPermissions(appUID,appUID, domain2); + permissionGranter.grantJarPermissions(session, appUID,appUID, domain2); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, appUID); signingCerts = authenticationModule.getCertificatesDetails(session, appUID); success2 = (blanketPermissions == null && signingCerts == null); assertWithTrace(success1 == true && success2 == true); diff -r 461e71b327da -r 0553e2305d00 javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationModuleTests.java --- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationModuleTests.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationModuleTests.java Fri Oct 22 14:23:56 2010 +0100 @@ -179,8 +179,7 @@ authenticationModule.removeSecurityData(session, appUID); try { - authenticationModule.authenticateJar(appUID,null,"somethingWhichDoesNotExist", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,"somethingWhichDoesNotExist", false); assertTrue(false); } catch (InstallerSecurityException e) @@ -194,15 +193,13 @@ authenticationModule.removeSecurityData(session, appUID); // 3. unsigned, install from JAR authenticationModule.removeSecurityData(session, appUID); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); assertTrue(authenticationModule.getProtectionDomainCategory(session, appUID).equals(ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN) && authenticationModule.getCertificatesDetails(session, appUID) == null); authenticationModule.removeSecurityData(session, appUID); - // 3.1. unsigned, install from JAR, no session provided to addSecurityData -> no authentication data stored to storage + // 3.1. unsigned, install from JAR, no session provided to authenticateJar -> no authentication data stored to storage authenticationModule.removeSecurityData(session, appUID); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(null, appUID, null); + authenticationModule.authenticateJar(null, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); StorageEntry query = new StorageEntry(); query.addAttribute(new StorageAttribute( StorageAttribute.ID, @@ -234,15 +231,13 @@ credentials = authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); assertTrue(credentials != null && credentials.length == 1 && credentials[0].getProtectionDomainName().equals("UnidentifiedThirdParty") && authenticationModule.getCertificatesDetails(session, appUID) == null); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); assertTrue(authenticationModule.getProtectionDomainCategory(session, appUID).equals(ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN)); authenticationModule.removeSecurityData(session, appUID); // 5. upgrade of authentication storage data authenticationModule.removeSecurityData(session, appUID); storage.writeAuthenticationStorageData(appUID, new AuthenticationStorageData("UnidentifiedThirdParty", ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN, "jarHash", "rootHash", new Vector())); - authenticationModule.authenticateJar(appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, appUID); + authenticationModule.authenticateJar(session, appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); assertTrue(authenticationModule.getProtectionDomainCategory(session, appUID).equals(ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN) && authenticationModule.getCertificatesDetails(session, appUID) == null); authenticationModule.removeSecurityData(session, appUID); @@ -277,8 +272,7 @@ securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); details = (SigningCertificate[])authenticationModule.getCertificatesDetails(session, appUID); - authenticationModule.authenticateJar(appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); // this empties the cache as well authenticationModule.removeSecurityData(session, appUID); @@ -365,8 +359,7 @@ authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); try { - authenticationModule.authenticateJar(appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "modified_app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "modified_app.jar", false); assertTrue(INVALID_CERTIFICATE_SIGNATURE_MSG, false); } catch (InstallerSecurityException e) @@ -559,8 +552,7 @@ securityAttributes = new SecurityAttributes(); securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); // 17. Developer Certificates/Manufacturer - sign to operator party domain @@ -574,8 +566,7 @@ securityAttributes = new SecurityAttributes(); securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); assertTrue(domainCategory.equals(ApplicationInfo.OPERATOR_DOMAIN)); // 18. Developer Certificates/Manufacturer - sign to manufacturer domain @@ -589,8 +580,7 @@ securityAttributes = new SecurityAttributes(); securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); assertTrue(domainCategory.equals(ApplicationInfo.MANUFACTURER_DOMAIN)); // 19. Developer Certificates/Operator - sign to trusted third party domain @@ -604,8 +594,7 @@ securityAttributes = new SecurityAttributes(); securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); // 20. Developer Certificates/Operator - sign to operator party domain @@ -619,8 +608,7 @@ securityAttributes = new SecurityAttributes(); securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); assertTrue(domainCategory.equals(ApplicationInfo.OPERATOR_DOMAIN)); // 21. Developer Certificates/Operator - sign to manufacturer domain -> still the operator domain is used @@ -634,8 +622,7 @@ securityAttributes = new SecurityAttributes(); securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); assertTrue(domainCategory.equals(ApplicationInfo.OPERATOR_DOMAIN)); // 22. Developer Certificates/TrustedThirdParty - sign to manufacturer domain -> still the trusted third party domain is used @@ -649,8 +636,7 @@ securityAttributes = new SecurityAttributes(); securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); // 23. Developer Certificates/TrustedThirdParty - sign to operator domain -> still the trusted third party domain is used @@ -664,8 +650,7 @@ securityAttributes = new SecurityAttributes(); securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); // 24. Developer Certificates - no domain info -> fail @@ -702,8 +687,7 @@ securityAttributes = new SecurityAttributes(); securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); // 26. Developer Certificates - empty IMEI list -> failure @@ -823,8 +807,7 @@ securityAttributes = new SecurityAttributes(); securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); - authenticationModule.authenticateJar(appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); SigningInfo info = authenticationModule.getSigningInfo("appName","appVersion","appVendor"); // app is unknown assertTrue(info == null); @@ -868,8 +851,7 @@ securityAttributes = new SecurityAttributes(); securityAttributes.addDescriptorAttributes(allAttributes); authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); - authenticationModule.authenticateJar(appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); info = authenticationModule.getSigningInfo("appName","appVersion","appVendor"); assertTrue(info.getProtectionDomain() != null && info.getProtectionDomain().getName() != null @@ -976,8 +958,7 @@ authenticationModule.removeSecurityData(session, appUID); try { - authenticationModule.authenticateJar(appUID, null, domain, TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar"); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID, null, domain, TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar"); assertTrue(!expectToFail); } catch (InstallerSecurityException e) @@ -1065,8 +1046,8 @@ } catch (RuntimeSecurityException e) { - assertTrue(e.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.JAR_NOT_FOUND, null)) - && e.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.JAR_NOT_FOUND, null))); + assertTrue(e.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.JAR_TAMPERED, null)) + && e.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.JAR_TAMPERED, null))); } // root not enabled try @@ -1219,8 +1200,7 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); securityAttributes.addManifestAttributes(allAttributes); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); assertTrue(true); // PreInstallation: ocsp disabled, warning undefined, silent mode ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_DISABLED, OcspSettings.OCSP_WARNING_UNDEFINED, true, "0", "0"); @@ -1238,8 +1218,7 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); securityAttributes.addManifestAttributes(allAttributes); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); assertTrue(true); // PreInstallation: ocsp enabled, warning ignore, silent mode, ocsp url not set ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_ENABLED, OcspSettings.OCSP_WARNING_IGNORE, true, "0", "0"); @@ -1257,8 +1236,7 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); securityAttributes.addManifestAttributes(allAttributes); - authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); assertTrue(true); } diff -r 461e71b327da -r 0553e2305d00 javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/AccessControllerTests.java --- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/AccessControllerTests.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/AccessControllerTests.java Fri Oct 22 14:23:56 2010 +0100 @@ -47,7 +47,6 @@ public class AccessControllerTests extends TestCase implements InstallerMain { - int assertTrace = 0; // Begin j2meunit test framework setup public void installerMain(String[] args) { @@ -92,12 +91,6 @@ { } - private void assertWithTrace(boolean aCondition) - { - assertTrue("" + assertTrace, aCondition); - assertTrace++; - } - protected void testAccessControllerFactory() { Uid appUID1 = Uid.createUid("appUID1"); @@ -107,17 +100,17 @@ String appName = "AccessControllerTests"; // check null values ac1 = AccessControllerFactoryImpl.getAccessController(null, null); - assertWithTrace(ac1 == null); + assertTrue(ac1 == null); AccessControllerFactoryImpl.destroyAccessController(null); ac1 = AccessControllerFactoryImpl.getAccessController(null, "appName"); - assertWithTrace(ac1 == null); + assertTrue(ac1 == null); AccessControllerFactoryImpl.destroyAccessController(null); // check duplicates AccessControllerFactoryImpl.destroyAccessController(appUID1); ac1 = AccessControllerFactoryImpl.getAccessController(appUID1, appName); ac2 = AccessControllerFactoryImpl.getAccessController(appUID1, appName); AccessControllerFactoryImpl.destroyAccessController(appUID1); - assertWithTrace(ac1 == ac2); + assertTrue(ac1 == ac2); // check destroy ac1 = AccessControllerFactoryImpl.getAccessController(appUID1, appName); AccessControllerFactoryImpl.destroyAccessController(appUID1); @@ -125,7 +118,7 @@ // call destroy two times (or calling it on a UID which does not have an instance) AccessControllerFactoryImpl.destroyAccessController(appUID1); AccessControllerFactoryImpl.destroyAccessController(appUID1); - assertWithTrace(ac1 != ac2); + assertTrue(ac1 != ac2); } protected void testAccessController() @@ -142,32 +135,32 @@ try { ac.checkPermission((Permission)null); - assertWithTrace(false); + assertTrue(false); } catch (AccessControlException e) { - assertWithTrace(true); + assertTrue(true); } - assertWithTrace(ac.checkPermission((String)null) == 0); + assertTrue(ac.checkPermission((String)null) == 0); // check permission which is not granted PermissionResolver.testClearCache(); try { ac.checkPermission(new CommProtocolPermission("comm://")); - assertWithTrace(false); + assertTrue(false); } catch (AccessControlException e) { - assertWithTrace(true); + assertTrue(true); } try { ac.checkPermission(new CommProtocolPermission("comm://")); - assertWithTrace(false); + assertTrue(false); } catch (AccessControlException e) { - assertWithTrace(true); + assertTrue(true); } // check allowed permission which is granted PermissionResolver.testClearCache(); @@ -183,11 +176,11 @@ try { ac.checkPermission(new FileProtocolPermission("file://myFile.txt", "read")); - assertWithTrace(false); + assertTrue(false); } catch (AccessControlException e) { - assertWithTrace(true); + assertTrue(true); } storage.removeGrantedPermissions(appUID); // check permission not allowed @@ -209,11 +202,11 @@ try { ac.checkPermission(new SocketProtocolPermission("socket://:100")); - assertWithTrace(false); + assertTrue(false); } catch (AccessControlException e) { - assertWithTrace(true); + assertTrue(true); } storage.removeGrantedPermissions(appUID); // check user permission with NO as interaction mode -> security exception thrown @@ -235,35 +228,35 @@ try { ac.checkPermission(new HttpProtocolPermissionImpl("http://")); - assertWithTrace(false); + assertTrue(false); } catch (AccessControlException e) { - assertWithTrace(true); + assertTrue(true); } try { ac.checkPermission(new HttpProtocolPermission("http://")); - assertWithTrace(false); + assertTrue(false); } catch (AccessControlException e) { - assertWithTrace(true); + assertTrue(true); } storage.removeGrantedPermissions(appUID); // check the named permissions: unknown permission - assertWithTrace(ac.checkPermission("unknownPermission") == 0); + assertTrue(ac.checkPermission("unknownPermission") == 0); // check the named permissions: allowed permission PermissionResolver.testClearCache(); grantedPermissions = new Vector(); grantedPermissions.addElement(new PolicyBasedPermissionImpl( "com.nokia.mj.impl.gcf.protocol.socket.SocketPermissionImpl", - "socket://*", + "socket://", null, null)); storage.removeGrantedPermissions(appUID); storage.writeGrantedPermissions(appUID, null, grantedPermissions); - assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.socket") == 1); + assertTrue(ac.checkPermission("javax.microedition.io.Connector.socket") == 1); // check the named permissions: user permission with NO interaction mode PermissionResolver.testClearCache(); grantedPermissions = new Vector(); @@ -280,7 +273,7 @@ }))); storage.removeGrantedPermissions(appUID); storage.writeGrantedPermissions(appUID, null, grantedPermissions); - assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.http") == 0); + assertTrue(ac.checkPermission("javax.microedition.io.Connector.http") == 0); // check the named permissions: user permission with ONESHOT interaction mode PermissionResolver.testClearCache(); grantedPermissions = new Vector(); @@ -297,7 +290,7 @@ }))); storage.removeGrantedPermissions(appUID); storage.writeGrantedPermissions(appUID, null, grantedPermissions); - assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.http") == -1); + assertTrue(ac.checkPermission("javax.microedition.io.Connector.http") == -1); // check the named permissions: user permission with BLANKET interaction mode (blanket prompt not shown yet) PermissionResolver.testClearCache(); grantedPermissions = new Vector(); @@ -314,7 +307,7 @@ }))); storage.removeGrantedPermissions(appUID); storage.writeGrantedPermissions(appUID, null, grantedPermissions); - assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.http") == -1); + assertTrue(ac.checkPermission("javax.microedition.io.Connector.http") == -1); // check the named permissions: user permission with BLANKET interaction mode (blanket prompt shown already) PermissionResolver.testClearCache(); grantedPermissions = new Vector(); @@ -332,7 +325,7 @@ storage.removeGrantedPermissions(appUID); storage.writeGrantedPermissions(appUID, null, grantedPermissions); storage.writeUserSecuritySettingsPromptFlag(appUID, "Net Access", true); - assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.http") == 1); + assertTrue(ac.checkPermission("javax.microedition.io.Connector.http") == 1); // check the named permissions: user permission with SESSION interaction mode (session prompt not shown already) PermissionResolver.testClearCache(); grantedPermissions = new Vector(); @@ -350,7 +343,7 @@ storage.removeGrantedPermissions(appUID); storage.writeGrantedPermissions(appUID, null, grantedPermissions); storage.writeUserSecuritySettingsPromptFlag(appUID, "Net Access", true); - assertWithTrace(ac.checkPermission("javax.microedition.io.Connector.http") == -1); + assertTrue(ac.checkPermission("javax.microedition.io.Connector.http") == -1); // check the named permissions: denied permission PermissionResolver.testClearCache(); grantedPermissions = new Vector(); @@ -361,7 +354,7 @@ null)); storage.removeGrantedPermissions(appUID); storage.writeGrantedPermissions(appUID, null, grantedPermissions); - assertWithTrace(ac.checkPermission("javax.wireless.messaging.mms.send") == 0); + assertTrue(ac.checkPermission("javax.wireless.messaging.mms.send") == 0); // cleanup storage.removeGrantedPermissions(appUID); AccessControllerFactoryImpl.destroyAccessController(appUID); diff -r 461e71b327da -r 0553e2305d00 javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/InteractiveAccessControllerTests.java --- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/InteractiveAccessControllerTests.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/InteractiveAccessControllerTests.java Fri Oct 22 14:23:56 2010 +0100 @@ -626,10 +626,8 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); - permissionGranter.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); permissionGranter.getBlanketPermissions(appUID); ac.checkPermission(new HttpProtocolPermissionImpl("http://", "\n(choose ALLOW)")); ac.checkPermission(new HttpProtocolPermissionImpl("http://", "\n(IF YOU SEE THIS PROMPT THE TEST FAILED)")); @@ -661,10 +659,8 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, appUID); - permissionGranter.grantJarPermissions( appUID, appUID, securityAttributes.getPermissionAttributes(), credentials); - permissionGranter.addSecurityData(session, appUID, appUID); + authenticationModule.authenticateJar(session, appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, appUID, securityAttributes.getPermissionAttributes()); blanketPromptShown = storage.readUserSecuritySettingsPromptFlag(appUID, "Net Access"); ac.checkPermission(new HttpProtocolPermissionImpl("http://", "\n(IF YOU SEE THIS PROMPT THE TEST FAILED)")); storage.removeAuthenticationStorageData(appUID); @@ -691,10 +687,8 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(com.nokia.mj.impl.security.midp.common.PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","javax.microedition.io.Connector.socket,javax.microedition.io.Connector.http")); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); - permissionGranter.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); signingCerts = authenticationModule.getCertificatesDetails(session, appUID); assertTrue(signingCerts != null && signingCerts.length == 1 @@ -731,10 +725,8 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); securityAttributes.addManifestAttributes(allAttributes); - credentials = authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); - authenticationModule.addSecurityData(session, appUID, null); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), credentials); - permissionGranter.addSecurityData(session, appUID, null); + authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); signingCerts = authenticationModule.getCertificatesDetails(session, appUID); assertTrue(signingCerts == null); ac.checkPermission(new HttpProtocolPermissionImpl("http://url", "\n(choose ALLOW)")); diff -r 461e71b327da -r 0553e2305d00 javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/PermissionGranterTests.java --- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/PermissionGranterTests.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authorization/PermissionGranterTests.java Fri Oct 22 14:23:56 2010 +0100 @@ -57,7 +57,6 @@ { private static String TEST_DATA_DIR; - int assertTrace = 0; static { @@ -79,12 +78,6 @@ } } - private void assertWithTrace(boolean aCondition) - { - assertTrue("" + assertTrace, aCondition); - assertTrace++; - } - // general-purpose constants private static final String MIDP_PROFILE_ATTRIBUTE_NAME = "MicroEdition-Profile"; private static final String MIDP3 = "MIDP-3.0"; @@ -233,12 +226,12 @@ MIDPPermission[] jadPermissions; MIDPPermission[] jarPermissions; MIDPPermission[] allPermissions; - assertWithTrace(permissionGranter != null); + assertTrue(permissionGranter != null); // test the null values permissionGranter.removeSecurityData(session, appUID); - permissionGranter.grantJarPermissions(null, null, (PermissionAttribute[])null, null); + permissionGranter.grantJarPermissions(null, null, null, (PermissionAttribute[])null); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(grantedPermissions == null); + assertTrue(grantedPermissions == null); // populate the storage storage.removeAuthenticationStorageData(appUID); permissionGranter.removeSecurityData(session, appUID); @@ -266,10 +259,9 @@ allAttributes.put(PermissionAttribute.OPTIONAL_LEGACY_ATTRIBUTE_NAME, new Attribute("",MIDP2_DATAGRAM_PERMISSION + COMMA + " " + MIDP2_COMM_PERMISSION)); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("",MIDP2_SOCKET_PERMISSION + COMMA + MIDP2_HTTP_PERMISSION)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("Manufacturer", new String[] + assertTrue(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("Manufacturer", new String[] { INTERNAL_DATAGRAM_PERMISSION, INTERNAL_COMM_PERMISSION, INTERNAL_SOCKET_PERMISSION,INTERNAL_HTTP_PERMISSION,"javax.microedition.PropertyPermission","javax.microedition.midlet.AutoStartPermission" }), @@ -295,10 +287,9 @@ allAttributes.put(PermissionAttribute.OPTIONAL_LEGACY_ATTRIBUTE_NAME, new Attribute("",MIDP2_DATAGRAM_PERMISSION + COMMA + " " + MIDP2_COMM_PERMISSION)); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("",MIDP2_SOCKET_PERMISSION + COMMA + MIDP2_HTTP_PERMISSION)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("IdentifiedThirdParty", + assertTrue(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("IdentifiedThirdParty", new String[] {INTERNAL_DATAGRAM_PERMISSION, INTERNAL_COMM_PERMISSION, INTERNAL_SOCKET_PERMISSION,INTERNAL_HTTP_PERMISSION}), getAssignedPermissions("IdentifiedThirdParty"))); // 1.2 One of the requested mandatory permission is not available in the domain -> fail @@ -323,13 +314,12 @@ allAttributes.put(PermissionAttribute.OPTIONAL_ATTRIBUTE_PREFIX + "1", new Attribute("",MIDP3_DATAGRAM_PERMISSION)); allAttributes.put(PermissionAttribute.MANDATORY_ATTRIBUTE_PREFIX + "1", new Attribute("",MIDP3_RUNTIME_PERMISSION + " name")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); + assertTrue(INVALID_PERMISSION_VALUE_MSG, false); } catch (InvalidAttributeException e) { - assertWithTrace( + assertTrue(INVALID_PERMISSION_VALUE_MSG + e.getOtaStatusCode() + " " + e.getShortMessage() + "," + e.getDetailedMessage(), e.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHORIZATION_FAILURE && e.getShortMessage().equals(errorMessage.get(InstallerErrorMessage.INST_CORRUPT_PKG, null)) && e.getDetailedMessage().equals(detailedErrorMessage.get(InstallerDetailedErrorMessage.ATTR_UNSUPPORTED, @@ -353,10 +343,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); allAttributes.put(PermissionAttribute.OPTIONAL_ATTRIBUTE_PREFIX + "1", new Attribute("",MIDP3_RUNTIME_PERMISSION + " name")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(checkGrantedPermissions(grantedPermissions, getAssignedPermissions("IdentifiedThirdParty"), true)); + assertTrue(checkGrantedPermissions(grantedPermissions, getAssignedPermissions("IdentifiedThirdParty"), true)); // 2. Legacy, signed : permissions NOT requested in JAD & permissions requested in JAR -> grant the requested permissions filled in with right // targets/actions from the policy plus the assigned ones storage.removeAuthenticationStorageData(appUID); @@ -376,10 +365,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("",MIDP2_SOCKET_PERMISSION + COMMA + MIDP2_HTTP_PERMISSION)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("Operator", new String[] + assertTrue(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("Operator", new String[] { INTERNAL_SOCKET_PERMISSION, INTERNAL_HTTP_PERMISSION,"javax.microedition.PropertyPermission","javax.microedition.midlet.AutoStartPermission" }), @@ -401,10 +389,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, getAssignedPermissions("IdentifiedThirdParty"), true)); + assertTrue(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, getAssignedPermissions("IdentifiedThirdParty"), true)); // same for a domain which has one assigned permissions -> only the assigned + default permissions are granted storage.removeAuthenticationStorageData(appUID); permissionGranter.removeSecurityData(session, appUID); @@ -422,10 +409,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("Operator", new String[] {"javax.microedition.PropertyPermission","javax.microedition.midlet.AutoStartPermission"}), + assertTrue(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("Operator", new String[] {"javax.microedition.PropertyPermission","javax.microedition.midlet.AutoStartPermission"}), getDefaultPermissions())); // 4. Legacy, unsigned : permissions requested in JAD & permissions requested in JAR -> ignore requested permissions and // grant all the permissions available in the policy for untrusted MIDlets @@ -448,10 +434,9 @@ allAttributes.put(PermissionAttribute.OPTIONAL_LEGACY_ATTRIBUTE_NAME, new Attribute("","MyOwnOptionalPermission")); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","MyOwnMandatoryPermission")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("UnidentifiedThirdParty"))); + assertTrue(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("UnidentifiedThirdParty"))); // 5. Legacy, unsigned : permissions requested in JAD & permissions NOT requested in JAR -> ignore requested permissions and, // grant all the permissions available in the policy for untrusted MIDlets storage.removeAuthenticationStorageData(appUID); @@ -470,10 +455,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("UnidentifiedThirdParty"))); + assertTrue(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("UnidentifiedThirdParty"))); // 6. Legacy, unsigned : permissions NOT requested in JAD & permissions requested in JAR -> ignore requested permissions and // grant all the permissions available in the policy for untrusted MIDlets storage.removeAuthenticationStorageData(appUID); @@ -492,10 +476,9 @@ allAttributes.put(PermissionAttribute.OPTIONAL_LEGACY_ATTRIBUTE_NAME, new Attribute("","MyOwnOptionalPermission")); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("","MyOwnMandatoryPermission")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("UnidentifiedThirdParty"))); + assertTrue(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("UnidentifiedThirdParty"))); // 7. Legacy, unsigned : permissions NOT requested in JAD & permissions NOT requested in JAR -> grant all the permissions available in the policy for untrusted MIDlets storage.removeAuthenticationStorageData(appUID); permissionGranter.removeSecurityData(session, appUID); @@ -511,10 +494,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("UnidentifiedThirdParty"))); + assertTrue(checkGrantedPermissions(grantedPermissions, getPolicyPermissions("UnidentifiedThirdParty"))); // 8. MIDP3 unsigned, unknown mandatory permission in JAD file -> failure permissionGranter.removeSecurityData(session, appUID); try @@ -527,11 +509,11 @@ authCredentials = new AuthenticationCredentials[1]; authCredentials[0] = new AuthenticationCredentials("UnidentifiedThirdParty", "UIDP"); permissionGranter.grantJadPermissions(appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - assertWithTrace(false); + assertTrue(UNKNOWN_PERMISSION_MSG, false); } catch (InvalidAttributeException e) { - assertWithTrace( + assertTrue(UNKNOWN_PERMISSION_MSG + e.getOtaStatusCode() + " " + e.getShortMessage() + "," + e.getDetailedMessage(), e.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHORIZATION_FAILURE && e.getShortMessage().equals(errorMessage.get(InstallerErrorMessage.INST_CORRUPT_PKG, null)) && e.getDetailedMessage().equals(detailedErrorMessage.get(InstallerDetailedErrorMessage.ATTR_UNSUPPORTED, @@ -546,13 +528,12 @@ allAttributes.put(PermissionAttribute.MANDATORY_ATTRIBUTE_PREFIX + "1",new Attribute("","MyMandatoryClass MyMandatoryTarget MyMandatoryAction1,MyMandatoryAction2,MyMandatoryAction3")); securityAttributes = new SecurityAttributes(); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); + assertTrue(UNKNOWN_PERMISSION_MSG, false); } catch (InvalidAttributeException e) { - assertWithTrace( + assertTrue(UNKNOWN_PERMISSION_MSG + e.getOtaStatusCode() + " " + e.getShortMessage() + "," + e.getDetailedMessage(), e.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHORIZATION_FAILURE && e.getShortMessage().equals(errorMessage.get(InstallerErrorMessage.INST_CORRUPT_PKG, null)) && e.getDetailedMessage().equals(detailedErrorMessage.get(InstallerDetailedErrorMessage.ATTR_UNSUPPORTED, @@ -574,10 +555,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, getAssignedPermissions("UnidentifiedThirdParty"), true)); + assertTrue(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, getAssignedPermissions("UnidentifiedThirdParty"), true)); // 9.1. MIDP3 unsigned, P1, unknown optional P2 requested in JAD -> unknown permission is ignored, grant only P1 plus the assigned permissions storage.removeAuthenticationStorageData(appUID); permissionGranter.removeSecurityData(session, appUID); @@ -595,10 +575,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, + assertTrue(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, new MIDPPermission[] {new MIDPPermission(INTERNAL_SOCKET_PERMISSION,"socket://")},getAssignedPermissions("UnidentifiedThirdParty"))); // 10. MIDP3 unsigned MIDlet, unknown mandatory permission in JAR file -> failure permissionGranter.removeSecurityData(session, appUID); @@ -609,13 +588,12 @@ allAttributes.put(PermissionAttribute.MANDATORY_ATTRIBUTE_PREFIX + "1",new Attribute("","MyMandatoryClass MyMandatoryTarget MyMandatoryAction1,MyMandatoryAction2,MyMandatoryAction3")); securityAttributes = new SecurityAttributes(); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); + assertTrue(UNKNOWN_PERMISSION_MSG, false); } catch (InvalidAttributeException e) { - assertWithTrace( + assertTrue(UNKNOWN_PERMISSION_MSG + e.getOtaStatusCode() + " " + e.getShortMessage() + "," + e.getDetailedMessage(), e.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHORIZATION_FAILURE && e.getShortMessage().equals(errorMessage.get(InstallerErrorMessage.INST_CORRUPT_PKG, null)) && e.getDetailedMessage().equals(detailedErrorMessage.get(InstallerDetailedErrorMessage.ATTR_UNSUPPORTED, @@ -633,13 +611,12 @@ allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1", new Attribute("","signature")); securityAttributes = new SecurityAttributes(); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); + assertTrue(UNKNOWN_PERMISSION_MSG, false); } catch (InvalidAttributeException e) { - assertWithTrace( + assertTrue(UNKNOWN_PERMISSION_MSG + e.getOtaStatusCode() + " " + e.getShortMessage() + "," + e.getDetailedMessage(), e.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHORIZATION_FAILURE && e.getShortMessage().equals(errorMessage.get(InstallerErrorMessage.INST_CORRUPT_PKG, null)) && e.getDetailedMessage().equals(detailedErrorMessage.get(InstallerDetailedErrorMessage.ATTR_UNSUPPORTED, @@ -658,13 +635,12 @@ securityAttributes.addDescriptorAttributes(allAttributes); allAttributes.put(PermissionAttribute.MANDATORY_ATTRIBUTE_PREFIX + "1",new Attribute("","MyMandatoryClass MyMandatoryTarget MyMandatoryAction1,MyMandatoryAction2,MyMandatoryAction3")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); + assertTrue(UNKNOWN_PERMISSION_MSG, false); } catch (InvalidAttributeException e) { - assertWithTrace( + assertTrue(UNKNOWN_PERMISSION_MSG + e.getOtaStatusCode() + " " + e.getShortMessage() + "," + e.getDetailedMessage(), e.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHORIZATION_FAILURE && e.getShortMessage().equals(errorMessage.get(InstallerErrorMessage.INST_CORRUPT_PKG, null)) && e.getDetailedMessage().equals(detailedErrorMessage.get(InstallerDetailedErrorMessage.ATTR_UNSUPPORTED, @@ -683,13 +659,12 @@ securityAttributes.addDescriptorAttributes(allAttributes); allAttributes.put(PermissionAttribute.MANDATORY_ATTRIBUTE_PREFIX + "1",new Attribute("","MyMandatoryClass MyMandatoryTarget MyMandatoryAction1,MyMandatoryAction2,MyMandatoryAction3")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(false); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); + assertTrue(UNKNOWN_PERMISSION_MSG, false); } catch (InvalidAttributeException e) { - assertWithTrace( + assertTrue(UNKNOWN_PERMISSION_MSG + e.getOtaStatusCode() + " " + e.getShortMessage() + "," + e.getDetailedMessage(), e.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHORIZATION_FAILURE && e.getShortMessage().equals(errorMessage.get(InstallerErrorMessage.INST_CORRUPT_PKG, null)) && e.getDetailedMessage().equals(detailedErrorMessage.get(InstallerDetailedErrorMessage.ATTR_UNSUPPORTED, @@ -716,10 +691,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, + assertTrue(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, new MIDPPermission[] { new MIDPPermission(INTERNAL_SOCKET_PERMISSION,"socket://50"), @@ -751,11 +725,11 @@ authCredentials = new AuthenticationCredentials[1]; authCredentials[0] = new AuthenticationCredentials("UnidentifiedThirdParty", "UIDP"); permissionGranter.grantJadPermissions(appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - assertWithTrace(false); + assertTrue(INVALID_PERMISSION_VALUE_MSG, false); } catch (InvalidAttributeException e) { - assertWithTrace( + assertTrue(INVALID_PERMISSION_VALUE_MSG + e.getOtaStatusCode() + " " + e.getShortMessage() + "," + e.getDetailedMessage(), e.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHORIZATION_FAILURE && e.getShortMessage().equals(errorMessage.get(InstallerErrorMessage.INST_CORRUPT_PKG, null)) && e.getDetailedMessage().equals(detailedErrorMessage.get(InstallerDetailedErrorMessage.ATTR_UNSUPPORTED, @@ -791,10 +765,9 @@ allAttributes.put(PermissionAttribute.MANDATORY_ATTRIBUTE_PREFIX + "5",new Attribute("",MIDP3_DATAGRAM_PERMISSION + " datagram://12345")); allAttributes.put(PermissionAttribute.MANDATORY_ATTRIBUTE_PREFIX + "6",new Attribute("",MIDP3_COMM_PERMISSION + " comm:123")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, + assertTrue(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, new MIDPPermission[] { new MIDPPermission(INTERNAL_SOCKET_PERMISSION,"socket://50"), @@ -837,10 +810,9 @@ allAttributes.put(PermissionAttribute.MANDATORY_ATTRIBUTE_PREFIX + "5",new Attribute("",MIDP3_DATAGRAM_PERMISSION + " datagram://12345")); allAttributes.put(PermissionAttribute.MANDATORY_ATTRIBUTE_PREFIX + "6",new Attribute("",MIDP3_COMM_PERMISSION + " comm:123")); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); - permissionGranter.addSecurityData(session, appUID, null); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); grantedPermissions = storage.readGrantedPermissions(appUID); - assertWithTrace(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, + assertTrue(grantedPermissions != null && checkGrantedPermissions(grantedPermissions, new MIDPPermission[] { new MIDPPermission(INTERNAL_SOCKET_PERMISSION,"socket://50"), @@ -855,12 +827,12 @@ storage.removeAuthenticationStorageData(appUID); permissionGranter.removeSecurityData(session, appUID); blanketPermissions = permissionGranter.getBlanketPermissions(null); - assertWithTrace(blanketPermissions == null); + assertTrue(blanketPermissions == null); // 20. getBlanketPermissions - unknown appUID storage.removeAuthenticationStorageData(appUID); permissionGranter.removeSecurityData(session, appUID); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - assertWithTrace(blanketPermissions == null); + assertTrue(blanketPermissions == null); // 21. getBlanketPermissions - unsigned suite storage.removeAuthenticationStorageData(appUID); permissionGranter.removeSecurityData(session, appUID); @@ -876,10 +848,9 @@ allAttributes.clear(); allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(blanketPermissions == null); + assertTrue(blanketPermissions == null); // 22. getBlanketPermissions - one of the requested permissions does not allow Blanket permissionGranter.removeSecurityData(session, appUID); storage.removeAuthenticationStorageData(appUID); @@ -901,10 +872,9 @@ allAttributes.put(PermissionAttribute.OPTIONAL_LEGACY_ATTRIBUTE_NAME, new Attribute("",MIDP2_DATAGRAM_PERMISSION + COMMA + " " + MIDP2_SMS_SEND_PERMISSION)); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("",MIDP2_SOCKET_PERMISSION + COMMA + MIDP2_HTTP_PERMISSION)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(blanketPermissions == null); + assertTrue(blanketPermissions == null); // 23. getBlanketPermissions - request one permissions which is already in Blanket permissionGranter.removeSecurityData(session, appUID); storage.removeAuthenticationStorageData(appUID); @@ -925,10 +895,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(PermissionAttribute.OPTIONAL_LEGACY_ATTRIBUTE_NAME, new Attribute("",MIDP2_HTTP_PERMISSION)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(blanketPermissions == null); + assertTrue(blanketPermissions == null); // 24. getBlanketPermissions - request Auto Invocation and Net Access -> mutually exclusive permissions permissionGranter.removeSecurityData(session, appUID); storage.removeAuthenticationStorageData(appUID); @@ -949,10 +918,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(PermissionAttribute.OPTIONAL_LEGACY_ATTRIBUTE_NAME, new Attribute("",MIDP2_PUSH_REGISTRY_PERMISSION + COMMA + MIDP2_HTTP_PERMISSION)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(blanketPermissions == null); + assertTrue(blanketPermissions == null); // 25. getBlanketPermissions - manufacturer signed MIDlet permissionGranter.removeSecurityData(session, appUID); storage.removeAuthenticationStorageData(appUID); @@ -973,10 +941,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("",MIDP2_HTTP_PERMISSION + COMMA + MIDP2_SMS_SEND_PERMISSION + COMMA + MIDP2_MMS_OPEN_PERMISSION + COMMA + MIDP2_COMM_PERMISSION)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(blanketPermissions == null); + assertTrue(blanketPermissions == null); // 26. getBlanketPermissions - request Messaging, Net Access and Local connectivity. Since Messaging and Net Access have the current interaction mode set to Blanket, only Local connectivity is returned permissionGranter.removeSecurityData(session, appUID); storage.removeAuthenticationStorageData(appUID); @@ -997,10 +964,9 @@ allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP2)); allAttributes.put(PermissionAttribute.MANDATORY_LEGACY_ATTRIBUTE_NAME, new Attribute("",MIDP2_HTTP_PERMISSION + COMMA + MIDP2_SMS_SEND_PERMISSION + COMMA + MIDP2_MMS_OPEN_PERMISSION + COMMA + MIDP2_COMM_PERMISSION)); securityAttributes.addManifestAttributes(allAttributes); - permissionGranter.grantJarPermissions( appUID, null, securityAttributes.getPermissionAttributes(), authCredentials); + permissionGranter.grantJarPermissions(session, appUID, null, securityAttributes.getPermissionAttributes()); blanketPermissions = permissionGranter.getBlanketPermissions(appUID); - permissionGranter.addSecurityData(session, appUID, null); - assertWithTrace(blanketPermissions != null && blanketPermissions.length == 1 && blanketPermissions[0].equals(UserSecuritySettingsImpl.getLocalizedName(UserSecuritySettings.LOCAL_CONNECTIVITY_SETTINGS))); + assertTrue(blanketPermissions != null && blanketPermissions.length == 1 && blanketPermissions[0].equals(UserSecuritySettingsImpl.getLocalizedName(UserSecuritySettings.LOCAL_CONNECTIVITY_SETTINGS))); permissionGranter.setPermissionsToBlanket(session, appUID); grantedPermissions = storage.readGrantedPermissions(appUID); for (int i=0; i the old settings are retained + storage.removeGrantedPermissions(appUID); + grantedPermissions = storage.readGrantedPermissions(appUID); + assertTrue(grantedPermissions == null); + grantedPermissions = new Vector(); + storage.writeGrantedPermissions(appUID, null, grantedPermissions); + storage.removeGrantedPermissions(appUID); + assertTrue(true); + grantedPermissions.addElement(new PolicyBasedPermissionImpl( + "permission1", + "target1", + "action1", + PolicyBasedPermission.ALLOWED_TYPE)); + grantedPermissions.addElement(new PolicyBasedPermissionImpl( + "permission2", + "target2", + "action2", + PolicyBasedPermission.ASSIGNED_TYPE)); + grantedPermissions.addElement(new PolicyBasedPermissionImpl( + "permission3", + "target3", + "action3", + new UserSecuritySettingsImpl("settingsname", + UserSecuritySettings.ONESHOT_INTERACTION_MODE, + new int[] { UserSecuritySettings.ONESHOT_INTERACTION_MODE, + UserSecuritySettings.SESSION_INTERACTION_MODE, + UserSecuritySettings.BLANKET_INTERACTION_MODE, + UserSecuritySettings.NO_INTERACTION_MODE + }))); + storage.writeGrantedPermissions(appUID, null, grantedPermissions); + readPermissions = storage.readGrantedPermissions(appUID); + assertTrue(readPermissions != null + && readPermissions.size() == grantedPermissions.size() + && checkGrantedPermissions(readPermissions, grantedPermissions)); + grantedPermissions2 = new Vector(); + grantedPermissions2.addElement(new PolicyBasedPermissionImpl( + "permission1", + "target1", + "action1", + PolicyBasedPermission.ALLOWED_TYPE)); + grantedPermissions2.addElement(new PolicyBasedPermissionImpl( + "permission2", + "target2", + "action2", + PolicyBasedPermission.ASSIGNED_TYPE)); + grantedPermissions2.addElement(new PolicyBasedPermissionImpl( + "permission3", + "target3", + "action3", + new UserSecuritySettingsImpl("settingsname", + UserSecuritySettings.SESSION_INTERACTION_MODE, + new int[] { UserSecuritySettings.ONESHOT_INTERACTION_MODE, + UserSecuritySettings.SESSION_INTERACTION_MODE, + UserSecuritySettings.BLANKET_INTERACTION_MODE, + UserSecuritySettings.NO_INTERACTION_MODE + }))); + storage.writeGrantedPermissions(appUID, appUID, grantedPermissions2); + readPermissions = storage.readGrantedPermissions(appUID); + assertTrue(readPermissions != null + && readPermissions.size() == grantedPermissions.size() + && checkGrantedPermissions(readPermissions, grantedPermissions)); + storage.removeGrantedPermissions(appUID); + readPermissions = storage.readGrantedPermissions(appUID); + assertTrue(readPermissions == null); // full read/write/remove cycle with different valid values for permissions and user settings storage.removeGrantedPermissions(appUID); grantedPermissions = storage.readGrantedPermissions(appUID); diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/build/build.xml --- a/javacommons/utils/build/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/build/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -30,7 +30,6 @@ com.nokia.mj.impl.properties.common.Locale, com.nokia.mj.impl.properties.common.Platform, com.nokia.mj.impl.utils.Formatter, - com.nokia.mj.impl.utils.InstallerErrorMessage, com.nokia.mj.impl.utils.ResourceLoader"/> diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/build/bwins/javautilsu.def --- a/javacommons/utils/build/bwins/javautilsu.def Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/build/bwins/javautilsu.def Fri Oct 22 14:23:56 2010 +0100 @@ -128,7 +128,7 @@ ??_ERuntimeException@runtime@java@@UAE@I@Z @ 127 NONAME ; java::runtime::RuntimeException::~RuntimeException(unsigned int) ??1RuntimeException@runtime@java@@UAE@XZ @ 128 NONAME ; java::runtime::RuntimeException::~RuntimeException(void) ?toString@RuntimeException@runtime@java@@UBE?AV?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ @ 129 NONAME ; class std::basic_string, class std::allocator > java::runtime::RuntimeException::toString(void) const - ?wbase64encode@JavaCommonUtils@util@java@@SA?AV?$basic_string@_WV?$char_traits@_W@std@@V?$allocator@_W@2@@std@@ABV45@@Z @ 130 NONAME ; class std::basic_string, class std::allocator > java::util::JavaCommonUtils::wbase64encode(class std::basic_string, class std::allocator > const &) + ?wbase64encode@JavaCommonUtils@util@java@@SA?AV?$basic_string@_WV?$char_traits@_W@std@@V?$allocator@_W@2@@std@@ABV45@@Z @ 130 ABSENT; absent ?isFirstBoot@JavaCommonUtils@util@java@@SA_NXZ @ 131 NONAME ; bool java::util::JavaCommonUtils::isFirstBoot(void) ?initIsFirstBoot@JavaCommonUtils@util@java@@SAHXZ @ 132 NONAME ; int java::util::JavaCommonUtils::initIsFirstBoot(void) diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/build/eabi/javautilsu.def --- a/javacommons/utils/build/eabi/javautilsu.def Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/build/eabi/javautilsu.def Fri Oct 22 14:23:56 2010 +0100 @@ -178,7 +178,7 @@ _ZNK4java7runtime16RuntimeException8toStringEv @ 177 NONAME _ZTIN4java7runtime16RuntimeExceptionE @ 178 NONAME _ZTVN4java7runtime16RuntimeExceptionE @ 179 NONAME - _ZN4java4util15JavaCommonUtils13wbase64encodeERKSbIwSt11char_traitsIwESaIwEE @ 180 NONAME + 0 @ 180 NONAME ABSENT _ZN4java4util15JavaCommonUtils11isFirstBootEv @ 181 NONAME _ZN4java4util15JavaCommonUtils15initIsFirstBootEv @ 182 NONAME diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/build/javautils.pro diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/build/javautils_0x2002DCDA.mmp --- a/javacommons/utils/build/javautils_0x2002DCDA.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/build/javautils_0x2002DCDA.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/inc.s60/java_stdcpp_support_for_dll.hrh --- a/javacommons/utils/inc.s60/java_stdcpp_support_for_dll.hrh Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/inc.s60/java_stdcpp_support_for_dll.hrh Fri Oct 22 14:23:56 2010 +0100 @@ -49,6 +49,9 @@ macro J9EPOC32 #define J9EPOC32 +macro RD_JAVA_OMJ_FSERVER +#define RD_JAVA_OMJ_FSERVER + #include "build_defines.hrh" #ifdef RD_JAVA_STDCPPV5 diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/inc.s60/java_stdcpp_support_for_exe.hrh diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/inc.s60/java_stdcpp_support_for_stddll.hrh diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/inc.s60/java_stdcpp_support_for_stdexe.hrh diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/inc/javacommonutils.h --- a/javacommons/utils/inc/javacommonutils.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/inc/javacommonutils.h Fri Oct 22 14:23:56 2010 +0100 @@ -87,23 +87,6 @@ OS_IMPORT static std::string base64encode(const std::string& aData); /** - * Encode wstring to base64 wstring byte by byte. - * - * wstring aData is base64 encoded as a byte array. - * If the wstring has been created from TDesC16 in Symbian it contains - * UTF-16LE (UCS-2) encoded 16-bit characters. - * The result is byte array that contains 8-bit ASCII characters. - * Each of these 8-bit character is converted to the corresponding - * wchar and appended to the result wstring. - * - * @see \sf\app\jrt\javamanager\javainstaller\installer\javasrc\com\nokia - * \mj\impl\installer\utils\Args.java, decodeBase64Args() - * @param aData wstring containing the data to be encoded. - * @return base64 encoded result wstring. - */ - OS_IMPORT static std::wstring wbase64encode(const std::wstring& aData); - - /** * Decode base64 string. * * @param aData base64 encoded string. diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/inc/javaoslayer.h --- a/javacommons/utils/inc/javaoslayer.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/inc/javaoslayer.h Fri Oct 22 14:23:56 2010 +0100 @@ -33,7 +33,6 @@ const int BOOT_CLASSPATH_MIDP = 1; const int BOOT_CLASSPATH_INSTALLER = 2; const int BOOT_CLASSPATH_TCKRUNNER = 3; -const int BOOT_CLASSPATH_JAVACONTROLPANEL = 4; class DriveId; diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/inc/logger.h --- a/javacommons/utils/inc/logger.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/inc/logger.h Fri Oct 22 14:23:56 2010 +0100 @@ -115,9 +115,7 @@ EDebugApi, // =34 EJavaAppMngrPlugin, // =35 EJavaBroadcast, // =36 - EJavaAMMS, // =37 - EJavaSettings, // =38 - EJavaQtServiceApp, // =39 + EJavaAMMS, // =37 // add id of new components here }; @@ -174,9 +172,7 @@ {"JavaDebugApi.log", "[JavaDebugApi]"}, // EDebugApi {"JavaAppMngrPlugin.log","[JavaAppMngrPlugin]"}, // EJavaAppMngrPlugin {"JavaBroadcast.log", "[JavaBroadcast]"}, // EJavaBroadcast - {"JavaMMAPI.log", "[ MMAPPI ]"}, // EJavaAMMS - {"JavaSettings.log", "[ JavaSettings ]"}, // EJavaSettings - {"JavaQtServiceApp.log", "[ QtServiceApp ]"}, // EJavaQtServiceApp + {"JavaMMAPI.log", "[ MMAPPI ]"}, // EJavaAMMS // add new component file name and nickname here }; diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/coreui/CoreUi.java diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/rt/SystemPropertyUtils.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/SystemPropertyUtils.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/SystemPropertyUtils.java Fri Oct 22 14:23:56 2010 +0100 @@ -98,7 +98,7 @@ try { - Class clazz = Class.forName(className); + Class clazz = clazz = Class.forName(className); Object providerImpl = clazz.newInstance(); boolean isFrozen = false; diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java Fri Oct 22 14:23:56 2010 +0100 @@ -45,11 +45,12 @@ * package com.nokia.mj.impl.mypackage; * * import com.nokia.mj.impl.rt.support.ApplicationUtils; - * public void myClass() + * import com.nokia.mj.impl.rt.support.ShutdownListener; + * public MyClass * { * public void myMethod() * { - * // Get the insatnce of ApplicationUtils. + * // Get the instance of ApplicationUtils. * ApplicationUtils appUtils = ApplicationUtils.getInstance(); * * // Get the name of the application. @@ -162,14 +163,11 @@ *

* This method is meant ONLY for the UI and no other API are allowed * to use it. The UI must use this API ONLY when the user explicitly - * wants to close the application using some platform dependent feature + * wants to close the application using some platform depedent feataure * (e.g. red key in S60). If the user tries to close the application * using the mechanism provided by the application itself, this method * must not be called. *

- * Note that calling this method might cause the UI framework to call - * uiDisposed method, depending on which UI framework is used. - *

* This method is a problematic in such runtimes that may run more than one * application in same JVM instance (e.g. eRCP). If the application * doesn't close nicely the runtime may have to terminate @@ -180,23 +178,6 @@ public abstract void notifyExitCmd(); /** - * Notifies the runtime that UI has been disposed. The runtime is - * responsible for killing the application if it doesn't close itself - * nicely after specified grace time. The specified grace time is - * runtime dependent. - *

- * This method is meant ONLY for the UI and no other API are allowed - * to use it. - *

- * It is possible that the method is called several times from different - * phases of the UI exit sequence. - */ - public void uiDisposed() - { - notifyExitCmd(); - } - - /** * Determines whether the access request indicated by the specified * permission should be allowed or denied, based on the security policy * currently in effect. This method quietly returns if the access request @@ -236,7 +217,11 @@ * calls are made in a loop in one thread, so if some listener blocks the * call the rest of the listeners don't get the notification. *

- * There can be more than one listener. + * There can be more than one listener, but it is recommended that there + * is only one listener per component. + *

+ * The implementation stores a strong reference to object which prevents + * garbage collection of the listener unless the listener is removed. * * @param listener the new listener. */ @@ -249,6 +234,25 @@ mListeners.addElement(listener); } + /** + * Removes the registered shutdown listener. + * + * @param listener the listener to be removed. If the listener is not + * found nothing happens. If the key is null, a + * @throws NullPointerException if the listener is null. + */ + public void removeShutdownListener(ShutdownListener listener) + { + if (listener == null) + { + throw new + NullPointerException("Listener was null when trying to remove"); + } + if (mListeners != null) + { + mListeners.removeElement(listener); + } + } /** * Waits (if needed) until the application to be started is known. diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/utils/DebugUtils.java diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/utils/ErrorMessageBase.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ErrorMessageBase.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ErrorMessageBase.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -24,6 +24,8 @@ /** * Base class for classes defining localized error messages. * + * @author Nokia Corporation + * @version 1.0 * @see InstallerExceptionBase */ abstract public class ErrorMessageBase @@ -32,19 +34,6 @@ public static final int NO_MSG = 0; // Used when the error message is not available. - /** Start of Runtime error message ids range. */ - public static final int RUNTIME_RANGE_START = 0; - /** End of Runtime error message ids range. */ - public static final int RUNTIME_RANGE_END = 99; - /** Start of Installer error message ids range. */ - public static final int INSTALLER_RANGE_START = 100; - /** End of Installer error message ids range. */ - public static final int INSTALLER_RANGE_END = 199; - /** Start of Security error message ids range. */ - public static final int SECURITY_RANGE_START = 200; - /** End of Security error message ids range. */ - public static final int SECURITY_RANGE_END = 299; - /** * Method for retrieving the message of a certain error. * @@ -62,12 +51,7 @@ { return this.getClass().getName() + ": No message found for error " + errorCode; } - ResourceLoader rl = getResourceLoader(); - if (rl == null) - { - rl = getResourceLoader(errorCode); - } - return rl.format(msgId, errorMessageParameters); + return getResourceLoader().format(msgId, errorMessageParameters); } /*** ---------------------------- PROTECTED --------------------------- */ @@ -81,64 +65,11 @@ /** * Method for retrieving the ResourceLoader instance that is used - * to localise error messages. If this method returns null, - * the ResourceLoader is obtained with getResourceLoader(int) - * method variant which then must not return null. - * + * to localise error messages. * This method must be overriden in inheriting class. */ abstract protected ResourceLoader getResourceLoader(); - /** - * Method for retrieving the ResourceLoader instance that is used - * to localise error message for specified error code. - * This method must be overriden in inheriting class if - * the getResourceLoader() method variant returns null. - * - * @param errorCode error code for which ResourceLoader is returned - */ - protected ResourceLoader getResourceLoader(int errorCode) - { - return null; - } - - /** - * Method for retrieving the ResourceLoader instance. - * This method is called from inheriting class - * getResourceLoader(int) method variant. - * - * @param textFilename name for text file - * @param textPrefix prefix for text ids - */ - private static Hashtable iResourceLoaderTable = null; - protected static ResourceLoader getResourceLoader(String textFilename, String textPrefix) - { - String key = textFilename + "::" + textPrefix; - if (iResourceLoaderTable == null) - { - iResourceLoaderTable = new Hashtable(); - } - ResourceLoader rl = (ResourceLoader)iResourceLoaderTable.get(key); - if (rl == null) - { - rl = ResourceLoader.getInstance(textFilename, textPrefix); - iResourceLoaderTable.put(key, rl); - } - return rl; - } - - /** - * Gets the Qt locale ID currently being used on the phone. - * - * @return Qt locale ID as provided by the platform - */ - protected static String getLocaleIdQt() - { - // Change this after Qt localisation files are taken into use. - //return ResourceLoader.getLocaleIdQt(); - return null; - } - /*** ----------------------------- PACKAGE ---------------------------- */ /*** ----------------------------- PRIVATE ---------------------------- */ /*** ----------------------------- NATIVE ----------------------------- */ diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -28,7 +28,6 @@ *

    *
  • %nU - String in position n *
  • %U - Next string - *
  • %Ln - Integer in position n *
  • %nN - Integer in position n *
  • %N - Next integer *
  • %nC - Character in position n @@ -61,7 +60,7 @@ private String replaced; /** Next replacement index */ - private int nextIndex = (ResourceLoader.getLocaleIdQt() == null? 0: 1); + private int nextIndex = 0; /*** ----------------------------- PUBLIC ------------------------------ */ @@ -70,7 +69,7 @@ * * @param pattern formatter pattern */ - Formatter(String aPattern) + public Formatter(String aPattern) { pattern = aPattern; replaced = aPattern; @@ -91,12 +90,11 @@ replace("%U", string)) { nextIndex++; + } else { - Logger.WLOG(Logger.EUtils, - "String replacement failed on parameter " + - nextIndex + ": " + pattern); + Logger.WLOG(Logger.EUtils, "String replacement failed"); } return this; } @@ -112,9 +110,8 @@ { String localisedNumber = _formatInteger(number); - // Try to replace with patterns %Ln, %nN, %n, %N - if (replace("%" + "L" + nextIndex, localisedNumber) || - replace("%" + nextIndex + "N", localisedNumber) || + // Try to replace with patterns %nN, %n, %N + if (replace("%" + nextIndex + "N", localisedNumber) || replace("%" + nextIndex, localisedNumber) || replace("%N", localisedNumber)) { @@ -123,9 +120,7 @@ } else { - Logger.WLOG(Logger.EUtils, - "Integer replacement failed on parameter " + - nextIndex + ": " + pattern); + Logger.WLOG(Logger.EUtils, "Integer replacement failed"); } return this; } @@ -151,9 +146,7 @@ } else { - Logger.WLOG(Logger.EUtils, - "Character replacement failed on parameter " + - nextIndex + ": " + pattern); + Logger.WLOG(Logger.EUtils, "Character replacement failed"); } return this; } @@ -215,7 +208,7 @@ // Reset for next usage replaced = pattern; - nextIndex = (ResourceLoader.getLocaleIdQt() == null? 0: 1); + nextIndex = 0; return result; } diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/utils/Id.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Id.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +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: -* -*/ - - -package com.nokia.mj.impl.utils; - -/** - * Localisation Identifier. This class is used to hide platform localisation - * specifics. - */ -public class Id -{ - private String iAvkonLocString = null; - private String iQtLocString = null; - - /** - * Default constructor. - */ - private Id() - { - } - - public Id(String aAvkonLocString, String aQtLocString) - { - this.iAvkonLocString = aAvkonLocString; - this.iQtLocString = aQtLocString; - } - - public String getString(int aPlatform) - { - if (aPlatform == ResourceLoader.QT) - { - return iQtLocString; - } - else - { - return iAvkonLocString; - } - } -} diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerDetailedErrorMessage.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerDetailedErrorMessage.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerDetailedErrorMessage.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -22,6 +22,9 @@ /** * Class defining Installer detailed error messages. + * + * @author Nokia Corporation + * @version 1.0 */ public final class InstallerDetailedErrorMessage extends ErrorMessageBase { @@ -39,8 +42,6 @@ public static final int UNINST_BLOCKED = 11; public static final int INTERNAL_ERROR = 12; public static final int NO_MEM_MB = 13; - public static final int INST_CANCEL = 14; - public static final int UNINST_CANCEL = 15; /*** ----------------------------- PUBLIC ------------------------------ */ /*** ---------------------------- PROTECTED --------------------------- */ @@ -57,42 +58,19 @@ return iMessageTable; } Hashtable messageTable = new Hashtable(); - if (getLocaleIdQt() == null) - { - messageTable.put(new Integer(NO_MEM), "no_mem_detail"); - messageTable.put(new Integer(NO_MEM_MB), "no_mem_detail_mb"); - messageTable.put(new Integer(NO_NET), "no_net_detail"); - messageTable.put(new Integer(ATTR_BAD_SYNTAX), "attr_bad_syntax"); - messageTable.put(new Integer(ATTR_MISSING), "attr_missing"); - messageTable.put(new Integer(ATTR_MISMATCH), "attr_mismatch"); - messageTable.put(new Integer(ATTR_UNSUPPORTED), "attr_unsupported_value"); - messageTable.put(new Integer(ATTR_HANDLING_FAILED), "attr_handling_failed"); - messageTable.put(new Integer(CERT_UNSUPPORTED), "cert_unsupported"); - messageTable.put(new Integer(PROT_PKG_MISUSE), "protected_pkg_misuse"); - messageTable.put(new Integer(DIFFERENT_SIGNERS), "different_signers"); - messageTable.put(new Integer(UNINST_BLOCKED), "uninst_blocked"); - messageTable.put(new Integer(INTERNAL_ERROR), "internal"); - messageTable.put(new Integer(INST_CANCEL), "Installation cancelled."); - messageTable.put(new Integer(UNINST_CANCEL), "Uninstallation cancelled."); - } - else - { - messageTable.put(new Integer(NO_MEM), "error_no_mem_detail"); - messageTable.put(new Integer(NO_MEM_MB), "error_no_mem_detail_mb"); - messageTable.put(new Integer(NO_NET), "error_no_net_detail"); - messageTable.put(new Integer(ATTR_BAD_SYNTAX), "error_bad_syntax"); - messageTable.put(new Integer(ATTR_MISSING), "error_attr_missing"); - messageTable.put(new Integer(ATTR_MISMATCH), "error_attr_mismatch"); - messageTable.put(new Integer(ATTR_UNSUPPORTED), "error_attr_unsupported_value"); - messageTable.put(new Integer(ATTR_HANDLING_FAILED), "error_attr_handling_failed"); - messageTable.put(new Integer(CERT_UNSUPPORTED), "error_cert_unsupported"); - messageTable.put(new Integer(PROT_PKG_MISUSE), "error_pkg_misuse"); - messageTable.put(new Integer(DIFFERENT_SIGNERS), "error_different_signers"); - messageTable.put(new Integer(UNINST_BLOCKED), "uninst_blocked"); - messageTable.put(new Integer(INTERNAL_ERROR), "internal_error"); - messageTable.put(new Integer(INST_CANCEL), "error_cancel"); - messageTable.put(new Integer(UNINST_CANCEL), "error_uninst_cancel"); - } + messageTable.put(new Integer(NO_MEM), "no_mem_detail"); + messageTable.put(new Integer(NO_MEM_MB), "no_mem_detail_mb"); + messageTable.put(new Integer(NO_NET), "no_net_detail"); + messageTable.put(new Integer(ATTR_BAD_SYNTAX), "attr_bad_syntax"); + messageTable.put(new Integer(ATTR_MISSING), "attr_missing"); + messageTable.put(new Integer(ATTR_MISMATCH), "attr_mismatch"); + messageTable.put(new Integer(ATTR_UNSUPPORTED), "attr_unsupported_value"); + messageTable.put(new Integer(ATTR_HANDLING_FAILED), "attr_handling_failed"); + messageTable.put(new Integer(CERT_UNSUPPORTED), "cert_unsupported"); + messageTable.put(new Integer(PROT_PKG_MISUSE), "protected_pkg_misuse"); + messageTable.put(new Integer(DIFFERENT_SIGNERS), "different_signers"); + messageTable.put(new Integer(UNINST_BLOCKED), "uninst_blocked"); + messageTable.put(new Integer(INTERNAL_ERROR), "internal"); iMessageTable = messageTable; return iMessageTable; } @@ -106,14 +84,7 @@ { if (iRes == null) { - if (getLocaleIdQt() == null) - { - iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_"); - } - else - { - iRes = ResourceLoader.getInstance("javaapplicationinstaller", "txt_java_inst_info_"); - } + iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_"); } return iRes; } diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerErrorMessage.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerErrorMessage.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerErrorMessage.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -22,31 +22,34 @@ /** * Class defining Installer short error messages. + * + * @author Nokia Corporation + * @version 1.0 */ public final class InstallerErrorMessage extends ErrorMessageBase { // Installation error codes. - public static final int INST_NO_MEM = 1 + ErrorMessageBase.INSTALLER_RANGE_START; - public static final int INST_NO_NET = 2 + ErrorMessageBase.INSTALLER_RANGE_START; - public static final int INST_CORRUPT_PKG = 3 + ErrorMessageBase.INSTALLER_RANGE_START; - public static final int INST_COMPAT_ERR = 4 + ErrorMessageBase.INSTALLER_RANGE_START; - public static final int INST_AUTHORIZATION_ERR = 5 + ErrorMessageBase.INSTALLER_RANGE_START; - public static final int INST_AUTHENTICATION_ERR = 6 + ErrorMessageBase.INSTALLER_RANGE_START; - public static final int INST_PUSH_REG_ERR = 7 + ErrorMessageBase.INSTALLER_RANGE_START; - public static final int INST_UNEXPECTED_ERR = 8 + ErrorMessageBase.INSTALLER_RANGE_START; - public static final int INST_CANCEL = 9 + ErrorMessageBase.INSTALLER_RANGE_START; + public static final int INST_NO_MEM = 1; + public static final int INST_NO_NET = 2; + public static final int INST_CORRUPT_PKG = 3; + public static final int INST_COMPAT_ERR = 4; + public static final int INST_AUTHORIZATION_ERR = 5; + public static final int INST_AUTHENTICATION_ERR = 6; + public static final int INST_PUSH_REG_ERR = 7; + public static final int INST_UNEXPECTED_ERR = 8; + public static final int INST_CANCEL = 9; // Uninstallation error codes. - public static final int UNINST_NOT_ALLOWED = 10 + ErrorMessageBase.INSTALLER_RANGE_START; - public static final int UNINST_UNEXPECTED_ERR = 11 + ErrorMessageBase.INSTALLER_RANGE_START; - public static final int UNINST_CANCEL = 12 + ErrorMessageBase.INSTALLER_RANGE_START; + public static final int UNINST_NOT_ALLOWED = 101; + public static final int UNINST_UNEXPECTED_ERR = 102; + public static final int UNINST_CANCEL = 103; /** * Error codes for other than install and uninstall operations. * Do not use these error codes in installation or uninstallation. * These are only used in installer "list" and "test" commands. */ - public static final int OTHER_UNEXPECTED_ERR = 13 + ErrorMessageBase.INSTALLER_RANGE_START; + public static final int OTHER_UNEXPECTED_ERR = 201; /*** ----------------------------- PUBLIC ------------------------------ */ /*** ---------------------------- PROTECTED --------------------------- */ @@ -63,38 +66,19 @@ return iMessageTable; } Hashtable messageTable = new Hashtable(); - if (getLocaleIdQt() == null) - { - messageTable.put(new Integer(INST_NO_MEM), "no_mem"); - messageTable.put(new Integer(INST_NO_NET), "no_net"); - messageTable.put(new Integer(INST_CORRUPT_PKG), "corrupt_pkg"); - messageTable.put(new Integer(INST_COMPAT_ERR), "compat_err"); - messageTable.put(new Integer(INST_AUTHORIZATION_ERR), "authorization_err"); - messageTable.put(new Integer(INST_AUTHENTICATION_ERR), "authentication_err"); - messageTable.put(new Integer(INST_PUSH_REG_ERR), "push_reg_err"); - messageTable.put(new Integer(INST_UNEXPECTED_ERR), "unexpected"); - messageTable.put(new Integer(INST_CANCEL), "cancel"); - messageTable.put(new Integer(UNINST_NOT_ALLOWED), "uninst_not_allowed"); - messageTable.put(new Integer(UNINST_UNEXPECTED_ERR), "uninst_unexpected"); - messageTable.put(new Integer(UNINST_CANCEL), "uninst_cancel"); - messageTable.put(new Integer(OTHER_UNEXPECTED_ERR), "other_unexpected"); - } - else - { - messageTable.put(new Integer(INST_NO_MEM), "info_there_is_not_enough_space_currently"); - messageTable.put(new Integer(INST_NO_NET), "info_network_is_unavailable_currently"); - messageTable.put(new Integer(INST_CORRUPT_PKG), "info_installation_package_is_invalid"); - messageTable.put(new Integer(INST_COMPAT_ERR), "info_application_is_not_compatible_with"); - messageTable.put(new Integer(INST_AUTHORIZATION_ERR), "info_there_is_a_security_issue_with_this"); - messageTable.put(new Integer(INST_AUTHENTICATION_ERR), "info_there_is_a_security_issue_with_this"); - messageTable.put(new Integer(INST_PUSH_REG_ERR), "info_an_unexpected_error_occurred"); - messageTable.put(new Integer(INST_UNEXPECTED_ERR), "info_an_unexpected_error_occurred"); - messageTable.put(new Integer(INST_CANCEL), "info_application_not_installed"); - messageTable.put(new Integer(UNINST_NOT_ALLOWED), "info_application_cannot_be_deleted"); - messageTable.put(new Integer(UNINST_UNEXPECTED_ERR), "installer_info_uninstallation_failed"); - messageTable.put(new Integer(UNINST_CANCEL), "info_application_not_deleted"); - messageTable.put(new Integer(OTHER_UNEXPECTED_ERR), "info_an_unexpected_error_occurred"); - } + messageTable.put(new Integer(INST_NO_MEM), "no_mem"); + messageTable.put(new Integer(INST_NO_NET), "no_net"); + messageTable.put(new Integer(INST_CORRUPT_PKG), "corrupt_pkg"); + messageTable.put(new Integer(INST_COMPAT_ERR), "compat_err"); + messageTable.put(new Integer(INST_AUTHORIZATION_ERR), "authorization_err"); + messageTable.put(new Integer(INST_AUTHENTICATION_ERR), "authentication_err"); + messageTable.put(new Integer(INST_PUSH_REG_ERR), "push_reg_err"); + messageTable.put(new Integer(INST_UNEXPECTED_ERR), "unexpected"); + messageTable.put(new Integer(INST_CANCEL), "cancel"); + messageTable.put(new Integer(UNINST_NOT_ALLOWED), "uninst_not_allowed"); + messageTable.put(new Integer(UNINST_UNEXPECTED_ERR), "uninst_unexpected"); + messageTable.put(new Integer(UNINST_CANCEL), "uninst_cancel"); + messageTable.put(new Integer(OTHER_UNEXPECTED_ERR), "other_unexpected"); iMessageTable = messageTable; return iMessageTable; } @@ -108,14 +92,7 @@ { if (iRes == null) { - if (getLocaleIdQt() == null) - { - iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_"); - } - else - { - iRes = ResourceLoader.getInstance("common_errors", "txt_error_"); - } + iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_"); } return iRes; } diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/utils/LocalizedTextProvider.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/LocalizedTextProvider.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/LocalizedTextProvider.java Fri Oct 22 14:23:56 2010 +0100 @@ -28,5 +28,5 @@ * @return the text associated with the provided * identifier and parameters */ - public abstract String getText(Id aTextId, Object[] aTextParams); + public abstract String getText(String aTextId, Object[] aTextParams); } diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java Fri Oct 22 14:23:56 2010 +0100 @@ -81,7 +81,6 @@ public static final int EJavaAppMngrPlugin = 35; public static final int EJavaBroadcast = 36; public static final int EJavaAMMS = 37; - public static final int EJavaSettings = 38; // add name of new components here @@ -139,7 +138,6 @@ false, //EJavaAppMngrPlugin = 35; false, //EJavaBroadcast = 36; false, //EJavaAMMS = 37; - false, //EJavaSettings = 38; // add new components here }; diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java Fri Oct 22 14:23:56 2010 +0100 @@ -40,11 +40,6 @@ */ public class ResourceLoader { - /** AVKON UI identifier. */ - public static final int AVKON = 1; - /** QT UI identifier. */ - public static final int QT = 2; - /** Localisation resource basepath */ private static final String LOC_RESOURCE_BASE = "/resources/com/nokia/mj/impl/"; @@ -55,30 +50,10 @@ private Hashtable resourceMap = new Hashtable(); /** Resource name prefix */ - private String prefix = null; - - /** Platform localisation type. */ - private int locType = -1; + private String prefix; /*** ----------------------------- PUBLIC ------------------------------ */ - public static ResourceLoader getInstance(String avkonFileName, - String avkonPrefix, - String qtFileName, - String qtPrefix) - { - // Avkon name prefix pair is used as key and this is same between platforms. - String key = avkonFileName + ":" + avkonPrefix; - ResourceLoader result = (ResourceLoader)resourceLoaders.get(key); - - if (result == null) - { - result = new ResourceLoader(avkonFileName, avkonPrefix, qtFileName, qtPrefix); - resourceLoaders.put(key, result); - } - return result; - } - /** * Returns a resource loader instance. * @@ -99,46 +74,6 @@ } /** - * Private constructor. Loads localisation resource file. - * On Avkon UI it's resources are loaded. On Qt platfor it's - * resource is first read and if that fails Avkon one is read. - * - * @param avkonFileName Avkon localisation resource file. - * @param avkonPrefix Avkon logical string prefix. - * @param qtFileName Qt localisation resource file. - * @param qtPrefix Qt logical string prefix. - */ - private ResourceLoader(String avkonFileName, - String avkonPrefix, - String qtFileName, - String qtPrefix) - { - String localeId = getLocaleIdQt(); - - if (localeId == null) - { - locType = AVKON; - prefix = avkonPrefix; - loadFile(avkonFileName, true); - } - else - { - if (!loadFile(qtFileName, false)) - { - // Fallback to Avkon - locType = AVKON; - prefix = avkonPrefix; - loadFile(avkonFileName, true); - } - else - { - locType = QT; - prefix = qtPrefix; - } - } - } - - /** * Creates resource loader, using the current locale of the environment. * * @param resourceName name of the resource @@ -147,7 +82,7 @@ public ResourceLoader(String resourceName, String aPrefix) { prefix = aPrefix; - loadFile(resourceName, true); // Avkon + loadFile(resourceName); } /** @@ -163,59 +98,6 @@ } /** - * Get a string formatter of a given resource id. - * - * @param avkonId Avkon resource id. - * @param qtId Qt resource id. - * @return formatter instance - * @see Formatter - */ - public Formatter format(String avkonId, String qtId) - { - if (locType == AVKON) - { - return new Formatter(string(avkonId)); - } - else - { - return new Formatter(string(qtId)); - } - } - - /** - * Formats localised text with specified parameters from an array. - * - * @param avkonId Avkon resource id. - * @param qtId Qt resource id. - * @param textParameters parameters to be filled into the text. - * @return localised text formatted with the provided parameters. - * @see Formatter - */ - public String format(String avkonId, String qtId, Object[] textParameters) - { - if (locType == AVKON) - { - return new Formatter(string(avkonId)).format(textParameters); - } - else - { - return new Formatter(string(qtId)).format(textParameters); - } - } - - /** - * Get a string formatter of a given resource id. - * - * @param id resource id - * @return formatter instance - * @see Formatter - */ - public Formatter format(Id id) - { - return new Formatter(id.getString(locType)); - } - - /** * Formats localised text with specified parameters from an array. * * @param id resource id @@ -229,20 +111,6 @@ } /** - * Formats localised text with specified parameters from an array. - * - * @param id resource id - * @param textParameters parameters to be filled into the text - * @return localised text formatted with the provided parameters - * @see Formatter - */ - public String format(Id id, Object[] textParameters) - { - return new Formatter(string(id.getString(locType))).format(textParameters); - } - - - /** * Get a plain string resource with a given resource id. * * @param id resource id, either with prefix or without @@ -304,77 +172,35 @@ return "sc"; } - /** - * Return locale id string on Qt platform. - * - * @return Qt Locale Id String, null if not in Qt. - */ - public static String getLocaleIdQt() - { - return _getLocaleIdQt(); - } - - /*** ----------------------------- PRIVATE ---------------------------- */ /** - * Loads the resources from .loc type file. - * - * @param resourceName name of the resource file. - * @param aIs InputStream pointing to resource. It will be closed after use. - * @param true if operation succeed. + * Loads the resources from .loc type file */ - private boolean loadFile(String resourceName, boolean avkon) + private void loadFile(String resourceName) { InputStream is = null; - if (!avkon) // Qt resources. + // Load with real locale id + is = this.getClass().getResourceAsStream( + LOC_RESOURCE_BASE + resourceName + "_" + getLocaleId() + ".loc"); + if (is == null) { - String langName = getLocaleIdQt(); - - // Emulator returns falsely en_GB as engineering English locale name. - if (langName.equals("en_GB")) - { - langName = "en"; - } - - // Load with real locale id + // Load the engineering english is = this.getClass().getResourceAsStream( - LOC_RESOURCE_BASE + resourceName + "_" + langName + ".loc"); - - if (is == null) - { - /* - * Does not exist. No need to continue as avkon file cannot - * found using qt name. - */ - return false; - } + LOC_RESOURCE_BASE + resourceName + "_sc" + ".loc"); } - else // Avkon resources. + if (is == null) { - // Load with real locale id + // Load the reference engineering english is = this.getClass().getResourceAsStream( - LOC_RESOURCE_BASE + resourceName + "_" + getLocaleId() + ".loc"); - - if (is == null) - { - // Load the engineering english - is = this.getClass().getResourceAsStream( - LOC_RESOURCE_BASE + resourceName + "_sc" + ".loc"); - } - if (is == null) - { - // Load the reference engineering english - is = this.getClass().getResourceAsStream( - LOC_RESOURCE_BASE + resourceName + ".loc"); - } - if (is == null) - { - Logger.WLOG(Logger.EUtils, - "Cannot load resource file: " + resourceName); - return false; - } + LOC_RESOURCE_BASE + resourceName + ".loc"); + } + if (is == null) + { + Logger.WLOG(Logger.EUtils, + "Cannot load resource file: " + resourceName); + return; } try @@ -422,8 +248,6 @@ "Resource file " + resourceName + " handling failed: " + ex.getMessage()); } - - return true; } /** @@ -542,11 +366,4 @@ */ private native int _getLocaleId(); - /** - * Get Locale Id on Qt platform. - * - * @return locale Id string. If not in Qt null. - */ - private static native String _getLocaleIdQt(); - } diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/javasrc/com/nokia/mj/impl/utils/Version.java diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/src.s60/formatternative.cpp --- a/javacommons/utils/src.s60/formatternative.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/src.s60/formatternative.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -16,14 +16,10 @@ */ +//#include #include #include - -#ifdef RD_JAVA_UI_QT -#include -#else // RD_JAVA_UI_QT #include -#endif // RD_JAVA_UI_QT #include "com_nokia_mj_impl_utils_Formatter.h" #include "com_nokia_mj_impl_utils_ResourceLoader.h" @@ -49,6 +45,7 @@ const TInt KMaxNumberFormatSize = 40; using namespace java::util; +// _LIT( KAvkonResFile, "z:\\resource\\avkon.rsc" ); JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_Formatter__1formatInteger (JNIEnv *aJni, jobject, jint aNumber) @@ -71,10 +68,7 @@ "Cannot format %d to current locale. Error: %d", aNumber, error); } -#ifndef RD_JAVA_UI_QT - AknTextUtils::LanguageSpecificNumberConversion( numberPtr ); -#endif // RD_JAVA_UI_QT - + AknTextUtils::LanguageSpecificNumberConversion( numberPtr ); return aJni->NewString( (const jchar*)numberPtr.Ptr(), numberPtr.Length()); } @@ -122,24 +116,8 @@ std::wstring wstr = JniUtils::jstringToWstring(aEnv, str); HBufC* buf = S60CommonUtils::wstringToDes(wstr.c_str()); TPtr ptr(buf->Des()); - -#ifndef RD_JAVA_UI_QT AknTextUtils::LanguageSpecificNumberConversion( ptr ); -#endif // RD_JAVA_UI_QT ret = S60CommonUtils::NativeToJavaString(*aEnv, ptr); delete buf; buf = NULL; return ret; } - -JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_ResourceLoader__1getLocaleIdQt - (JNIEnv *env, jclass) -{ -#ifdef RD_JAVA_UI_QT - QString localeName = QLocale::system().name(); - jstring loc = env->NewString(localeName.utf16(), localeName.size()); - return loc; -#else // RD_JAVA_UI_QT - (void)env; // just to suppress a warning - return NULL; -#endif // RD_JAVA_UI_QT -} diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/src.s60/javaoslayer.cpp --- a/javacommons/utils/src.s60/javaoslayer.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/src.s60/javaoslayer.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -39,7 +39,6 @@ const char * const BOOT_CLASSPATH_MIDP_FILE = "midpodclist"; const char * const BOOT_CLASSPATH_INSTALLER_FILE = "installerodclist"; const char * const BOOT_CLASSPATH_TCKRUNNER_FILE = "tckrunnerodclist"; -const char * const BOOT_CLASSPATH_JAVACONTROLPANEL_FILE = "javacontrolpanelodclist"; _LIT(KStartUpTraceDir, "java\\full"); _LIT(KStartUpTraceFile, "startup.txt"); @@ -304,10 +303,6 @@ { path.append(BOOT_CLASSPATH_TCKRUNNER_FILE); } - else if (BOOT_CLASSPATH_JAVACONTROLPANEL == pathType) - { - path.append(BOOT_CLASSPATH_JAVACONTROLPANEL_FILE); - } else { path.append(BOOT_CLASSPATH_MIDP_FILE); diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/src/debugutils.cpp diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/src/javacommonutils.cpp --- a/javacommons/utils/src/javacommonutils.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/src/javacommonutils.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -289,34 +289,6 @@ return result; } -OS_EXPORT std::wstring JavaCommonUtils::wbase64encode(const std::wstring& aData) -{ - BIO* b64 = BIO_new(BIO_f_base64()); - if (NULL == b64) - { - return L""; - } - BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); - BIO* bmem = BIO_new(BIO_s_mem()); - - b64 = BIO_push(b64, bmem); - BIO_write(b64, aData.c_str(), aData.length() * 2); - BIO_flush(b64); - - BUF_MEM* bptr; - BIO_get_mem_ptr(b64, &bptr); - - std::wstring result; - // convert each char to wchar - for (int i = 0; i < bptr->length; i++) - { - result.push_back((wchar_t)*(bptr->data + i)); - } - BIO_free_all(b64); - - return result; -} - OS_EXPORT std::string JavaCommonUtils::base64decode(const std::string& aData) { BIO* b64 = BIO_new(BIO_f_base64()); diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/src/javainifileutils.cpp --- a/javacommons/utils/src/javainifileutils.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/src/javainifileutils.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -157,9 +157,9 @@ } rewind(iniFile); data = new char[len+1]; + data[len] = 0; if (data != 0) { - data[len] = 0; fread(data, sizeof(char), len, iniFile); } fclose(iniFile); diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/src/logger.cpp --- a/javacommons/utils/src/logger.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javacommons/utils/src/logger.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -30,10 +30,6 @@ #include #include -#include -#include -#include - #include "jdebug_omj.h" #include "logger.h" #include "javacommonutils.h" @@ -340,16 +336,14 @@ int logFileNameLen = strlen(fileName); TPtr8 fileNamePtr((unsigned char*)fileName, logFileNameLen, logFileNameLen); RBuf nameBuf; - int rc = nameBuf.Create(fileNamePtr.MaxLength()); - if (rc == KErrNone) - { - nameBuf.Copy(fileNamePtr); + nameBuf.Create(fileNamePtr.MaxLength()); + nameBuf.Copy(fileNamePtr); - TInt len = strlen(txt); - TPtr8 ptr((unsigned char*)txt, len, len); - RFileLogger::Write(KJavaLogDir, nameBuf, EFileLoggingModeAppendRaw, ptr); - nameBuf.Close(); - } + TInt len = strlen(txt); + TPtr8 ptr((unsigned char*)txt, len, len); + RFileLogger::Write(KJavaLogDir, nameBuf, EFileLoggingModeAppendRaw, ptr); + + nameBuf.Close(); #else //J_LOG_USE_RLOGGER_ENABLED diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/SystemPropertyTests.java diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/BufferedReaderTests.java diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/concurrent/ConcurrentTests.java diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/tsrc/localisation/build/build.xml diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/tsrc/localisation/javasrc/com/nokia/mj/test/utils/LocalisationTest.java diff -r 461e71b327da -r 0553e2305d00 javacommons/utils/tsrc/src/testoslayer.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/bld.inf diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluecove/build/javabluecove_0x2002DC97.mmp --- a/javaextensions/bluetooth/bluecove/build/javabluecove_0x2002DC97.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluecove/build/javabluecove_0x2002DC97.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60bluetoothplatformcontrol.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60btdialog.cpp --- a/javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60btdialog.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60btdialog.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -23,13 +23,6 @@ #include "s60btdialog.h" #include "logger.h" -#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS -#include -#include -#include - -#define QUERY_BUF_LEN 512 -#endif using namespace java::bluetooth; @@ -51,9 +44,7 @@ void CS60BTDialog::ConstructL() { LOG(EJavaBluetooth, EInfo, "+ CS60BTDialog::ConstructL()"); -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS User::LeaveIfError(mNotifier.Connect()); -#endif LOG(EJavaBluetooth, EInfo, "- CS60BTDialog::ConstructL()"); } @@ -66,9 +57,7 @@ { CS60BTDialog* self = new(ELeave) CS60BTDialog; CleanupStack::PushL(self); -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS self->ConstructL(); -#endif return self; } @@ -81,11 +70,8 @@ { JELOG2(EJavaBluetooth); LOG(EJavaBluetooth, EInfo, "+ CS60BTDialog::~CS60BTDialog()"); - -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS DoCancel(); mNotifier.Close(); -#endif LOG(EJavaBluetooth, EInfo, "- CS60BTDialog::~CS60BTDialog()"); } @@ -101,42 +87,14 @@ JELOG2(EJavaBluetooth); LOG1(EJavaBluetooth, EInfo,"+ CS60BTDialog::ShowBTQueryDialog(): aQueryType = %d", aQueryType); - -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS mQueryParamsPckg().iMessageType = aQueryType; mQueryParamsPckg().iNameExists = ETrue; mQueryParamsPckg().iName.Copy(aAppName); mNotifier.StartNotifierAndGetResponse(mStatus, KBTGenericQueryNotifierUid, mQueryParamsPckg, mQueryResult); + User::WaitForRequest(mStatus); -#else - _LIT(KAppInfo,"Application %S cannot be used when Bluetooth is off Activate Bluetooth ?"); - _LIT(KAppInfomsg,"Change 'My phone's visibility' setting to 'Show to all'? Application '%S' cannot be used when the visibility is set as 'Hidden'."); - - TBuf queryBuf; - TInt err = KErrNone; - TBool userOpt; - - queryBuf.Zero(); - if (aQueryType == EBTIsOffJavaQuery) - { - queryBuf.Format(KAppInfo,&aAppName); - } - else if (aQueryType == EBTIsNotShownQuery) - { - queryBuf.Format(KAppInfomsg,&aAppName); - } - - TRAP(err, userOpt = ShowBTQueryHbDialogL(queryBuf)); - LOG1(EJavaBluetooth, EInfo," CS60BTDialog::ShowBTQueryDialog(): mQueryResult = %d", err); - - if (err != KErrNone ) - mQueryResult = EFalse; - else - mQueryResult = userOpt; -#endif - LOG1(EJavaBluetooth, EInfo,"- CS60BTDialog::ShowBTQueryDialog(): mQueryResult = %d", mQueryResult()); return mQueryResult(); } @@ -151,42 +109,6 @@ void CS60BTDialog::DoCancel() { LOG(EJavaBluetooth, EInfo, "+ CS60BTDialog::DoCancel()"); -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS mNotifier.CancelNotifier(KBTGenericQueryNotifierUid); -#endif LOG(EJavaBluetooth, EInfo, "- CS60BTDialog::DoCancel()"); } - -#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS - -TBool CS60BTDialog::ShowBTQueryHbDialogL(const TDesC& aBufData) -{ - TBool result = EFalse; - - CHbDeviceMessageBoxSymbian* messageBox - = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EQuestion); - CleanupStack::PushL(messageBox); - - messageBox->SetTextL(aBufData); - messageBox->SetTimeout(HbPopup::NoTimeout); - - // Read localised versions instead of hard coded values. - _LIT(KAllowButtonText, "Yes"); - _LIT(KDenyButtonText, "No"); - - messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::EAcceptButton, KAllowButtonText); - messageBox->SetButton(CHbDeviceMessageBoxSymbian::EAcceptButton, ETrue); - messageBox->SetButtonTextL(CHbDeviceMessageBoxSymbian::ERejectButton, KDenyButtonText); - messageBox->SetButton(CHbDeviceMessageBoxSymbian::ERejectButton, ETrue); - - if (messageBox->ExecL() == CHbDeviceMessageBoxSymbian::EAcceptButton) - result = ETrue; - else - result = EFalse; - - messageBox->Close(); - CleanupStack::PopAndDestroy(messageBox); - - return result; -} -#endif diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60btdialog.h --- a/javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60btdialog.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60btdialog.h Fri Oct 22 14:23:56 2010 +0100 @@ -57,11 +57,6 @@ TBool ShowBTQueryDialog(const TDesC& aAppName, const TBool aInstalling, TBTGenericQueryNoteType aQueryType); -#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS - TBool ShowBTQueryHbDialogL(const TDesC& aBufData); -#endif - - /** * Cancels the asynchronous request to the query list dialog. * @@ -77,9 +72,7 @@ private: // data TRequestStatus mStatus; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS RNotifier mNotifier; -#endif TBTGenericQueryNotiferParamsPckg mQueryParamsPckg; TPckgBuf mQueryResult; }; diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons.pro --- a/javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons.pro Fri Oct 22 14:23:56 2010 +0100 @@ -14,33 +14,20 @@ # Description: # -include(../../../../inc/build_defines.pri) - TEMPLATE=lib TARGET=javabluetoothcommons CONFIG += omj java stl +CONFIG -= qt -contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_5_0) { - CONFIG -= qt -} -contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_9_2) { - CONFIG -= qt -} -contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) { - CONFIG += hb -} - - -symbian { +symbian { SOURCES += ../src/*.cpp SOURCES += ../src.s60/*.cpp SOURCES += ../bluetoothplatformcontrol/src/*.cpp - SOURCES += ../bluetoothplatformcontrol/src.s60/*.cpp + SOURCES += ../bluetoothplatformcontrol/src.s60/*.cpp } LIBS += -lsdpdatabase -lbtengsettings -lbluetooth -lbtmanclient \ -lbtdevice -ljavacomms -ljavafileutils -lesock + include(../../../../build/omj.pri) - - diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons_0x2002DC99.mmp --- a/javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons_0x2002DC99.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons_0x2002DC99.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothcommons/src.s60/bluetoothclientconnection.cpp --- a/javaextensions/bluetooth/bluetoothcommons/src.s60/bluetoothclientconnection.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothcommons/src.s60/bluetoothclientconnection.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -36,15 +36,19 @@ OS_EXPORT BluetoothClientConnection::BluetoothClientConnection (BluetoothFunctionServer* server): - mServer(server), + mServer(server), mSocket(0), mShutdownNotifyMonitor(NULL), mReadNotifyMonitor(NULL), + mReadStatus(0), mBuffer(NULL, 0), mSendNotifyMonitor(NULL), + mRequestedRMtu(0), mRequestedTMtu(0), + mWriteStatus(0), mProtocol(0), mNegotiatedReceiveMtu(0), mNegotiatedTransmitMtu(0), mRemoteBTAddr(0), mConnectNotifyMonitor(NULL), + mConnectError(0), mMakeJavaCallbackOnRead(EFalse), mReadPending(EFalse), mBufferInitialized(EFalse) @@ -58,11 +62,15 @@ mSocket(aSocket), mShutdownNotifyMonitor(NULL), mReadNotifyMonitor(NULL), + mReadStatus(0), mBuffer(NULL, 0), mSendNotifyMonitor(NULL), + mRequestedRMtu(0), mRequestedTMtu(0), + mWriteStatus(0), mProtocol(0), mNegotiatedReceiveMtu(0), mNegotiatedTransmitMtu(0), mRemoteBTAddr(0), + mConnectError(0), mMakeJavaCallbackOnRead(EFalse), mReadPending(EFalse), mBufferInitialized(EFalse) diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp --- a/javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -148,7 +148,7 @@ TPtrC8 uuidDes(uuidBytes, uuidByteLength); TRAPD(err, uuid.SetL(uuidDes)); - delete[] uuidBytes; + delete uuidBytes; uuidBytes = NULL; if (KErrNone != err) @@ -205,7 +205,7 @@ char *fileName = java::util::JavaCommonUtils::wstringToUtf8( persistentFileName); persistentRecFd = open(fileName, O_RDONLY); - delete[] fileName; + delete fileName; } catch (ExceptionBase ex) { @@ -618,7 +618,7 @@ write(mSrvRecFd, (char *) &aDeviceServiceClasses, sizeof(aDeviceServiceClasses)); - delete[] fileName; + delete fileName; } catch (ExceptionBase ex) { @@ -1286,7 +1286,7 @@ char *fileName = java::util::JavaCommonUtils::wstringToUtf8(persistentFileName); persistentRecFd = open(fileName, O_RDONLY); - delete[] fileName; + delete fileName; } catch (ExceptionBase ex) { @@ -1310,10 +1310,7 @@ unsigned int devServClass = 0; ret = read(persistentRecFd, &devServClass, sizeof(devServClass)); if (ret <= 0) - { - delete srvRecPopulator; return; - } elementBuilder = srvRecPopulator->SetDeviceServiceClass(devServClass); diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothplugins/btgoeppushplugin/build/javabtgoepscplugin_0x2002DC9A.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btgoeppushplugin/build/javabtgoepscplugin_0x2002DC9A.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btgoeppushplugin/build/javabtgoepscplugin_0x2002DC9A.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothplugins/btjavacaptainplugin/build/javacaptain_ext_btdeviceclassmanager_0x2002DC9D.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btjavacaptainplugin/build/javacaptain_ext_btdeviceclassmanager_0x2002DC9D.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btjavacaptainplugin/build/javacaptain_ext_btdeviceclassmanager_0x2002DC9D.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/build/javabtl2capscplugin_0x2002DC9B.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/build/javabtl2capscplugin_0x2002DC9B.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/build/javabtl2capscplugin_0x2002DC9B.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src.s60/btl2capserverconnection.cpp --- a/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src.s60/btl2capserverconnection.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src.s60/btl2capserverconnection.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -40,11 +40,16 @@ OS_EXPORT L2CAPServerConnection::L2CAPServerConnection( java::bluetooth::BluetoothFunctionServer* server): mAcceptMonitor(NULL), + mAcceptStatus(0), + mAcceptedSocket(0), + mMasterRoleRequested(EFalse), mAsyncAccept(false), mAvoidFilter(false), + mPushEventListener(0), mBtUrlParams(NULL), mBtClientConn(NULL), mServer(server), + mListenSock(0), mIsConnected(EFalse), mServRec(NULL), mState(ENone) diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src/btl2cappushserverconnection.cpp --- a/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src/btl2cappushserverconnection.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src/btl2cappushserverconnection.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -37,9 +37,11 @@ OS_EXPORT L2CapPushServerConnection::L2CapPushServerConnection( const wstring aUri, const wstring aFilter): mAcceptMonitor(NULL), + mConnectionListener(0), mConnectionUri(aUri), mConnectionFilter(aFilter), mL2CAPServer(NULL), + mClientConnection(0), mPendingConnection(false), mListening(false), mCreatedByPush(false), @@ -199,9 +201,9 @@ BluetoothNameLookup * nameLookup = NULL; long long remoteDevAddr = aClientConnection->getRemoteAddress(); - ELOG1(EJavaBluetooth, - "+ L2CapPushServerConnection::handleConnectionRequest DeviceAddress:%llx", - remoteDevAddr); + LOG1(EJavaBluetooth, EInfo, + "L2CapPushServerConnection::handleConnectionRequest: remoteDevAddr: %llx", + remoteDevAddr); TRAPD(lookupErr, { nameLookup = BluetoothNameLookup::NewL(); diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothplugins/btspppushplugin/build/javabtsppscplugin_0x2002DC9C.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/build/javabtsppscplugin_0x2002DC9C.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/build/javabtsppscplugin_0x2002DC9C.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothplugins/btspppushplugin/src.s60/btrfcommserverconnection.cpp --- a/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/src.s60/btrfcommserverconnection.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/src.s60/btrfcommserverconnection.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -42,10 +42,15 @@ OS_EXPORT RFCOMMServerConnection::RFCOMMServerConnection( java::bluetooth::BluetoothFunctionServer* server): mAcceptMonitor(NULL), + mAcceptStatus(0), + mAcceptedSocket(0), mAsyncAccept(false), + mAvoidFilter(false), + mPushEventListener(0), mBtUrlParams(NULL), mBtClientConn(NULL), mServer(server), + mListenSock(0), mIsConnected(EFalse), mServRec(NULL), mState(ENone) diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/bluetoothplugins/btspppushplugin/src/rfcommpushserverconnection.cpp --- a/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/src/rfcommpushserverconnection.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/src/rfcommpushserverconnection.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -38,10 +38,12 @@ OS_EXPORT RFCOMMPushServerConnection::RFCOMMPushServerConnection( const wstring aUri, const wstring aFilter,ServerConnectionFactoryBase* aFactory): mAcceptMonitor(NULL), + mConnectionListener(0), mConnectionUri(aUri), mConnectionFilter(aFilter), mRFCOMMServer(NULL), mConnectionFactory(aFactory), + mClientConnection(0), mIsGOEP(false), mPendingConnection(false), mListening(false), diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/omjbluetooth/build/javabluetooth_0x2002DC98.mmp --- a/javaextensions/bluetooth/omjbluetooth/build/javabluetooth_0x2002DC98.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/omjbluetooth/build/javabluetooth_0x2002DC98.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/bluetooth/omjbluetooth/javasrc/com/nokia/mj/impl/properties/bluetooth/BtDynamicPropertyHandler.java --- a/javaextensions/bluetooth/omjbluetooth/javasrc/com/nokia/mj/impl/properties/bluetooth/BtDynamicPropertyHandler.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/bluetooth/omjbluetooth/javasrc/com/nokia/mj/impl/properties/bluetooth/BtDynamicPropertyHandler.java Fri Oct 22 14:23:56 2010 +0100 @@ -65,7 +65,7 @@ private static final int MASTER_SWITCH = 7; - private static final int SD_TRANS_MAX = 1; + private static final int SD_TRANS_MAX = 8; private static final int SD_ATTR_RETRIEVE_MAX = 9; diff -r 461e71b327da -r 0553e2305d00 javaextensions/broadcast_stub/build/javabroadcast_0x2002DCE0.mmp --- a/javaextensions/broadcast_stub/build/javabroadcast_0x2002DCE0.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/broadcast_stub/build/javabroadcast_0x2002DCE0.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/comm/build/javacomm_0x2002DCA5.mmp --- a/javaextensions/comm/build/javacomm_0x2002DCA5.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/comm/build/javacomm_0x2002DCA5.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/datagram/datagram/build/javadatagram_0x2002DCA9.mmp --- a/javaextensions/datagram/datagram/build/javadatagram_0x2002DCA9.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/datagram/datagram/build/javadatagram_0x2002DCA9.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/datagram/UDPDatagramConnectionImpl.java --- a/javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/datagram/UDPDatagramConnectionImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/datagram/UDPDatagramConnectionImpl.java Fri Oct 22 14:23:56 2010 +0100 @@ -134,7 +134,7 @@ /* security related stuff */ ApplicationUtils appUtils = ApplicationUtils.getInstance(); - DatagramPermissionImpl per = new DatagramPermissionImpl(DatagramPermissionImpl.SERVER_TARGET); + DatagramPermissionImpl per = new DatagramPermissionImpl("datagram://"); Logger.LOG(Logger.ESOCKET, Logger.EInfo, "calling check permissions from UDPDatagramConnectionImpl"); appUtils.checkPermission(per); @@ -171,7 +171,7 @@ { /* security related stuff, server mode datagram connection */ ApplicationUtils appUtils = ApplicationUtils.getInstance(); - DatagramPermissionImpl per = new DatagramPermissionImpl(DatagramPermissionImpl.SERVER_TARGET); + DatagramPermissionImpl per = new DatagramPermissionImpl("datagram://"); Logger.LOG(Logger.ESOCKET, Logger.EInfo, "calling check permissions from UDPDatagramConnectionImpl"); appUtils.checkPermission(per); @@ -183,7 +183,7 @@ { /* security related stuff, client mode datagram connection */ ApplicationUtils appUtils = ApplicationUtils.getInstance(); - DatagramPermissionImpl per = new DatagramPermissionImpl(DatagramPermissionImpl.CLIENT_TARGET); + DatagramPermissionImpl per = new DatagramPermissionImpl("datagram://*"); Logger.LOG(Logger.ESOCKET, Logger.EInfo, "calling check permissions from UDPDatagramConnectionImpl"); appUtils.checkPermission(per); diff -r 461e71b327da -r 0553e2305d00 javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/gcf/protocol/datagram/DatagramPermissionImpl.java --- a/javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/gcf/protocol/datagram/DatagramPermissionImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/gcf/protocol/datagram/DatagramPermissionImpl.java Fri Oct 22 14:23:56 2010 +0100 @@ -25,13 +25,6 @@ public class DatagramPermissionImpl extends PermissionBase { - /** - * Constants for identifying the target/uri of connection: client or server - */ - public static String CLIENT_TARGET = "datagram://*"; - public static String SERVER_TARGET = "datagram://"; - - private String iTarget; /** * Returns the question (as localized text) associated with the security @@ -44,7 +37,6 @@ public DatagramPermissionImpl(String uri) { super(uri); - iTarget = uri; } public String getSecurityPromptQuestion(int aInteractionMode) @@ -64,10 +56,6 @@ public String toString() { - if (SERVER_TARGET.equals(iTarget)) - { - return "javax.microedition.io.Connector.datagramreceiver"; - } return "javax.microedition.io.Connector.datagram"; } @@ -75,12 +63,7 @@ { if (p instanceof DatagramPermissionImpl) { - DatagramPermissionImpl o = (DatagramPermissionImpl)p; - if ((iTarget != null && iTarget.equals(o.getTarget())) - || (iTarget == null && o.getTarget() == null)) - { - return true; - } + return true; } return false; } @@ -105,8 +88,4 @@ return null; } - String getTarget() - { - return iTarget; - } } \ No newline at end of file diff -r 461e71b327da -r 0553e2305d00 javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/gcf/protocol/datagram/PushValidatorImpl.java --- a/javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/gcf/protocol/datagram/PushValidatorImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/gcf/protocol/datagram/PushValidatorImpl.java Fri Oct 22 14:23:56 2010 +0100 @@ -125,7 +125,7 @@ /* security check */ Logger.LOG(Logger.ESOCKET, Logger.EInfo,"datagram - push validator : before security check"); ApplicationUtils appUtils = ApplicationUtils.getInstance(); - DatagramPermissionImpl per = new DatagramPermissionImpl(DatagramPermissionImpl.SERVER_TARGET); + DatagramPermissionImpl per = new DatagramPermissionImpl("datagram://"); appUtils.checkPermission(per); /* security check */ Logger.LOG(Logger.ESOCKET, Logger.EInfo,"datagram - push validator : after security check"); diff -r 461e71b327da -r 0553e2305d00 javaextensions/datagram/datagram/src.s60/apnsettings.cpp --- a/javaextensions/datagram/datagram/src.s60/apnsettings.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/datagram/datagram/src.s60/apnsettings.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -42,7 +42,6 @@ char * fret = if_indextoname(aApn,interfacename); strcpy(ifr.ifr_name, interfacename); ILOG1(ESOCKET, "interface name is %s",interfacename); - delete interfacename; } else { diff -r 461e71b327da -r 0553e2305d00 javaextensions/datagram/datagram/src/nativedatagramconnection.cpp --- a/javaextensions/datagram/datagram/src/nativedatagramconnection.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/datagram/datagram/src/nativedatagramconnection.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -133,7 +133,6 @@ writeBuffer = new char[requiredNativeBufferLength + 1]; } /* Copy the data to be written from java buffer to the native buffer. */ - if (writeBuffer != NULL) JNIArrayUtils::CopyToNative(aJni, aJavaBuffer, aOffset, requiredNativeBufferLength, writeBuffer); diff -r 461e71b327da -r 0553e2305d00 javaextensions/datagram/serverconnection/build/javadatagramscplugin_0x2002DCAA.mmp --- a/javaextensions/datagram/serverconnection/build/javadatagramscplugin_0x2002DCAA.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/datagram/serverconnection/build/javadatagramscplugin_0x2002DCAA.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/globalindicators/build/javaglobalindicators_0x2002DCAF.mmp --- a/javaextensions/globalindicators/build/javaglobalindicators_0x2002DCAF.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/globalindicators/build/javaglobalindicators_0x2002DCAF.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/iapinfo/build/javaiapinfo_0x2002DCB3.mmp --- a/javaextensions/iapinfo/build/javaiapinfo_0x2002DCB3.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/iapinfo/build/javaiapinfo_0x2002DCB3.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javaextensions/javaextensions.pro --- a/javaextensions/javaextensions.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/javaextensions.pro Fri Oct 22 14:23:56 2010 +0100 @@ -15,7 +15,7 @@ # TEMPLATE = subdirs SUBDIRS += iapinfo/build/javaiapinfo.pro -SUBDIRS += mobinfo/build/javamobinfo.pro +SUBDIRS += mobinfo/build/mobinfo.pro SUBDIRS += comm/build/javacomm.pro SUBDIRS += globalindicators/build/javaglobalindicators.pro SUBDIRS += webservices/build/javawebservices.pro diff -r 461e71b327da -r 0553e2305d00 javaextensions/location/build/javalocation_0x2002DCBC.mmp --- a/javaextensions/location/build/javalocation_0x2002DCBC.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/location/build/javalocation_0x2002DCBC.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../common/inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/location/position/src/cpositioner.cpp --- a/javaextensions/location/position/src/cpositioner.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/location/position/src/cpositioner.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -156,9 +156,10 @@ case KErrAccessDenied: // Fallthrough case KErrUnknown: // Used in MLFW // Position request was canceled - case KErrCancel: // Fallthrough - // Partial update feature is not supported. So Java tries to obtain - // location fixes until time specified in Java-side expires + case KErrCancel: // Fallthrough + // Bad implementation but due to partial fixes this cannot be fixed + // at the moment. Correct when partial fixes are supported. Java tries + // to obtain location fixes until time specified in Java-side expires // Delay response so that repeated calls to getLocation do not steal // all CPU time default: diff -r 461e71b327da -r 0553e2305d00 javaextensions/midppush/build/javapushregistry_0x2002DCC9.mmp --- a/javaextensions/midppush/build/javapushregistry_0x2002DCC9.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/midppush/build/javapushregistry_0x2002DCC9.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../pushcontroller/src diff -r 461e71b327da -r 0553e2305d00 javaextensions/midppush/pushcontroller/build/javapushcontroller_0x2002DCC8.mmp --- a/javaextensions/midppush/pushcontroller/build/javapushcontroller_0x2002DCC8.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/midppush/pushcontroller/build/javapushcontroller_0x2002DCC8.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../../../javaruntime/inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/midppush/pushregistryplugin/build/javacaptain_ext_pushregistryplugin_0x2002DCA2.mmp --- a/javaextensions/midppush/pushregistryplugin/build/javacaptain_ext_pushregistryplugin_0x2002DCA2.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/midppush/pushregistryplugin/build/javacaptain_ext_pushregistryplugin_0x2002DCA2.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/midprms_db/build/javarms_0x2002DCCB.mmp --- a/javaextensions/midprms_db/build/javarms_0x2002DCCB.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/midprms_db/build/javarms_0x2002DCCB.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RecordIdCache.java diff -r 461e71b327da -r 0553e2305d00 javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RmsFileInfo.java --- a/javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RmsFileInfo.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RmsFileInfo.java Fri Oct 22 14:23:56 2010 +0100 @@ -71,7 +71,7 @@ private long getSize() { - long size = -1; + long size = 0; try { size = iFile.fileSize(); @@ -82,7 +82,6 @@ } if (size < 0) { - Logger.WLOG(Logger.EMidpRms, "fileSize = " + size); size = 0; } return size; @@ -103,19 +102,18 @@ private long getFreeSpace() { - long size = -1; + long size = 0; try { size = iFile.availableSize(); } catch (Exception e) { - Logger.ELOG(Logger.EMidpRms, "availableSize() failed" , e); + Logger.ELOG(Logger.EMidpRms, "availableSize()" , e); } if (size < 0) { - Logger.WLOG(Logger.EMidpRms, "availableSize = " + size); - size = MAX_RMS_SIZE; + size = 0; } return size; } diff -r 461e71b327da -r 0553e2305d00 javaextensions/midprms_db/rmsplugin/build/javacaptain_ext_ondemand_2_0x2002DD01.mmp --- a/javaextensions/midprms_db/rmsplugin/build/javacaptain_ext_ondemand_2_0x2002DD01.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/midprms_db/rmsplugin/build/javacaptain_ext_ondemand_2_0x2002DD01.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/midprms_db/tsrc/build/rmsintersuite.jad diff -r 461e71b327da -r 0553e2305d00 javaextensions/midprms_db/tsrc/build/rmssharedtests.jad diff -r 461e71b327da -r 0553e2305d00 javaextensions/midprms_db/tsrc/build/rmstests.jad diff -r 461e71b327da -r 0553e2305d00 javaextensions/midprms_db/tsrc/javasrc/com/nokia/mj/test/rms/TestRecordEnumeration.java diff -r 461e71b327da -r 0553e2305d00 javaextensions/mobinfo/build/bld.inf --- a/javaextensions/mobinfo/build/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/mobinfo/build/bld.inf Fri Oct 22 14:23:56 2010 +0100 @@ -19,4 +19,4 @@ default PRJ_MMPFILES -javamobinfo_0x2002DCC3.mmp +mobinfo_0x2002DCC3.mmp diff -r 461e71b327da -r 0553e2305d00 javaextensions/mobinfo/build/javamobinfo.pro --- a/javaextensions/mobinfo/build/javamobinfo.pro Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TARGET=javamobinfo -TEMPLATE=lib -CONFIG += omj java stl -CONFIG -= qt - -symbian { - LIBS += -leuser -letel -letelmm -lesock -lconnmon -lcommdb -lcommsdat -lcmmanager -ljavaconnectionmanager -} - -include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javaextensions/mobinfo/build/javamobinfo_0x2002DCC3.mmp --- a/javaextensions/mobinfo/build/javamobinfo_0x2002DCC3.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +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: Generated file - do not edit manually -* -*/ - -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) -// This file is generated by qmake and should not be modified by the -// user. -// Name : javamobinfo.mmp -// ============================================================================== - -TARGET javamobinfo.dll -TARGETTYPE DLL - -UID 0x1000008d 0x2002DCC3 -SECUREID 0x2002DCC3 - -EPOCALLOWDLLDATA - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO RD_JAVA_SYMBIAN_TARGET -MACRO RD_JAVA_S60_RELEASE_9_2 -MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS -MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS -MACRO RD_JAVA_STDCPPV5 -MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX -MACRO RD_JAVA_HTTP_EMC_ENABLED -MACRO RD_JAVA_NGA_ENABLED -MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED -MACRO RD_JAVA_OPENC_BETA_PATCH -MACRO RD_JAVA_INSTALLERUI_ENABLED -MACRO RD_JAVA_PREWARM -MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK -MACRO RD_JAVA_MIDPRMS_DB -MACRO __SYMBIAN32__ -MACRO J9EPOC32 - -SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../../inc -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE ../src.s60 -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE . - -SOURCEPATH ../src.s60 -SOURCE javamobinfo.cpp - - -LIBRARY euser.lib -LIBRARY etel.lib -LIBRARY etelmm.lib -LIBRARY esock.lib -LIBRARY connmon.lib -LIBRARY commdb.lib -LIBRARY commsdat.lib -LIBRARY cmmanager.lib -LIBRARY javaconnectionmanager.lib -LIBRARY javautils.lib -LIBRARY libpthread.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib -LIBRARY apgrfx.lib - -CAPABILITY all -tcb - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden -#if defined(ARMCC_4_0) -OPTION ARMCC --import_all_vtbl -#endif -OPTION GCCE -fvisibility-inlines-hidden - -VERSION 10.0 - -ARMFPU softvfp - -PAGED - -BYTEPAIRCOMPRESSTARGET - -USERINCLUDE . - -#include - - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - -deffile ./~/javamobinfo.def - - SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) - -SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah - -SOURCEPATH /epoc32/build/jrt/javabuild/javamobinfo - -SOURCE lookup.cpp - -SOURCEPATH /epoc32/build/jrt/javabuild/javamobinfo - -SOURCE jxe.c - -#ifdef WINSCW - -LIBRARY ewsd.lib - -#endif - -STDCPP - -#ifdef WINSCW -DEFFILE ./bwins/javamobinfo.def -#elif defined EABI -DEFFILE ./eabi/javamobinfo.def -#endif diff -r 461e71b327da -r 0553e2305d00 javaextensions/mobinfo/build/mobinfo.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/mobinfo/build/mobinfo.pro Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,26 @@ +# +# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TARGET=javamobinfo +TEMPLATE=lib +CONFIG += omj java stl +CONFIG -= qt + +symbian { + LIBS += -leuser -letel -letelmm -lesock -lconnmon -lcommdb -lcommsdat -lcmmanager -ljavaconnectionmanager +} + +include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javaextensions/mobinfo/build/mobinfo_0x2002DCC3.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/mobinfo/build/mobinfo_0x2002DCC3.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,151 @@ +/* +* 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: Generated file - do not edit manually +* +*/ + +// ============================================================================== +// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) +// This file is generated by qmake and should not be modified by the +// user. +// Name : mobinfo.mmp +// ============================================================================== + +TARGET javamobinfo.dll +TARGETTYPE DLL + +UID 0x1000008d 0x2002DCC3 +SECUREID 0x2002DCC3 + +EPOCALLOWDLLDATA + + +// Qt Macros +MACRO UNICODE +MACRO QT_KEYPAD_NAVIGATION +MACRO QT_SOFTKEYS_ENABLED +MACRO QT_USE_MATH_H_FLOATS +MACRO RD_JAVA_SYMBIAN_TARGET +MACRO RD_JAVA_S60_RELEASE_9_2 +MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS +MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS +MACRO RD_JAVA_STDCPPV5 +MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX +MACRO RD_JAVA_HTTP_EMC_ENABLED +MACRO RD_JAVA_NGA_ENABLED +MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_OPENC_BETA_PATCH +MACRO RD_JAVA_INSTALLERUI_ENABLED +MACRO RD_JAVA_PREWARM +MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK +MACRO RD_JAVA_MIDPRMS_DB +MACRO __SYMBIAN32__ +MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER + +SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian +SYSTEMINCLUDE ../../inc +SYSTEMINCLUDE ../../../inc +SYSTEMINCLUDE ../src.s60 +SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 +SYSTEMINCLUDE /epoc32/include/mw +SYSTEMINCLUDE . + +SOURCEPATH ../src.s60 +SOURCE javamobinfo.cpp + + +LIBRARY euser.lib +LIBRARY etel.lib +LIBRARY etelmm.lib +LIBRARY esock.lib +LIBRARY connmon.lib +LIBRARY commdb.lib +LIBRARY commsdat.lib +LIBRARY cmmanager.lib +LIBRARY javaconnectionmanager.lib +LIBRARY javautils.lib +LIBRARY libpthread.lib +LIBRARY libstdcppv5.lib +LIBRARY libc.lib +LIBRARY libm.lib +LIBRARY libdl.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY mediaclientaudio.lib +LIBRARY eikcoctl.lib +LIBRARY eiksrv.lib +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY efsrv.lib +LIBRARY charconv.lib +LIBRARY ws32.lib +LIBRARY hal.lib +LIBRARY gdi.lib +LIBRARY apgrfx.lib + +CAPABILITY all -tcb + +OPTION CW -wchar_t on +OPTION ARMCC --visibility_inlines_hidden +#if defined(ARMCC_4_0) +OPTION ARMCC --import_all_vtbl +#endif +OPTION GCCE -fvisibility-inlines-hidden + +VERSION 10.0 + +ARMFPU softvfp + +PAGED + +BYTEPAIRCOMPRESSTARGET + +USERINCLUDE . + +#include + + APP_LAYER_SYSTEMINCLUDE + + OS_LAYER_LIBC_SYSTEMINCLUDE + + OS_LAYER_SSL_SYSTEMINCLUDE + +deffile ./~/javamobinfo.def + + SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) + +SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah + +SOURCEPATH /epoc32/build/jrt/javabuild/javamobinfo + +SOURCE lookup.cpp + +SOURCEPATH /epoc32/build/jrt/javabuild/javamobinfo + +SOURCE jxe.c + +#ifdef WINSCW + +LIBRARY ewsd.lib + +#endif + +STDCPP + +#ifdef WINSCW +DEFFILE ./bwins/javamobinfo.def +#elif defined EABI +DEFFILE ./eabi/javamobinfo.def +#endif diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/agnadapter/inc.s60/cpimagnlistadapter.h diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/agnadapter/inc.s60/cpimeventadapteraccess.h diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/agnadapter/inc.s60/cpimeventlistadapter.h diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/agnadapter/inc.s60/cpimtodoadapteraccess.h diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/agnadapter/inc.s60/cpimtodolistadapter.h diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/agnadapter/src.s60/cpimagnapptadapter.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/agnadapter/src.s60/cpimagnlistadapter.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/agnadapter/src.s60/cpimeventadapteraccess.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/agnadapter/src.s60/cpimeventlistadapter.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/agnadapter/src.s60/cpimtodoadapteraccess.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/agnadapter/src.s60/cpimtodolistadapter.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/build/build.xml diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/build/javapim.pro diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/build/javapim_0x2002DCC5.mmp --- a/javaextensions/pim/build/javapim_0x2002DCC5.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/pim/build/javapim_0x2002DCC5.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../framework/inc.s60 diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/cntadapter/inc.s60/cpimcmadapteraccess.h diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/cntadapter/inc.s60/cpimcontactlistadapter.h diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/cntadapter/src.s60/cpimcmadapteraccess.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/cntadapter/src.s60/cpimcontactitemadapter.cpp --- a/javaextensions/pim/cntadapter/src.s60/cpimcontactitemadapter.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/pim/cntadapter/src.s60/cpimcontactitemadapter.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -193,12 +193,12 @@ JELOG2(EPim); const CDesCArray& pimCategories = aItem.ItemData().Categories(); const TInt pimCategoryCount = pimCategories.Count(); - CArrayFix* newCategoryTable = new(ELeave) CArrayFixFlat (pimCategoryCount); - CleanupStack::PushL(newCategoryTable); + TBool* newCategoryTable = new(ELeave) TBool[pimCategoryCount]; + CleanupArrayDeletePushL(newCategoryTable); TInt i = 0; for (i = 0; i < pimCategoryCount; i++) { - newCategoryTable->InsertL(TRUE,i); + newCategoryTable[i] = ETrue; } CContactIdArray* cardCategories = aCard.GroupsJoinedLC(); @@ -220,14 +220,14 @@ } else { - // old group - newCategoryTable->InsertL(FALSE,pos); + // old group + newCategoryTable[pos] = EFalse; } } // then add new categories for (i = 0; i < pimCategoryCount; i++) { - if (newCategoryTable->At(i)) + if (newCategoryTable[i]) { TPtrC category = pimCategories[i]; iCategoryManager.AddToGroupL(id, category); diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/cntadapter/src.s60/cpimcontactlistadapter.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/common/inc.s60/mpimadapteraccess.h diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/framework/inc.s60/cpimmanager.h diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/framework/inc/pimbasemanager.h diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/framework/src.s60/cpimeventlist.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/framework/src.s60/cpimlist.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/framework/src.s60/cpimmanager.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/framework/src.s60/cpimtodolist.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/framework/src.s60/pimjnitools.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/javasrc.s60/com/nokia/mj/impl/pim/utils/NativeError.java diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/javasrc/com/nokia/mj/impl/pim/ErrorString.java diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMListImpl.java diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMManager.java diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMPermissionImpl.java diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/javasrc/javax/microedition/pim/PIM.java diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/jni/src/pimmanager.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/versit/src.s60/cpimcalendarconverter.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/versit/src.s60/cpimcardconverter.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/versit/src.s60/cpimeventpropertyconverter.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/pim/versit/src.s60/cpimversit.cpp diff -r 461e71b327da -r 0553e2305d00 javaextensions/satsa/build/javasatsa.pro --- a/javaextensions/satsa/build/javasatsa.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/satsa/build/javasatsa.pro Fri Oct 22 14:23:56 2010 +0100 @@ -11,47 +11,33 @@ # # Contributors: # -# Description: +# Description: # -include(../../../inc/build_defines.pri) - TARGET=javasatsa TEMPLATE=lib -CONFIG += omj java stl - -contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_5_0) { - CONFIG -= qt -} -contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_9_2) { - CONFIG -= qt -} -contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) { - CONFIG += hb -} +CONFIG += omj java stl +CONFIG -= qt symbian { - - INCLUDEPATH += ../framework/inc \ ../pki/inc \ ../apdu/inc \ ../../inc \ ../../../inc \ - - - + + SOURCES += ../pki/src.s60/*.cpp \ ../crypto/src/*.cpp \ ../apdu/src/*.cpp \ ../apdu/src.s60/*.cpp \ ../framework/src/satsajnitools.cpp \ - - + + LIBS += -ljavastorage \ -lCommonUI \ -lrandom \ - -lx509 \ + -lx509 \ -lx500 \ -llibcrypto \ -lasn1 \ @@ -62,9 +48,10 @@ -lcertstore \ -lcharconv \ -lcms \ + -laknnotify \ -leiksrv \ -lctframework \ - -lctsecdlgs \ + -lctsecdlgs \ -lcustomapi \ -lefsrv \ -letel \ @@ -74,16 +61,9 @@ -lhash \ -lWimClient \ -lestlib \ - -lcryptography \ - - -contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_5_0) { - LIBS += -laknnotify \ - } -contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_9_2) { - LIBS += -laknnotify \ - } - + -lcryptography \ + + } include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javaextensions/satsa/build/javasatsa_0x2002DCCE.mmp --- a/javaextensions/satsa/build/javasatsa_0x2002DCCE.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/satsa/build/javasatsa_0x2002DCCE.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../framework/inc @@ -163,6 +164,7 @@ LIBRARY certstore.lib LIBRARY charconv.lib LIBRARY cms.lib +LIBRARY aknnotify.lib LIBRARY eiksrv.lib LIBRARY ctframework.lib LIBRARY ctsecdlgs.lib @@ -176,7 +178,6 @@ LIBRARY WimClient.lib LIBRARY estlib.lib LIBRARY cryptography.lib -LIBRARY aknnotify.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib diff -r 461e71b327da -r 0553e2305d00 javaextensions/satsa/pki/src.s60/cstscredentialmanager.cpp --- a/javaextensions/satsa/pki/src.s60/cstscredentialmanager.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstscredentialmanager.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -32,11 +32,7 @@ #include #include #include - -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS #include -#endif - #include @@ -71,12 +67,10 @@ { delete iEncodedCert; delete iIssuerAndSerialNumber; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS if (iPKIDialog) { iPKIDialog->Release(); } -#endif delete iDistinguishedName; delete iDisplayName; delete iRequestEncoded; @@ -539,9 +533,8 @@ // void CSTSCredentialManager::ConstructL() { - #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS iPKIDialog = PKIDialogFactory::CreateNoteL(); - #endif + User::LeaveIfError(iFileServer.Connect()); iWait = new(ELeave) CActiveSchedulerWait; iStore = CUnifiedCertStore::NewL(iFileServer, ETrue); @@ -626,10 +619,8 @@ { // not found, ok to add iState = EAddDialog; - #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS iPKIDialog->SaveCertificate(EX509Certificate, EUserCertificate, iSubject, iStatus); - #endif SetActive(); return; } @@ -729,9 +720,7 @@ CCTCertInfo* certInfo = (*iCertInfoArray)[ 0 ]; iState = ERemoveDialog; iHandle = certInfo->Handle(); - #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS iPKIDialog->DeleteCertificate(iHandle, iStatus); - #endif SetActive(); } @@ -793,9 +782,8 @@ } iState = ECSRDialog; iHandle = iKeyInfo->Handle(); - #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS + iPKIDialog->CreateCSR(*iDisplayName, iHandle, iStatus); - #endif SetActive(); } @@ -1039,3 +1027,5 @@ FunctionServer::doServerSideInit(); } + + diff -r 461e71b327da -r 0553e2305d00 javaextensions/satsa/pki/src.s60/cstscredentialmanager.h --- a/javaextensions/satsa/pki/src.s60/cstscredentialmanager.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstscredentialmanager.h Fri Oct 22 14:23:56 2010 +0100 @@ -31,9 +31,7 @@ // FORWARD DECLARATIONS class CCTKeyInfo; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS class MPKIDialog; -#endif class CUnifiedCertStore; class CUnifiedKeyStore; class CX500DistinguishedName; @@ -350,11 +348,9 @@ // internal error variable TInt iError; - -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS + // PKI Dialog, owned MPKIDialog* iPKIDialog; -#endif // The actual store, owned CUnifiedCertStore* iStore; diff -r 461e71b327da -r 0553e2305d00 javaextensions/satsa/pki/src.s60/cstsseprompt.cpp --- a/javaextensions/satsa/pki/src.s60/cstsseprompt.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstsseprompt.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -18,24 +18,11 @@ // INCLUDE FILES - - - #include "cstsseprompt.h" - -#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS - -#include -#include -const QString KMessageTextKey = "text"; - -#else - #include #include #include -#endif // ============================ MEMBER FUNCTIONS =============================== @@ -56,10 +43,8 @@ // Destructor CSTSSEPrompt::~CSTSSEPrompt() { -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS delete iGlobalNote; delete iSynchronizer; -#endif } // ----------------------------------------------------------------------------- @@ -69,26 +54,11 @@ // void CSTSSEPrompt::DisplayPromptL(const TDesC& aPrompt) { - #ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS - HbDeviceDialog* dialog; - dialog = new(ELeave) HbDeviceDialog(); - - QVariantMap parameters; - QString qString((QChar*)aPrompt.Ptr(),aPrompt.Length()); - parameters[QString(KMessageTextKey)] = qString; - - dialog->show("com.nokia.hb.devicemessagebox/1.0", parameters); - - delete dialog; - #else - iGlobalNote->ShowNoteL( iSynchronizer->iStatus, - EAknGlobalConfirmationNote, + EAknGlobalConfirmationNote, aPrompt); iSynchronizer->ExecuteL((TTimeIntervalMicroSeconds32) 0); - - #endif } // ----------------------------------------------------------------------------- @@ -107,11 +77,9 @@ // ----------------------------------------------------------------------------- void CSTSSEPrompt::ConstructL() { - #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS iGlobalNote = CAknGlobalNote::NewL(); iGlobalNote->SetSoftkeys(R_AVKON_SOFTKEYS_OK_EMPTY); iSynchronizer = CAOSynchronizer::NewL(); - #endif } diff -r 461e71b327da -r 0553e2305d00 javaextensions/satsa/pki/src.s60/cstsseprompt.h --- a/javaextensions/satsa/pki/src.s60/cstsseprompt.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstsseprompt.h Fri Oct 22 14:23:56 2010 +0100 @@ -22,13 +22,13 @@ // INCLUDE #include + + + // FORWARD DECLARATIONS -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS - +class CAknGlobalNote; class CAOSynchronizer; -class CAknGlobalNote; -#endif // CLASS DECLARATION /** @@ -71,14 +71,11 @@ private: // data - #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS + // displays the prompt asynchronously, owned CAknGlobalNote* iGlobalNote; // waits for the prompt to finish, owned CAOSynchronizer* iSynchronizer; - - #endif - }; diff -r 461e71b327da -r 0553e2305d00 javaextensions/satsa/pki/src.s60/cstssignatureservice.cpp --- a/javaextensions/satsa/pki/src.s60/cstssignatureservice.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstssignatureservice.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -15,6 +15,8 @@ * */ + +// INCLUDE FILES #include "cstssignatureservice.h" #include "tstsdistinguishednameconverter.h" #include "secdlg.h" @@ -30,11 +32,7 @@ #include #include #include - -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS #include -#endif - #include "cstsseprompt.h" #include @@ -44,7 +42,7 @@ #include "logger.h" #include "jstringutils.h" - +// CONSTANTS const TInt KDefaultGranularity = 1; const TInt KOptionIncludeContent = 1; @@ -82,12 +80,10 @@ { iDialog->Release(); // Release deletes the object } -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS if (iPKIDialog) { iPKIDialog->Release(); } -#endif iCertificateArray.Close(); iCertInfos.Close(); delete iFilter; @@ -130,12 +126,14 @@ TInt aOptions, const CDesCArray& aCaNames, const TDesC& asecurityElementPrompt, TBool aShowData) { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::AuthenticateL"); if (iState != EReady) { ELOG(ESATSA, "CSTSSignatureService::AuthenticateL: Not Ready"); User::Leave(KErrNotReady); } + LOG(ESATSA, EInfo, "CSTSSignatureService::AuthenticateL:After convertions"); // First we need to convert the data to unicode, if we have to display it HBufC* textToDisplay = NULL; if (aShowData) @@ -157,9 +155,14 @@ iOptions = aOptions; iShowNotes = EFalse; + + LOG(ESATSA, EInfo, "CSTSSignatureService::AuthenticateL:Going to call CreateSignatureL"); // get handles to applicable certificates HBufC8* retVal = CreateSignatureL(aCaNames, EX509UsageDigitalSignature, asecurityElementPrompt); + LOG(ESATSA, EInfo, "CSTSSignatureService::AuthenticateL:After call to CreateSignatureL"); + + LOG(ESATSA, EInfo, "-- CSTSSignatureService::AuthenticateL"); return retVal; } @@ -168,6 +171,7 @@ jint aOptions, jobjectArray aCaNames, jstring aSecurityElementPrompt, jboolean aShowData, HBufC8** aRetVal) { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::StaticAuthenticateL"); const TInt byteArrayLength = aJniEnv->GetArrayLength( aByteArrayToAuthenticate); jbyte* bytesToAuthenticate = aJniEnv->GetByteArrayElements( @@ -185,15 +189,20 @@ CDesCArrayFlat* nativeCaNames = STSCreateNativeStringArrayL(aJniEnv, aCaNames); + LOG(ESATSA, EInfo, "CSTSSignatureService::StaticAuthenticateL: prepare se prompt"); const JStringUtils securityElementPrompt(*aJniEnv, aSecurityElementPrompt); + LOG(ESATSA, EInfo, "CSTSSignatureService::StaticAuthenticateL: start convertions to TInt"); TBool ShowData = static_cast(aShowData); const TDesC* sec = static_cast(&securityElementPrompt); + LOG(ESATSA, EInfo, "CSTSSignatureService::StaticAuthenticateL: After convertions,going to call CallMethodL"); TRAPD(err, CallMethodL(*aRetVal, service, &CSTSSignatureService::AuthenticateL, desToAuthenticate, aOptions, *nativeCaNames, *sec, ShowData, service)); + LOG(ESATSA, EInfo, "+ CSTSSignatureService::StaticAuthenticateL:After CallmethodL"); + LOG(ESATSA, EInfo, "-- return CSTSSignatureService::StaticAuthenticateL"); return err; } @@ -207,12 +216,15 @@ HBufC8* CSTSSignatureService::SignL(const TDesC8& aBytesToSign, TInt aOptions, const CDesCArray& aCaNames, const TDesC& aSecurityElementPrompt) { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::SignL"); if (iState != EReady) { ELOG(ESATSA, "CSTSSignatureService::SignL: Not Ready"); User::Leave(KErrNotReady); } + LOG(ESATSA, EInfo, "CSTSSignatureService::SignL: start convertions!"); + LOG(ESATSA, EInfo, "CSTSSignatureService::SignL: After convertions"); // convert text from UTF8 HBufC* textToDisplay = ConvertUTF8ToUnicodeL(aBytesToSign); delete iTextToDisplay; @@ -226,10 +238,12 @@ iShowNotes = ETrue; + LOG(ESATSA, EInfo, "CSTSSignatureService::SignL: Before call to CreateSignatureL"); // get handles to applicable certificates HBufC8* retVal = CreateSignatureL(aCaNames, EX509UsageNonRepudiation, aSecurityElementPrompt); + LOG(ESATSA, EInfo, "-- return CSTSSignatureService::SignL"); return retVal; } @@ -242,12 +256,13 @@ CSTSSignatureService* service, jbyteArray aBytesToSign, jint aOptions, jobjectArray aCaNames, jstring aSecurityElementPrompt, HBufC8** aRetVal) { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::StaticSignL"); const TInt byteArrayLength = aJniEnv->GetArrayLength(aBytesToSign); jbyte* bytesToSign = aJniEnv->GetByteArrayElements(aBytesToSign, NULL); if (!bytesToSign) { - ELOG(ESATSA, "CSTSSignatureService::StaticSignL: No memory"); + LOG(ESATSA, EInfo, "CSTSSignatureService::StaticSignL: No memory"); return NULL; } @@ -258,12 +273,15 @@ const JStringUtils securityElementPrompt(*aJniEnv, aSecurityElementPrompt); - + LOG(ESATSA, EInfo, "CSTSSignatureService::StaticSignL: Start convertions"); + LOG(ESATSA, EInfo, "CSTSSignatureService::StaticSignL: Before callmethodl"); + const TDesC* sec = static_cast(&securityElementPrompt); TRAPD(err, CallMethodL(*aRetVal, service, &CSTSSignatureService::SignL, desToSign, aOptions, *nativeCaNames, *sec, service)); + LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::StaticSignL"); return err; } @@ -274,25 +292,28 @@ // void CSTSSignatureService::RunL() { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::RunL"); if (iStatus == KErrCancel) { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: KErrCancel"); if (iShowNotes) { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: ShowNote"); iState = EFinalNote; iStatus = KErrNone; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS iPKIDialog->Note(MPKIDialog::ESigningCancelled, iStatus); -#endif SetActive(); - } + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: Done ShowNote"); + } else { - Complete(KErrNone); + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: Complete"); + Complete(KErrNone); } } else if (iStatus != KErrNone) { - ELOG(ESATSA, "CSTSSignatureService::RunL: Error occured"); + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: Error occured"); // Error has occured; inform java Complete(iStatus.Int()); } @@ -302,23 +323,29 @@ { case EInitialising: { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EInitialising"); iState = EKeyStoreInit; iKeyStore->Initialize(iStatus); SetActive(); + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case EInitialising"); break; } case EKeyStoreInit: { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EKeyStoreInit"); Complete(KErrNone); break; } case EListing: { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EListing"); HandlesFromCertInfosL(); + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case EListing"); break; } case EDialog: { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EDialog"); iState = EGetCert; if (iCertificate) { @@ -333,10 +360,12 @@ iCertStore->GetCert(iCertificate, iCertificateHandle, iStatus); SetActive(); + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case EDialog"); break; } case EGetCert: { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EGetCert"); if (iX509Certificate) { delete iX509Certificate; @@ -345,35 +374,44 @@ iState = ERetrieveCert; iCertStore->Retrieve(*iCertificate, iX509Certificate, iStatus); SetActive(); + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case EGetCert"); break; } case ERetrieveCert: { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case ERetrieveCert"); FindKeyL(); break; } case EFindKey: { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EFindKey"); OpenSignerL(); break; } case EOpenSigner: { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EOpenSigner"); SignL(); break; } case ESign: { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case ESign"); CreateSignedDataL(); + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case ESign"); break; } case EFinalNote: { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EFinalNote"); Complete(KErrNone); + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case EFinalNote"); break; } default: { + LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case default"); Complete(KErrGeneral); } } @@ -387,6 +425,7 @@ // TInt CSTSSignatureService::RunError(TInt aError) { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::RunError"); Complete(aError); return KErrNone; } @@ -485,9 +524,8 @@ { User::LeaveIfError(iFileServer.Connect()); iDialog = SecurityDialogFactory::CreateL(); -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS iPKIDialog = PKIDialogFactory::CreateNoteL(); -#endif + iFilter = CCertAttributeFilter::NewL(); iWait = new(ELeave) CActiveSchedulerWait; @@ -504,6 +542,7 @@ // void CSTSSignatureService::Complete(TInt aError) { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::Complete"); if (KErrNone == aError) { iState = EReady; @@ -514,7 +553,7 @@ iError = aError; } iWait->AsyncStop(); - + LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::Complete"); } // ----------------------------------------------------------------------------- @@ -524,14 +563,17 @@ // void CSTSSignatureService::WaitForCompletionL() { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::WaitForCompletionL"); SetActive(); iWait->Start(); if (iState != EReady) { // we need to be ready for the next request iState = EReady; + User::Leave(iError); } + LOG(ESATSA, EInfo, "- ret CSTSSignatureService::WaitForCompletionL"); } // ----------------------------------------------------------------------------- @@ -542,6 +584,7 @@ HBufC8* CSTSSignatureService::CreateSignatureL(const CDesCArray& aCaNames, const TKeyUsageX509 aUsage, const TDesC& aSecurityElementPrompt) { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::CreateSignatureL"); HBufC* sePrompt = NULL; if (aSecurityElementPrompt != KNullDesC()) { @@ -549,10 +592,14 @@ } delete iSecurityElementPrompt; iSecurityElementPrompt = sePrompt; + LOG(ESATSA, EInfo, "CSTSSignatureService::CreateSignatureL: call findcertificates"); FindCertificatesL(aCaNames, aUsage); + LOG(ESATSA, EInfo, "CSTSSignatureService::CreateSignatureL: After call to findcertificates"); WaitForCompletionL(); + LOG(ESATSA, EInfo, "CSTSSignatureService::CreateSignatureL: call WaitForCompletion"); HBufC8* retVal = iSignature; iSignature = NULL; + LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::CreateSignatureL"); return retVal; } // ----------------------------------------------------------------------------- @@ -564,6 +611,7 @@ const TKeyUsageX509 aUsage) { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::FindCertificatesL"); iFilter->SetKeyUsage(aUsage); iFilter->SetOwnerType(EUserCertificate); iFilter->SetFormat(EX509Certificate); @@ -606,7 +654,7 @@ iState = EListing; iCertStore->List(iCertInfos, *iFilter, iDERNames, iStatus); } - + LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::FindCertificatesL"); } // ----------------------------------------------------------------------------- @@ -616,6 +664,7 @@ // void CSTSSignatureService::HandlesFromCertInfosL() { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::HandlesFromCertInfosL"); TInt certificateCount = iCertInfos.Count(); if (certificateCount == 0) { @@ -626,6 +675,7 @@ iCertificateArray.Reset(); for (TInt i = 0; i < certificateCount; i++) { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::HandlesFromCertInfosL: No Certificates"); User::LeaveIfError(iCertificateArray.Append(iCertInfos[i]->Handle())); } @@ -634,18 +684,18 @@ { case EAuthWithoutText: { -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS + LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: case EAuthWithoutText"); iPKIDialog->UserAuthentication(iCertificateArray, iCertificateHandle, iStatus); -#endif + LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: over case EAuthWithoutText"); break; } case EAuthWithText: { -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS + LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: case EAuthWithText"); iPKIDialog->UserAuthenticationText(*iTextToDisplay, iCertificateArray, iCertificateHandle, iStatus); -#endif + LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: over case EAuthWithText"); break; } case ESignWithText: @@ -671,6 +721,7 @@ // void CSTSSignatureService::FindKeyL() { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::FindKeyL"); iKeyFilter.iKeyAlgorithm = CKeyInfoBase::EInvalidAlgorithm; iKeyFilter.iKeyId = iCertificate->SubjectKeyId(); @@ -689,6 +740,7 @@ // void CSTSSignatureService::OpenSignerL() { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::OpenSignerL"); // if key is not found, display security element prompt and search again if (iKeys.Count() == 0) { @@ -751,6 +803,8 @@ // void CSTSSignatureService::SignL() { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::SignL"); + // first we create a digest of the message CSHA1* sha = CSHA1::NewL(); @@ -838,6 +892,7 @@ // void CSTSSignatureService::CreateSignedDataL() { + LOG(ESATSA, EInfo, "+ CSTSSignatureService::CreateSignedDataL"); CCTKeyInfo* keyInfo = iKeys[0]; HBufC8* signature = NULL; @@ -932,16 +987,14 @@ if (iShowNotes) { iState = EFinalNote; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS iPKIDialog->Note(MPKIDialog::ESignatureDone, iStatus); -#endif SetActive(); } else { Complete(KErrNone); } - + LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::CreateSignedDataL"); } // ----------------------------------------------------------------------------- diff -r 461e71b327da -r 0553e2305d00 javaextensions/satsa/pki/src.s60/cstssignatureservice.h --- a/javaextensions/satsa/pki/src.s60/cstssignatureservice.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstssignatureservice.h Fri Oct 22 14:23:56 2010 +0100 @@ -19,18 +19,19 @@ #ifndef CSTSSIGNATURESERVICE_H #define CSTSSIGNATURESERVICE_H - - +// INCLUDES #include #include #include #include "functionserver.h" +// CONSTANTS + + + // FORWARD DECLARATIONS class MSecurityDialog; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS class MPKIDialog; -#endif class CUnifiedCertStore; class CUnifiedKeyStore; class CCTCertInfo; @@ -265,10 +266,8 @@ // security dialog, owned MSecurityDialog* iDialog; -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS // PKI Dialog, owned MPKIDialog* iPKIDialog; -#endif // certificate store, owned CUnifiedCertStore* iCertStore; diff -r 461e71b327da -r 0553e2305d00 javaextensions/sensor/build/javasensor_0x2002DCD0.mmp --- a/javaextensions/sensor/build/javasensor_0x2002DCD0.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/sensor/build/javasensor_0x2002DCD0.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/sensor/src.s60/cacceleratorsensor.cpp --- a/javaextensions/sensor/src.s60/cacceleratorsensor.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/sensor/src.s60/cacceleratorsensor.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -297,6 +297,7 @@ void CAcceleratorSensor::OpenChannelL() { + TInt err; JELOG2(ESensor); LOG(ESensor,EInfo,"Creating Open Channel"); iChannel->OpenChannelL(); @@ -305,9 +306,9 @@ iScaleFactor = 1; TInt format(ESensrvChannelDataFormatAbsolute); TSensrvProperty property; - iChannel->GetPropertyL(KSensrvPropIdChannelDataFormat, KSensrvItemIndexNone, - property); - + TRAP(err,iChannel->GetPropertyL(KSensrvPropIdChannelDataFormat, KSensrvItemIndexNone, + property);); + LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() One = %d",err); if (property.PropertyType() == ESensrvIntProperty) { @@ -327,17 +328,19 @@ // Scaled value maximum TSensrvProperty property_scaled; TInt maxScaled(0); - iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone, - property_scaled); - + TRAP(err,iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone, + property_scaled);); + LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() Two = %d",err); if (property_scaled.GetArrayIndex() == ESensrvArrayPropertyInfo) { LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::If"); //for 2G Accelerometer Sensor index value is 0. TInt rangeIndex(0); - iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone, - rangeIndex, property_scaled); + TRAP(err,iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone, + rangeIndex, property_scaled);); + LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() Three = %d",err); + property_scaled.GetMaxValue(maxScaled); LOG1(ESensor,EInfo,"property_scaled::maxValue = %d",maxScaled); @@ -350,32 +353,36 @@ } // MeasureRange can be an array property TReal maxMeasure; - + TInt err1; TSensrvProperty property_Measured; - iChannel->GetPropertyL(KSensrvPropIdMeasureRange, KSensrvItemIndexNone, - property_Measured); - - TInt arrayIndex = property_Measured.GetArrayIndex(); - LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::KSensrvPropIdMeasureRange::arrayIndex = %d",arrayIndex); + TRAP(err1,iChannel->GetPropertyL(KSensrvPropIdMeasureRange, KSensrvItemIndexNone, + property_Measured);); + LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() Four = %d",err1); - if (property_Measured.GetArrayIndex() == ESensrvArrayPropertyInfo) + if (err1 == KErrNone) { - LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::If"); + TInt arrayIndex = property_Measured.GetArrayIndex(); + LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::KSensrvPropIdMeasureRange::arrayIndex = %d",arrayIndex); + + if (property_Measured.GetArrayIndex() == ESensrvArrayPropertyInfo) + { + LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::If"); - TInt index2g = 0; - LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::Getting RangeIndex = %f",index2g); - //We need to TypeCast variable rangeIndex to TInt for - iChannel->GetPropertyL(KSensrvPropIdMeasureRange, KSensrvItemIndexNone, - index2g, property_Measured); - property_Measured.GetMaxValue(maxMeasure); + TInt index2g = 0; + LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::Getting RangeIndex = %f",index2g); + //We need to TypeCast variable rangeIndex to TInt for + TRAP(err,iChannel->GetPropertyL(KSensrvPropIdMeasureRange, KSensrvItemIndexNone, + index2g, property_Measured);); + LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() Five = %d",err); + property_Measured.GetMaxValue(maxMeasure); + } + else + { + LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::else"); + property_Measured.GetMaxValue(maxMeasure); + } + } - else - { - LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::else"); - property_Measured.GetMaxValue(maxMeasure); - } - - iScaleFactor = maxMeasure / maxScaled ; LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::iScaleFactor = %f",iScaleFactor); } diff -r 461e71b327da -r 0553e2305d00 javaextensions/sensor/src.s60/cnetworkfieldintensitysensor.cpp --- a/javaextensions/sensor/src.s60/cnetworkfieldintensitysensor.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/sensor/src.s60/cnetworkfieldintensitysensor.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -146,16 +146,15 @@ SensorData* data = iData[ KNISensorChannel ]; TTime currentTime; - - if ((data->iTimeStampsIncluded) || (iBufferingPeriod > 0)) + if (data->iTimeStamps || (iBufferingPeriod > 0)) + { + currentTime.UniversalTime(); + if (iStartTime == KErrNotFound) { - currentTime.UniversalTime(); - if (iStartTime == KErrNotFound) - { - iStartTime = currentTime; - } + iStartTime = currentTime; } - + } + // P&S sensors are assumed to have one channel only TInt interpretedValue = InterpretValue(aLevel); diff -r 461e71b327da -r 0553e2305d00 javaextensions/sensor/src.s60/csensorbase.cpp --- a/javaextensions/sensor/src.s60/csensorbase.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/sensor/src.s60/csensorbase.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -139,14 +139,7 @@ void CSensorBase::AsyncCallback(TMethod aMethod) { JELOG2(ESensor); - TInt err = iMethodArray.Append(aMethod); - // if there was error when adding the method to array then just return - if ( err ) - { - ELOG2(ESensor, "CSensorBase::AsyncCallback - Error (code = %d) when " - "adding method (type = %d) to method buffer.", err, aMethod.iMethodType); - return; - } + iMethodArray.Append(aMethod); // If there is old request ongoing, wait it for completion if (iMethodArray.Count() > 1) @@ -249,13 +242,14 @@ matched = ETrue; CSensorConditionBase *condition = iConditions[i]; iConditions.Remove(i); - - iSensorListener->ConditionMet( - condition, - condition->GetChannelId(), - currentValue, - javaTime); - + if (iSensorListener) + { + iSensorListener->ConditionMet( + condition, + condition->GetChannelId(), + currentValue, + javaTime); + } delete condition; } } @@ -263,7 +257,6 @@ // Also send all values separately if we have java side custom conditions if (iJavaConditionEval) { - if (iSensorListener != NULL) iSensorListener->ConditionMet(0, aChannelId, currentValue, javaTime); } return matched; diff -r 461e71b327da -r 0553e2305d00 javaextensions/subsystem.mk diff -r 461e71b327da -r 0553e2305d00 javaextensions/webservices/build/javawebservices_0x2002DCDB.mmp --- a/javaextensions/webservices/build/javawebservices_0x2002DCDB.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/webservices/build/javawebservices_0x2002DCDB.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/mms/build/javawmamms.pro diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/mms/build/javawmamms_0x2002DCDD.mmp --- a/javaextensions/wma/mms/build/javawmamms_0x2002DCDD.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/mms/build/javawmamms_0x2002DCDD.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/mms/javasrc/com/nokia/mj/impl/gcf/protocol/mms/PushValidatorImpl.java --- a/javaextensions/wma/mms/javasrc/com/nokia/mj/impl/gcf/protocol/mms/PushValidatorImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/mms/javasrc/com/nokia/mj/impl/gcf/protocol/mms/PushValidatorImpl.java Fri Oct 22 14:23:56 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" @@ -18,6 +18,7 @@ package com.nokia.mj.impl.gcf.protocol.mms; import java.lang.String; +import java.io.IOException; import com.nokia.mj.impl.utils.Uid; import com.nokia.mj.impl.gcf.PushValidator; import com.nokia.mj.impl.mms.MMSPermissionImpl; @@ -43,6 +44,7 @@ */ public void validate(String aUri, String aFilter, Uid aSuiteUid, String aMidletName, boolean aIsStaticRegistration) + throws IOException { if (!(aUri.startsWith(MMS_PREFIX))) { @@ -67,6 +69,29 @@ throw new IllegalArgumentException("Invalid Filter"); } + Uid suiteUid = null; + String commsName = null; + if (aIsStaticRegistration) + { + suiteUid = aSuiteUid; + commsName = PushValidator.INSTALLER_COMMS; + } + else + { + commsName = PushValidator.RUNTIME_COMMS; + } + if (PushValidator.isRegisteredPushUriStartingWith(aUri, suiteUid, + commsName)) + { + if (aIsStaticRegistration) + { + throw new IllegalArgumentException(); + } + else + { + throw new IOException("connection already exists"); + } + } ApplicationUtils appUtils = ApplicationUtils.getInstance(); MMSPermissionImpl permission = new MMSPermissionImpl("mms://*","open"); appUtils.checkPermission(permission); diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/mms/javasrc/com/nokia/mj/impl/mms/MMSConnectionImpl.java --- a/javaextensions/wma/mms/javasrc/com/nokia/mj/impl/mms/MMSConnectionImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/mms/javasrc/com/nokia/mj/impl/mms/MMSConnectionImpl.java Fri Oct 22 14:23:56 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" @@ -21,10 +21,14 @@ import java.io.IOException; import java.io.InterruptedIOException; import javax.wireless.messaging.*; +import java.lang.ref.WeakReference; import com.nokia.mj.impl.utils.Logger; +import com.nokia.mj.impl.gcf.PushValidator; +import com.nokia.mj.impl.rt.support.Finalizer; import com.nokia.mj.impl.mms.MmsPropertyRetriever; import com.nokia.mj.impl.rt.support.ShutdownListener; +import com.nokia.mj.impl.rt.support.ApplicationInfo; import com.nokia.mj.impl.rt.support.ApplicationUtils; public final class MMSConnectionImpl implements MessageConnection @@ -78,7 +82,10 @@ // Application Id private String iAppID = null; + + private Finalizer iFinalizer; + private ShutdownListener iShutDownListener; // the listener used for messages receiving notifications private MessageListener iMessageListener; @@ -90,6 +97,18 @@ iUri = aUri; iState = INITIAL; iServerConnection = aServerConnection; + if (iServerConnection) + { + // Check if this url is push registered by other application + // Get the insatnce of ApplicationInfo. + ApplicationInfo appInfo = ApplicationInfo.getInstance(); + if (PushValidator.isRegisteredPushUriStartingWith(aUri, + appInfo.getSuiteUid(), PushValidator.RUNTIME_COMMS)) + { + throw new IOException("Connection already exists"); + } + iAppID = aUri.substring("mms://:".length()); + } // create the native side peer iNativeHandle = _createPeer(iServerConnection, iUri); iReadLock = new Object(); @@ -98,30 +117,21 @@ iMessageLock = new Object(); iSendLock = new Object(); // register for shutdown listening - setShutdownListener(); - if (iServerConnection) - { - iAppID = aUri.substring("mms://:".length()); - } + iShutDownListener = new MmsShutDownListener(this); + // register for finalization + iFinalizer = registerForFinalization(); Logger.LOG(Logger.EWMA, Logger.EInfo, "- MMSConnectionImpl::MMSConnectionImpl()"); } /* - * This function registers this object for shutDown. - */ - private void setShutdownListener() + * This function registers this object for Finalization. + */ + public Finalizer registerForFinalization() { - Logger.LOG(Logger.EWMA, Logger.EInfo, - "+ MMSConnectionImpl::setShutdownListener()"); - // Get the insatnce of ApplicationUtils. - ApplicationUtils appUtils = ApplicationUtils.getInstance(); - - // Get the name of the application. - appUtils.addShutdownListener(new ShutdownListener() + return new Finalizer() { - //The method that gets called when Application is shutting down - public void shuttingDown() + public void finalizeImpl() { try { @@ -133,9 +143,45 @@ Logger.LOG(Logger.EWMA, Logger.EInfo, e.toString()); } } - }); - Logger.LOG(Logger.EWMA, Logger.EInfo, - "- MMSConnectionImpl::setShutdownListener()"); + }; + } + + /* + * Registering for shutDown Listener. + */ + private static class MmsShutDownListener implements ShutdownListener + { + private final WeakReference iImpl; + + private MmsShutDownListener(MMSConnectionImpl impl) + { + // Get the instance of ApplicationUtils. + ApplicationUtils appUtils = ApplicationUtils.getInstance(); + + // Add the listener. + appUtils.addShutdownListener(this); + + // Create weak reference to impl object. + iImpl = new WeakReference(impl); + } + + public void shuttingDown() + { + // Get a strong reference to impl class if it is not yet GC'ed. + MMSConnectionImpl impl = (MMSConnectionImpl)iImpl.get(); + if (impl != null) + { + try + { + impl.close(); + } + catch (IOException e) + { + //Nothing to do, just ignore + Logger.LOG(Logger.EWMA, Logger.EInfo, e.toString()); + } + } + } } /** @@ -197,6 +243,9 @@ iReadLock.notify(); } _dispose(iNativeHandle); + // Remove the shutdown listener. + ApplicationUtils.getInstance().removeShutdownListener( + iShutDownListener); } } Logger.LOG(Logger.EWMA, Logger.EInfo, diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/mms/pushplugin/build/eabi/javammsscpluginu.def --- a/javaextensions/wma/mms/pushplugin/build/eabi/javammsscpluginu.def Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/mms/pushplugin/build/eabi/javammsscpluginu.def Fri Oct 22 14:23:56 2010 +0100 @@ -24,11 +24,4 @@ _ZThn28_N4java3wma22S60MmsServerConnection9setFilterERKSbIwSt11char_traitsIwESaIwEE @ 23 NONAME ; ## _ZThn28_NK4java3wma22S60MmsServerConnection6getUriEv @ 24 NONAME ; ## _ZThn28_NK4java3wma22S60MmsServerConnection9getFilterEv @ 25 NONAME ; ## - _ZN4java3wma22S60MmsServerConnection5closeEv @ 26 NONAME - _ZThn28_N4java3wma22S60MmsServerConnection5closeEv @ 27 NONAME - _ZN4java3wma22S60MmsServerConnectionD0Ev @ 28 NONAME - _ZN4java3wma22S60MmsServerConnectionD1Ev @ 29 NONAME - _ZN4java3wma22S60MmsServerConnectionD2Ev @ 30 NONAME - _ZThn28_N4java3wma22S60MmsServerConnectionD0Ev @ 31 NONAME - _ZThn28_N4java3wma22S60MmsServerConnectionD1Ev @ 32 NONAME diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/mms/pushplugin/build/javammsscplugin_0x2002DCC1.mmp --- a/javaextensions/wma/mms/pushplugin/build/javammsscplugin_0x2002DCC1.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/mms/pushplugin/build/javammsscplugin_0x2002DCC1.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp --- a/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -55,7 +55,7 @@ return mmsConn; } -OS_EXPORT S60MmsServerConnection::~S60MmsServerConnection() +S60MmsServerConnection::~S60MmsServerConnection() { JELOG2(EWMA); delete mOpenMonitor; @@ -270,7 +270,7 @@ return mFilter; } -OS_EXPORT void S60MmsServerConnection::close() +void S60MmsServerConnection::close() { JELOG2(EWMA); // the close and RunL are synchronized to make it SMP safe. diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/mms/src.s60/cjavammsmessagehandler.cpp --- a/javaextensions/wma/mms/src.s60/cjavammsmessagehandler.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/mms/src.s60/cjavammsmessagehandler.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -790,6 +790,8 @@ { // get cc length aHeaderLengths[KCcFieldIndex] = ReadIntL(aReadStream); + if (div == 0) + break; mmsMap = div; } break; diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/sms_cbs/build/javawma_0x2002DCDC.mmp --- a/javaextensions/wma/sms_cbs/build/javawma_0x2002DCDC.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/sms_cbs/build/javawma_0x2002DCDC.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/sms/SMSConnectionImpl.java --- a/javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/sms/SMSConnectionImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/sms/SMSConnectionImpl.java Fri Oct 22 14:23:56 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" @@ -28,7 +28,7 @@ import com.nokia.mj.impl.utils.Logger; import com.nokia.mj.impl.smscbs.utils.WmaUrl; -import com.nokia.mj.impl.rt.support.ShutdownListener; +import com.nokia.mj.impl.rt.support.Finalizer; import com.nokia.mj.impl.rt.support.ApplicationUtils; /** * The SMSConnectionImpl used for sending and receiving Binary/Text Messages. It @@ -96,6 +96,8 @@ private MessageListener iMessageListener; private WmaUrl iUri; + + private Finalizer iFinalizer; public SMSConnectionImpl(WmaUrl aMsgUri, boolean aServerMode) throws IOException @@ -113,41 +115,34 @@ iCloseLock = new Object(); iMessageLock = new Object(); iSendLock = new Object(); - //register for shutdown listening - setShutdownListener(); + //register for Finalization + iFinalizer = registerForFinalization(); Logger.LOG(Logger.EWMA, Logger.EInfo, "- SMSConnectionImpl::SMSConnectionImpl"); } /* - * This function registers this object for shutDown. + * This function registers for Finalization. */ - private void setShutdownListener() + + + public Finalizer registerForFinalization() { - Logger.LOG(Logger.EWMA, Logger.EInfo, - "+ SMSConnectionImpl::setShutdownListener"); - // Get the insatnce of ApplicationUtils. - ApplicationUtils appUtils = ApplicationUtils.getInstance(); - - // Get the name of the application. - appUtils.addShutdownListener(new ShutdownListener() + return new Finalizer() { - //The method that gets called when Application is shutting down - public void shuttingDown() + public void finalizeImpl() { try { close(); } - catch (IOException ex) + catch (IOException e) { //Nothing to do, just ignore - Logger.ELOG(Logger.EWMA, ex.toString(), ex); + Logger.LOG(Logger.EWMA, Logger.EInfo, e.toString()); } } - }); - Logger.LOG(Logger.EWMA, Logger.EInfo, - "- SMSConnectionImpl::setShutdownListener"); + }; } /** diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/sms_cbs/pushplugin/cbs/build/eabi/javacbsscpluginu.def --- a/javaextensions/wma/sms_cbs/pushplugin/cbs/build/eabi/javacbsscpluginu.def Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/cbs/build/eabi/javacbsscpluginu.def Fri Oct 22 14:23:56 2010 +0100 @@ -24,16 +24,4 @@ _ZTVN4java3wma19CbsServerConnectionE @ 23 NONAME ; ## _ZTVN4java3wma20ServerConnectionBaseE @ 24 NONAME ; ## _ZThn28_N4java3wma19CbsServerConnection4openEPNS_4push18ConnectionListenerE @ 25 NONAME ; ## - _ZN4java3wma19CbsServerConnection15retrieveMessageER8TPckgBufI22TJavaMessageParametersE @ 26 NONAME - _ZN4java3wma19CbsServerConnection4openEPNS_4push18ConnectionListenerEb @ 27 NONAME - _ZN4java3wma19CbsServerConnection5closeEv @ 28 NONAME - _ZN4java3wma19CbsServerConnectionD0Ev @ 29 NONAME - _ZN4java3wma19CbsServerConnectionD1Ev @ 30 NONAME - _ZN4java3wma19CbsServerConnectionD2Ev @ 31 NONAME - _ZThn28_N4java3wma19CbsServerConnection15retrieveMessageER8TPckgBufI22TJavaMessageParametersE @ 32 NONAME - _ZThn28_N4java3wma19CbsServerConnection4openEPNS_4push18ConnectionListenerEb @ 33 NONAME - _ZThn28_N4java3wma19CbsServerConnection5closeEv @ 34 NONAME - _ZThn28_N4java3wma19CbsServerConnectionD0Ev @ 35 NONAME - _ZThn28_N4java3wma19CbsServerConnectionD1Ev @ 36 NONAME - diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/sms_cbs/pushplugin/cbs/build/javacbsscplugin_0x2002DCA4.mmp --- a/javaextensions/wma/sms_cbs/pushplugin/cbs/build/javacbsscplugin_0x2002DCA4.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/cbs/build/javacbsscplugin_0x2002DCA4.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/sms_cbs/pushplugin/cbs/src.s60/cbsserverconnection.cpp --- a/javaextensions/wma/sms_cbs/pushplugin/cbs/src.s60/cbsserverconnection.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/cbs/src.s60/cbsserverconnection.cpp Fri Oct 22 14:23:56 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" @@ -58,10 +58,9 @@ return cbsConn; } -OS_EXPORT CbsServerConnection::~CbsServerConnection() +CbsServerConnection::~CbsServerConnection() { JELOG2(EWMA); - removeDir(mMessageStoreDirName); } void CbsServerConnection::initializeL() @@ -128,7 +127,7 @@ } } -OS_EXPORT void CbsServerConnection::open(ConnectionListener* aListener, +void CbsServerConnection::open(ConnectionListener* aListener, bool aIsAppLaunched) { JELOG2(EWMA); @@ -192,7 +191,8 @@ const java::runtime::ApplicationInfo& appInf = java::runtime::ApplicationInfo::getInstance(); const std::wstring& root = appInf.getRootPath(); - error = createMessageStore(root + CBS_STORE_PATH); + // At this point mIsAppLaunched will be true if it not push connection. + error = createMessageStore(root + CBS_STORE_PATH, mIsAppLaunched); if (error != KErrNone) { ELOG1(EWMA,"CBS : create message store failed : %d",error); @@ -214,12 +214,6 @@ } mOpenMonitor->wait(); - // If there are any messages already available in the message store - // notify the listener - if (mMessagesOnStore > 0) - { - mListener->msgArrived(); - } mIsListening = true; } } @@ -282,7 +276,7 @@ } } -OS_EXPORT int CbsServerConnection::retrieveMessage(TJavaMessageParametersBuf& aCbsBuf) +int CbsServerConnection::retrieveMessage(TJavaMessageParametersBuf& aCbsBuf) { JELOG2(EWMA); TCBSParametersBuf cbsParametersBuf; @@ -328,7 +322,7 @@ } -OS_EXPORT void CbsServerConnection::close() +void CbsServerConnection::close() { JELOG2(EWMA); // the close and RunL are synchronized to make it SMP safe. @@ -524,7 +518,7 @@ } // Store the received page number, such that the message can // be reconstructed in the correct order later - mCbsMessagePagesRef.AppendL(currentPage); + mCbsMessagePagesRef.Append(currentPage); // Store the actual content of the message mCbsMessagePagesData->AppendL(messageData); diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/sms_cbs/pushplugin/inc/serverconnectionbase.h --- a/javaextensions/wma/sms_cbs/pushplugin/inc/serverconnectionbase.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/inc/serverconnectionbase.h Fri Oct 22 14:23:56 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" @@ -109,7 +109,7 @@ * @param path:the message store path * @returns SUCCESS or FAILURE */ - int createMessageStore(std::wstring aPath); + int createMessageStore(std::wstring aPath, bool aDeleteStore); /** * Removes the directory specified. diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/sms_cbs/pushplugin/sms/build/eabi/javasmsscpluginu.def --- a/javaextensions/wma/sms_cbs/pushplugin/sms/build/eabi/javasmsscpluginu.def Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/sms/build/eabi/javasmsscpluginu.def Fri Oct 22 14:23:56 2010 +0100 @@ -10,28 +10,23 @@ _ZN26SmsServerConnectionFactoryD2Ev @ 9 NONAME _ZN4java3wma19SmsServerConnection15retrieveMessageER8TPckgBufI22TJavaMessageParametersE @ 10 NONAME _ZN4java3wma19SmsServerConnection4openEPNS_4push18ConnectionListenerE @ 11 NONAME - _ZN4java3wma19SmsServerConnection4openEPNS_4push18ConnectionListenerEb @ 12 NONAME - _ZN4java3wma19SmsServerConnection5closeEv @ 13 NONAME - _ZN4java3wma19SmsServerConnectionC1ERKSbIwSt11char_traitsIwESaIwEES7_ @ 14 NONAME - _ZN4java3wma19SmsServerConnectionC2ERKSbIwSt11char_traitsIwESaIwEES7_ @ 15 NONAME - _ZN4java3wma19SmsServerConnectionD0Ev @ 16 NONAME - _ZN4java3wma19SmsServerConnectionD1Ev @ 17 NONAME - _ZN4java3wma19SmsServerConnectionD2Ev @ 18 NONAME - _ZN4java3wma20ServerConnectionBase9setFilterERKSbIwSt11char_traitsIwESaIwEE @ 19 NONAME - _ZNK4java3wma20ServerConnectionBase18getMessagesOnStoreEv @ 20 NONAME - _ZNK4java3wma20ServerConnectionBase6getUriEv @ 21 NONAME - _ZNK4java3wma20ServerConnectionBase9getFilterEv @ 22 NONAME - _ZTI26SmsServerConnectionFactory @ 23 NONAME - _ZTIN4java3wma19SmsServerConnectionE @ 24 NONAME - _ZTIN4java3wma20ServerConnectionBaseE @ 25 NONAME - _ZTV26SmsServerConnectionFactory @ 26 NONAME - _ZTVN4java3wma19SmsServerConnectionE @ 27 NONAME - _ZTVN4java3wma20ServerConnectionBaseE @ 28 NONAME - _ZThn28_N4java3wma19SmsServerConnection15retrieveMessageER8TPckgBufI22TJavaMessageParametersE @ 29 NONAME - _ZThn28_N4java3wma19SmsServerConnection4openEPNS_4push18ConnectionListenerE @ 30 NONAME - _ZThn28_N4java3wma19SmsServerConnection4openEPNS_4push18ConnectionListenerEb @ 31 NONAME - _ZThn28_N4java3wma19SmsServerConnection5closeEv @ 32 NONAME - _ZThn28_N4java3wma19SmsServerConnectionD0Ev @ 33 NONAME - _ZThn28_N4java3wma19SmsServerConnectionD1Ev @ 34 NONAME + _ZN4java3wma19SmsServerConnectionC1ERKSbIwSt11char_traitsIwESaIwEES7_ @ 12 NONAME + _ZN4java3wma19SmsServerConnectionC2ERKSbIwSt11char_traitsIwESaIwEES7_ @ 13 NONAME + _ZN4java3wma19SmsServerConnectionD0Ev @ 14 NONAME + _ZN4java3wma19SmsServerConnectionD1Ev @ 15 NONAME + _ZN4java3wma19SmsServerConnectionD2Ev @ 16 NONAME + _ZN4java3wma20ServerConnectionBase9setFilterERKSbIwSt11char_traitsIwESaIwEE @ 17 NONAME + _ZNK4java3wma20ServerConnectionBase18getMessagesOnStoreEv @ 18 NONAME + _ZNK4java3wma20ServerConnectionBase6getUriEv @ 19 NONAME + _ZNK4java3wma20ServerConnectionBase9getFilterEv @ 20 NONAME + _ZTI26SmsServerConnectionFactory @ 21 NONAME ; ## + _ZTIN4java3wma19SmsServerConnectionE @ 22 NONAME ; ## + _ZTIN4java3wma20ServerConnectionBaseE @ 23 NONAME ; ## + _ZTV26SmsServerConnectionFactory @ 24 NONAME ; ## + _ZTVN4java3wma19SmsServerConnectionE @ 25 NONAME ; ## + _ZTVN4java3wma20ServerConnectionBaseE @ 26 NONAME ; ## + _ZThn28_N4java3wma19SmsServerConnection15retrieveMessageER8TPckgBufI22TJavaMessageParametersE @ 27 NONAME ; ## + _ZThn28_N4java3wma19SmsServerConnection4openEPNS_4push18ConnectionListenerE @ 28 NONAME ; ## + _ZThn28_N4java3wma19SmsServerConnectionD0Ev @ 29 NONAME ; ## + _ZThn28_N4java3wma19SmsServerConnectionD1Ev @ 30 NONAME ; ## - diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/sms_cbs/pushplugin/sms/build/javasmsscplugin_0x2002DCD3.mmp --- a/javaextensions/wma/sms_cbs/pushplugin/sms/build/javasmsscplugin_0x2002DCD3.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/sms/build/javasmsscplugin_0x2002DCD3.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc.s60 diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp --- a/javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp Fri Oct 22 14:23:56 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" @@ -64,15 +64,13 @@ OS_EXPORT SmsServerConnection::~SmsServerConnection() { JELOG2(EWMA); - // As per internal spec the message store should be removed only when - // Application is uninstalled / UnRegistered from push - removeDir(mMessageStoreDirName); + delete mMessage; delete mFilterDes; delete mOpenMonitor; } -OS_EXPORT void SmsServerConnection::open(ConnectionListener* aListener, +void SmsServerConnection::open(ConnectionListener* aListener, bool aIsAppLaunched) { JELOG2(EWMA); @@ -148,7 +146,9 @@ java::runtime::ApplicationInfo::getInstance(); const std::wstring& root = appInf.getRootPath(); LOG1(EWMA, EInfo,"SMS Store path %S",root.c_str()); - error = createMessageStore(root + SMS_STORE_PATH); + // At this point mIsAppLaunched will be true if it not + // push connection. + error = createMessageStore(root + SMS_STORE_PATH , mIsAppLaunched); mState = EReceivingMessageForNotify; if (KErrNone == error) { @@ -165,10 +165,6 @@ __FUNCTION__,__LINE__); } mOpenMonitor->wait(); - if (mMessagesOnStore > 0) - { - mListener->msgArrived(); - } mIsListening = true; } } @@ -301,7 +297,7 @@ } -OS_EXPORT void SmsServerConnection::close() +void SmsServerConnection::close() { JELOG2(EWMA); // the close and RunL are synchronized to make it SMP safe. diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/sms_cbs/pushplugin/src/serverconnectionbase.cpp --- a/javaextensions/wma/sms_cbs/pushplugin/src/serverconnectionbase.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/src/serverconnectionbase.cpp Fri Oct 22 14:23:56 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" @@ -82,19 +82,21 @@ return mMessagesOnStore; } -int ServerConnectionBase::createMessageStore(std::wstring aDirectoryPath) +int ServerConnectionBase::createMessageStore(std::wstring aDirectoryPath, bool aDeleteStore) { JELOG2(EWMA); aDirectoryPath += JavaCommonUtils::intToWstring(mPort); - aDirectoryPath +=L"\\" ; - mMessageStoreDirName = aDirectoryPath; + // If not push connection delete the message store. + if (aDeleteStore) + removeDir(aDirectoryPath); + mMessageStoreDirName = aDirectoryPath + L"\\"; LOG1(EWMA, EInfo , " Creating message store in path %S", mMessageStoreDirName.c_str()); // See if directory is present - if (FileUtilities::isDirectory(mMessageStoreDirName)) + if (FileUtilities::isDirectory(aDirectoryPath)) { std::list dirList = FileUtilities::getDirContentsList - (mMessageStoreDirName); + (aDirectoryPath); mMessagesOnStore = dirList.size(); if (mMessagesOnStore> 0) { @@ -198,7 +200,7 @@ { for (it = dirList.begin(); it != dirList.end(); it++) { - std::wstring element(aDirPath); + std::wstring element(aDirPath + L"\\"); element += *it; char *fileName = JavaCommonUtils::wstringToUtf8(element); if ((error = remove(fileName)) != 0) diff -r 461e71b327da -r 0553e2305d00 javaextensions/wma/sms_cbs/src.s60/csmsplatformservices60impl.cpp --- a/javaextensions/wma/sms_cbs/src.s60/csmsplatformservices60impl.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaextensions/wma/sms_cbs/src.s60/csmsplatformservices60impl.cpp Fri Oct 22 14:23:56 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" @@ -48,6 +48,7 @@ { mSmsSendSocket.CancelAll(); mSmsSendSocket.Close(); + mSocketServer.Close(); delete mSendMessage; } delete mMessageParameters; diff -r 461e71b327da -r 0553e2305d00 javamanager/bld.inf --- a/javamanager/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/bld.inf Fri Oct 22 14:23:56 2010 +0100 @@ -21,12 +21,11 @@ #include "preinstaller/build/bld.inf" #include "debugapi/build/bld.inf" #include "javalauncher/build/bld.inf" -#include "javaupgradeapp/build/bld.inf" #include "javacaptain/bld.inf" #include "javainstaller/bld.inf" #include "javaregistry/bld.inf" #include "javabackup/bld.inf" #include "javasettings/bld.inf" +#include "javasidchecker/build/bld.inf" #include "javarecognizer/build/bld.inf" -#include "javasidchecker/build/bld.inf" #include "javaappschemeplugin/build/bld.inf" diff -r 461e71b327da -r 0553e2305d00 javamanager/debugapi/build/debugapi_0x2002DCAB.mmp --- a/javamanager/debugapi/build/debugapi_0x2002DCAB.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/debugapi/build/debugapi_0x2002DCAB.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javamanager/javaappschemeplugin/build/javaappschemeplugin.mmp --- a/javamanager/javaappschemeplugin/build/javaappschemeplugin.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaappschemeplugin/build/javaappschemeplugin.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -26,12 +26,6 @@ // Use bytepair compression to enable code paging PAGED -APP_LAYER_SYSTEMINCLUDE - -#ifndef RD_JAVA_S60_RELEASE_9_2 -SYSTEMINCLUDE /epoc32/include/ecom // Due to SchemeHandler.inl in 5.0 2009w18 and 10.1 builds -#endif - SOURCEPATH ../src SOURCE javaapphandler.cpp @@ -43,6 +37,9 @@ USERINCLUDE ../inc +SYSTEMINCLUDE /epoc32/include/ecom +APP_LAYER_SYSTEMINCLUDE + LIBRARY euser.lib LIBRARY ecom.lib diff -r 461e71b327da -r 0553e2305d00 javamanager/javaappschemeplugin/data/2002875F.rss diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/javabackupcore/build/javabackup.mmp --- a/javamanager/javabackup/javabackupcore/build/javabackup.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javabackup/javabackupcore/build/javabackup.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -43,14 +43,12 @@ SOURCE jsbcactive.cpp SOURCE jsbcdataowner.cpp -#ifdef RD_JAVA_S60_RELEASE_5_0 -SYSTEMINCLUDE /epoc32/include/connect // Due to abclient.h in S60 5.0 -#endif - USERINCLUDE ../src.s60 USERINCLUDE ../../inc.s60 USERINCLUDE ../../../../inc +SYSTEMINCLUDE /epoc32/include/connect + LIBRARY ecom.lib LIBRARY abclient.lib LIBRARY javastorage.lib diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/javabackupcore/src.s60/jsbcdataowner.h --- a/javamanager/javabackup/javabackupcore/src.s60/jsbcdataowner.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javabackup/javabackupcore/src.s60/jsbcdataowner.h Fri Oct 22 14:23:56 2010 +0100 @@ -19,7 +19,7 @@ #ifndef JSBCDATAOWNER_H #define JSBCDATAOWNER_H -#include +#include namespace java { diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup/build/midp2backupplugin.mmp --- a/javamanager/javabackup/midp2backup/build/midp2backupplugin.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javabackup/midp2backup/build/midp2backupplugin.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -46,16 +46,19 @@ SOURCE javaversionbackuputil.cpp SOURCE mediaidupdater.cpp + USERINCLUDE ../src.s60 USERINCLUDE ../../inc.s60 USERINCLUDE ../../../../inc +SYSTEMINCLUDE /epoc32/include/connect + start resource ../data/10282474.rss TARGET midp2backupplugin.rsc end LIBRARY ecom.lib -LIBRARY estor.lib +LIBRARY estor.lib LIBRARY efsrv.lib LIBRARY javastorage.lib LIBRARY sysutil.lib diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup/data/10282474.rss --- a/javamanager/javabackup/midp2backup/data/10282474.rss Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javabackup/midp2backup/data/10282474.rss Fri Oct 22 14:23:56 2010 +0100 @@ -36,7 +36,7 @@ IMPLEMENTATION_INFO { implementation_uid = KBackupEcomImplUid; - version_no = 1; + version_no = 3; display_name = "MIDP2 Backup Plugin"; default_data = "midp2"; opaque_data = "test_params"; diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.cpp --- a/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -39,6 +39,9 @@ using namespace java::storage; using namespace java::backup; +const wchar_t * const JBNULLSTRING = L"ABBAABBA_NULL"; +const int JBNULLSTRINGLENGTH = -1; + // ======== MEMBER FUNCTIONS ======== CStorageBackupUtil::CStorageBackupUtil() @@ -82,60 +85,134 @@ // clear the vectors to free all the heap data. iStringVector.clear(); + if (iBufForJavaStorageItemsPtr) + { + delete iBufForJavaStorageItemsPtr; + iBufForJavaStorageItemsPtr = 0; + } + } void CStorageBackupUtil::BackupStorageDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft) { - LOG(EBackup, EInfo, "CStorageBackupUtil::BackupStorageDataL"); + ILOG(EBackup, "CStorageBackupUtil::BackupStorageDataL()"); iBufferSpaceLeft = aBufferSpaceLeft; if (iFirstCalltoBackupStorageData) { + ILOG(EBackup, "First call to BackupStorageData()"); int err = FillVectorWithStorageData(); if (err != KErrNone) { + ELOG1(EBackup, "Error (%d) in filling wstring vector", err); User::Leave(err); } - LOG1(EBackup, EInfo, "Total no of rows in vector: %d", iStringVector.size()); + ILOG1(EBackup, "Total no of rows in vector: %d", iStringVector.size()); - // First write the total no of rows in the vector to the stream + // 1. Find out the size of the buffer needed for containing JavaStorage + // data in "streamed" format. + TUint totalStringLengthInBytes = 0; + for (int i = 0; i < iStringVector.size(); ++i) + { + if (iStringVector[i] == JBNULLSTRING ){ + continue; + } + totalStringLengthInBytes += iStringVector[i].length()*sizeof(wchar_t); + } + ILOG1(EBackup, "Total string length calculated: %d", totalStringLengthInBytes); - aStream.WriteInt32L(iStringVector.size()); - iBufferSpaceLeft -= sizeof(TInt32); + // Calculate the total length of the buffer. + // The content of the buffer will be as follows: + + TUint totalBuffSize = sizeof(TInt32) + NUMBER_OF_TABLES*sizeof(TInt16) + + iStringVector.size()*sizeof(TInt16) + totalStringLengthInBytes; + + // 2. Reserve the buffer with adequate space + iBufForJavaStorageItemsPtr = HBufC8::NewL(totalBuffSize); + ILOG1(EBackup, "javaStorage Buffer(size %d) allocated SUCCESSFULLY", totalBuffSize); - /* 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++) + // 3. Create temporary stream operator and with it write stuff to buffer + TPtr8 buffPtr(iBufForJavaStorageItemsPtr->Des()); + RDesWriteStream buffStream(buffPtr); + CleanupClosePushL(buffStream); + buffStream.WriteInt32L(iStringVector.size()); + for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; ++tableNumber) + { + buffStream.WriteInt16L(iTableSize[tableNumber]); + } + ILOG(EBackup, "JavaStorage table sizes writen to buffer"); + TUint writenStringLength = 0; + for (int i = 0; i < iStringVector.size(); ++i) { - aStream.WriteInt16L(iTableSize[tableNumber]); - iBufferSpaceLeft -= sizeof(TInt16); + TInt16 lenOf8byteString = JBNULLSTRINGLENGTH; + if ( iStringVector[i] == JBNULLSTRING ) + { + buffStream.WriteInt16L(lenOf8byteString); + continue; + } + lenOf8byteString = iStringVector[i].length()*sizeof(wchar_t); + buffStream.WriteInt16L(lenOf8byteString); + if (lenOf8byteString > 0 ) + { + HBufC* tempstring = java::util::S60CommonUtils::wstringToDes( + iStringVector[i].c_str()); + if (!tempstring) + { + ELOG(EBackup, "Out of memory in JavaStorage backup(in wstring -> des conv)!"); + User::Leave(KErrNoMemory); + } + CleanupStack::PushL(tempstring); + TPtrC tempStr = tempstring->Des(); + writenStringLength += tempStr.Size(); + buffStream.WriteL(tempStr); //length of the string will not be written + CleanupStack::PopAndDestroy(tempstring); + } } + ILOG1(EBackup, "Total string length writen: %d", writenStringLength); + ILOG(EBackup, "Whole Java Storage String vector writen to streambuffer"); + // 4. Clear not needed resources + iStringVector.clear(); + CleanupStack::PopAndDestroy(&buffStream); + ILOG(EBackup, "Not needed resources cleared"); + + // 5. Set the read pointer to the beginning of the buffer data + // Note that the length of the HBufC8 buffer is exact. + iBuffReadPointer.Set(iBufForJavaStorageItemsPtr->Des()); iFirstCalltoBackupStorageData = EFalse; } - // Now write the actual string data into the stream. - - while (iBufferSpaceLeft > 0 && iStrCount < iStringVector.size()) + // 6. Start to provide data to SBE from the buffer. + ILOG(EBackup, "Extracting data from buffer to SBE"); + ILOG1(EBackup, "Length of the data in stream buffer: %d", iBuffReadPointer.Length()); + ILOG1(EBackup, "Space available in SBE buffer: %d", aBufferSpaceLeft); + if (iBuffReadPointer.Length() <= aBufferSpaceLeft ) { - WriteStringtoStreamL(aStream, iStringVector[iStrCount]); - LOG1(EBackup, EInfo, "StrCount = %d", iStrCount); + aStream.WriteL(iBuffReadPointer); + aBufferSpaceLeft -= iBuffReadPointer.Length(); + iBuffReadPointer.Set(NULL,0); + delete iBufForJavaStorageItemsPtr; + iBufForJavaStorageItemsPtr = 0; + ILOG(EBackup, "BACKUP OF STORAGE DATA FINISHED"); + aBackupNotFinished = EFalse; // Indicate to caller that we are ready } - - if (iStrCount >= iStringVector.size()) + else // All data from internal buffer does not fit at once to buffer received from SBE { - LOG(EBackup, EInfo, "Backup of storage data finished"); - aBackupNotFinished = EFalse; + aStream.WriteL(iBuffReadPointer, aBufferSpaceLeft); + TInt lengthOfWritenData = aBufferSpaceLeft; + iBuffReadPointer.Set(iBuffReadPointer.Ptr() + lengthOfWritenData, + iBuffReadPointer.Length() - lengthOfWritenData); + aBufferSpaceLeft = 0; + ILOG(EBackup, "Not all of the storage data fit into SBE buffer, new buffer from SBE needed."); } } void CStorageBackupUtil::RestoreStorageDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft) { - LOG(EBackup, EInfo, "CStorageBackupUtil::RestoreStorageDataL()"); + ILOG(EBackup, "+CStorageBackupUtil::RestoreStorageDataL()"); iBufferSpaceLeft = aBufferSpaceLeft; @@ -177,49 +254,11 @@ updater.update(); // Storage restore is over; Set state to EAppArc + ILOG(EBackup, "JAVASTORAGE RESTORED SUCCESSFULLY"); aRestoreState = EAppArc; 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++; - } - } + ILOG(EBackup, "-CStorageBackupUtil::RestoreStorageDataL()"); } void CStorageBackupUtil::ReadStringfromStreamL(RDesReadStream& aStream) @@ -271,7 +310,7 @@ } } - else + else /* handling new string */ { iLenOfString = aStream.ReadInt16L(); iBufferSpaceLeft -= sizeof(TInt16); @@ -326,6 +365,12 @@ delete data; } } + /* */ + else if (iLenOfString == JBNULLSTRINGLENGTH ) + { + iStringVector.push_back(JBNULLSTRING); + iStrCount--; + } /* if length of string is 0, do not read anything from the stream; just push an empty string into the vector */ else @@ -657,6 +702,20 @@ } +void CStorageBackupUtil::WriteItemToStorageEntry( + const std::wstring& aEntryName, + const std::wstring& aEntryValue, + JavaStorageApplicationEntry_t& aInsertEntry + ) +{ + JavaStorageEntry attribute; + if (aEntryValue != JBNULLSTRING ) + { + attribute.setEntry(aEntryName, aEntryValue); + aInsertEntry.insert(attribute); + } +} + int CStorageBackupUtil::WriteDataToStorage() { JELOG2(EBackup); @@ -716,7 +775,6 @@ } } - JavaStorageEntry attribute; JavaStorageApplicationEntry_t insertEntry; ILOG(EBackup, "Start transaction for writing into the database"); @@ -728,47 +786,20 @@ 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); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(PACKAGE_NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VENDOR, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VERSION, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ROOT_PATH, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(MEDIA_ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(INITIAL_SIZE, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(JAD_PATH, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(JAR_PATH, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(JAD_URL, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(JAR_URL, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ACCESS_POINT, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CONTENT_INFO, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CONTENT_ID, iStringVector[count++], insertEntry); try { @@ -791,20 +822,11 @@ 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); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(PACKAGE_ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(MAIN_CLASS, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(AUTORUN, iStringVector[count++], insertEntry); try { @@ -827,17 +849,10 @@ 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); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VALUE, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(TRUSTED, iStringVector[count++], insertEntry); try { @@ -860,35 +875,16 @@ 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); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(TYPE, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(SECURITY_DOMAIN, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(SECURITY_DOMAIN_CATEGORY, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(HASH, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CERT_HASH, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(RMS, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VALID_CERTS, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ON_SCREEN_KEYPAD, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(SECURITY_WARNINGS, iStringVector[count++], insertEntry); try { @@ -911,20 +907,11 @@ 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); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CLASS, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ACTION, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(FUNCTION_GROUP, iStringVector[count++], insertEntry); try { @@ -947,20 +934,11 @@ 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); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(FUNCTION_GROUP, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ALLOWED_SETTINGS, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CURRENT_SETTING, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(BLANKET_PROMPT, iStringVector[count++], insertEntry); try { @@ -983,20 +961,11 @@ 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); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(URL, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(FILTER, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(REGISTRATION_TYPE, iStringVector[count++], insertEntry); try { @@ -1019,11 +988,8 @@ 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); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ALARM_TIME, iStringVector[count++], insertEntry); try { @@ -1047,8 +1013,7 @@ for (int rowNumber = 0; rowNumber < iTableSize[8]; rowNumber++) { - attribute.setEntry(EXTENSIONS, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(EXTENSIONS, iStringVector[count++], insertEntry); try { @@ -1071,17 +1036,10 @@ 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); + WriteItemToStorageEntry(NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VENDOR, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VERSION, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(INSTALL_STATE, iStringVector[count++], insertEntry); try { @@ -1170,26 +1128,13 @@ 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); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CREATION_TIME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(TYPE, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(OTA_CODE, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(URL, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(LATEST_RETRY_TIME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(RETRY_COUNT, iStringVector[count++], insertEntry); try { @@ -1247,144 +1192,46 @@ 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); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(PACKAGE_NAME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VENDOR, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VERSION, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ROOT_PATH, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(MEDIA_ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(INITIAL_SIZE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(JAD_PATH, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(JAR_PATH, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(JAD_URL, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(JAR_URL, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ACCESS_POINT, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CONTENT_INFO, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CONTENT_ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1408,54 +1255,19 @@ 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); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(PACKAGE_ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(NAME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(MAIN_CLASS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(AUTORUN, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1479,44 +1291,16 @@ 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); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(NAME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VALUE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(TRUSTED, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1524,6 +1308,24 @@ return rowsCount; } +void CStorageBackupUtil::FetchStorageEntryToStringVector(const JavaStorageEntry& aAttribute, + JavaStorageApplicationList_t::const_iterator& aApplicationsIter) +{ + const wstring emptyString; + wstring str; + JavaStorageApplicationEntry_t::const_iterator findIterator; + str = emptyString; + findIterator = (*aApplicationsIter).find(aAttribute); + + if (findIterator != (*aApplicationsIter).end()) + { + str = (*findIterator).entryValue(); + iStringVector.push_back(str); + } else { + iStringVector.push_back(JBNULLSTRING); + } +} + int CStorageBackupUtil::FillVectorwithMidpPackageTableData(JavaStorageApplicationList_t& afoundEntries) { const wstring emptyString; @@ -1534,110 +1336,39 @@ /* 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); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(TYPE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(SECURITY_DOMAIN, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(SECURITY_DOMAIN_CATEGORY, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(HASH, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CERT_HASH, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(RMS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VALID_CERTS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ON_SCREEN_KEYPAD, L""); - str = emptyString; - findIterator = (*applications).find(attribute); + FetchStorageEntryToStringVector(attribute, applications); - 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); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1661,54 +1392,19 @@ 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); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CLASS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(NAME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ACTION, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(FUNCTION_GROUP, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1732,54 +1428,19 @@ 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); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(FUNCTION_GROUP, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ALLOWED_SETTINGS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CURRENT_SETTING, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(BLANKET_PROMPT, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1803,54 +1464,19 @@ 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); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(URL, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(NAME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(FILTER, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(REGISTRATION_TYPE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1874,24 +1500,10 @@ 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); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ALARM_TIME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1915,14 +1527,7 @@ 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); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1946,44 +1551,16 @@ 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); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VENDOR, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VERSION, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(INSTALL_STATE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -2007,74 +1584,25 @@ 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); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CREATION_TIME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(TYPE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(OTA_CODE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(URL, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(LATEST_RETRY_TIME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(RETRY_COUNT, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.h --- a/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.h Fri Oct 22 14:23:56 2010 +0100 @@ -172,16 +172,6 @@ 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. * @@ -200,6 +190,17 @@ * has completed successfully or not. */ int WriteDataToStorage(); + + + void FetchStorageEntryToStringVector( + const java::storage::JavaStorageEntry& aAttribute, + java::storage::JavaStorageApplicationList_t::const_iterator& aApplicationsIter + ); + + void WriteItemToStorageEntry(const std::wstring& aEntryName, + const std::wstring& aEntryValue, + java::storage::JavaStorageApplicationEntry_t& aInsertEntry); + public: /** * Utility function which fills the vector with data got from storage. @@ -396,6 +397,19 @@ * Own */ int iBufferSpaceLeft; + + /** + * During backup data fromJavaStorage will be temporarily stored + * in serialised format in this buffer. + */ + HBufC8* iBufForJavaStorageItemsPtr; + + /** + * Stores the position in iBufForJavaStorageItemsPtr from where data is + * being read during backup operation. + */ + TPtrC8 iBuffReadPointer; + }; } // namespace backup diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup/src.s60/mediaidupdater.h --- a/javamanager/javabackup/midp2backup/src.s60/mediaidupdater.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javabackup/midp2backup/src.s60/mediaidupdater.h Fri Oct 22 14:23:56 2010 +0100 @@ -19,6 +19,8 @@ #ifndef MEDIAIDUPDATER_H #define MEDIAIDUPDATER_H +#include "javaosheaders.h" + #include #include @@ -39,7 +41,7 @@ * - another memory card is used during restore than originally */ -class MediaIdUpdater +OS_NONSHARABLE_CLASS(MediaIdUpdater) { public: MediaIdUpdater(); diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup/src.s60/midp2backupplugin.cpp --- a/javamanager/javabackup/midp2backup/src.s60/midp2backupplugin.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javabackup/midp2backup/src.s60/midp2backupplugin.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -29,7 +29,7 @@ #include "javacommonutils.h" #include "logger.h" -#include +#include #include #include #include @@ -125,7 +125,7 @@ void CMidp2BackupPlugin::GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished) { - LOG(EBackup, EInfo, "CMidp2BackupPlugin::GetBackupDataSectionL"); + ILOG(EBackup, "+CMidp2BackupPlugin::GetBackupDataSectionL()"); iBufferSpaceLeft = aBuffer.MaxLength(); RDesWriteStream stream(aBuffer); @@ -144,7 +144,7 @@ aFinished = EFalse; } - else + if (!iStorageDataBackup) { if (iFirstCallToGetBackupDataSection) { @@ -301,12 +301,13 @@ { aFinished = ETrue; iFirstCallToGetBackupDataSection = ETrue; - iStorageDataBackup = ETrue; + // iStorageDataBackup = ETrue; } delete fullFileName; } CleanupStack::PopAndDestroy(&stream); + ILOG(EBackup, "-CMidp2BackupPlugin::GetBackupDataSectionL()"); } @@ -318,7 +319,7 @@ void CMidp2BackupPlugin::RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished) { - LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreBaseDataSectionL"); + ILOG(EBackup, "+CMidp2BackupPlugin::RestoreBaseDataSectionL()"); iBufferSpaceLeft = aBuffer.Size(); RDesReadStream stream(aBuffer); @@ -349,6 +350,7 @@ if (iRestoreState == EStorage) { + ILOG1(EBackup, "Restoring Storage for drive %d", iDrive); iStorageBackupUtil -> RestoreStorageDataL(stream, iRestoreState, iBufferSpaceLeft); } @@ -372,12 +374,14 @@ if (aFinished) { // Set state to EStorage - iRestoreState = EStorage; + ILOG1(EBackup, "Restore of drive %d complete, resetting statemachine for next drive", iDrive); + iRestoreState = EAppArc; } } - aFinished = ETrue; + // aFinished = ETrue; CleanupStack::PopAndDestroy(&stream); + ILOG(EBackup, "-CMidp2BackupPlugin::RestoreBaseDataSectionL()"); } void CMidp2BackupPlugin::InitialiseRestoreIncrementDataL(TDriveNumber /* aDrive */) diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/build/bld.inf --- a/javamanager/javabackup/midp2backup_usif/build/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: bld.inf file for Midp2BackupPlugin -* -*/ - - -PRJ_MMPFILES -midp2backupplugin.mmp diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/build/bwins/backupu.def --- a/javamanager/javabackup/midp2backup_usif/build/bwins/backupu.def Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -EXPORTS - ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/build/eabi/backupu.def --- a/javamanager/javabackup/midp2backup_usif/build/eabi/backupu.def Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -EXPORTS - _Z24ImplementationGroupProxyRi @ 1 NONAME - _ZTIN4java6backup17CAppArcBackupUtilE @ 2 NONAME - _ZTIN4java6backup18CMidp2BackupPluginE @ 3 NONAME - _ZTIN4java6backup18CStorageBackupUtilE @ 4 NONAME - _ZTVN4java6backup17CAppArcBackupUtilE @ 5 NONAME - _ZTVN4java6backup18CMidp2BackupPluginE @ 6 NONAME - _ZTVN4java6backup18CStorageBackupUtilE @ 7 NONAME - diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/build/midp2backupplugin.mmp --- a/javamanager/javabackup/midp2backup_usif/build/midp2backupplugin.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file for MIDP2 Backup Plugin -* -*/ - - -#include -#include -#include - -#include <../../../../inc/java_stdcpp_support_for_dll.hrh> -#include <../../../../inc/project_defines.hrh> - -TARGET midp2backupplugin.dll -TARGETTYPE plugin -UID 0x10009D8D 0x10282474 - -#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS -CAPABILITY CAP_ECOM_PLUGIN TrustedUI -#else -// SBE has lesser capability set on beta release. -CAPABILITY CAP_ECOM_PLUGIN WriteDeviceData -#endif - -VENDORID VID_DEFAULT - -PAGED - -SOURCEPATH ../src.s60 -SOURCE proxy.cpp -SOURCE apparcbackuputil.cpp -SOURCE javastoragebackuputil.cpp -SOURCE javaversionbackuputil.cpp - -#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK -SOURCE javascrbackuputil.cpp -SOURCE midp2backuppluginusif.cpp -#else -SOURCE midp2backupplugin.cpp -#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - -USERINCLUDE ../src.s60 -USERINCLUDE ../../inc.s60 -USERINCLUDE ../../../../inc - -start resource ../data/10282474.rss -TARGET midp2backupplugin.rsc -end - -LIBRARY ecom.lib -LIBRARY efsrv.lib -LIBRARY javastorage.lib -LIBRARY sysutil.lib -LIBRARY apgrfx.lib -LIBRARY apparc.lib -LIBRARY estlib.lib -LIBRARY javaenvinfo.lib -LIBRARY estor.lib -LIBRARY ipcstream.lib - -#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK -LIBRARY scrclient.lib -#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - -#if defined(WINSCW) - deffile ./bwins/backup.def -#else - deffile ./eabi/backup.def -#endif diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/data/10282474.rss --- a/javamanager/javabackup/midp2backup_usif/data/10282474.rss Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource file for the Ecom plugin of Java Backup -* -*/ - - -#include -#include "javauids.h" - -// Declares info for one implementation -RESOURCE REGISTRY_INFO theInfo -{ - resource_format_version = RESOURCE_FORMAT_VERSION_2; - // UID for the DLL - dll_uid = KBackupMidp2DllUid; - // Declare array of interface info - interfaces = { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = KBackupEcomIfUid; - implementations = { - // Info for CImplementation1 - IMPLEMENTATION_INFO - { - implementation_uid = KBackupEcomImplUid; - version_no = 1; - display_name = "MIDP2 Backup Plugin"; - default_data = "midp2"; - opaque_data = "test_params"; - rom_only = 0; - } - }; - } - }; -} - diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/apparcbackuputil.cpp --- a/javamanager/javabackup/midp2backup_usif/src.s60/apparcbackuputil.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,550 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of CAppArcBackupUtil -* -*/ - - -#include "apparcbackuputil.h" -#include "javaapparcutil.h" - -#include "javasymbianoslayer.h" -#include "javauid.h" -#include "logger.h" -#include "javacommonutils.h" -#include "s60commonutils.h" - -#include -#include -#include -#include -#include - -#include -#include - -#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS -#include -#else -#include -#endif - - -using namespace std; -using namespace java::storage; -using namespace java::backup; - -const TUid KMidletApplicationTypeUid = { 0x10210E26 }; -_LIT(KDefaultFolder, ""); - -// ======== MEMBER FUNCTIONS ======== - -CAppArcBackupUtil::CAppArcBackupUtil() -{ - LOG(EBackup, EInfo, "CAppArcBackupUtil constructor"); -} - -void CAppArcBackupUtil::ConstructL(RFs& aFs) -{ - LOG(EBackup, EInfo, "CAppArcBackupUtil::ConstructL"); - - User::LeaveIfError(iApparcServer.Connect()); - - iNumberOfIcons = 0; - iFs = aFs; -} - - -CAppArcBackupUtil* CAppArcBackupUtil::NewL(RFs& aFs) -{ - LOG(EBackup, EInfo, "CAppArcBackupUtil::NewL"); - - CAppArcBackupUtil* self = new(ELeave) CAppArcBackupUtil(); - CleanupStack::PushL(self); - self->ConstructL(aFs); - CleanupStack::Pop(); - - return self; -} - - -CAppArcBackupUtil::~CAppArcBackupUtil() -{ - LOG(EBackup, EInfo, "CAppArcBackupUtil destructor"); - - iApparcServer.Close(); -} - - -void CAppArcBackupUtil::RegisterAppL(TPtr8& aRestoreIconPtr, TDriveNumber& aDrive) -{ - LOG(EBackup, EInfo, "CAppArcBackupUtil::RegisterApp"); - - RDesReadStream stream(aRestoreIconPtr); - CleanupClosePushL(stream); - - // Read Uid - int midletUid = stream.ReadUint32L(); - - if (!CheckIfAlreadyRegisteredL(midletUid)) - { - // Read filename - TInt32 fileNameSize = stream.ReadInt32L(); - HBufC* fileName = HBufC::NewL(fileNameSize); - CleanupStack::PushL(fileName); - TPtr16 fileNamePtr = fileName->Des(); - stream.ReadL(fileNamePtr, fileNameSize / 2); // half of size - - // Read number of icons - TInt numberOfIcons = stream.ReadInt32L(); -// numberOfIcons = 1; - //LOG1(EBackup, EInfo, "Number of Icons = %d", numberOfIcons); - - TInt groupNameSize = stream.ReadInt32L(); - TBuf groupName; - - if (groupNameSize != 0) - { - stream.ReadL(groupName, groupNameSize / 2); - } - - // check disk space - TInt index = sizeof(TUint32) // midletUid - + sizeof(TInt32) // size of fileNameSize - + fileNameSize // size of filename - + sizeof(TInt32) // size of numberOfIcons - + sizeof(TInt32) // group name size - + groupNameSize; // groupname - - if (SysUtil::DiskSpaceBelowCriticalLevelL(&iFs, aRestoreIconPtr.Size() - index, aDrive)) - { - ELOG(EBackup, "Disk space below critical level. Leaving with KErrDiskFull."); - User::Leave(KErrDiskFull); - } - - // Make directory if necessary - iFs.CreatePrivatePath(aDrive); - - // Make full path of temporary icon file - TPath tempPath; - TPath tempPrivatePath; - iFs.PrivatePath(tempPrivatePath); - - TDriveUnit* driveUnit = new(ELeave) TDriveUnit(aDrive); - CleanupStack::PushL(driveUnit); - - tempPath.Append(driveUnit->Name().Left(1)); - tempPath.Append(KDriveDelimiter); - tempPath.Append(tempPrivatePath); - tempPath.Append(fileNamePtr); - - // Set private session path to point same drive where restoring - iFs.SetSessionToPrivate(aDrive); - - - RFile iconFile; - User::LeaveIfError(iconFile.Create(iFs, fileNamePtr, EFileWrite)); - - CleanupStack::PopAndDestroy(fileName); - CleanupClosePushL(iconFile); - - iconFile.Write(aRestoreIconPtr.Mid(index)); - - // Register application - LOG1(EBackup,EInfo,"Registering app %d", midletUid); - TUid uid = TUid::Uid(midletUid); - TBuf<128> appName; - CJavaApparcUtil::AppName(uid, appName); - - CApaRegistrationResourceFileWriter* writer = - CApaRegistrationResourceFileWriter::NewL(uid, - appName, - TApaAppCapability::ENonNative); - CleanupStack::PushL(writer); - - const TInt KOpaqueDataLength = 4; - TBuf8 opaqueData; - RDesWriteStream writeStream(opaqueData); - CleanupClosePushL(writeStream); - - LOG(EBackup, EInfo, "Getting midlet entry"); - - JavaStorageApplicationEntry_t appEntries = StorageEntryL(uid); - - if (appEntries.size() == 0) - { - ELOG(EBackup, "No midlet entry found in Java Storage; Mismatch between AppArc and Storage data. Abort backup"); - User::Leave(KErrNotFound); - } - - JavaStorageEntry attribute; - attribute.setEntry(NAME, L""); - - // Get Name attribute from read attributes. - JavaStorageApplicationEntry_t::const_iterator findIterator = appEntries.find(attribute); - wstring midName; - - if (findIterator != appEntries.end()) - { - midName = (*findIterator).entryValue(); - - } - else - { - User::Leave(KErrBadHandle); - } - - appEntries.clear(); - - HBufC* tempstr = java::util::S60CommonUtils::wstringToDes(midName.c_str()); - TPtrC midletName = tempstr->Des(); - - if (groupNameSize != 0) - { - writer->SetGroupNameL(groupName); - } - else - { - writer->SetGroupNameL(KDefaultFolder); - } - - writeStream.WriteUint32L(midletUid); - writeStream.CommitL(); - - LOG(EBackup, EInfo, "Setting opaque data"); - writer->SetOpaqueDataL(opaqueData); - - CApaLocalisableResourceFileWriter* lWriter = - CApaLocalisableResourceFileWriter::NewL(KNullDesC, - midletName, - numberOfIcons, - KNullDesC); - CleanupStack::PushL(lWriter); - - // Prepare AppArc for deregistration - LOG(EBackup, EInfo, "PrepareNonNativeApplicationsUpdatesL"); - iApparcServer.PrepareNonNativeApplicationsUpdatesL(); - - // Register application - LOG(EBackup, EInfo, "RegisterNonNativeApplicationL"); - iApparcServer.RegisterNonNativeApplicationL(KMidletApplicationTypeUid, - aDrive, - *writer, - lWriter, - &iconFile); - - // Commit registration changes - LOG(EBackup, EInfo, "CommitNonNativeApplicationsUpdatesL"); - iApparcServer.CommitNonNativeApplicationsUpdatesL(); - - delete tempstr; - CleanupStack::PopAndDestroy(lWriter); - CleanupStack::PopAndDestroy(&writeStream); - CleanupStack::PopAndDestroy(writer); - iconFile.Close(); - CleanupStack::PopAndDestroy(&iconFile); - - TInt err = iFs.Delete(tempPath); - LOG1(EBackup, EInfo, "iFs.Delete err = %d", err); - CleanupStack::PopAndDestroy(driveUnit); - } - - CleanupStack::PopAndDestroy(&stream); -} - - -void CAppArcBackupUtil::DeregisterAppsL(TDriveNumber aDrive) -{ - LOG1(EBackup, EInfo, "CAppArcBackupUtil::DeregisterApps, drive: %d", aDrive); - - // Initialise the process of getting apps - iApparcServer.GetFilteredApps(TApaAppCapability::ENonNative, - TApaAppCapability::ENonNative); - - // Getting the apps one-by-one - TApaAppInfo* info = new(ELeave) TApaAppInfo(); - CleanupStack::PushL(info); - - TUid typeUid; - - // Prepare AppArc for deregistration - LOG(EBackup, EInfo, "PrepareNonNativeApplicationsUpdatesL"); - iApparcServer.PrepareNonNativeApplicationsUpdatesL(); - - while (!iApparcServer.GetNextApp((*info))) - { - LOG1(EBackup, EInfo, "Getting Next App from AppArc, UID = %d", info->iUid); - - // Getting the type of the application - iApparcServer.GetAppType(typeUid, info->iUid); - - // If it's a MIDlet, check if it has an entry in Java Registry - TInt drive = 0; - GetDriveOfApp(info->iFullName, drive); - - if (typeUid == KMidletApplicationTypeUid && drive == aDrive) - { - LOG1(EBackup, EInfo, "Checking registry, midlet id = %d", info->iUid); - wstring PackageID; - // If there's no entry on the drive, deregister it from AppArc - JavaStorageApplicationEntry_t appEntries = StorageEntryL(info->iUid); - - if (appEntries.size() != 0) - { - JavaStorageEntry attribute; - attribute.setEntry(PACKAGE_ID, L""); - - JavaStorageApplicationEntry_t::const_iterator findIterator = appEntries.find(attribute); - - if (findIterator != appEntries.end()) - { - PackageID = (*findIterator).entryValue(); - } - else - { - User::Leave(KErrBadHandle); - } - - if (GetDrivefromStorageL(PackageID) != aDrive) - { - iApparcServer.DeregisterNonNativeApplicationL(info->iUid); - LOG1(EBackup, EInfo, "Deregistering midlet id = %d", info->iUid); - } - } - else - { - LOG(EBackup, EInfo, "Midlet entry not found in Java Storage; Deregister the Application"); - iApparcServer.DeregisterNonNativeApplicationL(info->iUid); - LOG1(EBackup, EInfo, "Deregistering midlet id = %d", info->iUid); - } - appEntries.clear(); - } - } - - // Commit registration changes - LOG(EBackup, EInfo, "CommitNonNativeApplicationsUpdatesL"); - iApparcServer.CommitNonNativeApplicationsUpdatesL(); - CleanupStack::PopAndDestroy(info); -} - - -void CAppArcBackupUtil::GetMidletsFromAppArcL(RArray& aUidArray, TDriveNumber aDrive) -{ - LOG(EBackup, EInfo, "CAppArcBackupUtil::GetMidletsFromAppArc"); - CleanupClosePushL(aUidArray); - - // Initialise the process of getting apps - iApparcServer.GetFilteredApps(TApaAppCapability::ENonNative, - TApaAppCapability::ENonNative); - - // Getting the apps one-by-one - TApaAppInfo* info = new(ELeave) TApaAppInfo(); - CleanupStack::PushL(info); - - TUid typeUid; - LOG1(EBackup, EInfo, "Drive Number aDrive = %d", aDrive); - - while (!iApparcServer.GetNextApp((*info))) - { - // Getting the type of the application - iApparcServer.GetAppType(typeUid, info->iUid); - - // If it's a MIDlet, check if it's registered to this drive - if (typeUid == KMidletApplicationTypeUid) - { - JavaStorageApplicationEntry_t appEntries = StorageEntryL(info->iUid); - - if (appEntries.size() != 0) - { - JavaStorageEntry attribute; - attribute.setEntry(PACKAGE_ID, L""); - - JavaStorageApplicationEntry_t::const_iterator findIterator = appEntries.find(attribute); - wstring PackageID; - - if (findIterator != appEntries.end()) - { - PackageID = (*findIterator).entryValue(); - - } - else - { - User::Leave(KErrBadHandle); - } - appEntries.clear(); - - if (GetDrivefromStorageL(PackageID) == aDrive) - { - aUidArray.AppendL(info->iUid); - iNumberOfIcons++; - } - } - else - { - ELOG(EBackup, "No entries from registry; midlet does not exist"); - } - } - } - CleanupStack::PopAndDestroy(info); - CleanupStack::Pop(); - -} - - -void CAppArcBackupUtil::GetIconFilename(TUid aUid, HBufC*& aFullFileName) -{ - LOG(EBackup, EInfo, "CAppArcBackupUtil::GetIconFilename"); - - iApparcServer.GetAppIcon(aUid, aFullFileName); -} - -TInt CAppArcBackupUtil::NumberOfIcons() -{ - LOG(EBackup, EInfo, "CAppArcBackupUtil::NumberOfIcons"); - - return iNumberOfIcons; -} - -void CAppArcBackupUtil::NumberOfOwnDefinedIcons(TUid aUid, TInt& aIconCount) -{ - LOG(EBackup, EInfo, "CAppArcBackupUtil::NumberOfOwnDefinedIcons"); - - iApparcServer.NumberOfOwnDefinedIcons(aUid, aIconCount); -} - -TBool CAppArcBackupUtil::CheckIfAlreadyRegisteredL(TInt& aUid) -{ - LOG(EBackup, EInfo, "CAppArcBackupUtil::CheckIfAlreadyRegisteredL"); - - TApaAppInfo* info = new(ELeave) TApaAppInfo(); - - TInt err = iApparcServer.GetAppInfo(*info, TUid::Uid(aUid)); - delete info; - if (err == KErrNone) - { - return ETrue; - } - else - { - return EFalse; - } - - -} - -void CAppArcBackupUtil::GetDriveOfApp(TFileName aPath, TInt& aDrive) -{ - LOG(EBackup, EInfo, "CAppArcBackupUtil::DriveOfApp"); - - iFs.CharToDrive(aPath[0], aDrive); -} - - -TApaAppGroupName CAppArcBackupUtil::GetMidletGroupName(TUid aUid) -{ - TApaAppCapabilityBuf cap; - - TInt err = iApparcServer.GetAppCapability(cap, aUid); - return cap().iGroupName; -} - - -JavaStorageApplicationEntry_t CAppArcBackupUtil::StorageEntryL(const TUid& aMidletUID) -{ - auto_ptr js(JavaStorage::createInstance()); - - try - { - js->open(JAVA_DATABASE_NAME); - LOG(EBackup, EInfo, "Java database opened"); - } - catch (JavaStorageException jse) - { - ELOG(EBackup, "Opening database connection failed"); - User::Leave(KErrNotFound); - } - - JavaStorageApplicationEntry_t entries; - - java::util::Uid appUid; - TUidToUid(aMidletUID, appUid); - - try - { - js->read(APPLICATION_TABLE, appUid, entries); - } - catch (JavaStorageException jse) - { - ELOG(EBackup, "Read in Java Storage failed"); - js->close(); - User::Leave(KErrGeneral); - } - js->close(); - - return entries; -} - -TDriveNumber CAppArcBackupUtil::GetDrivefromStorageL(wstring& aPackageID) -{ - wchar_t Drive; - auto_ptr js(JavaStorage::createInstance()); - - try - { - js->open(JAVA_DATABASE_NAME); - } - catch (JavaStorageException jse) - { - ELOG(EBackup, "Opening database connection failed"); - User::Leave(KErrNotFound); - } - - JavaStorageApplicationEntry_t entries; - java::util::Uid PackageID(aPackageID); - - try - { - js->read(APPLICATION_PACKAGE_TABLE, PackageID, entries); - } - catch (JavaStorageException jse) - { - ELOG(EBackup, "Read in Java Storage failed"); - js->close(); - User::Leave(KErrGeneral); - } - - js->close(); - - JavaStorageEntry attribute; - attribute.setEntry(ROOT_PATH, L""); - - JavaStorageApplicationEntry_t::const_iterator findIterator = entries.find(attribute); - wstring RootPath; - - if (findIterator != entries.end()) - { - RootPath = (*findIterator).entryValue(); - - } - else - { - User::Leave(KErrBadHandle); - } - - Drive = (wchar_t)RootPath[0]; - LOG1(EBackup, EInfo, "Drive = %c", Drive); - TInt i = Drive - (wchar_t)'a'; - LOG1(EBackup, EInfo, "Drive = %d", (TDriveNumber)i); - return (TDriveNumber)i; -} diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/apparcbackuputil.h --- a/javamanager/javabackup/midp2backup_usif/src.s60/apparcbackuputil.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Header file for CAppArcBackupUtil class -* -*/ - - -#ifndef APPARCBACKUPUTIL_H -#define APPARCBACKUPUTIL_H - -#include -#include -#include - -#include "javastorage.h" -#include "javastorageentry.h" -#include "javastoragenames.h" - -namespace java -{ -namespace backup -{ - -/** - * CAppArcBackupUtil class is handling AppArc registrations during backup - * and restore of Java Domain. - */ -class CAppArcBackupUtil : public CBase -{ - -public: - - /** - * Instantiates an object of this type - */ - static CAppArcBackupUtil* NewL(RFs& aFs); - - ~CAppArcBackupUtil(); - - /** - * This method registers applications to AppArc during restore. - * - * @param restoreIconPtr the buffer which contains the Uid and the - * icon file to be restored - * @param aDrive current drive to be restored - */ - void RegisterAppL(TPtr8& aRestoreIconPtr, TDriveNumber& aDrive); - - /** - * This method deregisters leftover applications from AppArc during - * restore. - * @param aDrive current drive to be restored - */ - void DeregisterAppsL(TDriveNumber aDrive); - - /** - * This method builds an array of the registered apps in AppArc. - * - * @param [out] aUidArray array of Midlet uids - * @param aDrive current drive to be backed up - */ - void GetMidletsFromAppArcL(RArray& aUidArray, TDriveNumber aDrive); - - /** - * This method looks up the icon filename of the given midlet - * - * @param aUid Uid of Midlet - * @param [out] aFullFilename filename of icon file - */ - void GetIconFilename(TUid aUid, HBufC*& aFullFilename); - - /** - * This method gets the number of MIDlet icons registered to AppArc - * restore. - * - * @return iNumberOfIcons - */ - TInt NumberOfIcons(); - - /** - * Gets the number of icons defined for a midlet from AppArc - * - * @param aUid Midlet Id - * @param [out] aIconCount number of icons defined for the midlet - */ - void NumberOfOwnDefinedIcons(TUid aUid, TInt& aIconCount); - - /** - * Gets an entry from Java Storage for the midlet uid specified - * - * @param midletUid Uid of the midlet - * - * @return returns the entry of the midlet - */ - java::storage::JavaStorageApplicationEntry_t StorageEntryL(const TUid& aMidletUID); - - /** - * Gets the Drive of the midlet suite for the specified UID - * - * @param packageID the ID of the application package - * - * @return returns the drive number of the application package - */ - - TDriveNumber GetDrivefromStorageL(std::wstring& aPackageID); - - /** - * Gets the group name of the midlet for the pecified UID - * - * @param aUid the UID of the midlet - * - * @return returns the group name of the midlet - */ - - TApaAppGroupName GetMidletGroupName(TUid aUid); - -private: - - CAppArcBackupUtil(); - - void ConstructL(RFs& aFs); - - /** - * Checks if midlet is already registered to AppArc. - * - * @param aUid Uid of Midlet - * @return ETrue if midlet is already registered to AppArc - */ - TBool CheckIfAlreadyRegisteredL(TInt& aUid); - - /** - * Gets the drive of the Midlet based on the path - * - * @param aPath Full path of Midlet - * @param [out] aDrive the drive where the midlet is registered to - */ - void GetDriveOfApp(TFileName aPath, TInt& aDrive); - - /** - * Gets the index of the midlet in its midlet suite - * - * @param aMidletSuiteEntry Midlet suite - * @param aUid Midlet Id - * @return index of midlet in the suite - */ - //TInt MidletIndexL( CJavaRegistrySuiteEntry &aMidletSuiteEntry, - // TUid aUid ); - - -private: // data - - /** - * File session - * Not own. - */ - RFs iFs; - - /** - * Number of MIDlet icons registered to AppArc - * Own. - */ - TInt iNumberOfIcons; - - /** - * ApparcSession - * Own. - */ - RApaLsSession iApparcServer; - -}; - -} //namespace backup -} //namespace java - -#endif // APPARCBACKUPUTIL_H diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/javaapparcutil.h --- a/javamanager/javabackup/midp2backup_usif/src.s60/javaapparcutil.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: CJavaApparcUtil definition. -* -*/ - - -#ifndef JAVAAPPARCUTIL_H -#define JAVAAPPARCUTIL_H - -#include - -namespace java -{ -namespace backup -{ -/** - * Common utilities for Apparc registration. - */ -class CJavaApparcUtil : public CBase -{ - -public: - - /** - * Creates a reasonably unique executable name, since the UI Framework - * uses this as a key to look up the application opaque data. - * - * This name is not actually used to run the application, but it must - * look reasonably like an acceptable file name. - * - * @param aAppUid Uid of the application - * @param aAppName On return, it contains an unique executable name. - * Maximum length of this descriptor should be >= 20 or the function - * panics with USER 11. - */ - static void inline AppName(const TUid aAppUid, TDes& aAppName); - -}; - -} //namespace backup -} //namespace java - -#include "javaapparcutil.inl" - -#endif // JAVAAPPARCUTIL_H - -// End of File diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/javaapparcutil.inl --- a/javamanager/javabackup/midp2backup_usif/src.s60/javaapparcutil.inl Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: CJavaApparcUtil inline functions definition -* -*/ - - -using namespace java::backup; - -inline void CJavaApparcUtil::AppName(const TUid aAppUid, TDes& aAppName) -{ - _LIT(KPathSeperator, "\\"); - _LIT(KAppPostfix, ".fakeapp"); - aAppName.Copy(KPathSeperator); - aAppName.AppendNum(aAppUid.iUid); - aAppName.Append(KAppPostfix); -} - diff -r 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.cpp --- a/javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1014 +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: Implementation of CScrBackupUtil -* -*/ - -#include "javascrbackuputil.h" -#include "midp2backupdataids.h" - -#include "logger.h" -#include "javasymbianoslayer.h" // for CleanupResetAndDestroyPushL - -#include -#include -#include //for TApaAppCapability::ENonNative -#include - -using namespace java::backup; -using namespace Usif; - -// 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(KSettingsPlugin, "SettingsName"); -_LIT(KMIDletDeletionConformation, "MIDlet-Delete-Confirm"); - -_LIT(KDomainCategory,"Domain-Category"); - - -CScrBackupUtil* CScrBackupUtil::NewL() - { - LOG(EBackup,EInfo," ---> 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 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.h --- a/javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,266 +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: 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 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.cpp --- a/javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2084 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.h --- a/javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,404 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.cpp --- a/javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.h --- a/javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/midp2backupdataids.h --- a/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupdataids.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.cpp --- a/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,637 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.h --- a/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,412 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.cpp --- a/javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,490 +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: 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 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.h --- a/javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,411 +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: 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 461e71b327da -r 0553e2305d00 javamanager/javabackup/midp2backup_usif/src.s60/proxy.cpp --- a/javamanager/javabackup/midp2backup_usif/src.s60/proxy.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: 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 461e71b327da -r 0553e2305d00 javamanager/javacaptain/bld.inf --- a/javamanager/javacaptain/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/bld.inf Fri Oct 22 14:23:56 2010 +0100 @@ -23,5 +23,4 @@ #include "extensionplugins/javacertstore/build/bld.inf" #include "extensionplugins/storageserver/build/bld.inf" #include "extensionplugins/settingslistener/build/bld.inf" -#include "extensionplugins/preinstallerstarter/build/bld.inf" -#include "extensionplugins/autostarter/build/bld.inf" +#include "extensionplugins/preinstallerstarter/build/bld.inf" diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/build/javacaptain.pro --- a/javamanager/javacaptain/build/javacaptain.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/build/javacaptain.pro Fri Oct 22 14:23:56 2010 +0100 @@ -35,7 +35,7 @@ LIBS += -ljavacomms -ljavaipc -ljavafileutils -ljavastorage symbian { - LIBS += -lefsrv + LIBS += -lefsrv -lAknNotify TARGET.EPOCHEAPSIZE = 0x2800 0x100000 TARGET.EPOCSTACKSIZE = 0x2000 TARGET.UID2 = 0x200211DC diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/build/javacaptain_0x200211DC.mmp --- a/javamanager/javacaptain/build/javacaptain_0x200211DC.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/build/javacaptain_0x200211DC.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -54,6 +54,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../rtcplugins/midp/inc @@ -99,6 +100,7 @@ LIBRARY javafileutils.lib LIBRARY javastorage.lib LIBRARY efsrv.lib +LIBRARY AknNotify.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/autostarter/build/bld.inf --- a/javamanager/javacaptain/extensionplugins/autostarter/build/bld.inf Fri Sep 17 17:50:17 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: Generated bld.inf -file -* -*/ - -PRJ_PLATFORMS -default - -PRJ_MMPFILES -javacaptain_ext_autostarter_0x2002EA7E.mmp diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/autostarter/build/bwins/javacaptain_ext_autostarteru.def --- a/javamanager/javacaptain/extensionplugins/autostarter/build/bwins/javacaptain_ext_autostarteru.def Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?findDllMethod@@YAP6APAXXZPBD@Z @ 1 NONAME ; void * (*)(void) findDllMethod(char const *) - diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/autostarter/build/eabi/javacaptain_ext_autostarteru.def --- a/javamanager/javacaptain/extensionplugins/autostarter/build/eabi/javacaptain_ext_autostarteru.def Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z13findDllMethodPKc @ 1 NONAME - diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter.pro --- a/javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter.pro Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +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: autostarter is plugin for Java Captain that starts auto start -# MIDlets -# - -TEMPLATE=lib -TARGET=javacaptain_ext_autostarter -CONFIG += omj stl -CONFIG -= qt - - -LIBS += -ljavacomms -ljavastorage -lapparc -lapgrfx - -include(../../../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter_0x2002EA7E.mmp --- a/javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter_0x2002EA7E.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +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: Generated file - do not edit manually -* -*/ - -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) -// This file is generated by qmake and should not be modified by the -// user. -// Name : javacaptain_ext_autostarter.mmp -// ============================================================================== - -TARGET javacaptain_ext_autostarter.dll -TARGETTYPE DLL - -UID 0x1000008d 0x2002EA7E -SECUREID 0x2002EA7E - -EPOCALLOWDLLDATA - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO RD_JAVA_SYMBIAN_TARGET -MACRO RD_JAVA_S60_RELEASE_9_2 -MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS -MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS -MACRO RD_JAVA_STDCPPV5 -MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX -MACRO RD_JAVA_HTTP_EMC_ENABLED -MACRO RD_JAVA_NGA_ENABLED -MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED -MACRO RD_JAVA_OPENC_BETA_PATCH -MACRO RD_JAVA_INSTALLERUI_ENABLED -MACRO RD_JAVA_PREWARM -MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK -MACRO RD_JAVA_MIDPRMS_DB -MACRO __SYMBIAN32__ -MACRO J9EPOC32 - -SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../inc -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE ../../../../inc -SYSTEMINCLUDE ../../../../../inc -SYSTEMINCLUDE ../src.s60 -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE . - -SOURCEPATH ../src.s60 -SOURCE autostarter.cpp -SOURCE lookup.cpp - - -LIBRARY javacomms.lib -LIBRARY javastorage.lib -LIBRARY apparc.lib -LIBRARY apgrfx.lib -LIBRARY javautils.lib -LIBRARY libpthread.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib - -CAPABILITY all -tcb - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden -#if defined(ARMCC_4_0) -OPTION ARMCC --import_all_vtbl -#endif -OPTION GCCE -fvisibility-inlines-hidden - -VERSION 10.0 - -ARMFPU softvfp - -PAGED - -BYTEPAIRCOMPRESSTARGET - -USERINCLUDE . - -#include - - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - -deffile ./~/javacaptain_ext_autostarter.def - - SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) - -SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah - -#ifdef WINSCW - -LIBRARY ewsd.lib - -#endif - -STDCPP - -#ifdef WINSCW -DEFFILE ./bwins/javacaptain_ext_autostarter.def -#elif defined EABI -DEFFILE ./eabi/javacaptain_ext_autostarter.def -#endif diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/autostarter/inc/autostarter.h --- a/javamanager/javacaptain/extensionplugins/autostarter/inc/autostarter.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +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: autostarter is Java Captain Symbian plugin that starts -* auto start Java applications after they have been installed -* and when the device boots. -* -*/ - -#ifndef AUTOSTARTER_H -#define AUTOSTARTER_H - -#include "javaosheaders.h" - -#include "eventconsumerinterface.h" -#include "extensionplugininterface.h" - -namespace java -{ - -namespace captain -{ - -class CoreInterface; - -OS_NONSHARABLE_CLASS(AutoStarter) : public EventConsumerInterface, - public ExtensionPluginInterface -{ -public: - AutoStarter(); - virtual ~AutoStarter(); - - // 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: - bool isMIDletPresent(const std::wstring& aUid); - bool startMIDletL(const std::wstring& aUid); - void checkMIDletsToBeStartedL(); - - CoreInterface* mCore; -}; - -} // namespace captain -} // namespace java - -#endif // AUTOSTARTER_H diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/autostarter/src.s60/autostarter.cpp --- a/javamanager/javacaptain/extensionplugins/autostarter/src.s60/autostarter.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,328 +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: autostarter is Java Captain Symbian plugin that starts -* auto start Java applications after they have been installed -* and when the device boots. -* -*/ - -#include // for RApaLsSession -#include -#include -#include -#include -#include -#include - -#include "commsendpoint.h" -#include "coreinterface.h" -#include "javaprocessconstants.h" -#include "javasymbianoslayer.h" -#include "javauid.h" -#include "javauids.h" -#include "logger.h" -#include "preinstallerstartermessages.h" -#include "rtcinterface.h" -#include "rtcmessages.h" - -#include "autostarter.h" - - -using namespace java::storage; -using namespace java::util; - - -/** - * Return pointer to ExtensionPluginInterface implementation for this - * extension dll - */ -java::captain::ExtensionPluginInterface* getExtensionPlugin() -{ - return new java::captain::AutoStarter(); -} - -namespace java // codescanner::namespace -{ -namespace captain // codescanner::namespace -{ - -/** - * Empty contructor - */ -AutoStarter::AutoStarter() : mCore(0) -{ -} - -/** - * Empty destructor - */ -AutoStarter::~AutoStarter() -{ -} - -/** - * Implement PluginInterface method - */ -void AutoStarter::startPlugin(CoreInterface* core) -{ - LOG(EJavaCaptain, EInfo, "AutoStarter plugin started"); - - mCore = core; -} - -/** - * Implement PluginInterface method - */ -void AutoStarter::stopPlugin() -{ - mCore = 0; -} - -/** - * Implement ExtensionPluginInterface method - */ -EventConsumerInterface* AutoStarter::getEventConsumer() -{ - return this; -} - -/** - * Handle Java Captain events sent by Boot event provider or - * preinstaller starter - * - * Implement EventConsumerInterface method - */ -void AutoStarter::event(const std::string& eventProvider, - java::comms::CommsMessage& aMsg) -{ - LOG1(EJavaCaptain, EInfo, "AutoStarter::event received, id %d", aMsg.getMessageId()); - - if (eventProvider == PREINSTALLER_EVENT_PROVIDER) - { - int exitStatus = 0; - getPreinstallerExitedMessageParams(aMsg, exitStatus); - LOG1( - EJavaCaptain, - EInfo, - "AutoStarter::event() preinstaller exited event received (status=%d)", - exitStatus); - - // Start auto-start MIDlets - TRAPD(err, checkMIDletsToBeStartedL()) - if (KErrNone != err) - { - ELOG1(EJavaCaptain, "AutoStarter::checkMIDletsToBeStartedL: leaved (%d)", err); - } - } -} - -/** - * - * - */ -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()); - try - { - js->open(JAVA_DATABASE_NAME); - - // In Java Storage there is 'APPLICATION_TABLE' table that contains - // the Uid of the application in ID column. The value in column AUTORUN is - // one of the following AUTOSTART_FALSE (0), AUTOSTART_TRUE (1) or - // AUTOSTART_ONCE (2) - - JavaStorageEntry attribute; - JavaStorageApplicationEntry_t findPattern; - JavaStorageApplicationList_t foundEntries; - - // Get all IDs from APPLICATION_TABLE where AUTORUN is AUTOSTART_TRUE - attribute.setEntry(AUTORUN, L"1"); - findPattern.insert(attribute); - attribute.setEntry(ID, L""); - findPattern.insert(attribute); - - js->search(APPLICATION_TABLE, findPattern, foundEntries); - findPattern.clear(); - - // Iterate through all found applications - JavaStorageApplicationList_t::const_iterator appIterator; - for (appIterator = foundEntries.begin(); appIterator != foundEntries.end(); ++appIterator) - { - std::wstring applicationId = appIterator->begin()->entryValue(); - - LOG1WSTR(EJavaCaptain, EInfo, - "AutoStarter::checkMIDletsToBeStartedL : going to start MIDlet, uid is %s", - applicationId); - - startMIDletL(applicationId); - } - foundEntries.clear(); - - - // Get all IDs from APPLICATION_TABLE where AUTORUN is AUTOSTART_ONCE - attribute.setEntry(AUTORUN, L"2"); - findPattern.insert(attribute); - attribute.setEntry(ID, L""); - findPattern.insert(attribute); - - js->search(APPLICATION_TABLE, findPattern, foundEntries); - findPattern.clear(); - - // Iterate through all found applications - for (appIterator = foundEntries.begin(); appIterator != foundEntries.end(); ++appIterator) - { - std::wstring applicationId = appIterator->begin()->entryValue(); - - LOG1WSTR(EJavaCaptain, EInfo, - "AutoStarter::checkMIDletsToBeStartedL : going to start MIDlet (once), uid is %s", - applicationId); - - if (startMIDletL(applicationId)) - { - // after starting MIDlet must set AUTORUN value to AUTOSTART_FALSE - JavaStorageApplicationEntry_t matchEntries; - - JavaStorageApplicationEntry_t updateEntries; - JavaStorageEntry attribute; - - attribute.setEntry(ID, applicationId); - matchEntries.insert(attribute); - - attribute.setEntry(AUTORUN, L"0"); - updateEntries.insert(attribute); - - js->update(APPLICATION_TABLE, updateEntries, matchEntries); - } - } - foundEntries.clear(); - } - catch (JavaStorageException& e) - { - ELOG1(EJavaCaptain, - "AutoStarter::checkMIDletsToBeStartedL: Java Storage exception %s", e.what()); - } - - try - { - js->close(); - } - catch (JavaStorageException& e2) - { - WLOG1(EJavaCaptain, - "AutoStarter::checkMIDletsToBeStartedL: Java Storage exception " - "when closing storage %s", e2.what()); - } -} - - -/** - * - * @return true if launch succeeded, false is starting failed - */ -bool AutoStarter::startMIDletL(const std::wstring& aUid) -{ - // 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); - if (!launchSuccess) - { - ELOG(EJavaCaptain, "AutoStarter::startMIDletL: launching MIDlet failed"); - } - - return launchSuccess; -} - - -/** - * 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 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/autostarter/src.s60/lookup.cpp --- a/javamanager/javacaptain/extensionplugins/autostarter/src.s60/lookup.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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) -{ - 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 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/boot/src/booteventprovider.cpp --- a/javamanager/javacaptain/extensionplugins/boot/src/booteventprovider.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/boot/src/booteventprovider.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -17,8 +17,6 @@ #include #include -#include -#include #include #include diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/config/build/javacaptain_ext_config_0x2002DC9E.mmp --- a/javamanager/javacaptain/extensionplugins/config/build/javacaptain_ext_config_0x2002DC9E.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/config/build/javacaptain_ext_config_0x2002DC9E.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp --- a/javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -74,9 +74,6 @@ #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK mCore->loadExtensionPlugin("scrupdater"); #endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - // This plugin implements support for auto-starting - // Java applications - mCore->loadExtensionPlugin("autostarter"); #endif // __SYMBIAN32__ mCore->loadExtensionPlugin("boot"); mCore->loadExtensionPlugin("mmc"); diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore_0x2002DC9F.mmp --- a/javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore_0x2002DC9F.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore_0x2002DC9F.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/javacertstore/inc/javacertstore.h --- a/javamanager/javacaptain/extensionplugins/javacertstore/inc/javacertstore.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/inc/javacertstore.h Fri Oct 22 14:23:56 2010 +0100 @@ -69,6 +69,7 @@ { std::string full_path; std::string hash; + std::string pkey; int state; bool disposable; bool disablable; diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.cpp --- a/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -59,7 +59,7 @@ NextState(Initialize()); break; case EListTokenTypes: - NextState(ListTokenTypesL()); + NextState(ListTokenTypes()); break; case EOpenTokenType: NextState(OpenTokenType()); @@ -132,11 +132,11 @@ return true; } -bool SmartCardCryptoTokenReader::ListTokenTypesL() +bool SmartCardCryptoTokenReader::ListTokenTypes() { TCTTokenTypeAttribute att = { KCTRemovable , 1 }; - iSmartCardTokensAttributes.AppendL(att); - iSmartCardTokensInterfaces.AppendL(TUid::Uid(KInterfaceCertStore)); + iSmartCardTokensAttributes.Append(att); + iSmartCardTokensInterfaces.Append(TUid::Uid(KInterfaceCertStore)); TCTFindTokenTypesByInterfaceAndAttribute findByIAndA( iSmartCardTokensInterfaces.Array(), iSmartCardTokensAttributes.Array()); CCTTokenTypeInfo::ListL(iSmartCardTokenTypes, findByIAndA); diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.h --- a/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.h Fri Oct 22 14:23:56 2010 +0100 @@ -61,7 +61,7 @@ SmartCardCryptoTokenReader(); void ConstructL(); bool Initialize(); - bool ListTokenTypesL(); + bool ListTokenTypes(); bool OpenTokenType(); bool OpenToken(); bool GetTokenInterface(); diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/javacertstore/src/javacertstore.cpp --- a/javamanager/javacaptain/extensionplugins/javacertstore/src/javacertstore.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/src/javacertstore.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -196,7 +196,8 @@ || (queryDisabled && iCertsMetadata[i]->state == STATE_DISABLED) || (queryDeleted && iCertsMetadata[i]->state == STATE_DELETED)) && (hash.compare("") == 0 - || iCertsMetadata[i]->hash.compare(hash) == 0)) + || iCertsMetadata[i]->hash.compare(hash) == 0 + || iCertsMetadata[i]->pkey.find(hash) == 0)) { // what we return back depends on what was queried switch (query) @@ -211,7 +212,14 @@ if (replyWithContent(replyMsg, *iCertsMetadata[i])) { // add also the ID and the state - replyMsg << iCertsMetadata[i]->hash; + if (iCertsMetadata[i]->pkey.size() > 0) + { + replyMsg << iCertsMetadata[i]->pkey; + } + else + { + replyMsg << iCertsMetadata[i]->hash; + } replyMsg << encodeState(iCertsMetadata[i]->disposable, iCertsMetadata[i]->disablable, iCertsMetadata[i]->state); @@ -366,6 +374,7 @@ const int READ_HASH = 4; const int READ_REMOVABLE = 5; const int READ_DISABLABLE = 6; + const int READ_PKEY = 7; // domain_name_info int domain_name_index = 0; @@ -383,6 +392,10 @@ bool removable = false; bool disablable = false; + // pkey info + int pkey_index = 0; + char pkey[50]; + // start&end separators for the metadata's keys bool key_ss = true; bool key_es = false; @@ -417,6 +430,10 @@ op = READ_DISABLABLE; key_ss = false; break; + case 'p': + op = READ_PKEY; + key_ss = false; + break; } } else @@ -462,6 +479,11 @@ disablable = true; } break; + case READ_PKEY: + pkey[pkey_index] = (char)retval; + pkey_index++; + pkey[pkey_index] = '\0'; + break; } } } @@ -470,6 +492,11 @@ && domain_category_index > 0 && hash_index > 0) { + if (pkey_index > 0) + { + metadata->pkey = string(pkey, pkey_index); + transform(metadata->pkey.begin(), metadata->pkey.end(), metadata->pkey.begin(), (int(*)(int)) tolower); + } metadata->prot_domain_name = string(domain_name, domain_name_index); metadata->prot_domain_category = string(domain_category, domain_category_index); metadata->hash = string(hash, hash_index); @@ -552,7 +579,8 @@ // go through the certidicates and find the right one for (int i=0; ihash) == 0) + if (cert_id.compare(iCertsMetadata[i]->hash) == 0 || + iCertsMetadata[i]->pkey.find(cert_id) == 0) { switch (state) { @@ -784,7 +812,8 @@ bool found = false; for (int i=0; ihash.compare(metadata->hash) == 0) + if (iCertsMetadata[i]->hash.compare(metadata->hash) == 0 + && iCertsMetadata[i]->pkey.find(metadata->pkey) == 0) { if (overwrite) { diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/javasmartcardcertsunittests.mmp --- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/javasmartcardcertsunittests.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/javasmartcardcertsunittests.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -14,8 +14,9 @@ * Description: * */ - +// #include #include +//#include #include #include <../../../../../../inc/java_stdcpp_support_for_exe.hrh> diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp --- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -29,6 +29,9 @@ CAPABILITY CAP_ECOM_PLUGIN VENDORID VID_DEFAULT +systeminclude /epoc32/include +systeminclude /epoc32/include/ecom + sourcepath ../src source testsmartcardtokenplugin.cpp diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/src/101F5B72.rss --- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/src/101F5B72.rss Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/src/101F5B72.rss Fri Oct 22 14:23:56 2010 +0100 @@ -14,7 +14,7 @@ * Description: * */ -#include +#include #include // True diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/preinstallerstarter/build/bld.inf --- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/bld.inf Fri Oct 22 14:23:56 2010 +0100 @@ -20,4 +20,3 @@ PRJ_MMPFILES javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp -#include "exports.inf" diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/preinstallerstarter/build/exports.inf --- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/exports.inf Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +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: -* -*/ - -PRJ_EXPORTS -../inc/preinstallerstartermessages.h |../../../../../inc/preinstallerstartermessages.h diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp --- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstarter.h --- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstarter.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstarter.h Fri Oct 22 14:23:56 2010 +0100 @@ -33,8 +33,7 @@ class CoreInterface; -OS_NONSHARABLE_CLASS(PreinstallerStarter) : public CActive, - public EventConsumerInterface, +OS_NONSHARABLE_CLASS(PreinstallerStarter) : public EventConsumerInterface, public ExtensionPluginInterface { public: @@ -52,19 +51,11 @@ // ExtensionPluginInterface methods virtual EventConsumerInterface* getEventConsumer(); -protected: - // CActive - virtual void RunL(); - virtual void DoCancel(); - private: void startPreinstaller(TBool aIadBoot); -#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK void registerMidletApplicationTypeHandler(); -#endif CoreInterface* mCore; - RProcess* mPreinstaller; }; } // namespace captain diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstartermessages.h --- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstartermessages.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +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: PreinstallerStarterMessages -* -*/ - -#ifndef PREINSTALLERSTARTERMESSAGES_H -#define PREINSTALLERSTARTERMESSAGES_H - -#include "logger.h" -#include "commsmessage.h" - -namespace java -{ -namespace captain -{ - -using namespace java::util; -using namespace java::comms; - -// This event is sent when preinstaller process has exited -const int PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C = 30; - -const char PREINSTALLER_EVENT_PROVIDER[] = "preinstaller"; - - -inline void setPreinstallerExitedMessageParams(CommsMessage& aMessage, const int& aExitStatus) -{ - aMessage.setMessageId(PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C); - aMessage << aExitStatus; -} - -inline void getPreinstallerExitedMessageParams(CommsMessage& aMessage, int& aExitStatus) -{ - if (aMessage.getMessageId() == PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C) - { - aMessage >> aExitStatus; - } - else - { - ELOG2(EJavaCaptain, "wrong MessageId!: %d should be %d", - aMessage.getMessageId(), PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C); - aExitStatus = 0; - } -} - - -} // namespace captain -} // namespace java - -#endif // PREINSTALLERSTARTERMESSAGES_H diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/preinstallerstarter/src.s60/preinstallerstarter.cpp --- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/src.s60/preinstallerstarter.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/src.s60/preinstallerstarter.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 - 2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -19,9 +19,7 @@ #include -#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK #include // for RApaLsSession -#endif #include #include #include @@ -33,7 +31,6 @@ #include "coreinterface.h" #include "booteventprovidermessages.h" #include "mmceventprovidermessages.h" -#include "preinstallerstartermessages.h" #include "preinstallerstarter.h" @@ -55,19 +52,19 @@ using java::fileutils::DriveListenerInterface; /** - * Initialize member varaibles in constructor + * Empty contructor */ -PreinstallerStarter::PreinstallerStarter() : - CActive(EPriorityStandard), mCore(0), mPreinstaller(0) +PreinstallerStarter::PreinstallerStarter() : mCore(0) { + JELOG2(EJavaCaptain); } /** - * Destructor + * Empty destructor */ PreinstallerStarter::~PreinstallerStarter() { - DoCancel(); + JELOG2(EJavaCaptain); } /** @@ -75,8 +72,8 @@ */ void PreinstallerStarter::startPlugin(CoreInterface* core) { + JELOG2(EJavaCaptain); mCore = core; - CActiveScheduler::Add(this); } /** @@ -84,6 +81,7 @@ */ void PreinstallerStarter::stopPlugin() { + JELOG2(EJavaCaptain); mCore = 0; } @@ -92,6 +90,7 @@ */ EventConsumerInterface* PreinstallerStarter::getEventConsumer() { + JELOG2(EJavaCaptain); return this; } @@ -107,6 +106,7 @@ void PreinstallerStarter::event(const std::string& eventProvider, java::comms::CommsMessage& aMsg) { + JELOG2(EJavaCaptain); if (eventProvider == BOOT_EVENT_PROVIDER) { int bootType = NORMAL_BOOT_C; @@ -133,9 +133,7 @@ case FIRST_DEVICE_BOOT_C: case NORMAL_BOOT_C: { -#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK registerMidletApplicationTypeHandler(); -#endif // Start preinstaller normally (without 'iad' option). startPreinstaller(EFalse); @@ -185,6 +183,8 @@ */ void PreinstallerStarter::startPreinstaller(TBool aIadBoot) { + JELOG2(EJavaCaptain); + // Check that the device has enough free memory (800kB) to start preinstaller process // and (if needed) also java installer TInt freeMemory = 0; @@ -276,21 +276,17 @@ } // start preinstaller - mPreinstaller = new RProcess(); + RProcess preinstaller; TBuf<64> preinstallerProcess; // Actual len of the process name is 9 len = strlen(java::runtime::JAVA_PROCESS); TPtr8 ptr8Process((TUint8 *)java::runtime::JAVA_PROCESS, len, len); preinstallerProcess.Copy(ptr8Process); - TInt err = mPreinstaller->Create(preinstallerProcess, commandLine); + TInt err = preinstaller.Create(preinstallerProcess, commandLine); if (KErrNone == err) { - // Process has been created. - - // This active object will be activated when preinstaller process exits - mPreinstaller->Logon(iStatus); - - // Allow the process to run - mPreinstaller->Resume(); + // process has been created, allow it to run + preinstaller.Resume(); + preinstaller.Close(); if (aIadBoot) { LOG( @@ -302,14 +298,9 @@ { LOG(EJavaCaptain, EInfo, "PreinstallerStarter: started preinstaller"); } - - SetActive(); } else { - delete mPreinstaller; - mPreinstaller = 0; - ELOG1( EJavaCaptain, "PreinstallerStarter: starting preinstaller failed, err %d", @@ -322,7 +313,6 @@ * Register 'javalauncher.exe' as the midlet application type handler * in AppArc. If necessary unregister old handler first. */ -#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK void PreinstallerStarter::registerMidletApplicationTypeHandler() { _LIT(KMidpAppArcPlugin, "javalauncher.exe"); @@ -384,37 +374,6 @@ err); } } -#endif - -void PreinstallerStarter::RunL() -{ - LOG(EJavaCaptain, EInfo, "PreinstallerStarter::RunL started"); - - // Send event to AutoStarter plugin, done only once - CommsMessage eventMsg; - setPreinstallerExitedMessageParams(eventMsg, iStatus.Int()); - mCore->getEventDispatcher()->event(PREINSTALLER_EVENT_PROVIDER, eventMsg); - - // process handle is no longer needed - mPreinstaller->Close(); - delete mPreinstaller; - mPreinstaller = 0; -} - - -void PreinstallerStarter::DoCancel() -{ - if (mPreinstaller) - { - mPreinstaller->LogonCancel(iStatus); - // Because exit notification request has been canceled, - // there is no reason to keep the process handle open. - mPreinstaller->Close(); - delete mPreinstaller; - mPreinstaller = 0; - } -} - } // namespace captain } // namespace java diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/scrupdater/inc/scrupdater.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/scrupdater/inc/scrupdater.h Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,71 @@ +/* +* 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 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/scrupdater/src.s60/lookup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/scrupdater/src.s60/lookup.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,46 @@ +/* +* 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 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/scrupdater/src.s60/scrupdater.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/scrupdater/src.s60/scrupdater.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,705 @@ +/* +* 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 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/scrupdater/src/lookup.cpp --- a/javamanager/javacaptain/extensionplugins/scrupdater/src/lookup.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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) -{ - 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 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.cpp --- a/javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,666 +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" - -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 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.h --- a/javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +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 // 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 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener_0x200315D8.mmp --- a/javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener_0x200315D8.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener_0x200315D8.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin_0x2002DCA3.mmp --- a/javamanager/javacaptain/extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin_0x2002DCA3.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin_0x2002DCA3.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../src diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/inc.s60/pmc.h --- a/javamanager/javacaptain/inc.s60/pmc.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/inc.s60/pmc.h Fri Oct 22 14:23:56 2010 +0100 @@ -23,6 +23,9 @@ #include +#include + + #include "javaoslayer.h" #include "logger.h" #include "scopedlocks.h" @@ -140,6 +143,13 @@ void showErrorNote() { LOG(EJavaCaptain, EInfo, "Process failed to exit gracefully"); +#ifdef RD_JAVA_EXIT_ERROR_DIALOG + //Print the dialog showing that force process kill was done. + CAknGlobalNote* globalNote = CAknGlobalNote::NewL(); + globalNote->ShowNoteL(EAknGlobalErrorNote, + _L("Midp process failed to exit gracefully.")); + delete globalNote; +#endif } private: diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/javacaptain.pro --- a/javamanager/javacaptain/javacaptain.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/javacaptain.pro Fri Oct 22 14:23:56 2010 +0100 @@ -20,5 +20,4 @@ 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 BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/subsystem.mk --- a/javamanager/javacaptain/subsystem.mk Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/subsystem.mk Fri Oct 22 14:23:56 2010 +0100 @@ -36,7 +36,6 @@ endif COMPONENTS += extensionplugins/preinstallerstarter/build -COMPONENTS += extensionplugins/autostarter/build ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK COMPONENTS += extensionplugins/scrupdater/build endif diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/systemams/build/systemams.mmp --- a/javamanager/javacaptain/systemams/build/systemams.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/systemams/build/systemams.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -21,9 +21,6 @@ #include <../../../../inc/project_defines.hrh> #include <../../../../inc/java_stdcpp_support_for_exe.hrh> -epocheapsize 0x00001000 0x02000000 -epocstacksize 16384 - target SystemAMS.exe TARGETTYPE EXE diff -r 461e71b327da -r 0553e2305d00 javamanager/javacaptain/systemams/src/certificatesmanager.cpp --- a/javamanager/javacaptain/systemams/src/certificatesmanager.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javacaptain/systemams/src/certificatesmanager.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -231,7 +231,7 @@ LazyInit(); iCurrentCertInfo = getTrustRootL(aId); RArray applications; - applications.AppendL(KMidletInstallApplicabilityUid); + applications.Append(KMidletInstallApplicabilityUid); iCertStore->SetApplicability(*iCurrentCertInfo, applications, iStatus); User::WaitForRequest(iStatus); if (iStatus.Int() == KErrNone) diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp --- a/javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,8 @@ USERINCLUDE ../inc USERINCLUDE ../../../../inc +SYSTEMINCLUDE ../../../../inc + // Libraries LIBRARY charconv.lib LIBRARY cone.lib diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/appinstuiplugin/data/101F875F.rss diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/appinstuiplugin/src/javainstalllauncher.cpp --- a/javamanager/javainstaller/appinstuiplugin/src/javainstalllauncher.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/appinstuiplugin/src/javainstalllauncher.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -26,7 +26,7 @@ #include #include -#include +#include #include @@ -228,7 +228,7 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - iHandlesToClose.AppendL(rJavaInstaller); + iHandlesToClose.Append(rJavaInstaller); } void CJavaInstallLauncher::SilentInstallL(RFile& aFile, @@ -410,7 +410,7 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - iHandlesToClose.AppendL(rJavaInstaller); + iHandlesToClose.Append(rJavaInstaller); } void CJavaInstallLauncher::UninstallL(const TUid& aUid, const TDesC8&, /*aMIME*/ @@ -451,7 +451,7 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - iHandlesToClose.AppendL(rJavaInstaller); + iHandlesToClose.Append(rJavaInstaller); } void CJavaInstallLauncher::SilentUninstallL(const TUid& aUid, const TDesC8&, /*aMIME*/ @@ -539,7 +539,7 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - iHandlesToClose.AppendL(rJavaInstaller); + iHandlesToClose.Append(rJavaInstaller); } TBool CJavaInstallLauncher::IsAppShellUpdate() @@ -619,7 +619,7 @@ // Open UI env and resource file. if (!iEik) { - iEik = CEikonEnv::Static(); // codescanner::eikonenvstatic + iEik = CEikonEnv::Static(); } if (!iEik) { diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/iconsizenotifplugin/build/javaiconsizenotifplugin.mmp diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/iconsizenotifplugin/data/javaiconsizenotifplugin.rss diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installcopier/build/javainstallcopier.pro --- a/javamanager/javainstaller/installcopier/build/javainstallcopier.pro Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +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: -# - -TEMPLATE=app -TARGET=javainstallcopier -CONFIG += omj no_icon stl -CONFIG -= qt - -symbian { - TARGET.UID2 = 0x20031612 - TARGET.UID3 = 0x20031612 - - TARGET.CAPABILITY = AllFiles - - LIBS += -lefsrv -lcharconv -} - -include(../../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installcopier/src/javainstallcopier.cpp --- a/javamanager/javainstaller/installcopier/src/javainstallcopier.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,153 +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: -* -* JavaInstallCopier.exe is a utility for copying Java installation -* files from other processes private data cages to JavaInstaller's -* private data cage. JavaSifPlugin calls JavaInstallCopier if -* installation is started from a file which resides in a private -* data cage which JavaInstaller cannot access. -* -*/ - - -#ifdef __SYMBIAN32__ -#include -#include -#endif // __SYMBIAN32__ - -#include "exceptionbase.h" -#include "javaoslayer.h" -#include "logger.h" -#include "runtimeexception.h" - -using namespace java::runtime; -using namespace java::util; - -int isCopyAllowed() -{ - int result = 0; -#ifdef __SYMBIAN32__ - // Only SifServer (0x10285BCB) is allowed to launch JavaInstallCopier. - TSecureId creatorSecId(User::CreatorSecureId()); - if (0x10285BCB != creatorSecId.iId) - { - ELOG1(EJavaInstaller, - "INSTALLCOPIER: Process 0x%x is not allowed to " - "launch JavaInstallCopier", creatorSecId.iId); - result = KErrPermissionDenied; - } -#endif // __SYMBIAN32__ - return result; -} - -int copyToInstallerDir(int argc, char *argv[]) -{ - int result = 0; - -#ifdef __SYMBIAN32__ - RFs rfs; - result = rfs.Connect(); - if (KErrNone != result) - { - ELOG1(EJavaInstaller, - "INSTALLCOPIER: Connecting to RFs failed, err=%d", result); - return result; - } - - CFileMan* fm = NULL; - TRAP(result, fm = CFileMan::NewL(rfs)); - if (KErrNone != result) - { - ELOG1(EJavaInstaller, - "INSTALLCOPIER: Creating CFileMan failed, err=%d", result); - return result; - } - - _LIT(KJavaInstallerTmp, "\\private\\102033E6\\installer\\tmp\\"); - for (int i = 1; i < argc && KErrNone == result; i++) - { - TPtrC8 srcPtr((const TText8*)argv[i]); - TFileName srcPath; - CnvUtfConverter::ConvertToUnicodeFromUtf8(srcPath, srcPtr); - // Get the drive from the srcPath... - TParse fp; - rfs.Parse(srcPath, fp); - // ...and prefix it to KJavaInstallerTmp path. - TFileName dstPath = fp.Drive(); - dstPath.Append(KJavaInstallerTmp); - - result = fm->Copy(srcPath, dstPath, CFileMan::ERecurse|CFileMan::EOverWrite); - - std::wstring srcWs((wchar_t*)srcPath.Ptr(), srcPath.Length()); - std::wstring dstWs((wchar_t*)dstPath.Ptr(), dstPath.Length()); - if (KErrNone == result) - { - ILOG2(EJavaInstaller, "INSTALLCOPIER: Copied %S to %S", - srcWs.c_str(), dstWs.c_str()); - } - else - { - ELOG3(EJavaInstaller, - "INSTALLCOPIER: Copying %S to %S failed, err=%d", - srcWs.c_str(), dstWs.c_str(), result); - } - } - - delete fm; - fm = NULL; - rfs.Close(); -#else // __SYMBIAN32__ - for (int i = 1; i < argc && result == 0; i++) - { - WLOG1(EJavaInstaller, "INSTALLCOPIER: Ignored %s", argv[i]); - } -#endif // __SYMBIAN32__ - - return result; -} - -int main(int argc, char *argv[]) -{ - //ILOG(EJavaInstaller, "INSTALLCOPIER main()"); - JavaOsLayer::startUpTrace("INSTALLCOPIER main() start", -1, -1); - - int result = 0; - try - { - result = isCopyAllowed(); - if (0 == result) - { - result = copyToInstallerDir(argc, argv); - } - } - catch (RuntimeException& e) - { - ELOG1(EJavaInstaller, "INSTALLCOPIER main() RuntimeException caught: %s", - e.toString().c_str()); - } - catch (ExceptionBase& e) - { - ELOG1(EJavaInstaller, "INSTALLCOPIER main() ExceptionBase caught: %s", - e.toString().c_str()); - } - catch (std::exception& e) - { - ELOG1(EJavaInstaller, "INSTALLCOPIER main() Exception %s caught", e.what()); - } - - //ILOG1(EJavaInstaller, "INSTALLCOPIER main() exit %d", result); - JavaOsLayer::startUpTrace("INSTALLCOPIER main() end", -1, -1); - return result; -} diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/build/build.xml --- a/javamanager/javainstaller/installer/build/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/build/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -74,7 +74,6 @@ value="com.nokia.mj.impl.installer.utils.SysUtil, com.nokia.mj.impl.installer.utils.FileRoots, com.nokia.mj.impl.installer.utils.FileWriter, - com.nokia.mj.impl.installer.utils.PropertyProvider, com.nokia.mj.impl.installer.jadjarmatcher.JadJarMatcher, com.nokia.mj.impl.installer.applicationregistrator.ApplicationRegistrator, com.nokia.mj.impl.installer.applicationregistrator.SifNotifier, diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/build/exports.inf --- a/javamanager/javainstaller/installer/build/exports.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/build/exports.inf Fri Oct 22 14:23:56 2010 +0100 @@ -27,12 +27,11 @@ ../data/inst_plugins.cfg /epoc32/data/z/private/102033E6/installer/inst_plugins.cfg -// Configuration interface for javainstaller +// Generic configuration interface for javainstaller cenrep settings +// javainstaller_102824CE implementation specifics for cenrep data #ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS -// Public configuration interface is named as CI_javainstaller.confml -// and it is located outside of jrt package. The name of private -// configuration interface is javainstaller2.confml. ../conf/javainstaller2.confml APP_LAYER_CONFML(javainstaller.confml) +../conf/CI_javainstaller.confml APP_LAYER_CONFML(CI_javainstaller.confml) #else ../conf/javainstaller.confml APP_LAYER_CONFML(javainstaller.confml) #endif /* RD_JAVA_S60_RELEASE_10_1_ONWARDS */ diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/build/javainstaller.pro --- a/javamanager/javainstaller/installer/build/javainstaller.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/build/javainstaller.pro Fri Oct 22 14:23:56 2010 +0100 @@ -49,8 +49,6 @@ ../src.s60/jadjarmatcher/jadjarmatcherscanfrominbox.cpp \ ../src.s60/utils/filewriter.cpp \ ../src.s60/utils/fileroots.cpp \ - ../src.s60/utils/propertylistener.cpp \ - ../src.s60/utils/propertyprovider.cpp \ ../src.s60/utils/sysutil.cpp LIBS += -lapgrfx -lbafl -lcentralrepository -lcharconv -lefsrv -lestor \ @@ -63,17 +61,17 @@ } contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) { - CONFIG += hb - LIBS += -lsifnotification -lxqservice + LIBS += -lQtServiceFramework + } + + contains(PROJECT_DEFINES,RD_JAVA_USIF_NOTIFY_PROGRESS) { + LIBS += -lsifnotification } MMP_RULES += \ "$${LITERAL_HASH}include " \ "$${LITERAL_HASH}ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK" \ "LIBRARY scrclient.lib" \ - "$${LITERAL_HASH}else" \ - "LIBRARY ecom.lib" \ - "LIBRARY SWInstTaskManager.lib" \ "$${LITERAL_HASH}endif" } else { CONFIG += omj java javaonly stl diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/build/javainstaller_0x2002DCB4.mmp --- a/javamanager/javainstaller/installer/build/javainstaller_0x2002DCB4.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/build/javainstaller_0x2002DCB4.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../src.s60/applicationregistrator @@ -81,8 +82,6 @@ SOURCEPATH ../src.s60/utils SOURCE filewriter.cpp SOURCE fileroots.cpp -SOURCE propertylistener.cpp -SOURCE propertyprovider.cpp SOURCE sysutil.cpp @@ -144,12 +143,6 @@ LIBRARY scrclient.lib -#else - -LIBRARY ecom.lib - -LIBRARY SWInstTaskManager.lib - #endif #include diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/conf/CI_javainstaller.confml Binary file javamanager/javainstaller/installer/conf/CI_javainstaller.confml has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistrator.java --- a/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistrator.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistrator.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -18,7 +18,6 @@ package com.nokia.mj.impl.installer.applicationregistrator; -import com.nokia.mj.impl.installer.storagehandler.SuiteInfo; import com.nokia.mj.impl.installer.utils.InstallerException; import com.nokia.mj.impl.installer.utils.FileRoots; import com.nokia.mj.impl.installer.utils.FileUtils; @@ -356,8 +355,6 @@ String aJarFilename, StringBuffer aIconSuffix) { - Log.log("ApplicationRegistrator.convertIcon: " + aInputIconFilename + - " --> " + aOutputIconFilename + ", from jar " + aJarFilename); return _convertIcon(aInputIconFilename, aOutputIconFilename, aJarFilename, aIconSuffix); } @@ -440,50 +437,8 @@ return; } - /** - * Adds an entry to platform installation log. - * - * @param aSuite application suite information - * @param aAction 0 - installation, 1 - uninstallation - */ - public static void addInstallLogEntry(SuiteInfo aSuite, int aAction) - { - // In S60 the version number is restricted to limited range. - // If version number is outside of this range, use version - // number 0 instead. - int result = _addInstallLogEntry( - aAction, PlatformUid.getIntValue(aSuite.getUid()), - aSuite.getName(), aSuite.getVendor(), - getVersion(aSuite.getVersion().getMajor(), 0, 127), - getVersion(aSuite.getVersion().getMinor(), 0, 99), - getVersion(aSuite.getVersion().getMicro(), 0, 32767)); - if (result < 0) - { - Log.logError("Adding installation log entry failed, err=" + result); - } - else - { - Log.log("Added installation log entry"); - } - } - /*** ----------------------------- PACKAGE ---------------------------- */ /*** ----------------------------- PRIVATE ---------------------------- */ - - /** - * Checks that given version number is between specified minimum and - * maximum value range (inclusive) and if it is returns version number. - * If version number is out of given range, returns 0. - */ - private static int getVersion(int aVersion, int aMin, int aMax) - { - if (aVersion >= aMin && aVersion <= aMax) - { - return aVersion; - } - return 0; - } - /*** ----------------------------- NATIVE ----------------------------- */ /** @@ -624,20 +579,4 @@ * @return true if Symbian 9.2 emulator environment */ private static native boolean _runningIn92Emulator(); - - /** - * Adds an entry to platform installation log. - * - * @param aAction 0 - installation, 1 - uninstallation - * @param aUid application suite uid - * @param aName application suite name - * @param aVendor application suite vendor - * @param aMajorVersion application suite major version - * @param aMinorVersion application suite minor version - * @param aMicroVersion application suite micro version - * @return Symbian error code (negative number) if fails, otherwise 0 - */ - private static native int _addInstallLogEntry( - int aAction, int aUid, String aName, String aVendor, - int aMajorVersion, int aMinorVersion, int aMicroVersion); } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifNotifier.java Fri Oct 22 14:23:56 2010 +0100 @@ -41,8 +41,6 @@ public static final int SUB_OP_OCSP = 2; /** Download phase during installation. */ public static final int SUB_OP_DOWNLOAD = 3; - /** Maximum progress notification value. */ - private static final int MAX_PROGRESS = 100; /** Operation being notified. */ private int iOperation = 0; @@ -64,8 +62,6 @@ /** Sending progress notifications is only allowed between start * and end notifications. */ private boolean iNotifyProgressAllowed = false; - /** Value of the last progress notification that has been sent. */ - private int iLastProgressSent = 0; /** Native object handle. */ private int iHandle = 0; @@ -107,22 +103,22 @@ iIconDir = aIconDir; iComponentIcon = aComponentIcon; - checkHandle(); + if (iHandle == 0) + { + InstallerException.internalError( + "SifNotifier.notifyStart: notifier has not been initialized"); + } int ret = _notifyStart( iHandle, aGlobalComponentId, aComponentName, aApplicationNames, aApplicationIcons, aComponentSize, aIconDir, aComponentIcon); if (ret < 0) { - Log.log("Notifying SIF start failed with code " + ret + - ", " + getInfoString()); + Log.logError("Notifying SIF start failed with code " + ret + + ", " + getInfoString()); InstallerException.internalError( "Notifying SIF start failed with code " + ret); } - else - { - Log.log("SifNotifier.notifyStart: " + getInfoString()); - } iNotifyProgressAllowed = true; } @@ -134,35 +130,26 @@ public void notifyEnd( int aErrCategory, int aErrCode, String aErrMsg, String aErrMsgDetails) { - checkHandle(); - if (aErrCategory == 0 && iLastProgressSent < MAX_PROGRESS) + if (iHandle == 0) { - // Before sending end notification, update progress to max if - // operation was successful and max progress notification has - // not yet been sent. - notifyProgress(SUB_OP_NO, MAX_PROGRESS, MAX_PROGRESS); + InstallerException.internalError( + "SifNotifier.notifyEnd: notifier has not been initialized"); } - // No more progress notifications allowed. iNotifyProgressAllowed = false; int ret = _notifyEnd( iHandle, iGlobalComponentId, aErrCategory, aErrCode, aErrMsg, aErrMsgDetails); - String logMsg = - "ErrCategory: " + aErrCategory + - ", ErrCode: " + aErrCode + - ", ErrMsg: " + aErrMsg + - ", ErrMsgDetails: " + aErrMsgDetails; if (ret < 0) { - Log.log("Notifying SIF end failed with code " + ret + - ", " + getInfoString() + ", " + logMsg); + Log.logError("Notifying SIF end failed with code " + ret + + ", " + getInfoString() + + ", ErrCategory: " + aErrCategory + + ", ErrCode: " + aErrCode + + ", ErrMsg: " + aErrMsg + + ", ErrMsgDetails: " + aErrMsgDetails); InstallerException.internalError( "Notifying SIF end failed with code " + ret); } - else - { - Log.log("SifNotifier.notifyEnd: " + logMsg); - } } /** @@ -176,29 +163,24 @@ { return; } - checkHandle(); - if (aSubOperation == SUB_OP_NO) + if (iHandle == 0) { - iLastProgressSent = aCurrent; + InstallerException.internalError( + "SifNotifier.notifyProgress: notifier has not been initialized"); } int ret = _notifyProgress( iHandle, iGlobalComponentId, iOperation, aSubOperation, aCurrent, aTotal); - String logMsg = - "SubOp: " + aSubOperation + - ", Current: " + aCurrent + - ", Total: " + aTotal; if (ret < 0) { - Log.log("Notifying SIF progress failed with code " + ret + - ", " + getInfoString() + ", " + logMsg); + Log.logError("Notifying SIF progress failed with code " + ret + + ", " + getInfoString() + + ", SubOp: " + aSubOperation + + ", Current: " + aCurrent + + ", Total: " + aTotal); InstallerException.internalError( "Notifying SIF progress failed with code " + ret); } - else - { - Log.log("SifNotifier.notifyProgress: " + logMsg); - } } /** @@ -209,17 +191,17 @@ */ public void destroy() { - checkHandle(); + if (iHandle == 0) + { + InstallerException.internalError( + "SifNotifier.destroy: notifier has not been initialized"); + } int ret = _destroy(iHandle); if (ret < 0) { InstallerException.internalError( "Destroying SIF notifier failed with code " + ret); } - else - { - Log.log("SifNotifier destroyed"); - } iHandle = 0; } @@ -239,29 +221,12 @@ InstallerException.internalError( "Initializing SifNotifier failed with code " + ret); } - else - { - Log.log("SifNotifier created"); - } iHandle = ret; } /*** ----------------------------- 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() @@ -270,31 +235,11 @@ buf.append("Operation: ").append(iOperation); buf.append(", GlobalComponentId: ").append(iGlobalComponentId); buf.append(", ComponentName: ").append(iComponentName); - if (iApplicationNames != null) + for (int i = 0; i < iApplicationNames.length; i++) { - for (int i = 0; i < iApplicationNames.length; i++) - { - buf.append(", ApplicationName[").append(i).append("]: ") - .append(iApplicationNames[i]); - } - } - if (iApplicationIcons != null) - { - for (int i = 0; i < iApplicationIcons.length; i++) - { - buf.append(", ApplicationIcon[").append(i).append("]: ") - .append(iApplicationIcons[i]); - } + buf.append(", ApplicationName: ").append(iApplicationNames[i]); } buf.append(", ComponentSize: ").append(iComponentSize); - if (iIconDir != null) - { - buf.append(", IconDir: ").append(iIconDir); - } - if (iComponentIcon != null) - { - buf.append(", ComponentIcon: ").append(iComponentIcon); - } return buf.toString(); } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifRegistrator.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009-2010 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" @@ -25,6 +25,7 @@ import com.nokia.mj.impl.installer.utils.FileUtils; import com.nokia.mj.impl.installer.utils.Log; import com.nokia.mj.impl.installer.utils.PlatformUid; +import com.nokia.mj.impl.rt.installer.ApplicationInfoImpl; import com.nokia.mj.impl.utils.Attribute; import com.nokia.mj.impl.utils.Uid; @@ -60,14 +61,6 @@ } /** - * 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. @@ -136,6 +129,27 @@ } /** + * Registers or unregisters Java software type to software + * installation framework. + * + * @param aRegister true for registration, false for unregistration + */ + public static void registerJavaSoftwareType(boolean aRegister) + { + String op = (aRegister? "Register": "Unregister"); + int err = _registerJavaSoftwareType(aRegister); + if (err < 0) + { + InstallerException.internalError( + op + " Java software type failed with code " + err); + } + else + { + Log.log("SifRegistrator " + op + "ed Java software type"); + } + } + + /** * Starts application registration session. * The registrations and unregistrations are done only * when commitSession is called. @@ -165,7 +179,7 @@ if (ret < 0) { InstallerException.internalError( - "Creating SIF session failed with code " + ret); + "Creating session failed with code " + ret); } //Log.log("SifRegistrator session started"); iSessionHandle = ret; @@ -184,18 +198,36 @@ */ public void registerSuite(SuiteInfo aSuiteInfo, boolean aIsUpdate) { - checkSession(); + if (0 == iSessionHandle) + { + InstallerException.internalError("No valid SIF session."); + } Log.log("SifRegistrator registering application suite " + aSuiteInfo.getGlobalId()); - // 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++) + if (_getUsifMode() > 0) { - registerApplication(aSuiteInfo, 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); + } } registerLocalizedProperties(aSuiteInfo); } @@ -211,12 +243,29 @@ */ public void unregisterSuite(SuiteInfo aSuiteInfo) { - checkSession(); + if (0 == iSessionHandle) + { + InstallerException.internalError("No valid SIF session."); + } Log.log("SifRegistrator unregistering application suite " + aSuiteInfo.getGlobalId()); - // Unregister suite as a component. - unregisterComponent(aSuiteInfo); + 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); + } + } } /** @@ -229,11 +278,15 @@ */ public void commitSession() { - checkSession(); + if (0 == iSessionHandle) + { + InstallerException.internalError("No valid SIF session."); + } + int err = _commitSession(iSessionHandle); if (err < 0) { - InstallerException.internalError("Commiting SIF session failed with code " + err); + InstallerException.internalError("Commiting session failed with code " + err); } // Current session has been closed iSessionHandle = 0; @@ -248,13 +301,17 @@ */ public void rollbackSession() { - checkSession(); + if (0 == iSessionHandle) + { + InstallerException.internalError("No valid SIF session."); + } + int err = _rollbackSession(iSessionHandle); // Session is closed always when rollback is called iSessionHandle = 0; if (err < 0) { - InstallerException.internalError("Rolling back SIF session failed with code " + err); + InstallerException.internalError("Rolling back the session failed with code " + err); } //Log.log("SifRegistrator session rolled back"); } @@ -270,6 +327,7 @@ { return; } + _closeSession(iSessionHandle); // Current session has been closed iSessionHandle = 0; @@ -286,7 +344,11 @@ */ public ComponentId getComponentId(String aGlobalId) { - checkSession(); + if (0 == iSessionHandle) + { + InstallerException.internalError("No valid SIF session."); + } + ComponentId result = new ComponentId(); int ret = _getComponentId(iSessionHandle, aGlobalId, result); if (-1 == ret) @@ -314,7 +376,11 @@ */ public ComponentId getComponentId(Uid aAppUid) { - checkSession(); + if (0 == iSessionHandle) + { + InstallerException.internalError("No valid SIF session."); + } + ComponentId result = new ComponentId(); int ret = _getComponentIdForApp( iSessionHandle, ((PlatformUid)aAppUid).getIntValue(), result); @@ -340,12 +406,15 @@ */ public void logComponent(String aGlobalId) { - checkSession(); + if (0 == iSessionHandle) + { + InstallerException.internalError("No valid SIF session."); + } + int ret = _logComponent(iSessionHandle, aGlobalId); if (ret < -1) { - Log.logError("SifRegistrator logComponent for " + aGlobalId + - " failed with code " + ret); + Log.logError("SifRegistrator logComponent failed with code " + ret); } } @@ -353,19 +422,120 @@ /*** ----------------------------- PRIVATE ---------------------------- */ /** - * Checks if SifRegistrator session has been started. - * @throws InstallerException if SifRegistrator session has not been started + * 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 */ - private void checkSession() + private void registerComponent( + SuiteInfo aSuiteInfo, int aIndex, boolean aIsUpdate) { - if (iSessionHandle == 0) + 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) + { + InstallerException.internalError( + "Registering component " + globalId + + " failed with code " + err); + } + else { - InstallerException.internalError("No valid SIF session."); + 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()); } } /** * 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 @@ -381,6 +551,7 @@ 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(); @@ -391,20 +562,17 @@ 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(globalId), - componentFiles, componentSize, - isRemovable, isDrmProtected, - isOriginVerified, aIsUpdate, - aSuiteInfo.getMediaId(), + getScrString(version), getScrString(name), + getScrString(globalId), componentFiles, + componentSize, isRemovable, isDrmProtected, + isOriginVerified, aIsUpdate, aSuiteInfo.getMediaId(), getScrString(midletInfoUrl), getScrString(midletDescription), getScrString(downloadUrl), - getScrString(updateUrl), componentId); if (err < 0) { @@ -422,6 +590,7 @@ /** * 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 @@ -463,6 +632,7 @@ * 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 @@ -520,20 +690,15 @@ private static String[] getComponentFiles(SuiteInfo aSuite) { Vector componentFiles = new Vector(); - if (!aSuite.isPreinstalled()) + String path = aSuite.getJadPath(); + if (path != null) { - // Add component jad and jar files only when the - // application is not preinstalled. - String path = aSuite.getJadPath(); - if (path != null) - { - componentFiles.addElement(getScrString(path)); - } - path = aSuite.getJarPath(); - if (path != null) - { - componentFiles.addElement(getScrString(path)); - } + componentFiles.addElement(getScrString(path)); + } + path = aSuite.getJarPath(); + if (path != null) + { + componentFiles.addElement(getScrString(path)); } boolean addRootPath = true; int rootDrive = FileUtils.getDrive(aSuite.getRootDir()); @@ -551,15 +716,10 @@ } if (addRootPath) { - componentFiles.addElement( - getScrString(aSuite.getRootDir() + "nofile.txt")); + componentFiles.addElement(getScrString(aSuite.getRootDir())); } String[] result = new String[componentFiles.size()]; componentFiles.copyInto(result); - for (int i = 0; i < result.length; i++) - { - Log.log("SifRegistrator componentFiles[" + i + "]: " + result[i]); - } return result; } @@ -666,48 +826,21 @@ } // Register Domain-Category property. - String protectionDomainProperty = "Domain-Category"; - String protectionDomainName = aSuite.getProtectionDomainName(); + ApplicationInfoImpl appInfoImpl = (ApplicationInfoImpl) + com.nokia.mj.impl.rt.support.ApplicationInfo.getInstance(); + String domainCategory = appInfoImpl.getProtectionDomain(); err = _setLocalizedComponentProperty( - iSessionHandle, cid, protectionDomainProperty, - getProtectionDomainPropertyValue(protectionDomainName), - UNSPECIFIED_LOCALE); + iSessionHandle, cid, "Domain-Category", + domainCategory, UNSPECIFIED_LOCALE); if (err < 0) { InstallerException.internalError( - "Adding property " + protectionDomainProperty + - " value " + protectionDomainName + " for component " + - cid + " failed with code " + err); + "Adding property Domain-Category value " + domainCategory + + " 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. This method must never return null. - */ - private String getProtectionDomainPropertyValue(String aProtectionDomain) - { - String textId = "txt_java_inst_setlabel_cert_domain_val_untrusted_third_party"; - if (aProtectionDomain != null) - { - 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"; - } - - /** * Returns array of localized names from the specified * attributes of given suite. Assumes that aAttrPrefix * is an attribute name prefix that is followed by locale. @@ -736,13 +869,6 @@ "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 " + @@ -823,6 +949,14 @@ private static native int _launchAppView(); /** + * Registers Java software type to software installation framework. + * + * @param aRegister true for registration, false for unregistration + * @return 0 or Symbian error code (negative number) + */ + private static native int _registerJavaSoftwareType(boolean aRegister); + + /** * Starts native application registration session. * * @param aTransaction true if also transaction for this session should @@ -864,6 +998,7 @@ * @param aSuiteName * @param aVendor * @param aVersion + * @param aName * @param aGlobalId * @param aComponentFiles * @param aComponentSize @@ -875,19 +1010,17 @@ * @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 aGlobalId, + String aVersion, String aName, String aGlobalId, String[] aComponentFiles, long aComponentSize, boolean aIsRemovable, boolean aIsDrmProtected, boolean aIsOriginVerified, boolean aIsUpdate, int aMediaId, - String aMidletInfoUrl, String aMidletDescription, - String aDownloadUrl, String aUpdateUrl, + String aMidletInfoUrl, String aMidletDescription, String aDownloadUrl, ComponentId aComponentId); /** @@ -995,9 +1128,4 @@ * @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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/FileRoots.java --- a/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/FileRoots.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/FileRoots.java Fri Oct 22 14:23:56 2010 +0100 @@ -62,16 +62,7 @@ */ public static String getRegisteredIconDir(int aDrive) { - String result = getAppsRoot(); - result = FileUtils.setDrive(result, aDrive); - String replace = "\\private\\"; - int i = result.indexOf(replace); - if (i == -1) - { - return FileUtils.getDriveName(aDrive) + ":\\data\\java\\"; - } - return result.substring(0, i) + "\\public\\" + - result.substring(i + replace.length()); + return FileUtils.getDriveName(aDrive) + ":\\data\\java\\"; } /** diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/PropertyProvider.java --- a/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/PropertyProvider.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,179 +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: -* -*/ - - -package com.nokia.mj.impl.installer.utils; - -/** - * Provides notifications whenever the subscribed property value changes. - *
    - * One PropertyProvider instance can be used to subscribe events - * for only one property. If events for more properties are needed - * use separate PropertyProvider instance for each property. - * - * @see PropertyListener - */ -public class PropertyProvider -{ - /** Property category. */ - private int iCategory = 0; - /** Property key. */ - private int iKey = 0; - /** Property listener. */ - private PropertyListener iListener = null; - /** Handle to native object. */ - private int iHandle = 0; - - /** - * Constructor. - */ - public PropertyProvider() - { - } - - /** - * Subscribe to listen changes of specified property value. - * One PropertyListener can subscribe to only one property - * value at a time. - * - * @param aCategory property category - * @param aKey property key - * @param aListener listener to be notified. - */ - public void subscribe(int aCategory, int aKey, PropertyListener aListener) - { - if (iHandle != 0) - { - InstallerException.internalError("PropertyProvider already in use."); - } - iCategory = aCategory; - iKey = aKey; - iListener = aListener; - // Start a new thread which blocks until unsubscribe is called. - final PropertyProvider provider = this; - new Thread(new Runnable() - { - public void run() - { - synchronized (provider) - { - iHandle = _subscribe(iCategory, iKey); - // Notify subscribe method after subscription - // result is available. - provider.notify(); - } - if (iHandle > 0) - { - // Subscription succeeded, start to process events. - _processEvents(iHandle, provider); - } - } - }, "PropertyProviderThread").start(); - synchronized (this) - { - try - { - if (iHandle == 0) - { - // Wait until subscription has been completed. - wait(); - } - } - catch (InterruptedException ie) - { - } - } - // Check if subscription failed. - if (iHandle < 0) - { - Log.logError("PropertyProvider.subscribe failed with code " + iHandle); - iHandle = 0; - } - } - - /** - * Unubscribe from listening changes. - */ - public void unsubscribe() - { - final PropertyProvider provider = this; - new Thread(new Runnable() - { - public void run() - { - synchronized (provider) - { - if (iHandle <= 0) - { - Log.logWarning( - "PropertyProvider.unsubscribe: no subscription."); - return; - } - int err = _unsubscribe(iHandle); - if (err < 0) - { - Log.logError( - "PropertyProvider.unsubscribe failed with code " + - err); - } - else - { - iHandle = 0; - } - } - } - }, "PropertyProviderUnsubscribeThread").start(); - } - - /** - * Called from native when value for the subscribed property changes. - */ - private void valueChanged(int aValue) - { - if (iListener != null) - { - iListener.valueChanged(iCategory, iKey, aValue); - } - } - - /** - * Subscribe to listen changes of specified property value. - * - * @param aCategory property category - * @param aKey property key - * @return handle to native side object or Symbian error - * code (negative number) - */ - private static native int _subscribe(int aCategory, int aKey); - - /** - * Starts to process events. This call blocks until unsubscribe is called. - * - * @param aHandle handle to native side object - * @param aProvider PropertyProvider class instance to be notified - * @return 0 or Symbian error code (negative number) - */ - private static native int _processEvents(int aHandle, PropertyProvider aProvider); - - /** - * Unubscribe from listening changes. - * - * @param aHandle handle to native side object - * @return 0 or Symbian error code (negative number) - */ - private static native int _unsubscribe(int aHandle); -} diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/SysUtil.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -359,12 +359,11 @@ " drives failed with code " + ret); } // Save the drives so that next time they are not fetched again. - Vector drivesVector = new Vector(); + iUserVisibleDrives = new Vector(); for (int i = 0; i < aVisibleDrives.size(); i++) { - drivesVector.addElement(aVisibleDrives.elementAt(i)); + iUserVisibleDrives.addElement(aVisibleDrives.elementAt(i)); } - iUserVisibleDrives = drivesVector; } /** @@ -442,44 +441,6 @@ return ret; } - /** - * Maps given ISO language/country code to Symbian TLanguage. - * - * @param aLocale ISO language/country code - * @return Symbian TLanguage value, or -1 if no matching language is found. - */ - public static int isoToLang(String aLocale) - { - // Replace possible dash with underscore. - aLocale = aLocale.replace('-', '_'); - // Get language and country parts. - String lang = aLocale.toLowerCase(); - String country = null; - int sepIndex = aLocale.indexOf("_"); - if (sepIndex >= 0) - { - lang = aLocale.substring(0, sepIndex).toLowerCase(); - country = aLocale.substring(sepIndex + 1).toUpperCase(); - } - // Map locale to Symbian TLanguage using native service. - int result = -1; - if (country == null) - { - result = _isoToLang(lang); - } - else - { - result = _isoToLang(lang + "_" + country); - if (result == -1) - { - // No result for language and country, try using language only. - result = _isoToLang(lang); - } - } - //Log.log("SysUtil.isoToLang: " + aLocale + " ==> " + result); - return result; - } - /*** ---------------------------- PROTECTED --------------------------- */ /*** ----------------------------- PACKAGE ---------------------------- */ /*** ----------------------------- PRIVATE ---------------------------- */ @@ -687,14 +648,6 @@ private static native int _getScreenHeight(); /** - * Maps given ISO language/country code to Symbian TLanguage. - * - * @param aLocale ISO language/country code - * @return Symbian TLanguage value, or -1 if no matching language is found. - */ - private static native int _isoToLang(String aLocale); - - /** * Class for holding return value from native side. */ private static class IntValue diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/GetComponentInfo.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/GetComponentInfo.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/GetComponentInfo.java Fri Oct 22 14:23:56 2010 +0100 @@ -480,20 +480,11 @@ 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. AuthenticationModule.getInstance().authenticateJar( - suiteUid, null, iJarFilename, + null, suiteUid, null, iJarFilename, FileUtils.isDrmProtected(iJarFilename)); } } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java Fri Oct 22 14:23:56 2010 +0100 @@ -46,8 +46,6 @@ // 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; @@ -63,16 +61,11 @@ 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; @@ -210,11 +203,6 @@ { iPropertyProgressStep = 1; } - iSifProgressStep = iMaxValue / MAX_SIF_PROGRESS_UPDATES; - if (iSifProgressStep == 0) - { - iSifProgressStep = 1; - } iUiProgressStep = iMaxValue / MAX_UI_PROGRESS_UPDATES; if (iUiProgressStep == 0) { @@ -253,44 +241,29 @@ Log.log("InstallationNotifier.set: progress " + currentPercentage); defineProperties(); - if (isUpdateNeeded(aCurrentValue, iMaxValue, - iLastPropertyUpdate, iPropertyProgressStep)) + if (aCurrentValue == 0 || + aCurrentValue == iMaxValue || + aCurrentValue >= iLastPropertyUpdate + iPropertyProgressStep || + aCurrentValue <= 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 (isUpdateNeeded(aCurrentValue, iMaxValue, - iLastSifUpdate, iSifProgressStep)) + if (aCurrentValue == 0 || + aCurrentValue == iMaxValue || + aCurrentValue >= iLastUiUpdate + iUiProgressStep || + aCurrentValue <= iLastUiUpdate - iUiProgressStep) { - 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)) - { + iLastUiUpdate = aCurrentValue; if (iInstallerUi != null) { - iLastUiUpdate = aCurrentValue; Log.log("InstallationNotifier.set: update ui to " + currentPercentage); try @@ -303,6 +276,21 @@ "InstallationNotifier: InstallerUi.updateProgress threw exception", t); } } + if (iSifNotifier != null) + { + Log.log("InstallationNotifier.set: update SifNotifier to " + + currentPercentage); + try + { + iSifNotifier.notifyProgress( + iSifNotifier.SUB_OP_NO, currentPercentage, 100); + } + catch (Throwable t) + { + Log.logError( + "InstallationNotifier: SifNotifier.notifyProgress threw exception", t); + } + } } } @@ -394,24 +382,4 @@ "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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java Fri Oct 22 14:23:56 2010 +0100 @@ -99,11 +99,6 @@ */ 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; @@ -328,7 +323,7 @@ } StartUpTrace.doTrace("Installer.mainWithResult " + aArgs[0] + " begins"); - StringBuffer buf = new StringBuffer("Java install process started with command:"); + StringBuffer buf = new StringBuffer("Java install process started with command: "); for (int i = 0; i < aArgs.length; i++) { buf.append(" ").append(aArgs[i]); @@ -341,7 +336,7 @@ if (iThreadDumper != null) { - iThreadDumper.startTimer(5*60*1000); // 5 mins + iThreadDumper.startTimer(10*60*1000); // 10 mins } try @@ -543,9 +538,9 @@ table.add(new com.nokia.mj.impl.installer.midp2.install.steps. GetFromStorage()); table.add(new com.nokia.mj.impl.installer.midp2.install.steps. - SelectUids()); // Select suite uid and application uids. + StartProgressNotifications()); table.add(new com.nokia.mj.impl.installer.midp2.install.steps. - StartProgressNotifications()); + SelectUids()); // Select suite uid and application uids. table.add(new com.nokia.mj.impl.installer.midp2.install.steps. AuthenticateJad()); // This must be the first security // related step. @@ -596,8 +591,6 @@ StopApplication()); // Update new application info in the following steps. table.add(new com.nokia.mj.impl.installer.midp2.install.steps. - AddSecurityData()); - table.add(new com.nokia.mj.impl.installer.midp2.install.steps. AddToStorage()); table.add(new com.nokia.mj.impl.installer.midp2.install.steps. RegisterPush()); @@ -1242,8 +1235,6 @@ " -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"; @@ -1273,13 +1264,10 @@ " -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"; @@ -1478,7 +1466,7 @@ if (aMessage.hasPermission(CommsPermission.INSTALL_APPLICATION)) { int msgId = aMessage.getMessageId(); - if (msgId == INSTALLER_CANCEL_MESSAGE_ID) + if (msgId == 603) { Installer.cancel(); result = ERR_NONE; @@ -1491,7 +1479,7 @@ } CommsMessage response = new CommsMessage(); response.replyTo(aMessage); - response.setMessageId(INSTALLER_CANCEL_RESPONSE_MESSAGE_ID); + response.setMessageId(604); response.write(result); iInstallerServer.send(response); Log.log("InstallerListener sent " + response); diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallerResultMessage.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallerResultMessage.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallerResultMessage.java Fri Oct 22 14:23:56 2010 +0100 @@ -21,14 +21,12 @@ 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; @@ -39,77 +37,30 @@ /** * InstallerResultMessage contains information about install, uninstall - * 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>
    - * 
    - *

    + * and componentinfo operations. It is sent to Comms endpoint specified + * at JavaInstaller startup. */ 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; @@ -214,7 +165,7 @@ { addValue(NAME_ERROR_DETAILS, msg); } - addErrorCodes(eb); + addErrorCategory(eb); } if (aException instanceof InstallerException) { @@ -242,24 +193,25 @@ } /** - * Returns a string value from this message, or null - * if string value is not present. + * Get a string value from this message. + * @throws IllegalArgumentException if value with given name is not found */ - String getStringValue(String aName) + public String getStringValue(String aName) { Object value = iNamedStringValues.get(aName); if (value instanceof String) { return (String)value; } - return null; + throw new IllegalArgumentException( + "InstallerResultMessage: string value " + aName + " not found"); } /** * Get an int value from this message. * @throws IllegalArgumentException if value with given name is not found */ - int getIntValue(String aName) + public int getIntValue(String aName) { Object value = iNamedIntValues.get(aName); if (value instanceof Integer) @@ -273,7 +225,7 @@ /** * Removes a value from this message. */ - void removeValue(String aName) + public void removeValue(String aName) { iNamedStringValues.remove(aName); iNamedIntValues.remove(aName); @@ -303,20 +255,19 @@ } 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) @@ -347,7 +298,7 @@ { comms.connect(aEndpoint); CommsMessage msg = new CommsMessage(); - msg.setMessageId(INSTALLER_RESULT_MESSAGE_ID); + msg.setMessageId(601); // Initialise the message data. msg.write(iNamedIntValues.size()); Enumeration e = iNamedIntValues.keys(); @@ -367,7 +318,7 @@ } // Send the message. Log.log("Sending InstallerResultMessage to " + aEndpoint); - comms.sendReceive(msg, 5); + CommsMessage installerResultResponse = comms.sendReceive(msg, 5); comms.disconnect(); Log.log("Received InstallerResultResponse from " + aEndpoint); } @@ -434,34 +385,48 @@ } /** - * Adds error codes to the result message. + * Adds error category to the result message. */ - private void addErrorCodes(ExceptionBase aEb) + private void addErrorCategory(ExceptionBase aEb) { - if (aEb.getShortMessageId() >= ErrorMessageBase.INSTALLER_RANGE_START && - aEb.getShortMessageId() <= ErrorMessageBase.INSTALLER_RANGE_END) + switch (aEb.getShortMessageId()) { - addValue(NAME_ERROR_CATEGORY, - SifRegistrator.getErrorCategory(aEb.getShortMessageId())); - addValue(NAME_ERROR_CODE, - aEb.getShortMessageId()*1000 + 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()*1000 + aEb.getDetailedMessageId()); - } - else - { - addValue(NAME_ERROR_CATEGORY, - SifRegistrator.getErrorCategory( - InstallerErrorMessage.INST_UNEXPECTED_ERR)); - addValue(NAME_ERROR_CODE, - aEb.getShortMessageId()*1000 + aEb.getDetailedMessageId()); + 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 } } } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/applicationregistrator/AppRegInfo.java diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/jsrpluginnotifier/InstallerExtensionInfo.java diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/AddSecurityData.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/AddSecurityData.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +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: -* -*/ - - -package com.nokia.mj.impl.installer.midp2.install.steps; - -import com.nokia.mj.impl.installer.exetable.ExeBall; -import com.nokia.mj.impl.installer.exetable.ExeStep; -import com.nokia.mj.impl.installer.utils.Log; -import com.nokia.mj.impl.security.midp.authentication.AuthenticationModule; -import com.nokia.mj.impl.security.midp.authorization.PermissionGranter; - -/** - * Writes application's security data into storage. - */ -public class AddSecurityData extends ExeStep -{ - public void execute(ExeBall aBall) - { - InstallBall ball = (InstallBall)aBall; - ball.log("Writing security data..."); - AuthenticationModule.getInstance().addSecurityData - (ball.iStorageHandler.getSession(), ball.iSuite.getUid(), - (ball.iOldSuite != null? ball.iOldSuite.getUid(): null)); - PermissionGranter.getInstance().addSecurityData - (ball.iStorageHandler.getSession(), ball.iSuite.getUid(), - (ball.iOldSuite != null? ball.iOldSuite.getUid(): null)); - } - - public void cancel(ExeBall aBall) - { - // nop - } -} diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/AuthenticateJar.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/AuthenticateJar.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/AuthenticateJar.java Fri Oct 22 14:23:56 2010 +0100 @@ -35,12 +35,12 @@ } ball.log("Authenticating Jar..."); - ball.iAuthenticationCredentials = - AuthenticationModule.getInstance().authenticateJar - (ball.iSuite.getUid(), - (ball.iOldSuite != null? ball.iOldSuite.getUid(): null), - ball.iJarFilename, - (ball.iSuite.getContentInfo() == SuiteInfo.CONTENT_INFO_DRM? true: false)); + AuthenticationModule.getInstance().authenticateJar + (ball.iStorageHandler.getSession(), + ball.iSuite.getUid(), + (ball.iOldSuite != null? ball.iOldSuite.getUid(): null), + ball.iJarFilename, + (ball.iSuite.getContentInfo() == SuiteInfo.CONTENT_INFO_DRM? true: false)); ball.iJarAuthenticated = true; // Unregister OCSP listener after Jar authentication. AuthenticationModule.getInstance().unregisterOcspEventListener( diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckDiskSpace.java diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckJarPackages.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -38,6 +38,7 @@ // the installation drive. This is needed to determine // if tamper detection is needed. AuthenticationModule.getInstance().setMediaId( + ball.iStorageHandler.getSession(), ball.iSuite.getUid(), ball.iSuite.getMediaId()); // Application package scanning must be skipped if instructed so @@ -72,8 +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 && - ball.iSuite.getOnScreenKeypad() != SuiteInfo.OSK_UNDEFINED) + if (ball.getAttributeValue("Nokia-MIDlet-On-Screen-Keypad") != null) { touchDetection = false; } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConfirmInstallation.java diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConvertIcons.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConvertIcons.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConvertIcons.java Fri Oct 22 14:23:56 2010 +0100 @@ -258,11 +258,10 @@ // the attribute MIDlet- iconName = newApp.getIconPath(); } - if (iconName.length() == 0 || iconName.equals(suiteIconName)) + if (iconName.length() == 0) { - // No MIDlet icon defined or MIDlet icon defined to be - // the same as suite icon, use already converted suite - // icon if it exists. + // No MIDlet icon defined, use already converted suite + // icon if it exists if (suiteIconFile.length() > 0) { // Must make separate copy of the suite icon for each diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/DlListener.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/DlListener.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/DlListener.java Fri Oct 22 14:23:56 2010 +0100 @@ -81,6 +81,8 @@ } if (iBall.iSifNotifier != null) { + Log.log("DlListener.set: update SifNotifier to " + + aDlInfo.getCurrentSize() + " / " + aDlInfo.getTotalSize()); try { iBall.iSifNotifier.notifyProgress( diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/FinalizeInstallation.java Fri Oct 22 14:23:56 2010 +0100 @@ -150,9 +150,6 @@ Log.log("JavaCaptain notified"); } - // Add an entry to platform installation log. - ball.iApplicationRegistrator.addInstallLogEntry(ball.iSuite, 0); - String midletName = ball.getAttributeValue("MIDlet-Name"); ball.log("Application " + midletName + " successfully installed."); ball.log(ball.iSuite.toShortString()); @@ -305,18 +302,11 @@ } } - if (ball.iSifRegistrator.getSifMode() > 0 && launchApp) - { - ball.getInstallerUi().syncExec(new Runnable() - { - // launchAppView() must be called in the UI thread. - public void run() - { - ball.iSifRegistrator.launchAppView(); - } - }); - } - else + //if (ball.iSifRegistrator.getSifMode() > 0 && launchApp) + //{ + // ball.iSifRegistrator.launchAppView(); + //} + //else if (ball.iCaptainMsgs && launchApp && launchAppInfo.getApplications() != null && launchAppInfo.getApplications().length > 0) diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/GrantJarPermissions.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/GrantJarPermissions.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/GrantJarPermissions.java Fri Oct 22 14:23:56 2010 +0100 @@ -45,10 +45,9 @@ } ball.iSecurityAttributes.addManifestAttributes(ball.iJarAttributes); PermissionGranter.getInstance().grantJarPermissions - (ball.iSuite.getUid(), + (ball.iStorageHandler.getSession(), ball.iSuite.getUid(), (ball.iOldSuite != null? ball.iOldSuite.getUid(): null), - ball.iSecurityAttributes.getPermissionAttributes(), - ball.iAuthenticationCredentials); + ball.iSecurityAttributes.getPermissionAttributes()); ball.iJarPermissionsGranted = true; } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/HandleCustomAttributes.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -23,13 +23,10 @@ import com.nokia.mj.impl.installer.storagehandler.ApplicationInfo; import com.nokia.mj.impl.installer.storagehandler.SuiteInfo; import com.nokia.mj.impl.installer.utils.Log; -import com.nokia.mj.impl.installer.utils.AutoStartPermission; import com.nokia.mj.impl.utils.InstallerDetailedErrorMessage; import com.nokia.mj.impl.utils.InstallerErrorMessage; import com.nokia.mj.impl.utils.OtaStatusCode; import com.nokia.mj.impl.utils.exception.InvalidAttributeException; -import com.nokia.mj.impl.security.midp.authorization.AccessControllerFactoryImpl; -import com.nokia.mj.impl.security.midp.authorization.AccessControllerImpl; import java.util.Vector; @@ -56,7 +53,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,16 +74,13 @@ } else { - // Ignore on-screen-keypad attribute with invalid value. - aBall.iSuite.setOnScreenKeypad(SuiteInfo.OSK_UNDEFINED); - Log.logWarning("Ignoring invalid " + attrName + - " value " + attrValue); + Log.logWarning("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); } @@ -102,62 +96,20 @@ } for (int i = 1; true; i++) { - if (apps.size() < i) - { - break; - } - String attrName = "Nokia-MIDlet-Auto-Start-" + i; String attrValue = aBall.getAttributeValue(attrName); - - if (attrValue == null) - { - // Allow also this form of the name to be compatible with - // an existing implementation - attrName = "Nokia-MIDlet-auto-start-" + i; - attrValue = aBall.getAttributeValue(attrName); - - if ((attrValue == null) && (i == 1)) - { - // Allow even this S40 format - attrName = "Nokia-MIDlet-auto-start"; - attrValue = aBall.getAttributeValue(attrName); - } - } - if (attrValue != null) { - if (!aBall.attributeExistsInJar(attrName)) + if (apps.size() < i) { - // The attribute is only in .jad, ignore it. - Log.logWarning("Attribute " + attrName + - " ignored because it is not in Manifest"); - continue; - } - - // Check if MIDlet has permission for Auto-start - AccessControllerImpl accessControllerImpl = - AccessControllerFactoryImpl. - getAccessController(aBall.iStorageHandler.getSession(), - aBall.iSuite.getUid(), - aBall.iSuite.getName()); - AutoStartPermission autoStartPermission = new AutoStartPermission(); - if (!accessControllerImpl.isPermissionAllowed( - autoStartPermission.toString())) - { - Log.logWarning("Attribute " + attrName + - " ignored due to insufficient permissions"); break; } - - if (attrValue.equalsIgnoreCase("false") || - attrValue.equalsIgnoreCase("no")) + if (attrValue.equalsIgnoreCase("false")) { ((ApplicationInfo)apps.elementAt(i-1)). setAutoStart(ApplicationInfo.AUTOSTART_FALSE); } - else if (attrValue.equalsIgnoreCase("true") || - attrValue.equalsIgnoreCase("yes")) + else if (attrValue.equalsIgnoreCase("true")) { ((ApplicationInfo)apps.elementAt(i-1)). setAutoStart(ApplicationInfo.AUTOSTART_TRUE); @@ -179,6 +131,10 @@ OtaStatusCode.INVALID_JAR)); } } + else + { + break; + } } } } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/InstallBall.java Fri Oct 22 14:23:56 2010 +0100 @@ -20,7 +20,6 @@ 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; @@ -304,11 +303,10 @@ Log.logWarning("checkForCancel: Stopping downloader failed", t); } } - throw new InstallerException( - Installer.ERR_CANCEL, - InstallerErrorMessage.INST_CANCEL, null, - InstallerDetailedErrorMessage.INST_CANCEL, null, - OtaStatusCode.USER_CANCELLED); + throw new InstallerException + (InstallerErrorMessage.INST_CANCEL, null, + InstallerDetailedErrorMessage.NO_MSG, null, + OtaStatusCode.USER_CANCELLED); } } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/NotifyJsrPlugins.java diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/OcspListener.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/OcspListener.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/OcspListener.java Fri Oct 22 14:23:56 2010 +0100 @@ -78,6 +78,7 @@ } if (iBall.iSifNotifier != null) { + Log.log("OcspListener.ocspEvent: update SifNotifier to 0 / 0"); try { iBall.iSifNotifier.notifyProgress( @@ -108,6 +109,7 @@ } if (iBall.iSifNotifier != null) { + Log.log("OcspListener.ocspEvent: update SifNotifier to 100 / 100"); try { iBall.iSifNotifier.notifyProgress( diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareInstallation.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareInstallation.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareInstallation.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -29,7 +29,6 @@ import com.nokia.mj.impl.installer.jsrpluginnotifier.JsrPluginNotifier; import com.nokia.mj.impl.installer.storagehandler.StorageHandler; import com.nokia.mj.impl.installer.utils.Args; -import com.nokia.mj.impl.installer.utils.DriveInfo; import com.nokia.mj.impl.installer.utils.FileRoots; import com.nokia.mj.impl.installer.utils.FileUtils; import com.nokia.mj.impl.installer.utils.InstallerException; @@ -38,11 +37,8 @@ import com.nokia.mj.impl.installer.utils.SysUtil; import com.nokia.mj.impl.security.midp.authentication.AuthenticationModule; import com.nokia.mj.impl.security.midp.authentication.OcspSettings; -import com.nokia.mj.impl.fileutils.FileURL; import com.nokia.mj.impl.utils.Uid; -import java.util.Vector; - public class PrepareInstallation extends ExeStep { @@ -174,11 +170,6 @@ { aBall.iJarUrl = jarArg; } - else if (isFileUrl(jarArg)) - { - aBall.iJarFilename = getFileFromUrl(jarArg); - Log.log("Jar " + aBall.iJarFilename + " from URL " + jarArg); - } else { aBall.iJarFilename = jarArg; @@ -190,11 +181,6 @@ { aBall.iJadUrl = jadArg; } - else if (isFileUrl(jadArg)) - { - aBall.iJadFilename = getFileFromUrl(jadArg); - Log.log("Jad " + aBall.iJadFilename + " from URL " + jadArg); - } else { aBall.iJadFilename = jadArg; @@ -280,7 +266,6 @@ if (arg != null) { aBall.iInstallationDrive = args.parseDrive(arg); - checkInstallationDrive(aBall.iInstallationDrive); } } @@ -361,60 +346,4 @@ Log.log("ocspSettings: " + ocspSettings); return ocspSettings; } - - /** - * Returns true if given URL is a file URL, false otherwise. - */ - private static boolean isFileUrl(String aUrl) - { - if (aUrl == null || aUrl.length() == 0) - { - return false; - } - return aUrl.toLowerCase().startsWith("file://"); - } - - /** - * Returns a file path from file URL. - * - * @throws InstallerException if URL is invalid. - */ - private static String getFileFromUrl(String aUrl) - { - String filePath = null; - try - { - FileURL fileUrl = new FileURL(aUrl); - filePath = fileUrl.getFullPath(); - } - catch (Throwable t) - { - InstallerException.internalError("Invalid file URL: " + aUrl, t); - } - return filePath; - } - - /** - * Checks that given installation drive is a valid one. - * - * @param aDrive installation drive - * @throws InstallerException if installation drive is not valid - */ - private static void checkInstallationDrive(int aDrive) - { - Vector drives = new Vector(); - SysUtil.getUserVisibleDrives(drives); - for (int i = 0; i < drives.size(); i++) - { - DriveInfo driveInfo = (DriveInfo)drives.elementAt(i); - if (driveInfo.getNumber() == aDrive) - { - // Installation drive found from user visible drives. - return; - } - } - InstallerException.internalError( - "Invalid installation drive: " + aDrive + - " (" + (char)('A' + aDrive) + ")"); - } } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareSplashScreen.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareSplashScreen.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareSplashScreen.java Fri Oct 22 14:23:56 2010 +0100 @@ -35,7 +35,6 @@ import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.ImageLoader; import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.internal.extension.ImageUtil; /** * Installation step PrepareSplashScreen prepares splash @@ -107,21 +106,15 @@ for (int i = 0; i < tokens.length; i++) { tokens[i] = tokens[i].trim(); - imageSizes[i] = getImageSize(tokens[i], ball.iJarFilename); - if (imageSizes[i] == null) + currentImage = loadImage(tokens[i], ball.iJarFilename); + if (currentImage == null) { - // Couldn't get image size, try to get it by loading - // the image. - currentImage = loadImage(tokens[i], ball.iJarFilename); - if (currentImage == null) - { - // Image loading failed, proceed to the next image. - imageSizes[i] = new Point(0, 0); - continue; - } - imageSizes[i] = new Point( - currentImage[0].width, currentImage[0].height); + // Image loading failed, proceed to the next image. + imageSizes[i] = new Point(0, 0); + continue; } + imageSizes[i] = new Point( + currentImage[0].width, currentImage[0].height); } // Choose the images which best fill the portrait and // landscape screens. @@ -244,74 +237,6 @@ } /** - * Gets image size for specified image from given jar file. - * - * @param aResource image file name - * @param aJar jar file name - * @return image size, or null if getting image size fails - */ - private static Point getImageSize(String aResource, String aJar) - { - Point result = null; - JarFile jarFile = null; - InputStream is = null; - try - { - // Open jar file and input stream. - jarFile = new JarFile(aJar); - is = jarFile.getInputStream( - new JarEntry(FileUtils.trimJarEntry(aResource))); - if (is != null) - { - result = ImageUtil.getImageSize(is); - if (result != null) - { - Log.log("Image size for " + aResource + " from " + - aJar + ": " + result); - } - } - else - { - Log.logWarning("Image " + aResource + " not found from " + aJar); - } - } - catch (Throwable t) - { - Log.logWarning("Loading image " + aResource + " from " + - aJar + " failed", t); - } - finally - { - // Close streams and jar file. - if (is != null) - { - try - { - is.close(); - is = null; - } - catch (IOException ioe) - { - Log.logWarning("Closing InputStream failed", ioe); - } - } - if (jarFile != null) - { - try - { - jarFile.close(); - jarFile = null; - } - catch (IOException ioe) - { - Log.logWarning("Closing " + aJar + " failed", ioe); - } - } - } - return result; - } - - /** * Loads image from specified resource from given jar file. * * @param aResource resource file name @@ -327,8 +252,8 @@ { // Open jar file and input stream. jarFile = new JarFile(aJar); - is = jarFile.getInputStream( - new JarEntry(FileUtils.trimJarEntry(aResource))); + is = jarFile.getInputStream + (new JarEntry(FileUtils.trimJarEntry(aResource))); if (is != null) { result = (new ImageLoader()).load(is); @@ -394,8 +319,8 @@ { // Open jar file and input and output streams. jarFile = new JarFile(aJar); - is = jarFile.getInputStream( - new JarEntry(FileUtils.trimJarEntry(aResource))); + is = jarFile.getInputStream + (new JarEntry(FileUtils.trimJarEntry(aResource))); os = FileUtils.getOutputStream(imageFilename); // Copy the image data from InputStream to OutputStream. byte[] buf = new byte[16384]; diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/RegisterApplicationToSif.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/RegisterApplicationToSif.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/RegisterApplicationToSif.java Fri Oct 22 14:23:56 2010 +0100 @@ -40,11 +40,11 @@ Log.log("Old suite unregistered from SIF"); } - if (ball.iAuthenticationCredentials != null) + if (ball.iSourceUrl != null) { - // Set protection domain name. - ball.iSuite.setProtectionDomainName( - ball.iAuthenticationCredentials[0].getProtectionDomainName()); + // Save source URL to suite as jad URL which is + // registered to SIF as download URL. + ball.iSuite.setJadUrl(ball.iSourceUrl); } // Initialize application installation group to SuiteInfo. diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/StartProgressNotifications.java Fri Oct 22 14:23:56 2010 +0100 @@ -36,12 +36,6 @@ 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."); @@ -105,17 +99,9 @@ } catch (Throwable t) { - Log.log("StartProgressNotifications: SifNotifier.notifyStart failed", t); - try - { - ball.iSifNotifier.destroy(); - } - catch (Throwable t2) - { - Log.logError("StartProgressNotifications: SifNotifier.destroy failed", t2); - } - ball.iSifNotifier = null; + Log.logError("StartProgressNotifications: SifNotifier.notifyStart failed", t); } + // Set SifNotifier for the listeners that should use it. ball.iInstallationNotifier.setSifNotifier(ball.iSifNotifier); } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/FinalizeUninstallation.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/FinalizeUninstallation.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/FinalizeUninstallation.java Fri Oct 22 14:23:56 2010 +0100 @@ -102,10 +102,6 @@ ball.log("Application with uid " + appUids[i] + " uninstalled"); } } - - // Add an entry to platform installation log. - ball.iApplicationRegistrator.addInstallLogEntry(ball.iSuite, 1); - ball.log("Application suite with uid " + ball.iSuite.getUid() + " successfully uninstalled."); } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/GetFromStorage.java Fri Oct 22 14:23:56 2010 +0100 @@ -54,15 +54,6 @@ // 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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/NotifyJsrPlugins.java diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/StartProgressNotifications.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/StartProgressNotifications.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/StartProgressNotifications.java Fri Oct 22 14:23:56 2010 +0100 @@ -91,16 +91,8 @@ catch (Throwable t) { Log.logError("StartProgressNotifications: SifNotifier.notifyStart failed", t); - try - { - ball.iSifNotifier.destroy(); - } - catch (Throwable t2) - { - Log.logError("StartProgressNotifications: SifNotifier.destroy failed", t2); - } - ball.iSifNotifier = null; } + // Set SifNotifier for the listeners that should use it. ball.iInstallationNotifier.setSifNotifier(ball.iSifNotifier); } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/UninstallBall.java Fri Oct 22 14:23:56 2010 +0100 @@ -21,7 +21,6 @@ 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; @@ -125,11 +124,10 @@ super.checkForCancel(); if (isCancelled()) { - throw new InstallerException( - Installer.ERR_CANCEL, - InstallerErrorMessage.UNINST_CANCEL, null, - InstallerDetailedErrorMessage.UNINST_CANCEL, null, - OtaStatusCode.USER_CANCELLED); + throw new InstallerException + (InstallerErrorMessage.UNINST_CANCEL, null, + InstallerDetailedErrorMessage.NO_MSG, null, + OtaStatusCode.USER_CANCELLED); } } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandler.java Fri Oct 22 14:23:56 2010 +0100 @@ -925,23 +925,13 @@ } else { - // Not an update ==> suite is being uninstalled. + // Not an update ==> user is making uninstallation. int oldPreinstallState = readPreinstallState(aSuiteInfo); if (oldPreinstallState == aSuiteInfo.STATE_PREINSTALLED) { - 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); - } + // User is uninstalling a preinstalled application, + // set preinstall state to STATE_NO_PREINSTALL. + setNoPreinstallState(aSuiteInfo); } else if (oldPreinstallState == aSuiteInfo.STATE_INSTALLED) { @@ -1091,11 +1081,13 @@ /** * Removes preinstall state for given suite from - * preinstall table + * preinstall table but only if preinstall state + * in given SuiteInfo is SuiteInfo.STATE_INSTALLED. */ private void removePreinstallState(SuiteInfo aSuiteInfo) { - if (aSuiteInfo == null) + if (aSuiteInfo == null || + aSuiteInfo.iPreinstallState != aSuiteInfo.STATE_INSTALLED) { return; } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/SuiteInfo.java Fri Oct 22 14:23:56 2010 +0100 @@ -73,9 +73,6 @@ 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; @@ -83,8 +80,6 @@ private String iConvertedIconPath = null; /** Application installation group. This member is not saved into storage. */ private String iInstallationGroup = null; - /** Protection domain name. This member is not saved into storage. */ - private String iProtectionDomainName = null; /** * Combined Jad and Manifest attributes. Key is attribute name, @@ -526,22 +521,6 @@ } /** - * Get protection domain name. - */ - public String getProtectionDomainName() - { - return iProtectionDomainName; - } - - /** - * Set protection domain name. - */ - public void setProtectionDomainName(String aProtectionDomainName) - { - iProtectionDomainName = aProtectionDomainName; - } - - /** * Set suite uid. * * @param aUid suite uid @@ -761,14 +740,6 @@ } /** - * Returns true if this application suite is preinstalled, false otherwise. - */ - public boolean isPreinstalled() - { - return (iPreinstallState == STATE_PREINSTALLED); - } - - /** * Set flag telling if application suite is preinstalled. * * @param aTrusted true if suite is preinstalled, false otherwise @@ -786,24 +757,6 @@ } /** - * 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. @@ -886,11 +839,9 @@ 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"); - buf.append(" Protection domain: ").append(getProtectionDomainName()).append("\n"); if (iApplications != null) { buf.append("Applications:\n"); diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/Args.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -20,7 +20,6 @@ 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; @@ -60,7 +59,6 @@ //Log.log("Args: " + arg + "=" + value); } } - decodeBase64Args(); } /** @@ -205,59 +203,7 @@ } drive = aDrive.toLowerCase().charAt(0) - 'a'; } - Log.log("Args: Parsed drive " + aDrive + " --> " + drive); + Log.log("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 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/AutoStartPermission.java Fri Oct 22 14:23:56 2010 +0100 @@ -75,10 +75,6 @@ */ public boolean equals(Object obj) { - if (!(obj instanceof AutoStartPermission)) - { - return false; - } return (obj.hashCode() == hashCode()); } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/PropertyListener.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/PropertyListener.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +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: -* -*/ - - -package com.nokia.mj.impl.installer.utils; - -/** - * Interface for listening property value changes. - * - * @see PropertyProvider - */ -public interface PropertyListener -{ - /** - * Called when property value is changed. - * This method must return quickly. - * - * @param aCategory property category - * @param aKey property key - * @param aValue property value - */ - public void valueChanged(int aCategory, int aKey, int aValue); -} diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/rt/installer/ApplicationUtilsImpl.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -85,11 +85,6 @@ Installer.cancel(); } - public void uiDisposed() - { - Log.log("ApplicationUtilsImpl.uiDisposed"); - } - public void checkPermission(Permission aPermission) throws AccessControlException, NullPointerException { diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/src.s60/applicationregistrator/applicationregistrator.cpp --- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/applicationregistrator.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/applicationregistrator.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -30,12 +30,6 @@ #include #include -#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK -#include -#include -#include -#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS #include #else @@ -56,13 +50,7 @@ // NAMESPACE DECLARATION using namespace java; -#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK -using namespace SwiUI; -#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK -IMPORT_C HBufC* CreateHBufCFromJavaStringLC(JNIEnv* aEnv, jstring aString); - -#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /** * MIDP Stub SIS file UID. The application type Uid for MIDlets in S60 */ @@ -99,6 +87,14 @@ 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() @@ -106,15 +102,6 @@ * @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 @@ -149,7 +136,8 @@ return err; } -#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#if 1 +//#ifndef RD_JAVA_USIF_APP_REG // Delete any pending (un)registrations (possible if // e.g. device rebooted before commit). // This call does nothing if there is no pending registrations. @@ -164,7 +152,7 @@ pApaSession->Close(); return err; } -#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#endif // RD_JAVA_USIF_APP_REG // Return handle to session. Utilize the fact that in Symbian // all pointer addresses are MOD 4 so the last 2 bits are 0 @@ -188,7 +176,8 @@ * @param[in] aBackground * @return 0 if registration succeeded or Symbian error code */ -#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#if 0 +//#ifdef RD_JAVA_USIF_APP_REG 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*/, @@ -196,7 +185,7 @@ { return KErrNone; } -#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#else 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, @@ -363,6 +352,7 @@ return err; } +#endif // RD_JAVA_USIF_APP_REG /** @@ -494,7 +484,6 @@ return err; } -#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /** @@ -504,13 +493,14 @@ * @param[in] aUid The Uid of the application to be unregistered.. * @return 0 if unregistration succeeded or Symbian error code */ -#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#if 0 +//#ifdef RD_JAVA_USIF_APP_REG JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1unregisterApplication (JNIEnv *, jclass, jint /*aSessionHandle*/, jint /*aUid*/) { return KErrNone; } -#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#else JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1unregisterApplication (JNIEnv *, jclass, jint aSessionHandle, jint aUid) { @@ -523,7 +513,7 @@ TRAPD(err, pApaSession->DeregisterNonNativeApplicationL(appUid)); return err; } -#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#endif // RD_JAVA_USIF_APP_REG /** @@ -544,7 +534,8 @@ TInt err = KErrNone; -#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#if 1 +//#ifndef RD_JAVA_USIF_APP_REG if (aSynchronous) { // Make synchronous commit @@ -572,12 +563,12 @@ // Use always this synchronous commit when running in emulator // to make writing autotest cases easier. TRAP(err, pApaSession->CommitNonNativeApplicationsUpdatesL()); -#else // __WINS__ +#else // asynchronous commit TRAP(err, pApaSession->ForceCommitNonNativeApplicationsUpdatesL()); #endif // __WINS__ } -#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#endif // RD_JAVA_USIF_APP_REG if (KErrNone == err) { @@ -602,9 +593,10 @@ reinterpret_cast(aSessionHandle<<2); TInt err = KErrNone; -#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#if 1 +//#ifndef RD_JAVA_USIF_APP_REG err = pApaSession->RollbackNonNativeApplicationsUpdates(); -#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#endif // RD_JAVA_USIF_APP_REG pApaSession->Close(); delete pApaSession; @@ -945,7 +937,6 @@ } -#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /** * Internal helper method for checking whether this code is executing in * a device that has correctly working version of @@ -990,75 +981,3 @@ return EFalse; } } -#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - -/** - * See JNI method __1logComponent. - * This method makes calls that may leave. - */ -#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK -void AddInstallLogEntryL( - JNIEnv */*aEnv*/, jint /*aAction*/, jint /*aUid*/, - jstring /*aName*/, jstring /*aVendor*/, - jint /*aMajorVersion*/, jint /*aMinorVersion*/, jint /*aMicroVersion*/) -{ -} -#else -void AddInstallLogEntryL( - JNIEnv *aEnv, jint aAction, jint aUid, jstring aName, jstring aVendor, - jint aMajorVersion, jint aMinorVersion, jint aMicroVersion) -{ - TUid uid = TUid::Uid(aUid); - HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aName); - HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor); - TVersion version(aMajorVersion, aMinorVersion, aMicroVersion); - - // Create log task object. - CTask* task = CTask::NewL(KLogTaskImplUid, EFalse); - CleanupStack::PushL(task); - - // Initalize log task parameters. - TLogTaskParam params; - params.iName.Copy(name->Left(KMaxLogNameLength)); - params.iVendor.Copy(vendor->Left(KMaxLogVendorLength)); - params.iVersion = version; - params.iUid = uid; - // Time must be universal time. - TTime time; - time.UniversalTime(); - params.iTime = time; - params.iAction = (TLogTaskAction)aAction; - params.iIsStartup = EFalse; // Startup list was not modified. - - TLogTaskParamPckg pckg(params); - task->SetParameterL(pckg, 0); - - // Create log task manager. - CTaskManager* taskManager = CTaskManager::NewL(); - CleanupStack::PushL(taskManager); - - // Add the log task to the task list. - taskManager->AddTaskL(task); - taskManager->ExecutePendingTasksL(); - - // Cleanup. - CleanupStack::PopAndDestroy(taskManager); - CleanupStack::Pop(task); - - CleanupStack::PopAndDestroy(vendor); - CleanupStack::PopAndDestroy(name); -} -#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - -/** - * Adds an entry to platform installation log. - */ -JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1addInstallLogEntry -(JNIEnv *aEnv, jclass, jint aAction, jint aUid, jstring aName, jstring aVendor, - jint aMajorVersion, jint aMinorVersion, jint aMicroVersion) -{ - TRAPD(err, AddInstallLogEntryL( - aEnv, aAction, aUid, aName, aVendor, - aMajorVersion, aMinorVersion, aMicroVersion)); - return err; -} diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp --- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -21,11 +21,21 @@ #include "javasymbianoslayer.h" // for CleanupResetAndDestroyPushL #include "logger.h" -#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#if defined(SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK) && defined(RD_JAVA_USIF_NOTIFY_PROGRESS) #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; @@ -91,7 +101,6 @@ HBufC *appIcon = CreateHBufCFromJavaStringLC(aEnv, tmpAppIcon); applicationIcons.AppendL(appIcon); CleanupStack::Pop(appIcon); - aEnv->DeleteLocalRef(tmpAppIcon); } else { @@ -152,7 +161,7 @@ jstring aGlobalComponentId, jint aErrCategory, jint aErrCode, jstring aErrMsg, jstring aErrMsgDetails) { - //__UHEAP_MARK; + __UHEAP_MARK; HBufC *globalComponentId = CreateHBufCFromJavaStringLC(aEnv, aGlobalComponentId); HBufC *errMsg = NULL; if (NULL != aErrMsg) @@ -165,29 +174,24 @@ errMsgDetails = CreateHBufCFromJavaStringLC(aEnv, aErrMsgDetails); } - CSifOperationEndData *endData = - CSifOperationEndData::NewLC( - *globalComponentId, (TErrorCategory)aErrCategory, aErrCode, - (NULL != errMsg? *errMsg: KNullDesC()), - (NULL != errMsgDetails? *errMsgDetails: KNullDesC())); + CSifOperationEndData *endData = CSifOperationEndData::NewLC( + *globalComponentId, (TErrorCategory)aErrCategory, aErrCode, + *errMsg, *errMsgDetails); - // Do not use UHEAP macros around PublishCompletionL() because it - // creates a timer object which gets deleted only when the notifier - // object is deleted. aNotifier->PublishCompletionL(*endData); CleanupStack::PopAndDestroy(endData); - if (NULL != errMsgDetails) + if (NULL != aErrMsg) + { + CleanupStack::PopAndDestroy(errMsg); + } + if (NULL != aErrMsgDetails) { CleanupStack::PopAndDestroy(errMsgDetails); } - if (NULL != errMsg) - { - CleanupStack::PopAndDestroy(errMsg); - } CleanupStack::PopAndDestroy(globalComponentId); - //__UHEAP_MARKEND; + __UHEAP_MARKEND; } /* @@ -199,25 +203,10 @@ (JNIEnv *aEnv, jclass, jint aHandle, jstring aGlobalComponentId, jint aErrCategory, jint aErrCode, jstring aErrMsg, jstring aErrMsgDetails) { - CActiveScheduler* newScheduler = 0; - if (0 == CActiveScheduler::Current()) - { - // Create ActiveScheduler as it does not yet exist. - newScheduler = new CActiveScheduler; - CActiveScheduler::Install(newScheduler); - } - CPublishSifOperationInfo *pNotifier = reinterpret_cast(aHandle<<2); TRAPD(err, NotifyEndL(aEnv, pNotifier, aGlobalComponentId, aErrCategory, aErrCode, aErrMsg, aErrMsgDetails)); - - if (newScheduler) - { - delete newScheduler; - newScheduler = 0; - } - return err; } @@ -297,7 +286,7 @@ return KErrNone; } -#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK && RD_JAVA_USIF_NOTIFY_PROGRESS /* * Class: com_nokia_mj_impl_installer_applicationregistrator_SifNotifier @@ -381,4 +370,4 @@ return KErrNone; } -#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK && RD_JAVA_USIF_NOTIFY_PROGRESS diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp --- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -24,7 +24,6 @@ #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" @@ -32,39 +31,53 @@ // SCR usage is enabled if this macro has been defined. #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#include +#include #include #include +#ifdef RD_JAVA_USIF_APP_REG #include -#include -#include +#endif // RD_JAVA_USIF_APP_REG // Helper macro for logging a TDesC. #define LOG_TDESC_L(compIdParam, logLevelParam, msgParam, tdescParam) \ - { \ - std::wstring ws((wchar_t*)tdescParam.Ptr(), tdescParam.Length()); \ - LOG1(compIdParam, logLevelParam, msgParam, ws.c_str()); \ + { \ + 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 +QTM_USE_NAMESPACE using namespace java; using namespace Usif; IMPORT_C HBufC* CreateHBufCFromJavaStringLC(JNIEnv* aEnv, jstring aString); +// Java MIME types. +_LIT(KMimeTypeAppDescriptor, "text/vnd.sun.j2me.app-descriptor"); +_LIT(KMimeTypeJava, "application/java"); +_LIT(KMimeTypeJavaArchive, "application/java-archive"); +_LIT(KMimeTypeXJavaArchive, "application/x-java-archive"); + // 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 @@ -174,6 +187,7 @@ * 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; @@ -206,6 +220,11 @@ 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 @@ -216,6 +235,12 @@ (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; } @@ -229,47 +254,86 @@ { TInt err = KErrNone; - CActiveScheduler* newScheduler = 0; - if (0 == CActiveScheduler::Current()) + QServiceManager serviceManager; + QObject* activityManager = + serviceManager.loadInterface("com.nokia.qt.activities.ActivityManager"); + if (!activityManager) { - // Create ActiveScheduler as it does not yet exist. - newScheduler = new CActiveScheduler; - CActiveScheduler::Install(newScheduler); + err = serviceManager.error(); + ELOG1(EJavaInstaller, + "launchAppView: loading ActivityManager failed, error %d", err); + return KErrCouldNotConnect; + } + // URL for launching AppLib. + QUrl url(QString("appto://20022F35?activityname=AppLibRecentView")); + QMetaObject::invokeMethod(activityManager, "launchActivity", + Q_ARG(QString, url.toString())); + err = serviceManager.error(); + delete activityManager; + if (QServiceManager::NoError != err) + { + ELOG1(EJavaInstaller, + "launchAppView: launching AppLib activity failed, error %d", + err); + return KErrCouldNotConnect; } - QUrl openRecentView("appto://20022F35?activityname=AppLibRecentView"); - XQApplicationManager applicationManager; - XQAiwRequest *request = applicationManager.create(openRecentView); - if (request) + // Start AppLib and bring it to foreground. + const TUid KAppLibUid = { 0x20022F35 }; + TRAP(err, StartAppL(KAppLibUid)); + return err; +} + +/** + * See JNI method __1registerJavaSoftwareType. + * This method makes calls that may leave (the actual registering). + */ +void RegisterJavaSoftwareTypeL(RSoftwareComponentRegistry *aScr, TBool aRegister = ETrue) +{ + RPointerArray javaMimeTypes; + CleanupResetAndDestroyPushL(javaMimeTypes); + javaMimeTypes.AppendL(KMimeTypeAppDescriptor().AllocL()); + javaMimeTypes.AppendL(KMimeTypeJava().AllocL()); + javaMimeTypes.AppendL(KMimeTypeJavaArchive().AllocL()); + javaMimeTypes.AppendL(KMimeTypeXJavaArchive().AllocL()); + if (aRegister) + { + TUid javaSifPluginUid = TUid::Uid(0x2002bc70); + _LIT_SECURE_ID(KJavaInstallerSid, 0x102033E6); + aScr->AddSoftwareTypeL( + Usif::KSoftwareTypeJava, javaSifPluginUid, + KJavaInstallerSid, KJavaInstallerSid, javaMimeTypes); + } + else { - LOG(EJavaInstaller, EInfo, "launchAppView: launching AppLib"); - bool result = request->send(); - 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; + aScr->DeleteSoftwareTypeL(Usif::KSoftwareTypeJava, javaMimeTypes); } - - if (newScheduler) - { - delete newScheduler; - newScheduler = 0; - } + CleanupStack::PopAndDestroy(&javaMimeTypes); +} - if (KErrNone == err) +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator + * Method: _registerJavaSoftwareType + * Signature: (Z)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1registerJavaSoftwareType +(JNIEnv *, jclass, jboolean aRegister) +{ + RSoftwareComponentRegistry *pScr = NULL; + TRAPD(err, pScr = CreateScrL()); + if (KErrNone != err) { - // Start AppLib and bring it to foreground. - const TUid KAppLibUid = { 0x20022F35 }; - TRAP(err, StartAppL(KAppLibUid)); + return err; } + TRAP(err, RegisterJavaSoftwareTypeL(pScr, aRegister)); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "registerJavaSoftwareType: registration failed, error %d", + err); + } + pScr->Close(); + delete pScr; return err; } @@ -344,6 +408,12 @@ TRAPD(err, pScr->RollbackTransactionL()); pScr->Close(); delete pScr; + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "rollbackSession: Rolling back transaction failed, error %d", + err); + } return err; } @@ -373,9 +443,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); } } @@ -386,14 +456,23 @@ */ TComponentId RegisterComponentL( JNIEnv *aEnv, RSoftwareComponentRegistry *aScr, jint aUid, - jstring aSuiteName, jstring aVendor, jstring aVersion, jstring aGlobalId, + jstring aSuiteName, jstring aVendor, jstring aVersion, + jstring aName, jstring aGlobalId, jobjectArray aComponentFiles, TInt64 aComponentSize, TBool aIsRemovable, TBool aIsDrmProtected, TBool aIsOriginVerified, TBool aIsUpdate, jint aMediaId, - jstring aMidletInfoUrl, jstring aMidletDescription, - jstring aDownloadUrl, jstring aUpdateUrl) + jstring aMidletInfoUrl, jstring aMidletDescription, jstring aDownloadUrl) { - HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aSuiteName); + HBufC *name = NULL; + if (NULL == aName) + { + // If name is not specified, use suite name. + name = CreateHBufCFromJavaStringLC(aEnv, aSuiteName); + } + else + { + name = CreateHBufCFromJavaStringLC(aEnv, aName); + } HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor); HBufC *version = CreateHBufCFromJavaStringLC(aEnv, aVersion); HBufC *globalId = CreateHBufCFromJavaStringLC(aEnv, aGlobalId); @@ -420,10 +499,14 @@ 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); @@ -449,23 +532,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 aGlobalId, + jstring aVendor, jstring aVersion, jstring aName, jstring aGlobalId, jobjectArray aComponentFiles, jlong aComponentSize, jboolean aIsRemovable, jboolean aIsDrmProtected, jboolean aIsOriginVerified, jboolean aIsUpdate, jint aMediaId, jstring aMidletInfoUrl, jstring aMidletDescription, - jstring aDownloadUrl, jstring aUpdateUrl, jobject aComponentId) + jstring aDownloadUrl, jobject aComponentId) { - __UHEAP_MARK; + //__UHEAP_MARK; RSoftwareComponentRegistry *pScr = reinterpret_cast(aSessionHandle<<2); TComponentId componentId = -1; TRAPD(err, componentId = RegisterComponentL( - aEnv, pScr, aUid, aSuiteName, aVendor, aVersion, aGlobalId, + aEnv, pScr, aUid, aSuiteName, aVendor, aVersion, aName, aGlobalId, aComponentFiles, aComponentSize, aIsRemovable, aIsDrmProtected, aIsOriginVerified, aIsUpdate, aMediaId, - aMidletInfoUrl, aMidletDescription, - aDownloadUrl, aUpdateUrl)); - __UHEAP_MARKEND; + aMidletInfoUrl, aMidletDescription, aDownloadUrl)); + //__UHEAP_MARKEND; if (KErrNone == err) { jclass clazz = aEnv->GetObjectClass(aComponentId); @@ -483,16 +565,18 @@ JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1unregisterComponent (JNIEnv *, jclass, jint aSessionHandle, jint aComponentId) { - __UHEAP_MARK; + //__UHEAP_MARK; 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)); } - __UHEAP_MARKEND; + //__UHEAP_MARKEND; return err; } @@ -500,6 +584,7 @@ * 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, @@ -567,36 +652,47 @@ RPointerArray captionsArray; CleanupResetAndDestroyPushL(captionsArray); TInt langCount = aEnv->GetArrayLength(aLanguages); - jint* languages = aEnv->GetIntArrayElements(aLanguages, NULL); - for (TInt i = 0; i < langCount; i++) + TInt captionCount = aEnv->GetArrayLength(aAppNames); + if (langCount == captionCount) { - 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); + 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); } - aEnv->ReleaseIntArrayElements(aLanguages, languages, 0); + else + { + WLOG2(EJavaInstaller, + "RegisterApplicationL: localisation not made because language " \ + "count does not match to caption count (%d != %d)", + langCount, captionCount); + } // Create application registration data objects. TApplicationCharacteristics appCharacteristics; @@ -632,6 +728,13 @@ 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 @@ -661,13 +764,19 @@ JNIEnv *aEnv, RSoftwareComponentRegistry *aScr, jint aComponentId, jstring aName, jstring aVendor, jint aLanguage) { - HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aName); - aScr->SetComponentNameL(aComponentId, *name, (TLanguage)aLanguage); - CleanupStack::PopAndDestroy(name); + if (NULL != aName) + { + HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aName); + aScr->SetComponentNameL(aComponentId, *name, (TLanguage)aLanguage); + CleanupStack::PopAndDestroy(name); + } - HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor); - aScr->SetVendorNameL(aComponentId, *vendor, (TLanguage)aLanguage); - CleanupStack::PopAndDestroy(vendor); + if (NULL != aVendor) + { + HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor); + aScr->SetVendorNameL(aComponentId, *vendor, (TLanguage)aLanguage); + CleanupStack::PopAndDestroy(vendor); + } } /* @@ -772,6 +881,7 @@ * 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) { @@ -791,6 +901,13 @@ } 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. @@ -803,8 +920,20 @@ CleanupClosePushL(*pScr); TInt uid = 0; CPropertyEntry *property = pScr->GetComponentPropertyL(aCid, KUid()); - uid = ((CIntPropertyEntry*)property)->IntValue(); - delete property; + 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; + } // Close and delete the temporary RSoftwareComponentRegistry. CleanupStack::PopAndDestroy(pScr); delete pScr; // For some reason PopAndDestroy does not delete this. @@ -841,16 +970,23 @@ 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()); @@ -878,37 +1014,42 @@ 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); - LOG1(EJavaInstaller, EInfo, "Number of AppUids found: %d", appUids.Count()); + if (appUids.Count() == 0) + { + LOG(EJavaInstaller, EInfo, "No component appUids found from SCR"); + } 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 } /** @@ -944,11 +1085,11 @@ JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1logComponent (JNIEnv *aEnv, jclass, jint aSessionHandle, jstring aGlobalId) { - //__UHEAP_MARK; + __UHEAP_MARK; RSoftwareComponentRegistry *pScr = reinterpret_cast(aSessionHandle<<2); TRAPD(err, LogComponentL(aEnv, pScr, aGlobalId)); - //__UHEAP_MARKEND; + __UHEAP_MARKEND; return err; } @@ -960,51 +1101,11 @@ JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getUsifMode (JNIEnv *, jclass) { +#ifdef RD_JAVA_USIF_APP_REG return 1; -} - -/* - * 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 + return 0; +#endif // RD_JAVA_USIF_APP_REG } #else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK @@ -1033,6 +1134,17 @@ /* * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator + * Method: _registerJavaSoftwareType + * Signature: (Z)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1registerJavaSoftwareType +(JNIEnv *, jclass, jboolean) +{ + return KErrNone; +} + +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator * Method: _startSession * Signature: ()I */ @@ -1080,9 +1192,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, - jobjectArray, jlong, jboolean, jboolean, jboolean, jboolean, jint, - jstring, jstring, jstring, jstring, jobject) +(JNIEnv *, jclass, jint, jint, jstring, jstring, jstring, jstring, jstring, + jobjectArray, jlong, jboolean, jboolean, jboolean, jboolean, jint, jstring, + jstring, jstring, jobject) { return KErrNone; } @@ -1186,15 +1298,4 @@ 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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.cpp --- a/javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -20,7 +20,7 @@ #include #include -#include +#include #include "javacommonutils.h" #include "logger.h" diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcher.cpp --- a/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcher.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcher.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -83,7 +83,7 @@ classHandles, "addElement", "(Ljava/lang/Object;)V"); jclass classTimestamps = aEnv->GetObjectClass(aTimestamps); jmethodID methodTimestampsAddElement = aEnv->GetMethodID( - classTimestamps, "addElement", "(Ljava/lang/Object;)V"); + classHandles, "addElement", "(Ljava/lang/Object;)V"); jclass integerClass = aEnv->FindClass("java/lang/Integer"); jmethodID integerConstructor = aEnv->GetMethodID( integerClass, "", "(I)V"); diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcherscanfrominbox.cpp --- a/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcherscanfrominbox.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcherscanfrominbox.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -143,7 +143,7 @@ TRAP(err, atta = iAttaMan->GetAttachmentFileL(attaInfo->Id())); if (KErrNone == err) { - aResultArray.InsertL(atta, 0); + aResultArray.Insert(atta, 0); } } } @@ -206,7 +206,7 @@ TMsvEntry index = (*entry)[loop]; if (KUidMsgTypePOP3 == index.iMtm || KUidMsgTypeIMAP4 == index.iMtm) { - aRootEntryArray.InsertL((*entry)[loop].Id(), 0); + aRootEntryArray.Insert((*entry)[loop].Id(), 0); } } } @@ -245,7 +245,7 @@ if (index.Visible() && index.Complete() && !index.InPreparation() && !index.Deleted()) { - aEntryArray.InsertL(aId, 0); + aEntryArray.Insert(aId, 0); } } } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/src.s60/utils/filewriter.cpp --- a/javamanager/javainstaller/installer/src.s60/utils/filewriter.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/utils/filewriter.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -26,7 +26,6 @@ #ifdef RD_JAVA_S60_RELEASE_5_0 #include #else -#include #include #endif // RD_JAVA_S60_RELEASE_5_0 diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/src.s60/utils/propertylistener.cpp --- a/javamanager/javainstaller/installer/src.s60/utils/propertylistener.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +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: -* -* This class implements general wait object for calling -* a callback function after subscribed P&S key value changes. -* -*/ - -#include "propertylistener.h" -#include "logger.h" - -using namespace java::installer; - -// ============================ MEMBER FUNCTIONS =============================== - -CPropertyListener* CPropertyListener::NewL(TUid aUid, TUint aKey) -{ - CPropertyListener* self = new(ELeave) CPropertyListener(aUid, aKey); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(self); - return self; -} - -CPropertyListener::CPropertyListener(TUid aUid, TUint aKey) - : CActive(CActive::EPriorityStandard), iUid(aUid), iKey(aKey) -{ -} - -void CPropertyListener::ConstructL() -{ - User::LeaveIfError(iProperty.Attach(iUid, iKey)); - // PropertyListener is always created from a thread which does - // not have ActiveScheduler, so create ActiveScheduler now. - iActiveScheduler = new(ELeave) CActiveScheduler; - CActiveScheduler::Install(iActiveScheduler); - // Add this object to the ActiveScheduler. - CActiveScheduler::Add(this); -} - -CPropertyListener::~CPropertyListener() -{ - Cancel(); - iProperty.Close(); - if (iActiveScheduler) - { - delete iActiveScheduler; - iActiveScheduler = 0; - } -} - -void CPropertyListener::ProcessEventsL(JNIEnv *aEnv, jobject aProvider) -{ - // Get the java side callback method. - jclass clazz = aEnv->GetObjectClass(aProvider); - jmethodID method = aEnv->GetMethodID(clazz, "valueChanged", "(I)V"); - - iEnv = aEnv; - iProvider = aProvider; - iMethod = method; - - // Run propertyListener once so that the current property value - // gets delivered and property value changes are subscribed. - RunL(); - - // Start ActiveScheduler. - CActiveScheduler::Start(); -} - -void CPropertyListener::RunL() -{ - if (iCancelled) - { - CActiveScheduler::Stop(); - return; - } - - // Resubscribe before handling the new value to prevent missing updates. - iProperty.Subscribe(iStatus); - SetActive(); - - TInt value; - TInt err = iProperty.Get(value); - if (KErrNone == err) - { - //ILOG3(EJavaInstaller, - // "CPropertyListener::RunL: property value changed" - // ", uid: 0x%x, key: 0x%x, value: %d", iUid.iUid, iKey, value); - // Use callback method to deliver the changed property value to - // Java side object. - iEnv->CallVoidMethod(iProvider, iMethod, value); - } - else if (KErrNotFound == err) - { - // Property deleted, no actions needed. - } - else - { - // Error while reading property value. - ELOG3(EJavaInstaller, - "CPropertyListener::RunL: getting property value failed" - ", uid: 0x%x, key: 0x%x, err=%d", iUid.iUid, iKey, err); - } -} - -void CPropertyListener::DoCancel() -{ - iCancelled = ETrue; - iProperty.Cancel(); -} diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/src.s60/utils/propertylistener.h --- a/javamanager/javainstaller/installer/src.s60/utils/propertylistener.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,82 +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: -* -* This class implements general wait object for calling -* a callback function after subscribed P&S key value changes. -* -*/ - -#ifndef PROPERTYLISTENER_H -#define PROPERTYLISTENER_H - -#include -#include -#include - -namespace java -{ -namespace installer -{ - -/** - * This class implements wait object for calling a callback - * function after subscribed P&S key value changes. - */ -NONSHARABLE_CLASS(CPropertyListener) : public CActive -{ -public: // Constructor and destructor - - static CPropertyListener* NewL(TUid aUid, TUint aKey); - - // Destructor. - virtual ~CPropertyListener(); - -private: - - // Constructor. - CPropertyListener(TUid aUid, TUint aKey); - - // 2nd phase constructor. - void ConstructL(); - - // from base class CActive - - void RunL(); - - void DoCancel(); - -public: // Methods - - void ProcessEventsL(JNIEnv *aEnv, jobject aProvider); - -private: // Data - - CActiveScheduler* iActiveScheduler; // Owned - - RProperty iProperty; // Property to listen - TUid iUid; // Property UID - TUint iKey; // Property key - - JNIEnv *iEnv; // JNI environment, not owned - jobject iProvider; // Callback object - jmethodID iMethod; // Callback method - - TBool iCancelled; -}; - -} // installer -} // java - -#endif // PROPERTYLISTENER_H diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/src.s60/utils/propertyprovider.cpp --- a/javamanager/javainstaller/installer/src.s60/utils/propertyprovider.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +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: The JNI code for Java Installer class FileWriter. -* -*/ - -#include "com_nokia_mj_impl_installer_utils_PropertyProvider.h" -#include "logger.h" -#include "propertylistener.h" - -// NAMESPACE DECLARATION -using namespace java::installer; -using namespace java::util; - -/* - * Class: com_nokia_mj_impl_installer_utils_PropertyProvider - * Method: _subscribe - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_utils_PropertyProvider__1subscribe -(JNIEnv */*aEnv*/, jclass, jint aCategory, jint aKey) -{ - TUid uid = TUid::Uid(aCategory); - TUint key = (TUint)aKey; - // Construct PropertyListener. - CPropertyListener* propertyListener = 0; - TRAPD(err, propertyListener = CPropertyListener::NewL(uid, key)); - if (KErrNone != err) - { - ELOG3(EJavaInstaller, - "PropertyProvider__1subscribe: creating property listener " - "failed, uid: 0x%x, key: 0x%x, err=%d", uid.iUid, key, err); - return err; - } - - // Return handle to session. Utilize the fact that in Symbian - // all pointer addresses are MOD 4 so the last 2 bits are 0 - // and can be shifted out. This way the returned handle is - // always positive whereas Symbian error codes are always negative. - return reinterpret_cast(propertyListener)>>2; -} - -/* - * Class: com_nokia_mj_impl_installer_utils_PropertyProvider - * Method: _processEvents - * Signature: (ILcom/nokia/mj/impl/installer/utils/PropertyProvider;)I - */ -JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_utils_PropertyProvider__1processEvents - (JNIEnv *aEnv, jclass, jint aHandle, jobject aProvider) -{ - CPropertyListener* propertyListener = - reinterpret_cast(aHandle<<2); - // Start propertyListener for event sending. - TRAPD(err, propertyListener->ProcessEventsL(aEnv, aProvider)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "PropertyProvider__1processEvents: initializing " - "propertyListener failed, err=%d", err); - } - return err; -} - -/* - * Class: com_nokia_mj_impl_installer_utils_PropertyProvider - * Method: _unsubscribe - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_utils_PropertyProvider__1unsubscribe - (JNIEnv *, jclass, jint aHandle) -{ - CPropertyListener* propertyListener = - reinterpret_cast(aHandle<<2); - - // Delete PropertyListener. - delete propertyListener; - propertyListener = 0; - - return KErrNone; -} diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/src.s60/utils/sysutil.cpp --- a/javamanager/javainstaller/installer/src.s60/utils/sysutil.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/utils/sysutil.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -25,20 +25,13 @@ #include #include -#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK -#include "hbextendedlocale.h" -#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - #include "com_nokia_mj_impl_installer_utils_SysUtil.h" -#include "javajniutils.h" #include "logger.h" #ifndef KPSUidJavaLatestInstallation #define KPSUidJavaLatestInstallation 0x10282567 #endif -using namespace java::util; - /** * Helper method for creating HBufC from jstring. */ @@ -93,8 +86,8 @@ TUid repositoryUid = { aRepository }; CRepository* repository = CRepository::NewLC(repositoryUid); RBuf buf; + buf.Create(NCentralRepositoryConstants::KMaxUnicodeStringLength); CleanupClosePushL(buf); - buf.CreateL(NCentralRepositoryConstants::KMaxUnicodeStringLength); TInt err = repository->Get(aKey, buf) ; if (KErrNone == err) { @@ -727,21 +720,3 @@ } return value; } - -/* - * Class: com_nokia_mj_impl_installer_utils_SysUtil - * Method: _isoToLang - * Signature: ()[Ljava/lang/String; - */ -JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_utils_SysUtil__1isoToLang -(JNIEnv *aEnv, jclass, jstring aLocale) -{ -#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - return HbExtendedLocale::ISOToSymbianLang( - QString::fromStdWString(JniUtils::jstringToWstring(aEnv, aLocale))); -#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - (void)aEnv; // suppress compilation warning about unused argument - (void)aLocale; // suppress compilation warning about unused argument - return -1; -#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK -} diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/build/build.xml diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/build/jiut.bat --- a/javamanager/javainstaller/installer/tsrc/build/jiut.bat Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/build/jiut.bat Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ @rem -@rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +@rem Copyright (c) 2009 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" @@ -14,10 +14,8 @@ @rem Description: @rem rem Script for running JavaInstaller unit tests from S60 eshell -rem Start SifServer before running any tests -sifserver -javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.NotificationPosterTest -javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.DownloaderTest +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.storagehandler.OtaStatusHandlerTest javainstaller test -mainclass=com.nokia.mj.impl.installer.integrityservice.IntegrityServiceTest javainstaller test -mainclass=com.nokia.mj.impl.installer.jadjarmatcher.JadJarMatcherTest @@ -34,7 +32,4 @@ 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 -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 +rem javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/GetComponentInfoTest.java Fri Oct 22 14:23:56 2010 +0100 @@ -856,11 +856,15 @@ try { String value = aMsg.getStringValue(aName); - assertTrue("Unexpected value " + aName + "=" + value, value == null); + assertTrue("Unexpected value " + aName + "=" + value, false); + } + catch (IllegalArgumentException iae) + { + // Expected exception. } catch (Throwable t) { - assertTrue("Unexpected exception for string value " + aName + + assertTrue("Incorrect exception for string value " + aName + ": " + t, false); } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/InstallerEngineTest.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -52,8 +52,6 @@ { 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. @@ -66,9 +64,6 @@ })); } - if (runIndex == null || runIndex.equalsIgnoreCase("run1")) - { - // Run 1 suite.addTest(new InstallerEngineTest("testMidletMessageOk", new TestMethod() { public void run(TestCase tc) @@ -108,11 +103,7 @@ ((InstallerEngineTest)tc).test3AppsOk(); } })); - } - if (runIndex == null || runIndex.equalsIgnoreCase("run2")) - { - // Run 2 suite.addTest(new InstallerEngineTest("testDownloadJadOk", new TestMethod() { public void run(TestCase tc) @@ -224,11 +215,7 @@ ((InstallerEngineTest)tc).testNoJavaBinRoot(); } })); - } - if (runIndex == null || runIndex.equalsIgnoreCase("run3")) - { - // Run 3 suite.addTest(new InstallerEngineTest("testBlockUninstall", new TestMethod() { public void run(TestCase tc) @@ -252,11 +239,7 @@ ((InstallerEngineTest)tc).testApplicationInfo(); } })); - } - if (runIndex == null || runIndex.equalsIgnoreCase("run4")) - { - // Run 4 suite.addTest(new InstallerEngineTest("testInstallOptions", new TestMethod() { public void run(TestCase tc) @@ -272,7 +255,6 @@ ((InstallerEngineTest)tc).testInstallAuthAndBig(); } })); - } com.nokia.mj.impl.utils.OmjTestRunner.run(suite); } @@ -328,15 +310,6 @@ } /** - */ - 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, @@ -437,12 +410,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); @@ -597,38 +570,38 @@ public void testDownloadJadOk() { Log.logOut("InstallerEngineTest.testDownloadJadOk begins"); - SuiteInfo suite = new SuiteInfo("HelloWorld", "Nokia"); - doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/HelloWorld_ota.jad", true, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); + doInstallUninstall(suite, "http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_gcf.jsp", true, iDefaultOptions); } public void testDownloadJarOk() { Log.logOut("InstallerEngineTest.testDownloadJarOk begins"); - SuiteInfo suite = new SuiteInfo("HelloWorld", "Nokia"); - doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/HelloWorld.jar", false, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); + doInstallUninstall(suite, "http://195.134.231.83:7070/omjserver/resources/omj/JBenchmark2.jar", false, iDefaultOptions); } public void testDownloadJadHttpRedirectOk() { Log.logOut("InstallerEngineTest.testDownloadJadHttpRedirectOk begins"); - SuiteInfo suite = new SuiteInfo("HelloWorld_redirect", "Nokia"); - doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jad&count=5", true, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); + doInstallUninstall(suite, "http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jad&count=5", true, iDefaultOptions); } public void testDownloadJarHttpRedirectOk() { Log.logOut("InstallerEngineTest.testDownloadJarHttpRedirectOk begins"); - SuiteInfo suite = new SuiteInfo("HelloWorld_redirect", "Nokia"); - doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jar", false, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); + doInstallUninstall(suite, "http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jar", false, iDefaultOptions); } public void testDownloadJadHttpAuthOk() { Log.logOut("InstallerEngineTest.testDownloadJadHttpAuthOk begins"); - SuiteInfo suite = new SuiteInfo("HelloWorld_http_auth", "Nokia"); + SuiteInfo suite = new SuiteInfo("DS_Snow_http_auth", "DS_Effects"); iDefaultOptions.addElement("-username=guest"); iDefaultOptions.addElement("-password=guest"); - doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", true, iDefaultOptions); + doInstallUninstall(suite, "http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", true, iDefaultOptions); } public void testDownloadJadHttpAuthNok() @@ -638,7 +611,7 @@ { "install", "-silent", - "-jad=http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", + "-jad=http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", }; int result = Installer.mainWithResult(args); // Check result code. @@ -649,7 +622,7 @@ iItu.isExceptionReason (Installer.getExecuteException(), InstallerErrorMessage.INST_CANCEL, - InstallerDetailedErrorMessage.INST_CANCEL, + InstallerDetailedErrorMessage.NO_MSG, OtaStatusCode.USER_CANCELLED)); assertTrue("installed app uid should not exist", Installer.iInstalledApps.length == 0); } @@ -661,7 +634,7 @@ { "install", "-silent", - "-jad=http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jad&count=6", + "-jad=http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jad&count=6", }; int result = Installer.mainWithResult(args); // Check result code. @@ -704,7 +677,7 @@ { "install", "-silent", - "-jad=http://" + getTestServer() + "/installertest/HelloWorld_8mb.jad", + "-jad=http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_8mb_gcf.jsp", }; Log.log("InstallerEngineTest.testDownloadJadCancel: installation starts"); int result = Installer.mainWithResult(args); @@ -717,7 +690,7 @@ iItu.isExceptionReason (Installer.getExecuteException(), InstallerErrorMessage.INST_CANCEL, - InstallerDetailedErrorMessage.INST_CANCEL, + InstallerDetailedErrorMessage.NO_MSG, OtaStatusCode.USER_CANCELLED)); assertTrue("installed app uid should not exist", Installer.iInstalledApps.length == 0); Log.log("InstallerEngineTest.testDownloadJadCancel: end"); @@ -1012,7 +985,7 @@ callInstallerOk(new String[] { "list", "-systemproperties" }); callInstallerOk(new String[] { "launch", "-nouid" }); callInstallerOk(new String[] { "launch", "-uid=invaliduid" }); - callInstallerOk(new String[] { "uninstallall", "-silent" }); + callInstallerOk(new String[] { "uninstallall" }); callInstallerOk(new String[] { "unregister" }); callInstallerOk(new String[] { "test", "-nomainclass" }); } @@ -1133,10 +1106,10 @@ { Log.logOut("InstallerEngineTest.testInstallAuthAndBig begins"); // Do first installation with doInstallUninstall helper - SuiteInfo suite = new SuiteInfo("HelloWorld_http_auth", "Nokia"); + SuiteInfo suite = new SuiteInfo("DS_Snow_http_auth", "DS_Effects"); iDefaultOptions.addElement("-username=guest"); iDefaultOptions.addElement("-password=guest"); - doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", true, iDefaultOptions); + doInstallUninstall(suite, "http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", true, iDefaultOptions); // Then start installation which downloads a large file. Log.log("InstallerEngineTest.testInstallAuthAndBig begin to install big app"); @@ -1144,7 +1117,7 @@ { "install", "-silent", - "-jad=http://" + getTestServer() + "/installertest/HelloWorld_8mb.jad", + "-jad=http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_8mb_gcf.jsp", }; int result = Installer.mainWithResult(args); // Check result code. diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistratorTest.java --- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistratorTest.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistratorTest.java Fri Oct 22 14:23:56 2010 +0100 @@ -374,32 +374,12 @@ appReg.startSession(); groupName = appReg.getGroupName(uid); - if (SifRegistrator.getSifMode() > 0) - { - // When USIF is in use ApplicationRegistrator should not - // have registered anything. - assertTrue( - "The group name was not empty, it was " + groupName, - "".equals(groupName)); - } - else - { - assertTrue( - "The group name was not VeryVeryLongGrou, it was " + groupName, - "VeryVeryLongGrou".equals(groupName)); - } + assertTrue( + "The group name was not VeryVeryLongGrou, it was " + groupName, + "VeryVeryLongGrou".equals(groupName)); uidInUse = appReg.uidInUse(uid); - if (SifRegistrator.getSifMode() > 0) - { - // When USIF is in use ApplicationRegistrator should not - // have registered anything. - assertTrue("uidInUse returned true value", false == uidInUse); - } - else - { - assertTrue("uidInUse returned false value", true == uidInUse); - } + assertTrue("uidInUse returned false value", true == uidInUse); appReg.closeSession(); } @@ -602,16 +582,7 @@ "".equals(groupName)); uidInUse = appReg.uidInUse(uid); - if (SifRegistrator.getSifMode() > 0) - { - // When USIF is in use ApplicationRegistrator should not - // have registered anything. - assertTrue("uidInUse returned true value", false == uidInUse); - } - else - { - assertTrue("uidInUse returned false value", true == uidInUse); - } + assertTrue("uidInUse returned false value", true == uidInUse); appReg.closeSession(); } @@ -732,32 +703,12 @@ appReg.startSession(); groupName = appReg.getGroupName(uid); - if (SifRegistrator.getSifMode() > 0) - { - // When USIF is in use ApplicationRegistrator should not - // have registered anything. - assertTrue( - "The group name was not empty, it was " + groupName, - "".equals(groupName)); - } - else - { - assertTrue( - "The group name was not Suite, it was " + groupName, - "Suite".equals(groupName)); - } + assertTrue( + "The group name was not Suite, it was " + groupName, + "Suite".equals(groupName)); uidInUse = appReg.uidInUse(uid); - if (SifRegistrator.getSifMode() > 0) - { - // When USIF is in use ApplicationRegistrator should not - // have registered anything. - assertTrue("uidInUse returned true value", false == uidInUse); - } - else - { - assertTrue("uidInUse returned false value", true == uidInUse); - } + assertTrue("uidInUse returned false value", true == uidInUse); appReg.closeSession(); } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/SifRegistratorTest.java Fri Oct 22 14:23:56 2010 +0100 @@ -203,34 +203,21 @@ { 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++) - //{ - // cid = getComponentId(si.getGlobalId(i)); - // uid = sifReg.getUid(cid.getId()); - // assertTrue("Application uid " + - // ((ApplicationInfo)apps.elementAt(i)).getUid() + - // " does not match to uid " + uid + " from SCR", - // ((ApplicationInfo)apps.elementAt(i)).getUid().equals(uid)); - //} + Uid uid = null; + //Uid uid = sifReg.getUid(cid.getId()); + //assertTrue("Suite uid " + si.getUid() + " does not match" + + // " to uid " + uid + " from SCR", + // si.getUid().equals(uid)); + Vector apps = si.getApplications(); + for (int i = 0; i < apps.size(); i++) + { + cid = getComponentId(si.getGlobalId(i)); + uid = sifReg.getUid(cid.getId()); + assertTrue("Application uid " + + ((ApplicationInfo)apps.elementAt(i)).getUid() + + " does not match to uid " + uid + " from SCR", + ((ApplicationInfo)apps.elementAt(i)).getUid().equals(uid)); + } sifReg.closeSession(); } catch (InstallerException ie) @@ -337,18 +324,16 @@ private void assertSuiteExists(SuiteInfo aSuite, boolean aExists) { String not = (aExists? " not": ""); - // Check for USIF Phase 2 registration. ComponentId cid = getComponentId(aSuite.getGlobalId()); - assertTrue("Suite " + aSuite.getGlobalId() + not + - " found from SCR", (aExists? cid != null: cid == null)); - // Check for USIF Phase 1 registration. - //Vector apps = aSuite.getApplications(); - //for (int i = 0; i < apps.size(); i++) - //{ - // cid = getComponentId(aSuite.getGlobalId(i)); - // assertTrue("Application " + aSuite.getGlobalId(i) + not + - // " found from SCR", (aExists? cid != null: cid == null)); - //} + //assertTrue("Suite " + aSuite.getGlobalId() + not + + // " found from SCR", (aExists? cid != null: cid == null)); + Vector apps = aSuite.getApplications(); + for (int i = 0; i < apps.size(); i++) + { + cid = getComponentId(aSuite.getGlobalId(i)); + assertTrue("Application " + aSuite.getGlobalId(i) + not + + " found from SCR", (aExists? cid != null: cid == null)); + } } private void logSuite(SuiteInfo aSuite) diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/customisationproperties/CustomisationPropertiesTest.java Fri Oct 22 14:23:56 2010 +0100 @@ -212,18 +212,18 @@ String drive = (String)value.firstElement(); assertTrue("PossibleInstallationDrives is null", (drive != null)); - assertTrue("First PossibleInstallationDrive is not C:, it is " + drive, drive.equals("C:")); + assertTrue("First PossibleInstallationDrive is not C:", drive.equals("C:")); // second possible drive drive = (String)value.get(1); assertTrue("PossibleInstallationDrives is null", (drive != null)); - assertTrue("Second PossibleInstallationDrive is not E:, it is " + drive, drive.equals("E:")); + assertTrue("Second PossibleInstallationDrive is not E:", 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 not E:, it is " + idrive, idrive.intValue() == 4); + assertTrue("Second PossibleInstallationDrive is E:", idrive.intValue() == 4); } public void testTypesOfPossibleInstallationDrives() diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/DownloaderTest.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -37,8 +37,8 @@ */ public class DownloaderTest extends TestCase implements InstallerMain { - private static final String TEST_URL = "/installertest/HelloWorld.jar"; - private static final int TEST_URL_SIZE = 1511; // test data file size + 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 // Begin j2meunit test framework setup @@ -172,15 +172,10 @@ 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("http://" + server - + TEST_URL, filename); + DownloadInfo dlInfo = new DownloadInfo(TEST_URL, filename); downloader.start(dlInfo); downloader.waitForCompletion(); assertTrue("Result DlInfo is null", diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/NotificationPosterTest.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -36,7 +36,7 @@ */ public class NotificationPosterTest extends TestCase implements InstallerMain { - private static final String TEST_URL = "/installertest/notify?tID=900_success"; + private static final String TEST_URL = "http://195.134.231.83:7070/java-server/getresult.jsp?phone=CE0CBA106ADB77A9298A143E5136CD2B&tID=900_success"; // Begin j2meunit test framework setup @@ -361,18 +361,13 @@ testNotifyPendingFailureLimit(poster); } - private OtaStatusNotification createNotification(int aIndex) + private static 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, - "http://" + server + TEST_URL + aIndex, System.currentTimeMillis(), - 0); + TEST_URL + aIndex, System.currentTimeMillis(), 0); return notification; } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandlerTest.java diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/utils/AttributeValidatorTest.java diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/utils/SysUtilTest.java Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -33,8 +33,6 @@ */ public class SysUtilTest extends TestCase implements InstallerMain { - private int iPropertyValue = 0; // Used in testPropertyListener test case. - // Begin j2meunit test framework setup public void installerMain(String[] args) @@ -169,49 +167,6 @@ } })); - if (Platform.isS60()) - { - suite.addTest(new SysUtilTest("testPropertyListener", new TestMethod() - { - public void run(TestCase tc) - { - ((SysUtilTest)tc).testPropertyListener(); - } - })); - - 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); } @@ -243,11 +198,11 @@ { try { - // Test PS keys defined in hwrmpowerstatesdkpskey.h - Uid uid = PlatformUid.createUid("0x10205041"); // KPSUidHWRMPowerState - int key = 0x00000003; // KHWRMChargingStatus + // Test PS keys defined in ScreensaverInternalPSKeys.h + Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver + int key = 0x00000001; // KScreenSaverPreviewMode int value = SysUtil.getPropertyValue(uid, key); - assertTrue("KHWRMChargingStatus(!=0): " + value, value == 0); + assertTrue("KScreenSaverPreviewMode(!=0): " + value, value == 0); } catch (InstallerException ie) { @@ -260,8 +215,8 @@ { try { - // Test PS keys defined in hwrmpowerstatesdkpskey.h - Uid uid = PlatformUid.createUid("0x10205041"); // KPSUidHWRMPowerState + // Test PS keys defined in ScreensaverInternalPSKeys.h + Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver int key = 0x00000010; // Undefined key int value = SysUtil.getPropertyValue(uid, key); assertTrue("Getting undefined property value did not fail", false); @@ -276,12 +231,13 @@ { try { - Uid uid = SysUtil.PROP_CATEGORY_SYSTEM; - long key = SysUtil.PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS; + // Test PS keys defined in ScreensaverInternalPSKeys.h + Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver + int key = 0x00000001; // KScreenSaverPreviewMode + // Set screensaver preview mode on (stays on for 10 secs). SysUtil.setPropertyValue(uid, key, 1); int value = SysUtil.getPropertyValue(uid, key); - assertTrue("PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS(!=1): " + - value, value == 1); + assertTrue("KScreenSaverPreviewMode(!=1): " + value, value == 1); } catch (InstallerException ie) { @@ -294,8 +250,9 @@ { try { - Uid uid = SysUtil.PROP_CATEGORY_SYSTEM; - int key = 0x00000100; // Undefined key + // Test PS keys defined in ScreensaverInternalPSKeys.h + Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver + int key = 0x00000010; // Undefined key SysUtil.setPropertyValue(uid, key, 1); assertTrue("Setting undefined property value did not fail", false); } @@ -382,12 +339,11 @@ { try { - // Test CenRep keys defined in Java security. - Uid uid = PlatformUid.createUid("0x2001B289"); // KJavaSecurity - long key = 0x00000004; // KJavaSecurity/KWarningsMode + // Test CenRep keys defined in ScreensaverInternalCRKeys.h + Uid uid = PlatformUid.createUid("0x101F8770"); // KCRUidScreenSaver + long key = 0x00000004; // KScreenSaverInvertedColors int value = SysUtil.getRepositoryValue(uid, key); - assertTrue("KJavaSecurity/KWarningsMode(!=2): " + value, - value == 2); + assertTrue("KScreenSaverInvertedColors(!=0): " + value, value == 0); } catch (InstallerException ie) { @@ -419,8 +375,8 @@ Uid uid = SysUtil.REPO_ID_JAVA_INST_VARIATION; long key = SysUtil.REPO_KEY_JAVA_INST_SHELL_FOLDER_VALUE; String value = SysUtil.getRepositoryStringValue(uid, key); - assertTrue("Unexpected value: " + value, "Games,Applications".equals(value)); - //assertTrue("Unexpected value: " + value, "".equals(value)); + //assertTrue("Unexpected value: " + value, "Games,Applications".equals(value)); + assertTrue("Unexpected value: " + value, "".equals(value)); } catch (InstallerException ie) { @@ -617,126 +573,4 @@ // OK, expected exception. } } - - public void testPropertyListener() - { - final int category = 0x101f75b6; - final int key = 0x20019546; - final int value = 15; - final Object synchObject = this; - PropertyListener listener = new PropertyListener() - { - public void valueChanged(int aCategory, int aKey, int aValue) - { - try - { - if (aValue == 0) - { - // Ignore the first event which is sent when - // subscription is made. - return; - } - synchronized (synchObject) - { - iPropertyValue = aValue; - Log.log("PropertyListener.valueChanged: " + aValue + - " (" + aCategory + ", " + aKey + ")"); - if (aCategory != category) - { - Log.logError("PropertyListener.valueChanged: " + - "invalid category " + aCategory); - } - if (aKey != key) - { - Log.logError("PropertyListener.valueChanged: " + - "invalid key " + aKey); - } - synchObject.notify(); - } - } - catch (Throwable t) - { - Log.logError("PropertyListener.valueChanged exception", t); - } - } - }; - try - { - iPropertyValue = 0; - SysUtil.setPropertyValue( - PlatformUid.createUid(category), key, iPropertyValue); - PropertyProvider provider = new PropertyProvider(); - provider.subscribe(category, key, listener); - SysUtil.setPropertyValue( - PlatformUid.createUid(category), key, value); - try - { - synchronized (synchObject) - { - if (iPropertyValue == 0) - { - synchObject.wait(2000); - } - } - } - catch (InterruptedException ie) - { - } - provider.unsubscribe(); - assertTrue("Unexpected property value after test: " + - iPropertyValue, iPropertyValue == value); - } - catch (Throwable t) - { - Log.logError("testPropertyListener exception", t); - assertTrue("Unexpected exception " + t, false); - } - } - - 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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/installerengine/HelloWorld_3_midlets.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/installerengine/HelloWorld_3_midlets.jad Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/testdata/installerengine/HelloWorld_3_midlets.jad Fri Oct 22 14:23:56 2010 +0100 @@ -9,8 +9,8 @@ Nokia-MIDlet-UID-1: 0xefef0001 Nokia-MIDlet-UID-3: 0xefef0003 Nokia-MIDlet-On-Screen-Keypad: no -Nokia-MIDlet-auto-start: true -Nokia-MIDlet-auto-start-2: false +Nokia-MIDlet-Auto-Start-1: true +Nokia-MIDlet-Auto-Start-2: false Nokia-MIDlet-Auto-Start-3: once MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=CE00C90A2EF00F07C210A061BD15A4EC&tID=900_success MIDlet-Delete-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=CE00C90A2EF00F07C210A061BD15A4EC&tID=912_deletion_notification diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000019.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000019.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000046.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000046.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000058.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000058.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000070.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000070.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000090.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000090.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000150.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000150.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000172.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000172.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000175.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000175.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000182.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000182.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000189.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000189.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000250.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000250.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000305.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000305.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000390.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000390.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000500.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000500.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000582.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000582.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000618.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000618.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/00000703.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000703.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/3DSpaceShooter.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/3DSpaceShooter.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/800_x_N97_64GB_fr_speed_v5_32_01.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/800_x_N97_64GB_fr_speed_v5_32_01.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -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: MIIEOTCCAyGgAwIBAgILAQAAAAABFIeLkAEwCQYJKoZIhvcNAQEFBQAwUDELNAkGA1UEBhMCVVsxFzAVBgNVBAoIDlZvZGFmb25lIEdyb3VwMSgwJgYDVQQDEx9Wb2RhZm9uZSAoVHJ1c3RlZCBBcHBsaWNhdGlvbnMpMB4XDTA3MDgyMTA4MzA0NFoXDTEyMDgyMTA4MzA0NFowTzELMAkGA1UEBhMCU0cxFDASBgNVBAoTC05ldXN0YXIgTkdNMSowKAYDVQQDEyFNb2JpbGUgSW5zdGFudCBNZXNzYWdpbmcgMjEuMDguMDcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCFfdEngntebK38dtsdODIkNzMiYsngpTwgnDPqV23m/OtsCX1+1E3+ns9v7EPQVqeTuPYUbUiQRXAYE2NpnUjzNd4bKIXBlk18YpXftMxKv4XRvtVa273O/nbKigtR9IuJx2Pz/x/zWbDpc4ZitRQaRTHy0oA1W+htVI1BBzO8cFC3kf4DTNEXjeYHGF5U7deGp/KuN8qfN7QPJ5gtYyUcwYtrV9imc7P2idLFfYGejm7/s/R3qh9o3bIvqLSHUQbwTQNz7bA7QzpBYkSgaQqzif8+ZYRZuLApjbhpoM5XRFUwQCu6KXx7ZPMKoCKVjof20LWlilUiBrVIXMIwHq0tAgMBAAGjggETMIIBDzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwUgYDVR0fBEswSTBHoEWgQ4ZBaHR0cDovL2NybC52b2RhZm9uZS1wa2kuY29tL2NybC52L1ZvZGFmb25lVHJ1c3RlZEFwcGxpY2F0aW9ucy5jcmwwOAYIKwYBBQUHAQEELDAqMCgGCCsGAQUFBzABhhxodHRwOi8vb2NzcC52b2RhZm9uZS1wa2kuY29tMBoGA1UdIAQTMBEwDwYNKoY6AAHv9U8BAQMBAzAfBgNVHSMEGDAWgBQ7En6Wl4emCf8AlmWvsw/TeSSR9DAdBgNVHQ4EFgQUadzkP7g69+F/NQGoOfvOG1PC6YowDQYJKoZIhvcNAQEFBQADggEBAK2Z4qE4EFlXYL3ELnsbV/Ri6igPgdXgSZalaw8IKorw19TX7ERpL2tCiyDqisEJygNLW2iok9Nn3DUsmJTr0CoSZFGZc88hkJ9mlDTCQnNa9Hx9XQhp3Ig0uo1Eoei+12kF9j1kVlQJl6QkOPrbdmBbGpv7NFTM29zkPN/4wt3uUvoLZ/ZlbB4NjufZ6gVL77Bt2+UNwKLM4wF39Dy3zTD6qcJPuitGGSss0X4SYX6AzTtNRM+CtTPkFby10pHmmr4ClSfGtOZnXmbGizOIUh/lgOgv/nG9Q+dRDUGDTkhnDwMs1b0reQ0rGE1jFayCJ6Rmn/03FIN5N1SKfgkSeBE= -MIDlet-Certificate-1-2: MIIECjCCAvKgAwIBAgIFAwEAAzANBgkqhkiG9w0BAQUF8DBLMQswCQYDVQQGEwJVSzEXNBUGA1UEChMOVm9kYWXvbmUgR3JvdXAxIzAhBgNVBAMTGlZvZGFmb25lIChPcGVyYXRvciBEb21haW4pMB4XDTA1MDYxMzExMDAwMFoXDTIxMTIzMTEyMDAwMFowUDELMAkGA1UEBhMCVUsxFzAVBgNVBAoTDlZvZGFmb25lIEdyb3VwMSgwJgYDVQQDEx9Wb2RhZm9uZSAoVHJ1c3RlZCBBcHBsaWNhdGlvbnMpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvfev7oXJy+WKdRjmc2i+Y8vMI3ey/LggGtOhGhY7w1oH1puYttgAjwPP7Ff2qObaJyfFnX81aCopQWeymGzpJtcIv/Z5sZRayBw9ceNIqI7WrwS3Ht//4uqUIH0p6VtPuRukNAnJewbFGgImowwZI4sizQ5Idqxx14lUoOTw8EaE0ygwXSJefS1w/5vuShyujd22F3wHpQnjo/lf05y14x43Uf+PpfFoVzvKm8q/n4VMtzMwi04vkgPjkflT2yay8WWtEpxU6rw8j32EWM/A2+kd4YbTE50I9/XFmIitHajaPVB3piwsChSt4d89UyIP/a+xGkPMultznEdH23SptQIDAQABo4HwMIHtMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBQ7En6Wl4emCf8AlmWvsw/TeSSR9DAZBgNVHSAEEjAQMA4GDCqGOgAB7/VPAQEDATBNBgNVHR8ERjBEMEKgQKA+hjxodHRwOi8vY3JsLnZvZGFmb25lLXBraS5jb20vY3JsLnYvVm9kYWZvbmVPcGVyYXRvckRvbWFpbi5jcmwwHQYDVR0lBBYwFAYIKwYBBQUHAwMGCCsGAQUFBwMJMB8GA1UdIwQYMBaAFEjdPe/gPJzfErEw/ZHhwen7l9wIMA0GCSqGSIb3DQEBBQUAA4IBAQCaehJEHzna6onjE8bCCsi7A5NxcQ2Cx85PYs67yxQZ0wMQq1khzxsOJPB7H4SoXlceNMvIxpgPFm/ZcLNdeyjoYOQccH+aS6GRSerYX3COdbtWA4Gjq/sB6ghoUZ74+VbXD3t9Rhrnt7fOMe1llWOcf/eoMmvOrJOrBPrC3ZxZEwyHAgyqEJDn2Z8KXTMUr41jge3KyhxRehflRcYhdXzwmE+8LOHaN7xLEZauOuafyBEVpjVN5UaaOm/v8mTn0TymV2j9R7D8Nycbz1gVeMrOhNW2GODxjvu5IoEHQh/myul28EecKGx05Xprcodr0a8Q6LKJg+ihJMxMrS3YEylp diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.zip Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.zip has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/DevCertTestMIDlet.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/DevCertTestMIDlet.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -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: MIJs7jCCbFegAwIBAgIJAPNUaScSr5cxMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9EZXZpY2VfTWFudWZhY3R1cmVyMB4XDTA5MDkxNjExNDk1M1oXDTEwMDkxNjExNDk1M1owNTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFDASBgNVBAMTC0phdmFEZXZDZXJ0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXZ/GCV/N8foAkCQJfoiwGlwHO+f1lV9zloo0r0zosGtVqItLXKrvXEKylpOVWBygRVVrkl30Y1Cxess4aS1UmZ1rcvwL0jcvwlkZGacJazjtHE4UQuYJz9WRbYOaQxR2SVS/wU2Ptu/mr0ZgqFhgaJ1FzCuBdNaWzx2mGV9az/QIDAQABo4JqxjCCasIwKQYDVR0gBCIwIDAOBgwrBgEEAV4BMQEBAwQwDgYMKwYBBAEqAm4CAgICMA4GA1UdDwEB/wQEAwIHgDAXBgNVHSUEEDAOBgwrBgEEAV4BMQECAgMwgmpqBgwrBgEEAV4BMQECAgcBAf8EgmpVMIJqUQwPMDA0NDAxMDE1MDc2OTU5DA8xNDM3MjU3ODc0MDc3MzAMDzAwNDQwMTEwNDIzNjk4NQwPODUxODA4MzAxNzgwMzcwDA84MzYwMTU2MDMxNDY4MjgMDzM2ODYxNzM4NzAzNzM4MAwPNzY2NjI2NTYyMDM3MzI4DA84NjgwMjIwNjUxODczMTgMDzQ3NTEzNTQ0MzEwMzQwNAwPNDY0NTI4NzEzODY1MDY1DA84NjEyMTU3NzIwMDczODUMDzQwNzQ3NTAzMTI1NjYxOAwPNzQxMDY1MDUxNDE1ODI2DA81MzI1MTM4NTc4MzM1NTMMDzA4ODQ1NDM0Mjg4ODg2NQwPMTY1MTEwMDA3ODE1NTE2DA83NzYwMTU4NDUzNDgyODgMDzIyNTUzNTY4NjA4ODYwNQwPNDUzNTUyMTc2Mzc2MjcyDA8zNTAwNTM1MjQxMzMyMDYMDzg4NzU3ODg4NzM2MTM0NwwPNzgxODA1MjY0ODE0MzQyDA8yNTM4ODg2NzUzNzUxMjgMDzMyODczMzE2Nzc1MDg1OAwPMjA2Mzg1NDYyMTM4MjUyDA82NTA1NTIwNDcyMjIzNDMMDzA2MjQ4NzM2NTAxMzMyNgwPMzM4NjAxODY2NTcwMzcwDA8yNzcwMTgyMTEyODYzMzYMDzA3MDE2MzQ1MzQ3MzExMwwPMDM3MDI1ODcxMzE3ODc3DA81MjMyNDMzODgyMDA0NDIMDzg1NTcwODIzMzAyNjQzMQwPNTQzNDU4MzEzMzc1ODI1DA80MDgwMzUwNTQxODIxNzcMDzcxNjYyMjEzMzMzMjEzNAwPMTAzNzY1NTEwNDcwODQ3DA80NjAxNzgwODEwMTQ0NjYMDzMxMDYxMTQzNzY2NDUyMAwPMDQwMjM1MTMxMDE3NjI0DA8xNTIyMzUzNjA1MDg1NDQMDzc1NjU3Mjc2NDI1ODE3NQwPNjcwNjcyMTIyMzAzMjU3DA83NzUyNjU0NzQ3MjgwMjMMDzQyMTgwMzg1MjE0MjE2NQwPODE0MTcxODU0NjQ4MjcyDA80Mzg2MTIwNDczMDY2MzUMDzY2ODA4ODQ1MjM3NDAxNAwPMjMwMDgyNjEzNDYzNTM2DA8yODA4MTYyMjMyMTExMTYMDzc4MjM3MzE2NzgwMTgwMwwPMDYyNjU3NTgwODMxODMxDA82NzI0Njg2NDc0NTUwNTYMDzgyNTUyODAzMjY0NzQ0MwwPNDU2MzAxNTA4NzEwMDMzDA8xODgzMTg4MjAzNjI0NTcMDzQ4NDM3NjExMDUzNDQyMgwPMjMyMzU0MTQzNDE1NTU4DA84NDc2NzAxNzc3MDI0MTAMDzc4NDIzMTY3MDE3NDY1NQwPNDc2Nzg0NDI1MDE1MTMyDA81MTEzMTU3ODA1NjcxNDMMDzA1MDUxNjgyNDg1Mzc3NQwPNDUxNTA1NjA0MTE3NjQ3DA8wNzc3MzU0MTc0NzcwNzcMDzQ4ODQ3NzYzNTE3MTU1NgwPMTQ4NjM0MzM1MDgzNTgzDA8yMjMxMzE0NzI1Mzc0NzcMDzY1ODQ4ODQ2NzI0MjA1NQwPMzYwMTU2NDYwODU1ODM1DA8zNDc1MTczMjM2NDMwNDYMDzMwNTE3MDA0NDQyNjQ4MQwPMDg4NzMzMjAyMzUzNzQwDA8zNDY2NzY1MjY4MDA1MDMMDzUwODQ1MDEwNjM3MzY1NgwPMjAxNzM2NzEyMDUwNDg3DA80MDMwMDg1ODMwMzE1NTIMDzM4NTUyMDQ2ODA2ODAxMgwPNzIwNDc3Njc4NjM2NDg3DA84MTM4MTc1NDQzNTY3MzAMDzgyNzIyMzc3MzY1NTEzNQwPNjQ3MDEwNTUyMDA3ODY2DA8xODAzMjExMTg4ODY2NzIMDzc0MjEzMzg4MzgxNDIzNQwPNTc1MzU1NzQ4NTMwODgwDA8zMTAzNzAxMTY1NDcyNDMMDzQ0NDQ4NTU1Mzg0NTE3NQwPNzQzNzc1NzA4MjM2NDM3DA8yMzc1MjQxNTg3MTUxMTMMDzI3NzQwNTUzMDE2MzAyMAwPMTgyMzA3MTU2Mzg3MzM2DA8xMDMwMzA2NjIyNjA0NzAMDzE0MTYyMTU3MDI1MzI0NAwPNDY0MDcyMjc2NjQ1ODM3DA80NTUxNzc3NDczMDQ1NTcMDzI2NzYwODgyNjY3ODY0NgwPMzQwNjM1NjMyNTc3NDg0DA8wMTUxNzcwMzI2NjM4MDUMDzgwNzI2ODcwNzY3NjQwNQwPMjA1NzQ2NTE1NTQzMDIzDA82NDU3MzA4MTUxNjcwMzUMDzAzNDEzNjM0Mjc3NTAxNwwPNTc4ODAyODAyNDYzMzYyDA84NDA1MDUzMjE4MjM2MjcMDzA3NzEyNzYxMTEyNjUyNgwPMDE4NzU0NDgwMDM3NDM4DA8wMjEyNTgwNzAzNDE1NzgMDzg2MzAyNjcxNDcwMDYyNAwPMDU2NjQ0MjQ2NjA1MTEzDA8xMjIyMDMxNTcwNTg2MjEMDzgxMDY3NjQ2MjU0MDU1MwwPMTUxMzM1NzUyNTI3NDc0DA8wNjA3MzQyODg0MTgzNTQMDzEyNzYxMjI2NjE0MjUxMAwPODY2MTI0NDU3NzE2NDQxDA8zNDAwNjI0ODY3ODE2NjYMDzA1NzcyMjMwNTE4MzQ4MgwPODMzMzU2NTI3NDI3ODc2DA8zMTA2MjI0NjI0MTM0MzQMDzQ3NDYwODY1MzEyNjA2NAwPMDQzMzIyNzg1MDgxNzM2DA8zNzY0MTAzNzcyODQ2NTIMDzYxNDg3MzQxNDY4MTA3NQwPNjM2NDc1NTgzMDgxNTE4DA8zNzIzODAxMjgzNDAwMzUMDzcxMzEwNzAyNzIwNDcwMQwPNTU2MDA4MTY1MDg4MDMzDA83MjQ4MzQ4MTgyNjY2NTcMDzA2ODA2MTMwNDcyMzg0NgwPMTMzMzY1MjMwODQ1MDUyDA81NDQ2MDI1NjQzNzU0MjgMDzQ4MTM0ODQ3ODAwMjEwMAwPNDExMzA0MTUzMDA0NjcyDA83NTYyMzUxNzc3MDEzNTAMDzIwMTI3NTg3ODMzMTc0NwwPNTg2MTQ4NTYyMzM2NjgzDA84MDQ3Mzc1MjM0NTgzMjYMDzMyODYxNjI3NzQwMjAwOAwPNjU1ODMwNTExNTEwNTA4DA8wNDgwMDc1Nzg2NzIyODUMDzM1ODM2MTM4NDEyMDcwNQwPNTg1MzA2NzU1MjUwMDI3DA81MDU3NjQ3MjQ2MTExNjcMDzQ2NjU2MTc0NTMxMDU3NAwPNDU1MTUwMjI4NjQ3MTc3DA8yNDM1NDY0NTY1MDI4MzAMDzUyMDI4NjUzNDE0MTQ0MQwPMTUzNDA4MDc0NzAzMDE0DA81NjUwNjE1MTEwMjM2MTAMDzQ4MDExNDMwNzIwMTc1MwwPMjQ1Mjc2ODc3MTg3ODY2DA80MDY3MDgxMjM1NzExODQMDzQxMzU2MTA4NTY2MTAxNgwPNDIyMjI2NjEwMDcyMzgwDA8yMTEwNDE3MjU1MjM2MzYMDzU3ODM1NDE2MjQ3MzIzMwwPMDU4MTExMDQ3NzQxMjEwDA82NDUyMTAyMDAxNzI2NDgMDzA0MzEzMTc1MDE0NDA4MgwPODc3NTIxODg2NjE3NzU4DA80NjYxNTgyNTA2MTUzNjgMDzg3NTY4MzA4NjE2MjExMQwPMDQ4NjQzNjM1NzEwODUwDA8wNzg1NzY2NTYzODE4MzUMDzE4NTQzNTU4NTE3MjU3NAwPNDMxNjYxMjc4NTUwNDU0DA8yNTgwNzQ4NjU3MjM1MzAMDzM0MDc4ODYzODA2NzQ2NQwPNjE4NDIzNjMwMTM0NzczDA8yNjgwODQyNzQ0NzAzMjAMDzI4MDgxNDMxMjA2NzM1NQwPNDEyNjUxMTA4MzAxMTYzDA80NTE4ODIxODc4NTcyMjAMDzQ3NTYwODc2ODE0NzY2NgwPMDU3MDAzMjcxMTUyODI3DA8yNjAwMDYzODg2MjExNjYMDzM1MDg3NDQxMDUyMTMwOAwPODM1MDAwMzUzNTcxMTQwDA81MTU3MjAzMDYxMjg3NTYMDzA1ODgzNzY0ODQwNDg1NQwPNDA4NDg2NjQ0NDMzNDM2DA82NTg0ODM0MTIxMjM2NzcMDzU4ODA0NzA1NTM0MDYzOAwPNTA3NDMzMTMwMDY3MDY1DA8yNjQwNjcxNzc3NDc4NTgMDzQ4NTEwMTM4MTY1NjE1MAwPMzEwNzYzMzY2MjIxNDU1DA83NzIzMjMyMTEyMTQyMjQMDzU0ODg4MTU0Mzg4MTY0NwwPNDc2NTYyNTE3NzIzMTE2DA8wMTAwMTQ0NjEyODE4MDYMDzUwNzM1NzA3MDM4MDUyNwwPNTg3NDQ3ODIyMTExNTA2DA81MzY2NTExMjI2ODc0NzIMDzIxNDc0NTAwNjU0NTcyOAwPMjg2MTY2NzUxMTA2MzA4DA8xNjg3NzA1NDQ1MTIyMTcMDzM1MjU3MzcwMzQxMzU0MwwPMzAxNDEwODc4NDI2MjE1DA8zNDY2ODQxODUwNjgxMjMMDzUzMzA2NTMyMzEzNjI0NQwPNjA1MDE3ODUyNzU1NDM1DA80NzcxMzg3NTc0MjM2NjgMDzY2NzA4Mjc1NDUwNTUyMgwPODczMjQ1MTM4MTAwNDAwDA81NTc1MDI0ODczMjQ1NzEMDzI1MTEwNDAzMTcyNjI1NAwPNjI4MTA0NTEyMTU0MDAxDA80NzQzMDM1MTExMjI1NDUMDzQ4NDY4ODc1MDg2MTI4MgwPNTMxNjY0ODAxMjA3NjY0DA80NDc3NjA0MDUzMjM1NDcMDzgxODA2NjQ0MjgyMzQxMQwPNDg0NzQ1NzUzNTcxNTAyDA83MDM1NDE4Mjg3NjUwNzgMDzA0NDAwODczMTEyNTY0NAwPNTM0NTAzNjE4NTA3MDczDA83MDQ0NzE4NTE4MzQ1NDYMDzM0ODEwNjMzMTUyMDg0MgwPNzY0MDY3NTYyMjM1MjA0DA80NzQwMzEyNTI1ODE3NDUMDzU2NzQzNzQ4MzY2MjQ0NgwPNTIyNzM0NTg4MTY2NjE4DA8zNDU1NTQ0NzA0ODgwMjIMDzAzMjMzMjAyMzYyNjQzMAwPNjUwMDg0NDc1NTU1ODYyDA82ODE0ODA1NTM3NzM0NzcMDzM0NzMyMDI1NjE3NDg3MgwPMTA0NTIxNjY2Njg2NjI4DA81Njc2NDg1MTM3MjMzNzMMDzU4NzUxNzg4NDA2MzAzNAwPMjI1NTI3MDAxMTYyNDU1DA8zNTc2MjQzNDc1Nzc0NTAMDzY3NjQyNjQzODc2NzI0MAwPNDg2ODM0MTAwODA4NzU3DA8xNTg1NjY0NDM3MDA2ODUMDzY0NDY2ODE4MDU0NzY0MwwPMDQyMzU3MTQ3MTgyNjY0DA80NTA3NTQzODQyMzA2MzEMDzA1ODA3Mjc4MjIyODI4MwwPNTY1NjE1NjEwMzQxNzYwDA84NzIzNzIyODc0ODIzNTIMDzYzMDE2NzY0ODE1Njg4NgwPNjEwNDAzMzg2MDUzMTY4DA8zODA1ODQyMTE0ODEwNjUMDzExMzg0NTM0NDY3MjI1NgwPMjY2NDY1MzEzNTUzMjg4DA80MDExNTc2NzMyODAyMDcMDzc2NzI3NTQ2NjM0MzA3MgwPNDczMjY2NDY3MTU3NjA3DA8wMjY2NTQ2MzA1MzEyMjUMDzYxMzU2NjgxNjExMzg0MgwPNzE1MTE2MjE2NDI1NzcxDA8wMjY4MzcyMTQ2MDMyMzMMDzE2NjM2MzY1MzE3ODUwNAwPNjgyNDAwNjExMzQ0NTM3DA80MDE3NDM0MzMwNDI1NDYMDzY0MDc0MDMyNDg4MDgzNQwPNDU2MTQ0ODM1MTg2MTYyDA8xODI0NTYyNjI0NTcwMjQMDzQwMzEzNjc4ODY1NzI0NgwPNzUyMjE3NjI3NTQxMTIxDA8zMTcyMTQxNTgyMTYxMzgMDzM2MDI3ODA3MjA3MTA0OAwPMDU4MjA4MDgzMjg4NzIwDA80MTgxNDgwMDUyNzc2NTgMDzM0MTg1ODQyMjgwODYzNwwPNTU1MzIxMDI3MjMyNTE3DA83MjYyNjY3NTQ2Mjc2MzUMDzQwODc2NTg0NDExMzQ1NAwPMzAzMzc2ODIyODg0MTc4DA80MDE3MDI0NTMyMDYyNzQMDzIxMTcwNDc2NTE3MTIzNAwPMTg0NzEwMDY3NzgyMjAzDA8yNjIwMDAyMDQ1MjI1NjQMDzg4NDI0Nzg4NDI3Mzg4MAwPMTIzODAyMTI0Njc1NDA4DA8zMTczMDYyMjY4ODIwODQMDzQxMzc2NzQ4MzEyMjQ2MwwPMjc3MDU0NDI0MDQ3MzgyDA8xMTYwODA4NzU2NjE0NzEMDzE2MzY3MTIzNzg4NzIyMwwPODc0ODI1NjYxMTczNTU2DA80MjU1MTg0NjA2NTI2NzIMDzA1NzMyNzU0NTgxNTE2MAwPNDIwMzU0MzA3MzI2MzQwDA83NjQzMjYxMTc0MTQxMzcMDzQxNDEzODIyNzQ1MTc3OAwPNDE0MjE4MjQ3MzI4NzEzDA81NTAwNzE0MjIyMTE1MTAMDzE2MjcxODUwNzQ1NjYyMQwPNzE0NDc3MjI4MjAzMzE0DA80NzgwODAwMDAwNTg0MzcMDzI1NjQ4MTY1ODQzMzQ0MAwPNjYyODU0MzU2NjY4MzQ1DA8yNDE2ODY2NzY1NzI1NzgMDzUwMzIxNDE1MDU1MTU1MgwPNjAwNDU0MTI1MDU4MTc3DA83MjYxNjQ2NzY3MjMyMTgMDzUyNjMxMDMwMjMyNDA4MgwPNjgwNTEwMzE1NzI3ODgyDA80MjY4NzgzODE1MTcxMjgMDzQ3MzQ3NzI2MzM1NjAyNwwPNDgxODE4MDg3NTMxNjE4DA82NTIzMTY3NjY1MDg1MzIMDzM0NjgxNTI1NTcxNjc4MgwPNTcyNTY1ODQ4ODM2MzA2DA81MzMzNjQ3MzAyNjM3MzcMDzAwNTI1MjQ2ODEyODA2MAwPNzYxODIzNjM0NjA2NTQ0DA8yMDY4NDA1MzQ1MDE2MjUMDzgyNjg3MDExMTA4NzQ1MAwPNzcwNjUzNDE4MjE3NDU4DA83NjM0MzY4MTI4NDg3MjgMDzA2MjYzMjQyNjM1NTI0MAwPNTUzMDY1MzQ2NTU0MjQ2DA8zMDE3NjQyMjQ3MzA2MDEMDzM3MTUxMTM2MjQxMjA3MwwPMDgyMDg3MTc0MDA2NjA4DA8zMTg1NzQwNjA4NjA1MTgMDzQ4MjQ1MjIxMTUwNzIxMQwPNTQwNTAwNTQ2NzcyMDI2DA8xNjczNTAwMDQ2NzAzNDYMDzQzNTExMzIyMjE2NTExNgwPNjY3ODMzMTY0MTM0MTYwDA81MTI2MzYxNDEyNjIyNjcMDzcxMjA2ODA3NzUyMzMzNQwPNjY4MDMxMDc1MzU1NzU2DA82NTM3ODgxMzI1MDUxNjgMDzg2NjIyNTgxNzI3ODMzNgwPMjg2NTg3NDc2NjM0NzMzDA80NTQ2MTQ0MzU2MzY2NjIMDzQxMzU3ODEzMjMyNzgyMAwPNjMxMzQ1MzA2Nzc1NTQ0DA81ODA0NDczNDUzMjgzNTgMDzY1NTI1NTU4NzYxMzQ4NwwPMjUwMjAzODUyMTM3Mjg0DA81Mjg3NDYzNjg1MjAwNDgMDzIxNjE1NzQzODM0ODA3NgwPMjEzMzAzMTE1MzEwNzM0DA8zNzUwNzg0NDgwNDcwODAMDzM3Nzc1MTE3MzExMDc3NQwPODE0MDAyNjIxMjIyNDUyDA81NzY0MzM2NjAyNjMyNTAMDzIzNDAyMTI0MDExODA1NgwPODg3NjE1Nzg3NzEyMTAzDA84NTUzNTYxODA3NDE2NjgMDzc3NjA4NzgwNzgyMjE3MwwPNjU3MTg1NjcxMjIwMTI4DA8wNTU2NDAyNTQ4NzU3MTEMDzcyMDMyMDE0MjI3NjU1MAwPNjE2NTgzMDcxODIyNTc0DA81MTEwNDQ0MzEwNjg0MTAMDzgzMDg1NTM2MTAwMTQ1NwwPODAwMjA0NDAzMzAxMDI2DA8wNDM0NjIxNjg3NTE3NzUMDzI2MjYyMTc4NzgxNjQzMgwPNTc1NTU1MTQ2MTIwODY4DA8zNDEzODI1MTYwMjI0MzUMDzE2NTgzNzE2NDM2ODAyMgwPNzY3Njg0NzI2MTE3NDA1DA8yNjM1MzU4NDExNTEzNzAMDzAyMzAyMDE3NjM4MTI2NwwPNTg1MTI2MjgyMzgwMDQ3DA81MzgxNDI2MTgyMDM2MzQMDzczNDM1NjA1NTEwODIwNwwPNjA2NTA3MzE1MTE2NjE3DA8xMTgyMjA2MzYxNjEzODUMDzQ2NjY4MjE1NzIzNjg4MQwPNDUwNTc3MzI0Nzc4NzQ3DA80NjE1MzAwNTIxMDAzMjUMDzM1MTc4NjY1MzQ2NTYyOAwPNjIwMDE0NDM4NzMzNTM0DA8yODQ1MjA2NTE4NjM3MjAMDzUwODA1NTQwMzM3MDEzMgwPMzIzMjI2NzM3NzY4MTY1DA8wMTQyNDcyMTM2NDA0ODEMDzI0MDYxNzgzMDc4MjU3NQwPNDc2Mzc2NTY4NTQ4MDcwDA8yMzY4MzI4ODMwMTYzMDcMDzIzODYzODI3NjIzNzA2OAwPNTA3NzYxNDc1NDQ4MzUwDA83MjgxMDAwMzAzNzY3NzgMDzU2NjMxNDU3MDU1NTA2MAwPODY4NzExNjIzMTc0MzMwDA84MTQxMDgxNzU2NTI3MjMMDzIyMTc0MjQzMjY1NzM2MQwPNjA3NjgxMzYxNTgxMDU1DA83MzMwMDE0MDE2NzQ4MzgMDzY0MDQwMDUwMzA2MjI1NwwPMTI3NDI0MjQ0NTc4MzMwDA8xMDcwNjM1MTc3NzIwMjUMDzQ1MDUyODE3MzU1Mzg4NwwPNzE1NTExNDYyMDE2NzczDA8zNjQ4NzcxMzAzODExMjgMDzEzNDAwMTQ3MDI0MTE2MAwPODAzNjQ2NTE1NTIzMTUwDA8wODcxNDI3ODc1MTA3NjAMDzM0MjI3ODcxMjM3MjEwNgwPMzc0MDA3ODMwNjcxNzU2DA83NDY1MzE1MDAzMDU4NjcMDzEyNjM2MjQ4MzUzMzA1OAwPMjMzMjIwMDI3MTE1NTE1DA80MTQzNjMwMzc3NzA1NjYMDzM1NTE1MjEyNDAwMDg2MgwPODQwNzczNDU1Nzg1MTgwDA80NTc2NDQyMDExMjIzNDYMDzEzMzg3ODMyMjgyODU4MQwPNzM0NDQ3NTMyNTAzNTIwDA8zMTAwNDQyODYyNzczMTEMDzI4MTY3MDY2MTIyMzE0OAwPNTAyMDI2ODE1NzE4NDI3DA8wMzA3Njg1ODE1ODI2NDEMDzI4MjQ4MDYxNDU1NzMxMwwPNDU3Njc0NTU0MzI0NDA1DA84MTc0MTc2ODI4NTcwODEMDzMwNDE0ODI1MjEyMDY2NQwPNTEzMzExNDMzNzA1Njc2DA83NzUzNDI0Njg0MTI3ODEMDzM0NzgyNTczODc3NzA0OAwPNzIzODQ3NDYzMDQwNTI4DA8zNTI0MzA3MDc2MDYxNTIMDzc3ODgzNDU4MTI0NzQxMQwPMzQwNjIyMjMxMDg1MjM4DA83MzQyODIwMzU1NjA4MjEMDzgxMzgxMjY2NTI4NzQwMQwPMjI4MDI4NTExODUwMzI1DA8yNzgwNzE0ODE4MDIzODAMDzM4ODg0NTU0NTcwMzIzMgwPMDgwMDE0MzUxNDM1NTEzDA8wNzQzODUxNjcwNTUwMDcMDzQ2MzQxODM0MTUyNzAwMgwPODAzMDcyMTM2NDI0ODg3DA80NjAxMjMwNjgzNTIyMTcMDzMxNzAwNjU1MDE0Njg1MwwPMTcwMzIyODAxMTY2NTgwDA83MTM2NDU4MjI2Mjg4ODMMDzA3NTA0ODc2NzgyNjg3OAwPMDQ2MjA2ODYyNDY4NTgzDA8wMjc3ODM2MjgzMzgyNDYMDzIzMTY3MjA0NzAzNjc1NQwPMTUzMzIxMTQ1MzAwODQwDA83MTIyNTMyODQyNTExNTMMDzYzMDMyNjcyMjU3MzQzNwwPNzY0MTIwMjEyNTc2NzUwDA82MzUyMjczNzYxMTU2ODYMDzI3NDc2NDYzMzc3MTcyMAwPMzM0ODIzMjM0NTY2MjE4DA8yODYwNTg1NDAyNzM4NjQMDzA3NTg2MDMxODE3ODIyNgwPMTE3MzY3MzIzNTg0NjgwDA80MjI2ODg0MDc2NTE0MjQMDzQyODgxNjA2MjE0MzI0NQwPNjEyMDY3NTU1NzUxMjMzDA8yMTcyODM3MDg4NDY4NDYMDzc4MzgwMDI2NzcyMzE0MwwPNTc3NzY1MTI2MDI3ODU2DA8wODAwMDM3ODIzMjA3MDcMDzM3MzM3NTA1MzY1MDQzMAwPMzg1MjI0MDY0MDU3MzUzDA84ODQ4MjMxMzg0MDA4NzAMDzA3NzQ0NjYwNDEwMjMwNgwPNzM4MjgwMjM1NzYxNjg4DA83NzM2ODAxODU1NjIzMzMMDzU3MDY1MjYwMDQyNTMzMQwPMjQyNjQxNTcwMjg3MTMwDA8wNTc0NjczNDc3NDc1NjUMDzczODIzNjU3MzgwNDU0MAwPMDU1MzIxMzE3ODgzNDgzDA8zNTEzMjc1MDMwMzQwNDYMDzA2MjMxNTQ4NjY3NzI1NwwPMDc0MDEwNDMwMTI2MTY0DA83MDQ4MDE1NDI1ODI1NDQMDzE2Mjc3MjQyNTg2MTgzOAwPNTY4ODgyNzI1NzY3MTcxDA8wNzgyNTQ1NDE2NDM2NDYMDzY3MzE3NzI3ODM4MTgyNwwPNzEwNzU0Mzg0Mzg3MDg1DA8yMzEyNjg1NjA0NzIzNTYMDzIzMDYyNjgzODQxNTg2OAwPODcxMjIyMzI4MDY4NTQwDA80NTg3ODUxMTIyMzY4MjAMDzQxMjQyMzYyNTE1MDYyMAwPMjUwODUzNzExMjAzNDQ3DA82MDExNTcwMzg3NzUzMjcMDzM2NTQ2NDM3MjE2Nzg4NAwPMTU2MjAyMDgyMjQyMTQzDA84MjYwMDQwMzc3NTcyODAMDzIxNTQ1MDIzMjA4NjE1NAwPNTY3MDE4NTI3MDc2NjI1DA8yNDUyMjc0NjUxNjYzMDQMDzc4ODI4MTAyMDQ0MDQ1MQwPNDc2ODQ3MDI4ODg0MTYwDA83NzE0NDY1MjY1NTA3MzUMDzc1NDIyMzg1NTYzNjAxNwwPMTQ0NjE1NTA4MzQwMjA4DA83MjcxNjUwODMwNzgwMDUMDzEyNjQ1MzIyMjMwNjY3NwwPMjU3NTExNzY3ODQwMjgwDA8yNTg4MTA3MzYzNTAwNjAMDzE1Mjg1MjM0ODcxNjU0MgwPMzE0NDE1NzcyODc1NzA0DA83NjE3NzU3MDUwNjg4MzgMDzA0MzU2NzE4NjI0ODI4OAwPMDMzNTc0MjI3NzE3Mzc0DA81MDIyMDY4NjM1NTY0MzcMDzgxODM3ODMzNzE2NDQzMwwPMzExNDI4ODQyNTQxNDEwDA83ODYxNzQyNTE0MDc1NDMMDzM1NDg2ODQxNTAwNzQyNAwPNzg4Njg0Njc4Nzc4NTc0DA8wODc3MjAyMDUyMjA2NzQMDzIzNzQyMTcxODA2NTU2NAwPNjQzNjIwNzU1Mjc0MzM1DA81MTg0MDMyMDY0NzIxNzgMDzA1NzIzMzQ3MjUwNDQyNQwPNTgxMzI2NDY1MjY3NjYxDA8yNzc3ODM1NzM1MDc3NTUMDzg4NTAwMjA0ODc3MDAxMAwPNDczNzIzNjcxMjgzMzE3DA8yMTQzMTgxMjcwODE4MTAMDzA4NDU2ODg2NTAwMjcxMAwPNDc2NjE1MTg4NjAzNjMxDA83MDcwMDcxNzQ1ODM3MTAMDzYxMTUyNjcwMTEzNzEwMwwPMjEyMTczNzM1MDI3ODA2DA8wODgyMzgzMzEzMjA1NDUMDzU1NjEzODEyMjYyNjU4NgwPNTU4NDQyNzQ1ODI4NDI4DA8wNDQwMDIxNDUzMTAwNDMMDzU4MjQ1NzM0Mzc3MTY0NgwPMDg3NTM3NTY4NTMyNTQ4DA81MDI0NjU3NjA4ODg0NDcMDzE1MTUwMzYyMjE2NjM4NwwPMzQ0NzQxMjI2NDU3MTIyDA8yODIzMDU3ODI0NjY2MzQMDzYyNDMwNjE1NTAxMTU2MAwPMzA2NTE2NDUyNjI3NzUyDA81NDMxODc4MTg0Mjc1NDgMDzQwMTE4NzA2NTgxMDcxMgwPODc4MTgzNjE3NDUyMDE3DA8xNTI0NzgzMjY3NjUyNTUMDzEwNDIzNjgyMDY3NzEyMgwPMjM2MDM4MDczNTU3ODU1DA84NjAwMDI2NTczODQ1MzcMDzcxMjQ2NjAzMzAxMzI0NgwPNjU4NDcyMzM0NzgyNDUyDA82Mzg3ODY0MjMzMzg1NDIMDzUyODA4NzA0NjYxNzQxNAwPMjM4NjMwMTM2NzY1ODczDA80NjM1NTc0MTM2Nzg1MjUMDzAxMTQzODU3NzQxMTUxMgwPODYwNzQwMTg0Mjg0MDc1DA8xNzQyNTgzMDEwMzU0MDMMDzc0NzYyNjI3NDg2MzA2MwwPMTcxMDY2NTMwNTg1NjEzDA8zMDYyNDU0MTcwMzUyNDUMDzQ2ODUwMTA2MjEwNzUxNwwPODQ3Mzc1NjUxNzcwNTMxDA8zMDM2NjM3MzY4MzAxNjYMDzc3MDQ2MjY0MTMwNzg4MAwPMDcxNTUxNTMxNDYzMzIwDA81NzAxNTgyMjMyODcwMzgMDzE4NzA4NDUyNTUyNjM4MAwPMjY2NTE1MzAxODgzNTc2DA8yNDc2ODY4NjcxMzYzNjEMDzcxODM2ODAyMTIzNjQwMAwPMDIyNzUzMjcwMDAyODg1DA82MDMxMTgxNjA2NzY2ODQMDzY1Nzg2Njc1NDU2NTM2OAwPMDgyMjE1MjQyMDcyMzEwDA8wMDYwMDM1NDQyMDA1MzcMDzMwNzU2NTUxMzEzNzYxMAwPNTY0MjIyMTA3MjI1MzE1DA82ODQyODIxODg0NTYzNzIMDzQ4NzY1MDYwMTQ4NDMwMAwPNTU4MDYyMjgwMzE4NzQ1DA82NDM0ODMzNjE0NjI0MzIMDzY4MTY4MDExODUwNzg2NAwPMjU3MDMwMjQxNTA0ODY4DA82ODg0MDQ2NDU0NDEyMjMMDzMyMjQ4ODIyMzI1MTA1NAwPMTQ1MzcxODMyMDUxMDQ0DA8yNjQ2MDYzMDMzNjAxMDEMDzg4NDgyMzQ0ODM0ODgwNAwPMTQxMzgzODEyNDU0NTIwDA8wNjA2MTU3NzUwNTM2MjUMDzc3NDQwNjAzMzQ1NjI0NgwPMTQ4MzM3MzE2MTQwNTA0DA81MDU0MzI3NDU3MzY1ODMMDzQwMjEzNzU1MTI0NzY2MgwPNzQwNjI1NDg4NDcwNjYxDA80NDIxMjc2MjQ4ODc2MTgMDzA4NDgxNDgxODMyMTg1MgwPMTg1MDg2MjEwNTY3ODE2DA8xMjUwMjQxMzUwNTcxNzEMDzQwMzg2ODQ2NzMyNjQ0NgwPMjY1MTgyNzQyNjM1ODU4DA80ODczODUxNDczNjA4NTcMDzIwMzU2MjQzMTQ3NzQ1NgwPMzA3NzA2NTg3MTY2ODU0DA80NzQ3NTI3MzE3MzEzNjUMDzQzNjQwNzgxNTgwNTI1OAwPNjYxNjI0MTQ2NDI4NDMxDA80MTI2MjE0NjU2MTMyNTgMDzQ1ODc1NTI2NDY1MDM3MAwPMjcxODczNDE3MTU0NTMwDA83NjM0NTMyMzE2NTA0MTMMDzU3ODYxMzM2MjM1NDI3NQwPMDcyMjc1MzUyNjcyMDU0DA83NzM0NjE1MTQ1NzQyMzQMDzI3MDQ4Njg2MjIyNzI3MAwPNjE3NTYxNDA2NzcyNjQ0DA83NDc3MDc3NjIyMzg1NjEMDzA3NDYwMzA4NzE0NzA0MgwPODU1Njg1NDA1MjQ0NTQ0DA80NTM0NzMyODM1NDU3NzgMDzQ4NTU2Mzc0NTIxNTI0MAwPODEyMDg4MTM2NTY3NDA3DA8xMTU2NzEyMDgzODcwNzUMDzgxMTI0MjE0ODczMDA1MAwPODIyNzU4MTEwNjYxMzUwDA8xNzcxNjU0NTIxNzIyMDEMDzczODM3MjIxMDYyNDc1NgwPMzUzNzY4NjE1NzY3NDM0DA84NTg4NzMwMzU0MTA4NTYMDzcxMDYwMTc1MzczNzMwNAwPMTU4ODAzMTA2NjU4MTIzDA84NTc3MDY4MzQwNzc3MjAMDzI2ODI2Nzc1NjQ2Mzg2NgwPODgxMzUyNjE0NzU4MDgwDA80ODc2MzQwNDE3NTg3NDgMDzQ2MzAxODU2MjQwNzEwNAwPNzg2NTA1ODQ3MzY0NDM2DA8wNzg4MTE3MzEwNTUwNTEMDzQwMjYxNjQyNDAzNzg3NQwPMjMzMDMxNTMzMDE3NDA2DA8xNzMxNTE4NjYzNzc2ODIMDzE1MTc0MzE1MzExNjc0NwwPNTIyNjE2NzM1MzMwMTMzDA82NTQ3MjAwODc2NjA1MTgMDzQ3NTgwMDM1MTIyNzMwNwwPNzExMjYxNTgwMjAxMjQzDA80ODYwODMwMjAyNjQ4NjAMDzE1NjIyMTAzNTIxMDc3NAwPNjEyNjMyNTgxMDQyMDY2DA84MDU2NjM3MzUwMTQ0MDMMDzc2MTQ1MzcwODU0MzI2NgwPMTI4NjE1NDg1NzI0NDIxDA81MjExNDY3NDU1Mzg2NTMMDzAwODM1MzAxNzE2NDgwNgwPNTgxNDQyMTIzMTAyODU0DA8zNjIxMTYxNTcxNjAyMTAMDzMwMzg3MzUxNTAzODc0NQwPNDU4NDU3NzQ2MjIxNjQ0DA81NTIyMjA0NDAxMDY1MzcMDzgxNDI3NDcwNTI4MDMzNAwPMDQ4NjA1NjI2NjU3MDg3DA82NjMwNTUyNzc1MTg0NDIMDzg3NTAxNDA3MTc2NzYwMwwPMzI3ODUyMTgyNzc0NTQ1DA8wNDQ4NzU0MjM2NTE4MTcMDzI4MTExNTcxNDMwNjAzNQwPNDgxNTY1MzU3NTE3NjgwDA8wMTEyMzE3NDI3NTQzMDgMDzIyMTg0MjY4MTUzNTEwMAwPMDYyNzQyMDMzODgwNzUzDA81ODUxMzAzMDUwNzEwNjcMDzM1MTI4Nzg1MDA1NjcwNQwPMjcyODEwODQ1MzI4MDYyDA8zNTg1MzQ4MTAzMzgyMjMMDzQzMDM1NjY2MjAyMzIxNAwPMzY1NjM1NDY4ODM1NjM2DA81MDA0MzY3NjMwMzQ2NTQMDzAyMTE0MDg0MDQwMDYwOAwPMzEzMTMzNjg0ODM1NDgyDA81MTA0NjI3MTgyMjU3NzQMDzc3NTE2MjMzMTY4MTIwNwwPNjQ2MTU0NDQzNzU1ODM4DA8wODUzNzAzMTAzODI0NTUMDzU3Nzc2ODM1NDc2ODg3NwwPMjQ4ODQyNzIzNDU2Mjc0DA8yMDU4NjY2NjE4ODA2MjYMDzE3NTI4ODQxMzU3MjE2MAwPNTA0MzQyMTU1NjIyMzcxDA81ODY2MDE4NzY4MjY1NjYMDzEzMjUxODYyNTgxMTUxMwwPNDIzMDc4NDIzNjcyMzUyDA8xMTQ0NzczMTI1ODY2NDEMDzU2NDU4NTM0MTgyNDgyOAwPMjU0MTE4NzY1NjQzNjI0DA81NjA1MjAxNDUwNTUwNzAMDzg4ODQyODI0NTcwODIwNgwPNDM1NzY2MTE0MTc3NTQxDA8zNjY4MDQwODQ3Njc0MzMMDzE2NTgzODY2NTU2NDU0OAwPNzA1NjgzMTg4NzU1MTczDA84Njc3MzEwODMwNDAwMDIMDzA0MTg2MTg2MTQ3NDA4MwwPODIxODQ1NDAzNDA3MTUzDA81MzExNTQ4NTcxNDMzNjEMDzA0MTgwMTUwNDQ1MTAxNgwPMDAzNDUyNDc2MDYyNzc2DA82ODE1MjMwMTAwODYwODYMDzMyNTAzMTUyNDM1NTY1MgwPMTczMTI2NDAyODQ3MzAzDA8yMDMzNzc2MTU0ODM0NjEMDzUzMDIzODA3MDQ3NTQwNwwPNjYwNDUxODIwNTMwNDE4DA83Mzc0NzQ1NTQ2NjQyNzgMDzAyNjAzNjc2ODgzMzMzMgwPNjA1NDIxNjg2MDYzODAxDA8wMTYwNzI3MjUyNTIyNDQMDzg3MDYzMDQ3MjMwNTQzNAwPMDMyODAwMzQ3MzE0MTgzDA8wNDg0NzY3Njc2NDY4MTIMDzM1MDMxMjEwMDE2MDA0NgwPMTU3MzM0NTg3NTQzNjUwDA8zMjExMTExNjQxODQ0MDUMDzI3NTU3MDA1MzI1MjA2NAwPMjU3NjMwMTAyNDg1NjE3DA82NDU3NDYzNTgxMDYwNzAMDzM3NzgzMjIxMjM3NjQ2MAwPMjE2MTc2MTE0MTUyNjM1DA80NjgyNDMwNTQ4NTM4MTMMDzc4MTM2MDEzNTI1NTU2NQwPODcwNDEzMTcwMjg1NzU2DA83MTE3NDQ0NDE2MzQwNzEMDzEzNjE0MDAwNDU2MDIxNgwPNDA4MjQ4MjEyNDg4MTUwDA8yMjY1MDU3NTE1MjgyODgMDzY0NzU4MzcwNTAzMjYyNwwPNjUzMjQ1NDMwMzg4MDUzDA8wMTQ4NjUwMDMwNDUxMjAMDzIwNDA2MDA0MjY0NDAzNAwPMDM0MjM4MTUzMTg4MjQ0DA8yMjg1MjQyNjcyMTU4NjAMDzQ0MzE4MDgwNDI2ODUxMAwPMzM0ODA1NzUxMzg4MjU3DA81ODAyNDA1NzY2MDY4ODcMDzg0MzAwMDQ1ODY4NTA1MAwPNTY4Nzc4NjY3ODExMjcyDA8zMTUxMTcxNTIxMzQ2NjEMDzg0NTQ3NDMxMjQyMTYxNwwPNDYxMDIzNjQyMDgzODMyDA8yMTQ3MDM2MTg0NjM2NTIMDzM0NTQyNTIyMDU1MjQ3NwwPODMwMDUzODczMTA2NjcyDA8wMDUyMjEwMjc4NTE2NDgMDzE1MjY0Nzc1MTE1MTM2NAwPNzI2NDQxNjM2MDYwNzMzDA82ODU3MTgzMTIwNTA1MzEMDzI2NDM1MDIzODI0NjI4MAwPNTA0NDU0MzYwMTMyNDUyDA84Mzg0Mzc1NDI1NzA2MjQMDzQyNzQ2MDQ2NTE1NDAwMwwPMDQzODExMjEzNTM3NzYxDA84MTE4NDc3MzA4NjE0NjgMDzUxNTI1Mzc0ODEzMTQwOAwPMDQ1NDU0MDg4NDYyMTUwDA82MzE2Nzc4MTYwNTE2MjUMDzU4MzI4MjcwMTEyMTY0NAwPMzgzNTg0NzQ3NTM0MDE2DA8xMDIwNDY0MjUwMjU0MjQMDzU3MDA2NjIxNDQ4NTE1NwwPNDU4ODY4MTg1NjI4NDA4DA81ODUyNTg4NjYzNDY3NzgMDzUyNzQwNTYxODY2NDc0MAwPMjc0MjY4MTczODA3MTE3DA83NzY2MzcwNDY2NDA3NTQMDzUzNTEzMzMzMTM2NDA1MwwPMTA1MDYzMDAxMjIxNjUwDA81ODMzMTY2MjA2NDc3NzcMDzQzMzM3NDYzMDMyMTU2NAwPNDcxMjA0MzgzODAxODg3DA81NjUwNTIxMjU1MzUxMDYMDzM2NTMxODEzNzA2NzMwNgwPMjQzMjg4NzgzMjY3NzI3DA8zNzQxMDg2MjYxMDAxMjQMDzc4MjA4NDIyNzUwMDM3MQwPMzU0NzU3MjYzNjAzMzg1DA83NDM3MTU2MzAwODAwODYMDzM4MzIzNzc3NzMzMTE3NwwPMzU2MjIyMzUwMDc2MTE3DA84MDIwMzQxNjcwMjU1NzcMDzU1ODE1NTI1MjM0NDQzMwwPODE4ODcxMTQ0MDQxNDY3DA8yODQzNDI1NjAyMjg1NzcMDzA0NTQyMDcxNjEzODAwMAwPNzQ4MzgxMDQyMzIxMzgxDA8zNzE1MjA4NjI3MzMyODgMDzMxMjgzMjQwNjYxMzA1NQwPODA1ODgzMDUzNDIzMzUzDA8zODEzNzQ0NzI1MDQ4MjYMDzU2Mzc0ODE0NDI3MjU0NgwPNjE2MTA3Nzg1MTcwMjg1DA8wODQ4NjY2MzI1MTEyODAMDzMxNjEyNzE4NjUxNzgzMwwPMTAwMjQ2MTE1MDU0NzgzDA84NzQ3MTgwNzEzMzc0NDcMDzA1MzQ3NzgwMTEyNDEzNQwPNzcwNjM0MjQ1MzM4MTM0DA82MTQ2NzUyMjY1MzcwNDYMDzU1NjA4MTM4MDMzMTQ0NgwPNTgyMzI1NzU1MjU0MjM2DA8zMzAyMTI1NDcyNjQ0MTMMDzE1NDg3MDE0ODcwNzMyMQwPNTI3Njc3ODIyNTUxNjE1DA82ODY0MDgzNDE2MTQzNTAMDzQyNTAyNzM4NjAxMTc4OAwPMDg0MDExNDg4NzQ4ODY1DA81NTgxMjUyNjg0MzYwNzYMDzE0NzEyODE3NjczNzUwNgwPMzEwNzAzMjI2MTQwODE3DA8yNjA2NjAwODQ0NzQ2MjYMDzEyMjMxNjgzNjUwODE4MQwPNTAzMjA2ODI0MTc1NDY1DA8xMDY3MzIzNDE1NTg0ODcMDzgyMzI4NDcxMjIwMjg0NgwPNTIwMjUxMTIyMTU0MDM3DA80NzE2NTIyMTMxMTgyMTEMDzYwNzAzMjU4MzAxNTM4NQwPNzM4NjU2NjUwMzYyNTQwDA81NjQyNzUwMTg0MTI4MzUMDzU4MDIwNDM4NDg2NzM1MQwPMzYxNjA2NTgxNDU4NzczDA84MTAwNTg0NjA0MDY3MzgMDzA1ODA0MDAyMzMxMjE0MgwPNjg0NDY0MzQzNzg0MjQ3DA8xNjU1NTgxNjIzODQwNzEMDzU0ODA1MDgzMTY0NDczNQwPODU1NjY2NTI4ODM2NTUyDA82NjE0NjcyNjMwNDYwNDgMDzYwMzUzNTMxODEyNjAxOAwPMDE0MjM2MjU1MDM2NzEzDA84NDQ1MjQyNzYzNDc1MTQMDzY3MDc4MzY3MjYyMzYxMAwPMjY4MjU1NjgzMDcyNDc3DA8xNzUyMTY1MzgyODg4MDEMDzg2NjQxMTI0MDc1MzM4MgwPNDg1Mzc4MDgyNTQ4NTY3DA84ODU3Nzc2NTcxNzc1MzAMDzgxNzQyMjcwMjQwNDYyMwwPMzI2MzcxMzYwODcxNDAwDA8yNDcyNDg1MDA0MDY4MzcMDzA2MDE1NzIwNTQwMTIzMgwPNjgxNDMwNDEyMTA4MDE3DA82ODQwNzM0Mzg4MjgxNTgMDzU0MTI4MzQ3ODQyMTE4OAwPNjM2NDI1ODYyNTgxODg0DA84NzM4NjQ4MTc2MDA3NDcMDzM2MTg4MTcyNjQwMTUwNAwPMTM4NTY3ODI4ODAwNjEzDA8wNDE2NDI1MDM2MjUzNzUMDzUxODEzMTQwODg3MDgxMgwPMjcxNTM4ODc2NTEzNzM4DA8xODY4Mjc2MzU0MTEyODEMDzUyMzU4MjQ0ODU4MDUwOAwPMzg1MTg1MTg2ODE1NTMxDA84MjU4MzUzMTc2NDMwNDIMDzU4MzAzNTY0NTgwMzg2NwwPODQ1NTMxMzQ3MTg4ODMxDA84MDUyNzYyODA0MzI0ODIMDzQyMzcwMjAxMDQ4NjUyOAwPMjEwODIwMDA1ODU4MTQ4DA83MzQ3MTA3MjMzNTAwNTYMDzc1NjA2NDYyNTA3NDQzNwwPMjcwMjY1MDMyMTQzMDcyDA8wNjY2NDcxNTQ4MjA2NzQMDzU2NTAxNTE3MzQ3NTMxNQwPNjQ1MjQ3NDEyNTM3NTUwDA81MDY3MjAwODY2NTY4MjgMDzc2MTEwNTQ3NTUxMDYyMgwPNjY4NjMyODg2NzMxNTA4DA82NDE2NzI1ODQxNDUzNjAMDzY2NjcxMjIxODQwNzQ2NQwPNTg0MTIyMTM3MDAxMzIxDA84NDgyMzc1NTQzODgwMjcMDzc1NTg4NzI3MzYxMzI4NgwPMjY1MjI0NDAyNDM2ODExDA83MzMyNjMwMzg3NzAxMzUMDzE4Mjc1MDExMDE0Njc3MwwPNTgwNTUzMzA2MDgxMjA1DA80NzQ2MzMwNTIyMzUzNTYMDzg4NTgxMDYyMjIxNjQzMQwPMjQ1Mzc4ODQ2MzE0MjgwDA8zMzEwODIzNjg2MTM3MDYMDzA4MzQzMTA0NjYyNzE0OAwPMTc3NzgwNTQ2MjQyNzI1DA84NTIyNjYyMDU3MjI0NzYMDzM2NTgxMjg3ODMyMzQ1MQwPNzAzNDA3MTU1MzEzMDcyDA84NzgyODIxMjQwMTAwNjMMDzI1MjU4ODA0Mjc2NDYwNQwPMDIzODAyNjg2NzUyNjI1DA82NDQyMDI4MDUxMjA2ODEMDzE1NzAxMjU1ODU4NjU2MQwPMDM4ODAzNDUyNTU1MTI4DA82Mzc1MjMzNTUxNjUwMTAMDzQ2MjQxNjg3NTI2MjI3MQwPMDEzNjUzODAzODc0MjI0DA8wMTUyNzE0NDI0MzQ4MDcMDzI3NTc4NjcxNjc3MzYwMgwPODA2NDM0MTQ0MzEzMDczDA81NjMzMDEzNTY3NTIwMjMMDzcyMTc3NDI4NzAwMjIzNgwPMTg4ODQzNjEwMzQ2MDEyDA8zNTMyMTE1ODYxNTA2MDMMDzQxMDQyMDA0MzcxNTg2NAwPNTAzODY0NDIxMTg4MDEzDA83NTUwNDI3ODE4MTA2MTQMDzAxODQ4NzI0NjYyMzQwMgwPMDg2MDUxMzIwNDI4MTM1DA84ODcyMDc1NDU1NjA3NDMMDzg4NDQwNTIxMjExNzA2OAwPMDg2MjY4NDY0Mzg3NjA2DA8zODIwMzY2MzQ4NDEyNDYMDzI0NzI1MDExMTI2NTQ2NAwPNDA0ODQzNTIxNjg3NzAwDA8zNjg3MDEwNjcxNDM0ODMMDzgwODA3MjY0NDI2MTE4MwwPNTYzNTEzMDgwNTIzODI3DA82ODExMjczODg0NzY1NzUMDzY3MjI3MTcwMzQxNTcyMAwPMTA3NzcxNzAyMjU1NDY4DA8yMzc1MTQxNzY0MjMwMjYMDzQ4ODgxMzM2MjcyNjMwMgwPMzYwMDAyNTUyNzYwMzE4DA8yMTA0MzgxMDAwNzM0ODYMDzUzNjU2NDY2MDIyNTEwMwwPNDU3NjcxMjM0MDUwNjYxDA84Njg2NjY3Nzc3MDAyNjUMDzI2NzExNTEwMzQ0MjY4NgwPODc2MjYwMzUwNDExNzE2DA8wNjY2MjUxNTExNDMyMTcMDzIzNTI3MTMyMzM0MzUwOAwPMjg1MTgxNjI2NTU2NDAyDA82MDA0NzAwNzE2NzcxMzYMDzE3NDc3Njg0MDA1MTc3MgwPODY4ODczODUyNDI4NjgyDA81NjE2ODQ3ODYyNjczODYMDzMzNTI4MDA0NzMxNjg4MgwPMDM4Mzg3ODMzMzY1NjU4DA8wMzc1MDMxMjc3NTU3NzcMDzc4NzA2NTAwNzE1MDI0NAwPMzcyMjUxMzEyNzYwNjI3DA8wMTcxMjIxMTc0Mzc3MjIMDzM3ODMwMjA0NDU0MDc3NQwPNDgyNzY2NDYyNTYxNzE3DA8xMDY4MDY4MTE3MTg2NjgMDzEyODM3NzQ4NDA3MDE2MgwPMzE1ODUwNDYzMDY1MzIxDA84MjAxNTEwMzQxNjcyNTcMDzY3NzQ0NTQ1NjAzNTcxNAwPNTY0MTQwMjY2Mzc4NzM2DA84ODc3NTc4MzU1NTMxMTQMDzQzMTUyNTcxODI0MjYxNAwPMTAxNTIyNjEzMTIwNTg4DA83MzUyNTczODcyMzIwMzQMDzAyMzQ4NTg2MDQyNzE2OAwPMjUyNDUwNDgzNzU4NjU0DA83MzQ4MjE4MTQzNzcwNjUMDzg4MDgzMTA3ODU3Mjg1MwwPNzUyMDE1MDgxMTQxNTcwDA8zNzc4ODYxMTU4NzMzNTcMDzEwNTgzODcxNDI4NjY0MQwPMjg3NzEzMzE4ODE4NzEyDA8wMzUwODg3NDU4MDI1MTAMDzc2NTU4NTMxMzM0MzI4MAwPNzg1NzAzNjExMjczNjgzDA80MjQ2ODcxMDc0NTM4NTcMDzQ3MTc2MTQ3NzUyMjQwOAwPMTIxODY4NzM3NzY2MTAxDA8zNzg2NzAwMTY1MTQ2NjQMDzg4MDE1MDY2ODIyNzA2MwwPMzQ3NjM2MzI1NzI2MDYxDA83NzUzMTY0ODQ0MzU3ODAMDzU3MjMxODI1ODY2NTcyMAwPNzQzODI2MzIxODg0NjE1DA84ODU4MjQ1NjQ0ODczNDYMDzc1NjA0NjYwODU3NDE2OAwPMjIzNTI2Nzg0MDI0ODM2DA82NjQzMDA3NzQxODA1ODYMDzYwNDAxMDcyNTUwNDQ2NQwPNzY0MDE4Nzg3NjAyNTUxDA8xNDI1MzMyNTQyODczMjAMDzEzNDU3ODYxMTgzODU0MAwPNzM3NDU1MDcxMzEwMDU1DA8zMDMwMDg4MTI0MjU3MzMMDzc0ODU3MzU3MDIwNjcwMAwPNDIxNTAxMjA2MjU0MTE2DA80ODMzNjg0Njc1NDgwNjQMDzUyMTIyMzU4ODYwNzAzMgwPNTUyNjg3NTAxODI2MTY1DA80MTM2MjQwMjUwNzYyNDUMDzU2NjI3NzYwNjMwNzUzMgwPNzgwNTc4MzMzMjgwODA2DA84ODIxNjMwODc1MzIwMjUMDzI1ODI0NTc4NjU3NTcyNQwPNjMwNjIxNzEzMzQxNDU4DA83MjQxMjA1NTU2MzY2ODgMDzUwNzE4MDUwODU1NzA1NwwPNDQzMTY1MTc4ODA2ODMyDA84NDYzNTE2NTc1MDgzMTgMDzM0MDEyNTIwMDQ4ODY2NgwPNzg4MjcwODE2MDEwNjQ4DA82ODEyMjczMDQ2MzE2NTcMDzU0ODYxMDEzODMxNDgyMAwPNDI4NjA0Mzg2MTc2MTIyDA8wNDU2ODQ2MzU1NzcyNTgMDzU3MTEzNTMyMjg4NzIzNAwPNTQ2MzMzMjYzMzU3ODc4DA8zMDgyNzY2NTY0NzM0MDUMDzU0ODQ3MTMzNTM2NTYxOAwPNjY3NjM0MjIyMDE0MTQzDA8yNTMwNTcwMDI2ODY2MDcMDzc0NDUxNDgzNDc3NTA0NAwPNzMxODY2MzA0MDgxNTc1DA82MjU3NjcxNDgwNTc2MjcMDzY4NjQ2NzI4NDI4Mjc3MwwPNDAzMDUwMDM4NTQwMjAzDA8xNTQ3NDYzNzIyNzY1ODcMDzEzMTY1NTc3Nzg2MTE0NgwPMzY4Njc2MDMwMjQyMDMyDA8zMDY2MjM4MzYzNDY1MzMMDzUzNDgxMDc2NzI4MjI2NQwPNjYwMDEyNDA0MjI1NDU0DA8zMTg0MDc1ODYwNzgwMzYMDzMzMjQzMzc1MDg0NDUxMgwPNTA1MjMyMTE0NjgyMDA0DA8xMjYyNjcyNDM2NzQ0NTIMDzQ3NDQzNDYyNjAwMDA4NgwPNTY1MzI1NjMzNjcyNTQyDA8zMjc3MjMwNjUxNDcyMTgMDzcxNjQ2NzEzMDg2Mzg1MwwPMDQ1MDI3ODgzMzQ0NDYwDA8wNDQ3Mjg1MTA0MDE2MzUMDzU4ODgxNDYwNDg1Mjc1MwwPNDgzMzY0ODIzMzYyNjUwDA82NDMzMTUzMTcwMDgxNjQMDzAzNzQwNjEzNjM3Njc1MwwPODYzMjg2MjQ0MzgwMzQzDA80NjMyNzUzODMxNDMwMzcMDzM2NTQ3MzU2MDc0NjMyMgwPODc4MzM2NjY3NzI3NTQ3DA8zMDU2NDYzMzcwNjczNzEMDzM3MDA4MzE1MjY4NjE1NwwPODg4NTM1NzY3ODg3MzAwDA8zMzYwNzUyMTIxMjI3NjIMDzUwMDgzNTM0MTExMTQwNAwPMDQzNjg4NDg4Njc3MTE3DA82NDY0MzIyODM2MTAyNzQMDzE3MTIyMjA3ODIyNDgwMAwPMjUzMDEyMjg0NTg2MjUyDA80MzYyODIxMTg0NzU3MDQMDzgzMDQxNDU4NDM2MjQzMAwPNzY2ODIzNjYzMTI1MDI4DA8xMjAzODEyNjI3ODE3MTEMDzAxNjM1Nzg2NTg3MTQ3MQwPMDMyNzM3Nzg2MjgyMzY4DA8wMjYzMzAwMzcxNDUzMjEMDzgwODcyMzU1ODQ0MTgxMgwPNDI4MjMzMzI1MjQ1MDgyDA8xODgwMzAyMTczODA4MjcMDzI1MjYwMzI0NzcxNjg0MgwPMDE4MzM1MjA4NDAyMDczDA8zODgzNDQxMzMwNjU4ODgMDzAxODUxMjAwMTE1MTY2MQwPMDgzMjgzMTM2NjY1NjcyDA84NjMzODU3ODU0MTIwODgMDzgxNzg0MjQ2MjUxNTA3MQwPNTM2ODA1ODIyNzgxODU1DA8xNDA0NjYzNzY3MzQyMjQMDzMxNDUxMjgwODQzNjEzNgwPNzUzNjY3NTAxMjgzNTE1DA8zMjQ4MzM1MTMyMzEyMDcMDzc0NTMwMTY4NjI1MTg2NwwPMjE2NjMwNzM3NjEzNjM2DA81NzgxODUxNjY2Nzg1NzUMDzc0MjI0MDQ1NjI2MzU3NQwPODA2NDUyMDQyMzI1NDg2DA81NTAwMTExMDgyNzg4MjMMDzQxNTIwNzM3MjM4NDc1NAwPNjIwNTA4NTUxNTMyNDEwDA80NTM4NTYwNzA1NjgyNDAMDzE1NzY1MDIwNDM2NjUyOAwPMjcwNDUyNjc3Mjc1MDc1DA8wMTgyNzE2NTIwMDU1MjMMDzU2Nzg0NjA0NDI0MDEyNQwPNDYwNTgxMDUwNDg1MjM3DA80NjM1NTQwNzgxNjMxMzYMDzQ3ODAwMTAyNTAxMzU4NAwPNDc3NzUwMzEyMDg4NzYwDA84MDU1MzQwMTYwNzUyMDEMDzg1Mjg2MTcxNjQyNzExOAwPNzU2NjA3MzEyMzcwNTg2DA81NTQ3MTQ4NTAwNTQ2NTAMDzEzMzI2ODQ2MzMwMDMwNQwPMjYyNTU0MTYyNTU3NTMyDA80Mjg3NjI4NTc2NDE0MDMMDzg1MzQ1MzEyMTgzNDY0MAwPNDAzMTgyMjU4MDU0NDQ2DA84MzYzODAwNTczODY4MjgMDzIzNDAwODQxMzIzMDIzMQwPNDg4MzE1NzA2MDQ0ODAyDA82MzY4MjI3ODQzMTczNjUMDzg2ODg1MTU3NTA1Njg3NgwPNjY0NDAzMzA4NDIxNzMwDA8zMzI4MTQyNjA0NDExNTEMDzYyNTY3NjcyMjI4MjM1NwwPNTc1NzYwNDAyNjE2NzQyDA8xODQ1NTg4MzE4MzI4MzYMDzg3MDIxMDMxNjM0MjczMwwPNjg1NzQyMDg1MjYwNDExDA83NTY4ODU3NjUzMjczMzYMDzA0NjU3MzQ4MzU2MzYwOAwPNjE3MDQyMTU1ODEwMDgyDA84NTU4NDU4NzIxMjExNTgMDzc1MzYzNzI4MDgyNDIyNwwPNTM3MzAzNzU0MzYzMTI3DA81MzYyNjU4NjQ0MzcwMjIMDzc3MjcxODU4ODcxNDI0MwwPMDUwNjY2MDAwNTgyMzE3DA81MjE1NDY3MDYwMzYzMTAMDzczODQ1ODcyNzU1NTY1MgwPMTE1NTUwNzYxNjcwNzQ4DA82NzcwMDcyNjgwMTQzNTEMDzI4ODU3NTgzNTA1NzI1NwwPMzcxNjIzMjQyMjgwNzQ3DA8zNTU2Njg2NDAwMzgwNzQMDzQxNzExMzQ4ODQ0MDc1NAwPNzY2MzAwMjU4MTI2NzcyDA8xODU1ODE0NDUwMTM2NzMMDzg1ODIzMDY1NjYxNzY2NQwPMzIyNjQ2NzA3Njc3NjU3DA83ODg4ODU2MTAxODczNzIMDzc2MDgyNDcyMDI4NzcxNwwPNTc4Mjc0MTMzNDM3MTgwDA8yNDEyMzMzNDE4NzEyNTIMDzcyMjg3MjQ4MzY4MjA1MwwPNTQ0MDQyNDIzMzU2NDQ3DA83MjI2MDg3NTUwNjQ4MTEMDzM1NTE2NDU4NTcxMzcyNQwPNTE1NDI4NTQwNTQ0NzU0DA8yODUyNzU4NTE3MDc4NDcMDzY0Njc0NjUwMTEwNzQ2MAwPMDA3MDczMTQ1NjU1NTgwDA8wNTIzMTc1ODA0MDQ2NjQMDzUwNTAwMTY3NTg2MjU2MAwPMzEwMzQ4ODA0NDQxNzM1DA8wNzE0NzI1NzA4MTYyNTAMDzYzMjA4Mjg0NDY4MzE3NQwPNjUxNjY2MTgzNDY3MDI4DA8zNDgxMjA0ODI1NzM2NDgMDzE3MjUwODIxMDUxMTg2NgwPMzg2MTI2NTYxMzM3NzMzDA81NjAxMzU2MDYwMjE2ODcMDzI4MjY2NzgzNDUwMTI1MgwPMDIzMjY4NzIxODYxNDEwDA8xNDE4NjgyODg1MTQyNjgMDzcwNjMyMDQ4MDYyNTQ2NQwPNTA0NDMwNzE1MTA4NzQxDA8xNTQ4MTAwMjU4NDMzNTAMDzgxMTY4NjYyMTEwNTY0NwwPODY4NDM0MzU4MDY0MTA2DA82MzE2ODQ2MjMzMDA3NjgMDzgxODc0MzgxMDc2NjY3OAwPMTE0MzQyNDI0NTYwMzE2DA8wODU0MDQ3NjM4NTc4NjEMDzM1MTAyMjcyMjE4NzI0NgwPNzc2Njc4MzE3NDMyNDAwDA82MzIwNDE4Mjc2NzEyMzEMDzc2NDA3MjEzODMxNjEyMAwPNjMxNTUxODMzMTc2NjA2DA8yMzIwNDA4NzQ1NDc1MzcMDzI2NTA2MjExMjEyNjEyOAwPMjc0NDM1MDgyNzIzODYyDA80MDI0NjA0MjAwMzIyNzgMDzgwODg0MTI0ODExODYwMwwPMzAxMDM0NDE0NjUwNjcxDA8wNTc4NTM0ODc1NTg2MDIMDzc2MDYxNTMxNjU4MzAxNgwPNzgxMTgyNDIxNzUwNTA4DA8yMTEzNzY3MDczNDExNjYMDzc0MzM0NzQxNDgxNzI4NwwPMjg4NjE3NTM4MDQ0MjY2DA80MDMwODExMjE0MzE2MDEMDzc3NDU1MDgxNDQwMjYzNwwPNjc2NDQ2NDEyMjUzMzUxDA80NjE4ODQwNDgyMjI0MTMMDzQ2ODcwNDc1MDEyMzM1MwwPNTA4MzM0Njc3NjI1ODYyDA82NTY2MzEzNjQzMDE3MzIMDzcxMzI2NTgyNTUyMDIwMgwPNjIzMTQ2ODM0Mjg3NzI0DA8zODIwNTg3Mjc2Njg4NjcMDzA3MjcwNjYwNzc1MTUyMAwPNDg1NzY3NDI2NDU0MDE4DA84NTI0MDAzNTE2NDY1MjIMDzIyODEwNTgzMDY0MTM3NgwPMDAzNDczMTIzNTYwODcyDA8yMDA1ODA0Njg1NzY0NDIMDzc2MDg3MTc2NzUzNDUyNAwPNzg2MDI4Mzg2NTAyNDE4DA8xMzY4NTAwMTg1NDA4MzMMDzIyMzY1MzA3Nzg0MjQ1OAwPMTI4NzM4MDg3MjcxMzQyDA8xMjA4Mzc2MjQwMjQ0MzIMDzA3NTE3NTgxMzA2MDc0NAwPNjM4NTY0MTAyNTEyMzMzDA8wMjE4MjcyMzA3NDQ3MzUMDzAzMjAyNTQzMjc1ODUwMgwPMDY3Nzc1MTc1MDAzMjMwDA8wNzc1NDc0ODgwMTg0NzIMDzc0NjcwNjczNTAwMzMyMQwPODQ4MzgwODA0MjAxNDExDA8zMTQ4NTYwNTI0MzQ4NjAMDzI4ODAzNDUyNDI4MjQ0NQwPMDIyNTI4NTExNzg2NDQwDA82MDQwNjgxMDg1NzA1MjMMDzY1NTYyMjY3ODcwNTE2MgwPNTY0NDIxMDIyNTI3NzQzDA8wMjE1MjE3MDI1MDI4ODQMDzYzNzgwMTY1NTA0MDc2NwwPMzA3MTE4NDExMTc2NTU3DA8wMDYxNzI3NTM0NDQxMjAMDzU1MzgxNzI4Nzg4MDA3OAwPMzI2MjU2NjQ0MTIyNDc3DA8zNTgyNjQ0NDI2NzQ1NzcMDzQyMTg3MDg3MjMyNDIwNQwPNTE3NTMzMzE4ODY1NTE1DA81MDQ1Mjc3NjI1ODQ3NzAMDzcxNDAyNDQxMjEyNzgzOAwPNTIzMTYxODE4Mzg1NTEwDA8wMDI3Nzg2MzEyMDQ0ODQMDzMzNTUxMDcxMTYxODAwOAwPNDU1MDYwODMzMzMyMjM4DA80NTM4NzExNjE1MDg1MDMMDzQ0MzQ3MjUxNzM4MDU2NwwPNjIwMDM1MDg1MzU0NDcxDA81NjE4NjMzNTE2MjU0MDUMDzE1Mzc4NjYwMDgxNDM2NAwPNzgwMDgyNjEzODc2MzgzDA81Njc0Nzg1NTg0ODczMjcMDzM1NTIwNDg4NTMwMTM3NAwPNDA4MDAwNzU3MDQzODYxDA81NjgxNjQ1ODcyMzIwMTgMDzQ4MTUzMjMxODUyNzM0MAwPMzE0NDI0NjY4Mjc4NDg2DA81NDc3NzIwODcwMDU4NjMMDzMzMjExMTUwODMzODI2MgwPNDU3MjI4MzM3NjAzNzAwDA80ODQyODAzODQyNjg1NTYMDzEzMjMxMjQ3Nzc3ODQ2NAwPNjI3NjQyMDY2NTA0MzUzDA82NTAwNjEyMTIxNjY2MzcMDzE1MTA3ODY0MTc3NDUwMAwPNDEwODIyNDIwNzcyMDg0DA83NjEyMjY3ODYxODU4MjcMDzcxMDMyNTE1MjcwNDIxNAwPODY2NjU4MzA4MjEwMjcyDA80MjI3ODc4NDg1NTg3NDcMDzgzNzcxNDQ4MTI2MTg1NwwPNjM1ODY2MTA1MTIxMTcxDA83NDU2MDExNTM2MzAzNzUMDzg1MjUyNjE3MjM1MDUyOAwPNjI1MDM3NzY2MTc1MDc0DA84NzAyNDIyMjMyMjAyMzUMDzQ0MzQwMDMxNTYyNTY0NAwPODUzNDUyNzgyODAwMzcxDA8xMDM1MTY3NTY0NDgzNTYMDzQyMzUxMzYwNjcwMjUzOAwPMTcyMTAxNDg2MjcyNDUxDA80MzIzNDI0NDg3NjUwMDUMDzc1NjI4MDAxNDU1ODQxNAwPMTE1NjU2ODE2NzAwMDM0DA8wMjc4MjQ0MDc3MzU4NTIMDzM1NzYxNTgxMDYyNTA4MAwPMTIwNTQ4NjUzNTgwNTgxDA80MTI2MDg3NzAzMjI4NzMMDzYwMzgwNjQ4NjIxNTY0NQwPODQxNzE1NjIyMzQ4NjczDA82ODI0MjQ0MDIzNjUwMzcMDzQ0NzQwNTU0ODI1NjI3MgwPMTEwNDQwMTMwMjIyODM0DA8xNTQ0NDMzNzU1NjgzMTYMDzI3MTExNDU4MTYwNjM3OAwPNDIyNjU0MzI0MzM2NjA3DA83NjQ0MTQ1MDcyNDg0NDYMDzE3MzU3NzgxMjE1NDQ2MwwPNzcwNjAwMzAxMzgwNzAxDA80NTM0MzYzNjQwNzIwMjEMDzgzNzIyNTQ1NTUyMjAyMgwPNjAyMzQ2MjIwMjUyODA3DA84MzAyMDExMDQwNjA2MjIMDzUyODQ4NTgzMzg2MDI4MwwPMTc1NDc2NTA0NDQxMDQwDA83MTM1NDE2Njc3NDE2NzYMDzIwODU2NDcwMzYyNDU3NwwPMDA4NDcwMDIxMjg4MDU3DA8zMDAwMDA1ODIwODQ4NzYMDzE4MzI0NzEwNDIwNTQxNQwPMzEzODY2NTA3NTM0NjI1DA8zNzcwMDcyMDgxMjgzMTMMDzIyNzQ2ODIyMjE0MDIzMAwPODE2MjU3MDEyMDI0MjE3DA83NjAyMDMwMDY4MTM3MTEMDzQxMjgyNTE0NTQzMzIzOAwPMzI2MzU2MTE4Njg2NjQ3DA82NTM2NDIwMTcwMzI0MzMMDzEwODQ3MjYzMDAxODc1MAwPNzM3MDI3ODI4NDUzNzQzDA8xODQ4NzI1MjI1NDg1NzIMDzgxNTQ3NTA1MzYxNDEzNwwPNzUyMTg2ODY3MzYzMzMwDA82NTM0MzgyNjU0MTQyODUMDzIwMjQyMjI1MTA1NzQ1MQwPNzE1MzQ1MDI2MDY0MTIwDA8xNTcwNjc0MzM4MzA1NjUMDzcxNDcyNjIzODQ4MTA2NwwPMjg0NjM4NTY3MjM1MDYwDA8yNzQ3NjAzNDc3NTMwMzEMDzIyMTYzNjgwNTE3NDAzNQwPNjgzMjI2MTEzMTUxODA1DA82NTgwMzE2NDIyMzU0NzQMDzYyNjQwNzYyODAyMjAzMwwPMjIxMzgxNDgzMTMyMzI3DA8xNjU2NzEwNTI3ODI1NDgMDzY1ODgyMTU2ODU2ODY2NAwPMzY3MTU3NDUxMjIxNzU3DA8zNzMzMzUyNTE0MDgzODYMDzcwNDYwNjYwNTEyNzA3MwwPMjgzODg0ODU2ODI1MzA3DA8wODQzNzIyMzgwMTYxNzMMDzM3ODAyODExNzgyMjE3MgwPMzU3MjQ1MDI3MDQ1MDM2DA82NDUxNzAzNjg2NDQ3NzUMDzE1MDQyNTY0MDAxMTUwMQwPODYyMDMzNDQwNDgxNDcwDA82NzE4MDgwMTU1MDUxNDUMDzQ0NDI1NjQ3MjA1MTQ1MQwPNTU0MjM1MzI1NTg2MTIzDA84MzQ1NDUwODgyMjA3MjEMDzc4NjU1MjIxODYwODIxNQwPMzgyMDU1NjIyNTE0ODMwDA81MDMyNTMzMzExNDcyNjcMDzAxNDc2ODA4MzA0MDgzMQwPNTE0MzY4ODgxNDQxNTI0DA84ODMyMTUzMDMyNTQxMjUMDzAyNDQyNzE2MTIyMjg0MQwPNjI1NTYyMTQ3NDc2NDA2DA84NzM4NTA2MTgxNzc3MTMMDzIyNjM2NzU0MDczNjAxMQwPMzYzNjA4NDQ0Njg4MDEyDA80NzMzNzYzNTAwNzc2ODUMDzY3NTA1ODUxMDY3NDgwOAwPNTc1MDM1NDYxMzg2NDEyDA80NjU4Mjg0Mzg0NjY4MTgMDzIwNjE2NTg4NjU1NTczMAwPMjUzNjQxNDQzMTEyMjA0DA8xODE1MTE0MDI3NTA4MzMMDzU2NDYxNDQ1MTAxNTM3MgwPMDEyODQ2MzI2NjM2MjUxDA8zNjUzMDg2ODgwNTY3MjYMDzg4Njg2NjA2ODEzNDQ1MwwPNjM4ODMwMzEyNDA4MzgwDA81NTUzNzA4MDc2NTI0MDcMDzE2NDY0MTI3NzE1MjM2MwwPMzg3MTA2NTg4NDQ2NjEwDA8xNTIxMTc4ODY2NjI1MjYMDzU0MTU3ODIyMzQ1MjEwNAwPMDQ3MTMwODYwMzU0NDA2DA84MzQ2NDA3NTI4MDQ1NTcMDzExMDc4NjcxNDQ0NjI1NwwPMzUwMjEyMzAzNjgwMTQ0DA8xODc4ODI4ODQ3NDIyNzYMDzg1MzU1NDg4NTg0NTMxMgwPMTQ2NzY3MjI0Njc1MTY1DA84MTY1MjEwMjU0MjIwMTUMDzM1Nzg2NzMzNTczMTc1OAwPNzQwMjUwNTgyMDI3MzM0DA84MDcwNzA0NzUyNDA3MTQMDzcyMDA0MDI1MTgwMzczNwwPMDMyMjI4NzU1ODA3NDcwDA8zNDY0NTQyNzA1NDIxNTEMDzQ0MTMxODAyNzA4NzMzMAwPNjg2NjEyMDgyNjEwODg3DA8wMzUwNTY4NDQwNjA4NzMMDzUzMTc1NTQ4NDg4MTQ2MwwPNTc0ODA4NDUyMzU0MjU0DA8zODQyMDUwMjU1MTUwNTEMDzgxNTU1NDAwMjg4ODgyMwwPNjg0MDMzMDYwMTc4MzYzDA8yNTE3NDc3MjU2MTEwMTIMDzUzODQ0NDcwNDgzMjUwNAwPMDY2MzUyNTQzNjQwNTI2DA8xNjY0NzU1MTAzNjAwMjIMDzMwODE3ODA0NjI3MDQ2NgwPNTEyODQwMTI2MzUzMjYzDA82NTU3NjY3NzE0NDU2NDYMDzIyNDc3NjQ4MDE3NTc1NQwPNDc2MTAwMjYyMDMwNzQzDA8xMjE1NTExMDc3MjYxNDcMDzExNDc2NTMyMDU0MDEyNQwPNzY1Mjc2Njg0MTE1MjQ1DA80NDc1Nzg1NDgwMzEwODAMDzQ0MzgyMDY0ODQ0MDYwNgwPMDg3MDAwMDgzNjIyMDMwDA8yNjg4NDM3MzYxNDM2MDUMDzgzMjMxNTM4MTQ3MzE0NgwPMzI2Njg1MjI4MjYzNDM3DA81ODgxODAxMzUwNTEwNTAMDzQ0NTEzNDYwMDUxMDA1OAwPMzI3NzQxNjUxNjU3MTU1DA80MTYwMTgyNTQwMjg1NDUMDzQ3MDE2MDE3MTE0Mzc3OAwPNzYwNjAxMjU3NzgwNjgwDA80NjE1MzQ4NDU1NTU3NjcMDzU2MjIzMzYxMzAxMTcyNgwPMTQzNzE2ODMxMTg4MjI0DA8wNDM3ODQ3MzU2NDYzMzEMDzg1MDU3MzQ4ODEyMTYwMAwPMzEzMTA3MjIwMjM0MjMxDA83NTczMDcyNjE2NTMzODIMDzE2MTEwODYyNjY1Nzg2NAwPNTUyNzUxMzAyNDA3ODg1DA8yNDA2MTg2MDc1NjEwMzgMDzA0NTA2MzcwNzQyODQ0MgwPODUzNzA1NTIwNTYwNzY2DA8yNTI4NTI3NDU2NTQ4NDUMDzMyNzE3ODIxMjMwMjc1NAwPMjMxMzA4MTE0MzU3MjE3DA8zNDQ3NDU3ODY4MzIxNzQMDzI0NzM0NDc3MTI4ODE4NwwPMzM2ODEzODAxMTUxMzg3DA8xMTU4MjU1MDAxMzg2MjIMDzQxMTcxNDQ4MjAwMjAyNQwPMjQ0NDU1MjYyNjA4NjIyDA8wMDUzNDgzMzg3MjI1NzYMDzY1NzM2NzExMTc4NjYyMQwPMDE2MDU0MTIxODY3NDcwDA8xNDU2ODcwNDY4MDEzMjAMDzIwNTg1MjYyODE1NzA4NwwPNTIyNDY4MjQxMTQ2MTU1DA8zMzY2MjMyNTY4MzczMjUMDzAxMTMzNzg3Nzc0ODU3MgwPMTE0ODU4MDEzMjE4NTIzDA84Nzg1MDc0MjYwMDgwMTIMDzQ2MzM2NDE4NzE1NjYyMQwPNTcwMzMyMDYxMzI1MDUzDA83Nzg1MzA4ODQ2NTMyNjgMDzMzNjgxMjIxNDQ0Mjg3NwwPNjIxODI1MjYxMzMxODQzDA8yNTc1NzU3MTc3MzI1MDIMDzYyNDQ4MjU3NTI4NTAyMAwPMzQ4NDA1NjU2MTUyMjI3DA83NjY3MDAxMzU1MTQ1NzIMDzYzODM0NDE1MjUzMTcyNgwPNjAzMjEwODA1NzIyNzU1DA84NzAxNjcxMTM2ODU3MzYMDzYyMjI4NjQ0NjIyNTM4NgwPODcwNTgyNzYyNTg1MzUzDA8wNDMzNTg2MzAzMjU2ODcMDzc1ODI2NTA4NDQzNTA0MQwPMDM4MjM4NzI3ODUwNTQ2DA83MjYxMzQyMDgzMzYyMTEMDzU2ODM3NTIxMjU1MDgxMwwPNzM0MDQyMzExNDMwNzQ2DA83MDU3NDIwNTcyODU3MDQMDzg4NTA3NzAxNDYxMDc0MQwPODExNDI3NTA4NDgxMTIyDA80MzM2MzQ0NjQxNDU3NjQMDzc0MDAxMzY3NTc4MzE2MwwPODg1MzUwMzI2MTcwMDc4DA84NDQwMzY3MDI4MzYxMzQMDzc0ODA4NzY4NjA2NTcxMAwPODA3NDg3MTU2NzcyNjg3DA82NDY4NzIzNzU1MDU2NjcMDzI4NTE2Nzc0NTgyMDY1MwwPNDY2ODczNDUxODI0MzE4DA81NDg2NzIzMzA3MDgxODQMDzcyNjQ1NjgwMzI2MDI3NwwPMzE1MDM4ODAyMDY1NDgzDA83NjEzMjczNjM2NjM4ODEMDzQ2NjUzMzYyMzg1MjcwNAwPMTQ4ODE4MTQ4ODcxODE1DA82ODQzMDIzNDc2ODU4MDYMDzUzNjEyODQzMzMwMDgzNwwPNDAxMzQ4Njc0ODg3NzE0DA84NjQ1NzU4MDI4MTg4ODYMDzc2NTQ3NzIwMzIzMDEwMQwPMDA4MTI2MjA1Mzc2NzA0DA8wNjM4NjAwNTI4MjY0MTQMDzY4MDg0MTc0Mzc3MTQ2MwwPNDUyMzg3ODU4NjEzNzA4DA80MjYyMjA2NTMwNTIwNTMMDzc3NzM1NDE1ODQzMzg1NQwPODcyNDc2ODQyMzY4NjI3DA82NTQ3NDQ3NjMwNTMyNzUMDzg0NjU2MjMxMTYxNjYwOAwPNzEzMTUzNzM3MTE1MDMwDA8yMDQ2Nzg2MjczMTEzNjUMDzU4MTYwNDcxNzIwNjY0MQwPMTYxODIzMDIzMTUzNjEyDA83MTgwMDM4MDEwMzc4NjAMDzA2ODQyNDc0NTQwNjIzMQwPMzU0NzQyMzc2NDQ4MDU4DA8wODc4MzUyMjc4MTc3MTcMDzQ4ODYzNDEyNjExNjMxNAwPMDA0NDAxMDE1MDc2OTc1DA8wMDQ0MDEwMTE0Mzg0MDEMDzAwNDQwMTAxMTQxOTc0MAwPNjUxODAxNjc4NjQ1MDA0DA8zNjgyMDMwMDY0MDIzMjgMDzAwMDAwNTA2MTY2NTYwMAwPMzczNjczMTAyMjE1ODY3DA81NTAwNjE2NjQzNDcxNzAMDzI3MjgzODQ4NDUzNjcxNgwPMTUyMTM4MDIxNTg0MTAxDA8yMDMxMTA1NjM2MzM3MTgMDzQzNDI3MDYyNzMzODEwOAwPMzY4MTUxODcyMjE0Mzg0DA80NzI3MjI4NzExNTg4ODQMDzYxMzMxMjMwNjQ2MTA1MAwPODgxODgxNzEwNjI2NzI0DA8xNTIxNTE3MjA2MzEyMTcMDzA0MzUwNzIyNzU1NjQyNQwPMTY3ODAxMzIwNjIwMDQ4DA83MDQwMzU4MzEyNTQzMjIMDzQ3Mzg4MDM2MDg3ODE2MgwPMTE3NTQxODEwMDM2NTg1DA83NDIxMjQyMDUxNzYxMzIMDzEzMzg4MTI4NDM1MTUxMQwPNDE1ODcyMjUwNDg4MjYwDA8yMzUwNjIzNjcyODMzMzYMDzQyMTU3Mzc4MjMxMzcxNwwPODU2MjIxNjM2NTQyODM4DA82Mzc1NDI2MTI3MDUxMTcMDzg4ODU2NDAyODYzMTA3MQwPNzg4NDc3MjM1Njg0MjEzDA8zMzA0MjQxMjQ0ODM0MTgMDzI3NTQzNzExMTQ0NzIzNgwPNTMwNjQwNjM3ODIzMjQyDA8xMjExNDIzMjE1ODI0NDUMDzMxNDY2MzMzNjQxMDUzMgwPNzI1NzE2NDI4NDIzNTIwDA8zNjM4NTYyMDI0MjYxMTQMDzIzNTUxNTY2MzI0NDMwMwwPNjI4NzYxMjE4MDA4MjY4DA8xMzg0MDcxNzM0ODY3MTYMDzYzNjYxMzI2MTM3NjU4MgwPNTg3MTE2MjcyMDcxMTEwDA8yNDA1NDAzMDQzMjc3NDgMDzM0MTYxNDI2MDMxMDI3NAwPNDQwNTc4NzE0NDM1NjI0DA82MTc3NzY0MTYwNzUwMTMMDzA1NDE1MTAzNzI3NzYxNgwPNjMzNDU2MzM0NTQ0NjE2DA8wNjU3NzY1NTE4NDQzODIMDzIxMzMzMTU4NTY2ODE1NgwPNTgxNTAwMjY2ODY3NTIwDA81NDMzNDI4NDYwNzc0MzcMDzAzNjM3NTcyNzgwNjc1MAwPMDcyMzQ2ODg0NTU3MDg0DA8yMjcyNzYzNzIzODcyODYMDzEwNDg3NjUwNzUxNTU4MAwPODIxMDY1MTIzNjM4MjU1DA83MjMwNzc1ODA2MTE1MzEMDzI2MDYxNjMzNDIwNzU0NAwPMzU2NTY0NjM4MDYxNzQxDA8yNDY4NzMzNTA3MjgyODAMDzIyNTgwMjIwODI0NzcxMwwPNDQ4MTQ3MzEzNzAwODM0DA82MTYwMzg4NTgzODYxMDMMDzc4NjcyODgzODg2MjA3NQwPNjgwMTczNTYxNzgwMjg0DA81NjA4MzA4NDcyMDgxMDAMDzYyMjM0ODI0NjIzNTY3NAwPNDA3NDc4Mzg0MTExMzQxDA8xNDgxMDI1NzU3MzA3MjEMDzY1MDY1ODI2MTQ1MzE3MQwPMDgyMzU0MjIwNzQ2NzU3DA82MjQ4MjY2NDc4MTE1ODIMDzI3MjI2MTI3Mjc0NDA0NAwPNTIwMjIwNzgwMTc2MTY2DA81MDE1MzI4MDE0MDgxMjUMDzI1NDMwMzcwMDQyODgyOAwPNjc0NDc4ODY4MzQ4MjgxDA80NjMzMTY3NDU1MjcyNzUMDzQ3MTE4NTQ1MDIwMzEyMgwPNjM1NDgwMjg2MTEzNjUyDA82MTM0MzE4MjI4NTI3NzMMDzIyMTYzNDczNDg2MTA4NgwPNjE4NjU3NDcxNzUyMTE0DA8zMjg1MjU1MTIzMTgwNzAMDzQ2MTAzMTQ0NDAzMDMyNAwPNTc2ODU4NDI3MjE0MTg2DA82NjU0MDAwNjgwMjgxMzEMDzMwNTcyMzIxODQ0MTgxMwwPNTQ1MTg0NDYwMDg4NTQ2DA82ODExMDczNDM4Njg3MzgwDQYJKoZIhvcNAQEFBQADgYEAQq6zHN8SP8w71Yyq+cwwNQ2VZ4UMPRw/9JkW8ZUJWC4gae2lOfeyyjtN3akXaT+p+vETtfoPuCpPjvzPYoN1RZieyJnpSVzUrNw/lM6kSP5DjGg5K/WKWYad0VkQg56Kynp2YVX4yKUhBydd7iBeSGP900LAHRWCR++xq+r98mI= -MIDlet-Jar-RSA-SHA1: PRpjLFh81oAjHdPSZ/9lTe64ICSSHOk/MQMdRSqwsoGMSPID91mBRFEYOIQ/5nocEscacSi81o089Y0gMpEIP8V/EWBD7WDP6xqjC0gSyac+QjZm1Bu7Pzav+JC5J3KEkKOGy4wgQKJx02bArR/P9LhYAe7T6LVVFbfFyw2lhJA= diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/Empty.jad diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/EmptyLines.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/EmptyLines.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - - - - - -  -  - -  \ No newline at end of file diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/FL_Rocks.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/FL_Rocks.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/NDRM.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/NDRM.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/PlatformReqHTTP.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/PlatformReqHTTP.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -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 461e71b327da -r 0553e2305d00 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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet2.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet2.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -a<>: separators in attribute name -bo: control characters in attribute name -c: diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet3.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet3.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -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 461e71b327da -r 0553e2305d00 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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/ceac00.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/ceac00.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/cecn02.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/cecn02.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/cecn06.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/cecn06.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/ceis00.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis00.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/ceis09.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis09.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/ceis14.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis14.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/cejp04.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/cejp04.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/ceko01.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/ceko01.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/cems01.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/cems01.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/cems11.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/cems11.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/ceut03.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut03.jad has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/ceut04.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut04.jad has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/ceut08.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut08.jad has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/ceut09.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut09.jad has changed diff -r 461e71b327da -r 0553e2305d00 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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/javahelper.mif Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/javahelper.mif has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/mine_en_fr_de_it_es_ES_pt_PT.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/mine_en_fr_de_it_es_ES_pt_PT.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testdata/utils/utf8bom.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/utf8bom.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/build/build.xml --- a/javamanager/javainstaller/installer/tsrc/testserver/build/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/build/readme.txt --- a/javamanager/javainstaller/installer/tsrc/testserver/build/readme.txt Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jad --- a/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jar Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jad --- a/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jar Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_ota.jad --- a/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_ota.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jad --- a/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jar Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jar has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/MANIFEST.MF --- a/javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/MANIFEST.MF Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Class-Path: - diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/context.xml --- a/javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/context.xml Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ - - - - \ No newline at end of file diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/content/WEB-INF/web.xml --- a/javamanager/javainstaller/installer/tsrc/testserver/content/WEB-INF/web.xml Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ - - - - 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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/content/httpauth/HelloWorld_http_auth.jad --- a/javamanager/javainstaller/installer/tsrc/testserver/content/httpauth/HelloWorld_http_auth.jad Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -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 461e71b327da -r 0553e2305d00 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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/JadServlet.java --- a/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/JadServlet.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +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: -* -*/ - -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/NotifyServlet.java --- a/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/NotifyServlet.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +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: -* -*/ - -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/RedirectServlet.java --- a/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/RedirectServlet.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +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: -* -*/ - -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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installerui/build/build.xml --- a/javamanager/javainstaller/installerui/build/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/build/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -1,6 +1,6 @@ @@ -50,16 +50,6 @@ - - - - - - - - diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installerui/build/javainstallerui_0x2002DCB6.mmp --- a/javamanager/javainstaller/installerui/build/javainstallerui_0x2002DCB6.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/build/javainstallerui_0x2002DCB6.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installerui/data/java_3_trusted.png Binary file javamanager/javainstaller/installerui/data/java_3_trusted.png has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installerui/data/java_3_untrusted.png Binary file javamanager/javainstaller/installerui/data/java_3_untrusted.png has changed diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installerui/data/javaapplicationinstaller.css --- a/javamanager/javainstaller/installerui/data/javaapplicationinstaller.css Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +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: -* -*/ - -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#urlLabel{ - /* 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#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 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUi.java Fri Oct 22 14:23:56 2010 +0100 @@ -385,13 +385,6 @@ } /** - * 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 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUiFactory.java Fri Oct 22 14:23:56 2010 +0100 @@ -50,9 +50,9 @@ installerUi = (InstallerUi)clazz.newInstance(); installerUi.init(aMode, aListener); } - catch (Throwable t) + catch (Exception ex) { - logError("Instantiating " + className + " failed", t); + logError("Instantiating " + className + " failed", ex); } return installerUi; } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallerUiEswt.java Fri Oct 22 14:23:56 2010 +0100 @@ -129,6 +129,7 @@ // 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() @@ -147,7 +148,6 @@ private void uiMain() { log("uiMain: thread started"); - iUiThreadExists = true; try { // Create the necessary views. @@ -1000,14 +1000,6 @@ } /** - * 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() @@ -1152,11 +1144,14 @@ { long startTime = System.currentTimeMillis(); + int maxWidth = DisplayExtension.getBestImageWidth(DisplayExtension.LIST_ELEMENT); + int maxHeight = DisplayExtension.getBestImageHeight(DisplayExtension.LIST_ELEMENT); + + aDisplay.setData("org.eclipse.swt.internal.image.loadSize", new Point(maxWidth, maxHeight)); Image image = new Image(aDisplay, aInputStream); + if (aScaleImage) { - int maxWidth = DisplayExtension.getBestImageWidth(DisplayExtension.LIST_ELEMENT); - int maxHeight = DisplayExtension.getBestImageHeight(DisplayExtension.LIST_ELEMENT); Rectangle rect = image.getBounds(); if (maxWidth != rect.width || maxHeight != rect.height) { diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/CertificateDetailsView.java Fri Oct 22 14:23:56 2010 +0100 @@ -79,7 +79,7 @@ Label detailsLabel = createLabel( InstallerUiTexts.get(InstallerUiTexts.NOT_CERTIFIED_TITLE), horizontalSpan, labelStyle); - setCssId(detailsLabel, "heading"); + detailsLabel.setFont(iInstallerUi.getBoldFont()); // Add domain category label. createLabel("", horizontalSpan, labelStyle); @@ -103,7 +103,6 @@ new String[] { appName }), horizontalSpan, labelStyle); - setCssId(warningLabel, "detailsWarningLabel"); } /** @@ -119,7 +118,7 @@ (InstallerUiTexts.get (InstallerUiTexts.CERTIFICATE_TITLE), horizontalSpan, labelStyle); - setCssId(detailsLabel, "heading"); + detailsLabel.setFont(iInstallerUi.getBoldFont()); SigningCertificate certificate = iCerts[iCertIndex]; diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ConfirmationViewBase.java Fri Oct 22 14:23:56 2010 +0100 @@ -100,7 +100,6 @@ createCommands(); setDefaultCommand(); } - iInstallerUi.loadCss(); setVisible(true); iInstallerUi.unhide(); } @@ -185,14 +184,6 @@ 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); @@ -239,14 +230,6 @@ 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 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorDetailsView.java Fri Oct 22 14:23:56 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) { - titleLabel = createLabel(title, getColumns() - 1, SWT.WRAP); + Label titleLabel = createLabel(title, getColumns() - 1, SWT.WRAP); + titleLabel.setFont(iInstallerUi.getBoldFont()); // Add security icon. iCertificates = iInstallerUi.getInstallInfo().getCertificates(); createSecurityButton(); } else { - titleLabel = createLabel(title, getColumns(), SWT.WRAP); + Label titleLabel = createLabel(title, getColumns(), SWT.WRAP); + titleLabel.setFont(iInstallerUi.getBoldFont()); } - setCssId(titleLabel, "heading"); int horizontalSpan = getColumns(); int labelStyle = SWT.WRAP; @@ -90,7 +90,6 @@ // Begin widgets creation. Label errorLabel = createLabel( iException.getDetailedMessage(), horizontalSpan, labelStyle); - setCssId(errorLabel, "errorLabel"); // End of widgets creation. } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorView.java Fri Oct 22 14:23:56 2010 +0100 @@ -78,7 +78,7 @@ else { Label titleLabel = createLabel(title, getColumns(), SWT.WRAP); - setCssId(titleLabel, "heading"); + titleLabel.setFont(iInstallerUi.getBoldFont()); } int horizontalSpan = getColumns(); @@ -87,7 +87,6 @@ // Begin widgets creation. Label errorLabel = createLabel( iException.getShortMessage(), horizontalSpan, labelStyle); - setCssId(errorLabel, "errorLabel"); // End of widgets creation. if (iInstallerUi.getInstallInfo() != null) diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallConfirmationView.java Fri Oct 22 14:23:56 2010 +0100 @@ -33,6 +33,7 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Link; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; @@ -106,7 +107,15 @@ protected void createView() { // Add header. - addHeader(null, iInstallInfo, null); + String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY); + if (iInstallInfo != null) + { + if (iInstallInfo.getOldVersion() != null) + { + title = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY); + } + } + addHeader(title, iInstallInfo, null); GridData gridData = null; int horizontalSpan = getColumns(); @@ -118,7 +127,6 @@ { // 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); @@ -148,7 +156,6 @@ { // 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 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java Fri Oct 22 14:23:56 2010 +0100 @@ -27,6 +27,7 @@ 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; @@ -36,7 +37,6 @@ import java.io.InputStream; import java.io.IOException; -import java.util.Enumeration; import java.util.Hashtable; import org.eclipse.ercp.swt.midp.UIThreadSupport; @@ -47,10 +47,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,15 +62,10 @@ */ 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; @@ -103,6 +98,8 @@ 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; @@ -138,6 +135,7 @@ // 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() @@ -156,14 +154,12 @@ 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(); @@ -186,10 +182,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) { @@ -220,7 +216,10 @@ display.sleep(); } } - disposeResources(); + if (iBoldFont != null && !iBoldFont.isDisposed()) + { + iBoldFont.dispose(); + } display.dispose(); log("uiMain: display disposed"); synchronized (iExitWaitObject) @@ -303,14 +302,24 @@ super.confirm(aInstallInfo); waitForUi(); + boolean result = true; if (!isUiReady()) { - // If UI is not ready by the time confirmation is requested, - // throw an exception. - throw new RuntimeException("JavaInstallerUi not ready"); + 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"); + } } - boolean result = true; if (result) { StartUpTrace.doTrace("InstallerUiEswt confirm"); @@ -454,7 +463,6 @@ public void updateProgress(int aProgress) { super.updateProgress(aProgress); - if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -465,12 +473,6 @@ // 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 @@ -507,7 +509,6 @@ public void ended() { super.ended(); - if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -552,7 +553,6 @@ public void started(DownloadInfo aDownloadInfo) { super.started(aDownloadInfo); - if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -579,7 +579,6 @@ public void updateProgress(DownloadInfo aDownloadInfo) { super.updateProgress(aDownloadInfo); - if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -629,7 +628,6 @@ public void ended(DownloadInfo aDownloadInfo) { super.ended(aDownloadInfo); - if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -656,7 +654,6 @@ public void setOcspIndicator(boolean aOn) { super.setOcspIndicator(aOn); - if (DISABLE_UI) return; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { @@ -672,10 +669,9 @@ { public void run() { - iOcspProgressView = new ProgressView( - self, iDialog, - InstallerUiTexts.get(InstallerUiTexts.OCSP_CHECK_PROGRESS), - true); + iOcspProgressView = new ProgressView(self, iDialog, + InstallerUiTexts.get(InstallerUiTexts.OCSP_CHECK_PROGRESS), + true); } }); iOcspProgressView.addCancelCommand(); @@ -758,7 +754,6 @@ public void error(InstallerExceptionBase aInstallerException) { super.error(aInstallerException); - if (DISABLE_UI) return; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { @@ -804,6 +799,45 @@ } /** + * Notify user that an error has occurred using RuntimeUI. + * + * @param aInstallerException exception indicating the error reason + */ + /* + private void showRuntimeUiError(InstallerExceptionBase aInstallerException) + { + boolean identified = false; + if (iInstallInfo != null) + { + if (iInstallInfo.getCertificates() != null) + { + identified = true; + } + } + else if (iUninstallInfo != null) + { + if (iUninstallInfo.getCertificates() != null) + { + identified = true; + } + } + String tmpTitle = InstallerUiTexts.get(InstallerUiTexts.INSTALL_FAILED); + + // Ensure that no confirmations are being displayed. + cancelConfirmations(); + // Hide progress view before displaying error message. + if (iProgressView != null) + { + iProgressView.setVisible(false); + } + // Use RuntimeUi to display uninstallation error message. + RuntimeUi runtimeUi = RuntimeUiFactory.getRuntimeUi(identified); + runtimeUi.error(tmpTitle, aInstallerException); + runtimeUi.destroy(); + } + */ + + /** * Seeks confirmation from the user. * * @param aAppName the name of the application on behalf of which the @@ -816,7 +850,6 @@ */ public boolean confirm(String aAppName, ConfirmData aConfirmData) { - if (DISABLE_UI) return true; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { return true; @@ -855,7 +888,6 @@ */ public String[] getUsernamePassword(String aUrl) { - if (DISABLE_UI) return new String[] { "", "" }; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { @@ -911,7 +943,6 @@ */ public boolean launchAppQuery(LaunchAppInfo aLaunchAppInfo) { - if (DISABLE_UI) return false; // Disable UI temporarily. waitForUi(); if (!isUiReady() || iConfirmationsCanceled || getInstallInfo() == null) { @@ -933,31 +964,19 @@ }); } boolean result = iLaunchAppQueryView.launchAppQuery(aLaunchAppInfo); - iLaunchAppQueryView.dispose(); - iLaunchAppQueryView = null; - if (!result) + iParent.getDisplay().syncExec(new Runnable() { - iParent.getDisplay().syncExec(new Runnable() + public void run() { - public void run() - { - iParent.dispose(); - } - }); - } + iParent.dispose(); + } + }); + iLaunchAppQueryView = null; 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) @@ -992,23 +1011,20 @@ */ protected String getTitle() { - String result = super.getTitle(); - if (isUiReady()) + String result = null; + if (iMode == MODE_INSTALL) + { + result = InstallerUiTexts.get(InstallerUiTexts.INSTALLING); + } + else if (iMode == MODE_UNINSTALL) { - if (iMode == MODE_INSTALL) - { - result = InstallerUiTexts.get(InstallerUiTexts.INSTALLING); - } - else if (iMode == MODE_UNINSTALL) - { - result = InstallerUiTexts.get("Uninstalling"); - } - else if (iMode == MODE_APP_CONVERSION) - { - result = InstallerUiTexts.get( - "Converting data for application " + - iAppConversionCurrent + "/" + iAppConversionTotal); - } + result = InstallerUiTexts.get("Uninstalling"); + } + else if (iMode == MODE_APP_CONVERSION) + { + result = InstallerUiTexts.get( + "Converting data for application " + + iAppConversionCurrent + "/" + iAppConversionTotal); } return result; } @@ -1028,24 +1044,16 @@ { return iSecurityIcon; } - String iconFilename = "java_3_untrusted.png"; + String iconFilename = ResourceUtil.UNTRUSTED_ICON_NAME; if (aIdentified) { - iconFilename = "java_3_trusted.png"; + iconFilename = ResourceUtil.TRUSTED_ICON_NAME; } - try + String resourceDir = ResourceUtil.getResourceDir(0); + for (int i = 1; iSecurityIcon == null && resourceDir != null; i++) { - String resourceDir = ResourceUtil.getResourceDir(0); - for (int i = 1; iSecurityIcon == null && resourceDir != null; i++) - { - iSecurityIcon = loadImage( - aDisplay, resourceDir + iconFilename, false); - resourceDir = ResourceUtil.getResourceDir(i); - } - } - catch (Throwable t) - { - log("Can not load security icon: " + t); + iSecurityIcon = loadImage(aDisplay, resourceDir + iconFilename, false); + resourceDir = ResourceUtil.getResourceDir(i); } return iSecurityIcon; } @@ -1136,21 +1144,19 @@ try { long startTime = System.currentTimeMillis(); - Image image = new Image(aDisplay, aInputStream); - ImageData imageData = image.getImageData(); + ImageData[] imageDatas = new ImageLoader().load(aInputStream); + ImageData imageData = imageDatas[0]; 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 " + - oldSize.x + "x" + oldSize.y + " to " + - bestSize.x + "x" + bestSize.y); + imageDatas[0].width + "x" + imageDatas[0].height + + " to " + bestSize.x + "x" + bestSize.y); } } result = new Image(aDisplay, imageData); @@ -1172,8 +1178,8 @@ */ private static Point getBestImageSize(int aWidth, int aHeight) { - final int MAX_WIDTH = (iBestIconSize == null? 50: iBestIconSize.x); - final int MAX_HEIGHT = (iBestIconSize == null? 50: iBestIconSize.y); + final int MAX_WIDTH = iBestIconSize.x; + final int MAX_HEIGHT = iBestIconSize.y; Point result = new Point(aWidth, aHeight); if (result.x > MAX_WIDTH || result.y > MAX_HEIGHT) { @@ -1301,57 +1307,4 @@ { 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); - } - } - - private void disposeResources() { - if (iBoldFont != null && !iBoldFont.isDisposed()) - { - iBoldFont.dispose(); - } - if (iSecurityIcon != null && !iSecurityIcon.isDisposed()) - { - iSecurityIcon.dispose(); - } - Enumeration e = iImageTable.elements(); - while (e.hasMoreElements()) - { - Image img = (Image)e.nextElement(); - if (img != null && !img.isDisposed()) - { - img.dispose(); - } - } - } } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiTexts.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiTexts.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiTexts.java Fri Oct 22 14:23:56 2010 +0100 @@ -30,6 +30,73 @@ /*** ----------------------------- PUBLIC ------------------------------ */ // Define constants for localised text ids. + public static final String OK = "Ok"; + public static final String CANCEL = "Cancel"; + public static final String BACK = "Ok"; + public static final String HIDE = "Hide"; + public static final String SHOW = "Show"; + public static final String CLOSE = "Close"; + public static final String INSTALL_QUERY = "Install?"; + public static final String UPDATE_QUERY = "Update?"; + public static final String OCSP_CHECK_PROGRESS = "Checking certificate validity"; + public static final String INSTALLING = "Installing"; + public static final String INSTALL_FAILED = "Installation failed"; + public static final String INSTALLATION_COMPLETE = "Installed"; + public static final String DOWNLOADING = "Downloading"; + public static final String CONNECT_TO = "Connect to"; + public static final String DOWNLOAD_APPLICATION = "To download %U you need to authenticate yourself"; + public static final String USERNAME = "Username:"; + public static final String PASSWORD = "Password:"; + public static final String SUITE_NAME = "%U (%U)"; + public static final String SUITE_VENDOR = "%U"; + public static final String SUITE_VERSION = "%U"; + public static final String APP_NAME = "%U"; + public static final String SIZE_KB = "%U kB"; + public static final String SIZE_MB = "%U MB"; + public static final String RETAIN_USER_DATA = "Retain application data"; + // Certificate info texts. + public static final String NOT_CERTIFIED_TITLE = "Application is not certified."; + public static final String NOT_CERTIFIED_INFO = "Application %U is from an unknown source."; + public static final String CERTIFICATE_TITLE = "Application is certified."; + public static final String DOMAIN = "Domain: %U"; + public static final String DOMAIN_MANU = "Manufacturer"; + public static final String DOMAIN_OPER = "Operator"; + public static final String DOMAIN_ITP = "Trusted 3rd party"; + public static final String DOMAIN_UTP = "Untrusted 3rd party"; + public static final String ISSUER = "Issuer: %U"; + public static final String SUBJECT = "Subject: %U"; + public static final String ORGANIZATION = "Organization: %U"; + public static final String VALID_FROM = "Valid from: %U"; + public static final String VALID_UNTIL = "Valid until: %U"; + public static final String SERIAL_NUMBER = "Serial number: %U"; + public static final String FINGERPRINT = "Fingerprint: %U"; + // Texts for installation drive selection. + public static final String DRIVE_TYPE_UNKNOWN = "%U: Unknown"; + public static final String DRIVE_TYPE_UNKNOWN_KB = "%U: Unknown (%N kB)"; + public static final String DRIVE_TYPE_UNKNOWN_MB = "%U: Unknown (%N MB)"; + public static final String DRIVE_TYPE_UNKNOWN_GB = "%U: Unknown (%N GB)"; + public static final String DRIVE_TYPE_PHONE_MEMORY = "%U: Phone memory"; + public static final String DRIVE_TYPE_PHONE_MEMORY_KB = "%U: Phone memory (%N kB)"; + public static final String DRIVE_TYPE_PHONE_MEMORY_MB = "%U: Phone memory (%N MB)"; + public static final String DRIVE_TYPE_PHONE_MEMORY_GB = "%U: Phone memory (%N GB)"; + public static final String DRIVE_TYPE_MEMORY_CARD = "%U: Memory card"; + public static final String DRIVE_TYPE_MEMORY_CARD_KB = "%U: Memory card (%N kB)"; + public static final String DRIVE_TYPE_MEMORY_CARD_MB = "%U: Memory card (%N MB)"; + public static final String DRIVE_TYPE_MEMORY_CARD_GB = "%U: Memory card (%N GB)"; + public static final String DRIVE_TYPE_INTERNAL_MASS_STORAGE = "%U: Internal Mass Storage"; + public static final String DRIVE_TYPE_INTERNAL_MASS_STORAGE_KB = "%U: Internal Mass Storage (%N kB)"; + public static final String DRIVE_TYPE_INTERNAL_MASS_STORAGE_MB = "%U: Internal Mass Storage (%N MB)"; + public static final String DRIVE_TYPE_INTERNAL_MASS_STORAGE_GB = "%U: Internal Mass Storage (%N GB)"; + // Texts for permission confirmation view. + public static final String PERM_QUERY = "Application %U asks permissions to access protected device functionality."; + public static final String PERM_VIEW_DETAILS = "Details"; + public static final String PERM_ALLOW_ALWAYS = "Allow always"; + public static final String PERM_ASK_ME_LATER = "Ask me later"; + public static final String PERM_CANCEL = "Cancel installing"; + public static final String PERM_VIEW_DETAILS_TITLE = "Application asks permissions for:"; + + /* + // Define constants for localised text ids. public static final String OK = "button_ok"; public static final String CANCEL = "button_cancel"; public static final String BACK = "button_back_ok"; @@ -47,8 +114,9 @@ public static final String DOWNLOAD_APPLICATION = "info_auth_yourself"; public static final String USERNAME = "dialog_username"; public static final String PASSWORD = "dialog_password"; - public static final String SUITE_NAME_VERSION = "info_app_suite_name_version"; + public static final String SUITE_NAME = "info_app_suite_name"; public static final String SUITE_VENDOR = "info_vendor"; + public static final String SUITE_VERSION = "info_version"; public static final String APP_NAME = "info_app_name"; public static final String SIZE_KB = "info_size_kb"; public static final String SIZE_MB = "info_size_mb"; @@ -93,6 +161,7 @@ public static final String PERM_ASK_ME_LATER = "button_perm_ask_me_later"; public static final String PERM_CANCEL = "button_perm_cancel_installing"; public static final String PERM_VIEW_DETAILS_TITLE = "title_perm_view_details"; + */ /** * Method for retrieving a text string with given id and no parameters. @@ -114,12 +183,12 @@ */ public static String get(String aTextId, Object[] aTextParameters) { - if (iRes == null) - { - iRes = ResourceLoader.getInstance( - null, null, "javaapplicationinstaller", "txt_java_inst_"); - } - return iRes.format(aTextId, aTextParameters); + return new com.nokia.mj.impl.utils.Formatter(aTextId).format(aTextParameters); + //if (iRes == null) + //{ + // iRes = ResourceLoader.getInstance("javaapplicationinstaller", "txt_java_inst_"); + //} + //return iRes.format(aTextId, aTextParameters); } /*** ---------------------------- PROTECTED --------------------------- */ diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/LaunchAppQueryView.java Fri Oct 22 14:23:56 2010 +0100 @@ -18,9 +18,12 @@ 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 @@ -28,6 +31,9 @@ */ public class LaunchAppQueryView extends ConfirmationViewBase { + private LaunchAppInfo iLaunchAppInfo = null; + private Button iDefaultButton = null; + /** Constructor */ protected LaunchAppQueryView() { @@ -40,7 +46,7 @@ { super(aInstallerUi, aParent, 8); setTitle(InstallerUiTexts.get(InstallerUiTexts.INSTALLATION_COMPLETE)); - setCommands(InstallerUiTexts.get(InstallerUiTexts.SHOW), + setCommands("Show", //InstallerUiTexts.get(InstallerUiTexts.SHOW), InstallerUiTexts.get(InstallerUiTexts.CLOSE)); } @@ -52,6 +58,7 @@ return false; } + iLaunchAppInfo = aLaunchAppInfo; // Use confirm() from super class to display the view. boolean result = confirm(); // Return the result to the client. @@ -61,8 +68,8 @@ protected void createView() { // Add header. - addHeader(InstallerUiTexts.get(InstallerUiTexts.INSTALLATION_COMPLETE), - iInstallerUi.getInstallInfo(), null); + String title = "Installed"; + addHeader(title, iInstallerUi.getInstallInfo(), null); // Add content to the application info Composite. addAppInfo(iInstallerUi.getInstallInfo(), true); } @@ -74,4 +81,26 @@ { // 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 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionConfirmationView.java Fri Oct 22 14:23:56 2010 +0100 @@ -35,6 +35,7 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Link; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; @@ -61,7 +62,7 @@ protected PermissionConfirmationView( InstallerUiEswt aInstallerUi, Composite aParent) { - super(aInstallerUi, aParent, 8); + super(aInstallerUi, aParent, 8, true); setTitle(InstallerUiTexts.get(InstallerUiTexts.INSTALLING)); setCommands(null, null); } @@ -92,30 +93,39 @@ protected void createView() { // Add header. - addHeader(null, iInstallInfo, null); + String title = "Install?"; + String appName = ""; + if (iInstallInfo != null) + { + if (iInstallInfo.getOldVersion() != null) + { + title = "Update?"; + } + appName = iInstallInfo.getName(); + } + addHeader(title, iInstallInfo, null); GridData gridData = null; + int horizontalSpan = getColumns(); int labelStyle = SWT.WRAP; // Add permission query label. - int detailsColumns = 2; - int horizontalSpan = getColumns() - detailsColumns; - Label permissionQueryLabel = createLabel( - InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY), + Label domainLabel = createLabel( + InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY, + new String[] { appName }), horizontalSpan, labelStyle); - setCssId(permissionQueryLabel, "permissionDetails"); // Add link for permission details. if (iPermissionInfo != null && iPermissionInfo.getPermissionNames() != null && iPermissionInfo.getPermissionNames().length > 0) { - 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() + Link detailsLink = new Link(getComposite(), SWT.NONE); + detailsLink.setText( + "" + + InstallerUiTexts.get(InstallerUiTexts.PERM_VIEW_DETAILS) + + ""); + detailsLink.addListener(SWT.Selection, new Listener() { public void handleEvent(Event aEvent) { @@ -124,15 +134,15 @@ }); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; - detailsButton.setLayoutData(gridData); - addSoftKeyListenerFor(detailsButton); + detailsLink.setLayoutData(gridData); + addSoftKeyListenerFor(detailsLink); } - 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() @@ -159,13 +169,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() @@ -192,12 +202,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() { @@ -222,12 +232,9 @@ }); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; + gridData.verticalIndent = verticalIndent; iCancelButton.setLayoutData(gridData); addSoftKeyListenerFor(iCancelButton); - - // After other widgets have been added, add content to - // application info Composite. - addAppInfo(iInstallInfo, false); } /** diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionDetailsView.java Fri Oct 22 14:23:56 2010 +0100 @@ -64,7 +64,7 @@ (InstallerUiTexts.get (InstallerUiTexts.PERM_VIEW_DETAILS_TITLE), horizontalSpan, labelStyle); - setCssId(detailsLabel, "heading"); + detailsLabel.setFont(iInstallerUi.getBoldFont()); // Add permission names. String[] permNames = iPermissionInfo.getPermissionNames(); @@ -84,7 +84,6 @@ Label permissionDetailsLabel = createLabel( iPermissionInfo.getPermissionsDetails(), horizontalSpan, labelStyle); - setCssId(permissionDetailsLabel, "detailsWarningLabel"); } } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ProgressView.java Fri Oct 22 14:23:56 2010 +0100 @@ -86,7 +86,6 @@ { setTitle(iMsg); iLabel = createLabel(iMsg, SWT.WRAP); - setCssId(iLabel, "heading"); } iIndeterminate = aIndeterminate; @@ -103,7 +102,6 @@ iProgressBar.setMaximum(100); iProgressBar.setSelection(iValue); } - setCssId(iProgressBar, "progressBar"); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = getColumns(); iProgressBar.setLayoutData(gridData); @@ -117,8 +115,6 @@ // By default add cancel command to all progress bars. addCancelCommand(); - - iInstallerUi.loadCss(); } /** Update text for this progress bar. */ @@ -173,18 +169,13 @@ { 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); - setCssId(iHideCommand, "softKeyButton"); - gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.horizontalSpan = horizontalSpan; + GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.horizontalSpan = 1; iHideCommand.setLayoutData(gridData); iHideCommand.setText(InstallerUiTexts.get(InstallerUiTexts.HIDE)); - iHideCommand.addSelectionListener(new SelectionListener() + iHideCommand.addSelectionListener + (new SelectionListener() { public void widgetDefaultSelected(SelectionEvent aEvent) { @@ -196,16 +187,15 @@ } }); addSoftKeyListenerFor(iHideCommand); - */ iCancelCommand = new Button(getCommandComposite(), SWT.PUSH); - setCssId(iCancelCommand, "softKeyButtonWide"); gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.horizontalSpan = horizontalSpan; + gridData.horizontalSpan = 1; iCancelCommand.setLayoutData(gridData); iCancelCommand.setText( InstallerUiTexts.get(InstallerUiTexts.CANCEL)); - iCancelCommand.addSelectionListener(new SelectionListener() + iCancelCommand.addSelectionListener + (new SelectionListener() { public void widgetDefaultSelected(SelectionEvent aEvent) { @@ -244,11 +234,8 @@ public void run() { getShell().setDefaultButton(null); - if (iHideCommand != null) - { - iHideCommand.dispose(); - iHideCommand = null; - } + iHideCommand.dispose(); + iHideCommand = null; iCancelCommand.dispose(); iCancelCommand = null; } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/RuntimeConfirmationView.java Fri Oct 22 14:23:56 2010 +0100 @@ -57,18 +57,10 @@ String[] answerOptions = iConfirmData.getAnswerOptions(); switch (answerOptions.length) { - //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; + case 1: setCommands(answerOptions[0], null); break; + case 2: setCommands(answerOptions[0], answerOptions[1]); break; default: setCommands(null, null); break; } - } /** @@ -76,13 +68,27 @@ */ protected void createView() { - // Add header. - addHeader(null, iInstallerUi.getInstallInfo(), null); + // 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()); + } GridData gridData = null; int horizontalSpan = getColumns(); int labelStyle = SWT.WRAP; + // Begin widgets creation. + // Add question label. Label errorLabel = createLabel( iConfirmData.getQuestion(), horizontalSpan, labelStyle); @@ -126,9 +132,7 @@ iAnswerButtons[iConfirmData.getAnswerSuggestion()].setFocus(); } - // After other widgets have been added, add content to - // application info Composite. - addAppInfo(iInstallerUi.getInstallInfo(), false); + // End of widgets creation. } /** diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/UsernamePasswordView.java Fri Oct 22 14:23:56 2010 +0100 @@ -108,33 +108,28 @@ int labelStyle = SWT.WRAP; - Label titleLabel = createLabel( - InstallerUiTexts.get(InstallerUiTexts.CONNECT_TO), labelStyle); - setCssId(titleLabel, "heading"); + Label titleLabel = createLabel + (InstallerUiTexts.get(InstallerUiTexts.CONNECT_TO), labelStyle); + titleLabel.setFont(iInstallerUi.getBoldFont()); - Label urlLabel = createLabel(getServer(iUrl), labelStyle); - setCssId(urlLabel, "urlLabel"); + Label urlLabel = createLabel(iUrl, labelStyle); - Label authLabel = createLabel( - InstallerUiTexts.get(InstallerUiTexts.DOWNLOAD_APPLICATION, - new String[] { iAppName }), labelStyle); - setCssId(authLabel, "authLabel"); + Label authLabel = createLabel + (InstallerUiTexts.get + (InstallerUiTexts.DOWNLOAD_APPLICATION, new String[] { iAppName }), + labelStyle); - Label usernameLabel = createLabel( - InstallerUiTexts.get(InstallerUiTexts.USERNAME), labelStyle); - setCssId(usernameLabel, "usernamePasswordLabel"); + Label usernameLabel = createLabel + (InstallerUiTexts.get(InstallerUiTexts.USERNAME), labelStyle); 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"); + Label passwordLabel = createLabel + (InstallerUiTexts.get(InstallerUiTexts.PASSWORD), labelStyle); iPasswordText = new Text(getComposite(), SWT.PASSWORD | SWT.BORDER); - setCssId(iPasswordText, "usernamePasswordInputField"); iPasswordText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); addSoftKeyListenerFor(iPasswordText); } @@ -156,31 +151,4 @@ { return SWT.V_SCROLL; } - - /** - * Returns server part from HTTP URL. - */ - private String getServer(String aUrl) - { - String server = aUrl; - int i = server.indexOf("://"); - if (i != -1) - { - server = server.substring(i + 3); - i = server.indexOf(":"); - if (i != -1) - { - server = server.substring(0, i); - } - else - { - i = server.indexOf("/"); - if (i != -1) - { - server = server.substring(0, i); - } - } - } - return server; - } } diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java Fri Oct 22 14:23:56 2010 +0100 @@ -34,7 +34,6 @@ 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; @@ -43,7 +42,6 @@ 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. @@ -52,8 +50,6 @@ { /** Maximum view height in percentage from display client area height. */ protected static final int MAX_VIEW_HEIGHT = 80; - /** Maximum view width in percentage from display client area width. */ - protected static final int MAX_VIEW_WIDTH = 90; /** Parent shell for this view. */ protected Shell iParent = null; /** Container for the contents of the view */ @@ -103,7 +99,6 @@ iParent = (Shell)aParent; iContainer = new Composite(iParent, 0); - setCssId(iContainer, "dialogArea"); iContainer.setVisible(false); iColumns = aColumns; @@ -221,7 +216,7 @@ /** Set title for this view. */ public void setTitle(String aTitle) { - // Dialog shells have no title. + // Dialog shells have no title anymore } /** Disposes this view. */ @@ -346,12 +341,12 @@ SWT.DEFAULT, SWT.DEFAULT)); } - int contentWidth = iDefaultContentSize.x * MAX_VIEW_WIDTH / 100; + int contentWidth = iDefaultContentSize.x; if (aVerticalScrollBarVisible) { int verticalScrollBarWidth = getScrolledComposite().getVerticalBar().getSize().x; - contentWidth -= verticalScrollBarWidth; + contentWidth = iDefaultContentSize.x - verticalScrollBarWidth; } // Recalculate the size of the content. @@ -360,7 +355,7 @@ Point cmdContentSize = cmdComp.computeSize(iDefaultContentSize.x, SWT.DEFAULT); cmdComp.setSize(cmdContentSize); - // Adjust Shell height and width. + // Adjust Shell height. The Shell never changes the x position, nor the width. Rectangle dispRect = shell.getDisplay().getClientArea(); int offset = iDefaultContentSize.y - contentSize.y - cmdContentSize.y; @@ -373,20 +368,18 @@ offset -= maxHeight - newHeight; newHeight = maxHeight; } - int newWidth = defShellBounds.width; - int maxWidth = dispRect.width * MAX_VIEW_WIDTH / 100; - if (newWidth > maxWidth) - { - newWidth = maxWidth; - } - // Always center horizontally and vertically. Rectangle dispBounds = shell.getDisplay().getBounds(); - int x = dispBounds.width - newWidth; int y = dispBounds.height - newHeight; - x /= 2; + // Always center vertically. y /= 2; - shell.setBounds(x, y, newWidth, newHeight); + // For landscape orientation center vertically + //if (dispRect.width > dispRect.height) + //{ + // y /= 2; + //} + // Set bounds when command Buttons are in use. + shell.setBounds(defShellBounds.x, y, defShellBounds.width, newHeight); Rectangle clientArea = shell.getClientArea(); iContainer.setSize(clientArea.width, clientArea.height); iContainer.layout(true); @@ -441,14 +434,6 @@ } /** - * 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( @@ -465,28 +450,26 @@ boolean aSecurityButton) { // Add title. - if (aTitle == null) + String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY); + if (aInstallInfo != null) { - aTitle = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY); - if (aInstallInfo != null && aInstallInfo.getOldVersion() != null) + if (aInstallInfo.getOldVersion() != null) { - aTitle = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY); + title = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY); } + iCertificates = aInstallInfo.getCertificates(); + } + if (aUninstallInfo != null) + { + title = "Uninstall?"; + iCertificates = aUninstallInfo.getCertificates(); } Label titleLabel = createLabel(aTitle, getColumns() - 1, SWT.WRAP); - setCssId(titleLabel, "heading"); + titleLabel.setFont(iInstallerUi.getBoldFont()); - if (aInstallInfo != null) - { - iCertificates = aInstallInfo.getCertificates(); - } - else if (aUninstallInfo != null) - { - iCertificates = aUninstallInfo.getCertificates(); - } if (aSecurityButton) { - // Add security button. + // Add security icon. createSecurityButton(); } else @@ -518,12 +501,11 @@ { iconColumns = 2; Label iconLabel = createLabel(iSuiteIcon, iconColumns, SWT.NONE); - setCssId(iconLabel, "contentIcon"); } // Create a Composite for displaying application info. iAppInfoScrolledComposite = - new ScrolledComposite(getComposite(), SWT.V_SCROLL); + new ScrolledComposite(getComposite(), SWT.H_SCROLL | SWT.V_SCROLL); iAppInfoScrolledComposite.setAlwaysShowScrollBars(false); iAppInfoScrolledComposite.setExpandHorizontal(true); GridData gridData = new GridData(GridData.FILL_BOTH); @@ -532,7 +514,6 @@ iAppInfoComposite = new Composite(iAppInfoScrolledComposite, SWT.NONE); iAppInfoComposite.setLayout(new GridLayout(1, true)); iAppInfoScrolledComposite.setContent(iAppInfoComposite); - setCssId(iAppInfoScrolledComposite, "appInfoArea"); } /** @@ -549,7 +530,7 @@ // Add suite name and version. createAppInfoLabel( InstallerUiTexts.get( - InstallerUiTexts.SUITE_NAME_VERSION, + InstallerUiTexts.SUITE_NAME, new String[] { aInstallInfo.getName(), aInstallInfo.getVersion() })); if (aFull) @@ -572,20 +553,10 @@ } if (size > 0) { - if (size > 1024*1024) - { - createAppInfoLabel( - InstallerUiTexts.get( - InstallerUiTexts.SIZE_MB, - new Object[] { new Integer((int)(1 + size/(1024*1024))) })); - } - else - { - createAppInfoLabel( - InstallerUiTexts.get( - InstallerUiTexts.SIZE_KB, - new Object[] { new Integer((int)(1 + size/1024)) })); - } + createAppInfoLabel( + InstallerUiTexts.get( + InstallerUiTexts.SIZE_KB, + new String[] { Long.toString(1 + size/1024) })); } if (aFull) { @@ -668,7 +639,7 @@ GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = aColumns; gridData.horizontalAlignment = SWT.CENTER; - gridData.verticalAlignment = SWT.TOP; + gridData.verticalAlignment = SWT.CENTER; label.setLayoutData(gridData); return label; } @@ -700,7 +671,6 @@ protected Label createSecurityLabel(boolean aIdentified) { Label label = createLabel((Image)null, 1, SWT.NONE); - setCssId(label, "securityLabel"); Image securityIcon = null; if (iInstallerUi != null) { @@ -721,7 +691,6 @@ 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 461e71b327da -r 0553e2305d00 javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp --- a/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -42,7 +42,6 @@ // Sources SOURCEPATH ../src -SOURCE asyncwaitcallback.cpp SOURCE javasifplugin.cpp SOURCE proxy.cpp SOURCE resultsserver.cpp @@ -53,14 +52,13 @@ USERINCLUDE ../inc USERINCLUDE ../../../../inc -SYSTEMINCLUDE /epoc32/include/mw/hb/hbwidgets +SYSTEMINCLUDE ../../../../inc // Libraries LIBRARY apgrfx.lib LIBRARY apmime.lib LIBRARY ecom.lib LIBRARY efsrv.lib -LIBRARY hbwidgets.lib LIBRARY sif.lib LIBRARY javacomms.lib -LIBRARY javaruntimestarterutils.lib +LIBRARY javaruntimestarterutils.lib \ No newline at end of file diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/javasifplugin/data/2002BC6F.rss diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/javasifplugin/inc/asyncwaitcallback.h --- a/javamanager/javainstaller/javasifplugin/inc/asyncwaitcallback.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* Copyright (c) 2005-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: This class implements general wait object for calling a desired -* callback function after asynchronous notification -* -*/ - -#ifndef ASYNCWAITCALLBACK_H -#define ASYNCWAITCALLBACK_H - -#include - -namespace java -{ -namespace installer -{ - -/** - * This class implements wait object for calling a desired - * callback function after rendezvous returns specified - * reason code from the process that this object is listening to. - */ -NONSHARABLE_CLASS(CAsyncWaitCallBack) : public CActive -{ -public: // Constructors and destructor - - static CAsyncWaitCallBack* NewL(TCallBack aCallBack); - - // Destructor. - virtual ~CAsyncWaitCallBack(); - -public: // From base classes - - // from base class CActive - - void RunL(); - - void DoCancel(); - -public: - - void Wait(RProcess aProcessToListen, TInt aActivatingReasonCode); - -private: - - // Constructor. - CAsyncWaitCallBack(); - - // 2nd phase constructor. - void ConstructL(TCallBack aCallBack); - -private: // Data - - // Callback member - TCallBack iCallBack; - - // When request completes with this status code, - // callback is called. - TInt iActivatingReasonCode; - - RProcess iProcessToListen; -}; - -} // installer -} // java - -#endif // ASYNCWAITCALLBACK_H diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/javasifplugin/inc/javasifplugin.h --- a/javamanager/javainstaller/javasifplugin/inc/javasifplugin.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/inc/javasifplugin.h Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -22,13 +22,10 @@ #define JAVASIFPLUGIN_H #include -#include #include -#include "asyncwaitcallback.h" #include "f32file.h" - -class ResultsServer; +#include "resultsserver.h" using namespace Usif; @@ -39,9 +36,9 @@ const int INSTALLER_CANCEL_MESSAGE_ID = 603; const int INSTALLER_CANCEL_RESPONSE_MESSAGE_ID = 604; -namespace java +namespace Java { -namespace installer +namespace Installer { /** @@ -198,11 +195,6 @@ virtual void CancelOperation(); - /** - * Hides 'preparing installation' dialog. - */ - void HidePrepInstDialogL(); - private: /** @@ -229,96 +221,16 @@ */ 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 - * @param[in][out] aStatus - * @return ETrue if Java Installer is running - */ - TBool ExitIfJavaInstallerRunning( - COpaqueNamedParams& aResults, - TRequestStatus& aStatus); - - /** - * Creates 'preparing installation' dialog. - */ - void CreatePrepInstDialogL(); private: // Data - RFs mRFs; - RArray mHandlesToClose; - ResultsServer* mResultsServer; + TRequestStatus* iStatus; + RFs iRFs; + RArray iHandlesToClose; + ResultsServer* iResultsServer; - COpaqueNamedParams* mDummyResults; - CComponentInfo* mDummyInfo; - - CHbDeviceNotificationDialogSymbian* mPrepInstDialog; - CAsyncWaitCallBack* mWaitToHideDialog; + COpaqueNamedParams* iDummyResults; + CComponentInfo* iDummyInfo; }; } // Installer diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/javasifplugin/inc/resultsserver.h --- a/javamanager/javainstaller/javasifplugin/inc/resultsserver.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/inc/resultsserver.h Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* 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 the License "Eclipse Public License v1.0" @@ -65,19 +65,18 @@ CommsEndpoint* getComms() { - return &mComms; + return &iComms; } private: void clearData(); void setComponentInfoL(); - void resetDefaultErrorValues(); - void setCommonErrorInfo(); private: - CommsServerEndpoint mComms; - COpaqueNamedParams &mResults; - CComponentInfo &mInfo; + int iRunning; // 1 if running, 0 if not running + CommsServerEndpoint iComms; + COpaqueNamedParams &iResults; + CComponentInfo &iInfo; std::map iIntPairs; std::map iStringPairs; diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/javasifplugin/src/asyncwaitcallback.cpp --- a/javamanager/javainstaller/javasifplugin/src/asyncwaitcallback.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* -* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This class implements general wait object for calling a desired - * callback function after asynchronous notification - * -*/ - -#include "asyncwaitcallback.h" -#include "logger.h" - -using namespace java::installer; - -// ============================ MEMBER FUNCTIONS =============================== - -CAsyncWaitCallBack* CAsyncWaitCallBack::NewL(TCallBack aCallBack) -{ - CAsyncWaitCallBack* self = new(ELeave) CAsyncWaitCallBack(); - CleanupStack::PushL(self); - self->ConstructL(aCallBack); - CleanupStack::Pop(self); - return self; -} - -CAsyncWaitCallBack::CAsyncWaitCallBack(): - CActive(CActive::EPriorityStandard), iActivatingReasonCode(0) -{ -} - -CAsyncWaitCallBack::~CAsyncWaitCallBack() -{ -} - -void CAsyncWaitCallBack::ConstructL(TCallBack aCallBack) -{ - iCallBack = aCallBack; - CActiveScheduler::Add(this); -} - -void CAsyncWaitCallBack::RunL() -{ - // Execute callback only if the request completed with correct - // status code - if (iStatus == iActivatingReasonCode) - { - ILOG1(EJavaInstaller, - "CAsyncWaitCallBack called with notif code %d", - iStatus.Int()); - iCallBack.CallBack(); - } - else - { - WLOG1(EJavaInstaller, - "CAsyncWaitCallBack was called with unexpected notif code %d, reactivate", - iStatus.Int()); - // Reactivate wait - iProcessToListen.Rendezvous(iStatus); - SetActive(); - } -} - -void CAsyncWaitCallBack::DoCancel() -{ - iProcessToListen.RendezvousCancel(iStatus); -} - -void CAsyncWaitCallBack::Wait(RProcess aProcessToListen, TInt aActivatingReasonCode) -{ - iActivatingReasonCode = aActivatingReasonCode; - iProcessToListen = aProcessToListen; - iProcessToListen.Rendezvous(iStatus); - SetActive(); -} - diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp --- a/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -20,92 +20,33 @@ #include #include -#include -#include #include #include -#include -#include +#include +#include #include "comms.h" +#include "commsmessage.h" #include "commsclientendpoint.h" -#include "commsmessage.h" -#include "javacommonutils.h" +#include "javasifplugin.h" +#include "javauids.h" +#include "logger.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(KJavaInstallCopierProcess, "javainstallcopier.exe"); _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); - -/** - * This function is called to hide the 'Preparing Installation' dialog. - */ -LOCAL_C TInt HidePrepInstDialog(TAny* aPlugin) -{ - CJavaSifPlugin *pPlugin = (CJavaSifPlugin *)aPlugin; - if (NULL != pPlugin) - { - TRAP_IGNORE(pPlugin->HidePrepInstDialogL()); - } - return KErrNone; -} // ============================ MEMBER FUNCTIONS =============================== @@ -120,33 +61,24 @@ CJavaSifPlugin::~CJavaSifPlugin() { - mRFs.Close(); + iRFs.Close(); - TInt nHandles = mHandlesToClose.Count(); + TInt nHandles = iHandlesToClose.Count(); while (nHandles > 0) { nHandles--; - mHandlesToClose[nHandles].Close(); + iHandlesToClose[nHandles].Close(); } - mHandlesToClose.Reset(); - - delete mResultsServer; - mResultsServer = NULL; - - delete mDummyResults; - mDummyResults = NULL; + iHandlesToClose.Reset(); - delete mDummyInfo; - mDummyInfo = NULL; - - delete mPrepInstDialog; - mPrepInstDialog = NULL; + delete iResultsServer; + iResultsServer = NULL; - if (mWaitToHideDialog) - { - delete mWaitToHideDialog; - mWaitToHideDialog = NULL; - } + delete iDummyResults; + iDummyResults = NULL; + + delete iDummyInfo; + iDummyInfo = NULL; } CJavaSifPlugin::CJavaSifPlugin() @@ -155,12 +87,11 @@ void CJavaSifPlugin::ConstructL() { - User::LeaveIfError(mRFs.Connect()); - User::LeaveIfError(mRFs.ShareProtected()); - mResultsServer = NULL; - mDummyResults = COpaqueNamedParams::NewL(); // codescanner::forgottoputptroncleanupstack - mDummyInfo = CComponentInfo::NewL(); - mWaitToHideDialog = NULL; + User::LeaveIfError(iRFs.Connect()); + User::LeaveIfError(iRFs.ShareProtected()); + iResultsServer = NULL; + iDummyResults = COpaqueNamedParams::NewL(); + iDummyInfo = CComponentInfo::NewL(); } void CJavaSifPlugin::GetComponentInfo( @@ -170,7 +101,7 @@ TRequestStatus& aStatus) { RFile fileHandle; - TInt err = fileHandle.Open(mRFs, aFileName, EFileShareReadersOnly | EFileRead); + TInt err = fileHandle.Open(iRFs, aFileName, EFileShareReadersOnly | EFileRead); if (KErrNone != err) { ELOG1(EJavaInstaller, @@ -191,37 +122,22 @@ CComponentInfo& aComponentInfo, TRequestStatus& aStatus) { - if (ExitIfJavaInstallerRunning(*mDummyResults, aStatus)) - { - return; - } - RProcess rJavaInstaller; TFileName fileName; - 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(); + TBuf<1536> commandLine; // 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(KComponentInfo); + commandLine.Append(_L(" componentinfo")); // 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(KCommsResult); - commandLine.AppendNum(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); + commandLine.Append(_L(" -commsresult=11000")); - err = aFileHandle.FullName(fileName); + TInt err = aFileHandle.FullName(fileName); // Java Installer does not have AllFiles capability. // So if the .jad/.jar file is in the private data cage of @@ -238,30 +154,42 @@ } // Check whether the file is .jad or .jar - TBool isJad; - err = IsJadFile(aFileHandle, isJad); + RApaLsSession apaSession; + err = apaSession.Connect(); 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(KJad); + commandLine.Append(_L(" -jad=")); } else { // from JAR file - commandLine.Append(KJar); + commandLine.Append(_L(" -jar=")); } - // Filename parameter must be surrounded in double quotes to // ensure that spaces in filename are passed correctly. - commandLine.Append(KDoubleQuote); + commandLine.Append(_L("\"")); commandLine.Append(fileName); - commandLine.Append(KDoubleQuote); + commandLine.Append(_L("\"")); // Start JavaInstaller std::auto_ptr installerProcess( @@ -269,7 +197,21 @@ err = rJavaInstaller.Create(installerProcess->Des(), commandLine); if (KErrNone == err) { - err = StartResultsServer(*mDummyResults, aComponentInfo); + // 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(); + } if (KErrNone != err) { // server cannot be started @@ -299,16 +241,7 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - err = mHandlesToClose.Append(rJavaInstaller); - if ( err ) - { - rJavaInstaller.Close(); - ELOG1(EJavaInstaller, "CJavaSifPlugin::GetComponentInfo mHandles" - "ToClose.Append failed with error %d", err); - TRequestStatus *statusPtr(&aStatus); - User::RequestComplete(statusPtr, err); - return; - } + iHandlesToClose.Append(rJavaInstaller); } void CJavaSifPlugin::Install( @@ -319,12 +252,11 @@ TRequestStatus& aStatus) { RFile fileHandle; - TInt err = fileHandle.Open(mRFs, aFileName, EFileShareReadersOnly | EFileRead); + TInt err = fileHandle.Open(iRFs, 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; @@ -341,29 +273,16 @@ COpaqueNamedParams& aResults, TRequestStatus& aStatus) { - if (ExitIfJavaInstallerRunning(aResults, aStatus)) - { - return; - } - - // 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(); + RProcess rJavaInstaller; + TFileName fileName; + // Max two path names and some options -> 1536 is enough + TBuf<1536> commandLine; // 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(KInstall); + commandLine.Append(_L(" install")); // Check whether this is silent installation TInt silentInstall = 0; @@ -375,36 +294,175 @@ { 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(KSilent); + commandLine.Append(_L(" -silent")); } - else + + 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) { - // Uncomment this to enable 'preparing installation' dialog. - //TRAP(err, CreatePrepInstDialogL()); - //if (KErrNone != err) - //{ - // WLOG1(EJavaInstaller, - // "CJavaSifPlugin::Install Creating preparing installation dialog failed, err=%d", - // err); - //} + 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 } - BuildInstallCommandLine(commandLine, aArguments); + // 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); + } + // 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(KCommsResult); - commandLine.AppendNum(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); + commandLine.Append(_L(" -commsresult=11000")); - TFileName fileName; - err = aFileHandle.FullName(fileName); + TInt err = aFileHandle.FullName(fileName); // Java Installer does not have AllFiles capability. // So if the .jad/.jar file is in the private data cage of @@ -415,53 +473,74 @@ 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 - TBool isJad = EFalse; - err = IsJadFile(aFileHandle, aArguments, isJad); + RApaLsSession apaSession; + err = apaSession.Connect(); if (KErrNone != err) { - TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); + ELOG1(EJavaInstaller, + "CJavaSifPlugin::Install 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) + { + ELOG1(EJavaInstaller, + "CJavaSifPlugin::Install RApaLsSession RecognizeSpecificData error %d", err); + } if (isJad) { // Installation should be started from JAD file - commandLine.Append(KJad); + commandLine.Append(_L(" -jad=")); } else { // from JAR file - commandLine.Append(KJar); + commandLine.Append(_L(" -jar=")); } // Filename parameter must be surrounded in double quotes to // ensure that spaces in filename are passed correctly. - commandLine.Append(KDoubleQuote); + commandLine.Append(_L("\"")); commandLine.Append(fileName); - commandLine.Append(KDoubleQuote); + commandLine.Append(_L("\"")); // Start JavaInstaller std::auto_ptr installerProcess( stringToDes(java::runtime::JAVA_PROCESS)); - RProcess rJavaInstaller; err = rJavaInstaller.Create(installerProcess->Des(), commandLine); if (KErrNone == err) { - err = StartResultsServer(aResults, *mDummyInfo); + // 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(); + } 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; @@ -476,81 +555,37 @@ 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; } - if (!silentInstall) - { - TRAP(err, mWaitToHideDialog = - CAsyncWaitCallBack::NewL(TCallBack(HidePrepInstDialog, this))); - if (KErrNone == err) - { - // The active object will wait until JavaInstaller process calls Rendezvous. - // If JavaInstaller specifies reason code EJavaInstaller, then - // the active object will call callback function that will hide the - // 'Preparing installation' dialog. If reason code is not EJavaInstaller, - // the wait object will automatically wait for the next rendezvous. - mWaitToHideDialog->Wait( rJavaInstaller, EJavaInstaller ); - } - else - { - ELOG1(EJavaInstaller, "CJavaSifPlugin::Install: Creating " - "mWaitToHideDialog failed, err %d", err); - } - } rJavaInstaller.Resume(); // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - err = mHandlesToClose.Append(rJavaInstaller); - if ( err ) - { - rJavaInstaller.Close(); - ELOG1(EJavaInstaller, "CJavaSifPlugin::Install mHandles" - "ToClose.Append failed with error %d", err); - TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ELowMemory)); - TRequestStatus *statusPtr(&aStatus); - User::RequestComplete(statusPtr, err); - return; - } - + iHandlesToClose.Append(rJavaInstaller); } void CJavaSifPlugin::Uninstall( TComponentId aComponentId, const TSecurityContext& aSecurityContext, const COpaqueNamedParams& aArguments, - COpaqueNamedParams& aResults, + COpaqueNamedParams& /* aResults */, TRequestStatus& aStatus) { - if (ExitIfJavaInstallerRunning(aResults, aStatus)) - { - return; - } - - // 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(); + RProcess rJavaInstaller; + TFileName fileName; + // Max one uid and some options -> 256 is enough + TBuf<256> commandLine; // 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(KUninstall); + commandLine.Append(_L(" uninstall")); - commandLine.Append(KCid); + commandLine.Append(_L(" -cid=")); commandLine.AppendNum(aComponentId); // Check whether this is silent uninstallation @@ -563,35 +598,24 @@ { 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(KSilent); + commandLine.Append(_L(" -silent")); } + // 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)); - RProcess rJavaInstaller; - err = rJavaInstaller.Create(installerProcess->Des(), commandLine); + TInt 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); @@ -603,7 +627,6 @@ 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; @@ -611,17 +634,7 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - err = mHandlesToClose.Append(rJavaInstaller); - if ( err ) - { - rJavaInstaller.Close(); - ELOG1(EJavaInstaller, "CJavaSifPlugin::Uninstall mHandles" - "ToClose.Append failed with error %d", err); - TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ELowMemory)); - TRequestStatus *statusPtr(&aStatus); - User::RequestComplete(statusPtr, err); - return; - } + iHandlesToClose.Append(rJavaInstaller); } void CJavaSifPlugin::Activate( @@ -651,7 +664,7 @@ // Send cancel message to Java Installer // Check whether there is anything to cancel - if (mHandlesToClose.Count() < 1) + if (iHandlesToClose.Count() < 1) { // No Java Installer process running, do nothing WLOG(EJavaInstaller, @@ -659,47 +672,64 @@ return; } - CommsMessage message; - message.setReceiver(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C); - message.setSender(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); - message.setMessageId(INSTALLER_CANCEL_MESSAGE_ID); + 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 replyMessage; - int timeout = 10; // 10 seconds // codescanner::magicnumbers + CommsMessage replyMessage; + int timeout = 10; // 10 seconds - CommsClientEndpoint comms; - int err = comms.connect(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C); - if (KErrNone == err) - { - err = comms.sendReceive(message, replyMessage, timeout); + 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(); } - else + catch (ExceptionBase& e) { - // 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); + ELOG1(EJavaInstaller, + "CJavaSifPlugin: Send cancel msg failed: ExceptionBase caught: %s ", + e.toString().c_str()); return; } - if (err != 0) + catch (std::exception& e) { - // 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(); // codescanner::voidparameter + "CJavaSifPlugin: Send cancel msg failed: Exception %s caught", e.what()); 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. @@ -707,14 +737,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 (mHandlesToClose[mHandlesToClose.Count()-1].ExitReason() != 0) + if (iHandlesToClose[iHandlesToClose.Count()-1].ExitReason() != 0) { // Process has already closed return; } // Wait until it exits - mHandlesToClose[mHandlesToClose.Count()-1].Logon(status); - User::WaitForRequest(status); // codescanner::userWaitForRequest + iHandlesToClose[iHandlesToClose.Count()-1].Logon(status); + User::WaitForRequest(status); // Ignore the exit status of Java Installer because current SIF API // does not return cancel result @@ -725,7 +755,7 @@ { // Check if the file is in the private data cage of some process TInt idx = aFileName.FindF(KPrivateDataCage); - if ((idx != KErrNotFound) && (idx < 3)) // codescanner::magicnumbers + if ((idx != KErrNotFound) && (idx < 3)) { // In case of device Inbox or Java Installer itself do nothing if ((aFileName.FindF(KInboxDataCage) != KErrNotFound) || @@ -740,37 +770,19 @@ // (aFileName is \., copy \.* // to Java Installer tmp dir.) TParse fp; - mRFs.Parse(aFileName, fp); + iRFs.Parse(aFileName, fp); + + CFileMan* fm = CFileMan::NewL(iRFs); TFileName filesToCopy = fp.DriveAndPath(); filesToCopy.Append(fp.Name()); filesToCopy.Append(KAnyExtension); - - // Use JavaInstallCopier.exe to copy the files. - RProcess rJavaInstallCopier; - TInt err = rJavaInstallCopier.Create( - KJavaInstallCopierProcess, filesToCopy); - if (KErrNone == err) + TInt err = fm->Copy(filesToCopy, KJavaInstallerTmp, CFileMan::ERecurse); + delete fm; + if (KErrNone != err) { - TRequestStatus status; - rJavaInstallCopier.Logon(status); - rJavaInstallCopier.Resume(); - User::WaitForRequest(status); // codescanner::userWaitForRequest - err = rJavaInstallCopier.ExitReason(); - rJavaInstallCopier.Close(); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "CJavaSifPlugin::CopyFilesIfNeededL: copying files " - "to JavaInstaller data cage failed, err=%d", err); - User::Leave(err); - } - } - else - { - rJavaInstallCopier.Close(); ELOG1(EJavaInstaller, - "CJavaSifPlugin::CopyFilesIfNeededL: starting " - "JavaInstallCopier failed, err=%d", err); + "CJavaSifPlugin::CopyFilesIfNeededL: copying files " + "to Java Installer data cage failed, err=%d", err); User::Leave(err); } @@ -783,446 +795,4 @@ 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 - - // KSifInParam_AllowUpgradeData Yes/No/AskUser -> -upgrade_data=yes|no - intValue = GetPositiveIntParam(KSifInParam_AllowUpgradeData, 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) -{ - // If Java Installer is already running, set error category EInstallerBusy etc - // to aResults and return - - TInt err(KErrNone); - 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 - TRAP(err, aResults.AddIntL(KSifOutParam_ErrCategory, EInstallerBusy)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "CJavaSifPlugin::ExitIfJavaInstallerRunning aResults.AddIntL " - "ErrCategory err %d", err); - } - - TRAP(err, aResults.AddIntL(KSifOutParam_ErrCode, KErrInUse)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "CJavaSifPlugin::ExitIfJavaInstallerRunning aResults.AddIntL " - "ErrCode err %d", err); - } - - TRAP(err, aResults.AddIntL(KSifOutParam_ExtendedErrCode, 0)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "CJavaSifPlugin::ExitIfJavaInstallerRunning aResults.AddIntL " - "ExtendedErrCode err %d", err); - } - - // TODO: return also localized error message from usif - // common localization file after the localized strings are available - - TRequestStatus *statusPtr(&aStatus); - User::RequestComplete(statusPtr, KErrInUse); - return ETrue; - } - } - proc.Close(); - } - - return EFalse; -} - -/** - * Creates 'preparing installation' dialog. - */ -void CJavaSifPlugin::CreatePrepInstDialogL() -{ - ILOG(EJavaInstaller, "CJavaSifPlugin::CreatePrepInstDialogL creating dialog"); - mPrepInstDialog = CHbDeviceNotificationDialogSymbian::NewL(); - _LIT(KPrepInstText, "Preparing installation..."); - mPrepInstDialog->SetTitleL(KPrepInstText); - mPrepInstDialog->SetTimeout(20*1000); // ms - mPrepInstDialog->ShowL(); - ILOG(EJavaInstaller, "CJavaSifPlugin::CreatePrepInstDialogL dialog created"); -} - -void CJavaSifPlugin::HidePrepInstDialogL() -{ - ILOG(EJavaInstaller, "CJavaSifPlugin::HidePrepInstDialogL hiding dialog"); - // Stop further timed calls - if (mWaitToHideDialog) - { - mWaitToHideDialog->Cancel(); - } - // Close wait dialog. - if (mPrepInstDialog) - { - mPrepInstDialog->Close(); - } - ILOG(EJavaInstaller, "CJavaSifPlugin::HidePrepInstDialogL dialog hidden"); -} - // End of File diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/javasifplugin/src/proxy.cpp --- a/javamanager/javainstaller/javasifplugin/src/proxy.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/src/proxy.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). +* 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" @@ -26,7 +26,7 @@ // CONSTANTS const TImplementationProxy KImplementationTable[] = { IMPLEMENTATION_PROXY_ENTRY(KJavaSifPluginEcomImplUid, - java::installer::CJavaSifPlugin::NewL) + Java::Installer::CJavaSifPlugin::NewL) }; // ----------------------------------------------------------------------------- diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/javasifplugin/src/resultsserver.cpp --- a/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 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 the License "Eclipse Public License v1.0" @@ -11,18 +11,14 @@ * * Contributors: * -* 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. +* Description: Comms server, +* part of Java platform 2.0 javarestoreconverter process * */ #include #include -#include #include "comms.h" #include "javasymbianoslayer.h" @@ -33,7 +29,7 @@ using namespace std; ResultsServer::ResultsServer(COpaqueNamedParams& aResults, CComponentInfo& aInfo) : - mResults(aResults), mInfo(aInfo) + iResults(aResults), iInfo(aInfo) { } @@ -48,43 +44,23 @@ int ResultsServer::start() { - // 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, mResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "ResultsServer::start mResults.AddIntL ErrCategory err %d", err); - } - - TRAP(err, mResults.AddIntL(KSifOutParam_ErrCode, KErrUnknown)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "ResultsServer::start mResults.AddIntL ErrCode err %d", err); - } - - TRAP(err, mResults.AddIntL(KSifOutParam_ExtendedErrCode, 0)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "ResultsServer::start mResults.AddIntL ExtendedErrCode err %d", err); - } - - // TODO: return also localized error message (KSifOutParam_ErrMessage and - // perhaps also KSifOutParam_ErrMessageDetails) from usif - // common localization file after the localized strings are available - - - mComms.registerDefaultListener(this); - return mComms.start(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); + iRunning = 1; + iComms.registerDefaultListener(this); + return iComms.start(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); } int ResultsServer::stop() { - mComms.unregisterDefaultListener(this); - return mComms.stop(); + if (iRunning > 0) + { + iRunning = 0; + iComms.unregisterDefaultListener(this); + return iComms.stop(); + } + else + { + return 0; + } } /** @@ -141,8 +117,66 @@ if (KErrNone != result) { - // return common error information; - setCommonErrorInfo(); + // return common error information + TRAP(err, iResults.AddIntL(KSifOutParam_ExtendedErrCode, result)); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::processMessage iResults.AddIntL ExtendedErrCode err %d", + err); + } + + 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; + } if (INSTALL_OPERATION == operation) { @@ -163,21 +197,17 @@ } else { - // Operation succeeded - - // Overwrite (reset) the default error values set for the case where no - // InstallerResultMessage is never received - resetDefaultErrorValues(); + // operation succeeded if (INSTALL_OPERATION == operation) { // Return the component ids of the installed Java application. TComponentId resultComponentId = iIntPairs[L"suite-cid"]; - TRAP(err, mResults.AddIntL(KSifOutParam_ComponentId, resultComponentId)); + TRAP(err, iResults.AddIntL(KSifOutParam_ComponentId, resultComponentId)); if (KErrNone != err) { ELOG1(EJavaInstaller, - "ResultsServer::processMessage mResults.AddIntL cid error %d", err); + "ResultsServer::processMessage iResults.AddIntL cid error %d", err); } } else if (UNINSTALL_OPERATION == operation) @@ -209,7 +239,7 @@ reply.setMessageId(INSTALLER_RESULT_RESPONSE_MESSAGE_ID); reply << 0; - int err = mComms.send(reply); + int err = iComms.send(reply); if (err != 0) { ELOG1(EJavaInstaller, @@ -232,95 +262,6 @@ } -/** - * 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(); @@ -359,7 +300,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) @@ -385,8 +326,8 @@ CleanupStack::Pop(applicationInfo); n++; - } // sanity check: no suite can have 10000 midlets - while (n < 10000); // codescanner::magicnumbers + } + while (n < 10000); // sanity check: no suite can have 10000 midlets CComponentInfo::CNode *rootNode = NULL; rootNode = CComponentInfo::CNode::NewLC( @@ -407,7 +348,7 @@ ); // Store whole component info tree - mInfo.SetRootNodeL(rootNode); + iInfo.SetRootNodeL(rootNode); CleanupStack::Pop(rootNode); CleanupStack::PopAndDestroy(&applications); } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/javasifplugin/tsrc/build/testsifapi.pro --- a/javamanager/javainstaller/javasifplugin/tsrc/build/testsifapi.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/tsrc/build/testsifapi.pro Fri Oct 22 14:23:56 2010 +0100 @@ -23,7 +23,7 @@ symbian { TARGET.UID2 = 0 TARGET.UID3 = 0xE0E5E262 - TARGET.CAPABILITY = all -tcb -drm + TARGET.CAPABILITY = WriteDeviceData TrustedUI LIBS += -lestor -lapparc -lapgrfx -lefsrv -lsif diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp --- a/javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -31,16 +31,7 @@ using namespace Usif; _LIT(KTestMIDlet, "E:\\stopwatch10midp2.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"); - +//_LIT(KTestMIDlet, "C:\\data\\installs\\DS_Snow.jad"); /** * Installs a component by file name @@ -73,82 +64,6 @@ 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 */ @@ -174,9 +89,8 @@ User::Leave(err); } -// TEMP TEST RFile installFile; - err = installFile.Open(fs, KTestMIDlet3, EFileShareReadersOnly | EFileRead); + err = installFile.Open(fs, KTestMIDlet, EFileShareReadersOnly | EFileRead); if (KErrNone != err) { ELOG1(EJavaConverters, @@ -211,32 +125,6 @@ // 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"); @@ -267,90 +155,6 @@ 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) { @@ -492,50 +296,8 @@ 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(1); + CleanupStack::PopAndDestroy(2); } @@ -588,18 +350,6 @@ LOG(EJavaConverters, EInfo, "testsifapi: cancelFunction: Called"); - // TEMP TEST - // This thread does not have active scheduler, - // create and install it - CActiveScheduler* as = new CActiveScheduler(); - if (NULL == as) - { - ELOG(EJavaConverters, - "testsifapi: cancelFunction: Cannot create active scheduler"); - return 1; - } - 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); @@ -609,13 +359,9 @@ ((RSoftwareInstall *)installer)->CancelOperation(); - LOG(EJavaConverters, EInfo, "testsifapi: cancelFunction: Starting CActiveScheduler"); - CActiveScheduler::Start(); - LOG(EJavaConverters, EInfo, "testsifapi: cancelFunction: CancelOperation() was called"); - delete as; return 0; } @@ -653,7 +399,6 @@ "testsifapi: cancelFromSameThread: CancelOperation() returned"); } - static void cancelInstallL() { LOG(EJavaConverters, EInfo, @@ -693,30 +438,6 @@ } -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 @@ -724,35 +445,35 @@ */ TInt E32Main() { -// __UHEAP_MARK; +/* + 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; CTrapCleanup* cleanupStack = CTrapCleanup::New(); TInt err = KErrNone; - LOG(EJavaConverters, EInfo, "testsifapi: starting cancelNoOperationL"); - TRAP(err, cancelNoOperationL()); - if (KErrNone != err) - { - ELOG1(EJavaConverters, "testsifapi: cancelNoOperationL leaved with err %d", err); - } + /* + TRAP(err, cancelInstallL()); + if (KErrNone != err) + { + ELOG1(EJavaConverters, "testsifapi: cancelInstallL 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) { @@ -763,25 +484,8 @@ 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); - } + TInt componentId = 0; - // 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) { @@ -791,22 +495,7 @@ // Wait for a moment User::After(500000); - - // 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"); + // TODO: if this fails, it leaks memory TRAP(err, sifGetComponentInfoL()); if (KErrNone != err) { @@ -816,7 +505,6 @@ // Wait for a moment User::After(500000); - LOG(EJavaConverters, EInfo, "testsifapi: starting sifActivationTestL"); TRAP(err, sifActivationTestL(componentId)); if (KErrNone != err) { @@ -831,7 +519,6 @@ // TODO: if this fails, it leaks memory if (0 != componentId) { - LOG(EJavaConverters, EInfo, "testsifapi: starting sifUninstallL"); TRAP(err, sifUninstallL(componentId)); if (KErrNone != err) { @@ -843,9 +530,8 @@ User::After(500000); } - delete cleanupStack; // __UHEAP_MARKEND; -// __UHEAP_MARKENDC(1); + __UHEAP_MARKENDC(1); return KErrNone; } diff -r 461e71b327da -r 0553e2305d00 javamanager/javainstaller/subsystem.mk --- a/javamanager/javainstaller/subsystem.mk Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javainstaller/subsystem.mk Fri Oct 22 14:23:56 2010 +0100 @@ -20,19 +20,22 @@ installerui/build \ installer/build \ -ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - NONQTSUBSYSTEMS = javasifplugin/build - SYMBIAN_ONLY = javasifplugin/build - COMPONENTS += installcopier/build +NONQTSUBSYSTEMS = \ + appinstuiplugin/build + +SYMBIAN_ONLY = \ + appinstuiplugin/build + +ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + NONQTSUBSYSTEMS += javasifplugin/build + SYMBIAN_ONLY += javasifplugin/build else - NONQTSUBSYSTEMS = appinstuiplugin/build - SYMBIAN_ONLY = appinstuiplugin/build ifndef RD_JAVA_S60_RELEASE_5_0_IAD NONQTSUBSYSTEMS += iconsizenotifplugin/build SYMBIAN_ONLY += iconsizenotifplugin/build endif endif - + LINUX_ONLY = include ${JAVA_SRC_ROOT}/build/Makefile.subsystem diff -r 461e71b327da -r 0553e2305d00 javamanager/javalauncher/build/javalauncher_0x2001E262.mmp --- a/javamanager/javalauncher/build/javalauncher_0x2001E262.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javalauncher/build/javalauncher_0x2001E262.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javamanager/javalauncher/src.s60/javalauncher.cpp --- a/javamanager/javalauncher/src.s60/javalauncher.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javalauncher/src.s60/javalauncher.cpp Fri Oct 22 14:23:56 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,10 +549,6 @@ 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; @@ -676,8 +672,8 @@ LOG(EJavaCaptain, EInfo, "javalauncher: startJavaCaptain javacaptain.exe was started ok"); #endif - // Wait 3 seconds so that Java Captain has time to start and get read to answer Comms - User::After(3000000); // codescanner::userafter + // Wait 3 seconds so that Java Captain has time to start + User::After(3000000); } else { @@ -777,8 +773,6 @@ "javalauncher: OMJ app launch: Exception %s caught", e.what()); } - delete pBufCmdLine; - return err; } diff -r 461e71b327da -r 0553e2305d00 javamanager/javamanager.pro --- a/javamanager/javamanager.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javamanager.pro Fri Oct 22 14:23:56 2010 +0100 @@ -17,13 +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 \"javasidchecker/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javaappschemeplugin/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 461e71b327da -r 0553e2305d00 javamanager/javarecognizer/build/recjar.mmp --- a/javamanager/javarecognizer/build/recjar.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javarecognizer/build/recjar.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -32,11 +32,7 @@ // Use bytepair compression to enable code paging PAGED -APP_LAYER_SYSTEMINCLUDE - USERINCLUDE ../inc -USERINCLUDE ../../../inc - SOURCEPATH ../src SOURCE recjar.cpp @@ -44,6 +40,9 @@ TARGET recjar.rsc END +SYSTEMINCLUDE ../../../inc +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE /epoc32/include/ecom LIBRARY euser.lib apmime.lib efsrv.lib diff -r 461e71b327da -r 0553e2305d00 javamanager/javarecognizer/data/102031FB.rss diff -r 461e71b327da -r 0553e2305d00 javamanager/javarecognizer/src/recjar.cpp --- a/javamanager/javarecognizer/src/recjar.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javarecognizer/src/recjar.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -100,7 +100,7 @@ weOwnFileHandle = ETrue; } - TInt fileRemaining = 0; + TInt fileRemaining; User::LeaveIfError(file->Size(fileRemaining)); if (fileRemaining > aBuffer.Length()) { diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/build/eabi/javaregistryclientu.def --- a/javamanager/javaregistry/build/eabi/javaregistryclientu.def Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/build/eabi/javaregistryclientu.def Fri Oct 22 14:23:56 2010 +0100 @@ -209,12 +209,4 @@ _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 461e71b327da -r 0553e2305d00 javamanager/javaregistry/build/javaregistryclient_0x10282476.mmp --- a/javamanager/javaregistry/build/javaregistryclient_0x10282476.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/build/javaregistryclient_0x10282476.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../client/inc diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/client/src/javaattribute.cpp --- a/javamanager/javaregistry/client/src/javaattribute.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/client/src/javaattribute.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -92,7 +92,7 @@ // --------------------------------------------------------------------------- // CJavaAttribute::~MJavaAttribute // --------------------------------------------------------------------------- -EXPORT_C CJavaAttribute::~CJavaAttribute() +CJavaAttribute::~CJavaAttribute() { delete iName; delete iValue; diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/client/src/javaregistryentry.cpp --- a/javamanager/javaregistry/client/src/javaregistryentry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/client/src/javaregistryentry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -115,7 +115,7 @@ // CJavaRegistryEntry::~CJavaRegistryEntry // --------------------------------------------------------------------------- // -EXPORT_C CJavaRegistryEntry::~CJavaRegistryEntry() +CJavaRegistryEntry::~CJavaRegistryEntry() { if (iWritableEntry) { diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/client/src/writeablejavaregistry.cpp --- a/javamanager/javaregistry/client/src/writeablejavaregistry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/client/src/writeablejavaregistry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -363,17 +363,9 @@ if (KErrNotFound == err) { - // reset the error flag - err = KErrNone; if (IsPresent((*iter))) { - err = aUids.Append(uid); - } - if (err) - { - ELOG1(EJavaStorage, "Failed to add Uid to container. " - "( error code = %d )", err); - + aUids.Append(uid); } } } @@ -422,7 +414,7 @@ } } } - catch (ExceptionBase& ee) + catch (ExceptionBase) { ELOG1WSTR(EJavaStorage, "MediaId conversion failed: '%s'", value); } diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/client/src/writeablejavaregistryentry.cpp --- a/javamanager/javaregistry/client/src/writeablejavaregistryentry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/client/src/writeablejavaregistryentry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -379,7 +379,7 @@ regAttr = CJavaAttribute::NewL( nameBuf->Des(), valueBuf->Des(), trusted); - iAttributes.AppendL(regAttr); + iAttributes.Append(regAttr); nameBuf.reset(0); valueBuf.reset(0); diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/javasizehelper/client/build/javasizehelperclient_0x2002DCD1.mmp --- a/javamanager/javaregistry/javasizehelper/client/build/javasizehelperclient_0x2002DCD1.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/javasizehelper/client/build/javasizehelperclient_0x2002DCD1.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../client/inc diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/javasizehelper/server/build/javasizehelperserver_0x2002DCD2.mmp --- a/javamanager/javaregistry/javasizehelper/server/build/javasizehelperserver_0x2002DCD2.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/javasizehelper/server/build/javasizehelperserver_0x2002DCD2.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -53,6 +53,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/legacy/server/src/javaregstore.cpp --- a/javamanager/javaregistry/legacy/server/src/javaregstore.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/legacy/server/src/javaregstore.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -543,7 +543,7 @@ { if (IsPresentL((*iter))) { - aUids.AppendL(uid); + aUids.Append(uid); } } } @@ -765,7 +765,7 @@ TInt err = uidToTUid(appUid, converted); if (KErrNone == err) { - uids.AppendL(converted); + uids.Append(converted); } else { diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/legacy/tsrc/build/testlegacyregistry.mmp --- a/javamanager/javaregistry/legacy/tsrc/build/testlegacyregistry.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/build/testlegacyregistry.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -20,10 +20,9 @@ CAPABILITY all -tcb -allfiles -drm #include <../../../../../inc/java_stdcpp_support_for_exe.hrh> -#include +#include -USERINCLUDE /epoc32/include/CppUTest // Due to TestHarness.h et al - +USERINCLUDE /epoc32/include/cpputest USERINCLUDE ../src/utils USERINCLUDE ../../../../../inc // == (JAVA_SRC_ROOT)/inc USERINCLUDE ../../../../../jrt_plat/java_registry_api/inc diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/legacy/tsrc/src/AllTests.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/AllTests.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/AllTests.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -15,8 +15,8 @@ * */ -#include -#include +#include "Platform.h" +#include "CommandLineTestRunner.h" int main(int ac, char** av) { diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include +#include "TestHarness.h" #include "javastorage.h" #include "javastorageexception.h" diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistryentry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistryentry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistryentry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include +#include "TestHarness.h" #include "javastorage.h" #include "javastorageexception.h" diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/legacy/tsrc/src/testlegacyregistry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testlegacyregistry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testlegacyregistry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include +#include "TestHarness.h" #include "javacommonutils.h" #include "javaoslayer.h" diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/legacy/tsrc/src/testmidletentry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testmidletentry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testmidletentry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include +#include "TestHarness.h" #include "javacommonutils.h" #include "javaoslayer.h" diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/legacy/tsrc/src/testsuiteentry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testsuiteentry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testsuiteentry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include +#include "TestHarness.h" #include "javacommonutils.h" #include "javaoslayer.h" diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/tsrc/build/alltests.mmp --- a/javamanager/javaregistry/tsrc/build/alltests.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/tsrc/build/alltests.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -21,12 +21,12 @@ #include <../../../../inc/java_stdcpp_support_for_exe.hrh> #include - -APP_LAYER_SYSTEMINCLUDE + APP_LAYER_SYSTEMINCLUDE +MW_LAYER_SYSTEMINCLUDE -USERINCLUDE /epoc32/include/CppUTest // Due to TestHarness.h et al +USERINCLUDE /epoc32/include/cpputest +USERINCLUDE ../src/utils -USERINCLUDE ../src/utils USERINCLUDE ../../../../inc // == (JAVA_SRC_ROOT)/inc // Using main() as entry point diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/tsrc/src/AllTests.cpp --- a/javamanager/javaregistry/tsrc/src/AllTests.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/AllTests.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -15,8 +15,8 @@ * */ -#include -#include +#include "Platform.h" +#include "CommandLineTestRunner.h" int main(int ac, char** av) { diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/tsrc/src/AllTests.h --- a/javamanager/javaregistry/tsrc/src/AllTests.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/AllTests.h Fri Oct 22 14:23:56 2010 +0100 @@ -15,7 +15,7 @@ * */ -#include +#include "Utest.h" //Include this in the test main to execute these tests IMPORT_TEST_GROUP(TestRegistry); diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/tsrc/src/testregistry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -19,7 +19,7 @@ #include #include -#include +#include "TestHarness.h" #include "javastorage.h" #include "javastorageexception.h" diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/tsrc/src/testregistryapplicationentry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistryapplicationentry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistryapplicationentry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -19,7 +19,7 @@ #include #include -#include +#include "TestHarness.h" #include "javaregistry.h" #include "javaregistryapplicationentry.h" diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/tsrc/src/testregistryentry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistryentry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistryentry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -20,7 +20,7 @@ #include #include -#include +#include "TestHarness.h" #include "javastorage.h" #include "javastorageexception.h" diff -r 461e71b327da -r 0553e2305d00 javamanager/javaregistry/tsrc/src/testregistrypackageentry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistrypackageentry.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistrypackageentry.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -19,7 +19,7 @@ #include #include -#include +#include "TestHarness.h" #include "javaprocessconstants.h" #include "javaregistry.h" diff -r 461e71b327da -r 0553e2305d00 javamanager/javasettings/appmngrplugin/build/appmngr2midletruntime.mmp --- a/javamanager/javasettings/appmngrplugin/build/appmngr2midletruntime.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/build/appmngr2midletruntime.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -31,12 +31,8 @@ PAGED -APP_LAYER_SYSTEMINCLUDE - -USERINCLUDE ../inc -USERINCLUDE ../../../../inc -USERINCLUDE ../javapackagelookup/inc -USERINCLUDE ../help/inc +USERINCLUDE ../javapackagelookup/inc +USERINCLUDE ../help/inc USERINCLUDE ../../../javainstaller/iconsizenotifplugin/inc SOURCEPATH ../javapackagelookup/src @@ -71,6 +67,11 @@ LANGUAGE_IDS END +USERINCLUDE ../inc + +APP_LAYER_SYSTEMINCLUDE +SYSTEMINCLUDE ../../../../inc + LIBRARY bafl.lib // Syslibs BAFL LIBRARY appmngr2pluginapi.lib // AppMngr2 Runtime API LIBRARY cone.lib // App Framework diff -r 461e71b327da -r 0553e2305d00 javamanager/javasettings/appmngrplugin/data/20016bf7.rss diff -r 461e71b327da -r 0553e2305d00 javamanager/javasettings/appmngrplugin/inc/appmngr2midletsettingshandler.h --- a/javamanager/javasettings/appmngrplugin/inc/appmngr2midletsettingshandler.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/inc/appmngr2midletsettingshandler.h Fri Oct 22 14:23:56 2010 +0100 @@ -118,12 +118,12 @@ * ApplicationInfo::OPERATOR_DOMAIN * ApplicationInfo::UNIDENTIFIED_THIRD_PARTY_DOMAIN */ - const std::wstring GetSecurityDomainCategoryL(); + const std::wstring GetSecurityDomainCategory(); /** * Gets security domain name */ - const std::wstring GetSecurityDomainNameL(); + const std::wstring GetSecurityDomainName(); /** * Gets security warnings mode value diff -r 461e71b327da -r 0553e2305d00 javamanager/javasettings/appmngrplugin/inc/appmngr2midletsettingsutil.h --- a/javamanager/javasettings/appmngrplugin/inc/appmngr2midletsettingsutil.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/inc/appmngr2midletsettingsutil.h Fri Oct 22 14:23:56 2010 +0100 @@ -60,7 +60,7 @@ const int READ_USER_DATA_ACCESS_SETTINGS_DISPLAY_INDEX = 10; const int WRITE_USER_DATA_ACCESS_SETTINGS_DISPLAY_INDEX = 11; const int LOCATION_SETTINGS_DISPLAY_INDEX = 12; -const int LANDMARK_SETTINGS_DISPLAY_INDEX = 13; +const int LANDMARK_SETTINGS_DISPLAY_INDEX = 12; const int AUTHENTICATION_SETTINGS_DISPLAY_INDEX = 14; const int SMART_CARD_COMMUNICATION_SETTINGS_DISPLAY_INDEX = 15; const int BROADCAST_SETTINGS_DISPLAY_INDEX = 16; @@ -210,7 +210,6 @@ private: static const std::wstring getLocalizedSettingsName(std::wstring aSettingsName); - static HBufC* getLocalizedSettingsNameLC(std::wstring aSettingsName); static const std::wstring getLocalizedSettingsInteractionMode(int aInteractionMode); static const std::wstring getLocalizedOnScreenKeypadValue(std::wstring aOnScreenKeypadValue); static const std::wstring getLocalizedSecurityWarningsModeValue(std::wstring aSecurityWarningsModeValue); diff -r 461e71b327da -r 0553e2305d00 javamanager/javasettings/appmngrplugin/src/appmngr2midletappinfo.cpp --- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletappinfo.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletappinfo.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -779,15 +779,15 @@ ELOG1(EJavaAppMngrPlugin, "GetAppIconL error %d", err); } } - + CleanupStack::PopAndDestroy(&midletUids); // security domain CAppMngr2MidletSettingsHandler* settingsHandler = CAppMngr2MidletSettingsHandler::NewL(*iLocalizedMIDletName, iEntry->Uid(), iResourceHandler); CleanupStack::PushL(settingsHandler); - iSecurityDomainCategory = settingsHandler->GetSecurityDomainCategoryL(); - iSecurityDomainName = settingsHandler->GetSecurityDomainNameL(); + iSecurityDomainCategory = settingsHandler->GetSecurityDomainCategory(); + iSecurityDomainName = settingsHandler->GetSecurityDomainName(); CleanupStack::PopAndDestroy(settingsHandler); if (iSecurityDomainCategory != UNIDENTIFIED_THIRD_PARTY_DOMAIN_CATEGORY) { @@ -998,20 +998,20 @@ void CAppMngr2MidletAppInfo::GetAppIconL(TUid aMidletUid) { LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::GetAppIconL"); - + ASSERT(!iAppBitmap); ASSERT(!iAppMask); - + RApaLsSession lsSession; - User::LeaveIfError(lsSession.Connect()); + User::LeaveIfError(lsSession.Connect()); CleanupClosePushL(lsSession); CApaMaskedBitmap* apaBmp = CApaMaskedBitmap::NewLC(); - + TSize size = static_cast(Runtime()).JavaRasterIconSize(); TInt err = lsSession.GetAppIcon(aMidletUid, size, *apaBmp); if (err == KErrNone) { - iAppBitmap = new (ELeave) CFbsBitmap(); + iAppBitmap = new (ELeave) CFbsBitmap(); iAppMask = new (ELeave) CFbsBitmap(); User::LeaveIfError(iAppBitmap->Duplicate(apaBmp->Handle())); User::LeaveIfError(iAppMask->Duplicate(apaBmp->Mask()->Handle())); @@ -1025,6 +1025,6 @@ EAknsAppIconTypeList, iAppBitmap, iAppMask); CleanupStack::Pop(2); // iAppBitmap, iAppMask } - + LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::GetAppIconL"); } diff -r 461e71b327da -r 0553e2305d00 javamanager/javasettings/appmngrplugin/src/appmngr2midletinfoiterator.cpp --- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletinfoiterator.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletinfoiterator.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -17,7 +17,7 @@ #include // StringLoader -#include // Resource IDs +#include // Resource IDs #include // Midlet resource IDs #include // AknTextUtils #include // KJadMimeType diff -r 461e71b327da -r 0553e2305d00 javamanager/javasettings/appmngrplugin/src/appmngr2midletmanifestreader.cpp --- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletmanifestreader.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletmanifestreader.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -119,7 +119,7 @@ { CJavaAttribute* javaAttribute = CJavaAttribute::NewL(namePtr, valuePtr, EFalse); - aAttributes.AppendL(javaAttribute); + aAttributes.Append(javaAttribute); } CleanupStack::PopAndDestroy(value); diff -r 461e71b327da -r 0553e2305d00 javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingshandler.cpp --- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingshandler.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingshandler.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -244,11 +244,9 @@ findEntry(queryResult, VALUE, value); - if (value.size() > 0 - && ((value == L"no") - || (value == L"navigationkeys") - || (value == L"gameactions"))) + if (value.size() > 0) { + // default is KValueGameactions if value is not defined predefined = true; } LOG(EJavaAppMngrPlugin, EInfo, " - CAppMngr2MidletSettingsHandler::OnScreenKeypadValuePreDefinedL "); @@ -306,7 +304,7 @@ LOG(EJavaAppMngrPlugin, EInfo, " - CAppMngr2MidletSettingsHandler::SetCurrentSuiteSnapL "); } -const std::wstring CAppMngr2MidletSettingsHandler::GetSecurityDomainCategoryL() +const std::wstring CAppMngr2MidletSettingsHandler::GetSecurityDomainCategory() { wstring securityDomainCategory = L""; @@ -325,7 +323,6 @@ catch (JavaStorageException& aJse) { ELOG1(EJavaAppMngrPlugin, "SECURITY_DOMAIN_CATEGORY value read failed: %d", aJse.mStatus); - User::Leave(KErrLocked); } findEntry(queryResult, SECURITY_DOMAIN_CATEGORY, securityDomainCategory); @@ -334,7 +331,7 @@ } -const std::wstring CAppMngr2MidletSettingsHandler::GetSecurityDomainNameL() +const std::wstring CAppMngr2MidletSettingsHandler::GetSecurityDomainName() { wstring securityDomainName = L""; @@ -353,7 +350,6 @@ catch (JavaStorageException& aJse) { ELOG1(EJavaAppMngrPlugin, "SECURITY_DOMAIN value read failed: %d", aJse.mStatus); - User::Leave(KErrLocked); } findEntry(queryResult, SECURITY_DOMAIN, securityDomainName); diff -r 461e71b327da -r 0553e2305d00 javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingsutil.cpp --- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingsutil.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingsutil.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -488,121 +488,86 @@ { wstring ret = aSettingsName; TRAP_IGNORE( - HBufC* localizedName = getLocalizedSettingsNameLC(aSettingsName); - if (localizedName != NULL) + HBufC* localizedName = NULL; + if (aSettingsName == ACCESS_POINT_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NETWORK_DESTINATION); + } + else if (aSettingsName == ON_SCREEN_KEYPAD_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_KEYPAD); + } + else if (aSettingsName == SECURITY_WARNINGS_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SECURITY_WARNINGS); + } + else if (aSettingsName == NET_ACCESS_SETTINGS) { - ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); - CleanupStack::PopAndDestroy(localizedName); + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NET_ACCESS); + } + else if (aSettingsName == LOW_LEVEL_NET_ACCESS_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOW_LEVEL_NET_ACCESS); + } + else if (aSettingsName == CALL_CONTROL_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_CALL_CONTROL); + } + else if (aSettingsName == MESSAGING_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MESSAGING); + } + else if (aSettingsName == RESTRICTED_MESSAGING_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_MESSAGING); + } + else if (aSettingsName == APPLICATION_AUTO_INVOCATION_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_APP_AUTO_INVOCAT); } - ); - return ret; -} - -HBufC* AppMngr2MidletSettingsUtil::getLocalizedSettingsNameLC(wstring aSettingsName) -{ - HBufC* localizedName = NULL; - if (aSettingsName == ACCESS_POINT_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NETWORK_DESTINATION); - } - else if (aSettingsName == ON_SCREEN_KEYPAD_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_KEYPAD); - } - else if (aSettingsName == SECURITY_WARNINGS_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SECURITY_WARNINGS); - } - else if (aSettingsName == NET_ACCESS_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NET_ACCESS); - } - else if (aSettingsName == LOW_LEVEL_NET_ACCESS_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOW_LEVEL_NET_ACCESS); - } - else if (aSettingsName == CALL_CONTROL_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_CALL_CONTROL); - } - else if (aSettingsName == MESSAGING_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MESSAGING); - } - else if (aSettingsName == RESTRICTED_MESSAGING_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_MESSAGING); - } - else if (aSettingsName == APPLICATION_AUTO_INVOCATION_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_APP_AUTO_INVOCAT); - } - else if (aSettingsName == LOCAL_CONNECTIVITY_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCAL_CONN); - } - else if (aSettingsName == MULTIMEDIA_RECORDING_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MM_RECORD); - } - else if (aSettingsName == READ_USER_DATA_ACCESS_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_READ_DATA); - } - else if (aSettingsName == WRITE_USER_DATA_ACCESS_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_WRITE_DATA); - } - else if (aSettingsName == LOCATION_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCATION); - } - else if (aSettingsName == LANDMARK_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LANDMARKS); - } - else if (aSettingsName == AUTHENTICATION_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_AUT); - } - else if (aSettingsName == SMART_CARD_COMMUNICATION_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SMARTCARD); - } - else if (aSettingsName == BROADCAST_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_BROADCAST); - } - else if (aSettingsName == NFC_WRITE_ACCESS_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NFC_WRITE_ACCESS); - } - else if (aSettingsName == URL_START_SETTINGS) - { - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_URL_START); - } - return localizedName; -} - -const wstring AppMngr2MidletSettingsUtil::getLocalizedSettingsInteractionMode(int aInteractionMode) -{ - wstring ret = L""; - TRAP_IGNORE( - HBufC* localizedName = NULL; - switch (aInteractionMode) + else if (aSettingsName == LOCAL_CONNECTIVITY_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCAL_CONN); + } + else if (aSettingsName == MULTIMEDIA_RECORDING_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MM_RECORD); + } + else if (aSettingsName == READ_USER_DATA_ACCESS_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_READ_DATA); + } + else if (aSettingsName == WRITE_USER_DATA_ACCESS_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_WRITE_DATA); + } + else if (aSettingsName == LOCATION_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCATION); + } + else if (aSettingsName == LANDMARK_SETTINGS) { - case INTERACTION_MODE_BLANKET: - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_BLANK); - break; - case INTERACTION_MODE_SESSION: - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_SESSION); - break; - case INTERACTION_MODE_ONESHOT: - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_ONESHOT); - break; - case INTERACTION_MODE_DENIED: - localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_NO); - break; + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LANDMARKS); + } + else if (aSettingsName == AUTHENTICATION_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_AUT); + } + else if (aSettingsName == SMART_CARD_COMMUNICATION_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SMARTCARD); + } + else if (aSettingsName == BROADCAST_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_BROADCAST); + } + else if (aSettingsName == NFC_WRITE_ACCESS_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NFC_WRITE_ACCESS); + } + else if (aSettingsName == URL_START_SETTINGS) + { + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_URL_START); } if (localizedName != NULL) { @@ -613,50 +578,71 @@ return ret; } +const wstring AppMngr2MidletSettingsUtil::getLocalizedSettingsInteractionMode(int aInteractionMode) +{ + HBufC* localizedName = NULL; + switch (aInteractionMode) + { + case INTERACTION_MODE_BLANKET: + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_BLANK); + break; + case INTERACTION_MODE_SESSION: + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_SESSION); + break; + case INTERACTION_MODE_ONESHOT: + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_ONESHOT); + break; + case INTERACTION_MODE_DENIED: + localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_NO); + break; + default: + return L""; + } + wstring ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); + CleanupStack::PopAndDestroy(localizedName); + return ret; +} + const wstring AppMngr2MidletSettingsUtil::getLocalizedSecurityWarningsModeValue(wstring aSecurityWarningsModeValue) { - wstring ret = L""; - TRAP_IGNORE( - HBufC* localizedName = NULL; - if (aSecurityWarningsModeValue == SECURITY_WARNINGS_DEFAULT_MODE) - { - localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_DEFAULT); - } - else if (aSecurityWarningsModeValue == SECURITY_WARNINGS_USER_DEFINED_MODE) - { - localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_USER_DEFINED); - } - if (localizedName != NULL) - { - ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); - CleanupStack::PopAndDestroy(localizedName); - } - ); + HBufC* localizedName = NULL; + if (aSecurityWarningsModeValue == SECURITY_WARNINGS_DEFAULT_MODE) + { + localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_DEFAULT); + } + else if (aSecurityWarningsModeValue == SECURITY_WARNINGS_USER_DEFINED_MODE) + { + localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_USER_DEFINED); + } + else + { + return L""; + } + wstring ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); + CleanupStack::PopAndDestroy(localizedName); return ret; } const wstring AppMngr2MidletSettingsUtil::getLocalizedOnScreenKeypadValue(wstring aOnScreenKeypadValue) { - wstring ret = L""; - TRAP_IGNORE( - HBufC* localizedName = NULL; - if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NO) - { - localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NO); - } - else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_GAMEACTIONS) - { - localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_GAME); - } - else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NAVIGATION) - { - localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NAVIGATION); - } - if (localizedName != NULL) - { - ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); - CleanupStack::PopAndDestroy(localizedName); - } - ); + HBufC* localizedName = NULL; + if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NO) + { + localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NO); + } + else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_GAMEACTIONS) + { + localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_GAME); + } + else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NAVIGATION) + { + localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NAVIGATION); + } + else + { + return L""; + } + wstring ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); + CleanupStack::PopAndDestroy(localizedName); return ret; } diff -r 461e71b327da -r 0553e2305d00 javamanager/javasettings/subsystem.mk --- a/javamanager/javasettings/subsystem.mk Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javasettings/subsystem.mk Fri Oct 22 14:23:56 2010 +0100 @@ -17,7 +17,10 @@ include $(JAVA_SRC_ROOT)/build/Makefile.defs -ifndef RD_JAVA_APPLICATION_SETTINGS_QT +ifdef RD_JAVA_APPLICATION_SETTINGS_QT +COMPONENTS += appsettingsview_qt/build +SYMBIAN_ONLY += appsettingsview_qt/build +else ifndef RD_JAVA_S60_RELEASE_5_0_IAD NONQTSUBSYSTEMS += appmngrplugin/build SYMBIAN_ONLY += appmngrplugin/build diff -r 461e71b327da -r 0553e2305d00 javamanager/javasidchecker/build/javasidchecker.mmp --- a/javamanager/javasidchecker/build/javasidchecker.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javasidchecker/build/javasidchecker.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -39,7 +39,8 @@ // Includes USERINCLUDE . USERINCLUDE ../inc -USERINCLUDE ../../../inc + +SYSTEMINCLUDE ../../../inc /epoc32/include/ecom /epoc32/include/swi // Sources SOURCEPATH ../src diff -r 461e71b327da -r 0553e2305d00 javamanager/javasidchecker/data/10281FBE.rss diff -r 461e71b327da -r 0553e2305d00 javamanager/javasidchecker/src/javasidchecker.cpp --- a/javamanager/javasidchecker/src/javasidchecker.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/javasidchecker/src/javasidchecker.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -21,7 +21,7 @@ #include -#include +#include #include #include "javauids.h" diff -r 461e71b327da -r 0553e2305d00 javamanager/javaupgradeapp/build/bld.inf --- a/javamanager/javaupgradeapp/build/bld.inf Fri Sep 17 17:50:17 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: Generated bld.inf -file -* -*/ - -PRJ_PLATFORMS -default - -PRJ_MMPFILES -javaupgradeapp_0x2002FF64.mmp diff -r 461e71b327da -r 0553e2305d00 javamanager/javaupgradeapp/build/javaupgradeapp.pro --- a/javamanager/javaupgradeapp/build/javaupgradeapp.pro Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +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: Helper application for uninstalling a java application and -# then installing new application (java or native) -# -# - -TEMPLATE=app -TARGET=javaupgradeapp -CONFIG += omj no_icon stl -CONFIG -= qt - -symbian { - TARGET.UID2 = 0x2000CFEC - TARGET.UID3 = 0x2002FF64 - TARGET.CAPABILITY = TrustedUI - LIBS += -lestor -lapparc -lapgrfx -} - -include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javamanager/javaupgradeapp/build/javaupgradeapp_0x2002FF64.mmp --- a/javamanager/javaupgradeapp/build/javaupgradeapp_0x2002FF64.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +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: Generated file - do not edit manually -* -*/ - -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) -// This file is generated by qmake and should not be modified by the -// user. -// Name : javaupgradeapp.mmp -// ============================================================================== - -TARGET javaupgradeapp.exe -TARGETTYPE EXE - -UID 0x2000CFEC 0x2002FF64 -SECUREID 0x2002FF64 - -EPOCALLOWDLLDATA - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO RD_JAVA_SYMBIAN_TARGET -MACRO RD_JAVA_S60_RELEASE_9_2 -MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS -MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS -MACRO RD_JAVA_STDCPPV5 -MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX -MACRO RD_JAVA_HTTP_EMC_ENABLED -MACRO RD_JAVA_NGA_ENABLED -MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED -MACRO RD_JAVA_OPENC_BETA_PATCH -MACRO RD_JAVA_INSTALLERUI_ENABLED -MACRO RD_JAVA_PREWARM -MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK -MACRO RD_JAVA_MIDPRMS_DB -MACRO __SYMBIAN32__ -MACRO J9EPOC32 - -SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../../inc -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE ../src.s60 -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE . - -SOURCEPATH ../src.s60 -SOURCE javaupgradeapp.cpp - - -LIBRARY estor.lib -LIBRARY apparc.lib -LIBRARY apgrfx.lib -LIBRARY javautils.lib -LIBRARY libpthread.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib -STATICLIBRARY libcrt0.lib - -CAPABILITY TrustedUI - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden -#if defined(ARMCC_4_0) -OPTION ARMCC --import_all_vtbl -#endif -OPTION GCCE -fvisibility-inlines-hidden - -VERSION 10.0 - -ARMFPU softvfp - -PAGED - -BYTEPAIRCOMPRESSTARGET - -USERINCLUDE . - -#include - - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - - SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) - -SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah - -#ifdef WINSCW - -LIBRARY ewsd.lib - -#endif - -STDCPP diff -r 461e71b327da -r 0553e2305d00 javamanager/javaupgradeapp/sis/java_upgradeapp.pkg --- a/javamanager/javaupgradeapp/sis/java_upgradeapp.pkg Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +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: Helper application for uninstalling a java application and -; then installing new application (any installation package file) -; -;Languages -&EN - - -#{"javaupgradeapp"},(0x2002FF64),1,1,0, TYPE=SA,RU - -;Localised Vendor name -%{"Nokia"} - -;Unique Vendor name -:"Nokia" - -;Supports Series 60 v 5.0 -;This line indicates that this installation is for the Series 60 platform v3.0 -;This line must appear _exactly_ as shown below in the sis file -;If this line is missing or incorrect, the sis file will not be able -;to be installed on Series 60 v5.0 platforms -[0x1028315F], 0, 0, 0, {"Series60ProductID"} - -; -"\epoc32\release\armv5\urel\javaupgradeapp.exe"-"c:\sys\bin\javaupgradeapp.exe" diff -r 461e71b327da -r 0553e2305d00 javamanager/javaupgradeapp/src.s60/javaupgradeapp.cpp --- a/javamanager/javaupgradeapp/src.s60/javaupgradeapp.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,434 +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: Helper application for uninstalling a java application and -* then installing new application (java or native) -* -*/ - -#include -#include -#include -#include -#include -#include -#include - -#include "exceptionbase.h" -#include "javaoslayer.h" -#include "javacommonutils.h" -#include "javaprocessconstants.h" -#include "javasymbianoslayer.h" -#include "javauids.h" -#include "logger.h" - - -using namespace java::util; - - -_LIT8(KHexValueStart, "0x"); -_LIT8(KSemiColon, ";"); -_LIT8(KUidArg, "uid="); -_LIT8(KFileArg, "file="); - -const TInt KExtraLenForLogging = 2; -const TInt KArgumentValueMaxLen = 1568; -// Wait for 0.5 sec if ArcApp has not yet initialized -const TInt KDelayWhenWaitingAppArc = 500000; - - -/** - * Set the value of the argument specified by aArgName to aArgValue - * - * @param aCmdLine command line to be parsed - * @param aArgName the name of the argument - * @param aArgValue the value parsed from command line will be returned here - */ -static void getArgValueL(const TPtrC8 &aCmdLine, const TDesC8 &aArgName, HBufC **aArgValue) -{ - TBuf8 valueBuf; - TInt argPos = aCmdLine.FindF(aArgName); - if (argPos >= 0) - { - TInt semicolonPos = aCmdLine.Mid(argPos).Find(KSemiColon); - if (KErrNotFound == semicolonPos) - { - semicolonPos = aCmdLine.Mid(argPos).Length(); - } - TInt argLen = semicolonPos - aArgName.Length(); - if (argLen >= KArgumentValueMaxLen) - { - // Protect from buffer overflow. - WLOG2(EUtils, - "javaupgradeapp: argument value len too long (%d), cutting it to %d", - argLen, (KArgumentValueMaxLen - 1)); - argLen = KArgumentValueMaxLen - 1; - } - else if (argLen == 0) - { - User::Leave(KErrArgument); - } - - valueBuf = aCmdLine.Mid(argPos + aArgName.Length(), argLen); - } - - // Allocate new HBufC - HBufC *pBufValue = HBufC::NewL(valueBuf.Length() + 2); - - // 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; -} - - -/** - * Parse the name from the value of 'file' parameter in - * command line given in aCmdLine - * - * @param aCmdLine command line to be parsed, the format is - * ;file=YYY; - * @param aFileName will contain the name parsed from command line - */ -static void getNameFromCommandLineL(const TPtrC8 &aCmdLine, HBufC **aFileName) -{ - TInt err = aCmdLine.FindF(KFileArg); - User::LeaveIfError(err); - - getArgValueL(aCmdLine, KFileArg, aFileName); -} - - -/** - * Parse the Uid from the value of 'uid' parameter in - * command line given in aCmdLine - * - * @param aCmdLine command line to be parsed, the format is - * uid=YYY; - * @param aUid will contain the Uid parsed from command line - */ -static void getUidFromCommandLineL(const TPtrC8 &aCmdLine, TInt32 &aUid) -{ - TInt err(KErrNone); - TInt argPos = aCmdLine.FindF(KUidArg); - if (KErrNotFound != argPos) - { - TPtrC8 uidToParse = aCmdLine.Mid(argPos + KUidArg.iTypeLength); - TLex8 parseUid(uidToParse); - if (uidToParse.FindF(KHexValueStart) == 0) - { - parseUid.Inc(2); // skip hex prefix - TUint32 tmpValue; - err = parseUid.Val(tmpValue, EHex); - aUid = tmpValue; - } - else - { - err = parseUid.Val(aUid); - } - - if (KErrNone != err) - { - ELOG1(EUtils, - "javaupgradeapp failed parsing app Uid from cmdline uid param. Error %d", - err); - } - } - else - { - ELOG(EUtils, - "javaupgradeapp cannot uninstall app because uid parameter is not given"); - } - - User::LeaveIfError(err); -} - - -/** - * Parse the process command line. - * Determine the uid of the Java application to be uninstalled and - * the name of the application package to be installed. - * Leaves if argument 'file' exist but file name cannot be found, - * leaves if argument 'uid' exist but uid cannot be parsed from command line, - * does NOT leave if only one of the arguments is present - * - * @param aFileName returns value of argument 'file' - * @param aUid returns Uid of the Java application to be uninstalled - */ -void getFileAndUidL(HBufC **aFileName, TInt32 *aUid) -{ - 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); - - // Get the value of _application-args_ - TPtrC8 args = commandLine->TailEnd(); - HBufC8 *pBufCmdLine = - HBufC8::NewLC(args.Length() + KExtraLenForLogging); - if (args.Length() > 0) - { - // 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)); - // It is enough that either midlet uid OR installation package name - // have been given in commandline - if ((err != KErrNone) && (err != KErrNotFound)) - { - User::Leave(err); - } - - // Get the name of the installation package from the commandline - TRAPD(err2, getNameFromCommandLineL(cmdLineBuf, aFileName)) - if (err2 != KErrNone) - { - if (err2 == KErrNotFound) - { - if (err == KErrNotFound) - { - // Both arguments missing - User::Leave(KErrArgument); - } - } - else - { - User::Leave(err2); - } - } - } - else - { - ELOG(EUtils, "javaupgradeapp: empty command line"); - User::Leave(KErrArgument); - } - - CleanupStack::PopAndDestroy(pBufCmdLine); - CleanupStack::PopAndDestroy(commandLine); -} - - -/** - * Uninstall the java application specified by aUid parameter. - * - * @param aUid the Uid of the java application to be uninstalled - */ -void uninstallJavaAppL(TInt32 aUid) -{ - RProcess rJavaInstaller; - TFileName fileName; - // Max one path name and some options -> 1536 is enough - TBuf<1536> commandLine; - - // Build command line used to pass all necessary info to Java Installer - TInt len = strlen(java::runtime::JAVA_INSTALLER_STARTER_DLL); - TPtr8 ptr8InstallerDll((TUint8 *)java::runtime::JAVA_INSTALLER_STARTER_DLL, len, len); - commandLine.Copy(ptr8InstallerDll); - - // Use command line options that make sure that uninstallation is done - // always, silently and so that the uninstalled java application will - // be preinstalled again if the user uninstalls it - commandLine.Append(_L(" uninstall -uid=")); - commandLine.AppendNum(aUid); - commandLine.Append(_L(" -forceuninstall -silent -resetpreinstall")); - - LOG1WSTR(EUtils, EInfo, - "javaupgradeapp:uninstallJavaAppL Java Installer command line is %s", - (wchar_t *)(commandLine.PtrZ())); - - // start JavaInstaller - TBuf<64> installerProcess; // Actual len of the process name is 9 - len = strlen(java::runtime::JAVA_PROCESS); - TPtr8 ptr8Process((TUint8 *)java::runtime::JAVA_PROCESS, len, len); - installerProcess.Copy(ptr8Process); - - TRequestStatus status; - TInt err = rJavaInstaller.Create(installerProcess, commandLine); - if (KErrNone == err) - { - LOG(EUtils, EInfo, "javaupgradeapp:uninstallJavaAppL calling Logon"); - // Get notification when Java Installer exits (or panics) - rJavaInstaller.Logon(status); - - LOG(EUtils, EInfo, "javaupgradeapp:uninstallJavaAppL calling Resume"); - rJavaInstaller.Resume(); - } - else - { - ELOG1(EUtils, - "javaupgradeapp:uninstallJavaAppL Cannot start Java Installer, error %d", - err); - User::Leave(err); - } - - // now wait until Java Installer exits - User::WaitForRequest(status); - - LOG(EUtils, EInfo, "javaupgradeapp:uninstallJavaAppL calling RProcess::Close"); - // free resources before returning - rJavaInstaller.Close(); -} - - -/** - * - * - * - */ -void installAppPackageL(HBufC *aBufFileName) -{ - // Open file using default handler, - // if the file is an installation package, it will be installed - RApaLsSession apaSession; - TInt err = apaSession.Connect(); - if (KErrNone != err) - { - ELOG(EUtils, - "javaupgradeapp:installAppPackageL: Cannot connect to AppArc server"); - User::Leave(err); - } - CleanupClosePushL(apaSession); - - TInt retryCounter(10); - TThreadId handlerTreadId; - do - { - err = apaSession.StartDocument(*aBufFileName, handlerTreadId); - if (RApaLsSession::EAppListInvalid == err) - { - // Application list has not yet been populated, - // try again after a short delay - retryCounter--; - if (retryCounter > 0) - { - User::After(KDelayWhenWaitingAppArc); // codescanner::userafter - continue; - } - else - { - ELOG(EUtils, - "javaupgradeapp:installAppPackageL: RApaLsSession " - "StartDocument returned EAppListInvalid for 10 times, exiting"); - User::Leave(err); - } - } - else if (KErrNone != err) - { - ELOG1(EUtils, - "javaupgradeapp:installAppPackageL: RApaLsSession " - "StartDocument returned error %d", err); - User::Leave(err); - } - - } while (RApaLsSession::EAppListInvalid == err); - - CleanupStack::PopAndDestroy(); // apaSession -} - - -/** - * Get the uid of the Java application to be uninstaller and - * start Java Installer to uninstall the application. - * Then install the new application package given in cmdline - * - */ -void handleUpgradeL(void) -{ - HBufC *pBufFileName = NULL; - TInt32 uid(0); - - getFileAndUidL(&pBufFileName, &uid); - - if (uid != 0) - { - PLOG1(EUtils, "javaupgradeapp uninstalling app uid %x", uid); - uninstallJavaAppL(uid); - } - else - { - WLOG(EUtils, "javaupgradeapp: uid argument was not given"); - } - - if (pBufFileName != NULL) - { - 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"); - } -} - - -/** - * Main function of executable javaupgradeapp.exe. - * "installer app" created by Services team starts this executable when - * the "installer app" must be replaced with the real application (java/native or wrt) - * - * The command line format is - * uid=;file= - * for example - * uid=0x10137c4d;file=D:\\temp\\upgrade\\package.sis - * - * Sample code for starting this application from the "installer app" MIDlet - * @code - - MIDlet.platformRequest( - “nativeapp://application-exe=javaupgradeapp.exe;application-args=uid=0x10137c4d;file=D:\\temp\\upgrade\\package.sis”); - - * @endcode - * - */ -TInt E32Main(void) -{ - // TODO: check that only MIDP runtime process can start this in final version - // that goes to ROM - - - CTrapCleanup *pCleanupStack = CTrapCleanup::New(); - if (NULL == pCleanupStack) - { - ELOG(EUtils, "Cannot create CleanupStack in javaupgradeapp.exe main()"); - return KErrNoMemory; - } - - TRAPD(err, handleUpgradeL()); - if (KErrNone != err) - { - ELOG1(EUtils, "javaupgradeapp.exe: handleUpgradeL leaved with err %d", err); - } - - delete pCleanupStack; - return err; -} - diff -r 461e71b327da -r 0553e2305d00 javamanager/preinstaller/build/javapreinstaller.pro --- a/javamanager/preinstaller/build/javapreinstaller.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/preinstaller/build/javapreinstaller.pro Fri Oct 22 14:23:56 2010 +0100 @@ -27,9 +27,7 @@ -lPlatformEnv \ -ljavacomms \ -lcharconv \ - -ljavastorage \ - -lapparc \ - -lapgrfx + -ljavastorage } include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javamanager/preinstaller/build/javapreinstaller_0x2002DCC6.mmp --- a/javamanager/preinstaller/build/javapreinstaller_0x2002DCC6.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/preinstaller/build/javapreinstaller_0x2002DCC6.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc @@ -72,8 +73,6 @@ LIBRARY javacomms.lib LIBRARY charconv.lib LIBRARY javastorage.lib -LIBRARY apparc.lib -LIBRARY apgrfx.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib @@ -86,10 +85,12 @@ LIBRARY mediaclientaudio.lib LIBRARY eikcoctl.lib LIBRARY eiksrv.lib +LIBRARY apparc.lib LIBRARY avkon.lib LIBRARY ws32.lib LIBRARY hal.lib LIBRARY gdi.lib +LIBRARY apgrfx.lib CAPABILITY all -tcb diff -r 461e71b327da -r 0553e2305d00 javamanager/preinstaller/src.s60/main.cpp --- a/javamanager/preinstaller/src.s60/main.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/preinstaller/src.s60/main.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -119,7 +119,7 @@ // Start active scheduler. Preinstallation starts. LOG(EJavaPreinstaller, EInfo, "startPreinstallationL: Starting CActiveScheduler"); - CActiveScheduler::Start(); // codescanner::activestart + CActiveScheduler::Start(); // Now preinstallation has been done LOG(EJavaPreinstaller, EInfo, "startPreinstallationL: Cleaning up"); diff -r 461e71b327da -r 0553e2305d00 javamanager/preinstaller/src.s60/silentmidletinstall.cpp --- a/javamanager/preinstaller/src.s60/silentmidletinstall.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/preinstaller/src.s60/silentmidletinstall.cpp Fri Oct 22 14:23:56 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" @@ -11,7 +11,7 @@ * * Contributors: * -* Description: OMJ Symbian preinstaller process +* Description: OMJ S60 preinstaller process * */ @@ -26,8 +26,6 @@ #include "silentmidletinstall.h" #include "javacommonutils.h" -#include "javauid.h" -#include "javauids.h" #include "logger.h" #include "javaprocessconstants.h" #include "javasymbianoslayer.h" @@ -53,7 +51,6 @@ _LIT(KMidletName, "MIDlet-Name"); _LIT(KMidletVendor, "MIDlet-Vendor"); _LIT(KMidletVersion, "MIDlet-Version"); -_LIT(KMidletUid, "Nokia-MIDlet-UID-1"); _LIT(KJadExtension, "*.jad"); @@ -99,9 +96,9 @@ */ void CSilentMIDletInstall::ConstructL() { + JELOG2(EJavaPreinstaller); iMIDletName = HBufC::NewL(KMaxBufferSize); iMIDletVendor = HBufC::NewL(KMaxBufferSize); - iMIDletUid = HBufC::NewL(KMaxBufferSize); iPreinstallServer = new(ELeave) PreinstallCommsServer(); iNumberOfAppsToInstall = 0; @@ -114,6 +111,7 @@ */ CSilentMIDletInstall::~CSilentMIDletInstall() { + JELOG2(EJavaPreinstaller); iJadFiles.ResetAndDestroy(); iJadFiles.Close(); @@ -126,9 +124,6 @@ delete iMIDletVendor; iMIDletVendor = NULL; - delete iMIDletUid; - iMIDletUid = NULL; - delete iPreinstallServer; iPreinstallServer = NULL; } @@ -138,6 +133,7 @@ */ void CSilentMIDletInstall::Start() { + JELOG2(EJavaPreinstaller); iState = EFindOutDeviceDrives; // Check if an explicit roll-back of a previous installation is needed @@ -155,16 +151,17 @@ { iISRollbackNeeded = ETrue; // If JavaInstaller is running, then existence of the Java Installer - // integrity service directory is ok and rollback is not needed + // integrity service directory is ok and rollback is not needed. TFullName processName; - _LIT(KJavaInstallerProcess, "*Installer*"); + _LIT(KJavaInstallerProcess, "Installer*"); TFindProcess finder(KJavaInstallerProcess); err = finder.Next(processName); if (err == KErrNone) { iISRollbackNeeded = EFalse; - WLOG(EJavaPreinstaller, - "Java Installer is running while checking need to rollback"); + WLOG1(EJavaPreinstaller, + "Java Installer is running while checking need to rollback (%S)", + (wchar_t *)(processName.PtrZ())); } } @@ -191,6 +188,8 @@ */ void CSilentMIDletInstall::CompleteRequest() { + JELOG2(EJavaPreinstaller); + TRequestStatus *status = &iStatus; User::RequestComplete(status, KErrNone); if (!IsActive()) @@ -243,6 +242,8 @@ */ void CSilentMIDletInstall::RunL() { + JELOG2(EJavaPreinstaller); + switch (iState) { case EFindOutDeviceDrives: @@ -449,7 +450,7 @@ LOG1WSTR(EJavaPreinstaller, EInfo, "CSilentMIDletInstall::GetDirEntriesL Adding file %s", (wchar_t *)(pathPtr.PtrZ())); - aVector.AppendL(path); + aVector.Append(path); CleanupStack::Pop(path); } @@ -580,12 +581,13 @@ /** * 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)); @@ -646,23 +648,6 @@ "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; } @@ -743,17 +728,10 @@ // 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++) { @@ -801,8 +779,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 { @@ -840,34 +818,9 @@ 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(); @@ -878,8 +831,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) @@ -893,11 +846,6 @@ } } - if (apaSessionConnected) - { - apaSession.Close(); - } - js->close(); } @@ -1218,53 +1166,3 @@ 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 461e71b327da -r 0553e2305d00 javamanager/preinstaller/src.s60/silentmidletinstall.h --- a/javamanager/preinstaller/src.s60/silentmidletinstall.h Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/preinstaller/src.s60/silentmidletinstall.h Fri Oct 22 14:23:56 2010 +0100 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: OMJ Symbian preinstaller process +* Description: OMJ S60 preinstaller process * */ @@ -19,7 +19,6 @@ #ifndef SILENTMIDLETINSTALL_H #define SILENTMIDLETINSTALL_H -#include // for RApaLsSession #include #include #include @@ -102,9 +101,6 @@ // 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: @@ -127,8 +123,6 @@ 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 461e71b327da -r 0553e2305d00 javamanager/subsystem.mk --- a/javamanager/subsystem.mk Fri Sep 17 17:50:17 2010 +0100 +++ b/javamanager/subsystem.mk Fri Oct 22 14:23:56 2010 +0100 @@ -21,42 +21,28 @@ javainstaller \ javaregistry \ javabackup \ - javasettings + javasettings COMPONENTS = \ preinstaller/build \ debugapi/build \ - javalauncher/build \ - javaupgradeapp/build - + javalauncher/build + NONQTSUBSYSTEMS = \ - javarecognizer/build + javasidchecker/build \ + javarecognizer/build \ + javaappschemeplugin/build SYMBIAN_ONLY = \ javaregistry \ javalauncher/build \ - javaupgradeapp/build \ javabackup \ + javasidchecker/build \ javarecognizer/build \ preinstaller/build \ - debugapi/build + debugapi/build \ + javaappschemeplugin/build -ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS -NONQTSUBSYSTEMS += javasidchecker/build javaappschemeplugin/build -SYMBIAN_ONLY += javasidchecker/build javaappschemeplugin/build javasidchecker/build : javaregistry -else -COMPONENTS += javaappscheme/build javaqtrequest/build -SYMBIAN_ONLY += javaappscheme/build javaqtrequest/build -endif - -ifdef RD_JAVA_APPLICATION_SETTINGS_QT -COMPONENTS += javasettings_qt/build -SYMBIAN_ONLY += javasettings_qt/build -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 461e71b327da -r 0553e2305d00 javaruntimes/bld.inf --- a/javaruntimes/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/bld.inf Fri Oct 22 14:23:56 2010 +0100 @@ -23,6 +23,5 @@ #include "jvmargmodifier/default/build/bld.inf" #include "jvmargmodifier/file/build/bld.inf" #include "starterutils/build/bld.inf" -#include "standalone/build/bld.inf" #include "starter/build/bld.inf" #include "midp/bld.inf" diff -r 461e71b327da -r 0553e2305d00 javaruntimes/installer/starterdll/build/javainstallerstarter_0x2002DCB5.mmp --- a/javaruntimes/installer/starterdll/build/javainstallerstarter_0x2002DCB5.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/installer/starterdll/build/javainstallerstarter_0x2002DCB5.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 461e71b327da -r 0553e2305d00 javaruntimes/installer/starterdll/src/main.cpp --- a/javaruntimes/installer/starterdll/src/main.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/installer/starterdll/src/main.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -221,7 +221,7 @@ #endif // Wait 3 seconds so that Java Captain has time to start - User::After(3000000); // codescanner::userafter + User::After(3000000); } else { @@ -384,12 +384,7 @@ jvm->appendSystemProperty( L"-Dcom.nokia.mj.impl.rt.ui=" L"com.nokia.mj.impl.installer.ui.eswt2.InstallerRuntimeUi"); -#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 +#else jvm->appendSystemProperty( L"-Dcom.nokia.mj.impl.installer.ui=" L"com.nokia.mj.impl.installer.ui.eswt.InstallerUiEswt"); diff -r 461e71b327da -r 0553e2305d00 javaruntimes/installer/starterexe/build/javainstaller_0x2001843A.mmp --- a/javaruntimes/installer/starterexe/build/javainstaller_0x2001843A.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/installer/starterexe/build/javainstaller_0x2001843A.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -54,6 +54,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 461e71b327da -r 0553e2305d00 javaruntimes/javaruntimes.pro --- a/javaruntimes/javaruntimes.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/javaruntimes.pro Fri Oct 22 14:23:56 2010 +0100 @@ -19,7 +19,6 @@ SUBDIRS += installer/starterdll/build/javainstallerstarter.pro SUBDIRS += installer/starterexe/build/javainstaller.pro SUBDIRS += jvmargmodifier/file/build/javajvmargsmodifierfile.pro -SUBDIRS += standalone/build/javastarter.pro -SUBDIRS += starter/build/javamidp.pro +SUBDIRS += starter/build/java.pro SUBDIRS += midp BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 461e71b327da -r 0553e2305d00 javaruntimes/jvmargmodifier/default/build/javajvmargsmodifier_0x2002DCB8.mmp --- a/javaruntimes/jvmargmodifier/default/build/javajvmargsmodifier_0x2002DCB8.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/jvmargmodifier/default/build/javajvmargsmodifier_0x2002DCB8.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile.pro --- a/javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile.pro Fri Oct 22 14:23:56 2010 +0100 @@ -21,4 +21,8 @@ LIBS += -ljavafileutils +symbian { +LIBS += -laknnotify +} + include(../../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile_0x2002DCB9.mmp --- a/javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile_0x2002DCB9.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile_0x2002DCB9.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc @@ -68,6 +69,7 @@ LIBRARY javafileutils.lib +LIBRARY aknnotify.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib diff -r 461e71b327da -r 0553e2305d00 javaruntimes/jvmargmodifier/file/src/jvmargsmodifier.cpp --- a/javaruntimes/jvmargmodifier/file/src/jvmargsmodifier.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/jvmargmodifier/file/src/jvmargsmodifier.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: A file argument reader implementation for JvmArgs modifier. +* Description: A default empty implementation for JvmArgs modifier. * */ @@ -23,17 +23,33 @@ #include "jvmargsfilereader.h" #include "argsmodifier.h" +#ifdef __SYMBIAN32__ +#include +_LIT(KArgsTxt, "Note! Modified VM arguments used!"); +#endif + void logArguments(std::wstring aArg) { WLOG1(EJavaRuntime, " '%S'", aArg.c_str()); } +#ifdef __SYMBIAN32__ +void showWarningDialogL() +{ + ::CAknGlobalNote* globalNote = CAknGlobalNote::NewL(); + CleanupStack::PushL(globalNote); + globalNote->ShowNoteL(EAknGlobalInformationNote, KArgsTxt); + CleanupStack::PopAndDestroy(globalNote); +} +#endif + + OS_EXPORT void java::runtime::modifyJvmArguments(const std::wstring& aIdentifier, std::list& aJvmArgs, std::list& aApplicationAndArgs) { - PLOG(EJavaRuntime, "JVM File Argument modifier in use"); + JELOG2(EJavaRuntime); #ifdef __SYMBIAN32__ // Open the extension directory of the J9 VM. @@ -54,6 +70,9 @@ std::for_each(aJvmArgs.begin(), aJvmArgs.end(), logArguments); WLOG(EJavaRuntime, "new App arguments"); std::for_each(aApplicationAndArgs.begin(), aApplicationAndArgs.end(), logArguments); +#ifdef __SYMBIAN32__ + TRAP_IGNORE(showWarningDialogL()); +#endif } } diff -r 461e71b327da -r 0553e2305d00 javaruntimes/midp/runtime/build/build.xml --- a/javaruntimes/midp/runtime/build/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/midp/runtime/build/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -33,6 +33,7 @@ + microedition.hostname=localhost microedition.jtwi.version=1.0 microedition.msa.version=1.1-SUBSET microedition.profiles=MIDP-2.1 diff -r 461e71b327da -r 0553e2305d00 javaruntimes/midp/runtime/build/javamidpruntime.pro --- a/javaruntimes/midp/runtime/build/javamidpruntime.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/midp/runtime/build/javamidpruntime.pro Fri Oct 22 14:23:56 2010 +0100 @@ -23,7 +23,7 @@ symbian { - INCLUDEPATH += /epoc32/include/ecom # Due to schemehandler.inl in S60 5.0 2009w18 and SPB 10.1 + INCLUDEPATH += /epoc32/include/ecom LIBS += -lecom -lflogger -lDrmRightsInfo -lcaf -lDrmHelper -lapgrfx -lapparc -ljavautils } diff -r 461e71b327da -r 0553e2305d00 javaruntimes/midp/runtime/build/javamidpruntime_0x2002DCBF.mmp --- a/javaruntimes/midp/runtime/build/javamidpruntime_0x2002DCBF.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/midp/runtime/build/javamidpruntime_0x2002DCBF.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE /epoc32/include/ecom diff -r 461e71b327da -r 0553e2305d00 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 Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/Main.java Fri Oct 22 14:23:56 2010 +0100 @@ -38,14 +38,12 @@ { // Do the start up trace. StartUpTrace.doTrace("Midp runtime ready"); - if (Log.mOn) - { - Log.logI("Starting MIDP runtime"); - Log.logI("java.version: " + - System.getProperty("java.version")); - Log.logI("java.fullversion: " + - System.getProperty("java.fullversion")); - } + 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")); boolean ok = true; try diff -r 461e71b327da -r 0553e2305d00 javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/utils/CmdLineArgsPermission.java --- a/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/utils/CmdLineArgsPermission.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/utils/CmdLineArgsPermission.java Fri Oct 22 14:23:56 2010 +0100 @@ -77,10 +77,6 @@ */ public boolean equals(Object obj) { - if (!(obj instanceof CmdLineArgsPermission)) - { - return false; - } return (obj.hashCode() == hashCode()); } diff -r 461e71b327da -r 0553e2305d00 javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java --- a/javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java Fri Oct 22 14:23:56 2010 +0100 @@ -31,7 +31,6 @@ 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; /** @@ -283,7 +282,7 @@ } - private boolean showNote(String aAppName, Id aConfirmationQueryId) + private boolean showNote(String aAppName,String aConfirmationQueryId) { SecurityPromptMessage msg = SecurityPromptMessage.getInstance(); String queryTxt = msg.getText(aConfirmationQueryId,null); @@ -323,7 +322,9 @@ mNoPromptSchemes = new Hashtable(); mNoPromptSchemes.put("cti:",""); mNoPromptSchemes.put("mailto:",""); + mNoPromptSchemes.put("mms:",""); mNoPromptSchemes.put("mmsto:",""); + mNoPromptSchemes.put("rtsp:",""); mNoPromptSchemes.put("sms:",""); mNoPromptSchemes.put("tel:",""); } diff -r 461e71b327da -r 0553e2305d00 javaruntimes/midp/runtime/src.s60/platformrequesthandler.cpp --- a/javaruntimes/midp/runtime/src.s60/platformrequesthandler.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/midp/runtime/src.s60/platformrequesthandler.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -18,7 +18,9 @@ #include -#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS +#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS +#include +#else #include #endif @@ -66,7 +68,7 @@ void PlatformRequestHandler::handleUri(const std::wstring& aUri) { JELOG2(EJavaRuntime); - TRAPD(err, launchAppL(aUri)); + TRAPD(err,launchAppL(aUri);); if (err != KErrNone) { ELOG1(EJavaRuntime, "ERROR!!! PlatformRequestHandler::handleUri() %d", @@ -74,8 +76,8 @@ if (KErrNotFound == err) { if ((aUri.find(L"localapp:jam/launch?") == 0) || - (aUri.find(L"localapp://jam/launch?") == 0) || - (aUri.find(L"javaapp:") == 0)) + (aUri.find(L"localapp://jam/launch?") == 0) || + (aUri.find(L"javaapp:") == 0)) { // The URI is supported but the MIDlet specified by the URI // does not exist. @@ -110,71 +112,9 @@ } else { -#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS - std::wstring uri; - std::wstring okScheme(L"javaapp:"); - if (aUri.find(L"localapp:jam/launch?") == 0) - { - // Remove the scheme not supported by the devices in 10.1 from the - // beginning, replace it with okScheme that is supported - uri = okScheme; - uri += aUri.substr(20); // 20 == wstrlen(L"localapp:jam/launch?") - } - else if (aUri.find(L"localapp://jam/launch?") == 0) - { - uri = okScheme; - uri += aUri.substr(22); // 22 == wstrlen(L"localapp://jam/launch?") - } - else if (aUri.find(L"javaapp://") == 0) - { - // TODO: after QtHighway has been fixed to that - // it can recognize "javaapp://" scheme, remove this. - // At 2010wk26 it recognizes only "javaapp:" - uri = okScheme; - uri += aUri.substr(10); // 10 == wstrlen(L"javaapp://") - } - else - { - uri = aUri; - } - LOG1(EJavaRuntime, EInfo, "Platform request. Converted uri: %S", uri.c_str()); - - TPtrC ptr((const TUint16 *)uri.c_str(), uri.length()); - // Start javaqtrequest.exe so that url is command line argument. - // javaqtrequest is a Qt application that will use Qt Highway API - // to send the url request to correct XQServiceProvider - _LIT(KJavaQtRequestExe, "javaqtrequest.exe"); - RProcess rProcess; - TInt err = rProcess.Create(KJavaQtRequestExe, ptr); - if (KErrNone != err) - { - ELOG1(EJavaRuntime, - "PlatformRequestHandler: launchAppL: Starting javaqtrequest.exe failed, err %d", - err); - User::Leave(err); - } - - // Wait until javaqtrequest exits - TRequestStatus status; - rProcess.Logon(status); - rProcess.Resume(); - User::WaitForRequest(status); - - // Check the exit code of javaqtrequest - err = status.Int(); - rProcess.Close(); - if (err != KErrNone) - { - ELOG1(EJavaRuntime, - "PlatformRequestHandler: launchAppL: javaqtrequest.exe exited with err %d", - err); - User::Leave(err); - } -#else TPtrC ptr((const TUint16 *)aUri.c_str(), aUri.length()); std::auto_ptr schemeHandler(CSchemeHandler::NewL(ptr)); schemeHandler->HandleUrlStandaloneL(); // Process Uri in standalone mode. -#endif } } diff -r 461e71b327da -r 0553e2305d00 javaruntimes/midp/runtimestarter/build/javamidpstarter_0x2002DCC0.mmp --- a/javaruntimes/midp/runtimestarter/build/javamidpstarter_0x2002DCC0.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/midp/runtimestarter/build/javamidpstarter_0x2002DCC0.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javaruntimes/midp/runtimestarter/src/midpruntimestarter.cpp diff -r 461e71b327da -r 0553e2305d00 javaruntimes/standalone/build/bld.inf --- a/javaruntimes/standalone/build/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +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: Generated bld.inf -file -* -*/ - -PRJ_PLATFORMS -default - -PRJ_MMPFILES -javastarter_0x2002E6A7.mmp -#include "exports.inf" diff -r 461e71b327da -r 0553e2305d00 javaruntimes/standalone/build/javastarter_0x2002E6A7.mmp --- a/javaruntimes/standalone/build/javastarter_0x2002E6A7.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,136 +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: Generated file - do not edit manually -* -*/ - -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) -// This file is generated by qmake and should not be modified by the -// user. -// Name : javastarter.mmp -// ============================================================================== - -TARGET javastarter.dll -TARGETTYPE DLL - -UID 0x1000008d 0x2002E6A7 -SECUREID 0x2002E6A7 - -EPOCALLOWDLLDATA - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO RD_JAVA_SYMBIAN_TARGET -MACRO RD_JAVA_S60_RELEASE_9_2 -MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS -MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS -MACRO RD_JAVA_STDCPPV5 -MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX -MACRO RD_JAVA_HTTP_EMC_ENABLED -MACRO RD_JAVA_NGA_ENABLED -MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED -MACRO RD_JAVA_OPENC_BETA_PATCH -MACRO RD_JAVA_INSTALLERUI_ENABLED -MACRO RD_JAVA_PREWARM -MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK -MACRO RD_JAVA_MIDPRMS_DB -MACRO __SYMBIAN32__ -MACRO J9EPOC32 - -SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../inc -SYSTEMINCLUDE ../../inc -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE ../src -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE . - -SOURCEPATH ../src -SOURCE javastarterimpl.cpp - - -LIBRARY javaruntimestarterutils.lib -LIBRARY javautils.lib -LIBRARY libpthread.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib -LIBRARY apgrfx.lib - -CAPABILITY all -tcb - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden -#if defined(ARMCC_4_0) -OPTION ARMCC --import_all_vtbl -#endif -OPTION GCCE -fvisibility-inlines-hidden - -VERSION 10.0 - -ARMFPU softvfp - -PAGED - -BYTEPAIRCOMPRESSTARGET - -USERINCLUDE . - -#include - - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - -deffile ./~/javastarter.def - - SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) - -SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah - -#ifdef WINSCW - -LIBRARY ewsd.lib - -#endif - -STDCPP - -#ifdef WINSCW -DEFFILE ./bwins/javastarter.def -#elif defined EABI -DEFFILE ./eabi/javastarter.def -#endif diff -r 461e71b327da -r 0553e2305d00 javaruntimes/standalone/src/javastarterimpl.cpp diff -r 461e71b327da -r 0553e2305d00 javaruntimes/starter/build/bld.inf --- a/javaruntimes/starter/build/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/starter/build/bld.inf Fri Oct 22 14:23:56 2010 +0100 @@ -19,5 +19,5 @@ default PRJ_MMPFILES -javamidp_0x102033E6.mmp +java_0x102033E6.mmp #include "exports.inf" diff -r 461e71b327da -r 0553e2305d00 javaruntimes/starter/build/java.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaruntimes/starter/build/java.pro Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,52 @@ +# +# 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.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 +} +# For wins the max heap is 16 MB and for arm it is 64 MB +MMP_RULES += "$${LITERAL_HASH}ifdef WINSCW" +MMP_RULES += "EPOCHEAPSIZE 0x00001000 0x01000000" +MMP_RULES += "$${LITERAL_HASH}else // WINSCW" +MMP_RULES += "EPOCHEAPSIZE 0x00001000 0x04000000" +MMP_RULES += "$${LITERAL_HASH}endif // WINSCW" + +include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javaruntimes/starter/build/java_0x102033E6.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaruntimes/starter/build/java_0x102033E6.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,141 @@ +/* +* 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: Generated file - do not edit manually +* +*/ + +// ============================================================================== +// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) +// This file is generated by qmake and should not be modified by the +// user. +// Name : java.mmp +// ============================================================================== + +TARGET javamidp.exe +TARGETTYPE EXE + +UID 0x102033E6 0x102033E6 +SECUREID 0x102033E6 +VENDORID 0x101FB657 + +EPOCSTACKSIZE 16384 +EPOCALLOWDLLDATA + + +// Qt Macros +MACRO UNICODE +MACRO QT_KEYPAD_NAVIGATION +MACRO QT_SOFTKEYS_ENABLED +MACRO QT_USE_MATH_H_FLOATS +MACRO RD_JAVA_SYMBIAN_TARGET +MACRO RD_JAVA_S60_RELEASE_9_2 +MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS +MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS +MACRO RD_JAVA_STDCPPV5 +MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX +MACRO RD_JAVA_HTTP_EMC_ENABLED +MACRO RD_JAVA_NGA_ENABLED +MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_OPENC_BETA_PATCH +MACRO RD_JAVA_INSTALLERUI_ENABLED +MACRO RD_JAVA_PREWARM +MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK +MACRO RD_JAVA_MIDPRMS_DB +MACRO __SYMBIAN32__ +MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER + +SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian +SYSTEMINCLUDE ../inc +SYSTEMINCLUDE ../../inc +SYSTEMINCLUDE ../../../inc +SYSTEMINCLUDE ../src +SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 +SYSTEMINCLUDE /epoc32/include/mw +SYSTEMINCLUDE . + +SOURCEPATH ../src +SOURCE main.cpp + + +LIBRARY javautils.lib +LIBRARY libpthread.lib +LIBRARY libstdcppv5.lib +LIBRARY libc.lib +LIBRARY libm.lib +LIBRARY euser.lib +LIBRARY libdl.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY mediaclientaudio.lib +LIBRARY eikcoctl.lib +LIBRARY eiksrv.lib +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY efsrv.lib +LIBRARY charconv.lib +LIBRARY ws32.lib +LIBRARY hal.lib +LIBRARY gdi.lib +LIBRARY apgrfx.lib +STATICLIBRARY libcrt0.lib + +CAPABILITY LocalServices NetworkServices ProtServ WriteDeviceData ReadDeviceData ReadUserData WriteUserData UserEnvironment SwEvent Location MultiMediaDD NetworkControl TrustedUI + +OPTION CW -wchar_t on +OPTION ARMCC --visibility_inlines_hidden +#if defined(ARMCC_4_0) +OPTION ARMCC --import_all_vtbl +#endif +OPTION GCCE -fvisibility-inlines-hidden + +VERSION 10.0 + +ARMFPU softvfp + +PAGED + +BYTEPAIRCOMPRESSTARGET + +USERINCLUDE . + +#ifdef WINSCW + +EPOCHEAPSIZE 0x00001000 0x01000000 + +#else // WINSCW + +EPOCHEAPSIZE 0x00001000 0x04000000 + +#endif // WINSCW + +#include + + APP_LAYER_SYSTEMINCLUDE + + OS_LAYER_LIBC_SYSTEMINCLUDE + + OS_LAYER_SSL_SYSTEMINCLUDE + + SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) + +SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah + +#ifdef WINSCW + +LIBRARY ewsd.lib + +#endif + +STDCPP diff -r 461e71b327da -r 0553e2305d00 javaruntimes/starter/build/javamidp.pro --- a/javaruntimes/starter/build/javamidp.pro Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +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.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 -} -# For wins the max heap is 16 MB and for arm it is 64 MB -MMP_RULES += "$${LITERAL_HASH}ifdef WINSCW" -MMP_RULES += "EPOCHEAPSIZE 0x00001000 0x01000000" -MMP_RULES += "$${LITERAL_HASH}else // WINSCW" -MMP_RULES += "EPOCHEAPSIZE 0x00001000 0x04000000" -MMP_RULES += "$${LITERAL_HASH}endif // WINSCW" - -include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javaruntimes/starter/build/javamidp_0x102033E6.mmp --- a/javaruntimes/starter/build/javamidp_0x102033E6.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +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: Generated file - do not edit manually -* -*/ - -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) -// This file is generated by qmake and should not be modified by the -// user. -// Name : javamidp.mmp -// ============================================================================== - -TARGET javamidp.exe -TARGETTYPE EXE - -UID 0x102033E6 0x102033E6 -SECUREID 0x102033E6 -VENDORID 0x101FB657 - -EPOCSTACKSIZE 16384 -EPOCALLOWDLLDATA - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO RD_JAVA_SYMBIAN_TARGET -MACRO RD_JAVA_S60_RELEASE_9_2 -MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS -MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS -MACRO RD_JAVA_STDCPPV5 -MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX -MACRO RD_JAVA_HTTP_EMC_ENABLED -MACRO RD_JAVA_NGA_ENABLED -MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED -MACRO RD_JAVA_OPENC_BETA_PATCH -MACRO RD_JAVA_INSTALLERUI_ENABLED -MACRO RD_JAVA_PREWARM -MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK -MACRO RD_JAVA_MIDPRMS_DB -MACRO __SYMBIAN32__ -MACRO J9EPOC32 - -SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../inc -SYSTEMINCLUDE ../../inc -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE ../src -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE . - -SOURCEPATH ../src -SOURCE main.cpp - - -LIBRARY javautils.lib -LIBRARY libpthread.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib -LIBRARY apgrfx.lib -STATICLIBRARY libcrt0.lib - -CAPABILITY LocalServices NetworkServices ProtServ WriteDeviceData ReadDeviceData ReadUserData WriteUserData UserEnvironment SwEvent Location MultiMediaDD NetworkControl TrustedUI - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden -#if defined(ARMCC_4_0) -OPTION ARMCC --import_all_vtbl -#endif -OPTION GCCE -fvisibility-inlines-hidden - -VERSION 10.0 - -ARMFPU softvfp - -PAGED - -BYTEPAIRCOMPRESSTARGET - -USERINCLUDE . - -#ifdef WINSCW - -EPOCHEAPSIZE 0x00001000 0x01000000 - -#else // WINSCW - -EPOCHEAPSIZE 0x00001000 0x04000000 - -#endif // WINSCW - -#include - - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - - SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) - -SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah - -#ifdef WINSCW - -LIBRARY ewsd.lib - -#endif - -STDCPP diff -r 461e71b327da -r 0553e2305d00 javaruntimes/starter/build/javamidp_installer.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaruntimes/starter/build/javamidp_installer.pkg Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,31 @@ +; javamidp_installer.pkg generated by qmake at 2010-09-28T12:11:56 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + + +; SIS header: name, uid, version +#{"javamidp installer"},(0xA000D7CE),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +pkg_depends_webkit +pkg_depends_qt +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + + + +"R:/sf/app/jrt/javaruntimes/starter/build/javamidp.sis" - "c:\adm\javamidp.sis" +@"R:/sf/mw/qt/smartinstaller.sis",(0x2002CCCD) diff -r 461e71b327da -r 0553e2305d00 javaruntimes/starter/build/javamidp_template.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaruntimes/starter/build/javamidp_template.pkg Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,32 @@ +; javamidp_template.pkg generated by qmake at 2010-09-28T12:11:56 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + + +; SIS header: name, uid, version +#{"javamidp"},(0x102033E6),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +pkg_depends_webkit +pkg_depends_qt +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + + +; Executable and default resource files +"/epoc32/release/$(PLATFORM)/$(TARGET)/javamidp.exe" - "!:\sys\bin\javamidp.exe" + +; Manual PKG post-rules from PRO files diff -r 461e71b327da -r 0553e2305d00 javaruntimes/starterutils/build/exports.inf --- a/javaruntimes/starterutils/build/exports.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/starterutils/build/exports.inf Fri Oct 22 14:23:56 2010 +0100 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ diff -r 461e71b327da -r 0553e2305d00 javaruntimes/starterutils/build/javaruntimestarterutils_0x2002DCCC.mmp --- a/javaruntimes/starterutils/build/javaruntimestarterutils_0x2002DCCC.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/starterutils/build/javaruntimestarterutils_0x2002DCCC.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javaruntimes/starterutils/src.s60/j9starters60.cpp --- a/javaruntimes/starterutils/src.s60/j9starters60.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/starterutils/src.s60/j9starters60.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -230,10 +230,6 @@ { pathType = BOOT_CLASSPATH_TCKRUNNER; } - else if (mIdentifier == L"JavaControlPanel") - { - pathType = BOOT_CLASSPATH_JAVACONTROLPANEL; - } std::list odcFiles; std::list bcpEntities; diff -r 461e71b327da -r 0553e2305d00 javaruntimes/subsystem.mk --- a/javaruntimes/subsystem.mk Fri Sep 17 17:50:17 2010 +0100 +++ b/javaruntimes/subsystem.mk Fri Oct 22 14:23:56 2010 +0100 @@ -26,8 +26,7 @@ installer/starterexe/build \ jvmargmodifier/default/build \ jvmargmodifier/file/build \ - starterutils/build \ - standalone/build \ + starterutils/build ifdef RD_JAVA_S60_RELEASE_5_0_IAD COMPONENTS += starter/build.iad @@ -38,6 +37,5 @@ starterutils/build: jvmargmodifier/default/build midp: starterutils/build installer/starterdll/build: starterutils/build -standalone/build: starterutils/build include ${JAVA_SRC_ROOT}/build/Makefile.subsystem diff -r 461e71b327da -r 0553e2305d00 javatools/bld.inf --- a/javatools/bld.inf Fri Sep 17 17:50:17 2010 +0100 +++ b/javatools/bld.inf Fri Oct 22 14:23:56 2010 +0100 @@ -20,7 +20,6 @@ #include "tckrunner/starter/build/bld.inf" #include "tckrunner/runner/build/bld.inf" -#include "javacontrolpanel/starter/build/bld.inf" -#include "javacontrolpanel/controlpanel/build/bld.inf" #include "javasecuritycustomization/build/bld.inf" +#include "javacaptain_app/build/bld.inf" #include "testcerts/bld.inf" diff -r 461e71b327da -r 0553e2305d00 javatools/javacaptain_app/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacaptain_app/build/bld.inf Fri Oct 22 14:23:56 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: +* +*/ + +PRJ_PLATFORMS +default + +PRJ_MMPFILES +javacaptainapp.mmp \ No newline at end of file diff -r 461e71b327da -r 0553e2305d00 javatools/javacaptain_app/build/javacaptainapp.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacaptain_app/build/javacaptainapp.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,63 @@ +/* +* 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 +#include +#include +#include <../../../inc/java_stdcpp_support_for_exe.hrh> +#include <../../../inc/project_defines.hrh> + +TARGET JavaCap.exe +TARGETTYPE exe +UID 0x100039CE 0x20022D3C +CAPABILITY AllFiles WriteDeviceData PowerMgmt NetworkControl + +SOURCEPATH ../src.s60 +SOURCE javacap.cpp + +PAGED + +USERINCLUDE ../../../inc + +START RESOURCE javacap.rss +HEADER +TARGETPATH APP_RESOURCE_DIR +LANG SC +END // RESOURCE + +START RESOURCE javacap_reg.rss +// Do not change the UID below. +TARGETPATH /private/10003a3f/apps +END + +LIBRARY apparc.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY eikcoctl.lib +LIBRARY avkon.lib +LIBRARY bafl.lib +LIBRARY egul.lib +LIBRARY ws32.lib +LIBRARY flogger.lib +LIBRARY efsrv.lib +LIBRARY centralrepository.lib + +LIBRARY javacomms.lib +LIBRARY javaipc.lib +LIBRARY javastorage.lib +LIBRARY javadebugapi.lib + +// End of file diff -r 461e71b327da -r 0553e2305d00 javatools/javacaptain_app/src.s60/javacap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacaptain_app/src.s60/javacap.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,685 @@ +/* +* 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: JavaCap +* +*/ + + +#include "comms.h" +#include "rtcmessages.h" +#include "coremessages.h" + +#include "logger.h" + +#include "javacap.h" +#include "javacap.hrh" + +#include "javainifileutils.h" + +#include +#include + +#include "javastoragenames.h" // Storage constants. +#include "securitystoragedatadefs.h" + +#include + +_LIT(KJavaCapYes, "Yes"); +_LIT(KJavaCapNo, "No"); +_LIT(KUserSecurityMode, "User"); +_LIT(KNormalSecurityMode, "Default"); +_LIT(KS60SecurityPolicyName, "S60"); +_LIT(KMSASecurityPolicyName, "MSA"); +_LIT(KATTSecurityPolicyName, "AT&T"); +_LIT(KS60SecurityPolicy, "s60"); +_LIT(KMSASecurityPolicy, "msa"); +_LIT(KATTSecurityPolicy, "att"); +// Java Security Policy Central Repository UID +static const TUid KCRUidJavaSecurity = { 0x2001B289 }; +// IDs for security folder and file keys +static const TUint32 KPolicy = 0x03; +static const TUint32 KSecurityWarnings = 0x04; +const int KS60SecurityPolicyId = 1; +const int KMSASecurityPolicyId = 2; +const int KATTSecurityPolicyId = 3; + +using namespace java::storage; +using namespace std; +using namespace java::util; +using namespace java::comms; +using namespace java::captain; + +void CJavaCaptainContainer::ConstructL(const TRect& aRect) +{ + JELOG2(EJavaCaptain); + mCaptainRunning = true; + mPrewarmEnabled = false; +#if defined(RD_JAVA_PREWARM) && !defined (__WINS__) + mPrewarmEnabled = true; +#endif // RD_JAVA_PREWARM + mPrewarmUiEnabled = false; + mDebugEnabled = false; + mRedirectEnabled = false; + iStorage.reset(JavaStorage::createInstance()); + try + { + iStorage->open(); + } + catch (JavaStorageException& aJse) + { + User::Leave(aJse.mStatus); + } + mUserSecurityModeEnabled = (GetSecurityWarningsMode() == SECURITY_WARNINGS_USER_DEFINED_MODE); + mSecurityPolicyId = GetSecurityPolicy(); + mHeader = _L("Java states:"); + updateStates(); + CreateWindowL(); + SetRect(aRect); + ActivateL(); + mRedirector.reset(new LogRedirector()); +} + +CJavaCaptainContainer::~CJavaCaptainContainer() +{ + JELOG2(EJavaCaptain); +} + +void CJavaCaptainContainer::Draw(const TRect& /*aRect*/) const +{ + JELOG2(EJavaCaptain); + CWindowGc& gc = SystemGc(); + gc.Clear(); + + const CFont* usedFont = CEikonEnv::Static()->NormalFont(); + gc.UseFont(usedFont); + + gc.DrawText(mHeader,TPoint(10,20)); + int pos = 50; + gc.DrawText(mCaptainState,TPoint(20,pos)); + int gap = 25; + pos += gap; + gc.DrawText(mPrewarmState,TPoint(20,pos)); + pos += gap; + gc.DrawText(mPrewarmUiState,TPoint(20,pos)); + pos += gap; + gc.DrawText(mDebugState,TPoint(20,pos)); + pos += gap; + gc.DrawText(mSecurityMode,TPoint(20,pos)); + pos += gap; + gc.DrawText(mSecurityPolicy,TPoint(20,pos)); + pos += gap; + gc.DrawText(mRedirectState,TPoint(20,pos)); + + gc.DiscardFont(); +} + +void CJavaCaptainContainer::updateStates() +{ + + int propertyVal = java::util::JavaIniFileUtils::getProperty(java::util::UI_PREWARM); + if (propertyVal != -1) + { + mPrewarmUiEnabled = propertyVal; + } + + mCaptainState = _L("Captain running: "); + if (mCaptainRunning) + { + mCaptainState.Append(KJavaCapYes); + } + else + { + mCaptainState.Append(KJavaCapNo); + } + + mPrewarmState = _L("Prewarm enabled: "); + if (mPrewarmEnabled) + { + mPrewarmState.Append(KJavaCapYes); + } + else + { + mPrewarmState.Append(KJavaCapNo); + } + + mPrewarmUiState = _L("Prewarm UI enabled: "); + if (mPrewarmUiEnabled) + { + mPrewarmUiState.Append(KJavaCapYes); + } + else + { + mPrewarmUiState.Append(KJavaCapNo); + } + + mDebugState = _L("Java Debug enabled: "); + if (mDebugEnabled) + { + mDebugState.Append(KJavaCapYes); + } + else + { + mDebugState.Append(KJavaCapNo); + } + + mSecurityMode = _L("Security warnings: "); + if (mUserSecurityModeEnabled) + { + mSecurityMode.Append(KUserSecurityMode); + } + else + { + mSecurityMode.Append(KNormalSecurityMode); + } + + mSecurityPolicy = _L("Security policy: "); + switch (mSecurityPolicyId) + { + case KS60SecurityPolicyId: + mSecurityPolicy.Append(KS60SecurityPolicyName); + break; + case KMSASecurityPolicyId: + mSecurityPolicy.Append(KMSASecurityPolicyName); + break; + case KATTSecurityPolicyId: + mSecurityPolicy.Append(KATTSecurityPolicyName); + break; + default: + mSecurityPolicy.Append(KS60SecurityPolicyName); + } + + mRedirectState = _L("Redirect logs: "); + if (mRedirectEnabled) + { + mRedirectState.Append(KJavaCapYes); + } + else + { + mRedirectState.Append(KJavaCapNo); + } + + DrawDeferred(); +} + +void CJavaCaptainContainer::setCaptainState(bool running) +{ + mCaptainRunning = running; + updateStates(); +} + + + +#include "commsmessage.h" +#include "commsclientendpoint.h" + +void CJavaCaptainContainer::handleStateChangeCmd(int cmd) +{ + switch (cmd) + { + + case ETogglePrewarmEnable: + { + mPrewarmEnabled = !mPrewarmEnabled; + CommsMessage message; + message.setModuleId(PLUGIN_ID_JAVACAPTAIN_CORE_C); + if (mPrewarmEnabled) + { + message.setMessageId(CORE_MSG_ID_START_PREWARM); + } + else + { + message.setMessageId(CORE_MSG_ID_STOP_PREWARM); + } + CommsClientEndpoint comms; + comms.connect(IPC_ADDRESS_JAVA_CAPTAIN_C); + comms.send(message); + comms.disconnect(); + break; + } + case ETogglePrewarmUiEnable: + mPrewarmUiEnabled = !mPrewarmUiEnabled; + java::util::JavaIniFileUtils::setProperty(java::util::UI_PREWARM, mPrewarmUiEnabled); + break; + + case EDebugMode: + { + mDebugEnabled = !mDebugEnabled; + + CommsMessage message; + std::wstring vmArgs = L""; + if (mDebugEnabled) + { + vmArgs = L"-Xrunjdwp:server=y,address=localhost:8000"; + } + setSetExtraArguments(message, vmArgs, L""); + + CommsClientEndpoint comms; + comms.connect(IPC_ADDRESS_JAVA_CAPTAIN_C); + comms.send(message); + comms.disconnect(); + } + break; + + case ESecurityMode: + { + mUserSecurityModeEnabled = !mUserSecurityModeEnabled; + + if (mUserSecurityModeEnabled) + { + SetSecurityWarningsMode(SECURITY_WARNINGS_USER_DEFINED_MODE); + } + else + { + SetSecurityWarningsMode(SECURITY_WARNINGS_DEFAULT_MODE); + } + } + break; + case ES60SecurityPolicy: + mSecurityPolicyId = KS60SecurityPolicyId; + SetSecurityPolicy(mSecurityPolicyId); + break; + case EMSASecurityPolicy: + mSecurityPolicyId = KMSASecurityPolicyId; + SetSecurityPolicy(mSecurityPolicyId); + break; + case EATTSecurityPolicy: + mSecurityPolicyId = KATTSecurityPolicyId; + SetSecurityPolicy(mSecurityPolicyId); + break; + + case ERedirectMode: + mRedirectEnabled = !mRedirectEnabled; + if (mRedirectEnabled) + { + mRedirector->start(); + } + else + { + mRedirector->stop(); + } + break; + + default: + break; + } + updateStates(); +} + +std::wstring CJavaCaptainContainer::GetSecurityWarningsMode() +{ + try + { + JavaStorageApplicationEntry_t query; + JavaStorageApplicationList_t queryResult; + JavaStorageEntry attr; + attr.setEntry(ID, L""); + query.insert(attr); + attr.setEntry(SECURITY_WARNINGS, L""); + query.insert(attr); + iStorage->search(MIDP_PACKAGE_TABLE, query, queryResult); + JavaStorageApplicationList_t::const_iterator iterator; + JavaStorageApplicationList_t domainQueryResult; + for (iterator = queryResult.begin(); iterator != queryResult.end(); iterator++) + { + std::wstring securityWarnings = L""; + JavaStorageApplicationEntry_t entry = (*iterator); + findColumn(entry, SECURITY_WARNINGS, securityWarnings); + if (securityWarnings == SECURITY_WARNINGS_USER_DEFINED_MODE) + { + // make them all USER + SetSecurityWarningsMode(SECURITY_WARNINGS_USER_DEFINED_MODE); + return SECURITY_WARNINGS_USER_DEFINED_MODE; + } + } + } + catch (JavaStorageException& aJse) + { + } + // one mroe check: central repository + std::wstring securityWarningsMode = SECURITY_WARNINGS_DEFAULT_MODE; + TRAP_IGNORE( + CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity); + TInt warningsMode; + User::LeaveIfError(repository->Get(KSecurityWarnings, warningsMode)); + switch (warningsMode) +{ +case 1: + securityWarningsMode = SECURITY_WARNINGS_USER_DEFINED_MODE; + break; +case 2: + securityWarningsMode = SECURITY_WARNINGS_DEFAULT_MODE; + break; +} +CleanupStack::PopAndDestroy(repository);); + return securityWarningsMode; +} + +void CJavaCaptainContainer::SetSecurityWarningsMode(const std::wstring& aSecurityWarningsMode) +{ + try + { + JavaStorageApplicationEntry_t query; + JavaStorageApplicationList_t queryResult; + JavaStorageEntry attr; + attr.setEntry(ID, L""); + query.insert(attr); + iStorage->search(MIDP_PACKAGE_TABLE, query, queryResult); + JavaStorageApplicationList_t::const_iterator iterator; + JavaStorageApplicationList_t domainQueryResult; + for (iterator = queryResult.begin(); iterator != queryResult.end(); iterator++) + { + std::wstring uid = L""; + JavaStorageApplicationEntry_t entry = (*iterator); + findColumn(entry, ID, uid); + JavaStorageApplicationEntry_t oldEntry; + JavaStorageEntry oldAttr; + oldAttr.setEntry(ID, uid); + oldEntry.insert(oldAttr); + attr.setEntry(SECURITY_WARNINGS, aSecurityWarningsMode); + entry.clear(); + entry.insert(attr); + iStorage->update(MIDP_PACKAGE_TABLE, entry, oldEntry); + } + } + catch (JavaStorageException& aJse) + { + } + // set the cenRep key as well + TRAP_IGNORE( + CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity); + if (aSecurityWarningsMode == SECURITY_WARNINGS_USER_DEFINED_MODE) +{ + repository->Set(KSecurityWarnings, 1); + } + else + { + repository->Set(KSecurityWarnings, 2); + } + CleanupStack::PopAndDestroy(repository); + ); +} + +void CJavaCaptainContainer::findColumn(const JavaStorageApplicationEntry_t& aEntry, + const wstring& aColName, wstring& aColValue) +{ + JavaStorageEntry findPattern; + findPattern.setEntry(aColName, L""); + JavaStorageApplicationEntry_t::const_iterator findIterator = + aEntry.find(findPattern); + if (findIterator != aEntry.end()) + { + aColValue = findIterator->entryValue(); + } +} + + +int CJavaCaptainContainer::GetSecurityPolicy() +{ + int securityPolicyId =KS60SecurityPolicyId; + TRAP_IGNORE( + CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity); + HBufC* buf = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr policy(buf->Des()); + User::LeaveIfError(repository->Get(KPolicy, policy)); + if (policy.Compare(KS60SecurityPolicy) == 0) +{ + securityPolicyId = KS60SecurityPolicyId; +} +else if (policy.Compare(KMSASecurityPolicy) == 0) +{ + securityPolicyId = KMSASecurityPolicyId; +} +else if (policy.Compare(KATTSecurityPolicy) == 0) +{ + securityPolicyId = KATTSecurityPolicyId; +} +CleanupStack::PopAndDestroy(buf); +CleanupStack::PopAndDestroy(repository);); + return securityPolicyId; +} + +void CJavaCaptainContainer::SetSecurityPolicy(int aSecurityPolicyId) +{ + TRAP_IGNORE( + CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity); + switch (aSecurityPolicyId) +{ +case KS60SecurityPolicyId: + User::LeaveIfError(repository->Set(KPolicy, KS60SecurityPolicy)); + break; + case KMSASecurityPolicyId: + User::LeaveIfError(repository->Set(KPolicy, KMSASecurityPolicy)); + break; + case KATTSecurityPolicyId: + User::LeaveIfError(repository->Set(KPolicy, KATTSecurityPolicy)); + break; + } + CleanupStack::PopAndDestroy(repository);); +} + +// +// CJavaCaptainAppUi +// +CJavaCaptainAppUi::~CJavaCaptainAppUi() +{ + JELOG2(EJavaCaptain); + RemoveFromStack(iAppView); + delete iAppView; + delete mPeriodic; +} + +void CJavaCaptainAppUi::ConstructL() +{ + JELOG2(EJavaCaptain); + BaseConstructL(); + iAppView=new(ELeave) CJavaCaptainContainer; + iAppView->SetMopParent(this); + iAppView->ConstructL(ClientRect()); + + iCoeEnv->RootWin().EnableFocusChangeEvents(); + mPeriodic=CPeriodic::NewL(CActive::EPriorityStandard); + + AddToStackL(iAppView); + +} + +_LIT(KExecutableName, "javacaptain.exe"); + +void senMsgToSplash(int id) +{ + CommsMessage message; + message.setModuleId(1); + message.setMessageId(id); + CommsClientEndpoint comms; + comms.connect(10900); + comms.send(message); + comms.disconnect(); +} + +TInt CJavaCaptainAppUi::tick(TAny* appUi) +{ + CJavaCaptainAppUi* app = static_cast(appUi); +// ELOG1(EJavaCaptain,"mActive: %d", app->mActive); + if (app->mActive) + { + senMsgToSplash(1); + } + else + { + senMsgToSplash(2); + } + app->mActive = !app->mActive; + return 0; +} + +void CJavaCaptainAppUi::HandleCommandL(TInt aCommand) +{ + JELOG2(EJavaCaptain); + + switch (aCommand) + { + case EAknSoftkeyExit: + case EEikCmdExit: + Exit(); + break; + case ECaptainStart: + { + RProcess proc; + int st = proc.Create(KExecutableName, KExecutableName); + if (st == KErrNone) + { + proc.Resume(); + iAppView->setCaptainState(true); + } + proc.Close(); + } + break; + + case ECaptainStop: + { + CommsMessage message; + message.setModuleId(PLUGIN_ID_JAVACAPTAIN_CORE_C); + message.setMessageId(CORE_MSG_ID_STOP_JAVACAPTAIN); + CommsClientEndpoint comms; + comms.connect(IPC_ADDRESS_JAVA_CAPTAIN_C); + comms.send(message); + comms.disconnect(); + iAppView->setCaptainState(false); + } + break; + + case EThreadDump: + { + CommsMessage message; + message.setModuleId(PLUGIN_ID_JAVACAPTAIN_CORE_C); + message.setMessageId(CORE_MSG_ID_DO_THREAD_DUMP); + CommsClientEndpoint comms; + comms.connect(IPC_ADDRESS_JAVA_CAPTAIN_C); + comms.send(message); + comms.disconnect(); + } + break; + + case ETogglePrewarmEnable: + case ETogglePrewarmUiEnable: + case EDebugMode: + case ESecurityMode: + case ES60SecurityPolicy: + case EMSASecurityPolicy: + case EATTSecurityPolicy: + case ERedirectMode: + iAppView->handleStateChangeCmd(aCommand); + break; + + default: + Exit(); + break; + } +} + +CEikAppUi* CJavaCaptainEikDocument::CreateAppUiL() +{ + JELOG2(EJavaCaptain); + return(new(ELeave) CJavaCaptainAppUi); +} + +void CJavaCaptainEikDocument::ConstructL() +{ + JELOG2(EJavaCaptain); +} + +TUid CJavaCaptainApplication::AppDllUid() const +{ + JELOG2(EJavaCaptain); + return KUidJavaCaptain; +} + +CApaDocument* CJavaCaptainApplication::CreateDocumentL() +{ + JELOG2(EJavaCaptain); + CJavaCaptainEikDocument* document=new(ELeave) CJavaCaptainEikDocument(*this); + CleanupStack::PushL(document); + document->ConstructL(); + CleanupStack::Pop(); + return(document); +} + +#include + +LOCAL_C CApaApplication* NewApplication() +{ + JELOG2(EJavaCaptain); + return new CJavaCaptainApplication; +} + + +GLDEF_C TInt E32Main() +{ + JELOG2(EJavaCaptain); + return EikStart::RunApplication(NewApplication); +} + + +#include +#include +#include + +LogRedirector::LogRedirector() : mFd(-1) +{ + iJavaDiagnostic.reset(JavaDiagnostic::createInstance()); +} + +LogRedirector::~LogRedirector() +{ +} + +void LogRedirector::start() +{ + iJavaDiagnostic->setDiagnosticListener(*this); + mFd = open("c:\\data\\javaredirect.log", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); +} + +void LogRedirector::stop() +{ + iJavaDiagnostic->removeDiagnosticListener(); + close(mFd); + mFd = -1; +} + +void LogRedirector::systemOut(const TDesC8& aData) +{ + write(aData); +} + +void LogRedirector::systemErr(const TDesC8& aData) +{ + write(aData); +} + +void LogRedirector::log(const TDesC8& aData) +{ + write(aData); +} + +void LogRedirector::write(const TDesC8& aData) +{ + if (mFd > 0) + { + ::write(mFd, (const char*)aData.Ptr(), aData.Size()); + } +}; + + + +// End of File diff -r 461e71b327da -r 0553e2305d00 javatools/javacaptain_app/src.s60/javacap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacaptain_app/src.s60/javacap.h Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,132 @@ +/* +* 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: JavaCap +* +*/ + +#ifndef JAVACAP_H +#define JAVACAP_H + +#include +#include +#include +#include +#include +#include "javastorage.h" +#include "javadiagnostic.h" +using namespace java::debug; + +const TUid KUidJavaCaptain={ 0x20022D3C }; +class LogRedirector; + +class CJavaCaptainContainer : public CCoeControl +{ +public: + void ConstructL(const TRect& aRect); + ~CJavaCaptainContainer(); + static void ThreadMain(CJavaCaptainContainer*); + void updateStates(); + void setCaptainState(bool running); + void handleStateChangeCmd(int cmd); + +private: + void StartCaptain(); + void Draw(const TRect& aRect) const; + std::wstring GetSecurityWarningsMode(); + void SetSecurityWarningsMode(const std::wstring& aSecurityWarningsMode); + int GetSecurityPolicy(); + void SetSecurityPolicy(int); + void findColumn(const java::storage::JavaStorageApplicationEntry_t& aEntry, const std::wstring& aColName, std::wstring& aColValue); + + +private: + TBuf<20> mHeader; + TBuf<40> mCaptainState; + TBuf<40> mPrewarmState; + TBuf<40> mPrewarmUiState; + TBuf<40> mDebugState; + TBuf<40> mSecurityMode; + TBuf<40> mSecurityPolicy; + TBuf<40> mRedirectState; + + bool mCaptainRunning; + bool mPrewarmEnabled; + bool mPrewarmUiEnabled; + bool mDebugEnabled; + bool mUserSecurityModeEnabled; + int mSecurityPolicyId; + bool mRedirectEnabled; + + std::auto_ptr iStorage; + std::auto_ptr mRedirector; +}; + +class CJavaCaptainEikDocument : public CAknDocument +{ +public: + void ConstructL(); + CJavaCaptainEikDocument(CEikApplication& aApp): CAknDocument(aApp) { } + ~CJavaCaptainEikDocument() {} +private: + // from CAknDocument + CEikAppUi* CreateAppUiL(); +}; + +class CJavaCaptainAppUi : public CAknAppUi +{ +public: + void ConstructL(); + ~CJavaCaptainAppUi(); + +public: + static TInt tick(TAny* splash); + +private: + void HandleCommandL(TInt aCommand); + CJavaCaptainContainer* iAppView; + bool mActive; + CPeriodic* mPeriodic; +}; + +class CJavaCaptainApplication : public CAknApplication +{ +private: + // from CApaApplication + CApaDocument* CreateDocumentL(); + TUid AppDllUid() const; +}; + +class LogRedirector : public DiagnosticListener +{ +public: + LogRedirector(); + ~LogRedirector(); + + void start(); + void stop(); + + // DiagnosticListener methods + virtual void systemOut(const TDesC8& aData); + virtual void systemErr(const TDesC8& aData); + virtual void log(const TDesC8& aData); + +private: + void write(const TDesC8& aData); + std::auto_ptr iJavaDiagnostic; + + int mFd; +}; + +#endif // JAVACAP_H + diff -r 461e71b327da -r 0553e2305d00 javatools/javacaptain_app/src.s60/javacap.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacaptain_app/src.s60/javacap.hrh Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,38 @@ +/* +* 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: +* +*/ + +#ifndef _JAVACAP_HRH +#define _JAVACAP_HRH + +enum JavaCapCommandIds +{ + ECaptainCtl = 1, + EPrewarmCtl, + ECaptainStart, + ECaptainStop, + ETogglePrewarmEnable, + ETogglePrewarmUiEnable, + EThreadDump, + EDebugMode, + ESecurityMode, + ESecurityPolicy, + ES60SecurityPolicy, + EMSASecurityPolicy, + EATTSecurityPolicy, + ERedirectMode +}; +#endif diff -r 461e71b327da -r 0553e2305d00 javatools/javacaptain_app/src.s60/javacap.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacaptain_app/src.s60/javacap.rss Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,114 @@ +/* +* 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: +* +*/ +NAME JACA + +#include +#include +#include +#include + +#ifdef RD_SCALABLE_UI +#include +#endif + +#include "javacap.hrh" + +#include + +RESOURCE RSS_SIGNATURE { } + +RESOURCE TBUF { buf="javacap"; } + +RESOURCE EIK_APP_INFO + { + menubar = r_javacap_menubar; + cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT; + } + +#ifdef RD_SCALABLE_UI +RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info +{ + short_caption = "JavaCap"; + caption_and_icon = CAPTION_AND_ICON_INFO + { + caption = "JavaCap"; + }; +} +#endif + +//---------------------------------------------------- +// +// r_javacap_menubar +// +//---------------------------------------------------- +// +RESOURCE MENU_BAR r_javacap_menubar + { + titles = + { + MENU_TITLE { menu_pane = r_javacap_menu; txt = "Menu"; } + }; + } + +//---------------------------------------------------- +// +// r_askello_menu +// +//---------------------------------------------------- +// +RESOURCE MENU_PANE r_javacap_menu +{ + items = + { + MENU_ITEM { command = ECaptainCtl; txt = "JavaCaptain"; cascade = r_javacap_sub_menu;}, + MENU_ITEM { command = EPrewarmCtl; txt = "Prewarm"; cascade = r_javacap_prewarm_menu; }, + MENU_ITEM { command = EThreadDump; txt = "Thread dump";}, + MENU_ITEM { command = EDebugMode; txt = "Change debug mode";}, + MENU_ITEM { command = ESecurityMode; txt = "Change security warnings";}, + MENU_ITEM { command = ESecurityPolicy; txt = "SecurityPolicy"; cascade = r_javacap_secpolicy_sub_menu;}, + MENU_ITEM { command = ERedirectMode; txt = "Change redirect mode";} + }; +} + +RESOURCE MENU_PANE r_javacap_sub_menu +{ + items = + { + MENU_ITEM { command = ECaptainStart; txt = "Start Captain"; }, + MENU_ITEM { command = ECaptainStop; txt = "Stop Captain"; } + }; +} + +RESOURCE MENU_PANE r_javacap_secpolicy_sub_menu +{ + items = + { + MENU_ITEM { command = ES60SecurityPolicy; txt = "S60"; }, + MENU_ITEM { command = EMSASecurityPolicy; txt = "MSA"; }, + MENU_ITEM { command = EATTSecurityPolicy; txt = "AT&T"; } + }; +} + +RESOURCE MENU_PANE r_javacap_prewarm_menu +{ + items = + { + MENU_ITEM { command = ETogglePrewarmEnable; txt = "Prewarm (on/off)"; }, + MENU_ITEM { command = ETogglePrewarmUiEnable; txt = "Prewarm UI (on/off)"; } + }; +} + diff -r 461e71b327da -r 0553e2305d00 javatools/javacaptain_app/src.s60/javacap_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacaptain_app/src.s60/javacap_reg.rss Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,29 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include + +UID2 KUidAppRegistrationResourceFile +UID3 0x20022D3C + +RESOURCE APP_REGISTRATION_INFO +{ + app_file = "JavaCap"; + embeddability = KAppNotEmbeddable; + newfile=KAppDoesNotSupportNewFile; +} + +// End of File diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/build/bld.inf --- a/javatools/javacontrolpanel/controlpanel/build/bld.inf Fri Sep 17 17:50:17 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: Generated bld.inf -file -* -*/ - -PRJ_PLATFORMS -default - -PRJ_MMPFILES -javacontrolpanel_0x2002FF62.mmp diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/build/build.xml --- a/javatools/javacontrolpanel/controlpanel/build/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ - - - - - - - - - - - diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/build/bwins/javacontrolpanelu.def --- a/javatools/javacontrolpanel/controlpanel/build/bwins/javacontrolpanelu.def Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) - diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/build/eabi/javacontrolpanelu.def --- a/javatools/javacontrolpanel/controlpanel/build/eabi/javacontrolpanelu.def Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z10jni_lookupPKc @ 1 NONAME - diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/build/javacontrolpanel.pro --- a/javatools/javacontrolpanel/controlpanel/build/javacontrolpanel.pro Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +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: -# - -TARGET=javacontrolpanel -TEMPLATE=lib - -CONFIG += omj java stl -CONFIG -= qt - -LIBS += -ljavastorage - -symbian { - LIBS += -ljavadebugapi -lcentralrepository -} - -include(../../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/build/javacontrolpanel_0x2002FF62.mmp --- a/javatools/javacontrolpanel/controlpanel/build/javacontrolpanel_0x2002FF62.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,151 +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: Generated file - do not edit manually -* -*/ - -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) -// This file is generated by qmake and should not be modified by the -// user. -// Name : javacontrolpanel.mmp -// ============================================================================== - -TARGET javacontrolpanel.dll -TARGETTYPE DLL - -UID 0x1000008d 0x2002FF62 -SECUREID 0x2002FF62 - -EPOCALLOWDLLDATA - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO RD_JAVA_SYMBIAN_TARGET -MACRO RD_JAVA_S60_RELEASE_9_2 -MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS -MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS -MACRO RD_JAVA_STDCPPV5 -MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX -MACRO RD_JAVA_HTTP_EMC_ENABLED -MACRO RD_JAVA_NGA_ENABLED -MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED -MACRO RD_JAVA_OPENC_BETA_PATCH -MACRO RD_JAVA_INSTALLERUI_ENABLED -MACRO RD_JAVA_PREWARM -MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK -MACRO RD_JAVA_MIDPRMS_DB -MACRO __SYMBIAN32__ -MACRO J9EPOC32 - -SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../../../../inc -SYSTEMINCLUDE ../src -SYSTEMINCLUDE ../src.s60 -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE . - -SOURCEPATH ../src -SOURCE javacaptain.cpp -SOURCE redirector.cpp -SOURCE securityconfig.cpp - -SOURCEPATH ../src.s60 -SOURCE logredirector.cpp -SOURCE security.cpp - - -LIBRARY javastorage.lib -LIBRARY javadebugapi.lib -LIBRARY centralrepository.lib -LIBRARY javautils.lib -LIBRARY libpthread.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib -LIBRARY apgrfx.lib - -CAPABILITY all -tcb - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden -#if defined(ARMCC_4_0) -OPTION ARMCC --import_all_vtbl -#endif -OPTION GCCE -fvisibility-inlines-hidden - -VERSION 10.0 - -ARMFPU softvfp - -PAGED - -BYTEPAIRCOMPRESSTARGET - -USERINCLUDE . - -#include - - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - -deffile ./~/javacontrolpanel.def - - SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) - -SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah - -SOURCEPATH /epoc32/build/jrt/javabuild/javacontrolpanel - -SOURCE lookup.cpp - -SOURCEPATH /epoc32/build/jrt/javabuild/javacontrolpanel - -SOURCE jxe.c - -#ifdef WINSCW - -LIBRARY ewsd.lib - -#endif - -STDCPP - -#ifdef WINSCW -DEFFILE ./bwins/javacontrolpanel.def -#elif defined EABI -DEFFILE ./eabi/javacontrolpanel.def -#endif diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaCaptain.java --- a/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaCaptain.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,206 +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: -* -*/ - -package com.nokia.mj.impl.javacontrolpanel; - -import com.nokia.mj.impl.utils.Logger; -import com.nokia.mj.impl.comms.*; -import com.nokia.mj.impl.comms.exception.*; - - -class JavaCaptain -{ - private final static int PLUGIN_ID_JAVACAPTAIN_CORE_C = 13; - private final static int CORE_MSG_ID_STOP_JAVACAPTAIN = 130; - private final static int CORE_MSG_ID_DO_THREAD_DUMP = 131; - private final static int CORE_MSG_ID_START_PREWARM = 132; - private final static int CORE_MSG_ID_STOP_PREWARM = 133; - private final static int CORE_MSG_ID_GET_PREWARM = 134; - - private final static int PLUGIN_ID_RTC_C = 1; - private final static int RTC_MSG_ID_SET_EXTRA_ARGUMENTS = 150; - private final static int RTC_MSG_ID_GET_EXTRA_ARGUMENTS = 151; - - private final static String JVM_DEBUG_ARGS = "-Xrunjdwp:server=y,address=localhost:8000"; - - public JavaCaptain() - { - } - - public boolean isRunning() - { - CommsEndpoint comms = new CommsEndpoint(); - boolean isRunning = false; - try - { - comms.connect(CommsEndpoint.JAVA_CAPTAIN); - comms.disconnect(); - isRunning = true; - } - catch (CommsException e) - { - e.printStackTrace(); - } - finally - { - comms.destroy(); - } - return isRunning; - } - - public void start() - { - _start(); - // wait until JC message loop is up - for(int i = 0; i < 5; i++) - { - try - { - Thread.sleep(30); - } - catch(InterruptedException e) {} - if (isRunning()) - { - break; - } - } - } - - public void stop() - { - CommsMessage message = createMessage(); - message.setMessageId(CORE_MSG_ID_STOP_JAVACAPTAIN); - // waits until JC message loop is down - sendReceive(message); - } - - public boolean isPrewarmEnabled() - { - CommsMessage message = createMessage(); - message.setMessageId(CORE_MSG_ID_GET_PREWARM); - CommsMessage reply = sendReceive(message); - int enabled = reply.readInt(); - return enabled == 1 ? true : false; - } - - public void enablePrewarm(boolean aEnable) - { - CommsMessage message = createMessage(); - if (aEnable) - { - message.setMessageId(CORE_MSG_ID_START_PREWARM); - } - else - { - message.setMessageId(CORE_MSG_ID_STOP_PREWARM); - } - send(message); - } - - public void doThreadDump() - { - CommsMessage message = createMessage(); - message.setMessageId(CORE_MSG_ID_DO_THREAD_DUMP); - send(message); - } - - public boolean isDebugEnabled() - { - CommsMessage message = createDebugMessage(); - message.setMessageId(RTC_MSG_ID_GET_EXTRA_ARGUMENTS); - CommsMessage receivedMessage = sendReceive(message); - String vmArgs = receivedMessage.readString(); - boolean enabled = false; - if(vmArgs.compareTo(JVM_DEBUG_ARGS) == 0) - { - enabled = true; - } - return enabled; - } - - public void enableDebug(boolean aEnable) - { - String vmArgs = ""; - if (aEnable) - { - vmArgs = JVM_DEBUG_ARGS; - } - - CommsMessage message = createDebugMessage(); - message.setMessageId(RTC_MSG_ID_SET_EXTRA_ARGUMENTS); - message.write(vmArgs); - message.write(""); // appArgs - send(message); - } - - private void send(CommsMessage aMessage) - { - CommsEndpoint comms = new CommsEndpoint(); - try - { - comms.connect(CommsEndpoint.JAVA_CAPTAIN); - comms.send(aMessage); - comms.disconnect(); - } - catch (CommsException e) - { - e.printStackTrace(); - } - finally - { - comms.destroy(); - } - } - - private CommsMessage sendReceive(CommsMessage aMessage) - { - CommsEndpoint comms = new CommsEndpoint(); - CommsMessage receivedMessage = new CommsMessage(); - try - { - comms.connect(CommsEndpoint.JAVA_CAPTAIN); - receivedMessage = comms.sendReceive(aMessage, CommsEndpoint.WAIT_FOR_EVER); - comms.disconnect(); - } - catch (CommsException e) - { - e.printStackTrace(); - } - finally - { - comms.destroy(); - } - return receivedMessage; - } - - private CommsMessage createMessage() - { - CommsMessage message = new CommsMessage(); - message.setModuleId(PLUGIN_ID_JAVACAPTAIN_CORE_C); - return message; - } - - private CommsMessage createDebugMessage() - { - CommsMessage message = new CommsMessage(); - message.setModuleId(PLUGIN_ID_RTC_C); - return message; - } - - private native void _start(); - -} diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaControlPanel.java --- a/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaControlPanel.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +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: -* -*/ - -package com.nokia.mj.impl.javacontrolpanel; - -import com.nokia.mj.impl.utils.Logger; -import com.nokia.mj.impl.rt.support.JvmInternal; -import com.nokia.mj.impl.rt.support.ThreadEventListener; - -class JavaControlPanel -{ - /** - * JavaControlPanel main program. - * - * @param aArgs command line arguments - */ - public static void main(String[] aArgs) - { - Logger.ILOG(Logger.EUtils, "JavaControlPanel.main starts"); - int exitCode = 0; - - try - { - JvmInternal.setThreadEventListener(new ThreadEventListener() - { - public void threadStarting(Thread newThread, Thread parentThread) {} - public void threadDied(Thread thread) {} - public void uncaughtException(Thread thread, Throwable throwable) - { - String threadName = null; - if (thread != null) - { - threadName = thread.getName(); - } - Logger.ELOG(Logger.EUtils, "Unhandled exception in " + - threadName, throwable); - } - }); - exitCode = mainWithResult(aArgs); - } - catch (Throwable t) - { - Logger.ELOG(Logger.EUtils, "Unhandled exception in main", t); - exitCode = -1; - } - - Logger.ILOG(Logger.EUtils, "JavaControlPanel.main exits with code " + exitCode); - System.exit(exitCode); - } - - /** - * JavaControlPanel main program which returns error code indicating - * operation result. - * - * @param aArgs command line arguments - * @return error code indicating operation result - */ - public static int mainWithResult(String[] aArgs) - { - if (aArgs.length == 0) - { - JavaControlPanelUi ui = new JavaControlPanelUi(); - ui.show(); - } - else - { - Logger.WLOG(Logger.EUtils, "JavaControlPanel making thread dump and exiting"); - new JavaCaptain().doThreadDump(); - } - return 0; - } - -} diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaControlPanelUi.java --- a/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaControlPanelUi.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,434 +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: -* -*/ - -package com.nokia.mj.impl.javacontrolpanel; - -import com.nokia.mj.impl.rt.support.Jvm; -import org.eclipse.swt.layout.*; -import org.eclipse.ercp.swt.mobile.*; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.*; -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.graphics.*; - -import com.nokia.mj.impl.utils.Logger; - -class JavaControlPanelUi -{ - private JavaCaptain iCaptain; - private Redirector iRedirector; - private SecurityConfig iSecurity; - - private Shell iShell; - private Button iJavaCaptain; - private Button iPrewarm; - private Button iThreadDump; - private Button iJavaDebug; - private Button iRedirect; - private Combo iSecurityWarnings; - private Combo iSecurityPolicy; - - static - { - Jvm.loadSystemLibrary("javacontrolpanel"); - } - - public JavaControlPanelUi() - { - iCaptain = new JavaCaptain(); - iRedirector = new Redirector(); - iSecurity = new SecurityConfig(); - } - - public void show() - { - Display display = new Display(); - iShell = new Shell(display); - - createUi(); - iShell.pack(); - iShell.open(); - handleOrientationChange(); - - while (!iShell.isDisposed()) - { - if (!display.readAndDispatch()) - { - display.sleep(); - } - } - display.dispose(); - } - - private void exitEventLoop() - { - iRedirector.stop(); - iShell.dispose(); - } - - private void createUi() - { - try - { - setLayout(); - createJavaCaptainUi(); - createPrewarmUi(); - createThreadDumpUi(); - createJavaDebugUi(); - createSecurityWarningsUi(); - createSecurityPolicyUi(); - createRedirectLogsUi(); - createCommands(); - platformAdaptation(); - } - catch (Throwable e) - { - Logger.ELOG(Logger.EUtils, "createUi failed", e); - exitEventLoop(); - } - } - - private void setLayout() - { - iShell.setText("Java Control Panel"); - iShell.setLayout(new GridLayout(2, false)); - } - - private void createJavaCaptainUi() - { - Label label = new Label(iShell, SWT.NONE); - label.setText("Java Captain"); - label.setLayoutData(new GridData(SWT.CENTER)); - - iJavaCaptain = new Button(iShell, SWT.TOGGLE); - iJavaCaptain.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - iJavaCaptain.addSelectionListener(new SelectionListener() - { - public void widgetDefaultSelected(SelectionEvent aEvent) - { - widgetSelected(aEvent); - } - public void widgetSelected(SelectionEvent event) - { - javaCaptainPressed(); - } - }); - toggleJavaCaptain(iCaptain.isRunning()); - } - - private void createPrewarmUi() - { - Label label = new Label(iShell, SWT.NONE); - label.setText("Prewarm"); - label.setLayoutData(new GridData(SWT.CENTER)); - - iPrewarm = new Button(iShell, SWT.TOGGLE); - iPrewarm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - iPrewarm.addSelectionListener(new SelectionListener() - { - public void widgetDefaultSelected(SelectionEvent aEvent) - { - widgetSelected(aEvent); - } - public void widgetSelected(SelectionEvent event) - { - prewarmPressed(); - } - }); - togglePrewarm(iCaptain.isPrewarmEnabled()); - } - - private void createThreadDumpUi() - { - Label label = new Label(iShell, SWT.NONE); - label.setText("Thread Dump"); - label.setLayoutData(new GridData(SWT.CENTER)); - - iThreadDump = new Button(iShell, SWT.PUSH); - iThreadDump.setText("Dump"); - iThreadDump.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - iThreadDump.addSelectionListener(new SelectionListener() - { - public void widgetDefaultSelected(SelectionEvent aEvent) - { - widgetSelected(aEvent); - } - public void widgetSelected(SelectionEvent event) - { - threadDumpPressed(); - } - }); - } - - private void createJavaDebugUi() - { - Label label = new Label(iShell, SWT.NONE); - label.setText("Java Debug"); - label.setLayoutData(new GridData(SWT.CENTER)); - - iJavaDebug = new Button(iShell, SWT.TOGGLE); - iJavaDebug.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - iJavaDebug.addSelectionListener(new SelectionListener() - { - public void widgetDefaultSelected(SelectionEvent aEvent) - { - widgetSelected(aEvent); - } - public void widgetSelected(SelectionEvent event) - { - javaDebugPressed(); - } - }); - toggleJavaDebug(iCaptain.isDebugEnabled()); - } - - private void createSecurityWarningsUi() - { - Label label = new Label(iShell, SWT.NONE); - label.setText("Security Warnings"); - label.setLayoutData(new GridData(SWT.CENTER)); - - iSecurityWarnings = new Combo(iShell, SWT.DROP_DOWN | SWT.READ_ONLY); - for(int i = 0; i < SecurityConfig.MODES.length; i++) - { - iSecurityWarnings.add(SecurityConfig.MODES[i]); - } - iSecurityWarnings.select(iSecurity.getWarningsMode()); - iSecurityWarnings.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - iSecurityWarnings.addSelectionListener(new SelectionListener() - { - public void widgetDefaultSelected(SelectionEvent aEvent) - { - widgetSelected(aEvent); - } - public void widgetSelected(SelectionEvent event) - { - securityWarningsSelected(); - } - }); - } - - private void createSecurityPolicyUi() - { - Label label = new Label(iShell, SWT.NONE); - label.setText("Security Policy"); - label.setLayoutData(new GridData(SWT.CENTER)); - - iSecurityPolicy = new Combo(iShell, SWT.DROP_DOWN | SWT.READ_ONLY); - for(int i = 0; i < SecurityConfig.POLICIES.length; i++) - { - iSecurityPolicy.add(SecurityConfig.POLICIES[i]); - } - iSecurityPolicy.select(iSecurity.getSecurityPolicy()); - iSecurityPolicy.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - iSecurityPolicy.addSelectionListener(new SelectionListener() - { - public void widgetDefaultSelected(SelectionEvent aEvent) - { - widgetSelected(aEvent); - } - public void widgetSelected(SelectionEvent event) - { - securityPolicySelected(); - } - }); - } - - private void createRedirectLogsUi() - { - Label label = new Label(iShell, SWT.NONE); - label.setText("Redirect Logs"); - label.setLayoutData(new GridData(SWT.CENTER)); - - iRedirect = new Button(iShell, SWT.TOGGLE); - iRedirect.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); - iRedirect.addSelectionListener(new SelectionListener() - { - public void widgetDefaultSelected(SelectionEvent aEvent) - { - widgetSelected(aEvent); - } - public void widgetSelected(SelectionEvent event) - { - redirectPressed(); - } - }); - toggleRedirect(iRedirector.isRedirecting()); - } - - private void createCommands() - { - Command exit = new Command(iShell, Command.EXIT, 0); - exit.setText("Exit"); - exit.addSelectionListener(new SelectionListener() - { - public void widgetDefaultSelected(SelectionEvent aEvent) - { - widgetSelected(aEvent); - } - public void widgetSelected(SelectionEvent aEvent) - { - exitEventLoop(); - } - }); - } - - private void platformAdaptation() - { - if (isLinux()) - { - configureUi(); - } - } - - private void configureUi() - { - // add second dummy command so that menu bar is visible - new Command(iShell, Command.GENERAL, 0).setText(""); - - // disable not supported services - iRedirect.setEnabled(false); - iSecurityPolicy.setEnabled(false); - iSecurityWarnings.setEnabled(false); - } - - private void handleOrientationChange() - { - iShell.addControlListener(new ControlListener() - { - private boolean handleEvent = false; - public void controlMoved(ControlEvent e) - { - } - public void controlResized(ControlEvent e) - { - // ignore first event that comes during startup - if (handleEvent) - { - // avoid flickering during orientation change - iShell.setVisible(false); - iShell.layout(); - iShell.setVisible(true); - } - handleEvent = true; - } - }); - } - - - private void javaCaptainPressed() - { - if (iJavaCaptain.getSelection()) - { - iCaptain.start(); - javaCaptainStarted(); - } - else - { - iCaptain.stop(); - } - toggleJavaCaptain(iJavaCaptain.getSelection()); - } - - private void toggleJavaCaptain(boolean aSelected) - { - iJavaCaptain.setText( aSelected ? "Running" : "Stopped"); - iJavaCaptain.setSelection(aSelected); - } - - private void prewarmPressed() - { - iCaptain.enablePrewarm(iPrewarm.getSelection()); - togglePrewarm(iPrewarm.getSelection()); - } - - private void togglePrewarm(boolean aSelected) - { - iPrewarm.setText( aSelected ? "Enabled" : "Disabled"); - iPrewarm.setSelection(aSelected); - } - - private void threadDumpPressed() - { - iCaptain.doThreadDump(); - } - - private void javaDebugPressed() - { - iCaptain.enableDebug(iJavaDebug.getSelection()); - toggleJavaDebug(iJavaDebug.getSelection()); - } - - private void toggleJavaDebug(boolean aSelected) - { - iJavaDebug.setText( aSelected ? "Enabled" : "Disabled"); - iJavaDebug.setSelection(aSelected); - } - - private void securityWarningsSelected() - { - iSecurity.setWarningsMode(iSecurityWarnings.getSelectionIndex()); - } - - private void securityPolicySelected() - { - iSecurity.setSecurityPolicy(iSecurityPolicy.getSelectionIndex()); - } - - private void redirectPressed() - { - if (iRedirect.getSelection()) - { - iRedirector.start(); - } - else - { - iRedirector.stop(); - } - toggleRedirect(iRedirect.getSelection()); - } - - private void toggleRedirect(boolean aSelected) - { - iRedirect.setText( aSelected ? "Yes" : "No"); - iRedirect.setSelection(aSelected); - } - - private void javaCaptainStarted() - { - // some JavaCaptain services return to default settings - // when JC is restarted so refresh states - togglePrewarm(iCaptain.isPrewarmEnabled()); - toggleJavaDebug(iCaptain.isDebugEnabled()); - } - - private boolean isLinux() - { - String platform = System.getProperty("os.name"); - if (platform != null && platform.equalsIgnoreCase("linux")) - { - return true; - } - return false; - } - -} - - - - - diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/Redirector.java --- a/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/Redirector.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +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: -* -*/ - -package com.nokia.mj.impl.javacontrolpanel; - -class Redirector -{ - private int iHandle; - - public Redirector() - { - } - - public void start() - { - stop(); - iHandle = _start(); - } - - public void stop() - { - if (isRedirecting()) - { - _stop(iHandle); - iHandle = 0; - } - } - - public boolean isRedirecting() - { - if (iHandle != 0) - { - return true; - } - else - { - return false; - } - } - - private native int _start(); - private native void _stop(int aHandle); - -} diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/SecurityConfig.java --- a/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/SecurityConfig.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +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: -* -*/ - -package com.nokia.mj.impl.javacontrolpanel; - -import com.nokia.mj.impl.utils.Logger; - - -class SecurityConfig -{ - private static final String SECURITY_WARNINGS_USER_DEFINED_MODE = "1"; - private static final String SECURITY_WARNINGS_DEFAULT_MODE = "2"; - - private static final int S60_SECURITY_POLICY_ID = 1; - private static final int MSA_SECURITY_POLICY_ID = 2; - private static final int ATT_SECURITY_POLICY_ID = 3; - - public static final String MODES[] = { "Default", "User"}; - public static final String POLICIES[] = { "S60", "MSA", "AT&T"}; - - public SecurityConfig() - { - } - - public int getSecurityPolicy() - { - int index = _getSecurityPolicy() - 1; - return index; - } - - public void setSecurityPolicy(int aPolicyIndex) - { - int id = aPolicyIndex + 1; - _setSecurityPolicy(id); - } - - public int getWarningsMode() - { - String mode = _getSecurityWarningsMode(); - int index = 0; - if (mode.compareTo(SECURITY_WARNINGS_USER_DEFINED_MODE) == 0 ) - { - index = 1; - } - return index; - } - - public void setWarningsMode(int aModeIndex) - { - if (aModeIndex == 0) - { - _setSecurityWarningsMode(SECURITY_WARNINGS_DEFAULT_MODE); - } - else - { - _setSecurityWarningsMode(SECURITY_WARNINGS_USER_DEFINED_MODE); - } - } - - private native String _getSecurityWarningsMode(); - private native void _setSecurityWarningsMode(String aMode); - private native int _getSecurityPolicy(); - private native void _setSecurityPolicy(int aPolicyId); - -} diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/rt/javacontrolpanel/ApplicationInfoImpl.java --- a/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/rt/javacontrolpanel/ApplicationInfoImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +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: -* -*/ - -package com.nokia.mj.impl.rt.javacontrolpanel; - -import com.nokia.mj.impl.rt.support.ApplicationInfo; -import com.nokia.mj.impl.utils.Uid; - -/** - * @author Nokia Corporation - * @version 1.0 - */ - -public class ApplicationInfoImpl extends ApplicationInfo -{ - private String iProtectionDomain = null; - - /** - */ - public String getRuntimeType() - { - // See runtime types defined in ApplicationInfo class. - return "JavaControlPanel"; - } - - /** - */ - public String getProtectionDomain() - { - return MANUFACTURER_DOMAIN; - } - - /** - */ - public Uid getUid() - { - return Uid.createUid("[2002FF61]"); - } - - /** - */ - public Uid getSuiteUid() - { - throw new RuntimeException - ("Get suite uid is not applicable for JavaControlPanel"); - } - - /** - */ - public String getSuiteName() - { - return getName(); - } - - /** - */ - public String getName() - { - return "JavaControlPanel"; - } - - /** - */ - public String getVendor() - { - return "Nokia"; - } - - /** - */ - public String getVersion() - { - return "1.0.0"; - } - - /** - */ - public String getRootPath() - { - throw new RuntimeException - ("getRootPath is not applicable for JavaControlPanel"); - } - - /** - */ - public String getMainClass() - { - throw new RuntimeException - ("Get main class is not applicable for JavaControlPanel"); - } - - /** - */ - public String getAttribute(String key) - { - return null; - } -} diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/rt/javacontrolpanel/ApplicationUtilsImpl.java --- a/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/rt/javacontrolpanel/ApplicationUtilsImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +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: -* -*/ - -package com.nokia.mj.impl.rt.javacontrolpanel; - -import com.nokia.mj.impl.rt.support.ApplicationInfo; -import com.nokia.mj.impl.rt.support.ApplicationUtils; -import com.nokia.mj.impl.utils.Uid; -import com.nokia.mj.impl.utils.Logger; - -import java.security.Permission; -import java.security.AccessControlException; - -/** - * @author Nokia Corporation - * @version 1.0 - */ -public class ApplicationUtilsImpl extends ApplicationUtils -{ - public static void doShutdownImpl() - { - // Send shutdown notification to all registered listeners. - ((ApplicationUtilsImpl)sInstance).doShutdown(); - } - - - public void notifyExitCmd() - { - Logger.ILOG(Logger.EUtils, "notifyExitCmd() - exiting"); - System.exit(0); - } - - public void checkPermission(Permission aPermission) - throws AccessControlException, NullPointerException - { - checkPermission(null, aPermission); - } - - public void checkPermission(Uid aAppUid, Permission aPermission) - throws AccessControlException, NullPointerException - { - return; - } -} diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/src.s60/logredirector.cpp --- a/javatools/javacontrolpanel/controlpanel/src.s60/logredirector.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +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: -* -*/ - -#include -#include -#include -#include -#include "logredirector.h" - -LogRedirector::LogRedirector() : mFd(-1) -{ - iJavaDiagnostic.reset(JavaDiagnostic::createInstance()); -} - -LogRedirector::~LogRedirector() -{ -} - -void LogRedirector::start() -{ - iJavaDiagnostic->setDiagnosticListener(*this); - mFd = open("c:\\data\\javaredirect.log", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR); -} - -void LogRedirector::stop() -{ - iJavaDiagnostic->removeDiagnosticListener(); - close(mFd); - mFd = -1; -} - -void LogRedirector::systemOut(const TDesC8& aData) -{ - write(aData); -} - -void LogRedirector::systemErr(const TDesC8& aData) -{ - write(aData); -} - -void LogRedirector::log(const TDesC8& aData) -{ - write(aData); -} - -void LogRedirector::write(const TDesC8& aData) -{ - if (mFd > 0) - { - ::write(mFd, (const char*)aData.Ptr(), aData.Size()); - } -}; - diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/src.s60/logredirector.h --- a/javatools/javacontrolpanel/controlpanel/src.s60/logredirector.h Fri Sep 17 17:50:17 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: -* -*/ - -#ifndef LOGREDIRECTOR_H -#define LOGREDIRECTOR_H - -#include -#include "javadiagnostic.h" -using namespace java::debug; - -class LogRedirector : public DiagnosticListener -{ -public: - LogRedirector(); - ~LogRedirector(); - - void start(); - void stop(); - - // DiagnosticListener methods - virtual void systemOut(const TDesC8& aData); - virtual void systemErr(const TDesC8& aData); - virtual void log(const TDesC8& aData); - -private: - void write(const TDesC8& aData); - std::auto_ptr iJavaDiagnostic; - int mFd; -}; - -#endif // LOGREDIRECTOR_H - diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/src.s60/security.cpp --- a/javatools/javacontrolpanel/controlpanel/src.s60/security.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,220 +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: -* -*/ - - -#include -#include - -#include "security.h" -#include "logger.h" -#include "javastoragenames.h" -#include "securitystoragedatadefs.h" - -using namespace java::storage; -using namespace std; - -_LIT(KS60SecurityPolicy, "s60"); -_LIT(KMSASecurityPolicy, "msa"); -_LIT(KATTSecurityPolicy, "att"); -// Java Security Policy Central Repository UID -static const TUid KCRUidJavaSecurity = { 0x2001B289 }; -// IDs for security folder and file keys -static const TUint32 KPolicy = 0x03; -static const TUint32 KSecurityWarnings = 0x04; - -const int S60_SECURITY_POLICY_ID = 1; -const int MSA_SECURITY_POLICY_ID = 2; -const int ATT_SECURITY_POLICY_ID = 3; - - -Security::Security() -{ - try - { - iStorage.reset(JavaStorage::createInstance()); - iStorage->open(); - } - catch (JavaStorageException& e) - { - ELOG1(EUtils, "open storage connection failed, %s", e.toString().c_str()); - } -} - -Security::~Security() -{ -} - -std::wstring Security::getSecurityWarningsMode() -{ - try - { - JavaStorageApplicationEntry_t query; - JavaStorageApplicationList_t queryResult; - JavaStorageEntry attr; - attr.setEntry(ID, L""); - query.insert(attr); - attr.setEntry(SECURITY_WARNINGS, L""); - query.insert(attr); - iStorage->search(MIDP_PACKAGE_TABLE, query, queryResult); - JavaStorageApplicationList_t::const_iterator iterator; - JavaStorageApplicationList_t domainQueryResult; - for (iterator = queryResult.begin(); iterator != queryResult.end(); iterator++) - { - std::wstring securityWarnings = L""; - JavaStorageApplicationEntry_t entry = (*iterator); - findColumn(entry, SECURITY_WARNINGS, securityWarnings); - if (securityWarnings == SECURITY_WARNINGS_USER_DEFINED_MODE) - { - // make them all USER - setSecurityWarningsMode(SECURITY_WARNINGS_USER_DEFINED_MODE); - return SECURITY_WARNINGS_USER_DEFINED_MODE; - } - } - } - catch (JavaStorageException& aJse) - { - } - // one more check: central repository - std::wstring securityWarningsMode = SECURITY_WARNINGS_DEFAULT_MODE; - TRAP_IGNORE - ( - CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity); - TInt warningsMode; - User::LeaveIfError(repository->Get(KSecurityWarnings, warningsMode)); - switch (warningsMode) - { - case 1: - securityWarningsMode = SECURITY_WARNINGS_USER_DEFINED_MODE; - break; - case 2: - securityWarningsMode = SECURITY_WARNINGS_DEFAULT_MODE; - break; - } - CleanupStack::PopAndDestroy(repository); - ); - return securityWarningsMode; -} - -void Security::setSecurityWarningsMode(const std::wstring& aSecurityWarningsMode) -{ - try - { - JavaStorageApplicationEntry_t query; - JavaStorageApplicationList_t queryResult; - JavaStorageEntry attr; - attr.setEntry(ID, L""); - query.insert(attr); - iStorage->search(MIDP_PACKAGE_TABLE, query, queryResult); - JavaStorageApplicationList_t::const_iterator iterator; - JavaStorageApplicationList_t domainQueryResult; - for (iterator = queryResult.begin(); iterator != queryResult.end(); iterator++) - { - std::wstring uid = L""; - JavaStorageApplicationEntry_t entry = (*iterator); - findColumn(entry, ID, uid); - JavaStorageApplicationEntry_t oldEntry; - JavaStorageEntry oldAttr; - oldAttr.setEntry(ID, uid); - oldEntry.insert(oldAttr); - attr.setEntry(SECURITY_WARNINGS, aSecurityWarningsMode); - entry.clear(); - entry.insert(attr); - iStorage->update(MIDP_PACKAGE_TABLE, entry, oldEntry); - } - } - catch (JavaStorageException& aJse) - { - } - // set the cenRep key as well - TRAP_IGNORE - ( - CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity); - if (aSecurityWarningsMode == SECURITY_WARNINGS_USER_DEFINED_MODE) - { - repository->Set(KSecurityWarnings, 1); - } - else - { - repository->Set(KSecurityWarnings, 2); - } - CleanupStack::PopAndDestroy(repository); - ); -} - -void Security::findColumn(const JavaStorageApplicationEntry_t& aEntry, - const wstring& aColName, wstring& aColValue) -{ - JavaStorageEntry findPattern; - findPattern.setEntry(aColName, L""); - JavaStorageApplicationEntry_t::const_iterator findIterator = - aEntry.find(findPattern); - if (findIterator != aEntry.end()) - { - aColValue = findIterator->entryValue(); - } -} - -int Security::getSecurityPolicy() -{ - int securityPolicyId = S60_SECURITY_POLICY_ID; - TRAP_IGNORE - ( - CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity); - HBufC* buf = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); - TPtr policy(buf->Des()); - User::LeaveIfError(repository->Get(KPolicy, policy)); - if (policy.Compare(KS60SecurityPolicy) == 0) - { - securityPolicyId = S60_SECURITY_POLICY_ID; - } - else if (policy.Compare(KMSASecurityPolicy) == 0) - { - securityPolicyId = MSA_SECURITY_POLICY_ID; - } - else if (policy.Compare(KATTSecurityPolicy) == 0) - { - securityPolicyId = ATT_SECURITY_POLICY_ID; - } - CleanupStack::PopAndDestroy(buf); - CleanupStack::PopAndDestroy(repository); - ); - return securityPolicyId; - -} - -void Security::setSecurityPolicy(int aSecurityPolicyId) -{ - TRAP_IGNORE - ( - CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity); - switch (aSecurityPolicyId) - { - case S60_SECURITY_POLICY_ID: - User::LeaveIfError(repository->Set(KPolicy, KS60SecurityPolicy)); - break; - case MSA_SECURITY_POLICY_ID: - User::LeaveIfError(repository->Set(KPolicy, KMSASecurityPolicy)); - break; - case ATT_SECURITY_POLICY_ID: - User::LeaveIfError(repository->Set(KPolicy, KATTSecurityPolicy)); - break; - } - CleanupStack::PopAndDestroy(repository); - ); -} - - diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/src.s60/security.h --- a/javatools/javacontrolpanel/controlpanel/src.s60/security.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +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: -* -*/ - -#ifndef SECURITY_H -#define SECURITY_H - -#include -#include -#include "javastorage.h" - -class Security -{ -public: - Security(); - ~Security(); - - std::wstring getSecurityWarningsMode(); - void setSecurityWarningsMode(const std::wstring& aMode); - int getSecurityPolicy(); - void setSecurityPolicy(int aPolicyId); - -private: - void findColumn(const java::storage::JavaStorageApplicationEntry_t& aEntry, - const std::wstring& aColName, std::wstring& aColValue); - - std::auto_ptr iStorage; -}; - -#endif // SECURITY_H diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/src/javacaptain.cpp --- a/javatools/javacontrolpanel/controlpanel/src/javacaptain.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,65 +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: JavaCaptain -* -*/ - - -#include "com_nokia_mj_impl_javacontrolpanel_JavaCaptain.h" - -#ifdef __SYMBIAN32__ -#include -#else -#include -#endif - -#include -#include -#include "logger.h" - -/* - * Class: com_nokia_mj_impl_javacontrolpanel_JavaCaptain - * Method: _start - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_com_nokia_mj_impl_javacontrolpanel_JavaCaptain__1start - (JNIEnv *, jobject) -{ - int rc = 0; - int pid = 0; - char* av[2]; - int index = 0; - av[index++] = "javacaptain"; - av[index] = NULL; - -#ifdef __SYMBIAN32__ - rc = posix_spawn(&pid, "javacaptain", NULL, NULL, av, NULL); -#else - if (!(pid = fork())) - { - rc = execvp("javacaptain", av); - if (rc == -1) - { - rc = errno; - } - } -#endif // __SYMBIAN32__ - - if (rc) - { - ELOG3(EUtils,"%s failed, %s - errno=%d", __PRETTY_FUNCTION__, strerror(rc), rc); - } - -} - diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/src/redirector.cpp --- a/javatools/javacontrolpanel/controlpanel/src/redirector.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,55 +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: -* -*/ - - -#include "com_nokia_mj_impl_javacontrolpanel_Redirector.h" -#include "logger.h" -#ifdef __SYMBIAN32__ -#include "logredirector.h" -#endif - -/* - * Class: com_nokia_mj_impl_javacontrolpanel_Redirector - * Method: _start - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_javacontrolpanel_Redirector__1start - (JNIEnv *, jobject) -{ -#ifdef __SYMBIAN32__ - LogRedirector* redirector = new LogRedirector(); - redirector->start(); - return (jint)redirector; -#else - return 0; -#endif -} - -/* - * Class: com_nokia_mj_impl_javacontrolpanel_Redirector - * Method: _stop - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_com_nokia_mj_impl_javacontrolpanel_Redirector__1stop - (JNIEnv *, jobject, jint aHandle) -{ -#ifdef __SYMBIAN32__ - LogRedirector* redirector = reinterpret_cast(aHandle); - redirector->stop(); - delete redirector; -#endif -} diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/controlpanel/src/securityconfig.cpp --- a/javatools/javacontrolpanel/controlpanel/src/securityconfig.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +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: -* -*/ - -#include -#include "com_nokia_mj_impl_javacontrolpanel_SecurityConfig.h" -#include "javajniutils.h" - -#ifdef __SYMBIAN32__ -#include "security.h" -#endif - -/* - * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig - * Method: _getSecurityWarningsMode - * Signature: ()Ljava/lang/String; - */ -JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1getSecurityWarningsMode - (JNIEnv* aEnv, jobject) -{ -#ifdef __SYMBIAN32__ - Security security; - std::wstring mode = security.getSecurityWarningsMode(); - return java::util::JniUtils::wstringToJstring(aEnv, mode); -#else - return java::util::JniUtils::wstringToJstring(aEnv, L"2");; -#endif -} - -/* - * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig - * Method: _setSecurityWarningsMode - * Signature: (Ljava/lang/String;)V - */ -JNIEXPORT void JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1setSecurityWarningsMode - (JNIEnv* aEnv, jobject, jstring aMode) -{ -#ifdef __SYMBIAN32__ - Security security; - std::wstring mode = java::util::JniUtils::jstringToWstring(aEnv, aMode); - security.setSecurityWarningsMode(mode); -#endif -} - -/* - * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig - * Method: _getSecurityPolicy - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1getSecurityPolicy - (JNIEnv *, jobject) -{ -#ifdef __SYMBIAN32__ - Security security; - return security.getSecurityPolicy(); -#else - return 1; -#endif -} - -/* - * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig - * Method: _setSecurityPolicy - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1setSecurityPolicy - (JNIEnv *, jobject, jint aPolicyId) -{ -#ifdef __SYMBIAN32__ - Security security; - security.setSecurityPolicy(aPolicyId); -#endif -} - diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/starter/build/bld.inf --- a/javatools/javacontrolpanel/starter/build/bld.inf Fri Sep 17 17:50:17 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: Generated bld.inf -file -* -*/ - -PRJ_PLATFORMS -default - -PRJ_MMPFILES -javacontrolpanel_0x2002FF61.mmp diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/starter/build/javacontrolpanel.pro --- a/javatools/javacontrolpanel/starter/build/javacontrolpanel.pro Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +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: -# - -TEMPLATE=app -TARGET=javacontrolpanel -CONFIG += omj no_icon stl -CONFIG -= qt - -INCLUDEPATH += ../../../../javaruntimes/inc -LIBS += -ljavacomms -ljavaruntimestarterutils - -symbian { - TARGET.EPOCHEAPSIZE = 0x020000 0x800000 - TARGET.EPOCSTACKSIZE = 0x14000 - TARGET.UID2 = 0x20004c45 - TARGET.UID3 = 0x2002FF61 - TARGET.SID = 0x2002FF61 - - TARGET.CAPABILITY = AllFiles WriteDeviceData PowerMgmt NetworkControl - - MMP_RULES += "START RESOURCE ../data/javacontrolpanel_reg.rss" - MMP_RULES += "TARGETPATH /private/10003a3f/apps" - MMP_RULES += "END" -} - -include(../../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/starter/build/javacontrolpanel_0x2002FF61.mmp --- a/javatools/javacontrolpanel/starter/build/javacontrolpanel_0x2002FF61.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +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: Generated file - do not edit manually -* -*/ - -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) -// This file is generated by qmake and should not be modified by the -// user. -// Name : javacontrolpanel.mmp -// ============================================================================== - -TARGET javacontrolpanel.exe -TARGETTYPE EXE - -UID 0x20004c45 0x2002FF61 -SECUREID 0x2002FF61 - -EPOCSTACKSIZE 0x14000 -EPOCHEAPSIZE 0x020000 0x800000 -EPOCALLOWDLLDATA - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO RD_JAVA_SYMBIAN_TARGET -MACRO RD_JAVA_S60_RELEASE_9_2 -MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS -MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS -MACRO RD_JAVA_STDCPPV5 -MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX -MACRO RD_JAVA_HTTP_EMC_ENABLED -MACRO RD_JAVA_NGA_ENABLED -MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED -MACRO RD_JAVA_OPENC_BETA_PATCH -MACRO RD_JAVA_INSTALLERUI_ENABLED -MACRO RD_JAVA_PREWARM -MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK -MACRO RD_JAVA_MIDPRMS_DB -MACRO __SYMBIAN32__ -MACRO J9EPOC32 - -SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../../../../javaruntimes/inc -SYSTEMINCLUDE ../../../../inc -SYSTEMINCLUDE ../src -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE . - -SOURCEPATH ../src -SOURCE main.cpp - - -LIBRARY javacomms.lib -LIBRARY javaruntimestarterutils.lib -LIBRARY javautils.lib -LIBRARY libpthread.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib -LIBRARY apgrfx.lib -STATICLIBRARY libcrt0.lib - -CAPABILITY AllFiles WriteDeviceData PowerMgmt NetworkControl - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden -#if defined(ARMCC_4_0) -OPTION ARMCC --import_all_vtbl -#endif -OPTION GCCE -fvisibility-inlines-hidden - -VERSION 10.0 - -ARMFPU softvfp - -PAGED - -BYTEPAIRCOMPRESSTARGET - -USERINCLUDE . - -START RESOURCE ../data/javacontrolpanel_reg.rss - -TARGETPATH /private/10003a3f/apps - -END - -#include - - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - - SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) - -SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah - -#ifdef WINSCW - -LIBRARY ewsd.lib - -#endif - -STDCPP diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/starter/data/javacontrolpanel_reg.rss --- a/javatools/javacontrolpanel/starter/data/javacontrolpanel_reg.rss Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +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: javacontrolpanel_reg.rss -* -*/ - - -#include - -UID2 KUidAppRegistrationResourceFile -UID3 0x2002FF61 - -RESOURCE APP_REGISTRATION_INFO -{ - app_file = "JavaControlPanel"; - embeddability = KAppEmbeddable; - newfile = KAppDoesNotSupportNewFile; -} - -// End of File diff -r 461e71b327da -r 0553e2305d00 javatools/javacontrolpanel/starter/src/main.cpp --- a/javatools/javacontrolpanel/starter/src/main.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,91 +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: Main program for the Java Manager process -* -*/ - -#include -#include - -#include "logger.h" -#include "exceptionbase.h" -#include "runtimeexception.h" -#include "javacommonutils.h" -#include "runtimestarterutils.h" -#include "jvmstarter.h" - -using namespace java::runtime; -using namespace java::util; - -int startJvm(int argc, char *argv[]); -const wchar_t* const JavaControlPanel_MAIN_CLASS = L"com.nokia.mj.impl.javacontrolpanel.JavaControlPanel"; - -int main(int argc, char *argv[]) -{ - LOG(EUtils, EInfo, "JavaControlPanel main()"); - int result = -1; - try - { - result = startJvm(argc, argv); - } - catch (RuntimeException& e) - { - ELOG1(EUtils, "JavaControlPanel main() RuntimeException caught: %s ", - e.toString().c_str()); - } - - catch (ExceptionBase& e) - { - ELOG1(EUtils, "JavaControlPanel main() ExceptionBase caught: %s ", - e.toString().c_str()); - } - - catch (std::exception& e) - { - ELOG1(EUtils, "JavaControlPanel main() Exception %s caught", e.what()); - } - - LOG1(EUtils, EInfo, "JavaControlPanel EXIT = %d", result); - return result; -} - -int startJvm(int argc, char *argv[]) -{ - JELOG2(EUtils); - - // Create instance of RuntimeStarterUtils for thread supervisioning. - std::auto_ptr starterUtils(new RuntimeStarterUtils()); - starterUtils->startThreadSupervisor(); - - // Create starter for starting the JVM - std::auto_ptr - jvm(JvmStarter::getJvmStarterInstance(JvmStarter::CLDC, - L"JavaControlPanel")); - - // Set the debugging features available provided by the captain. - // starterUtils->enableDevelopmentFeatures(*jvm.get()); - // jvm->enableThreadDumping(); - - jvm->appendSystemProperty(L"-Dcom.nokia.rt.port=javacontrolpanel"); - jvm->setMainClass(JavaControlPanel_MAIN_CLASS); - - for (int i = 1; i < argc; ++i) - { - jvm->appendApplicationArgument( - JavaCommonUtils::utf8ToWstring(argv[i])); - } - - // Start the JVM. - return jvm->startJvm(); -} diff -r 461e71b327da -r 0553e2305d00 javatools/javasecuritycustomization/build/javasecuritycustomization_0x20028786.mmp --- a/javatools/javasecuritycustomization/build/javasecuritycustomization_0x20028786.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javatools/javasecuritycustomization/build/javasecuritycustomization_0x20028786.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -53,6 +53,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 461e71b327da -r 0553e2305d00 javatools/javatools.pro --- a/javatools/javatools.pro Fri Sep 17 17:50:17 2010 +0100 +++ b/javatools/javatools.pro Fri Oct 22 14:23:56 2010 +0100 @@ -16,8 +16,7 @@ TEMPLATE = subdirs SUBDIRS += tckrunner/starter/build/tckrunner.pro SUBDIRS += tckrunner/runner/build/tckrunner.pro -SUBDIRS += javacontrolpanel/starter/build/javacontrolpanel.pro -SUBDIRS += javacontrolpanel/controlpanel/build/javacontrolpanel.pro SUBDIRS += javasecuritycustomization/build/javasecuritycustomization.pro +BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javacaptain_app/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"testcerts/bld.inf\"" BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 461e71b327da -r 0553e2305d00 javatools/subsystem.mk --- a/javatools/subsystem.mk Fri Sep 17 17:50:17 2010 +0100 +++ b/javatools/subsystem.mk Fri Oct 22 14:23:56 2010 +0100 @@ -19,9 +19,7 @@ # Common COMPONENTS = \ tckrunner/starter/build \ - tckrunner/runner/build \ - javacontrolpanel/starter/build \ - javacontrolpanel/controlpanel/build \ + tckrunner/runner/build # Platform specific ifeq ($(BUILDENV),symbian) @@ -45,6 +43,7 @@ endif NONQTSUBSYSTEMS += \ + javacaptain_app/build \ testcerts endif diff -r 461e71b327da -r 0553e2305d00 javatools/tckrunner/runner/build/tckrunner_0x2002DCE3.mmp --- a/javatools/tckrunner/runner/build/tckrunner_0x2002DCE3.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javatools/tckrunner/runner/build/tckrunner_0x2002DCE3.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../../inc diff -r 461e71b327da -r 0553e2305d00 javatools/tckrunner/runner/javasrc/com/nokia/mj/impl/rt/tckrunner/ApplicationUtilsImpl.java --- a/javatools/tckrunner/runner/javasrc/com/nokia/mj/impl/rt/tckrunner/ApplicationUtilsImpl.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javatools/tckrunner/runner/javasrc/com/nokia/mj/impl/rt/tckrunner/ApplicationUtilsImpl.java Fri Oct 22 14:23:56 2010 +0100 @@ -20,7 +20,6 @@ import com.nokia.mj.impl.rt.support.ApplicationInfo; import com.nokia.mj.impl.rt.support.ApplicationUtils; import com.nokia.mj.impl.utils.Uid; -import com.nokia.mj.impl.utils.Logger; import java.security.Permission; import java.security.AccessControlException; @@ -40,8 +39,6 @@ public void notifyExitCmd() { - Logger.ILOG(Logger.ETckRunner, "notifyExitCmd() - exiting"); - System.exit(0); } public void checkPermission(Permission aPermission) diff -r 461e71b327da -r 0553e2305d00 javatools/tckrunner/runner/src/tckrunnernative.cpp --- a/javatools/tckrunner/runner/src/tckrunnernative.cpp Fri Sep 17 17:50:17 2010 +0100 +++ b/javatools/tckrunner/runner/src/tckrunnernative.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -58,13 +58,12 @@ { int rc = 0; - const char* av[MAX_PARAMS + 6]; + const char* av[MAX_PARAMS + 5]; int index = 0; av[index++] = java::runtime::JAVA_PROCESS; av[index++] = java::runtime::JAVA_INSTALLER_STARTER_DLL; av[index++] = "poll"; av[index++] = "-address=tck"; - av[index++] = "-drive=C"; int args = aEnv->GetArrayLength(aArgs); char** installerArgs = new char*[args]; diff -r 461e71b327da -r 0553e2305d00 javatools/tckrunner/starter/build/tckrunner_0x2002121E.mmp --- a/javatools/tckrunner/starter/build/tckrunner_0x2002121E.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javatools/tckrunner/starter/build/tckrunner_0x2002121E.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -54,6 +54,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../../javaruntimes/inc diff -r 461e71b327da -r 0553e2305d00 javauis/amms_akn/build/build.xml --- a/javauis/amms_akn/build/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/amms_akn/build/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -27,7 +27,7 @@ file --> - + - - - - - - - - - - - - - diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/build/bwins/javanokiasoundu.def --- a/javauis/nokiasound/build/bwins/javanokiasoundu.def Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) - diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/build/eabi/javanokiasoundu.def --- a/javauis/nokiasound/build/eabi/javanokiasoundu.def Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z10jni_lookupPKc @ 1 NONAME - diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/build/javanokiasound.pro --- a/javauis/nokiasound/build/javanokiasound.pro Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE=lib -TARGET=javanokiasound -CONFIG += omj java stl -CONFIG -= qt - -LIBS += -lcenrepnotifhandler \ - -lcentralrepository \ - -lmediaclientaudio \ - -lcommonengine \ - -ljavautils - -include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/build/javanokiasound_0x2002DCC4.mmp --- a/javauis/nokiasound/build/javanokiasound_0x2002DCC4.mmp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,150 +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: Generated file - do not edit manually -* -*/ - -// ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) -// This file is generated by qmake and should not be modified by the -// user. -// Name : javanokiasound.mmp -// ============================================================================== - -TARGET javanokiasound.dll -TARGETTYPE DLL - -UID 0x1000008d 0x2002DCC4 -SECUREID 0x2002DCC4 - -EPOCALLOWDLLDATA - - -// Qt Macros -MACRO UNICODE -MACRO QT_KEYPAD_NAVIGATION -MACRO QT_SOFTKEYS_ENABLED -MACRO QT_USE_MATH_H_FLOATS -MACRO RD_JAVA_SYMBIAN_TARGET -MACRO RD_JAVA_S60_RELEASE_9_2 -MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS -MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS -MACRO RD_JAVA_STDCPPV5 -MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX -MACRO RD_JAVA_HTTP_EMC_ENABLED -MACRO RD_JAVA_NGA_ENABLED -MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED -MACRO RD_JAVA_OPENC_BETA_PATCH -MACRO RD_JAVA_INSTALLERUI_ENABLED -MACRO RD_JAVA_PREWARM -MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK -MACRO RD_JAVA_MIDPRMS_DB -MACRO __SYMBIAN32__ -MACRO J9EPOC32 - -SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE ../inc -SYSTEMINCLUDE ../../inc -SYSTEMINCLUDE ../../../inc -SYSTEMINCLUDE ../src -SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw -SYSTEMINCLUDE . - -SOURCEPATH ../src -SOURCE cmidclip.cpp -SOURCE cmidsound.cpp -SOURCE CMIDSoundImpl.cpp -SOURCE cmidtone.cpp -SOURCE sound.cpp - - -LIBRARY cenrepnotifhandler.lib -LIBRARY centralrepository.lib -LIBRARY mediaclientaudio.lib -LIBRARY commonengine.lib -LIBRARY javautils.lib -LIBRARY libpthread.lib -LIBRARY libstdcppv5.lib -LIBRARY libc.lib -LIBRARY libm.lib -LIBRARY euser.lib -LIBRARY libdl.lib -LIBRARY cone.lib -LIBRARY eikcore.lib -LIBRARY eikcoctl.lib -LIBRARY eiksrv.lib -LIBRARY apparc.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib -LIBRARY charconv.lib -LIBRARY ws32.lib -LIBRARY hal.lib -LIBRARY gdi.lib -LIBRARY apgrfx.lib - -CAPABILITY all -tcb - -OPTION CW -wchar_t on -OPTION ARMCC --visibility_inlines_hidden -#if defined(ARMCC_4_0) -OPTION ARMCC --import_all_vtbl -#endif -OPTION GCCE -fvisibility-inlines-hidden - -VERSION 10.0 - -ARMFPU softvfp - -PAGED - -BYTEPAIRCOMPRESSTARGET - -USERINCLUDE . - -#include - - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - -deffile ./~/javanokiasound.def - - SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) - -SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah - -SOURCEPATH /epoc32/build/jrt/javabuild/javanokiasound - -SOURCE lookup.cpp - -SOURCEPATH /epoc32/build/jrt/javabuild/javanokiasound - -SOURCE jxe.c - -#ifdef WINSCW - -LIBRARY ewsd.lib - -#endif - -STDCPP - -#ifdef WINSCW -DEFFILE ./bwins/javanokiasound.def -#elif defined EABI -DEFFILE ./eabi/javanokiasound.def -#endif diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/inc/CMIDClip.h --- a/javauis/nokiasound/inc/CMIDClip.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This class implements wav playing. -* -*/ - - -#ifndef CMIDCLIP_H -#define CMIDCLIP_H - -// INCLUDES -#include -#include - -#include "CMIDSoundImpl.h" - -// FORWARD DECLARATIONS -class MMIDEventSender; - -// CLASS DEFINITION -/** - * This class implements wav playing. - * - */ -NONSHARABLE_CLASS(CMIDClip): public CMIDSoundImpl, - public MMdaAudioPlayerCallback -{ -public: - - static CMIDClip* NewL(const TDesC8* aData, MMIDEventSender* aEventSender); - // Destructor - ~CMIDClip(); - -protected: - - // C++ constructor - CMIDClip(MMIDEventSender* aEventSender); - // Second phase - void ConstructL(const TDesC8* aData); - -public: - - virtual TInt Play(TInt aLoop); - virtual void Stop(); - virtual void SetVolume(TInt aVolume); - virtual TInt Volume(); - virtual void Release(); - -public: // from MMdaAudioPlayerCallback - void MapcInitComplete(TInt aError, - const TTimeIntervalMicroSeconds& aDuration); - void MapcPlayComplete(TInt aError); - -private: - - HBufC8* iClip; - CMdaAudioPlayerUtility* iMdaAudioPlayerUtility; - TInt iLoops; - TInt iVolume; -}; - -#endif // CMIDCLIP_H diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/inc/CMIDSound.h --- a/javauis/nokiasound/inc/CMIDSound.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2006 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: Wrapper for CMIDClip and CMIDTone class initialisations. -* -*/ - - -// INCLUDES -#include -#include -#include -#include "MMIDEventSender.h" -#include "functionserver.h" - -// FORWARD DECLARATIONS -class CMIDSoundImpl; - -// CLASS DEFINITION -/** - * CMIDSound is a wrapper that handles which class is - * wanted to be initialised, CMIDClip or CMIDTone - * - */ -NONSHARABLE_CLASS(CMIDSound): - public CBase, MCenRepNotifyHandlerCallback, MMIDEventSender, java::util::FunctionServer -{ - -public: - - // Destructor - ~CMIDSound(); - -public: // From MCenRepNotifyHandlerCallback - /** - * Notifies this class about changes in the audio enable status - */ - void HandleNotifyInt(TUint32 aId, TInt aNewValue); - -public: // From MMIDEventSender - /** - * Sends event to Java SoundListener. - * @since 3.0 - * @param aEventType Type of the event to send - */ - void SendEvent(TInt aEventType); - -protected: - - // C++ default constructor - CMIDSound(); - -private: - TBool IsAudioEnabled(); - -public: - - static CMIDSound* NewL(JNIEnv& aJni, jobject aSound); - void SetBeep(TInt aFreq, TInt64 aDuration); - TInt Init(TInt aType, const TDesC8* aData); - void InitL(TInt aType, const TDesC8* aData); - TInt InitProfileListener(); - void InitProfileListenerL(); - TInt Play(TInt aLoop); - TInt DoPlay(TInt aLoop); - void Resume(); - void DoResume(); - void Stop(); - void DoStop(); - TInt SoundVolume(); - TInt Volume(); - void SetVolume(TInt aVolume); - void DoSetVolume(TInt aVolume); - TInt State(); - TInt PlayerState(); - void Release(); - void DoRelease(); - - -private: - - CMIDSoundImpl* iMIDSound; - TInt iFreq; - TInt64 iDur; - TInt iSource; - TInt iRealVolume; - - // owned, informs about changes in iRepository - CCenRepNotifyHandler* iProfileListener; - - // owned, current profile - CRepository* iRepository; - - TInt iHandle; -}; - diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/inc/CMIDSoundEvent.h --- a/javauis/nokiasound/inc/CMIDSoundEvent.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for sound related events. -* -*/ - - -#ifndef CMIDSOUNDEVENT_H -#define CMIDSOUNDEVENT_H - -#include - -// CLASS DEFINITION - -/** - * Class for sound related events. - */ -NONSHARABLE_CLASS(CMIDSoundEvent) -{ -public: // constructor - CMIDSoundEvent(TInt aEvent); - -public: // new methods - /** - * Setter for listener - * @param aListener this event will be sent to this listener - */ - void SetListener(jobject aListener); - - /** - * Setter for method ID - * @param aMethodID this event will be sent by calling this method - */ - void SetMethodID(jmethodID aMethodID); - - /** - * Adds a global reference to peer object, this reference is - * removed when the event is dispatched. This prevents peer - * object from being deleted by garbage collector before the - * event has been dispatched. - */ - void AddGlobalRef(JavaVM* javaVM); - - -private: - void Dispatch(JNIEnv& aJni); - -private: - jobject iListener; - jmethodID iMethodID; - TInt iEvent; - jobject iGlobalRef; - // Number of times the global reference has been added. - // The actual global reference is removed when the counter reaches zero. - TInt iRefCount; - -}; - - -#endif // CMIDSOUNDEVENT_H diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/inc/CMIDSoundImpl.h --- a/javauis/nokiasound/inc/CMIDSoundImpl.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Interface and a base class for CMIDClip and CMIDTone. -* -*/ - - - -#ifndef CMIDSOUNDIMPL_H -#define CMIDSOUNDIMPL_H - -// INCLUDES -#include - -// FORWARD DECLARATIONS -class MMIDEventSender; - - -// CLASS DEFINITION -/** - * This class is interface and a base class for CMIDClip and CMIDTone - * - */ -NONSHARABLE_CLASS(CMIDSoundImpl): public CBase -{ - -public: - - enum TState - { - ENotReady, - EReadyToPlay, - EPlaying, - ENotSupported, - EInitialising - }; - -public: - - // destructor - ~CMIDSoundImpl(); - -protected: - - void ConstructL(); - - // C++ constructor - CMIDSoundImpl(MMIDEventSender* aEventSender); - -public: - - void Resume(); - - virtual TInt Play(TInt aLoop) = 0; - virtual void Stop() = 0; - virtual void SetVolume(TInt aVolume) = 0; - virtual TInt Volume() = 0; - virtual void Release() = 0; - - inline TInt State() const; - -protected: - - - TInt iState; - - // true if playback has been started. - TBool iPlayed; - - CActiveSchedulerWait* iSchedulerWait; - - // events are sent through this interface - MMIDEventSender* iEventSender; - -}; - -inline TInt CMIDSoundImpl::State() const -{ - return iState; -}; - -#endif // CMIDSOUNDIMPL_H diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/inc/CMIDTone.h --- a/javauis/nokiasound/inc/CMIDTone.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This class implements beep playing and OTA ringingtone playing. -* -*/ - - -#ifndef CMIDTONE_H -#define CMIDTONE_H - -// INCLUDES -#include -#include - -#include "CMIDSoundImpl.h" - -// FORWARD DECLARATIONS -class MMIDEventSender; - -// CLASS DEFINITION -/** - * This class implements beep playing and OTA ringingtone playing. - * - */ -NONSHARABLE_CLASS(CMIDTone): public CMIDSoundImpl, public MMdaAudioToneObserver -{ -public: - - static CMIDTone* NewL(TInt aFreq, TInt64 aDuration, - MMIDEventSender* aEventSender); - static CMIDTone* NewL(const TDesC8& aData, MMIDEventSender* aEventSender); - // Destructor - ~CMIDTone(); - -protected: - - // C++ constructor - CMIDTone(MMIDEventSender* aEventSender); - // Second phase - void ConstructL(TInt aFreq, TInt64 aDuration); - void ConstructL(const TDesC8& aData); - -public: - - virtual TInt Play(TInt aLoop); - virtual void Stop(); - virtual void SetVolume(TInt aVolume); - virtual TInt Volume(); - virtual void Release(); - -public: // from MMdaAudioToneObserver - - void MatoPrepareComplete(TInt aError); - void MatoPlayComplete(TInt aError); - -private: - - TInt iFreq; - TInt64 iDuration; - CMdaAudioToneUtility* iMdaAudioToneUtility; -}; - -#endif // CMIDTONE_H diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/inc/MMIDEventSender.h --- a/javauis/nokiasound/inc/MMIDEventSender.h Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* Copyright (c) 2005 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: SoundImpl instances can send events through this interface -* -*/ - - - -#ifndef MMIDEVENTSENDER_H -#define MMIDEVENTSENDER_H - -/** -* SoundImpl instances cand send events through this interface. -* This interface has only one method, SendEvent(), which can be used -* for sending all types of sound events. -* -* @since 3.0 -*/ -NONSHARABLE_CLASS(MMIDEventSender) -{ - -public: // New functions - - /** - * Sends event to Java SoundListener. - * @since 3.0 - * @param aEventType Type of the event to send - */ - virtual void SendEvent(TInt aEventType) = 0; - -protected: - - /** - * C++ default constructor. - */ - MMIDEventSender() { } - -private: - - // Prohibit copy constructor if not deriving from CBase. - MMIDEventSender(const MMIDEventSender&) { } - // Prohibit assigment operator if not deriving from CBase. - MMIDEventSender& operator=(const MMIDEventSender&) - { - return *this; - } - -}; - -#endif // MMIDEVENTSENDER_H - -// End of File diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/javasrc/com/nokia/mid/sound/Sound.java --- a/javauis/nokiasound/javasrc/com/nokia/mid/sound/Sound.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,698 +0,0 @@ -/* -* Copyright (c) 2006 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: Provides Sound API for playing tones and digitized audio. -* -*/ - - -package com.nokia.mid.sound; - -import com.nokia.mj.impl.rt.support.Finalizer; -import java.util.Vector; -import com.nokia.mj.impl.utils.Logger; -import java.lang.Thread; - -/** - *

    - * Provides simple Sound API for playing tones and digitized audio. - *

    - * Since MIDP doesn't have any Sound API for games there is a need - * for proprietary sound extension to support devices audio - * capabilities. Every implementation has capability to produce tone - * sounds (e.g. ringing tones), this is the minimum support. Currently - * some products support or will support also digitized audio formats. - * The Game sound API will support both buzzer and digitized audio. - * Buzzer must be supported by all implementations. If implementation - * doesn't have buzzer the buzzer tones are emulated. - *

    - * Since implementations have different audio capabilities, - * application can query which audio formats are supported by - * implementation by calling {@link #getSupportedFormats()}. - *

    - * All implementations need to support at least tone based sounds - * (type FORMAT_TONE) via {@link #Sound(int freq, long duration)} and - * {@link #init(int freq, long duration)}. In addition all implementations - * must support Smart messaging ringingtone format (type FORMAT_TONE) - * via {@link #Sound(byte[] data, int type)} and - * {@link #init(byte[] data, int type) }. - *

    - * Note that there is also work going on with Multimedia API that - * is done in JCP as - * JSR 135. - * The standard Multimedia API - * will replace the proprietary Game Sound API when it is ready. However - * Sound API will be supported also later on but probably it will be - * stated as deprecated. - *

    - * @version 1.1 - * @see com.nokia.mid.ui.DeviceControl - * @since 1.0 - */ - -public class Sound -{ - - /** - * Tone based format is used. - * - * init(int freq, int duration) puts sound into this format. - * @since 1.0 - * - */ - public static final int FORMAT_TONE = 1; - - /** - * Content is in WAV format. - * @since 1.0 - * - */ - public static final int FORMAT_WAV = 5; - - /** - * Sound is playing. - * @since 1.0 - * - */ - public static final int SOUND_PLAYING = 0; - - /** - * Sound is stopped. - * @since 1.0 - * - */ - public static final int SOUND_STOPPED = 1; - - /** - * Sound is uninitialized (released). - * @since 1.0 - */ - public static final int SOUND_UNINITIALIZED = 3; - - /** - * Sound is reinitialising - */ - private static final int SOUND_REINITIALISING = 4; - - private static final int FORMAT_BEEP = 2; - private static final int NOT_SUPPORTED_ERROR = 3; - - private static final int ERR_NOT_READY = -18; - private static final int ERR_ARGUMENT = -6; - - private int iHandle; - - private Finalizer iFinalizer; - private int iCurrentType; - private int iState; - private int iGain = -1; - - Vector iSoundListeners = new Vector(); - - private static Sound iPlayingSound; - - static - { - com.nokia.mj.impl.rt.support.Jvm.loadSystemLibrary("javanokiasound"); - } - - /** - * Constructors initialize the Sound object so that it is ready for - * playback. This constructor is used for initializing Sound - * object based on byte array data. The data should contain the data - * presented in the data format specified by type parameter. The Sound - * class defines also generally supported types as constants. - *

    - * All implementations need to support at least Nokia - * Smart Messaging, Over the Air (OTA) ringingtone format. - * The type of this format is FORMAT_TONE. - *

    - * Note: some implementations can't throw exceptions about - * sound data being corrupted or illegal during construction. - * This will result that IllagalArgumentException is delayed until - * play(int loop) method is called. Applications thus need to except - * that IllegalArgumentException is thrown in this method or during - * play method call. - *

    - * @throws java.lang.IllegalArgumentException if the data can not be - recognized to - * given type or the type is unsupported or unknown - * @throws java.lang.NullPointerException if the data is null - * @since 1.0 - * - */ - public Sound(byte[] data, int type) - { - Logger.LOG(Logger.EJavaUI, Logger.EInfo, "Sound Constructor"); - iFinalizer = registerForFinalization(); - - iHandle = _create(); - - iState = SOUND_UNINITIALIZED; - - init(data, type); - } - - /** - * Constructors initialize the Sound object so that it is ready for - * playback. Sound is initialized as a simple tone based sound. - *

    - * See method {@link #init(int freq, long duration)} for - * freq value descriptions. See also a note on exceptions semantics in - * {@link #init(int freq, long duration)}. - * - * @param freq a frequency value - * @param duration the duration of the tone in milliseconds - * @throws java.lang.IllegalArgumentException if parameter values are - * illegal, freq is not in given range or duration is negative or zero - * @since 1.0 - */ - public Sound(int freq, long duration) - { - - iFinalizer = registerForFinalization(); - iHandle = _create(); - - iState = SOUND_UNINITIALIZED; - - init(freq, duration); - } - - /** - * Called when this object is finalized, frees native resources - */ - - public Finalizer registerForFinalization() - { - - return new Finalizer() - { - public void finalizeImpl() - { - doFinalize(); - } - }; - } - - void doFinalize() - { - - if (iFinalizer == null) - { - return; - } - iFinalizer = null; - - if (iHandle > 0) - { - _dispose(iHandle); - } - } - - /** - * Releases audio resources reserved by this object. After object - * is released it goes to uninitialized state. This method should - * be called when Sound object is not needed anymore. - * @since 1.0 - */ - public void release() - { - if ((iState != SOUND_UNINITIALIZED) && - (iState != SOUND_REINITIALISING)) - { - iState = SOUND_REINITIALISING; - soundStateChanged(SOUND_UNINITIALIZED); - } - - _release(iHandle); - - iState = SOUND_UNINITIALIZED; - - } - - /** - * Initializes Sound to play a simple beep. - *

    - * Note: some implementations may not support the full frequency - * scale defined in table below. They will throw - * IllegalArgumentException instead for unsupported values. The - * exception may also be delayed - * until the play(int loop) method is called. - *

    - * Following table describes some freq argument - * values: - *

    -     * Description            Frequency
    -     * Freq off               0
    -     * Ring freq A0           220
    -     * Ring freq B0b          233
    -     * Ring freq B0           247
    -     * Ring freq C0           262
    -     * Ring freq D0b          277
    -     * Ring freq D0           294
    -     * Ring freq E0b          311
    -     * Ring freq E0           330
    -     * Ring freq F0           349
    -     * Ring freq G0b          370
    -     * Ring freq G0           392
    -     * Ring freq A1b          416
    -     * Ring freq A1           440
    -     * Ring freq B1b          466
    -     * Ring freq B1           494
    -     * Ring freq C1           523
    -     * Ring freq D1b          554
    -     * Ring freq D1           587
    -     * Ring freq E1b          622
    -     * Ring freq E1           659
    -     * Ring freq F1           698
    -     * Ring freq G1b          740
    -     * Ring freq G1           784
    -     * Ring freq A2b          831
    -     * Ring freq A2           880
    -     * Ring freq B2b          932
    -     * Ring freq B2           988
    -     * Ring freq C2           1047
    -     * Ring freq D2b          1109
    -     * Ring freq D2           1175
    -     * Ring freq E2b          1245
    -     * Ring freq E2           1319
    -     * Ring freq F2           1397
    -     * Ring freq G2b          1480
    -     * Ring freq G2           1568
    -     * Ring freq A3b          1661
    -     * Ring freq A3           1760
    -     * Ring freq B3b          1865
    -     * Ring freq B3           1976
    -     * Ring freq C3           2093
    -     * Ring freq D3b          2217
    -     * Ring freq D3           2349
    -     * Ring freq E3b          2489
    -     * Ring freq E3           2637
    -     * Ring freq F3           2794
    -     * Ring freq G3b          2960
    -     * Ring freq G3           3136
    -     * Ring freq A4b          3322
    -     * Ring freq A4           3520
    -     * Ring freq B4b          3729
    -     * Ring freq B4           3951
    -     * Ring freq C4           4186
    -     * Ring freq D4b          4434
    -     * Ring freq D4           4698
    -     * Ring freq E4b          4978
    -     * Ring freq E4           5274
    -     * Ring freq F4           5588
    -     * Ring freq G4b          5920
    -     * Ring freq G4           6272
    -     * Ring freq A5b          6644
    -     * Ring freq A5           7040
    -     * Ring freq B5b          7458
    -     * Ring freq B5           7902
    -     * Ring freq C5           8372
    -     * Ring freq D5b          8870
    -     * Ring freq D5           9396
    -     * Ring freq E5b          9956
    -     * Ring freq E5           10548
    -     * Ring freq F5           11176
    -     * Ring freq G5b          11840
    -     * Ring freq G5           12544
    -     * Ring freq A6b          13288
    -     *
    -     * 
    - * - * @param duration length of the beep in milliseconds - * @param freq frequency to be played - * @throws java.lang.IllegalArgumentException if parameter values are - * illegal, freq is not in given range or duration is negative or zero - * @since 1.0 - */ - public void init(int freq, long duration) - { - if (duration < 1 || duration > 10000000) - { - throw(new IllegalArgumentException( - "Bad duration value, must be 1-10000000")); - } - if (freq < 0 || freq > 15000) - { - throw(new IllegalArgumentException( - "Bad frequency value, must be 0-15000")); - } - // if the uninitialised event is sent from native side, it reaches - // listener too late in TCK test sound8004, thus we send the event - // already here - if ((iState != SOUND_UNINITIALIZED) && - (iState != SOUND_REINITIALISING)) - { - iState = SOUND_REINITIALISING; - soundStateChanged(SOUND_UNINITIALIZED); - } // end of if (iState != SOUND_UNINITIALIZED) - - iCurrentType = FORMAT_BEEP; - int err = _init(iHandle, iCurrentType, null, freq, duration); - if (err == ERR_NOT_READY) - { - throw new RuntimeException(Integer.toString(err)); - } - else if (err == ERR_ARGUMENT) - { - throw new IllegalArgumentException("Data is invalid"); - } - iState = SOUND_STOPPED; - } - - /** - * Initializes Sound object based on byte - * array data. The data should contain the data presented in the data - * format specified by type parameter. The Sound class defines also - * generally supported types as constants. - *

    - * All implementations need to support at least Nokia - * Smart Messaging, Over the Air (OTA) ringingtone format. - * The type of this format is FORMAT_TONE. - *

    - * Note: some implementations can't throw exceptions about - * sound data being corrupted or illegal during this method call. - * This will result that IllagalArgumentException is delayed until - * play(int loop) method is called. Applications thus need to except - * that IllegalArgumentException is thrown in this method or during - * play method call. - *

    - * @param data a byte array containing the data to be played - * @param type type of the audio - * @throws java.lang.IllegalArgumentException if the data can not be - recognized to - * given type or the type is unsupported or unknown - * @throws java.lang.NullPointerException if the data is null - * @since 1.0 - */ - public void init(byte[] data, int type) - { - if (!(type == FORMAT_WAV || type == FORMAT_TONE)) - { - throw(new IllegalArgumentException("Type is not supported")); - } - if (data == null) - { - throw(new NullPointerException("Data is null")); - } - - if ((iState != SOUND_UNINITIALIZED) && - (iState != SOUND_REINITIALISING)) - { - iState = SOUND_REINITIALISING; - soundStateChanged(SOUND_UNINITIALIZED); - } // end of if (iState != SOUND_UNINITIALIZED) - - iCurrentType = type; - int err = _init(iHandle, iCurrentType, data, 0, 0); - if (err == ERR_NOT_READY || err == ERR_ARGUMENT ) - { - throw new IllegalArgumentException("Data is invalid"); - } - - iState = SOUND_STOPPED; - } - - - /** - * Get the current state of the Sound object. - * - * @return current state, SOUND_PLAYING, SOUND_STOPPED or - SOUND_UNINITIALIZED - * @since 1.0 - * - */ - public int getState() - { - if (iState == SOUND_REINITIALISING) - { - return SOUND_UNINITIALIZED; - } - - iState = _getState(iHandle); - switch (iState) - { - case(0): // ENotReady - case(4): // EInitialising - iState = SOUND_UNINITIALIZED; - break; - case(1): // EReadyToPlay - iState = SOUND_STOPPED; - break; - case(2): // EPlaying - iState = SOUND_PLAYING; - break; - default: - } - return iState; - } - - /** - * This method is used for starting the playback from the beginning of a - * sound object. The loop parameter defined the loop count for playback. - * Argument zero (0) means continuos looping. For uninitialized sound the - * play method doesn't do anything and silently returns. For stopped and - * playing sounds the playback starts from beginning of the sound with new - * looping information. - *

    - * This method will throw IllegalStateException if playback cannot be - * started since all channels are in use, or playback is not possible - * because there is more higher priority system sounds being played. - *

    - * If Sound playback is possible this method will return immediately and - * thus will not block the calling thread during the playback. If any error - * that prevents the playback is encountered during the playback, the - * playback is silently stopped as if called to the stop method. - * - * @param number number of times audio is played. Value 0 plays audio in - * continous loop. - * @throws java.lang.IllegalStateException if the sound object cannot be - * played because all the channels are already in use. - * @throws java.lang.IllegalArgumentException if the loop value is negative, - * or if sound values/date is illegal or corrupted. - * @since 1.0 - * - */ - public void play(int loop) throws IllegalArgumentException - { - if (loop < 0) - { - throw(new IllegalArgumentException("Negative loop value")); - } - if (iState == SOUND_REINITIALISING) - { - return; - } // end of if (iState == SOUND_REINITIALISING) - - if (iPlayingSound != null) - { - if (iPlayingSound.getState() == SOUND_PLAYING) - { - iPlayingSound.stop(); - } - } // end of if (iPlayingSound != null) - - int error = _play(iHandle, loop); - if ((error == NOT_SUPPORTED_ERROR)) - { - throw(new IllegalArgumentException("Sound is not supported")); - } - iPlayingSound = this; - } - - /** - * The method will stop the sound playback, storing the current position. - * For sound that has never been started (may be uninitialized), or is - * currently being stopped the method call doesn't do anything and returns - * silently. - * - * Note that for tone based sounds it is not possible to resume from - * position the sound was stopped at, to be specific, stop will reset - * the position to the beginning of the sound. - * @since 1.0 - */ - public void stop() - { - if (iState == SOUND_REINITIALISING) - { - return; - } // end of if (iState == SOUND_REINITIALISING) - _stop(iHandle); - } - - /** - * The method will continue the stopped sound object from the position it - * was stopped to. For sound that has never been started (may be - * uninitialized), or is currently being played the method call doesn't - * do anything. - *

    - * Note: For tone based sounds the resume starts the sound from the - * beginning of the sound clip. - * @since 1.0 - * - */ - public void resume() - { - if (iState == SOUND_REINITIALISING) - { - return; - } // end of if (iState == SOUND_REINITIALISING) - _resume(iHandle); - } - - /** - * Sets the gain for the sound object. The gain is a value between - * 0 and 255. Implementation scales the gain value to the limits it - * supports. Notice that any gain value > 0 should result a gain - * value > 0. If the gain is smaller than this minimum value then - * gain is set to 0, if the gain greater than this maximum value - * then the gain is set to maximum value (255). - * - * @param gain gain value: 0 - 255 - * @throws java.lang.IllegalArgumentException if the gain not 0 - 255 - * @since 1.0 - */ - public void setGain(int gain) - { - if (iState == SOUND_REINITIALISING) - { - return; - } // end of if (iState == SOUND_REINITIALISING) - if (gain < 0) - { - gain = 0; - } - else if (gain > 255) - { - gain = 255; - } - iGain = gain; - _setVolume(iHandle, iGain); - } - - /** - * Get the gain (or volume) of Sound object. The gain is a value - * between 0 and 255. System returns a scaled value based on the - * limits it supports. Notice that any system gain value > 0 should - * return a gain value > 0. - * - * @return gain value 0 - 255 - * @since 1.0 - * - */ - public int getGain() - { - if (iGain == -1) - { - return _volume(iHandle); - } - // we have previously set gain - return iGain; - } - - /** - * Returns number of concurrent sounds the device can play for - * specific audio type. Returns 1 if only one sound can be played - * at a time. Notice that most types use same channel resources. - * @return total number of available channels. - * @param type the media type - * @throws java.lang.IllegalArgumentException if the type is unsupported - * or unknown - * @since 1.0 - */ - public static int getConcurrentSoundCount(int type) - { - if ((type != FORMAT_TONE) && (type != FORMAT_WAV)) - { - throw(new IllegalArgumentException("Type is not supported")); - } - - return 1; - } - - /** - * Returns the supported audio formats as an int array. - * - * @return an array containing supported audio formats as - * int values (e.g. FORMAT_TONE, FORMAT_WAV), - * or an empty array if no audio formats are supported. - * @since 1.0 - */ - static public int[] getSupportedFormats() - { - return(new int[] { FORMAT_TONE, FORMAT_WAV }); - } - - /** - * Registeres a listener for playback state notifications. - * @see com.nokia.mid.sound.SoundListener - * @param listener a listener that is notified when state - * changes occur or null if listener is to be - * removed. - * @since 1.0 - * - */ - public void setSoundListener(SoundListener listener) - { - iSoundListeners.addElement(listener); - } - - /** - * Callback method when sound state changes - * - */ - public void soundStateChanged(final int event) - { - /* - for(int i = 0; i < iSoundListeners.size(); i++) - { - ((SoundListener)iSoundListeners.elementAt(i)).soundStateChanged(this, event); - } - */ - //Notify SoundState Listeners in a separate thread, so that application doesn't - //block main thread - new Thread(new Runnable() - { - public void run() - { - notifySoundStateListeners(event); - } - }).start(); - } - - /** - * Notify Sound State Listeners - */ - public synchronized void notifySoundStateListeners(int event) - { - for (int i = 0; i < iSoundListeners.size(); i++) - { - ((SoundListener)iSoundListeners.elementAt(i)).soundStateChanged(this, event); - } - } - - private native void _dispose(int aHandle); - private native int _create(); - private native int _init(int aHandle, int aType, - byte[] aData, - int aFrequency, long aDuration); - private native void _release(int aHandle); - private native int _play(int aHandle, int aLoop); - private native void _stop(int aHandle); - private native void _resume(int aHandle); - private native void _setVolume(int aHandle, int aVolume); - private native int _volume(int aHandle); - private native int _getState(int aHandle); - -} //End of Sound class - diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/javasrc/com/nokia/mid/sound/SoundListener.java --- a/javauis/nokiasound/javasrc/com/nokia/mid/sound/SoundListener.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +0,0 @@ -/* -* Copyright (c) 2006 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: Interface indicating changes in the playback state. -* -*/ - - -package com.nokia.mid.sound; - -/** - *

    - * This interface is used by applications which need to receive events - * that indicate changes in the playback state of the Sound objects. - *

    - * @see com.nokia.mid.sound.Sound - * @version 1.1 - * @since 1.0 - */ - -public interface SoundListener -{ - - /** - * Called when playback state of an Sound has been changed. - * Listener will be notified when playback has been started - * or stopped. - * @see com.nokia.mid.sound.Sound#setSoundListener(SoundListener listener) - * @see com.nokia.mid.sound.Sound#SOUND_PLAYING - * @see com.nokia.mid.sound.Sound#SOUND_STOPPED - * @param sound the sound object this event relates to - * @param event the sound changed event, SOUND_PLAYING or SOUND_STOPPED - * @since 1.0 - */ - public abstract void soundStateChanged(Sound sound, int event); - -} diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/src/CMIDSoundImpl.cpp --- a/javauis/nokiasound/src/CMIDSoundImpl.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2006 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: Interface and a base class for CMIDClip and CMIDTone. -* -*/ - - -#include "CMIDSoundImpl.h" -#include "CMIDSoundEvent.h" -#include "com_nokia_mid_sound_Sound.h" - -CMIDSoundImpl::~CMIDSoundImpl() -{ - -} - -CMIDSoundImpl::CMIDSoundImpl(MMIDEventSender* aEventSender) -{ - iEventSender = aEventSender; -} - -void CMIDSoundImpl::ConstructL() -{ - -} - -void CMIDSoundImpl::Resume() -{ - if (iPlayed && (iState == EReadyToPlay)) - { - Play(1); - } -} diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/src/cmidclip.cpp --- a/javauis/nokiasound/src/cmidclip.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,196 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This class implements wav playing. -* -*/ - - -#include -#include - -#include "com_nokia_mid_sound_Sound.h" -#include "CMIDClip.h" -#include "MMIDEventSender.h" - -namespace -{ -const TInt KMIDMaxJavaVolume = 255; -const TInt KMIDMinNativeVolume = 1; -const TInt KMIDHeaderLength = 4; -_LIT8(KMIDHeaderWAV, "RIFF"); -_LIT8(KMIDHeaderAMR, "#!AM"); -const TInt KMIDClipForever = 999999; -const TInt KMIDMinDataSize = 4; -} - -CMIDClip* CMIDClip::NewL(const TDesC8* aData, MMIDEventSender* aEventSender) -{ - CMIDClip* self = new(ELeave) CMIDClip(aEventSender); - CleanupStack::PushL(self); - self->ConstructL(aData); - CleanupStack::Pop(self); - return self; -} - -CMIDClip::~CMIDClip() -{ - if (iMdaAudioPlayerUtility) - { - if (iState == EPlaying) - { - iMdaAudioPlayerUtility->Stop(); - } - } - delete iMdaAudioPlayerUtility; - delete iClip; - delete iSchedulerWait; -} - -CMIDClip::CMIDClip(MMIDEventSender* aEventSender) - : CMIDSoundImpl(aEventSender) -{ -} - -void CMIDClip::ConstructL(const TDesC8* aData) -{ - CMIDSoundImpl::ConstructL(); - iSchedulerWait = new(ELeave) CActiveSchedulerWait; - - if (aData->Length() < KMIDMinDataSize) - { - iState = ENotSupported; - User::Leave(KErrArgument); - } - - TPtrC8 header = aData->Left(KMIDHeaderLength); - - if ((header != KMIDHeaderWAV()) && (header != KMIDHeaderAMR)) - { - iState = ENotSupported; - User::Leave(KErrArgument); - } - - iState = EInitialising; - iClip = aData->AllocL(); - iMdaAudioPlayerUtility = - CMdaAudioPlayerUtility:: - NewDesPlayerReadOnlyL(*iClip, *this, - KAudioPriorityRecording); - iMdaAudioPlayerUtility->UseSharedHeap(); - iSchedulerWait->Start(); -} - -TInt CMIDClip::Play(TInt aLoop) -{ - __ASSERT_DEBUG(iState == EReadyToPlay, User::Invariant()); - - if (aLoop == 0) - { - // There is no known working method to play clip forever, so we play - // it for a long time instead. - aLoop = KMIDClipForever; - } - - --aLoop; - - // Setting repeats to 1 causes sound played twice - if (aLoop > 0) - { - iMdaAudioPlayerUtility->SetRepeats(aLoop, TTimeIntervalMicroSeconds(0)); - } - - iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_PLAYING); - - iMdaAudioPlayerUtility->Play(); - iState = EPlaying; - iPlayed = ETrue; - return KErrNone; -} - -void CMIDClip::Stop() -{ - if (iState == EPlaying) - { - iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED); - iMdaAudioPlayerUtility->Stop(); - iState = EReadyToPlay; - } -} - -void CMIDClip::SetVolume(TInt aVolume) -{ - iVolume = aVolume; - TInt volume = 0; - if (aVolume) - { - volume = (((iMdaAudioPlayerUtility->MaxVolume() - - KMIDMinNativeVolume + 1) - * aVolume) - / (KMIDMaxJavaVolume + 1)) + KMIDMinNativeVolume; - } - iMdaAudioPlayerUtility->SetVolume(volume); -} - -TInt CMIDClip::Volume() -{ - return iVolume; -} - -void CMIDClip::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/) -{ - if (aError == KErrNone) - { - //Setting iVolume to max because - //CMdaAudioPlayerUtility doesn't have Volume() - iVolume = KMIDMaxJavaVolume; - iState = EReadyToPlay; - } - else - { - if (aError == KErrNotSupported) - { - iState = ENotSupported; - } - else - { - iState = ENotReady; - } - } - iSchedulerWait->AsyncStop(); -} - -void CMIDClip::MapcPlayComplete(TInt /*aError*/) -{ - iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED); - iState = EReadyToPlay; -} - -void CMIDClip::Release() -{ - if (iMdaAudioPlayerUtility) - { - if (iState == EPlaying) - { - iMdaAudioPlayerUtility->Stop(); - } - } - delete iMdaAudioPlayerUtility; - iMdaAudioPlayerUtility = NULL; - delete iClip; - iClip = NULL; - iState = ENotReady; -} - -//End of File - diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/src/cmidsound.cpp --- a/javauis/nokiasound/src/cmidsound.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,313 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Wrapper for CMIDClip and CMIDTone class initialisations. -* -*/ - - -#include -#include -#include - -#include "CMIDSound.h" -#include "CMIDTone.h" -#include "CMIDClip.h" -#include "logger.h" -#include "fs_methodcall.h" -#include "com_nokia_mid_sound_Sound.h" - - -CMIDSound* CMIDSound::NewL(JNIEnv& aJni, jobject aPeer) -{ - JELOG2(EJavaUI); - - CMIDSound* self = new CMIDSound(); - if (self != NULL) - { - self->attachToVm(aJni, aPeer); - } - return self; -} - -CMIDSound::~CMIDSound() -{ - delete iMIDSound; - - // CENREP - if (iProfileListener) - { - iProfileListener->StopListening(); - delete iProfileListener; - } - delete iRepository; -} - -void CMIDSound::HandleNotifyInt(TUint32 aId, TInt aNewValue) -{ - JELOG2(EJavaUI); - if (aId == KProEngActiveWarningTones) - { - if (iMIDSound) - { - iMIDSound->SetVolume(aNewValue == 0 ? 0 : iRealVolume); - } - } -} - -void CMIDSound::SendEvent(TInt aEventType) -{ - /** - *Callback to Java - */ - JELOG2(EJavaUI); - - jclass javaPeerClass = mJniEnv->FindClass("com/nokia/mid/sound/Sound"); - - jmethodID soundStateChangeCallback = mJniEnv->GetMethodID( - javaPeerClass /*mJavaPeerClass */, "soundStateChanged", "(I)V"); - - - mJniEnv->CallVoidMethod(mJavaPeerObject, soundStateChangeCallback, - aEventType); -} - -CMIDSound::CMIDSound() - : java::util::FunctionServer("CMIDSoundFunctionServer"), - iMIDSound(0) -{ - JELOG2(EJavaUI); - createServerToNewThread(); -} - -int CMIDSound::InitProfileListener() -{ - TRAPD(err, CallMethodL(this, &CMIDSound::InitProfileListenerL, this)); - return err; -} - -void CMIDSound::InitProfileListenerL() -{ - JELOG2(EJavaUI); - // repository for profile - iRepository = CRepository::NewL(KCRUidProfileEngine); - - // get notifies about changes in KProEngActiveWarningTones - iProfileListener = CCenRepNotifyHandler::NewL(*this, - *iRepository, - CCenRepNotifyHandler::EIntKey, - KProEngActiveWarningTones); - - // Changes will be informed to HandleNotifyInt - iProfileListener->StartListeningL(); -} - -TBool CMIDSound::IsAudioEnabled(/*CMIDSound* aSelf*/) -{ - JELOG2(EJavaUI); - TInt isProfileOn = 0; - TInt error = iRepository->Get(KProEngActiveWarningTones, isProfileOn); - TBool retVal = EFalse; - - // If getting profile status fails do not play any tones. - if ((isProfileOn == 1) && - (error == KErrNone)) - { - retVal = ETrue; - } - return retVal; -} - -void CMIDSound::SetBeep(TInt aFreq, TInt64 aDuration) -{ - JELOG2(EJavaUI); - iFreq = aFreq; - iDur = aDuration; -} - -TInt CMIDSound::Init(TInt aType, const TDesC8* aData) -{ - JELOG2(EJavaUI); - TRAPD(err, CallMethodL(this, &CMIDSound::InitL, aType, aData, this)); - return err; -} - -void CMIDSound::InitL(TInt aType, const TDesC8* aData) -{ - JELOG2(EJavaUI); - - if (iMIDSound) - { - if (iMIDSound->State() == CMIDSoundImpl::EInitialising) - { - return; - } - if (iMIDSound->State() == CMIDSoundImpl::EReadyToPlay || - iMIDSound->State() == CMIDSoundImpl::EPlaying) - { - iMIDSound->Release(); - } - } - - CMIDSoundImpl* soundImpl = NULL; - switch (aType) - { - case com_nokia_mid_sound_Sound_FORMAT_TONE: //Tone - { - soundImpl = CMIDTone::NewL(*aData, this); - break; - } - case com_nokia_mid_sound_Sound_FORMAT_BEEP: //Beep - { - soundImpl = CMIDTone::NewL(iFreq, iDur, this); - break; - } - case com_nokia_mid_sound_Sound_FORMAT_WAV: //Wav - { - soundImpl = CMIDClip::NewL(aData, this); - break; - } - default: - { - break; - } - } - - if (soundImpl) - { - if (soundImpl->State() != CMIDSoundImpl::EReadyToPlay) - { - TInt state = soundImpl->State(); - delete soundImpl; - User::Leave(KErrNotReady); - } - iRealVolume = soundImpl->Volume(); - } - - delete iMIDSound; - iMIDSound = soundImpl; -} - -TInt CMIDSound::Play(TInt aLoop) -{ - JELOG2(EJavaUI); - TInt err = 0; - CallMethod(err, this, &CMIDSound::DoPlay, aLoop, this); - return err; -} - -TInt CMIDSound::DoPlay(TInt aLoop) -{ - JELOG2(EJavaUI); - - if (iMIDSound) - { - TInt state = iMIDSound->State(); - if (state != CMIDSoundImpl::EReadyToPlay) - { - return state; - } - } - else - { - return CMIDSoundImpl::ENotSupported; - } - if (!IsAudioEnabled()) - { - iMIDSound->SetVolume(0); - } - return iMIDSound->Play(aLoop); -} - -void CMIDSound::Resume() -{ - JELOG2(EJavaUI); - CallMethod(this, &CMIDSound::DoResume, this); -} - -void CMIDSound::DoResume() -{ - JELOG2(EJavaUI); - iMIDSound->Resume(); -} - -void CMIDSound::Stop() -{ - JELOG2(EJavaUI); - CallMethod(this, &CMIDSound::DoStop, this); -} - -void CMIDSound::DoStop() -{ - JELOG2(EJavaUI); - iMIDSound->Stop(); -} - -TInt CMIDSound::SoundVolume() -{ - JELOG2(EJavaUI); - TInt result = 0; - CallMethod(result, this, &CMIDSound::Volume, this); - return result; -} - -TInt CMIDSound::Volume() -{ - JELOG2(EJavaUI); - return iMIDSound->Volume(); -} - -void CMIDSound::SetVolume(TInt aVolume) -{ - JELOG2(EJavaUI); - CallMethod(this, &CMIDSound::DoSetVolume, aVolume, this); -} - -void CMIDSound::DoSetVolume(TInt aVolume) -{ - JELOG2(EJavaUI); - iRealVolume = aVolume; - TInt currentState = iMIDSound->State(); - if ((currentState == CMIDSoundImpl::EReadyToPlay) || - (currentState == CMIDSoundImpl::EPlaying)) - { - iMIDSound->SetVolume(IsAudioEnabled() ? aVolume : 0); - } -} - - -TInt CMIDSound::PlayerState() -{ - JELOG2(EJavaUI); - TInt result = 0; - CallMethod(result, this, &CMIDSound::State, this); - return result; -} - -TInt CMIDSound::State() -{ - JELOG2(EJavaUI); - return iMIDSound->State(); -} - -void CMIDSound::Release() -{ - JELOG2(EJavaUI); - CallMethod(this, &CMIDSound::DoRelease, this); -} - -void CMIDSound::DoRelease() -{ - JELOG2(EJavaUI); - iMIDSound->Release(); -} diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/src/cmidtone.cpp --- a/javauis/nokiasound/src/cmidtone.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,244 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This class implements beep playing and OTA ringingtone playing. -* -*/ - - -#include -#include - -#include "com_nokia_mid_sound_Sound.h" -#include "CMIDTone.h" -#include "MMIDEventSender.h" - -namespace -{ -const TInt KMIDMaxJavaVolume = 255; -const TInt KMIDMinNativeVolume = 1; -const TInt KMIDStopSleepTime = 10000; -const TInt KMIDMicrosInMilli = 1000; -const TInt KMIDMinDataLength = 4; -const TInt KMIDLoopForever = 999999; -} - -CMIDTone* CMIDTone::NewL(TInt aFreq, TInt64 aDuration, - MMIDEventSender* aEventSender) -{ - CMIDTone* self = new(ELeave) CMIDTone(aEventSender); - CleanupStack::PushL(self); - self->ConstructL(aFreq, aDuration); - CleanupStack::Pop(self); - return self; -} - -CMIDTone* CMIDTone::NewL(const TDesC8& aData, MMIDEventSender* aEventSender) -{ - CMIDTone* self = new(ELeave) CMIDTone(aEventSender); - CleanupStack::PushL(self); - self->ConstructL(aData); - CleanupStack::Pop(self); - return self; -} - - -CMIDTone::~CMIDTone() -{ - if (iMdaAudioToneUtility) - { - if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityNotReady) - { - iMdaAudioToneUtility->CancelPrepare(); - } - else if (iMdaAudioToneUtility->State() - == EMdaAudioToneUtilityPlaying) - { - iMdaAudioToneUtility->CancelPlay(); - } - } - delete iMdaAudioToneUtility; - delete iSchedulerWait; -} - -CMIDTone::CMIDTone(MMIDEventSender* aEventSender) - : CMIDSoundImpl(aEventSender) -{ -} - -void CMIDTone::ConstructL(TInt aFreq, TInt64 aDuration) -{ - CMIDSoundImpl::ConstructL(); - iSchedulerWait = new(ELeave) CActiveSchedulerWait; - iFreq = aFreq; - iDuration = aDuration; - iState = EInitialising; - iMdaAudioToneUtility = CMdaAudioToneUtility::NewL(*this); - iMdaAudioToneUtility->PrepareToPlayTone(iFreq, - TTimeIntervalMicroSeconds(iDuration * KMIDMicrosInMilli)); - iSchedulerWait->Start(); -} - -void CMIDTone::ConstructL(const TDesC8& aData) -{ - CMIDSoundImpl::ConstructL(); - iSchedulerWait = new(ELeave) CActiveSchedulerWait; - // first byte is the number of command parts - iFreq = 0; - iDuration = 0; - iState = EInitialising; - - if (aData.Length() < KMIDMinDataLength) - { - iState = ENotSupported; - User::Leave(KErrArgument); - } - - if (aData[0x000] == 0x02 && aData[0x001] == 0x4a && aData[0x002] == 0x3a) - { - iState = EInitialising; - } - else if (aData[0x000] == 0x03 && aData[0x001] == 0x4a && aData[0x002] == - 0x44 && aData[0x003] == 0x3a) - { - iState = EInitialising; - } - else if (aData[0] == 0x00 && aData[1] == 0x11) - { - iState = EInitialising; - } - else - { - iState = ENotSupported; - User::Leave(KErrArgument); - } - iMdaAudioToneUtility = CMdaAudioToneUtility::NewL(*this); - iMdaAudioToneUtility->PrepareToPlayDesSequence(aData); - iSchedulerWait->Start(); - -} - -TInt CMIDTone::Play(TInt aLoop) -{ - __ASSERT_DEBUG(iState == EReadyToPlay, User::Invariant()); - - if (aLoop == 0) - { - // There is no known working method to play tone forever - aLoop = KMIDLoopForever; - } - - // Setting repeats to 1 causes sound played twice - if (aLoop == 1) - { - iMdaAudioToneUtility->SetRepeats(0, TTimeIntervalMicroSeconds(0)); - } - else if (aLoop > 1) - { - iMdaAudioToneUtility->SetRepeats(aLoop, TTimeIntervalMicroSeconds(0)); - } - - iMdaAudioToneUtility->Play(); - - iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_PLAYING); - iState = EPlaying; - iPlayed = ETrue; - - return KErrNone; -} - -void CMIDTone::Stop() -{ - if (iState == EPlaying) - { - iMdaAudioToneUtility->CancelPlay(); - // sleep to make sure the device has time to stop - User::After(TTimeIntervalMicroSeconds32(KMIDStopSleepTime)); // CSI: 92 MdaAudioToneUtility does not send event when stopping has finished # - iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED); - iState = EReadyToPlay; - } -} - -void CMIDTone::SetVolume(TInt aVolume) -{ - TInt maxVolume = iMdaAudioToneUtility->MaxVolume(); - TInt volume = 0; - if (aVolume) - { - volume = (((maxVolume - - KMIDMinNativeVolume + 1) - * aVolume) - / (KMIDMaxJavaVolume + 1)) + KMIDMinNativeVolume; - } - iMdaAudioToneUtility->SetVolume(volume); -} - -TInt CMIDTone::Volume() -{ - TInt maxVolume = iMdaAudioToneUtility->MaxVolume(); - TInt volume = (iMdaAudioToneUtility->Volume() * - KMIDMaxJavaVolume) / maxVolume; - - return volume; -} - -void CMIDTone::MatoPrepareComplete(TInt aError) -{ - if (aError == KErrNone) - { - iState = EReadyToPlay; - } - else - { - if (aError == KErrNotSupported) - { - iState = ENotSupported; - } - else - { - iState = ENotReady; - } - } - iSchedulerWait->AsyncStop(); -} - -void CMIDTone::MatoPlayComplete(TInt aError) -{ - if (KErrNone == aError) - { - iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED); - iState = EReadyToPlay; - } -} - -void CMIDTone::Release() -{ - iState = ENotReady; - if (iMdaAudioToneUtility) - { - if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityNotReady) - { - iMdaAudioToneUtility->CancelPrepare(); - } - else if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityPlaying - || iState == EPlaying) - { - iMdaAudioToneUtility->CancelPlay(); - } - } - delete iMdaAudioToneUtility; - iMdaAudioToneUtility = NULL; - iState = ENotReady; -} - -// End of File diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound/src/sound.cpp --- a/javauis/nokiasound/src/sound.cpp Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,209 +0,0 @@ -/* -* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: JNI class for Sound.java. -* -*/ - - -#include // MAKE_TINT64 Warning fix - -#include "com_nokia_mid_sound_Sound.h" -#include "CMIDSound.h" -#include "javajniutils.h" -#include "javacommonutils.h" -#include "logger.h" - -/* - * Class: com_nokia_mid_sound_Sound - * Method: _dispose - * Signature: (II)V - */ -JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1dispose -(JNIEnv* /* aJni */, jobject /* aSound */, jint aHandle) -{ - JELOG2(EJavaUI); - CMIDSound* sound = reinterpret_cast(aHandle); - delete sound; -} - -/* - * Class: com_nokia_mid_sound_Sound - * Method: _create - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1create -(JNIEnv* aJni, jobject aSound) -{ - JELOG2(EJavaUI); - - TInt handle(0); - CMIDSound* sound = 0; - TRAPD(err, - { - sound = CMIDSound::NewL(*aJni, aSound); - if (sound != 0) - { - sound->InitProfileListener(); - } - }); - - if (err != KErrNone) - { - - java::util::JniUtils::throwNewException(aJni, "java/lang/RuntimeException" , - "Failed to create Native Peer " + - java::util::JavaCommonUtils::intToString(err)); - } - else - { - - handle = reinterpret_cast(sound); - } - return handle; -} - -/* - * Class: com_nokia_mid_sound_Sound - * Method: _init - * Signature: (III[BIJ)I - */ -JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1init -(JNIEnv* aJni, jobject, jint aHandle, jint aType, jbyteArray aData, - jint aFrequency, jlong aDuration) -{ - JELOG2(EJavaUI); - TInt freq(aFrequency); - TInt64 duration = *reinterpret_cast(&aDuration); - - CMIDSound* sound = reinterpret_cast(aHandle); - - TPtrC8 ptr; - jbyte* data = NULL; - - if (aType != com_nokia_mid_sound_Sound_FORMAT_BEEP) - { - if (!aData) - { - return KErrGeneral; - } - data = aJni->GetByteArrayElements(aData,0); - jint length = aJni->GetArrayLength(aData); - ptr.Set((TUint8*)data, length); - } - - // Had to make SetBeep() due to number of maximum parameters in ExecuteTrap. - sound->SetBeep(freq, duration); - TInt err = sound->Init(aType, (const TDesC8*)&ptr); - - if (aType != com_nokia_mid_sound_Sound_FORMAT_BEEP) - { - aJni->ReleaseByteArrayElements(aData, data, 0); - } - return err; -} - -/* - * Class: com_nokia_mid_sound_Sound - * Method: _release - * Signature: (II)V - */ -JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1release -(JNIEnv*, jobject, jint aHandle) -{ - JELOG2(EJavaUI); - CMIDSound* sound = reinterpret_cast(aHandle); - sound->Release(); -} - - -/* - * Class: com_nokia_mid_sound_Sound - * Method: _play - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1play -(JNIEnv*, jobject, jint aHandle, jint aLoop) -{ - JELOG2(EJavaUI); - CMIDSound* sound = reinterpret_cast(aHandle); - TInt err = sound->Play(aLoop); - return err; -} - -/* - * Class: com_nokia_mid_sound_Sound - * Method: _stop - * Signature: (II)V - */ -JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1stop -(JNIEnv*, jobject, jint aHandle) -{ - JELOG2(EJavaUI); - CMIDSound* sound = reinterpret_cast(aHandle); - sound->Stop(); -} - -/* - * Class: com_nokia_mid_sound_Sound - * Method: _resume - * Signature: (II)V - */ -JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1resume -(JNIEnv*, jobject, jint aHandle) -{ - JELOG2(EJavaUI); - CMIDSound* sound = reinterpret_cast(aHandle); - sound->Resume(); -} - -/* - * Class: com_nokia_mid_sound_Sound - * Method: _setVolume - * Signature: (III)V - */ -JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1setVolume -(JNIEnv*, jobject, jint aHandle, jint aVolume) -{ - JELOG2(EJavaUI); - CMIDSound* sound = reinterpret_cast(aHandle); - sound->SetVolume(aVolume); -} - -/* - * Class: com_nokia_mid_sound_Sound - * Method: _volume - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1volume -(JNIEnv*, jobject, jint aHandle) -{ - JELOG2(EJavaUI); - CMIDSound* sound = reinterpret_cast(aHandle); - TInt volume = sound->SoundVolume(); - return(volume); -} - -/* - * Class: com_nokia_mid_sound_Sound - * Method: _getState - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1getState -(JNIEnv*, jobject, jint aHandle) -{ - JELOG2(EJavaUI); - CMIDSound* sound = reinterpret_cast(aHandle); - TInt state = sound->PlayerState(); - return state; -} diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/build/bld.inf Fri Oct 22 14:23:56 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: Generated bld.inf -file +* +*/ + +PRJ_PLATFORMS +default + +PRJ_MMPFILES +javanokiasound_0x2002DCC4.mmp diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/build/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/build/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/build/bwins/javanokiasoundu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/build/bwins/javanokiasoundu.def Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) + diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/build/eabi/javanokiasoundu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/build/eabi/javanokiasoundu.def Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z10jni_lookupPKc @ 1 NONAME + diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/build/javanokiasound.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/build/javanokiasound.pro Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,28 @@ +# +# 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=javanokiasound +CONFIG += omj java stl +CONFIG -= qt + +LIBS += -lcenrepnotifhandler \ + -lcentralrepository \ + -lmediaclientaudio \ + -lcommonengine \ + -ljavautils + +include(../../../build/omj.pri) diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/build/javanokiasound_0x2002DCC4.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/build/javanokiasound_0x2002DCC4.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,151 @@ +/* +* 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: Generated file - do not edit manually +* +*/ + +// ============================================================================== +// Generated by qmake (2.01a) (Qt 4.6.4) on: (date) +// This file is generated by qmake and should not be modified by the +// user. +// Name : javanokiasound.mmp +// ============================================================================== + +TARGET javanokiasound.dll +TARGETTYPE DLL + +UID 0x1000008d 0x2002DCC4 +SECUREID 0x2002DCC4 + +EPOCALLOWDLLDATA + + +// Qt Macros +MACRO UNICODE +MACRO QT_KEYPAD_NAVIGATION +MACRO QT_SOFTKEYS_ENABLED +MACRO QT_USE_MATH_H_FLOATS +MACRO RD_JAVA_SYMBIAN_TARGET +MACRO RD_JAVA_S60_RELEASE_9_2 +MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS +MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS +MACRO RD_JAVA_STDCPPV5 +MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX +MACRO RD_JAVA_HTTP_EMC_ENABLED +MACRO RD_JAVA_NGA_ENABLED +MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_OPENC_BETA_PATCH +MACRO RD_JAVA_INSTALLERUI_ENABLED +MACRO RD_JAVA_PREWARM +MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK +MACRO RD_JAVA_MIDPRMS_DB +MACRO __SYMBIAN32__ +MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER + +SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian +SYSTEMINCLUDE ../inc +SYSTEMINCLUDE ../../inc +SYSTEMINCLUDE ../../../inc +SYSTEMINCLUDE ../src +SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 +SYSTEMINCLUDE /epoc32/include/mw +SYSTEMINCLUDE . + +SOURCEPATH ../src +SOURCE cmidclip.cpp +SOURCE cmidsound.cpp +SOURCE CMIDSoundImpl.cpp +SOURCE cmidtone.cpp +SOURCE sound.cpp + + +LIBRARY cenrepnotifhandler.lib +LIBRARY centralrepository.lib +LIBRARY mediaclientaudio.lib +LIBRARY commonengine.lib +LIBRARY javautils.lib +LIBRARY libpthread.lib +LIBRARY libstdcppv5.lib +LIBRARY libc.lib +LIBRARY libm.lib +LIBRARY euser.lib +LIBRARY libdl.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY eikcoctl.lib +LIBRARY eiksrv.lib +LIBRARY apparc.lib +LIBRARY avkon.lib +LIBRARY efsrv.lib +LIBRARY charconv.lib +LIBRARY ws32.lib +LIBRARY hal.lib +LIBRARY gdi.lib +LIBRARY apgrfx.lib + +CAPABILITY all -tcb + +OPTION CW -wchar_t on +OPTION ARMCC --visibility_inlines_hidden +#if defined(ARMCC_4_0) +OPTION ARMCC --import_all_vtbl +#endif +OPTION GCCE -fvisibility-inlines-hidden + +VERSION 10.0 + +ARMFPU softvfp + +PAGED + +BYTEPAIRCOMPRESSTARGET + +USERINCLUDE . + +#include + + APP_LAYER_SYSTEMINCLUDE + + OS_LAYER_LIBC_SYSTEMINCLUDE + + OS_LAYER_SSL_SYSTEMINCLUDE + +deffile ./~/javanokiasound.def + + SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) + +SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah + +SOURCEPATH /epoc32/build/jrt/javabuild/javanokiasound + +SOURCE lookup.cpp + +SOURCEPATH /epoc32/build/jrt/javabuild/javanokiasound + +SOURCE jxe.c + +#ifdef WINSCW + +LIBRARY ewsd.lib + +#endif + +STDCPP + +#ifdef WINSCW +DEFFILE ./bwins/javanokiasound.def +#elif defined EABI +DEFFILE ./eabi/javanokiasound.def +#endif diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/inc/CMIDClip.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/inc/CMIDClip.h Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class implements wav playing. +* +*/ + + +#ifndef CMIDCLIP_H +#define CMIDCLIP_H + +// INCLUDES +#include +#include + +#include "CMIDSoundImpl.h" + +// FORWARD DECLARATIONS +class MMIDEventSender; + +// CLASS DEFINITION +/** + * This class implements wav playing. + * + */ +NONSHARABLE_CLASS(CMIDClip): public CMIDSoundImpl, + public MMdaAudioPlayerCallback +{ +public: + + static CMIDClip* NewL(const TDesC8* aData, MMIDEventSender* aEventSender); + // Destructor + ~CMIDClip(); + +protected: + + // C++ constructor + CMIDClip(MMIDEventSender* aEventSender); + // Second phase + void ConstructL(const TDesC8* aData); + +public: + + virtual TInt Play(TInt aLoop); + virtual void Stop(); + virtual void SetVolume(TInt aVolume); + virtual TInt Volume(); + virtual void Release(); + +public: // from MMdaAudioPlayerCallback + void MapcInitComplete(TInt aError, + const TTimeIntervalMicroSeconds& aDuration); + void MapcPlayComplete(TInt aError); + +private: + + HBufC8* iClip; + CMdaAudioPlayerUtility* iMdaAudioPlayerUtility; + TInt iLoops; + TInt iVolume; +}; + +#endif // CMIDCLIP_H diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/inc/CMIDSound.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/inc/CMIDSound.h Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,106 @@ +/* +* Copyright (c) 2006 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: Wrapper for CMIDClip and CMIDTone class initialisations. +* +*/ + + +// INCLUDES +#include +#include +#include +#include "MMIDEventSender.h" +#include "functionserver.h" + +// FORWARD DECLARATIONS +class CMIDSoundImpl; + +// CLASS DEFINITION +/** + * CMIDSound is a wrapper that handles which class is + * wanted to be initialised, CMIDClip or CMIDTone + * + */ +NONSHARABLE_CLASS(CMIDSound): + public CBase, MCenRepNotifyHandlerCallback, MMIDEventSender, java::util::FunctionServer +{ + +public: + + // Destructor + ~CMIDSound(); + +public: // From MCenRepNotifyHandlerCallback + /** + * Notifies this class about changes in the audio enable status + */ + void HandleNotifyInt(TUint32 aId, TInt aNewValue); + +public: // From MMIDEventSender + /** + * Sends event to Java SoundListener. + * @since 3.0 + * @param aEventType Type of the event to send + */ + void SendEvent(TInt aEventType); + +protected: + + // C++ default constructor + CMIDSound(); + +private: + TBool IsAudioEnabled(); + +public: + + static CMIDSound* NewL(JNIEnv& aJni, jobject aSound); + void SetBeep(TInt aFreq, TInt64 aDuration); + TInt Init(TInt aType, const TDesC8* aData); + void InitL(TInt aType, const TDesC8* aData); + TInt InitProfileListener(); + void InitProfileListenerL(); + TInt Play(TInt aLoop); + TInt DoPlay(TInt aLoop); + void Resume(); + void DoResume(); + void Stop(); + void DoStop(); + TInt SoundVolume(); + TInt Volume(); + void SetVolume(TInt aVolume); + void DoSetVolume(TInt aVolume); + TInt State(); + TInt PlayerState(); + void Release(); + void DoRelease(); + + +private: + + CMIDSoundImpl* iMIDSound; + TInt iFreq; + TInt64 iDur; + TInt iSource; + TInt iRealVolume; + + // owned, informs about changes in iRepository + CCenRepNotifyHandler* iProfileListener; + + // owned, current profile + CRepository* iRepository; + + TInt iHandle; +}; + diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/inc/CMIDSoundEvent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/inc/CMIDSoundEvent.h Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,71 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class for sound related events. +* +*/ + + +#ifndef CMIDSOUNDEVENT_H +#define CMIDSOUNDEVENT_H + +#include + +// CLASS DEFINITION + +/** + * Class for sound related events. + */ +NONSHARABLE_CLASS(CMIDSoundEvent) +{ +public: // constructor + CMIDSoundEvent(TInt aEvent); + +public: // new methods + /** + * Setter for listener + * @param aListener this event will be sent to this listener + */ + void SetListener(jobject aListener); + + /** + * Setter for method ID + * @param aMethodID this event will be sent by calling this method + */ + void SetMethodID(jmethodID aMethodID); + + /** + * Adds a global reference to peer object, this reference is + * removed when the event is dispatched. This prevents peer + * object from being deleted by garbage collector before the + * event has been dispatched. + */ + void AddGlobalRef(JavaVM* javaVM); + + +private: + void Dispatch(JNIEnv& aJni); + +private: + jobject iListener; + jmethodID iMethodID; + TInt iEvent; + jobject iGlobalRef; + // Number of times the global reference has been added. + // The actual global reference is removed when the counter reaches zero. + TInt iRefCount; + +}; + + +#endif // CMIDSOUNDEVENT_H diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/inc/CMIDSoundImpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/inc/CMIDSoundImpl.h Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Interface and a base class for CMIDClip and CMIDTone. +* +*/ + + + +#ifndef CMIDSOUNDIMPL_H +#define CMIDSOUNDIMPL_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class MMIDEventSender; + + +// CLASS DEFINITION +/** + * This class is interface and a base class for CMIDClip and CMIDTone + * + */ +NONSHARABLE_CLASS(CMIDSoundImpl): public CBase +{ + +public: + + enum TState + { + ENotReady, + EReadyToPlay, + EPlaying, + ENotSupported, + EInitialising + }; + +public: + + // destructor + ~CMIDSoundImpl(); + +protected: + + void ConstructL(); + + // C++ constructor + CMIDSoundImpl(MMIDEventSender* aEventSender); + +public: + + void Resume(); + + virtual TInt Play(TInt aLoop) = 0; + virtual void Stop() = 0; + virtual void SetVolume(TInt aVolume) = 0; + virtual TInt Volume() = 0; + virtual void Release() = 0; + + inline TInt State() const; + +protected: + + + TInt iState; + + // true if playback has been started. + TBool iPlayed; + + CActiveSchedulerWait* iSchedulerWait; + + // events are sent through this interface + MMIDEventSender* iEventSender; + +}; + +inline TInt CMIDSoundImpl::State() const +{ + return iState; +}; + +#endif // CMIDSOUNDIMPL_H diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/inc/CMIDTone.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/inc/CMIDTone.h Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class implements beep playing and OTA ringingtone playing. +* +*/ + + +#ifndef CMIDTONE_H +#define CMIDTONE_H + +// INCLUDES +#include +#include + +#include "CMIDSoundImpl.h" + +// FORWARD DECLARATIONS +class MMIDEventSender; + +// CLASS DEFINITION +/** + * This class implements beep playing and OTA ringingtone playing. + * + */ +NONSHARABLE_CLASS(CMIDTone): public CMIDSoundImpl, public MMdaAudioToneObserver +{ +public: + + static CMIDTone* NewL(TInt aFreq, TInt64 aDuration, + MMIDEventSender* aEventSender); + static CMIDTone* NewL(const TDesC8& aData, MMIDEventSender* aEventSender); + // Destructor + ~CMIDTone(); + +protected: + + // C++ constructor + CMIDTone(MMIDEventSender* aEventSender); + // Second phase + void ConstructL(TInt aFreq, TInt64 aDuration); + void ConstructL(const TDesC8& aData); + +public: + + virtual TInt Play(TInt aLoop); + virtual void Stop(); + virtual void SetVolume(TInt aVolume); + virtual TInt Volume(); + virtual void Release(); + +public: // from MMdaAudioToneObserver + + void MatoPrepareComplete(TInt aError); + void MatoPlayComplete(TInt aError); + +private: + + TInt iFreq; + TInt64 iDuration; + CMdaAudioToneUtility* iMdaAudioToneUtility; +}; + +#endif // CMIDTONE_H diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/inc/MMIDEventSender.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/inc/MMIDEventSender.h Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2005 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: SoundImpl instances can send events through this interface +* +*/ + + + +#ifndef MMIDEVENTSENDER_H +#define MMIDEVENTSENDER_H + +/** +* SoundImpl instances cand send events through this interface. +* This interface has only one method, SendEvent(), which can be used +* for sending all types of sound events. +* +* @since 3.0 +*/ +NONSHARABLE_CLASS(MMIDEventSender) +{ + +public: // New functions + + /** + * Sends event to Java SoundListener. + * @since 3.0 + * @param aEventType Type of the event to send + */ + virtual void SendEvent(TInt aEventType) = 0; + +protected: + + /** + * C++ default constructor. + */ + MMIDEventSender() { } + +private: + + // Prohibit copy constructor if not deriving from CBase. + MMIDEventSender(const MMIDEventSender&) { } + // Prohibit assigment operator if not deriving from CBase. + MMIDEventSender& operator=(const MMIDEventSender&) + { + return *this; + } + +}; + +#endif // MMIDEVENTSENDER_H + +// End of File diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/javasrc/com/nokia/mid/sound/Sound.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/javasrc/com/nokia/mid/sound/Sound.java Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,698 @@ +/* +* Copyright (c) 2006 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: Provides Sound API for playing tones and digitized audio. +* +*/ + + +package com.nokia.mid.sound; + +import com.nokia.mj.impl.rt.support.Finalizer; +import java.util.Vector; +import com.nokia.mj.impl.utils.Logger; +import java.lang.Thread; + +/** + *

    + * Provides simple Sound API for playing tones and digitized audio. + *

    + * Since MIDP doesn't have any Sound API for games there is a need + * for proprietary sound extension to support devices audio + * capabilities. Every implementation has capability to produce tone + * sounds (e.g. ringing tones), this is the minimum support. Currently + * some products support or will support also digitized audio formats. + * The Game sound API will support both buzzer and digitized audio. + * Buzzer must be supported by all implementations. If implementation + * doesn't have buzzer the buzzer tones are emulated. + *

    + * Since implementations have different audio capabilities, + * application can query which audio formats are supported by + * implementation by calling {@link #getSupportedFormats()}. + *

    + * All implementations need to support at least tone based sounds + * (type FORMAT_TONE) via {@link #Sound(int freq, long duration)} and + * {@link #init(int freq, long duration)}. In addition all implementations + * must support Smart messaging ringingtone format (type FORMAT_TONE) + * via {@link #Sound(byte[] data, int type)} and + * {@link #init(byte[] data, int type) }. + *

    + * Note that there is also work going on with Multimedia API that + * is done in JCP as + * JSR 135. + * The standard Multimedia API + * will replace the proprietary Game Sound API when it is ready. However + * Sound API will be supported also later on but probably it will be + * stated as deprecated. + *

    + * @version 1.1 + * @see com.nokia.mid.ui.DeviceControl + * @since 1.0 + */ + +public class Sound +{ + + /** + * Tone based format is used. + * + * init(int freq, int duration) puts sound into this format. + * @since 1.0 + * + */ + public static final int FORMAT_TONE = 1; + + /** + * Content is in WAV format. + * @since 1.0 + * + */ + public static final int FORMAT_WAV = 5; + + /** + * Sound is playing. + * @since 1.0 + * + */ + public static final int SOUND_PLAYING = 0; + + /** + * Sound is stopped. + * @since 1.0 + * + */ + public static final int SOUND_STOPPED = 1; + + /** + * Sound is uninitialized (released). + * @since 1.0 + */ + public static final int SOUND_UNINITIALIZED = 3; + + /** + * Sound is reinitialising + */ + private static final int SOUND_REINITIALISING = 4; + + private static final int FORMAT_BEEP = 2; + private static final int NOT_SUPPORTED_ERROR = 3; + + private static final int ERR_NOT_READY = -18; + private static final int ERR_ARGUMENT = -6; + + private int iHandle; + + private Finalizer iFinalizer; + private int iCurrentType; + private int iState; + private int iGain = -1; + + Vector iSoundListeners = new Vector(); + + private static Sound iPlayingSound; + + static + { + com.nokia.mj.impl.rt.support.Jvm.loadSystemLibrary("javanokiasound"); + } + + /** + * Constructors initialize the Sound object so that it is ready for + * playback. This constructor is used for initializing Sound + * object based on byte array data. The data should contain the data + * presented in the data format specified by type parameter. The Sound + * class defines also generally supported types as constants. + *

    + * All implementations need to support at least Nokia + * Smart Messaging, Over the Air (OTA) ringingtone format. + * The type of this format is FORMAT_TONE. + *

    + * Note: some implementations can't throw exceptions about + * sound data being corrupted or illegal during construction. + * This will result that IllagalArgumentException is delayed until + * play(int loop) method is called. Applications thus need to except + * that IllegalArgumentException is thrown in this method or during + * play method call. + *

    + * @throws java.lang.IllegalArgumentException if the data can not be + recognized to + * given type or the type is unsupported or unknown + * @throws java.lang.NullPointerException if the data is null + * @since 1.0 + * + */ + public Sound(byte[] data, int type) + { + Logger.LOG(Logger.EJavaUI, Logger.EInfo, "Sound Constructor"); + iFinalizer = registerForFinalization(); + + iHandle = _create(); + + iState = SOUND_UNINITIALIZED; + + init(data, type); + } + + /** + * Constructors initialize the Sound object so that it is ready for + * playback. Sound is initialized as a simple tone based sound. + *

    + * See method {@link #init(int freq, long duration)} for + * freq value descriptions. See also a note on exceptions semantics in + * {@link #init(int freq, long duration)}. + * + * @param freq a frequency value + * @param duration the duration of the tone in milliseconds + * @throws java.lang.IllegalArgumentException if parameter values are + * illegal, freq is not in given range or duration is negative or zero + * @since 1.0 + */ + public Sound(int freq, long duration) + { + + iFinalizer = registerForFinalization(); + iHandle = _create(); + + iState = SOUND_UNINITIALIZED; + + init(freq, duration); + } + + /** + * Called when this object is finalized, frees native resources + */ + + public Finalizer registerForFinalization() + { + + return new Finalizer() + { + public void finalizeImpl() + { + doFinalize(); + } + }; + } + + void doFinalize() + { + + if (iFinalizer == null) + { + return; + } + iFinalizer = null; + + if (iHandle > 0) + { + _dispose(iHandle); + } + } + + /** + * Releases audio resources reserved by this object. After object + * is released it goes to uninitialized state. This method should + * be called when Sound object is not needed anymore. + * @since 1.0 + */ + public void release() + { + if ((iState != SOUND_UNINITIALIZED) && + (iState != SOUND_REINITIALISING)) + { + iState = SOUND_REINITIALISING; + soundStateChanged(SOUND_UNINITIALIZED); + } + + _release(iHandle); + + iState = SOUND_UNINITIALIZED; + + } + + /** + * Initializes Sound to play a simple beep. + *

    + * Note: some implementations may not support the full frequency + * scale defined in table below. They will throw + * IllegalArgumentException instead for unsupported values. The + * exception may also be delayed + * until the play(int loop) method is called. + *

    + * Following table describes some freq argument + * values: + *

    +     * Description            Frequency
    +     * Freq off               0
    +     * Ring freq A0           220
    +     * Ring freq B0b          233
    +     * Ring freq B0           247
    +     * Ring freq C0           262
    +     * Ring freq D0b          277
    +     * Ring freq D0           294
    +     * Ring freq E0b          311
    +     * Ring freq E0           330
    +     * Ring freq F0           349
    +     * Ring freq G0b          370
    +     * Ring freq G0           392
    +     * Ring freq A1b          416
    +     * Ring freq A1           440
    +     * Ring freq B1b          466
    +     * Ring freq B1           494
    +     * Ring freq C1           523
    +     * Ring freq D1b          554
    +     * Ring freq D1           587
    +     * Ring freq E1b          622
    +     * Ring freq E1           659
    +     * Ring freq F1           698
    +     * Ring freq G1b          740
    +     * Ring freq G1           784
    +     * Ring freq A2b          831
    +     * Ring freq A2           880
    +     * Ring freq B2b          932
    +     * Ring freq B2           988
    +     * Ring freq C2           1047
    +     * Ring freq D2b          1109
    +     * Ring freq D2           1175
    +     * Ring freq E2b          1245
    +     * Ring freq E2           1319
    +     * Ring freq F2           1397
    +     * Ring freq G2b          1480
    +     * Ring freq G2           1568
    +     * Ring freq A3b          1661
    +     * Ring freq A3           1760
    +     * Ring freq B3b          1865
    +     * Ring freq B3           1976
    +     * Ring freq C3           2093
    +     * Ring freq D3b          2217
    +     * Ring freq D3           2349
    +     * Ring freq E3b          2489
    +     * Ring freq E3           2637
    +     * Ring freq F3           2794
    +     * Ring freq G3b          2960
    +     * Ring freq G3           3136
    +     * Ring freq A4b          3322
    +     * Ring freq A4           3520
    +     * Ring freq B4b          3729
    +     * Ring freq B4           3951
    +     * Ring freq C4           4186
    +     * Ring freq D4b          4434
    +     * Ring freq D4           4698
    +     * Ring freq E4b          4978
    +     * Ring freq E4           5274
    +     * Ring freq F4           5588
    +     * Ring freq G4b          5920
    +     * Ring freq G4           6272
    +     * Ring freq A5b          6644
    +     * Ring freq A5           7040
    +     * Ring freq B5b          7458
    +     * Ring freq B5           7902
    +     * Ring freq C5           8372
    +     * Ring freq D5b          8870
    +     * Ring freq D5           9396
    +     * Ring freq E5b          9956
    +     * Ring freq E5           10548
    +     * Ring freq F5           11176
    +     * Ring freq G5b          11840
    +     * Ring freq G5           12544
    +     * Ring freq A6b          13288
    +     *
    +     * 
    + * + * @param duration length of the beep in milliseconds + * @param freq frequency to be played + * @throws java.lang.IllegalArgumentException if parameter values are + * illegal, freq is not in given range or duration is negative or zero + * @since 1.0 + */ + public void init(int freq, long duration) + { + if (duration < 1 || duration > 10000000) + { + throw(new IllegalArgumentException( + "Bad duration value, must be 1-10000000")); + } + if (freq < 0 || freq > 15000) + { + throw(new IllegalArgumentException( + "Bad frequency value, must be 0-15000")); + } + // if the uninitialised event is sent from native side, it reaches + // listener too late in TCK test sound8004, thus we send the event + // already here + if ((iState != SOUND_UNINITIALIZED) && + (iState != SOUND_REINITIALISING)) + { + iState = SOUND_REINITIALISING; + soundStateChanged(SOUND_UNINITIALIZED); + } // end of if (iState != SOUND_UNINITIALIZED) + + iCurrentType = FORMAT_BEEP; + int err = _init(iHandle, iCurrentType, null, freq, duration); + if (err == ERR_NOT_READY) + { + throw new RuntimeException(Integer.toString(err)); + } + else if (err == ERR_ARGUMENT) + { + throw new IllegalArgumentException("Data is invalid"); + } + iState = SOUND_STOPPED; + } + + /** + * Initializes Sound object based on byte + * array data. The data should contain the data presented in the data + * format specified by type parameter. The Sound class defines also + * generally supported types as constants. + *

    + * All implementations need to support at least Nokia + * Smart Messaging, Over the Air (OTA) ringingtone format. + * The type of this format is FORMAT_TONE. + *

    + * Note: some implementations can't throw exceptions about + * sound data being corrupted or illegal during this method call. + * This will result that IllagalArgumentException is delayed until + * play(int loop) method is called. Applications thus need to except + * that IllegalArgumentException is thrown in this method or during + * play method call. + *

    + * @param data a byte array containing the data to be played + * @param type type of the audio + * @throws java.lang.IllegalArgumentException if the data can not be + recognized to + * given type or the type is unsupported or unknown + * @throws java.lang.NullPointerException if the data is null + * @since 1.0 + */ + public void init(byte[] data, int type) + { + if (!(type == FORMAT_WAV || type == FORMAT_TONE)) + { + throw(new IllegalArgumentException("Type is not supported")); + } + if (data == null) + { + throw(new NullPointerException("Data is null")); + } + + if ((iState != SOUND_UNINITIALIZED) && + (iState != SOUND_REINITIALISING)) + { + iState = SOUND_REINITIALISING; + soundStateChanged(SOUND_UNINITIALIZED); + } // end of if (iState != SOUND_UNINITIALIZED) + + iCurrentType = type; + int err = _init(iHandle, iCurrentType, data, 0, 0); + if (err == ERR_NOT_READY || err == ERR_ARGUMENT ) + { + throw new IllegalArgumentException("Data is invalid"); + } + + iState = SOUND_STOPPED; + } + + + /** + * Get the current state of the Sound object. + * + * @return current state, SOUND_PLAYING, SOUND_STOPPED or + SOUND_UNINITIALIZED + * @since 1.0 + * + */ + public int getState() + { + if (iState == SOUND_REINITIALISING) + { + return SOUND_UNINITIALIZED; + } + + iState = _getState(iHandle); + switch (iState) + { + case(0): // ENotReady + case(4): // EInitialising + iState = SOUND_UNINITIALIZED; + break; + case(1): // EReadyToPlay + iState = SOUND_STOPPED; + break; + case(2): // EPlaying + iState = SOUND_PLAYING; + break; + default: + } + return iState; + } + + /** + * This method is used for starting the playback from the beginning of a + * sound object. The loop parameter defined the loop count for playback. + * Argument zero (0) means continuos looping. For uninitialized sound the + * play method doesn't do anything and silently returns. For stopped and + * playing sounds the playback starts from beginning of the sound with new + * looping information. + *

    + * This method will throw IllegalStateException if playback cannot be + * started since all channels are in use, or playback is not possible + * because there is more higher priority system sounds being played. + *

    + * If Sound playback is possible this method will return immediately and + * thus will not block the calling thread during the playback. If any error + * that prevents the playback is encountered during the playback, the + * playback is silently stopped as if called to the stop method. + * + * @param number number of times audio is played. Value 0 plays audio in + * continous loop. + * @throws java.lang.IllegalStateException if the sound object cannot be + * played because all the channels are already in use. + * @throws java.lang.IllegalArgumentException if the loop value is negative, + * or if sound values/date is illegal or corrupted. + * @since 1.0 + * + */ + public void play(int loop) throws IllegalArgumentException + { + if (loop < 0) + { + throw(new IllegalArgumentException("Negative loop value")); + } + if (iState == SOUND_REINITIALISING) + { + return; + } // end of if (iState == SOUND_REINITIALISING) + + if (iPlayingSound != null) + { + if (iPlayingSound.getState() == SOUND_PLAYING) + { + iPlayingSound.stop(); + } + } // end of if (iPlayingSound != null) + + int error = _play(iHandle, loop); + if ((error == NOT_SUPPORTED_ERROR)) + { + throw(new IllegalArgumentException("Sound is not supported")); + } + iPlayingSound = this; + } + + /** + * The method will stop the sound playback, storing the current position. + * For sound that has never been started (may be uninitialized), or is + * currently being stopped the method call doesn't do anything and returns + * silently. + * + * Note that for tone based sounds it is not possible to resume from + * position the sound was stopped at, to be specific, stop will reset + * the position to the beginning of the sound. + * @since 1.0 + */ + public void stop() + { + if (iState == SOUND_REINITIALISING) + { + return; + } // end of if (iState == SOUND_REINITIALISING) + _stop(iHandle); + } + + /** + * The method will continue the stopped sound object from the position it + * was stopped to. For sound that has never been started (may be + * uninitialized), or is currently being played the method call doesn't + * do anything. + *

    + * Note: For tone based sounds the resume starts the sound from the + * beginning of the sound clip. + * @since 1.0 + * + */ + public void resume() + { + if (iState == SOUND_REINITIALISING) + { + return; + } // end of if (iState == SOUND_REINITIALISING) + _resume(iHandle); + } + + /** + * Sets the gain for the sound object. The gain is a value between + * 0 and 255. Implementation scales the gain value to the limits it + * supports. Notice that any gain value > 0 should result a gain + * value > 0. If the gain is smaller than this minimum value then + * gain is set to 0, if the gain greater than this maximum value + * then the gain is set to maximum value (255). + * + * @param gain gain value: 0 - 255 + * @throws java.lang.IllegalArgumentException if the gain not 0 - 255 + * @since 1.0 + */ + public void setGain(int gain) + { + if (iState == SOUND_REINITIALISING) + { + return; + } // end of if (iState == SOUND_REINITIALISING) + if (gain < 0) + { + gain = 0; + } + else if (gain > 255) + { + gain = 255; + } + iGain = gain; + _setVolume(iHandle, iGain); + } + + /** + * Get the gain (or volume) of Sound object. The gain is a value + * between 0 and 255. System returns a scaled value based on the + * limits it supports. Notice that any system gain value > 0 should + * return a gain value > 0. + * + * @return gain value 0 - 255 + * @since 1.0 + * + */ + public int getGain() + { + if (iGain == -1) + { + return _volume(iHandle); + } + // we have previously set gain + return iGain; + } + + /** + * Returns number of concurrent sounds the device can play for + * specific audio type. Returns 1 if only one sound can be played + * at a time. Notice that most types use same channel resources. + * @return total number of available channels. + * @param type the media type + * @throws java.lang.IllegalArgumentException if the type is unsupported + * or unknown + * @since 1.0 + */ + public static int getConcurrentSoundCount(int type) + { + if ((type != FORMAT_TONE) && (type != FORMAT_WAV)) + { + throw(new IllegalArgumentException("Type is not supported")); + } + + return 1; + } + + /** + * Returns the supported audio formats as an int array. + * + * @return an array containing supported audio formats as + * int values (e.g. FORMAT_TONE, FORMAT_WAV), + * or an empty array if no audio formats are supported. + * @since 1.0 + */ + static public int[] getSupportedFormats() + { + return(new int[] { FORMAT_TONE, FORMAT_WAV }); + } + + /** + * Registeres a listener for playback state notifications. + * @see com.nokia.mid.sound.SoundListener + * @param listener a listener that is notified when state + * changes occur or null if listener is to be + * removed. + * @since 1.0 + * + */ + public void setSoundListener(SoundListener listener) + { + iSoundListeners.addElement(listener); + } + + /** + * Callback method when sound state changes + * + */ + public void soundStateChanged(final int event) + { + /* + for(int i = 0; i < iSoundListeners.size(); i++) + { + ((SoundListener)iSoundListeners.elementAt(i)).soundStateChanged(this, event); + } + */ + //Notify SoundState Listeners in a separate thread, so that application doesn't + //block main thread + new Thread(new Runnable() + { + public void run() + { + notifySoundStateListeners(event); + } + }).start(); + } + + /** + * Notify Sound State Listeners + */ + public synchronized void notifySoundStateListeners(int event) + { + for (int i = 0; i < iSoundListeners.size(); i++) + { + ((SoundListener)iSoundListeners.elementAt(i)).soundStateChanged(this, event); + } + } + + private native void _dispose(int aHandle); + private native int _create(); + private native int _init(int aHandle, int aType, + byte[] aData, + int aFrequency, long aDuration); + private native void _release(int aHandle); + private native int _play(int aHandle, int aLoop); + private native void _stop(int aHandle); + private native void _resume(int aHandle); + private native void _setVolume(int aHandle, int aVolume); + private native int _volume(int aHandle); + private native int _getState(int aHandle); + +} //End of Sound class + diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/javasrc/com/nokia/mid/sound/SoundListener.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/javasrc/com/nokia/mid/sound/SoundListener.java Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2006 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: Interface indicating changes in the playback state. +* +*/ + + +package com.nokia.mid.sound; + +/** + *

    + * This interface is used by applications which need to receive events + * that indicate changes in the playback state of the Sound objects. + *

    + * @see com.nokia.mid.sound.Sound + * @version 1.1 + * @since 1.0 + */ + +public interface SoundListener +{ + + /** + * Called when playback state of an Sound has been changed. + * Listener will be notified when playback has been started + * or stopped. + * @see com.nokia.mid.sound.Sound#setSoundListener(SoundListener listener) + * @see com.nokia.mid.sound.Sound#SOUND_PLAYING + * @see com.nokia.mid.sound.Sound#SOUND_STOPPED + * @param sound the sound object this event relates to + * @param event the sound changed event, SOUND_PLAYING or SOUND_STOPPED + * @since 1.0 + */ + public abstract void soundStateChanged(Sound sound, int event); + +} diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/src/CMIDSoundImpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/src/CMIDSoundImpl.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2006 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: Interface and a base class for CMIDClip and CMIDTone. +* +*/ + + +#include "CMIDSoundImpl.h" +#include "CMIDSoundEvent.h" +#include "com_nokia_mid_sound_Sound.h" + +CMIDSoundImpl::~CMIDSoundImpl() +{ + +} + +CMIDSoundImpl::CMIDSoundImpl(MMIDEventSender* aEventSender) +{ + iEventSender = aEventSender; +} + +void CMIDSoundImpl::ConstructL() +{ + +} + +void CMIDSoundImpl::Resume() +{ + if (iPlayed && (iState == EReadyToPlay)) + { + Play(1); + } +} diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/src/cmidclip.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/src/cmidclip.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,196 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class implements wav playing. +* +*/ + + +#include +#include + +#include "com_nokia_mid_sound_Sound.h" +#include "CMIDClip.h" +#include "MMIDEventSender.h" + +namespace +{ +const TInt KMIDMaxJavaVolume = 255; +const TInt KMIDMinNativeVolume = 1; +const TInt KMIDHeaderLength = 4; +_LIT8(KMIDHeaderWAV, "RIFF"); +_LIT8(KMIDHeaderAMR, "#!AM"); +const TInt KMIDClipForever = 999999; +const TInt KMIDMinDataSize = 4; +} + +CMIDClip* CMIDClip::NewL(const TDesC8* aData, MMIDEventSender* aEventSender) +{ + CMIDClip* self = new(ELeave) CMIDClip(aEventSender); + CleanupStack::PushL(self); + self->ConstructL(aData); + CleanupStack::Pop(self); + return self; +} + +CMIDClip::~CMIDClip() +{ + if (iMdaAudioPlayerUtility) + { + if (iState == EPlaying) + { + iMdaAudioPlayerUtility->Stop(); + } + } + delete iMdaAudioPlayerUtility; + delete iClip; + delete iSchedulerWait; +} + +CMIDClip::CMIDClip(MMIDEventSender* aEventSender) + : CMIDSoundImpl(aEventSender) +{ +} + +void CMIDClip::ConstructL(const TDesC8* aData) +{ + CMIDSoundImpl::ConstructL(); + iSchedulerWait = new(ELeave) CActiveSchedulerWait; + + if (aData->Length() < KMIDMinDataSize) + { + iState = ENotSupported; + User::Leave(KErrArgument); + } + + TPtrC8 header = aData->Left(KMIDHeaderLength); + + if ((header != KMIDHeaderWAV()) && (header != KMIDHeaderAMR)) + { + iState = ENotSupported; + User::Leave(KErrArgument); + } + + iState = EInitialising; + iClip = aData->AllocL(); + iMdaAudioPlayerUtility = + CMdaAudioPlayerUtility:: + NewDesPlayerReadOnlyL(*iClip, *this, + KAudioPriorityRecording); + iMdaAudioPlayerUtility->UseSharedHeap(); + iSchedulerWait->Start(); +} + +TInt CMIDClip::Play(TInt aLoop) +{ + __ASSERT_DEBUG(iState == EReadyToPlay, User::Invariant()); + + if (aLoop == 0) + { + // There is no known working method to play clip forever, so we play + // it for a long time instead. + aLoop = KMIDClipForever; + } + + --aLoop; + + // Setting repeats to 1 causes sound played twice + if (aLoop > 0) + { + iMdaAudioPlayerUtility->SetRepeats(aLoop, TTimeIntervalMicroSeconds(0)); + } + + iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_PLAYING); + + iMdaAudioPlayerUtility->Play(); + iState = EPlaying; + iPlayed = ETrue; + return KErrNone; +} + +void CMIDClip::Stop() +{ + if (iState == EPlaying) + { + iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED); + iMdaAudioPlayerUtility->Stop(); + iState = EReadyToPlay; + } +} + +void CMIDClip::SetVolume(TInt aVolume) +{ + iVolume = aVolume; + TInt volume = 0; + if (aVolume) + { + volume = (((iMdaAudioPlayerUtility->MaxVolume() + - KMIDMinNativeVolume + 1) + * aVolume) + / (KMIDMaxJavaVolume + 1)) + KMIDMinNativeVolume; + } + iMdaAudioPlayerUtility->SetVolume(volume); +} + +TInt CMIDClip::Volume() +{ + return iVolume; +} + +void CMIDClip::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/) +{ + if (aError == KErrNone) + { + //Setting iVolume to max because + //CMdaAudioPlayerUtility doesn't have Volume() + iVolume = KMIDMaxJavaVolume; + iState = EReadyToPlay; + } + else + { + if (aError == KErrNotSupported) + { + iState = ENotSupported; + } + else + { + iState = ENotReady; + } + } + iSchedulerWait->AsyncStop(); +} + +void CMIDClip::MapcPlayComplete(TInt /*aError*/) +{ + iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED); + iState = EReadyToPlay; +} + +void CMIDClip::Release() +{ + if (iMdaAudioPlayerUtility) + { + if (iState == EPlaying) + { + iMdaAudioPlayerUtility->Stop(); + } + } + delete iMdaAudioPlayerUtility; + iMdaAudioPlayerUtility = NULL; + delete iClip; + iClip = NULL; + iState = ENotReady; +} + +//End of File + diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/src/cmidsound.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/src/cmidsound.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,309 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Wrapper for CMIDClip and CMIDTone class initialisations. +* +*/ + + +#include +#include +#include + +#include "CMIDSound.h" +#include "CMIDTone.h" +#include "CMIDClip.h" +#include "logger.h" +#include "fs_methodcall.h" +#include "com_nokia_mid_sound_Sound.h" + + +CMIDSound* CMIDSound::NewL(JNIEnv& aJni, jobject aPeer) +{ + JELOG2(EJavaUI); + + CMIDSound* self = new CMIDSound(); + if (self != NULL) + { + self->attachToVm(aJni, aPeer); + } + return self; +} + +CMIDSound::~CMIDSound() +{ + delete iMIDSound; + + // CENREP + if (iProfileListener) + { + iProfileListener->StopListening(); + delete iProfileListener; + } + delete iRepository; +} + +void CMIDSound::HandleNotifyInt(TUint32 aId, TInt aNewValue) +{ + JELOG2(EJavaUI); + if (aId == KProEngActiveWarningTones) + { + if (iMIDSound) + { + iMIDSound->SetVolume(aNewValue == 0 ? 0 : iRealVolume); + } + } +} + +void CMIDSound::SendEvent(TInt aEventType) +{ + /** + *Callback to Java + */ + JELOG2(EJavaUI); + + jclass javaPeerClass = mJniEnv->FindClass("com/nokia/mid/sound/Sound"); + + jmethodID soundStateChangeCallback = mJniEnv->GetMethodID( + javaPeerClass /*mJavaPeerClass */, "soundStateChanged", "(I)V"); + + + mJniEnv->CallVoidMethod(mJavaPeerObject, soundStateChangeCallback, + aEventType); +} + +CMIDSound::CMIDSound() + : java::util::FunctionServer("CMIDSoundFunctionServer"), + iMIDSound(0) +{ + JELOG2(EJavaUI); + createServerToNewThread(); +} + +int CMIDSound::InitProfileListener() +{ + TRAPD(err, CallMethodL(this, &CMIDSound::InitProfileListenerL, this)); + return err; +} + +void CMIDSound::InitProfileListenerL() +{ + JELOG2(EJavaUI); + // repository for profile + iRepository = CRepository::NewL(KCRUidProfileEngine); + + // get notifies about changes in KProEngActiveWarningTones + iProfileListener = CCenRepNotifyHandler::NewL(*this, + *iRepository, + CCenRepNotifyHandler::EIntKey, + KProEngActiveWarningTones); + + // Changes will be informed to HandleNotifyInt + iProfileListener->StartListeningL(); +} + +TBool CMIDSound::IsAudioEnabled(/*CMIDSound* aSelf*/) +{ + JELOG2(EJavaUI); + TInt isProfileOn = 0; + TInt error = iRepository->Get(KProEngActiveWarningTones, isProfileOn); + TBool retVal = EFalse; + + // If getting profile status fails do not play any tones. + if ((isProfileOn == 1) && + (error == KErrNone)) + { + retVal = ETrue; + } + return retVal; +} + +void CMIDSound::SetBeep(TInt aFreq, TInt64 aDuration) +{ + JELOG2(EJavaUI); + iFreq = aFreq; + iDur = aDuration; +} + +TInt CMIDSound::Init(TInt aType, const TDesC8* aData) +{ + JELOG2(EJavaUI); + TRAPD(err, CallMethodL(this, &CMIDSound::InitL, aType, aData, this)); + return err; +} + +void CMIDSound::InitL(TInt aType, const TDesC8* aData) +{ + JELOG2(EJavaUI); + + if (iMIDSound) + { + if (iMIDSound->State() == CMIDSoundImpl::EInitialising) + { + return; + } + if (iMIDSound->State() == CMIDSoundImpl::EReadyToPlay || + iMIDSound->State() == CMIDSoundImpl::EPlaying) + { + iMIDSound->Release(); + } + } + + CMIDSoundImpl* soundImpl = NULL; + switch (aType) + { + case com_nokia_mid_sound_Sound_FORMAT_TONE: //Tone + { + soundImpl = CMIDTone::NewL(*aData, this); + break; + } + case com_nokia_mid_sound_Sound_FORMAT_BEEP: //Beep + { + soundImpl = CMIDTone::NewL(iFreq, iDur, this); + break; + } + case com_nokia_mid_sound_Sound_FORMAT_WAV: //Wav + { + soundImpl = CMIDClip::NewL(aData, this); + break; + } + default: + { + break; + } + } + if (soundImpl->State() != CMIDSoundImpl::EReadyToPlay) + { + TInt state = soundImpl->State(); + delete soundImpl; + User::Leave(KErrNotReady); + } + iRealVolume = soundImpl->Volume(); + + delete iMIDSound; + iMIDSound = soundImpl; +} + +TInt CMIDSound::Play(TInt aLoop) +{ + JELOG2(EJavaUI); + TInt err = 0; + CallMethod(err, this, &CMIDSound::DoPlay, aLoop, this); + return err; +} + +TInt CMIDSound::DoPlay(TInt aLoop) +{ + JELOG2(EJavaUI); + + if ( iMIDSound ) + { + TInt state = iMIDSound->State(); + if (state != CMIDSoundImpl::EReadyToPlay) + { + return state; + } + } + else + { + return CMIDSoundImpl::ENotSupported; + } + if (!IsAudioEnabled()) + { + iMIDSound->SetVolume(0); + } + return iMIDSound->Play(aLoop); +} + +void CMIDSound::Resume() +{ + JELOG2(EJavaUI); + CallMethod(this, &CMIDSound::DoResume, this); +} + +void CMIDSound::DoResume() +{ + JELOG2(EJavaUI); + iMIDSound->Resume(); +} + +void CMIDSound::Stop() +{ + JELOG2(EJavaUI); + CallMethod(this, &CMIDSound::DoStop, this); +} + +void CMIDSound::DoStop() +{ + JELOG2(EJavaUI); + iMIDSound->Stop(); +} + +TInt CMIDSound::SoundVolume() +{ + JELOG2(EJavaUI); + TInt result = 0; + CallMethod(result, this, &CMIDSound::Volume, this); + return result; +} + +TInt CMIDSound::Volume() +{ + JELOG2(EJavaUI); + return iMIDSound->Volume(); +} + +void CMIDSound::SetVolume(TInt aVolume) +{ + JELOG2(EJavaUI); + CallMethod(this, &CMIDSound::DoSetVolume, aVolume, this); +} + +void CMIDSound::DoSetVolume(TInt aVolume) +{ + JELOG2(EJavaUI); + iRealVolume = aVolume; + TInt currentState = iMIDSound->State(); + if ((currentState == CMIDSoundImpl::EReadyToPlay) || + (currentState == CMIDSoundImpl::EPlaying)) + { + iMIDSound->SetVolume(IsAudioEnabled() ? aVolume : 0); + } +} + + +TInt CMIDSound::PlayerState() +{ + JELOG2(EJavaUI); + TInt result = 0; + CallMethod(result, this, &CMIDSound::State, this); + return result; +} + +TInt CMIDSound::State() +{ + JELOG2(EJavaUI); + return iMIDSound->State(); +} + +void CMIDSound::Release() +{ + JELOG2(EJavaUI); + CallMethod(this, &CMIDSound::DoRelease, this); +} + +void CMIDSound::DoRelease() +{ + JELOG2(EJavaUI); + iMIDSound->Release(); +} diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/src/cmidtone.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/src/cmidtone.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,244 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This class implements beep playing and OTA ringingtone playing. +* +*/ + + +#include +#include + +#include "com_nokia_mid_sound_Sound.h" +#include "CMIDTone.h" +#include "MMIDEventSender.h" + +namespace +{ +const TInt KMIDMaxJavaVolume = 255; +const TInt KMIDMinNativeVolume = 1; +const TInt KMIDStopSleepTime = 10000; +const TInt KMIDMicrosInMilli = 1000; +const TInt KMIDMinDataLength = 4; +const TInt KMIDLoopForever = 999999; +} + +CMIDTone* CMIDTone::NewL(TInt aFreq, TInt64 aDuration, + MMIDEventSender* aEventSender) +{ + CMIDTone* self = new(ELeave) CMIDTone(aEventSender); + CleanupStack::PushL(self); + self->ConstructL(aFreq, aDuration); + CleanupStack::Pop(self); + return self; +} + +CMIDTone* CMIDTone::NewL(const TDesC8& aData, MMIDEventSender* aEventSender) +{ + CMIDTone* self = new(ELeave) CMIDTone(aEventSender); + CleanupStack::PushL(self); + self->ConstructL(aData); + CleanupStack::Pop(self); + return self; +} + + +CMIDTone::~CMIDTone() +{ + if (iMdaAudioToneUtility) + { + if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityNotReady) + { + iMdaAudioToneUtility->CancelPrepare(); + } + else if (iMdaAudioToneUtility->State() + == EMdaAudioToneUtilityPlaying) + { + iMdaAudioToneUtility->CancelPlay(); + } + } + delete iMdaAudioToneUtility; + delete iSchedulerWait; +} + +CMIDTone::CMIDTone(MMIDEventSender* aEventSender) + : CMIDSoundImpl(aEventSender) +{ +} + +void CMIDTone::ConstructL(TInt aFreq, TInt64 aDuration) +{ + CMIDSoundImpl::ConstructL(); + iSchedulerWait = new(ELeave) CActiveSchedulerWait; + iFreq = aFreq; + iDuration = aDuration; + iState = EInitialising; + iMdaAudioToneUtility = CMdaAudioToneUtility::NewL(*this); + iMdaAudioToneUtility->PrepareToPlayTone(iFreq, + TTimeIntervalMicroSeconds(iDuration * KMIDMicrosInMilli)); + iSchedulerWait->Start(); +} + +void CMIDTone::ConstructL(const TDesC8& aData) +{ + CMIDSoundImpl::ConstructL(); + iSchedulerWait = new(ELeave) CActiveSchedulerWait; + // first byte is the number of command parts + iFreq = 0; + iDuration = 0; + iState = EInitialising; + + if (aData.Length() < KMIDMinDataLength) + { + iState = ENotSupported; + User::Leave(KErrArgument); + } + + if (aData[0x000] == 0x02 && aData[0x001] == 0x4a && aData[0x002] == 0x3a) + { + iState = EInitialising; + } + else if (aData[0x000] == 0x03 && aData[0x001] == 0x4a && aData[0x002] == + 0x44 && aData[0x003] == 0x3a) + { + iState = EInitialising; + } + else if (aData[0] == 0x00 && aData[1] == 0x11) + { + iState = EInitialising; + } + else + { + iState = ENotSupported; + User::Leave(KErrArgument); + } + iMdaAudioToneUtility = CMdaAudioToneUtility::NewL(*this); + iMdaAudioToneUtility->PrepareToPlayDesSequence(aData); + iSchedulerWait->Start(); + +} + +TInt CMIDTone::Play(TInt aLoop) +{ + __ASSERT_DEBUG(iState == EReadyToPlay, User::Invariant()); + + if (aLoop == 0) + { + // There is no known working method to play tone forever + aLoop = KMIDLoopForever; + } + + // Setting repeats to 1 causes sound played twice + if (aLoop == 1) + { + iMdaAudioToneUtility->SetRepeats(0, TTimeIntervalMicroSeconds(0)); + } + else if (aLoop > 1) + { + iMdaAudioToneUtility->SetRepeats(aLoop, TTimeIntervalMicroSeconds(0)); + } + + iMdaAudioToneUtility->Play(); + + iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_PLAYING); + iState = EPlaying; + iPlayed = ETrue; + + return KErrNone; +} + +void CMIDTone::Stop() +{ + if (iState == EPlaying) + { + iMdaAudioToneUtility->CancelPlay(); + // sleep to make sure the device has time to stop + User::After(TTimeIntervalMicroSeconds32(KMIDStopSleepTime)); // CSI: 92 MdaAudioToneUtility does not send event when stopping has finished # + iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED); + iState = EReadyToPlay; + } +} + +void CMIDTone::SetVolume(TInt aVolume) +{ + TInt maxVolume = iMdaAudioToneUtility->MaxVolume(); + TInt volume = 0; + if (aVolume) + { + volume = (((maxVolume + - KMIDMinNativeVolume + 1) + * aVolume) + / (KMIDMaxJavaVolume + 1)) + KMIDMinNativeVolume; + } + iMdaAudioToneUtility->SetVolume(volume); +} + +TInt CMIDTone::Volume() +{ + TInt maxVolume = iMdaAudioToneUtility->MaxVolume(); + TInt volume = (iMdaAudioToneUtility->Volume() * + KMIDMaxJavaVolume) / maxVolume; + + return volume; +} + +void CMIDTone::MatoPrepareComplete(TInt aError) +{ + if (aError == KErrNone) + { + iState = EReadyToPlay; + } + else + { + if (aError == KErrNotSupported) + { + iState = ENotSupported; + } + else + { + iState = ENotReady; + } + } + iSchedulerWait->AsyncStop(); +} + +void CMIDTone::MatoPlayComplete(TInt aError) +{ + if (KErrNone == aError) + { + iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED); + iState = EReadyToPlay; + } +} + +void CMIDTone::Release() +{ + iState = ENotReady; + if (iMdaAudioToneUtility) + { + if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityNotReady) + { + iMdaAudioToneUtility->CancelPrepare(); + } + else if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityPlaying + || iState == EPlaying) + { + iMdaAudioToneUtility->CancelPlay(); + } + } + delete iMdaAudioToneUtility; + iMdaAudioToneUtility = NULL; + iState = ENotReady; +} + +// End of File diff -r 461e71b327da -r 0553e2305d00 javauis/nokiasound_akn/src/sound.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound_akn/src/sound.cpp Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,209 @@ +/* +* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: JNI class for Sound.java. +* +*/ + + +#include // MAKE_TINT64 Warning fix + +#include "com_nokia_mid_sound_Sound.h" +#include "CMIDSound.h" +#include "javajniutils.h" +#include "javacommonutils.h" +#include "logger.h" + +/* + * Class: com_nokia_mid_sound_Sound + * Method: _dispose + * Signature: (II)V + */ +JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1dispose +(JNIEnv* /* aJni */, jobject /* aSound */, jint aHandle) +{ + JELOG2(EJavaUI); + CMIDSound* sound = reinterpret_cast(aHandle); + delete sound; +} + +/* + * Class: com_nokia_mid_sound_Sound + * Method: _create + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1create +(JNIEnv* aJni, jobject aSound) +{ + JELOG2(EJavaUI); + + TInt handle(0); + CMIDSound* sound = 0; + TRAPD(err, + { + sound = CMIDSound::NewL(*aJni, aSound); + if (sound != 0) + { + sound->InitProfileListener(); + } + }); + + if (err != KErrNone) + { + + java::util::JniUtils::throwNewException(aJni, "java/lang/RuntimeException" , + "Failed to create Native Peer " + + java::util::JavaCommonUtils::intToString(err)); + } + else + { + + handle = reinterpret_cast(sound); + } + return handle; +} + +/* + * Class: com_nokia_mid_sound_Sound + * Method: _init + * Signature: (III[BIJ)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1init +(JNIEnv* aJni, jobject, jint aHandle, jint aType, jbyteArray aData, + jint aFrequency, jlong aDuration) +{ + JELOG2(EJavaUI); + TInt freq(aFrequency); + TInt64 duration = *reinterpret_cast(&aDuration); + + CMIDSound* sound = reinterpret_cast(aHandle); + + TPtrC8 ptr; + jbyte* data = NULL; + + if (aType != com_nokia_mid_sound_Sound_FORMAT_BEEP) + { + if (!aData) + { + return KErrGeneral; + } + data = aJni->GetByteArrayElements(aData,0); + jint length = aJni->GetArrayLength(aData); + ptr.Set((TUint8*)data, length); + } + + // Had to make SetBeep() due to number of maximum parameters in ExecuteTrap. + sound->SetBeep(freq, duration); + TInt err = sound->Init(aType, (const TDesC8*)&ptr); + + if (aType != com_nokia_mid_sound_Sound_FORMAT_BEEP) + { + aJni->ReleaseByteArrayElements(aData, data, 0); + } + return err; +} + +/* + * Class: com_nokia_mid_sound_Sound + * Method: _release + * Signature: (II)V + */ +JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1release +(JNIEnv*, jobject, jint aHandle) +{ + JELOG2(EJavaUI); + CMIDSound* sound = reinterpret_cast(aHandle); + sound->Release(); +} + + +/* + * Class: com_nokia_mid_sound_Sound + * Method: _play + * Signature: (II)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1play +(JNIEnv*, jobject, jint aHandle, jint aLoop) +{ + JELOG2(EJavaUI); + CMIDSound* sound = reinterpret_cast(aHandle); + TInt err = sound->Play(aLoop); + return err; +} + +/* + * Class: com_nokia_mid_sound_Sound + * Method: _stop + * Signature: (II)V + */ +JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1stop +(JNIEnv*, jobject, jint aHandle) +{ + JELOG2(EJavaUI); + CMIDSound* sound = reinterpret_cast(aHandle); + sound->Stop(); +} + +/* + * Class: com_nokia_mid_sound_Sound + * Method: _resume + * Signature: (II)V + */ +JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1resume +(JNIEnv*, jobject, jint aHandle) +{ + JELOG2(EJavaUI); + CMIDSound* sound = reinterpret_cast(aHandle); + sound->Resume(); +} + +/* + * Class: com_nokia_mid_sound_Sound + * Method: _setVolume + * Signature: (III)V + */ +JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1setVolume +(JNIEnv*, jobject, jint aHandle, jint aVolume) +{ + JELOG2(EJavaUI); + CMIDSound* sound = reinterpret_cast(aHandle); + sound->SetVolume(aVolume); +} + +/* + * Class: com_nokia_mid_sound_Sound + * Method: _volume + * Signature: (II)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1volume +(JNIEnv*, jobject, jint aHandle) +{ + JELOG2(EJavaUI); + CMIDSound* sound = reinterpret_cast(aHandle); + TInt volume = sound->SoundVolume(); + return(volume); +} + +/* + * Class: com_nokia_mid_sound_Sound + * Method: _getState + * Signature: (II)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1getState +(JNIEnv*, jobject, jint aHandle) +{ + JELOG2(EJavaUI); + CMIDSound* sound = reinterpret_cast(aHandle); + TInt state = sound->PlayerState(); + return state; +} diff -r 461e71b327da -r 0553e2305d00 javauis/remconobserver_akn/build/javaremconobserver_0x2002DCCA.mmp --- a/javauis/remconobserver_akn/build/javaremconobserver_0x2002DCCA.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/remconobserver_akn/build/javaremconobserver_0x2002DCCA.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javauis/runtimeui_akn/build/javaruntimeui_0x2002DCCD.mmp --- a/javauis/runtimeui_akn/build/javaruntimeui_0x2002DCCD.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/runtimeui_akn/build/javaruntimeui_0x2002DCCD.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../src.s60 diff -r 461e71b327da -r 0553e2305d00 javauis/runtimeui_akn/loc/javausermessages.loc --- a/javauis/runtimeui_akn/loc/javausermessages.loc Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/runtimeui_akn/loc/javausermessages.loc Fri Oct 22 14:23:56 2010 +0100 @@ -450,18 +450,6 @@ #define qtn_java_secur_error_drm_rights_not_valid "No digital rights to launch application." // d:Security error message: -// d:short error message -// l:popup_info_list_pane_t1 -// -#define qtn_java_secur_error_jar_not_found "Application's deployment package not found." - -// d:Security error message: -// d:short error message -// l:popup_info_list_pane_t1 -// -#define qtn_java_secur_error_jar_not_found_details "Possible reasons for the missing files: the files might reside on a memory card which is not currently present or has been formatted." - -// d:Security error message: // d:detailed error message // l:popup_info_list_pane_t1 // diff -r 461e71b327da -r 0553e2305d00 javauis/softnotification_akn/build/javasoftnotification_0x2002DCD6.mmp --- a/javauis/softnotification_akn/build/javasoftnotification_0x2002DCD6.mmp Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/softnotification_akn/build/javasoftnotification_0x2002DCD6.mmp Fri Oct 22 14:23:56 2010 +0100 @@ -52,6 +52,7 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 +MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 461e71b327da -r 0553e2305d00 javauis/subsystem.mk --- a/javauis/subsystem.mk Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/subsystem.mk Fri Oct 22 14:23:56 2010 +0100 @@ -23,16 +23,13 @@ NONQTSUBSYSTEMS += \ coreui/build -COMPONENTS += nokiasound/build # # Common legacy utilities # SUBSYSTEMS += javalegacyutils - -SYMBIAN_ONLY += javalegacyutils nokiasound/build - +SYMBIAN_ONLY += javalegacyutils # diff -r 461e71b327da -r 0553e2305d00 javauis/subsystem_akn.mk --- a/javauis/subsystem_akn.mk Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/subsystem_akn.mk Fri Oct 22 14:23:56 2010 +0100 @@ -22,6 +22,7 @@ m2g_akn/build \ m3g_akn/build \ mmapi_akn/build \ + nokiasound_akn/build \ remconobserver_akn/build \ runtimeui_akn/build \ softnotification_akn/build diff -r 461e71b327da -r 0553e2305d00 javauis/subsystem_qt.mk --- a/javauis/subsystem_qt.mk Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/subsystem_qt.mk Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2009, 2010 Nokia Corporation and/or its subsidiary(-ies). +# 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" @@ -14,10 +14,6 @@ # Description: Makefile for Qt based components and subsystems # -SUBSYSTEMS += eswt_qt/build -COMPONENTS += lcdui_qt/build runtimeui_qt/build nokiauiapi_qt/build mmapi_qt/build amms_qt/build m3g_qt/build +COMPONENTS += eswt_qt/build lcdui_qt/build runtimeui_qt/build nokiauiapi_qt/build mmapi_qt/build amms_qt/build SYMBIAN_ONLY += mmapi_qt/build amms_qt/build m3g_qt/build - -# Build order dependency -lcdui_qt/build runtimeui_qt/build nokiauiapi_qt/build mmapi_qt/build amms_qt/build m3g_qt/build: eswt_qt/build diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_Alert_01/build.xml --- a/javauis/tsrc/fute/lcdui/Midp_Alert_01/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_Alert_01/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -28,7 +28,7 @@ - + diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_Alert_01/src/AlertTests.java --- a/javauis/tsrc/fute/lcdui/Midp_Alert_01/src/AlertTests.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_Alert_01/src/AlertTests.java Fri Oct 22 14:23:56 2010 +0100 @@ -156,14 +156,6 @@ errorAlert.setTimeout(Alert.FOREVER); Display.getDisplay(parent).setCurrent(errorAlert); } - catch (IllegalArgumentException e) - { - System.out.println("Exception: " + e.toString()); - Alert errorAlert = new Alert("Exception", e.toString(), null, - AlertType.ERROR); - errorAlert.setTimeout(Alert.FOREVER); - Display.getDisplay(parent).setCurrent(errorAlert); - } } else if (c == cmdExit) { diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_Form_01/build.xml --- a/javauis/tsrc/fute/lcdui/Midp_Form_01/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_Form_01/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -28,7 +28,7 @@ - + diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_Form_01/src/FormMethodsTests.java --- a/javauis/tsrc/fute/lcdui/Midp_Form_01/src/FormMethodsTests.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_Form_01/src/FormMethodsTests.java Fri Oct 22 14:23:56 2010 +0100 @@ -56,7 +56,7 @@ private final String imgStr = "ImageItem"; - private final String spacerStr = "Spacer (100x100)"; + private final String spacerStr = "Spacer"; private ChoiceGroup cg = null; @@ -324,7 +324,7 @@ else if (item.equals(imgStr)) addImageItem(); else if (item.equals(spacerStr)) - addSpacer(100,100); + addSpacer(10,10); else if (item.equals(tfStr)) { addTextField("ANY", TextField.ANY); diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General/build.xml --- a/javauis/tsrc/fute/lcdui/Midp_General/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General/res/small.png Binary file javauis/tsrc/fute/lcdui/Midp_General/res/small.png has changed diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General/src/EmptyForm.java --- a/javauis/tsrc/fute/lcdui/Midp_General/src/EmptyForm.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -/** - * import midp classes. - */ -import javax.microedition.midlet.*; -import javax.microedition.lcdui.*; - -/** - * This is the main class for the empty Form. - */ - -public class EmptyForm extends Form -{ - - /** - * The constructor creates and displays the Form. - * - *@param parent is the parent midlet. - */ - public EmptyForm(MIDlet parent) - { - super(parent.getClass().getName()); - Display.getDisplay(parent).setCurrent(this); - } -} diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_01.java --- a/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_01.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -/** - * import midp classes. - */ -import javax.microedition.midlet.*; -import javax.microedition.lcdui.*; - -/** - * This is the main class for the Midp_General_01 tests. - */ - -public class Midp_General_01 extends MIDlet implements CommandListener -{ - private Form theForm; - private Command cmdExit = new Command("Exit", Command.EXIT, 1); - - /** - * Signals the MIDlet to start and enter the Active state. - */ - protected void startApp() - { - theForm = new EmptyForm(this); - theForm.addCommand(cmdExit); - theForm.setCommandListener(this); - } - - /** - * Signals the MIDlet to terminate and enter the Destroyed state. - * - */ - protected void destroyApp(boolean unconditional) - { - } - - /** - * Signals the MIDlet to stop and enter the Paused state. - */ - protected void pauseApp() - { - } - - /** - * This method handles command invocations. - * - *@param c This is the command responsible for the event. - *@param s Should be equal to this. - */ - public void commandAction(Command c, Displayable s) - { - if (c == cmdExit) - { - destroyApp(false); - notifyDestroyed(); - } - } -} diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_02.java --- a/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_02.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -/** - * import midp classes. - */ -import javax.microedition.midlet.*; -import javax.microedition.lcdui.*; - -/** - * This is the main class for the Midp_General_02 tests. - */ - -public class Midp_General_02 extends MIDlet implements CommandListener -{ - - TextBox tb; - Display display; - private Command cmdExit = new Command("Exit", Command.EXIT, 1); - - String theText = "This is a TextBox with very long text blah blah blah blah blah blah" + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" + - "This is the last sentence."; - - public Midp_General_02() - { - tb = new TextBox("TextBox", theText, 1000, TextField.ANY); - tb.addCommand(cmdExit); - tb.setCommandListener(this); - display = Display.getDisplay(this); - } - - /** - * Signals the MIDlet to start and enter the Active state. - */ - protected void startApp() - { - display.setCurrent(tb); - } - - /** - * Signals the MIDlet to terminate and enter the Destroyed state. - * - */ - protected void destroyApp(boolean unconditional) - { - } - - /** - * Signals the MIDlet to stop and enter the Paused state. - */ - protected void pauseApp() - { - } - - /** - * This method handles command invocations. - * - *@param c This is the command responsible for the event. - *@param s Should be equal to this. - */ - public void commandAction(Command c, Displayable s) - { - if (c == cmdExit) - { - destroyApp(false); - notifyDestroyed(); - } - } -} diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_03.java --- a/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_03.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -/** - * import midp classes. - */ -import javax.microedition.midlet.*; -import javax.microedition.lcdui.*; - -/** - * This is the main class for the Midp_General_03 tests. - */ - -public class Midp_General_03 extends MIDlet implements CommandListener -{ - - private List emptyList; - private Display display; - private Command cmdExit = new Command("Exit", Command.EXIT, 1); - - public Midp_General_03() - { - emptyList = new List("List", List.EXCLUSIVE); - emptyList.addCommand(cmdExit); - emptyList.setCommandListener(this); - display = Display.getDisplay(this); - } - - /** - * Signals the MIDlet to start and enter the Active state. - */ - protected void startApp() - { - display.setCurrent(emptyList); - } - - /** - * Signals the MIDlet to terminate and enter the Destroyed state. - * - */ - protected void destroyApp(boolean unconditional) - { - } - - /** - * Signals the MIDlet to stop and enter the Paused state. - */ - protected void pauseApp() - { - } - - /** - * This method handles command invocations. - * - *@param c This is the command responsible for the event. - *@param s Should be equal to this. - */ - public void commandAction(Command c, Displayable s) - { - if (c == cmdExit) - { - destroyApp(false); - notifyDestroyed(); - } - } -} diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_04.java --- a/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_04.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,108 +0,0 @@ -/* -* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -/** - * import midp classes. - */ -import javax.microedition.midlet.*; -import javax.microedition.lcdui.*; - -/** - * This is the main class for the Midp_General_04 tests. - */ - -public class Midp_General_04 extends MIDlet implements CommandListener -{ - - private Alert alert; - private Display display; - private Gauge indicator; - private Image image; - private Command cmdScreen = new Command("Screen cmd", Command.SCREEN, 1); - private Command cmdExit = new Command("Exit", Command.EXIT, 1); - - private String alertText = "This is a modal alert with very long text blah blah blah blah blah blah " + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah " + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah " + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah " + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah " + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah " + - "blah blah blah blah blah blah blah blah blah blah blah blah blah blah"; - - public Midp_General_04() - { - alert = new Alert("Alert title", alertText, null, AlertType.INFO); - alert.addCommand(cmdExit); - alert.addCommand(cmdScreen); - alert.setCommandListener(this); - indicator = new Gauge(null, false, Gauge.INDEFINITE, Gauge.CONTINUOUS_RUNNING); - alert.setIndicator(indicator); - - try - { - image = Image.createImage("/small.png"); - } - catch (java.io.IOException e) - { - } - alert.setImage(image); - - display = Display.getDisplay(this); - } - - /** - * Signals the MIDlet to start and enter the Active state. - */ - protected void startApp() - { - display.setCurrent(alert); - } - - /** - * Signals the MIDlet to terminate and enter the Destroyed state. - * - */ - protected void destroyApp(boolean unconditional) - { - } - - /** - * Signals the MIDlet to stop and enter the Paused state. - */ - protected void pauseApp() - { - } - - /** - * This method handles command invocations. - * - *@param c This is the command responsible for the event. - *@param s Should be equal to this. - */ - public void commandAction(Command c, Displayable s) - { - if (c == cmdExit) - { - destroyApp(false); - notifyDestroyed(); - } - else if (c == cmdScreen) - { - alert.setTitle("Command run"); - } - } -} diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_05.java --- a/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_05.java Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* -* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -/** - * import midp classes. - */ -import javax.microedition.midlet.*; -import javax.microedition.lcdui.*; - -/** - * This is the main class for the Midp_General_05 tests. - */ - -public class Midp_General_05 extends MIDlet implements CommandListener -{ - - private Canvas canvas; - private Display display; - private Command cmdExit = new Command("Exit", Command.EXIT, 1); - - public Midp_General_05() - { - display = Display.getDisplay(this); - canvas = new EmptyCanvas(); - canvas.addCommand(cmdExit); - canvas.setCommandListener(this); - } - - /** - * Signals the MIDlet to start and enter the Active state. - */ - protected void startApp() - { - display.setCurrent(canvas); - } - - /** - * Signals the MIDlet to terminate and enter the Destroyed state. - * - */ - protected void destroyApp(boolean unconditional) - { - } - - /** - * Signals the MIDlet to stop and enter the Paused state. - */ - protected void pauseApp() - { - } - - /** - * This method handles command invocations. - * - *@param c This is the command responsible for the event. - *@param s Should be equal to this. - */ - public void commandAction(Command c, Displayable s) - { - if (c == cmdExit) - { - destroyApp(false); - notifyDestroyed(); - } - } -} - -class EmptyCanvas extends Canvas -{ - protected void paint(Graphics g) - { - g.setColor(0, 0, 0); - g.drawString("Empty Canvas", getWidth()/2, getHeight()/2, Graphics.TOP | Graphics.HCENTER); - } -} diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General_02/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General_02/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General_02/src/Midp_General_02.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General_02/src/Midp_General_02.java Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +/** + * import midp classes. + */ +import javax.microedition.midlet.*; +import javax.microedition.lcdui.*; + +/** + * + */ + +public class Midp_General_02 extends MIDlet +{ + + TextBox tb; + Display display; + + public Midp_General_02() + { + tb = new TextBox("TextBox", null, 1000, TextField.ANY); + display = Display.getDisplay(this); + } + + /** + * Signals the MIDlet to start and enter the Active state. + */ + protected void startApp() + { + display.setCurrent(tb); + } + + /** + * Signals the MIDlet to terminate and enter the Destroyed state. + * + */ + protected void destroyApp(boolean unconditional) + { + } + + /** + * Signals the MIDlet to stop and enter the Paused state. + */ + protected void pauseApp() + { + } +} + diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General_04/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General_04/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General_04/src/Midp_General_04.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General_04/src/Midp_General_04.java Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +/** + * import midp classes. + */ +import javax.microedition.midlet.*; +import javax.microedition.lcdui.*; + +/** + * + */ + +public class Midp_General_04 extends MIDlet +{ + + private Alert alert; + private Display display; + + public Midp_General_04() + { + alert = new Alert("Alert title", "Alert Text", null, AlertType.INFO); + display = Display.getDisplay(this); + } + + /** + * Signals the MIDlet to start and enter the Active state. + */ + protected void startApp() + { + display.setCurrent(alert); + } + + /** + * Signals the MIDlet to terminate and enter the Destroyed state. + * + */ + protected void destroyApp(boolean unconditional) + { + } + + /** + * Signals the MIDlet to stop and enter the Paused state. + */ + protected void pauseApp() + { + } +} + diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General_05/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General_05/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_General_05/src/Midp_General_05.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General_05/src/Midp_General_05.java Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +/** + * import midp classes. + */ +import javax.microedition.midlet.*; +import javax.microedition.lcdui.*; + +/** + * + */ + +public class Midp_General_05 extends MIDlet +{ + + private Canvas canvas; + private Display display; + + public Midp_General_05() + { + display = Display.getDisplay(this); + canvas = new EmptyCanvas(); + } + + /** + * Signals the MIDlet to start and enter the Active state. + */ + protected void startApp() + { + display.setCurrent(canvas); + } + + /** + * Signals the MIDlet to terminate and enter the Destroyed state. + * + */ + protected void destroyApp(boolean unconditional) + { + } + + /** + * Signals the MIDlet to stop and enter the Paused state. + */ + protected void pauseApp() + { + } +} + +class EmptyCanvas extends Canvas +{ + protected void paint(Graphics g) + { + g.setColor(0, 0, 0); + g.drawString("Empty Canvas", getWidth()/2, getHeight()/2, Graphics.TOP | Graphics.HCENTER); + } +} + diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_StringItem_01/build.xml --- a/javauis/tsrc/fute/lcdui/Midp_StringItem_01/build.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_StringItem_01/build.xml Fri Oct 22 14:23:56 2010 +0100 @@ -28,7 +28,7 @@ - + diff -r 461e71b327da -r 0553e2305d00 javauis/tsrc/fute/lcdui/Midp_StringItem_01/src/FormStringItemTests.java --- a/javauis/tsrc/fute/lcdui/Midp_StringItem_01/src/FormStringItemTests.java Fri Sep 17 17:50:17 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_StringItem_01/src/FormStringItemTests.java Fri Oct 22 14:23:56 2010 +0100 @@ -62,11 +62,9 @@ //the command to create the StringItem with the entered label and text and with focus private Command cmdCreateHL = new Command("Create as Hyperlink", Command.SCREEN, 1); - private Command cmdCreateHLM = new Command("Create as Hyperlink 2 cmds", Command.SCREEN, 1); //the command to create the StringItem with the entered label and text and with focus private Command cmdCreateButton = new Command("Create as Button", Command.SCREEN, 1); - private Command cmdCreateButtonM = new Command("Create as Button 2 cmds", Command.SCREEN, 1); //the command to unlock the Item private Command cmdUnlock = new Command("Unlock", Command.SCREEN, 1); @@ -99,11 +97,6 @@ private Command cmdNext = new Command("Next", Command.SCREEN, 1); private Command cmdExit = new Command("Exit", Command.EXIT, 1); - // commands for the form - private Command cmdItemF = new Command("ItemF", Command.ITEM, 1); - private Command cmdOkF = new Command("OkF", Command.OK, 1); - private Command cmdScreenF = new Command("Add form commands", Command.SCREEN, 1); - static int change = -1; public FormStringItemTests(Midp_StringItem_01 m) @@ -125,9 +118,7 @@ append(cg); addCommand(cmdCreate); addCommand(cmdCreateHL); - addCommand(cmdCreateHLM); addCommand(cmdCreateButton); - addCommand(cmdCreateButtonM); addCommand(cmdLayout); addCommand(cmdLayoutHL); addCommand(cmdLayoutButton); @@ -143,7 +134,6 @@ //create StringItemForm stringItemForm = new Form("StringItem"); stringItemForm.addCommand(cmdBack); - stringItemForm.addCommand(cmdScreenF); stringItemForm.setCommandListener(this); } @@ -233,27 +223,39 @@ } else if (c == cmdLayout) { + layoutTest(Item.PLAIN); + } else if (c == cmdLayoutHL) { + layoutTest(Item.HYPERLINK); + } else if (c == cmdLayoutButton) { + layoutTest(Item.BUTTON); + } else if (c == cmdVLayout) { + verticalLayoutTest(Item.PLAIN); + } else if (c == cmdVLayoutHL) { + verticalLayoutTest(Item.HYPERLINK); + } else if (c == cmdVLayoutButton) { + verticalLayoutTest(Item.BUTTON); + } else if (c == cmdAddListeners) { @@ -270,11 +272,6 @@ m.destroyApp(false); m.notifyDestroyed(); } - else if (c == cmdScreenF) - { - stringItemForm.addCommand(cmdItemF); - stringItemForm.addCommand(cmdOkF); - } else { String l = label.getString(); @@ -285,12 +282,12 @@ if (c == cmdCreate) si = new StringItem(l, t); - else if (c == cmdCreateHL || c == cmdCreateHLM) + else if (c == cmdCreateHL) { si = new StringItem(l, t, Item.HYPERLINK); si.setDefaultCommand(cmdItem); } - else if (c == cmdCreateButton || c == cmdCreateButtonM) + else if (c == cmdCreateButton) { si = new StringItem(l, t, Item.BUTTON); si.setDefaultCommand(cmdItem); @@ -355,10 +352,6 @@ stringItemForm.addCommand(cmdRemoveCommand); stringItemForm.addCommand(cmdRestoreCommand); stringItemForm.addCommand(cmdRemoveItem); - if (c == cmdCreateButtonM || c == cmdCreateHLM) - { - si.addCommand(cmdBack); - } Display.getDisplay(m).setCurrent(stringItemForm); } } diff -r 461e71b327da -r 0553e2305d00 layers.sysdef.xml --- a/layers.sysdef.xml Fri Sep 17 17:50:17 2010 +0100 +++ b/layers.sysdef.xml Fri Oct 22 14:23:56 2010 +0100 @@ -10,10 +10,22 @@ + + + + + + + + + diff -r 461e71b327da -r 0553e2305d00 rom/installerodclist30 diff -r 461e71b327da -r 0553e2305d00 rom/java_2_1.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/java_2_1.iby Fri Oct 22 14:23:56 2010 +0100 @@ -0,0 +1,366 @@ +/* +* 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: +* Image-description file of the Java package for ROFS1. +*/ + +#ifndef __JAVA_IBY__ +#define __JAVA_IBY__ + +#include + +// Helper defines +define JAVA_RES_BLD ABI_DIR\BUILD_DIR\z\resource\java +define JAVA_RES_IMG RESOURCE_FILES_DIR\java +define JAVA_VM_RES_BLD JAVA_RES_BLD\jvm\lib\jrt +define JAVA_VM_RES_IMG JAVA_RES_IMG\jvm\lib\jrt +define JAVA_POLICY_BLD ABI_DIR\BUILD_DIR\z\resource\java\security\policies +define JAVA_POLICY_IMG RESOURCE_FILES_DIR\java\security\policies + + +//////////////////////////// +// Java Manager collection// +//////////////////////////// + +// stub sis +data=ZSYSTEM\install\java.sis System\Install\java.sis + + +// AppMngr plugin +ECOM_PLUGIN( appmngr2midletplugin.dll, appmngr2midletplugin.rsc ) +data=ZRESOURCE\plugins\appmngr2midletplugin.rsc ECOM_RESOURCE_DIR\appmngr2midletplugin.rsc + +// Captain +file=ABI_DIR\BUILD_DIR\javacaptain_ext_btdeviceclassmanager.dll SHARED_LIB_DIR\javacaptain_ext_btdeviceclassmanager.dll +file=ABI_DIR\BUILD_DIR\javacaptain_ext_config.dll SHARED_LIB_DIR\javacaptain_ext_config.dll +file=ABI_DIR\BUILD_DIR\javacaptain_ext_ondemand_2.dll SHARED_LIB_DIR\javacaptain_ext_ondemand_2.dll +file=ABI_DIR\BUILD_DIR\javacaptain_ext_ondemand_7.dll SHARED_LIB_DIR\javacaptain_ext_ondemand_7.dll +file=ABI_DIR\BUILD_DIR\javacaptain_ext_preinstallerstarter.dll SHARED_LIB_DIR\javacaptain_ext_preinstallerstarter.dll +file=ABI_DIR\BUILD_DIR\javacaptain_ext_pushregistryplugin.dll SHARED_LIB_DIR\javacaptain_ext_pushregistryplugin.dll +file=ABI_DIR\BUILD_DIR\javacaptain_ext_storageserverplugin.dll SHARED_LIB_DIR\javacaptain_ext_storageserverplugin.dll +file=ABI_DIR\BUILD_DIR\javacaptain_ext_settingslistener.dll SHARED_LIB_DIR\javacaptain_ext_settingslistener.dll +file=ABI_DIR\BUILD_DIR\javacaptain.exe PROGRAMS_DIR\javacaptain.exe + +// Registry +file=ABI_DIR\BUILD_DIR\javaregistryclient.dll SHARED_LIB_DIR\javaregistryclient.dll +file=ABI_DIR\BUILD_DIR\javasizehelperclient.dll SHARED_LIB_DIR\javasizehelperclient.dll +file=ABI_DIR\BUILD_DIR\javasizehelperserver.dll SHARED_LIB_DIR\javasizehelperserver.dll + +// Installer +ECOM_PLUGIN(ifeui.dll,ifeui.rsc) +data=ZRESOURCE\plugins\ifeui.rsc ECOM_RESOURCE_DIR\ifeui.rsc +data=ZPRIVATE\10003a3f\apps\javainstaller_reg.rsc \private\10003a3f\import\apps\javainstaller_reg.rsc +data=ZRESOURCE\apps\javainstaller_loc.rsc APP_RESOURCE_DIR\javainstaller_loc.rsc +data=ZRESOURCE\apps\javainstaller_icon.mif APP_BITMAP_DIR\javainstaller_icon.mif +file=ABI_DIR\BUILD_DIR\javainstaller.dll SHARED_LIB_DIR\javainstaller.dll +data=JAVA_VM_RES_BLD\javainstallerui.odc JAVA_VM_RES_IMG\javainstallerui.odc +file=ABI_DIR\BUILD_DIR\javainstallerui.dll SHARED_LIB_DIR\javainstallerui.dll +data=JAVA_VM_RES_BLD\javainstaller.odc JAVA_VM_RES_IMG\javainstaller.odc +file=ABI_DIR\BUILD_DIR\javainstallerstarter.dll PROGRAMS_DIR\javainstallerstarter.dll +file=ABI_DIR\BUILD_DIR\javapreinstaller.dll PROGRAMS_DIR\javapreinstaller.dll +data=ZRESOURCE\java\java_app_92.mif JAVA_RES_IMG\java_app.mif +data=ZRESOURCE\java\java_trusted.png JAVA_RES_IMG\java_trusted.png +data=ZRESOURCE\java\java_untrusted.png JAVA_RES_IMG\java_untrusted.png +data=DATAZ_\private\102033E6\installer\inst_plugins.cfg \private\102033E6\installer\inst_plugins.cfg + +// Launchers +file=ABI_DIR\BUILD_DIR\javalauncher.exe PROGRAMS_DIR\javalauncher.exe +ECOM_PLUGIN(javaappschemeplugin.dll,javaappschemeplugin.rsc) +data=ZRESOURCE\plugins\javaappschemeplugin.rsc ECOM_RESOURCE_DIR\javaappschemeplugin.rsc + +// SID Checker +ECOM_PLUGIN(javasidchecker.dll,10281FBE.rsc) +data=ZRESOURCE\plugins\javasidchecker.rsc ECOM_RESOURCE_DIR\javasidchecker.rsc + +// Recognizers +ECOM_PLUGIN(recjar.dll, 102031FB.rsc) +data=ZRESOURCE\plugins\recjar.rsc ECOM_RESOURCE_DIR\recjar.rsc + +// Backup & Restore +file=ABI_DIR\BUILD_DIR\javabackup.exe PROGRAMS_DIR\javabackup.exe +ECOM_PLUGIN(midp2backupplugin.dll,10282474.rsc) +data=ZRESOURCE\plugins\midp2backupplugin.rsc ECOM_RESOURCE_DIR\midp2backupplugin.rsc +data=DATAZ_\private\1028246F\backup_registration.xml \private\1028246F\backup_registration.xml +data=DATAZ_\private\102033E6\backup_registration.xml \private\102033E6\backup_registration.xml + + +///////////////////////// +// Java UIs collection // +///////////////////////// + +// CoreUi +file=ABI_DIR\BUILD_DIR\javacoreui.dll SHARED_LIB_DIR\javacoreui.dll +data=JAVA_VM_RES_BLD\javacoreui.odc JAVA_VM_RES_IMG\javacoreui.odc + +// eSWT +file=ABI_DIR\BUILD_DIR\eswt.dll SHARED_LIB_DIR\eswt.dll +data=JAVA_VM_RES_BLD\eswt.odc JAVA_VM_RES_IMG\eswt.odc +file=ABI_DIR\BUILD_DIR\eswtphysics.dll SHARED_LIB_DIR\eswtphysics.dll +file=ABI_DIR\BUILD_DIR\eswtapifacade.dll SHARED_LIB_DIR\eswtapifacade.dll +file=ABI_DIR\BUILD_DIR\eswtdirectcontent.dll SHARED_LIB_DIR\eswtdirectcontent.dll +data=JAVA_VM_RES_BLD\eswtdirectcontent.odc JAVA_VM_RES_IMG\eswtdirectcontent.odc +data=ZPRIVATE\10003a3f\apps\eswt_reg.rsc \private\10003a3f\import\apps\eswt_reg.rsc + +// LCDUI +file=ABI_DIR\BUILD_DIR\javalcdui.dll SHARED_LIB_DIR\javalcdui.dll +data=JAVA_VM_RES_BLD\javalcdui.odc JAVA_VM_RES_IMG\javalcdui.odc +file=ABI_DIR\BUILD_DIR\lcdui.dll SHARED_LIB_DIR\lcdui.dll +file=ABI_DIR\BUILD_DIR\lcdgr.dll SHARED_LIB_DIR\lcdgr.dll +file=ABI_DIR\BUILD_DIR\lcdgdrv.dll SHARED_LIB_DIR\lcdgdrv.dll +file=ABI_DIR\BUILD_DIR\lcdgdrvi.dll SHARED_LIB_DIR\lcdgdrvi.dll +file=ABI_DIR\BUILD_DIR\lcduiphysicswrap.dll SHARED_LIB_DIR\lcduiphysicswrap.dll +ECOM_PLUGIN(LCDC4K.dll, 10208164.rsc) +ECOM_PLUGIN(LCDC64K.dll, 10208162.rsc) +ECOM_PLUGIN(LCDC16MU.dll, 10208166.rsc) +ECOM_PLUGIN(LCDC16MA.dll, 10208168.rsc) +data=ZRESOURCE\java\lcdgr.rsc JAVA_RES_IMG\lcdgr.rsc +data=ZPRIVATE\10003a3f\apps\lcdui_reg.rsc \private\10003a3f\import\apps\lcdui_reg.rsc + +SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,lcdui) + +// AMMS API +file=ABI_DIR\BUILD_DIR\javaamms.dll SHARED_LIB_DIR\javaamms.dll +data=JAVA_VM_RES_BLD\javaamms.odc JAVA_VM_RES_IMG\javaamms.odc + +// Mobile Media API +file=ABI_DIR\BUILD_DIR\javamobilemedia.dll SHARED_LIB_DIR\javamobilemedia.dll +data=JAVA_VM_RES_BLD\javamobilemedia.odc JAVA_VM_RES_IMG\javamobilemedia.odc +data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaCapture.wav \System\Sounds\Digital\CamcorderJavaCapture.wav +data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaStart.wav \System\Sounds\Digital\CamcorderJavaStart.wav + +// MobInfo API +file=ABI_DIR\BUILD_DIR\javamobinfo.dll SHARED_LIB_DIR\javamobinfo.dll +data=JAVA_VM_RES_BLD\javamobinfo.odc JAVA_VM_RES_IMG\javamobinfo.odc + +// GlobalIndicators API +file=ABI_DIR\BUILD_DIR\javaglobalindicators.dll SHARED_LIB_DIR\javaglobalindicators.dll +data=JAVA_VM_RES_BLD\javaglobalindicators.odc JAVA_VM_RES_IMG\javaglobalindicators.odc + +// SoftNotification API +file=ABI_DIR\BUILD_DIR\javasoftnotification.dll SHARED_LIB_DIR\javasoftnotification.dll +data=JAVA_VM_RES_BLD\javasoftnotification.odc JAVA_VM_RES_IMG\javasoftnotification.odc + +// 2G API +file=ABI_DIR\BUILD_DIR\javam2g.dll SHARED_LIB_DIR\javam2g.dll +data=JAVA_VM_RES_BLD\javam2g.odc JAVA_VM_RES_IMG\javam2g.odc + +// 3G API +file=ABI_DIR\BUILD_DIR\javam3g.dll SHARED_LIB_DIR\javam3g.dll +data=JAVA_VM_RES_BLD\javam3g.odc JAVA_VM_RES_IMG\javam3g.odc + +// Nokia Sound API +file=ABI_DIR\BUILD_DIR\javanokiasound.dll SHARED_LIB_DIR\javanokiasound.dll +data=JAVA_VM_RES_BLD\javanokiasound.odc JAVA_VM_RES_IMG\javanokiasound.odc + +// Remote Connection Observer +file=ABI_DIR\BUILD_DIR\javaremconobserver.dll SHARED_LIB_DIR\javaremconobserver.dll + +// Legacy utilities +file=ABI_DIR\BUILD_DIR\javalegacyutils.dll SHARED_LIB_DIR\javalegacyutils.dll +data=JAVA_VM_RES_BLD\javalegacyutils.odc JAVA_VM_RES_IMG\javalegacyutils.odc + + +///////////////////////////// +// Java Runtimes collection // +///////////////////////////// + +// Runtime utilities +file=ABI_DIR\BUILD_DIR\javaruntimeui.dll SHARED_LIB_DIR\javaruntimeui.dll +data=JAVA_VM_RES_BLD\javaruntimeui.odc JAVA_VM_RES_IMG\javaruntimeui.odc +file=ABI_DIR\BUILD_DIR\javaruntimestarterutils.dll SHARED_LIB_DIR\javaruntimestarterutils.dll + +// MIDP runtime +file=ABI_DIR\BUILD_DIR\javamidp.exe PROGRAMS_DIR\javamidp.exe +file=ABI_DIR\BUILD_DIR\javamidpstarter.dll SHARED_LIB_DIR\javamidpstarter.dll +file=ABI_DIR\BUILD_DIR\javamidpruntime.dll SHARED_LIB_DIR\javamidpruntime.dll +data=JAVA_VM_RES_BLD\javamidpruntime.odc JAVA_VM_RES_IMG\javamidpruntime.odc + +// An empty JVM argument modifier (to prevent 3rd parties from installing a DLL with this name) +// To enable JVM argument modifier - comment 1st line below and uncomment 2nd line below +file=ABI_DIR\BUILD_DIR\javajvmargsmodifier.dll SHARED_LIB_DIR\javajvmargsmodifier.dll +//file=ABI_DIR\BUILD_DIR\javajvmargsmodifierfile.dll SHARED_LIB_DIR\javajvmargsmodifier.dll + + +///////////////////////////// +// Java Commons collection // +///////////////////////////// + +// J9 JVM +file=ABI_DIR\BUILD_DIR\j9.dll SHARED_LIB_DIR\j9.dll +file=ABI_DIR\BUILD_DIR\j9vmall23.dll SHARED_LIB_DIR\j9vmall23.dll +file=ABI_DIR\BUILD_DIR\j9mjit23.dll SHARED_LIB_DIR\j9mjit23.dll +file=ABI_DIR\BUILD_DIR\jclcldc11_23.dll SHARED_LIB_DIR\jclcldc11_23.dll +file=ABI_DIR\BUILD_DIR\jclcdc11_23.dll SHARED_LIB_DIR\jclcdc11_23.dll +file=ABI_DIR\BUILD_DIR\j9fdm23.dll SHARED_LIB_DIR\j9fdm23.dll +file=ABI_DIR\BUILD_DIR\JvmNativePort.dll SHARED_LIB_DIR\JvmNativePort.dll +data=JAVA_RES_BLD\jvm\bin\java.properties JAVA_RES_IMG\jvm\bin\java.properties +data=JAVA_RES_BLD\jvm\lib\security\java.policy JAVA_RES_IMG\jvm\lib\security\java.policy +data=JAVA_RES_BLD\jvm\lib\security\java.security JAVA_RES_IMG\jvm\lib\security\java.security + +// Utilities +file=ABI_DIR\BUILD_DIR\javautils.dll SHARED_LIB_DIR\javautils.dll +data=JAVA_VM_RES_BLD\javautils.odc JAVA_VM_RES_IMG\javautils.odc +file=ABI_DIR\BUILD_DIR\javacomms.dll SHARED_LIB_DIR\javacomms.dll +data=JAVA_VM_RES_BLD\javacomms.odc JAVA_VM_RES_IMG\javacomms.odc +file=ABI_DIR\BUILD_DIR\javaipc.dll SHARED_LIB_DIR\javaipc.dll +file=ABI_DIR\BUILD_DIR\javafileutils.dll SHARED_LIB_DIR\javafileutils.dll +data=JAVA_VM_RES_BLD\javafileutils.odc JAVA_VM_RES_IMG\javafileutils.odc +file=ABI_DIR\BUILD_DIR\javadebugapi.dll SHARED_LIB_DIR\javadebugapi.dll + +// Security dlls +file=ABI_DIR\BUILD_DIR\javasecurity.dll SHARED_LIB_DIR\javasecurity.dll +data=JAVA_VM_RES_BLD\javasecurity.odc JAVA_VM_RES_IMG\javasecurity.odc +ECOM_PLUGIN(javaunicertstoreplugin.dll,200213A3.rsc) +data=ZRESOURCE\plugins\javaunicertstoreplugin.rsc ECOM_RESOURCE_DIR\javaunicertstoreplugin.rsc + +// Security certs & policies +data=JAVA_POLICY_BLD\s60_manufacturer.ser JAVA_POLICY_IMG\s60_manufacturer.ser +data=JAVA_POLICY_BLD\s60_operator.ser JAVA_POLICY_IMG\s60_operator.ser +data=JAVA_POLICY_BLD\s60_trustedthirdparty.ser JAVA_POLICY_IMG\s60_trustedthirdparty.ser +data=JAVA_POLICY_BLD\s60_untrusted.ser JAVA_POLICY_IMG\s60_untrusted.ser +data=JAVA_POLICY_BLD\msa_manufacturer.ser JAVA_POLICY_IMG\msa_manufacturer.ser +data=JAVA_POLICY_BLD\msa_operator.ser JAVA_POLICY_IMG\msa_operator.ser +data=JAVA_POLICY_BLD\msa_trustedthirdparty.ser JAVA_POLICY_IMG\msa_trustedthirdparty.ser +data=JAVA_POLICY_BLD\msa_untrusted.ser JAVA_POLICY_IMG\msa_untrusted.ser +data=JAVA_POLICY_BLD\att_manufacturer.ser JAVA_POLICY_IMG\att_manufacturer.ser +data=JAVA_POLICY_BLD\att_operator.ser JAVA_POLICY_IMG\att_operator.ser +data=JAVA_POLICY_BLD\att_operatorextra.ser JAVA_POLICY_IMG\att_operatorextra.ser +data=JAVA_POLICY_BLD\att_trustedthirdparty.ser JAVA_POLICY_IMG\att_trustedthirdparty.ser +data=JAVA_POLICY_BLD\att_untrusted.ser JAVA_POLICY_IMG\att_untrusted.ser +data=JAVA_POLICY_BLD\all.ser JAVA_POLICY_IMG\all.ser + + +// Java environment info +file=ABI_DIR\BUILD_DIR\javaenvinfo.dll SHARED_LIB_DIR\javaenvinfo.dll +data=ABI_DIR\BUILD_DIR\Z\Resource\versions\java.txt RESOURCE_FILES_DIR\versions\java.txt + +// Storage +file=ABI_DIR\BUILD_DIR\javastorage.dll SHARED_LIB_DIR\javastorage.dll +data=JAVA_VM_RES_BLD\javastorage.odc JAVA_VM_RES_IMG\javastorage.odc + +// GCF base +file=ABI_DIR\BUILD_DIR\javagcf.dll SHARED_LIB_DIR\javagcf.dll +data=JAVA_VM_RES_BLD\javagcf.odc JAVA_VM_RES_IMG\javagcf.odc + +// Connection Manager +file=ABI_DIR\BUILD_DIR\javaconnectionmanager.dll SHARED_LIB_DIR\javaconnectionmanager.dll +data=JAVA_VM_RES_BLD\javaconnectionmanager.odc JAVA_VM_RES_IMG\javaconnectionmanager.odc + +// Http & https protocols +file=ABI_DIR\BUILD_DIR\javahttp.dll SHARED_LIB_DIR\javahttp.dll +file=ABI_DIR\BUILD_DIR\javahttps.dll SHARED_LIB_DIR\javahttps.dll +data=JAVA_VM_RES_BLD\javahttp.odc JAVA_VM_RES_IMG\javahttp.odc +data=JAVA_VM_RES_BLD\javahttps.odc JAVA_VM_RES_IMG\javahttps.odc + +// Socket protocol +file=ABI_DIR\BUILD_DIR\javasocket.dll SHARED_LIB_DIR\javasocket.dll +file=ABI_DIR\BUILD_DIR\javasocketscplugin.dll SHARED_LIB_DIR\javasocketscplugin.dll +data=JAVA_VM_RES_BLD\javasocket.odc JAVA_VM_RES_IMG\javasocket.odc + +// Secure socket protocol +file=ABI_DIR\BUILD_DIR\javassl.dll SHARED_LIB_DIR\javassl.dll +data=JAVA_VM_RES_BLD\javassl.odc JAVA_VM_RES_IMG\javassl.odc + + +//////////////////////////////// +// Java Extensions collection // +//////////////////////////////// + +// Push +file=ABI_DIR\BUILD_DIR\javapushcontroller.dll SHARED_LIB_DIR\javapushcontroller.dll +file=ABI_DIR\BUILD_DIR\javapushregistry.dll SHARED_LIB_DIR\javapushregistry.dll +data=JAVA_VM_RES_BLD\javapushregistry.odc JAVA_VM_RES_IMG\javapushregistry.odc + +// Bluetooth +file=ABI_DIR\BUILD_DIR\javabluecove.dll SHARED_LIB_DIR\javabluecove.dll +file=ABI_DIR\BUILD_DIR\javabluetooth.dll SHARED_LIB_DIR\javabluetooth.dll +file=ABI_DIR\BUILD_DIR\javabluetoothcommons.dll SHARED_LIB_DIR\javabluetoothcommons.dll +file=ABI_DIR\BUILD_DIR\javabtgoepscplugin.dll SHARED_LIB_DIR\javabtgoepscplugin.dll +file=ABI_DIR\BUILD_DIR\javabtl2capscplugin.dll SHARED_LIB_DIR\javabtl2capscplugin.dll +file=ABI_DIR\BUILD_DIR\javabtsppscplugin.dll SHARED_LIB_DIR\javabtsppscplugin.dll +data=JAVA_VM_RES_BLD\javabluecove.odc JAVA_VM_RES_IMG\javabluecove.odc +data=JAVA_VM_RES_BLD\javabluetooth.odc JAVA_VM_RES_IMG\javabluetooth.odc +data=JAVA_VM_RES_BLD\javabluetoothcommons.odc JAVA_VM_RES_IMG\javabluetoothcommons.odc + +// WMA +file=ABI_DIR\BUILD_DIR\javawma.dll SHARED_LIB_DIR\javawma.dll +file=ABI_DIR\BUILD_DIR\javawmamms.dll SHARED_LIB_DIR\javawmamms.dll +file=ABI_DIR\BUILD_DIR\javacbsscplugin.dll SHARED_LIB_DIR\javacbsscplugin.dll +file=ABI_DIR\BUILD_DIR\javammsscplugin.dll SHARED_LIB_DIR\javammsscplugin.dll +file=ABI_DIR\BUILD_DIR\javasmsscplugin.dll SHARED_LIB_DIR\javasmsscplugin.dll +data=JAVA_VM_RES_BLD\javawma.odc JAVA_VM_RES_IMG\javawma.odc +data=JAVA_VM_RES_BLD\javawmamms.odc JAVA_VM_RES_IMG\javawmamms.odc + +// Comm +file=ABI_DIR\BUILD_DIR\javacomm.dll SHARED_LIB_DIR\javacomm.dll +data=JAVA_VM_RES_BLD\javacomm.odc JAVA_VM_RES_IMG\javacomm.odc + +// Datagram +file=ABI_DIR\BUILD_DIR\javadatagram.dll SHARED_LIB_DIR\javadatagram.dll +file=ABI_DIR\BUILD_DIR\javadatagramscplugin.dll SHARED_LIB_DIR\javadatagramscplugin.dll +data=JAVA_VM_RES_BLD\javadatagram.odc JAVA_VM_RES_IMG\javadatagram.odc + +// Location API +file=ABI_DIR\BUILD_DIR\javalocation.dll SHARED_LIB_DIR\javalocation.dll +data=JAVA_VM_RES_BLD\javalocation.odc JAVA_VM_RES_IMG\javalocation.odc + +// Sensor API +file=ABI_DIR\BUILD_DIR\javasensor.dll SHARED_LIB_DIR\javasensor.dll +data=JAVA_VM_RES_BLD\javasensor.odc JAVA_VM_RES_IMG\javasensor.odc + +// Web services API +file=ABI_DIR\BUILD_DIR\javawebservices.dll SHARED_LIB_DIR\javawebservices.dll +data=JAVA_VM_RES_BLD\javawebservices.odc JAVA_VM_RES_IMG\javawebservices.odc + +// PIM API +file=ABI_DIR\BUILD_DIR\javapim.dll SHARED_LIB_DIR\javapim.dll +data=JAVA_VM_RES_BLD\javapim.odc JAVA_VM_RES_IMG\javapim.odc + +// RMS API +file=ABI_DIR\BUILD_DIR\javarms.dll SHARED_LIB_DIR\javarms.dll +data=JAVA_VM_RES_BLD\javarms.odc JAVA_VM_RES_IMG\javarms.odc + +// SATSA API +file=ABI_DIR\BUILD_DIR\javasatsa.dll SHARED_LIB_DIR\javasatsa.dll +data=JAVA_VM_RES_BLD\javasatsa.odc JAVA_VM_RES_IMG\javasatsa.odc + +// File API +file=ABI_DIR\BUILD_DIR\javafile.dll SHARED_LIB_DIR\javafile.dll +data=JAVA_VM_RES_BLD\javafile.odc JAVA_VM_RES_IMG\javafile.odc + +// IAP Info API +file=ABI_DIR\BUILD_DIR\javaiapinfo.dll SHARED_LIB_DIR\javaiapinfo.dll +data=JAVA_VM_RES_BLD\javaiapinfo.odc JAVA_VM_RES_IMG\javaiapinfo.odc + + +/////////////////// +// Miscellaneous // +/////////////////// + +// Generated localization file resources +data=JAVA_VM_RES_BLD\resources.jar JAVA_VM_RES_IMG\resources.jar + +// ODC list files +data=ZRESOURCE\java\midpOdcList JAVA_RES_IMG\midpodclist +data=ZRESOURCE\java\installerOdcList JAVA_RES_IMG\installerodclist +data=ZRESOURCE\java\tckRunnerOdcList JAVA_RES_IMG\tckrunnerodclist + +// trust roots list +data=ZRESOURCE\java\security\trustroots\midprootslist JAVA_RES_IMG\security\trustroots\midprootslist + +// Java icon size notifier ecom plugin +ECOM_PLUGIN(javaiconsizenotifplugin.dll, javaiconsizenotifplugin.rsc) +data=ZRESOURCE\plugins\javaiconsizenotifplugin.rsc ECOM_RESOURCE_DIR\javaiconsizenotifplugin.rsc + +#endif diff -r 461e71b327da -r 0553e2305d00 rom/java_2_2.iby --- a/rom/java_2_2.iby Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,372 +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: -* Image-description file of the Java package for ROFS1. -*/ - -#ifndef __JAVA_IBY__ -#define __JAVA_IBY__ - -#include - -// Helper defines -define JAVA_RES_BLD ABI_DIR\BUILD_DIR\z\resource\java -define JAVA_RES_IMG RESOURCE_FILES_DIR\java -define JAVA_VM_RES_BLD JAVA_RES_BLD\jvm\lib\jrt -define JAVA_VM_RES_IMG JAVA_RES_IMG\jvm\lib\jrt -define JAVA_POLICY_BLD ABI_DIR\BUILD_DIR\z\resource\java\security\policies -define JAVA_POLICY_IMG RESOURCE_FILES_DIR\java\security\policies - - -//////////////////////////// -// Java Manager collection// -//////////////////////////// - -// stub sis -data=ZSYSTEM\install\java.sis System\Install\java.sis - - -// AppMngr plugin -ECOM_PLUGIN( appmngr2midletplugin.dll, appmngr2midletplugin.rsc ) -data=ZRESOURCE\plugins\appmngr2midletplugin.rsc ECOM_RESOURCE_DIR\appmngr2midletplugin.rsc - -// Captain -file=ABI_DIR\BUILD_DIR\javacaptain_ext_autostarter.dll SHARED_LIB_DIR\javacaptain_ext_autostarter.dll -file=ABI_DIR\BUILD_DIR\javacaptain_ext_btdeviceclassmanager.dll SHARED_LIB_DIR\javacaptain_ext_btdeviceclassmanager.dll -file=ABI_DIR\BUILD_DIR\javacaptain_ext_config.dll SHARED_LIB_DIR\javacaptain_ext_config.dll -file=ABI_DIR\BUILD_DIR\javacaptain_ext_ondemand_2.dll SHARED_LIB_DIR\javacaptain_ext_ondemand_2.dll -file=ABI_DIR\BUILD_DIR\javacaptain_ext_ondemand_7.dll SHARED_LIB_DIR\javacaptain_ext_ondemand_7.dll -file=ABI_DIR\BUILD_DIR\javacaptain_ext_preinstallerstarter.dll SHARED_LIB_DIR\javacaptain_ext_preinstallerstarter.dll -file=ABI_DIR\BUILD_DIR\javacaptain_ext_pushregistryplugin.dll SHARED_LIB_DIR\javacaptain_ext_pushregistryplugin.dll -file=ABI_DIR\BUILD_DIR\javacaptain_ext_storageserverplugin.dll SHARED_LIB_DIR\javacaptain_ext_storageserverplugin.dll -file=ABI_DIR\BUILD_DIR\javacaptain_ext_settingslistener.dll SHARED_LIB_DIR\javacaptain_ext_settingslistener.dll -file=ABI_DIR\BUILD_DIR\javacaptain.exe PROGRAMS_DIR\javacaptain.exe - -// Registry -file=ABI_DIR\BUILD_DIR\javaregistryclient.dll SHARED_LIB_DIR\javaregistryclient.dll -file=ABI_DIR\BUILD_DIR\javasizehelperclient.dll SHARED_LIB_DIR\javasizehelperclient.dll -file=ABI_DIR\BUILD_DIR\javasizehelperserver.dll SHARED_LIB_DIR\javasizehelperserver.dll - -// Installer -ECOM_PLUGIN(ifeui.dll,ifeui.rsc) -data=ZRESOURCE\plugins\ifeui.rsc ECOM_RESOURCE_DIR\ifeui.rsc -data=ZPRIVATE\10003a3f\apps\javainstaller_reg.rsc \private\10003a3f\import\apps\javainstaller_reg.rsc -data=ZRESOURCE\apps\javainstaller_loc.rsc APP_RESOURCE_DIR\javainstaller_loc.rsc -data=ZRESOURCE\apps\javainstaller_icon.mif APP_BITMAP_DIR\javainstaller_icon.mif -file=ABI_DIR\BUILD_DIR\javainstaller.dll SHARED_LIB_DIR\javainstaller.dll -data=JAVA_VM_RES_BLD\javainstallerui.odc JAVA_VM_RES_IMG\javainstallerui.odc -file=ABI_DIR\BUILD_DIR\javainstallerui.dll SHARED_LIB_DIR\javainstallerui.dll -data=JAVA_VM_RES_BLD\javainstaller.odc JAVA_VM_RES_IMG\javainstaller.odc -file=ABI_DIR\BUILD_DIR\javainstallerstarter.dll PROGRAMS_DIR\javainstallerstarter.dll -file=ABI_DIR\BUILD_DIR\javapreinstaller.dll PROGRAMS_DIR\javapreinstaller.dll -data=ZRESOURCE\java\java_app_92.mif JAVA_RES_IMG\java_app.mif -data=ZRESOURCE\java\java_trusted.png JAVA_RES_IMG\java_trusted.png -data=ZRESOURCE\java\java_untrusted.png JAVA_RES_IMG\java_untrusted.png -data=DATAZ_\private\102033E6\installer\inst_plugins.cfg \private\102033E6\installer\inst_plugins.cfg - -// Launchers -file=ABI_DIR\BUILD_DIR\javalauncher.exe PROGRAMS_DIR\javalauncher.exe -ECOM_PLUGIN(javaappschemeplugin.dll,javaappschemeplugin.rsc) -data=ZRESOURCE\plugins\javaappschemeplugin.rsc ECOM_RESOURCE_DIR\javaappschemeplugin.rsc - -// SID Checker -ECOM_PLUGIN(javasidchecker.dll,10281FBE.rsc) -data=ZRESOURCE\plugins\javasidchecker.rsc ECOM_RESOURCE_DIR\javasidchecker.rsc - -// Recognizers -ECOM_PLUGIN(recjar.dll, 102031FB.rsc) -data=ZRESOURCE\plugins\recjar.rsc ECOM_RESOURCE_DIR\recjar.rsc - -// Backup & Restore -file=ABI_DIR\BUILD_DIR\javabackup.exe PROGRAMS_DIR\javabackup.exe -ECOM_PLUGIN(midp2backupplugin.dll,10282474.rsc) -data=ZRESOURCE\plugins\midp2backupplugin.rsc ECOM_RESOURCE_DIR\midp2backupplugin.rsc -data=DATAZ_\private\1028246F\backup_registration.xml \private\1028246F\backup_registration.xml -data=DATAZ_\private\102033E6\backup_registration.xml \private\102033E6\backup_registration.xml - - -///////////////////////// -// Java UIs collection // -///////////////////////// - -// CoreUi -file=ABI_DIR\BUILD_DIR\javacoreui.dll SHARED_LIB_DIR\javacoreui.dll -data=JAVA_VM_RES_BLD\javacoreui.odc JAVA_VM_RES_IMG\javacoreui.odc - -// eSWT -file=ABI_DIR\BUILD_DIR\eswt.dll SHARED_LIB_DIR\eswt.dll -data=JAVA_VM_RES_BLD\eswt.odc JAVA_VM_RES_IMG\eswt.odc -file=ABI_DIR\BUILD_DIR\eswtphysics.dll SHARED_LIB_DIR\eswtphysics.dll -file=ABI_DIR\BUILD_DIR\eswtapifacade.dll SHARED_LIB_DIR\eswtapifacade.dll -file=ABI_DIR\BUILD_DIR\eswtdirectcontent.dll SHARED_LIB_DIR\eswtdirectcontent.dll -data=JAVA_VM_RES_BLD\eswtdirectcontent.odc JAVA_VM_RES_IMG\eswtdirectcontent.odc -data=ZPRIVATE\10003a3f\apps\eswt_reg.rsc \private\10003a3f\import\apps\eswt_reg.rsc - -// LCDUI -file=ABI_DIR\BUILD_DIR\javalcdui.dll SHARED_LIB_DIR\javalcdui.dll -data=JAVA_VM_RES_BLD\javalcdui.odc JAVA_VM_RES_IMG\javalcdui.odc -file=ABI_DIR\BUILD_DIR\lcdui.dll SHARED_LIB_DIR\lcdui.dll -file=ABI_DIR\BUILD_DIR\lcdgr.dll SHARED_LIB_DIR\lcdgr.dll -file=ABI_DIR\BUILD_DIR\lcdgdrv.dll SHARED_LIB_DIR\lcdgdrv.dll -file=ABI_DIR\BUILD_DIR\lcdgdrvi.dll SHARED_LIB_DIR\lcdgdrvi.dll -file=ABI_DIR\BUILD_DIR\lcduiphysicswrap.dll SHARED_LIB_DIR\lcduiphysicswrap.dll -ECOM_PLUGIN(LCDC4K.dll, 10208164.rsc) -ECOM_PLUGIN(LCDC64K.dll, 10208162.rsc) -ECOM_PLUGIN(LCDC16MU.dll, 10208166.rsc) -ECOM_PLUGIN(LCDC16MA.dll, 10208168.rsc) -data=ZRESOURCE\java\lcdgr.rsc JAVA_RES_IMG\lcdgr.rsc -data=ZPRIVATE\10003a3f\apps\lcdui_reg.rsc \private\10003a3f\import\apps\lcdui_reg.rsc - -SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,lcdui) - -// AMMS API -file=ABI_DIR\BUILD_DIR\javaamms.dll SHARED_LIB_DIR\javaamms.dll -data=JAVA_VM_RES_BLD\javaamms.odc JAVA_VM_RES_IMG\javaamms.odc - -// Mobile Media API -file=ABI_DIR\BUILD_DIR\javamobilemedia.dll SHARED_LIB_DIR\javamobilemedia.dll -data=JAVA_VM_RES_BLD\javamobilemedia.odc JAVA_VM_RES_IMG\javamobilemedia.odc -data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaCapture.wav \System\Sounds\Digital\CamcorderJavaCapture.wav -data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaStart.wav \System\Sounds\Digital\CamcorderJavaStart.wav - -// MobInfo API -file=ABI_DIR\BUILD_DIR\javamobinfo.dll SHARED_LIB_DIR\javamobinfo.dll -data=JAVA_VM_RES_BLD\javamobinfo.odc JAVA_VM_RES_IMG\javamobinfo.odc - -// GlobalIndicators API -file=ABI_DIR\BUILD_DIR\javaglobalindicators.dll SHARED_LIB_DIR\javaglobalindicators.dll -data=JAVA_VM_RES_BLD\javaglobalindicators.odc JAVA_VM_RES_IMG\javaglobalindicators.odc - -// SoftNotification API -file=ABI_DIR\BUILD_DIR\javasoftnotification.dll SHARED_LIB_DIR\javasoftnotification.dll -data=JAVA_VM_RES_BLD\javasoftnotification.odc JAVA_VM_RES_IMG\javasoftnotification.odc - -// 2G API -file=ABI_DIR\BUILD_DIR\javam2g.dll SHARED_LIB_DIR\javam2g.dll -data=JAVA_VM_RES_BLD\javam2g.odc JAVA_VM_RES_IMG\javam2g.odc - -// 3G API -file=ABI_DIR\BUILD_DIR\javam3g.dll SHARED_LIB_DIR\javam3g.dll -data=JAVA_VM_RES_BLD\javam3g.odc JAVA_VM_RES_IMG\javam3g.odc - -// Nokia Sound API -file=ABI_DIR\BUILD_DIR\javanokiasound.dll SHARED_LIB_DIR\javanokiasound.dll -data=JAVA_VM_RES_BLD\javanokiasound.odc JAVA_VM_RES_IMG\javanokiasound.odc - -// Remote Connection Observer -file=ABI_DIR\BUILD_DIR\javaremconobserver.dll SHARED_LIB_DIR\javaremconobserver.dll - -// Legacy utilities -file=ABI_DIR\BUILD_DIR\javalegacyutils.dll SHARED_LIB_DIR\javalegacyutils.dll -data=JAVA_VM_RES_BLD\javalegacyutils.odc JAVA_VM_RES_IMG\javalegacyutils.odc - - -///////////////////////////// -// Java Runtimes collection // -///////////////////////////// - -// Runtime utilities -file=ABI_DIR\BUILD_DIR\javaruntimeui.dll SHARED_LIB_DIR\javaruntimeui.dll -data=JAVA_VM_RES_BLD\javaruntimeui.odc JAVA_VM_RES_IMG\javaruntimeui.odc -file=ABI_DIR\BUILD_DIR\javaruntimestarterutils.dll SHARED_LIB_DIR\javaruntimestarterutils.dll -file=ABI_DIR\BUILD_DIR\javastarter.dll SHARED_LIB_DIR\javastarter.dll - -// MIDP runtime -file=ABI_DIR\BUILD_DIR\javamidp.exe PROGRAMS_DIR\javamidp.exe -file=ABI_DIR\BUILD_DIR\javamidpstarter.dll SHARED_LIB_DIR\javamidpstarter.dll -file=ABI_DIR\BUILD_DIR\javamidpruntime.dll SHARED_LIB_DIR\javamidpruntime.dll -data=JAVA_VM_RES_BLD\javamidpruntime.odc JAVA_VM_RES_IMG\javamidpruntime.odc - -// An empty JVM argument modifier (to prevent 3rd parties from installing a DLL with this name) -// To enable JVM argument modifier - comment 1st line below and uncomment 2nd line below -file=ABI_DIR\BUILD_DIR\javajvmargsmodifier.dll SHARED_LIB_DIR\javajvmargsmodifier.dll -//file=ABI_DIR\BUILD_DIR\javajvmargsmodifierfile.dll SHARED_LIB_DIR\javajvmargsmodifier.dll - - -///////////////////////////// -// Java Commons collection // -///////////////////////////// - -// J9 JVM -file=ABI_DIR\BUILD_DIR\j9.dll SHARED_LIB_DIR\j9.dll -file=ABI_DIR\BUILD_DIR\j9vmall23.dll SHARED_LIB_DIR\j9vmall23.dll -file=ABI_DIR\BUILD_DIR\j9mjit23.dll SHARED_LIB_DIR\j9mjit23.dll -file=ABI_DIR\BUILD_DIR\jclcldc11_23.dll SHARED_LIB_DIR\jclcldc11_23.dll -file=ABI_DIR\BUILD_DIR\jclcdc11_23.dll SHARED_LIB_DIR\jclcdc11_23.dll -file=ABI_DIR\BUILD_DIR\j9fdm23.dll SHARED_LIB_DIR\j9fdm23.dll -file=ABI_DIR\BUILD_DIR\JvmNativePort.dll SHARED_LIB_DIR\JvmNativePort.dll -data=JAVA_RES_BLD\jvm\bin\java.properties JAVA_RES_IMG\jvm\bin\java.properties -data=JAVA_RES_BLD\jvm\lib\security\java.policy JAVA_RES_IMG\jvm\lib\security\java.policy -data=JAVA_RES_BLD\jvm\lib\security\java.security JAVA_RES_IMG\jvm\lib\security\java.security - -// Utilities -file=ABI_DIR\BUILD_DIR\javautils.dll SHARED_LIB_DIR\javautils.dll -data=JAVA_VM_RES_BLD\javautils.odc JAVA_VM_RES_IMG\javautils.odc -file=ABI_DIR\BUILD_DIR\javacomms.dll SHARED_LIB_DIR\javacomms.dll -data=JAVA_VM_RES_BLD\javacomms.odc JAVA_VM_RES_IMG\javacomms.odc -file=ABI_DIR\BUILD_DIR\javaipc.dll SHARED_LIB_DIR\javaipc.dll -file=ABI_DIR\BUILD_DIR\javafileutils.dll SHARED_LIB_DIR\javafileutils.dll -data=JAVA_VM_RES_BLD\javafileutils.odc JAVA_VM_RES_IMG\javafileutils.odc -file=ABI_DIR\BUILD_DIR\javadebugapi.dll SHARED_LIB_DIR\javadebugapi.dll - -// Security dlls -file=ABI_DIR\BUILD_DIR\javasecurity.dll SHARED_LIB_DIR\javasecurity.dll -data=JAVA_VM_RES_BLD\javasecurity.odc JAVA_VM_RES_IMG\javasecurity.odc -ECOM_PLUGIN(javaunicertstoreplugin.dll,200213A3.rsc) -data=ZRESOURCE\plugins\javaunicertstoreplugin.rsc ECOM_RESOURCE_DIR\javaunicertstoreplugin.rsc - -// Security certs & policies -data=JAVA_POLICY_BLD\s60_manufacturer.ser JAVA_POLICY_IMG\s60_manufacturer.ser -data=JAVA_POLICY_BLD\s60_operator.ser JAVA_POLICY_IMG\s60_operator.ser -data=JAVA_POLICY_BLD\s60_trustedthirdparty.ser JAVA_POLICY_IMG\s60_trustedthirdparty.ser -data=JAVA_POLICY_BLD\s60_untrusted.ser JAVA_POLICY_IMG\s60_untrusted.ser -data=JAVA_POLICY_BLD\msa_manufacturer.ser JAVA_POLICY_IMG\msa_manufacturer.ser -data=JAVA_POLICY_BLD\msa_operator.ser JAVA_POLICY_IMG\msa_operator.ser -data=JAVA_POLICY_BLD\msa_trustedthirdparty.ser JAVA_POLICY_IMG\msa_trustedthirdparty.ser -data=JAVA_POLICY_BLD\msa_untrusted.ser JAVA_POLICY_IMG\msa_untrusted.ser -data=JAVA_POLICY_BLD\att_manufacturer.ser JAVA_POLICY_IMG\att_manufacturer.ser -data=JAVA_POLICY_BLD\att_operator.ser JAVA_POLICY_IMG\att_operator.ser -data=JAVA_POLICY_BLD\att_operatorextra.ser JAVA_POLICY_IMG\att_operatorextra.ser -data=JAVA_POLICY_BLD\att_trustedthirdparty.ser JAVA_POLICY_IMG\att_trustedthirdparty.ser -data=JAVA_POLICY_BLD\att_untrusted.ser JAVA_POLICY_IMG\att_untrusted.ser -data=JAVA_POLICY_BLD\all.ser JAVA_POLICY_IMG\all.ser - - -// Java environment info -file=ABI_DIR\BUILD_DIR\javaenvinfo.dll SHARED_LIB_DIR\javaenvinfo.dll -data=ABI_DIR\BUILD_DIR\Z\Resource\versions\java.txt RESOURCE_FILES_DIR\versions\java.txt - -// Storage -file=ABI_DIR\BUILD_DIR\javastorage.dll SHARED_LIB_DIR\javastorage.dll -data=JAVA_VM_RES_BLD\javastorage.odc JAVA_VM_RES_IMG\javastorage.odc - -// GCF base -file=ABI_DIR\BUILD_DIR\javagcf.dll SHARED_LIB_DIR\javagcf.dll -data=JAVA_VM_RES_BLD\javagcf.odc JAVA_VM_RES_IMG\javagcf.odc - -// Connection Manager -file=ABI_DIR\BUILD_DIR\javaconnectionmanager.dll SHARED_LIB_DIR\javaconnectionmanager.dll -data=JAVA_VM_RES_BLD\javaconnectionmanager.odc JAVA_VM_RES_IMG\javaconnectionmanager.odc - -// Http & https protocols -file=ABI_DIR\BUILD_DIR\javahttp.dll SHARED_LIB_DIR\javahttp.dll -file=ABI_DIR\BUILD_DIR\javahttps.dll SHARED_LIB_DIR\javahttps.dll -data=JAVA_VM_RES_BLD\javahttp.odc JAVA_VM_RES_IMG\javahttp.odc -data=JAVA_VM_RES_BLD\javahttps.odc JAVA_VM_RES_IMG\javahttps.odc - -// Socket protocol -file=ABI_DIR\BUILD_DIR\javasocket.dll SHARED_LIB_DIR\javasocket.dll -file=ABI_DIR\BUILD_DIR\javasocketscplugin.dll SHARED_LIB_DIR\javasocketscplugin.dll -data=JAVA_VM_RES_BLD\javasocket.odc JAVA_VM_RES_IMG\javasocket.odc - -// Secure socket protocol -file=ABI_DIR\BUILD_DIR\javassl.dll SHARED_LIB_DIR\javassl.dll -data=JAVA_VM_RES_BLD\javassl.odc JAVA_VM_RES_IMG\javassl.odc - - -//////////////////////////////// -// Java Extensions collection // -//////////////////////////////// - -// Push -file=ABI_DIR\BUILD_DIR\javapushcontroller.dll SHARED_LIB_DIR\javapushcontroller.dll -file=ABI_DIR\BUILD_DIR\javapushregistry.dll SHARED_LIB_DIR\javapushregistry.dll -data=JAVA_VM_RES_BLD\javapushregistry.odc JAVA_VM_RES_IMG\javapushregistry.odc - -// Bluetooth -file=ABI_DIR\BUILD_DIR\javabluecove.dll SHARED_LIB_DIR\javabluecove.dll -file=ABI_DIR\BUILD_DIR\javabluetooth.dll SHARED_LIB_DIR\javabluetooth.dll -file=ABI_DIR\BUILD_DIR\javabluetoothcommons.dll SHARED_LIB_DIR\javabluetoothcommons.dll -file=ABI_DIR\BUILD_DIR\javabtgoepscplugin.dll SHARED_LIB_DIR\javabtgoepscplugin.dll -file=ABI_DIR\BUILD_DIR\javabtl2capscplugin.dll SHARED_LIB_DIR\javabtl2capscplugin.dll -file=ABI_DIR\BUILD_DIR\javabtsppscplugin.dll SHARED_LIB_DIR\javabtsppscplugin.dll -data=JAVA_VM_RES_BLD\javabluecove.odc JAVA_VM_RES_IMG\javabluecove.odc -data=JAVA_VM_RES_BLD\javabluetooth.odc JAVA_VM_RES_IMG\javabluetooth.odc -data=JAVA_VM_RES_BLD\javabluetoothcommons.odc JAVA_VM_RES_IMG\javabluetoothcommons.odc - -// WMA -file=ABI_DIR\BUILD_DIR\javawma.dll SHARED_LIB_DIR\javawma.dll -file=ABI_DIR\BUILD_DIR\javawmamms.dll SHARED_LIB_DIR\javawmamms.dll -file=ABI_DIR\BUILD_DIR\javacbsscplugin.dll SHARED_LIB_DIR\javacbsscplugin.dll -file=ABI_DIR\BUILD_DIR\javammsscplugin.dll SHARED_LIB_DIR\javammsscplugin.dll -file=ABI_DIR\BUILD_DIR\javasmsscplugin.dll SHARED_LIB_DIR\javasmsscplugin.dll -data=JAVA_VM_RES_BLD\javawma.odc JAVA_VM_RES_IMG\javawma.odc -data=JAVA_VM_RES_BLD\javawmamms.odc JAVA_VM_RES_IMG\javawmamms.odc - -// Comm -file=ABI_DIR\BUILD_DIR\javacomm.dll SHARED_LIB_DIR\javacomm.dll -data=JAVA_VM_RES_BLD\javacomm.odc JAVA_VM_RES_IMG\javacomm.odc - -// Datagram -file=ABI_DIR\BUILD_DIR\javadatagram.dll SHARED_LIB_DIR\javadatagram.dll -file=ABI_DIR\BUILD_DIR\javadatagramscplugin.dll SHARED_LIB_DIR\javadatagramscplugin.dll -data=JAVA_VM_RES_BLD\javadatagram.odc JAVA_VM_RES_IMG\javadatagram.odc - -// Location API -file=ABI_DIR\BUILD_DIR\javalocation.dll SHARED_LIB_DIR\javalocation.dll -data=JAVA_VM_RES_BLD\javalocation.odc JAVA_VM_RES_IMG\javalocation.odc - -// Sensor API -file=ABI_DIR\BUILD_DIR\javasensor.dll SHARED_LIB_DIR\javasensor.dll -data=JAVA_VM_RES_BLD\javasensor.odc JAVA_VM_RES_IMG\javasensor.odc - -// Web services API -file=ABI_DIR\BUILD_DIR\javawebservices.dll SHARED_LIB_DIR\javawebservices.dll -data=JAVA_VM_RES_BLD\javawebservices.odc JAVA_VM_RES_IMG\javawebservices.odc - -// PIM API -file=ABI_DIR\BUILD_DIR\javapim.dll SHARED_LIB_DIR\javapim.dll -data=JAVA_VM_RES_BLD\javapim.odc JAVA_VM_RES_IMG\javapim.odc - -// RMS API -file=ABI_DIR\BUILD_DIR\javarms.dll SHARED_LIB_DIR\javarms.dll -data=JAVA_VM_RES_BLD\javarms.odc JAVA_VM_RES_IMG\javarms.odc - -// SATSA API -file=ABI_DIR\BUILD_DIR\javasatsa.dll SHARED_LIB_DIR\javasatsa.dll -data=JAVA_VM_RES_BLD\javasatsa.odc JAVA_VM_RES_IMG\javasatsa.odc - -// File API -file=ABI_DIR\BUILD_DIR\javafile.dll SHARED_LIB_DIR\javafile.dll -data=JAVA_VM_RES_BLD\javafile.odc JAVA_VM_RES_IMG\javafile.odc - -// IAP Info API -file=ABI_DIR\BUILD_DIR\javaiapinfo.dll SHARED_LIB_DIR\javaiapinfo.dll -data=JAVA_VM_RES_BLD\javaiapinfo.odc JAVA_VM_RES_IMG\javaiapinfo.odc - - -/////////////////// -// Miscellaneous // -/////////////////// - -// Generated localization file resources -data=JAVA_VM_RES_BLD\resources.jar JAVA_VM_RES_IMG\resources.jar - -// ODC list files -data=ZRESOURCE\java\midpOdcList JAVA_RES_IMG\midpodclist -data=ZRESOURCE\java\installerOdcList JAVA_RES_IMG\installerodclist -data=ZRESOURCE\java\tckRunnerOdcList JAVA_RES_IMG\tckrunnerodclist -data=ZRESOURCE\java\javacontrolpanelodclist JAVA_RES_IMG\javacontrolpanelodclist - -// trust roots list -data=ZRESOURCE\java\security\trustroots\midprootslist JAVA_RES_IMG\security\trustroots\midprootslist - -// Utility for Services team -file=ABI_DIR\BUILD_DIR\javaupgradeapp.exe PROGRAMS_DIR\javaupgradeapp.exe - -// Java icon size notifier ecom plugin -ECOM_PLUGIN(javaiconsizenotifplugin.dll, javaiconsizenotifplugin.rsc) -data=ZRESOURCE\plugins\javaiconsizenotifplugin.rsc ECOM_RESOURCE_DIR\javaiconsizenotifplugin.rsc - -#endif diff -r 461e71b327da -r 0553e2305d00 rom/java_3_1.iby --- a/rom/java_3_1.iby Fri Sep 17 17:50:17 2010 +0100 +++ b/rom/java_3_1.iby Fri Oct 22 14:23:56 2010 +0100 @@ -36,12 +36,13 @@ // stub sis data=ZSYSTEM\install\java.sis System\Install\java.sis +#ifdef RD_JAVA_APPLICATION_SETTINGS_QT // Application settings -file=ABI_DIR\BUILD_DIR\javaapplicationsettingsview.dll SHARED_LIB_DIR\javaapplicationsettingsview.dll -data=DATAZ_\resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin +//file=ABI_DIR\BUILD_DIR\javaapplicationsettingsview.dll SHARED_LIB_DIR\javaapplicationsettingsview.dll +//data=DATAZ_\resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin +#endif // Captain -file=ABI_DIR\BUILD_DIR\javacaptain_ext_autostarter.dll SHARED_LIB_DIR\javacaptain_ext_autostarter.dll file=ABI_DIR\BUILD_DIR\javacaptain_ext_btdeviceclassmanager.dll SHARED_LIB_DIR\javacaptain_ext_btdeviceclassmanager.dll file=ABI_DIR\BUILD_DIR\javacaptain_ext_config.dll SHARED_LIB_DIR\javacaptain_ext_config.dll file=ABI_DIR\BUILD_DIR\javacaptain_ext_ondemand_2.dll SHARED_LIB_DIR\javacaptain_ext_ondemand_2.dll @@ -61,6 +62,8 @@ file=ABI_DIR\BUILD_DIR\javasizehelperserver.dll SHARED_LIB_DIR\javasizehelperserver.dll // Installer +ECOM_PLUGIN(ifeui.dll,ifeui.rsc) +data=ZRESOURCE\plugins\ifeui.rsc ECOM_RESOURCE_DIR\ifeui.rsc data=ZPRIVATE\10003a3f\apps\javainstaller_reg.rsc \private\10003a3f\import\apps\javainstaller_reg.rsc data=ZRESOURCE\apps\javainstaller_loc.rsc APP_RESOURCE_DIR\javainstaller_loc.rsc data=ZRESOURCE\apps\javainstaller_icon.mif APP_BITMAP_DIR\javainstaller_icon.mif @@ -71,21 +74,23 @@ file=ABI_DIR\BUILD_DIR\javainstallerstarter.dll PROGRAMS_DIR\javainstallerstarter.dll file=ABI_DIR\BUILD_DIR\javapreinstaller.dll PROGRAMS_DIR\javapreinstaller.dll data=ZRESOURCE\java\java_app_92.mif JAVA_RES_IMG\java_app.mif -data=ZRESOURCE\java\java_3_trusted.png JAVA_RES_IMG\java_3_trusted.png -data=ZRESOURCE\java\java_3_untrusted.png JAVA_RES_IMG\java_3_untrusted.png -data=ZRESOURCE\java\javaapplicationinstaller.css JAVA_RES_IMG\javaapplicationinstaller.css +data=ZRESOURCE\java\java_trusted.png JAVA_RES_IMG\java_trusted.png +data=ZRESOURCE\java\java_untrusted.png JAVA_RES_IMG\java_untrusted.png data=DATAZ_\private\102033E6\installer\inst_plugins.cfg \private\102033E6\installer\inst_plugins.cfg // Launchers file=ABI_DIR\BUILD_DIR\javalauncher.exe PROGRAMS_DIR\javalauncher.exe -file=ABI_DIR\BUILD_DIR\javaappscheme.exe PROGRAMS_DIR\javaappscheme.exe -file=ABI_DIR\BUILD_DIR\javaqtrequest.exe PROGRAMS_DIR\javaqtrequest.exe +ECOM_PLUGIN(javaappschemeplugin.dll,javaappschemeplugin.rsc) +data=ZRESOURCE\plugins\javaappschemeplugin.rsc ECOM_RESOURCE_DIR\javaappschemeplugin.rsc + +// SID Checker +ECOM_PLUGIN(javasidchecker.dll,javasidchecker.rsc) +data=ZRESOURCE\plugins\javasidchecker.rsc ECOM_RESOURCE_DIR\javasidchecker.rsc #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK // Usif installer plugin ECOM_PLUGIN(javasifplugin.dll,javasifplugin.rsc) data=ZRESOURCE\plugins\javasifplugin.rsc ECOM_RESOURCE_DIR\javasifplugin.rsc -file=ABI_DIR\BUILD_DIR\javainstallcopier.exe PROGRAMS_DIR\javainstallcopier.exe #endif // Recognizers @@ -113,13 +118,22 @@ // eSWT file=ABI_DIR\BUILD_DIR\eswtqt.dll SHARED_LIB_DIR\eswtqt.dll data=JAVA_VM_RES_BLD\eswtqt.odc JAVA_VM_RES_IMG\eswtqt.odc -file=ABI_DIR\BUILD_DIR\eswtqtwebkit.dll SHARED_LIB_DIR\eswtqtwebkit.dll -data=JAVA_VM_RES_BLD\eswtqtwebkit.odc JAVA_VM_RES_IMG\eswtqtwebkit.odc // LCDUI file=ABI_DIR\BUILD_DIR\openlcdui.dll SHARED_LIB_DIR\openlcdui.dll data=JAVA_VM_RES_BLD\openlcdui.odc JAVA_VM_RES_IMG\openlcdui.odc - +// AMMS API +/* +file=ABI_DIR\BUILD_DIR\javaamms.dll SHARED_LIB_DIR\javaamms.dll +data=JAVA_VM_RES_BLD\javaamms.odc JAVA_VM_RES_IMG\javaamms.odc +*/ +// Mobile Media API +/* +file=ABI_DIR\BUILD_DIR\javamobilemedia.dll SHARED_LIB_DIR\javamobilemedia.dll +data=JAVA_VM_RES_BLD\javamobilemedia.odc JAVA_VM_RES_IMG\javamobilemedia.odc +data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaCapture.wav \System\Sounds\Digital\CamcorderJavaCapture.wav +data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaStart.wav \System\Sounds\Digital\CamcorderJavaStart.wav +*/ // MobInfo API file=ABI_DIR\BUILD_DIR\javamobinfo.dll SHARED_LIB_DIR\javamobinfo.dll data=JAVA_VM_RES_BLD\javamobinfo.odc JAVA_VM_RES_IMG\javamobinfo.odc @@ -133,21 +147,22 @@ data=JAVA_VM_RES_BLD\javasoftnotification.odc JAVA_VM_RES_IMG\javasoftnotification.odc */ -// M2G API +// 2G API /*file=ABI_DIR\BUILD_DIR\javam2g.dll SHARED_LIB_DIR\javam2g.dll data=JAVA_VM_RES_BLD\javam2g.odc JAVA_VM_RES_IMG\javam2g.odc */ -// M3G API -file=ABI_DIR\BUILD_DIR\javam3g.dll SHARED_LIB_DIR\javam3g.dll +// 3G API +/*file=ABI_DIR\BUILD_DIR\javam3g.dll SHARED_LIB_DIR\javam3g.dll data=JAVA_VM_RES_BLD\javam3g.odc JAVA_VM_RES_IMG\javam3g.odc - +*/ // Nokia UI API file=ABI_DIR\BUILD_DIR\javanokiaui.dll SHARED_LIB_DIR\javanokiaui.dll data=JAVA_VM_RES_BLD\javanokiaui.odc JAVA_VM_RES_IMG\javanokiaui.odc // Nokia Sound API -file=ABI_DIR\BUILD_DIR\javanokiasound.dll SHARED_LIB_DIR\javanokiasound.dll +/*file=ABI_DIR\BUILD_DIR\javanokiasound.dll SHARED_LIB_DIR\javanokiasound.dll data=JAVA_VM_RES_BLD\javanokiasound.odc JAVA_VM_RES_IMG\javanokiasound.odc +*/ // Remote Connection Observer /*file=ABI_DIR\BUILD_DIR\javaremconobserver.dll SHARED_LIB_DIR\javaremconobserver.dll @@ -166,7 +181,6 @@ file=ABI_DIR\BUILD_DIR\javaruntimeui.dll SHARED_LIB_DIR\javaruntimeui.dll data=JAVA_VM_RES_BLD\javaruntimeui.odc JAVA_VM_RES_IMG\javaruntimeui.odc file=ABI_DIR\BUILD_DIR\javaruntimestarterutils.dll SHARED_LIB_DIR\javaruntimestarterutils.dll -file=ABI_DIR\BUILD_DIR\javastarter.dll SHARED_LIB_DIR\javastarter.dll // MIDP runtime file=ABI_DIR\BUILD_DIR\javamidp.exe PROGRAMS_DIR\javamidp.exe @@ -331,15 +345,6 @@ file=ABI_DIR\BUILD_DIR\javaiapinfo.dll SHARED_LIB_DIR\javaiapinfo.dll data=JAVA_VM_RES_BLD\javaiapinfo.odc JAVA_VM_RES_IMG\javaiapinfo.odc -// MMAPI -file=ABI_DIR\BUILD_DIR\javamobilemedia.dll SHARED_LIB_DIR\javamobilemedia.dll -data=JAVA_VM_RES_BLD\javamobilemedia.odc JAVA_VM_RES_IMG\javamobilemedia.odc -data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaCapture.wav \System\Sounds\Digital\CamcorderJavaCapture.wav -data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaStart.wav \System\Sounds\Digital\CamcorderJavaStart.wav - -// AMMS -file=ABI_DIR\BUILD_DIR\javaamms.dll SHARED_LIB_DIR\javaamms.dll -data=JAVA_VM_RES_BLD\javaamms.odc JAVA_VM_RES_IMG\javaamms.odc /////////////////// // Miscellaneous // @@ -352,12 +357,8 @@ data=ZRESOURCE\java\midpOdcList JAVA_RES_IMG\midpodclist data=ZRESOURCE\java\installerOdcList JAVA_RES_IMG\installerodclist data=ZRESOURCE\java\tckRunnerOdcList JAVA_RES_IMG\tckrunnerodclist -data=ZRESOURCE\java\javacontrolpanelodclist JAVA_RES_IMG\javacontrolpanelodclist // trust roots list data=ZRESOURCE\java\security\trustroots\midprootslist JAVA_RES_IMG\security\trustroots\midprootslist -// Utility for Services team -file=ABI_DIR\BUILD_DIR\javaupgradeapp.exe PROGRAMS_DIR\javaupgradeapp.exe - #endif diff -r 461e71b327da -r 0553e2305d00 rom/javacontrolpanelodclist --- a/rom/javacontrolpanelodclist Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -javautils.odc -javacomms.odc -javalegacyutils.odc -eswt.odc -eswtdirectcontent.odc -resources.jar -javacontrolpanel.odc diff -r 461e71b327da -r 0553e2305d00 rom/javacontrolpanelodclist30 --- a/rom/javacontrolpanelodclist30 Fri Sep 17 17:50:17 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -javautils.odc -javacomms.odc -eswtqt.odc -resources.jar -javacontrolpanel.odc diff -r 461e71b327da -r 0553e2305d00 rom/javatest.iby --- a/rom/javatest.iby Fri Sep 17 17:50:17 2010 +0100 +++ b/rom/javatest.iby Fri Oct 22 14:23:56 2010 +0100 @@ -46,10 +46,9 @@ data=JAVA_CERT_BLD\test_trustedthirdparty.der JAVA_CERT_IMG\test_trustedthirdparty.der data=JAVA_CERT_BLD\test_trustedthirdparty.metadata JAVA_CERT_IMG\test_trustedthirdparty.metadata -// Java Control Panel test utility -file=ABI_DIR\BUILD_DIR\javacontrolpanel.exe PROGRAMS_DIR\javacontrolpanel.exe -file=ABI_DIR\BUILD_DIR\javacontrolpanel.dll SHARED_LIB_DIR\javacontrolpanel.dll -data=JAVA_VM_ODC_BLD\javacontrolpanel.odc JAVA_VM_ODC_IMG\javacontrolpanel.odc -data=ZPRIVATE\10003a3f\apps\javacontrolpanel_reg.rsc \private\10003a3f\import\apps\javacontrolpanel_reg.rsc +// JavaCap App test utility +file=ABI_DIR\BUILD_DIR\JavaCap.exe PROGRAMS_DIR\JavaCap.exe +data=ZPRIVATE\10003a3f\apps\JavaCap_reg.rsc \private\10003a3f\import\apps\JavaCap_reg.rsc +data=\epoc32\data\z\resource\apps\JavaCap.rsc \resource\apps\JavaCap.rsc #endif diff -r 461e71b327da -r 0553e2305d00 rom/midpodclist diff -r 461e71b327da -r 0553e2305d00 rom/midpodclist30 --- a/rom/midpodclist30 Fri Sep 17 17:50:17 2010 +0100 +++ b/rom/midpodclist30 Fri Oct 22 14:23:56 2010 +0100 @@ -1,5 +1,4 @@ eswtqt.odc -javaamms.odc javabluecove.odc javabluetooth.odc javabluetoothcommons.odc @@ -18,7 +17,6 @@ javam3g.odc javamidpruntime.odc javamobinfo.odc -javamobilemedia.odc javanokiasound.odc javapim.odc javapushregistry.odc