# HG changeset patch # User srilekhas # Date 1282577924 -3600 # Node ID d1278d87b01e2a4ba19fd2372776f54c6117c4b8 # Parent 6c158198356e0b22b1f6c547ccad9fa72e3d2959# Parent 5bec7efefe18593e0ea105aed30507976e64a38e Merge RCL_3 fixes with latest delivery. diff -r 5bec7efefe18 -r d1278d87b01e bld.inf --- a/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/bld.inf Mon Aug 23 16:38:44 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 "build/bld.inf" -#include "jrt_plat/group/bld.inf" +#include "javaextensions/bld.inf" diff -r 5bec7efefe18 -r d1278d87b01e build/Makefile.comp --- a/build/Makefile.comp Mon Jul 19 17:58:36 2010 +0100 +++ b/build/Makefile.comp Mon Aug 23 16:38:44 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),) - $(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) + echo $(RELEASABLE_PATH)/$(BASENAME).odc endif # Remove all generated build files @@ -185,11 +185,11 @@ build_native: $(PHASEINFO) - $(SBS) -c $(PLATFORM)_$(CFG) BUILD + $(SBS) -c $(PLATFORM)_$(CFG) -fastbuild: export java +fastbuild: java $(PHASEINFO) - $(SBS) -c $(PLATFORM)_$(CFG) TARGET + $(SBS) -c $(PLATFORM)_$(CFG) build_clean_native: $(PHASEINFO) diff -r 5bec7efefe18 -r d1278d87b01e build/Makefile.defs --- a/build/Makefile.defs Mon Jul 19 17:58:36 2010 +0100 +++ b/build/Makefile.defs Mon Aug 23 16:38:44 2010 +0100 @@ -262,10 +262,9 @@ 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 5bec7efefe18 -r d1278d87b01e build/Makefile.project --- a/build/Makefile.project Mon Jul 19 17:58:36 2010 +0100 +++ b/build/Makefile.project Mon Aug 23 16:38:44 2010 +0100 @@ -174,13 +174,6 @@ ifdef RD_JAVA_USIF_ENABLED SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK = 1 PROJECT_DEFINES += SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - # Following flag enables application registrations to USIF - # and disables application registrations to AppArc. - PROJECT_DEFINES += RD_JAVA_USIF_APP_REG - # Following flag enables application notifications to AppArc. - #PROJECT_DEFINES += RD_JAVA_USIF_NOTIFY_APP_ARC - # Following flag enables installation progress notifications through USIF. - #PROJECT_DEFINES += RD_JAVA_USIF_NOTIFY_PROGRESS endif # Java proximity Listener support exsist in 9.2 only(can not be used if 5.0 untill IAD dependecy mentioned) diff -r 5bec7efefe18 -r d1278d87b01e build/Makefile.subsystem --- a/build/Makefile.subsystem Mon Jul 19 17:58:36 2010 +0100 +++ b/build/Makefile.subsystem Mon Aug 23 16:38:44 2010 +0100 @@ -211,7 +211,7 @@ $(SBS) -c $(PLATFORM)_$(CFG) fastbuild: export java - $(SBS) -c $(PLATFORM)_$(CFG) TARGET + $(SBS) -c $(PLATFORM)_$(CFG) clean_native: $(PHASEINFO) diff -r 5bec7efefe18 -r d1278d87b01e build/bld.inf --- a/build/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/build/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -42,11 +42,15 @@ ../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_1.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) +../rom/java_2_2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) // Export ODC list files ../rom/midpodclist /epoc32/release/winscw/udeb/z/resource/java/midpodclist @@ -61,6 +65,10 @@ ../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 5bec7efefe18 -r d1278d87b01e build/buildutils/checkcopyrights.py --- a/build/buildutils/checkcopyrights.py Mon Jul 19 17:58:36 2010 +0100 +++ b/build/buildutils/checkcopyrights.py Mon Aug 23 16:38:44 2010 +0100 @@ -13,48 +13,54 @@ # Contributors: # # Description: -# Checks that all the source files have a proper copyright header. +# Checks that all the source files have a proper EPL copyright header. # Ignores number of known 3rd party source files and directories. # -# Run this script on a clean workarea in order to avoid warnings -# about exported files and qmake generated files. +# Run this script on a clean workarea in order to avoid warnings +# about exported files and qmake generated files. # -# The excluded directories should be checked every now and then -# so that there won't be other problems (like files without any -# header). +# The excluded directories should be checked every now and then +# so that there won't be other problems (like files without any header). import sys, os, re # Specify here the file types to be checked checkedFileTypes = [".cpp", ".h", ".java", ".py", ".mk"] -# Include here the directories to be ignored -ignoredDirectories = [ - "javaextensions\\bluetooth\\bluecove", # Bluecove - "javacommons\\jvms\\j9\\s60\\inc", # IBM J9 - "javauis\\eswt_akn", # eSWT checked separately - "javauis\\eswt_qt", # eSWT checked separately - "javauis\\tsrc\\fute\\eswt\\", # eSWT checked separately - "javaextensions\\webservices", # Webservices not delivered - "jrt\\tools", # Tools not delivered - "\\internal" # Internal directories not delivered - ] -# Include here any individual files to be ignored -ignoredFiles = [ - "javacommons\\jvms\\cldc_1.1.1\\javasrc\\java\\util\\Timer.java", # Apache license - "javacommons\\jvms\\cldc_1.1.1\\javasrc\\java\\util\\TimerTask.java", # Apache license - "javacommons\\jvms\\cldc_1.1.1\\tsrc\\javasrc\\com\\nokia\\mj\\test\\java\\util\\TimerTaskTest.java", # Apache license - "javacommons\\jvms\\cldc_1.1.1\\tsrc\\javasrc\\com\\nokia\\mj\\test\\java\\util\\TimerTest.java", # Apache license - "javacommons\\utils\\inc\\convertutf.h", # Unicode Inc. - "javacommons\\utils\\src\\convertutf.cpp" # Unicode Inc. -] - -# The copyright text to be checked -copyrightText = "Nokia Corporation and/or its subsidiary(-ies)" +# The copyright texts to be searched for +copyrightText1 = "Nokia Corporation and/or its subsidiary(-ies)" +copyrightText2 = "Eclipse Public License v1.0" def main(): + + root = sys.argv[1] + if root[-1] != '\\': + root = root + '\\' + + # Include here the directories to be ignored + ignoredDirectories = [ + root + "javaextensions\\bluetooth\\bluecove", # Bluecove + root + "javacommons\\jvms\\j9\\s60\\inc", # IBM J9 + root + "javauis\\eswt_akn", # eSWT checked separately + root + "javauis\\eswt_qt", # eSWT checked separately + root + "javauis\\tsrc\\fute\\eswt\\", # eSWT checked separately + root + "javaextensions\\webservices", # Webservices not delivered + root + "tools", # Tools not delivered + "\\internal" # Internal directories not delivered + ] + + # Include here any individual files to be ignored + ignoredFiles = [ + root + "javacommons\\jvms\\cldc_1.1.1\\javasrc\\java\\util\\Timer.java", # Apache license + root + "javacommons\\jvms\\cldc_1.1.1\\javasrc\\java\\util\\TimerTask.java", # Apache license + root + "javacommons\\jvms\\cldc_1.1.1\\tsrc\\javasrc\\com\\nokia\\mj\\test\\java\\util\\TimerTaskTest.java", # Apache license + root + "javacommons\\jvms\\cldc_1.1.1\\tsrc\\javasrc\\com\\nokia\\mj\\test\\java\\util\\TimerTest.java", # Apache license + root + "javacommons\\utils\\inc\\convertutf.h", # Unicode Inc. + root + "javacommons\\utils\\src\\convertutf.cpp" # Unicode Inc. + ] + def visitFun(arg, dirname, names): @@ -94,16 +100,29 @@ # print "Ignoring file", f continue - # Check if the file contains the copyright text + # Check if the file contains the copyright texts try: file = open(fname) + + # Search for the first text found = False line = file.readline() while line != "": - if copyrightText in line: + if copyrightText1 in line: found = True break; - line = file.readline() + line = file.readline() + + # Search the second copyright text as well + if found: + found = False + line = file.readline() + while line != "": + if copyrightText2 in line: + found = True + break; + line = file.readline() + file.close() except IOError: @@ -112,8 +131,8 @@ if not found: print fname continue - - os.path.walk(sys.argv[1], visitFun, None) + + os.path.walk(root, visitFun, None) if __name__ == "__main__": diff -r 5bec7efefe18 -r d1278d87b01e build/buildutils/checkfilenames.py --- a/build/buildutils/checkfilenames.py Mon Jul 19 17:58:36 2010 +0100 +++ b/build/buildutils/checkfilenames.py Mon Aug 23 16:38:44 2010 +0100 @@ -64,6 +64,7 @@ # Other peculiar filenames: "installerodclist", "installerodclist30", "midpodclist", "midpodclist30", "notice", "package-list", "tckrunnerodclist", "tckrunnerodclist30", "unknowncert","midprootslist", + "javacontrolpanelodclist", "javacontrolpanelodclist30", ] # Command line options. diff -r 5bec7efefe18 -r d1278d87b01e build/buildutils/checkjavapackages.py --- a/build/buildutils/checkjavapackages.py Mon Jul 19 17:58:36 2010 +0100 +++ b/build/buildutils/checkjavapackages.py Mon Aug 23 16:38:44 2010 +0100 @@ -16,13 +16,17 @@ # 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(): - files = [] + root = sys.argv[1] + all = len(sys.argv) > 2 and sys.argv[2] == '-all' + # Create a reg exp matching to "package x.y.z;" with whitespace ignored regex = re.compile("\\s*package\\s*([\\w.]*);.*", re.IGNORECASE) @@ -31,8 +35,12 @@ # Skip SVN directories if dirname.find("\\.svn") != -1: - return names + return + # Skip tsrc + if not all and dirname.find("\\tsrc") != -1: + return + for f in names: if not f.endswith(".java"): continue @@ -63,7 +71,7 @@ except IOError: print "Error reading the file " + fname - os.path.walk(sys.argv[1], visitFun, files) + os.path.walk(sys.argv[1], visitFun, None) if __name__ == "__main__": diff -r 5bec7efefe18 -r d1278d87b01e build/buildutils/svnchangeids.py --- a/build/buildutils/svnchangeids.py Mon Jul 19 17:58:36 2010 +0100 +++ b/build/buildutils/svnchangeids.py Mon Aug 23 16:38:44 2010 +0100 @@ -59,6 +59,7 @@ 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 @@ -67,6 +68,11 @@ 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 5bec7efefe18 -r d1278d87b01e build/codescanner_high.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/codescanner_high.xml Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,61 @@ + + + + + + + .*\.au + .*\.avi + .*\.bmp + .*\.dll + .*\.doc + .*\.exe + .*\.gif + .*\.jpg + .*\.mbm + .*\.mp3 + .*\.mpg + .*\.png + .*\.raw + .*\.rtf + .*\.tif + .*\.wav + .*\.wbmp + .*\.wmf + .*\.xls + + .*\\ts_.* + .*\\tsrc\\.* + .*\\tsrc.s60\\.* + .*\\test\\.* + .*\\internal\\.* + .*\\Internal\\.* + .*\\.svn\\.* + \\tools\\.* + + + + + + + + + + diff -r 5bec7efefe18 -r d1278d87b01e build/exports.inf --- a/build/exports.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/build/exports.inf Mon Aug 23 16:38:44 2010 +0100 @@ -40,11 +40,15 @@ ../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_1.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) +../rom/java_2_2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby) // Export ODC list files ../rom/midpodclist /epoc32/release/winscw/udeb/z/resource/java/midpodclist @@ -59,6 +63,10 @@ ../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 5bec7efefe18 -r d1278d87b01e build/loc/resources.jar Binary file build/loc/resources.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e build/loc/resources_qt.jar Binary file build/loc/resources_qt.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e build/makefile --- a/build/makefile Mon Jul 19 17:58:36 2010 +0100 +++ b/build/makefile Mon Aug 23 16:38:44 2010 +0100 @@ -61,6 +61,9 @@ javatools \ javaextensions +# Set order explicitly to get Java building as first +SUBTARGETS = $(COMPONENTS) $(NONQTSUBSYSTEMS) $(SUBSYSTEMS) + # ------------------------------------------------------- include ${JAVA_SRC_ROOT}/build/Makefile.subsystem diff -r 5bec7efefe18 -r d1278d87b01e build/makefile.javaversion --- a/build/makefile.javaversion Mon Jul 19 17:58:36 2010 +0100 +++ b/build/makefile.javaversion Mon Aug 23 16:38:44 2010 +0100 @@ -1,6 +1,2 @@ # Set Java version (must be dot separated, without spaces) -ifdef RD_JAVA_S60_RELEASE_5_0_IAD - JAVA_VERSION = 2.1.30 -else - JAVA_VERSION = 2.1.30 -endif +JAVA_VERSION = 2.2.9 diff -r 5bec7efefe18 -r d1278d87b01e build/nativejava.flm --- a/build/nativejava.flm Mon Jul 19 17:58:36 2010 +0100 +++ b/build/nativejava.flm Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available # under the terms of "Eclipse Public License v1.0" @@ -23,23 +23,67 @@ # 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))) -JAVABUILDCMD = make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ +# General Java makefile command +JAVACMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \ PLATFORM=$(PLATFORM) CFG=$(CFG) BLD_INF_JAVA=1 -define java_build -RESOURCE:: +# 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: $(call startrule,compilenativejava,,javasources) \ - $(JAVABUILDCMD) java finalactions\ + $(JAVABUILDCMD) \ $(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) \ - $(JAVABUILDCMD) clean_java \ + $(JAVACMD) clean_java \ $(call endrule,cleannativejava) endef -$(eval $(java_build)) +$(eval $(compilenativejava)) -RELEASABLES = $(shell $(JAVABUILDCMD) -s javareleasables) +RELEASABLES:= $(shell $(JAVACMD) -s javareleasables) $(eval $(call whatmacro,$(RELEASABLES),WHATRESOURCES)) + +$(eval $(call GenerateStandardCleanTarget,$(NATIVEJAVAMARKER))) + + diff -r 5bec7efefe18 -r d1278d87b01e build/omj.pri --- a/build/omj.pri Mon Jul 19 17:58:36 2010 +0100 +++ b/build/omj.pri Mon Aug 23 16:38:44 2010 +0100 @@ -73,7 +73,7 @@ include(symbian_uids.pri) DEFINES += __SYMBIAN32__ - DEFINES += J9EPOC32 RD_JAVA_OMJ_FSERVER + DEFINES += J9EPOC32 LIBS += -llibpthread diff -r 5bec7efefe18 -r d1278d87b01e build/properties.xml diff -r 5bec7efefe18 -r d1278d87b01e build/sis/incompatible_openc.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/sis/incompatible_openc.txt Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,3 @@ +OpenC version 1.5 or later is not found. Some Java applications may not work properly. Make sure that latest device firmware is used. + +Continue installation? \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e build/sis/incompatible_platform.txt --- a/build/sis/incompatible_platform.txt Mon Jul 19 17:58:36 2010 +0100 +++ b/build/sis/incompatible_platform.txt Mon Aug 23 16:38:44 2010 +0100 @@ -1,1 +1,1 @@ -Unfortunately Java Runtime 2.0 Alpha is not compatible with your device. Java Runtime 2.0 Alpha works only on S60 5.0 devices. +Java Runtime is not compatible with your device. Java Runtime requires S60 5th Edition device. \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e build/sis/java_2_0.pkg --- a/build/sis/java_2_0.pkg Mon Jul 19 17:58:36 2010 +0100 +++ b/build/sis/java_2_0.pkg Mon Aug 23 16:38:44 2010 +0100 @@ -43,6 +43,17 @@ ; Popup error on Non-S60 v 5.0 platforms. Do not allow continuing. "incompatible_platform.txt"-"", FILETEXT, FORCEABORT ENDIF + +; Check OpenC versions +; 0x10282872 = Standard C++ library +; 0x10281F34 = Open C LIBSSL +; 0x20009a80 = Symbian OS PIPS +IF( version(0x10282872, <, 1, 5, 0) ) OR + ( version(0x10281F34, <, 1, 5, 0) ) OR + ( version(0x20009a80, <, 1, 5, 0) ) + "incompatible_openc.txt"-"", FT, TA +ENDIF + #endif // RD_JAVA_S60_RELEASE_5_0_IAD @@ -95,6 +106,7 @@ "\epoc32\release\armv5\urel\javacaptain.exe"-"c:\sys\bin\javacaptain.exe" "\epoc32\release\armv5\urel\javalauncher.exe"-"c:\sys\bin\javalauncher.exe" +"\epoc32\release\armv5\urel\javaupgradeapp.exe"-"c:\sys\bin\javaupgradeapp.exe" @@ -102,6 +114,7 @@ "\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" @@ -378,7 +391,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 @@ -475,6 +488,7 @@ "\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" @@ -491,6 +505,8 @@ "\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" #ifdef RD_JAVA_MIDPRMS_DB @@ -811,3 +827,9 @@ ; javaappbackconverter is ran after uninstallation "\epoc32\release\armv5\urel\javaappbackconverter.exe"-"c:\sys\bin\javaappbackconverter.exe", FR, RR, RW #endif // RD_JAVA_S60_RELEASE_5_0_IAD + + +#ifndef RD_JAVA_S60_RELEASE_5_0_IAD +"\epoc32\release\armv5\urel\javaiconsizenotifplugin.dll"-"c:\sys\bin\javaiconsizenotifplugin.dll" +"\epoc32\data\z\resource\plugins\javaiconsizenotifplugin.rsc"-"c:\resource\plugins\javaiconsizenotifplugin.rsc" +#endif // RD_JAVA_S60_RELEASE_5_0_IAD diff -r 5bec7efefe18 -r d1278d87b01e build/sis/java_3_1.pkg --- a/build/sis/java_3_1.pkg Mon Jul 19 17:58:36 2010 +0100 +++ b/build/sis/java_3_1.pkg Mon Aug 23 16:38:44 2010 +0100 @@ -50,12 +50,15 @@ "\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" @@ -158,13 +161,12 @@ "\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" @@ -180,7 +182,6 @@ "\epoc32\release\armv5\urel\javapushcontroller.dll"-"c:\sys\bin\javapushcontroller.dll" "\epoc32\release\armv5\urel\javaregistryclient.dll"-"c:\sys\bin\javaregistryclient.dll" "\epoc32\release\armv5\urel\javaruntimestarterutils.dll"-"c:\sys\bin\javaruntimestarterutils.dll" -"\epoc32\release\armv5\urel\javasidchecker.dll"-"c:\sys\bin\javasidchecker.dll" "\epoc32\release\armv5\urel\javasizehelperclient.dll"-"c:\sys\bin\javasizehelperclient.dll" "\epoc32\release\armv5\urel\javasizehelperserver.dll"-"c:\sys\bin\javasizehelperserver.dll" "\epoc32\release\armv5\urel\javasocketscplugin.dll"-"c:\sys\bin\javasocketscplugin.dll" @@ -190,7 +191,9 @@ "\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" @@ -203,6 +206,8 @@ "\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" #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK @@ -213,17 +218,15 @@ #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_trusted.png"-"c:\resource\java\java_trusted.png" -"\epoc32\data\z\resource\java\java_untrusted.png"-"c:\resource\java\java_untrusted.png" -"\epoc32\data\z\resource\plugins\javasidchecker.rsc" -"c:\resource\plugins\javasidchecker.rsc" +"\epoc32\data\z\resource\java\java_3_trusted.png"-"c:\resource\java\java_3_trusted.png" +"\epoc32\data\z\resource\java\java_3_untrusted.png"-"c:\resource\java\java_3_untrusted.png" +"\epoc32\data\z\resource\java\javaapplicationinstaller.css"-"c:\resource\java\javaapplicationinstaller.css" "\epoc32\data\z\resource\plugins\javaunicertstoreplugin.rsc" -"c:\resource\plugins\javaunicertstoreplugin.rsc" "\epoc32\data\z\resource\plugins\midp2backupplugin.rsc"-"c:\resource\plugins\midp2backupplugin.rsc" #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK @@ -317,14 +320,16 @@ ;"\epoc32\release\armv5\urel\javacoreui.dll"-"c:\sys\bin\javacoreui.dll" ;"\epoc32\data\z\resource\apps\javastartscreen.mif"-"c:\resource\apps\javastartscreen.mif" -;"\epoc32\release\armv5\urel\javaamms.dll"-"c:\sys\bin\javaamms.dll" -;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javaamms.odc"-"c:\resource\java\jvm\lib\jrt\javaamms.odc" +"\epoc32\release\armv5\urel\javaamms.dll"-"c:\sys\bin\javaamms.dll" +"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javaamms.odc"-"c:\resource\java\jvm\lib\jrt\javaamms.odc" ;"\epoc32\release\armv5\urel\javalegacyutils.dll"-"c:\sys\bin\javalegacyutils.dll" ;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javalegacyutils.odc"-"c:\resource\java\jvm\lib\jrt\javalegacyutils.odc" -;"\epoc32\release\armv5\urel\javamobilemedia.dll"-"c:\sys\bin\javamobilemedia.dll" -;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javamobilemedia.odc"-"c:\resource\java\jvm\lib\jrt\javamobilemedia.odc" +"\epoc32\release\armv5\urel\javamobilemedia.dll"-"c:\sys\bin\javamobilemedia.dll" +"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javamobilemedia.odc"-"c:\resource\java\jvm\lib\jrt\javamobilemedia.odc" +"\epoc32\release\armv5\urel\z\system\sounds\digital\CamcorderJavaCapture.wav"-"c:\System\Sounds\Digital\CamcorderJavaCapture.wav" +"\epoc32\release\armv5\urel\z\system\sounds\digital\CamcorderJavaStart.wav"-"c:\System\Sounds\Digital\CamcorderJavaStart.wav" ;"\epoc32\release\armv5\urel\javam2g.dll"-"c:\sys\bin\javam2g.dll" ;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javam2g.odc"-"c:\resource\java\jvm\lib\jrt\javam2g.odc" @@ -332,16 +337,20 @@ ;"\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 5bec7efefe18 -r d1278d87b01e build/sis/java_rnd_tools.pkg --- a/build/sis/java_rnd_tools.pkg Mon Jul 19 17:58:36 2010 +0100 +++ b/build/sis/java_rnd_tools.pkg Mon Aug 23 16:38:44 2010 +0100 @@ -31,10 +31,6 @@ ;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. @@ -46,3 +42,8 @@ ; 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 5bec7efefe18 -r d1278d87b01e build/symbian_uids.pri --- a/build/symbian_uids.pri Mon Jul 19 17:58:36 2010 +0100 +++ b/build/symbian_uids.pri Mon Aug 23 16:38:44 2010 +0100 @@ -116,9 +116,13 @@ contains(TARGET, openlcdui): TARGET.UID3 = 0x2002DCE2 contains(TARGET, tckrunner): TARGET.UID3 = 0x2002DCE3 +contains(TARGET, javacaptain_ext_settingslistener): TARGET.UID3 = 0x200315D8 contains(TARGET, javacaptain_ext_scrupdater): TARGET.UID3 = 0x2002DD10 contains(TARGET, javacaptain_ext_ondemand_2): TARGET.UID3 = 0x2002DD01 contains(TARGET, javanokiaui): TARGET.UID3 = 0x2002E697 +contains(TARGET, javacaptain_ext_autostarter): TARGET.UID3 = 0x2002EA7E +contains(TARGET, javacontrolpanel): TARGET.UID3 = 0x2002FF62 +contains(TARGET, eswtqtwebkit): TARGET.UID3 = 0x2002FFA9 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 5bec7efefe18 -r d1278d87b01e build/templates/10.1.layers.sysdef.xml --- a/build/templates/10.1.layers.sysdef.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/build/templates/10.1.layers.sysdef.xml Mon Aug 23 16:38:44 2010 +0100 @@ -12,26 +12,12 @@ qmakeArgs="-r" filter="!sf_build" /> - - - - - - - - - diff -r 5bec7efefe18 -r d1278d87b01e build/templates/9.2.layers.sysdef.xml --- a/build/templates/9.2.layers.sysdef.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/build/templates/9.2.layers.sysdef.xml Mon Aug 23 16:38:44 2010 +0100 @@ -10,22 +10,10 @@ - - - - - - - - - diff -r 5bec7efefe18 -r d1278d87b01e inc/build_defines.hrh --- a/inc/build_defines.hrh Mon Jul 19 17:58:36 2010 +0100 +++ b/inc/build_defines.hrh Mon Aug 23 16:38:44 2010 +0100 @@ -15,7 +15,7 @@ * */ -#define RD_JAVA_VERSION 2,1,30 +#define RD_JAVA_VERSION 2,2,9 #define RD_JAVA_SYMBIAN_TARGET #define RD_JAVA_S60_RELEASE_9_2 #define RD_JAVA_S60_RELEASE_9_2_ONWARDS diff -r 5bec7efefe18 -r d1278d87b01e inc/java.txt --- a/inc/java.txt Mon Jul 19 17:58:36 2010 +0100 +++ b/inc/java.txt Mon Aug 23 16:38:44 2010 +0100 @@ -1,1 +1,1 @@ -2.1.30 +2.2.9 diff -r 5bec7efefe18 -r d1278d87b01e inc/java_s60_release.hrh --- a/inc/java_s60_release.hrh Mon Jul 19 17:58:36 2010 +0100 +++ b/inc/java_s60_release.hrh Mon Aug 23 16:38:44 2010 +0100 @@ -1,1 +1,1 @@ -RD_JAVA_S60_RELEASE=9.2 +RD_JAVA_S60_RELEASE=9.2 diff -r 5bec7efefe18 -r d1278d87b01e javacommons/comms/build/bld.inf --- a/javacommons/comms/build/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/comms/build/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -19,5 +19,5 @@ default PRJ_MMPFILES -comms_0x2002DCA6.mmp +javacomms_0x2002DCA6.mmp #include "exports.inf" diff -r 5bec7efefe18 -r d1278d87b01e javacommons/comms/build/comms.pro --- a/javacommons/comms/build/comms.pro Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javacommons/comms/build/comms_0x2002DCA6.mmp --- a/javacommons/comms/build/comms_0x2002DCA6.mmp Mon Jul 19 17:58:36 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.3) 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 5bec7efefe18 -r d1278d87b01e javacommons/comms/build/javacomms.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/comms/build/javacomms.pro Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javacommons/comms/build/javacomms_0x2002DCA6.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/comms/build/javacomms_0x2002DCA6.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,150 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javacommons/comms/comms.pro --- a/javacommons/comms/comms.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/comms/comms.pro Mon Aug 23 16:38:44 2010 +0100 @@ -15,6 +15,6 @@ # TEMPLATE = subdirs SUBDIRS += ipclib/clientserver/build/ipc.pro -SUBDIRS += build/comms.pro +SUBDIRS += build/javacomms.pro BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"ipclib/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 5bec7efefe18 -r d1278d87b01e javacommons/comms/ipclib/clientserver/build/ipc_0x2002DCB7.mmp --- a/javacommons/comms/ipclib/clientserver/build/ipc_0x2002DCB7.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/comms/ipclib/clientserver/build/ipc_0x2002DCB7.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : ipc.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javacommons/comms/ipclib/clientserver/src.s60/commssession.cpp --- a/javacommons/comms/ipclib/clientserver/src.s60/commssession.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/comms/ipclib/clientserver/src.s60/commssession.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -87,7 +87,10 @@ } else { - WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc); + if (rc != KErrOverflow) + { + WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc); + } } } return 0; @@ -151,7 +154,10 @@ } else { - WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc); + if (rc != KErrOverflow) + { + WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc); + } } } } @@ -193,7 +199,7 @@ else { rc = KErrOverflow; - WLOG3(EJavaComms, "%s: allocated length for message is too small (required size=%d, allocated size=%d)", + LOG3(EJavaComms, EInfo, "%s: allocated length for message is too small (required size=%d, allocated size=%d)", __PRETTY_FUNCTION__, neededLength, allocatedLength); } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/comms/ipclib/clientserver/src.s60/creceiver.cpp --- a/javacommons/comms/ipclib/clientserver/src.s60/creceiver.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/comms/ipclib/clientserver/src.s60/creceiver.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -66,7 +66,7 @@ // buffer was not big enough for the message so reallocate buffer with correct size mBuffer.Close(); mBuffer.ReAllocL(mRequiredLength()); - WLOG2(EJavaComms, "%s: increasing buffer size to %d", __PRETTY_FUNCTION__, mRequiredLength()); + LOG2(EJavaComms, EInfo, "%s: increasing buffer size to %d", __PRETTY_FUNCTION__, mRequiredLength()); Receive(); } break; diff -r 5bec7efefe18 -r d1278d87b01e javacommons/comms/src/commsendpoint.cpp --- a/javacommons/comms/src/commsendpoint.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/comms/src/commsendpoint.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -295,12 +295,13 @@ break; case ETIMEDOUT: + default: mSendReceiveListeners.erase(messageRef); done = 1; - break; - - default: - ELOG2(EJavaComms, "pthread_cond_timedwait failed %d - %s", rc, strerror(rc)); + if (rc != ETIMEDOUT) + { + ELOG2(EJavaComms, "pthread_cond_timedwait failed %d - %s", rc, strerror(rc)); + } break; } } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/comms/tsrc/Makefile --- a/javacommons/comms/tsrc/Makefile Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javacommons/comms/tsrc/javaapi/Makefile --- a/javacommons/comms/tsrc/javaapi/Makefile Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javacommons/comms/tsrc/javaapi/build/build.xml --- a/javacommons/comms/tsrc/javaapi/build/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/comms/tsrc/javaapi/build/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -27,7 +27,6 @@ - @@ -41,9 +40,9 @@ - - - + + + @@ -64,7 +63,7 @@ - + diff -r 5bec7efefe18 -r d1278d87b01e javacommons/comms/tsrc/javaapi/build/javacaptain_ext_ondemand_101.pro --- a/javacommons/comms/tsrc/javaapi/build/javacaptain_ext_ondemand_101.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/comms/tsrc/javaapi/build/javacaptain_ext_ondemand_101.pro Mon Aug 23 16:38:44 2010 +0100 @@ -25,5 +25,6 @@ symbian { SOURCES += ../src.s60/lookup.cpp + TARGET.UID3 = 0xE0000055 } include(../../../../../build/omj.pri) diff -r 5bec7efefe18 -r d1278d87b01e javacommons/comms/tsrc/javaapi/subsystem.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/comms/tsrc/javaapi/subsystem.mk Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javacommons/comms/tsrc/subsystem.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/comms/tsrc/subsystem.mk Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javacommons/connectionmanager/build/javaconnectionmanager_0x2002DCA7.mmp --- a/javacommons/connectionmanager/build/javaconnectionmanager_0x2002DCA7.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/connectionmanager/build/javaconnectionmanager_0x2002DCA7.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javaconnectionmanager.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/connectionmanager/inc.s60/connectionmanager.h --- a/javacommons/connectionmanager/inc.s60/connectionmanager.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/connectionmanager/inc.s60/connectionmanager.h Mon Aug 23 16:38:44 2010 +0100 @@ -163,6 +163,7 @@ static HBufC8 * PromptUserSelectNetworkAccessPointL(); static HBufC8 * CreateDescriptorL(const int aType, const int id); + static bool checkIapDefaultL(TUint32 aMatchIapId, TUint32 aDestId, bool aDefault); diff -r 5bec7efefe18 -r d1278d87b01e javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/build/testapnsettings.mmp --- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/build/testapnsettings.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/build/testapnsettings.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -22,7 +22,9 @@ #include <../../../../../../inc/java_stdcpp_support_for_exe.hrh> #include -USERINCLUDE /epoc32/include/cpputest +USERINCLUDE /epoc32/include/cpputest // Due to TestHarness.h + +USERINCLUDE ../../inc.s60 USERINCLUDE ../../../../../../inc // Using main() as entry point diff -r 5bec7efefe18 -r d1278d87b01e javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/AllTests.h --- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/AllTests.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/AllTests.h Mon Aug 23 16:38:44 2010 +0100 @@ -15,7 +15,7 @@ * */ -#include "Utest.h" +#include "cpputest/Utest.h" //Include this in the test main to execute these tests IMPORT_TEST_GROUP(TestAPNSettings); diff -r 5bec7efefe18 -r d1278d87b01e javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/testapnsettings.cpp --- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/testapnsettings.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/testapnsettings.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -16,11 +16,9 @@ */ #include - -#include "TestHarness.h" +#include -#include "../../inc.s60/mapnsettings.h" - +#include "mapnsettings.h" #include "javastorage.h" #include "javastorageexception.h" #include "javastoragenames.h" diff -r 5bec7efefe18 -r d1278d87b01e javacommons/connectionmanager/src.s60/connectionmanager.cpp --- a/javacommons/connectionmanager/src.s60/connectionmanager.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/connectionmanager/src.s60/connectionmanager.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -65,7 +65,21 @@ EXPORT_C bool ConnectionManager::isIapDefault(TUint32 aMatchIapId, TUint32 aDestId, bool aDefault) { - LOG(ESOCKET,EInfo,"+ConnectionManager::getDefualtId"); + LOG(ESOCKET,EInfo,"+ConnectionManager::isIapDefault"); + bool retVal = false; + TRAPD(err,retVal = checkIapDefaultL(aMatchIapId,aDestId,aDefault)); + if(err!=KErrNone) + { + // error occured + return false; + } + return retVal; +} + +bool ConnectionManager::checkIapDefaultL(TUint32 aMatchIapId, TUint32 aDestId, bool aDefault) +{ + + LOG(ESOCKET,EInfo,"+ConnectionManager::checkIapDefaultL"); TUint32 id = aDestId; TUint32 tmpapId; TCmDefConnType type; @@ -79,7 +93,7 @@ mgr->ReadDefConnL(obj); id = obj.iId; type = obj.iType; - if ((type ==ECmDefConnConnectionMethod) && (type == aMatchIapId)) + if ((type ==ECmDefConnConnectionMethod) && (id == aMatchIapId)) { return true; } @@ -104,8 +118,9 @@ return true; } } - return false; - + return false; + + } // --------------------------------------------------------------------------- diff -r 5bec7efefe18 -r d1278d87b01e javacommons/fileutils/build/bld.inf --- a/javacommons/fileutils/build/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/fileutils/build/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -19,5 +19,5 @@ default PRJ_MMPFILES -fileutils_0x2002DCAD.mmp +javafileutils_0x2002DCAD.mmp #include "exports.inf" diff -r 5bec7efefe18 -r d1278d87b01e javacommons/fileutils/build/fileutils.pro --- a/javacommons/fileutils/build/fileutils.pro Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javacommons/fileutils/build/fileutils_0x2002DCAD.mmp --- a/javacommons/fileutils/build/fileutils_0x2002DCAD.mmp Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +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.3) 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 5bec7efefe18 -r d1278d87b01e javacommons/fileutils/build/javafileutils.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/fileutils/build/javafileutils.pro Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javacommons/fileutils/build/javafileutils_0x2002DCAD.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/fileutils/build/javafileutils_0x2002DCAD.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,165 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileURL.java --- a/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileURL.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileURL.java Mon Aug 23 16:38:44 2010 +0100 @@ -23,7 +23,7 @@ * differences between URL and Absolute path and make it transparent to use * from. */ -final class FileURL +public final class FileURL { private static String FILE_PREFIX = "file://"; diff -r 5bec7efefe18 -r d1278d87b01e javacommons/fileutils/src/fileutilities.cpp --- a/javacommons/fileutils/src/fileutilities.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/fileutils/src/fileutilities.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -18,6 +18,7 @@ #include #include +#include #include #include #include diff -r 5bec7efefe18 -r d1278d87b01e javacommons/fileutils/src/nativefileiohandler.cpp --- a/javacommons/fileutils/src/nativefileiohandler.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/fileutils/src/nativefileiohandler.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -18,6 +18,8 @@ #include #include #include +#include +#include #include #include diff -r 5bec7efefe18 -r d1278d87b01e javacommons/fileutils/tsrc/fileutilstestinit/build/javafileutilstestinit.pro --- a/javacommons/fileutils/tsrc/fileutilstestinit/build/javafileutilstestinit.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/fileutils/tsrc/fileutilstestinit/build/javafileutilstestinit.pro Mon Aug 23 16:38:44 2010 +0100 @@ -21,7 +21,6 @@ symbian { TARGET.CAPABILITY = all -tcb - INCLUDEPATH += /epoc32/include/caf LIBS += -lcaf -lcafutils -lefsrv -lDrmParsers -lDRMServerInterfaces } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfbase/build/javagcf_0x2002DCAE.mmp --- a/javacommons/gcfbase/build/javagcf_0x2002DCAE.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfbase/build/javagcf_0x2002DCAE.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javagcf.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/file/build/javafile_0x2002DCAC.mmp --- a/javacommons/gcfprotocols/file/build/javafile_0x2002DCAC.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/file/build/javafile_0x2002DCAC.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javafile.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/file/javasrc/com/nokia/mj/impl/file/FileConnectionImpl.java --- a/javacommons/gcfprotocols/file/javasrc/com/nokia/mj/impl/file/FileConnectionImpl.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/file/javasrc/com/nokia/mj/impl/file/FileConnectionImpl.java Mon Aug 23 16:38:44 2010 +0100 @@ -254,7 +254,7 @@ curUrl = curUrl.substring(0, curUrl.length() - 1); } String newUrl = curUrl.substring(0, curUrl.lastIndexOf('/') + 1); - newUrl += iFileUtility.getName(); + newUrl += FileUTF8Handler.encode(iFileUtility.getName()); iFileConnectionUrl = new FileConnectionURL(newUrl); } @@ -409,10 +409,6 @@ checkConnection(); checkConnectionMode(Connector.WRITE); - if (Connector.READ == iMode) - { - return false; - } return iFileUtility.canWrite(); } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/file/tsrc/mt/filetestinit/build/javafiletestinit.pro --- a/javacommons/gcfprotocols/file/tsrc/mt/filetestinit/build/javafiletestinit.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/file/tsrc/mt/filetestinit/build/javafiletestinit.pro Mon Aug 23 16:38:44 2010 +0100 @@ -21,7 +21,6 @@ symbian { TARGET.CAPABILITY = all -tcb - INCLUDEPATH += /epoc32/include/caf LIBS += -lcaf -lcafutils -lefsrv -lDrmParsers -lDRMServerInterfaces } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/http/build/javahttp.pro --- a/javacommons/gcfprotocols/http/build/javahttp.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/http/build/javahttp.pro Mon Aug 23 16:38:44 2010 +0100 @@ -13,16 +13,22 @@ # # Description: # +include(../../../../inc/build_defines.pri) TARGET=javahttp TEMPLATE=lib CONFIG += omj java stl -CONFIG -= qt symbian { + LIBS += -leuser -lhttp -lecom -lbafl -linetprotutil -lhttpfiltercommon -lx509 -lx500 -lcrypto -lesock -lcommdb -lcentralrepository -lwebutils + + contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_5_0) { + LIBS += -lcommdb + } + contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_9_2_ONWARDS) { + LIBS += -lextendedconnpref -lnetmeta + } } - - include(../../../../build/omj.pri) diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/http/build/javahttp_0x2002DCB1.mmp --- a/javacommons/gcfprotocols/http/build/javahttp_0x2002DCB1.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/http/build/javahttp_0x2002DCB1.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javahttp.mmp @@ -28,6 +28,8 @@ UID 0x1000008d 0x2002DCB1 SECUREID 0x2002DCB1 +EPOCSTACKSIZE 0x14000 +EPOCHEAPSIZE 0x020000 0x800000 EPOCALLOWDLLDATA @@ -52,15 +54,32 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER +MACRO QT_GUI_LIB +MACRO QT_CORE_LIB +SYSTEMINCLUDE /epoc32/include/mw/QtCore +SYSTEMINCLUDE /epoc32/include/mw/QtGui +SYSTEMINCLUDE /epoc32/include/mw SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian +SYSTEMINCLUDE /epoc32/include +SYSTEMINCLUDE /epoc32/include/stdapis +SYSTEMINCLUDE /epoc32/include/stdapis/sys +SYSTEMINCLUDE /epoc32/include/platform/mw +SYSTEMINCLUDE /epoc32/include/platform +SYSTEMINCLUDE /epoc32/include/app +SYSTEMINCLUDE /epoc32/include/platform/app +SYSTEMINCLUDE /epoc32/include/platform/loc +SYSTEMINCLUDE /epoc32/include/platform/mw/loc +SYSTEMINCLUDE /epoc32/include/platform/app/loc +SYSTEMINCLUDE /epoc32/include/platform/loc/sc +SYSTEMINCLUDE /epoc32/include/platform/mw/loc/sc +SYSTEMINCLUDE /epoc32/include/platform/app/loc/sc +SYSTEMINCLUDE /epoc32/include/stdapis/openssl SYSTEMINCLUDE ../inc.s60 SYSTEMINCLUDE ../../../inc SYSTEMINCLUDE ../../../../inc SYSTEMINCLUDE ../src.s60 SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 -SYSTEMINCLUDE /epoc32/include/mw SYSTEMINCLUDE . SOURCEPATH ../src.s60 @@ -86,9 +105,13 @@ LIBRARY commdb.lib LIBRARY centralrepository.lib LIBRARY webutils.lib +LIBRARY extendedconnpref.lib +LIBRARY netmeta.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib +LIBRARY QtGui.lib +LIBRARY QtCore.lib LIBRARY libc.lib LIBRARY libm.lib LIBRARY libdl.lib @@ -127,12 +150,6 @@ #include - APP_LAYER_SYSTEMINCLUDE - - OS_LAYER_LIBC_SYSTEMINCLUDE - - OS_LAYER_SSL_SYSTEMINCLUDE - deffile ./~/javahttp.def SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) @@ -160,3 +177,5 @@ #elif defined EABI DEFFILE ./eabi/javahttp.def #endif + +USERINCLUDE . diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/http/HttpConnectionNative.java --- a/javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/http/HttpConnectionNative.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/http/javasrc.s60/com/nokia/mj/impl/http/HttpConnectionNative.java Mon Aug 23 16:38:44 2010 +0100 @@ -194,7 +194,7 @@ iTransactionBlock = new BlockingOperation(); iNativeDataReadyForRead = new BlockingOperation(); iNativeDataReadyForRead.setResult(BlockingOperation.BLOCKED); - iFinalizer = registerForFinalization(); + iFinalizer = registerForFinalization(); Logger.LOG(Logger.ESOCKET, Logger.EInfo, "- HttpConnectionNative new "); ApplicationInfo appInfo = ApplicationInfo.getInstance(); @@ -253,9 +253,9 @@ { close(); } - catch(Exception e) + catch (Exception e) { - + } Logger.LOG(Logger.ESOCKET, Logger.EInfo, "--HttpConnectionNative::doFinalize "); diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/http/src.s60/chttpsessionclient.cpp --- a/javacommons/gcfprotocols/http/src.s60/chttpsessionclient.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/chttpsessionclient.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -22,7 +22,13 @@ #include #include #include "logger.h" + +#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS +#include // extended connection preference +#include +#else #include +#endif #include #include @@ -146,10 +152,19 @@ *apnerr = ret; return; } - +#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS + TConnPrefList prefList; + TExtendedConnPref prefs; + prefs.SetSnapId(aAPNId); + prefList.AppendL(&prefs); + ret = iConnection.Start(prefList); +#else TCommSnapPref connPref; connPref.SetSnap(aAPNId); ret = iConnection.Start(connPref); +#endif + + LOG(ESOCKET,EInfo,"+HttpSessionClient:: using extended connection prefernce in snap case"); LOG1(ESOCKET,EInfo,"iConnection.Start returned %d",ret); if (ret < 0) { @@ -172,6 +187,7 @@ { if (aType == 3) // IAP Id { + LOG(ESOCKET,EInfo,"+HttpSessionClient:: in iap case"); if (aAPNId != -1) { // Creates connection with selected IAP ID @@ -189,18 +205,35 @@ *apnerr = ret; return; } + +#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS + // Create connection preferences + TConnPrefList prefList; + TExtendedConnPref prefs; + prefs.SetIapId(aAPNId); + prefList.AppendL(&prefs); + ret = iConnection.Start(prefList); + LOG(ESOCKET,EInfo,"+HttpSessionClient:: using extended connection prefernce in iap case"); +#else TCommDbConnPref pref; pref.SetIapId(aAPNId); pref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt); ret = iConnection.Start(pref); +#endif + if (ret < 0) { *apnerr = ret; //return; } RHTTPConnectionInfo connInfo = iHttpSession.ConnectionInfo(); + //connInfo.SetPropertyL(iHttpSession.StringPool().StringF( + // HttpFilterCommonStringsExt::EAccessPointID, HttpFilterCommonStringsExt::GetTable()), aAPNId); connInfo.SetPropertyL(iHttpSession.StringPool().StringF( - HttpFilterCommonStringsExt::EAccessPointID, HttpFilterCommonStringsExt::GetTable()), aAPNId); + HTTP::EHttpSocketServ, RHTTPSession::GetTable()), THTTPHdrVal(iSocketServ.Handle())); + TInt connPtr = REINTERPRET_CAST(TInt, &iConnection); + connInfo.SetPropertyL(iHttpSession.StringPool().StringF( + HTTP::EHttpSocketConnection, RHTTPSession::GetTable()), THTTPHdrVal(connPtr)); } // end of if ( aAPNId != -1) } // end of if(aType == 4) else @@ -210,7 +243,7 @@ } // end of else - LOG1(ESOCKET,EInfo,"apnerr = ",*apnerr); + LOG1(ESOCKET,EInfo,"apnerr = %d",*apnerr); // This is special case when that IAP/SNAP is not found // Override the http stack's feaute of using device default @@ -219,9 +252,19 @@ LOG(ESOCKET,EInfo,"ECommDbDialogPrefPrompt set for the http session"); int ret = iSocketServ.Connect(); ret = iConnection.Open(iSocketServ); +#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS + TConnPrefList prefList; + TExtendedConnPref prefs; + prefs.SetConnSelectionDialog(ETrue); + prefList.AppendL(&prefs); + ret = iConnection.Start(prefList); + LOG(ESOCKET,EInfo,"+HttpSessionClient:: using extended connection prefernce - error case "); +#else TCommDbConnPref pref; pref.SetDialogPreference(ECommDbDialogPrefPrompt); ret = iConnection.Start(pref); + LOG(ESOCKET,EInfo,"+HttpSessionClient:: using commdb con pref - error case "); +#endif RHTTPConnectionInfo connInfo = iHttpSession.ConnectionInfo(); connInfo.SetPropertyL(iHttpSession.StringPool().StringF( @@ -296,10 +339,25 @@ iConnection.Close(); TInt ret = iConnection.Open(iSocketServ); + //TCommSnapPref connPref; +#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS + TConnPrefList prefList; + TExtendedConnPref prefs; + + if (iApnId!=-1) + prefs.SetSnapId(iApnId); + TRAPD(err,prefList.AppendL(&prefs)); + if (err == KErrNone) + ret = iConnection.Start(prefList); + else + ret = iConnection.Start(); +#else TCommSnapPref connPref; if (iApnId!=-1) connPref.SetSnap(iApnId); ret = iConnection.Start(connPref); + +#endif LOG(ESOCKET,EInfo,"+HttpSessionClient::RestartConnection + "); } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/http/src.s60/chttptransactionclient.cpp --- a/javacommons/gcfprotocols/http/src.s60/chttptransactionclient.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/chttptransactionclient.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -626,14 +626,14 @@ iStatus = CHttpTransactionClient::ERequestNextBodayData; break; } - + case THTTPEvent::EReceiveTimeOut: { - ELOG(ESOCKET,"MHFRunL EReceiveTimeOut"); - NotifyErrorL(KErrTimedOut); // send timeout error to java - break; - - } + ELOG(ESOCKET,"MHFRunL EReceiveTimeOut"); + NotifyErrorL(KErrTimedOut); // send timeout error to java + break; + + } /* * -j2me expects the http stack to be able to post body data with no content type * the native stack default validation filter does not allow this. diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/http/src.s60/nativehttpsession.cpp --- a/javacommons/gcfprotocols/http/src.s60/nativehttpsession.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/nativehttpsession.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -49,10 +49,10 @@ TInt NativeHttpSession::NewL(JNIEnv& aJni, jobject aPeer,/* TJavaEventServer aServer,*/ TInt aType, TInt aAPNId, TInt * aErr, TInt * apnerr) { NativeHttpSession* self = new(ELeave) NativeHttpSession(); - + *aErr = self->ConstructL(aJni, aPeer /* aServer*/, aType, aAPNId, apnerr); LOG1(ESOCKET,EInfo,"NativeHttpSession::NewL - aErr : %d",*aErr); - + self->attachToVm(aJni,aPeer); // Pop the cleanup of the object and create a handle: return reinterpret_cast(self); //selfCleanup.GetHandle(); @@ -119,17 +119,17 @@ void NativeHttpSession::doSubmitCallback(TInt aStatus,jobject &aPeer) { - LOG(ESOCKET,EInfo,"+doSubmitCallback1"); + LOG(ESOCKET,EInfo,"+doSubmitCallback1"); jobject localPeerObject = mJniEnv->NewLocalRef(aPeer); - if(localPeerObject) + if (localPeerObject) { - // java side peer object may be GC'ed when this call is being made. - mJniEnv->CallVoidMethod(aPeer,iSubmitCallbackMethodID,aStatus); + // java side peer object may be GC'ed when this call is being made. + mJniEnv->CallVoidMethod(aPeer,iSubmitCallbackMethodID,aStatus); } else { - ELOG(ESOCKET,"NativeHttpSession::doSubmitCallback: Error!! java peer object not found "); - } + ELOG(ESOCKET,"NativeHttpSession::doSubmitCallback: Error!! java peer object not found "); + } LOG(ESOCKET,EInfo,"-doSubmitCallback1"); } @@ -137,14 +137,14 @@ { LOG(ESOCKET,EInfo,"+doReadCallback1"); jobject localPeerObject = mJniEnv->NewLocalRef(aPeer); - if(localPeerObject) + if (localPeerObject) { - mJniEnv->CallVoidMethod(aPeer,iReadCallbackMethodID,aStatus); + mJniEnv->CallVoidMethod(aPeer,iReadCallbackMethodID,aStatus); } else { - ELOG(ESOCKET,"NativeHttpSession::doReadCallback: Error!! java peer object not found "); - } + ELOG(ESOCKET,"NativeHttpSession::doReadCallback: Error!! java peer object not found "); + } LOG(ESOCKET,EInfo,"-doReadCallback1"); } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp --- a/javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -57,7 +57,7 @@ NativeHttpTransaction::NativeHttpTransaction(HttpSessionClient& aSession, FunctionServer* aFuncServer) :iSessionClient(aSession) //, java::util::FunctionServer("MyhttpServer2") { - + iFuncServer = aFuncServer; } @@ -72,7 +72,7 @@ { NativeHttpTransaction* self = new(ELeave) NativeHttpTransaction(aSession,aFuncServer); - + self->ConstructL(aJni, aPeer, /*aServer, */ aUri, aRequestMethod); @@ -93,9 +93,9 @@ int urihandle = reinterpret_cast(aUri); int methodhandle = reinterpret_cast(aRequestMethod); //open the transaction - + CallMethodL(this, &NativeHttpTransaction::ExecuteCreateTransactionL,handle,urihandle , methodhandle, iFuncServer); - + } void NativeHttpTransaction::ExecuteCreateTransactionL(int aSelfhandle, int aUrihandle, int aMethodhandle) @@ -115,7 +115,7 @@ RPointerArray rawHeaderArray; CleanupStack::PushL(TCleanupItem(CleanUpResetAndDestroy,&rawHeaderArray)); iJniObject = aJni; - + if (aHeaders!=NULL) { @@ -135,7 +135,7 @@ narrowBuffer = HBufC8::NewLC(length); TPtr8 narrowPtr = narrowBuffer->Des(); narrowPtr.Copy(rawHeader); - rawHeaderArray.Append(narrowBuffer); + rawHeaderArray.AppendL(narrowBuffer); CleanupStack::Pop(narrowBuffer); } aJni->DeleteLocalRef(jniString); @@ -173,7 +173,7 @@ void NativeHttpTransaction::ExecuteSubmitL(int aSelfhandle , int aRawHeadershandle , int aPostBufhandle, int aResponseTimeout) { - + NativeHttpTransaction *aSelf = reinterpret_cast(aSelfhandle); RPointerArray* aRawHeaders = reinterpret_cast*>(aRawHeadershandle); HBufC8* aPostBuf = reinterpret_cast(aPostBufhandle); @@ -186,12 +186,12 @@ jobjectArray objArray=NULL; RPointerArray rawHeaders(KResponseGranularity); CleanupStack::PushL(TCleanupItem(CleanUpResetAndDestroy,&rawHeaders)); - + int handle = reinterpret_cast(this); int arrayhandle = reinterpret_cast(&rawHeaders); CallMethodL(this, &NativeHttpTransaction::ExecuteGetResponseL,handle,arrayhandle , iFuncServer); - + const TInt headerCount = rawHeaders.Count(); if (headerCount>KErrNone) { @@ -232,7 +232,7 @@ */ TInt NativeHttpTransaction::ReadBytes(TUint8* aBytes, TInt aLength) { - + int handle = reinterpret_cast(this); int uinthandle = reinterpret_cast(aBytes); @@ -240,7 +240,7 @@ CallMethod(ret,this, &NativeHttpTransaction::ExecuteReadBytes,handle,uinthandle,aLength,iFuncServer); return ret; - + } TInt NativeHttpTransaction::ExecuteReadBytes(int aSelfhandle, int aByteshandle, TInt aLength) diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp --- a/javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -20,7 +20,7 @@ #include #ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS -#include +#include #else #include #endif @@ -69,15 +69,15 @@ NativeHttpTransaction* tran = reinterpret_cast(aNativeHttpTransaction); tran->iJniPeer = aJni->NewWeakGlobalRef(aPeer); try - { + { tran->Dispose(); - } - catch(...) - { - // function server usage may throw an exception. - // ignore, called when transcation is closed - ELOG(ESOCKET,"Http JNI Error, exception caught!: _closeTransaction"); - } + } + catch (...) + { + // function server usage may throw an exception. + // ignore, called when transcation is closed + ELOG(ESOCKET,"Http JNI Error, exception caught!: _closeTransaction"); + } delete tran; } @@ -88,7 +88,7 @@ jstring aUri, jstring aRequestMethod) { - LOG(ESOCKET,EInfo,"http jni _createNativeTransaction()"); + LOG(ESOCKET,EInfo,"http jni _createNativeTransaction()"); NativeHttpSession* session = reinterpret_cast(aNativeHttpSession); //tran->iJniPeer = aJni->NewGlobalRef(aPeer); try @@ -96,13 +96,13 @@ TRAPD(handle, handle = session->CreateTransactionL(aJni, aPeer , aUri, aRequestMethod);); return handle; } - catch(...) + catch (...) { - // function server usage may throw an exception. - ELOG(ESOCKET,"Http JNI Error, exception caught!: _createTransaction"); - return -1; + // function server usage may throw an exception. + ELOG(ESOCKET,"Http JNI Error, exception caught!: _createTransaction"); + return -1; } - + } JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_http_HttpConnectionNative__1submitTransaction( @@ -114,7 +114,7 @@ jint aPostDataLength, jint aResponseTimeout) { - LOG(ESOCKET,EInfo,"http jni _submitTransaction"); + LOG(ESOCKET,EInfo,"http jni _submitTransaction"); NativeHttpTransaction* tran = reinterpret_cast(aNativeHttpTransaction); int respTimeOut = aResponseTimeout; tran->iJniPeer = aJni->NewWeakGlobalRef(aPeer); @@ -123,11 +123,11 @@ TRAPD(err,tran->SubmitL(aJni, &aPeer,aHeaders, aPostData, aPostDataLength, respTimeOut)); return err; } - catch(...) + catch (...) { - ELOG(ESOCKET,"Http JNI Error, exception caught!: _submitTransaction"); - return -1; - } + ELOG(ESOCKET,"Http JNI Error, exception caught!: _submitTransaction"); + return -1; + } } JNIEXPORT jobjectArray JNICALL Java_com_nokia_mj_impl_http_HttpConnectionNative__1getResponse( @@ -135,24 +135,24 @@ jobject aPeer, jint aNativeHttpTransaction) { - LOG(ESOCKET,EInfo,"http jni _getResponse"); + LOG(ESOCKET,EInfo,"http jni _getResponse"); jobjectArray rawHeaders=NULL; NativeHttpTransaction* tran = reinterpret_cast(aNativeHttpTransaction); tran->iJniPeer = aJni->NewWeakGlobalRef(aPeer); try { - TRAPD(err, rawHeaders = tran->GetResponseL(aJni)); - if (err!=KErrNone) - { - rawHeaders=NULL; - } - } - catch(...) - { - rawHeaders=NULL; - ELOG(ESOCKET,"Http JNI Error, exception caught!: _getResponse"); - - } + TRAPD(err, rawHeaders = tran->GetResponseL(aJni)); + if (err!=KErrNone) + { + rawHeaders=NULL; + } + } + catch (...) + { + rawHeaders=NULL; + ELOG(ESOCKET,"Http JNI Error, exception caught!: _getResponse"); + + } return rawHeaders; } @@ -164,27 +164,27 @@ jbyteArray aBytes, jint aLength) { - LOG(ESOCKET,EInfo,"http jni _getBytes"); + LOG(ESOCKET,EInfo,"http jni _getBytes"); jbyte* bytes = aEnv->GetByteArrayElements(aBytes, NULL); if (bytes == NULL) { return -1; } - try - { - NativeHttpTransaction* tran = reinterpret_cast(aNativeHttpTransaction); - tran->iJniPeer = aEnv->NewWeakGlobalRef(aPeer); - TInt length = tran->ReadBytes(reinterpret_cast(bytes), aLength); - - aEnv->ReleaseByteArrayElements(aBytes, bytes, NULL); - return length; - } - catch(...) - { - ELOG(ESOCKET,"Http JNI Error, exception caught!: _getBytes"); - return -1; - } + try + { + NativeHttpTransaction* tran = reinterpret_cast(aNativeHttpTransaction); + tran->iJniPeer = aEnv->NewWeakGlobalRef(aPeer); + TInt length = tran->ReadBytes(reinterpret_cast(bytes), aLength); + + aEnv->ReleaseByteArrayElements(aBytes, bytes, NULL); + return length; + } + catch (...) + { + ELOG(ESOCKET,"Http JNI Error, exception caught!: _getBytes"); + return -1; + } } JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_http_HttpConnectionNative__1available( @@ -196,12 +196,12 @@ tran->iJniPeer = aJni->NewWeakGlobalRef(aPeer); try { - return tran->Available(); + return tran->Available(); } - catch(...) + catch (...) { - ELOG(ESOCKET,"Http JNI Error, exception caught!: _available"); - return -1; + ELOG(ESOCKET,"Http JNI Error, exception caught!: _available"); + return -1; } } @@ -220,7 +220,6 @@ jstring GetUserAgentL(JNIEnv *aJni, jboolean aMidpRuntime) { - jstring header = NULL; if (aMidpRuntime == false) @@ -291,6 +290,6 @@ CleanupStack::PopAndDestroy(repository); } - + LOG(ESOCKET,EInfo,"GetUserAgentL() -"); return header; } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/https/build/javahttps_0x2002DCB2.mmp --- a/javacommons/gcfprotocols/https/build/javahttps_0x2002DCB2.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/https/build/javahttps_0x2002DCB2.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javahttps.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/secureconnection/build/javassl_0x2002DCD7.mmp --- a/javacommons/gcfprotocols/secureconnection/build/javassl_0x2002DCD7.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/secureconnection/build/javassl_0x2002DCD7.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javassl.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/ssl/SecureConnectionImpl.java --- a/javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/ssl/SecureConnectionImpl.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/ssl/SecureConnectionImpl.java Mon Aug 23 16:38:44 2010 +0100 @@ -35,6 +35,7 @@ import com.nokia.mj.impl.rt.ui.ConfirmData; import com.nokia.mj.impl.connectionmanager.ConnectionManager; import com.nokia.mj.impl.connectionmanager.AccessPoint; +import com.nokia.mj.impl.utils.Id; import com.nokia.mj.impl.utils.ResourceLoader; /** @@ -74,7 +75,7 @@ private static final String LOCALISED_STRING_ID = "qtn_ssl_prompt_"; - private static final String UNTRUSTED_CERTIFICATE_WARNING = "untrusted_certificate"; + private static final Id UNTRUSTED_CERTIFICATE_WARNING = new Id("untrusted_certificate", "N/A"); /** * Constructs the SecureConnectionImpl. diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/serverconnection/build/javasocketscplugin_0x2002DCD5.mmp --- a/javacommons/gcfprotocols/socket/serverconnection/build/javasocketscplugin_0x2002DCD5.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/serverconnection/build/javasocketscplugin_0x2002DCD5.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javasocketscplugin.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/build/bld.inf --- a/javacommons/gcfprotocols/socket/socket/build/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/build/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -20,3 +20,4 @@ PRJ_MMPFILES javasocket_0x2002DCD4.mmp +#include "exports.inf" diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/build/build.xml --- a/javacommons/gcfprotocols/socket/socket/build/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/build/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -41,7 +41,8 @@ + com.nokia.mj.impl.socket.ServerSocketConnectionImpl, + com.nokia.mj.impl.properties.socket.SocketDynamicPropertyHandler"/> + + + java.src.paths=${java.src.paths} + microedition.hostname=:socket.SocketDynamicPropertyHandler + + diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/build/bwins/javasocketu.def --- a/javacommons/gcfprotocols/socket/socket/build/bwins/javasocketu.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/build/bwins/javasocketu.def Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ EXPORTS - ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) + ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) ?readBytes@NativeSocketConnection@java@@UAEHAAUJNIEnv_@@PAV_jbyteArray@@@Z @ 2 NONAME ; int java::NativeSocketConnection::readBytes(struct JNIEnv_ &, class _jbyteArray *) ?setSocketOption@NativeSocketConnection@java@@QAEHHH@Z @ 3 NONAME ; int java::NativeSocketConnection::setSocketOption(int, int) ?socketClose@NativeSocketConnection@java@@QAEHXZ @ 4 NONAME ; int java::NativeSocketConnection::socketClose(void) @@ -16,5 +16,5 @@ ?getLocalPort@NativeSocketConnection@java@@QAEHXZ @ 15 NONAME ; int java::NativeSocketConnection::getLocalPort(void) ?getPort@NativeSocketConnection@java@@QAEHXZ @ 16 NONAME ; int java::NativeSocketConnection::getPort(void) ?getSocketOption@NativeSocketConnection@java@@QAEHH@Z @ 17 NONAME ; int java::NativeSocketConnection::getSocketOption(int) - + ?getLocalAddress@SocketLocalHostInfo@@SAHHPADHH@Z @ 18 NONAME ; int SocketLocalHostInfo::getLocalAddress(int, char *, int, int) diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/build/eabi/javasocketu.def --- a/javacommons/gcfprotocols/socket/socket/build/eabi/javasocketu.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/build/eabi/javasocketu.def Mon Aug 23 16:38:44 2010 +0100 @@ -20,4 +20,5 @@ _ZN4java22NativeSocketConnectionD2Ev @ 19 NONAME _ZTIN4java22NativeSocketConnectionE @ 20 NONAME ; ## _ZTVN4java22NativeSocketConnectionE @ 21 NONAME ; ## + _ZN19SocketLocalHostInfo15getLocalAddressEiPcii @ 22 NONAME diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/build/exports.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/gcfprotocols/socket/socket/build/exports.inf Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,21 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +PRJ_EXPORTS + +../inc/socketlocalhostinfo.h |../../../../../inc/socketlocalhostinfo.h + diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/build/javasocket_0x2002DCD4.mmp --- a/javacommons/gcfprotocols/socket/socket/build/javasocket_0x2002DCD4.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/build/javasocket_0x2002DCD4.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javasocket.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/inc/apnsettings.h --- a/javacommons/gcfprotocols/socket/socket/inc/apnsettings.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/inc/apnsettings.h Mon Aug 23 16:38:44 2010 +0100 @@ -27,7 +27,7 @@ public : static int setDefaultApn(int aType, int aApn); - static void removeDefaultApn(); + }; diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/inc/socketlocalhostinfo.h --- a/javacommons/gcfprotocols/socket/socket/inc/socketlocalhostinfo.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/inc/socketlocalhostinfo.h Mon Aug 23 16:38:44 2010 +0100 @@ -19,13 +19,15 @@ #ifndef SOCKETLOCALHOSTINFO_H #define SOCKETLOCALHOSTINFO_H +#include "javaosheaders.h" + class SocketLocalHostInfo { public: - static int getLocalAddress(int aSd, char *aLocalAddr, int aMidletIapId, int aApType); - + OS_IMPORT static int getLocalAddress(int aSd, char *aLocalAddr, int aMidletIapId, int aApType); + static char* getLocalHostName(); }; diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/properties/socket/SocketDynamicPropertyHandler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/properties/socket/SocketDynamicPropertyHandler.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,83 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/socket/ServerSocketConnectionImpl.java --- a/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/socket/ServerSocketConnectionImpl.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/socket/ServerSocketConnectionImpl.java Mon Aug 23 16:38:44 2010 +0100 @@ -141,8 +141,7 @@ apId = -1; } Logger.LOG(Logger.ESOCKET, Logger.EInfo, - "+SocketServerConnectionImpl:: getApplicationDefault returned, \n"+apn.getNapId()+" type = "+apn.getType()); - System.out.println(" type = "+apn.getType()+" id = "+apId); + "+SocketServerConnectionImpl:: getApplicationDefault returned, \n"+apn.getNapId()+" type = "+apn.getType()); } } catch (Exception e) diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/src.s60/apnsettings.cpp --- a/javacommons/gcfprotocols/socket/socket/src.s60/apnsettings.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/src.s60/apnsettings.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -66,11 +66,4 @@ return def; } -void ApnSettings::removeDefaultApn() -{ - #ifdef RD_JAVA_OPENC_BETA_PATCH - setdefaultif(NULL); - ILOG(ESOCKET, "sedefaultif called"); - ILOG1(ESOCKET, "remove default apn returned %d",setdefaultif(NULL)); - #endif -} + diff -r 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/src.s60/socketlocalhostinfo.cpp --- a/javacommons/gcfprotocols/socket/socket/src.s60/socketlocalhostinfo.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/src.s60/socketlocalhostinfo.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -22,9 +22,26 @@ #include "logger.h" #include "connectionmanager.h" +#define localhost_len 20 int GetlocalIPAdressL(char *localaddr, int aMidletIapId, int aApType); +char* GetlocalHostNameL(); -int SocketLocalHostInfo::getLocalAddress(int /* aSd */, char *aLocalAddr, +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) { TRAPD(err,GetlocalIPAdressL(aLocalAddr,aMidletIapId, aApType);); @@ -32,6 +49,77 @@ } +int getIPAddressL(const int aIapId, char *ipAddress) +{ + RSocketServ socketServ; + RSocket sock; + User::LeaveIfError(socketServ.Connect()); + User::LeaveIfError(sock.Open(socketServ, KAfInet, KSockStream, + KProtocolInetTcp)); + + // find the ip address of the active interface + TSoInetInterfaceInfo ifInfo; + TPckg ifInfoPkg(ifInfo); + TSoInetIfQuery ifQuery; + TPckg ifQueryPkg(ifQuery); + + // To find out which interfaces are using our current IAP, we must + // enumerate and go through all of them and make a query by name for each. + ILOG(ESOCKET, "Looping thru all the destinations and ap \n\n"); + User::LeaveIfError(sock.SetOpt(KSoInetEnumInterfaces, + KSolInetIfCtrl)); + + while (sock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, ifInfoPkg) + == KErrNone) + { + ifQuery.iName = ifInfo.iName; + TInt err = sock.GetOpt(KSoInetIfQueryByName, KSolInetIfQuery, + ifQueryPkg); + if ((err == KErrNone) && (ifQuery.iZone[1] == aIapId)) + { + ILOG2(ESOCKET, "Network id = %d, IAP id = %d ",(TUint32)(ifQuery.iZone[15]),(TUint32)ifQuery.iZone[1]); + + // IAP ID is index 1 of iZone + // We have found an interface using the IAP we are interested in. + if (ifInfo.iAddress.Address() > 0) + { + if (!ifInfo.iAddress.IsUnspecified() + && !ifInfo.iAddress.IsLoopback() + && !ifInfo.iAddress.IsLinkLocal()) + { + // found a IPv4 address + TBuf8<20> aIP8; + TBuf<20> aIP; + TInetAddr aAddr; + aAddr = ifInfo.iAddress; + aAddr.ConvertToV4(); + aAddr.Output(aIP); + aIP8.Copy(aIP); + + strncpy(ipAddress, (char*) aIP8.Ptr(), + aIP8.Length()); + ipAddress[aIP8.Length()] = '\0'; + ILOG1(ESOCKET, "GetlocalIPAdressLLL , ip = %s", + ipAddress); + sock.Close(); + socketServ.Close(); + ILOG(ESOCKET, "returning from getIpAddr"); + return KErrNone; + } + } // end if addr > 0 + else if (err != KErrNone) + { + sock.Close(); + return err; // return with error + } + } + } // end while + sock.Close(); + socketServ.Close(); + return KErrNone; + +} + /** *In Symbian, when a server connection is opened, it is not bound to any interface *so the openC calls returns "0.0.0.0" as the local address. @@ -43,7 +131,7 @@ int GetlocalIPAdressL(char *localaddr, int aMidletIapId, int aType) { JELOG2(ESOCKET); - + int err = KErrNone; TUint32 activeIapId = 0; TConnectionInfoBuf connectionInfo; TUint count = 0; @@ -103,66 +191,57 @@ continue; // go to the next active IAP } - // find the ip address of the active interface - - TSoInetInterfaceInfo ifInfo; - TPckg ifInfoPkg(ifInfo); - TSoInetIfQuery ifQuery; - TPckg ifQueryPkg(ifQuery); - // To find out which interfaces are using our current IAP, we must - // enumerate and go through all of them and make a query by name for each. - ILOG(ESOCKET, "Looping thru all the destinations and ap \n\n"); - User::LeaveIfError(sock.SetOpt(KSoInetEnumInterfaces, - KSolInetIfCtrl)); - while (sock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl, ifInfoPkg) - == KErrNone) - { - ifQuery.iName = ifInfo.iName; - TInt err = sock.GetOpt(KSoInetIfQueryByName, KSolInetIfQuery, - ifQueryPkg); + // find the ip address of the active IAP + err = getIPAddressL(activeIapId,localaddr); + break; // once we find the IP addr, return - if ((err == KErrNone) && (ifQuery.iZone[1] == activeIapId)) - { - //TUint32 t5 = (TUint32)(ifQuery.iZone[15]); - ILOG2(ESOCKET, "Network id = %d, IAP id = %d ",(TUint32)(ifQuery.iZone[15]),(TUint32)ifQuery.iZone[1]); - - // IAP ID is index 1 of iZone - // We have found an interface using the IAP we are interested in. - if (ifInfo.iAddress.Address() > 0) - if (!ifInfo.iAddress.IsUnspecified() - && !ifInfo.iAddress.IsLoopback() - && !ifInfo.iAddress.IsLinkLocal()) - { - // found a IPv4 address - TBuf8<20> aIP8; - TBuf<20> aIP; - TInetAddr aAddr; - aAddr = ifInfo.iAddress; - aAddr.ConvertToV4(); - aAddr.Output(aIP); - aIP8.Copy(aIP); - - strncpy(localaddr, (char*) aIP8.Ptr(), - aIP8.Length()); - localaddr[aIP8.Length()] = '\0'; - ILOG1(ESOCKET, "GetlocalIPAdressL , ip = %s", - localaddr); - sock.Close(); - return KErrNone; - } - } - else if (err != KErrNone) - { - sock.Close(); - return err; // return with error - } - } // end while } // end for loop } // end else active connection - + ILOG(ESOCKET, "GetlocalIPAdressL , got ip "); + conn.Close(); sock.Close(); - return KErrNotFound; // return with KErrNotFound + socketServ.Close(); + + return err; // return with KErrNotFound } + +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 5bec7efefe18 -r d1278d87b01e javacommons/gcfprotocols/socket/socket/src/socketconnectionjni.cpp --- a/javacommons/gcfprotocols/socket/socket/src/socketconnectionjni.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/gcfprotocols/socket/socket/src/socketconnectionjni.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -17,8 +17,10 @@ #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; @@ -141,3 +143,13 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/javacommons.pro --- a/javacommons/javacommons.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/javacommons.pro Mon Aug 23 16:38:44 2010 +0100 @@ -18,7 +18,7 @@ SUBDIRS += utils/build/javautils.pro SUBDIRS += comms SUBDIRS += javastorage -SUBDIRS += fileutils/build/fileutils.pro +SUBDIRS += fileutils/build/javafileutils.pro SUBDIRS += security SUBDIRS += gcfbase/build/javagcf.pro SUBDIRS += connectionmanager/build/javaconnectionmanager.pro diff -r 5bec7efefe18 -r d1278d87b01e javacommons/javaenv/build/javaenv_0x2001B2A5.mmp --- a/javacommons/javaenv/build/javaenv_0x2001B2A5.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/javaenv/build/javaenv_0x2001B2A5.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javaenv.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javacommons/javaenv/src.s60/javaenvinfo.cpp --- a/javacommons/javaenv/src.s60/javaenvinfo.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/javaenv/src.s60/javaenvinfo.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -113,7 +113,7 @@ { JELOG2(EUtils); - TInt size; + TInt size = 0; RFs rfs; User::LeaveIfError(rfs.Connect()); diff -r 5bec7efefe18 -r d1278d87b01e javacommons/javaenv/tsrc/build/alltests.mmp --- a/javacommons/javaenv/tsrc/build/alltests.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/javaenv/tsrc/build/alltests.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -20,14 +20,12 @@ CAPABILITY all -tcb -allfiles -drm #include <../../../../inc/java_stdcpp_support_for_exe.hrh> -#include - -//SYSTEMINCLUDE /epoc32/include +#include USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc USERINCLUDE ../../../../tools/cpputest/include/cpputest USERINCLUDE ../../../../tools/cpputest/include/platforms/symbian -USERINCLUDE ../../../../inc STATICLIBRARY cpputest.lib diff -r 5bec7efefe18 -r d1278d87b01e javacommons/javastorage/build/javastorage_0x2002DCD8.mmp --- a/javacommons/javastorage/build/javastorage_0x2002DCD8.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/javastorage/build/javastorage_0x2002DCD8.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javastorage.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/javastorage/tsrc/storageclient/build/alltests.mmp --- a/javacommons/javastorage/tsrc/storageclient/build/alltests.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/javastorage/tsrc/storageclient/build/alltests.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -22,7 +22,7 @@ #include <../../../../../inc/java_stdcpp_support_for_exe.hrh> #include -SYSTEMINCLUDE /epoc32/include +APP_LAYER_SYSTEMINCLUDE USERINCLUDE ../../../inc USERINCLUDE ../../../../../tools/cpputest/include/cpputest diff -r 5bec7efefe18 -r d1278d87b01e javacommons/jvms/j9utils/threaddump/build/javathreaddumper_0x2002DCD9.mmp --- a/javacommons/jvms/j9utils/threaddump/build/javathreaddumper_0x2002DCD9.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/jvms/j9utils/threaddump/build/javathreaddumper_0x2002DCD9.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javathreaddumper.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/jvms/nativeportlayer/build/jvmnativeport_0x2002DCDE.mmp --- a/javacommons/jvms/nativeportlayer/build/jvmnativeport_0x2002DCDE.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/jvms/nativeportlayer/build/jvmnativeport_0x2002DCDE.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : jvmnativeport.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/security/build/build.xml --- a/javacommons/security/build/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/build/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ - + - Builds OMJ security, generates the policy files in their internal format and copies the certificates and the metadata into right locations + Builds OMJ security and generates the policy files in their internal format @@ -32,7 +32,6 @@ - @@ -48,7 +47,7 @@ - + @@ -62,20 +61,10 @@ - - - - - - - - - - diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/build/exports.inf --- a/javacommons/security/build/exports.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/build/exports.inf Mon Aug 23 16:38:44 2010 +0100 @@ -27,9 +27,12 @@ #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 5bec7efefe18 -r d1278d87b01e javacommons/security/build/javasecurity_0x2002DCCF.mmp --- a/javacommons/security/build/javasecurity_0x2002DCCF.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/build/javasecurity_0x2002DCCF.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javasecurity.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/conf/CI_javasecurity.confml Binary file javacommons/security/conf/CI_javasecurity.confml has changed diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/data/att_operator.txt --- a/javacommons/security/data/att_operator.txt Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/data/att_operator.txt Mon Aug 23 16:38:44 2010 +0100 @@ -35,8 +35,12 @@ } grant user "Messaging" blanket,session,oneshot,no { - permission javax.microedition.io.Connector.sms "sms://*" "send"; - permission javax.microedition.io.Connector.mms "mms://*" "send"; + permission javax.microedition.io.Connector.sms "sms://*" "open,send,receive"; + permission javax.microedition.io.Connector.mms "mms://*" "open,send,receive"; +} + +grant user "Restricted Messaging" blanket,no { + permission javax.microedition.io.Connector.cbs "cbs://*" "open,receive"; } grant user "Multimedia Recording" blanket,session,oneshot,no { @@ -52,12 +56,6 @@ permission javax.microedition.midlet.CmdLineArgsPermission; } -grant allowed { - permission javax.microedition.io.Connector.sms "sms://*" "open,receive"; - permission javax.microedition.io.Connector.mms "mms://*" "open,receive"; - permission javax.microedition.io.Connector.cbs "cbs://*" "open,receive"; -} - grant assigned { permission javax.microedition.midlet.AutoStartPermission; } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/data/att_trustedthirdparty.txt --- a/javacommons/security/data/att_trustedthirdparty.txt Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/data/att_trustedthirdparty.txt Mon Aug 23 16:38:44 2010 +0100 @@ -13,8 +13,8 @@ } grant user "Messaging" session,oneshot,no { - permission javax.microedition.io.Connector.sms "sms://*" "send"; - permission javax.microedition.io.Connector.mms "mms://*" "send"; + permission javax.microedition.io.Connector.sms "sms://*" "open,send,receive"; + permission javax.microedition.io.Connector.mms "mms://*" "open,send,receive"; } grant user "Multimedia Recording" session,oneshot,no { @@ -25,8 +25,3 @@ grant user "Application Auto Invocation" session,oneshot,no { permission javax.microedition.io.PushRegistryPermission "*" "staticregistration,dynamicregistration,autoinvocation"; } - -grant allowed { - permission javax.microedition.io.Connector.sms "sms://*" "open,receive"; - permission javax.microedition.io.Connector.mms "mms://*" "open,receive"; -} diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/data/att_untrusted.txt --- a/javacommons/security/data/att_untrusted.txt Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/data/att_untrusted.txt Mon Aug 23 16:38:44 2010 +0100 @@ -2,4 +2,5 @@ grant user "Net Access" oneshot,no { permission javax.microedition.io.HttpProtocolPermission "http://*"; permission javax.microedition.io.HttpsProtocolPermission "https://*"; + permission javax.microedition.io.Connector.rtsp "*"; } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/javasrc.cdc/com/nokia/mj/impl/security/midp/authorization/PermissionGranter.java Mon Aug 23 16:38:44 2010 +0100 @@ -17,6 +17,7 @@ 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; @@ -457,7 +458,7 @@ 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) || (net_access == true && multimedia == true) @@ -465,7 +466,18 @@ || (messaging == true && multimedia == true) || (messaging == true && read_user_data == true)) ? "settings_inst_query_perm_net" : - "settings_inst_query_perm_sec"); + "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")); + iBlanketPermissionsDetails.put(msUidKey, UserSecuritySettingsImpl.getLocalizedString( blanketPermissionsDetails)); diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationException.java --- a/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationException.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationException.java Mon Aug 23 16:38:44 2010 +0100 @@ -37,6 +37,7 @@ public static final int CERT_EXPIRED = 8; public static final int ROOT_CERT_IN_CHAIN = 9; public static final int UNKNOWN_EXT_KEY_USAGE = 10; + public static final int JAR_NOT_FOUND = 11; // the error code encapsulated in this exception private int errorCode; diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationModule.java --- a/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationModule.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationModule.java Mon Aug 23 16:38:44 2010 +0100 @@ -277,7 +277,11 @@ try { Vector allAuthCredentials = (Vector)iAuthCredentials.get(msUID); - String jarHash = _computeHash(appJARPath); + String jarHash = null; + try + { + jarHash = _computeHash(appJARPath); + }catch(AuthenticationException e) {} if (jarHash == null || jarHash.length() == 0) { // could not compute hash for the given application @@ -410,7 +414,11 @@ new String[] {"Unknown protection domain " + protectionDomain}, OtaStatusCode.INTERNAL_ERROR); } - String jarHash = _computeHash(appJARPath); + String jarHash = null; + try + { + jarHash = _computeHash(appJARPath); + }catch(AuthenticationException e) {} if (jarHash == null || jarHash.length() == 0) { // could not compute hash for the given application @@ -825,7 +833,23 @@ && authStorageData.getJarHashValue().length() > 0) { Logger.log(" Doing tamper detection"); - String computedJarHash = _computeHash(authStorageData.getJarPath()); + 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 */); + } + } // do the tampering check: compute the hash and compare it with the stored hash if (computedJarHash == null || !computedJarHash.equals( authStorageData.getJarHashValue())) @@ -1120,6 +1144,7 @@ private boolean isDriveProtected(int aMediaId) { DriveInfo[] allDrives = DriveUtilities.getAllDrives(); + boolean driveFound = false; if (allDrives != null) { for (int i=0; i +#include #include // Some defines of useful values for attributes to simplify diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.cpp --- a/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -75,7 +75,6 @@ Cancel(); } - mComms.unregisterListener(PLUGIN_ID_JAVA_CERT_STORE_ECOM_C,this); mComms.unregisterDefaultListener(this); mComms.disconnect(); mCertsData.ResetAndDestroy(); @@ -176,7 +175,7 @@ case EPreDeleting: SendDeleteMsg(status); return; - + default: //Do nothing. break; @@ -251,7 +250,7 @@ User::RequestComplete(pRequestStatus,KErrArgument); return; } - + mState = EPreDeleting; mTempCertData = certData; HandleDeleteDisableQuery(aStatus, false /* disableCertQuery */); @@ -388,7 +387,7 @@ TBool validRequest = validateCertAttrFilter(aFilter); if (!validRequest) { - ELOG(EJavaSecurity,"No certificates matching the filter supplied"); + LOG(EJavaSecurity, EInfo, "No certificates matching the filter supplied"); User::RequestComplete(pRequestStatus,KErrNone); return; } @@ -490,12 +489,13 @@ return; } + TInt err = KErrNone; if (!certData->mIsDisabled) { - aApplications.Append(KMidletInstallApplicabilityUid); + err = aApplications.Append(KMidletInstallApplicabilityUid); } - User::RequestComplete(pRequestStatus,KErrNone); + User::RequestComplete(pRequestStatus, err); } /** @@ -836,7 +836,7 @@ User::RequestComplete(aRequestStatus,KErrCommsBreak); return EFalse; } - + return ETrue; } @@ -972,7 +972,7 @@ //operation in the error situation. return; } - aCertDataObj.mDeleted = ETrue; + aCertDataObj.mDeleted = ETrue; User::RequestComplete(aRequestStatus,KErrNone); } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.h --- a/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.h Mon Aug 23 16:38:44 2010 +0100 @@ -68,8 +68,7 @@ }; class CJavaCertStoreImpl: public CActive, public MCTWritableCertStore, - public java::comms::CommsListener, - public java::comms::CommsClientEndpoint + public java::comms::CommsListener { public: diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/build/MIDP2SecurityPolicyV2Dll.mmp --- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/build/MIDP2SecurityPolicyV2Dll.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/build/MIDP2SecurityPolicyV2Dll.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -21,8 +21,10 @@ @SYMPurpose MIDP2SecurityPolicyV2.dll Java security policy interface implementation */ +#include +#include <../../../../../../../inc/project_defines.hrh> -#include <../../../../../../../inc/project_defines.hrh> +APP_LAYER_SYSTEMINCLUDE target MIDP2SecurityPolicyV2.dll targettype dll @@ -42,10 +44,6 @@ deffile ./midp2secrp/eabi/MIDP2SecurityPolicyV2.def #endif -systeminclude /epoc32/include -systeminclude /epoc32/include/libc - -systeminclude ../../../../../../../inc userinclude ../export userinclude ../../../../../../../inc diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.cpp --- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -61,9 +61,9 @@ } -void CBlanketPermissionPolicy::Add(const CBlanketPermissionPolicyElement *aElement) +void CBlanketPermissionPolicy::AddL(const CBlanketPermissionPolicyElement *aElement) { - iPolicyElements.Append(aElement); + iPolicyElements.AppendL(aElement); } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.h --- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.h Mon Aug 23 16:38:44 2010 +0100 @@ -49,7 +49,7 @@ static CBlanketPermissionPolicy* NewL(); - void Add(const CBlanketPermissionPolicyElement *); + void AddL(const CBlanketPermissionPolicyElement *); // MBlanketPermissionPolicy virtual TInt GetPolicyElementCount() const ; diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/SimpleMapping.cpp --- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/SimpleMapping.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/SimpleMapping.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -61,7 +61,7 @@ for (TInt i = 0; i < count; i++) { - iMapping.Append(aMapping[i]); + iMapping.AppendL(aMapping[i]); } } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/XPFParser.cpp --- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/XPFParser.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/XPFParser.cpp Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javacommons/security/legacysupport/midp2userpreferences/build/midp2userpreferences.pro --- a/javacommons/security/legacysupport/midp2userpreferences/build/midp2userpreferences.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/legacysupport/midp2userpreferences/build/midp2userpreferences.pro Mon Aug 23 16:38:44 2010 +0100 @@ -19,11 +19,7 @@ CONFIG += omj stl CONFIG -= qt -INCLUDEPATH += /epoc32/include/j2me/midp2/data \ - ../../../../../inc/j2me/midp2/security \ - ../../../../../inc/j2me/midp2/runtime \ - ../../../../../inc/j2me/midp2/dbv2 \ - ../../storageutils/inc +INCLUDEPATH += ../../storageutils/inc SOURCES += ../../storageutils/src/*.cpp \ ../src/*.cpp diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/legacysupport/midp2userpreferences/src/MIDP2UserPreferences.cpp --- a/javacommons/security/legacysupport/midp2userpreferences/src/MIDP2UserPreferences.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/legacysupport/midp2userpreferences/src/MIDP2UserPreferences.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -22,8 +22,8 @@ #include "UserPreferencesIterator.h" #include "MIDletSuiteUserPreferences.h" #include "MIDletSuiteCustomAttributes.h" -#include -#include +#include "MUserSecurityPreferencesTable.h" +#include "j2me/midp2/security/MSecurityPolicyV2.h" #include "SecurityPreferences.h" #include "javauid.h" diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/legacysupport/tsrc/build/securitylegacysupportunittests.mmp --- a/javacommons/security/legacysupport/tsrc/build/securitylegacysupportunittests.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/legacysupport/tsrc/build/securitylegacysupportunittests.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -22,11 +22,6 @@ #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 5bec7efefe18 -r d1278d87b01e javacommons/security/legacysupport/tsrc/src/testpermissiondb.cpp --- a/javacommons/security/legacysupport/tsrc/src/testpermissiondb.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/legacysupport/tsrc/src/testpermissiondb.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -23,7 +23,7 @@ #include "javastoragenames.h" #include "javauid.h" -#include +#include "j2me/midp2/security/midp2permissiondb.h" using namespace MIDP; using namespace java::storage; diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/legacysupport/tsrc/src/testsecuritypolicy.cpp --- a/javacommons/security/legacysupport/tsrc/src/testsecuritypolicy.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/legacysupport/tsrc/src/testsecuritypolicy.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -20,7 +20,7 @@ #include "TestHarness.h" -#include +#include "j2me/midp2/security/msecuritypolicyv2.h" using namespace MIDP; diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/legacysupport/tsrc/src/testuserpreferences.cpp --- a/javacommons/security/legacysupport/tsrc/src/testuserpreferences.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/legacysupport/tsrc/src/testuserpreferences.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -25,11 +25,11 @@ #include "javauid.h" #include "javasymbianoslayer.h" -#include -#include -#include -#include -#include +#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" using namespace MIDP; using namespace java::storage; diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/src.s60/fileutils.cpp --- a/javacommons/security/src.s60/fileutils.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/src.s60/fileutils.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -65,7 +65,7 @@ if (err == KErrNone) { // figure out the size of the file - TInt size; + TInt size = 0; if (drmContent) { TRAP(err, cafData->DataSizeL(size)); diff -r 5bec7efefe18 -r d1278d87b01e javacommons/security/src.s60/telutils.cpp --- a/javacommons/security/src.s60/telutils.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/src.s60/telutils.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -76,6 +76,19 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/security/src.s60/telutils.h --- a/javacommons/security/src.s60/telutils.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/src.s60/telutils.h Mon Aug 23 16:38:44 2010 +0100 @@ -36,6 +36,7 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/security/src/midpauthenticationmoduleimpl.cpp --- a/javacommons/security/src/midpauthenticationmoduleimpl.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/src/midpauthenticationmoduleimpl.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -15,7 +15,7 @@ * */ - +#include "javacommonutils.h" #include "javajniutils.h" #include "com_nokia_mj_impl_security_midp_authentication_AuthenticationModule.h" #include "midpauthenticationmodule.h" @@ -40,6 +40,7 @@ #include #include #include +#include using namespace java::security; using namespace java::storage; @@ -252,6 +253,13 @@ jar_hash_value = NULL; return hash; } + else + { + if (errno == ENOENT) + { + SecurityUtils::throw_exception(env, "JAR_NOT_FOUND"); + } + } return NULL; } @@ -464,7 +472,22 @@ if (X509_verify_cert(x509_ctx) != 1) { ret_code = getErrCode(X509_STORE_CTX_get_error(x509_ctx)); - break; + // If the secure time of the device has not yet been set + // to correct value (This can happen some times during + // the first device boot), + // allow installing with not yet valid certificates + if (KCertNotYetValidFailure == ret_code) + { + if (JavaCommonUtils::isFirstBoot()) + { + ret_code = KCertAndSignatureOk; + } + } + + if (KCertAndSignatureOk != ret_code) + { + break; + } } // verify the extended key usage: it must point to id-kp-codeSigning (RFC3280 code signing) // or 1.3.6.1.4.1.94.1.49.1.2.2.3 (Nokia Java Code Signing Extension) diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationModuleTests.java Mon Aug 23 16:38:44 2010 +0100 @@ -1046,8 +1046,8 @@ } catch (RuntimeSecurityException e) { - assertTrue(e.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.JAR_TAMPERED, null)) - && e.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.JAR_TAMPERED, null))); + assertTrue(e.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.JAR_NOT_FOUND, null)) + && e.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.JAR_NOT_FOUND, null))); } // root not enabled try @@ -1105,7 +1105,7 @@ appUID.getStringValue())); entry.addAttribute(new StorageAttribute( StorageNames.NAME, - "MIDlet-Operator-Allowed")); + "Nokia-MIDlet-Operator-Allowed")); entry.addAttribute(new StorageAttribute( StorageNames.VALUE, "123-45 456-789 000-000")); @@ -1126,7 +1126,7 @@ appUID.getStringValue())); entry.addAttribute(new StorageAttribute( StorageNames.NAME, - "MIDlet-Operator-Allowed")); + "Nokia-MIDlet-Operator-Allowed")); entry.addAttribute(new StorageAttribute( StorageNames.VALUE, "123-45")); @@ -1147,7 +1147,7 @@ appUID.getStringValue())); entry.addAttribute(new StorageAttribute( StorageNames.NAME, - "MIDlet-Operator-Allowed")); + "Nokia-MIDlet-Operator-Allowed")); entry.addAttribute(new StorageAttribute( StorageNames.VALUE, "123-45")); diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/build/build.xml --- a/javacommons/utils/build/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/build/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -30,6 +30,7 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/utils/build/bwins/javautilsu.def --- a/javacommons/utils/build/bwins/javautilsu.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/build/bwins/javautilsu.def Mon Aug 23 16:38:44 2010 +0100 @@ -128,4 +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 &) + ?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 5bec7efefe18 -r d1278d87b01e javacommons/utils/build/eabi/javautilsu.def --- a/javacommons/utils/build/eabi/javautilsu.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/build/eabi/javautilsu.def Mon Aug 23 16:38:44 2010 +0100 @@ -178,5 +178,7 @@ _ZNK4java7runtime16RuntimeException8toStringEv @ 177 NONAME _ZTIN4java7runtime16RuntimeExceptionE @ 178 NONAME _ZTVN4java7runtime16RuntimeExceptionE @ 179 NONAME - - + _ZN4java4util15JavaCommonUtils13wbase64encodeERKSbIwSt11char_traitsIwESaIwEE @ 180 NONAME + _ZN4java4util15JavaCommonUtils11isFirstBootEv @ 181 NONAME + _ZN4java4util15JavaCommonUtils15initIsFirstBootEv @ 182 NONAME + diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/build/javautils_0x2002DCDA.mmp --- a/javacommons/utils/build/javautils_0x2002DCDA.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/build/javautils_0x2002DCDA.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javautils.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/utils/inc.s60/java_stdcpp_support_for_dll.hrh --- a/javacommons/utils/inc.s60/java_stdcpp_support_for_dll.hrh Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/inc.s60/java_stdcpp_support_for_dll.hrh Mon Aug 23 16:38:44 2010 +0100 @@ -49,9 +49,6 @@ macro J9EPOC32 #define J9EPOC32 -macro RD_JAVA_OMJ_FSERVER -#define RD_JAVA_OMJ_FSERVER - #include "build_defines.hrh" #ifdef RD_JAVA_STDCPPV5 diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/inc/javacommonutils.h --- a/javacommons/utils/inc/javacommonutils.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/inc/javacommonutils.h Mon Aug 23 16:38:44 2010 +0100 @@ -87,6 +87,23 @@ 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. @@ -105,6 +122,33 @@ */ OS_IMPORT static std::wstring percentDecode(const std::wstring& str); + /** + * This function checks whether is it called during the first device boot + * and stores the information to static data so that isFirstBoot() can + * return it. + * + * Call this function always when the process is starting. + * + * This function creates a flag file to the private data cage / work directory + * of the process. + * + * In Symbian this method can be called only from Java Installer or + * Java MIDP processes. + * + * Return 0 if check was made successfully. Otherwise it returns errno + * defined in STDLIBS errno.h + */ + OS_IMPORT static int initIsFirstBoot(); + + /** + * This function returns true if it called during the first boot. + * Otherwise it returns false. + * + * initIsFirstBoot() must be called before this function can be called. + */ + OS_IMPORT static bool isFirstBoot(); + + public: /** * Decodes one % sequence. @@ -114,6 +158,10 @@ * @throws ExceptionBase if and are not hexadecimal characters */ static char decodeOnePercentSeq(wchar_t first, wchar_t sec); + +private: + static bool mFirstBoot; + }; // A simple class for storing char array that is deleted automatically diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/inc/javaoslayer.h --- a/javacommons/utils/inc/javaoslayer.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/inc/javaoslayer.h Mon Aug 23 16:38:44 2010 +0100 @@ -33,6 +33,7 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/utils/inc/logger.h --- a/javacommons/utils/inc/logger.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/inc/logger.h Mon Aug 23 16:38:44 2010 +0100 @@ -115,7 +115,9 @@ EDebugApi, // =34 EJavaAppMngrPlugin, // =35 EJavaBroadcast, // =36 - EJavaAMMS, // =37 + EJavaAMMS, // =37 + EJavaSettings, // =38 + EJavaQtServiceApp, // =39 // add id of new components here }; @@ -172,7 +174,9 @@ {"JavaDebugApi.log", "[JavaDebugApi]"}, // EDebugApi {"JavaAppMngrPlugin.log","[JavaAppMngrPlugin]"}, // EJavaAppMngrPlugin {"JavaBroadcast.log", "[JavaBroadcast]"}, // EJavaBroadcast - {"JavaMMAPI.log", "[ MMAPPI ]"}, // EJavaAMMS + {"JavaMMAPI.log", "[ MMAPPI ]"}, // EJavaAMMS + {"JavaSettings.log", "[ JavaSettings ]"}, // EJavaSettings + {"JavaQtServiceApp.log", "[ QtServiceApp ]"}, // EJavaQtServiceApp // add new component file name and nickname here }; diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java Mon Aug 23 16:38:44 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" @@ -162,11 +162,14 @@ *

* 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 depedent feataure + * wants to close the application using some platform dependent feature * (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 @@ -177,6 +180,23 @@ 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 @@ -221,7 +241,7 @@ * @param listener the new listener. */ public void addShutdownListener(ShutdownListener listener) -{ + { if (mListeners == null) { mListeners = new Vector(); diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/javasrc/com/nokia/mj/impl/utils/ErrorMessageBase.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ErrorMessageBase.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ErrorMessageBase.java Mon Aug 23 16:38:44 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" @@ -24,8 +24,6 @@ /** * Base class for classes defining localized error messages. * - * @author Nokia Corporation - * @version 1.0 * @see InstallerExceptionBase */ abstract public class ErrorMessageBase @@ -34,6 +32,19 @@ 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. * @@ -51,7 +62,12 @@ { return this.getClass().getName() + ": No message found for error " + errorCode; } - return getResourceLoader().format(msgId, errorMessageParameters); + ResourceLoader rl = getResourceLoader(); + if (rl == null) + { + rl = getResourceLoader(errorCode); + } + return rl.format(msgId, errorMessageParameters); } /*** ---------------------------- PROTECTED --------------------------- */ @@ -65,11 +81,64 @@ /** * Method for retrieving the ResourceLoader instance that is used - * to localise error messages. + * to localise error messages. If this method returns null, + * the ResourceLoader is obtained with getResourceLoader(int) + * method variant which then must not return null. + * * 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 5bec7efefe18 -r d1278d87b01e javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java Mon Aug 23 16:38:44 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,6 +28,7 @@ *

    *
  • %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 @@ -60,7 +61,7 @@ private String replaced; /** Next replacement index */ - private int nextIndex = 0; + private int nextIndex = (ResourceLoader.getLocaleIdQt() == null? 0: 1); /*** ----------------------------- PUBLIC ------------------------------ */ @@ -69,7 +70,7 @@ * * @param pattern formatter pattern */ - public Formatter(String aPattern) + Formatter(String aPattern) { pattern = aPattern; replaced = aPattern; @@ -90,11 +91,12 @@ replace("%U", string)) { nextIndex++; - } else { - Logger.WLOG(Logger.EUtils, "String replacement failed"); + Logger.WLOG(Logger.EUtils, + "String replacement failed on parameter " + + nextIndex + ": " + pattern); } return this; } @@ -110,8 +112,9 @@ { String localisedNumber = _formatInteger(number); - // Try to replace with patterns %nN, %n, %N - if (replace("%" + nextIndex + "N", localisedNumber) || + // Try to replace with patterns %Ln, %nN, %n, %N + if (replace("%" + "L" + nextIndex, localisedNumber) || + replace("%" + nextIndex + "N", localisedNumber) || replace("%" + nextIndex, localisedNumber) || replace("%N", localisedNumber)) { @@ -120,7 +123,9 @@ } else { - Logger.WLOG(Logger.EUtils, "Integer replacement failed"); + Logger.WLOG(Logger.EUtils, + "Integer replacement failed on parameter " + + nextIndex + ": " + pattern); } return this; } @@ -146,7 +151,9 @@ } else { - Logger.WLOG(Logger.EUtils, "Character replacement failed"); + Logger.WLOG(Logger.EUtils, + "Character replacement failed on parameter " + + nextIndex + ": " + pattern); } return this; } @@ -208,7 +215,7 @@ // Reset for next usage replaced = pattern; - nextIndex = 0; + nextIndex = (ResourceLoader.getLocaleIdQt() == null? 0: 1); return result; } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/javasrc/com/nokia/mj/impl/utils/Id.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Id.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +package com.nokia.mj.impl.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 5bec7efefe18 -r d1278d87b01e javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerDetailedErrorMessage.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerDetailedErrorMessage.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerDetailedErrorMessage.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,9 +22,6 @@ /** * Class defining Installer detailed error messages. - * - * @author Nokia Corporation - * @version 1.0 */ public final class InstallerDetailedErrorMessage extends ErrorMessageBase { @@ -42,6 +39,8 @@ 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 --------------------------- */ @@ -58,19 +57,42 @@ return iMessageTable; } Hashtable messageTable = new Hashtable(); - 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"); + 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"); + } iMessageTable = messageTable; return iMessageTable; } @@ -84,7 +106,14 @@ { if (iRes == null) { - iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_"); + if (getLocaleIdQt() == null) + { + iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_"); + } + else + { + iRes = ResourceLoader.getInstance("javaapplicationinstaller", "txt_java_inst_info_"); + } } return iRes; } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerErrorMessage.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerErrorMessage.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerErrorMessage.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,34 +22,31 @@ /** * 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; - 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; + 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; // Uninstallation error codes. - public static final int UNINST_NOT_ALLOWED = 101; - public static final int UNINST_UNEXPECTED_ERR = 102; - public static final int UNINST_CANCEL = 103; + 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; /** * 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 = 201; + public static final int OTHER_UNEXPECTED_ERR = 13 + ErrorMessageBase.INSTALLER_RANGE_START; /*** ----------------------------- PUBLIC ------------------------------ */ /*** ---------------------------- PROTECTED --------------------------- */ @@ -66,19 +63,38 @@ return iMessageTable; } Hashtable messageTable = new Hashtable(); - 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"); + 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"); + } iMessageTable = messageTable; return iMessageTable; } @@ -92,7 +108,14 @@ { if (iRes == null) { - iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_"); + if (getLocaleIdQt() == null) + { + iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_"); + } + else + { + iRes = ResourceLoader.getInstance("common_errors", "txt_error_"); + } } return iRes; } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/javasrc/com/nokia/mj/impl/utils/LocalizedTextProvider.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/LocalizedTextProvider.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/LocalizedTextProvider.java Mon Aug 23 16:38:44 2010 +0100 @@ -28,5 +28,5 @@ * @return the text associated with the provided * identifier and parameters */ - public abstract String getText(String aTextId, Object[] aTextParams); + public abstract String getText(Id aTextId, Object[] aTextParams); } diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java Mon Aug 23 16:38:44 2010 +0100 @@ -81,6 +81,7 @@ 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 @@ -138,6 +139,7 @@ false, //EJavaAppMngrPlugin = 35; false, //EJavaBroadcast = 36; false, //EJavaAMMS = 37; + false, //EJavaSettings = 38; // add new components here }; diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java Mon Aug 23 16:38:44 2010 +0100 @@ -40,6 +40,11 @@ */ 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/"; @@ -50,10 +55,30 @@ private Hashtable resourceMap = new Hashtable(); /** Resource name prefix */ - private String prefix; + private String prefix = null; + + /** Platform localisation type. */ + private int locType = -1; /*** ----------------------------- 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. * @@ -74,6 +99,46 @@ } /** + * 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 @@ -82,7 +147,7 @@ public ResourceLoader(String resourceName, String aPrefix) { prefix = aPrefix; - loadFile(resourceName); + loadFile(resourceName, true); // Avkon } /** @@ -98,6 +163,59 @@ } /** + * 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 @@ -111,6 +229,20 @@ } /** + * 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 @@ -172,35 +304,77 @@ 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 + * 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. */ - private void loadFile(String resourceName) + private boolean loadFile(String resourceName, boolean avkon) { InputStream is = null; - // Load with real locale id - is = this.getClass().getResourceAsStream( - LOC_RESOURCE_BASE + resourceName + "_" + getLocaleId() + ".loc"); - if (is == null) + if (!avkon) // Qt resources. { - // Load the engineering english + 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 is = this.getClass().getResourceAsStream( - LOC_RESOURCE_BASE + resourceName + "_sc" + ".loc"); + 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; + } } - if (is == null) + else // Avkon resources. { - // Load the reference engineering english + // Load with real locale id is = this.getClass().getResourceAsStream( - LOC_RESOURCE_BASE + resourceName + ".loc"); - } - if (is == null) - { - Logger.WLOG(Logger.EUtils, - "Cannot load resource file: " + resourceName); - return; + 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; + } } try @@ -248,6 +422,8 @@ "Resource file " + resourceName + " handling failed: " + ex.getMessage()); } + + return true; } /** @@ -366,4 +542,11 @@ */ 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 5bec7efefe18 -r d1278d87b01e javacommons/utils/src.s60/formatternative.cpp --- a/javacommons/utils/src.s60/formatternative.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/src.s60/formatternative.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -16,10 +16,14 @@ */ -//#include #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" @@ -45,7 +49,6 @@ 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) @@ -68,7 +71,10 @@ "Cannot format %d to current locale. Error: %d", aNumber, error); } - AknTextUtils::LanguageSpecificNumberConversion( numberPtr ); +#ifndef RD_JAVA_UI_QT + AknTextUtils::LanguageSpecificNumberConversion( numberPtr ); +#endif // RD_JAVA_UI_QT + return aJni->NewString( (const jchar*)numberPtr.Ptr(), numberPtr.Length()); } @@ -116,8 +122,24 @@ 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 5bec7efefe18 -r d1278d87b01e javacommons/utils/src.s60/javaoslayer.cpp --- a/javacommons/utils/src.s60/javaoslayer.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/src.s60/javaoslayer.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -39,6 +39,7 @@ 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"); @@ -303,6 +304,10 @@ { 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 5bec7efefe18 -r d1278d87b01e javacommons/utils/src/javacommonutils.cpp --- a/javacommons/utils/src/javacommonutils.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/src/javacommonutils.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -15,9 +15,11 @@ * */ - +#include +#include #include #include +#include #include #include @@ -33,6 +35,16 @@ using namespace java::util; +// In Symbian working directory should be initalized to C:\private\ by OpenC +// But for some reason this does not seem to work if process binary is in rom. +#ifdef __SYMBIAN32__ +const char* const FIRST_BOOT_FILE = "c:\\private\\102033E6\\first_boot_done.dat"; +#else +const char* const FIRST_BOOT_FILE = "first_boot_done.dat"; +#endif /* __SYMBIAN32__ */ + +bool JavaCommonUtils::mFirstBoot = false; + OS_EXPORT int JavaCommonUtils::stringToInt(const std::string& str) { // JELOG2(EUtils); @@ -277,6 +289,34 @@ 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()); @@ -344,6 +384,40 @@ } +OS_EXPORT int JavaCommonUtils::initIsFirstBoot() +{ + struct stat fileStatBuf; + if (stat(FIRST_BOOT_FILE, &fileStatBuf) == 0) + { + mFirstBoot = false; + } + else + { + mFirstBoot = true; + + // Create flag file so that next time we detect that first boot + // has already been done + int fd = open(FIRST_BOOT_FILE, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); + if (fd < 0) + { + return errno; + } + else + { + close(fd); + } + } + + return 0; +} + + +OS_EXPORT bool JavaCommonUtils::isFirstBoot() +{ + return mFirstBoot; +} + + char JavaCommonUtils::decodeOnePercentSeq(wchar_t first, wchar_t sec) { // Handle one encoded %XY diff -r 5bec7efefe18 -r d1278d87b01e javacommons/utils/src/javainifileutils.cpp --- a/javacommons/utils/src/javainifileutils.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/src/javainifileutils.cpp Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javacommons/utils/src/logger.cpp --- a/javacommons/utils/src/logger.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javacommons/utils/src/logger.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -30,6 +30,10 @@ #include #include +#include +#include +#include + #include "jdebug_omj.h" #include "logger.h" #include "javacommonutils.h" diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/bluecove/build/javabluecove_0x2002DC97.mmp --- a/javaextensions/bluetooth/bluecove/build/javabluecove_0x2002DC97.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/bluecove/build/javabluecove_0x2002DC97.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javabluecove.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons_0x2002DC99.mmp --- a/javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons_0x2002DC99.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons_0x2002DC99.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javabluetoothcommons.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/bluetoothcommons/src.s60/bluetoothnamelookup.cpp --- a/javaextensions/bluetooth/bluetoothcommons/src.s60/bluetoothnamelookup.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothcommons/src.s60/bluetoothnamelookup.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -63,9 +63,8 @@ mLookupMonitor = new CActiveSchedulerWait(); } LOG1(EJavaBluetooth, EInfo, - "+ BluetoothNameLookup::doDeviceNameLookupL DeviceAddress:%x", + "+ BluetoothNameLookup::doDeviceNameLookupL DeviceAddress:%llx", aDevAddr); - TProtocolDesc pdesc; User::LeaveIfError(mSocketServ.FindProtocol(KBTLinkManagerTxt(), pdesc)); diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp --- a/javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp Mon Aug 23 16:38:44 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,7 +1310,10 @@ unsigned int devServClass = 0; ret = read(persistentRecFd, &devServClass, sizeof(devServClass)); if (ret <= 0) + { + delete srvRecPopulator; return; + } elementBuilder = srvRecPopulator->SetDeviceServiceClass(devServClass); diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/bluetoothplugins/btgoeppushplugin/build/javabtgoepscplugin_0x2002DC9A.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btgoeppushplugin/build/javabtgoepscplugin_0x2002DC9A.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btgoeppushplugin/build/javabtgoepscplugin_0x2002DC9A.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javabtgoepscplugin.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/bluetoothplugins/btjavacaptainplugin/build/javacaptain_ext_btdeviceclassmanager_0x2002DC9D.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btjavacaptainplugin/build/javacaptain_ext_btdeviceclassmanager_0x2002DC9D.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btjavacaptainplugin/build/javacaptain_ext_btdeviceclassmanager_0x2002DC9D.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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_btdeviceclassmanager.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/build/javabtl2capscplugin_0x2002DC9B.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/build/javabtl2capscplugin_0x2002DC9B.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/build/javabtl2capscplugin_0x2002DC9B.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javabtl2capscplugin.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src.s60/btl2capserverconnection.cpp --- a/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src.s60/btl2capserverconnection.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src.s60/btl2capserverconnection.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -489,7 +489,21 @@ if (KErrNone == err) { mAcceptedSocket->RemoteName(btRemoteAddr); - if (mAsyncAccept && (!mAvoidFilter) && (false == isConnectionAllowed(btRemoteAddr))) + TBuf<20> addr; + TInt64 longBtAddr = 0; + TBTDevAddr btDeviceAddress = btRemoteAddr.BTAddr(); + LOG4(EJavaBluetooth,EInfo,"TBTDevAddr Address is %x %x %x %x ", + btDeviceAddress[0],btDeviceAddress[1], + btDeviceAddress[2],btDeviceAddress[3]); + LOG2(EJavaBluetooth,EInfo,"%x %x",btDeviceAddress[4], + btDeviceAddress[5]); + btDeviceAddress.GetReadable(addr); + LOG1(EJavaBluetooth,EInfo,"BT: Readable address is %S",&addr); + TLex16 toParse(addr); + toParse.Val(longBtAddr, EHex); + LOG1(EJavaBluetooth, EInfo, + "L2CAPServerConnection::HandleAcceptCompleteL: Address: %llx", longBtAddr); + if ((longBtAddr == 0) ||(mAsyncAccept && (!mAvoidFilter) && (false == isConnectionAllowed(btRemoteAddr)))) { mAcceptedSocket->CancelAll(); mAcceptedSocket->Shutdown(RSocket::EImmediate); @@ -500,14 +514,7 @@ AcceptL(); return; } - TBuf<20> addr; - TInt64 longBtAddr = 0; - TBTDevAddr btDeviceAddress = btRemoteAddr.BTAddr(); - btDeviceAddress.GetReadable(addr); - TLex16 toParse(addr); - toParse.Val(longBtAddr, EHex); - LOG1(EJavaBluetooth, EInfo, - "L2CAPServerConnection::HandleAcceptCompleteL: Address: %ld", longBtAddr); + mBtClientConn = new BluetoothClientConnection(mAcceptedSocket, mServer); mAcceptedSocket->GetOpt(KL2CAPInboundMTU, KSolBtL2CAP, negotiatedReceiveMtu); mAcceptedSocket->GetOpt(KL2CAPNegotiatedOutboundMTU, KSolBtL2CAP, negotiatedTransmitMtu); diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src/btl2cappushserverconnection.cpp --- a/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src/btl2cappushserverconnection.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src/btl2cappushserverconnection.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -199,7 +199,9 @@ BluetoothNameLookup * nameLookup = NULL; long long remoteDevAddr = aClientConnection->getRemoteAddress(); - + ELOG1(EJavaBluetooth, + "+ L2CapPushServerConnection::handleConnectionRequest DeviceAddress:%llx", + remoteDevAddr); TRAPD(lookupErr, { nameLookup = BluetoothNameLookup::NewL(); diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/bluetoothplugins/btspppushplugin/build/javabtsppscplugin_0x2002DC9C.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/build/javabtsppscplugin_0x2002DC9C.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/build/javabtsppscplugin_0x2002DC9C.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javabtsppscplugin.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/bluetoothplugins/btspppushplugin/src.s60/btrfcommserverconnection.cpp --- a/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/src.s60/btrfcommserverconnection.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/src.s60/btrfcommserverconnection.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -437,7 +437,21 @@ if (KErrNone == err) { mAcceptedSocket->RemoteName(btRemoteAddr); - if (mAsyncAccept && (!mAvoidFilter) && (false == isConnectionAllowed(btRemoteAddr))) + TBuf<20> addr; + TInt64 longBtAddr = 0; + TBTDevAddr btDeviceAddress = btRemoteAddr.BTAddr(); + LOG4(EJavaBluetooth,EInfo,"TBTDevAddr Address is %x %x %x %x ", + btDeviceAddress[0],btDeviceAddress[1], + btDeviceAddress[2],btDeviceAddress[3]); + LOG2(EJavaBluetooth,EInfo,"%x %x",btDeviceAddress[4], + btDeviceAddress[5]); + btDeviceAddress.GetReadable(addr); + LOG1(EJavaBluetooth,EInfo,"BT: Readable address is %S",&addr); + TLex16 toParse(addr); + toParse.Val(longBtAddr, EHex); + LOG1(EJavaBluetooth, EInfo, + "L2CAPServerConnection::HandleAcceptCompleteL: Address: %llx", longBtAddr); + if ((longBtAddr == 0) ||(mAsyncAccept && (!mAvoidFilter) && (false == isConnectionAllowed(btRemoteAddr)))) { mAcceptedSocket->CancelAll(); mAcceptedSocket->Shutdown(RSocket::EImmediate); @@ -448,13 +462,7 @@ AcceptL(); return; } - TBuf<20> addr; - TInt64 longBtAddr = 0; - TBTDevAddr btDeviceAddress = btRemoteAddr.BTAddr(); - btDeviceAddress.GetReadable(addr); - TLex16 toParse(addr); - toParse.Val(longBtAddr, EHex); - LOG1(EJavaBluetooth, EInfo, "RFCOMMServerConnection::HandleAcceptCompleteL: Address: %ld", longBtAddr); + mBtClientConn = new BluetoothClientConnection(mAcceptedSocket, mServer); mBtClientConn->initialize(PROTOCOL_RFCOMM, longBtAddr, 0, 0); if (mAsyncAccept) diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/bluetooth/omjbluetooth/build/javabluetooth_0x2002DC98.mmp --- a/javaextensions/bluetooth/omjbluetooth/build/javabluetooth_0x2002DC98.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/omjbluetooth/build/javabluetooth_0x2002DC98.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javabluetooth.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/bluetooth/omjbluetooth/javasrc/com/nokia/mj/impl/properties/bluetooth/BtDynamicPropertyHandler.java Mon Aug 23 16:38:44 2010 +0100 @@ -65,7 +65,7 @@ private static final int MASTER_SWITCH = 7; - private static final int SD_TRANS_MAX = 8; + private static final int SD_TRANS_MAX = 1; private static final int SD_ATTR_RETRIEVE_MAX = 9; diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/broadcast_stub/build/javabroadcast_0x2002DCE0.mmp --- a/javaextensions/broadcast_stub/build/javabroadcast_0x2002DCE0.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/broadcast_stub/build/javabroadcast_0x2002DCE0.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javabroadcast.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/comm/build/javacomm_0x2002DCA5.mmp --- a/javaextensions/comm/build/javacomm_0x2002DCA5.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/comm/build/javacomm_0x2002DCA5.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javacomm.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/datagram/datagram/build/javadatagram.pro --- a/javaextensions/datagram/datagram/build/javadatagram.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/datagram/datagram/build/javadatagram.pro Mon Aug 23 16:38:44 2010 +0100 @@ -21,6 +21,6 @@ INCLUDEPATH += ../../inc -LIBS += -ljavadatagramscplugin -ljavagcf +LIBS += -ljavadatagramscplugin -ljavagcf -ljavasocket include(../../../../build/omj.pri) diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/datagram/datagram/build/javadatagram_0x2002DCA9.mmp --- a/javaextensions/datagram/datagram/build/javadatagram_0x2002DCA9.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/datagram/datagram/build/javadatagram_0x2002DCA9.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javadatagram.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc @@ -75,6 +74,7 @@ LIBRARY javadatagramscplugin.lib LIBRARY javagcf.lib +LIBRARY javasocket.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/datagram/UDPDatagramConnectionImpl.java --- a/javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/datagram/UDPDatagramConnectionImpl.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/datagram/datagram/javasrc/com/nokia/mj/impl/datagram/UDPDatagramConnectionImpl.java Mon Aug 23 16:38:44 2010 +0100 @@ -297,7 +297,33 @@ { throw new IOException("getLocalAddress failed: connection is already closed"); } - retVal = _getLocalAddress(iNativePeerHandle, address); + int apId = -1; + int apType = -1; + try + { + + Uid appSuite = ApplicationInfo.getInstance().getSuiteUid(); + iCmInstance = ConnectionManager.getInstance(); + AccessPoint apn = iCmInstance.getApplicationDefault(appSuite); + if (apn != null) + { + apId = apn.getNapId(); + apType = apn.getType(); + + if ((apType!=AccessPoint.NAP_SNAP) && (apType!=AccessPoint.NAP_IAP)) + { + apType = -1; + apId = -1; + } + Logger.LOG(Logger.ESOCKET, Logger.EInfo, + "+SocketServerConnectionImpl:: getApplicationDefault returned, \n"+apn.getNapId()+" type = "+apn.getType()); + } + } + catch (Exception e) + { + + } + retVal = _getLocalAddress(iNativePeerHandle, address, apId, apType); if (retVal < 0) { throw new IOException("getLocalAddress method failed.Posix error code: " + retVal); @@ -512,7 +538,7 @@ public Datagram newDatagram(byte[] aBuf, int aSize, String aAddr) throws IOException { - + DatagramImpl tmp = null; if (!iConnectionOpen) { throw new IOException("newDatagram failed: connection is already closed"); @@ -524,9 +550,21 @@ if (aAddr != null) { UrlParser urlvalidation = new UrlParser(aAddr); + tmp = new DatagramImpl(aBuf, aSize, aAddr); } - DatagramImpl t = new DatagramImpl(aBuf, aSize, aAddr); - return t; + else + { + String tmpAddr = null; + if (iUri != null) // server datagram if iUri = null + { + if (iUri.host != null) // server datagram is host is null + { + tmpAddr = iUri.toString(); + } + } + tmp = new DatagramImpl(aBuf, aSize, tmpAddr); + } + return tmp; } Finalizer registerforFinalization() @@ -571,7 +609,7 @@ int length, String host, int port); private native int _receive(int iNativePeerHandle, byte[] buf, int offset, int length, String[] senderAddr, int[] senderPort); - private native int _getLocalAddress(int iNativePeerHandle, String[] address); + private native int _getLocalAddress(int iNativePeerHandle, String[] address, int aIapId, int aType); private native int _getLocalPort(int iNativePeerHandle); private native int _close(int iNativePeerHandle); private native void _dispose(int iNativePeerHandle); diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/datagram/datagram/src/datagramconnectionjni.cpp --- a/javaextensions/datagram/datagram/src/datagramconnectionjni.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/datagram/datagram/src/datagramconnectionjni.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -23,6 +23,7 @@ #include "logger.h" #include "pushexception.h" #include "pusherrorcodes.h" +#include "socketlocalhostinfo.h" using namespace java; @@ -99,16 +100,18 @@ } JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_datagram_UDPDatagramConnectionImpl__1getLocalAddress -(JNIEnv *aJni, jobject, jint nativePeerHandle, jobjectArray aAddress) +(JNIEnv *aJni, jobject, jint /* nativePeerHandle */, jobjectArray aAddress, jint aMidletIapId, jint aApType) { char * addr = new char[256]; - NativeDatagramConnection* datagramConn = reinterpret_cast(nativePeerHandle); - int retVal = datagramConn->getLocalAddress(addr); + + int err = SocketLocalHostInfo::getLocalAddress(0,addr,aMidletIapId,aApType); + PLOG2(ESOCKET, "getLocalAddress, ret = %d, addr = %s" , err, addr); jstring jnistring = aJni->NewStringUTF(addr); aJni->SetObjectArrayElement(aAddress, 0, jnistring); aJni->DeleteLocalRef(jnistring); delete[] addr; - return retVal; + + return err; } JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_datagram_UDPDatagramConnectionImpl__1getLocalPort diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/datagram/datagram/src/nativedatagramconnection.cpp --- a/javaextensions/datagram/datagram/src/nativedatagramconnection.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/datagram/datagram/src/nativedatagramconnection.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -98,6 +98,11 @@ LOG(ESOCKET, EInfo, "Datagram client connection"); mSockDesc = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = htonl(INADDR_ANY); + int res = bind(mSockDesc, (struct sockaddr*) &addr, sizeof(addr)); + LOG1(ESOCKET, EInfo, "Datagram client connection, bind returned %d",res); if (aApn != -1) { diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/datagram/serverconnection/build/javadatagramscplugin_0x2002DCAA.mmp --- a/javaextensions/datagram/serverconnection/build/javadatagramscplugin_0x2002DCAA.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/datagram/serverconnection/build/javadatagramscplugin_0x2002DCAA.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javadatagramscplugin.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/globalindicators/build/javaglobalindicators_0x2002DCAF.mmp --- a/javaextensions/globalindicators/build/javaglobalindicators_0x2002DCAF.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/globalindicators/build/javaglobalindicators_0x2002DCAF.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javaglobalindicators.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/iapinfo/build/javaiapinfo_0x2002DCB3.mmp --- a/javaextensions/iapinfo/build/javaiapinfo_0x2002DCB3.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/iapinfo/build/javaiapinfo_0x2002DCB3.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javaiapinfo.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/javaextensions.pro --- a/javaextensions/javaextensions.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/javaextensions.pro Mon Aug 23 16:38:44 2010 +0100 @@ -15,7 +15,7 @@ # TEMPLATE = subdirs SUBDIRS += iapinfo/build/javaiapinfo.pro -SUBDIRS += mobinfo/build/mobinfo.pro +SUBDIRS += mobinfo/build/javamobinfo.pro SUBDIRS += comm/build/javacomm.pro SUBDIRS += globalindicators/build/javaglobalindicators.pro SUBDIRS += webservices/build/javawebservices.pro diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/location/build/javalocation_0x2002DCBC.mmp --- a/javaextensions/location/build/javalocation_0x2002DCBC.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/location/build/javalocation_0x2002DCBC.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javalocation.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/location/landmarks/src/landmark.cpp --- a/javaextensions/location/landmarks/src/landmark.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/location/landmarks/src/landmark.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -457,6 +457,11 @@ return error; } +LOCAL_C void dispose(CBase* aLandmark) +{ + delete aLandmark; +} + /* * Class: javax_microedition_location_Landmark * Method: _dispose @@ -466,14 +471,15 @@ JNICALL Java_javax_microedition_location_Landmark__1dispose( JNIEnv* /*aJniEnv*/, jobject /*aPeer*/, - jint /*aEventSourceHandle*/, + jint aEventSourceHandle, jint aLandmarkHandle) { JELOG2(EJavaLocation); - + LocationFunctionServer* eventSource = + reinterpret_cast< LocationFunctionServer*>(aEventSourceHandle); + CBase* object = reinterpret_cast< CBase*>(aLandmarkHandle); - - delete object; + eventSource->ExecuteTrap(dispose,object); } // End of file diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/location/position/src/cpositioner.cpp --- a/javaextensions/location/position/src/cpositioner.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/location/position/src/cpositioner.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -156,10 +156,9 @@ case KErrAccessDenied: // Fallthrough case KErrUnknown: // Used in MLFW // Position request was canceled - 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 + case KErrCancel: // Fallthrough + // Partial update feature is not supported. So 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 5bec7efefe18 -r d1278d87b01e javaextensions/midppush/build/javapushregistry_0x2002DCC9.mmp --- a/javaextensions/midppush/build/javapushregistry_0x2002DCC9.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/midppush/build/javapushregistry_0x2002DCC9.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javapushregistry.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/midppush/pushcontroller/build/javapushcontroller_0x2002DCC8.mmp --- a/javaextensions/midppush/pushcontroller/build/javapushcontroller_0x2002DCC8.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/midppush/pushcontroller/build/javapushcontroller_0x2002DCC8.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javapushcontroller.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/midppush/pushregistryplugin/build/javacaptain_ext_pushregistryplugin_0x2002DCA2.mmp --- a/javaextensions/midppush/pushregistryplugin/build/javacaptain_ext_pushregistryplugin_0x2002DCA2.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/midppush/pushregistryplugin/build/javacaptain_ext_pushregistryplugin_0x2002DCA2.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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_pushregistryplugin.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/midprms_db/build/javarms_0x2002DCCB.mmp --- a/javaextensions/midprms_db/build/javarms_0x2002DCCB.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/midprms_db/build/javarms_0x2002DCCB.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javarms.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RmsFileInfo.java --- a/javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RmsFileInfo.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RmsFileInfo.java Mon Aug 23 16:38:44 2010 +0100 @@ -71,7 +71,7 @@ private long getSize() { - long size = 0; + long size = -1; try { size = iFile.fileSize(); @@ -82,6 +82,7 @@ } if (size < 0) { + Logger.WLOG(Logger.EMidpRms, "fileSize = " + size); size = 0; } return size; @@ -102,18 +103,19 @@ private long getFreeSpace() { - long size = 0; + long size = -1; try { size = iFile.availableSize(); } catch (Exception e) { - Logger.ELOG(Logger.EMidpRms, "availableSize()" , e); + Logger.ELOG(Logger.EMidpRms, "availableSize() failed" , e); } if (size < 0) { - size = 0; + Logger.WLOG(Logger.EMidpRms, "availableSize = " + size); + size = MAX_RMS_SIZE; } return size; } diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/midprms_db/rmsplugin/build/javacaptain_ext_ondemand_2_0x2002DD01.mmp --- a/javaextensions/midprms_db/rmsplugin/build/javacaptain_ext_ondemand_2_0x2002DD01.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/midprms_db/rmsplugin/build/javacaptain_ext_ondemand_2_0x2002DD01.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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_ondemand_2.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/mobinfo/build/bld.inf --- a/javaextensions/mobinfo/build/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/mobinfo/build/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -19,4 +19,4 @@ default PRJ_MMPFILES -mobinfo_0x2002DCC3.mmp +javamobinfo_0x2002DCC3.mmp diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/mobinfo/build/javamobinfo.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/mobinfo/build/javamobinfo.pro Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javaextensions/mobinfo/build/javamobinfo_0x2002DCC3.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/mobinfo/build/javamobinfo_0x2002DCC3.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,150 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javaextensions/mobinfo/build/mobinfo.pro --- a/javaextensions/mobinfo/build/mobinfo.pro Mon Jul 19 17:58:36 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 -} - -include(../../../build/omj.pri) diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/mobinfo/build/mobinfo_0x2002DCC3.mmp --- a/javaextensions/mobinfo/build/mobinfo_0x2002DCC3.mmp Mon Jul 19 17:58:36 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.3) 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 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 5bec7efefe18 -r d1278d87b01e javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoProperties.java --- a/javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoProperties.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoProperties.java Mon Aug 23 16:38:44 2010 +0100 @@ -140,6 +140,9 @@ int value = ((Integer)iPropertyKeys.get(aKey)).intValue(); Uid appSuiteUid; + int apId = APP_DEFAULT_APN_NOT_SPECIFIED; // access point id + int apType = APP_DEFAULT_APN_NOT_SPECIFIED; // MIDlet access point type, can be SNAP or IAP + ConnectionManager CmInstance = null; String result = null; // Only network access seems to have another way to handle it. @@ -160,29 +163,25 @@ AccessPoint apn = CmInstance.getApplicationDefault(appSuiteUid); if (apn != null) { - if (apn.getType() == AccessPoint.NAP_IAP) // IAP ID + apId = apn.getNapId(); + apType = apn.getType(); + + + if ((apType!=AccessPoint.NAP_SNAP) && (apType!=AccessPoint.NAP_IAP)) { - result = _getPropertyApn(NETWORK_ACCESS_V, apn.getNapId()); + apType = APP_DEFAULT_APN_NOT_SPECIFIED; + apId = APP_DEFAULT_APN_NOT_SPECIFIED; } - else - { - result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED); - } + } - else - { - result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED); - } + } - else - { - result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED); - } + result = _getPropertyApn(NETWORK_ACCESS_V, apId,apType); } catch (Exception e) { Logger.LOG(Logger.ESOCKET, Logger.EInfo,"MobilInfoProperties :: getSuiteUid exception "); - result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED); + result = _getPropertyApn(NETWORK_ACCESS_V, apId,apType); } return result; } @@ -202,6 +201,6 @@ } private native String _getProperty(int value); - private static native String _getPropertyApn(int property, int aAppDefaultApn); + private static native String _getPropertyApn(int property, int aAppDefaultApn, int apType); } \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/mobinfo/src.s60/javamobinfo.cpp --- a/javaextensions/mobinfo/src.s60/javamobinfo.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/mobinfo/src.s60/javamobinfo.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -29,6 +29,8 @@ #include #include #include +#include "connectionmanager.h" + using namespace CMManager; #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS @@ -75,14 +77,15 @@ // --------------------------------------------------------------------------- // forward declarations // --------------------------------------------------------------------------- -HBufC* GetProperty(const TInt aProperty, const TUint32 aAppDefaultApn); +HBufC* GetProperty(const TInt aProperty, const TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType); HBufC* GetTelephonyPropertyL(const TInt aProperty); HBufC* GetDateTimePropertyL(const TInt aProperty); -HBufC* GetNetworkAccessL(const TUint32 aAppDefaultApn); +HBufC* GetNetworkAccessL(const TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType); TUint32 GetUsedIapL(); HBufC* GetBearerTypeL(TUint32 aIapId); +HBufC* GetIapBearerTypeL(const TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType); HBufC* TranslateBearerInfoToNetworkAccessL(TConnMonBearerInfo aBearerInfo); -HBufC* GetDefIapBearerTypeL(TUint32 aMidSuiteId); +HBufC* GetAppDefIapBearerTypeL(const TUint32 aAppDefaultApn); /* * Class: com_nokia_mj_impl_properties_mobinfo_MobileInfoProperties @@ -95,16 +98,18 @@ // Each mobinfo java property implementation calls the getPropertyMsid() // function of the MobileInfoProperties class. // @param aProperty name of the actual property +// @param aAppDefaultApn application default access point id +// @param aAppDefaultApType application default access point type ( SNAP, IAP) // @param aAppDefaultApn Application default apn // ----------------------------------------------------------------------------- JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_properties_mobinfo_MobileInfoProperties__1getPropertyApn -(JNIEnv* aJni, jclass, jint aProperty, jint aAppDefaultApn) +(JNIEnv* aJni, jclass, jint aProperty, jint aAppDefaultApn, jint aAppDefaultApType) { LOG1(ESOCKET, EInfo, "MOBINFO + getPropertyMsid(), msid: %D", aAppDefaultApn); HBufC* property = NULL; jstring str = NULL; - property = GetProperty(aProperty, aAppDefaultApn); + property = GetProperty(aProperty, aAppDefaultApn,aAppDefaultApType); if (NULL != property) { LOG(ESOCKET,EInfo,"_getPropertyApn, property is not null"); @@ -124,7 +129,7 @@ HBufC* property = NULL; jstring str = NULL; - property = GetProperty(aKey,NULL); + property = GetProperty(aKey,NULL,0); if (NULL != property) { TPtrC data(property->Des()); @@ -134,7 +139,7 @@ return str; } -HBufC* GetProperty(const TInt aProperty, const TUint32 aAppDefaultApn) +HBufC* GetProperty(const TInt aProperty, const TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType) { JELOG2(ESOCKET); LOG(ESOCKET, EInfo, "MOBINFO + GetProperty()"); @@ -148,7 +153,7 @@ TRAP(err, property = GetDateTimePropertyL(aProperty)); break; case NETWORK_ACCESS: - TRAP(err, property = GetNetworkAccessL(aAppDefaultApn)); + TRAP(err, property = GetNetworkAccessL(aAppDefaultApn,aAppDefaultApType)); LOG(ESOCKET, EInfo,"after GetNetworkAccessL"); break; @@ -785,21 +790,178 @@ // Get type network access of currently used active connection // @return network access, ownership hand over // --------------------------------------------------------------------------- -HBufC* GetNetworkAccessL(TUint32 aAppDefaultApn) +HBufC* GetNetworkAccessL(TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType) { LOG(ESOCKET, EInfo, "MOBINFO + GetNetworkAccessL"); HBufC* bearerType = NULL; TUint32 iapId = GetUsedIapL(); - if (iapId == 0) + if (iapId != 0) + { + // active connection present, opened by MIDlet. + bearerType = GetBearerTypeL(iapId); + + } + else { - bearerType = GetDefIapBearerTypeL(aAppDefaultApn); + // if there is no active connection by the application, return the app default bearer type. + if (aAppDefaultApType == 3) + { + // app default is IAP + bearerType = GetAppDefIapBearerTypeL(aAppDefaultApn); + + } + else + { + bearerType = GetIapBearerTypeL(aAppDefaultApn,aAppDefaultApType); + } + + } + LOG(ESOCKET, EInfo, "MOBINFO - GetNetworkAccessL"); + return bearerType; +} + + +//// --------------------------------------------------------------------------- +//// Check if device default is set (SNAP or IAP) +//// @return true if device default defined, else false +//// --------------------------------------------------------------------------- + +bool isDeviceDefaultPresentL() +{ + TCmDefConnType type; + RCmManager * mgr = new(ELeave) RCmManager(); + mgr->OpenL(); + + TCmDefConnValue obj; + mgr->ReadDefConnL(obj); + type = obj.iType; + + if ((type!=ECmDefConnConnectionMethod) && (type!=ECmDefConnDestination)) + { + // device default is other than SNAP or IAP + return false; } else { - bearerType = GetBearerTypeL(iapId); + return true; + } - LOG(ESOCKET, EInfo, "MOBINFO - GetNetworkAccessL"); + + + +} + +//// --------------------------------------------------------------------------- +//// Get bearer type of Access point ID +//// @return bearer type Acess point ID +//// --------------------------------------------------------------------------- + +HBufC* GetIapBearerTypeL(const TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType) +{ + + LOG(ESOCKET, EInfo, "MOBINFO + GetIapBearerTypeL()"); + RConnectionMonitor monitor; + TUint connectionCount(0); + TUint iapId(0); + TRequestStatus status(KErrNone); + HBufC* bearerType(NULL); + TUint connectionId(0); + TUint subConnectionCount(0); + TConnMonBearerInfo bearerInfo(EBearerInfoUnknown); + bool flag = false; + TUint connIdx = 1; + + User::LeaveIfError(monitor.ConnectL()); + CleanupClosePushL(monitor); + + status = KRequestPending; + monitor.GetConnectionCount(connectionCount, status); + User::WaitForRequest(status); + User::LeaveIfError(status.Int()); + LOG1(ESOCKET, EInfo, "MOBINFO: GetIapBearerTypeL: Count of active connections: %D", connectionCount); + + // Go through all connections + for (connIdx = 1; connIdx <= connectionCount; ++connIdx) + { + + connectionId = 0; + subConnectionCount = 0; + flag = false; + + // Get connection ID + monitor.GetConnectionInfo(connIdx, connectionId, subConnectionCount); + User::LeaveIfError(connectionId); + // Get connection IAP ID + status = KRequestPending; + monitor.GetUintAttribute(connectionId, 0, KIAPId, iapId, status); + User::WaitForRequest(status); + User::LeaveIfError(status.Int()); + LOG1(ESOCKET, EInfo, "MOBINFO: GetIapBearerTypeL Connection 's IAP ID found: %D", iapId); + if (aAppDefaultApType == 2) + { + LOG(ESOCKET, EInfo, "MOBINFO: Matching MIDlet defined SNAP to active IAP ID "); + // Midlet has a SNAP defined, so check if the active IAP is under this SNAP. + flag = ConnectionManager::isIapDefault(iapId, aAppDefaultApn,false); + if (!flag) + { + continue; // active access point doesn't belong to MIDlet SNAP, check the next active access point. + } + else + { + break; + } + } + else + { + // No SNAP defined for the MIDlet, check for system default SNAP/IAP. + if (isDeviceDefaultPresentL()) + { + LOG(ESOCKET, EInfo, "MOBINFO: Matching device default to active IAP ID "); + flag = ConnectionManager::isIapDefault(iapId, 0, true); + if (!flag) + { + continue; // active access point doesn't belong to MIDlet SNAP, check the next active access point. + } + else + { + break; + } + } + else + { + LOG(ESOCKET, EInfo, "MOBINFO: Returning the bearer type of first active IAP "); + flag = true; + break; // no MIDlet SNAP, no device default, select this access point and return the bearer type + + } + } + + } // end of for loop + + if (flag) + { + // we did not reach end of active connections, one of the conditions matched , find the bearer type + status = KRequestPending; + monitor.GetIntAttribute(connectionId, + 0, + KBearerInfo, + (TInt&)bearerInfo, + status); + User::WaitForRequest(status); + User::LeaveIfError(status.Int()); + + // Translate bearer type to type of network access + bearerType = TranslateBearerInfoToNetworkAccessL(bearerInfo); + } + CleanupStack::PopAndDestroy(&monitor); + if (bearerType == NULL) + { + // No active connection (or) active IAP didn't match the conditions + bearerType = KNetworkAccessNa().AllocL(); + } return bearerType; + + } //// --------------------------------------------------------------------------- @@ -1047,26 +1209,24 @@ // -------------------------------------------------------------------- // Get network access type of default access point set in MIDlet settings -// @param aAppDefaultApn MIDlet suite ID +// @param aAppDefaultApn MIDlet default IAP // @return network access type, ownership hand over -HBufC* GetDefIapBearerTypeL(TUint32 aAppDefaultApn) +HBufC* GetAppDefIapBearerTypeL(const TUint32 aAppDefaultApn) { - LOG(ESOCKET, EInfo, "MOBINFO + GetDefIapBearerTypeL"); - ELOG1(ESOCKET, "GetDefIapBearerTypeL %d", aAppDefaultApn); + LOG1(ESOCKET, EInfo, "MOBINFO + GetAppDefIapBearerTypeL aId = %d ", aAppDefaultApn); HBufC* bearerType(NULL); - // MAPNSettings* apnTable = GetAPNSettingsLC(KAPNSettingsVersion); - //TUint32 apn = apnTable->GetAPNIdL( aMidSuiteId ); - //CleanupStack::PopAndDestroy(); //apnTable - LOG1(ESOCKET, EInfo, "MIDlet specific IAP ID gotten: %D", aAppDefaultApn); + if (aAppDefaultApn == 0 || aAppDefaultApn == (TUint32)-1) { bearerType = KNetworkAccessNa().AllocL(); } else { + RCmManager localCmManager; localCmManager.OpenL(); - TUint32 tmpval = localCmManager.GetConnectionMethodInfoIntL(aAppDefaultApn,ECmBearerType); + TUint32 iap = aAppDefaultApn; + TUint32 tmpval = localCmManager.GetConnectionMethodInfoIntL(iap,ECmBearerType); ELOG1(ESOCKET, "GetConnectionMethodInfoIntL: %d", tmpval); switch (tmpval) { @@ -1084,11 +1244,8 @@ default : bearerType = KNetworkAccessNa().AllocL(); break; - - } - } - LOG(ESOCKET, EInfo, "MOBINFO - GetDefIapBearerTypeL"); + LOG(ESOCKET, EInfo, "MOBINFO - GetAppDefIapBearerTypeL"); return bearerType; } diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/pim/build/javapim_0x2002DCC5.mmp --- a/javaextensions/pim/build/javapim_0x2002DCC5.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/pim/build/javapim_0x2002DCC5.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javapim.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/satsa/build/javasatsa.pro --- a/javaextensions/satsa/build/javasatsa.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/satsa/build/javasatsa.pro Mon Aug 23 16:38:44 2010 +0100 @@ -11,7 +11,7 @@ # # Contributors: # -# Description: +# Description: # TARGET=javasatsa @@ -19,25 +19,36 @@ CONFIG += omj java stl CONFIG -= qt + + symbian { + + INCLUDEPATH += ../framework/inc \ ../pki/inc \ ../apdu/inc \ ../../inc \ ../../../inc \ - - + + contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) { + + INCLUDEPATH += /epoc32/include/mw/hb/hbcore \ + /epoc32/include/mw/QtCore \ + /epoc32/include/mw/QtGui \ + } + + 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 \ @@ -51,7 +62,7 @@ -laknnotify \ -leiksrv \ -lctframework \ - -lctsecdlgs \ + -lctsecdlgs \ -lcustomapi \ -lefsrv \ -letel \ @@ -61,9 +72,17 @@ -lhash \ -lWimClient \ -lestlib \ - -lcryptography \ - - + -lcryptography \ + + contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) { + + LIBS += -lHbCore\ + -lQtGui\ + -lQtCore\ + + } + + } include(../../../build/omj.pri) diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/satsa/build/javasatsa_0x2002DCCE.mmp --- a/javaextensions/satsa/build/javasatsa_0x2002DCCE.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/satsa/build/javasatsa_0x2002DCCE.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javasatsa.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../framework/inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/satsa/pki/src.s60/cstscredentialmanager.cpp --- a/javaextensions/satsa/pki/src.s60/cstscredentialmanager.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstscredentialmanager.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -36,7 +36,6 @@ #include - // CONSTANTS _LIT(KSTSSymbianKeyStoreLabel, "Software key store"); _LIT(KSTSSymbianCertificateStoreLabel, "Software certificate store"); @@ -67,10 +66,7 @@ { delete iEncodedCert; delete iIssuerAndSerialNumber; - if (iPKIDialog) - { - iPKIDialog->Release(); - } + delete iDistinguishedName; delete iDisplayName; delete iRequestEncoded; @@ -533,8 +529,7 @@ // void CSTSCredentialManager::ConstructL() { - iPKIDialog = PKIDialogFactory::CreateNoteL(); - + User::LeaveIfError(iFileServer.Connect()); iWait = new(ELeave) CActiveSchedulerWait; iStore = CUnifiedCertStore::NewL(iFileServer, ETrue); @@ -619,8 +614,7 @@ { // not found, ok to add iState = EAddDialog; - iPKIDialog->SaveCertificate(EX509Certificate, EUserCertificate, - iSubject, iStatus); + SetActive(); return; } @@ -720,7 +714,8 @@ CCTCertInfo* certInfo = (*iCertInfoArray)[ 0 ]; iState = ERemoveDialog; iHandle = certInfo->Handle(); - iPKIDialog->DeleteCertificate(iHandle, iStatus); + + SetActive(); } @@ -783,7 +778,7 @@ iState = ECSRDialog; iHandle = iKeyInfo->Handle(); - iPKIDialog->CreateCSR(*iDisplayName, iHandle, iStatus); + SetActive(); } diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/satsa/pki/src.s60/cstscredentialmanager.h --- a/javaextensions/satsa/pki/src.s60/cstscredentialmanager.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstscredentialmanager.h Mon Aug 23 16:38:44 2010 +0100 @@ -31,7 +31,7 @@ // FORWARD DECLARATIONS class CCTKeyInfo; -class MPKIDialog; + class CUnifiedCertStore; class CUnifiedKeyStore; class CX500DistinguishedName; @@ -349,8 +349,6 @@ // internal error variable TInt iError; - // PKI Dialog, owned - MPKIDialog* iPKIDialog; // The actual store, owned CUnifiedCertStore* iStore; diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/satsa/pki/src.s60/cstsseprompt.cpp --- a/javaextensions/satsa/pki/src.s60/cstsseprompt.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstsseprompt.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -18,11 +18,24 @@ // 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 =============================== @@ -43,8 +56,10 @@ // Destructor CSTSSEPrompt::~CSTSSEPrompt() { +#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS delete iGlobalNote; delete iSynchronizer; +#endif } // ----------------------------------------------------------------------------- @@ -54,11 +69,26 @@ // 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 } // ----------------------------------------------------------------------------- @@ -77,9 +107,11 @@ // ----------------------------------------------------------------------------- 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 5bec7efefe18 -r d1278d87b01e javaextensions/satsa/pki/src.s60/cstsseprompt.h --- a/javaextensions/satsa/pki/src.s60/cstsseprompt.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstsseprompt.h Mon Aug 23 16:38:44 2010 +0100 @@ -22,13 +22,13 @@ // INCLUDE #include - - +// FORWARD DECLARATIONS +#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS -// FORWARD DECLARATIONS +class CAOSynchronizer; class CAknGlobalNote; -class CAOSynchronizer; +#endif // CLASS DECLARATION /** @@ -71,11 +71,14 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/satsa/pki/src.s60/cstssignatureservice.cpp --- a/javaextensions/satsa/pki/src.s60/cstssignatureservice.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstssignatureservice.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -15,8 +15,6 @@ * */ - -// INCLUDE FILES #include "cstssignatureservice.h" #include "tstsdistinguishednameconverter.h" #include "secdlg.h" @@ -32,7 +30,11 @@ #include #include #include + +#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS #include +#endif + #include "cstsseprompt.h" #include @@ -42,7 +44,7 @@ #include "logger.h" #include "jstringutils.h" -// CONSTANTS + const TInt KDefaultGranularity = 1; const TInt KOptionIncludeContent = 1; @@ -80,10 +82,12 @@ { 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; @@ -126,14 +130,12 @@ 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) @@ -155,14 +157,9 @@ 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; } @@ -171,7 +168,6 @@ 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( @@ -189,20 +185,15 @@ 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; } @@ -216,15 +207,12 @@ 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; @@ -238,12 +226,10 @@ 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; } @@ -256,13 +242,12 @@ 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) { - LOG(ESATSA, EInfo, "CSTSSignatureService::StaticSignL: No memory"); + ELOG(ESATSA, "CSTSSignatureService::StaticSignL: No memory"); return NULL; } @@ -273,15 +258,12 @@ 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; } @@ -292,28 +274,25 @@ // 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 { - LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: Complete"); - Complete(KErrNone); + Complete(KErrNone); } } else if (iStatus != KErrNone) { - LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: Error occured"); + ELOG(ESATSA, "CSTSSignatureService::RunL: Error occured"); // Error has occured; inform java Complete(iStatus.Int()); } @@ -323,29 +302,23 @@ { 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) { @@ -360,12 +333,10 @@ 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; @@ -374,44 +345,35 @@ 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); } } @@ -425,7 +387,6 @@ // TInt CSTSSignatureService::RunError(TInt aError) { - LOG(ESATSA, EInfo, "+ CSTSSignatureService::RunError"); Complete(aError); return KErrNone; } @@ -524,8 +485,9 @@ { 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; @@ -542,7 +504,6 @@ // void CSTSSignatureService::Complete(TInt aError) { - LOG(ESATSA, EInfo, "+ CSTSSignatureService::Complete"); if (KErrNone == aError) { iState = EReady; @@ -553,7 +514,7 @@ iError = aError; } iWait->AsyncStop(); - LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::Complete"); + } // ----------------------------------------------------------------------------- @@ -563,17 +524,14 @@ // 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"); } // ----------------------------------------------------------------------------- @@ -584,7 +542,6 @@ HBufC8* CSTSSignatureService::CreateSignatureL(const CDesCArray& aCaNames, const TKeyUsageX509 aUsage, const TDesC& aSecurityElementPrompt) { - LOG(ESATSA, EInfo, "+ CSTSSignatureService::CreateSignatureL"); HBufC* sePrompt = NULL; if (aSecurityElementPrompt != KNullDesC()) { @@ -592,14 +549,10 @@ } 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; } // ----------------------------------------------------------------------------- @@ -611,7 +564,6 @@ const TKeyUsageX509 aUsage) { - LOG(ESATSA, EInfo, "+ CSTSSignatureService::FindCertificatesL"); iFilter->SetKeyUsage(aUsage); iFilter->SetOwnerType(EUserCertificate); iFilter->SetFormat(EX509Certificate); @@ -654,7 +606,7 @@ iState = EListing; iCertStore->List(iCertInfos, *iFilter, iDERNames, iStatus); } - LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::FindCertificatesL"); + } // ----------------------------------------------------------------------------- @@ -664,7 +616,6 @@ // void CSTSSignatureService::HandlesFromCertInfosL() { - LOG(ESATSA, EInfo, "+ CSTSSignatureService::HandlesFromCertInfosL"); TInt certificateCount = iCertInfos.Count(); if (certificateCount == 0) { @@ -675,7 +626,6 @@ iCertificateArray.Reset(); for (TInt i = 0; i < certificateCount; i++) { - LOG(ESATSA, EInfo, "+ CSTSSignatureService::HandlesFromCertInfosL: No Certificates"); User::LeaveIfError(iCertificateArray.Append(iCertInfos[i]->Handle())); } @@ -684,18 +634,18 @@ { case EAuthWithoutText: { - LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: case EAuthWithoutText"); +#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS iPKIDialog->UserAuthentication(iCertificateArray, iCertificateHandle, iStatus); - LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: over case EAuthWithoutText"); +#endif break; } case EAuthWithText: { - LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: case EAuthWithText"); +#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS iPKIDialog->UserAuthenticationText(*iTextToDisplay, iCertificateArray, iCertificateHandle, iStatus); - LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: over case EAuthWithText"); +#endif break; } case ESignWithText: @@ -721,7 +671,6 @@ // void CSTSSignatureService::FindKeyL() { - LOG(ESATSA, EInfo, "+ CSTSSignatureService::FindKeyL"); iKeyFilter.iKeyAlgorithm = CKeyInfoBase::EInvalidAlgorithm; iKeyFilter.iKeyId = iCertificate->SubjectKeyId(); @@ -740,7 +689,6 @@ // void CSTSSignatureService::OpenSignerL() { - LOG(ESATSA, EInfo, "+ CSTSSignatureService::OpenSignerL"); // if key is not found, display security element prompt and search again if (iKeys.Count() == 0) { @@ -803,8 +751,6 @@ // void CSTSSignatureService::SignL() { - LOG(ESATSA, EInfo, "+ CSTSSignatureService::SignL"); - // first we create a digest of the message CSHA1* sha = CSHA1::NewL(); @@ -892,7 +838,6 @@ // void CSTSSignatureService::CreateSignedDataL() { - LOG(ESATSA, EInfo, "+ CSTSSignatureService::CreateSignedDataL"); CCTKeyInfo* keyInfo = iKeys[0]; HBufC8* signature = NULL; @@ -987,14 +932,16 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/satsa/pki/src.s60/cstssignatureservice.h --- a/javaextensions/satsa/pki/src.s60/cstssignatureservice.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/satsa/pki/src.s60/cstssignatureservice.h Mon Aug 23 16:38:44 2010 +0100 @@ -19,19 +19,18 @@ #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; @@ -266,8 +265,10 @@ // 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 5bec7efefe18 -r d1278d87b01e javaextensions/sensor/build/javasensor_0x2002DCD0.mmp --- a/javaextensions/sensor/build/javasensor_0x2002DCD0.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/sensor/build/javasensor_0x2002DCD0.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javasensor.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/sensor/src.s60/cacceleratorsensor.cpp --- a/javaextensions/sensor/src.s60/cacceleratorsensor.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/sensor/src.s60/cacceleratorsensor.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -297,7 +297,6 @@ void CAcceleratorSensor::OpenChannelL() { - TInt err; JELOG2(ESensor); LOG(ESensor,EInfo,"Creating Open Channel"); iChannel->OpenChannelL(); @@ -306,9 +305,9 @@ iScaleFactor = 1; TInt format(ESensrvChannelDataFormatAbsolute); TSensrvProperty property; - TRAP(err,iChannel->GetPropertyL(KSensrvPropIdChannelDataFormat, KSensrvItemIndexNone, - property);); - LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() One = %d",err); + iChannel->GetPropertyL(KSensrvPropIdChannelDataFormat, KSensrvItemIndexNone, + property); + if (property.PropertyType() == ESensrvIntProperty) { @@ -328,19 +327,17 @@ // Scaled value maximum TSensrvProperty property_scaled; TInt maxScaled(0); - TRAP(err,iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone, - property_scaled);); - LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() Two = %d",err); + iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone, + property_scaled); + if (property_scaled.GetArrayIndex() == ESensrvArrayPropertyInfo) { LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::If"); //for 2G Accelerometer Sensor index value is 0. TInt rangeIndex(0); - TRAP(err,iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone, - rangeIndex, property_scaled);); - LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() Three = %d",err); - + iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone, + rangeIndex, property_scaled); property_scaled.GetMaxValue(maxScaled); LOG1(ESensor,EInfo,"property_scaled::maxValue = %d",maxScaled); @@ -353,36 +350,32 @@ } // MeasureRange can be an array property TReal maxMeasure; - TInt err1; + TSensrvProperty property_Measured; - TRAP(err1,iChannel->GetPropertyL(KSensrvPropIdMeasureRange, KSensrvItemIndexNone, - property_Measured);); - LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() Four = %d",err1); + iChannel->GetPropertyL(KSensrvPropIdMeasureRange, KSensrvItemIndexNone, + property_Measured); + + TInt arrayIndex = property_Measured.GetArrayIndex(); + LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::KSensrvPropIdMeasureRange::arrayIndex = %d",arrayIndex); - if (err1 == KErrNone) + if (property_Measured.GetArrayIndex() == ESensrvArrayPropertyInfo) { - 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"); + 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 - 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); - } + 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); + } + else + { + LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::else"); + property_Measured.GetMaxValue(maxMeasure); + } - } + iScaleFactor = maxMeasure / maxScaled ; LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::iScaleFactor = %f",iScaleFactor); } diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/sensor/src.s60/cacceleratorsensorrawdata.cpp --- a/javaextensions/sensor/src.s60/cacceleratorsensorrawdata.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/sensor/src.s60/cacceleratorsensorrawdata.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -97,6 +97,18 @@ TSensrvProperty property; TInt intValue(0); GetProperty(aList, KSensrvPropIdScaledRange,KSensrvItemIndexNone, property); + + if ((property.GetArrayIndex() == ESensrvArrayPropertyInfo)&& + (property.PropertyType() == ESensrvIntProperty)) + { + // Read index + TInt rangeIndex = 0; + + // Read actual property data from array + GetProperty(aList, KSensrvPropIdScaledRange, + KSensrvItemIndexNone, rangeIndex, property); + } + if (property.PropertyType() == ESensrvIntProperty) { aPtr->Append(KMeasureRangeCount); diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/sensor/src.s60/csensorbase.cpp --- a/javaextensions/sensor/src.s60/csensorbase.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/sensor/src.s60/csensorbase.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -139,7 +139,14 @@ void CSensorBase::AsyncCallback(TMethod aMethod) { JELOG2(ESensor); - iMethodArray.Append(aMethod); + 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; + } // If there is old request ongoing, wait it for completion if (iMethodArray.Count() > 1) diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/webservices/build/javawebservices_0x2002DCDB.mmp --- a/javaextensions/webservices/build/javawebservices_0x2002DCDB.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/webservices/build/javawebservices_0x2002DCDB.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javawebservices.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/wma/mms/build/javawmamms_0x2002DCDD.mmp --- a/javaextensions/wma/mms/build/javawmamms_0x2002DCDD.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/mms/build/javawmamms_0x2002DCDD.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javawmamms.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/wma/mms/pushplugin/build/eabi/javammsscpluginu.def --- a/javaextensions/wma/mms/pushplugin/build/eabi/javammsscpluginu.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/mms/pushplugin/build/eabi/javammsscpluginu.def Mon Aug 23 16:38:44 2010 +0100 @@ -24,4 +24,11 @@ _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 5bec7efefe18 -r d1278d87b01e javaextensions/wma/mms/pushplugin/build/javammsscplugin_0x2002DCC1.mmp --- a/javaextensions/wma/mms/pushplugin/build/javammsscplugin_0x2002DCC1.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/mms/pushplugin/build/javammsscplugin_0x2002DCC1.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javammsscplugin.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp --- a/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -55,7 +55,7 @@ return mmsConn; } -S60MmsServerConnection::~S60MmsServerConnection() +OS_EXPORT S60MmsServerConnection::~S60MmsServerConnection() { JELOG2(EWMA); delete mOpenMonitor; @@ -270,7 +270,7 @@ return mFilter; } -void S60MmsServerConnection::close() +OS_EXPORT void S60MmsServerConnection::close() { JELOG2(EWMA); // the close and RunL are synchronized to make it SMP safe. diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/wma/mms/src.s60/cjavammsmessagehandler.cpp --- a/javaextensions/wma/mms/src.s60/cjavammsmessagehandler.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/mms/src.s60/cjavammsmessagehandler.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -790,8 +790,6 @@ { // get cc length aHeaderLengths[KCcFieldIndex] = ReadIntL(aReadStream); - if (div == 0) - break; mmsMap = div; } break; diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/wma/sms_cbs/build/javawma_0x2002DCDC.mmp --- a/javaextensions/wma/sms_cbs/build/javawma_0x2002DCDC.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/sms_cbs/build/javawma_0x2002DCDC.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javawma.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/sms/SMSPermissionImpl.java --- a/javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/sms/SMSPermissionImpl.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/sms/SMSPermissionImpl.java Mon Aug 23 16:38:44 2010 +0100 @@ -84,8 +84,7 @@ formattedDestination = iDestination.substring(1); prefix = "+"; } - formattedDestination = Formatter.formatDigits(formattedDestination) - + prefix; + formattedDestination = prefix + Formatter.formatDigits(formattedDestination); if (iNumberOfSegments > 1) { return (SecurityPromptMessage.getInstance()).getText( diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/smscbs/utils/WmaUrl.java --- a/javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/smscbs/utils/WmaUrl.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/smscbs/utils/WmaUrl.java Mon Aug 23 16:38:44 2010 +0100 @@ -95,7 +95,7 @@ int index = iAbsoluteUri.indexOf("://"); int nameLength = iAbsoluteUri.length(); if ((index == -1) || (index != iAbsoluteUri.indexOf(':')) - || ((index + 3) > nameLength)) + || ((index + 3) >= nameLength)) { throw new IllegalArgumentException(INVALID_URL.concat(iAbsoluteUri)); } diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/wma/sms_cbs/pushplugin/cbs/build/eabi/javacbsscpluginu.def --- a/javaextensions/wma/sms_cbs/pushplugin/cbs/build/eabi/javacbsscpluginu.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/cbs/build/eabi/javacbsscpluginu.def Mon Aug 23 16:38:44 2010 +0100 @@ -24,4 +24,16 @@ _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 5bec7efefe18 -r d1278d87b01e javaextensions/wma/sms_cbs/pushplugin/cbs/build/javacbsscplugin_0x2002DCA4.mmp --- a/javaextensions/wma/sms_cbs/pushplugin/cbs/build/javacbsscplugin_0x2002DCA4.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/cbs/build/javacbsscplugin_0x2002DCA4.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javacbsscplugin.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/wma/sms_cbs/pushplugin/cbs/src.s60/cbsserverconnection.cpp --- a/javaextensions/wma/sms_cbs/pushplugin/cbs/src.s60/cbsserverconnection.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/cbs/src.s60/cbsserverconnection.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -58,7 +58,7 @@ return cbsConn; } -CbsServerConnection::~CbsServerConnection() +OS_EXPORT CbsServerConnection::~CbsServerConnection() { JELOG2(EWMA); removeDir(mMessageStoreDirName); @@ -128,7 +128,7 @@ } } -void CbsServerConnection::open(ConnectionListener* aListener, +OS_EXPORT void CbsServerConnection::open(ConnectionListener* aListener, bool aIsAppLaunched) { JELOG2(EWMA); @@ -282,7 +282,7 @@ } } -int CbsServerConnection::retrieveMessage(TJavaMessageParametersBuf& aCbsBuf) +OS_EXPORT int CbsServerConnection::retrieveMessage(TJavaMessageParametersBuf& aCbsBuf) { JELOG2(EWMA); TCBSParametersBuf cbsParametersBuf; @@ -328,7 +328,7 @@ } -void CbsServerConnection::close() +OS_EXPORT void CbsServerConnection::close() { JELOG2(EWMA); // the close and RunL are synchronized to make it SMP safe. @@ -524,7 +524,7 @@ } // Store the received page number, such that the message can // be reconstructed in the correct order later - mCbsMessagePagesRef.Append(currentPage); + mCbsMessagePagesRef.AppendL(currentPage); // Store the actual content of the message mCbsMessagePagesData->AppendL(messageData); diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/wma/sms_cbs/pushplugin/sms/build/eabi/javasmsscpluginu.def --- a/javaextensions/wma/sms_cbs/pushplugin/sms/build/eabi/javasmsscpluginu.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/sms/build/eabi/javasmsscpluginu.def Mon Aug 23 16:38:44 2010 +0100 @@ -10,23 +10,28 @@ _ZN26SmsServerConnectionFactoryD2Ev @ 9 NONAME _ZN4java3wma19SmsServerConnection15retrieveMessageER8TPckgBufI22TJavaMessageParametersE @ 10 NONAME _ZN4java3wma19SmsServerConnection4openEPNS_4push18ConnectionListenerE @ 11 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 ; ## + _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 + diff -r 5bec7efefe18 -r d1278d87b01e javaextensions/wma/sms_cbs/pushplugin/sms/build/javasmsscplugin_0x2002DCD3.mmp --- a/javaextensions/wma/sms_cbs/pushplugin/sms/build/javasmsscplugin_0x2002DCD3.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/sms/build/javasmsscplugin_0x2002DCD3.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javasmsscplugin.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp --- a/javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -72,7 +72,7 @@ delete mOpenMonitor; } -void SmsServerConnection::open(ConnectionListener* aListener, +OS_EXPORT void SmsServerConnection::open(ConnectionListener* aListener, bool aIsAppLaunched) { JELOG2(EWMA); @@ -211,6 +211,7 @@ mIoctlBuf() = KSockSelectRead; mSocket.Ioctl(KIOctlSelect, iStatus, &mIoctlBuf, KSOLSocket); SetActive(); + pthread_mutex_unlock(&mMutex); return; } switch (mState) @@ -276,6 +277,7 @@ pthread_cond_signal(&mCondVar); mIsRunning = EFalse; CActiveScheduler::Stop(); + break; } default: { @@ -299,7 +301,7 @@ } -void SmsServerConnection::close() +OS_EXPORT void SmsServerConnection::close() { JELOG2(EWMA); // the close and RunL are synchronized to make it SMP safe. diff -r 5bec7efefe18 -r d1278d87b01e javamanager/bld.inf --- a/javamanager/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -21,11 +21,12 @@ #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 "javarecognizer/build/bld.inf" #include "javasidchecker/build/bld.inf" -#include "javarecognizer/build/bld.inf" #include "javaappschemeplugin/build/bld.inf" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/debugapi/build/debugapi_0x2002DCAB.mmp --- a/javamanager/debugapi/build/debugapi_0x2002DCAB.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/debugapi/build/debugapi_0x2002DCAB.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : debugapi.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaappschemeplugin/build/javaappschemeplugin.mmp --- a/javamanager/javaappschemeplugin/build/javaappschemeplugin.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaappschemeplugin/build/javaappschemeplugin.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -26,6 +26,12 @@ // 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 @@ -37,9 +43,6 @@ USERINCLUDE ../inc -SYSTEMINCLUDE /epoc32/include/ecom -APP_LAYER_SYSTEMINCLUDE - LIBRARY euser.lib LIBRARY ecom.lib diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/javabackupcore/build/javabackup.mmp --- a/javamanager/javabackup/javabackupcore/build/javabackup.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javabackup/javabackupcore/build/javabackup.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -43,12 +43,14 @@ 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 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/javabackupcore/src.s60/jsbcdataowner.h --- a/javamanager/javabackup/javabackupcore/src.s60/jsbcdataowner.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javabackup/javabackupcore/src.s60/jsbcdataowner.h Mon Aug 23 16:38:44 2010 +0100 @@ -19,7 +19,7 @@ #ifndef JSBCDATAOWNER_H #define JSBCDATAOWNER_H -#include +#include namespace java { diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup/build/midp2backupplugin.mmp --- a/javamanager/javabackup/midp2backup/build/midp2backupplugin.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javabackup/midp2backup/build/midp2backupplugin.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -44,13 +44,12 @@ SOURCE apparcbackuputil.cpp SOURCE javastoragebackuputil.cpp 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 @@ -64,6 +63,7 @@ LIBRARY apparc.lib LIBRARY estlib.lib LIBRARY javaenvinfo.lib +LIBRARY javafileutils.lib #if defined(WINSCW) deffile ./bwins/backup.def diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.cpp --- a/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -19,6 +19,7 @@ #include "javastoragebackuputil.h" #include "midp2backupplugin.h" #include "midp2backupdataids.h" +#include "mediaidupdater.h" #include "javastorageentry.h" #include "javastorage.h" @@ -171,6 +172,10 @@ User::Leave(KErrGeneral); } + // ensure that storage contains correct removable media ids + MediaIdUpdater updater; + updater.update(); + // Storage restore is over; Set state to EAppArc aRestoreState = EAppArc; aBufferSpaceLeft = iBufferSpaceLeft; diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup/src.s60/mediaidupdater.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup/src.s60/mediaidupdater.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,263 @@ +/* +* 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: MediaIdUpdater +* +*/ + + +#include +#include + +#include "mediaidupdater.h" +#include "logger.h" +#include "javacommonutils.h" +#include "driveutilities.h" +#include "javastorageentry.h" +#include "javastorage.h" +#include "javastoragenames.h" + +using namespace java::backup; +using namespace java::storage; +using namespace java::util; + + +MediaIdUpdater::MediaIdUpdater() : mStorage(0) +{ +} + +MediaIdUpdater::~MediaIdUpdater() +{ + close(); +} + +/** +* Ensures that java storage does not contain media ids that are not valid any more. +* Media id updating is done in following steps: +* - get media ids from storage +* - get present (valid) media ids +* - get difference between storage and present ids (result is invalid ids that need to be updated) +* - update invalid media ids with valid ids +* @param - +* @return - +*/ +void MediaIdUpdater::update() +{ + try + { + open(); + std::set storageIds = getMediaIdsFromStorage(); + std::set presentIds = getPresentMediaIds(); + + std::set invalidIds = removePresentMediaIds(storageIds, presentIds); + std::set validIds = getPresentRemovableDriveMediaIds(); + + if (isMediaIdUpdateNeeded(invalidIds, validIds)) + { + updateMediaIds(invalidIds, validIds); + } + close(); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "MediaIdUpdater::update() failed: %S", jse.toString().c_str()); + } +} + +/** +* Gets present media ids. Result includes phone, internal and mass memory drive ids if any +* @param - +* @return present media ids +*/ +std::set MediaIdUpdater::getPresentMediaIds() +{ + std::set result; + + java::fileutils::driveInfos drives; + java::fileutils::DriveUtilities::getAccesibleDrives(drives); + + PLOG1(EBackup, "getPresentMediaIds(count=%d)", drives.size()); + for (java::fileutils::driveInfos::const_iterator iter = drives.begin(); iter != drives.end(); iter++) + { + PLOG2(EBackup, " %S - id=%d", (*iter).iRootPath.c_str(), (*iter).iId); + std::wstring mediaId = JavaCommonUtils::intToWstring((*iter).iId); + result.insert(mediaId); + } + + result.insert(L"0"); // default set by javainstaller for internal drives + return result; +} + +/** +* Gets present removable media ids. Result mass memory drive ids if any +* @param - +* @return present removable media ids +*/ +std::set MediaIdUpdater::getPresentRemovableDriveMediaIds() +{ + std::set result; + + java::fileutils::driveInfos drives; + java::fileutils::DriveUtilities::getAccesibleDrives(drives); + + PLOG1(EBackup, "getPresentRemovableDriveMediaIds(count=%d)", drives.size()); + for (java::fileutils::driveInfos::const_iterator iter = drives.begin(); iter != drives.end(); iter++) + { + if ((*iter).iIsRemovable) + { + PLOG2(EBackup, " %S - id=%d", (*iter).iRootPath.c_str(), (*iter).iId); + std::wstring mediaId = JavaCommonUtils::intToWstring((*iter).iId); + result.insert(mediaId); + } + } + + return result; +} + +/** +* Filters present media ids from given set. +* @param[in] aStorageIds original media ids +* @param[in] aPresentIds present media ids +* @return set of media ids that are invalid i.e. not present at the moment +*/ +std::set MediaIdUpdater::removePresentMediaIds(const std::set& aStorageIds, + const std::set& aPresentIds) +{ + std::set result; + + std::set_difference(aStorageIds.begin(), aStorageIds.end(), + aPresentIds.begin(), aPresentIds.end(), + std::inserter(result, result.end())); + + return result; +} + +/** +* Checks if there is a need for updating given media ids +* @param[in] aInvalidIds media ids to be updated +* @param[in] aValidIds valid ids used during update +* @return true, if media ids need to be updated, false otherwise +*/ +bool MediaIdUpdater::isMediaIdUpdateNeeded(const std::set& aInvalidIds, + const std::set& aValidIds) +{ + if(aInvalidIds.size() > 0 && aValidIds.size() > 0) + { + return true; + } + return false; +} + +/** +* Gets media ids that can be found from java storage. +* @param - +* @return media ids found from java storage +*/ +std::set MediaIdUpdater::getMediaIdsFromStorage() +{ + std::set result; + + JavaStorageEntry attribute; + attribute.setEntry(MEDIA_ID, L""); + + JavaStorageApplicationEntry_t findQuery; + findQuery.insert(attribute); + + JavaStorageApplicationList_t foundEntries; + + mStorage->search(APPLICATION_PACKAGE_TABLE, findQuery, foundEntries); + PLOG1(EBackup, "getMediaIdsFromStorage(count=%d)", foundEntries.size()); + for (JavaStorageApplicationList_t::const_iterator iter = foundEntries.begin(); iter != foundEntries.end(); iter++) + { + std::wstring id = (*iter).begin()->entryValue(); + PLOG1(EBackup, " id=%S", id.c_str()); + result.insert(id); + } + + return result; +} + +/** +* Updates given media ids with new values and saves the result in java storage. +* @param[in] aInvalidIds media ids to be updated +* @param[in] aValidIds valid ids used during update +* @return - +*/ +void MediaIdUpdater::updateMediaIds(const std::set& aInvalidIds, + const std::set& aValidIds) +{ + if (aValidIds.size() == 0) + { + return; + } + // use the first present media id for all + std::wstring newId = *(aValidIds.begin()); + + mStorage->startTransaction(); + + PLOG1(EBackup, "updateMediaIds(count=%d)", aInvalidIds.size()); + for (std::set::const_iterator iter = aInvalidIds.begin(); iter != aInvalidIds.end(); ++iter) + { + std::wstring origId = (*iter).c_str(); + PLOG2(EBackup, " origId=%S - newId=%S", origId.c_str(), newId.c_str()); + + JavaStorageEntry attribute; + attribute.setEntry(MEDIA_ID, newId); + + JavaStorageApplicationEntry_t updateEntry; + updateEntry.insert(attribute); + + JavaStorageApplicationEntry_t matchEntry; + attribute.setEntry(MEDIA_ID, origId); + matchEntry.insert(attribute); + + mStorage->update(APPLICATION_PACKAGE_TABLE, updateEntry, matchEntry); + } + + mStorage->commitTransaction(); +} + +/** +* Opens java storage connection +* @param - +* @return - +*/ +void MediaIdUpdater::open() +{ + close(); + mStorage = JavaStorage::createInstance(); + mStorage->open(JAVA_DATABASE_NAME); +} + +/** +* Closes java storage connection +* @param - +* @return - +*/ +void MediaIdUpdater::close() +{ + try + { + if (mStorage) + { + mStorage->close(); + delete mStorage; + mStorage = 0; + } + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "MediaIdUpdater::close() failed: %S", jse.toString().c_str()); + } +} + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup/src.s60/mediaidupdater.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup/src.s60/mediaidupdater.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MediaIdUpdater +* +*/ + + +#ifndef MEDIAIDUPDATER_H +#define MEDIAIDUPDATER_H + +#include +#include + +namespace java +{ +namespace storage +{ + class JavaStorage; +} +namespace backup +{ + +/** +* MediaIdUpdater is responsible for ensuring that java storage contains +* valid media ids after restore. +* Media id may change in following situations: +* - memory card is formatted between backup and restore +* - another memory card is used during restore than originally +*/ + +class MediaIdUpdater +{ +public: + MediaIdUpdater(); + virtual ~MediaIdUpdater(); + + /** + * Updates media ids to valid values if needed + * Note: this method must be called after java storage is restored + */ + virtual void update(); + +protected: + virtual std::set getPresentMediaIds(); + virtual std::set getPresentRemovableDriveMediaIds(); + virtual std::set removePresentMediaIds(const std::set& aStorageIds, + const std::set& aPresentIds); + virtual bool isMediaIdUpdateNeeded(const std::set& aInvalidIds, + const std::set& aValidIds); + virtual std::set getMediaIdsFromStorage(); + virtual void updateMediaIds(const std::set& aInvalidIds, + const std::set& aValidIds); + + virtual void open(); + virtual void close(); + + java::storage::JavaStorage* mStorage; +}; + +} // namespace backup +} // namespace java + +#endif // MEDIAIDUPDATER_H diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup/src.s60/midp2backupplugin.cpp --- a/javamanager/javabackup/midp2backup/src.s60/midp2backupplugin.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javabackup/midp2backup/src.s60/midp2backupplugin.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -29,7 +29,7 @@ #include "javacommonutils.h" #include "logger.h" -#include +#include #include #include #include @@ -474,14 +474,14 @@ CleanupStack::PushL(fileMan); // Copy to new place - iFs.MkDir(path_new); + TInt err = iFs.MkDir(path_new); + ILOG2(EBackup, "MkDir, status: %d, path=%S", err, path_new.PtrZ()); + path_old.Append(KStarWildCard); - TInt err = fileMan->Copy(path_old, path_new); + err = fileMan->Copy(path_old, path_new); ILOG1(EBackup, "File copy, status: %d", err); - User::LeaveIfError(err); - CleanupStack::PopAndDestroy(); } } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/build/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,20 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/build/bwins/backupu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/build/bwins/backupu.def Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,2 @@ +EXPORTS + ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &) diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/build/eabi/backupu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/build/eabi/backupu.def Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,9 @@ +EXPORTS + _Z24ImplementationGroupProxyRi @ 1 NONAME + _ZTIN4java6backup17CAppArcBackupUtilE @ 2 NONAME + _ZTIN4java6backup18CMidp2BackupPluginE @ 3 NONAME + _ZTIN4java6backup18CStorageBackupUtilE @ 4 NONAME + _ZTVN4java6backup17CAppArcBackupUtilE @ 5 NONAME + _ZTVN4java6backup18CMidp2BackupPluginE @ 6 NONAME + _ZTVN4java6backup18CStorageBackupUtilE @ 7 NONAME + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/build/midp2backupplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/build/midp2backupplugin.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,81 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/data/10282474.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/data/10282474.rss Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,49 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/apparcbackuputil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/apparcbackuputil.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,550 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/apparcbackuputil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/apparcbackuputil.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,186 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/javaapparcutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javaapparcutil.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,59 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/javaapparcutil.inl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javaapparcutil.inl Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,29 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,1014 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,266 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for CScrBackupUtil class +* +*/ + +#ifndef JAVASCRBACKUPUTIL_H_ +#define JAVASCRBACKUPUTIL_H_ + + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include //for TAppCaption +#include + +#include +#include + +namespace java + { +namespace backup + { + +class CScrBackupUtil : public CBase + { +public: + static CScrBackupUtil* NewL(); + + ~CScrBackupUtil(); + + static CScrBackupUtil* NewLC(); + + /* + * filling the data with the SCR value one by one + */ + void BackupScrDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft); + + void GetComponentInfoL(Usif::TComponentId aComponentId,RDesWriteStream& aStream); + void WriteToActualStream(RDesWriteStream& aStream); + + void RestoreScrDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft); + void SetDataInScrL(TUid aUid ,RDesReadStream& aStream); + +private: //fun + void ConstructL(); + void ConnectScrL(); + void writeRemainingData(); + void RegisterApplicationL(TInt aComponentId, TUid aAppUid, + Usif::TAppCaption aAppName, TDesC aIconFilename, TInt aNumberOfIcons, + TLanguage aLanguages); + + template + TInt ComputeSizeL(const T &aObject); + void ExtractUidAndComponentIdL(RArray& componentIds,RArray& uids,TInt& ComponentsCount); + Usif::TComponentId RegisterComponentL(Usif::CComponentEntry& aEntry ,TUid aUid,TPtr aMidletInfoUrl, TPtr aMidletDescription, TPtr8 aMidletDeletionConformation,TPtr aDownloadUrl,TInt64 aMediaId,TPtr aDomainCatogary , TPtr aSettingValue,RPointerArray& aComponentFilesArray, TBool aIsComponentPresent,RPointerArray& aLocalizableComponentInfoArray); + CScrBackupUtil(); +private://members + + enum TState + { + EIsFetchCompleteInfo, + EIsWriteCompleteInfo + }; + TState iState; + HBufC8* iRemainingInfo; + // to check if the previous attribte claims that he cant + //write in stream because of space so all other attribute + //down the lane should be in the remaining info buffer to maintain the sequence + TBool iIsToWriteInStream; + TBool iBufferToWriteNextTime; + TBool iWriteToStream; + TInt i ; + TInt iLengthOfString; + Usif::RSoftwareComponentRegistry* iScr; + RArray iComponentIds; + RArray iUids; + RArray iPresentUids; + + TInt iNumberOfComponents; + TInt iBufferSpaceLeft; + + TInt iRemainingBuffer; + TPtr8 iPtrToWriteBuffer; + + TBool iIsFristCall; + + }; + +// Helper class pass the info of midlet with in midletSuite +class CAppInfo : public CBase + { +public: + static CAppInfo* NewL(); + + ~CAppInfo(); + + static CAppInfo* NewLC(); + void ConstructL(); + void Set(TLanguage language,TUid appUid,Usif::TAppCaption caption,TDesC& appIcon,TInt aNoOfIcons); + TLanguage GetLanguage(); + TUid GetAppUid(); + Usif::TAppCaption GetCaption(); + HBufC* GetAppIcon(); + TInt NoOfIcons(); +protected: + + CAppInfo(); + + +private: + TLanguage iLanguage; + TUid iAppUid; + Usif::TAppCaption iCaption; + HBufC* iAppIcon; + TInt iNoOfIcons; + }; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +class CJavaBackupEntries : public CBase + { +public: + ~CJavaBackupEntries(); + static CJavaBackupEntries* NewL(Usif::TComponentId aId); + + static CJavaBackupEntries* NewLC(Usif::TComponentId aId); + + + //used to get the below info + /* + * will get all the entries in this API + * called when restoring + */ + void GetEntries(); + + /* + * to set all the entries + * + */ + void SetEntries(); +private : + + void ConstructL(Usif::TComponentId aId); + +private: + //check if this duplication can be removed as the same variable is in ccomponentEntry + Usif::TComponentId iComponentId; ///< The unique id of the software component. + //HBufC* iName; ///< Name of the software component. + //HBufC* iVendor; ///< Vendor of the software component. + //HBufC* iSwType; ///< Software type name of the component. + //HBufC* iGlobalId; ///< Globally unique component identifier. + //TBool iRemovable; ///< Whether the component is removable. + //TInt64 iSize; ///< The total size of the component at installation time in bytes. + //TScomoState iScomoState; ///< SCOMO state of the component. + //TDriveList iInstalledDrives; ///< The set of drives that files for the software component were installed to. + //HBufC* iVersion; ///< Version identifier of the software component + //HBufC* iInstallTime; ///< The install time of the component. + //TBool iDrmProtected; ///< Whether the component is DRM protected. + //TBool iHidden; ///< Whether the component is hidden in the list of installed components. + //TBool iKnownRevoked; ///< Whether the component has been revoked. + //TBool iOriginVerified; ///< Whether the installer has verified the originator of the component. + + + // TODO Can we keep a pointer here + Usif::CComponentEntry iEntries; + TBool iIsComponentPresent; + // component property + TInt iMidletSuitId; + HBufC *iMidletInfoUrl; + HBufC *iMidletDescription; + TBool iMidletDeletetionConfirmation; // Didnt got any thing for it + HBufC *iMidletDownloadUrl; + HBufC *iDomainCatagory;// didnt got any thing for it + TInt iMediaId; + //addtion to CcomponentEntry Class + RPointerArray &iCompLocalizedInfoArray; + + + Usif::RSoftwareComponentRegistry *iScr; + + + + }; + } + + } + + + +#endif /* JAVASCRBACKUPUTIL_H_ */ diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,2084 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of CStorageBackupUtil +* +*/ + + +#include "javastoragebackuputil.h" +#include "midp2backupplugin.h" +#include "midp2backupdataids.h" + +#include "javastorageentry.h" +#include "javastorage.h" +#include "javastoragenames.h" + +#include "logger.h" +#include "javauid.h" +#include "javaoslayer.h" +#include "javacommonutils.h" +#include "s60commonutils.h" +#include "javasymbianoslayer.h" + +#include +#include + +using namespace std; +using namespace java::storage; +using namespace java::backup; + +// ======== MEMBER FUNCTIONS ======== + +CStorageBackupUtil::CStorageBackupUtil() +{ + LOG(EBackup, EInfo, "CStorageBackupUtil constructor"); +} + +void CStorageBackupUtil::ConstructL() +{ + LOG(EBackup, EInfo, "CStorageBackupUtil::ConstructL"); + + iFirstCalltoBackupStorageData = ETrue; + iFirstCalltoRestoreStorageData = ETrue; + + iBufferSpaceLeft = 0; + + iRemainingString = EFalse; + iStrCount = 0; + + for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; tableNumber++) + { + iTableSize[tableNumber] = 0; + } +} + +CStorageBackupUtil* CStorageBackupUtil::NewL() +{ + LOG(EBackup, EInfo, "CStorageBackupUtil::NewL"); + + CStorageBackupUtil* self = new(ELeave) CStorageBackupUtil(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +CStorageBackupUtil::~CStorageBackupUtil() +{ + LOG(EBackup, EInfo, "CStorageBackupUtil Destructor"); + + // clear the vectors to free all the heap data. + iStringVector.clear(); +} + + +void CStorageBackupUtil::BackupStorageDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CStorageBackupUtil::BackupStorageDataL"); + + iBufferSpaceLeft = aBufferSpaceLeft; + + if (iFirstCalltoBackupStorageData) + { + int err = FillVectorWithStorageData(); + + if (err != KErrNone) + { + User::Leave(err); + } + LOG1(EBackup, EInfo, "Total no of rows in vector: %d", iStringVector.size()); + + // First write the total no of rows in the vector to the stream + + aStream.WriteInt32L(iStringVector.size()); + iBufferSpaceLeft -= sizeof(TInt32); + + /* Then write the number of rows in each table to the stream. + This will be used while writing the data to storage. */ + + for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; tableNumber++) + { + aStream.WriteInt16L(iTableSize[tableNumber]); + iBufferSpaceLeft -= sizeof(TInt16); + } + + iFirstCalltoBackupStorageData = EFalse; + } + + // Now write the actual string data into the stream. + + while (iBufferSpaceLeft > 0 && iStrCount < iStringVector.size()) + { + WriteStringtoStreamL(aStream, iStringVector[iStrCount]); + LOG1(EBackup, EInfo, "StrCount = %d", iStrCount); + } + + if (iStrCount >= iStringVector.size()) + { + LOG(EBackup, EInfo, "Backup of storage data finished"); + aBackupNotFinished = EFalse; + } +} + +void CStorageBackupUtil::RestoreStorageDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CStorageBackupUtil::RestoreStorageDataL()"); + + iBufferSpaceLeft = aBufferSpaceLeft; + + if (iFirstCalltoRestoreStorageData) + { + // the no of strings in the stream + iStrCount = aStream.ReadInt32L(); + iBufferSpaceLeft -= sizeof(TInt32); + + // read the number of rows in each table + for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; tableNumber++) + { + iTableSize[tableNumber] = aStream.ReadInt16L(); + iBufferSpaceLeft -= sizeof(TInt16); + } + iFirstCalltoRestoreStorageData = EFalse; + } + + while (iBufferSpaceLeft > 0 && iStrCount > 0) + { + ReadStringfromStreamL(aStream); + } + + if (iStrCount == 0) + { + LOG1(EBackup, EInfo, "Finished reading from stream, row count = %d", iStringVector.size()); + + + int err = WriteDataToStorage(); + + if (err != KErrNone) + { + CleanupStack::PopAndDestroy(&aStream); + User::Leave(KErrGeneral); + } + + // Storage restore is over; Change the state +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + aRestoreState = EScr; +#else + aRestoreState = EAppArc; +#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + + aBufferSpaceLeft = iBufferSpaceLeft; + } +} + + +void CStorageBackupUtil::WriteStringtoStreamL(RDesWriteStream& aStream, wstring aStr) +{ + iLenOfString = aStr.length(); + + // if length of string is 0, do not write any string to the stream. + if (iLenOfString == 0) + { + aStream.WriteInt16L(iLenOfString*2); + iBufferSpaceLeft -= sizeof(TInt16); + iStrCount++; + } + + else + { + /* if space is not enough for writing the complete string, + do not write it. Could be written next time. */ + if (((iLenOfString*2) + sizeof(TInt16)) > iBufferSpaceLeft) + { + LOG(EBackup, EInfo, "Stream size is not enough to hold the string"); + // set the bufferspaceleft to zero + iBufferSpaceLeft = 0; + } + // stream has enough space for the length and the string data. + else + { + aStream.WriteInt16L(iLenOfString*2); + iBufferSpaceLeft -= sizeof(TInt16); + + HBufC* tempstr = java::util::S60CommonUtils::wstringToDes(aStr.c_str()); + TPtrC tempStr = tempstr->Des(); + aStream.WriteL(tempStr); + iBufferSpaceLeft -= (iLenOfString*2); + delete tempstr; + + iStrCount++; + } + } +} + +void CStorageBackupUtil::ReadStringfromStreamL(RDesReadStream& aStream) +{ + wstring emptyString; + + /* if only part of the string was read last time, + read the remaining and append it to that string. */ + if (iRemainingString) + { + // if the whole string cannot be read, read part of it and store it. + if (iLenOfString > iBufferSpaceLeft) + { + LOG(EBackup, EInfo, "Cant read the full string; read only part of it"); + + HBufC* data = HBufC::NewL(iBufferSpaceLeft/2+1); + TPtr pdata = data->Des(); + + aStream.ReadL(pdata, iBufferSpaceLeft/2); + iLenOfString -= iBufferSpaceLeft; + iBufferSpaceLeft = 0; + + wchar_t* str = desToWstring(pdata); + wstring stringData(str); + iHalfReadString += stringData; + + delete data; + iRemainingString = ETrue; + } + // else read the complete string + else + { + HBufC* data = HBufC::NewL(iLenOfString/2+1); + TPtr pdata = data->Des(); + + aStream.ReadL(pdata, iLenOfString/2); + iBufferSpaceLeft -= (iLenOfString); + + wchar_t* str = desToWstring(pdata); + wstring stringData(str); + iHalfReadString += stringData; + + iStringVector.push_back(iHalfReadString); + + delete data; + iStrCount--; + iRemainingString = EFalse; + iHalfReadString = emptyString; + } + } + + else + { + iLenOfString = aStream.ReadInt16L(); + iBufferSpaceLeft -= sizeof(TInt16); + + if (iLenOfString > 0) + { + // if full string cannot be read, read only part of it. + if (iLenOfString > iBufferSpaceLeft) + { + /* if the stream does not have even part of the string, + just set the iRemainingFlag to ETrue so that the + string can be read next time. */ + + if (iBufferSpaceLeft == 0) + { + iRemainingString = ETrue; + iHalfReadString = emptyString; + } + // else stream contains part of the stream. Read it + else + { + LOG(EBackup, EInfo, "Cant read the full string; read only part of it"); + + HBufC* data = HBufC::NewL(iBufferSpaceLeft/2+1); + TPtr pdata = data->Des(); + + aStream.ReadL(pdata, iBufferSpaceLeft/2); + iLenOfString -= iBufferSpaceLeft; + iBufferSpaceLeft = 0; + + wchar_t* str = desToWstring(pdata); + wstring stringData(str); + iHalfReadString = stringData; + delete data; + iRemainingString = ETrue; + } + } + // else full string can be read + else + { + HBufC* data = HBufC::NewL(iLenOfString/2+1); + TPtr pdata = data->Des(); + + aStream.ReadL(pdata, iLenOfString/2); + iBufferSpaceLeft -= (iLenOfString); + + wchar_t* str = desToWstring(pdata); + wstring stringData(str); + + iStringVector.push_back(stringData); + iStrCount--; + delete data; + } + } + /* if length of string is 0, do not read anything from the stream; + just push an empty string into the vector */ + else + { + iStringVector.push_back(emptyString); + iStrCount--; + } + } +} + + +int CStorageBackupUtil::FillVectorWithStorageData() +{ + // get data from storage + + LOG(EBackup, EInfo, "CStorageBackupUtil::FillVectorsWithData"); + + auto_ptr js(JavaStorage::createInstance()); + LOG(EBackup, EInfo, "Opening connection to JAVA_DATABASE"); + + try + { + js->open(JAVA_DATABASE_NAME); + LOG(EBackup, EInfo, "Opening commection succeeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Opening JAVA_DATABASE failed; %S", jse.toString().c_str()); + return KErrGeneral; + } + + JavaStorageEntry attribute; + JavaStorageApplicationEntry_t findPattern; + JavaStorageApplicationList_t foundEntries; + + + // table 1 : Application package table + { + LOG(EBackup, EInfo, "Read entries from APPLICATION_PACKAGE_TABLE"); + + try + { + js->search(APPLICATION_PACKAGE_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[0] = FillVectorwithAppPackageTableData(foundEntries); + foundEntries.clear(); + + if (iTableSize[0] == 0) + { + LOG(EBackup, EInfo, "No data in Storage; So no midlets in system;"); + return KErrGeneral; + } + } + + + // table 2: Application table + { + LOG(EBackup, EInfo, "Read entries from APPLICATION_TABLE"); + + try + { + js->search(APPLICATION_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[1] = FillVectorwithAppTableData(foundEntries); + + foundEntries.clear(); + } + + // table 3: Application package attributes table + + /* for this table, since there are very large number of rows, + read the data from the table suite-by-suite + ie. read entries for the first suite, then read entries for the + second suite. This would prevent stack overflow */ + { + LOG(EBackup, EInfo, "Read entries from APPLICATION_PACKAGE_ATTRIBUTES_TABLE"); + + int rowCount = 0; + + for (int suiteNumber = 0; suiteNumber < iTableSize[0]; suiteNumber++) + { + attribute.setEntry(ID, iStringVector[suiteNumber*14]); + findPattern.insert(attribute); + + try + { + js->search(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + rowCount += FillVectorwithAppPackageAttTableData(foundEntries); + + foundEntries.clear(); + findPattern.clear(); + } + iTableSize[2] = rowCount; + } + + // table 4: Midp package table + { + LOG(EBackup, EInfo, "Read entries from MIDP_PACKAGE_TABLE"); + + try + { + js->search(MIDP_PACKAGE_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[3] = FillVectorwithMidpPackageTableData(foundEntries); + + foundEntries.clear(); + } + + // table 5: Midp permissions table + + /* for this table, since there are very large number of rows, + read the data from the table suite-by-suite + ie. read entries for the first suite, then read entries for the + second suite. This would prevent stack overflow */ + { + LOG(EBackup, EInfo, "Read entries from MIDP_PERMISSIONS_TABLE"); + + int rowCount = 0; + + for (int suiteNumber = 0; suiteNumber < iTableSize[0]; suiteNumber++) + { + attribute.setEntry(ID, iStringVector[suiteNumber*14]); + findPattern.insert(attribute); + + try + { + js->search(MIDP_PERMISSIONS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + rowCount += FillVectorwithMidpPermTableData(foundEntries); + + foundEntries.clear(); + findPattern.clear(); + } + iTableSize[4] = rowCount; + } + + // table 6: Midp function group settings table + { + LOG(EBackup, EInfo, "Read entries from MIDP_FUNC_GRP_SETTINGS_TABLE"); + + try + { + js->search(MIDP_FUNC_GRP_SETTINGS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[5] = FillVectorwithMidpFuncGrpSetTableData(foundEntries); + + foundEntries.clear(); + } + + // table 7: push registration table + { + LOG(EBackup, EInfo, "Read entries from PUSH_REGISTRATIONS_TABLE"); + + try + { + js->search(PUSH_REGISTRATIONS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[6] = FillVectorwithPushRegTableData(foundEntries); + + foundEntries.clear(); + } + + // table 8: alarm registration table + { + LOG(EBackup, EInfo, "Read entries from ALARM_REGISTRATIONS_TABLE"); + + try + { + js->search(ALARM_REGISTRATIONS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[7] = FillVectorwithAlarmRegTableData(foundEntries); + + foundEntries.clear(); + } + + // table 9: runtime settings table + { + LOG(EBackup, EInfo, "Read entries from RUNTIME_SETTINGS_TABLE"); + + try + { + js->search(RUNTIME_SETTINGS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[8] = FillVectorwithRuntimeSetTableData(foundEntries); + + foundEntries.clear(); + } + + // table 10: pre-install table + { + LOG(EBackup, EInfo, "Read entries from PREINSTALL_TABLE"); + + try + { + js->search(PREINSTALL_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + iTableSize[9] = FillVectorwithPreinstallTableData(foundEntries); + + foundEntries.clear(); + } + + // Data read from JAVA_DATABASE; So close the connection + js->close(); + + // table 11: ota status table + /* Stored in another database called javaotadatabase. + so open a new connection to that database. */ + { + LOG(EBackup, EInfo, "Read entries from OTA_STATUS_TABLE"); + + auto_ptr jos(JavaStorage::createInstance()); + + try + { + jos->open(JAVA_OTA_DATABASE_NAME); + ILOG(EBackup, "Opening connection to OTA database succeeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Opening OTA database failed: %s", jse.toString().c_str()); + return KErrGeneral; + } + + try + { + jos->search(OTA_STATUS_TABLE, findPattern, foundEntries); + LOG(EBackup, EInfo, "Search in Java Storage succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Search in Java Storage failed; %s", jse.toString().c_str()); + jos->close(); + return KErrGeneral; + } + + iTableSize[10] = FillVectorwithOtaStatusTableData(foundEntries); + + foundEntries.clear(); + jos->close(); + } + + //################ printing the vectors ############# + //printVector(); + //################################################### + + ILOG(EBackup, "Vector filled with data"); + return KErrNone; +} + + +int CStorageBackupUtil::WriteDataToStorage() +{ + JELOG2(EBackup); + ILOG(EBackup, "Create instance of JAVA_DATABASE_NAME and open the database"); + + auto_ptr js(JavaStorage::createInstance()); + + try + { + js->open(JAVA_DATABASE_NAME); + ILOG(EBackup, "Opening database succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Opening database failed: %S", jse.toString().c_str()); + return KErrGeneral; + } + + try + { + js->startTransaction(); + ILOG(EBackup, "Transaction started"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "startTransaction() failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + ILOG(EBackup, "Before writing data to storage, existing data must be cleared"); + + // call delete * from table one-by-one + { + JavaStorageApplicationEntry_t emptyEntry; + + try + { + js->remove(APPLICATION_PACKAGE_TABLE, emptyEntry); + js->remove(APPLICATION_TABLE, emptyEntry); + js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, emptyEntry); + js->remove(MIDP_PACKAGE_TABLE, emptyEntry); + js->remove(MIDP_PERMISSIONS_TABLE, emptyEntry); + js->remove(MIDP_FUNC_GRP_SETTINGS_TABLE, emptyEntry); + js->remove(PUSH_REGISTRATIONS_TABLE, emptyEntry); + js->remove(ALARM_REGISTRATIONS_TABLE, emptyEntry); + js->remove(RUNTIME_SETTINGS_TABLE, emptyEntry); + js->remove(PREINSTALL_TABLE, emptyEntry); + + ILOG(EBackup, "Data removed successfully from table"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Failed during removal of entries from table: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + } + + JavaStorageEntry attribute; + JavaStorageApplicationEntry_t insertEntry; + + ILOG(EBackup, "Start transaction for writing into the database"); + + int count = 0; + // table 1 : Application package table + { + LOG(EBackup, EInfo, "Writing to APPLICATION_PACKAGE_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[0]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(PACKAGE_NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VENDOR, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VERSION, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ROOT_PATH, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(MEDIA_ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(INITIAL_SIZE, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(JAD_PATH, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(JAR_PATH, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(JAD_URL, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(JAR_URL, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ACCESS_POINT, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CONTENT_INFO, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CONTENT_ID, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(APPLICATION_PACKAGE_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 2: Application table + { + LOG(EBackup, EInfo, "Writing to APPLICATION_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[1]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(PACKAGE_ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(MAIN_CLASS, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(AUTORUN, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(APPLICATION_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 3: Application package attributes table + { + LOG(EBackup, EInfo, "Writing to APPLICATION_PACKAGE_ATTRIBUTES_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[2]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VALUE, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(TRUSTED, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 4: Midp package table + { + LOG(EBackup, EInfo, "Writing to MIDP_PACKAGE_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[3]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(TYPE, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(SECURITY_DOMAIN, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(SECURITY_DOMAIN_CATEGORY, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(HASH, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CERT_HASH, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(RMS, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VALID_CERTS, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ON_SCREEN_KEYPAD, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(SECURITY_WARNINGS, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(MIDP_PACKAGE_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 5: Midp permissions table + { + LOG(EBackup, EInfo, "Writing to MIDP_PERMISSIONS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[4]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CLASS, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ACTION, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(FUNCTION_GROUP, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(MIDP_PERMISSIONS_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 6: Midp function group settings table + { + LOG(EBackup, EInfo, "MIDP_FUNC_GRP_SETTINGS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[5]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(FUNCTION_GROUP, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ALLOWED_SETTINGS, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CURRENT_SETTING, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(BLANKET_PROMPT, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(MIDP_FUNC_GRP_SETTINGS_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 7: push registration table + { + LOG(EBackup, EInfo, "Writing to PUSH_REGISTRATIONS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[6]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(URL, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(FILTER, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(REGISTRATION_TYPE, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(PUSH_REGISTRATIONS_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 8: alarm registration table + { + LOG(EBackup, EInfo, "Writing to ALARM_REGISTRATIONS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[7]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(ALARM_TIME, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(ALARM_REGISTRATIONS_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + + // table 9: runtime settings table + { + LOG(EBackup, EInfo, "Writing to RUNTIME_SETTINGS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[8]; rowNumber++) + { + attribute.setEntry(EXTENSIONS, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(RUNTIME_SETTINGS_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + // table 10: pre-install table + { + LOG(EBackup, EInfo, "Writing to PREINSTALL_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[9]; rowNumber++) + { + attribute.setEntry(NAME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VENDOR, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(VERSION, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(INSTALL_STATE, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + js->write(PREINSTALL_TABLE, insertEntry); + ILOG(EBackup, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + } + + ILOG(EBackup, "Data written to JAVA_DATABASE; So Commit the transaction and close the database"); + ILOG(EBackup, "Committing the transaction"); + + try + { + js->commitTransaction(); + ILOG(EBackup, "Transaction committed successfully"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Committing the transaction failed: %S", jse.toString().c_str()); + js->close(); + return KErrGeneral; + } + + ILOG(EBackup, "Close the database"); + + // close the JAVA_DATABASE + js->close(); + + + // table 11: ota status table + /* stored in another database called javaotadatabase. + so open a new connection to that database */ + + { + ILOG(EBackup, "Create instance of JAVA_OTA_DATABASE_NAME and open the database"); + auto_ptr jos(JavaStorage::createInstance()); + + try + { + jos->open(JAVA_OTA_DATABASE_NAME); + ILOG(EBackup, "Opening database succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Opening database failed: %S", jse.toString().c_str()); + return KErrGeneral; + } + + ILOG(EBackup, "Start a transaction for writing to this database"); + + try + { + jos->startTransaction(); + ILOG(EBackup, "Transaction started"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "startTransaction() failed: %S", jse.toString().c_str()); + jos->close(); + return KErrGeneral; + } + + ILOG(EBackup, "Before writing data to this database, existing data must be cleared"); + + try + { + JavaStorageApplicationEntry_t emptyEntry; + jos->remove(OTA_STATUS_TABLE, emptyEntry); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Removing data from OTA database failed: %S", jse.toString().c_str()); + jos->close(); + return KErrGeneral; + } + + LOG(EBackup, EInfo, "Writing to OTA_STATUS_TABLE"); + + for (int rowNumber = 0; rowNumber < iTableSize[10]; rowNumber++) + { + attribute.setEntry(ID, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(CREATION_TIME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(TYPE, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(OTA_CODE, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(URL, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(LATEST_RETRY_TIME, iStringVector[count++]); + insertEntry.insert(attribute); + + attribute.setEntry(RETRY_COUNT, iStringVector[count++]); + insertEntry.insert(attribute); + + try + { + jos->write(OTA_STATUS_TABLE, insertEntry); + LOG(EBackup, EInfo, "Writing to table succeded"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str()); + jos->close(); + return KErrGeneral; + } + insertEntry.clear(); + } + + ILOG(EBackup, "Data written to JAVA_OTA_DATABASE; commit the transaction and close the database"); + ILOG(EBackup, "Committing the transaction"); + + try + { + jos->commitTransaction(); + LOG(EBackup, EInfo, "Transaction committed successfully"); + } + catch (JavaStorageException jse) + { + ELOG1(EBackup, "Committing the transaction failed: %S", jse.toString().c_str()); + jos->close(); + return KErrGeneral; + } + + LOG(EBackup, EInfo, "Close the database"); + + // close the OTA_DATABASE + jos->close(); + } + + LOG(EBackup, EInfo, "Data written to Storage"); + return KErrNone; +} + + +int CStorageBackupUtil::FillVectorwithAppPackageTableData(JavaStorageApplicationList_t& foundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = foundEntries.begin(); applications != foundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(PACKAGE_NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VENDOR, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VERSION, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ROOT_PATH, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(MEDIA_ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(INITIAL_SIZE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(JAD_PATH, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(JAR_PATH, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(JAD_URL, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(JAR_URL, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ACCESS_POINT, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CONTENT_INFO, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CONTENT_ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithAppTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(PACKAGE_ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(MAIN_CLASS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(AUTORUN, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithAppPackageAttTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VALUE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(TRUSTED, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithMidpPackageTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(TYPE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(SECURITY_DOMAIN, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(SECURITY_DOMAIN_CATEGORY, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(HASH, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CERT_HASH, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(RMS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VALID_CERTS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ON_SCREEN_KEYPAD, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(SECURITY_WARNINGS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithMidpPermTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CLASS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ACTION, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(FUNCTION_GROUP, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithMidpFuncGrpSetTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(FUNCTION_GROUP, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ALLOWED_SETTINGS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CURRENT_SETTING, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(BLANKET_PROMPT, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithPushRegTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(URL, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(FILTER, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(REGISTRATION_TYPE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithAlarmRegTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(ALARM_TIME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithRuntimeSetTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(EXTENSIONS, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithPreinstallTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(NAME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VENDOR, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(VERSION, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(INSTALL_STATE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + +int CStorageBackupUtil::FillVectorwithOtaStatusTableData(JavaStorageApplicationList_t& afoundEntries) +{ + const wstring emptyString; + wstring str; + + JavaStorageEntry attribute; + + /* Initialise Iterators to iterate through all applications + matched with search patterns. */ + JavaStorageApplicationList_t::const_iterator applications; + JavaStorageApplicationEntry_t::const_iterator findIterator; + + int rowsCount=0; + for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) + { + attribute.setEntry(ID, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(CREATION_TIME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(TYPE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(OTA_CODE, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(URL, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(LATEST_RETRY_TIME, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + attribute.setEntry(RETRY_COUNT, L""); + str = emptyString; + findIterator = (*applications).find(attribute); + + if (findIterator != (*applications).end()) + { + str = (*findIterator).entryValue(); + } + iStringVector.push_back(str); + + rowsCount++; + } + ILOG1(EBackup, "for loop crossed with i = %d", rowsCount); + return rowsCount; +} + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,404 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for CStorageBackupUtil class +* +*/ + + +#ifndef JAVASTORAGEBACKUPUTIL_H +#define JAVASTORAGEBACKUPUTIL_H + +#include +#include + +#include +#include +#include + +#include "javastorageentry.h" +#include "javastorage.h" +#include "javastoragenames.h" + +#define NUMBER_OF_TABLES 11 + +class RDesWriteStream; +class RDesReadStream; + +namespace java +{ +namespace backup +{ + + +/** +-------------------------------------------------------------------------------- + +* CStorageBackupUtil class is handling backup and restore of Java Storage data +* This class is instantiated when a BUR operation is starting. + +Example Data that could be present in JavaStorage which is backed up and restored by this class. + +Application Package Data +ID | PACKAGE_NAME | VENDOR | VERSION | ROOT_PATH | MEDIA_ID | INITIAL_SIZE | JAD_PATH | JAR_PATH | JAD_URL | JAR_URL | ACCESS_POINT | CONTENT_INFO | CONTENT_ID +788463512 | HelloWorld? | Nokia | 1.1 | \C\Private\102033E6\MIDlets\[101e59d8] | 123456 | 200 | \C\Private\102033E6\MIDlets\[101e59d8]\HelloWorld.jad | \C\Private\102033E6\MIDlets\[101e59d8]\HelloWorld.jar | http://getjar.com/MyGreatApp.jad | http://getjar.com/MyGreatApp2.jar | IAP:2 | 0 | 78d78sd89f789 + + +Application Data +ID | PACKAGE_ID | NAME | MAIN_CLASS | AUTORUN +788463616 | 788463512 | HelloWorld | HelloWorld | 0 + + +Application Package Attributes Data +ID | NAME | VALUE | TRUSTED +788463512 | MIDlet-Name | HelloWorld | 00 +788463512 | MIDlet-Version | 1.0 | 10 +788463512 | MIDlet-Vendor | Nokia | 10 + + +MIDP Application Package Data +ID | TYPE | SECURITY_DOMAIN | HASH | CERT_HASH | RMS | VALID_CERTS | ON_SCREEN_KEYPAD +788463512 | MIDletSuite? | Trusted | 123456789 | 123456789 | \C\Private\102033E6\MIDlets\[101e59d8]\RMSdata.bin | 1,3,5 | 0 + + +MIDP Permissions Data +ID | CLASS | NAME | ACTION | FUNCTION_GROUP +788463616 | javax.microedition.io.HttpProtocolPermission | http://server/index.html | read | HTTP + + +MIDP Function Group Settings Data +ID | FUNCTION_GROUP | ALLOWED_SETTINGS | CURRENT_SETTING | BLANKET_PROMPT +788463616 | HTTP | 111 (e.g. BLANKET, SESSION, ONESHOT) | 001 (ONESHOT) | 0 + +The allowed settings could be a an encoded integer based on the binary representation of 3 bits (e.g. 100 if only BLANKET is allowed, 011 if SESSION and ONESHOT are allowed). + + +MIDP Push Registrations Data +ID | URL | NAME | FILTER | REGISTRATION_TYPE +788463616 | sip:*;type=""application/test"", SIPPushReceiver? | SIPPushReceiver? | * | 1 +788463616 | btspp://localhost:99999999999999999999999999999999;*;authenticated;blacklist=00E001234567 | BTPushReceiver? | * | 0 + + +MIDP Alarm Push Registrations Data +ID | ALARM_TIME +788463616 | 2008-09-13;15:20:30 + + +MIDP Runtime Settings Data +EXTENSIONS +\C\Private\102033E6\Extenstions\12345678\Location.jar + + +Preinstall Data +NAME | VENDOR | VERSION | INSTALL_STATE +TestMIDletSuite | TestVendor | 1.2.3 | 2 + + +MIDP OTA Status Data table +ID | CREATION_TIME | TYPE | OTA_CODE | URL | LATEST_RETRY_TIME | RETRY_COUNT +788463616 | 2008-09-13;12:20:30 | 1 | 900 | http://www.moo.com/MIDLETS.js | 2008-09-13;15:20:30 | 2 + +----------------------------------------------------------------------------------------------------------------------------- +*/ + +class CStorageBackupUtil : public CBase +{ +public: + + /** + * Instantiates an object of this type + */ + static CStorageBackupUtil* NewL(); + + ~CStorageBackupUtil(); + + /** + * This method requests a section of Java Storage data. + * Called by the function GetBackupDataSectionL from midp2backupplugin + * The data is filled into the stream till it is full. + * The data returned may be base or incremental depending + * on the type of backup and the capability of the data owner. + * + * @param aBuffer a pointer to the base of the location where data + * can be copied. + * @param aBackupNotFinished on return EFalse if all data has + * been returned for this drive, else ETrue. + */ + void BackupStorageDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft); + + /** + * This method receives a section of base restore data. + * Stores the restore data in the vector so that it can be + * written to Java Storage when all data have come. + * + * @param stream holds the restore data + * @param aRestoreState EFirstBuffer if all data has been returned + * for this drive, else remains at EStorage. + * @param aBufferSpaceLeft the space left in the buffer + */ + void RestoreStorageDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft); + +private: + + // Default constructor for the class + + CStorageBackupUtil(); + + // Second phase constructor function + + void ConstructL(); + + /** + * This method fills the vector with Java Storage data. + * Data is read from JavaStorage tables and put inside the vector + * which will later be put into the buffer stream. + * The reason for having vector to store the data is that connection to + * Java Storage cannot be open for a long period of time + * ie writing into buffer stream's time + * + * @return returns an integer value telling whether the operation + * was completed successfully or not. + */ + int FillVectorWithStorageData(); + + /** + * A utility function which converts a wstring into a TDesC + * and writes it into the stream. + * + * @param stream an RDesWriteStream into which the converted + * string is written + * @param tempString the wstring which is to be converted. + */ + void WriteStringtoStreamL(RDesWriteStream& aStream, std::wstring aTempString); + + /** + * A utility function which reads a TDesC from the stream, converts it + * to a wstring and writes it into the vector. + * + * @param stream an RDesReadStream from which the TDesC data is read + */ + void ReadStringfromStreamL(RDesReadStream& aStream); + + /** + * This method writes the data to storage. + * Gets called after FillVectorsWithStreamDataL() function is called. + * This function opens a transaction to Storage and writes + * the vector's data into storage row-by-row, and then commits + * the transaction. + * + * @return returns an integer specifying whether the operation + * has completed successfully or not. + */ + int WriteDataToStorage(); +public: + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only APPLICATION_PACKAGE_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithAppPackageTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only APPLICATION_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithAppTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only APPLICATION_PACKAGE_ATTRIBUTES_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithAppPackageAttTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only MIDP_PACKAGE_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithMidpPackageTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only MIDP_PERMISSIONS_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithMidpPermTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only MIDP_FUNCTION_GROUP_SETTINGS_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithMidpFuncGrpSetTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only PUSH_REGISTRATION_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithPushRegTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only ALARM_REGISTRATION_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithAlarmRegTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only RUNTIME_SETTINGS_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithRuntimeSetTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only PREINSTALL_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithPreinstallTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Utility function which fills the vector with data got from storage. + * Handles data of only OTA_STATUS_TABLE. + * + * @param afoundEntries the application entries which match + * the SQL query. + * @return an integer representing the number of rows written + * into the vector. + */ + int FillVectorwithOtaStatusTableData(java::storage::JavaStorageApplicationList_t& afoundEntries); + + /** + * Prints the vectors + */ + void printVector(); + +private: + + /** + * The actual wstring vector which holds the data during a B&R operation. + * During a backup, this vector is filled with storage data and then + * written to the stream. + * During a restore, this vector is filled with data from the stream + * before it is written to storage. + * Own + */ + std::vector< std::wstring > iStringVector; + + /** + * An integer which holds the length of the string. + * When only half the data is read from the stream, this holds the + * length of the remaining data which is to be read. + * Own + */ + int iLenOfString; + + /** + * An integer which holds the count of the number of strings + * in the vector. Used during a B&R operation. + * Own + */ + int iStrCount; + + /** + * An integer array which holds the number of rows of each table + * present in storage. + * This information is written to stream and is used when the + * restored data is written back to storage. + * Own + */ + int iTableSize[NUMBER_OF_TABLES]; + + /** + * A Boolean value which says if a string was only + * half read during a previous iteration. + * Own + */ + TBool iRemainingString; + + /** + * A wstring which holds the half read string so that the + * completed string can be appended to it during the next iteration + * before it is put into the vector. + * Own + */ + std::wstring iHalfReadString; + + /** + * Shows if it's the fill call to backup storage data. + * Vectors filled only at the first call. + * Own + */ + TBool iFirstCalltoBackupStorageData; + + /** + * Shows if it's the fill call to restore storage data. + * Own + */ + TBool iFirstCalltoRestoreStorageData; + + /** + * Shows the remaining number of bytes available in the stream. + * Own + */ + int iBufferSpaceLeft; +}; + +} // namespace backup +} // namespace java + +#endif // JAVASTORAGEBACKUPUTIL_H diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,150 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of JavaVersionBackupUtil +* +*/ + + +#include +#include "javaversionbackuputil.h" +#include "logger.h" + + +#include +#include + +#define KOMJIdentifier 0x20000F3D + +using namespace Java; +using namespace java::backup; + +// ======== MEMBER FUNCTIONS ======== + +void JavaVersionBackupUtil::WriteJavaVersionL(RDesWriteStream& aStream) +{ + JELOG2(EBackup); + + // Get the Java version number from the environment API's + + TVersion version = Java::JavaEnvInfo::Version(); + + PLOG3(EBackup, "JavaEnvInfo::Version: major = %d, minor = %d, build = %d", + version.iMajor, version.iMinor, version.iBuild); + + /* Put OMJ Package UID in the front indicating that it is an + OMJ environment from which backup was taken. */ + aStream.WriteInt32L(KOMJIdentifier); + + // write the version numbers to the stream + aStream.WriteInt8L(version.iMajor); + aStream.WriteInt8L(version.iMinor); + aStream.WriteInt16L(version.iBuild); + + ILOG(EBackup, "Version information written to stream"); +} + +TUint JavaVersionBackupUtil::CheckJavaVersionL(RDesReadStream& aStream, TDriveNumber aDrive, TBool versionCheck) +{ + JELOG2(EBackup); + TInt32 omjID = 0; + if (versionCheck) + { + // Read the OMJSpecific ID only on first call + omjID = aStream.ReadInt32L(); + } + + if (omjID != KOMJIdentifier) + { + _LIT(KJavaRestoreConverterExe, "javarestoreconverter.exe"); + + RProcess rProcess; + + TChar targetDrive; + _LIT(KText , ""); + TBuf<15> commandLine(KText); + RFs session; + TInt err = session.Connect(); + if (KErrNone != err) + { + ELOG1(EBackup, + "JavaVersionBackupUtil::CheckJavaVersionL: Session Connection failed, error %d", err); + CleanupStack::PopAndDestroy(&aStream); + User::Leave(err); + } + + err = session.DriveToChar(aDrive, targetDrive); + if (KErrNone == err) + { + _LIT(KDrive, " -drive"); + commandLine.Append(KDrive); + commandLine.Append(targetDrive); + } + + err = rProcess.Create(KJavaRestoreConverterExe, commandLine); + if (KErrNone == err) + { + TRequestStatus status; + rProcess.Logon(status); + rProcess.Resume(); + + // now wait until javarestoreconverter exits + User::WaitForRequest(status); + if (status.Int() != KErrNone) + { + // Installing old JRT 1.x MIDlets to JRT 2.x failed + err = status.Int(); + ELOG1(EBackup, + "JavaVersionBackupUtil::CheckJavaVersionL: Installation failed, error %d", err); + CleanupStack::PopAndDestroy(&aStream); + User::Leave(err); + } + else + { + LOG(EBackup,EInfo, + "JavaVersionBackupUtil::CheckJavaVersionL: Installing Midlets successful"); + } + } + else + { + // Cannot even start javarestoreconverter + ELOG1(EBackup, + "JavaVersionBackupUtil::CheckJavaVersionL: Cannot start Installer, error %d", err); + CleanupStack::PopAndDestroy(&aStream); + User::Leave(err); + } + rProcess.Close(); + return 1; + + } + else + { + TInt8 major = aStream.ReadInt8L(); + TInt8 minor = aStream.ReadInt8L(); + TInt16 build = aStream.ReadInt16L(); + + TVersion version(major, minor, build); + + PLOG3(EBackup, "JavaVersion read from Stream: major = %d, minor = %d, build = %d", + version.iMajor, version.iMinor, version.iBuild); + + // read current version and compare it with the read version + TVersion curVersion = Java::JavaEnvInfo::Version(); + + PLOG3(EBackup," Current JavaVersion: major = %d, minor = %d, build = %d", + curVersion.iMajor, curVersion.iMinor, curVersion.iBuild); + return 0; + + } +} + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for JavaVersionBackupUtil class +* +*/ + + +#ifndef JAVAVERSIONBACKUPUTIL_H +#define JAVAVERSIONBACKUPUTIL_H + +#include +#include +#include + +class RDesReadStream; +class RDesWriteStream; + +namespace java +{ +namespace backup +{ +/** + * JavaVersionBackupUtil class is used for checking the java version + * during a B&R operation. This class writes the current java version + * while backing up and then checks whether the backed up version + * is compatible with the currnet version while doing a restore. + * If it is not compatible, then the backup process is gracefully exited. + */ + +class JavaVersionBackupUtil +{ + +public: + + /** + * This method writes the current java version into the SBE buffer. + * This functions is called when a backup process is started. + * + * @param aBuffer the buffer which is sent by the SBE + */ + static void WriteJavaVersionL(RDesWriteStream& aStream); + + /** + * This method reads the java version from the stream. If there is no + * Java version or if the Java version is not compatible with the + * current version, then the restore process is exited gracefully. + * + * @param aStream an RDesReadStream on the buffer which is sent + * by the SBE + * @param aDrive current drive to be backed up + * @return status + */ + static TUint CheckJavaVersionL(RDesReadStream& aStream, TDriveNumber aDrive, TBool versionCheck); + +private: + + /** + * This method is used to compare the current java version with the + * one read from the stream. + * This method is not used presently. Logic may be added in the future + * + * @param aVersion the java version read from the stream + * @param aCurVersion the current java version + */ + void CompareL(TVersion aVersion, TVersion aCurVersion); + +}; + +} // namespace backup +} // namespace java + +#endif // JAVAVERSIONBACKUPUTIL_H diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/midp2backupdataids.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupdataids.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: midp2backupdataids definition +* +*/ + +#include + +#ifndef MIDP2BACKUPDATAIDS_H +#define MIDP2BACKUPDATAIDS_H + +namespace java +{ +namespace backup +{ +/** + * State of streaming during restore + */ +enum TRestoreState +{ + EVersion = 0, + EStorage, + EAppArc, + EInIcon, + EInSize, + EInstall, + EScr +}; + +} //namespace backup +} //namespace java + + +#endif // MIDP2BACKUPDATAIDS_H diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,637 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Midp2BackupPlugin +* +*/ + + +#include "midp2backupplugin.h" +#include "midp2backupdataids.h" +#include "apparcbackuputil.h" +#include "javastoragebackuputil.h" +#include "javaversionbackuputil.h" + +#include "javastoragenames.h" +#include "javastorageentry.h" +#include "javastorage.h" + +#include "javacommonutils.h" +#include "logger.h" + +#include +#include +#include +#include +#include + + +using namespace std; +using namespace java::storage; +using namespace java::backup; + +// ======== MEMBER FUNCTIONS ======== + +CMidp2BackupPlugin::CMidp2BackupPlugin() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin constructor"); +} + +void CMidp2BackupPlugin::ConstructL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ConstructL"); + + iIconDescIndex = 0; + iBufferSpaceLeft = 0; + iFirstCallToGetBackupDataSection = ETrue; + iStorageDataBackup = ETrue; + iStorageDataRestore = ETrue; + iJavaVersionInfoWritten = EFalse; + iRestoreState = EVersion; + + User::LeaveIfError(iFs.Connect()); + // to share file handles with AppArc + User::LeaveIfError(iFs.ShareProtected()); + + iStorageBackupUtil = CStorageBackupUtil::NewL(); + iAppArcUtil = CAppArcBackupUtil::NewL(iFs); +} + +CMidp2BackupPlugin* CMidp2BackupPlugin::NewL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::NewL"); + + CMidp2BackupPlugin* self = new(ELeave) CMidp2BackupPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +CMidp2BackupPlugin::~CMidp2BackupPlugin() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin destructor"); + + iFs.Close(); + iIconUidArray.Close(); + delete iAppArcUtil; + delete iIconDesc; + delete iRestoreIconDesc; + delete iStorageBackupUtil; +} + +// from base class CBackupPlugin + +void CMidp2BackupPlugin::PrepareForBURL(TInt aBackupStateValue) +{ + (void)aBackupStateValue; // Just to suppress a warning in release builds + LOG1(EBackup, EInfo, "CMidp2BackupPlugin::PrepareForBURL, BUR state: %d", aBackupStateValue); +} + +void CMidp2BackupPlugin::ReceiveSnapshotDataL(TDriveNumber /* aDrive */, TDesC8& /* aBuffer */, TBool /* aLastSection */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +TUint CMidp2BackupPlugin::GetExpectedDataSize(TDriveNumber /* aDrive */) +{ + JELOG2(EBackup); + return 0; +} + +void CMidp2BackupPlugin::GetSnapshotDataL(TDriveNumber /* aDrive */, TPtr8& /* aBuffer */, TBool& /* aFinished */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::InitialiseGetBackupDataL(TDriveNumber aDrive) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseGetBackupDataL"); + iDrive = aDrive; +} + +void CMidp2BackupPlugin::GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::GetBackupDataSectionL"); + + iBufferSpaceLeft = aBuffer.MaxLength(); + RDesWriteStream stream(aBuffer); + CleanupClosePushL(stream); + + if (!iJavaVersionInfoWritten) + { + JavaVersionBackupUtil::WriteJavaVersionL(stream); + iJavaVersionInfoWritten = ETrue; + iBufferSpaceLeft -= 8; + } + + if (iStorageDataBackup) + { + iStorageBackupUtil->BackupStorageDataL(stream, iStorageDataBackup, iBufferSpaceLeft); + aFinished = EFalse; + } + + else + { + if (iFirstCallToGetBackupDataSection) + { + LOG(EBackup, EInfo, "First Call To GetBackupDataSection"); + // Get the uids of midlets whose icons are to be backed up + iIconFilePointer = 0; + ResetIconArray(); + iAppArcUtil->GetMidletsFromAppArcL(iIconUidArray, iDrive); + + /* Streaming MMC's unique Id, if current drive is MMC + and there's at least one midlet on the drive*/ + if (iIconUidArray.Count() > 0 && iDrive >= EDriveE && iDrive <= EDriveZ) + { + TUint32 mmcId = MmcIdL(); + + if (mmcId != 0) + { + LOG1(EBackup,EInfo, "Write MMC id: %u", mmcId); + stream.WriteUint32L(mmcId); + iBufferSpaceLeft -= sizeof(mmcId); + } + } + // Setting flag to EFalse + iFirstCallToGetBackupDataSection = EFalse; + } + + // Next icon uid and filename + TUid currentUid; + HBufC* fullFileName = NULL; + + // Streaming leftover part of icon file + if (iIconDescIndex) + { + LOG(EBackup, EInfo, "Streaming leftover part of icon file"); + + /* if the icon file is bigger than the space in the buffer, write only + part of it and fill iLeftover with remaining part. */ + if (iIconDesc->Size() - iIconDescIndex > iBufferSpaceLeft) + { + stream.WriteL(iIconDesc->Mid(iIconDescIndex), iBufferSpaceLeft); + iIconDescIndex += iBufferSpaceLeft; + } + else + { + stream.WriteL(iIconDesc->Mid(iIconDescIndex)); + iIconDescIndex = 0; + } + + aFinished = EFalse; + } + + // Get new icon file + else if (NextIcon(currentUid, fullFileName)) + { + LOG1(EBackup, EInfo, "New icon file, id: %d", currentUid.iUid); + + // Readstream for icon file + RFileReadStream fileStream; + + User::LeaveIfError(fileStream.Open(iFs, *fullFileName, EFileRead)); + CleanupClosePushL(fileStream); + + TEntry* entry = new(ELeave) TEntry(); + CleanupStack::PushL(entry); + + iFs.Entry(*fullFileName, *entry); + TInt32 size = entry->iSize; + + // Write icon file content into iIconDesc + LOG(EBackup, EInfo, "Write icon file content into iIconDesc"); + delete iIconDesc; + iIconDesc = NULL; + iIconDesc = HBufC8::NewL(size); + + TPtr8 buf = iIconDesc->Des(); + fileStream.ReadL(buf, size); + + // get the group name of the midlet from AppArc + TBuf< KApaMaxAppGroupName >groupName(iAppArcUtil->GetMidletGroupName(currentUid)); + TInt groupNameSize = groupName.Size(); + + // Write the size of the data + LOG(EBackup,EInfo, "Write the size of the data"); + + TParsePtrC parse(*fullFileName); + TPtrC fileName = parse.NameAndExt(); + TInt32 fileNameSize = fileName.Size(); + + stream.WriteInt32L(sizeof(TUid) // Uid + + sizeof(TInt32) // fileNameSize + + fileNameSize // filename + + sizeof(TInt32) // number of icons + + sizeof(TInt32) // groupnamesize + + groupNameSize + + size // icon file + ); + iBufferSpaceLeft -= sizeof(TInt32); + + // Write the Uid of the midlet + LOG(EBackup, EInfo, "Write the Uid of the midlet"); + stream.WriteInt32L(currentUid.iUid); + iBufferSpaceLeft -= sizeof(TUid); + + // Write the size of the icon filename + LOG(EBackup, EInfo, "Write the size of the icon filename"); + stream.WriteInt32L(fileNameSize); + iBufferSpaceLeft -= sizeof(TInt32); + + // Write icon filename + LOG(EBackup, EInfo, "Write icon filename"); + stream.WriteL(fileName); + iBufferSpaceLeft -= fileNameSize; + + // Write number of icons in midlet + LOG(EBackup, EInfo, "Write number of icons in midlet"); + TInt iconCount; + iAppArcUtil->NumberOfOwnDefinedIcons(TUid::Uid(currentUid.iUid), iconCount); + stream.WriteInt32L(iconCount); + iBufferSpaceLeft -= sizeof(TInt32); + + // TPtr8 groupName(iAppArcUtil->GetMidletGroupName(currentUid)); + LOG(EBackup, EInfo, "Write the size of the Group name of the midlet"); + stream.WriteInt32L(groupNameSize); + iBufferSpaceLeft -= sizeof(TInt32); + + if (groupNameSize != 0) + { + LOG(EBackup, EInfo, "Write the Group name of the midlet"); + stream.WriteL(groupName); + iBufferSpaceLeft -= groupNameSize; + } + + /* if the icon file is bigger than the space in the buffer, + write only part of it and fill iLeftover with remaining part */ + LOG(EBackup, EInfo, "Write icon"); + if (size > iBufferSpaceLeft) + { + stream.WriteL(buf, iBufferSpaceLeft); + iIconDescIndex = iBufferSpaceLeft; + } + else + { + stream.WriteL(buf, size); + iIconDescIndex = 0; + } + + aFinished = EFalse; + + CleanupStack::PopAndDestroy(&fileStream); + CleanupStack::PopAndDestroy(entry); + } + + else + { + aFinished = ETrue; + iFirstCallToGetBackupDataSection = ETrue; + iStorageDataBackup = ETrue; + } + + delete fullFileName; + } + CleanupStack::PopAndDestroy(&stream); +} + + +void CMidp2BackupPlugin::InitialiseRestoreBaseDataL(TDriveNumber aDrive) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseRestoreBaseDataL"); + iDrive = aDrive; +} + +void CMidp2BackupPlugin::RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreBaseDataSectionL"); + + iBufferSpaceLeft = aBuffer.Size(); + RDesReadStream stream(aBuffer); + CleanupClosePushL(stream); + TBool versionCheck = ETrue; + + if (((iRestoreState == EVersion) || (iRestoreState == EInstall)) && iBufferSpaceLeft >= 8) + { + if (iRestoreState == EInstall) + { + versionCheck = EFalse; + } + TUint ret = JavaVersionBackupUtil::CheckJavaVersionL(stream,iDrive,versionCheck); + if (1==ret) + { + // Here set the satus to restore finished, so that control goes back to SBE & SBE calls B&R for another drive + iRestoreState = EInstall; + } + else + { + /* version information has been written to stream. + So change restore state to restore storage data */ + iRestoreState = EStorage; + } + // version information is of length 8 bytes. + iBufferSpaceLeft -= 8; + } + + if (iRestoreState == EStorage) + { + iStorageBackupUtil -> RestoreStorageDataL(stream, iRestoreState, iBufferSpaceLeft); + } + + // Only at first call + if ((iRestoreState != EStorage && iRestoreState != EVersion) && (iRestoreState != EInstall)) + { + if (iRestoreState == EAppArc) + { + // Making AppArc deregistrations + TRAPD(err, iAppArcUtil->DeregisterAppsL(iDrive)); + + if (err) + { + ELOG(EBackup, "Leave in deregistering apps"); + } + } + + // Process the data buffer for restore + ProcessBufferL(stream); + + if (aFinished) + { + // Set state to EStorage + iRestoreState = EStorage; + } + } + + aFinished = ETrue; + CleanupStack::PopAndDestroy(&stream); +} + +void CMidp2BackupPlugin::InitialiseRestoreIncrementDataL(TDriveNumber /* aDrive */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::RestoreIncrementDataSectionL(TDesC8& /* aBuffer */, TBool /* aFinished */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::RestoreComplete(TDriveNumber /* aDrive */) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreComplete"); +} + +TUint CMidp2BackupPlugin::MmcIdL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::MmcIdL()"); + + TVolumeInfo* volumeInfo = new(ELeave) TVolumeInfo(); + + TInt err = iFs.Volume(*volumeInfo, iDrive); + + if (!err) + { + TUint mmcId = volumeInfo->iUniqueID; + return mmcId; + } + else + { + return 0; + } + + +} + +void CMidp2BackupPlugin::ProcessBufferL(RDesReadStream& stream) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessBuffer()"); + + // Cycle until there's data in the buffer + while (iBufferSpaceLeft > 0) + { + switch (iRestoreState) + { + case EAppArc: + ProcessFirstBufferL(stream, iBufferSpaceLeft); + break; + + case EInIcon: + ProcessInIconL(stream, iBufferSpaceLeft); + break; + + case EInSize: + ProcessInSizeL(stream, iBufferSpaceLeft); + break; + + default: + CleanupStack::PopAndDestroy(&stream); + User::Leave(KErrNotSupported); + } + } +} + + +_LIT(KStarWildCard, "*.*"); + +void CMidp2BackupPlugin::RestoreMmcRegistryL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreMmcRegistry()"); + + /* If backed up MMC is not the same as the current MMC, copy the entries + from the directory of the backed up MMC to the directory + of the current MMC */ + TUint32 mmc = MmcIdL(); + + if (iBackupMmc != mmc) + { + // Create path to old place + TPath path_old; + CreateMmcPath(path_old, iDrive, iBackupMmc); + + // Create path to new place + TPath path_new; + CreateMmcPath(path_new, iDrive, mmc); + + // Get old files list + CFileMan* fileMan = CFileMan::NewL(iFs); + + CleanupStack::PushL(fileMan); + + // Copy to new place + iFs.MkDir(path_new); + path_old.Append(KStarWildCard); + TInt err = fileMan->Copy(path_old, path_new); + + ILOG1(EBackup, "File copy, status: %d", err); + + User::LeaveIfError(err); + + CleanupStack::PopAndDestroy(); + } +} + +_LIT(KPrivatePath, "C:\\private\\"); + +void CMidp2BackupPlugin::CreateMmcPath(TDes& aPathName, TInt aDrive, TUint aUniqueId) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::CreateMmcPath()"); + + aPathName.Zero(); + aPathName.Append(KPrivatePath); + aPathName.AppendNum(KRegistryServerUid, EHex); + aPathName.Append(KPathDelimiter); + + // append drive name + TDriveUnit driveUnit(aDrive); + aPathName.Append(driveUnit.Name().Left(1)); + aPathName.Append(KPathDelimiter); + + TUint64 id = aUniqueId; + aPathName.AppendNum(id, EHex); + aPathName.Append(KPathDelimiter); +} + +TBool CMidp2BackupPlugin::NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::NextIcon()"); + + if (iIconUidArray.Count() > iIconFilePointer) + { + aCurrentUid = iIconUidArray[iIconFilePointer]; + iAppArcUtil->GetIconFilename(iIconUidArray[iIconFilePointer], aFullFileName); + iIconFilePointer++; + return ETrue; + } + else + { + // There are no more icon files + return EFalse; + } +} + +void CMidp2BackupPlugin::ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessFirstBuffer()"); + + if (iDrive >= EDriveE && iDrive <= EDriveZ) + { + // Read MMC id and restore MMC entries if needed + iBackupMmc = aStream.ReadUint32L(); + aBufferSpaceLeft -= sizeof(iBackupMmc); + LOG1(EBackup, EInfo, "Read MMC Id: %u", iBackupMmc); + RestoreMmcRegistryL(); + } + if (aBufferSpaceLeft >= sizeof(TInt32)) + { + iIconFileSizeLeft = aStream.ReadInt32L(); + aBufferSpaceLeft -= sizeof(iIconFileSizeLeft); + iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft); + iRestoreState = EInIcon; + } + else + { + // No more data to read + aBufferSpaceLeft = 0; + } +} + +void CMidp2BackupPlugin::ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInIcon()"); + + TPtr8 restoreIconPtr = iRestoreIconDesc->Des(); + HBufC8* tempDesc = HBufC8::NewL(iIconFileSizeLeft); + CleanupStack::PushL(tempDesc); + TPtr8 tempPtr = tempDesc->Des(); + + // Icon cannot be read fully + if (iIconFileSizeLeft > aBufferSpaceLeft) + { + aStream.ReadL(tempPtr, aBufferSpaceLeft); + restoreIconPtr.Append(tempPtr); + iIconFileSizeLeft -= aBufferSpaceLeft; + aBufferSpaceLeft = 0; + iRestoreState = EInIcon; + } + // Icon can be read fully + else + { + aStream.ReadL(tempPtr, iIconFileSizeLeft); + restoreIconPtr.Append(tempPtr); + aBufferSpaceLeft -= iIconFileSizeLeft; + iRestoreState = EInSize; + + TRAPD(err, iAppArcUtil->RegisterAppL(restoreIconPtr, iDrive)); + + if (err) + { + ELOG(EBackup, "Registerin application to AppArc failed."); + } + } + + CleanupStack::PopAndDestroy(tempDesc); +} + +void CMidp2BackupPlugin::ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInSize()"); + + if (aBufferSpaceLeft >= sizeof(TInt32)) + { + if (iSizeBuffer.Size() != 0) + { + // Read leftover part of size + TInt readData = sizeof(TInt32) - iSizeBuffer.Size(); + aStream.ReadL(iSizeBuffer, readData); + RMemReadStream sizeStream(iSizeBuffer.Ptr(), 4); + CleanupClosePushL(sizeStream); + iIconFileSizeLeft = sizeStream.ReadInt32L(); + CleanupStack::PopAndDestroy(&sizeStream); + aBufferSpaceLeft -= sizeof(readData); + } + else + { + // Read size in full + iIconFileSizeLeft = aStream.ReadInt32L(); + aBufferSpaceLeft -= sizeof(iIconFileSizeLeft); + } + + delete iRestoreIconDesc; + iRestoreIconDesc = NULL; + iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft); + iRestoreState = EInIcon; + } + else + { + // Read first byte(s) of size + aStream.ReadL(iSizeBuffer, aBufferSpaceLeft); + aBufferSpaceLeft = 0; + } +} + +void CMidp2BackupPlugin::ResetIconArray() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ResetIconArray()"); + + // Remove all entries + while (iIconUidArray.Count()) + { + iIconUidArray.Remove(0); + } +} diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,412 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for CMidp2BackupPlugin class +* +*/ + + +#ifndef MIDP2BACKUPPLUGIN_H +#define MIDP2BACKUPPLUGIN_H + +#include "backupplugin.h" +#include +#include "logger.h" + +class RDesWriteStream; +class RDesReadStream; + + + +namespace java +{ +namespace backup +{ + +class CAppArcBackupUtil; +class CJavaVersionBackupUtil; +class CStorageBackupUtil; + + + +/** + * CMidp2BackupPlugin class is handling backup and restore operations + * for MIDlets + * + * This class is instantiated when a BUR operation is starting. + */ +class CMidp2BackupPlugin : public CBackupPlugin +{ + +public: + + /** + * Instantiates an object of this type + */ + static CMidp2BackupPlugin* NewL(); + + ~CMidp2BackupPlugin(); + + + // from base class CBackupPlugin + + /** + * This method is called when a backup or restore operation is + * starting. Preparations can be done to prepare for BUR. + * + * @param aBackupStateValue the value of the current backup state + */ + void PrepareForBURL(TInt aBackupStateValue); + + /** + * This method receives all or part of a snapshot of data to allow + * calculation of an incremental backup. The snapshot is one that + * was previously supplied by the data owner. The snapshot data + * should be read from the location supplied. The snapshot data may + * be larger than the location supplied in which case the routine + * will be called repeatedly until all data has been supplied. + * + * Snapshot data will also be supplied as part of a restore operation + * + * @param aDrive the drive being backed up + * @param aBuffer a pointer to the base of the location from whence + * data can be copied. + * @param aLastSection ETrue if this is the last section of snapshot + * data, else EFalse. + */ + void ReceiveSnapshotDataL(TDriveNumber aDrive, + TDesC8& aBuffer, + TBool aLastSection); + + /** + * This method returns the expected size of backup data that will be + * supplied. If an incremental backup is underway then this method + * will not be called until after ReceiveSnapshotDataL(). + * The size data will be used for the purpose of tracking progess + * during a backup. If it is inaccurate then the user may see + * irregular progress but the actual backup data will not be + * affected so it is acceptable to return an estimated value. + * + * @param aDrive the drive being backed up. + * @return the size of the data that will be returned + */ + TUint GetExpectedDataSize(TDriveNumber aDrive); + + /** + * This method returns a snapshot of data to accompany a backup. The + * snapshot is expected to contain details on files / data being + * backed up. The format of the snapshot is only meaningful to the + * data owner. The snapshot will be supplied if the data owner is + * asked for an incremental backup and for a restore operation. The + * snapshot data should be copied to the location supplied. + * + * The snapshot data may be larger than the location supplied in + * which case the routine will be called repeatedly until all data + * has been retrieved. + * + * @param aDrive the drive being backed up + * @param aBuffer a pointer to the base of the location where data + * can be copied. + * @param aFinished on return ETrue if all data has been returned + * for this drive, else EFalse. + */ + void GetSnapshotDataL(TDriveNumber aDrive, + TPtr8& aBuffer, + TBool& aFinished); + + /** + * This method prepares the implementor to return backup data. It + * will be followed by a sequence of calls to request the actual + * data. + * + * @param aDrive the drive being backed up. + */ + void InitialiseGetBackupDataL(TDriveNumber aDrive); + + /** + * This method requests a section of backup data. + * InitialiseGetBackupDataL() will have been called previously to + * specify the drive concerned. The data returned may be base or + * incremental depending on the type of backup and the capability of + * the data owner. + * + * @param aBuffer a pointer to the base of the location where data + * can be copied. + * @param aFinished on return ETrue if all data has been returned + * for this drive, else EFalse. + */ + void GetBackupDataSectionL(TPtr8& aBuffer, + TBool& aFinished); + + /** + * This method prepares the implementor to receive base restore data + * for a drive. It will be followed by a sequence of calls to supply + * the actual data. + * + * @param aDrive the drive being restored. + */ + void InitialiseRestoreBaseDataL(TDriveNumber aDrive); + + /** + * This method receives a section of base restore data. + * InitialiseRestoreBaseDataL() will have been called previously to + * specify the drive concerned. + * + * @param aBuffer a pointer to the base of the location whence data + * can be read. + * @param aFinished ETrue if all data has been returned for this + * drive, else EFalse. + */ + void RestoreBaseDataSectionL(TDesC8& aBuffer, + TBool aFinished); + + /** + * This method prepares the implementor to receive incremental + * restore data for a drive. It will be followed by a sequence + * of calls to supply the actual data. If multiple increments + * are supplied then this methid will be called before each increment + * + * @param aDrive the drive being restored. + */ + void InitialiseRestoreIncrementDataL(TDriveNumber aDrive); + + /** + * This method receives a section of increment restore data. + * InitialiseRestoreIncrementDataL() will have been called + * previously to specify the drive concerned. + * + * @param aBuffer a pointer to the base of the location whence data + * can be read. + * @param aFinished ETrue if all data has been returned for this + * increment, else EFalse. + */ + void RestoreIncrementDataSectionL(TDesC8& aBuffer, + TBool aFinished); + + /** + * This method is called when all data to be restored has been + * supplied. + * + * @param aDrive the drive being restored. + */ + void RestoreComplete(TDriveNumber aDrive); + +private: + + CMidp2BackupPlugin(); + + void ConstructL(); + + /** + * This method is called to get the unique Id of the current MMC + * + * @return The Id of the MMC, or 0, if no MMC is inserted + */ + TUint MmcIdL(); + + /** + * This method is called to process the content of the buffer + * provided in active phase of restore + * + * @param aBuffer the buffer to process + */ + void ProcessBufferL(RDesReadStream& stream); + + /** + * This method is called to restore the Java Registry entries + * on the MMC, if needed + */ + void RestoreMmcRegistryL(); + + /** + * This method creates the path for the Java Registry entries on + * the specified MMC + * + * @param [out] aPathName path of the entries of the MMC + * @param aDrive drive of the MMC + * @param aUniqueId Unique Id of the MMC + */ + void CreateMmcPath(TDes& aPathName, + TInt aDrive, + TUint aUniqueId); + + /** + * This method gets the path for the next icon file to be backed up + * + * @param [out] aCurrentUid Uid of the next icon + * @param [out] aFullFileName path of the next icon + * @return EFalse if there are no more icons in the array, ETrue + * otherwise + */ + TBool NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName); + + /** + * Process buffer when restore state is EFirstBuffer + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + void ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Process buffer when restore state is EInIcon + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + void ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Process buffer when restore state is EInSize + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + void ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Resets the array of icons to be backed up + */ + void ResetIconArray(); + +private: // data + + /** + * File session + * Own. + */ + RFs iFs; + + /** + * AppArcBackupUtil object for AppArc operations + * Own. + */ + CAppArcBackupUtil* iAppArcUtil; + + /** + * StorageBackupUtil object for storage B&R + * Own. + */ + CStorageBackupUtil* iStorageBackupUtil; + /** + * The drive that is backed up or restored currently + * Own. + */ + TDriveNumber iDrive; + + /** + * Id of backed up drive, gets its value from restored data + * Own. + */ + TInt32 iBackupDrive; + + /** + * Id of backed up MMC, gets its value from restored data + * Own. + */ + TUint32 iBackupMmc; + + /** + * State of streaming during restore + * Own. + */ + TInt iRestoreState; + + /** + * Shows if it's the first call to GetBackupDataSectionL + * Own. + */ + TBool iFirstCallToGetBackupDataSection; + + /** + * Shows if Backup of storage data is finished or not + * Own. + */ + TBool iStorageDataBackup; + + /** + * Shows if Restore of storage data is finished or not + * Own. + */ + TBool iStorageDataRestore; + + /** + * Shows if Java version information is already written or not + * Own + */ + TBool iJavaVersionInfoWritten; + + /** + * Shows if its the first call to restore data or not. + * Own. + */ + TBool iFirstCallToRestoreBackupDataSection; + + /** + * Stores the uids of the midlets whose icons are to be backed up. + * Own. + */ + RArray iIconUidArray; + + /** + * The current index in the icon file array + * Own. + */ + TInt iIconFilePointer; + + /** + * Stores the current icon file for streaming + * This descriptor will be streamed at subsequent calls of + * GetBackupDataSectionL() + * Own. + */ + HBufC8* iIconDesc; + + /** + * Stores the current icon file being restored + * Own. + */ + HBufC8* iRestoreIconDesc; + + /** + * Size of the icon to be still read during restore + * Own. + */ + TInt32 iIconFileSizeLeft; + + /** + * Current index of iIconDesc + * Own. + */ + TInt iIconDescIndex; + + /** + * Holds the remaining bytes in the buffer + * Own + */ + + TInt iBufferSpaceLeft; + + /** + * Buffer for storing data size in restore + * Own. + */ + TBuf8<4> iSizeBuffer; +}; + + + +} //namespace backup +} //namespace java + +#endif // MIDP2BACKUPPLUGIN_H diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,490 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation of Midp2BackupPlugin with USIF +* +*/ + +#include +#include +#include +#include +#include + +#include "midp2backuppluginusif.h" +#include "midp2backupdataids.h" +#include "javastoragebackuputil.h" +#include "javaversionbackuputil.h" +#include "javascrbackuputil.h" + +#include "javastoragenames.h" +#include "javastorageentry.h" +#include "javastorage.h" + + +#include "javacommonutils.h" +#include "logger.h" + + +using namespace std; +using namespace java::storage; +using namespace java::backup; + +// ======== MEMBER FUNCTIONS ======== + +CMidp2BackupPlugin::CMidp2BackupPlugin() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin constructor"); +} + +void CMidp2BackupPlugin::ConstructL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ConstructL"); + + iIconDescIndex = 0; + iBufferSpaceLeft = 0; + iFirstCallToGetBackupDataSection = ETrue; + iStorageDataBackup = ETrue; + iScrDataBackup = ETrue; + iStorageDataRestore = ETrue; + iJavaVersionInfoWritten = EFalse; + iRestoreState = EVersion; + + User::LeaveIfError(iFs.Connect()); + // to share file handles with AppArc + User::LeaveIfError(iFs.ShareProtected()); + + iStorageBackupUtil = CStorageBackupUtil::NewL(); + + //iAppArcUtil = CAppArcBackupUtil::NewL(iFs); + + iScrBackupUtil = CScrBackupUtil::NewL(); +} + +CMidp2BackupPlugin* CMidp2BackupPlugin::NewL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::NewL"); + + CMidp2BackupPlugin* self = new(ELeave) CMidp2BackupPlugin(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +CMidp2BackupPlugin::~CMidp2BackupPlugin() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin destructor"); + + iFs.Close(); + iIconUidArray.Close(); + //delete iAppArcUtil; + delete iIconDesc; + delete iRestoreIconDesc; + delete iStorageBackupUtil; +} + +// from base class CBackupPlugin + +void CMidp2BackupPlugin::PrepareForBURL(TInt aBackupStateValue) +{ + (void)aBackupStateValue; // Just to suppress a warning in release builds + LOG1(EBackup, EInfo, "CMidp2BackupPlugin::PrepareForBURL, BUR state: %d", aBackupStateValue); +} + +void CMidp2BackupPlugin::ReceiveSnapshotDataL(TDriveNumber /* aDrive */, TDesC8& /* aBuffer */, TBool /* aLastSection */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +TUint CMidp2BackupPlugin::GetExpectedDataSize(TDriveNumber /* aDrive */) +{ + JELOG2(EBackup); + return 0; +} + +void CMidp2BackupPlugin::GetSnapshotDataL(TDriveNumber /* aDrive */, TPtr8& /* aBuffer */, TBool& /* aFinished */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::InitialiseGetBackupDataL(TDriveNumber aDrive) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseGetBackupDataL"); + iDrive = aDrive; +} + +void CMidp2BackupPlugin::GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::GetBackupDataSectionL"); + + iBufferSpaceLeft = aBuffer.MaxLength(); + RDesWriteStream stream(aBuffer); + CleanupClosePushL(stream); + + if (!iJavaVersionInfoWritten) + { + JavaVersionBackupUtil::WriteJavaVersionL(stream); + iJavaVersionInfoWritten = ETrue; + iBufferSpaceLeft -= 8; + } + + if (iStorageDataBackup) + { + iStorageBackupUtil->BackupStorageDataL(stream, iStorageDataBackup, iBufferSpaceLeft); + aFinished = EFalse; + } + else if(iScrDataBackup) + { + iScrBackupUtil->BackupScrDataL(stream,iScrDataBackup,iBufferSpaceLeft); + aFinished = EFalse; + } + + CleanupStack::PopAndDestroy(&stream); +} + + +void CMidp2BackupPlugin::InitialiseRestoreBaseDataL(TDriveNumber aDrive) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseRestoreBaseDataL"); + iDrive = aDrive; +} + +void CMidp2BackupPlugin::RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreBaseDataSectionL"); + + iBufferSpaceLeft = aBuffer.Size(); + RDesReadStream stream(aBuffer); + CleanupClosePushL(stream); + TBool versionCheck = ETrue; + + if (((iRestoreState == EVersion) || (iRestoreState == EInstall)) && iBufferSpaceLeft >= 8) + { + if (iRestoreState == EInstall) + { + versionCheck = EFalse; + } + TUint ret = JavaVersionBackupUtil::CheckJavaVersionL(stream,iDrive,versionCheck); + if (1==ret) + { + // Here set the satus to restore finished, so that control goes back to SBE & SBE calls B&R for another drive + iRestoreState = EInstall; + } + else + { + /* version information has been written to stream. + So change restore state to restore storage data */ + iRestoreState = EStorage; + } + // version information is of length 8 bytes. + iBufferSpaceLeft -= 8; + } + + if (iRestoreState == EStorage) + { + iStorageBackupUtil -> RestoreStorageDataL(stream, iRestoreState, iBufferSpaceLeft); + } + + if(iRestoreState == EScr) + { + iScrBackupUtil->RestoreScrDataL(stream,iRestoreState,iBufferSpaceLeft); + } + // Only at first call + if ((iRestoreState != EScr && iRestoreState != EVersion) && (iRestoreState != EInstall)) + {/* + if (iRestoreState == EAppArc) + { + // Making AppArc deregistrations + TRAPD(err, iAppArcUtil->DeregisterAppsL(iDrive)); + + if (err) + { + ELOG(EBackup, "Leave in deregistering apps"); + } + } + + // Process the data buffer for restore + ProcessBufferL(stream); + + if (aFinished) + { + // Set state to EStorage + iRestoreState = EStorage; + } + */ } + + aFinished = ETrue; + CleanupStack::PopAndDestroy(&stream); +} + +void CMidp2BackupPlugin::InitialiseRestoreIncrementDataL(TDriveNumber /* aDrive */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::RestoreIncrementDataSectionL(TDesC8& /* aBuffer */, TBool /* aFinished */) +{ + JELOG2(EBackup); + User::Leave(KErrNotSupported); +} + +void CMidp2BackupPlugin::RestoreComplete(TDriveNumber /* aDrive */) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreComplete"); +} + +TUint CMidp2BackupPlugin::MmcIdL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::MmcIdL()"); + + TVolumeInfo* volumeInfo = new(ELeave) TVolumeInfo(); + + TInt err = iFs.Volume(*volumeInfo, iDrive); + + if (!err) + { + TUint mmcId = volumeInfo->iUniqueID; + return mmcId; + } + else + { + return 0; + } + + +} +/* +void CMidp2BackupPlugin::ProcessBufferL(RDesReadStream& stream) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessBuffer()"); + + // Cycle until there's data in the buffer + while (iBufferSpaceLeft > 0) + { + switch (iRestoreState) + { + case EAppArc: + ProcessFirstBufferL(stream, iBufferSpaceLeft); + break; + + case EInIcon: + ProcessInIconL(stream, iBufferSpaceLeft); + break; + + case EInSize: + ProcessInSizeL(stream, iBufferSpaceLeft); + break; + + default: + CleanupStack::PopAndDestroy(&stream); + User::Leave(KErrNotSupported); + } + } +} +*/ + +_LIT(KStarWildCard, "*.*"); + +void CMidp2BackupPlugin::RestoreMmcRegistryL() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreMmcRegistry()"); + + /* If backed up MMC is not the same as the current MMC, copy the entries + from the directory of the backed up MMC to the directory + of the current MMC */ + TUint32 mmc = MmcIdL(); + + if (iBackupMmc != mmc) + { + // Create path to old place + TPath path_old; + CreateMmcPath(path_old, iDrive, iBackupMmc); + + // Create path to new place + TPath path_new; + CreateMmcPath(path_new, iDrive, mmc); + + // Get old files list + CFileMan* fileMan = CFileMan::NewL(iFs); + + CleanupStack::PushL(fileMan); + + // Copy to new place + iFs.MkDir(path_new); + path_old.Append(KStarWildCard); + TInt err = fileMan->Copy(path_old, path_new); + + ILOG1(EBackup, "File copy, status: %d", err); + + User::LeaveIfError(err); + + CleanupStack::PopAndDestroy(); + } +} + +_LIT(KPrivatePath, "C:\\private\\"); + +void CMidp2BackupPlugin::CreateMmcPath(TDes& aPathName, TInt aDrive, TUint aUniqueId) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::CreateMmcPath()"); + + aPathName.Zero(); + aPathName.Append(KPrivatePath); + aPathName.AppendNum(KRegistryServerUid, EHex); + aPathName.Append(KPathDelimiter); + + // append drive name + TDriveUnit driveUnit(aDrive); + aPathName.Append(driveUnit.Name().Left(1)); + aPathName.Append(KPathDelimiter); + + TUint64 id = aUniqueId; + aPathName.AppendNum(id, EHex); + aPathName.Append(KPathDelimiter); +} +/* +TBool CMidp2BackupPlugin::NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::NextIcon()"); + + if (iIconUidArray.Count() > iIconFilePointer) + { + aCurrentUid = iIconUidArray[iIconFilePointer]; + iAppArcUtil->GetIconFilename(iIconUidArray[iIconFilePointer], aFullFileName); + iIconFilePointer++; + return ETrue; + } + else + { + // There are no more icon files + return EFalse; + } +} + +void CMidp2BackupPlugin::ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessFirstBuffer()"); + + if (iDrive >= EDriveE && iDrive <= EDriveZ) + { + // Read MMC id and restore MMC entries if needed + iBackupMmc = aStream.ReadUint32L(); + aBufferSpaceLeft -= sizeof(iBackupMmc); + LOG1(EBackup, EInfo, "Read MMC Id: %u", iBackupMmc); + RestoreMmcRegistryL(); + } + if (aBufferSpaceLeft >= sizeof(TInt32)) + { + iIconFileSizeLeft = aStream.ReadInt32L(); + aBufferSpaceLeft -= sizeof(iIconFileSizeLeft); + iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft); + iRestoreState = EInIcon; + } + else + { + // No more data to read + aBufferSpaceLeft = 0; + } +} + +void CMidp2BackupPlugin::ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInIcon()"); + + TPtr8 restoreIconPtr = iRestoreIconDesc->Des(); + HBufC8* tempDesc = HBufC8::NewL(iIconFileSizeLeft); + CleanupStack::PushL(tempDesc); + TPtr8 tempPtr = tempDesc->Des(); + + // Icon cannot be read fully + if (iIconFileSizeLeft > aBufferSpaceLeft) + { + aStream.ReadL(tempPtr, aBufferSpaceLeft); + restoreIconPtr.Append(tempPtr); + iIconFileSizeLeft -= aBufferSpaceLeft; + aBufferSpaceLeft = 0; + iRestoreState = EInIcon; + } + // Icon can be read fully + else + { + aStream.ReadL(tempPtr, iIconFileSizeLeft); + restoreIconPtr.Append(tempPtr); + aBufferSpaceLeft -= iIconFileSizeLeft; + iRestoreState = EInSize; + + TRAPD(err, iAppArcUtil->RegisterAppL(restoreIconPtr, iDrive)); + + if (err) + { + ELOG(EBackup, "Registerin application to AppArc failed."); + } + } + + CleanupStack::PopAndDestroy(tempDesc); +} + +void CMidp2BackupPlugin::ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft) +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInSize()"); + + if (aBufferSpaceLeft >= sizeof(TInt32)) + { + if (iSizeBuffer.Size() != 0) + { + // Read leftover part of size + TInt readData = sizeof(TInt32) - iSizeBuffer.Size(); + aStream.ReadL(iSizeBuffer, readData); + RMemReadStream sizeStream(iSizeBuffer.Ptr(), 4); + CleanupClosePushL(sizeStream); + iIconFileSizeLeft = sizeStream.ReadInt32L(); + CleanupStack::PopAndDestroy(&sizeStream); + aBufferSpaceLeft -= sizeof(readData); + } + else + { + // Read size in full + iIconFileSizeLeft = aStream.ReadInt32L(); + aBufferSpaceLeft -= sizeof(iIconFileSizeLeft); + } + + delete iRestoreIconDesc; + iRestoreIconDesc = NULL; + iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft); + iRestoreState = EInIcon; + } + else + { + // Read first byte(s) of size + aStream.ReadL(iSizeBuffer, aBufferSpaceLeft); + aBufferSpaceLeft = 0; + } +} + +void CMidp2BackupPlugin::ResetIconArray() +{ + LOG(EBackup, EInfo, "CMidp2BackupPlugin::ResetIconArray()"); + + // Remove all entries + while (iIconUidArray.Count()) + { + iIconUidArray.Remove(0); + } +} +*/ + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,411 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Header file for CMidp2BackupPlugin class with USIF changes +* +*/ +#ifndef MIDP2BACKUPPLUGINUSIF_H_ +#define MIDP2BACKUPPLUGINUSIF_H_ + +#include "backupplugin.h" +#include +#include "logger.h" + +class RDesWriteStream; +class RDesReadStream; + +namespace java +{ +namespace backup +{ + + +class CJavaVersionBackupUtil; +class CStorageBackupUtil; +class CScrBackupUtil; + + +/** + * CMidp2BackupPlugin class is handling backup and restore operations + * for MIDlets + * + * This class is instantiated when a BUR operation is starting. + */ +class CMidp2BackupPlugin : public CBackupPlugin +{ + +public: + + /** + * Instantiates an object of this type + */ + static CMidp2BackupPlugin* NewL(); + + ~CMidp2BackupPlugin(); + + + // from base class CBackupPlugin + + /** + * This method is called when a backup or restore operation is + * starting. Preparations can be done to prepare for BUR. + * + * @param aBackupStateValue the value of the current backup state + */ + void PrepareForBURL(TInt aBackupStateValue); + + /** + * This method receives all or part of a snapshot of data to allow + * calculation of an incremental backup. The snapshot is one that + * was previously supplied by the data owner. The snapshot data + * should be read from the location supplied. The snapshot data may + * be larger than the location supplied in which case the routine + * will be called repeatedly until all data has been supplied. + * + * Snapshot data will also be supplied as part of a restore operation + * + * @param aDrive the drive being backed up + * @param aBuffer a pointer to the base of the location from whence + * data can be copied. + * @param aLastSection ETrue if this is the last section of snapshot + * data, else EFalse. + */ + void ReceiveSnapshotDataL(TDriveNumber aDrive, + TDesC8& aBuffer, + TBool aLastSection); + + /** + * This method returns the expected size of backup data that will be + * supplied. If an incremental backup is underway then this method + * will not be called until after ReceiveSnapshotDataL(). + * The size data will be used for the purpose of tracking progess + * during a backup. If it is inaccurate then the user may see + * irregular progress but the actual backup data will not be + * affected so it is acceptable to return an estimated value. + * + * @param aDrive the drive being backed up. + * @return the size of the data that will be returned + */ + TUint GetExpectedDataSize(TDriveNumber aDrive); + + /** + * This method returns a snapshot of data to accompany a backup. The + * snapshot is expected to contain details on files / data being + * backed up. The format of the snapshot is only meaningful to the + * data owner. The snapshot will be supplied if the data owner is + * asked for an incremental backup and for a restore operation. The + * snapshot data should be copied to the location supplied. + * + * The snapshot data may be larger than the location supplied in + * which case the routine will be called repeatedly until all data + * has been retrieved. + * + * @param aDrive the drive being backed up + * @param aBuffer a pointer to the base of the location where data + * can be copied. + * @param aFinished on return ETrue if all data has been returned + * for this drive, else EFalse. + */ + void GetSnapshotDataL(TDriveNumber aDrive, + TPtr8& aBuffer, + TBool& aFinished); + + /** + * This method prepares the implementor to return backup data. It + * will be followed by a sequence of calls to request the actual + * data. + * + * @param aDrive the drive being backed up. + */ + void InitialiseGetBackupDataL(TDriveNumber aDrive); + + /** + * This method requests a section of backup data. + * InitialiseGetBackupDataL() will have been called previously to + * specify the drive concerned. The data returned may be base or + * incremental depending on the type of backup and the capability of + * the data owner. + * + * @param aBuffer a pointer to the base of the location where data + * can be copied. + * @param aFinished on return ETrue if all data has been returned + * for this drive, else EFalse. + */ + void GetBackupDataSectionL(TPtr8& aBuffer, + TBool& aFinished); + + /** + * This method prepares the implementor to receive base restore data + * for a drive. It will be followed by a sequence of calls to supply + * the actual data. + * + * @param aDrive the drive being restored. + */ + void InitialiseRestoreBaseDataL(TDriveNumber aDrive); + + /** + * This method receives a section of base restore data. + * InitialiseRestoreBaseDataL() will have been called previously to + * specify the drive concerned. + * + * @param aBuffer a pointer to the base of the location whence data + * can be read. + * @param aFinished ETrue if all data has been returned for this + * drive, else EFalse. + */ + void RestoreBaseDataSectionL(TDesC8& aBuffer, + TBool aFinished); + + /** + * This method prepares the implementor to receive incremental + * restore data for a drive. It will be followed by a sequence + * of calls to supply the actual data. If multiple increments + * are supplied then this methid will be called before each increment + * + * @param aDrive the drive being restored. + */ + void InitialiseRestoreIncrementDataL(TDriveNumber aDrive); + + /** + * This method receives a section of increment restore data. + * InitialiseRestoreIncrementDataL() will have been called + * previously to specify the drive concerned. + * + * @param aBuffer a pointer to the base of the location whence data + * can be read. + * @param aFinished ETrue if all data has been returned for this + * increment, else EFalse. + */ + void RestoreIncrementDataSectionL(TDesC8& aBuffer, + TBool aFinished); + + /** + * This method is called when all data to be restored has been + * supplied. + * + * @param aDrive the drive being restored. + */ + void RestoreComplete(TDriveNumber aDrive); + +private: + + CMidp2BackupPlugin(); + + void ConstructL(); + + /** + * This method is called to get the unique Id of the current MMC + * + * @return The Id of the MMC, or 0, if no MMC is inserted + */ + TUint MmcIdL(); + + /** + * This method is called to process the content of the buffer + * provided in active phase of restore + * + * @param aBuffer the buffer to process + */ + void ProcessBufferL(RDesReadStream& stream); + + /** + * This method is called to restore the Java Registry entries + * on the MMC, if needed + */ + void RestoreMmcRegistryL(); + + /** + * This method creates the path for the Java Registry entries on + * the specified MMC + * + * @param [out] aPathName path of the entries of the MMC + * @param aDrive drive of the MMC + * @param aUniqueId Unique Id of the MMC + */ + void CreateMmcPath(TDes& aPathName, + TInt aDrive, + TUint aUniqueId); + + /** + * This method gets the path for the next icon file to be backed up + * + * @param [out] aCurrentUid Uid of the next icon + * @param [out] aFullFileName path of the next icon + * @return EFalse if there are no more icons in the array, ETrue + * otherwise + */ + //TBool NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName); + + /** + * Process buffer when restore state is EFirstBuffer + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + // void ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Process buffer when restore state is EInIcon + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + // void ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Process buffer when restore state is EInSize + * + * @param aStream readstream of buffer to process + * @param aBufferSpaceLeft space left of buffer to be processed + */ + //void ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft); + + /** + * Resets the array of icons to be backed up + */ + //void ResetIconArray(); + +private: // data + + /** + * File session + * Own. + */ + RFs iFs; + + /** + * StorageBackupUtil object for storage B&R + * Own. + */ + CStorageBackupUtil* iStorageBackupUtil; + /** + * CScrBackupUtil object for SCR B&R + * Own. + */ + CScrBackupUtil* iScrBackupUtil; + /** + * The drive that is backed up or restored currently + * Own. + */ + TDriveNumber iDrive; + + /** + * Id of backed up drive, gets its value from restored data + * Own. + */ + TInt32 iBackupDrive; + + /** + * Id of backed up MMC, gets its value from restored data + * Own. + */ + TUint32 iBackupMmc; + + /** + * State of streaming during restore + * Own. + */ + TInt iRestoreState; + + /** + * Shows if it's the first call to GetBackupDataSectionL + * Own. + */ + TBool iFirstCallToGetBackupDataSection; + + /** + * Shows if Backup of storage data is finished or not + * Own. + */ + TBool iStorageDataBackup; + /** + * Shows if Backup of SCR is finished or not + * Own. + */ + TBool iScrDataBackup; + + /** + * Shows if Restore of storage data is finished or not + * Own. + */ + TBool iStorageDataRestore; + + /** + * Shows if Java version information is already written or not + * Own + */ + TBool iJavaVersionInfoWritten; + + /** + * Shows if its the first call to restore data or not. + * Own. + */ + TBool iFirstCallToRestoreBackupDataSection; + + /** + * Stores the uids of the midlets whose icons are to be backed up. + * Own. + */ + RArray iIconUidArray; + + /** + * The current index in the icon file array + * Own. + */ + TInt iIconFilePointer; + + /** + * Stores the current icon file for streaming + * This descriptor will be streamed at subsequent calls of + * GetBackupDataSectionL() + * Own. + */ + HBufC8* iIconDesc; + + /** + * Stores the current icon file being restored + * Own. + */ + HBufC8* iRestoreIconDesc; + + /** + * Size of the icon to be still read during restore + * Own. + */ + TInt32 iIconFileSizeLeft; + + /** + * Current index of iIconDesc + * Own. + */ + TInt iIconDescIndex; + + /** + * Holds the remaining bytes in the buffer + * Own + */ + + TInt iBufferSpaceLeft; + + /** + * Buffer for storing data size in restore + * Own. + */ + TBuf8<4> iSizeBuffer; +}; + + + +} //namespace backup +} //namespace java +#endif /* MIDP2BACKUPPLUGINUSIF_H_ */ diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javabackup/midp2backup_usif/src.s60/proxy.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/src.s60/proxy.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: This module contains the ECom plugin UID and mappings. +* +*/ + + +// system include files +#include +#include + +#include "midp2backupplugin.h" + + + +// Map the interface UIDs to implementation factory functions +const TImplementationProxy ImplementationTable[] = +{ + IMPLEMENTATION_PROXY_ENTRY(KBackupEcomImplUid, CMidp2BackupPlugin::NewL) +}; + +// Exported proxy for instantiation method resolution +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) +{ + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; +} + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/bld.inf --- a/javamanager/javacaptain/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -22,4 +22,6 @@ #include "extensionplugins/config/build/bld.inf" #include "extensionplugins/javacertstore/build/bld.inf" #include "extensionplugins/storageserver/build/bld.inf" -#include "extensionplugins/preinstallerstarter/build/bld.inf" +#include "extensionplugins/settingslistener/build/bld.inf" +#include "extensionplugins/preinstallerstarter/build/bld.inf" +#include "extensionplugins/autostarter/build/bld.inf" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/build/javacaptain_0x200211DC.mmp --- a/javamanager/javacaptain/build/javacaptain_0x200211DC.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/build/javacaptain_0x200211DC.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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.mmp @@ -54,7 +54,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../rtcplugins/midp/inc diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/autostarter/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/autostarter/build/bld.inf Mon Aug 23 16:38:44 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 +javacaptain_ext_autostarter_0x2002EA7E.mmp diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/autostarter/build/bwins/javacaptain_ext_autostarteru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/autostarter/build/bwins/javacaptain_ext_autostarteru.def Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?findDllMethod@@YAP6APAXXZPBD@Z @ 1 NONAME ; void * (*)(void) findDllMethod(char const *) + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/autostarter/build/eabi/javacaptain_ext_autostarteru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/autostarter/build/eabi/javacaptain_ext_autostarteru.def Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z13findDllMethodPKc @ 1 NONAME + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter.pro Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,26 @@ +# +# 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 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter_0x2002EA7E.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter_0x2002EA7E.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,139 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/autostarter/inc/autostarter.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/autostarter/inc/autostarter.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,65 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/autostarter/src.s60/autostarter.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/autostarter/src.s60/autostarter.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,328 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/autostarter/src.s60/lookup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/autostarter/src.s60/lookup.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: lookup +* +*/ + +#include //For strcmp + +#include "javasymbianoslayer.h" +#include "logger.h" + +#include "extensionplugininterface.h" + +using namespace java::captain; + +ExtensionPluginInterface* getExtensionPlugin(); + +EXPORT_C FuncPtr findDllMethod(const char* funcName) +{ + FuncPtr ptr = 0; + if (funcName) + { + if (strcmp(funcName, "getExtensionPlugin") == 0) + { + ptr = (FuncPtr)getExtensionPlugin; + } + } + else + { + ELOG(EJavaCaptain, + "scrupdater extensionplugin findDllMethod() funcName == null"); + } + return ptr; +} diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/boot/src/booteventprovider.cpp --- a/javamanager/javacaptain/extensionplugins/boot/src/booteventprovider.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/boot/src/booteventprovider.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -17,6 +17,8 @@ #include #include +#include +#include #include #include diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/config/build/javacaptain_ext_config_0x2002DC9E.mmp --- a/javamanager/javacaptain/extensionplugins/config/build/javacaptain_ext_config_0x2002DC9E.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/config/build/javacaptain_ext_config_0x2002DC9E.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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_config.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp --- a/javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -74,9 +74,13 @@ #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"); + mCore->loadExtensionPlugin("settingslistener"); } } // namespace captain diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore_0x2002DC9F.mmp --- a/javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore_0x2002DC9F.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore_0x2002DC9F.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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_javacertstore.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.cpp --- a/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -59,7 +59,7 @@ NextState(Initialize()); break; case EListTokenTypes: - NextState(ListTokenTypes()); + NextState(ListTokenTypesL()); break; case EOpenTokenType: NextState(OpenTokenType()); @@ -132,11 +132,11 @@ return true; } -bool SmartCardCryptoTokenReader::ListTokenTypes() +bool SmartCardCryptoTokenReader::ListTokenTypesL() { TCTTokenTypeAttribute att = { KCTRemovable , 1 }; - iSmartCardTokensAttributes.Append(att); - iSmartCardTokensInterfaces.Append(TUid::Uid(KInterfaceCertStore)); + iSmartCardTokensAttributes.AppendL(att); + iSmartCardTokensInterfaces.AppendL(TUid::Uid(KInterfaceCertStore)); TCTFindTokenTypesByInterfaceAndAttribute findByIAndA( iSmartCardTokensInterfaces.Array(), iSmartCardTokensAttributes.Array()); CCTTokenTypeInfo::ListL(iSmartCardTokenTypes, findByIAndA); diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.h --- a/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.h Mon Aug 23 16:38:44 2010 +0100 @@ -61,7 +61,7 @@ SmartCardCryptoTokenReader(); void ConstructL(); bool Initialize(); - bool ListTokenTypes(); + bool ListTokenTypesL(); bool OpenTokenType(); bool OpenToken(); bool GetTokenInterface(); diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/javasmartcardcertsunittests.mmp --- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/javasmartcardcertsunittests.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/javasmartcardcertsunittests.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -14,9 +14,8 @@ * Description: * */ -// #include + #include -//#include #include #include <../../../../../../inc/java_stdcpp_support_for_exe.hrh> diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp --- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -29,9 +29,6 @@ CAPABILITY CAP_ECOM_PLUGIN VENDORID VID_DEFAULT -systeminclude /epoc32/include -systeminclude /epoc32/include/ecom - sourcepath ../src source testsmartcardtokenplugin.cpp diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/src/101F5B72.rss --- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/src/101F5B72.rss Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/src/101F5B72.rss Mon Aug 23 16:38:44 2010 +0100 @@ -14,7 +14,7 @@ * Description: * */ -#include +#include #include // True diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/preinstallerstarter/build/bld.inf --- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -20,3 +20,4 @@ PRJ_MMPFILES javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp +#include "exports.inf" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/preinstallerstarter/build/exports.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/exports.inf Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,19 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp --- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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_preinstallerstarter.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstarter.h --- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstarter.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstarter.h Mon Aug 23 16:38:44 2010 +0100 @@ -33,7 +33,8 @@ class CoreInterface; -OS_NONSHARABLE_CLASS(PreinstallerStarter) : public EventConsumerInterface, +OS_NONSHARABLE_CLASS(PreinstallerStarter) : public CActive, + public EventConsumerInterface, public ExtensionPluginInterface { public: @@ -51,11 +52,19 @@ // 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 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstartermessages.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstartermessages.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,62 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/preinstallerstarter/src.s60/preinstallerstarter.cpp --- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/src.s60/preinstallerstarter.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/src.s60/preinstallerstarter.cpp Mon Aug 23 16:38:44 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" @@ -19,7 +19,9 @@ #include +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK #include // for RApaLsSession +#endif #include #include #include @@ -31,6 +33,7 @@ #include "coreinterface.h" #include "booteventprovidermessages.h" #include "mmceventprovidermessages.h" +#include "preinstallerstartermessages.h" #include "preinstallerstarter.h" @@ -52,19 +55,19 @@ using java::fileutils::DriveListenerInterface; /** - * Empty contructor + * Initialize member varaibles in constructor */ -PreinstallerStarter::PreinstallerStarter() : mCore(0) +PreinstallerStarter::PreinstallerStarter() : + CActive(EPriorityStandard), mCore(0), mPreinstaller(0) { - JELOG2(EJavaCaptain); } /** - * Empty destructor + * Destructor */ PreinstallerStarter::~PreinstallerStarter() { - JELOG2(EJavaCaptain); + DoCancel(); } /** @@ -72,8 +75,8 @@ */ void PreinstallerStarter::startPlugin(CoreInterface* core) { - JELOG2(EJavaCaptain); mCore = core; + CActiveScheduler::Add(this); } /** @@ -81,7 +84,6 @@ */ void PreinstallerStarter::stopPlugin() { - JELOG2(EJavaCaptain); mCore = 0; } @@ -90,7 +92,6 @@ */ EventConsumerInterface* PreinstallerStarter::getEventConsumer() { - JELOG2(EJavaCaptain); return this; } @@ -106,7 +107,6 @@ void PreinstallerStarter::event(const std::string& eventProvider, java::comms::CommsMessage& aMsg) { - JELOG2(EJavaCaptain); if (eventProvider == BOOT_EVENT_PROVIDER) { int bootType = NORMAL_BOOT_C; @@ -133,7 +133,9 @@ case FIRST_DEVICE_BOOT_C: case NORMAL_BOOT_C: { +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK registerMidletApplicationTypeHandler(); +#endif // Start preinstaller normally (without 'iad' option). startPreinstaller(EFalse); @@ -183,8 +185,6 @@ */ 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,17 +276,21 @@ } // start preinstaller - RProcess preinstaller; + mPreinstaller = new RProcess(); 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 = preinstaller.Create(preinstallerProcess, commandLine); + TInt err = mPreinstaller->Create(preinstallerProcess, commandLine); if (KErrNone == err) { - // process has been created, allow it to run - preinstaller.Resume(); - preinstaller.Close(); + // Process has been created. + + // This active object will be activated when preinstaller process exits + mPreinstaller->Logon(iStatus); + + // Allow the process to run + mPreinstaller->Resume(); if (aIadBoot) { LOG( @@ -298,9 +302,14 @@ { LOG(EJavaCaptain, EInfo, "PreinstallerStarter: started preinstaller"); } + + SetActive(); } else { + delete mPreinstaller; + mPreinstaller = 0; + ELOG1( EJavaCaptain, "PreinstallerStarter: starting preinstaller failed, err %d", @@ -313,6 +322,7 @@ * 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"); @@ -374,6 +384,37 @@ 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 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/scrupdater/inc/scrupdater.h --- a/javamanager/javacaptain/extensionplugins/scrupdater/inc/scrupdater.h Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,71 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ScrUpdater is Java Captain Symbian plugin that updates -* presence information of Java Applications in USIF SCR -* when removable drive is added or removed to the device. -* -*/ - -#ifndef SCRUPDATER_H -#define SCRUPDATER_H - -#include -#include - -#include "javaosheaders.h" - -#include "eventconsumerinterface.h" -#include "extensionplugininterface.h" - -namespace java -{ - -namespace captain -{ - -class CoreInterface; - -OS_NONSHARABLE_CLASS(ScrUpdater) : public EventConsumerInterface, - public ExtensionPluginInterface -{ -public: - ScrUpdater(); - virtual ~ScrUpdater(); - - // PluginInterface - virtual void startPlugin(CoreInterface* aCore); - virtual void stopPlugin(); - - // EventConsumerInterface - virtual void event(const std::string& eventProvider, - java::comms::CommsMessage& aMsg); - - // ExtensionPluginInterface methods - virtual EventConsumerInterface* getEventConsumer(); - -private: - void removeScrPresencesL(driveInfo *aInfo); - void addScrPresencesL(driveInfo *aInfo); - void initializeScrPresenceInfoL(); - - Usif::RSoftwareComponentRegistry *createScrL(); - - - CoreInterface* mCore; -}; - -} // namespace captain -} // namespace java - -#endif // SCRUPDATER_H diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/scrupdater/src.s60/lookup.cpp --- a/javamanager/javacaptain/extensionplugins/scrupdater/src.s60/lookup.cpp Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: lookup -* -*/ - -#include //For strcmp - -#include "javasymbianoslayer.h" -#include "logger.h" - -#include "extensionplugininterface.h" - -using namespace java::captain; - -ExtensionPluginInterface* getExtensionPlugin(); - -EXPORT_C FuncPtr findDllMethod(const char* funcName) -{ - JELOG2(EJavaCaptain); - FuncPtr ptr = 0; - if (funcName) - { - if (strcmp(funcName, "getExtensionPlugin") == 0) - { - ptr = (FuncPtr)getExtensionPlugin; - } - } - else - { - ELOG(EJavaCaptain, - "scrupdater extensionplugin findDllMethod() funcName == null"); - } - return ptr; -} diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/scrupdater/src.s60/scrupdater.cpp --- a/javamanager/javacaptain/extensionplugins/scrupdater/src.s60/scrupdater.cpp Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,705 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ScrUpdater is Java Captain Symbian plugin that updates -* presence information of Java Applications in USIF SCR -* when removable drive is added or removed to the device. -* -*/ - -#include -#include -#include - -#include "javaprocessconstants.h" -#include "javasymbianoslayer.h" -#include "javauids.h" -#include "logger.h" -#include "coreinterface.h" -#include "booteventprovidermessages.h" -#include "mmceventprovidermessages.h" - -#include "scrupdater.h" - -// Enable notifying AppArc for USIF Phase 2. -//#define RD_JAVA_USIF_NOTIFY_APP_ARC - - -using namespace Usif; - -/** - * Return pointer to ExtensionPluginInterface implementation for this - * extension dll - */ -java::captain::ExtensionPluginInterface* getExtensionPlugin() -{ - return new java::captain::ScrUpdater(); -} - -namespace java -{ -namespace captain -{ - -using java::fileutils::driveInfo; -using java::fileutils::DriveListenerInterface; - -/** - * Empty contructor - */ -ScrUpdater::ScrUpdater() : mCore(0) -{ -} - -/** - * Empty destructor - */ -ScrUpdater::~ScrUpdater() -{ -} - -/** - * Implement PluginInterface method - */ -void ScrUpdater::startPlugin(CoreInterface* core) -{ - LOG(EJavaCaptain, EInfo, "ScrUpdater plugin started"); - - mCore = core; -} - -/** - * Implement PluginInterface method - */ -void ScrUpdater::stopPlugin() -{ - mCore = 0; -} - -/** - * Implement ExtensionPluginInterface method - */ -EventConsumerInterface* ScrUpdater::getEventConsumer() -{ - return this; -} - -/** - * Handle Java Captain events sent by Boot event provider or - * MMC event provider. - * - * Implement EventConsumerInterface method - */ -void ScrUpdater::event(const std::string& eventProvider, - java::comms::CommsMessage& aMsg) -{ - if (eventProvider == BOOT_EVENT_PROVIDER) - { - int bootType = NORMAL_BOOT_C; - getBootMessageParams(aMsg, bootType); - LOG1( - EJavaCaptain, - EInfo, - "ScrUpdater::event() boot event received (type=%d)", - bootType); - switch (bootType) - { - case IAD_BOOT_C: - case FIRST_DEVICE_BOOT_C: - case NORMAL_BOOT_C: - { - // Update presence information - TRAPD(err, initializeScrPresenceInfoL()) - if (KErrNone != err) - { - ELOG1(EJavaCaptain, "initializeScrPresenceInfoL: leaved (%d)", err); - } - } - break; - - default: - { - WLOG1(EJavaCaptain, - "DriveListenerInterface: event() unknown boot event (type=%d)", bootType); - } - break; - } - } - else if (eventProvider == MMC_EVENT_PROVIDER) - { - int operation = 0; - driveInfo di; - getMmcChangedMessageParams(aMsg, operation, di); - LOG1( - EJavaCaptain, - EInfo, - "ScrUpdater::event() mmc event received (operation=%d)", - operation); - - switch (operation) - { - case DriveListenerInterface::REMOVABLE_MEDIA_REMOVED_C: - { - // All Java applications in the removed drive are set - // to 'not present' state - TRAPD(err, removeScrPresencesL(&di)); - if (KErrNone != err) - { - ELOG1(EJavaCaptain, "removeScrPresencesL leaved (%d)", err); - } - } - break; - - case DriveListenerInterface::REMOVABLE_MEDIA_INSERTED_C: - { - // Those Java applications in the drive to where the media - // (e.g. memory card) was added are set to 'present' state - // IF the media id is correct (in other words if the same - // memory card that they have been installed to is added - // to the drive). - TRAPD(err, addScrPresencesL(&di)); - if (KErrNone != err) - { - ELOG1(EJavaCaptain, "addScrPresencesL leaved (%d)", err); - } - } - break; - } - } -} - -/** - * Set the presence state of all Java applications installed - * to the removable drive specified in aInfo to not present - */ -void ScrUpdater::removeScrPresencesL(driveInfo *aInfo) -{ - __UHEAP_MARK; - LOG1WSTR(EJavaCaptain, EInfo, - "removeScrPresencesL: driveInfo root path is %s", aInfo->iRootPath); - - RSoftwareComponentRegistry *pScr = createScrL(); - CleanupStack::PushL(pScr); - - // Get ids of all Java components in scr - RArray componentIdList; - CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); - pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); - - pScr->GetComponentIdsL(componentIdList); - CleanupStack::PopAndDestroy(pJavaSwTypeFilter); - CleanupClosePushL(componentIdList); - - // For each component check whether it has been installed - // to the removed drive - TInt nComponents = componentIdList.Count(); - TUint removedDrive = (TUint)(aInfo->iRootPath[0]); - // Now removedDrive contains the drive letter, convert it to drive number 0-25 - if ((removedDrive > 64) && (removedDrive < 91)) - { - // 'A' - 'Z' - removedDrive -= 65; - } - else if ((removedDrive > 96) && (removedDrive < 123)) - { - // 'a' - 'z' - removedDrive -= 97; - } - else - { - ELOG1WSTR(EJavaCaptain, - "removeScrPresencesL: Unexpected root path in remove drive info %s", - aInfo->iRootPath); - CleanupStack::PopAndDestroy(pScr); - return; - } - - LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, removed drive is %d", - nComponents, removedDrive); - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - // TEMP TEST - TBool fPresenceChange = EFalse; - RArray removedApps; - CleanupClosePushL(removedApps); -#endif - - for (TInt nInd = 0; nInd < nComponents; nInd++) - { - CComponentEntry *pEntry = CComponentEntry::NewLC(); - if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) - { - ELOG1(EJavaCaptain, - "removeScrPresencesL: SCR GetComponentIdsL returned id %d " - "but GetComponentL does not find it", componentIdList[nInd]); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - TInt nInstalledDrives = pEntry->InstalledDrives().Length(); - if (nInstalledDrives <= removedDrive) - { - // SCR InstalledDrives should be array of 26 elements (value 0 or 1) - ELOG2(EJavaCaptain, - "removeScrPresencesL: The length of InstalledDrives array (%d) " - "is smaller than removedDrive (%d)", nInstalledDrives, removedDrive); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]); - - if (pEntry->InstalledDrives()[removedDrive]) - { - // This component has been installed to the drive - // that has just been removed - pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); - - LOG1(EJavaCaptain, EInfo, - "removeScrPresencesL: set component %d to not present", - componentIdList[nInd]); - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - fPresenceChange = ETrue; - - // Gather the Uids of all applications that are no longer present - RArray appsInComponent; - CleanupClosePushL(appsInComponent); - pScr->GetAppUidsForComponentL( - componentIdList[nInd], appsInComponent); - for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++) - { - TApaAppUpdateInfo appInfo; - appInfo.iAppUid = appsInComponent[nInd2]; - appInfo.iAction = TApaAppUpdateInfo::EAppNotPresent; - (void)removedApps.Append(appInfo); - } - CleanupStack::PopAndDestroy(&appsInComponent); -#endif - } - - CleanupStack::PopAndDestroy(pEntry); - } - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - // Tell AppArc which applications are no longer present - while (fPresenceChange) - { - if (removedApps.Count() == 0) - { - ELOG(EJavaCaptain, "removeScrPresencesL: Uids of the removed apps are not known"); - break; - } - - RApaLsSession apaSession; - TInt err = apaSession.Connect(); - if (KErrNone != err) - { - ELOG1(EJavaCaptain, "removeScrPresencesL: Error %d when connecting AppArc", err); - break; - } - else - { - CleanupClosePushL(apaSession); - apaSession.UpdateAppListL(removedApps); - CleanupStack::PopAndDestroy(); // closes apaSession - fPresenceChange = EFalse; - } - } - - CleanupStack::PopAndDestroy(); // Close removedApps -#endif - CleanupStack::PopAndDestroy(); // Close componentIdList - CleanupStack::PopAndDestroy(pScr); - __UHEAP_MARKEND; -} - - -/** - * Set the presence state of all Java applications installed - * to the removable drive specified in aInfo to present - */ -void ScrUpdater::addScrPresencesL(driveInfo *aInfo) -{ - __UHEAP_MARK; - LOG1WSTR(EJavaCaptain, EInfo, - "addScrPresencesL: driveInfo root path is %s", aInfo->iRootPath); - - RSoftwareComponentRegistry *pScr = createScrL(); - CleanupStack::PushL(pScr); - - // Get ids of all Java components in scr - RArray componentIdList; - CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); - pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); - - pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter); - CleanupStack::PopAndDestroy(pJavaSwTypeFilter); - CleanupClosePushL(componentIdList); - - - // For each component check whether it has been installed - // to the added drive AND whether the media id is correct - // (in other words if the actual memory card where the component - // has been installed to is added to the drive). - TInt nComponents = componentIdList.Count(); - TUint addedMediaId = (TUint)(aInfo->iId); - TUint addedDrive = (TUint)(aInfo->iRootPath[0]); - // Now addedDrive contains the drive letter, convert it to drive number 0-25 - if ((addedDrive > 64) && (addedDrive < 91)) - { - // 'A' - 'Z' - addedDrive -= 65; - } - else if ((addedDrive > 96) && (addedDrive < 123)) - { - // 'a' - 'z' - addedDrive -= 97; - } - else - { - ELOG1WSTR(EJavaCaptain, - "addScrPresencesL: Unexpected root path in add drive info %s", - aInfo->iRootPath); - CleanupStack::PopAndDestroy(pScr); - return; - } - - LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, added drive is %d", - nComponents, addedDrive); - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - TBool fPresenceChange = EFalse; - RArray addedApps; - CleanupClosePushL(addedApps); -#endif - - for (TInt nInd = 0; nInd < nComponents; nInd++) - { - CComponentEntry *pEntry = CComponentEntry::NewLC(); - if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) - { - ELOG1(EJavaCaptain, - "addScrPresencesL: SCR GetComponentIdsL returned id %d " - "but GetComponentL does not find it", componentIdList[nInd]); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - // When Java Installer registers Java app to SCR it stores also - // the media id using SetComponentPropertyL(TComponentId aComponentId, - // _L("Media-Id")), TInt64 aValue); (aValue is actually 32 bit int) - CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *) - pScr->GetComponentPropertyL(componentIdList[nInd],_L("Media-Id")); - if (NULL == pMediaIdProperty) - { - ELOG1(EJavaCaptain, - "addScrPresencesL: media_id property not found for component %d", - componentIdList[nInd]); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - CleanupStack::PushL(pMediaIdProperty); - - TInt nInstalledDrives = pEntry->InstalledDrives().Length(); - if (nInstalledDrives <= addedDrive) - { - // SCR InstalledDrives should be array of 26 elements (value 0 or 1) - ELOG2(EJavaCaptain, - "addScrPresencesL: The length of InstalledDrives array (%d) " - "is smaller than addedDrive (%d)", nInstalledDrives, addedDrive); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]); - - if (pEntry->InstalledDrives()[addedDrive]) - { - // This component has been installed to the drive - // that has just been added. - // Now check whether the media id of the added media - // is OK for this component. - if (addedMediaId == pMediaIdProperty->IntValue()) - { - pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue); - - LOG1(EJavaCaptain, EInfo, - "addScrPresencesL: set component %d to present", - componentIdList[nInd]); - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - fPresenceChange = ETrue; - - // Gather the Uids of all 'new' applications that are now present - RArray appsInComponent; - CleanupClosePushL(appsInComponent); - pScr->GetAppUidsForComponentL( - componentIdList[nInd], appsInComponent); - for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++) - { - TApaAppUpdateInfo appInfo; - appInfo.iAppUid = appsInComponent[nInd2]; - appInfo.iAction = TApaAppUpdateInfo::EAppPresent; - (void)addedApps.Append(appInfo); - } - CleanupStack::PopAndDestroy(&appsInComponent); -#endif - } - } - - CleanupStack::PopAndDestroy(pMediaIdProperty); - CleanupStack::PopAndDestroy(pEntry); - } - -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC - // Tell AppArc which 'new' applications are now present - while (fPresenceChange) - { - if (addedApps.Count() == 0) - { - ELOG(EJavaCaptain, "addScrPresencesL: Uids of the 'new' apps are not known"); - break; - } - - RApaLsSession apaSession; - TInt err = apaSession.Connect(); - if (KErrNone != err) - { - ELOG1(EJavaCaptain, "addScrPresencesL: Error %d when connecting AppArc", err); - break; - } - else - { - CleanupClosePushL(apaSession); - apaSession.UpdateAppListL(addedApps); - CleanupStack::PopAndDestroy(); // closes apaSession - fPresenceChange = EFalse; - } - } - - CleanupStack::PopAndDestroy(); // Close addedApps -#endif - CleanupStack::PopAndDestroy(); // Close componentIdList - CleanupStack::PopAndDestroy(pScr); - __UHEAP_MARKEND; -} - - -/** - * Loop through all removable drives and get the media id of - * the memory card or other removable media in the drive and update - * presence information of all Java applications installed - * to removable drives accordingly. - */ -void ScrUpdater::initializeScrPresenceInfoL() -{ - __UHEAP_MARK; - RFs fs; - User::LeaveIfError(fs.Connect()); - CleanupClosePushL(fs); - - // Which drives are present and what is the media id of - // each removable volume - TInt err = KErrNone; - TInt err2 = KErrNone; - TBool drivePresent[EDriveZ + 1]; - TUint driveMediaId[EDriveZ + 1]; - TVolumeInfo volumeInfo; - TDriveInfo driveInfo; - - for (TInt nInd = EDriveA; nInd < EDriveZ; nInd++) - { - err = fs.Volume(volumeInfo, nInd); - if (KErrNone == err) - { - drivePresent[nInd] = ETrue; - driveMediaId[nInd] = volumeInfo.iUniqueID; - // If the media is not removable, media id is not checked - err2 = fs.Drive(driveInfo, nInd); - if (KErrNone != err2) - { - ELOG1(EJavaCaptain, - "initializeScrPresenceInfoL: error (%d) when trying to get drive info", - err2); - User::Leave(err2); - } - else - { - if (!(driveInfo.iDriveAtt & KDriveAttRemovable)) - { - driveMediaId[nInd] = 0; - } - } - } - else if (KErrNotReady == err) - { - // no volume in this drive - drivePresent[nInd] = EFalse; - driveMediaId[nInd] = 0; - } - else - { - ELOG1(EJavaCaptain, - "initializeScrPresenceInfoL: error (%d) when trying to get volume info", - err); - User::Leave(err); - } - } - CleanupStack::PopAndDestroy(); // close RFs - - - RSoftwareComponentRegistry *pScr = createScrL(); - CleanupStack::PushL(pScr); - - // Get ids of all Java components in scr - RArray componentIdList; - CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); - pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); - - pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter); - CleanupStack::PopAndDestroy(pJavaSwTypeFilter); - CleanupClosePushL(componentIdList); - - // For each component check whether the drive it has been installed - // to is present AND whether the media id is correct - TInt nComponents = componentIdList.Count(); - - LOG1(EJavaCaptain, EInfo, "initializeScrPresenceInfoL: Number of Java components is %d", - nComponents); - - for (TInt nInd = 0; nInd < nComponents; nInd++) - { - CComponentEntry *pEntry = CComponentEntry::NewLC(); - if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) - { - ELOG1(EJavaCaptain, - "initializeScrPresenceInfoL: SCR GetComponentIdsL returned id %d " - "but GetComponentL does not find it", componentIdList[nInd]); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *) - pScr->GetComponentPropertyL(componentIdList[nInd],_L("Media-Id")); - if (NULL == pMediaIdProperty) - { - ELOG1(EJavaCaptain, - "initializeScrPresenceInfoL: media_id property not found for component %d", - componentIdList[nInd]); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - CleanupStack::PushL(pMediaIdProperty); - - TInt nInstalledDrives = pEntry->InstalledDrives().Length(); - if (nInstalledDrives > (EDriveZ + 1)) - { - WLOG2(EJavaCaptain, - "initializeScrPresenceInfoL: too big (%d) installed drives array for " - "component %d", nInstalledDrives, componentIdList[nInd]); - nInstalledDrives = EDriveZ; - } - // When Java components are installed, only one installed drive - // and corresponding media id are registered. - TInt installationDrive = -1; - - for (TInt driveNumber = EDriveA; driveNumber < nInstalledDrives; driveNumber++) - { - if (pEntry->InstalledDrives()[driveNumber]) - { - installationDrive = driveNumber; - break; - } - } - - if (installationDrive == -1) - { - ELOG1(EJavaCaptain, - "initializeScrPresenceInfoL: component (id %d) did not have installed drive info", - componentIdList[nInd]); - CleanupStack::PopAndDestroy(pMediaIdProperty); - CleanupStack::PopAndDestroy(pEntry); - continue; - } - - if (drivePresent[installationDrive]) - { - // Check also the media id - if (driveMediaId[installationDrive] == pMediaIdProperty->IntValue()) - { - LOG1(EJavaCaptain, EInfo, - "initializeScrPresenceInfoL: set component %d to present", - componentIdList[nInd]); - - pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue); - } - else - { - LOG1(EJavaCaptain, EInfo, - "initializeScrPresenceInfoL: set component %d to NOT present", - componentIdList[nInd]); - - pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); - } - } - else - { - LOG1(EJavaCaptain, EInfo, - "initializeScrPresenceInfoL: set component %d to NOT present", - componentIdList[nInd]); - - // drive is not present -> Java component installed to that - // drive is not present - pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); - } - - CleanupStack::PopAndDestroy(pMediaIdProperty); - CleanupStack::PopAndDestroy(pEntry); - } - - CleanupStack::PopAndDestroy(); // Close componentIdList - CleanupStack::PopAndDestroy(pScr); // Also closes RSoftwareComponentRegistry - - __UHEAP_MARKEND; -} - - -/** - * Creates an instance of RSoftwareComponentRegistry and connects to it. - */ -RSoftwareComponentRegistry *ScrUpdater::createScrL() -{ - RSoftwareComponentRegistry *pScr = new RSoftwareComponentRegistry; - if (NULL == pScr) - { - ELOG(EJavaInstaller, - "CreateScrL: Creating RSoftwareComponentRegistry failed"); - User::Leave(KErrGeneral); - } - TInt err = pScr->Connect(); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "CreateScrL: Connecting to RSoftwareComponentRegistry failed, error %d", - err); - delete pScr; - User::Leave(err); - } - - return pScr; -} - - -} // namespace captain -} // namespace java diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/scrupdater/src/lookup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/scrupdater/src/lookup.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: lookup +* +*/ + +#include //For strcmp + +#include "javasymbianoslayer.h" +#include "logger.h" + +#include "extensionplugininterface.h" + +using namespace java::captain; + +ExtensionPluginInterface* getExtensionPlugin(); + +EXPORT_C FuncPtr findDllMethod(const char* funcName) +{ + FuncPtr ptr = 0; + if (funcName) + { + if (strcmp(funcName, "getExtensionPlugin") == 0) + { + ptr = (FuncPtr)getExtensionPlugin; + } + } + else + { + ELOG(EJavaCaptain, + "scrupdater extensionplugin findDllMethod() funcName == null"); + } + return ptr; +} diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,666 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ScrUpdater is Java Captain Symbian plugin that updates +* presence information of Java Applications in USIF SCR +* when removable drive is added or removed to the device. +* +*/ + +#include +#include +#include + +#include "javaprocessconstants.h" +#include "javasymbianoslayer.h" +#include "javauids.h" +#include "logger.h" +#include "coreinterface.h" +#include "booteventprovidermessages.h" +#include "mmceventprovidermessages.h" + +#include "scrupdater.h" + +using namespace Usif; + +_LIT(KMediaId, "Media-Id"); + +/** + * Return pointer to ExtensionPluginInterface implementation for this + * extension dll + */ +java::captain::ExtensionPluginInterface* getExtensionPlugin() +{ + return new java::captain::ScrUpdater(); +} + +namespace java // codescanner::namespace +{ +namespace captain // codescanner::namespace +{ + +using java::fileutils::driveInfo; +using java::fileutils::DriveListenerInterface; + +/** + * Empty contructor + */ +ScrUpdater::ScrUpdater() +{ +} + +/** + * Empty destructor + */ +ScrUpdater::~ScrUpdater() +{ +} + +/** + * Implement PluginInterface method + */ +void ScrUpdater::startPlugin(CoreInterface* /* aCore */) +{ + LOG(EJavaCaptain, EInfo, "ScrUpdater plugin started"); +} + +/** + * Implement PluginInterface method + */ +void ScrUpdater::stopPlugin() +{ +} + +/** + * Implement ExtensionPluginInterface method + */ +EventConsumerInterface* ScrUpdater::getEventConsumer() +{ + return this; +} + +/** + * Handle Java Captain events sent by Boot event provider or + * MMC event provider. + * + * Implement EventConsumerInterface method + */ +void ScrUpdater::event(const std::string& aEventProvider, + java::comms::CommsMessage& aMsg) +{ + if (aEventProvider == BOOT_EVENT_PROVIDER) + { + int bootType = NORMAL_BOOT_C; + getBootMessageParams(aMsg, bootType); + LOG1( + EJavaCaptain, + EInfo, + "ScrUpdater::event() boot event received (type=%d)", + bootType); + switch (bootType) + { + case IAD_BOOT_C: + case FIRST_DEVICE_BOOT_C: + case NORMAL_BOOT_C: + { + // Update presence information + TRAPD(err, initializeScrPresenceInfoL()) + if (KErrNone != err) + { + ELOG1(EJavaCaptain, "initializeScrPresenceInfoL: leaved (%d)", err); + } + } + break; + + default: + { + WLOG1(EJavaCaptain, + "DriveListenerInterface: event() unknown boot event (type=%d)", bootType); + } + break; + } + } + else if (aEventProvider == MMC_EVENT_PROVIDER) + { + int operation = 0; + driveInfo di; + getMmcChangedMessageParams(aMsg, operation, di); + LOG1( + EJavaCaptain, + EInfo, + "ScrUpdater::event() mmc event received (operation=%d)", + operation); + + switch (operation) + { + case DriveListenerInterface::REMOVABLE_MEDIA_REMOVED_C: + { + // All Java applications in the removed drive are set + // to 'not present' state + TRAPD(err, removeScrPresencesL(&di)); + if (KErrNone != err) + { + ELOG1(EJavaCaptain, "removeScrPresencesL leaved (%d)", err); + } + } + break; + + case DriveListenerInterface::REMOVABLE_MEDIA_INSERTED_C: + { + // Those Java applications in the drive to where the media + // (e.g. memory card) was added are set to 'present' state + // IF the media id is correct (in other words if the same + // memory card that they have been installed to is added + // to the drive). + TRAPD(err, addScrPresencesL(&di)); + if (KErrNone != err) + { + ELOG1(EJavaCaptain, "addScrPresencesL leaved (%d)", err); + } + } + break; + } + } +} + +/** + * Set the presence state of all Java applications installed + * to the removable drive specified in aInfo to not present + */ +void ScrUpdater::removeScrPresencesL(driveInfo *aInfo) +{ + __UHEAP_MARK; + LOG1WSTR(EJavaCaptain, EInfo, + "removeScrPresencesL: driveInfo root path is %s", aInfo->iRootPath); + + RSoftwareComponentRegistry *pScr = createScrL(); + CleanupStack::PushL(pScr); + + // Get ids of all Java components in scr + RArray componentIdList; + CleanupClosePushL(componentIdList); + + CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); + pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); + + pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter); + CleanupStack::PopAndDestroy(pJavaSwTypeFilter); + + // For each component check whether it has been installed + // to the removed drive + TInt nComponents = componentIdList.Count(); + TUint removedDrive = (TUint)(aInfo->iRootPath[0]); + // Now removedDrive contains the drive letter, convert it to drive number 0-25 + if ((removedDrive > 64) && (removedDrive < 91)) // codescanner::magicnumbers + { + // 'A' - 'Z' + removedDrive -= 65; // codescanner::magicnumbers + } + else if ((removedDrive > 96) && (removedDrive < 123)) // codescanner::magicnumbers + { + // 'a' - 'z' + removedDrive -= 97; // codescanner::magicnumbers + } + else + { + ELOG1WSTR(EJavaCaptain, + "removeScrPresencesL: Unexpected root path in remove drive info %s", + aInfo->iRootPath); + CleanupStack::PopAndDestroy(pScr); + return; + } + + LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, removed drive is %d", + nComponents, removedDrive); + + RArray removedApps; + CleanupClosePushL(removedApps); + + for (TInt nInd = 0; nInd < nComponents; nInd++) + { + CComponentEntry *pEntry = CComponentEntry::NewLC(); + if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) + { + ELOG1(EJavaCaptain, + "removeScrPresencesL: SCR GetComponentIdsL returned id %d " + "but GetComponentL does not find it", componentIdList[nInd]); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + TInt nInstalledDrives = pEntry->InstalledDrives().Length(); + if (nInstalledDrives <= removedDrive) + { + // SCR InstalledDrives should be array of 26 elements (value 0 or 1) + ELOG2(EJavaCaptain, + "removeScrPresencesL: The length of InstalledDrives array (%d) " + "is smaller than removedDrive (%d)", nInstalledDrives, removedDrive); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]); + + if (pEntry->InstalledDrives()[removedDrive]) + { + // This component has been installed to the drive + // that has just been removed + pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); + + LOG1(EJavaCaptain, EInfo, + "removeScrPresencesL: set component %d to not present", + componentIdList[nInd]); + + // Gather the Uids of all applications that are no longer present + RArray appsInComponent; + CleanupClosePushL(appsInComponent); + pScr->GetAppUidsForComponentL( + componentIdList[nInd], appsInComponent); + for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++) + { + TApaAppUpdateInfo appInfo; + appInfo.iAppUid = appsInComponent[nInd2]; + appInfo.iAction = TApaAppUpdateInfo::EAppNotPresent; + removedApps.AppendL(appInfo); + } + CleanupStack::PopAndDestroy(&appsInComponent); + } + + CleanupStack::PopAndDestroy(pEntry); + } + + // Tell AppArc which applications are no longer present + if (removedApps.Count() > 0) + { + RApaLsSession apaSession; + TInt err = apaSession.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaCaptain, "removeScrPresencesL: Error %d when connecting AppArc", err); + } + else + { + CleanupClosePushL(apaSession); + apaSession.UpdateAppListL(removedApps); + CleanupStack::PopAndDestroy(); // closes apaSession + } + } + + CleanupStack::PopAndDestroy(); // Close removedApps + CleanupStack::PopAndDestroy(); // Close componentIdList + CleanupStack::PopAndDestroy(pScr); + __UHEAP_MARKEND; +} + + +/** + * Set the presence state of all Java applications installed + * to the removable drive specified in aInfo to present + */ +void ScrUpdater::addScrPresencesL(driveInfo *aInfo) +{ + __UHEAP_MARK; + LOG1WSTR(EJavaCaptain, EInfo, + "addScrPresencesL: driveInfo root path is %s", aInfo->iRootPath); + + RSoftwareComponentRegistry *pScr = createScrL(); + CleanupStack::PushL(pScr); + + // Get ids of all Java components in scr + RArray componentIdList; + CleanupClosePushL(componentIdList); + + CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); + pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); + + pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter); + CleanupStack::PopAndDestroy(pJavaSwTypeFilter); + + // For each component check whether it has been installed + // to the added drive AND whether the media id is correct + // (in other words if the actual memory card where the component + // has been installed to is added to the drive). + TInt nComponents = componentIdList.Count(); + TUint addedMediaId = (TUint)(aInfo->iId); + TUint addedDrive = (TUint)(aInfo->iRootPath[0]); + // Now addedDrive contains the drive letter, convert it to drive number 0-25 + if ((addedDrive > 64) && (addedDrive < 91)) // codescanner::magicnumbers + { + // 'A' - 'Z' + addedDrive -= 65; // codescanner::magicnumbers + } + else if ((addedDrive > 96) && (addedDrive < 123)) // codescanner::magicnumbers + { + // 'a' - 'z' + addedDrive -= 97; // codescanner::magicnumbers + } + else + { + ELOG1WSTR(EJavaCaptain, + "addScrPresencesL: Unexpected root path in add drive info %s", + aInfo->iRootPath); + CleanupStack::PopAndDestroy(pScr); + return; + } + + LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, added drive is %d", + nComponents, addedDrive); + + RArray addedApps; + CleanupClosePushL(addedApps); + + for (TInt nInd = 0; nInd < nComponents; nInd++) + { + CComponentEntry *pEntry = CComponentEntry::NewLC(); + if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) + { + ELOG1(EJavaCaptain, + "addScrPresencesL: SCR GetComponentIdsL returned id %d " + "but GetComponentL does not find it", componentIdList[nInd]); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + // When Java Installer registers Java app to SCR it stores also + // the media id using SetComponentPropertyL(TComponentId aComponentId, + // _L("Media-Id"), TInt64 aValue); (aValue is actually 32 bit int) + CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *) + pScr->GetComponentPropertyL(componentIdList[nInd], KMediaId); + if (NULL == pMediaIdProperty) + { + ELOG1(EJavaCaptain, + "addScrPresencesL: media_id property not found for component %d", + componentIdList[nInd]); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + CleanupStack::PushL(pMediaIdProperty); + + TInt nInstalledDrives = pEntry->InstalledDrives().Length(); + if (nInstalledDrives <= addedDrive) + { + // SCR InstalledDrives should be array of 26 elements (value 0 or 1) + ELOG2(EJavaCaptain, + "addScrPresencesL: The length of InstalledDrives array (%d) " + "is smaller than addedDrive (%d)", nInstalledDrives, addedDrive); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]); + + if (pEntry->InstalledDrives()[addedDrive]) + { + // This component has been installed to the drive + // that has just been added. + // Now check whether the media id of the added media + // is OK for this component. + if (addedMediaId == pMediaIdProperty->IntValue()) + { + pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue); + + LOG1(EJavaCaptain, EInfo, + "addScrPresencesL: set component %d to present", + componentIdList[nInd]); + + // Gather the Uids of all 'new' applications that are now present + RArray appsInComponent; + CleanupClosePushL(appsInComponent); + pScr->GetAppUidsForComponentL( + componentIdList[nInd], appsInComponent); + for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++) + { + TApaAppUpdateInfo appInfo; + appInfo.iAppUid = appsInComponent[nInd2]; + appInfo.iAction = TApaAppUpdateInfo::EAppPresent; + addedApps.AppendL(appInfo); + } + CleanupStack::PopAndDestroy(&appsInComponent); + } + } + + CleanupStack::PopAndDestroy(pMediaIdProperty); + CleanupStack::PopAndDestroy(pEntry); + } + + // Tell AppArc which 'new' applications are now present + if (addedApps.Count() > 0) + { + RApaLsSession apaSession; + TInt err = apaSession.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaCaptain, "addScrPresencesL: Error %d when connecting AppArc", err); + } + else + { + CleanupClosePushL(apaSession); + apaSession.UpdateAppListL(addedApps); + CleanupStack::PopAndDestroy(); // closes apaSession + } + } + + CleanupStack::PopAndDestroy(); // Close addedApps + CleanupStack::PopAndDestroy(); // Close componentIdList + CleanupStack::PopAndDestroy(pScr); + __UHEAP_MARKEND; +} + + +/** + * Loop through all removable drives and get the media id of + * the memory card or other removable media in the drive and update + * presence information of all Java applications installed + * to removable drives accordingly. + */ +void ScrUpdater::initializeScrPresenceInfoL() +{ + __UHEAP_MARK; + RFs fs; // codescanner::rfs + User::LeaveIfError(fs.Connect()); + CleanupClosePushL(fs); + + // Which drives are present and what is the media id of + // each removable volume + TInt err = KErrNone; + TInt err2 = KErrNone; + TBool drivePresent[EDriveZ + 1]; + TUint driveMediaId[EDriveZ + 1]; + TVolumeInfo volumeInfo; + TDriveInfo driveInfo; + + for (TInt nInd = EDriveA; nInd < EDriveZ; nInd++) + { + err = fs.Volume(volumeInfo, nInd); + if (KErrNone == err) + { + drivePresent[nInd] = ETrue; // codescanner::accessArrayElementWithoutCheck2 + driveMediaId[nInd] = volumeInfo.iUniqueID; // codescanner::accessArrayElementWithoutCheck2 + // If the media is not removable, media id is not checked + err2 = fs.Drive(driveInfo, nInd); + if (KErrNone != err2) + { + ELOG1(EJavaCaptain, + "initializeScrPresenceInfoL: error (%d) when trying to get drive info", + err2); + User::Leave(err2); + } + else + { + if (!(driveInfo.iDriveAtt & KDriveAttRemovable)) + { + driveMediaId[nInd] = 0; // codescanner::accessArrayElementWithoutCheck2 + } + } + } + else if (KErrNotReady == err) + { + // no volume in this drive + drivePresent[nInd] = EFalse; // codescanner::accessArrayElementWithoutCheck2 + driveMediaId[nInd] = 0; // codescanner::accessArrayElementWithoutCheck2 + } + else + { + ELOG1(EJavaCaptain, + "initializeScrPresenceInfoL: error (%d) when trying to get volume info", + err); + User::Leave(err); + } + } + CleanupStack::PopAndDestroy(); // close RFs + + + RSoftwareComponentRegistry *pScr = createScrL(); + CleanupStack::PushL(pScr); + + // Get ids of all Java components in scr + RArray componentIdList; + CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC(); + pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava); + + pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter); + CleanupStack::PopAndDestroy(pJavaSwTypeFilter); + CleanupClosePushL(componentIdList); + + // For each component check whether the drive it has been installed + // to is present AND whether the media id is correct + TInt nComponents = componentIdList.Count(); + + LOG1(EJavaCaptain, EInfo, "initializeScrPresenceInfoL: Number of Java components is %d", + nComponents); + + for (TInt nInd = 0; nInd < nComponents; nInd++) + { + CComponentEntry *pEntry = CComponentEntry::NewLC(); + if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry))) + { + ELOG1(EJavaCaptain, + "initializeScrPresenceInfoL: SCR GetComponentIdsL returned id %d " + "but GetComponentL does not find it", componentIdList[nInd]); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *) + pScr->GetComponentPropertyL(componentIdList[nInd], KMediaId); + if (NULL == pMediaIdProperty) + { + ELOG1(EJavaCaptain, + "initializeScrPresenceInfoL: media_id property not found for component %d", + componentIdList[nInd]); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + CleanupStack::PushL(pMediaIdProperty); + + TInt nInstalledDrives = pEntry->InstalledDrives().Length(); + if (nInstalledDrives > (EDriveZ + 1)) + { + WLOG2(EJavaCaptain, + "initializeScrPresenceInfoL: too big (%d) installed drives array for " + "component %d", nInstalledDrives, componentIdList[nInd]); + nInstalledDrives = EDriveZ; + } + // When Java components are installed, only one installed drive + // and corresponding media id are registered. + TInt installationDrive = -1; + + for (TInt driveNumber = EDriveA; driveNumber < nInstalledDrives; driveNumber++) + { + if (pEntry->InstalledDrives()[driveNumber]) + { + installationDrive = driveNumber; + break; + } + } + + if (installationDrive == -1) + { + ELOG1(EJavaCaptain, + "initializeScrPresenceInfoL: component (id %d) did not have installed drive info", + componentIdList[nInd]); + CleanupStack::PopAndDestroy(pMediaIdProperty); + CleanupStack::PopAndDestroy(pEntry); + continue; + } + + if (drivePresent[installationDrive]) // codescanner::accessArrayElementWithoutCheck2 + { + // Check also the media id + if (driveMediaId[installationDrive] == pMediaIdProperty->IntValue()) // codescanner::accessArrayElementWithoutCheck2 + { + LOG1(EJavaCaptain, EInfo, + "initializeScrPresenceInfoL: set component %d to present", + componentIdList[nInd]); + + pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue); + } + else + { + LOG1(EJavaCaptain, EInfo, + "initializeScrPresenceInfoL: set component %d to NOT present", + componentIdList[nInd]); + + pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); + } + } + else + { + LOG1(EJavaCaptain, EInfo, + "initializeScrPresenceInfoL: set component %d to NOT present", + componentIdList[nInd]); + + // drive is not present -> Java component installed to that + // drive is not present + pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse); + } + + CleanupStack::PopAndDestroy(pMediaIdProperty); + CleanupStack::PopAndDestroy(pEntry); + } + + CleanupStack::PopAndDestroy(); // Close componentIdList + CleanupStack::PopAndDestroy(pScr); // Also closes RSoftwareComponentRegistry + + __UHEAP_MARKEND; +} + + +/** + * Creates an instance of RSoftwareComponentRegistry and connects to it. + */ +RSoftwareComponentRegistry *ScrUpdater::createScrL() +{ + RSoftwareComponentRegistry *pScr = new RSoftwareComponentRegistry; // codescanner::nonleavenew + if (NULL == pScr) + { + ELOG(EJavaInstaller, + "CreateScrL: Creating RSoftwareComponentRegistry failed"); + User::Leave(KErrGeneral); + } + TInt err = pScr->Connect(); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "CreateScrL: Connecting to RSoftwareComponentRegistry failed, error %d", + err); + delete pScr; + User::Leave(err); + } + + return pScr; +} + + +} // namespace captain +} // namespace java diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: ScrUpdater is Java Captain Symbian plugin that updates +* presence information of Java Applications in USIF SCR +* when removable drive is added or removed to the device. +* +*/ + +#ifndef SCRUPDATER_H +#define SCRUPDATER_H + +#include +#include + +#include "javaosheaders.h" + +#include "eventconsumerinterface.h" +#include "extensionplugininterface.h" + +namespace java // codescanner::namespace +{ + +namespace captain // codescanner::namespace +{ + +class CoreInterface; + +OS_NONSHARABLE_CLASS(ScrUpdater) : public EventConsumerInterface, + public ExtensionPluginInterface +{ +public: + ScrUpdater(); + virtual ~ScrUpdater(); + + // PluginInterface + virtual void startPlugin(CoreInterface* aCore); + virtual void stopPlugin(); + + // EventConsumerInterface + virtual void event(const std::string& aEventProvider, + java::comms::CommsMessage& aMsg); + + // ExtensionPluginInterface methods + virtual EventConsumerInterface* getEventConsumer(); + +private: + void removeScrPresencesL(driveInfo *aInfo); + void addScrPresencesL(driveInfo *aInfo); + void initializeScrPresenceInfoL(); + + Usif::RSoftwareComponentRegistry *createScrL(); +}; + +} // namespace captain +} // namespace java + +#endif // SCRUPDATER_H diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,23 @@ +/* +* 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_settingslistener_0x200315D8.mmp +#include "exports.inf" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/build/bwins/javacaptain_ext_settingslisteneru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/bwins/javacaptain_ext_settingslisteneru.def Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?findDllMethod@@YAP6APAXXZPBD@Z @ 1 NONAME ; void * (*)(void) findDllMethod(char const *) + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/build/eabi/javacaptain_ext_settingslisteneru.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/eabi/javacaptain_ext_settingslisteneru.def Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z13findDllMethodPKc @ 1 NONAME + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/build/exports.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/exports.inf Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,19 @@ +/* +* 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/settingschangeeventsprovidermessages.h |../../../inc/settingschangeeventsprovidermessages.h diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,29 @@ +# +# 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=lib +TARGET=javacaptain_ext_settingslistener +CONFIG += omj stl +CONFIG -= qt + +symbian { + LIBS += -lcommonengine \ + -lcentralrepository \ + -lcenrepnotifhandler \ + -ljavacomms +} + +include(../../../../../build/omj.pri) diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener_0x200315D8.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener_0x200315D8.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,146 @@ +/* +* 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_settingslistener.mmp +// ============================================================================== + +TARGET javacaptain_ext_settingslistener.dll +TARGETTYPE DLL + +UID 0x1000008d 0x200315D8 +SECUREID 0x200315D8 + +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 +SYSTEMINCLUDE ../src.s60 +SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 +SYSTEMINCLUDE /epoc32/include/mw +SYSTEMINCLUDE . + +SOURCEPATH ../src +SOURCE settingslistenerextension.cpp + +SOURCEPATH ../src.s60 +SOURCE cenreplistener.cpp +SOURCE lookup.cpp +SOURCE settingslistenerimpl.cpp + + +LIBRARY commonengine.lib +LIBRARY centralrepository.lib +LIBRARY cenrepnotifhandler.lib +LIBRARY javacomms.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 ./~/javacaptain_ext_settingslistener.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_settingslistener.def +#elif defined EABI +DEFFILE ./eabi/javacaptain_ext_settingslistener.def +#endif diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/inc/settingschangeeventsprovidermessages.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/inc/settingschangeeventsprovidermessages.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,70 @@ +/* +* 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: Definition of comms messages used for reporting chages in system +* settings. +* +*/ + +#ifndef SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H +#define SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H + +#include "commsmessage.h" +#include "logger.h" + +namespace java +{ +namespace captain +{ + +using namespace java::util; +using namespace java::comms; + +const int SETTINGS_CHANGE_EVENT_MESSAGE_ID_C = 1; + +const char* const SETTINGS_CHANGE_EVENT_PROVIDER = "settingslistener"; + +typedef enum +{ + UNDEFINED_CHANGE = 0x00, + MIDP_CLASS_PATH_CHANGE = 0x01, + +} SettingsChangeEventType_t; + + +inline void setSettingsChangeEventMessageParams(CommsMessage& aMessage, + const int& aChangeEventType) +{ + aMessage.setMessageId(SETTINGS_CHANGE_EVENT_MESSAGE_ID_C); + aMessage << aChangeEventType; +} + +inline void getSettingsChangeEventMessageParams(CommsMessage& aMessage, + int& aChangeEventType) +{ + if (aMessage.getMessageId() == SETTINGS_CHANGE_EVENT_MESSAGE_ID_C) + { + aMessage >> aChangeEventType; + } + else + { + ELOG2(EJavaCaptain, "Received Settings Change Event with wrong MessageId!: %d should be %d", + aMessage.getMessageId(), SETTINGS_CHANGE_EVENT_MESSAGE_ID_C); + aChangeEventType = UNDEFINED_CHANGE; + } +} + +} // namespace captain +} // namespace java + +#endif // SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/inc/settingslistenerextension.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/inc/settingslistenerextension.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Extension plugin which is used for monitoring changes in various +* system settings. +* +*/ + +#ifndef SETTINGSLISTENEREXTENSION_H +#define SETTINGSLISTENEREXTENSION_H + +#include "javaosheaders.h" + +#include "extensionplugininterface.h" +#include "settingslistenerinterface.h" + +namespace java +{ +namespace captain +{ + +class CoreInterface; + +OS_NONSHARABLE_CLASS(SettingsListenerExtension) : public ExtensionPluginInterface +{ +public: + SettingsListenerExtension(); + virtual ~SettingsListenerExtension(); + + // ExtensionPluginInterface + virtual void startPlugin(CoreInterface* aCore); + virtual void stopPlugin(); + +protected: + +private: + CoreInterface* mCore; // resource not owned + SettingsListenerInterface* mSettingsListenerImpl; // resource owned +}; + +} // namespace captain +} // namespace java + +#endif // SETTINGSLISTENEREXTENSION_H + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/inc/settingslistenerinterface.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/inc/settingslistenerinterface.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,42 @@ +/* +* 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: Definition of interface, which is used for listening changes in +* in system settings. +* +*/ + +#ifndef SETTINGSLISTENERINTERFACE_H +#define SETTINGSLISTENERINTERFACE_H + +namespace java +{ + +namespace captain +{ + +class SettingsListenerInterface +{ +public: + virtual ~SettingsListenerInterface() {} + + virtual void startListening() = 0; + virtual void stopListening() = 0; + +}; + +} // namespace captain +} // namespace java + +#endif // SETTINGSLISTENERINTERFACE_H + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/src.s60/cenreplistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/cenreplistener.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,116 @@ +/* +* 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 "coreinterface.h" +#include "eventconsumerinterface.h" + +#include "logger.h" +#include "cenreplistener.h" +#include "settingschangeeventsprovidermessages.h" + +namespace java +{ +namespace captain +{ + +// General listener used as a base value indicating that whole repository is being +// listened instead of individual key. +CenRepListener::CenRepListener() : mKeyType(CenRepListener::GENERAL_LISTENER) +{ +} + +CenRepListener::~CenRepListener() +{ + close(); +} + +void CenRepListener::close() +{ + if (mNotifyHandler) + { + mNotifyHandler->StopListening(); + delete mNotifyHandler; + mNotifyHandler = 0; + } + if (mCenRepSession) + { + delete mCenRepSession; + mCenRepSession = 0; + } +} + +CenRepListener* CenRepListener::NewL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType) +{ + CenRepListener* crListener = new(ELeave) CenRepListener(); + CleanupStack::PushL(crListener); + crListener->ConstructL(aCore, aRepoId, aKeyId, aKeyType); + CleanupStack::Pop(crListener); + return (crListener); +} + +void CenRepListener::ConstructL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType) +{ + mCore = aCore; + mRepoId = aRepoId; + mKeyType = aKeyType; + mCenRepSession = CRepository::NewL(mRepoId); + mNotifyHandler = CCenRepNotifyHandler::NewL(*this, *mCenRepSession, + aKeyType, aKeyId); + mNotifyHandler->StartListeningL(); +} + +void CenRepListener::HandleNotifyString(TUint32 aKeyId, const TDesC16& /*aNewValue*/) +{ + if (KCRUidJavaRuntime == mRepoId && KJavaRuntimeMIDPClasspath == aKeyId) + { + ILOG(EJavaCaptain, "CenRepListener::HandleNotifyString: change notified " + "in key KJavaRuntimeMIDPClasspath"); + dispatchEvent(SETTINGS_CHANGE_EVENT_PROVIDER, + MIDP_CLASS_PATH_CHANGE); + } + else + { + WLOG1(EJavaCaptain, "Change in Unrecognised cenrep string key noticed! " + "CR Key= %0x", aKeyId); + } +} + +void CenRepListener::HandleNotifyError(TUint32 aKeyId, TInt aError, CCenRepNotifyHandler* /* aHandler */) +{ + ELOG2(EJavaCaptain, "Error (code: %d) occured when listening changes on " + "Cenrep key (Key ID: %0x). Listening stopped!", aError, aKeyId); + close(); +} + +void CenRepListener::dispatchEvent(const std::string& aEvent, + const SettingsChangeEventType_t& aType) const +{ + ILOG2(EJavaCaptain, "CenRepListener::dispatchEvent: dispatching event=%s " + "type=%d", aEvent.c_str(), aType); + CommsMessage eventMsg; + setSettingsChangeEventMessageParams(eventMsg, aType); + mCore->getEventDispatcher()->event(aEvent, eventMsg); +} + +} // namespace captain +} // namespace java + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/src.s60/cenreplistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/cenreplistener.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class is used for listening changes in various Symbian Central +* repository keys. +* +*/ + +#ifndef CENREPLISTENER_H +#define CENREPLISTENER_H + +#include +#include + +#include "javaosheaders.h" +#include "settingschangeeventsprovidermessages.h" +#include "javaruntimeprivatecrkeys.h" + +namespace java +{ +namespace captain +{ + +class CoreInterface; + +OS_NONSHARABLE_CLASS(CenRepListener) : + public CBase, public MCenRepNotifyHandlerCallback +{ +public: + enum TListenerType {GENERAL_LISTENER = -1}; + + static CenRepListener* NewL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType); + + virtual ~CenRepListener(); + + // MCenRepNotifyHandlerCallback (only partial implementation needed here for now) + // These handler methods must know what to do in each case, i.e + // how to handle the change in each particular key. + virtual void HandleNotifyString(TUint32 aKeyId, const TDesC16& aNewValue); + virtual void HandleNotifyError(TUint32 aKeyId, TInt aError, + CCenRepNotifyHandler* aHandler); +protected: + CenRepListener(); + + void dispatchEvent(const std::string& aEvent, + const SettingsChangeEventType_t& aType) const; + +private: + void ConstructL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType); + void close(); + TInt mKeyType; + CoreInterface* mCore; + TUid mRepoId; + CCenRepNotifyHandler* mNotifyHandler; + CRepository* mCenRepSession; +}; + +} // namespace captain +} // namespace java + +#endif // CENREPLISTENER_H + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/src.s60/lookup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/lookup.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,45 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: lookup +* +*/ + +#include //For strcmp + +#include "javasymbianoslayer.h" +#include "logger.h" + +#include "extensionplugininterface.h" + +using namespace java::captain; + +ExtensionPluginInterface* getExtensionPlugin(); + +EXPORT_C FuncPtr findDllMethod(const char* funcName) +{ + JELOG2(EJavaCaptain); + FuncPtr ptr = 0; + if (funcName) + { + if (strcmp(funcName, "getExtensionPlugin") == 0) + { + ptr = (FuncPtr)getExtensionPlugin; + } + } + else + { + ELOG(EJavaCaptain, "settingslistener extensionplugin findDllMethod() funcName == null"); + } + return ptr; +} diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/src.s60/settingslistenerimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/settingslistenerimpl.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,86 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include "settingslistenerimpl.h" +#include "cenreplistener.h" +#include "logger.h" + +namespace java +{ +namespace captain +{ + +SettingsListenerImpl::SettingsListenerImpl(CoreInterface* aCore) : + mCore(aCore) +{ +} + +SettingsListenerImpl::~SettingsListenerImpl() +{ + cleanUp(); +} + +void SettingsListenerImpl::startListening() +{ + // All "listeners" must be created&started here. + + // Currently there is just this one CenRep key to be listened + TInt error = KErrNone; + CenRepListener* crMidpClassPathChangeListener = + createCenRepKeyListener(KCRUidJavaRuntime, KJavaRuntimeMIDPClasspath, + CCenRepNotifyHandler::EStringKey, error); + if (crMidpClassPathChangeListener) + { + mCenRepListeners.push_back(crMidpClassPathChangeListener); + } + else + { + ELOG4(EJavaCaptain, "Error (code: %d) occured when starting " + "CenRepListener (repo=%0x, key=%0x, keytype=%d)", + error, KCRUidJavaRuntime.iUid, KJavaRuntimeMIDPClasspath, + CCenRepNotifyHandler::EStringKey); + } +} + +void SettingsListenerImpl::stopListening() +{ + cleanUp(); +} + +CenRepListener* SettingsListenerImpl::createCenRepKeyListener(TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType, TInt& aErrorCode) +{ + CenRepListener* listener = NULL; + TRAP(aErrorCode, listener = CenRepListener::NewL(mCore, aRepoId, aKeyId, aKeyType)); + return listener; // Possible error propagated as a function parameter +} + +// Clean up owned resources +void SettingsListenerImpl::cleanUp() +{ + for (crListeners_t::iterator listenersIter = mCenRepListeners.begin(); + listenersIter != mCenRepListeners.end(); ++listenersIter) + { + delete *listenersIter; + *listenersIter = 0; + } + mCenRepListeners.clear(); +} + +} // namespace captain +} // namespace java + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/src.s60/settingslistenerimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/settingslistenerimpl.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Platform specific component which manages all the listeners +* listening changes in system configuration. Currently only Central +* Repository listening is supported. +* +*/ + +#ifndef SETTINGSLISTENERIMPL_H +#define SETTINGSLISTENERIMPL_H + +#include +#include +#include + +#include "javaosheaders.h" +#include "settingslistenerinterface.h" + +namespace java +{ +namespace captain +{ + +class CoreInterface; +class CenRepListener; + +OS_NONSHARABLE_CLASS(SettingsListenerImpl) : public SettingsListenerInterface +{ +public: + SettingsListenerImpl(CoreInterface* aCore); + virtual ~SettingsListenerImpl(); + + // SystemSettingsChangeListenerInterface + virtual void startListening(); + virtual void stopListening(); + +private: + void cleanUp(); + CenRepListener* createCenRepKeyListener(TUid aRepoId, TUint32 aKeyId, + CCenRepNotifyHandler::TCenRepKeyType aKeyType, + TInt& aErrorCode); + + CoreInterface* mCore; // resource not owned + typedef std::vector crListeners_t; + crListeners_t mCenRepListeners; // listeners are owned resources. + +}; + +} // namespace captain +} // namespace java + +#endif // SETTINGSLISTENERIMPL_H + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/settingslistener/src/settingslistenerextension.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/src/settingslistenerextension.cpp Mon Aug 23 16:38:44 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: Implementation for creating system settings listener plugin +* +*/ + +#include "logger.h" +#include "settingslistenerextension.h" +#include "settingslistenerimpl.h" + +#ifdef __SYMBIAN32__ +java::captain::ExtensionPluginInterface* getExtensionPlugin() +{ +#else +extern "C" java::captain::ExtensionPluginInterface* getExtensionPlugin() +{ +#endif + return new java::captain::SettingsListenerExtension(); +} + +namespace java +{ +namespace captain +{ + +SettingsListenerExtension::SettingsListenerExtension() : mCore(0), mSettingsListenerImpl(0) +{ +} + +SettingsListenerExtension::~SettingsListenerExtension() +{ +} + +void SettingsListenerExtension::startPlugin(CoreInterface* core) +{ + if (mSettingsListenerImpl || mCore) + { + WLOG(EJavaCaptain, "Settingslistener plugin already running, terminating previous instance first!"); + stopPlugin(); + } + mCore = core; + mSettingsListenerImpl = new SettingsListenerImpl(mCore); + mSettingsListenerImpl->startListening(); +} + +void SettingsListenerExtension::stopPlugin() +{ + mCore = 0; + if (mSettingsListenerImpl) + { + mSettingsListenerImpl->stopListening(); + delete mSettingsListenerImpl; + mSettingsListenerImpl = 0; + } +} + + +} // namespace captain +} // namespace java + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin_0x2002DCA3.mmp --- a/javamanager/javacaptain/extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin_0x2002DCA3.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin_0x2002DCA3.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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_storageserverplugin.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../src diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/inc.s60/tickerprovider.h --- a/javamanager/javacaptain/inc.s60/tickerprovider.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/inc.s60/tickerprovider.h Mon Aug 23 16:38:44 2010 +0100 @@ -43,7 +43,7 @@ virtual void cancel(); // Helpers -// virtual long long getCurrentJavaTime(); + virtual long long getPlatformCurrentJavaTime(); protected: // CActive diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/javacaptain.pro --- a/javamanager/javacaptain/javacaptain.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/javacaptain.pro Mon Aug 23 16:38:44 2010 +0100 @@ -18,5 +18,7 @@ SUBDIRS += extensionplugins/config/build/javacaptain_ext_config.pro SUBDIRS += extensionplugins/javacertstore/build/javacaptain_ext_javacertstore.pro SUBDIRS += extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin.pro +SUBDIRS += extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro SUBDIRS += extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter.pro +SUBDIRS += extensionplugins/autostarter/build/javacaptain_ext_autostarter.pro BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/src.s60/tickerprovider.cpp --- a/javamanager/javacaptain/src.s60/tickerprovider.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/src.s60/tickerprovider.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -91,8 +91,8 @@ } mNextTickAt = 0LL; } -/* -long long TickerProvider::getCurrentJavaTime() + +long long TickerProvider::getPlatformCurrentJavaTime() { JELOG2(EJavaCaptain); TTime currentTime; @@ -101,7 +101,7 @@ // Current time - javaEpoc && uSeconds -> mSeconds return (currentTime.Int64()- TTime(TDateTime(1970,EJanuary,0,0,0,0,0)).Int64()) / 1000LL; } -*/ + void TickerProvider::RunL() { JELOG2(EJavaCaptain); diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/src/rtc.cpp --- a/javamanager/javacaptain/src/rtc.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/src/rtc.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -36,6 +36,8 @@ #include "javastorage.h" #include "javastoragenames.h" +#include "settingschangeeventsprovidermessages.h" + #include "midprtcplugin.h" #ifdef RD_JAVA_CAPTAIN_TESTRUNTIME #include "testrtcplugin.h" @@ -498,15 +500,31 @@ } void Rtc::event(const std::string& eventProvider, - java::comms::CommsMessage& /* aMsg */) + java::comms::CommsMessage& aMsg ) { ILOG(EJavaCaptain, "+Rtc::event()"); if (BOOT_EVENT_PROVIDER == eventProvider) { if (mSupportPreWarming && isThereInstalledMidlets()) { - ILOG(EJavaCaptain, "Rtc::event() - Boot event received, Starting prewarm VM since found Installed MIDlets"); - launchPrewarm(); //New prewarm VM instance is will be created only if it did not exist already + ILOG(EJavaCaptain, "Rtc::event() - Boot event received, Starting " + "prewarm VM since found Installed MIDlets"); + launchPrewarm(); //New prewarm VM instance is will be created only + //if it did not exist already + } + } else if ( SETTINGS_CHANGE_EVENT_PROVIDER == eventProvider ) + { + int changeEventType = 0; + getSettingsChangeEventMessageParams(aMsg, changeEventType); + if ( MIDP_CLASS_PATH_CHANGE == changeEventType && + (mRuntimes.find(PREWARM_UID) != mRuntimes.end()) ) + { + // Java libraries have been modified in the system. + //Prewarm instance must be restarted + ILOG(EJavaCaptain, "Rtc::event() - Restarting prewarm VM instance " + "since MIDP classpath has changed"); + stopPrewarm(); + launchPrewarm(); } } } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/src/tickerproviderinterface.h --- a/javamanager/javacaptain/src/tickerproviderinterface.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/src/tickerproviderinterface.h Mon Aug 23 16:38:44 2010 +0100 @@ -64,6 +64,19 @@ // Helpers /** * Returns milliseconds from EPOCH. + * This can be overridden with the platform specific implementation. Use case for + * overriding is that in some platforms gettimeofday implementation can't handle + * correctly times after 2038. + * @param[in] - + * @return - milliseconds from EPOCH in success, -1 if fails + */ + virtual long long getPlatformCurrentJavaTime() + { + return -1LL; + } + + /** + * Returns milliseconds from EPOCH. * @param[in] - * @return - milliseconds from EPOCH in success, -1 if fails */ @@ -73,7 +86,8 @@ int err = gettimeofday(&tim, NULL); if (-1 == err) { - return -1LL; + WLOG(EJavaCaptain, "getCurrentJavaTime: gettimeofday returned -1"); + return getPlatformCurrentJavaTime(); } return (tim.tv_sec * 1000LL) + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/subsystem.mk --- a/javamanager/javacaptain/subsystem.mk Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/subsystem.mk Mon Aug 23 16:38:44 2010 +0100 @@ -22,6 +22,7 @@ extensionplugins/config/build \ extensionplugins/javacertstore/build \ extensionplugins/storageserver/build \ + extensionplugins/settingslistener/build \ $(LINUX_ONLY) @@ -35,6 +36,7 @@ endif COMPONENTS += extensionplugins/preinstallerstarter/build +COMPONENTS += extensionplugins/autostarter/build ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK COMPONENTS += extensionplugins/scrupdater/build endif diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javacaptain/systemams/src/certificatesmanager.cpp --- a/javamanager/javacaptain/systemams/src/certificatesmanager.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javacaptain/systemams/src/certificatesmanager.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -231,7 +231,7 @@ LazyInit(); iCurrentCertInfo = getTrustRootL(aId); RArray applications; - applications.Append(KMidletInstallApplicabilityUid); + applications.AppendL(KMidletInstallApplicabilityUid); iCertStore->SetApplicability(*iCurrentCertInfo, applications, iStatus); User::WaitForRequest(iStatus); if (iStatus.Int() == KErrNone) diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp --- a/javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -52,8 +52,6 @@ USERINCLUDE ../inc USERINCLUDE ../../../../inc -SYSTEMINCLUDE ../../../../inc - // Libraries LIBRARY charconv.lib LIBRARY cone.lib diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/appinstuiplugin/src/javainstalllauncher.cpp --- a/javamanager/javainstaller/appinstuiplugin/src/javainstalllauncher.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/appinstuiplugin/src/javainstalllauncher.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -228,7 +228,7 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - iHandlesToClose.Append(rJavaInstaller); + iHandlesToClose.AppendL(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.Append(rJavaInstaller); + iHandlesToClose.AppendL(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.Append(rJavaInstaller); + iHandlesToClose.AppendL(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.Append(rJavaInstaller); + iHandlesToClose.AppendL(rJavaInstaller); } TBool CJavaInstallLauncher::IsAppShellUpdate() @@ -619,7 +619,7 @@ // Open UI env and resource file. if (!iEik) { - iEik = CEikonEnv::Static(); + iEik = CEikonEnv::Static(); // codescanner::eikonenvstatic } if (!iEik) { diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/bld.inf --- a/javamanager/javainstaller/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -20,4 +20,5 @@ #include "installerui/build/bld.inf" #include "installer/build/bld.inf" -#include "appinstuiplugin/build/bld.inf" +#include "appinstuiplugin/build/bld.inf" +#include "iconsizenotifplugin/build/bld.inf" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/iconsizenotifplugin/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/iconsizenotifplugin/build/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,19 @@ +/* +* 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: Build information file for Java Icon Size Notifier Plugin +* +*/ + +PRJ_MMPFILES +javaiconsizenotifplugin.mmp diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/iconsizenotifplugin/build/javaiconsizenotifplugin.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/iconsizenotifplugin/build/javaiconsizenotifplugin.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,50 @@ +/* +* 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: Java notifier ecom plugin used to access the UI env +* from non UI context. +*/ + + +#include + + +TARGET javaiconsizenotifplugin.dll +TARGETTYPE PLUGIN +UID 0x10009D8D 0x101FD689 + +CAPABILITY CAP_ECOM_PLUGIN +VENDORID VID_DEFAULT + +PAGED + +APP_LAYER_SYSTEMINCLUDE + +START RESOURCE ../data/javaiconsizenotifplugin.rss +TARGET javaiconsizenotifplugin.rsc +END + +SOURCEPATH ../src +SOURCE iconsizenotifier.cpp + +USERINCLUDE . +USERINCLUDE ../inc +USERINCLUDE ../../../../inc + +LIBRARY euser.lib +LIBRARY eiksrv.lib // MEikSrvNotifierBase2 +LIBRARY cdlengine.lib // AknLayoutScalable_Avkon +LIBRARY aknlayout2scalable.lib // TAknWindowComponentLayout +LIBRARY avkon.lib // TAknLayoutRect +LIBRARY eikcore.lib // TAknLayoutRect + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/iconsizenotifplugin/data/javaiconsizenotifplugin.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/iconsizenotifplugin/data/javaiconsizenotifplugin.rss Mon Aug 23 16:38:44 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: ECOM resource definition +* +*/ + +#include +#include + +RESOURCE REGISTRY_INFO r_registry + { + resource_format_version = RESOURCE_FORMAT_VERSION_2; + dll_uid = 0x101FD689; + interfaces = + { + INTERFACE_INFO + { + interface_uid = KUikonUidPluginInterfaceNotifiers; + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x101FD68A; + version_no = 1; + display_name = "JavaIconSizeNotifPlugin"; + default_data = ""; + opaque_data = "0"; + rom_only = 0; // This is not a ROM only plugin + } + }; + } + }; + } + +// End of File diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/iconsizenotifplugin/inc/iconsizenotifier.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/iconsizenotifplugin/inc/iconsizenotifier.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef ICONSIZENOTIFIER_H +#define ICONSIZENOTIFIER_H + + +#include // MEikSrvNotifierBase2 + + +const TInt KIdIconSizeNotifPlugin = 0x101FD68B; +const TUid KUidIconSizeNotifPlugin = {KIdIconSizeNotifPlugin}; + + +class CIconSizeNotifier : public CBase, public MEikSrvNotifierBase2 +{ +public: + static CIconSizeNotifier* NewLC(); + ~CIconSizeNotifier(); + +private: + CIconSizeNotifier(); + void ConstructL(); + +// From MEikSrvNotifierBase2 +public: + void Release(); + TNotifierInfo RegisterL(); + TNotifierInfo Info() const; + void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); + TPtrC8 StartL(const TDesC8& aBuffer); + void Cancel(); + TPtrC8 UpdateL(const TDesC8& aBuffer); + void UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); + TInt NotifierCapabilites(); +private: + TNotifierInfo iInfo; +}; + +#endif // ICONSIZENOTIFIER_H diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/iconsizenotifplugin/inc/iconsizeutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/iconsizenotifplugin/inc/iconsizeutils.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,85 @@ +/* +* 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 ICONSIZEUTILS_H +#define ICONSIZEUTILS_H + +#include +#include + +/** + * Fallback value of expected size of raster icons in Menu & Home Screen. + * Copy of KJavaIconWidth in Menu's mcsmenuiconutility.cpp. + */ +const TInt KIconInMenuFallbackSize = 88; + +/** + * Fallback value of expected size of raster icons in App Mgr. + */ +const TInt KIconInAppMgrFallbackSize = 46; + +/** + * Utility class packing all Java icon sizes needed troughout the system. + */ +class TIconSizes +{ +public: + TSize iMenuIconSize; + TSize iAppMgrIconSize; +}; + +/** + * Utility class dealing with Java icon sizes. + */ +class IconSizeUtils +{ +public: + /** + * Helper for getting the ideal sizes for Java raster icons. + * Accesses Akn layouts, therefore a Ui context is required + * (CEikonEnv present in the calling thread). + * This function has been inlined so that the Java App Mgr plugin + * does not have to statically link against the ecom plugin dll. + */ + static TIconSizes GetIconSizes() + { + TIconSizes res; + + // Menu & Home Screen icons size. + // No api to get it so just use the fallback value for now. + res.iMenuIconSize = TSize(KIconInMenuFallbackSize, KIconInMenuFallbackSize); + + // App manager icon size. + // list_double_large_graphic_pane_vc_g1 = the icon of the app mgr list in landscape + TAknLayoutRect layoutRect; + layoutRect.LayoutRect(TRect(), + AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_g1(0).LayoutLine()); + TRect rect(layoutRect.Rect()); + TInt w(rect.Width()); + TInt h(rect.Height()); + if (w < 0 || h < 0) + { + w = KIconInAppMgrFallbackSize; + h = KIconInAppMgrFallbackSize; + } + res.iAppMgrIconSize = TSize(w, h); + + return res; + } +}; + +#endif // ICONSIZEUTILS_H diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/iconsizenotifplugin/src/iconsizenotifier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/iconsizenotifplugin/src/iconsizenotifier.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,135 @@ +/* +* 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 "iconsizenotifier.h" +#include "iconsizeutils.h" + +const TUid KUidScreenOutput = { 0x10009D48 }; + +CIconSizeNotifier* CIconSizeNotifier::NewLC() +{ + CIconSizeNotifier* self = new(ELeave) CIconSizeNotifier(); + CleanupStack::PushL(self); + self->ConstructL(); + return self; +} + +CIconSizeNotifier::~CIconSizeNotifier() +{ +} + +CIconSizeNotifier::CIconSizeNotifier() +{ +} + +void CIconSizeNotifier::ConstructL() +{ +} + +void CIconSizeNotifier::Release() +{ + delete this; +} + +CIconSizeNotifier::TNotifierInfo CIconSizeNotifier::RegisterL() +{ + iInfo.iUid = KUidIconSizeNotifPlugin; + iInfo.iChannel = KUidScreenOutput; + iInfo.iPriority = ENotifierPriorityHigh; + return iInfo; +} + +CIconSizeNotifier::TNotifierInfo CIconSizeNotifier::Info() const +{ + return iInfo; +} + +void CIconSizeNotifier::StartL(const TDesC8& /*aBuffer*/, TInt aReplySlot, const RMessagePtr2& aMessage) +{ + TPckgBuf res(IconSizeUtils::GetIconSizes()); + aMessage.WriteL(aReplySlot, res); + aMessage.Complete(KErrNone); +} + +TPtrC8 CIconSizeNotifier::StartL(const TDesC8& /*aBuffer*/) +{ + return KNullDesC8(); +} + +void CIconSizeNotifier::Cancel() +{ +} + +TPtrC8 CIconSizeNotifier::UpdateL(const TDesC8& /*aBuffer*/) +{ + return KNullDesC8(); +} + +void CIconSizeNotifier::UpdateL(const TDesC8& /*aBuffer*/, TInt /*aReplySlot*/, const RMessagePtr2& aMessage) +{ + aMessage.Complete(KErrNotSupported); +} + +void CreateNotifiersL(CArrayPtrFlat& aNotifiers) +{ + CIconSizeNotifier* notifier1 = CIconSizeNotifier::NewLC(); + aNotifiers.AppendL(notifier1); + CleanupStack::Pop(notifier1); +} + +CArrayPtr* NotifierArray() +{ + CArrayPtrFlat* notifiers = new CArrayPtrFlat(1); + if (notifiers) + { + TRAPD(err, CreateNotifiersL(*notifiers)); + if (err) + { + TInt count = notifiers->Count(); + while (count--) + { + (*notifiers)[count]->Release(); + } + delete notifiers; + notifiers = NULL; + } + } + return notifiers; +} + +TInt CIconSizeNotifier::NotifierCapabilites() +{ + return ENoSpecialCapabilities; +} + +// ECom plugin entry point +const TImplementationProxy ImplementationTable[] = +{ + IMPLEMENTATION_PROXY_ENTRY(0x101FD68A, NotifierArray) +}; + +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) +{ + aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); + return ImplementationTable; +} + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installcopier/build/javainstallcopier.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installcopier/build/javainstallcopier.pro Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,31 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installcopier/src/javainstallcopier.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installcopier/src/javainstallcopier.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,153 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/build/build.xml --- a/javamanager/javainstaller/installer/build/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/build/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -74,6 +74,7 @@ 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/build/exports.inf --- a/javamanager/javainstaller/installer/build/exports.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/build/exports.inf Mon Aug 23 16:38:44 2010 +0100 @@ -27,11 +27,12 @@ ../data/inst_plugins.cfg /epoc32/data/z/private/102033E6/installer/inst_plugins.cfg -// Generic configuration interface for javainstaller cenrep settings -// javainstaller_102824CE implementation specifics for cenrep data +// Configuration interface for javainstaller #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 */ @@ -39,7 +40,3 @@ ../conf/javainstaller_102824CE.crml APP_LAYER_CRML(javainstaller_102824CE.crml) #endif - -//darios: this is needed by the midlet installer -../data/resource/java_app_92.mif /epoc32/winscw/c/resource/java/java_app_92.mif -../data/resource/java_app_92.mif /epoc32/data/z/resource/java/java_app_92.mif diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/build/javainstaller.pro --- a/javamanager/javainstaller/installer/build/javainstaller.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/build/javainstaller.pro Mon Aug 23 16:38:44 2010 +0100 @@ -37,7 +37,8 @@ INCLUDEPATH += ../src.s60/applicationregistrator \ ../src.s60/iconconverter \ ../src.s60/jadjarmatcher \ - ../src.s60/utils + ../src.s60/utils \ + ../../iconsizenotifplugin/inc SOURCES += ../src.s60/applicationregistrator/applicationregistrator.cpp \ ../src.s60/applicationregistrator/sifnotifier.cpp \ @@ -48,29 +49,31 @@ ../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 \ -lezip -lfbscli -limageconversion -lmsgs \ -lsysutil -lplatformenv -lws32 -lapparc -lcentralrepository \ - -lhal -lcaf -lcafutils + -lhal -lcaf -lcafutils -lbitmaptransforms contains(PROJECT_DEFINES,RD_JAVA_S60_50_REL2) { LIBS += -lmcsmenu } contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) { - LIBS += -lQtServiceFramework - } - - contains(PROJECT_DEFINES,RD_JAVA_USIF_NOTIFY_PROGRESS) { - LIBS += -lsifnotification + CONFIG += hb + LIBS += -lsifnotification -lxqservice } 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/build/javainstaller_0x2002DCB4.mmp --- a/javamanager/javainstaller/installer/build/javainstaller_0x2002DCB4.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/build/javainstaller_0x2002DCB4.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javainstaller.mmp @@ -52,13 +52,13 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../src.s60/applicationregistrator SYSTEMINCLUDE ../src.s60/iconconverter SYSTEMINCLUDE ../src.s60/jadjarmatcher SYSTEMINCLUDE ../src.s60/utils +SYSTEMINCLUDE ../../iconsizenotifplugin/inc SYSTEMINCLUDE ../../../inc SYSTEMINCLUDE ../../../../inc SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 @@ -81,6 +81,8 @@ SOURCEPATH ../src.s60/utils SOURCE filewriter.cpp SOURCE fileroots.cpp +SOURCE propertylistener.cpp +SOURCE propertyprovider.cpp SOURCE sysutil.cpp @@ -101,6 +103,7 @@ LIBRARY hal.lib LIBRARY caf.lib LIBRARY cafutils.lib +LIBRARY bitmaptransforms.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib @@ -141,6 +144,12 @@ LIBRARY scrclient.lib +#else + +LIBRARY ecom.lib + +LIBRARY SWInstTaskManager.lib + #endif #include diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/conf/CI_javainstaller.confml Binary file javamanager/javainstaller/installer/conf/CI_javainstaller.confml has changed diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistrator.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,6 +18,7 @@ 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; @@ -355,6 +356,8 @@ String aJarFilename, StringBuffer aIconSuffix) { + Log.log("ApplicationRegistrator.convertIcon: " + aInputIconFilename + + " --> " + aOutputIconFilename + ", from jar " + aJarFilename); return _convertIcon(aInputIconFilename, aOutputIconFilename, aJarFilename, aIconSuffix); } @@ -437,8 +440,50 @@ 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 ----------------------------- */ /** @@ -579,4 +624,20 @@ * @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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifNotifier.java Mon Aug 23 16:38:44 2010 +0100 @@ -41,6 +41,8 @@ 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; @@ -62,6 +64,8 @@ /** 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; @@ -103,22 +107,22 @@ iIconDir = aIconDir; iComponentIcon = aComponentIcon; - if (iHandle == 0) - { - InstallerException.internalError( - "SifNotifier.notifyStart: notifier has not been initialized"); - } + checkHandle(); int ret = _notifyStart( iHandle, aGlobalComponentId, aComponentName, aApplicationNames, aApplicationIcons, aComponentSize, aIconDir, aComponentIcon); if (ret < 0) { - Log.logError("Notifying SIF start failed with code " + ret + - ", " + getInfoString()); + Log.log("Notifying SIF start failed with code " + ret + + ", " + getInfoString()); InstallerException.internalError( "Notifying SIF start failed with code " + ret); } + else + { + Log.log("SifNotifier.notifyStart: " + getInfoString()); + } iNotifyProgressAllowed = true; } @@ -130,26 +134,35 @@ public void notifyEnd( int aErrCategory, int aErrCode, String aErrMsg, String aErrMsgDetails) { - if (iHandle == 0) + checkHandle(); + if (aErrCategory == 0 && iLastProgressSent < MAX_PROGRESS) { - InstallerException.internalError( - "SifNotifier.notifyEnd: notifier has not been initialized"); + // 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); } + // 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.logError("Notifying SIF end failed with code " + ret + - ", " + getInfoString() + - ", ErrCategory: " + aErrCategory + - ", ErrCode: " + aErrCode + - ", ErrMsg: " + aErrMsg + - ", ErrMsgDetails: " + aErrMsgDetails); + Log.log("Notifying SIF end failed with code " + ret + + ", " + getInfoString() + ", " + logMsg); InstallerException.internalError( "Notifying SIF end failed with code " + ret); } + else + { + Log.log("SifNotifier.notifyEnd: " + logMsg); + } } /** @@ -163,24 +176,29 @@ { return; } - if (iHandle == 0) + checkHandle(); + if (aSubOperation == SUB_OP_NO) { - InstallerException.internalError( - "SifNotifier.notifyProgress: notifier has not been initialized"); + iLastProgressSent = aCurrent; } int ret = _notifyProgress( iHandle, iGlobalComponentId, iOperation, aSubOperation, aCurrent, aTotal); + String logMsg = + "SubOp: " + aSubOperation + + ", Current: " + aCurrent + + ", Total: " + aTotal; if (ret < 0) { - Log.logError("Notifying SIF progress failed with code " + ret + - ", " + getInfoString() + - ", SubOp: " + aSubOperation + - ", Current: " + aCurrent + - ", Total: " + aTotal); + Log.log("Notifying SIF progress failed with code " + ret + + ", " + getInfoString() + ", " + logMsg); InstallerException.internalError( "Notifying SIF progress failed with code " + ret); } + else + { + Log.log("SifNotifier.notifyProgress: " + logMsg); + } } /** @@ -191,17 +209,17 @@ */ public void destroy() { - if (iHandle == 0) - { - InstallerException.internalError( - "SifNotifier.destroy: notifier has not been initialized"); - } + checkHandle(); int ret = _destroy(iHandle); if (ret < 0) { InstallerException.internalError( "Destroying SIF notifier failed with code " + ret); } + else + { + Log.log("SifNotifier destroyed"); + } iHandle = 0; } @@ -221,12 +239,29 @@ 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() @@ -235,11 +270,31 @@ buf.append("Operation: ").append(iOperation); buf.append(", GlobalComponentId: ").append(iGlobalComponentId); buf.append(", ComponentName: ").append(iComponentName); - for (int i = 0; i < iApplicationNames.length; i++) + if (iApplicationNames != null) { - buf.append(", ApplicationName: ").append(iApplicationNames[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(", ComponentSize: ").append(iComponentSize); + if (iIconDir != null) + { + buf.append(", IconDir: ").append(iIconDir); + } + if (iComponentIcon != null) + { + buf.append(", ComponentIcon: ").append(iComponentIcon); + } return buf.toString(); } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifRegistrator.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -25,7 +25,6 @@ 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; @@ -61,6 +60,14 @@ } /** + * Returns SIF specific error category from given error id. + */ + public static int getErrorCategory(int aErrorId) + { + return _getErrorCategory(aErrorId); + } + + /** * Launches the application view. If launching application view * fails this method does not throw exception but produces an * error log entry. @@ -129,27 +136,6 @@ } /** - * 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. @@ -179,7 +165,7 @@ if (ret < 0) { InstallerException.internalError( - "Creating session failed with code " + ret); + "Creating SIF session failed with code " + ret); } //Log.log("SifRegistrator session started"); iSessionHandle = ret; @@ -198,36 +184,18 @@ */ public void registerSuite(SuiteInfo aSuiteInfo, boolean aIsUpdate) { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } + checkSession(); Log.log("SifRegistrator registering application suite " + aSuiteInfo.getGlobalId()); - if (_getUsifMode() > 0) + // Register suite as a component. + registerComponent(aSuiteInfo, aIsUpdate); + registerLocalizedComponentName(aSuiteInfo, -1); + // Register applications within the component. + Vector apps = aSuiteInfo.getApplications(); + for (int i = 0; i < apps.size(); i++) { - // USIF Phase 2 registration. - // Register suite as a component. - registerComponent(aSuiteInfo, aIsUpdate); - registerLocalizedComponentName(aSuiteInfo, -1); - // Register applications within the component. - Vector apps = aSuiteInfo.getApplications(); - for (int i = 0; i < apps.size(); i++) - { - registerApplication(aSuiteInfo, i); - } - } - else - { - // USIF Phase 1 registration. - // Register each application in the suite. - Vector apps = aSuiteInfo.getApplications(); - for (int i = 0; i < apps.size(); i++) - { - registerComponent(aSuiteInfo, i, aIsUpdate); - registerLocalizedComponentName(aSuiteInfo, i); - } + registerApplication(aSuiteInfo, i); } registerLocalizedProperties(aSuiteInfo); } @@ -243,29 +211,12 @@ */ public void unregisterSuite(SuiteInfo aSuiteInfo) { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } + checkSession(); Log.log("SifRegistrator unregistering application suite " + aSuiteInfo.getGlobalId()); - if (_getUsifMode() > 0) - { - // USIF Phase 2 unregistration. - // Unregister suite as a component. - unregisterComponent(aSuiteInfo); - } - else - { - // USIF Phase 1 unregistration. - // Unregister each application in the suite. - Vector apps = aSuiteInfo.getApplications(); - for (int i = 0; i < apps.size(); i++) - { - unregisterComponent(aSuiteInfo, i); - } - } + // Unregister suite as a component. + unregisterComponent(aSuiteInfo); } /** @@ -278,15 +229,11 @@ */ public void commitSession() { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } - + checkSession(); int err = _commitSession(iSessionHandle); if (err < 0) { - InstallerException.internalError("Commiting session failed with code " + err); + InstallerException.internalError("Commiting SIF session failed with code " + err); } // Current session has been closed iSessionHandle = 0; @@ -301,17 +248,13 @@ */ public void rollbackSession() { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } - + checkSession(); int err = _rollbackSession(iSessionHandle); // Session is closed always when rollback is called iSessionHandle = 0; if (err < 0) { - InstallerException.internalError("Rolling back the session failed with code " + err); + InstallerException.internalError("Rolling back SIF session failed with code " + err); } //Log.log("SifRegistrator session rolled back"); } @@ -327,7 +270,6 @@ { return; } - _closeSession(iSessionHandle); // Current session has been closed iSessionHandle = 0; @@ -344,11 +286,7 @@ */ public ComponentId getComponentId(String aGlobalId) { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } - + checkSession(); ComponentId result = new ComponentId(); int ret = _getComponentId(iSessionHandle, aGlobalId, result); if (-1 == ret) @@ -376,11 +314,7 @@ */ public ComponentId getComponentId(Uid aAppUid) { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } - + checkSession(); ComponentId result = new ComponentId(); int ret = _getComponentIdForApp( iSessionHandle, ((PlatformUid)aAppUid).getIntValue(), result); @@ -406,15 +340,12 @@ */ public void logComponent(String aGlobalId) { - if (0 == iSessionHandle) - { - InstallerException.internalError("No valid SIF session."); - } - + checkSession(); int ret = _logComponent(iSessionHandle, aGlobalId); if (ret < -1) { - Log.logError("SifRegistrator logComponent failed with code " + ret); + Log.logError("SifRegistrator logComponent for " + aGlobalId + + " failed with code " + ret); } } @@ -422,120 +353,19 @@ /*** ----------------------------- PRIVATE ---------------------------- */ /** - * Registers one Java application to S60 USIF as a component. - * Used with USIF Phase 1. - * - * @param aSuiteInfo Information needed to register the application - * @param aIndex index of the application in the suite - * @param aIsUpdate true in case of an update, false in case of a new - * installation - * @throws InstallerException if registration cannot done or - * startSession has not been called successfully - * @see startSession - * @see SuiteInfo + * Checks if SifRegistrator session has been started. + * @throws InstallerException if SifRegistrator session has not been started */ - private void registerComponent( - SuiteInfo aSuiteInfo, int aIndex, boolean aIsUpdate) + private void checkSession() { - String globalId = aSuiteInfo.getGlobalId(aIndex); - if (globalId == null) - { - Log.logWarning("SifRegistrator: Application with index " + aIndex + - " not found from " + aSuiteInfo.getGlobalId()); - return; - } - ApplicationInfo appInfo = - (ApplicationInfo)aSuiteInfo.getApplications().elementAt(aIndex); - String suiteName = aSuiteInfo.getName(); - String vendor = aSuiteInfo.getVendor(); - String version = aSuiteInfo.getVersion().toString(); - String name = appInfo.getName(); - int uid = ((PlatformUid)appInfo.getUid()).getIntValue(); - String[] componentFiles = getComponentFiles(aSuiteInfo); - long componentSize = aSuiteInfo.getInitialSize(); - String attrValue = aSuiteInfo.getAttributeValue("Nokia-MIDlet-Block-Uninstall"); - boolean isRemovable = !(attrValue != null && attrValue.equalsIgnoreCase("true")); - boolean isDrmProtected = (aSuiteInfo.getContentInfo() == aSuiteInfo.CONTENT_INFO_DRM); - boolean isOriginVerified = aSuiteInfo.isTrusted(); - String midletInfoUrl = aSuiteInfo.getAttributeValue("MIDlet-Info-URL"); - String midletDescription = aSuiteInfo.getAttributeValue("MIDlet-Description"); - String downloadUrl = aSuiteInfo.getAttributeValue("Nokia-MIDlet-Download-URL"); - ComponentId componentId = new ComponentId(); - int err = _registerComponent( - iSessionHandle, uid, - getScrString(suiteName), getScrString(vendor), - getScrString(version), getScrString(name), - getScrString(globalId), componentFiles, - componentSize, isRemovable, isDrmProtected, - isOriginVerified, aIsUpdate, aSuiteInfo.getMediaId(), - getScrString(midletInfoUrl), - getScrString(midletDescription), - getScrString(downloadUrl), - componentId); - if (err < 0) + if (iSessionHandle == 0) { - InstallerException.internalError( - "Registering component " + globalId + - " failed with code " + err); - } - else - { - appInfo.setComponentId(componentId); - Log.log("SifRegistrator registered component " + globalId + - " with id " + componentId.getId()); - } - } - - /** - * Unregisters one Java application from being S60 USIF component. - * Used with USIF Phase 1. - * - * @param aSuiteInfo Information needed to unregister the application, - * @param aIndex index of the application in the suite - * @throws InstallerException if unregistration cannot done or - * startSession has not been called successfully - * @see startSession - * @see SuiteInfo - */ - private void unregisterComponent(SuiteInfo aSuiteInfo, int aIndex) - { - String globalId = aSuiteInfo.getGlobalId(aIndex); - if (globalId == null) - { - Log.logWarning("SifRegistrator: Application with index " + aIndex + - " not found from " + aSuiteInfo.getGlobalId()); - return; - } - ComponentId componentId = getComponentId(globalId); - if (componentId == null) - { - Log.logWarning( - "SifRegistrator unregistration failed, application " + - globalId + " does not exist"); - return; - } - // Save component id to ApplicationInfo. - ApplicationInfo appInfo = - (ApplicationInfo)aSuiteInfo.getApplications().elementAt(aIndex); - appInfo.setComponentId(componentId); - // Unregister application. - int err = _unregisterComponent(iSessionHandle, componentId.getId()); - if (err < 0) - { - InstallerException.internalError( - "Unregistering component " + globalId + - " failed with code " + err); - } - else - { - Log.log("SifRegistrator unregistered component " + globalId + - " with id " + componentId.getId()); + InstallerException.internalError("No valid SIF session."); } } /** * Registers Java application suite to S60 USIF as a component. - * Used with USIF Phase 2. * * @param aSuiteInfo Suite information * @param aIsUpdate true in case of an update, false in case of a new @@ -551,7 +381,6 @@ String suiteName = aSuiteInfo.getName(); String vendor = aSuiteInfo.getVendor(); String version = aSuiteInfo.getVersion().toString(); - String name = null; // Set name to null so that suite name will be used. int uid = ((PlatformUid)aSuiteInfo.getUid()).getIntValue(); String[] componentFiles = getComponentFiles(aSuiteInfo); long componentSize = aSuiteInfo.getInitialSize(); @@ -562,17 +391,20 @@ String midletInfoUrl = aSuiteInfo.getAttributeValue("MIDlet-Info-URL"); String midletDescription = aSuiteInfo.getAttributeValue("MIDlet-Description"); String downloadUrl = aSuiteInfo.getAttributeValue("Nokia-MIDlet-Download-URL"); + String updateUrl = aSuiteInfo.getAttributeValue("Nokia-Update"); ComponentId componentId = new ComponentId(); int err = _registerComponent( iSessionHandle, uid, getScrString(suiteName), getScrString(vendor), - getScrString(version), getScrString(name), - getScrString(globalId), componentFiles, - componentSize, isRemovable, isDrmProtected, - isOriginVerified, aIsUpdate, aSuiteInfo.getMediaId(), + getScrString(version), getScrString(globalId), + componentFiles, componentSize, + isRemovable, isDrmProtected, + isOriginVerified, aIsUpdate, + aSuiteInfo.getMediaId(), getScrString(midletInfoUrl), getScrString(midletDescription), getScrString(downloadUrl), + getScrString(updateUrl), componentId); if (err < 0) { @@ -590,7 +422,6 @@ /** * Unregisters Java application suite from being S60 USIF component. - * Used with USIF Phase 2. * * @param aSuiteInfo suite information * @throws InstallerException if unregistration cannot done or @@ -632,7 +463,6 @@ * from given SuiteInfo object. The SuiteInfo must already have * been registered to USIF as a component with registerComponent() * method before this method is called. - * Used with USIF Phase 2. * * @param aSuiteInfo information needed to register the application * @param aIndex index of the application in the suite @@ -690,15 +520,20 @@ private static String[] getComponentFiles(SuiteInfo aSuite) { Vector componentFiles = new Vector(); - String path = aSuite.getJadPath(); - if (path != null) + if (!aSuite.isPreinstalled()) { - componentFiles.addElement(getScrString(path)); - } - path = aSuite.getJarPath(); - if (path != null) - { - componentFiles.addElement(getScrString(path)); + // 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)); + } } boolean addRootPath = true; int rootDrive = FileUtils.getDrive(aSuite.getRootDir()); @@ -716,10 +551,15 @@ } if (addRootPath) { - componentFiles.addElement(getScrString(aSuite.getRootDir())); + componentFiles.addElement( + getScrString(aSuite.getRootDir() + "nofile.txt")); } 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; } @@ -809,7 +649,7 @@ " failed with code " + err + " (" + nonlocalizedAttrValue + ")"); } LocalizedName[] localizedAttrValues = - getLocalizedNames(aSuite, attrName + "-"); + getLocalizedNames(aSuite, "Nokia-" + attrName + "-"); for (int i = 0; i < localizedAttrValues.length; i++) { err = _setLocalizedComponentProperty( @@ -826,21 +666,48 @@ } // Register Domain-Category property. - ApplicationInfoImpl appInfoImpl = (ApplicationInfoImpl) - com.nokia.mj.impl.rt.support.ApplicationInfo.getInstance(); - String domainCategory = appInfoImpl.getProtectionDomain(); + String protectionDomainProperty = "Domain-Category"; + String protectionDomainName = aSuite.getProtectionDomainName(); err = _setLocalizedComponentProperty( - iSessionHandle, cid, "Domain-Category", - domainCategory, UNSPECIFIED_LOCALE); + iSessionHandle, cid, protectionDomainProperty, + getProtectionDomainPropertyValue(protectionDomainName), + UNSPECIFIED_LOCALE); if (err < 0) { InstallerException.internalError( - "Adding property Domain-Category value " + domainCategory + - " for component " + cid + " failed with code " + err); + "Adding property " + protectionDomainProperty + + " value " + protectionDomainName + " for component " + + cid + " failed with code " + err); } } /** + * Returns the "Domain-Category" property value which contains + * the text id and text file name for the localized domain category + * text. 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. @@ -869,6 +736,13 @@ "SifRegistrator ignored unknown locale: " + name + ": " + localizedName); } + else if (localizedName.getName() == null || + localizedName.getName().length() == 0) + { + Log.logWarning( + "SifRegistrator ignored empty localized text: " + + name + ": " + localizedName); + } else { Log.log("SifRegistrator found localized text " + @@ -949,14 +823,6 @@ 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 @@ -998,7 +864,6 @@ * @param aSuiteName * @param aVendor * @param aVersion - * @param aName * @param aGlobalId * @param aComponentFiles * @param aComponentSize @@ -1010,17 +875,19 @@ * @param aMidletInfoUrl * @param aMidletDescription * @param aDownloadUrl + * @param aUpdateUrl * @param aComponentId upon successful execution contains the * component id for the registered component * @return 0 if registration succeeded or Symbian error code */ private static native int _registerComponent( int aSessionHandle, int aUid, String aSuiteName, String aVendor, - String aVersion, String aName, String aGlobalId, + String aVersion, String aGlobalId, String[] aComponentFiles, long aComponentSize, boolean aIsRemovable, boolean aIsDrmProtected, boolean aIsOriginVerified, boolean aIsUpdate, int aMediaId, - String aMidletInfoUrl, String aMidletDescription, String aDownloadUrl, + String aMidletInfoUrl, String aMidletDescription, + String aDownloadUrl, String aUpdateUrl, ComponentId aComponentId); /** @@ -1128,4 +995,9 @@ * @return 1 if application data should be registered to USIF, 0 otherwise */ private static native int _getUsifMode(); + + /** + * Returns SIF specific error category from given error id. + */ + private static native int _getErrorCategory(int aErrorId); } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/FileRoots.java Mon Aug 23 16:38:44 2010 +0100 @@ -62,7 +62,16 @@ */ public static String getRegisteredIconDir(int aDrive) { - return FileUtils.getDriveName(aDrive) + ":\\data\\java\\"; + 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()); } /** diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/PropertyProvider.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/PropertyProvider.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,179 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/SysUtil.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -359,11 +359,12 @@ " drives failed with code " + ret); } // Save the drives so that next time they are not fetched again. - iUserVisibleDrives = new Vector(); + Vector drivesVector = new Vector(); for (int i = 0; i < aVisibleDrives.size(); i++) { - iUserVisibleDrives.addElement(aVisibleDrives.elementAt(i)); + drivesVector.addElement(aVisibleDrives.elementAt(i)); } + iUserVisibleDrives = drivesVector; } /** @@ -441,6 +442,44 @@ 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 ---------------------------- */ @@ -648,6 +687,14 @@ 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/GetComponentInfo.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/GetComponentInfo.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/GetComponentInfo.java Mon Aug 23 16:38:44 2010 +0100 @@ -480,6 +480,15 @@ suiteUid, null, iSecurityAttributes.getAuthenticationAttributes()); + if (authenticationCredentials != null) + { + for (int i = 0; i < authenticationCredentials.length; i++) + { + String domain = authenticationCredentials[i] + .getProtectionDomainCategory(); + Log.log("Protection domain: " + domain); + } + } if (iJarFilename != null) { // Authenticate jar. diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java Mon Aug 23 16:38:44 2010 +0100 @@ -46,6 +46,8 @@ // Maximum number of progress updates to SysUtil.setProperty(). private static final int MAX_PROPERTY_PROGRESS_UPDATES = 5; + // Maximum number of progress updates to SIF. + private static final int MAX_SIF_PROGRESS_UPDATES = 5; // Maximum number of progress updates to UI. private static final int MAX_UI_PROGRESS_UPDATES = 20; @@ -61,11 +63,16 @@ private int iMaxValue = 1; // Tells how often property progress should be updated. private int iPropertyProgressStep = 1; + // Tells how often SIF progress should be updated. + private int iSifProgressStep = 1; // Tells how often UI progress should be updated. private int iUiProgressStep = 1; // Point between 0 and iMaxValue where the last property // update has been made. private int iLastPropertyUpdate = 0; + // Point between 0 and iMaxValue where the last SIF update + // has been made. + private int iLastSifUpdate = 0; // Point between 0 and iMaxValue where the last UI update // has been made. private int iLastUiUpdate = 0; @@ -203,6 +210,11 @@ { iPropertyProgressStep = 1; } + iSifProgressStep = iMaxValue / MAX_SIF_PROGRESS_UPDATES; + if (iSifProgressStep == 0) + { + iSifProgressStep = 1; + } iUiProgressStep = iMaxValue / MAX_UI_PROGRESS_UPDATES; if (iUiProgressStep == 0) { @@ -241,29 +253,44 @@ Log.log("InstallationNotifier.set: progress " + currentPercentage); defineProperties(); - if (aCurrentValue == 0 || - aCurrentValue == iMaxValue || - aCurrentValue >= iLastPropertyUpdate + iPropertyProgressStep || - aCurrentValue <= iLastPropertyUpdate - iPropertyProgressStep) + if (isUpdateNeeded(aCurrentValue, iMaxValue, + iLastPropertyUpdate, iPropertyProgressStep)) { iLastPropertyUpdate = aCurrentValue; Log.log("InstallationNotifier.set: update property to " + currentPercentage); // Update property values: progress. - SysUtil.setPropertyValue - (SysUtil.PROP_CATEGORY_SYSTEM, - SysUtil.PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS, - currentPercentage); + SysUtil.setPropertyValue( + SysUtil.PROP_CATEGORY_SYSTEM, + SysUtil.PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS, + currentPercentage); } - if (aCurrentValue == 0 || - aCurrentValue == iMaxValue || - aCurrentValue >= iLastUiUpdate + iUiProgressStep || - aCurrentValue <= iLastUiUpdate - iUiProgressStep) + if (isUpdateNeeded(aCurrentValue, iMaxValue, + iLastSifUpdate, iSifProgressStep)) { - iLastUiUpdate = aCurrentValue; + if (iSifNotifier != null) + { + iLastSifUpdate = aCurrentValue; + try + { + iSifNotifier.notifyProgress( + iSifNotifier.SUB_OP_NO, currentPercentage, 100); + } + catch (Throwable t) + { + Log.logError( + "InstallationNotifier: SifNotifier.notifyProgress threw exception", t); + } + } + } + + if (isUpdateNeeded(aCurrentValue, iMaxValue, + iLastUiUpdate, iUiProgressStep)) + { if (iInstallerUi != null) { + iLastUiUpdate = aCurrentValue; Log.log("InstallationNotifier.set: update ui to " + currentPercentage); try @@ -276,21 +303,6 @@ "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); - } - } } } @@ -382,4 +394,24 @@ "InstallationNotifier: Deleting property failed", ex); } } + + /** + * Returns true if progress update is needed, false otherwise. + * + * @param aCurrent current progress value + * @param aMax maximum progress value + * @param aPrevious previously updated progress value + * @param aStep step between progress updates + */ + private static boolean isUpdateNeeded( + int aCurrent, int aMax, int aPrevious, int aStep) + { + if (aCurrent == 0 || aCurrent == aMax || + aCurrent >= aPrevious + aStep || + aCurrent <= aPrevious - aStep) + { + return true; + } + return false; + } } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java Mon Aug 23 16:38:44 2010 +0100 @@ -99,6 +99,11 @@ */ static final int RET_NO_SYSTEM_EXIT = 100; + /** Id for installer cancel Comms message. */ + private static final int INSTALLER_CANCEL_MESSAGE_ID = 603; + /** Id for installer cancel Comms response message. */ + private static final int INSTALLER_CANCEL_RESPONSE_MESSAGE_ID = 604; + // ThreadDumper instance. private static ThreadDumper iThreadDumper = null; @@ -323,7 +328,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]); @@ -336,7 +341,7 @@ if (iThreadDumper != null) { - iThreadDumper.startTimer(10*60*1000); // 10 mins + iThreadDumper.startTimer(5*60*1000); // 5 mins } try @@ -538,9 +543,9 @@ table.add(new com.nokia.mj.impl.installer.midp2.install.steps. GetFromStorage()); 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. - SelectUids()); // Select suite uid and application uids. + StartProgressNotifications()); table.add(new com.nokia.mj.impl.installer.midp2.install.steps. AuthenticateJad()); // This must be the first security // related step. @@ -1235,6 +1240,8 @@ " -commsresult=endpoint In the end of operation, send\n"+ " InstallerResultMessage to specified comms\n"+ " endpoint.\n"+ + " -base64=base64options Comma separated list of base64 encoded\n"+ + " options.\n"+ "\n"+ "Either -jad or -jar must be specified, other options are optional.\n"; @@ -1264,10 +1271,13 @@ " -captainmsgs=yes|no If set to no, JavaInstaller will not send\n"+ " any messages to JavaCaptain during\n"+ " uninstallation. Default is yes.\n"+ + " -resetpreinstall Reset preinstall state.\n"+ " -skipotastatus Skip OTA status handling.\n"+ " -commsresult=endpoint In the end of operation, send\n"+ " InstallerResultMessage to specified comms\n"+ " endpoint.\n"+ + " -base64=base64options Comma separated list of base64 encoded\n"+ + " options.\n"+ "\n"+ "The -uid option must be specified, other options are optional.\n"; @@ -1466,7 +1476,7 @@ if (aMessage.hasPermission(CommsPermission.INSTALL_APPLICATION)) { int msgId = aMessage.getMessageId(); - if (msgId == 603) + if (msgId == INSTALLER_CANCEL_MESSAGE_ID) { Installer.cancel(); result = ERR_NONE; @@ -1479,7 +1489,7 @@ } CommsMessage response = new CommsMessage(); response.replyTo(aMessage); - response.setMessageId(604); + response.setMessageId(INSTALLER_CANCEL_RESPONSE_MESSAGE_ID); response.write(result); iInstallerServer.send(response); Log.log("InstallerListener sent " + response); diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallerResultMessage.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallerResultMessage.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallerResultMessage.java Mon Aug 23 16:38:44 2010 +0100 @@ -21,12 +21,14 @@ import com.nokia.mj.impl.comms.CommsEndpoint; import com.nokia.mj.impl.comms.CommsMessage; import com.nokia.mj.impl.installer.applicationregistrator.SifNotifier; +import com.nokia.mj.impl.installer.applicationregistrator.SifRegistrator; import com.nokia.mj.impl.installer.storagehandler.ApplicationInfo; import com.nokia.mj.impl.installer.storagehandler.SuiteInfo; import com.nokia.mj.impl.installer.utils.InstallerException; import com.nokia.mj.impl.installer.utils.Log; import com.nokia.mj.impl.installer.utils.PlatformUid; import com.nokia.mj.impl.utils.exception.ExceptionBase; +import com.nokia.mj.impl.utils.ErrorMessageBase; import com.nokia.mj.impl.utils.InstallerErrorMessage; import com.nokia.mj.impl.utils.Tokenizer; import com.nokia.mj.impl.utils.Uid; @@ -37,30 +39,77 @@ /** * InstallerResultMessage contains information about install, uninstall - * and componentinfo operations. It is sent to Comms endpoint specified - * at JavaInstaller startup. + * and componentinfo operation results. JavaInstaller sends it at the end + * of operation to Comms endpoint specified at JavaInstaller startup with + * -commsresult option. + *

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

    + *

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

    */ public class InstallerResultMessage { + /** Operation type. Value type: int. + Possible values: 0: install, 1: uninstall, 2: componentinfo. */ public static final String NAME_OPERATION = "operation"; + /** Status code indicating operation result. Value type: int. */ public static final String NAME_RESULT = "result"; + /** SIF error category. Value type: int. */ public static final String NAME_ERROR_CATEGORY = "error-category"; + /** Java runtime specific error code. Value type: int. */ + public static final String NAME_ERROR_CODE = "error-code"; + /** Localized error message. Value type: string. */ public static final String NAME_ERROR_MSG = "error-message"; + /** Localized message with more details of the error reason. Value type: string. */ public static final String NAME_ERROR_DETAILS = "error-details"; + /** Suite UID. Value type: int. */ public static final String NAME_SUITE_UID = "suite-uid"; + /** Midlet-n UID. Value type: int. */ public static final String NAME_MIDLET_UID = "midlet-uid-"; + /** Suite component id. Value type: int. */ public static final String NAME_SUITE_CID = "suite-cid"; + /** Midlet-n component id. Value type: int. */ public static final String NAME_MIDLET_CID = "midlet-cid-"; + /** Suite global id. Value type: string. */ public static final String NAME_SUITE_GID = "suite-gid"; + /** Midlet-n global id. Value type: string. */ public static final String NAME_MIDLET_GID = "midlet-gid-"; + /** Suite name. Value type: string. */ public static final String NAME_SUITE_NAME = "suite-name"; + /** Midlet-n name. Value type: string. */ public static final String NAME_MIDLET_NAME= "midlet-name-"; + /** Suite vendor. Value type: string. */ public static final String NAME_VENDOR = "vendor"; + /** Suite version. Value type: string. */ public static final String NAME_VERSION = "version"; + /** Component installation status. Value type: int. Possible values: + 0: new component, + 1: upgrade, + 2: already installed, + 3: newer version already installed, + 4: invalid package, cannot be installed. */ public static final String NAME_INSTALL_STATUS = "install-status"; + /** Component authenticity. Value type: int. Possible values: + 0: component is not authenticated, 1: component is authenticated. */ public static final String NAME_AUTHENTICITY = "authenticity"; + /** Size of the files owned by the component at the time of the + installation. Calculated from MIDlet-Data-Size and + MIDlet-Jar-Size attributes. Value type: int. */ public static final String NAME_COMPONENT_SIZE = "component-size"; + /** Id for installer result Comms message. */ + private static final int INSTALLER_RESULT_MESSAGE_ID = 601; + private Hashtable iNamedIntValues = null; private Hashtable iNamedStringValues = null; @@ -165,7 +214,7 @@ { addValue(NAME_ERROR_DETAILS, msg); } - addErrorCategory(eb); + addErrorCodes(eb); } if (aException instanceof InstallerException) { @@ -193,25 +242,24 @@ } /** - * Get a string value from this message. - * @throws IllegalArgumentException if value with given name is not found + * Returns a string value from this message, or null + * if string value is not present. */ - public String getStringValue(String aName) + String getStringValue(String aName) { Object value = iNamedStringValues.get(aName); if (value instanceof String) { return (String)value; } - throw new IllegalArgumentException( - "InstallerResultMessage: string value " + aName + " not found"); + return null; } /** * Get an int value from this message. * @throws IllegalArgumentException if value with given name is not found */ - public int getIntValue(String aName) + int getIntValue(String aName) { Object value = iNamedIntValues.get(aName); if (value instanceof Integer) @@ -225,7 +273,7 @@ /** * Removes a value from this message. */ - public void removeValue(String aName) + void removeValue(String aName) { iNamedStringValues.remove(aName); iNamedIntValues.remove(aName); @@ -255,19 +303,20 @@ } if (iSifNotifier != null) { - int errCategory = 0; - int errCode = 0; - String errMsg = null; - String errDetails = null; - if (getIntValue(NAME_RESULT) != Installer.ERR_NONE) - { - errCategory = getIntValue(NAME_ERROR_CATEGORY); - errCode = Installer.ERR_GENERAL; - errMsg = getStringValue(NAME_ERROR_MSG); - errDetails = getStringValue(NAME_ERROR_DETAILS); - } try { + int result = getIntValue(NAME_RESULT); + int errCategory = 0; + int errCode = 0; + String errMsg = null; + String errDetails = null; + if (result != Installer.ERR_NONE) + { + errCategory = getIntValue(NAME_ERROR_CATEGORY); + errCode = getIntValue(NAME_ERROR_CODE); + errMsg = getStringValue(NAME_ERROR_MSG); + errDetails = getStringValue(NAME_ERROR_DETAILS); + } iSifNotifier.notifyEnd(errCategory, errCode, errMsg, errDetails); } catch (Throwable t) @@ -298,7 +347,7 @@ { comms.connect(aEndpoint); CommsMessage msg = new CommsMessage(); - msg.setMessageId(601); + msg.setMessageId(INSTALLER_RESULT_MESSAGE_ID); // Initialise the message data. msg.write(iNamedIntValues.size()); Enumeration e = iNamedIntValues.keys(); @@ -318,7 +367,7 @@ } // Send the message. Log.log("Sending InstallerResultMessage to " + aEndpoint); - CommsMessage installerResultResponse = comms.sendReceive(msg, 5); + comms.sendReceive(msg, 5); comms.disconnect(); Log.log("Received InstallerResultResponse from " + aEndpoint); } @@ -385,48 +434,34 @@ } /** - * Adds error category to the result message. + * Adds error codes to the result message. */ - private void addErrorCategory(ExceptionBase aEb) + private void addErrorCodes(ExceptionBase aEb) { - switch (aEb.getShortMessageId()) + if (aEb.getShortMessageId() >= ErrorMessageBase.INSTALLER_RANGE_START && + aEb.getShortMessageId() <= ErrorMessageBase.INSTALLER_RANGE_END) { - case InstallerErrorMessage.INST_NO_MEM: - addValue(NAME_ERROR_CATEGORY, 2); // ELowDiskSpace - break; - case InstallerErrorMessage.INST_NO_NET: - addValue(NAME_ERROR_CATEGORY, 3); // ENetworkUnavailable - break; - case InstallerErrorMessage.INST_CORRUPT_PKG: - addValue(NAME_ERROR_CATEGORY, 5); // ECorruptedPackage - break; - case InstallerErrorMessage.INST_COMPAT_ERR: - addValue(NAME_ERROR_CATEGORY, 6); // EApplicationNotCompatible - break; - case InstallerErrorMessage.INST_AUTHORIZATION_ERR: - // fall through - case InstallerErrorMessage.INST_AUTHENTICATION_ERR: - addValue(NAME_ERROR_CATEGORY, 7); // ESecurityError - break; - case InstallerErrorMessage.INST_PUSH_REG_ERR: - // fall through - case InstallerErrorMessage.INST_UNEXPECTED_ERR: - // fall through - case InstallerErrorMessage.UNINST_UNEXPECTED_ERR: - // fall through - case InstallerErrorMessage.OTHER_UNEXPECTED_ERR: - addValue(NAME_ERROR_CATEGORY, 8); // EUnexpectedError - break; - case InstallerErrorMessage.INST_CANCEL: - // fall through - case InstallerErrorMessage.UNINST_CANCEL: - addValue(NAME_ERROR_CATEGORY, 9); // EUserCancelled - break; - case InstallerErrorMessage.UNINST_NOT_ALLOWED: - addValue(NAME_ERROR_CATEGORY, 10); // EUninstallationBlocked - break; - default: - addValue(NAME_ERROR_CATEGORY, 8); // EUnexpectedError + addValue(NAME_ERROR_CATEGORY, + SifRegistrator.getErrorCategory(aEb.getShortMessageId())); + addValue(NAME_ERROR_CODE, + aEb.getShortMessageId()*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()); } } } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckJarPackages.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -73,7 +73,8 @@ // Application touch support detection is not needed // if Nokia-MIDlet-On-Screen-Keypad has been defined. boolean touchDetection = true; - if (ball.getAttributeValue("Nokia-MIDlet-On-Screen-Keypad") != null) + if (ball.getAttributeValue("Nokia-MIDlet-On-Screen-Keypad") != null && + ball.iSuite.getOnScreenKeypad() != SuiteInfo.OSK_UNDEFINED) { touchDetection = false; } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConvertIcons.java Mon Aug 23 16:38:44 2010 +0100 @@ -258,10 +258,11 @@ // the attribute MIDlet- iconName = newApp.getIconPath(); } - if (iconName.length() == 0) + if (iconName.length() == 0 || iconName.equals(suiteIconName)) { - // No MIDlet icon defined, use already converted suite - // icon if it exists + // No MIDlet icon defined or MIDlet icon defined to be + // the same as suite icon, use already converted suite + // icon if it exists. if (suiteIconFile.length() > 0) { // Must make separate copy of the suite icon for each diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/DlListener.java Mon Aug 23 16:38:44 2010 +0100 @@ -81,8 +81,6 @@ } if (iBall.iSifNotifier != null) { - Log.log("DlListener.set: update SifNotifier to " + - aDlInfo.getCurrentSize() + " / " + aDlInfo.getTotalSize()); try { iBall.iSifNotifier.notifyProgress( diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/FinalizeInstallation.java Mon Aug 23 16:38:44 2010 +0100 @@ -150,6 +150,9 @@ 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()); @@ -302,11 +305,18 @@ } } - //if (ball.iSifRegistrator.getSifMode() > 0 && launchApp) - //{ - // ball.iSifRegistrator.launchAppView(); - //} - //else + 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.iCaptainMsgs && launchApp && launchAppInfo.getApplications() != null && launchAppInfo.getApplications().length > 0) diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/HandleCustomAttributes.java Mon Aug 23 16:38:44 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" @@ -23,10 +23,13 @@ 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; @@ -53,7 +56,7 @@ { if (aBall.iApplicationRegistrator.isOnDeviceKeypadNeeded()) { - // default value when on-screen-keypad is needed + // Default value when on-screen-keypad is needed. aBall.iSuite.setOnScreenKeypad(SuiteInfo.OSK_GAMEACTIONS); String attrName = "Nokia-MIDlet-On-Screen-Keypad"; @@ -74,13 +77,16 @@ } else { - Log.logWarning("Invalid " + attrName + " value " + attrValue); + // Ignore on-screen-keypad attribute with invalid value. + aBall.iSuite.setOnScreenKeypad(SuiteInfo.OSK_UNDEFINED); + Log.logWarning("Ignoring invalid " + attrName + + " value " + attrValue); } } } else { - // If the device does not need on-screen-keypad, the value is not set at all + // If the device does not need on-screen-keypad, the value is not set at all. aBall.iSuite.setOnScreenKeypad(SuiteInfo.OSK_UNDEFINED); } @@ -98,18 +104,52 @@ { 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 (apps.size() < i) { break; } - if (attrValue.equalsIgnoreCase("false")) + + // 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")) { ((ApplicationInfo)apps.elementAt(i-1)). setAutoStart(ApplicationInfo.AUTOSTART_FALSE); } - else if (attrValue.equalsIgnoreCase("true")) + else if (attrValue.equalsIgnoreCase("true") || + attrValue.equalsIgnoreCase("yes")) { ((ApplicationInfo)apps.elementAt(i-1)). setAutoStart(ApplicationInfo.AUTOSTART_TRUE); diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/InstallBall.java Mon Aug 23 16:38:44 2010 +0100 @@ -20,6 +20,7 @@ import java.util.Hashtable; +import com.nokia.mj.impl.installer.Installer; import com.nokia.mj.impl.installer.InstallationNotifier; import com.nokia.mj.impl.installer.applicationregistrator.ApplicationRegistrator; import com.nokia.mj.impl.installer.applicationregistrator.SifNotifier; @@ -303,10 +304,11 @@ Log.logWarning("checkForCancel: Stopping downloader failed", t); } } - throw new InstallerException - (InstallerErrorMessage.INST_CANCEL, null, - InstallerDetailedErrorMessage.NO_MSG, null, - OtaStatusCode.USER_CANCELLED); + throw new InstallerException( + Installer.ERR_CANCEL, + InstallerErrorMessage.INST_CANCEL, null, + InstallerDetailedErrorMessage.INST_CANCEL, null, + OtaStatusCode.USER_CANCELLED); } } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/OcspListener.java Mon Aug 23 16:38:44 2010 +0100 @@ -78,7 +78,6 @@ } if (iBall.iSifNotifier != null) { - Log.log("OcspListener.ocspEvent: update SifNotifier to 0 / 0"); try { iBall.iSifNotifier.notifyProgress( @@ -109,7 +108,6 @@ } if (iBall.iSifNotifier != null) { - Log.log("OcspListener.ocspEvent: update SifNotifier to 100 / 100"); try { iBall.iSifNotifier.notifyProgress( diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareInstallation.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -29,6 +29,7 @@ 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; @@ -37,8 +38,11 @@ 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 { @@ -170,6 +174,11 @@ { aBall.iJarUrl = jarArg; } + else if (isFileUrl(jarArg)) + { + aBall.iJarFilename = getFileFromUrl(jarArg); + Log.log("Jar " + aBall.iJarFilename + " from URL " + jarArg); + } else { aBall.iJarFilename = jarArg; @@ -181,6 +190,11 @@ { aBall.iJadUrl = jadArg; } + else if (isFileUrl(jadArg)) + { + aBall.iJadFilename = getFileFromUrl(jadArg); + Log.log("Jad " + aBall.iJadFilename + " from URL " + jadArg); + } else { aBall.iJadFilename = jadArg; @@ -266,6 +280,7 @@ if (arg != null) { aBall.iInstallationDrive = args.parseDrive(arg); + checkInstallationDrive(aBall.iInstallationDrive); } } @@ -346,4 +361,60 @@ 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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareSplashScreen.java Mon Aug 23 16:38:44 2010 +0100 @@ -35,10 +35,11 @@ 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 - * screen images from MIDlet-Splash-Screen-Image attribute. + * screen images from Nokia-MIDlet-Splash-Screen-Image attribute. */ public class PrepareSplashScreen extends ExeStep { @@ -70,7 +71,7 @@ return; } - String attrName = "MIDlet-Splash-Screen-Image"; + String attrName = "Nokia-MIDlet-Splash-Screen-Image"; String attrValue = ball.getAttributeValue(attrName); if (attrValue != null && attrValue.length() > 0) { @@ -106,15 +107,21 @@ for (int i = 0; i < tokens.length; i++) { tokens[i] = tokens[i].trim(); - currentImage = loadImage(tokens[i], ball.iJarFilename); - if (currentImage == null) + imageSizes[i] = getImageSize(tokens[i], ball.iJarFilename); + if (imageSizes[i] == null) { - // Image loading failed, proceed to the next image. - imageSizes[i] = new Point(0, 0); - continue; + // 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); } - imageSizes[i] = new Point( - currentImage[0].width, currentImage[0].height); } // Choose the images which best fill the portrait and // landscape screens. @@ -237,6 +244,74 @@ } /** + * 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 @@ -252,8 +327,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); @@ -319,8 +394,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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/RegisterApplicationToSif.java Mon Aug 23 16:38:44 2010 +0100 @@ -40,11 +40,11 @@ Log.log("Old suite unregistered from SIF"); } - if (ball.iSourceUrl != null) + if (ball.iAuthenticationCredentials != null) { - // Save source URL to suite as jad URL which is - // registered to SIF as download URL. - ball.iSuite.setJadUrl(ball.iSourceUrl); + // Set protection domain name. + ball.iSuite.setProtectionDomainName( + ball.iAuthenticationCredentials[0].getProtectionDomainName()); } // Initialize application installation group to SuiteInfo. diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/StartProgressNotifications.java Mon Aug 23 16:38:44 2010 +0100 @@ -36,6 +36,12 @@ InstallBall ball = (InstallBall)aBall; Log.log("Starting progress notifications..."); + if (ball.iPreinstallation) + { + Log.log("SifNotifier disabled during preinstallation."); + return; + } + if (!SifNotifier.enabled()) { Log.log("SifNotifier disabled."); @@ -99,9 +105,17 @@ } catch (Throwable t) { - Log.logError("StartProgressNotifications: SifNotifier.notifyStart failed", 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; } - // Set SifNotifier for the listeners that should use it. ball.iInstallationNotifier.setSifNotifier(ball.iSifNotifier); } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/ConfirmUninstallation.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/ConfirmUninstallation.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/ConfirmUninstallation.java Mon Aug 23 16:38:44 2010 +0100 @@ -76,8 +76,9 @@ int idxMinus = -1; do { - attrValue = ball.iSuite.getAttributeValue(attrName + "-" + locale); - Log.log(attrName + "-" + locale + ": " + attrValue); + String localizedAttrName = "Nokia-" + attrName + "-" + locale; + attrValue = ball.iSuite.getAttributeValue(localizedAttrName); + Log.log(localizedAttrName + ": " + attrValue); idxMinus = locale.lastIndexOf('-'); // If attribute is not found using full locale, e.g. 'en-GB', // strip the most specific part of the locale out diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/FinalizeUninstallation.java Mon Aug 23 16:38:44 2010 +0100 @@ -102,6 +102,10 @@ 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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/GetFromStorage.java Mon Aug 23 16:38:44 2010 +0100 @@ -54,6 +54,15 @@ // Check if debug attribute has been defined for this suite. ball.setDebug(ball.iSuite.getAttributeValue("Nokia-MIDlet-Install-Debug")); + // Check from arguments if preinstall state should be reset. + String arg = ball.iArgs.get("resetpreinstall"); + if (arg != null) + { + ball.iSuite.setResetPreinstall(true); + ball.log("ResetPreinstall set"); + } + + // Log all suite info. //ball.log(ball.iSuite.toString()); } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/StartProgressNotifications.java Mon Aug 23 16:38:44 2010 +0100 @@ -91,8 +91,16 @@ 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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/UninstallBall.java Mon Aug 23 16:38:44 2010 +0100 @@ -21,6 +21,7 @@ import java.util.Hashtable; import java.util.Vector; +import com.nokia.mj.impl.installer.Installer; import com.nokia.mj.impl.installer.InstallationNotifier; import com.nokia.mj.impl.installer.applicationregistrator.ApplicationRegistrator; import com.nokia.mj.impl.installer.applicationregistrator.SifNotifier; @@ -124,10 +125,11 @@ super.checkForCancel(); if (isCancelled()) { - throw new InstallerException - (InstallerErrorMessage.UNINST_CANCEL, null, - InstallerDetailedErrorMessage.NO_MSG, null, - OtaStatusCode.USER_CANCELLED); + throw new InstallerException( + Installer.ERR_CANCEL, + InstallerErrorMessage.UNINST_CANCEL, null, + InstallerDetailedErrorMessage.UNINST_CANCEL, null, + OtaStatusCode.USER_CANCELLED); } } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandler.java Mon Aug 23 16:38:44 2010 +0100 @@ -925,13 +925,23 @@ } else { - // Not an update ==> user is making uninstallation. + // Not an update ==> suite is being uninstalled. int oldPreinstallState = readPreinstallState(aSuiteInfo); if (oldPreinstallState == aSuiteInfo.STATE_PREINSTALLED) { - // User is uninstalling a preinstalled application, - // set preinstall state to STATE_NO_PREINSTALL. - setNoPreinstallState(aSuiteInfo); + if (aSuiteInfo.getResetPreinstall()) + { + // Preinstallation state should be reset, + // remove existing data from + // StorageNames.PREINSTALL_TABLE table. + removePreinstallState(aSuiteInfo); + } + else + { + // User is uninstalling a preinstalled application, + // set preinstall state to STATE_NO_PREINSTALL. + setNoPreinstallState(aSuiteInfo); + } } else if (oldPreinstallState == aSuiteInfo.STATE_INSTALLED) { @@ -1081,13 +1091,11 @@ /** * Removes preinstall state for given suite from - * preinstall table but only if preinstall state - * in given SuiteInfo is SuiteInfo.STATE_INSTALLED. + * preinstall table */ private void removePreinstallState(SuiteInfo aSuiteInfo) { - if (aSuiteInfo == null || - aSuiteInfo.iPreinstallState != aSuiteInfo.STATE_INSTALLED) + if (aSuiteInfo == null) { return; } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/SuiteInfo.java Mon Aug 23 16:38:44 2010 +0100 @@ -73,6 +73,9 @@ private String iAccessPoint = null; // Flag telling if application suite is trusted private boolean iTrusted = false; + // Flag telling if preinstallation state should be + // reseted in uninstallation. + private boolean iResetPreinstall = false; /** Flag telling if default icon should be used. */ private boolean iUseDefaultIcon = false; @@ -80,6 +83,8 @@ 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, @@ -521,6 +526,22 @@ } /** + * 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 @@ -740,6 +761,14 @@ } /** + * 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 @@ -757,6 +786,24 @@ } /** + * Get the flag telling if preinstallation state should be reset. + * Used only in uninstallation. + */ + public boolean getResetPreinstall() + { + return iResetPreinstall; + } + + /** + * Set the flag telling if preinstallation state should be reset. + * Used only in uninstallation. + */ + public void setResetPreinstall(boolean aResetPreinstall) + { + iResetPreinstall = aResetPreinstall; + } + + /** * Calculates initial size from MIDlet-Data-Size and * MIDlet-Jar-Size attributes, or if they are not present * from jar file size. @@ -839,9 +886,11 @@ 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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/Args.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,6 +20,7 @@ import com.nokia.mj.impl.installer.utils.InstallerException; import com.nokia.mj.impl.installer.utils.Log; +import com.nokia.mj.impl.utils.Base64; import com.nokia.mj.impl.utils.Tokenizer; import java.util.Hashtable; @@ -59,6 +60,7 @@ //Log.log("Args: " + arg + "=" + value); } } + decodeBase64Args(); } /** @@ -203,7 +205,59 @@ } drive = aDrive.toLowerCase().charAt(0) - 'a'; } - Log.log("Parsed drive " + aDrive + " --> " + drive); + Log.log("Args: Parsed drive " + aDrive + " --> " + drive); return drive; } + + /** + * Decodes base64 encoded arguments. + * In Symbian environment the decoded argument is UTF-16LE string. + * + * @see /sf/app/jrt/javacommons/utils/inc/javacommonutils.h, + * wbase64encode() + */ + private void decodeBase64Args() + { + String base64Value = get("base64"); + if (base64Value == null || base64Value.length() == 0) + { + return; + } + String[] tokens = Tokenizer.split(base64Value, ","); + String name = null; + String value = null; + for (int i = 0; i < tokens.length; i++) + { + name = tokens[i]; + value = null; + if (name != null && name.length() > 0) + { + value = get(name); + } + if (value != null && value.length() > 0) + { + try + { + byte[] valueBytes = Base64.decode(value); + if (valueBytes != null && valueBytes.length > 0) + { + value = new String(valueBytes, "UTF-16LE"); + Log.log("Args: Base64 decoded option " + + name + "=" + value); + iArgs.put(name, value); + } + else + { + Log.logError("Args: Base64 decoding failed for " + + name + "=" + value); + } + } + catch (Throwable t) + { + Log.logError("Args: Base64 decoding failed for " + + name + "=" + value, t); + } + } + } + } } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/PropertyListener.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/PropertyListener.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/rt/installer/ApplicationUtilsImpl.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -85,6 +85,11 @@ Installer.cancel(); } + public void uiDisposed() + { + Log.log("ApplicationUtilsImpl.uiDisposed"); + } + public void checkPermission(Permission aPermission) throws AccessControlException, NullPointerException { diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/applicationregistrator/applicationregistrator.cpp --- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/applicationregistrator.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/applicationregistrator.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -30,6 +30,12 @@ #include #include +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#include +#include +#include +#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS #include #else @@ -50,7 +56,13 @@ // 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 */ @@ -66,6 +78,13 @@ */ _LIT(KAppPostfix, ".fakeapp"); + +#ifdef RD_JAVA_S60_RELEASE_9_2 +const TInt KAppIconCount = 2; +#else +const TInt KAppIconCount = 1; +#endif + // ------------------------ /** @@ -80,14 +99,6 @@ jboolean aBackground); /** - * Internal helper method for checking whether Application Shell is already running - * Used JNI method ...1startAppShellUi - * - * @return ETrue if AppShell is running - */ -TBool isAppShellUiRunning(); - -/** * Internal helper method for checking whether this code is executing in * a device that has correctly working version of * RApaLsSession::ForceCommitNonNativeApplicationsUpdatesL() @@ -95,6 +106,15 @@ * @return ETrue if force commit works well */ TBool isForceCommitSupported(); +#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + +/** + * Internal helper method for checking whether Application Shell is already running + * Used JNI method ...1startAppShellUi + * + * @return ETrue if AppShell is running + */ +TBool isAppShellUiRunning(); /** * Internal helper method for starting menu application @@ -129,8 +149,7 @@ return err; } -#if 1 -//#ifndef RD_JAVA_USIF_APP_REG +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK // Delete any pending (un)registrations (possible if // e.g. device rebooted before commit). // This call does nothing if there is no pending registrations. @@ -145,7 +164,7 @@ pApaSession->Close(); return err; } -#endif // RD_JAVA_USIF_APP_REG +#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK // Return handle to session. Utilize the fact that in Symbian // all pointer addresses are MOD 4 so the last 2 bits are 0 @@ -169,8 +188,7 @@ * @param[in] aBackground * @return 0 if registration succeeded or Symbian error code */ -#if 0 -//#ifdef RD_JAVA_USIF_APP_REG +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1registerApplication (JNIEnv */*aEnv*/, jclass /*aClass*/, jint /*aSessionHandle*/, jint /*aUid*/, jstring /*aGroupName*/, jstring /*aMIDletName*/, jstring /*aTargetDrive*/, jstring /*aIconFileName*/, @@ -178,7 +196,7 @@ { return KErrNone; } -#else +#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1registerApplication (JNIEnv *aEnv, jclass aClass, jint aSessionHandle, jint aUid, jstring aGroupName, jstring aMIDletName, jstring aTargetDrive, jstring aIconFileName, @@ -345,7 +363,6 @@ return err; } -#endif // RD_JAVA_USIF_APP_REG /** @@ -361,7 +378,7 @@ RFile appArcIcon; TUid midletUid; TInt err; - TInt numberOfIcons = 1; // Conversion results always one icon in mbm. + TInt numberOfIcons = KAppIconCount; // number of icons stored in MBM // Also default mbm has one icon. midletUid.iUid = aUid; @@ -477,6 +494,7 @@ return err; } +#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /** @@ -486,14 +504,13 @@ * @param[in] aUid The Uid of the application to be unregistered.. * @return 0 if unregistration succeeded or Symbian error code */ -#if 0 -//#ifdef RD_JAVA_USIF_APP_REG +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1unregisterApplication (JNIEnv *, jclass, jint /*aSessionHandle*/, jint /*aUid*/) { return KErrNone; } -#else +#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1unregisterApplication (JNIEnv *, jclass, jint aSessionHandle, jint aUid) { @@ -506,7 +523,7 @@ TRAPD(err, pApaSession->DeregisterNonNativeApplicationL(appUid)); return err; } -#endif // RD_JAVA_USIF_APP_REG +#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /** @@ -527,8 +544,7 @@ TInt err = KErrNone; -#if 1 -//#ifndef RD_JAVA_USIF_APP_REG +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK if (aSynchronous) { // Make synchronous commit @@ -556,12 +572,12 @@ // Use always this synchronous commit when running in emulator // to make writing autotest cases easier. TRAP(err, pApaSession->CommitNonNativeApplicationsUpdatesL()); -#else +#else // __WINS__ // asynchronous commit TRAP(err, pApaSession->ForceCommitNonNativeApplicationsUpdatesL()); #endif // __WINS__ } -#endif // RD_JAVA_USIF_APP_REG +#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK if (KErrNone == err) { @@ -586,10 +602,9 @@ reinterpret_cast(aSessionHandle<<2); TInt err = KErrNone; -#if 1 -//#ifndef RD_JAVA_USIF_APP_REG +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK err = pApaSession->RollbackNonNativeApplicationsUpdates(); -#endif // RD_JAVA_USIF_APP_REG +#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK pApaSession->Close(); delete pApaSession; @@ -930,6 +945,7 @@ } +#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /** * Internal helper method for checking whether this code is executing in * a device that has correctly working version of @@ -974,3 +990,75 @@ 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp --- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -21,21 +21,11 @@ #include "javasymbianoslayer.h" // for CleanupResetAndDestroyPushL #include "logger.h" -#if defined(SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK) && defined(RD_JAVA_USIF_NOTIFY_PROGRESS) +#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK #include #include -// Helper macro for logging a TDesC. -#define LOG_TDESC_L(compIdParam, logLevelParam, msgParam, tdescParam) \ - { \ - HBufC8* tdescBuf = HBufC8::NewLC(tdescParam.Length() + 1); \ - TPtr8 tdescPtr(tdescBuf->Des()); \ - tdescPtr.Append(tdescParam); \ - LOG1(compIdParam, logLevelParam, msgParam, tdescPtr.PtrZ());\ - CleanupStack::PopAndDestroy(tdescBuf); \ - } - // NAMESPACE DECLARATION using namespace java; using namespace Usif; @@ -101,6 +91,7 @@ HBufC *appIcon = CreateHBufCFromJavaStringLC(aEnv, tmpAppIcon); applicationIcons.AppendL(appIcon); CleanupStack::Pop(appIcon); + aEnv->DeleteLocalRef(tmpAppIcon); } else { @@ -161,7 +152,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) @@ -174,24 +165,29 @@ errMsgDetails = CreateHBufCFromJavaStringLC(aEnv, aErrMsgDetails); } - CSifOperationEndData *endData = CSifOperationEndData::NewLC( - *globalComponentId, (TErrorCategory)aErrCategory, aErrCode, - *errMsg, *errMsgDetails); + CSifOperationEndData *endData = + CSifOperationEndData::NewLC( + *globalComponentId, (TErrorCategory)aErrCategory, aErrCode, + (NULL != errMsg? *errMsg: KNullDesC()), + (NULL != errMsgDetails? *errMsgDetails: KNullDesC())); + // 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 != aErrMsg) + if (NULL != errMsgDetails) + { + CleanupStack::PopAndDestroy(errMsgDetails); + } + if (NULL != errMsg) { CleanupStack::PopAndDestroy(errMsg); } - if (NULL != aErrMsgDetails) - { - CleanupStack::PopAndDestroy(errMsgDetails); - } CleanupStack::PopAndDestroy(globalComponentId); - __UHEAP_MARKEND; + //__UHEAP_MARKEND; } /* @@ -203,10 +199,25 @@ (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; } @@ -286,7 +297,7 @@ return KErrNone; } -#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK && RD_JAVA_USIF_NOTIFY_PROGRESS +#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /* * Class: com_nokia_mj_impl_installer_applicationregistrator_SifNotifier @@ -370,4 +381,4 @@ return KErrNone; } -#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK && RD_JAVA_USIF_NOTIFY_PROGRESS +#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp --- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -24,6 +24,7 @@ #include #include "com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator.h" +#include "com_nokia_mj_impl_utils_InstallerErrorMessage.h" #include "javacommonutils.h" #include "javasymbianoslayer.h" // for CleanupResetAndDestroyPushL #include "logger.h" @@ -31,53 +32,39 @@ // 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 -#endif // RD_JAVA_USIF_APP_REG +#include +#include // Helper macro for logging a TDesC. #define LOG_TDESC_L(compIdParam, logLevelParam, msgParam, tdescParam) \ - { \ - HBufC8* tdescBuf = HBufC8::NewLC(tdescParam.Length() + 1); \ - TPtr8 tdescPtr(tdescBuf->Des()); \ - tdescPtr.Append(tdescParam); \ - LOG1(compIdParam, logLevelParam, msgParam, tdescPtr.PtrZ());\ - CleanupStack::PopAndDestroy(tdescBuf); \ + { \ + std::wstring ws((wchar_t*)tdescParam.Ptr(), tdescParam.Length()); \ + LOG1(compIdParam, logLevelParam, msgParam, ws.c_str()); \ } // NAMESPACE DECLARATION -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 @@ -187,7 +174,6 @@ * See JNI method __1notifyAppChange. * This method makes calls that may leave (the actual registering). */ -#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC void NotifyAppChangeL(JNIEnv *aEnv, jintArray aAppUids, jint aAppChange) { RApaLsSession apaSession; @@ -220,11 +206,6 @@ CleanupStack::PopAndDestroy(&apaSession); LOG(EJavaInstaller, EInfo, "NotifyAppChangeL completed"); } -#else -void NotifyAppChangeL(JNIEnv *, jintArray, jint) -{ -} -#endif // RD_JAVA_USIF_NOTIFY_APP_ARC /* * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator @@ -235,12 +216,6 @@ (JNIEnv *aEnv, jclass, jintArray aAppUids, jint aAppChange) { TRAPD(err, NotifyAppChangeL(aEnv, aAppUids, aAppChange)); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "notifyAppChange: notifying AppArc failed, error %d", - err); - } return err; } @@ -254,86 +229,47 @@ { TInt err = KErrNone; - QServiceManager serviceManager; - QObject* activityManager = - serviceManager.loadInterface("com.nokia.qt.activities.ActivityManager"); - if (!activityManager) + CActiveScheduler* newScheduler = 0; + if (0 == CActiveScheduler::Current()) { - 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; + // Create ActiveScheduler as it does not yet exist. + newScheduler = new CActiveScheduler; + CActiveScheduler::Install(newScheduler); } - // 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 + QUrl openRecentView("appto://20022F35?activityname=AppLibRecentView"); + XQApplicationManager applicationManager; + XQAiwRequest *request = applicationManager.create(openRecentView); + if (request) { - aScr->DeleteSoftwareTypeL(Usif::KSoftwareTypeJava, javaMimeTypes); + 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; } - CleanupStack::PopAndDestroy(&javaMimeTypes); -} -/* - * 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) + if (newScheduler) { - return err; + delete newScheduler; + newScheduler = 0; } - TRAP(err, RegisterJavaSoftwareTypeL(pScr, aRegister)); - if (KErrNone != err) + + if (KErrNone == err) { - ELOG1(EJavaInstaller, - "registerJavaSoftwareType: registration failed, error %d", - err); + // Start AppLib and bring it to foreground. + const TUid KAppLibUid = { 0x20022F35 }; + TRAP(err, StartAppL(KAppLibUid)); } - pScr->Close(); - delete pScr; return err; } @@ -408,12 +344,6 @@ TRAPD(err, pScr->RollbackTransactionL()); pScr->Close(); delete pScr; - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "rollbackSession: Rolling back transaction failed, error %d", - err); - } return err; } @@ -443,9 +373,9 @@ HBufC *valueBuf = CreateHBufCFromJavaStringLC(aEnv, aValue); aScr->SetComponentPropertyL(aComponentId, aName, *valueBuf); //LOG_TDESC_L(EJavaInstaller, EInfo, - // "SetComponentPropertyL: name %s", aName); + // "SetComponentPropertyL: name %S", aName); //LOG_TDESC_L(EJavaInstaller, EInfo, - // "SetComponentPropertyL: value %s", valueBuf->Des()); + // "SetComponentPropertyL: value %S", valueBuf->Des()); CleanupStack::PopAndDestroy(valueBuf); } } @@ -456,23 +386,14 @@ */ TComponentId RegisterComponentL( JNIEnv *aEnv, RSoftwareComponentRegistry *aScr, jint aUid, - jstring aSuiteName, jstring aVendor, jstring aVersion, - jstring aName, jstring aGlobalId, + jstring aSuiteName, jstring aVendor, jstring aVersion, jstring aGlobalId, jobjectArray aComponentFiles, TInt64 aComponentSize, TBool aIsRemovable, TBool aIsDrmProtected, TBool aIsOriginVerified, TBool aIsUpdate, jint aMediaId, - jstring aMidletInfoUrl, jstring aMidletDescription, jstring aDownloadUrl) + jstring aMidletInfoUrl, jstring aMidletDescription, + jstring aDownloadUrl, jstring aUpdateUrl) { - HBufC *name = NULL; - if (NULL == aName) - { - // If name is not specified, use suite name. - name = CreateHBufCFromJavaStringLC(aEnv, aSuiteName); - } - else - { - name = CreateHBufCFromJavaStringLC(aEnv, aName); - } + HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aSuiteName); HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor); HBufC *version = CreateHBufCFromJavaStringLC(aEnv, aVersion); HBufC *globalId = CreateHBufCFromJavaStringLC(aEnv, aGlobalId); @@ -499,14 +420,10 @@ aScr->SetComponentPropertyL(componentId, KSettingsPlugin(), KSettingsPluginValue()); //LOG(EJavaInstaller, EInfo, "RegisterComponentL: Settings plugin property set"); - if (NULL != aName) - { - // If name is specified, store suite name as property. - SetComponentPropertyL(aEnv, aScr, componentId, KMIDletName(), aSuiteName); - } SetComponentPropertyL(aEnv, aScr, componentId, KMIDletInfoURL(), aMidletInfoUrl); SetComponentPropertyL(aEnv, aScr, componentId, KMIDletDescription(), aMidletDescription); SetComponentPropertyL(aEnv, aScr, componentId, KDownloadURL(), aDownloadUrl); + SetComponentPropertyL(aEnv, aScr, componentId, KUpdateURL(), aUpdateUrl); CleanupStack::PopAndDestroy(globalId); CleanupStack::PopAndDestroy(version); @@ -532,22 +449,23 @@ */ JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1registerComponent (JNIEnv *aEnv, jclass, jint aSessionHandle, jint aUid, jstring aSuiteName, - jstring aVendor, jstring aVersion, jstring aName, jstring aGlobalId, + jstring aVendor, jstring aVersion, jstring aGlobalId, jobjectArray aComponentFiles, jlong aComponentSize, jboolean aIsRemovable, jboolean aIsDrmProtected, jboolean aIsOriginVerified, jboolean aIsUpdate, jint aMediaId, jstring aMidletInfoUrl, jstring aMidletDescription, - jstring aDownloadUrl, jobject aComponentId) + jstring aDownloadUrl, jstring aUpdateUrl, jobject aComponentId) { - //__UHEAP_MARK; + __UHEAP_MARK; RSoftwareComponentRegistry *pScr = reinterpret_cast(aSessionHandle<<2); TComponentId componentId = -1; TRAPD(err, componentId = RegisterComponentL( - aEnv, pScr, aUid, aSuiteName, aVendor, aVersion, aName, aGlobalId, + aEnv, pScr, aUid, aSuiteName, aVendor, aVersion, aGlobalId, aComponentFiles, aComponentSize, aIsRemovable, aIsDrmProtected, aIsOriginVerified, aIsUpdate, aMediaId, - aMidletInfoUrl, aMidletDescription, aDownloadUrl)); - //__UHEAP_MARKEND; + aMidletInfoUrl, aMidletDescription, + aDownloadUrl, aUpdateUrl)); + __UHEAP_MARKEND; if (KErrNone == err) { jclass clazz = aEnv->GetObjectClass(aComponentId); @@ -565,18 +483,16 @@ 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; } @@ -584,7 +500,6 @@ * See JNI method __1registerApplication. * This method makes calls that may leave. */ -#ifdef RD_JAVA_USIF_APP_REG void RegisterApplicationL( JNIEnv *aEnv, RSoftwareComponentRegistry *aScr, jint aComponentId, jint aAppUid, @@ -652,47 +567,36 @@ RPointerArray captionsArray; CleanupResetAndDestroyPushL(captionsArray); TInt langCount = aEnv->GetArrayLength(aLanguages); - TInt captionCount = aEnv->GetArrayLength(aAppNames); - if (langCount == captionCount) + jint* languages = aEnv->GetIntArrayElements(aLanguages, NULL); + for (TInt i = 0; i < langCount; i++) { - jint* languages = aEnv->GetIntArrayElements(aLanguages, NULL); - for (TInt i = 0; i < langCount; i++) - { - TLanguage tmpLanguage = (TLanguage)languages[i]; - HBufC *tmpCaption = - CreateHBufCFromJavaStringLC( - aEnv, (jstring)aEnv->GetObjectArrayElement(aAppNames, i)); - captionsArray.AppendL(tmpCaption); - CleanupStack::Pop(tmpCaption); - //LOG1(EJavaInstaller, EInfo, - // "RegisterApplicationL: language %d", tmpLanguage); - //LOG_TDESC_L(EJavaInstaller, EInfo, - // "RegisterApplicationL: caption %s", tmpCaption->Des()); - CCaptionAndIconInfo *tmpCaptionAndIconInfo = - CCaptionAndIconInfo::NewLC( - /*aCaption=*/ *tmpCaption, - /*aIconFileName=*/ KNullDesC, - /*aNumOfAppIcons=*/ 0); - CLocalizableAppInfo *tmpLocAppInfo = - CLocalizableAppInfo::NewLC( - /*aShortCaption=*/ KNullDesC, - /*aApplicationLanguage=*/ tmpLanguage, - /*aGroupName=*/ KNullDesC, - /*aCaptionAndIconInfo=*/ tmpCaptionAndIconInfo, - /*aViewDataList=*/ viewDataList); - localizableAppInfoList.AppendL(tmpLocAppInfo); - CleanupStack::Pop(tmpLocAppInfo); - CleanupStack::Pop(tmpCaptionAndIconInfo); - } - aEnv->ReleaseIntArrayElements(aLanguages, languages, 0); + TLanguage tmpLanguage = (TLanguage)languages[i]; + HBufC *tmpCaption = + CreateHBufCFromJavaStringLC( + aEnv, (jstring)aEnv->GetObjectArrayElement(aAppNames, i)); + captionsArray.AppendL(tmpCaption); + CleanupStack::Pop(tmpCaption); + //LOG1(EJavaInstaller, EInfo, + // "RegisterApplicationL: language %d", tmpLanguage); + //LOG_TDESC_L(EJavaInstaller, EInfo, + // "RegisterApplicationL: caption %S", tmpCaption->Des()); + CCaptionAndIconInfo *tmpCaptionAndIconInfo = + CCaptionAndIconInfo::NewLC( + /*aCaption=*/ *tmpCaption, + /*aIconFileName=*/ KNullDesC, + /*aNumOfAppIcons=*/ 0); + CLocalizableAppInfo *tmpLocAppInfo = + CLocalizableAppInfo::NewLC( + /*aShortCaption=*/ KNullDesC, + /*aApplicationLanguage=*/ tmpLanguage, + /*aGroupName=*/ KNullDesC, + /*aCaptionAndIconInfo=*/ tmpCaptionAndIconInfo, + /*aViewDataList=*/ viewDataList); + localizableAppInfoList.AppendL(tmpLocAppInfo); + CleanupStack::Pop(tmpLocAppInfo); + CleanupStack::Pop(tmpCaptionAndIconInfo); } - else - { - WLOG2(EJavaInstaller, - "RegisterApplicationL: localisation not made because language " \ - "count does not match to caption count (%d != %d)", - langCount, captionCount); - } + aEnv->ReleaseIntArrayElements(aLanguages, languages, 0); // Create application registration data objects. TApplicationCharacteristics appCharacteristics; @@ -728,13 +632,6 @@ CleanupStack::PopAndDestroy(caption); __UHEAP_MARKEND; } -#else -void RegisterApplicationL( - JNIEnv *, RSoftwareComponentRegistry *, jint, jint, jstring, - jstring, jstring, jstring, jint, jintArray, jobjectArray) -{ -} -#endif // RD_JAVA_USIF_APP_REG /* * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator @@ -764,19 +661,13 @@ JNIEnv *aEnv, RSoftwareComponentRegistry *aScr, jint aComponentId, jstring aName, jstring aVendor, jint aLanguage) { - if (NULL != aName) - { - HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aName); - aScr->SetComponentNameL(aComponentId, *name, (TLanguage)aLanguage); - CleanupStack::PopAndDestroy(name); - } + HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aName); + aScr->SetComponentNameL(aComponentId, *name, (TLanguage)aLanguage); + CleanupStack::PopAndDestroy(name); - if (NULL != aVendor) - { - HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor); - aScr->SetVendorNameL(aComponentId, *vendor, (TLanguage)aLanguage); - CleanupStack::PopAndDestroy(vendor); - } + HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor); + aScr->SetVendorNameL(aComponentId, *vendor, (TLanguage)aLanguage); + CleanupStack::PopAndDestroy(vendor); } /* @@ -881,7 +772,6 @@ * Method: _getComponentIdForApp * Signature: (IILcom/nokia/mj/impl/installer/applicationregistrator/ComponentId;)I */ -#ifdef RD_JAVA_USIF_APP_REG JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getComponentIdForApp (JNIEnv *aEnv, jclass, jint aSessionHandle, jint aAppUid, jobject aComponentId) { @@ -901,13 +791,6 @@ } return err; } -#else -JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getComponentIdForApp -(JNIEnv *, jclass, jint, jint, jobject) -{ - return KErrNone; -} -#endif // RD_JAVA_USIF_APP_REG /** * See JNI method __1getuid. @@ -920,20 +803,8 @@ CleanupClosePushL(*pScr); TInt uid = 0; CPropertyEntry *property = pScr->GetComponentPropertyL(aCid, KUid()); - if (NULL != property) - { - if (property->PropertyType() == CPropertyEntry::EIntProperty) - { - uid = ((CIntPropertyEntry*)property)->IntValue(); - } - else - { - ELOG2(EJavaInstaller, - "GetUidL: Incorrect property type %d for cid %d", - property->PropertyType(), aCid); - } - delete property; - } + uid = ((CIntPropertyEntry*)property)->IntValue(); + delete property; // Close and delete the temporary RSoftwareComponentRegistry. CleanupStack::PopAndDestroy(pScr); delete pScr; // For some reason PopAndDestroy does not delete this. @@ -970,23 +841,16 @@ HBufC *globalId = CreateHBufCFromJavaStringLC(aEnv, aGlobalId); CComponentEntry *componentEntry = aScr->GetComponentL(*globalId, Usif::KSoftwareTypeJava, aLanguage); - if (NULL == componentEntry) - { - //LOG_TDESC_L(EJavaInstaller, EInfo, - // "Component not found for GlobalId %s", globalId->Des()); - CleanupStack::PopAndDestroy(globalId); - return; - } CleanupStack::PopAndDestroy(globalId); // Log component entry. TComponentId componentId = componentEntry->ComponentId(); - LOG_TDESC_L(EJavaInstaller, EInfo, "GlobalId: %s", componentEntry->GlobalId()); + LOG_TDESC_L(EJavaInstaller, EInfo, "GlobalId: %S", componentEntry->GlobalId()); LOG1(EJavaInstaller, EInfo, "ComponentId: %d", componentId); - LOG_TDESC_L(EJavaInstaller, EInfo, "SoftwareType: %s", componentEntry->SoftwareType()); - LOG_TDESC_L(EJavaInstaller, EInfo, "Name: %s", componentEntry->Name()); - LOG_TDESC_L(EJavaInstaller, EInfo, "Vendor: %s", componentEntry->Vendor()); - LOG_TDESC_L(EJavaInstaller, EInfo, "Version: %s", componentEntry->Version()); + LOG_TDESC_L(EJavaInstaller, EInfo, "SoftwareType: %S", componentEntry->SoftwareType()); + LOG_TDESC_L(EJavaInstaller, EInfo, "Name: %S", componentEntry->Name()); + LOG_TDESC_L(EJavaInstaller, EInfo, "Vendor: %S", componentEntry->Vendor()); + LOG_TDESC_L(EJavaInstaller, EInfo, "Version: %S", componentEntry->Version()); LOG1(EJavaInstaller, EInfo, "ComponentSize: %d", componentEntry->ComponentSize()); LOG1(EJavaInstaller, EInfo, "ScomoState: %d", componentEntry->ScomoState()); LOG1(EJavaInstaller, EInfo, "IsDrmProtected: %d", componentEntry->IsDrmProtected()); @@ -1014,42 +878,37 @@ switch (propertyEntry->PropertyType()) { case CPropertyEntry::EBinaryProperty: - LOG_TDESC_L(EJavaInstaller, EInfo, "BinaryProperty: %s", + LOG_TDESC_L(EJavaInstaller, EInfo, "BinaryProperty: %S", propertyEntry->PropertyName()); break; case CPropertyEntry::EIntProperty: - LOG_TDESC_L(EJavaInstaller, EInfo, "IntProperty: %s", + LOG_TDESC_L(EJavaInstaller, EInfo, "IntProperty: %S", propertyEntry->PropertyName()); LOG2(EJavaInstaller, EInfo, " = 0x%x (%d)", ((CIntPropertyEntry*)propertyEntry)->IntValue(), ((CIntPropertyEntry*)propertyEntry)->IntValue()); break; case CPropertyEntry::ELocalizedProperty: - LOG_TDESC_L(EJavaInstaller, EInfo, "LocalizedProperty: %s", + LOG_TDESC_L(EJavaInstaller, EInfo, "LocalizedProperty: %S", propertyEntry->PropertyName()); - LOG_TDESC_L(EJavaInstaller, EInfo, " = %s", + LOG_TDESC_L(EJavaInstaller, EInfo, " = %S", ((CLocalizablePropertyEntry*)propertyEntry)->StrValue()); break; } } CleanupStack::PopAndDestroy(&properties); -#ifdef RD_JAVA_USIF_APP_REG // Log uids of applications associated to component. RArray appUids; CleanupClosePushL(appUids); aScr->GetAppUidsForComponentL(componentId, appUids); - if (appUids.Count() == 0) - { - LOG(EJavaInstaller, EInfo, "No component appUids found from SCR"); - } + LOG1(EJavaInstaller, EInfo, "Number of AppUids found: %d", appUids.Count()); for (TInt i = 0; i < appUids.Count(); i++) { LOG2(EJavaInstaller, EInfo, "AppUid [%x] (%d)", appUids[i].iUid, appUids[i].iUid); } CleanupStack::PopAndDestroy(&appUids); -#endif // RD_JAVA_USIF_APP_REG } /** @@ -1085,11 +944,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; } @@ -1101,11 +960,51 @@ JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getUsifMode (JNIEnv *, jclass) { -#ifdef RD_JAVA_USIF_APP_REG return 1; -#else - return 0; -#endif // RD_JAVA_USIF_APP_REG +} + +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator + * Method: _getErrorCategory + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getErrorCategory +(JNIEnv *, jclass, jint aErrorId) +{ + int errorCategory = Usif::EUnexpectedError; + switch (aErrorId) + { + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_NO_MEM: + errorCategory = Usif::ELowDiskSpace; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_NO_NET: + errorCategory = Usif::ENetworkUnavailable; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_CORRUPT_PKG: + errorCategory = Usif::ECorruptedPackage; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_COMPAT_ERR: + errorCategory = Usif::EApplicationNotCompatible; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_AUTHORIZATION_ERR: + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_AUTHENTICATION_ERR: + errorCategory = Usif::ESecurityError; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_PUSH_REG_ERR: + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_UNEXPECTED_ERR: + case com_nokia_mj_impl_utils_InstallerErrorMessage_UNINST_UNEXPECTED_ERR: + case com_nokia_mj_impl_utils_InstallerErrorMessage_OTHER_UNEXPECTED_ERR: + errorCategory = Usif::EUnexpectedError; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_CANCEL: + case com_nokia_mj_impl_utils_InstallerErrorMessage_UNINST_CANCEL: + errorCategory = Usif::EUserCancelled; + break; + case com_nokia_mj_impl_utils_InstallerErrorMessage_UNINST_NOT_ALLOWED: + errorCategory = Usif::EUninstallationBlocked; + break; + } + return errorCategory; } #else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK @@ -1134,17 +1033,6 @@ /* * 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 */ @@ -1192,9 +1080,9 @@ * Signature: (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;JZZZZLcom/nokia/mj/impl/installer/applicationregistrator/ComponentId;)I */ JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1registerComponent -(JNIEnv *, jclass, jint, jint, jstring, jstring, jstring, jstring, jstring, - jobjectArray, jlong, jboolean, jboolean, jboolean, jboolean, jint, jstring, - jstring, jstring, jobject) +(JNIEnv *, jclass, jint, jint, jstring, jstring, jstring, jstring, + jobjectArray, jlong, jboolean, jboolean, jboolean, jboolean, jint, + jstring, jstring, jstring, jstring, jobject) { return KErrNone; } @@ -1298,4 +1186,15 @@ return 0; } +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator + * Method: _getErrorCategory + * Signature: (I)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getErrorCategory +(JNIEnv *, jclass, jint) +{ + return 0; +} + #endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.cpp --- a/javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -20,11 +20,14 @@ #include #include +#include #include "javacommonutils.h" #include "logger.h" #include "mifconverter.h" #include "iconconverter.h" +#include "iconsizeutils.h" // TIconSizes +#include "iconsizenotifier.h" // KUidIconSizeNotifPlugin namespace java { @@ -32,12 +35,13 @@ /** * The icon in S60 temporary drive */ -_LIT(KTempIconName, "D:\\micon.mbm"); +_LIT(KTempIconName1, "D:\\micon1.mbm"); +_LIT(KTempMaskName1, "D:\\mmask1.mbm"); -/** - * The mask in S60 temporary drive - */ -_LIT(KTempMaskName, "D:\\mmask.mbm"); +#ifdef RD_JAVA_S60_RELEASE_9_2 +_LIT(KTempIconName2, "D:\\micon2.mbm"); +_LIT(KTempMaskName2, "D:\\mmask2.mbm"); +#endif // RD_JAVA_S60_RELEASE_9_2 // MIF file constants @@ -51,13 +55,11 @@ const TInt KMifIconHeaderAnimated = 0; - CIconConverter* CIconConverter::NewL(RFs& aRFs) { return new(ELeave) CIconConverter(aRFs); } - CIconConverter::CIconConverter(RFs &aRFs) { iRFs = aRFs; @@ -79,6 +81,8 @@ // Do NOT close file server session delete iBitmapMask; delete iBitmap; + delete iBitmapMaskScaledCopy; + delete iBitmapScaledCopy; delete iImageDecoder; RFbsSession::Disconnect(); @@ -246,34 +250,77 @@ *iBitmapMask); CActiveScheduler::Start(); - err = iActiveListener->iStatus.Int(); + User::LeaveIfError(iActiveListener->iStatus.Int()); + + // Scale icons + TIconSizes sizes(GetIdealIconSizes()); + CBitmapScaler* scaler = CBitmapScaler::NewL(); + CleanupStack::PushL(scaler); + scaler->SetQualityAlgorithm(CBitmapScaler::EMaximumQuality); + + // Scale for Menu + ILOG2(EJavaInstaller, "Scaling Menu icon to (%d, %d)", + sizes.iMenuIconSize.iWidth, sizes.iMenuIconSize.iHeight); + iBitmapScaledCopy = new(ELeave) CFbsBitmap; + iBitmapMaskScaledCopy = new(ELeave) CFbsBitmap; + ScaleL(*scaler, sizes.iMenuIconSize); + User::LeaveIfError(iBitmapScaledCopy->Save(KTempIconName1)); + User::LeaveIfError(iBitmapMaskScaledCopy->Save(KTempMaskName1)); + iBitmapScaledCopy->Reset(); + iBitmapMaskScaledCopy->Reset(); + +#ifdef RD_JAVA_S60_RELEASE_9_2 + // Scale for App Manager + ILOG2(EJavaInstaller, "Scaling App Mgr icon to (%d, %d)", + sizes.iMenuIconSize.iWidth, sizes.iMenuIconSize.iHeight); + ScaleL(*scaler, sizes.iAppMgrIconSize); + User::LeaveIfError(iBitmapScaledCopy->Save(KTempIconName2)); + User::LeaveIfError(iBitmapMaskScaledCopy->Save(KTempMaskName2)); + iBitmapScaledCopy->Reset(); + iBitmapMaskScaledCopy->Reset(); +#endif // RD_JAVA_S60_RELEASE_9_2 + + CleanupStack::PopAndDestroy(scaler); delete iActiveListener; iActiveListener = NULL; - if (err != KErrNone) - { - User::Leave(err); - } - // store bitmap to two temp files - User::LeaveIfError(iBitmap->Save(KTempIconName)); - User::LeaveIfError(iBitmapMask->Save(KTempMaskName)); - - // construct multi bitmap file from bitmap and mask files (2 files) + // Construct multi bitmap file from bitmap and mask files (2 files) +#ifdef RD_JAVA_S60_RELEASE_9_2 + const TInt KBmpCount = 4; + TInt32 sourceIds[] = {0, 0, 0, 0}; +#else + const TInt KBmpCount = 2; TInt32 sourceIds[] = {0, 0}; - TFileName** filenames = new(ELeave) TFileName*[2]; +#endif // RD_JAVA_S60_RELEASE_9_2 + + TFileName** filenames = new(ELeave) TFileName*[KBmpCount]; CleanupStack::PushL(filenames); - filenames[0] = new(ELeave) TFileName(KTempIconName); + filenames[0] = new(ELeave) TFileName(KTempIconName1); CleanupStack::PushL(filenames[0]); - filenames[1] = new(ELeave) TFileName(KTempMaskName); + filenames[1] = new(ELeave) TFileName(KTempMaskName1); CleanupStack::PushL(filenames[1]); - - CFbsBitmap::StoreL(aOutputFile, 2, (const TDesC**)filenames, sourceIds); + +#ifdef RD_JAVA_S60_RELEASE_9_2 + filenames[2] = new(ELeave) TFileName(KTempIconName2); + CleanupStack::PushL(filenames[2]); + filenames[3] = new(ELeave) TFileName(KTempMaskName2); + CleanupStack::PushL(filenames[3]); +#endif // RD_JAVA_S60_RELEASE_9_2 + + CFbsBitmap::StoreL(aOutputFile, KBmpCount, (const TDesC**)filenames, sourceIds); // Now try to delete the temp icon and mask files, // ignore possible errors - (void)iRFs.Delete(KTempIconName); - (void)iRFs.Delete(KTempMaskName); - + (void)iRFs.Delete(KTempIconName1); + (void)iRFs.Delete(KTempMaskName1); + +#ifdef RD_JAVA_S60_RELEASE_9_2 + (void)iRFs.Delete(KTempIconName2); + (void)iRFs.Delete(KTempMaskName2); + CleanupStack::PopAndDestroy(filenames[3]); + CleanupStack::PopAndDestroy(filenames[2]); +#endif // RD_JAVA_S60_RELEASE_9_2 + CleanupStack::PopAndDestroy(filenames[1]); CleanupStack::PopAndDestroy(filenames[0]); CleanupStack::PopAndDestroy(filenames); @@ -371,4 +418,64 @@ mimeTypes.ResetAndDestroy(); } +void CIconConverter::ScaleL(CBitmapScaler& aScaler, const TSize aSize) +{ + ASSERT(iBitmapScaledCopy); + ASSERT(iBitmapMaskScaledCopy); + + User::LeaveIfError(iBitmapScaledCopy->Create(aSize, EColor16M)); + User::LeaveIfError(iBitmapMaskScaledCopy->Create(aSize, EGray256)); + + iActiveListener->InitialiseActiveListener(); + aScaler.Scale(&iActiveListener->iStatus, *iBitmap, *iBitmapScaledCopy, ETrue); + CActiveScheduler::Start(); + User::LeaveIfError(iActiveListener->iStatus.Int()); + + iActiveListener->InitialiseActiveListener(); + aScaler.Scale(&iActiveListener->iStatus, *iBitmapMask, *iBitmapMaskScaledCopy, ETrue); + CActiveScheduler::Start(); + User::LeaveIfError(iActiveListener->iStatus.Int()); +} + +TIconSizes CIconConverter::GetIdealIconSizes() +{ + TIconSizes fallbackSizes; + fallbackSizes.iMenuIconSize = TSize(KIconInMenuFallbackSize, KIconInMenuFallbackSize); + fallbackSizes.iAppMgrIconSize = TSize(KIconInAppMgrFallbackSize, KIconInAppMgrFallbackSize); + +#ifdef RD_JAVA_S60_RELEASE_9_2 + RNotifier notifier; + TInt err = notifier.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, "CIconConverter::GetIdealIconSizes #1 err = %d", err); + return fallbackSizes; + } + + CleanupClosePushL(notifier); + + TPckgBuf des; + iActiveListener->InitialiseActiveListener(); + notifier.StartNotifierAndGetResponse(iActiveListener->iStatus, + KUidIconSizeNotifPlugin, des, des); + CActiveScheduler::Start(); + notifier.CancelNotifier(KUidIconSizeNotifPlugin); + err = iActiveListener->iStatus.Int(); + + CleanupStack::PopAndDestroy(¬ifier); + + if (KErrNone != err) + { + ELOG1(EJavaInstaller, "CIconConverter::GetIdealIconSizes #2 err = %d", err); + return fallbackSizes; + } + else + { + return des(); + } +#else + return fallbackSizes; +#endif +} + } // namespace java diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.h --- a/javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.h Mon Aug 23 16:38:44 2010 +0100 @@ -26,6 +26,10 @@ #include +class CBitmapScaler; +class TIconSizes; + + namespace java { @@ -161,6 +165,15 @@ HBufC8* apIconBuf, const TDesC &aOutputFile); + /** + * Scale the original icon into the current temporary icon. + */ + void ScaleL(CBitmapScaler& aScaler, const TSize aSize); + + /** + * Get the ideal icon sizes from UI, trough the ecom plugin notifier. + */ + TIconSizes GetIdealIconSizes(); private: /** @@ -176,16 +189,25 @@ CBufferedImageDecoder* iImageDecoder; /** - * Pointer to bitmap generated from the icon + * Pointer to bitmap generated from the icon. */ CFbsBitmap* iBitmap; /** * Pointer to the bitmap mask generated from the icon. - * May be NULL if the original icon not not have mask. */ CFbsBitmap* iBitmapMask; + /** + * Scaled copy of the original icon bitmap. + */ + CFbsBitmap* iBitmapScaledCopy; + + /** + * Scaled copy of the original icon mask. + */ + CFbsBitmap* iBitmapMaskScaledCopy; + CActiveListener *iActiveListener; }; diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcher.cpp --- a/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcher.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcher.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -83,7 +83,7 @@ classHandles, "addElement", "(Ljava/lang/Object;)V"); jclass classTimestamps = aEnv->GetObjectClass(aTimestamps); jmethodID methodTimestampsAddElement = aEnv->GetMethodID( - classHandles, "addElement", "(Ljava/lang/Object;)V"); + classTimestamps, "addElement", "(Ljava/lang/Object;)V"); jclass integerClass = aEnv->FindClass("java/lang/Integer"); jmethodID integerConstructor = aEnv->GetMethodID( integerClass, "", "(I)V"); diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcherscanfrominbox.cpp --- a/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcherscanfrominbox.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcherscanfrominbox.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -143,7 +143,7 @@ TRAP(err, atta = iAttaMan->GetAttachmentFileL(attaInfo->Id())); if (KErrNone == err) { - aResultArray.Insert(atta, 0); + aResultArray.InsertL(atta, 0); } } } @@ -206,7 +206,7 @@ TMsvEntry index = (*entry)[loop]; if (KUidMsgTypePOP3 == index.iMtm || KUidMsgTypeIMAP4 == index.iMtm) { - aRootEntryArray.Insert((*entry)[loop].Id(), 0); + aRootEntryArray.InsertL((*entry)[loop].Id(), 0); } } } @@ -245,7 +245,7 @@ if (index.Visible() && index.Complete() && !index.InPreparation() && !index.Deleted()) { - aEntryArray.Insert(aId, 0); + aEntryArray.InsertL(aId, 0); } } } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/utils/filewriter.cpp --- a/javamanager/javainstaller/installer/src.s60/utils/filewriter.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/utils/filewriter.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -26,6 +26,7 @@ #ifdef RD_JAVA_S60_RELEASE_5_0 #include #else +#include #include #endif // RD_JAVA_S60_RELEASE_5_0 diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/utils/propertylistener.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/src.s60/utils/propertylistener.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,122 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/utils/propertylistener.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/src.s60/utils/propertylistener.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,82 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/utils/propertyprovider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/src.s60/utils/propertyprovider.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,91 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/src.s60/utils/sysutil.cpp --- a/javamanager/javainstaller/installer/src.s60/utils/sysutil.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/src.s60/utils/sysutil.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -25,13 +25,20 @@ #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. */ @@ -720,3 +727,21 @@ } 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/build/jiut.bat --- a/javamanager/javainstaller/installer/tsrc/build/jiut.bat Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/build/jiut.bat Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ @rem -@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +@rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). @rem All rights reserved. @rem This component and the accompanying materials are made available @rem under the terms of "Eclipse Public License v1.0" @@ -14,8 +14,10 @@ @rem Description: @rem rem Script for running JavaInstaller unit tests from S60 eshell -rem javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.NotificationPosterTest -rem javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.DownloaderTest +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 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 @@ -32,4 +34,7 @@ javainstaller test -mainclass=com.nokia.mj.impl.installer.utils.AttributeReaderTest javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerResultMessageTest javainstaller test -mainclass=com.nokia.mj.impl.installer.GetComponentInfoTest -rem javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest +javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run1 +javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run2 +javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run3 +javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run4 diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/GetComponentInfoTest.java Mon Aug 23 16:38:44 2010 +0100 @@ -856,15 +856,11 @@ try { String value = aMsg.getStringValue(aName); - assertTrue("Unexpected value " + aName + "=" + value, false); - } - catch (IllegalArgumentException iae) - { - // Expected exception. + assertTrue("Unexpected value " + aName + "=" + value, value == null); } catch (Throwable t) { - assertTrue("Incorrect exception for string value " + aName + + assertTrue("Unexpected exception for string value " + aName + ": " + t, false); } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/InstallerEngineTest.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -52,6 +52,8 @@ { TestSuite suite = new TestSuite(this.getClass().getName()); + String runIndex = System.getProperty("com.nokia.mj.impl.installer.test.param1"); + if (Platform.isLinux()) { // In S60 this would be interactive test, so disable it there. @@ -64,6 +66,9 @@ })); } + if (runIndex == null || runIndex.equalsIgnoreCase("run1")) + { + // Run 1 suite.addTest(new InstallerEngineTest("testMidletMessageOk", new TestMethod() { public void run(TestCase tc) @@ -103,7 +108,11 @@ ((InstallerEngineTest)tc).test3AppsOk(); } })); + } + if (runIndex == null || runIndex.equalsIgnoreCase("run2")) + { + // Run 2 suite.addTest(new InstallerEngineTest("testDownloadJadOk", new TestMethod() { public void run(TestCase tc) @@ -215,7 +224,11 @@ ((InstallerEngineTest)tc).testNoJavaBinRoot(); } })); + } + if (runIndex == null || runIndex.equalsIgnoreCase("run3")) + { + // Run 3 suite.addTest(new InstallerEngineTest("testBlockUninstall", new TestMethod() { public void run(TestCase tc) @@ -239,7 +252,11 @@ ((InstallerEngineTest)tc).testApplicationInfo(); } })); + } + if (runIndex == null || runIndex.equalsIgnoreCase("run4")) + { + // Run 4 suite.addTest(new InstallerEngineTest("testInstallOptions", new TestMethod() { public void run(TestCase tc) @@ -255,6 +272,7 @@ ((InstallerEngineTest)tc).testInstallAuthAndBig(); } })); + } com.nokia.mj.impl.utils.OmjTestRunner.run(suite); } @@ -310,6 +328,15 @@ } /** + */ + public String getTestServer() + { + String server = System.getProperty("com.nokia.mj.impl.installer.test.server"); + assertNotNull("-server=

    : argument required.", server); + return server; + } + + /** * Makes installation, update and uninstallation for given application. * Does the following steps: * install with cancellation and check that app is not installed, @@ -410,12 +437,12 @@ assertNoIsDir(); // List. - Log.logOut("InstallerEngineTest.doInstallUninstall: list -v"); - result = Installer.mainWithResult(new String[] { "list", "-v" }); - assertResult(result, Installer.ERR_NONE); - Log.logOut("InstallerEngineTest.doInstallUninstall: list -otastatus"); - result = Installer.mainWithResult(new String[] { "list", "-otastatus" }); - assertResult(result, Installer.ERR_NONE); + //Log.logOut("InstallerEngineTest.doInstallUninstall: list -v"); + //result = Installer.mainWithResult(new String[] { "list", "-v" }); + //assertResult(result, Installer.ERR_NONE); + //Log.logOut("InstallerEngineTest.doInstallUninstall: list -otastatus"); + //result = Installer.mainWithResult(new String[] { "list", "-otastatus" }); + //assertResult(result, Installer.ERR_NONE); // Update with cancellation. Log.logOut("InstallerEngineTest.doInstallUninstall: update with cancellation " + aFilename); @@ -570,38 +597,38 @@ public void testDownloadJadOk() { Log.logOut("InstallerEngineTest.testDownloadJadOk begins"); - SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); - doInstallUninstall(suite, "http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_gcf.jsp", true, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("HelloWorld", "Nokia"); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/HelloWorld_ota.jad", true, iDefaultOptions); } public void testDownloadJarOk() { Log.logOut("InstallerEngineTest.testDownloadJarOk begins"); - SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); - doInstallUninstall(suite, "http://195.134.231.83:7070/omjserver/resources/omj/JBenchmark2.jar", false, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("HelloWorld", "Nokia"); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/HelloWorld.jar", false, iDefaultOptions); } public void testDownloadJadHttpRedirectOk() { Log.logOut("InstallerEngineTest.testDownloadJadHttpRedirectOk begins"); - SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); - doInstallUninstall(suite, "http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jad&count=5", true, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("HelloWorld_redirect", "Nokia"); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jad&count=5", true, iDefaultOptions); } public void testDownloadJarHttpRedirectOk() { Log.logOut("InstallerEngineTest.testDownloadJarHttpRedirectOk begins"); - SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP"); - doInstallUninstall(suite, "http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jar", false, iDefaultOptions); + SuiteInfo suite = new SuiteInfo("HelloWorld_redirect", "Nokia"); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jar", false, iDefaultOptions); } public void testDownloadJadHttpAuthOk() { Log.logOut("InstallerEngineTest.testDownloadJadHttpAuthOk begins"); - SuiteInfo suite = new SuiteInfo("DS_Snow_http_auth", "DS_Effects"); + SuiteInfo suite = new SuiteInfo("HelloWorld_http_auth", "Nokia"); iDefaultOptions.addElement("-username=guest"); iDefaultOptions.addElement("-password=guest"); - doInstallUninstall(suite, "http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", true, iDefaultOptions); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", true, iDefaultOptions); } public void testDownloadJadHttpAuthNok() @@ -611,7 +638,7 @@ { "install", "-silent", - "-jad=http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", + "-jad=http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", }; int result = Installer.mainWithResult(args); // Check result code. @@ -622,7 +649,7 @@ iItu.isExceptionReason (Installer.getExecuteException(), InstallerErrorMessage.INST_CANCEL, - InstallerDetailedErrorMessage.NO_MSG, + InstallerDetailedErrorMessage.INST_CANCEL, OtaStatusCode.USER_CANCELLED)); assertTrue("installed app uid should not exist", Installer.iInstalledApps.length == 0); } @@ -634,7 +661,7 @@ { "install", "-silent", - "-jad=http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jad&count=6", + "-jad=http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jad&count=6", }; int result = Installer.mainWithResult(args); // Check result code. @@ -677,7 +704,7 @@ { "install", "-silent", - "-jad=http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_8mb_gcf.jsp", + "-jad=http://" + getTestServer() + "/installertest/HelloWorld_8mb.jad", }; Log.log("InstallerEngineTest.testDownloadJadCancel: installation starts"); int result = Installer.mainWithResult(args); @@ -690,7 +717,7 @@ iItu.isExceptionReason (Installer.getExecuteException(), InstallerErrorMessage.INST_CANCEL, - InstallerDetailedErrorMessage.NO_MSG, + InstallerDetailedErrorMessage.INST_CANCEL, OtaStatusCode.USER_CANCELLED)); assertTrue("installed app uid should not exist", Installer.iInstalledApps.length == 0); Log.log("InstallerEngineTest.testDownloadJadCancel: end"); @@ -985,7 +1012,7 @@ callInstallerOk(new String[] { "list", "-systemproperties" }); callInstallerOk(new String[] { "launch", "-nouid" }); callInstallerOk(new String[] { "launch", "-uid=invaliduid" }); - callInstallerOk(new String[] { "uninstallall" }); + callInstallerOk(new String[] { "uninstallall", "-silent" }); callInstallerOk(new String[] { "unregister" }); callInstallerOk(new String[] { "test", "-nomainclass" }); } @@ -1106,10 +1133,10 @@ { Log.logOut("InstallerEngineTest.testInstallAuthAndBig begins"); // Do first installation with doInstallUninstall helper - SuiteInfo suite = new SuiteInfo("DS_Snow_http_auth", "DS_Effects"); + SuiteInfo suite = new SuiteInfo("HelloWorld_http_auth", "Nokia"); iDefaultOptions.addElement("-username=guest"); iDefaultOptions.addElement("-password=guest"); - doInstallUninstall(suite, "http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", true, iDefaultOptions); + doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", true, iDefaultOptions); // Then start installation which downloads a large file. Log.log("InstallerEngineTest.testInstallAuthAndBig begin to install big app"); @@ -1117,7 +1144,7 @@ { "install", "-silent", - "-jad=http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_8mb_gcf.jsp", + "-jad=http://" + getTestServer() + "/installertest/HelloWorld_8mb.jad", }; int result = Installer.mainWithResult(args); // Check result code. diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistratorTest.java Mon Aug 23 16:38:44 2010 +0100 @@ -374,12 +374,32 @@ appReg.startSession(); groupName = appReg.getGroupName(uid); - assertTrue( - "The group name was not VeryVeryLongGrou, it was " + groupName, - "VeryVeryLongGrou".equals(groupName)); + 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)); + } uidInUse = appReg.uidInUse(uid); - assertTrue("uidInUse returned false value", true == uidInUse); + 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); + } appReg.closeSession(); } @@ -582,7 +602,16 @@ "".equals(groupName)); uidInUse = appReg.uidInUse(uid); - assertTrue("uidInUse returned false value", true == uidInUse); + 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); + } appReg.closeSession(); } @@ -703,12 +732,32 @@ appReg.startSession(); groupName = appReg.getGroupName(uid); - assertTrue( - "The group name was not Suite, it was " + groupName, - "Suite".equals(groupName)); + 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)); + } uidInUse = appReg.uidInUse(uid); - assertTrue("uidInUse returned false value", true == uidInUse); + 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); + } appReg.closeSession(); } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/SifRegistratorTest.java Mon Aug 23 16:38:44 2010 +0100 @@ -203,21 +203,34 @@ { SuiteInfo si = getTestSuite(); ComponentId cid = getComponentId(si.getGlobalId()); - 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)); - } + + // 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)); + //} sifReg.closeSession(); } catch (InstallerException ie) @@ -324,16 +337,18 @@ 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)); - 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)); + // 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)); + //} } private void logSuite(SuiteInfo aSuite) diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/customisationproperties/CustomisationPropertiesTest.java Mon Aug 23 16:38:44 2010 +0100 @@ -212,18 +212,18 @@ String drive = (String)value.firstElement(); assertTrue("PossibleInstallationDrives is null", (drive != null)); - assertTrue("First PossibleInstallationDrive is not C:", drive.equals("C:")); + assertTrue("First PossibleInstallationDrive is not C:, it is " + drive, drive.equals("C:")); // second possible drive drive = (String)value.get(1); assertTrue("PossibleInstallationDrives is null", (drive != null)); - assertTrue("Second PossibleInstallationDrive is not E:", drive.equals("E:")); + assertTrue("Second PossibleInstallationDrive is not E:, it is " + drive, drive.equals("E:")); value = cust.getIntegerProperty(CustomisationProperties.PossibleInstallationDrives); assertTrue("PossibleInstallationDrives value is null", (value != null)); assertTrue("PossibleInstallationDrives value does not contain any integers", (value.size() > 0)); Integer idrive = (Integer)value.get(1); - assertTrue("Second PossibleInstallationDrive is E:", idrive.intValue() == 4); + assertTrue("Second PossibleInstallationDrive is not E:, it is " + idrive, idrive.intValue() == 4); } public void testTypesOfPossibleInstallationDrives() diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/DownloaderTest.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -37,8 +37,8 @@ */ public class DownloaderTest extends TestCase implements InstallerMain { - private static final String TEST_URL = "http://195.134.231.83:7070/java-server/resources/DS_Snow.jar"; - private static final int TEST_URL_SIZE = 10241; // test data file size + private static final String TEST_URL = "/installertest/HelloWorld.jar"; + private static final int TEST_URL_SIZE = 1511; // test data file size // Begin j2meunit test framework setup @@ -172,10 +172,15 @@ public void testBasicDownload(Downloader downloader, TestDlListener listener) { + String server = System.getProperty( + "com.nokia.mj.impl.installer.test.server"); + assertNotNull("-server=
    : argument required.", server); + try { String filename = "test.dat"; - DownloadInfo dlInfo = new DownloadInfo(TEST_URL, filename); + DownloadInfo dlInfo = new DownloadInfo("http://" + server + + TEST_URL, filename); downloader.start(dlInfo); downloader.waitForCompletion(); assertTrue("Result DlInfo is null", diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/NotificationPosterTest.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -36,7 +36,7 @@ */ public class NotificationPosterTest extends TestCase implements InstallerMain { - private static final String TEST_URL = "http://195.134.231.83:7070/java-server/getresult.jsp?phone=CE0CBA106ADB77A9298A143E5136CD2B&tID=900_success"; + private static final String TEST_URL = "/installertest/notify?tID=900_success"; // Begin j2meunit test framework setup @@ -361,13 +361,18 @@ testNotifyPendingFailureLimit(poster); } - private static OtaStatusNotification createNotification(int aIndex) + private OtaStatusNotification createNotification(int aIndex) { + String server = System.getProperty( + "com.nokia.mj.impl.installer.test.server"); + assertNotNull("-server=
    : argument required.", server); + OtaStatusNotification notification = new OtaStatusNotification (PlatformUid.createUid(Integer.toString(aIndex)), System.currentTimeMillis(), OtaStatusNotification.TYPE_INSTALL, OtaStatusCode.SUCCESS, - TEST_URL + aIndex, System.currentTimeMillis(), 0); + "http://" + server + TEST_URL + aIndex, System.currentTimeMillis(), + 0); return notification; } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/utils/SysUtilTest.java Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -33,6 +33,8 @@ */ 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) @@ -167,6 +169,49 @@ } })); + 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); } @@ -198,11 +243,11 @@ { try { - // Test PS keys defined in ScreensaverInternalPSKeys.h - Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver - int key = 0x00000001; // KScreenSaverPreviewMode + // Test PS keys defined in hwrmpowerstatesdkpskey.h + Uid uid = PlatformUid.createUid("0x10205041"); // KPSUidHWRMPowerState + int key = 0x00000003; // KHWRMChargingStatus int value = SysUtil.getPropertyValue(uid, key); - assertTrue("KScreenSaverPreviewMode(!=0): " + value, value == 0); + assertTrue("KHWRMChargingStatus(!=0): " + value, value == 0); } catch (InstallerException ie) { @@ -215,8 +260,8 @@ { try { - // Test PS keys defined in ScreensaverInternalPSKeys.h - Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver + // Test PS keys defined in hwrmpowerstatesdkpskey.h + Uid uid = PlatformUid.createUid("0x10205041"); // KPSUidHWRMPowerState int key = 0x00000010; // Undefined key int value = SysUtil.getPropertyValue(uid, key); assertTrue("Getting undefined property value did not fail", false); @@ -231,13 +276,12 @@ { try { - // 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). + Uid uid = SysUtil.PROP_CATEGORY_SYSTEM; + long key = SysUtil.PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS; SysUtil.setPropertyValue(uid, key, 1); int value = SysUtil.getPropertyValue(uid, key); - assertTrue("KScreenSaverPreviewMode(!=1): " + value, value == 1); + assertTrue("PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS(!=1): " + + value, value == 1); } catch (InstallerException ie) { @@ -250,9 +294,8 @@ { try { - // Test PS keys defined in ScreensaverInternalPSKeys.h - Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver - int key = 0x00000010; // Undefined key + Uid uid = SysUtil.PROP_CATEGORY_SYSTEM; + int key = 0x00000100; // Undefined key SysUtil.setPropertyValue(uid, key, 1); assertTrue("Setting undefined property value did not fail", false); } @@ -339,11 +382,12 @@ { try { - // Test CenRep keys defined in ScreensaverInternalCRKeys.h - Uid uid = PlatformUid.createUid("0x101F8770"); // KCRUidScreenSaver - long key = 0x00000004; // KScreenSaverInvertedColors + // Test CenRep keys defined in Java security. + Uid uid = PlatformUid.createUid("0x2001B289"); // KJavaSecurity + long key = 0x00000004; // KJavaSecurity/KWarningsMode int value = SysUtil.getRepositoryValue(uid, key); - assertTrue("KScreenSaverInvertedColors(!=0): " + value, value == 0); + assertTrue("KJavaSecurity/KWarningsMode(!=2): " + value, + value == 2); } catch (InstallerException ie) { @@ -375,8 +419,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) { @@ -573,4 +617,126 @@ // 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000019.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000019.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000046.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000046.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000058.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000058.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000070.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000070.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000090.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000090.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000150.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000150.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000172.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000172.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000175.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000175.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000182.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000182.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000189.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000189.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000250.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000250.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000305.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000305.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000390.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000390.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000500.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000500.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000582.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000582.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000618.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000618.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/00000703.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000703.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/3DSpaceShooter.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/3DSpaceShooter.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,18 @@ + +MIDlet-1: 3DSpaceShooter, /icon.png, Sapce3D + + +MIDlet-Jar-Size: 240229 + + +MIDlet-Jar-URL: 3DSpaceShooter.jar +MIDlet-Name: 3DSpaceShooter +MIDlet-Vendor: Innovative Ideas From Outer Space Ltd. + + + + +  +MIDlet-Version: 1.0.4 +Nokia-MIDlet-Original-Display-Size: 176,208 +Nokia-MIDlet-On-Screen-Keypad: navigationkeys \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/800_x_N97_64GB_fr_speed_v5_32_01.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/800_x_N97_64GB_fr_speed_v5_32_01.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,99 @@ +RepositoryContentType: text/plain +UserAgent: NokiaN95/J2ME-IMPS +ShowStatusTextInCL: 0 +SpaceBetweenFriendsNameAndHisIcon: 3 +ShowDomain: 0 +MIDlet-Icon: /img/App.png +NormalPollRate: 12000 +TCPCIREnabled: 1 +Images: http://download.ko.mysite.fr/koi/j2me/enc/1111/ +SpecialKeys: -12 +Host: koi.ko.mysite.fr +TCPPingRate: 1560000 +EnableCommunitySelector: 1 +BackgoundImgPos: 0 +ScrollBarWidth: 5 +MIDlet-Vendor: Vodafone +BillingURL: http://koi.ko.mysite.fr/koi/sq.dll/awo_buy +UseTemplate: 1 +MaxFriendsNumber: 150 +StopTCPCIR: 1 +MIDlet-Version: 4.5.27 +SelectCommand: 1 +KeepAlive: 1500000 +SMSCIREnabled: 1 +MultiTrans: 5 +DefaultDomain: gmaeam1.com +EnableBackgroundImage: 0 +MicroEdition-Profile: MIDP-2.0 +TermsAndConditions: 1 +SeamlessLogin: 0 +GlobalMsgLength: 600 +MIDlet-Push-1: sms://:3716, ui.Main, * +RegisterConnection: 1 +ViewType: 0 +HTTPCIREnabled: 1 +IsTabFontBold: 1 +AboutNaming: PrerryLake_h_N97_fr_speed_v4_5_27 +InitMessage: 1 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-Jar-URL: 800€_x_N97_64GB_fr_speed_v5_32_01.jar +AnimationRate: 300 +Multitask: 0 +EnableSemitransparentHighlight: 0 +CheckContentType: 1 +MaxMsgNumber: 30 +Port: 80 +LoginURL: http:/koi.ko.mysite.fr/koi/sq.dll/dsw_daas +UseKeepAlive: 0 +MIDlet-Install-Notify: http://download.ko.mysite.fr/InstallNotify?c= +SelfUpgrade: 1 +MIDlet-Data-Size: 500 +AnimationEnabled: 1 +TitleUpdateRate: 7000 +EnableRenameFriend: 0 +SystemMessageUserTimeout: 25000 +Help: http://download.ko.mysite.fr/koi/j2me/enc/help/fr/ +UseDeviceTimeForIncomingMsg: 1 +TCPCIRReconnectCount: 3 +DefaultLanguage: de +MIDlet-1: Messenger,/img/App.png,ui.Main +MsgListHeightTuner: 8 +MIDlet-Name: Messenger +FontSize: 0 +WVExtension: /web/wv.dll/msn_imgw +RefreshChoiceOnStateChange: 0 +MIDlet-Permissions: javax.microedition.io.Connector.http,javax.microedition.io.Connector.https,javax.microedition.io.Connector.socket,javax.microedition.io.Connector.sms,javax.wireless.messaging.sms.receive,javax.microedition.io.PushRegistry,javax.microedition.media.control.VideoControl.getSnapshot,javax.microedition.io.Connector.file.read,javax.microedition.io.Connector.file.write +MaxConversations: 20 +SubscribePresence: 1 +PersistencyEnabled: 1 +RepositoryAlertMessage: Error loading application data. Please try again later. +GlobalMaxCharCount: 5000 +EnableEmoticonsSelector: 1 +IdleMode: 1 +SpacerHeight: 5 +TCPCIRReconnectRate: 3000 +MIDlet-Jar-Size: 502719 +BackgroundEnabled: 1 +IsCaseInsensitive: 1 +AlertToneMsg: http://download.ko.mysite.fr/koi/j2me/enc/dingdong.mp3 +NormalNoPollTransition: 1800000 +AlertToneContact: http://download.ko.mysite.fr/koi/j2me/enc/alalal.mp3 +NoPollStateEnabled: 0 +Device: 3 +SupportCustomUTF8: 0 +MIDlet-Info-URL: www.koikoikoi.com +MsgListWidthTuner: 15 +CommandsType: 1;4;2;4;3;8;5;4;6;2;8;2;9;7;10;4;11;8;23;4;24;3;37;2;68;2;69;7;76;4;80;2;86;6;87;1 +IdleModeTimeOut: 900000 +ShowAboutLogo: 1 +TopMarginFriendName: 2 +ContentLanguage: fr +FastPollRate: 7000 +NokiaTimeOut: 100 +FastNormalTransition: 20000 +EnableShortProfile: 1 +RepositoryVersion: 1 +MIDlet-Jar-RSA-SHA1: QhSjP7F1q3TGmmNC45cUGclVWB537GtcMLpplIJGe+TyDwJ1Mx5VssNHpp3Qs3C1WHLycvcfOkDT0CscStI0lV/5Xy33z192qEHIT5lkGVz1Rd1nfBHqrIBqv77H7dHW1tdU6RiVajx8jrYYXz+Yh/7U2kskmGXd0bLSYq2cuZZgkiT9YDOLa8OJ1Xn2U4/AYzonM1tjGQvkOniCvwqv0DXDW3GAial5w7hzB4txSopBgWiCO7sEPgkssJIvWQ2dsuLnwb3nU8gsUYWuRqidSI5Dm8mSOEA0zjRoREjTJjkqRZXX3r27rtp+omYh+VNCkXDneiNcaihWpkW5TgMhVg== +MIDlet-Certificate-1-1: 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,10 @@ +MIDlet-Jar-URL: https://uljava.gjmptw.de/midlets/harmonized/Local%20Connectivity%20(BT%20and%20IrDa)/BCExchanger/BCExchanger.jar +MIDlet-Install-Notify: https://uljava.gjmptw.de/Index/Index.php/BCExchanger.jad?installed=BCExchanger_harmony +MIDlet-1: BCExchangerMIDlet, /icon.png, bcexchanger.BCExchangerMIDlet +MIDlet-Description: Demonstrates the usage of the JSR-82 Bluetooth OBEX API by exchanging business cards between devices. +MIDlet-Jar-Size: 29967 +MIDlet-Name: BCExchanger +MIDlet-Vendor: Forum Nokia +MIDlet-Version: 1.0.0 +MicroEdition-Configuration: CLDC-1.1 +MicroEdition-Profile: MIDP-2.0 diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.zip Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.zip has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/DevCertTestMIDlet.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/DevCertTestMIDlet.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,14 @@ +MIDlet-1: DevCertTestMIDlet, , com.nokia.midp.test.devcerttests.DevCertTestMIDlet +MIDlet-Jar-Size: 3152 +MIDlet-Jar-URL: DevCertTestMIDlet.jar +MIDlet-Name: DevCertTestMIDlet +MIDlet-Permissions: javax.microedition.pim.ContactList.read,javax.microedition.pim.ContactList.write,javax.microedition.io.Connector.http +MIDlet-Permissions-Opt: javax.microedition.io.Connector.https +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +httpUrl: http://www.google.com +httpsUrl: https://www.google.com +MIDlet-Certificate-1-1: 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/Empty.jad diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/EmptyLines.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/EmptyLines.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + +  +  + +  \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/FL_Rocks.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/FL_Rocks.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,6 @@ +MIDlet-Version: 1.0 +MIDlet-Vendor: Standing Still Limited +MIDlet-Jar-URL: http://195.114.231.97:7001/dls/delivery/ds/01AAvJ1WX3jmZsurMwoC/1/FL_Rocks.dm +MIDlet-Install-Notify: http://195.114.231.97:7001/dls/delivery/ds/01AAvJ1WX3jmZsurMwoC/2/FL_Rocks/status +MIDlet-Name: Rocks +MIDlet-Jar-Size: 28196 diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/NDRM.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/NDRM.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,10 @@ +MIDlet-Jar-URL: NDRM.jar +MIDlet-Install-Notify: http://uljava.gjmptw.de:8080/Index/Index/NDRM.jad? nstalled=NDRM_harmony +MIDlet-Name: DRMonitor +MIDlet-Vendor: m-internet.com Limited +MIDlet-Version: 1.0 +MIDlet-Jar-Size: 24472 +MIDlet-Icon: /icon.png +MIDlet-1: NDRM, /icon.png, ndrm.NDRMMIDlet + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/PlatformReqHTTP.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/PlatformReqHTTP.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,11 @@ +MIDlet-1: PlatformReqHTTP, , com.nokia.midp.test.securitytests.PlatformReqHTTP +MIDlet-Jar-Size: 2272 +MIDlet-Jar-URL: PlatformReqHTTP.jar +MIDlet-Name: PlatformReqHTTP +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +URL: http://tcktest3.extra.wirelessfuture.com:8080/axis/servlet/marika.GetServlet +MIDlet-Certificate-1-1: MIICPDCCAaUCBD+zblMwDQYJKoZIhvcNAQEEBQAwZTELMAkGA1UEBhMCZmkxEDAOBgNVBAgTB1Vua25vd24xEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQwwCgYDVQQLEwNKQ0YxFDASBgNVBAMTC01hcmlrYSBGYWJlMB4XDTAzMTExMzExNDMxNVoXDTEzMTExMDExNDMxNVowZTELMAkGA1UEBhMCZmkxEDAOBgNVBAgTB1Vua25vd24xEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQwwCgYDVQQLEwNKQ0YxFDASBgNVBAMTC01hcmlrYSBGYWJlMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDsUJbYMb9GlP99Ax9n6m2AIAg+b2zC0u6h7OuLP+ls9OpI0sLtE1uBABCePloS0uKwmjtsdFc1zLyA/bpbi644xDw3PMIEhppeuKbLrog5uMk5wD1bFk5kJXYwYEorWVrFpLDmqFwEMig2a+Uhf7eTq1Ze/JgMHoUDXRo0eVsnFwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBACuTqh37N34NnVzziuj66gmiE3rt7fKDTUCiqoHGfv7dpr4M0e8+y6FvtXtUXEajxX/DZbZuy0E9mZqmXsYyP2DDKbCg4cBJ23uOCffuYYVQFSnv4RQFVrQr4jMUHgX7wT5Ox4Ee8xcpsvWWfOgTY4zyEznOBUj6Uw4Xj7F+1yk8 +MIDlet-Jar-RSA-SHA1: UfQMdprNMMmJOk9INrJXe+Y06tnuL+zOJz4gJNEKnLPOzb6UwR2zczNddwfdBxENKbhw2RVp3GBQD2OZjB6UEU4kiw2S956RMlk5OVfqwXB5wvYPCePX6/8qgKSUmsBjNiEpXBGE2UT7MqbRApxmsf/OaDnzzd9Tlr9jUw+YU3w= diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-Name: SimpleRMS +Created-By: 1.5.0_12 (Sun Microsystems Inc.) +MIDlet-Vendor: Unknown +MIDlet-1: SimpleRMS, SimpleRMS.png, SimpleRMS +MIDlet-Version: 1.0 +MicroEdition-Profile: MIDP-2.0 + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jar Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,24 @@ +IGP-BS: MP3D=MP3D_BS;SCDA=SCDA_BS;ASP3=ASP3_BS;PSDK=PSDK_BS; +IGP-CATEGORIES: WN=WN;BS=BS;PROMO=0;OP=OP; +IGP-DEMOS: DEMOPG=DEL; +IGP-PROMOS: MB3D=MB3D;PB07=PB07;BBRK=BBRK; +IGP-VERSION: 2.5.0 +IGP-WN: RBPF=RBPF_WN;MMN=MMN_WN;BRBO=BRBO_WN;ASCR=ASCR_WN; +MIDLET-FULLVERSION-URL: http://advers.bestgamfts.com/redir/?from=D725&game=MD3D&op=GONG&game_type=DM&lg=EN +MIDlet-1: Sun Shines 3D Demo, /icon.png, HightS3D +MIDlet-Data-Size: 8192 +MIDlet-Description: Sun Shines 3D, Emulated sun shine in full 3D! +MIDlet-Icon: /icon.png +MIDlet-Jar-Size: 754864 +MIDlet-Jar-URL: SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.jar +MIDlet-Name: Sun Shines 3D Demo +MIDlet-Vendor: Celedons Two +MIDlet-Version: 1.0.4 +Nokia-MIDlet-Block-Uninstall: true +Nokia-MIDlet-Category: Applications +Nokia-MIDlet-UID-1: 0x20012293 +Nokia-Scalable-Icon: /icon.svg +Nokia-Scalable-Icon-MIDlet-1: /icon.svg +URL-OPERATOR: http://bestgamfts.hereis.com/redir/?from=D725&op=GONG&game_type=DM&lg=EN&ver=2.5.0 +URL-PT: 0 +URL-TEMPLATE-GAME: http://bestgamfts.hereis.com/redir/?from=D725&op=GONG&game=XXXX&game_type=DM&lg=EN&emb=1&ver=2.5.0 diff -r 5bec7efefe18 -r d1278d87b01e 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,14 @@ +MIDlet-1: TestMidlet, TestMidlet.png, TestMidlet +MIDlet-Jar-Size: 3674 +MIDlet-Jar-URL: TestMidlet.jar +MIDlet-Name: TestMidlet +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +: Empty attribute name + : White space only attribute name + : White space only attribute name 2 +a<>: separators in attribute name +bo: control characters in attribute name +c: diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet2.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet2.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,3 @@ +a<>: separators in attribute name +bo: control characters in attribute name +c: diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet3.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet3.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,9 @@ +MIDlet-1: TestMidlet, TestMidlet.png, TestMidlet +MIDlet-Jar-Size: 3674 +MIDlet-Jar-URL: TestMidlet.jar +MIDlet-Name: TestMidlet +MIDlet-Vendor: Nokia +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +o: attribute name starts with CTL characters +MIDlet-Version: 1.0 diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,32 @@ +MIDlet-1: Calculator, i.png,common.control.CalculatorMIDlet +MIDlet-Name: Calculator +MIDlet-Vendor: Nokia +MIDlet-Version: 1.5 +MIDlet-Jar-Size: 123 +Nokia-MIDlet-Category: Application +Nokia-UI-Enhancement: CanvasHasBackground +MIDlet-Data-Size: 150 +Vertical-Move-Delta: 10 +Vertical-Move-Period: 2 +Inline-Editing-Supported: true +Nokia-Platform: Nokia* +Nokia-MIDlet-Category: Games +Nokia-MIDlet-Name-en: Calculator +Nokia-MIDlet-Name-de: Rechner +Nokia-MIDlet-Name-es-ES: Calculadora +Nokia-MIDlet-Name-fr: Calculatrice +Nokia-MIDlet-Name-it: Calcolatrice +Nokia-MIDlet-Name-tr-TR: Hesaplamalar +Nokia-MIDlet-Name-nl-NL: Rekenmachine +Nokia-MIDlet-Name-pt-PT: Calculadora +Nokia-MIDlet-1-en: Calculator +Nokia-MIDlet-1-de: Rechner +Nokia-MIDlet-1-es-ES: Calculadora +Nokia-MIDlet-1-fr: Calculatrice +Nokia-MIDlet-1-it: Calcolatrice +Nokia-MIDlet-1-tr-TR: Hesaplamalar +Nokia-MIDlet-1-nl-NL: Rekenmachine +Nokia-MIDlet-1-pt-PT: Calculadora +MIDlet-Jar-Size: 84713 +MIDlet-Jar-URL: calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.jar +Nokia-MIDlet-Category: Best-Sellers diff -r 5bec7efefe18 -r d1278d87b01e 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/ceac00.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceac00.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ASCII +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceac00/bin/CEAC00.jar +MIDlet-Jar-Size: 1494 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ASCII,,USASCII.CEAC00_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=9F732D83F3B6AF98EB6577EA92366D95&tID=ceac00 + + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/cecn02.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cecn02.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ùÓùÔùÕ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cecn02/bin/CECN02.jar +MIDlet-Jar-Size: 1417 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ùÓùÔùÕ, ,Big5.CECN02_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=C9EABB544D0A47788C684D71A5A1C8C9&tID=cecn02 + + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/cecn06.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cecn06.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ‚X‚Y‚Z‚[ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cecn06/bin/CECN06.jar +MIDlet-Jar-Size: 1415 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ‚X‚Y‚Z‚[,,GBK.CECN06_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=79CD95B6352F8388513D6DDB699817CF&tID=cecn06 + + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/ceis00.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis00.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,19 @@ +MIDlet-Name: ÷ùø + +MIDlet-Vendor: Nokia + +MIDlet-Version: 1.0 + +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceis00/bin/CEIS00.jar + +MIDlet-Jar-Size: 1450 + +MIDlet-1: ÷ùø, , ISO8859_1.CEIS00_01 + +MicroEdition-Configuration: CLDC-1.0 + +MicroEdition-Profile: MIDP-2.0 + +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=1D11AB7B2A1E2BC200165EB4CF554232&tID=ceis00 + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/ceis09.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis09.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,11 @@ +MIDlet-Name: ¢£¤ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceis09/bin/CEIS09.jar +MIDlet-Jar-Size: 1457 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ¢£¤, ,ISO8859_15.CEIS09_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=7F914DE931B9D04E5F731F1ADCD163F6&tID=ceis09 + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/ceis14.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis14.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ??» +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceis14/bin/CEIS14.jar +MIDlet-Jar-Size: 1456 +MIDlet-1: ??», ,ISO8859_16.CEIS14_01 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=336AA79A2E085DC20583865B841DBE6B&tID=ceis14 + + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/cejp04.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cejp04.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,4 @@ +MIDlet"DNa"De:"D"D@!"D"D"D"D"D"D"DMIDlet"DVe"Ddo"D"D"DNoki"D"D"DMIDlet"DVe"D"Dio"D"D"D1."D"D"DMIDlet"DJa"D"DURL:"DCEJP04"Dja"D"D"DMIDlet"DJa"D"DSi"De:"D1439"D"DMIDlet"D1:"D"D@!"D"D"D"D"D"D"D"DJISX0208"DCEJP04_0"D"D"DMicr"DEditio"D"DCo"Dfigu"Datio"D"D"DCLDC"D1."D"D"DMicr"DEditio"D"DPr"Dfile"D"DMIDP"D2."D"D"D +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=CF0B99F53572032690A4D26E0CB83D02&tID=cejp04 + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/ceko01.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceko01.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,11 @@ +MIDlet-Name: ÍÎÏÐ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceko01/bin/CEKO01.jar +MIDlet-Jar-Size: 1429 +MIDlet-1: ÍÎÏÐ, ,KOI8_R.CEKO01_01 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=64E5A88BE41622497EDF05039C15F26C&tID=ceko01 + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/cems01.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cems01.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ýþ€ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cems01/bin/CEMS01.jar +MIDlet-Jar-Size: 1465 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ýþ€, ,windows_1250.CEMS01_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=3F627BEFBC6E8A0FB9510BA4EB42AE6F&tID=cems01 + + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/cems11.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cems11.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,12 @@ +MIDlet-Name: ýþÿ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cems11/bin/CEMS11.jar +MIDlet-Jar-Size: 1467 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ýþÿ, ,windows_1256.CEMS11_01 +MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=3EBDFC736561D6876CF9ED93D3BF1B36&tID=cems11 + + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/ceut03.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut03.jad has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/ceut04.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut04.jad has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/ceut08.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut08.jad has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/ceut09.jad Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut09.jad has changed diff -r 5bec7efefe18 -r d1278d87b01e 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/javahelper.mif Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/javahelper.mif has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/mine_en_fr_de_it_es_ES_pt_PT.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/mine_en_fr_de_it_es_ES_pt_PT.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,33 @@ +MIDlet-Name: HecticMine +MIDlet-1: HecticMine,/images/icon.png,com.nokia.mid.appl.mine.common.MineMIDlet +Nokia-MIDlet-Category: Game +MIDlet-Icon: /images/icon.png +MIDlet-Vendor: Nokia +MIDlet-Version: 3.0.4 +MIDlet-Description: HecticMine +Period-Speed-ms: 100 +Vertical-Text-Offset: -2 +Nokia-Platform: Nokia* +Nokia-MIDlet-Name-en: +Nokia-MIDlet-Name-fr: Hectic Mine +Nokia-MIDlet-Name-de: Hectic Mine +Nokia-MIDlet-Name-it: Hectic Mine +Nokia-MIDlet-Name-es-ES: Hectic Mine +Nokia-MIDlet-Name-pt-PT: Hectic Mine +MIDlet-Jar-Size: 233616 +MIDlet-Jar-URL: mine_en_fr_de_it_es-ES_pt-PT.jar +MIDlet-Certificate-1-1: MIIDhDCCAmygAwIBAgIEQhnyeTANBgkqhkiG9w0BAQUFADAzMQ4wDAYDVQQKEwVOb2tpYTEhMB8 + GA1UEAxMYTm9raWEgQ29udGVudCBTaWduaW5nIENBMB4XDTA1MDIyMTE0Mzg0OVoXDTE2MDEwMjExMDUwNFowKDEOMAwGA1UEC + hMFTm9raWExFjAUBgNVBAMTDU5va2lhIENvbnRlbnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAK2PV8KLVSZ9OePe4k + 78GeQ0MiujbMd1wU9/xqhUFPst50drxhKzH+fMxvXgQOJ7viReolqWyq+ZmKpikGa+6SdqHysnVBhAqo9SLMNjlMfoOXVJ/lvM + gOk9k5oyVhBqFonw/FDDHmINC6w9o83e3gRq1C1m2T368yHbZtKifiVdAgMBAAGjggEtMIIBKTAOBgNVHQ8BAf8EBAMCB4AwEw + YDVR0lBAwwCgYIKwYBBQUHAwMwggEABgNVHSAEgfgwgfUwgfIGCysGAQQBXgExAQMBMIHiMIHRBggrBgEFBQcCAjCBxBqBwVJl + bGlhbmNlIG9uIHRoaXMgY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0YW5jZSBvZiB0aGUgc3RhbmRhcm + QgdGVybXMgYW5kIGNvbmRpdGlvbnMgYW5kIGxpbWl0YXRpb25zIG9mIHVzZSwgYXMgZGV0YWlsZWQgaW4gdGhlIENlcnRpZmlj + YXRlIFByYWN0aWNlIFN0YXRlbWVudCBhdmFpbGFibGUgZnJvbSBOb2tpYS4wDAYIKwYBBQUHAgEWADANBgkqhkiG9w0BAQUFAA + OCAQEAvXtgKSffVjD52zHgUEFBBmXFq3QjgWNh8+cQTD23wnPYgfA4GBomMmznLiV3X03SOOI42DUUenQ9baPb78iU8AngF6xd + oOpFYlNtVka9YdD9mA0jtkoe4YEmykxPabSKDS50xVYgQG+5Y9H8nO9EyIiviP6drFmpRv635mf8Trlao63XIx4geoCMb9v8vS + dfs0louKB9DrjwFki/uHAQvRcVYnFNtAwHdri22UMx+GMppuY4/oPVvQqxgzfP+1AX/w2lgG7pi3lbVVUB4MLhG36kZIk8/J7B + lmATAL1/G5t19HR3+9doz5H94y3WQG7ClWN1eoQtjLlvLfZO/iu20g== +MIDlet-Jar-RSA-SHA1: ncuy0soEPUB4OPGHNyLn1ldXU2FvKvs0bUKGn/aPQefKI15aOlrczlapIWreUukE3ArQImU/xwxWh0 + Q8LROEULJKXRIYyoGCCblM6o6EPYn+YT+CDd/HV8JlHS6OO+sAV//9vWuo9orIwSwdKN8wGl0g1JmPl8LF8V5/MjSmyh8= \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testdata/utils/utf8bom.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/utf8bom.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,8 @@ +MIDlet-Name: ışÿ +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MIDlet-Jar-URL: utf8bom.jar +MIDlet-Jar-Size: 1417 +MicroEdition-Profile: MIDP-2.0 +MicroEdition-Configuration: CLDC-1.0 +MIDlet-1: ışÿ, ,UTF8BOM.UTF8BOM diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/build/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/build/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/build/readme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/build/readme.txt Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,41 @@ +Building +-------- + +Requirements: + * Apache Ant. + * Apache Tomcat. (Tested with 6.0.26) + +Change "catalina.home" property in build.xml file to match your Tomcat +installation directory. Default is as follows: + + + +To compile the project and to create .war archive just use either of following +commands: + + ant + ant dist + +To compile only use: + + ant compile + +And to clean all build artifacts use: + + ant clean + +Deployment +---------- + +After build is complete, "installertest.war" file is created into the "build" +directory. Deploy it to Tomcat instance as any other .war file. For HTTP +authentication tests it is assumed that user named "guest" with password +"guest" and with role "guest" exits. + +Running the tests +----------------- + +Before running tests add option "-server=server_ip_address:port" to +NotificationPosterTest, DownloaderTest and InstallerEngineTest +test suites in jiut.bat (for S60) or in build.xml (for Linux) +in "javainstaller\installer\tsrc\build" directory. diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,8 @@ +MIDlet-1: HelloWorld, , helloworld.HelloWorld +MIDlet-Jar-Size: 1511 +MIDlet-Jar-URL: HelloWorld.jar +MIDlet-Name: HelloWorld +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jar Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,10 @@ +MIDlet-1: HelloWorld, , helloworld.HelloWorld +MIDlet-Jar-Size: 7867927 +MIDlet-Jar-URL: HelloWorld_8mb.jar +MIDlet-Name: HelloWorld_8mb +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +MIDlet-Install-Notify: http:///notify?tID=900_success +MIDlet-Delete-Notify: http:///notify?tID=912_deletion diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jar Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_ota.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_ota.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,10 @@ +MIDlet-1: HelloWorld, , helloworld.HelloWorld +MIDlet-Jar-Size: 1511 +MIDlet-Jar-URL: HelloWorld.jar +MIDlet-Name: HelloWorld +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +MIDlet-Install-Notify: http:///notify?tID=900_success +MIDlet-Delete-Notify: http:///notify?tID=912_deletion diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,9 @@ +MIDlet-1: HelloWorld, , helloworld.HelloWorld +MIDlet-Jar-Size: 1719 +MIDlet-Jar-URL: http:///redirect?name=HelloWorld_redirect.jar +MIDlet-Name: HelloWorld_redirect +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 +MIDlet-Install-Notify: http:///notify?tID=900_success diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jar Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jar has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/MANIFEST.MF --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/MANIFEST.MF Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/context.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/context.xml Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,20 @@ + + + + \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/content/WEB-INF/web.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/WEB-INF/web.xml Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,73 @@ + + + + installertest + + + + redirect + redirect + com.nokia.mj.impl.installer.testserver.RedirectServlet + + + redirect + /redirect + + + + + jad + jad + com.nokia.mj.impl.installer.testserver.JadServlet + + + jad + *.jad + + + + + notify + notify + com.nokia.mj.impl.installer.testserver.NotifyServlet + + + notify + /notify + + + + + + /httpauth/* + + + guest + + + + BASIC + httpauth + + + + guest + + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/content/httpauth/HelloWorld_http_auth.jad --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/content/httpauth/HelloWorld_http_auth.jad Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,8 @@ +MIDlet-1: HelloWorld, , helloworld.HelloWorld +MIDlet-Jar-Size: 1721 +MIDlet-Jar-URL: HelloWorld_http_auth.jar +MIDlet-Name: HelloWorld_http_auth +MIDlet-Vendor: Nokia +MIDlet-Version: 1.0 +MicroEdition-Configuration: CLDC-1.0 +MicroEdition-Profile: MIDP-2.0 \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/JadServlet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/JadServlet.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.mj.impl.installer.testserver; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.io.FileNotFoundException; +import java.io.IOException; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class JadServlet + */ +public class JadServlet extends HttpServlet +{ + private static final long serialVersionUID = 1L; + + protected void processRequest(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + ServletContext context = getServletContext(); + String localPath = context.getRealPath(request.getServletPath()); + + response.setContentType("text/vnd.sun.j2me.app-descriptor"); + + BufferedReader in = null; + ServletOutputStream out = null; + + try + { + in = new BufferedReader(new FileReader(localPath)); + out = response.getOutputStream(); + + String line = in.readLine(); + while (line != null) + { + if (line.startsWith("MIDlet-Jar-URL:") + || line.startsWith("MIDlet-Install-Notify:") + || line.startsWith("MIDlet-Delete-Notify:")) + { + line = line.replaceAll("", request.getServerName() + + ":" + request.getServerPort()); + line = line.replaceAll("", + request.getContextPath()); + } + out.println(line); + line = in.readLine(); + } + } + catch (FileNotFoundException e) + { + response.sendError(HttpServletResponse.SC_NOT_FOUND, + request.getServletPath()); + } + finally + { + if (out != null) + { + out.close(); + } + if (in != null) + { + in.close(); + } + } + } + + protected void doGet(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + + protected void doPost(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + +} diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/NotifyServlet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/NotifyServlet.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,54 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.mj.impl.installer.testserver; + +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class NotifyServlet + */ +public class NotifyServlet extends HttpServlet +{ + private static final long serialVersionUID = 1L; + + protected void processRequest(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + response.setStatus(HttpServletResponse.SC_OK); + } + + protected void doGet(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + + protected void doPost(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + +} diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/RedirectServlet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/RedirectServlet.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.mj.impl.installer.testserver; + +import java.io.IOException; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * Servlet implementation class RedirectServlet + */ +public class RedirectServlet extends HttpServlet +{ + private static final long serialVersionUID = 1L; + + protected void processRequest(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + int redirectCount = 1; + String redirectUrl = "http://" + request.getServerName() + ":" + + request.getServerPort() + + request.getContextPath(); + + String countParam = request.getParameter("count"); + String nameParam = request.getParameter("name"); + + if (countParam != null) + { + try + { + redirectCount = Integer.parseInt(countParam); + } + catch (NumberFormatException nfe) + { + } + } + + if (redirectCount > 1) + { + redirectUrl += request.getServletPath() + "?count=" + + (redirectCount - 1) + "&name="; + } + else + { + redirectUrl += "/"; + } + + redirectUrl += nameParam; + response.sendRedirect(redirectUrl); + } + + protected void doGet(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + + protected void doPost(HttpServletRequest request, + HttpServletResponse response) + throws ServletException, IOException + { + processRequest(request, response); + } + +} diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installerui/build/build.xml --- a/javamanager/javainstaller/installerui/build/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/build/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -1,6 +1,6 @@ @@ -50,6 +50,16 @@ + + + + + + + + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installerui/build/javainstallerui_0x2002DCB6.mmp --- a/javamanager/javainstaller/installerui/build/javainstallerui_0x2002DCB6.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/build/javainstallerui_0x2002DCB6.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javainstallerui.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installerui/data/java_3_trusted.png Binary file javamanager/javainstaller/installerui/data/java_3_trusted.png has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installerui/data/java_3_untrusted.png Binary file javamanager/javainstaller/installerui/data/java_3_untrusted.png has changed diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installerui/data/javaapplicationinstaller.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/installerui/data/javaapplicationinstaller.css Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,205 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUi.java Mon Aug 23 16:38:44 2010 +0100 @@ -385,6 +385,13 @@ } /** + * Executes given Runnable synchronously in the UI thread. + */ + public void syncExec(Runnable aRunnable) + { + } + + /** * Writes an info log entry to JavaInstaller log. * * @param aMsg message to be logged diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUiFactory.java Mon Aug 23 16:38:44 2010 +0100 @@ -50,9 +50,9 @@ installerUi = (InstallerUi)clazz.newInstance(); installerUi.init(aMode, aListener); } - catch (Exception ex) + catch (Throwable t) { - logError("Instantiating " + className + " failed", ex); + logError("Instantiating " + className + " failed", t); } return installerUi; } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallConfirmationView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallConfirmationView.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallConfirmationView.java Mon Aug 23 16:38:44 2010 +0100 @@ -23,18 +23,13 @@ import java.io.InputStream; import org.eclipse.swt.SWT; -import org.eclipse.swt.SWTException; import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; -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; /** * InstallConfirmationView asks installation confirmation diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallDetailsView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallDetailsView.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallDetailsView.java Mon Aug 23 16:38:44 2010 +0100 @@ -124,16 +124,11 @@ new String[] { iInstallInfo.getName() }), horizontalSpan, labelStyle); - if (identified) - { - // Vendor information must be displayed only for - // identified applications. - Label vendorLabel = createLabel - (InstallerUiTexts.get - (InstallerUiTexts.VENDOR, - new String[] { iInstallInfo.getVendor() }), - horizontalSpan, labelStyle); - } + Label vendorLabel = createLabel + (InstallerUiTexts.get + (InstallerUiTexts.VENDOR, + new String[] { iInstallInfo.getVendor() }), + horizontalSpan, labelStyle); Label versionLabel = createLabel (InstallerUiTexts.get diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallerUiEswt.java Mon Aug 23 16:38:44 2010 +0100 @@ -35,6 +35,7 @@ import java.io.InputStream; import java.io.IOException; +import java.util.Enumeration; import java.util.Hashtable; import org.eclipse.ercp.swt.midp.UIThreadSupport; @@ -48,6 +49,8 @@ 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.extension.ImageUtil; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Composite; @@ -126,7 +129,6 @@ // Create a hashtable for icons. iImageTable = new Hashtable(); // Create a new thread to be the UI main thread. - iUiThreadExists = true; UIThreadSupport.startInUIThread(new Runnable() { public void run() @@ -145,6 +147,7 @@ private void uiMain() { log("uiMain: thread started"); + iUiThreadExists = true; try { // Create the necessary views. @@ -201,10 +204,7 @@ display.sleep(); } } - if (iBoldFont != null && !iBoldFont.isDisposed()) - { - iBoldFont.dispose(); - } + disposeResources(); display.dispose(); log("uiMain: display disposed"); synchronized (iExitWaitObject) @@ -512,6 +512,12 @@ // updating it. synchronized (iProgressSyncObject) { + if (iDlProgressView != null && iDlProgressView.isVisible()) + { + // If download progress is being displayed, + // do not display installation progress. + return; + } if (iDisplayProgress && !iProgressView.isVisible()) { iProgressView.setVisible(true); @@ -994,6 +1000,14 @@ } /** + * Executes given Runnable synchronously in the UI thread. + */ + public void syncExec(Runnable aRunnable) + { + iParent.getDisplay().syncExec(aRunnable); + } + + /** * Returns string title basing on mode of this InstallerUi. */ protected String getTitle() @@ -1033,17 +1047,21 @@ { return iSecurityIcon; } - String iconFilename = ResourceUtil.UNTRUSTED_ICON_NAME; + int id = ImageUtil.THEME_IMAGE_SECURITY_UNTRUSTED; if (aIdentified) { - iconFilename = ResourceUtil.TRUSTED_ICON_NAME; + id = ImageUtil.THEME_IMAGE_SECURITY_TRUSTED; } - String resourceDir = ResourceUtil.getResourceDir(0); - for (int i = 1; iSecurityIcon == null && resourceDir != null; i++) + + try { - iSecurityIcon = loadImage(aDisplay, resourceDir + iconFilename, false); - resourceDir = ResourceUtil.getResourceDir(i); + iSecurityIcon = ImageUtil.createImageFromTheme(aDisplay, id); } + catch (Throwable t) + { + log("Can not load security icon: " + t); + } + return iSecurityIcon; } @@ -1133,22 +1151,26 @@ try { long startTime = System.currentTimeMillis(); - ImageData[] imageDatas = new ImageLoader().load(aInputStream); - ImageData imageData = imageDatas[0]; + + Image image = new Image(aDisplay, aInputStream); if (aScaleImage) { - Point bestSize = getBestImageSize( - imageData.width, imageData.height); - if (bestSize.x != imageData.width || - bestSize.y != imageData.height) + 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) { - imageData = imageData.scaledTo(bestSize.x, bestSize.y); - log("Image " + aImageName + " scaled from " + - imageDatas[0].width + "x" + imageDatas[0].height + - " to " + bestSize.x + "x" + bestSize.y); + // Copy and scale natively preserving the aspect ratio + result = ImageUtil.scaleImage(aDisplay, image, new Point(maxWidth, maxHeight), true); + image.dispose(); + image = null; } } - result = new Image(aDisplay, imageData); + if (result == null) + { + result = image; + } + long endTime = System.currentTimeMillis(); log("Loaded image " + aImageName + " (load time " + (endTime - startTime) + " ms)"); @@ -1162,33 +1184,6 @@ return result; } - /** - * Determines the best image size for the image of given size. - */ - private static Point getBestImageSize(int aWidth, int aHeight) - { - // Actually maximum image width and height should be obtained with - // org.eclipse.swt.internal.extension.DisplayExtension - // getBestImageWidth() and getBestImageHeight(). - final int MAX_WIDTH = 50; // max width in pixels - final int MAX_HEIGHT = 50; // max height in pixels - Point result = new Point(aWidth, aHeight); - if (result.x > MAX_WIDTH || result.y > MAX_HEIGHT) - { - if (result.x >= MAX_WIDTH) - { - result.x = MAX_WIDTH; - result.y = MAX_WIDTH * aHeight / aWidth; - } - if (result.y >= MAX_HEIGHT) - { - result.x = MAX_HEIGHT * aWidth / aHeight; - result.y = MAX_HEIGHT; - } - } - return result; - } - /** Returns true if UI has been created and can be used. */ protected boolean isUiReady() { @@ -1284,6 +1279,13 @@ } return iBoldFont; } + + int iconLabelTopMargin() + { + // Aproximating the space at the top of a Label. + // eSWT's Label adds extra space around texts but not around images. + return getBoldFont().getFontData()[0].getHeight(); + } void setActiveView(ViewBase aView) { @@ -1299,4 +1301,24 @@ { return iActiveView; } + + 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/UninstallConfirmationView.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/UninstallConfirmationView.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/UninstallConfirmationView.java Mon Aug 23 16:38:44 2010 +0100 @@ -119,16 +119,11 @@ new String[] { iUninstallInfo.getName() }), horizontalSpan, labelStyle); - if (identified) - { - // Vendor information must be displayed only for - // identified applications. - Label vendorLabel = createLabel - (InstallerUiTexts.get - (InstallerUiTexts.VENDOR, - new String[] { iUninstallInfo.getVendor() }), - horizontalSpan, labelStyle); - } + Label vendorLabel = createLabel + (InstallerUiTexts.get + (InstallerUiTexts.VENDOR, + new String[] { iUninstallInfo.getVendor() }), + horizontalSpan, labelStyle); Label versionLabel = createLabel (InstallerUiTexts.get diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/ViewBase.java --- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/ViewBase.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/ViewBase.java Mon Aug 23 16:38:44 2010 +0100 @@ -412,7 +412,11 @@ gridData.horizontalSpan = aColumns; gridData.horizontalAlignment = SWT.CENTER; gridData.verticalAlignment = SWT.TOP; + // This is to lower the image at the same level with the texts. + // eSWT's Label adds extra space around texts but not around images. + gridData.verticalIndent = iInstallerUi.iconLabelTopMargin(); label.setLayoutData(gridData); + label.setFont(iInstallerUi.getBoldFont()); return label; } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/CertificateDetailsView.java Mon Aug 23 16:38:44 2010 +0100 @@ -79,7 +79,7 @@ Label detailsLabel = createLabel( InstallerUiTexts.get(InstallerUiTexts.NOT_CERTIFIED_TITLE), horizontalSpan, labelStyle); - detailsLabel.setFont(iInstallerUi.getBoldFont()); + setCssId(detailsLabel, "heading"); // Add domain category label. createLabel("", horizontalSpan, labelStyle); @@ -103,6 +103,7 @@ new String[] { appName }), horizontalSpan, labelStyle); + setCssId(warningLabel, "detailsWarningLabel"); } /** @@ -118,7 +119,7 @@ (InstallerUiTexts.get (InstallerUiTexts.CERTIFICATE_TITLE), horizontalSpan, labelStyle); - detailsLabel.setFont(iInstallerUi.getBoldFont()); + setCssId(detailsLabel, "heading"); SigningCertificate certificate = iCerts[iCertIndex]; diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ConfirmationViewBase.java Mon Aug 23 16:38:44 2010 +0100 @@ -100,6 +100,7 @@ createCommands(); setDefaultCommand(); } + iInstallerUi.loadCss(); setVisible(true); iInstallerUi.unhide(); } @@ -184,6 +185,14 @@ if (iOkText != null) { iOkCommand = new Button(getCommandComposite(), SWT.PUSH); + if (iCancelText != null) + { + setCssId(iOkCommand, "softKeyButton"); + } + else + { + setCssId(iOkCommand, "softKeyButtonWide"); + } GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; iOkCommand.setLayoutData(gridData); @@ -230,6 +239,14 @@ if (iCancelText != null) { iCancelCommand = new Button(getCommandComposite(), SWT.PUSH); + if (iOkText != null) + { + setCssId(iCancelCommand, "softKeyButton"); + } + else + { + setCssId(iCancelCommand, "softKeyButtonWide"); + } GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; iCancelCommand.setLayoutData(gridData); diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorDetailsView.java Mon Aug 23 16:38:44 2010 +0100 @@ -69,20 +69,20 @@ protected void createView() { // Add title. + Label titleLabel = null; String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_FAILED); if (iInstallerUi.getInstallInfo() != null) { - Label titleLabel = createLabel(title, getColumns() - 1, SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); + titleLabel = createLabel(title, getColumns() - 1, SWT.WRAP); // Add security icon. iCertificates = iInstallerUi.getInstallInfo().getCertificates(); createSecurityButton(); } else { - Label titleLabel = createLabel(title, getColumns(), SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); + titleLabel = createLabel(title, getColumns(), SWT.WRAP); } + setCssId(titleLabel, "heading"); int horizontalSpan = getColumns(); int labelStyle = SWT.WRAP; @@ -90,6 +90,7 @@ // Begin widgets creation. Label errorLabel = createLabel( iException.getDetailedMessage(), horizontalSpan, labelStyle); + setCssId(errorLabel, "errorLabel"); // End of widgets creation. } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorView.java Mon Aug 23 16:38:44 2010 +0100 @@ -78,7 +78,7 @@ else { Label titleLabel = createLabel(title, getColumns(), SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); + setCssId(titleLabel, "heading"); } int horizontalSpan = getColumns(); @@ -87,6 +87,7 @@ // Begin widgets creation. Label errorLabel = createLabel( iException.getShortMessage(), horizontalSpan, labelStyle); + setCssId(errorLabel, "errorLabel"); // End of widgets creation. if (iInstallerUi.getInstallInfo() != null) diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallConfirmationView.java Mon Aug 23 16:38:44 2010 +0100 @@ -33,7 +33,6 @@ 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; @@ -107,15 +106,7 @@ protected void createView() { // Add header. - String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY); - if (iInstallInfo != null) - { - if (iInstallInfo.getOldVersion() != null) - { - title = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY); - } - } - addHeader(title, iInstallInfo, null); + addHeader(null, iInstallInfo, null); GridData gridData = null; int horizontalSpan = getColumns(); @@ -127,6 +118,7 @@ { // Add installation drive selector. iDriveSelector = new Combo(getComposite(), SWT.READ_ONLY); + setCssId(iDriveSelector, "driveSelector"); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; iDriveSelector.setLayoutData(gridData); @@ -156,6 +148,7 @@ { // Add retain user data option. iRetainDataButton = new Button(getComposite(), SWT.CHECK); + setCssId(iRetainDataButton, "retainDataButton"); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; iRetainDataButton.setLayoutData(gridData); diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java Mon Aug 23 16:38:44 2010 +0100 @@ -27,7 +27,6 @@ import com.nokia.mj.impl.installer.ui.LaunchAppInfo; import com.nokia.mj.impl.installer.ui.PermissionInfo; import com.nokia.mj.impl.installer.ui.UninstallInfo; -import com.nokia.mj.impl.installer.ui.eswt.MinimalUi; import com.nokia.mj.impl.rt.ui.ConfirmData; import com.nokia.mj.impl.rt.ui.RuntimeUi; import com.nokia.mj.impl.rt.ui.RuntimeUiFactory; @@ -37,6 +36,7 @@ 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,10 +62,15 @@ */ public class InstallerUiEswt extends InstallerUi { + /** Disable UI temporarily. */ + private static final boolean DISABLE_UI = + (System.getProperty("com.nokia.mj.impl.installer.ui.disableui") + == null? false: true); /** Default shell style. */ private static final int SHELL_STYLE = SWT.BORDER | SWT.APPLICATION_MODAL | SWT.ON_TOP; + private BaseCSSEngine iCssEngine = null; private Shell iParent = null; private Shell iDialog = null; private ProgressView iProgressView = null; @@ -98,8 +103,6 @@ private boolean iDisplayProgress = false; /** Flag telling if the first progress bar update has been traced. */ private boolean iProgressBarUpdateTraced = false; - /** Flag telling if MinimalUi should be used if UI creation fails. */ - private boolean iMinimalUiEnabled = true; /** Hashtable for storing the loaded icons. */ private static Hashtable iImageTable = null; @@ -135,7 +138,6 @@ // Create a hashtable for icons. iImageTable = new Hashtable(); // Create a new thread to be the UI main thread. - iUiThreadExists = true; UIThreadSupport.startInUIThread(new Runnable() { public void run() @@ -154,12 +156,14 @@ private void uiMain() { log("uiMain: thread started"); + iUiThreadExists = true; try { // Create the necessary views. DisplayExtension display = new DisplayExtension(); StartUpTrace.doTrace("InstallerUiEswt display created"); display.setAppName(""); // Remove display title. + iCssEngine = new BaseCSSEngine(display); iParent = new Shell(display); iDialog = new Shell(iParent, SHELL_STYLE); iDefaultShellBounds = iDialog.internal_getDefaultBounds(); @@ -182,10 +186,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) { @@ -216,10 +220,7 @@ display.sleep(); } } - if (iBoldFont != null && !iBoldFont.isDisposed()) - { - iBoldFont.dispose(); - } + disposeResources(); display.dispose(); log("uiMain: display disposed"); synchronized (iExitWaitObject) @@ -302,24 +303,14 @@ super.confirm(aInstallInfo); waitForUi(); - boolean result = true; if (!isUiReady()) { - result = false; - if (iMinimalUiEnabled) - { - result = MinimalUi.confirmStatic(aInstallInfo); - log("MinimalUi installation confirmation returns " + result); - return result; - } - else - { - // If UI is not ready by the time confirmation is requested, - // throw an exception. - throw new RuntimeException("JavaInstallerUi not ready"); - } + // If UI is not ready by the time confirmation is requested, + // throw an exception. + throw new RuntimeException("JavaInstallerUi not ready"); } + boolean result = true; if (result) { StartUpTrace.doTrace("InstallerUiEswt confirm"); @@ -463,6 +454,7 @@ public void updateProgress(int aProgress) { super.updateProgress(aProgress); + if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -473,6 +465,12 @@ // updating it. synchronized (iProgressSyncObject) { + if (iDlProgressView != null && iDlProgressView.isVisible()) + { + // If download progress is being displayed, + // do not display installation progress. + return; + } if (iDisplayProgress && !iProgressView.isVisible()) { // Re-create iProgressView here so that it gets @@ -509,6 +507,7 @@ public void ended() { super.ended(); + if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -553,6 +552,7 @@ public void started(DownloadInfo aDownloadInfo) { super.started(aDownloadInfo); + if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -579,6 +579,7 @@ public void updateProgress(DownloadInfo aDownloadInfo) { super.updateProgress(aDownloadInfo); + if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -628,6 +629,7 @@ public void ended(DownloadInfo aDownloadInfo) { super.ended(aDownloadInfo); + if (DISABLE_UI) return; // Disable UI temporarily. if (!isUiReady()) { return; @@ -654,6 +656,7 @@ public void setOcspIndicator(boolean aOn) { super.setOcspIndicator(aOn); + if (DISABLE_UI) return; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { @@ -669,9 +672,10 @@ { 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(); @@ -754,6 +758,7 @@ public void error(InstallerExceptionBase aInstallerException) { super.error(aInstallerException); + if (DISABLE_UI) return; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { @@ -799,45 +804,6 @@ } /** - * 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 @@ -850,6 +816,7 @@ */ public boolean confirm(String aAppName, ConfirmData aConfirmData) { + if (DISABLE_UI) return true; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { return true; @@ -888,6 +855,7 @@ */ public String[] getUsernamePassword(String aUrl) { + if (DISABLE_UI) return new String[] { "", "" }; // Disable UI temporarily. waitForUi(); if (!isUiReady()) { @@ -943,6 +911,7 @@ */ public boolean launchAppQuery(LaunchAppInfo aLaunchAppInfo) { + if (DISABLE_UI) return false; // Disable UI temporarily. waitForUi(); if (!isUiReady() || iConfirmationsCanceled || getInstallInfo() == null) { @@ -964,19 +933,31 @@ }); } boolean result = iLaunchAppQueryView.launchAppQuery(aLaunchAppInfo); - iParent.getDisplay().syncExec(new Runnable() + iLaunchAppQueryView.dispose(); + iLaunchAppQueryView = null; + if (!result) { - public void run() + iParent.getDisplay().syncExec(new Runnable() { - iParent.dispose(); - } - }); - iLaunchAppQueryView = null; + public void run() + { + iParent.dispose(); + } + }); + } log("LaunchAppQuery returns " + result + " for " + aLaunchAppInfo); return result; } /** + * Executes given Runnable synchronously in the UI thread. + */ + public void syncExec(Runnable aRunnable) + { + iParent.getDisplay().syncExec(aRunnable); + } + + /** * Hides or unhides InstallerUi. */ public void hide(boolean aHide) @@ -1011,20 +992,23 @@ */ protected String getTitle() { - String result = null; - if (iMode == MODE_INSTALL) - { - result = InstallerUiTexts.get(InstallerUiTexts.INSTALLING); - } - else if (iMode == MODE_UNINSTALL) + String result = super.getTitle(); + if (isUiReady()) { - result = InstallerUiTexts.get("Uninstalling"); - } - else if (iMode == MODE_APP_CONVERSION) - { - result = InstallerUiTexts.get( - "Converting data for application " + - iAppConversionCurrent + "/" + iAppConversionTotal); + 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); + } } return result; } @@ -1044,16 +1028,24 @@ { return iSecurityIcon; } - String iconFilename = ResourceUtil.UNTRUSTED_ICON_NAME; + String iconFilename = "java_3_untrusted.png"; if (aIdentified) { - iconFilename = ResourceUtil.TRUSTED_ICON_NAME; + iconFilename = "java_3_trusted.png"; } - String resourceDir = ResourceUtil.getResourceDir(0); - for (int i = 1; iSecurityIcon == null && resourceDir != null; i++) + try { - iSecurityIcon = loadImage(aDisplay, resourceDir + iconFilename, false); - resourceDir = ResourceUtil.getResourceDir(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); } return iSecurityIcon; } @@ -1144,19 +1136,21 @@ try { long startTime = System.currentTimeMillis(); - ImageData[] imageDatas = new ImageLoader().load(aInputStream); - ImageData imageData = imageDatas[0]; + Image image = new Image(aDisplay, aInputStream); + ImageData imageData = image.getImageData(); if (aScaleImage) { Point bestSize = getBestImageSize( - imageData.width, imageData.height); + imageData.width, imageData.height); if (bestSize.x != imageData.width || bestSize.y != imageData.height) { + Point oldSize = + new Point(imageData.width, imageData.height); imageData = imageData.scaledTo(bestSize.x, bestSize.y); log("Image " + aImageName + " scaled from " + - imageDatas[0].width + "x" + imageDatas[0].height + - " to " + bestSize.x + "x" + bestSize.y); + oldSize.x + "x" + oldSize.y + " to " + + bestSize.x + "x" + bestSize.y); } } result = new Image(aDisplay, imageData); @@ -1178,8 +1172,8 @@ */ private static Point getBestImageSize(int aWidth, int aHeight) { - final int MAX_WIDTH = iBestIconSize.x; - final int MAX_HEIGHT = iBestIconSize.y; + final int MAX_WIDTH = (iBestIconSize == null? 50: iBestIconSize.x); + final int MAX_HEIGHT = (iBestIconSize == null? 50: iBestIconSize.y); Point result = new Point(aWidth, aHeight); if (result.x > MAX_WIDTH || result.y > MAX_HEIGHT) { @@ -1307,4 +1301,57 @@ { 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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiTexts.java Mon Aug 23 16:38:44 2010 +0100 @@ -30,73 +30,6 @@ /*** ----------------------------- 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"; @@ -114,9 +47,8 @@ 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 = "info_app_suite_name"; + public static final String SUITE_NAME_VERSION = "info_app_suite_name_version"; 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"; @@ -161,7 +93,6 @@ 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. @@ -183,12 +114,12 @@ */ public static String get(String aTextId, Object[] 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); + if (iRes == null) + { + iRes = ResourceLoader.getInstance( + null, null, "javaapplicationinstaller", "txt_java_inst_"); + } + return iRes.format(aTextId, aTextParameters); } /*** ---------------------------- PROTECTED --------------------------- */ diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/LaunchAppQueryView.java Mon Aug 23 16:38:44 2010 +0100 @@ -18,12 +18,9 @@ package com.nokia.mj.impl.installer.ui.eswt2; -import com.nokia.mj.impl.installer.ui.InstallInfo; import com.nokia.mj.impl.installer.ui.LaunchAppInfo; -import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Button; /** * LaunchAppQueryView asks from the user if the installed @@ -31,9 +28,6 @@ */ public class LaunchAppQueryView extends ConfirmationViewBase { - private LaunchAppInfo iLaunchAppInfo = null; - private Button iDefaultButton = null; - /** Constructor */ protected LaunchAppQueryView() { @@ -46,7 +40,7 @@ { super(aInstallerUi, aParent, 8); setTitle(InstallerUiTexts.get(InstallerUiTexts.INSTALLATION_COMPLETE)); - setCommands("Show", //InstallerUiTexts.get(InstallerUiTexts.SHOW), + setCommands(InstallerUiTexts.get(InstallerUiTexts.SHOW), InstallerUiTexts.get(InstallerUiTexts.CLOSE)); } @@ -58,7 +52,6 @@ return false; } - iLaunchAppInfo = aLaunchAppInfo; // Use confirm() from super class to display the view. boolean result = confirm(); // Return the result to the client. @@ -68,8 +61,8 @@ protected void createView() { // Add header. - String title = "Installed"; - addHeader(title, iInstallerUi.getInstallInfo(), null); + addHeader(InstallerUiTexts.get(InstallerUiTexts.INSTALLATION_COMPLETE), + iInstallerUi.getInstallInfo(), null); // Add content to the application info Composite. addAppInfo(iInstallerUi.getInstallInfo(), true); } @@ -81,26 +74,4 @@ { // User selection data is initialized in button listeners. } - - /** - * Returns SWT style for this view. - */ - protected int getStyle() - { - return SWT.V_SCROLL; - } - - /** - * Called after view and commands have been created. Subclasses - * can overrride this method to set focus to their own default - * commands. - */ - protected void setDefaultCommand() - { - if (iDefaultButton != null) - { - iDefaultButton.setFocus(); - getShell().setDefaultButton(iDefaultButton); - } - } } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionConfirmationView.java Mon Aug 23 16:38:44 2010 +0100 @@ -35,7 +35,6 @@ 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; @@ -62,7 +61,7 @@ protected PermissionConfirmationView( InstallerUiEswt aInstallerUi, Composite aParent) { - super(aInstallerUi, aParent, 8, true); + super(aInstallerUi, aParent, 8); setTitle(InstallerUiTexts.get(InstallerUiTexts.INSTALLING)); setCommands(null, null); } @@ -93,39 +92,30 @@ protected void createView() { // Add header. - String title = "Install?"; - String appName = ""; - if (iInstallInfo != null) - { - if (iInstallInfo.getOldVersion() != null) - { - title = "Update?"; - } - appName = iInstallInfo.getName(); - } - addHeader(title, iInstallInfo, null); + addHeader(null, iInstallInfo, null); GridData gridData = null; - int horizontalSpan = getColumns(); int labelStyle = SWT.WRAP; // Add permission query label. - Label domainLabel = createLabel( - InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY, - new String[] { appName }), + int detailsColumns = 2; + int horizontalSpan = getColumns() - detailsColumns; + Label permissionQueryLabel = createLabel( + InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY), horizontalSpan, labelStyle); + setCssId(permissionQueryLabel, "permissionDetails"); // Add link for permission details. if (iPermissionInfo != null && iPermissionInfo.getPermissionNames() != null && iPermissionInfo.getPermissionNames().length > 0) { - Link detailsLink = new Link(getComposite(), SWT.NONE); - detailsLink.setText( - "" + - InstallerUiTexts.get(InstallerUiTexts.PERM_VIEW_DETAILS) + - ""); - detailsLink.addListener(SWT.Selection, new Listener() + 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() { public void handleEvent(Event aEvent) { @@ -134,15 +124,15 @@ }); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; - detailsLink.setLayoutData(gridData); - addSoftKeyListenerFor(detailsLink); + detailsButton.setLayoutData(gridData); + addSoftKeyListenerFor(detailsButton); } - // Number of pixels on top of the buttons. - int verticalIndent = 5; + horizontalSpan = getColumns(); // 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() @@ -169,13 +159,13 @@ }); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; - gridData.verticalIndent = verticalIndent; iAllowButton.setLayoutData(gridData); iAllowButton.setFocus(); addSoftKeyListenerFor(iAllowButton); // Add deny button. iDenyButton = new Button(getComposite(), SWT.NONE); + setCssId(iDenyButton, "denyButton"); iDenyButton.setText(InstallerUiTexts.get( InstallerUiTexts.PERM_ASK_ME_LATER)); iDenyButton.addListener(SWT.Selection, new Listener() @@ -202,12 +192,12 @@ }); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; - gridData.verticalIndent = verticalIndent; iDenyButton.setLayoutData(gridData); addSoftKeyListenerFor(iDenyButton); // Add cancel button. iCancelButton = new Button(getComposite(), SWT.NONE); + setCssId(iCancelButton, "cancelButton"); iCancelButton.setText(InstallerUiTexts.get(InstallerUiTexts.PERM_CANCEL)); iCancelButton.addListener(SWT.Selection, new Listener() { @@ -232,9 +222,12 @@ }); 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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionDetailsView.java Mon Aug 23 16:38:44 2010 +0100 @@ -64,7 +64,7 @@ (InstallerUiTexts.get (InstallerUiTexts.PERM_VIEW_DETAILS_TITLE), horizontalSpan, labelStyle); - detailsLabel.setFont(iInstallerUi.getBoldFont()); + setCssId(detailsLabel, "heading"); // Add permission names. String[] permNames = iPermissionInfo.getPermissionNames(); @@ -84,6 +84,7 @@ Label permissionDetailsLabel = createLabel( iPermissionInfo.getPermissionsDetails(), horizontalSpan, labelStyle); + setCssId(permissionDetailsLabel, "detailsWarningLabel"); } } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ProgressView.java Mon Aug 23 16:38:44 2010 +0100 @@ -86,6 +86,7 @@ { setTitle(iMsg); iLabel = createLabel(iMsg, SWT.WRAP); + setCssId(iLabel, "heading"); } iIndeterminate = aIndeterminate; @@ -102,6 +103,7 @@ iProgressBar.setMaximum(100); iProgressBar.setSelection(iValue); } + setCssId(iProgressBar, "progressBar"); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = getColumns(); iProgressBar.setLayoutData(gridData); @@ -115,6 +117,8 @@ // By default add cancel command to all progress bars. addCancelCommand(); + + iInstallerUi.loadCss(); } /** Update text for this progress bar. */ @@ -169,13 +173,18 @@ { public void run() { + // Set horizontalSpan to 2 for one button, + // and to 1 for one two buttons. + int horizontalSpan = 2; + GridData gridData = null; + /* iHideCommand = new Button(getCommandComposite(), SWT.PUSH); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.horizontalSpan = 1; + setCssId(iHideCommand, "softKeyButton"); + gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.horizontalSpan = horizontalSpan; iHideCommand.setLayoutData(gridData); iHideCommand.setText(InstallerUiTexts.get(InstallerUiTexts.HIDE)); - iHideCommand.addSelectionListener - (new SelectionListener() + iHideCommand.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent aEvent) { @@ -187,15 +196,16 @@ } }); addSoftKeyListenerFor(iHideCommand); + */ iCancelCommand = new Button(getCommandComposite(), SWT.PUSH); + setCssId(iCancelCommand, "softKeyButtonWide"); gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.horizontalSpan = 1; + gridData.horizontalSpan = horizontalSpan; iCancelCommand.setLayoutData(gridData); iCancelCommand.setText( InstallerUiTexts.get(InstallerUiTexts.CANCEL)); - iCancelCommand.addSelectionListener - (new SelectionListener() + iCancelCommand.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent aEvent) { @@ -234,8 +244,11 @@ public void run() { getShell().setDefaultButton(null); - iHideCommand.dispose(); - iHideCommand = null; + if (iHideCommand != null) + { + iHideCommand.dispose(); + iHideCommand = null; + } iCancelCommand.dispose(); iCancelCommand = null; } diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/RuntimeConfirmationView.java Mon Aug 23 16:38:44 2010 +0100 @@ -57,10 +57,18 @@ String[] answerOptions = iConfirmData.getAnswerOptions(); switch (answerOptions.length) { - case 1: setCommands(answerOptions[0], null); break; - case 2: setCommands(answerOptions[0], answerOptions[1]); break; + //case 1: setCommands(answerOptions[0], null); break; + case 1: + setCommands(InstallerUiTexts.get(InstallerUiTexts.OK), null); + break; + //case 2: setCommands(answerOptions[0], answerOptions[1]); break; + case 2: + setCommands(InstallerUiTexts.get(InstallerUiTexts.OK), + InstallerUiTexts.get(InstallerUiTexts.CANCEL)); + break; default: setCommands(null, null); break; } + } /** @@ -68,27 +76,13 @@ */ protected void createView() { - // Add title. - if (iInstallerUi.getInstallInfo() != null) - { - Label titleLabel = createLabel(iAppName, getColumns() - 1, SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); - // Add security icon. - iCertificates = iInstallerUi.getInstallInfo().getCertificates(); - createSecurityButton(); - } - else - { - Label titleLabel = createLabel(iAppName, getColumns(), SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); - } + // Add header. + addHeader(null, iInstallerUi.getInstallInfo(), null); GridData gridData = null; int horizontalSpan = getColumns(); int labelStyle = SWT.WRAP; - // Begin widgets creation. - // Add question label. Label errorLabel = createLabel( iConfirmData.getQuestion(), horizontalSpan, labelStyle); @@ -132,7 +126,9 @@ iAnswerButtons[iConfirmData.getAnswerSuggestion()].setFocus(); } - // End of widgets creation. + // After other widgets have been added, add content to + // application info Composite. + addAppInfo(iInstallerUi.getInstallInfo(), false); } /** diff -r 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/UsernamePasswordView.java Mon Aug 23 16:38:44 2010 +0100 @@ -108,28 +108,33 @@ int labelStyle = SWT.WRAP; - Label titleLabel = createLabel - (InstallerUiTexts.get(InstallerUiTexts.CONNECT_TO), labelStyle); - titleLabel.setFont(iInstallerUi.getBoldFont()); + Label titleLabel = createLabel( + InstallerUiTexts.get(InstallerUiTexts.CONNECT_TO), labelStyle); + setCssId(titleLabel, "heading"); - Label urlLabel = createLabel(iUrl, labelStyle); + Label urlLabel = createLabel(getServer(iUrl), labelStyle); + setCssId(urlLabel, "urlLabel"); - Label authLabel = createLabel - (InstallerUiTexts.get - (InstallerUiTexts.DOWNLOAD_APPLICATION, new String[] { iAppName }), - labelStyle); + Label authLabel = createLabel( + InstallerUiTexts.get(InstallerUiTexts.DOWNLOAD_APPLICATION, + new String[] { iAppName }), labelStyle); + setCssId(authLabel, "authLabel"); - Label usernameLabel = createLabel - (InstallerUiTexts.get(InstallerUiTexts.USERNAME), labelStyle); + Label usernameLabel = createLabel( + InstallerUiTexts.get(InstallerUiTexts.USERNAME), labelStyle); + setCssId(usernameLabel, "usernamePasswordLabel"); iUsernameText = new Text(getComposite(), SWT.BORDER); + setCssId(iUsernameText, "usernamePasswordInputField"); iUsernameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); addSoftKeyListenerFor(iUsernameText); - Label passwordLabel = createLabel - (InstallerUiTexts.get(InstallerUiTexts.PASSWORD), labelStyle); + Label passwordLabel = createLabel( + InstallerUiTexts.get(InstallerUiTexts.PASSWORD), labelStyle); + setCssId(passwordLabel, "usernamePasswordLabel"); iPasswordText = new Text(getComposite(), SWT.PASSWORD | SWT.BORDER); + setCssId(iPasswordText, "usernamePasswordInputField"); iPasswordText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); addSoftKeyListenerFor(iPasswordText); } @@ -151,4 +156,31 @@ { 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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java Mon Aug 23 16:38:44 2010 +0100 @@ -34,6 +34,7 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.internal.qt.WidgetConstant; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -42,6 +43,7 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Widget; /** * Base class for different InstallerUi views. @@ -50,6 +52,8 @@ { /** 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 */ @@ -99,6 +103,7 @@ iParent = (Shell)aParent; iContainer = new Composite(iParent, 0); + setCssId(iContainer, "dialogArea"); iContainer.setVisible(false); iColumns = aColumns; @@ -216,7 +221,7 @@ /** Set title for this view. */ public void setTitle(String aTitle) { - // Dialog shells have no title anymore + // Dialog shells have no title. } /** Disposes this view. */ @@ -341,12 +346,12 @@ SWT.DEFAULT, SWT.DEFAULT)); } - int contentWidth = iDefaultContentSize.x; + int contentWidth = iDefaultContentSize.x * MAX_VIEW_WIDTH / 100; if (aVerticalScrollBarVisible) { int verticalScrollBarWidth = getScrolledComposite().getVerticalBar().getSize().x; - contentWidth = iDefaultContentSize.x - verticalScrollBarWidth; + contentWidth -= verticalScrollBarWidth; } // Recalculate the size of the content. @@ -355,7 +360,7 @@ Point cmdContentSize = cmdComp.computeSize(iDefaultContentSize.x, SWT.DEFAULT); cmdComp.setSize(cmdContentSize); - // Adjust Shell height. The Shell never changes the x position, nor the width. + // Adjust Shell height and width. Rectangle dispRect = shell.getDisplay().getClientArea(); int offset = iDefaultContentSize.y - contentSize.y - cmdContentSize.y; @@ -368,18 +373,20 @@ 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; - // Always center vertically. + x /= 2; y /= 2; - // 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); + shell.setBounds(x, y, newWidth, newHeight); Rectangle clientArea = shell.getClientArea(); iContainer.setSize(clientArea.width, clientArea.height); iContainer.layout(true); @@ -434,6 +441,14 @@ } /** + * Sets CSS id for given widget. + */ + protected void setCssId(Widget aWidget, String aCssId) + { + aWidget.setData(WidgetConstant.CSS_ID, aCssId); + } + + /** * Adds header used in installation views. */ protected void addHeader( @@ -450,26 +465,28 @@ boolean aSecurityButton) { // Add title. - String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY); + if (aTitle == null) + { + aTitle = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY); + if (aInstallInfo != null && aInstallInfo.getOldVersion() != null) + { + aTitle = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY); + } + } + Label titleLabel = createLabel(aTitle, getColumns() - 1, SWT.WRAP); + setCssId(titleLabel, "heading"); + if (aInstallInfo != null) { - if (aInstallInfo.getOldVersion() != null) - { - title = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY); - } iCertificates = aInstallInfo.getCertificates(); } - if (aUninstallInfo != null) + else if (aUninstallInfo != null) { - title = "Uninstall?"; iCertificates = aUninstallInfo.getCertificates(); } - Label titleLabel = createLabel(aTitle, getColumns() - 1, SWT.WRAP); - titleLabel.setFont(iInstallerUi.getBoldFont()); - if (aSecurityButton) { - // Add security icon. + // Add security button. createSecurityButton(); } else @@ -501,11 +518,12 @@ { iconColumns = 2; Label iconLabel = createLabel(iSuiteIcon, iconColumns, SWT.NONE); + setCssId(iconLabel, "contentIcon"); } // Create a Composite for displaying application info. iAppInfoScrolledComposite = - new ScrolledComposite(getComposite(), SWT.H_SCROLL | SWT.V_SCROLL); + new ScrolledComposite(getComposite(), SWT.V_SCROLL); iAppInfoScrolledComposite.setAlwaysShowScrollBars(false); iAppInfoScrolledComposite.setExpandHorizontal(true); GridData gridData = new GridData(GridData.FILL_BOTH); @@ -514,6 +532,7 @@ iAppInfoComposite = new Composite(iAppInfoScrolledComposite, SWT.NONE); iAppInfoComposite.setLayout(new GridLayout(1, true)); iAppInfoScrolledComposite.setContent(iAppInfoComposite); + setCssId(iAppInfoScrolledComposite, "appInfoArea"); } /** @@ -530,21 +549,16 @@ // Add suite name and version. createAppInfoLabel( InstallerUiTexts.get( - InstallerUiTexts.SUITE_NAME, + InstallerUiTexts.SUITE_NAME_VERSION, new String[] { aInstallInfo.getName(), aInstallInfo.getVersion() })); if (aFull) { // Add vendor. - if (aInstallInfo.getCertificates() != null) - { - // Vendor information must be displayed only for - // identified applications. - createAppInfoLabel( - InstallerUiTexts.get( - InstallerUiTexts.SUITE_VENDOR, - new String[] { aInstallInfo.getVendor() })); - } + createAppInfoLabel( + InstallerUiTexts.get( + InstallerUiTexts.SUITE_VENDOR, + new String[] { aInstallInfo.getVendor() })); } // Add size. long size = 0; @@ -558,10 +572,20 @@ } if (size > 0) { - createAppInfoLabel( - InstallerUiTexts.get( - InstallerUiTexts.SIZE_KB, - new String[] { Long.toString(1 + size/1024) })); + 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)) })); + } } if (aFull) { @@ -644,7 +668,7 @@ GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = aColumns; gridData.horizontalAlignment = SWT.CENTER; - gridData.verticalAlignment = SWT.CENTER; + gridData.verticalAlignment = SWT.TOP; label.setLayoutData(gridData); return label; } @@ -676,6 +700,7 @@ protected Label createSecurityLabel(boolean aIdentified) { Label label = createLabel((Image)null, 1, SWT.NONE); + setCssId(label, "securityLabel"); Image securityIcon = null; if (iInstallerUi != null) { @@ -696,6 +721,7 @@ protected Button createSecurityButton() { Button button = new Button(getComposite(), SWT.PUSH); + setCssId(button, "securityButton"); GridData gridData = new GridData( GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL); gridData.horizontalSpan = 1; diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/javainstaller.pro --- a/javamanager/javainstaller/javainstaller.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/javainstaller.pro Mon Aug 23 16:38:44 2010 +0100 @@ -17,4 +17,5 @@ SUBDIRS += installerui/build/javainstallerui.pro SUBDIRS += installer/build/javainstaller.pro BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"appinstuiplugin/build/bld.inf\"" +BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"iconsizenotifplugin/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp --- a/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -42,6 +42,7 @@ // Sources SOURCEPATH ../src +SOURCE asyncwaitcallback.cpp SOURCE javasifplugin.cpp SOURCE proxy.cpp SOURCE resultsserver.cpp @@ -52,13 +53,14 @@ USERINCLUDE ../inc USERINCLUDE ../../../../inc -SYSTEMINCLUDE ../../../../inc +SYSTEMINCLUDE /epoc32/include/mw/hb/hbwidgets // 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 \ No newline at end of file +LIBRARY javaruntimestarterutils.lib diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/javasifplugin/inc/asyncwaitcallback.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/javasifplugin/inc/asyncwaitcallback.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,78 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/javasifplugin/inc/javasifplugin.h --- a/javamanager/javainstaller/javasifplugin/inc/javasifplugin.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/inc/javasifplugin.h Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,10 +22,13 @@ #define JAVASIFPLUGIN_H #include +#include #include +#include "asyncwaitcallback.h" #include "f32file.h" -#include "resultsserver.h" + +class ResultsServer; using namespace Usif; @@ -36,9 +39,9 @@ const int INSTALLER_CANCEL_MESSAGE_ID = 603; const int INSTALLER_CANCEL_RESPONSE_MESSAGE_ID = 604; -namespace Java +namespace java { -namespace Installer +namespace installer { /** @@ -195,6 +198,11 @@ virtual void CancelOperation(); + /** + * Hides 'preparing installation' dialog. + */ + void HidePrepInstDialogL(); + private: /** @@ -221,16 +229,96 @@ */ 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 - TRequestStatus* iStatus; - RFs iRFs; - RArray iHandlesToClose; - ResultsServer* iResultsServer; + RFs mRFs; + RArray mHandlesToClose; + ResultsServer* mResultsServer; - COpaqueNamedParams* iDummyResults; - CComponentInfo* iDummyInfo; + COpaqueNamedParams* mDummyResults; + CComponentInfo* mDummyInfo; + + CHbDeviceNotificationDialogSymbian* mPrepInstDialog; + CAsyncWaitCallBack* mWaitToHideDialog; }; } // Installer diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/javasifplugin/inc/resultsserver.h --- a/javamanager/javainstaller/javasifplugin/inc/resultsserver.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/inc/resultsserver.h Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -65,18 +65,19 @@ CommsEndpoint* getComms() { - return &iComms; + return &mComms; } private: void clearData(); void setComponentInfoL(); + void resetDefaultErrorValues(); + void setCommonErrorInfo(); private: - int iRunning; // 1 if running, 0 if not running - CommsServerEndpoint iComms; - COpaqueNamedParams &iResults; - CComponentInfo &iInfo; + CommsServerEndpoint mComms; + COpaqueNamedParams &mResults; + CComponentInfo &mInfo; std::map iIntPairs; std::map iStringPairs; diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/javasifplugin/src/asyncwaitcallback.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/javasifplugin/src/asyncwaitcallback.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,84 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp --- a/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,33 +20,92 @@ #include #include +#include +#include #include #include -#include -#include +#include +#include #include "comms.h" +#include "commsclientendpoint.h" #include "commsmessage.h" -#include "commsclientendpoint.h" -#include "javasifplugin.h" -#include "javauids.h" -#include "logger.h" +#include "javacommonutils.h" #include "javaoslayer.h" #include "javaprocessconstants.h" #include "javasymbianoslayer.h" +#include "javauids.h" +#include "logger.h" +#include "resultsserver.h" #include "runtimeexception.h" +#include "javasifplugin.h" -using namespace Java::Installer; + +using namespace java::installer; using namespace java::util; using namespace java::comms; _LIT(KPrivateDataCage, "\\private\\"); _LIT(KInboxDataCage, "\\private\\1000484b\\"); +_LIT(KJavaInstallerProcess, "Installer*"); +_LIT(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 =============================== @@ -61,24 +120,33 @@ CJavaSifPlugin::~CJavaSifPlugin() { - iRFs.Close(); + mRFs.Close(); - TInt nHandles = iHandlesToClose.Count(); + TInt nHandles = mHandlesToClose.Count(); while (nHandles > 0) { nHandles--; - iHandlesToClose[nHandles].Close(); + mHandlesToClose[nHandles].Close(); } - iHandlesToClose.Reset(); + mHandlesToClose.Reset(); + + delete mResultsServer; + mResultsServer = NULL; + + delete mDummyResults; + mDummyResults = NULL; - delete iResultsServer; - iResultsServer = NULL; + delete mDummyInfo; + mDummyInfo = NULL; + + delete mPrepInstDialog; + mPrepInstDialog = NULL; - delete iDummyResults; - iDummyResults = NULL; - - delete iDummyInfo; - iDummyInfo = NULL; + if (mWaitToHideDialog) + { + delete mWaitToHideDialog; + mWaitToHideDialog = NULL; + } } CJavaSifPlugin::CJavaSifPlugin() @@ -87,11 +155,12 @@ void CJavaSifPlugin::ConstructL() { - User::LeaveIfError(iRFs.Connect()); - User::LeaveIfError(iRFs.ShareProtected()); - iResultsServer = NULL; - iDummyResults = COpaqueNamedParams::NewL(); - iDummyInfo = CComponentInfo::NewL(); + User::LeaveIfError(mRFs.Connect()); + User::LeaveIfError(mRFs.ShareProtected()); + mResultsServer = NULL; + mDummyResults = COpaqueNamedParams::NewL(); // codescanner::forgottoputptroncleanupstack + mDummyInfo = CComponentInfo::NewL(); + mWaitToHideDialog = NULL; } void CJavaSifPlugin::GetComponentInfo( @@ -101,7 +170,7 @@ TRequestStatus& aStatus) { RFile fileHandle; - TInt err = fileHandle.Open(iRFs, aFileName, EFileShareReadersOnly | EFileRead); + TInt err = fileHandle.Open(mRFs, aFileName, EFileShareReadersOnly | EFileRead); if (KErrNone != err) { ELOG1(EJavaInstaller, @@ -122,22 +191,37 @@ CComponentInfo& aComponentInfo, TRequestStatus& aStatus) { + if (ExitIfJavaInstallerRunning(*mDummyResults, aStatus)) + { + return; + } + RProcess rJavaInstaller; TFileName fileName; - TBuf<1536> commandLine; + HBufC* pBufCommandLine = NULL; + TRAPD(err, pBufCommandLine = HBufC::NewL(KLongCmdLineLen)) + if (KErrNone != err) + { + TRequestStatus *statusPtr(&aStatus); + User::RequestComplete(statusPtr, err); + return; + } + std::auto_ptr bufCommandLine(pBufCommandLine); + TPtr commandLine = pBufCommandLine->Des(); // Build command line used to pass all necessary info to Java Installer std::auto_ptr installerStarterDll( stringToDes(java::runtime::JAVA_INSTALLER_STARTER_DLL)); commandLine = installerStarterDll->Des(); - commandLine.Append(_L(" componentinfo")); + commandLine.Append(KComponentInfo); // Ask Java Installer to send component info back // as Comms message. 11000 is IPC_ADDRESS_JAVA_SIF_PLUGIN_C Comms endpoint // that our ResultsServer will listen to. - commandLine.Append(_L(" -commsresult=11000")); + commandLine.Append(KCommsResult); + commandLine.AppendNum(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); - TInt err = aFileHandle.FullName(fileName); + err = aFileHandle.FullName(fileName); // Java Installer does not have AllFiles capability. // So if the .jad/.jar file is in the private data cage of @@ -154,42 +238,30 @@ } // Check whether the file is .jad or .jar - RApaLsSession apaSession; - err = apaSession.Connect(); + TBool isJad; + err = IsJadFile(aFileHandle, isJad); if (KErrNone != err) { - ELOG1(EJavaInstaller, - "CJavaSifPlugin::GetComponentInfo RApaLsSession Connect error %d", err); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; } - TDataType jadFileMimeType(_L8("text/vnd.sun.j2me.app-descriptor")); - TBool isJad = EFalse; - err = apaSession.RecognizeSpecificData(aFileHandle, jadFileMimeType, isJad); - apaSession.Close(); - if (KErrNone != err) - { - // Just log the error - ELOG1(EJavaInstaller, - "CJavaSifPlugin::GetComponentInfo RApaLsSession RecognizeSpecificData error %d", - err); - } if (isJad) { // Installation should be started from JAD file - commandLine.Append(_L(" -jad=")); + commandLine.Append(KJad); } else { // from JAR file - commandLine.Append(_L(" -jar=")); + commandLine.Append(KJar); } + // Filename parameter must be surrounded in double quotes to // ensure that spaces in filename are passed correctly. - commandLine.Append(_L("\"")); + commandLine.Append(KDoubleQuote); commandLine.Append(fileName); - commandLine.Append(_L("\"")); + commandLine.Append(KDoubleQuote); // Start JavaInstaller std::auto_ptr installerProcess( @@ -197,21 +269,7 @@ err = rJavaInstaller.Create(installerProcess->Des(), commandLine); if (KErrNone == err) { - // Destroy old Comms server if it exists - delete iResultsServer; - iResultsServer = NULL; - // Start new Comms server that receives component info and sets it to - // to aComponentInfo. - iResultsServer = new ResultsServer(*iDummyResults, aComponentInfo); - if (NULL == iResultsServer) - { - err = KErrNoMemory; - } - else - { - // Start the server - err = iResultsServer->start(); - } + err = StartResultsServer(*mDummyResults, aComponentInfo); if (KErrNone != err) { // server cannot be started @@ -241,7 +299,16 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - iHandlesToClose.Append(rJavaInstaller); + 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; + } } void CJavaSifPlugin::Install( @@ -252,11 +319,12 @@ TRequestStatus& aStatus) { RFile fileHandle; - TInt err = fileHandle.Open(iRFs, aFileName, EFileShareReadersOnly | EFileRead); + TInt err = fileHandle.Open(mRFs, aFileName, EFileShareReadersOnly | EFileRead); if (KErrNone != err) { ELOG1(EJavaInstaller, "CJavaSifPlugin::Install Opening file for reading failed with error %d", err); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; @@ -273,16 +341,29 @@ COpaqueNamedParams& aResults, TRequestStatus& aStatus) { - RProcess rJavaInstaller; - TFileName fileName; - // Max two path names and some options -> 1536 is enough - TBuf<1536> commandLine; + 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(); // Build command line used to pass all necessary info to Java Installer std::auto_ptr installerStarterDll( stringToDes(java::runtime::JAVA_INSTALLER_STARTER_DLL)); commandLine = installerStarterDll->Des(); - commandLine.Append(_L(" install")); + commandLine.Append(KInstall); // Check whether this is silent installation TInt silentInstall = 0; @@ -294,175 +375,36 @@ { ELOG(EJavaInstaller, "CJavaSifPlugin::Install The caller did not have TrustedUI capability"); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ESecurityError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, KErrPermissionDenied); return; } - commandLine.Append(_L(" -silent")); + commandLine.Append(KSilent); } - - 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) + else { - 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 + // 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); + //} } - // KSifInParam_AllowUntrusted Yes/No/AskUser -> -untrusted=yes|no - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_AllowUntrusted, intValue)); - if (paramFound) - { - if (intValue == 0) // Yes - { - commandLine.Append(_L(" -untrusted=yes")); - } - else if (intValue == 1) // No - { - commandLine.Append(_L(" -untrusted=no")); - } - // AskUser is not supported - } - - // KSifInParam_AllowOverwrite Yes/No/AskUser -> -overwrite=yes|no - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_AllowOverwrite, intValue)); - if (paramFound) - { - if (intValue == 0) // Yes - { - commandLine.Append(_L(" -overwrite=yes")); - } - else if (intValue == 1) // No - { - commandLine.Append(_L(" -overwrite=no")); - } - // AskUser is not supported - } - - // KSifInParam_AllowDownload Yes/No/AskUser -> -download=yes|no - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_AllowDownload, intValue)); - if (paramFound) - { - if (intValue == 0) // Yes - { - commandLine.Append(_L(" -download=yes")); - } - else if (intValue == 1) // No - { - commandLine.Append(_L(" -download=no")); - } - // AskUser is not supported - } - - // KSifInParam_UserName -> -username=download_username - TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_UserName)); - if (desValue.Length() > 0) - { - commandLine.Append(_L(" -username=")); - commandLine.Append(desValue); - } - - // KSifInParam_Password -> -password=download_password - TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_Password)); - if (desValue.Length() > 0) - { - commandLine.Append(_L(" -password=")); - commandLine.Append(desValue); - } - - // KSifInParam_SourceUrl -> -sourceurl=original (HTTP) URL of the JAD or JAR file - TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_SourceUrl)); - if (desValue.Length() > 0) - { - commandLine.Append(_L(" -sourceurl=")); - commandLine.Append(desValue); - } - - // KSifInParam_IAP -> -iap=IAP_ID (internet access point id) - TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_IAP, intValue)); - if (paramFound) - { - commandLine.Append(_L(" -iap=")); - commandLine.AppendNum(intValue); - } - - // KSifInParam_Charset -> -charset=Internet-standard character set name - TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_Charset)); - if (desValue.Length() > 0) - { - commandLine.Append(_L(" -charset=")); - commandLine.Append(desValue); - } - + BuildInstallCommandLine(commandLine, aArguments); // Ask Java Installer to send installation results back // as Comms message. 11000 is IPC_ADDRESS_JAVA_SIF_PLUGIN_C Comms endpoint // that our ResultsServer will listen to. - commandLine.Append(_L(" -commsresult=11000")); + commandLine.Append(KCommsResult); + commandLine.AppendNum(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); - TInt err = aFileHandle.FullName(fileName); + TFileName fileName; + err = aFileHandle.FullName(fileName); // Java Installer does not have AllFiles capability. // So if the .jad/.jar file is in the private data cage of @@ -473,74 +415,53 @@ TRAP(err, CopyFilesIfNeededL(fileName)); if (KErrNone != err) { + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; } // Check whether the file is .jad or .jar - RApaLsSession apaSession; - err = apaSession.Connect(); + TBool isJad = EFalse; + err = IsJadFile(aFileHandle, aArguments, isJad); if (KErrNone != err) { - ELOG1(EJavaInstaller, - "CJavaSifPlugin::Install RApaLsSession Connect error %d", err); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; } - TDataType jadFileMimeType(_L8("text/vnd.sun.j2me.app-descriptor")); - TBool isJad = EFalse; - err = apaSession.RecognizeSpecificData(aFileHandle, jadFileMimeType, isJad); - apaSession.Close(); - if (KErrNone != err) - { - ELOG1(EJavaInstaller, - "CJavaSifPlugin::Install RApaLsSession RecognizeSpecificData error %d", err); - } if (isJad) { // Installation should be started from JAD file - commandLine.Append(_L(" -jad=")); + commandLine.Append(KJad); } else { // from JAR file - commandLine.Append(_L(" -jar=")); + commandLine.Append(KJar); } // Filename parameter must be surrounded in double quotes to // ensure that spaces in filename are passed correctly. - commandLine.Append(_L("\"")); + commandLine.Append(KDoubleQuote); commandLine.Append(fileName); - commandLine.Append(_L("\"")); + commandLine.Append(KDoubleQuote); // Start JavaInstaller std::auto_ptr installerProcess( stringToDes(java::runtime::JAVA_PROCESS)); + RProcess rJavaInstaller; err = rJavaInstaller.Create(installerProcess->Des(), commandLine); if (KErrNone == err) { - // Destroy old Comms server if it exists - delete iResultsServer; - iResultsServer = NULL; - // Start new Comms server that receives component ids, sets them - // to aResults. - iResultsServer = new ResultsServer(aResults, *iDummyInfo); - if (NULL == iResultsServer) - { - err = KErrNoMemory; - } - else - { - // Start the server - err = iResultsServer->start(); - } + err = StartResultsServer(aResults, *mDummyInfo); if (KErrNone != err) { // server cannot be started rJavaInstaller.Close(); ELOG1(EJavaInstaller, "CJavaSifPlugin::Install: Cannot start results server, err %d", err); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; @@ -555,37 +476,81 @@ 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. - iHandlesToClose.Append(rJavaInstaller); + 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; + } + } void CJavaSifPlugin::Uninstall( TComponentId aComponentId, const TSecurityContext& aSecurityContext, const COpaqueNamedParams& aArguments, - COpaqueNamedParams& /* aResults */, + COpaqueNamedParams& aResults, TRequestStatus& aStatus) { - RProcess rJavaInstaller; - TFileName fileName; - // Max one uid and some options -> 256 is enough - TBuf<256> commandLine; + 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(); // Build command line used to pass all necessary info to Java Installer std::auto_ptr installerStarterDll( stringToDes(java::runtime::JAVA_INSTALLER_STARTER_DLL)); commandLine = installerStarterDll->Des(); - commandLine.Append(_L(" uninstall")); + commandLine.Append(KUninstall); - commandLine.Append(_L(" -cid=")); + commandLine.Append(KCid); commandLine.AppendNum(aComponentId); // Check whether this is silent uninstallation @@ -598,24 +563,35 @@ { ELOG(EJavaInstaller, "CJavaSifPlugin::Uninstall The caller did not have TrustedUI capability"); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ESecurityError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, KErrPermissionDenied); return; } - commandLine.Append(_L(" -silent")); + commandLine.Append(KSilent); } - // No need to start iResultsServer because Uninstall() does not - // return anything usefull in aResults. We could return extended - // error code there. - // start JavaInstaller std::auto_ptr installerProcess( stringToDes(java::runtime::JAVA_PROCESS)); - TInt err = rJavaInstaller.Create(installerProcess->Des(), commandLine); + RProcess rJavaInstaller; + err = rJavaInstaller.Create(installerProcess->Des(), commandLine); if (KErrNone == err) { + err = StartResultsServer(aResults, *mDummyInfo); + if (KErrNone != err) + { + // server cannot be started + rJavaInstaller.Close(); + ELOG1(EJavaInstaller, + "CJavaSifPlugin::Uninstall: Cannot start results server, err %d", err); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); + TRequestStatus *statusPtr(&aStatus); + User::RequestComplete(statusPtr, err); + return; + } + // the exit status of Java Installer will be passed to // the asynch caller through aStatus rJavaInstaller.Logon(aStatus); @@ -627,6 +603,7 @@ rJavaInstaller.Close(); ELOG1(EJavaInstaller, "CJavaSifPlugin::Uninstall: starting JavaInstaller failed, err=%d", err); + TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError)); TRequestStatus *statusPtr(&aStatus); User::RequestComplete(statusPtr, err); return; @@ -634,7 +611,17 @@ // Do NOT close rJavaInstaller now -> the caller gets notification when the // process actually closes. - iHandlesToClose.Append(rJavaInstaller); + 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; + } } void CJavaSifPlugin::Activate( @@ -664,7 +651,7 @@ // Send cancel message to Java Installer // Check whether there is anything to cancel - if (iHandlesToClose.Count() < 1) + if (mHandlesToClose.Count() < 1) { // No Java Installer process running, do nothing WLOG(EJavaInstaller, @@ -672,64 +659,47 @@ return; } - try - { - CommsMessage message; - message.setModuleId(PLUGIN_ID_SAMPLE_C); - message.setReceiver(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C); - message.setSender(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); - message.setMessageId(INSTALLER_CANCEL_MESSAGE_ID); + CommsMessage message; + message.setReceiver(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C); + message.setSender(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); + message.setMessageId(INSTALLER_CANCEL_MESSAGE_ID); - CommsMessage replyMessage; - int timeout = 10; // 10 seconds + CommsMessage replyMessage; + int timeout = 10; // 10 seconds // codescanner::magicnumbers - CommsClientEndpoint comms; - int err = comms.connect(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C); - if (KErrNone == err) - { - err = comms.sendReceive(message, replyMessage, timeout); - } - else - { - // Cannot connect to Java Installer Comms end point, - // for example Java Installer is still starting up or - // already exiting - WLOG1(EJavaInstaller, - "CJavaSifPlugin:CancelOperation: Cannot connect to Java Installer " - "Comms end point, err %d", err); - return; - } - if (err != 0) - { - // Sending message to Java Installer failed. - ELOG1(EJavaInstaller, - "CJavaSifPlugin:CancelOperation: Cannot send message to Java Installer, err %d", - err); - // Ignore possible errors in disconnect - (void)comms.disconnect(); - return; - } - - // Ignore the cancel result returned in replyMessage - // because current SIF API does not return cancel result - - // Ignore possible errors in disconnect - (void)comms.disconnect(); + CommsClientEndpoint comms; + int err = comms.connect(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C); + if (KErrNone == err) + { + err = comms.sendReceive(message, replyMessage, timeout); } - catch (ExceptionBase& e) + else { - ELOG1(EJavaInstaller, - "CJavaSifPlugin: Send cancel msg failed: ExceptionBase caught: %s ", - e.toString().c_str()); + // Cannot connect to Java Installer Comms end point, + // for example Java Installer is still starting up or + // already exiting + WLOG1(EJavaInstaller, + "CJavaSifPlugin:CancelOperation: Cannot connect to Java Installer " + "Comms end point, err %d", err); return; } - catch (std::exception& e) + if (err != 0) { + // Sending message to Java Installer failed. ELOG1(EJavaInstaller, - "CJavaSifPlugin: Send cancel msg failed: Exception %s caught", e.what()); + "CJavaSifPlugin:CancelOperation: Cannot send message to Java Installer, err %d", + err); + // Ignore possible errors in disconnect + (void)comms.disconnect(); // codescanner::voidparameter return; } + // Ignore the cancel result returned in replyMessage + // because current SIF API does not return cancel result + + // Ignore possible errors in disconnect + (void)comms.disconnect(); // codescanner::voidparameter + // It takes some time before Java Installer had really cancelled // the operation and exited. Wait for it to happen because this function // must return only after the original asynchronous call is completed. @@ -737,14 +707,14 @@ // This array contains process handles for all Java Installer processes // started from this sif plugin. The last handle is the active one. // Check if it is still running - if (iHandlesToClose[iHandlesToClose.Count()-1].ExitReason() != 0) + if (mHandlesToClose[mHandlesToClose.Count()-1].ExitReason() != 0) { // Process has already closed return; } // Wait until it exits - iHandlesToClose[iHandlesToClose.Count()-1].Logon(status); - User::WaitForRequest(status); + mHandlesToClose[mHandlesToClose.Count()-1].Logon(status); + User::WaitForRequest(status); // codescanner::userWaitForRequest // Ignore the exit status of Java Installer because current SIF API // does not return cancel result @@ -755,7 +725,7 @@ { // Check if the file is in the private data cage of some process TInt idx = aFileName.FindF(KPrivateDataCage); - if ((idx != KErrNotFound) && (idx < 3)) + if ((idx != KErrNotFound) && (idx < 3)) // codescanner::magicnumbers { // In case of device Inbox or Java Installer itself do nothing if ((aFileName.FindF(KInboxDataCage) != KErrNotFound) || @@ -770,19 +740,37 @@ // (aFileName is \., copy \.* // to Java Installer tmp dir.) TParse fp; - iRFs.Parse(aFileName, fp); - - CFileMan* fm = CFileMan::NewL(iRFs); + mRFs.Parse(aFileName, fp); TFileName filesToCopy = fp.DriveAndPath(); filesToCopy.Append(fp.Name()); filesToCopy.Append(KAnyExtension); - TInt err = fm->Copy(filesToCopy, KJavaInstallerTmp, CFileMan::ERecurse); - delete fm; - if (KErrNone != err) + + // Use JavaInstallCopier.exe to copy the files. + RProcess rJavaInstallCopier; + TInt err = rJavaInstallCopier.Create( + KJavaInstallCopierProcess, filesToCopy); + 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: copying files " - "to Java Installer data cage failed, err=%d", err); + "CJavaSifPlugin::CopyFilesIfNeededL: starting " + "JavaInstallCopier failed, err=%d", err); User::Leave(err); } @@ -795,4 +783,446 @@ 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 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/javasifplugin/src/proxy.cpp --- a/javamanager/javainstaller/javasifplugin/src/proxy.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/src/proxy.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -26,7 +26,7 @@ // CONSTANTS const TImplementationProxy KImplementationTable[] = { IMPLEMENTATION_PROXY_ENTRY(KJavaSifPluginEcomImplUid, - Java::Installer::CJavaSifPlugin::NewL) + java::installer::CJavaSifPlugin::NewL) }; // ----------------------------------------------------------------------------- diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/javasifplugin/src/resultsserver.cpp --- a/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of the License "Eclipse Public License v1.0" @@ -11,14 +11,18 @@ * * Contributors: * -* Description: Comms server, -* part of Java platform 2.0 javarestoreconverter process +* Description: Comms server, part of Java Sif plugin. +* When started in 'commsresult' mode from Java Sif plugin +* Java Installer sends the results of the operation +* it executes (install, uninstall or component info) +* to this server. * */ #include #include +#include #include "comms.h" #include "javasymbianoslayer.h" @@ -29,7 +33,7 @@ using namespace std; ResultsServer::ResultsServer(COpaqueNamedParams& aResults, CComponentInfo& aInfo) : - iResults(aResults), iInfo(aInfo) + mResults(aResults), mInfo(aInfo) { } @@ -44,23 +48,43 @@ int ResultsServer::start() { - iRunning = 1; - iComms.registerDefaultListener(this); - return iComms.start(IPC_ADDRESS_JAVA_SIF_PLUGIN_C); + // 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); } int ResultsServer::stop() { - if (iRunning > 0) - { - iRunning = 0; - iComms.unregisterDefaultListener(this); - return iComms.stop(); - } - else - { - return 0; - } + mComms.unregisterDefaultListener(this); + return mComms.stop(); } /** @@ -117,66 +141,8 @@ if (KErrNone != result) { - // 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; - } + // return common error information; + setCommonErrorInfo(); if (INSTALL_OPERATION == operation) { @@ -197,17 +163,21 @@ } else { - // operation succeeded + // Operation succeeded + + // Overwrite (reset) the default error values set for the case where no + // InstallerResultMessage is never received + resetDefaultErrorValues(); if (INSTALL_OPERATION == operation) { // Return the component ids of the installed Java application. TComponentId resultComponentId = iIntPairs[L"suite-cid"]; - TRAP(err, iResults.AddIntL(KSifOutParam_ComponentId, resultComponentId)); + TRAP(err, mResults.AddIntL(KSifOutParam_ComponentId, resultComponentId)); if (KErrNone != err) { ELOG1(EJavaInstaller, - "ResultsServer::processMessage iResults.AddIntL cid error %d", err); + "ResultsServer::processMessage mResults.AddIntL cid error %d", err); } } else if (UNINSTALL_OPERATION == operation) @@ -239,7 +209,7 @@ reply.setMessageId(INSTALLER_RESULT_RESPONSE_MESSAGE_ID); reply << 0; - int err = iComms.send(reply); + int err = mComms.send(reply); if (err != 0) { ELOG1(EJavaInstaller, @@ -262,6 +232,95 @@ } +/** + * Set common error information. + * Note that the information is in member variables + * iIntPairs and iStringPairs + */ +void ResultsServer::setCommonErrorInfo() +{ + // return common error information + TRAPD(err, mResults.AddIntL(KSifOutParam_ErrCode, iIntPairs[L"error-code"])); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.AddIntL ErrCode err %d", err); + } + + TRAP(err, mResults.AddIntL( + KSifOutParam_ErrCategory, iIntPairs[L"error-category"])); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.AddIntL ErrCategory err %d", + err); + } + + HBufC *message = wstringToBuf(iStringPairs[L"error-message"]); + if (!message) + { + ELOG(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.wstringToBuf returned NULL "); + } + else + { + TRAP(err, mResults.AddStringL(KSifOutParam_ErrMessage, *message)); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.AddStringL ErrMessage err %d", + err); + } + delete message; + } + + message = wstringToBuf(iStringPairs[L"error-details"]); + if (!message) + { + ELOG(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.wstringToBuf 2 returned NULL "); + } + else + { + TRAP(err, mResults.AddStringL(KSifOutParam_ErrMessageDetails, *message)); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::setCommonErrorInfo mResults.AddStringL ErrMessageDetails " + "err %d", err); + } + delete message; + } +} + + +/** + * Overwrite (reset) the default error values to 'no error'. + * The default error values were originally set for the case + * where no InstallerResultMessage is never received and we must + * return sensible error information. + */ +void ResultsServer::resetDefaultErrorValues() +{ + TRAPD(err, mResults.AddIntL(KSifOutParam_ErrCategory, 0)); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::resetDefaultErrorValues mResults.AddIntL ErrCategory err %d", err); + } + + TRAP(err, mResults.AddIntL(KSifOutParam_ErrCode, 0)); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "ResultsServer::resetDefaultErrorValues mResults.AddIntL ErrCode err %d", err); + } + + // TODO: reset also localized error message KSifOutParam_ErrMessage and + // perhaps also KSifOutParam_ErrMessageDetails if they have been set in start() +} + + void ResultsServer::clearData() { iIntPairs.clear(); @@ -300,7 +359,7 @@ ss >> midletUidN; //LOG1WSTR(EJavaInstaller, EInfo, - // "ResultsServer::processMessage: checking %s", midletUidN.c_str()); + // "ResultsServer::processMessage: checking %S", midletUidN.c_str()); int uid = iIntPairs[midletUidN]; if (uid == 0) @@ -326,8 +385,8 @@ CleanupStack::Pop(applicationInfo); n++; - } - while (n < 10000); // sanity check: no suite can have 10000 midlets + } // sanity check: no suite can have 10000 midlets + while (n < 10000); // codescanner::magicnumbers CComponentInfo::CNode *rootNode = NULL; rootNode = CComponentInfo::CNode::NewLC( @@ -348,7 +407,7 @@ ); // Store whole component info tree - iInfo.SetRootNodeL(rootNode); + mInfo.SetRootNodeL(rootNode); CleanupStack::Pop(rootNode); CleanupStack::PopAndDestroy(&applications); } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/javasifplugin/tsrc/build/testsifapi.pro --- a/javamanager/javainstaller/javasifplugin/tsrc/build/testsifapi.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/tsrc/build/testsifapi.pro Mon Aug 23 16:38:44 2010 +0100 @@ -23,7 +23,7 @@ symbian { TARGET.UID2 = 0 TARGET.UID3 = 0xE0E5E262 - TARGET.CAPABILITY = WriteDeviceData TrustedUI + TARGET.CAPABILITY = all -tcb -drm LIBS += -lestor -lapparc -lapgrfx -lefsrv -lsif diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp --- a/javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -31,7 +31,16 @@ using namespace Usif; _LIT(KTestMIDlet, "E:\\stopwatch10midp2.jad"); -//_LIT(KTestMIDlet, "C:\\data\\installs\\DS_Snow.jad"); +_LIT(KTestMIDlet2, "E:\\stopwatch11midp2.jar"); +_LIT(KTestMIDlet3, "E:\\Private\\10281e17\\SimpleRMS.jar"); +_LIT(KUserName, "user"); +_LIT(KPassWord, "password"); +_LIT(KEmptyString, ""); +_LIT(KSourceUrl, "\\sourceurl\\foo"); +_LIT(KCharSet, "charset"); +_LIT(KJadMimeType, "text/vnd.sun.j2me.app-descriptor"); +_LIT(KJarMimeType, "application/java-archive"); + /** * Installs a component by file name @@ -64,6 +73,82 @@ CleanupStack::PopAndDestroy(1); } + +/** + * This test case requires that you start Java Installer + * manually before executing this one and keep it running + * this test case ends. + * + * + * Keep the installer running until 1) installation has failed + * 2) uninstallation has failed and 3) getComponentInfo had failed + * because the installer is already running. + */ +static void sifInstallerAlreadyRunningL() +{ + LOG(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: Called"); + + RSoftwareInstall installer; + TInt err = installer.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaConverters, + "testsifapi: sifInstallerAlreadyRunningL: Cannot connect to RSoftwareInstall, err %d", err); + User::Leave(err); + } + CleanupClosePushL(installer); + +/* + LOG(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: Starting the first installer process"); + TRequestStatus status; + installer.Install(KTestMIDlet, status); + + // wait for second + User::After(1000000); +*/ + + LOG(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: Starting the concurrent installation"); + // Try to start concurrent installation, will fail + TRequestStatus status2; + installer.Install(KTestMIDlet2, status2, EFalse); + User::WaitForRequest(status2); + LOG1(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: The return status of concurrent install operation was %d", status2.Int()); + + LOG(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: Starting the concurrent uninstallation"); + // Try to start concurrent uninstallation, will fail + TRequestStatus status3; + installer.Uninstall(15, status3, EFalse); + User::WaitForRequest(status3); + LOG1(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: The return status of concurrent uninstall operation was %d", status3.Int()); + + LOG(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: Starting the concurrent get component info"); + // Try to start concurrent GetComponentInfo, will fail + TRequestStatus status4; + CComponentInfo *info = CComponentInfo::NewL(); + installer.GetComponentInfo(KTestMIDlet, *info, status4); + User::WaitForRequest(status4); + delete info; + LOG1(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: The return status of concurrent GetComponentInfo operation was %d", status4.Int()); + +/* + User::WaitForRequest(status); + + LOG1(EJavaConverters, EInfo, + "testsifapi: sifInstallerAlreadyRunningL: The return status of install operation was %d", status.Int()); +*/ + + // free resources before returning + CleanupStack::PopAndDestroy(1); +} + /** * Installs a component by file handle using opaque arguments/results */ @@ -89,8 +174,9 @@ User::Leave(err); } +// TEMP TEST RFile installFile; - err = installFile.Open(fs, KTestMIDlet, EFileShareReadersOnly | EFileRead); + err = installFile.Open(fs, KTestMIDlet3, EFileShareReadersOnly | EFileRead); if (KErrNone != err) { ELOG1(EJavaConverters, @@ -125,6 +211,32 @@ // Silent installation request arguments->AddIntL(KSifInParam_InstallSilently, 1); + // drive E: + arguments->AddIntL(KSifInParam_Drive, 4); + + // 0 is TSifPolicy::EUserAllowed == Yes + arguments->AddIntL(KSifInParam_PerformOCSP, 0); + arguments->AddIntL(KSifInParam_IgnoreOCSPWarnings, 0); + + arguments->AddIntL(KSifInParam_AllowUpgrade, 0); + arguments->AddIntL(KSifInParam_AllowUntrusted, 0); + arguments->AddIntL(KSifInParam_AllowOverwrite, 0); + arguments->AddIntL(KSifInParam_AllowDownload, 0); + + +// TEMP TEST prevent overflow +// arguments->AddStringL(KSifInParam_UserName, KUserName); +// arguments->AddStringL(KSifInParam_Password, KPassWord); + + arguments->AddStringL(KSifInParam_SourceUrl, KSourceUrl); + + arguments->AddIntL(KSifInParam_IAP, 3); + + arguments->AddStringL(KSifInParam_Charset, KEmptyString); + + arguments->AddStringL(KSifInParam_MimeType, KJadMimeType); + + LOG(EJavaConverters, EInfo, "testsifapi: sifByHandleAndArgsAndResultsInstallL: arguments created"); @@ -155,6 +267,90 @@ return componentId; } +/** + * Installs a component by file handle using other opaque arguments than + * sifByHandleAndArgsAndResultsInstallL() + */ +static TInt secondSifByFileAndArgsAndResultsInstallL() +{ + RSoftwareInstall installer; + TInt err = installer.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaConverters, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: Cannot connect to RSoftwareInstall, err %d", err); + User::Leave(err); + } + CleanupClosePushL(installer); + + LOG(EJavaConverters, EInfo, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: RSoftwareInstall connected"); + + TRequestStatus status; + COpaqueNamedParams *arguments = COpaqueNamedParams::NewL(); + CleanupStack::PushL(arguments); + COpaqueNamedParams *results = COpaqueNamedParams::NewL(); + CleanupStack::PushL(results); + + // Silent installation request + arguments->AddIntL(KSifInParam_InstallSilently, 1); + + // illegal drive number 33 + arguments->AddIntL(KSifInParam_Drive, 33); + + // 1 is No + arguments->AddIntL(KSifInParam_PerformOCSP, 1); + arguments->AddIntL(KSifInParam_IgnoreOCSPWarnings, 1); + + arguments->AddIntL(KSifInParam_AllowUpgrade, 1); + arguments->AddIntL(KSifInParam_AllowUntrusted, 1); + arguments->AddIntL(KSifInParam_AllowOverwrite, 1); + arguments->AddIntL(KSifInParam_AllowDownload, 1); + +// TEMP TEST prevent overflow +// arguments->AddStringL(KSifInParam_UserName, KEmptyString); +// arguments->AddStringL(KSifInParam_Password, KEmptyString); + + arguments->AddStringL(KSifInParam_SourceUrl, KEmptyString); + + arguments->AddIntL(KSifInParam_SNAP, 8); + + arguments->AddStringL(KSifInParam_Charset, KCharSet); + + arguments->AddStringL(KSifInParam_MimeType, KJarMimeType); + + // forcecancel argument value is ignored, forcecancel is set if the value length > 0 + arguments->AddStringL(_L("-forcecancel"), KCharSet); + + LOG(EJavaConverters, EInfo, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: arguments created"); + + installer.Install(KTestMIDlet2, *arguments, *results, status); + + User::WaitForRequest(status); + + LOG1(EJavaConverters, EInfo, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: The return status of install operation was %d", status.Int()); + + + TInt componentId = 0; + TBool idExisted = results->GetIntByNameL(KSifOutParam_ComponentId, componentId); + if ( idExisted ) + { + LOG1(EJavaConverters, EInfo, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: Component id was %d", componentId); + } + else + { + LOG(EJavaConverters, EInfo, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL: No component id was returned"); + } + + // free resources before returning + CleanupStack::PopAndDestroy(3); + + return componentId; +} static void sifUninstallL(TInt &aComponentId) { @@ -296,8 +492,50 @@ logApplicationInfo(*(info->RootNodeL().Applications()[nInd])); } + CleanupStack::PopAndDestroy(info); + + + User::After(1000000); + + // Get component info also from jar + TRequestStatus status2; + CComponentInfo *info2 = CComponentInfo::NewL(); + CleanupStack::PushL(info2); + + installer.GetComponentInfo(KTestMIDlet2, *info2, status2); + + User::WaitForRequest(status2); + + LOG1(EJavaConverters, EInfo, + "testsifapi: sifGetComponentInfoL: The return status of get " + "component info operation 2 was %d", status.Int()); + + LOG(EJavaConverters, EInfo, + "testsifapi: sifGetComponentInfoL: Logging root node (suite2)"); + + logComponentInfoNode(info2->RootNodeL()); + + LOG(EJavaConverters, EInfo, + "testsifapi: sifGetComponentInfoL: Logging child nodes (MIDlets2)"); + + TInt nMIDlets2 = info2->RootNodeL().Children().Count(); + TInt nInd2; + for (nInd2 = 0; nInd2 < nMIDlets2; nInd2++) + { + logComponentInfoNode(*(info2->RootNodeL().Children()[nInd2])); + } + + nMIDlets2 = info2->RootNodeL().Applications().Count(); + for (nInd2 = 0; nInd2 < nMIDlets2; nInd2++) + { + logApplicationInfo(*(info2->RootNodeL().Applications()[nInd2])); + } + + CleanupStack::PopAndDestroy(info2); + + // free resources before returning - CleanupStack::PopAndDestroy(2); + CleanupStack::PopAndDestroy(1); } @@ -350,6 +588,18 @@ 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); @@ -359,9 +609,13 @@ ((RSoftwareInstall *)installer)->CancelOperation(); + LOG(EJavaConverters, EInfo, "testsifapi: cancelFunction: Starting CActiveScheduler"); + CActiveScheduler::Start(); + LOG(EJavaConverters, EInfo, "testsifapi: cancelFunction: CancelOperation() was called"); + delete as; return 0; } @@ -399,6 +653,7 @@ "testsifapi: cancelFromSameThread: CancelOperation() returned"); } + static void cancelInstallL() { LOG(EJavaConverters, EInfo, @@ -438,6 +693,30 @@ } +static void cancelNoOperationL() +{ + LOG(EJavaConverters, EInfo, + "testsifapi: cancelNoOperationL: Called"); + + RSoftwareInstall installer; + TInt err = installer.Connect(); + if (KErrNone != err) + { + ELOG1(EJavaConverters, + "testsifapi: cancelNoOperationL: Cannot connect to RSoftwareInstall, err %d", err); + User::Leave(err); + } + CleanupClosePushL(installer); + + cancelFromSameThread(installer); + + LOG(EJavaConverters, EInfo, + "testsifapi: cancelNoOperationL: cancelFromThread returned"); + + // free resources before returning + CleanupStack::PopAndDestroy(1); + +} /** * Create cleanup stack and run the cleaner code inside TRAP harness @@ -445,35 +724,35 @@ */ TInt E32Main() { -/* - ELOG2(EJavaConverters, - "testsifapi: Starting testing long long long long long long long long long long " - "long long long long long long long long long long long long long long long long " - "long long long long long long long long long long long long long long long long " - "long long long long long long long long long long long long long buffer %d %d", 0, 1); - - LOG(EJavaConverters, EInfo, - "testsifapi: sifByHandleAndArgsAndResultsInstallL: Called"); -*/ - - __UHEAP_MARK; +// __UHEAP_MARK; CTrapCleanup* cleanupStack = CTrapCleanup::New(); TInt err = KErrNone; - /* - TRAP(err, cancelInstallL()); - if (KErrNone != err) - { - ELOG1(EJavaConverters, "testsifapi: cancelInstallL leaved with err %d", err); - } + LOG(EJavaConverters, EInfo, "testsifapi: starting cancelNoOperationL"); + TRAP(err, cancelNoOperationL()); + if (KErrNone != err) + { + ELOG1(EJavaConverters, "testsifapi: cancelNoOperationL leaved with err %d", err); + } - // Wait for a moment - User::After(500000); - */ + // Wait for a moment + User::After(500000); + LOG(EJavaConverters, EInfo, "testsifapi: starting cancelInstallL"); + TRAP(err, cancelInstallL()); + if (KErrNone != err) + { + ELOG1(EJavaConverters, "testsifapi: cancelInstallL leaved with err %d", err); + } + + // Wait for a moment + User::After(500000); + + + LOG(EJavaConverters, EInfo, "testsifapi: starting sifSimplestInstallL"); TRAP(err, sifSimplestInstallL()); if (KErrNone != err) { @@ -484,8 +763,25 @@ User::After(500000); + + // This test case must be executed sepatately, while manually started + // Java Installer is running + LOG(EJavaConverters, EInfo, "testsifapi: starting sifInstallerAlreadyRunningL"); + TRAP(err, sifInstallerAlreadyRunningL()); + if (KErrNone != err) + { + ELOG1(EJavaConverters, "testsifapi: sifInstallerAlreadyRunningL leaved with err %d", err); + } + + // Wait for a moment + User::After(500000); + + TInt componentId = 0; + TInt componentId2 = 0; + + LOG(EJavaConverters, EInfo, "testsifapi: starting sifByHandleAndArgsAndResultsInstallL"); TRAP(err, componentId = sifByHandleAndArgsAndResultsInstallL()); if (KErrNone != err) { @@ -495,7 +791,22 @@ // Wait for a moment User::After(500000); - // TODO: if this fails, it leaks memory + + // This installation will fail because MIDlet is untrusted and installing + // untrusted is denied AND because charset is illegal + LOG(EJavaConverters, EInfo, "testsifapi: starting secondSifByFileAndArgsAndResultsInstallL"); + TRAP(err, componentId2 = secondSifByFileAndArgsAndResultsInstallL()); + if (KErrNone != err) + { + ELOG1(EJavaConverters, + "testsifapi: secondSifByFileAndArgsAndResultsInstallL leaved with err %d", err); + } + // Wait for a moment + User::After(500000); + + + // if this fails, it leaks memory + LOG(EJavaConverters, EInfo, "testsifapi: starting sifGetComponentInfoL"); TRAP(err, sifGetComponentInfoL()); if (KErrNone != err) { @@ -505,6 +816,7 @@ // Wait for a moment User::After(500000); + LOG(EJavaConverters, EInfo, "testsifapi: starting sifActivationTestL"); TRAP(err, sifActivationTestL(componentId)); if (KErrNone != err) { @@ -519,6 +831,7 @@ // TODO: if this fails, it leaks memory if (0 != componentId) { + LOG(EJavaConverters, EInfo, "testsifapi: starting sifUninstallL"); TRAP(err, sifUninstallL(componentId)); if (KErrNone != err) { @@ -530,8 +843,9 @@ User::After(500000); } + delete cleanupStack; // __UHEAP_MARKEND; - __UHEAP_MARKENDC(1); +// __UHEAP_MARKENDC(1); return KErrNone; } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javainstaller/subsystem.mk --- a/javamanager/javainstaller/subsystem.mk Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javainstaller/subsystem.mk Mon Aug 23 16:38:44 2010 +0100 @@ -20,17 +20,19 @@ installerui/build \ installer/build \ -NONQTSUBSYSTEMS = \ - appinstuiplugin/build - -SYMBIAN_ONLY = \ - appinstuiplugin/build +ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK + NONQTSUBSYSTEMS = javasifplugin/build + SYMBIAN_ONLY = javasifplugin/build + COMPONENTS += installcopier/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 -ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK - NONQTSUBSYSTEMS += javasifplugin/build - SYMBIAN_ONLY += javasifplugin/build -endif - LINUX_ONLY = include ${JAVA_SRC_ROOT}/build/Makefile.subsystem diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javalauncher/build/javalauncher_0x2001E262.mmp --- a/javamanager/javalauncher/build/javalauncher_0x2001E262.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javalauncher/build/javalauncher_0x2001E262.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javalauncher.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javalauncher/src.s60/javalauncher.cpp --- a/javamanager/javalauncher/src.s60/javalauncher.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javalauncher/src.s60/javalauncher.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -92,7 +92,7 @@ JavaStorageApplicationList_t foundEntries; - // Get MIDlet-n from APPLICATION_PACKAGE_ATTRIBUTES_TABLE based on + // Get MIDlet-n from APPLICATION_PACKAGE_ATTRIBUTES_TABLE based on // PACKAGE_ID and NAME. attribute.setEntry(ID, aPackageId); findPattern.insert(attribute); @@ -107,7 +107,7 @@ return KErrNotFound; } - // Found the MIDlet-n argument. Now getting the MIDlet name and + // Found the MIDlet-n argument. Now getting the MIDlet name and // main class. Name is the first argument and main class is the last // in the comma separated list. std::wstring value = foundEntries.front().begin()->entryValue(); @@ -549,6 +549,10 @@ err = getUidFromCommandLine(cmdLineBuf, uid); if (KErrNone != err) { + ELOG1WSTR(EJavaCaptain, + "JavaLauncher: process command line was %s", + (wchar_t *)(cmdLineBuf.PtrZ())); + CleanupStack::PopAndDestroy(pBufCmdLine); CleanupStack::PopAndDestroy(commandLine); return err; @@ -672,8 +676,8 @@ LOG(EJavaCaptain, EInfo, "javalauncher: startJavaCaptain javacaptain.exe was started ok"); #endif - // Wait 3 seconds so that Java Captain has time to start - User::After(3000000); + // Wait 3 seconds so that Java Captain has time to start and get read to answer Comms + User::After(3000000); // codescanner::userafter } else { @@ -773,6 +777,8 @@ "javalauncher: OMJ app launch: Exception %s caught", e.what()); } + delete pBufCmdLine; + return err; } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javamanager.pro --- a/javamanager/javamanager.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javamanager.pro Mon Aug 23 16:38:44 2010 +0100 @@ -17,12 +17,13 @@ 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 \"javarecognizer/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javasidchecker/build/bld.inf\"" -BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javarecognizer/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javaappschemeplugin/build/bld.inf\"" BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javarecognizer/build/recjar.mmp --- a/javamanager/javarecognizer/build/recjar.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javarecognizer/build/recjar.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -32,7 +32,11 @@ // Use bytepair compression to enable code paging PAGED +APP_LAYER_SYSTEMINCLUDE + USERINCLUDE ../inc +USERINCLUDE ../../../inc + SOURCEPATH ../src SOURCE recjar.cpp @@ -40,9 +44,6 @@ TARGET recjar.rsc END -SYSTEMINCLUDE ../../../inc -APP_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/ecom LIBRARY euser.lib apmime.lib efsrv.lib diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javarecognizer/src/recjar.cpp --- a/javamanager/javarecognizer/src/recjar.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javarecognizer/src/recjar.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -100,7 +100,7 @@ weOwnFileHandle = ETrue; } - TInt fileRemaining; + TInt fileRemaining = 0; User::LeaveIfError(file->Size(fileRemaining)); if (fileRemaining > aBuffer.Length()) { diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/build/eabi/javaregistryclientu.def --- a/javamanager/javaregistry/build/eabi/javaregistryclientu.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/build/eabi/javaregistryclientu.def Mon Aug 23 16:38:44 2010 +0100 @@ -209,4 +209,12 @@ _ZNK4Java7Manager8Registry34CWriteableJavaRegistryPackageEntry17UsedUserDiskSpaceEv @ 208 NONAME _ZNK4Java7Manager8Registry34CWriteableJavaRegistryPackageEntry14IsPreinstalledEv @ 209 NONAME _ZNK4Java25CJavaRegistryPackageEntry14IsPreinstalledEv @ 210 NONAME + _ZN4Java14CJavaAttributeD0Ev @ 211 NONAME + _ZN4Java14CJavaAttributeD1Ev @ 212 NONAME + _ZN4Java14CJavaAttributeD2Ev @ 213 NONAME + _ZN4Java18CJavaRegistryEntryD0Ev @ 214 NONAME + _ZN4Java18CJavaRegistryEntryD1Ev @ 215 NONAME + _ZN4Java18CJavaRegistryEntryD2Ev @ 216 NONAME + _ZThn4_N4Java14CJavaAttributeD0Ev @ 217 NONAME + _ZThn4_N4Java14CJavaAttributeD1Ev @ 218 NONAME diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/build/javaregistryclient_0x10282476.mmp --- a/javamanager/javaregistry/build/javaregistryclient_0x10282476.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/build/javaregistryclient_0x10282476.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javaregistryclient.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/client/src/javaattribute.cpp --- a/javamanager/javaregistry/client/src/javaattribute.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/client/src/javaattribute.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -92,7 +92,7 @@ // --------------------------------------------------------------------------- // CJavaAttribute::~MJavaAttribute // --------------------------------------------------------------------------- -CJavaAttribute::~CJavaAttribute() +EXPORT_C CJavaAttribute::~CJavaAttribute() { delete iName; delete iValue; diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/client/src/javaregistryentry.cpp --- a/javamanager/javaregistry/client/src/javaregistryentry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/client/src/javaregistryentry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -115,7 +115,7 @@ // CJavaRegistryEntry::~CJavaRegistryEntry // --------------------------------------------------------------------------- // -CJavaRegistryEntry::~CJavaRegistryEntry() +EXPORT_C CJavaRegistryEntry::~CJavaRegistryEntry() { if (iWritableEntry) { diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/client/src/writeablejavaregistry.cpp --- a/javamanager/javaregistry/client/src/writeablejavaregistry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/client/src/writeablejavaregistry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -363,9 +363,17 @@ if (KErrNotFound == err) { + // reset the error flag + err = KErrNone; if (IsPresent((*iter))) { - aUids.Append(uid); + err = aUids.Append(uid); + } + if (err) + { + ELOG1(EJavaStorage, "Failed to add Uid to container. " + "( error code = %d )", err); + } } } @@ -414,7 +422,7 @@ } } } - catch (ExceptionBase) + catch (ExceptionBase& ee) { ELOG1WSTR(EJavaStorage, "MediaId conversion failed: '%s'", value); } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/client/src/writeablejavaregistryentry.cpp --- a/javamanager/javaregistry/client/src/writeablejavaregistryentry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/client/src/writeablejavaregistryentry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -303,19 +303,15 @@ AttributesL(); } - CJavaAttribute* regAttr = NULL; for (TInt i = 0; i < iAttributes.Count(); i++) { if (0 == (iAttributes[i])->Name().Compare(aName)) { - regAttr = CJavaAttribute::NewL((iAttributes[i])->Name(), - (iAttributes[i])->Value(), - (iAttributes[i])->Trusted()); - break; + return iAttributes[i]; } } - return regAttr; + return NULL; } // --------------------------------------------------------------------------- @@ -383,7 +379,7 @@ regAttr = CJavaAttribute::NewL( nameBuf->Des(), valueBuf->Des(), trusted); - iAttributes.Append(regAttr); + iAttributes.AppendL(regAttr); nameBuf.reset(0); valueBuf.reset(0); diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/javasizehelper/client/build/javasizehelperclient_0x2002DCD1.mmp --- a/javamanager/javaregistry/javasizehelper/client/build/javasizehelperclient_0x2002DCD1.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/javasizehelper/client/build/javasizehelperclient_0x2002DCD1.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javasizehelperclient.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/javasizehelper/server/build/javasizehelperserver_0x2002DCD2.mmp --- a/javamanager/javaregistry/javasizehelper/server/build/javasizehelperserver_0x2002DCD2.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/javasizehelper/server/build/javasizehelperserver_0x2002DCD2.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javasizehelperserver.mmp @@ -53,7 +53,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/legacy/server/src/javaregstore.cpp --- a/javamanager/javaregistry/legacy/server/src/javaregstore.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/legacy/server/src/javaregstore.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -543,7 +543,7 @@ { if (IsPresentL((*iter))) { - aUids.Append(uid); + aUids.AppendL(uid); } } } @@ -765,7 +765,7 @@ TInt err = uidToTUid(appUid, converted); if (KErrNone == err) { - uids.Append(converted); + uids.AppendL(converted); } else { diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/legacy/tsrc/build/testlegacyregistry.mmp --- a/javamanager/javaregistry/legacy/tsrc/build/testlegacyregistry.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/build/testlegacyregistry.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -20,9 +20,10 @@ CAPABILITY all -tcb -allfiles -drm #include <../../../../../inc/java_stdcpp_support_for_exe.hrh> -#include +#include -USERINCLUDE /epoc32/include/cpputest +USERINCLUDE /epoc32/include/CppUTest // Due to TestHarness.h et al + USERINCLUDE ../src/utils USERINCLUDE ../../../../../inc // == (JAVA_SRC_ROOT)/inc USERINCLUDE ../../../../../jrt_plat/java_registry_api/inc diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/legacy/tsrc/src/AllTests.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/AllTests.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/AllTests.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -15,8 +15,8 @@ * */ -#include "Platform.h" -#include "CommandLineTestRunner.h" +#include +#include int main(int ac, char** av) { diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include "TestHarness.h" +#include #include "javastorage.h" #include "javastorageexception.h" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistryentry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistryentry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistryentry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include "TestHarness.h" +#include #include "javastorage.h" #include "javastorageexception.h" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/legacy/tsrc/src/testlegacyregistry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testlegacyregistry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testlegacyregistry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include "TestHarness.h" +#include #include "javacommonutils.h" #include "javaoslayer.h" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/legacy/tsrc/src/testmidletentry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testmidletentry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testmidletentry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include "TestHarness.h" +#include #include "javacommonutils.h" #include "javaoslayer.h" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/legacy/tsrc/src/testsuiteentry.cpp --- a/javamanager/javaregistry/legacy/tsrc/src/testsuiteentry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/legacy/tsrc/src/testsuiteentry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -18,7 +18,7 @@ #include #include -#include "TestHarness.h" +#include #include "javacommonutils.h" #include "javaoslayer.h" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/tsrc/build/alltests.mmp --- a/javamanager/javaregistry/tsrc/build/alltests.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/tsrc/build/alltests.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -21,12 +21,12 @@ #include <../../../../inc/java_stdcpp_support_for_exe.hrh> #include - APP_LAYER_SYSTEMINCLUDE -MW_LAYER_SYSTEMINCLUDE + +APP_LAYER_SYSTEMINCLUDE -USERINCLUDE /epoc32/include/cpputest +USERINCLUDE /epoc32/include/CppUTest // Due to TestHarness.h et al + USERINCLUDE ../src/utils - USERINCLUDE ../../../../inc // == (JAVA_SRC_ROOT)/inc // Using main() as entry point diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/tsrc/src/AllTests.cpp --- a/javamanager/javaregistry/tsrc/src/AllTests.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/AllTests.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -15,8 +15,8 @@ * */ -#include "Platform.h" -#include "CommandLineTestRunner.h" +#include +#include int main(int ac, char** av) { diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/tsrc/src/AllTests.h --- a/javamanager/javaregistry/tsrc/src/AllTests.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/AllTests.h Mon Aug 23 16:38:44 2010 +0100 @@ -15,7 +15,7 @@ * */ -#include "Utest.h" +#include //Include this in the test main to execute these tests IMPORT_TEST_GROUP(TestRegistry); diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/tsrc/src/testregistry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -19,7 +19,7 @@ #include #include -#include "TestHarness.h" +#include #include "javastorage.h" #include "javastorageexception.h" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/tsrc/src/testregistryapplicationentry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistryapplicationentry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistryapplicationentry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -19,7 +19,7 @@ #include #include -#include "TestHarness.h" +#include #include "javaregistry.h" #include "javaregistryapplicationentry.h" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/tsrc/src/testregistryentry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistryentry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistryentry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -20,7 +20,7 @@ #include #include -#include "TestHarness.h" +#include #include "javastorage.h" #include "javastorageexception.h" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaregistry/tsrc/src/testregistrypackageentry.cpp --- a/javamanager/javaregistry/tsrc/src/testregistrypackageentry.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javaregistry/tsrc/src/testregistrypackageentry.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -19,7 +19,7 @@ #include #include -#include "TestHarness.h" +#include #include "javaprocessconstants.h" #include "javaregistry.h" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javasettings/appmngrplugin/build/appmngr2midletruntime.mmp --- a/javamanager/javasettings/appmngrplugin/build/appmngr2midletruntime.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/build/appmngr2midletruntime.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -31,8 +31,13 @@ PAGED -USERINCLUDE ../javapackagelookup/inc -USERINCLUDE ../help/inc +APP_LAYER_SYSTEMINCLUDE + +USERINCLUDE ../inc +USERINCLUDE ../../../../inc +USERINCLUDE ../javapackagelookup/inc +USERINCLUDE ../help/inc +USERINCLUDE ../../../javainstaller/iconsizenotifplugin/inc SOURCEPATH ../javapackagelookup/src SOURCE jcfjadjarmatcher.cpp @@ -66,11 +71,6 @@ 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 @@ -101,6 +101,11 @@ LIBRARY ezip.lib // CZipFile LIBRARY charconv.lib // CnvUtfConverter LIBRARY hlplch.lib // Help +LIBRARY apgrfx.lib // RApaLsSession +LIBRARY aknicon.lib // CAknIcon +LIBRARY fbscli.lib // CFbsBitmap +LIBRARY cdlengine.lib // AknLayoutScalable_Avkon +LIBRARY aknlayout2scalable.lib // TAknWindowComponentLayout DEBUGLIBRARY flogger.lib // File logger API diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javasettings/appmngrplugin/inc/appmngr2midletappinfo.h --- a/javamanager/javasettings/appmngrplugin/inc/appmngr2midletappinfo.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/inc/appmngr2midletappinfo.h Mon Aug 23 16:38:44 2010 +0100 @@ -392,6 +392,12 @@ * @since S60 9.1 */ void ReadCertificatesInfoL(); + + /** + * Read the app's icon and store it in iAppBitmap & iAppMask. + * If not found or if error occured, iAppBitmap will remain NULL. + */ + void GetAppIconL(TUid aMidletUid); private: // data diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javasettings/appmngrplugin/inc/appmngr2midletruntime.h --- a/javamanager/javasettings/appmngrplugin/inc/appmngr2midletruntime.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/inc/appmngr2midletruntime.h Mon Aug 23 16:38:44 2010 +0100 @@ -68,6 +68,11 @@ * @since S60 9.1 */ ~CAppMngr2MidletRuntime(); + + /** + * Get the ideal size for Java raster icons in the app mgr list. + */ + inline TSize JavaRasterIconSize() {return iJavaRasterIconSize;}; public: // from CAppMngr2Runtime @@ -172,6 +177,11 @@ * Owned */ CAppMngr2MidletResourceHandler* iResourceHandler; + + /** + * Size of java raster icons in the app mgr list. + */ + TSize iJavaRasterIconSize; }; #endif // APPMNGR2MIDLETRUNTIME_H diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javasettings/appmngrplugin/inc/appmngr2midletsettingsutil.h --- a/javamanager/javasettings/appmngrplugin/inc/appmngr2midletsettingsutil.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/inc/appmngr2midletsettingsutil.h Mon Aug 23 16:38:44 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 = 12; +const int LANDMARK_SETTINGS_DISPLAY_INDEX = 13; const int AUTHENTICATION_SETTINGS_DISPLAY_INDEX = 14; const int SMART_CARD_COMMUNICATION_SETTINGS_DISPLAY_INDEX = 15; const int BROADCAST_SETTINGS_DISPLAY_INDEX = 16; @@ -210,6 +210,7 @@ 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 5bec7efefe18 -r d1278d87b01e javamanager/javasettings/appmngrplugin/src/appmngr2midletappinfo.cpp --- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletappinfo.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletappinfo.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -31,10 +31,12 @@ #include // TAppMngr2DRMUtils #include // CleanupResetAndDestroyPushL -#include // Midlet resource IDs +#include // RApaLsSession + +#include // Midlet resource IDs #include "appmngr2midletappinfo.h" // CAppMngr2MidletAppInfo #include "appmngr2midletruntime.h" // KAppMngr2MidletUid -#include "javaapplicationsettings.hrh" // Midlet command IDs +#include "javaapplicationsettings.hrh" // Midlet command IDs #include "appmngr2midletinfoiterator.h" // CAppMngr2MidletInfoIterator #include "appmngr2midletsettingsview.h" // CAppMngr2MidletSettingsView #include "appmngr2midletsettingshandler.h" // CAppMngr2MidletSettingsHandler @@ -189,8 +191,12 @@ CGulIcon* CAppMngr2MidletAppInfo::SpecificIconL() const { LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::SpecificIconL"); - CGulIcon* icon = CGulIcon::NewL(iAppBitmap, iAppMask); - icon->SetBitmapsOwnedExternally(ETrue); + CGulIcon* icon = NULL; + if (iAppBitmap && iAppMask) + { + icon = CGulIcon::NewL(iAppBitmap, iAppMask); + icon->SetBitmapsOwnedExternally(ETrue); + } return icon; } @@ -243,7 +249,7 @@ void CAppMngr2MidletAppInfo::GetMenuItemsL( RPointerArray& aMenuCmds) { - LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::GetMenuItemsL"); + LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::GetMenuItemsL"); TInt resourceOffset = iResourceHandler.AddResourceFileL(); CEikMenuPaneItem::SData* menuItemData = new(ELeave) CEikMenuPaneItem::SData; CleanupStack::PushL(menuItemData); @@ -468,8 +474,7 @@ // const std::wstring CAppMngr2MidletAppInfo::SecurityDomainCategory() const { - LOG(EJavaAppMngrPlugin, EInfo, " + CAppMngr2MidletAppInfo::MidletSuiteSecurityDomainCategory "); - LOG(EJavaAppMngrPlugin, EInfo, " - CAppMngr2MidletAppInfo::MidletSuiteSecurityDomainCategory "); + LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::MidletSuiteSecurityDomainCategory "); return iSecurityDomainCategory; } @@ -636,21 +641,18 @@ iDataSize = attribute->Value().AllocL(); } // Description - delete attribute; attribute = aEntry->AttributeL(KMIDletDescription()); // no ownership if (attribute) { iDescription = attribute->Value().AllocL(); } // Info URL - delete attribute; attribute = aEntry->AttributeL(KMIDletInfoURL()); // no ownership if (attribute) { iInfoUrl = attribute->Value().AllocL(); } // Update URL - delete attribute; attribute = aEntry->AttributeL(KNokiaUpdate()); // no ownership if (attribute) { @@ -664,7 +666,6 @@ iUpdateUrl = attribute->Value().AllocL(); } } - delete attribute; // Use localized midlet suite name if it exists attribute = aEntry->AttributeL(KNokiaMIDletName()); // no ownership if (attribute) @@ -676,7 +677,6 @@ // Use non-localized name iLocalizedMIDletName = aEntry->Name().AllocL(); } - delete attribute; RArray midletUids; CleanupClosePushL(midletUids); @@ -696,7 +696,6 @@ if (attribute) { contentLength += attribute->Value().Length(); - delete attribute; } else { @@ -737,7 +736,6 @@ ptrContent.Append(KListSeparatorAndSpace); ptrContent.Append(attribute->Value()); } - delete attribute; } else { @@ -774,10 +772,14 @@ // MIDlet suite specific icons if (midletUids.Count() > 0) { - AknsUtils::CreateAppIconLC(AknsUtils::SkinInstance(), midletUids[ 0 ], - EAknsAppIconTypeList, iAppBitmap, iAppMask); - CleanupStack::Pop(2); // iAppBitmap, iAppMask + // Errors ignored so that the midlet is still displayed in the list with default icon. + TRAPD(err, GetAppIconL(midletUids[0])); + if (KErrNone != err) + { + ELOG1(EJavaAppMngrPlugin, "GetAppIconL error %d", err); + } } + CleanupStack::PopAndDestroy(&midletUids); // security domain @@ -795,7 +797,6 @@ iPermissions = attribute->Value().AllocL(); iPermissions->Des().TrimAll(); } - delete attribute; } LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::ConstructL"); @@ -933,7 +934,7 @@ CleanupStack::PopAndDestroy(urlParam); CleanupStack::PopAndDestroy(launcher); - LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::ShowInfoUrlL"); + LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::ShowInfoUrlL"); } // --------------------------------------------------------------------------- @@ -993,3 +994,37 @@ iCertsRead = ETrue; LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::ReadCertificatesInfoL"); } + +void CAppMngr2MidletAppInfo::GetAppIconL(TUid aMidletUid) +{ + LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::GetAppIconL"); + + ASSERT(!iAppBitmap); + ASSERT(!iAppMask); + + RApaLsSession lsSession; + 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(); + iAppMask = new (ELeave) CFbsBitmap(); + User::LeaveIfError(iAppBitmap->Duplicate(apaBmp->Handle())); + User::LeaveIfError(iAppMask->Duplicate(apaBmp->Mask()->Handle())); + } + CleanupStack::PopAndDestroy(apaBmp); + CleanupStack::PopAndDestroy(&lsSession); + + if (!iAppBitmap) + { + AknsUtils::CreateAppIconLC(AknsUtils::SkinInstance(), aMidletUid, + EAknsAppIconTypeList, iAppBitmap, iAppMask); + CleanupStack::Pop(2); // iAppBitmap, iAppMask + } + + LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::GetAppIconL"); +} diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javasettings/appmngrplugin/src/appmngr2midletmanifestreader.cpp --- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletmanifestreader.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletmanifestreader.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -119,7 +119,7 @@ { CJavaAttribute* javaAttribute = CJavaAttribute::NewL(namePtr, valuePtr, EFalse); - aAttributes.Append(javaAttribute); + aAttributes.AppendL(javaAttribute); } CleanupStack::PopAndDestroy(value); diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javasettings/appmngrplugin/src/appmngr2midletruntime.cpp --- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletruntime.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletruntime.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -37,6 +37,7 @@ #include #include "logger.h" // LOG +#include "iconsizeutils.h" // IconSizeUtils::GetIconSizes // MIDlet icon file name _LIT(KAppMngr2MidletIconFileNameMif, "AppMngr2Midlet.mif"); @@ -270,5 +271,8 @@ LOG(EJavaAppMngrPlugin, EInfo, " + CAppMngr2MidletRuntime::ConstructL "); iJavaRegistry = Java::CJavaRegistry::NewL(); iResourceHandler = CAppMngr2MidletResourceHandler::NewL(); + iJavaRasterIconSize = IconSizeUtils::GetIconSizes().iAppMgrIconSize; + ILOG2(EJavaAppMngrPlugin, "Java icon size (%d, %d)", + iJavaRasterIconSize.iWidth, iJavaRasterIconSize.iHeight); LOG(EJavaAppMngrPlugin, EInfo, " - CAppMngr2MidletRuntime::ConstructL "); } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingshandler.cpp --- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingshandler.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingshandler.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -244,9 +244,11 @@ findEntry(queryResult, VALUE, value); - if (value.size() > 0) + if (value.size() > 0 + && ((value == L"no") + || (value == L"navigationkeys") + || (value == L"gameactions"))) { - // default is KValueGameactions if value is not defined predefined = true; } LOG(EJavaAppMngrPlugin, EInfo, " - CAppMngr2MidletSettingsHandler::OnScreenKeypadValuePreDefinedL "); diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingsutil.cpp --- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingsutil.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingsutil.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -488,86 +488,121 @@ { wstring ret = aSettingsName; TRAP_IGNORE( - 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) + HBufC* localizedName = getLocalizedSettingsNameLC(aSettingsName); + if (localizedName != NULL) { - 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); + ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length()); + CleanupStack::PopAndDestroy(localizedName); } - 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) + ); + 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) { - 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); + 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; } if (localizedName != NULL) { @@ -578,71 +613,50 @@ 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) { - 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); + 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); + } + ); return ret; } const wstring AppMngr2MidletSettingsUtil::getLocalizedOnScreenKeypadValue(wstring aOnScreenKeypadValue) { - 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); + 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); + } + ); return ret; } diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javasettings/subsystem.mk --- a/javamanager/javasettings/subsystem.mk Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasettings/subsystem.mk Mon Aug 23 16:38:44 2010 +0100 @@ -17,10 +17,7 @@ include $(JAVA_SRC_ROOT)/build/Makefile.defs -ifdef RD_JAVA_APPLICATION_SETTINGS_QT -COMPONENTS += appsettingsview_qt/build -SYMBIAN_ONLY += appsettingsview_qt/build -else +ifndef RD_JAVA_APPLICATION_SETTINGS_QT ifndef RD_JAVA_S60_RELEASE_5_0_IAD NONQTSUBSYSTEMS += appmngrplugin/build SYMBIAN_ONLY += appmngrplugin/build diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javasidchecker/build/javasidchecker.mmp --- a/javamanager/javasidchecker/build/javasidchecker.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasidchecker/build/javasidchecker.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -39,8 +39,7 @@ // Includes USERINCLUDE . USERINCLUDE ../inc - -SYSTEMINCLUDE ../../../inc /epoc32/include/ecom /epoc32/include/swi +USERINCLUDE ../../../inc // Sources SOURCEPATH ../src diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javasidchecker/src/javasidchecker.cpp --- a/javamanager/javasidchecker/src/javasidchecker.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/javasidchecker/src/javasidchecker.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -21,7 +21,7 @@ #include -#include +#include #include #include "javauids.h" diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaupgradeapp/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javaupgradeapp/build/bld.inf Mon Aug 23 16:38:44 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 +javaupgradeapp_0x2002FF64.mmp diff -r 5bec7efefe18 -r d1278d87b01e javamanager/javaupgradeapp/build/javaupgradeapp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javaupgradeapp/build/javaupgradeapp.pro Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,31 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: 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 5bec7efefe18 -r d1278d87b01e javamanager/javaupgradeapp/build/javaupgradeapp_0x2002FF64.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javaupgradeapp/build/javaupgradeapp_0x2002FF64.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,128 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/javaupgradeapp/sis/java_upgradeapp.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javaupgradeapp/sis/java_upgradeapp.pkg Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,37 @@ +; +; Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: 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 5bec7efefe18 -r d1278d87b01e javamanager/javaupgradeapp/src.s60/javaupgradeapp.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javaupgradeapp/src.s60/javaupgradeapp.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,434 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javamanager/preinstaller/build/javapreinstaller.pro --- a/javamanager/preinstaller/build/javapreinstaller.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/preinstaller/build/javapreinstaller.pro Mon Aug 23 16:38:44 2010 +0100 @@ -27,7 +27,9 @@ -lPlatformEnv \ -ljavacomms \ -lcharconv \ - -ljavastorage + -ljavastorage \ + -lapparc \ + -lapgrfx } include(../../../build/omj.pri) diff -r 5bec7efefe18 -r d1278d87b01e javamanager/preinstaller/build/javapreinstaller_0x2002DCC6.mmp --- a/javamanager/preinstaller/build/javapreinstaller_0x2002DCC6.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/preinstaller/build/javapreinstaller_0x2002DCC6.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javapreinstaller.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../inc @@ -73,6 +72,8 @@ LIBRARY javacomms.lib LIBRARY charconv.lib LIBRARY javastorage.lib +LIBRARY apparc.lib +LIBRARY apgrfx.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib @@ -85,12 +86,10 @@ 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 5bec7efefe18 -r d1278d87b01e javamanager/preinstaller/src.s60/main.cpp --- a/javamanager/preinstaller/src.s60/main.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/preinstaller/src.s60/main.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -119,7 +119,7 @@ // Start active scheduler. Preinstallation starts. LOG(EJavaPreinstaller, EInfo, "startPreinstallationL: Starting CActiveScheduler"); - CActiveScheduler::Start(); + CActiveScheduler::Start(); // codescanner::activestart // Now preinstallation has been done LOG(EJavaPreinstaller, EInfo, "startPreinstallationL: Cleaning up"); diff -r 5bec7efefe18 -r d1278d87b01e javamanager/preinstaller/src.s60/silentmidletinstall.cpp --- a/javamanager/preinstaller/src.s60/silentmidletinstall.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/preinstaller/src.s60/silentmidletinstall.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: OMJ S60 preinstaller process +* Description: OMJ Symbian preinstaller process * */ @@ -26,6 +26,8 @@ #include "silentmidletinstall.h" #include "javacommonutils.h" +#include "javauid.h" +#include "javauids.h" #include "logger.h" #include "javaprocessconstants.h" #include "javasymbianoslayer.h" @@ -51,6 +53,7 @@ _LIT(KMidletName, "MIDlet-Name"); _LIT(KMidletVendor, "MIDlet-Vendor"); _LIT(KMidletVersion, "MIDlet-Version"); +_LIT(KMidletUid, "Nokia-MIDlet-UID-1"); _LIT(KJadExtension, "*.jad"); @@ -96,9 +99,9 @@ */ void CSilentMIDletInstall::ConstructL() { - JELOG2(EJavaPreinstaller); iMIDletName = HBufC::NewL(KMaxBufferSize); iMIDletVendor = HBufC::NewL(KMaxBufferSize); + iMIDletUid = HBufC::NewL(KMaxBufferSize); iPreinstallServer = new(ELeave) PreinstallCommsServer(); iNumberOfAppsToInstall = 0; @@ -111,7 +114,6 @@ */ CSilentMIDletInstall::~CSilentMIDletInstall() { - JELOG2(EJavaPreinstaller); iJadFiles.ResetAndDestroy(); iJadFiles.Close(); @@ -124,6 +126,9 @@ delete iMIDletVendor; iMIDletVendor = NULL; + delete iMIDletUid; + iMIDletUid = NULL; + delete iPreinstallServer; iPreinstallServer = NULL; } @@ -133,7 +138,6 @@ */ void CSilentMIDletInstall::Start() { - JELOG2(EJavaPreinstaller); iState = EFindOutDeviceDrives; // Check if an explicit roll-back of a previous installation is needed @@ -187,8 +191,6 @@ */ void CSilentMIDletInstall::CompleteRequest() { - JELOG2(EJavaPreinstaller); - TRequestStatus *status = &iStatus; User::RequestComplete(status, KErrNone); if (!IsActive()) @@ -241,8 +243,6 @@ */ void CSilentMIDletInstall::RunL() { - JELOG2(EJavaPreinstaller); - switch (iState) { case EFindOutDeviceDrives: @@ -449,7 +449,7 @@ LOG1WSTR(EJavaPreinstaller, EInfo, "CSilentMIDletInstall::GetDirEntriesL Adding file %s", (wchar_t *)(pathPtr.PtrZ())); - aVector.Append(path); + aVector.AppendL(path); CleanupStack::Pop(path); } @@ -580,13 +580,12 @@ /** * Parse MIDlet-Name, MIDlet-Vendor and MIDlet-Version parameters from JAD file. * Parameters are used to determine whether to pre-install MIDlet or not. + * Parse also optional Nokia-MIDlet-UID-1 in case it is needed. * * @param ETrue if parsing succeeds otherwise EFalse. */ TBool CSilentMIDletInstall::ParseJadL(const TDesC& aJadFileName) { - JELOG2(EJavaPreinstaller); - HBufC *jadContent = NULL; // Trap leave thrown if reading jad content fails TRAPD(err, jadContent = GetJadContentL(aJadFileName)); @@ -647,6 +646,23 @@ "CSilentMIDletInstall::ParseJadL MIDlet-Version is %d.%d.%d", iMIDletVersion.iMajor, iMIDletVersion.iMinor, iMIDletVersion.iBuild); + HBufC *midletUid = ParseAttribute(jadContent, KMidletUid); + if (NULL == midletUid) + { + // Ok, all MIDlets do not predefine Symbian Uid + iMIDletUid->Des().Zero(); + } + else + { + // store midlet Uid to member variable and log it + TPtr uidPtr(iMIDletUid->Des()); + uidPtr.Copy(*midletUid); + LOG1WSTR(EJavaPreinstaller, EInfo, + "CSilentMIDletInstall::ParseJadL Nokia-MIDlet-UID-1 %s", + (wchar_t *)(uidPtr.PtrZ())); + delete midletUid; + } + CleanupStack::PopAndDestroy(jadContent); return ETrue; } @@ -727,10 +743,17 @@ // Do not preinstall application if it is found from this table // and the version number of the application is the same or less // than the version number in the table. + // If the application has been removed by javaupgradeupp or it has + // not yet been installed, the application is not in the table at all. + // Do not preinstall the application if there is a native application + // with the same Uid as the predefined Uid of the first Java + // application in the application suite. + TBool apaSessionConnected(EFalse); + RApaLsSession apaSession; JavaStorageEntry attribute; JavaStorageApplicationEntry_t findPattern; - JavaStorageApplicationList_t foundEntries; + JavaStorageApplicationList_t foundEntries; for (TInt i = 0; i < iJadFiles.Count(); i++) { @@ -778,8 +801,8 @@ { // This application must not be preinstalled LOG1WSTR(EJavaPreinstaller, EInfo, - "CheckWhichAppsShouldBeInstalledL: User has removed application %s " - "It must not be preinstalled again.", desToWstring(namePtr)); + "CheckWhichAppsShouldBeInstalledL: User has removed application %s " + "It must not be preinstalled again.", desToWstring(namePtr)); } else { @@ -817,9 +840,34 @@ else { skipInstall = EFalse; + LOG(EJavaPreinstaller, EInfo, "CheckWhichAppsShouldBeInstalledL: Application has not " "been installed previously"); + + // Check whether there is a native application installed + // with the same Uid as the predefined Uid of the first + // Java application in the suite. + + // The string value of attribute Nokia-MIDlet-UID-1 from + // Jad file is in iMIDletUid if it was defined. + TInt err = KErrNone; + if (iMIDletUid->Length() > 0) + { + if (!apaSessionConnected) + { + err = apaSession.Connect(); + apaSessionConnected = ETrue; + } + + // If the presence of a possible native app cannot be + // determined, let Java Installer try to install + // the Java application + if (KErrNone == err) + { + skipInstall = IsNativeAppPresent(apaSession); + } + } } foundEntries.clear(); @@ -830,8 +878,8 @@ skipInstall = ETrue; TPtr16 ptrJadName = iJadFiles[i]->Des(); ELOG1WSTR(EJavaPreinstaller, - "CheckWhichAppsShouldBeInstalledL: Parsing JAD %s failed", - desToWstring(ptrJadName)); + "CheckWhichAppsShouldBeInstalledL: Parsing JAD %s failed", + desToWstring(ptrJadName)); } if (skipInstall) @@ -845,6 +893,11 @@ } } + if (apaSessionConnected) + { + apaSession.Close(); + } + js->close(); } @@ -1165,3 +1218,53 @@ return midletVersion; } // DesToAppVersion + + +/** + * Parses the Uid in iMIDletUid and returns ETrue if there is a native + * application with the same Uid installed into the device. + * Returns EFalse in case of any error. + * + * @param[in] aApaSession open AppArc session + * @return EFalse if no native application with Uid in iMIDletUid + */ +TBool CSilentMIDletInstall::IsNativeAppPresent(const RApaLsSession& aApaSession) +{ + std::wstring uidValue((wchar_t *)(iMIDletUid->Ptr()), iMIDletUid->Length()); + TUid appUid; + Uid javaUid(uidValue); + TInt err = uidToTUid(javaUid, appUid); + + if (KErrNone != err) + { + WLOG1(EJavaPreinstaller, + "CSilentMIDletInstall::IsNativeAppPresent: Cannot convert %S to TUid", + uidValue.c_str()); + return EFalse; + } + + TUid appTypeUid; + err = aApaSession.GetAppType(appTypeUid, appUid); + if (KErrNone != err) + { + if (KErrNotFound == err) + { + // No such application in device + return EFalse; + } + + // Cannot check presence from AppArc + ELOG1(EJavaPreinstaller, + "CSilentMIDletInstall::IsNativeAppPresent: RApaLsSession GetAppType error %d", err); + return EFalse; + } + + if (appTypeUid.iUid != KMidletApplicationTypeUid) + { + // The application is present and it is not a MIDlet + return ETrue; + } + + return EFalse; +} // IsNativeAppPresent + diff -r 5bec7efefe18 -r d1278d87b01e javamanager/preinstaller/src.s60/silentmidletinstall.h --- a/javamanager/preinstaller/src.s60/silentmidletinstall.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/preinstaller/src.s60/silentmidletinstall.h Mon Aug 23 16:38:44 2010 +0100 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: OMJ S60 preinstaller process +* Description: OMJ Symbian preinstaller process * */ @@ -19,6 +19,7 @@ #ifndef SILENTMIDLETINSTALL_H #define SILENTMIDLETINSTALL_H +#include // for RApaLsSession #include #include #include @@ -101,6 +102,9 @@ // Parses the application version string given in aAppVersionString // and returns the corresponding Symbian TAppVersion. TAppVersion DesToAppVersion(const HBufC *aAppVersionString); + // Parses the Uid in iMIDletUid and returns ETrue if there is a native + // application with the same Uid installed into the device + TBool IsNativeAppPresent(const RApaLsSession& aApaSession); private: @@ -123,6 +127,8 @@ HBufC* iMIDletVendor; // Variable used for parsing midlet version from jad file TAppVersion iMIDletVersion; + // Buffer used for parsing Uid of the first midlet from jad file + HBufC* iMIDletUid; // Drive status info for each non-remote, non-substed drive on device TUint iDriveStatuses[KMaxDrives]; diff -r 5bec7efefe18 -r d1278d87b01e javamanager/subsystem.mk --- a/javamanager/subsystem.mk Mon Jul 19 17:58:36 2010 +0100 +++ b/javamanager/subsystem.mk Mon Aug 23 16:38:44 2010 +0100 @@ -21,28 +21,42 @@ javainstaller \ javaregistry \ javabackup \ - javasettings + javasettings COMPONENTS = \ preinstaller/build \ debugapi/build \ - javalauncher/build - + javalauncher/build \ + javaupgradeapp/build + NONQTSUBSYSTEMS = \ - javasidchecker/build \ - javarecognizer/build \ - javaappschemeplugin/build + javarecognizer/build SYMBIAN_ONLY = \ javaregistry \ javalauncher/build \ + javaupgradeapp/build \ javabackup \ - javasidchecker/build \ javarecognizer/build \ preinstaller/build \ - debugapi/build \ - javaappschemeplugin/build + debugapi/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 5bec7efefe18 -r d1278d87b01e javaruntimes/bld.inf --- a/javaruntimes/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -23,5 +23,6 @@ #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 5bec7efefe18 -r d1278d87b01e javaruntimes/installer/starterdll/build/javainstallerstarter_0x2002DCB5.mmp --- a/javaruntimes/installer/starterdll/build/javainstallerstarter_0x2002DCB5.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/installer/starterdll/build/javainstallerstarter_0x2002DCB5.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javainstallerstarter.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/installer/starterdll/src/main.cpp --- a/javaruntimes/installer/starterdll/src/main.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/installer/starterdll/src/main.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -149,6 +149,15 @@ return INSTALLER_ALREADY_RUNNING; } + // Check whether executing this process during first boot. + ret = JavaCommonUtils::initIsFirstBoot(); + if (0 != ret) + { + ELOG1(EJavaRuntime, + "INSTALLER main() Cannot create first_boot_done.dat flag file, errno.h err %d", + ret); + } + int result = -1; try { @@ -212,7 +221,7 @@ #endif // Wait 3 seconds so that Java Captain has time to start - User::After(3000000); + User::After(3000000); // codescanner::userafter } else { @@ -348,6 +357,12 @@ const int oldHeapSize = 512; jvm->overrideOldHeapSize(oldHeapSize); +#ifdef __WINSCW__ + // Setting smaller max heap in the emulator. + const int maxHeapSize = 8 * 1024; // 8 MB + jvm->overrideMaxHeapSize(maxHeapSize); +#endif // __WINSCW__ + jvm->enableThreadDumping(); jvm->setMainClass(INSTALLER_MAIN_CLASS); @@ -369,7 +384,12 @@ jvm->appendSystemProperty( L"-Dcom.nokia.mj.impl.rt.ui=" L"com.nokia.mj.impl.installer.ui.eswt2.InstallerRuntimeUi"); -#else +#ifdef __SYMBIAN32__ +#ifndef __WINS__ + //jvm->appendSystemProperty(L"-Dcom.nokia.mj.impl.installer.ui.disableui=1"); +#endif //__WINS__ +#endif // __SYMBIAN32__ +#else // RD_JAVA_S60_RELEASE_10_1_ONWARDS jvm->appendSystemProperty( L"-Dcom.nokia.mj.impl.installer.ui=" L"com.nokia.mj.impl.installer.ui.eswt.InstallerUiEswt"); diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/installer/starterexe/build/javainstaller_0x2001843A.mmp --- a/javaruntimes/installer/starterexe/build/javainstaller_0x2001843A.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/installer/starterexe/build/javainstaller_0x2001843A.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javainstaller.mmp @@ -54,7 +54,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/javaruntimes.pro --- a/javaruntimes/javaruntimes.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/javaruntimes.pro Mon Aug 23 16:38:44 2010 +0100 @@ -19,6 +19,7 @@ SUBDIRS += installer/starterdll/build/javainstallerstarter.pro SUBDIRS += installer/starterexe/build/javainstaller.pro SUBDIRS += jvmargmodifier/file/build/javajvmargsmodifierfile.pro -SUBDIRS += starter/build/java.pro +SUBDIRS += standalone/build/javastarter.pro +SUBDIRS += starter/build/javamidp.pro SUBDIRS += midp BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/jvmargmodifier/default/build/javajvmargsmodifier_0x2002DCB8.mmp --- a/javaruntimes/jvmargmodifier/default/build/javajvmargsmodifier_0x2002DCB8.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/jvmargmodifier/default/build/javajvmargsmodifier_0x2002DCB8.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javajvmargsmodifier.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile_0x2002DCB9.mmp --- a/javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile_0x2002DCB9.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile_0x2002DCB9.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javajvmargsmodifierfile.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/midp/runtime/build/build.xml --- a/javaruntimes/midp/runtime/build/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/midp/runtime/build/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -33,7 +33,6 @@ - microedition.hostname=localhost microedition.jtwi.version=1.0 microedition.msa.version=1.1-SUBSET microedition.profiles=MIDP-2.1 diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/midp/runtime/build/javamidpruntime.pro --- a/javaruntimes/midp/runtime/build/javamidpruntime.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/midp/runtime/build/javamidpruntime.pro Mon Aug 23 16:38:44 2010 +0100 @@ -23,7 +23,7 @@ symbian { - INCLUDEPATH += /epoc32/include/ecom + INCLUDEPATH += /epoc32/include/ecom # Due to schemehandler.inl in S60 5.0 2009w18 and SPB 10.1 LIBS += -lecom -lflogger -lDrmRightsInfo -lcaf -lDrmHelper -lapgrfx -lapparc -ljavautils } diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/midp/runtime/build/javamidpruntime_0x2002DCBF.mmp --- a/javaruntimes/midp/runtime/build/javamidpruntime_0x2002DCBF.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/midp/runtime/build/javamidpruntime_0x2002DCBF.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javamidpruntime.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e 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 Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/Main.java Mon Aug 23 16:38:44 2010 +0100 @@ -38,12 +38,14 @@ { // Do the start up trace. StartUpTrace.doTrace("Midp runtime ready"); - if (Log.mOn) Log.logI("Starting MIDP runtime"); - - System.out.println("java.version: " + - System.getProperty("java.version")); - System.out.println("java.fullversion: " + - System.getProperty("java.fullversion")); + if (Log.mOn) + { + Log.logI("Starting MIDP runtime"); + Log.logI("java.version: " + + System.getProperty("java.version")); + Log.logI("java.fullversion: " + + System.getProperty("java.fullversion")); + } boolean ok = true; try diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/StorageAccessor.java --- a/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/StorageAccessor.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/StorageAccessor.java Mon Aug 23 16:38:44 2010 +0100 @@ -198,7 +198,6 @@ } catch (NumberFormatException ne) { - Log.logW("Error in getting localized name: " + nameStr, ne); } } } diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java --- a/javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java Mon Aug 23 16:38:44 2010 +0100 @@ -31,6 +31,7 @@ import com.nokia.mj.impl.security.midp.authorization.AccessControllerImpl; import com.nokia.mj.impl.security.utils.SecurityPromptMessage; +import com.nokia.mj.impl.utils.Id; import com.nokia.mj.impl.utils.Logger; /** @@ -282,7 +283,7 @@ } - private boolean showNote(String aAppName,String aConfirmationQueryId) + private boolean showNote(String aAppName, Id aConfirmationQueryId) { SecurityPromptMessage msg = SecurityPromptMessage.getInstance(); String queryTxt = msg.getText(aConfirmationQueryId,null); @@ -322,9 +323,7 @@ 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 5bec7efefe18 -r d1278d87b01e javaruntimes/midp/runtime/src.s60/platformrequesthandler.cpp --- a/javaruntimes/midp/runtime/src.s60/platformrequesthandler.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/midp/runtime/src.s60/platformrequesthandler.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -18,9 +18,7 @@ #include -#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS -#include -#else +#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS #include #endif @@ -68,7 +66,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", @@ -76,8 +74,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. @@ -112,9 +110,71 @@ } 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 5bec7efefe18 -r d1278d87b01e javaruntimes/midp/runtimestarter/build/javamidpstarter_0x2002DCC0.mmp --- a/javaruntimes/midp/runtimestarter/build/javamidpstarter_0x2002DCC0.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/midp/runtimestarter/build/javamidpstarter_0x2002DCC0.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javamidpstarter.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/midp/runtimestarter/src/midpruntimestarter.cpp --- a/javaruntimes/midp/runtimestarter/src/midpruntimestarter.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/midp/runtimestarter/src/midpruntimestarter.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -397,36 +397,36 @@ LOG(EJavaRuntime, EInfo, "Nokia-MIDlet-App-Orientation not defined"); } - // Check if the MIDlet has defined the MIDlet-Splash-Screen-Image + // Check if the MIDlet has defined the Nokia-MIDlet-Splash-Screen-Image // JAD attribute. std::auto_ptr splashScreen (getMidletAttributeFromStorage(*javaStorage.get(), - L"MIDlet-Splash-Screen-Image")); + L"Nokia-MIDlet-Splash-Screen-Image")); if (splashScreen.get() != 0) { std::transform(splashScreen->begin(), splashScreen->end(), splashScreen->begin(), tolower); if (*splashScreen == L"suppress") { - // If MIDlet-Splash-Screen-Image JAD attribute is suppress then + // If Nokia-MIDlet-Splash-Screen-Image JAD attribute is suppress then // we start the UI into background. - LOG(EJavaRuntime, EInfo, "MIDlet-Splash-Screen-Image is suppress"); + LOG(EJavaRuntime, EInfo, "Nokia-MIDlet-Splash-Screen-Image is suppress"); uiParams.setScreenMode(NO_START_SCREEN); uiParams.setBackgroundStart(true); } else { - // If MIDlet-Splash-Screen-Image JAD attribute is not suppress then + // If Nokia-MIDlet-Splash-Screen-Image JAD attribute is not suppress then // we need to solve the root path of the MIDlet and provide that // to the coreUI. uiParams.setScreenMode(MIDLET_DEFINED_SCREEN); - LOG1(EJavaRuntime, EInfo, "MIDlet-Splash-Screen-Image, setPath to %S", + LOG1(EJavaRuntime, EInfo, "Nokia-MIDlet-Splash-Screen-Image, setPath to %S", mMidletInfo->mMIDletRootPath.c_str()); } } else { - LOG(EJavaRuntime, EInfo, "MIDlet-Splash-Screen-Image not defined"); + LOG(EJavaRuntime, EInfo, "Nokia-MIDlet-Splash-Screen-Image not defined"); uiParams.setScreenMode(DEFAULT_START_SCREEN); } diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/standalone/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaruntimes/standalone/build/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,23 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javaruntimes/standalone/build/javastarter_0x2002E6A7.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaruntimes/standalone/build/javastarter_0x2002E6A7.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,136 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javaruntimes/starter/build/bld.inf --- a/javaruntimes/starter/build/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/starter/build/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -19,5 +19,5 @@ default PRJ_MMPFILES -java_0x102033E6.mmp +javamidp_0x102033E6.mmp #include "exports.inf" diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/starter/build/java.pro --- a/javaruntimes/starter/build/java.pro Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -# -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TEMPLATE=app -TARGET=javamidp -CONFIG += omj no_icon stl -CONFIG -= qt - -include(../../../inc/build_defines.pri) - -symbian { - -contains(PROJECT_DEFINES,RD_JAVA_UI_QT) { - TARGET.EPOCSTACKSIZE = 81920 -} - -!contains(PROJECT_DEFINES,RD_JAVA_UI_QT) { - TARGET.EPOCSTACKSIZE = 16384 -} - - TARGET.EPOCHEAPSIZE = 0x00001000 0x02000000 - - TARGET.UID2 = 0x102033E6 - TARGET.UID3 = 0x102033E6 - - TARGET.SID = 0x102033E6 - TARGET.VID = 0x101FB657 - - TARGET.CAPABILITY = \ - LocalServices NetworkServices ProtServ WriteDeviceData \ - ReadDeviceData ReadUserData WriteUserData UserEnvironment \ - SwEvent Location MultiMediaDD NetworkControl TrustedUI -} - -include(../../../build/omj.pri) diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/starter/build/java_0x102033E6.mmp --- a/javaruntimes/starter/build/java_0x102033E6.mmp Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +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.3) 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 -EPOCHEAPSIZE 0x00001000 0x02000000 -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 . - -#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 5bec7efefe18 -r d1278d87b01e javaruntimes/starter/build/javamidp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaruntimes/starter/build/javamidp.pro Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javaruntimes/starter/build/javamidp_0x102033E6.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaruntimes/starter/build/javamidp_0x102033E6.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,140 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javaruntimes/starter/build/javamidp_installer.pkg --- a/javaruntimes/starter/build/javamidp_installer.pkg Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ -; javamidp_installer.pkg generated by qmake at 2010-06-08T10:21:53 -; 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"} - - - -"X:/sf/app/jrt/javaruntimes/starter/build/javamidp.sis" - "c:\adm\javamidp.sis" -@"X:/sf/mw/qt/smartinstaller.sis",(0x2002CCCD) diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/starter/build/javamidp_template.pkg --- a/javaruntimes/starter/build/javamidp_template.pkg Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -; javamidp_template.pkg generated by qmake at 2010-06-08T10:21:53 -; 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 5bec7efefe18 -r d1278d87b01e javaruntimes/starterutils/build/exports.inf --- a/javaruntimes/starterutils/build/exports.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/starterutils/build/exports.inf Mon Aug 23 16:38:44 2010 +0100 @@ -11,7 +11,7 @@ * * Contributors: * -* Description: +* Description: * */ @@ -19,3 +19,7 @@ ../inc/jvmstarter.h |../../../javaruntimes/inc/jvmstarter.h ../inc/runtimestarterutils.h |../../../javaruntimes/inc/runtimestarterutils.h + +#ifdef RD_JAVA_SYMBIAN_TARGET +../src.s60/javaruntimeprivatecrkeys.h |../../../inc/javaruntimeprivatecrkeys.h +#endif \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/starterutils/build/javaruntimestarterutils_0x2002DCCC.mmp --- a/javaruntimes/starterutils/build/javaruntimestarterutils_0x2002DCCC.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/starterutils/build/javaruntimestarterutils_0x2002DCCC.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javaruntimestarterutils.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/starterutils/inc/jvmstarter.h --- a/javaruntimes/starterutils/inc/jvmstarter.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/starterutils/inc/jvmstarter.h Mon Aug 23 16:38:44 2010 +0100 @@ -258,6 +258,13 @@ virtual void overrideNewHeapSize(int heapSize) = 0; /** + * Overrides the default max heap size. + * @param heapSize Heap size in kilo bytes. + * @throws std::exception on error cases + */ + virtual void overrideMaxHeapSize(int heapSize) = 0; + + /** * Overrides the default stack of the native thread. * * @param stackSize Stack size in kilo bytes. diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/starterutils/src.s60/j9starters60.cpp --- a/javaruntimes/starterutils/src.s60/j9starters60.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/starterutils/src.s60/j9starters60.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -129,8 +129,15 @@ mJvmArgs.push_back(L"-Xmine16K"); // Minimum size for heap expansion. mJvmArgs.push_back(L"-Xmns64K"); // Initial new space size. Keep this in sync with MemoryLogger.java mJvmArgs.push_back(L"-Xmos64K"); // Initial old space size. Keep this in sync with MemoryLogger.java + +#ifdef __WINSCW__ mJvmArgs.push_back(L"-Xmox16M"); // Maximum old space size. mJvmArgs.push_back(L"-Xmx16M"); // Memory maximum. +#else // __WINSCW__ + mJvmArgs.push_back(L"-Xmox64M"); // Maximum old space size. + mJvmArgs.push_back(L"-Xmx64M"); // Memory maximum. +#endif // __WINSCW__ + mJvmArgs.push_back(L"-Xmco16k"); // ROM class segment increment. mJvmArgs.push_back(L"-Xmr1k"); // Remembered set size. @@ -165,6 +172,24 @@ mJvmArgs.push_back(oldSpace); } + +void J9StarterS60::overrideMaxHeapSize(int heapSize) +{ + JELOG2(EJavaRuntime); + std::wstring heapAsString(JavaCommonUtils::intToWstring(heapSize)); + doOverideHeap(L"-Xmox", heapAsString); + doOverideHeap(L"-Xmx", heapAsString); +} + +void J9StarterS60::doOverideHeap(const std::wstring& arg, const std::wstring& size) +{ + JELOG2(EJavaRuntime); + std::wstring maxHeapArg(arg); + maxHeapArg += size; + maxHeapArg += L"K"; + mJvmArgs.push_back(maxHeapArg); +} + void J9StarterS60::overrideNewHeapSize(int heapSize) { JELOG2(EJavaRuntime); @@ -205,6 +230,10 @@ { pathType = BOOT_CLASSPATH_TCKRUNNER; } + else if (mIdentifier == L"JavaControlPanel") + { + pathType = BOOT_CLASSPATH_JAVACONTROLPANEL; + } std::list odcFiles; std::list bcpEntities; diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/starterutils/src.s60/j9starters60.h --- a/javaruntimes/starterutils/src.s60/j9starters60.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/starterutils/src.s60/j9starters60.h Mon Aug 23 16:38:44 2010 +0100 @@ -74,6 +74,11 @@ /** * @see jvmstarter.h */ + virtual void overrideMaxHeapSize(int heapSize); + + /** + * @see jvmstarter.h + */ virtual void overrideNativeStackSize(int stackSize); /** @@ -106,6 +111,15 @@ * @param odcFile Th ODC file to be appended. */ void appendOdcFile(const std::wstring& odcFile); + + /** + * Internal utility for setting max heap sizes in kB. Used to + * set -Xmx and -Xmox vm args. + * @param arg String containing either -Xmx or -Xmox (not checked). + * @param size Size of the heap as string in kilo bytes. + */ + void doOverideHeap(const std::wstring& arg, const std::wstring& size); + #ifdef __WINSCW__ // codescanner::ifpreprocessor /** diff -r 5bec7efefe18 -r d1278d87b01e javaruntimes/subsystem.mk --- a/javaruntimes/subsystem.mk Mon Jul 19 17:58:36 2010 +0100 +++ b/javaruntimes/subsystem.mk Mon Aug 23 16:38:44 2010 +0100 @@ -26,7 +26,8 @@ installer/starterexe/build \ jvmargmodifier/default/build \ jvmargmodifier/file/build \ - starterutils/build + starterutils/build \ + standalone/build \ ifdef RD_JAVA_S60_RELEASE_5_0_IAD COMPONENTS += starter/build.iad @@ -37,5 +38,6 @@ 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 5bec7efefe18 -r d1278d87b01e javatools/bld.inf --- a/javatools/bld.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javatools/bld.inf Mon Aug 23 16:38:44 2010 +0100 @@ -20,6 +20,7 @@ #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 5bec7efefe18 -r d1278d87b01e javatools/javacaptain_app/build/bld.inf --- a/javatools/javacaptain_app/build/bld.inf Mon Jul 19 17:58:36 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: -* -*/ - -PRJ_PLATFORMS -default - -PRJ_MMPFILES -javacaptainapp.mmp \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javatools/javacaptain_app/build/javacaptainapp.mmp --- a/javatools/javacaptain_app/build/javacaptainapp.mmp Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +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 -#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 5bec7efefe18 -r d1278d87b01e javatools/javacaptain_app/src.s60/javacap.cpp --- a/javatools/javacaptain_app/src.s60/javacap.cpp Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,685 +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: 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 5bec7efefe18 -r d1278d87b01e javatools/javacaptain_app/src.s60/javacap.h --- a/javatools/javacaptain_app/src.s60/javacap.h Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +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: 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 5bec7efefe18 -r d1278d87b01e javatools/javacaptain_app/src.s60/javacap.hrh --- a/javatools/javacaptain_app/src.s60/javacap.hrh Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +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: -* -*/ - -#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 5bec7efefe18 -r d1278d87b01e javatools/javacaptain_app/src.s60/javacap.rss --- a/javatools/javacaptain_app/src.s60/javacap.rss Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,114 +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: -* -*/ -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 5bec7efefe18 -r d1278d87b01e javatools/javacaptain_app/src.s60/javacap_reg.rss --- a/javatools/javacaptain_app/src.s60/javacap_reg.rss Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -#include - -UID2 KUidAppRegistrationResourceFile -UID3 0x20022D3C - -RESOURCE APP_REGISTRATION_INFO -{ - app_file = "JavaCap"; - embeddability = KAppNotEmbeddable; - newfile=KAppDoesNotSupportNewFile; -} - -// End of File diff -r 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/build/bld.inf Mon Aug 23 16:38:44 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 +javacontrolpanel_0x2002FF62.mmp diff -r 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/build/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/build/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,30 @@ + + + + + + + + + + + diff -r 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/build/bwins/javacontrolpanelu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/build/bwins/javacontrolpanelu.def Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) + diff -r 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/build/eabi/javacontrolpanelu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/build/eabi/javacontrolpanelu.def Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z10jni_lookupPKc @ 1 NONAME + diff -r 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/build/javacontrolpanel.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/build/javacontrolpanel.pro Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,29 @@ +# +# 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/build/javacontrolpanel_0x2002FF62.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/build/javacontrolpanel_0x2002FF62.mmp Mon Aug 23 16:38:44 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 : 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaCaptain.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaCaptain.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,206 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaControlPanel.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaControlPanel.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,87 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaControlPanelUi.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaControlPanelUi.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,434 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/Redirector.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/Redirector.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,58 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/SecurityConfig.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/SecurityConfig.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,79 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/rt/javacontrolpanel/ApplicationInfoImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/rt/javacontrolpanel/ApplicationInfoImpl.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,112 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/rt/javacontrolpanel/ApplicationUtilsImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/rt/javacontrolpanel/ApplicationUtilsImpl.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +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 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() + { + } + + public void checkPermission(Permission aPermission) + throws AccessControlException, NullPointerException + { + checkPermission(null, aPermission); + } + + public void checkPermission(Uid aAppUid, Permission aPermission) + throws AccessControlException, NullPointerException + { + return; + } +} diff -r 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/src.s60/logredirector.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/src.s60/logredirector.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/src.s60/logredirector.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/src.s60/logredirector.h Mon Aug 23 16:38:44 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: +* +*/ + +#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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/src.s60/security.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/src.s60/security.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,220 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/src.s60/security.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/src.s60/security.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/src/javacaptain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/src/javacaptain.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,65 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/src/redirector.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/src/redirector.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/controlpanel/src/securityconfig.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/controlpanel/src/securityconfig.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,87 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/starter/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/starter/build/bld.inf Mon Aug 23 16:38:44 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 +javacontrolpanel_0x2002FF61.mmp diff -r 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/starter/build/javacontrolpanel.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/starter/build/javacontrolpanel.pro Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,39 @@ +# +# 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/starter/build/javacontrolpanel_0x2002FF61.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/starter/build/javacontrolpanel_0x2002FF61.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,137 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/starter/data/javacontrolpanel_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/starter/data/javacontrolpanel_reg.rss Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,31 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: javacontrolpanel_reg.rss +* +*/ + + +#include + +UID2 KUidAppRegistrationResourceFile +UID3 0x2002FF61 + +RESOURCE APP_REGISTRATION_INFO +{ + app_file = "JavaControlPanel"; + embeddability = KAppEmbeddable; + newfile = KAppDoesNotSupportNewFile; +} + +// End of File diff -r 5bec7efefe18 -r d1278d87b01e javatools/javacontrolpanel/starter/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javacontrolpanel/starter/src/main.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,91 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javatools/javasecuritycustomization/build/javasecuritycustomization_0x20028786.mmp --- a/javatools/javasecuritycustomization/build/javasecuritycustomization_0x20028786.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javatools/javasecuritycustomization/build/javasecuritycustomization_0x20028786.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javasecuritycustomization.mmp @@ -53,7 +53,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../inc diff -r 5bec7efefe18 -r d1278d87b01e javatools/javatools.pro --- a/javatools/javatools.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javatools/javatools.pro Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,8 @@ 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 5bec7efefe18 -r d1278d87b01e javatools/subsystem.mk --- a/javatools/subsystem.mk Mon Jul 19 17:58:36 2010 +0100 +++ b/javatools/subsystem.mk Mon Aug 23 16:38:44 2010 +0100 @@ -19,7 +19,9 @@ # Common COMPONENTS = \ tckrunner/starter/build \ - tckrunner/runner/build + tckrunner/runner/build \ + javacontrolpanel/starter/build \ + javacontrolpanel/controlpanel/build \ # Platform specific ifeq ($(BUILDENV),symbian) @@ -43,7 +45,6 @@ endif NONQTSUBSYSTEMS += \ - javacaptain_app/build \ testcerts endif diff -r 5bec7efefe18 -r d1278d87b01e javatools/tckrunner/runner/build/tckrunner_0x2002DCE3.mmp --- a/javatools/tckrunner/runner/build/tckrunner_0x2002DCE3.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javatools/tckrunner/runner/build/tckrunner_0x2002DCE3.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : tckrunner.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../../../../inc diff -r 5bec7efefe18 -r d1278d87b01e javatools/tckrunner/runner/src/tckrunnernative.cpp --- a/javatools/tckrunner/runner/src/tckrunnernative.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javatools/tckrunner/runner/src/tckrunnernative.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -58,12 +58,13 @@ { int rc = 0; - const char* av[MAX_PARAMS + 5]; + const char* av[MAX_PARAMS + 6]; 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 5bec7efefe18 -r d1278d87b01e javatools/tckrunner/starter/build/tckrunner_0x2002121E.mmp --- a/javatools/tckrunner/starter/build/tckrunner_0x2002121E.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javatools/tckrunner/starter/build/tckrunner_0x2002121E.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : tckrunner.mmp @@ -54,7 +54,6 @@ 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 5bec7efefe18 -r d1278d87b01e javatools/tckrunner/starter/src/main.cpp --- a/javatools/tckrunner/starter/src/main.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javatools/tckrunner/starter/src/main.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -92,6 +92,12 @@ // starterUtils->enableDevelopmentFeatures(*jvm.get()); // jvm->enableThreadDumping(); +#ifdef __WINSCW__ + // Setting smaller max heap in the emulator. + const int maxHeapSize = 2 * 1024; // 2 MB + jvm->overrideMaxHeapSize(maxHeapSize); +#endif // __WINSCW__ + jvm->appendSystemProperty(L"-Dcom.nokia.rt.port=tckrunner"); jvm->setMainClass(TCK_RUNNER_MAIN_CLASS); diff -r 5bec7efefe18 -r d1278d87b01e javauis/amms_akn/build/build.xml --- a/javauis/amms_akn/build/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/amms_akn/build/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -27,7 +27,7 @@ file --> - + - + - - - +#include "cmmaplayer.h" +#include "mmmaguiplayer.h" +#include "mmmasnapshot.h" +#include "cmmacamerawindow.h" + +// CONSTANTS +_LIT(KMMACameraPlayer, "CameraPlayer"); + +// CLASS DECLARATION +/** +* This class is used for playing camera. +* +* +*/ + +NONSHARABLE_CLASS(CMMACameraPlayer): public CMMAPlayer, + public MMMAGuiPlayer, + public MMMASnapshot, + public MCameraObserver +{ +public: // Construction + /** + * Creates new CMMACameraPlayer for the camera at certain index. + * Index must be smaller CCamera::CamerasAvailable(). + * @param aCameraIndex Index of the camera. + */ + static CMMACameraPlayer* NewLC(TInt aCameraIndex); + + // Destructor + ~CMMACameraPlayer(); + +protected: + // C++ constructor + CMMACameraPlayer(); + void ConstructL(TInt aCameraIndex); + +private: // new methods + TInt64 CurrentTime(); + void ResolveViewFinderSizeL(TSize& aSize); + void ResolveScreenSizeL(TSize& aSize); + void ResolveCaptureSizes(const CCamera::TFormat aFormat, + const TInt aNumImageSizesSupported, + const TSize& aRequestSize, + TSize& aSourceSize, + TInt& aSourceIndex, + TInt& aLargestIndex); + +public: // from CMMAPlayer + void StartL(TBool aPostEvent); + void StopL(TBool aPostEvent); + void DeallocateL(); + void RealizeL(); + void PrefetchL(); + void GetDuration(TInt64* aDuration); + void SetMediaTimeL(TInt64* aTime); + void GetMediaTime(TInt64* aMediaTime); + void CloseL(); + const TDesC& Type(); +public: // From MCameraObserver + void ReserveComplete(TInt aError); + void PowerOnComplete(TInt aError); + void ViewFinderFrameReady(CFbsBitmap& aFrame); + + void ImageReady(CFbsBitmap* aBitmap, + HBufC8* aData, + TInt aError); + + void FrameBufferReady(MFrameBuffer* aFrameBuffer, + TInt aError); + +public: // From MMMAGuiPlayer + void SetDisplayL(MMMADisplay* aDisplay); + TSize SourceSize(); + void NotifyWithStringEvent(CMMAPlayerEvent::TEventType aEventType, + const TDesC& aStringEventData); + MMMASnapshot* SnapshoterL(); + +public: // From MMMASnapshot + MMMASnapshot::TEncoding TakeSnapshotL(TRequestStatus* aStatus, + const TSize& aSize, + const CMMAImageSettings& aSettings); + CFbsBitmap* SnapshotBitmap(); + HBufC8* SnapshotEncoded(); + +public: // New methods + TInt CameraHandle(); + /** + * Disables or enables viewfinder stopping. + * Needed when using recording. + * + * @param aStopViewFinder If true viewfinder will be really stopped. + */ + void SetViewFinderMode(TBool aStopViewFinder); + +private: // Data + /** + * Window used to render viewfinder. + * Owned. + */ + CMMACameraWindow* iWindow; + + /** + * Camera instance used for taking snapshots and recording. + * iWindow uses this to create duplicated camera instance. + * Owned. + */ + CCamera* iCamera; + MMMADisplay* iDisplay; + + // index to be used for size enumeration + TInt iSourceSizeIndex; + + TInt64 iMediaTime; + TInt64 iStartTime; + + TRequestStatus* iSnapshotStatus; + + // Owned. + CFbsBitmap* iSnapshotBitmap; + HBufC8* iSnapshotEncoded; + + TSize iSize; + TBool iStopViewFinder; + + // inner class for waiting realize, owned + class CRealizeWait : public CActiveSchedulerWait + { + public: + TInt iError; + }; + CRealizeWait* iRealizeWait; +}; + +#endif // CMMACAMERAPLAYER_H diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc.dsa/cmmacameraplayerfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/inc.dsa/cmmacameraplayerfactory.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or 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 is used for creating camera players. +* +*/ + + +#ifndef CMMACAMERAPLAYERFACTORY_H +#define CMMACAMERAPLAYERFACTORY_H + +// INCLUDES +#include +#include "cmmammfplayerfactory.h" +#include "tmmaparametervalidator.h" + +// CLASS DECLARATION +/** +* This class is used for creating camera players. +* +* +*/ + +NONSHARABLE_CLASS(CMMACameraPlayerFactory): public CMMAMMFPlayerFactory +{ +public: // Construction + static CMMACameraPlayerFactory* NewLC(); + ~CMMACameraPlayerFactory(); + +private: + CMMACameraPlayerFactory(); + +public: // From MMMAPlayerFactory + CMMAPlayer* CreatePlayerL(const TDesC& aContentType); + + CMMAPlayer* CreatePlayerL(const TDesC8& aHeaderData); + + CMMAPlayer* CreatePlayerL(const TDesC& aProtocol, + const TDesC& aMiddlePart, + const TDesC& aParameters); + + void GetSupportedProtocolsL(const TDesC& aContentType, + CDesC16Array& aProtocolArray); + +public: // From CMMAMMFPlayerFactory + + CMMAPlayer* CreatePlayerL( + CMMAMMFResolver* aResolver); + + + void MediaIdsL(RArray& aMediaIds); + + void PreparePluginSelectionParametersL( + CMMAMMFResolver* aResolver, + CMMFFormatSelectionParameters* aFormatSelection); + +private: // Data + CMMAAudioSettings* iAudioSettings; // Owned audio settings + TMMAVideoSettings iVideoSettings; // Video settings + TInt iCameraIndex; +}; + +#endif // CMMACAMERAPLAYERFACTORY_H diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc.dsa/cmmasnapshot.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/inc.dsa/cmmasnapshot.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,177 @@ +/* +* Copyright (c) 2002-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 takes snapshot and resizes bitmap if needed. +* +*/ + +#ifndef CMMASNAPSHOT_H +#define CMMASNAPSHOT_H + +// INCLUDES +#include +#include "tmmaparametervalidator.h" +#include "mmmasnapshot.h" + +// FORWARD DECLARATIONS +class MMMAGuiPlayer; +class MMMAEventPoster; +class MMMASnapshotReadyCallback; + + +// CLASS DECLARATION +/** +* This class takes snapshot from MMMAGuiPlayer and resizes bitmap +* if needed. Then bitmap is converted to wanted image format and posted +* to java side. This class is used only from CMMAVideoControl and +* this class is made to separate many asynchronous calls from control and +* resource releasing. +* +* +*/ + +NONSHARABLE_CLASS(CMMASnapshot): public CActive +{ +private: // private state + enum TMMASnapshotState + { + EIdle, + ETakingSnapshot, + EResizing, + EEncoding + }; +public: + /** + * Creates new CMMASnapshot which will be associated to gui player. + * + * @param aGuiPlayer Player used to take snapshot bitmap. + * @param aCallBack Will be informed when completed. + */ + static CMMASnapshot* NewL(MMMAGuiPlayer* aGuiPlayer, + MMMASnapshotReadyCallback& aCallBack); + /** + * Destructor. + */ + virtual ~CMMASnapshot(); + +private: + /** + * Creates required member variables. + */ + void ConstructL(); + + /** + * Contructs new CMMASnapshot. + * + * @param aGuiPlayer Used to take snapshot bitmap. + * @param aCallBack Will be informed when completed. + */ + CMMASnapshot(MMMAGuiPlayer* aGuiPlayer, + MMMASnapshotReadyCallback& aCallBack); + +public: // new methods + /** + * Takes snapshot from player and converts it to according to + * the properties. + * + * @param aProperties Snapshot's properties. + */ + void TakeSnapShotL(const TDesC& aProperties); + + /** + * Caller takes the ownership of the buffer. + * + * @return Image buffer. Ownership is transferred. + */ + HBufC8* ImageBuffer(); + + +private:// New methods + /** + * Resizing image to size of settings + */ + void ResizeL(); + + /** + * Encodes bitmap to wanted mime-type + */ + void EncodeL(); + + /** + * Called when snapshot is ready or error occures. This method will + * inform also the MMMASnapshotReadyCallback interface. + * + * @param aError Error code for the caller class. + */ + void Completed(TInt aError); + +public: // CActive + void RunL(); + TInt RunError(TInt aError); + void DoCancel(); + +private: + /** + * Bitmap encoder, owned + */ + CImageEncoder* iEncoder; + + /** + * Bitmap will be got from gui player and ownership is + * transfers to this class, owned + */ + CFbsBitmap* iBitmap; + + /** + * Bitmap scaler, owned + */ + CBitmapScaler* iScaler; + + /** + * Buffer used for storing encoded data, owned + */ + HBufC8* iBuffer; + + /** + * Bitmap settings, owned + */ + CMMAImageSettings* iSettings; + + /** + * Snapshot encoding + */ + MMMASnapshot::TEncoding iEncoding; + + /** + * GUI player interface, used for taking snapshot, not owned + */ + MMMAGuiPlayer* iGUIPlayer; + + /** + * When snapshot is ready or error occures callback will be informed. + */ + MMMASnapshotReadyCallback& iCallBack; + + /** + * Internal state + */ + TMMASnapshotState iState; +}; + +#endif // CMMASNAPSHOT_H + + + + + + diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc.emc/cmmaemcaudioplayer.h --- a/javauis/mmapi_akn/baseline/inc.emc/cmmaemcaudioplayer.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc.emc/cmmaemcaudioplayer.h Mon Aug 23 16:38:44 2010 +0100 @@ -20,7 +20,7 @@ // INCLUDES #include "cmmaemcplayerbase.h" -#include "mmfbase.h" +#include "mmf/common/mmfbase.h" // CONSTANTS diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc.nga/cmmacameraplayer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/inc.nga/cmmacameraplayer.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,220 @@ +/* +* Copyright (c) 2002-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 is used for playing camera. +* +*/ + + +#ifndef CMMACAMERAPLAYER_H +#define CMMACAMERAPLAYER_H + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include "cmmaplayer.h" +#include "mmmaguiplayer.h" +#include "mmmasnapshot.h" +#include "cmmacamerawindow.h" + +// CONSTANTS +_LIT(KMMACameraPlayer, "CameraPlayer"); + +enum TCamActiveCamera +{ + ECamActiveCameraPrimary, + ECamActiveCameraSecondary, + ECamActiveCameraNone +}; + + +enum TCamImageOrientation +{ + ECamOrientation0, + ECamOrientation90, + ECamOrientation180, + ECamOrientation270, + ECamOrientationIgnore, + ECamOrientationCount +}; + +// CLASS DECLARATION +/** +* This class is used for playing camera. +* +* +*/ + +NONSHARABLE_CLASS(CMMACameraPlayer): public CMMAPlayer, + public MMMAGuiPlayer, + public MMMASnapshot, + public MCameraObserver2, + public MSensrvDataListener +{ +public: // Construction + /** + * Creates new CMMACameraPlayer for the camera at certain index. + * Index must be smaller CCamera::CamerasAvailable(). + * @param aCameraIndex Index of the camera. + */ + static CMMACameraPlayer* NewLC(TCamActiveCamera aCameraIndex); + + // Destructor + ~CMMACameraPlayer(); + +protected: + // C++ constructor + CMMACameraPlayer(TCamActiveCamera aCameraIndex); + void ConstructL(TCamActiveCamera aCameraIndex); + +private: // new methods + TInt64 CurrentTime(); + void ResolveViewFinderSizeL(TSize& aSize); + void ResolveScreenSizeL(TSize& aSize); + void ResolveCaptureSizes(const CCamera::TFormat aFormat, + const TInt aNumImageSizesSupported, + const TSize& aRequestSize, + TSize& aSourceSize, + TInt& aSourceIndex, + TInt& aLargestIndex); + /** + * Registers and start listening to sensor channel. + */ + void UpdateSensorInfoL(); + + /** + * Copies bitmap image from camerabuffer to iSnapshotBitmap + */ + void HandleBitmapCopyL(MCameraBuffer& aCameraBuffer, + CFbsBitmap* aSrcBitmap); + + /** + * Determines amount of image rotation required for the given sensor + * orientation input. + */ + static TCamImageOrientation MapSensorOrientatio2CamOrientation( + const TSensrvOrientationData::TSensrvDeviceOrientation& aSensorOrientation, + TCamImageOrientation aLastImageOrientation, + TCamActiveCamera aActiveCameraIndex); + + /** + * Convert UI orienation setting value of type TCamImageOrientation + * to MCameraOrientation TOrientation value. + */ + static MCameraOrientation::TOrientation + Map2CameraOrientation(const TCamImageOrientation& aSettingOrientation); + +public: // from CMMAPlayer + void StartL(TBool aPostEvent); + void StopL(TBool aPostEvent); + void DeallocateL(); + void RealizeL(); + void PrefetchL(); + void GetDuration(TInt64* aDuration); + void SetMediaTimeL(TInt64* aTime); + void GetMediaTime(TInt64* aMediaTime); + void CloseL(); + const TDesC& Type(); +public: // From MCameraObserver2 + void HandleEvent(const TECAMEvent& aEvent); + void ViewFinderReady(MCameraBuffer& aCameraBuffer,TInt aError); + void ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError); + void VideoBufferReady(MCameraBuffer& aCameraBuffer,TInt aError); + +public: // From MMMAGuiPlayer + void SetDisplayL(MMMADisplay* aDisplay); + TSize SourceSize(); + void NotifyWithStringEvent(CMMAPlayerEvent::TEventType aEventType, + const TDesC& aStringEventData); + MMMASnapshot* SnapshoterL(); + +public: // From MMMASnapshot + MMMASnapshot::TEncoding TakeSnapshotL(TRequestStatus* aStatus, + const TSize& aSize, + const CMMAImageSettings& aSettings); + CFbsBitmap* SnapshotBitmap(); + HBufC8* SnapshotEncoded(); + +private: // From MSensrvDataListener + void DataReceived(CSensrvChannel& aChannel, + TInt aCount, + TInt aDataLost); + void DataError(CSensrvChannel& aChannel, + TSensrvErrorSeverity aError); + void GetDataListenerInterfaceL(TUid aInterfaceUid, + TAny*& aInterface); + +public: // New methods + TInt CameraHandle(); + /** + * Disables or enables viewfinder stopping. + * Needed when using recording. + * + * @param aStopViewFinder If true viewfinder will be really stopped. + */ + void SetViewFinderMode(TBool aStopViewFinder); + +private: // Data + /** + * Window used to render viewfinder. + * Owned. + */ + CMMACameraWindow* iWindow; + + /** + * Camera instance used for taking snapshots and recording. + * iWindow uses this to create duplicated camera instance. + * Owned. + */ + CCamera* iCamera; + MMMADisplay* iDisplay; + + // index to be used for size enumeration + TInt iSourceSizeIndex; + + TInt64 iMediaTime; + TInt64 iStartTime; + + TRequestStatus* iSnapshotStatus; + + // Owned. + CFbsBitmap* iSnapshotBitmap; + HBufC8* iSnapshotEncoded; + + TSize iSize; + TBool iStopViewFinder; + + // inner class for waiting realize, owned + class CRealizeWait : public CActiveSchedulerWait + { + public: + TInt iError; + }; + CRealizeWait* iRealizeWait; + + TCamActiveCamera iActiveCameraIndex; + TCamImageOrientation iImageOrientation; + TCamImageOrientation iLastImageOrientation; + // owned + CSensrvChannel* iAccSensorChannel; + // not owned + MCameraOrientation* iCustomInterfaceOrientation; + // not owned + MCameraUIOrientationOverride* iCustomInterfaceUIOrientationOverride; +}; + +#endif // CMMACAMERAPLAYER_H diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc.nga/cmmacameraplayerfactory.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/inc.nga/cmmacameraplayerfactory.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,74 @@ +/* +* Copyright (c) 2002 Nokia Corporation and/or 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 is used for creating camera players. +* +*/ + + +#ifndef CMMACAMERAPLAYERFACTORY_H +#define CMMACAMERAPLAYERFACTORY_H + +// INCLUDES +#include +#include "cmmammfplayerfactory.h" +#include "tmmaparametervalidator.h" +#include "cmmacameraplayer.h" + +// CLASS DECLARATION +/** +* This class is used for creating camera players. +* +* +*/ + +NONSHARABLE_CLASS(CMMACameraPlayerFactory): public CMMAMMFPlayerFactory +{ +public: // Construction + static CMMACameraPlayerFactory* NewLC(); + ~CMMACameraPlayerFactory(); + +private: + CMMACameraPlayerFactory(); + +public: // From MMMAPlayerFactory + CMMAPlayer* CreatePlayerL(const TDesC& aContentType); + + CMMAPlayer* CreatePlayerL(const TDesC8& aHeaderData); + + CMMAPlayer* CreatePlayerL(const TDesC& aProtocol, + const TDesC& aMiddlePart, + const TDesC& aParameters); + + void GetSupportedProtocolsL(const TDesC& aContentType, + CDesC16Array& aProtocolArray); + +public: // From CMMAMMFPlayerFactory + + CMMAPlayer* CreatePlayerL( + CMMAMMFResolver* aResolver); + + + void MediaIdsL(RArray& aMediaIds); + + void PreparePluginSelectionParametersL( + CMMAMMFResolver* aResolver, + CMMFFormatSelectionParameters* aFormatSelection); + +private: // Data + CMMAAudioSettings* iAudioSettings; // Owned audio settings + TMMAVideoSettings iVideoSettings; // Video settings + TCamActiveCamera iCameraIndex; +}; + +#endif // CMMACAMERAPLAYERFACTORY_H diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc.nga/cmmacamerawindow.h --- a/javauis/mmapi_akn/baseline/inc.nga/cmmacamerawindow.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc.nga/cmmacamerawindow.h Mon Aug 23 16:38:44 2010 +0100 @@ -49,7 +49,7 @@ NONSHARABLE_CLASS(CMMACameraWindow): public CBase, public MMMADisplayWindow, - public MCameraObserver, + public MCameraObserver2, public MUiEventConsumer, public MDirectScreenAccess { @@ -125,17 +125,11 @@ void ContainerDestroyed(); -// from base class MCameraObserver - void ReserveComplete(TInt aError); - void PowerOnComplete(TInt aError); - void ViewFinderFrameReady(CFbsBitmap& aFrame); - - void ImageReady(CFbsBitmap* aBitmap, - HBufC8* aData, - TInt aError); - - void FrameBufferReady(MFrameBuffer* aFrameBuffer, - TInt aError); +// from base class MCameraObserver2 + void HandleEvent(const TECAMEvent& aEvent); + void ViewFinderReady(MCameraBuffer& aCameraBuffer,TInt aError); + void ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError); + void VideoBufferReady(MCameraBuffer& aCameraBuffer,TInt aError); // from base class MUiEventConsumer diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc.nga/cmmasnapshot.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/inc.nga/cmmasnapshot.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,182 @@ +/* +* Copyright (c) 2002-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 takes snapshot and resizes bitmap if needed. +* +*/ + +#ifndef CMMASNAPSHOT_H +#define CMMASNAPSHOT_H + +// INCLUDES +#include +#include "tmmaparametervalidator.h" +#include "mmmasnapshot.h" + +// FORWARD DECLARATIONS +class MMMAGuiPlayer; +class MMMAEventPoster; +class MMMASnapshotReadyCallback; + + +// CLASS DECLARATION +/** +* This class takes snapshot from MMMAGuiPlayer and resizes bitmap +* if needed. Then bitmap is converted to wanted image format and posted +* to java side. This class is used only from CMMAVideoControl and +* this class is made to separate many asynchronous calls from control and +* resource releasing. +* +* +*/ + +NONSHARABLE_CLASS(CMMASnapshot): public CActive +{ +private: // private state + enum TMMASnapshotState + { + EIdle, + ETakingSnapshot, + EResizing, + EEncoding + }; +public: + /** + * Creates new CMMASnapshot which will be associated to gui player. + * + * @param aGuiPlayer Player used to take snapshot bitmap. + * @param aCallBack Will be informed when completed. + */ + static CMMASnapshot* NewL(MMMAGuiPlayer* aGuiPlayer, + MMMASnapshotReadyCallback& aCallBack); + /** + * Destructor. + */ + virtual ~CMMASnapshot(); + +private: + /** + * Creates required member variables. + */ + void ConstructL(); + + /** + * Contructs new CMMASnapshot. + * + * @param aGuiPlayer Used to take snapshot bitmap. + * @param aCallBack Will be informed when completed. + */ + CMMASnapshot(MMMAGuiPlayer* aGuiPlayer, + MMMASnapshotReadyCallback& aCallBack); + +public: // new methods + /** + * Takes snapshot from player and converts it to according to + * the properties. + * + * @param aProperties Snapshot's properties. + */ + void TakeSnapShotL(const TDesC& aProperties); + + /** + * Caller takes the ownership of the buffer. + * + * @return Image buffer. Ownership is transferred. + */ + HBufC8* ImageBuffer(); + + +private:// New methods + /** + * Resizing image to size of settings + */ + void ResizeL(); + + /** + * Encodes bitmap to wanted mime-type + */ + void EncodeL(); + + /** + * Called when snapshot is ready or error occures. This method will + * inform also the MMMASnapshotReadyCallback interface. + * + * @param aError Error code for the caller class. + */ + void Completed(TInt aError); + +public: // CActive + void RunL(); + TInt RunError(TInt aError); + void DoCancel(); + +private: + /** + * Bitmap encoder, owned + */ + CImageEncoder* iEncoder; + + /** + * Bitmap will be got from gui player and ownership is + * transfers to this class, owned + */ + CFbsBitmap* iBitmap; + + /** + * Bitmap scaler, owned + */ + CBitmapScaler* iScaler; + + /** + * Buffer used for storing encoded data, owned + */ + HBufC8* iBuffer; + + /** + * Bitmap settings, owned + */ + CMMAImageSettings* iSettings; + + /** + * Snapshot encoding + */ + MMMASnapshot::TEncoding iEncoding; + + /** + * GUI player interface, used for taking snapshot, not owned + */ + MMMAGuiPlayer* iGUIPlayer; + + /** + * When snapshot is ready or error occures callback will be informed. + */ + MMMASnapshotReadyCallback& iCallBack; + + /** + * Internal state + */ + TMMASnapshotState iState; + + /** + *Internal State for maintaining the Aspect Ratio. + */ + TBool iScalingFactor; +}; + +#endif // CMMASNAPSHOT_H + + + + + + diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc.nga/cmmasurfacewindow.h --- a/javauis/mmapi_akn/baseline/inc.nga/cmmasurfacewindow.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc.nga/cmmasurfacewindow.h Mon Aug 23 16:38:44 2010 +0100 @@ -202,7 +202,7 @@ * * @param aStatus true indicates cable connected else false */ - void SetAVCableConnStatus(TBool aStatus); + IMPORT_C void SetAVCableConnStatus(TBool aStatus); private: // New methods /** diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc.nga/cmmavideoplayer.h --- a/javauis/mmapi_akn/baseline/inc.nga/cmmavideoplayer.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc.nga/cmmavideoplayer.h Mon Aug 23 16:38:44 2010 +0100 @@ -135,6 +135,7 @@ */ CAccMonitor *iAccMonitor; RAccMonCapabilityArray iAccMonCapabilityArray; + TBool isHDMICableConnected; }; #endif // CMMAVIDEOPLAYER_H diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/cmmaaudiometadatacontrol.h --- a/javauis/mmapi_akn/baseline/inc/cmmaaudiometadatacontrol.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc/cmmaaudiometadatacontrol.h Mon Aug 23 16:38:44 2010 +0100 @@ -21,7 +21,7 @@ #define CMMAAUDIOMETADATACONTROL_H // INCLUDES -#include +#include #include "cmmametadatacontrol.h" diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/cmmacallstatemonitor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/inc/cmmacallstatemonitor.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,108 @@ +/* +* 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: Publish and Subscribe key watcher +* +*/ + + +#ifndef CMMACALLSTATEMONITOR_H +#define CMMACALLSTATEMONITOR_H + +#include + +class MMMACallStateObserver; + +/** + * Publish and subscribe key watcher. + * + * @lib + */ +class CMMACallStateMonitor : public CActive + { +public: + + /* + * Two Phased Constructor. + * + * @since + * @param aUid PubSub UID to watch + * @param aKey specific key to watch + * @return Construced object + */ + static CMMACallStateMonitor* NewL( TUid aUid, TInt aKey, + MMMACallStateObserver* aObserver ); + + /* + * virtual destructor. + * + * @since + */ + virtual ~CMMACallStateMonitor(); + +public: // New Functions + + /* + * Return the value of the key. + * + * @since + * @param aValue + * @return KErrNone, if successful otherwise system error + */ + TInt GetValue( TInt& aValue ); + +protected: // From Base class + + /* + * From CActive. + * + * @since + */ + void RunL(); + + /* + * From CActive. + * + * @since + */ + void DoCancel(); + +private: + + /* + * Default Constructor. + * + * @since + * @param aUid PubSub key to watch + * @param aKey specific key to watch + */ + CMMACallStateMonitor( TUid aUid, + TInt aKey, + MMMACallStateObserver* aObserver ); + + /* + * Second phased constructor. + * + * @since + */ + void ConstructL(); + +private: // data + + RProperty iProperty; + MMMACallStateObserver* iObserver; // not owned + TUid iUid; // Uid that we are watching + TInt iKey; // Key that we are watching + }; + +#endif // C_MMAPSKEYWATCHER_H \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/cmmacameraplayer.h --- a/javauis/mmapi_akn/baseline/inc/cmmacameraplayer.h Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,157 +0,0 @@ -/* -* Copyright (c) 2002-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 is used for playing camera. -* -*/ - - -#ifndef CMMACAMERAPLAYER_H -#define CMMACAMERAPLAYER_H - -// INCLUDES -#include -#include "cmmaplayer.h" -#include "mmmaguiplayer.h" -#include "mmmasnapshot.h" -#include "cmmacamerawindow.h" - -// CONSTANTS -_LIT(KMMACameraPlayer, "CameraPlayer"); - -// CLASS DECLARATION -/** -* This class is used for playing camera. -* -* -*/ - -NONSHARABLE_CLASS(CMMACameraPlayer): public CMMAPlayer, - public MMMAGuiPlayer, - public MMMASnapshot, - public MCameraObserver -{ -public: // Construction - /** - * Creates new CMMACameraPlayer for the camera at certain index. - * Index must be smaller CCamera::CamerasAvailable(). - * @param aCameraIndex Index of the camera. - */ - static CMMACameraPlayer* NewLC(TInt aCameraIndex); - - // Destructor - ~CMMACameraPlayer(); - -protected: - // C++ constructor - CMMACameraPlayer(); - void ConstructL(TInt aCameraIndex); - -private: // new methods - TInt64 CurrentTime(); - void ResolveViewFinderSizeL(TSize& aSize); - void ResolveScreenSizeL(TSize& aSize); - void ResolveCaptureSizes(const CCamera::TFormat aFormat, - const TInt aNumImageSizesSupported, - const TSize& aRequestSize, - TSize& aSourceSize, - TInt& aSourceIndex, - TInt& aLargestIndex); - -public: // from CMMAPlayer - void StartL(TBool aPostEvent); - void StopL(TBool aPostEvent); - void DeallocateL(); - void RealizeL(); - void PrefetchL(); - void GetDuration(TInt64* aDuration); - void SetMediaTimeL(TInt64* aTime); - void GetMediaTime(TInt64* aMediaTime); - void CloseL(); - const TDesC& Type(); -public: // From MCameraObserver - void ReserveComplete(TInt aError); - void PowerOnComplete(TInt aError); - void ViewFinderFrameReady(CFbsBitmap& aFrame); - - void ImageReady(CFbsBitmap* aBitmap, - HBufC8* aData, - TInt aError); - - void FrameBufferReady(MFrameBuffer* aFrameBuffer, - TInt aError); - -public: // From MMMAGuiPlayer - void SetDisplayL(MMMADisplay* aDisplay); - TSize SourceSize(); - void NotifyWithStringEvent(CMMAPlayerEvent::TEventType aEventType, - const TDesC& aStringEventData); - MMMASnapshot* SnapshoterL(); - -public: // From MMMASnapshot - MMMASnapshot::TEncoding TakeSnapshotL(TRequestStatus* aStatus, - const TSize& aSize, - const CMMAImageSettings& aSettings); - CFbsBitmap* SnapshotBitmap(); - HBufC8* SnapshotEncoded(); - -public: // New methods - TInt CameraHandle(); - /** - * Disables or enables viewfinder stopping. - * Needed when using recording. - * - * @param aStopViewFinder If true viewfinder will be really stopped. - */ - void SetViewFinderMode(TBool aStopViewFinder); - -private: // Data - /** - * Window used to render viewfinder. - * Owned. - */ - CMMACameraWindow* iWindow; - - /** - * Camera instance used for taking snapshots and recording. - * iWindow uses this to create duplicated camera instance. - * Owned. - */ - CCamera* iCamera; - MMMADisplay* iDisplay; - - // index to be used for size enumeration - TInt iSourceSizeIndex; - - TInt64 iMediaTime; - TInt64 iStartTime; - - TRequestStatus* iSnapshotStatus; - - // Owned. - CFbsBitmap* iSnapshotBitmap; - HBufC8* iSnapshotEncoded; - - TSize iSize; - TBool iStopViewFinder; - - // inner class for waiting realize, owned - class CRealizeWait : public CActiveSchedulerWait - { - public: - TInt iError; - }; - CRealizeWait* iRealizeWait; -}; - -#endif // CMMACAMERAPLAYER_H diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/cmmacameraplayerfactory.h --- a/javauis/mmapi_akn/baseline/inc/cmmacameraplayerfactory.h Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or 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 is used for creating camera players. -* -*/ - - -#ifndef CMMACAMERAPLAYERFACTORY_H -#define CMMACAMERAPLAYERFACTORY_H - -// INCLUDES -#include -#include "cmmammfplayerfactory.h" -#include "tmmaparametervalidator.h" - -// CLASS DECLARATION -/** -* This class is used for creating camera players. -* -* -*/ - -NONSHARABLE_CLASS(CMMACameraPlayerFactory): public CMMAMMFPlayerFactory -{ -public: // Construction - static CMMACameraPlayerFactory* NewLC(); - ~CMMACameraPlayerFactory(); - -private: - CMMACameraPlayerFactory(); - -public: // From MMMAPlayerFactory - CMMAPlayer* CreatePlayerL(const TDesC& aContentType); - - CMMAPlayer* CreatePlayerL(const TDesC8& aHeaderData); - - CMMAPlayer* CreatePlayerL(const TDesC& aProtocol, - const TDesC& aMiddlePart, - const TDesC& aParameters); - - void GetSupportedProtocolsL(const TDesC& aContentType, - CDesC16Array& aProtocolArray); - -public: // From CMMAMMFPlayerFactory - - CMMAPlayer* CreatePlayerL( - CMMAMMFResolver* aResolver); - - - void MediaIdsL(RArray& aMediaIds); - - void PreparePluginSelectionParametersL( - CMMAMMFResolver* aResolver, - CMMFFormatSelectionParameters* aFormatSelection); - -private: // Data - CMMAAudioSettings* iAudioSettings; // Owned audio settings - TMMAVideoSettings iVideoSettings; // Video settings - TInt iCameraIndex; -}; - -#endif // CMMACAMERAPLAYERFACTORY_H diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/cmmadisplay.h --- a/javauis/mmapi_akn/baseline/inc/cmmadisplay.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc/cmmadisplay.h Mon Aug 23 16:38:44 2010 +0100 @@ -59,6 +59,7 @@ TBool IsVisible(); TBool IsFullScreen(); virtual void SetForeground(TBool aIsForeground, TBool UseEventServer); + virtual void FixUIOrientation(TBool aFix); /** * Gets notification that there is container to draw assigned @@ -90,6 +91,7 @@ virtual void UIGetCallback( MUiEventConsumer& aConsumer, TInt aCallbackId); + public: // Methods derived from MDirectContent /** * Used to obtain RWindow rect diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/cmmaframepositioningcontrol.h --- a/javauis/mmapi_akn/baseline/inc/cmmaframepositioningcontrol.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc/cmmaframepositioningcontrol.h Mon Aug 23 16:38:44 2010 +0100 @@ -20,8 +20,8 @@ #define CMMAFRAMEPOSITIONINGCONTROL_H // EXTERNAL INCLUDES -#include "mmfcontroller.h" -#include "mmfstandardcustomcommands.h" +#include "mmf/common/mmfcontroller.h" +#include "mmf/common/mmfstandardcustomcommands.h" // INTERNAL INCLUDES #include "cmmacontrol.h" // base class diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/cmmamidimetadatacontrol.h --- a/javauis/mmapi_akn/baseline/inc/cmmamidimetadatacontrol.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc/cmmamidimetadatacontrol.h Mon Aug 23 16:38:44 2010 +0100 @@ -21,7 +21,7 @@ #define CMMAMIDIMETADATACONTROL_H // INCLUDES -#include +#include #include "cmmamidiplayer.h" #include "cmmametadatacontrol.h" diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/cmmaplayer.h --- a/javauis/mmapi_akn/baseline/inc/cmmaplayer.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc/cmmaplayer.h Mon Aug 23 16:38:44 2010 +0100 @@ -25,9 +25,11 @@ #include "cmmaplayerevent.h" #include "mmmasourcestreamlistener.h" #include "mmmaplayerstatelistener.h" +#include "mmmacallstateobserver.h" // FORWARD DECLARATIONS class CMMADurationUpdater; +class CMMACallStateMonitor; // CONTANTS @@ -52,7 +54,7 @@ */ class CMMAPlayer : public CBase, - public MMMASourceStreamListener + public MMMASourceStreamListener, MMMACallStateObserver { public: @@ -174,7 +176,7 @@ * Close the Player and release its resources. After this player is in * EClosed state and cannot be used anymore. */ - virtual void CloseL(); + IMPORT_C virtual void CloseL(); /** * Gets duration. @@ -216,6 +218,10 @@ */ HBufC* ContentType() const; +public: // from MMMACallStateObserver + + void HandleCallStateEventL(TUid aUid, TInt aKey); + public: // new methods /** * Sets Java listener object that will be used to post player events @@ -451,6 +457,16 @@ */ CMMADurationUpdater* iDurationUpdater; + /** + * Used to get the callback for Call State Events. + */ + CMMACallStateMonitor* iStateObserver; + + /** + * Used to determine if the Player is in Paused state + * due to call or done by user. + */ + TBool isPausedByCall; }; diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/cmmasnapshot.h --- a/javauis/mmapi_akn/baseline/inc/cmmasnapshot.h Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,177 +0,0 @@ -/* -* Copyright (c) 2002-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 takes snapshot and resizes bitmap if needed. -* -*/ - -#ifndef CMMASNAPSHOT_H -#define CMMASNAPSHOT_H - -// INCLUDES -#include -#include "tmmaparametervalidator.h" -#include "mmmasnapshot.h" - -// FORWARD DECLARATIONS -class MMMAGuiPlayer; -class MMMAEventPoster; -class MMMASnapshotReadyCallback; - - -// CLASS DECLARATION -/** -* This class takes snapshot from MMMAGuiPlayer and resizes bitmap -* if needed. Then bitmap is converted to wanted image format and posted -* to java side. This class is used only from CMMAVideoControl and -* this class is made to separate many asynchronous calls from control and -* resource releasing. -* -* -*/ - -NONSHARABLE_CLASS(CMMASnapshot): public CActive -{ -private: // private state - enum TMMASnapshotState - { - EIdle, - ETakingSnapshot, - EResizing, - EEncoding - }; -public: - /** - * Creates new CMMASnapshot which will be associated to gui player. - * - * @param aGuiPlayer Player used to take snapshot bitmap. - * @param aCallBack Will be informed when completed. - */ - static CMMASnapshot* NewL(MMMAGuiPlayer* aGuiPlayer, - MMMASnapshotReadyCallback& aCallBack); - /** - * Destructor. - */ - virtual ~CMMASnapshot(); - -private: - /** - * Creates required member variables. - */ - void ConstructL(); - - /** - * Contructs new CMMASnapshot. - * - * @param aGuiPlayer Used to take snapshot bitmap. - * @param aCallBack Will be informed when completed. - */ - CMMASnapshot(MMMAGuiPlayer* aGuiPlayer, - MMMASnapshotReadyCallback& aCallBack); - -public: // new methods - /** - * Takes snapshot from player and converts it to according to - * the properties. - * - * @param aProperties Snapshot's properties. - */ - void TakeSnapShotL(const TDesC& aProperties); - - /** - * Caller takes the ownership of the buffer. - * - * @return Image buffer. Ownership is transferred. - */ - HBufC8* ImageBuffer(); - - -private:// New methods - /** - * Resizing image to size of settings - */ - void ResizeL(); - - /** - * Encodes bitmap to wanted mime-type - */ - void EncodeL(); - - /** - * Called when snapshot is ready or error occures. This method will - * inform also the MMMASnapshotReadyCallback interface. - * - * @param aError Error code for the caller class. - */ - void Completed(TInt aError); - -public: // CActive - void RunL(); - TInt RunError(TInt aError); - void DoCancel(); - -private: - /** - * Bitmap encoder, owned - */ - CImageEncoder* iEncoder; - - /** - * Bitmap will be got from gui player and ownership is - * transfers to this class, owned - */ - CFbsBitmap* iBitmap; - - /** - * Bitmap scaler, owned - */ - CBitmapScaler* iScaler; - - /** - * Buffer used for storing encoded data, owned - */ - HBufC8* iBuffer; - - /** - * Bitmap settings, owned - */ - CMMAImageSettings* iSettings; - - /** - * Snapshot encoding - */ - MMMASnapshot::TEncoding iEncoding; - - /** - * GUI player interface, used for taking snapshot, not owned - */ - MMMAGuiPlayer* iGUIPlayer; - - /** - * When snapshot is ready or error occures callback will be informed. - */ - MMMASnapshotReadyCallback& iCallBack; - - /** - * Internal state - */ - TMMASnapshotState iState; -}; - -#endif // CMMASNAPSHOT_H - - - - - - diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/cmmavideourlplayer.h --- a/javauis/mmapi_akn/baseline/inc/cmmavideourlplayer.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc/cmmavideourlplayer.h Mon Aug 23 16:38:44 2010 +0100 @@ -28,6 +28,9 @@ // FORWARD DECLARATIONS class CMMAEventSource; +//Can not open audio device or lost control of audio device +const TInt KErrMMAudioDevice = -12014; + // CLASS DECLARATION /** * This class is used for playing video. diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/cmmavolumecontrol.h --- a/javauis/mmapi_akn/baseline/inc/cmmavolumecontrol.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc/cmmavolumecontrol.h Mon Aug 23 16:38:44 2010 +0100 @@ -22,7 +22,7 @@ // INCLUDES #include "cmmacontrol.h" #include "mmmaplayerstatelistener.h" -#include +#include // CONSTANS _LIT(KMMAVolumeControlName, "VolumeControl"); @@ -47,11 +47,11 @@ static void StaticGetLevelL(CMMAVolumeControl* aVolumeControl, TInt* aLevel); - ~CMMAVolumeControl(); + IMPORT_C ~CMMAVolumeControl(); protected: - CMMAVolumeControl(CMMAPlayer* aPlayer); - void ConstructBaseL(); + IMPORT_C CMMAVolumeControl(CMMAPlayer* aPlayer); + IMPORT_C void ConstructBaseL(); /** * Sets the level to player. @@ -66,18 +66,18 @@ virtual TInt DoGetLevelL() = 0; public: // From CMMAControl - const TDesC& ClassName() const; + IMPORT_C const TDesC& ClassName() const; /** * Refresh volume control. */ - void RefreshControl(); + IMPORT_C void RefreshControl(); public: // From MMMAPlayerStateListener - void StateChanged(TInt aState); + IMPORT_C void StateChanged(TInt aState); public: // from MProfileChangeObserver - void HandleActiveProfileEventL(TProfileEvent aProfileEvent, TInt aProfileId ); + IMPORT_C void HandleActiveProfileEventL(TProfileEvent aProfileEvent, TInt aProfileId ); public: // New methods /** @@ -105,6 +105,8 @@ * volume setting is done. */ IMPORT_C void SetAudioOutputPreferenceL( TInt aRoutingPreference); + + void InitializeGlobalVolumeLevel(TInt aGlobalVolumeLevel); private: // New methods @@ -144,6 +146,9 @@ TInt iAudioOutputPreference; // Current profile Id. TInt iProfileId; +private: + // The Global Volume level at the time when a player is created + TInt iInitialGlobalVolumeLevel; }; #endif // CMMAVOLUMECONTROL_H diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/mmmacallstateobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/inc/mmmacallstateobserver.h Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,42 @@ +/* +* 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: Observer class for Publish and Subscribe handling +* +*/ + + +#ifndef MMMMACALLSTATEOBSERVER_H +#define MMMMACALLSTATEOBSERVER_H + +/** + * Abstract interface to the PS key watcher. + * + * @lib + */ +NONSHARABLE_CLASS(MMMACallStateObserver) + { +public: + + /** + * Handle Call state event + * + * @since + * @param aUid The UID that identifies the property category + * @param aKey The property sub-key + */ + virtual void HandleCallStateEventL(TUid aUid, TInt aKey) = 0; + }; + + +#endif // M_MMMAPSKEYOBSERVER_H diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/mmmacontainer.h --- a/javauis/mmapi_akn/baseline/inc/mmmacontainer.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc/mmmacontainer.h Mon Aug 23 16:38:44 2010 +0100 @@ -102,6 +102,14 @@ * @returns The rect of the content window in screen co-ordinates. */ virtual TRect MdcContainerWindowRect() const = 0; + + /** + * Fixes screen UI orientation. + * + * @param aEnableFix If ETrue, the UI orientation will be fixed. + * If EFalse, the standard UI orientation is restored. + */ + virtual void MdcFixUIOrientation(TBool aEnableFix) = 0; }; diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/mmmadisplay.h --- a/javauis/mmapi_akn/baseline/inc/mmmadisplay.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc/mmmadisplay.h Mon Aug 23 16:38:44 2010 +0100 @@ -182,6 +182,14 @@ virtual void UIGetCallback( MUiEventConsumer& aConsumer, TInt aCallbackId) = 0; + + /** + * Fixes screen UI orientation. + * + * @param aFix If ETrue, the UI orientation will be fixed. + * If EFalse, the standard UI orientation is restored. + */ + virtual void FixUIOrientation(TBool aFix) = 0; }; #endif // MMMADISPLAY_H diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/inc/tmmaparametervalidator.h --- a/javauis/mmapi_akn/baseline/inc/tmmaparametervalidator.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/inc/tmmaparametervalidator.h Mon Aug 23 16:38:44 2010 +0100 @@ -21,7 +21,7 @@ // INCLUDES #include -#include +#include #include // STRUCTS diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src.dsa/cmmacameraplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/src.dsa/cmmacameraplayer.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,672 @@ +/* +* Copyright (c) 2002-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 class is used for playing camera. +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include "cmmacameraplayer.h" +#include "tmmaparametervalidator.h" +#include "mmmadisplay.h" +#include "cmmacamerasound.h" + +#if defined( __WINS__ ) +#include +#endif + +// CONSTANTS +_LIT8(KImageJpegMime, "image/jpeg"); +_LIT8(KJpegMime, "jpeg"); +_LIT(KVideoControlName, "VideoControl"); + +CMMACameraPlayer* CMMACameraPlayer::NewLC(TInt aCameraIndex) +{ + CMMACameraPlayer* self = new(ELeave) CMMACameraPlayer; + CleanupStack::PushL(self); + self->ConstructL(aCameraIndex); + return self; +} + +CMMACameraPlayer::~CMMACameraPlayer() +{ + DEBUG("CMMACameraPlayer::~CMMACameraPlayer"); + + // Free (duplicated) UI camera resources first. + // Window is not able to send any + // callback requests to UI from now. + if (iWindow) + { + iWindow->SetDisplay(NULL); + } + + if (iCamera) + { + iCamera->CancelCaptureImage(); + iCamera->Release(); + delete iCamera; + } + + delete iSnapshotEncoded; + delete iSnapshotBitmap; + delete iRealizeWait; + + if (iDisplay && iDisplay->HasContainer()) + { + // Window will delete itself + // after all pending events are processed + // (lazy delete) + iDisplay->UIGetCallback( + *iWindow, CMMACameraWindow::EDestroyWindow); + } + else + { + delete iWindow; + } + iWindow = NULL; +} + + +CMMACameraPlayer::CMMACameraPlayer(): + iDisplay(NULL), + iSourceSizeIndex(KErrNotFound), + iStartTime(KErrNotFound) +{ + iStopViewFinder = ETrue; +} + + +void CMMACameraPlayer::ConstructL(TInt aCameraIndex) +{ + CMMAPlayer::ConstructL(); + + if (aCameraIndex >= CCamera::CamerasAvailable()) + { + // image capture is not supported + User::Leave(KErrNotFound); + } + + iCamera = CCamera::NewL(*this, aCameraIndex); + + iWindow = CMMACameraWindow::NewL(iCamera->Handle()); + + TCameraInfo cameraInfo; + iCamera->CameraInfo(cameraInfo); + + if (cameraInfo.iNumImageSizesSupported < 1) + { + // image capture is not supported + User::Leave(KErrNotFound); + } + + // default snapshot size + iSourceSizeIndex = cameraInfo.iNumImageSizesSupported - 1; + + iRealizeWait = new(ELeave)CRealizeWait; +} + +TInt64 CMMACameraPlayer::CurrentTime() +{ + TTime time; + time.HomeTime(); + return time.Int64(); +} + +void CMMACameraPlayer::ResolveViewFinderSizeL(TSize& aSize) +{ + DEBUG("CMMACameraPlayer::ResolveViewFinderSizeL"); + + TSize resultSize; + + // The only way to find out the size is to start the view finder + // with a proper size (screen size). + + ResolveScreenSizeL(resultSize); + + // StartViewFinderBitmapsL changes resultSize to + // the used view finder size. + // Used to get the source size only. + iCamera->StartViewFinderBitmapsL(resultSize); + + // Bitmap viewfinder is not used anymore. + iCamera->StopViewFinder(); + + aSize = resultSize; +} + +void CMMACameraPlayer::ResolveScreenSizeL(TSize& aSize) +{ + DEBUG("CMMACameraPlayer::ResolveScreenSizeL"); + +#if defined( __WINS__ ) + TSize size(0,0); + RWsSession ws; + + if (ws.Connect() == KErrNone) + { + CleanupClosePushL(ws); + + CWsScreenDevice* wsScreenDevice = new(ELeave)CWsScreenDevice(ws); + CleanupStack::PushL(wsScreenDevice); + + User::LeaveIfError(wsScreenDevice->Construct()); + + size = wsScreenDevice->SizeInPixels(); + + CleanupStack::PopAndDestroy(2); // wsScreenDevice, ws.Close() + } + + aSize = size; + +#else + TScreenInfoV01 info; + TPckgBuf< TScreenInfoV01 > buf(info); + + UserSvr::ScreenInfo(buf); + info = buf(); + + aSize = info.iScreenSize; +#endif +} + +void CMMACameraPlayer::ResolveCaptureSizes(const CCamera::TFormat aFormat, + const TInt aNumImageSizesSupported, + const TSize& aRequestSize, + TSize& aSourceSize, + TInt& aSourceIndex, + TInt& aLargestIndex) +{ + // Largest image size + TSize largestSize; + // Index to largest image size + TInt largestSizeIndex = 0; + // Source size + TSize sourceSize; + // Default source size index not set + TInt sourceSizeIndex = KErrNotFound; + // Temporary size for iterating capture sizes + TSize tmpSize; + + DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: aFormat = 0x%x", aFormat); + + // go through all supported sizes. + // Notice: Capture sizes are assumed to be in order from smaller to larger sizes + for (TInt i = 0; i < aNumImageSizesSupported; i++) + { + iCamera->EnumerateCaptureSizes(tmpSize, + i, + aFormat); + + DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iWidth = %d", tmpSize.iWidth); + DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iHeight = %d", tmpSize.iHeight); + + // Check if current is the largest + if ((largestSize.iWidth < tmpSize.iWidth) && + (largestSize.iHeight < tmpSize.iHeight)) + { + largestSize = tmpSize; + largestSizeIndex = i; + } + + // If wanted size is smaller than tmpSize we can use it + if ((aRequestSize.iWidth <= tmpSize.iWidth) && + (aRequestSize.iHeight <= tmpSize.iHeight)) + { + sourceSize = tmpSize; + sourceSizeIndex = i; + } + } + + DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: sourceSizeIndex = %d", sourceSizeIndex); + DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: largestSizeIndex = %d", largestSizeIndex); + + aSourceSize = sourceSize; + aSourceIndex = sourceSizeIndex; + aLargestIndex = largestSizeIndex; +} + +void CMMACameraPlayer::StartL(TBool aPostEvent) +{ + DEBUG_INT("CMMACameraPlayer:StartL iState %d", iState); + + // start can't be called to not ready player + if (iState == EPrefetched) + { + // camera passes ready images through + // ViewFinderFrameReady method + + // set time when started + iStartTime = CurrentTime(); + + // inform java side + ChangeState(EStarted); + + TInt64 time; + GetMediaTime(&time); + + // Notify the camera window + // about the status change + iWindow->SetStarted(ETrue); + + if (aPostEvent) + { + // inform java side + PostLongEvent(CMMAPlayerEvent::EStarted, time); + } + } + PostActionCompleted(KErrNone); // java start return +} + +void CMMACameraPlayer::StopL(TBool aPostEvent) +{ + DEBUG_INT("CMMACameraPlayer::StopL", iState); + if (iState == EStarted) + { + TInt64 time; + GetMediaTime(&time); // add played time to media time + + if (iStopViewFinder && iWindow->ViewFinderActive()) + { + iWindow->SetStarted(EFalse); + } + iStartTime = KErrNotFound; + + if (aPostEvent) + { + PostLongEvent(CMMAPlayerEvent::EStopped, time); + } + + // go back to prefetched state + ChangeState(EPrefetched); + } +} + +void CMMACameraPlayer::DeallocateL() +{ + // If player is started when deallocate is called, + // player is stopped from java side -> state is changed to + // prefetched. + // In prefetched state only reserved resource is + // camera reserve( released with iCamera->Release() ) + // In realized state no resources have been reserved. + // CHANGED: not releasing camera anymore, since it is already + // done in realized state + if (iState == EPrefetched) + { + ChangeState(ERealized); + } +} + + +void CMMACameraPlayer::RealizeL() +{ + iCamera->Reserve(); + // this lock will be released when power on is completed (or error) + if (!iRealizeWait->IsStarted()) + { + iRealizeWait->Start(); + } + User::LeaveIfError(iRealizeWait->iError); + CMMAPlayer::RealizeL(); +} + + +void CMMACameraPlayer::PrefetchL() +{ + DEBUG("MMA::CMMACameraPlayer::PrefetchL"); + // nothing to do here + ChangeState(EPrefetched); + PostActionCompleted(KErrNone); +} + + +void CMMACameraPlayer::GetDuration(TInt64* aDuration) +{ + // camera viewer has no duration. + *aDuration = KTimeUnknown; +} + + +void CMMACameraPlayer::SetMediaTimeL(TInt64* /*aTime*/) +{ + DEBUG("MMA::CMMACameraPlayer::SetMediaTimeL "); + // with camera media time is not supported. +} + + +void CMMACameraPlayer::GetMediaTime(TInt64* aMediaTime) +{ + if (iState == EStarted) + { + // add play time to media time + iMediaTime += CurrentTime() - iStartTime; + // set new start time + iStartTime = CurrentTime(); + } + + // set value to parameter + (*aMediaTime) = iMediaTime; +} + +void CMMACameraPlayer::CloseL() +{ + DEBUG("MMA::CMMACameraPlayer::CloseL()"); + + // cancel all activity + iCamera->CancelCaptureImage(); + + // Stop and release UI Camera instance + iWindow->SetDisplay(NULL); + + // we don't need reserve camera anymore + iCamera->Release(); + + CMMAPlayer::CloseL(); +} + +const TDesC& CMMACameraPlayer::Type() +{ + return KMMACameraPlayer; +} + +// MCameraObserver +void CMMACameraPlayer::ReserveComplete(TInt aError) +{ + DEBUG_INT("MMA::CMMACameraPlayer::ReserveComplete %d", aError); + if (aError == KErrNone) + { + // camera will notify completion with PowerOnComplete method. + iCamera->PowerOn(); + } + else + { + // release lock and store error. State doesn't change. + iRealizeWait->iError = aError; + iRealizeWait->AsyncStop(); + } + +} + +void CMMACameraPlayer::PowerOnComplete(TInt aError) +{ + DEBUG_INT("MMA::CMMACameraPlayer::PowerOnComplete %d", aError); + + TSize viewFinderSize; + TInt error = aError; + + if (error == KErrNone) + { + // The view finder size must be known after prefetching. + TRAP(error, ResolveViewFinderSizeL(viewFinderSize)); + } + + if (error == KErrNone) + { + iSize = viewFinderSize; + + if (iDisplay) + { + iDisplay->SourceSizeChanged(iSize); + NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName); + } + } + + iRealizeWait->iError = error; + iRealizeWait->AsyncStop(); +} + +void CMMACameraPlayer::ViewFinderFrameReady(CFbsBitmap& /*aFrame*/) +{ + // Empty implementation of an interface method. + // DirectViewFinder is used + // instead of BitmapViewFinder +} + +void CMMACameraPlayer::ImageReady(CFbsBitmap* aBitmap, + HBufC8* aData, + TInt aError) +{ + DEBUG_INT("MMA::CMMACameraPlayer::ImageReady %d", aError); + + // This method should never be called, + // unless we are taking snapshot + __ASSERT_DEBUG(iSnapshotStatus, User::Invariant()); + + __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant()); + __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant()); + + if (aError == KErrNone) + { + // this class has ownership of the bitmap until + // snapshot bitmap is got from this class. + iSnapshotBitmap = aBitmap; + iSnapshotEncoded = aData; + } + + // notify the caller, error code or KErrNone + User::RequestComplete(iSnapshotStatus, aError); + iWindow->SetStarted(ETrue); + // Status is not needed anymore + // and this class don't own the status. + iSnapshotStatus = NULL; +} + +void CMMACameraPlayer::FrameBufferReady(MFrameBuffer* /*aFrameBuffer*/, + TInt /*aError*/) +{ + DEBUG("MMA::CMMACameraPlayer::FrameBufferReady"); + // this callback will never be called + // Asserted in debug build to be sure. + __ASSERT_DEBUG(EFalse, User::Invariant()); +} + +void CMMACameraPlayer::SetDisplayL(MMMADisplay* aDisplay) +{ + DEBUG("MMA::CMMACameraPlayer::SetDisplay"); + + // now it is ready to draw + iDisplay = aDisplay; + + // Passes display into iWindow. + // Allocates all resources needed to use a camera DirectViewFinder. + iWindow->SetDisplay(aDisplay); + + iDisplay->SetWindowL(iWindow); + + // Set view finder size to the display only if the view finder + // size has been resolved. + if (iSize != TSize(0, 0)) + { + iDisplay->SourceSizeChanged(iSize); + NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName); + } +} + +TSize CMMACameraPlayer::SourceSize() +{ + return iSize; +} + +MMMASnapshot::TEncoding CMMACameraPlayer::TakeSnapshotL(TRequestStatus* aStatus, + const TSize& aSize, + const CMMAImageSettings& aSettings) +{ + __ASSERT_DEBUG(!iSnapshotStatus, User::Invariant()); + __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant()); + __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant()); + + // snapshots can not be taken if player is not realized + if (iState < ERealized) + { + User::Leave(KErrNotReady); + } + // save status which will be notified + iSnapshotStatus = aStatus; + + // changing status to pending + *iSnapshotStatus = KRequestPending; + + // Source size not set in the beginning + TSize sourceSize; + + // Use default if size is not specified. + TInt sourceSizeIndex = iSourceSizeIndex; + + // Largest image size index + TInt largestSizeIndex = 0; + + // Get camera characteristics + TCameraInfo cameraInfo; + iCamera->CameraInfo(cameraInfo); + + // Set default snapshot encoding type + TEncoding encoding = EBitmap; + + // Set default image capture format + CCamera::TFormat format = CCamera::EFormatFbsBitmapColor16M; + + DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iImageFormatsSupported = 0x%x", cameraInfo.iImageFormatsSupported); + DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iNumImageSizesSupported = %d", cameraInfo.iNumImageSizesSupported); + + // Check if size was set in Java + if (aSize.iWidth != KErrNotFound && + aSize.iHeight != KErrNotFound) + { + // Determine if jpeg capture was requested + if ((*aSettings.iMimeType == KJpegMime) || + (*aSettings.iMimeType == KImageJpegMime)) + { + // Shortcut for supported image formats + TUint32 imageFormats = cameraInfo.iImageFormatsSupported; + + // Jpeg subtype constants + _LIT8(KJpegJfif, "jfif"); + _LIT8(KJpegExif, "exif"); + + // Resolve requested jpeg subtype from settings and camerainfo + if ((imageFormats & CCamera::EFormatJpeg) && + (*aSettings.iType == KJpegJfif)) + { + // JFIF JPEG + format = CCamera::EFormatJpeg; + encoding = EEncoded; + } + else if ((imageFormats & CCamera::EFormatExif) && + (*aSettings.iType == KJpegExif)) + { + // EXIF JPEG + format = CCamera::EFormatExif; + encoding = EEncoded; + } + } + + // Try to resolve nearest source size to the one requested, + // except for the JFIF and EXIF jpeg subtypes the match has + // to be exact otherwise non-encode capture format will be + // used + ResolveCaptureSizes(format, + cameraInfo.iNumImageSizesSupported, + aSize, + sourceSize, + sourceSizeIndex, + largestSizeIndex); + + // Format was either of the jpeg formats and requested size + // didn't match the source size + if ((format >= CCamera::EFormatJpeg && + format <= CCamera::EFormatExif) && + (aSize != sourceSize)) + { + // Try again with an non-encoded format + format = CCamera::EFormatFbsBitmapColor16M; + encoding = EBitmap; + ResolveCaptureSizes(format, + cameraInfo.iNumImageSizesSupported, + aSize, + sourceSize, + sourceSizeIndex, + largestSizeIndex); + } + + if (sourceSizeIndex == KErrNotFound) + { + // If correct index was not found use the largest. + sourceSizeIndex = largestSizeIndex; + } + } + // else use default iSourceSizeIndex and default image capture format + + iCamera->PrepareImageCaptureL(format, + sourceSizeIndex); + + // play sound when capturing image + CMMACameraSound::PlayImageCaptureSoundL(); + + // start capture, ImageReady will be called when ready + iWindow->SetStarted(EFalse); + + iCamera->CaptureImage(); + + DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: format = 0x%x", format); + DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: sourceSizeIndex = %d", sourceSizeIndex); + DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: encoding = %d", encoding); + + // Inform caller which snapshot encoding was ultimately used + return encoding; +} + +CFbsBitmap* CMMACameraPlayer::SnapshotBitmap() +{ + CFbsBitmap* bitmap = iSnapshotBitmap; + + // ownership transfers to the caller + iSnapshotBitmap = NULL; + return bitmap; +} + +HBufC8* CMMACameraPlayer::SnapshotEncoded() +{ + HBufC8* encoded = iSnapshotEncoded; + + // ownership transfers to the caller + iSnapshotEncoded = NULL; + return encoded; +} + +void CMMACameraPlayer::NotifyWithStringEvent( + CMMAPlayerEvent::TEventType aEventType, + const TDesC& aStringEventData) +{ + PostStringEvent(aEventType, aStringEventData); +} + +MMMASnapshot* CMMACameraPlayer::SnapshoterL() +{ + return this; +} + +TInt CMMACameraPlayer::CameraHandle() +{ + return iCamera->Handle(); +} + +void CMMACameraPlayer::SetViewFinderMode(TBool aStopViewFinder) +{ + iStopViewFinder = aStopViewFinder; +} + +// END OF FILE diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src.dsa/cmmacameraplayerfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/src.dsa/cmmacameraplayerfactory.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,224 @@ +/* +* Copyright (c) 2002-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 is used for creating camera players. +* +*/ + + +// INCLUDE FILES +#include +#include + +#include "cmmacameraplayerfactory.h" +#include "cmmacameraplayer.h" +#include "cmmavideocontrol.h" +#include "cmmavideorecordcontrol.h" +#include "cmmastoptimecontrol.h" +#include "cmmaplayerproperties.h" +#include "cmmammfresolver.h" + +_LIT(KDefaultVideo, "video"); +//is the main camera +_LIT(KDevcamZero, "devcam0"); +// the secondary camera +_LIT(KDevcamOne, "devcam1"); + +_LIT(KEncodingProperty, "encoding"); + +_LIT(KVideoMp4MimeType, "video/mp4"); +_LIT(KVideoH264MimeType, "video/H264"); + +CMMACameraPlayerFactory* CMMACameraPlayerFactory::NewLC() +{ + CMMACameraPlayerFactory* pFactory = + new(ELeave) CMMACameraPlayerFactory(); + CleanupStack::PushL(pFactory); + return pFactory; +} + + +CMMACameraPlayerFactory::CMMACameraPlayerFactory() +{ +} + + +CMMACameraPlayerFactory::~CMMACameraPlayerFactory() +{ + delete iAudioSettings; +} + +CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL( + CMMAMMFResolver* aResolver) +{ + DEBUG("MMA::CMMACameraPlayerFactory::CreatePlayerL( aResolver )+"); + CMMACameraPlayer* player = CMMACameraPlayer::NewLC(iCameraIndex); + + /* Add VideoControl */ + CMMAVideoControl* videoControl = new(ELeave)CMMAVideoControl(player); + + CleanupStack::PushL(videoControl); + player->AddControlL(videoControl); + CleanupStack::Pop(videoControl); + + /* Add RecordControl */ + CMMAVideoRecordControl* videoRecordControl = + CMMAVideoRecordControl::NewL(player, + aResolver, + iVideoSettings, + iAudioSettings, + player->CameraHandle()); + CleanupStack::PushL(videoRecordControl); + player->AddControlL(videoRecordControl); + // ownership transfered to player + CleanupStack::Pop(videoRecordControl); + + // With record control view finder can't be stopped, + // because it can not be restarted. + player->SetViewFinderMode(EFalse); + + CleanupStack::Pop(player); + return player; +} + + +void CMMACameraPlayerFactory::MediaIdsL(RArray& aMediaIds) +{ + CleanupClosePushL(aMediaIds); + User::LeaveIfError(aMediaIds.Append(KUidMediaTypeVideo)); + CleanupStack::Pop(); +} + +void CMMACameraPlayerFactory::PreparePluginSelectionParametersL( + CMMAMMFResolver* aResolver, + CMMFFormatSelectionParameters* aFormatSelection) +{ + // We are creating record type player + aResolver->SetRequiredRecordFormatSupportL(*aFormatSelection); +} + +CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC&) +{ + // record player cannot be created from conten-type, since this is used only + // when we have also data + return NULL; +} + + +CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC8&) +{ + // record player cannot be created with header data + return NULL; +} + +CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL( + const TDesC& aProtocol, + const TDesC& aMiddlePart, + const TDesC& aParameters) +{ + DEBUG_STR("MMA::CMMACameraPlayerFactory::CreatePlayerL aParameters = %S", aParameters); + // check that locator is capture:://audio + if (aProtocol != KMMACaptureProtocol) + { + return NULL; + } + + iCameraIndex = KErrNotFound; + + // If the device supports multiple cameras then "capture://devcam0" is the + // main camera pointing outwards from the user. "capture://devcam1" is the + // secondary camera pointing e.g. towards the user. "capture://video" is + // the default camera locator pointing to the same camera as "devcam0" + if ((aMiddlePart == KDefaultVideo) || + (aMiddlePart == KDevcamZero)) + { + // First camera + iCameraIndex = 0; + } + else if (aMiddlePart == KDevcamOne) + { + // Second camera. + iCameraIndex = 1; + } + else + { + // not supported type + return NULL; + } + + CMMAAudioSettings* audioSettings = new(ELeave) CMMAAudioSettings; + audioSettings->iDataType = KMMFFourCCCodeNULL; + delete iAudioSettings; + iAudioSettings = audioSettings; + + if (aParameters.Length() == 0) + { + // getting defaults from validator + iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters); + } + else + { + // we accept either video or mixed parameters, so properties must contain encoding 2 times for mixed and + // 1 time for video. + // making tmp des without first "encoding" + TInt lengthWithoutEncoding = aParameters.Length() - KEncodingProperty().Length(); + if (lengthWithoutEncoding < 0) + { + User::Leave(KErrArgument); + } + TPtrC tmp = aParameters.Right(lengthWithoutEncoding); + // finding second "encoding" + TInt videoPropertiesStartPos = tmp.Find(KEncodingProperty); + if (videoPropertiesStartPos == KErrNotFound) + { + // there is not another encoding, so assuming that there is only video parameters + iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters); + } + else + { + // there is mixed parameters + videoPropertiesStartPos += KEncodingProperty().Length(); + + // skipping '&' char + TPtrC audioProperties = aParameters.Left(videoPropertiesStartPos - 1); + TPtrC videoProperties = aParameters.Mid(videoPropertiesStartPos); + iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(videoProperties); + + CMMAAudioSettings* audioSettings = TMMAParameterValidator::ValidateAudioPropertiesL(audioProperties); + delete iAudioSettings; + iAudioSettings = audioSettings; + } + } + + // if wanted video capture encoding is H264, we must create player with video/mp4 + // because mmf doesn't have controller for H264 + if (iVideoSettings.iEncoding.Compare(KVideoH264MimeType) == 0) + { + return CMMAMMFPlayerFactory::CreatePlayerL(KVideoMp4MimeType); + } + + // Find controller with content-type + return CMMAMMFPlayerFactory::CreatePlayerL(iVideoSettings.iEncoding); +} + +void CMMACameraPlayerFactory::GetSupportedProtocolsL( + const TDesC& aContentType, + CDesC16Array& aProtocolArray) +{ + if (IsSupportedContentTypeL(aContentType)) + { + aProtocolArray.AppendL(KMMACaptureProtocol); + } +} + +// END OF FILE diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src.dsa/cmmasnapshot.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/src.dsa/cmmasnapshot.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,248 @@ +/* +* Copyright (c) 2002-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 takes snapshot and resizes bitmap if needed. +* +*/ + + +// INCLUDE FILES +#include + +#include "cmmasnapshot.h" +#include "mmmaguiplayer.h" +#include "mmmasnapshotreadycallback.h" +#include "mmmasnapshot.h" + +// CONSTANTS +const TInt KIgnoreSize = -1; + + +// CONSTRUCTION +CMMASnapshot* CMMASnapshot::NewL(MMMAGuiPlayer* aGuiPlayer, + MMMASnapshotReadyCallback& aCallBack) +{ + CMMASnapshot* self = new(ELeave) CMMASnapshot(aGuiPlayer, + aCallBack); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // self + return self; +} + +CMMASnapshot::~CMMASnapshot() +{ + if (iScaler) + { + iScaler->Cancel(); + delete iScaler; + } + if (iEncoder) + { + iEncoder->Cancel(); + delete iEncoder; + } + delete iBitmap; + delete iBuffer; + delete iSettings; +} + +void CMMASnapshot::ConstructL() +{ + CActiveScheduler::Add(this); + iScaler = CBitmapScaler::NewL(); +} + +CMMASnapshot::CMMASnapshot(MMMAGuiPlayer* aGuiPlayer, + MMMASnapshotReadyCallback& aCallBack): + CActive(EPriorityStandard), + iEncoding(MMMASnapshot::EBitmap), + iCallBack(aCallBack), + iState(EIdle) +{ + iGUIPlayer = aGuiPlayer; +} + +void CMMASnapshot::TakeSnapShotL(const TDesC& aProperties) +{ + // snapshot sequence is not finished + __ASSERT_DEBUG(iState == EIdle, User::Invariant()); + // image buffer must be taken with ImageBuffer before taking new snapshot + __ASSERT_DEBUG(iBuffer == NULL, User::Invariant()); + + CMMAImageSettings* settings + = TMMAParameterValidator::ValidateImagePropertiesL(aProperties); + CleanupStack::PushL(settings); + + delete iSettings; + CleanupStack::Pop(settings); + iSettings = settings; + + // take snapshot from player. RunL is called when image is ready + // or error occures + iState = ETakingSnapshot; + TSize snapshotSize(iSettings->iWidth, iSettings->iHeight); + iEncoding = iGUIPlayer->SnapshoterL()->TakeSnapshotL(&iStatus, + snapshotSize, + *iSettings); + SetActive(); +} + +HBufC8* CMMASnapshot::ImageBuffer() +{ + // this must not be called when snapshot sequence is running + __ASSERT_DEBUG(iState == EIdle, User::Invariant()); + HBufC8* buffer = iBuffer; + // caller takes ownership of the buffer + iBuffer = NULL; + return buffer; +} + +void CMMASnapshot::ResizeL() +{ + iState = EResizing; + TSize imageSize(iBitmap->SizeInPixels()); + if (iSettings->iWidth != KIgnoreSize) + { + imageSize.iWidth = iSettings->iWidth; + } + if (iSettings->iHeight != KIgnoreSize) + { + imageSize.iHeight = iSettings->iHeight; + } + if (imageSize == iBitmap->SizeInPixels()) + { + // no user resizing needed, continue sequence + EncodeL(); + } + else + { + iScaler->Scale(&iStatus, *iBitmap, imageSize, EFalse); + SetActive(); + } +} + +void CMMASnapshot::EncodeL() +{ + // CImageEncoder cannot be reused, so have to make it every time + CImageEncoder* encoder = CImageEncoder::DataNewL(iBuffer, *iSettings->iMimeType); + delete iEncoder; + iEncoder = encoder; + + iState = EEncoding; + iEncoder->Convert(&iStatus, *iBitmap, iSettings->iImageData); + SetActive(); +} + +void CMMASnapshot::Completed(TInt aError) +{ + iStatus = aError; + iCallBack.SnapshotReady(); +} + +void CMMASnapshot::RunL() +{ + if (iStatus != KErrNone) + { + // Error has occured, inform java side and change state + iState = EIdle; + Completed(iStatus.Int()); + return; + } + + switch (iState) + { + case ETakingSnapshot: + { + DEBUG_INT("MMA::CMMASnapshot::RunL: iEncoding = %d", iEncoding); + if (iEncoding == MMMASnapshot::EEncoded) + { + // take encoded image from player. + // Ownership transfers to this class. + iBuffer = iGUIPlayer->SnapshoterL()->SnapshotEncoded(); + if (!iBuffer) + { + // error has occured with taking image + Completed(KErrNotFound); + } + // Image is ready, update internal state and inform listener + // Encoded images are not resized + iState = EIdle; + Completed(KErrNone); + } + else + { + // take bitmap from player. + // Ownership transfers to this class. + iBitmap = iGUIPlayer->SnapshoterL()->SnapshotBitmap(); + if (!iBitmap) + { + // error has occured with taking image + Completed(KErrNotFound); + } + // Continue to next state + ResizeL(); + } + break; + } + case EResizing: + { + // Continue to next state + EncodeL(); + break; + } + case EEncoding: + { + delete iEncoder; + iEncoder = NULL; + + delete iBitmap; + iBitmap = NULL; + iState = EIdle; + // encoding is ready, inform listener + Completed(KErrNone); + break; + } + default: + { + // unknown state + __ASSERT_DEBUG(EFalse, User::Invariant()); + } + } +} + +TInt CMMASnapshot::RunError(TInt aError) +{ + // Reset state + iState = EIdle; + // Pass error code to observer + Completed(aError); + + return KErrNone; +} + +void CMMASnapshot::DoCancel() +{ + // snapshot taking cannot be cancelled + if (iScaler) + { + iScaler->Cancel(); + } + if (iEncoder) + { + iEncoder->Cancel(); + } + iState = EIdle; +} + +// END OF FILE diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src.nga/cmmacameraplayer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/src.nga/cmmacameraplayer.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,964 @@ +/* +* Copyright (c) 2002-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 class is used for playing camera. +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include "cmmacameraplayer.h" +#include "tmmaparametervalidator.h" +#include "mmmadisplay.h" +#include "cmmacamerasound.h" + +#if defined( __WINS__ ) +#include +#endif + +// CONSTANTS +_LIT8(KImageJpegMime, "image/jpeg"); +_LIT8(KJpegMime, "jpeg"); +_LIT(KVideoControlName, "VideoControl"); + +CMMACameraPlayer* CMMACameraPlayer::NewLC(TCamActiveCamera aCameraIndex) +{ + CMMACameraPlayer* self = new(ELeave) CMMACameraPlayer(aCameraIndex); + CleanupStack::PushL(self); + self->ConstructL(aCameraIndex); + return self; +} + +CMMACameraPlayer::~CMMACameraPlayer() +{ + DEBUG("CMMACameraPlayer::~CMMACameraPlayer +"); + + // Free (duplicated) UI camera resources first. + // Window is not able to send any + // callback requests to UI from now. + if (iWindow) + { + iWindow->SetDisplay(NULL); + } + + if (iCamera) + { + iCamera->CancelCaptureImage(); + iCamera->Release(); + delete iCamera; + } + + delete iSnapshotEncoded; + delete iSnapshotBitmap; + delete iRealizeWait; + + if (iDisplay && iDisplay->HasContainer()) + { + // Window will delete itself + // after all pending events are processed + // (lazy delete) + iDisplay->UIGetCallback( + *iWindow, CMMACameraWindow::EDestroyWindow); + } + else + { + delete iWindow; + } + iWindow = NULL; + // Delete sensor api object + delete iAccSensorChannel; + DEBUG("CMMACameraPlayer::~CMMACameraPlayer -"); +} + + +CMMACameraPlayer::CMMACameraPlayer(TCamActiveCamera aCameraIndex): + iDisplay(NULL), + iSourceSizeIndex(KErrNotFound), + iStartTime(KErrNotFound), + iSnapshotEncoded(NULL), + iActiveCameraIndex(aCameraIndex), + iImageOrientation(ECamOrientation0), + iLastImageOrientation(ECamOrientation0) +{ + iStopViewFinder = ETrue; +} + + +void CMMACameraPlayer::ConstructL(TCamActiveCamera aCameraIndex) +{ + CMMAPlayer::ConstructL(); + + if (aCameraIndex >= CCamera::CamerasAvailable()) + { + // image capture is not supported + User::Leave(KErrNotFound); + } + + iCamera = CCamera::New2L(*this, aCameraIndex, 100); + + iCustomInterfaceOrientation = + static_cast ( + iCamera->CustomInterface(KCameraOrientationUid )); + iCustomInterfaceUIOrientationOverride = + static_cast ( + iCamera->CustomInterface(KCameraUIOrientationOverrideUid)); + // Fix to landscape mode + iCustomInterfaceUIOrientationOverride->SetOrientationModeL(1); + + iWindow = CMMACameraWindow::NewL(iCamera->Handle()); + + TCameraInfo cameraInfo; + iCamera->CameraInfo(cameraInfo); + + if (cameraInfo.iNumImageSizesSupported < 1) + { + // image capture is not supported + User::Leave(KErrNotFound); + } + + // default snapshot size + iSourceSizeIndex = cameraInfo.iNumImageSizesSupported - 1; + + iRealizeWait = new(ELeave)CRealizeWait; +} + +TInt64 CMMACameraPlayer::CurrentTime() +{ + TTime time; + time.HomeTime(); + return time.Int64(); +} + +void CMMACameraPlayer::ResolveViewFinderSizeL(TSize& aSize) +{ + DEBUG("CMMACameraPlayer::ResolveViewFinderSizeL"); + + TSize resultSize; + + // The only way to find out the size is to start the view finder + // with a proper size (screen size). + + ResolveScreenSizeL(resultSize); + + // StartViewFinderBitmapsL changes resultSize to + // the used view finder size. + // Used to get the source size only. + iCamera->StartViewFinderBitmapsL(resultSize); + + // Bitmap viewfinder is not used anymore. + iCamera->StopViewFinder(); + + aSize = resultSize; +} + +void CMMACameraPlayer::ResolveScreenSizeL(TSize& aSize) +{ + DEBUG("CMMACameraPlayer::ResolveScreenSizeL"); + +#if defined( __WINS__ ) + TSize size(0,0); + RWsSession ws; + + if (ws.Connect() == KErrNone) + { + CleanupClosePushL(ws); + + CWsScreenDevice* wsScreenDevice = new(ELeave)CWsScreenDevice(ws); + CleanupStack::PushL(wsScreenDevice); + + User::LeaveIfError(wsScreenDevice->Construct()); + + size = wsScreenDevice->SizeInPixels(); + + CleanupStack::PopAndDestroy(2); // wsScreenDevice, ws.Close() + } + + aSize = size; + +#else + TScreenInfoV01 info; + TPckgBuf< TScreenInfoV01 > buf(info); + + UserSvr::ScreenInfo(buf); + info = buf(); + + aSize = info.iScreenSize; +#endif +} + +void CMMACameraPlayer::ResolveCaptureSizes(const CCamera::TFormat aFormat, + const TInt aNumImageSizesSupported, + const TSize& aRequestSize, + TSize& aSourceSize, + TInt& aSourceIndex, + TInt& aLargestIndex) +{ + // Largest image size + TSize largestSize; + // Index to largest image size + TInt largestSizeIndex = 0; + // Source size + TSize sourceSize; + // Default source size index not set + TInt sourceSizeIndex = KErrNotFound; + // Temporary size for iterating capture sizes + TSize tmpSize; + + DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: aFormat = 0x%x", aFormat); + + // go through all supported sizes. + // Notice: Capture sizes are assumed to be in order from smaller to larger sizes + for (TInt i = 0; i < aNumImageSizesSupported; i++) + { + iCamera->EnumerateCaptureSizes(tmpSize, + i, + aFormat); + + DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iWidth = %d", tmpSize.iWidth); + DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iHeight = %d", tmpSize.iHeight); + + // Check if current is the largest + if ((largestSize.iWidth < tmpSize.iWidth) && + (largestSize.iHeight < tmpSize.iHeight)) + { + largestSize = tmpSize; + largestSizeIndex = i; + } + + // If wanted size is smaller than tmpSize we can use it + if ((aRequestSize.iWidth <= tmpSize.iWidth) && + (aRequestSize.iHeight <= tmpSize.iHeight)) + { + sourceSize = tmpSize; + sourceSizeIndex = i; + } + } + + DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: sourceSizeIndex = %d", sourceSizeIndex); + DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: largestSizeIndex = %d", largestSizeIndex); + + aSourceSize = sourceSize; + aSourceIndex = sourceSizeIndex; + aLargestIndex = largestSizeIndex; +} + +void CMMACameraPlayer::StartL(TBool aPostEvent) +{ + DEBUG_INT("CMMACameraPlayer:StartL iState %d", iState); + + // start can't be called to not ready player + if (iState == EPrefetched) + { + // camera passes ready images through + // ViewFinderFrameReady method + + // set time when started + iStartTime = CurrentTime(); + + // inform java side + ChangeState(EStarted); + + TInt64 time; + GetMediaTime(&time); + + // Notify the camera window + // about the status change + iWindow->SetStarted(ETrue); + + if (aPostEvent) + { + // inform java side + PostLongEvent(CMMAPlayerEvent::EStarted, time); + } + } + PostActionCompleted(KErrNone); // java start return +} + +void CMMACameraPlayer::StopL(TBool aPostEvent) +{ + DEBUG_INT("CMMACameraPlayer::StopL", iState); + if (iState == EStarted) + { + TInt64 time; + GetMediaTime(&time); // add played time to media time + + if (iStopViewFinder && iWindow->ViewFinderActive()) + { + iWindow->SetStarted(EFalse); + } + iStartTime = KErrNotFound; + + if (aPostEvent) + { + PostLongEvent(CMMAPlayerEvent::EStopped, time); + } + + // go back to prefetched state + ChangeState(EPrefetched); + } +} + +void CMMACameraPlayer::DeallocateL() +{ + // If player is started when deallocate is called, + // player is stopped from java side -> state is changed to + // prefetched. + // In prefetched state only reserved resource is + // camera reserve( released with iCamera->Release() ) + // In realized state no resources have been reserved. + // CHANGED: not releasing camera anymore, since it is already + // done in realized state + if (iState == EPrefetched) + { + ChangeState(ERealized); + } +} + + +void CMMACameraPlayer::RealizeL() +{ + iCamera->Reserve(); + // this lock will be released when power on is completed (or error) + if (!iRealizeWait->IsStarted()) + { + iRealizeWait->Start(); + } + User::LeaveIfError(iRealizeWait->iError); + CMMAPlayer::RealizeL(); +} + + +void CMMACameraPlayer::PrefetchL() +{ + DEBUG("MMA::CMMACameraPlayer::PrefetchL"); + // nothing to do here + ChangeState(EPrefetched); + PostActionCompleted(KErrNone); +} + + +void CMMACameraPlayer::GetDuration(TInt64* aDuration) +{ + // camera viewer has no duration. + *aDuration = KTimeUnknown; +} + + +void CMMACameraPlayer::SetMediaTimeL(TInt64* /*aTime*/) +{ + DEBUG("MMA::CMMACameraPlayer::SetMediaTimeL "); + // with camera media time is not supported. +} + + +void CMMACameraPlayer::GetMediaTime(TInt64* aMediaTime) +{ + if (iState == EStarted) + { + // add play time to media time + iMediaTime += CurrentTime() - iStartTime; + // set new start time + iStartTime = CurrentTime(); + } + + // set value to parameter + (*aMediaTime) = iMediaTime; +} + +void CMMACameraPlayer::CloseL() +{ + DEBUG("MMA::CMMACameraPlayer::CloseL()"); + + // cancel all activity + iCamera->CancelCaptureImage(); + + // Stop and release UI Camera instance + iWindow->SetDisplay(NULL); + + // we don't need reserve camera anymore + iCamera->Release(); + + iCustomInterfaceOrientation = NULL; + if (iAccSensorChannel) + { + iAccSensorChannel->StopDataListening(); + } + + if (iDisplay) + { + iDisplay->FixUIOrientation(EFalse); + } + + CMMAPlayer::CloseL(); +} + +const TDesC& CMMACameraPlayer::Type() +{ + return KMMACameraPlayer; +} + + +void CMMACameraPlayer::HandleEvent(const TECAMEvent& aEvent) +{ + TInt error = aEvent.iErrorCode; + if (KUidECamEventReserveComplete == aEvent.iEventType) + { + DEBUG_INT("MMA::CMMACameraPlayer::HandleEvent:KUidECamEventReserveComplete error %d", error); + if (error == KErrNone) + { + // camera will notify completion with PowerOnComplete method. + iCamera->PowerOn(); + } + else + { + // release lock and store error. State doesn't change. + iRealizeWait->iError = error; + iRealizeWait->AsyncStop(); + } + } + else if (KUidECamEventPowerOnComplete == aEvent.iEventType) + { + DEBUG_INT("MMA::CMMACameraPlayer::HandleEvent:KUidECamEventPowerOnComplete error %d", error); + + TSize viewFinderSize; + + if (error == KErrNone) + { + // The view finder size must be known after prefetching. + TRAP(error, ResolveViewFinderSizeL(viewFinderSize)); + } + + if (error == KErrNone) + { + iSize = viewFinderSize; + + if (iDisplay) + { + iDisplay->SourceSizeChanged(iSize); + NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName); + + iDisplay->FixUIOrientation(ETrue); + } + } + + iRealizeWait->iError = error; + iRealizeWait->AsyncStop(); + } +} + +void CMMACameraPlayer::ViewFinderReady(MCameraBuffer& aCameraBuffer, + TInt /*aError*/) +{ + aCameraBuffer.Release(); +} + +void CMMACameraPlayer::ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError) +{ + DEBUG_INT("MMA::CMMACameraPlayer::ImageBufferReady %d", aError); + + // This method should never be called, + // unless we are taking snapshot + __ASSERT_DEBUG(iSnapshotStatus, User::Invariant()); + __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant()); + __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant()); + + TInt error = aError; + if (aError == KErrNone) + { + CFbsBitmap* srcBitmap = NULL; + TRAP(error, HandleBitmapCopyL(aCameraBuffer, srcBitmap)); + DEBUG_INT("MMA::CMMACameraPlayer::ImageBufferReady HandleBitmapCopyL %d", error); + + // picture data is not of bitmap type + if (!srcBitmap && (KErrNotSupported == error)) + { + TDesC8* temp = NULL; + TRAP(error, temp = aCameraBuffer.DataL(0)); + DEBUG_INT("CMMACameraPlayer::CopyImageDataL DataL error %d", error); + if (KErrNone == error) + { + iSnapshotEncoded = temp->Alloc(); + } + } + } + + // notify the caller, error code or KErrNone + User::RequestComplete(iSnapshotStatus, error); + iWindow->SetStarted(ETrue); + // Status is not needed anymore + // and this class don't own the status. + iSnapshotStatus = NULL; + aCameraBuffer.Release(); +} + +void CMMACameraPlayer::VideoBufferReady(MCameraBuffer& aCameraBuffer, + TInt /*aError*/) +{ + aCameraBuffer.Release(); +} + +void CMMACameraPlayer::HandleBitmapCopyL(MCameraBuffer& aCameraBuffer, + CFbsBitmap* aSrcBitmap) +{ + DEBUG("MMA::CMMACameraPlayer::HandleBitmapCopyL +"); + + aSrcBitmap = &(aCameraBuffer.BitmapL(0)); // not owned + + iSnapshotBitmap = new(ELeave)CFbsBitmap(); + + User::LeaveIfError(iSnapshotBitmap->Create(aSrcBitmap->SizeInPixels(), + aSrcBitmap->DisplayMode())); + CFbsBitmapDevice* bitmapDevice = NULL; + CFbsBitGc* bitmapGc = NULL; + + bitmapDevice = CFbsBitmapDevice::NewL(iSnapshotBitmap); + bitmapDevice->CreateContext(bitmapGc); + bitmapGc->BitBlt(TPoint(0,0), aSrcBitmap); + + delete bitmapGc; + delete bitmapDevice; + DEBUG("MMA::CMMACameraPlayer::HandleBitmapCopyL -"); +} + +void CMMACameraPlayer::SetDisplayL(MMMADisplay* aDisplay) +{ + DEBUG("MMA::CMMACameraPlayer::SetDisplay"); + + // now it is ready to draw + iDisplay = aDisplay; + + // Passes display into iWindow. + // Allocates all resources needed to use a camera DirectViewFinder. + iWindow->SetDisplay(aDisplay); + + iDisplay->SetWindowL(iWindow); + + // Set view finder size to the display only if the view finder + // size has been resolved. + if (iSize != TSize(0, 0)) + { + iDisplay->SourceSizeChanged(iSize); + NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName); + } + + iDisplay->FixUIOrientation(ETrue); + UpdateSensorInfoL(); +} + +TSize CMMACameraPlayer::SourceSize() +{ + return iSize; +} + +MMMASnapshot::TEncoding CMMACameraPlayer::TakeSnapshotL(TRequestStatus* aStatus, + const TSize& aSize, + const CMMAImageSettings& aSettings) +{ + __ASSERT_DEBUG(!iSnapshotStatus, User::Invariant()); + __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant()); + __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant()); + + // snapshots can not be taken if player is not realized + if (iState < ERealized) + { + User::Leave(KErrNotReady); + } + // save status which will be notified + iSnapshotStatus = aStatus; + + // changing status to pending + *iSnapshotStatus = KRequestPending; + + // Source size not set in the beginning + TSize sourceSize; + + // Use default if size is not specified. + TInt sourceSizeIndex; + + if (aSize.iWidth != KErrNotFound && + aSize.iHeight != KErrNotFound) + { + sourceSizeIndex = iSourceSizeIndex; + } + else + { + sourceSizeIndex = 0; + } + + // Largest image size index + TInt largestSizeIndex = 0; + + // Get camera characteristics + TCameraInfo cameraInfo; + iCamera->CameraInfo(cameraInfo); + + // Set default snapshot encoding type + TEncoding encoding = EEncoded; + // Set default image capture format + CCamera::TFormat format = CCamera::EFormatExif; + + DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iImageFormatsSupported = 0x%x", cameraInfo.iImageFormatsSupported); + DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iNumImageSizesSupported = %d", cameraInfo.iNumImageSizesSupported); + + // Check if size was set in Java + if (aSize.iWidth != KErrNotFound && + aSize.iHeight != KErrNotFound) + { + DEBUG("MMA::CMMACameraPlayer::TakeSnapshotL size was set in MIDlet"); + // Determine if jpeg capture was requested + if ((*aSettings.iMimeType == KJpegMime) || + (*aSettings.iMimeType == KImageJpegMime)) + { + // Shortcut for supported image formats + TUint32 imageFormats = cameraInfo.iImageFormatsSupported; + + // Jpeg subtype constants + _LIT8(KJpegJfif, "jfif"); + _LIT8(KJpegExif, "exif"); + + // Resolve requested jpeg subtype from settings and camerainfo + if ((imageFormats & CCamera::EFormatJpeg) && + (*aSettings.iType == KJpegJfif)) + { + // JFIF JPEG + format = CCamera::EFormatJpeg; + encoding = EEncoded; + } + else if ((imageFormats & CCamera::EFormatExif) && + (*aSettings.iType == KJpegExif)) + { + // EXIF JPEG + format = CCamera::EFormatExif; + encoding = EEncoded; + } + } + + // Try to resolve nearest source size to the one requested, + // except for the JFIF and EXIF jpeg subtypes the match has + // to be exact otherwise non-encode capture format will be + // used + ResolveCaptureSizes(format, + cameraInfo.iNumImageSizesSupported, + aSize, + sourceSize, + sourceSizeIndex, + largestSizeIndex); + + // Format was either of the jpeg formats and requested size + // didn't match the source size + if ((format >= CCamera::EFormatJpeg && + format <= CCamera::EFormatExif) && + (aSize != sourceSize)) + { + // Try again with an non-encoded format + format = CCamera::EFormatFbsBitmapColor16M; + encoding = EBitmap; + ResolveCaptureSizes(format, + cameraInfo.iNumImageSizesSupported, + aSize, + sourceSize, + sourceSizeIndex, + largestSizeIndex); + } + + if (sourceSizeIndex == KErrNotFound) + { + // If correct index was not found use the largest. + sourceSizeIndex = largestSizeIndex; + } + } + // else use default iSourceSizeIndex and default image capture format + + iCamera->PrepareImageCaptureL(format, + sourceSizeIndex); + + // play sound when capturing image + CMMACameraSound::PlayImageCaptureSoundL(); + + // start capture, ImageBufferReady will be called when ready + iWindow->SetStarted(EFalse); + + iCamera->CaptureImage(); + + DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: format = 0x%x", format); + DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: sourceSizeIndex = %d", sourceSizeIndex); + DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: encoding = %d", encoding); + + // Inform caller which snapshot encoding was ultimately used + return encoding; +} + +CFbsBitmap* CMMACameraPlayer::SnapshotBitmap() +{ + CFbsBitmap* bitmap = iSnapshotBitmap; + + // ownership transfers to the caller + iSnapshotBitmap = NULL; + return bitmap; +} + +HBufC8* CMMACameraPlayer::SnapshotEncoded() +{ + HBufC8* encoded = iSnapshotEncoded; + + // ownership transfers to the caller + iSnapshotEncoded = NULL; + return encoded; +} + +void CMMACameraPlayer::NotifyWithStringEvent( + CMMAPlayerEvent::TEventType aEventType, + const TDesC& aStringEventData) +{ + PostStringEvent(aEventType, aStringEventData); +} + +MMMASnapshot* CMMACameraPlayer::SnapshoterL() +{ + return this; +} + +TInt CMMACameraPlayer::CameraHandle() +{ + return iCamera->Handle(); +} + +void CMMACameraPlayer::SetViewFinderMode(TBool aStopViewFinder) +{ + iStopViewFinder = aStopViewFinder; +} + +void CMMACameraPlayer::UpdateSensorInfoL() +{ + DEBUG("CMMACameraPlayer::UpdateSensorInfoL +"); + CSensrvChannelFinder* channelFinder; + channelFinder = CSensrvChannelFinder::NewL(); + CleanupStack::PushL(channelFinder); + + //List of found channels. + RSensrvChannelInfoList channelInfoList; + CleanupClosePushL(channelInfoList); + + //Create and fill channel search criteria. + TSensrvChannelInfo channelInfo; + channelInfo.iChannelType = KSensrvChannelTypeIdOrientationData; + //Find the orientation channel + channelFinder->FindChannelsL(channelInfoList, channelInfo); + + if(channelInfoList.Count() != 1) + { + DEBUG("CMMACameraPlayer::UpdateSensorInfoL, Orientation channel not found"); + User::Leave( KErrNotSupported ); + } + else + { + DEBUG("CMMACameraPlayer::UpdateSensorInfoL, Orientation channel found"); + } + + iAccSensorChannel = CSensrvChannel::NewL(channelInfoList[ 0 ]); + CleanupStack::PopAndDestroy(&channelInfoList); + CleanupStack::PopAndDestroy(channelFinder); + + TRAPD(channelerror, iAccSensorChannel->OpenChannelL()); + if (channelerror!=KErrNone) + { + User::Leave( channelerror ); + } + + // start listening + iAccSensorChannel->StartDataListeningL(this, //this object is data listener for this channel + 1, //aDesiredCount is one, i.e. each orientation change is notified separately + 1, //aMaximumCount is one, i.e. object count in receiving data buffer is one + 0);//buffering period is not used + iLastImageOrientation = ECamOrientation0; + DEBUG("CMMACameraPlayer::UpdateSensorInfoL -"); +} + +void CMMACameraPlayer::DataReceived(CSensrvChannel& aChannel, + TInt /*aCount*/, + TInt /*aDataLost*/) +{ + DEBUG_INT("CMMACameraPlayer::DataReceived aChannel %d", aChannel.GetChannelInfo().iChannelType); + + if (KSensrvChannelTypeIdOrientationData == aChannel.GetChannelInfo().iChannelType) + { + TSensrvOrientationData orientationData; + TPckg orientationPackage(orientationData); + aChannel.GetData(orientationPackage); + + iImageOrientation = + MapSensorOrientatio2CamOrientation(orientationData.iDeviceOrientation, + iLastImageOrientation, + iActiveCameraIndex); + + TRAPD(error, iCustomInterfaceOrientation->SetOrientationL(Map2CameraOrientation(iImageOrientation))); + if (KErrNone == error) + { + DEBUG_INT("CMMACameraPlayer::DataReceived SetOrientationL error = %d", error); + } + + iLastImageOrientation = iImageOrientation; + } +} + +void CMMACameraPlayer::DataError(CSensrvChannel& /*aChannel*/, + TSensrvErrorSeverity aError) +{ + DEBUG_INT("MMA::CMMACameraPlayer::DataError: aError = %d", aError); + if ( ESensrvErrorSeverityFatal == aError ) + { + // Delete sensor api object + delete iAccSensorChannel; + iAccSensorChannel = NULL; + + // Set orientation back to default if not already there. + iImageOrientation = ECamOrientation0; + } +} + +void CMMACameraPlayer::GetDataListenerInterfaceL(TUid /*aInterfaceUid*/, + TAny*& /*aInterface*/) +{ +} + +TCamImageOrientation CMMACameraPlayer::MapSensorOrientatio2CamOrientation( + const TSensrvOrientationData::TSensrvDeviceOrientation& aSensorOrientation, + TCamImageOrientation aLastImageOrientation, + TCamActiveCamera aActiveCameraIndex) +{ + DEBUG_INT("MMA::CMMACameraPlayer::MapSensorOrientatio2CamOrientation: aSensorOrientation = %d", + aSensorOrientation); + + TCamImageOrientation cameraOrientation( ECamOrientation0 ); + + // Primary camera rotation + if (aActiveCameraIndex == ECamActiveCameraPrimary) + { + switch(aSensorOrientation) + { + case TSensrvOrientationData::EOrientationDisplayUpwards: + DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayUpwards"); + // If coming from upside down portrait... + if ( ECamOrientation270 == aLastImageOrientation ) + { + // Switch from upside down portrait to normal portrait.") ) + cameraOrientation = ECamOrientation90; // Set normal portrait + } + // If coming from upside down landscape... + else if ( ECamOrientation180 == aLastImageOrientation ) + { + // Switch from upside down landscape to normal landscape...") ) + cameraOrientation = ECamOrientation0; // Set normal lanscape + } + // If neither one, keep the current image orientation. + else + { + cameraOrientation = ECamOrientationIgnore; + } + break; + + case TSensrvOrientationData::EOrientationDisplayDownwards: + DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayDownwards"); + // Camera is pointing up now. Check if it was upside down previously. + // If coming from upside down portrait... + if ( ECamOrientation270 == aLastImageOrientation ) + { + // Switch from upside down portrait to normal portrait...") ) + cameraOrientation = ECamOrientation90; // Set normal portrait + } + // If coming from upside down landscape... + else if ( ECamOrientation180 == aLastImageOrientation ) + { + // Switch from upside down landscape to normal landscape...") ) + cameraOrientation = ECamOrientation0; // Set normal lanscape + } + // If neither one, keep the current image orientation. + else + { + cameraOrientation = ECamOrientationIgnore; + } + break; + case TSensrvOrientationData::EOrientationDisplayRightUp: + DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayRightUp"); + case TSensrvOrientationData::EOrientationUndefined: + DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationUndefined"); + cameraOrientation = ECamOrientation0; + break; + case TSensrvOrientationData::EOrientationDisplayUp: + DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayUp"); + cameraOrientation = ECamOrientation90; + break; + case TSensrvOrientationData::EOrientationDisplayLeftUp: + DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayLeftUp"); + cameraOrientation = ECamOrientation180; + break; + case TSensrvOrientationData::EOrientationDisplayDown: + DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayDown"); + cameraOrientation = ECamOrientation270; + break; + default: + DEBUG("Camera <> Unexpected orientation value"); + break; + } + } + // Secondary camera rotations + else if (aActiveCameraIndex == ECamActiveCameraSecondary) + { + if (aSensorOrientation == TSensrvOrientationData::EOrientationDisplayUp) // Portrait + { + DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation Secondary-camera EOrientationDisplayUp"); + cameraOrientation = ECamOrientation180; + } + else if (aSensorOrientation == TSensrvOrientationData::EOrientationDisplayDown) // Upside down portrait + { + DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation Secondary-camera EOrientationDisplayDown"); + cameraOrientation = ECamOrientation180; + } + else + { + DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation Secondary-camera else"); + cameraOrientation = ECamOrientation0; + } + } + + return cameraOrientation; +} + +MCameraOrientation::TOrientation CMMACameraPlayer::Map2CameraOrientation( + const TCamImageOrientation& aSettingOrientation ) +{ + DEBUG("CMMACameraPlayer::Map2CameraOrientation +"); + switch(aSettingOrientation) + { + case ECamOrientation90: + DEBUG("CMMACameraPlayer::Map2CameraOrientation ECamOrientation90"); + return MCameraOrientation::EOrientation90; + case ECamOrientation180: + DEBUG("CMMACameraPlayer::Map2CameraOrientation ECamOrientation180"); + return MCameraOrientation::EOrientation180; + case ECamOrientation270: + DEBUG("CMMACameraPlayer::Map2CameraOrientation ECamOrientation270"); + return MCameraOrientation::EOrientation270; + case ECamOrientation0: // <> + default: + DEBUG("CMMACameraPlayer::Map2CameraOrientation ECamOrientation0 or default"); + return MCameraOrientation::EOrientation0; + } +} + +// END OF FILE diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src.nga/cmmacameraplayerfactory.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/src.nga/cmmacameraplayerfactory.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,224 @@ +/* +* Copyright (c) 2002-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 is used for creating camera players. +* +*/ + + +// INCLUDE FILES +#include +#include + +#include "cmmacameraplayerfactory.h" +#include "cmmacameraplayer.h" +#include "cmmavideocontrol.h" +#include "cmmavideorecordcontrol.h" +#include "cmmastoptimecontrol.h" +#include "cmmaplayerproperties.h" +#include "cmmammfresolver.h" + +_LIT(KDefaultVideo, "video"); +//is the main camera +_LIT(KDevcamZero, "devcam0"); +// the secondary camera +_LIT(KDevcamOne, "devcam1"); + +_LIT(KEncodingProperty, "encoding"); + +_LIT(KVideoMp4MimeType, "video/mp4"); +_LIT(KVideoH264MimeType, "video/H264"); + +CMMACameraPlayerFactory* CMMACameraPlayerFactory::NewLC() +{ + CMMACameraPlayerFactory* pFactory = + new(ELeave) CMMACameraPlayerFactory(); + CleanupStack::PushL(pFactory); + return pFactory; +} + + +CMMACameraPlayerFactory::CMMACameraPlayerFactory() +{ +} + + +CMMACameraPlayerFactory::~CMMACameraPlayerFactory() +{ + delete iAudioSettings; +} + +CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL( + CMMAMMFResolver* aResolver) +{ + DEBUG("MMA::CMMACameraPlayerFactory::CreatePlayerL( aResolver )+"); + CMMACameraPlayer* player = CMMACameraPlayer::NewLC(iCameraIndex); + + /* Add VideoControl */ + CMMAVideoControl* videoControl = new(ELeave)CMMAVideoControl(player); + + CleanupStack::PushL(videoControl); + player->AddControlL(videoControl); + CleanupStack::Pop(videoControl); + + /* Add RecordControl */ + CMMAVideoRecordControl* videoRecordControl = + CMMAVideoRecordControl::NewL(player, + aResolver, + iVideoSettings, + iAudioSettings, + player->CameraHandle()); + CleanupStack::PushL(videoRecordControl); + player->AddControlL(videoRecordControl); + // ownership transfered to player + CleanupStack::Pop(videoRecordControl); + + // With record control view finder can't be stopped, + // because it can not be restarted. + player->SetViewFinderMode(EFalse); + + CleanupStack::Pop(player); + return player; +} + + +void CMMACameraPlayerFactory::MediaIdsL(RArray& aMediaIds) +{ + CleanupClosePushL(aMediaIds); + User::LeaveIfError(aMediaIds.Append(KUidMediaTypeVideo)); + CleanupStack::Pop(); +} + +void CMMACameraPlayerFactory::PreparePluginSelectionParametersL( + CMMAMMFResolver* aResolver, + CMMFFormatSelectionParameters* aFormatSelection) +{ + // We are creating record type player + aResolver->SetRequiredRecordFormatSupportL(*aFormatSelection); +} + +CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC&) +{ + // record player cannot be created from conten-type, since this is used only + // when we have also data + return NULL; +} + + +CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC8&) +{ + // record player cannot be created with header data + return NULL; +} + +CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL( + const TDesC& aProtocol, + const TDesC& aMiddlePart, + const TDesC& aParameters) +{ + DEBUG_STR("MMA::CMMACameraPlayerFactory::CreatePlayerL aParameters = %S", aParameters); + // check that locator is capture:://audio + if (aProtocol != KMMACaptureProtocol) + { + return NULL; + } + + iCameraIndex = ECamActiveCameraNone; + + // If the device supports multiple cameras then "capture://devcam0" is the + // main camera pointing outwards from the user. "capture://devcam1" is the + // secondary camera pointing e.g. towards the user. "capture://video" is + // the default camera locator pointing to the same camera as "devcam0" + if ((aMiddlePart == KDefaultVideo) || + (aMiddlePart == KDevcamZero)) + { + // First camera + iCameraIndex = ECamActiveCameraPrimary; + } + else if (aMiddlePart == KDevcamOne) + { + // Second camera. + iCameraIndex = ECamActiveCameraSecondary; + } + else + { + // not supported type + return NULL; + } + + CMMAAudioSettings* audioSettings = new(ELeave) CMMAAudioSettings; + audioSettings->iDataType = KMMFFourCCCodeNULL; + delete iAudioSettings; + iAudioSettings = audioSettings; + + if (aParameters.Length() == 0) + { + // getting defaults from validator + iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters); + } + else + { + // we accept either video or mixed parameters, so properties must contain encoding 2 times for mixed and + // 1 time for video. + // making tmp des without first "encoding" + TInt lengthWithoutEncoding = aParameters.Length() - KEncodingProperty().Length(); + if (lengthWithoutEncoding < 0) + { + User::Leave(KErrArgument); + } + TPtrC tmp = aParameters.Right(lengthWithoutEncoding); + // finding second "encoding" + TInt videoPropertiesStartPos = tmp.Find(KEncodingProperty); + if (videoPropertiesStartPos == KErrNotFound) + { + // there is not another encoding, so assuming that there is only video parameters + iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters); + } + else + { + // there is mixed parameters + videoPropertiesStartPos += KEncodingProperty().Length(); + + // skipping '&' char + TPtrC audioProperties = aParameters.Left(videoPropertiesStartPos - 1); + TPtrC videoProperties = aParameters.Mid(videoPropertiesStartPos); + iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(videoProperties); + + CMMAAudioSettings* audioSettings = TMMAParameterValidator::ValidateAudioPropertiesL(audioProperties); + delete iAudioSettings; + iAudioSettings = audioSettings; + } + } + + // if wanted video capture encoding is H264, we must create player with video/mp4 + // because mmf doesn't have controller for H264 + if (iVideoSettings.iEncoding.Compare(KVideoH264MimeType) == 0) + { + return CMMAMMFPlayerFactory::CreatePlayerL(KVideoMp4MimeType); + } + + // Find controller with content-type + return CMMAMMFPlayerFactory::CreatePlayerL(iVideoSettings.iEncoding); +} + +void CMMACameraPlayerFactory::GetSupportedProtocolsL( + const TDesC& aContentType, + CDesC16Array& aProtocolArray) +{ + if (IsSupportedContentTypeL(aContentType)) + { + aProtocolArray.AppendL(KMMACaptureProtocol); + } +} + +// END OF FILE diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src.nga/cmmacamerawindow.cpp --- a/javauis/mmapi_akn/baseline/src.nga/cmmacamerawindow.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/src.nga/cmmacamerawindow.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -385,80 +385,68 @@ // --------------------------------------------------------------------------- -// From class MCameraObserver -// CMMACameraWindow::ReserveComplete +// From class MCameraObserver2 +// CMMACameraWindow::HandleEvent // // --------------------------------------------------------------------------- // -void CMMACameraWindow::ReserveComplete(TInt aError) +void CMMACameraWindow::HandleEvent(const TECAMEvent& aEvent) { - DEBUG_INT("MMA::CMMACameraWindow::ReserveComplete %d", aError); - - if (aError == KErrNone) + TInt error = aEvent.iErrorCode; + if (KUidECamEventReserveComplete == aEvent.iEventType) { - // camera will notify completion with PowerOnComplete method. - iUICamera->PowerOn(); + DEBUG_INT("MMA::CMMACameraPlayer::HandleEvent:KUidECamEventReserveComplete error %d", error); + if (error == KErrNone) + { + // camera will notify completion with PowerOnComplete method. + iUICamera->PowerOn(); + } } -} - - -// --------------------------------------------------------------------------- -// From class MCameraObserver -// CMMACameraWindow::PowerOnComplete -// -// --------------------------------------------------------------------------- -// -void CMMACameraWindow::PowerOnComplete(TInt aError) -{ - DEBUG_INT("MMA::CMMACameraWindow::PowerOnComplete %d", aError); - - if (aError == KErrNone) + else if (KUidECamEventPowerOnComplete == aEvent.iEventType) { - iCameraPowerOn = ETrue; - SetViewFinderVisibility(ETrue); + DEBUG_INT("MMA::CMMACameraPlayer::HandleEvent:KUidECamEventPowerOnComplete error %d", error); + if (error == KErrNone) + { + iCameraPowerOn = ETrue; + SetViewFinderVisibility(ETrue); + } } } // --------------------------------------------------------------------------- -// From class MCameraObserver -// CMMACameraWindow::ViewFinderFrameReady +// From class MCameraObserver2 +// CMMACameraWindow::ViewFinderReady // // --------------------------------------------------------------------------- // -void CMMACameraWindow::ViewFinderFrameReady(CFbsBitmap& /*aFrame*/) +void CMMACameraWindow::ViewFinderReady(MCameraBuffer& /*aCameraBuffer*/, + TInt /*aError*/) { - // Empty implementation of the interface method - DEBUG("MMA::CMMACameraWindow::ViewFinderFrameReady"); } // --------------------------------------------------------------------------- -// From class MCameraObserver -// CMMACameraWindow::ImageReady +// From class MCameraObserver2 +// CMMACameraWindow::ImageBufferReady // // --------------------------------------------------------------------------- // -void CMMACameraWindow::ImageReady(CFbsBitmap* /*aBitmap*/, - HBufC8* /*aData*/, - TInt /*aError*/) +void CMMACameraWindow::ImageBufferReady(MCameraBuffer& /*aCameraBuffer*/, + TInt /*aError*/) { - // Empty implementation of the interface method - DEBUG("MMA::CMMACameraWindow::ImageReady"); } // --------------------------------------------------------------------------- -// From class MCameraObserver -// CMMACameraWindow::FrameBufferReady +// From class MCameraObserver2 +// CMMACameraWindow::VideoBufferReady // // --------------------------------------------------------------------------- // -void CMMACameraWindow::FrameBufferReady(MFrameBuffer* /*aFrameBuffer*/, +void CMMACameraWindow::VideoBufferReady(MCameraBuffer& /*aCameraBuffer*/, TInt /*aError*/) { - // Empty implementation of the interface method - DEBUG("MMA::CMMACameraWindow::FrameBufferReady"); } @@ -533,7 +521,7 @@ if (!iUICamera) { TRAPD(error, iUICamera = - CCamera::NewDuplicateL(*this, iCameraHandle)); + CCamera::NewDuplicate2L(*this, iCameraHandle)); DEBUG_INT( "MMA::CMMACameraWindow::UIStartViewFinder - NewDuplicateL %d", @@ -905,7 +893,7 @@ // void CMMACameraWindow::MdcUICallback(TInt aCallbackId) { - DEBUG("MMA::CMMACameraWindow::MdcUICallback"); + DEBUG_INT("MMA::CMMACameraWindow::MdcUICallback callbackid %d", aCallbackId); switch (aCallbackId) { diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src.nga/cmmasnapshot.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/src.nga/cmmasnapshot.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,277 @@ +/* +* Copyright (c) 2002-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 takes snapshot and resizes bitmap if needed. +* +*/ + + +// INCLUDE FILES +#include + +#include "cmmasnapshot.h" +#include "mmmaguiplayer.h" +#include "mmmasnapshotreadycallback.h" +#include "mmmasnapshot.h" + +// CONSTANTS +const TInt KIgnoreSize = -1; + + +// CONSTRUCTION +CMMASnapshot* CMMASnapshot::NewL(MMMAGuiPlayer* aGuiPlayer, + MMMASnapshotReadyCallback& aCallBack) +{ + CMMASnapshot* self = new(ELeave) CMMASnapshot(aGuiPlayer, + aCallBack); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); // self + return self; +} + +CMMASnapshot::~CMMASnapshot() +{ + if (iScaler) + { + iScaler->Cancel(); + delete iScaler; + } + if (iEncoder) + { + iEncoder->Cancel(); + delete iEncoder; + } + delete iBitmap; + delete iBuffer; + delete iSettings; +} + +void CMMASnapshot::ConstructL() +{ + CActiveScheduler::Add(this); + iScaler = CBitmapScaler::NewL(); +} + +CMMASnapshot::CMMASnapshot(MMMAGuiPlayer* aGuiPlayer, + MMMASnapshotReadyCallback& aCallBack): + CActive(EPriorityStandard), + iEncoding(MMMASnapshot::EBitmap), + iCallBack(aCallBack), + iState(EIdle) +{ + iGUIPlayer = aGuiPlayer; +} + +void CMMASnapshot::TakeSnapShotL(const TDesC& aProperties) +{ + // snapshot sequence is not finished + __ASSERT_DEBUG(iState == EIdle, User::Invariant()); + // image buffer must be taken with ImageBuffer before taking new snapshot + __ASSERT_DEBUG(iBuffer == NULL, User::Invariant()); + + CMMAImageSettings* settings + = TMMAParameterValidator::ValidateImagePropertiesL(aProperties); + CleanupStack::PushL(settings); + + delete iSettings; + CleanupStack::Pop(settings); + iSettings = settings; + + // take snapshot from player. RunL is called when image is ready + // or error occures + iState = ETakingSnapshot; + TSize snapshotSize(iSettings->iWidth, iSettings->iHeight); + iEncoding = iGUIPlayer->SnapshoterL()->TakeSnapshotL(&iStatus, + snapshotSize, + *iSettings); + SetActive(); +} + +HBufC8* CMMASnapshot::ImageBuffer() +{ + // this must not be called when snapshot sequence is running + __ASSERT_DEBUG(iState == EIdle, User::Invariant()); + HBufC8* buffer = iBuffer; + // caller takes ownership of the buffer + iBuffer = NULL; + return buffer; +} + +void CMMASnapshot::ResizeL() +{ + iState = EResizing; + TSize imageSize(iBitmap->SizeInPixels()); + if (iSettings->iWidth != KIgnoreSize) + { + imageSize.iWidth = iSettings->iWidth; + } + if (iSettings->iHeight != KIgnoreSize) + { + imageSize.iHeight = iSettings->iHeight; + } + if (imageSize == iBitmap->SizeInPixels()) + { + // no user resizing needed, continue sequence + EncodeL(); + } + else + { + if(iScalingFactor) + { + iScalingFactor = EFalse; + iScaler->Scale(&iStatus, *iBitmap, imageSize, EFalse); + } + else + { + iScaler->Scale(&iStatus, *iBitmap, imageSize, ETrue); + } + SetActive(); + } +} + +void CMMASnapshot::EncodeL() +{ + // CImageEncoder cannot be reused, so have to make it every time + CImageEncoder* encoder = CImageEncoder::DataNewL(iBuffer, *iSettings->iMimeType); + delete iEncoder; + iEncoder = encoder; + + iState = EEncoding; + iEncoder->Convert(&iStatus, *iBitmap, iSettings->iImageData); + SetActive(); +} + +void CMMASnapshot::Completed(TInt aError) +{ + iStatus = aError; + iCallBack.SnapshotReady(); +} + +void CMMASnapshot::RunL() +{ + if (iStatus != KErrNone) + { + // Error has occured, inform java side and change state + iState = EIdle; + Completed(iStatus.Int()); + return; + } + + switch (iState) + { + case ETakingSnapshot: + { + DEBUG_INT("MMA::CMMASnapshot::RunL: iEncoding = %d", iEncoding); + if (iEncoding == MMMASnapshot::EEncoded) + { + // take encoded image from player. + // Ownership transfers to this class. + iBuffer = iGUIPlayer->SnapshoterL()->SnapshotEncoded(); + if (!iBuffer) + { + // error has occured with taking image + Completed(KErrNotFound); + } + // Image is ready, update internal state and inform listener + // Encoded images are not resized + iState = EIdle; + Completed(KErrNone); + } + else + { + // take bitmap from player. + // Ownership transfers to this class. + iBitmap = iGUIPlayer->SnapshoterL()->SnapshotBitmap(); + if (!iBitmap) + { + // error has occured with taking image + Completed(KErrNotFound); + } + else + { + TInt nativeArea = iBitmap->SizeInPixels().iWidth * iBitmap->SizeInPixels().iHeight; + TInt requestArea = iSettings->iWidth * iSettings->iHeight; + if(requestArea < nativeArea && (((TReal)iSettings->iWidth/iSettings->iHeight != (4.0/3.0)) && ((TReal)iSettings->iWidth/iSettings->iHeight != (16.0/9.0)))) + { + DEBUG_INT2("CMMASnapshot::EncodeL() nativeBitmap->iWidth = %d, nativeBitmap->iHeight %d",iBitmap->SizeInPixels().iWidth,iBitmap->SizeInPixels().iHeight); + if(iBitmap) + { + iBitmap->Resize(TSize(iSettings->iWidth,iSettings->iHeight)); + } + } + else if(requestArea > nativeArea && (((TReal)iSettings->iWidth/iSettings->iHeight != (4.0/3.0)))) + { + if(iBitmap) + { + iScalingFactor = ETrue; + } + } + } + // Continue to next statecd + ResizeL(); + } + break; + } + case EResizing: + { + // Continue to next state + EncodeL(); + break; + } + case EEncoding: + { + delete iEncoder; + iEncoder = NULL; + + delete iBitmap; + iBitmap = NULL; + + iState = EIdle; + // encoding is ready, inform listener + Completed(KErrNone); + break; + } + default: + { + // unknown state + __ASSERT_DEBUG(EFalse, User::Invariant()); + } + } +} + +TInt CMMASnapshot::RunError(TInt aError) +{ + // Reset state + iState = EIdle; + // Pass error code to observer + Completed(aError); + + return KErrNone; +} + +void CMMASnapshot::DoCancel() +{ + // snapshot taking cannot be cancelled + if (iScaler) + { + iScaler->Cancel(); + } + if (iEncoder) + { + iEncoder->Cancel(); + } + iState = EIdle; +} + +// END OF FILE diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src.nga/cmmasurfacewindow.cpp --- a/javauis/mmapi_akn/baseline/src.nga/cmmasurfacewindow.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/src.nga/cmmasurfacewindow.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -667,7 +667,7 @@ DEBUG("MID::CMMASurfaceWindow::CleanVideoDisplay -"); } -void CMMASurfaceWindow::SetAVCableConnStatus(TBool aStatus) +EXPORT_C void CMMASurfaceWindow::SetAVCableConnStatus(TBool aStatus) { iAVCableConnected = aStatus; if (iDisplay && !iAVCableConnected) diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src.nga/cmmavideoplayer.cpp --- a/javauis/mmapi_akn/baseline/src.nga/cmmavideoplayer.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/src.nga/cmmavideoplayer.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -83,7 +83,8 @@ CMMAAudioPlayer(aResolver), iVideoControllerCustomCommands(iController), iVideoPlayControllerCustomCommands(iController), - iVideoPlaySurfaceSupportCustomCommands(iController) + iVideoPlaySurfaceSupportCustomCommands(iController), + isHDMICableConnected(EFalse) { iMMASurface.iPrevSurfaceAvailable = EFalse; } @@ -248,12 +249,21 @@ if ((aEvent.iEventType == KMMFEventCategoryVideoPlayerGeneralError) && (aEvent.iErrorCode == KMMVideoBlitError)) { - TRAPD(error, StartL(EFalse)); - if (KErrNone != error) - { - DEBUG_INT("MMA:CMMAVideoPlayer::HandleEvent, StartL() error %d", error); - } - return; + // incase of HDMI cable is inserted, start the player again before ignoring the error otherwise simply ignore + if(isHDMICableConnected) + { + TRAPD(error, StartL(EFalse)); + if (KErrNone != error) + { + DEBUG_INT("MMA:CMMAVideoPlayer::HandleEvent, StartL() error %d", + error); + } + return; + } + else // no HDMI cable is inserted, Hence ignore the error. + { + return; + } } // KNotCompleteVideoError can be notified when video is not complete @@ -569,6 +579,7 @@ DEBUG_INT("MID::CMMAVideoPlayer::ConnectedL %d", deviceType); if (iSurfaceWindow && (deviceType == KAccMonAVDevice)) { + isHDMICableConnected = ETrue; iSurfaceWindow->SetAVCableConnStatus(ETrue); } } @@ -579,6 +590,7 @@ DEBUG_INT("MID::CMMAVideoPlayer::DisconnectedL %d", deviceType); if (iSurfaceWindow && (deviceType == KAccMonAVDevice)) { + isHDMICableConnected = EFalse; iSurfaceWindow->SetAVCableConnStatus(EFalse); } } diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/cmmaaudiorecorder.cpp --- a/javauis/mmapi_akn/baseline/src/cmmaaudiorecorder.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/src/cmmaaudiorecorder.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "cmmaaudiorecorder.h" #include "cmmaoutputstream.h" diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/cmmacallstatemonitor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/mmapi_akn/baseline/src/cmmacallstatemonitor.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,112 @@ +/* +* 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: Publish and Subscribe key watcher +* +*/ + + +#include +#include "cmmacallstatemonitor.h" +#include "mmmacallstateobserver.h" + +// --------------------------------------------------------------------------- +// Default Constructor +// --------------------------------------------------------------------------- +// +CMMACallStateMonitor::CMMACallStateMonitor( TUid aUid, TInt aKey, + MMMACallStateObserver* aObserver ) : + CActive( EPriorityHigh ), + iObserver( aObserver ), + iUid( aUid ), + iKey( aKey ) + + { + } + + +// --------------------------------------------------------------------------- +// 2nd phased Constructor +// --------------------------------------------------------------------------- +// +void CMMACallStateMonitor::ConstructL() + { + CActiveScheduler::Add(this); + + iProperty.Attach( iUid, iKey ); + iProperty.Subscribe( iStatus ); + SetActive(); + } + + +// --------------------------------------------------------------------------- +// Two-Phased COnstructor +// --------------------------------------------------------------------------- +// +CMMACallStateMonitor* CMMACallStateMonitor::NewL( TUid aUid, TInt aKey, + MMMACallStateObserver* aObserver ) + { + CMMACallStateMonitor* self = new(ELeave) CMMACallStateMonitor( aUid, + aKey, + aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CMMACallStateMonitor::~CMMACallStateMonitor() + { + Cancel(); // Cancels waiting request + iProperty.Close(); + } + +// --------------------------------------------------------------------------- +// CMMAPSKeyWatcher::RunL +// --------------------------------------------------------------------------- +// +void CMMACallStateMonitor::RunL() + { + iProperty.Subscribe( iStatus ); + SetActive(); + + // Notify Observer and start watching again + if( iObserver ) + { + iObserver->HandleCallStateEventL( iUid, iKey ); + } + } + +// --------------------------------------------------------------------------- +// CMMAPSKeyWatcher::DoCancel +// --------------------------------------------------------------------------- +// +void CMMACallStateMonitor::DoCancel() + { + iProperty.Cancel(); + } + +// --------------------------------------------------------------------------- +// CMMAPSKeyWatcher::GetValue +// --------------------------------------------------------------------------- +// +TInt CMMACallStateMonitor::GetValue( TInt& aValue ) + { + return iProperty.Get( aValue ); + } + diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/cmmacameraplayer.cpp --- a/javauis/mmapi_akn/baseline/src/cmmacameraplayer.cpp Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,671 +0,0 @@ -/* -* Copyright (c) 2002-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 class is used for playing camera. -* -*/ - - -// INCLUDE FILES -#include -#include -#include "cmmacameraplayer.h" -#include "tmmaparametervalidator.h" -#include "mmmadisplay.h" -#include "cmmacamerasound.h" - -#if defined( __WINS__ ) -#include -#endif - -// CONSTANTS -_LIT8(KImageJpegMime, "image/jpeg"); -_LIT8(KJpegMime, "jpeg"); -_LIT(KVideoControlName, "VideoControl"); - -CMMACameraPlayer* CMMACameraPlayer::NewLC(TInt aCameraIndex) -{ - CMMACameraPlayer* self = new(ELeave) CMMACameraPlayer; - CleanupStack::PushL(self); - self->ConstructL(aCameraIndex); - return self; -} - -CMMACameraPlayer::~CMMACameraPlayer() -{ - DEBUG("CMMACameraPlayer::~CMMACameraPlayer"); - - // Free (duplicated) UI camera resources first. - // Window is not able to send any - // callback requests to UI from now. - if (iWindow) - { - iWindow->SetDisplay(NULL); - } - - if (iCamera) - { - iCamera->CancelCaptureImage(); - iCamera->Release(); - delete iCamera; - } - - delete iSnapshotEncoded; - delete iSnapshotBitmap; - delete iRealizeWait; - - if (iDisplay && iDisplay->HasContainer()) - { - // Window will delete itself - // after all pending events are processed - // (lazy delete) - iDisplay->UIGetCallback( - *iWindow, CMMACameraWindow::EDestroyWindow); - } - else - { - delete iWindow; - } - iWindow = NULL; -} - - -CMMACameraPlayer::CMMACameraPlayer(): - iDisplay(NULL), - iSourceSizeIndex(KErrNotFound), - iStartTime(KErrNotFound) -{ - iStopViewFinder = ETrue; -} - - -void CMMACameraPlayer::ConstructL(TInt aCameraIndex) -{ - CMMAPlayer::ConstructL(); - - if (aCameraIndex >= CCamera::CamerasAvailable()) - { - // image capture is not supported - User::Leave(KErrNotFound); - } - - iCamera = CCamera::NewL(*this, aCameraIndex); - - iWindow = CMMACameraWindow::NewL(iCamera->Handle()); - - TCameraInfo cameraInfo; - iCamera->CameraInfo(cameraInfo); - - if (cameraInfo.iNumImageSizesSupported < 1) - { - // image capture is not supported - User::Leave(KErrNotFound); - } - - // default snapshot size - iSourceSizeIndex = cameraInfo.iNumImageSizesSupported - 1; - - iRealizeWait = new(ELeave)CRealizeWait; -} - -TInt64 CMMACameraPlayer::CurrentTime() -{ - TTime time; - time.HomeTime(); - return time.Int64(); -} - -void CMMACameraPlayer::ResolveViewFinderSizeL(TSize& aSize) -{ - DEBUG("CMMACameraPlayer::ResolveViewFinderSizeL"); - - TSize resultSize; - - // The only way to find out the size is to start the view finder - // with a proper size (screen size). - - ResolveScreenSizeL(resultSize); - - // StartViewFinderBitmapsL changes resultSize to - // the used view finder size. - // Used to get the source size only. - iCamera->StartViewFinderBitmapsL(resultSize); - - // Bitmap viewfinder is not used anymore. - iCamera->StopViewFinder(); - - aSize = resultSize; -} - -void CMMACameraPlayer::ResolveScreenSizeL(TSize& aSize) -{ - DEBUG("CMMACameraPlayer::ResolveScreenSizeL"); - -#if defined( __WINS__ ) - TSize size(0,0); - RWsSession ws; - - if (ws.Connect() == KErrNone) - { - CleanupClosePushL(ws); - - CWsScreenDevice* wsScreenDevice = new(ELeave)CWsScreenDevice(ws); - CleanupStack::PushL(wsScreenDevice); - - User::LeaveIfError(wsScreenDevice->Construct()); - - size = wsScreenDevice->SizeInPixels(); - - CleanupStack::PopAndDestroy(2); // wsScreenDevice, ws.Close() - } - - aSize = size; - -#else - TScreenInfoV01 info; - TPckgBuf< TScreenInfoV01 > buf(info); - - UserSvr::ScreenInfo(buf); - info = buf(); - - aSize = info.iScreenSize; -#endif -} - -void CMMACameraPlayer::ResolveCaptureSizes(const CCamera::TFormat aFormat, - const TInt aNumImageSizesSupported, - const TSize& aRequestSize, - TSize& aSourceSize, - TInt& aSourceIndex, - TInt& aLargestIndex) -{ - // Largest image size - TSize largestSize; - // Index to largest image size - TInt largestSizeIndex = 0; - // Source size - TSize sourceSize; - // Default source size index not set - TInt sourceSizeIndex = KErrNotFound; - // Temporary size for iterating capture sizes - TSize tmpSize; - - DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: aFormat = 0x%x", aFormat); - - // go through all supported sizes. - // Notice: Capture sizes are assumed to be in order from smaller to larger sizes - for (TInt i = 0; i < aNumImageSizesSupported; i++) - { - iCamera->EnumerateCaptureSizes(tmpSize, - i, - aFormat); - - DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iWidth = %d", tmpSize.iWidth); - DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iHeight = %d", tmpSize.iHeight); - - // Check if current is the largest - if ((largestSize.iWidth < tmpSize.iWidth) && - (largestSize.iHeight < tmpSize.iHeight)) - { - largestSize = tmpSize; - largestSizeIndex = i; - } - - // If wanted size is smaller than tmpSize we can use it - if ((aRequestSize.iWidth <= tmpSize.iWidth) && - (aRequestSize.iHeight <= tmpSize.iHeight)) - { - sourceSize = tmpSize; - sourceSizeIndex = i; - } - } - - DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: sourceSizeIndex = %d", sourceSizeIndex); - DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: largestSizeIndex = %d", largestSizeIndex); - - aSourceSize = sourceSize; - aSourceIndex = sourceSizeIndex; - aLargestIndex = largestSizeIndex; -} - -void CMMACameraPlayer::StartL(TBool aPostEvent) -{ - DEBUG_INT("CMMACameraPlayer:StartL iState %d", iState); - - // start can't be called to not ready player - if (iState == EPrefetched) - { - // camera passes ready images through - // ViewFinderFrameReady method - - // set time when started - iStartTime = CurrentTime(); - - // inform java side - ChangeState(EStarted); - - TInt64 time; - GetMediaTime(&time); - - // Notify the camera window - // about the status change - iWindow->SetStarted(ETrue); - - if (aPostEvent) - { - // inform java side - PostLongEvent(CMMAPlayerEvent::EStarted, time); - } - } - PostActionCompleted(KErrNone); // java start return -} - -void CMMACameraPlayer::StopL(TBool aPostEvent) -{ - DEBUG_INT("CMMACameraPlayer::StopL", iState); - if (iState == EStarted) - { - TInt64 time; - GetMediaTime(&time); // add played time to media time - - if (iStopViewFinder && iWindow->ViewFinderActive()) - { - iWindow->SetStarted(EFalse); - } - iStartTime = KErrNotFound; - - if (aPostEvent) - { - PostLongEvent(CMMAPlayerEvent::EStopped, time); - } - - // go back to prefetched state - ChangeState(EPrefetched); - } -} - -void CMMACameraPlayer::DeallocateL() -{ - // If player is started when deallocate is called, - // player is stopped from java side -> state is changed to - // prefetched. - // In prefetched state only reserved resource is - // camera reserve( released with iCamera->Release() ) - // In realized state no resources have been reserved. - // CHANGED: not releasing camera anymore, since it is already - // done in realized state - if (iState == EPrefetched) - { - ChangeState(ERealized); - } -} - - -void CMMACameraPlayer::RealizeL() -{ - iCamera->Reserve(); - // this lock will be released when power on is completed (or error) - if (!iRealizeWait->IsStarted()) - { - iRealizeWait->Start(); - } - User::LeaveIfError(iRealizeWait->iError); - CMMAPlayer::RealizeL(); -} - - -void CMMACameraPlayer::PrefetchL() -{ - DEBUG("MMA::CMMACameraPlayer::PrefetchL"); - // nothing to do here - ChangeState(EPrefetched); - PostActionCompleted(KErrNone); -} - - -void CMMACameraPlayer::GetDuration(TInt64* aDuration) -{ - // camera viewer has no duration. - *aDuration = KTimeUnknown; -} - - -void CMMACameraPlayer::SetMediaTimeL(TInt64* /*aTime*/) -{ - DEBUG("MMA::CMMACameraPlayer::SetMediaTimeL "); - // with camera media time is not supported. -} - - -void CMMACameraPlayer::GetMediaTime(TInt64* aMediaTime) -{ - if (iState == EStarted) - { - // add play time to media time - iMediaTime += CurrentTime() - iStartTime; - // set new start time - iStartTime = CurrentTime(); - } - - // set value to parameter - (*aMediaTime) = iMediaTime; -} - -void CMMACameraPlayer::CloseL() -{ - DEBUG("MMA::CMMACameraPlayer::CloseL()"); - - // cancel all activity - iCamera->CancelCaptureImage(); - - // Stop and release UI Camera instance - iWindow->SetDisplay(NULL); - - // we don't need reserve camera anymore - iCamera->Release(); - - CMMAPlayer::CloseL(); -} - -const TDesC& CMMACameraPlayer::Type() -{ - return KMMACameraPlayer; -} - -// MCameraObserver -void CMMACameraPlayer::ReserveComplete(TInt aError) -{ - DEBUG_INT("MMA::CMMACameraPlayer::ReserveComplete %d", aError); - if (aError == KErrNone) - { - // camera will notify completion with PowerOnComplete method. - iCamera->PowerOn(); - } - else - { - // release lock and store error. State doesn't change. - iRealizeWait->iError = aError; - iRealizeWait->AsyncStop(); - } - -} - -void CMMACameraPlayer::PowerOnComplete(TInt aError) -{ - DEBUG_INT("MMA::CMMACameraPlayer::PowerOnComplete %d", aError); - - TSize viewFinderSize; - TInt error = aError; - - if (error == KErrNone) - { - // The view finder size must be known after prefetching. - TRAP(error, ResolveViewFinderSizeL(viewFinderSize)); - } - - if (error == KErrNone) - { - iSize = viewFinderSize; - - if (iDisplay) - { - iDisplay->SourceSizeChanged(iSize); - NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName); - } - } - - iRealizeWait->iError = error; - iRealizeWait->AsyncStop(); -} - -void CMMACameraPlayer::ViewFinderFrameReady(CFbsBitmap& /*aFrame*/) -{ - // Empty implementation of an interface method. - // DirectViewFinder is used - // instead of BitmapViewFinder -} - -void CMMACameraPlayer::ImageReady(CFbsBitmap* aBitmap, - HBufC8* aData, - TInt aError) -{ - DEBUG_INT("MMA::CMMACameraPlayer::ImageReady %d", aError); - - // This method should never be called, - // unless we are taking snapshot - __ASSERT_DEBUG(iSnapshotStatus, User::Invariant()); - - __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant()); - __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant()); - - if (aError == KErrNone) - { - // this class has ownership of the bitmap until - // snapshot bitmap is got from this class. - iSnapshotBitmap = aBitmap; - iSnapshotEncoded = aData; - } - - // notify the caller, error code or KErrNone - User::RequestComplete(iSnapshotStatus, aError); - iWindow->SetStarted(ETrue); - // Status is not needed anymore - // and this class don't own the status. - iSnapshotStatus = NULL; -} - -void CMMACameraPlayer::FrameBufferReady(MFrameBuffer* /*aFrameBuffer*/, - TInt /*aError*/) -{ - DEBUG("MMA::CMMACameraPlayer::FrameBufferReady"); - // this callback will never be called - // Asserted in debug build to be sure. - __ASSERT_DEBUG(EFalse, User::Invariant()); -} - -void CMMACameraPlayer::SetDisplayL(MMMADisplay* aDisplay) -{ - DEBUG("MMA::CMMACameraPlayer::SetDisplay"); - - // now it is ready to draw - iDisplay = aDisplay; - - // Passes display into iWindow. - // Allocates all resources needed to use a camera DirectViewFinder. - iWindow->SetDisplay(aDisplay); - - iDisplay->SetWindowL(iWindow); - - // Set view finder size to the display only if the view finder - // size has been resolved. - if (iSize != TSize(0, 0)) - { - iDisplay->SourceSizeChanged(iSize); - NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName); - } -} - -TSize CMMACameraPlayer::SourceSize() -{ - return iSize; -} - -MMMASnapshot::TEncoding CMMACameraPlayer::TakeSnapshotL(TRequestStatus* aStatus, - const TSize& aSize, - const CMMAImageSettings& aSettings) -{ - __ASSERT_DEBUG(!iSnapshotStatus, User::Invariant()); - __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant()); - __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant()); - - // snapshots can not be taken if player is not realized - if (iState < ERealized) - { - User::Leave(KErrNotReady); - } - // save status which will be notified - iSnapshotStatus = aStatus; - - // changing status to pending - *iSnapshotStatus = KRequestPending; - - // Source size not set in the beginning - TSize sourceSize; - - // Use default if size is not specified. - TInt sourceSizeIndex = iSourceSizeIndex; - - // Largest image size index - TInt largestSizeIndex = 0; - - // Get camera characteristics - TCameraInfo cameraInfo; - iCamera->CameraInfo(cameraInfo); - - // Set default snapshot encoding type - TEncoding encoding = EBitmap; - - // Set default image capture format - CCamera::TFormat format = CCamera::EFormatFbsBitmapColor16M; - - DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iImageFormatsSupported = 0x%x", cameraInfo.iImageFormatsSupported); - DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iNumImageSizesSupported = %d", cameraInfo.iNumImageSizesSupported); - - // Check if size was set in Java - if (aSize.iWidth != KErrNotFound && - aSize.iHeight != KErrNotFound) - { - // Determine if jpeg capture was requested - if ((*aSettings.iMimeType == KJpegMime) || - (*aSettings.iMimeType == KImageJpegMime)) - { - // Shortcut for supported image formats - TUint32 imageFormats = cameraInfo.iImageFormatsSupported; - - // Jpeg subtype constants - _LIT8(KJpegJfif, "jfif"); - _LIT8(KJpegExif, "exif"); - - // Resolve requested jpeg subtype from settings and camerainfo - if ((imageFormats & CCamera::EFormatJpeg) && - (*aSettings.iType == KJpegJfif)) - { - // JFIF JPEG - format = CCamera::EFormatJpeg; - encoding = EEncoded; - } - else if ((imageFormats & CCamera::EFormatExif) && - (*aSettings.iType == KJpegExif)) - { - // EXIF JPEG - format = CCamera::EFormatExif; - encoding = EEncoded; - } - } - - // Try to resolve nearest source size to the one requested, - // except for the JFIF and EXIF jpeg subtypes the match has - // to be exact otherwise non-encode capture format will be - // used - ResolveCaptureSizes(format, - cameraInfo.iNumImageSizesSupported, - aSize, - sourceSize, - sourceSizeIndex, - largestSizeIndex); - - // Format was either of the jpeg formats and requested size - // didn't match the source size - if ((format >= CCamera::EFormatJpeg && - format <= CCamera::EFormatExif) && - (aSize != sourceSize)) - { - // Try again with an non-encoded format - format = CCamera::EFormatFbsBitmapColor16M; - encoding = EBitmap; - ResolveCaptureSizes(format, - cameraInfo.iNumImageSizesSupported, - aSize, - sourceSize, - sourceSizeIndex, - largestSizeIndex); - } - - if (sourceSizeIndex == KErrNotFound) - { - // If correct index was not found use the largest. - sourceSizeIndex = largestSizeIndex; - } - } - // else use default iSourceSizeIndex and default image capture format - - iCamera->PrepareImageCaptureL(format, - sourceSizeIndex); - - // play sound when capturing image - CMMACameraSound::PlayImageCaptureSoundL(); - - // start capture, ImageReady will be called when ready - iWindow->SetStarted(EFalse); - - iCamera->CaptureImage(); - - DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: format = 0x%x", format); - DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: sourceSizeIndex = %d", sourceSizeIndex); - DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: encoding = %d", encoding); - - // Inform caller which snapshot encoding was ultimately used - return encoding; -} - -CFbsBitmap* CMMACameraPlayer::SnapshotBitmap() -{ - CFbsBitmap* bitmap = iSnapshotBitmap; - - // ownership transfers to the caller - iSnapshotBitmap = NULL; - return bitmap; -} - -HBufC8* CMMACameraPlayer::SnapshotEncoded() -{ - HBufC8* encoded = iSnapshotEncoded; - - // ownership transfers to the caller - iSnapshotEncoded = NULL; - return encoded; -} - -void CMMACameraPlayer::NotifyWithStringEvent( - CMMAPlayerEvent::TEventType aEventType, - const TDesC& aStringEventData) -{ - PostStringEvent(aEventType, aStringEventData); -} - -MMMASnapshot* CMMACameraPlayer::SnapshoterL() -{ - return this; -} - -TInt CMMACameraPlayer::CameraHandle() -{ - return iCamera->Handle(); -} - -void CMMACameraPlayer::SetViewFinderMode(TBool aStopViewFinder) -{ - iStopViewFinder = aStopViewFinder; -} - -// END OF FILE diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/cmmacameraplayerfactory.cpp --- a/javauis/mmapi_akn/baseline/src/cmmacameraplayerfactory.cpp Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,224 +0,0 @@ -/* -* Copyright (c) 2002-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 is used for creating camera players. -* -*/ - - -// INCLUDE FILES -#include -#include - -#include "cmmacameraplayerfactory.h" -#include "cmmacameraplayer.h" -#include "cmmavideocontrol.h" -#include "cmmavideorecordcontrol.h" -#include "cmmastoptimecontrol.h" -#include "cmmaplayerproperties.h" -#include "cmmammfresolver.h" - -_LIT(KDefaultVideo, "video"); -//is the main camera -_LIT(KDevcamZero, "devcam0"); -// the secondary camera -_LIT(KDevcamOne, "devcam1"); - -_LIT(KEncodingProperty, "encoding"); - -_LIT(KVideoMp4MimeType, "video/mp4"); -_LIT(KVideoH264MimeType, "video/H264"); - -CMMACameraPlayerFactory* CMMACameraPlayerFactory::NewLC() -{ - CMMACameraPlayerFactory* pFactory = - new(ELeave) CMMACameraPlayerFactory(); - CleanupStack::PushL(pFactory); - return pFactory; -} - - -CMMACameraPlayerFactory::CMMACameraPlayerFactory() -{ -} - - -CMMACameraPlayerFactory::~CMMACameraPlayerFactory() -{ - delete iAudioSettings; -} - -CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL( - CMMAMMFResolver* aResolver) -{ - DEBUG("MMA::CMMACameraPlayerFactory::CreatePlayerL( aResolver )+"); - CMMACameraPlayer* player = CMMACameraPlayer::NewLC(iCameraIndex); - - /* Add VideoControl */ - CMMAVideoControl* videoControl = new(ELeave)CMMAVideoControl(player); - - CleanupStack::PushL(videoControl); - player->AddControlL(videoControl); - CleanupStack::Pop(videoControl); - - /* Add RecordControl */ - CMMAVideoRecordControl* videoRecordControl = - CMMAVideoRecordControl::NewL(player, - aResolver, - iVideoSettings, - iAudioSettings, - player->CameraHandle()); - CleanupStack::PushL(videoRecordControl); - player->AddControlL(videoRecordControl); - // ownership transfered to player - CleanupStack::Pop(videoRecordControl); - - // With record control view finder can't be stopped, - // because it can not be restarted. - player->SetViewFinderMode(EFalse); - - CleanupStack::Pop(player); - return player; -} - - -void CMMACameraPlayerFactory::MediaIdsL(RArray& aMediaIds) -{ - CleanupClosePushL(aMediaIds); - User::LeaveIfError(aMediaIds.Append(KUidMediaTypeVideo)); - CleanupStack::Pop(); -} - -void CMMACameraPlayerFactory::PreparePluginSelectionParametersL( - CMMAMMFResolver* aResolver, - CMMFFormatSelectionParameters* aFormatSelection) -{ - // We are creating record type player - aResolver->SetRequiredRecordFormatSupportL(*aFormatSelection); -} - -CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC&) -{ - // record player cannot be created from conten-type, since this is used only - // when we have also data - return NULL; -} - - -CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC8&) -{ - // record player cannot be created with header data - return NULL; -} - -CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL( - const TDesC& aProtocol, - const TDesC& aMiddlePart, - const TDesC& aParameters) -{ - DEBUG_STR("MMA::CMMACameraPlayerFactory::CreatePlayerL aParameters = %S", aParameters); - // check that locator is capture:://audio - if (aProtocol != KMMACaptureProtocol) - { - return NULL; - } - - iCameraIndex = KErrNotFound; - - // If the device supports multiple cameras then "capture://devcam0" is the - // main camera pointing outwards from the user. "capture://devcam1" is the - // secondary camera pointing e.g. towards the user. "capture://video" is - // the default camera locator pointing to the same camera as "devcam0" - if ((aMiddlePart == KDefaultVideo) || - (aMiddlePart == KDevcamZero)) - { - // First camera - iCameraIndex = 0; - } - else if (aMiddlePart == KDevcamOne) - { - // Second camera. - iCameraIndex = 1; - } - else - { - // not supported type - return NULL; - } - - CMMAAudioSettings* audioSettings = new(ELeave) CMMAAudioSettings; - audioSettings->iDataType = KMMFFourCCCodeNULL; - delete iAudioSettings; - iAudioSettings = audioSettings; - - if (aParameters.Length() == 0) - { - // getting defaults from validator - iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters); - } - else - { - // we accept either video or mixed parameters, so properties must contain encoding 2 times for mixed and - // 1 time for video. - // making tmp des without first "encoding" - TInt lengthWithoutEncoding = aParameters.Length() - KEncodingProperty().Length(); - if (lengthWithoutEncoding < 0) - { - User::Leave(KErrArgument); - } - TPtrC tmp = aParameters.Right(lengthWithoutEncoding); - // finding second "encoding" - TInt videoPropertiesStartPos = tmp.Find(KEncodingProperty); - if (videoPropertiesStartPos == KErrNotFound) - { - // there is not another encoding, so assuming that there is only video parameters - iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters); - } - else - { - // there is mixed parameters - videoPropertiesStartPos += KEncodingProperty().Length(); - - // skipping '&' char - TPtrC audioProperties = aParameters.Left(videoPropertiesStartPos - 1); - TPtrC videoProperties = aParameters.Mid(videoPropertiesStartPos); - iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(videoProperties); - - CMMAAudioSettings* audioSettings = TMMAParameterValidator::ValidateAudioPropertiesL(audioProperties); - delete iAudioSettings; - iAudioSettings = audioSettings; - } - } - - // if wanted video capture encoding is H264, we must create player with video/mp4 - // because mmf doesn't have controller for H264 - if (iVideoSettings.iEncoding.Compare(KVideoH264MimeType) == 0) - { - return CMMAMMFPlayerFactory::CreatePlayerL(KVideoMp4MimeType); - } - - // Find controller with content-type - return CMMAMMFPlayerFactory::CreatePlayerL(iVideoSettings.iEncoding); -} - -void CMMACameraPlayerFactory::GetSupportedProtocolsL( - const TDesC& aContentType, - CDesC16Array& aProtocolArray) -{ - if (IsSupportedContentTypeL(aContentType)) - { - aProtocolArray.AppendL(KMMACaptureProtocol); - } -} - -// END OF FILE diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/cmmadisplay.cpp --- a/javauis/mmapi_akn/baseline/src/cmmadisplay.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/src/cmmadisplay.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -455,4 +455,12 @@ } } +void CMMADisplay::FixUIOrientation(TBool aFix) +{ + if (iDirectContainer) + { + iDirectContainer->MdcFixUIOrientation(aFix); + } +} + // END OF FILE diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/cmmammfplayerbase.cpp --- a/javauis/mmapi_akn/baseline/src/cmmammfplayerbase.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/src/cmmammfplayerbase.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -146,6 +146,7 @@ // inform java side PostLongEvent(CMMAPlayerEvent::EStarted, iStartedEventTime); } + ChangeState(EStarted); PostActionCompleted(KErrNone); // java start return } @@ -159,35 +160,9 @@ iStartedEventTime = time; TInt err = KErrNone; - // AAC controller does not support multiple - // calls to pause but leave with KErrNotReady. - // That error is dismissed as player should - // be paused already in that case. - if (time == 0) - { - DEBUG("CMMAMMFPlayerBase::StopL: Position is zero, stopping"); - // Normally pause would be called, but if - // current time is zero, Stop is called instead. - // This is done because video playback breaks - // if pause is called between events - // KMMFEventCategoryVideoLoadingStarted and - // KMMFEventCategoryVideoLoadingCompleted - // (no wurther events are delivered altough - // playback continues fine). - // However calling Stop is tolerated in that - // situation. - err = iController.Stop(); - if (err == KErrNone) - { - err = iController.Prime(); - } - } - else - { - DEBUG("CMMAMMFPlayerBase::StopL: Position not zero, pausing"); - err = iController.Pause(); - } - + DEBUG("CMMAMMFPlayerBase::StopL: Position not zero, pausing"); + err = iController.Pause(); + if ((err != KErrNone) && (err != KErrNotReady)) { DEBUG_INT("CMMAMMFPlayerBase::StopL: pause/stop failed %d, leaving", err); diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/cmmaplayer.cpp --- a/javauis/mmapi_akn/baseline/src/cmmaplayer.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/src/cmmaplayer.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -18,11 +18,13 @@ // INCLUDE FILES #include #include +#include #include "cmmaplayer.h" #include "cmmaeventsource.h" #include "cmmadurationupdater.h" #include "cmmavolumecontrol.h" +#include "cmmacallstatemonitor.h" // CONSTANTS _LIT(KPanicOutOfMem, "out of memory"); @@ -43,6 +45,7 @@ delete iOOMErrorEvent; delete iDurationUpdater; delete iContentType; + delete iStateObserver; } @@ -51,7 +54,8 @@ iRepeatForever(EFalse), iRepeatCount(0), iDuration(KTimeUnknown), - iState(EUnrealized) + iState(EUnrealized), + isPausedByCall(EFalse) { } @@ -60,6 +64,10 @@ { DEBUG("MMA::CMMAPlayer::ConstructL + "); iDurationUpdater = CMMADurationUpdater::NewL(*this); + // Listen to call state changes + iStateObserver = CMMACallStateMonitor::NewL(KPSUidCtsyCallInformation, + KCTsyCallState,this); + DEBUG("MMA::CMMAPlayer::ConstructL - "); } @@ -145,7 +153,7 @@ } -void CMMAPlayer::CloseL() +EXPORT_C void CMMAPlayer::CloseL() { DEBUG("MMA::CMMAPlayer::CloseL "); PostObjectEvent(CMMAPlayerEvent::EClosed, NULL); @@ -421,7 +429,7 @@ } -void CMMAPlayer::PostActionCompleted(TInt aError) +EXPORT_C void CMMAPlayer::PostActionCompleted(TInt aError) { iActionCompletedEvent->SetEventData(aError); iEventPoster->PostEvent(iActionCompletedEvent, @@ -452,4 +460,72 @@ iControls.ResetAndDestroy(); } } + + +void CMMAPlayer::HandleCallStateEventL(TUid aUid, TInt aKey) +{ + DEBUG("CMMAPlayer::HandleCallStateEvent +"); + DEBUG_INT2( "CMMAVideoUrlPlayer::HandleCallStateEvent(TUid aUid, TInt aKey) = (%d, %d)",aUid.iUid, aKey); + + TInt callState; + iStateObserver->GetValue(callState); + DEBUG_INT( "CMMAVideoUrlPlayer::HandleCallStateEvent: state = %d", callState); + + switch (callState) + { + case EPSCTsyCallStateUninitialized: + { + DEBUG_INT( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateUninitialized istate = %d", iState); + break; + } + + case EPSCTsyCallStateAlerting: + + case EPSCTsyCallStateRinging: + + case EPSCTsyCallStateDialling: + + case EPSCTsyCallStateAnswering: + + case EPSCTsyCallStateConnected: + { + DEBUG_INT( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateConnected iState = %d", iState); + if(iState == CMMAPlayer::EStarted) + { + DEBUG( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateConnected started state"); + StopL(ETrue); + isPausedByCall = ETrue; + } + break; + } + case EPSCTsyCallStateDisconnecting: + { + DEBUG_INT( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateDisconnecting istate = %d", iState); + break; + } + case EPSCTsyCallStateNone: + { + DEBUG_INT( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateNone istate = %d", iState); + if( (iState == CMMAPlayer::EPrefetched) && isPausedByCall ) + { + DEBUG( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateNone Prefetched state"); + StartL(ETrue); + isPausedByCall = EFalse; + } + break; + } + + case EPSCTsyCallStateHold: + { + DEBUG_INT( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateHold iState = %d", iState); + break; + } + default: + { + DEBUG( "CMMAVideoUrlPlayer::HandlePSEvent default"); + // Default is no pause + break; + } + } +} // END OF FILE diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/cmmasnapshot.cpp --- a/javauis/mmapi_akn/baseline/src/cmmasnapshot.cpp Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,248 +0,0 @@ -/* -* Copyright (c) 2002-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 takes snapshot and resizes bitmap if needed. -* -*/ - - -// INCLUDE FILES -#include - -#include "cmmasnapshot.h" -#include "mmmaguiplayer.h" -#include "mmmasnapshotreadycallback.h" -#include "mmmasnapshot.h" - -// CONSTANTS -const TInt KIgnoreSize = -1; - - -// CONSTRUCTION -CMMASnapshot* CMMASnapshot::NewL(MMMAGuiPlayer* aGuiPlayer, - MMMASnapshotReadyCallback& aCallBack) -{ - CMMASnapshot* self = new(ELeave) CMMASnapshot(aGuiPlayer, - aCallBack); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); // self - return self; -} - -CMMASnapshot::~CMMASnapshot() -{ - if (iScaler) - { - iScaler->Cancel(); - delete iScaler; - } - if (iEncoder) - { - iEncoder->Cancel(); - delete iEncoder; - } - delete iBitmap; - delete iBuffer; - delete iSettings; -} - -void CMMASnapshot::ConstructL() -{ - CActiveScheduler::Add(this); - iScaler = CBitmapScaler::NewL(); -} - -CMMASnapshot::CMMASnapshot(MMMAGuiPlayer* aGuiPlayer, - MMMASnapshotReadyCallback& aCallBack): - CActive(EPriorityStandard), - iEncoding(MMMASnapshot::EBitmap), - iCallBack(aCallBack), - iState(EIdle) -{ - iGUIPlayer = aGuiPlayer; -} - -void CMMASnapshot::TakeSnapShotL(const TDesC& aProperties) -{ - // snapshot sequence is not finished - __ASSERT_DEBUG(iState == EIdle, User::Invariant()); - // image buffer must be taken with ImageBuffer before taking new snapshot - __ASSERT_DEBUG(iBuffer == NULL, User::Invariant()); - - CMMAImageSettings* settings - = TMMAParameterValidator::ValidateImagePropertiesL(aProperties); - CleanupStack::PushL(settings); - - delete iSettings; - CleanupStack::Pop(settings); - iSettings = settings; - - // take snapshot from player. RunL is called when image is ready - // or error occures - iState = ETakingSnapshot; - TSize snapshotSize(iSettings->iWidth, iSettings->iHeight); - iEncoding = iGUIPlayer->SnapshoterL()->TakeSnapshotL(&iStatus, - snapshotSize, - *iSettings); - SetActive(); -} - -HBufC8* CMMASnapshot::ImageBuffer() -{ - // this must not be called when snapshot sequence is running - __ASSERT_DEBUG(iState == EIdle, User::Invariant()); - HBufC8* buffer = iBuffer; - // caller takes ownership of the buffer - iBuffer = NULL; - return buffer; -} - -void CMMASnapshot::ResizeL() -{ - iState = EResizing; - TSize imageSize(iBitmap->SizeInPixels()); - if (iSettings->iWidth != KIgnoreSize) - { - imageSize.iWidth = iSettings->iWidth; - } - if (iSettings->iHeight != KIgnoreSize) - { - imageSize.iHeight = iSettings->iHeight; - } - if (imageSize == iBitmap->SizeInPixels()) - { - // no user resizing needed, continue sequence - EncodeL(); - } - else - { - iScaler->Scale(&iStatus, *iBitmap, imageSize, EFalse); - SetActive(); - } -} - -void CMMASnapshot::EncodeL() -{ - // CImageEncoder cannot be reused, so have to make it every time - CImageEncoder* encoder = CImageEncoder::DataNewL(iBuffer, *iSettings->iMimeType); - delete iEncoder; - iEncoder = encoder; - - iState = EEncoding; - iEncoder->Convert(&iStatus, *iBitmap, iSettings->iImageData); - SetActive(); -} - -void CMMASnapshot::Completed(TInt aError) -{ - iStatus = aError; - iCallBack.SnapshotReady(); -} - -void CMMASnapshot::RunL() -{ - if (iStatus != KErrNone) - { - // Error has occured, inform java side and change state - iState = EIdle; - Completed(iStatus.Int()); - return; - } - - switch (iState) - { - case ETakingSnapshot: - { - DEBUG_INT("MMA::CMMASnapshot::RunL: iEncoding = %d", iEncoding); - if (iEncoding == MMMASnapshot::EEncoded) - { - // take encoded image from player. - // Ownership transfers to this class. - iBuffer = iGUIPlayer->SnapshoterL()->SnapshotEncoded(); - if (!iBuffer) - { - // error has occured with taking image - Completed(KErrNotFound); - } - // Image is ready, update internal state and inform listener - // Encoded images are not resized - iState = EIdle; - Completed(KErrNone); - } - else - { - // take bitmap from player. - // Ownership transfers to this class. - iBitmap = iGUIPlayer->SnapshoterL()->SnapshotBitmap(); - if (!iBitmap) - { - // error has occured with taking image - Completed(KErrNotFound); - } - // Continue to next state - ResizeL(); - } - break; - } - case EResizing: - { - // Continue to next state - EncodeL(); - break; - } - case EEncoding: - { - delete iEncoder; - iEncoder = NULL; - - delete iBitmap; - iBitmap = NULL; - iState = EIdle; - // encoding is ready, inform listener - Completed(KErrNone); - break; - } - default: - { - // unknown state - __ASSERT_DEBUG(EFalse, User::Invariant()); - } - } -} - -TInt CMMASnapshot::RunError(TInt aError) -{ - // Reset state - iState = EIdle; - // Pass error code to observer - Completed(aError); - - return KErrNone; -} - -void CMMASnapshot::DoCancel() -{ - // snapshot taking cannot be cancelled - if (iScaler) - { - iScaler->Cancel(); - } - if (iEncoder) - { - iEncoder->Cancel(); - } - iState = EIdle; -} - -// END OF FILE diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/cmmasnapshotevent.cpp --- a/javauis/mmapi_akn/baseline/src/cmmasnapshotevent.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/src/cmmasnapshotevent.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -48,9 +48,11 @@ DEBUG("MMA::CMMASnapshotEvent::Dispatch"); // create java byte array + jbyteArray byteArray; if (iImageBuffer) + { byteArray = aJni.NewByteArray(iImageBuffer->Size()); if (byteArray) @@ -82,8 +84,8 @@ byteArray); delete iImageBuffer; + iImageBuffer = NULL; // otherwise double delete in destructor - iImageBuffer = NULL; // otherwise double delete in destructor aJni.DeleteLocalRef(byteArray); } diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/cmmavideourlplayerlivestreamdelegate.cpp --- a/javauis/mmapi_akn/baseline/src/cmmavideourlplayerlivestreamdelegate.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/src/cmmavideourlplayerlivestreamdelegate.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -52,7 +52,7 @@ void CMMAVideoUrlPlayer::CMMAVideoUrlPlayerLiveStreamDelegate::StartL(TBool /*aPostEvent*/) { // start can't be called to not ready player - ASSERT(iPlayer.iState == EPrefetched); + //ASSERT(iPlayer.iState == EPrefetched); iPlayer.PrefetchL(); @@ -122,7 +122,7 @@ void CMMAVideoUrlPlayer::CMMAVideoUrlPlayerLiveStreamDelegate::HandleEvent(const TMMFEvent& aEvent) { - DEBUG_INT("MMA:CMMAVideoUrlPlayer: Live stream: HandleEvent %d", aEvent.iEventType.iUid); + DEBUG_INT("MMA:CMMAVideoUrlPlayer: Live stream: HandleEvent -EventTypeUid = %u", aEvent.iEventType.iUid); DEBUG_INT("MMA:CMMAVideoUrlPlayer: Live stream: HandleEvent error code: %d", aEvent.iErrorCode); TInt err = aEvent.iErrorCode; @@ -202,8 +202,13 @@ // usually error condition -45 (KErrSessionClosed) or -33 (KErrTimedOut) if (err != KErrNone) { - DEBUG("MMA:CMMAVideoUrlPlayer: Live stream: KMMFEventCategoryVideoPlayerGeneralError Inform Parent"); - iPlayer.HandleEventToParent(aEvent); + if(err == KErrSessionClosed || err == KErrMMAudioDevice) + { + DEBUG_INT("MMA:CMMAVideoUrlPlayer: Live stream: Ignoring error %d", err); + return; + } + DEBUG("MMA:CMMAVideoUrlPlayer: Live stream: KMMFEventCategoryVideoPlayerGeneralError Inform Parent"); + iPlayer.HandleEventToParent(aEvent); } DEBUG("MMA:CMMAVideoUrlPlayer: Live stream: KMMFEventCategoryVideoPlayerGeneralError -"); } diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/cmmavolumecontrol.cpp --- a/javauis/mmapi_akn/baseline/src/cmmavolumecontrol.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/src/cmmavolumecontrol.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -20,9 +20,9 @@ #include "cmmaplayer.h" #include "cmmavolumecontrol.h" #include -#include -#include -#include +#include +#include +#include _LIT(KMMAVolumeErrorMsg, "Can't set volume level"); @@ -46,20 +46,20 @@ } -CMMAVolumeControl::CMMAVolumeControl(CMMAPlayer* aPlayer) +EXPORT_C CMMAVolumeControl::CMMAVolumeControl(CMMAPlayer* aPlayer) : iPlayer(aPlayer), iLevel(KMMAVolumeMaxLevel) { } -CMMAVolumeControl::~CMMAVolumeControl() +EXPORT_C CMMAVolumeControl::~CMMAVolumeControl() { delete iProfChangeNotifier; iLevels.Close(); } -void CMMAVolumeControl::ConstructBaseL() +EXPORT_C void CMMAVolumeControl::ConstructBaseL() { iPlayer->AddStateListenerL(this); @@ -114,8 +114,8 @@ iLevel = CalculateLevel(); } -void CMMAVolumeControl::HandleActiveProfileEventL(TProfileEvent aProfileEvent, - TInt aProfileId) +EXPORT_C void CMMAVolumeControl::HandleActiveProfileEventL( + TProfileEvent aProfileEvent, TInt aProfileId) { switch (aProfileEvent) { @@ -157,7 +157,7 @@ -const TDesC& CMMAVolumeControl::ClassName() const +EXPORT_C const TDesC& CMMAVolumeControl::ClassName() const { return KMMAVolumeControlName; } @@ -172,7 +172,7 @@ iLevel = aLevel; } -void CMMAVolumeControl::StateChanged(TInt aState) +EXPORT_C void CMMAVolumeControl::StateChanged(TInt aState) { DEBUG_INT("CMMAVolumeControl::StateChanged - state %d", aState); // Set the volume if the player is prefetched @@ -204,10 +204,12 @@ { if ((iLevels.Count() - 1) == KMMAGlobalVolumeSoundIndex) { - DEBUG("MMA::CMMAVolumeControl::StateChanged : Post GLOBAL VOL EVENT "); - if (iLevels[ KMMAGlobalVolumeSoundIndex ] != KErrNotFound) + if ((iLevels[ KMMAGlobalVolumeSoundIndex ] != KErrNotFound) && + (iLevels[ KMMAGlobalVolumeSoundIndex] != iInitialGlobalVolumeLevel)) { - DEBUG_INT("MMA::CMMAVolumeControl::StateChanged : Post complete Val = %d ",iLevels[ KMMAGlobalVolumeSoundIndex ]); + DEBUG("MMA::CMMAVolumeControl::StateChanged : Post GLOBAL VOL EVENT "); + DEBUG_INT("MMA::CMMAVolumeControl::StateChanged : Post complete Val = %d ", + iLevels[ KMMAGlobalVolumeSoundIndex ]); iPlayer->PostLongEvent(CMMAPlayerEvent::ENOKIA_EXTERNAL_VOLUME_EVENT, iLevels[ KMMAGlobalVolumeSoundIndex ]); } @@ -215,7 +217,7 @@ } } -void CMMAVolumeControl::RefreshVolume() +EXPORT_C void CMMAVolumeControl::RefreshVolume() { DEBUG("MMA::CMMAVolumeControl::RefreshVolume ++ "); TRAPD(error, @@ -238,7 +240,7 @@ DEBUG("MMA::CMMAVolumeControl::RefreshVolume -- "); } -void CMMAVolumeControl::RefreshControl() +EXPORT_C void CMMAVolumeControl::RefreshControl() { RefreshVolume(); } @@ -283,6 +285,10 @@ } } +void CMMAVolumeControl::InitializeGlobalVolumeLevel(TInt aGlobalVolumeLevel) +{ + iInitialGlobalVolumeLevel = aGlobalVolumeLevel; +} void CMMAVolumeControl::GetVolumeLevelL(TInt aLevelIndex, TInt* aVolumeLevel) { @@ -330,6 +336,7 @@ // Actual sound level will be multiplying all levels. for (TInt i = 0; i < levelCount; i++) { + DEBUG_INT2("CMMAVolumeControl::CalculateLevel value at iLevels[ %d ] is %d",i,iLevels[i]); // If the level is not known it is expected to be max volume level = (iLevels[ i ] == KErrNotFound ? level * KMMAVolumeMaxLevel : diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/baseline/src/tmmaparametervalidator.cpp --- a/javauis/mmapi_akn/baseline/src/tmmaparametervalidator.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/baseline/src/tmmaparametervalidator.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -18,10 +18,10 @@ // INCLUDE FILES #include -#include -#include +#include +#include +#include #include "cmmaplayerproperties.h" -#include #include "tmmaparametervalidator.h" diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/build/bwins/javamobilemedia_5_0u.def --- a/javauis/mmapi_akn/build/bwins/javamobilemedia_5_0u.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/build/bwins/javamobilemedia_5_0u.def Mon Aug 23 16:38:44 2010 +0100 @@ -66,4 +66,13 @@ ?StopL@CMMAVideoUrlPlayer@@UAEXH@Z @ 65 NONAME ; void CMMAVideoUrlPlayer::StopL(int) ?TakeSnapshotL@CMMAVideoPlayer@@UAE?AW4TEncoding@MMMASnapshot@@PAVTRequestStatus@@ABVTSize@@ABVCMMAImageSettings@@@Z @ 66 NONAME ; enum MMMASnapshot::TEncoding CMMAVideoPlayer::TakeSnapshotL(class TRequestStatus *, class TSize const &, class CMMAImageSettings const &) ?Type@CMMAVideoPlayer@@MAEABVTDesC16@@XZ @ 67 NONAME ; class TDesC16 const & CMMAVideoPlayer::Type(void) + ??0CMMAVolumeControl@@IAE@PAVCMMAPlayer@@@Z @ 68 NONAME ; CMMAVolumeControl::CMMAVolumeControl(class CMMAPlayer *) + ??1CMMAVolumeControl@@UAE@XZ @ 69 NONAME ; CMMAVolumeControl::~CMMAVolumeControl(void) + ?ClassName@CMMAVolumeControl@@UBEABVTDesC16@@XZ @ 70 NONAME ; class TDesC16 const & CMMAVolumeControl::ClassName(void) const + ?CloseL@CMMAPlayer@@UAEXXZ @ 71 NONAME ; void CMMAPlayer::CloseL(void) + ?ConstructBaseL@CMMAVolumeControl@@IAEXXZ @ 72 NONAME ; void CMMAVolumeControl::ConstructBaseL(void) + ?HandleActiveProfileEventL@CMMAVolumeControl@@UAEXW4TProfileEvent@@H@Z @ 73 NONAME ; void CMMAVolumeControl::HandleActiveProfileEventL(enum TProfileEvent, int) + ?RefreshControl@CMMAVolumeControl@@UAEXXZ @ 74 NONAME ; void CMMAVolumeControl::RefreshControl(void) + ?RefreshVolume@CMMAVolumeControl@@AAEXXZ @ 75 NONAME ; void CMMAVolumeControl::RefreshVolume(void) + ?StateChanged@CMMAVolumeControl@@UAEXH@Z @ 76 NONAME ; void CMMAVolumeControl::StateChanged(int) diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/build/bwins/javamobilemediau.def --- a/javauis/mmapi_akn/build/bwins/javamobilemediau.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/build/bwins/javamobilemediau.def Mon Aug 23 16:38:44 2010 +0100 @@ -87,4 +87,14 @@ ?StopL@CMMAVideoUrlPlayer@@UAEXH@Z @ 86 NONAME ; void CMMAVideoUrlPlayer::StopL(int) ??1CMMAVideoControl@@UAE@XZ @ 87 NONAME ; CMMAVideoControl::~CMMAVideoControl(void) ?HandleSwitchOnL@CMMAVideoControl@@UAEXH@Z @ 88 NONAME ; void CMMAVideoControl::HandleSwitchOnL(int) + ?StateChanged@CMMAVolumeControl@@UAEXH@Z @ 89 NONAME ; void CMMAVolumeControl::StateChanged(int) + ?CloseL@CMMAPlayer@@UAEXXZ @ 90 NONAME ; void CMMAPlayer::CloseL(void) + ?RefreshControl@CMMAVolumeControl@@UAEXXZ @ 91 NONAME ; void CMMAVolumeControl::RefreshControl(void) + ?SetAVCableConnStatus@CMMASurfaceWindow@@QAEXH@Z @ 92 NONAME ; void CMMASurfaceWindow::SetAVCableConnStatus(int) + ?RefreshVolume@CMMAVolumeControl@@AAEXXZ @ 93 NONAME ; void CMMAVolumeControl::RefreshVolume(void) + ?HandleActiveProfileEventL@CMMAVolumeControl@@UAEXW4TProfileEvent@@H@Z @ 94 NONAME ; void CMMAVolumeControl::HandleActiveProfileEventL(enum TProfileEvent, int) + ??1CMMAVolumeControl@@UAE@XZ @ 95 NONAME ; CMMAVolumeControl::~CMMAVolumeControl(void) + ??0CMMAVolumeControl@@IAE@PAVCMMAPlayer@@@Z @ 96 NONAME ; CMMAVolumeControl::CMMAVolumeControl(class CMMAPlayer *) + ?ConstructBaseL@CMMAVolumeControl@@IAEXXZ @ 97 NONAME ; void CMMAVolumeControl::ConstructBaseL(void) + ?ClassName@CMMAVolumeControl@@UBEABVTDesC16@@XZ @ 98 NONAME ; class TDesC16 const & CMMAVolumeControl::ClassName(void) const diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/build/eabi/javamobilemedia_5_0u.def --- a/javauis/mmapi_akn/build/eabi/javamobilemedia_5_0u.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/build/eabi/javamobilemedia_5_0u.def Mon Aug 23 16:38:44 2010 +0100 @@ -9,128 +9,146 @@ _ZN10CMMAPlayer15PostStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 8 NONAME _ZN10CMMAPlayer16AddSourceStreamLEP7JNIEnv_P15CMMAEventSourceP8_jobject @ 9 NONAME _ZN10CMMAPlayer17AddStateListenerLEP23MMMAPlayerStateListener @ 10 NONAME - _ZN10CMMAPlayer19RemoveStateListenerEP23MMMAPlayerStateListener @ 11 NONAME - _ZN10CMMAPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 12 NONAME - _ZN10CMMAPlayer7ControlEi @ 13 NONAME - _ZN10CMMAPlayerC2Ev @ 14 NONAME - _ZN10CMMAPlayerD0Ev @ 15 NONAME - _ZN10CMMAPlayerD1Ev @ 16 NONAME - _ZN10CMMAPlayerD2Ev @ 17 NONAME - _ZN11CMMAManager17AddPlayerFactoryLEP17MMMAPlayerFactory @ 18 NONAME - _ZN15CMMAAudioPlayer13PlayCompleteLEi @ 19 NONAME - _ZN15CMMAAudioPlayer13PrefetchDataLERK6TDesC8 @ 20 NONAME - _ZN15CMMAAudioPlayer13PrefetchFileLEv @ 21 NONAME - _ZN15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 22 NONAME - _ZN15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 23 NONAME - _ZN15CMMAEventSource25SetPlayerInstanceObserverEP26MMMAPlayerInstanceObserver @ 24 NONAME - _ZN15CMMAEventSource26StaticAddObjectFromHandleLEPS_i @ 25 NONAME - _ZN15CMMAEventSource7PlayersEv @ 26 NONAME - _ZN15CMMAVideoPlayer10SourceSizeEv @ 27 NONAME - _ZN15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 28 NONAME - _ZN15CMMAVideoPlayer11SnapshoterLEv @ 29 NONAME - _ZN15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 30 NONAME - _ZN15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 31 NONAME - _ZN15CMMAVideoPlayer14SnapshotBitmapEv @ 32 NONAME - _ZN15CMMAVideoPlayer15SnapshotEncodedEv @ 33 NONAME - _ZN15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 34 NONAME - _ZN15CMMAVideoPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 35 NONAME - _ZN15CMMAVideoPlayer4TypeEv @ 36 NONAME - _ZN16CMMAVideoControl13SnapshotReadyEv @ 37 NONAME - _ZN16CMMAVideoControl15HandleSwitchOnLEi @ 38 NONAME - _ZN16CMMAVideoControl17HandleForegroundLEi @ 39 NONAME - _ZN16CMMAVideoControl21HandleResourceChangeLEi @ 40 NONAME - _ZN16CMMAVideoControlC1EP13MMMAGuiPlayer @ 41 NONAME - _ZN16CMMAVideoControlC2EP13MMMAGuiPlayer @ 42 NONAME - _ZN16CMMAVideoControlD0Ev @ 43 NONAME - _ZN16CMMAVideoControlD1Ev @ 44 NONAME - _ZN16CMMAVideoControlD2Ev @ 45 NONAME - _ZN17CMMAMMFPlayerBase10ControllerEv @ 46 NONAME - _ZN17CMMAMMFPlayerBase11GetDurationEPx @ 47 NONAME - _ZN17CMMAMMFPlayerBase6DoOpenE4TUidRK6TDesC8S0_S3_20TMMFPrioritySettings @ 48 NONAME - _ZN17CMMAVolumeControl15SetVolumeLevelLEii @ 49 NONAME - _ZN17CMMAVolumeControl25SetAudioOutputPreferenceLEi @ 50 NONAME - _ZN17CMMAVolumeControl9AddLevelLEv @ 51 NONAME - _ZN18CMMAVideoUrlPlayer10ConstructLERK7TDesC16 @ 52 NONAME - _ZN18CMMAVideoUrlPlayer11DeallocateLEv @ 53 NONAME - _ZN18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 54 NONAME - _ZN18CMMAVideoUrlPlayer12GetMediaTimeEPx @ 55 NONAME - _ZN18CMMAVideoUrlPlayer5StopLEi @ 56 NONAME - _ZN18CMMAVideoUrlPlayer6CloseLEv @ 57 NONAME - _ZN18CMMAVideoUrlPlayer6StartLEi @ 58 NONAME - _ZN18CMMAVideoUrlPlayer8RealizeLEv @ 59 NONAME - _ZN18CMMAVideoUrlPlayer9PrefetchLEv @ 60 NONAME - _ZN18CMMAVideoUrlPlayerC1EP15CMMAMMFResolver @ 61 NONAME - _ZN18CMMAVideoUrlPlayerC2EP15CMMAMMFResolver @ 62 NONAME - _ZN18CMMAVideoUrlPlayerD0Ev @ 63 NONAME - _ZN18CMMAVideoUrlPlayerD1Ev @ 64 NONAME - _ZN18CMMAVideoUrlPlayerD2Ev @ 65 NONAME - _ZN20CMMAMMFPlayerFactory13CreatePlayerLEP29CMMFFormatSelectionParametersPK7TDesC16 @ 66 NONAME - _ZN20CMMAMMFPlayerFactory33PreparePluginSelectionParametersLEP15CMMAMMFResolverP29CMMFFormatSelectionParameters @ 67 NONAME - _ZN20CMMAMMFPlayerFactoryC2Ev @ 68 NONAME - _ZN20CMMAMMFPlayerFactoryD0Ev @ 69 NONAME - _ZN20CMMAMMFPlayerFactoryD1Ev @ 70 NONAME - _ZN20CMMAMMFPlayerFactoryD2Ev @ 71 NONAME - _ZN22CMMAAudioVolumeControl4NewLEP15CMMAAudioPlayer @ 72 NONAME - _ZNK11CMMAControl15PublicClassNameEv @ 73 NONAME - _ZNK14CMMAMIDIPlayer10MidiClientEv @ 74 NONAME - _ZNK16CMMAVideoControl9ClassNameEv @ 75 NONAME - _ZTI10CMMAPlayer @ 76 NONAME - _ZTI11CMMAControl @ 77 NONAME - _ZTI14CMMAMIDIPlayer @ 78 NONAME - _ZTI15CMMAEventSource @ 79 NONAME - _ZTI16CMMAVideoControl @ 80 NONAME - _ZTI17CMMAMMFPlayerBase @ 81 NONAME - _ZTI17CMMAStreamRequest @ 82 NONAME - _ZTI17CMMAVolumeControl @ 83 NONAME - _ZTI18CMMAVideoUrlPlayer @ 84 NONAME - _ZTI20CMMAMMFPlayerFactory @ 85 NONAME - _ZTI26CPlaybackCompletedCallback @ 86 NONAME - _ZTIN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 87 NONAME - _ZTIN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 88 NONAME - _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 89 NONAME - _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 90 NONAME - _ZTIN19CMMAStopTimeControl10CStopTimerE @ 91 NONAME - _ZTV10CMMAPlayer @ 92 NONAME - _ZTV11CMMAControl @ 93 NONAME - _ZTV14CMMAMIDIPlayer @ 94 NONAME - _ZTV15CMMAEventSource @ 95 NONAME - _ZTV16CMMAVideoControl @ 96 NONAME - _ZTV17CMMAMMFPlayerBase @ 97 NONAME - _ZTV17CMMAStreamRequest @ 98 NONAME - _ZTV17CMMAVolumeControl @ 99 NONAME - _ZTV18CMMAVideoUrlPlayer @ 100 NONAME - _ZTV20CMMAMMFPlayerFactory @ 101 NONAME - _ZTV26CPlaybackCompletedCallback @ 102 NONAME - _ZTVN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 103 NONAME - _ZTVN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 104 NONAME - _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 105 NONAME - _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 106 NONAME - _ZTVN19CMMAStopTimeControl10CStopTimerE @ 107 NONAME - _ZThn12_N16CMMAVideoControl15HandleSwitchOnLEi @ 108 NONAME - _ZThn12_N16CMMAVideoControl17HandleForegroundLEi @ 109 NONAME - _ZThn12_N16CMMAVideoControl21HandleResourceChangeLEi @ 110 NONAME - _ZThn152_N18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 111 NONAME - _ZThn280_N15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 112 NONAME - _ZThn280_N15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 113 NONAME - _ZThn288_N15CMMAVideoPlayer10SourceSizeEv @ 114 NONAME - _ZThn288_N15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 115 NONAME - _ZThn288_N15CMMAVideoPlayer11SnapshoterLEv @ 116 NONAME - _ZThn288_N15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 117 NONAME - _ZThn288_N18CMMAVideoUrlPlayerD0Ev @ 118 NONAME - _ZThn288_N18CMMAVideoUrlPlayerD1Ev @ 119 NONAME - _ZThn292_N15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 120 NONAME - _ZThn292_N15CMMAVideoPlayer14SnapshotBitmapEv @ 121 NONAME - _ZThn292_N15CMMAVideoPlayer15SnapshotEncodedEv @ 122 NONAME - _ZThn292_N18CMMAVideoUrlPlayerD0Ev @ 123 NONAME - _ZThn292_N18CMMAVideoUrlPlayerD1Ev @ 124 NONAME - _ZThn4_N10CMMAPlayerD0Ev @ 125 NONAME - _ZThn4_N10CMMAPlayerD1Ev @ 126 NONAME - _ZThn4_N15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 127 NONAME - _ZThn4_N18CMMAVideoUrlPlayerD0Ev @ 128 NONAME - _ZThn4_N18CMMAVideoUrlPlayerD1Ev @ 129 NONAME - _ZThn4_N20CMMAMMFPlayerFactoryD0Ev @ 130 NONAME - _ZThn4_N20CMMAMMFPlayerFactoryD1Ev @ 131 NONAME - _ZThn8_N16CMMAVideoControl13SnapshotReadyEv @ 132 NONAME - _ZThn8_N16CMMAVideoControlD0Ev @ 133 NONAME - _ZThn8_N16CMMAVideoControlD1Ev @ 134 NONAME + _ZN10CMMAPlayer19PostActionCompletedEi @ 11 NONAME + _ZN10CMMAPlayer19RemoveStateListenerEP23MMMAPlayerStateListener @ 12 NONAME + _ZN10CMMAPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 13 NONAME + _ZN10CMMAPlayer6CloseLEv @ 14 NONAME + _ZN10CMMAPlayer7ControlEi @ 15 NONAME + _ZN10CMMAPlayerC2Ev @ 16 NONAME + _ZN10CMMAPlayerD0Ev @ 17 NONAME + _ZN10CMMAPlayerD1Ev @ 18 NONAME + _ZN10CMMAPlayerD2Ev @ 19 NONAME + _ZN11CMMAManager17AddPlayerFactoryLEP17MMMAPlayerFactory @ 20 NONAME + _ZN15CMMAAudioPlayer13PlayCompleteLEi @ 21 NONAME + _ZN15CMMAAudioPlayer13PrefetchDataLERK6TDesC8 @ 22 NONAME + _ZN15CMMAAudioPlayer13PrefetchFileLEv @ 23 NONAME + _ZN15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 24 NONAME + _ZN15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 25 NONAME + _ZN15CMMAEventSource25SetPlayerInstanceObserverEP26MMMAPlayerInstanceObserver @ 26 NONAME + _ZN15CMMAEventSource26StaticAddObjectFromHandleLEPS_i @ 27 NONAME + _ZN15CMMAEventSource7PlayersEv @ 28 NONAME + _ZN15CMMAVideoPlayer10SourceSizeEv @ 29 NONAME + _ZN15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 30 NONAME + _ZN15CMMAVideoPlayer11SnapshoterLEv @ 31 NONAME + _ZN15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 32 NONAME + _ZN15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 33 NONAME + _ZN15CMMAVideoPlayer14SnapshotBitmapEv @ 34 NONAME + _ZN15CMMAVideoPlayer15SnapshotEncodedEv @ 35 NONAME + _ZN15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 36 NONAME + _ZN15CMMAVideoPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 37 NONAME + _ZN15CMMAVideoPlayer4TypeEv @ 38 NONAME + _ZN16CMMAVideoControl13SnapshotReadyEv @ 39 NONAME + _ZN16CMMAVideoControl15HandleSwitchOnLEi @ 40 NONAME + _ZN16CMMAVideoControl17HandleForegroundLEi @ 41 NONAME + _ZN16CMMAVideoControl21HandleResourceChangeLEi @ 42 NONAME + _ZN16CMMAVideoControlC1EP13MMMAGuiPlayer @ 43 NONAME + _ZN16CMMAVideoControlC2EP13MMMAGuiPlayer @ 44 NONAME + _ZN16CMMAVideoControlD0Ev @ 45 NONAME + _ZN16CMMAVideoControlD1Ev @ 46 NONAME + _ZN16CMMAVideoControlD2Ev @ 47 NONAME + _ZN17CMMAMMFPlayerBase10ControllerEv @ 48 NONAME + _ZN17CMMAMMFPlayerBase11GetDurationEPx @ 49 NONAME + _ZN17CMMAMMFPlayerBase6DoOpenE4TUidRK6TDesC8S0_S3_20TMMFPrioritySettings @ 50 NONAME + _ZN17CMMAVolumeControl12StateChangedEi @ 51 NONAME + _ZN17CMMAVolumeControl13RefreshVolumeEv @ 52 NONAME + _ZN17CMMAVolumeControl14ConstructBaseLEv @ 53 NONAME + _ZN17CMMAVolumeControl14RefreshControlEv @ 54 NONAME + _ZN17CMMAVolumeControl15SetVolumeLevelLEii @ 55 NONAME + _ZN17CMMAVolumeControl25HandleActiveProfileEventLE13TProfileEventi @ 56 NONAME + _ZN17CMMAVolumeControl25SetAudioOutputPreferenceLEi @ 57 NONAME + _ZN17CMMAVolumeControl9AddLevelLEv @ 58 NONAME + _ZN17CMMAVolumeControlC2EP10CMMAPlayer @ 59 NONAME + _ZN17CMMAVolumeControlD0Ev @ 60 NONAME + _ZN17CMMAVolumeControlD1Ev @ 61 NONAME + _ZN17CMMAVolumeControlD2Ev @ 62 NONAME + _ZN18CMMAVideoUrlPlayer10ConstructLERK7TDesC16 @ 63 NONAME + _ZN18CMMAVideoUrlPlayer11DeallocateLEv @ 64 NONAME + _ZN18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 65 NONAME + _ZN18CMMAVideoUrlPlayer12GetMediaTimeEPx @ 66 NONAME + _ZN18CMMAVideoUrlPlayer5StopLEi @ 67 NONAME + _ZN18CMMAVideoUrlPlayer6CloseLEv @ 68 NONAME + _ZN18CMMAVideoUrlPlayer6StartLEi @ 69 NONAME + _ZN18CMMAVideoUrlPlayer8RealizeLEv @ 70 NONAME + _ZN18CMMAVideoUrlPlayer9PrefetchLEv @ 71 NONAME + _ZN18CMMAVideoUrlPlayerC1EP15CMMAMMFResolver @ 72 NONAME + _ZN18CMMAVideoUrlPlayerC2EP15CMMAMMFResolver @ 73 NONAME + _ZN18CMMAVideoUrlPlayerD0Ev @ 74 NONAME + _ZN18CMMAVideoUrlPlayerD1Ev @ 75 NONAME + _ZN18CMMAVideoUrlPlayerD2Ev @ 76 NONAME + _ZN20CMMAMMFPlayerFactory13CreatePlayerLEP29CMMFFormatSelectionParametersPK7TDesC16 @ 77 NONAME + _ZN20CMMAMMFPlayerFactory33PreparePluginSelectionParametersLEP15CMMAMMFResolverP29CMMFFormatSelectionParameters @ 78 NONAME + _ZN20CMMAMMFPlayerFactoryC2Ev @ 79 NONAME + _ZN20CMMAMMFPlayerFactoryD0Ev @ 80 NONAME + _ZN20CMMAMMFPlayerFactoryD1Ev @ 81 NONAME + _ZN20CMMAMMFPlayerFactoryD2Ev @ 82 NONAME + _ZN22CMMAAudioVolumeControl4NewLEP15CMMAAudioPlayer @ 83 NONAME + _ZNK11CMMAControl15PublicClassNameEv @ 84 NONAME + _ZNK14CMMAMIDIPlayer10MidiClientEv @ 85 NONAME + _ZNK16CMMAVideoControl9ClassNameEv @ 86 NONAME + _ZNK17CMMAVolumeControl9ClassNameEv @ 87 NONAME + _ZTI10CMMAPlayer @ 88 NONAME ; ## + _ZTI11CMMAControl @ 89 NONAME ; ## + _ZTI14CMMAMIDIPlayer @ 90 NONAME ; ## + _ZTI15CMMAEventSource @ 91 NONAME ; ## + _ZTI16CMMAVideoControl @ 92 NONAME ; ## + _ZTI17CMMAMMFPlayerBase @ 93 NONAME ; ## + _ZTI17CMMAStreamRequest @ 94 NONAME ; ## + _ZTI17CMMAVolumeControl @ 95 NONAME ; ## + _ZTI18CMMAVideoUrlPlayer @ 96 NONAME ; ## + _ZTI20CMMACallStateMonitor @ 97 NONAME ; ## + _ZTI20CMMAMMFPlayerFactory @ 98 NONAME ; ## + _ZTI26CPlaybackCompletedCallback @ 99 NONAME ; ## + _ZTIN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 100 NONAME ; ## + _ZTIN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 101 NONAME ; ## + _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 102 NONAME ; ## + _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 103 NONAME ; ## + _ZTIN19CMMAStopTimeControl10CStopTimerE @ 104 NONAME ; ## + _ZTV10CMMAPlayer @ 105 NONAME ; ## + _ZTV11CMMAControl @ 106 NONAME ; ## + _ZTV14CMMAMIDIPlayer @ 107 NONAME ; ## + _ZTV15CMMAEventSource @ 108 NONAME ; ## + _ZTV16CMMAVideoControl @ 109 NONAME ; ## + _ZTV17CMMAMMFPlayerBase @ 110 NONAME ; ## + _ZTV17CMMAStreamRequest @ 111 NONAME ; ## + _ZTV17CMMAVolumeControl @ 112 NONAME ; ## + _ZTV18CMMAVideoUrlPlayer @ 113 NONAME ; ## + _ZTV20CMMACallStateMonitor @ 114 NONAME ; ## + _ZTV20CMMAMMFPlayerFactory @ 115 NONAME ; ## + _ZTV26CPlaybackCompletedCallback @ 116 NONAME ; ## + _ZTVN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 117 NONAME ; ## + _ZTVN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 118 NONAME ; ## + _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 119 NONAME ; ## + _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 120 NONAME ; ## + _ZTVN19CMMAStopTimeControl10CStopTimerE @ 121 NONAME ; ## + _ZThn12_N16CMMAVideoControl15HandleSwitchOnLEi @ 122 NONAME ; ## + _ZThn12_N16CMMAVideoControl17HandleForegroundLEi @ 123 NONAME ; ## + _ZThn12_N16CMMAVideoControl21HandleResourceChangeLEi @ 124 NONAME ; ## + _ZThn12_N17CMMAVolumeControl25HandleActiveProfileEventLE13TProfileEventi @ 125 NONAME ; ## + _ZThn160_N18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 126 NONAME ; ## + _ZThn288_N15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 127 NONAME ; ## + _ZThn288_N15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 128 NONAME ; ## + _ZThn296_N15CMMAVideoPlayer10SourceSizeEv @ 129 NONAME ; ## + _ZThn296_N15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 130 NONAME ; ## + _ZThn296_N15CMMAVideoPlayer11SnapshoterLEv @ 131 NONAME ; ## + _ZThn296_N15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 132 NONAME ; ## + _ZThn296_N18CMMAVideoUrlPlayerD0Ev @ 133 NONAME ; ## + _ZThn296_N18CMMAVideoUrlPlayerD1Ev @ 134 NONAME ; ## + _ZThn300_N15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 135 NONAME ; ## + _ZThn300_N15CMMAVideoPlayer14SnapshotBitmapEv @ 136 NONAME ; ## + _ZThn300_N15CMMAVideoPlayer15SnapshotEncodedEv @ 137 NONAME ; ## + _ZThn300_N18CMMAVideoUrlPlayerD0Ev @ 138 NONAME ; ## + _ZThn300_N18CMMAVideoUrlPlayerD1Ev @ 139 NONAME ; ## + _ZThn4_N10CMMAPlayerD0Ev @ 140 NONAME ; ## + _ZThn4_N10CMMAPlayerD1Ev @ 141 NONAME ; ## + _ZThn4_N15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 142 NONAME ; ## + _ZThn4_N18CMMAVideoUrlPlayerD0Ev @ 143 NONAME ; ## + _ZThn4_N18CMMAVideoUrlPlayerD1Ev @ 144 NONAME ; ## + _ZThn4_N20CMMAMMFPlayerFactoryD0Ev @ 145 NONAME ; ## + _ZThn4_N20CMMAMMFPlayerFactoryD1Ev @ 146 NONAME ; ## + _ZThn8_N16CMMAVideoControl13SnapshotReadyEv @ 147 NONAME ; ## + _ZThn8_N16CMMAVideoControlD0Ev @ 148 NONAME ; ## + _ZThn8_N16CMMAVideoControlD1Ev @ 149 NONAME ; ## + _ZThn8_N17CMMAVolumeControl12StateChangedEi @ 150 NONAME ; ## + _ZThn8_N17CMMAVolumeControlD0Ev @ 151 NONAME ; ## + _ZThn8_N17CMMAVolumeControlD1Ev @ 152 NONAME ; ## diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/build/eabi/javamobilemediau.def --- a/javauis/mmapi_akn/build/eabi/javamobilemediau.def Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/build/eabi/javamobilemediau.def Mon Aug 23 16:38:44 2010 +0100 @@ -9,158 +9,177 @@ _ZN10CMMAPlayer15PostStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 8 NONAME _ZN10CMMAPlayer16AddSourceStreamLEP7JNIEnv_P15CMMAEventSourceP8_jobject @ 9 NONAME _ZN10CMMAPlayer17AddStateListenerLEP23MMMAPlayerStateListener @ 10 NONAME - _ZN10CMMAPlayer19RemoveStateListenerEP23MMMAPlayerStateListener @ 11 NONAME - _ZN10CMMAPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 12 NONAME - _ZN10CMMAPlayer7ControlEi @ 13 NONAME - _ZN10CMMAPlayerC2Ev @ 14 NONAME - _ZN10CMMAPlayerD0Ev @ 15 NONAME - _ZN10CMMAPlayerD1Ev @ 16 NONAME - _ZN10CMMAPlayerD2Ev @ 17 NONAME - _ZN11CMMAManager17AddPlayerFactoryLEP17MMMAPlayerFactory @ 18 NONAME - _ZN15CMMAAudioPlayer13PlayCompleteLEi @ 19 NONAME - _ZN15CMMAAudioPlayer13PrefetchDataLERK6TDesC8 @ 20 NONAME - _ZN15CMMAAudioPlayer13PrefetchFileLEv @ 21 NONAME - _ZN15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 22 NONAME - _ZN15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 23 NONAME - _ZN15CMMAEventSource25SetPlayerInstanceObserverEP26MMMAPlayerInstanceObserver @ 24 NONAME - _ZN15CMMAEventSource26StaticAddObjectFromHandleLEPS_i @ 25 NONAME - _ZN15CMMAEventSource7PlayersEv @ 26 NONAME - _ZN15CMMAVideoPlayer10SourceSizeEv @ 27 NONAME - _ZN15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 28 NONAME - _ZN15CMMAVideoPlayer11SnapshoterLEv @ 29 NONAME - _ZN15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 30 NONAME - _ZN15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 31 NONAME - _ZN15CMMAVideoPlayer14SnapshotBitmapEv @ 32 NONAME - _ZN15CMMAVideoPlayer15SnapshotEncodedEv @ 33 NONAME - _ZN15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 34 NONAME - _ZN15CMMAVideoPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 35 NONAME - _ZN15CMMAVideoPlayer4TypeEv @ 36 NONAME - _ZN16CMMAVideoControl13SnapshotReadyEv @ 37 NONAME - _ZN16CMMAVideoControl15HandleSwitchOnLEi @ 38 NONAME - _ZN16CMMAVideoControl17HandleForegroundLEi @ 39 NONAME - _ZN16CMMAVideoControl21HandleResourceChangeLEi @ 40 NONAME - _ZN16CMMAVideoControlC1EP13MMMAGuiPlayer @ 41 NONAME - _ZN16CMMAVideoControlC2EP13MMMAGuiPlayer @ 42 NONAME - _ZN16CMMAVideoControlD0Ev @ 43 NONAME - _ZN16CMMAVideoControlD1Ev @ 44 NONAME - _ZN16CMMAVideoControlD2Ev @ 45 NONAME - _ZN17CMMAEMCPlayerBase13StreamControlEv @ 46 NONAME - _ZN17CMMAEMCPlayerBase9MMFactoryEv @ 47 NONAME - _ZN17CMMAMMFPlayerBase10ControllerEv @ 48 NONAME - _ZN17CMMAMMFPlayerBase11GetDurationEPx @ 49 NONAME - _ZN17CMMAMMFPlayerBase6DoOpenE4TUidRK6TDesC8S0_S3_20TMMFPrioritySettings @ 50 NONAME - _ZN17CMMASurfaceWindow10SetDisplayEP11MMMADisplay @ 51 NONAME - _ZN17CMMASurfaceWindow13RemoveSurfaceEv @ 52 NONAME - _ZN17CMMASurfaceWindow20SetSurfaceParametersERK10TSurfaceIdRK5TRectRK17TVideoAspectRatio @ 53 NONAME - _ZN17CMMASurfaceWindow27SetChangedSurfaceParametersERK10TSurfaceIdRK5TRectRK17TVideoAspectRatio @ 54 NONAME - _ZN17CMMASurfaceWindow4NewLEP15CMMAEventSourceP10CMMAPlayeri @ 55 NONAME - _ZN17CMMAVolumeControl15SetVolumeLevelLEii @ 56 NONAME - _ZN17CMMAVolumeControl25SetAudioOutputPreferenceLEi @ 57 NONAME - _ZN17CMMAVolumeControl9AddLevelLEv @ 58 NONAME - _ZN18CMMAEMCAudioPlayer10ConstructLEv @ 59 NONAME - _ZN18CMMAEMCAudioPlayer13PlayCompleteLEi @ 60 NONAME - _ZN18CMMAEMCAudioPlayer13PrefetchDataLERK6TDesC8 @ 61 NONAME - _ZN18CMMAEMCAudioPlayer13PrefetchFileLEv @ 62 NONAME - _ZN18CMMAEMCAudioPlayer14ReadCompletedLEiRK6TDesC8 @ 63 NONAME - _ZN18CMMAEMCAudioPlayer4TypeEv @ 64 NONAME - _ZN18CMMAEMCAudioPlayer8RealizeLEv @ 65 NONAME - _ZN18CMMAEMCAudioPlayer9PrefetchLEv @ 66 NONAME - _ZN18CMMAEMCAudioPlayerC1EP15CMMAEMCResolver @ 67 NONAME - _ZN18CMMAEMCAudioPlayerC2EP15CMMAEMCResolver @ 68 NONAME - _ZN18CMMAEMCAudioPlayerD0Ev @ 69 NONAME - _ZN18CMMAEMCAudioPlayerD1Ev @ 70 NONAME - _ZN18CMMAEMCAudioPlayerD2Ev @ 71 NONAME - _ZN18CMMAVideoUrlPlayer10ConstructLERK7TDesC16 @ 72 NONAME - _ZN18CMMAVideoUrlPlayer11DeallocateLEv @ 73 NONAME - _ZN18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 74 NONAME - _ZN18CMMAVideoUrlPlayer12GetMediaTimeEPx @ 75 NONAME - _ZN18CMMAVideoUrlPlayer5StopLEi @ 76 NONAME - _ZN18CMMAVideoUrlPlayer6CloseLEv @ 77 NONAME - _ZN18CMMAVideoUrlPlayer6StartLEi @ 78 NONAME - _ZN18CMMAVideoUrlPlayer8RealizeLEv @ 79 NONAME - _ZN18CMMAVideoUrlPlayer9PrefetchLEv @ 80 NONAME - _ZN18CMMAVideoUrlPlayerC1EP15CMMAMMFResolver @ 81 NONAME - _ZN18CMMAVideoUrlPlayerC2EP15CMMAMMFResolver @ 82 NONAME - _ZN18CMMAVideoUrlPlayerD0Ev @ 83 NONAME - _ZN18CMMAVideoUrlPlayerD1Ev @ 84 NONAME - _ZN18CMMAVideoUrlPlayerD2Ev @ 85 NONAME - _ZN20CMMAMMFPlayerFactory13CreatePlayerLEP29CMMFFormatSelectionParametersPK7TDesC16 @ 86 NONAME - _ZN20CMMAMMFPlayerFactory33PreparePluginSelectionParametersLEP15CMMAMMFResolverP29CMMFFormatSelectionParameters @ 87 NONAME - _ZN20CMMAMMFPlayerFactoryC2Ev @ 88 NONAME - _ZN20CMMAMMFPlayerFactoryD0Ev @ 89 NONAME - _ZN20CMMAMMFPlayerFactoryD1Ev @ 90 NONAME - _ZN20CMMAMMFPlayerFactoryD2Ev @ 91 NONAME - _ZN22CMMAAudioVolumeControl4NewLEP15CMMAAudioPlayer @ 92 NONAME - _ZN25CMMAEMCAudioVolumeControl11DoGetLevelLEv @ 93 NONAME - _ZN25CMMAEMCAudioVolumeControl11DoSetLevelLEi @ 94 NONAME - _ZN25CMMAEMCAudioVolumeControl4NewLER18CMMAEMCAudioPlayer @ 95 NONAME - _ZN25CMMAEMCAudioVolumeControlC1ER18CMMAEMCAudioPlayer @ 96 NONAME - _ZN25CMMAEMCAudioVolumeControlC2ER18CMMAEMCAudioPlayer @ 97 NONAME - _ZNK11CMMAControl15PublicClassNameEv @ 98 NONAME - _ZNK14CMMAMIDIPlayer10MidiClientEv @ 99 NONAME - _ZNK16CMMAVideoControl9ClassNameEv @ 100 NONAME - _ZTI10CMMAPlayer @ 101 NONAME - _ZTI11CMMAControl @ 102 NONAME - _ZTI14CMMAMIDIPlayer @ 103 NONAME - _ZTI15CMMAEventSource @ 104 NONAME - _ZTI16CMMAVideoControl @ 105 NONAME - _ZTI17CMMAMMFPlayerBase @ 106 NONAME - _ZTI17CMMAStreamRequest @ 107 NONAME - _ZTI17CMMAVolumeControl @ 108 NONAME - _ZTI18CHXMetaDataUtility @ 109 NONAME - _ZTI18CMMAVideoUrlPlayer @ 110 NONAME - _ZTI20CMMAMMFPlayerFactory @ 111 NONAME - _ZTI26CPlaybackCompletedCallback @ 112 NONAME - _ZTIN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 113 NONAME - _ZTIN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 114 NONAME - _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 115 NONAME - _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 116 NONAME - _ZTIN19CMMAStopTimeControl10CStopTimerE @ 117 NONAME - _ZTV10CMMAPlayer @ 118 NONAME - _ZTV11CMMAControl @ 119 NONAME - _ZTV14CMMAMIDIPlayer @ 120 NONAME - _ZTV15CMMAEventSource @ 121 NONAME - _ZTV16CMMAVideoControl @ 122 NONAME - _ZTV17CMMAMMFPlayerBase @ 123 NONAME - _ZTV17CMMAStreamRequest @ 124 NONAME - _ZTV17CMMAVolumeControl @ 125 NONAME - _ZTV18CHXMetaDataUtility @ 126 NONAME - _ZTV18CMMAVideoUrlPlayer @ 127 NONAME - _ZTV20CMMAMMFPlayerFactory @ 128 NONAME - _ZTV26CPlaybackCompletedCallback @ 129 NONAME - _ZTVN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 130 NONAME - _ZTVN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 131 NONAME - _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 132 NONAME - _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 133 NONAME - _ZTVN19CMMAStopTimeControl10CStopTimerE @ 134 NONAME - _ZThn12_N16CMMAVideoControl15HandleSwitchOnLEi @ 135 NONAME - _ZThn12_N16CMMAVideoControl17HandleForegroundLEi @ 136 NONAME - _ZThn12_N16CMMAVideoControl21HandleResourceChangeLEi @ 137 NONAME - _ZThn152_N18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 138 NONAME - _ZThn280_N15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 139 NONAME - _ZThn280_N15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 140 NONAME - _ZThn288_N15CMMAVideoPlayer10SourceSizeEv @ 141 NONAME - _ZThn288_N15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 142 NONAME - _ZThn288_N15CMMAVideoPlayer11SnapshoterLEv @ 143 NONAME - _ZThn288_N15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 144 NONAME - _ZThn288_N18CMMAVideoUrlPlayerD0Ev @ 145 NONAME - _ZThn288_N18CMMAVideoUrlPlayerD1Ev @ 146 NONAME - _ZThn292_N15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 147 NONAME - _ZThn292_N15CMMAVideoPlayer14SnapshotBitmapEv @ 148 NONAME - _ZThn292_N15CMMAVideoPlayer15SnapshotEncodedEv @ 149 NONAME - _ZThn292_N18CMMAVideoUrlPlayerD0Ev @ 150 NONAME - _ZThn292_N18CMMAVideoUrlPlayerD1Ev @ 151 NONAME - _ZThn4_N10CMMAPlayerD0Ev @ 152 NONAME - _ZThn4_N10CMMAPlayerD1Ev @ 153 NONAME - _ZThn4_N15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 154 NONAME - _ZThn4_N18CMMAEMCAudioPlayer14ReadCompletedLEiRK6TDesC8 @ 155 NONAME - _ZThn4_N18CMMAEMCAudioPlayerD0Ev @ 156 NONAME - _ZThn4_N18CMMAEMCAudioPlayerD1Ev @ 157 NONAME - _ZThn4_N18CMMAVideoUrlPlayerD0Ev @ 158 NONAME - _ZThn4_N18CMMAVideoUrlPlayerD1Ev @ 159 NONAME - _ZThn4_N20CMMAMMFPlayerFactoryD0Ev @ 160 NONAME - _ZThn4_N20CMMAMMFPlayerFactoryD1Ev @ 161 NONAME - _ZThn8_N16CMMAVideoControl13SnapshotReadyEv @ 162 NONAME - _ZThn8_N16CMMAVideoControlD0Ev @ 163 NONAME - _ZThn8_N16CMMAVideoControlD1Ev @ 164 NONAME + _ZN10CMMAPlayer19PostActionCompletedEi @ 11 NONAME + _ZN10CMMAPlayer19RemoveStateListenerEP23MMMAPlayerStateListener @ 12 NONAME + _ZN10CMMAPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 13 NONAME + _ZN10CMMAPlayer6CloseLEv @ 14 NONAME + _ZN10CMMAPlayer7ControlEi @ 15 NONAME + _ZN10CMMAPlayerC2Ev @ 16 NONAME + _ZN10CMMAPlayerD0Ev @ 17 NONAME + _ZN10CMMAPlayerD1Ev @ 18 NONAME + _ZN10CMMAPlayerD2Ev @ 19 NONAME + _ZN11CMMAManager17AddPlayerFactoryLEP17MMMAPlayerFactory @ 20 NONAME + _ZN15CMMAAudioPlayer13PlayCompleteLEi @ 21 NONAME + _ZN15CMMAAudioPlayer13PrefetchDataLERK6TDesC8 @ 22 NONAME + _ZN15CMMAAudioPlayer13PrefetchFileLEv @ 23 NONAME + _ZN15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 24 NONAME + _ZN15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 25 NONAME + _ZN15CMMAEventSource25SetPlayerInstanceObserverEP26MMMAPlayerInstanceObserver @ 26 NONAME + _ZN15CMMAEventSource26StaticAddObjectFromHandleLEPS_i @ 27 NONAME + _ZN15CMMAEventSource7PlayersEv @ 28 NONAME + _ZN15CMMAVideoPlayer10SourceSizeEv @ 29 NONAME + _ZN15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 30 NONAME + _ZN15CMMAVideoPlayer11SnapshoterLEv @ 31 NONAME + _ZN15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 32 NONAME + _ZN15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 33 NONAME + _ZN15CMMAVideoPlayer14SnapshotBitmapEv @ 34 NONAME + _ZN15CMMAVideoPlayer15SnapshotEncodedEv @ 35 NONAME + _ZN15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 36 NONAME + _ZN15CMMAVideoPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 37 NONAME + _ZN15CMMAVideoPlayer4TypeEv @ 38 NONAME + _ZN16CMMAVideoControl13SnapshotReadyEv @ 39 NONAME + _ZN16CMMAVideoControl15HandleSwitchOnLEi @ 40 NONAME + _ZN16CMMAVideoControl17HandleForegroundLEi @ 41 NONAME + _ZN16CMMAVideoControl21HandleResourceChangeLEi @ 42 NONAME + _ZN16CMMAVideoControlC1EP13MMMAGuiPlayer @ 43 NONAME + _ZN16CMMAVideoControlC2EP13MMMAGuiPlayer @ 44 NONAME + _ZN16CMMAVideoControlD0Ev @ 45 NONAME + _ZN16CMMAVideoControlD1Ev @ 46 NONAME + _ZN16CMMAVideoControlD2Ev @ 47 NONAME + _ZN17CMMAEMCPlayerBase13StreamControlEv @ 48 NONAME + _ZN17CMMAEMCPlayerBase9MMFactoryEv @ 49 NONAME + _ZN17CMMAMMFPlayerBase10ControllerEv @ 50 NONAME + _ZN17CMMAMMFPlayerBase11GetDurationEPx @ 51 NONAME + _ZN17CMMAMMFPlayerBase6DoOpenE4TUidRK6TDesC8S0_S3_20TMMFPrioritySettings @ 52 NONAME + _ZN17CMMASurfaceWindow10SetDisplayEP11MMMADisplay @ 53 NONAME + _ZN17CMMASurfaceWindow13RemoveSurfaceEv @ 54 NONAME + _ZN17CMMASurfaceWindow20SetAVCableConnStatusEi @ 55 NONAME + _ZN17CMMASurfaceWindow20SetSurfaceParametersERK10TSurfaceIdRK5TRectRK17TVideoAspectRatio @ 56 NONAME + _ZN17CMMASurfaceWindow27SetChangedSurfaceParametersERK10TSurfaceIdRK5TRectRK17TVideoAspectRatio @ 57 NONAME + _ZN17CMMASurfaceWindow4NewLEP15CMMAEventSourceP10CMMAPlayeri @ 58 NONAME + _ZN17CMMAVolumeControl12StateChangedEi @ 59 NONAME + _ZN17CMMAVolumeControl13RefreshVolumeEv @ 60 NONAME + _ZN17CMMAVolumeControl14ConstructBaseLEv @ 61 NONAME + _ZN17CMMAVolumeControl14RefreshControlEv @ 62 NONAME + _ZN17CMMAVolumeControl15SetVolumeLevelLEii @ 63 NONAME + _ZN17CMMAVolumeControl25HandleActiveProfileEventLE13TProfileEventi @ 64 NONAME + _ZN17CMMAVolumeControl25SetAudioOutputPreferenceLEi @ 65 NONAME + _ZN17CMMAVolumeControl9AddLevelLEv @ 66 NONAME + _ZN17CMMAVolumeControlC2EP10CMMAPlayer @ 67 NONAME + _ZN17CMMAVolumeControlD0Ev @ 68 NONAME + _ZN17CMMAVolumeControlD1Ev @ 69 NONAME + _ZN17CMMAVolumeControlD2Ev @ 70 NONAME + _ZN18CMMAEMCAudioPlayer10ConstructLEv @ 71 NONAME + _ZN18CMMAEMCAudioPlayer13PlayCompleteLEi @ 72 NONAME + _ZN18CMMAEMCAudioPlayer13PrefetchDataLERK6TDesC8 @ 73 NONAME + _ZN18CMMAEMCAudioPlayer13PrefetchFileLEv @ 74 NONAME + _ZN18CMMAEMCAudioPlayer14ReadCompletedLEiRK6TDesC8 @ 75 NONAME + _ZN18CMMAEMCAudioPlayer4TypeEv @ 76 NONAME + _ZN18CMMAEMCAudioPlayer8RealizeLEv @ 77 NONAME + _ZN18CMMAEMCAudioPlayer9PrefetchLEv @ 78 NONAME + _ZN18CMMAEMCAudioPlayerC1EP15CMMAEMCResolver @ 79 NONAME + _ZN18CMMAEMCAudioPlayerC2EP15CMMAEMCResolver @ 80 NONAME + _ZN18CMMAEMCAudioPlayerD0Ev @ 81 NONAME + _ZN18CMMAEMCAudioPlayerD1Ev @ 82 NONAME + _ZN18CMMAEMCAudioPlayerD2Ev @ 83 NONAME + _ZN18CMMAVideoUrlPlayer10ConstructLERK7TDesC16 @ 84 NONAME + _ZN18CMMAVideoUrlPlayer11DeallocateLEv @ 85 NONAME + _ZN18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 86 NONAME + _ZN18CMMAVideoUrlPlayer12GetMediaTimeEPx @ 87 NONAME + _ZN18CMMAVideoUrlPlayer5StopLEi @ 88 NONAME + _ZN18CMMAVideoUrlPlayer6CloseLEv @ 89 NONAME + _ZN18CMMAVideoUrlPlayer6StartLEi @ 90 NONAME + _ZN18CMMAVideoUrlPlayer8RealizeLEv @ 91 NONAME + _ZN18CMMAVideoUrlPlayer9PrefetchLEv @ 92 NONAME + _ZN18CMMAVideoUrlPlayerC1EP15CMMAMMFResolver @ 93 NONAME + _ZN18CMMAVideoUrlPlayerC2EP15CMMAMMFResolver @ 94 NONAME + _ZN18CMMAVideoUrlPlayerD0Ev @ 95 NONAME + _ZN18CMMAVideoUrlPlayerD1Ev @ 96 NONAME + _ZN18CMMAVideoUrlPlayerD2Ev @ 97 NONAME + _ZN20CMMAMMFPlayerFactory13CreatePlayerLEP29CMMFFormatSelectionParametersPK7TDesC16 @ 98 NONAME + _ZN20CMMAMMFPlayerFactory33PreparePluginSelectionParametersLEP15CMMAMMFResolverP29CMMFFormatSelectionParameters @ 99 NONAME + _ZN20CMMAMMFPlayerFactoryC2Ev @ 100 NONAME + _ZN20CMMAMMFPlayerFactoryD0Ev @ 101 NONAME + _ZN20CMMAMMFPlayerFactoryD1Ev @ 102 NONAME + _ZN20CMMAMMFPlayerFactoryD2Ev @ 103 NONAME + _ZN22CMMAAudioVolumeControl4NewLEP15CMMAAudioPlayer @ 104 NONAME + _ZN25CMMAEMCAudioVolumeControl11DoGetLevelLEv @ 105 NONAME + _ZN25CMMAEMCAudioVolumeControl11DoSetLevelLEi @ 106 NONAME + _ZN25CMMAEMCAudioVolumeControl4NewLER18CMMAEMCAudioPlayer @ 107 NONAME + _ZN25CMMAEMCAudioVolumeControlC1ER18CMMAEMCAudioPlayer @ 108 NONAME + _ZN25CMMAEMCAudioVolumeControlC2ER18CMMAEMCAudioPlayer @ 109 NONAME + _ZNK11CMMAControl15PublicClassNameEv @ 110 NONAME + _ZNK14CMMAMIDIPlayer10MidiClientEv @ 111 NONAME + _ZNK16CMMAVideoControl9ClassNameEv @ 112 NONAME + _ZNK17CMMAVolumeControl9ClassNameEv @ 113 NONAME + _ZTI10CMMAPlayer @ 114 NONAME + _ZTI11CMMAControl @ 115 NONAME + _ZTI14CMMAMIDIPlayer @ 116 NONAME + _ZTI15CMMAEventSource @ 117 NONAME + _ZTI16CMMAVideoControl @ 118 NONAME + _ZTI17CMMAMMFPlayerBase @ 119 NONAME + _ZTI17CMMAStreamRequest @ 120 NONAME + _ZTI17CMMAVolumeControl @ 121 NONAME + _ZTI18CHXMetaDataUtility @ 122 NONAME + _ZTI18CMMAVideoUrlPlayer @ 123 NONAME + _ZTI20CMMACallStateMonitor @ 124 NONAME + _ZTI20CMMAMMFPlayerFactory @ 125 NONAME + _ZTI26CPlaybackCompletedCallback @ 126 NONAME + _ZTIN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 127 NONAME + _ZTIN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 128 NONAME + _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 129 NONAME + _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 130 NONAME + _ZTIN19CMMAStopTimeControl10CStopTimerE @ 131 NONAME + _ZTV10CMMAPlayer @ 132 NONAME + _ZTV11CMMAControl @ 133 NONAME + _ZTV14CMMAMIDIPlayer @ 134 NONAME + _ZTV15CMMAEventSource @ 135 NONAME + _ZTV16CMMAVideoControl @ 136 NONAME + _ZTV17CMMAMMFPlayerBase @ 137 NONAME + _ZTV17CMMAStreamRequest @ 138 NONAME + _ZTV17CMMAVolumeControl @ 139 NONAME + _ZTV18CHXMetaDataUtility @ 140 NONAME + _ZTV18CMMAVideoUrlPlayer @ 141 NONAME + _ZTV20CMMACallStateMonitor @ 142 NONAME + _ZTV20CMMAMMFPlayerFactory @ 143 NONAME + _ZTV26CPlaybackCompletedCallback @ 144 NONAME + _ZTVN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 145 NONAME + _ZTVN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 146 NONAME + _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 147 NONAME + _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 148 NONAME + _ZTVN19CMMAStopTimeControl10CStopTimerE @ 149 NONAME + _ZThn12_N16CMMAVideoControl15HandleSwitchOnLEi @ 150 NONAME + _ZThn12_N16CMMAVideoControl17HandleForegroundLEi @ 151 NONAME + _ZThn12_N16CMMAVideoControl21HandleResourceChangeLEi @ 152 NONAME + _ZThn12_N17CMMAVolumeControl25HandleActiveProfileEventLE13TProfileEventi @ 153 NONAME + _ZThn160_N18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 154 NONAME + _ZThn288_N15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 155 NONAME + _ZThn288_N15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 156 NONAME + _ZThn296_N15CMMAVideoPlayer10SourceSizeEv @ 157 NONAME + _ZThn296_N15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 158 NONAME + _ZThn296_N15CMMAVideoPlayer11SnapshoterLEv @ 159 NONAME + _ZThn296_N15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 160 NONAME + _ZThn296_N18CMMAVideoUrlPlayerD0Ev @ 161 NONAME + _ZThn296_N18CMMAVideoUrlPlayerD1Ev @ 162 NONAME + _ZThn300_N15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 163 NONAME + _ZThn300_N15CMMAVideoPlayer14SnapshotBitmapEv @ 164 NONAME + _ZThn300_N15CMMAVideoPlayer15SnapshotEncodedEv @ 165 NONAME + _ZThn300_N18CMMAVideoUrlPlayerD0Ev @ 166 NONAME + _ZThn300_N18CMMAVideoUrlPlayerD1Ev @ 167 NONAME + _ZThn4_N10CMMAPlayerD0Ev @ 168 NONAME + _ZThn4_N10CMMAPlayerD1Ev @ 169 NONAME + _ZThn4_N15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 170 NONAME + _ZThn4_N18CMMAEMCAudioPlayer14ReadCompletedLEiRK6TDesC8 @ 171 NONAME + _ZThn4_N18CMMAEMCAudioPlayerD0Ev @ 172 NONAME + _ZThn4_N18CMMAEMCAudioPlayerD1Ev @ 173 NONAME + _ZThn4_N18CMMAVideoUrlPlayerD0Ev @ 174 NONAME + _ZThn4_N18CMMAVideoUrlPlayerD1Ev @ 175 NONAME + _ZThn4_N20CMMAMMFPlayerFactoryD0Ev @ 176 NONAME + _ZThn4_N20CMMAMMFPlayerFactoryD1Ev @ 177 NONAME + _ZThn8_N16CMMAVideoControl13SnapshotReadyEv @ 178 NONAME + _ZThn8_N16CMMAVideoControlD0Ev @ 179 NONAME + _ZThn8_N16CMMAVideoControlD1Ev @ 180 NONAME + _ZThn8_N17CMMAVolumeControl12StateChangedEi @ 181 NONAME + _ZThn8_N17CMMAVolumeControlD0Ev @ 182 NONAME + _ZThn8_N17CMMAVolumeControlD1Ev @ 183 NONAME diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/build/exports.inf --- a/javauis/mmapi_akn/build/exports.inf Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/build/exports.inf Mon Aug 23 16:38:44 2010 +0100 @@ -37,6 +37,9 @@ ../baseline/inc/cmmaplayerevent.h |../../inc/cmmaplayerevent.h ../baseline/inc/cmmasourcestream.h |../../inc/cmmasourcestream.h ../baseline/inc/cmmavideocontrol.h |../../inc/cmmavideocontrol.h +../baseline/inc/cmmaaudioplayer.h |../../inc/cmmaaudioplayer.h +../baseline/inc/cmmamidiplayer.h |../../inc/cmmamidiplayer.h +../baseline/inc/cmmammfplayerbase.h |../../inc/cmmammfplayerbase.h ../baseline/inc/cmmavolumecontrol.h |../../inc/cmmavolumecontrol.h ../baseline/inc/cmmammfplayerfactory.h |../../inc/cmmammfplayerfactory.h ../baseline/inc/cmmaaudiovolumecontrol.h |../../inc/cmmaaudiovolumecontrol.h @@ -47,16 +50,23 @@ ../baseline/inc/mmmadisplaywindow.h |../../inc/mmmadisplaywindow.h ../baseline/inc/mmmaplayerfactory.h |../../inc/mmmaplayerfactory.h ../baseline/inc/mmmaplayerstatelistener.h |../../inc/mmmaplayerstatelistener.h +../baseline/inc/mmmaplayerinstanceobserver.h |../../inc/mmmaplayerinstanceobserver.h +../baseline/inc/mmmacallstateobserver.h |../../inc/mmmacallstateobserver.h ../baseline/inc/mmmasourcestreamlistener.h |../../inc/mmmasourcestreamlistener.h ../baseline/inc/mmmasnapshotreadycallback.h |../../inc/mmmasnapshotreadycallback.h #ifdef RD_JAVA_NGA_ENABLED ../baseline/inc.nga/cmmavideoplayer.h |../../inc/cmmavideoplayer.h ../baseline/inc.nga/cmmasurfacewindow.h |../../inc/cmmasurfacewindow.h +#else +../baseline/inc.dsa/cmmadsawindow.h |../../inc/cmmadsawindow.h +../baseline/inc.dsa/cmmavideoplayer.h |../../inc/cmmavideoplayer.h #endif #ifdef RD_JAVA_HTTP_EMC_ENABLED ../baseline/inc.emc/cmmamanager.h |../../inc/cmmamanager.h +../baseline/inc.emc/cmmaemcaudioplayer.h |../../inc/cmmaemcaudioplayer.h +../baseline/inc.emc/cmmaemcplayerbase.h |../../inc/cmmaemcplayerbase.h #endif // Generic configuration interface for mobilemedia cenrep settings diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/build/javamobilemedia.pro --- a/javauis/mmapi_akn/build/javamobilemedia.pro Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/build/javamobilemedia.pro Mon Aug 23 16:38:44 2010 +0100 @@ -24,8 +24,7 @@ DEFINES += RD_JAVA_VOLUME_CONTROL DEFINES += RD_JAVA_OMA_DRM_V2 -INCLUDEPATH += /epoc32/include/mmf/common \ - ../animated_gif/inc \ +INCLUDEPATH += ../animated_gif/inc \ ../baseline/inc \ ../src_drmv2/inc \ ../directcontent/inc \ @@ -69,7 +68,10 @@ SOURCES += ../baseline/src.nga/*.cpp - LIBS += -lmediaclientvideodisplay + LIBS += -lmediaclientvideodisplay \ + -lsensrvclient \ + -lsensrvutil \ + -lfbscli } else { INCLUDEPATH += ../baseline/inc.dsa diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/build/javamobilemedia_0x2002DCC2.mmp --- a/javauis/mmapi_akn/build/javamobilemedia_0x2002DCC2.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/build/javamobilemedia_0x2002DCC2.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javamobilemedia.mmp @@ -54,10 +54,8 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian -SYSTEMINCLUDE /epoc32/include/mmf/common SYSTEMINCLUDE ../animated_gif/inc SYSTEMINCLUDE ../baseline/inc SYSTEMINCLUDE ../src_drmv2/inc @@ -112,8 +110,7 @@ SOURCE cmmaaudiorecorderfactory.cpp SOURCE cmmaaudiovolumecontrol.cpp SOURCE cmmabitmapwindow.cpp -SOURCE cmmacameraplayer.cpp -SOURCE cmmacameraplayerfactory.cpp +SOURCE cmmacallstatemonitor.cpp SOURCE cmmacanvasdisplay.cpp SOURCE cmmacontrol.cpp SOURCE cmmadeleterefevent.cpp @@ -143,7 +140,6 @@ SOURCE cmmaplayerproperties.cpp SOURCE cmmaratecontrol.cpp SOURCE cmmarecordcontrol.cpp -SOURCE cmmasnapshot.cpp SOURCE cmmasnapshotevent.cpp SOURCE cmmasourcestream.cpp SOURCE cmmasourcestreamevent.cpp @@ -188,7 +184,10 @@ SOURCE emcsourceinfo.cpp SOURCEPATH ../baseline/src.nga +SOURCE cmmacameraplayer.cpp +SOURCE cmmacameraplayerfactory.cpp SOURCE cmmacamerawindow.cpp +SOURCE cmmasnapshot.cpp SOURCE cmmasurfacewindow.cpp SOURCE cmmavideoplayer.cpp @@ -222,6 +221,9 @@ LIBRARY apgrfx.lib LIBRARY flogger.lib LIBRARY mediaclientvideodisplay.lib +LIBRARY sensrvclient.lib +LIBRARY sensrvutil.lib +LIBRARY fbscli.lib LIBRARY AknIcon.lib LIBRARY aknskins.lib LIBRARY aknskinsrv.lib @@ -249,7 +251,6 @@ LIBRARY eikcore.lib LIBRARY esock.lib LIBRARY euser.lib -LIBRARY fbscli.lib LIBRARY javalegacyutils.lib LIBRARY javaremconobserver.lib LIBRARY mediaclientvideo.lib diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/directcontent/inc/cmmadcdisplay.h --- a/javauis/mmapi_akn/directcontent/inc/cmmadcdisplay.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/directcontent/inc/cmmadcdisplay.h Mon Aug 23 16:38:44 2010 +0100 @@ -60,6 +60,7 @@ void SetFullScreenL(TBool aFullScreen); void SourceSizeChanged(const TSize& aSourceSize); TBool IsVisible(); + void FixUIOrientation(TBool aFix); /** * Gets notification that there is container to draw assigned @@ -135,6 +136,8 @@ // Not own MMMAGuiPlayer* iPlayer; + + TBool iFixUIOrientation; }; #endif // CMMADCDISPLAY_H diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/directcontent/src/cmmadcdisplay.cpp --- a/javauis/mmapi_akn/directcontent/src/cmmadcdisplay.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/directcontent/src/cmmadcdisplay.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -274,6 +274,12 @@ iWindow->SetVisible(aContainer->MdcContainerVisibility() && iVisible); } + + if(iFixUIOrientation) + { + iContainer->MdcFixUIOrientation(ETrue); + iFixUIOrientation = EFalse; + } } // interface MMMADirectContent @@ -312,6 +318,19 @@ } } +void CMMADCDisplay::FixUIOrientation(TBool aFix) +{ + if (iContainer) + { + iContainer->MdcFixUIOrientation(aFix); + } + else + { + // fix orientation when container becomes available + iFixUIOrientation = aFix; + } +} + TInt CMMADCDisplay::InitBitmapMode() { TInt errCode = KErrNone; @@ -349,7 +368,8 @@ CMMADCDisplay::CMMADCDisplay(MMMAGuiPlayer* aPlayer, CMMAEventSource* aEventSource, - jobject aGUIObject) + jobject aGUIObject): + iFixUIOrientation(EFalse) { iPlayer = aPlayer; iEventSource = aEventSource; diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/src_drmv2/inc/cmmadrmmetadatacontrol.h --- a/javauis/mmapi_akn/src_drmv2/inc/cmmadrmmetadatacontrol.h Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/src_drmv2/inc/cmmadrmmetadatacontrol.h Mon Aug 23 16:38:44 2010 +0100 @@ -21,7 +21,7 @@ #define CMMADRMMETADATACONTROL_H // INCLUDES -#include +#include #include "cmmadrmaudioplayer.h" #include "cmmametadatacontrol.h" diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/src_drmv2/src/cmmadrmplayerfactory.cpp --- a/javauis/mmapi_akn/src_drmv2/src/cmmadrmplayerfactory.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/src_drmv2/src/cmmadrmplayerfactory.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -19,9 +19,14 @@ // INCLUDE FILES #include +#ifndef RD_JAVA_S60_RELEASE_5_0 +#include +#endif + +#include + #include #include -#include #include "cmmadrmplayerfactory.h" #include "cmmadrmaudioplayer.h" diff -r 5bec7efefe18 -r d1278d87b01e javauis/mmapi_akn/volumekeys/src/cmmaglobalvolume.cpp --- a/javauis/mmapi_akn/volumekeys/src/cmmaglobalvolume.cpp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/mmapi_akn/volumekeys/src/cmmaglobalvolume.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -72,6 +72,7 @@ // void CMMAGlobalVolume::AddPlayerL(CMMAPlayer* aPlayer) { + DEBUG("CMMAGlobalVolume: AddPlayerL +"); // Find if the player has a volume control CMMAVolumeControl* control = FindVolumeControl(aPlayer); @@ -82,12 +83,19 @@ // Create new volume control and level index pair playerHolder.iVolumeControl = control; playerHolder.iVolumeIndex = control->AddLevelL(); + DEBUG_INT2("CMMAGlobalVolume: AddPlayerL : iVolumeIndex = %d and iLevel = %d",playerHolder.iVolumeIndex,iLevel); playerHolder.iPlayer = aPlayer; // Set current volume level for the control control->SetVolumeLevelL(playerHolder.iVolumeIndex, iLevel); + // To set the initial Global Volume for each player so that + // it will not post any event during the transition to realized state if there + // is no change in the global volume between player creation and realization. + control->InitializeGlobalVolumeLevel(iLevel); // Add created pair to the control list iControlList.AppendL(playerHolder); } + + DEBUG("CMMAGlobalVolume: AddPlayerL -"); } // --------------------------------------------------------------------------- @@ -96,6 +104,7 @@ // void CMMAGlobalVolume::RemovePlayer(CMMAPlayer* aPlayer) { + DEBUG("CMMAGlobalVolume: RemovePlayer +"); // Find if the player has a volume control CMMAVolumeControl* control = FindVolumeControl(aPlayer); @@ -105,11 +114,14 @@ // Check that if this type of volume control can be found from // the control list and remove it TInt count(iControlList.Count()); + DEBUG_INT("CMMAGlobalVolume: RemovePlayer :No of CMMAVolumeControl instances = %d",count); + for (TInt i(0); i < count; i++) { const TMMAPlayerHolder& holder = iControlList[ i ]; if (control == holder.iVolumeControl) { + DEBUG("CMMAGlobalVolume: RemovePlayer removing the instance of CMMAVolumeControl from the list"); iControlList.Remove(i); break; } @@ -124,6 +136,7 @@ void CMMAGlobalVolume::VolumeUp() { DEBUG_INT("THREADID = %d : CMMAGlobalVolume: VolumeUp: +", RThread().Id()); + DEBUG_INT("CMMAGlobalVolume: VolumeUp : iLevel = %d", iLevel); // Adjust volume if midlet is in foreground and the volume level value // is not too high, in this case it cannot be set over KMMAVolumeMaxLevel if (iForeground->IsForeground() && (iLevel < KMMAVolumeMaxLevel)) @@ -134,6 +147,7 @@ iLevel > (KMMAVolumeMaxLevel - KMMAVolumeLevelStep) ? KMMAVolumeMaxLevel - iLevel : iLevel + KMMAVolumeLevelStep; // Increase level by new value + DEBUG_INT("CMMAGlobalVolume: VolumeUp : effective volume to be set to player = %d", level); SetControlVolumeLevels(level); } DEBUG("CMMAGlobalVolume: VolumeUp: -"); @@ -146,6 +160,7 @@ void CMMAGlobalVolume::VolumeDown() { DEBUG_INT("THREADID = %d : CMMAGlobalVolume: VolumeDown: +", RThread().Id()); + DEBUG_INT("CMMAGlobalVolume: VolumeDown : iLevel = %d", iLevel); // Adjust volume if midlet is in foreground and the volume value // is not too low, in this case it cannot be set under zero if (iForeground->IsForeground() && (iLevel > 0)) @@ -155,6 +170,7 @@ TInt level = iLevel < KMMAVolumeLevelStep ? 0 : iLevel - KMMAVolumeLevelStep; + DEBUG_INT("CMMAGlobalVolume: VolumeDown : effective volume to be set to player = %d", level); // Decrease level by new value SetControlVolumeLevels(level); } @@ -188,6 +204,7 @@ void CMMAGlobalVolume::SetControlVolumeLevels(TInt aLevel) { TInt count(iControlList.Count()); + DEBUG_INT("CMMAGlobalVolume: SetControlVolumeLevels + count of controls = %d",count); // Adjust volume for all current volume controls associated for (TInt i(0); i < count; i++) { @@ -195,6 +212,7 @@ // Set new volume level for this control TRAPD(error, hdr.iVolumeControl->SetVolumeLevelL(hdr.iVolumeIndex, aLevel)); + DEBUG_INT2("CMMAGlobalVolume: SetControlVolumeLevels level set to control = %d,err = %d",aLevel,error); if (error != KErrNone) { hdr.iPlayer->PostStringEvent( @@ -211,6 +229,7 @@ // in any sophisticated way so we just have to ignore it. Debug builds // may panic in this case TInt error = iSettingsStore->Set(KMobileMediaVolumeLevel, aLevel); + DEBUG_INT2("CMMAGlobalVolume::setting the new value to Settings store, value = %d, err = %d", aLevel, error); __ASSERT_DEBUG(error == KErrNone, User::Invariant()); } @@ -235,6 +254,7 @@ // Get level from the settings store User::LeaveIfError(iSettingsStore->Get(KMobileMediaVolumeLevel, iLevel)); + DEBUG_INT("CMMAGlobalVolume::ConstructL - iLevel got from cenrep = %d", iLevel); } // End of file diff -r 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/build/bld.inf Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/build/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/build/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + diff -r 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/build/bwins/javanokiasoundu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/build/bwins/javanokiasoundu.def Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) + diff -r 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/build/eabi/javanokiasoundu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/build/eabi/javanokiasoundu.def Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,3 @@ +EXPORTS + _Z10jni_lookupPKc @ 1 NONAME + diff -r 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/build/javanokiasound.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/build/javanokiasound.pro Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/build/javanokiasound_0x2002DCC4.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/build/javanokiasound_0x2002DCC4.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,150 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/inc/CMIDClip.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/inc/CMIDClip.h Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/inc/CMIDSound.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/inc/CMIDSound.h Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/inc/CMIDSoundEvent.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/inc/CMIDSoundEvent.h Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/inc/CMIDSoundImpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/inc/CMIDSoundImpl.h Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/inc/CMIDTone.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/inc/CMIDTone.h Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/inc/MMIDEventSender.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/inc/MMIDEventSender.h Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/javasrc/com/nokia/mid/sound/Sound.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/javasrc/com/nokia/mid/sound/Sound.java Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/javasrc/com/nokia/mid/sound/SoundListener.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/javasrc/com/nokia/mid/sound/SoundListener.java Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/src/CMIDSoundImpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/src/CMIDSoundImpl.cpp Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/src/cmidclip.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/src/cmidclip.cpp Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/src/cmidsound.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/src/cmidsound.cpp Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,313 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/src/cmidtone.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/src/cmidtone.cpp Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound/src/sound.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/nokiasound/src/sound.cpp Mon Aug 23 16:38:44 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/build/bld.inf --- a/javauis/nokiasound_akn/build/bld.inf Mon Jul 19 17:58:36 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 -javanokiasound_0x2002DCC4.mmp diff -r 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/build/build.xml --- a/javauis/nokiasound_akn/build/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - diff -r 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/build/bwins/javanokiasoundu.def --- a/javauis/nokiasound_akn/build/bwins/javanokiasoundu.def Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/build/eabi/javanokiasoundu.def --- a/javauis/nokiasound_akn/build/eabi/javanokiasoundu.def Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z10jni_lookupPKc @ 1 NONAME - diff -r 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/build/javanokiasound.pro --- a/javauis/nokiasound_akn/build/javanokiasound.pro Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/build/javanokiasound_0x2002DCC4.mmp --- a/javauis/nokiasound_akn/build/javanokiasound_0x2002DCC4.mmp Mon Jul 19 17:58:36 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.3) 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/inc/CMIDClip.h --- a/javauis/nokiasound_akn/inc/CMIDClip.h Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/inc/CMIDSound.h --- a/javauis/nokiasound_akn/inc/CMIDSound.h Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/inc/CMIDSoundEvent.h --- a/javauis/nokiasound_akn/inc/CMIDSoundEvent.h Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/inc/CMIDSoundImpl.h --- a/javauis/nokiasound_akn/inc/CMIDSoundImpl.h Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/inc/CMIDTone.h --- a/javauis/nokiasound_akn/inc/CMIDTone.h Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/inc/MMIDEventSender.h --- a/javauis/nokiasound_akn/inc/MMIDEventSender.h Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/javasrc/com/nokia/mid/sound/Sound.java --- a/javauis/nokiasound_akn/javasrc/com/nokia/mid/sound/Sound.java Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/javasrc/com/nokia/mid/sound/SoundListener.java --- a/javauis/nokiasound_akn/javasrc/com/nokia/mid/sound/SoundListener.java Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/src/CMIDSoundImpl.cpp --- a/javauis/nokiasound_akn/src/CMIDSoundImpl.cpp Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/src/cmidclip.cpp --- a/javauis/nokiasound_akn/src/cmidclip.cpp Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/src/cmidsound.cpp --- a/javauis/nokiasound_akn/src/cmidsound.cpp Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,309 +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->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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/src/cmidtone.cpp --- a/javauis/nokiasound_akn/src/cmidtone.cpp Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/nokiasound_akn/src/sound.cpp --- a/javauis/nokiasound_akn/src/sound.cpp Mon Jul 19 17:58:36 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 5bec7efefe18 -r d1278d87b01e javauis/remconobserver_akn/build/javaremconobserver_0x2002DCCA.mmp --- a/javauis/remconobserver_akn/build/javaremconobserver_0x2002DCCA.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/remconobserver_akn/build/javaremconobserver_0x2002DCCA.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javaremconobserver.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javauis/runtimeui_akn/build/javaruntimeui_0x2002DCCD.mmp --- a/javauis/runtimeui_akn/build/javaruntimeui_0x2002DCCD.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/runtimeui_akn/build/javaruntimeui_0x2002DCCD.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javaruntimeui.mmp @@ -52,7 +52,6 @@ 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 5bec7efefe18 -r d1278d87b01e javauis/runtimeui_akn/loc/javausermessages.loc --- a/javauis/runtimeui_akn/loc/javausermessages.loc Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/runtimeui_akn/loc/javausermessages.loc Mon Aug 23 16:38:44 2010 +0100 @@ -450,6 +450,18 @@ #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 5bec7efefe18 -r d1278d87b01e javauis/softnotification_akn/build/javasoftnotification_0x2002DCD6.mmp --- a/javauis/softnotification_akn/build/javasoftnotification_0x2002DCD6.mmp Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/softnotification_akn/build/javasoftnotification_0x2002DCD6.mmp Mon Aug 23 16:38:44 2010 +0100 @@ -16,7 +16,7 @@ */ // ============================================================================== -// Generated by qmake (2.01a) (Qt 4.6.3) on: (date) +// 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 : javasoftnotification.mmp @@ -52,7 +52,6 @@ MACRO RD_JAVA_MIDPRMS_DB MACRO __SYMBIAN32__ MACRO J9EPOC32 -MACRO RD_JAVA_OMJ_FSERVER SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian SYSTEMINCLUDE ../inc diff -r 5bec7efefe18 -r d1278d87b01e javauis/subsystem.mk --- a/javauis/subsystem.mk Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/subsystem.mk Mon Aug 23 16:38:44 2010 +0100 @@ -23,13 +23,16 @@ NONQTSUBSYSTEMS += \ coreui/build +COMPONENTS += nokiasound/build # # Common legacy utilities # SUBSYSTEMS += javalegacyutils -SYMBIAN_ONLY += javalegacyutils + +SYMBIAN_ONLY += javalegacyutils nokiasound/build + # diff -r 5bec7efefe18 -r d1278d87b01e javauis/subsystem_akn.mk --- a/javauis/subsystem_akn.mk Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/subsystem_akn.mk Mon Aug 23 16:38:44 2010 +0100 @@ -22,7 +22,6 @@ m2g_akn/build \ m3g_akn/build \ mmapi_akn/build \ - nokiasound_akn/build \ remconobserver_akn/build \ runtimeui_akn/build \ softnotification_akn/build diff -r 5bec7efefe18 -r d1278d87b01e javauis/subsystem_qt.mk --- a/javauis/subsystem_qt.mk Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/subsystem_qt.mk Mon Aug 23 16:38:44 2010 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +# Copyright (c) 2009, 2010 Nokia Corporation and/or its subsidiary(-ies). # All rights reserved. # This component and the accompanying materials are made available # under the terms of "Eclipse Public License v1.0" @@ -14,6 +14,10 @@ # Description: Makefile for Qt based components and subsystems # -COMPONENTS += eswt_qt/build lcdui_qt/build runtimeui_qt/build nokiauiapi_qt/build mmapi_qt/build amms_qt/build +SUBSYSTEMS += eswt_qt/build +COMPONENTS += lcdui_qt/build runtimeui_qt/build nokiauiapi_qt/build mmapi_qt/build amms_qt/build m3g_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 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_Alert_01/build.xml --- a/javauis/tsrc/fute/lcdui/Midp_Alert_01/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_Alert_01/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -28,7 +28,7 @@ - + diff -r 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_Alert_01/src/AlertTests.java --- a/javauis/tsrc/fute/lcdui/Midp_Alert_01/src/AlertTests.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_Alert_01/src/AlertTests.java Mon Aug 23 16:38:44 2010 +0100 @@ -156,6 +156,14 @@ 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 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_Form_01/build.xml --- a/javauis/tsrc/fute/lcdui/Midp_Form_01/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_Form_01/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -28,7 +28,7 @@ - + diff -r 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_Form_01/src/FormMethodsTests.java --- a/javauis/tsrc/fute/lcdui/Midp_Form_01/src/FormMethodsTests.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_Form_01/src/FormMethodsTests.java Mon Aug 23 16:38:44 2010 +0100 @@ -56,7 +56,7 @@ private final String imgStr = "ImageItem"; - private final String spacerStr = "Spacer"; + private final String spacerStr = "Spacer (100x100)"; private ChoiceGroup cg = null; @@ -324,7 +324,7 @@ else if (item.equals(imgStr)) addImageItem(); else if (item.equals(spacerStr)) - addSpacer(10,10); + addSpacer(100,100); else if (item.equals(tfStr)) { addTextField("ANY", TextField.ANY); diff -r 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General/res/small.png Binary file javauis/tsrc/fute/lcdui/Midp_General/res/small.png has changed diff -r 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General/src/EmptyForm.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General/src/EmptyForm.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,41 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_01.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_01.java Mon Aug 23 16:38:44 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.*; + +/** + * 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 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_02.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_02.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,89 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_03.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_03.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,80 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_04.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_04.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,108 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_05.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_05.java Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,89 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General_02/build.xml --- a/javauis/tsrc/fute/lcdui/Midp_General_02/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General_02/src/Midp_General_02.java --- a/javauis/tsrc/fute/lcdui/Midp_General_02/src/Midp_General_02.java Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +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.*; - -/** - * - */ - -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 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General_04/build.xml --- a/javauis/tsrc/fute/lcdui/Midp_General_04/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General_04/src/Midp_General_04.java --- a/javauis/tsrc/fute/lcdui/Midp_General_04/src/Midp_General_04.java Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +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.*; - -/** - * - */ - -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 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General_05/build.xml --- a/javauis/tsrc/fute/lcdui/Midp_General_05/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_General_05/src/Midp_General_05.java --- a/javauis/tsrc/fute/lcdui/Midp_General_05/src/Midp_General_05.java Mon Jul 19 17:58:36 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.*; - -/** - * - */ - -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 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_StringItem_01/build.xml --- a/javauis/tsrc/fute/lcdui/Midp_StringItem_01/build.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_StringItem_01/build.xml Mon Aug 23 16:38:44 2010 +0100 @@ -28,7 +28,7 @@ - + diff -r 5bec7efefe18 -r d1278d87b01e javauis/tsrc/fute/lcdui/Midp_StringItem_01/src/FormStringItemTests.java --- a/javauis/tsrc/fute/lcdui/Midp_StringItem_01/src/FormStringItemTests.java Mon Jul 19 17:58:36 2010 +0100 +++ b/javauis/tsrc/fute/lcdui/Midp_StringItem_01/src/FormStringItemTests.java Mon Aug 23 16:38:44 2010 +0100 @@ -62,9 +62,11 @@ //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); @@ -97,6 +99,11 @@ 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) @@ -118,7 +125,9 @@ append(cg); addCommand(cmdCreate); addCommand(cmdCreateHL); + addCommand(cmdCreateHLM); addCommand(cmdCreateButton); + addCommand(cmdCreateButtonM); addCommand(cmdLayout); addCommand(cmdLayoutHL); addCommand(cmdLayoutButton); @@ -134,6 +143,7 @@ //create StringItemForm stringItemForm = new Form("StringItem"); stringItemForm.addCommand(cmdBack); + stringItemForm.addCommand(cmdScreenF); stringItemForm.setCommandListener(this); } @@ -223,39 +233,27 @@ } 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) { @@ -272,6 +270,11 @@ m.destroyApp(false); m.notifyDestroyed(); } + else if (c == cmdScreenF) + { + stringItemForm.addCommand(cmdItemF); + stringItemForm.addCommand(cmdOkF); + } else { String l = label.getString(); @@ -282,12 +285,12 @@ if (c == cmdCreate) si = new StringItem(l, t); - else if (c == cmdCreateHL) + else if (c == cmdCreateHL || c == cmdCreateHLM) { si = new StringItem(l, t, Item.HYPERLINK); si.setDefaultCommand(cmdItem); } - else if (c == cmdCreateButton) + else if (c == cmdCreateButton || c == cmdCreateButtonM) { si = new StringItem(l, t, Item.BUTTON); si.setDefaultCommand(cmdItem); @@ -352,6 +355,10 @@ stringItemForm.addCommand(cmdRemoveCommand); stringItemForm.addCommand(cmdRestoreCommand); stringItemForm.addCommand(cmdRemoveItem); + if (c == cmdCreateButtonM || c == cmdCreateHLM) + { + si.addCommand(cmdBack); + } Display.getDisplay(m).setCurrent(stringItemForm); } } diff -r 5bec7efefe18 -r d1278d87b01e layers.sysdef.xml --- a/layers.sysdef.xml Mon Jul 19 17:58:36 2010 +0100 +++ b/layers.sysdef.xml Mon Aug 23 16:38:44 2010 +0100 @@ -10,22 +10,10 @@ - - - - - - - - - diff -r 5bec7efefe18 -r d1278d87b01e rom/java_2_1.iby --- a/rom/java_2_1.iby Mon Jul 19 17:58:36 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,361 +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_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.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 - -#endif diff -r 5bec7efefe18 -r d1278d87b01e rom/java_2_2.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/java_2_2.iby Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,372 @@ +/* +* 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 5bec7efefe18 -r d1278d87b01e rom/java_3_1.iby --- a/rom/java_3_1.iby Mon Jul 19 17:58:36 2010 +0100 +++ b/rom/java_3_1.iby Mon Aug 23 16:38:44 2010 +0100 @@ -36,13 +36,12 @@ // 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 -#endif +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 // 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 @@ -50,6 +49,7 @@ 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 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK file=ABI_DIR\BUILD_DIR\javacaptain_ext_scrupdater.dll SHARED_LIB_DIR\javacaptain_ext_scrupdater.dll #endif @@ -61,8 +61,6 @@ 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 @@ -73,23 +71,21 @@ 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=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=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,javasidchecker.rsc) -data=ZRESOURCE\plugins\javasidchecker.rsc ECOM_RESOURCE_DIR\javasidchecker.rsc +file=ABI_DIR\BUILD_DIR\javaappscheme.exe PROGRAMS_DIR\javaappscheme.exe +file=ABI_DIR\BUILD_DIR\javaqtrequest.exe PROGRAMS_DIR\javaqtrequest.exe #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 @@ -117,22 +113,13 @@ // 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 @@ -146,22 +133,21 @@ data=JAVA_VM_RES_BLD\javasoftnotification.odc JAVA_VM_RES_IMG\javasoftnotification.odc */ -// 2G API +// M2G 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 +// M3G 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 @@ -180,6 +166,7 @@ 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 @@ -344,6 +331,15 @@ 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 // @@ -356,8 +352,12 @@ 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 5bec7efefe18 -r d1278d87b01e rom/javacontrolpanelodclist --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/javacontrolpanelodclist Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,7 @@ +javautils.odc +javacomms.odc +javalegacyutils.odc +eswt.odc +eswtdirectcontent.odc +resources.jar +javacontrolpanel.odc diff -r 5bec7efefe18 -r d1278d87b01e rom/javacontrolpanelodclist30 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rom/javacontrolpanelodclist30 Mon Aug 23 16:38:44 2010 +0100 @@ -0,0 +1,5 @@ +javautils.odc +javacomms.odc +eswtqt.odc +resources.jar +javacontrolpanel.odc diff -r 5bec7efefe18 -r d1278d87b01e rom/javatest.iby --- a/rom/javatest.iby Mon Jul 19 17:58:36 2010 +0100 +++ b/rom/javatest.iby Mon Aug 23 16:38:44 2010 +0100 @@ -46,9 +46,10 @@ 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 -// 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 +// 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 #endif diff -r 5bec7efefe18 -r d1278d87b01e rom/midpodclist30 --- a/rom/midpodclist30 Mon Jul 19 17:58:36 2010 +0100 +++ b/rom/midpodclist30 Mon Aug 23 16:38:44 2010 +0100 @@ -1,4 +1,5 @@ eswtqt.odc +javaamms.odc javabluecove.odc javabluetooth.odc javabluetoothcommons.odc @@ -17,6 +18,7 @@ javam3g.odc javamidpruntime.odc javamobinfo.odc +javamobilemedia.odc javanokiasound.odc javapim.odc javapushregistry.odc