# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1284541525 -10800 # Node ID 7cee158cb8cd605277b91c03dafe0251a87f3dec # Parent d5e927d5853b7b9b3ce145925fbb0c825dcacef6 Revision: v2.2.13 Kit: 201036 diff -r d5e927d5853b -r 7cee158cb8cd build/Makefile.defs --- a/build/Makefile.defs Tue Sep 14 21:06:50 2010 +0300 +++ b/build/Makefile.defs Wed Sep 15 12:05:25 2010 +0300 @@ -42,13 +42,17 @@ export JAVA_HOME=$(JAVA_6_HOME) ifeq ($(notdir $(basename $(SHELL))),sh) - # Cygwin definitions + # Cygwin & Linux definitions BATPREFIX = RMFILE = rm $(call PATHFIX, $(1)) RMFILES = $(RMFILE) CATCOMMAND = cat $(call PATHFIX, $(1)) PATHFIX = $(subst \,/,$(1)) - ANT := sh ant + ifeq ($(OS),Windows_NT) + ANT := sh ant + else + ANT := ant + endif SBS = MAKELEVEL=&&MAKEFLAGS=&&MFLAGS=&&sbs CPPCMD = gcc -E -x assembler-with-cpp -P -undef -w -traditional-cpp IFNOTEXIST = if [ ! -f $(1) ]; then $(2); fi @@ -245,10 +249,12 @@ generateconffiles: @echo Writing $(BUILDDEFINEFILE) ... \ $(shell $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/generated_header.txt) > $(BUILDDEFINEFILE)) \ - $(shell echo #define RD_JAVA_VERSION $(JAVA_VERSION_) >> $(BUILDDEFINEFILE)) \ + $(shell echo #define RD_JAVA_VERSION $(JAVA_VERSION_)>> $(BUILDDEFINEFILE)) \ + $(shell echo #define RD_JAVA_BIN_VERSION_NONQT $(shell python $(JAVA_SRC_ROOT)/build/buildutils/ver2binver.py mmp $(JAVA_VERSION))>> $(BUILDDEFINEFILE)) \ $(foreach d, $(PROJECT_DEFINES), $(shell echo #define $d >> $(BUILDDEFINEFILE))) @echo Writing $(QBUILDDEFINEFILE) ... \ $(shell $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/generated_header_hash.txt) > $(QBUILDDEFINEFILE)) \ + $(shell echo RD_JAVA_BIN_VERSION = $(shell python $(JAVA_SRC_ROOT)/build/buildutils/ver2binver.py qmake $(JAVA_VERSION))>> $(QBUILDDEFINEFILE)) \ $(shell echo PROJECT_DEFINES *= $(PROJECT_DEFINES) >> $(QBUILDDEFINEFILE)) @echo Writing $(JAVAVERSIONFILE) \ $(shell echo $(JAVA_VERSION)>$(JAVAVERSIONFILE)) diff -r d5e927d5853b -r 7cee158cb8cd build/Makefile.project --- a/build/Makefile.project Tue Sep 14 21:06:50 2010 +0300 +++ b/build/Makefile.project Wed Sep 15 12:05:25 2010 +0300 @@ -49,6 +49,9 @@ # Use release written in file include $(RD_JAVA_S60_RELEASE_FILE) else + ifneq ($(wildcard $(addsuffix Symbianv4.sis,$(S60_STUBSIS_DIRS))),) + RD_JAVA_S60_RELEASE = 10.1 + else ifneq ($(wildcard $(addsuffix Series60v5.2.sis,$(S60_STUBSIS_DIRS))),) RD_JAVA_S60_RELEASE = 9.2 else @@ -63,6 +66,7 @@ endif endif endif + endif # Export the release info, so that no autodetermination is needed after this export RD_JAVA_S60_RELEASE endif @@ -184,6 +188,14 @@ PROJECT_DEFINES += RD_JAVA_PROXIMITY_LISTENER_ENABLED endif +# Java PIM Multiple Calendar exsist in 9.2 only(can not be used if 5.0 and for 10.1 as native support doesn't exsist) +ifdef RD_JAVA_S60_RELEASE_9_2 + RD_JAVA_PIM_MULTICAL_ENABLED = 1 +endif +ifdef RD_JAVA_PIM_MULTICAL_ENABLED + PROJECT_DEFINES += RD_JAVA_PIM_MULTICAL_ENABLED +endif + ifeq ($(OPENC_BETA_PATCH),1) PROJECT_DEFINES += RD_JAVA_OPENC_BETA_PATCH endif diff -r d5e927d5853b -r 7cee158cb8cd build/buildutils/checkwarnings.py --- a/build/buildutils/checkwarnings.py Tue Sep 14 21:06:50 2010 +0300 +++ b/build/buildutils/checkwarnings.py Wed Sep 15 12:05:25 2010 +0300 @@ -25,17 +25,15 @@ # Counters for various warnings totalWarnings = 0 badOnes = 0 - deprecatedWarnings = 0 + pragmaWarnings = 0 compilerWarnings = 0 linkerWarnings = 0 postlinkerWarnings = 0 flmWarnings = 0 - # Constants for matching warnings related to deprecation - deprecatedStart = "warning: preprocessor #warning directive" - deprecatedSecondLine = "warning: #warning This header file" - deprecatedOptionalThirdLine = "warning: (included from:" - deprecatedOptionalRest = "warning: " + # Constants for matching pragma generated warnings + pragmaStart = "warning: preprocessor #warning directive" + pragmaOptionalRest = "warning: " # This list includes strings from which the BAD warnings can be recognized. # Note that these must be in lower case! @@ -61,7 +59,7 @@ print "" print "Details:" print " FLM warnings: ", self.flmWarnings - print " Use of deprecated api: ", self.deprecatedWarnings + print " Pragma warnings: ", self.pragmaWarnings print " Other compiler warnings: ", self.compilerWarnings print " Linker warnings: ", self.linkerWarnings print " Post-linker warnings: ", self.postlinkerWarnings @@ -71,7 +69,7 @@ class PrintSettings: """Class parsing and maintaining the printing settings related to warnings""" - printDeprecatedWarnings = False + printPragmaWarnings = False printCompilerWarnings = False printLinkerWarnings = False printFlmWarnings = False @@ -87,8 +85,8 @@ default=False, help="Prints compiler warnings") parser.add_option("--pl", dest="printlinkerwarnings", action="store_true", default=False, help="Prints linker warnings") - parser.add_option("--pd", dest="printdeprecatedwarnings", action="store_true", - default=False, help="Prints deprecation warnings") + parser.add_option("--pp", dest="printpragmawarnings", action="store_true", + default=False, help="Prints pragma warnings") parser.add_option("--pf", dest="printflmwarnings", action="store_true", default=False, help="Prints FLM warnings") (opts, args) = parser.parse_args() @@ -98,12 +96,12 @@ sys.exit(-1) if opts.printall: - self.printDeprecatedWarnings = True + self.printPragmaWarnings = True self.printCompilerWarnings = True self.printLinkerWarnings = True self.printFlmWarnings = True else: - self.printDeprecatedWarnings = opts.printdeprecatedwarnings + self.printPragmaWarnings = opts.printpragmawarnings self.printCompilerWarnings = opts.printcompilerwarnings self.printLinkerWarnings = opts.printlinkerwarnings self.printFlmWarnings = opts.printflmwarnings @@ -119,7 +117,7 @@ # should have always zero of them. The related log message strings are defined # in the variable badWarnings above. # -# The warnings are further categorized as deprecated API warnings, compiler +# The warnings are further categorized as pragma warnings, compiler # warnings, linker, and post-linker warnings. # def main(): @@ -168,12 +166,12 @@ # Looking for any warning related to the current target if state == 1: - # Check first for the start of a multiline deprecation warning - if wh.deprecatedStart in line: - if settings.printDeprecatedWarnings: + # Check first for the start of a multiline pragma warning + if wh.pragmaStart in line: + if settings.printPragmaWarnings: print underCompilation, print line, - wh.deprecatedWarnings += 1 + wh.pragmaWarnings += 1 wh.totalWarnings += 1 return 2 @@ -220,37 +218,17 @@ return 1 - # Looking for the second line of the multiline deprecation warning + # Looking for the optional trailing lines of the multiline pragma warning if state == 2: - if wh.deprecatedSecondLine in line: - if settings.printDeprecatedWarnings: + if wh.pragmaOptionalRest in line: + if settings.printPragmaWarnings: print line, - return 3 - else: - print "Missing second line" - return 1 - - # Looking for the optional third line of the multiline deprecation warning - if state == 3: - if wh.deprecatedOptionalThirdLine in line: - if settings.printDeprecatedWarnings: - print line, - return 4 - else: - # Hmm... went one line too far -> need to check the current line again - # but now in the state 1 - return stateMachine(1, line, underCompilation, settings, wh) - - # Looking for the optional trailing lines of the multiline deprecation warning - if state == 4: - if wh.deprecatedOptionalRest in line: - if settings.printDeprecatedWarnings: - print line, - return 4 + return 2 else: # Hmm... went one line too far -> need to check the current line again # but now in the state 1 return stateMachine(1, line, underCompilation, settings, wh) + # Looking for MAKEDEF detailed information lines if state == 5: diff -r d5e927d5853b -r 7cee158cb8cd build/buildutils/distribution.policy.s60.configuration.txt --- a/build/buildutils/distribution.policy.s60.configuration.txt Tue Sep 14 21:06:50 2010 +0300 +++ b/build/buildutils/distribution.policy.s60.configuration.txt Wed Sep 15 12:05:25 2010 +0300 @@ -16,9 +16,11 @@ /swt/internal : 7 /swt/expanded/internal : 7 /swt/mobile/internal : 7 +/nokiauiapi_qt/src/com/nokia/mid/ui/internal : 7 /internal : 1 /releng : 1 ROOT/tools : 1 +ROOT/jrt_info : 1 ROOT/javacommons/jvms/j9/s60 : 810 /midprms : 102 /webservices/javasrc : 102 diff -r d5e927d5853b -r 7cee158cb8cd build/buildutils/ver2binver.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/buildutils/ver2binver.py Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,64 @@ +# +# 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: +# +# This script changes a JRT version to a binary version usable as +# Symbian mmp-file version or qmake's version. +# - each version part is cut to three digits, and then to 8 bits +# - qmake's version is taken as is, mmp's version is mangled as by qmake (the +# resulting version is the same in binaries). +# - major version is always 10 + +import sys, re + + +USAGE = "usage: %s [qmake|mmp] 1.2.3\n" % sys.argv[0] + +def main(): + try: + if len(sys.argv) != 3: + raise Exception(USAGE) + + mode, javaversion = sys.argv[1:] + + if mode != "qmake" and mode != "mmp": + raise Exception(USAGE) + + # Match version + parts = re.match(r"^(\d+)\.(\d+)\.(\d+)$", javaversion) + if not parts: + raise Exception(USAGE) + + # Change to integer + parts = [int(p) for p in parts.groups()] + + # Modulo 1000, 256 + parts = [(p % 1000) % 256 for p in parts] + + # Print according to type + if mode == "qmake": + print "%d.%d.%d" % (10, parts[1], parts[2]) + else: + print "%d.%d" % (10, (parts[1] << 8) + parts[2]) + + + except Exception, e: + sys.stderr.write(e.__str__()) + sys.exit(1) + + +if __name__ == "__main__": + main() + + diff -r d5e927d5853b -r 7cee158cb8cd build/makefile --- a/build/makefile Tue Sep 14 21:06:50 2010 +0300 +++ b/build/makefile Wed Sep 15 12:05:25 2010 +0300 @@ -73,11 +73,21 @@ ifdef RD_JAVA_S60_RELEASE_9_2 prep: configure qmake endif +ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS +prep: pkgdefsetup +endif SYSDEF_TEMPLATE = $(JAVA_SRC_ROOT)/build/templates/$(RD_JAVA_S60_RELEASE).layers.sysdef.xml sysdefsetup: $(call CATCOMMAND,$(wildcard $(SYSDEF_TEMPLATE)))>$(JAVA_SRC_ROOT)/layers.sysdef.xml +pkgdefsetup: + $(call MKDIR, $(call PATHFIX, $(JAVA_SRC_ROOT)/jrt_info)) + $(call MKDIR, $(call PATHFIX, $(JAVA_SRC_ROOT)/jrt_info/nokia_jrt_metadata)) + $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/pkgmap_template.xml)>$(JAVA_SRC_ROOT)/package_map.xml + $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/pkgdef_template.xml)>$(JAVA_SRC_ROOT)/package_definition.xml + $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/nokia_pkgdef_template.xml)>$(JAVA_SRC_ROOT)/jrt_info/nokia_jrt_metadata/package_definition.xml + # Cleaning java from top level cleans also the API jars clean_java: cleanapijars cleanapijars: diff -r d5e927d5853b -r 7cee158cb8cd build/makefile.javaversion --- a/build/makefile.javaversion Tue Sep 14 21:06:50 2010 +0300 +++ b/build/makefile.javaversion Wed Sep 15 12:05:25 2010 +0300 @@ -1,2 +1,2 @@ # Set Java version (must be dot separated, without spaces) -JAVA_VERSION = 2.2.11 +JAVA_VERSION = 2.2.13 diff -r d5e927d5853b -r 7cee158cb8cd build/omj.pri --- a/build/omj.pri Tue Sep 14 21:06:50 2010 +0300 +++ b/build/omj.pri Wed Sep 15 12:05:25 2010 +0300 @@ -132,8 +132,12 @@ MMP_RULES += " OS_LAYER_STDCPP_SYSTEMINCLUDE" } } + } + # Set version if not defined + isEmpty(VERSION):!isEmpty(RD_JAVA_BIN_VERSION): VERSION = $${RD_JAVA_BIN_VERSION} + # Define generated paths JXE_SOURCE_PATH = $${JAVA_ARTIFACTS} LOOKUP_SOURCE_PATH = $${JAVA_ARTIFACTS} diff -r d5e927d5853b -r 7cee158cb8cd build/properties.xml --- a/build/properties.xml Tue Sep 14 21:06:50 2010 +0300 +++ b/build/properties.xml Wed Sep 15 12:05:25 2010 +0300 @@ -12,7 +12,7 @@ # # Contributors: # -# Description: +# Description: # --> @@ -58,7 +58,7 @@ - + @@ -71,29 +71,33 @@ - - - + - - + - - + - + + + @@ -102,20 +106,20 @@ - - - - - @@ -124,14 +128,14 @@ - - + - @@ -144,19 +148,19 @@ - - - - @@ -166,7 +170,7 @@ - + @@ -183,10 +187,10 @@ - + - + @@ -243,7 +247,7 @@ @@ -255,7 +259,7 @@ define.target.cfg, set.s60.properties, set.linux.properties, - define.bootclasspath, + define.bootclasspath, init.component.properties, define.javasrc.path, define.jar.filename, @@ -275,7 +279,7 @@ - + @@ -304,14 +308,14 @@ - + - + diff -r d5e927d5853b -r 7cee158cb8cd build/sis/java_2_0.pkg --- a/build/sis/java_2_0.pkg Tue Sep 14 21:06:50 2010 +0300 +++ b/build/sis/java_2_0.pkg Wed Sep 15 12:05:25 2010 +0300 @@ -393,6 +393,8 @@ "\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" +"\epoc32\release\armv5\urel\javacentrep.dll"-"c:\sys\bin\javacentrep.dll" +"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javacentrep.odc"-"c:\resource\java\jvm\lib\jrt\javacentrep.odc" ; Misc dlls #ifdef RD_JAVA_S60_RELEASE_5_0_IAD @@ -403,7 +405,7 @@ ; Application Manager 2 plugin #ifndef RD_JAVA_S60_RELEASE_5_0_IAD "\epoc32\release\armv5\urel\appmngr2midletplugin.dll"-"c:\sys\bin\appmngr2midletplugin.dll" -"\epoc32\data\z\resource\plugins\appmngr2midletplugin.rsc"-"c:\resource\plugins\appmngr2midletplugin.rsc" +"\epoc32\data\z\resource\java\iad\appmngr2midletplugin.rsc"-"c:\resource\plugins\appmngr2midletplugin.rsc" "\epoc32\data\z\resource\java\javaapplicationsettings.r01"-"c:\resource\java\javaapplicationsettings.r01" "\epoc32\data\z\resource\java\javaapplicationsettings.r02"-"c:\resource\java\javaapplicationsettings.r02" "\epoc32\data\z\resource\java\javaapplicationsettings.r03"-"c:\resource\java\javaapplicationsettings.r03" @@ -517,8 +519,8 @@ ; 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\data\z\resource\java\iad\ifeui.rsc" -"c:\resource\plugins\ifeui.rsc" +"\epoc32\data\z\resource\java\iad\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" #ifdef RD_JAVA_S60_RELEASE_5_0_IAD @@ -532,9 +534,9 @@ "\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\plugins\javaunicertstoreplugin.rsc" -"c:\resource\plugins\javaunicertstoreplugin.rsc" -"\epoc32\data\z\resource\plugins\midp2backupplugin.rsc"-"c:\resource\plugins\midp2backupplugin.rsc" +"\epoc32\data\z\resource\java\iad\javasidchecker.rsc" -"c:\resource\plugins\javasidchecker.rsc" +"\epoc32\data\z\resource\java\iad\javaunicertstoreplugin.rsc" -"c:\resource\plugins\javaunicertstoreplugin.rsc" +"\epoc32\data\z\resource\java\iad\midp2backupplugin.rsc"-"c:\resource\plugins\midp2backupplugin.rsc" #ifndef RD_JAVA_S60_RELEASE_5_0_IAD "\epoc32\data\z\resource\java\javausermessages.r01"-"c:\resource\java\javausermessages.r01" "\epoc32\data\z\resource\java\javausermessages.r02"-"c:\resource\java\javausermessages.r02" @@ -670,13 +672,13 @@ "\epoc32\release\armv5\urel\lcdgr.dll"-"c:\sys\bin\lcdgr.dll" "\epoc32\release\armv5\urel\lcdui.dll"-"c:\sys\bin\lcdui.dll" "\epoc32\release\armv5\urel\LCDC16MA.dll"-"c:\sys\bin\LCDC16MA.dll" -"\epoc32\data\z\resource\plugins\LCDC16MA.rsc"-"c:\resource\plugins\LCDC16MA.rsc" +"\epoc32\data\z\resource\java\iad\LCDC16MA.rsc"-"c:\resource\plugins\LCDC16MA.rsc" "\epoc32\release\armv5\urel\LCDC16MU.dll"-"c:\sys\bin\LCDC16MU.dll" -"\epoc32\data\z\resource\plugins\LCDC16MU.rsc"-"c:\resource\plugins\LCDC16MU.rsc" +"\epoc32\data\z\resource\java\iad\LCDC16MU.rsc"-"c:\resource\plugins\LCDC16MU.rsc" "\epoc32\release\armv5\urel\LCDC4K.dll"-"c:\sys\bin\LCDC4K.dll" -"\epoc32\data\z\resource\plugins\LCDC4K.rsc"-"c:\resource\plugins\LCDC4K.rsc" +"\epoc32\data\z\resource\java\iad\LCDC4K.rsc"-"c:\resource\plugins\LCDC4K.rsc" "\epoc32\release\armv5\urel\LCDC64K.dll"-"c:\sys\bin\LCDC64K.dll" -"\epoc32\data\z\resource\plugins\LCDC64K.rsc"-"c:\resource\plugins\LCDC64K.rsc" +"\epoc32\data\z\resource\java\iad\LCDC64K.rsc"-"c:\resource\plugins\LCDC64K.rsc" "\epoc32\release\armv5\urel\lcdgdrv.dll"-"c:\sys\bin\lcdgdrv.dll" "\epoc32\release\armv5\urel\lcdgdrvi.dll"-"c:\sys\bin\lcdgdrvi.dll" "\epoc32\release\armv5\urel\lcduiphysicswrap.dll"-"c:\sys\bin\lcduiphysicswrap.dll" @@ -806,6 +808,10 @@ "\epoc32\data\z\resource\java\eswtcore.rsc"-"c:\resource\java\eswtcore.rsc" +#ifndef RD_JAVA_S60_RELEASE_5_0_IAD +"\epoc32\release\armv5\urel\javaiconsizenotifplugin.dll"-"c:\sys\bin\javaiconsizenotifplugin.dll" +"\epoc32\data\z\resource\java\iad\javaiconsizenotifplugin.rsc"-"c:\resource\plugins\javaiconsizenotifplugin.rsc" +#endif // RD_JAVA_S60_RELEASE_5_0_IAD #ifdef RD_JAVA_S60_RELEASE_5_0_IAD @@ -828,8 +834,7 @@ "\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" +; javafinishjrtinstall is ran after Jrt 2.2 installation +"\epoc32\release\armv5\urel\javafinishjrtinstall.exe"-"c:\sys\bin\javafinishjrtinstall.exe", FR, RI, RW #endif // RD_JAVA_S60_RELEASE_5_0_IAD diff -r d5e927d5853b -r 7cee158cb8cd build/sis/java_3_1.pkg --- a/build/sis/java_3_1.pkg Tue Sep 14 21:06:50 2010 +0300 +++ b/build/sis/java_3_1.pkg Wed Sep 15 12:05:25 2010 +0300 @@ -163,7 +163,8 @@ "\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" - +"\epoc32\release\armv5\urel\javacentrep.dll"-"c:\sys\bin\javacentrep.dll" +"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javacentrep.odc"-"c:\resource\java\jvm\lib\jrt\javacentrep.odc" ; Misc dlls @@ -227,10 +228,10 @@ "\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" +"\epoc32\data\z\resource\java\iad\javaunicertstoreplugin.rsc" -"c:\resource\plugins\javaunicertstoreplugin.rsc" +"\epoc32\data\z\resource\java\iad\midp2backupplugin.rsc"-"c:\resource\plugins\midp2backupplugin.rsc" #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK -"\epoc32\data\z\resource\plugins\javasifplugin.rsc"-"c:\resource\plugins\javasifplugin.rsc" +"\epoc32\data\z\resource\java\iad\javasifplugin.rsc"-"c:\resource\plugins\javasifplugin.rsc" #endif "\epoc32\data\z\resource\java\javausermessages.r01"-"c:\resource\java\javausermessages.r01" @@ -323,9 +324,6 @@ "\epoc32\release\armv5\urel\javaamms.dll"-"c:\sys\bin\javaamms.dll" "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javaamms.odc"-"c:\resource\java\jvm\lib\jrt\javaamms.odc" -;"\epoc32\release\armv5\urel\javalegacyutils.dll"-"c:\sys\bin\javalegacyutils.dll" -;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javalegacyutils.odc"-"c:\resource\java\jvm\lib\jrt\javalegacyutils.odc" - "\epoc32\release\armv5\urel\javamobilemedia.dll"-"c:\sys\bin\javamobilemedia.dll" "\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javamobilemedia.odc"-"c:\resource\java\jvm\lib\jrt\javamobilemedia.odc" "\epoc32\release\armv5\urel\z\system\sounds\digital\CamcorderJavaCapture.wav"-"c:\System\Sounds\Digital\CamcorderJavaCapture.wav" diff -r d5e927d5853b -r 7cee158cb8cd build/symbian_uids.pri --- a/build/symbian_uids.pri Tue Sep 14 21:06:50 2010 +0300 +++ b/build/symbian_uids.pri Wed Sep 15 12:05:25 2010 +0300 @@ -124,6 +124,8 @@ contains(TARGET, javacontrolpanel): TARGET.UID3 = 0x2002FF62 contains(TARGET, eswtqtwebkit): TARGET.UID3 = 0x2002FFA9 contains(TARGET, javaopengles): TARGET.UID3 = 0x20031DD1 +contains(TARGET, javacentrep): TARGET.UID3 = 0x2002DCE1 +contains(TARGET, javachapi): TARGET.UID3 = 0x2002DCE4 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 d5e927d5853b -r 7cee158cb8cd build/templates/nokia_pkgdef_template.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/templates/nokia_pkgdef_template.xml Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r d5e927d5853b -r 7cee158cb8cd build/templates/pkgdef_template.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/templates/pkgdef_template.xml Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r d5e927d5853b -r 7cee158cb8cd build/templates/pkgmap_template.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/templates/pkgmap_template.xml Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,1 @@ + diff -r d5e927d5853b -r 7cee158cb8cd build/unittest.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/build/unittest.properties Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ + + + +no.rommizing = true +no.collection.update = true diff -r d5e927d5853b -r 7cee158cb8cd build/utilities.xml --- a/build/utilities.xml Tue Sep 14 21:06:50 2010 +0300 +++ b/build/utilities.xml Wed Sep 15 12:05:25 2010 +0300 @@ -12,7 +12,7 @@ # # Contributors: # -# Description: +# Description: # --> @@ -24,27 +24,27 @@ APIs can use default values, but if some property is not suitable, it can be overridden. - java.src.paths The source path. If there are more than one source path + java.src.paths The source path. If there are more than one source path concatenate the paths using ':' as separator. Default is '../javasrc - java.src.second.paths The source path for the second phase compilation. - If there are more than one source path concatenate the + java.src.second.paths The source path for the second phase compilation. + If there are more than one source path concatenate the paths using ':' as separator. Default is '../javasrc.cdc bootclasspath The bootclasspath used for compile time. Default is CLDC - bootclasspath.second The bootclasspath used for the second phase + bootclasspath.second The bootclasspath used for the second phase compilation.. Default is CDC - native.dll.name The name of the dll (without extension) which will - contain the rommized byte code. The default value is the + native.dll.name The name of the dll (without extension) which will + contain the rommized byte code. The default value is the name of the ant project. - - + + Following properties are optionals: - javah.classnames A list of classes using ',' as separator to be + javah.classnames A list of classes using ',' as separator to be "javah"ed. --> @@ -52,12 +52,12 @@ - + @@ -78,26 +78,30 @@ - + - - + + + + + @@ -114,10 +118,10 @@ @@ -126,12 +130,12 @@ - - @@ -168,12 +172,12 @@ - - @@ -229,7 +233,7 @@ - + @@ -241,7 +245,7 @@ @@ -253,12 +257,12 @@ - + - @@ -292,7 +296,7 @@ @@ -304,20 +308,20 @@ - - - - + + @@ -370,7 +374,7 @@ - + @@ -380,7 +384,7 @@ - @@ -396,9 +400,9 @@ update="true"/> - @@ -411,9 +415,9 @@ /> - @@ -421,7 +425,7 @@ - + @@ -446,7 +450,7 @@ if they have changed, then they are copied into a directory that is included to the component's makefile --> - @@ -468,7 +472,7 @@ in order to include platform specific utility xml file.--> - @@ -518,8 +522,17 @@ + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -555,10 +613,10 @@ - - - - + + + + @@ -575,6 +633,7 @@ + diff -r d5e927d5853b -r 7cee158cb8cd inc/build_defines.hrh --- a/inc/build_defines.hrh Tue Sep 14 21:06:50 2010 +0300 +++ b/inc/build_defines.hrh Wed Sep 15 12:05:25 2010 +0300 @@ -15,7 +15,8 @@ * */ -#define RD_JAVA_VERSION 2,2,11 +#define RD_JAVA_VERSION 2,2,13 +#define RD_JAVA_BIN_VERSION_NONQT 10.525 #define RD_JAVA_SYMBIAN_TARGET #define RD_JAVA_S60_RELEASE_9_2 #define RD_JAVA_S60_RELEASE_9_2_ONWARDS @@ -25,6 +26,7 @@ #define RD_JAVA_HTTP_EMC_ENABLED #define RD_JAVA_NGA_ENABLED #define RD_JAVA_PROXIMITY_LISTENER_ENABLED +#define RD_JAVA_PIM_MULTICAL_ENABLED #define RD_JAVA_OPENC_BETA_PATCH #define RD_JAVA_INSTALLERUI_ENABLED #define RD_JAVA_PREWARM diff -r d5e927d5853b -r 7cee158cb8cd inc/build_defines.pri --- a/inc/build_defines.pri Tue Sep 14 21:06:50 2010 +0300 +++ b/inc/build_defines.pri Wed Sep 15 12:05:25 2010 +0300 @@ -13,4 +13,5 @@ # # Description: Generated file - do not edit manually # -PROJECT_DEFINES *= RD_JAVA_SYMBIAN_TARGET RD_JAVA_S60_RELEASE_9_2 RD_JAVA_S60_RELEASE_9_2_ONWARDS RD_JAVA_S60_RELEASE_5_0_ONWARDS RD_JAVA_STDCPPV5 RD_JAVA_EPOCALLOWDLLDATA_FIX RD_JAVA_HTTP_EMC_ENABLED RD_JAVA_NGA_ENABLED RD_JAVA_PROXIMITY_LISTENER_ENABLED RD_JAVA_OPENC_BETA_PATCH RD_JAVA_INSTALLERUI_ENABLED RD_JAVA_PREWARM RD_JAVA_ADVANCED_TACTILE_FEEDBACK RD_JAVA_MIDPRMS_DB +RD_JAVA_BIN_VERSION = 10.2.13 +PROJECT_DEFINES *= RD_JAVA_SYMBIAN_TARGET RD_JAVA_S60_RELEASE_9_2 RD_JAVA_S60_RELEASE_9_2_ONWARDS RD_JAVA_S60_RELEASE_5_0_ONWARDS RD_JAVA_STDCPPV5 RD_JAVA_EPOCALLOWDLLDATA_FIX RD_JAVA_HTTP_EMC_ENABLED RD_JAVA_NGA_ENABLED RD_JAVA_PROXIMITY_LISTENER_ENABLED RD_JAVA_PIM_MULTICAL_ENABLED RD_JAVA_OPENC_BETA_PATCH RD_JAVA_INSTALLERUI_ENABLED RD_JAVA_PREWARM RD_JAVA_ADVANCED_TACTILE_FEEDBACK RD_JAVA_MIDPRMS_DB diff -r d5e927d5853b -r 7cee158cb8cd inc/java.txt --- a/inc/java.txt Tue Sep 14 21:06:50 2010 +0300 +++ b/inc/java.txt Wed Sep 15 12:05:25 2010 +0300 @@ -1,1 +1,1 @@ -2.2.11 +2.2.13 diff -r d5e927d5853b -r 7cee158cb8cd inc/project_defines.hrh --- a/inc/project_defines.hrh Tue Sep 14 21:06:50 2010 +0300 +++ b/inc/project_defines.hrh Wed Sep 15 12:05:25 2010 +0300 @@ -24,6 +24,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM diff -r d5e927d5853b -r 7cee158cb8cd javacommons/comms/build/javacomms_0x2002DCA6.mmp --- a/javacommons/comms/build/javacomms_0x2002DCA6.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/comms/build/javacomms_0x2002DCA6.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -103,7 +104,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/comms/ipclib/clientserver/build/ipc_0x2002DCB7.mmp --- a/javacommons/comms/ipclib/clientserver/build/ipc_0x2002DCB7.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/comms/ipclib/clientserver/build/ipc_0x2002DCB7.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -104,7 +105,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/connectionmanager/build/javaconnectionmanager_0x2002DCA7.mmp --- a/javacommons/connectionmanager/build/javaconnectionmanager_0x2002DCA7.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/connectionmanager/build/javaconnectionmanager_0x2002DCA7.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -101,7 +102,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/fileutils/build/javafileutils.pro --- a/javacommons/fileutils/build/javafileutils.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/fileutils/build/javafileutils.pro Wed Sep 15 12:05:25 2010 +0300 @@ -19,7 +19,7 @@ CONFIG += omj java staticdata stl CONFIG -= qt -symbian : LIBS += -lefsrv -lPlatformEnv -lcaf +symbian : LIBS += -lefsrv -lplatformenv -lcaf LIBS+= -ljavautils -ljavacomms diff -r d5e927d5853b -r 7cee158cb8cd javacommons/fileutils/build/javafileutils_0x2002DCAD.mmp --- a/javacommons/fileutils/build/javafileutils_0x2002DCAD.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/fileutils/build/javafileutils_0x2002DCAD.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -86,7 +87,7 @@ LIBRARY efsrv.lib -LIBRARY PlatformEnv.lib +LIBRARY platformenv.lib LIBRARY caf.lib LIBRARY javautils.lib LIBRARY javacomms.lib @@ -118,7 +119,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/gcfbase/build/javagcf_0x2002DCAE.mmp --- a/javacommons/gcfbase/build/javagcf_0x2002DCAE.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/gcfbase/build/javagcf_0x2002DCAE.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -106,7 +107,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/gcfprotocols/file/build/javafile.pro --- a/javacommons/gcfprotocols/file/build/javafile.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/gcfprotocols/file/build/javafile.pro Wed Sep 15 12:05:25 2010 +0300 @@ -20,7 +20,7 @@ CONFIG -= qt symbian { - LIBS+= -leuser -lefsrv -lPlatformEnv + LIBS+= -leuser -lefsrv -lplatformenv } include(../../../../build/omj.pri) diff -r d5e927d5853b -r 7cee158cb8cd javacommons/gcfprotocols/file/build/javafile_0x2002DCAC.mmp --- a/javacommons/gcfprotocols/file/build/javafile_0x2002DCAC.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/gcfprotocols/file/build/javafile_0x2002DCAC.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -68,7 +69,7 @@ LIBRARY euser.lib LIBRARY efsrv.lib -LIBRARY PlatformEnv.lib +LIBRARY platformenv.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib @@ -97,7 +98,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/gcfprotocols/http/build/javahttp_0x2002DCB1.mmp --- a/javacommons/gcfprotocols/http/build/javahttp_0x2002DCB1.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/gcfprotocols/http/build/javahttp_0x2002DCB1.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -116,7 +117,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/gcfprotocols/https/build/javahttps_0x2002DCB2.mmp --- a/javacommons/gcfprotocols/https/build/javahttps_0x2002DCB2.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/gcfprotocols/https/build/javahttps_0x2002DCB2.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -107,7 +108,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/gcfprotocols/secureconnection/build/javassl_0x2002DCD7.mmp --- a/javacommons/gcfprotocols/secureconnection/build/javassl_0x2002DCD7.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/gcfprotocols/secureconnection/build/javassl_0x2002DCD7.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -109,7 +110,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/gcfprotocols/socket/serverconnection/build/javasocketscplugin_0x2002DCD5.mmp --- a/javacommons/gcfprotocols/socket/serverconnection/build/javasocketscplugin_0x2002DCD5.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/gcfprotocols/socket/serverconnection/build/javasocketscplugin_0x2002DCD5.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -103,7 +104,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/gcfprotocols/socket/socket/build/javasocket_0x2002DCD4.mmp --- a/javacommons/gcfprotocols/socket/socket/build/javasocket_0x2002DCD4.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/gcfprotocols/socket/socket/build/javasocket_0x2002DCD4.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -110,7 +111,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/gcfprotocols/socket/socket/inc/apnsettings.h --- a/javacommons/gcfprotocols/socket/socket/inc/apnsettings.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/gcfprotocols/socket/socket/inc/apnsettings.h Wed Sep 15 12:05:25 2010 +0300 @@ -27,7 +27,8 @@ public : static int setDefaultApn(int aType, int aApn); - + static void removeDefaultApn(); + static int retryConnection(int aErrCode,int aType, int aApn); }; diff -r d5e927d5853b -r 7cee158cb8cd javacommons/gcfprotocols/socket/socket/src.s60/apnsettings.cpp --- a/javacommons/gcfprotocols/socket/socket/src.s60/apnsettings.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/gcfprotocols/socket/socket/src.s60/apnsettings.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -66,4 +66,29 @@ return def; } - +void ApnSettings::removeDefaultApn() +{ + #ifdef RD_JAVA_OPENC_BETA_PATCH + setdefaultif(0); + ILOG(ESOCKET, "sedefaultif called"); + ILOG1(ESOCKET, "remove default apn returned %d",setdefaultif(NULL)); + #endif +} +int ApnSettings::retryConnection(int aErrCode, int aType, int aApn) +{ + if ( aErrCode > __EMAXERRNO ) + { + // errno out of range, check for KErrNotReady + int errCode = -(aErrCode - __EMAXERRNO); + ELOG1(ESOCKET,"ApnSettings:: retryConnection symbian error : %d" , errCode); + if( (errCode == KErrNotReady) && (aType == 2) ) + { + // call reset and setDefaultif() again to make a new conn and use + ApnSettings::removeDefaultApn(); + int ret = ApnSettings::setDefaultApn(aType,aApn); + return ret; + } + } + return -(aErrCode); + +} diff -r d5e927d5853b -r 7cee158cb8cd javacommons/gcfprotocols/socket/socket/src/nativesocketconnection.cpp --- a/javacommons/gcfprotocols/socket/socket/src/nativesocketconnection.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/gcfprotocols/socket/socket/src/nativesocketconnection.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -187,7 +187,24 @@ struct hostent* hp = gethostbyname(mHost); if (hp == NULL) { - return -(h_errno); + //error condition, we have to handle -18 error. + ELOG1(ESOCKET,"NativeSocketConnection:: gthostbyname error : %d" , h_errno); + int tmp = ApnSettings::retryConnection(h_errno,aType,aApn); + if(tmp == 0) + { + // connection reset done, attempt once again + hp = gethostbyname(mHost); + if(hp == NULL) + { + return -(h_errno); + } + } + else + { + // retry not supported/failed + return tmp; + + } } addr.sin_addr.s_addr = ((struct in_addr*)(hp->h_addr))->s_addr; } diff -r d5e927d5853b -r 7cee158cb8cd javacommons/javaenv/build/javaenv.pro --- a/javacommons/javaenv/build/javaenv.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/javaenv/build/javaenv.pro Wed Sep 15 12:05:25 2010 +0300 @@ -23,7 +23,7 @@ TARGET.UID2 = 0x1000008d TARGET.UID3 = 0x2001B2A5 SOURCES += ../src.s60/*.cpp - LIBS += -lplatformEnv -lefsrv + LIBS += -lplatformenv -lefsrv } include(../../../build/omj.pri) diff -r d5e927d5853b -r 7cee158cb8cd javacommons/javaenv/build/javaenv_0x2001B2A5.mmp --- a/javacommons/javaenv/build/javaenv_0x2001B2A5.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/javaenv/build/javaenv_0x2001B2A5.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -65,7 +66,7 @@ SOURCE javaenvinfo.cpp -LIBRARY platformEnv.lib +LIBRARY platformenv.lib LIBRARY efsrv.lib LIBRARY javautils.lib LIBRARY libpthread.lib @@ -96,7 +97,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/javastorage/build/javastorage_0x2002DCD8.mmp --- a/javacommons/javastorage/build/javastorage_0x2002DCD8.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/javastorage/build/javastorage_0x2002DCD8.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -113,7 +114,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/jvms/j9utils/threaddump/build/javathreaddumper_0x2002DCD9.mmp --- a/javacommons/jvms/j9utils/threaddump/build/javathreaddumper_0x2002DCD9.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/jvms/j9utils/threaddump/build/javathreaddumper_0x2002DCD9.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -98,7 +99,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/jvms/nativeportlayer/build/jvmnativeport_0x2002DCDE.mmp --- a/javacommons/jvms/nativeportlayer/build/jvmnativeport_0x2002DCDE.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/jvms/nativeportlayer/build/jvmnativeport_0x2002DCDE.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -99,7 +100,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/build/javasecurity_0x2002DCCF.mmp --- a/javacommons/security/build/javasecurity_0x2002DCCF.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/build/javasecurity_0x2002DCCF.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -128,7 +129,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/data/msa_manufacturer.txt --- a/javacommons/security/data/msa_manufacturer.txt Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/data/msa_manufacturer.txt Wed Sep 15 12:05:25 2010 +0300 @@ -31,6 +31,12 @@ permission javax.microedition.io.Connector.rtsp "*"; permission javax.microedition.PropertyPermission "mobinfo.imsi" "read"; permission javax.microedition.midlet.CmdLineArgsPermission; + permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write"; + permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance"; + permission javax.microedition.io.Connector.ndef "ndef://*" "open"; + permission javax.microedition.io.Connector.rf "rf://*" "open"; + permission javax.microedition.io.Connector.sc "sc://*" "open"; + permission javax.microedition.io.Connector.vtag "vtag://*" "open"; } grant assigned { diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/data/msa_operator.txt --- a/javacommons/security/data/msa_operator.txt Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/data/msa_operator.txt Wed Sep 15 12:05:25 2010 +0300 @@ -31,6 +31,12 @@ permission javax.microedition.io.Connector.rtsp "*"; permission javax.microedition.PropertyPermission "mobinfo.imsi" "read"; permission javax.microedition.midlet.CmdLineArgsPermission; + permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write"; + permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance"; + permission javax.microedition.io.Connector.ndef "ndef://*" "open"; + permission javax.microedition.io.Connector.rf "rf://*" "open"; + permission javax.microedition.io.Connector.sc "sc://*" "open"; + permission javax.microedition.io.Connector.vtag "vtag://*" "open"; } grant assigned { diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/data/msa_trustedthirdparty.txt --- a/javacommons/security/data/msa_trustedthirdparty.txt Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/data/msa_trustedthirdparty.txt Wed Sep 15 12:05:25 2010 +0300 @@ -66,11 +66,21 @@ permission javax.microedition.midlet.CmdLineArgsPermission; } +grant user "NFC Write Access" session,blanket,oneshot,no { + permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write"; +} + grant allowed { permission javax.microedition.io.Connector.sms "sms://*" "open,receive"; permission javax.microedition.io.Connector.mms "mms://*" "open,receive"; permission javax.microedition.io.Connector.cbs "cbs://*" "open,receive"; + permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance"; + permission javax.microedition.io.Connector.ndef "ndef://*" "open"; + permission javax.microedition.io.Connector.rf "rf://*" "open"; + permission javax.microedition.io.Connector.sc "sc://*" "open"; + permission javax.microedition.io.Connector.vtag "vtag://*" "open"; } + grant assigned "Location" { permission javax.microedition.PropertyPermission "mobinfo.cellid" "read"; permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read"; diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/data/msa_untrusted.txt --- a/javacommons/security/data/msa_untrusted.txt Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/data/msa_untrusted.txt Wed Sep 15 12:05:25 2010 +0300 @@ -55,11 +55,21 @@ permission javax.microedition.location.LocationPermission "landmarks://*" "read,write,category,management"; } +grant user "NFC Write Access" oneshot,session,no { + permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write"; +} + grant allowed { permission javax.microedition.io.Connector.sms "sms://*" "open,receive"; permission javax.microedition.io.Connector.mms "mms://*" "open,receive"; permission javax.microedition.io.Connector.cbs "cbs://*" "open,receive"; + permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance"; + permission javax.microedition.io.Connector.ndef "ndef://*" "open"; + permission javax.microedition.io.Connector.rf "rf://*" "open"; + permission javax.microedition.io.Connector.sc "sc://*" "open"; + permission javax.microedition.io.Connector.vtag "vtag://*" "open"; } + grant assigned "Location" { permission javax.microedition.PropertyPermission "mobinfo.cellid" "read"; permission javax.microedition.PropertyPermission "mobinfo.countrycode" "read"; diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/data/s60_manufacturer.txt --- a/javacommons/security/data/s60_manufacturer.txt Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/data/s60_manufacturer.txt Wed Sep 15 12:05:25 2010 +0300 @@ -31,6 +31,12 @@ permission javax.microedition.io.Connector.rtsp "*"; permission javax.microedition.PropertyPermission "mobinfo.imsi" "read"; permission javax.microedition.midlet.CmdLineArgsPermission; + permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write"; + permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance"; + permission javax.microedition.io.Connector.ndef "ndef://*" "open"; + permission javax.microedition.io.Connector.rf "rf://*" "open"; + permission javax.microedition.io.Connector.sc "sc://*" "open"; + permission javax.microedition.io.Connector.vtag "vtag://*" "open"; } grant assigned { diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/data/s60_operator.txt --- a/javacommons/security/data/s60_operator.txt Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/data/s60_operator.txt Wed Sep 15 12:05:25 2010 +0300 @@ -31,6 +31,12 @@ permission javax.microedition.io.Connector.rtsp "*"; permission javax.microedition.PropertyPermission "mobinfo.imsi" "read"; permission javax.microedition.midlet.CmdLineArgsPermission; + permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write"; + permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance"; + permission javax.microedition.io.Connector.ndef "ndef://*" "open"; + permission javax.microedition.io.Connector.rf "rf://*" "open"; + permission javax.microedition.io.Connector.sc "sc://*" "open"; + permission javax.microedition.io.Connector.vtag "vtag://*" "open"; } grant assigned { diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/data/s60_trustedthirdparty.txt --- a/javacommons/security/data/s60_trustedthirdparty.txt Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/data/s60_trustedthirdparty.txt Wed Sep 15 12:05:25 2010 +0300 @@ -67,10 +67,19 @@ permission javax.microedition.midlet.CmdLineArgsPermission; } +grant user "NFC Write Access" session,blanket,oneshot,no { + permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write"; +} + grant allowed { permission javax.microedition.io.Connector.sms "sms://*" "open,receive"; permission javax.microedition.io.Connector.mms "mms://*" "open,receive"; permission javax.microedition.io.Connector.cbs "cbs://*" "open,receive"; + permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance"; + permission javax.microedition.io.Connector.ndef "ndef://*" "open"; + permission javax.microedition.io.Connector.rf "rf://*" "open"; + permission javax.microedition.io.Connector.sc "sc://*" "open"; + permission javax.microedition.io.Connector.vtag "vtag://*" "open"; } grant assigned "Location" { diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/data/s60_untrusted.txt --- a/javacommons/security/data/s60_untrusted.txt Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/data/s60_untrusted.txt Wed Sep 15 12:05:25 2010 +0300 @@ -55,10 +55,19 @@ permission javax.microedition.location.LocationPermission "landmarks://*" "read,write,category,management"; } +grant user "NFC Write Access" oneshot,session,no { + permission javax.microedition.contactless.ndef.NDEFTagConnection.write "ndef://*" "write"; +} + grant allowed { permission javax.microedition.io.Connector.sms "sms://*" "open,receive"; permission javax.microedition.io.Connector.mms "mms://*" "open,receive"; permission javax.microedition.io.Connector.cbs "cbs://*" "open,receive"; + permission javax.microedition.contactless.DiscoveryManager "DiscoveryManager" "get_instance"; + permission javax.microedition.io.Connector.ndef "ndef://*" "open"; + permission javax.microedition.io.Connector.rf "rf://*" "open"; + permission javax.microedition.io.Connector.sc "sc://*" "open"; + permission javax.microedition.io.Connector.vtag "vtag://*" "open"; } grant assigned "Location" { diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/javasrc/com/nokia/mj/impl/security/midp/common/PermissionMappingTable.java --- a/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/common/PermissionMappingTable.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/common/PermissionMappingTable.java Wed Sep 15 12:05:25 2010 +0300 @@ -178,22 +178,22 @@ "com.nokia.mj.impl.properties.mobinfo.MobileInfoPermission", "*", "read")); PERMISSION_MAPPING_TABLE.put( "javax.microedition.contactless.ndef.NDEFTagConnection.write", new MIDPPermission( - "com.nokia.mj.impl.ccapi.utils.ContactlessCommunicationPermission", "ndef://*", "write")); + "com.nokia.mj.impl.nfc.utils.ContactlessCommunicationPermission", "ndef://*", "write")); PERMISSION_MAPPING_TABLE.put( "javax.microedition.contactless.DiscoveryManager", new MIDPPermission( - "com.nokia.mj.impl.ccapi.utils.ContactlessCommunicationPermission", "discoveryManager", "get_instance")); + "com.nokia.mj.impl.nfc.utils.ContactlessCommunicationPermission", "DiscoveryManager", "get_instance")); PERMISSION_MAPPING_TABLE.put( "javax.microedition.io.Connector.ndef", new MIDPPermission( - "com.nokia.mj.impl.ccapi.utils.ContactlessCommunicationPermission", "ndef://*", "open")); + "com.nokia.mj.impl.nfc.utils.ContactlessCommunicationPermission", "ndef://*", "open")); PERMISSION_MAPPING_TABLE.put( "javax.microedition.io.Connector.rf", new MIDPPermission( - "com.nokia.mj.impl.ccapi.utils.ContactlessCommunicationPermission", "rf://*", "open")); + "com.nokia.mj.impl.nfc.utils.ContactlessCommunicationPermission", "rf://*", "open")); PERMISSION_MAPPING_TABLE.put( "javax.microedition.io.Connector.sc", new MIDPPermission( - "com.nokia.mj.impl.ccapi.utils.ContactlessCommunicationPermission", "sc://*", "open")); + "com.nokia.mj.impl.nfc.utils.ContactlessCommunicationPermission", "sc://*", "open")); PERMISSION_MAPPING_TABLE.put( "javax.microedition.io.Connector.vtag", new MIDPPermission( - "com.nokia.mj.impl.ccapi.utils.ContactlessCommunicationPermission", "vtag://*", "open")); + "com.nokia.mj.impl.nfc.utils.ContactlessCommunicationPermission", "vtag://*", "open")); PERMISSION_MAPPING_TABLE.put( "javax.microedition.io.SocketProtocolPermission", new MIDPPermission( "com.nokia.mj.impl.gcf.protocol.socket.SocketPermissionImpl", "socket://*")); diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin.pro --- a/javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin.pro Wed Sep 15 12:05:25 2010 +0300 @@ -35,6 +35,10 @@ MMP_RULES += "TARGETPATH /resource/plugins" MMP_RULES += "TARGET javaunicertstoreplugin.rsc" MMP_RULES += "END" + MMP_RULES += "START RESOURCE 200213A3_iad.rss" + MMP_RULES += "TARGETPATH /resource/java/iad" + MMP_RULES += "TARGET javaunicertstoreplugin.rsc" + MMP_RULES += "END" MMP_RULES += "START RESOURCE ../data/javausermessages.rss" MMP_RULES += "HEADER" MMP_RULES += "TARGETPATH /resource/java" diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin_0x200213A3.mmp --- a/javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin_0x200213A3.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin_0x200213A3.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -105,7 +106,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp @@ -123,6 +124,14 @@ END +START RESOURCE 200213A3_iad.rss + +TARGETPATH /resource/java/iad + +TARGET javaunicertstoreplugin.rsc + +END + START RESOURCE ../data/javausermessages.rss HEADER diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/javaunicertstoreplugin/src.s60/200213A3.rss --- a/javacommons/security/javaunicertstoreplugin/src.s60/200213A3.rss Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/javaunicertstoreplugin/src.s60/200213A3.rss Wed Sep 15 12:05:25 2010 +0300 @@ -24,6 +24,10 @@ // Some defines of useful values for attributes to simplify // writing resource files +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 1 +#endif + // True #define CT_TRUE 1,0,0,0 // False @@ -57,7 +61,7 @@ BINARY_IMPLEMENTATION_INFO { implementation_uid = 0x200213A3; - version_no = 1; + version_no = ECOM_VERSION_NO; display_name = "Java Certificate store"; default_data = { CT_CERT_STORE, CT_WRITEABLE_CERT_STORE }; opaque_data = { CT_SOFTWARE, CT_TRUE, diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/javaunicertstoreplugin/src.s60/200213A3_iad.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/security/javaunicertstoreplugin/src.s60/200213A3_iad.rss Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 2 + +// Include actual rss +#include "200213A3.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javacommons/security/src/midpauthenticationmoduleimpl.cpp --- a/javacommons/security/src/midpauthenticationmoduleimpl.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/security/src/midpauthenticationmoduleimpl.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -535,9 +535,16 @@ } // compute the root hash value if requested - if (x509_ctx->current_issuer != NULL) + if (x509_ctx->chain != NULL) { - sprintf(root_hash,"%08lX",X509_issuer_name_hash(x509_ctx->current_issuer)); + X509* root = sk_X509_value(x509_ctx->chain,sk_X509_num(x509_ctx->chain) - 1); + if (root != NULL) + { + sprintf(root_hash,"%08lX",X509_issuer_name_hash(root)); + // no need to free the root explicitly since it will be + // freed when freeing all the roots from roots_certs_st + // stack + } } // add the '\0' root_hash[MD5_DIGEST_LEN] = '\0'; diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/build/javautils.pro --- a/javacommons/utils/build/javautils.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/build/javautils.pro Wed Sep 15 12:05:25 2010 +0300 @@ -37,7 +37,7 @@ ../src.s60/*.cpp \ LIBS += -lflogger -lplatformver -lsysversioninfo -lsysutil -lbafl \ - -lefsrv -ljavaenvinfo -lhal -llibcrypto -lcommonengine -lplatformenv + -lefsrv -ljavaenvinfo -lhal -llibcrypto -lCommonEngine -lplatformenv !contains(PROJECT_DEFINES,RD_JAVA_UI_QT) { LIBS += -lavkon diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/build/javautils_0x2002DCDA.mmp --- a/javacommons/utils/build/javautils_0x2002DCDA.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/build/javautils_0x2002DCDA.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -112,7 +113,7 @@ LIBRARY javaenvinfo.lib LIBRARY hal.lib LIBRARY libcrypto.lib -LIBRARY commonengine.lib +LIBRARY CommonEngine.lib LIBRARY platformenv.lib LIBRARY avkon.lib LIBRARY libpthread.lib @@ -141,7 +142,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/inc.s60/java_stdcpp_support_for_dll.hrh --- a/javacommons/utils/inc.s60/java_stdcpp_support_for_dll.hrh Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/inc.s60/java_stdcpp_support_for_dll.hrh Wed Sep 15 12:05:25 2010 +0300 @@ -59,5 +59,10 @@ OS_LAYER_STDCPP_SYSTEMINCLUDE LIBRARY libstdcpp.lib #endif +#ifndef RD_JAVA_NO_BIN_VERSION +#ifdef RD_JAVA_BIN_VERSION_NONQT + VERSION RD_JAVA_BIN_VERSION_NONQT +#endif +#endif #endif // JAVA_STDCPP_SUPPORT_FOR_DLL_HRH diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/inc.s60/java_stdcpp_support_for_exe.hrh --- a/javacommons/utils/inc.s60/java_stdcpp_support_for_exe.hrh Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/inc.s60/java_stdcpp_support_for_exe.hrh Wed Sep 15 12:05:25 2010 +0300 @@ -55,5 +55,10 @@ OS_LAYER_STDCPP_SYSTEMINCLUDE LIBRARY libstdcpp.lib #endif +#ifndef RD_JAVA_NO_BIN_VERSION +#ifdef RD_JAVA_BIN_VERSION_NONQT + VERSION RD_JAVA_BIN_VERSION_NONQT +#endif +#endif #endif // JAVA_STDCPP_SUPPORT_FOR_DLL_HRH diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/inc.s60/java_stdcpp_support_for_stddll.hrh --- a/javacommons/utils/inc.s60/java_stdcpp_support_for_stddll.hrh Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/inc.s60/java_stdcpp_support_for_stddll.hrh Wed Sep 15 12:05:25 2010 +0300 @@ -51,5 +51,10 @@ OS_LAYER_STDCPP_SYSTEMINCLUDE LIBRARY libstdcpp.lib #endif +#ifndef RD_JAVA_NO_BIN_VERSION +#ifdef RD_JAVA_BIN_VERSION_NONQT + VERSION RD_JAVA_BIN_VERSION_NONQT +#endif +#endif #endif // JAVA_STDCPP_SUPPORT_FOR_DLL_HRH diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/inc.s60/java_stdcpp_support_for_stdexe.hrh --- a/javacommons/utils/inc.s60/java_stdcpp_support_for_stdexe.hrh Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/inc.s60/java_stdcpp_support_for_stdexe.hrh Wed Sep 15 12:05:25 2010 +0300 @@ -52,5 +52,10 @@ OS_LAYER_STDCPP_SYSTEMINCLUDE LIBRARY libstdcpp.lib #endif +#ifndef RD_JAVA_NO_BIN_VERSION +#ifdef RD_JAVA_BIN_VERSION_NONQT + VERSION RD_JAVA_BIN_VERSION_NONQT +#endif +#endif #endif // JAVA_STDCPP_SUPPORT_FOR_DLL_HRH diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/inc/logger.h --- a/javacommons/utils/inc/logger.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/inc/logger.h Wed Sep 15 12:05:25 2010 +0300 @@ -118,6 +118,7 @@ EJavaAMMS, // =37 EJavaSettings, // =38 EJavaQtServiceApp, // =39 + EJavaCentrep // =40 // add id of new components here }; @@ -177,6 +178,7 @@ {"JavaMMAPI.log", "[ MMAPPI ]"}, // EJavaAMMS {"JavaSettings.log", "[ JavaSettings ]"}, // EJavaSettings {"JavaQtServiceApp.log", "[ QtServiceApp ]"}, // EJavaQtServiceApp + {"JavaCentrep.log", "[ JavaCentrep ]"}, // EJavaCentrep // add new component file name and nickname here }; diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/javasrc/com/nokia/mj/impl/coreui/CoreUi.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/coreui/CoreUi.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/coreui/CoreUi.java Wed Sep 15 12:05:25 2010 +0300 @@ -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" @@ -19,6 +19,7 @@ import java.util.Hashtable; +import com.nokia.mj.impl.utils.Logger; import com.nokia.mj.impl.utils.Uid; /** @@ -49,10 +50,12 @@ Class clazz = Class.forName(className); sInstance = (CoreUi)clazz.newInstance(); } - catch (Exception e) + catch (Throwable t) { - throw new RuntimeException("Not able to instantiate class " + - className+". Reason is: " + e); + String err = "Not able to instantiate class " + + className+". Reason is: "; + Logger.LOG(Logger.EJavaUI, Logger.EInfo, err, t); + throw new RuntimeException(err + t); } } } @@ -78,13 +81,18 @@ /** * For creating the UI from Java side. This is meant for the pre-warmed * VM use case. Calling this method will lead creation of the CoreUI. - * @param uid The UID of the application. + * @param uid The UID of the application. If null NullPointerException + * will be thrown. * @param backGroundStart Should the UI be put into background. */ public static void createUi(Uid uid, boolean backGroundStart) { if (sInstance != null) { + if (uid == null) + { + throw new NullPointerException("Null UID when creating UI"); + } sInstance.createUiImpl(uid, backGroundStart); } } @@ -125,9 +133,18 @@ return fg; } + public static void hideApplication(boolean hide) + { + if (sInstance != null) + { + sInstance.hideApplicationImpl(hide); + } + } + protected abstract boolean connectToUiImpl(); protected abstract void createUiImpl(Uid uid, boolean backGroundStart); protected abstract void shutdownRequestImpl(); protected abstract void foregroundRequestImpl(); protected abstract boolean isUiInForegroundImpl(); + protected abstract void hideApplicationImpl(boolean hide); } diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/javasrc/com/nokia/mj/impl/utils/DebugUtils.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/DebugUtils.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/DebugUtils.java Wed Sep 15 12:05:25 2010 +0300 @@ -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" @@ -11,13 +11,16 @@ * * Contributors: * -* Description: ?Description +* Description: * */ package com.nokia.mj.impl.utils; +import java.io.PrintStream; +import java.io.ByteArrayOutputStream; + import com.nokia.mj.impl.rt.support.Jvm; import com.nokia.mj.impl.utils.Logger; @@ -54,6 +57,19 @@ _closeThreadDumper(); } + public static String getStackTrace(Throwable t) + { + if (t == null) + { + throw new NullPointerException("Null when getting stack trace"); + } + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + _getStackTrace(t, new PrintStream(baos)); + return baos.toString(); + } + + private static native void _getStackTrace(Throwable t, PrintStream printStream); + private static native void _doThreadDump(); private static native void _closeThreadDumper(); } diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java Wed Sep 15 12:05:25 2010 +0300 @@ -48,9 +48,10 @@ * *
* Limitation: more than 10 positional arguments are not supported (only 0...9) - * - * @author Nokia Corporation - * @version 1.0 + *
+ * Note that Formatter supports Avkon and Qt based localisation. + * Text parameter indices start from 0 when Avkon is used and from 1 + * when Qt is used. */ public class Formatter { @@ -60,8 +61,19 @@ /** String with latest replacements */ private String replaced; + /** + * Platform localisation type. + * Either ResourceLoader.AVKON or ResourceLoader.QT. */ + private final int locType; + + /** + * The first text parameter replacement index. For Avkon based + * localisation this is 0, for Qt based localisation this is 1. + */ + private final int startIndex; + /** Next replacement index */ - private int nextIndex = (ResourceLoader.getLocaleIdQt() == null? 0: 1); + private int nextIndex; /*** ----------------------------- PUBLIC ------------------------------ */ @@ -72,8 +84,22 @@ */ Formatter(String aPattern) { + this(aPattern, ResourceLoader.AVKON); + } + + /** + * Create a new formatter + * + * @param pattern formatter pattern + * @param aLocType platform localisation type + */ + Formatter(String aPattern, int aLocType) + { pattern = aPattern; replaced = aPattern; + locType = aLocType; + startIndex = (locType == ResourceLoader.QT? 1: 0); + nextIndex = startIndex; } /** @@ -215,24 +241,12 @@ // Reset for next usage replaced = pattern; - nextIndex = (ResourceLoader.getLocaleIdQt() == null? 0: 1); + nextIndex = startIndex; return result; } /** - * Gets a clone of this formatter. This can be used for caching preparsed - * Formatters. - * - * @return clone of the formatter, as if new Formatter were created with - * same pattern as current one. - */ - public Formatter getClone() - { - return new Formatter(pattern); - } - - /** * Formats localised text with specified parameters from an array. * * Note that the arg().arg().toString() is preferred method of @@ -268,11 +282,11 @@ return toString(); } /** - * Applies convertion from european digits into arabic-indic digits + * Applies convertion from european digits into arabic-indic digits * based on existing language settings * * @param str String which might contain european digits - * @return A string identical with the provided string but with the + * @return A string identical with the provided string but with the * european digits (if any) converted to arabic-indic digits */ public static String formatDigits(String str) @@ -383,7 +397,7 @@ * based on existing language settings * * @param str String which might contain european digits - * @return A string identical with the provided string but with the + * @return A string identical with the provided string but with the * european digits (if any) converted to arabic-indic digits */ private static native String _formatDigits(String str); diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java Wed Sep 15 12:05:25 2010 +0300 @@ -82,6 +82,7 @@ public static final int EJavaBroadcast = 36; public static final int EJavaAMMS = 37; public static final int EJavaSettings = 38; + public static final int EJavaCentrep = 40; // add name of new components here @@ -140,6 +141,7 @@ false, //EJavaBroadcast = 36; false, //EJavaAMMS = 37; false, //EJavaSettings = 38; + false //EJavaCentrep = 40; // add new components here }; diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java Wed Sep 15 12:05:25 2010 +0300 @@ -34,9 +34,6 @@ * Label noteLabel = createLabel( * res.string("note"), horizontalSpan, labelStyle); * - * - * @author Nokia Corporation - * @version 1.0 */ public class ResourceLoader { @@ -67,8 +64,11 @@ String qtFileName, String qtPrefix) { - // Avkon name prefix pair is used as key and this is same between platforms. - String key = avkonFileName + ":" + avkonPrefix; + // Construct key from filenames and prefixes, this is the same + // between platforms. + String key = (new StringBuffer()).append(avkonFileName).append(":") + .append(avkonPrefix).append(":").append(qtFileName).append(":") + .append(qtPrefix).toString(); ResourceLoader result = (ResourceLoader)resourceLoaders.get(key); if (result == null) @@ -146,6 +146,7 @@ */ public ResourceLoader(String resourceName, String aPrefix) { + locType = AVKON; prefix = aPrefix; loadFile(resourceName, true); // Avkon } @@ -159,7 +160,7 @@ */ public Formatter format(String id) { - return new Formatter(string(id)); + return new Formatter(string(id), locType); } /** @@ -174,11 +175,11 @@ { if (locType == AVKON) { - return new Formatter(string(avkonId)); + return new Formatter(string(avkonId), locType); } else { - return new Formatter(string(qtId)); + return new Formatter(string(qtId), locType); } } @@ -195,11 +196,11 @@ { if (locType == AVKON) { - return new Formatter(string(avkonId)).format(textParameters); + return new Formatter(string(avkonId), locType).format(textParameters); } else { - return new Formatter(string(qtId)).format(textParameters); + return new Formatter(string(qtId), locType).format(textParameters); } } @@ -212,7 +213,7 @@ */ public Formatter format(Id id) { - return new Formatter(id.getString(locType)); + return new Formatter(id.getString(locType), locType); } /** @@ -225,7 +226,7 @@ */ public String format(String id, Object[] textParameters) { - return new Formatter(string(id)).format(textParameters); + return new Formatter(string(id), locType).format(textParameters); } /** @@ -238,7 +239,7 @@ */ public String format(Id id, Object[] textParameters) { - return new Formatter(string(id.getString(locType))).format(textParameters); + return new Formatter(string(id.getString(locType)), locType).format(textParameters); } @@ -331,13 +332,13 @@ if (!avkon) // Qt resources. { 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 + "_" + langName + ".loc"); diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/javasrc/com/nokia/mj/impl/utils/Version.java --- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Version.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Version.java Wed Sep 15 12:05:25 2010 +0300 @@ -58,7 +58,12 @@ { return null; } - String str = aStr.trim(); + // Remove all invalid characters from string + String str = normalizeVersion(aStr); + if (str.length() == 0) + { + return null; + } int major = 0; int minor = 0; @@ -232,4 +237,23 @@ } return buf.toString(); } + + /** + * Remove the illegal characters from version string, + * for example "1.1 rev.2" becomes "1.1.2" + */ + private static String normalizeVersion(String aString) + { + StringBuffer buf = new StringBuffer(); + int len = aString.length(); + for (int ind = 0; ind < len; ind++) + { + char ch = aString.charAt(ind); + if ((ch == '.') || Character.isDigit(ch)) + { + buf.append(ch); + } + } + return buf.toString(); + } } diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/src/debugutils.cpp --- a/javacommons/utils/src/debugutils.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/src/debugutils.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -39,3 +39,28 @@ ThreadDump::closeDumper(); } +/** + * A utility for getting the stack trace for further processing. + * @param th The throwable from where the stack trace should be get. + * @param printStream Where to print the stack trace. + */ +JNIEXPORT void JNICALL +Java_com_nokia_mj_impl_utils_DebugUtils__1getStackTrace +(JNIEnv* jniEnv, jclass, jthrowable th, jobject printStream) +{ + /* + * call Throwable.printStackTrace(java.io.PrintStream) + * this method is not part of CLDC spec, but it's supported by VM vendor. + */ + jclass classThrowable = jniEnv->GetObjectClass(th); + if (classThrowable) + { + jmethodID methodId = jniEnv->GetMethodID(classThrowable, + "printStackTrace", + "(Ljava/io/PrintStream;)V"); + if (methodId) + { + jniEnv->CallVoidMethod(th, methodId, printStream); + } + } +} diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/src/javacommonutils.cpp --- a/javacommons/utils/src/javacommonutils.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/src/javacommonutils.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -285,7 +285,8 @@ std::string result; result.insert(0, bptr->data, bptr->length); BIO_free_all(b64); - + CRYPTO_cleanup_all_ex_data(); + return result; } @@ -313,7 +314,8 @@ result.push_back((wchar_t)*(bptr->data + i)); } BIO_free_all(b64); - + CRYPTO_cleanup_all_ex_data(); + return result; } @@ -338,7 +340,8 @@ BIO_free_all(bmem); delete[] buf; - + CRYPTO_cleanup_all_ex_data(); + return result; } diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/build/java/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/utils/tsrc/build/java/build.xml Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,51 @@ + + + + + + + + + + + + Running BufferedReaderTests + + + + + Running ConcurrencyTests + + + + + Running SystemPropertyTests + + + + + Running DebugUtilsTests tests + + + + + + + + diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/build/java/dummy.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/utils/tsrc/build/java/dummy.pro Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,18 @@ +# +# 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: A dummy pro file for generating a Jar file. Keeping +# build system happy. +# + +TEMPLATE = subdirs diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/build/native/exports.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/utils/tsrc/build/native/exports.inf Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 + +#include "../../../../inc/build_defines.hrh" +#ifdef RD_JAVA_SYMBIAN_TARGET +../../tst.bat /epoc32/winscw/c/tst.bat +#endif // RD_JAVA_SYMBIAN_TARGET diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/build/native/testjavautils.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/utils/tsrc/build/native/testjavautils.pro Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,37 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE=app +TARGET=testjavautils +CONFIG += omj no_icon stl +CONFIG -= qt + +LIBS += -lCppUTest + +INCLUDEPATH += ../../../../../tools/cpputest/include/CppUTest + +INCLUDEPATH += ../../../../../tools/cpputest/include/Platforms/Symbian +INCLUDEPATH += ../testcoreui/src +TARGET.CAPABILITY = all -tcb + +#SOURCES += ../../src/SymbianAllTests.cpp +SOURCES += ../../src/AllTests.cpp +SOURCES += ../../src/uidtests.cpp +SOURCES += ../../src/testbase64.cpp +SOURCES += ../../src/testlanguageresource.cpp +SOURCES += ../../src/testoslayer.cpp + +include(../../../../../build/omj.pri) diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/SystemPropertyTests.java --- a/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/SystemPropertyTests.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/rt/SystemPropertyTests.java Wed Sep 15 12:05:25 2010 +0300 @@ -19,7 +19,7 @@ package com.nokia.mj.impl.rt; -import com.nokia.mj.impl.installer.utils.InstallerMain; +import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator; import com.nokia.mj.impl.rt.support.JvmInternal; import j2meunit.framework.Test; @@ -30,11 +30,11 @@ /** * SystemProperty unit tests. */ -public class SystemPropertyTests extends TestCase implements InstallerMain +public class SystemPropertyTests extends TestCase implements UnitTestSuiteCreator { // Begin j2meunit test framework setup - public void installerMain(String[] args) + public TestSuite createTestSuite(String[] args) { TestSuite suite = new TestSuite(this.getClass().getName()); @@ -62,8 +62,7 @@ } })); - - com.nokia.mj.impl.utils.OmjTestRunner.run(suite); + return suite; } @@ -118,7 +117,7 @@ res = System.getProperty(testPropertyKey1); assertTrue("Fail3, got: "+ res, testPropertyVal2.equals(res)); - // Set a null value to same system property and check that an + // Set a null value to same system property and check that an // exception is thrown and the value is not changed. try { @@ -146,7 +145,7 @@ res = System.getProperty(testPropertyKey2); assertTrue("Fail7, got: "+ res, testPropertyVal4.equals(res)); - // Set a null value to same user property and check that an + // Set a null value to same user property and check that an // exception is thrown and the value is not changed. try { @@ -159,7 +158,7 @@ res = System.getProperty(testPropertyKey2); assertTrue("Fail8, got: "+ res, testPropertyVal4.equals(res)); - // Set the same system and user property and check that the user property + // Set the same system and user property and check that the user property // doesn't override the system property. JvmInternal.setSystemProperty(testPropertyKey3, testPropertyVal5); JvmInternal.setUserProperty(testPropertyKey3, testPropertyVal6); diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/BufferedReaderTests.java --- a/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/BufferedReaderTests.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/BufferedReaderTests.java Wed Sep 15 12:05:25 2010 +0300 @@ -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" @@ -18,7 +18,7 @@ package com.nokia.mj.impl.utils; -import com.nokia.mj.impl.installer.utils.InstallerMain; +import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator; import com.nokia.mj.impl.utils.BufferedReader; import java.io.ByteArrayInputStream; @@ -33,14 +33,14 @@ /** * BufferedReader unit tests. */ -public class BufferedReaderTests extends TestCase implements InstallerMain +public class BufferedReaderTests extends TestCase implements UnitTestSuiteCreator { private static final String TEST_DATA = "one\ntwo\nthree"; private static final int MAX_BUF_SIZE = 16; // Begin j2meunit test framework setup - public void installerMain(String[] args) + public TestSuite createTestSuite(String[] args) { TestSuite suite = new TestSuite(this.getClass().getName()); @@ -80,7 +80,7 @@ } })); - com.nokia.mj.impl.utils.OmjTestRunner.run(suite); + return suite; } public BufferedReaderTests() diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/DebugUtilsTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/DebugUtilsTests.java Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,94 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +package com.nokia.mj.impl.utils; + +import com.nokia.mj.impl.utils.DebugUtils; + +import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator; +import j2meunit.framework.Test; +import j2meunit.framework.TestCase; +import j2meunit.framework.TestMethod; +import j2meunit.framework.TestSuite; + +/** + * DebugUtils unit tests. + */ +public class DebugUtilsTests extends TestCase implements UnitTestSuiteCreator +{ + // Create the test suite. + public TestSuite createTestSuite(String[] args) + { + TestSuite suite = new TestSuite(this.getClass().getName()); + + suite.addTest(new DebugUtilsTests("TestStackTrace", new TestMethod() + { + public void run(TestCase tc) + { + ((DebugUtilsTests)tc).testStackTrace(); + } + })); + + return suite; + } + + public DebugUtilsTests() + { + } + + public DebugUtilsTests(String aTestName, TestMethod aTestMethod) + { + super(aTestName, aTestMethod); + } + + // End j2meunit test framework setup + + protected void setUp() + { + } + + protected void tearDown() + { + } + + public void testStackTrace() + { + try + { + try + { + DebugUtils.getStackTrace(null); + assertTrue("No exception.", false); + } + catch (NullPointerException ne) + { + } + + Exception e1 = new Exception("Test 42"); + String res = DebugUtils.getStackTrace(e1); + boolean ok = res.indexOf("at com.nokia.mj.impl.utils.DebugUtilsTests.testStackTrace") >= 0; + assertTrue("Exception didn't contain: " + res, ok); + + } + catch (Throwable t) + { + assertTrue(t.toString(), false); + t.printStackTrace(); + } + } +} diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/concurrent/ConcurrentTests.java --- a/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/concurrent/ConcurrentTests.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/tsrc/javasrc/com/nokia/mj/impl/utils/concurrent/ConcurrentTests.java Wed Sep 15 12:05:25 2010 +0300 @@ -21,8 +21,7 @@ import java.util.Enumeration; import java.util.Vector; -import com.nokia.mj.impl.installer.utils.InstallerMain; -import com.nokia.mj.impl.utils.DebugUtils; +import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator; import j2meunit.framework.Test; import j2meunit.framework.TestCase; @@ -32,7 +31,7 @@ /** * BufferedReader unit tests. */ -public class ConcurrentTests extends TestCase implements InstallerMain +public class ConcurrentTests extends TestCase implements UnitTestSuiteCreator { private int mMaxThreadId; private int mReleaseThreadId; @@ -42,7 +41,7 @@ private Object mLockEnd; // Begin j2meunit test framework setup - public void installerMain(String[] args) + public TestSuite createTestSuite(String[] args) { createDumperThread(false); TestSuite suite = new TestSuite(this.getClass().getName()); @@ -123,9 +122,7 @@ } })); - - - com.nokia.mj.impl.utils.OmjTestRunner.run(suite); + return suite; } @@ -142,7 +139,8 @@ { if (doCreate) { - new Thread(new Runnable(){ + new Thread(new Runnable() + { public void run() { threadSleep(5000); @@ -189,8 +187,8 @@ { if (doTrace) { - //System.out.println(str); - mTrace.addElement(str); + //System.out.println(str); + mTrace.addElement(str); } } @@ -250,7 +248,7 @@ try { - + testLock(true); } catch (Throwable t) @@ -269,7 +267,7 @@ try { - + testLock(true); } catch (Throwable t) @@ -288,7 +286,7 @@ try { - + testLock(false); } catch (Throwable t) @@ -307,7 +305,7 @@ try { - + testLock(false); } catch (Throwable t) @@ -359,13 +357,13 @@ { private int mId; private boolean mCheck; - + private LockTestThread(int id, boolean check) { mId = id; mCheck = check; } - public void run() + public void run() { threadSleep(20); trace("run: "+mId); @@ -389,7 +387,7 @@ trace("Got lock: "+mId); if (mCheck) { - String errorTxt = "Incorrect release order. mId: "+ mId + + String errorTxt = "Incorrect release order. mId: "+ mId + ", next: " +mNextReleasedThreadId; assertTrue(errorTxt, mNextReleasedThreadId == mId); } @@ -500,12 +498,12 @@ private class ConditionTestThread extends Thread { private int mId; - + private ConditionTestThread(int id) { mId = id; } - public void run() + public void run() { threadSleep(20); trace("run: "+mId); diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/localisation/build/build.xml --- a/javacommons/utils/tsrc/localisation/build/build.xml Tue Sep 14 21:06:50 2010 +0300 +++ b/javacommons/utils/tsrc/localisation/build/build.xml Wed Sep 15 12:05:25 2010 +0300 @@ -1,6 +1,6 @@ - - - - - - diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/unittestrunner/runner/build/bwins/javaunittestrunneru.def --- a/javacommons/utils/tsrc/unittestrunner/runner/build/bwins/javaunittestrunneru.def Tue Sep 14 21:06:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) - diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/unittestrunner/runner/build/eabi/javaunittestrunneru.def --- a/javacommons/utils/tsrc/unittestrunner/runner/build/eabi/javaunittestrunneru.def Tue Sep 14 21:06:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -EXPORTS - _Z10jni_lookupPKc @ 1 NONAME - diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/unittestrunner/runner/build/javaunittestrunner.pro --- a/javacommons/utils/tsrc/unittestrunner/runner/build/javaunittestrunner.pro Tue Sep 14 21:06:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -# -# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TARGET=javaunittestrunner -TEMPLATE=lib -CONFIG += omj java stl -CONFIG -= qt - -symbian { - TARGET.UID3 = 0xE0008435 -} -include(../../../../../../build/omj.pri) - diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/unittestrunner/runner/javasrc/com/nokia/mj/impl/rt/test/UnitTestRunner.java --- a/javacommons/utils/tsrc/unittestrunner/runner/javasrc/com/nokia/mj/impl/rt/test/UnitTestRunner.java Tue Sep 14 21:06:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -package com.nokia.mj.impl.rt.test; - -import com.nokia.mj.impl.installer.utils.InstallerMain; -import com.nokia.mj.impl.rt.support.JvmInternal; -import com.nokia.mj.impl.rt.support.ThreadEventListener; -import com.nokia.mj.impl.utils.Logger; -import com.nokia.mj.impl.utils.Tokenizer; - - -public class UnitTestRunner -{ - /** - * UnitTestRunner main program. - * - * @param args command line arguments - */ - public static void main(String[] args) - { - int exitCode = 0; - - System.out.println("java.version: " + - System.getProperty("java.version")); - System.out.println("java.fullversion: " + - System.getProperty("java.fullversion")); - - if (args.length == 0) - { - Logger.ELOG(Logger.EJavaRuntime, "No args provided."); - exitCode = -2; - } - 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.EJavaRuntime, "Unhandled exception in " + - threadName, throwable); - System.exit(-1); - } - }); - test(args); - } - catch (Throwable t) - { - Logger.ELOG(Logger.EJavaRuntime, "Unhandled exception in main", t); - exitCode = -1; - } - System.exit(exitCode); - } - - /** - * Main program for executing tests. - */ - private static void test(String[] args) - { - String mainClass = getMainClass(args[0]); - if (mainClass == null) - { - Logger.ELOG(Logger.EJavaRuntime, "Mainclass must be specified."); - return; - } - - try - { - // Instantiate mainclass and call its main() method. - Class clazz = Class.forName(mainClass); - InstallerMain instMain = (InstallerMain)clazz.newInstance(); - instMain.installerMain(args); - } - catch (Exception ex) - { - Logger.ELOG(Logger.EJavaRuntime, "Running mainclass failed", ex); - } - } - - /** - * Main program for executing tests. - */ - private static String getMainClass(String arg) - { - String[] mainClassArg = Tokenizer.split(arg, "="); - if (mainClassArg.length != 2) - { - return null; - } - if (!mainClassArg[0].equals("-mainclass")) - { - return null; - } - return mainClassArg[1]; - - } - - /** - * Logs arguments given to TCK Runner - */ - private static void logArgs(String[] args) - { - StringBuffer buf = new StringBuffer("UnitTestRunner args:"); - for (int i = 0; i < args.length; i++) - { - buf.append(" "); - buf.append(args[i]); - } - Logger.ILOG(Logger.EJavaRuntime, buf.toString()); - } - -} diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/unittestrunner/runner/javasrc/com/nokia/mj/impl/rt/unittestrunner/ApplicationInfoImpl.java --- a/javacommons/utils/tsrc/unittestrunner/runner/javasrc/com/nokia/mj/impl/rt/unittestrunner/ApplicationInfoImpl.java Tue Sep 14 21:06:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -package com.nokia.mj.impl.rt.unittestrunner; - -import com.nokia.mj.impl.rt.support.ApplicationInfo; -import com.nokia.mj.impl.utils.Uid; - -public class ApplicationInfoImpl extends ApplicationInfo -{ - private String iProtectionDomain = null; - - /** - */ - public String getRuntimeType() - { - // See runtime types defined in ApplicationInfo class. - return "UnitTest_Runner"; - } - - /** - */ - public String getProtectionDomain() - { - return MANUFACTURER_DOMAIN; - } - - /** - */ - public Uid getUid() - { - return Uid.createUid("[ffffffff]"); - } - - /** - */ - public Uid getSuiteUid() - { - throw new RuntimeException - ("Get suite uid is not applicable for TckRunner"); - } - - /** - */ - public String getSuiteName() - { - return getName(); - } - - /** - */ - public String getName() - { - return "JavaUnitTester"; - } - - /** - */ - public String getVendor() - { - return "Nokia"; - } - - /** - */ - public String getVersion() - { - return "1.0.0"; - } - - /** - */ - public String getRootPath() - { - return "."; - } - - /** - */ - public String getMainClass() - { - throw new RuntimeException - ("Get main class is not applicable for UntiTestRunner"); - } - - /** - */ - public String getAttribute(String key) - { - return null; - } -} diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/unittestrunner/runner/javasrc/com/nokia/mj/impl/rt/unittestrunner/ApplicationUtilsImpl.java --- a/javacommons/utils/tsrc/unittestrunner/runner/javasrc/com/nokia/mj/impl/rt/unittestrunner/ApplicationUtilsImpl.java Tue Sep 14 21:06:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -package com.nokia.mj.impl.rt.unittestrunner; - -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; - -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 d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/unittestrunner/starter/build/javauntitester.pro --- a/javacommons/utils/tsrc/unittestrunner/starter/build/javauntitester.pro Tue Sep 14 21:06:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -# -# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# - -TARGET=javaunittester -TEMPLATE=app - -CONFIG += omj no_icon stl -CONFIG -= qt - -INCLUDEPATH += ../../../../../../javaruntimes/inc - -LIBS += -ljavaruntimestarterutils -ljavastorage - -symbian { - TARGET.EPOCHEAPSIZE = 0x020000 0x800000 - TARGET.EPOCSTACKSIZE = 0x14000 - TARGET.CAPABILITY = all -tcb -allfiles -drm -} - - -include(../../../../../../build/omj.pri) diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/unittestrunner/starter/src/main.cpp --- a/javacommons/utils/tsrc/unittestrunner/starter/src/main.cpp Tue Sep 14 21:06:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,110 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Main program for the Unit test 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 UNIT_TEST_RUNNER_MAIN_CLASS = L"com.nokia.mj.impl.rt.test.UnitTestRunner"; -void findMidlet(); - -int main(int argc, char *argv[]) -{ - LOG(EJavaRuntime, EInfo, "UNIT TEST RUNNER main()"); - - int result = -1; - try - { - result = startJvm(argc, argv); - } - catch (RuntimeException& e) - { - ELOG1(EJavaRuntime, "UNIT TEST RUNNER main() RuntimeException caught: %s ", - e.toString().c_str()); - } - - catch (ExceptionBase& e) - { - ELOG1(EJavaRuntime, "UNIT TEST RUNNER main() ExceptionBase caught: %s ", - e.toString().c_str()); - } - - catch (std::exception& e) - { - ELOG1(EJavaRuntime, "UNIT TEST RUNNER main() Exception %s caught", e.what()); - } - - LOG1(EJavaRuntime, EInfo, "UNIT TEST RUNNER EXIT = %d", result); - return result; -} - -int startJvm(int argc, char *argv[]) -{ - JELOG2(EJavaRuntime); - - // Create instance of RuntimeStarterUtils for thread supervisioning. - std::auto_ptr starterUtils(new RuntimeStarterUtils()); - starterUtils->startThreadSupervisor(); - - JvmStarter::Configuration config = JvmStarter::CLDC; - int argInd = 1; - if (argc > 2) - { - if (strncmp(argv[1], "-conf", 5) == 0) - { - argInd = 2; - if (strcmp(argv[1]+5, "=cdc") == 0) - { - config = JvmStarter::CDC; - } - else if (strcmp(argv[1]+5, "=foundation") == 0) - { - config = JvmStarter::FOUNDATION; - } - } - } - // Create starter for starting the JVM - std::auto_ptr - jvm(JvmStarter::getJvmStarterInstance(config, - L"Unit_test_runner")); - - // starterUtils->enableDevelopmentFeatures(*jvm.get()); - jvm->enableThreadDumping(); - - jvm->appendSystemProperty(L"-Dcom.nokia.rt.port=unittestrunner"); - - jvm->setMainClass(UNIT_TEST_RUNNER_MAIN_CLASS); - - for (; argInd < argc; ++argInd) - { - jvm->appendApplicationArgument( - JavaCommonUtils::utf8ToWstring(argv[argInd])); - } - - // Start the JVM. - return jvm->startJvm(); -} diff -r d5e927d5853b -r 7cee158cb8cd javacommons/utils/tsrc/unittestrunner/subsystem.mk --- a/javacommons/utils/tsrc/unittestrunner/subsystem.mk Tue Sep 14 21:06:50 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ -# -# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies 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 += \ - starter/build \ - runner/build - -include ${JAVA_SRC_ROOT}/build/Makefile.subsystem diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/bld.inf --- a/javaextensions/bld.inf Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/bld.inf Wed Sep 15 12:05:25 2010 +0300 @@ -27,6 +27,7 @@ #include "location/build/bld.inf" #include "sensor/build/bld.inf" #include "broadcast_stub/build/bld.inf" +#include "centralrepository/build/bld.inf" #include "midppush/bld.inf" #include "bluetooth/bld.inf" #include "datagram/bld.inf" diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/bluetooth/bluecove/build/javabluecove_0x2002DC97.mmp --- a/javaextensions/bluetooth/bluecove/build/javabluecove_0x2002DC97.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/bluetooth/bluecove/build/javabluecove_0x2002DC97.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -92,7 +93,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60bluetoothplatformcontrol.cpp --- a/javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60bluetoothplatformcontrol.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/bluetooth/bluetoothcommons/bluetoothplatformcontrol/src.s60/s60bluetoothplatformcontrol.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -358,7 +358,7 @@ */ std::wstring *S60BluetoothPlatformControl::getBluetoothName() { - TBuf16 bluetoothName; + TBuf16 bluetoothName; JELOG2(EJavaBluetooth); TInt error = RProperty::Get(KPropertyUidBluetoothCategory, diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons_0x2002DC99.mmp --- a/javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons_0x2002DC99.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons_0x2002DC99.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -126,7 +127,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/bluetooth/bluetoothplugins/btgoeppushplugin/build/javabtgoepscplugin_0x2002DC9A.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btgoeppushplugin/build/javabtgoepscplugin_0x2002DC9A.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/bluetooth/bluetoothplugins/btgoeppushplugin/build/javabtgoepscplugin_0x2002DC9A.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -110,7 +111,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/bluetooth/bluetoothplugins/btjavacaptainplugin/build/javacaptain_ext_btdeviceclassmanager_0x2002DC9D.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btjavacaptainplugin/build/javacaptain_ext_btdeviceclassmanager_0x2002DC9D.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/bluetooth/bluetoothplugins/btjavacaptainplugin/build/javacaptain_ext_btdeviceclassmanager_0x2002DC9D.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -104,7 +105,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/build/javabtl2capscplugin_0x2002DC9B.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/build/javabtl2capscplugin_0x2002DC9B.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/build/javabtl2capscplugin_0x2002DC9B.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -112,7 +113,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/bluetooth/bluetoothplugins/btspppushplugin/build/javabtsppscplugin_0x2002DC9C.mmp --- a/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/build/javabtsppscplugin_0x2002DC9C.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/build/javabtsppscplugin_0x2002DC9C.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -112,7 +113,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/bluetooth/omjbluetooth/build/javabluetooth_0x2002DC98.mmp --- a/javaextensions/bluetooth/omjbluetooth/build/javabluetooth_0x2002DC98.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/bluetooth/omjbluetooth/build/javabluetooth_0x2002DC98.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -118,7 +119,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd 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 Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/bluetooth/omjbluetooth/javasrc/com/nokia/mj/impl/properties/bluetooth/BtDynamicPropertyHandler.java Wed Sep 15 12:05:25 2010 +0300 @@ -65,7 +65,7 @@ private static final int MASTER_SWITCH = 7; - private static final int SD_TRANS_MAX = 1; + private static final int SD_TRANS_MAX = 8; private static final int SD_ATTR_RETRIEVE_MAX = 9; diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/broadcast_stub/build/javabroadcast_0x2002DCE0.mmp --- a/javaextensions/broadcast_stub/build/javabroadcast_0x2002DCE0.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/broadcast_stub/build/javabroadcast_0x2002DCE0.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -91,7 +92,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/build/bld.inf Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Generated bld.inf -file +* +*/ + +PRJ_PLATFORMS +default + +PRJ_MMPFILES +javacentrep_0x2002DCE1.mmp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/build/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/build/build.xml Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,42 @@ + + + + + Builds Central Repository Component + + + + + + + + + + + + + + + + diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/build/bwins/javacentrepu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/build/bwins/javacentrepu.def Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) + diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/build/eabi/javacentrepu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/build/eabi/javacentrepu.def Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,5 @@ +EXPORTS + _Z10jni_lookupPKc @ 1 NONAME + _ZTI22CJavaCentralRepository @ 2 NONAME + _ZTV22CJavaCentralRepository @ 3 NONAME + diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/build/javacentrep.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/build/javacentrep.pro Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,32 @@ +# +# 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=javacentrep +TEMPLATE=lib +CONFIG += omj java stl +CONFIG -= qt + +include(../../../inc/build_defines.pri) + +symbian { + INCLUDEPATH += ../inc + SOURCES += ../src/*.cpp + + LIBS += -lcentralrepository \ + -leuser +} + +include(../../../build/omj.pri) diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/build/javacentrep_0x2002DCE1.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/build/javacentrep_0x2002DCE1.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -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 : javacentrep.mmp +// ============================================================================== + +TARGET javacentrep.dll +TARGETTYPE DLL + +UID 0x1000008d 0x2002DCE1 +SECUREID 0x2002DCE1 + +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_PIM_MULTICAL_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 cjavacentralrepository.cpp +SOURCE javacentralrepositoryjni.cpp + + +LIBRARY centralrepository.lib +LIBRARY euser.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.525 + +ARMFPU softvfp + +PAGED + +BYTEPAIRCOMPRESSTARGET + +USERINCLUDE . + +#include + + APP_LAYER_SYSTEMINCLUDE + + OS_LAYER_LIBC_SYSTEMINCLUDE + + OS_LAYER_SSL_SYSTEMINCLUDE + +deffile ./~/javacentrep.def + + SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5) + +SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah + +SOURCEPATH /epoc32/build/jrt/javabuild/javacentrep + +SOURCE lookup.cpp + +SOURCEPATH /epoc32/build/jrt/javabuild/javacentrep + +SOURCE jxe.c + +#ifdef WINSCW + +LIBRARY ewsd.lib + +#endif + +STDCPP + +#ifdef WINSCW +DEFFILE ./bwins/javacentrep.def +#elif defined EABI +DEFFILE ./eabi/javacentrep.def +#endif diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/inc/centrepfunctionserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/inc/centrepfunctionserver.h Wed Sep 15 12:05:25 2010 +0300 @@ -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: +* +*/ + + +#ifndef CENTREPFUNCTIONSERVER_H +#define CENTREPFUNCTIONSERVER_H + +#include "monitor.h" +#include "functionserver.h" +#include "legacyeventserverwrapper.h" + +namespace java +{ +namespace centrep +{ + +/** + * If we have to execute some operation that essentially + * needs ActiveScheduler, then we use this CentrepFunctionServer. + * + * We must however be careful not to make callbacks through FunctionServer. + * Reason: If in callback, app calls another method that needs FunctionServer + * to execute, we enter a deadlock. + */ + +class CentrepFunctionServer: public java::util::FunctionServer, + public LegacyEventServerWrapper +{ +public: + + CentrepFunctionServer() : + java::util::FunctionServer("JavaCentrepFunctionServer") + { + JELOG2(EJavaCentrep); + + //Creates a new thread and starts active scheduler + //This results in call to doServerSideInit() + createServerToNewThread(); + mServer = reinterpret_cast(this); + } + + ~CentrepFunctionServer() + { + JELOG2(EJavaCentrep); + stopServer(); + } + + java::util::FunctionServer* getFunctionServer() const + { + JELOG2(EJavaCentrep); + return mServer; + } + +private: + + void doServerSideInit() + { + JELOG2(EJavaCentrep); + FunctionServer::doServerSideInit(); + } + +private: + + java::util::FunctionServer* mServer; +}; + +} //end namespace centrep +} //end namespace java + +#endif // CENTREPFUNCTIONSERVER_H diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/inc/cjavacentralrepository.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/inc/cjavacentralrepository.h Wed Sep 15 12:05:25 2010 +0300 @@ -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: +* +*/ + +#ifndef C_JAVACENTRALREPOSITORY_H +#define C_JAVACENTRALREPOSITORY_H + + +#include + +class CRepository; + +/** + * Java Central Repository. + */ +class CJavaCentralRepository : public CBase +{ +public: + + /** + * Two-phased constructor. + * @param aRepositoryUid The UID of the repository to be accessed + */ + static CJavaCentralRepository* NewL(TUid aRepositoryUid); + + /** + * Two-phased constructor. + * @param aRepositoryUid The UID of the repository to be accessed + */ + static CJavaCentralRepository* NewLC(TUid aRepositoryUid); + + /** + * Destructor. + */ + virtual ~CJavaCentralRepository(); + + /** + * Closes opened central repository. + */ + void Close(); + + /** + * Reads a descriptor setting. + * + * @param aKey Key of setting to be read. + * @param aValue Returns the value of the setting if it is a descriptor. + * @leave System wide code if setting can not be read. + */ + void GetL(TUint32 aKey, TDes& aValue); + + /** + * Reads a integer setting. + * + * @param aKey Key of setting to be read. + * @param aValue Returns the value of the setting if it is an integer. + * @leave System wide code if setting can not be read. + */ + void GetL(TUint32 aKey, TInt& aValue); + + /** + * Stores descriptor setting. + * + * @param key The key of setting to be stored. + * @param value The value of the setting to be stored. + * @leave System wide error code if value cannot be stored. + */ + void SetL(TUint32 aKey, TDesC& aValue); + + /** + * Stores integer setting. + * + * @param aKey Key of setting to be stored. + * @param aValue The value of the setting to be stored. + * @leave System wide error code if value cannot be stored. + */ + void SetL(TUint32 aKey, TInt aValue); + + HBufC* GetStringL(TUint32 aKey); + + TInt GetIntL(TUint32 aKey); + +private: + + CJavaCentralRepository(TUid aRepositoryUid); + + void ConstructL(); + +private: // data + + /** + * Access to a repository + * Own + */ + CRepository* iRepository; + + /** + * Repository ID + */ + TUid iRepositoryUid; + +}; + +#endif // C_JAVACENTRALREPOSITORY_H diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/javasrc/com/nokia/mid/cenrep/CentralRepository.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/javasrc/com/nokia/mid/cenrep/CentralRepository.java Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,124 @@ +/* +* 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.mid.cenrep; + +import com.nokia.mj.impl.cenrep.CentralRepositoryImpl; + +/** + * The CentralRepository is class to manage application + * settings and share data with other runtimes. In S60 this API can be used + * to set and get values in Symbian Central Repositories.

+ * + * Example of usage:

+ * + * + * class CentralRepositoryExample { + * private static final String EXAMPLE_REPOSITORY= "0x20000000"; + * private static final String EXAMPLE_KEY1 = "0x00000001"; + * private static final String EXAMPLE_KEY2 = "0x00000002"; + * + * public modifySetting() throws CentralRepositoryException { + * CentralRepository cenrep = CentralRepository.open(EXAMPLE_REPOSITORY); + * try { + * String value1 = cenrep.getString(EXAMPLE_KEY1); + * int value2 = cenrep.getInt(EXAMPLE_KEY2); + + * cenrep.setString(EXAMPLE_KEY1, value3); + * cenrep.setInt(EXAMPLE_KEY2, value4); + * } + * catch (CentralRepositoryException cre) { + * System.out.println(cre); + * } + * finally { + * cenrep.close(); + * } + * } + * } + */ +public abstract class CentralRepository +{ + + /** + * Hidden default constructor. + */ + protected CentralRepository() + { + } + + /** + * Opens central repository. + * + * @param repositoryId it is platform specific and in S60 it is + * Symbian Central Repository UID. + * @return An instance of CentralRepository class + * for accessing a repository. + * @throws CentralRepositoryException if openning fails. + */ + static public CentralRepository open(String repositoryId) + throws CentralRepositoryException + { + return CentralRepositoryImpl.open(repositoryId); + } + + /** + * Closes central repository. If get or set methods are used after + * close operation, exception will be thrown. + */ + public abstract void close() + throws CentralRepositoryException; + + /** + * Returns string stored in given key. + * + * @param key the key of setting to be read. + * @return the value of the setting if it is the string. + * @throws CentralRepositoryException if key is not found or + * stored data is not string. + */ + public abstract String getString(String key) + throws CentralRepositoryException; + + /** + * Returns integer stored in given key. + * + * @param key the key of setting to be read. + * @return the value of the setting if it is an integer. + * @throws CentralRepositoryException if key is not found or + * stored data is not integer. + */ + public abstract int getInt(String key) + throws CentralRepositoryException; + + /** Stores string value in key. + * + * @param key the key of setting to be stored. + * @param value the string value of the setting to be stored. + * @throws CentralRepositoryException if string value cannot be stored. + */ + public abstract void setString(String key, String value) + throws CentralRepositoryException; + + /** Stores integer value in key. + * + * @param key the key of setting to be stored. + * @param value the integer value of the setting to be stored. + * @throws CentralRepositoryException if integer value cannot be stored. + */ + public abstract void setInt(String key, int value) + throws CentralRepositoryException; +} diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/javasrc/com/nokia/mid/cenrep/CentralRepositoryException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/javasrc/com/nokia/mid/cenrep/CentralRepositoryException.java Wed Sep 15 12:05:25 2010 +0300 @@ -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: +* +*/ + +package com.nokia.mid.cenrep; + +/** + * Generic exception class for Central Repository API. + */ +public class CentralRepositoryException extends Exception +{ + + /** + * Default constructor is not allowed. + */ + protected CentralRepositoryException() + { + } + + /** + * Constructs an exception instance with a textual information. + * + * @param message human readable information about the exception. + */ + public CentralRepositoryException(String message) + { + super(message); + } + +} diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/javasrc/com/nokia/mj/impl/cenrep/CentralRepositoryImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/javasrc/com/nokia/mj/impl/cenrep/CentralRepositoryImpl.java Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,354 @@ +/* +* 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.cenrep; + +import com.nokia.mid.cenrep.CentralRepository; +import com.nokia.mid.cenrep.CentralRepositoryException; +import com.nokia.mj.impl.gcf.utils.NativeError; +import com.nokia.mj.impl.rt.support.ApplicationInfo; +import com.nokia.mj.impl.utils.Logger; +import com.nokia.mj.impl.rt.support.Finalizer; +import com.nokia.mj.impl.rt.support.Jvm; + +/** + * CentralRepositoryImpl implements the functionality specified in + * com.nokia.mid.cenrep.CentralRepository class. + */ +public class CentralRepositoryImpl extends CentralRepository +{ + + static + { + try + { + Jvm.loadSystemLibrary("javacentrep"); + } + catch (Exception e) + { + Logger.ELOG(Logger.EJavaCentrep, + "Unable to load javacentrep dll."); + } + } + + private static final int INITIAL = 0; + + private static final int OPEN = 1; + + private static final int CLOSED = 2; + + /* + * Central Repository API Function server. + */ + private int iFunctionSourceHandle; + + /** + * Handle to the native side peer object. + */ + private int iCenrepHandle = 0; + + /** + * Repository ID + */ + private String iRepositoryId = null; + + private Finalizer iFinalizer; + + private int iState; + + /** + * Hidden default constructor. + */ + private CentralRepositoryImpl() + { + } + + /** + * Hidden constructor. + * + * @param repositoryId it is platform specific and in S60 it is + * Symbian Central Repository UID. + */ + private CentralRepositoryImpl(String repositoryId) + throws CentralRepositoryException + { + checkAccess(); + iState = INITIAL; + int cenrepUid = CentralRepositoryUid.getIntValue(repositoryId); + this.iRepositoryId = repositoryId; + iFinalizer = registerFinalize(); + + iFunctionSourceHandle = _createFunctionSource(); + iCenrepHandle = _createNativePeer(iFunctionSourceHandle, cenrepUid); + iState = OPEN; + } + + /** + * See class CentralRepository for comments. + */ + static public CentralRepository open(String repositoryId) + throws CentralRepositoryException + { + return new CentralRepositoryImpl(repositoryId); + } + + /** + * See class CentralRepository for comments. + */ + public void close() throws CentralRepositoryException + { + synchronized (this) + { + + if (iState != CLOSED) + { + iState = CLOSED; + _close(iFunctionSourceHandle, iCenrepHandle); + _dispose(iFunctionSourceHandle, iCenrepHandle); + } + iRepositoryId = null; + } + } + + /** + * See class CentralRepository for comments. + */ + public String getString(String key) + throws CentralRepositoryException + { + synchronized (this) + { + + if (iState == CLOSED) + { + throw new CentralRepositoryException("Connection Already Closed"); + } + long cenrepKey = CentralRepositoryKey.getLongValue(key); + String value = _getString(iFunctionSourceHandle, iCenrepHandle, cenrepKey); + return value; + } + } + + /** + * See class CentralRepository for comments. + */ + public int getInt(String key) + throws CentralRepositoryException + { + synchronized (this) + { + + if (iState == CLOSED) + { + throw new CentralRepositoryException("Connection Already Closed"); + } + long cenrepKey = CentralRepositoryKey.getLongValue(key); + int res = _getInt(iFunctionSourceHandle, iCenrepHandle, cenrepKey); + return res; + } + } + + /** + * See class CentralRepository for comments. + */ + public void setString(String key, String value) + throws CentralRepositoryException + { + synchronized (this) + { + + if (iState == CLOSED) + { + throw new CentralRepositoryException("Connection Already Closed"); + } + long cenrepKey = CentralRepositoryKey.getLongValue(key); + if (value == null) + { + throw new CentralRepositoryException("Value is null"); + } + _setString(iFunctionSourceHandle, iCenrepHandle, cenrepKey, value); + } + } + + /** + * See class CentralRepository for comments. + */ + public void setInt(String key, int value) + throws CentralRepositoryException + { + synchronized (this) + { + + if (iState == CLOSED) + { + throw new CentralRepositoryException("Connection Already Closed"); + } + long cenrepKey = CentralRepositoryKey.getLongValue(key); + _setInt(iFunctionSourceHandle, iCenrepHandle, cenrepKey, value); + } + } + + /** + * Registers with Finalizer to call a method when the object gets collected + * by GC + * + * @return Finalizer object that will be notified when GC happens + */ + private Finalizer registerFinalize() + { + return new Finalizer() + { + public void finalizeImpl() + { + registeredFinalize(); + } + }; + } + + /** + * Called when the object is finalized by the garbage collector. + */ + final void registeredFinalize() + { + try + { + close(); + } + catch (CentralRepositoryException e) + { + // Ignore + } + } + + /** + * Creates a native side function source. + * + * @return handle to the native function source. + */ + private native int _createFunctionSource(); + + /** + * Create native side peer of this Java class. It opens a repository. + * + * @param FunctionSource Handle handle to the native function source. + * @param arepositoryId is platform specific and in S60 it is + * Symbian Central Repository UID. + * @return handle to the native side peer. + * @return Symbian OS error code, if openning fails. + */ + private native int _createNativePeer( + int aFunctionSourceHandle, + int repositoryId); + + /** + * Closes a repository. + * + * @param FunctionSourceHandle handle to the native function source. + * @param cenrepHandle handle to the native side peer object. + * @return Symbian OS error code, if closing fails. + */ + private native void _close(int aFunctionSourceHandle, int cenrepHandle); + + /** + * Dispose native side resources owned by this class. + * + * @param FunctionSourceHandle handle to the native function source. + * @param cenrepHandle handle to the native side peer object. + */ + private native void _dispose(int aFunctionSourceHandle, int cenrepHandle); + + /** + * Returns string stored in given key. + * + * @param FunctionSourceHandle handle to the native function source. + * @param cenrepHandle handle to the native side peer object. + * @param key the key of setting to be read. + * @param value returns the value of the setting if it is the string. + * @return Symbian OS error code, if key is not found or + * stored data is not string. + */ + private native String _getString( + int aFunctionSourceHandle, + int cenrepHandle, + long key); + + /** + * Returns integer stored in given key. + * + * @param FunctionSourceHandle handle to the native function source. + * @param cenrepHandle handle to the native side peer object. + * @param key the key of setting to be read. + * @param value the value of the setting if it is an integer. + * @return Symbian OS error code, if key is not found or + * stored data is not integer. + */ + private native int _getInt( + int aFunctionSourceHandle, + int cenrepHandle, + long key); + + /** Stores string value in key. + * + * @param FunctionSourceHandle handle to the native function source. + * @param cenrepHandle handle to the native side peer object. + * @param key the key of setting to be stored. + * @param value the string value of the setting to be stored. + * @return Symbian OS error code, if string value cannot be stored. + */ + private native void _setString( + int aFunctionSourceHandle, + int cenrepHandle, + long key, + String value); + + /** Stores integer value in key. + * + * @param FunctionSourceHandle handle to the native function source. + * @param cenrepHandle handle to the native side peer object. + * @param key the key of setting to be stored. + * @param value the integer value of the setting to be stored. + * @return Symbian OS error code, if integer value cannot be stored. + */ + private native void _setInt( + int aFunctionSourceHandle, + int cenrepHandle, + long key, + int value); + + + /** + * Checks if MIDlet is permited to access the central repository. + * Only MIDlets in manufacturer or operator domain are allowed. + * @throws CentralRepositoryException if MIDlet is not in manufacturer or + * operator domain. + */ + private void checkAccess() + throws SecurityException + { + + ApplicationInfo appInfo = ApplicationInfo.getInstance(); + String protectionDomain = appInfo.getProtectionDomain(); + + if (protectionDomain.equals(ApplicationInfo.MANUFACTURER_DOMAIN) == false && + protectionDomain.equals(ApplicationInfo.OPERATOR_DOMAIN) == false) + { + Logger.ELOG(Logger.EJavaCentrep, "Protection Domain: " + protectionDomain + + ", Access denied"); + throw new SecurityException("Access denied!"); + } + } +} diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/javasrc/com/nokia/mj/impl/cenrep/CentralRepositoryKey.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/javasrc/com/nokia/mj/impl/cenrep/CentralRepositoryKey.java Wed Sep 15 12:05:25 2010 +0300 @@ -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: +* +*/ + +package com.nokia.mj.impl.cenrep; + +import com.nokia.mid.cenrep.CentralRepositoryException; +/** + * Class for central repository key representation + */ +class CentralRepositoryKey +{ + + /** + * Default constructor. + */ + protected CentralRepositoryKey() + { + } + + /** + * Returns long value represantion. + * + * @param value string represantion of key. + * @throws CentralRepositoryException, if key is null, empty, negative + * or not valid. + */ + static long getLongValue(String value) + throws CentralRepositoryException + { + if (value == null || value.length() == 0) + { + throw new CentralRepositoryException("Key is null or empty!"); + } + + String numStr = value; + + // Negative value is not allowed + if (numStr.startsWith("-")) + { + throw new CentralRepositoryException("Nagative value is not allowed!"); + } + + // Check for optional radix prefix. + int radix = 10; + if (numStr.startsWith("0x")) + { + radix = 16; + numStr = numStr.substring(2); + } + + return Long.parseLong(numStr, radix); + } + +}; diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/javasrc/com/nokia/mj/impl/cenrep/CentralRepositoryUid.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/javasrc/com/nokia/mj/impl/cenrep/CentralRepositoryUid.java Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,90 @@ +/* +* 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.cenrep; + +import com.nokia.mj.impl.utils.Uid; +import com.nokia.mid.cenrep.CentralRepositoryException; + +/** + * Class for central repository UID. + */ +class CentralRepositoryUid extends Uid +{ + + /** + * Default constructor. + */ + protected CentralRepositoryUid() + { + super(); + } + + /** + * Returns int value + * + * @param value string representation of uid. + * @throws CentralRepositoryException, if value is null, empty or not valid. + */ + static int getIntValue(String value) + throws CentralRepositoryException + { + Uid uid = Uid.createUid(value); + if (uid == null) + { + throw new CentralRepositoryException("Uid is null or empty"); + } + + String numStr = uid.getStringValue(); + + // Check if value is negative. + boolean negative = false; + if (numStr.startsWith("-")) + { + negative = true; + numStr = numStr.substring(1); + } + + // Check for optional radix prefix. + int radix = 10; + if (numStr.startsWith("0x")) + { + radix = 16; + numStr = numStr.substring(2); + } + + // Check if numStr is in Symbian TUid form [12345678]. + if (numStr.length() <= 10 && numStr.startsWith("[") && numStr.endsWith("]")) + { + radix = 16; + numStr = numStr.substring(1, numStr.length()-1); + } + + int result = 0; + long val = Long.parseLong(numStr, radix); + if (negative) + { + result = (int)-val; + } + else + { + result = (int)val; + } + return result; + } + +}; diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/src/cjavacentralrepository.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/src/cjavacentralrepository.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,134 @@ +/* +* 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 // CRepository + +#include "cjavacentralrepository.h" // CJavaCentralRepository +#include "logger.h" +// ======== MEMBER FUNCTIONS ======== + +// --------------------------------------------------------------------------- +// CJavaCentralRepository::NewL +// --------------------------------------------------------------------------- +CJavaCentralRepository* CJavaCentralRepository::NewL(TUid aRepositoryUid) +{ + CJavaCentralRepository* self = CJavaCentralRepository::NewLC(aRepositoryUid); + CleanupStack::Pop(self); + return self; +} + +// --------------------------------------------------------------------------- +// CJavaCentralRepository::NewLC +// --------------------------------------------------------------------------- +CJavaCentralRepository* CJavaCentralRepository::NewLC(TUid aRepositoryUid) +{ + CJavaCentralRepository* self = + new(ELeave) CJavaCentralRepository(aRepositoryUid); + CleanupStack::PushL(self); + self->ConstructL(); + return self; +} + +// --------------------------------------------------------------------------- +// CJavaCentralRepository::~CJavaCentralRepository +// --------------------------------------------------------------------------- +CJavaCentralRepository::~CJavaCentralRepository() +{ + Close(); +} + +// --------------------------------------------------------------------------- +// CJavaCentralRepository::Close +// --------------------------------------------------------------------------- +void CJavaCentralRepository::Close() +{ + iRepositoryUid = TUid::Null(); + delete iRepository; + iRepository = NULL; +} + +// --------------------------------------------------------------------------- +// CJavaCentralRepository::CJavaCentralRepository +// --------------------------------------------------------------------------- +CJavaCentralRepository::CJavaCentralRepository(TUid aRepositoryUid) +{ + iRepositoryUid = aRepositoryUid; +} + +// --------------------------------------------------------------------------- +// CJavaCentralRepository::ConstructL +// --------------------------------------------------------------------------- +void CJavaCentralRepository::ConstructL() +{ + iRepository = CRepository::NewL(iRepositoryUid); +} + +/** + * GetStringL + */ +HBufC* CJavaCentralRepository::GetStringL(TUint32 aKey) +{ + HBufC* value = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength); + TPtr ptr(value->Des()); + GetL(aKey, ptr); + + //aValue = value; + CleanupStack::Pop(value); + return value; +} + +// --------------------------------------------------------------------------- +// CJavaCentralRepository::Get +// --------------------------------------------------------------------------- +void CJavaCentralRepository::GetL(TUint32 aKey, TDes& aValue) +{ + User::LeaveIfError(iRepository->Get(aKey, aValue)); +} + +/** + * GetIntL + */ +TInt CJavaCentralRepository::GetIntL(TUint32 aKey/*, TInt& aValue*/) +{ + TInt value(0); + GetL(aKey, value); + return value; +} + +// --------------------------------------------------------------------------- +// CJavaCentralRepository::Get +// --------------------------------------------------------------------------- +void CJavaCentralRepository::GetL(TUint32 aKey, TInt& aValue) +{ + User::LeaveIfError(iRepository->Get(aKey, aValue)); +} + +// --------------------------------------------------------------------------- +// CJavaCentralRepository::Set +// --------------------------------------------------------------------------- +void CJavaCentralRepository::SetL(TUint32 aKey, TDesC& aValue) +{ + User::LeaveIfError(iRepository->Set(aKey, aValue)); +} + +// --------------------------------------------------------------------------- +// CJavaCentralRepository::Set +// --------------------------------------------------------------------------- +void CJavaCentralRepository::SetL(TUint32 aKey, TInt aValue) +{ + User::LeaveIfError(iRepository->Set(aKey, aValue)); +} diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/centralrepository/src/javacentralrepositoryjni.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/centralrepository/src/javacentralrepositoryjni.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,277 @@ +/* +* 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 // KMaxUnicodeStringLength + +#include "com_nokia_mj_impl_cenrep_CentralRepositoryImpl.h" +#include "cjavacentralrepository.h" +#include "centrepfunctionserver.h" +#include "javajniutils.h" +#include "jstringutils.h" +#include "s60commonutils.h" +#include "logger.h" +#include "fs_methodcall.h" + +using namespace java::util; +/* + * Class: com_nokia_mj_impl_cenrep_CentralRepositoryImpl + * Method: _createFunctionSource + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_cenrep_CentralRepositoryImpl__1createFunctionSource +(JNIEnv *aJni, jobject /*aPeer*/) +{ + JELOG2(EJavaCentrep); + java::centrep::CentrepFunctionServer* mFunctionServer; + mFunctionServer = new java::centrep::CentrepFunctionServer(); + TInt handle = reinterpret_cast(mFunctionServer); + if (handle < KErrNone) + { + JniUtils::throwNewException(aJni, "com/nokia/mid/cenrep/CentralRepositoryException" , + JavaCommonUtils::intToString(handle)); + } + return handle; +} + +/** + * CreateCentralRepositoryL + */ +void CreateCentralRepositoryL(CJavaCentralRepository*& aCenRep, + TUid aRepositoryId) +{ + CJavaCentralRepository* cenrep = + CJavaCentralRepository::NewL(aRepositoryId); + aCenRep = cenrep; +} + +/* + * Class: com_nokia_mj_impl_cenrep_CentralRepositoryImpl + * Method: _createNativePeer + * Signature: (II)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_cenrep_CentralRepositoryImpl__1createNativePeer +(JNIEnv *aJni, jobject, jint aFunctionSourceHandle, jint aRepositoryId) +{ + java::centrep::CentrepFunctionServer* mFunctionServer = + reinterpret_cast< java::centrep::CentrepFunctionServer*>(aFunctionSourceHandle); + + CJavaCentralRepository* cenrep = NULL; + + TUid uid = TUid::Uid(aRepositoryId); + TRAPD(err,CallMethodL(CreateCentralRepositoryL, cenrep, uid, mFunctionServer)); + + if (err != KErrNone) + { + JniUtils::throwNewException(aJni, "com/nokia/mid/cenrep/CentralRepositoryException" , + JavaCommonUtils::intToString(err)); + } + return reinterpret_cast(cenrep); +} + +/** + * Close + */ +void CloseCentralRepository(CJavaCentralRepository* aCenRep) +{ + aCenRep->Close(); +} + +/* + * Class: com_nokia_mj_impl_cenrep_CentralRepositoryImpl + * Method: _close + * Signature: (II)I + */ +JNIEXPORT void JNICALL Java_com_nokia_mj_impl_cenrep_CentralRepositoryImpl__1close +(JNIEnv *, jobject, jint aFunctionSourceHandle, jint aCenrepHandle) +{ + java::centrep::CentrepFunctionServer* mFunctionServer = + reinterpret_cast< java::centrep::CentrepFunctionServer*>( + aFunctionSourceHandle); + + CJavaCentralRepository* cenrep = + reinterpret_cast(aCenrepHandle); + + CallMethod(CloseCentralRepository, cenrep, mFunctionServer); +} + +/** + * Dispose + */ +void Dispose(CJavaCentralRepository* aCenRep) +{ + delete aCenRep; + aCenRep = NULL; +} + +/* + * Class: com_nokia_mj_impl_cenrep_CentralRepositoryImpl + * Method: _dispose + * Signature: (II)V + */ +JNIEXPORT void JNICALL Java_com_nokia_mj_impl_cenrep_CentralRepositoryImpl__1dispose +(JNIEnv *, jobject, jint aFunctionSourceHandle, jint aCenrepHandle) +{ + java::centrep::CentrepFunctionServer* mFunctionServer = + reinterpret_cast< java::centrep::CentrepFunctionServer*>( + aFunctionSourceHandle); + + CJavaCentralRepository* cenrep = + reinterpret_cast(aCenrepHandle); + + CallMethod(Dispose, cenrep, mFunctionServer); + delete mFunctionServer; +} + +/* + * Class: com_nokia_mj_impl_cenrep_CentralRepositoryImpl + * Method: _getString + * Signature: (IIJLcom/nokia/mj/impl/cenrep/CentralRepositoryImpl$StringValue;)I + */ +JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_cenrep_CentralRepositoryImpl__1getString +(JNIEnv * aJni, jobject, jint aFunctionSourceHandle, jint aCenrepHandle, + jlong aKey) +{ + java::centrep::CentrepFunctionServer* mFunctionServer = + reinterpret_cast< java::centrep::CentrepFunctionServer*>( + aFunctionSourceHandle); + + CJavaCentralRepository* cenrep = + reinterpret_cast(aCenrepHandle); + + HBufC* buf = NULL; + + TUint32 key = (TUint32)aKey; + TRAPD(err, CallMethodL(buf, cenrep, &CJavaCentralRepository::GetStringL, key, mFunctionServer)); + + jstring val = NULL; + if (err == KErrNone && buf) + { + val = java::util::S60CommonUtils::NativeToJavaString(*aJni, *buf); + } + else + { + JniUtils::throwNewException(aJni, "com/nokia/mid/cenrep/CentralRepositoryException" , + JavaCommonUtils::intToString(err)); + } + + delete buf; + return val; +} + + +/* + * Class: com_nokia_mj_impl_cenrep_CentralRepositoryImpl + * Method: _getInt + * Signature: (IIJLcom/nokia/mj/impl/cenrep/CentralRepositoryImpl$IntValue;)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_cenrep_CentralRepositoryImpl__1getInt +(JNIEnv * aJni, jobject, jint aFunctionSourceHandle, jint aCenrepHandle, + jlong aKey) +{ + java::centrep::CentrepFunctionServer* mFunctionServer = + reinterpret_cast< java::centrep::CentrepFunctionServer*>( + aFunctionSourceHandle); + + CJavaCentralRepository* cenrep = + reinterpret_cast(aCenrepHandle); + + TInt val = 0; + TUint32 key = (TUint32)aKey; + + TRAPD(err, CallMethodL(val, cenrep, &CJavaCentralRepository::GetIntL, key, mFunctionServer)); + + if (err != KErrNone) + { + JniUtils::throwNewException(aJni, "com/nokia/mid/cenrep/CentralRepositoryException" , + JavaCommonUtils::intToString(err)); + } + return val; +} + +/** + * SetStringL + */ +void SetStringL(CJavaCentralRepository* aCenRep, TUint32 aKey, TDesC* aValue) +{ + aCenRep->SetL(aKey, *aValue); +} + +/* + * Class: com_nokia_mj_impl_cenrep_CentralRepositoryImpl + * Method: _setString + * Signature: (IIJLjava/lang/String;)I + */ +JNIEXPORT void JNICALL Java_com_nokia_mj_impl_cenrep_CentralRepositoryImpl__1setString +(JNIEnv *aJni, jobject, jint aFunctionSourceHandle, jint aCenrepHandle, + jlong aKey, jstring aValue) +{ + java::centrep::CentrepFunctionServer* mFunctionServer = + reinterpret_cast< java::centrep::CentrepFunctionServer*>( + aFunctionSourceHandle); + + CJavaCentralRepository* cenrep = + reinterpret_cast(aCenrepHandle); + + JStringUtils string(*aJni, aValue); + TUint32 key = (TUint32)aKey; + + TDesC* tstring = (TDesC*) &string; + TRAPD(err, CallMethodL(SetStringL, cenrep, key, tstring, mFunctionServer)); + + if (err != KErrNone) + { + JniUtils::throwNewException(aJni, "com/nokia/mid/cenrep/CentralRepositoryException" , + JavaCommonUtils::intToString(err)); + } +} + +/** + * SetIntL + */ +void SetIntL(CJavaCentralRepository* aCenRep, TUint32 aKey, TInt aValue) +{ + aCenRep->SetL(aKey, aValue); +} + +/* + * Class: com_nokia_mj_impl_cenrep_CentralRepositoryImpl + * Method: _setInt + * Signature: (IIJI)I + */ +JNIEXPORT void JNICALL Java_com_nokia_mj_impl_cenrep_CentralRepositoryImpl__1setInt +(JNIEnv *aJni, jobject, jint aFunctionSourceHandle, jint aCenrepHandle, + jlong aKey, jint aValue) +{ + java::centrep::CentrepFunctionServer* mFunctionServer = + reinterpret_cast< java::centrep::CentrepFunctionServer*>( + aFunctionSourceHandle); + + CJavaCentralRepository* cenrep = + reinterpret_cast(aCenrepHandle); + + TUint32 key = (TUint32)aKey; + TInt value = (TInt)aValue; + + TRAPD(err, CallMethodL(SetIntL, cenrep, key, value, mFunctionServer)); + if (err != KErrNone) + { + JniUtils::throwNewException(aJni, "com/nokia/mid/cenrep/CentralRepositoryException" , + JavaCommonUtils::intToString(err)); + } +} + + diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/comm/build/javacomm_0x2002DCA5.mmp --- a/javaextensions/comm/build/javacomm_0x2002DCA5.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/comm/build/javacomm_0x2002DCA5.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -105,7 +106,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/datagram/datagram/build/javadatagram_0x2002DCA9.mmp --- a/javaextensions/datagram/datagram/build/javadatagram_0x2002DCA9.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/datagram/datagram/build/javadatagram_0x2002DCA9.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -105,7 +106,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/datagram/serverconnection/build/javadatagramscplugin_0x2002DCAA.mmp --- a/javaextensions/datagram/serverconnection/build/javadatagramscplugin_0x2002DCAA.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/datagram/serverconnection/build/javadatagramscplugin_0x2002DCAA.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -103,7 +104,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/globalindicators/build/javaglobalindicators_0x2002DCAF.mmp --- a/javaextensions/globalindicators/build/javaglobalindicators_0x2002DCAF.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/globalindicators/build/javaglobalindicators_0x2002DCAF.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -101,7 +102,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/iapinfo/build/javaiapinfo_0x2002DCB3.mmp --- a/javaextensions/iapinfo/build/javaiapinfo_0x2002DCB3.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/iapinfo/build/javaiapinfo_0x2002DCB3.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -104,7 +105,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/javaextensions.pro --- a/javaextensions/javaextensions.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/javaextensions.pro Wed Sep 15 12:05:25 2010 +0300 @@ -23,6 +23,7 @@ SUBDIRS += location/build/javalocation.pro SUBDIRS += sensor/build/javasensor.pro SUBDIRS += broadcast_stub/build/javabroadcast.pro +SUBDIRS += centralrepository/build/javacentrep.pro SUBDIRS += midppush SUBDIRS += bluetooth SUBDIRS += datagram diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/location/build/javalocation_0x2002DCBC.mmp --- a/javaextensions/location/build/javalocation_0x2002DCBC.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/location/build/javalocation_0x2002DCBC.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -145,7 +146,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/midppush/build/javapushregistry_0x2002DCC9.mmp --- a/javaextensions/midppush/build/javapushregistry_0x2002DCC9.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/midppush/build/javapushregistry_0x2002DCC9.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -99,7 +100,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/midppush/pushcontroller/build/javapushcontroller_0x2002DCC8.mmp --- a/javaextensions/midppush/pushcontroller/build/javapushcontroller_0x2002DCC8.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/midppush/pushcontroller/build/javapushcontroller_0x2002DCC8.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -106,7 +107,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/midppush/pushregistryplugin/build/javacaptain_ext_pushregistryplugin_0x2002DCA2.mmp --- a/javaextensions/midppush/pushregistryplugin/build/javacaptain_ext_pushregistryplugin_0x2002DCA2.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/midppush/pushregistryplugin/build/javacaptain_ext_pushregistryplugin_0x2002DCA2.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -111,7 +112,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/midprms_db/build/javarms_0x2002DCCB.mmp --- a/javaextensions/midprms_db/build/javarms_0x2002DCCB.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/midprms_db/build/javarms_0x2002DCCB.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -96,7 +97,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RecordIdCache.java --- a/javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RecordIdCache.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RecordIdCache.java Wed Sep 15 12:05:25 2010 +0300 @@ -88,8 +88,8 @@ private void insertRecordId(int aRecordId) { int[] temp = new int[iRecordIds.length + 1]; - temp[0] = aRecordId; - System.arraycopy(iRecordIds, 0, temp, 1, iRecordIds.length); + temp[iRecordIds.length] = aRecordId; + System.arraycopy(iRecordIds, 0, temp, 0, iRecordIds.length); iRecordIds = temp; } diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/midprms_db/rmsplugin/build/javacaptain_ext_ondemand_2_0x2002DD01.mmp --- a/javaextensions/midprms_db/rmsplugin/build/javacaptain_ext_ondemand_2_0x2002DD01.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/midprms_db/rmsplugin/build/javacaptain_ext_ondemand_2_0x2002DD01.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -100,7 +101,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/midprms_db/tsrc/build/rmsintersuite.jad --- a/javaextensions/midprms_db/tsrc/build/rmsintersuite.jad Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/midprms_db/tsrc/build/rmsintersuite.jad Wed Sep 15 12:05:25 2010 +0300 @@ -4,6 +4,6 @@ MicroEdition-Profile: MIDP-2.0 MIDlet-1: InterSuite,,j2meunitomj.MIDletTestRunner MIDlet-Name: InterSuite -MIDlet-Jar-Size: 69754 +MIDlet-Jar-Size: 70421 MIDlet-Jar-URL: rmsintersuite.jar J2MEUnitTestClasses: com.nokia.mj.test.rms.TestInterSuiteAccess diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/midprms_db/tsrc/build/rmssharedtests.jad --- a/javaextensions/midprms_db/tsrc/build/rmssharedtests.jad Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/midprms_db/tsrc/build/rmssharedtests.jad Wed Sep 15 12:05:25 2010 +0300 @@ -4,6 +4,6 @@ MicroEdition-Profile: MIDP-2.0 MIDlet-1: SharedStore,,j2meunitomj.MIDletTestRunner MIDlet-Name: SharedStore -MIDlet-Jar-Size: 69757 +MIDlet-Jar-Size: 70423 MIDlet-Jar-URL: rmssharedtests.jar J2MEUnitTestClasses: com.nokia.mj.test.rms.CreateSharedStore diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/midprms_db/tsrc/build/rmstests.jad --- a/javaextensions/midprms_db/tsrc/build/rmstests.jad Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/midprms_db/tsrc/build/rmstests.jad Wed Sep 15 12:05:25 2010 +0300 @@ -4,7 +4,7 @@ MicroEdition-Profile: MIDP-2.0 MIDlet-1: RmsUnitTests,,j2meunitomj.MIDletTestRunner MIDlet-Name: RmsUnitTests -MIDlet-Jar-Size: 69757 +MIDlet-Jar-Size: 70423 MIDlet-Jar-URL: rmstests.jar J2MEUnitTestClasses: com.nokia.mj.test.rms.AllTests diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/midprms_db/tsrc/javasrc/com/nokia/mj/test/rms/TestRecordEnumeration.java --- a/javaextensions/midprms_db/tsrc/javasrc/com/nokia/mj/test/rms/TestRecordEnumeration.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/midprms_db/tsrc/javasrc/com/nokia/mj/test/rms/TestRecordEnumeration.java Wed Sep 15 12:05:25 2010 +0300 @@ -139,6 +139,14 @@ } })); + aSuite.addTest(new TestRecordEnumeration("testEnumerationOrder", new TestMethod() + { + public void run(TestCase tc) + { + ((TestRecordEnumeration) tc).testEnumerationOrder(); + } + })); + return aSuite; } @@ -1147,5 +1155,56 @@ } } + public void testEnumerationOrder() + { + // This test checks that record enumeration returns records in FIFO order + // if null RecordComparator is provided + // MIDP spec says that order is undefined in this case but many acceptance tests + // assume this order + System.out.println("TestRecordEnumeration.testEnumerationOrder()"); + RecordStore store = null; + String rec_store_name = "testEnumerationOrder"; + + try + { + // 0: Init + System.out.println("0: Init"); + try + { + RecordStore.deleteRecordStore(rec_store_name); + } + catch (Exception e) {} + store = RecordStore.openRecordStore(rec_store_name, true); + populateRecordStore(store); + + // 1: check order + System.out.println("1: check order"); + RecordEnumeration enumeration = store.enumerateRecords(null, null, false); + for(int i = 0; enumeration.hasNextElement(); i++) + { + byte[] r = enumeration.nextRecord(); + assertEquals(r, iData[i].getBytes()); + } + } + catch (Exception e) + { + e.printStackTrace(); + fail("Unexpected exception " + e); + } + finally + { + try + { + store.closeRecordStore(); + } + catch (Exception e) {} + try + { + RecordStore.deleteRecordStore(rec_store_name); + } + catch (Exception e) {} + } + } + } diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/mobinfo/build/javamobinfo_0x2002DCC3.mmp --- a/javaextensions/mobinfo/build/javamobinfo_0x2002DCC3.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/mobinfo/build/javamobinfo_0x2002DCC3.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -103,7 +104,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/agnadapter/inc.s60/cpimagnlistadapter.h --- a/javaextensions/pim/agnadapter/inc.s60/cpimagnlistadapter.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/agnadapter/inc.s60/cpimagnlistadapter.h Wed Sep 15 12:05:25 2010 +0300 @@ -225,7 +225,8 @@ GetExternalItemModificationsByEntryTypeL( CCalEntry::TType aEntryType); - void DoExternalItemModificationsByEntryTypeL(CCalEntry::TType aEntryType); + void CPIMAgnListAdapter::DoExternalItemModificationsByEntryTypeL( + CCalEntry::TType aEntryType); /** * Fetches a CAgnEntry from the native Agenda Model. @@ -267,7 +268,8 @@ * * @param aEntryType Entry type for change callbacks (ToDo/Event/all). */ - void ConstructL(MCalChangeCallBack::TChangeEntryType aEntryType); + void ConstructL(MCalChangeCallBack::TChangeEntryType aEntryType, + CCalSession* aCalSession); void DoClose(); diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/agnadapter/inc.s60/cpimeventadapteraccess.h --- a/javaextensions/pim/agnadapter/inc.s60/cpimeventadapteraccess.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/agnadapter/inc.s60/cpimeventadapteraccess.h Wed Sep 15 12:05:25 2010 +0300 @@ -73,13 +73,17 @@ MPIMLocalizationData** aRetLocalizationData); TBool OpenEventListL( - const TDesC* aListName, + CCalSession* aCalSession, + + const TDesC* aCalNameArg, MPIMEventAdapterManager** aRetAdapterManager, MPIMEventListAdapter** aRetListAdapter, MPIMLocalizationData** aRetLocalizationData); TBool OpenToDoListL( - const TDesC* aListName, + CCalSession* aCalSession, + + const TDesC* aCalNameArg, MPIMToDoAdapterManager** aRetAdapterManager, MPIMToDoListAdapter** aRetListAdapter, MPIMLocalizationData** aRetLocalizationData); diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/agnadapter/inc.s60/cpimeventlistadapter.h --- a/javaextensions/pim/agnadapter/inc.s60/cpimeventlistadapter.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/agnadapter/inc.s60/cpimeventlistadapter.h Wed Sep 15 12:05:25 2010 +0300 @@ -27,6 +27,7 @@ // FORWARD DECLARATIONS class MPIMEventItem; class CPIMAgnEventAdapter; +class CCalSession; // CLASS DECLARATION @@ -47,7 +48,8 @@ static CPIMEventListAdapter* NewL( CCalEntry::TType aEntryType, CPIMAgnEventAdapter* aEventAdapter, - java::util::FunctionServer* aFuncServer); + java::util::FunctionServer* aFuncServer, + CCalSession *aCalSession); /** * Destructor. @@ -137,7 +139,8 @@ */ void CreateEventItemL(MPIMEventItem& aEventItem); - void DoCreateEventItemL(MPIMEventItem& aEventItem); + void CPIMEventListAdapter::DoCreateEventItemL( + MPIMEventItem& aEventItem); /** * Reads an existing event item from the Agenda File. @@ -162,7 +165,8 @@ */ void ReadEventItemL(MPIMEventItem& aEventItem); - void DoReadEventItemL(MPIMEventItem& aEventItem); + void CPIMEventListAdapter::DoReadEventItemL( + MPIMEventItem& aEventItem); /** * Writes an existing event item to the native Agenda File. @@ -188,7 +192,8 @@ */ void WriteEventItemL(MPIMEventItem& aEventItem); - void DoWriteEventItemL(MPIMEventItem& aEventItem); + void CPIMEventListAdapter::DoWriteEventItemL( + MPIMEventItem& aEventItem); /** * Removes an existing event from the native Agenda File. @@ -208,7 +213,8 @@ */ void RemoveEventItemL(TPIMItemID aItemID); - void DoRemoveEventItemL(TPIMItemID aItemID); + void CPIMEventListAdapter::DoRemoveEventItemL( + TPIMItemID aItemID); protected: @@ -222,7 +228,9 @@ */ void ConstructL( CCalEntry::TType aEntryType, - CPIMAgnEventAdapter* aEventAdapter); + + CPIMAgnEventAdapter* aEventAdapter, + TInt aCalSessionInt); private: // Member data diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/agnadapter/inc.s60/cpimtodoadapteraccess.h --- a/javaextensions/pim/agnadapter/inc.s60/cpimtodoadapteraccess.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/agnadapter/inc.s60/cpimtodoadapteraccess.h Wed Sep 15 12:05:25 2010 +0300 @@ -67,13 +67,17 @@ MPIMLocalizationData** aRetLocalizationData); TBool OpenEventListL( - const TDesC* aListName, + CCalSession* aCalSession, + + const TDesC* aCalNameArg, MPIMEventAdapterManager** aRetAdapterManager, MPIMEventListAdapter** aRetListAdapter, MPIMLocalizationData** aRetLocalizationData); TBool OpenToDoListL( - const TDesC* aListName, + CCalSession* aCalSession, + + const TDesC* aCalNameArg, MPIMToDoAdapterManager** aRetAdapterManager, MPIMToDoListAdapter** aRetListAdapter, MPIMLocalizationData** aRetLocalizationData); diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/agnadapter/inc.s60/cpimtodolistadapter.h --- a/javaextensions/pim/agnadapter/inc.s60/cpimtodolistadapter.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/agnadapter/inc.s60/cpimtodolistadapter.h Wed Sep 15 12:05:25 2010 +0300 @@ -44,7 +44,8 @@ /** * Two-phased constructor. */ - static CPIMToDoListAdapter* NewL(java::util::FunctionServer* aFuncServer); + static CPIMToDoListAdapter* NewL(java::util::FunctionServer* aFuncServer, + CCalSession *aCalSession); /** * Destructor. @@ -134,7 +135,8 @@ */ void CreateToDoItemL(MPIMToDoItem& aToDoItem); - void DoCreateToDoItemL(MPIMToDoItem& aToDoItem); + void CPIMToDoListAdapter::DoCreateToDoItemL( + MPIMToDoItem& aToDoItem); /** * Reads an existing To-Do item from the Agenda File. @@ -159,7 +161,8 @@ */ void ReadToDoItemL(MPIMToDoItem& aToDoItem); - void DoReadToDoItemL(MPIMToDoItem& aToDoItem); + void CPIMToDoListAdapter::DoReadToDoItemL( + MPIMToDoItem& aToDoItem); /** * Writes an existing To-Do item to the native Agenda File. @@ -185,7 +188,8 @@ */ void WriteToDoItemL(MPIMToDoItem& aToDoItem); - void DoWriteToDoItemL(MPIMToDoItem& aToDoItem); + void CPIMToDoListAdapter::DoWriteToDoItemL( + MPIMToDoItem& aToDoItem); /** * Removes an existing To-Do from the native Agenda File. @@ -205,7 +209,8 @@ */ void RemoveToDoItemL(TPIMItemID aItemID); - void DoRemoveToDoItemL(TPIMItemID aItemID); + void CPIMToDoListAdapter::DoRemoveToDoItemL( + TPIMItemID aItemID); protected: @@ -217,7 +222,7 @@ /** * By default Symbian 2nd phase constructor is private. */ - void ConstructL(); + void ConstructL(TInt aCalSessionInt); private: // Member data diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/agnadapter/src.s60/cpimagnapptadapter.cpp --- a/javaextensions/pim/agnadapter/src.s60/cpimagnapptadapter.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/agnadapter/src.s60/cpimagnapptadapter.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -46,6 +46,7 @@ CPIMAgnApptAdapter* self = new(ELeave) CPIMAgnApptAdapter(aFuncServer); CleanupStack::PushL(self); CallMethodL(self, &CPIMAgnApptAdapter::ConstructL, self->iFuncServer); + CleanupStack::Pop(self); return self; } diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/agnadapter/src.s60/cpimagnlistadapter.cpp --- a/javaextensions/pim/agnadapter/src.s60/cpimagnlistadapter.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/agnadapter/src.s60/cpimagnlistadapter.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -19,7 +19,7 @@ // INCLUDE FILES #include "cpimagnlistadapter.h" #include "mpimitemdata.h" -#include "javasymbianoslayer.h" +#include "cleanupresetanddestroy.h" #include "cpimagnserverwait.h" #include "logger.h" @@ -54,12 +54,14 @@ // ----------------------------------------------------------------------------- // void CPIMAgnListAdapter::ConstructL( - MCalChangeCallBack::TChangeEntryType aEntryType) + + MCalChangeCallBack::TChangeEntryType aEntryType, + CCalSession* aCalSession) { JELOG2(EPim); + iServerWait = CPIMAgnServerWait::NewL(); - iCalSession = CCalSession::NewL(); - iCalSession->OpenL(iCalSession->DefaultFileNameL()); + iCalSession = aCalSession; iCalEntryView = CCalEntryView::NewL(*iCalSession, *iServerWait); iServerWait->WaitCompleteL(KServerMaxWait); @@ -285,10 +287,9 @@ void CPIMAgnListAdapter::CloseAgendaSession() { JELOG2(EPim); + iCalSession->StopChangeNotification(); delete iCalEntryView; iCalEntryView = NULL; - - delete iCalSession; iCalSession = NULL; iChangesRead = ETrue; diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/agnadapter/src.s60/cpimeventadapteraccess.cpp --- a/javaextensions/pim/agnadapter/src.s60/cpimeventadapteraccess.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/agnadapter/src.s60/cpimeventadapteraccess.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -139,7 +139,8 @@ return EFalse; } -TBool CPIMEventAdapterAccess::OpenEventListL(const TDesC* aListName, +TBool CPIMEventAdapterAccess::OpenEventListL(CCalSession* aCalSession, + const TDesC* aListName, MPIMEventAdapterManager** aRetAdapterManager, MPIMEventListAdapter** aRetListAdapter, MPIMLocalizationData** aRetLocalizationData) @@ -181,8 +182,8 @@ CPIMAgnApptAdapter* adapter = CPIMAgnApptAdapter::NewL(iFuncServer); CleanupStack::PushL(adapter); - listAdapter = CPIMEventListAdapter::NewL(CCalEntry::EAppt, adapter, - iFuncServer); + listAdapter = CPIMEventListAdapter::NewL(CCalEntry::EAppt,adapter, + iFuncServer, aCalSession); CleanupStack::Pop(adapter); CleanupStack::Pop(adapterManager); @@ -200,8 +201,8 @@ CPIMAgnMemoAdapter* adapter = CPIMAgnMemoAdapter::NewL(iFuncServer); CleanupStack::PushL(adapter); - listAdapter = CPIMEventListAdapter::NewL(CCalEntry::EEvent, adapter, - iFuncServer); + listAdapter = CPIMEventListAdapter::NewL(CCalEntry::EEvent,adapter, + iFuncServer, aCalSession); CleanupStack::Pop(adapter); CleanupStack::Pop(adapterManager); @@ -219,8 +220,8 @@ CPIMAgnAnnivAdapter* adapter = CPIMAgnAnnivAdapter::NewL(iFuncServer); CleanupStack::PushL(adapter); - listAdapter = CPIMEventListAdapter::NewL(CCalEntry::EAnniv, adapter, - iFuncServer); + listAdapter = CPIMEventListAdapter::NewL(CCalEntry::EAnniv,adapter, + iFuncServer, aCalSession); CleanupStack::Pop(adapter); CleanupStack::Pop(adapterManager); @@ -244,9 +245,11 @@ return ETrue; } -TBool CPIMEventAdapterAccess::OpenToDoListL(const TDesC* /*aListName*/, +TBool CPIMEventAdapterAccess::OpenToDoListL(CCalSession* /*aCalSession*/, + const TDesC* /*aListName*/, MPIMToDoAdapterManager** /*aRetAdapterManager*/, - MPIMToDoListAdapter** /*aRetListAdapter*/, MPIMLocalizationData** /*aRetLocalizationData*/) + MPIMToDoListAdapter** /*aRetListAdapter*/, + MPIMLocalizationData** /*aRetLocalizationData*/) { JELOG2(EPim); // no ToDo lists diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/agnadapter/src.s60/cpimeventlistadapter.cpp --- a/javaextensions/pim/agnadapter/src.s60/cpimeventlistadapter.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/agnadapter/src.s60/cpimeventlistadapter.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -49,10 +49,13 @@ // ----------------------------------------------------------------------------- // void CPIMEventListAdapter::ConstructL(CCalEntry::TType aEntryType, - CPIMAgnEventAdapter* aEventAdapter) + + CPIMAgnEventAdapter* aEventAdapter, + TInt aCalSessionInt) { JELOG2(EPim); - CPIMAgnListAdapter::ConstructL(MCalChangeCallBack::EChangeEntryEvent); + CCalSession* calSession = reinterpret_cast (aCalSessionInt); + CPIMAgnListAdapter::ConstructL(MCalChangeCallBack::EChangeEntryEvent, calSession); iEntryType = aEntryType; iAgnAdapter = aEventAdapter; } @@ -63,13 +66,17 @@ // ----------------------------------------------------------------------------- // CPIMEventListAdapter* CPIMEventListAdapter::NewL(CCalEntry::TType aEntryType, - CPIMAgnEventAdapter* aEventAdapter, java::util::FunctionServer* aFuncServer) + CPIMAgnEventAdapter* aEventAdapter, + java::util::FunctionServer* aFuncServer, CCalSession *aCalSession + ) { JELOG2(EPim); CPIMEventListAdapter* self = new(ELeave) CPIMEventListAdapter(aFuncServer); CleanupStack::PushL(self); + TInt calSessionInt = reinterpret_cast (aCalSession); CallMethodL(self, &CPIMEventListAdapter::ConstructL, aEntryType, - aEventAdapter, self->iFuncServer); + aEventAdapter, calSessionInt,self->iFuncServer); + CleanupStack::Pop(self); return self; } diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/agnadapter/src.s60/cpimtodoadapteraccess.cpp --- a/javaextensions/pim/agnadapter/src.s60/cpimtodoadapteraccess.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/agnadapter/src.s60/cpimtodoadapteraccess.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -106,16 +106,20 @@ return EFalse; } -TBool CPIMToDoAdapterAccess::OpenEventListL(const TDesC* /*aListName*/, +TBool CPIMToDoAdapterAccess::OpenEventListL(CCalSession* /*aCalSession*/, + const TDesC* /*aListName*/, MPIMEventAdapterManager** /*aRetAdapterManager*/, - MPIMEventListAdapter** /*aRetListAdapter*/, MPIMLocalizationData** /*aRetLocalizationData*/) + MPIMEventListAdapter** /*aRetListAdapter*/, + MPIMLocalizationData** /*aRetLocalizationData*/ + ) { JELOG2(EPim); // no Event lists return EFalse; } -TBool CPIMToDoAdapterAccess::OpenToDoListL(const TDesC* aListName, +TBool CPIMToDoAdapterAccess::OpenToDoListL(CCalSession* aCalSession, + const TDesC* aListName, MPIMToDoAdapterManager** aRetAdapterManager, MPIMToDoListAdapter** aRetListAdapter, MPIMLocalizationData** aRetLocalizationData) @@ -136,7 +140,7 @@ (*iToDoListNames)[0]); CleanupDeletePushL(adapterManager); - MPIMToDoListAdapter* listAdapter = CPIMToDoListAdapter::NewL(iFuncServer); + MPIMToDoListAdapter* listAdapter = CPIMToDoListAdapter::NewL(iFuncServer, aCalSession); CleanupStack::Pop(adapterManager); MPIMLocalizationData* localizationData = iToDoLocalizationData; diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/agnadapter/src.s60/cpimtodolistadapter.cpp --- a/javaextensions/pim/agnadapter/src.s60/cpimtodolistadapter.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/agnadapter/src.s60/cpimtodolistadapter.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -49,10 +49,11 @@ // Symbian 2nd phase constructor can leave. // ----------------------------------------------------------------------------- // -void CPIMToDoListAdapter::ConstructL() +void CPIMToDoListAdapter::ConstructL(TInt aCalSessionInt) { JELOG2(EPim); - CPIMAgnListAdapter::ConstructL(MCalChangeCallBack::EChangeEntryTodo); + CCalSession* calSession = reinterpret_cast (aCalSessionInt); + CPIMAgnListAdapter::ConstructL(MCalChangeCallBack::EChangeEntryTodo, calSession); iAgnToDoAdapter = CPIMAgnToDoAdapter::NewL(iFuncServer); } @@ -61,13 +62,14 @@ // Two-phased constructor. // ----------------------------------------------------------------------------- // -CPIMToDoListAdapter* CPIMToDoListAdapter::NewL( - java::util::FunctionServer* aFuncServer) +CPIMToDoListAdapter* CPIMToDoListAdapter::NewL(java::util::FunctionServer* aFuncServer, + CCalSession *aCalSession) { JELOG2(EPim); CPIMToDoListAdapter* self = new(ELeave) CPIMToDoListAdapter(aFuncServer); CleanupStack::PushL(self); - CallMethodL(self, &CPIMToDoListAdapter::ConstructL, self->iFuncServer); + TInt calSessionInt = reinterpret_cast (aCalSession); + CallMethodL(self, &CPIMToDoListAdapter::ConstructL,calSessionInt,self->iFuncServer); CleanupStack::Pop(self); return self; } diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/build/build.xml --- a/javaextensions/pim/build/build.xml Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/build/build.xml Wed Sep 15 12:05:25 2010 +0300 @@ -39,6 +39,7 @@ + com.nokia.mid.calendars=:pim.DynamicPropertyHandler microedition.pim.version=1.0 diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/build/javapim.pro --- a/javaextensions/pim/build/javapim.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/build/javapim.pro Wed Sep 15 12:05:25 2010 +0300 @@ -44,21 +44,21 @@ LIBS += -lbafl \ - -lBitmapTransforms \ + -lbitmaptransforms \ -lcaleninterimutils2 \ -lcalinterimapi \ -lcntmodel \ -lefsrv \ -lestor \ -lfbscli \ - -lImageConversion \ + -limageconversion \ -ltzclient \ -lvcal \ -lversit \ -lvcard \ -lefsrv \ - -lcommonengine \ - -lPlatformEnv + -lCommonEngine \ + -lplatformenv # Resource files diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/build/javapim_0x2002DCC5.mmp --- a/javaextensions/pim/build/javapim_0x2002DCC5.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/build/javapim_0x2002DCC5.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -171,20 +172,20 @@ LIBRARY bafl.lib -LIBRARY BitmapTransforms.lib +LIBRARY bitmaptransforms.lib LIBRARY caleninterimutils2.lib LIBRARY calinterimapi.lib LIBRARY cntmodel.lib LIBRARY efsrv.lib LIBRARY estor.lib LIBRARY fbscli.lib -LIBRARY ImageConversion.lib +LIBRARY imageconversion.lib LIBRARY tzclient.lib LIBRARY vcal.lib LIBRARY versit.lib LIBRARY vcard.lib -LIBRARY commonengine.lib -LIBRARY PlatformEnv.lib +LIBRARY CommonEngine.lib +LIBRARY platformenv.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib @@ -214,7 +215,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/cntadapter/inc.s60/cpimcmadapteraccess.h --- a/javaextensions/pim/cntadapter/inc.s60/cpimcmadapteraccess.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/cntadapter/inc.s60/cpimcmadapteraccess.h Wed Sep 15 12:05:25 2010 +0300 @@ -26,6 +26,7 @@ // FORWARD DECLARATIONS class MPIMLocalizationManager; class MPIMLocalizationData; +class CCalSession; // CLASS DECLARATION /** @@ -63,12 +64,14 @@ MPIMLocalizationData** aRetLocalizationData); TBool OpenEventListL( + CCalSession* aCalSession, const TDesC* aListName, MPIMEventAdapterManager** aRetAdapterManager, MPIMEventListAdapter** aRetListAdapter, MPIMLocalizationData** aRetLocalizationData); TBool OpenToDoListL( + CCalSession* aCalSession, const TDesC* aListName, MPIMToDoAdapterManager** aRetAdapterManager, MPIMToDoListAdapter** aRetListAdapter, diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/cntadapter/inc.s60/cpimcontactlistadapter.h --- a/javaextensions/pim/cntadapter/inc.s60/cpimcontactlistadapter.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/cntadapter/inc.s60/cpimcontactlistadapter.h Wed Sep 15 12:05:25 2010 +0300 @@ -195,7 +195,7 @@ */ void Close(); - void DoClose(); + void CPIMContactListAdapter::DoClose(); public: // MPIMContactListAdapter @@ -223,7 +223,8 @@ */ void CreateContactItemL(MPIMContactItem& aContactItem); - void DoCreateContactItemL(MPIMContactItem& aContactItem); + void CPIMContactListAdapter::DoCreateContactItemL( + MPIMContactItem& aContactItem); /** * Reads an existing contact item from the native database. @@ -248,7 +249,8 @@ */ void ReadContactItemL(MPIMContactItem& aContactItem); - void DoCallReadContactItemL(MPIMContactItem& aContactItem); + void CPIMContactListAdapter::DoCallReadContactItemL( + MPIMContactItem& aContactItem); /** * Reads an existing contact item from the native database @@ -269,9 +271,11 @@ * native database. * @li Other - The list adapter is non-functional. */ - void ReadMinimalContactItemL(MPIMContactItem& aContactItem); + void ReadMinimalContactItemL( + MPIMContactItem& aContactItem); - void DoCallReadMinimalContactItemL(MPIMContactItem& aContactItem); + void CPIMContactListAdapter::DoCallReadMinimalContactItemL( + MPIMContactItem& aContactItem); /** * Reads an existing contact item from the native database @@ -311,7 +315,7 @@ void ReadContactFieldL(MPIMContactItem& aContactItem, TPIMContactField aContactField); - void DoReadContactFieldL( + void CPIMContactListAdapter::DoReadContactFieldL( MPIMContactItem& aContactItem, TPIMContactField aContactField); @@ -339,7 +343,8 @@ */ void WriteContactItemL(MPIMContactItem& aContactItem); - void DoWriteContactItemL(MPIMContactItem& aContactItem); + void CPIMContactListAdapter::DoWriteContactItemL( + MPIMContactItem& aContactItem); /** * Removes an existing contact from the native database. @@ -410,7 +415,7 @@ * @param aContactItemViewDef View definition which is used for * reading the contact item from the database */ - void DoReadContactItemL( + void CPIMContactListAdapter::DoReadContactItemL( MPIMContactItem& aContactItem, const CContactItemViewDef& aContactItemViewDef); diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/cntadapter/src.s60/cpimcmadapteraccess.cpp --- a/javaextensions/pim/cntadapter/src.s60/cpimcmadapteraccess.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/cntadapter/src.s60/cpimcmadapteraccess.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -75,16 +75,16 @@ return ETrue; } -TBool CPIMCMAdapterAccess::OpenEventListL(const TDesC* /*aListName*/, +TBool CPIMCMAdapterAccess::OpenEventListL(CCalSession* /*aCalSession*/, const TDesC* /*aListName*/, MPIMEventAdapterManager** /*aRetAdapterManager*/, - MPIMEventListAdapter** /*aRetListAdapter*/, MPIMLocalizationData** /*aRetLocalizationData */) + MPIMEventListAdapter** /*aRetListAdapter*/, MPIMLocalizationData** /*aRetLocalizationData*/) { JELOG2(EPim); // no Event lists return EFalse; } -TBool CPIMCMAdapterAccess::OpenToDoListL(const TDesC* /*aListName*/, +TBool CPIMCMAdapterAccess::OpenToDoListL(CCalSession* /*aCalSession*/, const TDesC* /*aListName*/, MPIMToDoAdapterManager** /*aRetAdapterManager*/, MPIMToDoListAdapter** /*aRetListAdapter*/, MPIMLocalizationData** /*aRetLocalizationData */) { diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/cntadapter/src.s60/cpimcontactitemadapter.cpp --- a/javaextensions/pim/cntadapter/src.s60/cpimcontactitemadapter.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/cntadapter/src.s60/cpimcontactitemadapter.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -193,12 +193,12 @@ JELOG2(EPim); const CDesCArray& pimCategories = aItem.ItemData().Categories(); const TInt pimCategoryCount = pimCategories.Count(); - CArrayFix* newCategoryTable = new(ELeave) CArrayFixFlat (pimCategoryCount); - CleanupStack::PushL(newCategoryTable); + TBool* newCategoryTable = new(ELeave) TBool[pimCategoryCount]; + CleanupArrayDeletePushL(newCategoryTable); TInt i = 0; for (i = 0; i < pimCategoryCount; i++) { - newCategoryTable->InsertL(TRUE,i); + newCategoryTable[i] = ETrue; } CContactIdArray* cardCategories = aCard.GroupsJoinedLC(); @@ -220,14 +220,14 @@ } else { - // old group - newCategoryTable->InsertL(FALSE,pos); + // old group + newCategoryTable[pos] = EFalse; } } // then add new categories for (i = 0; i < pimCategoryCount; i++) { - if (newCategoryTable->At(i)) + if (newCategoryTable[i]) { TPtrC category = pimCategories[i]; iCategoryManager.AddToGroupL(id, category); diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/cntadapter/src.s60/cpimcontactlistadapter.cpp --- a/javaextensions/pim/cntadapter/src.s60/cpimcontactlistadapter.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/cntadapter/src.s60/cpimcontactlistadapter.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -809,8 +809,7 @@ EPIMPanicInvalidItemID)); // Read contact item using the item view definition CContactCard* contactItem = - static_cast(iDatabase->ReadContactLC(id, - aContactItemViewDef)); + static_cast(iDatabase->ReadContactLC(id,aContactItemViewDef)); // Set date and fill the PIM item TTime lastModified = contactItem->LastModified(); aContactItem.SetLastModifiedL(lastModified); diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/common/inc.s60/mpimadapteraccess.h --- a/javaextensions/pim/common/inc.s60/mpimadapteraccess.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/common/inc.s60/mpimadapteraccess.h Wed Sep 15 12:05:25 2010 +0300 @@ -31,6 +31,7 @@ class MPIMToDoAdapterManager; class MPIMToDoListAdapter; class MPIMLocalizationData; +class CCalSession; // CLASS DECLARATION @@ -129,7 +130,9 @@ * @li \c KErrNotFound - The native database does not exist any more. * @li Other - The system is non-functional. */ - virtual TBool OpenEventListL(const TDesC* aListName, + virtual TBool OpenEventListL(CCalSession* aCalSession, + const TDesC* aListName, + //const TDesC* aCalNameArg, MPIMEventAdapterManager** aRetAdapterManager, MPIMEventListAdapter** aRetListAdapter, MPIMLocalizationData** aRetLocalizationData) = 0; @@ -163,7 +166,9 @@ * @li \c KErrNotFound - The native database does not exist any more. * @li Other - The system is non-functional. */ - virtual TBool OpenToDoListL(const TDesC* aListName, + virtual TBool OpenToDoListL(CCalSession* aCalSession, + const TDesC* aListName, + //const TDesC* aCalNameArg, MPIMToDoAdapterManager** aRetAdapterManager, MPIMToDoListAdapter** aRetListAdapter, MPIMLocalizationData** aRetLocalizationData) = 0; diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/framework/inc.s60/cleanupresetanddestroy.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/pim/framework/inc.s60/cleanupresetanddestroy.h Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,114 @@ +/* +* 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: Cleanup Stack "reset and destroy" push operation. + * +*/ + + +#ifndef CLEANUPRESETANDDESTROY_H +#define CLEANUPRESETANDDESTROY_H + +// INCLUDE FILES +#include + +/** + * An operation for pushing objects to cleanup stack with \c TCleanupItems + * that will perform a \c ResetAndDestroy() operation on the pushed object + * if a leave occurs. + * + * Note that the object itself will not be deleted. + * + * @par Example: + * Here is an example of using \c CleanupResetAndDestroy with a dynamically + * allocated \c RPointerArray. \c RPointerArray clears its contents with a + * \cResetAndDestroy() operation. + * @code + * + * // A function which creates a pointer array with couple of initialized + * // CThings. The function must return a pointer to the pointer array, + * // because the array has to be allocated dynamically. CThing is some + * // simple CBase-derived class. + * + * RPointerArray< CThing >* CreateThingArrayL( ) + * { + * // Create an array of pointers to CThings with granularity of 4 + * + * RPointerArray< CThing >* things = + * new( ELeave ) RPointerArray< CThing >( 4 ); + * + * // Push pointer to the array to the cleanup stack; then push reference + * // to the array and a ResetAndDestroy operation to the cleanup stack. + * + * // (Note that order of these operations matters: the ResetAndDestroy + * // operation must be performed before the array itself is deleted.) + * + * CleanupStack::PushL( things ); + * CleanupResetAndDestroyPushL( *things ); + * + * // Add couple of CThings with magic numbers to the array. + * // If any of the NewL() operations leaves, the array will be cleared + * // with ResetAndDestroy() and the array itself will destroyed. + * + * User::LeaveIfError( things->Append( CThing::NewL( 7 ) ) ); + * User::LeaveIfError( things->Append( CThing::NewL( 96 ) ) ); + * User::LeaveIfError( things->Append( CThing::NewL( 999 ) ) ); + * + * // Pop the array reference with ResetAndDestroy from cleanup stack + * // then pop the pointer to the array itself. + * + * CleanupStack::Pop(); // *things + * CleanupStack::Pop(); // things + * + * // Now we're ready to return the results (a pointer to the array) + * return things; + * } + * + * @endcode + */ +template +inline void CleanupResetAndDestroyPushL(T& aRef); + +/** + * See \ref CleanupResetAndDestroyPushL() documentation. + */ +template +class CleanupResetAndDestroy +{ +public: + inline static void PushL(T& aRef); + +private: + static void ResetAndDestroy(TAny *aPtr); +}; + +template +inline void CleanupResetAndDestroy::PushL(T& aRef) +{ + CleanupStack::PushL(TCleanupItem(&ResetAndDestroy, &aRef)); +} + +template +void CleanupResetAndDestroy::ResetAndDestroy(TAny *aPtr) +{ + static_cast(aPtr)->ResetAndDestroy(); +} + +template +inline void CleanupResetAndDestroyPushL(T& aRef) +{ + CleanupResetAndDestroy::PushL(aRef); +} + +#endif // CLEANUPRESETANDDESTROY_H +// End of File diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/framework/inc.s60/cpimmanager.h --- a/javaextensions/pim/framework/inc.s60/cpimmanager.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/framework/inc.s60/cpimmanager.h Wed Sep 15 12:05:25 2010 +0300 @@ -43,6 +43,7 @@ class CPIMEventValidator; class CPIMToDoValidator; class MPIMAdapterAccess; +class CCalSession; // CLASS DECLARATION @@ -77,6 +78,7 @@ * Destructor. */ virtual ~CPIMManager(); + void DeleteSessions(); public: // New functions @@ -113,6 +115,8 @@ * @param aPimListName Name of the list. The name must be valid list * name. If not present, name is resolved to the default list * of the given type. + * @param aCalName Name of the Canlendar. The name must be valid Canlendar + * name. If not present, name is resolved to the default Canlendar. * * @return PIM list. Type of the list corresponds to * \a aPimListType argument. @@ -130,6 +134,7 @@ pimbaselist* openPimList( const TPIMListType& aPimListType, jstring aPimListName, + jstring aCalName, JNIEnv* aJniEnv); /** @@ -149,6 +154,48 @@ const TPIMListType& aPimListType, jintArray aError, JNIEnv* aJniEnv); + /** + * Lists list of Calendars existsing the mobile database. + * + * @return Array of list names. + * Caller takes the ownership of the returned object. + * + */ + jobjectArray listCalendars(jintArray aError, JNIEnv* aJniEnv); + + /** + * Lists list of Calendars names existsing the mobile database. + * + * @return Array of list names. + * Caller takes the ownership of the returned object. + */ + jobjectArray listCalendarNames(jintArray aError, JNIEnv* aJniEnv); + + /** + * create new calendar which you given name. + * + * @param calendar name Sting type this is used as filename. + * + * @param calendar name Sting type this is used as diaplay to the user. + * + * @return void. + * + * @par Leaving: + * @li \c KErrArgument - \if name already exists + */ + void createCalendar(jstring aCalName, jstring aDisplayName, JNIEnv* aJniEnv); + + /** + * delete the calendar which you given name. + * + * @param calendar name Sting type this is used as canlader filename + * which it will delete. + * @return void. + * + * @par Leaving: + * @li \c KErrArgument - \a calendar name is not valid or not exists. + */ + void deleteCalendar(jstring aCalName, JNIEnv* aJniEnv); /** * Provides a Contact validator. @@ -187,28 +234,102 @@ * @return A new list or NULL if no matching list was found. */ CPIMEventList* DoOpenEventListL( - const TDesC* aListName); + const TDesC* aListName, const TDesC* aCalName); /** * Opens a to-do list. * * @param aListName Name of the list or NULL to indicate * default list. - * - * @return A new list or NULL if no matching list was found. + * @param aCalName Name of the calendar or NULL to indicate + * default calendar. + * @return A new list or NULL if no matching list and calendar was found. */ - CPIMToDoList* DoOpenToDoListL( - const TDesC* aListName); + CPIMToDoList* DoOpenToDoListL(const TDesC* aListName, const TDesC* aCalName); + - CDesCArray* DoListPimListsL( + /** + * Opens a to-do list. + * + * @param aPimListType Name of the list or NULL to indicate + * default list. + * @return A new list or NULL if no matching list and calendar was found. + */ + CDesCArray* CPIMManager::DoListPimListsL( const TPIMListType& aPimListType); - pimbaselist* DoOpenPimListL( + /** + * list all the calendars this function will call by ListCalendars function + * + * @return void. + */ + void CPIMManager::DoListCalendarsL(); + + /** + * list all the calendars names this function will call by ListCalendatNames function + * + * @return void. + */ + void CPIMManager::DoListCalendarNamesL(); + + + /** + * creates the new calendar by given name. + * + * @param aFileName name of the calendar file this is string type. + * + * @param aDisplayName name of the calendar to display this is string type + * + * @return void. + */ + void CPIMManager::DoCreateCalFileL(const TDesC &aFileName,const TDesC &aDisplayName); + + /** + * delets the calendar by given name. + * + * @param aFileName name of the calendar file this is string type. + * + * @return void. + */ + void CPIMManager::DoDeleteCalFileL(const TDesC& aFileName); + + /** + * Opens a PIM list of given type. + * + * @param aPimListType List type. + * @param aPimListName Name of the list. The name must be valid list + * name. If not present, name is resolved to the default list + * of the given type. + * @param aCalName Name of the Canlendar. The name must be valid Canlendar + * name. If not present, name is resolved to the default Canlendar. + * + * @return PIM list. Type of the list corresponds to + * \a aPimListType argument. + * + * @par Leaving: + * The method leaves on error. Error codes should be interpreted as + * follows: + * @li \c KErrArgument - \a aPimListType is invalid. + * @li \c KErrNotSupported - \a aPimListType is not supported. + * @li \c KErrNotFound - No list was found by \a aPimListName. + * @li \c KErrAlreadyExists - The list was already opened and multiple + * instances of the list are not supported. + * @li Other - Internal error. + */ + pimbaselist* CPIMManager::DoOpenPimListL( const TPIMListType& aPimListType, - const TDesC* aPimListName); + const TDesC* aPimListName, + const TDesC* aCalName); + /** + * this method will create the Sessions with every calendar using file server. + * + */ + + void CPIMManager::createCalSessionL(); void dispose(); + private: // Constructors /** @@ -240,6 +361,23 @@ /** Owned. */ CPIMToDoValidator* iToDoValidator; + /** (Owned.) */ + RLibrary iLocalizationLibrary; + + CDesCArray* iCalList; + /** Session to calendar server. Owned. */ + //CCalSession* iCalSession; + + RPointerArray iCalSessions; + + CDesCArray* iCalendarNamesDesCArray; + + CDesCArray* iCalSessionArray; + + CDesCArray* iCalListName; + CDesCArrayFlat* iDesCArray; + CCalSession* iCalSession; + }; diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/framework/inc/pimbasemanager.h --- a/javaextensions/pim/framework/inc/pimbasemanager.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/framework/inc/pimbasemanager.h Wed Sep 15 12:05:25 2010 +0300 @@ -35,13 +35,22 @@ virtual MPIMLocalizationManager* localizationManager() const = 0; virtual pimbaselist* openPimList(const TPIMListType& aPimListType, - jstring aPimListName, JNIEnv* aJniEnv) = 0; + jstring aPimListName, jstring aCalName, + JNIEnv* aJniEnv) = 0; virtual jobjectArray listPimLists(const TPIMListType& aPimListType, jintArray aError, JNIEnv* aJniEnv) = 0; + virtual jobjectArray listCalendars(jintArray aError, + JNIEnv* aJniEnv) = 0; + virtual jobjectArray listCalendarNames(jintArray aError, + JNIEnv* aJniEnv) = 0; virtual void dispose()= 0; + virtual void createCalendar(jstring aCalName, jstring aDisplayName, JNIEnv* aJniEnv) = 0; + + virtual void deleteCalendar(jstring aCalName, JNIEnv* aJniEnv) = 0; + static pimbasemanager* getInstance(); }; diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/framework/src.s60/cpimeventlist.cpp --- a/javaextensions/pim/framework/src.s60/cpimeventlist.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/framework/src.s60/cpimeventlist.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -29,7 +29,7 @@ #include "pimjnitools.h" #include "pimutils.h" #include "s60commonutils.h" -#include "javasymbianoslayer.h" +#include "cleanupresetanddestroy.h" #include "logger.h" CPIMEventList::CPIMEventList(const CPIMEventValidator& aValidator) : diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/framework/src.s60/cpimlist.cpp --- a/javaextensions/pim/framework/src.s60/cpimlist.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/framework/src.s60/cpimlist.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -25,7 +25,7 @@ #include "cpimitem.h" #include "cpimitemmatcher.h" #include "cpimstringmatcher.h" -#include "javasymbianoslayer.h" +#include "cleanupresetanddestroy.h" #include "pimexternalchanges.h" #include "pimpanics.h" #include "pimjnitools.h" @@ -927,9 +927,9 @@ User::LeaveIfError(newAndRemovedItems->Append( tempRemovedItems[i])); } - CleanupStack::Pop(newAndRemovedItems); + CleanupStack::Pop(); // newAndRemovedItems cleanup close - + CleanupStack::Pop(newAndRemovedItems); CleanupStack::PopAndDestroy(); // tempRemovedItems cleanup close CleanupStack::PopAndDestroy(); // tempNewItems cleanup close @@ -1163,6 +1163,7 @@ RPointerArray& aTempNewItems, CPIMItem* aMatchingItem) { JELOG2(EPim); + // Create new item CPIMItem* newItem = NULL; TRAPD(errCreateItem, newItem = DoCreateItemL(aNewItemId, @@ -1179,13 +1180,10 @@ { User::LeaveIfError(errCreateItem); } - - // OK newItem->SetModified(EFalse); CleanupStack::PushL(newItem); User::LeaveIfError(iItems.Append(newItem)); CleanupStack::Pop(newItem); - // Add to list of new items CleanupClosePushL(aTempNewItems); TInt errAddToNewItems = aTempNewItems.Append(newItem); @@ -1217,8 +1215,6 @@ { User::LeaveIfError(errUpdateItem); } - - // OK aModifiedItem.SetModified(EFalse); } diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/framework/src.s60/cpimmanager.cpp --- a/javaextensions/pim/framework/src.s60/cpimmanager.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/framework/src.s60/cpimmanager.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -17,35 +17,44 @@ // INCLUDE FILES -#include "cpimmanager.h" + #include #include -#include "pimcommon.h" +#include +#include +#ifdef RD_JAVA_PIM_MULTICAL_ENABLED +#include +#include +#endif +#include "cpimmanager.h" +#include "cpimcontactlist.h" +#include "cpimcontactvalidator.h" +#include "cpimeventvalidator.h" +#include "cpimtodovalidator.h" +#include "cpimeventlist.h" +#include "cpimtodolist.h" +#include "cpimversit.h" +#include "cpimcmadapteraccess.h" +#include "cpimeventadapteraccess.h" +#include "cpimtodoadapteraccess.h" +#include "cpimlocalizationmanager.h" +#include "fs_methodcall.h" +#include "jstringutils.h" +#include "logger.h" #include "mpimcontactadaptermanager.h" #include "mpimeventadaptermanager.h" #include "mpimtodoadaptermanager.h" #include "mpimcontactlistadapter.h" #include "mpimeventlistadapter.h" #include "mpimtodolistadapter.h" -#include "cpimversit.h" #include "mpimlocalizationmanager.h" #include "mpimlocalizationdata.h" -#include "cpimcontactlist.h" -#include "cpimeventlist.h" -#include "cpimtodolist.h" -#include "cpimcontactvalidator.h" -#include "cpimeventvalidator.h" -#include "cpimtodovalidator.h" #include "mpimadapteraccess.h" -#include "cpimcmadapteraccess.h" -#include "cpimeventadapteraccess.h" -#include "cpimtodoadapteraccess.h" +#include "pimcommon.h" #include "pimpanics.h" #include "pimjnitools.h" #include "pimutils.h" -#include "jstringutils.h" -#include "logger.h" -#include "cpimlocalizationmanager.h" +#include "s60commonutils.h" // CONSTANTS @@ -55,10 +64,12 @@ * low, at the time of writing 1 to 4. */ const TInt KManagerArrayGranularity = 2; - +#ifdef RD_JAVA_PIM_MULTICAL_ENABLED +const TInt KBuffLength = 24; +#endif CPIMManager::CPIMManager() : - java::util::FunctionServer("CPIMManager"), iAdapterAccesses() + java::util::FunctionServer("CPIMManager"), iAdapterAccesses(), iCalSessions() { JELOG2(EPim); } @@ -69,18 +80,86 @@ iContactValidator = CPIMContactValidator::NewL(); iEventValidator = CPIMEventValidator::NewL(); iToDoValidator = CPIMToDoValidator::NewL(); - + iDesCArray = new(ELeave) CDesCArrayFlat(KManagerArrayGranularity); iLocalizationManager = (MPIMLocalizationManager*)(CPIMLocalizationManager::NewL()); createServerToNewThread(); + CallMethodL(this, &CPIMManager::createCalSessionL, this); +} + +void CPIMManager::createCalSessionL() +{ + iCalSession = CCalSession::NewL(); + //CleanupStack::PushL(iCalSession); + iCalSessionArray = iCalSession->ListCalFilesL(); + + TInt index = 0; + TInt find = iCalSessionArray->Find(iCalSession->DefaultFileNameL(),index); + + if (!find) + { + iCalSessionArray->Delete(index); + } + + TRAPD(err, iCalSession->OpenL(iCalSession->DefaultFileNameL())); + if (KErrNotFound == err) + { + iCalSession->CreateCalFileL(iCalSession->DefaultFileNameL()); + iCalSession->OpenL(iCalSession->DefaultFileNameL()); + } + else + { + User::LeaveIfError(err); + } + //CleanupStack::Pop(iCalSession); + +#ifdef RD_JAVA_PIM_MULTICAL_ENABLED + TInt iterate = 0; + TBool softDelete = EFalse; + + while (iterate < iCalSessionArray->Count()) + { + CCalSession* aCalSession = CCalSession::NewL(*iCalSession); + CleanupStack::PushL(aCalSession); + aCalSession->OpenL(iCalSessionArray->MdcaPoint(iterate)); + CCalCalendarInfo* caleninfo = aCalSession->CalendarInfoL(); + CleanupStack::PushL(caleninfo); + aCalSession->SetCalendarInfoL(*caleninfo); + + TBuf8 keyBuff; + keyBuff.Zero(); + keyBuff.AppendNum(EMarkAsDelete); + TPckgC pkgSoftDelete(softDelete); + TRAPD(err,pkgSoftDelete.Set(caleninfo->PropertyValueL(keyBuff))); + if (KErrNone == err) + { + softDelete = pkgSoftDelete(); + } + + if (softDelete) + { + + CleanupStack::PopAndDestroy(caleninfo); + CleanupStack::PopAndDestroy(aCalSession); + } + else + { + iCalSessions.AppendL(aCalSession); + iDesCArray->AppendL(iCalSessionArray->MdcaPoint(iterate)); + CleanupStack::PopAndDestroy(caleninfo); + CleanupStack::Pop(aCalSession); + } + iterate++; + } + delete iCalSessionArray; + iCalSessionArray = NULL; +#endif } pimbasemanager* pimbasemanager::getInstance() { JELOG2(EPim); - // Create CPIMManager - CPIMManager* self = NULL; TInt error = KErrNone; TRAP(error, self = CPIMManager::NewL()); @@ -135,9 +214,18 @@ delete iEventValidator; iEventValidator = NULL; delete iToDoValidator; + CallMethod(this, &CPIMManager::DeleteSessions, this); + delete iDesCArray; iToDoValidator = NULL; stopServer(); } +void CPIMManager::DeleteSessions() +{ + JELOG2(EPim); + iCalSessions.ResetAndDestroy(); + delete iCalSession; + iCalSession = NULL; +} void CPIMManager::dispose() { @@ -163,21 +251,24 @@ } pimbaselist* CPIMManager::openPimList(const TPIMListType& aPimListType, - jstring aPimListName, JNIEnv* aJniEnv) + jstring aPimListName, jstring aCalName, + JNIEnv* aJniEnv) { JELOG2(EPim); const JStringUtils listName(*aJniEnv, aPimListName); const TDesC* listNameArg = (aPimListName ? &listName : NULL); + const JStringUtils calName(*aJniEnv, aCalName); + const TDesC* calNameArg = (aCalName ? &calName : NULL); pimbaselist* list = NULL; TInt error = KErrNone; - TRAP(error, list = DoOpenPimListL(aPimListType, listNameArg)); + TRAP(error, list = DoOpenPimListL(aPimListType, listNameArg, calNameArg)); if (error != KErrNone) throw error; return list; } pimbaselist* CPIMManager::DoOpenPimListL(const TPIMListType& aPimListType, - const TDesC* aPimListName) + const TDesC* aPimListName, const TDesC* aCalNameArg) { JELOG2(EPim); pimbaselist* list = NULL; @@ -188,20 +279,18 @@ } else if (aPimListType == EPIMEventList) { - list = DoOpenEventListL(aPimListName); + list = DoOpenEventListL(aPimListName, aCalNameArg); } else if (aPimListType == EPIMToDoList) { - list = DoOpenToDoListL(aPimListName); + list = DoOpenToDoListL(aPimListName, aCalNameArg); } else { // invalid list type User::Leave(KErrArgument); } - // Check results - if (!list) { if (aPimListName) @@ -241,9 +330,6 @@ retVal->AppendL(lists[listIndex]); } } - - // Done - CleanupStack::Pop(retVal); return retVal; @@ -276,6 +362,276 @@ return javaStringArray; } + + + + +void CPIMManager::DoListCalendarsL() +{ + +#ifdef RD_JAVA_PIM_MULTICAL_ENABLED + iCalList = iCalSession->ListCalFilesL(); + + TInt index = 0; + TInt find = iCalList->Find(iCalSession->DefaultFileNameL(),index); + + if (!find) + { + iCalList->Delete(index); + } + iCalSessionArray = iCalList; + TInt iterate = 0; + TInt aPosition = 0; + while (iterate < iCalList->Count()) + { + aPosition = 0; + + TInt findInCurrentArray = iDesCArray->Find(iCalList->MdcaPoint(iterate),aPosition, ECmpNormal16); + CCalSession* aCalSession; + if (findInCurrentArray == 0) + { + aCalSession = iCalSessions[aPosition]; + } + else + { + aCalSession = CCalSession::NewL(*iCalSession); + CleanupStack::PushL(aCalSession); + aCalSession->OpenL(iCalList->MdcaPoint(iterate)); + } + // check for soft deleted calendars, incase of calendars being held by other applications, this will be followed. + CCalCalendarInfo* caleninfo = aCalSession->CalendarInfoL(); + CleanupStack::PushL(caleninfo); + aCalSession->SetCalendarInfoL(*caleninfo); + TBool softDelete = EFalse; + TBuf8 keyBuff; + keyBuff.Zero(); + keyBuff.AppendNum(EMarkAsDelete); + + TPckgC pkgSoftDelete(softDelete); + + TRAPD(err,pkgSoftDelete.Set(caleninfo->PropertyValueL(keyBuff))); + + if (KErrNone == err) + { + softDelete = pkgSoftDelete(); + } + + if (!softDelete && findInCurrentArray != 0) + { + iCalSessions.AppendL(aCalSession); + CleanupStack::Pop(aCalSession); + iDesCArray->AppendL(iCalList->MdcaPoint(iterate)); + } + else if (softDelete && findInCurrentArray == 0) + { + CleanupStack::PopAndDestroy(caleninfo); + caleninfo = NULL; + delete aCalSession; + iCalSessions[aPosition] = NULL; + iCalSessions.Remove(aPosition); + iDesCArray->Delete(aPosition); + + } + else if (softDelete && findInCurrentArray != 0) + { + CleanupStack::PopAndDestroy(caleninfo); + CleanupStack::PopAndDestroy(aCalSession); + caleninfo=NULL; + aCalSession = NULL; + } + if (caleninfo != NULL) + { + CleanupStack::PopAndDestroy(caleninfo); + caleninfo = NULL; + } + iterate++; + + } + + iCalList = iDesCArray; + iCalList->AppendL(iCalSession->DefaultFileNameL()); + delete iCalSessionArray; + iCalSessionArray = NULL; +#endif + +} + + +jobjectArray CPIMManager::listCalendars(jintArray aError, + JNIEnv* aJniEnv) +{ + + jobjectArray javaStringArray = NULL; + TInt error = KErrNone; + TRAP(error, CallMethodL(this, &CPIMManager::DoListCalendarsL, this)); + if (error == KErrNone) + { + javaStringArray = CreateJavaStringArray(aJniEnv, *iCalList, EFalse); + if (!javaStringArray) + { + SetJavaErrorCode(aJniEnv, aError, KErrNoMemory); + } + iCalList = NULL; + TInt index = 0; + TInt find = 0; + TRAPD(error,find = iDesCArray->Find(iCalSession->DefaultFileNameL(),index)); + if (error == KErrNone) + if (!find) + { + iDesCArray->Delete(index); + } + else + { + SetJavaErrorCode(aJniEnv, aError, error); + } + } + else + { + + SetJavaErrorCode(aJniEnv, aError, error); + } + return javaStringArray; +} + +jobjectArray CPIMManager::listCalendarNames(jintArray aError, + JNIEnv* aJniEnv) +{ + jobjectArray javaStringArray = NULL; + TInt error = KErrNone; + TRAP(error, CallMethodL(this, &CPIMManager::DoListCalendarNamesL, this)); + if (error == KErrNone) + { + javaStringArray = CreateJavaStringArray(aJniEnv, *iCalListName, EFalse); + if (!javaStringArray) + { + SetJavaErrorCode(aJniEnv, aError, KErrNoMemory); + } + delete iCalListName; + iCalListName = NULL; + } + else + { + SetJavaErrorCode(aJniEnv, aError, error); + } + return javaStringArray; +} + +void CPIMManager::DoListCalendarNamesL() +{ +#ifdef RD_JAVA_PIM_MULTICAL_ENABLED + iCalListName = new(ELeave) CDesCArrayFlat(KManagerArrayGranularity); + //CleanupStack::PushL(iCalListName); + for (int iterate = 0; iterate < iDesCArray->Count(); iterate++) + { + CCalCalendarInfo* caleninfo = iCalSessions[iterate]->CalendarInfoL(); + CleanupStack::PushL(caleninfo); + iCalListName->AppendL(caleninfo->NameL()); + + CleanupStack::PopAndDestroy(caleninfo); + } + CCalCalendarInfo* caleninfo = iCalSession->CalendarInfoL(); + CleanupStack::PushL(caleninfo); + iCalListName->AppendL(caleninfo->NameL()); + + CleanupStack::PopAndDestroy(caleninfo); + //CleanupStack::Pop(iCalListName); +#endif +} +void CPIMManager::createCalendar(jstring aCalName,jstring aDisplayName, JNIEnv* aJniEnv) +{ + const JStringUtils calName(*aJniEnv, aCalName); + const JStringUtils displayName(*aJniEnv, aDisplayName); + const TDesC* displayNameArg = (aDisplayName ? &displayName : NULL); + const TDesC* calNameArg = (aCalName ? &calName : NULL); + TInt error = KErrNone; + TRAP(error, CallMethodL(this, &CPIMManager::DoCreateCalFileL, *calNameArg,*displayNameArg, this)); + if (error != KErrNone) + throw error; +} + +void CPIMManager::DoCreateCalFileL(const TDesC& aFileName, const TDesC& aDisplayName) +{ + #ifdef RD_JAVA_PIM_MULTICAL_ENABLED + + CCalSession* aCalSession = CCalSession::NewL(*iCalSession); + CleanupStack::PushL(aCalSession); + CCalCalendarInfo* calendarInfo = CCalCalendarInfo::NewL(); + CleanupStack::PushL(calendarInfo); + + aCalSession->CreateCalFileL(aFileName,*calendarInfo); + CleanupStack::PopAndDestroy(calendarInfo); + aCalSession->OpenL(aFileName); + CCalCalendarInfo* calendarinfostack = aCalSession->CalendarInfoL(); + CleanupStack::PushL(calendarinfostack); + + calendarinfostack->SetNameL(aDisplayName); + calendarinfostack->SetEnabled(ETrue); + aCalSession->SetCalendarInfoL(*calendarinfostack); + CleanupStack::PopAndDestroy(calendarinfostack); + iCalSessions.AppendL(aCalSession); + iDesCArray->AppendL(aFileName); + CleanupStack::Pop(aCalSession); + + #endif +} + +void CPIMManager::deleteCalendar(jstring aCalName, JNIEnv* aJniEnv) +{ + const JStringUtils calName(*aJniEnv, aCalName); + const TDesC* calNameArg = (aCalName ? &calName : NULL); + TInt error = KErrNone; + TRAP(error, CallMethodL(this, &CPIMManager::DoDeleteCalFileL, *calNameArg, this)); + if (error != KErrNone) + throw error; + +} + + +void CPIMManager::DoDeleteCalFileL(const TDesC& aFileName) +{ + #ifdef RD_JAVA_PIM_MULTICAL_ENABLED + + if (aFileName != iCalSession->DefaultFileNameL()) + { + TInt aPosition = 0; + TInt findInCurrentArray = iDesCArray->Find(aFileName, aPosition, ECmpNormal16); + if (findInCurrentArray == 0) + { + CCalCalendarInfo* caleninfo = iCalSessions[aPosition]->CalendarInfoL(); + CleanupStack::PushL(caleninfo); + + caleninfo->SetEnabled(EFalse); + + TBuf8 keyBuff; + + keyBuff.Zero(); + keyBuff.AppendNum(EMarkAsDelete); + TPckgC pkgSoftDelete(ETrue); + caleninfo->SetPropertyL(keyBuff, pkgSoftDelete); + + CleanupStack::PopAndDestroy(caleninfo); + TRAP_IGNORE(iCalSessions[aPosition]->DeleteCalFileL(aFileName)); + + delete iCalSessions[aPosition]; + iCalSessions[aPosition]= NULL; + iCalSessions.Remove(aPosition); + + iDesCArray->Delete(aPosition); + } + else + { + User::Leave(KErrNotFound); + } + + } + else + { + User::Leave(KErrAccessDenied); + } + + #endif +} + const CPIMContactValidator& CPIMManager::ContactValidator() { JELOG2(EPim); @@ -309,26 +665,20 @@ if (iAdapterAccesses[i]->OpenContactListL(aListName, &contactAdapterManager, &contactListAdapter, &localizationData)) { - // got one CleanupDeletePushL(contactAdapterManager); CleanupDeletePushL(contactListAdapter); - contactList = CPIMContactList::NewL(contactAdapterManager, contactListAdapter, localizationData, *iContactValidator); - CleanupStack::Pop(contactListAdapter); CleanupStack::Pop(contactAdapterManager); - break; } - - // else try next Adapter Access } return contactList; } -CPIMEventList* CPIMManager::DoOpenEventListL(const TDesC* aListName) +CPIMEventList* CPIMManager::DoOpenEventListL(const TDesC* aListName, const TDesC* aCalNameArg) { JELOG2(EPim); CPIMEventList* eventList = NULL; @@ -337,22 +687,40 @@ MPIMEventListAdapter* eventListAdapter = NULL; MPIMLocalizationData* localizationData = NULL; + + CCalSession* calSession = NULL; + TInt findInCurrentArray = 0; + TInt aPosition = 0; + if (aCalNameArg == NULL || *aCalNameArg == iCalSession->DefaultFileNameL()) + { + calSession = iCalSession; + } + else + { + findInCurrentArray = iDesCArray->Find(*aCalNameArg, aPosition); + + if (findInCurrentArray == 0) + { + calSession = iCalSessions[aPosition]; + } + else + { + User::Leave(KErrNotFound); + } + } + const TInt n = iAdapterAccesses.Count(); for (TInt i = 0; i < n; i++) { - if (iAdapterAccesses[i]->OpenEventListL(aListName, + if (iAdapterAccesses[i]->OpenEventListL(calSession, aListName, &eventAdapterManager, &eventListAdapter, &localizationData)) { - // got one CleanupDeletePushL(eventAdapterManager); CleanupDeletePushL(eventListAdapter); - eventList = CPIMEventList::NewL(eventAdapterManager, eventListAdapter, localizationData, *iEventValidator); - CleanupStack::Pop(eventListAdapter); CleanupStack::Pop(eventAdapterManager); - break; } @@ -362,7 +730,7 @@ return eventList; } -CPIMToDoList* CPIMManager::DoOpenToDoListL(const TDesC* aListName) +CPIMToDoList* CPIMManager::DoOpenToDoListL(const TDesC* aListName, const TDesC* aCalNameArg) { JELOG2(EPim); CPIMToDoList* toDoList = NULL; @@ -370,12 +738,34 @@ MPIMToDoAdapterManager* toDoAdapterManager = NULL; MPIMToDoListAdapter* toDoListAdapter = NULL; MPIMLocalizationData* localizationData = NULL; + TInt aPosition = 0; + TInt findInCurrentArray = 0; + + CCalSession* calSession = NULL; + + if (aCalNameArg == NULL || *aCalNameArg == iCalSession->DefaultFileNameL()) + { + calSession = iCalSession; + } + else + { + findInCurrentArray = iDesCArray->Find(*aCalNameArg, aPosition); + + if (findInCurrentArray == 0) + { + calSession = iCalSessions[aPosition]; + } + else + { + User::Leave(KErrNotFound); + } + } const TInt n = iAdapterAccesses.Count(); for (TInt i = 0; i < n; i++) { - if (iAdapterAccesses[i]->OpenToDoListL(aListName, &toDoAdapterManager, - &toDoListAdapter, &localizationData)) + if (iAdapterAccesses[i]->OpenToDoListL(calSession, aListName, + &toDoAdapterManager, &toDoListAdapter,&localizationData)) { // got one CleanupDeletePushL(toDoAdapterManager); diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/framework/src.s60/cpimtodolist.cpp --- a/javaextensions/pim/framework/src.s60/cpimtodolist.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/framework/src.s60/cpimtodolist.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -24,7 +24,7 @@ #include "cpimtodoitem.h" #include "mpimadaptermanager.h" #include "pimtodo.h" -#include "javasymbianoslayer.h" +#include "cleanupresetanddestroy.h" #include "pimjnitools.h" #include "pimutils.h" #include "s60commonutils.h" diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/framework/src.s60/pimjnitools.cpp --- a/javaextensions/pim/framework/src.s60/pimjnitools.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/framework/src.s60/pimjnitools.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -174,10 +174,12 @@ JELOG2(EPim); const TInt numElems = aNativeArray.Count(); + // Initializes the array with NULLs jobjectArray javaStringArray = aJniEnv->NewObjectArray(numElems, aJniEnv->FindClass("java/lang/String"), NULL); + if (!javaStringArray) { return NULL; @@ -208,7 +210,6 @@ // Avoid running out of local references aJniEnv->DeleteLocalRef(javaElem); } - return javaStringArray; } diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/inc.s60/dummy.txt diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/inc.s60/mpimlocalizationdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/pim/inc.s60/mpimlocalizationdata.h Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Access interface to list-specific localization data. +* +*/ + +#ifndef MPIMLOCALIZATIONDATA_H +#define MPIMLOCALIZATIONDATA_H + +// INCLUDES +#include "pimtypes.h" + +// CLASS DECLARATION + +/** +* Provides localized strings for the various labels used in the PIM API +*/ +class MPIMLocalizationData +{ +public: // destructor + /** + * Destructor is public virtual in order to allow deletion through + * M-class + */ + virtual ~MPIMLocalizationData() { } + +public: // New functions + + /** + * Provides a string label associated with the given field. The caller + * takes ownership of the returned object. + * + * @param aField The field for which the label is being queried. + * + * @return String label for the field. The label is locale specific. + */ + virtual HBufC* GetFieldLabelL(TPIMField aField) = 0; + + /** + * Provides a string label associated with the given attribute. + * The caller takes ownership of the returned object. + * + * @param aAttribute The attribute for which the label is being queried. + * + * @return String label for the attribute. The label is locale specific. + */ + virtual HBufC* GetAttributeLabelL(TPIMAttribute aAttribute) = 0; + + /** + * Provides a string label associated with the given array element. + * The caller takes ownership of the returned object. + * + * @param aStringArrayField The field which has a EPIMFieldStringArray + * data type. + * @param aArrayElement The element in the array. + * + * @return String label for the array element + */ + virtual HBufC* GetArrayElementLabelL(TPIMField aStringArrayField, + TPIMArrayElement aArrayElement) = 0; + /** + * Provides the name of the list. + * The caller takes ownership of the returned object. + * + * @return the list name. + */ + virtual HBufC* GetListNameL() = 0; + +}; + + + +#endif // MPIMLOCALIZATIONDATA_H diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/inc.s60/mpimlocalizationmanager.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/pim/inc.s60/mpimlocalizationmanager.h Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2004-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: Access interface to different list localization data sets. +* +*/ + +#ifndef MPIMLOCALIZATIONMANAGER_H +#define MPIMLOCALIZATIONMANAGER_H + +// INCLUDES +#include "pimtypes.h" +#include + +// FORWARD DECLARATIONS +class MPIMLocalizationData; +class MPIMConfirmationDialogue; + +/** + * PIM Item and category operations + */ +enum TPIMOperationType +{ + EPIMOperationItemDeletion = 1, + EPIMOperationItemCommit, + EPIMOperationCategoryDeletion, + EPIMOperationContactListRead, + EPIMOperationContactListWrite, + EPIMOperationEventListRead, + EPIMOperationEventListWrite, + EPIMOperationToDoListRead, + EPIMOperationToDoListWrite +}; + +// CLASS DECLARATION +/** + * A Factory class for MPIMLocalizationData objects + */ +class MPIMLocalizationManager +{ +public: // destructor + /** + * Destructor is public virtual in order to allow deletion through + * M-class + */ + virtual ~MPIMLocalizationManager() { } + +public: + /** + * Creates an instance of MPIMLocalizationData. + * Caller takes ownership of the returned object. + * + * @param aType Type of the list, which of data to localize. + * This can be KPIMLocalizationIdContact, + * KPIMLocalizationIdSIM, KPIMLocalizationIdEvent or + * KPIMLocalizationidToDo + * + * @return MPIMLocalizationData object for the requested list type. + * @par Leaving: + * The method leaves on error. Error codes should be interpreted as + * follows: + * @li \c KErrArgument - \a aType is not valid + * @li \c KErrNotFound - The resource file cannot be read + */ + virtual MPIMLocalizationData* GetPIMLocalizationDataL( + TPIMLocalizationDataID aType) = 0; + + /** + * Creates an instance of MPIMLocalizationData. + * Caller takes ownership of the returned object. + * + * @param aType Type of the list, which of data to localize. + * This can be KPIMLocalizationIdContact, + * KPIMLocalizationIdSIM, KPIMLocalizationIdEvent or + * KPIMLocalizationidToDo + * + * @param aSubType List name identifier. Currently only Event lists + * can have list name identifiers (all other list should + * use zero). + * + * @return MPIMLocalizationData object for the requested list type. + * @par Leaving: + * The method leaves on error. Error codes should be interpreted as + * follows: + * @li \c KErrArgument - \a aType is not valid, or \a aSubType is not + * valid for \a aType. + * @li \c KErrNotFound - The resource file cannot be read + */ + virtual MPIMLocalizationData* GetPIMLocalizationDataL( + TPIMLocalizationDataID aType, + TPIMLocalizationDataID aSubType) = 0; + + + +}; + + + +#endif // MPIMLOCALIZATIONMANAGER_H + +// End of file diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/inc.s60/pimlocalizationids.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/pim/inc.s60/pimlocalizationids.h Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Localization data identifiers. +* +*/ + + + +#ifndef PIMLOCALIZATIONIDS_H +#define PIMLOCALIZATIONIDS_H + +// INCLUDE FILES +#include "pimtypes.h" + +/** +* @file +* This file contains constants that map the lists provided by adapters +* with label sets provided with the localization module. A constant may +* apply to one or several related lists. +* +* There are two types of IDs: +* @li Localization IDs +* @li List name IDs +* Both of them are of type TPIMLocalizationDataID. +* +* Localization IDs define a set of localized labels for fields, attributes +* and array elements and a default name for the list. +* +* List name IDs specify a name among a set of localized labels defined by +* a localization ID. The default list name can be thus overridden using +* a list name ID. A localization set may or may not define several list name +* IDs. If only single name is defined for a localization set, it may not be +* documented but it can be used using the localization operations that rely +* on the default list name id. +* +* Naming: +* @li Localization IDs are of form \c KPIMLocalizationIDXXX. +* @li List name IDs are of form \c KPIMListNameIdYYY. +*/ + +// CONSTANTS + + +// Localization data IDs + +/** +* Localization data identifier for Contacts Model contact list. The labels +* associated with this identifier apply only on that list. +*/ +const TPIMLocalizationDataID KPIMLocalizationIdContacts = 1; + +/** +* Localization data identifier for SIM contact list. The labels associated +* with this identifier apply only on that list. +* +* NOTE: Currently unused, defined for future purposes. +*/ +const TPIMLocalizationDataID KPIMLocalizationIdSIM = 2; + +/** +* Localization data identifier for all Agenda Event lists (Meeting, Memo and +* Anniversary). The labels are valid for any of those lists. Each of the lists +* uses only a subset of the labels associated with this identifier. +*/ +const TPIMLocalizationDataID KPIMLocalizationIdEvent = 3; + +/** +* Localization data identifier for Agenda to-do list. The labels associated +* with this identifier apply only on that list. +*/ +const TPIMLocalizationDataID KPIMLocalizationIdToDo = 4; + + +// List name IDs +// NOTE! It is essential that these IDs are sequential and start from zero. + +/** +* List name identifier for "Appointment" Agenda Event list. +* Applies with the localization data identifier \c KPIMLocalizationIdEvent. +*/ +const TPIMLocalizationDataID KPIMListNameIdAppointment = 0; + +/** +* List name identifier for "Event" Agenda Event list. +* Applies with the localization data identifier \c KPIMLocalizationIdEvent. +*/ +const TPIMLocalizationDataID KPIMListNameIdEvent = 1; + +/** +* List name identifier for "Anniversary" Agenda Event list. +* Applies with the localization data identifier \c KPIMLocalizationIdEvent. +*/ +const TPIMLocalizationDataID KPIMListNameIdAnniversary = 2; + + +#endif // PIMLOCALIZATIONIDS_H + + +// End of File diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/javasrc.s60/com/nokia/mj/impl/pim/utils/NativeError.java --- a/javaextensions/pim/javasrc.s60/com/nokia/mj/impl/pim/utils/NativeError.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/javasrc.s60/com/nokia/mj/impl/pim/utils/NativeError.java Wed Sep 15 12:05:25 2010 +0300 @@ -644,7 +644,81 @@ } } } + public static void handleCreateCalendarError(int aNativeErrorCode, String aCalName) + { + + if (aNativeErrorCode == OsErrorMessage.SUCCESS) + { + return; // OK + } + + switch (aNativeErrorCode) + { + case OsErrorMessage.KERR_ARGUMENT: + { + throw new IllegalArgumentException( + "Creation of calendar failed: calendar name is invalid" + + aCalName); + } + case OsErrorMessage.KERR_BAD_NAME: + { + throw new IllegalArgumentException( + "Creation of calendar failed: calendar name is not valid " + + aCalName); + } + case OsErrorMessage.KERR_ALREADY_EXISTS: + { + throw new RuntimeException(ErrorString.CALENDAR_ALREADY_EXISTS); + } + default: + { + throw new GenericException(ErrorString.GENERAL_ERROR_COLON + aNativeErrorCode); + } + } + } + + public static void handleDeleteCalendarError(int aNativeErrorCode, String aCalName) + { + + + if (aNativeErrorCode == OsErrorMessage.SUCCESS) + { + return; // OK + } + + switch (aNativeErrorCode) + { + case OsErrorMessage.KERR_ACCESS_DENIED: + { + throw new IllegalArgumentException( + "Deletion of calendar failed: phone default calendar cannot be deleted"); + } + case OsErrorMessage.KERR_ARGUMENT: + { + // we should never end up here since the calendar name is + // verified to be not empty before making the native call + throw new IllegalArgumentException( + "Deletion of calendar failed: calendar name is null"); + } + case OsErrorMessage.KERR_NOT_FOUND: + { + throw new IllegalArgumentException( + "Deletion of calendar failed: calendar by name " + + aCalName + " cannot be found"); + } + case OsErrorMessage.KERR_BAD_NAME: + { + throw new IllegalArgumentException( + "Deletion of calendar failed: calendar name " + + aCalName + " includes a path explicitly"); + } + default: + { + throw new GenericException(ErrorString.GENERAL_ERROR_COLON + aNativeErrorCode); + } + } + } /** * Construction prohibited. */ diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/javasrc/com/nokia/mj/impl/pim/Calendar.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/pim/javasrc/com/nokia/mj/impl/pim/Calendar.java Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,106 @@ +/* +* 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: Abstract PIMExtension class. + * +*/ + +// PACKAGE +package com.nokia.mj.impl.pim; + +// CLASS DEFINITION +/** + *

+ * Nokia propritery class for holding the calendar file name and calendar display name. + *

+ + *

General

+ * The object of the class will be returned to user when listcalendars is called from the MIDlet. + * Using the object user can obtain either calendar file name or calendar display name. These names should be used in appropriate places. + *
    + *
  • + *

    Sample MIDlet code snippet

    + * + *

    Opening a Memo List from a calendar name Personal available on C drive

    + * + * + * import javax.microedition.pim.*;
    + * import com.nokia.mid.pimextension.PIMExtension;
    + * import com.nokia.mid.pimextension.calendar;
    + *
    + *     ...
    + *     // Gets a PIMExtended class instance
    + *     PIM pim = PIM.getInstance();
    + *     try {
    + *     PIMExtension pimExtension = (PIMExtension) pim;
    + *     }
    + *     catch (ClassCastException e){
    + *     // extension is not avaialable
    + *     }
    + *
    + *     // Gets the list of calendars available on the device
    + *     calendar[] calList = pimExtension.listCalendars();
    + *
    + *     // Opens the memo list from the "Personal" calendar
    + *     EventList memoList = ( EventList )
    + *         calPIM.openPIMList(PIM.EVENT_LIST, PIM.READ_WRITE, "Memos", calList.getCalendarFileName);
    + *  ...
    + *  
    + *
    + */ +public final class Calendar +{ + /* + * + * two strings to hold calendar File Name and Calendar name. These should not be accesible, hence they are private. + * + */ + private String calendarFileName; + private String calendarName; + /* + * + *constructor accessed by jrt implementation to construct the object with the 2 different names of the calendar. + * + */ + public Calendar(String fileName, String userName) + { + calendarFileName = fileName; + calendarName = userName; + } + /* + * + * + * This functions getCalendarFileName() returns the calendar file name in the database. + * This string should be passed to all the operations on calendar. + * + */ + public String getCalendarFileName() + { + return calendarFileName; + } + + /* + * + * + * This functions getCalendarName() returns the display name of the calendar. + * This should be used for user display purposes. + * Note: When user creates a calendar from java side, both the names will be same. + * The file created will be named as the string passed by user. + * The calendar will also be named with the string. + * + */ + public String getCalendarName() + { + return calendarName; + } +} \ No newline at end of file diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/javasrc/com/nokia/mj/impl/pim/ErrorString.java --- a/javaextensions/pim/javasrc/com/nokia/mj/impl/pim/ErrorString.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/javasrc/com/nokia/mj/impl/pim/ErrorString.java Wed Sep 15 12:05:25 2010 +0300 @@ -217,4 +217,7 @@ /** Error description. */ public final static String SEARCHING_FAILED_COLON = "Searching failed:"; + + /** Error description. */ + public final static String CALENDAR_ALREADY_EXISTS = "Calendar already Exists:"; } \ No newline at end of file diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMListImpl.java --- a/javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMListImpl.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMListImpl.java Wed Sep 15 12:05:25 2010 +0300 @@ -111,12 +111,14 @@ PIMListImpl(int aListHandle, int aMode) { iListHandle = aListHandle; + iMode = aMode; Logger.LOG(Logger.EPim,Logger.EInfo,"+PIMListImpl() = iListHandle = "+iListHandle); + if (iListHandle != 0) + { + iItems = new ItemTable(); + } setShutdownListener(); iFinalizer = registerForFinalization(); - iMode = aMode; - - iItems = new ItemTable(); } public Finalizer registerForFinalization() @@ -359,8 +361,11 @@ if (iIsOpen == true) { iIsOpen = false; - int err = _close(iListHandle); - NativeError.handlePIMListCloseError(err); + if (iListHandle != 0) + { + int err = _close(iListHandle); + NativeError.handlePIMListCloseError(err); + } iItems = null; } else diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMManager.java --- a/javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMManager.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMManager.java Wed Sep 15 12:05:25 2010 +0300 @@ -20,12 +20,13 @@ package com.nokia.mj.impl.pim; // IMPORTS - import javax.microedition.pim.PIM; import javax.microedition.pim.PIMException; import javax.microedition.pim.PIMItem; import javax.microedition.pim.PIMList; import java.io.UnsupportedEncodingException; +import java.util.Enumeration; +import java.util.Vector; import com.nokia.mj.impl.pim.ErrorString; import com.nokia.mj.impl.pim.GenericException; import com.nokia.mj.impl.rt.support.ApplicationUtils; @@ -33,7 +34,8 @@ import com.nokia.mj.impl.rt.support.ShutdownListener; import com.nokia.mj.impl.security.utils.SecurityPromptMessage; import com.nokia.mj.impl.pim.utils.NativeError; - +import com.nokia.mj.impl.utils.Tokenizer; +import com.nokia.mj.impl.pim.Calendar; // CLASS DEFINITION /** @@ -72,6 +74,7 @@ /** Serializer. */ private Serializer iSerializer; + private Vector iCalInfo; // Methods @@ -98,7 +101,7 @@ * Creates PIMManager. * Direct creation of a PIMManager is prohibited. */ - private PIMManager() + public PIMManager() { super(); setShutdownListener(); @@ -111,6 +114,7 @@ } iSerializer = new Serializer(iManagerHandle); + iCalInfo = new Vector(); } /** @@ -164,7 +168,6 @@ iManagerHandle = 0; } } - }); } @@ -178,13 +181,18 @@ } // Methods from PIM - public synchronized PIMList openPIMList(int aPimListType, int aMode) throws PIMException { - return doOpenPIMList(aPimListType, aMode, null); + return doOpenPIMList(aPimListType, aMode, null, null); } + + /** + * this method is used to open existsing calendar, create new calendar and delete existsing calendar by passing string as name. + * function will parse the string and do the operation. + * user as to pass the string in given format only + */ public synchronized PIMList openPIMList(int aPimListType, int aMode, String aName) throws PIMException { @@ -193,17 +201,130 @@ throw new NullPointerException(ErrorString.OPENING_LISTS_FAILED_COLON + ErrorString.LIST_NAME_IS_NULL); } + //Check if the aName is as per the MultipleCalendar Parameter definition + //aName = [calendarname "/"] listname ["?operation=" ["create" | "delete"]] + if (isMultiCalendarParam(aName)) + { - return doOpenPIMList(aPimListType, aMode, aName); + String calendarName = null; + String operation = null; + String listName = null; + + listName = getListName(aName); + operation = getOperation(aName); + calendarName = aName.substring(0, aName.indexOf("/")); + if (isListNameValid(listName)) + { + if (operation == null) + { + if (calendarName != null) + { + //This is the case of opening an existing calendar + return doOpenPIMList(aPimListType, aMode, listName, "C:" + calendarName); + } + else + { + //This is the case with IllegalArgumentException + throw new IllegalArgumentException("Calendar Name is NULL"); + } + } + else if (operation.equals("create")) + { + createCalendar(calendarName); + int[] error = new int[1]; + int listHandle = _openPIMList(iManagerHandle, aPimListType, listName, calendarName, error); + PIMListImpl pimList = new EventListImpl(listHandle, aMode); + return pimList; + } + else if (operation.equals("delete")) + { + deleteCalendar(calendarName); + int listHandle = 0; + PIMListImpl pimList = new EventListImpl(listHandle, aMode); + return pimList; + } + else + { + throw new IllegalArgumentException("Invalid operation"); + } + } // if isListNameValid(listName) block ends here + else + { + throw new IllegalArgumentException("Invalid List name"); + } + } // if isMultiCalendarParam(aName) block ends here + else + { + //This is not the case of Multiple Calendar, so follow the default calendar path + return doOpenPIMList(aPimListType, aMode, aName); + } + } + + private boolean isMultiCalendarParam(String aListTypeName) + { + //If there is "?" and/or "=" is present in aListTypeName + //return true + boolean ret = false; + if ((aListTypeName.indexOf("/") != -1) || (aListTypeName.indexOf("?") != -1) || (aListTypeName.indexOf("=") != -1)) + { + ret = true; + } + return ret; + } + + private String getListName(String aName) + { + // Get Operation + String operation = "?operation="; + int operationIndex = aName.indexOf(operation); + + if (operationIndex == -1) + { + operationIndex = aName.length(); + } + + return aName.substring(aName.indexOf("/") + 1, operationIndex); + } + + private boolean isListNameValid(String aListName) + { + String lists[] = listPIMLists(PIM.EVENT_LIST); + boolean listExist = false; + + for (int i = 0; i < lists.length; i++) + { + if (aListName.trim().equalsIgnoreCase(lists[i])) + { + listExist = true; + break; + } + } + + return listExist; + } + + private String getOperation(String aName) + { + String aOperation = null; + String operation = "?operation="; + int operationIndex = aName.indexOf(operation); + + if (operationIndex != -1) + { + aOperation = aName.substring(operationIndex + operation.length()); + } + + + return aOperation; + } public synchronized String[] listPIMLists(int aPimListType) { - if (aPimListType != PIM.CONTACT_LIST && aPimListType != PIM.EVENT_LIST - && aPimListType != PIM.TODO_LIST) + + if (aPimListType != PIM.CONTACT_LIST && aPimListType != PIM.EVENT_LIST && aPimListType != PIM.TODO_LIST) { - throw new java.lang.IllegalArgumentException(ErrorString.LISTING_FAILED_DOT + - ErrorString.INVALID_LIST_TYPE_COLON + aPimListType); + throw new java.lang.IllegalArgumentException(ErrorString.LISTING_FAILED_DOT + ErrorString.INVALID_LIST_TYPE_COLON + aPimListType); } // Ensure permission getPermission(aPimListType, PIM.READ_ONLY); @@ -233,7 +354,121 @@ { return iSerializer.supportedSerialFormats(aPimListType); } + /** + * Enumerates the calendars currently present in the device. + * + * @return A list of Calendar names + * @throws java.lang.SecurityException + * if the application is not given permission to read PIM lists + */ + public synchronized Calendar[] listCalendars() + { + // security check + ApplicationUtils appUtils = ApplicationUtils.getInstance(); + PIMPermissionImpl per = new PIMPermissionImpl("pim://*", PIMPermissionImpl.ACTION_READ_EVENTS + "," + PIMPermissionImpl.ACTION_READ_TODOS); + appUtils.checkPermission(per); + int[] error = new int[1]; + String[] calendarFileLists = _listCalendars(iManagerHandle, error); + String[] calendarNameLists = _listCalendarNames(iManagerHandle, error); + if (!NativeError.checkSuccess(error[0])) + { + throw new GenericException(ErrorString.GENERAL_ERROR_COLON + error[0]); + } + Vector tokens = new Vector(); + Vector tokenNames = new Vector(); + int length = calendarFileLists.length; + for (int i = 0; i < length; i++) + { + String str[] = Tokenizer.split(calendarFileLists[i], ":"); + String strname[] = Tokenizer.split(calendarNameLists[i], ":"); + + + if (str[0].equals("C")) + { + tokens.addElement(str[1]); + + } + if (strname[0].equals("C")) + { + + tokenNames.addElement(strname[1]); + } + else + { + + tokenNames.addElement(strname[0]); + } + } + String[] calendarLists = new String[tokens.size()]; + String[] calendarNames = new String[tokenNames.size()]; + tokens.copyInto(calendarLists); + tokenNames.copyInto(calendarNames); + Calendar[] calendarobjlist = new Calendar[calendarLists.length]; + for (int i = 0; i < calendarLists.length; i++) + { + Calendar cal = new Calendar(calendarLists[i], calendarNames[i]); + calendarobjlist[i] = cal; + } + //return calendarLists; + return calendarobjlist; + } + + + private synchronized void createCalendar(String aCalName) + { + + String displayName = aCalName; + // security check + ApplicationUtils appUtils = ApplicationUtils.getInstance(); + PIMPermissionImpl per = new PIMPermissionImpl("pim://*", PIMPermissionImpl.ACTION_WRITE_EVENTS + "," + PIMPermissionImpl.ACTION_WRITE_TODOS); + appUtils.checkPermission(per); + String fileName = "C:" + aCalName; + int error = _createCalendar(iManagerHandle, fileName,displayName); + NativeError.handleCreateCalendarError(error, aCalName); + } + + private synchronized void deleteCalendar(String aCalName) + { + // security check + ApplicationUtils appUtils = ApplicationUtils.getInstance(); + PIMPermissionImpl per = new PIMPermissionImpl(PIMPermissionImpl.ACTION_WRITE_EVENTS + "," + PIMPermissionImpl.ACTION_WRITE_TODOS, aCalName, null, -1); + appUtils.checkPermission(per); + + boolean isCalPresent = false; + String fileName = "C:" + aCalName; + int index; + for (index = 0; index < iCalInfo.size(); index++) + { + CalendarListInfo calList = (CalendarListInfo) iCalInfo.elementAt(index); + String calName = calList.iCalName; + if (calName.equals(fileName)) + { + Enumeration e = calList.iList.elements(); + while (e.hasMoreElements()) + { + PIMList list = (PIMList) e.nextElement(); + try + { + list.close(); + } + catch (PIMException ex) + { + //throw new GenericException("Delete entry failed. " + ex.toString()); + } + } + calList.iList.removeAllElements(); + isCalPresent = true; + break; + } + } + int error = _deleteCalendar(iManagerHandle, fileName); + NativeError.handleDeleteCalendarError(error, aCalName); + if (isCalPresent) + { + iCalInfo.removeElementAt(index); + } + } /** * getPermission @@ -297,27 +532,17 @@ appUtils.checkPermission(per); } - - // New private methods - /** - * Common implementation of the list opening. Arguments and permissions are - * pre-checked. - * - * @param aName - * If null, default list is opened. - */ private PIMList doOpenPIMList(int aPimListType, int aMode, String aName) throws PIMException { - if (aPimListType != PIM.CONTACT_LIST && aPimListType != PIM.EVENT_LIST - && aPimListType != PIM.TODO_LIST) + + if (aPimListType != PIM.CONTACT_LIST && aPimListType != PIM.EVENT_LIST && aPimListType != PIM.TODO_LIST) { throw new java.lang.IllegalArgumentException( ErrorString.INVALID_LIST_TYPE_COLON + aPimListType); } - if (aMode != PIM.READ_ONLY && aMode != PIM.WRITE_ONLY - && aMode != PIM.READ_WRITE) + if (aMode != PIM.READ_ONLY && aMode != PIM.WRITE_ONLY && aMode != PIM.READ_WRITE) { throw new java.lang.IllegalArgumentException( ErrorString.INVALID_MODE_COLON + aMode); @@ -339,8 +564,7 @@ } int[] error = new int[1]; int listHandle = _openPIMList( - - iManagerHandle, aPimListType, aName, error); // if null, open default + iManagerHandle, aPimListType, aName, null, error); // if null, open default // list NativeError.handleOpenPIMListError(error[0], aPimListType, aName); @@ -378,6 +602,86 @@ return pimList; } +/////////////////////// + // New private methods + + /** + * Common implementation of the list opening. Arguments and permissions are + * pre-checked. + * + * @param aName + * If null, default list is opened. + */ + private PIMList doOpenPIMList(int aPimListType, int aMode, String aName, String aCalName) + throws PIMException + { + + if (aPimListType != PIM.CONTACT_LIST && aPimListType != PIM.EVENT_LIST && aPimListType != PIM.TODO_LIST) + { + throw new java.lang.IllegalArgumentException( + ErrorString.INVALID_LIST_TYPE_COLON + aPimListType); + } + + if (aMode != PIM.READ_ONLY && aMode != PIM.WRITE_ONLY && aMode != PIM.READ_WRITE) + { + throw new java.lang.IllegalArgumentException( + ErrorString.INVALID_MODE_COLON + aMode); + } + + // Both permissions must be checked separately if aMode is + // PIM.READ_WRITE + if (aMode == PIM.READ_WRITE) + { + // First ensure read access permission + // Get localized text info for the security dialog + getPermission(aPimListType, PIM.READ_ONLY); + getPermission(aPimListType, PIM.WRITE_ONLY); + + } + else + { + getPermission(aPimListType, aMode); + } + int[] error = new int[1]; + + int listHandle = _openPIMList( + iManagerHandle, aPimListType, aName, aCalName, error); + // list + NativeError.handleOpenPIMListError(error[0], aPimListType, aName); + + // Create new pim list of right type + PIMListImpl pimList = null; + + switch (aPimListType) + { + case PIM.CONTACT_LIST: + { + pimList = new ContactListImpl(listHandle, aMode); + break; + } + + case PIM.EVENT_LIST: + { + pimList = new EventListImpl(listHandle, aMode); + break; + } + + case PIM.TODO_LIST: + { + pimList = new ToDoListImpl(listHandle, aMode); + break; + } + + default: + { + // We should never end up here + throw new PIMException(ErrorString.GENERAL_ERROR, + PIMException.GENERAL_ERROR); + } + } + + return pimList; + } // Native operations @@ -398,11 +702,33 @@ * value on error. */ private native int _openPIMList(int aManagerHandle, int aPimListType, - String aPimListName, int[] aError); + String aPimListName, String aCalName, + int[] aError); private native String[] _listPIMLists(int aManagerHandle, int aPimListType, int[] aError); + private native String[] _listCalendars(int aManagerHandle, int[] aError); + + private native String[] _listCalendarNames(int aManagerHandle, int[] aError); + + private native int _createCalendar(int aManagerHandle, String aCalName, String aDisplayName); + + private native int _deleteCalendar(int aManagerHandle, String aCalName); + + class CalendarListInfo + { + + String iCalName; + Vector iList; + + CalendarListInfo(String aCalName, PIMList aPIMList) + { + iCalName = aCalName; + iList = new Vector(); + iList.addElement(aPIMList); + } + } } // End of file diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMPermissionImpl.java --- a/javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMPermissionImpl.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/javasrc/com/nokia/mj/impl/pim/PIMPermissionImpl.java Wed Sep 15 12:05:25 2010 +0300 @@ -96,7 +96,7 @@ { return (SecurityPromptMessage.getInstance()).getText( SecurityPromptMessage.QUESTION_ID_DELETING_ITEM, - new String[] {iListName}); + new String[] {iItemInfo, iListName}); } } else if (iOperation == OPERATION_ITEM_COMMIT) @@ -111,7 +111,7 @@ { return (SecurityPromptMessage.getInstance()).getText( SecurityPromptMessage.QUESTION_ID_UPDATING_ITEM, - new String[] {iListName}); + new String[] {iItemInfo, iListName}); } } else if (iOperation == OPERATION_CATEGORY_DELETION) diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/javasrc/com/nokia/mj/impl/properties/pim/DynamicPropertyHandler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaextensions/pim/javasrc/com/nokia/mj/impl/properties/pim/DynamicPropertyHandler.java Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,67 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +package com.nokia.mj.impl.properties.pim; + +import com.nokia.mj.impl.pim.PIMManager; +import com.nokia.mj.impl.pim.Calendar; +import com.nokia.mj.impl.rt.support.SystemPropertyProvider; + +/** + * This class implements SystemPropertyProvider and provides getProperty to + * retrieve dynamic system property. + */ +public final class DynamicPropertyHandler implements SystemPropertyProvider +{ + + public String getProperty(String key) + { + + //Code for list calendars - Call Open PIM List + // MIDlet should know about its own calendars, but we could offer also system property (e.g.) com.nokia.mid.calendars, which lists comma-separated local calendarnames: + // String calendarNames = System.getProperty("com.nokia.mid.calendars"); + + PIMManager pim = new PIMManager(); + + Calendar calendarList[] = pim.listCalendars(); + + StringBuffer calendarListString = new StringBuffer();; + + if (calendarList != null) + { + for (int i = 0; i < calendarList.length; i++) + { + calendarListString.append(calendarList[i].getCalendarName()+","); + + } + } + else + { + return null; + } + pim = null; + calendarListString.deleteCharAt(calendarListString.length() - 1); + return calendarListString.toString(); + } + + public boolean isStatic(String key) + { + return false; + } + +} \ No newline at end of file diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/javasrc/javax/microedition/pim/PIM.java --- a/javaextensions/pim/javasrc/javax/microedition/pim/PIM.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/javasrc/javax/microedition/pim/PIM.java Wed Sep 15 12:05:25 2010 +0300 @@ -80,20 +80,63 @@ { } + /** + * @param aPimListType which list user want to open Ex.CONTACT_LIST, EVENT_LIST, or TODO_LIST. + * @param aMode list open mode READ_ONLY or WRITE_ONLY or READ_WRITE + * @return PIMList + * @throws javax.microedition.pim.PIMException + */ public abstract PIMList openPIMList(int aPimListType, int aMode) throws PIMException; + /** + * + * @param aPimListType aPimListType which list user want to open Ex.CONTACT_LIST, EVENT_LIST, or TODO_LIST. + * @param aMode list open mode READ_ONLY or WRITE_ONLY or READ_WRITE + * @param aName List name + * @return PIMList + * @throws javax.microedition.pim.PIMException + */ public abstract PIMList openPIMList(int aPimListType, int aMode, String aName) throws PIMException; + /** + * + * @param aPimListType aPimListType which list user want to open Ex.CONTACT_LIST, EVENT_LIST, or TODO_LIST. + * @return String which contains list of PIMList names + */ public abstract String[] listPIMLists(int aPimListType); + /** + * @param aIs an inputstream object containing PIM information + * @param aEnc encoding of the characters in the input stream + * @return PIMItem Array + * @throws javax.microedition.pim.PIMException + * @throws java.io.UnsupportedEncodingException + */ public abstract PIMItem[] fromSerialFormat(java.io.InputStream aIs, String aEnc) throws PIMException, UnsupportedEncodingException; + /** + * + * @param aItem the item to export + * @param aOs the OutputStream object that where is written to as a character stream. + * @param aEnc encoding of the characters in the input stream + * @param aDataFormat PIM data format to use + * @throws javax.microedition.pim.PIMException + * @throws java.io.UnsupportedEncodingException + */ public abstract void toSerialFormat(PIMItem aItem, java.io.OutputStream aOs, String aEnc, String aDataFormat) throws PIMException, UnsupportedEncodingException; + /** + * + * @param aPimListType which list user want to open Ex.CONTACT_LIST, EVENT_LIST, or TODO_LIST. + * @return String object + */ public abstract String[] supportedSerialFormats(int aPimListType); + + + } diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/jni/src/pimmanager.cpp --- a/javaextensions/pim/jni/src/pimmanager.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/jni/src/pimmanager.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -69,6 +69,7 @@ jint aManagerHandle, jint aPimListType, jstring aPimListName, + jstring aCalName, jintArray aError) { JELOG2(EPim); @@ -77,13 +78,15 @@ int error = 0; try { + list = manager->openPimList( - static_cast< TPIMListType>(aPimListType),aPimListName, aJniEnv); + static_cast< TPIMListType>(aPimListType),aPimListName,aCalName, aJniEnv); } catch (int aError) { error = aError; } + SetJavaErrorCode(aJniEnv, aError, error); // We now own the list (through the handle). The ownership of @@ -114,6 +117,86 @@ return javaStringArray; } +JNIEXPORT jint +JNICALL Java_com_nokia_mj_impl_pim_PIMManager__1createCalendar( + JNIEnv* aJniEnv, + jobject /*aPeer*/, + jint aManagerHandle, + jstring aCalName, + jstring aDisplayName) +{ + JELOG2(EPim); + pimbasemanager* manager = + reinterpret_cast< pimbasemanager *>(aManagerHandle); + TInt error = 0; + try + { + manager->createCalendar(aCalName, aDisplayName,aJniEnv); + } + catch (int aError) + { + error = aError; + } + return error; +} + +JNIEXPORT jint +JNICALL Java_com_nokia_mj_impl_pim_PIMManager__1deleteCalendar( + JNIEnv* aJniEnv, + jobject /*aPeer*/, + jint aManagerHandle, + jstring aCalName) +{ + JELOG2(EPim); + pimbasemanager* manager = + reinterpret_cast< pimbasemanager *>(aManagerHandle); + TInt error = 0; + + try + { + manager->deleteCalendar(aCalName,aJniEnv); + } + catch (int aError) + { + error = aError; + } + + return error; + +} + +JNIEXPORT jobjectArray +JNICALL Java_com_nokia_mj_impl_pim_PIMManager__1listCalendars( + JNIEnv* aJniEnv, + jobject /*aPeer*/, + jint aManagerHandle, + jintArray aError) +{ + JELOG2(EPim); + pimbasemanager* manager = + reinterpret_cast< pimbasemanager *>(aManagerHandle); + jobjectArray javaStringArray = NULL; + javaStringArray = manager->listCalendars(aError, + aJniEnv); + return javaStringArray; +} + +JNIEXPORT jobjectArray +JNICALL Java_com_nokia_mj_impl_pim_PIMManager__1listCalendarNames( + JNIEnv* aJniEnv, + jobject /*aPeer*/, + jint aManagerHandle, + jintArray aError) +{ + JELOG2(EPim); + pimbasemanager* manager = + reinterpret_cast< pimbasemanager *>(aManagerHandle); + + jobjectArray javaStringArray = NULL; + javaStringArray = manager->listCalendarNames(aError, + aJniEnv); + return javaStringArray; +} // End of File diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/versit/src.s60/cpimcalendarconverter.cpp --- a/javaextensions/pim/versit/src.s60/cpimcalendarconverter.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/versit/src.s60/cpimcalendarconverter.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -30,7 +30,7 @@ #include "cpimeventpropertyconverter.h" #include "fs_methodcall.h" #include "logger.h" -#include "javasymbianoslayer.h" +#include "cleanupresetanddestroy.h" // EXTERNAL INCLUDES #include @@ -165,8 +165,6 @@ RPointerArray& aItemArray, Versit::TVersitCharSet aCharset) { JELOG2(EPim); - - CParserVCal* parser = CParserVCal::NewL(); CleanupStack::PushL(parser); parser->SetDefaultCharSet(aCharset); @@ -201,8 +199,6 @@ } } CleanupStack::PopAndDestroy(3, parser); // parser, eventArray, todoArray - - } // ----------------------------------------------------------------------------- @@ -242,7 +238,7 @@ RPointerArray& aItemArray) { JELOG2(EPim); - + CleanupClosePushL(aItemArray); CPIMEventItem* item = CPIMEventItem::NewLC(iEventValidator); TPIMDate alarm(TInt64(0)); // We don't take the ownership of the propertyArray, so the properties @@ -269,7 +265,6 @@ item->addInt(EPIMEventAlarm, KPIMAttrNone, interval.Int()); } } - CleanupClosePushL(aItemArray); User::LeaveIfError(aItemArray.Append(item)); CleanupStack::Pop(item); // item CleanupStack::Pop(&aItemArray); @@ -284,7 +279,7 @@ RPointerArray& aItemArray) { JELOG2(EPim); - + CleanupClosePushL(aItemArray); CPIMToDoItem* item = CPIMToDoItem::NewLC(iToDoValidator); TPIMDate alarm(TInt64(0)); // We don't take the ownership of the propertyArray, so the properties @@ -319,7 +314,6 @@ { item->AddBooleanL(EPIMToDoCompleted, KPIMAttrNone, ETrue); } - CleanupClosePushL(aItemArray); User::LeaveIfError(aItemArray.Append(item)); CleanupStack::Pop(item); // item CleanupStack::Pop(&aItemArray); diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/versit/src.s60/cpimcardconverter.cpp --- a/javaextensions/pim/versit/src.s60/cpimcardconverter.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/versit/src.s60/cpimcardconverter.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -26,7 +26,7 @@ #include "cpimcardpropertyconverter.h" #include "fs_methodcall.h" #include "logger.h" -#include "javasymbianoslayer.h" +#include "cleanupresetanddestroy.h" #include // ============================ MEMBER FUNCTIONS =============================== diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/versit/src.s60/cpimeventpropertyconverter.cpp --- a/javaextensions/pim/versit/src.s60/cpimeventpropertyconverter.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/versit/src.s60/cpimeventpropertyconverter.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -27,7 +27,7 @@ #include "cpimitem.h" #include "cpimeventitem.h" #include "mpimrepeatruledata.h" -#include "javasymbianoslayer.h" +#include "cleanupresetanddestroy.h" #include "logger.h" // EXTERNAL INCLUDES diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/pim/versit/src.s60/cpimversit.cpp --- a/javaextensions/pim/versit/src.s60/cpimversit.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/pim/versit/src.s60/cpimversit.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -22,7 +22,7 @@ #include "cpimcardconverter.h" #include "cpimcalendarconverter.h" #include "cpimitem.h" -#include "javasymbianoslayer.h" +#include "cleanupresetanddestroy.h" #include "logger.h" #include // RBufWriteStream #include diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/satsa/build/javasatsa.pro --- a/javaextensions/satsa/build/javasatsa.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/satsa/build/javasatsa.pro Wed Sep 15 12:05:25 2010 +0300 @@ -64,7 +64,6 @@ -lcms \ -leiksrv \ -lctframework \ - -lctsecdlgs \ -lcustomapi \ -lefsrv \ -letel \ @@ -79,9 +78,11 @@ contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_5_0) { LIBS += -laknnotify \ + -lctsecdlgs \ } contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_9_2) { LIBS += -laknnotify \ + -lctsecdlgs \ } } diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/satsa/build/javasatsa_0x2002DCCE.mmp --- a/javaextensions/satsa/build/javasatsa_0x2002DCCE.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/satsa/build/javasatsa_0x2002DCCE.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -165,7 +166,6 @@ LIBRARY cms.lib LIBRARY eiksrv.lib LIBRARY ctframework.lib -LIBRARY ctsecdlgs.lib LIBRARY customapi.lib LIBRARY efsrv.lib LIBRARY etel.lib @@ -177,6 +177,7 @@ LIBRARY estlib.lib LIBRARY cryptography.lib LIBRARY aknnotify.lib +LIBRARY ctsecdlgs.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib @@ -203,7 +204,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/sensor/build/javasensor_0x2002DCD0.mmp --- a/javaextensions/sensor/build/javasensor_0x2002DCD0.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/sensor/build/javasensor_0x2002DCD0.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -117,7 +118,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/subsystem.mk --- a/javaextensions/subsystem.mk Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/subsystem.mk Wed Sep 15 12:05:25 2010 +0300 @@ -44,6 +44,10 @@ wma \ pim +ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS + COMPONENTS += centralrepository/build +endif + ifdef RD_JAVA_MIDPRMS_DB SUBSYSTEMS += midprms_db else diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/webservices/build/javawebservices_0x2002DCDB.mmp --- a/javaextensions/webservices/build/javawebservices_0x2002DCDB.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/webservices/build/javawebservices_0x2002DCDB.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -91,7 +92,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/wma/mms/build/javawmamms.pro --- a/javaextensions/wma/mms/build/javawmamms.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/wma/mms/build/javawmamms.pro Wed Sep 15 12:05:25 2010 +0300 @@ -27,7 +27,7 @@ ../src.s60/*.cpp LIBS += -lapmime \ - -lPlatformEnv \ + -lplatformenv \ -lcharconv \ -lCommonUI \ -lefsrv \ diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/wma/mms/build/javawmamms_0x2002DCDD.mmp --- a/javaextensions/wma/mms/build/javawmamms_0x2002DCDD.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/wma/mms/build/javawmamms_0x2002DCDD.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -78,7 +79,7 @@ LIBRARY apmime.lib -LIBRARY PlatformEnv.lib +LIBRARY platformenv.lib LIBRARY charconv.lib LIBRARY CommonUI.lib LIBRARY efsrv.lib @@ -116,7 +117,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/wma/mms/pushplugin/build/javammsscplugin_0x2002DCC1.mmp --- a/javaextensions/wma/mms/pushplugin/build/javammsscplugin_0x2002DCC1.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/wma/mms/pushplugin/build/javammsscplugin_0x2002DCC1.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -106,7 +107,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/wma/sms_cbs/build/javawma_0x2002DCDC.mmp --- a/javaextensions/wma/sms_cbs/build/javawma_0x2002DCDC.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/wma/sms_cbs/build/javawma_0x2002DCDC.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -112,7 +113,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/wma/sms_cbs/pushplugin/cbs/build/javacbsscplugin_0x2002DCA4.mmp --- a/javaextensions/wma/sms_cbs/pushplugin/cbs/build/javacbsscplugin_0x2002DCA4.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/wma/sms_cbs/pushplugin/cbs/build/javacbsscplugin_0x2002DCA4.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -117,7 +118,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaextensions/wma/sms_cbs/pushplugin/sms/build/javasmsscplugin_0x2002DCD3.mmp --- a/javaextensions/wma/sms_cbs/pushplugin/sms/build/javasmsscplugin_0x2002DCD3.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaextensions/wma/sms_cbs/pushplugin/sms/build/javasmsscplugin_0x2002DCD3.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -114,7 +115,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/debugapi/build/debugapi_0x2002DCAB.mmp --- a/javamanager/debugapi/build/debugapi_0x2002DCAB.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/debugapi/build/debugapi_0x2002DCAB.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -103,7 +104,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javaappschemeplugin/build/javaappschemeplugin.mmp --- a/javamanager/javaappschemeplugin/build/javaappschemeplugin.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javaappschemeplugin/build/javaappschemeplugin.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -40,6 +40,10 @@ START RESOURCE ../data/2002875F.rss TARGET javaappschemeplugin.rsc END +START RESOURCE ../data/2002875F_iad.rss +TARGET javaappschemeplugin.rsc +TARGETPATH resource/java/iad +END USERINCLUDE ../inc diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javaappschemeplugin/data/2002875F.rss --- a/javamanager/javaappschemeplugin/data/2002875F.rss Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javaappschemeplugin/data/2002875F.rss Wed Sep 15 12:05:25 2010 +0300 @@ -21,6 +21,10 @@ // RESOURCE DEFINITIONS +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 1 +#endif + RESOURCE REGISTRY_INFO theInfo { resource_format_version = RESOURCE_FORMAT_VERSION_2; @@ -42,7 +46,7 @@ { // KJavaLocalAppHandlerEcomImplUid implementation_uid = 0x20028767; - version_no = 1; + version_no = ECOM_VERSION_NO; display_name = "URL handler for javaapp scheme"; default_data = "javaapp"; opaque_data = ""; diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javaappschemeplugin/data/2002875F_iad.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javaappschemeplugin/data/2002875F_iad.rss Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 2 + +// Include actual rss +#include "2002875F.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javabackup/midp2backup/build/midp2backupplugin.mmp --- a/javamanager/javabackup/midp2backup/build/midp2backupplugin.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javabackup/midp2backup/build/midp2backupplugin.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -50,9 +50,13 @@ USERINCLUDE ../../inc.s60 USERINCLUDE ../../../../inc -start resource ../data/10282474.rss +START RESOURCE ../data/10282474.rss TARGET midp2backupplugin.rsc -end +END +START RESOURCE ../data/10282474_iad.rss +TARGET midp2backupplugin.rsc +TARGETPATH resource/java/iad +END LIBRARY ecom.lib LIBRARY estor.lib diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javabackup/midp2backup/data/10282474.rss --- a/javamanager/javabackup/midp2backup/data/10282474.rss Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javabackup/midp2backup/data/10282474.rss Wed Sep 15 12:05:25 2010 +0300 @@ -19,6 +19,10 @@ #include #include "javauids.h" +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 1 +#endif + // Declares info for one implementation RESOURCE REGISTRY_INFO theInfo { @@ -36,7 +40,7 @@ IMPLEMENTATION_INFO { implementation_uid = KBackupEcomImplUid; - version_no = 1; + version_no = ECOM_VERSION_NO; display_name = "MIDP2 Backup Plugin"; default_data = "midp2"; opaque_data = "test_params"; diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javabackup/midp2backup/data/10282474_iad.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup/data/10282474_iad.rss Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 2 + +// Include actual rss +#include "10282474.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.cpp --- a/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -39,6 +39,9 @@ using namespace java::storage; using namespace java::backup; +const wchar_t * const JBNULLSTRING = L"ABBAABBA_NULL"; +const int JBNULLSTRINGLENGTH = -1; + // ======== MEMBER FUNCTIONS ======== CStorageBackupUtil::CStorageBackupUtil() @@ -82,60 +85,134 @@ // clear the vectors to free all the heap data. iStringVector.clear(); + if (iBufForJavaStorageItemsPtr) + { + delete iBufForJavaStorageItemsPtr; + iBufForJavaStorageItemsPtr = 0; + } + } void CStorageBackupUtil::BackupStorageDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft) { - LOG(EBackup, EInfo, "CStorageBackupUtil::BackupStorageDataL"); + ILOG(EBackup, "CStorageBackupUtil::BackupStorageDataL()"); iBufferSpaceLeft = aBufferSpaceLeft; if (iFirstCalltoBackupStorageData) { + ILOG(EBackup, "First call to BackupStorageData()"); int err = FillVectorWithStorageData(); if (err != KErrNone) { + ELOG1(EBackup, "Error (%d) in filling wstring vector", err); User::Leave(err); } - LOG1(EBackup, EInfo, "Total no of rows in vector: %d", iStringVector.size()); + ILOG1(EBackup, "Total no of rows in vector: %d", iStringVector.size()); - // First write the total no of rows in the vector to the stream + // 1. Find out the size of the buffer needed for containing JavaStorage + // data in "streamed" format. + TUint totalStringLengthInBytes = 0; + for (int i = 0; i < iStringVector.size(); ++i) + { + if (iStringVector[i] == JBNULLSTRING ){ + continue; + } + totalStringLengthInBytes += iStringVector[i].length()*sizeof(wchar_t); + } + ILOG1(EBackup, "Total string length calculated: %d", totalStringLengthInBytes); - aStream.WriteInt32L(iStringVector.size()); - iBufferSpaceLeft -= sizeof(TInt32); + // Calculate the total length of the buffer. + // The content of the buffer will be as follows: + + TUint totalBuffSize = sizeof(TInt32) + NUMBER_OF_TABLES*sizeof(TInt16) + + iStringVector.size()*sizeof(TInt16) + totalStringLengthInBytes; + + // 2. Reserve the buffer with adequate space + iBufForJavaStorageItemsPtr = HBufC8::NewL(totalBuffSize); + ILOG1(EBackup, "javaStorage Buffer(size %d) allocated SUCCESSFULLY", totalBuffSize); - /* Then write the number of rows in each table to the stream. - This will be used while writing the data to storage. */ - - for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; tableNumber++) + // 3. Create temporary stream operator and with it write stuff to buffer + TPtr8 buffPtr(iBufForJavaStorageItemsPtr->Des()); + RDesWriteStream buffStream(buffPtr); + CleanupClosePushL(buffStream); + buffStream.WriteInt32L(iStringVector.size()); + for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; ++tableNumber) + { + buffStream.WriteInt16L(iTableSize[tableNumber]); + } + ILOG(EBackup, "JavaStorage table sizes writen to buffer"); + TUint writenStringLength = 0; + for (int i = 0; i < iStringVector.size(); ++i) { - aStream.WriteInt16L(iTableSize[tableNumber]); - iBufferSpaceLeft -= sizeof(TInt16); + TInt16 lenOf8byteString = JBNULLSTRINGLENGTH; + if ( iStringVector[i] == JBNULLSTRING ) + { + buffStream.WriteInt16L(lenOf8byteString); + continue; + } + lenOf8byteString = iStringVector[i].length()*sizeof(wchar_t); + buffStream.WriteInt16L(lenOf8byteString); + if (lenOf8byteString > 0 ) + { + HBufC* tempstring = java::util::S60CommonUtils::wstringToDes( + iStringVector[i].c_str()); + if (!tempstring) + { + ELOG(EBackup, "Out of memory in JavaStorage backup(in wstring -> des conv)!"); + User::Leave(KErrNoMemory); + } + CleanupStack::PushL(tempstring); + TPtrC tempStr = tempstring->Des(); + writenStringLength += tempStr.Size(); + buffStream.WriteL(tempStr); //length of the string will not be written + CleanupStack::PopAndDestroy(tempstring); + } } + ILOG1(EBackup, "Total string length writen: %d", writenStringLength); + ILOG(EBackup, "Whole Java Storage String vector writen to streambuffer"); + // 4. Clear not needed resources + iStringVector.clear(); + CleanupStack::PopAndDestroy(&buffStream); + ILOG(EBackup, "Not needed resources cleared"); + + // 5. Set the read pointer to the beginning of the buffer data + // Note that the length of the HBufC8 buffer is exact. + iBuffReadPointer.Set(iBufForJavaStorageItemsPtr->Des()); iFirstCalltoBackupStorageData = EFalse; } - // Now write the actual string data into the stream. - - while (iBufferSpaceLeft > 0 && iStrCount < iStringVector.size()) + // 6. Start to provide data to SBE from the buffer. + ILOG(EBackup, "Extracting data from buffer to SBE"); + ILOG1(EBackup, "Length of the data in stream buffer: %d", iBuffReadPointer.Length()); + ILOG1(EBackup, "Space available in SBE buffer: %d", aBufferSpaceLeft); + if (iBuffReadPointer.Length() <= aBufferSpaceLeft ) { - WriteStringtoStreamL(aStream, iStringVector[iStrCount]); - LOG1(EBackup, EInfo, "StrCount = %d", iStrCount); + aStream.WriteL(iBuffReadPointer); + aBufferSpaceLeft -= iBuffReadPointer.Length(); + iBuffReadPointer.Set(NULL,0); + delete iBufForJavaStorageItemsPtr; + iBufForJavaStorageItemsPtr = 0; + ILOG(EBackup, "BACKUP OF STORAGE DATA FINISHED"); + aBackupNotFinished = EFalse; // Indicate to caller that we are ready } - - if (iStrCount >= iStringVector.size()) + else // All data from internal buffer does not fit at once to buffer received from SBE { - LOG(EBackup, EInfo, "Backup of storage data finished"); - aBackupNotFinished = EFalse; + aStream.WriteL(iBuffReadPointer, aBufferSpaceLeft); + TInt lengthOfWritenData = aBufferSpaceLeft; + iBuffReadPointer.Set(iBuffReadPointer.Ptr() + lengthOfWritenData, + iBuffReadPointer.Length() - lengthOfWritenData); + aBufferSpaceLeft = 0; + ILOG(EBackup, "Not all of the storage data fit into SBE buffer, new buffer from SBE needed."); } } void CStorageBackupUtil::RestoreStorageDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft) { - LOG(EBackup, EInfo, "CStorageBackupUtil::RestoreStorageDataL()"); + ILOG(EBackup, "+CStorageBackupUtil::RestoreStorageDataL()"); iBufferSpaceLeft = aBufferSpaceLeft; @@ -177,49 +254,11 @@ updater.update(); // Storage restore is over; Set state to EAppArc + ILOG(EBackup, "JAVASTORAGE RESTORED SUCCESSFULLY"); aRestoreState = EAppArc; aBufferSpaceLeft = iBufferSpaceLeft; } -} - - -void CStorageBackupUtil::WriteStringtoStreamL(RDesWriteStream& aStream, wstring aStr) -{ - iLenOfString = aStr.length(); - - // if length of string is 0, do not write any string to the stream. - if (iLenOfString == 0) - { - aStream.WriteInt16L(iLenOfString*2); - iBufferSpaceLeft -= sizeof(TInt16); - iStrCount++; - } - - else - { - /* if space is not enough for writing the complete string, - do not write it. Could be written next time. */ - if (((iLenOfString*2) + sizeof(TInt16)) > iBufferSpaceLeft) - { - LOG(EBackup, EInfo, "Stream size is not enough to hold the string"); - // set the bufferspaceleft to zero - iBufferSpaceLeft = 0; - } - // stream has enough space for the length and the string data. - else - { - aStream.WriteInt16L(iLenOfString*2); - iBufferSpaceLeft -= sizeof(TInt16); - - HBufC* tempstr = java::util::S60CommonUtils::wstringToDes(aStr.c_str()); - TPtrC tempStr = tempstr->Des(); - aStream.WriteL(tempStr); - iBufferSpaceLeft -= (iLenOfString*2); - delete tempstr; - - iStrCount++; - } - } + ILOG(EBackup, "-CStorageBackupUtil::RestoreStorageDataL()"); } void CStorageBackupUtil::ReadStringfromStreamL(RDesReadStream& aStream) @@ -271,7 +310,7 @@ } } - else + else /* handling new string */ { iLenOfString = aStream.ReadInt16L(); iBufferSpaceLeft -= sizeof(TInt16); @@ -326,6 +365,12 @@ delete data; } } + /* */ + else if (iLenOfString == JBNULLSTRINGLENGTH ) + { + iStringVector.push_back(JBNULLSTRING); + iStrCount--; + } /* if length of string is 0, do not read anything from the stream; just push an empty string into the vector */ else @@ -657,6 +702,20 @@ } +void CStorageBackupUtil::WriteItemToStorageEntry( + const std::wstring& aEntryName, + const std::wstring& aEntryValue, + JavaStorageApplicationEntry_t& aInsertEntry + ) +{ + JavaStorageEntry attribute; + if (aEntryValue != JBNULLSTRING ) + { + attribute.setEntry(aEntryName, aEntryValue); + aInsertEntry.insert(attribute); + } +} + int CStorageBackupUtil::WriteDataToStorage() { JELOG2(EBackup); @@ -706,7 +765,7 @@ js->remove(RUNTIME_SETTINGS_TABLE, emptyEntry); js->remove(PREINSTALL_TABLE, emptyEntry); - ILOG(EBackup, "Data removed successfully from table"); + ELOG(EBackup, "Data removed successfully from table"); } catch (JavaStorageException jse) { @@ -716,7 +775,6 @@ } } - JavaStorageEntry attribute; JavaStorageApplicationEntry_t insertEntry; ILOG(EBackup, "Start transaction for writing into the database"); @@ -728,47 +786,20 @@ for (int rowNumber = 0; rowNumber < iTableSize[0]; rowNumber++) { - attribute.setEntry(ID, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(PACKAGE_NAME, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(VENDOR, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(VERSION, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(ROOT_PATH, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(MEDIA_ID, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(INITIAL_SIZE, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(JAD_PATH, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(JAR_PATH, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(JAD_URL, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(JAR_URL, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(ACCESS_POINT, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(CONTENT_INFO, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(CONTENT_ID, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(PACKAGE_NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VENDOR, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VERSION, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ROOT_PATH, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(MEDIA_ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(INITIAL_SIZE, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(JAD_PATH, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(JAR_PATH, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(JAD_URL, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(JAR_URL, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ACCESS_POINT, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CONTENT_INFO, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CONTENT_ID, iStringVector[count++], insertEntry); try { @@ -791,20 +822,11 @@ for (int rowNumber = 0; rowNumber < iTableSize[1]; rowNumber++) { - attribute.setEntry(ID, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(PACKAGE_ID, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(NAME, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(MAIN_CLASS, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(AUTORUN, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(PACKAGE_ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(MAIN_CLASS, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(AUTORUN, iStringVector[count++], insertEntry); try { @@ -827,17 +849,10 @@ for (int rowNumber = 0; rowNumber < iTableSize[2]; rowNumber++) { - attribute.setEntry(ID, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(NAME, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(VALUE, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(TRUSTED, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VALUE, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(TRUSTED, iStringVector[count++], insertEntry); try { @@ -860,35 +875,16 @@ for (int rowNumber = 0; rowNumber < iTableSize[3]; rowNumber++) { - attribute.setEntry(ID, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(TYPE, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(SECURITY_DOMAIN, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(SECURITY_DOMAIN_CATEGORY, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(HASH, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(CERT_HASH, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(RMS, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(VALID_CERTS, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(ON_SCREEN_KEYPAD, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(SECURITY_WARNINGS, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(TYPE, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(SECURITY_DOMAIN, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(SECURITY_DOMAIN_CATEGORY, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(HASH, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CERT_HASH, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(RMS, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VALID_CERTS, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ON_SCREEN_KEYPAD, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(SECURITY_WARNINGS, iStringVector[count++], insertEntry); try { @@ -911,20 +907,11 @@ for (int rowNumber = 0; rowNumber < iTableSize[4]; rowNumber++) { - attribute.setEntry(ID, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(CLASS, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(NAME, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(ACTION, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(FUNCTION_GROUP, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CLASS, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ACTION, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(FUNCTION_GROUP, iStringVector[count++], insertEntry); try { @@ -947,20 +934,11 @@ for (int rowNumber = 0; rowNumber < iTableSize[5]; rowNumber++) { - attribute.setEntry(ID, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(FUNCTION_GROUP, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(ALLOWED_SETTINGS, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(CURRENT_SETTING, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(BLANKET_PROMPT, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(FUNCTION_GROUP, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ALLOWED_SETTINGS, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CURRENT_SETTING, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(BLANKET_PROMPT, iStringVector[count++], insertEntry); try { @@ -983,20 +961,11 @@ for (int rowNumber = 0; rowNumber < iTableSize[6]; rowNumber++) { - attribute.setEntry(ID, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(URL, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(NAME, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(FILTER, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(REGISTRATION_TYPE, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(URL, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(FILTER, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(REGISTRATION_TYPE, iStringVector[count++], insertEntry); try { @@ -1019,11 +988,8 @@ for (int rowNumber = 0; rowNumber < iTableSize[7]; rowNumber++) { - attribute.setEntry(ID, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(ALARM_TIME, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(ALARM_TIME, iStringVector[count++], insertEntry); try { @@ -1047,8 +1013,7 @@ for (int rowNumber = 0; rowNumber < iTableSize[8]; rowNumber++) { - attribute.setEntry(EXTENSIONS, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(EXTENSIONS, iStringVector[count++], insertEntry); try { @@ -1071,17 +1036,10 @@ for (int rowNumber = 0; rowNumber < iTableSize[9]; rowNumber++) { - attribute.setEntry(NAME, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(VENDOR, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(VERSION, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(INSTALL_STATE, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(NAME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VENDOR, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(VERSION, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(INSTALL_STATE, iStringVector[count++], insertEntry); try { @@ -1170,26 +1128,13 @@ for (int rowNumber = 0; rowNumber < iTableSize[10]; rowNumber++) { - attribute.setEntry(ID, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(CREATION_TIME, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(TYPE, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(OTA_CODE, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(URL, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(LATEST_RETRY_TIME, iStringVector[count++]); - insertEntry.insert(attribute); - - attribute.setEntry(RETRY_COUNT, iStringVector[count++]); - insertEntry.insert(attribute); + WriteItemToStorageEntry(ID, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(CREATION_TIME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(TYPE, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(OTA_CODE, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(URL, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(LATEST_RETRY_TIME, iStringVector[count++], insertEntry); + WriteItemToStorageEntry(RETRY_COUNT, iStringVector[count++], insertEntry); try { @@ -1247,144 +1192,46 @@ for (applications = foundEntries.begin(); applications != foundEntries.end(); applications++) { attribute.setEntry(ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(PACKAGE_NAME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VENDOR, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VERSION, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ROOT_PATH, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(MEDIA_ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(INITIAL_SIZE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(JAD_PATH, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(JAR_PATH, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(JAD_URL, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(JAR_URL, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ACCESS_POINT, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CONTENT_INFO, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CONTENT_ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1408,54 +1255,19 @@ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) { attribute.setEntry(ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(PACKAGE_ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(NAME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(MAIN_CLASS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(AUTORUN, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1479,44 +1291,16 @@ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) { attribute.setEntry(ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(NAME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VALUE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(TRUSTED, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1524,6 +1308,24 @@ return rowsCount; } +void CStorageBackupUtil::FetchStorageEntryToStringVector(const JavaStorageEntry& aAttribute, + JavaStorageApplicationList_t::const_iterator& aApplicationsIter) +{ + const wstring emptyString; + wstring str; + JavaStorageApplicationEntry_t::const_iterator findIterator; + str = emptyString; + findIterator = (*aApplicationsIter).find(aAttribute); + + if (findIterator != (*aApplicationsIter).end()) + { + str = (*findIterator).entryValue(); + iStringVector.push_back(str); + } else { + iStringVector.push_back(JBNULLSTRING); + } +} + int CStorageBackupUtil::FillVectorwithMidpPackageTableData(JavaStorageApplicationList_t& afoundEntries) { const wstring emptyString; @@ -1534,110 +1336,39 @@ /* Initialise Iterators to iterate through all applications matched with search patterns. */ JavaStorageApplicationList_t::const_iterator applications; - JavaStorageApplicationEntry_t::const_iterator findIterator; int rowsCount=0; for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) { attribute.setEntry(ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(TYPE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(SECURITY_DOMAIN, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(SECURITY_DOMAIN_CATEGORY, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(HASH, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CERT_HASH, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(RMS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VALID_CERTS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ON_SCREEN_KEYPAD, L""); - str = emptyString; - findIterator = (*applications).find(attribute); + FetchStorageEntryToStringVector(attribute, applications); - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); - attribute.setEntry(SECURITY_WARNINGS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1661,54 +1392,19 @@ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) { attribute.setEntry(ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CLASS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(NAME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ACTION, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(FUNCTION_GROUP, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1732,54 +1428,19 @@ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) { attribute.setEntry(ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(FUNCTION_GROUP, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ALLOWED_SETTINGS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CURRENT_SETTING, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(BLANKET_PROMPT, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1803,54 +1464,19 @@ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) { attribute.setEntry(ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(URL, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(NAME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(FILTER, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(REGISTRATION_TYPE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1874,24 +1500,10 @@ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) { attribute.setEntry(ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(ALARM_TIME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1915,14 +1527,7 @@ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) { attribute.setEntry(EXTENSIONS, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -1946,44 +1551,16 @@ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) { attribute.setEntry(NAME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VENDOR, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(VERSION, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(INSTALL_STATE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } @@ -2007,74 +1584,25 @@ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++) { attribute.setEntry(ID, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(CREATION_TIME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(TYPE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(OTA_CODE, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(URL, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(LATEST_RETRY_TIME, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); attribute.setEntry(RETRY_COUNT, L""); - str = emptyString; - findIterator = (*applications).find(attribute); - - if (findIterator != (*applications).end()) - { - str = (*findIterator).entryValue(); - } - iStringVector.push_back(str); + FetchStorageEntryToStringVector(attribute, applications); rowsCount++; } diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.h --- a/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.h Wed Sep 15 12:05:25 2010 +0300 @@ -172,16 +172,6 @@ int FillVectorWithStorageData(); /** - * A utility function which converts a wstring into a TDesC - * and writes it into the stream. - * - * @param stream an RDesWriteStream into which the converted - * string is written - * @param tempString the wstring which is to be converted. - */ - void WriteStringtoStreamL(RDesWriteStream& aStream, std::wstring aTempString); - - /** * A utility function which reads a TDesC from the stream, converts it * to a wstring and writes it into the vector. * @@ -200,6 +190,17 @@ * has completed successfully or not. */ int WriteDataToStorage(); + + + void FetchStorageEntryToStringVector( + const java::storage::JavaStorageEntry& aAttribute, + java::storage::JavaStorageApplicationList_t::const_iterator& aApplicationsIter + ); + + void WriteItemToStorageEntry(const std::wstring& aEntryName, + const std::wstring& aEntryValue, + java::storage::JavaStorageApplicationEntry_t& aInsertEntry); + public: /** * Utility function which fills the vector with data got from storage. @@ -396,6 +397,19 @@ * Own */ int iBufferSpaceLeft; + + /** + * During backup data fromJavaStorage will be temporarily stored + * in serialised format in this buffer. + */ + HBufC8* iBufForJavaStorageItemsPtr; + + /** + * Stores the position in iBufForJavaStorageItemsPtr from where data is + * being read during backup operation. + */ + TPtrC8 iBuffReadPointer; + }; } // namespace backup diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javabackup/midp2backup/src.s60/midp2backupplugin.cpp --- a/javamanager/javabackup/midp2backup/src.s60/midp2backupplugin.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javabackup/midp2backup/src.s60/midp2backupplugin.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -125,7 +125,7 @@ void CMidp2BackupPlugin::GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished) { - LOG(EBackup, EInfo, "CMidp2BackupPlugin::GetBackupDataSectionL"); + ILOG(EBackup, "+CMidp2BackupPlugin::GetBackupDataSectionL()"); iBufferSpaceLeft = aBuffer.MaxLength(); RDesWriteStream stream(aBuffer); @@ -144,7 +144,7 @@ aFinished = EFalse; } - else + if (!iStorageDataBackup) { if (iFirstCallToGetBackupDataSection) { @@ -301,12 +301,13 @@ { aFinished = ETrue; iFirstCallToGetBackupDataSection = ETrue; - iStorageDataBackup = ETrue; + // iStorageDataBackup = ETrue; } delete fullFileName; } CleanupStack::PopAndDestroy(&stream); + ILOG(EBackup, "-CMidp2BackupPlugin::GetBackupDataSectionL()"); } @@ -318,7 +319,7 @@ void CMidp2BackupPlugin::RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished) { - LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreBaseDataSectionL"); + ILOG(EBackup, "+CMidp2BackupPlugin::RestoreBaseDataSectionL()"); iBufferSpaceLeft = aBuffer.Size(); RDesReadStream stream(aBuffer); @@ -349,6 +350,7 @@ if (iRestoreState == EStorage) { + ILOG1(EBackup, "Restoring Storage for drive %d", iDrive); iStorageBackupUtil -> RestoreStorageDataL(stream, iRestoreState, iBufferSpaceLeft); } @@ -372,12 +374,14 @@ if (aFinished) { // Set state to EStorage - iRestoreState = EStorage; + ILOG1(EBackup, "Restore of drive %d complete, resetting statemachine for next drive", iDrive); + iRestoreState = EAppArc; } } - aFinished = ETrue; + // aFinished = ETrue; CleanupStack::PopAndDestroy(&stream); + ILOG(EBackup, "-CMidp2BackupPlugin::RestoreBaseDataSectionL()"); } void CMidp2BackupPlugin::InitialiseRestoreIncrementDataL(TDriveNumber /* aDrive */) diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javabackup/midp2backup_usif/build/midp2backupplugin.mmp --- a/javamanager/javabackup/midp2backup_usif/build/midp2backupplugin.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javabackup/midp2backup_usif/build/midp2backupplugin.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -55,9 +55,13 @@ USERINCLUDE ../../inc.s60 USERINCLUDE ../../../../inc -start resource ../data/10282474.rss +START RESOURCE ../data/10282474.rss TARGET midp2backupplugin.rsc -end +END +START RESOURCE ../data/10282474_iad.rss +TARGET midp2backupplugin.rsc +TARGETPATH resource/java/iad +END LIBRARY ecom.lib LIBRARY efsrv.lib diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javabackup/midp2backup_usif/data/10282474.rss --- a/javamanager/javabackup/midp2backup_usif/data/10282474.rss Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javabackup/midp2backup_usif/data/10282474.rss Wed Sep 15 12:05:25 2010 +0300 @@ -19,6 +19,10 @@ #include #include "javauids.h" +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 1 +#endif + // Declares info for one implementation RESOURCE REGISTRY_INFO theInfo { @@ -36,7 +40,7 @@ IMPLEMENTATION_INFO { implementation_uid = KBackupEcomImplUid; - version_no = 1; + version_no = ECOM_VERSION_NO; display_name = "MIDP2 Backup Plugin"; default_data = "midp2"; opaque_data = "test_params"; diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javabackup/midp2backup_usif/data/10282474_iad.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javabackup/midp2backup_usif/data/10282474_iad.rss Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 2 + +// Include actual rss +#include "10282474.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javacaptain/build/javacaptain_0x200211DC.mmp --- a/javamanager/javacaptain/build/javacaptain_0x200211DC.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javacaptain/build/javacaptain_0x200211DC.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -47,6 +47,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -129,7 +130,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter_0x2002EA7E.mmp --- a/javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter_0x2002EA7E.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter_0x2002EA7E.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -100,7 +101,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javacaptain/extensionplugins/config/build/javacaptain_ext_config_0x2002DC9E.mmp --- a/javamanager/javacaptain/extensionplugins/config/build/javacaptain_ext_config_0x2002DC9E.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javacaptain/extensionplugins/config/build/javacaptain_ext_config_0x2002DC9E.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -101,7 +102,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore_0x2002DC9F.mmp --- a/javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore_0x2002DC9F.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore_0x2002DC9F.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -110,7 +111,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javacaptain/extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp --- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -100,7 +101,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro --- a/javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro Wed Sep 15 12:05:25 2010 +0300 @@ -20,7 +20,7 @@ CONFIG -= qt symbian { - LIBS += -lcommonengine \ + LIBS += -lCommonEngine \ -lcentralrepository \ -lcenrepnotifhandler \ -ljavacomms diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener_0x200315D8.mmp --- a/javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener_0x200315D8.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener_0x200315D8.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -73,7 +74,7 @@ SOURCE settingslistenerimpl.cpp -LIBRARY commonengine.lib +LIBRARY CommonEngine.lib LIBRARY centralrepository.lib LIBRARY cenrepnotifhandler.lib LIBRARY javacomms.lib @@ -107,7 +108,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javacaptain/extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin_0x2002DCA3.mmp --- a/javamanager/javacaptain/extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin_0x2002DCA3.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javacaptain/extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin_0x2002DCA3.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -100,7 +101,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp --- a/javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -40,6 +40,10 @@ START RESOURCE ../data/101F875F.rss TARGET ifeui.rsc END +START RESOURCE ../data/101F875F_iad.rss +TARGET ifeui.rsc +TARGETPATH resource/java/iad +END // Sources SOURCEPATH ../src diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/appinstuiplugin/data/101F875F.rss --- a/javamanager/javainstaller/appinstuiplugin/data/101F875F.rss Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/appinstuiplugin/data/101F875F.rss Wed Sep 15 12:05:25 2010 +0300 @@ -23,6 +23,10 @@ // RESOURCE DEFINITIONS +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 2 +#endif + RESOURCE REGISTRY_INFO registry_info { resource_format_version = RESOURCE_FORMAT_VERSION_2; @@ -42,8 +46,7 @@ IMPLEMENTATION_INFO { implementation_uid = KInstallerFrontEndEcomImplUid; - // Version number is 2 so that this implementation should override the old one in ROM - version_no = 2; + version_no = ECOM_VERSION_NO; display_name = "Midlet installation ui implementation"; default_data = "application/java-archive||text/vnd.sun.j2me.app-descriptor||application/x-java-archive||application/java"; opaque_data = " "; diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/appinstuiplugin/data/101F875F_iad.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/appinstuiplugin/data/101F875F_iad.rss Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 3 + +// Include actual rss +#include "101F875F.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/iconsizenotifplugin/build/javaiconsizenotifplugin.mmp --- a/javamanager/javainstaller/iconsizenotifplugin/build/javaiconsizenotifplugin.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/iconsizenotifplugin/build/javaiconsizenotifplugin.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -16,8 +16,12 @@ */ +#include <../../../../inc/project_defines.hrh> +#include #include +#include <../../../../inc/java_stdcpp_support_for_dll.hrh> + TARGET javaiconsizenotifplugin.dll TARGETTYPE PLUGIN @@ -33,6 +37,10 @@ START RESOURCE ../data/javaiconsizenotifplugin.rss TARGET javaiconsizenotifplugin.rsc END +START RESOURCE ../data/javaiconsizenotifplugin_iad.rss +TARGET javaiconsizenotifplugin.rsc +TARGETPATH resource/java/iad +END SOURCEPATH ../src SOURCE iconsizenotifier.cpp @@ -43,8 +51,8 @@ LIBRARY euser.lib LIBRARY eiksrv.lib // MEikSrvNotifierBase2 -LIBRARY cdlengine.lib // AknLayoutScalable_Avkon -LIBRARY aknlayout2scalable.lib // TAknWindowComponentLayout +LIBRARY CdlEngine.lib // AknLayoutScalable_Avkon +LIBRARY AknLayout2Scalable.lib // TAknWindowComponentLayout LIBRARY avkon.lib // TAknLayoutRect LIBRARY eikcore.lib // TAknLayoutRect diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/iconsizenotifplugin/data/javaiconsizenotifplugin.rss --- a/javamanager/javainstaller/iconsizenotifplugin/data/javaiconsizenotifplugin.rss Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/iconsizenotifplugin/data/javaiconsizenotifplugin.rss Wed Sep 15 12:05:25 2010 +0300 @@ -18,6 +18,10 @@ #include #include +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 1 +#endif + RESOURCE REGISTRY_INFO r_registry { resource_format_version = RESOURCE_FORMAT_VERSION_2; @@ -32,7 +36,7 @@ IMPLEMENTATION_INFO { implementation_uid = 0x101FD68A; - version_no = 1; + version_no = ECOM_VERSION_NO; display_name = "JavaIconSizeNotifPlugin"; default_data = ""; opaque_data = "0"; diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/iconsizenotifplugin/data/javaiconsizenotifplugin_iad.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/iconsizenotifplugin/data/javaiconsizenotifplugin_iad.rss Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 2 + +// Include actual rss +#include "javaiconsizenotifplugin.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/build/javainstaller_0x2002DCB4.mmp --- a/javamanager/javainstaller/installer/build/javainstaller_0x2002DCB4.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/build/javainstaller_0x2002DCB4.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -128,7 +129,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd 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 Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifNotifier.java Wed Sep 15 12:05:25 2010 +0300 @@ -18,8 +18,11 @@ package com.nokia.mj.impl.installer.applicationregistrator; +import com.nokia.mj.impl.installer.ui.InstallerUi; import com.nokia.mj.impl.installer.utils.InstallerException; import com.nokia.mj.impl.installer.utils.Log; +import com.nokia.mj.impl.installer.utils.PropertyListener; +import com.nokia.mj.impl.installer.utils.PropertyProvider; /** * Sends installation and uninstallation progress notifications @@ -28,24 +31,26 @@ public final class SifNotifier { /** Install operation. */ - public static final int OP_INSTALL = 1; + public static final int OP_INSTALL = 1; // TSifOperationPhase::EInstalling /** Uninstall operation. */ - public static final int OP_UNINSTALL = 2; + public static final int OP_UNINSTALL = 2; // TSifOperationPhase::EUninstalling /** Update operation. */ - public static final int OP_UPDATE = 3; + public static final int OP_UPDATE = 3; // TSifOperationPhase::EUpgrading - /** Indicates installaion or uninstallation without + /** Indicates installation or uninstallation without specific suboperation. */ - public static final int SUB_OP_NO = 1; + public static final int SUB_OP_NO = 1; // TSifOperationSubPhase::ENoSubPhase /** OCSP phase during installation. */ - public static final int SUB_OP_OCSP = 2; + public static final int SUB_OP_OCSP = 2; // TSifOperationSubPhase::EOCSPCheck /** Download phase during installation. */ - public static final int SUB_OP_DOWNLOAD = 3; + public static final int SUB_OP_DOWNLOAD = 3; // TSifOperationSubPhase::EDownload /** Maximum progress notification value. */ private static final int MAX_PROGRESS = 100; /** Operation being notified. */ private int iOperation = 0; + /** Suboperation during installation. */ + private int iSubOperation = 0; /** Global component id for the application. */ private String iGlobalComponentId = null; /** Component name (i.e. suite name). */ @@ -64,11 +69,26 @@ /** 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. */ + /** + * Value of the last progress notification that has been sent with + * SUB_OP_NO suboperation. + */ private int iLastProgressSent = 0; + /** Current value of the last progress notification that has been sent. */ + private int iCurrentValue = 0; + /** total value of the last progress notification that has been sent. */ + private int iTotalValue = 0; - /** Native object handle. */ + /** Native notifier object handle. */ private int iHandle = 0; + /** Native indicator object handle. */ + private int iIndicatorHandle = 0; + /** InstallerUi handle. */ + private InstallerUi iInstallerUi = null; + /** Provider for indicator status events. */ + private PropertyProvider iIndicatorStatusProvider = null; + /** Indicator state. */ + private int iIndicatorState = -1; /*** ----------------------------- PUBLIC ------------------------------ */ @@ -81,6 +101,164 @@ } /** + * Set InstallerUi used when handling indicator. + */ + public void setInstallerUi(InstallerUi aInstallerUi) + { + iInstallerUi = aInstallerUi; + } + + /** + * Activates and updates indicator which displays installation + * progress to user while installer UI is hidden. The notifyStart + * and notifyProgress methods must be called at least once before + * calling this method. + */ + public void activateIndicator() + { + if (iInstallerUi == null) + { + return; + } + + if (iIndicatorHandle == 0) + { + int ret = _initIndicator(); + if (ret < 0) + { + Log.logError( + "Initializing SifNotifier indicator failed with code " + + ret); + } + else + { + Log.log("SifNotifier indicator created"); + } + iIndicatorHandle = ret; + } + + if (iIndicatorHandle == 0) + { + return; + } + + int phase = 0; + switch (iSubOperation) + { + case SUB_OP_OCSP: phase = 2; break; // TInstallingPhase::ECheckingCerts + case SUB_OP_DOWNLOAD: phase = 1; break; // TInstallingPhase::EDownloading + default: phase = 0; // TInstallingPhase::EInstalling + } + int progress = (iTotalValue == 0? 0: iCurrentValue*100/iTotalValue); + updateIndicator(iComponentName, phase, progress); + + if (iIndicatorStatusProvider == null) + { + // Create PropertyListener which listens indicator status events + // and unhides UI when necessary. + final int indicatorCategory = 0x20022FC5; // sifuiinstallindicatorplugin + final int indicatorKey = 0x2002E690; // /SifUiInstallIndicator/Status + iIndicatorStatusProvider = new PropertyProvider(); + iIndicatorStatusProvider.subscribe( + indicatorCategory, indicatorKey, new PropertyListener() + { + public void valueChanged(int aCategory, int aKey, int aValue) + { + Log.log("SifNotifier indicator status " + aValue + + " (category=" + aCategory + ", key=" + aKey + ")"); + iIndicatorState = aValue; + if (iIndicatorState == 0) + { + // Indicator has been closed, unhide the UI. + iInstallerUi.hide(false); + } + } + }); + Log.log("SifNotifier indicator status provider subscribed"); + } + } + + /** + * Updates indicator which displays installation progress to user + * while installer UI is hidden. The activateindicator method must + * be called before calling this method. + */ + public void updateIndicator(String aName, int aPhase, int aProgress) + { + if (iInstallerUi == null || iIndicatorHandle == 0) + { + return; + } + + final String name = aName; + final int phase = aPhase; + final int progress = aProgress; + iInstallerUi.syncExec(new Runnable() + { + // Indicator must be updated from UI thread. + public void run() + { + int ret = _updateIndicator( + iIndicatorHandle, name, phase, progress); + if (ret < 0) + { + Log.logError( + "Updating SifNotifier indicator failed with code " + + ret); + } + else + { + Log.log("SifNotifier indicator updated: " + name + + ", " + phase + ", " + progress + "%"); + } + } + }); + } + + /** + * Deactivates indicator which displays installation + * progress to user while installer UI is hidden. + */ + public void deactivateIndicator() + { + if (iIndicatorStatusProvider != null) + { + iIndicatorStatusProvider.unsubscribe(); + iIndicatorStatusProvider = null; + Log.log("SifNotifier indicator status provider unsubscribed"); + } + + if (iInstallerUi == null) + { + return; + } + + iInstallerUi.syncExec(new Runnable() + { + // Indicator must be deactivated from UI thread. + public void run() + { + if (iIndicatorHandle == 0) + { + return; + } + int ret = _destroyIndicator(iIndicatorHandle, iIndicatorState); + if (ret < 0) + { + Log.logError( + "Destroying SifNotifier indicator failed with code " + + ret); + } + else + { + Log.log("SifNotifier indicator destroyed"); + } + iIndicatorHandle = 0; + } + }); + } + + /** * Returns true if SIF progress notifications are enabled, false otherwise. */ public static boolean enabled() @@ -109,7 +287,7 @@ checkHandle(); int ret = _notifyStart( - iHandle, aGlobalComponentId, aComponentName, + iHandle, aOperation, aGlobalComponentId, aComponentName, aApplicationNames, aApplicationIcons, aComponentSize, aIconDir, aComponentIcon); if (ret < 0) @@ -176,6 +354,16 @@ { return; } + + iSubOperation = aSubOperation; + iCurrentValue = aCurrent; + iTotalValue = aTotal; + if (iIndicatorHandle != 0) + { + // Call activateIndicator so that indicator gets updated. + activateIndicator(); + } + checkHandle(); if (aSubOperation == SUB_OP_NO) { @@ -209,6 +397,7 @@ */ public void destroy() { + deactivateIndicator(); checkHandle(); int ret = _destroy(iHandle); if (ret < 0) @@ -309,6 +498,7 @@ * Notifies SIF about installation/uinstallation start. * * @param aHandle + * @param aOperation * @param aGlobalComponentId * @param aComponentName * @param aApplicationNames @@ -320,9 +510,10 @@ * otherwise 0 */ private static native int _notifyStart( - int aHandle, String aGlobalComponentId, String aComponentName, - String[] aApplicationNames, String[] aApplicationIcons, - int aComponentSize, String aIconDir, String aComponentIcon); + int aHandle, int aOperation, String aGlobalComponentId, + String aComponentName, String[] aApplicationNames, + String[] aApplicationIcons, int aComponentSize, + String aIconDir, String aComponentIcon); /** * Notifies SIF about installation/uinstallation completion. @@ -362,7 +553,7 @@ * other methods are called. * * @return Symbian error code (negative number) if operation fails, - * otherwise handle to the natie side object + * otherwise handle to the native side object */ private static native int _init(); @@ -376,4 +567,35 @@ */ private static native int _destroy(int aHandle); + /** + * Initializes SifNotifier indicator. + * + * @return Symbian error code (negative number) if operation fails, + * otherwise handle to the native side object + */ + private static native int _initIndicator(); + + /** + * Updates SifNotifier indicator. + * + * @param aHandle handle to indicator object + * @param aName application name + * @param aPhase operation phase + * @param aProgress progress in percentage + * @return Symbian error code (negative number) if operation fails, + * otherwise handle to the native side object + */ + private static native int _updateIndicator( + int aHandle, String aName, int aPhase, int aProgress); + + /** + * Destroys SifNotifier indicator. + * + * @param aHandle handle to indicator object + * @param aState indicator state + * @return Symbian error code (negative number) if operation fails, + * otherwise 0 + */ + private static native int _destroyIndicator(int aHandle, int aState); + } diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java Wed Sep 15 12:05:25 2010 +0300 @@ -47,7 +47,7 @@ // 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; + private static final int MAX_SIF_PROGRESS_UPDATES = 8; // Maximum number of progress updates to UI. private static final int MAX_UI_PROGRESS_UPDATES = 20; @@ -132,18 +132,6 @@ public void ended() { Log.log("InstallationNotifier.ended"); - if (iInstallerUi != null) - { - try - { - iInstallerUi.ended(); - } - catch (Throwable t) - { - Log.logError( - "InstallationNotifier: InstallerUi.ended threw exception", t); - } - } if (iSifNotifier != null) { // After this SifNotifier is no longer used, destroy it. @@ -157,6 +145,18 @@ Log.logError("InstallationNotifier: SifNotifier.destroy failed", t); } } + if (iInstallerUi != null) + { + try + { + iInstallerUi.ended(); + } + catch (Throwable t) + { + Log.logError( + "InstallationNotifier: InstallerUi.ended threw exception", t); + } + } } /** diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java Wed Sep 15 12:05:25 2010 +0300 @@ -589,6 +589,8 @@ table.add(new com.nokia.mj.impl.installer.midp2.install.steps. ConfirmPermissions()); // Show UI confirmation dialog. table.add(new com.nokia.mj.impl.installer.midp2.install.steps. + AddSecurityData()); + table.add(new com.nokia.mj.impl.installer.midp2.install.steps. HandleCustomAttributes()); table.add(new com.nokia.mj.impl.installer.midp2.install.steps. CheckJarPackages()); @@ -596,8 +598,6 @@ StopApplication()); // Update new application info in the following steps. table.add(new com.nokia.mj.impl.installer.midp2.install.steps. - AddSecurityData()); - table.add(new com.nokia.mj.impl.installer.midp2.install.steps. AddToStorage()); table.add(new com.nokia.mj.impl.installer.midp2.install.steps. RegisterPush()); @@ -607,12 +607,13 @@ RegisterApplicationToSif()); table.add(new com.nokia.mj.impl.installer.midp2.install.steps. CopyAppFiles()); - if (Platform.isS60()) // PrepareSplashScreen uses eSWT which is + if (Platform.isS60()) { - // not available in Linux. + // PrepareSplashScreen uses eSWT which is not available in Linux. + // Create splash screen images after app dir exists, + // that is after CopyAppFiles step. table.add(new com.nokia.mj.impl.installer.midp2.install.steps. - PrepareSplashScreen()); // Create splash screen images - // after app dir exists (after CopyAppFiles step). + PrepareSplashScreen()); } table.add(new com.nokia.mj.impl.installer.midp2.install.steps. NotifyJsrPlugins()); diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/applicationregistrator/AppRegInfo.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/applicationregistrator/AppRegInfo.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/applicationregistrator/AppRegInfo.java Wed Sep 15 12:05:25 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -77,41 +77,6 @@ * When this object is used for registering applications, all * params must be valid. When used for unregistering applications, * only aUid is really needed. - * Use default values for optional information. - * - * @param aUid Java application Uid (MIDlet Uid). - * @param aGroupName The value of Nokia-MIDlet-Category attribute or empty. - * Note that in Symbian only 16 first characters are stored to - * application registry. - * @param aMIDletName MIDlet name from MIDlet- attribute. - * @param aTargetDrive The installation drive, e.g. "C:" in S60 - * @param aIconFileName The full path name to the icon file in file system. - * The file must be accessible and the path must have \\ chars. - * @param aJarFileName Full path name to jar file. - * @see ApplicationRegistrator - */ - public AppRegInfo( - Uid aUid, - String aGroupName, - String aMIDletName, - String aTargetDrive, - String aIconFileName, - String aJarFileName) - { - iUid = aUid; - iGroupName = aGroupName; - iMIDletName = aMIDletName; - iTargetDrive = aTargetDrive; - iIconFileName = aIconFileName; - iJarFileName = aJarFileName; - } - - - /** - * Construct new AppRegInfo object. - * When this object is used for registering applications, all - * params must be valid. When used for unregistering applications, - * only aUid is really needed. * Specify all information. * * @param aUid Java application Uid (MIDlet Uid). diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/jsrpluginnotifier/InstallerExtensionInfo.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/jsrpluginnotifier/InstallerExtensionInfo.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/jsrpluginnotifier/InstallerExtensionInfo.java Wed Sep 15 12:05:25 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -18,38 +18,54 @@ package com.nokia.mj.impl.installer.jsrpluginnotifier; +import com.nokia.mj.impl.storage.StorageSession; import com.nokia.mj.impl.utils.Logger; import com.nokia.mj.impl.utils.Uid; import java.util.Hashtable; /** * Information passed to JSR plugins when installing or uninstalling - * Java applications + * Java applications. * @see JsrPluginNotifier */ public final class InstallerExtensionInfo { /** - * MIDlet Suite Uid. Can be null. + * MIDlet Suite Uid. */ - public Uid iUid; + public Uid iUid = null; + + /** + * Application Uids. + */ + public Uid[] iAppUids = null; /** - * true if upgrade installation + * Application suite root directory path. */ - public boolean iUpgrade; + public String iRootPath = null; /** - * true if silent installation + * True if upgrade installation. */ - public boolean iSilent; + public boolean iUpgrade = false; /** - * Combined jad./.jar attributes. + * True if silent installation. + */ + public boolean iSilent = false; + + /** + * Combined jad/jar attributes. * Key is attribute name, value is com.nokia.mj.impl.utils.Attribute object * Can be null. */ - public Hashtable iAttributes; + public Hashtable iAttributes = null; + + /** + * JavaStorage session where installation/uninstallation changes are made. + */ + public StorageSession iStorageSession = null; /*** ----------------------------- PUBLIC ------------------------------ */ diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckDiskSpace.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckDiskSpace.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckDiskSpace.java Wed Sep 15 12:05:25 2010 +0300 @@ -42,15 +42,8 @@ public void execute(ExeBall aBall) { InstallBall ball = (InstallBall)aBall; - int initialSize = ball.iSuite.calculateInitialSize(); - if (initialSize == 0 && ball.iJarFilename != null) - { - // Get initialSize from jar file size. - initialSize = (int)FileUtils.getSize(ball.iJarFilename); - - } - int requiredSize = initialSize + (100 * 1024); // +100kB + int requiredSize = getRequiredSize(ball); if (ball.iUserConfirmation == null) { @@ -103,6 +96,25 @@ } /** + * Returns amount of disk space this application requires. + */ + static int getRequiredSize(InstallBall aBall) + { + int initialSize = aBall.iSuite.getInitialSize(); + if (initialSize <= 0) + { + initialSize = aBall.iSuite.calculateInitialSize(); + } + if (initialSize == 0 && aBall.iJarFilename != null) + { + // Get initialSize from jar file size. + initialSize = (int)FileUtils.getSize(aBall.iJarFilename); + + } + return initialSize + (100 * 1024); // +100kB + } + + /** * Checks if given drive has enough free disk space. Throws * InstallerException if there is not enough free disk space. */ @@ -139,9 +151,9 @@ int driveId = drive.getNumber(); if (SysUtil.isDiskSpaceBelowCriticalLevel(aSizeInBytes, driveId)) { - Log.logWarning("Drive " + driveId + - " space below critical level, required space " + - aSizeInBytes + " bytes"); + Log.log("Drive " + driveId + + " space below critical level, required space " + + aSizeInBytes + " bytes"); } else { diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConfirmInstallation.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConfirmInstallation.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConfirmInstallation.java Wed Sep 15 12:05:25 2010 +0300 @@ -126,6 +126,7 @@ installInfo.setDriveId(ball.iInstallationDrive); Vector drives = new Vector(); SysUtil.getUserVisibleDrives(drives); + removeFullDrives(ball, drives); int[] driveIds = new int[drives.size()]; int[] driveTypes = new int[drives.size()]; long[] driveFreeSpaces = new long[drives.size()]; @@ -385,4 +386,34 @@ } return size; } + + /** + * Removes drives which do not have enough free space for the + * application from the aDrives vector. + */ + private void removeFullDrives(InstallBall aBall, Vector aDrives) + { + int requiredSize = CheckDiskSpace.getRequiredSize(aBall); + for (int i = 0; i < aDrives.size(); i++) + { + DriveInfo drive = (DriveInfo)aDrives.elementAt(i); + int driveId = drive.getNumber(); + if (SysUtil.isDiskSpaceBelowCriticalLevel(requiredSize, driveId)) + { + Log.logWarning("Drive " + FileUtils.getDriveName(driveId) + + " (" + driveId + ") does not have enough " + + " free space, required space " + requiredSize + + " bytes"); + aDrives.removeElementAt(i); + i--; // Decrease index because drive was removed from Vector. + } + } + if (aDrives.size() == 0) + { + // None of the available drives has enough space, + // throw an exception. + throw InstallerException.getOutOfDiskSpaceException( + requiredSize, null); + } + } } diff -r d5e927d5853b -r 7cee158cb8cd 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 Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/InstallBall.java Wed Sep 15 12:05:25 2010 +0300 @@ -233,6 +233,31 @@ } /** + * Called when InstallerUi is hidden or unhidden. + * + * @param aHidden true if UI was hidden, false if UI was unhidden. + */ + public void uiIsHidden(boolean aHidden) + { + log("InstallBall.uiIsHidden " + aHidden); + if (iSifNotifier == null) + { + Log.logWarning("InstallBall.uiIsHidden(" + aHidden + + ") called when SifNotifier does not exist"); + return; + } + iSifNotifier.setInstallerUi(getInstallerUi()); + if (aHidden) + { + iSifNotifier.activateIndicator(); + } + else + { + iSifNotifier.deactivateIndicator(); + } + } + + /** * Called when user cancels the execution from the InstallerUi. * This method must return quickly. */ diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/NotifyJsrPlugins.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/NotifyJsrPlugins.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/NotifyJsrPlugins.java Wed Sep 15 12:05:25 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -34,17 +34,11 @@ { InstallBall ball = (InstallBall)aBall; - // If any Jsr plugins, notify plugins + // If any Jsr plugins, notify plugins. if (ball.iJsrPluginNotifier.anyJsrPlugins()) { - // Create info object to be passed to plugins - InstallerExtensionInfo info = new InstallerExtensionInfo(); - info.iUid = ball.iSuite.getUid(); - info.iUpgrade = (ball.iOldSuite != null); - info.iSilent = ball.isSilent(); - info.iAttributes = ball.iCombinedAttributes; - - ball.iJsrPluginNotifier.notifyInstallation(info); + ball.iJsrPluginNotifier.notifyInstallation( + createInstallerExtensionInfo(ball)); } } @@ -52,26 +46,31 @@ { InstallBall ball = (InstallBall)aBall; - // Notify possible plugins that installation can been cancelled + // Notify possible plugins that installation has been cancelled. if (ball.iJsrPluginNotifier.anyJsrPlugins()) { - // Create info object to be passed to plugins - InstallerExtensionInfo info = new InstallerExtensionInfo(); - // Beware, it is possible that aBall has not been fully - // initialized - if (null == ball.iSuite) - { - info.iUid = null; - } - else - { - info.iUid = ball.iSuite.getUid(); - } - info.iUpgrade = (ball.iOldSuite != null); - info.iSilent = ball.isSilent(); - info.iAttributes = ball.iCombinedAttributes; - - ball.iJsrPluginNotifier.notifyRollbackInstall(info); + ball.iJsrPluginNotifier.notifyRollbackInstall( + createInstallerExtensionInfo(ball)); } } + + private InstallerExtensionInfo createInstallerExtensionInfo(InstallBall aBall) + { + InstallerExtensionInfo info = new InstallerExtensionInfo(); + // Beware, it is possible that aBall has not been fully initialized. + if (aBall.iSuite != null) + { + info.iUid = aBall.iSuite.getUid(); + info.iAppUids = aBall.iSuite.getApplicationUids(); + info.iRootPath = aBall.iSuite.getRootDir(); + } + info.iUpgrade = (aBall.iOldSuite != null); + info.iSilent = aBall.isSilent(); + info.iAttributes = aBall.iCombinedAttributes; + if (aBall.iStorageHandler != null) + { + info.iStorageSession = aBall.iStorageHandler.getSession(); + } + return info; + } } diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/NotifyJsrPlugins.java --- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/NotifyJsrPlugins.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/NotifyJsrPlugins.java Wed Sep 15 12:05:25 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -34,17 +34,11 @@ { UninstallBall ball = (UninstallBall)aBall; - // If any Jsr plugins, notify plugins + // If any Jsr plugins, notify plugins. if (ball.iJsrPluginNotifier.anyJsrPlugins()) { - // Create info object to be passed to plugins - InstallerExtensionInfo info = new InstallerExtensionInfo(); - info.iUid = ball.iSuite.getUid(); - info.iUpgrade = false; - info.iSilent = ball.isSilent(); - info.iAttributes = ball.iSuite.getAttributes(); - - ball.iJsrPluginNotifier.notifyUninstallation(info); + ball.iJsrPluginNotifier.notifyUninstallation( + createInstallerExtensionInfo(ball)); } } @@ -52,27 +46,31 @@ { UninstallBall ball = (UninstallBall)aBall; - // Notify possible plugins that uninstallation can been cancelled + // Notify possible plugins that uninstallation has been cancelled. if (ball.iJsrPluginNotifier.anyJsrPlugins()) { - // Create info object to be passed to plugins - InstallerExtensionInfo info = new InstallerExtensionInfo(); - // Beware, it is possible that aBall has not been fully - // initialized - if (null == ball.iSuite) - { - info.iUid = null; - info.iAttributes = null; - } - else - { - info.iUid = ball.iSuite.getUid(); - info.iAttributes = ball.iSuite.getAttributes(); - } - info.iUpgrade = false; - info.iSilent = ball.isSilent(); - - ball.iJsrPluginNotifier.notifyRollbackUninstall(info); + ball.iJsrPluginNotifier.notifyRollbackUninstall( + createInstallerExtensionInfo(ball)); } } + + private InstallerExtensionInfo createInstallerExtensionInfo(UninstallBall aBall) + { + InstallerExtensionInfo info = new InstallerExtensionInfo(); + // Beware, it is possible that aBall has not been fully initialized. + if (aBall.iSuite != null) + { + info.iUid = aBall.iSuite.getUid(); + info.iAppUids = aBall.iSuite.getApplicationUids(); + info.iAttributes = aBall.iSuite.getAttributes(); + info.iRootPath = aBall.iSuite.getRootDir(); + } + info.iUpgrade = false; + info.iSilent = aBall.isSilent(); + if (aBall.iStorageHandler != null) + { + info.iStorageSession = aBall.iStorageHandler.getSession(); + } + return info; + } } diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp --- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -23,6 +23,9 @@ #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK +#include +#include +#include #include #include @@ -51,7 +54,7 @@ * This method makes calls that may leave (the actual notifying). */ void NotifyStartL( - JNIEnv *aEnv, CPublishSifOperationInfo *aNotifier, + JNIEnv *aEnv, CPublishSifOperationInfo *aNotifier, jint aOperation, jstring aGlobalComponentId, jstring aComponentName, jobjectArray aApplicationNames, jobjectArray aApplicationIcons, jint aComponentSize, jstring aIconDir, jstring /*aComponentIcon*/) @@ -106,7 +109,8 @@ CSifOperationStartData::NewLC( *globalComponentId, *componentName, applicationNames, applicationIcons, aComponentSize, /*aIconPath=*/ (NULL != aIconDir? *iconDir: KNullDesC()), - /*aComponentIcon=*/ KNullDesC(), Usif::KSoftwareTypeJava); + /*aComponentIcon=*/ KNullDesC(), Usif::KSoftwareTypeJava, + (TSifOperationPhase)aOperation); aNotifier->PublishStartL(*startData); @@ -130,16 +134,17 @@ * Signature: (IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;I)I */ JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifNotifier__1notifyStart -(JNIEnv *aEnv, jclass, jint aHandle, jstring aGlobalComponentId, - jstring aComponentName, jobjectArray aApplicationNames, - jobjectArray aApplicationIcons, jint aComponentSize, - jstring aIconDir, jstring aComponentIcon) +(JNIEnv *aEnv, jclass, jint aHandle, jint aOperation, + jstring aGlobalComponentId, jstring aComponentName, + jobjectArray aApplicationNames, jobjectArray aApplicationIcons, + jint aComponentSize, jstring aIconDir, jstring aComponentIcon) { CPublishSifOperationInfo *pNotifier = reinterpret_cast(aHandle<<2); - TRAPD(err, NotifyStartL(aEnv, pNotifier, aGlobalComponentId, aComponentName, - aApplicationNames, aApplicationIcons, - aComponentSize, aIconDir, aComponentIcon)); + TRAPD(err, NotifyStartL(aEnv, pNotifier, aOperation, aGlobalComponentId, + aComponentName, aApplicationNames, + aApplicationIcons, aComponentSize, + aIconDir, aComponentIcon)); return err; } @@ -297,6 +302,103 @@ return KErrNone; } +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifNotifier + * Method: _initIndicator + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifNotifier__1initIndicator +(JNIEnv *, jclass) +{ + CHbIndicatorSymbian *pIndicator = NULL; + TRAPD(err, pIndicator = CHbIndicatorSymbian::NewL()); + if (KErrNone != err) + { + ELOG1(EJavaInstaller, + "SifNotifier.initIndicator: Creating indicator failed, error %d", + err); + return err; + } + // Return handle to the object. 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(pIndicator)>>2; +} + +/** + * See JNI method __1updateIndicator. + * This method makes calls that may leave (the actual notifying). + */ +void UpdateIndicatorL( + JNIEnv *aEnv, CHbIndicatorSymbian *pIndicator, jstring aName, jint aPhase, jint aProgress) +{ + HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aName); + + CHbSymbianVariantMap *variantMap = CHbSymbianVariantMap::NewL(); + CleanupStack::PushL(variantMap); + CHbSymbianVariant *variantName = CHbSymbianVariant::NewL(name, CHbSymbianVariant::EDes); + variantMap->Add(KSifUiInstallIndicatorAppName, variantName); + CHbSymbianVariant *variantPhase = CHbSymbianVariant::NewL(&aPhase, CHbSymbianVariant::EInt); + variantMap->Add(KSifUiInstallIndicatorPhase, variantPhase); + CHbSymbianVariant *variantProgress = CHbSymbianVariant::NewL(&aProgress, CHbSymbianVariant::EInt); + variantMap->Add(KSifUiInstallIndicatorProgress, variantProgress); + + CHbSymbianVariant *variant = CHbSymbianVariant::NewL(variantMap, CHbSymbianVariant::EVariantMap); + CleanupStack::PushL(variant); + + TInt err = KErrNone; + if (!pIndicator->Activate(KSifUiInstallIndicatorType, variant)) + { + err = pIndicator->Error(); + ELOG1(EJavaInstaller, + "SifNotifier.updateIndicator: activating indicator failed, error %d", + err); + err = KErrGeneral; + } + + CleanupStack::PopAndDestroy(variant); + CleanupStack::PopAndDestroy(variantMap); + CleanupStack::PopAndDestroy(name); +} + +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifNotifier + * Method: _updateIndicator + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifNotifier__1updateIndicator +(JNIEnv *aEnv, jclass, jint aHandle, jstring aName, jint aPhase, jint aProgress) +{ + CHbIndicatorSymbian *pIndicator = + reinterpret_cast(aHandle<<2); + TRAPD(err, UpdateIndicatorL(aEnv, pIndicator, aName, aPhase, aProgress)); + return err; +} + +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifNotifier + * Method: _destroyIndicator + * Signature: (II)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifNotifier__1destroyIndicator +(JNIEnv *, jclass, jint aHandle, jint aState) +{ + CHbIndicatorSymbian *pIndicator = + reinterpret_cast(aHandle<<2); + TInt err = KErrNone; + if (aState && !pIndicator->Deactivate(KSifUiInstallIndicatorType)) + { + err = pIndicator->Error(); + ELOG1(EJavaInstaller, + "SifNotifier.destroyIndicator: Deactivating indicator failed, error %d", + err); + err = KErrGeneral; + } + delete pIndicator; + return err; +} + #else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK /* @@ -316,7 +418,7 @@ * Signature: (IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;I)I */ JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifNotifier__1notifyStart -(JNIEnv *, jclass, jint, jstring, jstring, jobjectArray, jobjectArray, jint, jstring, jstring) +(JNIEnv *, jclass, jint, jint, jstring, jstring, jobjectArray, jobjectArray, jint, jstring, jstring) { LOG(EJavaInstaller, EInfo, "SifNotifier.notifyStart"); return KErrNone; @@ -381,4 +483,40 @@ return KErrNone; } +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifNotifier + * Method: _initIndicator + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifNotifier__1initIndicator +(JNIEnv *, jclass) +{ + LOG(EJavaInstaller, EInfo, "SifNotifier.initIndicator"); + return 1; // return dummy object handle +} + +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifNotifier + * Method: _updateIndicator + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifNotifier__1updateIndicator +(JNIEnv *, jclass, jint, jstring, jint, jint) +{ + LOG(EJavaInstaller, EInfo, "SifNotifier.updateIndicator"); + return KErrNone; +} + +/* + * Class: com_nokia_mj_impl_installer_applicationregistrator_SifNotifier + * Method: _destroyIndicator + * Signature: (II)I + */ +JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifNotifier__1destroyIndicator +(JNIEnv *, jclass, jint, jint) +{ + LOG(EJavaInstaller, EInfo, "SifNotifier.destroyIndicator"); + return KErrNone; +} + #endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/tsrc/build/build.xml --- a/javamanager/javainstaller/installer/tsrc/build/build.xml Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/tsrc/build/build.xml Wed Sep 15 12:05:25 2010 +0300 @@ -1,6 +1,6 @@ @@ -96,7 +96,7 @@ tofile="${dist.dir}/${junit.omj.jar.filename}"/> - + @@ -108,6 +108,9 @@ + + + diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/tsrc/build/jiut.bat --- a/javamanager/javainstaller/installer/tsrc/build/jiut.bat Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/tsrc/build/jiut.bat Wed Sep 15 12:05:25 2010 +0300 @@ -11,11 +11,12 @@ @rem @rem Contributors: @rem -@rem Description: +@rem Description: @rem rem Script for running JavaInstaller unit tests from S60 eshell rem Start SifServer before running any tests sifserver +javainstaller uninstallall -silent -forceuninstall 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 diff -r d5e927d5853b -r 7cee158cb8cd 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 Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/customisationproperties/CustomisationPropertiesTest.java Wed Sep 15 12:05:25 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -216,14 +216,16 @@ // second possible drive drive = (String)value.get(1); assertTrue("PossibleInstallationDrives is null", (drive != null)); - assertTrue("Second PossibleInstallationDrive is not E:, it is " + drive, drive.equals("E:")); + //assertTrue("Second PossibleInstallationDrive is not E:, it is " + drive, drive.equals("E:")); + assertTrue("Second PossibleInstallationDrive is not T:, it is " + drive, drive.equals("T:")); value = cust.getIntegerProperty(CustomisationProperties.PossibleInstallationDrives); assertTrue("PossibleInstallationDrives value is null", (value != null)); assertTrue("PossibleInstallationDrives value does not contain any integers", (value.size() > 0)); Integer idrive = (Integer)value.get(1); - assertTrue("Second PossibleInstallationDrive is not E:, it is " + idrive, idrive.intValue() == 4); + //assertTrue("Second PossibleInstallationDrive is not E:, it is " + idrive, idrive.intValue() == 4); + assertTrue("Second PossibleInstallationDrive is not T:, it is " + idrive, idrive.intValue() == 19); } public void testTypesOfPossibleInstallationDrives() diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandlerTest.java --- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandlerTest.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandlerTest.java Wed Sep 15 12:05:25 2010 +0300 @@ -448,7 +448,8 @@ { Uid[] uids = iStorageHandler.getSuiteUids(); assertTrue("expected uids to be not null", uids != null); - assertTrue("expected uids.length to be suites.length", + assertTrue("expected uids.length (" + uids.length + + ") to be suites.length (" + suites.length + ")", uids.length == suites.length); } catch (Exception ex) diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/utils/AttributeValidatorTest.java --- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/utils/AttributeValidatorTest.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/utils/AttributeValidatorTest.java Wed Sep 15 12:05:25 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -183,16 +183,16 @@ Hashtable tbl = getTestTbl(); String attrName = "MIDlet-Version"; assertValidValue(tbl, attrName, "1"); - assertValidValue(tbl, attrName, "1."); // OPEN: Is this valid? If we are lenient it is. + assertValidValue(tbl, attrName, "1."); assertValidValue(tbl, attrName, "1.1"); - assertValidValue(tbl, attrName, "1.1."); // OPEN: Is this valid? If we are lenient it is. + assertValidValue(tbl, attrName, "1.1."); assertValidValue(tbl, attrName, "1.1.1"); + assertValidValue(tbl, attrName, "1.1:1"); // invalid chars are ignored assertInvalidValue(tbl, attrName, ""); // invalid, attr is mandatory assertInvalidValue(tbl, attrName, " "); // invalid, attr is mandatory - assertInvalidValue(tbl, attrName, "1.1:1"); // invalid char assertInvalidValue(tbl, attrName, "1.1.1."); // invalid, only three parts allowed assertInvalidValue(tbl, attrName, "1.1.1.1"); // invalid, only three parts allowed - assertInvalidValue(tbl, attrName, "abc"); // invalid chars + assertInvalidValue(tbl, attrName, "abc"); // invalid, version is mandatory } public void testRuntimeExecutionEnvironment() diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jad --- a/javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jad Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jad Wed Sep 15 12:05:25 2010 +0300 @@ -5,6 +5,7 @@ MIDlet-Jar-Size: 29967 MIDlet-Name: BCExchanger MIDlet-Vendor: Forum Nokia -MIDlet-Version: 1.0.0 + +MIDlet-Version: 1.0 rev.2 MicroEdition-Configuration: CLDC-1.1 MicroEdition-Profile: MIDP-2.0 diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.zip Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.zip has changed diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/installerui/build/javainstallerui_0x2002DCB6.mmp --- a/javamanager/javainstaller/installerui/build/javainstallerui_0x2002DCB6.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installerui/build/javainstallerui_0x2002DCB6.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -91,7 +92,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd 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 Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ConfirmationViewBase.java Wed Sep 15 12:05:25 2010 +0300 @@ -102,7 +102,6 @@ } iInstallerUi.loadCss(); setVisible(true); - iInstallerUi.unhide(); } }); // The UI thread must not be blocked. Let's wait for the answer diff -r d5e927d5853b -r 7cee158cb8cd 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 Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java Wed Sep 15 12:05:25 2010 +0300 @@ -104,6 +104,9 @@ /** Flag telling if the first progress bar update has been traced. */ private boolean iProgressBarUpdateTraced = false; + /** Certificate details view, owned by the view where it was opened. */ + private CertificateDetailsView iCertificateDetailsView = null; + /** Hashtable for storing the loaded icons. */ private static Hashtable iImageTable = null; /** Best size for application icon. */ @@ -253,6 +256,10 @@ public void cancelConfirmations() { super.cancelConfirmations(); + if (iCertificateDetailsView != null) + { + iCertificateDetailsView.confirmCancel(); + } if (iInstallConfirmationView != null) { iInstallConfirmationView.confirmCancel(); @@ -390,6 +397,9 @@ return true; } + // Ensure that UI is visible when this prompt is displayed. + unhide(); + synchronized (iProgressSyncObject) { // Do not display progress bar during dialog. @@ -471,7 +481,8 @@ // do not display installation progress. return; } - if (iDisplayProgress && !iProgressView.isVisible()) + if (iDisplayProgress && !iProgressView.isVisible() && + iCertificateDetailsView == null) { // Re-create iProgressView here so that it gets // application info that was set when confirm() @@ -605,7 +616,8 @@ synchronized (iProgressSyncObject) { - if (iDisplayProgress && !iDlProgressView.isVisible()) + if (iDisplayProgress && !iDlProgressView.isVisible() && + iCertificateDetailsView == null) { iDlProgressView.setVisible(true); } @@ -641,7 +653,8 @@ } synchronized (iProgressSyncObject) { - if (iDisplayProgress && !iProgressView.isVisible()) + if (iDisplayProgress && !iProgressView.isVisible() && + iCertificateDetailsView == null) { iProgressView.setVisible(true); } @@ -682,7 +695,8 @@ } if (iOcspProgressView != null) { - if (!iOcspProgressView.isVisible()) + if (!iOcspProgressView.isVisible() && + iCertificateDetailsView == null) { iOcspProgressView.setVisible(true); } @@ -761,7 +775,8 @@ if (DISABLE_UI) return; // Disable UI temporarily. waitForUi(); - if (!isUiReady()) { + waitForCertificateDetailsView(); + if (!isUiReady() || iHidden || iConfirmationsCanceled) { return; } @@ -821,6 +836,14 @@ if (!isUiReady()) { return true; } + waitForCertificateDetailsView(); + if (iConfirmationsCanceled) + { + return false; + } + + // Ensure that UI is visible when this prompt is displayed. + unhide(); if (iRuntimeConfirmationView == null) { @@ -857,11 +880,15 @@ { if (DISABLE_UI) return new String[] { "", "" }; // Disable UI temporarily. waitForUi(); - if (!isUiReady()) + waitForCertificateDetailsView(); + if (!isUiReady() || iConfirmationsCanceled) { return null; } + // Ensure that UI is visible when this prompt is displayed. + unhide(); + synchronized (iProgressSyncObject) { // Do not display progress bar during dialog. @@ -913,10 +940,13 @@ { if (DISABLE_UI) return false; // Disable UI temporarily. waitForUi(); - if (!isUiReady() || iConfirmationsCanceled || getInstallInfo() == null) + waitForCertificateDetailsView(); + if (!isUiReady() || iConfirmationsCanceled || + iHidden || getInstallInfo() == null) { - // Either UI is not yet ready, or user has cancelled - // installation, in both cases do nothing. + // Either UI is not yet ready, user has cancelled + // installation or UI is hidden; in all these cases + // do nothing. return false; } @@ -954,7 +984,10 @@ */ public void syncExec(Runnable aRunnable) { - iParent.getDisplay().syncExec(aRunnable); + if (!iParent.getDisplay().isDisposed()) + { + iParent.getDisplay().syncExec(aRunnable); + } } /** @@ -962,14 +995,14 @@ */ public void hide(boolean aHide) { - final boolean hide = aHide; - if (iParent != null) + iHidden = aHide; + if (iDialog != null) { - iParent.getDisplay().syncExec(new Runnable() + iDialog.getDisplay().syncExec(new Runnable() { public void run() { - iParent.setMinimized(hide); + iDialog.setMinimized(iHidden); } }); } @@ -988,6 +1021,45 @@ } /** + * Sets flag telling if certificate details view is open. + */ + protected void setCertificateDetailsView(CertificateDetailsView aView) + { + if (iCertificateDetailsView != null && aView == null) + { + // Certificate details view has been closed, + // notify possible waiters. + synchronized (iCertificateDetailsView) + { + iCertificateDetailsView.notify(); + } + } + iCertificateDetailsView = aView; + } + + /** + * Waits until certificate details view is closed. + */ + protected void waitForCertificateDetailsView() + { + if (iCertificateDetailsView != null) + { + // If certificate details view is open, wait until + // user closes it. + synchronized (iCertificateDetailsView) + { + try + { + iCertificateDetailsView.wait(); + } + catch (InterruptedException ie) + { + } + } + } + } + + /** * Returns string title basing on mode of this InstallerUi. */ protected String getTitle() diff -r d5e927d5853b -r 7cee158cb8cd 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 Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ProgressView.java Wed Sep 15 12:05:25 2010 +0300 @@ -80,7 +80,7 @@ if (iInstallerUi != null && iInstallerUi.getInstallInfo() != null) { // Add header. - addHeader(aMsg, iInstallerUi.getInstallInfo(), null, false); + addHeader(aMsg, iInstallerUi.getInstallInfo(), null); } else { @@ -174,10 +174,9 @@ public void run() { // Set horizontalSpan to 2 for one button, - // and to 1 for one two buttons. - int horizontalSpan = 2; + // and to 1 for two buttons. + int horizontalSpan = 1; GridData gridData = null; - /* iHideCommand = new Button(getCommandComposite(), SWT.PUSH); setCssId(iHideCommand, "softKeyButton"); gridData = new GridData(GridData.FILL_HORIZONTAL); @@ -196,10 +195,10 @@ } }); addSoftKeyListenerFor(iHideCommand); - */ iCancelCommand = new Button(getCommandComposite(), SWT.PUSH); - setCssId(iCancelCommand, "softKeyButtonWide"); + setCssId(iCancelCommand, "softKeyButton"); + //setCssId(iCancelCommand, "softKeyButtonWide"); gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; iCancelCommand.setLayoutData(gridData); diff -r d5e927d5853b -r 7cee158cb8cd 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 Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java Wed Sep 15 12:05:25 2010 +0300 @@ -78,7 +78,7 @@ private int iColumns = 1; /** Default content size. */ private Point iDefaultContentSize = null; - /** Certificate details view. */ + /** Certificate details view. */ private CertificateDetailsView iCertificateDetailsView = null; /** Certificates for this application. */ protected SigningCertificate[] iCertificates = null; @@ -803,6 +803,7 @@ { public void run() { + iInstallerUi.setCertificateDetailsView(iCertificateDetailsView); if (iCertificateDetailsView.confirm()) { log("certificateDetailsView confirmed"); @@ -813,6 +814,7 @@ } iCertificateDetailsView.dispose(); iCertificateDetailsView = null; + iInstallerUi.setCertificateDetailsView(null); setVisible(true); } }, "InstallerUiCertViewThread").start(); diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp --- a/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -39,6 +39,10 @@ START RESOURCE ../data/2002BC6F.rss TARGET javasifplugin.rsc END +START RESOURCE ../data/2002BC6F_iad.rss +TARGET javasifplugin.rsc +TARGETPATH resource/java/iad +END // Sources SOURCEPATH ../src diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/javasifplugin/data/2002BC6F.rss --- a/javamanager/javainstaller/javasifplugin/data/2002BC6F.rss Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javainstaller/javasifplugin/data/2002BC6F.rss Wed Sep 15 12:05:25 2010 +0300 @@ -21,6 +21,10 @@ // RESOURCE DEFINITIONS +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 1 +#endif + RESOURCE REGISTRY_INFO registry_info { resource_format_version = RESOURCE_FORMAT_VERSION_2; @@ -40,7 +44,7 @@ IMPLEMENTATION_INFO { implementation_uid = 0x2002BC70; - version_no = 1; + version_no = ECOM_VERSION_NO; display_name = "Midlet installation implementation"; default_data = ""; opaque_data = ""; diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javainstaller/javasifplugin/data/2002BC6F_iad.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javainstaller/javasifplugin/data/2002BC6F_iad.rss Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 2 + +// Include actual rss +#include "2002BC6F.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javalauncher/build/javalauncher_0x2001E262.mmp --- a/javamanager/javalauncher/build/javalauncher_0x2001E262.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javalauncher/build/javalauncher_0x2001E262.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -101,7 +102,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javarecognizer/build/recjar.mmp --- a/javamanager/javarecognizer/build/recjar.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javarecognizer/build/recjar.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -19,8 +19,11 @@ #include <../../../inc/project_defines.hrh> +#include #include +#include <../../../inc/java_stdcpp_support_for_dll.hrh> + TARGET recjar.dll CAPABILITY TrustedUI ProtServ @@ -43,6 +46,10 @@ START RESOURCE ../data/102031FB.rss TARGET recjar.rsc END +START RESOURCE ../data/102031FB_iad.rss +TARGET recjar.rsc +TARGETPATH resource/java/iad +END LIBRARY euser.lib apmime.lib efsrv.lib diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javarecognizer/data/102031FB.rss --- a/javamanager/javarecognizer/data/102031FB.rss Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javarecognizer/data/102031FB.rss Wed Sep 15 12:05:25 2010 +0300 @@ -11,8 +11,8 @@ * * Contributors: * -* Description: ECOM resource definition for MIME type recognizer for Symbian -* application framework +* Description: ECOM resource definition for MIME type recognizer for Symbian +* application framework * */ @@ -20,6 +20,10 @@ #include #include "javauids.h" +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 2 +#endif + RESOURCE REGISTRY_INFO r_registry { resource_format_version = RESOURCE_FORMAT_VERSION_2; @@ -34,12 +38,11 @@ IMPLEMENTATION_INFO { implementation_uid = KRecognizerEcomImplUid; - // Version number is 2 so that this implementation should override the old one in ROM - version_no = 2; + version_no = ECOM_VERSION_NO; display_name = "recjar"; default_data = ""; // This means it accepts ALL types opaque_data = ""; - rom_only = 0; + rom_only = 0; } }; } diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javarecognizer/data/102031FB_iad.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javarecognizer/data/102031FB_iad.rss Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 3 + +// Include actual rss +#include "102031FB.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javaregistry/build/javaregistryclient_0x10282476.mmp --- a/javamanager/javaregistry/build/javaregistryclient_0x10282476.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javaregistry/build/javaregistryclient_0x10282476.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -111,7 +112,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javaregistry/javasizehelper/client/build/javasizehelperclient_0x2002DCD1.mmp --- a/javamanager/javaregistry/javasizehelper/client/build/javasizehelperclient_0x2002DCD1.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javaregistry/javasizehelper/client/build/javasizehelperclient_0x2002DCD1.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -99,7 +100,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javaregistry/javasizehelper/server/build/javasizehelperserver_0x2002DCD2.mmp --- a/javamanager/javaregistry/javasizehelper/server/build/javasizehelperserver_0x2002DCD2.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javaregistry/javasizehelper/server/build/javasizehelperserver_0x2002DCD2.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -46,6 +46,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -102,7 +103,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javasettings/appmngrplugin/build/appmngr2midletruntime.mmp --- a/javamanager/javasettings/appmngrplugin/build/appmngr2midletruntime.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javasettings/appmngrplugin/build/appmngr2midletruntime.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -64,6 +64,10 @@ START RESOURCE ../data/20016bf7.rss TARGET appmngr2midletplugin.rsc END +START RESOURCE ../data/20016bf7_iad.rss +TARGET appmngr2midletplugin.rsc +TARGETPATH resource/java/iad +END START RESOURCE ../data/javaapplicationsettings.rss HEADER @@ -82,9 +86,9 @@ LIBRARY aknskins.lib // S60 UI Framework LIBRARY efsrv.lib // File server LIBRARY egul.lib // Icons -LIBRARY PlatformEnv.lib // PathInfo +LIBRARY platformenv.lib // PathInfo LIBRARY featmgr.lib // FeatureManager -LIBRARY commonengine.lib // StringLoader +LIBRARY CommonEngine.lib // StringLoader LIBRARY sendui.lib // Send UI LIBRARY browserlauncher.lib // BrowserLauncher API LIBRARY imut.lib // Encoding @@ -102,10 +106,10 @@ LIBRARY charconv.lib // CnvUtfConverter LIBRARY hlplch.lib // Help LIBRARY apgrfx.lib // RApaLsSession -LIBRARY aknicon.lib // CAknIcon +LIBRARY AknIcon.lib // CAknIcon LIBRARY fbscli.lib // CFbsBitmap -LIBRARY cdlengine.lib // AknLayoutScalable_Avkon -LIBRARY aknlayout2scalable.lib // TAknWindowComponentLayout +LIBRARY CdlEngine.lib // AknLayoutScalable_Avkon +LIBRARY AknLayout2Scalable.lib // TAknWindowComponentLayout DEBUGLIBRARY flogger.lib // File logger API diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javasettings/appmngrplugin/data/20016bf7.rss --- a/javamanager/javasettings/appmngrplugin/data/20016bf7.rss Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javasettings/appmngrplugin/data/20016bf7.rss Wed Sep 15 12:05:25 2010 +0300 @@ -18,6 +18,10 @@ #include "ecom/registryinfo.rh" +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 1 +#endif + RESOURCE REGISTRY_INFO theInfo { dll_uid = 0x20016BF7; @@ -31,7 +35,7 @@ IMPLEMENTATION_INFO { implementation_uid = 0x20016BF8; - version_no = 1; + version_no = ECOM_VERSION_NO; display_name = "Midlet plugin"; default_data = ""; opaque_data = ""; diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javasettings/appmngrplugin/data/20016bf7_iad.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javasettings/appmngrplugin/data/20016bf7_iad.rss Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 2 + +// Include actual rss +#include "20016bf7.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javasidchecker/build/javasidchecker.mmp --- a/javamanager/javasidchecker/build/javasidchecker.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javasidchecker/build/javasidchecker.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,9 +45,13 @@ SOURCEPATH ../src SOURCE javasidchecker.cpp -start RESOURCE ../data/10281FBE.rss -target javasidchecker.rsc -end +START RESOURCE ../data/10281FBE.rss +target javasidchecker.rsc +END +START RESOURCE ../data/10281FBE_iad.rss +TARGET javasidchecker.rsc +TARGETPATH resource/java/iad +END #ifdef RD_JAVA_OLD_SIDCHECKER_LIBRARY LIBRARY apfile.lib diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javasidchecker/data/10281FBE.rss --- a/javamanager/javasidchecker/data/10281FBE.rss Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javasidchecker/data/10281FBE.rss Wed Sep 15 12:05:25 2010 +0300 @@ -25,6 +25,10 @@ #include #include "javauids.h" +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 2 +#endif + RESOURCE REGISTRY_INFO r_registry { resource_format_version = RESOURCE_FORMAT_VERSION_2; @@ -39,8 +43,7 @@ IMPLEMENTATION_INFO { implementation_uid = KSidCheckerEcomImplUid; - // Version number is 2 so that this implementation should override the old one in ROM - version_no = 2; + version_no = ECOM_VERSION_NO; display_name = "JavaVerify"; default_data = "[10210e26]"; opaque_data = ""; diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javasidchecker/data/10281FBE_iad.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javamanager/javasidchecker/data/10281FBE_iad.rss Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 3 + +// Include actual rss +#include "10281FBE.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javamanager/javaupgradeapp/build/javaupgradeapp_0x2002FF64.mmp --- a/javamanager/javaupgradeapp/build/javaupgradeapp_0x2002FF64.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/javaupgradeapp/build/javaupgradeapp_0x2002FF64.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -97,7 +98,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/preinstaller/build/javapreinstaller.pro --- a/javamanager/preinstaller/build/javapreinstaller.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/preinstaller/build/javapreinstaller.pro Wed Sep 15 12:05:25 2010 +0300 @@ -24,7 +24,7 @@ SOURCES += ../src.s60/*.cpp LIBS += -lefsrv \ - -lPlatformEnv \ + -lplatformenv \ -ljavacomms \ -lcharconv \ -ljavastorage \ diff -r d5e927d5853b -r 7cee158cb8cd javamanager/preinstaller/build/javapreinstaller_0x2002DCC6.mmp --- a/javamanager/preinstaller/build/javapreinstaller_0x2002DCC6.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/preinstaller/build/javapreinstaller_0x2002DCC6.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -68,7 +69,7 @@ LIBRARY efsrv.lib -LIBRARY PlatformEnv.lib +LIBRARY platformenv.lib LIBRARY javacomms.lib LIBRARY charconv.lib LIBRARY javastorage.lib @@ -100,7 +101,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javamanager/preinstaller/src.s60/silentmidletinstall.cpp --- a/javamanager/preinstaller/src.s60/silentmidletinstall.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/preinstaller/src.s60/silentmidletinstall.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -155,16 +155,17 @@ { iISRollbackNeeded = ETrue; // If JavaInstaller is running, then existence of the Java Installer - // integrity service directory is ok and rollback is not needed + // integrity service directory is ok and rollback is not needed. TFullName processName; - _LIT(KJavaInstallerProcess, "*Installer*"); + _LIT(KJavaInstallerProcess, "Installer*"); TFindProcess finder(KJavaInstallerProcess); err = finder.Next(processName); if (err == KErrNone) { iISRollbackNeeded = EFalse; - WLOG(EJavaPreinstaller, - "Java Installer is running while checking need to rollback"); + WLOG1(EJavaPreinstaller, + "Java Installer is running while checking need to rollback (%S)", + (wchar_t *)(processName.PtrZ())); } } diff -r d5e927d5853b -r 7cee158cb8cd javamanager/subsystem.mk --- a/javamanager/subsystem.mk Tue Sep 14 21:06:50 2010 +0300 +++ b/javamanager/subsystem.mk Wed Sep 15 12:05:25 2010 +0300 @@ -20,8 +20,7 @@ javacaptain \ javainstaller \ javaregistry \ - javabackup \ - javasettings + javabackup COMPONENTS = \ preinstaller/build \ @@ -53,6 +52,8 @@ ifdef RD_JAVA_APPLICATION_SETTINGS_QT COMPONENTS += javasettings_qt/build SYMBIAN_ONLY += javasettings_qt/build +else +SUBSYSTEMS += javasettings endif # Declare that release preparation removes subdirectories not in build, except diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/installer/starterdll/build/javainstallerstarter_0x2002DCB5.mmp --- a/javaruntimes/installer/starterdll/build/javainstallerstarter_0x2002DCB5.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/installer/starterdll/build/javainstallerstarter_0x2002DCB5.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -97,7 +98,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/installer/starterexe/build/javainstaller_0x2001843A.mmp --- a/javaruntimes/installer/starterexe/build/javainstaller_0x2001843A.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/installer/starterexe/build/javainstaller_0x2001843A.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -47,6 +47,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -99,7 +100,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/jvmargmodifier/default/build/javajvmargsmodifier_0x2002DCB8.mmp --- a/javaruntimes/jvmargmodifier/default/build/javajvmargsmodifier_0x2002DCB8.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/jvmargmodifier/default/build/javajvmargsmodifier_0x2002DCB8.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -96,7 +97,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile_0x2002DCB9.mmp --- a/javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile_0x2002DCB9.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile_0x2002DCB9.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -98,7 +99,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/midp/runtime/build/javamidpruntime_0x2002DCBF.mmp --- a/javaruntimes/midp/runtime/build/javamidpruntime_0x2002DCBF.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/midp/runtime/build/javamidpruntime_0x2002DCBF.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -109,7 +110,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/SchemeHandlerBase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/SchemeHandlerBase.java Wed Sep 15 12:05:25 2010 +0300 @@ -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: +* +*/ + +package com.nokia.mj.impl.rt.midp; + +import javax.microedition.io.ConnectionNotFoundException; + +/** + * Java based platform request scheme handler base class. + */ +public abstract class SchemeHandlerBase +{ + + /*** ----------------------------- PUBLIC ------------------------------ */ + + /** + * Execute scheme. + * + * @param url to be invoked. + * @return true if MIDlet must be closed prior content fetch. + * @throws ConnectionNotFoundException if URL execution fails. + */ + public abstract boolean execute(String url) throws ConnectionNotFoundException; +} + diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/taskmanager/SchemeHandler.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/taskmanager/SchemeHandler.java Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,60 @@ +/* +* 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://taskmanager scheme handler. +* +*/ +package com.nokia.mj.impl.rt.taskmanager; + +import javax.microedition.io.ConnectionNotFoundException; + +import com.nokia.mj.impl.coreui.CoreUi; +import com.nokia.mj.impl.rt.midp.SchemeHandlerBase; + +/** + * TaskManager platform request scheme handler. These are java: taskmanager?hide + * java: taskmanager?show. Using hide URL query application is hided + * from the TaskManager and brought visible using show query. + */ +public class SchemeHandler extends SchemeHandlerBase +{ + + /*** ----------------------------- PUBLIC ------------------------------ */ + + /** + * Execute scheme. If url contains query ?hide application is removed + * from the TaskManager and if it contains ?show application is shown on + * TaskManager. + * + * @return false. Since MIDlet needs never be closed before content fetch. + * @throws ConnectionNotFoundException if URL was invalid. + */ + public boolean execute(String url) throws ConnectionNotFoundException + { + if (url.indexOf("?hide") != -1) + { + CoreUi.hideApplication(true); + } + else if (url.indexOf("?show") != -1) + { + CoreUi.hideApplication(false); + } + else + { + throw new ConnectionNotFoundException("Invalid URL"); + } + + return false; + } +} + diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java --- a/javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java Wed Sep 15 12:05:25 2010 +0300 @@ -25,6 +25,8 @@ import com.nokia.mj.impl.rt.ui.RuntimeUi; import com.nokia.mj.impl.rt.ui.RuntimeUiFactory; +import com.nokia.mj.impl.rt.midp.SchemeHandlerBase; + import com.nokia.mj.impl.rt.support.ApplicationInfo; import com.nokia.mj.impl.security.midp.authorization.AccessControllerFactoryImpl; @@ -34,6 +36,7 @@ import com.nokia.mj.impl.utils.Id; import com.nokia.mj.impl.utils.Logger; + /** * A class to be extended by the MIDlet applcation. See MIDP spec for * further details. @@ -56,6 +59,8 @@ */ private static boolean mConstructionAllowed = true; + private static final int DOMAIN_MANUFACTURER_OR_OPERATOR = 1; + /*** ----------------------------- PUBLIC ------------------------------ */ /** @@ -139,6 +144,7 @@ { Logger.PLOG(Logger.EJavaRuntime, "MIDlet.platformRequest(): " + url); + if (null == url) { throw new NullPointerException( @@ -153,24 +159,30 @@ return false; } + ApplicationInfo appInfo = ApplicationInfo.getInstance(); + String domain = appInfo.getProtectionDomain(); + + // Handling for java scheme. + /*if (url.startsWith("java://")) + { + String handlerName = parseHandlerName(url); + + if (handlerName.equals("taskmanager")) + { + // Check application is bound either Manufacturer or Operator domain. + enforceSecurityDomain(DOMAIN_MANUFACTURER_OR_OPERATOR, domain); + } + + return invokeSchemeHandler(handlerName, url); + }*/ + // If the platform request is used to start arbitrary native application, // check that MIDlet is in manufacturer or operator domain if (startsArbitraryNativeApp(url)) { - ApplicationInfo appInfo = ApplicationInfo.getInstance(); - String domain = appInfo.getProtectionDomain(); - if ((ApplicationInfo.MANUFACTURER_DOMAIN.equals(domain) != true) && - (ApplicationInfo.OPERATOR_DOMAIN.equals(domain) != true)) - { - Logger.WLOG(Logger.EJavaRuntime, - "Only manufacturer or operator domain MIDlets can start arbitrary native apps."); - - throw new ConnectionNotFoundException( - "Request allowed only for manufacturer or operator MIDlets"); - } + enforceSecurityDomain(DOMAIN_MANUFACTURER_OR_OPERATOR, domain); } - Logger.ILOG(Logger.EJavaRuntime, "Before handleConfirmationNote()"); @@ -362,6 +374,72 @@ return false; } + private String parseHandlerName(String url) throws ConnectionNotFoundException + { + // Parse handler name from URL. Remove java:// prefix. + String handlerName = url.substring(7).trim(); + + // name format: handlername?query + int nameEndIndex = handlerName.indexOf('?'); + + if (nameEndIndex != -1) + { + handlerName = handlerName.substring(0, nameEndIndex); + return handlerName; + } + else + { + throw new ConnectionNotFoundException("Handler not found for URL"); + } + } + + private boolean invokeSchemeHandler(String handlerName, String url) + throws ConnectionNotFoundException + { + try + { + // Avoid loading whatever class from the system using handler + // as package name. + Class clazz = Class.forName("com.nokia.mj.impl.rt." + handlerName + ".SchemeHandler"); + + SchemeHandlerBase handler = (SchemeHandlerBase)clazz.newInstance(); + + handler.execute(url); + return false; // No need to close MIDlet. + } + catch (Throwable t) + { + Logger.ELOG(Logger.EJavaRuntime, "Cannot invoke scheme handler: " + t.toString()); + // ClassNotFoundException, IllegalAccessException or InstantionException. + throw new ConnectionNotFoundException("Handler not found for URL"); + } + } + + private void enforceSecurityDomain(int type, String domain) + throws ConnectionNotFoundException + { + if (DOMAIN_MANUFACTURER_OR_OPERATOR == type) + { + if ((ApplicationInfo.MANUFACTURER_DOMAIN.equals(domain) != true) && + (ApplicationInfo.OPERATOR_DOMAIN.equals(domain) != true)) + { + Logger.WLOG(Logger.EJavaRuntime, + "Only manufacturer or operator domain MIDlets can invoke scheme"); + + throw new ConnectionNotFoundException( + "Request allowed only for manufacturer or operator MIDlets"); + } + } + else + { + Logger.ELOG(Logger.EJavaRuntime, + "Security enforcement failed: unknown domain category"); + + throw new ConnectionNotFoundException( + "Security enforcement failed: unknown domain category"); + } + } + /*** ----------------------------- NATIVE ----------------------------- */ private native void _managePlatformRequest(String url); diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/midp/runtimestarter/build/javamidpstarter_0x2002DCC0.mmp --- a/javaruntimes/midp/runtimestarter/build/javamidpstarter_0x2002DCC0.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/midp/runtimestarter/build/javamidpstarter_0x2002DCC0.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -100,7 +101,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/midp/runtimestarter/src/midpruntimestarter.cpp --- a/javaruntimes/midp/runtimestarter/src/midpruntimestarter.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/midp/runtimestarter/src/midpruntimestarter.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -63,7 +63,7 @@ MidpRuntimeStarter::MidpRuntimeStarter(): mMidletInfo(new MidletInfo()), // codescanner::nonleavenew - mRuntimeState(Constructed), mShudownOk(false) + mRuntimeState(Constructed), mShudownOk(false) { JELOG2(EJavaRuntime); } @@ -350,8 +350,6 @@ void MidpRuntimeStarter::startCoreUi(std::auto_ptr& coreUiLoader) { - CoreUi& coreUi = CoreUi::getUiInstance(coreUiLoader); - // Create the default UI only if not going into pre-warmed state. if (!mMidletInfo->mPreWarmStart) { @@ -442,7 +440,7 @@ // Start the coreUI. JavaOsLayer::startUpTrace("Starting CoreUI", -1, -1); - coreUi.start(mMidletInfo->mMIDletUid, &uiParams); + CoreUi::start(coreUiLoader, mMidletInfo->mMIDletUid, &uiParams); JavaOsLayer::startUpTrace("CoreUI started", -1, -1); getMIDletSuiteInfoFromStorage(javaStorage.get(), JAR_PATH, @@ -610,16 +608,16 @@ if (c & 0xFF00) { // 16 bit char, must send all bits - res += ( L'A' + (c >> 12) ); - res += ( L'A' + ((c & 0x0F00) >> 8) ); - res += ( L'A' + ((c & 0x00F0) >> 4) ); - res += ( L'A' + ((c & 0x000F)) ); + res += (L'A' + (c >> 12)); + res += (L'A' + ((c & 0x0F00) >> 8)); + res += (L'A' + ((c & 0x00F0) >> 4)); + res += (L'A' + ((c & 0x000F))); } else { // 8 bit char, send only lowest 8 bits - res += ( L'a' + ((c & 0x00F0) >> 4) ); - res += ( L'a' + ((c & 0x000F)) ); + res += (L'a' + ((c & 0x00F0) >> 4)); + res += (L'a' + ((c & 0x000F))); } } diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/standalone/build/javastarter_0x2002E6A7.mmp --- a/javaruntimes/standalone/build/javastarter_0x2002E6A7.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/standalone/build/javastarter_0x2002E6A7.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -97,7 +98,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/standalone/src/javastarterimpl.cpp --- a/javaruntimes/standalone/src/javastarterimpl.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/standalone/src/javastarterimpl.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -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" @@ -171,12 +171,12 @@ } JavaStarterImpl::JavaStarterImpl(const std::list& args): - mJvmStarter(0), - mRuntimeStarterUtils(0), - mOriginalArgs(args), - mShudownOk(false), - mIsMainApp(true), - mConfiguration(JvmStarter::UNDEFINED) + mJvmStarter(0), + mRuntimeStarterUtils(0), + mOriginalArgs(args), + mShudownOk(false), + mIsMainApp(true), + mConfiguration(JvmStarter::UNDEFINED) { JELOG2(EJavaRuntime); @@ -212,14 +212,21 @@ // Create the start screen and start it if needed. std::auto_ptr coreUiLoader; - CoreUi& coreUi = CoreUi::getUiInstance(coreUiLoader); if (mUiParams.getScreenMode() != NO_START_SCREEN) { LOG(EJavaRuntime, EInfo, "StartUI"); - coreUi.start(mAppUid, &mUiParams); + CoreUi::start(coreUiLoader, mAppUid, &mUiParams); LOG(EJavaRuntime, EInfo, "StartUI ok"); } + // Add the rest of the JVM args. + for (std::list::const_iterator iter = mFlagArgs.begin(); + iter != mFlagArgs.end(); ++iter) + { + LOG1(EJavaRuntime, EInfo, "Adding args %S", iter->c_str()); + mJvmStarter->appendRawJvmArgument(*iter); + } + // Sets the -jar, -jad, -cp (or -classpath) args if were provided. // Also a main class is set if needed. handleJadJarCpArgs(); diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/starter/build/javamidp_0x102033E6.mmp --- a/javaruntimes/starter/build/javamidp_0x102033E6.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/starter/build/javamidp_0x102033E6.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -47,6 +47,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -99,7 +100,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/starterutils/build/exports.inf --- a/javaruntimes/starterutils/build/exports.inf Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/starterutils/build/exports.inf Wed Sep 15 12:05:25 2010 +0300 @@ -17,6 +17,8 @@ PRJ_EXPORTS +#include "../../../inc/build_defines.hrh" + ../inc/jvmstarter.h |../../../javaruntimes/inc/jvmstarter.h ../inc/runtimestarterutils.h |../../../javaruntimes/inc/runtimestarterutils.h diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/starterutils/build/javaruntimestarterutils_0x2002DCCC.mmp --- a/javaruntimes/starterutils/build/javaruntimestarterutils_0x2002DCCC.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/starterutils/build/javaruntimestarterutils_0x2002DCCC.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -107,7 +108,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javaruntimes/starterutils/src.s60/j9starters60.cpp --- a/javaruntimes/starterutils/src.s60/j9starters60.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javaruntimes/starterutils/src.s60/j9starters60.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -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" @@ -55,8 +55,8 @@ J9StarterS60::J9StarterS60() #ifdef __WINSCW__ - : - mVariant(0) + : + mVariant(0) #endif // __WINSCW__ { JELOG2(EJavaRuntime); @@ -65,8 +65,8 @@ J9StarterS60::J9StarterS60(const Configuration configuration, const std::wstring& indetifier) #ifdef __WINSCW__ - : - mVariant(0) + : + mVariant(0) #endif // __WINSCW__ { JELOG2(EJavaRuntime); @@ -112,7 +112,6 @@ mJvmArgs.push_back(L"-Xmso16k"); // Native thread stack size. mJvmArgs.push_back(L"-Dcom.nokia.mj.impl.rt.ui=" L"com.nokia.mj.impl.rt.ui.avkon.RuntimeUiAvkon"); - mJvmArgs.push_back(L"-Dcom.nokia.coreui=coreuiavkon"); #endif // RD_JAVA_UI_QT mJvmArgs.push_back(L"-Dfile.encoding=ISO-8859-1"); @@ -184,7 +183,7 @@ void J9StarterS60::doOverideHeap(const std::wstring& arg, const std::wstring& size) { JELOG2(EJavaRuntime); - std::wstring maxHeapArg(arg); + std::wstring maxHeapArg(arg); maxHeapArg += size; maxHeapArg += L"K"; mJvmArgs.push_back(maxHeapArg); diff -r d5e927d5853b -r 7cee158cb8cd javatools/bld.inf --- a/javatools/bld.inf Tue Sep 14 21:06:50 2010 +0300 +++ b/javatools/bld.inf Wed Sep 15 12:05:25 2010 +0300 @@ -23,4 +23,5 @@ #include "javacontrolpanel/starter/build/bld.inf" #include "javacontrolpanel/controlpanel/build/bld.inf" #include "javasecuritycustomization/build/bld.inf" +#include "javafinishjrtinstall/build/bld.inf" #include "testcerts/bld.inf" diff -r d5e927d5853b -r 7cee158cb8cd javatools/javacontrolpanel/controlpanel/build/javacontrolpanel_0x2002FF62.mmp --- a/javatools/javacontrolpanel/controlpanel/build/javacontrolpanel_0x2002FF62.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javatools/javacontrolpanel/controlpanel/build/javacontrolpanel_0x2002FF62.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -104,7 +105,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javatools/javacontrolpanel/starter/build/javacontrolpanel_0x2002FF61.mmp --- a/javatools/javacontrolpanel/starter/build/javacontrolpanel_0x2002FF61.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javatools/javacontrolpanel/starter/build/javacontrolpanel_0x2002FF61.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -47,6 +47,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -100,7 +101,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javatools/javafinishjrtinstall/build/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javafinishjrtinstall/build/bld.inf Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Generated bld.inf -file +* +*/ + +PRJ_PLATFORMS +default + +PRJ_MMPFILES +javafinishjrtinstall_0x20031E4D.mmp diff -r d5e927d5853b -r 7cee158cb8cd javatools/javafinishjrtinstall/build/javafinishjrtinstall.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javafinishjrtinstall/build/javafinishjrtinstall.pro Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,38 @@ +# +# 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 application is executed by the native installer +# after a new version of Jrt has been installed from +# .sisx package on top of older Jrt version (e.g. when +# updating Jrt 2.1 to Jrt 2.2 via IAD). +# This application restarts Java Captain so that new +# version of the Jrt dlls is taken into use. +# All running MIDlets exit when Java Captain closes. +# + +TEMPLATE=app +TARGET=javafinishjrtinstall +CONFIG += omj no_icon stl +CONFIG -= qt + +symbian { + TARGET.EPOCSTACKSIZE = 0x5000 + TARGET.UID3 = 0x20031E4D + TARGET.CAPABILITY = PowerMgmt + + SOURCES += ../src.s60/*.cpp + + LIBS += -ljavautils -ljavacomms + } + +include(../../../build/omj.pri) diff -r d5e927d5853b -r 7cee158cb8cd javatools/javafinishjrtinstall/build/javafinishjrtinstall_0x20031E4D.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javafinishjrtinstall/build/javafinishjrtinstall_0x20031E4D.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,129 @@ +/* +* 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 : javafinishjrtinstall.mmp +// ============================================================================== + +TARGET javafinishjrtinstall.exe +TARGETTYPE EXE + +UID 0 0x20031E4D +SECUREID 0x20031E4D + +EPOCSTACKSIZE 0x5000 +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_PIM_MULTICAL_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.s60 +SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5 +SYSTEMINCLUDE /epoc32/include/mw +SYSTEMINCLUDE . + +SOURCEPATH ../src.s60 +SOURCE main.cpp + + +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 efsrv.lib +LIBRARY charconv.lib +LIBRARY ws32.lib +LIBRARY hal.lib +LIBRARY gdi.lib +LIBRARY apgrfx.lib +STATICLIBRARY libcrt0.lib + +CAPABILITY PowerMgmt + +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.525 + +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 d5e927d5853b -r 7cee158cb8cd javatools/javafinishjrtinstall/src.s60/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javatools/javafinishjrtinstall/src.s60/main.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,90 @@ +/* +* 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 application is executed by the native installer +* after a new version of Jrt has been installed from +* .sisx package on top of older Jrt version (e.g. when +* updating Jrt 2.1 to Jrt 2.2 via IAD). +* This application restarts Java Captain so that new +* version of the Jrt dlls is taken into use. +* All running MIDlets exit when Java Captain closes. +*/ + + +#include +#include +#include +#include + +#include "comms.h" +#include "commsclientendpoint.h" +#include "commsmessage.h" +#include "coremessages.h" +#include "logger.h" +#include "rtcmessages.h" + +using namespace java::comms; +using namespace java::captain; + + +void stopJavaCaptain() +{ + 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); + int rc = comms.send(message); + while (rc == 0) + { + sleep(1); + WLOG(EJavaConverters, "javafinishjrtinstall: Waiting JavaCaptain to exit..."); + rc = comms.send(message); + } + comms.disconnect(); +} + + +void startJavaCaptain() +{ + _LIT(KJavaCaptainExe, "javacaptain.exe"); + _LIT(KJavaCaptainArg, ""); + RProcess proc; + int err = proc.Create(KJavaCaptainExe, KJavaCaptainArg); + if (err == KErrNone) + { + proc.Resume(); + LOG(EJavaConverters, EInfo, + "javafinishjrtinstall: startJavaCaptain javacaptain.exe was started ok"); + } + else + { + ELOG1(EJavaConverters, + "javafinishjrtinstall: startJavaCaptain start javacaptain.exe failed: %d", err); + } + proc.Close(); +} + + +/** + * Create cleanup stack and run the cleaner code inside TRAP harness + * to log unexpected leaves. + */ +TInt E32Main() +{ + CTrapCleanup* cleanupStack = CTrapCleanup::New(); + stopJavaCaptain(); + startJavaCaptain(); + delete cleanupStack; + return KErrNone; +} diff -r d5e927d5853b -r 7cee158cb8cd javatools/javasecuritycustomization/build/javasecuritycustomization_0x20028786.mmp --- a/javatools/javasecuritycustomization/build/javasecuritycustomization_0x20028786.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javatools/javasecuritycustomization/build/javasecuritycustomization_0x20028786.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -46,6 +46,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -98,7 +99,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javatools/javatools.pro --- a/javatools/javatools.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javatools/javatools.pro Wed Sep 15 12:05:25 2010 +0300 @@ -19,5 +19,6 @@ SUBDIRS += javacontrolpanel/starter/build/javacontrolpanel.pro SUBDIRS += javacontrolpanel/controlpanel/build/javacontrolpanel.pro SUBDIRS += javasecuritycustomization/build/javasecuritycustomization.pro +SUBDIRS += javafinishjrtinstall/build/javafinishjrtinstall.pro BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"testcerts/bld.inf\"" BLD_INF_RULES.prj_extensions += "prj_extensions" diff -r d5e927d5853b -r 7cee158cb8cd javatools/subsystem.mk --- a/javatools/subsystem.mk Tue Sep 14 21:06:50 2010 +0300 +++ b/javatools/subsystem.mk Wed Sep 15 12:05:25 2010 +0300 @@ -42,6 +42,11 @@ usersettingsconfigurator/build \ javarestoreconverter/build +else + +COMPONENTS += \ + javafinishjrtinstall/build + endif NONQTSUBSYSTEMS += \ diff -r d5e927d5853b -r 7cee158cb8cd javatools/tckrunner/runner/build/tckrunner_0x2002DCE3.mmp --- a/javatools/tckrunner/runner/build/tckrunner_0x2002DCE3.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javatools/tckrunner/runner/build/tckrunner_0x2002DCE3.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -94,7 +95,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javatools/tckrunner/starter/build/tckrunner_0x2002121E.mmp --- a/javatools/tckrunner/starter/build/tckrunner_0x2002121E.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javatools/tckrunner/starter/build/tckrunner_0x2002121E.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -47,6 +47,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -100,7 +101,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/amms_akn/build/javaamms.pro --- a/javauis/amms_akn/build/javaamms.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/amms_akn/build/javaamms.pro Wed Sep 15 12:05:25 2010 +0300 @@ -63,14 +63,14 @@ -lAudioEqualizerUtility \ -lCustomCommandUtility \ -lDistanceAttenuationEffect \ - -lDopplerBase \ + -lDopplerbase \ -lEnvironmentalReverbEffect \ -lEnvironmentalReverbUtility \ -lListenerDopplerEffect \ -lListenerLocationEffect \ -lListenerOrientationEffect \ -lLocationBase \ - -lMediaClientAudio \ + -lmediaclientaudio \ -lOrientationBase \ -lRoomLevelEffect \ -lSourceDopplerEffect \ diff -r d5e927d5853b -r 7cee158cb8cd javauis/amms_akn/build/javaamms_0x2002DC96.mmp --- a/javauis/amms_akn/build/javaamms_0x2002DC96.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/amms_akn/build/javaamms_0x2002DC96.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -48,6 +48,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -179,14 +180,14 @@ LIBRARY AudioEqualizerUtility.lib LIBRARY CustomCommandUtility.lib LIBRARY DistanceAttenuationEffect.lib -LIBRARY DopplerBase.lib +LIBRARY Dopplerbase.lib LIBRARY EnvironmentalReverbEffect.lib LIBRARY EnvironmentalReverbUtility.lib LIBRARY ListenerDopplerEffect.lib LIBRARY ListenerLocationEffect.lib LIBRARY ListenerOrientationEffect.lib LIBRARY LocationBase.lib -LIBRARY MediaClientAudio.lib +LIBRARY mediaclientaudio.lib LIBRARY OrientationBase.lib LIBRARY RoomLevelEffect.lib LIBRARY SourceDopplerEffect.lib @@ -213,7 +214,6 @@ LIBRARY libdl.lib LIBRARY cone.lib LIBRARY eikcore.lib -LIBRARY mediaclientaudio.lib LIBRARY eikcoctl.lib LIBRARY eiksrv.lib LIBRARY apparc.lib @@ -234,7 +234,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/inc/javacoreui.h --- a/javauis/coreui/inc/javacoreui.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/coreui/inc/javacoreui.h Wed Sep 15 12:05:25 2010 +0300 @@ -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" @@ -20,9 +20,11 @@ #include +#include "libraryloaderexception.h" #include "dynamiclibloader.h" #include "javauid.h" #include "javacoreuiparams.h" +#include "logger.h" namespace java // codescanner::namespace { @@ -72,93 +74,88 @@ * @param[out] loader User must store this argument as long as it needs * to run any code in the shared library. No other APIs of the loader is needed to use. - * @return A reference to instance implementing CoreUi in + * @return true if the dll could be loaded and the start method was + * succesfully called. * success case. * @throws java::util::ExceptionBase or std::exception in error cases. */ - static CoreUi& - getUiInstance(std::auto_ptr& loader); + static bool start(std::auto_ptr& loader, + const java::util::Uid& appUid, + CoreUiParams* uiParams = 0); /** * This inline method will close the core UI unless already closed and * clean resources. * * @param[in] loader A loeader that was used to load the dll. + * @return true if the dll could be loaded and the release method was + * succesfully called. * @throws java::util::ExceptionBase or std::exception in error cases. */ - static void releaseUi(const std::auto_ptr& loader); + static bool releaseUi(std::auto_ptr& loader); }; -#if defined RD_JAVA_UI_QT -// This is an empty CoreUi impl for Java 3.0 -class CoreUiStub : public CoreUi -{ -public: - CoreUiStub() {} - virtual ~CoreUiStub() {} - virtual void init(const java::util::Uid& /*midletUid*/, - CoreUiParams* /*uiParams*/) {} - - virtual void start(const java::util::Uid& appUid, - CoreUiParams* uiParams = 0) {} -}; -#endif // RD_JAVA_UI_QT - -} //end namespace ui -} //end namespace java +} // end namespace ui +} // end namespace java -//START OF INLINE METHODS +const char* const COREUI_LIB_NAME = "javacoreui"; +// START OF INLINE METHODS inline java::ui::CoreUi::~CoreUi() {} -inline java::ui::CoreUi& java::ui::CoreUi::getUiInstance -(std::auto_ptr& loader) +inline bool java::ui::CoreUi::start( + std::auto_ptr& loader, + const java::util::Uid& appUid, + CoreUiParams* uiParams) { -#if defined RD_JAVA_UI_QT - - // The stub impl leaks memory, but is ok, since this - // is not in use in MCL, but is for future development - // enabler. - CoreUiStub* stub = new CoreUiStub(); - return *stub; - -#else // RD_JAVA_UI_QT - if (loader.get() == 0) { - //Create an instance of DynamicLibLoader. - loader.reset(new java::util::DynamicLibLoader("javacoreui")); + // Create an instance of DynamicLibLoader. + loader.reset(new java::util::DynamicLibLoader(COREUI_LIB_NAME)); } - //Load the javaui and locates method getUiInstance. If getFunction - //succeeds were are certain that createUiFunc points to valid method. - GetUiInstance getUiInstance = - reinterpret_cast(loader->getFunction("getUiInstance", - true)); - - //Call the method which will create the UI. - return getUiInstance(); - -#endif // RD_JAVA_UI_QT + try + { + // Load the javaui and locates method getUiInstance. If getFunction + // succeeds were are certain that createUiFunc points to valid method. + GetUiInstance getUiInstance = + reinterpret_cast(loader->getFunction("getUiInstance", + true)); + // Call the method which will create the UI. + getUiInstance().start(appUid, uiParams); + return true; + } + catch (java::util::LibraryLoaderException& ex) + { + loader.reset(); + LOG1(EJavaUI, EInfo, "No coreUi available (start): %s", ex.toString().c_str()); + } + return false; } -inline void java::ui::CoreUi::releaseUi( - const std::auto_ptr& loader) +inline bool java::ui::CoreUi::releaseUi( + std::auto_ptr& loader) { -#ifndef RD_JAVA_UI_QT - //Load the javaui and locates method getUiInstance. If getFunction - //succeeds were are certain that createUiFunc points to valid method. - ReleaseUi releaseUi = - reinterpret_cast(loader->getFunction("releaseUi", true)); + if (loader.get() == 0) + { + // Create an instance of DynamicLibLoader. + loader.reset(new java::util::DynamicLibLoader(COREUI_LIB_NAME)); + } + try + { + ReleaseUi releaseUi = + reinterpret_cast(loader->getFunction("releaseUi", true)); - //Call the method which will release UI resources. - releaseUi(); - -#else // RD_JAVA_UI_QT - - return; - -#endif // RD_JAVA_UI_QT + // Call the method which will release UI resources. + releaseUi(); + return true; + } + catch (java::util::LibraryLoaderException& ex) + { + loader.reset(); + LOG1(EJavaUI, EInfo, "No coreUi available (release): %s", ex.toString().c_str()); + } + return false; } #endif // JAVACOREUI_H diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/build/exports.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/build/exports.inf Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,25 @@ +/* +* 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 + +#include "../../../../inc/build_defines.hrh" +#ifdef RD_JAVA_SYMBIAN_TARGET +../tst.bat /epoc32/winscw/c/tst.bat +../tst2.bat /epoc32/winscw/c/tst2.bat +#endif // RD_JAVA_SYMBIAN_TARGET + diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/build/testcoreui.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/build/testcoreui.pro Wed Sep 15 12:05:25 2010 +0300 @@ -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=testcoreui +CONFIG += omj no_icon stl +CONFIG -= qt + +LIBS += -lCppUTest + +INCLUDEPATH += ../../../../tools/cpputest/include/CppUTest +INCLUDEPATH += ../testcoreui/src + +symbian { + INCLUDEPATH += ../../../../tools/cpputest/include/Platforms/Symbian + TARGET.CAPABILITY = all -tcb +} + +!symbian { +INCLUDEPATH += ../../../../tools/cpputest/include/Platforms/Gcc +LIBPATH += ../../../../tools/cpputest/lib +} + +SOURCES += ../src/*.cpp + +include(../../../../build/omj.pri) diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/readme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/readme.txt Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,11 @@ +This test set tests the coreui framework - both native and Java. + +Precoditions: + -This test will override the javacoreui.dll. This requirtes that before + compiling the test set run clean first. + -Compile the test sets from the root of the tsrc. + +To run test start eshell and run tst.bat. Then remove the javacoreui.dll from +epoc32\release\winscw\udeb\ directory and run tst2.bat. + +After tests recompile coreui_akn or coreui_qt. \ No newline at end of file diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/src/alltests.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/src/alltests.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: AllTests +* +*/ + +#include "Platform.h" +#include "CommandLineTestRunner.h" + +int main(int ac, char** av) +{ + return CommandLineTestRunner::RunAllTests(ac, av); +} diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/src/testcoreui.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/src/testcoreui.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,285 @@ +/* +* 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: Tests for JvmStarter class +* +*/ + +#include +#include +#include + +#include "coreuitestimpl.h" +#include "dynamiclibloader.h" + +#include "TestHarness.h" +#include "testutils.h" +#include "javaoslayer.h" +#include "logger.h" + +using namespace java::util; +using namespace java::ui; + + +class CoreUiTestHandlerImpl : public CoreUiTestHandler +{ +public: + CoreUiTestHandlerImpl() : mUiParams(0) + { + reset(); + } + ~CoreUiTestHandlerImpl() + { + delete mUiParams; + mUiParams = 0; + } + + virtual void startCalled(const Uid& midletUid, CoreUiParams* uiParams) + { + mMidletUid = midletUid; + if (mUiParams) + { + delete mUiParams; + mUiParams = 0; + } + if (uiParams) + { + mUiParams = new CoreUiParams(); + *mUiParams = *uiParams; + } + mStartCalledCount++; + } + virtual void releaseCalled() + { + mReleaseCalledCount++; + } + virtual void error(const std::string& info) + { + CHECKWITHNOTE(false, info) + } + + void reset() + { + mStartCalledCount = 0; + mReleaseCalledCount = 0; + } + int mStartCalledCount; + int mReleaseCalledCount; + CoreUiParams* mUiParams; + Uid mMidletUid; +}; + +#define UIPARAMSCHECK(check1, check2, fname, info) \ + CHECKWITHNOTE(check1 == check2, info << ": " << fname << " failed: 1=" << check1 << " 2=" << check2); + + +void compare(const CoreUiParams* uiParams1, const CoreUiParams* uiParams2, const std::string& info) +{ + bool pass = false; + if ((uiParams1 == 0 && uiParams2 != 0) || (uiParams1 != 0 && uiParams2 == 0)) + { + CHECKWITHNOTE(false, info << ": pointer mismatch 1=" << std::hex << uiParams1 << ", 2=" << std::hex << uiParams2); + return; + } + + if (uiParams1 == 0 && uiParams2 == 0) + { + return; + } + else if (uiParams1 != uiParams2) + { + pass = true; + } + CHECKWITHNOTE(pass, info << ": pointer mismatch 1=" << std::hex << uiParams1 << ", 2=" << std::hex << uiParams2); + UIPARAMSCHECK(uiParams1->getOrientation(), uiParams2->getOrientation(), "getOrientation", info); + UIPARAMSCHECK(uiParams1->getScreenMode(), uiParams2->getScreenMode(), "getScreenMode", info); + UIPARAMSCHECK(uiParams1->getImagePath(), uiParams2->getImagePath(), "getImagePath", info); + UIPARAMSCHECK(uiParams1->isBackgroundStart(), uiParams2->isBackgroundStart(), "isBackgroundStart", info); + +} + +void checkCallCounts(const CoreUiTestHandlerImpl& testHandler, int start, int release, const std::string& info) +{ + CHECKWITHNOTE(testHandler.mStartCalledCount == start, info <<". Start call count incorrect: " << testHandler.mStartCalledCount + <<", expecting: "< basicCoreUiLoader; + TEST_SETUP() + { + basicCoreUiLoader.reset(new java::util::DynamicLibLoader(COREUI_LIB_NAME)); + SetTestHandler setTestHandler = + reinterpret_cast(basicCoreUiLoader->getFunction("setTestHandler", + true)); + setTestHandler(&testHandler); + } + + TEST_TEARDOWN() + { + } +}; + + +// Run these tests with tst2.bat. These tests require that the javacoreui.dll +// doesn't exist at all. +TEST_GROUP(NoDllCoreUiTest) +{ + Uid uid; + TEST_SETUP() + { + } + + TEST_TEARDOWN() + { + } +}; + +TEST(TestCoreUi, testBasic) +{ + std::auto_ptr coreUiLoader; + // __BREAKPOINT(); + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid, &uiParams), "testBasic, start"); + checkCallCounts(testHandler, 1, 0, "Before release"); + CHECKWITHNOTE(CoreUi::releaseUi(coreUiLoader), "testBasic release"); + checkCallCounts(testHandler, 1, 1, "After release"); + compare(testHandler.mUiParams, &uiParams, "Final check basic"); +} + +TEST(TestCoreUi, testNullUiParams) +{ + std::auto_ptr coreUiLoader; + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid), "testNullUiParams, start"); + checkCallCounts(testHandler, 1, 0, "Before release"); + CHECKWITHNOTE(CoreUi::releaseUi(coreUiLoader), "testNullUiParams release"); + checkCallCounts(testHandler, 1, 1, "After release"); + compare(testHandler.mUiParams, 0, "Final check Null ui"); +} + +TEST(TestCoreUi, testModifiedOrientationArgs) +{ + std::auto_ptr coreUiLoader; + + uiParams.setOrientation(UNDEFINED); + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid, &uiParams), "testModifiedOrientationArgs, start1"); + checkCallCounts(testHandler, 1, 0, "Before release"); + compare(testHandler.mUiParams, &uiParams, "OrientationArgs UNDEFINED"); + + uiParams.setOrientation(LANDSCAPE); + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid, &uiParams), "testModifiedOrientationArgs, start2"); + checkCallCounts(testHandler, 2, 0, "Before release"); + compare(testHandler.mUiParams, &uiParams, "OrientationArgs LANDSCAPE"); + + uiParams.setOrientation(PORTRAIT); + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid, &uiParams), "testModifiedOrientationArgs, start3"); + checkCallCounts(testHandler, 3, 0, "Before release"); + compare(testHandler.mUiParams, &uiParams, "OrientationArgs PORTRAIT"); + + CHECKWITHNOTE(CoreUi::releaseUi(coreUiLoader), "testModifiedOrientationArgs release"); + checkCallCounts(testHandler, 3, 1, "After release"); +} + +TEST(TestCoreUi, testModifiedScreenModeArgs) +{ + std::auto_ptr coreUiLoader; + + uiParams.setScreenMode(NO_START_SCREEN); + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid, &uiParams), "testModifiedScreenModeArgs, start1"); + checkCallCounts(testHandler, 1, 0, "Before release"); + compare(testHandler.mUiParams, &uiParams, "ScreenModeArgs NO_START_SCREEN"); + + uiParams.setScreenMode(DEFAULT_START_SCREEN); + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid, &uiParams), "testModifiedScreenModeArgs, start2"); + checkCallCounts(testHandler, 2, 0, "Before release"); + compare(testHandler.mUiParams, &uiParams, "ScreenModeArgs DEFAULT_START_SCREEN"); + + uiParams.setScreenMode(MIDLET_DEFINED_SCREEN); + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid, &uiParams), "testModifiedScreenModeArgs, start3"); + checkCallCounts(testHandler, 3, 0, "Before release"); + compare(testHandler.mUiParams, &uiParams, "ScreenModeArgs MIDLET_DEFINED_SCREEN"); + + uiParams.setScreenMode(USER_DEFINED_SCREEN); + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid, &uiParams), "testModifiedScreenModeArgs, start4"); + checkCallCounts(testHandler, 4, 0, "Before release"); + compare(testHandler.mUiParams, &uiParams, "ScreenModeArgs USER_DEFINED_SCREEN"); + + CHECKWITHNOTE(CoreUi::releaseUi(coreUiLoader), "testModifiedScreenModeArgs release"); + checkCallCounts(testHandler, 4, 1, "After release"); +} + +TEST(TestCoreUi, testModifiedImagePathArgs) +{ + std::auto_ptr coreUiLoader; + + uiParams.setImagePath(L"c:\\logs\\java\\"); + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid, &uiParams), "testModifiedImagePathArgs start"); + checkCallCounts(testHandler, 1, 0, "Before release"); + compare(testHandler.mUiParams, &uiParams, "ImagePathArgs"); + + CHECKWITHNOTE(CoreUi::releaseUi(coreUiLoader), "testModifiedImagePathArgs release"); + checkCallCounts(testHandler, 1, 1, "After release"); +} + +TEST(TestCoreUi, testModifiedForeGroundArgs) +{ + std::auto_ptr coreUiLoader; + + uiParams.setBackgroundStart(true); + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid, &uiParams), "testModifiedForeGroundArgs start1"); + checkCallCounts(testHandler, 1, 0, "Before release"); + compare(testHandler.mUiParams, &uiParams, "ForeGround"); + + uiParams.setBackgroundStart(false); + CHECKWITHNOTE(CoreUi::start(coreUiLoader, uid, &uiParams), "testModifiedForeGroundArgs start2"); + checkCallCounts(testHandler, 2, 0, "Before release"); + compare(testHandler.mUiParams, &uiParams, "ForeGround"); + + CHECKWITHNOTE(CoreUi::releaseUi(coreUiLoader), "testModifiedForeGroundArgs release"); + checkCallCounts(testHandler, 2, 1, "After release"); +} + +TEST(TestCoreUi, testNoStartCall) +{ + std::auto_ptr coreUiLoader; + CHECKWITHNOTE(CoreUi::releaseUi(coreUiLoader), "testNoStartCall release"); + checkCallCounts(testHandler, 0, 1, "After release"); +} + +TEST(NoDllCoreUiTest, testBasic) +{ + std::auto_ptr coreUiLoader; + CHECKWITHNOTE(!CoreUi::start(coreUiLoader, uid), "testBasic NO_DLL start"); + CHECKWITHNOTE(!CoreUi::releaseUi(coreUiLoader), "testBasic NO_DLL release"); +} + +TEST(NoDllCoreUiTest, testOnlyStart) +{ + std::auto_ptr coreUiLoader; + CHECKWITHNOTE(!CoreUi::start(coreUiLoader, uid), "testOnlyStart NO_DLL start"); +} + +TEST(NoDllCoreUiTest, testOnlyRelease) +{ + std::auto_ptr coreUiLoader; + CHECKWITHNOTE(!CoreUi::releaseUi(coreUiLoader), "testOnlyRelease NO_DLL release"); +} diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/src/testutils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/src/testutils.h Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,33 @@ +/* +* 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: Test util +* +*/ + +#include + +#define CHECKWITHNOTE(check, note) \ +{\ + std::stringstream stream;\ + stream << note;\ + if (!(check))\ + {\ + ELOG1(EJavaRuntime, "TEST FAILURE: %s", stream.str().c_str());\ + FAIL(stream.str().c_str());\ + }\ + else\ + {\ + CHECK(true) /* Just to increase the check count*/ \ + }\ +} diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/subsystem.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/subsystem.mk Wed Sep 15 12:05:25 2010 +0300 @@ -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: +# + +include $(JAVA_SRC_ROOT)/build/Makefile.defs + +# Include the test frameworks. +SUBSYSTEMS = \ + $(JAVA_SRC_ROOT)/tools + +COMPONENTS = \ + testcoreui/build \ + build + +# Make dependency to those. +testcoreui/build build: $(JAVA_SRC_ROOT)/tools +include ${JAVA_SRC_ROOT}/build/Makefile.subsystem diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/testcoreui/build/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/testcoreui/build/build.xml Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,46 @@ + + + + + + + + + + Running CoreUiTests 1 + + + + + + Running CoreUiTests 01 + + + + + + Running CoreUiTests 001 + + + + + + + + + + diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/testcoreui/build/bwins/javacoreuiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/testcoreui/build/bwins/javacoreuiu.def Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,9 @@ +EXPORTS + ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *) + ?findDllMethod@@YAP6APAXXZPBD@Z @ 2 NONAME ; void * (*)(void) findDllMethod(char const *) + ??_ERuntimeException@runtime@java@@UAE@I@Z @ 3 NONAME ; java::runtime::RuntimeException::~RuntimeException(unsigned int) + ??_ELibraryLoaderException@util@java@@UAE@I@Z @ 4 NONAME ; java::util::LibraryLoaderException::~LibraryLoaderException(unsigned int) + ?setTestHandler@CoreUiTestImpl@ui@java@@SAXPAVCoreUiTestHandler@23@@Z @ 5 NONAME ; void java::ui::CoreUiTestImpl::setTestHandler(class java::ui::CoreUiTestHandler *) + ??0RuntimeException@runtime@java@@QAE@ABV012@@Z @ 6 NONAME ; java::runtime::RuntimeException::RuntimeException(class java::runtime::RuntimeException const &) + ??0LibraryLoaderException@util@java@@QAE@ABV012@@Z @ 7 NONAME ; java::util::LibraryLoaderException::LibraryLoaderException(class java::util::LibraryLoaderException const &) + diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/testcoreui/build/eabi/javacoreuiu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/testcoreui/build/eabi/javacoreuiu.def Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,5 @@ +EXPORTS + _Z10jni_lookupPKc @ 1 NONAME + _Z13findDllMethodPKc @ 2 NONAME + _ZN4java2ui14CoreUiTestImpl14setTestHandlerEPNS0_17CoreUiTestHandlerE @ 3 NONAME + diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/testcoreui/build/javacoreui.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/testcoreui/build/javacoreui.pro Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,22 @@ +# +# 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 build file of the Core UI test +# + +TEMPLATE=lib +TARGET=javacoreui +CONFIG += omj staticdata java stl +CONFIG -= qt + +include(../../../../../build/omj.pri) diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/testcoreui/javasrc/com/nokia/mj/impl/coreuitest/CoreUiImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/testcoreui/javasrc/com/nokia/mj/impl/coreuitest/CoreUiImpl.java Wed Sep 15 12:05:25 2010 +0300 @@ -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: Java side Core UI tester. +* +*/ +package com.nokia.mj.impl.coreuitest; + +import com.nokia.mj.impl.utils.Uid; +import com.nokia.mj.impl.coreui.CoreUi; + + +/** + * A gate to CoreUi test implementation. + */ +public class CoreUiImpl extends CoreUi +{ + private static int[] mCounters = new int[6]; + + static void resetCounters() + { + for (int i = 0; i < mCounters.length; ++i) + { + mCounters[i] = 0; + } + } + + static void checkCounters(int[] expected) + { + if (expected.length != mCounters.length) + { + throw new RuntimeException("expected.length != mCounters.length"); + } + for (int i = 0; i < mCounters.length; ++i) + { + if (mCounters[i] != expected[i]) + { + throw new RuntimeException("Index: " + i + " didn't match. Expected: " + + expected[i] + ", was: " + mCounters[i]); + } + } + } + + protected boolean connectToUiImpl() + { + mCounters[0]++; + return true; + } + + private static Uid mUid = null; + private static boolean mBackGroundStart = false; + + static void createUiImplCheck(Uid uid, boolean backGroundStart) + { + if (uid != mUid) + { + throw new RuntimeException("createUiImplCheck uid mismatch"); + } + if (backGroundStart != mBackGroundStart) + { + throw new RuntimeException("createUiImplCheck backGroundStart mismatch"); + } + mUid = null; + mBackGroundStart = false; + } + + protected void createUiImpl(Uid uid, boolean backGroundStart) + { + mCounters[1]++; + mUid = uid; + mBackGroundStart = backGroundStart; + } + + protected void shutdownRequestImpl() + { + mCounters[2]++; + } + + protected void foregroundRequestImpl() + { + mCounters[3]++; + } + + protected boolean isUiInForegroundImpl() + { + mCounters[4]++; + return true; + } + + private static boolean mHide = false; + + static void hideApplicationImplCheck(boolean hide) + { + if (mHide != hide) + { + throw new RuntimeException("hideApplicationImplCheck hide mismatch"); + } + mHide = false; + } + + protected void hideApplicationImpl(boolean hide) + { + mCounters[5]++; + mHide = hide; + } +} diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/testcoreui/javasrc/com/nokia/mj/impl/coreuitest/CoreUiTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/testcoreui/javasrc/com/nokia/mj/impl/coreuitest/CoreUiTests.java Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,213 @@ +/* +* 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.coreuitest; + + +import com.nokia.mj.impl.coreui.CoreUi; +import com.nokia.mj.impl.coreuitest.CoreUiImpl; +import com.nokia.mj.impl.rt.support.JvmInternal; +import com.nokia.mj.impl.utils.Uid; + + +import com.nokia.mj.impl.rt.test.UnitTestSuiteCreator; +import j2meunit.framework.Test; +import j2meunit.framework.TestCase; +import j2meunit.framework.TestMethod; +import j2meunit.framework.TestSuite; + +/** + * SystemProperty unit tests. + */ +public class CoreUiTests extends TestCase implements UnitTestSuiteCreator +{ + // Begin j2meunit test framework setup + public TestSuite createTestSuite(String[] args) + { + TestSuite suite = new TestSuite(this.getClass().getName()); + String testSelector = "0000000000000000"; + if (args.length > 1 && args[1] != null) + { + testSelector = args[1] + "0000000000000000"; + } + + if (testSelector.charAt(0) != '0') + { + suite.addTest(new CoreUiTests("AbNormalTests", new TestMethod() + { + public void run(TestCase tc) + { + ((CoreUiTests)tc).abNormalTests(); + } + })); + } + + if (testSelector.charAt(1) != '0') + { + suite.addTest(new CoreUiTests("AbNormalTests2", new TestMethod() + { + public void run(TestCase tc) + { + ((CoreUiTests)tc).abNormalTests2(); + } + })); + } + + if (testSelector.charAt(2) != '0') + { + suite.addTest(new CoreUiTests("NormalTests", new TestMethod() + { + public void run(TestCase tc) + { + ((CoreUiTests)tc).normalTests(); + } + })); + } + + return suite; + + } + + public CoreUiTests() + { + } + + public CoreUiTests(String aTestName, TestMethod aTestMethod) + { + super(aTestName, aTestMethod); + } + + // End j2meunit test framework setup + + protected void setUp() + { + } + + protected void tearDown() + { + } + + // Test cases + + private void abNormalTests() + { + System.out.println("abNormalTests"); + // Don't set the com.nokia.coreui property yet. + try + { + boolean res = CoreUi.connectToUi(); + assertTrue("Fail1, got: "+ res, res); + CoreUi.createUi(null, false); + + CoreUi.createUi(null, false); + CoreUi.shutdownRequest(); + CoreUi.foregroundRequest(); + + res = CoreUi.isUiInForeground(); + assertTrue("Fail2, got: "+ res, res); + CoreUi.hideApplication(false); + } + catch (Throwable t) + { + t.printStackTrace(); + assertTrue(t.toString(), false); + } + } + + + private void abNormalTests2() + { + System.out.println("abNormalTests2"); + // Set the com.nokia.coreui property to point nonexisitng class. + try + { + JvmInternal.setSystemProperty("com.nokia.coreui", "nonvalid"); + boolean res = CoreUi.connectToUi(); + assertTrue("No exception.", false); + } + catch (Error re) + { + int ind = re.toString().indexOf("Not able to instantiate class com.nokia.mj.impl.nonvalid.CoreUiImpl"); + boolean ok = ind >= 0; + if (!ok) + { + // Accept also java.lang.ExceptionInInitializerError. + ok = re.toString().equals("java.lang.ExceptionInInitializerError"); + } + assertTrue(re.toString(), ok); + } + catch (Throwable t2) + { + System.out.println("JOU2 "+ t2); + t2.printStackTrace(); + assertTrue(t2.toString(), false); + } + } + + private void normalTests() + { + // Set the com.nokia.coreui property to point valid class. + System.out.println("normalTests"); + try + { + JvmInternal.setSystemProperty("com.nokia.coreui", "coreuitest"); + boolean res = CoreUi.connectToUi(); + assertTrue("Fail1, got: "+ res, res); + + // Set a null value to UID and check that an exception is thrown. + try + { + CoreUi.createUi(null, false); + assertTrue("No exception.", false); + } + catch (NullPointerException ne) + { + } + + Uid uid = Uid.createUid("[12345678]"); + CoreUi.createUi(uid, true); + CoreUiImpl.createUiImplCheck(uid, true); + CoreUi.createUi(uid, false); + CoreUiImpl.createUiImplCheck(uid, false); + + CoreUi.shutdownRequest(); + + CoreUi.foregroundRequest(); + + res = CoreUi.isUiInForeground(); + assertTrue("Fail2, got: "+ res, res); + + CoreUi.hideApplication(true); + CoreUiImpl.hideApplicationImplCheck(true); + CoreUi.hideApplication(false); + CoreUiImpl.hideApplicationImplCheck(false); + + CoreUiImpl.checkCounters(new int[] {1,2,1,1,1,2}); + } + catch (Throwable t) + { + t.printStackTrace(); + assertTrue(t.toString(), false); + } + + } + +} + + + diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/testcoreui/src/coreuitestimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/testcoreui/src/coreuitestimpl.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,121 @@ +/* +* 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: A CoreUi TEST implementation. +* +*/ + +#include + +#include "logger.h" +#include "coreuitestimpl.h" +#include "runtimeexception.h" +#include "javacommonutils.h" + +using namespace java::ui; +using namespace java::util; + +// ======== STATIC VARIABLES ======== + +/** +* Singleton +*/ +static CoreUiTestImpl* sCoreUiTestImpl = 0; + +CoreUiTestImpl* getCoreUi() +{ + if (sCoreUiTestImpl == 0) + { + sCoreUiTestImpl = new CoreUiTestImpl(); // codescanner::nonleavenew + } + return sCoreUiTestImpl; +} + +OS_EXPORT void CoreUiTestImpl::setTestHandler(CoreUiTestHandler* testHandler) +{ + getCoreUi()->mTestHandler = testHandler; +} + +#ifndef __SYMBIAN32__ +extern "C" +#endif // __SYMBIAN32__ +void setTestHandler(CoreUiTestHandler* testHandler) +{ + CoreUiTestImpl::setTestHandler(testHandler); +} + +#ifndef __SYMBIAN32__ +extern "C" +#endif // __SYMBIAN32__ +CoreUi& getUiInstance() +{ + JELOG2(EJavaUI); + return *getCoreUi(); +} + +#ifndef __SYMBIAN32__ +extern "C" +#endif // __SYMBIAN32__ +void releaseUi() +{ + JELOG2(EJavaUI); + if (getCoreUi()->mTestHandler) + { + getCoreUi()->mTestHandler->releaseCalled(); + } + delete sCoreUiTestImpl; + sCoreUiTestImpl = 0; +} + +#ifdef __SYMBIAN32__ +EXPORT_C FuncPtr findDllMethod(const char* funcName) +{ + JELOG2(EJavaUI); + FuncPtr ptr = 0; + if (strcmp(funcName, "getUiInstance") == 0) + { + ptr = (FuncPtr)getUiInstance; + } + else if (strcmp(funcName, "releaseUi") == 0) + { + ptr = (FuncPtr)releaseUi; + } + else if (strcmp(funcName, "setTestHandler") == 0) + { + ptr = (FuncPtr)CoreUiTestImpl::setTestHandler; + } + return ptr; +} +#endif // __SYMBIAN32__ + +CoreUiTestImpl::CoreUiTestImpl() : mTestHandler(0) +{ + JELOG2(EJavaUI); +} + + +CoreUiTestImpl::~CoreUiTestImpl() +{ + JELOG2(EJavaUI); +} + + +void CoreUiTestImpl::start(const java::util::Uid& midletUid, + CoreUiParams* uiParams) +{ + JELOG2(EJavaUI); + if (mTestHandler) + { + mTestHandler->startCalled(midletUid, uiParams); + } +} diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/testcoreui/src/coreuitestimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/testcoreui/src/coreuitestimpl.h Wed Sep 15 12:05:25 2010 +0300 @@ -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 COREUITESTIMPL_H +#define COREUITESTIMPL_H + + +#include "javacoreui.h" + +#ifdef __SYMBIAN32__ + +#include "javasymbianoslayer.h" +/** + * For accessing the static methods using dynamic dll loading. + * @param funcName The name of the method to be searched. + * @return a pointer to found function, 0 if not found. + */ +IMPORT_C FuncPtr findDllMethod(const char* funcName); + +#endif //__SYMBIAN32__ + +namespace java // codescanner::namespace +{ +namespace ui // codescanner::namespace +{ + +OS_NONSHARABLE_CLASS(CoreUiTestHandler) +{ +public: + virtual void startCalled(const java::util::Uid& midletUid, + CoreUiParams* uiParams) = 0; + virtual void releaseCalled() = 0; + virtual void error(const std::string& info) = 0; +}; + +OS_NONSHARABLE_CLASS(CoreUiTestImpl) : public CoreUi +{ +public: + /** + * CoreUiTestImpl default constructor. + */ + CoreUiTestImpl(); + + /** + * CoreUiTestImpl destructor. + */ + virtual ~CoreUiTestImpl(); + + OS_IMPORT static void setTestHandler(CoreUiTestHandler* testHadler); + +public: // From CoreUi + /** + * This method will ask the UI to start the splash screen. + * @param appUid The Uid of the application. + * @param uiParams Ui configuration parameters. If it + * is null, the default arguments will be used. + * @throws java::util::ExceptionBase or std::exception in error cases. + */ + virtual void start(const java::util::Uid& midletUid, + CoreUiParams* uiParams); + +public: + CoreUiTestHandler* mTestHandler; +}; + + +} // end namespace ui +} // end namespace java + + +#endif // COREUITESTIMPL_H diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/tst.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/tst.bat Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,20 @@ +@rem +@rem Copyright (c) 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" +@rem which accompanies this distribution, and is available +@rem at the URL "http://www.eclipse.org/legal/epl-v10.html". +@rem +@rem Initial Contributors: +@rem Nokia Corporation - initial contribution. +@rem +@rem Contributors: +@rem +@rem Description: +@rem +@rem Script for running CoreUi unit tests from S60 eshell +testcoreui -nomemleaks -g TestCoreUi +javaunittester -conf=cldc -mainclass=com.nokia.mj.impl.coreuitest.CoreUiTests 1 +javaunittester -conf=cldc -mainclass=com.nokia.mj.impl.coreuitest.CoreUiTests 01 +javaunittester -conf=cldc -mainclass=com.nokia.mj.impl.coreuitest.CoreUiTests 001 diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui/tsrc/tst2.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/coreui/tsrc/tst2.bat Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,1 @@ +testcoreui -nomemleaks -g NoDllCoreUiTest diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui_akn/build/build.xml --- a/javauis/coreui_akn/build/build.xml Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/coreui_akn/build/build.xml Wed Sep 15 12:05:25 2010 +0300 @@ -1,5 +1,5 @@ - + + + + com.nokia.coreui=coreuiavkon + + diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui_akn/build/javacoreui.pro --- a/javauis/coreui_akn/build/javacoreui.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/coreui_akn/build/javacoreui.pro Wed Sep 15 12:05:25 2010 +0300 @@ -18,7 +18,7 @@ TARGET=javacoreui CONFIG += omj staticdata java stl CONFIG -= qt -LIBS += -laknicon \ +LIBS += -lAknIcon \ -laknlayout2 \ -laknskins \ -laknskinsrv \ diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui_akn/build/javacoreui_0x2002DCA8.mmp --- a/javauis/coreui_akn/build/javacoreui_0x2002DCA8.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/coreui_akn/build/javacoreui_0x2002DCA8.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -76,7 +77,7 @@ SOURCE startscreencontainer.cpp -LIBRARY aknicon.lib +LIBRARY AknIcon.lib LIBRARY aknlayout2.lib LIBRARY aknskins.lib LIBRARY aknskinsrv.lib @@ -122,7 +123,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui_akn/javasrc/com/nokia/mj/impl/coreuiavkon/CoreUiImpl.java --- a/javauis/coreui_akn/javasrc/com/nokia/mj/impl/coreuiavkon/CoreUiImpl.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/coreui_akn/javasrc/com/nokia/mj/impl/coreuiavkon/CoreUiImpl.java Wed Sep 15 12:05:25 2010 +0300 @@ -132,10 +132,16 @@ return _isForeground(); } + protected void hideApplicationImpl(boolean hide) + { + _hideApplication(hide); + } + private native boolean _connect(); private native boolean _createUi(String appUid, int orientation, int selectedScreenMode, String rootpath, boolean backGroundStart); private native void _toForeground(); private native boolean _isForeground(); + private native void _hideApplication(boolean hide); } diff -r d5e927d5853b -r 7cee158cb8cd javauis/coreui_akn/src/coreuijni.cpp --- a/javauis/coreui_akn/src/coreuijni.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/coreui_akn/src/coreuijni.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -17,6 +17,8 @@ #include "com_nokia_mj_impl_coreuiavkon_CoreUiImpl.h" +#include + #include "logger.h" #include "coreuiavkonimpl.h" #include "javauiavkonimpl.h" @@ -143,6 +145,17 @@ return success; } +void hideFromTaskManager(TBool aHide) +{ + CApaWindowGroupName* wgName = java::ui::CoreUiAvkonLcdui::getInstance().getWindowGroupName(); + if (wgName) + { + wgName->SetHidden(aHide); + // Refresh displayed name in tasklist + wgName->SetWindowGroupName(CCoeEnv::Static()->RootWin()); + } +} + void bringToForeGround() { CCoeEnv::Static()->RootWin().SetOrdinalPosition(0); @@ -219,3 +232,36 @@ } return fg; } + + +JNIEXPORT void JNICALL Java_com_nokia_mj_impl_coreuiavkon_CoreUiImpl__1hideApplication +(JNIEnv* env, jobject peer, jboolean hide) +{ + try + { + if (CoreUiAvkonImpl::isCoreUiCreated()) + { + int esHandle = CoreUiAvkonImpl::getInstanceImpl().getLcduiSupport().getEventServerHandle(); + if (esHandle > 0) + { + int handle = CoreUiEventSource::New(*env, peer, esHandle); + if (handle > 0) + { + CoreUiEventSource* es = JavaUnhand(handle); + es->ExecuteV(&hideFromTaskManager, (TBool)hide); + es->Dispose(*env); + } + } + } + } + catch (ExceptionBase& ex) + { + ELOG1(EJavaUI,"ERROR in core UI to hideApplication. ExceptionBase: %s", + ex.toString().c_str()); + } + catch (std::exception& e) + { + ELOG1(EJavaUI,"ERROR in core UI to hideApplication. std::exception: %s", + e.what()); + } +} diff -r d5e927d5853b -r 7cee158cb8cd javauis/eswt_akn/eswtapifacade/group/eswtapifacade.mmp --- a/javauis/eswt_akn/eswtapifacade/group/eswtapifacade.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/eswt_akn/eswtapifacade/group/eswtapifacade.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -20,6 +20,8 @@ #include #include +// Do not use global Java version for binaries +#define RD_JAVA_NO_BIN_VERSION // java/inc #include <../../../../inc/project_defines.hrh> @@ -83,9 +85,9 @@ LIBRARY avkon.lib -LIBRARY cdlengine.lib +LIBRARY CdlEngine.lib LIBRARY aknlayout2.lib -LIBRARY aknlayout2scalable.lib +LIBRARY AknLayout2Scalable.lib LIBRARY centralrepository.lib LIBRARY browserdialogsprovider.lib LIBRARY apengine.lib diff -r d5e927d5853b -r 7cee158cb8cd javauis/eswt_akn/eswtdirectcontent/build/eswtdirectcontent_0x2002DC94.mmp --- a/javauis/eswt_akn/eswtdirectcontent/build/eswtdirectcontent_0x2002DC94.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/eswt_akn/eswtdirectcontent/build/eswtdirectcontent_0x2002DC94.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM diff -r d5e927d5853b -r 7cee158cb8cd javauis/eswt_akn/eswtphysics/group/eswtphysics.mmp --- a/javauis/eswt_akn/eswtphysics/group/eswtphysics.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/eswt_akn/eswtphysics/group/eswtphysics.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -20,6 +20,9 @@ #include #include +// Do not use global Java version for binaries +#define RD_JAVA_NO_BIN_VERSION + // java/inc #include <../../../../inc/project_defines.hrh> #include <../../../../inc/java_stdcpp_support_for_dll.hrh> diff -r d5e927d5853b -r 7cee158cb8cd javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eswt.pro --- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eswt.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eswt.pro Wed Sep 15 12:05:25 2010 +0300 @@ -148,7 +148,7 @@ -LIBS += -laknicon \ +LIBS += -lAknIcon \ -laknhlist \ -laknlayout \ -laknpictograph \ @@ -163,11 +163,11 @@ -lbitgdi \ -lbitmaptransforms \ -lbmpanim \ - -lcdlengine \ + -lCdlEngine \ -lcentralrepository \ -lcommdb \ -lcommondialogs \ - -lcommonengine \ + -lCommonEngine \ -lcommonui \ -lcone \ -lecom \ diff -r d5e927d5853b -r 7cee158cb8cd javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eswt_0x2002DC93.mmp --- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eswt_0x2002DC93.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eswt_0x2002DC93.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -176,7 +177,7 @@ SOURCE imagescaler.cpp -LIBRARY aknicon.lib +LIBRARY AknIcon.lib LIBRARY aknhlist.lib LIBRARY aknlayout.lib LIBRARY aknpictograph.lib @@ -191,11 +192,11 @@ LIBRARY bitgdi.lib LIBRARY bitmaptransforms.lib LIBRARY bmpanim.lib -LIBRARY cdlengine.lib +LIBRARY CdlEngine.lib LIBRARY centralrepository.lib LIBRARY commdb.lib LIBRARY commondialogs.lib -LIBRARY commonengine.lib +LIBRARY CommonEngine.lib LIBRARY commonui.lib LIBRARY cone.lib LIBRARY ecom.lib diff -r d5e927d5853b -r 7cee158cb8cd javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcommandarranger.cpp --- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcommandarranger.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcommandarranger.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -445,10 +445,7 @@ iCbaCommands[cbaIndex]->Text()); // Dimming - if (!iCbaCommands[cbaIndex]->IsEnabled()) - { - iCba.DimCommand(commandId, ETrue); - } + iCba.DimCommand(commandId, !iCbaCommands[cbaIndex]->IsEnabled()); // Set default command if (iCbaCommands[cbaIndex] == iDefaultCommand) diff -r d5e927d5853b -r 7cee158cb8cd javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcontrolbase.cpp --- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcontrolbase.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcontrolbase.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -804,6 +804,18 @@ return EKeyWasConsumed; } } +#ifdef RD_JAVA_S60_RELEASE_9_2 + // On 9.2 MSK is never shown, so we have to always handle + // the Selection key + else if (aKeyEvent.iCode == EKeyOK && !IsKeyUsed(EKeyOK) + && commandArranger->IsContextSensitiveOperationSet()) + { + if (commandArranger->DoContextSensitiveOperationL()) + { + return EKeyWasConsumed; + } + } +#else else if (!AknLayoutUtils::MSKEnabled() || (activeTopShell && activeTopShell->FullScreenMode())) { @@ -819,6 +831,7 @@ } } } +#endif //RD_JAVA_S60_RELEASE_9_2 else if (aKeyEvent.iCode == EKeyEnter && !IsKeyUsed(EKeyEnter)) { if (commandArranger->HandleEnterKeyL()) diff -r d5e927d5853b -r 7cee158cb8cd javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/widgets/FontDialog.java --- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/widgets/FontDialog.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/widgets/FontDialog.java Wed Sep 15 12:05:25 2010 +0300 @@ -382,6 +382,7 @@ public void setRGB(RGB rgb) { resRgb = rgb; + resRgbChanged = true; } /** diff -r d5e927d5853b -r 7cee158cb8cd javauis/javalegacyutils/build/javalegacyutils.pro --- a/javauis/javalegacyutils/build/javalegacyutils.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/javalegacyutils/build/javalegacyutils.pro Wed Sep 15 12:05:25 2010 +0300 @@ -18,7 +18,7 @@ TARGET=javalegacyutils CONFIG += omj java staticdata stl CONFIG -= qt -LIBS += -lhal -lcommonengine +LIBS += -lhal -lCommonEngine include(../../../build/omj.pri) diff -r d5e927d5853b -r 7cee158cb8cd javauis/javalegacyutils/build/javalegacyutils_0x2002DCBB.mmp --- a/javauis/javalegacyutils/build/javalegacyutils_0x2002DCBB.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/javalegacyutils/build/javalegacyutils_0x2002DCBB.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -91,7 +92,7 @@ LIBRARY hal.lib -LIBRARY commonengine.lib +LIBRARY CommonEngine.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib @@ -121,7 +122,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/javalcdui/build/javalcdui.pro --- a/javauis/lcdui_akn/javalcdui/build/javalcdui.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/javalcdui/build/javalcdui.pro Wed Sep 15 12:05:25 2010 +0300 @@ -46,9 +46,9 @@ -lhwrmlightclient \ -lgfxtrans \ -lws32 \ - -lCentralRepository \ + -lcentralrepository \ #ifdef RD_JAVA_NGA_ENABLED - -llibegl \ + -llibEGL \ -llibglesv1_cm #endif // RD_JAVA_NGA_ENABLED diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/javalcdui/build/javalcdui_0x2002DCBA.mmp --- a/javauis/lcdui_akn/javalcdui/build/javalcdui_0x2002DCBA.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/javalcdui/build/javalcdui_0x2002DCBA.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -156,8 +157,8 @@ LIBRARY ws32.lib LIBRARY hwrmlightclient.lib LIBRARY gfxtrans.lib -LIBRARY CentralRepository.lib -LIBRARY libegl.lib +LIBRARY centralrepository.lib +LIBRARY libEGL.lib LIBRARY libglesv1_cm.lib LIBRARY javautils.lib LIBRARY libpthread.lib @@ -182,7 +183,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/javalcdui/inc/CMIDEnv.h --- a/javauis/lcdui_akn/javalcdui/inc/CMIDEnv.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/javalcdui/inc/CMIDEnv.h Wed Sep 15 12:05:25 2010 +0300 @@ -151,6 +151,16 @@ */ virtual MMIDToLcduiObserver& ToLcduiObserver(); + /** + * @see MMIDEnv#VideoOverlayEnabled() + */ + virtual TBool VideoOverlayEnabled() const; + + /** + * @see MMIDEnv#GetMMAPILock() + */ + RCriticalSection& GetMMAPILock(); + #ifdef RD_JAVA_NGA_ENABLED /** * @see MMIDEnv#IsHardwareAccelerated() @@ -275,6 +285,8 @@ */ CMIDToLcduiObserver* iToLcduiObserver; + TBool iVideoOverlayEnabled; + RCriticalSection iMMAPILock; #ifdef RD_JAVA_NGA_ENABLED TInt iHardwareStatus; TBool iFullOrPartialFg; diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/javalcdui/inc/lcdui.h --- a/javauis/lcdui_akn/javalcdui/inc/lcdui.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/javalcdui/inc/lcdui.h Wed Sep 15 12:05:25 2010 +0300 @@ -49,6 +49,7 @@ #include #include #include +#include #ifdef RD_JAVA_NGA_ENABLED #include @@ -124,6 +125,7 @@ _LIT(KUIEnhCanvasBackground, "canvashasbackground"); _LIT(KUIEnhPopUpTextBox, "popuptextbox"); _LIT(KUIEnhFullScreenTextBox, "fullscreentextbox"); +_LIT(KUIEnhVideoOverlay, "videooverlaysupported"); _LIT(KTrueValue, "true"); _LIT(KPauseValue, "pause"); _LIT(KRunValue, "run"); @@ -133,6 +135,8 @@ _LIT(KPositionRight, "right"); } +const TInt KHighlightedItemTextColor = EAknsCIQsnTextColorsCG8; +const TInt KNonHighlightedItemTextColor = EAknsCIQsnTextColorsCG6; /** @@ -721,6 +725,13 @@ */ EDrwOpcBitBltRect = 1 #endif // RD_JAVA_NGA_ENABLED + + /** + * Indicates start of drawing commands for canvas paint. + * Used only video overlay case. + * @since S60 9.2 + */ + ,EDrwOpcPaintStarted = 3 }; public: /** @@ -830,6 +841,16 @@ * @since S60 9.2 */ virtual void MidletExiting() = 0; + + /** + * Returns ETrue if video overlay is currently used in Canvas. + * ETrue is returned when: + * - overlay is enabled by the jad attribute + * - Canvas is not GameCanvas + * - Canvas has MMAPI content areas + * @since S60 9.2 + */ + virtual TBool IsVideoOverlayActive() = 0; #endif // RD_JAVA_NGA_ENABLED virtual TBool ReadyToBlit() const = 0; @@ -2480,6 +2501,13 @@ */ virtual TBool CanvasHasBackground(const MMIDCanvas& aCanvas) const = 0; + /** + * Checks if video overlays are enabled (by the jad attribute). + * @return ETrue if overlays are enabled. + * @since S60 9.2 + */ + virtual TBool VideoOverlayEnabled() const = 0; + #ifdef RD_JAVA_NGA_ENABLED /** @@ -2559,6 +2587,41 @@ * @since Java 2.1 */ virtual const MMIDDisplayable* LastFullscreenDisplayable() const = 0; + + /** + * Returns reference to RCriticalSection that should be used in all + * MMAPI related synchronization in LCDUI. + * + * @return referende to RCriticalSection + * @since Java 2.1 + */ + virtual RCriticalSection& GetMMAPILock() = 0; + + /** + * Autolocker class for RCriticalSection. + */ + class TCriticalSectionAutoLock + { + public: + /** + * Ctor + * @param aLock Syncronization primitive that is locked during construction + */ + TCriticalSectionAutoLock(RCriticalSection& aLock) : iLock(aLock) + { + iLock.Wait(); + } + + /** + * Dtor. Signals the synchronization primitive + */ + ~TCriticalSectionAutoLock() + { + iLock.Signal(); + } + private: + RCriticalSection& iLock; + }; }; /** diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/javalcdui/inc/reflcdui.h --- a/javauis/lcdui_akn/javalcdui/inc/reflcdui.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/javalcdui/inc/reflcdui.h Wed Sep 15 12:05:25 2010 +0300 @@ -86,11 +86,11 @@ virtual void MdcRemoveContent(MDirectContent* aContent) = 0; /** - * Adds content bound to this container. Container will not allow painting in this region + * Adds MMAPI content bound to this container. * * @param aRect Content bounds */ - virtual void MdcAddContentBounds(const TRect& aRect) = 0; + virtual void MdcAddMMAPIContentBounds(const TRect& aRect) = 0; /** * Removes one content bound from this container. @@ -98,7 +98,7 @@ * * @param aRect Content bound to be removed. */ - virtual void MdcRemoveContentBounds(const TRect& aRect) = 0; + virtual void MdcRemoveMMAPIContentBounds(const TRect& aRect) = 0; /** * Get a rect of a window (with respect to screen) on which content can be displayed. diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Canvas.java --- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Canvas.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Canvas.java Wed Sep 15 12:05:25 2010 +0300 @@ -61,7 +61,8 @@ private static final int ATTRIB_HEIGHT_INDEX = 2; private static final int ATTRIB_NATIVE_FRAME_BUFFER_INDEX = 3; private static final int ATTRIB_BACKGROUND_INDEX = 4; - private static final int ATTRIB_COUNT = 5; + private static final int ATTRIB_VIDEO_OVERLAY_INDEX = 5; + private static final int ATTRIB_COUNT = 6; /** * Static constants for media key keycodes @@ -94,6 +95,7 @@ * attribute is "CanvasHasBackground". The attribute may be placed in the JAD or the manifest. */ private boolean iHasBackgroundImage; + private boolean iVideoOverlayEnabled; private boolean iIsGameCanvas; private Object iPaintLock; @@ -133,6 +135,9 @@ iHasBackgroundImage = (canvasAttribs[ATTRIB_BACKGROUND_INDEX] != 0); + iVideoOverlayEnabled = + (canvasAttribs[ATTRIB_VIDEO_OVERLAY_INDEX] != 0); + // If is Toolkit activated, we can add Displayable to Vector // Displayables are removed from Vector when SizeChangedEvent arrives see Displayable.sizeChangedEvent() if (iToolkit.activated) @@ -446,6 +451,16 @@ { drawBackground(true); } + + if (iVideoOverlayEnabled) + { + // Send op code to native canvas about the start of paint, + // to enable overlays. This is done after + // drawBackground() so that framebuffer can be cleared + // correctly on native side. + iToolkit.canvasPaintStarted(getContentHandle()); + } + paint(graphics); } diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Image.java --- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Image.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Image.java Wed Sep 15 12:05:25 2010 +0300 @@ -325,16 +325,15 @@ public static Image createRGBImage(int[] aRgb, int aWidth, int aHeight, boolean aProcessAlpha) { - if (aRgb.length < (aWidth * aHeight)) - { - throw new ArrayIndexOutOfBoundsException(); - } - if (aWidth <= 0 || aHeight <= 0) { throw new IllegalArgumentException(); } + if (aRgb.length < (aWidth * aHeight) || (aWidth * aHeight) < 0) + { + throw new ArrayIndexOutOfBoundsException(); + } try { return new Image(aRgb, aWidth, aHeight, aProcessAlpha); diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Toolkit.java --- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Toolkit.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Toolkit.java Wed Sep 15 12:05:25 2010 +0300 @@ -151,6 +151,10 @@ // Op code indicating M3G content start private static final int M3G_CONTENT_START = 2; + // Used for notifying native canvas about start of paint method, + // needed by video overlay implementation + private static final int PAINT_START = 3; + Toolkit(ToolkitInvoker aInvoker) { iInvoker = aInvoker; @@ -689,6 +693,17 @@ } } + void canvasPaintStarted(int aDrawable) + { + if (checkFlags(FLAG_NGA)) + { + synchronized (iBuffer) + { + iBuffer.write(aDrawable, PAINT_START); + } + } + } + /** JSR 135 Support */ diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/game/LayerManager.java --- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/game/LayerManager.java Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/game/LayerManager.java Wed Sep 15 12:05:25 2010 +0300 @@ -108,7 +108,7 @@ final int transY = aGraphics.getTranslateY(); // intersect Graphics clip region with View Window - if ((iViewWidthiHasBackground = aToolkit->Env()->CanvasHasBackground(*canvas); - + aAttribs->iVideoOverlayEnabled = aToolkit->Env()->VideoOverlayEnabled(); } JNIEXPORT jint JNICALL Java_javax_microedition_lcdui_Canvas__1create @@ -77,10 +78,12 @@ create.iDisplayable=aDisplayable; create.iRef= aJni->NewWeakGlobalRef(aCanvas); create.iIsGameCanvas = aIsGameCanvas; + TCanvasAttribs attribs; attribs.iFrameBuffer=EFalse; + attribs.iHasBackground = EFalse; + attribs.iVideoOverlayEnabled = EFalse; - attribs.iHasBackground = EFalse; jint error; if (create.iRef) { @@ -97,14 +100,15 @@ aJni->DeleteWeakGlobalRef(create.iRef); } - ASSERT(aJni->GetArrayLength(aAttribsReturn) == 5); - jint attribsArray[5]; + ASSERT(aJni->GetArrayLength(aAttribsReturn) == 6); + jint attribsArray[6]; attribsArray[0] = static_cast< jint >(attribs.iHandle); attribsArray[1] = static_cast< jint >(attribs.iSize.iWidth); attribsArray[2] = static_cast< jint >(attribs.iSize.iHeight); attribsArray[3] = static_cast< jint >(attribs.iFrameBuffer); attribsArray[4] = static_cast< jint >(attribs.iHasBackground); - aJni->SetIntArrayRegion(aAttribsReturn, 0, 5, &attribsArray[0]); + attribsArray[5] = static_cast< jint >(attribs.iVideoOverlayEnabled); + aJni->SetIntArrayRegion(aAttribsReturn, 0, 6, &attribsArray[0]); LCDUI_DEBUG_INT2("Canvas_create(%x == %x)", handle, (TInt)MIDUnhandObject(handle)); return error; diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/build/lcdc16ma.mmp --- a/javauis/lcdui_akn/lcdgd/build/lcdc16ma.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdgd/build/lcdc16ma.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -54,6 +54,11 @@ START RESOURCE 10208168.RSS TARGET LCDC16MA.RSC END +SOURCEPATH ../resource +START RESOURCE 10208168_iad.RSS +TARGET LCDC16MA.RSC +TARGETPATH resource/java/iad +END LIBRARY euser.lib diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/build/lcdc16mu.mmp --- a/javauis/lcdui_akn/lcdgd/build/lcdc16mu.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdgd/build/lcdc16mu.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -54,6 +54,11 @@ START RESOURCE 10208166.RSS TARGET LCDC16MU.RSC END +SOURCEPATH ../resource +START RESOURCE 10208166_iad.RSS +TARGET LCDC16MU.RSC +TARGETPATH resource/java/iad +END LIBRARY euser.lib diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/build/lcdc4k.mmp --- a/javauis/lcdui_akn/lcdgd/build/lcdc4k.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdgd/build/lcdc4k.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -55,6 +55,10 @@ START RESOURCE 10208164.RSS TARGET LCDC4K.RSC END +START RESOURCE 10208164_iad.RSS +TARGET LCDC4K.RSC +TARGETPATH resource/java/iad +END LIBRARY euser.lib diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/build/lcdc64k.mmp --- a/javauis/lcdui_akn/lcdgd/build/lcdc64k.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdgd/build/lcdc64k.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -55,6 +55,10 @@ START RESOURCE 10208162.RSS TARGET LCDC64K.RSC END +START RESOURCE 10208162_iad.RSS +TARGET LCDC64K.RSC +TARGETPATH resource/java/iad +END LIBRARY euser.lib LIBRARY gdi.lib diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/resource/10208162.RSS --- a/javauis/lcdui_akn/lcdgd/resource/10208162.RSS Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdgd/resource/10208162.RSS Wed Sep 15 12:05:25 2010 +0300 @@ -22,6 +22,10 @@ #include #include "lcdgd.hrh" +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 2 +#endif + RESOURCE REGISTRY_INFO r_registry { resource_format_version = RESOURCE_FORMAT_VERSION_2; @@ -36,7 +40,7 @@ IMPLEMENTATION_INFO { implementation_uid = LCDGD_COLOR64K_IMPLEMENTATION_UID; - version_no = 2; + version_no = ECOM_VERSION_NO; display_name = "J2ME_COLOR64K_DRIVER"; default_data = LCDGD_COLOR64K_DRIVER_ID_STR; opaque_data = "0;"; diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/resource/10208162_iad.RSS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/lcdui_akn/lcdgd/resource/10208162_iad.RSS Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 3 + +// Include actual rss +#include "10208162.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/resource/10208164.RSS --- a/javauis/lcdui_akn/lcdgd/resource/10208164.RSS Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdgd/resource/10208164.RSS Wed Sep 15 12:05:25 2010 +0300 @@ -22,6 +22,10 @@ #include #include "lcdgd.hrh" +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 2 +#endif + RESOURCE REGISTRY_INFO r_registry { resource_format_version = RESOURCE_FORMAT_VERSION_2; @@ -36,7 +40,7 @@ IMPLEMENTATION_INFO { implementation_uid = LCDGD_COLOR4K_IMPLEMENTATION_UID; - version_no = 2; + version_no = ECOM_VERSION_NO; display_name = "J2ME_COLOR4K_DRIVER"; default_data = LCDGD_COLOR4K_DRIVER_ID_STR; opaque_data = "0;"; diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/resource/10208164_iad.RSS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/lcdui_akn/lcdgd/resource/10208164_iad.RSS Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 3 + +// Include actual rss +#include "10208164.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/resource/10208166.RSS --- a/javauis/lcdui_akn/lcdgd/resource/10208166.RSS Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdgd/resource/10208166.RSS Wed Sep 15 12:05:25 2010 +0300 @@ -22,6 +22,10 @@ #include #include "lcdgd.hrh" +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 2 +#endif + RESOURCE REGISTRY_INFO r_registry { resource_format_version = RESOURCE_FORMAT_VERSION_2; @@ -36,7 +40,7 @@ IMPLEMENTATION_INFO { implementation_uid = LCDGD_COLOR16MU_IMPLEMENTATION_UID; - version_no = 2; + version_no = ECOM_VERSION_NO; display_name = "J2ME_COLOR16MU_DRIVER"; default_data = LCDGD_COLOR16MU_DRIVER_ID_STR; opaque_data = "0;"; diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/resource/10208166_iad.RSS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/lcdui_akn/lcdgd/resource/10208166_iad.RSS Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 3 + +// Include actual rss +#include "10208166.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/resource/10208168.RSS --- a/javauis/lcdui_akn/lcdgd/resource/10208168.RSS Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdgd/resource/10208168.RSS Wed Sep 15 12:05:25 2010 +0300 @@ -22,6 +22,10 @@ #include #include "lcdgd.hrh" +#ifndef ECOM_VERSION_NO +#define ECOM_VERSION_NO 2 +#endif + RESOURCE REGISTRY_INFO r_registry { resource_format_version = RESOURCE_FORMAT_VERSION_2; @@ -36,7 +40,7 @@ IMPLEMENTATION_INFO { implementation_uid = LCDGD_COLOR16MA_IMPLEMENTATION_UID; - version_no = 2; + version_no = ECOM_VERSION_NO; display_name = "J2ME_COLOR16MA_DRIVER"; default_data = LCDGD_COLOR16MA_DRIVER_ID_STR; opaque_data = "0;"; diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgd/resource/10208168_iad.RSS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/javauis/lcdui_akn/lcdgd/resource/10208168_iad.RSS Wed Sep 15 12:05:25 2010 +0300 @@ -0,0 +1,23 @@ +/* +* 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 for IAD +* +*/ + +// Version for IAD +#define ECOM_VERSION_NO 3 + +// Include actual rss +#include "10208168.rss" + diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgr/build/lcdgr.mmp --- a/javauis/lcdui_akn/lcdgr/build/lcdgr.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdgr/build/lcdgr.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -87,7 +87,7 @@ LIBRARY gdi.lib LIBRARY bitgdi.lib LIBRARY fbscli.lib -LIBRARY ImageConversion.lib +LIBRARY imageconversion.lib LIBRARY lcdgdrv.lib LIBRARY bafl.lib library efsrv.lib diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdgr/src/CMIDGraphics.cpp --- a/javauis/lcdui_akn/lcdgr/src/CMIDGraphics.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdgr/src/CMIDGraphics.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -134,6 +134,12 @@ // need to be calculated. eglAvailable = ETrue; } + + // Use premultiplied colors in target bitmap if + // EGL surface is in use or Canvas has video overlay active. + TBool premultiplied = eglAvailable || + (iCanvasTarget && iCanvasTarget->IsVideoOverlayActive()); + #else // !RD_JAVA_NGA_ENABLED TBool CMIDGraphics::ProcessL( const TMIDBufferOp*& aRead, const TMIDBufferOp* aEnd, @@ -350,7 +356,7 @@ #ifndef RD_JAVA_NGA_ENABLED graphics.DrawImage(image, drawImage->iPoint, drawImage->iAnchor); #else // RD_JAVA_NGA_ENABLED - graphics.DrawImage(image, drawImage->iPoint, drawImage->iAnchor, eglAvailable); + graphics.DrawImage(image, drawImage->iPoint, drawImage->iAnchor, premultiplied); if (eglAvailable) { UpdateRect(CalcDstRect( @@ -378,7 +384,7 @@ graphics.DrawRegion( image, drawRegion->iSrcPosition, drawRegion->iSrcSize, drawRegion->iTransform, drawRegion->iDstPoint, - drawRegion->iAnchor, eglAvailable); + drawRegion->iAnchor, premultiplied); if (eglAvailable) { UpdateRect(CalcDstRect(drawRegion->iDstPoint, drawRegion->iSrcSize, @@ -495,6 +501,12 @@ premultiplied = ETrue; UpdateRect(aRect); } + + // Video overlay support + if (iCanvasTarget && iCanvasTarget->IsVideoOverlayActive()) + { + premultiplied = ETrue; + } #endif err = iGraphics->DrawPixels(aType, aAddress, aLength, aScanLength, diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/build/lcdui.mmp --- a/javauis/lcdui_akn/lcdui/build/lcdui.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/build/lcdui.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -160,7 +160,7 @@ LIBRARY ConnMon.lib // for network indicator on the fullcanvas LIBRARY etel3rdparty.lib // for call indicator on the fullcanvas -LIBRARY CentralRepository.lib +LIBRARY centralrepository.lib LIBRARY CommonEngine.lib // shared data stuff for form LIBRARY javalegacyutils.lib diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/inc/CMIDCanvas.h --- a/javauis/lcdui_akn/lcdui/inc/CMIDCanvas.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/inc/CMIDCanvas.h Wed Sep 15 12:05:25 2010 +0300 @@ -478,7 +478,7 @@ * @since S60 v3.0 * @param aRect Content bounds. */ - void MdcAddContentBounds(const TRect& aRect); + void MdcAddMMAPIContentBounds(const TRect& aRect); /** * From MDirectContainer. @@ -487,7 +487,7 @@ * @since S60 v3.2 * @param aRect Content bound to be removed. */ - void MdcRemoveContentBounds(const TRect& aRect); + void MdcRemoveMMAPIContentBounds(const TRect& aRect); /** * From MDirectContainer. @@ -1211,6 +1211,11 @@ * @see MMIDCanvas::MidletExiting() */ void MidletExiting(); + + /** + * @see MMIDCanvas::IsVideoOverlayActive() + */ + TBool IsVideoOverlayActive(); private: /** * Blits pbuffer surface scaled to window surface @@ -1400,6 +1405,14 @@ * @since S60 9.2 */ void PostForcedPaint(); + + /** + * Used only in video overlay case. + * Sets frame buffer alpha channel back to 0xFF after MMAPI content area have been + * removed from canvas. Must be called only in LCDUI thread. + * @since S60 9.2 + */ + void CheckDirectContentUpdated(); #endif // RD_JAVA_NGA_ENABLED private: // data @@ -1764,7 +1777,7 @@ TUint8* iTexturePixels; /** - * OpenGL coordinate arrays used fo r rendering filled rectangles + * OpenGL coordinate arrays used for rendering filled rectangles */ GLshort* iVertexArray; GLubyte* iTriangleStrip; @@ -1773,6 +1786,13 @@ * ETrue, when midlet is exiting and this canvas is the current displayable */ TBool iExiting; + + /** + * Indicates if MMAPI content areas have been updated. + * This flag is accessed from MMAPI and LCDUI threads. + */ + TBool iMMAPIAreaUpdated; + #endif // RD_JAVA_NGA_ENABLED /** diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupControl.h --- a/javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupControl.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupControl.h Wed Sep 15 12:05:25 2010 +0300 @@ -166,6 +166,9 @@ virtual void HandleChoiceGroupModelEventL( CMIDChoiceGroupModel* aModel, TChoiceGroupModelEvent aEvent); +#ifdef RD_JAVA_S60_RELEASE_9_2 + virtual TBool IsControlOnFormHighlighted(); +#endif // RD_JAVA_S60_RELEASE_9_2 public: // from MEikListBoxObserver virtual void HandleListBoxEventL(CEikListBox* aControl, TListBoxEvent aEventType); @@ -233,6 +236,9 @@ */ void SingleClickDisableHighlightL(TBool aDisable); + CMIDControlItem* ControlItem() const; + CMIDChoiceGroupListBox* InnerListBoxControl() const; + CMIDChoiceGroupModel* InnerListBoxModel() const; #endif // RD_JAVA_S60_RELEASE_9_2 #ifdef RD_TACTILE_FEEDBACK diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupItem.h --- a/javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupItem.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupItem.h Wed Sep 15 12:05:25 2010 +0300 @@ -149,6 +149,11 @@ public: void PostPendingUpEventL(); TBool LongTapDetected(); + + /** + * Overrides function from CMIDControlItem + */ + void SetHighlight(const TBool aHighlight); #endif // RD_JAVA_S60_RELEASE_9_2 private: diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupListBox.h --- a/javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupListBox.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupListBox.h Wed Sep 15 12:05:25 2010 +0300 @@ -85,6 +85,8 @@ void SetHighlight(TBool aVisible); TBool GetHighlight(); + void UpdateColors(); + #endif // RD_JAVA_S60_RELEASE_9_2 #ifdef RD_TACTILE_FEEDBACK diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupModel.h --- a/javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupModel.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupModel.h Wed Sep 15 12:05:25 2010 +0300 @@ -53,6 +53,9 @@ virtual void HandleChoiceGroupModelEventL( CMIDChoiceGroupModel* aModel, TChoiceGroupModelEvent aEvent) = 0; +#ifdef RD_JAVA_S60_RELEASE_9_2 + virtual TBool IsControlOnFormHighlighted() = 0; +#endif // RD_JAVA_S60_RELEASE_9_2 }; @@ -159,7 +162,11 @@ // NOTE that the indices in the array and the item strings should // be synchronised. The selection icon is always at index // 0 (selected) and 1 (not selected) +#ifdef RD_JAVA_S60_RELEASE_9_2 + void UpdateIconArrayL(TBool aHighlighted); +#else void UpdateIconArrayL(); +#endif // RD_JAVA_S60_RELEASE_9_2 // Returns true if there is at least one item that has icon TBool HasIcons() const; @@ -183,6 +190,13 @@ CGulIcon* iIconSelected; CGulIcon* iIconNotSelected; +#ifdef RD_JAVA_S60_RELEASE_9_2 + // The same icons as above, but used when whole ChoiceGroup + // gets highlighted on Form + CGulIcon* iIconSelectedHighlighted; + CGulIcon* iIconNotSelectedHighlighted; +#endif // RD_JAVA_S60_RELEASE_9_2 + // Dummy icon for elements that have no icon CGulIcon* iIconDummy; diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/inc/CMIDCustomItem.h --- a/javauis/lcdui_akn/lcdui/inc/CMIDCustomItem.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/inc/CMIDCustomItem.h Wed Sep 15 12:05:25 2010 +0300 @@ -228,8 +228,8 @@ void MdcItemContentRect(TRect& aContentRect, TRect& aScreenRect) const; void MdcHandlePointerEventL(TPointerEvent& aPointerEvent); void MdcFlushContainer(const TRect& aRect); - void MdcAddContentBounds(const TRect& aRect); - void MdcRemoveContentBounds(const TRect& aRect); + void MdcAddMMAPIContentBounds(const TRect& aRect); + void MdcRemoveMMAPIContentBounds(const TRect& aRect); void MdcGetDSAResources(MUiEventConsumer& aConsumer); void MdcGetUICallback(MUiEventConsumer& aConsumer, TInt aCallbackId); diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/inc/CMIDDisplayable.h --- a/javauis/lcdui_akn/lcdui/inc/CMIDDisplayable.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/inc/CMIDDisplayable.h Wed Sep 15 12:05:25 2010 +0300 @@ -267,12 +267,6 @@ void RemoveDirectContentArea(const TRect& aRect); /** - Checks if there were some direct content area added - @return ETrue if there no DC Area has been added - */ - TBool NoDirectContentAreaDefined(); - - /** * Sets popup style TextBox boolean value. Called by CMIDTextBoxDialogControl when * TextBox presentation is pop-up. * @@ -345,6 +339,19 @@ */ void ReleaseOrientation(); +#ifdef RD_JAVA_NGA_ENABLED + /** + * Gets the direct content areas that + * have been added to this displayable. + */ + void GetDirectContentsRegion(RRegion& region) const; + + /** + * Returns the number of direct content areas currently added to this displayable. + */ + TInt DirectContentsCount() const; +#endif + private: // Construction and destruction CMIDDisplayable(MMIDEnv& aEnv,CMIDUIManager& aUIManager); @@ -481,7 +488,7 @@ * If content control is CMIDCanvas, returns pointer to it, NULL otherwise. * @since S60 9.2 */ - CMIDCanvas* GetContentCanvas(); + CMIDCanvas* GetContentCanvas() const; private: CMIDAppUi* iAppUi; diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDAppUi.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDAppUi.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDAppUi.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -268,6 +268,11 @@ } #endif // RD_JAVA_NGA_ENABLED + if (aEvent.Type() == KAknShutOrHideApp) + { + java::ui::CoreUiAvkonLcdui::getInstance().shutDownRequestFromWindowServer(); + } + return EFalse; } diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDCanvas.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDCanvas.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDCanvas.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -856,67 +856,104 @@ return EFalse; } - switch (aRead->OpCode()) - { - case EDrwOpcM3GContentStart: - { - // EGL surface is created if canvas window is currently visible - // even if MIDlet would be on background. - if (!iM3GContent && - i3DAccelerated && - iDirectContents.Count() == 0 && - IsWindowVisible()) + // Usually only one op code is processed by Canvas. + // Exception is the video overlay case, where MIDlet + // does not draw anything inside Canvas.paint(). + // In this case EDrwOpcPaintStarted and EDrwOpcBitBltRect/EDrwOpcBitBlt + // are received in one ProcessL(). Also EDrwOpcPaintStarted and EDrwOpcM3GContentStart + // may be processed in one ProcessL(), if overlays are enabled. + while (aRead < aEnd) + { + switch (aRead->OpCode()) + { + case EDrwOpcM3GContentStart: { - DEBUG("CMIDCanvas::ProcessL - M3G content start"); - iM3GContent = ETrue; - iM3GStart = ETrue; - PostEvent(EM3GDraw, iM3GContent, 0); - // First time when M3G content is drawn => - // switch to EGL surface drawing. - // Pixel source must be disposed first. - DisposePixelSource(); - OpenEglL(); - - // if we are scaling with m3g and HW acceleration - // create a pbuffer surface to be used with m3g rendering - if (iScalingOn && iFullScreen) + // EGL surface is created if canvas window is currently visible + // even if MIDlet would be on background. + if (!iM3GContent && + i3DAccelerated && + iDirectContents.Count() == 0 && + IsWindowVisible()) { - CreatePBufferSurfaceL(); + DEBUG("CMIDCanvas::ProcessL - M3G content start"); + iM3GContent = ETrue; + iM3GStart = ETrue; + PostEvent(EM3GDraw, iM3GContent, 0); + // First time when M3G content is drawn => + // switch to EGL surface drawing. + // Pixel source must be disposed first. + DisposePixelSource(); + OpenEglL(); + + // if we are scaling with m3g and HW acceleration + // create a pbuffer surface to be used with m3g rendering + if (iScalingOn && iFullScreen) + { + CreatePBufferSurfaceL(); + } + // Draw the whole framebuffer content (as a texture) on top of + // the EGL window surface. + iUpperUpdateRect = TRect(Size()); + UpdateEglContent(); } - // Draw the whole framebuffer content (as a texture) on top of - // the EGL window surface. - iUpperUpdateRect = TRect(Size()); - UpdateEglContent(); + + ASSERT(aRead + aRead->Size() == aEnd); } - } - break; - case EDrwOpcBitBltRect: - { - if (iFirstPaintState == EFirstPaintNeverOccurred) + break; + case EDrwOpcBitBltRect: { - iFirstPaintState = EFirstPaintInitiated; + if (iFirstPaintState == EFirstPaintNeverOccurred) + { + iFirstPaintState = EFirstPaintInitiated; + } + + const TBitBltData& data = BitBltData(aRead); + UpdateL(data.iRect); + + ASSERT(aRead + aRead->Size() == aEnd); + } + break; + case EDrwOpcBitBlt: + { + if (iFirstPaintState == EFirstPaintNeverOccurred) + { + iFirstPaintState = EFirstPaintInitiated; + } + + UpdateL(iViewRect); + + ASSERT(aRead + aRead->Size() == aEnd); } - - const TBitBltData& data = BitBltData(aRead); - UpdateL(data.iRect); - } - break; - case EDrwOpcBitBlt: - { - if (iFirstPaintState == EFirstPaintNeverOccurred) + break; + case EDrwOpcPaintStarted: { - iFirstPaintState = EFirstPaintInitiated; + // Clear MMAPI content areas on Canvas to enable overlays. + if (IsVideoOverlayActive()) + { + RRegion directContents; + iDisplayable->GetDirectContentsRegion(directContents); + TInt count = directContents.Count(); + + iFrameContext->SetBrushColor(KTransparentClearColor); + iFrameContext->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); + + for (TInt i = 0; i < count; ++i) + { + const TRect rect = directContents[i]; + iFrameContext->Clear(rect); + } + directContents.Close(); + } } - - UpdateL(iViewRect); - } - break; - default: - User::Leave(KErrNotSupported); break; - } - - aRead += aRead->Size(); + default: + User::Leave(KErrNotSupported); + break; + } + + aRead += aRead->Size(); + } + ASSERT(aRead == aEnd); // iFrameReady tells if this is async operation. @@ -1145,7 +1182,7 @@ // Adds a rectangle to be excluded from redrawing. // --------------------------------------------------------------------------- // -void CMIDCanvas::MdcAddContentBounds(const TRect& aRect) +void CMIDCanvas::MdcAddMMAPIContentBounds(const TRect& aRect) { if (iDisplayable) { @@ -1160,11 +1197,29 @@ // Removes a rectangle to be excluded from redrawing. // --------------------------------------------------------------------------- // -void CMIDCanvas::MdcRemoveContentBounds(const TRect& aRect) +void CMIDCanvas::MdcRemoveMMAPIContentBounds(const TRect& aRect) { if (iDisplayable) { +#ifdef RD_JAVA_NGA_ENABLED + if (iEnv.VideoOverlayEnabled()) + { + // iMMAPIAreaUpdated may be modified in LCDUI and MMAPI threads. + // Lock must be released before RemoveDirectContentArea(). + RCriticalSection& lock(iEnv.GetMMAPILock()); + lock.Wait(); + iMMAPIAreaUpdated = ETrue; + lock.Signal(); + + iDisplayable->RemoveDirectContentArea(aRect); + } + else + { + iDisplayable->RemoveDirectContentArea(aRect); + } +#else iDisplayable->RemoveDirectContentArea(aRect); +#endif // RD_JAVA_NGA_ENABLED } } @@ -1902,6 +1957,17 @@ gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha); } +#ifdef RD_JAVA_NGA_ENABLED + // If overlay is enabled, need to clear previous content + // from CWindowGc. + CMIDCanvas* myself = const_cast(this); + if (myself->IsVideoOverlayActive()) + { + gc.SetBrushColor(KTransparentClearColor); + gc.Clear(aRect); + } +#endif + TRect windowRect(aRect); PrepareDraw(gc, windowRect); @@ -2199,7 +2265,7 @@ { // We need inform TextEditor that input language is changed. if ((iFocusedComponent != KComponentFocusedNone) && - (iFocusedComponent < iCustomComponents.Count())) + (iFocusedComponent < iCustomComponents.Count())) { iCustomComponents[iFocusedComponent]-> CustomComponentControl(KComponentMainControl)-> @@ -2743,7 +2809,9 @@ { myself->ClearUiSurface(ETrue); } - else if (iAlfCompositionPixelSource) + // Pixel source is not activated if Canvas is not visible, + // in order that graphics memory is not reserved while being on background + else if (iAlfCompositionPixelSource && IsWindowVisible()) { myself->ClearUiSurface(ETrue); TRAP_IGNORE(myself->ActivatePixelSourceL(ETrue)); @@ -2840,24 +2908,24 @@ TBool aUpdateRequired #endif // CANVAS_DIRECT_ACCESS ) : - CCoeControl() - ,iEnv(aEnv) + CCoeControl() + ,iEnv(aEnv) #ifdef CANVAS_DOUBLE_BUFFER - ,iFrameBuffer(NULL) + ,iFrameBuffer(NULL) #endif // CANVAS_DOUBLE_BUFFER - ,iIsGameCanvas(( - aComponentType == MMIDComponent::EGameCanvas ? ETrue : EFalse)) - ,iFlags(EPostKeyEvents) - ,iFullScreen(EFalse) - ,iScalingOn(EFalse) - ,iS60SelectionKeyCompatibility(EFalse) - ,iRestoreContentWhenUnfaded(EFalse) - ,iLastFadeMessage(0) + ,iIsGameCanvas(( + aComponentType == MMIDComponent::EGameCanvas ? ETrue : EFalse)) + ,iFlags(EPostKeyEvents) + ,iFullScreen(EFalse) + ,iScalingOn(EFalse) + ,iS60SelectionKeyCompatibility(EFalse) + ,iRestoreContentWhenUnfaded(EFalse) + ,iLastFadeMessage(0) #ifdef CANVAS_DIRECT_ACCESS - ,iDcDsaToStart(EFalse) + ,iDcDsaToStart(EFalse) #endif // CANVAS_DIRECT_ACCESS - ,iDragEventsStartedInside(EFalse) - ,iFirstPaintState(EFirstPaintNeverOccurred) + ,iDragEventsStartedInside(EFalse) + ,iFirstPaintState(EFirstPaintNeverOccurred) { DEBUG("+ CMIDCanvas::CMIDCanvas - EDirectEnabled"); @@ -3651,14 +3719,16 @@ void CMIDCanvas::HandleFullOrPartialForegroundL( TBool aFullOrPartialFg, TBool aCurrentDisplayable) { - if (!aFullOrPartialFg && aCurrentDisplayable) + if (!aFullOrPartialFg) { FreeGraphicsMemory(ETrue); } - else if (!iPrevM3GContent && iAlfCompositionPixelSource) - { - SuspendPixelSource(); - ActivatePixelSourceL(ETrue); + + // If canvas is not the current displayable but visible when MIDlet has gained + // foreground, need to invoke forced paint to get content updated on screen + if (aFullOrPartialFg && !aCurrentDisplayable && IsVisible()) + { + PostForcedPaint(); } } @@ -4676,6 +4746,28 @@ } // --------------------------------------------------------------------------- +// CMIDCanvas::IsVideoOverlayActive +// --------------------------------------------------------------------------- +// +TBool CMIDCanvas::IsVideoOverlayActive() +{ + if (iEnv.VideoOverlayEnabled() && !iIsGameCanvas) + { + // This method is called also from CMIDGraphics. + // Need to check here if MMAPI video area was removed by calling CheckDirectContentUpdated() + // in order that lcdgr can use the correct alpha blending + // (opaque or transparent target, see CMIDGraphcis.cpp and lcd16ma.cpp). + TBool ret = iDisplayable->DirectContentsCount() > 0; + CheckDirectContentUpdated(); + return ret; + } + else + { + return EFalse; + } +} + +// --------------------------------------------------------------------------- // CMIDCanvas::BlitFrameBufferPixels // Sets up OpenGL state for 2D texture rendering and renders the textures for // updated frame buffer areas by calling BlitSubRect(). @@ -5301,5 +5393,40 @@ TInt sizePacked = (iContentSize.iWidth << 16) | (iContentSize.iHeight); PostEvent(EForcedPaint, posPacked, sizePacked); } + +// --------------------------------------------------------------------------- +// CMIDCanvas::CheckDirectContentUpdated +// Restores opaque alpha channel to direct content areas in +// framebuffer bitmap after video is removed from canvas. +// --------------------------------------------------------------------------- +// +void CMIDCanvas::CheckDirectContentUpdated() +{ + if (iEnv.VideoOverlayEnabled() && iMMAPIAreaUpdated) + { + // iMMAPIAreaUpdated is modified in LCDUI and MMAPI threads. + // Lock must be released before GetDirectContentsRegion(). + RCriticalSection& lock(iEnv.GetMMAPILock()); + lock.Wait(); + iMMAPIAreaUpdated = EFalse; + lock.Signal(); + + RRegion clearedRegion; + RRegion directContentRegion; + iDisplayable->GetDirectContentsRegion(directContentRegion); + clearedRegion.AddRect(TRect(iFrameBuffer->SizeInPixels())); + clearedRegion.SubRegion(directContentRegion); + + iFrameContext->CancelClipping(); + iFrameContext->SetClippingRegion(clearedRegion); + iFrameContext->SetBrushColor(KOpaqueBlackColor); + iFrameContext->SetDrawMode(CGraphicsContext::EDrawModeOR); + iFrameContext->Clear(); + // Restore full clip area + iFrameContext->CancelClipping(); + clearedRegion.Close(); + directContentRegion.Close(); + } +} #endif // RD_JAVA_NGA_ENABLED // End of File. diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupControl.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupControl.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupControl.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -216,8 +216,21 @@ } //in case skin or resolution has changed +#ifdef RD_JAVA_S60_RELEASE_9_2 + TBool highlighted = EFalse; + if (iItem) + { + highlighted = iItem->IsHighlighted(); + } +#endif // RD_JAVA_S60_RELEASE_9_2 + iModel->ReConstructSelectionIconsL(); + +#ifdef RD_JAVA_S60_RELEASE_9_2 + iModel->UpdateIconArrayL(highlighted); +#else iModel->UpdateIconArrayL(); +#endif // RD_JAVA_S60_RELEASE_9_2 iListBox = CreateListBoxL(aParent); @@ -629,6 +642,19 @@ } } +#ifdef RD_JAVA_S60_RELEASE_9_2 +TBool CMIDChoiceGroupControl::IsControlOnFormHighlighted() +{ + if (iItem) + { + return iItem->IsHighlighted(); + } + else + { + return EFalse; + } +} +#endif // RD_JAVA_S60_RELEASE_9_2 // --- from MEikListBoxObserver --- // Handles choice listbox events (as in selection) @@ -1199,13 +1225,15 @@ TRgb rgb = AKN_LAF_COLOR(215); TInt textColor; + // Set color for text according to item highlight + // (logical color constants are defined in lcdui.h) if (iItem && iItem->IsHighlighted()) { - textColor = EAknsCIQsnTextColorsCG8; + textColor = KHighlightedItemTextColor; } else { - textColor = EAknsCIQsnTextColorsCG6; + textColor = KNonHighlightedItemTextColor; } AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), @@ -1390,7 +1418,12 @@ { //in case skin or resolution has changed iModel->ReConstructSelectionIconsL(); + +#ifdef RD_JAVA_S60_RELEASE_9_2 + iModel->UpdateIconArrayL(EFalse); +#else iModel->UpdateIconArrayL(); +#endif // In order for the listbox to have popup as parent, it // needs to be allocated and constructed separately @@ -1888,4 +1921,19 @@ { return iItem->Form(); } + +CMIDControlItem* CMIDChoiceGroupControl::ControlItem() const +{ + return iItem; +} + +CMIDChoiceGroupListBox* CMIDChoiceGroupControl::InnerListBoxControl() const +{ + return iListBox; +} + +CMIDChoiceGroupModel* CMIDChoiceGroupControl::InnerListBoxModel() const +{ + return iModel; +} #endif // RD_JAVA_S60_RELEASE_9_2 diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupItem.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupItem.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupItem.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -823,4 +823,22 @@ } } +#ifdef RD_JAVA_S60_RELEASE_9_2 +void CMIDChoiceGroupItem::SetHighlight(const TBool aHighlight) +{ + CMIDControlItem::SetHighlight(aHighlight); + if (iChoiceGroupControl + && iChoiceGroupControl->ChoiceType() != MMIDChoiceGroup::EPopup + && iChoiceGroupControl->InnerListBoxControl() + && iChoiceGroupControl->InnerListBoxModel()) + { + // Try to update icons (due to color change), if it leaves + // do nothing + TRAP_IGNORE(iChoiceGroupControl->InnerListBoxModel()->UpdateIconArrayL(aHighlight)); + iChoiceGroupControl->InnerListBoxControl()->UpdateColors(); + } +} +#endif // RD_JAVA_S60_RELEASE_9_2 + + // End of File diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupListBox.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupListBox.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupListBox.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -20,6 +20,8 @@ // API for iChoiceControl #include "CMIDChoiceGroupControl.h" #include "CMIDChoiceGroupModel.h" +// API for control item +#include "CMIDControlItem.h" #include // using for CColumnListBoxData related to colors @@ -100,6 +102,7 @@ #endif //RD_JAVA_ADVANCED_TACTILE_FEEDBACK #endif //RD_TACTILE_FEEDBACK + SetTextColors(); } // Overridden, because CEikListBox returns EKeyWasConsumed when @@ -341,31 +344,47 @@ MAknsSkinInstance* skin = AknsUtils::SkinInstance(); TRgb color; - // icon color, checkbox, radio button + // Chose correct colors for elements + TInt logicalColor = KNonHighlightedItemTextColor; // non-highlighted + +#ifdef RD_JAVA_S60_RELEASE_9_2 + if (iChoiceControl + && iChoiceControl->ChoiceType() != MMIDChoiceGroup::EPopup + && iChoiceControl->ControlItem() + && iChoiceControl->ControlItem()->IsHighlighted()) + { + logicalColor = KHighlightedItemTextColor; // highlighted + } +#endif // RD_JAVA_S60_RELEASE_9_2 + TInt error = AknsUtils::GetCachedColor(skin, color, - KAknsIIDQsnIconColors, - EAknsCIQsnIconColorsCG14); - + KAknsIIDQsnTextColors, + logicalColor); if (!error) { colors.iText = color; } - // icon color, setting list highlight checkbox, radio button error = AknsUtils::GetCachedColor(skin, color, - KAknsIIDQsnIconColors, - EAknsCIQsnIconColorsCG14); - + KAknsIIDQsnTextColors, + logicalColor); if (!error) { colors.iHighlightedText = color; } } - View()->ItemDrawer()->SetTextColor(colors.iText); - View()->ItemDrawer()->SetHighlightedTextColor(colors.iHighlightedText); + if (View() && View()->ItemDrawer()) + { +#ifdef RD_JAVA_S60_RELEASE_9_2 + View()->ItemDrawer()->SetFlags( + CListItemDrawer::EUseOverrideSkinTextColor); +#endif // RD_JAVA_S60_RELEASE_9_2 + View()->ItemDrawer()->SetTextColor(colors.iText); + View()->ItemDrawer()->SetHighlightedTextColor(colors.iHighlightedText); + } } @@ -586,4 +605,9 @@ { return iHighlight; } + +void CMIDChoiceGroupListBox::UpdateColors() +{ + SetTextColors(); +} #endif // RD_JAVA_S60_RELEASE_9_2 diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupModel.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupModel.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupModel.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -71,6 +71,10 @@ // Delete icons delete iIconSelected; delete iIconNotSelected; +#ifdef RD_JAVA_S60_RELEASE_9_2 + delete iIconSelectedHighlighted; + delete iIconNotSelectedHighlighted; +#endif // RD_JAVA_S60_RELEASE_9_2 delete iIconDummy; } @@ -128,6 +132,8 @@ TSize iconSize(layoutRect.Rect().Width(), layoutRect.Rect().Height()); + // create icons for non-highlighted mode + AknsUtils::CreateColorIconLC(skin, notSelectedSkinId, KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG14, bitmap, mask, avkonbmpFilename, notSelectedIconId, notSelectedMaskId, KRgbBlue, iconSize, EAspectRatioPreservedAndUnusedSpaceRemoved); @@ -147,6 +153,29 @@ delete iIconSelected; iIconSelected = iconSelected; + + // create icons for highlighted mode +#ifdef RD_JAVA_S60_RELEASE_9_2 + AknsUtils::CreateColorIconLC(skin, notSelectedSkinId, KAknsIIDQsnIconColors, + EAknsCIQsnIconColorsCG15, bitmap, mask, avkonbmpFilename, notSelectedIconId, + notSelectedMaskId, KRgbBlue, iconSize, EAspectRatioPreservedAndUnusedSpaceRemoved); + + CGulIcon* iconNotSelectedHighlighted = CGulIcon::NewL(bitmap, mask); + CleanupStack::Pop(2); //bitmap, mask + + delete iIconNotSelectedHighlighted; + iIconNotSelectedHighlighted = iconNotSelectedHighlighted; + + AknsUtils::CreateColorIconLC(skin, selectedSkinId, KAknsIIDQsnIconColors, + EAknsCIQsnIconColorsCG15, bitmap, mask, avkonbmpFilename, selectedIconId, + selectedMaskId, KRgbBlue, iconSize, EAspectRatioPreservedAndUnusedSpaceRemoved); + + CGulIcon* iconSelectedHighlighted = CGulIcon::NewL(bitmap, mask); + CleanupStack::Pop(2); //bitmap, mask + + delete iIconSelectedHighlighted; + iIconSelectedHighlighted = iconSelectedHighlighted; +#endif // RD_JAVA_S60_RELEASE_9_2 } // Base class overrides @@ -212,7 +241,14 @@ if (!iUpdating) { // Refresh icon array +#ifdef RD_JAVA_S60_RELEASE_9_2 + if (iObserver) + { + UpdateIconArrayL(iObserver->IsControlOnFormHighlighted()); + } +#else UpdateIconArrayL(); +#endif // RD_JAVA_S60_RELEASE_9_2 // Report event ReportEventL(MMIDChoiceGroupModelObserver::EElementAdded); @@ -240,7 +276,14 @@ if (!iUpdating) { // Refresh icon array +#ifdef RD_JAVA_S60_RELEASE_9_2 + if (iObserver) + { + UpdateIconArrayL(iObserver->IsControlOnFormHighlighted()); + } +#else UpdateIconArrayL(); +#endif // RD_JAVA_S60_RELEASE_9_2 // Report element addition ReportEventL(MMIDChoiceGroupModelObserver::EElementAdded); @@ -292,7 +335,14 @@ if (!iUpdating) { // Refresh icon array. +#ifdef RD_JAVA_S60_RELEASE_9_2 + if (iObserver) + { + UpdateIconArrayL(iObserver->IsControlOnFormHighlighted()); + } +#else UpdateIconArrayL(); +#endif // RD_JAVA_S60_RELEASE_9_2 // Update the looks of the control ReportEventL(MMIDChoiceGroupModelObserver::EElementDeleted); @@ -316,7 +366,14 @@ if (!iUpdating) { // Recreate icon array +#ifdef RD_JAVA_S60_RELEASE_9_2 + if (iObserver) + { + UpdateIconArrayL(iObserver->IsControlOnFormHighlighted()); + } +#else UpdateIconArrayL(); +#endif // RD_JAVA_S60_RELEASE_9_2 // Report event ReportEventL(MMIDChoiceGroupModelObserver::EElementDeleted); @@ -351,7 +408,14 @@ if (!iUpdating) { // Icon may have changed, recreate array. +#ifdef RD_JAVA_S60_RELEASE_9_2 + if (iObserver) + { + UpdateIconArrayL(iObserver->IsControlOnFormHighlighted()); + } +#else UpdateIconArrayL(); +#endif // RD_JAVA_S60_RELEASE_9_2 // Report event ReportEventL(MMIDChoiceGroupModelObserver::EElementModified); @@ -390,7 +454,15 @@ if (aReCreate) { // Recreate, trap & ignore leaves +#ifdef RD_JAVA_S60_RELEASE_9_2 + if (iObserver) + { + TRAP_IGNORE( + UpdateIconArrayL(iObserver->IsControlOnFormHighlighted())); + } +#else TRAP_IGNORE(UpdateIconArrayL()); +#endif // RD_JAVA_S60_RELEASE_9_2 } return iIconArray; @@ -455,10 +527,17 @@ iUpdating = EFalse; // Create array, refresh control - TRAPD(ignore, UpdateIconArrayL()); +#ifdef RD_JAVA_S60_RELEASE_9_2 + if (iObserver) + { + TRAP_IGNORE(UpdateIconArrayL(iObserver->IsControlOnFormHighlighted())); + } +#else + TRAP_IGNORE(UpdateIconArrayL()); +#endif // RD_JAVA_S60_RELEASE_9_2 // Report update end (observer should redraw) - TRAP(ignore, ReportEventL(MMIDChoiceGroupModelObserver::EUpdateEnded)); + TRAP_IGNORE(ReportEventL(MMIDChoiceGroupModelObserver::EUpdateEnded)); } @@ -531,7 +610,11 @@ // NOTE that the indices in the array and the item strings should // be synchronised. The selection icon is always at index // 0 (selected) and 1 (not selected) +#ifdef RD_JAVA_S60_RELEASE_9_2 +void CMIDChoiceGroupModel::UpdateIconArrayL(TBool aHighlighted) +#else void CMIDChoiceGroupModel::UpdateIconArrayL() +#endif // RD_JAVA_S60_RELEASE_9_2 { ASSERT(iElements); ASSERT(iIconArray); @@ -547,8 +630,21 @@ } // First add the selection icons +#ifdef RD_JAVA_S60_RELEASE_9_2 + if (aHighlighted) + { + iIconArray->AppendL(iIconSelectedHighlighted); + iIconArray->AppendL(iIconNotSelectedHighlighted); + } + else + { + iIconArray->AppendL(iIconSelected); + iIconArray->AppendL(iIconNotSelected); + } +#else iIconArray->AppendL(iIconSelected); iIconArray->AppendL(iIconNotSelected); +#endif // RD_JAVA_S60_RELEASE_9_2 // Then loop through the elements and add their icons for (TInt i = 0; i < nCount; i++) diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDControlItem.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDControlItem.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDControlItem.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -261,10 +261,12 @@ { TRgb color; + // Set color for label text according to item highlight + // (logical color constants are defined in lcdui.h) TInt labelColor = (iHighlighted && Type() != MMIDComponent::ECustomItem && Type() != MMIDComponent::EImageItem) - ? EAknsCIQsnTextColorsCG8 : EAknsCIQsnTextColorsCG6; + ? KHighlightedItemTextColor : KNonHighlightedItemTextColor; // Get color from skin if ((AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), color, diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDCustomItem.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDCustomItem.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDCustomItem.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -76,21 +76,21 @@ } CMIDCustomItem::CMIDCustomItem(MMIDEnv& aEnv, CMIDUIManager* aUIManager) - : CMIDControlItem(EDefault, aUIManager) - , iEntered(EFalse) - , iSupportsInternalTraversal(ETrue) - , iEnv(aEnv) - , iResetFrameBuffer(ETrue) - , iDirectAreaAddedToDisplayable(EFalse) - , iS60SelectionKeyCompatibility(EFalse) + : CMIDControlItem(EDefault, aUIManager) + , iEntered(EFalse) + , iSupportsInternalTraversal(ETrue) + , iEnv(aEnv) + , iResetFrameBuffer(ETrue) + , iDirectAreaAddedToDisplayable(EFalse) + , iS60SelectionKeyCompatibility(EFalse) #ifndef RD_JAVA_NGA_ENABLED - , iDirectPaused(ETrue) + , iDirectPaused(ETrue) #endif - , iRestoreDirectContentWhenUnfaded(EFalse) - , iPreviousVisibility(EFalse) - , iConsumerWaitingForDSAResourcesCallback(NULL) - , iUiFixed(EFalse) - , iUiToBeFixedLater(EFalse) + , iRestoreDirectContentWhenUnfaded(EFalse) + , iPreviousVisibility(EFalse) + , iConsumerWaitingForDSAResourcesCallback(NULL) + , iUiFixed(EFalse) + , iUiToBeFixedLater(EFalse) { iMMidItem = this; @@ -259,7 +259,7 @@ { iDirectContent->MdcContainerDestroyed(); } - + if (iUiFixed && iForm) { iForm->CurrentDisplayable().ReleaseOrientation(); @@ -467,7 +467,8 @@ iRequestedPreferredSize = CheckRequestedSize(aSize); if (iRequestedPreferredSize.iWidth == -1) - { // Width is not locked + { + // Width is not locked iPreferredSize.iWidth = Min(FormClientAreaWidth(), PreferredContentSize().iWidth + iContentMargins.iLeft + iContentMargins.iRight); } @@ -484,7 +485,8 @@ if (iRequestedPreferredSize.iHeight == -1) - { // Height is not locked + { + // Height is not locked iPreferredSize.iHeight = PreferredContentSize().iHeight + iContentMargins.iTop + iContentMargins.iBottom + LabelHeight(); } @@ -513,7 +515,8 @@ DEBUG_INT("+ CMIDCustomItem::AdjustToSizeL - requested height = %d", requestedHeight); if (requestedHeight > availableHeight) - {// label + control do not fit + { + // label + control do not fit if (iLabelControl && iLabelControl->Text()->Length() > 0) { //reserve one line to the control @@ -1347,7 +1350,7 @@ { ChangeDirectContainerVisibility(ETrue); } - + if (iUiToBeFixedLater && iForm) { iForm->CurrentDisplayable().FixOrientation(); @@ -1560,7 +1563,7 @@ // From class MDirectContainer. // CMIDCustomItem::MdcFixUIOrientation(TBool aEnableFix) // --------------------------------------------------------------------------- -// +// void CMIDCustomItem::MdcFixUIOrientation(TBool aEnableFix) { @@ -1571,42 +1574,42 @@ else { iEnv.ToLcduiObserver().InvokeLcduiEvent(*this, EUnFixUIOrientation); - } + } } void CMIDCustomItem::HandleLcduiEvent(int aType) { - switch (aType) - { - case EFixUIOrientation: - if (!iUiFixed) - { - if (iForm) - { - iForm->CurrentDisplayable().FixOrientation(); - iUiFixed = ETrue; - iUiToBeFixedLater = EFalse; - } - else - { - iUiToBeFixedLater = ETrue; - } - } - break; - case EUnFixUIOrientation: - if (iForm && iUiFixed) - { - iForm->CurrentDisplayable().ReleaseOrientation(); - iUiFixed = EFalse; - iUiToBeFixedLater = EFalse; - } - break; + switch (aType) + { + case EFixUIOrientation: + if (!iUiFixed) + { + if (iForm) + { + iForm->CurrentDisplayable().FixOrientation(); + iUiFixed = ETrue; + iUiToBeFixedLater = EFalse; + } + else + { + iUiToBeFixedLater = ETrue; + } + } + break; + case EUnFixUIOrientation: + if (iForm && iUiFixed) + { + iForm->CurrentDisplayable().ReleaseOrientation(); + iUiFixed = EFalse; + iUiToBeFixedLater = EFalse; + } + break; } } // // --------------------------------------------------------------------------- // -void CMIDCustomItem::MdcAddContentBounds(const TRect& /*aRect*/) +void CMIDCustomItem::MdcAddMMAPIContentBounds(const TRect& /*aRect*/) { iDirectAreaAddedToDisplayable = UpdateDirectContentBounds(); } @@ -1615,7 +1618,7 @@ // // --------------------------------------------------------------------------- // -void CMIDCustomItem::MdcRemoveContentBounds(const TRect& /*aRect*/) +void CMIDCustomItem::MdcRemoveMMAPIContentBounds(const TRect& /*aRect*/) { if (iForm && iDirectAreaAddedToDisplayable) { diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDDateFieldItem.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDDateFieldItem.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDDateFieldItem.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -964,15 +964,17 @@ void CMIDDateFieldItem::UpdateTextColorsL() { + // Set color for content text according to item highlight + // (logical color constants are defined in lcdui.h) if (iHighlighted) { // Text colour from skin - highlighted - iEditor->SetSkinTextColorL(EAknsCIQsnTextColorsCG8); + iEditor->SetSkinTextColorL(KHighlightedItemTextColor); } else { // Text colour from skin - unfocused - iEditor->SetSkinTextColorL(EAknsCIQsnTextColorsCG6); + iEditor->SetSkinTextColorL(KNonHighlightedItemTextColor); } } diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDDisplayable.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDDisplayable.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDDisplayable.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -284,16 +284,16 @@ } CMIDDisplayable::CMIDDisplayable(MMIDEnv& aEnv,CMIDUIManager& aUIManager) - :CEikBorderedControl(TGulBorder(KMIDLetBorder)), - iUIManager(&aUIManager),iEnv(aEnv), - iIsFullScreenMode(EFalse),iActive(EFalse), iSelectCommand(NULL), iSelectCommandEnabled(ETrue), - iFullscreenCanvasLabelCacheIsValid(EFalse) + :CEikBorderedControl(TGulBorder(KMIDLetBorder)), + iUIManager(&aUIManager),iEnv(aEnv), + iIsFullScreenMode(EFalse),iActive(EFalse), iSelectCommand(NULL), iSelectCommandEnabled(ETrue), + iFullscreenCanvasLabelCacheIsValid(EFalse) #ifdef RD_TACTILE_FEEDBACK - ,iPenInputServerConnected(EFalse) + ,iPenInputServerConnected(EFalse) #endif //RD_TACTILE_FEEDBACK - ,iIdOfMSKCommand(KErrNotFound) - ,iRestoreOrientation(EFalse) - ,iReleaseCnt(0) + ,iIdOfMSKCommand(KErrNotFound) + ,iRestoreOrientation(EFalse) + ,iReleaseCnt(0) { #ifdef RD_JAVA_S60_RELEASE_9_2 iSplitScreenKeyboard = EFalse; @@ -424,14 +424,29 @@ { CWindowGc& gc = SystemGc(); - // Set up update region - preventing DSA to be destroyed by redrawing + // Set up update region - preventing MMAPI content area to + // be destroyed by redrawing +#ifdef RD_JAVA_NGA_ENABLED + // Video overlays supported only for Canvas + CMIDCanvas* canvas = GetContentCanvas(); + TBool overlayEnabled = iEnv.VideoOverlayEnabled() && + canvas && !canvas->IsGameCanvas(); + + if (!iDirectContentsRegion.IsEmpty() && !overlayEnabled) +#else if (!iDirectContentsRegion.IsEmpty()) +#endif // RD_JAVA_NGA_ENABLED { gc.CancelClippingRect(); iUpdateRegion.Clear(); iUpdateRegion.AddRect(aRect); + + // Protect access to iDirectContentsRegion, + // because it may be modified in MMAPI thread. + MMIDEnv::TCriticalSectionAutoLock autoLock(iEnv.GetMMAPILock()); // Remove occupied areas out from update region iUpdateRegion.SubRegion(iDirectContentsRegion); + // Set the update region for the context gc.SetClippingRegion(iUpdateRegion); } @@ -533,11 +548,11 @@ #endif // RD_JAVA_S60_RELEASE_9_2 { if ((!isItemCommands && - (command->CommandType() != MMIDCommand::EOk) && - (command->CommandType() != MMIDCommand::EItem)) || - (command->Id() == CMIDEdwinUtils::EMenuCommandFetchPhoneNumber) || - (command->Id() == CMIDEdwinUtils::EMenuCommandFetchEmailAddress) || - (command->Id() == CMIDEdwinUtils::EMenuCommandCreatePhoneCall)) + (command->CommandType() != MMIDCommand::EOk) && + (command->CommandType() != MMIDCommand::EItem)) || + (command->Id() == CMIDEdwinUtils::EMenuCommandFetchPhoneNumber) || + (command->Id() == CMIDEdwinUtils::EMenuCommandFetchEmailAddress) || + (command->Id() == CMIDEdwinUtils::EMenuCommandCreatePhoneCall)) { continue; } @@ -3212,6 +3227,9 @@ // void CMIDDisplayable::UpdateDirectContentsRegion() { + // iDirectContentsRegion is accessed both in LCDUI and MMAPI threads + MMIDEnv::TCriticalSectionAutoLock autoLock(iEnv.GetMMAPILock()); + iDirectContentsRegion.Clear(); TInt count = iDirectContentsRects.Count(); for (int index = 0; index < count; index++) @@ -3221,11 +3239,6 @@ } -TBool CMIDDisplayable::NoDirectContentAreaDefined() -{ - return iDirectContentsRegion.IsEmpty(); -} - void CMIDDisplayable::SetPopupTextBox(TBool aPopup) { iIsPopupTextBox = aPopup; @@ -3375,6 +3388,21 @@ } } +#ifdef RD_JAVA_NGA_ENABLED +void CMIDDisplayable::GetDirectContentsRegion(RRegion& region) const +{ + // Protect access to iDirectContentsRegion, + // because it may be modified in MMAPI thread. + MMIDEnv::TCriticalSectionAutoLock autoLock(iEnv.GetMMAPILock()); + region.Copy(iDirectContentsRegion); +} + +TInt CMIDDisplayable::DirectContentsCount() const +{ + return iDirectContentsRegion.Count(); +} +#endif // RD_JAVA_NGA_ENABLED + void CMIDDisplayable::DisplayableBehindPopupIsDestroyed() { // Old fullscreen Displayable is destroyed. @@ -3410,7 +3438,7 @@ HideIndicator(pane, EEikStatusPaneUidDigitalClock); } -CMIDCanvas* CMIDDisplayable::GetContentCanvas() +CMIDCanvas* CMIDDisplayable::GetContentCanvas() const { CMIDCanvas* ret = NULL; if (iContent && iContentControl && @@ -3479,7 +3507,7 @@ } CPropertyWatch::CPropertyWatch() - : CActive(0) + : CActive(0) { } diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDForm.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDForm.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDForm.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -2004,6 +2004,13 @@ control.PostFocusTransferEvent(EFalse, aDirection); // setting highlight must be called before setting focus control.SetHighlight(EFalse); +#ifdef RD_JAVA_S60_RELEASE_9_2 + if (IsChoiceGroup(control)) + { + CMIDChoiceGroupItem& cg = static_cast< CMIDChoiceGroupItem& >(control); + cg.SetHighlight(EFalse); + } +#endif // RD_JAVA_S60_RELEASE_9_2 control.SetFocus(EFalse); UpdateItemCommands(NULL, NULL); } @@ -2032,11 +2039,16 @@ if (iFocused != KErrNotFound) { // actions for the item gaining focus CMIDControlItem& control = ControlItem(iFocused); - SetHighlightBackgroundRects(); - control.PostFocusTransferEvent(ETrue, aDirection); control.SetHighlight(ETrue); +#ifdef RD_JAVA_S60_RELEASE_9_2 + if (IsChoiceGroup(control)) + { + CMIDChoiceGroupItem& cg = static_cast< CMIDChoiceGroupItem& >(control); + cg.SetHighlight(ETrue); + } +#endif // RD_JAVA_S60_RELEASE_9_2 control.SetFocus(ETrue); // msk: deliver also the possible MSK command to displayable UpdateItemCommands(control.CommandList(), control.GetMSKCommand()); diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDTextFieldEdwin.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDTextFieldEdwin.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDTextFieldEdwin.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -123,7 +123,11 @@ } else { // skinning colour groups for editable text - skinTextColor = IsFocused() ? EAknsCIQsnTextColorsCG8 : EAknsCIQsnTextColorsCG6; + // Set color for content text (logical color constants + // are defined in lcdui.h) + skinTextColor = IsFocused() ? + TAknsQsnTextColorsIndex(KHighlightedItemTextColor) + : TAknsQsnTextColorsIndex(KNonHighlightedItemTextColor); } TRect parentRect = aRect; diff -r d5e927d5853b -r 7cee158cb8cd javauis/lcdui_akn/lcdui/src/CMIDTextFieldItem.cpp --- a/javauis/lcdui_akn/lcdui/src/CMIDTextFieldItem.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/lcdui_akn/lcdui/src/CMIDTextFieldItem.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -677,15 +677,17 @@ { if (iTextField) { + // Set color for content text according to item highlight + // (logical color constants are defined in lcdui.h) if (iHighlighted) { // Text colour from skin - highlighted - iTextField->SetTextSkinColorIdL(EAknsCIQsnTextColorsCG8); + iTextField->SetTextSkinColorIdL(KHighlightedItemTextColor); } else { // Text colour from skin - unfocused - iTextField->SetTextSkinColorIdL(EAknsCIQsnTextColorsCG6); + iTextField->SetTextSkinColorIdL(KNonHighlightedItemTextColor); } } } diff -r d5e927d5853b -r 7cee158cb8cd javauis/m2g_akn/build/javam2g_0x2002DCBD.mmp --- a/javauis/m2g_akn/build/javam2g_0x2002DCBD.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/m2g_akn/build/javam2g_0x2002DCBD.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -116,7 +117,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/m3g_akn/build/javam3g_0x2002DCBE.mmp --- a/javauis/m3g_akn/build/javam3g_0x2002DCBE.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/m3g_akn/build/javam3g_0x2002DCBE.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -47,6 +47,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -108,7 +109,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/mmapi_akn/baseline/inc.nga/cmmavideoplayer.h --- a/javauis/mmapi_akn/baseline/inc.nga/cmmavideoplayer.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/mmapi_akn/baseline/inc.nga/cmmavideoplayer.h Wed Sep 15 12:05:25 2010 +0300 @@ -80,7 +80,9 @@ const TDesC& aStringEventData); IMPORT_C MMMASnapshot* SnapshoterL(); - + void FreeClipRectForUI(); + void GetClipRectFromUI(); + public: // From MMMASnapshot IMPORT_C MMMASnapshot::TEncoding TakeSnapshotL(TRequestStatus* aStatus, const TSize& aSize, diff -r d5e927d5853b -r 7cee158cb8cd javauis/mmapi_akn/baseline/inc/cmmadisplay.h --- a/javauis/mmapi_akn/baseline/inc/cmmadisplay.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/mmapi_akn/baseline/inc/cmmadisplay.h Wed Sep 15 12:05:25 2010 +0300 @@ -60,6 +60,19 @@ TBool IsFullScreen(); virtual void SetForeground(TBool aIsForeground, TBool UseEventServer); virtual void FixUIOrientation(TBool aFix); + /** + * Allow player to free the clipping rect for + * UI usage. required in case of RTSP live streaming player + * stop and then start, to avoid the black screen in that time gap + */ + virtual void RemoveClippingRegionPublic(); + + /** + * Allow player to get the clipping rect from + * UI usage. required in case of RTSP live streaming player + * start after stop, to avoid the black screen while its playing video + */ + virtual void SetClippingRegionPublic(); /** * Gets notification that there is container to draw assigned diff -r d5e927d5853b -r 7cee158cb8cd javauis/mmapi_akn/baseline/inc/mmmadisplay.h --- a/javauis/mmapi_akn/baseline/inc/mmmadisplay.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/mmapi_akn/baseline/inc/mmmadisplay.h Wed Sep 15 12:05:25 2010 +0300 @@ -190,6 +190,20 @@ * If EFalse, the standard UI orientation is restored. */ virtual void FixUIOrientation(TBool aFix) = 0; + + + /** + * Allow player to free the clipping rect for + * UI usage. required in case of RTSP live streaming player + * stop and then start, to avoid the black screen in that time gap + */ + virtual void RemoveClippingRegionPublic() = 0; + /** + * Allow player to get the clipping rect from + * UI usage. required in case of RTSP live streaming player + * start after stop, to avoid the black screen while its playing video + */ + virtual void SetClippingRegionPublic() = 0; }; #endif // MMMADISPLAY_H diff -r d5e927d5853b -r 7cee158cb8cd javauis/mmapi_akn/baseline/src.nga/cmmacameraplayer.cpp --- a/javauis/mmapi_akn/baseline/src.nga/cmmacameraplayer.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/mmapi_akn/baseline/src.nga/cmmacameraplayer.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -581,9 +581,6 @@ // save status which will be notified iSnapshotStatus = aStatus; - // changing status to pending - *iSnapshotStatus = KRequestPending; - // Source size not set in the beginning TSize sourceSize; @@ -689,7 +686,9 @@ // play sound when capturing image CMMACameraSound::PlayImageCaptureSoundL(); - + + // changing status to pending + *iSnapshotStatus = KRequestPending; // start capture, ImageBufferReady will be called when ready iWindow->SetStarted(EFalse); diff -r d5e927d5853b -r 7cee158cb8cd javauis/mmapi_akn/baseline/src.nga/cmmavideoplayer.cpp --- a/javauis/mmapi_akn/baseline/src.nga/cmmavideoplayer.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/mmapi_akn/baseline/src.nga/cmmavideoplayer.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -573,6 +573,15 @@ NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName); } +void CMMAVideoPlayer::FreeClipRectForUI() +{ + iDisplay->RemoveClippingRegionPublic(); +} + +void CMMAVideoPlayer::GetClipRectFromUI() +{ + iDisplay->SetClippingRegionPublic(); +} void CMMAVideoPlayer::ConnectedL(CAccMonitorInfo* aAccessoryInfo) { TAccMonCapability deviceType = aAccessoryInfo->AccDeviceType() ; diff -r d5e927d5853b -r 7cee158cb8cd javauis/mmapi_akn/baseline/src/cmmadisplay.cpp --- a/javauis/mmapi_akn/baseline/src/cmmadisplay.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/mmapi_akn/baseline/src/cmmadisplay.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -37,7 +37,7 @@ iClipRect.iTl.iX,iClipRect.iTl.iY); DEBUG_INT2("CMMADisplay::~CMMADisplay(): Removing clip rect iBr = %d X %d", iClipRect.iBr.iX,iClipRect.iBr.iY); - iDirectContainer->MdcRemoveContentBounds(iClipRect); + iDirectContainer->MdcRemoveMMAPIContentBounds(iClipRect); } // Remove this object from MDirectContainer @@ -162,7 +162,7 @@ if (!iClipRect.IsEmpty()) { DEBUG("CMMADisplay::SetClippingRegion: Removing old rect"); - iDirectContainer->MdcRemoveContentBounds(iClipRect); + iDirectContainer->MdcRemoveMMAPIContentBounds(iClipRect); iClipRect.SetRect(0, 0, 0, 0); refreshScreen = ETrue; } @@ -178,7 +178,7 @@ DEBUG_INT2("CMMADisplay::SetClippingRegion: Adding new rect iBr = %d X %d", iClipRect.iBr.iX,iClipRect.iBr.iY); // Add new clipping rect - iDirectContainer->MdcAddContentBounds(iClipRect); + iDirectContainer->MdcAddMMAPIContentBounds(iClipRect); refreshScreen = ETrue; } } @@ -204,7 +204,7 @@ if (!iClipRect.IsEmpty()) { DEBUG("CMMADisplay::RemoveClippingRegion: Removing old rect"); - iDirectContainer->MdcRemoveContentBounds(iClipRect); + iDirectContainer->MdcRemoveMMAPIContentBounds(iClipRect); iClipRect.SetRect(0, 0, 0, 0); // refresh screen iDirectContainer->MdcFlushContainer(iWindow->WindowRect()); @@ -246,7 +246,7 @@ DEBUG_INT2("CMMADisplay::AddClippingRegion: Adding new rect iBr = %d X %d", iClipRect.iBr.iX,iClipRect.iBr.iY); // Add new clipping rect - iDirectContainer->MdcAddContentBounds(iClipRect); + iDirectContainer->MdcAddMMAPIContentBounds(iClipRect); // refresh screen iDirectContainer->MdcFlushContainer( iWindow->WindowRect()); @@ -356,6 +356,11 @@ { DEBUG_INT("MID::CMMADisplay::MdcContainerVisibilityChanged aVisible = %d", aVisible); + + // aVisible true indicates that container is now in foreground, so + // set iContainerVisible which may be used in SetForeground(). + iContainerVisible = aVisible ? aVisible : iContainerVisible; + if (!iIsForeground && aVisible) { DEBUG("MID::CMMADisplay::MdcContainerVisibilityChanged Condition 1 "); @@ -452,6 +457,7 @@ if (iContainerVisible && !iWindow->IsVisible()) { iWindow->SetVisible(ETrue, aUseEventServer); + SetClippingRegion(); } } else @@ -509,4 +515,15 @@ } } + +void CMMADisplay::RemoveClippingRegionPublic() +{ + RemoveClippingRegion(); +} + +void CMMADisplay::SetClippingRegionPublic() +{ + SetClippingRegion(); +} + // END OF FILE diff -r d5e927d5853b -r 7cee158cb8cd javauis/mmapi_akn/baseline/src/cmmavideourlplayerlivestreamdelegate.cpp --- a/javauis/mmapi_akn/baseline/src/cmmavideourlplayerlivestreamdelegate.cpp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/mmapi_akn/baseline/src/cmmavideourlplayerlivestreamdelegate.cpp Wed Sep 15 12:05:25 2010 +0300 @@ -99,6 +99,9 @@ // Call stop instead of Pause as per the suggestions from helix // Pause has no meaning for live streaming iPlayer.iController.Stop(); +#ifdef RD_JAVA_NGA_ENABLED + iPlayer.FreeClipRectForUI(); +#endif } DEBUG("MMA:CMMAVideoUrlPlayer: Live stream: StopL - "); } @@ -153,6 +156,9 @@ DEBUG("MMA:CMMAVideoUrlPlayer: Live stream: KMMFEventCategoryVideoLoadingComplete ASW Stop"); // calling PrepareDisplay() in the nick of time as this takes over the control of window and // any UI widget can't be drawn after this call at the prescribed area for video display. +#ifdef RD_JAVA_NGA_ENABLED + iPlayer.GetClipRectFromUI(); +#endif iPlayer.PrepareDisplay(); iActiveSchedulerWait->AsyncStop(); } diff -r d5e927d5853b -r 7cee158cb8cd javauis/mmapi_akn/build/javamobilemedia.pro --- a/javauis/mmapi_akn/build/javamobilemedia.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/mmapi_akn/build/javamobilemedia.pro Wed Sep 15 12:05:25 2010 +0300 @@ -84,13 +84,13 @@ -laknskinsrv \ -lapgrfx \ -lapmime \ - -lBitmapTransforms \ + -lbitmaptransforms \ -lDRMHelper \ -lDrmAudioPlayUtility \ - -lImageConversion \ + -limageconversion \ -lIHL \ -lMMFControllerFramework \ - -lMediaClientAudio \ + -lmediaclientaudio \ -lMmfStandardCustomCommands \ -lRemConCoreApi \ -lRemConInterfaceBase \ diff -r d5e927d5853b -r 7cee158cb8cd javauis/mmapi_akn/build/javamobilemedia_0x2002DCC2.mmp --- a/javauis/mmapi_akn/build/javamobilemedia_0x2002DCC2.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/mmapi_akn/build/javamobilemedia_0x2002DCC2.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -47,6 +47,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -227,13 +228,13 @@ LIBRARY AknIcon.lib LIBRARY aknskins.lib LIBRARY aknskinsrv.lib -LIBRARY BitmapTransforms.lib +LIBRARY bitmaptransforms.lib LIBRARY DRMHelper.lib LIBRARY DrmAudioPlayUtility.lib -LIBRARY ImageConversion.lib +LIBRARY imageconversion.lib LIBRARY IHL.lib LIBRARY MMFControllerFramework.lib -LIBRARY MediaClientAudio.lib +LIBRARY mediaclientaudio.lib LIBRARY MmfStandardCustomCommands.lib LIBRARY RemConCoreApi.lib LIBRARY RemConInterfaceBase.lib @@ -265,7 +266,6 @@ LIBRARY libc.lib LIBRARY libm.lib LIBRARY libdl.lib -LIBRARY mediaclientaudio.lib LIBRARY eiksrv.lib LIBRARY apparc.lib LIBRARY avkon.lib @@ -282,7 +282,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/nokiasound/build/javanokiasound.pro --- a/javauis/nokiasound/build/javanokiasound.pro Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/nokiasound/build/javanokiasound.pro Wed Sep 15 12:05:25 2010 +0300 @@ -22,7 +22,7 @@ LIBS += -lcenrepnotifhandler \ -lcentralrepository \ -lmediaclientaudio \ - -lcommonengine \ + -lCommonEngine \ -ljavautils include(../../../build/omj.pri) diff -r d5e927d5853b -r 7cee158cb8cd javauis/nokiasound/build/javanokiasound_0x2002DCC4.mmp --- a/javauis/nokiasound/build/javanokiasound_0x2002DCC4.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/nokiasound/build/javanokiasound_0x2002DCC4.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -73,7 +74,7 @@ LIBRARY cenrepnotifhandler.lib LIBRARY centralrepository.lib LIBRARY mediaclientaudio.lib -LIBRARY commonengine.lib +LIBRARY CommonEngine.lib LIBRARY javautils.lib LIBRARY libpthread.lib LIBRARY libstdcppv5.lib @@ -103,7 +104,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/nokiasound/inc/CMIDSound.h --- a/javauis/nokiasound/inc/CMIDSound.h Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/nokiasound/inc/CMIDSound.h Wed Sep 15 12:05:25 2010 +0300 @@ -17,7 +17,6 @@ // INCLUDES -#include #include #include #include "MMIDEventSender.h" diff -r d5e927d5853b -r 7cee158cb8cd javauis/remconobserver_akn/build/javaremconobserver_0x2002DCCA.mmp --- a/javauis/remconobserver_akn/build/javaremconobserver_0x2002DCCA.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/remconobserver_akn/build/javaremconobserver_0x2002DCCA.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -101,7 +102,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/runtimeui_akn/build/javaruntimeui_0x2002DCCD.mmp --- a/javauis/runtimeui_akn/build/javaruntimeui_0x2002DCCD.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/runtimeui_akn/build/javaruntimeui_0x2002DCCD.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -99,7 +100,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/softnotification_akn/build/javasoftnotification_0x2002DCD6.mmp --- a/javauis/softnotification_akn/build/javasoftnotification_0x2002DCD6.mmp Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/softnotification_akn/build/javasoftnotification_0x2002DCD6.mmp Wed Sep 15 12:05:25 2010 +0300 @@ -45,6 +45,7 @@ MACRO RD_JAVA_HTTP_EMC_ENABLED MACRO RD_JAVA_NGA_ENABLED MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED +MACRO RD_JAVA_PIM_MULTICAL_ENABLED MACRO RD_JAVA_OPENC_BETA_PATCH MACRO RD_JAVA_INSTALLERUI_ENABLED MACRO RD_JAVA_PREWARM @@ -102,7 +103,7 @@ #endif OPTION GCCE -fvisibility-inlines-hidden -VERSION 10.0 +VERSION 10.525 ARMFPU softvfp diff -r d5e927d5853b -r 7cee158cb8cd javauis/subsystem.mk --- a/javauis/subsystem.mk Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/subsystem.mk Wed Sep 15 12:05:25 2010 +0300 @@ -28,10 +28,8 @@ # # Common legacy utilities # -SUBSYSTEMS += javalegacyutils - -SYMBIAN_ONLY += javalegacyutils nokiasound/build +SYMBIAN_ONLY += nokiasound/build diff -r d5e927d5853b -r 7cee158cb8cd javauis/subsystem_akn.mk --- a/javauis/subsystem_akn.mk Tue Sep 14 21:06:50 2010 +0300 +++ b/javauis/subsystem_akn.mk Wed Sep 15 12:05:25 2010 +0300 @@ -32,13 +32,13 @@ eswt_akn/eswtphysics/group SUBSYSTEMS += \ + javalegacyutils \ lcdui_akn ifdef RD_JAVA_S60_RELEASE_5_0_IAD SUBSYSTEMS += ptivariation_akn endif - # # Additional dependencies between the components # diff -r d5e927d5853b -r 7cee158cb8cd rom/installerodclist30 --- a/rom/installerodclist30 Tue Sep 14 21:06:50 2010 +0300 +++ b/rom/installerodclist30 Wed Sep 15 12:05:25 2010 +0300 @@ -10,7 +10,6 @@ javamidpruntime.odc javainstaller.odc javainstallerui.odc -javalegacyutils.odc javapushregistry.odc javaruntimeui.odc javasecurity.odc diff -r d5e927d5853b -r 7cee158cb8cd rom/java_2_2.iby --- a/rom/java_2_2.iby Tue Sep 14 21:06:50 2010 +0300 +++ b/rom/java_2_2.iby Wed Sep 15 12:05:25 2010 +0300 @@ -345,6 +345,9 @@ 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 +// CentralRepository API +file=ABI_DIR\BUILD_DIR\javacentrep.dll SHARED_LIB_DIR\javacentrep.dll +data=JAVA_VM_RES_BLD\javacentrep.odc JAVA_VM_RES_IMG\javacentrep.odc /////////////////// // Miscellaneous // diff -r d5e927d5853b -r 7cee158cb8cd rom/java_3_1.iby --- a/rom/java_3_1.iby Tue Sep 14 21:06:50 2010 +0300 +++ b/rom/java_3_1.iby Wed Sep 15 12:05:25 2010 +0300 @@ -153,10 +153,6 @@ /*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 // @@ -341,6 +337,10 @@ file=ABI_DIR\BUILD_DIR\javaamms.dll SHARED_LIB_DIR\javaamms.dll data=JAVA_VM_RES_BLD\javaamms.odc JAVA_VM_RES_IMG\javaamms.odc +// CentralRepository API +file=ABI_DIR\BUILD_DIR\javacentrep.dll SHARED_LIB_DIR\javacentrep.dll +data=JAVA_VM_RES_BLD\javacentrep.odc JAVA_VM_RES_IMG\javacentrep.odc + /////////////////// // Miscellaneous // /////////////////// diff -r d5e927d5853b -r 7cee158cb8cd rom/midpodclist --- a/rom/midpodclist Tue Sep 14 21:06:50 2010 +0300 +++ b/rom/midpodclist Wed Sep 15 12:05:25 2010 +0300 @@ -41,4 +41,5 @@ javawebservices.odc javawma.odc javawmamms.odc +javacentrep.odc resources.jar diff -r d5e927d5853b -r 7cee158cb8cd rom/midpodclist30 --- a/rom/midpodclist30 Tue Sep 14 21:06:50 2010 +0300 +++ b/rom/midpodclist30 Wed Sep 15 12:05:25 2010 +0300 @@ -36,5 +36,6 @@ javawmamms.odc openlcdui.odc javanokiaui.odc +javacentrep.odc resources.jar