--- a/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -18,11 +18,11 @@
PRJ_PLATFORMS
default
+#include "build/bld.inf"
+#include "jrt_plat/group/bld.inf"
#include "javacommons/bld.inf"
#include "javaruntimes/bld.inf"
#include "javauis/bld.inf"
#include "javamanager/bld.inf"
#include "javatools/bld.inf"
-#include "javaextensions/bld.inf"
-#include "build/bld.inf"
-#include "jrt_plat/group/bld.inf"
+#include "javaextensions/bld.inf"
--- a/build/Makefile.comp Thu Jul 15 18:31:06 2010 +0300
+++ b/build/Makefile.comp Thu Aug 19 09:48:13 2010 +0300
@@ -151,11 +151,11 @@
echo #include "exports.inf" >> bld.inf
endif
+# Quick java releasables target
+RELEASABLE_PATH = $(EPOCROOT)epoc32/release/$(PLATFORM)/$(CFG)/z/resource/java/jvm/lib/jrt
javareleasables:
ifneq ($(ANT_FILE),)
- $(ANT) -q -Dtarget.platform=$(PLATFORM) -Dtarget.cfg=$(VARIANT) $(ANT_PROJECT_DEFINES) releasables > $(DEVNULL)
- $(call CATCOMMAND,java_releasables_$(PLATFORM)_$(VARIANT).tmp)
- $(call RMFILE,java_releasables_$(PLATFORM)_$(VARIANT).tmp)
+ echo $(RELEASABLE_PATH)/$(BASENAME).odc
endif
# Remove all generated build files
@@ -185,11 +185,11 @@
build_native:
$(PHASEINFO)
- $(SBS) -c $(PLATFORM)_$(CFG) BUILD
+ $(SBS) -c $(PLATFORM)_$(CFG)
-fastbuild: export java
+fastbuild: java
$(PHASEINFO)
- $(SBS) -c $(PLATFORM)_$(CFG) TARGET
+ $(SBS) -c $(PLATFORM)_$(CFG)
build_clean_native:
$(PHASEINFO)
--- a/build/Makefile.defs Thu Jul 15 18:31:06 2010 +0300
+++ b/build/Makefile.defs Thu Aug 19 09:48:13 2010 +0300
@@ -262,10 +262,9 @@
endif
generatereleasefile:
-ifeq ($(origin RD_JAVA_S60_RELEASE),command line)
@echo Writing $(RD_JAVA_S60_RELEASE_FILE) ... \
+ $(shell $(call CATCOMMAND,$(JAVA_SRC_ROOT)/build/templates/generated_header_hash.txt) > $(RD_JAVA_S60_RELEASE_FILE)) \
$(shell echo RD_JAVA_S60_RELEASE=$(RD_JAVA_S60_RELEASE)>$(RD_JAVA_S60_RELEASE_FILE))
-endif
# Clean file on clean_generated
clean_configure: clean_conffiles
--- a/build/Makefile.project Thu Jul 15 18:31:06 2010 +0300
+++ b/build/Makefile.project Thu Aug 19 09:48:13 2010 +0300
@@ -174,13 +174,6 @@
ifdef RD_JAVA_USIF_ENABLED
SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK = 1
PROJECT_DEFINES += SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
- # Following flag enables application registrations to USIF
- # and disables application registrations to AppArc.
- PROJECT_DEFINES += RD_JAVA_USIF_APP_REG
- # Following flag enables application notifications to AppArc.
- #PROJECT_DEFINES += RD_JAVA_USIF_NOTIFY_APP_ARC
- # Following flag enables installation progress notifications through USIF.
- #PROJECT_DEFINES += RD_JAVA_USIF_NOTIFY_PROGRESS
endif
# Java proximity Listener support exsist in 9.2 only(can not be used if 5.0 untill IAD dependecy mentioned)
--- a/build/Makefile.subsystem Thu Jul 15 18:31:06 2010 +0300
+++ b/build/Makefile.subsystem Thu Aug 19 09:48:13 2010 +0300
@@ -211,7 +211,7 @@
$(SBS) -c $(PLATFORM)_$(CFG)
fastbuild: export java
- $(SBS) -c $(PLATFORM)_$(CFG) TARGET
+ $(SBS) -c $(PLATFORM)_$(CFG)
clean_native:
$(PHASEINFO)
--- a/build/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/build/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -42,11 +42,15 @@
../rom/tckrunnerodclist30 /epoc32/release/winscw/urel/z/resource/java/tckrunnerodclist
../rom/tckrunnerodclist30 /epoc32/data/z/resource/java/tckrunnerodclist
+../rom/javacontrolpanelodclist30 /epoc32/release/winscw/udeb/z/resource/java/javacontrolpanelodclist
+../rom/javacontrolpanelodclist30 /epoc32/release/winscw/urel/z/resource/java/javacontrolpanelodclist
+../rom/javacontrolpanelodclist30 /epoc32/data/z/resource/java/javacontrolpanelodclist
+
../rom/javalocalization_3_1.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(javalocalization.iby)
#else // RD_JAVA_UI_QT
-../rom/java_2_1.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby)
+../rom/java_2_2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby)
// Export ODC list files
../rom/midpodclist /epoc32/release/winscw/udeb/z/resource/java/midpodclist
@@ -61,6 +65,10 @@
../rom/tckrunnerodclist /epoc32/release/winscw/urel/z/resource/java/tckrunnerodclist
../rom/tckrunnerodclist /epoc32/data/z/resource/java/tckrunnerodclist
+../rom/javacontrolpanelodclist /epoc32/release/winscw/udeb/z/resource/java/javacontrolpanelodclist
+../rom/javacontrolpanelodclist /epoc32/release/winscw/urel/z/resource/java/javacontrolpanelodclist
+../rom/javacontrolpanelodclist /epoc32/data/z/resource/java/javacontrolpanelodclist
+
../rom/javalocalization_2_1.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(javalocalization.iby)
#endif // RD_JAVA_UI_QT
--- a/build/buildutils/checkfilenames.py Thu Jul 15 18:31:06 2010 +0300
+++ b/build/buildutils/checkfilenames.py Thu Aug 19 09:48:13 2010 +0300
@@ -64,6 +64,7 @@
# Other peculiar filenames:
"installerodclist", "installerodclist30", "midpodclist", "midpodclist30",
"notice", "package-list", "tckrunnerodclist", "tckrunnerodclist30", "unknowncert","midprootslist",
+ "javacontrolpanelodclist", "javacontrolpanelodclist30",
]
# Command line options.
--- a/build/buildutils/checkjavapackages.py Thu Jul 15 18:31:06 2010 +0300
+++ b/build/buildutils/checkjavapackages.py Thu Aug 19 09:48:13 2010 +0300
@@ -16,13 +16,17 @@
# Checks that all the java source files declare a package and that
# the directory within a java source file is located corresponds
# properly to the package.
+#
+# Ignores tsrc directories unless the option -all is given.
import sys, os, re
def main():
- files = []
+ root = sys.argv[1]
+ all = len(sys.argv) > 2 and sys.argv[2] == '-all'
+
# Create a reg exp matching to "package x.y.z;" with whitespace ignored
regex = re.compile("\\s*package\\s*([\\w.]*);.*", re.IGNORECASE)
@@ -31,8 +35,12 @@
# Skip SVN directories
if dirname.find("\\.svn") != -1:
- return names
+ return
+ # Skip tsrc
+ if not all and dirname.find("\\tsrc") != -1:
+ return
+
for f in names:
if not f.endswith(".java"):
continue
@@ -63,7 +71,7 @@
except IOError:
print "Error reading the file " + fname
- os.path.walk(sys.argv[1], visitFun, files)
+ os.path.walk(sys.argv[1], visitFun, None)
if __name__ == "__main__":
--- a/build/buildutils/svnchangeids.py Thu Jul 15 18:31:06 2010 +0300
+++ b/build/buildutils/svnchangeids.py Thu Aug 19 09:48:13 2010 +0300
@@ -59,6 +59,7 @@
re_change_id = re.compile("(\w+\#\d+)\s*,?", re.I | re.M)
re_change_id_keyword = re.compile(change_id_keyword + "[:=]?\s*(\w+\#\d+)",
re.I | re.M)
+ re_change_id_keyword_only = re.compile(change_id_keyword, re.I | re.M)
svn_change_ids = {}
cmd = "svn log -r " + rev_2 + ":" + rev_1 + " " + url
#print cmd
@@ -67,6 +68,11 @@
if rev:
current_rev = rev[0]
change_ids = re_change_id_keyword.findall(line)
+ change_id_keywords = re_change_id_keyword_only.findall(line)
+ if len(change_id_keywords) > len(change_ids):
+ print "WARNING: Rev " + current_rev + \
+ " has more matching changeid keywords" + \
+ " than matching change ids."
while change_ids:
for change_id in change_ids:
if change_id in svn_change_ids:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/build/codescanner_high.xml Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,61 @@
+<!--
+#
+# 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: Configuration file for the Carbine CodeScanner, to
+# scan only high-priority issues.
+#
+-->
+<codescannerConfig>
+ <sources>
+ <!-- source files matching any of the exclude patterns below will not be scanned -->
+
+ <!-- binary files -->
+ <exclude>.*\.au</exclude>
+ <exclude>.*\.avi</exclude>
+ <exclude>.*\.bmp</exclude>
+ <exclude>.*\.dll</exclude>
+ <exclude>.*\.doc</exclude>
+ <exclude>.*\.exe</exclude>
+ <exclude>.*\.gif</exclude>
+ <exclude>.*\.jpg</exclude>
+ <exclude>.*\.mbm</exclude>
+ <exclude>.*\.mp3</exclude>
+ <exclude>.*\.mpg</exclude>
+ <exclude>.*\.png</exclude>
+ <exclude>.*\.raw</exclude>
+ <exclude>.*\.rtf</exclude>
+ <exclude>.*\.tif</exclude>
+ <exclude>.*\.wav</exclude>
+ <exclude>.*\.wbmp</exclude>
+ <exclude>.*\.wmf</exclude>
+ <exclude>.*\.xls</exclude>
+ <!-- typical test directory names -->
+ <exclude>.*\\ts_.*</exclude>
+ <exclude>.*\\tsrc\\.*</exclude>
+ <exclude>.*\\tsrc.s60\\.*</exclude>
+ <exclude>.*\\test\\.*</exclude>
+ <exclude>.*\\internal\\.*</exclude>
+ <exclude>.*\\Internal\\.*</exclude>
+ <exclude>.*\\.svn\\.*</exclude>
+ <exclude>\\tools\\.*</exclude>
+ </sources>
+ <severities>
+ <!-- Group scripts based on severity level: -->
+ <!-- enable="true" or "false" -->
+
+ <high enable="true"/>
+ <medium enable="false"/>
+ <low enable="false"/>
+ </severities>
+</codescannerConfig>
--- a/build/exports.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/build/exports.inf Thu Aug 19 09:48:13 2010 +0300
@@ -40,11 +40,15 @@
../rom/tckrunnerodclist30 /epoc32/release/winscw/urel/z/resource/java/tckrunnerodclist
../rom/tckrunnerodclist30 /epoc32/data/z/resource/java/tckrunnerodclist
+../rom/javacontrolpanelodclist30 /epoc32/release/winscw/udeb/z/resource/java/javacontrolpanelodclist
+../rom/javacontrolpanelodclist30 /epoc32/release/winscw/urel/z/resource/java/javacontrolpanelodclist
+../rom/javacontrolpanelodclist30 /epoc32/data/z/resource/java/javacontrolpanelodclist
+
../rom/javalocalization_3_1.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(javalocalization.iby)
#else // RD_JAVA_UI_QT
-../rom/java_2_1.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby)
+../rom/java_2_2.iby CORE_APP_LAYER_IBY_EXPORT_PATH(java.iby)
// Export ODC list files
../rom/midpodclist /epoc32/release/winscw/udeb/z/resource/java/midpodclist
@@ -59,6 +63,10 @@
../rom/tckrunnerodclist /epoc32/release/winscw/urel/z/resource/java/tckrunnerodclist
../rom/tckrunnerodclist /epoc32/data/z/resource/java/tckrunnerodclist
+../rom/javacontrolpanelodclist /epoc32/release/winscw/udeb/z/resource/java/javacontrolpanelodclist
+../rom/javacontrolpanelodclist /epoc32/release/winscw/urel/z/resource/java/javacontrolpanelodclist
+../rom/javacontrolpanelodclist /epoc32/data/z/resource/java/javacontrolpanelodclist
+
../rom/javalocalization_2_1.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(javalocalization.iby)
#endif // RD_JAVA_UI_QT
Binary file build/loc/resources.jar has changed
Binary file build/loc/resources_qt.jar has changed
--- a/build/makefile Thu Jul 15 18:31:06 2010 +0300
+++ b/build/makefile Thu Aug 19 09:48:13 2010 +0300
@@ -61,6 +61,9 @@
javatools \
javaextensions
+# Set order explicitly to get Java building as first
+SUBTARGETS = $(COMPONENTS) $(NONQTSUBSYSTEMS) $(SUBSYSTEMS)
+
# -------------------------------------------------------
include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- a/build/makefile.javaversion Thu Jul 15 18:31:06 2010 +0300
+++ b/build/makefile.javaversion Thu Aug 19 09:48:13 2010 +0300
@@ -1,6 +1,2 @@
# Set Java version (must be dot separated, without spaces)
-ifdef RD_JAVA_S60_RELEASE_5_0_IAD
- JAVA_VERSION = 2.1.32
-else
- JAVA_VERSION = 2.1.32
-endif
+JAVA_VERSION = 2.2.9
--- a/build/nativejava.flm Thu Jul 15 18:31:06 2010 +0300
+++ b/build/nativejava.flm Thu Aug 19 09:48:13 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"
@@ -23,23 +23,67 @@
# therefore the jrt-directory is found from finding first directory having
# subsystem.mk, going up to max. three directory levels)
-JAVABUILDDIR = $(dir $(firstword $(wildcard $(TO_BLDINF)/subsystem.mk $(TO_BLDINF)/../subsystem.mk $(TO_BLDINF)/../../subsystem.mk)))
+JAVABUILDDIR:= $(dir $(firstword $(wildcard $(TO_BLDINF)/subsystem.mk $(TO_BLDINF)/../subsystem.mk $(TO_BLDINF)/../../subsystem.mk)))
-JAVABUILDCMD = make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \
+# General Java makefile command
+JAVACMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \
PLATFORM=$(PLATFORM) CFG=$(CFG) BLD_INF_JAVA=1
-define java_build
-RESOURCE::
+# General build command, targetting armv5 urel files
+JAVABUILDCMD:= make -C $(JAVABUILDDIR) -f subsystem.mk EPOCROOT=$(EPOCROOT)/ \
+ PLATFORM=armv5 CFG=urel BLD_INF_JAVA=1 java finalactions
+
+# Marker file to prevent multiple Java compilations of the
+# same platform/cfg, when building e.g. device variants.
+NATIVEJAVAMARKER := $(EPOCBLD)/nativejavamarker_$(PLATFORM)_$(CFG).done
+
+# Java build artifact file source and target
+JAVABUILD_ARTIFACT_SRC := $(EPOCROOT)/epoc32/release/armv5/urel
+JAVABUILD_ARTIFACT_DST := $(EPOCROOT)/epoc32/release/$(PLATFORM)/$(CFG)
+
+define compilenativejava
+
+# This is the general Java compilation, done once for the component
+ifeq ($(GUARD_nativejavatarget),)
+GUARD_nativejavatarget:=1
+.PHONY:: nativejavatarget
+nativejavatarget:
$(call startrule,compilenativejava,,javasources) \
- $(JAVABUILDCMD) java finalactions\
+ $(JAVABUILDCMD) \
$(call endrule,compilenativejava)
+endif
+
+# Actual resource target, one for each platform/cfg variant
+ifeq ($(GUARD_$(call sanitise,$(NATIVEJAVAMARKER))),)
+GUARD_$(call sanitise,$(NATIVEJAVAMARKER)):=1
+
+RESOURCE:: $(NATIVEJAVAMARKER)
+
+# Copy the build artifacts to target
+$(NATIVEJAVAMARKER): nativejavatarget
+ifeq ($(filter armv5_urel ARMV5_urel ARMV5_UREL,$(PLATFORM)_$(CFG)),)
+ $(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/jvm/lib/jrt)
+ $(call makepath,$(JAVABUILD_ARTIFACT_DST)/z/resource/java/security)
+ $(call startrule,copynativejavaresults) \
+ $(foreach f,java_impl_cdc.jar java_impl_cldc.jar java_platform_api.jar java_public_api.jar java_signature_test.jar, $(GNUCP) -v $(JAVABUILD_ARTIFACT_SRC)/$f $(JAVABUILD_ARTIFACT_DST) &&) \
+ $(GNUCP) -Rv $(JAVABUILD_ARTIFACT_SRC)/z/resource/java/jvm/lib/jrt $(JAVABUILD_ARTIFACT_DST)/z/resource/java/jvm/lib && \
+ $(GNUCP) -Rv $(JAVABUILD_ARTIFACT_SRC)/z/resource/java/security $(JAVABUILD_ARTIFACT_DST)/z/resource/java \
+ $(call endrule,copynativejavaresults)
+endif
+endif
+
+# Use normal clean for all variants
CLEAN::
$(call startrule,cleannativejava,,javasources) \
- $(JAVABUILDCMD) clean_java \
+ $(JAVACMD) clean_java \
$(call endrule,cleannativejava)
endef
-$(eval $(java_build))
+$(eval $(compilenativejava))
-RELEASABLES = $(shell $(JAVABUILDCMD) -s javareleasables)
+RELEASABLES:= $(shell $(JAVACMD) -s javareleasables)
$(eval $(call whatmacro,$(RELEASABLES),WHATRESOURCES))
+
+$(eval $(call GenerateStandardCleanTarget,$(NATIVEJAVAMARKER)))
+
+
--- a/build/omj.pri Thu Jul 15 18:31:06 2010 +0300
+++ b/build/omj.pri Thu Aug 19 09:48:13 2010 +0300
@@ -73,7 +73,7 @@
include(symbian_uids.pri)
DEFINES += __SYMBIAN32__
- DEFINES += J9EPOC32 RD_JAVA_OMJ_FSERVER
+ DEFINES += J9EPOC32
LIBS += -llibpthread
--- a/build/properties.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/build/properties.xml Thu Aug 19 09:48:13 2010 +0300
@@ -41,12 +41,23 @@
for reason why this property is defined"/> -->
<property name="platform.utilities.xml.file" value="utilities.fake.xml"/>
- <!--The cldc/cdc class file locations -->
- <property name="bootclasspath.cldc" location="${java.src.root}/inc/classes.cldc.zip"/>
- <property name="bootclasspath.cdc" location="${java.src.root}/inc/classes.cdc.zip"/>
- <property name="bootclasspath.fp" location="${java.src.root}/inc/classes.fp.zip"/>
-
-
+ <!-- Set internal epoc root -->
+ <condition property="epocroot" value="${env.EPOCROOT}" else="">
+ <isset property="env.EPOCROOT"/>
+ </condition>
+
+ <!--The cldc/cdc class file locations, within the sources -->
+ <available file="${java.src.root}/inc/classes.cldc.zip" property="bootclasspath.cldc"
+ value="${java.src.root}/inc/classes.cldc.zip" />
+ <available file="${java.src.root}/inc/classes.cdc.zip" property="bootclasspath.cdc"
+ value="${java.src.root}/inc/classes.cdc.zip" />
+ <available file="${java.src.root}/inc/classes.fp.zip" property="bootclasspath.fp"
+ value="${java.src.root}/inc/classes.fp.zip" />
+
+ <!--The cldc/cdc class file locations, external if not found in default places -->
+ <property name="bootclasspath.cldc" location="${epocroot}epoc32/jrt/classes.cldc.zip"/>
+ <property name="bootclasspath.cdc" location="${epocroot}epoc32/jrt/classes.cdc.zip"/>
+ <property name="bootclasspath.fp" location="${epocroot}epoc32/jrt/classes.fp.zip"/>
<!--NOTE!!! Properties defined below can be used only inside a target-->
@@ -60,13 +71,6 @@
<equals arg1="${target.cfg}" arg2="debug"/>
</condition>
- <!-- Set internal epoc root -->
- <condition property="epocroot"
- value="${env.EPOCROOT}"
- else="">
- <isset property="env.EPOCROOT"/>
- </condition>
-
<!--Location of eswt.jar. This is not needed in S60 Avkon,
but needed in S60 Qt. -->
<property name="eswt.jar" value=":${java.src.root}/javauis/bin/eswt.jar"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/build/sis/incompatible_openc.txt Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,3 @@
+OpenC version 1.5 or later is not found. Some Java applications may not work properly. Make sure that latest device firmware is used.
+
+Continue installation?
\ No newline at end of file
--- a/build/sis/incompatible_platform.txt Thu Jul 15 18:31:06 2010 +0300
+++ b/build/sis/incompatible_platform.txt Thu Aug 19 09:48:13 2010 +0300
@@ -1,1 +1,1 @@
-Unfortunately Java Runtime 2.0 Alpha is not compatible with your device. Java Runtime 2.0 Alpha works only on S60 5.0 devices.
+Java Runtime is not compatible with your device. Java Runtime requires S60 5th Edition device.
\ No newline at end of file
--- a/build/sis/java_2_0.pkg Thu Jul 15 18:31:06 2010 +0300
+++ b/build/sis/java_2_0.pkg Thu Aug 19 09:48:13 2010 +0300
@@ -43,6 +43,17 @@
; Popup error on Non-S60 v 5.0 platforms. Do not allow continuing.
"incompatible_platform.txt"-"", FILETEXT, FORCEABORT
ENDIF
+
+; Check OpenC versions
+; 0x10282872 = Standard C++ library
+; 0x10281F34 = Open C LIBSSL
+; 0x20009a80 = Symbian OS PIPS
+IF( version(0x10282872, <, 1, 5, 0) ) OR
+ ( version(0x10281F34, <, 1, 5, 0) ) OR
+ ( version(0x20009a80, <, 1, 5, 0) )
+ "incompatible_openc.txt"-"", FT, TA
+ENDIF
+
#endif // RD_JAVA_S60_RELEASE_5_0_IAD
@@ -95,6 +106,7 @@
"\epoc32\release\armv5\urel\javacaptain.exe"-"c:\sys\bin\javacaptain.exe"
"\epoc32\release\armv5\urel\javalauncher.exe"-"c:\sys\bin\javalauncher.exe"
+"\epoc32\release\armv5\urel\javaupgradeapp.exe"-"c:\sys\bin\javaupgradeapp.exe"
@@ -102,6 +114,7 @@
"\epoc32\data\z\resource\java\midpodclist"-"c:\resource\java\midpodclist"
"\epoc32\data\z\resource\java\tckrunnerodclist"-"c:\resource\java\tckrunnerodclist"
"\epoc32\data\z\resource\java\installerodclist"-"c:\resource\java\installerodclist"
+"\epoc32\data\z\resource\java\javacontrolpanelodclist"-"c:\resource\java\javacontrolpanelodclist"
@@ -378,7 +391,7 @@
"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javawmamms.odc"-"c:\resource\java\jvm\lib\jrt\javawmamms.odc"
"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\tckrunner.odc"-"c:\resource\java\jvm\lib\jrt\tckrunner.odc"
-
+"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javacontrolpanel.odc"-"c:\resource\java\jvm\lib\jrt\javacontrolpanel.odc"
; Misc dlls
@@ -475,6 +488,7 @@
"\epoc32\release\armv5\urel\jvmnativeport.dll"-"c:\sys\bin\jvmnativeport.dll"
"\epoc32\release\armv5\urel\midp2backupplugin.dll"-"c:\sys\bin\midp2backupplugin.dll"
"\epoc32\release\armv5\urel\javadebugapi.dll"-"c:\sys\bin\javadebugapi.dll"
+"\epoc32\release\armv5\urel\javastarter.dll"-"c:\sys\bin\javastarter.dll"
#ifdef RD_JAVA_S60_RELEASE_5_0_IAD
"\epoc32\release\armv5\urel\midp2cenrep.dll"-"c:\sys\bin\midp2cenrep.dll"
@@ -491,6 +505,8 @@
"\epoc32\release\armv5\urel\javacaptain_ext_pushregistryplugin.dll" -"c:\sys\bin\javacaptain_ext_pushregistryplugin.dll"
"\epoc32\release\armv5\urel\javacaptain_ext_storageserverplugin.dll" -"c:\sys\bin\javacaptain_ext_storageserverplugin.dll"
"\epoc32\release\armv5\urel\javacaptain_ext_btdeviceclassmanager.dll" -"c:\sys\bin\javacaptain_ext_btdeviceclassmanager.dll"
+"\epoc32\release\armv5\urel\javacaptain_ext_autostarter.dll" -"c:\sys\bin\javacaptain_ext_autostarter.dll"
+"\epoc32\release\armv5\urel\javacaptain_ext_settingslistener.dll" -"c:\sys\bin\javacaptain_ext_settingslistener.dll"
; PLUGIN_ID_JAVA_CERT_STORE_EXTENSION_C = 7
"\epoc32\release\armv5\urel\javacaptain_ext_ondemand_7.dll" -"c:\sys\bin\javacaptain_ext_ondemand_7.dll"
#ifdef RD_JAVA_MIDPRMS_DB
@@ -811,3 +827,9 @@
; javaappbackconverter is ran after uninstallation
"\epoc32\release\armv5\urel\javaappbackconverter.exe"-"c:\sys\bin\javaappbackconverter.exe", FR, RR, RW
#endif // RD_JAVA_S60_RELEASE_5_0_IAD
+
+
+#ifndef RD_JAVA_S60_RELEASE_5_0_IAD
+"\epoc32\release\armv5\urel\javaiconsizenotifplugin.dll"-"c:\sys\bin\javaiconsizenotifplugin.dll"
+"\epoc32\data\z\resource\plugins\javaiconsizenotifplugin.rsc"-"c:\resource\plugins\javaiconsizenotifplugin.rsc"
+#endif // RD_JAVA_S60_RELEASE_5_0_IAD
--- a/build/sis/java_3_1.pkg Thu Jul 15 18:31:06 2010 +0300
+++ b/build/sis/java_3_1.pkg Thu Aug 19 09:48:13 2010 +0300
@@ -50,12 +50,15 @@
"\epoc32\release\armv5\urel\javabackup.exe"-"c:\sys\bin\javabackup.exe"
"\epoc32\release\armv5\urel\javacaptain.exe"-"c:\sys\bin\javacaptain.exe"
"\epoc32\release\armv5\urel\javalauncher.exe"-"c:\sys\bin\javalauncher.exe"
+"\epoc32\release\armv5\urel\javaappscheme.exe"-"c:\sys\bin\javaappscheme.exe"
+"\epoc32\release\armv5\urel\javaqtrequest.exe"-"c:\sys\bin\javaqtrequest.exe"
+"\epoc32\release\armv5\urel\javaupgradeapp.exe"-"c:\sys\bin\javaupgradeapp.exe"
;Odc file lists
"\epoc32\data\z\resource\java\midpodclist"-"c:\resource\java\midpodclist"
"\epoc32\data\z\resource\java\tckrunnerodclist"-"c:\resource\java\tckrunnerodclist"
"\epoc32\data\z\resource\java\installerodclist"-"c:\resource\java\installerodclist"
-
+"\epoc32\data\z\resource\java\javacontrolpanelodclist"-"c:\resource\java\javacontrolpanelodclist"
; Dlls containing java byte code and their odc files
"\epoc32\release\armv5\urel\javabluecove.dll"-"c:\sys\bin\javabluecove.dll"
@@ -158,13 +161,12 @@
"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javawmamms.odc"-"c:\resource\java\jvm\lib\jrt\javawmamms.odc"
"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\tckrunner.odc"-"c:\resource\java\jvm\lib\jrt\tckrunner.odc"
+"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javacontrolpanel.odc"-"c:\resource\java\jvm\lib\jrt\javacontrolpanel.odc"
; Misc dlls
-"\epoc32\release\armv5\urel\ifeui.dll"-"c:\sys\bin\ifeui.dll"
-"\epoc32\release\armv5\urel\javaappschemeplugin.dll"-"c:\sys\bin\javaappschemeplugin.dll"
"\epoc32\release\armv5\urel\javabtl2capscplugin.dll"-"c:\sys\bin\javabtl2capscplugin.dll"
"\epoc32\release\armv5\urel\javabtsppscplugin.dll"-"c:\sys\bin\javabtsppscplugin.dll"
"\epoc32\release\armv5\urel\javabtgoepscplugin.dll"-"c:\sys\bin\javabtgoepscplugin.dll"
@@ -180,7 +182,6 @@
"\epoc32\release\armv5\urel\javapushcontroller.dll"-"c:\sys\bin\javapushcontroller.dll"
"\epoc32\release\armv5\urel\javaregistryclient.dll"-"c:\sys\bin\javaregistryclient.dll"
"\epoc32\release\armv5\urel\javaruntimestarterutils.dll"-"c:\sys\bin\javaruntimestarterutils.dll"
-"\epoc32\release\armv5\urel\javasidchecker.dll"-"c:\sys\bin\javasidchecker.dll"
"\epoc32\release\armv5\urel\javasizehelperclient.dll"-"c:\sys\bin\javasizehelperclient.dll"
"\epoc32\release\armv5\urel\javasizehelperserver.dll"-"c:\sys\bin\javasizehelperserver.dll"
"\epoc32\release\armv5\urel\javasocketscplugin.dll"-"c:\sys\bin\javasocketscplugin.dll"
@@ -190,7 +191,9 @@
"\epoc32\release\armv5\urel\javadebugapi.dll"-"c:\sys\bin\javadebugapi.dll"
#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
"\epoc32\release\armv5\urel\javasifplugin.dll"-"c:\sys\bin\javasifplugin.dll"
+"\epoc32\release\armv5\urel\javainstallcopier.exe"-"c:\sys\bin\javainstallcopier.exe"
#endif
+"\epoc32\release\armv5\urel\javastarter.dll"-"c:\sys\bin\javastarter.dll"
; to enable JVM argument modifier - comment 1st line below and uncomment 2nd line below
"\epoc32\release\armv5\urel\javajvmargsmodifier.dll"-"c:\sys\bin\javajvmargsmodifier.dll"
@@ -203,6 +206,8 @@
"\epoc32\release\armv5\urel\javacaptain_ext_pushregistryplugin.dll" -"c:\sys\bin\javacaptain_ext_pushregistryplugin.dll"
"\epoc32\release\armv5\urel\javacaptain_ext_storageserverplugin.dll" -"c:\sys\bin\javacaptain_ext_storageserverplugin.dll"
"\epoc32\release\armv5\urel\javacaptain_ext_btdeviceclassmanager.dll" -"c:\sys\bin\javacaptain_ext_btdeviceclassmanager.dll"
+"\epoc32\release\armv5\urel\javacaptain_ext_autostarter.dll" -"c:\sys\bin\javacaptain_ext_autostarter.dll"
+"\epoc32\release\armv5\urel\javacaptain_ext_settingslistener.dll" -"c:\sys\bin\javacaptain_ext_settingslistener.dll"
; PLUGIN_ID_JAVA_CERT_STORE_EXTENSION_C = 7
"\epoc32\release\armv5\urel\javacaptain_ext_ondemand_7.dll" -"c:\sys\bin\javacaptain_ext_ondemand_7.dll"
#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
@@ -213,17 +218,15 @@
#endif
; resources
-"\epoc32\data\z\resource\plugins\ifeui.rsc" -"c:\resource\plugins\ifeui.rsc"
-"\epoc32\data\z\resource\plugins\javaappschemeplugin.rsc" -"c:\resource\plugins\javaappschemeplugin.rsc"
"\epoc32\winscw\c\private\102033E6\installer\inst_plugins.cfg"-"c:\private\102033E6\installer\inst_plugins.cfg"
"\epoc32\data\Z\Resource\versions\java.txt"-"c:\resource\versions\java.txt"
"\epoc32\data\z\resource\java\java_app_92.mif"-"c:\resource\java\java_app.mif"
"\epoc32\data\z\private\10003a3f\apps\javainstaller_reg.rsc"-"c:\private\10003a3f\import\apps\javainstaller_reg.rsc"
"\epoc32\data\z\resource\apps\javainstaller_loc.rsc"-"c:\resource\apps\javainstaller_loc.rsc"
"\epoc32\data\z\resource\apps\javainstaller_icon.mif"-"c:\resource\apps\javainstaller_icon.mif"
-"\epoc32\data\z\resource\java\java_trusted.png"-"c:\resource\java\java_trusted.png"
-"\epoc32\data\z\resource\java\java_untrusted.png"-"c:\resource\java\java_untrusted.png"
-"\epoc32\data\z\resource\plugins\javasidchecker.rsc" -"c:\resource\plugins\javasidchecker.rsc"
+"\epoc32\data\z\resource\java\java_3_trusted.png"-"c:\resource\java\java_3_trusted.png"
+"\epoc32\data\z\resource\java\java_3_untrusted.png"-"c:\resource\java\java_3_untrusted.png"
+"\epoc32\data\z\resource\java\javaapplicationinstaller.css"-"c:\resource\java\javaapplicationinstaller.css"
"\epoc32\data\z\resource\plugins\javaunicertstoreplugin.rsc" -"c:\resource\plugins\javaunicertstoreplugin.rsc"
"\epoc32\data\z\resource\plugins\midp2backupplugin.rsc"-"c:\resource\plugins\midp2backupplugin.rsc"
#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
@@ -317,14 +320,16 @@
;"\epoc32\release\armv5\urel\javacoreui.dll"-"c:\sys\bin\javacoreui.dll"
;"\epoc32\data\z\resource\apps\javastartscreen.mif"-"c:\resource\apps\javastartscreen.mif"
-;"\epoc32\release\armv5\urel\javaamms.dll"-"c:\sys\bin\javaamms.dll"
-;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javaamms.odc"-"c:\resource\java\jvm\lib\jrt\javaamms.odc"
+"\epoc32\release\armv5\urel\javaamms.dll"-"c:\sys\bin\javaamms.dll"
+"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javaamms.odc"-"c:\resource\java\jvm\lib\jrt\javaamms.odc"
;"\epoc32\release\armv5\urel\javalegacyutils.dll"-"c:\sys\bin\javalegacyutils.dll"
;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javalegacyutils.odc"-"c:\resource\java\jvm\lib\jrt\javalegacyutils.odc"
-;"\epoc32\release\armv5\urel\javamobilemedia.dll"-"c:\sys\bin\javamobilemedia.dll"
-;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javamobilemedia.odc"-"c:\resource\java\jvm\lib\jrt\javamobilemedia.odc"
+"\epoc32\release\armv5\urel\javamobilemedia.dll"-"c:\sys\bin\javamobilemedia.dll"
+"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javamobilemedia.odc"-"c:\resource\java\jvm\lib\jrt\javamobilemedia.odc"
+"\epoc32\release\armv5\urel\z\system\sounds\digital\CamcorderJavaCapture.wav"-"c:\System\Sounds\Digital\CamcorderJavaCapture.wav"
+"\epoc32\release\armv5\urel\z\system\sounds\digital\CamcorderJavaStart.wav"-"c:\System\Sounds\Digital\CamcorderJavaStart.wav"
;"\epoc32\release\armv5\urel\javam2g.dll"-"c:\sys\bin\javam2g.dll"
;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javam2g.odc"-"c:\resource\java\jvm\lib\jrt\javam2g.odc"
@@ -332,16 +337,20 @@
;"\epoc32\release\armv5\urel\javam3g.dll"-"c:\sys\bin\javam3g.dll"
;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javam3g.odc"-"c:\resource\java\jvm\lib\jrt\javam3g.odc"
-;"\epoc32\release\armv5\urel\javanokiasound.dll"-"c:\sys\bin\javanokiasound.dll"
-;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javanokiasound.odc"-"c:\resource\java\jvm\lib\jrt\javanokiasound.odc"
+"\epoc32\release\armv5\urel\javanokiasound.dll"-"c:\sys\bin\javanokiasound.dll"
+"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javanokiasound.odc"-"c:\resource\java\jvm\lib\jrt\javanokiasound.odc"
;"\epoc32\release\armv5\urel\javasoftnotification.dll"-"c:\sys\bin\javasoftnotification.dll"
;"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javasoftnotification.odc"-"c:\resource\java\jvm\lib\jrt\javasoftnotification.odc"
"\epoc32\release\armv5\urel\eswtqt.dll"-"c:\sys\bin\eswtqt.dll"
+"\epoc32\release\armv5\urel\eswtqtwebkit.dll"-"c:\sys\bin\eswtqtwebkit.dll"
"\epoc32\release\armv5\urel\openlcdui.dll"-"c:\sys\bin\openlcdui.dll"
"\epoc32\release\armv5\urel\javanokiaui.dll"-"c:\sys\bin\javanokiaui.dll"
"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\eswtqt.odc"-"c:\resource\java\jvm\lib\jrt\eswtqt.odc"
+"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\eswtqtwebkit.odc"-"c:\resource\java\jvm\lib\jrt\eswtqtwebkit.odc"
"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\openlcdui.odc"-"c:\resource\java\jvm\lib\jrt\openlcdui.odc"
"\epoc32\release\armv5\urel\z\resource\java\jvm\lib\jrt\javanokiaui.odc"-"c:\resource\java\jvm\lib\jrt\javanokiaui.odc"
+"\epoc32\release\armv5\urel\javaapplicationsettingsview.dll"-"c:\sys\bin\javaapplicationsettingsview.dll"
+"\epoc32\data\z\resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin"-"c:\resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin"
--- a/build/sis/java_rnd_tools.pkg Thu Jul 15 18:31:06 2010 +0300
+++ b/build/sis/java_rnd_tools.pkg Thu Aug 19 09:48:13 2010 +0300
@@ -31,10 +31,6 @@
;to be installed on Series 60 v5.0 platforms
[0x1028315F], 0, 0, 0, {"Series60ProductID"}
-"\epoc32\release\armv5\urel\JavaCap.exe"-"c:\sys\bin\JavaCap.exe"
-"\epoc32\data\z\private\10003a3f\apps\JavaCap_reg.rsc"-"c:\private\10003a3f\import\apps\JavaCap_reg.rsc"
-"\epoc32\data\z\resource\apps\JavaCap.rsc" -"c:\resource\apps\JavaCap.rsc"
-
;j9dmp23.dll is a J9 VM plugin that provides the thread dump utility.
"\epoc32\release\armv5\urel\j9dmp23.dll"-"c:\sys\bin\j9dmp23.dll"
;javathreaddumper.dll provides the thread dump agent.
@@ -46,3 +42,8 @@
; javainstaller.exe is a command line tool for starting javainstaller for RnD purposes only
"\epoc32\release\armv5\urel\javainstaller.exe"-"c:\sys\bin\javainst.exe"
+
+
+"\epoc32\release\armv5\urel\javacontrolpanel.dll"-"c:\sys\bin\javacontrolpanel.dll"
+"\epoc32\release\armv5\urel\javacontrolpanel.exe"-"c:\sys\bin\javacontrolpanel.exe"
+"\epoc32\data\z\private\10003a3f\apps\javacontrolpanel_reg.rsc" -"c:\private\10003a3f\import\apps\javacontrolpanel_reg.rsc"
--- a/build/symbian_uids.pri Thu Jul 15 18:31:06 2010 +0300
+++ b/build/symbian_uids.pri Thu Aug 19 09:48:13 2010 +0300
@@ -116,9 +116,13 @@
contains(TARGET, openlcdui): TARGET.UID3 = 0x2002DCE2
contains(TARGET, tckrunner): TARGET.UID3 = 0x2002DCE3
+contains(TARGET, javacaptain_ext_settingslistener): TARGET.UID3 = 0x200315D8
contains(TARGET, javacaptain_ext_scrupdater): TARGET.UID3 = 0x2002DD10
contains(TARGET, javacaptain_ext_ondemand_2): TARGET.UID3 = 0x2002DD01
contains(TARGET, javanokiaui): TARGET.UID3 = 0x2002E697
+contains(TARGET, javacaptain_ext_autostarter): TARGET.UID3 = 0x2002EA7E
+contains(TARGET, javacontrolpanel): TARGET.UID3 = 0x2002FF62
+contains(TARGET, eswtqtwebkit): TARGET.UID3 = 0x2002FFA9
isEmpty(TARGET.UID3): error($${TEMPLATE} $${TARGET} : UID3 not defined. Please allocate UID3 and configure it either on $${TARGET}.pro file or in command symbian_uids.pri)
--- a/build/templates/10.1.layers.sysdef.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/build/templates/10.1.layers.sysdef.xml Thu Aug 19 09:48:13 2010 +0300
@@ -12,26 +12,12 @@
qmakeArgs="-r"
filter="!sf_build" />
</module>
-
-<!-- When releasing to SF, change the sf_build to this.
<module name="jrt_sf">
<unit name="jrt_sf" unitID="jrt.jrt_sf" mrp=""
bldFile="&layer_real_source_path;" proFile="jrt.pro"
qmakeArgs="-r RD_JAVA_SF_BUILD=1"
filter="sf_build" />
</module>
--->
- <module name="jrt">
- <unit name="jrt_jrt_plat" unitID="jrt.jrt.jrt_plat" mrp=""
- bldFile="&layer_real_source_path;/jrt_plat/group"
- filter="sf_build" />
- </module>
- <module name="jrt">
- <unit name="jrt_jrt_stubs" unitID="jrt.jrt.java_stubs" mrp=""
- bldFile="&layer_real_source_path;/java_stubs/group"
- filter="sf_build" />
- </module>
-
</layer>
</systemModel>
</SystemDefinition>
--- a/build/templates/9.2.layers.sysdef.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/build/templates/9.2.layers.sysdef.xml Thu Aug 19 09:48:13 2010 +0300
@@ -10,22 +10,10 @@
<unit unitID="jrt.jrt" mrp="" bldFile="&layer_real_source_path;/group"
filter="!sf_build" name="jrt" />
</module>
-
-<!-- When releasing to SF, change the sf_build to this.
<module name="jrt_sf">
<unit unitID="jrt.jrt_sf" mrp="" bldFile="&layer_real_source_path;/group/sf"
filter="sf_build" name="jrt_sf" />
</module>
--->
- <module name="jrt">
- <unit unitID="jrt.jrt.jrt_plat" mrp="" bldFile="&layer_real_source_path;/jrt_plat/group"
- filter="sf_build" name="jrt_jrt_plat" />
- </module>
- <module name="jrt">
- <unit unitID="jrt.jrt.java_stubs" mrp="" bldFile="&layer_real_source_path;/java_stubs/group"
- filter="sf_build" name="jrt_jrt_stubs" />
- </module>
-
</layer>
</systemModel>
</SystemDefinition>
--- a/inc/build_defines.hrh Thu Jul 15 18:31:06 2010 +0300
+++ b/inc/build_defines.hrh Thu Aug 19 09:48:13 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-#define RD_JAVA_VERSION 2,1,32
+#define RD_JAVA_VERSION 2,2,9
#define RD_JAVA_SYMBIAN_TARGET
#define RD_JAVA_S60_RELEASE_9_2
#define RD_JAVA_S60_RELEASE_9_2_ONWARDS
--- a/inc/java.txt Thu Jul 15 18:31:06 2010 +0300
+++ b/inc/java.txt Thu Aug 19 09:48:13 2010 +0300
@@ -1,1 +1,1 @@
-2.1.32
+2.2.9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/java_s60_release.hrh Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,1 @@
+RD_JAVA_S60_RELEASE=9.2
--- a/javacommons/comms/build/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/comms/build/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -19,5 +19,5 @@
default
PRJ_MMPFILES
-comms_0x2002DCA6.mmp
+javacomms_0x2002DCA6.mmp
#include "exports.inf"
--- a/javacommons/comms/build/comms.pro Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-TEMPLATE=lib
-TARGET=javacomms
-CONFIG += omj java staticdata stl
-CONFIG -= qt
-LIBS += -ljavaipc
-
-
-include(../../../build/omj.pri)
--- a/javacommons/comms/build/comms_0x2002DCA6.mmp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Generated file - do not edit manually
-*
-*/
-
-// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
-// This file is generated by qmake and should not be modified by the
-// user.
-// Name : comms.mmp
-// ==============================================================================
-
-TARGET javacomms.dll
-TARGETTYPE DLL
-
-UID 0x1000008d 0x2002DCA6
-SECUREID 0x2002DCA6
-
-EPOCALLOWDLLDATA
-
-
-// Qt Macros
-MACRO UNICODE
-MACRO QT_KEYPAD_NAVIGATION
-MACRO QT_SOFTKEYS_ENABLED
-MACRO QT_USE_MATH_H_FLOATS
-MACRO RD_JAVA_SYMBIAN_TARGET
-MACRO RD_JAVA_S60_RELEASE_9_2
-MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
-MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
-MACRO RD_JAVA_STDCPPV5
-MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
-MACRO RD_JAVA_HTTP_EMC_ENABLED
-MACRO RD_JAVA_NGA_ENABLED
-MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
-MACRO RD_JAVA_OPENC_BETA_PATCH
-MACRO RD_JAVA_INSTALLERUI_ENABLED
-MACRO RD_JAVA_PREWARM
-MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
-MACRO RD_JAVA_MIDPRMS_DB
-MACRO __SYMBIAN32__
-MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
-
-SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
-SYSTEMINCLUDE ../inc
-SYSTEMINCLUDE ../../inc
-SYSTEMINCLUDE ../../../inc
-SYSTEMINCLUDE ../src
-SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
-SYSTEMINCLUDE /epoc32/include/mw
-SYSTEMINCLUDE .
-
-SOURCEPATH ../src
-SOURCE commsclientendpoint.cpp
-SOURCE commscontext.cpp
-SOURCE commsendpoint.cpp
-SOURCE commsendpointnative.cpp
-SOURCE commsmessage.cpp
-SOURCE commsserverendpoint.cpp
-SOURCE listeners.cpp
-
-
-LIBRARY javaipc.lib
-LIBRARY javautils.lib
-LIBRARY libpthread.lib
-LIBRARY libstdcppv5.lib
-LIBRARY libc.lib
-LIBRARY libm.lib
-LIBRARY euser.lib
-LIBRARY libdl.lib
-LIBRARY cone.lib
-LIBRARY eikcore.lib
-LIBRARY mediaclientaudio.lib
-LIBRARY eikcoctl.lib
-LIBRARY eiksrv.lib
-LIBRARY apparc.lib
-LIBRARY avkon.lib
-LIBRARY efsrv.lib
-LIBRARY charconv.lib
-LIBRARY ws32.lib
-LIBRARY hal.lib
-LIBRARY gdi.lib
-LIBRARY apgrfx.lib
-
-CAPABILITY all -tcb
-
-OPTION CW -wchar_t on
-OPTION ARMCC --visibility_inlines_hidden
-#if defined(ARMCC_4_0)
-OPTION ARMCC --import_all_vtbl
-#endif
-OPTION GCCE -fvisibility-inlines-hidden
-
-VERSION 10.0
-
-ARMFPU softvfp
-
-PAGED
-
-BYTEPAIRCOMPRESSTARGET
-
-USERINCLUDE .
-
-#include <platform_paths.hrh>
-
- APP_LAYER_SYSTEMINCLUDE
-
- OS_LAYER_LIBC_SYSTEMINCLUDE
-
- OS_LAYER_SSL_SYSTEMINCLUDE
-
-deffile ./~/javacomms.def
-
- SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
-
-SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
-
-SOURCEPATH /epoc32/build/jrt/javabuild/javacomms
-
-SOURCE lookup.cpp
-
-SOURCEPATH /epoc32/build/jrt/javabuild/javacomms
-
-SOURCE jxe.c
-
-#ifdef WINSCW
-
-LIBRARY ewsd.lib
-
-#endif
-
-STDCPP
-
-#ifdef WINSCW
-DEFFILE ./bwins/javacomms.def
-#elif defined EABI
-DEFFILE ./eabi/javacomms.def
-#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/comms/build/javacomms.pro Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,24 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE=lib
+TARGET=javacomms
+CONFIG += omj java staticdata stl
+CONFIG -= qt
+LIBS += -ljavaipc
+
+
+include(../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/comms/build/javacomms_0x2002DCA6.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated file - do not edit manually
+*
+*/
+
+// ==============================================================================
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
+// This file is generated by qmake and should not be modified by the
+// user.
+// Name : javacomms.mmp
+// ==============================================================================
+
+TARGET javacomms.dll
+TARGETTYPE DLL
+
+UID 0x1000008d 0x2002DCA6
+SECUREID 0x2002DCA6
+
+EPOCALLOWDLLDATA
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO RD_JAVA_SYMBIAN_TARGET
+MACRO RD_JAVA_S60_RELEASE_9_2
+MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
+MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
+MACRO RD_JAVA_STDCPPV5
+MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
+MACRO RD_JAVA_HTTP_EMC_ENABLED
+MACRO RD_JAVA_NGA_ENABLED
+MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
+MACRO RD_JAVA_OPENC_BETA_PATCH
+MACRO RD_JAVA_INSTALLERUI_ENABLED
+MACRO RD_JAVA_PREWARM
+MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+MACRO RD_JAVA_MIDPRMS_DB
+MACRO __SYMBIAN32__
+MACRO J9EPOC32
+
+SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../inc
+SYSTEMINCLUDE ../../inc
+SYSTEMINCLUDE ../../../inc
+SYSTEMINCLUDE ../src
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE .
+
+SOURCEPATH ../src
+SOURCE commsclientendpoint.cpp
+SOURCE commscontext.cpp
+SOURCE commsendpoint.cpp
+SOURCE commsendpointnative.cpp
+SOURCE commsmessage.cpp
+SOURCE commsserverendpoint.cpp
+SOURCE listeners.cpp
+
+
+LIBRARY javaipc.lib
+LIBRARY javautils.lib
+LIBRARY libpthread.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY euser.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY apparc.lib
+LIBRARY avkon.lib
+LIBRARY efsrv.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+LIBRARY apgrfx.lib
+
+CAPABILITY all -tcb
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+#if defined(ARMCC_4_0)
+OPTION ARMCC --import_all_vtbl
+#endif
+OPTION GCCE -fvisibility-inlines-hidden
+
+VERSION 10.0
+
+ARMFPU softvfp
+
+PAGED
+
+BYTEPAIRCOMPRESSTARGET
+
+USERINCLUDE .
+
+#include <platform_paths.hrh>
+
+ APP_LAYER_SYSTEMINCLUDE
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE
+
+ OS_LAYER_SSL_SYSTEMINCLUDE
+
+deffile ./~/javacomms.def
+
+ SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
+
+SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
+
+SOURCEPATH /epoc32/build/jrt/javabuild/javacomms
+
+SOURCE lookup.cpp
+
+SOURCEPATH /epoc32/build/jrt/javabuild/javacomms
+
+SOURCE jxe.c
+
+#ifdef WINSCW
+
+LIBRARY ewsd.lib
+
+#endif
+
+STDCPP
+
+#ifdef WINSCW
+DEFFILE ./bwins/javacomms.def
+#elif defined EABI
+DEFFILE ./eabi/javacomms.def
+#endif
--- a/javacommons/comms/comms.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/comms/comms.pro Thu Aug 19 09:48:13 2010 +0300
@@ -15,6 +15,6 @@
#
TEMPLATE = subdirs
SUBDIRS += ipclib/clientserver/build/ipc.pro
-SUBDIRS += build/comms.pro
+SUBDIRS += build/javacomms.pro
BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"ipclib/build/bld.inf\""
BLD_INF_RULES.prj_extensions += "prj_extensions"
--- a/javacommons/comms/ipclib/clientserver/build/ipc_0x2002DCB7.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/comms/ipclib/clientserver/build/ipc_0x2002DCB7.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : ipc.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javacommons/comms/ipclib/clientserver/src.s60/commssession.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/comms/ipclib/clientserver/src.s60/commssession.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -87,7 +87,10 @@
}
else
{
- WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc);
+ if (rc != KErrOverflow)
+ {
+ WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc);
+ }
}
}
return 0;
@@ -151,7 +154,10 @@
}
else
{
- WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc);
+ if (rc != KErrOverflow)
+ {
+ WLOG2(EJavaComms, "%s failed, err = %d", __PRETTY_FUNCTION__, rc);
+ }
}
}
}
@@ -193,7 +199,7 @@
else
{
rc = KErrOverflow;
- WLOG3(EJavaComms, "%s: allocated length for message is too small (required size=%d, allocated size=%d)",
+ LOG3(EJavaComms, EInfo, "%s: allocated length for message is too small (required size=%d, allocated size=%d)",
__PRETTY_FUNCTION__, neededLength, allocatedLength);
}
--- a/javacommons/comms/ipclib/clientserver/src.s60/creceiver.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/comms/ipclib/clientserver/src.s60/creceiver.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -66,7 +66,7 @@
// buffer was not big enough for the message so reallocate buffer with correct size
mBuffer.Close();
mBuffer.ReAllocL(mRequiredLength());
- WLOG2(EJavaComms, "%s: increasing buffer size to %d", __PRETTY_FUNCTION__, mRequiredLength());
+ LOG2(EJavaComms, EInfo, "%s: increasing buffer size to %d", __PRETTY_FUNCTION__, mRequiredLength());
Receive();
}
break;
--- a/javacommons/comms/src/commsendpoint.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/comms/src/commsendpoint.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -295,12 +295,13 @@
break;
case ETIMEDOUT:
+ default:
mSendReceiveListeners.erase(messageRef);
done = 1;
- break;
-
- default:
- ELOG2(EJavaComms, "pthread_cond_timedwait failed %d - %s", rc, strerror(rc));
+ if (rc != ETIMEDOUT)
+ {
+ ELOG2(EJavaComms, "pthread_cond_timedwait failed %d - %s", rc, strerror(rc));
+ }
break;
}
}
--- a/javacommons/comms/tsrc/Makefile Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-include $(JAVA_SRC_ROOT)/build/Makefile.defs
-
-COMPONENTS = build
-SUBSYSTEMS = javaapi
-
-include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- a/javacommons/comms/tsrc/javaapi/Makefile Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-include $(JAVA_SRC_ROOT)/build/Makefile.defs
-
-COMPONENTS = \
- build
-
-include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
-
-run: default_target
--- a/javacommons/comms/tsrc/javaapi/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/comms/tsrc/javaapi/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -27,7 +27,6 @@
<property name="src.dir" location="../javasrc"/>
<property name="build.dir" location="../build"/>
<property name="classes.dir" location="${build.dir}/javabuild"/>
- <property name="dist" location="${java.bin.root}/jsr/classes"/>
<property name="commstest.jar.filename" value="commstest.jar"/>
<property name="junit.jar.dir" location="${java.src.root}/tools/junit"/>
@@ -41,9 +40,9 @@
<target name="clean" depends="init.properties">
<delete dir="${classes.dir}"/>
- <delete file="${dist}/${commstest.jar.filename}"/>
- <delete file="${dist}/${junit.jar.filename}"/>
- <delete file="${dist}/${junit.omj.jar.filename}"/>
+ <delete file="${vm.extension.directory}/${commstest.jar.filename}"/>
+ <delete file="${vm.extension.directory}/${junit.jar.filename}"/>
+ <delete file="${vm.extension.directory}/${junit.omj.jar.filename}"/>
</target>
<target name="compile.ut" depends="init.properties">
@@ -64,7 +63,7 @@
</target>
<target name="deploy.ut" depends="compile.ut">
- <mkdir dir="${dist}"/>
+ <mkdir dir="${vm.extension.directory}"/>
<jar destfile="${vm.extension.directory}/${commstest.jar.filename}" basedir="${classes.dir}"/>
<copy file="${junit.jar.dir}/${junit.jar.filename}"
tofile="${vm.extension.directory}/${junit.jar.filename}"/>
--- a/javacommons/comms/tsrc/javaapi/build/javacaptain_ext_ondemand_101.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/comms/tsrc/javaapi/build/javacaptain_ext_ondemand_101.pro Thu Aug 19 09:48:13 2010 +0300
@@ -25,5 +25,6 @@
symbian {
SOURCES += ../src.s60/lookup.cpp
+ TARGET.UID3 = 0xE0000055
}
include(../../../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/comms/tsrc/javaapi/subsystem.mk Thu Aug 19 09:48:13 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:
+#
+
+include $(JAVA_SRC_ROOT)/build/Makefile.defs
+
+COMPONENTS = \
+ build
+
+include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
+
+run: default_target
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/comms/tsrc/subsystem.mk Thu Aug 19 09:48:13 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:
+#
+
+include $(JAVA_SRC_ROOT)/build/Makefile.defs
+
+COMPONENTS = build
+SUBSYSTEMS = javaapi
+
+include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- a/javacommons/connectionmanager/build/javaconnectionmanager_0x2002DCA7.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/connectionmanager/build/javaconnectionmanager_0x2002DCA7.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javaconnectionmanager.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javacommons/connectionmanager/inc.s60/connectionmanager.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/connectionmanager/inc.s60/connectionmanager.h Thu Aug 19 09:48:13 2010 +0300
@@ -163,6 +163,7 @@
static HBufC8 * PromptUserSelectNetworkAccessPointL();
static HBufC8 * CreateDescriptorL(const int aType, const int id);
+ static bool checkIapDefaultL(TUint32 aMatchIapId, TUint32 aDestId, bool aDefault);
--- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/build/testapnsettings.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/build/testapnsettings.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -22,7 +22,9 @@
#include <../../../../../../inc/java_stdcpp_support_for_exe.hrh>
#include <platform_paths.hrh>
-USERINCLUDE /epoc32/include/cpputest
+USERINCLUDE /epoc32/include/cpputest // Due to TestHarness.h
+
+USERINCLUDE ../../inc.s60
USERINCLUDE ../../../../../../inc
// Using main() as entry point
--- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/AllTests.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/AllTests.h Thu Aug 19 09:48:13 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-#include "Utest.h"
+#include "cpputest/Utest.h"
//Include this in the test main to execute these tests
IMPORT_TEST_GROUP(TestAPNSettings);
--- a/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/testapnsettings.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/connectionmanager/legacysupport/apnsettings/tsrc.s60/src/testapnsettings.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -16,11 +16,9 @@
*/
#include <memory>
-
-#include "TestHarness.h"
+#include <cpputest/TestHarness.h>
-#include "../../inc.s60/mapnsettings.h"
-
+#include "mapnsettings.h"
#include "javastorage.h"
#include "javastorageexception.h"
#include "javastoragenames.h"
--- a/javacommons/connectionmanager/src.s60/connectionmanager.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/connectionmanager/src.s60/connectionmanager.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -65,7 +65,21 @@
EXPORT_C bool ConnectionManager::isIapDefault(TUint32 aMatchIapId, TUint32 aDestId, bool aDefault)
{
- LOG(ESOCKET,EInfo,"+ConnectionManager::getDefualtId");
+ LOG(ESOCKET,EInfo,"+ConnectionManager::isIapDefault");
+ bool retVal = false;
+ TRAPD(err,retVal = checkIapDefaultL(aMatchIapId,aDestId,aDefault));
+ if(err!=KErrNone)
+ {
+ // error occured
+ return false;
+ }
+ return retVal;
+}
+
+bool ConnectionManager::checkIapDefaultL(TUint32 aMatchIapId, TUint32 aDestId, bool aDefault)
+{
+
+ LOG(ESOCKET,EInfo,"+ConnectionManager::checkIapDefaultL");
TUint32 id = aDestId;
TUint32 tmpapId;
TCmDefConnType type;
@@ -79,7 +93,7 @@
mgr->ReadDefConnL(obj);
id = obj.iId;
type = obj.iType;
- if ((type ==ECmDefConnConnectionMethod) && (type == aMatchIapId))
+ if ((type ==ECmDefConnConnectionMethod) && (id == aMatchIapId))
{
return true;
}
@@ -104,8 +118,9 @@
return true;
}
}
- return false;
-
+ return false;
+
+
}
// ---------------------------------------------------------------------------
--- a/javacommons/fileutils/build/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/fileutils/build/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -19,5 +19,5 @@
default
PRJ_MMPFILES
-fileutils_0x2002DCAD.mmp
+javafileutils_0x2002DCAD.mmp
#include "exports.inf"
--- a/javacommons/fileutils/build/fileutils.pro Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-TARGET=javafileutils
-TEMPLATE=lib
-CONFIG += omj java staticdata stl
-CONFIG -= qt
-
-symbian : LIBS += -lefsrv -lPlatformEnv -lcaf
-
-LIBS+= -ljavautils -ljavacomms
-
-include(../../../build/omj.pri)
--- a/javacommons/fileutils/build/fileutils_0x2002DCAD.mmp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,166 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Generated file - do not edit manually
-*
-*/
-
-// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
-// This file is generated by qmake and should not be modified by the
-// user.
-// Name : fileutils.mmp
-// ==============================================================================
-
-TARGET javafileutils.dll
-TARGETTYPE DLL
-
-UID 0x1000008d 0x2002DCAD
-SECUREID 0x2002DCAD
-
-EPOCALLOWDLLDATA
-
-
-// Qt Macros
-MACRO UNICODE
-MACRO QT_KEYPAD_NAVIGATION
-MACRO QT_SOFTKEYS_ENABLED
-MACRO QT_USE_MATH_H_FLOATS
-MACRO RD_JAVA_SYMBIAN_TARGET
-MACRO RD_JAVA_S60_RELEASE_9_2
-MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
-MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
-MACRO RD_JAVA_STDCPPV5
-MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
-MACRO RD_JAVA_HTTP_EMC_ENABLED
-MACRO RD_JAVA_NGA_ENABLED
-MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
-MACRO RD_JAVA_OPENC_BETA_PATCH
-MACRO RD_JAVA_INSTALLERUI_ENABLED
-MACRO RD_JAVA_PREWARM
-MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
-MACRO RD_JAVA_MIDPRMS_DB
-MACRO __SYMBIAN32__
-MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
-
-SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
-SYSTEMINCLUDE ../inc.s60
-SYSTEMINCLUDE ../inc
-SYSTEMINCLUDE ../../inc
-SYSTEMINCLUDE ../../../inc
-SYSTEMINCLUDE ../src
-SYSTEMINCLUDE ../src.s60
-SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
-SYSTEMINCLUDE /epoc32/include/mw
-SYSTEMINCLUDE .
-
-SOURCEPATH ../src
-SOURCE driveobserverclient.cpp
-SOURCE driveobserverserver.cpp
-SOURCE driveutilities.cpp
-SOURCE fileextendedcommon.cpp
-SOURCE filestreamhandlerjni.cpp
-SOURCE fileutilities.cpp
-SOURCE fileutilityjni.cpp
-SOURCE nativefileiohandler.cpp
-
-SOURCEPATH ../src.s60
-SOURCE drivechangedeventgenerator.cpp
-SOURCE filedrmcontenthandler.cpp
-SOURCE filedrmhandlerjni.cpp
-SOURCE filemanager.cpp
-SOURCE fileplatformspecificsjni.cpp
-SOURCE filesystemutils.cpp
-SOURCE s60driveutilities.cpp
-SOURCE s60filesystemutilities.cpp
-
-
-LIBRARY efsrv.lib
-LIBRARY PlatformEnv.lib
-LIBRARY caf.lib
-LIBRARY javautils.lib
-LIBRARY javacomms.lib
-LIBRARY libpthread.lib
-LIBRARY libstdcppv5.lib
-LIBRARY libc.lib
-LIBRARY libm.lib
-LIBRARY euser.lib
-LIBRARY libdl.lib
-LIBRARY cone.lib
-LIBRARY eikcore.lib
-LIBRARY mediaclientaudio.lib
-LIBRARY eikcoctl.lib
-LIBRARY eiksrv.lib
-LIBRARY apparc.lib
-LIBRARY avkon.lib
-LIBRARY charconv.lib
-LIBRARY ws32.lib
-LIBRARY hal.lib
-LIBRARY gdi.lib
-LIBRARY apgrfx.lib
-
-CAPABILITY all -tcb
-
-OPTION CW -wchar_t on
-OPTION ARMCC --visibility_inlines_hidden
-#if defined(ARMCC_4_0)
-OPTION ARMCC --import_all_vtbl
-#endif
-OPTION GCCE -fvisibility-inlines-hidden
-
-VERSION 10.0
-
-ARMFPU softvfp
-
-PAGED
-
-BYTEPAIRCOMPRESSTARGET
-
-USERINCLUDE .
-
-#include <platform_paths.hrh>
-
- APP_LAYER_SYSTEMINCLUDE
-
- OS_LAYER_LIBC_SYSTEMINCLUDE
-
- OS_LAYER_SSL_SYSTEMINCLUDE
-
-deffile ./~/javafileutils.def
-
- SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
-
-SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
-
-SOURCEPATH /epoc32/build/jrt/javabuild/javafileutils
-
-SOURCE lookup.cpp
-
-SOURCEPATH /epoc32/build/jrt/javabuild/javafileutils
-
-SOURCE jxe.c
-
-#ifdef WINSCW
-
-LIBRARY ewsd.lib
-
-#endif
-
-STDCPP
-
-#ifdef WINSCW
-DEFFILE ./bwins/javafileutils.def
-#elif defined EABI
-DEFFILE ./eabi/javafileutils.def
-#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/fileutils/build/javafileutils.pro Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TARGET=javafileutils
+TEMPLATE=lib
+CONFIG += omj java staticdata stl
+CONFIG -= qt
+
+symbian : LIBS += -lefsrv -lPlatformEnv -lcaf
+
+LIBS+= -ljavautils -ljavacomms
+
+include(../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/fileutils/build/javafileutils_0x2002DCAD.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,165 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated file - do not edit manually
+*
+*/
+
+// ==============================================================================
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
+// This file is generated by qmake and should not be modified by the
+// user.
+// Name : javafileutils.mmp
+// ==============================================================================
+
+TARGET javafileutils.dll
+TARGETTYPE DLL
+
+UID 0x1000008d 0x2002DCAD
+SECUREID 0x2002DCAD
+
+EPOCALLOWDLLDATA
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO RD_JAVA_SYMBIAN_TARGET
+MACRO RD_JAVA_S60_RELEASE_9_2
+MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
+MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
+MACRO RD_JAVA_STDCPPV5
+MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
+MACRO RD_JAVA_HTTP_EMC_ENABLED
+MACRO RD_JAVA_NGA_ENABLED
+MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
+MACRO RD_JAVA_OPENC_BETA_PATCH
+MACRO RD_JAVA_INSTALLERUI_ENABLED
+MACRO RD_JAVA_PREWARM
+MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+MACRO RD_JAVA_MIDPRMS_DB
+MACRO __SYMBIAN32__
+MACRO J9EPOC32
+
+SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../inc.s60
+SYSTEMINCLUDE ../inc
+SYSTEMINCLUDE ../../inc
+SYSTEMINCLUDE ../../../inc
+SYSTEMINCLUDE ../src
+SYSTEMINCLUDE ../src.s60
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE .
+
+SOURCEPATH ../src
+SOURCE driveobserverclient.cpp
+SOURCE driveobserverserver.cpp
+SOURCE driveutilities.cpp
+SOURCE fileextendedcommon.cpp
+SOURCE filestreamhandlerjni.cpp
+SOURCE fileutilities.cpp
+SOURCE fileutilityjni.cpp
+SOURCE nativefileiohandler.cpp
+
+SOURCEPATH ../src.s60
+SOURCE drivechangedeventgenerator.cpp
+SOURCE filedrmcontenthandler.cpp
+SOURCE filedrmhandlerjni.cpp
+SOURCE filemanager.cpp
+SOURCE fileplatformspecificsjni.cpp
+SOURCE filesystemutils.cpp
+SOURCE s60driveutilities.cpp
+SOURCE s60filesystemutilities.cpp
+
+
+LIBRARY efsrv.lib
+LIBRARY PlatformEnv.lib
+LIBRARY caf.lib
+LIBRARY javautils.lib
+LIBRARY javacomms.lib
+LIBRARY libpthread.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY euser.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY apparc.lib
+LIBRARY avkon.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+LIBRARY apgrfx.lib
+
+CAPABILITY all -tcb
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+#if defined(ARMCC_4_0)
+OPTION ARMCC --import_all_vtbl
+#endif
+OPTION GCCE -fvisibility-inlines-hidden
+
+VERSION 10.0
+
+ARMFPU softvfp
+
+PAGED
+
+BYTEPAIRCOMPRESSTARGET
+
+USERINCLUDE .
+
+#include <platform_paths.hrh>
+
+ APP_LAYER_SYSTEMINCLUDE
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE
+
+ OS_LAYER_SSL_SYSTEMINCLUDE
+
+deffile ./~/javafileutils.def
+
+ SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
+
+SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
+
+SOURCEPATH /epoc32/build/jrt/javabuild/javafileutils
+
+SOURCE lookup.cpp
+
+SOURCEPATH /epoc32/build/jrt/javabuild/javafileutils
+
+SOURCE jxe.c
+
+#ifdef WINSCW
+
+LIBRARY ewsd.lib
+
+#endif
+
+STDCPP
+
+#ifdef WINSCW
+DEFFILE ./bwins/javafileutils.def
+#elif defined EABI
+DEFFILE ./eabi/javafileutils.def
+#endif
--- a/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileURL.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/fileutils/javasrc/com/nokia/mj/impl/fileutils/FileURL.java Thu Aug 19 09:48:13 2010 +0300
@@ -23,7 +23,7 @@
* differences between URL and Absolute path and make it transparent to use
* from.
*/
-final class FileURL
+public final class FileURL
{
private static String FILE_PREFIX = "file://";
--- a/javacommons/fileutils/src/fileutilities.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/fileutils/src/fileutilities.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -18,6 +18,7 @@
#include <dirent.h>
#include <errno.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stack>
--- a/javacommons/fileutils/src/nativefileiohandler.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/fileutils/src/nativefileiohandler.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -18,6 +18,8 @@
#include <errno.h>
#include <fcntl.h>
#include <locale.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <string>
--- a/javacommons/fileutils/tsrc/fileutilstestinit/build/javafileutilstestinit.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/fileutils/tsrc/fileutilstestinit/build/javafileutilstestinit.pro Thu Aug 19 09:48:13 2010 +0300
@@ -21,7 +21,6 @@
symbian {
TARGET.CAPABILITY = all -tcb
- INCLUDEPATH += /epoc32/include/caf
LIBS += -lcaf -lcafutils -lefsrv -lDrmParsers -lDRMServerInterfaces
}
--- a/javacommons/gcfbase/build/javagcf_0x2002DCAE.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfbase/build/javagcf_0x2002DCAE.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javagcf.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javacommons/gcfprotocols/file/build/javafile_0x2002DCAC.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/file/build/javafile_0x2002DCAC.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javafile.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../../inc
--- a/javacommons/gcfprotocols/file/javasrc/com/nokia/mj/impl/file/FileConnectionImpl.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/file/javasrc/com/nokia/mj/impl/file/FileConnectionImpl.java Thu Aug 19 09:48:13 2010 +0300
@@ -254,7 +254,7 @@
curUrl = curUrl.substring(0, curUrl.length() - 1);
}
String newUrl = curUrl.substring(0, curUrl.lastIndexOf('/') + 1);
- newUrl += iFileUtility.getName();
+ newUrl += FileUTF8Handler.encode(iFileUtility.getName());
iFileConnectionUrl = new FileConnectionURL(newUrl);
}
@@ -409,10 +409,6 @@
checkConnection();
checkConnectionMode(Connector.WRITE);
- if (Connector.READ == iMode)
- {
- return false;
- }
return iFileUtility.canWrite();
}
--- a/javacommons/gcfprotocols/file/tsrc/mt/filetestinit/build/javafiletestinit.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/file/tsrc/mt/filetestinit/build/javafiletestinit.pro Thu Aug 19 09:48:13 2010 +0300
@@ -21,7 +21,6 @@
symbian {
TARGET.CAPABILITY = all -tcb
- INCLUDEPATH += /epoc32/include/caf
LIBS += -lcaf -lcafutils -lefsrv -lDrmParsers -lDRMServerInterfaces
}
--- a/javacommons/gcfprotocols/http/build/javahttp.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/http/build/javahttp.pro Thu Aug 19 09:48:13 2010 +0300
@@ -18,10 +18,11 @@
TARGET=javahttp
TEMPLATE=lib
CONFIG += omj java stl
-CONFIG -= qt
symbian {
- LIBS += -leuser -lhttp -lecom -lbafl -linetprotutil -lhttpfiltercommon -lx509 -lx500 -lcrypto -lesock -lcentralrepository -lwebutils
+
+ LIBS += -leuser -lhttp -lecom -lbafl -linetprotutil -lhttpfiltercommon -lx509 -lx500 -lcrypto -lesock -lcommdb -lcentralrepository -lwebutils
+
contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_5_0) {
LIBS += -lcommdb
}
@@ -30,6 +31,4 @@
}
}
-
-
include(../../../../build/omj.pri)
--- a/javacommons/gcfprotocols/http/build/javahttp_0x2002DCB1.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/http/build/javahttp_0x2002DCB1.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javahttp.mmp
@@ -28,6 +28,8 @@
UID 0x1000008d 0x2002DCB1
SECUREID 0x2002DCB1
+EPOCSTACKSIZE 0x14000
+EPOCHEAPSIZE 0x020000 0x800000
EPOCALLOWDLLDATA
@@ -52,15 +54,32 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
+MACRO QT_GUI_LIB
+MACRO QT_CORE_LIB
+SYSTEMINCLUDE /epoc32/include/mw/QtCore
+SYSTEMINCLUDE /epoc32/include/mw/QtGui
+SYSTEMINCLUDE /epoc32/include/mw
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE /epoc32/include
+SYSTEMINCLUDE /epoc32/include/stdapis
+SYSTEMINCLUDE /epoc32/include/stdapis/sys
+SYSTEMINCLUDE /epoc32/include/platform/mw
+SYSTEMINCLUDE /epoc32/include/platform
+SYSTEMINCLUDE /epoc32/include/app
+SYSTEMINCLUDE /epoc32/include/platform/app
+SYSTEMINCLUDE /epoc32/include/platform/loc
+SYSTEMINCLUDE /epoc32/include/platform/mw/loc
+SYSTEMINCLUDE /epoc32/include/platform/app/loc
+SYSTEMINCLUDE /epoc32/include/platform/loc/sc
+SYSTEMINCLUDE /epoc32/include/platform/mw/loc/sc
+SYSTEMINCLUDE /epoc32/include/platform/app/loc/sc
+SYSTEMINCLUDE /epoc32/include/stdapis/openssl
SYSTEMINCLUDE ../inc.s60
SYSTEMINCLUDE ../../../inc
SYSTEMINCLUDE ../../../../inc
SYSTEMINCLUDE ../src.s60
SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
-SYSTEMINCLUDE /epoc32/include/mw
SYSTEMINCLUDE .
SOURCEPATH ../src.s60
@@ -83,6 +102,7 @@
LIBRARY x500.lib
LIBRARY crypto.lib
LIBRARY esock.lib
+LIBRARY commdb.lib
LIBRARY centralrepository.lib
LIBRARY webutils.lib
LIBRARY extendedconnpref.lib
@@ -90,6 +110,8 @@
LIBRARY javautils.lib
LIBRARY libpthread.lib
LIBRARY libstdcppv5.lib
+LIBRARY QtGui.lib
+LIBRARY QtCore.lib
LIBRARY libc.lib
LIBRARY libm.lib
LIBRARY libdl.lib
@@ -128,12 +150,6 @@
#include <platform_paths.hrh>
- APP_LAYER_SYSTEMINCLUDE
-
- OS_LAYER_LIBC_SYSTEMINCLUDE
-
- OS_LAYER_SSL_SYSTEMINCLUDE
-
deffile ./~/javahttp.def
SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
@@ -161,3 +177,5 @@
#elif defined EABI
DEFFILE ./eabi/javahttp.def
#endif
+
+USERINCLUDE .
--- a/javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/http/src.s60/nativehttptraansaction.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -135,7 +135,7 @@
narrowBuffer = HBufC8::NewLC(length);
TPtr8 narrowPtr = narrowBuffer->Des();
narrowPtr.Copy(rawHeader);
- rawHeaderArray.Append(narrowBuffer);
+ rawHeaderArray.AppendL(narrowBuffer);
CleanupStack::Pop(narrowBuffer);
}
aJni->DeleteLocalRef(jniString);
--- a/javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/http/src.s60/nativetransaction.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -20,7 +20,7 @@
#include <centralrepository.h>
#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
-#include <CUserAgent.h>
+#include <cuseragent.h>
#else
#include <cuseragent.h>
#endif
@@ -220,7 +220,6 @@
jstring GetUserAgentL(JNIEnv *aJni, jboolean aMidpRuntime)
{
-
jstring header = NULL;
if (aMidpRuntime == false)
@@ -291,6 +290,6 @@
CleanupStack::PopAndDestroy(repository);
}
-
+ LOG(ESOCKET,EInfo,"GetUserAgentL() -");
return header;
}
--- a/javacommons/gcfprotocols/https/build/javahttps_0x2002DCB2.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/https/build/javahttps_0x2002DCB2.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javahttps.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../http/inc.s60
--- a/javacommons/gcfprotocols/secureconnection/build/javassl_0x2002DCD7.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/secureconnection/build/javassl_0x2002DCD7.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javassl.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../socket/socket/inc
--- a/javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/ssl/SecureConnectionImpl.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/secureconnection/javasrc/com/nokia/mj/impl/ssl/SecureConnectionImpl.java Thu Aug 19 09:48:13 2010 +0300
@@ -35,6 +35,7 @@
import com.nokia.mj.impl.rt.ui.ConfirmData;
import com.nokia.mj.impl.connectionmanager.ConnectionManager;
import com.nokia.mj.impl.connectionmanager.AccessPoint;
+import com.nokia.mj.impl.utils.Id;
import com.nokia.mj.impl.utils.ResourceLoader;
/**
@@ -74,7 +75,7 @@
private static final String LOCALISED_STRING_ID = "qtn_ssl_prompt_";
- private static final String UNTRUSTED_CERTIFICATE_WARNING = "untrusted_certificate";
+ private static final Id UNTRUSTED_CERTIFICATE_WARNING = new Id("untrusted_certificate", "N/A");
/**
* Constructs the SecureConnectionImpl.
--- a/javacommons/gcfprotocols/socket/serverconnection/build/javasocketscplugin_0x2002DCD5.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/socket/serverconnection/build/javasocketscplugin_0x2002DCD5.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javasocketscplugin.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javacommons/gcfprotocols/socket/socket/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/socket/socket/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -41,7 +41,8 @@
<property name="javah.classnames"
value="com.nokia.mj.impl.socket.SocketConnectionImpl,
- com.nokia.mj.impl.socket.ServerSocketConnectionImpl"/>
+ com.nokia.mj.impl.socket.ServerSocketConnectionImpl,
+ com.nokia.mj.impl.properties.socket.SocketDynamicPropertyHandler"/>
<target name="create.internal.api.jar">
<omj.internal.apis includes="com/nokia/mj/impl/gcf/protocol/socket/Protocol.class,
@@ -54,6 +55,12 @@
<omj.public.apis includes="javax/microedition/io/SocketConnection.class,
javax/microedition/io/ServerSocketConnection.class"/>
</target>
+ <target name="system.properties">
+ <properties>
+ java.src.paths=${java.src.paths}
+ microedition.hostname=:socket.SocketDynamicPropertyHandler
+ </properties>
+ </target>
</project>
--- a/javacommons/gcfprotocols/socket/socket/build/javasocket_0x2002DCD4.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/socket/socket/build/javasocket_0x2002DCD4.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javasocket.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javacommons/gcfprotocols/socket/socket/inc/apnsettings.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/socket/socket/inc/apnsettings.h Thu Aug 19 09:48:13 2010 +0300
@@ -27,7 +27,7 @@
public :
static int setDefaultApn(int aType, int aApn);
- static void removeDefaultApn();
+
};
--- a/javacommons/gcfprotocols/socket/socket/inc/socketlocalhostinfo.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/socket/socket/inc/socketlocalhostinfo.h Thu Aug 19 09:48:13 2010 +0300
@@ -27,7 +27,7 @@
public:
OS_IMPORT static int getLocalAddress(int aSd, char *aLocalAddr, int aMidletIapId, int aApType);
-
+ static char* getLocalHostName();
};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/gcfprotocols/socket/socket/javasrc/com/nokia/mj/impl/properties/socket/SocketDynamicPropertyHandler.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.mj.impl.properties.socket;
+
+import java.util.Hashtable;
+import java.io.IOException;
+import com.nokia.mj.impl.rt.support.Jvm;
+import com.nokia.mj.impl.rt.support.SystemPropertyProvider;
+import com.nokia.mj.impl.utils.Logger;
+
+public final class SocketDynamicPropertyHandler implements SystemPropertyProvider
+{
+ static
+ {
+ try
+ {
+ Jvm.loadSystemLibrary("javasocket");
+ }
+ catch (Exception e)
+ {
+ Logger.ELOG(Logger.ESOCKET, e.toString());
+ }
+ }
+
+ private static String SOCKET_LOCALHOST_NAME = "microedition.hostname";
+
+ private static final int LOCALHOST_NAME = 1;
+
+ private static Hashtable iPropertyKeys;
+
+ static
+ {
+ iPropertyKeys = new Hashtable();
+ iPropertyKeys.put(SOCKET_LOCALHOST_NAME, new Integer(
+ LOCALHOST_NAME));
+
+ }
+
+ /**
+ * Retrieves socket localhost system property.
+ *
+ * @param aKey
+ * The property to retrieve as defined in this class.
+ * @return The value of the property specified; null if the property is not
+ * defined
+ */
+ public String getProperty(String aKey)
+ {
+ String propertyValue = null;
+ String propertyName = aKey;
+
+ Object property = iPropertyKeys.get(propertyName);
+ if (null == property)
+ {
+ return "localhost";
+ }
+ propertyValue = _getLocalhostname();
+
+ return propertyValue;
+ }
+
+ public boolean isStatic(String aKey)
+ {
+ return true;
+ }
+
+ private static native String _getLocalhostname();
+}
--- a/javacommons/gcfprotocols/socket/socket/src.s60/apnsettings.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/socket/socket/src.s60/apnsettings.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -66,11 +66,4 @@
return def;
}
-void ApnSettings::removeDefaultApn()
-{
- #ifdef RD_JAVA_OPENC_BETA_PATCH
- setdefaultif(NULL);
- ILOG(ESOCKET, "sedefaultif called");
- ILOG1(ESOCKET, "remove default apn returned %d",setdefaultif(NULL));
- #endif
-}
+
--- a/javacommons/gcfprotocols/socket/socket/src.s60/socketlocalhostinfo.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/socket/socket/src.s60/socketlocalhostinfo.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -22,7 +22,24 @@
#include "logger.h"
#include "connectionmanager.h"
+#define localhost_len 20
int GetlocalIPAdressL(char *localaddr, int aMidletIapId, int aApType);
+char* GetlocalHostNameL();
+
+char* SocketLocalHostInfo::getLocalHostName()
+{
+ char* localhostname =NULL;
+ TRAPD(err,localhostname = GetlocalHostNameL());
+ ILOG1(ESOCKET, "err %d ", err);
+ if (err != KErrNone)
+ {
+ localhostname = new char[localhost_len];
+ strcpy(localhostname,"localhost");
+ return localhostname;
+ }
+ else
+ return localhostname;
+}
OS_EXPORT int SocketLocalHostInfo::getLocalAddress(int /* aSd */, char *aLocalAddr,
int aMidletIapId, int aApType)
@@ -190,3 +207,41 @@
}
+
+char* GetlocalHostNameL()
+{
+ TUint32 activeIapId = 0;
+
+ TConnectionInfoBuf connectionInfo;
+ TUint count = 0;
+ RSocketServ socketServ;
+ RSocket sock;
+ RConnection conn;
+
+ User::LeaveIfError(socketServ.Connect());
+ User::LeaveIfError(sock.Open(socketServ, KAfInet, KSockStream,
+ KProtocolInetTcp));
+ User::LeaveIfError(conn.Open(socketServ));
+ User::LeaveIfError(conn.EnumerateConnections(count));
+
+ char* localhost = new char[localhost_len];
+
+ if (count <= 0)
+ {
+ strcpy(localhost,"localhost");
+ }
+ else
+ {
+
+ User::LeaveIfError(conn.GetConnectionInfo(1, connectionInfo));
+ activeIapId = connectionInfo().iIapId;
+ getIPAddressL(activeIapId,localhost);
+ }
+
+ conn.Close();
+ sock.Close();
+ socketServ.Close();
+
+ return localhost;
+}
+
--- a/javacommons/gcfprotocols/socket/socket/src/socketconnectionjni.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/gcfprotocols/socket/socket/src/socketconnectionjni.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -17,8 +17,10 @@
#include "com_nokia_mj_impl_socket_SocketConnectionImpl.h"
+#include "com_nokia_mj_impl_properties_socket_SocketDynamicPropertyHandler.h"
#include "nativesocketconnection.h"
-
+#include "socketlocalhostinfo.h"
+#include "logger.h"
using namespace java;
@@ -141,3 +143,13 @@
NativeSocketConnection* nativeConn = reinterpret_cast<NativeSocketConnection* >(aNativePeerHandle);
delete nativeConn;
}
+
+JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_properties_socket_SocketDynamicPropertyHandler__1getLocalhostname
+(JNIEnv *aJni, jclass)
+{
+ char* addr;
+ addr = SocketLocalHostInfo::getLocalHostName();
+ jstring jnistring = aJni->NewStringUTF(addr);
+ delete[] addr;
+ return jnistring;
+}
--- a/javacommons/javacommons.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/javacommons.pro Thu Aug 19 09:48:13 2010 +0300
@@ -18,7 +18,7 @@
SUBDIRS += utils/build/javautils.pro
SUBDIRS += comms
SUBDIRS += javastorage
-SUBDIRS += fileutils/build/fileutils.pro
+SUBDIRS += fileutils/build/javafileutils.pro
SUBDIRS += security
SUBDIRS += gcfbase/build/javagcf.pro
SUBDIRS += connectionmanager/build/javaconnectionmanager.pro
--- a/javacommons/javaenv/build/javaenv_0x2001B2A5.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/javaenv/build/javaenv_0x2001B2A5.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javaenv.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javacommons/javaenv/src.s60/javaenvinfo.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/javaenv/src.s60/javaenvinfo.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -113,7 +113,7 @@
{
JELOG2(EUtils);
- TInt size;
+ TInt size = 0;
RFs rfs;
User::LeaveIfError(rfs.Connect());
--- a/javacommons/javaenv/tsrc/build/alltests.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/javaenv/tsrc/build/alltests.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -20,14 +20,12 @@
CAPABILITY all -tcb -allfiles -drm
#include <../../../../inc/java_stdcpp_support_for_exe.hrh>
-#include <domain/osextensions/platform_paths.hrh>
-
-//SYSTEMINCLUDE /epoc32/include
+#include <platform_paths.hrh>
USERINCLUDE ../../../inc
+USERINCLUDE ../../../../inc
USERINCLUDE ../../../../tools/cpputest/include/cpputest
USERINCLUDE ../../../../tools/cpputest/include/platforms/symbian
-USERINCLUDE ../../../../inc
STATICLIBRARY cpputest.lib
--- a/javacommons/javastorage/build/javastorage_0x2002DCD8.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/javastorage/build/javastorage_0x2002DCD8.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javastorage.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javacommons/javastorage/tsrc/storageclient/build/alltests.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/javastorage/tsrc/storageclient/build/alltests.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -22,7 +22,7 @@
#include <../../../../../inc/java_stdcpp_support_for_exe.hrh>
#include <platform_paths.hrh>
-SYSTEMINCLUDE /epoc32/include
+APP_LAYER_SYSTEMINCLUDE
USERINCLUDE ../../../inc
USERINCLUDE ../../../../../tools/cpputest/include/cpputest
--- a/javacommons/jvms/j9utils/threaddump/build/javathreaddumper_0x2002DCD9.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/jvms/j9utils/threaddump/build/javathreaddumper_0x2002DCD9.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javathreaddumper.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../../../../../javaruntimes/inc
--- a/javacommons/jvms/nativeportlayer/build/jvmnativeport_0x2002DCDE.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/jvms/nativeportlayer/build/jvmnativeport_0x2002DCDE.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : jvmnativeport.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javacommons/security/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
<!--
- Copyright (c) 2008 Nokia. All rights reserved.
+ Copyright (c) 2008-2010 Nokia. All rights reserved.
This material, including documentation and any related computer programs,
is protected by copyright controlled by Nokia. All rights are reserved.
@@ -9,9 +9,9 @@
disclosed to others without the prior written consent of Nokia.
-->
-<project name="javasecurity" default="deploy.generate.policies.and.certs" basedir=".">
+<project name="javasecurity" default="deploy.generate.policies" basedir=".">
<description>
- Builds OMJ security, generates the policy files in their internal format and copies the certificates and the metadata into right locations
+ Builds OMJ security and generates the policy files in their internal format
</description>
<import file="../../../build/utilities.xml"/>
@@ -32,7 +32,6 @@
<target name="init" depends="init.properties">
<property name="internal.policies.dir" location="${java.res.root}/security/policies"/>
<mkdir dir="${internal.policies.dir}"/>
- <property name="security_res_dir" location="${java.captain.datacage}/security/trustroots/device/certificates"/>
</target>
<target name="deliver.classes.to.external.tool">
@@ -48,7 +47,7 @@
</jar>
</target>
- <target name="deploy.generate.policies.and.certs" depends="init, deploy.dual, deliver.classes.to.external.tool, set.linux.certs">
+ <target name="deploy.generate.policies" depends="init, deploy.dual, deliver.classes.to.external.tool">
<java classname="com.nokia.mj.tools.security.midp.PolicyEditor"
failonerror="true">
<sysproperty key="emma.properties" value="${emma.properties}"/>
@@ -62,20 +61,10 @@
</java>
</target>
- <target name="set.linux.certs" if="target.linux">
- <copy todir="${security_res_dir}/">
- <fileset dir="../../../javatools/testcerts/" includes="*.der"/>
- </copy>
- <copy todir="${security_res_dir}/">
- <fileset dir="../../../javatools/testcerts/" includes="*.metadata"/>
- </copy>
- </target>
-
<target name="clean" depends="init">
<ant antfile="../../../build/utilities.xml" target="clean"/>
<delete dir="${internal.policies.dir}"/>
<delete file="${external.policy.editor.tool.lib}"/>
- <delete dir="${security_res_dir}"/>
</target>
--- a/javacommons/security/build/exports.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/build/exports.inf Thu Aug 19 09:48:13 2010 +0300
@@ -27,9 +27,12 @@
#include <platform_paths.hrh>
+// Configuration interface for javasecurity
#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
+// Public configuration interface is named as CI_javasecurity.confml
+// and it is located outside of jrt package. The name of private
+// configuration interface is javasecurity2.confml.
../conf/javasecurity2.confml APP_LAYER_CONFML(javasecurity.confml)
-../conf/CI_javasecurity.confml APP_LAYER_CONFML(CI_javasecurity.confml)
#else
../conf/javasecurity.confml APP_LAYER_CONFML(javasecurity.confml)
#endif /* RD_JAVA_S60_RELEASE_10_1_ONWARDS */
--- a/javacommons/security/build/javasecurity_0x2002DCCF.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/build/javasecurity_0x2002DCCF.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javasecurity.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
Binary file javacommons/security/conf/CI_javasecurity.confml has changed
--- a/javacommons/security/data/att_operator.txt Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/data/att_operator.txt Thu Aug 19 09:48:13 2010 +0300
@@ -35,8 +35,12 @@
}
grant user "Messaging" blanket,session,oneshot,no {
- permission javax.microedition.io.Connector.sms "sms://*" "send";
- permission javax.microedition.io.Connector.mms "mms://*" "send";
+ permission javax.microedition.io.Connector.sms "sms://*" "open,send,receive";
+ permission javax.microedition.io.Connector.mms "mms://*" "open,send,receive";
+}
+
+grant user "Restricted Messaging" blanket,no {
+ permission javax.microedition.io.Connector.cbs "cbs://*" "open,receive";
}
grant user "Multimedia Recording" blanket,session,oneshot,no {
@@ -52,12 +56,6 @@
permission javax.microedition.midlet.CmdLineArgsPermission;
}
-grant allowed {
- permission javax.microedition.io.Connector.sms "sms://*" "open,receive";
- permission javax.microedition.io.Connector.mms "mms://*" "open,receive";
- permission javax.microedition.io.Connector.cbs "cbs://*" "open,receive";
-}
-
grant assigned {
permission javax.microedition.midlet.AutoStartPermission;
}
--- a/javacommons/security/data/att_trustedthirdparty.txt Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/data/att_trustedthirdparty.txt Thu Aug 19 09:48:13 2010 +0300
@@ -13,8 +13,8 @@
}
grant user "Messaging" session,oneshot,no {
- permission javax.microedition.io.Connector.sms "sms://*" "send";
- permission javax.microedition.io.Connector.mms "mms://*" "send";
+ permission javax.microedition.io.Connector.sms "sms://*" "open,send,receive";
+ permission javax.microedition.io.Connector.mms "mms://*" "open,send,receive";
}
grant user "Multimedia Recording" session,oneshot,no {
@@ -25,8 +25,3 @@
grant user "Application Auto Invocation" session,oneshot,no {
permission javax.microedition.io.PushRegistryPermission "*" "staticregistration,dynamicregistration,autoinvocation";
}
-
-grant allowed {
- permission javax.microedition.io.Connector.sms "sms://*" "open,receive";
- permission javax.microedition.io.Connector.mms "mms://*" "open,receive";
-}
--- a/javacommons/security/data/att_untrusted.txt Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/data/att_untrusted.txt Thu Aug 19 09:48:13 2010 +0300
@@ -2,4 +2,5 @@
grant user "Net Access" oneshot,no {
permission javax.microedition.io.HttpProtocolPermission "http://*";
permission javax.microedition.io.HttpsProtocolPermission "https://*";
+ permission javax.microedition.io.Connector.rtsp "*";
}
--- a/javacommons/security/javasrc.cdc/com/nokia/mj/impl/security/midp/authorization/PermissionGranter.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javasrc.cdc/com/nokia/mj/impl/security/midp/authorization/PermissionGranter.java Thu Aug 19 09:48:13 2010 +0300
@@ -17,6 +17,7 @@
package com.nokia.mj.impl.security.midp.authorization;
+import com.nokia.mj.impl.utils.Id;
import com.nokia.mj.impl.utils.Uid;
import com.nokia.mj.impl.utils.exception.InvalidAttributeException;
import com.nokia.mj.impl.security.midp.common.MIDPPermission;
@@ -457,7 +458,7 @@
if (permissions_from_sensitive_combination_list_1
&& permissions_from_sensitive_combination_list_2)
{
- String blanketPermissionsDetails = (
+ /*String blanketPermissionsDetails = (
((call_control == true && multimedia == true)
|| (call_control == true && read_user_data == true)
|| (net_access == true && multimedia == true)
@@ -465,7 +466,18 @@
|| (messaging == true && multimedia == true)
|| (messaging == true && read_user_data == true)) ?
"settings_inst_query_perm_net" :
- "settings_inst_query_perm_sec");
+ "settings_inst_query_perm_sec");*/
+
+ Id blanketPermissionsDetails = (
+ ((call_control == true && multimedia == true)
+ || (call_control == true && read_user_data == true)
+ || (net_access == true && multimedia == true)
+ || (net_access == true && read_user_data == true)
+ || (messaging == true && multimedia == true)
+ || (messaging == true && read_user_data == true)) ?
+ new Id("settings_inst_query_perm_net", "N/A") :
+ new Id("settings_inst_query_perm_sec", "N/A"));
+
iBlanketPermissionsDetails.put(msUidKey,
UserSecuritySettingsImpl.getLocalizedString(
blanketPermissionsDetails));
--- a/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationException.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationException.java Thu Aug 19 09:48:13 2010 +0300
@@ -37,6 +37,7 @@
public static final int CERT_EXPIRED = 8;
public static final int ROOT_CERT_IN_CHAIN = 9;
public static final int UNKNOWN_EXT_KEY_USAGE = 10;
+ public static final int JAR_NOT_FOUND = 11;
// the error code encapsulated in this exception
private int errorCode;
--- a/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationModule.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationModule.java Thu Aug 19 09:48:13 2010 +0300
@@ -277,7 +277,11 @@
try
{
Vector allAuthCredentials = (Vector)iAuthCredentials.get(msUID);
- String jarHash = _computeHash(appJARPath);
+ String jarHash = null;
+ try
+ {
+ jarHash = _computeHash(appJARPath);
+ }catch(AuthenticationException e) {}
if (jarHash == null || jarHash.length() == 0)
{
// could not compute hash for the given application
@@ -410,7 +414,11 @@
new String[] {"Unknown protection domain " + protectionDomain},
OtaStatusCode.INTERNAL_ERROR);
}
- String jarHash = _computeHash(appJARPath);
+ String jarHash = null;
+ try
+ {
+ jarHash = _computeHash(appJARPath);
+ }catch(AuthenticationException e) {}
if (jarHash == null || jarHash.length() == 0)
{
// could not compute hash for the given application
@@ -825,7 +833,23 @@
&& authStorageData.getJarHashValue().length() > 0)
{
Logger.log(" Doing tamper detection");
- String computedJarHash = _computeHash(authStorageData.getJarPath());
+ String computedJarHash = null;
+ try
+ {
+ computedJarHash = _computeHash(authStorageData.getJarPath());
+ }catch(AuthenticationException e)
+ {
+ if (e.getErrorCode()
+ == AuthenticationException.JAR_NOT_FOUND)
+ {
+ Logger.logWarning(" Jar not found while trying to compute hash");
+ throw new RuntimeSecurityException(
+ SecurityErrorMessage.JAR_NOT_FOUND,
+ null, /* no params for short msg */
+ SecurityDetailedErrorMessage.JAR_NOT_FOUND,
+ null /* no params for detailed msg */);
+ }
+ }
// do the tampering check: compute the hash and compare it with the stored hash
if (computedJarHash == null || !computedJarHash.equals(
authStorageData.getJarHashValue()))
@@ -1120,6 +1144,7 @@
private boolean isDriveProtected(int aMediaId)
{
DriveInfo[] allDrives = DriveUtilities.getAllDrives();
+ boolean driveFound = false;
if (allDrives != null)
{
for (int i=0; i<allDrives.length; i++)
@@ -1134,11 +1159,11 @@
{
return false;
}
- return true;
+ driveFound = true;
}
}
}
- return false;
+ return driveFound;
}
private Credentials selectCredentials(String selectedJarHash, Vector allAuthCredentials, Vector validatedChainIndexes)
--- a/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/common/NetworkRestrictionsAttribute.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/common/NetworkRestrictionsAttribute.java Thu Aug 19 09:48:13 2010 +0300
@@ -25,9 +25,8 @@
/**
* Specifies the allowed MCC (3 digits) and MNC (2 or 3 digits) tuples,
- * separated by a hyphen (Unicode U+002D), to limit the execution to certain
- * networks for any MIDlets within a MIDlet suite bound to the Operator
- * Protection Domain
+ * separated by a space. The tuples are used to limit the execution of
+ * Operator signed MIDlets
*/
public class NetworkRestrictionsAttribute
{
@@ -35,7 +34,7 @@
* The JAR attribute holding the network restriction info
*/
public static final String ATTRIBUTE_NAME
- = "MIDlet-Operator-Allowed";
+ = "Nokia-MIDlet-Operator-Allowed";
/* The network restrictions contained in the attribute */
private NetworkRestriction[] restrictions;
--- a/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/common/PermissionMappingTable.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/common/PermissionMappingTable.java Thu Aug 19 09:48:13 2010 +0300
@@ -228,6 +228,9 @@
"javax.microedition.midlet.AutoStartPermission", new MIDPPermission(
"com.nokia.mj.impl.installer.utils.AutoStartPermission", null));
PERMISSION_MAPPING_TABLE.put(
+ "AutoStartPermission", new MIDPPermission(
+ "com.nokia.mj.impl.installer.utils.AutoStartPermission", null));
+ PERMISSION_MAPPING_TABLE.put(
"javax.microedition.midlet.CmdLineArgsPermission", new MIDPPermission(
"com.nokia.mj.impl.rt.utils.CmdLineArgsPermission", null));
PERMISSION_MAPPING_TABLE.put(
--- a/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/common/UserSecuritySettingsImpl.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/common/UserSecuritySettingsImpl.java Thu Aug 19 09:48:13 2010 +0300
@@ -18,6 +18,7 @@
package com.nokia.mj.impl.security.midp.common;
import java.util.Vector;
+import com.nokia.mj.impl.utils.Id;
import com.nokia.mj.impl.utils.ResourceLoader;
/**
@@ -35,24 +36,29 @@
private static ResourceLoader resLoader = null;
private boolean active;
- private static final String NET_ACCESS_ID = "setting_net_access";
- private static final String LOW_LEVEL_NET_ACCESS_ID = "setting_low_level_net_access";
- private static final String MESSAGING_ID = "setting_messaging";
- private static final String RESTRICTED_MESSAGING_ID = "setting_restricted_messaging";
- private static final String CALL_CONTROL_ID = "setting_call_control";
- private static final String LOCAL_CONNECTIVITY_ID = "setting_local_conn";
- private static final String MULTIMEDIA_RECORDING_ID = "setting_mm_record";
- private static final String READ_USER_DATA_ACCESS_ID = "setting_read_data";
- private static final String WRITE_USER_DATA_ACCESS_ID = "setting_write_data";
- private static final String APPLICATION_AUTO_INVOCATION_ID = "setting_app_auto_invocat";
- private static final String PHONE_CALL_ID = "setting_phone_call";
- private static final String LOCATION_ID = "setting_location";
- private static final String LANDMARK_ID = "setting_landmarks";
- private static final String SMART_CARD_COMMUNICATION_ID = "setting_smartcard";
- private static final String AUTHENTICATION_ID = "setting_auth";
- private static final String BROADCAST_ID = "setting_broadcast";
- private static final String NFC_WRITE_ACCESS_ID = "setting_nfc_write_access";
- private static final String URL_START_ID = "setting_url_start";
+ private static final Id NET_ACCESS_ID = new Id("setting_net_access", "setlabel_net_access");
+ private static final Id LOW_LEVEL_NET_ACCESS_ID = new Id("setting_low_level_net_access", "setlabel_low_level_net_access");
+ private static final Id MESSAGING_ID = new Id("setting_messaging", "setlabel_messaging");
+ private static final Id RESTRICTED_MESSAGING_ID = new Id("setting_restricted_messaging", "setlabel_restricted_messaging");
+ private static final Id CALL_CONTROL_ID = new Id("setting_call_control", "setlabel_call_control");
+ private static final Id LOCAL_CONNECTIVITY_ID = new Id("setting_local_conn", "setlabel_local_conn");
+ private static final Id MULTIMEDIA_RECORDING_ID = new Id("setting_mm_record", "setlabel_mm_record");
+ private static final Id READ_USER_DATA_ACCESS_ID = new Id("setting_read_data", "setlabel_read_data");
+ private static final Id WRITE_USER_DATA_ACCESS_ID = new Id("setting_write_data", "setlabel_write_data");
+ private static final Id APPLICATION_AUTO_INVOCATION_ID = new Id("setting_app_auto_invocat", "setlabel_app_auto_invoc");
+ private static final Id PHONE_CALL_ID = new Id("setting_phone_call", "setlabel_call_control");
+ private static final Id LOCATION_ID = new Id("setting_location", "setlabel_location");
+ private static final Id LANDMARK_ID = new Id("setting_landmarks", "setlabel_landmarks");
+ private static final Id SMART_CARD_COMMUNICATION_ID = new Id("setting_smartcard", "setlabel_smartcard");
+ private static final Id AUTHENTICATION_ID = new Id("setting_auth", "setlabel_auth");
+ private static final Id BROADCAST_ID = new Id("setting_broadcast", "setlabel_broadcast");
+ private static final Id NFC_WRITE_ACCESS_ID = new Id("setting_nfc_write_access", "setlabel_nfc_write_access");
+ private static final Id URL_START_ID = new Id("setting_url_start", "setlabel_url_start");
+
+ private static final String AVKON_LOC_FILE = "javaapplicationsettings";
+ private static final String AVKON_PREFIX = "qtn_java_";
+ private static final String QT_LOC_FILE = "javaruntimeapplicationsettings";
+ private static final String QT_PREFIX = "txt_java_sett_";
public UserSecuritySettingsImpl(
String name,
@@ -106,9 +112,9 @@
{
if (resLoader == null)
{
- resLoader = ResourceLoader.getInstance("javaapplicationsettings", "qtn_java_");
+ resLoader = ResourceLoader.getInstance(AVKON_LOC_FILE, AVKON_PREFIX, QT_LOC_FILE, QT_PREFIX);
}
- String id = "";
+ Id id = null;
if (NET_ACCESS_SETTINGS.equalsIgnoreCase(aSettingName))
{
id = NET_ACCESS_ID;
@@ -188,11 +194,11 @@
return resLoader.format(id, null /*aTextParameters*/);
}
- public static String getLocalizedString(String aStrId)
+ public static String getLocalizedString(Id aStrId)
{
if (resLoader == null)
{
- resLoader = ResourceLoader.getInstance("javaapplicationsettings", "qtn_java_");
+ resLoader = ResourceLoader.getInstance(AVKON_LOC_FILE, AVKON_PREFIX, QT_LOC_FILE, QT_PREFIX);
}
return resLoader.format(aStrId, null /*aTextParameters*/);
}
--- a/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/storage/SecurityStorage.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/midp/storage/SecurityStorage.java Thu Aug 19 09:48:13 2010 +0300
@@ -1156,7 +1156,7 @@
appUID.getStringValue()));
query.addAttribute(new StorageAttribute(
StorageNames.NAME,
- "MIDlet-Operator-Allowed"));
+ "Nokia-MIDlet-Operator-Allowed"));
query.addAttribute(new StorageAttribute(
StorageNames.VALUE,
""));
--- a/javacommons/security/javasrc/com/nokia/mj/impl/security/utils/SecurityDetailedErrorMessage.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/utils/SecurityDetailedErrorMessage.java Thu Aug 19 09:48:13 2010 +0300
@@ -39,6 +39,7 @@
public static final int OCSP_GENERAL_ERR = 7;
public static final int OCSP_SETTINGS_ERR = 8;
public static final int OCSP_REVOKED_ERR = 9;
+ public static final int JAR_NOT_FOUND = 10;
/*** ----------------------------- PUBLIC ------------------------------ */
@@ -56,15 +57,32 @@
return iMessageTable;
}
Hashtable messageTable = new Hashtable();
- messageTable.put(new Integer(JAR_TAMPERED), "jar_tampered_details");
- messageTable.put(new Integer(CERT_DISABLED), "cert_disabled");
- messageTable.put(new Integer(CERT_DELETED), "cert_deleted");
- messageTable.put(new Integer(SIM_CHANGED), "sim_changed");
- messageTable.put(new Integer(UNIDENTIFIED_APPLICATION), "unidentified_application");
- messageTable.put(new Integer(NETWORK_RESTRICTION_VIOLATION), "net_restr_violation_details");
- messageTable.put(new Integer(OCSP_GENERAL_ERR), "ocsp_general_details");
- messageTable.put(new Integer(OCSP_SETTINGS_ERR), "ocsp_settings");
- messageTable.put(new Integer(OCSP_REVOKED_ERR), "ocsp_revoked");
+ if (getLocaleIdQt() == null)
+ {
+ messageTable.put(new Integer(JAR_TAMPERED), "jar_tampered_details");
+ messageTable.put(new Integer(CERT_DISABLED), "cert_disabled");
+ messageTable.put(new Integer(CERT_DELETED), "cert_deleted");
+ messageTable.put(new Integer(SIM_CHANGED), "sim_changed");
+ messageTable.put(new Integer(UNIDENTIFIED_APPLICATION), "unidentified_application");
+ messageTable.put(new Integer(NETWORK_RESTRICTION_VIOLATION), "net_restr_violation_details");
+ messageTable.put(new Integer(OCSP_GENERAL_ERR), "ocsp_general_details");
+ messageTable.put(new Integer(OCSP_SETTINGS_ERR), "ocsp_settings");
+ messageTable.put(new Integer(OCSP_REVOKED_ERR), "ocsp_revoked");
+ messageTable.put(new Integer(JAR_NOT_FOUND), "jar_not_found_details");
+ }
+ else
+ {
+ messageTable.put(new Integer(JAR_TAMPERED), "jar_tampered_details");
+ messageTable.put(new Integer(CERT_DISABLED), "cert_disabled");
+ messageTable.put(new Integer(CERT_DELETED), "cert_deleted");
+ messageTable.put(new Integer(SIM_CHANGED), "sim_changed");
+ messageTable.put(new Integer(UNIDENTIFIED_APPLICATION), "unidentified_application");
+ messageTable.put(new Integer(NETWORK_RESTRICTION_VIOLATION), "net_restr_violation_details");
+ messageTable.put(new Integer(OCSP_GENERAL_ERR), "error_ocsp_general_details");
+ messageTable.put(new Integer(OCSP_SETTINGS_ERR), "error_ocsp_settings");
+ messageTable.put(new Integer(OCSP_REVOKED_ERR), "error_ocsp_revoked");
+ messageTable.put(new Integer(JAR_NOT_FOUND), "jar_not_found_details");
+ }
iMessageTable = messageTable;
return iMessageTable;
}
@@ -78,11 +96,37 @@
{
if (iRes == null)
{
- iRes = ResourceLoader.getInstance("javausermessages", "qtn_java_secur_error_");
+ if (getLocaleIdQt() == null)
+ {
+ iRes = ResourceLoader.getInstance(
+ "javausermessages", "qtn_java_secur_error_");
+ }
}
return iRes;
}
+ /**
+ * Method for retrieving the ResourceLoader instance that is used
+ * to localise error message for specified error code.
+ *
+ * @param errorCode error code for which ResourceLoader is returned
+ */
+ protected ResourceLoader getResourceLoader(int errorCode)
+ {
+ String resFilename = "javaapplicationsecuritymessages";
+ String resPrefix = "txt_java_secur_info_";
+ switch (errorCode)
+ {
+ case OCSP_GENERAL_ERR:
+ case OCSP_SETTINGS_ERR:
+ case OCSP_REVOKED_ERR:
+ resFilename = "javaapplicationinstaller";
+ resPrefix = "txt_java_secur_info_";
+ break;
+ }
+ return getResourceLoader(resFilename, resPrefix);
+ }
+
/*** ----------------------------- PACKAGE ---------------------------- */
/*** ----------------------------- PRIVATE ---------------------------- */
/*** ----------------------------- NATIVE ----------------------------- */
--- a/javacommons/security/javasrc/com/nokia/mj/impl/security/utils/SecurityErrorMessage.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/utils/SecurityErrorMessage.java Thu Aug 19 09:48:13 2010 +0300
@@ -23,18 +23,16 @@
/**
* Class defining Security short error messages.
- *
- * @author Nokia Corporation
- * @version 1.0
*/
public final class SecurityErrorMessage extends ErrorMessageBase
{
// Security error codes.
- public static final int JAR_TAMPERED = 1;
- public static final int CERT_NOT_AVAILABLE = 2;
- public static final int UNEXPECTED_ERR = 3;
- public static final int NETWORK_RESTRICTION_VIOLATION = 4;
- public static final int OCSP_GENERAL_ERR = 5;
+ public static final int JAR_TAMPERED = 1 + ErrorMessageBase.SECURITY_RANGE_START;
+ public static final int CERT_NOT_AVAILABLE = 2 + ErrorMessageBase.SECURITY_RANGE_START;
+ public static final int UNEXPECTED_ERR = 3 + ErrorMessageBase.SECURITY_RANGE_START;
+ public static final int NETWORK_RESTRICTION_VIOLATION = 4 + ErrorMessageBase.SECURITY_RANGE_START;
+ public static final int OCSP_GENERAL_ERR = 5 + ErrorMessageBase.SECURITY_RANGE_START;
+ public static final int JAR_NOT_FOUND = 6 + ErrorMessageBase.SECURITY_RANGE_START;
/*** ----------------------------- PUBLIC ------------------------------ */
/*** ---------------------------- PROTECTED --------------------------- */
@@ -51,11 +49,24 @@
return iMessageTable;
}
Hashtable messageTable = new Hashtable();
- messageTable.put(new Integer(JAR_TAMPERED), "jar_tampered");
- messageTable.put(new Integer(CERT_NOT_AVAILABLE), "cert_not_available");
- messageTable.put(new Integer(UNEXPECTED_ERR), "unexpected_err");
- messageTable.put(new Integer(NETWORK_RESTRICTION_VIOLATION), "net_restr_violation");
- messageTable.put(new Integer(OCSP_GENERAL_ERR), "ocsp_general");
+ if (getLocaleIdQt() == null)
+ {
+ messageTable.put(new Integer(JAR_TAMPERED), "jar_tampered");
+ messageTable.put(new Integer(CERT_NOT_AVAILABLE), "cert_not_available");
+ messageTable.put(new Integer(UNEXPECTED_ERR), "unexpected_err");
+ messageTable.put(new Integer(NETWORK_RESTRICTION_VIOLATION), "net_restr_violation");
+ messageTable.put(new Integer(OCSP_GENERAL_ERR), "ocsp_general");
+ messageTable.put(new Integer(JAR_NOT_FOUND), "jar_not_found");
+ }
+ else
+ {
+ messageTable.put(new Integer(JAR_TAMPERED), "jar_tampered");
+ messageTable.put(new Integer(CERT_NOT_AVAILABLE), "cert_not_available");
+ messageTable.put(new Integer(UNEXPECTED_ERR), "unexpected_error");
+ messageTable.put(new Integer(NETWORK_RESTRICTION_VIOLATION), "net_restr_violation");
+ messageTable.put(new Integer(OCSP_GENERAL_ERR), "there_is_a_security_issue_with_this");
+ messageTable.put(new Integer(JAR_NOT_FOUND), "error_jar_not_found");
+ }
iMessageTable = messageTable;
return iMessageTable;
}
@@ -69,11 +80,39 @@
{
if (iRes == null)
{
- iRes = ResourceLoader.getInstance("javausermessages", "qtn_java_secur_error_");
+ // This method returns ResourceLoader only when Qt
+ // localisation is not in use. When Qt localisation
+ // is in use this method returns null and
+ // ResourceLoader is obtained with getResourceLoader(int)
+ // method variant.
+ if (getLocaleIdQt() == null)
+ {
+ iRes = ResourceLoader.getInstance("javausermessages", "qtn_java_secur_error_");
+ }
}
return iRes;
}
+ /**
+ * Method for retrieving the ResourceLoader instance that is used
+ * to localise error message for specified error code.
+ *
+ * @param errorCode error code for which ResourceLoader is returned
+ */
+ protected ResourceLoader getResourceLoader(int errorCode)
+ {
+ String resFilename = "javaapplicationsecuritymessages";
+ String resPrefix = "txt_java_secur_info_";
+ switch (errorCode)
+ {
+ case OCSP_GENERAL_ERR:
+ resFilename = "common_errors";
+ resPrefix = "txt_error_info_";
+ break;
+ }
+ return getResourceLoader(resFilename, resPrefix);
+ }
+
/*** ----------------------------- PACKAGE ---------------------------- */
/*** ----------------------------- PRIVATE ---------------------------- */
/*** ----------------------------- NATIVE ----------------------------- */
--- a/javacommons/security/javasrc/com/nokia/mj/impl/security/utils/SecurityPermissionTexts.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/utils/SecurityPermissionTexts.java Thu Aug 19 09:48:13 2010 +0300
@@ -17,6 +17,7 @@
package com.nokia.mj.impl.security.utils;
+import com.nokia.mj.impl.utils.Id;
import com.nokia.mj.impl.utils.LocalizedTextProvider;
import com.nokia.mj.impl.utils.ResourceLoader;
@@ -28,20 +29,25 @@
private static ResourceLoader iRes = null;
// identifiers for the security permission texts
- public static final String CALL_CONTROL = "call_control";
- public static final String NET_ACCESS = "net_access";
- public static final String LOW_LEVEL_NET_ACCESS = "low_level_net_access";
- public static final String MESSAGING = "messaging";
- public static final String RESTRICTED_MESSAGING = "restricted_messaging";
- public static final String APP_AUTO_INVOCAT = "app_auto_invocat";
- public static final String LOCAL_CONN = "local_conn";
- public static final String MM_RECORD = "mm_record";
- public static final String READ_DATA = "read_data";
- public static final String WRITE_DATA = "write_data";
- public static final String LOCATION = "location";
- public static final String LANDMARKS = "landmarks";
- public static final String AUTH = "auth";
- public static final String BROADCAST = "broadcast";
+ public static final Id CALL_CONTROL = new Id("call_control", "N/A");
+ public static final Id NET_ACCESS = new Id("net_access", "N/A");
+ public static final Id LOW_LEVEL_NET_ACCESS = new Id("low_level_net_access", "N/A");
+ public static final Id MESSAGING = new Id("messaging", "qt_kalle_test_d");
+ public static final Id RESTRICTED_MESSAGING = new Id("restricted_messaging", "N/A");
+ public static final Id APP_AUTO_INVOCAT = new Id("app_auto_invocat", "N/A");
+ public static final Id LOCAL_CONN = new Id("local_conn", "N/A");
+ public static final Id MM_RECORD = new Id("mm_record", "N/A");
+ public static final Id READ_DATA = new Id("read_data", "N/A");
+ public static final Id WRITE_DATA = new Id("write_data", "N/A");
+ public static final Id LOCATION = new Id("location", "N/A");
+ public static final Id LANDMARKS = new Id("landmarks", "N/A");
+ public static final Id AUTH = new Id("auth", "N/A");
+ public static final Id BROADCAST = new Id("broadcast", "N/A");
+
+ private static final String AVKON_LOC_FILE = "javainstallation";
+ private static final String AVKON_PREFIX = "qtn_java_inst_perm_";
+ private static final String QT_LOC_FILE = "N/A";
+ private static final String QT_PREFIX = "N/A";
/**
* Creates an instance of the SecurityPermissionTexts
@@ -73,12 +79,13 @@
* @return the localized text associated with the provided
* identifier and parameters
*/
- public String getText(String aTextId, Object[] aTextParams)
+ public String getText(Id aTextId, Object[] aTextParams)
{
if (iRes == null)
{
- iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_perm_");
+ iRes = ResourceLoader.getInstance(AVKON_LOC_FILE, AVKON_PREFIX, QT_LOC_FILE, QT_PREFIX);
}
+
return iRes.format(aTextId, aTextParams);
}
}
--- a/javacommons/security/javasrc/com/nokia/mj/impl/security/utils/SecurityPromptMessage.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javasrc/com/nokia/mj/impl/security/utils/SecurityPromptMessage.java Thu Aug 19 09:48:13 2010 +0300
@@ -17,6 +17,7 @@
package com.nokia.mj.impl.security.utils;
+import com.nokia.mj.impl.utils.Id;
import com.nokia.mj.impl.utils.LocalizedTextProvider;
import com.nokia.mj.impl.utils.ResourceLoader;
@@ -28,68 +29,74 @@
private static ResourceLoader iRes = null;
// identifiers for the security prompt questions
- public static final String QUESTION_ID_NETWORK_USAGE = "network_usage";
- public static final String QUESTION_ID_SMS_OPENING_CONN = "sms_opening_conn";
- public static final String QUESTION_ID_MMS_OPENING_CONN = "mms_opening_conn";
- public static final String QUESTION_ID_CBS_OPENING_CONN = "cbs_opening_conn";
- public static final String QUESTION_ID_SMS_RECEIVING = "sms_receiving";
- public static final String QUESTION_ID_MMS_RECEIVING = "mms_receiving";
- public static final String QUESTION_ID_CBS_RECEIVING = "cbs_receiving";
- public static final String QUESTION_ID_SMS_SENDING = "sms_sending";
- public static final String QUESTION_ID_SMS_SINGLE_SENDING = "sms_single_sending";
- public static final String QUESTION_ID_MMS_SENDING = "mms_sending";
- public static final String QUESTION_ID_MMS_SINGLE_SENDING = "mms_single_sending";
- public static final String QUESTION_ID_MMS_SINGLE_SENDING_MULTIPLE_DESTINATIONS = "mms_single_sending_multiple_destinations";
- public static final String QUESTION_ID_SEND_RECEIVE_MESSAGES = "receive_send_messages";
- public static final String QUESTION_ID_LOCAL_CONNECTIVITY = "local_connectivity";
- public static final String QUESTION_ID_AUDIO_VIDEO_RECORDING = "audio_video_recording";
- public static final String QUESTION_ID_READING_USER_DATA = "reading_user_data";
- public static final String QUESTION_ID_WRITING_USER_DATA = "writing_user_data";
- public static final String QUESTION_ID_READING_FILE = "reading_file";
- public static final String QUESTION_ID_MANAGE_USER_DATA = "manage_user_data";
- public static final String QUESTION_ID_MODIFYING_FILE = "modifying_file";
- public static final String QUESTION_ID_READING_LOCATION_DATA = "reading_location_data";
- public static final String QUESTION_ID_READING_LANDMARK_DATA = "reading_landmark_data";
- public static final String QUESTION_ID_READING_SMARTCARD = "reading_smartcard";
- public static final String QUESTION_ID_AUTH_SERVICES_USAGE = "auth_services_usage";
- public static final String QUESTION_ID_BLUETOOTH_USAGE = "bluetooth_usage";
- public static final String QUESTION_ID_READING_CONTACTS = "reading_contacts";
- public static final String QUESTION_ID_MODIFYING_CONTACTS = "modifying_contacts";
- public static final String QUESTION_ID_READING_EVENTS = "reading_events";
- public static final String QUESTION_ID_MODIFYING_EVENTS = "modifying_events";
- public static final String QUESTION_ID_READING_TODOS = "reading_todos";
- public static final String QUESTION_ID_MODIFYING_TODOS = "modifying_todos";
- public static final String QUESTION_ID_DELETING_ITEM = "deleting_item";
- public static final String QUESTION_ID_UPDATING_ITEM = "updating_item";
- public static final String QUESTION_ID_DELETING_CATEGORY = "deleting_category";
- public static final String QUESTION_ID_UPDATING_CATEGORY = "updating_category";
- public static final String QUESTION_ID_DELETING_UNNAMED_ITEM = "deleting_unnamed_item";
- public static final String QUESTION_ID_UPDATING_UNNAMED_ITEM = "updating_unnamed_item";
- public static final String QUESTION_ID_ADDING_CALENDAR = "adding_calendar";
- public static final String QUESTION_ID_DELETING_CALENDAR = "deleting_calendar";
- public static final String QUESTION_ID_LISTING_CALENDARS = "listing_calendars";
- public static final String QUESTION_ID_ORIENTATION_DATA_USAGE = "orientation_data_usage";
- public static final String QUESTION_ID_POSITIONING_DATA_USAGE = "positioning_data_usage";
- public static final String QUESTION_ID_LANDMARK_DATA_USAGE = "landmark_data_usage";
- public static final String QUESTION_ID_PROXIMITY_LISTENER_REGISTRATION = "proximity_listener_registration";
- public static final String QUESTION_ID_MOBITV_DATA_USAGE = "tv_broadcast_user_data_access";
- public static final String QUESTION_ID_NETWORK_USAGE_VIA_PLAT_REQ = "network_usage_via_plat_req";
- public static final String QUESTION_ID_APP_LAUNCH_VIA_PLAT_REQ = "app_launch_via_plat_req";
- public static final String QUESTION_ID_PUSH_STATIC_REGISTRATION = "push_registration_static";
- public static final String QUESTION_ID_PUSH_DYNAMIC_REGISTRATION = "push_registration_dynamic";
- public static final String QUESTION_ID_AUTO_INVOCATION = "auto_invocation";
- public static final String QUESTION_ID_NDEF_TAG_WRITE = "nfc_ndef_tag_write";
- public static final String QUESTION_ID_APP_AUTO_LAUNCH = "url_start";
+ public static final Id QUESTION_ID_NETWORK_USAGE = new Id("network_usage", "N/A");
+ public static final Id QUESTION_ID_SMS_OPENING_CONN = new Id("sms_opening_conn", "N/A");
+ public static final Id QUESTION_ID_MMS_OPENING_CONN = new Id("mms_opening_conn", "N/A");
+ public static final Id QUESTION_ID_CBS_OPENING_CONN = new Id("cbs_opening_conn", "N/A");
+ public static final Id QUESTION_ID_SMS_RECEIVING = new Id("sms_receiving", "N/A");
+ public static final Id QUESTION_ID_MMS_RECEIVING = new Id("mms_receiving", "N/A");
+ public static final Id QUESTION_ID_CBS_RECEIVING = new Id("cbs_receiving", "N/A");
+ public static final Id QUESTION_ID_SMS_SENDING = new Id("sms_sending", "N/A");
+ public static final Id QUESTION_ID_SMS_SINGLE_SENDING = new Id("sms_single_sending", "N/A");
+ public static final Id QUESTION_ID_MMS_SENDING = new Id("mms_sending", "N/A");
+ public static final Id QUESTION_ID_MMS_SINGLE_SENDING = new Id("mms_single_sending", "N/A");
+ public static final Id QUESTION_ID_MMS_SINGLE_SENDING_MULTIPLE_DESTINATIONS = new Id("mms_single_sending_multiple_destinations", "N/A");
+ public static final Id QUESTION_ID_SEND_RECEIVE_MESSAGES = new Id("receive_send_messages", "N/A");
+ public static final Id QUESTION_ID_LOCAL_CONNECTIVITY = new Id("local_connectivity", "N/A");
+ public static final Id QUESTION_ID_AUDIO_VIDEO_RECORDING = new Id("audio_video_recording", "N/A");
+ public static final Id QUESTION_ID_READING_USER_DATA = new Id("reading_user_data", "N/A");
+ public static final Id QUESTION_ID_WRITING_USER_DATA = new Id("writing_user_data", "N/A");
+ public static final Id QUESTION_ID_READING_FILE = new Id("reading_file", "N/A");
+ public static final Id QUESTION_ID_MANAGE_USER_DATA = new Id("manage_user_data", "N/A");
+ public static final Id QUESTION_ID_MODIFYING_FILE = new Id("modifying_file", "N/A");
+ public static final Id QUESTION_ID_READING_LOCATION_DATA = new Id("reading_location_data", "N/A");
+ public static final Id QUESTION_ID_READING_LANDMARK_DATA = new Id("reading_landmark_data", "N/A");
+ public static final Id QUESTION_ID_READING_SMARTCARD = new Id("reading_smartcard", "N/A");
+ public static final Id QUESTION_ID_AUTH_SERVICES_USAGE = new Id("auth_services_usage", "N/A");
+ public static final Id QUESTION_ID_BLUETOOTH_USAGE = new Id("bluetooth_usage", "N/A");
+ public static final Id QUESTION_ID_READING_CONTACTS = new Id("reading_contacts", "N/A");
+ public static final Id QUESTION_ID_MODIFYING_CONTACTS = new Id("modifying_contacts", "N/A");
+ public static final Id QUESTION_ID_READING_EVENTS = new Id("reading_events", "N/A");
+ public static final Id QUESTION_ID_MODIFYING_EVENTS = new Id("modifying_events", "N/A");
+ public static final Id QUESTION_ID_READING_TODOS = new Id("reading_todos", "N/A");
+ public static final Id QUESTION_ID_MODIFYING_TODOS = new Id("modifying_todos", "N/A");
+ public static final Id QUESTION_ID_DELETING_ITEM = new Id("deleting_item", "N/A");
+ public static final Id QUESTION_ID_UPDATING_ITEM = new Id("updating_item", "N/A");
+ public static final Id QUESTION_ID_DELETING_CATEGORY = new Id("deleting_category", "N/A");
+ public static final Id QUESTION_ID_UPDATING_CATEGORY = new Id("updating_category", "N/A");
+ public static final Id QUESTION_ID_DELETING_UNNAMED_ITEM = new Id("deleting_unnamed_item", "N/A");
+ public static final Id QUESTION_ID_UPDATING_UNNAMED_ITEM = new Id("updating_unnamed_item", "N/A");
+ public static final Id QUESTION_ID_ADDING_CALENDAR = new Id("adding_calendar", "N/A");
+ public static final Id QUESTION_ID_DELETING_CALENDAR = new Id("deleting_calendar", "N/A");
+ public static final Id QUESTION_ID_LISTING_CALENDARS = new Id("listing_calendars", "N/A");
+ public static final Id QUESTION_ID_ORIENTATION_DATA_USAGE = new Id("orientation_data_usage", "N/A");
+ public static final Id QUESTION_ID_POSITIONING_DATA_USAGE = new Id("positioning_data_usage", "N/A");
+ public static final Id QUESTION_ID_LANDMARK_DATA_USAGE = new Id("landmark_data_usage", "N/A");
+ public static final Id QUESTION_ID_PROXIMITY_LISTENER_REGISTRATION = new Id("proximity_listener_registration", "N/A");
+ public static final Id QUESTION_ID_MOBITV_DATA_USAGE = new Id("tv_broadcast_user_data_access", "N/A");
+ public static final Id QUESTION_ID_NETWORK_USAGE_VIA_PLAT_REQ = new Id("network_usage_via_plat_req", "N/A");
+ public static final Id QUESTION_ID_APP_LAUNCH_VIA_PLAT_REQ = new Id("app_launch_via_plat_req", "N/A");
+ public static final Id QUESTION_ID_PUSH_STATIC_REGISTRATION = new Id("push_registration_static", "N/A");
+ public static final Id QUESTION_ID_PUSH_DYNAMIC_REGISTRATION = new Id("push_registration_dynamic", "N/A");
+ public static final Id QUESTION_ID_AUTO_INVOCATION = new Id("auto_invocation", "N/A");
+ public static final Id QUESTION_ID_NDEF_TAG_WRITE = new Id("nfc_ndef_tag_write", "N/A");
+ public static final Id QUESTION_ID_APP_AUTO_LAUNCH = new Id("url_start", "N/A");
// identifiers for the security prompt answer options
- public static final String ANSWER_ID_ALLOW = "prompt_allow";
- public static final String ANSWER_ID_DENY = "prompt_deny";
- public static final String ANSWER_ID_YES = "prompt_yes";
- public static final String ANSWER_ID_NO = "prompt_no";
+ public static final Id ANSWER_ID_ALLOW = new Id("prompt_allow", "N/A");
+ public static final Id ANSWER_ID_DENY = new Id("prompt_deny", "N/A");
+ public static final Id ANSWER_ID_YES = new Id("prompt_yes", "N/A");
+ public static final Id ANSWER_ID_NO = new Id("prompt_no", "N/A");
// general purpose identifiers
- public static final String SECURITY_WARNING_ID = "general_warning";
- public static final String OCSP_WARNING_ID = "ocsp_warning";
+ public static final Id SECURITY_WARNING_ID = new Id("general_warning", "N/A");
+ public static final Id OCSP_WARNING_ID = new Id("ocsp_warning", "N/A");
+
+ // Localised resources
+ private static final String AVKON_LOC_FILE = "javausermessages";
+ private static final String AVKON_PREFIX = "qtn_java_secur_";
+ private static final String QT_LOC_FILE = "N/A";
+ private static final String QT_PREFIX = "";
/**
* Creates an instance of the SecurityPromptMessage
@@ -121,12 +128,13 @@
* @return the localized text associated with the provided
* identifier and parameters
*/
- public String getText(String aTextId, Object[] aTextParams)
+ public String getText(Id aTextId, Object[] aTextParams)
{
if (iRes == null)
{
- iRes = ResourceLoader.getInstance("javausermessages", "qtn_java_secur_");
+ iRes = ResourceLoader.getInstance(AVKON_LOC_FILE, AVKON_PREFIX, QT_LOC_FILE, QT_PREFIX);
}
+
return iRes.format(aTextId, aTextParams);
}
}
--- a/javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javaunicertstoreplugin/build/javaunicertstoreplugin.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -33,8 +33,6 @@
// Use bytepair compression to enable code paging
PAGED
-systeminclude /epoc32/include/ecom
-
userinclude ../../../../inc
sourcepath ../src.s60
--- a/javacommons/security/javaunicertstoreplugin/src.s60/200213A3.rss Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javaunicertstoreplugin/src.s60/200213A3.rss Thu Aug 19 09:48:13 2010 +0300
@@ -18,7 +18,7 @@
// INCLUDES
-#include <registryinfov2.rh>
+#include <ecom/registryinfov2.rh>
#include <ct/interfaceuid.hrh>
// Some defines of useful values for attributes to simplify
--- a/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -75,7 +75,6 @@
Cancel();
}
- mComms.unregisterListener(PLUGIN_ID_JAVA_CERT_STORE_ECOM_C,this);
mComms.unregisterDefaultListener(this);
mComms.disconnect();
mCertsData.ResetAndDestroy();
@@ -176,7 +175,7 @@
case EPreDeleting:
SendDeleteMsg(status);
return;
-
+
default:
//Do nothing.
break;
@@ -251,7 +250,7 @@
User::RequestComplete(pRequestStatus,KErrArgument);
return;
}
-
+
mState = EPreDeleting;
mTempCertData = certData;
HandleDeleteDisableQuery(aStatus, false /* disableCertQuery */);
@@ -388,7 +387,7 @@
TBool validRequest = validateCertAttrFilter(aFilter);
if (!validRequest)
{
- ELOG(EJavaSecurity,"No certificates matching the filter supplied");
+ LOG(EJavaSecurity, EInfo, "No certificates matching the filter supplied");
User::RequestComplete(pRequestStatus,KErrNone);
return;
}
@@ -490,12 +489,13 @@
return;
}
+ TInt err = KErrNone;
if (!certData->mIsDisabled)
{
- aApplications.Append(KMidletInstallApplicabilityUid);
+ err = aApplications.Append(KMidletInstallApplicabilityUid);
}
- User::RequestComplete(pRequestStatus,KErrNone);
+ User::RequestComplete(pRequestStatus, err);
}
/**
@@ -836,7 +836,7 @@
User::RequestComplete(aRequestStatus,KErrCommsBreak);
return EFalse;
}
-
+
return ETrue;
}
@@ -972,7 +972,7 @@
//operation in the error situation.
return;
}
- aCertDataObj.mDeleted = ETrue;
+ aCertDataObj.mDeleted = ETrue;
User::RequestComplete(aRequestStatus,KErrNone);
}
--- a/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/javaunicertstoreplugin/src.s60/javacertstoreimpl.h Thu Aug 19 09:48:13 2010 +0300
@@ -68,8 +68,7 @@
};
class CJavaCertStoreImpl: public CActive, public MCTWritableCertStore,
- public java::comms::CommsListener,
- public java::comms::CommsClientEndpoint
+ public java::comms::CommsListener
{
public:
--- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/build/MIDP2SecurityPolicyV2Dll.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/build/MIDP2SecurityPolicyV2Dll.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -21,8 +21,10 @@
@SYMPurpose MIDP2SecurityPolicyV2.dll Java security policy interface implementation
*/
+#include <platform_paths.hrh>
+#include <../../../../../../../inc/project_defines.hrh>
-#include <../../../../../../../inc/project_defines.hrh>
+APP_LAYER_SYSTEMINCLUDE
target MIDP2SecurityPolicyV2.dll
targettype dll
@@ -42,10 +44,6 @@
deffile ./midp2secrp/eabi/MIDP2SecurityPolicyV2.def
#endif
-systeminclude /epoc32/include
-systeminclude /epoc32/include/libc
-
-systeminclude ../../../../../../../inc
userinclude ../export
userinclude ../../../../../../../inc
--- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -61,9 +61,9 @@
}
-void CBlanketPermissionPolicy::Add(const CBlanketPermissionPolicyElement *aElement)
+void CBlanketPermissionPolicy::AddL(const CBlanketPermissionPolicyElement *aElement)
{
- iPolicyElements.Append(aElement);
+ iPolicyElements.AppendL(aElement);
}
--- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/BlanketPermissionPolicy.h Thu Aug 19 09:48:13 2010 +0300
@@ -49,7 +49,7 @@
static CBlanketPermissionPolicy* NewL();
- void Add(const CBlanketPermissionPolicyElement *);
+ void AddL(const CBlanketPermissionPolicyElement *);
// MBlanketPermissionPolicy
virtual TInt GetPolicyElementCount() const ;
--- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/SimpleMapping.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/SimpleMapping.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -61,7 +61,7 @@
for (TInt i = 0; i < count; i++)
{
- iMapping.Append(aMapping[i]);
+ iMapping.AppendL(aMapping[i]);
}
}
--- a/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/XPFParser.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/legacysupport/midp2securitypolicyv2/plugins/securitypolicyV2/src/XPFParser.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -385,8 +385,8 @@
//Add the sets and permission downgrade policy to the
//CBlanketPermissionPolicy object for this domain
+ aBlanketPermissionPolicy->AddL(pe);
CleanupStack::Pop(pe);
- aBlanketPermissionPolicy->Add(pe);
DEBUG("CXPFParser::ExclusionSetL() - Exit");
}
--- a/javacommons/security/legacysupport/midp2userpreferences/build/midp2userpreferences.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/legacysupport/midp2userpreferences/build/midp2userpreferences.pro Thu Aug 19 09:48:13 2010 +0300
@@ -19,11 +19,7 @@
CONFIG += omj stl
CONFIG -= qt
-INCLUDEPATH += /epoc32/include/j2me/midp2/data \
- ../../../../../inc/j2me/midp2/security \
- ../../../../../inc/j2me/midp2/runtime \
- ../../../../../inc/j2me/midp2/dbv2 \
- ../../storageutils/inc
+INCLUDEPATH += ../../storageutils/inc
SOURCES += ../../storageutils/src/*.cpp \
../src/*.cpp
--- a/javacommons/security/legacysupport/midp2userpreferences/src/MIDP2UserPreferences.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/legacysupport/midp2userpreferences/src/MIDP2UserPreferences.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -22,8 +22,8 @@
#include "UserPreferencesIterator.h"
#include "MIDletSuiteUserPreferences.h"
#include "MIDletSuiteCustomAttributes.h"
-#include <MUserSecurityPreferencesTable.h>
-#include <MSecurityPolicyV2.h>
+#include "MUserSecurityPreferencesTable.h"
+#include "j2me/midp2/security/MSecurityPolicyV2.h"
#include "SecurityPreferences.h"
#include "javauid.h"
--- a/javacommons/security/legacysupport/tsrc/build/securitylegacysupportunittests.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/legacysupport/tsrc/build/securitylegacysupportunittests.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -22,11 +22,6 @@
#include <../../../../../inc/java_stdcpp_support_for_exe.hrh>
#include <platform_paths.hrh>
-SYSTEMINCLUDE /epoc32/include
-SYSTEMINCLUDE ../../../../../inc/j2me/midp2/security
-SYSTEMINCLUDE ../../../../../inc/j2me/midp2/data
-SYSTEMINCLUDE ../../../../../inc/j2me/midp2/runtime
-
USERINCLUDE ../../../../../tools/cpputest/include/cpputest
USERINCLUDE ../../../../../tools/cpputest/include/platforms/symbian
USERINCLUDE ../../../../../inc
--- a/javacommons/security/legacysupport/tsrc/src/testpermissiondb.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/legacysupport/tsrc/src/testpermissiondb.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -23,7 +23,7 @@
#include "javastoragenames.h"
#include "javauid.h"
-#include <midp2permissiondb.h>
+#include "j2me/midp2/security/midp2permissiondb.h"
using namespace MIDP;
using namespace java::storage;
--- a/javacommons/security/legacysupport/tsrc/src/testsecuritypolicy.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/legacysupport/tsrc/src/testsecuritypolicy.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -20,7 +20,7 @@
#include "TestHarness.h"
-#include <msecuritypolicyv2.h>
+#include "j2me/midp2/security/msecuritypolicyv2.h"
using namespace MIDP;
--- a/javacommons/security/legacysupport/tsrc/src/testuserpreferences.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/legacysupport/tsrc/src/testuserpreferences.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -25,11 +25,11 @@
#include "javauid.h"
#include "javasymbianoslayer.h"
-#include <muserpreferences.h>
-#include <mmidletsuiteuserpreferencesiterator.h>
-#include <mmidletsuiteuserpreferences.h>
-#include <mmidletsuitecustomattributes.h>
-#include <msecuritypolicyv2.h>
+#include "j2me/midp2/data/muserpreferences.h"
+#include "j2me/midp2/data/mmidletsuiteuserpreferencesiterator.h"
+#include "j2me/midp2/data/mmidletsuiteuserpreferences.h"
+#include "j2me/midp2/data/mmidletsuitecustomattributes.h"
+#include "j2me/midp2/security/msecuritypolicyv2.h"
using namespace MIDP;
using namespace java::storage;
--- a/javacommons/security/src.s60/fileutils.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/src.s60/fileutils.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -65,7 +65,7 @@
if (err == KErrNone)
{
// figure out the size of the file
- TInt size;
+ TInt size = 0;
if (drmContent)
{
TRAP(err, cafData->DataSizeL(size));
--- a/javacommons/security/src.s60/telutils.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/src.s60/telutils.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -76,6 +76,19 @@
return sec.Int();
}
+/**
+ * Return 0 if secure time has not been set
+ */
+int TelUtils::isSecureTimeSet()
+{
+ TTime t;
+ if (KErrNoSecureTime == t.UniversalTimeSecure())
+ {
+ return 0;
+ }
+ return 1;
+}
+
void TelUtils::ConstructL()
{
RMobilePhone::TMobilePhoneIdentityV1 phoneId;
--- a/javacommons/security/src.s60/telutils.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/src.s60/telutils.h Thu Aug 19 09:48:13 2010 +0300
@@ -36,6 +36,7 @@
void getNetworkCodes(std::string& mnc, std::string& mcc);
void getImei(std::string& imei);
static signed int getSecureTime();
+ static int isSecureTimeSet();
virtual ~TelUtils();
private: //Methods
--- a/javacommons/security/src/midpauthenticationmoduleimpl.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/src/midpauthenticationmoduleimpl.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-
+#include "javacommonutils.h"
#include "javajniutils.h"
#include "com_nokia_mj_impl_security_midp_authentication_AuthenticationModule.h"
#include "midpauthenticationmodule.h"
@@ -40,6 +40,7 @@
#include <openssl/rsa.h>
#include <openssl/sha.h>
#include <string.h>
+#include <errno.h>
using namespace java::security;
using namespace java::storage;
@@ -252,6 +253,13 @@
jar_hash_value = NULL;
return hash;
}
+ else
+ {
+ if (errno == ENOENT)
+ {
+ SecurityUtils::throw_exception(env, "JAR_NOT_FOUND");
+ }
+ }
return NULL;
}
@@ -464,7 +472,22 @@
if (X509_verify_cert(x509_ctx) != 1)
{
ret_code = getErrCode(X509_STORE_CTX_get_error(x509_ctx));
- break;
+ // If the secure time of the device has not yet been set
+ // to correct value (This can happen some times during
+ // the first device boot),
+ // allow installing with not yet valid certificates
+ if (KCertNotYetValidFailure == ret_code)
+ {
+ if (JavaCommonUtils::isFirstBoot())
+ {
+ ret_code = KCertAndSignatureOk;
+ }
+ }
+
+ if (KCertAndSignatureOk != ret_code)
+ {
+ break;
+ }
}
// verify the extended key usage: it must point to id-kp-codeSigning (RFC3280 code signing)
// or 1.3.6.1.4.1.94.1.49.1.2.2.3 (Nokia Java Code Signing Extension)
--- a/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationModuleTests.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/security/tsrc/javasrc/com/nokia/mj/impl/security/midp/authentication/AuthenticationModuleTests.java Thu Aug 19 09:48:13 2010 +0300
@@ -1046,8 +1046,8 @@
}
catch (RuntimeSecurityException e)
{
- assertTrue(e.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.JAR_TAMPERED, null))
- && e.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.JAR_TAMPERED, null)));
+ assertTrue(e.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.JAR_NOT_FOUND, null))
+ && e.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.JAR_NOT_FOUND, null)));
}
// root not enabled
try
@@ -1105,7 +1105,7 @@
appUID.getStringValue()));
entry.addAttribute(new StorageAttribute(
StorageNames.NAME,
- "MIDlet-Operator-Allowed"));
+ "Nokia-MIDlet-Operator-Allowed"));
entry.addAttribute(new StorageAttribute(
StorageNames.VALUE,
"123-45 456-789 000-000"));
@@ -1126,7 +1126,7 @@
appUID.getStringValue()));
entry.addAttribute(new StorageAttribute(
StorageNames.NAME,
- "MIDlet-Operator-Allowed"));
+ "Nokia-MIDlet-Operator-Allowed"));
entry.addAttribute(new StorageAttribute(
StorageNames.VALUE,
"123-45"));
@@ -1147,7 +1147,7 @@
appUID.getStringValue()));
entry.addAttribute(new StorageAttribute(
StorageNames.NAME,
- "MIDlet-Operator-Allowed"));
+ "Nokia-MIDlet-Operator-Allowed"));
entry.addAttribute(new StorageAttribute(
StorageNames.VALUE,
"123-45"));
--- a/javacommons/utils/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -30,6 +30,7 @@
com.nokia.mj.impl.properties.common.Locale,
com.nokia.mj.impl.properties.common.Platform,
com.nokia.mj.impl.utils.Formatter,
+ com.nokia.mj.impl.utils.InstallerErrorMessage,
com.nokia.mj.impl.utils.ResourceLoader"/>
<target name="system.properties">
--- a/javacommons/utils/build/bwins/javautilsu.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/build/bwins/javautilsu.def Thu Aug 19 09:48:13 2010 +0300
@@ -128,4 +128,7 @@
??_ERuntimeException@runtime@java@@UAE@I@Z @ 127 NONAME ; java::runtime::RuntimeException::~RuntimeException(unsigned int)
??1RuntimeException@runtime@java@@UAE@XZ @ 128 NONAME ; java::runtime::RuntimeException::~RuntimeException(void)
?toString@RuntimeException@runtime@java@@UBE?AV?$basic_string@DV?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ @ 129 NONAME ; class std::basic_string<char, class std::char_traits<char>, class std::allocator<char> > java::runtime::RuntimeException::toString(void) const
+ ?wbase64encode@JavaCommonUtils@util@java@@SA?AV?$basic_string@_WV?$char_traits@_W@std@@V?$allocator@_W@2@@std@@ABV45@@Z @ 130 NONAME ; class std::basic_string<wchar_t, class std::char_traits<wchar_t>, class std::allocator<wchar_t> > java::util::JavaCommonUtils::wbase64encode(class std::basic_string<wchar_t, class std::char_traits<wchar_t>, class std::allocator<wchar_t> > const &)
+ ?isFirstBoot@JavaCommonUtils@util@java@@SA_NXZ @ 131 NONAME ; bool java::util::JavaCommonUtils::isFirstBoot(void)
+ ?initIsFirstBoot@JavaCommonUtils@util@java@@SAHXZ @ 132 NONAME ; int java::util::JavaCommonUtils::initIsFirstBoot(void)
--- a/javacommons/utils/build/eabi/javautilsu.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/build/eabi/javautilsu.def Thu Aug 19 09:48:13 2010 +0300
@@ -178,5 +178,7 @@
_ZNK4java7runtime16RuntimeException8toStringEv @ 177 NONAME
_ZTIN4java7runtime16RuntimeExceptionE @ 178 NONAME
_ZTVN4java7runtime16RuntimeExceptionE @ 179 NONAME
-
-
+ _ZN4java4util15JavaCommonUtils13wbase64encodeERKSbIwSt11char_traitsIwESaIwEE @ 180 NONAME
+ _ZN4java4util15JavaCommonUtils11isFirstBootEv @ 181 NONAME
+ _ZN4java4util15JavaCommonUtils15initIsFirstBootEv @ 182 NONAME
+
--- a/javacommons/utils/build/javautils_0x2002DCDA.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/build/javautils_0x2002DCDA.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javautils.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javacommons/utils/inc.s60/java_stdcpp_support_for_dll.hrh Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/inc.s60/java_stdcpp_support_for_dll.hrh Thu Aug 19 09:48:13 2010 +0300
@@ -49,9 +49,6 @@
macro J9EPOC32
#define J9EPOC32
-macro RD_JAVA_OMJ_FSERVER
-#define RD_JAVA_OMJ_FSERVER
-
#include "build_defines.hrh"
#ifdef RD_JAVA_STDCPPV5
--- a/javacommons/utils/inc/javacommonutils.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/inc/javacommonutils.h Thu Aug 19 09:48:13 2010 +0300
@@ -87,6 +87,23 @@
OS_IMPORT static std::string base64encode(const std::string& aData);
/**
+ * Encode wstring to base64 wstring byte by byte.
+ *
+ * wstring aData is base64 encoded as a byte array.
+ * If the wstring has been created from TDesC16 in Symbian it contains
+ * UTF-16LE (UCS-2) encoded 16-bit characters.
+ * The result is byte array that contains 8-bit ASCII characters.
+ * Each of these 8-bit character is converted to the corresponding
+ * wchar and appended to the result wstring.
+ *
+ * @see \sf\app\jrt\javamanager\javainstaller\installer\javasrc\com\nokia
+ * \mj\impl\installer\utils\Args.java, decodeBase64Args()
+ * @param aData wstring containing the data to be encoded.
+ * @return base64 encoded result wstring.
+ */
+ OS_IMPORT static std::wstring wbase64encode(const std::wstring& aData);
+
+ /**
* Decode base64 string.
*
* @param aData base64 encoded string.
@@ -105,6 +122,33 @@
*/
OS_IMPORT static std::wstring percentDecode(const std::wstring& str);
+ /**
+ * This function checks whether is it called during the first device boot
+ * and stores the information to static data so that isFirstBoot() can
+ * return it.
+ *
+ * Call this function always when the process is starting.
+ *
+ * This function creates a flag file to the private data cage / work directory
+ * of the process.
+ *
+ * In Symbian this method can be called only from Java Installer or
+ * Java MIDP processes.
+ *
+ * Return 0 if check was made successfully. Otherwise it returns errno
+ * defined in STDLIBS errno.h
+ */
+ OS_IMPORT static int initIsFirstBoot();
+
+ /**
+ * This function returns true if it called during the first boot.
+ * Otherwise it returns false.
+ *
+ * initIsFirstBoot() must be called before this function can be called.
+ */
+ OS_IMPORT static bool isFirstBoot();
+
+
public:
/**
* Decodes one %<X><Y> sequence.
@@ -114,6 +158,10 @@
* @throws ExceptionBase if <X> and <Y> are not hexadecimal characters
*/
static char decodeOnePercentSeq(wchar_t first, wchar_t sec);
+
+private:
+ static bool mFirstBoot;
+
};
// A simple class for storing char array that is deleted automatically
--- a/javacommons/utils/inc/javaoslayer.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/inc/javaoslayer.h Thu Aug 19 09:48:13 2010 +0300
@@ -33,6 +33,7 @@
const int BOOT_CLASSPATH_MIDP = 1;
const int BOOT_CLASSPATH_INSTALLER = 2;
const int BOOT_CLASSPATH_TCKRUNNER = 3;
+const int BOOT_CLASSPATH_JAVACONTROLPANEL = 4;
class DriveId;
--- a/javacommons/utils/inc/logger.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/inc/logger.h Thu Aug 19 09:48:13 2010 +0300
@@ -115,7 +115,9 @@
EDebugApi, // =34
EJavaAppMngrPlugin, // =35
EJavaBroadcast, // =36
- EJavaAMMS, // =37
+ EJavaAMMS, // =37
+ EJavaSettings, // =38
+ EJavaQtServiceApp, // =39
// add id of new components here
};
@@ -172,7 +174,9 @@
{"JavaDebugApi.log", "[JavaDebugApi]"}, // EDebugApi
{"JavaAppMngrPlugin.log","[JavaAppMngrPlugin]"}, // EJavaAppMngrPlugin
{"JavaBroadcast.log", "[JavaBroadcast]"}, // EJavaBroadcast
- {"JavaMMAPI.log", "[ MMAPPI ]"}, // EJavaAMMS
+ {"JavaMMAPI.log", "[ MMAPPI ]"}, // EJavaAMMS
+ {"JavaSettings.log", "[ JavaSettings ]"}, // EJavaSettings
+ {"JavaQtServiceApp.log", "[ QtServiceApp ]"}, // EJavaQtServiceApp
// add new component file name and nickname here
};
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/rt/support/ApplicationUtils.java Thu Aug 19 09:48:13 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"
@@ -162,11 +162,14 @@
* <p>
* This method is meant ONLY for the UI and no other API are allowed
* to use it. The UI must use this API ONLY when the user explicitly
- * wants to close the application using some platform depedent feataure
+ * wants to close the application using some platform dependent feature
* (e.g. red key in S60). If the user tries to close the application
* using the mechanism provided by the application itself, this method
* must not be called.
* <p>
+ * Note that calling this method might cause the UI framework to call
+ * uiDisposed method, depending on which UI framework is used.
+ * <p>
* This method is a problematic in such runtimes that may run more than one
* application in same JVM instance (e.g. eRCP). If the application
* doesn't close nicely the runtime may have to terminate
@@ -177,6 +180,23 @@
public abstract void notifyExitCmd();
/**
+ * Notifies the runtime that UI has been disposed. The runtime is
+ * responsible for killing the application if it doesn't close itself
+ * nicely after specified grace time. The specified grace time is
+ * runtime dependent.
+ * <p>
+ * This method is meant ONLY for the UI and no other API are allowed
+ * to use it.
+ * <p>
+ * It is possible that the method is called several times from different
+ * phases of the UI exit sequence.
+ */
+ public void uiDisposed()
+ {
+ notifyExitCmd();
+ }
+
+ /**
* Determines whether the access request indicated by the specified
* permission should be allowed or denied, based on the security policy
* currently in effect. This method quietly returns if the access request
@@ -221,7 +241,7 @@
* @param listener the new listener.
*/
public void addShutdownListener(ShutdownListener listener)
-{
+ {
if (mListeners == null)
{
mListeners = new Vector();
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ErrorMessageBase.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ErrorMessageBase.java Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -24,8 +24,6 @@
/**
* Base class for classes defining localized error messages.
*
- * @author Nokia Corporation
- * @version 1.0
* @see InstallerExceptionBase
*/
abstract public class ErrorMessageBase
@@ -34,6 +32,19 @@
public static final int NO_MSG = 0; // Used when the error message is not available.
+ /** Start of Runtime error message ids range. */
+ public static final int RUNTIME_RANGE_START = 0;
+ /** End of Runtime error message ids range. */
+ public static final int RUNTIME_RANGE_END = 99;
+ /** Start of Installer error message ids range. */
+ public static final int INSTALLER_RANGE_START = 100;
+ /** End of Installer error message ids range. */
+ public static final int INSTALLER_RANGE_END = 199;
+ /** Start of Security error message ids range. */
+ public static final int SECURITY_RANGE_START = 200;
+ /** End of Security error message ids range. */
+ public static final int SECURITY_RANGE_END = 299;
+
/**
* Method for retrieving the message of a certain error.
*
@@ -51,7 +62,12 @@
{
return this.getClass().getName() + ": No message found for error " + errorCode;
}
- return getResourceLoader().format(msgId, errorMessageParameters);
+ ResourceLoader rl = getResourceLoader();
+ if (rl == null)
+ {
+ rl = getResourceLoader(errorCode);
+ }
+ return rl.format(msgId, errorMessageParameters);
}
/*** ---------------------------- PROTECTED --------------------------- */
@@ -65,11 +81,64 @@
/**
* Method for retrieving the ResourceLoader instance that is used
- * to localise error messages.
+ * to localise error messages. If this method returns null,
+ * the ResourceLoader is obtained with getResourceLoader(int)
+ * method variant which then must not return null.
+ *
* This method must be overriden in inheriting class.
*/
abstract protected ResourceLoader getResourceLoader();
+ /**
+ * Method for retrieving the ResourceLoader instance that is used
+ * to localise error message for specified error code.
+ * This method must be overriden in inheriting class if
+ * the getResourceLoader() method variant returns null.
+ *
+ * @param errorCode error code for which ResourceLoader is returned
+ */
+ protected ResourceLoader getResourceLoader(int errorCode)
+ {
+ return null;
+ }
+
+ /**
+ * Method for retrieving the ResourceLoader instance.
+ * This method is called from inheriting class
+ * getResourceLoader(int) method variant.
+ *
+ * @param textFilename name for text file
+ * @param textPrefix prefix for text ids
+ */
+ private static Hashtable iResourceLoaderTable = null;
+ protected static ResourceLoader getResourceLoader(String textFilename, String textPrefix)
+ {
+ String key = textFilename + "::" + textPrefix;
+ if (iResourceLoaderTable == null)
+ {
+ iResourceLoaderTable = new Hashtable();
+ }
+ ResourceLoader rl = (ResourceLoader)iResourceLoaderTable.get(key);
+ if (rl == null)
+ {
+ rl = ResourceLoader.getInstance(textFilename, textPrefix);
+ iResourceLoaderTable.put(key, rl);
+ }
+ return rl;
+ }
+
+ /**
+ * Gets the Qt locale ID currently being used on the phone.
+ *
+ * @return Qt locale ID as provided by the platform
+ */
+ protected static String getLocaleIdQt()
+ {
+ // Change this after Qt localisation files are taken into use.
+ //return ResourceLoader.getLocaleIdQt();
+ return null;
+ }
+
/*** ----------------------------- PACKAGE ---------------------------- */
/*** ----------------------------- PRIVATE ---------------------------- */
/*** ----------------------------- NATIVE ----------------------------- */
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Formatter.java Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -28,6 +28,7 @@
* <UL>
* <LI>%nU - String in position n
* <LI>%U - Next string
+ * <LI>%Ln - Integer in position n
* <LI>%nN - Integer in position n
* <LI>%N - Next integer
* <LI>%nC - Character in position n
@@ -60,7 +61,7 @@
private String replaced;
/** Next replacement index */
- private int nextIndex = 0;
+ private int nextIndex = (ResourceLoader.getLocaleIdQt() == null? 0: 1);
/*** ----------------------------- PUBLIC ------------------------------ */
@@ -69,7 +70,7 @@
*
* @param pattern formatter pattern
*/
- public Formatter(String aPattern)
+ Formatter(String aPattern)
{
pattern = aPattern;
replaced = aPattern;
@@ -90,11 +91,12 @@
replace("%U", string))
{
nextIndex++;
-
}
else
{
- Logger.WLOG(Logger.EUtils, "String replacement failed");
+ Logger.WLOG(Logger.EUtils,
+ "String replacement failed on parameter " +
+ nextIndex + ": " + pattern);
}
return this;
}
@@ -110,8 +112,9 @@
{
String localisedNumber = _formatInteger(number);
- // Try to replace with patterns %nN, %n, %N
- if (replace("%" + nextIndex + "N", localisedNumber) ||
+ // Try to replace with patterns %Ln, %nN, %n, %N
+ if (replace("%" + "L" + nextIndex, localisedNumber) ||
+ replace("%" + nextIndex + "N", localisedNumber) ||
replace("%" + nextIndex, localisedNumber) ||
replace("%N", localisedNumber))
{
@@ -120,7 +123,9 @@
}
else
{
- Logger.WLOG(Logger.EUtils, "Integer replacement failed");
+ Logger.WLOG(Logger.EUtils,
+ "Integer replacement failed on parameter " +
+ nextIndex + ": " + pattern);
}
return this;
}
@@ -146,7 +151,9 @@
}
else
{
- Logger.WLOG(Logger.EUtils, "Character replacement failed");
+ Logger.WLOG(Logger.EUtils,
+ "Character replacement failed on parameter " +
+ nextIndex + ": " + pattern);
}
return this;
}
@@ -208,7 +215,7 @@
// Reset for next usage
replaced = pattern;
- nextIndex = 0;
+ nextIndex = (ResourceLoader.getLocaleIdQt() == null? 0: 1);
return result;
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Id.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.mj.impl.utils;
+
+/**
+ * Localisation Identifier. This class is used to hide platform localisation
+ * specifics.
+ */
+public class Id
+{
+ private String iAvkonLocString = null;
+ private String iQtLocString = null;
+
+ /**
+ * Default constructor.
+ */
+ private Id()
+ {
+ }
+
+ public Id(String aAvkonLocString, String aQtLocString)
+ {
+ this.iAvkonLocString = aAvkonLocString;
+ this.iQtLocString = aQtLocString;
+ }
+
+ public String getString(int aPlatform)
+ {
+ if (aPlatform == ResourceLoader.QT)
+ {
+ return iQtLocString;
+ }
+ else
+ {
+ return iAvkonLocString;
+ }
+ }
+}
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerDetailedErrorMessage.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerDetailedErrorMessage.java Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -22,9 +22,6 @@
/**
* Class defining Installer detailed error messages.
- *
- * @author Nokia Corporation
- * @version 1.0
*/
public final class InstallerDetailedErrorMessage extends ErrorMessageBase
{
@@ -42,6 +39,8 @@
public static final int UNINST_BLOCKED = 11;
public static final int INTERNAL_ERROR = 12;
public static final int NO_MEM_MB = 13;
+ public static final int INST_CANCEL = 14;
+ public static final int UNINST_CANCEL = 15;
/*** ----------------------------- PUBLIC ------------------------------ */
/*** ---------------------------- PROTECTED --------------------------- */
@@ -58,19 +57,42 @@
return iMessageTable;
}
Hashtable messageTable = new Hashtable();
- messageTable.put(new Integer(NO_MEM), "no_mem_detail");
- messageTable.put(new Integer(NO_MEM_MB), "no_mem_detail_mb");
- messageTable.put(new Integer(NO_NET), "no_net_detail");
- messageTable.put(new Integer(ATTR_BAD_SYNTAX), "attr_bad_syntax");
- messageTable.put(new Integer(ATTR_MISSING), "attr_missing");
- messageTable.put(new Integer(ATTR_MISMATCH), "attr_mismatch");
- messageTable.put(new Integer(ATTR_UNSUPPORTED), "attr_unsupported_value");
- messageTable.put(new Integer(ATTR_HANDLING_FAILED), "attr_handling_failed");
- messageTable.put(new Integer(CERT_UNSUPPORTED), "cert_unsupported");
- messageTable.put(new Integer(PROT_PKG_MISUSE), "protected_pkg_misuse");
- messageTable.put(new Integer(DIFFERENT_SIGNERS), "different_signers");
- messageTable.put(new Integer(UNINST_BLOCKED), "uninst_blocked");
- messageTable.put(new Integer(INTERNAL_ERROR), "internal");
+ if (getLocaleIdQt() == null)
+ {
+ messageTable.put(new Integer(NO_MEM), "no_mem_detail");
+ messageTable.put(new Integer(NO_MEM_MB), "no_mem_detail_mb");
+ messageTable.put(new Integer(NO_NET), "no_net_detail");
+ messageTable.put(new Integer(ATTR_BAD_SYNTAX), "attr_bad_syntax");
+ messageTable.put(new Integer(ATTR_MISSING), "attr_missing");
+ messageTable.put(new Integer(ATTR_MISMATCH), "attr_mismatch");
+ messageTable.put(new Integer(ATTR_UNSUPPORTED), "attr_unsupported_value");
+ messageTable.put(new Integer(ATTR_HANDLING_FAILED), "attr_handling_failed");
+ messageTable.put(new Integer(CERT_UNSUPPORTED), "cert_unsupported");
+ messageTable.put(new Integer(PROT_PKG_MISUSE), "protected_pkg_misuse");
+ messageTable.put(new Integer(DIFFERENT_SIGNERS), "different_signers");
+ messageTable.put(new Integer(UNINST_BLOCKED), "uninst_blocked");
+ messageTable.put(new Integer(INTERNAL_ERROR), "internal");
+ messageTable.put(new Integer(INST_CANCEL), "Installation cancelled.");
+ messageTable.put(new Integer(UNINST_CANCEL), "Uninstallation cancelled.");
+ }
+ else
+ {
+ messageTable.put(new Integer(NO_MEM), "error_no_mem_detail");
+ messageTable.put(new Integer(NO_MEM_MB), "error_no_mem_detail_mb");
+ messageTable.put(new Integer(NO_NET), "error_no_net_detail");
+ messageTable.put(new Integer(ATTR_BAD_SYNTAX), "error_bad_syntax");
+ messageTable.put(new Integer(ATTR_MISSING), "error_attr_missing");
+ messageTable.put(new Integer(ATTR_MISMATCH), "error_attr_mismatch");
+ messageTable.put(new Integer(ATTR_UNSUPPORTED), "error_attr_unsupported_value");
+ messageTable.put(new Integer(ATTR_HANDLING_FAILED), "error_attr_handling_failed");
+ messageTable.put(new Integer(CERT_UNSUPPORTED), "error_cert_unsupported");
+ messageTable.put(new Integer(PROT_PKG_MISUSE), "error_pkg_misuse");
+ messageTable.put(new Integer(DIFFERENT_SIGNERS), "error_different_signers");
+ messageTable.put(new Integer(UNINST_BLOCKED), "uninst_blocked");
+ messageTable.put(new Integer(INTERNAL_ERROR), "internal_error");
+ messageTable.put(new Integer(INST_CANCEL), "error_cancel");
+ messageTable.put(new Integer(UNINST_CANCEL), "error_uninst_cancel");
+ }
iMessageTable = messageTable;
return iMessageTable;
}
@@ -84,7 +106,14 @@
{
if (iRes == null)
{
- iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_");
+ if (getLocaleIdQt() == null)
+ {
+ iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_");
+ }
+ else
+ {
+ iRes = ResourceLoader.getInstance("javaapplicationinstaller", "txt_java_inst_info_");
+ }
}
return iRes;
}
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerErrorMessage.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/InstallerErrorMessage.java Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -22,34 +22,31 @@
/**
* Class defining Installer short error messages.
- *
- * @author Nokia Corporation
- * @version 1.0
*/
public final class InstallerErrorMessage extends ErrorMessageBase
{
// Installation error codes.
- public static final int INST_NO_MEM = 1;
- public static final int INST_NO_NET = 2;
- public static final int INST_CORRUPT_PKG = 3;
- public static final int INST_COMPAT_ERR = 4;
- public static final int INST_AUTHORIZATION_ERR = 5;
- public static final int INST_AUTHENTICATION_ERR = 6;
- public static final int INST_PUSH_REG_ERR = 7;
- public static final int INST_UNEXPECTED_ERR = 8;
- public static final int INST_CANCEL = 9;
+ public static final int INST_NO_MEM = 1 + ErrorMessageBase.INSTALLER_RANGE_START;
+ public static final int INST_NO_NET = 2 + ErrorMessageBase.INSTALLER_RANGE_START;
+ public static final int INST_CORRUPT_PKG = 3 + ErrorMessageBase.INSTALLER_RANGE_START;
+ public static final int INST_COMPAT_ERR = 4 + ErrorMessageBase.INSTALLER_RANGE_START;
+ public static final int INST_AUTHORIZATION_ERR = 5 + ErrorMessageBase.INSTALLER_RANGE_START;
+ public static final int INST_AUTHENTICATION_ERR = 6 + ErrorMessageBase.INSTALLER_RANGE_START;
+ public static final int INST_PUSH_REG_ERR = 7 + ErrorMessageBase.INSTALLER_RANGE_START;
+ public static final int INST_UNEXPECTED_ERR = 8 + ErrorMessageBase.INSTALLER_RANGE_START;
+ public static final int INST_CANCEL = 9 + ErrorMessageBase.INSTALLER_RANGE_START;
// Uninstallation error codes.
- public static final int UNINST_NOT_ALLOWED = 101;
- public static final int UNINST_UNEXPECTED_ERR = 102;
- public static final int UNINST_CANCEL = 103;
+ public static final int UNINST_NOT_ALLOWED = 10 + ErrorMessageBase.INSTALLER_RANGE_START;
+ public static final int UNINST_UNEXPECTED_ERR = 11 + ErrorMessageBase.INSTALLER_RANGE_START;
+ public static final int UNINST_CANCEL = 12 + ErrorMessageBase.INSTALLER_RANGE_START;
/**
* Error codes for other than install and uninstall operations.
* Do not use these error codes in installation or uninstallation.
* These are only used in installer "list" and "test" commands.
*/
- public static final int OTHER_UNEXPECTED_ERR = 201;
+ public static final int OTHER_UNEXPECTED_ERR = 13 + ErrorMessageBase.INSTALLER_RANGE_START;
/*** ----------------------------- PUBLIC ------------------------------ */
/*** ---------------------------- PROTECTED --------------------------- */
@@ -66,19 +63,38 @@
return iMessageTable;
}
Hashtable messageTable = new Hashtable();
- messageTable.put(new Integer(INST_NO_MEM), "no_mem");
- messageTable.put(new Integer(INST_NO_NET), "no_net");
- messageTable.put(new Integer(INST_CORRUPT_PKG), "corrupt_pkg");
- messageTable.put(new Integer(INST_COMPAT_ERR), "compat_err");
- messageTable.put(new Integer(INST_AUTHORIZATION_ERR), "authorization_err");
- messageTable.put(new Integer(INST_AUTHENTICATION_ERR), "authentication_err");
- messageTable.put(new Integer(INST_PUSH_REG_ERR), "push_reg_err");
- messageTable.put(new Integer(INST_UNEXPECTED_ERR), "unexpected");
- messageTable.put(new Integer(INST_CANCEL), "cancel");
- messageTable.put(new Integer(UNINST_NOT_ALLOWED), "uninst_not_allowed");
- messageTable.put(new Integer(UNINST_UNEXPECTED_ERR), "uninst_unexpected");
- messageTable.put(new Integer(UNINST_CANCEL), "uninst_cancel");
- messageTable.put(new Integer(OTHER_UNEXPECTED_ERR), "other_unexpected");
+ if (getLocaleIdQt() == null)
+ {
+ messageTable.put(new Integer(INST_NO_MEM), "no_mem");
+ messageTable.put(new Integer(INST_NO_NET), "no_net");
+ messageTable.put(new Integer(INST_CORRUPT_PKG), "corrupt_pkg");
+ messageTable.put(new Integer(INST_COMPAT_ERR), "compat_err");
+ messageTable.put(new Integer(INST_AUTHORIZATION_ERR), "authorization_err");
+ messageTable.put(new Integer(INST_AUTHENTICATION_ERR), "authentication_err");
+ messageTable.put(new Integer(INST_PUSH_REG_ERR), "push_reg_err");
+ messageTable.put(new Integer(INST_UNEXPECTED_ERR), "unexpected");
+ messageTable.put(new Integer(INST_CANCEL), "cancel");
+ messageTable.put(new Integer(UNINST_NOT_ALLOWED), "uninst_not_allowed");
+ messageTable.put(new Integer(UNINST_UNEXPECTED_ERR), "uninst_unexpected");
+ messageTable.put(new Integer(UNINST_CANCEL), "uninst_cancel");
+ messageTable.put(new Integer(OTHER_UNEXPECTED_ERR), "other_unexpected");
+ }
+ else
+ {
+ messageTable.put(new Integer(INST_NO_MEM), "info_there_is_not_enough_space_currently");
+ messageTable.put(new Integer(INST_NO_NET), "info_network_is_unavailable_currently");
+ messageTable.put(new Integer(INST_CORRUPT_PKG), "info_installation_package_is_invalid");
+ messageTable.put(new Integer(INST_COMPAT_ERR), "info_application_is_not_compatible_with");
+ messageTable.put(new Integer(INST_AUTHORIZATION_ERR), "info_there_is_a_security_issue_with_this");
+ messageTable.put(new Integer(INST_AUTHENTICATION_ERR), "info_there_is_a_security_issue_with_this");
+ messageTable.put(new Integer(INST_PUSH_REG_ERR), "info_an_unexpected_error_occurred");
+ messageTable.put(new Integer(INST_UNEXPECTED_ERR), "info_an_unexpected_error_occurred");
+ messageTable.put(new Integer(INST_CANCEL), "info_application_not_installed");
+ messageTable.put(new Integer(UNINST_NOT_ALLOWED), "info_application_cannot_be_deleted");
+ messageTable.put(new Integer(UNINST_UNEXPECTED_ERR), "installer_info_uninstallation_failed");
+ messageTable.put(new Integer(UNINST_CANCEL), "info_application_not_deleted");
+ messageTable.put(new Integer(OTHER_UNEXPECTED_ERR), "info_an_unexpected_error_occurred");
+ }
iMessageTable = messageTable;
return iMessageTable;
}
@@ -92,7 +108,14 @@
{
if (iRes == null)
{
- iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_");
+ if (getLocaleIdQt() == null)
+ {
+ iRes = ResourceLoader.getInstance("javainstallation", "qtn_java_inst_error_");
+ }
+ else
+ {
+ iRes = ResourceLoader.getInstance("common_errors", "txt_error_");
+ }
}
return iRes;
}
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/LocalizedTextProvider.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/LocalizedTextProvider.java Thu Aug 19 09:48:13 2010 +0300
@@ -28,5 +28,5 @@
* @return the text associated with the provided
* identifier and parameters
*/
- public abstract String getText(String aTextId, Object[] aTextParams);
+ public abstract String getText(Id aTextId, Object[] aTextParams);
}
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/Logger.java Thu Aug 19 09:48:13 2010 +0300
@@ -81,6 +81,7 @@
public static final int EJavaAppMngrPlugin = 35;
public static final int EJavaBroadcast = 36;
public static final int EJavaAMMS = 37;
+ public static final int EJavaSettings = 38;
// add name of new components here
@@ -138,6 +139,7 @@
false, //EJavaAppMngrPlugin = 35;
false, //EJavaBroadcast = 36;
false, //EJavaAMMS = 37;
+ false, //EJavaSettings = 38;
// add new components here
};
--- a/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/javasrc/com/nokia/mj/impl/utils/ResourceLoader.java Thu Aug 19 09:48:13 2010 +0300
@@ -40,6 +40,11 @@
*/
public class ResourceLoader
{
+ /** AVKON UI identifier. */
+ public static final int AVKON = 1;
+ /** QT UI identifier. */
+ public static final int QT = 2;
+
/** Localisation resource basepath */
private static final String LOC_RESOURCE_BASE = "/resources/com/nokia/mj/impl/";
@@ -50,10 +55,30 @@
private Hashtable resourceMap = new Hashtable();
/** Resource name prefix */
- private String prefix;
+ private String prefix = null;
+
+ /** Platform localisation type. */
+ private int locType = -1;
/*** ----------------------------- PUBLIC ------------------------------ */
+ public static ResourceLoader getInstance(String avkonFileName,
+ String avkonPrefix,
+ String qtFileName,
+ String qtPrefix)
+ {
+ // Avkon name prefix pair is used as key and this is same between platforms.
+ String key = avkonFileName + ":" + avkonPrefix;
+ ResourceLoader result = (ResourceLoader)resourceLoaders.get(key);
+
+ if (result == null)
+ {
+ result = new ResourceLoader(avkonFileName, avkonPrefix, qtFileName, qtPrefix);
+ resourceLoaders.put(key, result);
+ }
+ return result;
+ }
+
/**
* Returns a resource loader instance.
*
@@ -74,6 +99,46 @@
}
/**
+ * Private constructor. Loads localisation resource file.
+ * On Avkon UI it's resources are loaded. On Qt platfor it's
+ * resource is first read and if that fails Avkon one is read.
+ *
+ * @param avkonFileName Avkon localisation resource file.
+ * @param avkonPrefix Avkon logical string prefix.
+ * @param qtFileName Qt localisation resource file.
+ * @param qtPrefix Qt logical string prefix.
+ */
+ private ResourceLoader(String avkonFileName,
+ String avkonPrefix,
+ String qtFileName,
+ String qtPrefix)
+ {
+ String localeId = getLocaleIdQt();
+
+ if (localeId == null)
+ {
+ locType = AVKON;
+ prefix = avkonPrefix;
+ loadFile(avkonFileName, true);
+ }
+ else
+ {
+ if (!loadFile(qtFileName, false))
+ {
+ // Fallback to Avkon
+ locType = AVKON;
+ prefix = avkonPrefix;
+ loadFile(avkonFileName, true);
+ }
+ else
+ {
+ locType = QT;
+ prefix = qtPrefix;
+ }
+ }
+ }
+
+ /**
* Creates resource loader, using the current locale of the environment.
*
* @param resourceName name of the resource
@@ -82,7 +147,7 @@
public ResourceLoader(String resourceName, String aPrefix)
{
prefix = aPrefix;
- loadFile(resourceName);
+ loadFile(resourceName, true); // Avkon
}
/**
@@ -98,6 +163,59 @@
}
/**
+ * Get a string formatter of a given resource id.
+ *
+ * @param avkonId Avkon resource id.
+ * @param qtId Qt resource id.
+ * @return formatter instance
+ * @see Formatter
+ */
+ public Formatter format(String avkonId, String qtId)
+ {
+ if (locType == AVKON)
+ {
+ return new Formatter(string(avkonId));
+ }
+ else
+ {
+ return new Formatter(string(qtId));
+ }
+ }
+
+ /**
+ * Formats localised text with specified parameters from an array.
+ *
+ * @param avkonId Avkon resource id.
+ * @param qtId Qt resource id.
+ * @param textParameters parameters to be filled into the text.
+ * @return localised text formatted with the provided parameters.
+ * @see Formatter
+ */
+ public String format(String avkonId, String qtId, Object[] textParameters)
+ {
+ if (locType == AVKON)
+ {
+ return new Formatter(string(avkonId)).format(textParameters);
+ }
+ else
+ {
+ return new Formatter(string(qtId)).format(textParameters);
+ }
+ }
+
+ /**
+ * Get a string formatter of a given resource id.
+ *
+ * @param id resource id
+ * @return formatter instance
+ * @see Formatter
+ */
+ public Formatter format(Id id)
+ {
+ return new Formatter(id.getString(locType));
+ }
+
+ /**
* Formats localised text with specified parameters from an array.
*
* @param id resource id
@@ -111,6 +229,20 @@
}
/**
+ * Formats localised text with specified parameters from an array.
+ *
+ * @param id resource id
+ * @param textParameters parameters to be filled into the text
+ * @return localised text formatted with the provided parameters
+ * @see Formatter
+ */
+ public String format(Id id, Object[] textParameters)
+ {
+ return new Formatter(string(id.getString(locType))).format(textParameters);
+ }
+
+
+ /**
* Get a plain string resource with a given resource id.
*
* @param id resource id, either with prefix or without
@@ -172,35 +304,77 @@
return "sc";
}
+ /**
+ * Return locale id string on Qt platform.
+ *
+ * @return Qt Locale Id String, null if not in Qt.
+ */
+ public static String getLocaleIdQt()
+ {
+ return _getLocaleIdQt();
+ }
+
+
/*** ----------------------------- PRIVATE ---------------------------- */
/**
- * Loads the resources from .loc type file
+ * Loads the resources from .loc type file.
+ *
+ * @param resourceName name of the resource file.
+ * @param aIs InputStream pointing to resource. It will be closed after use.
+ * @param true if operation succeed.
*/
- private void loadFile(String resourceName)
+ private boolean loadFile(String resourceName, boolean avkon)
{
InputStream is = null;
- // Load with real locale id
- is = this.getClass().getResourceAsStream(
- LOC_RESOURCE_BASE + resourceName + "_" + getLocaleId() + ".loc");
- if (is == null)
+ if (!avkon) // Qt resources.
{
- // Load the engineering english
+ String langName = getLocaleIdQt();
+
+ // Emulator returns falsely en_GB as engineering English locale name.
+ if (langName.equals("en_GB"))
+ {
+ langName = "en";
+ }
+
+ // Load with real locale id
is = this.getClass().getResourceAsStream(
- LOC_RESOURCE_BASE + resourceName + "_sc" + ".loc");
+ LOC_RESOURCE_BASE + resourceName + "_" + langName + ".loc");
+
+ if (is == null)
+ {
+ /*
+ * Does not exist. No need to continue as avkon file cannot
+ * found using qt name.
+ */
+ return false;
+ }
}
- if (is == null)
+ else // Avkon resources.
{
- // Load the reference engineering english
+ // Load with real locale id
is = this.getClass().getResourceAsStream(
- LOC_RESOURCE_BASE + resourceName + ".loc");
- }
- if (is == null)
- {
- Logger.WLOG(Logger.EUtils,
- "Cannot load resource file: " + resourceName);
- return;
+ LOC_RESOURCE_BASE + resourceName + "_" + getLocaleId() + ".loc");
+
+ if (is == null)
+ {
+ // Load the engineering english
+ is = this.getClass().getResourceAsStream(
+ LOC_RESOURCE_BASE + resourceName + "_sc" + ".loc");
+ }
+ if (is == null)
+ {
+ // Load the reference engineering english
+ is = this.getClass().getResourceAsStream(
+ LOC_RESOURCE_BASE + resourceName + ".loc");
+ }
+ if (is == null)
+ {
+ Logger.WLOG(Logger.EUtils,
+ "Cannot load resource file: " + resourceName);
+ return false;
+ }
}
try
@@ -248,6 +422,8 @@
"Resource file " + resourceName + " handling failed: "
+ ex.getMessage());
}
+
+ return true;
}
/**
@@ -366,4 +542,11 @@
*/
private native int _getLocaleId();
+ /**
+ * Get Locale Id on Qt platform.
+ *
+ * @return locale Id string. If not in Qt null.
+ */
+ private static native String _getLocaleIdQt();
+
}
--- a/javacommons/utils/src.s60/formatternative.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/src.s60/formatternative.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -16,10 +16,14 @@
*/
-//#include <avkon.rsg>
#include <memory>
#include <stringresourcereader.h>
-#include <aknutils.h>
+
+#ifdef RD_JAVA_UI_QT
+#include <QLocale>
+#else // RD_JAVA_UI_QT
+#include <AknUtils.h>
+#endif // RD_JAVA_UI_QT
#include "com_nokia_mj_impl_utils_Formatter.h"
#include "com_nokia_mj_impl_utils_ResourceLoader.h"
@@ -45,7 +49,6 @@
const TInt KMaxNumberFormatSize = 40;
using namespace java::util;
-// _LIT( KAvkonResFile, "z:\\resource\\avkon.rsc" );
JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_Formatter__1formatInteger
(JNIEnv *aJni, jobject, jint aNumber)
@@ -68,7 +71,10 @@
"Cannot format %d to current locale. Error: %d", aNumber, error);
}
- AknTextUtils::LanguageSpecificNumberConversion( numberPtr );
+#ifndef RD_JAVA_UI_QT
+ AknTextUtils::LanguageSpecificNumberConversion( numberPtr );
+#endif // RD_JAVA_UI_QT
+
return aJni->NewString(
(const jchar*)numberPtr.Ptr(), numberPtr.Length());
}
@@ -116,8 +122,24 @@
std::wstring wstr = JniUtils::jstringToWstring(aEnv, str);
HBufC* buf = S60CommonUtils::wstringToDes(wstr.c_str());
TPtr ptr(buf->Des());
+
+#ifndef RD_JAVA_UI_QT
AknTextUtils::LanguageSpecificNumberConversion( ptr );
+#endif // RD_JAVA_UI_QT
ret = S60CommonUtils::NativeToJavaString(*aEnv, ptr);
delete buf; buf = NULL;
return ret;
}
+
+JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_utils_ResourceLoader__1getLocaleIdQt
+ (JNIEnv *env, jclass)
+{
+#ifdef RD_JAVA_UI_QT
+ QString localeName = QLocale::system().name();
+ jstring loc = env->NewString(localeName.utf16(), localeName.size());
+ return loc;
+#else // RD_JAVA_UI_QT
+ (void)env; // just to suppress a warning
+ return NULL;
+#endif // RD_JAVA_UI_QT
+}
--- a/javacommons/utils/src.s60/javaoslayer.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/src.s60/javaoslayer.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -39,6 +39,7 @@
const char * const BOOT_CLASSPATH_MIDP_FILE = "midpodclist";
const char * const BOOT_CLASSPATH_INSTALLER_FILE = "installerodclist";
const char * const BOOT_CLASSPATH_TCKRUNNER_FILE = "tckrunnerodclist";
+const char * const BOOT_CLASSPATH_JAVACONTROLPANEL_FILE = "javacontrolpanelodclist";
_LIT(KStartUpTraceDir, "java\\full");
_LIT(KStartUpTraceFile, "startup.txt");
@@ -303,6 +304,10 @@
{
path.append(BOOT_CLASSPATH_TCKRUNNER_FILE);
}
+ else if (BOOT_CLASSPATH_JAVACONTROLPANEL == pathType)
+ {
+ path.append(BOOT_CLASSPATH_JAVACONTROLPANEL_FILE);
+ }
else
{
path.append(BOOT_CLASSPATH_MIDP_FILE);
--- a/javacommons/utils/src/javacommonutils.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/src/javacommonutils.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -15,9 +15,11 @@
*
*/
-
+#include <errno.h>
+#include <fcntl.h>
#include <iostream>
#include <sstream>
+#include <unistd.h>
#include <vector>
#include <string.h>
@@ -33,6 +35,16 @@
using namespace java::util;
+// In Symbian working directory should be initalized to C:\private\<UID> by OpenC
+// But for some reason this does not seem to work if process binary is in rom.
+#ifdef __SYMBIAN32__
+const char* const FIRST_BOOT_FILE = "c:\\private\\102033E6\\first_boot_done.dat";
+#else
+const char* const FIRST_BOOT_FILE = "first_boot_done.dat";
+#endif /* __SYMBIAN32__ */
+
+bool JavaCommonUtils::mFirstBoot = false;
+
OS_EXPORT int JavaCommonUtils::stringToInt(const std::string& str)
{
// JELOG2(EUtils);
@@ -277,6 +289,34 @@
return result;
}
+OS_EXPORT std::wstring JavaCommonUtils::wbase64encode(const std::wstring& aData)
+{
+ BIO* b64 = BIO_new(BIO_f_base64());
+ if (NULL == b64)
+ {
+ return L"";
+ }
+ BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
+ BIO* bmem = BIO_new(BIO_s_mem());
+
+ b64 = BIO_push(b64, bmem);
+ BIO_write(b64, aData.c_str(), aData.length() * 2);
+ BIO_flush(b64);
+
+ BUF_MEM* bptr;
+ BIO_get_mem_ptr(b64, &bptr);
+
+ std::wstring result;
+ // convert each char to wchar
+ for (int i = 0; i < bptr->length; i++)
+ {
+ result.push_back((wchar_t)*(bptr->data + i));
+ }
+ BIO_free_all(b64);
+
+ return result;
+}
+
OS_EXPORT std::string JavaCommonUtils::base64decode(const std::string& aData)
{
BIO* b64 = BIO_new(BIO_f_base64());
@@ -344,6 +384,40 @@
}
+OS_EXPORT int JavaCommonUtils::initIsFirstBoot()
+{
+ struct stat fileStatBuf;
+ if (stat(FIRST_BOOT_FILE, &fileStatBuf) == 0)
+ {
+ mFirstBoot = false;
+ }
+ else
+ {
+ mFirstBoot = true;
+
+ // Create flag file so that next time we detect that first boot
+ // has already been done
+ int fd = open(FIRST_BOOT_FILE, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+ if (fd < 0)
+ {
+ return errno;
+ }
+ else
+ {
+ close(fd);
+ }
+ }
+
+ return 0;
+}
+
+
+OS_EXPORT bool JavaCommonUtils::isFirstBoot()
+{
+ return mFirstBoot;
+}
+
+
char JavaCommonUtils::decodeOnePercentSeq(wchar_t first, wchar_t sec)
{
// Handle one encoded %XY
--- a/javacommons/utils/src/javainifileutils.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/src/javainifileutils.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -157,9 +157,9 @@
}
rewind(iniFile);
data = new char[len+1];
- data[len] = 0;
if (data != 0)
{
+ data[len] = 0;
fread(data, sizeof(char), len, iniFile);
}
fclose(iniFile);
--- a/javacommons/utils/src/logger.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javacommons/utils/src/logger.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -30,6 +30,10 @@
#include <sstream>
#include <iomanip>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
#include "jdebug_omj.h"
#include "logger.h"
#include "javacommonutils.h"
--- a/javaextensions/bluetooth/bluecove/build/javabluecove_0x2002DC97.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/bluecove/build/javabluecove_0x2002DC97.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javabluecove.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons_0x2002DC99.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/bluetoothcommons/build/javabluetoothcommons_0x2002DC99.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javabluetoothcommons.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javaextensions/bluetooth/bluetoothcommons/src.s60/bluetoothnamelookup.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/bluetoothcommons/src.s60/bluetoothnamelookup.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -63,9 +63,8 @@
mLookupMonitor = new CActiveSchedulerWait();
}
LOG1(EJavaBluetooth, EInfo,
- "+ BluetoothNameLookup::doDeviceNameLookupL DeviceAddress:%x",
+ "+ BluetoothNameLookup::doDeviceNameLookupL DeviceAddress:%llx",
aDevAddr);
-
TProtocolDesc pdesc;
User::LeaveIfError(mSocketServ.FindProtocol(KBTLinkManagerTxt(), pdesc));
--- a/javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -148,7 +148,7 @@
TPtrC8 uuidDes(uuidBytes, uuidByteLength);
TRAPD(err, uuid.SetL(uuidDes));
- delete uuidBytes;
+ delete[] uuidBytes;
uuidBytes = NULL;
if (KErrNone != err)
@@ -205,7 +205,7 @@
char *fileName = java::util::JavaCommonUtils::wstringToUtf8(
persistentFileName);
persistentRecFd = open(fileName, O_RDONLY);
- delete fileName;
+ delete[] fileName;
}
catch (ExceptionBase ex)
{
@@ -618,7 +618,7 @@
write(mSrvRecFd, (char *) &aDeviceServiceClasses,
sizeof(aDeviceServiceClasses));
- delete fileName;
+ delete[] fileName;
}
catch (ExceptionBase ex)
{
@@ -1286,7 +1286,7 @@
char *fileName =
java::util::JavaCommonUtils::wstringToUtf8(persistentFileName);
persistentRecFd = open(fileName, O_RDONLY);
- delete fileName;
+ delete[] fileName;
}
catch (ExceptionBase ex)
{
@@ -1310,7 +1310,10 @@
unsigned int devServClass = 0;
ret = read(persistentRecFd, &devServClass, sizeof(devServClass));
if (ret <= 0)
+ {
+ delete srvRecPopulator;
return;
+ }
elementBuilder = srvRecPopulator->SetDeviceServiceClass(devServClass);
--- a/javaextensions/bluetooth/bluetoothplugins/btgoeppushplugin/build/javabtgoepscplugin_0x2002DC9A.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/bluetoothplugins/btgoeppushplugin/build/javabtgoepscplugin_0x2002DC9A.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javabtgoepscplugin.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javaextensions/bluetooth/bluetoothplugins/btjavacaptainplugin/build/javacaptain_ext_btdeviceclassmanager_0x2002DC9D.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/bluetoothplugins/btjavacaptainplugin/build/javacaptain_ext_btdeviceclassmanager_0x2002DC9D.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javacaptain_ext_btdeviceclassmanager.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/build/javabtl2capscplugin_0x2002DC9B.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/build/javabtl2capscplugin_0x2002DC9B.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javabtl2capscplugin.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src.s60/btl2capserverconnection.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src.s60/btl2capserverconnection.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -489,7 +489,21 @@
if (KErrNone == err)
{
mAcceptedSocket->RemoteName(btRemoteAddr);
- if (mAsyncAccept && (!mAvoidFilter) && (false == isConnectionAllowed(btRemoteAddr)))
+ TBuf<20> addr;
+ TInt64 longBtAddr = 0;
+ TBTDevAddr btDeviceAddress = btRemoteAddr.BTAddr();
+ LOG4(EJavaBluetooth,EInfo,"TBTDevAddr Address is %x %x %x %x ",
+ btDeviceAddress[0],btDeviceAddress[1],
+ btDeviceAddress[2],btDeviceAddress[3]);
+ LOG2(EJavaBluetooth,EInfo,"%x %x",btDeviceAddress[4],
+ btDeviceAddress[5]);
+ btDeviceAddress.GetReadable(addr);
+ LOG1(EJavaBluetooth,EInfo,"BT: Readable address is %S",&addr);
+ TLex16 toParse(addr);
+ toParse.Val(longBtAddr, EHex);
+ LOG1(EJavaBluetooth, EInfo,
+ "L2CAPServerConnection::HandleAcceptCompleteL: Address: %llx", longBtAddr);
+ if ((longBtAddr == 0) ||(mAsyncAccept && (!mAvoidFilter) && (false == isConnectionAllowed(btRemoteAddr))))
{
mAcceptedSocket->CancelAll();
mAcceptedSocket->Shutdown(RSocket::EImmediate);
@@ -500,14 +514,7 @@
AcceptL();
return;
}
- TBuf<20> addr;
- TInt64 longBtAddr = 0;
- TBTDevAddr btDeviceAddress = btRemoteAddr.BTAddr();
- btDeviceAddress.GetReadable(addr);
- TLex16 toParse(addr);
- toParse.Val(longBtAddr, EHex);
- LOG1(EJavaBluetooth, EInfo,
- "L2CAPServerConnection::HandleAcceptCompleteL: Address: %ld", longBtAddr);
+
mBtClientConn = new BluetoothClientConnection(mAcceptedSocket, mServer);
mAcceptedSocket->GetOpt(KL2CAPInboundMTU, KSolBtL2CAP, negotiatedReceiveMtu);
mAcceptedSocket->GetOpt(KL2CAPNegotiatedOutboundMTU, KSolBtL2CAP, negotiatedTransmitMtu);
--- a/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src/btl2cappushserverconnection.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/bluetoothplugins/btl2cappushplugin/src/btl2cappushserverconnection.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -199,7 +199,9 @@
BluetoothNameLookup * nameLookup = NULL;
long long remoteDevAddr = aClientConnection->getRemoteAddress();
-
+ ELOG1(EJavaBluetooth,
+ "+ L2CapPushServerConnection::handleConnectionRequest DeviceAddress:%llx",
+ remoteDevAddr);
TRAPD(lookupErr,
{
nameLookup = BluetoothNameLookup::NewL();
--- a/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/build/javabtsppscplugin_0x2002DC9C.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/build/javabtsppscplugin_0x2002DC9C.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javabtsppscplugin.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/src.s60/btrfcommserverconnection.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/bluetoothplugins/btspppushplugin/src.s60/btrfcommserverconnection.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -437,7 +437,21 @@
if (KErrNone == err)
{
mAcceptedSocket->RemoteName(btRemoteAddr);
- if (mAsyncAccept && (!mAvoidFilter) && (false == isConnectionAllowed(btRemoteAddr)))
+ TBuf<20> addr;
+ TInt64 longBtAddr = 0;
+ TBTDevAddr btDeviceAddress = btRemoteAddr.BTAddr();
+ LOG4(EJavaBluetooth,EInfo,"TBTDevAddr Address is %x %x %x %x ",
+ btDeviceAddress[0],btDeviceAddress[1],
+ btDeviceAddress[2],btDeviceAddress[3]);
+ LOG2(EJavaBluetooth,EInfo,"%x %x",btDeviceAddress[4],
+ btDeviceAddress[5]);
+ btDeviceAddress.GetReadable(addr);
+ LOG1(EJavaBluetooth,EInfo,"BT: Readable address is %S",&addr);
+ TLex16 toParse(addr);
+ toParse.Val(longBtAddr, EHex);
+ LOG1(EJavaBluetooth, EInfo,
+ "L2CAPServerConnection::HandleAcceptCompleteL: Address: %llx", longBtAddr);
+ if ((longBtAddr == 0) ||(mAsyncAccept && (!mAvoidFilter) && (false == isConnectionAllowed(btRemoteAddr))))
{
mAcceptedSocket->CancelAll();
mAcceptedSocket->Shutdown(RSocket::EImmediate);
@@ -448,13 +462,7 @@
AcceptL();
return;
}
- TBuf<20> addr;
- TInt64 longBtAddr = 0;
- TBTDevAddr btDeviceAddress = btRemoteAddr.BTAddr();
- btDeviceAddress.GetReadable(addr);
- TLex16 toParse(addr);
- toParse.Val(longBtAddr, EHex);
- LOG1(EJavaBluetooth, EInfo, "RFCOMMServerConnection::HandleAcceptCompleteL: Address: %ld", longBtAddr);
+
mBtClientConn = new BluetoothClientConnection(mAcceptedSocket, mServer);
mBtClientConn->initialize(PROTOCOL_RFCOMM, longBtAddr, 0, 0);
if (mAsyncAccept)
--- a/javaextensions/bluetooth/omjbluetooth/build/javabluetooth_0x2002DC98.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/omjbluetooth/build/javabluetooth_0x2002DC98.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javabluetooth.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javaextensions/bluetooth/omjbluetooth/javasrc/com/nokia/mj/impl/properties/bluetooth/BtDynamicPropertyHandler.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/bluetooth/omjbluetooth/javasrc/com/nokia/mj/impl/properties/bluetooth/BtDynamicPropertyHandler.java Thu Aug 19 09:48:13 2010 +0300
@@ -65,7 +65,7 @@
private static final int MASTER_SWITCH = 7;
- private static final int SD_TRANS_MAX = 8;
+ private static final int SD_TRANS_MAX = 1;
private static final int SD_ATTR_RETRIEVE_MAX = 9;
--- a/javaextensions/broadcast_stub/build/javabroadcast_0x2002DCE0.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/broadcast_stub/build/javabroadcast_0x2002DCE0.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javabroadcast.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javaextensions/comm/build/javacomm_0x2002DCA5.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/comm/build/javacomm_0x2002DCA5.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javacomm.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javaextensions/datagram/datagram/build/javadatagram_0x2002DCA9.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/datagram/datagram/build/javadatagram_0x2002DCA9.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javadatagram.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javaextensions/datagram/serverconnection/build/javadatagramscplugin_0x2002DCAA.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/datagram/serverconnection/build/javadatagramscplugin_0x2002DCAA.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javadatagramscplugin.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javaextensions/globalindicators/build/javaglobalindicators_0x2002DCAF.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/globalindicators/build/javaglobalindicators_0x2002DCAF.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javaglobalindicators.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javaextensions/iapinfo/build/javaiapinfo_0x2002DCB3.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/iapinfo/build/javaiapinfo_0x2002DCB3.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javaiapinfo.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javaextensions/javaextensions.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/javaextensions.pro Thu Aug 19 09:48:13 2010 +0300
@@ -15,7 +15,7 @@
#
TEMPLATE = subdirs
SUBDIRS += iapinfo/build/javaiapinfo.pro
-SUBDIRS += mobinfo/build/mobinfo.pro
+SUBDIRS += mobinfo/build/javamobinfo.pro
SUBDIRS += comm/build/javacomm.pro
SUBDIRS += globalindicators/build/javaglobalindicators.pro
SUBDIRS += webservices/build/javawebservices.pro
--- a/javaextensions/location/build/javalocation_0x2002DCBC.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/location/build/javalocation_0x2002DCBC.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javalocation.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../common/inc
--- a/javaextensions/location/landmarks/src/landmark.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/location/landmarks/src/landmark.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -457,6 +457,11 @@
return error;
}
+LOCAL_C void dispose(CBase* aLandmark)
+{
+ delete aLandmark;
+}
+
/*
* Class: javax_microedition_location_Landmark
* Method: _dispose
@@ -466,14 +471,15 @@
JNICALL Java_javax_microedition_location_Landmark__1dispose(
JNIEnv* /*aJniEnv*/,
jobject /*aPeer*/,
- jint /*aEventSourceHandle*/,
+ jint aEventSourceHandle,
jint aLandmarkHandle)
{
JELOG2(EJavaLocation);
-
+ LocationFunctionServer* eventSource =
+ reinterpret_cast< LocationFunctionServer*>(aEventSourceHandle);
+
CBase* object = reinterpret_cast< CBase*>(aLandmarkHandle);
-
- delete object;
+ eventSource->ExecuteTrap(dispose,object);
}
// End of file
--- a/javaextensions/location/position/src/cpositioner.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/location/position/src/cpositioner.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -156,10 +156,9 @@
case KErrAccessDenied: // Fallthrough
case KErrUnknown: // Used in MLFW
// Position request was canceled
- case KErrCancel: // Fallthrough
- // Bad implementation but due to partial fixes this cannot be fixed
- // at the moment. Correct when partial fixes are supported. Java tries
- // to obtain location fixes until time specified in Java-side expires
+ case KErrCancel: // Fallthrough
+ // Partial update feature is not supported. So Java tries to obtain
+ // location fixes until time specified in Java-side expires
// Delay response so that repeated calls to getLocation do not steal
// all CPU time
default:
--- a/javaextensions/midppush/build/javapushregistry_0x2002DCC9.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/midppush/build/javapushregistry_0x2002DCC9.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javapushregistry.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../pushcontroller/src
--- a/javaextensions/midppush/pushcontroller/build/javapushcontroller_0x2002DCC8.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/midppush/pushcontroller/build/javapushcontroller_0x2002DCC8.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javapushcontroller.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../../../../javaruntime/inc
--- a/javaextensions/midppush/pushregistryplugin/build/javacaptain_ext_pushregistryplugin_0x2002DCA2.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/midppush/pushregistryplugin/build/javacaptain_ext_pushregistryplugin_0x2002DCA2.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javacaptain_ext_pushregistryplugin.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javaextensions/midprms_db/build/javarms_0x2002DCCB.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/midprms_db/build/javarms_0x2002DCCB.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javarms.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RmsFileInfo.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/midprms_db/javasrc/com/nokia/mj/impl/rms/RmsFileInfo.java Thu Aug 19 09:48:13 2010 +0300
@@ -71,7 +71,7 @@
private long getSize()
{
- long size = 0;
+ long size = -1;
try
{
size = iFile.fileSize();
@@ -82,6 +82,7 @@
}
if (size < 0)
{
+ Logger.WLOG(Logger.EMidpRms, "fileSize = " + size);
size = 0;
}
return size;
@@ -102,18 +103,19 @@
private long getFreeSpace()
{
- long size = 0;
+ long size = -1;
try
{
size = iFile.availableSize();
}
catch (Exception e)
{
- Logger.ELOG(Logger.EMidpRms, "availableSize()" , e);
+ Logger.ELOG(Logger.EMidpRms, "availableSize() failed" , e);
}
if (size < 0)
{
- size = 0;
+ Logger.WLOG(Logger.EMidpRms, "availableSize = " + size);
+ size = MAX_RMS_SIZE;
}
return size;
}
--- a/javaextensions/midprms_db/rmsplugin/build/javacaptain_ext_ondemand_2_0x2002DD01.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/midprms_db/rmsplugin/build/javacaptain_ext_ondemand_2_0x2002DD01.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javacaptain_ext_ondemand_2.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../../inc
--- a/javaextensions/mobinfo/build/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/mobinfo/build/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -19,4 +19,4 @@
default
PRJ_MMPFILES
-mobinfo_0x2002DCC3.mmp
+javamobinfo_0x2002DCC3.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javaextensions/mobinfo/build/javamobinfo.pro Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TARGET=javamobinfo
+TEMPLATE=lib
+CONFIG += omj java stl
+CONFIG -= qt
+
+symbian {
+ LIBS += -leuser -letel -letelmm -lesock -lconnmon -lcommdb -lcommsdat -lcmmanager -ljavaconnectionmanager
+}
+
+include(../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javaextensions/mobinfo/build/javamobinfo_0x2002DCC3.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated file - do not edit manually
+*
+*/
+
+// ==============================================================================
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
+// This file is generated by qmake and should not be modified by the
+// user.
+// Name : javamobinfo.mmp
+// ==============================================================================
+
+TARGET javamobinfo.dll
+TARGETTYPE DLL
+
+UID 0x1000008d 0x2002DCC3
+SECUREID 0x2002DCC3
+
+EPOCALLOWDLLDATA
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO RD_JAVA_SYMBIAN_TARGET
+MACRO RD_JAVA_S60_RELEASE_9_2
+MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
+MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
+MACRO RD_JAVA_STDCPPV5
+MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
+MACRO RD_JAVA_HTTP_EMC_ENABLED
+MACRO RD_JAVA_NGA_ENABLED
+MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
+MACRO RD_JAVA_OPENC_BETA_PATCH
+MACRO RD_JAVA_INSTALLERUI_ENABLED
+MACRO RD_JAVA_PREWARM
+MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+MACRO RD_JAVA_MIDPRMS_DB
+MACRO __SYMBIAN32__
+MACRO J9EPOC32
+
+SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../../inc
+SYSTEMINCLUDE ../../../inc
+SYSTEMINCLUDE ../src.s60
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE .
+
+SOURCEPATH ../src.s60
+SOURCE javamobinfo.cpp
+
+
+LIBRARY euser.lib
+LIBRARY etel.lib
+LIBRARY etelmm.lib
+LIBRARY esock.lib
+LIBRARY connmon.lib
+LIBRARY commdb.lib
+LIBRARY commsdat.lib
+LIBRARY cmmanager.lib
+LIBRARY javaconnectionmanager.lib
+LIBRARY javautils.lib
+LIBRARY libpthread.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY apparc.lib
+LIBRARY avkon.lib
+LIBRARY efsrv.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+LIBRARY apgrfx.lib
+
+CAPABILITY all -tcb
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+#if defined(ARMCC_4_0)
+OPTION ARMCC --import_all_vtbl
+#endif
+OPTION GCCE -fvisibility-inlines-hidden
+
+VERSION 10.0
+
+ARMFPU softvfp
+
+PAGED
+
+BYTEPAIRCOMPRESSTARGET
+
+USERINCLUDE .
+
+#include <platform_paths.hrh>
+
+ APP_LAYER_SYSTEMINCLUDE
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE
+
+ OS_LAYER_SSL_SYSTEMINCLUDE
+
+deffile ./~/javamobinfo.def
+
+ SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
+
+SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
+
+SOURCEPATH /epoc32/build/jrt/javabuild/javamobinfo
+
+SOURCE lookup.cpp
+
+SOURCEPATH /epoc32/build/jrt/javabuild/javamobinfo
+
+SOURCE jxe.c
+
+#ifdef WINSCW
+
+LIBRARY ewsd.lib
+
+#endif
+
+STDCPP
+
+#ifdef WINSCW
+DEFFILE ./bwins/javamobinfo.def
+#elif defined EABI
+DEFFILE ./eabi/javamobinfo.def
+#endif
--- a/javaextensions/mobinfo/build/mobinfo.pro Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-TARGET=javamobinfo
-TEMPLATE=lib
-CONFIG += omj java stl
-CONFIG -= qt
-
-symbian {
- LIBS += -leuser -letel -letelmm -lesock -lconnmon -lcommdb -lcommsdat -lcmmanager
-}
-
-include(../../../build/omj.pri)
--- a/javaextensions/mobinfo/build/mobinfo_0x2002DCC3.mmp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,150 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Generated file - do not edit manually
-*
-*/
-
-// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
-// This file is generated by qmake and should not be modified by the
-// user.
-// Name : mobinfo.mmp
-// ==============================================================================
-
-TARGET javamobinfo.dll
-TARGETTYPE DLL
-
-UID 0x1000008d 0x2002DCC3
-SECUREID 0x2002DCC3
-
-EPOCALLOWDLLDATA
-
-
-// Qt Macros
-MACRO UNICODE
-MACRO QT_KEYPAD_NAVIGATION
-MACRO QT_SOFTKEYS_ENABLED
-MACRO QT_USE_MATH_H_FLOATS
-MACRO RD_JAVA_SYMBIAN_TARGET
-MACRO RD_JAVA_S60_RELEASE_9_2
-MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
-MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
-MACRO RD_JAVA_STDCPPV5
-MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
-MACRO RD_JAVA_HTTP_EMC_ENABLED
-MACRO RD_JAVA_NGA_ENABLED
-MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
-MACRO RD_JAVA_OPENC_BETA_PATCH
-MACRO RD_JAVA_INSTALLERUI_ENABLED
-MACRO RD_JAVA_PREWARM
-MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
-MACRO RD_JAVA_MIDPRMS_DB
-MACRO __SYMBIAN32__
-MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
-
-SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
-SYSTEMINCLUDE ../../inc
-SYSTEMINCLUDE ../../../inc
-SYSTEMINCLUDE ../src.s60
-SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
-SYSTEMINCLUDE /epoc32/include/mw
-SYSTEMINCLUDE .
-
-SOURCEPATH ../src.s60
-SOURCE javamobinfo.cpp
-
-
-LIBRARY euser.lib
-LIBRARY etel.lib
-LIBRARY etelmm.lib
-LIBRARY esock.lib
-LIBRARY connmon.lib
-LIBRARY commdb.lib
-LIBRARY commsdat.lib
-LIBRARY cmmanager.lib
-LIBRARY javautils.lib
-LIBRARY libpthread.lib
-LIBRARY libstdcppv5.lib
-LIBRARY libc.lib
-LIBRARY libm.lib
-LIBRARY libdl.lib
-LIBRARY cone.lib
-LIBRARY eikcore.lib
-LIBRARY mediaclientaudio.lib
-LIBRARY eikcoctl.lib
-LIBRARY eiksrv.lib
-LIBRARY apparc.lib
-LIBRARY avkon.lib
-LIBRARY efsrv.lib
-LIBRARY charconv.lib
-LIBRARY ws32.lib
-LIBRARY hal.lib
-LIBRARY gdi.lib
-LIBRARY apgrfx.lib
-
-CAPABILITY all -tcb
-
-OPTION CW -wchar_t on
-OPTION ARMCC --visibility_inlines_hidden
-#if defined(ARMCC_4_0)
-OPTION ARMCC --import_all_vtbl
-#endif
-OPTION GCCE -fvisibility-inlines-hidden
-
-VERSION 10.0
-
-ARMFPU softvfp
-
-PAGED
-
-BYTEPAIRCOMPRESSTARGET
-
-USERINCLUDE .
-
-#include <platform_paths.hrh>
-
- APP_LAYER_SYSTEMINCLUDE
-
- OS_LAYER_LIBC_SYSTEMINCLUDE
-
- OS_LAYER_SSL_SYSTEMINCLUDE
-
-deffile ./~/javamobinfo.def
-
- SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
-
-SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
-
-SOURCEPATH /epoc32/build/jrt/javabuild/javamobinfo
-
-SOURCE lookup.cpp
-
-SOURCEPATH /epoc32/build/jrt/javabuild/javamobinfo
-
-SOURCE jxe.c
-
-#ifdef WINSCW
-
-LIBRARY ewsd.lib
-
-#endif
-
-STDCPP
-
-#ifdef WINSCW
-DEFFILE ./bwins/javamobinfo.def
-#elif defined EABI
-DEFFILE ./eabi/javamobinfo.def
-#endif
--- a/javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoProperties.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/mobinfo/javasrc.s60/com/nokia/mj/impl/properties/mobinfo/MobileInfoProperties.java Thu Aug 19 09:48:13 2010 +0300
@@ -140,6 +140,9 @@
int value = ((Integer)iPropertyKeys.get(aKey)).intValue();
Uid appSuiteUid;
+ int apId = APP_DEFAULT_APN_NOT_SPECIFIED; // access point id
+ int apType = APP_DEFAULT_APN_NOT_SPECIFIED; // MIDlet access point type, can be SNAP or IAP
+
ConnectionManager CmInstance = null;
String result = null;
// Only network access seems to have another way to handle it.
@@ -160,29 +163,25 @@
AccessPoint apn = CmInstance.getApplicationDefault(appSuiteUid);
if (apn != null)
{
- if (apn.getType() == AccessPoint.NAP_IAP) // IAP ID
+ apId = apn.getNapId();
+ apType = apn.getType();
+
+
+ if ((apType!=AccessPoint.NAP_SNAP) && (apType!=AccessPoint.NAP_IAP))
{
- result = _getPropertyApn(NETWORK_ACCESS_V, apn.getNapId());
+ apType = APP_DEFAULT_APN_NOT_SPECIFIED;
+ apId = APP_DEFAULT_APN_NOT_SPECIFIED;
}
- else
- {
- result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED);
- }
+
}
- else
- {
- result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED);
- }
+
}
- else
- {
- result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED);
- }
+ result = _getPropertyApn(NETWORK_ACCESS_V, apId,apType);
}
catch (Exception e)
{
Logger.LOG(Logger.ESOCKET, Logger.EInfo,"MobilInfoProperties :: getSuiteUid exception ");
- result = _getPropertyApn(NETWORK_ACCESS_V, APP_DEFAULT_APN_NOT_SPECIFIED);
+ result = _getPropertyApn(NETWORK_ACCESS_V, apId,apType);
}
return result;
}
@@ -202,6 +201,6 @@
}
private native String _getProperty(int value);
- private static native String _getPropertyApn(int property, int aAppDefaultApn);
+ private static native String _getPropertyApn(int property, int aAppDefaultApn, int apType);
}
\ No newline at end of file
--- a/javaextensions/mobinfo/src.s60/javamobinfo.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/mobinfo/src.s60/javamobinfo.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -29,6 +29,8 @@
#include <cmpluginpacketdatadef.h>
#include <cmpluginwlandef.h>
#include <cmpluginhscsddef.h>
+#include "connectionmanager.h"
+
using namespace CMManager;
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
@@ -75,14 +77,15 @@
// ---------------------------------------------------------------------------
// forward declarations
// ---------------------------------------------------------------------------
-HBufC* GetProperty(const TInt aProperty, const TUint32 aAppDefaultApn);
+HBufC* GetProperty(const TInt aProperty, const TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType);
HBufC* GetTelephonyPropertyL(const TInt aProperty);
HBufC* GetDateTimePropertyL(const TInt aProperty);
-HBufC* GetNetworkAccessL(const TUint32 aAppDefaultApn);
+HBufC* GetNetworkAccessL(const TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType);
TUint32 GetUsedIapL();
HBufC* GetBearerTypeL(TUint32 aIapId);
+HBufC* GetIapBearerTypeL(const TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType);
HBufC* TranslateBearerInfoToNetworkAccessL(TConnMonBearerInfo aBearerInfo);
-HBufC* GetDefIapBearerTypeL(TUint32 aMidSuiteId);
+HBufC* GetAppDefIapBearerTypeL(const TUint32 aAppDefaultApn);
/*
* Class: com_nokia_mj_impl_properties_mobinfo_MobileInfoProperties
@@ -95,16 +98,18 @@
// Each mobinfo java property implementation calls the getPropertyMsid()
// function of the MobileInfoProperties class.
// @param aProperty name of the actual property
+// @param aAppDefaultApn application default access point id
+// @param aAppDefaultApType application default access point type ( SNAP, IAP)
// @param aAppDefaultApn Application default apn
// -----------------------------------------------------------------------------
JNIEXPORT jstring JNICALL
Java_com_nokia_mj_impl_properties_mobinfo_MobileInfoProperties__1getPropertyApn
-(JNIEnv* aJni, jclass, jint aProperty, jint aAppDefaultApn)
+(JNIEnv* aJni, jclass, jint aProperty, jint aAppDefaultApn, jint aAppDefaultApType)
{
LOG1(ESOCKET, EInfo, "MOBINFO + getPropertyMsid(), msid: %D", aAppDefaultApn);
HBufC* property = NULL;
jstring str = NULL;
- property = GetProperty(aProperty, aAppDefaultApn);
+ property = GetProperty(aProperty, aAppDefaultApn,aAppDefaultApType);
if (NULL != property)
{
LOG(ESOCKET,EInfo,"_getPropertyApn, property is not null");
@@ -124,7 +129,7 @@
HBufC* property = NULL;
jstring str = NULL;
- property = GetProperty(aKey,NULL);
+ property = GetProperty(aKey,NULL,0);
if (NULL != property)
{
TPtrC data(property->Des());
@@ -134,7 +139,7 @@
return str;
}
-HBufC* GetProperty(const TInt aProperty, const TUint32 aAppDefaultApn)
+HBufC* GetProperty(const TInt aProperty, const TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType)
{
JELOG2(ESOCKET);
LOG(ESOCKET, EInfo, "MOBINFO + GetProperty()");
@@ -148,7 +153,7 @@
TRAP(err, property = GetDateTimePropertyL(aProperty));
break;
case NETWORK_ACCESS:
- TRAP(err, property = GetNetworkAccessL(aAppDefaultApn));
+ TRAP(err, property = GetNetworkAccessL(aAppDefaultApn,aAppDefaultApType));
LOG(ESOCKET, EInfo,"after GetNetworkAccessL");
break;
@@ -785,21 +790,178 @@
// Get type network access of currently used active connection
// @return network access, ownership hand over
// ---------------------------------------------------------------------------
-HBufC* GetNetworkAccessL(TUint32 aAppDefaultApn)
+HBufC* GetNetworkAccessL(TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType)
{
LOG(ESOCKET, EInfo, "MOBINFO + GetNetworkAccessL");
HBufC* bearerType = NULL;
TUint32 iapId = GetUsedIapL();
- if (iapId == 0)
+ if (iapId != 0)
+ {
+ // active connection present, opened by MIDlet.
+ bearerType = GetBearerTypeL(iapId);
+
+ }
+ else
{
- bearerType = GetDefIapBearerTypeL(aAppDefaultApn);
+ // if there is no active connection by the application, return the app default bearer type.
+ if (aAppDefaultApType == 3)
+ {
+ // app default is IAP
+ bearerType = GetAppDefIapBearerTypeL(aAppDefaultApn);
+
+ }
+ else
+ {
+ bearerType = GetIapBearerTypeL(aAppDefaultApn,aAppDefaultApType);
+ }
+
+ }
+ LOG(ESOCKET, EInfo, "MOBINFO - GetNetworkAccessL");
+ return bearerType;
+}
+
+
+//// ---------------------------------------------------------------------------
+//// Check if device default is set (SNAP or IAP)
+//// @return true if device default defined, else false
+//// ---------------------------------------------------------------------------
+
+bool isDeviceDefaultPresentL()
+{
+ TCmDefConnType type;
+ RCmManager * mgr = new(ELeave) RCmManager();
+ mgr->OpenL();
+
+ TCmDefConnValue obj;
+ mgr->ReadDefConnL(obj);
+ type = obj.iType;
+
+ if ((type!=ECmDefConnConnectionMethod) && (type!=ECmDefConnDestination))
+ {
+ // device default is other than SNAP or IAP
+ return false;
}
else
{
- bearerType = GetBearerTypeL(iapId);
+ return true;
+
}
- LOG(ESOCKET, EInfo, "MOBINFO - GetNetworkAccessL");
+
+
+
+}
+
+//// ---------------------------------------------------------------------------
+//// Get bearer type of Access point ID
+//// @return bearer type Acess point ID
+//// ---------------------------------------------------------------------------
+
+HBufC* GetIapBearerTypeL(const TUint32 aAppDefaultApn, const TUint32 aAppDefaultApType)
+{
+
+ LOG(ESOCKET, EInfo, "MOBINFO + GetIapBearerTypeL()");
+ RConnectionMonitor monitor;
+ TUint connectionCount(0);
+ TUint iapId(0);
+ TRequestStatus status(KErrNone);
+ HBufC* bearerType(NULL);
+ TUint connectionId(0);
+ TUint subConnectionCount(0);
+ TConnMonBearerInfo bearerInfo(EBearerInfoUnknown);
+ bool flag = false;
+ TUint connIdx = 1;
+
+ User::LeaveIfError(monitor.ConnectL());
+ CleanupClosePushL(monitor);
+
+ status = KRequestPending;
+ monitor.GetConnectionCount(connectionCount, status);
+ User::WaitForRequest(status);
+ User::LeaveIfError(status.Int());
+ LOG1(ESOCKET, EInfo, "MOBINFO: GetIapBearerTypeL: Count of active connections: %D", connectionCount);
+
+ // Go through all connections
+ for (connIdx = 1; connIdx <= connectionCount; ++connIdx)
+ {
+
+ connectionId = 0;
+ subConnectionCount = 0;
+ flag = false;
+
+ // Get connection ID
+ monitor.GetConnectionInfo(connIdx, connectionId, subConnectionCount);
+ User::LeaveIfError(connectionId);
+ // Get connection IAP ID
+ status = KRequestPending;
+ monitor.GetUintAttribute(connectionId, 0, KIAPId, iapId, status);
+ User::WaitForRequest(status);
+ User::LeaveIfError(status.Int());
+ LOG1(ESOCKET, EInfo, "MOBINFO: GetIapBearerTypeL Connection 's IAP ID found: %D", iapId);
+ if (aAppDefaultApType == 2)
+ {
+ LOG(ESOCKET, EInfo, "MOBINFO: Matching MIDlet defined SNAP to active IAP ID ");
+ // Midlet has a SNAP defined, so check if the active IAP is under this SNAP.
+ flag = ConnectionManager::isIapDefault(iapId, aAppDefaultApn,false);
+ if (!flag)
+ {
+ continue; // active access point doesn't belong to MIDlet SNAP, check the next active access point.
+ }
+ else
+ {
+ break;
+ }
+ }
+ else
+ {
+ // No SNAP defined for the MIDlet, check for system default SNAP/IAP.
+ if (isDeviceDefaultPresentL())
+ {
+ LOG(ESOCKET, EInfo, "MOBINFO: Matching device default to active IAP ID ");
+ flag = ConnectionManager::isIapDefault(iapId, 0, true);
+ if (!flag)
+ {
+ continue; // active access point doesn't belong to MIDlet SNAP, check the next active access point.
+ }
+ else
+ {
+ break;
+ }
+ }
+ else
+ {
+ LOG(ESOCKET, EInfo, "MOBINFO: Returning the bearer type of first active IAP ");
+ flag = true;
+ break; // no MIDlet SNAP, no device default, select this access point and return the bearer type
+
+ }
+ }
+
+ } // end of for loop
+
+ if (flag)
+ {
+ // we did not reach end of active connections, one of the conditions matched , find the bearer type
+ status = KRequestPending;
+ monitor.GetIntAttribute(connectionId,
+ 0,
+ KBearerInfo,
+ (TInt&)bearerInfo,
+ status);
+ User::WaitForRequest(status);
+ User::LeaveIfError(status.Int());
+
+ // Translate bearer type to type of network access
+ bearerType = TranslateBearerInfoToNetworkAccessL(bearerInfo);
+ }
+ CleanupStack::PopAndDestroy(&monitor);
+ if (bearerType == NULL)
+ {
+ // No active connection (or) active IAP didn't match the conditions
+ bearerType = KNetworkAccessNa().AllocL();
+ }
return bearerType;
+
+
}
//// ---------------------------------------------------------------------------
@@ -1047,26 +1209,24 @@
// --------------------------------------------------------------------
// Get network access type of default access point set in MIDlet settings
-// @param aAppDefaultApn MIDlet suite ID
+// @param aAppDefaultApn MIDlet default IAP
// @return network access type, ownership hand over
-HBufC* GetDefIapBearerTypeL(TUint32 aAppDefaultApn)
+HBufC* GetAppDefIapBearerTypeL(const TUint32 aAppDefaultApn)
{
- LOG(ESOCKET, EInfo, "MOBINFO + GetDefIapBearerTypeL");
- ELOG1(ESOCKET, "GetDefIapBearerTypeL %d", aAppDefaultApn);
+ LOG1(ESOCKET, EInfo, "MOBINFO + GetAppDefIapBearerTypeL aId = %d ", aAppDefaultApn);
HBufC* bearerType(NULL);
- // MAPNSettings* apnTable = GetAPNSettingsLC(KAPNSettingsVersion);
- //TUint32 apn = apnTable->GetAPNIdL( aMidSuiteId );
- //CleanupStack::PopAndDestroy(); //apnTable
- LOG1(ESOCKET, EInfo, "MIDlet specific IAP ID gotten: %D", aAppDefaultApn);
+
if (aAppDefaultApn == 0 || aAppDefaultApn == (TUint32)-1)
{
bearerType = KNetworkAccessNa().AllocL();
}
else
{
+
RCmManager localCmManager;
localCmManager.OpenL();
- TUint32 tmpval = localCmManager.GetConnectionMethodInfoIntL(aAppDefaultApn,ECmBearerType);
+ TUint32 iap = aAppDefaultApn;
+ TUint32 tmpval = localCmManager.GetConnectionMethodInfoIntL(iap,ECmBearerType);
ELOG1(ESOCKET, "GetConnectionMethodInfoIntL: %d", tmpval);
switch (tmpval)
{
@@ -1084,11 +1244,8 @@
default :
bearerType = KNetworkAccessNa().AllocL();
break;
-
-
}
-
}
- LOG(ESOCKET, EInfo, "MOBINFO - GetDefIapBearerTypeL");
+ LOG(ESOCKET, EInfo, "MOBINFO - GetAppDefIapBearerTypeL");
return bearerType;
}
--- a/javaextensions/pim/build/javapim_0x2002DCC5.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/pim/build/javapim_0x2002DCC5.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javapim.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../framework/inc.s60
--- a/javaextensions/satsa/build/javasatsa.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/satsa/build/javasatsa.pro Thu Aug 19 09:48:13 2010 +0300
@@ -11,7 +11,7 @@
#
# Contributors:
#
-# Description:
+# Description:
#
TARGET=javasatsa
@@ -19,25 +19,36 @@
CONFIG += omj java stl
CONFIG -= qt
+
+
symbian {
+
+
INCLUDEPATH += ../framework/inc \
../pki/inc \
../apdu/inc \
../../inc \
../../../inc \
-
-
+
+ contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) {
+
+ INCLUDEPATH += /epoc32/include/mw/hb/hbcore \
+ /epoc32/include/mw/QtCore \
+ /epoc32/include/mw/QtGui \
+ }
+
+
SOURCES += ../pki/src.s60/*.cpp \
../crypto/src/*.cpp \
../apdu/src/*.cpp \
../apdu/src.s60/*.cpp \
../framework/src/satsajnitools.cpp \
-
-
+
+
LIBS += -ljavastorage \
-lCommonUI \
-lrandom \
- -lx509 \
+ -lx509 \
-lx500 \
-llibcrypto \
-lasn1 \
@@ -51,7 +62,7 @@
-laknnotify \
-leiksrv \
-lctframework \
- -lctsecdlgs \
+ -lctsecdlgs \
-lcustomapi \
-lefsrv \
-letel \
@@ -61,9 +72,17 @@
-lhash \
-lWimClient \
-lestlib \
- -lcryptography \
-
-
+ -lcryptography \
+
+ contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) {
+
+ LIBS += -lHbCore\
+ -lQtGui\
+ -lQtCore\
+
+ }
+
+
}
include(../../../build/omj.pri)
--- a/javaextensions/satsa/build/javasatsa_0x2002DCCE.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/satsa/build/javasatsa_0x2002DCCE.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javasatsa.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../framework/inc
--- a/javaextensions/satsa/pki/src.s60/cstscredentialmanager.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/satsa/pki/src.s60/cstscredentialmanager.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -36,7 +36,6 @@
#include <securityerr.h>
-
// CONSTANTS
_LIT(KSTSSymbianKeyStoreLabel, "Software key store");
_LIT(KSTSSymbianCertificateStoreLabel, "Software certificate store");
@@ -67,10 +66,7 @@
{
delete iEncodedCert;
delete iIssuerAndSerialNumber;
- if (iPKIDialog)
- {
- iPKIDialog->Release();
- }
+
delete iDistinguishedName;
delete iDisplayName;
delete iRequestEncoded;
@@ -533,8 +529,7 @@
//
void CSTSCredentialManager::ConstructL()
{
- iPKIDialog = PKIDialogFactory::CreateNoteL();
-
+
User::LeaveIfError(iFileServer.Connect());
iWait = new(ELeave) CActiveSchedulerWait;
iStore = CUnifiedCertStore::NewL(iFileServer, ETrue);
@@ -619,8 +614,7 @@
{
// not found, ok to add
iState = EAddDialog;
- iPKIDialog->SaveCertificate(EX509Certificate, EUserCertificate,
- iSubject, iStatus);
+
SetActive();
return;
}
@@ -720,7 +714,8 @@
CCTCertInfo* certInfo = (*iCertInfoArray)[ 0 ];
iState = ERemoveDialog;
iHandle = certInfo->Handle();
- iPKIDialog->DeleteCertificate(iHandle, iStatus);
+
+
SetActive();
}
@@ -783,7 +778,7 @@
iState = ECSRDialog;
iHandle = iKeyInfo->Handle();
- iPKIDialog->CreateCSR(*iDisplayName, iHandle, iStatus);
+
SetActive();
}
--- a/javaextensions/satsa/pki/src.s60/cstscredentialmanager.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/satsa/pki/src.s60/cstscredentialmanager.h Thu Aug 19 09:48:13 2010 +0300
@@ -31,7 +31,7 @@
// FORWARD DECLARATIONS
class CCTKeyInfo;
-class MPKIDialog;
+
class CUnifiedCertStore;
class CUnifiedKeyStore;
class CX500DistinguishedName;
@@ -349,8 +349,6 @@
// internal error variable
TInt iError;
- // PKI Dialog, owned
- MPKIDialog* iPKIDialog;
// The actual store, owned
CUnifiedCertStore* iStore;
--- a/javaextensions/satsa/pki/src.s60/cstsseprompt.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/satsa/pki/src.s60/cstsseprompt.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -18,11 +18,24 @@
// INCLUDE FILES
+
+
+
#include "cstsseprompt.h"
+
+#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
+
+#include <hbdevicedialog.h>
+#include <QtCore\qvariant.h>
+const QString KMessageTextKey = "text";
+
+#else
+
#include <AknGlobalNote.h>
#include <avkon.rsg>
#include <caosynchronizer.h>
+#endif
// ============================ MEMBER FUNCTIONS ===============================
@@ -43,8 +56,10 @@
// Destructor
CSTSSEPrompt::~CSTSSEPrompt()
{
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
delete iGlobalNote;
delete iSynchronizer;
+#endif
}
// -----------------------------------------------------------------------------
@@ -54,11 +69,26 @@
//
void CSTSSEPrompt::DisplayPromptL(const TDesC& aPrompt)
{
+ #ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
+ HbDeviceDialog* dialog;
+ dialog = new(ELeave) HbDeviceDialog();
+
+ QVariantMap parameters;
+ QString qString((QChar*)aPrompt.Ptr(),aPrompt.Length());
+ parameters[QString(KMessageTextKey)] = qString;
+
+ dialog->show("com.nokia.hb.devicemessagebox/1.0", parameters);
+
+ delete dialog;
+ #else
+
iGlobalNote->ShowNoteL(
iSynchronizer->iStatus,
- EAknGlobalConfirmationNote,
+ EAknGlobalConfirmationNote,
aPrompt);
iSynchronizer->ExecuteL((TTimeIntervalMicroSeconds32) 0);
+
+ #endif
}
// -----------------------------------------------------------------------------
@@ -77,9 +107,11 @@
// -----------------------------------------------------------------------------
void CSTSSEPrompt::ConstructL()
{
+ #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
iGlobalNote = CAknGlobalNote::NewL();
iGlobalNote->SetSoftkeys(R_AVKON_SOFTKEYS_OK_EMPTY);
iSynchronizer = CAOSynchronizer::NewL();
+ #endif
}
--- a/javaextensions/satsa/pki/src.s60/cstsseprompt.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/satsa/pki/src.s60/cstsseprompt.h Thu Aug 19 09:48:13 2010 +0300
@@ -22,13 +22,13 @@
// INCLUDE
#include <e32base.h>
-
-
+// FORWARD DECLARATIONS
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
-// FORWARD DECLARATIONS
+class CAOSynchronizer;
class CAknGlobalNote;
-class CAOSynchronizer;
+#endif
// CLASS DECLARATION
/**
@@ -71,11 +71,14 @@
private: // data
-
+ #ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
// displays the prompt asynchronously, owned
CAknGlobalNote* iGlobalNote;
// waits for the prompt to finish, owned
CAOSynchronizer* iSynchronizer;
+
+ #endif
+
};
--- a/javaextensions/satsa/pki/src.s60/cstssignatureservice.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/satsa/pki/src.s60/cstssignatureservice.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -15,8 +15,6 @@
*
*/
-
-// INCLUDE FILES
#include "cstssignatureservice.h"
#include "tstsdistinguishednameconverter.h"
#include "secdlg.h"
@@ -32,7 +30,11 @@
#include <CCMSSignerInfo.h>
#include <CCMSEncapsulatedContentInfo.h>
#include <CCMSSignedData.h>
+
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
#include <PKIDlg.h>
+#endif
+
#include "cstsseprompt.h"
#include <hash.h>
@@ -42,7 +44,7 @@
#include "logger.h"
#include "jstringutils.h"
-// CONSTANTS
+
const TInt KDefaultGranularity = 1;
const TInt KOptionIncludeContent = 1;
@@ -80,10 +82,12 @@
{
iDialog->Release(); // Release deletes the object
}
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
if (iPKIDialog)
{
iPKIDialog->Release();
}
+#endif
iCertificateArray.Close();
iCertInfos.Close();
delete iFilter;
@@ -126,14 +130,12 @@
TInt aOptions, const CDesCArray& aCaNames,
const TDesC& asecurityElementPrompt, TBool aShowData)
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::AuthenticateL");
if (iState != EReady)
{
ELOG(ESATSA, "CSTSSignatureService::AuthenticateL: Not Ready");
User::Leave(KErrNotReady);
}
- LOG(ESATSA, EInfo, "CSTSSignatureService::AuthenticateL:After convertions");
// First we need to convert the data to unicode, if we have to display it
HBufC* textToDisplay = NULL;
if (aShowData)
@@ -155,14 +157,9 @@
iOptions = aOptions;
iShowNotes = EFalse;
-
- LOG(ESATSA, EInfo, "CSTSSignatureService::AuthenticateL:Going to call CreateSignatureL");
// get handles to applicable certificates
HBufC8* retVal = CreateSignatureL(aCaNames, EX509UsageDigitalSignature,
asecurityElementPrompt);
- LOG(ESATSA, EInfo, "CSTSSignatureService::AuthenticateL:After call to CreateSignatureL");
-
- LOG(ESATSA, EInfo, "-- CSTSSignatureService::AuthenticateL");
return retVal;
}
@@ -171,7 +168,6 @@
jint aOptions, jobjectArray aCaNames, jstring aSecurityElementPrompt,
jboolean aShowData, HBufC8** aRetVal)
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::StaticAuthenticateL");
const TInt byteArrayLength = aJniEnv->GetArrayLength(
aByteArrayToAuthenticate);
jbyte* bytesToAuthenticate = aJniEnv->GetByteArrayElements(
@@ -189,20 +185,15 @@
CDesCArrayFlat* nativeCaNames = STSCreateNativeStringArrayL(aJniEnv,
aCaNames);
- LOG(ESATSA, EInfo, "CSTSSignatureService::StaticAuthenticateL: prepare se prompt");
const JStringUtils securityElementPrompt(*aJniEnv, aSecurityElementPrompt);
- LOG(ESATSA, EInfo, "CSTSSignatureService::StaticAuthenticateL: start convertions to TInt");
TBool ShowData = static_cast<TBool>(aShowData);
const TDesC* sec = static_cast<const TDesC*>(&securityElementPrompt);
- LOG(ESATSA, EInfo, "CSTSSignatureService::StaticAuthenticateL: After convertions,going to call CallMethodL");
TRAPD(err, CallMethodL(*aRetVal, service,
&CSTSSignatureService::AuthenticateL, desToAuthenticate, aOptions,
*nativeCaNames, *sec, ShowData, service));
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::StaticAuthenticateL:After CallmethodL");
- LOG(ESATSA, EInfo, "-- return CSTSSignatureService::StaticAuthenticateL");
return err;
}
@@ -216,15 +207,12 @@
HBufC8* CSTSSignatureService::SignL(const TDesC8& aBytesToSign, TInt aOptions,
const CDesCArray& aCaNames, const TDesC& aSecurityElementPrompt)
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::SignL");
if (iState != EReady)
{
ELOG(ESATSA, "CSTSSignatureService::SignL: Not Ready");
User::Leave(KErrNotReady);
}
- LOG(ESATSA, EInfo, "CSTSSignatureService::SignL: start convertions!");
- LOG(ESATSA, EInfo, "CSTSSignatureService::SignL: After convertions");
// convert text from UTF8
HBufC* textToDisplay = ConvertUTF8ToUnicodeL(aBytesToSign);
delete iTextToDisplay;
@@ -238,12 +226,10 @@
iShowNotes = ETrue;
- LOG(ESATSA, EInfo, "CSTSSignatureService::SignL: Before call to CreateSignatureL");
// get handles to applicable certificates
HBufC8* retVal = CreateSignatureL(aCaNames, EX509UsageNonRepudiation,
aSecurityElementPrompt);
- LOG(ESATSA, EInfo, "-- return CSTSSignatureService::SignL");
return retVal;
}
@@ -256,13 +242,12 @@
CSTSSignatureService* service, jbyteArray aBytesToSign, jint aOptions,
jobjectArray aCaNames, jstring aSecurityElementPrompt, HBufC8** aRetVal)
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::StaticSignL");
const TInt byteArrayLength = aJniEnv->GetArrayLength(aBytesToSign);
jbyte* bytesToSign = aJniEnv->GetByteArrayElements(aBytesToSign, NULL);
if (!bytesToSign)
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::StaticSignL: No memory");
+ ELOG(ESATSA, "CSTSSignatureService::StaticSignL: No memory");
return NULL;
}
@@ -273,15 +258,12 @@
const JStringUtils securityElementPrompt(*aJniEnv, aSecurityElementPrompt);
- LOG(ESATSA, EInfo, "CSTSSignatureService::StaticSignL: Start convertions");
- LOG(ESATSA, EInfo, "CSTSSignatureService::StaticSignL: Before callmethodl");
-
+
const TDesC* sec = static_cast<const TDesC*>(&securityElementPrompt);
TRAPD(err, CallMethodL(*aRetVal, service, &CSTSSignatureService::SignL,
desToSign, aOptions, *nativeCaNames, *sec, service));
- LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::StaticSignL");
return err;
}
@@ -292,28 +274,25 @@
//
void CSTSSignatureService::RunL()
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::RunL");
if (iStatus == KErrCancel)
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: KErrCancel");
if (iShowNotes)
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: ShowNote");
iState = EFinalNote;
iStatus = KErrNone;
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
iPKIDialog->Note(MPKIDialog::ESigningCancelled, iStatus);
+#endif
SetActive();
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: Done ShowNote");
- }
+ }
else
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: Complete");
- Complete(KErrNone);
+ Complete(KErrNone);
}
}
else if (iStatus != KErrNone)
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: Error occured");
+ ELOG(ESATSA, "CSTSSignatureService::RunL: Error occured");
// Error has occured; inform java
Complete(iStatus.Int());
}
@@ -323,29 +302,23 @@
{
case EInitialising:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EInitialising");
iState = EKeyStoreInit;
iKeyStore->Initialize(iStatus);
SetActive();
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case EInitialising");
break;
}
case EKeyStoreInit:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EKeyStoreInit");
Complete(KErrNone);
break;
}
case EListing:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EListing");
HandlesFromCertInfosL();
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case EListing");
break;
}
case EDialog:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EDialog");
iState = EGetCert;
if (iCertificate)
{
@@ -360,12 +333,10 @@
iCertStore->GetCert(iCertificate, iCertificateHandle, iStatus);
SetActive();
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case EDialog");
break;
}
case EGetCert:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EGetCert");
if (iX509Certificate)
{
delete iX509Certificate;
@@ -374,44 +345,35 @@
iState = ERetrieveCert;
iCertStore->Retrieve(*iCertificate, iX509Certificate, iStatus);
SetActive();
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case EGetCert");
break;
}
case ERetrieveCert:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case ERetrieveCert");
FindKeyL();
break;
}
case EFindKey:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EFindKey");
OpenSignerL();
break;
}
case EOpenSigner:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EOpenSigner");
SignL();
break;
}
case ESign:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case ESign");
CreateSignedDataL();
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case ESign");
break;
}
case EFinalNote:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case EFinalNote");
Complete(KErrNone);
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: over case EFinalNote");
break;
}
default:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::RunL: case default");
Complete(KErrGeneral);
}
}
@@ -425,7 +387,6 @@
//
TInt CSTSSignatureService::RunError(TInt aError)
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::RunError");
Complete(aError);
return KErrNone;
}
@@ -524,8 +485,9 @@
{
User::LeaveIfError(iFileServer.Connect());
iDialog = SecurityDialogFactory::CreateL();
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
iPKIDialog = PKIDialogFactory::CreateNoteL();
-
+#endif
iFilter = CCertAttributeFilter::NewL();
iWait = new(ELeave) CActiveSchedulerWait;
@@ -542,7 +504,6 @@
//
void CSTSSignatureService::Complete(TInt aError)
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::Complete");
if (KErrNone == aError)
{
iState = EReady;
@@ -553,7 +514,7 @@
iError = aError;
}
iWait->AsyncStop();
- LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::Complete");
+
}
// -----------------------------------------------------------------------------
@@ -563,17 +524,14 @@
//
void CSTSSignatureService::WaitForCompletionL()
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::WaitForCompletionL");
SetActive();
iWait->Start();
if (iState != EReady)
{
// we need to be ready for the next request
iState = EReady;
-
User::Leave(iError);
}
- LOG(ESATSA, EInfo, "- ret CSTSSignatureService::WaitForCompletionL");
}
// -----------------------------------------------------------------------------
@@ -584,7 +542,6 @@
HBufC8* CSTSSignatureService::CreateSignatureL(const CDesCArray& aCaNames,
const TKeyUsageX509 aUsage, const TDesC& aSecurityElementPrompt)
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::CreateSignatureL");
HBufC* sePrompt = NULL;
if (aSecurityElementPrompt != KNullDesC())
{
@@ -592,14 +549,10 @@
}
delete iSecurityElementPrompt;
iSecurityElementPrompt = sePrompt;
- LOG(ESATSA, EInfo, "CSTSSignatureService::CreateSignatureL: call findcertificates");
FindCertificatesL(aCaNames, aUsage);
- LOG(ESATSA, EInfo, "CSTSSignatureService::CreateSignatureL: After call to findcertificates");
WaitForCompletionL();
- LOG(ESATSA, EInfo, "CSTSSignatureService::CreateSignatureL: call WaitForCompletion");
HBufC8* retVal = iSignature;
iSignature = NULL;
- LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::CreateSignatureL");
return retVal;
}
// -----------------------------------------------------------------------------
@@ -611,7 +564,6 @@
const TKeyUsageX509 aUsage)
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::FindCertificatesL");
iFilter->SetKeyUsage(aUsage);
iFilter->SetOwnerType(EUserCertificate);
iFilter->SetFormat(EX509Certificate);
@@ -654,7 +606,7 @@
iState = EListing;
iCertStore->List(iCertInfos, *iFilter, iDERNames, iStatus);
}
- LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::FindCertificatesL");
+
}
// -----------------------------------------------------------------------------
@@ -664,7 +616,6 @@
//
void CSTSSignatureService::HandlesFromCertInfosL()
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::HandlesFromCertInfosL");
TInt certificateCount = iCertInfos.Count();
if (certificateCount == 0)
{
@@ -675,7 +626,6 @@
iCertificateArray.Reset();
for (TInt i = 0; i < certificateCount; i++)
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::HandlesFromCertInfosL: No Certificates");
User::LeaveIfError(iCertificateArray.Append(iCertInfos[i]->Handle()));
}
@@ -684,18 +634,18 @@
{
case EAuthWithoutText:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: case EAuthWithoutText");
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
iPKIDialog->UserAuthentication(iCertificateArray, iCertificateHandle,
iStatus);
- LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: over case EAuthWithoutText");
+#endif
break;
}
case EAuthWithText:
{
- LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: case EAuthWithText");
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
iPKIDialog->UserAuthenticationText(*iTextToDisplay, iCertificateArray,
iCertificateHandle, iStatus);
- LOG(ESATSA, EInfo, "CSTSSignatureService::HandlesFromCertInfosL: over case EAuthWithText");
+#endif
break;
}
case ESignWithText:
@@ -721,7 +671,6 @@
//
void CSTSSignatureService::FindKeyL()
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::FindKeyL");
iKeyFilter.iKeyAlgorithm = CKeyInfoBase::EInvalidAlgorithm;
iKeyFilter.iKeyId = iCertificate->SubjectKeyId();
@@ -740,7 +689,6 @@
//
void CSTSSignatureService::OpenSignerL()
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::OpenSignerL");
// if key is not found, display security element prompt and search again
if (iKeys.Count() == 0)
{
@@ -803,8 +751,6 @@
//
void CSTSSignatureService::SignL()
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::SignL");
-
// first we create a digest of the message
CSHA1* sha = CSHA1::NewL();
@@ -892,7 +838,6 @@
//
void CSTSSignatureService::CreateSignedDataL()
{
- LOG(ESATSA, EInfo, "+ CSTSSignatureService::CreateSignedDataL");
CCTKeyInfo* keyInfo = iKeys[0];
HBufC8* signature = NULL;
@@ -987,14 +932,16 @@
if (iShowNotes)
{
iState = EFinalNote;
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
iPKIDialog->Note(MPKIDialog::ESignatureDone, iStatus);
+#endif
SetActive();
}
else
{
Complete(KErrNone);
}
- LOG(ESATSA, EInfo, "-- ret CSTSSignatureService::CreateSignedDataL");
+
}
// -----------------------------------------------------------------------------
--- a/javaextensions/satsa/pki/src.s60/cstssignatureservice.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/satsa/pki/src.s60/cstssignatureservice.h Thu Aug 19 09:48:13 2010 +0300
@@ -19,19 +19,18 @@
#ifndef CSTSSIGNATURESERVICE_H
#define CSTSSIGNATURESERVICE_H
-// INCLUDES
+
+
#include <e32base.h>
#include <badesca.h>
#include <mctkeystore.h>
#include "functionserver.h"
-// CONSTANTS
-
-
-
// FORWARD DECLARATIONS
class MSecurityDialog;
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
class MPKIDialog;
+#endif
class CUnifiedCertStore;
class CUnifiedKeyStore;
class CCTCertInfo;
@@ -266,8 +265,10 @@
// security dialog, owned
MSecurityDialog* iDialog;
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
// PKI Dialog, owned
MPKIDialog* iPKIDialog;
+#endif
// certificate store, owned
CUnifiedCertStore* iCertStore;
--- a/javaextensions/sensor/build/javasensor_0x2002DCD0.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/sensor/build/javasensor_0x2002DCD0.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javasensor.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javaextensions/sensor/src.s60/cacceleratorsensor.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/sensor/src.s60/cacceleratorsensor.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -297,7 +297,6 @@
void CAcceleratorSensor::OpenChannelL()
{
- TInt err;
JELOG2(ESensor);
LOG(ESensor,EInfo,"Creating Open Channel");
iChannel->OpenChannelL();
@@ -306,9 +305,9 @@
iScaleFactor = 1;
TInt format(ESensrvChannelDataFormatAbsolute);
TSensrvProperty property;
- TRAP(err,iChannel->GetPropertyL(KSensrvPropIdChannelDataFormat, KSensrvItemIndexNone,
- property););
- LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() One = %d",err);
+ iChannel->GetPropertyL(KSensrvPropIdChannelDataFormat, KSensrvItemIndexNone,
+ property);
+
if (property.PropertyType() == ESensrvIntProperty)
{
@@ -328,19 +327,17 @@
// Scaled value maximum
TSensrvProperty property_scaled;
TInt maxScaled(0);
- TRAP(err,iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone,
- property_scaled););
- LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() Two = %d",err);
+ iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone,
+ property_scaled);
+
if (property_scaled.GetArrayIndex() == ESensrvArrayPropertyInfo)
{
LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::If");
//for 2G Accelerometer Sensor index value is 0.
TInt rangeIndex(0);
- TRAP(err,iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone,
- rangeIndex, property_scaled););
- LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() Three = %d",err);
-
+ iChannel->GetPropertyL(KSensrvPropIdScaledRange, KSensrvItemIndexNone,
+ rangeIndex, property_scaled);
property_scaled.GetMaxValue(maxScaled);
LOG1(ESensor,EInfo,"property_scaled::maxValue = %d",maxScaled);
@@ -353,36 +350,32 @@
}
// MeasureRange can be an array property
TReal maxMeasure;
- TInt err1;
+
TSensrvProperty property_Measured;
- TRAP(err1,iChannel->GetPropertyL(KSensrvPropIdMeasureRange, KSensrvItemIndexNone,
- property_Measured););
- LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() Four = %d",err1);
+ iChannel->GetPropertyL(KSensrvPropIdMeasureRange, KSensrvItemIndexNone,
+ property_Measured);
+
+ TInt arrayIndex = property_Measured.GetArrayIndex();
+ LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::KSensrvPropIdMeasureRange::arrayIndex = %d",arrayIndex);
- if (err1 == KErrNone)
+ if (property_Measured.GetArrayIndex() == ESensrvArrayPropertyInfo)
{
- TInt arrayIndex = property_Measured.GetArrayIndex();
- LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::KSensrvPropIdMeasureRange::arrayIndex = %d",arrayIndex);
-
- if (property_Measured.GetArrayIndex() == ESensrvArrayPropertyInfo)
- {
- LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::If");
+ LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::If");
- TInt index2g = 0;
- LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::Getting RangeIndex = %f",index2g);
- //We need to TypeCast variable rangeIndex to TInt for
- TRAP(err,iChannel->GetPropertyL(KSensrvPropIdMeasureRange, KSensrvItemIndexNone,
- index2g, property_Measured););
- LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::GetPropertyL() Five = %d",err);
- property_Measured.GetMaxValue(maxMeasure);
- }
- else
- {
- LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::else");
- property_Measured.GetMaxValue(maxMeasure);
- }
+ TInt index2g = 0;
+ LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::Getting RangeIndex = %f",index2g);
+ //We need to TypeCast variable rangeIndex to TInt for
+ iChannel->GetPropertyL(KSensrvPropIdMeasureRange, KSensrvItemIndexNone,
+ index2g, property_Measured);
+ property_Measured.GetMaxValue(maxMeasure);
+ }
+ else
+ {
+ LOG(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::else");
+ property_Measured.GetMaxValue(maxMeasure);
+ }
- }
+
iScaleFactor = maxMeasure / maxScaled ;
LOG1(ESensor,EInfo,"CAcceleratorSensor::OpenChannelL()::iScaleFactor = %f",iScaleFactor);
}
--- a/javaextensions/sensor/src.s60/cacceleratorsensorrawdata.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/sensor/src.s60/cacceleratorsensorrawdata.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -97,6 +97,18 @@
TSensrvProperty property;
TInt intValue(0);
GetProperty(aList, KSensrvPropIdScaledRange,KSensrvItemIndexNone, property);
+
+ if ((property.GetArrayIndex() == ESensrvArrayPropertyInfo)&&
+ (property.PropertyType() == ESensrvIntProperty))
+ {
+ // Read index
+ TInt rangeIndex = 0;
+
+ // Read actual property data from array
+ GetProperty(aList, KSensrvPropIdScaledRange,
+ KSensrvItemIndexNone, rangeIndex, property);
+ }
+
if (property.PropertyType() == ESensrvIntProperty)
{
aPtr->Append(KMeasureRangeCount);
--- a/javaextensions/sensor/src.s60/csensorbase.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/sensor/src.s60/csensorbase.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -139,7 +139,14 @@
void CSensorBase::AsyncCallback(TMethod aMethod)
{
JELOG2(ESensor);
- iMethodArray.Append(aMethod);
+ TInt err = iMethodArray.Append(aMethod);
+ // if there was error when adding the method to array then just return
+ if ( err )
+ {
+ ELOG2(ESensor, "CSensorBase::AsyncCallback - Error (code = %d) when "
+ "adding method (type = %d) to method buffer.", err, aMethod.iMethodType);
+ return;
+ }
// If there is old request ongoing, wait it for completion
if (iMethodArray.Count() > 1)
--- a/javaextensions/webservices/build/javawebservices_0x2002DCDB.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/webservices/build/javawebservices_0x2002DCDB.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javawebservices.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javaextensions/wma/mms/build/javawmamms_0x2002DCDD.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/mms/build/javawmamms_0x2002DCDD.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javawmamms.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javaextensions/wma/mms/pushplugin/build/eabi/javammsscpluginu.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/mms/pushplugin/build/eabi/javammsscpluginu.def Thu Aug 19 09:48:13 2010 +0300
@@ -24,4 +24,11 @@
_ZThn28_N4java3wma22S60MmsServerConnection9setFilterERKSbIwSt11char_traitsIwESaIwEE @ 23 NONAME ; #<thunk>#
_ZThn28_NK4java3wma22S60MmsServerConnection6getUriEv @ 24 NONAME ; #<thunk>#
_ZThn28_NK4java3wma22S60MmsServerConnection9getFilterEv @ 25 NONAME ; #<thunk>#
+ _ZN4java3wma22S60MmsServerConnection5closeEv @ 26 NONAME
+ _ZThn28_N4java3wma22S60MmsServerConnection5closeEv @ 27 NONAME
+ _ZN4java3wma22S60MmsServerConnectionD0Ev @ 28 NONAME
+ _ZN4java3wma22S60MmsServerConnectionD1Ev @ 29 NONAME
+ _ZN4java3wma22S60MmsServerConnectionD2Ev @ 30 NONAME
+ _ZThn28_N4java3wma22S60MmsServerConnectionD0Ev @ 31 NONAME
+ _ZThn28_N4java3wma22S60MmsServerConnectionD1Ev @ 32 NONAME
--- a/javaextensions/wma/mms/pushplugin/build/javammsscplugin_0x2002DCC1.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/mms/pushplugin/build/javammsscplugin_0x2002DCC1.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javammsscplugin.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/mms/pushplugin/src.s60/s60mmsserverconnection.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -55,7 +55,7 @@
return mmsConn;
}
-S60MmsServerConnection::~S60MmsServerConnection()
+OS_EXPORT S60MmsServerConnection::~S60MmsServerConnection()
{
JELOG2(EWMA);
delete mOpenMonitor;
@@ -270,7 +270,7 @@
return mFilter;
}
-void S60MmsServerConnection::close()
+OS_EXPORT void S60MmsServerConnection::close()
{
JELOG2(EWMA);
// the close and RunL are synchronized to make it SMP safe.
--- a/javaextensions/wma/mms/src.s60/cjavammsmessagehandler.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/mms/src.s60/cjavammsmessagehandler.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -790,8 +790,6 @@
{
// get cc length
aHeaderLengths[KCcFieldIndex] = ReadIntL(aReadStream);
- if (div == 0)
- break;
mmsMap = div;
}
break;
--- a/javaextensions/wma/sms_cbs/build/javawma_0x2002DCDC.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/sms_cbs/build/javawma_0x2002DCDC.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javawma.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/smscbs/utils/WmaUrl.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/sms_cbs/javasrc/com/nokia/mj/impl/smscbs/utils/WmaUrl.java Thu Aug 19 09:48:13 2010 +0300
@@ -95,7 +95,7 @@
int index = iAbsoluteUri.indexOf("://");
int nameLength = iAbsoluteUri.length();
if ((index == -1) || (index != iAbsoluteUri.indexOf(':'))
- || ((index + 3) > nameLength))
+ || ((index + 3) >= nameLength))
{
throw new IllegalArgumentException(INVALID_URL.concat(iAbsoluteUri));
}
--- a/javaextensions/wma/sms_cbs/pushplugin/cbs/build/eabi/javacbsscpluginu.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/sms_cbs/pushplugin/cbs/build/eabi/javacbsscpluginu.def Thu Aug 19 09:48:13 2010 +0300
@@ -24,4 +24,16 @@
_ZTVN4java3wma19CbsServerConnectionE @ 23 NONAME ; #<VT>#
_ZTVN4java3wma20ServerConnectionBaseE @ 24 NONAME ; #<VT>#
_ZThn28_N4java3wma19CbsServerConnection4openEPNS_4push18ConnectionListenerE @ 25 NONAME ; #<thunk>#
+ _ZN4java3wma19CbsServerConnection15retrieveMessageER8TPckgBufI22TJavaMessageParametersE @ 26 NONAME
+ _ZN4java3wma19CbsServerConnection4openEPNS_4push18ConnectionListenerEb @ 27 NONAME
+ _ZN4java3wma19CbsServerConnection5closeEv @ 28 NONAME
+ _ZN4java3wma19CbsServerConnectionD0Ev @ 29 NONAME
+ _ZN4java3wma19CbsServerConnectionD1Ev @ 30 NONAME
+ _ZN4java3wma19CbsServerConnectionD2Ev @ 31 NONAME
+ _ZThn28_N4java3wma19CbsServerConnection15retrieveMessageER8TPckgBufI22TJavaMessageParametersE @ 32 NONAME
+ _ZThn28_N4java3wma19CbsServerConnection4openEPNS_4push18ConnectionListenerEb @ 33 NONAME
+ _ZThn28_N4java3wma19CbsServerConnection5closeEv @ 34 NONAME
+ _ZThn28_N4java3wma19CbsServerConnectionD0Ev @ 35 NONAME
+ _ZThn28_N4java3wma19CbsServerConnectionD1Ev @ 36 NONAME
+
--- a/javaextensions/wma/sms_cbs/pushplugin/cbs/build/javacbsscplugin_0x2002DCA4.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/sms_cbs/pushplugin/cbs/build/javacbsscplugin_0x2002DCA4.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javacbsscplugin.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javaextensions/wma/sms_cbs/pushplugin/cbs/src.s60/cbsserverconnection.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/sms_cbs/pushplugin/cbs/src.s60/cbsserverconnection.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -58,7 +58,7 @@
return cbsConn;
}
-CbsServerConnection::~CbsServerConnection()
+OS_EXPORT CbsServerConnection::~CbsServerConnection()
{
JELOG2(EWMA);
removeDir(mMessageStoreDirName);
@@ -128,7 +128,7 @@
}
}
-void CbsServerConnection::open(ConnectionListener* aListener,
+OS_EXPORT void CbsServerConnection::open(ConnectionListener* aListener,
bool aIsAppLaunched)
{
JELOG2(EWMA);
@@ -282,7 +282,7 @@
}
}
-int CbsServerConnection::retrieveMessage(TJavaMessageParametersBuf& aCbsBuf)
+OS_EXPORT int CbsServerConnection::retrieveMessage(TJavaMessageParametersBuf& aCbsBuf)
{
JELOG2(EWMA);
TCBSParametersBuf cbsParametersBuf;
@@ -328,7 +328,7 @@
}
-void CbsServerConnection::close()
+OS_EXPORT void CbsServerConnection::close()
{
JELOG2(EWMA);
// the close and RunL are synchronized to make it SMP safe.
@@ -524,7 +524,7 @@
}
// Store the received page number, such that the message can
// be reconstructed in the correct order later
- mCbsMessagePagesRef.Append(currentPage);
+ mCbsMessagePagesRef.AppendL(currentPage);
// Store the actual content of the message
mCbsMessagePagesData->AppendL(messageData);
--- a/javaextensions/wma/sms_cbs/pushplugin/sms/build/eabi/javasmsscpluginu.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/sms_cbs/pushplugin/sms/build/eabi/javasmsscpluginu.def Thu Aug 19 09:48:13 2010 +0300
@@ -10,23 +10,28 @@
_ZN26SmsServerConnectionFactoryD2Ev @ 9 NONAME
_ZN4java3wma19SmsServerConnection15retrieveMessageER8TPckgBufI22TJavaMessageParametersE @ 10 NONAME
_ZN4java3wma19SmsServerConnection4openEPNS_4push18ConnectionListenerE @ 11 NONAME
- _ZN4java3wma19SmsServerConnectionC1ERKSbIwSt11char_traitsIwESaIwEES7_ @ 12 NONAME
- _ZN4java3wma19SmsServerConnectionC2ERKSbIwSt11char_traitsIwESaIwEES7_ @ 13 NONAME
- _ZN4java3wma19SmsServerConnectionD0Ev @ 14 NONAME
- _ZN4java3wma19SmsServerConnectionD1Ev @ 15 NONAME
- _ZN4java3wma19SmsServerConnectionD2Ev @ 16 NONAME
- _ZN4java3wma20ServerConnectionBase9setFilterERKSbIwSt11char_traitsIwESaIwEE @ 17 NONAME
- _ZNK4java3wma20ServerConnectionBase18getMessagesOnStoreEv @ 18 NONAME
- _ZNK4java3wma20ServerConnectionBase6getUriEv @ 19 NONAME
- _ZNK4java3wma20ServerConnectionBase9getFilterEv @ 20 NONAME
- _ZTI26SmsServerConnectionFactory @ 21 NONAME ; #<TI>#
- _ZTIN4java3wma19SmsServerConnectionE @ 22 NONAME ; #<TI>#
- _ZTIN4java3wma20ServerConnectionBaseE @ 23 NONAME ; #<TI>#
- _ZTV26SmsServerConnectionFactory @ 24 NONAME ; #<VT>#
- _ZTVN4java3wma19SmsServerConnectionE @ 25 NONAME ; #<VT>#
- _ZTVN4java3wma20ServerConnectionBaseE @ 26 NONAME ; #<VT>#
- _ZThn28_N4java3wma19SmsServerConnection15retrieveMessageER8TPckgBufI22TJavaMessageParametersE @ 27 NONAME ; #<thunk>#
- _ZThn28_N4java3wma19SmsServerConnection4openEPNS_4push18ConnectionListenerE @ 28 NONAME ; #<thunk>#
- _ZThn28_N4java3wma19SmsServerConnectionD0Ev @ 29 NONAME ; #<thunk>#
- _ZThn28_N4java3wma19SmsServerConnectionD1Ev @ 30 NONAME ; #<thunk>#
+ _ZN4java3wma19SmsServerConnection4openEPNS_4push18ConnectionListenerEb @ 12 NONAME
+ _ZN4java3wma19SmsServerConnection5closeEv @ 13 NONAME
+ _ZN4java3wma19SmsServerConnectionC1ERKSbIwSt11char_traitsIwESaIwEES7_ @ 14 NONAME
+ _ZN4java3wma19SmsServerConnectionC2ERKSbIwSt11char_traitsIwESaIwEES7_ @ 15 NONAME
+ _ZN4java3wma19SmsServerConnectionD0Ev @ 16 NONAME
+ _ZN4java3wma19SmsServerConnectionD1Ev @ 17 NONAME
+ _ZN4java3wma19SmsServerConnectionD2Ev @ 18 NONAME
+ _ZN4java3wma20ServerConnectionBase9setFilterERKSbIwSt11char_traitsIwESaIwEE @ 19 NONAME
+ _ZNK4java3wma20ServerConnectionBase18getMessagesOnStoreEv @ 20 NONAME
+ _ZNK4java3wma20ServerConnectionBase6getUriEv @ 21 NONAME
+ _ZNK4java3wma20ServerConnectionBase9getFilterEv @ 22 NONAME
+ _ZTI26SmsServerConnectionFactory @ 23 NONAME
+ _ZTIN4java3wma19SmsServerConnectionE @ 24 NONAME
+ _ZTIN4java3wma20ServerConnectionBaseE @ 25 NONAME
+ _ZTV26SmsServerConnectionFactory @ 26 NONAME
+ _ZTVN4java3wma19SmsServerConnectionE @ 27 NONAME
+ _ZTVN4java3wma20ServerConnectionBaseE @ 28 NONAME
+ _ZThn28_N4java3wma19SmsServerConnection15retrieveMessageER8TPckgBufI22TJavaMessageParametersE @ 29 NONAME
+ _ZThn28_N4java3wma19SmsServerConnection4openEPNS_4push18ConnectionListenerE @ 30 NONAME
+ _ZThn28_N4java3wma19SmsServerConnection4openEPNS_4push18ConnectionListenerEb @ 31 NONAME
+ _ZThn28_N4java3wma19SmsServerConnection5closeEv @ 32 NONAME
+ _ZThn28_N4java3wma19SmsServerConnectionD0Ev @ 33 NONAME
+ _ZThn28_N4java3wma19SmsServerConnectionD1Ev @ 34 NONAME
+
--- a/javaextensions/wma/sms_cbs/pushplugin/sms/build/javasmsscplugin_0x2002DCD3.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/sms_cbs/pushplugin/sms/build/javasmsscplugin_0x2002DCD3.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javasmsscplugin.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.s60
--- a/javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaextensions/wma/sms_cbs/pushplugin/sms/src.s60/smsserverconnection.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -72,7 +72,7 @@
delete mOpenMonitor;
}
-void SmsServerConnection::open(ConnectionListener* aListener,
+OS_EXPORT void SmsServerConnection::open(ConnectionListener* aListener,
bool aIsAppLaunched)
{
JELOG2(EWMA);
@@ -211,6 +211,7 @@
mIoctlBuf() = KSockSelectRead;
mSocket.Ioctl(KIOctlSelect, iStatus, &mIoctlBuf, KSOLSocket);
SetActive();
+ pthread_mutex_unlock(&mMutex);
return;
}
switch (mState)
@@ -276,6 +277,7 @@
pthread_cond_signal(&mCondVar);
mIsRunning = EFalse;
CActiveScheduler::Stop();
+ break;
}
default:
{
@@ -299,7 +301,7 @@
}
-void SmsServerConnection::close()
+OS_EXPORT void SmsServerConnection::close()
{
JELOG2(EWMA);
// the close and RunL are synchronized to make it SMP safe.
--- a/javamanager/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -21,11 +21,12 @@
#include "preinstaller/build/bld.inf"
#include "debugapi/build/bld.inf"
#include "javalauncher/build/bld.inf"
+#include "javaupgradeapp/build/bld.inf"
#include "javacaptain/bld.inf"
#include "javainstaller/bld.inf"
#include "javaregistry/bld.inf"
#include "javabackup/bld.inf"
#include "javasettings/bld.inf"
+#include "javarecognizer/build/bld.inf"
#include "javasidchecker/build/bld.inf"
-#include "javarecognizer/build/bld.inf"
#include "javaappschemeplugin/build/bld.inf"
--- a/javamanager/debugapi/build/debugapi_0x2002DCAB.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/debugapi/build/debugapi_0x2002DCAB.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : debugapi.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javamanager/javaappschemeplugin/build/javaappschemeplugin.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaappschemeplugin/build/javaappschemeplugin.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -26,6 +26,12 @@
// Use bytepair compression to enable code paging
PAGED
+APP_LAYER_SYSTEMINCLUDE
+
+#ifndef RD_JAVA_S60_RELEASE_9_2
+SYSTEMINCLUDE /epoc32/include/ecom // Due to SchemeHandler.inl in 5.0 2009w18 and 10.1 builds
+#endif
+
SOURCEPATH ../src
SOURCE javaapphandler.cpp
@@ -37,9 +43,6 @@
USERINCLUDE ../inc
-SYSTEMINCLUDE /epoc32/include/ecom
-APP_LAYER_SYSTEMINCLUDE
-
LIBRARY euser.lib
LIBRARY ecom.lib
--- a/javamanager/javabackup/javabackupcore/build/javabackup.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javabackup/javabackupcore/build/javabackup.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -43,12 +43,14 @@
SOURCE jsbcactive.cpp
SOURCE jsbcdataowner.cpp
+#ifdef RD_JAVA_S60_RELEASE_5_0
+SYSTEMINCLUDE /epoc32/include/connect // Due to abclient.h in S60 5.0
+#endif
+
USERINCLUDE ../src.s60
USERINCLUDE ../../inc.s60
USERINCLUDE ../../../../inc
-SYSTEMINCLUDE /epoc32/include/connect
-
LIBRARY ecom.lib
LIBRARY abclient.lib
LIBRARY javastorage.lib
--- a/javamanager/javabackup/javabackupcore/src.s60/jsbcdataowner.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javabackup/javabackupcore/src.s60/jsbcdataowner.h Thu Aug 19 09:48:13 2010 +0300
@@ -19,7 +19,7 @@
#ifndef JSBCDATAOWNER_H
#define JSBCDATAOWNER_H
-#include <abclient.h>
+#include <connect/abclient.h>
namespace java
{
--- a/javamanager/javabackup/midp2backup/build/midp2backupplugin.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javabackup/midp2backup/build/midp2backupplugin.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -44,13 +44,12 @@
SOURCE apparcbackuputil.cpp
SOURCE javastoragebackuputil.cpp
SOURCE javaversionbackuputil.cpp
+SOURCE mediaidupdater.cpp
USERINCLUDE ../src.s60
USERINCLUDE ../../inc.s60
USERINCLUDE ../../../../inc
-SYSTEMINCLUDE /epoc32/include/connect
-
start resource ../data/10282474.rss
TARGET midp2backupplugin.rsc
end
@@ -64,6 +63,7 @@
LIBRARY apparc.lib
LIBRARY estlib.lib
LIBRARY javaenvinfo.lib
+LIBRARY javafileutils.lib
#if defined(WINSCW)
deffile ./bwins/backup.def
--- a/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javabackup/midp2backup/src.s60/javastoragebackuputil.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -19,6 +19,7 @@
#include "javastoragebackuputil.h"
#include "midp2backupplugin.h"
#include "midp2backupdataids.h"
+#include "mediaidupdater.h"
#include "javastorageentry.h"
#include "javastorage.h"
@@ -171,6 +172,10 @@
User::Leave(KErrGeneral);
}
+ // ensure that storage contains correct removable media ids
+ MediaIdUpdater updater;
+ updater.update();
+
// Storage restore is over; Set state to EAppArc
aRestoreState = EAppArc;
aBufferSpaceLeft = iBufferSpaceLeft;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup/src.s60/mediaidupdater.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,263 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MediaIdUpdater
+*
+*/
+
+
+#include <algorithm>
+#include <memory>
+
+#include "mediaidupdater.h"
+#include "logger.h"
+#include "javacommonutils.h"
+#include "driveutilities.h"
+#include "javastorageentry.h"
+#include "javastorage.h"
+#include "javastoragenames.h"
+
+using namespace java::backup;
+using namespace java::storage;
+using namespace java::util;
+
+
+MediaIdUpdater::MediaIdUpdater() : mStorage(0)
+{
+}
+
+MediaIdUpdater::~MediaIdUpdater()
+{
+ close();
+}
+
+/**
+* Ensures that java storage does not contain media ids that are not valid any more.
+* Media id updating is done in following steps:
+* - get media ids from storage
+* - get present (valid) media ids
+* - get difference between storage and present ids (result is invalid ids that need to be updated)
+* - update invalid media ids with valid ids
+* @param -
+* @return -
+*/
+void MediaIdUpdater::update()
+{
+ try
+ {
+ open();
+ std::set<std::wstring> storageIds = getMediaIdsFromStorage();
+ std::set<std::wstring> presentIds = getPresentMediaIds();
+
+ std::set<std::wstring> invalidIds = removePresentMediaIds(storageIds, presentIds);
+ std::set<std::wstring> validIds = getPresentRemovableDriveMediaIds();
+
+ if (isMediaIdUpdateNeeded(invalidIds, validIds))
+ {
+ updateMediaIds(invalidIds, validIds);
+ }
+ close();
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "MediaIdUpdater::update() failed: %S", jse.toString().c_str());
+ }
+}
+
+/**
+* Gets present media ids. Result includes phone, internal and mass memory drive ids if any
+* @param -
+* @return present media ids
+*/
+std::set<std::wstring> MediaIdUpdater::getPresentMediaIds()
+{
+ std::set<std::wstring> result;
+
+ java::fileutils::driveInfos drives;
+ java::fileutils::DriveUtilities::getAccesibleDrives(drives);
+
+ PLOG1(EBackup, "getPresentMediaIds(count=%d)", drives.size());
+ for (java::fileutils::driveInfos::const_iterator iter = drives.begin(); iter != drives.end(); iter++)
+ {
+ PLOG2(EBackup, " %S - id=%d", (*iter).iRootPath.c_str(), (*iter).iId);
+ std::wstring mediaId = JavaCommonUtils::intToWstring((*iter).iId);
+ result.insert(mediaId);
+ }
+
+ result.insert(L"0"); // default set by javainstaller for internal drives
+ return result;
+}
+
+/**
+* Gets present removable media ids. Result mass memory drive ids if any
+* @param -
+* @return present removable media ids
+*/
+std::set<std::wstring> MediaIdUpdater::getPresentRemovableDriveMediaIds()
+{
+ std::set<std::wstring> result;
+
+ java::fileutils::driveInfos drives;
+ java::fileutils::DriveUtilities::getAccesibleDrives(drives);
+
+ PLOG1(EBackup, "getPresentRemovableDriveMediaIds(count=%d)", drives.size());
+ for (java::fileutils::driveInfos::const_iterator iter = drives.begin(); iter != drives.end(); iter++)
+ {
+ if ((*iter).iIsRemovable)
+ {
+ PLOG2(EBackup, " %S - id=%d", (*iter).iRootPath.c_str(), (*iter).iId);
+ std::wstring mediaId = JavaCommonUtils::intToWstring((*iter).iId);
+ result.insert(mediaId);
+ }
+ }
+
+ return result;
+}
+
+/**
+* Filters present media ids from given set.
+* @param[in] aStorageIds original media ids
+* @param[in] aPresentIds present media ids
+* @return set of media ids that are invalid i.e. not present at the moment
+*/
+std::set<std::wstring> MediaIdUpdater::removePresentMediaIds(const std::set<std::wstring>& aStorageIds,
+ const std::set<std::wstring>& aPresentIds)
+{
+ std::set<std::wstring> result;
+
+ std::set_difference(aStorageIds.begin(), aStorageIds.end(),
+ aPresentIds.begin(), aPresentIds.end(),
+ std::inserter(result, result.end()));
+
+ return result;
+}
+
+/**
+* Checks if there is a need for updating given media ids
+* @param[in] aInvalidIds media ids to be updated
+* @param[in] aValidIds valid ids used during update
+* @return true, if media ids need to be updated, false otherwise
+*/
+bool MediaIdUpdater::isMediaIdUpdateNeeded(const std::set<std::wstring>& aInvalidIds,
+ const std::set<std::wstring>& aValidIds)
+{
+ if(aInvalidIds.size() > 0 && aValidIds.size() > 0)
+ {
+ return true;
+ }
+ return false;
+}
+
+/**
+* Gets media ids that can be found from java storage.
+* @param -
+* @return media ids found from java storage
+*/
+std::set<std::wstring> MediaIdUpdater::getMediaIdsFromStorage()
+{
+ std::set<std::wstring> result;
+
+ JavaStorageEntry attribute;
+ attribute.setEntry(MEDIA_ID, L"");
+
+ JavaStorageApplicationEntry_t findQuery;
+ findQuery.insert(attribute);
+
+ JavaStorageApplicationList_t foundEntries;
+
+ mStorage->search(APPLICATION_PACKAGE_TABLE, findQuery, foundEntries);
+ PLOG1(EBackup, "getMediaIdsFromStorage(count=%d)", foundEntries.size());
+ for (JavaStorageApplicationList_t::const_iterator iter = foundEntries.begin(); iter != foundEntries.end(); iter++)
+ {
+ std::wstring id = (*iter).begin()->entryValue();
+ PLOG1(EBackup, " id=%S", id.c_str());
+ result.insert(id);
+ }
+
+ return result;
+}
+
+/**
+* Updates given media ids with new values and saves the result in java storage.
+* @param[in] aInvalidIds media ids to be updated
+* @param[in] aValidIds valid ids used during update
+* @return -
+*/
+void MediaIdUpdater::updateMediaIds(const std::set<std::wstring>& aInvalidIds,
+ const std::set<std::wstring>& aValidIds)
+{
+ if (aValidIds.size() == 0)
+ {
+ return;
+ }
+ // use the first present media id for all
+ std::wstring newId = *(aValidIds.begin());
+
+ mStorage->startTransaction();
+
+ PLOG1(EBackup, "updateMediaIds(count=%d)", aInvalidIds.size());
+ for (std::set<std::wstring>::const_iterator iter = aInvalidIds.begin(); iter != aInvalidIds.end(); ++iter)
+ {
+ std::wstring origId = (*iter).c_str();
+ PLOG2(EBackup, " origId=%S - newId=%S", origId.c_str(), newId.c_str());
+
+ JavaStorageEntry attribute;
+ attribute.setEntry(MEDIA_ID, newId);
+
+ JavaStorageApplicationEntry_t updateEntry;
+ updateEntry.insert(attribute);
+
+ JavaStorageApplicationEntry_t matchEntry;
+ attribute.setEntry(MEDIA_ID, origId);
+ matchEntry.insert(attribute);
+
+ mStorage->update(APPLICATION_PACKAGE_TABLE, updateEntry, matchEntry);
+ }
+
+ mStorage->commitTransaction();
+}
+
+/**
+* Opens java storage connection
+* @param -
+* @return -
+*/
+void MediaIdUpdater::open()
+{
+ close();
+ mStorage = JavaStorage::createInstance();
+ mStorage->open(JAVA_DATABASE_NAME);
+}
+
+/**
+* Closes java storage connection
+* @param -
+* @return -
+*/
+void MediaIdUpdater::close()
+{
+ try
+ {
+ if (mStorage)
+ {
+ mStorage->close();
+ delete mStorage;
+ mStorage = 0;
+ }
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "MediaIdUpdater::close() failed: %S", jse.toString().c_str());
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup/src.s60/mediaidupdater.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: MediaIdUpdater
+*
+*/
+
+
+#ifndef MEDIAIDUPDATER_H
+#define MEDIAIDUPDATER_H
+
+#include <string>
+#include <set>
+
+namespace java
+{
+namespace storage
+{
+ class JavaStorage;
+}
+namespace backup
+{
+
+/**
+* MediaIdUpdater is responsible for ensuring that java storage contains
+* valid media ids after restore.
+* Media id may change in following situations:
+* - memory card is formatted between backup and restore
+* - another memory card is used during restore than originally
+*/
+
+class MediaIdUpdater
+{
+public:
+ MediaIdUpdater();
+ virtual ~MediaIdUpdater();
+
+ /**
+ * Updates media ids to valid values if needed
+ * Note: this method must be called after java storage is restored
+ */
+ virtual void update();
+
+protected:
+ virtual std::set<std::wstring> getPresentMediaIds();
+ virtual std::set<std::wstring> getPresentRemovableDriveMediaIds();
+ virtual std::set<std::wstring> removePresentMediaIds(const std::set<std::wstring>& aStorageIds,
+ const std::set<std::wstring>& aPresentIds);
+ virtual bool isMediaIdUpdateNeeded(const std::set<std::wstring>& aInvalidIds,
+ const std::set<std::wstring>& aValidIds);
+ virtual std::set<std::wstring> getMediaIdsFromStorage();
+ virtual void updateMediaIds(const std::set<std::wstring>& aInvalidIds,
+ const std::set<std::wstring>& aValidIds);
+
+ virtual void open();
+ virtual void close();
+
+ java::storage::JavaStorage* mStorage;
+};
+
+} // namespace backup
+} // namespace java
+
+#endif // MEDIAIDUPDATER_H
--- a/javamanager/javabackup/midp2backup/src.s60/midp2backupplugin.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javabackup/midp2backup/src.s60/midp2backupplugin.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -29,7 +29,7 @@
#include "javacommonutils.h"
#include "logger.h"
-#include <sbdefs.h>
+#include <connect/sbdefs.h>
#include <s32mem.h>
#include <s32file.h>
#include <f32file.h>
@@ -474,14 +474,14 @@
CleanupStack::PushL(fileMan);
// Copy to new place
- iFs.MkDir(path_new);
+ TInt err = iFs.MkDir(path_new);
+ ILOG2(EBackup, "MkDir, status: %d, path=%S", err, path_new.PtrZ());
+
path_old.Append(KStarWildCard);
- TInt err = fileMan->Copy(path_old, path_new);
+ err = fileMan->Copy(path_old, path_new);
ILOG1(EBackup, "File copy, status: %d", err);
- User::LeaveIfError(err);
-
CleanupStack::PopAndDestroy();
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/build/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,20 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: bld.inf file for Midp2BackupPlugin
+*
+*/
+
+
+PRJ_MMPFILES
+midp2backupplugin.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/build/bwins/backupu.def Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,2 @@
+EXPORTS
+ ?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/build/eabi/backupu.def Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,9 @@
+EXPORTS
+ _Z24ImplementationGroupProxyRi @ 1 NONAME
+ _ZTIN4java6backup17CAppArcBackupUtilE @ 2 NONAME
+ _ZTIN4java6backup18CMidp2BackupPluginE @ 3 NONAME
+ _ZTIN4java6backup18CStorageBackupUtilE @ 4 NONAME
+ _ZTVN4java6backup17CAppArcBackupUtilE @ 5 NONAME
+ _ZTVN4java6backup18CMidp2BackupPluginE @ 6 NONAME
+ _ZTVN4java6backup18CStorageBackupUtilE @ 7 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/build/midp2backupplugin.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Project definition file for MIDP2 Backup Plugin
+*
+*/
+
+
+#include <bldvariant.hrh>
+#include <data_caging_paths.hrh>
+#include <platform_paths.hrh>
+
+#include <../../../../inc/java_stdcpp_support_for_dll.hrh>
+#include <../../../../inc/project_defines.hrh>
+
+TARGET midp2backupplugin.dll
+TARGETTYPE plugin
+UID 0x10009D8D 0x10282474
+
+#ifdef RD_JAVA_S60_RELEASE_9_2_ONWARDS
+CAPABILITY CAP_ECOM_PLUGIN TrustedUI
+#else
+// SBE has lesser capability set on beta release.
+CAPABILITY CAP_ECOM_PLUGIN WriteDeviceData
+#endif
+
+VENDORID VID_DEFAULT
+
+PAGED
+
+SOURCEPATH ../src.s60
+SOURCE proxy.cpp
+SOURCE apparcbackuputil.cpp
+SOURCE javastoragebackuputil.cpp
+SOURCE javaversionbackuputil.cpp
+
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+SOURCE javascrbackuputil.cpp
+SOURCE midp2backuppluginusif.cpp
+#else
+SOURCE midp2backupplugin.cpp
+#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+
+USERINCLUDE ../src.s60
+USERINCLUDE ../../inc.s60
+USERINCLUDE ../../../../inc
+
+start resource ../data/10282474.rss
+TARGET midp2backupplugin.rsc
+end
+
+LIBRARY ecom.lib
+LIBRARY efsrv.lib
+LIBRARY javastorage.lib
+LIBRARY sysutil.lib
+LIBRARY apgrfx.lib
+LIBRARY apparc.lib
+LIBRARY estlib.lib
+LIBRARY javaenvinfo.lib
+LIBRARY estor.lib
+LIBRARY ipcstream.lib
+
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+LIBRARY scrclient.lib
+#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+
+#if defined(WINSCW)
+ deffile ./bwins/backup.def
+#else
+ deffile ./eabi/backup.def
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/data/10282474.rss Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,49 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Resource file for the Ecom plugin of Java Backup
+*
+*/
+
+
+#include <ecom/registryinfov2.rh>
+#include "javauids.h"
+
+// Declares info for one implementation
+RESOURCE REGISTRY_INFO theInfo
+{
+ resource_format_version = RESOURCE_FORMAT_VERSION_2;
+ // UID for the DLL
+ dll_uid = KBackupMidp2DllUid;
+ // Declare array of interface info
+ interfaces = {
+ INTERFACE_INFO
+ {
+ // UID of interface that is implemented
+ interface_uid = KBackupEcomIfUid;
+ implementations = {
+ // Info for CImplementation1
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = KBackupEcomImplUid;
+ version_no = 1;
+ display_name = "MIDP2 Backup Plugin";
+ default_data = "midp2";
+ opaque_data = "test_params";
+ rom_only = 0;
+ }
+ };
+ }
+ };
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/apparcbackuputil.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,550 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CAppArcBackupUtil
+*
+*/
+
+
+#include "apparcbackuputil.h"
+#include "javaapparcutil.h"
+
+#include "javasymbianoslayer.h"
+#include "javauid.h"
+#include "logger.h"
+#include "javacommonutils.h"
+#include "s60commonutils.h"
+
+#include <apgcli.h>
+#include <wchar.h>
+#include <s32mem.h>
+#include <sysutil.h>
+#include <f32file.h>
+
+#include <memory>
+#include <string>
+
+#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <apgicnfl.h>
+#else
+#include <apgicnflpartner.h>
+#endif
+
+
+using namespace std;
+using namespace java::storage;
+using namespace java::backup;
+
+const TUid KMidletApplicationTypeUid = { 0x10210E26 };
+_LIT(KDefaultFolder, "");
+
+// ======== MEMBER FUNCTIONS ========
+
+CAppArcBackupUtil::CAppArcBackupUtil()
+{
+ LOG(EBackup, EInfo, "CAppArcBackupUtil constructor");
+}
+
+void CAppArcBackupUtil::ConstructL(RFs& aFs)
+{
+ LOG(EBackup, EInfo, "CAppArcBackupUtil::ConstructL");
+
+ User::LeaveIfError(iApparcServer.Connect());
+
+ iNumberOfIcons = 0;
+ iFs = aFs;
+}
+
+
+CAppArcBackupUtil* CAppArcBackupUtil::NewL(RFs& aFs)
+{
+ LOG(EBackup, EInfo, "CAppArcBackupUtil::NewL");
+
+ CAppArcBackupUtil* self = new(ELeave) CAppArcBackupUtil();
+ CleanupStack::PushL(self);
+ self->ConstructL(aFs);
+ CleanupStack::Pop();
+
+ return self;
+}
+
+
+CAppArcBackupUtil::~CAppArcBackupUtil()
+{
+ LOG(EBackup, EInfo, "CAppArcBackupUtil destructor");
+
+ iApparcServer.Close();
+}
+
+
+void CAppArcBackupUtil::RegisterAppL(TPtr8& aRestoreIconPtr, TDriveNumber& aDrive)
+{
+ LOG(EBackup, EInfo, "CAppArcBackupUtil::RegisterApp");
+
+ RDesReadStream stream(aRestoreIconPtr);
+ CleanupClosePushL(stream);
+
+ // Read Uid
+ int midletUid = stream.ReadUint32L();
+
+ if (!CheckIfAlreadyRegisteredL(midletUid))
+ {
+ // Read filename
+ TInt32 fileNameSize = stream.ReadInt32L();
+ HBufC* fileName = HBufC::NewL(fileNameSize);
+ CleanupStack::PushL(fileName);
+ TPtr16 fileNamePtr = fileName->Des();
+ stream.ReadL(fileNamePtr, fileNameSize / 2); // half of size
+
+ // Read number of icons
+ TInt numberOfIcons = stream.ReadInt32L();
+// numberOfIcons = 1;
+ //LOG1(EBackup, EInfo, "Number of Icons = %d", numberOfIcons);
+
+ TInt groupNameSize = stream.ReadInt32L();
+ TBuf<KApaMaxAppGroupName> groupName;
+
+ if (groupNameSize != 0)
+ {
+ stream.ReadL(groupName, groupNameSize / 2);
+ }
+
+ // check disk space
+ TInt index = sizeof(TUint32) // midletUid
+ + sizeof(TInt32) // size of fileNameSize
+ + fileNameSize // size of filename
+ + sizeof(TInt32) // size of numberOfIcons
+ + sizeof(TInt32) // group name size
+ + groupNameSize; // groupname
+
+ if (SysUtil::DiskSpaceBelowCriticalLevelL(&iFs, aRestoreIconPtr.Size() - index, aDrive))
+ {
+ ELOG(EBackup, "Disk space below critical level. Leaving with KErrDiskFull.");
+ User::Leave(KErrDiskFull);
+ }
+
+ // Make directory if necessary
+ iFs.CreatePrivatePath(aDrive);
+
+ // Make full path of temporary icon file
+ TPath tempPath;
+ TPath tempPrivatePath;
+ iFs.PrivatePath(tempPrivatePath);
+
+ TDriveUnit* driveUnit = new(ELeave) TDriveUnit(aDrive);
+ CleanupStack::PushL(driveUnit);
+
+ tempPath.Append(driveUnit->Name().Left(1));
+ tempPath.Append(KDriveDelimiter);
+ tempPath.Append(tempPrivatePath);
+ tempPath.Append(fileNamePtr);
+
+ // Set private session path to point same drive where restoring
+ iFs.SetSessionToPrivate(aDrive);
+
+
+ RFile iconFile;
+ User::LeaveIfError(iconFile.Create(iFs, fileNamePtr, EFileWrite));
+
+ CleanupStack::PopAndDestroy(fileName);
+ CleanupClosePushL(iconFile);
+
+ iconFile.Write(aRestoreIconPtr.Mid(index));
+
+ // Register application
+ LOG1(EBackup,EInfo,"Registering app %d", midletUid);
+ TUid uid = TUid::Uid(midletUid);
+ TBuf<128> appName;
+ CJavaApparcUtil::AppName(uid, appName);
+
+ CApaRegistrationResourceFileWriter* writer =
+ CApaRegistrationResourceFileWriter::NewL(uid,
+ appName,
+ TApaAppCapability::ENonNative);
+ CleanupStack::PushL(writer);
+
+ const TInt KOpaqueDataLength = 4;
+ TBuf8<KOpaqueDataLength> opaqueData;
+ RDesWriteStream writeStream(opaqueData);
+ CleanupClosePushL(writeStream);
+
+ LOG(EBackup, EInfo, "Getting midlet entry");
+
+ JavaStorageApplicationEntry_t appEntries = StorageEntryL(uid);
+
+ if (appEntries.size() == 0)
+ {
+ ELOG(EBackup, "No midlet entry found in Java Storage; Mismatch between AppArc and Storage data. Abort backup");
+ User::Leave(KErrNotFound);
+ }
+
+ JavaStorageEntry attribute;
+ attribute.setEntry(NAME, L"");
+
+ // Get Name attribute from read attributes.
+ JavaStorageApplicationEntry_t::const_iterator findIterator = appEntries.find(attribute);
+ wstring midName;
+
+ if (findIterator != appEntries.end())
+ {
+ midName = (*findIterator).entryValue();
+
+ }
+ else
+ {
+ User::Leave(KErrBadHandle);
+ }
+
+ appEntries.clear();
+
+ HBufC* tempstr = java::util::S60CommonUtils::wstringToDes(midName.c_str());
+ TPtrC midletName = tempstr->Des();
+
+ if (groupNameSize != 0)
+ {
+ writer->SetGroupNameL(groupName);
+ }
+ else
+ {
+ writer->SetGroupNameL(KDefaultFolder);
+ }
+
+ writeStream.WriteUint32L(midletUid);
+ writeStream.CommitL();
+
+ LOG(EBackup, EInfo, "Setting opaque data");
+ writer->SetOpaqueDataL(opaqueData);
+
+ CApaLocalisableResourceFileWriter* lWriter =
+ CApaLocalisableResourceFileWriter::NewL(KNullDesC,
+ midletName,
+ numberOfIcons,
+ KNullDesC);
+ CleanupStack::PushL(lWriter);
+
+ // Prepare AppArc for deregistration
+ LOG(EBackup, EInfo, "PrepareNonNativeApplicationsUpdatesL");
+ iApparcServer.PrepareNonNativeApplicationsUpdatesL();
+
+ // Register application
+ LOG(EBackup, EInfo, "RegisterNonNativeApplicationL");
+ iApparcServer.RegisterNonNativeApplicationL(KMidletApplicationTypeUid,
+ aDrive,
+ *writer,
+ lWriter,
+ &iconFile);
+
+ // Commit registration changes
+ LOG(EBackup, EInfo, "CommitNonNativeApplicationsUpdatesL");
+ iApparcServer.CommitNonNativeApplicationsUpdatesL();
+
+ delete tempstr;
+ CleanupStack::PopAndDestroy(lWriter);
+ CleanupStack::PopAndDestroy(&writeStream);
+ CleanupStack::PopAndDestroy(writer);
+ iconFile.Close();
+ CleanupStack::PopAndDestroy(&iconFile);
+
+ TInt err = iFs.Delete(tempPath);
+ LOG1(EBackup, EInfo, "iFs.Delete err = %d", err);
+ CleanupStack::PopAndDestroy(driveUnit);
+ }
+
+ CleanupStack::PopAndDestroy(&stream);
+}
+
+
+void CAppArcBackupUtil::DeregisterAppsL(TDriveNumber aDrive)
+{
+ LOG1(EBackup, EInfo, "CAppArcBackupUtil::DeregisterApps, drive: %d", aDrive);
+
+ // Initialise the process of getting apps
+ iApparcServer.GetFilteredApps(TApaAppCapability::ENonNative,
+ TApaAppCapability::ENonNative);
+
+ // Getting the apps one-by-one
+ TApaAppInfo* info = new(ELeave) TApaAppInfo();
+ CleanupStack::PushL(info);
+
+ TUid typeUid;
+
+ // Prepare AppArc for deregistration
+ LOG(EBackup, EInfo, "PrepareNonNativeApplicationsUpdatesL");
+ iApparcServer.PrepareNonNativeApplicationsUpdatesL();
+
+ while (!iApparcServer.GetNextApp((*info)))
+ {
+ LOG1(EBackup, EInfo, "Getting Next App from AppArc, UID = %d", info->iUid);
+
+ // Getting the type of the application
+ iApparcServer.GetAppType(typeUid, info->iUid);
+
+ // If it's a MIDlet, check if it has an entry in Java Registry
+ TInt drive = 0;
+ GetDriveOfApp(info->iFullName, drive);
+
+ if (typeUid == KMidletApplicationTypeUid && drive == aDrive)
+ {
+ LOG1(EBackup, EInfo, "Checking registry, midlet id = %d", info->iUid);
+ wstring PackageID;
+ // If there's no entry on the drive, deregister it from AppArc
+ JavaStorageApplicationEntry_t appEntries = StorageEntryL(info->iUid);
+
+ if (appEntries.size() != 0)
+ {
+ JavaStorageEntry attribute;
+ attribute.setEntry(PACKAGE_ID, L"");
+
+ JavaStorageApplicationEntry_t::const_iterator findIterator = appEntries.find(attribute);
+
+ if (findIterator != appEntries.end())
+ {
+ PackageID = (*findIterator).entryValue();
+ }
+ else
+ {
+ User::Leave(KErrBadHandle);
+ }
+
+ if (GetDrivefromStorageL(PackageID) != aDrive)
+ {
+ iApparcServer.DeregisterNonNativeApplicationL(info->iUid);
+ LOG1(EBackup, EInfo, "Deregistering midlet id = %d", info->iUid);
+ }
+ }
+ else
+ {
+ LOG(EBackup, EInfo, "Midlet entry not found in Java Storage; Deregister the Application");
+ iApparcServer.DeregisterNonNativeApplicationL(info->iUid);
+ LOG1(EBackup, EInfo, "Deregistering midlet id = %d", info->iUid);
+ }
+ appEntries.clear();
+ }
+ }
+
+ // Commit registration changes
+ LOG(EBackup, EInfo, "CommitNonNativeApplicationsUpdatesL");
+ iApparcServer.CommitNonNativeApplicationsUpdatesL();
+ CleanupStack::PopAndDestroy(info);
+}
+
+
+void CAppArcBackupUtil::GetMidletsFromAppArcL(RArray<TUid>& aUidArray, TDriveNumber aDrive)
+{
+ LOG(EBackup, EInfo, "CAppArcBackupUtil::GetMidletsFromAppArc");
+ CleanupClosePushL(aUidArray);
+
+ // Initialise the process of getting apps
+ iApparcServer.GetFilteredApps(TApaAppCapability::ENonNative,
+ TApaAppCapability::ENonNative);
+
+ // Getting the apps one-by-one
+ TApaAppInfo* info = new(ELeave) TApaAppInfo();
+ CleanupStack::PushL(info);
+
+ TUid typeUid;
+ LOG1(EBackup, EInfo, "Drive Number aDrive = %d", aDrive);
+
+ while (!iApparcServer.GetNextApp((*info)))
+ {
+ // Getting the type of the application
+ iApparcServer.GetAppType(typeUid, info->iUid);
+
+ // If it's a MIDlet, check if it's registered to this drive
+ if (typeUid == KMidletApplicationTypeUid)
+ {
+ JavaStorageApplicationEntry_t appEntries = StorageEntryL(info->iUid);
+
+ if (appEntries.size() != 0)
+ {
+ JavaStorageEntry attribute;
+ attribute.setEntry(PACKAGE_ID, L"");
+
+ JavaStorageApplicationEntry_t::const_iterator findIterator = appEntries.find(attribute);
+ wstring PackageID;
+
+ if (findIterator != appEntries.end())
+ {
+ PackageID = (*findIterator).entryValue();
+
+ }
+ else
+ {
+ User::Leave(KErrBadHandle);
+ }
+ appEntries.clear();
+
+ if (GetDrivefromStorageL(PackageID) == aDrive)
+ {
+ aUidArray.AppendL(info->iUid);
+ iNumberOfIcons++;
+ }
+ }
+ else
+ {
+ ELOG(EBackup, "No entries from registry; midlet does not exist");
+ }
+ }
+ }
+ CleanupStack::PopAndDestroy(info);
+ CleanupStack::Pop();
+
+}
+
+
+void CAppArcBackupUtil::GetIconFilename(TUid aUid, HBufC*& aFullFileName)
+{
+ LOG(EBackup, EInfo, "CAppArcBackupUtil::GetIconFilename");
+
+ iApparcServer.GetAppIcon(aUid, aFullFileName);
+}
+
+TInt CAppArcBackupUtil::NumberOfIcons()
+{
+ LOG(EBackup, EInfo, "CAppArcBackupUtil::NumberOfIcons");
+
+ return iNumberOfIcons;
+}
+
+void CAppArcBackupUtil::NumberOfOwnDefinedIcons(TUid aUid, TInt& aIconCount)
+{
+ LOG(EBackup, EInfo, "CAppArcBackupUtil::NumberOfOwnDefinedIcons");
+
+ iApparcServer.NumberOfOwnDefinedIcons(aUid, aIconCount);
+}
+
+TBool CAppArcBackupUtil::CheckIfAlreadyRegisteredL(TInt& aUid)
+{
+ LOG(EBackup, EInfo, "CAppArcBackupUtil::CheckIfAlreadyRegisteredL");
+
+ TApaAppInfo* info = new(ELeave) TApaAppInfo();
+
+ TInt err = iApparcServer.GetAppInfo(*info, TUid::Uid(aUid));
+ delete info;
+ if (err == KErrNone)
+ {
+ return ETrue;
+ }
+ else
+ {
+ return EFalse;
+ }
+
+
+}
+
+void CAppArcBackupUtil::GetDriveOfApp(TFileName aPath, TInt& aDrive)
+{
+ LOG(EBackup, EInfo, "CAppArcBackupUtil::DriveOfApp");
+
+ iFs.CharToDrive(aPath[0], aDrive);
+}
+
+
+TApaAppGroupName CAppArcBackupUtil::GetMidletGroupName(TUid aUid)
+{
+ TApaAppCapabilityBuf cap;
+
+ TInt err = iApparcServer.GetAppCapability(cap, aUid);
+ return cap().iGroupName;
+}
+
+
+JavaStorageApplicationEntry_t CAppArcBackupUtil::StorageEntryL(const TUid& aMidletUID)
+{
+ auto_ptr<JavaStorage> js(JavaStorage::createInstance());
+
+ try
+ {
+ js->open(JAVA_DATABASE_NAME);
+ LOG(EBackup, EInfo, "Java database opened");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG(EBackup, "Opening database connection failed");
+ User::Leave(KErrNotFound);
+ }
+
+ JavaStorageApplicationEntry_t entries;
+
+ java::util::Uid appUid;
+ TUidToUid(aMidletUID, appUid);
+
+ try
+ {
+ js->read(APPLICATION_TABLE, appUid, entries);
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG(EBackup, "Read in Java Storage failed");
+ js->close();
+ User::Leave(KErrGeneral);
+ }
+ js->close();
+
+ return entries;
+}
+
+TDriveNumber CAppArcBackupUtil::GetDrivefromStorageL(wstring& aPackageID)
+{
+ wchar_t Drive;
+ auto_ptr<JavaStorage> js(JavaStorage::createInstance());
+
+ try
+ {
+ js->open(JAVA_DATABASE_NAME);
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG(EBackup, "Opening database connection failed");
+ User::Leave(KErrNotFound);
+ }
+
+ JavaStorageApplicationEntry_t entries;
+ java::util::Uid PackageID(aPackageID);
+
+ try
+ {
+ js->read(APPLICATION_PACKAGE_TABLE, PackageID, entries);
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG(EBackup, "Read in Java Storage failed");
+ js->close();
+ User::Leave(KErrGeneral);
+ }
+
+ js->close();
+
+ JavaStorageEntry attribute;
+ attribute.setEntry(ROOT_PATH, L"");
+
+ JavaStorageApplicationEntry_t::const_iterator findIterator = entries.find(attribute);
+ wstring RootPath;
+
+ if (findIterator != entries.end())
+ {
+ RootPath = (*findIterator).entryValue();
+
+ }
+ else
+ {
+ User::Leave(KErrBadHandle);
+ }
+
+ Drive = (wchar_t)RootPath[0];
+ LOG1(EBackup, EInfo, "Drive = %c", Drive);
+ TInt i = Drive - (wchar_t)'a';
+ LOG1(EBackup, EInfo, "Drive = %d", (TDriveNumber)i);
+ return (TDriveNumber)i;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/apparcbackuputil.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,186 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header file for CAppArcBackupUtil class
+*
+*/
+
+
+#ifndef APPARCBACKUPUTIL_H
+#define APPARCBACKUPUTIL_H
+
+#include <e32base.h>
+#include <apgcli.h>
+#include <apadef.h>
+
+#include "javastorage.h"
+#include "javastorageentry.h"
+#include "javastoragenames.h"
+
+namespace java
+{
+namespace backup
+{
+
+/**
+ * CAppArcBackupUtil class is handling AppArc registrations during backup
+ * and restore of Java Domain.
+ */
+class CAppArcBackupUtil : public CBase
+{
+
+public:
+
+ /**
+ * Instantiates an object of this type
+ */
+ static CAppArcBackupUtil* NewL(RFs& aFs);
+
+ ~CAppArcBackupUtil();
+
+ /**
+ * This method registers applications to AppArc during restore.
+ *
+ * @param restoreIconPtr the buffer which contains the Uid and the
+ * icon file to be restored
+ * @param aDrive current drive to be restored
+ */
+ void RegisterAppL(TPtr8& aRestoreIconPtr, TDriveNumber& aDrive);
+
+ /**
+ * This method deregisters leftover applications from AppArc during
+ * restore.
+ * @param aDrive current drive to be restored
+ */
+ void DeregisterAppsL(TDriveNumber aDrive);
+
+ /**
+ * This method builds an array of the registered apps in AppArc.
+ *
+ * @param [out] aUidArray array of Midlet uids
+ * @param aDrive current drive to be backed up
+ */
+ void GetMidletsFromAppArcL(RArray<TUid>& aUidArray, TDriveNumber aDrive);
+
+ /**
+ * This method looks up the icon filename of the given midlet
+ *
+ * @param aUid Uid of Midlet
+ * @param [out] aFullFilename filename of icon file
+ */
+ void GetIconFilename(TUid aUid, HBufC*& aFullFilename);
+
+ /**
+ * This method gets the number of MIDlet icons registered to AppArc
+ * restore.
+ *
+ * @return iNumberOfIcons
+ */
+ TInt NumberOfIcons();
+
+ /**
+ * Gets the number of icons defined for a midlet from AppArc
+ *
+ * @param aUid Midlet Id
+ * @param [out] aIconCount number of icons defined for the midlet
+ */
+ void NumberOfOwnDefinedIcons(TUid aUid, TInt& aIconCount);
+
+ /**
+ * Gets an entry from Java Storage for the midlet uid specified
+ *
+ * @param midletUid Uid of the midlet
+ *
+ * @return returns the entry of the midlet
+ */
+ java::storage::JavaStorageApplicationEntry_t StorageEntryL(const TUid& aMidletUID);
+
+ /**
+ * Gets the Drive of the midlet suite for the specified UID
+ *
+ * @param packageID the ID of the application package
+ *
+ * @return returns the drive number of the application package
+ */
+
+ TDriveNumber GetDrivefromStorageL(std::wstring& aPackageID);
+
+ /**
+ * Gets the group name of the midlet for the pecified UID
+ *
+ * @param aUid the UID of the midlet
+ *
+ * @return returns the group name of the midlet
+ */
+
+ TApaAppGroupName GetMidletGroupName(TUid aUid);
+
+private:
+
+ CAppArcBackupUtil();
+
+ void ConstructL(RFs& aFs);
+
+ /**
+ * Checks if midlet is already registered to AppArc.
+ *
+ * @param aUid Uid of Midlet
+ * @return ETrue if midlet is already registered to AppArc
+ */
+ TBool CheckIfAlreadyRegisteredL(TInt& aUid);
+
+ /**
+ * Gets the drive of the Midlet based on the path
+ *
+ * @param aPath Full path of Midlet
+ * @param [out] aDrive the drive where the midlet is registered to
+ */
+ void GetDriveOfApp(TFileName aPath, TInt& aDrive);
+
+ /**
+ * Gets the index of the midlet in its midlet suite
+ *
+ * @param aMidletSuiteEntry Midlet suite
+ * @param aUid Midlet Id
+ * @return index of midlet in the suite
+ */
+ //TInt MidletIndexL( CJavaRegistrySuiteEntry &aMidletSuiteEntry,
+ // TUid aUid );
+
+
+private: // data
+
+ /**
+ * File session
+ * Not own.
+ */
+ RFs iFs;
+
+ /**
+ * Number of MIDlet icons registered to AppArc
+ * Own.
+ */
+ TInt iNumberOfIcons;
+
+ /**
+ * ApparcSession
+ * Own.
+ */
+ RApaLsSession iApparcServer;
+
+};
+
+} //namespace backup
+} //namespace java
+
+#endif // APPARCBACKUPUTIL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/javaapparcutil.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CJavaApparcUtil definition.
+*
+*/
+
+
+#ifndef JAVAAPPARCUTIL_H
+#define JAVAAPPARCUTIL_H
+
+#include <e32base.h>
+
+namespace java
+{
+namespace backup
+{
+/**
+ * Common utilities for Apparc registration.
+ */
+class CJavaApparcUtil : public CBase
+{
+
+public:
+
+ /**
+ * Creates a reasonably unique executable name, since the UI Framework
+ * uses this as a key to look up the application opaque data.
+ *
+ * This name is not actually used to run the application, but it must
+ * look reasonably like an acceptable file name.
+ *
+ * @param aAppUid Uid of the application
+ * @param aAppName On return, it contains an unique executable name.
+ * Maximum length of this descriptor should be >= 20 or the function
+ * panics with USER 11.
+ */
+ static void inline AppName(const TUid aAppUid, TDes& aAppName);
+
+};
+
+} //namespace backup
+} //namespace java
+
+#include "javaapparcutil.inl"
+
+#endif // JAVAAPPARCUTIL_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/javaapparcutil.inl Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,29 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: CJavaApparcUtil inline functions definition
+*
+*/
+
+
+using namespace java::backup;
+
+inline void CJavaApparcUtil::AppName(const TUid aAppUid, TDes& aAppName)
+{
+ _LIT(KPathSeperator, "\\");
+ _LIT(KAppPostfix, ".fakeapp");
+ aAppName.Copy(KPathSeperator);
+ aAppName.AppendNum(aAppUid.iUid);
+ aAppName.Append(KAppPostfix);
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,1014 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CScrBackupUtil
+*
+*/
+
+#include "javascrbackuputil.h"
+#include "midp2backupdataids.h"
+
+#include "logger.h"
+#include "javasymbianoslayer.h" // for CleanupResetAndDestroyPushL
+
+#include <scs/nullstream.h>
+#include <e32cmn.h>
+#include <apaid.h> //for TApaAppCapability::ENonNative
+#include <e32def.h>
+
+using namespace java::backup;
+using namespace Usif;
+
+// Properties registered to SCR.
+_LIT(KMIDletName, "MIDlet-Name");
+_LIT(KUid, "Uid");
+_LIT(KMediaId, "Media-Id");
+_LIT(KMIDletInfoURL, "MIDlet-Info-URL");
+_LIT(KMIDletDescription, "MIDlet-Description");
+_LIT(KDownloadURL, "Download-URL");
+_LIT(KSettingsPlugin, "SettingsName");
+_LIT(KMIDletDeletionConformation, "MIDlet-Delete-Confirm");
+
+_LIT(KDomainCategory,"Domain-Category");
+
+
+CScrBackupUtil* CScrBackupUtil::NewL()
+ {
+ LOG(EBackup,EInfo," ---> CScrBackupUtil: NewL()");
+
+ CScrBackupUtil *self = CScrBackupUtil::NewLC();
+
+ CleanupStack::Pop(self);
+
+ LOG(EBackup,EInfo," <--- CScrBackupUtil: NewL()");
+ return self;
+ }
+
+
+CScrBackupUtil* CScrBackupUtil::NewLC()
+ {
+ LOG(EBackup,EInfo," ---> CScrBackupUtil: NewLC");
+ CScrBackupUtil *self = new(ELeave) CScrBackupUtil();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ LOG(EBackup,EInfo," <--- CScrBackupUtil: NewLC");
+ return self;
+ }
+
+CScrBackupUtil::CScrBackupUtil():iPtrToWriteBuffer(NULL,0)
+ {
+ LOG(EBackup,EInfo," ---> CScrBackupUtil: CScrBackupUtil");
+ LOG(EBackup,EInfo," <--- CScrBackupUtil: CScrBackupUtil");
+ }
+
+
+void CScrBackupUtil::ConstructL()
+ {
+ LOG(EBackup,EInfo," ---> CScrBackupUtil: ConstructL ");
+
+ //will be incremented as and when needed
+ iRemainingInfo = HBufC8::NewL(4096);//TODO :need to change it to the total size of the the attribute
+ //iPtrToWriteBuffer = ((const_cast<TUint8*>(iRemainingInfo->Ptr())));// need to do this coz when fun end and goes to fetch next 4096 bytes i lose it
+ iPtrToWriteBuffer.Set(iRemainingInfo->Des());
+ iIsFristCall = ETrue;
+
+ iState = EIsFetchCompleteInfo;
+ iIsToWriteInStream = ETrue;
+ LOG(EBackup,EInfo," <--- CScrBackupUtil: ConstructL()");
+ }
+void CScrBackupUtil::ConnectScrL()
+ {
+ LOG(EBackup,EInfo," ---> CScrBackupUtil: ConnectScrL()");
+ iScr = new RSoftwareComponentRegistry();
+ if (NULL == iScr)
+ {
+ ELOG(EBackup,"Creating RSoftwareComponentRegistry failed");
+ User::Leave(KErrGeneral);
+ }
+
+ TInt err = iScr->Connect();
+ if (KErrNone != err)
+ {
+ ELOG1(EBackup,"Connecting to RSoftwareComponentRegistry failed, error %d",err);
+ //TODO need to see can we afford leaving here ;)
+ User::Leave(err);
+ }
+ LOG(EBackup,EInfo," <--- CScrBackupUtil: ConnectScrL()");
+ }
+void CScrBackupUtil::ExtractUidAndComponentIdL(RArray<Usif::TComponentId>& componentIds,RArray<TInt>& uids,TInt& ComponentsCount)
+ {
+ LOG(EBackup,EInfo," ---> CScrBackupUtil: ExtractUidAndComponentId()");
+ CComponentFilter* filter;
+ CPropertyEntry* property;
+ filter = CComponentFilter::NewLC();
+ //Set the filter for software type Usif::KSoftwareTypeJava and ftech the Ids
+ filter->SetSoftwareTypeL(Usif::KSoftwareTypeJava);
+ TRAPD(error,iScr->GetComponentIdsL(componentIds,filter));
+ if(error)
+ {
+ ELOG(EBackup,"Failed to get the components ID");
+ }
+ CleanupStack::PopAndDestroy(filter);
+ // fetch the no. of component from the given RArray
+ ComponentsCount = componentIds.Count();
+ // No use of Component Ids as such as they are used by SCR internally
+ //so exctracted the UID of of each component
+ for(TInt i = 0 ;i < ComponentsCount ; i++)
+ {
+
+ property = iScr->GetComponentPropertyL(componentIds.operator [](i),KUid());
+ if (property->PropertyType() == CPropertyEntry::EIntProperty)
+ {
+ TInt uid = ((CIntPropertyEntry*)property)->IntValue();
+ uids.AppendL(uid);
+
+ }
+ else
+ {
+ //Error
+ }
+
+ delete property;
+ property = NULL;
+
+ }
+ LOG(EBackup,EInfo," <--- CScrBackupUtil: ExtractUidAndComponentId()");
+ }
+void CScrBackupUtil::BackupScrDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft)
+ {
+ LOG(EBackup,EInfo," ---> CScrBackupUtil: BackupScrDataL()");
+
+ iBufferSpaceLeft = aBufferSpaceLeft ;
+
+ if(iIsFristCall)
+ {
+
+ // to get no. of components need to keep a flag that its called only once
+ ConnectScrL();
+
+ ExtractUidAndComponentIdL(iComponentIds,iUids,iNumberOfComponents);
+
+ //write the no. of components so that it will help us in restoration time
+ aStream.WriteInt32L(iNumberOfComponents);
+ iBufferSpaceLeft -= sizeof(TInt32);
+
+ //all the ids of the midlets that are to be backedup and the size of the rarray with holds the Ids
+ TPckgBuf<RArray<TInt> > ids(iUids);
+ TInt size = ComputeSizeL(ids);
+ aStream.WriteInt32L(size);
+ iBufferSpaceLeft -= sizeof(TInt32);
+
+ aStream.WriteL(ids);
+
+ iBufferSpaceLeft = iBufferSpaceLeft - size;
+
+ iIsFristCall = EFalse;
+ }
+
+ for( i ; i < iComponentIds.Count() ;)
+ {
+ if(iState == EIsFetchCompleteInfo)
+ {
+
+ TInt at = iComponentIds.operator[](i);
+
+ //Temp stream in which all attributes are backed up
+ RDesWriteStream writeStream;
+ writeStream.Open(iPtrToWriteBuffer);
+
+ GetComponentInfoL(at,writeStream);
+
+ writeStream.CommitL();
+ iLengthOfString = iPtrToWriteBuffer.Length();
+
+ iWriteToStream = ETrue;
+
+ // write the size, Used while restoring
+ aStream.WriteInt32L(iLengthOfString);
+ iBufferSpaceLeft = iBufferSpaceLeft - sizeof(TInt);
+
+
+ }
+ if(iState == EIsWriteCompleteInfo)
+ {
+
+ //writing the remaining information into the new buffer
+ if(iBufferToWriteNextTime)
+ {
+ aStream.WriteL(iPtrToWriteBuffer,iRemainingBuffer);
+ aStream.CommitL();
+ LOG(EBackup, EInfo, "attributes written fully in the stream fetching for next component");
+
+ iBufferSpaceLeft = iBufferSpaceLeft - iRemainingBuffer;
+
+ iBufferToWriteNextTime = EFalse;
+ iState = EIsFetchCompleteInfo;
+
+ iLengthOfString = 0; // to maintain the loop
+
+ iWriteToStream = EFalse;
+ i++;
+ }
+ // if the whole string cannot be writen, write part of it
+ if (iLengthOfString > iBufferSpaceLeft && !iBufferToWriteNextTime)
+ {
+
+ iRemainingBuffer = iLengthOfString - iBufferSpaceLeft;
+
+ aStream.WriteL(iPtrToWriteBuffer,iBufferSpaceLeft);
+ aStream.CommitL();
+
+ iBufferToWriteNextTime = ETrue;
+ break;
+ }
+ // else write the complete string
+ else if(iWriteToStream)
+ { aStream.WriteL(iPtrToWriteBuffer,iLengthOfString);
+
+ aStream.CommitL();
+ iBufferSpaceLeft = iBufferSpaceLeft - iLengthOfString;
+ iState = EIsFetchCompleteInfo;
+ iLengthOfString = 0; // to maintain the loop
+ i++;
+ }
+
+ }
+ }
+ // making it false to backup next component next time
+ if(i >= iComponentIds.Count())
+ aBackupNotFinished = EFalse;
+
+ }
+
+template <typename T>
+TInt CScrBackupUtil::ComputeSizeL(const T &aObject)
+ {
+ LOG(EBackup,EInfo," ---> computeSize() ");
+ TInt size(0);
+ RNullWriteStream nullstream;
+ CleanupClosePushL(nullstream);
+ nullstream << aObject;
+ nullstream.CommitL();
+ size = nullstream.BytesWritten();
+
+ CleanupStack::PopAndDestroy(&nullstream);
+ LOG(EBackup,EInfo," <--- computeSize() ");
+ return size;
+
+
+ }
+void CScrBackupUtil::GetComponentInfoL(TComponentId aComponentId ,RDesWriteStream& aStream )
+ {
+
+ LOG(EBackup,EInfo," ---> GetComponentInfo() ");
+
+ TInt j = 0 ;
+ CPropertyEntry* property;
+ CComponentEntry* entries = CComponentEntry::NewL();
+ CleanupStack::PushL(entries);
+ TLanguage language =KNonLocalized;
+
+ TBool result = iScr->GetComponentL(aComponentId,*entries,language);
+ entries->ExternalizeL(aStream);
+
+ CleanupStack::PopAndDestroy(entries);
+ TBool isComponentPresent = iScr->IsComponentPresentL(aComponentId);
+ aStream.WriteInt8L(isComponentPresent);
+
+
+ // Localizable Component info
+ RPointerArray<CLocalizableComponentInfo> localizableComponentInfo;
+ iScr->GetComponentLocalizedInfoL(aComponentId,localizableComponentInfo);
+ aStream.WriteInt32L(localizableComponentInfo.Count());
+
+
+ for(j ; j < localizableComponentInfo.Count(); j++)
+ {
+ (localizableComponentInfo.operator [](j))->ExternalizeL(aStream);
+
+ }
+
+ // Properties
+ // extracted the UID
+ property = iScr->GetComponentPropertyL(aComponentId,KUid());
+ if (NULL != property)
+ {
+ property->ExternalizeL(aStream);
+
+
+ delete property;
+ property = NULL;
+ }
+ else
+ {
+ // need to return or have to proceed
+ }
+ // Exctracted Domain - Category
+ property = iScr->GetComponentPropertyL(aComponentId,KDomainCategory());
+ if (NULL != property)
+ {
+ property->ExternalizeL(aStream);
+
+ delete property;
+ property = NULL;
+ }
+ // Exctracted Media ID
+ property = iScr->GetComponentPropertyL(aComponentId,KMediaId());
+ if (NULL != property)
+ {
+ property->ExternalizeL(aStream);
+
+
+ delete property;
+ property = NULL;
+ }
+ // Exctracted Setings plugin name
+ property = iScr->GetComponentPropertyL(aComponentId,KSettingsPlugin());
+ if (NULL != property)
+ {
+ property->ExternalizeL(aStream);
+
+
+ delete property;
+ property = NULL;
+ }
+
+ // Optional Properties
+ // extracted info URL
+ property = iScr->GetComponentPropertyL(aComponentId,KMIDletInfoURL());
+ if (NULL != property)
+ {
+ property->ExternalizeL(aStream);
+
+
+ delete property;
+ property = NULL;
+ }
+ else // as its optional property so could be NULL
+ {
+ aStream.WriteInt8L(NULL);
+ }
+
+ // extracted midlet description
+ property = iScr->GetComponentPropertyL(aComponentId,KMIDletDescription());
+ if (NULL != property)
+ {
+ property->ExternalizeL(aStream);
+
+
+ delete property;
+ property = NULL;
+ }
+ else // as its optional property so could be NULL
+ {
+ aStream.WriteInt8L(NULL);
+ }
+ // extracted midlet DeletionConformation
+ property = iScr->GetComponentPropertyL(aComponentId,KMIDletDeletionConformation());
+ if (NULL != property)
+ {
+ property->ExternalizeL(aStream);
+
+
+ delete property;
+ property = NULL;
+ }
+ else // as its optional property so could be NULL
+ {
+ aStream.WriteInt8L(NULL);
+ }
+ //extracted midlet DN URL
+ property = iScr->GetComponentPropertyL(aComponentId,KDownloadURL());
+ if (NULL != property)
+ {
+ property->ExternalizeL(aStream);
+
+
+ delete property;
+ property = NULL;
+ }
+ else // as its optional property so could be NULL
+ {
+ aStream.WriteInt8L(NULL);
+ }
+
+
+ // backing up files corresponds to component
+ RSoftwareComponentRegistryFilesList fileList;
+ CleanupClosePushL(fileList);
+ TInt count = iScr->GetComponentFilesCountL(aComponentId);
+ TInt k = 0;
+ RPointerArray<HBufC> files;
+ fileList.OpenListL(*iScr,aComponentId);
+ fileList.NextFileSetL(count,files);
+ aStream.WriteInt32L(files.Count());
+ CleanupStack::PopAndDestroy(&fileList);//filelist
+
+ for( k ; k < files.Count(); k++)
+ {
+ HBufC* temp = files.operator [](k);
+ aStream.WriteInt32L(temp->Length());
+ aStream.WriteL(temp->Des());
+ }
+
+
+ RArray<TUid> noOfApps;
+ HBufC* appIcon;
+ TAppRegInfo appInfo;
+ iScr->GetAppUidsForComponentL(aComponentId,noOfApps);
+ RRegistrationInfoForApplication regInfoIcon;
+ CleanupClosePushL(regInfoIcon);
+ RApplicationRegistrationInfo regInfoCaption;
+ CleanupClosePushL(regInfoCaption);
+
+
+ //backing up the no. of apps
+ aStream.WriteInt32L(noOfApps.Count());
+
+
+ for(j = 0 ; j < noOfApps.Count(); j++ )
+ {
+ regInfoIcon.OpenL(*iScr,noOfApps.operator [](j));
+ regInfoCaption.OpenL(*iScr);
+
+ //check if language is imp to give as an argument\
+ // Language extracted
+ TLanguage language = regInfoIcon.ApplicationLanguageL();
+ // Language backed up
+ aStream.WriteInt32L(language);
+
+ // AppUID extracted
+ TUid appUid = noOfApps[j];
+ // AppUID backed up
+ aStream.WriteInt32L(appUid.iUid);
+
+ //App caption extracted
+ regInfoCaption.GetAppInfoL(appUid,appInfo,language);
+ TAppCaption caption = appInfo.Caption();
+ caption.Trim();// would give the acctual size of content
+ //App caption backed up
+ aStream.WriteL(caption);
+
+ //AppIcon path extracted
+ regInfoIcon.GetAppIconL(appIcon);
+ //AppIcon path backed up
+ aStream.WriteL(appIcon->Des());
+
+
+ //need to backup no. of icons to needed for registrating application
+ TInt noOfIcons = regInfoIcon.NumberOfOwnDefinedIconsL();
+ aStream.WriteInt32L(noOfIcons);
+ }
+ CleanupStack::PopAndDestroy();//regInfoIcon
+ CleanupStack::PopAndDestroy();//regInfoCaption
+ //regInfoIcon.Close();
+ //regInfoCaption.Close();
+
+ iState = EIsWriteCompleteInfo;
+
+ LOG(EBackup,EInfo," <--- GetComponentInfo() ");
+
+ }
+void CScrBackupUtil::RestoreScrDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft)
+ {
+ LOG(EBackup,EInfo," ---> RestoreScrDataL() ");
+ if(iIsFristCall)
+ {
+ ConnectScrL();
+ TInt j = 0;
+ TInt presentComponentsCount;
+ RArray<Usif::TComponentId> presentComponentsIds;
+ iBufferSpaceLeft = aBufferSpaceLeft;
+ //aStream.r
+ //reading components count
+ iNumberOfComponents = aStream.ReadInt32L();
+ iBufferSpaceLeft = iBufferSpaceLeft - sizeof(TInt32);
+
+ //reading the size of the TPckgBuf<RArray<TComponentId>>
+ TInt size = aStream.ReadInt32L();
+ iBufferSpaceLeft = iBufferSpaceLeft - sizeof(TInt32);
+
+ //reading TPckgBuf<RArray<TComponentId>>
+ HBufC* temp = HBufC::NewLC(aStream , size);
+
+ TPckgBuf<RArray<TInt> > ids;
+ //extracting RArray from TPckgBuf<RArray<TUids>>
+ ids.Append(temp->Des());
+ CleanupStack::PopAndDestroy(temp);
+ iUids = ids.operator ()();// populated iUids
+ iBufferSpaceLeft = iBufferSpaceLeft - size;
+ iNumberOfComponents = iUids.Count();
+
+
+ ExtractUidAndComponentIdL(presentComponentsIds,iPresentUids,presentComponentsCount);
+
+ // calculating the midlets to be deleted from SCR
+ for(j ; j <= iNumberOfComponents ; j++ )
+ {
+ TInt id = NULL;
+ TInt index = 0;
+ id = iUids.operator [](j);
+ index = iPresentUids.Find(iUids.operator [](j));
+ if(index != NULL)
+ {
+ presentComponentsIds.Remove(index);// removeing the app that is present in SCr and backed up too
+ iPresentUids.Remove(index);// TODO : check if right component Id is removed
+ }
+ }
+
+
+ iPresentUids.Compress(); // need to see if this works
+ presentComponentsIds.Compress();// contains the uids that has to be deleted
+ //Updated the count
+ presentComponentsCount = iPresentUids.Count();
+ for(j = 0 ; j <= presentComponentsCount ; j++ )
+ {
+ TRAPD(err ,iScr->DeleteApplicationEntriesL(presentComponentsIds.operator [](j)));
+ if (KErrNone == err)
+ {
+ iScr->DeleteComponentL(presentComponentsIds.operator [](j));
+ }
+
+ }
+
+
+ }
+ RDesReadStream readStream;
+ readStream.Open(iPtrToWriteBuffer);
+ for( i ; i < iComponentIds.Count() ;)
+ {
+ if(iState == EIsFetchCompleteInfo)
+ {
+ TUid uid ;
+ uid.iUid = iUids.operator [](i);
+ SetDataInScrL(uid,readStream);
+ i++;
+ }
+ if(iState == EIsWriteCompleteInfo)
+ {
+ RDesReadStream readStream;
+ readStream.Open(iPtrToWriteBuffer);
+ iLengthOfString = aStream.ReadInt32L();
+
+
+ //Reading the remaining information into the new buffer
+ if(iBufferToWriteNextTime)
+ {
+ //appened it in the remaing
+ HBufC* remainingBuff = HBufC::NewL(iRemainingBuffer);
+ TPtr ptr(remainingBuff->Des());
+ aStream.ReadL(ptr,iRemainingBuffer);
+ iPtrToWriteBuffer.Append(ptr);
+ iState = EIsFetchCompleteInfo;
+ iLengthOfString = 0; // to maintain the loop
+ iWriteToStream = EFalse;
+
+
+ }
+ if (iLengthOfString > iBufferSpaceLeft && !iBufferToWriteNextTime)
+ {
+ iRemainingBuffer = iLengthOfString - iBufferSpaceLeft;
+ aStream.ReadL(iPtrToWriteBuffer,iBufferSpaceLeft);
+ iBufferToWriteNextTime = ETrue;
+ break ;
+ }
+ // Read the complete string
+ else if(iWriteToStream)
+ {
+ aStream.ReadL(iPtrToWriteBuffer,iLengthOfString);
+ iBufferSpaceLeft = iBufferSpaceLeft - iLengthOfString;
+ iState = EIsFetchCompleteInfo;
+ iLengthOfString = 0; // to maintain the loop
+
+ }
+
+ }
+ }
+ //take care of restorestate
+ // SCR restore is over; Set state to EAppArc
+ if(i >= iComponentIds.Count())
+ {
+ aRestoreState = EAppArc;
+ aBufferSpaceLeft = iBufferSpaceLeft;// need to to this coz of last iteration
+ }
+
+ LOG(EBackup,EInfo," <--- RestoreScrDataL() ");
+ }
+void CScrBackupUtil::SetDataInScrL(TUid aUid , RDesReadStream& aStream)
+ {
+ LOG(EBackup,EInfo," ---> SetDataInScrL() ");
+ TInt tempSize = NULL;
+ TInt j = 0;
+ tempSize = aStream.ReadInt32L();
+ CComponentEntry* entries;
+ entries = CComponentEntry::NewL();
+ CleanupStack::PushL( entries);
+ entries->InternalizeL(aStream);
+
+
+ TBool isComponentPresent = aStream.ReadInt8L();
+
+ // Localizable Component info
+ RPointerArray<CLocalizableComponentInfo> localizableComponentInfoArray; // Not owned by me nee to delete in last
+ TInt temp = aStream.ReadInt32L();
+ for(j ; j <= temp; j++)
+ {
+ CLocalizableComponentInfo* componentinfo = CLocalizableComponentInfo::NewL(aStream);
+ localizableComponentInfoArray.Append(componentinfo);
+ }
+
+ // now need to set all the properties
+ // extracted the UID
+ CIntPropertyEntry* property;
+ property = (CIntPropertyEntry*)CPropertyEntry::NewL(aStream);
+ TInt64 id = property->Int64Value();
+ delete property;
+
+ //extracted midlet Domain-Catogary
+ CLocalizablePropertyEntry* propertyString;
+ propertyString =(CLocalizablePropertyEntry*) CPropertyEntry::NewL(aStream);
+ HBufC* domainCategory = (propertyString->StrValue()).Alloc();
+ delete propertyString;
+
+ // Exctracted Media ID
+ property = (CIntPropertyEntry*)CPropertyEntry::NewL(aStream);
+ TInt64 mediaID = property->Int64Value();
+ delete property;
+
+ //extracted midlet SettingsValue
+ propertyString =(CLocalizablePropertyEntry*) CPropertyEntry::NewL(aStream);
+ HBufC* SettingsValue = (propertyString->StrValue()).Alloc();
+ delete propertyString;
+
+ // Optional Properties
+ // extracted info URL
+ propertyString = propertyString = (CLocalizablePropertyEntry*)CPropertyEntry::NewL(aStream);
+ HBufC* url = (propertyString->StrValue()).Alloc();
+ delete propertyString;
+
+
+ // extracted midlet description
+ propertyString = (CLocalizablePropertyEntry*)CPropertyEntry::NewL(aStream);
+ HBufC* midletDescription = (propertyString->StrValue()).Alloc();
+ delete propertyString;
+
+ // midlet deletion conformation has to be here
+ CBinaryPropertyEntry* propertyBinary = (CBinaryPropertyEntry*)CPropertyEntry::NewL(aStream);
+ HBufC8* midletDeletionConformation = (propertyBinary->BinaryValue()).Alloc();
+ delete propertyBinary;
+
+ //extracted midlet DN URL
+ propertyString =(CLocalizablePropertyEntry*) CPropertyEntry::NewL(aStream);
+ HBufC* dnUrl = (propertyString->StrValue()).Alloc();
+ delete propertyString;
+
+ //Extracting no. of files registered with a component
+ //1st the no. of files
+ RPointerArray<HBufC> componentFilesArray;
+
+ TInt fileCount = aStream.ReadInt32L();
+ //now the files
+ for(TInt k = 0 ; k < fileCount ; k++)
+ {
+ TInt size = aStream.ReadInt32L();
+ HBufC* componentFile = HBufC::NewL(aStream,size);
+ CleanupStack::PushL( componentFile);
+ componentFilesArray.AppendL(componentFile);
+ CleanupStack::Pop( componentFile);
+ }
+
+ //Extracting no. of apps with a component
+ TInt noOfApps = aStream.ReadInt32L();
+ RPointerArray<CAppInfo> appinfoArray;
+ for(j = 0 ; j < noOfApps ; j++ )
+ {
+ CAppInfo* appinfo = CAppInfo::NewL();
+ CleanupStack::PushL( appinfo);// i will not own it after using has to be destroyed
+ TLanguage language;
+ language = (TLanguage)(aStream.ReadInt32L());
+ TUid uid;
+ uid.Uid(aStream.ReadInt32L());
+
+ TAppCaption caption ;
+ aStream.ReadL(caption);
+ HBufC* appIcon ;
+ TPtr temp(appIcon->Des());
+ aStream.ReadL(temp);
+ TInt noOfIcons = aStream.ReadInt32L();
+
+ appinfo->Set(language,uid,caption,temp,noOfIcons);// TODO: check if it works
+ appinfoArray.Append(appinfo);
+
+
+
+ }
+
+
+ TInt index = iPresentUids.Find(aUid.iUid);
+ if(index != NULL)
+ { CComponentEntry* entry = CComponentEntry::NewLC();
+ TUid uid ;
+ uid.Uid(iPresentUids.operator [](index));
+ TComponentId componentId = iScr->GetComponentIdForAppL(uid);
+ iScr->GetComponentL(componentId,*entry);
+ HBufC* versionPresent = entry->Version().AllocLC();
+ CleanupStack::PopAndDestroy(entry);
+ HBufC* versionBackUpComponent = entries->Version().AllocLC();
+ if((versionPresent->CompareC(versionBackUpComponent->Des())))//check version
+ {
+ //ignore Write a log statement as the midlet is same no need to do any thing :)
+ }
+ else
+ {
+ // delete it and thn register it
+ TRAPD(err ,iScr->DeleteApplicationEntriesL(componentId));
+ if (KErrNone == err)
+ {
+ iScr->DeleteComponentL(componentId);
+ }
+ // call register
+ TComponentId newComponentId = RegisterComponentL(*entries,uid,url->Des(),midletDescription->Des(),midletDeletionConformation->Des(),dnUrl->Des(),mediaID,domainCategory->Des(),SettingsValue->Des(),componentFilesArray,isComponentPresent,localizableComponentInfoArray);
+ for(j=0; j < appinfoArray.Count() ; j++)
+ {
+ CAppInfo* appInfo = appinfoArray.operator [](j);
+
+ RegisterApplicationL(newComponentId,appInfo->GetAppUid(),appInfo->GetCaption(),appInfo->GetAppIcon()->Des(),appInfo->NoOfIcons(),appInfo->GetLanguage());
+ CleanupStack::PopAndDestroy(appInfo);
+ }
+ }
+ CleanupStack::PopAndDestroy(versionPresent);
+ CleanupStack::PopAndDestroy(versionBackUpComponent);
+ }
+ else
+ {
+ //just go register it as its not there in the phone
+ TComponentId newComponentId = RegisterComponentL(*entries,aUid,url->Des(),midletDescription->Des(),midletDeletionConformation->Des(),dnUrl->Des(),mediaID,domainCategory->Des(),SettingsValue->Des(),componentFilesArray,isComponentPresent,localizableComponentInfoArray);
+ for(j=0; j < appinfoArray.Count() ; j++)
+ {
+ CAppInfo* appInfo = appinfoArray.operator [](j);
+
+ RegisterApplicationL(newComponentId,appInfo->GetAppUid(),appInfo->GetCaption(),appInfo->GetAppIcon()->Des(),appInfo->NoOfIcons(),appInfo->GetLanguage());
+ CleanupStack::PopAndDestroy(appInfo);
+ }
+ }
+
+ //CleanupStack::Pop();//componentFilesArray
+ CleanupStack::PopAndDestroy( entries);
+
+ LOG(EBackup,EInfo," <--- SetDataInScrL() ");
+ }
+
+
+TComponentId CScrBackupUtil::RegisterComponentL(CComponentEntry& aEntry ,TUid aUid,TPtr aMidletInfoUrl,
+ TPtr aMidletDescription,TPtr8 aMidletDeletionConformation, TPtr aDownloadUrl,TInt64 aMediaId,TPtr aDomainCatogary , TPtr aSettingValue,
+ RPointerArray<HBufC>& aComponentFilesArray, TBool aIsComponentPresent,RPointerArray<CLocalizableComponentInfo>& aLocalizableComponentInfoArray)
+{
+ LOG(EBackup,EInfo," ---> RegisterComponentL() ");
+ HBufC* globalId =( aEntry.GlobalId()).AllocLC();
+
+ TComponentId componentId = iScr->AddComponentL(aLocalizableComponentInfoArray,Usif::KSoftwareTypeJava,globalId);
+
+
+
+ iScr->SetComponentVersionL(componentId, aEntry.Version());
+ //LOG1(EJavaInstaller, EInfo, "RegisterComponentL: version set %s",*version);
+
+ iScr->SetIsComponentRemovableL(componentId, aEntry.IsRemovable());
+
+
+ iScr->SetIsComponentDrmProtectedL(componentId, aEntry.IsDrmProtected());
+
+
+ iScr->SetIsComponentKnownRevokedL(componentId,aEntry.IsKnownRevoked());
+
+
+ iScr->SetIsComponentOriginVerifiedL(componentId, aEntry.IsOriginVerified());
+
+
+ iScr->SetComponentSizeL(componentId, aEntry.ComponentSize());
+
+
+ iScr->SetScomoStateL(componentId,aEntry.ScomoState());
+
+
+ iScr->SetIsComponentPresentL(componentId,aIsComponentPresent);
+
+
+
+ iScr->SetComponentPropertyL(componentId,KUid(), aUid.iUid);
+
+
+ iScr->SetComponentPropertyL(componentId,KMIDletInfoURL(),aMidletInfoUrl);
+
+ iScr->SetComponentPropertyL(componentId, KMIDletDescription(), aMidletDescription);
+
+ iScr->SetComponentPropertyL(componentId,KMIDletDeletionConformation(),aMidletDeletionConformation);
+
+ iScr->SetComponentPropertyL(componentId, KDownloadURL(), aDownloadUrl);
+
+ iScr->SetComponentPropertyL(componentId,KDomainCategory(),aDomainCatogary);
+
+ iScr->SetComponentPropertyL(componentId, KMediaId(), aMediaId);
+
+
+ iScr->SetComponentPropertyL(componentId, KSettingsPlugin(), aSettingValue);
+
+
+ CleanupStack::PopAndDestroy(globalId);
+
+ TInt fileCount = aComponentFilesArray.Count();
+ for (TInt i = 0; i < fileCount; i++)
+ {
+ HBufC *componentFile = aComponentFilesArray.operator [](i);
+ iScr->RegisterComponentFileL(componentId, *componentFile);
+ CleanupStack::PopAndDestroy(componentFile);
+ }
+ LOG(EBackup,EInfo," <--- RegisterComponentL() ");
+ return componentId;
+}
+
+void CScrBackupUtil::RegisterApplicationL(TInt aComponentId, TUid aAppUid,
+ TAppCaption aAppName, TDesC aIconFilename, TInt aNumberOfIcons,
+ TLanguage aLanguages)
+ {
+ LOG(EBackup,EInfo," ---> RegisterApplicationL() ");
+ TFileName appName;
+ RPointerArray<HBufC> ownedFileArray; // codescanner::resourcenotoncleanupstack
+ RPointerArray<Usif::CServiceInfo> serviceArray; // codescanner::resourcenotoncleanupstack
+ RPointerArray<Usif::CPropertyEntry> appPropertiesArray; // codescanner::resourcenotoncleanupstack
+ RPointerArray<Usif::CAppViewData> viewDataList; // codescanner::resourcenotoncleanupstack
+
+ RPointerArray<Usif::COpaqueData> opaqueDataArray;
+ CleanupResetAndDestroyPushL(opaqueDataArray);
+ // Write application Uid to opaque data (needed by MIDlet launcher).
+ TBuf8<4> opaqueDataBuf; // Opaque data will contain one signed 32-bit int.
+ RDesWriteStream writeStream(opaqueDataBuf);
+ writeStream.WriteInt32L(aAppUid.iUid);
+ writeStream.CommitL();
+
+
+
+ COpaqueData *opaqueData = COpaqueData::NewLC(opaqueDataBuf, KUnspecifiedLocale);
+ opaqueDataArray.AppendL(opaqueData);
+ CleanupStack::Pop(opaqueData);
+
+ RPointerArray<Usif::CLocalizableAppInfo> localizableAppInfoList;
+ CleanupResetAndDestroyPushL(localizableAppInfoList);
+ // Add non-localized application name (caption) and icon.
+
+ CCaptionAndIconInfo *captionAndIconInfo = CCaptionAndIconInfo::NewLC(aAppName,aIconFilename,aNumberOfIcons);
+
+ CLocalizableAppInfo *locAppInfo = CLocalizableAppInfo::NewLC(/*aShortCaption=*/ KNullDesC,KNonLocalized,
+ /*aGroupName=*/ KNullDesC,captionAndIconInfo,viewDataList);
+ localizableAppInfoList.AppendL(locAppInfo);
+
+ CleanupStack::Pop(locAppInfo);
+ CleanupStack::Pop(captionAndIconInfo);
+
+ CCaptionAndIconInfo *tmpCaptionAndIconInfo =CCaptionAndIconInfo::NewLC(aAppName,/*aIconFileName=*/ KNullDesC,/*aNumOfAppIcons=*/ 0);
+ CLocalizableAppInfo *tmpLocAppInfo = CLocalizableAppInfo::NewLC(/*aShortCaption=*/ KNullDesC,aLanguages,/*aGroupName=*/ KNullDesC,
+ tmpCaptionAndIconInfo,/*aViewDataList=*/ viewDataList);
+ localizableAppInfoList.AppendL(tmpLocAppInfo);
+
+ CleanupStack::Pop(tmpLocAppInfo);
+ CleanupStack::Pop(tmpCaptionAndIconInfo);
+
+
+
+ // Create application registration data objects.
+ TApplicationCharacteristics appCharacteristics;
+ appCharacteristics.iAttributes = TApaAppCapability::ENonNative;
+ appCharacteristics.iEmbeddability = TApplicationCharacteristics::ENotEmbeddable;
+ appCharacteristics.iSupportsNewFile = EFalse;
+ appCharacteristics.iAppIsHidden = EFalse;
+ appCharacteristics.iLaunchInBackground = EFalse;
+
+ CApplicationRegistrationData *appRegData =
+ CApplicationRegistrationData::NewLC(ownedFileArray, serviceArray,localizableAppInfoList,appPropertiesArray,opaqueDataArray,
+ /*aAppUid=*/ aAppUid, /*aAppFile=*/ appName,/*aCharacteristics=*/ appCharacteristics,/*aDefaultScreenNumber=*/ 0);
+
+ LOG(EJavaInstaller, EInfo,"RegisterApplicationL : Called AddApplicationEntryL >>>>>>>>>>>> ");
+ iScr->AddApplicationEntryL(aComponentId, *appRegData);
+ CleanupStack::PopAndDestroy(appRegData);
+
+
+ CleanupStack::Pop(&localizableAppInfoList); // deleted in appRegData destructor
+ CleanupStack::Pop(&opaqueDataArray); // deleted in appRegData destructor
+
+ LOG(EBackup,EInfo," <--- RegisterApplicationL() ");
+ }
+
+CScrBackupUtil::~CScrBackupUtil()
+ {
+ LOG(EBackup,EInfo," ---> ~CScrBackupUtil() ");
+
+ if(iScr)
+ {
+ iScr->Close();
+ delete iScr;
+ iScr = NULL;
+ }
+ if(iRemainingInfo)
+ {
+ delete iRemainingInfo;
+ iRemainingInfo = NULL;
+ }
+
+ LOG(EBackup,EInfo," <--- ~CScrBackupUtil() ");
+ }
+
+CAppInfo* CAppInfo::NewL()
+ {
+ LOG(EBackup,EInfo," ---> CAppInfo:NewL()");
+ CAppInfo *self = CAppInfo::NewLC();
+ CleanupStack::Pop(self);
+ LOG(EBackup,EInfo," <--- CAppInfo:NewL()");
+ return self;
+ }
+
+
+CAppInfo* CAppInfo::NewLC()
+ {
+ LOG(EBackup,EInfo," ---> CAppInfo:NewLC");
+ CAppInfo *self = new(ELeave) CAppInfo();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ LOG(EBackup,EInfo," <---CAppInfo:NewLC");
+ return self;
+ }
+CAppInfo::CAppInfo()
+ {
+
+ }
+void CAppInfo::ConstructL()
+ {
+ LOG(EBackup,EInfo," ---> CAppInfo:ConstructL ");
+
+
+
+ LOG(EBackup,EInfo," <--- CAppInfo:ConstructL()");
+ }
+CAppInfo::~CAppInfo()
+ {
+ LOG(EBackup,EInfo," ---> CAppInfo:~CAppInfo() ");
+ if(iAppIcon)
+ {
+ delete iAppIcon;
+ }
+ LOG(EBackup,EInfo," <--- CAppInfo:~CAppInfo() ");
+ }
+
+void CAppInfo::Set(TLanguage language,TUid appUid,Usif::TAppCaption caption,TDesC& appIcon,TInt aNoOfIcons)
+ {
+ LOG(EBackup,EInfo," ---> CAppInfo:Set() ");
+ iLanguage = language;
+ iAppUid = appUid;
+ iCaption = caption;
+ iAppIcon->Des().Copy(appIcon);
+ iNoOfIcons = aNoOfIcons;
+ LOG(EBackup,EInfo," <--- CAppInfo:Set() ");
+
+ }
+TLanguage CAppInfo::GetLanguage()
+ {
+ LOG(EBackup,EInfo," ---> CAppInfo:GetLanguage() ");
+ LOG(EBackup,EInfo," <--- CAppInfo:GetLanguage() ");
+ return iLanguage;
+ }
+TUid CAppInfo::GetAppUid()
+ {
+ LOG(EBackup,EInfo," ---> CAppInfo:GetAppUid() ");
+ LOG(EBackup,EInfo," <--- CAppInfo:GetAppUid() ");
+ return iAppUid;
+ }
+Usif::TAppCaption CAppInfo::GetCaption()
+ {
+ LOG(EBackup,EInfo," ---> CAppInfo:GetCaption() ");
+ LOG(EBackup,EInfo," <--- CAppInfo:GetCaption() ");
+ return iCaption;
+
+ }
+HBufC* CAppInfo::GetAppIcon()
+ {
+ LOG(EBackup,EInfo," ---> CAppInfo:GetAppIcon() ");
+ LOG(EBackup,EInfo," <--- CAppInfo:GetAppIcon() ");
+ return iAppIcon;
+
+ }
+
+TInt CAppInfo::NoOfIcons()
+ {
+ LOG(EBackup,EInfo," ---> CAppInfo:NoOfIcons() ");
+ LOG(EBackup,EInfo," <--- CAppInfo:NoOfIcons() ");
+ return iNoOfIcons;
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/javascrbackuputil.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,266 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header file for CScrBackupUtil class
+*
+*/
+
+#ifndef JAVASCRBACKUPUTIL_H_
+#define JAVASCRBACKUPUTIL_H_
+
+
+#include <e32base.h>
+#include <s32strm.h>
+#include <f32file.h>
+#include <e32cmn.h>
+#include <s32mem.h>
+#include <S32BUF.H>
+
+#include <mw/usif/usifcommon.h>
+#include <mw/usif/scr/scr.h>
+#include <mw/usif/scr/screntries.h>
+#include <mw/usif/scr/appreginfo.h> //for TAppCaption
+#include <e32lang.h>
+
+#include <string>
+#include <vector>
+
+namespace java
+ {
+namespace backup
+ {
+
+class CScrBackupUtil : public CBase
+ {
+public:
+ static CScrBackupUtil* NewL();
+
+ ~CScrBackupUtil();
+
+ static CScrBackupUtil* NewLC();
+
+ /*
+ * filling the data with the SCR value one by one
+ */
+ void BackupScrDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft);
+
+ void GetComponentInfoL(Usif::TComponentId aComponentId,RDesWriteStream& aStream);
+ void WriteToActualStream(RDesWriteStream& aStream);
+
+ void RestoreScrDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft);
+ void SetDataInScrL(TUid aUid ,RDesReadStream& aStream);
+
+private: //fun
+ void ConstructL();
+ void ConnectScrL();
+ void writeRemainingData();
+ void RegisterApplicationL(TInt aComponentId, TUid aAppUid,
+ Usif::TAppCaption aAppName, TDesC aIconFilename, TInt aNumberOfIcons,
+ TLanguage aLanguages);
+
+ template <typename T>
+ TInt ComputeSizeL(const T &aObject);
+ void ExtractUidAndComponentIdL(RArray<Usif::TComponentId>& componentIds,RArray<TInt>& uids,TInt& ComponentsCount);
+ Usif::TComponentId RegisterComponentL(Usif::CComponentEntry& aEntry ,TUid aUid,TPtr aMidletInfoUrl, TPtr aMidletDescription, TPtr8 aMidletDeletionConformation,TPtr aDownloadUrl,TInt64 aMediaId,TPtr aDomainCatogary , TPtr aSettingValue,RPointerArray<HBufC>& aComponentFilesArray, TBool aIsComponentPresent,RPointerArray<Usif::CLocalizableComponentInfo>& aLocalizableComponentInfoArray);
+ CScrBackupUtil();
+private://members
+
+ enum TState
+ {
+ EIsFetchCompleteInfo,
+ EIsWriteCompleteInfo
+ };
+ TState iState;
+ HBufC8* iRemainingInfo;
+ // to check if the previous attribte claims that he cant
+ //write in stream because of space so all other attribute
+ //down the lane should be in the remaining info buffer to maintain the sequence
+ TBool iIsToWriteInStream;
+ TBool iBufferToWriteNextTime;
+ TBool iWriteToStream;
+ TInt i ;
+ TInt iLengthOfString;
+ Usif::RSoftwareComponentRegistry* iScr;
+ RArray<Usif::TComponentId> iComponentIds;
+ RArray<TInt> iUids;
+ RArray<TInt> iPresentUids;
+
+ TInt iNumberOfComponents;
+ TInt iBufferSpaceLeft;
+
+ TInt iRemainingBuffer;
+ TPtr8 iPtrToWriteBuffer;
+
+ TBool iIsFristCall;
+
+ };
+
+// Helper class pass the info of midlet with in midletSuite
+class CAppInfo : public CBase
+ {
+public:
+ static CAppInfo* NewL();
+
+ ~CAppInfo();
+
+ static CAppInfo* NewLC();
+ void ConstructL();
+ void Set(TLanguage language,TUid appUid,Usif::TAppCaption caption,TDesC& appIcon,TInt aNoOfIcons);
+ TLanguage GetLanguage();
+ TUid GetAppUid();
+ Usif::TAppCaption GetCaption();
+ HBufC* GetAppIcon();
+ TInt NoOfIcons();
+protected:
+
+ CAppInfo();
+
+
+private:
+ TLanguage iLanguage;
+ TUid iAppUid;
+ Usif::TAppCaption iCaption;
+ HBufC* iAppIcon;
+ TInt iNoOfIcons;
+ };
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+class CJavaBackupEntries : public CBase
+ {
+public:
+ ~CJavaBackupEntries();
+ static CJavaBackupEntries* NewL(Usif::TComponentId aId);
+
+ static CJavaBackupEntries* NewLC(Usif::TComponentId aId);
+
+
+ //used to get the below info
+ /*
+ * will get all the entries in this API
+ * called when restoring
+ */
+ void GetEntries();
+
+ /*
+ * to set all the entries
+ *
+ */
+ void SetEntries();
+private :
+
+ void ConstructL(Usif::TComponentId aId);
+
+private:
+ //check if this duplication can be removed as the same variable is in ccomponentEntry
+ Usif::TComponentId iComponentId; ///< The unique id of the software component.
+ //HBufC* iName; ///< Name of the software component.
+ //HBufC* iVendor; ///< Vendor of the software component.
+ //HBufC* iSwType; ///< Software type name of the component.
+ //HBufC* iGlobalId; ///< Globally unique component identifier.
+ //TBool iRemovable; ///< Whether the component is removable.
+ //TInt64 iSize; ///< The total size of the component at installation time in bytes.
+ //TScomoState iScomoState; ///< SCOMO state of the component.
+ //TDriveList iInstalledDrives; ///< The set of drives that files for the software component were installed to.
+ //HBufC* iVersion; ///< Version identifier of the software component
+ //HBufC* iInstallTime; ///< The install time of the component.
+ //TBool iDrmProtected; ///< Whether the component is DRM protected.
+ //TBool iHidden; ///< Whether the component is hidden in the list of installed components.
+ //TBool iKnownRevoked; ///< Whether the component has been revoked.
+ //TBool iOriginVerified; ///< Whether the installer has verified the originator of the component.
+
+
+ // TODO Can we keep a pointer here
+ Usif::CComponentEntry iEntries;
+ TBool iIsComponentPresent;
+ // component property
+ TInt iMidletSuitId;
+ HBufC *iMidletInfoUrl;
+ HBufC *iMidletDescription;
+ TBool iMidletDeletetionConfirmation; // Didnt got any thing for it
+ HBufC *iMidletDownloadUrl;
+ HBufC *iDomainCatagory;// didnt got any thing for it
+ TInt iMediaId;
+ //addtion to CcomponentEntry Class
+ RPointerArray<Usif::CLocalizableComponentInfo> &iCompLocalizedInfoArray;
+
+
+ Usif::RSoftwareComponentRegistry *iScr;
+
+
+
+ };
+ }
+
+ }
+
+
+
+#endif /* JAVASCRBACKUPUTIL_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,2084 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of CStorageBackupUtil
+*
+*/
+
+
+#include "javastoragebackuputil.h"
+#include "midp2backupplugin.h"
+#include "midp2backupdataids.h"
+
+#include "javastorageentry.h"
+#include "javastorage.h"
+#include "javastoragenames.h"
+
+#include "logger.h"
+#include "javauid.h"
+#include "javaoslayer.h"
+#include "javacommonutils.h"
+#include "s60commonutils.h"
+#include "javasymbianoslayer.h"
+
+#include <memory>
+#include <s32mem.h>
+
+using namespace std;
+using namespace java::storage;
+using namespace java::backup;
+
+// ======== MEMBER FUNCTIONS ========
+
+CStorageBackupUtil::CStorageBackupUtil()
+{
+ LOG(EBackup, EInfo, "CStorageBackupUtil constructor");
+}
+
+void CStorageBackupUtil::ConstructL()
+{
+ LOG(EBackup, EInfo, "CStorageBackupUtil::ConstructL");
+
+ iFirstCalltoBackupStorageData = ETrue;
+ iFirstCalltoRestoreStorageData = ETrue;
+
+ iBufferSpaceLeft = 0;
+
+ iRemainingString = EFalse;
+ iStrCount = 0;
+
+ for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; tableNumber++)
+ {
+ iTableSize[tableNumber] = 0;
+ }
+}
+
+CStorageBackupUtil* CStorageBackupUtil::NewL()
+{
+ LOG(EBackup, EInfo, "CStorageBackupUtil::NewL");
+
+ CStorageBackupUtil* self = new(ELeave) CStorageBackupUtil();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+}
+
+CStorageBackupUtil::~CStorageBackupUtil()
+{
+ LOG(EBackup, EInfo, "CStorageBackupUtil Destructor");
+
+ // clear the vectors to free all the heap data.
+ iStringVector.clear();
+}
+
+
+void CStorageBackupUtil::BackupStorageDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft)
+{
+ LOG(EBackup, EInfo, "CStorageBackupUtil::BackupStorageDataL");
+
+ iBufferSpaceLeft = aBufferSpaceLeft;
+
+ if (iFirstCalltoBackupStorageData)
+ {
+ int err = FillVectorWithStorageData();
+
+ if (err != KErrNone)
+ {
+ User::Leave(err);
+ }
+ LOG1(EBackup, EInfo, "Total no of rows in vector: %d", iStringVector.size());
+
+ // First write the total no of rows in the vector to the stream
+
+ aStream.WriteInt32L(iStringVector.size());
+ iBufferSpaceLeft -= sizeof(TInt32);
+
+ /* Then write the number of rows in each table to the stream.
+ This will be used while writing the data to storage. */
+
+ for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; tableNumber++)
+ {
+ aStream.WriteInt16L(iTableSize[tableNumber]);
+ iBufferSpaceLeft -= sizeof(TInt16);
+ }
+
+ iFirstCalltoBackupStorageData = EFalse;
+ }
+
+ // Now write the actual string data into the stream.
+
+ while (iBufferSpaceLeft > 0 && iStrCount < iStringVector.size())
+ {
+ WriteStringtoStreamL(aStream, iStringVector[iStrCount]);
+ LOG1(EBackup, EInfo, "StrCount = %d", iStrCount);
+ }
+
+ if (iStrCount >= iStringVector.size())
+ {
+ LOG(EBackup, EInfo, "Backup of storage data finished");
+ aBackupNotFinished = EFalse;
+ }
+}
+
+void CStorageBackupUtil::RestoreStorageDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft)
+{
+ LOG(EBackup, EInfo, "CStorageBackupUtil::RestoreStorageDataL()");
+
+ iBufferSpaceLeft = aBufferSpaceLeft;
+
+ if (iFirstCalltoRestoreStorageData)
+ {
+ // the no of strings in the stream
+ iStrCount = aStream.ReadInt32L();
+ iBufferSpaceLeft -= sizeof(TInt32);
+
+ // read the number of rows in each table
+ for (int tableNumber = 0; tableNumber < NUMBER_OF_TABLES; tableNumber++)
+ {
+ iTableSize[tableNumber] = aStream.ReadInt16L();
+ iBufferSpaceLeft -= sizeof(TInt16);
+ }
+ iFirstCalltoRestoreStorageData = EFalse;
+ }
+
+ while (iBufferSpaceLeft > 0 && iStrCount > 0)
+ {
+ ReadStringfromStreamL(aStream);
+ }
+
+ if (iStrCount == 0)
+ {
+ LOG1(EBackup, EInfo, "Finished reading from stream, row count = %d", iStringVector.size());
+
+
+ int err = WriteDataToStorage();
+
+ if (err != KErrNone)
+ {
+ CleanupStack::PopAndDestroy(&aStream);
+ User::Leave(KErrGeneral);
+ }
+
+ // Storage restore is over; Change the state
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+ aRestoreState = EScr;
+#else
+ aRestoreState = EAppArc;
+#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+
+ aBufferSpaceLeft = iBufferSpaceLeft;
+ }
+}
+
+
+void CStorageBackupUtil::WriteStringtoStreamL(RDesWriteStream& aStream, wstring aStr)
+{
+ iLenOfString = aStr.length();
+
+ // if length of string is 0, do not write any string to the stream.
+ if (iLenOfString == 0)
+ {
+ aStream.WriteInt16L(iLenOfString*2);
+ iBufferSpaceLeft -= sizeof(TInt16);
+ iStrCount++;
+ }
+
+ else
+ {
+ /* if space is not enough for writing the complete string,
+ do not write it. Could be written next time. */
+ if (((iLenOfString*2) + sizeof(TInt16)) > iBufferSpaceLeft)
+ {
+ LOG(EBackup, EInfo, "Stream size is not enough to hold the string");
+ // set the bufferspaceleft to zero
+ iBufferSpaceLeft = 0;
+ }
+ // stream has enough space for the length and the string data.
+ else
+ {
+ aStream.WriteInt16L(iLenOfString*2);
+ iBufferSpaceLeft -= sizeof(TInt16);
+
+ HBufC* tempstr = java::util::S60CommonUtils::wstringToDes(aStr.c_str());
+ TPtrC tempStr = tempstr->Des();
+ aStream.WriteL(tempStr);
+ iBufferSpaceLeft -= (iLenOfString*2);
+ delete tempstr;
+
+ iStrCount++;
+ }
+ }
+}
+
+void CStorageBackupUtil::ReadStringfromStreamL(RDesReadStream& aStream)
+{
+ wstring emptyString;
+
+ /* if only part of the string was read last time,
+ read the remaining and append it to that string. */
+ if (iRemainingString)
+ {
+ // if the whole string cannot be read, read part of it and store it.
+ if (iLenOfString > iBufferSpaceLeft)
+ {
+ LOG(EBackup, EInfo, "Cant read the full string; read only part of it");
+
+ HBufC* data = HBufC::NewL(iBufferSpaceLeft/2+1);
+ TPtr pdata = data->Des();
+
+ aStream.ReadL(pdata, iBufferSpaceLeft/2);
+ iLenOfString -= iBufferSpaceLeft;
+ iBufferSpaceLeft = 0;
+
+ wchar_t* str = desToWstring(pdata);
+ wstring stringData(str);
+ iHalfReadString += stringData;
+
+ delete data;
+ iRemainingString = ETrue;
+ }
+ // else read the complete string
+ else
+ {
+ HBufC* data = HBufC::NewL(iLenOfString/2+1);
+ TPtr pdata = data->Des();
+
+ aStream.ReadL(pdata, iLenOfString/2);
+ iBufferSpaceLeft -= (iLenOfString);
+
+ wchar_t* str = desToWstring(pdata);
+ wstring stringData(str);
+ iHalfReadString += stringData;
+
+ iStringVector.push_back(iHalfReadString);
+
+ delete data;
+ iStrCount--;
+ iRemainingString = EFalse;
+ iHalfReadString = emptyString;
+ }
+ }
+
+ else
+ {
+ iLenOfString = aStream.ReadInt16L();
+ iBufferSpaceLeft -= sizeof(TInt16);
+
+ if (iLenOfString > 0)
+ {
+ // if full string cannot be read, read only part of it.
+ if (iLenOfString > iBufferSpaceLeft)
+ {
+ /* if the stream does not have even part of the string,
+ just set the iRemainingFlag to ETrue so that the
+ string can be read next time. */
+
+ if (iBufferSpaceLeft == 0)
+ {
+ iRemainingString = ETrue;
+ iHalfReadString = emptyString;
+ }
+ // else stream contains part of the stream. Read it
+ else
+ {
+ LOG(EBackup, EInfo, "Cant read the full string; read only part of it");
+
+ HBufC* data = HBufC::NewL(iBufferSpaceLeft/2+1);
+ TPtr pdata = data->Des();
+
+ aStream.ReadL(pdata, iBufferSpaceLeft/2);
+ iLenOfString -= iBufferSpaceLeft;
+ iBufferSpaceLeft = 0;
+
+ wchar_t* str = desToWstring(pdata);
+ wstring stringData(str);
+ iHalfReadString = stringData;
+ delete data;
+ iRemainingString = ETrue;
+ }
+ }
+ // else full string can be read
+ else
+ {
+ HBufC* data = HBufC::NewL(iLenOfString/2+1);
+ TPtr pdata = data->Des();
+
+ aStream.ReadL(pdata, iLenOfString/2);
+ iBufferSpaceLeft -= (iLenOfString);
+
+ wchar_t* str = desToWstring(pdata);
+ wstring stringData(str);
+
+ iStringVector.push_back(stringData);
+ iStrCount--;
+ delete data;
+ }
+ }
+ /* if length of string is 0, do not read anything from the stream;
+ just push an empty string into the vector */
+ else
+ {
+ iStringVector.push_back(emptyString);
+ iStrCount--;
+ }
+ }
+}
+
+
+int CStorageBackupUtil::FillVectorWithStorageData()
+{
+ // get data from storage
+
+ LOG(EBackup, EInfo, "CStorageBackupUtil::FillVectorsWithData");
+
+ auto_ptr<JavaStorage> js(JavaStorage::createInstance());
+ LOG(EBackup, EInfo, "Opening connection to JAVA_DATABASE");
+
+ try
+ {
+ js->open(JAVA_DATABASE_NAME);
+ LOG(EBackup, EInfo, "Opening commection succeeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Opening JAVA_DATABASE failed; %S", jse.toString().c_str());
+ return KErrGeneral;
+ }
+
+ JavaStorageEntry attribute;
+ JavaStorageApplicationEntry_t findPattern;
+ JavaStorageApplicationList_t foundEntries;
+
+
+ // table 1 : Application package table
+ {
+ LOG(EBackup, EInfo, "Read entries from APPLICATION_PACKAGE_TABLE");
+
+ try
+ {
+ js->search(APPLICATION_PACKAGE_TABLE, findPattern, foundEntries);
+ LOG(EBackup, EInfo, "Search in Java Storage succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ iTableSize[0] = FillVectorwithAppPackageTableData(foundEntries);
+ foundEntries.clear();
+
+ if (iTableSize[0] == 0)
+ {
+ LOG(EBackup, EInfo, "No data in Storage; So no midlets in system;");
+ return KErrGeneral;
+ }
+ }
+
+
+ // table 2: Application table
+ {
+ LOG(EBackup, EInfo, "Read entries from APPLICATION_TABLE");
+
+ try
+ {
+ js->search(APPLICATION_TABLE, findPattern, foundEntries);
+ LOG(EBackup, EInfo, "Search in Java Storage succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ iTableSize[1] = FillVectorwithAppTableData(foundEntries);
+
+ foundEntries.clear();
+ }
+
+ // table 3: Application package attributes table
+
+ /* for this table, since there are very large number of rows,
+ read the data from the table suite-by-suite
+ ie. read entries for the first suite, then read entries for the
+ second suite. This would prevent stack overflow */
+ {
+ LOG(EBackup, EInfo, "Read entries from APPLICATION_PACKAGE_ATTRIBUTES_TABLE");
+
+ int rowCount = 0;
+
+ for (int suiteNumber = 0; suiteNumber < iTableSize[0]; suiteNumber++)
+ {
+ attribute.setEntry(ID, iStringVector[suiteNumber*14]);
+ findPattern.insert(attribute);
+
+ try
+ {
+ js->search(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, findPattern, foundEntries);
+ LOG(EBackup, EInfo, "Search in Java Storage succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ rowCount += FillVectorwithAppPackageAttTableData(foundEntries);
+
+ foundEntries.clear();
+ findPattern.clear();
+ }
+ iTableSize[2] = rowCount;
+ }
+
+ // table 4: Midp package table
+ {
+ LOG(EBackup, EInfo, "Read entries from MIDP_PACKAGE_TABLE");
+
+ try
+ {
+ js->search(MIDP_PACKAGE_TABLE, findPattern, foundEntries);
+ LOG(EBackup, EInfo, "Search in Java Storage succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ iTableSize[3] = FillVectorwithMidpPackageTableData(foundEntries);
+
+ foundEntries.clear();
+ }
+
+ // table 5: Midp permissions table
+
+ /* for this table, since there are very large number of rows,
+ read the data from the table suite-by-suite
+ ie. read entries for the first suite, then read entries for the
+ second suite. This would prevent stack overflow */
+ {
+ LOG(EBackup, EInfo, "Read entries from MIDP_PERMISSIONS_TABLE");
+
+ int rowCount = 0;
+
+ for (int suiteNumber = 0; suiteNumber < iTableSize[0]; suiteNumber++)
+ {
+ attribute.setEntry(ID, iStringVector[suiteNumber*14]);
+ findPattern.insert(attribute);
+
+ try
+ {
+ js->search(MIDP_PERMISSIONS_TABLE, findPattern, foundEntries);
+ LOG(EBackup, EInfo, "Search in Java Storage succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ rowCount += FillVectorwithMidpPermTableData(foundEntries);
+
+ foundEntries.clear();
+ findPattern.clear();
+ }
+ iTableSize[4] = rowCount;
+ }
+
+ // table 6: Midp function group settings table
+ {
+ LOG(EBackup, EInfo, "Read entries from MIDP_FUNC_GRP_SETTINGS_TABLE");
+
+ try
+ {
+ js->search(MIDP_FUNC_GRP_SETTINGS_TABLE, findPattern, foundEntries);
+ LOG(EBackup, EInfo, "Search in Java Storage succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ iTableSize[5] = FillVectorwithMidpFuncGrpSetTableData(foundEntries);
+
+ foundEntries.clear();
+ }
+
+ // table 7: push registration table
+ {
+ LOG(EBackup, EInfo, "Read entries from PUSH_REGISTRATIONS_TABLE");
+
+ try
+ {
+ js->search(PUSH_REGISTRATIONS_TABLE, findPattern, foundEntries);
+ LOG(EBackup, EInfo, "Search in Java Storage succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ iTableSize[6] = FillVectorwithPushRegTableData(foundEntries);
+
+ foundEntries.clear();
+ }
+
+ // table 8: alarm registration table
+ {
+ LOG(EBackup, EInfo, "Read entries from ALARM_REGISTRATIONS_TABLE");
+
+ try
+ {
+ js->search(ALARM_REGISTRATIONS_TABLE, findPattern, foundEntries);
+ LOG(EBackup, EInfo, "Search in Java Storage succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ iTableSize[7] = FillVectorwithAlarmRegTableData(foundEntries);
+
+ foundEntries.clear();
+ }
+
+ // table 9: runtime settings table
+ {
+ LOG(EBackup, EInfo, "Read entries from RUNTIME_SETTINGS_TABLE");
+
+ try
+ {
+ js->search(RUNTIME_SETTINGS_TABLE, findPattern, foundEntries);
+ LOG(EBackup, EInfo, "Search in Java Storage succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ iTableSize[8] = FillVectorwithRuntimeSetTableData(foundEntries);
+
+ foundEntries.clear();
+ }
+
+ // table 10: pre-install table
+ {
+ LOG(EBackup, EInfo, "Read entries from PREINSTALL_TABLE");
+
+ try
+ {
+ js->search(PREINSTALL_TABLE, findPattern, foundEntries);
+ LOG(EBackup, EInfo, "Search in Java Storage succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Search in Java Storage failed; %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ iTableSize[9] = FillVectorwithPreinstallTableData(foundEntries);
+
+ foundEntries.clear();
+ }
+
+ // Data read from JAVA_DATABASE; So close the connection
+ js->close();
+
+ // table 11: ota status table
+ /* Stored in another database called javaotadatabase.
+ so open a new connection to that database. */
+ {
+ LOG(EBackup, EInfo, "Read entries from OTA_STATUS_TABLE");
+
+ auto_ptr<JavaStorage> jos(JavaStorage::createInstance());
+
+ try
+ {
+ jos->open(JAVA_OTA_DATABASE_NAME);
+ ILOG(EBackup, "Opening connection to OTA database succeeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Opening OTA database failed: %s", jse.toString().c_str());
+ return KErrGeneral;
+ }
+
+ try
+ {
+ jos->search(OTA_STATUS_TABLE, findPattern, foundEntries);
+ LOG(EBackup, EInfo, "Search in Java Storage succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Search in Java Storage failed; %s", jse.toString().c_str());
+ jos->close();
+ return KErrGeneral;
+ }
+
+ iTableSize[10] = FillVectorwithOtaStatusTableData(foundEntries);
+
+ foundEntries.clear();
+ jos->close();
+ }
+
+ //################ printing the vectors #############
+ //printVector();
+ //###################################################
+
+ ILOG(EBackup, "Vector filled with data");
+ return KErrNone;
+}
+
+
+int CStorageBackupUtil::WriteDataToStorage()
+{
+ JELOG2(EBackup);
+ ILOG(EBackup, "Create instance of JAVA_DATABASE_NAME and open the database");
+
+ auto_ptr<JavaStorage> js(JavaStorage::createInstance());
+
+ try
+ {
+ js->open(JAVA_DATABASE_NAME);
+ ILOG(EBackup, "Opening database succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Opening database failed: %S", jse.toString().c_str());
+ return KErrGeneral;
+ }
+
+ try
+ {
+ js->startTransaction();
+ ILOG(EBackup, "Transaction started");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "startTransaction() failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ ILOG(EBackup, "Before writing data to storage, existing data must be cleared");
+
+ // call delete * from table one-by-one
+ {
+ JavaStorageApplicationEntry_t emptyEntry;
+
+ try
+ {
+ js->remove(APPLICATION_PACKAGE_TABLE, emptyEntry);
+ js->remove(APPLICATION_TABLE, emptyEntry);
+ js->remove(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, emptyEntry);
+ js->remove(MIDP_PACKAGE_TABLE, emptyEntry);
+ js->remove(MIDP_PERMISSIONS_TABLE, emptyEntry);
+ js->remove(MIDP_FUNC_GRP_SETTINGS_TABLE, emptyEntry);
+ js->remove(PUSH_REGISTRATIONS_TABLE, emptyEntry);
+ js->remove(ALARM_REGISTRATIONS_TABLE, emptyEntry);
+ js->remove(RUNTIME_SETTINGS_TABLE, emptyEntry);
+ js->remove(PREINSTALL_TABLE, emptyEntry);
+
+ ILOG(EBackup, "Data removed successfully from table");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Failed during removal of entries from table: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+ }
+
+ JavaStorageEntry attribute;
+ JavaStorageApplicationEntry_t insertEntry;
+
+ ILOG(EBackup, "Start transaction for writing into the database");
+
+ int count = 0;
+ // table 1 : Application package table
+ {
+ LOG(EBackup, EInfo, "Writing to APPLICATION_PACKAGE_TABLE");
+
+ for (int rowNumber = 0; rowNumber < iTableSize[0]; rowNumber++)
+ {
+ attribute.setEntry(ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(PACKAGE_NAME, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(VENDOR, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(VERSION, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(ROOT_PATH, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(MEDIA_ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(INITIAL_SIZE, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(JAD_PATH, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(JAR_PATH, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(JAD_URL, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(JAR_URL, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(ACCESS_POINT, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(CONTENT_INFO, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(CONTENT_ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ try
+ {
+ js->write(APPLICATION_PACKAGE_TABLE, insertEntry);
+ ILOG(EBackup, "Writing to table succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+ insertEntry.clear();
+ }
+ }
+
+ // table 2: Application table
+ {
+ LOG(EBackup, EInfo, "Writing to APPLICATION_TABLE");
+
+ for (int rowNumber = 0; rowNumber < iTableSize[1]; rowNumber++)
+ {
+ attribute.setEntry(ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(PACKAGE_ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(NAME, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(MAIN_CLASS, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(AUTORUN, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ try
+ {
+ js->write(APPLICATION_TABLE, insertEntry);
+ ILOG(EBackup, "Writing to table succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+ insertEntry.clear();
+ }
+ }
+
+ // table 3: Application package attributes table
+ {
+ LOG(EBackup, EInfo, "Writing to APPLICATION_PACKAGE_ATTRIBUTES_TABLE");
+
+ for (int rowNumber = 0; rowNumber < iTableSize[2]; rowNumber++)
+ {
+ attribute.setEntry(ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(NAME, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(VALUE, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(TRUSTED, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ try
+ {
+ js->write(APPLICATION_PACKAGE_ATTRIBUTES_TABLE, insertEntry);
+ ILOG(EBackup, "Writing to table succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+ insertEntry.clear();
+ }
+ }
+
+ // table 4: Midp package table
+ {
+ LOG(EBackup, EInfo, "Writing to MIDP_PACKAGE_TABLE");
+
+ for (int rowNumber = 0; rowNumber < iTableSize[3]; rowNumber++)
+ {
+ attribute.setEntry(ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(TYPE, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(SECURITY_DOMAIN, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(SECURITY_DOMAIN_CATEGORY, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(HASH, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(CERT_HASH, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(RMS, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(VALID_CERTS, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(ON_SCREEN_KEYPAD, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(SECURITY_WARNINGS, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ try
+ {
+ js->write(MIDP_PACKAGE_TABLE, insertEntry);
+ ILOG(EBackup, "Writing to table succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+ insertEntry.clear();
+ }
+ }
+
+ // table 5: Midp permissions table
+ {
+ LOG(EBackup, EInfo, "Writing to MIDP_PERMISSIONS_TABLE");
+
+ for (int rowNumber = 0; rowNumber < iTableSize[4]; rowNumber++)
+ {
+ attribute.setEntry(ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(CLASS, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(NAME, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(ACTION, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(FUNCTION_GROUP, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ try
+ {
+ js->write(MIDP_PERMISSIONS_TABLE, insertEntry);
+ ILOG(EBackup, "Writing to table succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+ insertEntry.clear();
+ }
+ }
+
+ // table 6: Midp function group settings table
+ {
+ LOG(EBackup, EInfo, "MIDP_FUNC_GRP_SETTINGS_TABLE");
+
+ for (int rowNumber = 0; rowNumber < iTableSize[5]; rowNumber++)
+ {
+ attribute.setEntry(ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(FUNCTION_GROUP, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(ALLOWED_SETTINGS, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(CURRENT_SETTING, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(BLANKET_PROMPT, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ try
+ {
+ js->write(MIDP_FUNC_GRP_SETTINGS_TABLE, insertEntry);
+ ILOG(EBackup, "Writing to table succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+ insertEntry.clear();
+ }
+ }
+
+ // table 7: push registration table
+ {
+ LOG(EBackup, EInfo, "Writing to PUSH_REGISTRATIONS_TABLE");
+
+ for (int rowNumber = 0; rowNumber < iTableSize[6]; rowNumber++)
+ {
+ attribute.setEntry(ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(URL, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(NAME, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(FILTER, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(REGISTRATION_TYPE, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ try
+ {
+ js->write(PUSH_REGISTRATIONS_TABLE, insertEntry);
+ ILOG(EBackup, "Writing to table succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+ insertEntry.clear();
+ }
+ }
+
+ // table 8: alarm registration table
+ {
+ LOG(EBackup, EInfo, "Writing to ALARM_REGISTRATIONS_TABLE");
+
+ for (int rowNumber = 0; rowNumber < iTableSize[7]; rowNumber++)
+ {
+ attribute.setEntry(ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(ALARM_TIME, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ try
+ {
+ js->write(ALARM_REGISTRATIONS_TABLE, insertEntry);
+ ILOG(EBackup, "Writing to table succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+ insertEntry.clear();
+ }
+ }
+
+
+ // table 9: runtime settings table
+ {
+ LOG(EBackup, EInfo, "Writing to RUNTIME_SETTINGS_TABLE");
+
+ for (int rowNumber = 0; rowNumber < iTableSize[8]; rowNumber++)
+ {
+ attribute.setEntry(EXTENSIONS, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ try
+ {
+ js->write(RUNTIME_SETTINGS_TABLE, insertEntry);
+ ILOG(EBackup, "Writing to table succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+ insertEntry.clear();
+ }
+ }
+
+ // table 10: pre-install table
+ {
+ LOG(EBackup, EInfo, "Writing to PREINSTALL_TABLE");
+
+ for (int rowNumber = 0; rowNumber < iTableSize[9]; rowNumber++)
+ {
+ attribute.setEntry(NAME, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(VENDOR, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(VERSION, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(INSTALL_STATE, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ try
+ {
+ js->write(PREINSTALL_TABLE, insertEntry);
+ ILOG(EBackup, "Writing to table succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+ insertEntry.clear();
+ }
+ }
+
+ ILOG(EBackup, "Data written to JAVA_DATABASE; So Commit the transaction and close the database");
+ ILOG(EBackup, "Committing the transaction");
+
+ try
+ {
+ js->commitTransaction();
+ ILOG(EBackup, "Transaction committed successfully");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Committing the transaction failed: %S", jse.toString().c_str());
+ js->close();
+ return KErrGeneral;
+ }
+
+ ILOG(EBackup, "Close the database");
+
+ // close the JAVA_DATABASE
+ js->close();
+
+
+ // table 11: ota status table
+ /* stored in another database called javaotadatabase.
+ so open a new connection to that database */
+
+ {
+ ILOG(EBackup, "Create instance of JAVA_OTA_DATABASE_NAME and open the database");
+ auto_ptr<JavaStorage> jos(JavaStorage::createInstance());
+
+ try
+ {
+ jos->open(JAVA_OTA_DATABASE_NAME);
+ ILOG(EBackup, "Opening database succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Opening database failed: %S", jse.toString().c_str());
+ return KErrGeneral;
+ }
+
+ ILOG(EBackup, "Start a transaction for writing to this database");
+
+ try
+ {
+ jos->startTransaction();
+ ILOG(EBackup, "Transaction started");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "startTransaction() failed: %S", jse.toString().c_str());
+ jos->close();
+ return KErrGeneral;
+ }
+
+ ILOG(EBackup, "Before writing data to this database, existing data must be cleared");
+
+ try
+ {
+ JavaStorageApplicationEntry_t emptyEntry;
+ jos->remove(OTA_STATUS_TABLE, emptyEntry);
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Removing data from OTA database failed: %S", jse.toString().c_str());
+ jos->close();
+ return KErrGeneral;
+ }
+
+ LOG(EBackup, EInfo, "Writing to OTA_STATUS_TABLE");
+
+ for (int rowNumber = 0; rowNumber < iTableSize[10]; rowNumber++)
+ {
+ attribute.setEntry(ID, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(CREATION_TIME, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(TYPE, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(OTA_CODE, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(URL, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(LATEST_RETRY_TIME, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ attribute.setEntry(RETRY_COUNT, iStringVector[count++]);
+ insertEntry.insert(attribute);
+
+ try
+ {
+ jos->write(OTA_STATUS_TABLE, insertEntry);
+ LOG(EBackup, EInfo, "Writing to table succeded");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Writing to table failed: %S", jse.toString().c_str());
+ jos->close();
+ return KErrGeneral;
+ }
+ insertEntry.clear();
+ }
+
+ ILOG(EBackup, "Data written to JAVA_OTA_DATABASE; commit the transaction and close the database");
+ ILOG(EBackup, "Committing the transaction");
+
+ try
+ {
+ jos->commitTransaction();
+ LOG(EBackup, EInfo, "Transaction committed successfully");
+ }
+ catch (JavaStorageException jse)
+ {
+ ELOG1(EBackup, "Committing the transaction failed: %S", jse.toString().c_str());
+ jos->close();
+ return KErrGeneral;
+ }
+
+ LOG(EBackup, EInfo, "Close the database");
+
+ // close the OTA_DATABASE
+ jos->close();
+ }
+
+ LOG(EBackup, EInfo, "Data written to Storage");
+ return KErrNone;
+}
+
+
+int CStorageBackupUtil::FillVectorwithAppPackageTableData(JavaStorageApplicationList_t& foundEntries)
+{
+ const wstring emptyString;
+ wstring str;
+
+ JavaStorageEntry attribute;
+
+ /* Initialise Iterators to iterate through all applications
+ matched with search patterns. */
+ JavaStorageApplicationList_t::const_iterator applications;
+ JavaStorageApplicationEntry_t::const_iterator findIterator;
+
+ int rowsCount=0;
+ for (applications = foundEntries.begin(); applications != foundEntries.end(); applications++)
+ {
+ attribute.setEntry(ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(PACKAGE_NAME, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(VENDOR, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(VERSION, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(ROOT_PATH, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(MEDIA_ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(INITIAL_SIZE, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(JAD_PATH, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(JAR_PATH, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(JAD_URL, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(JAR_URL, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(ACCESS_POINT, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(CONTENT_INFO, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(CONTENT_ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ rowsCount++;
+ }
+ ILOG1(EBackup, "for loop crossed with i = %d", rowsCount);
+ return rowsCount;
+}
+
+int CStorageBackupUtil::FillVectorwithAppTableData(JavaStorageApplicationList_t& afoundEntries)
+{
+ const wstring emptyString;
+ wstring str;
+
+ JavaStorageEntry attribute;
+
+ /* Initialise Iterators to iterate through all applications
+ matched with search patterns. */
+ JavaStorageApplicationList_t::const_iterator applications;
+ JavaStorageApplicationEntry_t::const_iterator findIterator;
+
+ int rowsCount=0;
+ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++)
+ {
+ attribute.setEntry(ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(PACKAGE_ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(NAME, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(MAIN_CLASS, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(AUTORUN, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ rowsCount++;
+ }
+ ILOG1(EBackup, "for loop crossed with i = %d", rowsCount);
+ return rowsCount;
+}
+
+int CStorageBackupUtil::FillVectorwithAppPackageAttTableData(JavaStorageApplicationList_t& afoundEntries)
+{
+ const wstring emptyString;
+ wstring str;
+
+ JavaStorageEntry attribute;
+
+ /* Initialise Iterators to iterate through all applications
+ matched with search patterns. */
+ JavaStorageApplicationList_t::const_iterator applications;
+ JavaStorageApplicationEntry_t::const_iterator findIterator;
+
+ int rowsCount=0;
+ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++)
+ {
+ attribute.setEntry(ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(NAME, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(VALUE, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(TRUSTED, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ rowsCount++;
+ }
+ ILOG1(EBackup, "for loop crossed with i = %d", rowsCount);
+ return rowsCount;
+}
+
+int CStorageBackupUtil::FillVectorwithMidpPackageTableData(JavaStorageApplicationList_t& afoundEntries)
+{
+ const wstring emptyString;
+ wstring str;
+
+ JavaStorageEntry attribute;
+
+ /* Initialise Iterators to iterate through all applications
+ matched with search patterns. */
+ JavaStorageApplicationList_t::const_iterator applications;
+ JavaStorageApplicationEntry_t::const_iterator findIterator;
+
+ int rowsCount=0;
+ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++)
+ {
+ attribute.setEntry(ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(TYPE, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(SECURITY_DOMAIN, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(SECURITY_DOMAIN_CATEGORY, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(HASH, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(CERT_HASH, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(RMS, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(VALID_CERTS, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(ON_SCREEN_KEYPAD, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(SECURITY_WARNINGS, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ rowsCount++;
+ }
+ ILOG1(EBackup, "for loop crossed with i = %d", rowsCount);
+ return rowsCount;
+}
+
+int CStorageBackupUtil::FillVectorwithMidpPermTableData(JavaStorageApplicationList_t& afoundEntries)
+{
+ const wstring emptyString;
+ wstring str;
+
+ JavaStorageEntry attribute;
+
+ /* Initialise Iterators to iterate through all applications
+ matched with search patterns. */
+ JavaStorageApplicationList_t::const_iterator applications;
+ JavaStorageApplicationEntry_t::const_iterator findIterator;
+
+ int rowsCount=0;
+ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++)
+ {
+ attribute.setEntry(ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(CLASS, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(NAME, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(ACTION, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(FUNCTION_GROUP, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ rowsCount++;
+ }
+ ILOG1(EBackup, "for loop crossed with i = %d", rowsCount);
+ return rowsCount;
+}
+
+int CStorageBackupUtil::FillVectorwithMidpFuncGrpSetTableData(JavaStorageApplicationList_t& afoundEntries)
+{
+ const wstring emptyString;
+ wstring str;
+
+ JavaStorageEntry attribute;
+
+ /* Initialise Iterators to iterate through all applications
+ matched with search patterns. */
+ JavaStorageApplicationList_t::const_iterator applications;
+ JavaStorageApplicationEntry_t::const_iterator findIterator;
+
+ int rowsCount=0;
+ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++)
+ {
+ attribute.setEntry(ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(FUNCTION_GROUP, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(ALLOWED_SETTINGS, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(CURRENT_SETTING, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(BLANKET_PROMPT, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ rowsCount++;
+ }
+ ILOG1(EBackup, "for loop crossed with i = %d", rowsCount);
+ return rowsCount;
+}
+
+int CStorageBackupUtil::FillVectorwithPushRegTableData(JavaStorageApplicationList_t& afoundEntries)
+{
+ const wstring emptyString;
+ wstring str;
+
+ JavaStorageEntry attribute;
+
+ /* Initialise Iterators to iterate through all applications
+ matched with search patterns. */
+ JavaStorageApplicationList_t::const_iterator applications;
+ JavaStorageApplicationEntry_t::const_iterator findIterator;
+
+ int rowsCount=0;
+ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++)
+ {
+ attribute.setEntry(ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(URL, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(NAME, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(FILTER, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(REGISTRATION_TYPE, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ rowsCount++;
+ }
+ ILOG1(EBackup, "for loop crossed with i = %d", rowsCount);
+ return rowsCount;
+}
+
+int CStorageBackupUtil::FillVectorwithAlarmRegTableData(JavaStorageApplicationList_t& afoundEntries)
+{
+ const wstring emptyString;
+ wstring str;
+
+ JavaStorageEntry attribute;
+
+ /* Initialise Iterators to iterate through all applications
+ matched with search patterns. */
+ JavaStorageApplicationList_t::const_iterator applications;
+ JavaStorageApplicationEntry_t::const_iterator findIterator;
+
+ int rowsCount=0;
+ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++)
+ {
+ attribute.setEntry(ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(ALARM_TIME, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ rowsCount++;
+ }
+ ILOG1(EBackup, "for loop crossed with i = %d", rowsCount);
+ return rowsCount;
+}
+
+int CStorageBackupUtil::FillVectorwithRuntimeSetTableData(JavaStorageApplicationList_t& afoundEntries)
+{
+ const wstring emptyString;
+ wstring str;
+
+ JavaStorageEntry attribute;
+
+ /* Initialise Iterators to iterate through all applications
+ matched with search patterns. */
+ JavaStorageApplicationList_t::const_iterator applications;
+ JavaStorageApplicationEntry_t::const_iterator findIterator;
+
+ int rowsCount=0;
+ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++)
+ {
+ attribute.setEntry(EXTENSIONS, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ rowsCount++;
+ }
+ ILOG1(EBackup, "for loop crossed with i = %d", rowsCount);
+ return rowsCount;
+}
+
+int CStorageBackupUtil::FillVectorwithPreinstallTableData(JavaStorageApplicationList_t& afoundEntries)
+{
+ const wstring emptyString;
+ wstring str;
+
+ JavaStorageEntry attribute;
+
+ /* Initialise Iterators to iterate through all applications
+ matched with search patterns. */
+ JavaStorageApplicationList_t::const_iterator applications;
+ JavaStorageApplicationEntry_t::const_iterator findIterator;
+
+ int rowsCount=0;
+ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++)
+ {
+ attribute.setEntry(NAME, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(VENDOR, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(VERSION, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(INSTALL_STATE, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ rowsCount++;
+ }
+ ILOG1(EBackup, "for loop crossed with i = %d", rowsCount);
+ return rowsCount;
+}
+
+int CStorageBackupUtil::FillVectorwithOtaStatusTableData(JavaStorageApplicationList_t& afoundEntries)
+{
+ const wstring emptyString;
+ wstring str;
+
+ JavaStorageEntry attribute;
+
+ /* Initialise Iterators to iterate through all applications
+ matched with search patterns. */
+ JavaStorageApplicationList_t::const_iterator applications;
+ JavaStorageApplicationEntry_t::const_iterator findIterator;
+
+ int rowsCount=0;
+ for (applications = afoundEntries.begin(); applications != afoundEntries.end(); applications++)
+ {
+ attribute.setEntry(ID, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(CREATION_TIME, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(TYPE, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(OTA_CODE, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(URL, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(LATEST_RETRY_TIME, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ attribute.setEntry(RETRY_COUNT, L"");
+ str = emptyString;
+ findIterator = (*applications).find(attribute);
+
+ if (findIterator != (*applications).end())
+ {
+ str = (*findIterator).entryValue();
+ }
+ iStringVector.push_back(str);
+
+ rowsCount++;
+ }
+ ILOG1(EBackup, "for loop crossed with i = %d", rowsCount);
+ return rowsCount;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/javastoragebackuputil.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,404 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header file for CStorageBackupUtil class
+*
+*/
+
+
+#ifndef JAVASTORAGEBACKUPUTIL_H
+#define JAVASTORAGEBACKUPUTIL_H
+
+#include <string>
+#include <vector>
+
+#include <e32base.h>
+#include <wchar.h>
+#include <s32strm.h>
+
+#include "javastorageentry.h"
+#include "javastorage.h"
+#include "javastoragenames.h"
+
+#define NUMBER_OF_TABLES 11
+
+class RDesWriteStream;
+class RDesReadStream;
+
+namespace java
+{
+namespace backup
+{
+
+
+/**
+--------------------------------------------------------------------------------
+
+* CStorageBackupUtil class is handling backup and restore of Java Storage data
+* This class is instantiated when a BUR operation is starting.
+
+Example Data that could be present in JavaStorage which is backed up and restored by this class.
+
+Application Package Data
+ID | PACKAGE_NAME | VENDOR | VERSION | ROOT_PATH | MEDIA_ID | INITIAL_SIZE | JAD_PATH | JAR_PATH | JAD_URL | JAR_URL | ACCESS_POINT | CONTENT_INFO | CONTENT_ID
+788463512 | HelloWorld? | Nokia | 1.1 | \C\Private\102033E6\MIDlets\[101e59d8] | 123456 | 200 | \C\Private\102033E6\MIDlets\[101e59d8]\HelloWorld.jad | \C\Private\102033E6\MIDlets\[101e59d8]\HelloWorld.jar | http://getjar.com/MyGreatApp.jad | http://getjar.com/MyGreatApp2.jar | IAP:2 | 0 | 78d78sd89f789
+
+
+Application Data
+ID | PACKAGE_ID | NAME | MAIN_CLASS | AUTORUN
+788463616 | 788463512 | HelloWorld | HelloWorld | 0
+
+
+Application Package Attributes Data
+ID | NAME | VALUE | TRUSTED
+788463512 | MIDlet-Name | HelloWorld | 00
+788463512 | MIDlet-Version | 1.0 | 10
+788463512 | MIDlet-Vendor | Nokia | 10
+
+
+MIDP Application Package Data
+ID | TYPE | SECURITY_DOMAIN | HASH | CERT_HASH | RMS | VALID_CERTS | ON_SCREEN_KEYPAD
+788463512 | MIDletSuite? | Trusted | 123456789 | 123456789 | \C\Private\102033E6\MIDlets\[101e59d8]\RMSdata.bin | 1,3,5 | 0
+
+
+MIDP Permissions Data
+ID | CLASS | NAME | ACTION | FUNCTION_GROUP
+788463616 | javax.microedition.io.HttpProtocolPermission | http://server/index.html | read | HTTP
+
+
+MIDP Function Group Settings Data
+ID | FUNCTION_GROUP | ALLOWED_SETTINGS | CURRENT_SETTING | BLANKET_PROMPT
+788463616 | HTTP | 111 (e.g. BLANKET, SESSION, ONESHOT) | 001 (ONESHOT) | 0
+
+The allowed settings could be a an encoded integer based on the binary representation of 3 bits (e.g. 100 if only BLANKET is allowed, 011 if SESSION and ONESHOT are allowed).
+
+
+MIDP Push Registrations Data
+ID | URL | NAME | FILTER | REGISTRATION_TYPE
+788463616 | sip:*;type=""application/test"", SIPPushReceiver? | SIPPushReceiver? | * | 1
+788463616 | btspp://localhost:99999999999999999999999999999999;*;authenticated;blacklist=00E001234567 | BTPushReceiver? | * | 0
+
+
+MIDP Alarm Push Registrations Data
+ID | ALARM_TIME
+788463616 | 2008-09-13;15:20:30
+
+
+MIDP Runtime Settings Data
+EXTENSIONS
+\C\Private\102033E6\Extenstions\12345678\Location.jar
+
+
+Preinstall Data
+NAME | VENDOR | VERSION | INSTALL_STATE
+TestMIDletSuite | TestVendor | 1.2.3 | 2
+
+
+MIDP OTA Status Data table
+ID | CREATION_TIME | TYPE | OTA_CODE | URL | LATEST_RETRY_TIME | RETRY_COUNT
+788463616 | 2008-09-13;12:20:30 | 1 | 900 | http://www.moo.com/MIDLETS.js | 2008-09-13;15:20:30 | 2
+
+-----------------------------------------------------------------------------------------------------------------------------
+*/
+
+class CStorageBackupUtil : public CBase
+{
+public:
+
+ /**
+ * Instantiates an object of this type
+ */
+ static CStorageBackupUtil* NewL();
+
+ ~CStorageBackupUtil();
+
+ /**
+ * This method requests a section of Java Storage data.
+ * Called by the function GetBackupDataSectionL from midp2backupplugin
+ * The data is filled into the stream till it is full.
+ * The data returned may be base or incremental depending
+ * on the type of backup and the capability of the data owner.
+ *
+ * @param aBuffer a pointer to the base of the location where data
+ * can be copied.
+ * @param aBackupNotFinished on return EFalse if all data has
+ * been returned for this drive, else ETrue.
+ */
+ void BackupStorageDataL(RDesWriteStream& aStream, TBool& aBackupNotFinished, TInt& aBufferSpaceLeft);
+
+ /**
+ * This method receives a section of base restore data.
+ * Stores the restore data in the vector so that it can be
+ * written to Java Storage when all data have come.
+ *
+ * @param stream holds the restore data
+ * @param aRestoreState EFirstBuffer if all data has been returned
+ * for this drive, else remains at EStorage.
+ * @param aBufferSpaceLeft the space left in the buffer
+ */
+ void RestoreStorageDataL(RDesReadStream& aStream, TInt& aRestoreState, TInt& aBufferSpaceLeft);
+
+private:
+
+ // Default constructor for the class
+
+ CStorageBackupUtil();
+
+ // Second phase constructor function
+
+ void ConstructL();
+
+ /**
+ * This method fills the vector with Java Storage data.
+ * Data is read from JavaStorage tables and put inside the vector
+ * which will later be put into the buffer stream.
+ * The reason for having vector to store the data is that connection to
+ * Java Storage cannot be open for a long period of time
+ * ie writing into buffer stream's time
+ *
+ * @return returns an integer value telling whether the operation
+ * was completed successfully or not.
+ */
+ int FillVectorWithStorageData();
+
+ /**
+ * A utility function which converts a wstring into a TDesC
+ * and writes it into the stream.
+ *
+ * @param stream an RDesWriteStream into which the converted
+ * string is written
+ * @param tempString the wstring which is to be converted.
+ */
+ void WriteStringtoStreamL(RDesWriteStream& aStream, std::wstring aTempString);
+
+ /**
+ * A utility function which reads a TDesC from the stream, converts it
+ * to a wstring and writes it into the vector.
+ *
+ * @param stream an RDesReadStream from which the TDesC data is read
+ */
+ void ReadStringfromStreamL(RDesReadStream& aStream);
+
+ /**
+ * This method writes the data to storage.
+ * Gets called after FillVectorsWithStreamDataL() function is called.
+ * This function opens a transaction to Storage and writes
+ * the vector's data into storage row-by-row, and then commits
+ * the transaction.
+ *
+ * @return returns an integer specifying whether the operation
+ * has completed successfully or not.
+ */
+ int WriteDataToStorage();
+public:
+ /**
+ * Utility function which fills the vector with data got from storage.
+ * Handles data of only APPLICATION_PACKAGE_TABLE.
+ *
+ * @param afoundEntries the application entries which match
+ * the SQL query.
+ * @return an integer representing the number of rows written
+ * into the vector.
+ */
+ int FillVectorwithAppPackageTableData(java::storage::JavaStorageApplicationList_t& afoundEntries);
+
+ /**
+ * Utility function which fills the vector with data got from storage.
+ * Handles data of only APPLICATION_TABLE.
+ *
+ * @param afoundEntries the application entries which match
+ * the SQL query.
+ * @return an integer representing the number of rows written
+ * into the vector.
+ */
+ int FillVectorwithAppTableData(java::storage::JavaStorageApplicationList_t& afoundEntries);
+
+ /**
+ * Utility function which fills the vector with data got from storage.
+ * Handles data of only APPLICATION_PACKAGE_ATTRIBUTES_TABLE.
+ *
+ * @param afoundEntries the application entries which match
+ * the SQL query.
+ * @return an integer representing the number of rows written
+ * into the vector.
+ */
+ int FillVectorwithAppPackageAttTableData(java::storage::JavaStorageApplicationList_t& afoundEntries);
+
+ /**
+ * Utility function which fills the vector with data got from storage.
+ * Handles data of only MIDP_PACKAGE_TABLE.
+ *
+ * @param afoundEntries the application entries which match
+ * the SQL query.
+ * @return an integer representing the number of rows written
+ * into the vector.
+ */
+ int FillVectorwithMidpPackageTableData(java::storage::JavaStorageApplicationList_t& afoundEntries);
+
+ /**
+ * Utility function which fills the vector with data got from storage.
+ * Handles data of only MIDP_PERMISSIONS_TABLE.
+ *
+ * @param afoundEntries the application entries which match
+ * the SQL query.
+ * @return an integer representing the number of rows written
+ * into the vector.
+ */
+ int FillVectorwithMidpPermTableData(java::storage::JavaStorageApplicationList_t& afoundEntries);
+
+ /**
+ * Utility function which fills the vector with data got from storage.
+ * Handles data of only MIDP_FUNCTION_GROUP_SETTINGS_TABLE.
+ *
+ * @param afoundEntries the application entries which match
+ * the SQL query.
+ * @return an integer representing the number of rows written
+ * into the vector.
+ */
+ int FillVectorwithMidpFuncGrpSetTableData(java::storage::JavaStorageApplicationList_t& afoundEntries);
+
+ /**
+ * Utility function which fills the vector with data got from storage.
+ * Handles data of only PUSH_REGISTRATION_TABLE.
+ *
+ * @param afoundEntries the application entries which match
+ * the SQL query.
+ * @return an integer representing the number of rows written
+ * into the vector.
+ */
+ int FillVectorwithPushRegTableData(java::storage::JavaStorageApplicationList_t& afoundEntries);
+
+ /**
+ * Utility function which fills the vector with data got from storage.
+ * Handles data of only ALARM_REGISTRATION_TABLE.
+ *
+ * @param afoundEntries the application entries which match
+ * the SQL query.
+ * @return an integer representing the number of rows written
+ * into the vector.
+ */
+ int FillVectorwithAlarmRegTableData(java::storage::JavaStorageApplicationList_t& afoundEntries);
+
+ /**
+ * Utility function which fills the vector with data got from storage.
+ * Handles data of only RUNTIME_SETTINGS_TABLE.
+ *
+ * @param afoundEntries the application entries which match
+ * the SQL query.
+ * @return an integer representing the number of rows written
+ * into the vector.
+ */
+ int FillVectorwithRuntimeSetTableData(java::storage::JavaStorageApplicationList_t& afoundEntries);
+
+ /**
+ * Utility function which fills the vector with data got from storage.
+ * Handles data of only PREINSTALL_TABLE.
+ *
+ * @param afoundEntries the application entries which match
+ * the SQL query.
+ * @return an integer representing the number of rows written
+ * into the vector.
+ */
+ int FillVectorwithPreinstallTableData(java::storage::JavaStorageApplicationList_t& afoundEntries);
+
+ /**
+ * Utility function which fills the vector with data got from storage.
+ * Handles data of only OTA_STATUS_TABLE.
+ *
+ * @param afoundEntries the application entries which match
+ * the SQL query.
+ * @return an integer representing the number of rows written
+ * into the vector.
+ */
+ int FillVectorwithOtaStatusTableData(java::storage::JavaStorageApplicationList_t& afoundEntries);
+
+ /**
+ * Prints the vectors
+ */
+ void printVector();
+
+private:
+
+ /**
+ * The actual wstring vector which holds the data during a B&R operation.
+ * During a backup, this vector is filled with storage data and then
+ * written to the stream.
+ * During a restore, this vector is filled with data from the stream
+ * before it is written to storage.
+ * Own
+ */
+ std::vector< std::wstring > iStringVector;
+
+ /**
+ * An integer which holds the length of the string.
+ * When only half the data is read from the stream, this holds the
+ * length of the remaining data which is to be read.
+ * Own
+ */
+ int iLenOfString;
+
+ /**
+ * An integer which holds the count of the number of strings
+ * in the vector. Used during a B&R operation.
+ * Own
+ */
+ int iStrCount;
+
+ /**
+ * An integer array which holds the number of rows of each table
+ * present in storage.
+ * This information is written to stream and is used when the
+ * restored data is written back to storage.
+ * Own
+ */
+ int iTableSize[NUMBER_OF_TABLES];
+
+ /**
+ * A Boolean value which says if a string was only
+ * half read during a previous iteration.
+ * Own
+ */
+ TBool iRemainingString;
+
+ /**
+ * A wstring which holds the half read string so that the
+ * completed string can be appended to it during the next iteration
+ * before it is put into the vector.
+ * Own
+ */
+ std::wstring iHalfReadString;
+
+ /**
+ * Shows if it's the fill call to backup storage data.
+ * Vectors filled only at the first call.
+ * Own
+ */
+ TBool iFirstCalltoBackupStorageData;
+
+ /**
+ * Shows if it's the fill call to restore storage data.
+ * Own
+ */
+ TBool iFirstCalltoRestoreStorageData;
+
+ /**
+ * Shows the remaining number of bytes available in the stream.
+ * Own
+ */
+ int iBufferSpaceLeft;
+};
+
+} // namespace backup
+} // namespace java
+
+#endif // JAVASTORAGEBACKUPUTIL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of JavaVersionBackupUtil
+*
+*/
+
+
+#include <javaenvinfo.h>
+#include "javaversionbackuputil.h"
+#include "logger.h"
+
+
+#include <s32mem.h>
+#include <e32base.h>
+
+#define KOMJIdentifier 0x20000F3D
+
+using namespace Java;
+using namespace java::backup;
+
+// ======== MEMBER FUNCTIONS ========
+
+void JavaVersionBackupUtil::WriteJavaVersionL(RDesWriteStream& aStream)
+{
+ JELOG2(EBackup);
+
+ // Get the Java version number from the environment API's
+
+ TVersion version = Java::JavaEnvInfo::Version();
+
+ PLOG3(EBackup, "JavaEnvInfo::Version: major = %d, minor = %d, build = %d",
+ version.iMajor, version.iMinor, version.iBuild);
+
+ /* Put OMJ Package UID in the front indicating that it is an
+ OMJ environment from which backup was taken. */
+ aStream.WriteInt32L(KOMJIdentifier);
+
+ // write the version numbers to the stream
+ aStream.WriteInt8L(version.iMajor);
+ aStream.WriteInt8L(version.iMinor);
+ aStream.WriteInt16L(version.iBuild);
+
+ ILOG(EBackup, "Version information written to stream");
+}
+
+TUint JavaVersionBackupUtil::CheckJavaVersionL(RDesReadStream& aStream, TDriveNumber aDrive, TBool versionCheck)
+{
+ JELOG2(EBackup);
+ TInt32 omjID = 0;
+ if (versionCheck)
+ {
+ // Read the OMJSpecific ID only on first call
+ omjID = aStream.ReadInt32L();
+ }
+
+ if (omjID != KOMJIdentifier)
+ {
+ _LIT(KJavaRestoreConverterExe, "javarestoreconverter.exe");
+
+ RProcess rProcess;
+
+ TChar targetDrive;
+ _LIT(KText , "");
+ TBuf<15> commandLine(KText);
+ RFs session;
+ TInt err = session.Connect();
+ if (KErrNone != err)
+ {
+ ELOG1(EBackup,
+ "JavaVersionBackupUtil::CheckJavaVersionL: Session Connection failed, error %d", err);
+ CleanupStack::PopAndDestroy(&aStream);
+ User::Leave(err);
+ }
+
+ err = session.DriveToChar(aDrive, targetDrive);
+ if (KErrNone == err)
+ {
+ _LIT(KDrive, " -drive");
+ commandLine.Append(KDrive);
+ commandLine.Append(targetDrive);
+ }
+
+ err = rProcess.Create(KJavaRestoreConverterExe, commandLine);
+ if (KErrNone == err)
+ {
+ TRequestStatus status;
+ rProcess.Logon(status);
+ rProcess.Resume();
+
+ // now wait until javarestoreconverter exits
+ User::WaitForRequest(status);
+ if (status.Int() != KErrNone)
+ {
+ // Installing old JRT 1.x MIDlets to JRT 2.x failed
+ err = status.Int();
+ ELOG1(EBackup,
+ "JavaVersionBackupUtil::CheckJavaVersionL: Installation failed, error %d", err);
+ CleanupStack::PopAndDestroy(&aStream);
+ User::Leave(err);
+ }
+ else
+ {
+ LOG(EBackup,EInfo,
+ "JavaVersionBackupUtil::CheckJavaVersionL: Installing Midlets successful");
+ }
+ }
+ else
+ {
+ // Cannot even start javarestoreconverter
+ ELOG1(EBackup,
+ "JavaVersionBackupUtil::CheckJavaVersionL: Cannot start Installer, error %d", err);
+ CleanupStack::PopAndDestroy(&aStream);
+ User::Leave(err);
+ }
+ rProcess.Close();
+ return 1;
+
+ }
+ else
+ {
+ TInt8 major = aStream.ReadInt8L();
+ TInt8 minor = aStream.ReadInt8L();
+ TInt16 build = aStream.ReadInt16L();
+
+ TVersion version(major, minor, build);
+
+ PLOG3(EBackup, "JavaVersion read from Stream: major = %d, minor = %d, build = %d",
+ version.iMajor, version.iMinor, version.iBuild);
+
+ // read current version and compare it with the read version
+ TVersion curVersion = Java::JavaEnvInfo::Version();
+
+ PLOG3(EBackup," Current JavaVersion: major = %d, minor = %d, build = %d",
+ curVersion.iMajor, curVersion.iMinor, curVersion.iBuild);
+ return 0;
+
+ }
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/javaversionbackuputil.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header file for JavaVersionBackupUtil class
+*
+*/
+
+
+#ifndef JAVAVERSIONBACKUPUTIL_H
+#define JAVAVERSIONBACKUPUTIL_H
+
+#include <e32base.h>
+#include <driveinfo.h>
+#include <javaenvinfo.h>
+
+class RDesReadStream;
+class RDesWriteStream;
+
+namespace java
+{
+namespace backup
+{
+/**
+ * JavaVersionBackupUtil class is used for checking the java version
+ * during a B&R operation. This class writes the current java version
+ * while backing up and then checks whether the backed up version
+ * is compatible with the currnet version while doing a restore.
+ * If it is not compatible, then the backup process is gracefully exited.
+ */
+
+class JavaVersionBackupUtil
+{
+
+public:
+
+ /**
+ * This method writes the current java version into the SBE buffer.
+ * This functions is called when a backup process is started.
+ *
+ * @param aBuffer the buffer which is sent by the SBE
+ */
+ static void WriteJavaVersionL(RDesWriteStream& aStream);
+
+ /**
+ * This method reads the java version from the stream. If there is no
+ * Java version or if the Java version is not compatible with the
+ * current version, then the restore process is exited gracefully.
+ *
+ * @param aStream an RDesReadStream on the buffer which is sent
+ * by the SBE
+ * @param aDrive current drive to be backed up
+ * @return status
+ */
+ static TUint CheckJavaVersionL(RDesReadStream& aStream, TDriveNumber aDrive, TBool versionCheck);
+
+private:
+
+ /**
+ * This method is used to compare the current java version with the
+ * one read from the stream.
+ * This method is not used presently. Logic may be added in the future
+ *
+ * @param aVersion the java version read from the stream
+ * @param aCurVersion the current java version
+ */
+ void CompareL(TVersion aVersion, TVersion aCurVersion);
+
+};
+
+} // namespace backup
+} // namespace java
+
+#endif // JAVAVERSIONBACKUPUTIL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupdataids.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: midp2backupdataids definition
+*
+*/
+
+#include <e32base.h>
+
+#ifndef MIDP2BACKUPDATAIDS_H
+#define MIDP2BACKUPDATAIDS_H
+
+namespace java
+{
+namespace backup
+{
+/**
+ * State of streaming during restore
+ */
+enum TRestoreState
+{
+ EVersion = 0,
+ EStorage,
+ EAppArc,
+ EInIcon,
+ EInSize,
+ EInstall,
+ EScr
+};
+
+} //namespace backup
+} //namespace java
+
+
+#endif // MIDP2BACKUPDATAIDS_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,637 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of Midp2BackupPlugin
+*
+*/
+
+
+#include "midp2backupplugin.h"
+#include "midp2backupdataids.h"
+#include "apparcbackuputil.h"
+#include "javastoragebackuputil.h"
+#include "javaversionbackuputil.h"
+
+#include "javastoragenames.h"
+#include "javastorageentry.h"
+#include "javastorage.h"
+
+#include "javacommonutils.h"
+#include "logger.h"
+
+#include <connect/sbdefs.h>
+#include <s32mem.h>
+#include <s32file.h>
+#include <f32file.h>
+#include <apgcli.h>
+
+
+using namespace std;
+using namespace java::storage;
+using namespace java::backup;
+
+// ======== MEMBER FUNCTIONS ========
+
+CMidp2BackupPlugin::CMidp2BackupPlugin()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin constructor");
+}
+
+void CMidp2BackupPlugin::ConstructL()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ConstructL");
+
+ iIconDescIndex = 0;
+ iBufferSpaceLeft = 0;
+ iFirstCallToGetBackupDataSection = ETrue;
+ iStorageDataBackup = ETrue;
+ iStorageDataRestore = ETrue;
+ iJavaVersionInfoWritten = EFalse;
+ iRestoreState = EVersion;
+
+ User::LeaveIfError(iFs.Connect());
+ // to share file handles with AppArc
+ User::LeaveIfError(iFs.ShareProtected());
+
+ iStorageBackupUtil = CStorageBackupUtil::NewL();
+ iAppArcUtil = CAppArcBackupUtil::NewL(iFs);
+}
+
+CMidp2BackupPlugin* CMidp2BackupPlugin::NewL()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::NewL");
+
+ CMidp2BackupPlugin* self = new(ELeave) CMidp2BackupPlugin();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+}
+
+CMidp2BackupPlugin::~CMidp2BackupPlugin()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin destructor");
+
+ iFs.Close();
+ iIconUidArray.Close();
+ delete iAppArcUtil;
+ delete iIconDesc;
+ delete iRestoreIconDesc;
+ delete iStorageBackupUtil;
+}
+
+// from base class CBackupPlugin
+
+void CMidp2BackupPlugin::PrepareForBURL(TInt aBackupStateValue)
+{
+ (void)aBackupStateValue; // Just to suppress a warning in release builds
+ LOG1(EBackup, EInfo, "CMidp2BackupPlugin::PrepareForBURL, BUR state: %d", aBackupStateValue);
+}
+
+void CMidp2BackupPlugin::ReceiveSnapshotDataL(TDriveNumber /* aDrive */, TDesC8& /* aBuffer */, TBool /* aLastSection */)
+{
+ JELOG2(EBackup);
+ User::Leave(KErrNotSupported);
+}
+
+TUint CMidp2BackupPlugin::GetExpectedDataSize(TDriveNumber /* aDrive */)
+{
+ JELOG2(EBackup);
+ return 0;
+}
+
+void CMidp2BackupPlugin::GetSnapshotDataL(TDriveNumber /* aDrive */, TPtr8& /* aBuffer */, TBool& /* aFinished */)
+{
+ JELOG2(EBackup);
+ User::Leave(KErrNotSupported);
+}
+
+void CMidp2BackupPlugin::InitialiseGetBackupDataL(TDriveNumber aDrive)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseGetBackupDataL");
+ iDrive = aDrive;
+}
+
+void CMidp2BackupPlugin::GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::GetBackupDataSectionL");
+
+ iBufferSpaceLeft = aBuffer.MaxLength();
+ RDesWriteStream stream(aBuffer);
+ CleanupClosePushL(stream);
+
+ if (!iJavaVersionInfoWritten)
+ {
+ JavaVersionBackupUtil::WriteJavaVersionL(stream);
+ iJavaVersionInfoWritten = ETrue;
+ iBufferSpaceLeft -= 8;
+ }
+
+ if (iStorageDataBackup)
+ {
+ iStorageBackupUtil->BackupStorageDataL(stream, iStorageDataBackup, iBufferSpaceLeft);
+ aFinished = EFalse;
+ }
+
+ else
+ {
+ if (iFirstCallToGetBackupDataSection)
+ {
+ LOG(EBackup, EInfo, "First Call To GetBackupDataSection");
+ // Get the uids of midlets whose icons are to be backed up
+ iIconFilePointer = 0;
+ ResetIconArray();
+ iAppArcUtil->GetMidletsFromAppArcL(iIconUidArray, iDrive);
+
+ /* Streaming MMC's unique Id, if current drive is MMC
+ and there's at least one midlet on the drive*/
+ if (iIconUidArray.Count() > 0 && iDrive >= EDriveE && iDrive <= EDriveZ)
+ {
+ TUint32 mmcId = MmcIdL();
+
+ if (mmcId != 0)
+ {
+ LOG1(EBackup,EInfo, "Write MMC id: %u", mmcId);
+ stream.WriteUint32L(mmcId);
+ iBufferSpaceLeft -= sizeof(mmcId);
+ }
+ }
+ // Setting flag to EFalse
+ iFirstCallToGetBackupDataSection = EFalse;
+ }
+
+ // Next icon uid and filename
+ TUid currentUid;
+ HBufC* fullFileName = NULL;
+
+ // Streaming leftover part of icon file
+ if (iIconDescIndex)
+ {
+ LOG(EBackup, EInfo, "Streaming leftover part of icon file");
+
+ /* if the icon file is bigger than the space in the buffer, write only
+ part of it and fill iLeftover with remaining part. */
+ if (iIconDesc->Size() - iIconDescIndex > iBufferSpaceLeft)
+ {
+ stream.WriteL(iIconDesc->Mid(iIconDescIndex), iBufferSpaceLeft);
+ iIconDescIndex += iBufferSpaceLeft;
+ }
+ else
+ {
+ stream.WriteL(iIconDesc->Mid(iIconDescIndex));
+ iIconDescIndex = 0;
+ }
+
+ aFinished = EFalse;
+ }
+
+ // Get new icon file
+ else if (NextIcon(currentUid, fullFileName))
+ {
+ LOG1(EBackup, EInfo, "New icon file, id: %d", currentUid.iUid);
+
+ // Readstream for icon file
+ RFileReadStream fileStream;
+
+ User::LeaveIfError(fileStream.Open(iFs, *fullFileName, EFileRead));
+ CleanupClosePushL(fileStream);
+
+ TEntry* entry = new(ELeave) TEntry();
+ CleanupStack::PushL(entry);
+
+ iFs.Entry(*fullFileName, *entry);
+ TInt32 size = entry->iSize;
+
+ // Write icon file content into iIconDesc
+ LOG(EBackup, EInfo, "Write icon file content into iIconDesc");
+ delete iIconDesc;
+ iIconDesc = NULL;
+ iIconDesc = HBufC8::NewL(size);
+
+ TPtr8 buf = iIconDesc->Des();
+ fileStream.ReadL(buf, size);
+
+ // get the group name of the midlet from AppArc
+ TBuf< KApaMaxAppGroupName >groupName(iAppArcUtil->GetMidletGroupName(currentUid));
+ TInt groupNameSize = groupName.Size();
+
+ // Write the size of the data
+ LOG(EBackup,EInfo, "Write the size of the data");
+
+ TParsePtrC parse(*fullFileName);
+ TPtrC fileName = parse.NameAndExt();
+ TInt32 fileNameSize = fileName.Size();
+
+ stream.WriteInt32L(sizeof(TUid) // Uid
+ + sizeof(TInt32) // fileNameSize
+ + fileNameSize // filename
+ + sizeof(TInt32) // number of icons
+ + sizeof(TInt32) // groupnamesize
+ + groupNameSize
+ + size // icon file
+ );
+ iBufferSpaceLeft -= sizeof(TInt32);
+
+ // Write the Uid of the midlet
+ LOG(EBackup, EInfo, "Write the Uid of the midlet");
+ stream.WriteInt32L(currentUid.iUid);
+ iBufferSpaceLeft -= sizeof(TUid);
+
+ // Write the size of the icon filename
+ LOG(EBackup, EInfo, "Write the size of the icon filename");
+ stream.WriteInt32L(fileNameSize);
+ iBufferSpaceLeft -= sizeof(TInt32);
+
+ // Write icon filename
+ LOG(EBackup, EInfo, "Write icon filename");
+ stream.WriteL(fileName);
+ iBufferSpaceLeft -= fileNameSize;
+
+ // Write number of icons in midlet
+ LOG(EBackup, EInfo, "Write number of icons in midlet");
+ TInt iconCount;
+ iAppArcUtil->NumberOfOwnDefinedIcons(TUid::Uid(currentUid.iUid), iconCount);
+ stream.WriteInt32L(iconCount);
+ iBufferSpaceLeft -= sizeof(TInt32);
+
+ // TPtr8 groupName(iAppArcUtil->GetMidletGroupName(currentUid));
+ LOG(EBackup, EInfo, "Write the size of the Group name of the midlet");
+ stream.WriteInt32L(groupNameSize);
+ iBufferSpaceLeft -= sizeof(TInt32);
+
+ if (groupNameSize != 0)
+ {
+ LOG(EBackup, EInfo, "Write the Group name of the midlet");
+ stream.WriteL(groupName);
+ iBufferSpaceLeft -= groupNameSize;
+ }
+
+ /* if the icon file is bigger than the space in the buffer,
+ write only part of it and fill iLeftover with remaining part */
+ LOG(EBackup, EInfo, "Write icon");
+ if (size > iBufferSpaceLeft)
+ {
+ stream.WriteL(buf, iBufferSpaceLeft);
+ iIconDescIndex = iBufferSpaceLeft;
+ }
+ else
+ {
+ stream.WriteL(buf, size);
+ iIconDescIndex = 0;
+ }
+
+ aFinished = EFalse;
+
+ CleanupStack::PopAndDestroy(&fileStream);
+ CleanupStack::PopAndDestroy(entry);
+ }
+
+ else
+ {
+ aFinished = ETrue;
+ iFirstCallToGetBackupDataSection = ETrue;
+ iStorageDataBackup = ETrue;
+ }
+
+ delete fullFileName;
+ }
+ CleanupStack::PopAndDestroy(&stream);
+}
+
+
+void CMidp2BackupPlugin::InitialiseRestoreBaseDataL(TDriveNumber aDrive)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseRestoreBaseDataL");
+ iDrive = aDrive;
+}
+
+void CMidp2BackupPlugin::RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreBaseDataSectionL");
+
+ iBufferSpaceLeft = aBuffer.Size();
+ RDesReadStream stream(aBuffer);
+ CleanupClosePushL(stream);
+ TBool versionCheck = ETrue;
+
+ if (((iRestoreState == EVersion) || (iRestoreState == EInstall)) && iBufferSpaceLeft >= 8)
+ {
+ if (iRestoreState == EInstall)
+ {
+ versionCheck = EFalse;
+ }
+ TUint ret = JavaVersionBackupUtil::CheckJavaVersionL(stream,iDrive,versionCheck);
+ if (1==ret)
+ {
+ // Here set the satus to restore finished, so that control goes back to SBE & SBE calls B&R for another drive
+ iRestoreState = EInstall;
+ }
+ else
+ {
+ /* version information has been written to stream.
+ So change restore state to restore storage data */
+ iRestoreState = EStorage;
+ }
+ // version information is of length 8 bytes.
+ iBufferSpaceLeft -= 8;
+ }
+
+ if (iRestoreState == EStorage)
+ {
+ iStorageBackupUtil -> RestoreStorageDataL(stream, iRestoreState, iBufferSpaceLeft);
+ }
+
+ // Only at first call
+ if ((iRestoreState != EStorage && iRestoreState != EVersion) && (iRestoreState != EInstall))
+ {
+ if (iRestoreState == EAppArc)
+ {
+ // Making AppArc deregistrations
+ TRAPD(err, iAppArcUtil->DeregisterAppsL(iDrive));
+
+ if (err)
+ {
+ ELOG(EBackup, "Leave in deregistering apps");
+ }
+ }
+
+ // Process the data buffer for restore
+ ProcessBufferL(stream);
+
+ if (aFinished)
+ {
+ // Set state to EStorage
+ iRestoreState = EStorage;
+ }
+ }
+
+ aFinished = ETrue;
+ CleanupStack::PopAndDestroy(&stream);
+}
+
+void CMidp2BackupPlugin::InitialiseRestoreIncrementDataL(TDriveNumber /* aDrive */)
+{
+ JELOG2(EBackup);
+ User::Leave(KErrNotSupported);
+}
+
+void CMidp2BackupPlugin::RestoreIncrementDataSectionL(TDesC8& /* aBuffer */, TBool /* aFinished */)
+{
+ JELOG2(EBackup);
+ User::Leave(KErrNotSupported);
+}
+
+void CMidp2BackupPlugin::RestoreComplete(TDriveNumber /* aDrive */)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreComplete");
+}
+
+TUint CMidp2BackupPlugin::MmcIdL()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::MmcIdL()");
+
+ TVolumeInfo* volumeInfo = new(ELeave) TVolumeInfo();
+
+ TInt err = iFs.Volume(*volumeInfo, iDrive);
+
+ if (!err)
+ {
+ TUint mmcId = volumeInfo->iUniqueID;
+ return mmcId;
+ }
+ else
+ {
+ return 0;
+ }
+
+
+}
+
+void CMidp2BackupPlugin::ProcessBufferL(RDesReadStream& stream)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessBuffer()");
+
+ // Cycle until there's data in the buffer
+ while (iBufferSpaceLeft > 0)
+ {
+ switch (iRestoreState)
+ {
+ case EAppArc:
+ ProcessFirstBufferL(stream, iBufferSpaceLeft);
+ break;
+
+ case EInIcon:
+ ProcessInIconL(stream, iBufferSpaceLeft);
+ break;
+
+ case EInSize:
+ ProcessInSizeL(stream, iBufferSpaceLeft);
+ break;
+
+ default:
+ CleanupStack::PopAndDestroy(&stream);
+ User::Leave(KErrNotSupported);
+ }
+ }
+}
+
+
+_LIT(KStarWildCard, "*.*");
+
+void CMidp2BackupPlugin::RestoreMmcRegistryL()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreMmcRegistry()");
+
+ /* If backed up MMC is not the same as the current MMC, copy the entries
+ from the directory of the backed up MMC to the directory
+ of the current MMC */
+ TUint32 mmc = MmcIdL();
+
+ if (iBackupMmc != mmc)
+ {
+ // Create path to old place
+ TPath path_old;
+ CreateMmcPath(path_old, iDrive, iBackupMmc);
+
+ // Create path to new place
+ TPath path_new;
+ CreateMmcPath(path_new, iDrive, mmc);
+
+ // Get old files list
+ CFileMan* fileMan = CFileMan::NewL(iFs);
+
+ CleanupStack::PushL(fileMan);
+
+ // Copy to new place
+ iFs.MkDir(path_new);
+ path_old.Append(KStarWildCard);
+ TInt err = fileMan->Copy(path_old, path_new);
+
+ ILOG1(EBackup, "File copy, status: %d", err);
+
+ User::LeaveIfError(err);
+
+ CleanupStack::PopAndDestroy();
+ }
+}
+
+_LIT(KPrivatePath, "C:\\private\\");
+
+void CMidp2BackupPlugin::CreateMmcPath(TDes& aPathName, TInt aDrive, TUint aUniqueId)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::CreateMmcPath()");
+
+ aPathName.Zero();
+ aPathName.Append(KPrivatePath);
+ aPathName.AppendNum(KRegistryServerUid, EHex);
+ aPathName.Append(KPathDelimiter);
+
+ // append drive name
+ TDriveUnit driveUnit(aDrive);
+ aPathName.Append(driveUnit.Name().Left(1));
+ aPathName.Append(KPathDelimiter);
+
+ TUint64 id = aUniqueId;
+ aPathName.AppendNum(id, EHex);
+ aPathName.Append(KPathDelimiter);
+}
+
+TBool CMidp2BackupPlugin::NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::NextIcon()");
+
+ if (iIconUidArray.Count() > iIconFilePointer)
+ {
+ aCurrentUid = iIconUidArray[iIconFilePointer];
+ iAppArcUtil->GetIconFilename(iIconUidArray[iIconFilePointer], aFullFileName);
+ iIconFilePointer++;
+ return ETrue;
+ }
+ else
+ {
+ // There are no more icon files
+ return EFalse;
+ }
+}
+
+void CMidp2BackupPlugin::ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessFirstBuffer()");
+
+ if (iDrive >= EDriveE && iDrive <= EDriveZ)
+ {
+ // Read MMC id and restore MMC entries if needed
+ iBackupMmc = aStream.ReadUint32L();
+ aBufferSpaceLeft -= sizeof(iBackupMmc);
+ LOG1(EBackup, EInfo, "Read MMC Id: %u", iBackupMmc);
+ RestoreMmcRegistryL();
+ }
+ if (aBufferSpaceLeft >= sizeof(TInt32))
+ {
+ iIconFileSizeLeft = aStream.ReadInt32L();
+ aBufferSpaceLeft -= sizeof(iIconFileSizeLeft);
+ iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft);
+ iRestoreState = EInIcon;
+ }
+ else
+ {
+ // No more data to read
+ aBufferSpaceLeft = 0;
+ }
+}
+
+void CMidp2BackupPlugin::ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInIcon()");
+
+ TPtr8 restoreIconPtr = iRestoreIconDesc->Des();
+ HBufC8* tempDesc = HBufC8::NewL(iIconFileSizeLeft);
+ CleanupStack::PushL(tempDesc);
+ TPtr8 tempPtr = tempDesc->Des();
+
+ // Icon cannot be read fully
+ if (iIconFileSizeLeft > aBufferSpaceLeft)
+ {
+ aStream.ReadL(tempPtr, aBufferSpaceLeft);
+ restoreIconPtr.Append(tempPtr);
+ iIconFileSizeLeft -= aBufferSpaceLeft;
+ aBufferSpaceLeft = 0;
+ iRestoreState = EInIcon;
+ }
+ // Icon can be read fully
+ else
+ {
+ aStream.ReadL(tempPtr, iIconFileSizeLeft);
+ restoreIconPtr.Append(tempPtr);
+ aBufferSpaceLeft -= iIconFileSizeLeft;
+ iRestoreState = EInSize;
+
+ TRAPD(err, iAppArcUtil->RegisterAppL(restoreIconPtr, iDrive));
+
+ if (err)
+ {
+ ELOG(EBackup, "Registerin application to AppArc failed.");
+ }
+ }
+
+ CleanupStack::PopAndDestroy(tempDesc);
+}
+
+void CMidp2BackupPlugin::ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInSize()");
+
+ if (aBufferSpaceLeft >= sizeof(TInt32))
+ {
+ if (iSizeBuffer.Size() != 0)
+ {
+ // Read leftover part of size
+ TInt readData = sizeof(TInt32) - iSizeBuffer.Size();
+ aStream.ReadL(iSizeBuffer, readData);
+ RMemReadStream sizeStream(iSizeBuffer.Ptr(), 4);
+ CleanupClosePushL(sizeStream);
+ iIconFileSizeLeft = sizeStream.ReadInt32L();
+ CleanupStack::PopAndDestroy(&sizeStream);
+ aBufferSpaceLeft -= sizeof(readData);
+ }
+ else
+ {
+ // Read size in full
+ iIconFileSizeLeft = aStream.ReadInt32L();
+ aBufferSpaceLeft -= sizeof(iIconFileSizeLeft);
+ }
+
+ delete iRestoreIconDesc;
+ iRestoreIconDesc = NULL;
+ iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft);
+ iRestoreState = EInIcon;
+ }
+ else
+ {
+ // Read first byte(s) of size
+ aStream.ReadL(iSizeBuffer, aBufferSpaceLeft);
+ aBufferSpaceLeft = 0;
+ }
+}
+
+void CMidp2BackupPlugin::ResetIconArray()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ResetIconArray()");
+
+ // Remove all entries
+ while (iIconUidArray.Count())
+ {
+ iIconUidArray.Remove(0);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backupplugin.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,412 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header file for CMidp2BackupPlugin class
+*
+*/
+
+
+#ifndef MIDP2BACKUPPLUGIN_H
+#define MIDP2BACKUPPLUGIN_H
+
+#include "backupplugin.h"
+#include <apadef.h>
+#include "logger.h"
+
+class RDesWriteStream;
+class RDesReadStream;
+
+
+
+namespace java
+{
+namespace backup
+{
+
+class CAppArcBackupUtil;
+class CJavaVersionBackupUtil;
+class CStorageBackupUtil;
+
+
+
+/**
+ * CMidp2BackupPlugin class is handling backup and restore operations
+ * for MIDlets
+ *
+ * This class is instantiated when a BUR operation is starting.
+ */
+class CMidp2BackupPlugin : public CBackupPlugin
+{
+
+public:
+
+ /**
+ * Instantiates an object of this type
+ */
+ static CMidp2BackupPlugin* NewL();
+
+ ~CMidp2BackupPlugin();
+
+
+ // from base class CBackupPlugin
+
+ /**
+ * This method is called when a backup or restore operation is
+ * starting. Preparations can be done to prepare for BUR.
+ *
+ * @param aBackupStateValue the value of the current backup state
+ */
+ void PrepareForBURL(TInt aBackupStateValue);
+
+ /**
+ * This method receives all or part of a snapshot of data to allow
+ * calculation of an incremental backup. The snapshot is one that
+ * was previously supplied by the data owner. The snapshot data
+ * should be read from the location supplied. The snapshot data may
+ * be larger than the location supplied in which case the routine
+ * will be called repeatedly until all data has been supplied.
+ *
+ * Snapshot data will also be supplied as part of a restore operation
+ *
+ * @param aDrive the drive being backed up
+ * @param aBuffer a pointer to the base of the location from whence
+ * data can be copied.
+ * @param aLastSection ETrue if this is the last section of snapshot
+ * data, else EFalse.
+ */
+ void ReceiveSnapshotDataL(TDriveNumber aDrive,
+ TDesC8& aBuffer,
+ TBool aLastSection);
+
+ /**
+ * This method returns the expected size of backup data that will be
+ * supplied. If an incremental backup is underway then this method
+ * will not be called until after ReceiveSnapshotDataL().
+ * The size data will be used for the purpose of tracking progess
+ * during a backup. If it is inaccurate then the user may see
+ * irregular progress but the actual backup data will not be
+ * affected so it is acceptable to return an estimated value.
+ *
+ * @param aDrive the drive being backed up.
+ * @return the size of the data that will be returned
+ */
+ TUint GetExpectedDataSize(TDriveNumber aDrive);
+
+ /**
+ * This method returns a snapshot of data to accompany a backup. The
+ * snapshot is expected to contain details on files / data being
+ * backed up. The format of the snapshot is only meaningful to the
+ * data owner. The snapshot will be supplied if the data owner is
+ * asked for an incremental backup and for a restore operation. The
+ * snapshot data should be copied to the location supplied.
+ *
+ * The snapshot data may be larger than the location supplied in
+ * which case the routine will be called repeatedly until all data
+ * has been retrieved.
+ *
+ * @param aDrive the drive being backed up
+ * @param aBuffer a pointer to the base of the location where data
+ * can be copied.
+ * @param aFinished on return ETrue if all data has been returned
+ * for this drive, else EFalse.
+ */
+ void GetSnapshotDataL(TDriveNumber aDrive,
+ TPtr8& aBuffer,
+ TBool& aFinished);
+
+ /**
+ * This method prepares the implementor to return backup data. It
+ * will be followed by a sequence of calls to request the actual
+ * data.
+ *
+ * @param aDrive the drive being backed up.
+ */
+ void InitialiseGetBackupDataL(TDriveNumber aDrive);
+
+ /**
+ * This method requests a section of backup data.
+ * InitialiseGetBackupDataL() will have been called previously to
+ * specify the drive concerned. The data returned may be base or
+ * incremental depending on the type of backup and the capability of
+ * the data owner.
+ *
+ * @param aBuffer a pointer to the base of the location where data
+ * can be copied.
+ * @param aFinished on return ETrue if all data has been returned
+ * for this drive, else EFalse.
+ */
+ void GetBackupDataSectionL(TPtr8& aBuffer,
+ TBool& aFinished);
+
+ /**
+ * This method prepares the implementor to receive base restore data
+ * for a drive. It will be followed by a sequence of calls to supply
+ * the actual data.
+ *
+ * @param aDrive the drive being restored.
+ */
+ void InitialiseRestoreBaseDataL(TDriveNumber aDrive);
+
+ /**
+ * This method receives a section of base restore data.
+ * InitialiseRestoreBaseDataL() will have been called previously to
+ * specify the drive concerned.
+ *
+ * @param aBuffer a pointer to the base of the location whence data
+ * can be read.
+ * @param aFinished ETrue if all data has been returned for this
+ * drive, else EFalse.
+ */
+ void RestoreBaseDataSectionL(TDesC8& aBuffer,
+ TBool aFinished);
+
+ /**
+ * This method prepares the implementor to receive incremental
+ * restore data for a drive. It will be followed by a sequence
+ * of calls to supply the actual data. If multiple increments
+ * are supplied then this methid will be called before each increment
+ *
+ * @param aDrive the drive being restored.
+ */
+ void InitialiseRestoreIncrementDataL(TDriveNumber aDrive);
+
+ /**
+ * This method receives a section of increment restore data.
+ * InitialiseRestoreIncrementDataL() will have been called
+ * previously to specify the drive concerned.
+ *
+ * @param aBuffer a pointer to the base of the location whence data
+ * can be read.
+ * @param aFinished ETrue if all data has been returned for this
+ * increment, else EFalse.
+ */
+ void RestoreIncrementDataSectionL(TDesC8& aBuffer,
+ TBool aFinished);
+
+ /**
+ * This method is called when all data to be restored has been
+ * supplied.
+ *
+ * @param aDrive the drive being restored.
+ */
+ void RestoreComplete(TDriveNumber aDrive);
+
+private:
+
+ CMidp2BackupPlugin();
+
+ void ConstructL();
+
+ /**
+ * This method is called to get the unique Id of the current MMC
+ *
+ * @return The Id of the MMC, or 0, if no MMC is inserted
+ */
+ TUint MmcIdL();
+
+ /**
+ * This method is called to process the content of the buffer
+ * provided in active phase of restore
+ *
+ * @param aBuffer the buffer to process
+ */
+ void ProcessBufferL(RDesReadStream& stream);
+
+ /**
+ * This method is called to restore the Java Registry entries
+ * on the MMC, if needed
+ */
+ void RestoreMmcRegistryL();
+
+ /**
+ * This method creates the path for the Java Registry entries on
+ * the specified MMC
+ *
+ * @param [out] aPathName path of the entries of the MMC
+ * @param aDrive drive of the MMC
+ * @param aUniqueId Unique Id of the MMC
+ */
+ void CreateMmcPath(TDes& aPathName,
+ TInt aDrive,
+ TUint aUniqueId);
+
+ /**
+ * This method gets the path for the next icon file to be backed up
+ *
+ * @param [out] aCurrentUid Uid of the next icon
+ * @param [out] aFullFileName path of the next icon
+ * @return EFalse if there are no more icons in the array, ETrue
+ * otherwise
+ */
+ TBool NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName);
+
+ /**
+ * Process buffer when restore state is EFirstBuffer
+ *
+ * @param aStream readstream of buffer to process
+ * @param aBufferSpaceLeft space left of buffer to be processed
+ */
+ void ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft);
+
+ /**
+ * Process buffer when restore state is EInIcon
+ *
+ * @param aStream readstream of buffer to process
+ * @param aBufferSpaceLeft space left of buffer to be processed
+ */
+ void ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft);
+
+ /**
+ * Process buffer when restore state is EInSize
+ *
+ * @param aStream readstream of buffer to process
+ * @param aBufferSpaceLeft space left of buffer to be processed
+ */
+ void ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft);
+
+ /**
+ * Resets the array of icons to be backed up
+ */
+ void ResetIconArray();
+
+private: // data
+
+ /**
+ * File session
+ * Own.
+ */
+ RFs iFs;
+
+ /**
+ * AppArcBackupUtil object for AppArc operations
+ * Own.
+ */
+ CAppArcBackupUtil* iAppArcUtil;
+
+ /**
+ * StorageBackupUtil object for storage B&R
+ * Own.
+ */
+ CStorageBackupUtil* iStorageBackupUtil;
+ /**
+ * The drive that is backed up or restored currently
+ * Own.
+ */
+ TDriveNumber iDrive;
+
+ /**
+ * Id of backed up drive, gets its value from restored data
+ * Own.
+ */
+ TInt32 iBackupDrive;
+
+ /**
+ * Id of backed up MMC, gets its value from restored data
+ * Own.
+ */
+ TUint32 iBackupMmc;
+
+ /**
+ * State of streaming during restore
+ * Own.
+ */
+ TInt iRestoreState;
+
+ /**
+ * Shows if it's the first call to GetBackupDataSectionL
+ * Own.
+ */
+ TBool iFirstCallToGetBackupDataSection;
+
+ /**
+ * Shows if Backup of storage data is finished or not
+ * Own.
+ */
+ TBool iStorageDataBackup;
+
+ /**
+ * Shows if Restore of storage data is finished or not
+ * Own.
+ */
+ TBool iStorageDataRestore;
+
+ /**
+ * Shows if Java version information is already written or not
+ * Own
+ */
+ TBool iJavaVersionInfoWritten;
+
+ /**
+ * Shows if its the first call to restore data or not.
+ * Own.
+ */
+ TBool iFirstCallToRestoreBackupDataSection;
+
+ /**
+ * Stores the uids of the midlets whose icons are to be backed up.
+ * Own.
+ */
+ RArray<TUid> iIconUidArray;
+
+ /**
+ * The current index in the icon file array
+ * Own.
+ */
+ TInt iIconFilePointer;
+
+ /**
+ * Stores the current icon file for streaming
+ * This descriptor will be streamed at subsequent calls of
+ * GetBackupDataSectionL()
+ * Own.
+ */
+ HBufC8* iIconDesc;
+
+ /**
+ * Stores the current icon file being restored
+ * Own.
+ */
+ HBufC8* iRestoreIconDesc;
+
+ /**
+ * Size of the icon to be still read during restore
+ * Own.
+ */
+ TInt32 iIconFileSizeLeft;
+
+ /**
+ * Current index of iIconDesc
+ * Own.
+ */
+ TInt iIconDescIndex;
+
+ /**
+ * Holds the remaining bytes in the buffer
+ * Own
+ */
+
+ TInt iBufferSpaceLeft;
+
+ /**
+ * Buffer for storing data size in restore
+ * Own.
+ */
+ TBuf8<4> iSizeBuffer;
+};
+
+
+
+} //namespace backup
+} //namespace java
+
+#endif // MIDP2BACKUPPLUGIN_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,490 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of Midp2BackupPlugin with USIF
+*
+*/
+
+#include <connect/sbdefs.h>
+#include <s32mem.h>
+#include <s32file.h>
+#include <f32file.h>
+#include <apgcli.h>
+
+#include "midp2backuppluginusif.h"
+#include "midp2backupdataids.h"
+#include "javastoragebackuputil.h"
+#include "javaversionbackuputil.h"
+#include "javascrbackuputil.h"
+
+#include "javastoragenames.h"
+#include "javastorageentry.h"
+#include "javastorage.h"
+
+
+#include "javacommonutils.h"
+#include "logger.h"
+
+
+using namespace std;
+using namespace java::storage;
+using namespace java::backup;
+
+// ======== MEMBER FUNCTIONS ========
+
+CMidp2BackupPlugin::CMidp2BackupPlugin()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin constructor");
+}
+
+void CMidp2BackupPlugin::ConstructL()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ConstructL");
+
+ iIconDescIndex = 0;
+ iBufferSpaceLeft = 0;
+ iFirstCallToGetBackupDataSection = ETrue;
+ iStorageDataBackup = ETrue;
+ iScrDataBackup = ETrue;
+ iStorageDataRestore = ETrue;
+ iJavaVersionInfoWritten = EFalse;
+ iRestoreState = EVersion;
+
+ User::LeaveIfError(iFs.Connect());
+ // to share file handles with AppArc
+ User::LeaveIfError(iFs.ShareProtected());
+
+ iStorageBackupUtil = CStorageBackupUtil::NewL();
+
+ //iAppArcUtil = CAppArcBackupUtil::NewL(iFs);
+
+ iScrBackupUtil = CScrBackupUtil::NewL();
+}
+
+CMidp2BackupPlugin* CMidp2BackupPlugin::NewL()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::NewL");
+
+ CMidp2BackupPlugin* self = new(ELeave) CMidp2BackupPlugin();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+}
+
+CMidp2BackupPlugin::~CMidp2BackupPlugin()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin destructor");
+
+ iFs.Close();
+ iIconUidArray.Close();
+ //delete iAppArcUtil;
+ delete iIconDesc;
+ delete iRestoreIconDesc;
+ delete iStorageBackupUtil;
+}
+
+// from base class CBackupPlugin
+
+void CMidp2BackupPlugin::PrepareForBURL(TInt aBackupStateValue)
+{
+ (void)aBackupStateValue; // Just to suppress a warning in release builds
+ LOG1(EBackup, EInfo, "CMidp2BackupPlugin::PrepareForBURL, BUR state: %d", aBackupStateValue);
+}
+
+void CMidp2BackupPlugin::ReceiveSnapshotDataL(TDriveNumber /* aDrive */, TDesC8& /* aBuffer */, TBool /* aLastSection */)
+{
+ JELOG2(EBackup);
+ User::Leave(KErrNotSupported);
+}
+
+TUint CMidp2BackupPlugin::GetExpectedDataSize(TDriveNumber /* aDrive */)
+{
+ JELOG2(EBackup);
+ return 0;
+}
+
+void CMidp2BackupPlugin::GetSnapshotDataL(TDriveNumber /* aDrive */, TPtr8& /* aBuffer */, TBool& /* aFinished */)
+{
+ JELOG2(EBackup);
+ User::Leave(KErrNotSupported);
+}
+
+void CMidp2BackupPlugin::InitialiseGetBackupDataL(TDriveNumber aDrive)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseGetBackupDataL");
+ iDrive = aDrive;
+}
+
+void CMidp2BackupPlugin::GetBackupDataSectionL(TPtr8& aBuffer, TBool& aFinished)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::GetBackupDataSectionL");
+
+ iBufferSpaceLeft = aBuffer.MaxLength();
+ RDesWriteStream stream(aBuffer);
+ CleanupClosePushL(stream);
+
+ if (!iJavaVersionInfoWritten)
+ {
+ JavaVersionBackupUtil::WriteJavaVersionL(stream);
+ iJavaVersionInfoWritten = ETrue;
+ iBufferSpaceLeft -= 8;
+ }
+
+ if (iStorageDataBackup)
+ {
+ iStorageBackupUtil->BackupStorageDataL(stream, iStorageDataBackup, iBufferSpaceLeft);
+ aFinished = EFalse;
+ }
+ else if(iScrDataBackup)
+ {
+ iScrBackupUtil->BackupScrDataL(stream,iScrDataBackup,iBufferSpaceLeft);
+ aFinished = EFalse;
+ }
+
+ CleanupStack::PopAndDestroy(&stream);
+}
+
+
+void CMidp2BackupPlugin::InitialiseRestoreBaseDataL(TDriveNumber aDrive)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::InitialiseRestoreBaseDataL");
+ iDrive = aDrive;
+}
+
+void CMidp2BackupPlugin::RestoreBaseDataSectionL(TDesC8& aBuffer, TBool aFinished)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreBaseDataSectionL");
+
+ iBufferSpaceLeft = aBuffer.Size();
+ RDesReadStream stream(aBuffer);
+ CleanupClosePushL(stream);
+ TBool versionCheck = ETrue;
+
+ if (((iRestoreState == EVersion) || (iRestoreState == EInstall)) && iBufferSpaceLeft >= 8)
+ {
+ if (iRestoreState == EInstall)
+ {
+ versionCheck = EFalse;
+ }
+ TUint ret = JavaVersionBackupUtil::CheckJavaVersionL(stream,iDrive,versionCheck);
+ if (1==ret)
+ {
+ // Here set the satus to restore finished, so that control goes back to SBE & SBE calls B&R for another drive
+ iRestoreState = EInstall;
+ }
+ else
+ {
+ /* version information has been written to stream.
+ So change restore state to restore storage data */
+ iRestoreState = EStorage;
+ }
+ // version information is of length 8 bytes.
+ iBufferSpaceLeft -= 8;
+ }
+
+ if (iRestoreState == EStorage)
+ {
+ iStorageBackupUtil -> RestoreStorageDataL(stream, iRestoreState, iBufferSpaceLeft);
+ }
+
+ if(iRestoreState == EScr)
+ {
+ iScrBackupUtil->RestoreScrDataL(stream,iRestoreState,iBufferSpaceLeft);
+ }
+ // Only at first call
+ if ((iRestoreState != EScr && iRestoreState != EVersion) && (iRestoreState != EInstall))
+ {/*
+ if (iRestoreState == EAppArc)
+ {
+ // Making AppArc deregistrations
+ TRAPD(err, iAppArcUtil->DeregisterAppsL(iDrive));
+
+ if (err)
+ {
+ ELOG(EBackup, "Leave in deregistering apps");
+ }
+ }
+
+ // Process the data buffer for restore
+ ProcessBufferL(stream);
+
+ if (aFinished)
+ {
+ // Set state to EStorage
+ iRestoreState = EStorage;
+ }
+ */ }
+
+ aFinished = ETrue;
+ CleanupStack::PopAndDestroy(&stream);
+}
+
+void CMidp2BackupPlugin::InitialiseRestoreIncrementDataL(TDriveNumber /* aDrive */)
+{
+ JELOG2(EBackup);
+ User::Leave(KErrNotSupported);
+}
+
+void CMidp2BackupPlugin::RestoreIncrementDataSectionL(TDesC8& /* aBuffer */, TBool /* aFinished */)
+{
+ JELOG2(EBackup);
+ User::Leave(KErrNotSupported);
+}
+
+void CMidp2BackupPlugin::RestoreComplete(TDriveNumber /* aDrive */)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreComplete");
+}
+
+TUint CMidp2BackupPlugin::MmcIdL()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::MmcIdL()");
+
+ TVolumeInfo* volumeInfo = new(ELeave) TVolumeInfo();
+
+ TInt err = iFs.Volume(*volumeInfo, iDrive);
+
+ if (!err)
+ {
+ TUint mmcId = volumeInfo->iUniqueID;
+ return mmcId;
+ }
+ else
+ {
+ return 0;
+ }
+
+
+}
+/*
+void CMidp2BackupPlugin::ProcessBufferL(RDesReadStream& stream)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessBuffer()");
+
+ // Cycle until there's data in the buffer
+ while (iBufferSpaceLeft > 0)
+ {
+ switch (iRestoreState)
+ {
+ case EAppArc:
+ ProcessFirstBufferL(stream, iBufferSpaceLeft);
+ break;
+
+ case EInIcon:
+ ProcessInIconL(stream, iBufferSpaceLeft);
+ break;
+
+ case EInSize:
+ ProcessInSizeL(stream, iBufferSpaceLeft);
+ break;
+
+ default:
+ CleanupStack::PopAndDestroy(&stream);
+ User::Leave(KErrNotSupported);
+ }
+ }
+}
+*/
+
+_LIT(KStarWildCard, "*.*");
+
+void CMidp2BackupPlugin::RestoreMmcRegistryL()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::RestoreMmcRegistry()");
+
+ /* If backed up MMC is not the same as the current MMC, copy the entries
+ from the directory of the backed up MMC to the directory
+ of the current MMC */
+ TUint32 mmc = MmcIdL();
+
+ if (iBackupMmc != mmc)
+ {
+ // Create path to old place
+ TPath path_old;
+ CreateMmcPath(path_old, iDrive, iBackupMmc);
+
+ // Create path to new place
+ TPath path_new;
+ CreateMmcPath(path_new, iDrive, mmc);
+
+ // Get old files list
+ CFileMan* fileMan = CFileMan::NewL(iFs);
+
+ CleanupStack::PushL(fileMan);
+
+ // Copy to new place
+ iFs.MkDir(path_new);
+ path_old.Append(KStarWildCard);
+ TInt err = fileMan->Copy(path_old, path_new);
+
+ ILOG1(EBackup, "File copy, status: %d", err);
+
+ User::LeaveIfError(err);
+
+ CleanupStack::PopAndDestroy();
+ }
+}
+
+_LIT(KPrivatePath, "C:\\private\\");
+
+void CMidp2BackupPlugin::CreateMmcPath(TDes& aPathName, TInt aDrive, TUint aUniqueId)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::CreateMmcPath()");
+
+ aPathName.Zero();
+ aPathName.Append(KPrivatePath);
+ aPathName.AppendNum(KRegistryServerUid, EHex);
+ aPathName.Append(KPathDelimiter);
+
+ // append drive name
+ TDriveUnit driveUnit(aDrive);
+ aPathName.Append(driveUnit.Name().Left(1));
+ aPathName.Append(KPathDelimiter);
+
+ TUint64 id = aUniqueId;
+ aPathName.AppendNum(id, EHex);
+ aPathName.Append(KPathDelimiter);
+}
+/*
+TBool CMidp2BackupPlugin::NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::NextIcon()");
+
+ if (iIconUidArray.Count() > iIconFilePointer)
+ {
+ aCurrentUid = iIconUidArray[iIconFilePointer];
+ iAppArcUtil->GetIconFilename(iIconUidArray[iIconFilePointer], aFullFileName);
+ iIconFilePointer++;
+ return ETrue;
+ }
+ else
+ {
+ // There are no more icon files
+ return EFalse;
+ }
+}
+
+void CMidp2BackupPlugin::ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessFirstBuffer()");
+
+ if (iDrive >= EDriveE && iDrive <= EDriveZ)
+ {
+ // Read MMC id and restore MMC entries if needed
+ iBackupMmc = aStream.ReadUint32L();
+ aBufferSpaceLeft -= sizeof(iBackupMmc);
+ LOG1(EBackup, EInfo, "Read MMC Id: %u", iBackupMmc);
+ RestoreMmcRegistryL();
+ }
+ if (aBufferSpaceLeft >= sizeof(TInt32))
+ {
+ iIconFileSizeLeft = aStream.ReadInt32L();
+ aBufferSpaceLeft -= sizeof(iIconFileSizeLeft);
+ iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft);
+ iRestoreState = EInIcon;
+ }
+ else
+ {
+ // No more data to read
+ aBufferSpaceLeft = 0;
+ }
+}
+
+void CMidp2BackupPlugin::ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInIcon()");
+
+ TPtr8 restoreIconPtr = iRestoreIconDesc->Des();
+ HBufC8* tempDesc = HBufC8::NewL(iIconFileSizeLeft);
+ CleanupStack::PushL(tempDesc);
+ TPtr8 tempPtr = tempDesc->Des();
+
+ // Icon cannot be read fully
+ if (iIconFileSizeLeft > aBufferSpaceLeft)
+ {
+ aStream.ReadL(tempPtr, aBufferSpaceLeft);
+ restoreIconPtr.Append(tempPtr);
+ iIconFileSizeLeft -= aBufferSpaceLeft;
+ aBufferSpaceLeft = 0;
+ iRestoreState = EInIcon;
+ }
+ // Icon can be read fully
+ else
+ {
+ aStream.ReadL(tempPtr, iIconFileSizeLeft);
+ restoreIconPtr.Append(tempPtr);
+ aBufferSpaceLeft -= iIconFileSizeLeft;
+ iRestoreState = EInSize;
+
+ TRAPD(err, iAppArcUtil->RegisterAppL(restoreIconPtr, iDrive));
+
+ if (err)
+ {
+ ELOG(EBackup, "Registerin application to AppArc failed.");
+ }
+ }
+
+ CleanupStack::PopAndDestroy(tempDesc);
+}
+
+void CMidp2BackupPlugin::ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft)
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ProcessInSize()");
+
+ if (aBufferSpaceLeft >= sizeof(TInt32))
+ {
+ if (iSizeBuffer.Size() != 0)
+ {
+ // Read leftover part of size
+ TInt readData = sizeof(TInt32) - iSizeBuffer.Size();
+ aStream.ReadL(iSizeBuffer, readData);
+ RMemReadStream sizeStream(iSizeBuffer.Ptr(), 4);
+ CleanupClosePushL(sizeStream);
+ iIconFileSizeLeft = sizeStream.ReadInt32L();
+ CleanupStack::PopAndDestroy(&sizeStream);
+ aBufferSpaceLeft -= sizeof(readData);
+ }
+ else
+ {
+ // Read size in full
+ iIconFileSizeLeft = aStream.ReadInt32L();
+ aBufferSpaceLeft -= sizeof(iIconFileSizeLeft);
+ }
+
+ delete iRestoreIconDesc;
+ iRestoreIconDesc = NULL;
+ iRestoreIconDesc = HBufC8::NewL(iIconFileSizeLeft);
+ iRestoreState = EInIcon;
+ }
+ else
+ {
+ // Read first byte(s) of size
+ aStream.ReadL(iSizeBuffer, aBufferSpaceLeft);
+ aBufferSpaceLeft = 0;
+ }
+}
+
+void CMidp2BackupPlugin::ResetIconArray()
+{
+ LOG(EBackup, EInfo, "CMidp2BackupPlugin::ResetIconArray()");
+
+ // Remove all entries
+ while (iIconUidArray.Count())
+ {
+ iIconUidArray.Remove(0);
+ }
+}
+*/
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/midp2backuppluginusif.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,411 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Header file for CMidp2BackupPlugin class with USIF changes
+*
+*/
+#ifndef MIDP2BACKUPPLUGINUSIF_H_
+#define MIDP2BACKUPPLUGINUSIF_H_
+
+#include "backupplugin.h"
+#include <apadef.h>
+#include "logger.h"
+
+class RDesWriteStream;
+class RDesReadStream;
+
+namespace java
+{
+namespace backup
+{
+
+
+class CJavaVersionBackupUtil;
+class CStorageBackupUtil;
+class CScrBackupUtil;
+
+
+/**
+ * CMidp2BackupPlugin class is handling backup and restore operations
+ * for MIDlets
+ *
+ * This class is instantiated when a BUR operation is starting.
+ */
+class CMidp2BackupPlugin : public CBackupPlugin
+{
+
+public:
+
+ /**
+ * Instantiates an object of this type
+ */
+ static CMidp2BackupPlugin* NewL();
+
+ ~CMidp2BackupPlugin();
+
+
+ // from base class CBackupPlugin
+
+ /**
+ * This method is called when a backup or restore operation is
+ * starting. Preparations can be done to prepare for BUR.
+ *
+ * @param aBackupStateValue the value of the current backup state
+ */
+ void PrepareForBURL(TInt aBackupStateValue);
+
+ /**
+ * This method receives all or part of a snapshot of data to allow
+ * calculation of an incremental backup. The snapshot is one that
+ * was previously supplied by the data owner. The snapshot data
+ * should be read from the location supplied. The snapshot data may
+ * be larger than the location supplied in which case the routine
+ * will be called repeatedly until all data has been supplied.
+ *
+ * Snapshot data will also be supplied as part of a restore operation
+ *
+ * @param aDrive the drive being backed up
+ * @param aBuffer a pointer to the base of the location from whence
+ * data can be copied.
+ * @param aLastSection ETrue if this is the last section of snapshot
+ * data, else EFalse.
+ */
+ void ReceiveSnapshotDataL(TDriveNumber aDrive,
+ TDesC8& aBuffer,
+ TBool aLastSection);
+
+ /**
+ * This method returns the expected size of backup data that will be
+ * supplied. If an incremental backup is underway then this method
+ * will not be called until after ReceiveSnapshotDataL().
+ * The size data will be used for the purpose of tracking progess
+ * during a backup. If it is inaccurate then the user may see
+ * irregular progress but the actual backup data will not be
+ * affected so it is acceptable to return an estimated value.
+ *
+ * @param aDrive the drive being backed up.
+ * @return the size of the data that will be returned
+ */
+ TUint GetExpectedDataSize(TDriveNumber aDrive);
+
+ /**
+ * This method returns a snapshot of data to accompany a backup. The
+ * snapshot is expected to contain details on files / data being
+ * backed up. The format of the snapshot is only meaningful to the
+ * data owner. The snapshot will be supplied if the data owner is
+ * asked for an incremental backup and for a restore operation. The
+ * snapshot data should be copied to the location supplied.
+ *
+ * The snapshot data may be larger than the location supplied in
+ * which case the routine will be called repeatedly until all data
+ * has been retrieved.
+ *
+ * @param aDrive the drive being backed up
+ * @param aBuffer a pointer to the base of the location where data
+ * can be copied.
+ * @param aFinished on return ETrue if all data has been returned
+ * for this drive, else EFalse.
+ */
+ void GetSnapshotDataL(TDriveNumber aDrive,
+ TPtr8& aBuffer,
+ TBool& aFinished);
+
+ /**
+ * This method prepares the implementor to return backup data. It
+ * will be followed by a sequence of calls to request the actual
+ * data.
+ *
+ * @param aDrive the drive being backed up.
+ */
+ void InitialiseGetBackupDataL(TDriveNumber aDrive);
+
+ /**
+ * This method requests a section of backup data.
+ * InitialiseGetBackupDataL() will have been called previously to
+ * specify the drive concerned. The data returned may be base or
+ * incremental depending on the type of backup and the capability of
+ * the data owner.
+ *
+ * @param aBuffer a pointer to the base of the location where data
+ * can be copied.
+ * @param aFinished on return ETrue if all data has been returned
+ * for this drive, else EFalse.
+ */
+ void GetBackupDataSectionL(TPtr8& aBuffer,
+ TBool& aFinished);
+
+ /**
+ * This method prepares the implementor to receive base restore data
+ * for a drive. It will be followed by a sequence of calls to supply
+ * the actual data.
+ *
+ * @param aDrive the drive being restored.
+ */
+ void InitialiseRestoreBaseDataL(TDriveNumber aDrive);
+
+ /**
+ * This method receives a section of base restore data.
+ * InitialiseRestoreBaseDataL() will have been called previously to
+ * specify the drive concerned.
+ *
+ * @param aBuffer a pointer to the base of the location whence data
+ * can be read.
+ * @param aFinished ETrue if all data has been returned for this
+ * drive, else EFalse.
+ */
+ void RestoreBaseDataSectionL(TDesC8& aBuffer,
+ TBool aFinished);
+
+ /**
+ * This method prepares the implementor to receive incremental
+ * restore data for a drive. It will be followed by a sequence
+ * of calls to supply the actual data. If multiple increments
+ * are supplied then this methid will be called before each increment
+ *
+ * @param aDrive the drive being restored.
+ */
+ void InitialiseRestoreIncrementDataL(TDriveNumber aDrive);
+
+ /**
+ * This method receives a section of increment restore data.
+ * InitialiseRestoreIncrementDataL() will have been called
+ * previously to specify the drive concerned.
+ *
+ * @param aBuffer a pointer to the base of the location whence data
+ * can be read.
+ * @param aFinished ETrue if all data has been returned for this
+ * increment, else EFalse.
+ */
+ void RestoreIncrementDataSectionL(TDesC8& aBuffer,
+ TBool aFinished);
+
+ /**
+ * This method is called when all data to be restored has been
+ * supplied.
+ *
+ * @param aDrive the drive being restored.
+ */
+ void RestoreComplete(TDriveNumber aDrive);
+
+private:
+
+ CMidp2BackupPlugin();
+
+ void ConstructL();
+
+ /**
+ * This method is called to get the unique Id of the current MMC
+ *
+ * @return The Id of the MMC, or 0, if no MMC is inserted
+ */
+ TUint MmcIdL();
+
+ /**
+ * This method is called to process the content of the buffer
+ * provided in active phase of restore
+ *
+ * @param aBuffer the buffer to process
+ */
+ void ProcessBufferL(RDesReadStream& stream);
+
+ /**
+ * This method is called to restore the Java Registry entries
+ * on the MMC, if needed
+ */
+ void RestoreMmcRegistryL();
+
+ /**
+ * This method creates the path for the Java Registry entries on
+ * the specified MMC
+ *
+ * @param [out] aPathName path of the entries of the MMC
+ * @param aDrive drive of the MMC
+ * @param aUniqueId Unique Id of the MMC
+ */
+ void CreateMmcPath(TDes& aPathName,
+ TInt aDrive,
+ TUint aUniqueId);
+
+ /**
+ * This method gets the path for the next icon file to be backed up
+ *
+ * @param [out] aCurrentUid Uid of the next icon
+ * @param [out] aFullFileName path of the next icon
+ * @return EFalse if there are no more icons in the array, ETrue
+ * otherwise
+ */
+ //TBool NextIcon(TUid& aCurrentUid, HBufC*& aFullFileName);
+
+ /**
+ * Process buffer when restore state is EFirstBuffer
+ *
+ * @param aStream readstream of buffer to process
+ * @param aBufferSpaceLeft space left of buffer to be processed
+ */
+ // void ProcessFirstBufferL(RDesReadStream& aStream, TInt& aBufferSpaceLeft);
+
+ /**
+ * Process buffer when restore state is EInIcon
+ *
+ * @param aStream readstream of buffer to process
+ * @param aBufferSpaceLeft space left of buffer to be processed
+ */
+ // void ProcessInIconL(RDesReadStream& aStream, TInt& aBufferSpaceLeft);
+
+ /**
+ * Process buffer when restore state is EInSize
+ *
+ * @param aStream readstream of buffer to process
+ * @param aBufferSpaceLeft space left of buffer to be processed
+ */
+ //void ProcessInSizeL(RDesReadStream& aStream, TInt& aBufferSpaceLeft);
+
+ /**
+ * Resets the array of icons to be backed up
+ */
+ //void ResetIconArray();
+
+private: // data
+
+ /**
+ * File session
+ * Own.
+ */
+ RFs iFs;
+
+ /**
+ * StorageBackupUtil object for storage B&R
+ * Own.
+ */
+ CStorageBackupUtil* iStorageBackupUtil;
+ /**
+ * CScrBackupUtil object for SCR B&R
+ * Own.
+ */
+ CScrBackupUtil* iScrBackupUtil;
+ /**
+ * The drive that is backed up or restored currently
+ * Own.
+ */
+ TDriveNumber iDrive;
+
+ /**
+ * Id of backed up drive, gets its value from restored data
+ * Own.
+ */
+ TInt32 iBackupDrive;
+
+ /**
+ * Id of backed up MMC, gets its value from restored data
+ * Own.
+ */
+ TUint32 iBackupMmc;
+
+ /**
+ * State of streaming during restore
+ * Own.
+ */
+ TInt iRestoreState;
+
+ /**
+ * Shows if it's the first call to GetBackupDataSectionL
+ * Own.
+ */
+ TBool iFirstCallToGetBackupDataSection;
+
+ /**
+ * Shows if Backup of storage data is finished or not
+ * Own.
+ */
+ TBool iStorageDataBackup;
+ /**
+ * Shows if Backup of SCR is finished or not
+ * Own.
+ */
+ TBool iScrDataBackup;
+
+ /**
+ * Shows if Restore of storage data is finished or not
+ * Own.
+ */
+ TBool iStorageDataRestore;
+
+ /**
+ * Shows if Java version information is already written or not
+ * Own
+ */
+ TBool iJavaVersionInfoWritten;
+
+ /**
+ * Shows if its the first call to restore data or not.
+ * Own.
+ */
+ TBool iFirstCallToRestoreBackupDataSection;
+
+ /**
+ * Stores the uids of the midlets whose icons are to be backed up.
+ * Own.
+ */
+ RArray<TUid> iIconUidArray;
+
+ /**
+ * The current index in the icon file array
+ * Own.
+ */
+ TInt iIconFilePointer;
+
+ /**
+ * Stores the current icon file for streaming
+ * This descriptor will be streamed at subsequent calls of
+ * GetBackupDataSectionL()
+ * Own.
+ */
+ HBufC8* iIconDesc;
+
+ /**
+ * Stores the current icon file being restored
+ * Own.
+ */
+ HBufC8* iRestoreIconDesc;
+
+ /**
+ * Size of the icon to be still read during restore
+ * Own.
+ */
+ TInt32 iIconFileSizeLeft;
+
+ /**
+ * Current index of iIconDesc
+ * Own.
+ */
+ TInt iIconDescIndex;
+
+ /**
+ * Holds the remaining bytes in the buffer
+ * Own
+ */
+
+ TInt iBufferSpaceLeft;
+
+ /**
+ * Buffer for storing data size in restore
+ * Own.
+ */
+ TBuf8<4> iSizeBuffer;
+};
+
+
+
+} //namespace backup
+} //namespace java
+#endif /* MIDP2BACKUPPLUGINUSIF_H_ */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javabackup/midp2backup_usif/src.s60/proxy.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This module contains the ECom plugin UID and mappings.
+*
+*/
+
+
+// system include files
+#include <e32std.h>
+#include <ecom/implementationproxy.h>
+
+#include "midp2backupplugin.h"
+
+
+
+// Map the interface UIDs to implementation factory functions
+const TImplementationProxy ImplementationTable[] =
+{
+ IMPLEMENTATION_PROXY_ENTRY(KBackupEcomImplUid, CMidp2BackupPlugin::NewL)
+};
+
+// Exported proxy for instantiation method resolution
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+{
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+ return ImplementationTable;
+}
+
--- a/javamanager/javacaptain/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -22,4 +22,6 @@
#include "extensionplugins/config/build/bld.inf"
#include "extensionplugins/javacertstore/build/bld.inf"
#include "extensionplugins/storageserver/build/bld.inf"
-#include "extensionplugins/preinstallerstarter/build/bld.inf"
+#include "extensionplugins/settingslistener/build/bld.inf"
+#include "extensionplugins/preinstallerstarter/build/bld.inf"
+#include "extensionplugins/autostarter/build/bld.inf"
--- a/javamanager/javacaptain/build/javacaptain_0x200211DC.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/build/javacaptain_0x200211DC.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javacaptain.mmp
@@ -54,7 +54,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../rtcplugins/midp/inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/autostarter/build/bld.inf Thu Aug 19 09:48:13 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
+javacaptain_ext_autostarter_0x2002EA7E.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/autostarter/build/bwins/javacaptain_ext_autostarteru.def Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+ ?findDllMethod@@YAP6APAXXZPBD@Z @ 1 NONAME ; void * (*)(void) findDllMethod(char const *)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/autostarter/build/eabi/javacaptain_ext_autostarteru.def Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+ _Z13findDllMethodPKc @ 1 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter.pro Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: autostarter is plugin for Java Captain that starts auto start
+# MIDlets
+#
+
+TEMPLATE=lib
+TARGET=javacaptain_ext_autostarter
+CONFIG += omj stl
+CONFIG -= qt
+
+
+LIBS += -ljavacomms -ljavastorage -lapparc -lapgrfx
+
+include(../../../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/autostarter/build/javacaptain_ext_autostarter_0x2002EA7E.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,139 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated file - do not edit manually
+*
+*/
+
+// ==============================================================================
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
+// This file is generated by qmake and should not be modified by the
+// user.
+// Name : javacaptain_ext_autostarter.mmp
+// ==============================================================================
+
+TARGET javacaptain_ext_autostarter.dll
+TARGETTYPE DLL
+
+UID 0x1000008d 0x2002EA7E
+SECUREID 0x2002EA7E
+
+EPOCALLOWDLLDATA
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO RD_JAVA_SYMBIAN_TARGET
+MACRO RD_JAVA_S60_RELEASE_9_2
+MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
+MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
+MACRO RD_JAVA_STDCPPV5
+MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
+MACRO RD_JAVA_HTTP_EMC_ENABLED
+MACRO RD_JAVA_NGA_ENABLED
+MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
+MACRO RD_JAVA_OPENC_BETA_PATCH
+MACRO RD_JAVA_INSTALLERUI_ENABLED
+MACRO RD_JAVA_PREWARM
+MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+MACRO RD_JAVA_MIDPRMS_DB
+MACRO __SYMBIAN32__
+MACRO J9EPOC32
+
+SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../inc
+SYSTEMINCLUDE ../../../inc
+SYSTEMINCLUDE ../../../../inc
+SYSTEMINCLUDE ../../../../../inc
+SYSTEMINCLUDE ../src.s60
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE .
+
+SOURCEPATH ../src.s60
+SOURCE autostarter.cpp
+SOURCE lookup.cpp
+
+
+LIBRARY javacomms.lib
+LIBRARY javastorage.lib
+LIBRARY apparc.lib
+LIBRARY apgrfx.lib
+LIBRARY javautils.lib
+LIBRARY libpthread.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY euser.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY avkon.lib
+LIBRARY efsrv.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+
+CAPABILITY all -tcb
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+#if defined(ARMCC_4_0)
+OPTION ARMCC --import_all_vtbl
+#endif
+OPTION GCCE -fvisibility-inlines-hidden
+
+VERSION 10.0
+
+ARMFPU softvfp
+
+PAGED
+
+BYTEPAIRCOMPRESSTARGET
+
+USERINCLUDE .
+
+#include <platform_paths.hrh>
+
+ APP_LAYER_SYSTEMINCLUDE
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE
+
+ OS_LAYER_SSL_SYSTEMINCLUDE
+
+deffile ./~/javacaptain_ext_autostarter.def
+
+ SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
+
+SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
+
+#ifdef WINSCW
+
+LIBRARY ewsd.lib
+
+#endif
+
+STDCPP
+
+#ifdef WINSCW
+DEFFILE ./bwins/javacaptain_ext_autostarter.def
+#elif defined EABI
+DEFFILE ./eabi/javacaptain_ext_autostarter.def
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/autostarter/inc/autostarter.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: autostarter is Java Captain Symbian plugin that starts
+* auto start Java applications after they have been installed
+* and when the device boots.
+*
+*/
+
+#ifndef AUTOSTARTER_H
+#define AUTOSTARTER_H
+
+#include "javaosheaders.h"
+
+#include "eventconsumerinterface.h"
+#include "extensionplugininterface.h"
+
+namespace java
+{
+
+namespace captain
+{
+
+class CoreInterface;
+
+OS_NONSHARABLE_CLASS(AutoStarter) : public EventConsumerInterface,
+ public ExtensionPluginInterface
+{
+public:
+ AutoStarter();
+ virtual ~AutoStarter();
+
+ // PluginInterface
+ virtual void startPlugin(CoreInterface* aCore);
+ virtual void stopPlugin();
+
+ // EventConsumerInterface
+ virtual void event(const std::string& eventProvider,
+ java::comms::CommsMessage& aMsg);
+
+ // ExtensionPluginInterface methods
+ virtual EventConsumerInterface* getEventConsumer();
+
+private:
+ bool isMIDletPresent(const std::wstring& aUid);
+ bool startMIDletL(const std::wstring& aUid);
+ void checkMIDletsToBeStartedL();
+
+ CoreInterface* mCore;
+};
+
+} // namespace captain
+} // namespace java
+
+#endif // AUTOSTARTER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/autostarter/src.s60/autostarter.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,328 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: autostarter is Java Captain Symbian plugin that starts
+* auto start Java applications after they have been installed
+* and when the device boots.
+*
+*/
+
+#include <apgcli.h> // for RApaLsSession
+#include <e32base.h>
+#include <f32file.h>
+#include <javastorage.h>
+#include <javastorageentry.h>
+#include <javastoragenames.h>
+#include <memory>
+
+#include "commsendpoint.h"
+#include "coreinterface.h"
+#include "javaprocessconstants.h"
+#include "javasymbianoslayer.h"
+#include "javauid.h"
+#include "javauids.h"
+#include "logger.h"
+#include "preinstallerstartermessages.h"
+#include "rtcinterface.h"
+#include "rtcmessages.h"
+
+#include "autostarter.h"
+
+
+using namespace java::storage;
+using namespace java::util;
+
+
+/**
+ * Return pointer to ExtensionPluginInterface implementation for this
+ * extension dll
+ */
+java::captain::ExtensionPluginInterface* getExtensionPlugin()
+{
+ return new java::captain::AutoStarter();
+}
+
+namespace java // codescanner::namespace
+{
+namespace captain // codescanner::namespace
+{
+
+/**
+ * Empty contructor
+ */
+AutoStarter::AutoStarter() : mCore(0)
+{
+}
+
+/**
+ * Empty destructor
+ */
+AutoStarter::~AutoStarter()
+{
+}
+
+/**
+ * Implement PluginInterface method
+ */
+void AutoStarter::startPlugin(CoreInterface* core)
+{
+ LOG(EJavaCaptain, EInfo, "AutoStarter plugin started");
+
+ mCore = core;
+}
+
+/**
+ * Implement PluginInterface method
+ */
+void AutoStarter::stopPlugin()
+{
+ mCore = 0;
+}
+
+/**
+ * Implement ExtensionPluginInterface method
+ */
+EventConsumerInterface* AutoStarter::getEventConsumer()
+{
+ return this;
+}
+
+/**
+ * Handle Java Captain events sent by Boot event provider or
+ * preinstaller starter
+ *
+ * Implement EventConsumerInterface method
+ */
+void AutoStarter::event(const std::string& eventProvider,
+ java::comms::CommsMessage& aMsg)
+{
+ LOG1(EJavaCaptain, EInfo, "AutoStarter::event received, id %d", aMsg.getMessageId());
+
+ if (eventProvider == PREINSTALLER_EVENT_PROVIDER)
+ {
+ int exitStatus = 0;
+ getPreinstallerExitedMessageParams(aMsg, exitStatus);
+ LOG1(
+ EJavaCaptain,
+ EInfo,
+ "AutoStarter::event() preinstaller exited event received (status=%d)",
+ exitStatus);
+
+ // Start auto-start MIDlets
+ TRAPD(err, checkMIDletsToBeStartedL())
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaCaptain, "AutoStarter::checkMIDletsToBeStartedL: leaved (%d)", err);
+ }
+ }
+}
+
+/**
+ *
+ *
+ */
+void AutoStarter::checkMIDletsToBeStartedL()
+{
+ // Find all MIDlets with Nokia-MIDlet-auto-start
+ // APPLICATION_TABLE, if (AUTORUN == AUTOSTART_TRUE) || (AUTORUN == AUTOSTART_ONCE),
+ // call startMIDletL(ID)
+
+ LOG(EJavaCaptain, EInfo, "AutoStarter::checkMIDletsToBeStartedL called");
+
+ std::auto_ptr<JavaStorage> js(JavaStorage::createInstance());
+ try
+ {
+ js->open(JAVA_DATABASE_NAME);
+
+ // In Java Storage there is 'APPLICATION_TABLE' table that contains
+ // the Uid of the application in ID column. The value in column AUTORUN is
+ // one of the following AUTOSTART_FALSE (0), AUTOSTART_TRUE (1) or
+ // AUTOSTART_ONCE (2)
+
+ JavaStorageEntry attribute;
+ JavaStorageApplicationEntry_t findPattern;
+ JavaStorageApplicationList_t foundEntries;
+
+ // Get all IDs from APPLICATION_TABLE where AUTORUN is AUTOSTART_TRUE
+ attribute.setEntry(AUTORUN, L"1");
+ findPattern.insert(attribute);
+ attribute.setEntry(ID, L"");
+ findPattern.insert(attribute);
+
+ js->search(APPLICATION_TABLE, findPattern, foundEntries);
+ findPattern.clear();
+
+ // Iterate through all found applications
+ JavaStorageApplicationList_t::const_iterator appIterator;
+ for (appIterator = foundEntries.begin(); appIterator != foundEntries.end(); ++appIterator)
+ {
+ std::wstring applicationId = appIterator->begin()->entryValue();
+
+ LOG1WSTR(EJavaCaptain, EInfo,
+ "AutoStarter::checkMIDletsToBeStartedL : going to start MIDlet, uid is %s",
+ applicationId);
+
+ startMIDletL(applicationId);
+ }
+ foundEntries.clear();
+
+
+ // Get all IDs from APPLICATION_TABLE where AUTORUN is AUTOSTART_ONCE
+ attribute.setEntry(AUTORUN, L"2");
+ findPattern.insert(attribute);
+ attribute.setEntry(ID, L"");
+ findPattern.insert(attribute);
+
+ js->search(APPLICATION_TABLE, findPattern, foundEntries);
+ findPattern.clear();
+
+ // Iterate through all found applications
+ for (appIterator = foundEntries.begin(); appIterator != foundEntries.end(); ++appIterator)
+ {
+ std::wstring applicationId = appIterator->begin()->entryValue();
+
+ LOG1WSTR(EJavaCaptain, EInfo,
+ "AutoStarter::checkMIDletsToBeStartedL : going to start MIDlet (once), uid is %s",
+ applicationId);
+
+ if (startMIDletL(applicationId))
+ {
+ // after starting MIDlet must set AUTORUN value to AUTOSTART_FALSE
+ JavaStorageApplicationEntry_t matchEntries;
+
+ JavaStorageApplicationEntry_t updateEntries;
+ JavaStorageEntry attribute;
+
+ attribute.setEntry(ID, applicationId);
+ matchEntries.insert(attribute);
+
+ attribute.setEntry(AUTORUN, L"0");
+ updateEntries.insert(attribute);
+
+ js->update(APPLICATION_TABLE, updateEntries, matchEntries);
+ }
+ }
+ foundEntries.clear();
+ }
+ catch (JavaStorageException& e)
+ {
+ ELOG1(EJavaCaptain,
+ "AutoStarter::checkMIDletsToBeStartedL: Java Storage exception %s", e.what());
+ }
+
+ try
+ {
+ js->close();
+ }
+ catch (JavaStorageException& e2)
+ {
+ WLOG1(EJavaCaptain,
+ "AutoStarter::checkMIDletsToBeStartedL: Java Storage exception "
+ "when closing storage %s", e2.what());
+ }
+}
+
+
+/**
+ *
+ * @return true if launch succeeded, false is starting failed
+ */
+bool AutoStarter::startMIDletL(const std::wstring& aUid)
+{
+ // Try to check whether the MIDlet is present (or whether it has been
+ // installed to a removable media that is not present now)
+ if (!isMIDletPresent(aUid))
+ {
+ return false;
+ }
+
+ // Start MIDlet
+ rtcLaunchInfo launchInfo(aUid);
+
+ bool launchSuccess = mCore->getRtc()->launch(launchInfo);
+ if (!launchSuccess)
+ {
+ ELOG(EJavaCaptain, "AutoStarter::startMIDletL: launching MIDlet failed");
+ }
+
+ return launchSuccess;
+}
+
+
+/**
+ * Try to check whether the MIDlet is present (or whether it has been
+ * installed to a removable media that is not present now)
+ *
+ * @return false if it is certain that the MIDlet is not present, true otherwise
+ */
+bool AutoStarter::isMIDletPresent(const std::wstring& aUid)
+{
+ RApaLsSession apaSession;
+ TInt err = apaSession.Connect();
+ if (KErrNone != err)
+ {
+ // Cannot check presence from AppArc, try to start the MIDlet anyway
+ ELOG1(EJavaCaptain,
+ "AutoStarter::isMIDletPresent: RApaLsSession Connect error %d", err);
+ return true;
+ }
+ CleanupClosePushL(apaSession);
+
+ TUid appUid;
+ Uid javaUid(aUid);
+ err = uidToTUid(javaUid, appUid);
+ if (KErrNone != err)
+ {
+ WLOG1(EJavaCaptain,
+ "AutoStarter::isMIDletPresent: Cannot convert %S to TUid", aUid.c_str());
+ CleanupStack::PopAndDestroy(&apaSession); // apaSession
+ return true;
+ }
+
+ TUid appTypeUid;
+ err = apaSession.GetAppType(appTypeUid, appUid);
+ if (KErrNone != err)
+ {
+ if (KErrNotFound == err)
+ {
+ // The application is not present
+ WLOG1(EJavaCaptain,
+ "AutoStarter::isMIDletPresent: trying to start MIDlet %S that is not present",
+ aUid.c_str());
+ CleanupStack::PopAndDestroy(&apaSession); // apaSession
+ return false;
+ }
+
+ // Cannot check presence from AppArc, try to start the MIDlet anyway
+ ELOG1(EJavaCaptain,
+ "AutoStarter::isMIDletPresent: RApaLsSession GetAppType error %d", err);
+ CleanupStack::PopAndDestroy(&apaSession); // apaSession
+ return true;
+ }
+ else if (appTypeUid.iUid != KMidletApplicationTypeUid)
+ {
+ // The application is present but it is NOT a MIDlet
+ WLOG1(EJavaCaptain,
+ "AutoStarter::isMIDletPresent: tried to start application %S that is not MIDlet",
+ aUid.c_str());
+ CleanupStack::PopAndDestroy(&apaSession); // apaSession
+ return false;
+ }
+
+ CleanupStack::PopAndDestroy(&apaSession); // apaSession
+ return true;
+}
+
+
+} // namespace captain
+} // namespace java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/autostarter/src.s60/lookup.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: lookup
+*
+*/
+
+#include <string> //For strcmp
+
+#include "javasymbianoslayer.h"
+#include "logger.h"
+
+#include "extensionplugininterface.h"
+
+using namespace java::captain;
+
+ExtensionPluginInterface* getExtensionPlugin();
+
+EXPORT_C FuncPtr findDllMethod(const char* funcName)
+{
+ FuncPtr ptr = 0;
+ if (funcName)
+ {
+ if (strcmp(funcName, "getExtensionPlugin") == 0)
+ {
+ ptr = (FuncPtr)getExtensionPlugin;
+ }
+ }
+ else
+ {
+ ELOG(EJavaCaptain,
+ "scrupdater extensionplugin findDllMethod() funcName == null");
+ }
+ return ptr;
+}
--- a/javamanager/javacaptain/extensionplugins/boot/src/booteventprovider.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/boot/src/booteventprovider.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -17,6 +17,8 @@
#include <errno.h>
#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
--- a/javamanager/javacaptain/extensionplugins/config/build/javacaptain_ext_config_0x2002DC9E.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/config/build/javacaptain_ext_config_0x2002DC9E.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javacaptain_ext_config.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/config/src/configextensionplugin.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -74,9 +74,13 @@
#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
mCore->loadExtensionPlugin("scrupdater");
#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+ // This plugin implements support for auto-starting
+ // Java applications
+ mCore->loadExtensionPlugin("autostarter");
#endif // __SYMBIAN32__
mCore->loadExtensionPlugin("boot");
mCore->loadExtensionPlugin("mmc");
+ mCore->loadExtensionPlugin("settingslistener");
}
} // namespace captain
--- a/javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore_0x2002DC9F.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/javacertstore/build/javacaptain_ext_javacertstore_0x2002DC9F.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javacaptain_ext_javacertstore.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -59,7 +59,7 @@
NextState(Initialize());
break;
case EListTokenTypes:
- NextState(ListTokenTypes());
+ NextState(ListTokenTypesL());
break;
case EOpenTokenType:
NextState(OpenTokenType());
@@ -132,11 +132,11 @@
return true;
}
-bool SmartCardCryptoTokenReader::ListTokenTypes()
+bool SmartCardCryptoTokenReader::ListTokenTypesL()
{
TCTTokenTypeAttribute att = { KCTRemovable , 1 };
- iSmartCardTokensAttributes.Append(att);
- iSmartCardTokensInterfaces.Append(TUid::Uid(KInterfaceCertStore));
+ iSmartCardTokensAttributes.AppendL(att);
+ iSmartCardTokensInterfaces.AppendL(TUid::Uid(KInterfaceCertStore));
TCTFindTokenTypesByInterfaceAndAttribute findByIAndA(
iSmartCardTokensInterfaces.Array(), iSmartCardTokensAttributes.Array());
CCTTokenTypeInfo::ListL(iSmartCardTokenTypes, findByIAndA);
--- a/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/javacertstore/src.s60/smartcardcryptotokenreader.h Thu Aug 19 09:48:13 2010 +0300
@@ -61,7 +61,7 @@
SmartCardCryptoTokenReader();
void ConstructL();
bool Initialize();
- bool ListTokenTypes();
+ bool ListTokenTypesL();
bool OpenTokenType();
bool OpenToken();
bool GetTokenInterface();
--- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/javasmartcardcertsunittests.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/javasmartcardcertsunittests.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -14,9 +14,8 @@
* Description:
*
*/
-// #include <oem/bldvariant.hrh>
+
#include <data_caging_paths.hrh>
-//#include <domain/osextensions/platform_paths.hrh>
#include <platform_paths.hrh>
#include <../../../../../../inc/java_stdcpp_support_for_exe.hrh>
--- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/build/testsmartcardtokenplugin.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -29,9 +29,6 @@
CAPABILITY CAP_ECOM_PLUGIN
VENDORID VID_DEFAULT
-systeminclude /epoc32/include
-systeminclude /epoc32/include/ecom
-
sourcepath ../src
source testsmartcardtokenplugin.cpp
--- a/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/src/101F5B72.rss Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/javacertstore/tsrc.s60/src/101F5B72.rss Thu Aug 19 09:48:13 2010 +0300
@@ -14,7 +14,7 @@
* Description:
*
*/
-#include <RegistryInfoV2.rh>
+#include <ecom/RegistryInfoV2.rh>
#include <ct/InterfaceUID.hrh>
// True
--- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -20,3 +20,4 @@
PRJ_MMPFILES
javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp
+#include "exports.inf"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/exports.inf Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+PRJ_EXPORTS
+../inc/preinstallerstartermessages.h |../../../../../inc/preinstallerstartermessages.h
--- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter_0x2002DCA0.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javacaptain_ext_preinstallerstarter.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstarter.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstarter.h Thu Aug 19 09:48:13 2010 +0300
@@ -33,7 +33,8 @@
class CoreInterface;
-OS_NONSHARABLE_CLASS(PreinstallerStarter) : public EventConsumerInterface,
+OS_NONSHARABLE_CLASS(PreinstallerStarter) : public CActive,
+ public EventConsumerInterface,
public ExtensionPluginInterface
{
public:
@@ -51,11 +52,19 @@
// ExtensionPluginInterface methods
virtual EventConsumerInterface* getEventConsumer();
+protected:
+ // CActive
+ virtual void RunL();
+ virtual void DoCancel();
+
private:
void startPreinstaller(TBool aIadBoot);
+#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
void registerMidletApplicationTypeHandler();
+#endif
CoreInterface* mCore;
+ RProcess* mPreinstaller;
};
} // namespace captain
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/inc/preinstallerstartermessages.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,62 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: PreinstallerStarterMessages
+*
+*/
+
+#ifndef PREINSTALLERSTARTERMESSAGES_H
+#define PREINSTALLERSTARTERMESSAGES_H
+
+#include "logger.h"
+#include "commsmessage.h"
+
+namespace java
+{
+namespace captain
+{
+
+using namespace java::util;
+using namespace java::comms;
+
+// This event is sent when preinstaller process has exited
+const int PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C = 30;
+
+const char PREINSTALLER_EVENT_PROVIDER[] = "preinstaller";
+
+
+inline void setPreinstallerExitedMessageParams(CommsMessage& aMessage, const int& aExitStatus)
+{
+ aMessage.setMessageId(PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C);
+ aMessage << aExitStatus;
+}
+
+inline void getPreinstallerExitedMessageParams(CommsMessage& aMessage, int& aExitStatus)
+{
+ if (aMessage.getMessageId() == PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C)
+ {
+ aMessage >> aExitStatus;
+ }
+ else
+ {
+ ELOG2(EJavaCaptain, "wrong MessageId!: %d should be %d",
+ aMessage.getMessageId(), PREINSTALLER_EVENT_MESSAGE_ID_EXITED_C);
+ aExitStatus = 0;
+ }
+}
+
+
+} // namespace captain
+} // namespace java
+
+#endif // PREINSTALLERSTARTERMESSAGES_H
--- a/javamanager/javacaptain/extensionplugins/preinstallerstarter/src.s60/preinstallerstarter.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/preinstallerstarter/src.s60/preinstallerstarter.cpp Thu Aug 19 09:48:13 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"
@@ -19,7 +19,9 @@
#include <e32base.h>
+#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
#include <apgcli.h> // for RApaLsSession
+#endif
#include <hal_data.h>
#include <hal.h>
#include <sysutil.h>
@@ -31,6 +33,7 @@
#include "coreinterface.h"
#include "booteventprovidermessages.h"
#include "mmceventprovidermessages.h"
+#include "preinstallerstartermessages.h"
#include "preinstallerstarter.h"
@@ -52,19 +55,19 @@
using java::fileutils::DriveListenerInterface;
/**
- * Empty contructor
+ * Initialize member varaibles in constructor
*/
-PreinstallerStarter::PreinstallerStarter() : mCore(0)
+PreinstallerStarter::PreinstallerStarter() :
+ CActive(EPriorityStandard), mCore(0), mPreinstaller(0)
{
- JELOG2(EJavaCaptain);
}
/**
- * Empty destructor
+ * Destructor
*/
PreinstallerStarter::~PreinstallerStarter()
{
- JELOG2(EJavaCaptain);
+ DoCancel();
}
/**
@@ -72,8 +75,8 @@
*/
void PreinstallerStarter::startPlugin(CoreInterface* core)
{
- JELOG2(EJavaCaptain);
mCore = core;
+ CActiveScheduler::Add(this);
}
/**
@@ -81,7 +84,6 @@
*/
void PreinstallerStarter::stopPlugin()
{
- JELOG2(EJavaCaptain);
mCore = 0;
}
@@ -90,7 +92,6 @@
*/
EventConsumerInterface* PreinstallerStarter::getEventConsumer()
{
- JELOG2(EJavaCaptain);
return this;
}
@@ -106,7 +107,6 @@
void PreinstallerStarter::event(const std::string& eventProvider,
java::comms::CommsMessage& aMsg)
{
- JELOG2(EJavaCaptain);
if (eventProvider == BOOT_EVENT_PROVIDER)
{
int bootType = NORMAL_BOOT_C;
@@ -133,7 +133,9 @@
case FIRST_DEVICE_BOOT_C:
case NORMAL_BOOT_C:
{
+#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
registerMidletApplicationTypeHandler();
+#endif
// Start preinstaller normally (without 'iad' option).
startPreinstaller(EFalse);
@@ -183,8 +185,6 @@
*/
void PreinstallerStarter::startPreinstaller(TBool aIadBoot)
{
- JELOG2(EJavaCaptain);
-
// Check that the device has enough free memory (800kB) to start preinstaller process
// and (if needed) also java installer
TInt freeMemory = 0;
@@ -276,17 +276,21 @@
}
// start preinstaller
- RProcess preinstaller;
+ mPreinstaller = new RProcess();
TBuf<64> preinstallerProcess; // Actual len of the process name is 9
len = strlen(java::runtime::JAVA_PROCESS);
TPtr8 ptr8Process((TUint8 *)java::runtime::JAVA_PROCESS, len, len);
preinstallerProcess.Copy(ptr8Process);
- TInt err = preinstaller.Create(preinstallerProcess, commandLine);
+ TInt err = mPreinstaller->Create(preinstallerProcess, commandLine);
if (KErrNone == err)
{
- // process has been created, allow it to run
- preinstaller.Resume();
- preinstaller.Close();
+ // Process has been created.
+
+ // This active object will be activated when preinstaller process exits
+ mPreinstaller->Logon(iStatus);
+
+ // Allow the process to run
+ mPreinstaller->Resume();
if (aIadBoot)
{
LOG(
@@ -298,9 +302,14 @@
{
LOG(EJavaCaptain, EInfo, "PreinstallerStarter: started preinstaller");
}
+
+ SetActive();
}
else
{
+ delete mPreinstaller;
+ mPreinstaller = 0;
+
ELOG1(
EJavaCaptain,
"PreinstallerStarter: starting preinstaller failed, err %d",
@@ -313,6 +322,7 @@
* Register 'javalauncher.exe' as the midlet application type handler
* in AppArc. If necessary unregister old handler first.
*/
+#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
void PreinstallerStarter::registerMidletApplicationTypeHandler()
{
_LIT(KMidpAppArcPlugin, "javalauncher.exe");
@@ -374,6 +384,37 @@
err);
}
}
+#endif
+
+void PreinstallerStarter::RunL()
+{
+ LOG(EJavaCaptain, EInfo, "PreinstallerStarter::RunL started");
+
+ // Send event to AutoStarter plugin, done only once
+ CommsMessage eventMsg;
+ setPreinstallerExitedMessageParams(eventMsg, iStatus.Int());
+ mCore->getEventDispatcher()->event(PREINSTALLER_EVENT_PROVIDER, eventMsg);
+
+ // process handle is no longer needed
+ mPreinstaller->Close();
+ delete mPreinstaller;
+ mPreinstaller = 0;
+}
+
+
+void PreinstallerStarter::DoCancel()
+{
+ if (mPreinstaller)
+ {
+ mPreinstaller->LogonCancel(iStatus);
+ // Because exit notification request has been canceled,
+ // there is no reason to keep the process handle open.
+ mPreinstaller->Close();
+ delete mPreinstaller;
+ mPreinstaller = 0;
+ }
+}
+
} // namespace captain
} // namespace java
--- a/javamanager/javacaptain/extensionplugins/scrupdater/inc/scrupdater.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ScrUpdater is Java Captain Symbian plugin that updates
-* presence information of Java Applications in USIF SCR
-* when removable drive is added or removed to the device.
-*
-*/
-
-#ifndef SCRUPDATER_H
-#define SCRUPDATER_H
-
-#include <usif/scr/scr.h>
-#include <usif/scr/screntries.h>
-
-#include "javaosheaders.h"
-
-#include "eventconsumerinterface.h"
-#include "extensionplugininterface.h"
-
-namespace java
-{
-
-namespace captain
-{
-
-class CoreInterface;
-
-OS_NONSHARABLE_CLASS(ScrUpdater) : public EventConsumerInterface,
- public ExtensionPluginInterface
-{
-public:
- ScrUpdater();
- virtual ~ScrUpdater();
-
- // PluginInterface
- virtual void startPlugin(CoreInterface* aCore);
- virtual void stopPlugin();
-
- // EventConsumerInterface
- virtual void event(const std::string& eventProvider,
- java::comms::CommsMessage& aMsg);
-
- // ExtensionPluginInterface methods
- virtual EventConsumerInterface* getEventConsumer();
-
-private:
- void removeScrPresencesL(driveInfo *aInfo);
- void addScrPresencesL(driveInfo *aInfo);
- void initializeScrPresenceInfoL();
-
- Usif::RSoftwareComponentRegistry *createScrL();
-
-
- CoreInterface* mCore;
-};
-
-} // namespace captain
-} // namespace java
-
-#endif // SCRUPDATER_H
--- a/javamanager/javacaptain/extensionplugins/scrupdater/src.s60/lookup.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: lookup
-*
-*/
-
-#include <string> //For strcmp
-
-#include "javasymbianoslayer.h"
-#include "logger.h"
-
-#include "extensionplugininterface.h"
-
-using namespace java::captain;
-
-ExtensionPluginInterface* getExtensionPlugin();
-
-EXPORT_C FuncPtr findDllMethod(const char* funcName)
-{
- JELOG2(EJavaCaptain);
- FuncPtr ptr = 0;
- if (funcName)
- {
- if (strcmp(funcName, "getExtensionPlugin") == 0)
- {
- ptr = (FuncPtr)getExtensionPlugin;
- }
- }
- else
- {
- ELOG(EJavaCaptain,
- "scrupdater extensionplugin findDllMethod() funcName == null");
- }
- return ptr;
-}
--- a/javamanager/javacaptain/extensionplugins/scrupdater/src.s60/scrupdater.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,705 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ScrUpdater is Java Captain Symbian plugin that updates
-* presence information of Java Applications in USIF SCR
-* when removable drive is added or removed to the device.
-*
-*/
-
-#include <apgcli.h>
-#include <e32base.h>
-#include <f32file.h>
-
-#include "javaprocessconstants.h"
-#include "javasymbianoslayer.h"
-#include "javauids.h"
-#include "logger.h"
-#include "coreinterface.h"
-#include "booteventprovidermessages.h"
-#include "mmceventprovidermessages.h"
-
-#include "scrupdater.h"
-
-// Enable notifying AppArc for USIF Phase 2.
-//#define RD_JAVA_USIF_NOTIFY_APP_ARC
-
-
-using namespace Usif;
-
-/**
- * Return pointer to ExtensionPluginInterface implementation for this
- * extension dll
- */
-java::captain::ExtensionPluginInterface* getExtensionPlugin()
-{
- return new java::captain::ScrUpdater();
-}
-
-namespace java
-{
-namespace captain
-{
-
-using java::fileutils::driveInfo;
-using java::fileutils::DriveListenerInterface;
-
-/**
- * Empty contructor
- */
-ScrUpdater::ScrUpdater() : mCore(0)
-{
-}
-
-/**
- * Empty destructor
- */
-ScrUpdater::~ScrUpdater()
-{
-}
-
-/**
- * Implement PluginInterface method
- */
-void ScrUpdater::startPlugin(CoreInterface* core)
-{
- LOG(EJavaCaptain, EInfo, "ScrUpdater plugin started");
-
- mCore = core;
-}
-
-/**
- * Implement PluginInterface method
- */
-void ScrUpdater::stopPlugin()
-{
- mCore = 0;
-}
-
-/**
- * Implement ExtensionPluginInterface method
- */
-EventConsumerInterface* ScrUpdater::getEventConsumer()
-{
- return this;
-}
-
-/**
- * Handle Java Captain events sent by Boot event provider or
- * MMC event provider.
- *
- * Implement EventConsumerInterface method
- */
-void ScrUpdater::event(const std::string& eventProvider,
- java::comms::CommsMessage& aMsg)
-{
- if (eventProvider == BOOT_EVENT_PROVIDER)
- {
- int bootType = NORMAL_BOOT_C;
- getBootMessageParams(aMsg, bootType);
- LOG1(
- EJavaCaptain,
- EInfo,
- "ScrUpdater::event() boot event received (type=%d)",
- bootType);
- switch (bootType)
- {
- case IAD_BOOT_C:
- case FIRST_DEVICE_BOOT_C:
- case NORMAL_BOOT_C:
- {
- // Update presence information
- TRAPD(err, initializeScrPresenceInfoL())
- if (KErrNone != err)
- {
- ELOG1(EJavaCaptain, "initializeScrPresenceInfoL: leaved (%d)", err);
- }
- }
- break;
-
- default:
- {
- WLOG1(EJavaCaptain,
- "DriveListenerInterface: event() unknown boot event (type=%d)", bootType);
- }
- break;
- }
- }
- else if (eventProvider == MMC_EVENT_PROVIDER)
- {
- int operation = 0;
- driveInfo di;
- getMmcChangedMessageParams(aMsg, operation, di);
- LOG1(
- EJavaCaptain,
- EInfo,
- "ScrUpdater::event() mmc event received (operation=%d)",
- operation);
-
- switch (operation)
- {
- case DriveListenerInterface::REMOVABLE_MEDIA_REMOVED_C:
- {
- // All Java applications in the removed drive are set
- // to 'not present' state
- TRAPD(err, removeScrPresencesL(&di));
- if (KErrNone != err)
- {
- ELOG1(EJavaCaptain, "removeScrPresencesL leaved (%d)", err);
- }
- }
- break;
-
- case DriveListenerInterface::REMOVABLE_MEDIA_INSERTED_C:
- {
- // Those Java applications in the drive to where the media
- // (e.g. memory card) was added are set to 'present' state
- // IF the media id is correct (in other words if the same
- // memory card that they have been installed to is added
- // to the drive).
- TRAPD(err, addScrPresencesL(&di));
- if (KErrNone != err)
- {
- ELOG1(EJavaCaptain, "addScrPresencesL leaved (%d)", err);
- }
- }
- break;
- }
- }
-}
-
-/**
- * Set the presence state of all Java applications installed
- * to the removable drive specified in aInfo to not present
- */
-void ScrUpdater::removeScrPresencesL(driveInfo *aInfo)
-{
- __UHEAP_MARK;
- LOG1WSTR(EJavaCaptain, EInfo,
- "removeScrPresencesL: driveInfo root path is %s", aInfo->iRootPath);
-
- RSoftwareComponentRegistry *pScr = createScrL();
- CleanupStack::PushL(pScr);
-
- // Get ids of all Java components in scr
- RArray<TComponentId> componentIdList;
- CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC();
- pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava);
-
- pScr->GetComponentIdsL(componentIdList);
- CleanupStack::PopAndDestroy(pJavaSwTypeFilter);
- CleanupClosePushL(componentIdList);
-
- // For each component check whether it has been installed
- // to the removed drive
- TInt nComponents = componentIdList.Count();
- TUint removedDrive = (TUint)(aInfo->iRootPath[0]);
- // Now removedDrive contains the drive letter, convert it to drive number 0-25
- if ((removedDrive > 64) && (removedDrive < 91))
- {
- // 'A' - 'Z'
- removedDrive -= 65;
- }
- else if ((removedDrive > 96) && (removedDrive < 123))
- {
- // 'a' - 'z'
- removedDrive -= 97;
- }
- else
- {
- ELOG1WSTR(EJavaCaptain,
- "removeScrPresencesL: Unexpected root path in remove drive info %s",
- aInfo->iRootPath);
- CleanupStack::PopAndDestroy(pScr);
- return;
- }
-
- LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, removed drive is %d",
- nComponents, removedDrive);
-
-#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC
- // TEMP TEST
- TBool fPresenceChange = EFalse;
- RArray<TApaAppUpdateInfo> removedApps;
- CleanupClosePushL(removedApps);
-#endif
-
- for (TInt nInd = 0; nInd < nComponents; nInd++)
- {
- CComponentEntry *pEntry = CComponentEntry::NewLC();
- if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry)))
- {
- ELOG1(EJavaCaptain,
- "removeScrPresencesL: SCR GetComponentIdsL returned id %d "
- "but GetComponentL does not find it", componentIdList[nInd]);
- CleanupStack::PopAndDestroy(pEntry);
- continue;
- }
-
- TInt nInstalledDrives = pEntry->InstalledDrives().Length();
- if (nInstalledDrives <= removedDrive)
- {
- // SCR InstalledDrives should be array of 26 elements (value 0 or 1)
- ELOG2(EJavaCaptain,
- "removeScrPresencesL: The length of InstalledDrives array (%d) "
- "is smaller than removedDrive (%d)", nInstalledDrives, removedDrive);
- CleanupStack::PopAndDestroy(pEntry);
- continue;
- }
-
- LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]);
-
- if (pEntry->InstalledDrives()[removedDrive])
- {
- // This component has been installed to the drive
- // that has just been removed
- pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse);
-
- LOG1(EJavaCaptain, EInfo,
- "removeScrPresencesL: set component %d to not present",
- componentIdList[nInd]);
-
-#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC
- fPresenceChange = ETrue;
-
- // Gather the Uids of all applications that are no longer present
- RArray<TUid> appsInComponent;
- CleanupClosePushL(appsInComponent);
- pScr->GetAppUidsForComponentL(
- componentIdList[nInd], appsInComponent);
- for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++)
- {
- TApaAppUpdateInfo appInfo;
- appInfo.iAppUid = appsInComponent[nInd2];
- appInfo.iAction = TApaAppUpdateInfo::EAppNotPresent;
- (void)removedApps.Append(appInfo);
- }
- CleanupStack::PopAndDestroy(&appsInComponent);
-#endif
- }
-
- CleanupStack::PopAndDestroy(pEntry);
- }
-
-#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC
- // Tell AppArc which applications are no longer present
- while (fPresenceChange)
- {
- if (removedApps.Count() == 0)
- {
- ELOG(EJavaCaptain, "removeScrPresencesL: Uids of the removed apps are not known");
- break;
- }
-
- RApaLsSession apaSession;
- TInt err = apaSession.Connect();
- if (KErrNone != err)
- {
- ELOG1(EJavaCaptain, "removeScrPresencesL: Error %d when connecting AppArc", err);
- break;
- }
- else
- {
- CleanupClosePushL(apaSession);
- apaSession.UpdateAppListL(removedApps);
- CleanupStack::PopAndDestroy(); // closes apaSession
- fPresenceChange = EFalse;
- }
- }
-
- CleanupStack::PopAndDestroy(); // Close removedApps
-#endif
- CleanupStack::PopAndDestroy(); // Close componentIdList
- CleanupStack::PopAndDestroy(pScr);
- __UHEAP_MARKEND;
-}
-
-
-/**
- * Set the presence state of all Java applications installed
- * to the removable drive specified in aInfo to present
- */
-void ScrUpdater::addScrPresencesL(driveInfo *aInfo)
-{
- __UHEAP_MARK;
- LOG1WSTR(EJavaCaptain, EInfo,
- "addScrPresencesL: driveInfo root path is %s", aInfo->iRootPath);
-
- RSoftwareComponentRegistry *pScr = createScrL();
- CleanupStack::PushL(pScr);
-
- // Get ids of all Java components in scr
- RArray<TComponentId> componentIdList;
- CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC();
- pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava);
-
- pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter);
- CleanupStack::PopAndDestroy(pJavaSwTypeFilter);
- CleanupClosePushL(componentIdList);
-
-
- // For each component check whether it has been installed
- // to the added drive AND whether the media id is correct
- // (in other words if the actual memory card where the component
- // has been installed to is added to the drive).
- TInt nComponents = componentIdList.Count();
- TUint addedMediaId = (TUint)(aInfo->iId);
- TUint addedDrive = (TUint)(aInfo->iRootPath[0]);
- // Now addedDrive contains the drive letter, convert it to drive number 0-25
- if ((addedDrive > 64) && (addedDrive < 91))
- {
- // 'A' - 'Z'
- addedDrive -= 65;
- }
- else if ((addedDrive > 96) && (addedDrive < 123))
- {
- // 'a' - 'z'
- addedDrive -= 97;
- }
- else
- {
- ELOG1WSTR(EJavaCaptain,
- "addScrPresencesL: Unexpected root path in add drive info %s",
- aInfo->iRootPath);
- CleanupStack::PopAndDestroy(pScr);
- return;
- }
-
- LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, added drive is %d",
- nComponents, addedDrive);
-
-#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC
- TBool fPresenceChange = EFalse;
- RArray<TApaAppUpdateInfo> addedApps;
- CleanupClosePushL(addedApps);
-#endif
-
- for (TInt nInd = 0; nInd < nComponents; nInd++)
- {
- CComponentEntry *pEntry = CComponentEntry::NewLC();
- if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry)))
- {
- ELOG1(EJavaCaptain,
- "addScrPresencesL: SCR GetComponentIdsL returned id %d "
- "but GetComponentL does not find it", componentIdList[nInd]);
- CleanupStack::PopAndDestroy(pEntry);
- continue;
- }
-
- // When Java Installer registers Java app to SCR it stores also
- // the media id using SetComponentPropertyL(TComponentId aComponentId,
- // _L("Media-Id")), TInt64 aValue); (aValue is actually 32 bit int)
- CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *)
- pScr->GetComponentPropertyL(componentIdList[nInd],_L("Media-Id"));
- if (NULL == pMediaIdProperty)
- {
- ELOG1(EJavaCaptain,
- "addScrPresencesL: media_id property not found for component %d",
- componentIdList[nInd]);
- CleanupStack::PopAndDestroy(pEntry);
- continue;
- }
- CleanupStack::PushL(pMediaIdProperty);
-
- TInt nInstalledDrives = pEntry->InstalledDrives().Length();
- if (nInstalledDrives <= addedDrive)
- {
- // SCR InstalledDrives should be array of 26 elements (value 0 or 1)
- ELOG2(EJavaCaptain,
- "addScrPresencesL: The length of InstalledDrives array (%d) "
- "is smaller than addedDrive (%d)", nInstalledDrives, addedDrive);
- CleanupStack::PopAndDestroy(pEntry);
- continue;
- }
-
- LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]);
-
- if (pEntry->InstalledDrives()[addedDrive])
- {
- // This component has been installed to the drive
- // that has just been added.
- // Now check whether the media id of the added media
- // is OK for this component.
- if (addedMediaId == pMediaIdProperty->IntValue())
- {
- pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue);
-
- LOG1(EJavaCaptain, EInfo,
- "addScrPresencesL: set component %d to present",
- componentIdList[nInd]);
-
-#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC
- fPresenceChange = ETrue;
-
- // Gather the Uids of all 'new' applications that are now present
- RArray<TUid> appsInComponent;
- CleanupClosePushL(appsInComponent);
- pScr->GetAppUidsForComponentL(
- componentIdList[nInd], appsInComponent);
- for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++)
- {
- TApaAppUpdateInfo appInfo;
- appInfo.iAppUid = appsInComponent[nInd2];
- appInfo.iAction = TApaAppUpdateInfo::EAppPresent;
- (void)addedApps.Append(appInfo);
- }
- CleanupStack::PopAndDestroy(&appsInComponent);
-#endif
- }
- }
-
- CleanupStack::PopAndDestroy(pMediaIdProperty);
- CleanupStack::PopAndDestroy(pEntry);
- }
-
-#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC
- // Tell AppArc which 'new' applications are now present
- while (fPresenceChange)
- {
- if (addedApps.Count() == 0)
- {
- ELOG(EJavaCaptain, "addScrPresencesL: Uids of the 'new' apps are not known");
- break;
- }
-
- RApaLsSession apaSession;
- TInt err = apaSession.Connect();
- if (KErrNone != err)
- {
- ELOG1(EJavaCaptain, "addScrPresencesL: Error %d when connecting AppArc", err);
- break;
- }
- else
- {
- CleanupClosePushL(apaSession);
- apaSession.UpdateAppListL(addedApps);
- CleanupStack::PopAndDestroy(); // closes apaSession
- fPresenceChange = EFalse;
- }
- }
-
- CleanupStack::PopAndDestroy(); // Close addedApps
-#endif
- CleanupStack::PopAndDestroy(); // Close componentIdList
- CleanupStack::PopAndDestroy(pScr);
- __UHEAP_MARKEND;
-}
-
-
-/**
- * Loop through all removable drives and get the media id of
- * the memory card or other removable media in the drive and update
- * presence information of all Java applications installed
- * to removable drives accordingly.
- */
-void ScrUpdater::initializeScrPresenceInfoL()
-{
- __UHEAP_MARK;
- RFs fs;
- User::LeaveIfError(fs.Connect());
- CleanupClosePushL(fs);
-
- // Which drives are present and what is the media id of
- // each removable volume
- TInt err = KErrNone;
- TInt err2 = KErrNone;
- TBool drivePresent[EDriveZ + 1];
- TUint driveMediaId[EDriveZ + 1];
- TVolumeInfo volumeInfo;
- TDriveInfo driveInfo;
-
- for (TInt nInd = EDriveA; nInd < EDriveZ; nInd++)
- {
- err = fs.Volume(volumeInfo, nInd);
- if (KErrNone == err)
- {
- drivePresent[nInd] = ETrue;
- driveMediaId[nInd] = volumeInfo.iUniqueID;
- // If the media is not removable, media id is not checked
- err2 = fs.Drive(driveInfo, nInd);
- if (KErrNone != err2)
- {
- ELOG1(EJavaCaptain,
- "initializeScrPresenceInfoL: error (%d) when trying to get drive info",
- err2);
- User::Leave(err2);
- }
- else
- {
- if (!(driveInfo.iDriveAtt & KDriveAttRemovable))
- {
- driveMediaId[nInd] = 0;
- }
- }
- }
- else if (KErrNotReady == err)
- {
- // no volume in this drive
- drivePresent[nInd] = EFalse;
- driveMediaId[nInd] = 0;
- }
- else
- {
- ELOG1(EJavaCaptain,
- "initializeScrPresenceInfoL: error (%d) when trying to get volume info",
- err);
- User::Leave(err);
- }
- }
- CleanupStack::PopAndDestroy(); // close RFs
-
-
- RSoftwareComponentRegistry *pScr = createScrL();
- CleanupStack::PushL(pScr);
-
- // Get ids of all Java components in scr
- RArray<TComponentId> componentIdList;
- CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC();
- pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava);
-
- pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter);
- CleanupStack::PopAndDestroy(pJavaSwTypeFilter);
- CleanupClosePushL(componentIdList);
-
- // For each component check whether the drive it has been installed
- // to is present AND whether the media id is correct
- TInt nComponents = componentIdList.Count();
-
- LOG1(EJavaCaptain, EInfo, "initializeScrPresenceInfoL: Number of Java components is %d",
- nComponents);
-
- for (TInt nInd = 0; nInd < nComponents; nInd++)
- {
- CComponentEntry *pEntry = CComponentEntry::NewLC();
- if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry)))
- {
- ELOG1(EJavaCaptain,
- "initializeScrPresenceInfoL: SCR GetComponentIdsL returned id %d "
- "but GetComponentL does not find it", componentIdList[nInd]);
- CleanupStack::PopAndDestroy(pEntry);
- continue;
- }
-
- CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *)
- pScr->GetComponentPropertyL(componentIdList[nInd],_L("Media-Id"));
- if (NULL == pMediaIdProperty)
- {
- ELOG1(EJavaCaptain,
- "initializeScrPresenceInfoL: media_id property not found for component %d",
- componentIdList[nInd]);
- CleanupStack::PopAndDestroy(pEntry);
- continue;
- }
- CleanupStack::PushL(pMediaIdProperty);
-
- TInt nInstalledDrives = pEntry->InstalledDrives().Length();
- if (nInstalledDrives > (EDriveZ + 1))
- {
- WLOG2(EJavaCaptain,
- "initializeScrPresenceInfoL: too big (%d) installed drives array for "
- "component %d", nInstalledDrives, componentIdList[nInd]);
- nInstalledDrives = EDriveZ;
- }
- // When Java components are installed, only one installed drive
- // and corresponding media id are registered.
- TInt installationDrive = -1;
-
- for (TInt driveNumber = EDriveA; driveNumber < nInstalledDrives; driveNumber++)
- {
- if (pEntry->InstalledDrives()[driveNumber])
- {
- installationDrive = driveNumber;
- break;
- }
- }
-
- if (installationDrive == -1)
- {
- ELOG1(EJavaCaptain,
- "initializeScrPresenceInfoL: component (id %d) did not have installed drive info",
- componentIdList[nInd]);
- CleanupStack::PopAndDestroy(pMediaIdProperty);
- CleanupStack::PopAndDestroy(pEntry);
- continue;
- }
-
- if (drivePresent[installationDrive])
- {
- // Check also the media id
- if (driveMediaId[installationDrive] == pMediaIdProperty->IntValue())
- {
- LOG1(EJavaCaptain, EInfo,
- "initializeScrPresenceInfoL: set component %d to present",
- componentIdList[nInd]);
-
- pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue);
- }
- else
- {
- LOG1(EJavaCaptain, EInfo,
- "initializeScrPresenceInfoL: set component %d to NOT present",
- componentIdList[nInd]);
-
- pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse);
- }
- }
- else
- {
- LOG1(EJavaCaptain, EInfo,
- "initializeScrPresenceInfoL: set component %d to NOT present",
- componentIdList[nInd]);
-
- // drive is not present -> Java component installed to that
- // drive is not present
- pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse);
- }
-
- CleanupStack::PopAndDestroy(pMediaIdProperty);
- CleanupStack::PopAndDestroy(pEntry);
- }
-
- CleanupStack::PopAndDestroy(); // Close componentIdList
- CleanupStack::PopAndDestroy(pScr); // Also closes RSoftwareComponentRegistry
-
- __UHEAP_MARKEND;
-}
-
-
-/**
- * Creates an instance of RSoftwareComponentRegistry and connects to it.
- */
-RSoftwareComponentRegistry *ScrUpdater::createScrL()
-{
- RSoftwareComponentRegistry *pScr = new RSoftwareComponentRegistry;
- if (NULL == pScr)
- {
- ELOG(EJavaInstaller,
- "CreateScrL: Creating RSoftwareComponentRegistry failed");
- User::Leave(KErrGeneral);
- }
- TInt err = pScr->Connect();
- if (KErrNone != err)
- {
- ELOG1(EJavaInstaller,
- "CreateScrL: Connecting to RSoftwareComponentRegistry failed, error %d",
- err);
- delete pScr;
- User::Leave(err);
- }
-
- return pScr;
-}
-
-
-} // namespace captain
-} // namespace java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/scrupdater/src/lookup.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: lookup
+*
+*/
+
+#include <string> //For strcmp
+
+#include "javasymbianoslayer.h"
+#include "logger.h"
+
+#include "extensionplugininterface.h"
+
+using namespace java::captain;
+
+ExtensionPluginInterface* getExtensionPlugin();
+
+EXPORT_C FuncPtr findDllMethod(const char* funcName)
+{
+ FuncPtr ptr = 0;
+ if (funcName)
+ {
+ if (strcmp(funcName, "getExtensionPlugin") == 0)
+ {
+ ptr = (FuncPtr)getExtensionPlugin;
+ }
+ }
+ else
+ {
+ ELOG(EJavaCaptain,
+ "scrupdater extensionplugin findDllMethod() funcName == null");
+ }
+ return ptr;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,666 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: ScrUpdater is Java Captain Symbian plugin that updates
+* presence information of Java Applications in USIF SCR
+* when removable drive is added or removed to the device.
+*
+*/
+
+#include <apgcli.h>
+#include <e32base.h>
+#include <f32file.h>
+
+#include "javaprocessconstants.h"
+#include "javasymbianoslayer.h"
+#include "javauids.h"
+#include "logger.h"
+#include "coreinterface.h"
+#include "booteventprovidermessages.h"
+#include "mmceventprovidermessages.h"
+
+#include "scrupdater.h"
+
+using namespace Usif;
+
+_LIT(KMediaId, "Media-Id");
+
+/**
+ * Return pointer to ExtensionPluginInterface implementation for this
+ * extension dll
+ */
+java::captain::ExtensionPluginInterface* getExtensionPlugin()
+{
+ return new java::captain::ScrUpdater();
+}
+
+namespace java // codescanner::namespace
+{
+namespace captain // codescanner::namespace
+{
+
+using java::fileutils::driveInfo;
+using java::fileutils::DriveListenerInterface;
+
+/**
+ * Empty contructor
+ */
+ScrUpdater::ScrUpdater()
+{
+}
+
+/**
+ * Empty destructor
+ */
+ScrUpdater::~ScrUpdater()
+{
+}
+
+/**
+ * Implement PluginInterface method
+ */
+void ScrUpdater::startPlugin(CoreInterface* /* aCore */)
+{
+ LOG(EJavaCaptain, EInfo, "ScrUpdater plugin started");
+}
+
+/**
+ * Implement PluginInterface method
+ */
+void ScrUpdater::stopPlugin()
+{
+}
+
+/**
+ * Implement ExtensionPluginInterface method
+ */
+EventConsumerInterface* ScrUpdater::getEventConsumer()
+{
+ return this;
+}
+
+/**
+ * Handle Java Captain events sent by Boot event provider or
+ * MMC event provider.
+ *
+ * Implement EventConsumerInterface method
+ */
+void ScrUpdater::event(const std::string& aEventProvider,
+ java::comms::CommsMessage& aMsg)
+{
+ if (aEventProvider == BOOT_EVENT_PROVIDER)
+ {
+ int bootType = NORMAL_BOOT_C;
+ getBootMessageParams(aMsg, bootType);
+ LOG1(
+ EJavaCaptain,
+ EInfo,
+ "ScrUpdater::event() boot event received (type=%d)",
+ bootType);
+ switch (bootType)
+ {
+ case IAD_BOOT_C:
+ case FIRST_DEVICE_BOOT_C:
+ case NORMAL_BOOT_C:
+ {
+ // Update presence information
+ TRAPD(err, initializeScrPresenceInfoL())
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaCaptain, "initializeScrPresenceInfoL: leaved (%d)", err);
+ }
+ }
+ break;
+
+ default:
+ {
+ WLOG1(EJavaCaptain,
+ "DriveListenerInterface: event() unknown boot event (type=%d)", bootType);
+ }
+ break;
+ }
+ }
+ else if (aEventProvider == MMC_EVENT_PROVIDER)
+ {
+ int operation = 0;
+ driveInfo di;
+ getMmcChangedMessageParams(aMsg, operation, di);
+ LOG1(
+ EJavaCaptain,
+ EInfo,
+ "ScrUpdater::event() mmc event received (operation=%d)",
+ operation);
+
+ switch (operation)
+ {
+ case DriveListenerInterface::REMOVABLE_MEDIA_REMOVED_C:
+ {
+ // All Java applications in the removed drive are set
+ // to 'not present' state
+ TRAPD(err, removeScrPresencesL(&di));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaCaptain, "removeScrPresencesL leaved (%d)", err);
+ }
+ }
+ break;
+
+ case DriveListenerInterface::REMOVABLE_MEDIA_INSERTED_C:
+ {
+ // Those Java applications in the drive to where the media
+ // (e.g. memory card) was added are set to 'present' state
+ // IF the media id is correct (in other words if the same
+ // memory card that they have been installed to is added
+ // to the drive).
+ TRAPD(err, addScrPresencesL(&di));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaCaptain, "addScrPresencesL leaved (%d)", err);
+ }
+ }
+ break;
+ }
+ }
+}
+
+/**
+ * Set the presence state of all Java applications installed
+ * to the removable drive specified in aInfo to not present
+ */
+void ScrUpdater::removeScrPresencesL(driveInfo *aInfo)
+{
+ __UHEAP_MARK;
+ LOG1WSTR(EJavaCaptain, EInfo,
+ "removeScrPresencesL: driveInfo root path is %s", aInfo->iRootPath);
+
+ RSoftwareComponentRegistry *pScr = createScrL();
+ CleanupStack::PushL(pScr);
+
+ // Get ids of all Java components in scr
+ RArray<TComponentId> componentIdList;
+ CleanupClosePushL(componentIdList);
+
+ CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC();
+ pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava);
+
+ pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter);
+ CleanupStack::PopAndDestroy(pJavaSwTypeFilter);
+
+ // For each component check whether it has been installed
+ // to the removed drive
+ TInt nComponents = componentIdList.Count();
+ TUint removedDrive = (TUint)(aInfo->iRootPath[0]);
+ // Now removedDrive contains the drive letter, convert it to drive number 0-25
+ if ((removedDrive > 64) && (removedDrive < 91)) // codescanner::magicnumbers
+ {
+ // 'A' - 'Z'
+ removedDrive -= 65; // codescanner::magicnumbers
+ }
+ else if ((removedDrive > 96) && (removedDrive < 123)) // codescanner::magicnumbers
+ {
+ // 'a' - 'z'
+ removedDrive -= 97; // codescanner::magicnumbers
+ }
+ else
+ {
+ ELOG1WSTR(EJavaCaptain,
+ "removeScrPresencesL: Unexpected root path in remove drive info %s",
+ aInfo->iRootPath);
+ CleanupStack::PopAndDestroy(pScr);
+ return;
+ }
+
+ LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, removed drive is %d",
+ nComponents, removedDrive);
+
+ RArray<TApaAppUpdateInfo> removedApps;
+ CleanupClosePushL(removedApps);
+
+ for (TInt nInd = 0; nInd < nComponents; nInd++)
+ {
+ CComponentEntry *pEntry = CComponentEntry::NewLC();
+ if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry)))
+ {
+ ELOG1(EJavaCaptain,
+ "removeScrPresencesL: SCR GetComponentIdsL returned id %d "
+ "but GetComponentL does not find it", componentIdList[nInd]);
+ CleanupStack::PopAndDestroy(pEntry);
+ continue;
+ }
+
+ TInt nInstalledDrives = pEntry->InstalledDrives().Length();
+ if (nInstalledDrives <= removedDrive)
+ {
+ // SCR InstalledDrives should be array of 26 elements (value 0 or 1)
+ ELOG2(EJavaCaptain,
+ "removeScrPresencesL: The length of InstalledDrives array (%d) "
+ "is smaller than removedDrive (%d)", nInstalledDrives, removedDrive);
+ CleanupStack::PopAndDestroy(pEntry);
+ continue;
+ }
+
+ LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]);
+
+ if (pEntry->InstalledDrives()[removedDrive])
+ {
+ // This component has been installed to the drive
+ // that has just been removed
+ pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse);
+
+ LOG1(EJavaCaptain, EInfo,
+ "removeScrPresencesL: set component %d to not present",
+ componentIdList[nInd]);
+
+ // Gather the Uids of all applications that are no longer present
+ RArray<TUid> appsInComponent;
+ CleanupClosePushL(appsInComponent);
+ pScr->GetAppUidsForComponentL(
+ componentIdList[nInd], appsInComponent);
+ for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++)
+ {
+ TApaAppUpdateInfo appInfo;
+ appInfo.iAppUid = appsInComponent[nInd2];
+ appInfo.iAction = TApaAppUpdateInfo::EAppNotPresent;
+ removedApps.AppendL(appInfo);
+ }
+ CleanupStack::PopAndDestroy(&appsInComponent);
+ }
+
+ CleanupStack::PopAndDestroy(pEntry);
+ }
+
+ // Tell AppArc which applications are no longer present
+ if (removedApps.Count() > 0)
+ {
+ RApaLsSession apaSession;
+ TInt err = apaSession.Connect();
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaCaptain, "removeScrPresencesL: Error %d when connecting AppArc", err);
+ }
+ else
+ {
+ CleanupClosePushL(apaSession);
+ apaSession.UpdateAppListL(removedApps);
+ CleanupStack::PopAndDestroy(); // closes apaSession
+ }
+ }
+
+ CleanupStack::PopAndDestroy(); // Close removedApps
+ CleanupStack::PopAndDestroy(); // Close componentIdList
+ CleanupStack::PopAndDestroy(pScr);
+ __UHEAP_MARKEND;
+}
+
+
+/**
+ * Set the presence state of all Java applications installed
+ * to the removable drive specified in aInfo to present
+ */
+void ScrUpdater::addScrPresencesL(driveInfo *aInfo)
+{
+ __UHEAP_MARK;
+ LOG1WSTR(EJavaCaptain, EInfo,
+ "addScrPresencesL: driveInfo root path is %s", aInfo->iRootPath);
+
+ RSoftwareComponentRegistry *pScr = createScrL();
+ CleanupStack::PushL(pScr);
+
+ // Get ids of all Java components in scr
+ RArray<TComponentId> componentIdList;
+ CleanupClosePushL(componentIdList);
+
+ CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC();
+ pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava);
+
+ pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter);
+ CleanupStack::PopAndDestroy(pJavaSwTypeFilter);
+
+ // For each component check whether it has been installed
+ // to the added drive AND whether the media id is correct
+ // (in other words if the actual memory card where the component
+ // has been installed to is added to the drive).
+ TInt nComponents = componentIdList.Count();
+ TUint addedMediaId = (TUint)(aInfo->iId);
+ TUint addedDrive = (TUint)(aInfo->iRootPath[0]);
+ // Now addedDrive contains the drive letter, convert it to drive number 0-25
+ if ((addedDrive > 64) && (addedDrive < 91)) // codescanner::magicnumbers
+ {
+ // 'A' - 'Z'
+ addedDrive -= 65; // codescanner::magicnumbers
+ }
+ else if ((addedDrive > 96) && (addedDrive < 123)) // codescanner::magicnumbers
+ {
+ // 'a' - 'z'
+ addedDrive -= 97; // codescanner::magicnumbers
+ }
+ else
+ {
+ ELOG1WSTR(EJavaCaptain,
+ "addScrPresencesL: Unexpected root path in add drive info %s",
+ aInfo->iRootPath);
+ CleanupStack::PopAndDestroy(pScr);
+ return;
+ }
+
+ LOG2(EJavaCaptain, EInfo, "Number of Java components is %d, added drive is %d",
+ nComponents, addedDrive);
+
+ RArray<TApaAppUpdateInfo> addedApps;
+ CleanupClosePushL(addedApps);
+
+ for (TInt nInd = 0; nInd < nComponents; nInd++)
+ {
+ CComponentEntry *pEntry = CComponentEntry::NewLC();
+ if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry)))
+ {
+ ELOG1(EJavaCaptain,
+ "addScrPresencesL: SCR GetComponentIdsL returned id %d "
+ "but GetComponentL does not find it", componentIdList[nInd]);
+ CleanupStack::PopAndDestroy(pEntry);
+ continue;
+ }
+
+ // When Java Installer registers Java app to SCR it stores also
+ // the media id using SetComponentPropertyL(TComponentId aComponentId,
+ // _L("Media-Id"), TInt64 aValue); (aValue is actually 32 bit int)
+ CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *)
+ pScr->GetComponentPropertyL(componentIdList[nInd], KMediaId);
+ if (NULL == pMediaIdProperty)
+ {
+ ELOG1(EJavaCaptain,
+ "addScrPresencesL: media_id property not found for component %d",
+ componentIdList[nInd]);
+ CleanupStack::PopAndDestroy(pEntry);
+ continue;
+ }
+ CleanupStack::PushL(pMediaIdProperty);
+
+ TInt nInstalledDrives = pEntry->InstalledDrives().Length();
+ if (nInstalledDrives <= addedDrive)
+ {
+ // SCR InstalledDrives should be array of 26 elements (value 0 or 1)
+ ELOG2(EJavaCaptain,
+ "addScrPresencesL: The length of InstalledDrives array (%d) "
+ "is smaller than addedDrive (%d)", nInstalledDrives, addedDrive);
+ CleanupStack::PopAndDestroy(pEntry);
+ continue;
+ }
+
+ LOG1(EJavaCaptain, EInfo, "Java component id %d", componentIdList[nInd]);
+
+ if (pEntry->InstalledDrives()[addedDrive])
+ {
+ // This component has been installed to the drive
+ // that has just been added.
+ // Now check whether the media id of the added media
+ // is OK for this component.
+ if (addedMediaId == pMediaIdProperty->IntValue())
+ {
+ pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue);
+
+ LOG1(EJavaCaptain, EInfo,
+ "addScrPresencesL: set component %d to present",
+ componentIdList[nInd]);
+
+ // Gather the Uids of all 'new' applications that are now present
+ RArray<TUid> appsInComponent;
+ CleanupClosePushL(appsInComponent);
+ pScr->GetAppUidsForComponentL(
+ componentIdList[nInd], appsInComponent);
+ for (TInt nInd2 = 0; nInd2 < appsInComponent.Count(); nInd2++)
+ {
+ TApaAppUpdateInfo appInfo;
+ appInfo.iAppUid = appsInComponent[nInd2];
+ appInfo.iAction = TApaAppUpdateInfo::EAppPresent;
+ addedApps.AppendL(appInfo);
+ }
+ CleanupStack::PopAndDestroy(&appsInComponent);
+ }
+ }
+
+ CleanupStack::PopAndDestroy(pMediaIdProperty);
+ CleanupStack::PopAndDestroy(pEntry);
+ }
+
+ // Tell AppArc which 'new' applications are now present
+ if (addedApps.Count() > 0)
+ {
+ RApaLsSession apaSession;
+ TInt err = apaSession.Connect();
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaCaptain, "addScrPresencesL: Error %d when connecting AppArc", err);
+ }
+ else
+ {
+ CleanupClosePushL(apaSession);
+ apaSession.UpdateAppListL(addedApps);
+ CleanupStack::PopAndDestroy(); // closes apaSession
+ }
+ }
+
+ CleanupStack::PopAndDestroy(); // Close addedApps
+ CleanupStack::PopAndDestroy(); // Close componentIdList
+ CleanupStack::PopAndDestroy(pScr);
+ __UHEAP_MARKEND;
+}
+
+
+/**
+ * Loop through all removable drives and get the media id of
+ * the memory card or other removable media in the drive and update
+ * presence information of all Java applications installed
+ * to removable drives accordingly.
+ */
+void ScrUpdater::initializeScrPresenceInfoL()
+{
+ __UHEAP_MARK;
+ RFs fs; // codescanner::rfs
+ User::LeaveIfError(fs.Connect());
+ CleanupClosePushL(fs);
+
+ // Which drives are present and what is the media id of
+ // each removable volume
+ TInt err = KErrNone;
+ TInt err2 = KErrNone;
+ TBool drivePresent[EDriveZ + 1];
+ TUint driveMediaId[EDriveZ + 1];
+ TVolumeInfo volumeInfo;
+ TDriveInfo driveInfo;
+
+ for (TInt nInd = EDriveA; nInd < EDriveZ; nInd++)
+ {
+ err = fs.Volume(volumeInfo, nInd);
+ if (KErrNone == err)
+ {
+ drivePresent[nInd] = ETrue; // codescanner::accessArrayElementWithoutCheck2
+ driveMediaId[nInd] = volumeInfo.iUniqueID; // codescanner::accessArrayElementWithoutCheck2
+ // If the media is not removable, media id is not checked
+ err2 = fs.Drive(driveInfo, nInd);
+ if (KErrNone != err2)
+ {
+ ELOG1(EJavaCaptain,
+ "initializeScrPresenceInfoL: error (%d) when trying to get drive info",
+ err2);
+ User::Leave(err2);
+ }
+ else
+ {
+ if (!(driveInfo.iDriveAtt & KDriveAttRemovable))
+ {
+ driveMediaId[nInd] = 0; // codescanner::accessArrayElementWithoutCheck2
+ }
+ }
+ }
+ else if (KErrNotReady == err)
+ {
+ // no volume in this drive
+ drivePresent[nInd] = EFalse; // codescanner::accessArrayElementWithoutCheck2
+ driveMediaId[nInd] = 0; // codescanner::accessArrayElementWithoutCheck2
+ }
+ else
+ {
+ ELOG1(EJavaCaptain,
+ "initializeScrPresenceInfoL: error (%d) when trying to get volume info",
+ err);
+ User::Leave(err);
+ }
+ }
+ CleanupStack::PopAndDestroy(); // close RFs
+
+
+ RSoftwareComponentRegistry *pScr = createScrL();
+ CleanupStack::PushL(pScr);
+
+ // Get ids of all Java components in scr
+ RArray<TComponentId> componentIdList;
+ CComponentFilter *pJavaSwTypeFilter = CComponentFilter::NewLC();
+ pJavaSwTypeFilter->SetSoftwareTypeL(Usif::KSoftwareTypeJava);
+
+ pScr->GetComponentIdsL(componentIdList, pJavaSwTypeFilter);
+ CleanupStack::PopAndDestroy(pJavaSwTypeFilter);
+ CleanupClosePushL(componentIdList);
+
+ // For each component check whether the drive it has been installed
+ // to is present AND whether the media id is correct
+ TInt nComponents = componentIdList.Count();
+
+ LOG1(EJavaCaptain, EInfo, "initializeScrPresenceInfoL: Number of Java components is %d",
+ nComponents);
+
+ for (TInt nInd = 0; nInd < nComponents; nInd++)
+ {
+ CComponentEntry *pEntry = CComponentEntry::NewLC();
+ if (!(pScr->GetComponentL(componentIdList[nInd], *pEntry)))
+ {
+ ELOG1(EJavaCaptain,
+ "initializeScrPresenceInfoL: SCR GetComponentIdsL returned id %d "
+ "but GetComponentL does not find it", componentIdList[nInd]);
+ CleanupStack::PopAndDestroy(pEntry);
+ continue;
+ }
+
+ CIntPropertyEntry* pMediaIdProperty = (CIntPropertyEntry *)
+ pScr->GetComponentPropertyL(componentIdList[nInd], KMediaId);
+ if (NULL == pMediaIdProperty)
+ {
+ ELOG1(EJavaCaptain,
+ "initializeScrPresenceInfoL: media_id property not found for component %d",
+ componentIdList[nInd]);
+ CleanupStack::PopAndDestroy(pEntry);
+ continue;
+ }
+ CleanupStack::PushL(pMediaIdProperty);
+
+ TInt nInstalledDrives = pEntry->InstalledDrives().Length();
+ if (nInstalledDrives > (EDriveZ + 1))
+ {
+ WLOG2(EJavaCaptain,
+ "initializeScrPresenceInfoL: too big (%d) installed drives array for "
+ "component %d", nInstalledDrives, componentIdList[nInd]);
+ nInstalledDrives = EDriveZ;
+ }
+ // When Java components are installed, only one installed drive
+ // and corresponding media id are registered.
+ TInt installationDrive = -1;
+
+ for (TInt driveNumber = EDriveA; driveNumber < nInstalledDrives; driveNumber++)
+ {
+ if (pEntry->InstalledDrives()[driveNumber])
+ {
+ installationDrive = driveNumber;
+ break;
+ }
+ }
+
+ if (installationDrive == -1)
+ {
+ ELOG1(EJavaCaptain,
+ "initializeScrPresenceInfoL: component (id %d) did not have installed drive info",
+ componentIdList[nInd]);
+ CleanupStack::PopAndDestroy(pMediaIdProperty);
+ CleanupStack::PopAndDestroy(pEntry);
+ continue;
+ }
+
+ if (drivePresent[installationDrive]) // codescanner::accessArrayElementWithoutCheck2
+ {
+ // Check also the media id
+ if (driveMediaId[installationDrive] == pMediaIdProperty->IntValue()) // codescanner::accessArrayElementWithoutCheck2
+ {
+ LOG1(EJavaCaptain, EInfo,
+ "initializeScrPresenceInfoL: set component %d to present",
+ componentIdList[nInd]);
+
+ pScr->SetIsComponentPresentL(componentIdList[nInd], ETrue);
+ }
+ else
+ {
+ LOG1(EJavaCaptain, EInfo,
+ "initializeScrPresenceInfoL: set component %d to NOT present",
+ componentIdList[nInd]);
+
+ pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse);
+ }
+ }
+ else
+ {
+ LOG1(EJavaCaptain, EInfo,
+ "initializeScrPresenceInfoL: set component %d to NOT present",
+ componentIdList[nInd]);
+
+ // drive is not present -> Java component installed to that
+ // drive is not present
+ pScr->SetIsComponentPresentL(componentIdList[nInd], EFalse);
+ }
+
+ CleanupStack::PopAndDestroy(pMediaIdProperty);
+ CleanupStack::PopAndDestroy(pEntry);
+ }
+
+ CleanupStack::PopAndDestroy(); // Close componentIdList
+ CleanupStack::PopAndDestroy(pScr); // Also closes RSoftwareComponentRegistry
+
+ __UHEAP_MARKEND;
+}
+
+
+/**
+ * Creates an instance of RSoftwareComponentRegistry and connects to it.
+ */
+RSoftwareComponentRegistry *ScrUpdater::createScrL()
+{
+ RSoftwareComponentRegistry *pScr = new RSoftwareComponentRegistry; // codescanner::nonleavenew
+ if (NULL == pScr)
+ {
+ ELOG(EJavaInstaller,
+ "CreateScrL: Creating RSoftwareComponentRegistry failed");
+ User::Leave(KErrGeneral);
+ }
+ TInt err = pScr->Connect();
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "CreateScrL: Connecting to RSoftwareComponentRegistry failed, error %d",
+ err);
+ delete pScr;
+ User::Leave(err);
+ }
+
+ return pScr;
+}
+
+
+} // namespace captain
+} // namespace java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/scrupdater/src/scrupdater.h Thu Aug 19 09:48:13 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: ScrUpdater is Java Captain Symbian plugin that updates
+* presence information of Java Applications in USIF SCR
+* when removable drive is added or removed to the device.
+*
+*/
+
+#ifndef SCRUPDATER_H
+#define SCRUPDATER_H
+
+#include <usif/scr/scr.h>
+#include <usif/scr/screntries.h>
+
+#include "javaosheaders.h"
+
+#include "eventconsumerinterface.h"
+#include "extensionplugininterface.h"
+
+namespace java // codescanner::namespace
+{
+
+namespace captain // codescanner::namespace
+{
+
+class CoreInterface;
+
+OS_NONSHARABLE_CLASS(ScrUpdater) : public EventConsumerInterface,
+ public ExtensionPluginInterface
+{
+public:
+ ScrUpdater();
+ virtual ~ScrUpdater();
+
+ // PluginInterface
+ virtual void startPlugin(CoreInterface* aCore);
+ virtual void stopPlugin();
+
+ // EventConsumerInterface
+ virtual void event(const std::string& aEventProvider,
+ java::comms::CommsMessage& aMsg);
+
+ // ExtensionPluginInterface methods
+ virtual EventConsumerInterface* getEventConsumer();
+
+private:
+ void removeScrPresencesL(driveInfo *aInfo);
+ void addScrPresencesL(driveInfo *aInfo);
+ void initializeScrPresenceInfoL();
+
+ Usif::RSoftwareComponentRegistry *createScrL();
+};
+
+} // namespace captain
+} // namespace java
+
+#endif // SCRUPDATER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated bld.inf -file
+*
+*/
+
+PRJ_PLATFORMS
+default
+
+PRJ_MMPFILES
+javacaptain_ext_settingslistener_0x200315D8.mmp
+#include "exports.inf"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/bwins/javacaptain_ext_settingslisteneru.def Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+ ?findDllMethod@@YAP6APAXXZPBD@Z @ 1 NONAME ; void * (*)(void) findDllMethod(char const *)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/eabi/javacaptain_ext_settingslisteneru.def Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+ _Z13findDllMethodPKc @ 1 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/exports.inf Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+PRJ_EXPORTS
+../inc/settingschangeeventsprovidermessages.h |../../../inc/settingschangeeventsprovidermessages.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro Thu Aug 19 09:48:13 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:
+#
+
+TEMPLATE=lib
+TARGET=javacaptain_ext_settingslistener
+CONFIG += omj stl
+CONFIG -= qt
+
+symbian {
+ LIBS += -lcommonengine \
+ -lcentralrepository \
+ -lcenrepnotifhandler \
+ -ljavacomms
+}
+
+include(../../../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/build/javacaptain_ext_settingslistener_0x200315D8.mmp Thu Aug 19 09:48:13 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 : javacaptain_ext_settingslistener.mmp
+// ==============================================================================
+
+TARGET javacaptain_ext_settingslistener.dll
+TARGETTYPE DLL
+
+UID 0x1000008d 0x200315D8
+SECUREID 0x200315D8
+
+EPOCALLOWDLLDATA
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO RD_JAVA_SYMBIAN_TARGET
+MACRO RD_JAVA_S60_RELEASE_9_2
+MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
+MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
+MACRO RD_JAVA_STDCPPV5
+MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
+MACRO RD_JAVA_HTTP_EMC_ENABLED
+MACRO RD_JAVA_NGA_ENABLED
+MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
+MACRO RD_JAVA_OPENC_BETA_PATCH
+MACRO RD_JAVA_INSTALLERUI_ENABLED
+MACRO RD_JAVA_PREWARM
+MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+MACRO RD_JAVA_MIDPRMS_DB
+MACRO __SYMBIAN32__
+MACRO J9EPOC32
+
+SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../inc
+SYSTEMINCLUDE ../../../inc
+SYSTEMINCLUDE ../../../../inc
+SYSTEMINCLUDE ../../../../../inc
+SYSTEMINCLUDE ../src
+SYSTEMINCLUDE ../src.s60
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE .
+
+SOURCEPATH ../src
+SOURCE settingslistenerextension.cpp
+
+SOURCEPATH ../src.s60
+SOURCE cenreplistener.cpp
+SOURCE lookup.cpp
+SOURCE settingslistenerimpl.cpp
+
+
+LIBRARY commonengine.lib
+LIBRARY centralrepository.lib
+LIBRARY cenrepnotifhandler.lib
+LIBRARY javacomms.lib
+LIBRARY javautils.lib
+LIBRARY libpthread.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY euser.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY apparc.lib
+LIBRARY avkon.lib
+LIBRARY efsrv.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+LIBRARY apgrfx.lib
+
+CAPABILITY all -tcb
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+#if defined(ARMCC_4_0)
+OPTION ARMCC --import_all_vtbl
+#endif
+OPTION GCCE -fvisibility-inlines-hidden
+
+VERSION 10.0
+
+ARMFPU softvfp
+
+PAGED
+
+BYTEPAIRCOMPRESSTARGET
+
+USERINCLUDE .
+
+#include <platform_paths.hrh>
+
+ APP_LAYER_SYSTEMINCLUDE
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE
+
+ OS_LAYER_SSL_SYSTEMINCLUDE
+
+deffile ./~/javacaptain_ext_settingslistener.def
+
+ SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
+
+SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
+
+#ifdef WINSCW
+
+LIBRARY ewsd.lib
+
+#endif
+
+STDCPP
+
+#ifdef WINSCW
+DEFFILE ./bwins/javacaptain_ext_settingslistener.def
+#elif defined EABI
+DEFFILE ./eabi/javacaptain_ext_settingslistener.def
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/inc/settingschangeeventsprovidermessages.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Definition of comms messages used for reporting chages in system
+* settings.
+*
+*/
+
+#ifndef SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H
+#define SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H
+
+#include "commsmessage.h"
+#include "logger.h"
+
+namespace java
+{
+namespace captain
+{
+
+using namespace java::util;
+using namespace java::comms;
+
+const int SETTINGS_CHANGE_EVENT_MESSAGE_ID_C = 1;
+
+const char* const SETTINGS_CHANGE_EVENT_PROVIDER = "settingslistener";
+
+typedef enum
+{
+ UNDEFINED_CHANGE = 0x00,
+ MIDP_CLASS_PATH_CHANGE = 0x01,
+
+} SettingsChangeEventType_t;
+
+
+inline void setSettingsChangeEventMessageParams(CommsMessage& aMessage,
+ const int& aChangeEventType)
+{
+ aMessage.setMessageId(SETTINGS_CHANGE_EVENT_MESSAGE_ID_C);
+ aMessage << aChangeEventType;
+}
+
+inline void getSettingsChangeEventMessageParams(CommsMessage& aMessage,
+ int& aChangeEventType)
+{
+ if (aMessage.getMessageId() == SETTINGS_CHANGE_EVENT_MESSAGE_ID_C)
+ {
+ aMessage >> aChangeEventType;
+ }
+ else
+ {
+ ELOG2(EJavaCaptain, "Received Settings Change Event with wrong MessageId!: %d should be %d",
+ aMessage.getMessageId(), SETTINGS_CHANGE_EVENT_MESSAGE_ID_C);
+ aChangeEventType = UNDEFINED_CHANGE;
+ }
+}
+
+} // namespace captain
+} // namespace java
+
+#endif // SETTINGSCHANGEEVENTSPROVIDERMESSAGES_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/inc/settingslistenerextension.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Extension plugin which is used for monitoring changes in various
+* system settings.
+*
+*/
+
+#ifndef SETTINGSLISTENEREXTENSION_H
+#define SETTINGSLISTENEREXTENSION_H
+
+#include "javaosheaders.h"
+
+#include "extensionplugininterface.h"
+#include "settingslistenerinterface.h"
+
+namespace java
+{
+namespace captain
+{
+
+class CoreInterface;
+
+OS_NONSHARABLE_CLASS(SettingsListenerExtension) : public ExtensionPluginInterface
+{
+public:
+ SettingsListenerExtension();
+ virtual ~SettingsListenerExtension();
+
+ // ExtensionPluginInterface
+ virtual void startPlugin(CoreInterface* aCore);
+ virtual void stopPlugin();
+
+protected:
+
+private:
+ CoreInterface* mCore; // resource not owned
+ SettingsListenerInterface* mSettingsListenerImpl; // resource owned
+};
+
+} // namespace captain
+} // namespace java
+
+#endif // SETTINGSLISTENEREXTENSION_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/inc/settingslistenerinterface.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Definition of interface, which is used for listening changes in
+* in system settings.
+*
+*/
+
+#ifndef SETTINGSLISTENERINTERFACE_H
+#define SETTINGSLISTENERINTERFACE_H
+
+namespace java
+{
+
+namespace captain
+{
+
+class SettingsListenerInterface
+{
+public:
+ virtual ~SettingsListenerInterface() {}
+
+ virtual void startListening() = 0;
+ virtual void stopListening() = 0;
+
+};
+
+} // namespace captain
+} // namespace java
+
+#endif // SETTINGSLISTENERINTERFACE_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/cenreplistener.cpp Thu Aug 19 09:48:13 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:
+*
+*/
+
+#include <e32base.h>
+#include <centralrepository.h>
+
+#include "coreinterface.h"
+#include "eventconsumerinterface.h"
+
+#include "logger.h"
+#include "cenreplistener.h"
+#include "settingschangeeventsprovidermessages.h"
+
+namespace java
+{
+namespace captain
+{
+
+// General listener used as a base value indicating that whole repository is being
+// listened instead of individual key.
+CenRepListener::CenRepListener() : mKeyType(CenRepListener::GENERAL_LISTENER)
+{
+}
+
+CenRepListener::~CenRepListener()
+{
+ close();
+}
+
+void CenRepListener::close()
+{
+ if (mNotifyHandler)
+ {
+ mNotifyHandler->StopListening();
+ delete mNotifyHandler;
+ mNotifyHandler = 0;
+ }
+ if (mCenRepSession)
+ {
+ delete mCenRepSession;
+ mCenRepSession = 0;
+ }
+}
+
+CenRepListener* CenRepListener::NewL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId,
+ CCenRepNotifyHandler::TCenRepKeyType aKeyType)
+{
+ CenRepListener* crListener = new(ELeave) CenRepListener();
+ CleanupStack::PushL(crListener);
+ crListener->ConstructL(aCore, aRepoId, aKeyId, aKeyType);
+ CleanupStack::Pop(crListener);
+ return (crListener);
+}
+
+void CenRepListener::ConstructL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId,
+ CCenRepNotifyHandler::TCenRepKeyType aKeyType)
+{
+ mCore = aCore;
+ mRepoId = aRepoId;
+ mKeyType = aKeyType;
+ mCenRepSession = CRepository::NewL(mRepoId);
+ mNotifyHandler = CCenRepNotifyHandler::NewL(*this, *mCenRepSession,
+ aKeyType, aKeyId);
+ mNotifyHandler->StartListeningL();
+}
+
+void CenRepListener::HandleNotifyString(TUint32 aKeyId, const TDesC16& /*aNewValue*/)
+{
+ if (KCRUidJavaRuntime == mRepoId && KJavaRuntimeMIDPClasspath == aKeyId)
+ {
+ ILOG(EJavaCaptain, "CenRepListener::HandleNotifyString: change notified "
+ "in key KJavaRuntimeMIDPClasspath");
+ dispatchEvent(SETTINGS_CHANGE_EVENT_PROVIDER,
+ MIDP_CLASS_PATH_CHANGE);
+ }
+ else
+ {
+ WLOG1(EJavaCaptain, "Change in Unrecognised cenrep string key noticed! "
+ "CR Key= %0x", aKeyId);
+ }
+}
+
+void CenRepListener::HandleNotifyError(TUint32 aKeyId, TInt aError, CCenRepNotifyHandler* /* aHandler */)
+{
+ ELOG2(EJavaCaptain, "Error (code: %d) occured when listening changes on "
+ "Cenrep key (Key ID: %0x). Listening stopped!", aError, aKeyId);
+ close();
+}
+
+void CenRepListener::dispatchEvent(const std::string& aEvent,
+ const SettingsChangeEventType_t& aType) const
+{
+ ILOG2(EJavaCaptain, "CenRepListener::dispatchEvent: dispatching event=%s "
+ "type=%d", aEvent.c_str(), aType);
+ CommsMessage eventMsg;
+ setSettingsChangeEventMessageParams(eventMsg, aType);
+ mCore->getEventDispatcher()->event(aEvent, eventMsg);
+}
+
+} // namespace captain
+} // namespace java
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/cenreplistener.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Class is used for listening changes in various Symbian Central
+* repository keys.
+*
+*/
+
+#ifndef CENREPLISTENER_H
+#define CENREPLISTENER_H
+
+#include <e32std.h>
+#include <cenrepnotifyhandler.h>
+
+#include "javaosheaders.h"
+#include "settingschangeeventsprovidermessages.h"
+#include "javaruntimeprivatecrkeys.h"
+
+namespace java
+{
+namespace captain
+{
+
+class CoreInterface;
+
+OS_NONSHARABLE_CLASS(CenRepListener) :
+ public CBase, public MCenRepNotifyHandlerCallback
+{
+public:
+ enum TListenerType {GENERAL_LISTENER = -1};
+
+ static CenRepListener* NewL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId,
+ CCenRepNotifyHandler::TCenRepKeyType aKeyType);
+
+ virtual ~CenRepListener();
+
+ // MCenRepNotifyHandlerCallback (only partial implementation needed here for now)
+ // These handler methods must know what to do in each case, i.e
+ // how to handle the change in each particular key.
+ virtual void HandleNotifyString(TUint32 aKeyId, const TDesC16& aNewValue);
+ virtual void HandleNotifyError(TUint32 aKeyId, TInt aError,
+ CCenRepNotifyHandler* aHandler);
+protected:
+ CenRepListener();
+
+ void dispatchEvent(const std::string& aEvent,
+ const SettingsChangeEventType_t& aType) const;
+
+private:
+ void ConstructL(CoreInterface* aCore, TUid aRepoId, TUint32 aKeyId,
+ CCenRepNotifyHandler::TCenRepKeyType aKeyType);
+ void close();
+ TInt mKeyType;
+ CoreInterface* mCore;
+ TUid mRepoId;
+ CCenRepNotifyHandler* mNotifyHandler;
+ CRepository* mCenRepSession;
+};
+
+} // namespace captain
+} // namespace java
+
+#endif // CENREPLISTENER_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/lookup.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,45 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: lookup
+*
+*/
+
+#include <string> //For strcmp
+
+#include "javasymbianoslayer.h"
+#include "logger.h"
+
+#include "extensionplugininterface.h"
+
+using namespace java::captain;
+
+ExtensionPluginInterface* getExtensionPlugin();
+
+EXPORT_C FuncPtr findDllMethod(const char* funcName)
+{
+ JELOG2(EJavaCaptain);
+ FuncPtr ptr = 0;
+ if (funcName)
+ {
+ if (strcmp(funcName, "getExtensionPlugin") == 0)
+ {
+ ptr = (FuncPtr)getExtensionPlugin;
+ }
+ }
+ else
+ {
+ ELOG(EJavaCaptain, "settingslistener extensionplugin findDllMethod() funcName == null");
+ }
+ return ptr;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/settingslistenerimpl.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "settingslistenerimpl.h"
+#include "cenreplistener.h"
+#include "logger.h"
+
+namespace java
+{
+namespace captain
+{
+
+SettingsListenerImpl::SettingsListenerImpl(CoreInterface* aCore) :
+ mCore(aCore)
+{
+}
+
+SettingsListenerImpl::~SettingsListenerImpl()
+{
+ cleanUp();
+}
+
+void SettingsListenerImpl::startListening()
+{
+ // All "listeners" must be created&started here.
+
+ // Currently there is just this one CenRep key to be listened
+ TInt error = KErrNone;
+ CenRepListener* crMidpClassPathChangeListener =
+ createCenRepKeyListener(KCRUidJavaRuntime, KJavaRuntimeMIDPClasspath,
+ CCenRepNotifyHandler::EStringKey, error);
+ if (crMidpClassPathChangeListener)
+ {
+ mCenRepListeners.push_back(crMidpClassPathChangeListener);
+ }
+ else
+ {
+ ELOG4(EJavaCaptain, "Error (code: %d) occured when starting "
+ "CenRepListener (repo=%0x, key=%0x, keytype=%d)",
+ error, KCRUidJavaRuntime.iUid, KJavaRuntimeMIDPClasspath,
+ CCenRepNotifyHandler::EStringKey);
+ }
+}
+
+void SettingsListenerImpl::stopListening()
+{
+ cleanUp();
+}
+
+CenRepListener* SettingsListenerImpl::createCenRepKeyListener(TUid aRepoId, TUint32 aKeyId,
+ CCenRepNotifyHandler::TCenRepKeyType aKeyType, TInt& aErrorCode)
+{
+ CenRepListener* listener = NULL;
+ TRAP(aErrorCode, listener = CenRepListener::NewL(mCore, aRepoId, aKeyId, aKeyType));
+ return listener; // Possible error propagated as a function parameter
+}
+
+// Clean up owned resources
+void SettingsListenerImpl::cleanUp()
+{
+ for (crListeners_t::iterator listenersIter = mCenRepListeners.begin();
+ listenersIter != mCenRepListeners.end(); ++listenersIter)
+ {
+ delete *listenersIter;
+ *listenersIter = 0;
+ }
+ mCenRepListeners.clear();
+}
+
+} // namespace captain
+} // namespace java
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/src.s60/settingslistenerimpl.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Platform specific component which manages all the listeners
+* listening changes in system configuration. Currently only Central
+* Repository listening is supported.
+*
+*/
+
+#ifndef SETTINGSLISTENERIMPL_H
+#define SETTINGSLISTENERIMPL_H
+
+#include <vector>
+#include <memory>
+#include <cenrepnotifyhandler.h>
+
+#include "javaosheaders.h"
+#include "settingslistenerinterface.h"
+
+namespace java
+{
+namespace captain
+{
+
+class CoreInterface;
+class CenRepListener;
+
+OS_NONSHARABLE_CLASS(SettingsListenerImpl) : public SettingsListenerInterface
+{
+public:
+ SettingsListenerImpl(CoreInterface* aCore);
+ virtual ~SettingsListenerImpl();
+
+ // SystemSettingsChangeListenerInterface
+ virtual void startListening();
+ virtual void stopListening();
+
+private:
+ void cleanUp();
+ CenRepListener* createCenRepKeyListener(TUid aRepoId, TUint32 aKeyId,
+ CCenRepNotifyHandler::TCenRepKeyType aKeyType,
+ TInt& aErrorCode);
+
+ CoreInterface* mCore; // resource not owned
+ typedef std::vector<CenRepListener*> crListeners_t;
+ crListeners_t mCenRepListeners; // listeners are owned resources.
+
+};
+
+} // namespace captain
+} // namespace java
+
+#endif // SETTINGSLISTENERIMPL_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javacaptain/extensionplugins/settingslistener/src/settingslistenerextension.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation for creating system settings listener plugin
+*
+*/
+
+#include "logger.h"
+#include "settingslistenerextension.h"
+#include "settingslistenerimpl.h"
+
+#ifdef __SYMBIAN32__
+java::captain::ExtensionPluginInterface* getExtensionPlugin()
+{
+#else
+extern "C" java::captain::ExtensionPluginInterface* getExtensionPlugin()
+{
+#endif
+ return new java::captain::SettingsListenerExtension();
+}
+
+namespace java
+{
+namespace captain
+{
+
+SettingsListenerExtension::SettingsListenerExtension() : mCore(0), mSettingsListenerImpl(0)
+{
+}
+
+SettingsListenerExtension::~SettingsListenerExtension()
+{
+}
+
+void SettingsListenerExtension::startPlugin(CoreInterface* core)
+{
+ if (mSettingsListenerImpl || mCore)
+ {
+ WLOG(EJavaCaptain, "Settingslistener plugin already running, terminating previous instance first!");
+ stopPlugin();
+ }
+ mCore = core;
+ mSettingsListenerImpl = new SettingsListenerImpl(mCore);
+ mSettingsListenerImpl->startListening();
+}
+
+void SettingsListenerExtension::stopPlugin()
+{
+ mCore = 0;
+ if (mSettingsListenerImpl)
+ {
+ mSettingsListenerImpl->stopListening();
+ delete mSettingsListenerImpl;
+ mSettingsListenerImpl = 0;
+ }
+}
+
+
+} // namespace captain
+} // namespace java
+
--- a/javamanager/javacaptain/extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin_0x2002DCA3.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin_0x2002DCA3.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javacaptain_ext_storageserverplugin.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../src
--- a/javamanager/javacaptain/inc.s60/tickerprovider.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/inc.s60/tickerprovider.h Thu Aug 19 09:48:13 2010 +0300
@@ -43,7 +43,7 @@
virtual void cancel();
// Helpers
-// virtual long long getCurrentJavaTime();
+ virtual long long getPlatformCurrentJavaTime();
protected:
// CActive
--- a/javamanager/javacaptain/javacaptain.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/javacaptain.pro Thu Aug 19 09:48:13 2010 +0300
@@ -18,5 +18,7 @@
SUBDIRS += extensionplugins/config/build/javacaptain_ext_config.pro
SUBDIRS += extensionplugins/javacertstore/build/javacaptain_ext_javacertstore.pro
SUBDIRS += extensionplugins/storageserver/build/javacaptain_ext_storageserverplugin.pro
+SUBDIRS += extensionplugins/settingslistener/build/javacaptain_ext_settingslistener.pro
SUBDIRS += extensionplugins/preinstallerstarter/build/javacaptain_ext_preinstallerstarter.pro
+SUBDIRS += extensionplugins/autostarter/build/javacaptain_ext_autostarter.pro
BLD_INF_RULES.prj_extensions += "prj_extensions"
--- a/javamanager/javacaptain/src.s60/tickerprovider.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/src.s60/tickerprovider.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -91,8 +91,8 @@
}
mNextTickAt = 0LL;
}
-/*
-long long TickerProvider::getCurrentJavaTime()
+
+long long TickerProvider::getPlatformCurrentJavaTime()
{
JELOG2(EJavaCaptain);
TTime currentTime;
@@ -101,7 +101,7 @@
// Current time - javaEpoc && uSeconds -> mSeconds
return (currentTime.Int64()- TTime(TDateTime(1970,EJanuary,0,0,0,0,0)).Int64()) / 1000LL;
}
-*/
+
void TickerProvider::RunL()
{
JELOG2(EJavaCaptain);
--- a/javamanager/javacaptain/src/rtc.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/src/rtc.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -36,6 +36,8 @@
#include "javastorage.h"
#include "javastoragenames.h"
+#include "settingschangeeventsprovidermessages.h"
+
#include "midprtcplugin.h"
#ifdef RD_JAVA_CAPTAIN_TESTRUNTIME
#include "testrtcplugin.h"
@@ -498,15 +500,31 @@
}
void Rtc::event(const std::string& eventProvider,
- java::comms::CommsMessage& /* aMsg */)
+ java::comms::CommsMessage& aMsg )
{
ILOG(EJavaCaptain, "+Rtc::event()");
if (BOOT_EVENT_PROVIDER == eventProvider)
{
if (mSupportPreWarming && isThereInstalledMidlets())
{
- ILOG(EJavaCaptain, "Rtc::event() - Boot event received, Starting prewarm VM since found Installed MIDlets");
- launchPrewarm(); //New prewarm VM instance is will be created only if it did not exist already
+ ILOG(EJavaCaptain, "Rtc::event() - Boot event received, Starting "
+ "prewarm VM since found Installed MIDlets");
+ launchPrewarm(); //New prewarm VM instance is will be created only
+ //if it did not exist already
+ }
+ } else if ( SETTINGS_CHANGE_EVENT_PROVIDER == eventProvider )
+ {
+ int changeEventType = 0;
+ getSettingsChangeEventMessageParams(aMsg, changeEventType);
+ if ( MIDP_CLASS_PATH_CHANGE == changeEventType &&
+ (mRuntimes.find(PREWARM_UID) != mRuntimes.end()) )
+ {
+ // Java libraries have been modified in the system.
+ //Prewarm instance must be restarted
+ ILOG(EJavaCaptain, "Rtc::event() - Restarting prewarm VM instance "
+ "since MIDP classpath has changed");
+ stopPrewarm();
+ launchPrewarm();
}
}
}
--- a/javamanager/javacaptain/src/tickerproviderinterface.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/src/tickerproviderinterface.h Thu Aug 19 09:48:13 2010 +0300
@@ -64,6 +64,19 @@
// Helpers
/**
* Returns milliseconds from EPOCH.
+ * This can be overridden with the platform specific implementation. Use case for
+ * overriding is that in some platforms gettimeofday implementation can't handle
+ * correctly times after 2038.
+ * @param[in] -
+ * @return - milliseconds from EPOCH in success, -1 if fails
+ */
+ virtual long long getPlatformCurrentJavaTime()
+ {
+ return -1LL;
+ }
+
+ /**
+ * Returns milliseconds from EPOCH.
* @param[in] -
* @return - milliseconds from EPOCH in success, -1 if fails
*/
@@ -73,7 +86,8 @@
int err = gettimeofday(&tim, NULL);
if (-1 == err)
{
- return -1LL;
+ WLOG(EJavaCaptain, "getCurrentJavaTime: gettimeofday returned -1");
+ return getPlatformCurrentJavaTime();
}
return (tim.tv_sec * 1000LL) +
--- a/javamanager/javacaptain/subsystem.mk Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/subsystem.mk Thu Aug 19 09:48:13 2010 +0300
@@ -22,6 +22,7 @@
extensionplugins/config/build \
extensionplugins/javacertstore/build \
extensionplugins/storageserver/build \
+ extensionplugins/settingslistener/build \
$(LINUX_ONLY)
@@ -35,6 +36,7 @@
endif
COMPONENTS += extensionplugins/preinstallerstarter/build
+COMPONENTS += extensionplugins/autostarter/build
ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
COMPONENTS += extensionplugins/scrupdater/build
endif
--- a/javamanager/javacaptain/systemams/src/certificatesmanager.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javacaptain/systemams/src/certificatesmanager.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -231,7 +231,7 @@
LazyInit();
iCurrentCertInfo = getTrustRootL(aId);
RArray<TUid> applications;
- applications.Append(KMidletInstallApplicabilityUid);
+ applications.AppendL(KMidletInstallApplicabilityUid);
iCertStore->SetApplicability(*iCurrentCertInfo, applications, iStatus);
User::WaitForRequest(iStatus);
if (iStatus.Int() == KErrNone)
--- a/javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/appinstuiplugin/build/javainstalllauncher.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -52,8 +52,6 @@
USERINCLUDE ../inc
USERINCLUDE ../../../../inc
-SYSTEMINCLUDE ../../../../inc
-
// Libraries
LIBRARY charconv.lib
LIBRARY cone.lib
--- a/javamanager/javainstaller/appinstuiplugin/src/javainstalllauncher.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/appinstuiplugin/src/javainstalllauncher.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -228,7 +228,7 @@
// Do NOT close rJavaInstaller now -> the caller gets notification when the
// process actually closes.
- iHandlesToClose.Append(rJavaInstaller);
+ iHandlesToClose.AppendL(rJavaInstaller);
}
void CJavaInstallLauncher::SilentInstallL(RFile& aFile,
@@ -410,7 +410,7 @@
// Do NOT close rJavaInstaller now -> the caller gets notification when the
// process actually closes.
- iHandlesToClose.Append(rJavaInstaller);
+ iHandlesToClose.AppendL(rJavaInstaller);
}
void CJavaInstallLauncher::UninstallL(const TUid& aUid, const TDesC8&, /*aMIME*/
@@ -451,7 +451,7 @@
// Do NOT close rJavaInstaller now -> the caller gets notification when the
// process actually closes.
- iHandlesToClose.Append(rJavaInstaller);
+ iHandlesToClose.AppendL(rJavaInstaller);
}
void CJavaInstallLauncher::SilentUninstallL(const TUid& aUid, const TDesC8&, /*aMIME*/
@@ -539,7 +539,7 @@
// Do NOT close rJavaInstaller now -> the caller gets notification when the
// process actually closes.
- iHandlesToClose.Append(rJavaInstaller);
+ iHandlesToClose.AppendL(rJavaInstaller);
}
TBool CJavaInstallLauncher::IsAppShellUpdate()
@@ -619,7 +619,7 @@
// Open UI env and resource file.
if (!iEik)
{
- iEik = CEikonEnv::Static();
+ iEik = CEikonEnv::Static(); // codescanner::eikonenvstatic
}
if (!iEik)
{
--- a/javamanager/javainstaller/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -20,4 +20,5 @@
#include "installerui/build/bld.inf"
#include "installer/build/bld.inf"
-#include "appinstuiplugin/build/bld.inf"
+#include "appinstuiplugin/build/bld.inf"
+#include "iconsizenotifplugin/build/bld.inf"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/iconsizenotifplugin/build/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,19 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Build information file for Java Icon Size Notifier Plugin
+*
+*/
+
+PRJ_MMPFILES
+javaiconsizenotifplugin.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/iconsizenotifplugin/build/javaiconsizenotifplugin.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Java notifier ecom plugin used to access the UI env
+* from non UI context.
+*/
+
+
+#include <platform_paths.hrh>
+
+
+TARGET javaiconsizenotifplugin.dll
+TARGETTYPE PLUGIN
+UID 0x10009D8D 0x101FD689
+
+CAPABILITY CAP_ECOM_PLUGIN
+VENDORID VID_DEFAULT
+
+PAGED
+
+APP_LAYER_SYSTEMINCLUDE
+
+START RESOURCE ../data/javaiconsizenotifplugin.rss
+TARGET javaiconsizenotifplugin.rsc
+END
+
+SOURCEPATH ../src
+SOURCE iconsizenotifier.cpp
+
+USERINCLUDE .
+USERINCLUDE ../inc
+USERINCLUDE ../../../../inc
+
+LIBRARY euser.lib
+LIBRARY eiksrv.lib // MEikSrvNotifierBase2
+LIBRARY cdlengine.lib // AknLayoutScalable_Avkon
+LIBRARY aknlayout2scalable.lib // TAknWindowComponentLayout
+LIBRARY avkon.lib // TAknLayoutRect
+LIBRARY eikcore.lib // TAknLayoutRect
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/iconsizenotifplugin/data/javaiconsizenotifplugin.rss Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: ECOM resource definition
+*
+*/
+
+#include <ecom/registryinfov2.rh>
+#include <uikon.hrh>
+
+RESOURCE REGISTRY_INFO r_registry
+ {
+ resource_format_version = RESOURCE_FORMAT_VERSION_2;
+ dll_uid = 0x101FD689;
+ interfaces =
+ {
+ INTERFACE_INFO
+ {
+ interface_uid = KUikonUidPluginInterfaceNotifiers;
+ implementations =
+ {
+ IMPLEMENTATION_INFO
+ {
+ implementation_uid = 0x101FD68A;
+ version_no = 1;
+ display_name = "JavaIconSizeNotifPlugin";
+ default_data = "";
+ opaque_data = "0";
+ rom_only = 0; // This is not a ROM only plugin
+ }
+ };
+ }
+ };
+ }
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/iconsizenotifplugin/inc/iconsizenotifier.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef ICONSIZENOTIFIER_H
+#define ICONSIZENOTIFIER_H
+
+
+#include <eiknotapi.h> // MEikSrvNotifierBase2
+
+
+const TInt KIdIconSizeNotifPlugin = 0x101FD68B;
+const TUid KUidIconSizeNotifPlugin = {KIdIconSizeNotifPlugin};
+
+
+class CIconSizeNotifier : public CBase, public MEikSrvNotifierBase2
+{
+public:
+ static CIconSizeNotifier* NewLC();
+ ~CIconSizeNotifier();
+
+private:
+ CIconSizeNotifier();
+ void ConstructL();
+
+// From MEikSrvNotifierBase2
+public:
+ void Release();
+ TNotifierInfo RegisterL();
+ TNotifierInfo Info() const;
+ void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
+ TPtrC8 StartL(const TDesC8& aBuffer);
+ void Cancel();
+ TPtrC8 UpdateL(const TDesC8& aBuffer);
+ void UpdateL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage);
+ TInt NotifierCapabilites();
+private:
+ TNotifierInfo iInfo;
+};
+
+#endif // ICONSIZENOTIFIER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/iconsizenotifplugin/inc/iconsizeutils.h Thu Aug 19 09:48:13 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 ICONSIZEUTILS_H
+#define ICONSIZEUTILS_H
+
+#include <aknlayoutscalable_avkon.cdl.h>
+#include <AknUtils.h>
+
+/**
+ * Fallback value of expected size of raster icons in Menu & Home Screen.
+ * Copy of KJavaIconWidth in Menu's mcsmenuiconutility.cpp.
+ */
+const TInt KIconInMenuFallbackSize = 88;
+
+/**
+ * Fallback value of expected size of raster icons in App Mgr.
+ */
+const TInt KIconInAppMgrFallbackSize = 46;
+
+/**
+ * Utility class packing all Java icon sizes needed troughout the system.
+ */
+class TIconSizes
+{
+public:
+ TSize iMenuIconSize;
+ TSize iAppMgrIconSize;
+};
+
+/**
+ * Utility class dealing with Java icon sizes.
+ */
+class IconSizeUtils
+{
+public:
+ /**
+ * Helper for getting the ideal sizes for Java raster icons.
+ * Accesses Akn layouts, therefore a Ui context is required
+ * (CEikonEnv present in the calling thread).
+ * This function has been inlined so that the Java App Mgr plugin
+ * does not have to statically link against the ecom plugin dll.
+ */
+ static TIconSizes GetIconSizes()
+ {
+ TIconSizes res;
+
+ // Menu & Home Screen icons size.
+ // No api to get it so just use the fallback value for now.
+ res.iMenuIconSize = TSize(KIconInMenuFallbackSize, KIconInMenuFallbackSize);
+
+ // App manager icon size.
+ // list_double_large_graphic_pane_vc_g1 = the icon of the app mgr list in landscape
+ TAknLayoutRect layoutRect;
+ layoutRect.LayoutRect(TRect(),
+ AknLayoutScalable_Avkon::list_double_large_graphic_pane_vc_g1(0).LayoutLine());
+ TRect rect(layoutRect.Rect());
+ TInt w(rect.Width());
+ TInt h(rect.Height());
+ if (w < 0 || h < 0)
+ {
+ w = KIconInAppMgrFallbackSize;
+ h = KIconInAppMgrFallbackSize;
+ }
+ res.iAppMgrIconSize = TSize(w, h);
+
+ return res;
+ }
+};
+
+#endif // ICONSIZEUTILS_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/iconsizenotifplugin/src/iconsizenotifier.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,135 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <e32cmn.h>
+#include <eikenv.h>
+#include <bautils.h>
+#include <ecom/implementationproxy.h>
+
+#include "iconsizenotifier.h"
+#include "iconsizeutils.h"
+
+const TUid KUidScreenOutput = { 0x10009D48 };
+
+CIconSizeNotifier* CIconSizeNotifier::NewLC()
+{
+ CIconSizeNotifier* self = new(ELeave) CIconSizeNotifier();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+}
+
+CIconSizeNotifier::~CIconSizeNotifier()
+{
+}
+
+CIconSizeNotifier::CIconSizeNotifier()
+{
+}
+
+void CIconSizeNotifier::ConstructL()
+{
+}
+
+void CIconSizeNotifier::Release()
+{
+ delete this;
+}
+
+CIconSizeNotifier::TNotifierInfo CIconSizeNotifier::RegisterL()
+{
+ iInfo.iUid = KUidIconSizeNotifPlugin;
+ iInfo.iChannel = KUidScreenOutput;
+ iInfo.iPriority = ENotifierPriorityHigh;
+ return iInfo;
+}
+
+CIconSizeNotifier::TNotifierInfo CIconSizeNotifier::Info() const
+{
+ return iInfo;
+}
+
+void CIconSizeNotifier::StartL(const TDesC8& /*aBuffer*/, TInt aReplySlot, const RMessagePtr2& aMessage)
+{
+ TPckgBuf<TIconSizes> res(IconSizeUtils::GetIconSizes());
+ aMessage.WriteL(aReplySlot, res);
+ aMessage.Complete(KErrNone);
+}
+
+TPtrC8 CIconSizeNotifier::StartL(const TDesC8& /*aBuffer*/)
+{
+ return KNullDesC8();
+}
+
+void CIconSizeNotifier::Cancel()
+{
+}
+
+TPtrC8 CIconSizeNotifier::UpdateL(const TDesC8& /*aBuffer*/)
+{
+ return KNullDesC8();
+}
+
+void CIconSizeNotifier::UpdateL(const TDesC8& /*aBuffer*/, TInt /*aReplySlot*/, const RMessagePtr2& aMessage)
+{
+ aMessage.Complete(KErrNotSupported);
+}
+
+void CreateNotifiersL(CArrayPtrFlat<MEikSrvNotifierBase2>& aNotifiers)
+{
+ CIconSizeNotifier* notifier1 = CIconSizeNotifier::NewLC();
+ aNotifiers.AppendL(notifier1);
+ CleanupStack::Pop(notifier1);
+}
+
+CArrayPtr<MEikSrvNotifierBase2>* NotifierArray()
+{
+ CArrayPtrFlat<MEikSrvNotifierBase2>* notifiers = new CArrayPtrFlat<MEikSrvNotifierBase2>(1);
+ if (notifiers)
+ {
+ TRAPD(err, CreateNotifiersL(*notifiers));
+ if (err)
+ {
+ TInt count = notifiers->Count();
+ while (count--)
+ {
+ (*notifiers)[count]->Release();
+ }
+ delete notifiers;
+ notifiers = NULL;
+ }
+ }
+ return notifiers;
+}
+
+TInt CIconSizeNotifier::NotifierCapabilites()
+{
+ return ENoSpecialCapabilities;
+}
+
+// ECom plugin entry point
+const TImplementationProxy ImplementationTable[] =
+{
+ IMPLEMENTATION_PROXY_ENTRY(0x101FD68A, NotifierArray)
+};
+
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
+{
+ aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
+ return ImplementationTable;
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installcopier/build/javainstallcopier.pro Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE=app
+TARGET=javainstallcopier
+CONFIG += omj no_icon stl
+CONFIG -= qt
+
+symbian {
+ TARGET.UID2 = 0x20031612
+ TARGET.UID3 = 0x20031612
+
+ TARGET.CAPABILITY = AllFiles
+
+ LIBS += -lefsrv -lcharconv
+}
+
+include(../../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installcopier/src/javainstallcopier.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,153 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+* JavaInstallCopier.exe is a utility for copying Java installation
+* files from other processes private data cages to JavaInstaller's
+* private data cage. JavaSifPlugin calls JavaInstallCopier if
+* installation is started from a file which resides in a private
+* data cage which JavaInstaller cannot access.
+*
+*/
+
+
+#ifdef __SYMBIAN32__
+#include <f32file.h>
+#include <utf.h>
+#endif // __SYMBIAN32__
+
+#include "exceptionbase.h"
+#include "javaoslayer.h"
+#include "logger.h"
+#include "runtimeexception.h"
+
+using namespace java::runtime;
+using namespace java::util;
+
+int isCopyAllowed()
+{
+ int result = 0;
+#ifdef __SYMBIAN32__
+ // Only SifServer (0x10285BCB) is allowed to launch JavaInstallCopier.
+ TSecureId creatorSecId(User::CreatorSecureId());
+ if (0x10285BCB != creatorSecId.iId)
+ {
+ ELOG1(EJavaInstaller,
+ "INSTALLCOPIER: Process 0x%x is not allowed to "
+ "launch JavaInstallCopier", creatorSecId.iId);
+ result = KErrPermissionDenied;
+ }
+#endif // __SYMBIAN32__
+ return result;
+}
+
+int copyToInstallerDir(int argc, char *argv[])
+{
+ int result = 0;
+
+#ifdef __SYMBIAN32__
+ RFs rfs;
+ result = rfs.Connect();
+ if (KErrNone != result)
+ {
+ ELOG1(EJavaInstaller,
+ "INSTALLCOPIER: Connecting to RFs failed, err=%d", result);
+ return result;
+ }
+
+ CFileMan* fm = NULL;
+ TRAP(result, fm = CFileMan::NewL(rfs));
+ if (KErrNone != result)
+ {
+ ELOG1(EJavaInstaller,
+ "INSTALLCOPIER: Creating CFileMan failed, err=%d", result);
+ return result;
+ }
+
+ _LIT(KJavaInstallerTmp, "\\private\\102033E6\\installer\\tmp\\");
+ for (int i = 1; i < argc && KErrNone == result; i++)
+ {
+ TPtrC8 srcPtr((const TText8*)argv[i]);
+ TFileName srcPath;
+ CnvUtfConverter::ConvertToUnicodeFromUtf8(srcPath, srcPtr);
+ // Get the drive from the srcPath...
+ TParse fp;
+ rfs.Parse(srcPath, fp);
+ // ...and prefix it to KJavaInstallerTmp path.
+ TFileName dstPath = fp.Drive();
+ dstPath.Append(KJavaInstallerTmp);
+
+ result = fm->Copy(srcPath, dstPath, CFileMan::ERecurse|CFileMan::EOverWrite);
+
+ std::wstring srcWs((wchar_t*)srcPath.Ptr(), srcPath.Length());
+ std::wstring dstWs((wchar_t*)dstPath.Ptr(), dstPath.Length());
+ if (KErrNone == result)
+ {
+ ILOG2(EJavaInstaller, "INSTALLCOPIER: Copied %S to %S",
+ srcWs.c_str(), dstWs.c_str());
+ }
+ else
+ {
+ ELOG3(EJavaInstaller,
+ "INSTALLCOPIER: Copying %S to %S failed, err=%d",
+ srcWs.c_str(), dstWs.c_str(), result);
+ }
+ }
+
+ delete fm;
+ fm = NULL;
+ rfs.Close();
+#else // __SYMBIAN32__
+ for (int i = 1; i < argc && result == 0; i++)
+ {
+ WLOG1(EJavaInstaller, "INSTALLCOPIER: Ignored %s", argv[i]);
+ }
+#endif // __SYMBIAN32__
+
+ return result;
+}
+
+int main(int argc, char *argv[])
+{
+ //ILOG(EJavaInstaller, "INSTALLCOPIER main()");
+ JavaOsLayer::startUpTrace("INSTALLCOPIER main() start", -1, -1);
+
+ int result = 0;
+ try
+ {
+ result = isCopyAllowed();
+ if (0 == result)
+ {
+ result = copyToInstallerDir(argc, argv);
+ }
+ }
+ catch (RuntimeException& e)
+ {
+ ELOG1(EJavaInstaller, "INSTALLCOPIER main() RuntimeException caught: %s",
+ e.toString().c_str());
+ }
+ catch (ExceptionBase& e)
+ {
+ ELOG1(EJavaInstaller, "INSTALLCOPIER main() ExceptionBase caught: %s",
+ e.toString().c_str());
+ }
+ catch (std::exception& e)
+ {
+ ELOG1(EJavaInstaller, "INSTALLCOPIER main() Exception %s caught", e.what());
+ }
+
+ //ILOG1(EJavaInstaller, "INSTALLCOPIER main() exit %d", result);
+ JavaOsLayer::startUpTrace("INSTALLCOPIER main() end", -1, -1);
+ return result;
+}
--- a/javamanager/javainstaller/installer/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -74,6 +74,7 @@
value="com.nokia.mj.impl.installer.utils.SysUtil,
com.nokia.mj.impl.installer.utils.FileRoots,
com.nokia.mj.impl.installer.utils.FileWriter,
+ com.nokia.mj.impl.installer.utils.PropertyProvider,
com.nokia.mj.impl.installer.jadjarmatcher.JadJarMatcher,
com.nokia.mj.impl.installer.applicationregistrator.ApplicationRegistrator,
com.nokia.mj.impl.installer.applicationregistrator.SifNotifier,
--- a/javamanager/javainstaller/installer/build/exports.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/build/exports.inf Thu Aug 19 09:48:13 2010 +0300
@@ -27,11 +27,12 @@
../data/inst_plugins.cfg /epoc32/data/z/private/102033E6/installer/inst_plugins.cfg
-// Generic configuration interface for javainstaller cenrep settings
-// javainstaller_102824CE implementation specifics for cenrep data
+// Configuration interface for javainstaller
#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
+// Public configuration interface is named as CI_javainstaller.confml
+// and it is located outside of jrt package. The name of private
+// configuration interface is javainstaller2.confml.
../conf/javainstaller2.confml APP_LAYER_CONFML(javainstaller.confml)
-../conf/CI_javainstaller.confml APP_LAYER_CONFML(CI_javainstaller.confml)
#else
../conf/javainstaller.confml APP_LAYER_CONFML(javainstaller.confml)
#endif /* RD_JAVA_S60_RELEASE_10_1_ONWARDS */
--- a/javamanager/javainstaller/installer/build/javainstaller.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/build/javainstaller.pro Thu Aug 19 09:48:13 2010 +0300
@@ -37,7 +37,8 @@
INCLUDEPATH += ../src.s60/applicationregistrator \
../src.s60/iconconverter \
../src.s60/jadjarmatcher \
- ../src.s60/utils
+ ../src.s60/utils \
+ ../../iconsizenotifplugin/inc
SOURCES += ../src.s60/applicationregistrator/applicationregistrator.cpp \
../src.s60/applicationregistrator/sifnotifier.cpp \
@@ -48,29 +49,31 @@
../src.s60/jadjarmatcher/jadjarmatcherscanfrominbox.cpp \
../src.s60/utils/filewriter.cpp \
../src.s60/utils/fileroots.cpp \
+ ../src.s60/utils/propertylistener.cpp \
+ ../src.s60/utils/propertyprovider.cpp \
../src.s60/utils/sysutil.cpp
LIBS += -lapgrfx -lbafl -lcentralrepository -lcharconv -lefsrv -lestor \
-lezip -lfbscli -limageconversion -lmsgs \
-lsysutil -lplatformenv -lws32 -lapparc -lcentralrepository \
- -lhal -lcaf -lcafutils
+ -lhal -lcaf -lcafutils -lbitmaptransforms
contains(PROJECT_DEFINES,RD_JAVA_S60_50_REL2) {
LIBS += -lmcsmenu
}
contains(PROJECT_DEFINES,RD_JAVA_S60_RELEASE_10_1_ONWARDS) {
- LIBS += -lQtServiceFramework
- }
-
- contains(PROJECT_DEFINES,RD_JAVA_USIF_NOTIFY_PROGRESS) {
- LIBS += -lsifnotification
+ CONFIG += hb
+ LIBS += -lsifnotification -lxqservice
}
MMP_RULES += \
"$${LITERAL_HASH}include <bldvariant.hrh>" \
"$${LITERAL_HASH}ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK" \
"LIBRARY scrclient.lib" \
+ "$${LITERAL_HASH}else" \
+ "LIBRARY ecom.lib" \
+ "LIBRARY SWInstTaskManager.lib" \
"$${LITERAL_HASH}endif"
} else {
CONFIG += omj java javaonly stl
--- a/javamanager/javainstaller/installer/build/javainstaller_0x2002DCB4.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/build/javainstaller_0x2002DCB4.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javainstaller.mmp
@@ -52,13 +52,13 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../src.s60/applicationregistrator
SYSTEMINCLUDE ../src.s60/iconconverter
SYSTEMINCLUDE ../src.s60/jadjarmatcher
SYSTEMINCLUDE ../src.s60/utils
+SYSTEMINCLUDE ../../iconsizenotifplugin/inc
SYSTEMINCLUDE ../../../inc
SYSTEMINCLUDE ../../../../inc
SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
@@ -81,6 +81,8 @@
SOURCEPATH ../src.s60/utils
SOURCE filewriter.cpp
SOURCE fileroots.cpp
+SOURCE propertylistener.cpp
+SOURCE propertyprovider.cpp
SOURCE sysutil.cpp
@@ -101,6 +103,7 @@
LIBRARY hal.lib
LIBRARY caf.lib
LIBRARY cafutils.lib
+LIBRARY bitmaptransforms.lib
LIBRARY javautils.lib
LIBRARY libpthread.lib
LIBRARY libstdcppv5.lib
@@ -141,6 +144,12 @@
LIBRARY scrclient.lib
+#else
+
+LIBRARY ecom.lib
+
+LIBRARY SWInstTaskManager.lib
+
#endif
#include <platform_paths.hrh>
Binary file javamanager/javainstaller/installer/conf/CI_javainstaller.confml has changed
--- a/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistrator.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistrator.java Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -18,6 +18,7 @@
package com.nokia.mj.impl.installer.applicationregistrator;
+import com.nokia.mj.impl.installer.storagehandler.SuiteInfo;
import com.nokia.mj.impl.installer.utils.InstallerException;
import com.nokia.mj.impl.installer.utils.FileRoots;
import com.nokia.mj.impl.installer.utils.FileUtils;
@@ -355,6 +356,8 @@
String aJarFilename,
StringBuffer aIconSuffix)
{
+ Log.log("ApplicationRegistrator.convertIcon: " + aInputIconFilename +
+ " --> " + aOutputIconFilename + ", from jar " + aJarFilename);
return _convertIcon(aInputIconFilename, aOutputIconFilename,
aJarFilename, aIconSuffix);
}
@@ -437,8 +440,50 @@
return;
}
+ /**
+ * Adds an entry to platform installation log.
+ *
+ * @param aSuite application suite information
+ * @param aAction 0 - installation, 1 - uninstallation
+ */
+ public static void addInstallLogEntry(SuiteInfo aSuite, int aAction)
+ {
+ // In S60 the version number is restricted to limited range.
+ // If version number is outside of this range, use version
+ // number 0 instead.
+ int result = _addInstallLogEntry(
+ aAction, PlatformUid.getIntValue(aSuite.getUid()),
+ aSuite.getName(), aSuite.getVendor(),
+ getVersion(aSuite.getVersion().getMajor(), 0, 127),
+ getVersion(aSuite.getVersion().getMinor(), 0, 99),
+ getVersion(aSuite.getVersion().getMicro(), 0, 32767));
+ if (result < 0)
+ {
+ Log.logError("Adding installation log entry failed, err=" + result);
+ }
+ else
+ {
+ Log.log("Added installation log entry");
+ }
+ }
+
/*** ----------------------------- PACKAGE ---------------------------- */
/*** ----------------------------- PRIVATE ---------------------------- */
+
+ /**
+ * Checks that given version number is between specified minimum and
+ * maximum value range (inclusive) and if it is returns version number.
+ * If version number is out of given range, returns 0.
+ */
+ private static int getVersion(int aVersion, int aMin, int aMax)
+ {
+ if (aVersion >= aMin && aVersion <= aMax)
+ {
+ return aVersion;
+ }
+ return 0;
+ }
+
/*** ----------------------------- NATIVE ----------------------------- */
/**
@@ -579,4 +624,20 @@
* @return true if Symbian 9.2 emulator environment
*/
private static native boolean _runningIn92Emulator();
+
+ /**
+ * Adds an entry to platform installation log.
+ *
+ * @param aAction 0 - installation, 1 - uninstallation
+ * @param aUid application suite uid
+ * @param aName application suite name
+ * @param aVendor application suite vendor
+ * @param aMajorVersion application suite major version
+ * @param aMinorVersion application suite minor version
+ * @param aMicroVersion application suite micro version
+ * @return Symbian error code (negative number) if fails, otherwise 0
+ */
+ private static native int _addInstallLogEntry(
+ int aAction, int aUid, String aName, String aVendor,
+ int aMajorVersion, int aMinorVersion, int aMicroVersion);
}
--- a/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifNotifier.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifNotifier.java Thu Aug 19 09:48:13 2010 +0300
@@ -41,6 +41,8 @@
public static final int SUB_OP_OCSP = 2;
/** Download phase during installation. */
public static final int SUB_OP_DOWNLOAD = 3;
+ /** Maximum progress notification value. */
+ private static final int MAX_PROGRESS = 100;
/** Operation being notified. */
private int iOperation = 0;
@@ -62,6 +64,8 @@
/** Sending progress notifications is only allowed between start
* and end notifications. */
private boolean iNotifyProgressAllowed = false;
+ /** Value of the last progress notification that has been sent. */
+ private int iLastProgressSent = 0;
/** Native object handle. */
private int iHandle = 0;
@@ -103,22 +107,22 @@
iIconDir = aIconDir;
iComponentIcon = aComponentIcon;
- if (iHandle == 0)
- {
- InstallerException.internalError(
- "SifNotifier.notifyStart: notifier has not been initialized");
- }
+ checkHandle();
int ret = _notifyStart(
iHandle, aGlobalComponentId, aComponentName,
aApplicationNames, aApplicationIcons,
aComponentSize, aIconDir, aComponentIcon);
if (ret < 0)
{
- Log.logError("Notifying SIF start failed with code " + ret +
- ", " + getInfoString());
+ Log.log("Notifying SIF start failed with code " + ret +
+ ", " + getInfoString());
InstallerException.internalError(
"Notifying SIF start failed with code " + ret);
}
+ else
+ {
+ Log.log("SifNotifier.notifyStart: " + getInfoString());
+ }
iNotifyProgressAllowed = true;
}
@@ -130,26 +134,35 @@
public void notifyEnd(
int aErrCategory, int aErrCode, String aErrMsg, String aErrMsgDetails)
{
- if (iHandle == 0)
+ checkHandle();
+ if (aErrCategory == 0 && iLastProgressSent < MAX_PROGRESS)
{
- InstallerException.internalError(
- "SifNotifier.notifyEnd: notifier has not been initialized");
+ // Before sending end notification, update progress to max if
+ // operation was successful and max progress notification has
+ // not yet been sent.
+ notifyProgress(SUB_OP_NO, MAX_PROGRESS, MAX_PROGRESS);
}
+ // No more progress notifications allowed.
iNotifyProgressAllowed = false;
int ret = _notifyEnd(
iHandle, iGlobalComponentId, aErrCategory, aErrCode,
aErrMsg, aErrMsgDetails);
+ String logMsg =
+ "ErrCategory: " + aErrCategory +
+ ", ErrCode: " + aErrCode +
+ ", ErrMsg: " + aErrMsg +
+ ", ErrMsgDetails: " + aErrMsgDetails;
if (ret < 0)
{
- Log.logError("Notifying SIF end failed with code " + ret +
- ", " + getInfoString() +
- ", ErrCategory: " + aErrCategory +
- ", ErrCode: " + aErrCode +
- ", ErrMsg: " + aErrMsg +
- ", ErrMsgDetails: " + aErrMsgDetails);
+ Log.log("Notifying SIF end failed with code " + ret +
+ ", " + getInfoString() + ", " + logMsg);
InstallerException.internalError(
"Notifying SIF end failed with code " + ret);
}
+ else
+ {
+ Log.log("SifNotifier.notifyEnd: " + logMsg);
+ }
}
/**
@@ -163,24 +176,29 @@
{
return;
}
- if (iHandle == 0)
+ checkHandle();
+ if (aSubOperation == SUB_OP_NO)
{
- InstallerException.internalError(
- "SifNotifier.notifyProgress: notifier has not been initialized");
+ iLastProgressSent = aCurrent;
}
int ret = _notifyProgress(
iHandle, iGlobalComponentId, iOperation, aSubOperation,
aCurrent, aTotal);
+ String logMsg =
+ "SubOp: " + aSubOperation +
+ ", Current: " + aCurrent +
+ ", Total: " + aTotal;
if (ret < 0)
{
- Log.logError("Notifying SIF progress failed with code " + ret +
- ", " + getInfoString() +
- ", SubOp: " + aSubOperation +
- ", Current: " + aCurrent +
- ", Total: " + aTotal);
+ Log.log("Notifying SIF progress failed with code " + ret +
+ ", " + getInfoString() + ", " + logMsg);
InstallerException.internalError(
"Notifying SIF progress failed with code " + ret);
}
+ else
+ {
+ Log.log("SifNotifier.notifyProgress: " + logMsg);
+ }
}
/**
@@ -191,17 +209,17 @@
*/
public void destroy()
{
- if (iHandle == 0)
- {
- InstallerException.internalError(
- "SifNotifier.destroy: notifier has not been initialized");
- }
+ checkHandle();
int ret = _destroy(iHandle);
if (ret < 0)
{
InstallerException.internalError(
"Destroying SIF notifier failed with code " + ret);
}
+ else
+ {
+ Log.log("SifNotifier destroyed");
+ }
iHandle = 0;
}
@@ -221,12 +239,29 @@
InstallerException.internalError(
"Initializing SifNotifier failed with code " + ret);
}
+ else
+ {
+ Log.log("SifNotifier created");
+ }
iHandle = ret;
}
/*** ----------------------------- PRIVATE ---------------------------- */
/**
+ * Checks if notifier instance has been initialized.
+ * @throws InstallerException if notifier has not been initialized
+ */
+ private void checkHandle()
+ {
+ if (iHandle == 0)
+ {
+ InstallerException.internalError(
+ "SifNotifier.destroy: notifier has not been initialized");
+ }
+ }
+
+ /**
* Returns notification info string used in logging.
*/
private String getInfoString()
@@ -235,11 +270,31 @@
buf.append("Operation: ").append(iOperation);
buf.append(", GlobalComponentId: ").append(iGlobalComponentId);
buf.append(", ComponentName: ").append(iComponentName);
- for (int i = 0; i < iApplicationNames.length; i++)
+ if (iApplicationNames != null)
{
- buf.append(", ApplicationName: ").append(iApplicationNames[i]);
+ for (int i = 0; i < iApplicationNames.length; i++)
+ {
+ buf.append(", ApplicationName[").append(i).append("]: ")
+ .append(iApplicationNames[i]);
+ }
+ }
+ if (iApplicationIcons != null)
+ {
+ for (int i = 0; i < iApplicationIcons.length; i++)
+ {
+ buf.append(", ApplicationIcon[").append(i).append("]: ")
+ .append(iApplicationIcons[i]);
+ }
}
buf.append(", ComponentSize: ").append(iComponentSize);
+ if (iIconDir != null)
+ {
+ buf.append(", IconDir: ").append(iIconDir);
+ }
+ if (iComponentIcon != null)
+ {
+ buf.append(", ComponentIcon: ").append(iComponentIcon);
+ }
return buf.toString();
}
--- a/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifRegistrator.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/applicationregistrator/SifRegistrator.java Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -25,7 +25,6 @@
import com.nokia.mj.impl.installer.utils.FileUtils;
import com.nokia.mj.impl.installer.utils.Log;
import com.nokia.mj.impl.installer.utils.PlatformUid;
-import com.nokia.mj.impl.rt.installer.ApplicationInfoImpl;
import com.nokia.mj.impl.utils.Attribute;
import com.nokia.mj.impl.utils.Uid;
@@ -61,6 +60,14 @@
}
/**
+ * Returns SIF specific error category from given error id.
+ */
+ public static int getErrorCategory(int aErrorId)
+ {
+ return _getErrorCategory(aErrorId);
+ }
+
+ /**
* Launches the application view. If launching application view
* fails this method does not throw exception but produces an
* error log entry.
@@ -129,27 +136,6 @@
}
/**
- * Registers or unregisters Java software type to software
- * installation framework.
- *
- * @param aRegister true for registration, false for unregistration
- */
- public static void registerJavaSoftwareType(boolean aRegister)
- {
- String op = (aRegister? "Register": "Unregister");
- int err = _registerJavaSoftwareType(aRegister);
- if (err < 0)
- {
- InstallerException.internalError(
- op + " Java software type failed with code " + err);
- }
- else
- {
- Log.log("SifRegistrator " + op + "ed Java software type");
- }
- }
-
- /**
* Starts application registration session.
* The registrations and unregistrations are done only
* when commitSession is called.
@@ -179,7 +165,7 @@
if (ret < 0)
{
InstallerException.internalError(
- "Creating session failed with code " + ret);
+ "Creating SIF session failed with code " + ret);
}
//Log.log("SifRegistrator session started");
iSessionHandle = ret;
@@ -198,36 +184,18 @@
*/
public void registerSuite(SuiteInfo aSuiteInfo, boolean aIsUpdate)
{
- if (0 == iSessionHandle)
- {
- InstallerException.internalError("No valid SIF session.");
- }
+ checkSession();
Log.log("SifRegistrator registering application suite " +
aSuiteInfo.getGlobalId());
- if (_getUsifMode() > 0)
+ // Register suite as a component.
+ registerComponent(aSuiteInfo, aIsUpdate);
+ registerLocalizedComponentName(aSuiteInfo, -1);
+ // Register applications within the component.
+ Vector apps = aSuiteInfo.getApplications();
+ for (int i = 0; i < apps.size(); i++)
{
- // USIF Phase 2 registration.
- // Register suite as a component.
- registerComponent(aSuiteInfo, aIsUpdate);
- registerLocalizedComponentName(aSuiteInfo, -1);
- // Register applications within the component.
- Vector apps = aSuiteInfo.getApplications();
- for (int i = 0; i < apps.size(); i++)
- {
- registerApplication(aSuiteInfo, i);
- }
- }
- else
- {
- // USIF Phase 1 registration.
- // Register each application in the suite.
- Vector apps = aSuiteInfo.getApplications();
- for (int i = 0; i < apps.size(); i++)
- {
- registerComponent(aSuiteInfo, i, aIsUpdate);
- registerLocalizedComponentName(aSuiteInfo, i);
- }
+ registerApplication(aSuiteInfo, i);
}
registerLocalizedProperties(aSuiteInfo);
}
@@ -243,29 +211,12 @@
*/
public void unregisterSuite(SuiteInfo aSuiteInfo)
{
- if (0 == iSessionHandle)
- {
- InstallerException.internalError("No valid SIF session.");
- }
+ checkSession();
Log.log("SifRegistrator unregistering application suite " +
aSuiteInfo.getGlobalId());
- if (_getUsifMode() > 0)
- {
- // USIF Phase 2 unregistration.
- // Unregister suite as a component.
- unregisterComponent(aSuiteInfo);
- }
- else
- {
- // USIF Phase 1 unregistration.
- // Unregister each application in the suite.
- Vector apps = aSuiteInfo.getApplications();
- for (int i = 0; i < apps.size(); i++)
- {
- unregisterComponent(aSuiteInfo, i);
- }
- }
+ // Unregister suite as a component.
+ unregisterComponent(aSuiteInfo);
}
/**
@@ -278,15 +229,11 @@
*/
public void commitSession()
{
- if (0 == iSessionHandle)
- {
- InstallerException.internalError("No valid SIF session.");
- }
-
+ checkSession();
int err = _commitSession(iSessionHandle);
if (err < 0)
{
- InstallerException.internalError("Commiting session failed with code " + err);
+ InstallerException.internalError("Commiting SIF session failed with code " + err);
}
// Current session has been closed
iSessionHandle = 0;
@@ -301,17 +248,13 @@
*/
public void rollbackSession()
{
- if (0 == iSessionHandle)
- {
- InstallerException.internalError("No valid SIF session.");
- }
-
+ checkSession();
int err = _rollbackSession(iSessionHandle);
// Session is closed always when rollback is called
iSessionHandle = 0;
if (err < 0)
{
- InstallerException.internalError("Rolling back the session failed with code " + err);
+ InstallerException.internalError("Rolling back SIF session failed with code " + err);
}
//Log.log("SifRegistrator session rolled back");
}
@@ -327,7 +270,6 @@
{
return;
}
-
_closeSession(iSessionHandle);
// Current session has been closed
iSessionHandle = 0;
@@ -344,11 +286,7 @@
*/
public ComponentId getComponentId(String aGlobalId)
{
- if (0 == iSessionHandle)
- {
- InstallerException.internalError("No valid SIF session.");
- }
-
+ checkSession();
ComponentId result = new ComponentId();
int ret = _getComponentId(iSessionHandle, aGlobalId, result);
if (-1 == ret)
@@ -376,11 +314,7 @@
*/
public ComponentId getComponentId(Uid aAppUid)
{
- if (0 == iSessionHandle)
- {
- InstallerException.internalError("No valid SIF session.");
- }
-
+ checkSession();
ComponentId result = new ComponentId();
int ret = _getComponentIdForApp(
iSessionHandle, ((PlatformUid)aAppUid).getIntValue(), result);
@@ -406,15 +340,12 @@
*/
public void logComponent(String aGlobalId)
{
- if (0 == iSessionHandle)
- {
- InstallerException.internalError("No valid SIF session.");
- }
-
+ checkSession();
int ret = _logComponent(iSessionHandle, aGlobalId);
if (ret < -1)
{
- Log.logError("SifRegistrator logComponent failed with code " + ret);
+ Log.logError("SifRegistrator logComponent for " + aGlobalId +
+ " failed with code " + ret);
}
}
@@ -422,120 +353,19 @@
/*** ----------------------------- PRIVATE ---------------------------- */
/**
- * Registers one Java application to S60 USIF as a component.
- * Used with USIF Phase 1.
- *
- * @param aSuiteInfo Information needed to register the application
- * @param aIndex index of the application in the suite
- * @param aIsUpdate true in case of an update, false in case of a new
- * installation
- * @throws InstallerException if registration cannot done or
- * startSession has not been called successfully
- * @see startSession
- * @see SuiteInfo
+ * Checks if SifRegistrator session has been started.
+ * @throws InstallerException if SifRegistrator session has not been started
*/
- private void registerComponent(
- SuiteInfo aSuiteInfo, int aIndex, boolean aIsUpdate)
+ private void checkSession()
{
- String globalId = aSuiteInfo.getGlobalId(aIndex);
- if (globalId == null)
- {
- Log.logWarning("SifRegistrator: Application with index " + aIndex +
- " not found from " + aSuiteInfo.getGlobalId());
- return;
- }
- ApplicationInfo appInfo =
- (ApplicationInfo)aSuiteInfo.getApplications().elementAt(aIndex);
- String suiteName = aSuiteInfo.getName();
- String vendor = aSuiteInfo.getVendor();
- String version = aSuiteInfo.getVersion().toString();
- String name = appInfo.getName();
- int uid = ((PlatformUid)appInfo.getUid()).getIntValue();
- String[] componentFiles = getComponentFiles(aSuiteInfo);
- long componentSize = aSuiteInfo.getInitialSize();
- String attrValue = aSuiteInfo.getAttributeValue("Nokia-MIDlet-Block-Uninstall");
- boolean isRemovable = !(attrValue != null && attrValue.equalsIgnoreCase("true"));
- boolean isDrmProtected = (aSuiteInfo.getContentInfo() == aSuiteInfo.CONTENT_INFO_DRM);
- boolean isOriginVerified = aSuiteInfo.isTrusted();
- String midletInfoUrl = aSuiteInfo.getAttributeValue("MIDlet-Info-URL");
- String midletDescription = aSuiteInfo.getAttributeValue("MIDlet-Description");
- String downloadUrl = aSuiteInfo.getAttributeValue("Nokia-MIDlet-Download-URL");
- ComponentId componentId = new ComponentId();
- int err = _registerComponent(
- iSessionHandle, uid,
- getScrString(suiteName), getScrString(vendor),
- getScrString(version), getScrString(name),
- getScrString(globalId), componentFiles,
- componentSize, isRemovable, isDrmProtected,
- isOriginVerified, aIsUpdate, aSuiteInfo.getMediaId(),
- getScrString(midletInfoUrl),
- getScrString(midletDescription),
- getScrString(downloadUrl),
- componentId);
- if (err < 0)
+ if (iSessionHandle == 0)
{
- InstallerException.internalError(
- "Registering component " + globalId +
- " failed with code " + err);
- }
- else
- {
- appInfo.setComponentId(componentId);
- Log.log("SifRegistrator registered component " + globalId +
- " with id " + componentId.getId());
- }
- }
-
- /**
- * Unregisters one Java application from being S60 USIF component.
- * Used with USIF Phase 1.
- *
- * @param aSuiteInfo Information needed to unregister the application,
- * @param aIndex index of the application in the suite
- * @throws InstallerException if unregistration cannot done or
- * startSession has not been called successfully
- * @see startSession
- * @see SuiteInfo
- */
- private void unregisterComponent(SuiteInfo aSuiteInfo, int aIndex)
- {
- String globalId = aSuiteInfo.getGlobalId(aIndex);
- if (globalId == null)
- {
- Log.logWarning("SifRegistrator: Application with index " + aIndex +
- " not found from " + aSuiteInfo.getGlobalId());
- return;
- }
- ComponentId componentId = getComponentId(globalId);
- if (componentId == null)
- {
- Log.logWarning(
- "SifRegistrator unregistration failed, application " +
- globalId + " does not exist");
- return;
- }
- // Save component id to ApplicationInfo.
- ApplicationInfo appInfo =
- (ApplicationInfo)aSuiteInfo.getApplications().elementAt(aIndex);
- appInfo.setComponentId(componentId);
- // Unregister application.
- int err = _unregisterComponent(iSessionHandle, componentId.getId());
- if (err < 0)
- {
- InstallerException.internalError(
- "Unregistering component " + globalId +
- " failed with code " + err);
- }
- else
- {
- Log.log("SifRegistrator unregistered component " + globalId +
- " with id " + componentId.getId());
+ InstallerException.internalError("No valid SIF session.");
}
}
/**
* Registers Java application suite to S60 USIF as a component.
- * Used with USIF Phase 2.
*
* @param aSuiteInfo Suite information
* @param aIsUpdate true in case of an update, false in case of a new
@@ -551,7 +381,6 @@
String suiteName = aSuiteInfo.getName();
String vendor = aSuiteInfo.getVendor();
String version = aSuiteInfo.getVersion().toString();
- String name = null; // Set name to null so that suite name will be used.
int uid = ((PlatformUid)aSuiteInfo.getUid()).getIntValue();
String[] componentFiles = getComponentFiles(aSuiteInfo);
long componentSize = aSuiteInfo.getInitialSize();
@@ -562,17 +391,20 @@
String midletInfoUrl = aSuiteInfo.getAttributeValue("MIDlet-Info-URL");
String midletDescription = aSuiteInfo.getAttributeValue("MIDlet-Description");
String downloadUrl = aSuiteInfo.getAttributeValue("Nokia-MIDlet-Download-URL");
+ String updateUrl = aSuiteInfo.getAttributeValue("Nokia-Update");
ComponentId componentId = new ComponentId();
int err = _registerComponent(
iSessionHandle, uid,
getScrString(suiteName), getScrString(vendor),
- getScrString(version), getScrString(name),
- getScrString(globalId), componentFiles,
- componentSize, isRemovable, isDrmProtected,
- isOriginVerified, aIsUpdate, aSuiteInfo.getMediaId(),
+ getScrString(version), getScrString(globalId),
+ componentFiles, componentSize,
+ isRemovable, isDrmProtected,
+ isOriginVerified, aIsUpdate,
+ aSuiteInfo.getMediaId(),
getScrString(midletInfoUrl),
getScrString(midletDescription),
getScrString(downloadUrl),
+ getScrString(updateUrl),
componentId);
if (err < 0)
{
@@ -590,7 +422,6 @@
/**
* Unregisters Java application suite from being S60 USIF component.
- * Used with USIF Phase 2.
*
* @param aSuiteInfo suite information
* @throws InstallerException if unregistration cannot done or
@@ -632,7 +463,6 @@
* from given SuiteInfo object. The SuiteInfo must already have
* been registered to USIF as a component with registerComponent()
* method before this method is called.
- * Used with USIF Phase 2.
*
* @param aSuiteInfo information needed to register the application
* @param aIndex index of the application in the suite
@@ -690,15 +520,20 @@
private static String[] getComponentFiles(SuiteInfo aSuite)
{
Vector componentFiles = new Vector();
- String path = aSuite.getJadPath();
- if (path != null)
+ if (!aSuite.isPreinstalled())
{
- componentFiles.addElement(getScrString(path));
- }
- path = aSuite.getJarPath();
- if (path != null)
- {
- componentFiles.addElement(getScrString(path));
+ // Add component jad and jar files only when the
+ // application is not preinstalled.
+ String path = aSuite.getJadPath();
+ if (path != null)
+ {
+ componentFiles.addElement(getScrString(path));
+ }
+ path = aSuite.getJarPath();
+ if (path != null)
+ {
+ componentFiles.addElement(getScrString(path));
+ }
}
boolean addRootPath = true;
int rootDrive = FileUtils.getDrive(aSuite.getRootDir());
@@ -716,10 +551,15 @@
}
if (addRootPath)
{
- componentFiles.addElement(getScrString(aSuite.getRootDir()));
+ componentFiles.addElement(
+ getScrString(aSuite.getRootDir() + "nofile.txt"));
}
String[] result = new String[componentFiles.size()];
componentFiles.copyInto(result);
+ for (int i = 0; i < result.length; i++)
+ {
+ Log.log("SifRegistrator componentFiles[" + i + "]: " + result[i]);
+ }
return result;
}
@@ -809,7 +649,7 @@
" failed with code " + err + " (" + nonlocalizedAttrValue + ")");
}
LocalizedName[] localizedAttrValues =
- getLocalizedNames(aSuite, attrName + "-");
+ getLocalizedNames(aSuite, "Nokia-" + attrName + "-");
for (int i = 0; i < localizedAttrValues.length; i++)
{
err = _setLocalizedComponentProperty(
@@ -826,21 +666,48 @@
}
// Register Domain-Category property.
- ApplicationInfoImpl appInfoImpl = (ApplicationInfoImpl)
- com.nokia.mj.impl.rt.support.ApplicationInfo.getInstance();
- String domainCategory = appInfoImpl.getProtectionDomain();
+ String protectionDomainProperty = "Domain-Category";
+ String protectionDomainName = aSuite.getProtectionDomainName();
err = _setLocalizedComponentProperty(
- iSessionHandle, cid, "Domain-Category",
- domainCategory, UNSPECIFIED_LOCALE);
+ iSessionHandle, cid, protectionDomainProperty,
+ getProtectionDomainPropertyValue(protectionDomainName),
+ UNSPECIFIED_LOCALE);
if (err < 0)
{
InstallerException.internalError(
- "Adding property Domain-Category value " + domainCategory +
- " for component " + cid + " failed with code " + err);
+ "Adding property " + protectionDomainProperty +
+ " value " + protectionDomainName + " for component " +
+ cid + " failed with code " + err);
}
}
/**
+ * Returns the "Domain-Category" property value which contains
+ * the text id and text file name for the localized domain category
+ * text. This method must never return null.
+ */
+ private String getProtectionDomainPropertyValue(String aProtectionDomain)
+ {
+ String textId = "txt_java_inst_setlabel_cert_domain_val_untrusted_third_party";
+ if (aProtectionDomain != null)
+ {
+ if (aProtectionDomain.equals("Manufacturer"))
+ {
+ textId = "txt_java_inst_setlabel_cert_domain_val_manufacturer";
+ }
+ else if (aProtectionDomain.equals("Operator"))
+ {
+ textId = "txt_java_inst_setlabel_cert_domain_val_operator";
+ }
+ else if (aProtectionDomain.equals("IdentifiedThirdParty"))
+ {
+ textId = "txt_java_inst_setlabel_cert_domain_val_trusted_third_party";
+ }
+ }
+ return textId + ",javaapplicationinstaller";
+ }
+
+ /**
* Returns array of localized names from the specified
* attributes of given suite. Assumes that aAttrPrefix
* is an attribute name prefix that is followed by locale.
@@ -869,6 +736,13 @@
"SifRegistrator ignored unknown locale: " +
name + ": " + localizedName);
}
+ else if (localizedName.getName() == null ||
+ localizedName.getName().length() == 0)
+ {
+ Log.logWarning(
+ "SifRegistrator ignored empty localized text: " +
+ name + ": " + localizedName);
+ }
else
{
Log.log("SifRegistrator found localized text " +
@@ -949,14 +823,6 @@
private static native int _launchAppView();
/**
- * Registers Java software type to software installation framework.
- *
- * @param aRegister true for registration, false for unregistration
- * @return 0 or Symbian error code (negative number)
- */
- private static native int _registerJavaSoftwareType(boolean aRegister);
-
- /**
* Starts native application registration session.
*
* @param aTransaction true if also transaction for this session should
@@ -998,7 +864,6 @@
* @param aSuiteName
* @param aVendor
* @param aVersion
- * @param aName
* @param aGlobalId
* @param aComponentFiles
* @param aComponentSize
@@ -1010,17 +875,19 @@
* @param aMidletInfoUrl
* @param aMidletDescription
* @param aDownloadUrl
+ * @param aUpdateUrl
* @param aComponentId upon successful execution contains the
* component id for the registered component
* @return 0 if registration succeeded or Symbian error code
*/
private static native int _registerComponent(
int aSessionHandle, int aUid, String aSuiteName, String aVendor,
- String aVersion, String aName, String aGlobalId,
+ String aVersion, String aGlobalId,
String[] aComponentFiles, long aComponentSize,
boolean aIsRemovable, boolean aIsDrmProtected,
boolean aIsOriginVerified, boolean aIsUpdate, int aMediaId,
- String aMidletInfoUrl, String aMidletDescription, String aDownloadUrl,
+ String aMidletInfoUrl, String aMidletDescription,
+ String aDownloadUrl, String aUpdateUrl,
ComponentId aComponentId);
/**
@@ -1128,4 +995,9 @@
* @return 1 if application data should be registered to USIF, 0 otherwise
*/
private static native int _getUsifMode();
+
+ /**
+ * Returns SIF specific error category from given error id.
+ */
+ private static native int _getErrorCategory(int aErrorId);
}
--- a/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/FileRoots.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/FileRoots.java Thu Aug 19 09:48:13 2010 +0300
@@ -62,7 +62,16 @@
*/
public static String getRegisteredIconDir(int aDrive)
{
- return FileUtils.getDriveName(aDrive) + ":\\data\\java\\";
+ String result = getAppsRoot();
+ result = FileUtils.setDrive(result, aDrive);
+ String replace = "\\private\\";
+ int i = result.indexOf(replace);
+ if (i == -1)
+ {
+ return FileUtils.getDriveName(aDrive) + ":\\data\\java\\";
+ }
+ return result.substring(0, i) + "\\public\\" +
+ result.substring(i + replace.length());
}
/**
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/PropertyProvider.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,179 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+package com.nokia.mj.impl.installer.utils;
+
+/**
+ * Provides notifications whenever the subscribed property value changes.
+ * <br>
+ * One PropertyProvider instance can be used to subscribe events
+ * for only one property. If events for more properties are needed
+ * use separate PropertyProvider instance for each property.
+ *
+ * @see PropertyListener
+ */
+public class PropertyProvider
+{
+ /** Property category. */
+ private int iCategory = 0;
+ /** Property key. */
+ private int iKey = 0;
+ /** Property listener. */
+ private PropertyListener iListener = null;
+ /** Handle to native object. */
+ private int iHandle = 0;
+
+ /**
+ * Constructor.
+ */
+ public PropertyProvider()
+ {
+ }
+
+ /**
+ * Subscribe to listen changes of specified property value.
+ * One PropertyListener can subscribe to only one property
+ * value at a time.
+ *
+ * @param aCategory property category
+ * @param aKey property key
+ * @param aListener listener to be notified.
+ */
+ public void subscribe(int aCategory, int aKey, PropertyListener aListener)
+ {
+ if (iHandle != 0)
+ {
+ InstallerException.internalError("PropertyProvider already in use.");
+ }
+ iCategory = aCategory;
+ iKey = aKey;
+ iListener = aListener;
+ // Start a new thread which blocks until unsubscribe is called.
+ final PropertyProvider provider = this;
+ new Thread(new Runnable()
+ {
+ public void run()
+ {
+ synchronized (provider)
+ {
+ iHandle = _subscribe(iCategory, iKey);
+ // Notify subscribe method after subscription
+ // result is available.
+ provider.notify();
+ }
+ if (iHandle > 0)
+ {
+ // Subscription succeeded, start to process events.
+ _processEvents(iHandle, provider);
+ }
+ }
+ }, "PropertyProviderThread").start();
+ synchronized (this)
+ {
+ try
+ {
+ if (iHandle == 0)
+ {
+ // Wait until subscription has been completed.
+ wait();
+ }
+ }
+ catch (InterruptedException ie)
+ {
+ }
+ }
+ // Check if subscription failed.
+ if (iHandle < 0)
+ {
+ Log.logError("PropertyProvider.subscribe failed with code " + iHandle);
+ iHandle = 0;
+ }
+ }
+
+ /**
+ * Unubscribe from listening changes.
+ */
+ public void unsubscribe()
+ {
+ final PropertyProvider provider = this;
+ new Thread(new Runnable()
+ {
+ public void run()
+ {
+ synchronized (provider)
+ {
+ if (iHandle <= 0)
+ {
+ Log.logWarning(
+ "PropertyProvider.unsubscribe: no subscription.");
+ return;
+ }
+ int err = _unsubscribe(iHandle);
+ if (err < 0)
+ {
+ Log.logError(
+ "PropertyProvider.unsubscribe failed with code " +
+ err);
+ }
+ else
+ {
+ iHandle = 0;
+ }
+ }
+ }
+ }, "PropertyProviderUnsubscribeThread").start();
+ }
+
+ /**
+ * Called from native when value for the subscribed property changes.
+ */
+ private void valueChanged(int aValue)
+ {
+ if (iListener != null)
+ {
+ iListener.valueChanged(iCategory, iKey, aValue);
+ }
+ }
+
+ /**
+ * Subscribe to listen changes of specified property value.
+ *
+ * @param aCategory property category
+ * @param aKey property key
+ * @return handle to native side object or Symbian error
+ * code (negative number)
+ */
+ private static native int _subscribe(int aCategory, int aKey);
+
+ /**
+ * Starts to process events. This call blocks until unsubscribe is called.
+ *
+ * @param aHandle handle to native side object
+ * @param aProvider PropertyProvider class instance to be notified
+ * @return 0 or Symbian error code (negative number)
+ */
+ private static native int _processEvents(int aHandle, PropertyProvider aProvider);
+
+ /**
+ * Unubscribe from listening changes.
+ *
+ * @param aHandle handle to native side object
+ * @return 0 or Symbian error code (negative number)
+ */
+ private static native int _unsubscribe(int aHandle);
+}
--- a/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/SysUtil.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc.s60/com/nokia/mj/impl/installer/utils/SysUtil.java Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -359,11 +359,12 @@
" drives failed with code " + ret);
}
// Save the drives so that next time they are not fetched again.
- iUserVisibleDrives = new Vector();
+ Vector drivesVector = new Vector();
for (int i = 0; i < aVisibleDrives.size(); i++)
{
- iUserVisibleDrives.addElement(aVisibleDrives.elementAt(i));
+ drivesVector.addElement(aVisibleDrives.elementAt(i));
}
+ iUserVisibleDrives = drivesVector;
}
/**
@@ -441,6 +442,44 @@
return ret;
}
+ /**
+ * Maps given ISO language/country code to Symbian TLanguage.
+ *
+ * @param aLocale ISO language/country code
+ * @return Symbian TLanguage value, or -1 if no matching language is found.
+ */
+ public static int isoToLang(String aLocale)
+ {
+ // Replace possible dash with underscore.
+ aLocale = aLocale.replace('-', '_');
+ // Get language and country parts.
+ String lang = aLocale.toLowerCase();
+ String country = null;
+ int sepIndex = aLocale.indexOf("_");
+ if (sepIndex >= 0)
+ {
+ lang = aLocale.substring(0, sepIndex).toLowerCase();
+ country = aLocale.substring(sepIndex + 1).toUpperCase();
+ }
+ // Map locale to Symbian TLanguage using native service.
+ int result = -1;
+ if (country == null)
+ {
+ result = _isoToLang(lang);
+ }
+ else
+ {
+ result = _isoToLang(lang + "_" + country);
+ if (result == -1)
+ {
+ // No result for language and country, try using language only.
+ result = _isoToLang(lang);
+ }
+ }
+ //Log.log("SysUtil.isoToLang: " + aLocale + " ==> " + result);
+ return result;
+ }
+
/*** ---------------------------- PROTECTED --------------------------- */
/*** ----------------------------- PACKAGE ---------------------------- */
/*** ----------------------------- PRIVATE ---------------------------- */
@@ -648,6 +687,14 @@
private static native int _getScreenHeight();
/**
+ * Maps given ISO language/country code to Symbian TLanguage.
+ *
+ * @param aLocale ISO language/country code
+ * @return Symbian TLanguage value, or -1 if no matching language is found.
+ */
+ private static native int _isoToLang(String aLocale);
+
+ /**
* Class for holding return value from native side.
*/
private static class IntValue
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/GetComponentInfo.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/GetComponentInfo.java Thu Aug 19 09:48:13 2010 +0300
@@ -480,6 +480,15 @@
suiteUid, null,
iSecurityAttributes.getAuthenticationAttributes());
+ if (authenticationCredentials != null)
+ {
+ for (int i = 0; i < authenticationCredentials.length; i++)
+ {
+ String domain = authenticationCredentials[i]
+ .getProtectionDomainCategory();
+ Log.log("Protection domain: " + domain);
+ }
+ }
if (iJarFilename != null)
{
// Authenticate jar.
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallationNotifier.java Thu Aug 19 09:48:13 2010 +0300
@@ -46,6 +46,8 @@
// Maximum number of progress updates to SysUtil.setProperty().
private static final int MAX_PROPERTY_PROGRESS_UPDATES = 5;
+ // Maximum number of progress updates to SIF.
+ private static final int MAX_SIF_PROGRESS_UPDATES = 5;
// Maximum number of progress updates to UI.
private static final int MAX_UI_PROGRESS_UPDATES = 20;
@@ -61,11 +63,16 @@
private int iMaxValue = 1;
// Tells how often property progress should be updated.
private int iPropertyProgressStep = 1;
+ // Tells how often SIF progress should be updated.
+ private int iSifProgressStep = 1;
// Tells how often UI progress should be updated.
private int iUiProgressStep = 1;
// Point between 0 and iMaxValue where the last property
// update has been made.
private int iLastPropertyUpdate = 0;
+ // Point between 0 and iMaxValue where the last SIF update
+ // has been made.
+ private int iLastSifUpdate = 0;
// Point between 0 and iMaxValue where the last UI update
// has been made.
private int iLastUiUpdate = 0;
@@ -203,6 +210,11 @@
{
iPropertyProgressStep = 1;
}
+ iSifProgressStep = iMaxValue / MAX_SIF_PROGRESS_UPDATES;
+ if (iSifProgressStep == 0)
+ {
+ iSifProgressStep = 1;
+ }
iUiProgressStep = iMaxValue / MAX_UI_PROGRESS_UPDATES;
if (iUiProgressStep == 0)
{
@@ -241,29 +253,44 @@
Log.log("InstallationNotifier.set: progress " + currentPercentage);
defineProperties();
- if (aCurrentValue == 0 ||
- aCurrentValue == iMaxValue ||
- aCurrentValue >= iLastPropertyUpdate + iPropertyProgressStep ||
- aCurrentValue <= iLastPropertyUpdate - iPropertyProgressStep)
+ if (isUpdateNeeded(aCurrentValue, iMaxValue,
+ iLastPropertyUpdate, iPropertyProgressStep))
{
iLastPropertyUpdate = aCurrentValue;
Log.log("InstallationNotifier.set: update property to " +
currentPercentage);
// Update property values: progress.
- SysUtil.setPropertyValue
- (SysUtil.PROP_CATEGORY_SYSTEM,
- SysUtil.PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS,
- currentPercentage);
+ SysUtil.setPropertyValue(
+ SysUtil.PROP_CATEGORY_SYSTEM,
+ SysUtil.PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS,
+ currentPercentage);
}
- if (aCurrentValue == 0 ||
- aCurrentValue == iMaxValue ||
- aCurrentValue >= iLastUiUpdate + iUiProgressStep ||
- aCurrentValue <= iLastUiUpdate - iUiProgressStep)
+ if (isUpdateNeeded(aCurrentValue, iMaxValue,
+ iLastSifUpdate, iSifProgressStep))
{
- iLastUiUpdate = aCurrentValue;
+ if (iSifNotifier != null)
+ {
+ iLastSifUpdate = aCurrentValue;
+ try
+ {
+ iSifNotifier.notifyProgress(
+ iSifNotifier.SUB_OP_NO, currentPercentage, 100);
+ }
+ catch (Throwable t)
+ {
+ Log.logError(
+ "InstallationNotifier: SifNotifier.notifyProgress threw exception", t);
+ }
+ }
+ }
+
+ if (isUpdateNeeded(aCurrentValue, iMaxValue,
+ iLastUiUpdate, iUiProgressStep))
+ {
if (iInstallerUi != null)
{
+ iLastUiUpdate = aCurrentValue;
Log.log("InstallationNotifier.set: update ui to " +
currentPercentage);
try
@@ -276,21 +303,6 @@
"InstallationNotifier: InstallerUi.updateProgress threw exception", t);
}
}
- if (iSifNotifier != null)
- {
- Log.log("InstallationNotifier.set: update SifNotifier to " +
- currentPercentage);
- try
- {
- iSifNotifier.notifyProgress(
- iSifNotifier.SUB_OP_NO, currentPercentage, 100);
- }
- catch (Throwable t)
- {
- Log.logError(
- "InstallationNotifier: SifNotifier.notifyProgress threw exception", t);
- }
- }
}
}
@@ -382,4 +394,24 @@
"InstallationNotifier: Deleting property failed", ex);
}
}
+
+ /**
+ * Returns true if progress update is needed, false otherwise.
+ *
+ * @param aCurrent current progress value
+ * @param aMax maximum progress value
+ * @param aPrevious previously updated progress value
+ * @param aStep step between progress updates
+ */
+ private static boolean isUpdateNeeded(
+ int aCurrent, int aMax, int aPrevious, int aStep)
+ {
+ if (aCurrent == 0 || aCurrent == aMax ||
+ aCurrent >= aPrevious + aStep ||
+ aCurrent <= aPrevious - aStep)
+ {
+ return true;
+ }
+ return false;
+ }
}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/Installer.java Thu Aug 19 09:48:13 2010 +0300
@@ -99,6 +99,11 @@
*/
static final int RET_NO_SYSTEM_EXIT = 100;
+ /** Id for installer cancel Comms message. */
+ private static final int INSTALLER_CANCEL_MESSAGE_ID = 603;
+ /** Id for installer cancel Comms response message. */
+ private static final int INSTALLER_CANCEL_RESPONSE_MESSAGE_ID = 604;
+
// ThreadDumper instance.
private static ThreadDumper iThreadDumper = null;
@@ -323,7 +328,7 @@
}
StartUpTrace.doTrace("Installer.mainWithResult " + aArgs[0] + " begins");
- StringBuffer buf = new StringBuffer("Java install process started with command: ");
+ StringBuffer buf = new StringBuffer("Java install process started with command:");
for (int i = 0; i < aArgs.length; i++)
{
buf.append(" ").append(aArgs[i]);
@@ -336,7 +341,7 @@
if (iThreadDumper != null)
{
- iThreadDumper.startTimer(10*60*1000); // 10 mins
+ iThreadDumper.startTimer(5*60*1000); // 5 mins
}
try
@@ -538,9 +543,9 @@
table.add(new com.nokia.mj.impl.installer.midp2.install.steps.
GetFromStorage());
table.add(new com.nokia.mj.impl.installer.midp2.install.steps.
- StartProgressNotifications());
+ SelectUids()); // Select suite uid and application uids.
table.add(new com.nokia.mj.impl.installer.midp2.install.steps.
- SelectUids()); // Select suite uid and application uids.
+ StartProgressNotifications());
table.add(new com.nokia.mj.impl.installer.midp2.install.steps.
AuthenticateJad()); // This must be the first security
// related step.
@@ -1235,6 +1240,8 @@
" -commsresult=endpoint In the end of operation, send\n"+
" InstallerResultMessage to specified comms\n"+
" endpoint.\n"+
+ " -base64=base64options Comma separated list of base64 encoded\n"+
+ " options.\n"+
"\n"+
"Either -jad or -jar must be specified, other options are optional.\n";
@@ -1264,10 +1271,13 @@
" -captainmsgs=yes|no If set to no, JavaInstaller will not send\n"+
" any messages to JavaCaptain during\n"+
" uninstallation. Default is yes.\n"+
+ " -resetpreinstall Reset preinstall state.\n"+
" -skipotastatus Skip OTA status handling.\n"+
" -commsresult=endpoint In the end of operation, send\n"+
" InstallerResultMessage to specified comms\n"+
" endpoint.\n"+
+ " -base64=base64options Comma separated list of base64 encoded\n"+
+ " options.\n"+
"\n"+
"The -uid option must be specified, other options are optional.\n";
@@ -1466,7 +1476,7 @@
if (aMessage.hasPermission(CommsPermission.INSTALL_APPLICATION))
{
int msgId = aMessage.getMessageId();
- if (msgId == 603)
+ if (msgId == INSTALLER_CANCEL_MESSAGE_ID)
{
Installer.cancel();
result = ERR_NONE;
@@ -1479,7 +1489,7 @@
}
CommsMessage response = new CommsMessage();
response.replyTo(aMessage);
- response.setMessageId(604);
+ response.setMessageId(INSTALLER_CANCEL_RESPONSE_MESSAGE_ID);
response.write(result);
iInstallerServer.send(response);
Log.log("InstallerListener sent " + response);
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallerResultMessage.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/InstallerResultMessage.java Thu Aug 19 09:48:13 2010 +0300
@@ -21,12 +21,14 @@
import com.nokia.mj.impl.comms.CommsEndpoint;
import com.nokia.mj.impl.comms.CommsMessage;
import com.nokia.mj.impl.installer.applicationregistrator.SifNotifier;
+import com.nokia.mj.impl.installer.applicationregistrator.SifRegistrator;
import com.nokia.mj.impl.installer.storagehandler.ApplicationInfo;
import com.nokia.mj.impl.installer.storagehandler.SuiteInfo;
import com.nokia.mj.impl.installer.utils.InstallerException;
import com.nokia.mj.impl.installer.utils.Log;
import com.nokia.mj.impl.installer.utils.PlatformUid;
import com.nokia.mj.impl.utils.exception.ExceptionBase;
+import com.nokia.mj.impl.utils.ErrorMessageBase;
import com.nokia.mj.impl.utils.InstallerErrorMessage;
import com.nokia.mj.impl.utils.Tokenizer;
import com.nokia.mj.impl.utils.Uid;
@@ -37,30 +39,77 @@
/**
* InstallerResultMessage contains information about install, uninstall
- * and componentinfo operations. It is sent to Comms endpoint specified
- * at JavaInstaller startup.
+ * and componentinfo operation results. JavaInstaller sends it at the end
+ * of operation to Comms endpoint specified at JavaInstaller startup with
+ * -commsresult option.
+ * <p>
+ * InstallerResultMessage contains name-value pairs: name is a string,
+ * value can be either a string or an int. Message syntax:
+ * <p>
+ * <pre>
+ * message := length named_int_value* length named_string_value*
+ * named_int_value := name int_value
+ * named_string_value := name string_value
+ * name := <string>
+ * int_value := <int>
+ * string_value := <string>
+ * length := <int telling the length of the table that follows>
+ * </pre>
+ * <p>
*/
public class InstallerResultMessage
{
+ /** Operation type. Value type: int.
+ Possible values: 0: install, 1: uninstall, 2: componentinfo. */
public static final String NAME_OPERATION = "operation";
+ /** Status code indicating operation result. Value type: int. */
public static final String NAME_RESULT = "result";
+ /** SIF error category. Value type: int. */
public static final String NAME_ERROR_CATEGORY = "error-category";
+ /** Java runtime specific error code. Value type: int. */
+ public static final String NAME_ERROR_CODE = "error-code";
+ /** Localized error message. Value type: string. */
public static final String NAME_ERROR_MSG = "error-message";
+ /** Localized message with more details of the error reason. Value type: string. */
public static final String NAME_ERROR_DETAILS = "error-details";
+ /** Suite UID. Value type: int. */
public static final String NAME_SUITE_UID = "suite-uid";
+ /** Midlet-n UID. Value type: int. */
public static final String NAME_MIDLET_UID = "midlet-uid-";
+ /** Suite component id. Value type: int. */
public static final String NAME_SUITE_CID = "suite-cid";
+ /** Midlet-n component id. Value type: int. */
public static final String NAME_MIDLET_CID = "midlet-cid-";
+ /** Suite global id. Value type: string. */
public static final String NAME_SUITE_GID = "suite-gid";
+ /** Midlet-n global id. Value type: string. */
public static final String NAME_MIDLET_GID = "midlet-gid-";
+ /** Suite name. Value type: string. */
public static final String NAME_SUITE_NAME = "suite-name";
+ /** Midlet-n name. Value type: string. */
public static final String NAME_MIDLET_NAME= "midlet-name-";
+ /** Suite vendor. Value type: string. */
public static final String NAME_VENDOR = "vendor";
+ /** Suite version. Value type: string. */
public static final String NAME_VERSION = "version";
+ /** Component installation status. Value type: int. Possible values:
+ 0: new component,
+ 1: upgrade,
+ 2: already installed,
+ 3: newer version already installed,
+ 4: invalid package, cannot be installed. */
public static final String NAME_INSTALL_STATUS = "install-status";
+ /** Component authenticity. Value type: int. Possible values:
+ 0: component is not authenticated, 1: component is authenticated. */
public static final String NAME_AUTHENTICITY = "authenticity";
+ /** Size of the files owned by the component at the time of the
+ installation. Calculated from MIDlet-Data-Size and
+ MIDlet-Jar-Size attributes. Value type: int. */
public static final String NAME_COMPONENT_SIZE = "component-size";
+ /** Id for installer result Comms message. */
+ private static final int INSTALLER_RESULT_MESSAGE_ID = 601;
+
private Hashtable iNamedIntValues = null;
private Hashtable iNamedStringValues = null;
@@ -165,7 +214,7 @@
{
addValue(NAME_ERROR_DETAILS, msg);
}
- addErrorCategory(eb);
+ addErrorCodes(eb);
}
if (aException instanceof InstallerException)
{
@@ -193,25 +242,24 @@
}
/**
- * Get a string value from this message.
- * @throws IllegalArgumentException if value with given name is not found
+ * Returns a string value from this message, or null
+ * if string value is not present.
*/
- public String getStringValue(String aName)
+ String getStringValue(String aName)
{
Object value = iNamedStringValues.get(aName);
if (value instanceof String)
{
return (String)value;
}
- throw new IllegalArgumentException(
- "InstallerResultMessage: string value " + aName + " not found");
+ return null;
}
/**
* Get an int value from this message.
* @throws IllegalArgumentException if value with given name is not found
*/
- public int getIntValue(String aName)
+ int getIntValue(String aName)
{
Object value = iNamedIntValues.get(aName);
if (value instanceof Integer)
@@ -225,7 +273,7 @@
/**
* Removes a value from this message.
*/
- public void removeValue(String aName)
+ void removeValue(String aName)
{
iNamedStringValues.remove(aName);
iNamedIntValues.remove(aName);
@@ -255,19 +303,20 @@
}
if (iSifNotifier != null)
{
- int errCategory = 0;
- int errCode = 0;
- String errMsg = null;
- String errDetails = null;
- if (getIntValue(NAME_RESULT) != Installer.ERR_NONE)
- {
- errCategory = getIntValue(NAME_ERROR_CATEGORY);
- errCode = Installer.ERR_GENERAL;
- errMsg = getStringValue(NAME_ERROR_MSG);
- errDetails = getStringValue(NAME_ERROR_DETAILS);
- }
try
{
+ int result = getIntValue(NAME_RESULT);
+ int errCategory = 0;
+ int errCode = 0;
+ String errMsg = null;
+ String errDetails = null;
+ if (result != Installer.ERR_NONE)
+ {
+ errCategory = getIntValue(NAME_ERROR_CATEGORY);
+ errCode = getIntValue(NAME_ERROR_CODE);
+ errMsg = getStringValue(NAME_ERROR_MSG);
+ errDetails = getStringValue(NAME_ERROR_DETAILS);
+ }
iSifNotifier.notifyEnd(errCategory, errCode, errMsg, errDetails);
}
catch (Throwable t)
@@ -298,7 +347,7 @@
{
comms.connect(aEndpoint);
CommsMessage msg = new CommsMessage();
- msg.setMessageId(601);
+ msg.setMessageId(INSTALLER_RESULT_MESSAGE_ID);
// Initialise the message data.
msg.write(iNamedIntValues.size());
Enumeration e = iNamedIntValues.keys();
@@ -318,7 +367,7 @@
}
// Send the message.
Log.log("Sending InstallerResultMessage to " + aEndpoint);
- CommsMessage installerResultResponse = comms.sendReceive(msg, 5);
+ comms.sendReceive(msg, 5);
comms.disconnect();
Log.log("Received InstallerResultResponse from " + aEndpoint);
}
@@ -385,48 +434,34 @@
}
/**
- * Adds error category to the result message.
+ * Adds error codes to the result message.
*/
- private void addErrorCategory(ExceptionBase aEb)
+ private void addErrorCodes(ExceptionBase aEb)
{
- switch (aEb.getShortMessageId())
+ if (aEb.getShortMessageId() >= ErrorMessageBase.INSTALLER_RANGE_START &&
+ aEb.getShortMessageId() <= ErrorMessageBase.INSTALLER_RANGE_END)
{
- case InstallerErrorMessage.INST_NO_MEM:
- addValue(NAME_ERROR_CATEGORY, 2); // ELowDiskSpace
- break;
- case InstallerErrorMessage.INST_NO_NET:
- addValue(NAME_ERROR_CATEGORY, 3); // ENetworkUnavailable
- break;
- case InstallerErrorMessage.INST_CORRUPT_PKG:
- addValue(NAME_ERROR_CATEGORY, 5); // ECorruptedPackage
- break;
- case InstallerErrorMessage.INST_COMPAT_ERR:
- addValue(NAME_ERROR_CATEGORY, 6); // EApplicationNotCompatible
- break;
- case InstallerErrorMessage.INST_AUTHORIZATION_ERR:
- // fall through
- case InstallerErrorMessage.INST_AUTHENTICATION_ERR:
- addValue(NAME_ERROR_CATEGORY, 7); // ESecurityError
- break;
- case InstallerErrorMessage.INST_PUSH_REG_ERR:
- // fall through
- case InstallerErrorMessage.INST_UNEXPECTED_ERR:
- // fall through
- case InstallerErrorMessage.UNINST_UNEXPECTED_ERR:
- // fall through
- case InstallerErrorMessage.OTHER_UNEXPECTED_ERR:
- addValue(NAME_ERROR_CATEGORY, 8); // EUnexpectedError
- break;
- case InstallerErrorMessage.INST_CANCEL:
- // fall through
- case InstallerErrorMessage.UNINST_CANCEL:
- addValue(NAME_ERROR_CATEGORY, 9); // EUserCancelled
- break;
- case InstallerErrorMessage.UNINST_NOT_ALLOWED:
- addValue(NAME_ERROR_CATEGORY, 10); // EUninstallationBlocked
- break;
- default:
- addValue(NAME_ERROR_CATEGORY, 8); // EUnexpectedError
+ addValue(NAME_ERROR_CATEGORY,
+ SifRegistrator.getErrorCategory(aEb.getShortMessageId()));
+ addValue(NAME_ERROR_CODE,
+ aEb.getShortMessageId()*1000 + aEb.getDetailedMessageId());
+ }
+ else if (aEb.getShortMessageId() >= ErrorMessageBase.SECURITY_RANGE_START &&
+ aEb.getShortMessageId() <= ErrorMessageBase.SECURITY_RANGE_END)
+ {
+ addValue(NAME_ERROR_CATEGORY,
+ SifRegistrator.getErrorCategory(
+ InstallerErrorMessage.INST_AUTHORIZATION_ERR));
+ addValue(NAME_ERROR_CODE,
+ aEb.getShortMessageId()*1000 + aEb.getDetailedMessageId());
+ }
+ else
+ {
+ addValue(NAME_ERROR_CATEGORY,
+ SifRegistrator.getErrorCategory(
+ InstallerErrorMessage.INST_UNEXPECTED_ERR));
+ addValue(NAME_ERROR_CODE,
+ aEb.getShortMessageId()*1000 + aEb.getDetailedMessageId());
}
}
}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckJarPackages.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/CheckJarPackages.java Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -73,7 +73,8 @@
// Application touch support detection is not needed
// if Nokia-MIDlet-On-Screen-Keypad has been defined.
boolean touchDetection = true;
- if (ball.getAttributeValue("Nokia-MIDlet-On-Screen-Keypad") != null)
+ if (ball.getAttributeValue("Nokia-MIDlet-On-Screen-Keypad") != null &&
+ ball.iSuite.getOnScreenKeypad() != SuiteInfo.OSK_UNDEFINED)
{
touchDetection = false;
}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConvertIcons.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConvertIcons.java Thu Aug 19 09:48:13 2010 +0300
@@ -258,10 +258,11 @@
// the attribute MIDlet-<N>
iconName = newApp.getIconPath();
}
- if (iconName.length() == 0)
+ if (iconName.length() == 0 || iconName.equals(suiteIconName))
{
- // No MIDlet icon defined, use already converted suite
- // icon if it exists
+ // No MIDlet icon defined or MIDlet icon defined to be
+ // the same as suite icon, use already converted suite
+ // icon if it exists.
if (suiteIconFile.length() > 0)
{
// Must make separate copy of the suite icon for each
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/DlListener.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/DlListener.java Thu Aug 19 09:48:13 2010 +0300
@@ -81,8 +81,6 @@
}
if (iBall.iSifNotifier != null)
{
- Log.log("DlListener.set: update SifNotifier to " +
- aDlInfo.getCurrentSize() + " / " + aDlInfo.getTotalSize());
try
{
iBall.iSifNotifier.notifyProgress(
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/FinalizeInstallation.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/FinalizeInstallation.java Thu Aug 19 09:48:13 2010 +0300
@@ -150,6 +150,9 @@
Log.log("JavaCaptain notified");
}
+ // Add an entry to platform installation log.
+ ball.iApplicationRegistrator.addInstallLogEntry(ball.iSuite, 0);
+
String midletName = ball.getAttributeValue("MIDlet-Name");
ball.log("Application " + midletName + " successfully installed.");
ball.log(ball.iSuite.toShortString());
@@ -302,11 +305,18 @@
}
}
- //if (ball.iSifRegistrator.getSifMode() > 0 && launchApp)
- //{
- // ball.iSifRegistrator.launchAppView();
- //}
- //else
+ if (ball.iSifRegistrator.getSifMode() > 0 && launchApp)
+ {
+ ball.getInstallerUi().syncExec(new Runnable()
+ {
+ // launchAppView() must be called in the UI thread.
+ public void run()
+ {
+ ball.iSifRegistrator.launchAppView();
+ }
+ });
+ }
+ else
if (ball.iCaptainMsgs && launchApp &&
launchAppInfo.getApplications() != null &&
launchAppInfo.getApplications().length > 0)
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/HandleCustomAttributes.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/HandleCustomAttributes.java Thu Aug 19 09:48:13 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"
@@ -23,10 +23,13 @@
import com.nokia.mj.impl.installer.storagehandler.ApplicationInfo;
import com.nokia.mj.impl.installer.storagehandler.SuiteInfo;
import com.nokia.mj.impl.installer.utils.Log;
+import com.nokia.mj.impl.installer.utils.AutoStartPermission;
import com.nokia.mj.impl.utils.InstallerDetailedErrorMessage;
import com.nokia.mj.impl.utils.InstallerErrorMessage;
import com.nokia.mj.impl.utils.OtaStatusCode;
import com.nokia.mj.impl.utils.exception.InvalidAttributeException;
+import com.nokia.mj.impl.security.midp.authorization.AccessControllerFactoryImpl;
+import com.nokia.mj.impl.security.midp.authorization.AccessControllerImpl;
import java.util.Vector;
@@ -53,7 +56,7 @@
{
if (aBall.iApplicationRegistrator.isOnDeviceKeypadNeeded())
{
- // default value when on-screen-keypad is needed
+ // Default value when on-screen-keypad is needed.
aBall.iSuite.setOnScreenKeypad(SuiteInfo.OSK_GAMEACTIONS);
String attrName = "Nokia-MIDlet-On-Screen-Keypad";
@@ -74,13 +77,16 @@
}
else
{
- Log.logWarning("Invalid " + attrName + " value " + attrValue);
+ // Ignore on-screen-keypad attribute with invalid value.
+ aBall.iSuite.setOnScreenKeypad(SuiteInfo.OSK_UNDEFINED);
+ Log.logWarning("Ignoring invalid " + attrName +
+ " value " + attrValue);
}
}
}
else
{
- // If the device does not need on-screen-keypad, the value is not set at all
+ // If the device does not need on-screen-keypad, the value is not set at all.
aBall.iSuite.setOnScreenKeypad(SuiteInfo.OSK_UNDEFINED);
}
@@ -98,18 +104,52 @@
{
String attrName = "Nokia-MIDlet-Auto-Start-" + i;
String attrValue = aBall.getAttributeValue(attrName);
+
+ if (attrValue == null)
+ {
+ // Allow also this form of the name to be compatible with
+ // an existing implementation
+ attrName = "Nokia-MIDlet-auto-start-" + i;
+ attrValue = aBall.getAttributeValue(attrName);
+
+ if ((attrValue == null) && (i == 1))
+ {
+ // Allow even this S40 format
+ attrName = "Nokia-MIDlet-auto-start";
+ attrValue = aBall.getAttributeValue(attrName);
+ }
+ }
+
if (attrValue != null)
{
if (apps.size() < i)
{
break;
}
- if (attrValue.equalsIgnoreCase("false"))
+
+ // Check if MIDlet has permission for Auto-start
+ AccessControllerImpl accessControllerImpl =
+ AccessControllerFactoryImpl.
+ getAccessController(aBall.iStorageHandler.getSession(),
+ aBall.iSuite.getUid(),
+ aBall.iSuite.getName());
+ AutoStartPermission autoStartPermission = new AutoStartPermission();
+ if (!accessControllerImpl.isPermissionAllowed(
+ autoStartPermission.toString()))
+ {
+ Log.logWarning("Attribute " + attrName +
+ " ignored due to insufficient permissions");
+ break;
+ }
+
+ if (attrValue.equalsIgnoreCase("false") ||
+ attrValue.equalsIgnoreCase("no"))
{
((ApplicationInfo)apps.elementAt(i-1)).
setAutoStart(ApplicationInfo.AUTOSTART_FALSE);
}
- else if (attrValue.equalsIgnoreCase("true"))
+ else if (attrValue.equalsIgnoreCase("true") ||
+ attrValue.equalsIgnoreCase("yes"))
{
((ApplicationInfo)apps.elementAt(i-1)).
setAutoStart(ApplicationInfo.AUTOSTART_TRUE);
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/InstallBall.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/InstallBall.java Thu Aug 19 09:48:13 2010 +0300
@@ -20,6 +20,7 @@
import java.util.Hashtable;
+import com.nokia.mj.impl.installer.Installer;
import com.nokia.mj.impl.installer.InstallationNotifier;
import com.nokia.mj.impl.installer.applicationregistrator.ApplicationRegistrator;
import com.nokia.mj.impl.installer.applicationregistrator.SifNotifier;
@@ -303,10 +304,11 @@
Log.logWarning("checkForCancel: Stopping downloader failed", t);
}
}
- throw new InstallerException
- (InstallerErrorMessage.INST_CANCEL, null,
- InstallerDetailedErrorMessage.NO_MSG, null,
- OtaStatusCode.USER_CANCELLED);
+ throw new InstallerException(
+ Installer.ERR_CANCEL,
+ InstallerErrorMessage.INST_CANCEL, null,
+ InstallerDetailedErrorMessage.INST_CANCEL, null,
+ OtaStatusCode.USER_CANCELLED);
}
}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/OcspListener.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/OcspListener.java Thu Aug 19 09:48:13 2010 +0300
@@ -78,7 +78,6 @@
}
if (iBall.iSifNotifier != null)
{
- Log.log("OcspListener.ocspEvent: update SifNotifier to 0 / 0");
try
{
iBall.iSifNotifier.notifyProgress(
@@ -109,7 +108,6 @@
}
if (iBall.iSifNotifier != null)
{
- Log.log("OcspListener.ocspEvent: update SifNotifier to 100 / 100");
try
{
iBall.iSifNotifier.notifyProgress(
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareInstallation.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareInstallation.java Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -29,6 +29,7 @@
import com.nokia.mj.impl.installer.jsrpluginnotifier.JsrPluginNotifier;
import com.nokia.mj.impl.installer.storagehandler.StorageHandler;
import com.nokia.mj.impl.installer.utils.Args;
+import com.nokia.mj.impl.installer.utils.DriveInfo;
import com.nokia.mj.impl.installer.utils.FileRoots;
import com.nokia.mj.impl.installer.utils.FileUtils;
import com.nokia.mj.impl.installer.utils.InstallerException;
@@ -37,8 +38,11 @@
import com.nokia.mj.impl.installer.utils.SysUtil;
import com.nokia.mj.impl.security.midp.authentication.AuthenticationModule;
import com.nokia.mj.impl.security.midp.authentication.OcspSettings;
+import com.nokia.mj.impl.fileutils.FileURL;
import com.nokia.mj.impl.utils.Uid;
+import java.util.Vector;
+
public class PrepareInstallation extends ExeStep
{
@@ -170,6 +174,11 @@
{
aBall.iJarUrl = jarArg;
}
+ else if (isFileUrl(jarArg))
+ {
+ aBall.iJarFilename = getFileFromUrl(jarArg);
+ Log.log("Jar " + aBall.iJarFilename + " from URL " + jarArg);
+ }
else
{
aBall.iJarFilename = jarArg;
@@ -181,6 +190,11 @@
{
aBall.iJadUrl = jadArg;
}
+ else if (isFileUrl(jadArg))
+ {
+ aBall.iJadFilename = getFileFromUrl(jadArg);
+ Log.log("Jad " + aBall.iJadFilename + " from URL " + jadArg);
+ }
else
{
aBall.iJadFilename = jadArg;
@@ -266,6 +280,7 @@
if (arg != null)
{
aBall.iInstallationDrive = args.parseDrive(arg);
+ checkInstallationDrive(aBall.iInstallationDrive);
}
}
@@ -346,4 +361,60 @@
Log.log("ocspSettings: " + ocspSettings);
return ocspSettings;
}
+
+ /**
+ * Returns true if given URL is a file URL, false otherwise.
+ */
+ private static boolean isFileUrl(String aUrl)
+ {
+ if (aUrl == null || aUrl.length() == 0)
+ {
+ return false;
+ }
+ return aUrl.toLowerCase().startsWith("file://");
+ }
+
+ /**
+ * Returns a file path from file URL.
+ *
+ * @throws InstallerException if URL is invalid.
+ */
+ private static String getFileFromUrl(String aUrl)
+ {
+ String filePath = null;
+ try
+ {
+ FileURL fileUrl = new FileURL(aUrl);
+ filePath = fileUrl.getFullPath();
+ }
+ catch (Throwable t)
+ {
+ InstallerException.internalError("Invalid file URL: " + aUrl, t);
+ }
+ return filePath;
+ }
+
+ /**
+ * Checks that given installation drive is a valid one.
+ *
+ * @param aDrive installation drive
+ * @throws InstallerException if installation drive is not valid
+ */
+ private static void checkInstallationDrive(int aDrive)
+ {
+ Vector drives = new Vector();
+ SysUtil.getUserVisibleDrives(drives);
+ for (int i = 0; i < drives.size(); i++)
+ {
+ DriveInfo driveInfo = (DriveInfo)drives.elementAt(i);
+ if (driveInfo.getNumber() == aDrive)
+ {
+ // Installation drive found from user visible drives.
+ return;
+ }
+ }
+ InstallerException.internalError(
+ "Invalid installation drive: " + aDrive +
+ " (" + (char)('A' + aDrive) + ")");
+ }
}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareSplashScreen.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/PrepareSplashScreen.java Thu Aug 19 09:48:13 2010 +0300
@@ -35,10 +35,11 @@
import org.eclipse.swt.graphics.ImageData;
import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.extension.ImageUtil;
/**
* Installation step PrepareSplashScreen prepares splash
- * screen images from MIDlet-Splash-Screen-Image attribute.
+ * screen images from Nokia-MIDlet-Splash-Screen-Image attribute.
*/
public class PrepareSplashScreen extends ExeStep
{
@@ -70,7 +71,7 @@
return;
}
- String attrName = "MIDlet-Splash-Screen-Image";
+ String attrName = "Nokia-MIDlet-Splash-Screen-Image";
String attrValue = ball.getAttributeValue(attrName);
if (attrValue != null && attrValue.length() > 0)
{
@@ -106,15 +107,21 @@
for (int i = 0; i < tokens.length; i++)
{
tokens[i] = tokens[i].trim();
- currentImage = loadImage(tokens[i], ball.iJarFilename);
- if (currentImage == null)
+ imageSizes[i] = getImageSize(tokens[i], ball.iJarFilename);
+ if (imageSizes[i] == null)
{
- // Image loading failed, proceed to the next image.
- imageSizes[i] = new Point(0, 0);
- continue;
+ // Couldn't get image size, try to get it by loading
+ // the image.
+ currentImage = loadImage(tokens[i], ball.iJarFilename);
+ if (currentImage == null)
+ {
+ // Image loading failed, proceed to the next image.
+ imageSizes[i] = new Point(0, 0);
+ continue;
+ }
+ imageSizes[i] = new Point(
+ currentImage[0].width, currentImage[0].height);
}
- imageSizes[i] = new Point(
- currentImage[0].width, currentImage[0].height);
}
// Choose the images which best fill the portrait and
// landscape screens.
@@ -237,6 +244,74 @@
}
/**
+ * Gets image size for specified image from given jar file.
+ *
+ * @param aResource image file name
+ * @param aJar jar file name
+ * @return image size, or null if getting image size fails
+ */
+ private static Point getImageSize(String aResource, String aJar)
+ {
+ Point result = null;
+ JarFile jarFile = null;
+ InputStream is = null;
+ try
+ {
+ // Open jar file and input stream.
+ jarFile = new JarFile(aJar);
+ is = jarFile.getInputStream(
+ new JarEntry(FileUtils.trimJarEntry(aResource)));
+ if (is != null)
+ {
+ result = ImageUtil.getImageSize(is);
+ if (result != null)
+ {
+ Log.log("Image size for " + aResource + " from " +
+ aJar + ": " + result);
+ }
+ }
+ else
+ {
+ Log.logWarning("Image " + aResource + " not found from " + aJar);
+ }
+ }
+ catch (Throwable t)
+ {
+ Log.logWarning("Loading image " + aResource + " from " +
+ aJar + " failed", t);
+ }
+ finally
+ {
+ // Close streams and jar file.
+ if (is != null)
+ {
+ try
+ {
+ is.close();
+ is = null;
+ }
+ catch (IOException ioe)
+ {
+ Log.logWarning("Closing InputStream failed", ioe);
+ }
+ }
+ if (jarFile != null)
+ {
+ try
+ {
+ jarFile.close();
+ jarFile = null;
+ }
+ catch (IOException ioe)
+ {
+ Log.logWarning("Closing " + aJar + " failed", ioe);
+ }
+ }
+ }
+ return result;
+ }
+
+ /**
* Loads image from specified resource from given jar file.
*
* @param aResource resource file name
@@ -252,8 +327,8 @@
{
// Open jar file and input stream.
jarFile = new JarFile(aJar);
- is = jarFile.getInputStream
- (new JarEntry(FileUtils.trimJarEntry(aResource)));
+ is = jarFile.getInputStream(
+ new JarEntry(FileUtils.trimJarEntry(aResource)));
if (is != null)
{
result = (new ImageLoader()).load(is);
@@ -319,8 +394,8 @@
{
// Open jar file and input and output streams.
jarFile = new JarFile(aJar);
- is = jarFile.getInputStream
- (new JarEntry(FileUtils.trimJarEntry(aResource)));
+ is = jarFile.getInputStream(
+ new JarEntry(FileUtils.trimJarEntry(aResource)));
os = FileUtils.getOutputStream(imageFilename);
// Copy the image data from InputStream to OutputStream.
byte[] buf = new byte[16384];
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/RegisterApplicationToSif.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/RegisterApplicationToSif.java Thu Aug 19 09:48:13 2010 +0300
@@ -40,11 +40,11 @@
Log.log("Old suite unregistered from SIF");
}
- if (ball.iSourceUrl != null)
+ if (ball.iAuthenticationCredentials != null)
{
- // Save source URL to suite as jad URL which is
- // registered to SIF as download URL.
- ball.iSuite.setJadUrl(ball.iSourceUrl);
+ // Set protection domain name.
+ ball.iSuite.setProtectionDomainName(
+ ball.iAuthenticationCredentials[0].getProtectionDomainName());
}
// Initialize application installation group to SuiteInfo.
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/StartProgressNotifications.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/StartProgressNotifications.java Thu Aug 19 09:48:13 2010 +0300
@@ -36,6 +36,12 @@
InstallBall ball = (InstallBall)aBall;
Log.log("Starting progress notifications...");
+ if (ball.iPreinstallation)
+ {
+ Log.log("SifNotifier disabled during preinstallation.");
+ return;
+ }
+
if (!SifNotifier.enabled())
{
Log.log("SifNotifier disabled.");
@@ -99,9 +105,17 @@
}
catch (Throwable t)
{
- Log.logError("StartProgressNotifications: SifNotifier.notifyStart failed", t);
+ Log.log("StartProgressNotifications: SifNotifier.notifyStart failed", t);
+ try
+ {
+ ball.iSifNotifier.destroy();
+ }
+ catch (Throwable t2)
+ {
+ Log.logError("StartProgressNotifications: SifNotifier.destroy failed", t2);
+ }
+ ball.iSifNotifier = null;
}
-
// Set SifNotifier for the listeners that should use it.
ball.iInstallationNotifier.setSifNotifier(ball.iSifNotifier);
}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/ConfirmUninstallation.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/ConfirmUninstallation.java Thu Aug 19 09:48:13 2010 +0300
@@ -76,8 +76,9 @@
int idxMinus = -1;
do
{
- attrValue = ball.iSuite.getAttributeValue(attrName + "-" + locale);
- Log.log(attrName + "-" + locale + ": " + attrValue);
+ String localizedAttrName = "Nokia-" + attrName + "-" + locale;
+ attrValue = ball.iSuite.getAttributeValue(localizedAttrName);
+ Log.log(localizedAttrName + ": " + attrValue);
idxMinus = locale.lastIndexOf('-');
// If attribute is not found using full locale, e.g. 'en-GB',
// strip the most specific part of the locale out
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/FinalizeUninstallation.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/FinalizeUninstallation.java Thu Aug 19 09:48:13 2010 +0300
@@ -102,6 +102,10 @@
ball.log("Application with uid " + appUids[i] + " uninstalled");
}
}
+
+ // Add an entry to platform installation log.
+ ball.iApplicationRegistrator.addInstallLogEntry(ball.iSuite, 1);
+
ball.log("Application suite with uid " + ball.iSuite.getUid() +
" successfully uninstalled.");
}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/GetFromStorage.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/GetFromStorage.java Thu Aug 19 09:48:13 2010 +0300
@@ -54,6 +54,15 @@
// Check if debug attribute has been defined for this suite.
ball.setDebug(ball.iSuite.getAttributeValue("Nokia-MIDlet-Install-Debug"));
+ // Check from arguments if preinstall state should be reset.
+ String arg = ball.iArgs.get("resetpreinstall");
+ if (arg != null)
+ {
+ ball.iSuite.setResetPreinstall(true);
+ ball.log("ResetPreinstall set");
+ }
+
+
// Log all suite info.
//ball.log(ball.iSuite.toString());
}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/StartProgressNotifications.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/StartProgressNotifications.java Thu Aug 19 09:48:13 2010 +0300
@@ -91,8 +91,16 @@
catch (Throwable t)
{
Log.logError("StartProgressNotifications: SifNotifier.notifyStart failed", t);
+ try
+ {
+ ball.iSifNotifier.destroy();
+ }
+ catch (Throwable t2)
+ {
+ Log.logError("StartProgressNotifications: SifNotifier.destroy failed", t2);
+ }
+ ball.iSifNotifier = null;
}
-
// Set SifNotifier for the listeners that should use it.
ball.iInstallationNotifier.setSifNotifier(ball.iSifNotifier);
}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/UninstallBall.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/uninstall/steps/UninstallBall.java Thu Aug 19 09:48:13 2010 +0300
@@ -21,6 +21,7 @@
import java.util.Hashtable;
import java.util.Vector;
+import com.nokia.mj.impl.installer.Installer;
import com.nokia.mj.impl.installer.InstallationNotifier;
import com.nokia.mj.impl.installer.applicationregistrator.ApplicationRegistrator;
import com.nokia.mj.impl.installer.applicationregistrator.SifNotifier;
@@ -124,10 +125,11 @@
super.checkForCancel();
if (isCancelled())
{
- throw new InstallerException
- (InstallerErrorMessage.UNINST_CANCEL, null,
- InstallerDetailedErrorMessage.NO_MSG, null,
- OtaStatusCode.USER_CANCELLED);
+ throw new InstallerException(
+ Installer.ERR_CANCEL,
+ InstallerErrorMessage.UNINST_CANCEL, null,
+ InstallerDetailedErrorMessage.UNINST_CANCEL, null,
+ OtaStatusCode.USER_CANCELLED);
}
}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandler.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/StorageHandler.java Thu Aug 19 09:48:13 2010 +0300
@@ -925,13 +925,23 @@
}
else
{
- // Not an update ==> user is making uninstallation.
+ // Not an update ==> suite is being uninstalled.
int oldPreinstallState = readPreinstallState(aSuiteInfo);
if (oldPreinstallState == aSuiteInfo.STATE_PREINSTALLED)
{
- // User is uninstalling a preinstalled application,
- // set preinstall state to STATE_NO_PREINSTALL.
- setNoPreinstallState(aSuiteInfo);
+ if (aSuiteInfo.getResetPreinstall())
+ {
+ // Preinstallation state should be reset,
+ // remove existing data from
+ // StorageNames.PREINSTALL_TABLE table.
+ removePreinstallState(aSuiteInfo);
+ }
+ else
+ {
+ // User is uninstalling a preinstalled application,
+ // set preinstall state to STATE_NO_PREINSTALL.
+ setNoPreinstallState(aSuiteInfo);
+ }
}
else if (oldPreinstallState == aSuiteInfo.STATE_INSTALLED)
{
@@ -1081,13 +1091,11 @@
/**
* Removes preinstall state for given suite from
- * preinstall table but only if preinstall state
- * in given SuiteInfo is SuiteInfo.STATE_INSTALLED.
+ * preinstall table
*/
private void removePreinstallState(SuiteInfo aSuiteInfo)
{
- if (aSuiteInfo == null ||
- aSuiteInfo.iPreinstallState != aSuiteInfo.STATE_INSTALLED)
+ if (aSuiteInfo == null)
{
return;
}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/SuiteInfo.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/storagehandler/SuiteInfo.java Thu Aug 19 09:48:13 2010 +0300
@@ -73,6 +73,9 @@
private String iAccessPoint = null;
// Flag telling if application suite is trusted
private boolean iTrusted = false;
+ // Flag telling if preinstallation state should be
+ // reseted in uninstallation.
+ private boolean iResetPreinstall = false;
/** Flag telling if default icon should be used. */
private boolean iUseDefaultIcon = false;
@@ -80,6 +83,8 @@
private String iConvertedIconPath = null;
/** Application installation group. This member is not saved into storage. */
private String iInstallationGroup = null;
+ /** Protection domain name. This member is not saved into storage. */
+ private String iProtectionDomainName = null;
/**
* Combined Jad and Manifest attributes. Key is attribute name,
@@ -521,6 +526,22 @@
}
/**
+ * Get protection domain name.
+ */
+ public String getProtectionDomainName()
+ {
+ return iProtectionDomainName;
+ }
+
+ /**
+ * Set protection domain name.
+ */
+ public void setProtectionDomainName(String aProtectionDomainName)
+ {
+ iProtectionDomainName = aProtectionDomainName;
+ }
+
+ /**
* Set suite uid.
*
* @param aUid suite uid
@@ -740,6 +761,14 @@
}
/**
+ * Returns true if this application suite is preinstalled, false otherwise.
+ */
+ public boolean isPreinstalled()
+ {
+ return (iPreinstallState == STATE_PREINSTALLED);
+ }
+
+ /**
* Set flag telling if application suite is preinstalled.
*
* @param aTrusted true if suite is preinstalled, false otherwise
@@ -757,6 +786,24 @@
}
/**
+ * Get the flag telling if preinstallation state should be reset.
+ * Used only in uninstallation.
+ */
+ public boolean getResetPreinstall()
+ {
+ return iResetPreinstall;
+ }
+
+ /**
+ * Set the flag telling if preinstallation state should be reset.
+ * Used only in uninstallation.
+ */
+ public void setResetPreinstall(boolean aResetPreinstall)
+ {
+ iResetPreinstall = aResetPreinstall;
+ }
+
+ /**
* Calculates initial size from MIDlet-Data-Size and
* MIDlet-Jar-Size attributes, or if they are not present
* from jar file size.
@@ -839,9 +886,11 @@
buf.append(" MediaId: ").append(getMediaId()).append("\n");
buf.append(" InitialSize: ").append(getInitialSize()).append("\n");
buf.append(" PreinstallState: ").append(iPreinstallState).append("\n");
+ buf.append(" ResetPreinstall: ").append(getResetPreinstall()).append("\n");
buf.append(" OnScreenKeypad: ").append(getOnScreenKeypad()).append("\n");
buf.append(" ConvertedIcon: ").append(getConvertedIconPath()).append("\n");
buf.append(" Group: ").append(getInstallationGroup()).append("\n");
+ buf.append(" Protection domain: ").append(getProtectionDomainName()).append("\n");
if (iApplications != null)
{
buf.append("Applications:\n");
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/Args.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/Args.java Thu Aug 19 09:48:13 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"
@@ -20,6 +20,7 @@
import com.nokia.mj.impl.installer.utils.InstallerException;
import com.nokia.mj.impl.installer.utils.Log;
+import com.nokia.mj.impl.utils.Base64;
import com.nokia.mj.impl.utils.Tokenizer;
import java.util.Hashtable;
@@ -59,6 +60,7 @@
//Log.log("Args: " + arg + "=" + value);
}
}
+ decodeBase64Args();
}
/**
@@ -203,7 +205,59 @@
}
drive = aDrive.toLowerCase().charAt(0) - 'a';
}
- Log.log("Parsed drive " + aDrive + " --> " + drive);
+ Log.log("Args: Parsed drive " + aDrive + " --> " + drive);
return drive;
}
+
+ /**
+ * Decodes base64 encoded arguments.
+ * In Symbian environment the decoded argument is UTF-16LE string.
+ *
+ * @see /sf/app/jrt/javacommons/utils/inc/javacommonutils.h,
+ * wbase64encode()
+ */
+ private void decodeBase64Args()
+ {
+ String base64Value = get("base64");
+ if (base64Value == null || base64Value.length() == 0)
+ {
+ return;
+ }
+ String[] tokens = Tokenizer.split(base64Value, ",");
+ String name = null;
+ String value = null;
+ for (int i = 0; i < tokens.length; i++)
+ {
+ name = tokens[i];
+ value = null;
+ if (name != null && name.length() > 0)
+ {
+ value = get(name);
+ }
+ if (value != null && value.length() > 0)
+ {
+ try
+ {
+ byte[] valueBytes = Base64.decode(value);
+ if (valueBytes != null && valueBytes.length > 0)
+ {
+ value = new String(valueBytes, "UTF-16LE");
+ Log.log("Args: Base64 decoded option " +
+ name + "=" + value);
+ iArgs.put(name, value);
+ }
+ else
+ {
+ Log.logError("Args: Base64 decoding failed for " +
+ name + "=" + value);
+ }
+ }
+ catch (Throwable t)
+ {
+ Log.logError("Args: Base64 decoding failed for " +
+ name + "=" + value, t);
+ }
+ }
+ }
+ }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/utils/PropertyListener.java Thu Aug 19 09:48:13 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:
+*
+*/
+
+
+package com.nokia.mj.impl.installer.utils;
+
+/**
+ * Interface for listening property value changes.
+ *
+ * @see PropertyProvider
+ */
+public interface PropertyListener
+{
+ /**
+ * Called when property value is changed.
+ * This method must return quickly.
+ *
+ * @param aCategory property category
+ * @param aKey property key
+ * @param aValue property value
+ */
+ public void valueChanged(int aCategory, int aKey, int aValue);
+}
--- a/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/rt/installer/ApplicationUtilsImpl.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/rt/installer/ApplicationUtilsImpl.java Thu Aug 19 09:48:13 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"
@@ -85,6 +85,11 @@
Installer.cancel();
}
+ public void uiDisposed()
+ {
+ Log.log("ApplicationUtilsImpl.uiDisposed");
+ }
+
public void checkPermission(Permission aPermission)
throws AccessControlException, NullPointerException
{
--- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/applicationregistrator.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/applicationregistrator.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -30,6 +30,12 @@
#include <AknUtils.h>
#include <hal.h>
+#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+#include <SWInstLogTaskParam.h>
+#include <SWInstTask.h>
+#include <SWInstTaskManager.h>
+#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
#include <apgicnfl.h>
#else
@@ -50,7 +56,13 @@
// NAMESPACE DECLARATION
using namespace java;
+#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+using namespace SwiUI;
+#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+IMPORT_C HBufC* CreateHBufCFromJavaStringLC(JNIEnv* aEnv, jstring aString);
+
+#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
/**
* MIDP Stub SIS file UID. The application type Uid for MIDlets in S60
*/
@@ -66,6 +78,13 @@
*/
_LIT(KAppPostfix, ".fakeapp");
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+const TInt KAppIconCount = 2;
+#else
+const TInt KAppIconCount = 1;
+#endif
+
// ------------------------
/**
@@ -80,14 +99,6 @@
jboolean aBackground);
/**
- * Internal helper method for checking whether Application Shell is already running
- * Used JNI method ...1startAppShellUi
- *
- * @return ETrue if AppShell is running
- */
-TBool isAppShellUiRunning();
-
-/**
* Internal helper method for checking whether this code is executing in
* a device that has correctly working version of
* RApaLsSession::ForceCommitNonNativeApplicationsUpdatesL()
@@ -95,6 +106,15 @@
* @return ETrue if force commit works well
*/
TBool isForceCommitSupported();
+#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+
+/**
+ * Internal helper method for checking whether Application Shell is already running
+ * Used JNI method ...1startAppShellUi
+ *
+ * @return ETrue if AppShell is running
+ */
+TBool isAppShellUiRunning();
/**
* Internal helper method for starting menu application
@@ -129,8 +149,7 @@
return err;
}
-#if 1
-//#ifndef RD_JAVA_USIF_APP_REG
+#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
// Delete any pending (un)registrations (possible if
// e.g. device rebooted before commit).
// This call does nothing if there is no pending registrations.
@@ -145,7 +164,7 @@
pApaSession->Close();
return err;
}
-#endif // RD_JAVA_USIF_APP_REG
+#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
// Return handle to session. Utilize the fact that in Symbian
// all pointer addresses are MOD 4 so the last 2 bits are 0
@@ -169,8 +188,7 @@
* @param[in] aBackground
* @return 0 if registration succeeded or Symbian error code
*/
-#if 0
-//#ifdef RD_JAVA_USIF_APP_REG
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1registerApplication
(JNIEnv */*aEnv*/, jclass /*aClass*/, jint /*aSessionHandle*/, jint /*aUid*/, jstring /*aGroupName*/,
jstring /*aMIDletName*/, jstring /*aTargetDrive*/, jstring /*aIconFileName*/,
@@ -178,7 +196,7 @@
{
return KErrNone;
}
-#else
+#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1registerApplication
(JNIEnv *aEnv, jclass aClass, jint aSessionHandle, jint aUid, jstring aGroupName,
jstring aMIDletName, jstring aTargetDrive, jstring aIconFileName,
@@ -345,7 +363,6 @@
return err;
}
-#endif // RD_JAVA_USIF_APP_REG
/**
@@ -361,7 +378,7 @@
RFile appArcIcon;
TUid midletUid;
TInt err;
- TInt numberOfIcons = 1; // Conversion results always one icon in mbm.
+ TInt numberOfIcons = KAppIconCount; // number of icons stored in MBM
// Also default mbm has one icon.
midletUid.iUid = aUid;
@@ -477,6 +494,7 @@
return err;
}
+#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
/**
@@ -486,14 +504,13 @@
* @param[in] aUid The Uid of the application to be unregistered..
* @return 0 if unregistration succeeded or Symbian error code
*/
-#if 0
-//#ifdef RD_JAVA_USIF_APP_REG
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1unregisterApplication
(JNIEnv *, jclass, jint /*aSessionHandle*/, jint /*aUid*/)
{
return KErrNone;
}
-#else
+#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1unregisterApplication
(JNIEnv *, jclass, jint aSessionHandle, jint aUid)
{
@@ -506,7 +523,7 @@
TRAPD(err, pApaSession->DeregisterNonNativeApplicationL(appUid));
return err;
}
-#endif // RD_JAVA_USIF_APP_REG
+#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
/**
@@ -527,8 +544,7 @@
TInt err = KErrNone;
-#if 1
-//#ifndef RD_JAVA_USIF_APP_REG
+#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
if (aSynchronous)
{
// Make synchronous commit
@@ -556,12 +572,12 @@
// Use always this synchronous commit when running in emulator
// to make writing autotest cases easier.
TRAP(err, pApaSession->CommitNonNativeApplicationsUpdatesL());
-#else
+#else // __WINS__
// asynchronous commit
TRAP(err, pApaSession->ForceCommitNonNativeApplicationsUpdatesL());
#endif // __WINS__
}
-#endif // RD_JAVA_USIF_APP_REG
+#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
if (KErrNone == err)
{
@@ -586,10 +602,9 @@
reinterpret_cast<RApaLsSession*>(aSessionHandle<<2);
TInt err = KErrNone;
-#if 1
-//#ifndef RD_JAVA_USIF_APP_REG
+#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
err = pApaSession->RollbackNonNativeApplicationsUpdates();
-#endif // RD_JAVA_USIF_APP_REG
+#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
pApaSession->Close();
delete pApaSession;
@@ -930,6 +945,7 @@
}
+#ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
/**
* Internal helper method for checking whether this code is executing in
* a device that has correctly working version of
@@ -974,3 +990,75 @@
return EFalse;
}
}
+#endif // !SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+
+/**
+ * See JNI method __1logComponent.
+ * This method makes calls that may leave.
+ */
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+void AddInstallLogEntryL(
+ JNIEnv */*aEnv*/, jint /*aAction*/, jint /*aUid*/,
+ jstring /*aName*/, jstring /*aVendor*/,
+ jint /*aMajorVersion*/, jint /*aMinorVersion*/, jint /*aMicroVersion*/)
+{
+}
+#else
+void AddInstallLogEntryL(
+ JNIEnv *aEnv, jint aAction, jint aUid, jstring aName, jstring aVendor,
+ jint aMajorVersion, jint aMinorVersion, jint aMicroVersion)
+{
+ TUid uid = TUid::Uid(aUid);
+ HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aName);
+ HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor);
+ TVersion version(aMajorVersion, aMinorVersion, aMicroVersion);
+
+ // Create log task object.
+ CTask* task = CTask::NewL(KLogTaskImplUid, EFalse);
+ CleanupStack::PushL(task);
+
+ // Initalize log task parameters.
+ TLogTaskParam params;
+ params.iName.Copy(name->Left(KMaxLogNameLength));
+ params.iVendor.Copy(vendor->Left(KMaxLogVendorLength));
+ params.iVersion = version;
+ params.iUid = uid;
+ // Time must be universal time.
+ TTime time;
+ time.UniversalTime();
+ params.iTime = time;
+ params.iAction = (TLogTaskAction)aAction;
+ params.iIsStartup = EFalse; // Startup list was not modified.
+
+ TLogTaskParamPckg pckg(params);
+ task->SetParameterL(pckg, 0);
+
+ // Create log task manager.
+ CTaskManager* taskManager = CTaskManager::NewL();
+ CleanupStack::PushL(taskManager);
+
+ // Add the log task to the task list.
+ taskManager->AddTaskL(task);
+ taskManager->ExecutePendingTasksL();
+
+ // Cleanup.
+ CleanupStack::PopAndDestroy(taskManager);
+ CleanupStack::Pop(task);
+
+ CleanupStack::PopAndDestroy(vendor);
+ CleanupStack::PopAndDestroy(name);
+}
+#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+
+/**
+ * Adds an entry to platform installation log.
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_ApplicationRegistrator__1addInstallLogEntry
+(JNIEnv *aEnv, jclass, jint aAction, jint aUid, jstring aName, jstring aVendor,
+ jint aMajorVersion, jint aMinorVersion, jint aMicroVersion)
+{
+ TRAPD(err, AddInstallLogEntryL(
+ aEnv, aAction, aUid, aName, aVendor,
+ aMajorVersion, aMinorVersion, aMicroVersion));
+ return err;
+}
--- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifnotifier.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -21,21 +21,11 @@
#include "javasymbianoslayer.h" // for CleanupResetAndDestroyPushL
#include "logger.h"
-#if defined(SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK) && defined(RD_JAVA_USIF_NOTIFY_PROGRESS)
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
#include <usif/sif/sifnotification.h>
#include <usif/usifcommon.h>
-// Helper macro for logging a TDesC.
-#define LOG_TDESC_L(compIdParam, logLevelParam, msgParam, tdescParam) \
- { \
- HBufC8* tdescBuf = HBufC8::NewLC(tdescParam.Length() + 1); \
- TPtr8 tdescPtr(tdescBuf->Des()); \
- tdescPtr.Append(tdescParam); \
- LOG1(compIdParam, logLevelParam, msgParam, tdescPtr.PtrZ());\
- CleanupStack::PopAndDestroy(tdescBuf); \
- }
-
// NAMESPACE DECLARATION
using namespace java;
using namespace Usif;
@@ -101,6 +91,7 @@
HBufC *appIcon = CreateHBufCFromJavaStringLC(aEnv, tmpAppIcon);
applicationIcons.AppendL(appIcon);
CleanupStack::Pop(appIcon);
+ aEnv->DeleteLocalRef(tmpAppIcon);
}
else
{
@@ -161,7 +152,7 @@
jstring aGlobalComponentId, jint aErrCategory, jint aErrCode,
jstring aErrMsg, jstring aErrMsgDetails)
{
- __UHEAP_MARK;
+ //__UHEAP_MARK;
HBufC *globalComponentId = CreateHBufCFromJavaStringLC(aEnv, aGlobalComponentId);
HBufC *errMsg = NULL;
if (NULL != aErrMsg)
@@ -174,24 +165,29 @@
errMsgDetails = CreateHBufCFromJavaStringLC(aEnv, aErrMsgDetails);
}
- CSifOperationEndData *endData = CSifOperationEndData::NewLC(
- *globalComponentId, (TErrorCategory)aErrCategory, aErrCode,
- *errMsg, *errMsgDetails);
+ CSifOperationEndData *endData =
+ CSifOperationEndData::NewLC(
+ *globalComponentId, (TErrorCategory)aErrCategory, aErrCode,
+ (NULL != errMsg? *errMsg: KNullDesC()),
+ (NULL != errMsgDetails? *errMsgDetails: KNullDesC()));
+ // Do not use UHEAP macros around PublishCompletionL() because it
+ // creates a timer object which gets deleted only when the notifier
+ // object is deleted.
aNotifier->PublishCompletionL(*endData);
CleanupStack::PopAndDestroy(endData);
- if (NULL != aErrMsg)
+ if (NULL != errMsgDetails)
+ {
+ CleanupStack::PopAndDestroy(errMsgDetails);
+ }
+ if (NULL != errMsg)
{
CleanupStack::PopAndDestroy(errMsg);
}
- if (NULL != aErrMsgDetails)
- {
- CleanupStack::PopAndDestroy(errMsgDetails);
- }
CleanupStack::PopAndDestroy(globalComponentId);
- __UHEAP_MARKEND;
+ //__UHEAP_MARKEND;
}
/*
@@ -203,10 +199,25 @@
(JNIEnv *aEnv, jclass, jint aHandle, jstring aGlobalComponentId,
jint aErrCategory, jint aErrCode, jstring aErrMsg, jstring aErrMsgDetails)
{
+ CActiveScheduler* newScheduler = 0;
+ if (0 == CActiveScheduler::Current())
+ {
+ // Create ActiveScheduler as it does not yet exist.
+ newScheduler = new CActiveScheduler;
+ CActiveScheduler::Install(newScheduler);
+ }
+
CPublishSifOperationInfo *pNotifier =
reinterpret_cast<CPublishSifOperationInfo*>(aHandle<<2);
TRAPD(err, NotifyEndL(aEnv, pNotifier, aGlobalComponentId,
aErrCategory, aErrCode, aErrMsg, aErrMsgDetails));
+
+ if (newScheduler)
+ {
+ delete newScheduler;
+ newScheduler = 0;
+ }
+
return err;
}
@@ -286,7 +297,7 @@
return KErrNone;
}
-#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK && RD_JAVA_USIF_NOTIFY_PROGRESS
+#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
/*
* Class: com_nokia_mj_impl_installer_applicationregistrator_SifNotifier
@@ -370,4 +381,4 @@
return KErrNone;
}
-#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK && RD_JAVA_USIF_NOTIFY_PROGRESS
+#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
--- a/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/applicationregistrator/sifregistrator.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -24,6 +24,7 @@
#include <w32std.h>
#include "com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator.h"
+#include "com_nokia_mj_impl_utils_InstallerErrorMessage.h"
#include "javacommonutils.h"
#include "javasymbianoslayer.h" // for CleanupResetAndDestroyPushL
#include "logger.h"
@@ -31,53 +32,39 @@
// SCR usage is enabled if this macro has been defined.
#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
-#include <qservicemanager.h>
-#include <qurl.h>
#include <usif/scr/scr.h>
#include <usif/scr/screntries.h>
-#ifdef RD_JAVA_USIF_APP_REG
#include <usif/scr/appreginfo.h>
-#endif // RD_JAVA_USIF_APP_REG
+#include <usif/usiferror.h>
+#include <xqappmgr.h>
// Helper macro for logging a TDesC.
#define LOG_TDESC_L(compIdParam, logLevelParam, msgParam, tdescParam) \
- { \
- HBufC8* tdescBuf = HBufC8::NewLC(tdescParam.Length() + 1); \
- TPtr8 tdescPtr(tdescBuf->Des()); \
- tdescPtr.Append(tdescParam); \
- LOG1(compIdParam, logLevelParam, msgParam, tdescPtr.PtrZ());\
- CleanupStack::PopAndDestroy(tdescBuf); \
+ { \
+ std::wstring ws((wchar_t*)tdescParam.Ptr(), tdescParam.Length()); \
+ LOG1(compIdParam, logLevelParam, msgParam, ws.c_str()); \
}
// NAMESPACE DECLARATION
-QTM_USE_NAMESPACE
using namespace java;
using namespace Usif;
IMPORT_C HBufC* CreateHBufCFromJavaStringLC(JNIEnv* aEnv, jstring aString);
-// Java MIME types.
-_LIT(KMimeTypeAppDescriptor, "text/vnd.sun.j2me.app-descriptor");
-_LIT(KMimeTypeJava, "application/java");
-_LIT(KMimeTypeJavaArchive, "application/java-archive");
-_LIT(KMimeTypeXJavaArchive, "application/x-java-archive");
-
// Properties registered to SCR.
-_LIT(KMIDletName, "MIDlet-Name");
_LIT(KUid, "Uid");
_LIT(KMediaId, "Media-Id");
_LIT(KMIDletInfoURL, "MIDlet-Info-URL");
_LIT(KMIDletDescription, "MIDlet-Description");
_LIT(KDownloadURL, "Download-URL");
+_LIT(KUpdateURL, "Update-URL");
_LIT(KSettingsPlugin, "SettingsName");
_LIT(KSettingsPluginValue, "javaapplicationsettingsview");
-#ifdef RD_JAVA_USIF_APP_REG
// Symbian file path separator.
_LIT(KPathSeperator, "\\");
// Postfix for the fake application name generated for AppArc.
_LIT(KAppPostfix, ".fakeapp");
-#endif // RD_JAVA_USIF_APP_REG
/**
* Internal helper method for checking if specified application
@@ -187,7 +174,6 @@
* See JNI method __1notifyAppChange.
* This method makes calls that may leave (the actual registering).
*/
-#ifdef RD_JAVA_USIF_NOTIFY_APP_ARC
void NotifyAppChangeL(JNIEnv *aEnv, jintArray aAppUids, jint aAppChange)
{
RApaLsSession apaSession;
@@ -220,11 +206,6 @@
CleanupStack::PopAndDestroy(&apaSession);
LOG(EJavaInstaller, EInfo, "NotifyAppChangeL completed");
}
-#else
-void NotifyAppChangeL(JNIEnv *, jintArray, jint)
-{
-}
-#endif // RD_JAVA_USIF_NOTIFY_APP_ARC
/*
* Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator
@@ -235,12 +216,6 @@
(JNIEnv *aEnv, jclass, jintArray aAppUids, jint aAppChange)
{
TRAPD(err, NotifyAppChangeL(aEnv, aAppUids, aAppChange));
- if (KErrNone != err)
- {
- ELOG1(EJavaInstaller,
- "notifyAppChange: notifying AppArc failed, error %d",
- err);
- }
return err;
}
@@ -254,86 +229,47 @@
{
TInt err = KErrNone;
- QServiceManager serviceManager;
- QObject* activityManager =
- serviceManager.loadInterface("com.nokia.qt.activities.ActivityManager");
- if (!activityManager)
+ CActiveScheduler* newScheduler = 0;
+ if (0 == CActiveScheduler::Current())
{
- err = serviceManager.error();
- ELOG1(EJavaInstaller,
- "launchAppView: loading ActivityManager failed, error %d", err);
- return KErrCouldNotConnect;
- }
- // URL for launching AppLib.
- QUrl url(QString("appto://20022F35?activityname=AppLibRecentView"));
- QMetaObject::invokeMethod(activityManager, "launchActivity",
- Q_ARG(QString, url.toString()));
- err = serviceManager.error();
- delete activityManager;
- if (QServiceManager::NoError != err)
- {
- ELOG1(EJavaInstaller,
- "launchAppView: launching AppLib activity failed, error %d",
- err);
- return KErrCouldNotConnect;
+ // Create ActiveScheduler as it does not yet exist.
+ newScheduler = new CActiveScheduler;
+ CActiveScheduler::Install(newScheduler);
}
- // Start AppLib and bring it to foreground.
- const TUid KAppLibUid = { 0x20022F35 };
- TRAP(err, StartAppL(KAppLibUid));
- return err;
-}
-
-/**
- * See JNI method __1registerJavaSoftwareType.
- * This method makes calls that may leave (the actual registering).
- */
-void RegisterJavaSoftwareTypeL(RSoftwareComponentRegistry *aScr, TBool aRegister = ETrue)
-{
- RPointerArray<HBufC> javaMimeTypes;
- CleanupResetAndDestroyPushL(javaMimeTypes);
- javaMimeTypes.AppendL(KMimeTypeAppDescriptor().AllocL());
- javaMimeTypes.AppendL(KMimeTypeJava().AllocL());
- javaMimeTypes.AppendL(KMimeTypeJavaArchive().AllocL());
- javaMimeTypes.AppendL(KMimeTypeXJavaArchive().AllocL());
- if (aRegister)
- {
- TUid javaSifPluginUid = TUid::Uid(0x2002bc70);
- _LIT_SECURE_ID(KJavaInstallerSid, 0x102033E6);
- aScr->AddSoftwareTypeL(
- Usif::KSoftwareTypeJava, javaSifPluginUid,
- KJavaInstallerSid, KJavaInstallerSid, javaMimeTypes);
- }
- else
+ QUrl openRecentView("appto://20022F35?activityname=AppLibRecentView");
+ XQApplicationManager applicationManager;
+ XQAiwRequest *request = applicationManager.create(openRecentView);
+ if (request)
{
- aScr->DeleteSoftwareTypeL(Usif::KSoftwareTypeJava, javaMimeTypes);
+ LOG(EJavaInstaller, EInfo, "launchAppView: launching AppLib");
+ bool result = request->send();
+ if (!result)
+ {
+ int error = request->lastError();
+ ELOG1(EJavaInstaller,
+ "launchAppView: launching AppLib failed, error %d", error);
+ err = KErrGeneral;
+ }
+ else
+ {
+ LOG(EJavaInstaller, EInfo, "launchAppView: launching AppLib succeeded");
+ }
+ delete request;
}
- CleanupStack::PopAndDestroy(&javaMimeTypes);
-}
-/*
- * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator
- * Method: _registerJavaSoftwareType
- * Signature: (Z)I
- */
-JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1registerJavaSoftwareType
-(JNIEnv *, jclass, jboolean aRegister)
-{
- RSoftwareComponentRegistry *pScr = NULL;
- TRAPD(err, pScr = CreateScrL());
- if (KErrNone != err)
+ if (newScheduler)
{
- return err;
+ delete newScheduler;
+ newScheduler = 0;
}
- TRAP(err, RegisterJavaSoftwareTypeL(pScr, aRegister));
- if (KErrNone != err)
+
+ if (KErrNone == err)
{
- ELOG1(EJavaInstaller,
- "registerJavaSoftwareType: registration failed, error %d",
- err);
+ // Start AppLib and bring it to foreground.
+ const TUid KAppLibUid = { 0x20022F35 };
+ TRAP(err, StartAppL(KAppLibUid));
}
- pScr->Close();
- delete pScr;
return err;
}
@@ -408,12 +344,6 @@
TRAPD(err, pScr->RollbackTransactionL());
pScr->Close();
delete pScr;
- if (KErrNone != err)
- {
- ELOG1(EJavaInstaller,
- "rollbackSession: Rolling back transaction failed, error %d",
- err);
- }
return err;
}
@@ -443,9 +373,9 @@
HBufC *valueBuf = CreateHBufCFromJavaStringLC(aEnv, aValue);
aScr->SetComponentPropertyL(aComponentId, aName, *valueBuf);
//LOG_TDESC_L(EJavaInstaller, EInfo,
- // "SetComponentPropertyL: name %s", aName);
+ // "SetComponentPropertyL: name %S", aName);
//LOG_TDESC_L(EJavaInstaller, EInfo,
- // "SetComponentPropertyL: value %s", valueBuf->Des());
+ // "SetComponentPropertyL: value %S", valueBuf->Des());
CleanupStack::PopAndDestroy(valueBuf);
}
}
@@ -456,23 +386,14 @@
*/
TComponentId RegisterComponentL(
JNIEnv *aEnv, RSoftwareComponentRegistry *aScr, jint aUid,
- jstring aSuiteName, jstring aVendor, jstring aVersion,
- jstring aName, jstring aGlobalId,
+ jstring aSuiteName, jstring aVendor, jstring aVersion, jstring aGlobalId,
jobjectArray aComponentFiles, TInt64 aComponentSize,
TBool aIsRemovable, TBool aIsDrmProtected,
TBool aIsOriginVerified, TBool aIsUpdate, jint aMediaId,
- jstring aMidletInfoUrl, jstring aMidletDescription, jstring aDownloadUrl)
+ jstring aMidletInfoUrl, jstring aMidletDescription,
+ jstring aDownloadUrl, jstring aUpdateUrl)
{
- HBufC *name = NULL;
- if (NULL == aName)
- {
- // If name is not specified, use suite name.
- name = CreateHBufCFromJavaStringLC(aEnv, aSuiteName);
- }
- else
- {
- name = CreateHBufCFromJavaStringLC(aEnv, aName);
- }
+ HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aSuiteName);
HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor);
HBufC *version = CreateHBufCFromJavaStringLC(aEnv, aVersion);
HBufC *globalId = CreateHBufCFromJavaStringLC(aEnv, aGlobalId);
@@ -499,14 +420,10 @@
aScr->SetComponentPropertyL(componentId, KSettingsPlugin(), KSettingsPluginValue());
//LOG(EJavaInstaller, EInfo, "RegisterComponentL: Settings plugin property set");
- if (NULL != aName)
- {
- // If name is specified, store suite name as property.
- SetComponentPropertyL(aEnv, aScr, componentId, KMIDletName(), aSuiteName);
- }
SetComponentPropertyL(aEnv, aScr, componentId, KMIDletInfoURL(), aMidletInfoUrl);
SetComponentPropertyL(aEnv, aScr, componentId, KMIDletDescription(), aMidletDescription);
SetComponentPropertyL(aEnv, aScr, componentId, KDownloadURL(), aDownloadUrl);
+ SetComponentPropertyL(aEnv, aScr, componentId, KUpdateURL(), aUpdateUrl);
CleanupStack::PopAndDestroy(globalId);
CleanupStack::PopAndDestroy(version);
@@ -532,22 +449,23 @@
*/
JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1registerComponent
(JNIEnv *aEnv, jclass, jint aSessionHandle, jint aUid, jstring aSuiteName,
- jstring aVendor, jstring aVersion, jstring aName, jstring aGlobalId,
+ jstring aVendor, jstring aVersion, jstring aGlobalId,
jobjectArray aComponentFiles, jlong aComponentSize, jboolean aIsRemovable,
jboolean aIsDrmProtected, jboolean aIsOriginVerified, jboolean aIsUpdate,
jint aMediaId, jstring aMidletInfoUrl, jstring aMidletDescription,
- jstring aDownloadUrl, jobject aComponentId)
+ jstring aDownloadUrl, jstring aUpdateUrl, jobject aComponentId)
{
- //__UHEAP_MARK;
+ __UHEAP_MARK;
RSoftwareComponentRegistry *pScr =
reinterpret_cast<RSoftwareComponentRegistry*>(aSessionHandle<<2);
TComponentId componentId = -1;
TRAPD(err, componentId = RegisterComponentL(
- aEnv, pScr, aUid, aSuiteName, aVendor, aVersion, aName, aGlobalId,
+ aEnv, pScr, aUid, aSuiteName, aVendor, aVersion, aGlobalId,
aComponentFiles, aComponentSize, aIsRemovable,
aIsDrmProtected, aIsOriginVerified, aIsUpdate, aMediaId,
- aMidletInfoUrl, aMidletDescription, aDownloadUrl));
- //__UHEAP_MARKEND;
+ aMidletInfoUrl, aMidletDescription,
+ aDownloadUrl, aUpdateUrl));
+ __UHEAP_MARKEND;
if (KErrNone == err)
{
jclass clazz = aEnv->GetObjectClass(aComponentId);
@@ -565,18 +483,16 @@
JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1unregisterComponent
(JNIEnv *, jclass, jint aSessionHandle, jint aComponentId)
{
- //__UHEAP_MARK;
+ __UHEAP_MARK;
RSoftwareComponentRegistry *pScr =
reinterpret_cast<RSoftwareComponentRegistry*>(aSessionHandle<<2);
TInt err = KErrNone;
-#ifdef RD_JAVA_USIF_APP_REG
TRAP(err, pScr->DeleteApplicationEntriesL(aComponentId));
-#endif // RD_JAVA_USIF_APP_REG
if (KErrNone == err)
{
TRAP(err, pScr->DeleteComponentL(aComponentId));
}
- //__UHEAP_MARKEND;
+ __UHEAP_MARKEND;
return err;
}
@@ -584,7 +500,6 @@
* See JNI method __1registerApplication.
* This method makes calls that may leave.
*/
-#ifdef RD_JAVA_USIF_APP_REG
void RegisterApplicationL(
JNIEnv *aEnv, RSoftwareComponentRegistry *aScr,
jint aComponentId, jint aAppUid,
@@ -652,47 +567,36 @@
RPointerArray<HBufC> captionsArray;
CleanupResetAndDestroyPushL(captionsArray);
TInt langCount = aEnv->GetArrayLength(aLanguages);
- TInt captionCount = aEnv->GetArrayLength(aAppNames);
- if (langCount == captionCount)
+ jint* languages = aEnv->GetIntArrayElements(aLanguages, NULL);
+ for (TInt i = 0; i < langCount; i++)
{
- jint* languages = aEnv->GetIntArrayElements(aLanguages, NULL);
- for (TInt i = 0; i < langCount; i++)
- {
- TLanguage tmpLanguage = (TLanguage)languages[i];
- HBufC *tmpCaption =
- CreateHBufCFromJavaStringLC(
- aEnv, (jstring)aEnv->GetObjectArrayElement(aAppNames, i));
- captionsArray.AppendL(tmpCaption);
- CleanupStack::Pop(tmpCaption);
- //LOG1(EJavaInstaller, EInfo,
- // "RegisterApplicationL: language %d", tmpLanguage);
- //LOG_TDESC_L(EJavaInstaller, EInfo,
- // "RegisterApplicationL: caption %s", tmpCaption->Des());
- CCaptionAndIconInfo *tmpCaptionAndIconInfo =
- CCaptionAndIconInfo::NewLC(
- /*aCaption=*/ *tmpCaption,
- /*aIconFileName=*/ KNullDesC,
- /*aNumOfAppIcons=*/ 0);
- CLocalizableAppInfo *tmpLocAppInfo =
- CLocalizableAppInfo::NewLC(
- /*aShortCaption=*/ KNullDesC,
- /*aApplicationLanguage=*/ tmpLanguage,
- /*aGroupName=*/ KNullDesC,
- /*aCaptionAndIconInfo=*/ tmpCaptionAndIconInfo,
- /*aViewDataList=*/ viewDataList);
- localizableAppInfoList.AppendL(tmpLocAppInfo);
- CleanupStack::Pop(tmpLocAppInfo);
- CleanupStack::Pop(tmpCaptionAndIconInfo);
- }
- aEnv->ReleaseIntArrayElements(aLanguages, languages, 0);
+ TLanguage tmpLanguage = (TLanguage)languages[i];
+ HBufC *tmpCaption =
+ CreateHBufCFromJavaStringLC(
+ aEnv, (jstring)aEnv->GetObjectArrayElement(aAppNames, i));
+ captionsArray.AppendL(tmpCaption);
+ CleanupStack::Pop(tmpCaption);
+ //LOG1(EJavaInstaller, EInfo,
+ // "RegisterApplicationL: language %d", tmpLanguage);
+ //LOG_TDESC_L(EJavaInstaller, EInfo,
+ // "RegisterApplicationL: caption %S", tmpCaption->Des());
+ CCaptionAndIconInfo *tmpCaptionAndIconInfo =
+ CCaptionAndIconInfo::NewLC(
+ /*aCaption=*/ *tmpCaption,
+ /*aIconFileName=*/ KNullDesC,
+ /*aNumOfAppIcons=*/ 0);
+ CLocalizableAppInfo *tmpLocAppInfo =
+ CLocalizableAppInfo::NewLC(
+ /*aShortCaption=*/ KNullDesC,
+ /*aApplicationLanguage=*/ tmpLanguage,
+ /*aGroupName=*/ KNullDesC,
+ /*aCaptionAndIconInfo=*/ tmpCaptionAndIconInfo,
+ /*aViewDataList=*/ viewDataList);
+ localizableAppInfoList.AppendL(tmpLocAppInfo);
+ CleanupStack::Pop(tmpLocAppInfo);
+ CleanupStack::Pop(tmpCaptionAndIconInfo);
}
- else
- {
- WLOG2(EJavaInstaller,
- "RegisterApplicationL: localisation not made because language " \
- "count does not match to caption count (%d != %d)",
- langCount, captionCount);
- }
+ aEnv->ReleaseIntArrayElements(aLanguages, languages, 0);
// Create application registration data objects.
TApplicationCharacteristics appCharacteristics;
@@ -728,13 +632,6 @@
CleanupStack::PopAndDestroy(caption);
__UHEAP_MARKEND;
}
-#else
-void RegisterApplicationL(
- JNIEnv *, RSoftwareComponentRegistry *, jint, jint, jstring,
- jstring, jstring, jstring, jint, jintArray, jobjectArray)
-{
-}
-#endif // RD_JAVA_USIF_APP_REG
/*
* Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator
@@ -764,19 +661,13 @@
JNIEnv *aEnv, RSoftwareComponentRegistry *aScr, jint aComponentId,
jstring aName, jstring aVendor, jint aLanguage)
{
- if (NULL != aName)
- {
- HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aName);
- aScr->SetComponentNameL(aComponentId, *name, (TLanguage)aLanguage);
- CleanupStack::PopAndDestroy(name);
- }
+ HBufC *name = CreateHBufCFromJavaStringLC(aEnv, aName);
+ aScr->SetComponentNameL(aComponentId, *name, (TLanguage)aLanguage);
+ CleanupStack::PopAndDestroy(name);
- if (NULL != aVendor)
- {
- HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor);
- aScr->SetVendorNameL(aComponentId, *vendor, (TLanguage)aLanguage);
- CleanupStack::PopAndDestroy(vendor);
- }
+ HBufC *vendor = CreateHBufCFromJavaStringLC(aEnv, aVendor);
+ aScr->SetVendorNameL(aComponentId, *vendor, (TLanguage)aLanguage);
+ CleanupStack::PopAndDestroy(vendor);
}
/*
@@ -881,7 +772,6 @@
* Method: _getComponentIdForApp
* Signature: (IILcom/nokia/mj/impl/installer/applicationregistrator/ComponentId;)I
*/
-#ifdef RD_JAVA_USIF_APP_REG
JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getComponentIdForApp
(JNIEnv *aEnv, jclass, jint aSessionHandle, jint aAppUid, jobject aComponentId)
{
@@ -901,13 +791,6 @@
}
return err;
}
-#else
-JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getComponentIdForApp
-(JNIEnv *, jclass, jint, jint, jobject)
-{
- return KErrNone;
-}
-#endif // RD_JAVA_USIF_APP_REG
/**
* See JNI method __1getuid.
@@ -920,20 +803,8 @@
CleanupClosePushL(*pScr);
TInt uid = 0;
CPropertyEntry *property = pScr->GetComponentPropertyL(aCid, KUid());
- if (NULL != property)
- {
- if (property->PropertyType() == CPropertyEntry::EIntProperty)
- {
- uid = ((CIntPropertyEntry*)property)->IntValue();
- }
- else
- {
- ELOG2(EJavaInstaller,
- "GetUidL: Incorrect property type %d for cid %d",
- property->PropertyType(), aCid);
- }
- delete property;
- }
+ uid = ((CIntPropertyEntry*)property)->IntValue();
+ delete property;
// Close and delete the temporary RSoftwareComponentRegistry.
CleanupStack::PopAndDestroy(pScr);
delete pScr; // For some reason PopAndDestroy does not delete this.
@@ -970,23 +841,16 @@
HBufC *globalId = CreateHBufCFromJavaStringLC(aEnv, aGlobalId);
CComponentEntry *componentEntry =
aScr->GetComponentL(*globalId, Usif::KSoftwareTypeJava, aLanguage);
- if (NULL == componentEntry)
- {
- //LOG_TDESC_L(EJavaInstaller, EInfo,
- // "Component not found for GlobalId %s", globalId->Des());
- CleanupStack::PopAndDestroy(globalId);
- return;
- }
CleanupStack::PopAndDestroy(globalId);
// Log component entry.
TComponentId componentId = componentEntry->ComponentId();
- LOG_TDESC_L(EJavaInstaller, EInfo, "GlobalId: %s", componentEntry->GlobalId());
+ LOG_TDESC_L(EJavaInstaller, EInfo, "GlobalId: %S", componentEntry->GlobalId());
LOG1(EJavaInstaller, EInfo, "ComponentId: %d", componentId);
- LOG_TDESC_L(EJavaInstaller, EInfo, "SoftwareType: %s", componentEntry->SoftwareType());
- LOG_TDESC_L(EJavaInstaller, EInfo, "Name: %s", componentEntry->Name());
- LOG_TDESC_L(EJavaInstaller, EInfo, "Vendor: %s", componentEntry->Vendor());
- LOG_TDESC_L(EJavaInstaller, EInfo, "Version: %s", componentEntry->Version());
+ LOG_TDESC_L(EJavaInstaller, EInfo, "SoftwareType: %S", componentEntry->SoftwareType());
+ LOG_TDESC_L(EJavaInstaller, EInfo, "Name: %S", componentEntry->Name());
+ LOG_TDESC_L(EJavaInstaller, EInfo, "Vendor: %S", componentEntry->Vendor());
+ LOG_TDESC_L(EJavaInstaller, EInfo, "Version: %S", componentEntry->Version());
LOG1(EJavaInstaller, EInfo, "ComponentSize: %d", componentEntry->ComponentSize());
LOG1(EJavaInstaller, EInfo, "ScomoState: %d", componentEntry->ScomoState());
LOG1(EJavaInstaller, EInfo, "IsDrmProtected: %d", componentEntry->IsDrmProtected());
@@ -1014,42 +878,37 @@
switch (propertyEntry->PropertyType())
{
case CPropertyEntry::EBinaryProperty:
- LOG_TDESC_L(EJavaInstaller, EInfo, "BinaryProperty: %s",
+ LOG_TDESC_L(EJavaInstaller, EInfo, "BinaryProperty: %S",
propertyEntry->PropertyName());
break;
case CPropertyEntry::EIntProperty:
- LOG_TDESC_L(EJavaInstaller, EInfo, "IntProperty: %s",
+ LOG_TDESC_L(EJavaInstaller, EInfo, "IntProperty: %S",
propertyEntry->PropertyName());
LOG2(EJavaInstaller, EInfo, " = 0x%x (%d)",
((CIntPropertyEntry*)propertyEntry)->IntValue(),
((CIntPropertyEntry*)propertyEntry)->IntValue());
break;
case CPropertyEntry::ELocalizedProperty:
- LOG_TDESC_L(EJavaInstaller, EInfo, "LocalizedProperty: %s",
+ LOG_TDESC_L(EJavaInstaller, EInfo, "LocalizedProperty: %S",
propertyEntry->PropertyName());
- LOG_TDESC_L(EJavaInstaller, EInfo, " = %s",
+ LOG_TDESC_L(EJavaInstaller, EInfo, " = %S",
((CLocalizablePropertyEntry*)propertyEntry)->StrValue());
break;
}
}
CleanupStack::PopAndDestroy(&properties);
-#ifdef RD_JAVA_USIF_APP_REG
// Log uids of applications associated to component.
RArray<TUid> appUids;
CleanupClosePushL(appUids);
aScr->GetAppUidsForComponentL(componentId, appUids);
- if (appUids.Count() == 0)
- {
- LOG(EJavaInstaller, EInfo, "No component appUids found from SCR");
- }
+ LOG1(EJavaInstaller, EInfo, "Number of AppUids found: %d", appUids.Count());
for (TInt i = 0; i < appUids.Count(); i++)
{
LOG2(EJavaInstaller, EInfo, "AppUid [%x] (%d)",
appUids[i].iUid, appUids[i].iUid);
}
CleanupStack::PopAndDestroy(&appUids);
-#endif // RD_JAVA_USIF_APP_REG
}
/**
@@ -1085,11 +944,11 @@
JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1logComponent
(JNIEnv *aEnv, jclass, jint aSessionHandle, jstring aGlobalId)
{
- __UHEAP_MARK;
+ //__UHEAP_MARK;
RSoftwareComponentRegistry *pScr =
reinterpret_cast<RSoftwareComponentRegistry*>(aSessionHandle<<2);
TRAPD(err, LogComponentL(aEnv, pScr, aGlobalId));
- __UHEAP_MARKEND;
+ //__UHEAP_MARKEND;
return err;
}
@@ -1101,11 +960,51 @@
JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getUsifMode
(JNIEnv *, jclass)
{
-#ifdef RD_JAVA_USIF_APP_REG
return 1;
-#else
- return 0;
-#endif // RD_JAVA_USIF_APP_REG
+}
+
+/*
+ * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator
+ * Method: _getErrorCategory
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getErrorCategory
+(JNIEnv *, jclass, jint aErrorId)
+{
+ int errorCategory = Usif::EUnexpectedError;
+ switch (aErrorId)
+ {
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_NO_MEM:
+ errorCategory = Usif::ELowDiskSpace;
+ break;
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_NO_NET:
+ errorCategory = Usif::ENetworkUnavailable;
+ break;
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_CORRUPT_PKG:
+ errorCategory = Usif::ECorruptedPackage;
+ break;
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_COMPAT_ERR:
+ errorCategory = Usif::EApplicationNotCompatible;
+ break;
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_AUTHORIZATION_ERR:
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_AUTHENTICATION_ERR:
+ errorCategory = Usif::ESecurityError;
+ break;
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_PUSH_REG_ERR:
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_UNEXPECTED_ERR:
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_UNINST_UNEXPECTED_ERR:
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_OTHER_UNEXPECTED_ERR:
+ errorCategory = Usif::EUnexpectedError;
+ break;
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_INST_CANCEL:
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_UNINST_CANCEL:
+ errorCategory = Usif::EUserCancelled;
+ break;
+ case com_nokia_mj_impl_utils_InstallerErrorMessage_UNINST_NOT_ALLOWED:
+ errorCategory = Usif::EUninstallationBlocked;
+ break;
+ }
+ return errorCategory;
}
#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
@@ -1134,17 +1033,6 @@
/*
* Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator
- * Method: _registerJavaSoftwareType
- * Signature: (Z)I
- */
-JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1registerJavaSoftwareType
-(JNIEnv *, jclass, jboolean)
-{
- return KErrNone;
-}
-
-/*
- * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator
* Method: _startSession
* Signature: ()I
*/
@@ -1192,9 +1080,9 @@
* Signature: (ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;JZZZZLcom/nokia/mj/impl/installer/applicationregistrator/ComponentId;)I
*/
JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1registerComponent
-(JNIEnv *, jclass, jint, jint, jstring, jstring, jstring, jstring, jstring,
- jobjectArray, jlong, jboolean, jboolean, jboolean, jboolean, jint, jstring,
- jstring, jstring, jobject)
+(JNIEnv *, jclass, jint, jint, jstring, jstring, jstring, jstring,
+ jobjectArray, jlong, jboolean, jboolean, jboolean, jboolean, jint,
+ jstring, jstring, jstring, jstring, jobject)
{
return KErrNone;
}
@@ -1298,4 +1186,15 @@
return 0;
}
+/*
+ * Class: com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator
+ * Method: _getErrorCategory
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_applicationregistrator_SifRegistrator__1getErrorCategory
+(JNIEnv *, jclass, jint)
+{
+ return 0;
+}
+
#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
--- a/javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -20,11 +20,14 @@
#include <zipfile.h>
#include <time.h>
+#include <bitmaptransforms.h>
#include "javacommonutils.h"
#include "logger.h"
#include "mifconverter.h"
#include "iconconverter.h"
+#include "iconsizeutils.h" // TIconSizes
+#include "iconsizenotifier.h" // KUidIconSizeNotifPlugin
namespace java
{
@@ -32,12 +35,13 @@
/**
* The icon in S60 temporary drive
*/
-_LIT(KTempIconName, "D:\\micon.mbm");
+_LIT(KTempIconName1, "D:\\micon1.mbm");
+_LIT(KTempMaskName1, "D:\\mmask1.mbm");
-/**
- * The mask in S60 temporary drive
- */
-_LIT(KTempMaskName, "D:\\mmask.mbm");
+#ifdef RD_JAVA_S60_RELEASE_9_2
+_LIT(KTempIconName2, "D:\\micon2.mbm");
+_LIT(KTempMaskName2, "D:\\mmask2.mbm");
+#endif // RD_JAVA_S60_RELEASE_9_2
// MIF file constants
@@ -51,13 +55,11 @@
const TInt KMifIconHeaderAnimated = 0;
-
CIconConverter* CIconConverter::NewL(RFs& aRFs)
{
return new(ELeave) CIconConverter(aRFs);
}
-
CIconConverter::CIconConverter(RFs &aRFs)
{
iRFs = aRFs;
@@ -79,6 +81,8 @@
// Do NOT close file server session
delete iBitmapMask;
delete iBitmap;
+ delete iBitmapMaskScaledCopy;
+ delete iBitmapScaledCopy;
delete iImageDecoder;
RFbsSession::Disconnect();
@@ -246,34 +250,77 @@
*iBitmapMask);
CActiveScheduler::Start();
- err = iActiveListener->iStatus.Int();
+ User::LeaveIfError(iActiveListener->iStatus.Int());
+
+ // Scale icons
+ TIconSizes sizes(GetIdealIconSizes());
+ CBitmapScaler* scaler = CBitmapScaler::NewL();
+ CleanupStack::PushL(scaler);
+ scaler->SetQualityAlgorithm(CBitmapScaler::EMaximumQuality);
+
+ // Scale for Menu
+ ILOG2(EJavaInstaller, "Scaling Menu icon to (%d, %d)",
+ sizes.iMenuIconSize.iWidth, sizes.iMenuIconSize.iHeight);
+ iBitmapScaledCopy = new(ELeave) CFbsBitmap;
+ iBitmapMaskScaledCopy = new(ELeave) CFbsBitmap;
+ ScaleL(*scaler, sizes.iMenuIconSize);
+ User::LeaveIfError(iBitmapScaledCopy->Save(KTempIconName1));
+ User::LeaveIfError(iBitmapMaskScaledCopy->Save(KTempMaskName1));
+ iBitmapScaledCopy->Reset();
+ iBitmapMaskScaledCopy->Reset();
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ // Scale for App Manager
+ ILOG2(EJavaInstaller, "Scaling App Mgr icon to (%d, %d)",
+ sizes.iMenuIconSize.iWidth, sizes.iMenuIconSize.iHeight);
+ ScaleL(*scaler, sizes.iAppMgrIconSize);
+ User::LeaveIfError(iBitmapScaledCopy->Save(KTempIconName2));
+ User::LeaveIfError(iBitmapMaskScaledCopy->Save(KTempMaskName2));
+ iBitmapScaledCopy->Reset();
+ iBitmapMaskScaledCopy->Reset();
+#endif // RD_JAVA_S60_RELEASE_9_2
+
+ CleanupStack::PopAndDestroy(scaler);
delete iActiveListener;
iActiveListener = NULL;
- if (err != KErrNone)
- {
- User::Leave(err);
- }
- // store bitmap to two temp files
- User::LeaveIfError(iBitmap->Save(KTempIconName));
- User::LeaveIfError(iBitmapMask->Save(KTempMaskName));
-
- // construct multi bitmap file from bitmap and mask files (2 files)
+ // Construct multi bitmap file from bitmap and mask files (2 files)
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ const TInt KBmpCount = 4;
+ TInt32 sourceIds[] = {0, 0, 0, 0};
+#else
+ const TInt KBmpCount = 2;
TInt32 sourceIds[] = {0, 0};
- TFileName** filenames = new(ELeave) TFileName*[2];
+#endif // RD_JAVA_S60_RELEASE_9_2
+
+ TFileName** filenames = new(ELeave) TFileName*[KBmpCount];
CleanupStack::PushL(filenames);
- filenames[0] = new(ELeave) TFileName(KTempIconName);
+ filenames[0] = new(ELeave) TFileName(KTempIconName1);
CleanupStack::PushL(filenames[0]);
- filenames[1] = new(ELeave) TFileName(KTempMaskName);
+ filenames[1] = new(ELeave) TFileName(KTempMaskName1);
CleanupStack::PushL(filenames[1]);
-
- CFbsBitmap::StoreL(aOutputFile, 2, (const TDesC**)filenames, sourceIds);
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ filenames[2] = new(ELeave) TFileName(KTempIconName2);
+ CleanupStack::PushL(filenames[2]);
+ filenames[3] = new(ELeave) TFileName(KTempMaskName2);
+ CleanupStack::PushL(filenames[3]);
+#endif // RD_JAVA_S60_RELEASE_9_2
+
+ CFbsBitmap::StoreL(aOutputFile, KBmpCount, (const TDesC**)filenames, sourceIds);
// Now try to delete the temp icon and mask files,
// ignore possible errors
- (void)iRFs.Delete(KTempIconName);
- (void)iRFs.Delete(KTempMaskName);
-
+ (void)iRFs.Delete(KTempIconName1);
+ (void)iRFs.Delete(KTempMaskName1);
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ (void)iRFs.Delete(KTempIconName2);
+ (void)iRFs.Delete(KTempMaskName2);
+ CleanupStack::PopAndDestroy(filenames[3]);
+ CleanupStack::PopAndDestroy(filenames[2]);
+#endif // RD_JAVA_S60_RELEASE_9_2
+
CleanupStack::PopAndDestroy(filenames[1]);
CleanupStack::PopAndDestroy(filenames[0]);
CleanupStack::PopAndDestroy(filenames);
@@ -371,4 +418,64 @@
mimeTypes.ResetAndDestroy();
}
+void CIconConverter::ScaleL(CBitmapScaler& aScaler, const TSize aSize)
+{
+ ASSERT(iBitmapScaledCopy);
+ ASSERT(iBitmapMaskScaledCopy);
+
+ User::LeaveIfError(iBitmapScaledCopy->Create(aSize, EColor16M));
+ User::LeaveIfError(iBitmapMaskScaledCopy->Create(aSize, EGray256));
+
+ iActiveListener->InitialiseActiveListener();
+ aScaler.Scale(&iActiveListener->iStatus, *iBitmap, *iBitmapScaledCopy, ETrue);
+ CActiveScheduler::Start();
+ User::LeaveIfError(iActiveListener->iStatus.Int());
+
+ iActiveListener->InitialiseActiveListener();
+ aScaler.Scale(&iActiveListener->iStatus, *iBitmapMask, *iBitmapMaskScaledCopy, ETrue);
+ CActiveScheduler::Start();
+ User::LeaveIfError(iActiveListener->iStatus.Int());
+}
+
+TIconSizes CIconConverter::GetIdealIconSizes()
+{
+ TIconSizes fallbackSizes;
+ fallbackSizes.iMenuIconSize = TSize(KIconInMenuFallbackSize, KIconInMenuFallbackSize);
+ fallbackSizes.iAppMgrIconSize = TSize(KIconInAppMgrFallbackSize, KIconInAppMgrFallbackSize);
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ RNotifier notifier;
+ TInt err = notifier.Connect();
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller, "CIconConverter::GetIdealIconSizes #1 err = %d", err);
+ return fallbackSizes;
+ }
+
+ CleanupClosePushL(notifier);
+
+ TPckgBuf<TIconSizes> des;
+ iActiveListener->InitialiseActiveListener();
+ notifier.StartNotifierAndGetResponse(iActiveListener->iStatus,
+ KUidIconSizeNotifPlugin, des, des);
+ CActiveScheduler::Start();
+ notifier.CancelNotifier(KUidIconSizeNotifPlugin);
+ err = iActiveListener->iStatus.Int();
+
+ CleanupStack::PopAndDestroy(¬ifier);
+
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller, "CIconConverter::GetIdealIconSizes #2 err = %d", err);
+ return fallbackSizes;
+ }
+ else
+ {
+ return des();
+ }
+#else
+ return fallbackSizes;
+#endif
+}
+
} // namespace java
--- a/javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/iconconverter/iconconverter.h Thu Aug 19 09:48:13 2010 +0300
@@ -26,6 +26,10 @@
#include <imageconversion.h>
+class CBitmapScaler;
+class TIconSizes;
+
+
namespace java
{
@@ -161,6 +165,15 @@
HBufC8* apIconBuf,
const TDesC &aOutputFile);
+ /**
+ * Scale the original icon into the current temporary icon.
+ */
+ void ScaleL(CBitmapScaler& aScaler, const TSize aSize);
+
+ /**
+ * Get the ideal icon sizes from UI, trough the ecom plugin notifier.
+ */
+ TIconSizes GetIdealIconSizes();
private:
/**
@@ -176,16 +189,25 @@
CBufferedImageDecoder* iImageDecoder;
/**
- * Pointer to bitmap generated from the icon
+ * Pointer to bitmap generated from the icon.
*/
CFbsBitmap* iBitmap;
/**
* Pointer to the bitmap mask generated from the icon.
- * May be NULL if the original icon not not have mask.
*/
CFbsBitmap* iBitmapMask;
+ /**
+ * Scaled copy of the original icon bitmap.
+ */
+ CFbsBitmap* iBitmapScaledCopy;
+
+ /**
+ * Scaled copy of the original icon mask.
+ */
+ CFbsBitmap* iBitmapMaskScaledCopy;
+
CActiveListener *iActiveListener;
};
--- a/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcher.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcher.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -83,7 +83,7 @@
classHandles, "addElement", "(Ljava/lang/Object;)V");
jclass classTimestamps = aEnv->GetObjectClass(aTimestamps);
jmethodID methodTimestampsAddElement = aEnv->GetMethodID(
- classHandles, "addElement", "(Ljava/lang/Object;)V");
+ classTimestamps, "addElement", "(Ljava/lang/Object;)V");
jclass integerClass = aEnv->FindClass("java/lang/Integer");
jmethodID integerConstructor = aEnv->GetMethodID(
integerClass, "<init>", "(I)V");
--- a/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcherscanfrominbox.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/jadjarmatcher/jadjarmatcherscanfrominbox.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -143,7 +143,7 @@
TRAP(err, atta = iAttaMan->GetAttachmentFileL(attaInfo->Id()));
if (KErrNone == err)
{
- aResultArray.Insert(atta, 0);
+ aResultArray.InsertL(atta, 0);
}
}
}
@@ -206,7 +206,7 @@
TMsvEntry index = (*entry)[loop];
if (KUidMsgTypePOP3 == index.iMtm || KUidMsgTypeIMAP4 == index.iMtm)
{
- aRootEntryArray.Insert((*entry)[loop].Id(), 0);
+ aRootEntryArray.InsertL((*entry)[loop].Id(), 0);
}
}
}
@@ -245,7 +245,7 @@
if (index.Visible() && index.Complete() &&
!index.InPreparation() && !index.Deleted())
{
- aEntryArray.Insert(aId, 0);
+ aEntryArray.InsertL(aId, 0);
}
}
}
--- a/javamanager/javainstaller/installer/src.s60/utils/filewriter.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/utils/filewriter.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -26,6 +26,7 @@
#ifdef RD_JAVA_S60_RELEASE_5_0
#include <middleware/Oma2Agent.h>
#else
+#include <caf/cafplatform.h>
#include <mw/Oma2Agent.h>
#endif // RD_JAVA_S60_RELEASE_5_0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/src.s60/utils/propertylistener.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+* This class implements general wait object for calling
+* a callback function after subscribed P&S key value changes.
+*
+*/
+
+#include "propertylistener.h"
+#include "logger.h"
+
+using namespace java::installer;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CPropertyListener* CPropertyListener::NewL(TUid aUid, TUint aKey)
+{
+ CPropertyListener* self = new(ELeave) CPropertyListener(aUid, aKey);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+}
+
+CPropertyListener::CPropertyListener(TUid aUid, TUint aKey)
+ : CActive(CActive::EPriorityStandard), iUid(aUid), iKey(aKey)
+{
+}
+
+void CPropertyListener::ConstructL()
+{
+ User::LeaveIfError(iProperty.Attach(iUid, iKey));
+ // PropertyListener is always created from a thread which does
+ // not have ActiveScheduler, so create ActiveScheduler now.
+ iActiveScheduler = new(ELeave) CActiveScheduler;
+ CActiveScheduler::Install(iActiveScheduler);
+ // Add this object to the ActiveScheduler.
+ CActiveScheduler::Add(this);
+}
+
+CPropertyListener::~CPropertyListener()
+{
+ Cancel();
+ iProperty.Close();
+ if (iActiveScheduler)
+ {
+ delete iActiveScheduler;
+ iActiveScheduler = 0;
+ }
+}
+
+void CPropertyListener::ProcessEventsL(JNIEnv *aEnv, jobject aProvider)
+{
+ // Get the java side callback method.
+ jclass clazz = aEnv->GetObjectClass(aProvider);
+ jmethodID method = aEnv->GetMethodID(clazz, "valueChanged", "(I)V");
+
+ iEnv = aEnv;
+ iProvider = aProvider;
+ iMethod = method;
+
+ // Run propertyListener once so that the current property value
+ // gets delivered and property value changes are subscribed.
+ RunL();
+
+ // Start ActiveScheduler.
+ CActiveScheduler::Start();
+}
+
+void CPropertyListener::RunL()
+{
+ if (iCancelled)
+ {
+ CActiveScheduler::Stop();
+ return;
+ }
+
+ // Resubscribe before handling the new value to prevent missing updates.
+ iProperty.Subscribe(iStatus);
+ SetActive();
+
+ TInt value;
+ TInt err = iProperty.Get(value);
+ if (KErrNone == err)
+ {
+ //ILOG3(EJavaInstaller,
+ // "CPropertyListener::RunL: property value changed"
+ // ", uid: 0x%x, key: 0x%x, value: %d", iUid.iUid, iKey, value);
+ // Use callback method to deliver the changed property value to
+ // Java side object.
+ iEnv->CallVoidMethod(iProvider, iMethod, value);
+ }
+ else if (KErrNotFound == err)
+ {
+ // Property deleted, no actions needed.
+ }
+ else
+ {
+ // Error while reading property value.
+ ELOG3(EJavaInstaller,
+ "CPropertyListener::RunL: getting property value failed"
+ ", uid: 0x%x, key: 0x%x, err=%d", iUid.iUid, iKey, err);
+ }
+}
+
+void CPropertyListener::DoCancel()
+{
+ iCancelled = ETrue;
+ iProperty.Cancel();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/src.s60/utils/propertylistener.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+* This class implements general wait object for calling
+* a callback function after subscribed P&S key value changes.
+*
+*/
+
+#ifndef PROPERTYLISTENER_H
+#define PROPERTYLISTENER_H
+
+#include <e32base.h>
+#include <e32property.h>
+#include <jni.h>
+
+namespace java
+{
+namespace installer
+{
+
+/**
+ * This class implements wait object for calling a callback
+ * function after subscribed P&S key value changes.
+ */
+NONSHARABLE_CLASS(CPropertyListener) : public CActive
+{
+public: // Constructor and destructor
+
+ static CPropertyListener* NewL(TUid aUid, TUint aKey);
+
+ // Destructor.
+ virtual ~CPropertyListener();
+
+private:
+
+ // Constructor.
+ CPropertyListener(TUid aUid, TUint aKey);
+
+ // 2nd phase constructor.
+ void ConstructL();
+
+ // from base class CActive
+
+ void RunL();
+
+ void DoCancel();
+
+public: // Methods
+
+ void ProcessEventsL(JNIEnv *aEnv, jobject aProvider);
+
+private: // Data
+
+ CActiveScheduler* iActiveScheduler; // Owned
+
+ RProperty iProperty; // Property to listen
+ TUid iUid; // Property UID
+ TUint iKey; // Property key
+
+ JNIEnv *iEnv; // JNI environment, not owned
+ jobject iProvider; // Callback object
+ jmethodID iMethod; // Callback method
+
+ TBool iCancelled;
+};
+
+} // installer
+} // java
+
+#endif // PROPERTYLISTENER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/src.s60/utils/propertyprovider.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: The JNI code for Java Installer class FileWriter.
+*
+*/
+
+#include "com_nokia_mj_impl_installer_utils_PropertyProvider.h"
+#include "logger.h"
+#include "propertylistener.h"
+
+// NAMESPACE DECLARATION
+using namespace java::installer;
+using namespace java::util;
+
+/*
+ * Class: com_nokia_mj_impl_installer_utils_PropertyProvider
+ * Method: _subscribe
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_utils_PropertyProvider__1subscribe
+(JNIEnv */*aEnv*/, jclass, jint aCategory, jint aKey)
+{
+ TUid uid = TUid::Uid(aCategory);
+ TUint key = (TUint)aKey;
+ // Construct PropertyListener.
+ CPropertyListener* propertyListener = 0;
+ TRAPD(err, propertyListener = CPropertyListener::NewL(uid, key));
+ if (KErrNone != err)
+ {
+ ELOG3(EJavaInstaller,
+ "PropertyProvider__1subscribe: creating property listener "
+ "failed, uid: 0x%x, key: 0x%x, err=%d", uid.iUid, key, err);
+ return err;
+ }
+
+ // Return handle to session. Utilize the fact that in Symbian
+ // all pointer addresses are MOD 4 so the last 2 bits are 0
+ // and can be shifted out. This way the returned handle is
+ // always positive whereas Symbian error codes are always negative.
+ return reinterpret_cast<TUint>(propertyListener)>>2;
+}
+
+/*
+ * Class: com_nokia_mj_impl_installer_utils_PropertyProvider
+ * Method: _processEvents
+ * Signature: (ILcom/nokia/mj/impl/installer/utils/PropertyProvider;)I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_utils_PropertyProvider__1processEvents
+ (JNIEnv *aEnv, jclass, jint aHandle, jobject aProvider)
+{
+ CPropertyListener* propertyListener =
+ reinterpret_cast<CPropertyListener*>(aHandle<<2);
+ // Start propertyListener for event sending.
+ TRAPD(err, propertyListener->ProcessEventsL(aEnv, aProvider));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "PropertyProvider__1processEvents: initializing "
+ "propertyListener failed, err=%d", err);
+ }
+ return err;
+}
+
+/*
+ * Class: com_nokia_mj_impl_installer_utils_PropertyProvider
+ * Method: _unsubscribe
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_utils_PropertyProvider__1unsubscribe
+ (JNIEnv *, jclass, jint aHandle)
+{
+ CPropertyListener* propertyListener =
+ reinterpret_cast<CPropertyListener*>(aHandle<<2);
+
+ // Delete PropertyListener.
+ delete propertyListener;
+ propertyListener = 0;
+
+ return KErrNone;
+}
--- a/javamanager/javainstaller/installer/src.s60/utils/sysutil.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/src.s60/utils/sysutil.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -25,13 +25,20 @@
#include <sysutil.h>
#include <driveinfo.h>
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+#include "hbextendedlocale.h"
+#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+
#include "com_nokia_mj_impl_installer_utils_SysUtil.h"
+#include "javajniutils.h"
#include "logger.h"
#ifndef KPSUidJavaLatestInstallation
#define KPSUidJavaLatestInstallation 0x10282567
#endif
+using namespace java::util;
+
/**
* Helper method for creating HBufC from jstring.
*/
@@ -720,3 +727,21 @@
}
return value;
}
+
+/*
+ * Class: com_nokia_mj_impl_installer_utils_SysUtil
+ * Method: _isoToLang
+ * Signature: ()[Ljava/lang/String;
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_installer_utils_SysUtil__1isoToLang
+(JNIEnv *aEnv, jclass, jstring aLocale)
+{
+#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+ return HbExtendedLocale::ISOToSymbianLang(
+ QString::fromStdWString(JniUtils::jstringToWstring(aEnv, aLocale)));
+#else // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+ (void)aEnv; // suppress compilation warning about unused argument
+ (void)aLocale; // suppress compilation warning about unused argument
+ return -1;
+#endif // SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+}
--- a/javamanager/javainstaller/installer/tsrc/build/jiut.bat Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/tsrc/build/jiut.bat Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
@rem
-@rem Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+@rem Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
@rem All rights reserved.
@rem This component and the accompanying materials are made available
@rem under the terms of "Eclipse Public License v1.0"
@@ -14,8 +14,10 @@
@rem Description:
@rem
rem Script for running JavaInstaller unit tests from S60 eshell
-rem javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.NotificationPosterTest
-rem javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.DownloaderTest
+rem Start SifServer before running any tests
+sifserver
+javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.NotificationPosterTest
+javainstaller test -mainclass=com.nokia.mj.impl.installer.downloader.DownloaderTest
javainstaller test -mainclass=com.nokia.mj.impl.installer.storagehandler.OtaStatusHandlerTest
javainstaller test -mainclass=com.nokia.mj.impl.installer.integrityservice.IntegrityServiceTest
javainstaller test -mainclass=com.nokia.mj.impl.installer.jadjarmatcher.JadJarMatcherTest
@@ -32,4 +34,7 @@
javainstaller test -mainclass=com.nokia.mj.impl.installer.utils.AttributeReaderTest
javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerResultMessageTest
javainstaller test -mainclass=com.nokia.mj.impl.installer.GetComponentInfoTest
-rem javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest
+javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run1
+javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run2
+javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run3
+javainstaller test -mainclass=com.nokia.mj.impl.installer.InstallerEngineTest -param1=run4
--- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/GetComponentInfoTest.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/GetComponentInfoTest.java Thu Aug 19 09:48:13 2010 +0300
@@ -856,15 +856,11 @@
try
{
String value = aMsg.getStringValue(aName);
- assertTrue("Unexpected value " + aName + "=" + value, false);
- }
- catch (IllegalArgumentException iae)
- {
- // Expected exception.
+ assertTrue("Unexpected value " + aName + "=" + value, value == null);
}
catch (Throwable t)
{
- assertTrue("Incorrect exception for string value " + aName +
+ assertTrue("Unexpected exception for string value " + aName +
": " + t, false);
}
--- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/InstallerEngineTest.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/InstallerEngineTest.java Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -52,6 +52,8 @@
{
TestSuite suite = new TestSuite(this.getClass().getName());
+ String runIndex = System.getProperty("com.nokia.mj.impl.installer.test.param1");
+
if (Platform.isLinux())
{
// In S60 this would be interactive test, so disable it there.
@@ -64,6 +66,9 @@
}));
}
+ if (runIndex == null || runIndex.equalsIgnoreCase("run1"))
+ {
+ // Run 1
suite.addTest(new InstallerEngineTest("testMidletMessageOk", new TestMethod()
{
public void run(TestCase tc)
@@ -103,7 +108,11 @@
((InstallerEngineTest)tc).test3AppsOk();
}
}));
+ }
+ if (runIndex == null || runIndex.equalsIgnoreCase("run2"))
+ {
+ // Run 2
suite.addTest(new InstallerEngineTest("testDownloadJadOk", new TestMethod()
{
public void run(TestCase tc)
@@ -215,7 +224,11 @@
((InstallerEngineTest)tc).testNoJavaBinRoot();
}
}));
+ }
+ if (runIndex == null || runIndex.equalsIgnoreCase("run3"))
+ {
+ // Run 3
suite.addTest(new InstallerEngineTest("testBlockUninstall", new TestMethod()
{
public void run(TestCase tc)
@@ -239,7 +252,11 @@
((InstallerEngineTest)tc).testApplicationInfo();
}
}));
+ }
+ if (runIndex == null || runIndex.equalsIgnoreCase("run4"))
+ {
+ // Run 4
suite.addTest(new InstallerEngineTest("testInstallOptions", new TestMethod()
{
public void run(TestCase tc)
@@ -255,6 +272,7 @@
((InstallerEngineTest)tc).testInstallAuthAndBig();
}
}));
+ }
com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
}
@@ -310,6 +328,15 @@
}
/**
+ */
+ public String getTestServer()
+ {
+ String server = System.getProperty("com.nokia.mj.impl.installer.test.server");
+ assertNotNull("-server=<address>:<port> argument required.", server);
+ return server;
+ }
+
+ /**
* Makes installation, update and uninstallation for given application.
* Does the following steps:
* install with cancellation and check that app is not installed,
@@ -410,12 +437,12 @@
assertNoIsDir();
// List.
- Log.logOut("InstallerEngineTest.doInstallUninstall: list -v");
- result = Installer.mainWithResult(new String[] { "list", "-v" });
- assertResult(result, Installer.ERR_NONE);
- Log.logOut("InstallerEngineTest.doInstallUninstall: list -otastatus");
- result = Installer.mainWithResult(new String[] { "list", "-otastatus" });
- assertResult(result, Installer.ERR_NONE);
+ //Log.logOut("InstallerEngineTest.doInstallUninstall: list -v");
+ //result = Installer.mainWithResult(new String[] { "list", "-v" });
+ //assertResult(result, Installer.ERR_NONE);
+ //Log.logOut("InstallerEngineTest.doInstallUninstall: list -otastatus");
+ //result = Installer.mainWithResult(new String[] { "list", "-otastatus" });
+ //assertResult(result, Installer.ERR_NONE);
// Update with cancellation.
Log.logOut("InstallerEngineTest.doInstallUninstall: update with cancellation " + aFilename);
@@ -570,38 +597,38 @@
public void testDownloadJadOk()
{
Log.logOut("InstallerEngineTest.testDownloadJadOk begins");
- SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP");
- doInstallUninstall(suite, "http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_gcf.jsp", true, iDefaultOptions);
+ SuiteInfo suite = new SuiteInfo("HelloWorld", "Nokia");
+ doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/HelloWorld_ota.jad", true, iDefaultOptions);
}
public void testDownloadJarOk()
{
Log.logOut("InstallerEngineTest.testDownloadJarOk begins");
- SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP");
- doInstallUninstall(suite, "http://195.134.231.83:7070/omjserver/resources/omj/JBenchmark2.jar", false, iDefaultOptions);
+ SuiteInfo suite = new SuiteInfo("HelloWorld", "Nokia");
+ doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/HelloWorld.jar", false, iDefaultOptions);
}
public void testDownloadJadHttpRedirectOk()
{
Log.logOut("InstallerEngineTest.testDownloadJadHttpRedirectOk begins");
- SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP");
- doInstallUninstall(suite, "http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jad&count=5", true, iDefaultOptions);
+ SuiteInfo suite = new SuiteInfo("HelloWorld_redirect", "Nokia");
+ doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jad&count=5", true, iDefaultOptions);
}
public void testDownloadJarHttpRedirectOk()
{
Log.logOut("InstallerEngineTest.testDownloadJarHttpRedirectOk begins");
- SuiteInfo suite = new SuiteInfo("JBenchmark2", "Kishonti LP");
- doInstallUninstall(suite, "http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jar", false, iDefaultOptions);
+ SuiteInfo suite = new SuiteInfo("HelloWorld_redirect", "Nokia");
+ doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jar", false, iDefaultOptions);
}
public void testDownloadJadHttpAuthOk()
{
Log.logOut("InstallerEngineTest.testDownloadJadHttpAuthOk begins");
- SuiteInfo suite = new SuiteInfo("DS_Snow_http_auth", "DS_Effects");
+ SuiteInfo suite = new SuiteInfo("HelloWorld_http_auth", "Nokia");
iDefaultOptions.addElement("-username=guest");
iDefaultOptions.addElement("-password=guest");
- doInstallUninstall(suite, "http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", true, iDefaultOptions);
+ doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", true, iDefaultOptions);
}
public void testDownloadJadHttpAuthNok()
@@ -611,7 +638,7 @@
{
"install",
"-silent",
- "-jad=http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad",
+ "-jad=http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad",
};
int result = Installer.mainWithResult(args);
// Check result code.
@@ -622,7 +649,7 @@
iItu.isExceptionReason
(Installer.getExecuteException(),
InstallerErrorMessage.INST_CANCEL,
- InstallerDetailedErrorMessage.NO_MSG,
+ InstallerDetailedErrorMessage.INST_CANCEL,
OtaStatusCode.USER_CANCELLED));
assertTrue("installed app uid should not exist", Installer.iInstalledApps.length == 0);
}
@@ -634,7 +661,7 @@
{
"install",
"-silent",
- "-jad=http://195.134.231.83:7070/RedirectServlet/redirect?name=JBenchmark2.jad&count=6",
+ "-jad=http://" + getTestServer() + "/installertest/redirect?name=HelloWorld_redirect.jad&count=6",
};
int result = Installer.mainWithResult(args);
// Check result code.
@@ -677,7 +704,7 @@
{
"install",
"-silent",
- "-jad=http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_8mb_gcf.jsp",
+ "-jad=http://" + getTestServer() + "/installertest/HelloWorld_8mb.jad",
};
Log.log("InstallerEngineTest.testDownloadJadCancel: installation starts");
int result = Installer.mainWithResult(args);
@@ -690,7 +717,7 @@
iItu.isExceptionReason
(Installer.getExecuteException(),
InstallerErrorMessage.INST_CANCEL,
- InstallerDetailedErrorMessage.NO_MSG,
+ InstallerDetailedErrorMessage.INST_CANCEL,
OtaStatusCode.USER_CANCELLED));
assertTrue("installed app uid should not exist", Installer.iInstalledApps.length == 0);
Log.log("InstallerEngineTest.testDownloadJadCancel: end");
@@ -985,7 +1012,7 @@
callInstallerOk(new String[] { "list", "-systemproperties" });
callInstallerOk(new String[] { "launch", "-nouid" });
callInstallerOk(new String[] { "launch", "-uid=invaliduid" });
- callInstallerOk(new String[] { "uninstallall" });
+ callInstallerOk(new String[] { "uninstallall", "-silent" });
callInstallerOk(new String[] { "unregister" });
callInstallerOk(new String[] { "test", "-nomainclass" });
}
@@ -1106,10 +1133,10 @@
{
Log.logOut("InstallerEngineTest.testInstallAuthAndBig begins");
// Do first installation with doInstallUninstall helper
- SuiteInfo suite = new SuiteInfo("DS_Snow_http_auth", "DS_Effects");
+ SuiteInfo suite = new SuiteInfo("HelloWorld_http_auth", "Nokia");
iDefaultOptions.addElement("-username=guest");
iDefaultOptions.addElement("-password=guest");
- doInstallUninstall(suite, "http://195.134.231.83:7070/httpauth/DS_Snow_http_auth.jad", true, iDefaultOptions);
+ doInstallUninstall(suite, "http://" + getTestServer() + "/installertest/httpauth/HelloWorld_http_auth.jad", true, iDefaultOptions);
// Then start installation which downloads a large file.
Log.log("InstallerEngineTest.testInstallAuthAndBig begin to install big app");
@@ -1117,7 +1144,7 @@
{
"install",
"-silent",
- "-jad=http://195.134.231.83:7070/omjserver/resources/omj/T00000900_JBenchmark2_8mb_gcf.jsp",
+ "-jad=http://" + getTestServer() + "/installertest/HelloWorld_8mb.jad",
};
int result = Installer.mainWithResult(args);
// Check result code.
--- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistratorTest.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/ApplicationRegistratorTest.java Thu Aug 19 09:48:13 2010 +0300
@@ -374,12 +374,32 @@
appReg.startSession();
groupName = appReg.getGroupName(uid);
- assertTrue(
- "The group name was not VeryVeryLongGrou, it was " + groupName,
- "VeryVeryLongGrou".equals(groupName));
+ if (SifRegistrator.getSifMode() > 0)
+ {
+ // When USIF is in use ApplicationRegistrator should not
+ // have registered anything.
+ assertTrue(
+ "The group name was not empty, it was " + groupName,
+ "".equals(groupName));
+ }
+ else
+ {
+ assertTrue(
+ "The group name was not VeryVeryLongGrou, it was " + groupName,
+ "VeryVeryLongGrou".equals(groupName));
+ }
uidInUse = appReg.uidInUse(uid);
- assertTrue("uidInUse returned false value", true == uidInUse);
+ if (SifRegistrator.getSifMode() > 0)
+ {
+ // When USIF is in use ApplicationRegistrator should not
+ // have registered anything.
+ assertTrue("uidInUse returned true value", false == uidInUse);
+ }
+ else
+ {
+ assertTrue("uidInUse returned false value", true == uidInUse);
+ }
appReg.closeSession();
}
@@ -582,7 +602,16 @@
"".equals(groupName));
uidInUse = appReg.uidInUse(uid);
- assertTrue("uidInUse returned false value", true == uidInUse);
+ if (SifRegistrator.getSifMode() > 0)
+ {
+ // When USIF is in use ApplicationRegistrator should not
+ // have registered anything.
+ assertTrue("uidInUse returned true value", false == uidInUse);
+ }
+ else
+ {
+ assertTrue("uidInUse returned false value", true == uidInUse);
+ }
appReg.closeSession();
}
@@ -703,12 +732,32 @@
appReg.startSession();
groupName = appReg.getGroupName(uid);
- assertTrue(
- "The group name was not Suite, it was " + groupName,
- "Suite".equals(groupName));
+ if (SifRegistrator.getSifMode() > 0)
+ {
+ // When USIF is in use ApplicationRegistrator should not
+ // have registered anything.
+ assertTrue(
+ "The group name was not empty, it was " + groupName,
+ "".equals(groupName));
+ }
+ else
+ {
+ assertTrue(
+ "The group name was not Suite, it was " + groupName,
+ "Suite".equals(groupName));
+ }
uidInUse = appReg.uidInUse(uid);
- assertTrue("uidInUse returned false value", true == uidInUse);
+ if (SifRegistrator.getSifMode() > 0)
+ {
+ // When USIF is in use ApplicationRegistrator should not
+ // have registered anything.
+ assertTrue("uidInUse returned true value", false == uidInUse);
+ }
+ else
+ {
+ assertTrue("uidInUse returned false value", true == uidInUse);
+ }
appReg.closeSession();
}
--- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/SifRegistratorTest.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/applicationregistrator/SifRegistratorTest.java Thu Aug 19 09:48:13 2010 +0300
@@ -203,21 +203,34 @@
{
SuiteInfo si = getTestSuite();
ComponentId cid = getComponentId(si.getGlobalId());
- Uid uid = null;
- //Uid uid = sifReg.getUid(cid.getId());
- //assertTrue("Suite uid " + si.getUid() + " does not match" +
- // " to uid " + uid + " from SCR",
- // si.getUid().equals(uid));
- Vector apps = si.getApplications();
- for (int i = 0; i < apps.size(); i++)
- {
- cid = getComponentId(si.getGlobalId(i));
- uid = sifReg.getUid(cid.getId());
- assertTrue("Application uid " +
- ((ApplicationInfo)apps.elementAt(i)).getUid() +
- " does not match to uid " + uid + " from SCR",
- ((ApplicationInfo)apps.elementAt(i)).getUid().equals(uid));
- }
+
+ // Check for USIF Phase 2 registration.
+ Uid uid = sifReg.getUid(cid.getId());
+ assertTrue("Suite uid " + si.getUid() + " does not match" +
+ " to uid " + uid + " from SCR",
+ si.getUid().equals(uid));
+
+ Uid appUid = PlatformUid.createUid("[e0001001]");
+ sifReg.startSession(false);
+ ComponentId cidForApp = sifReg.getComponentId(appUid);
+ sifReg.closeSession();
+ assertTrue("Null component id from SCR for application uid " +
+ appUid, cidForApp != null);
+ assertTrue("Component id " + cid + " does not match" +
+ " to uid " + cidForApp + " from SCR",
+ cid.getId() == cidForApp.getId());
+
+ // Check for USIF Phase 1 registration.
+ //Vector apps = si.getApplications();
+ //for (int i = 0; i < apps.size(); i++)
+ //{
+ // cid = getComponentId(si.getGlobalId(i));
+ // uid = sifReg.getUid(cid.getId());
+ // assertTrue("Application uid " +
+ // ((ApplicationInfo)apps.elementAt(i)).getUid() +
+ // " does not match to uid " + uid + " from SCR",
+ // ((ApplicationInfo)apps.elementAt(i)).getUid().equals(uid));
+ //}
sifReg.closeSession();
}
catch (InstallerException ie)
@@ -324,16 +337,18 @@
private void assertSuiteExists(SuiteInfo aSuite, boolean aExists)
{
String not = (aExists? " not": "");
+ // Check for USIF Phase 2 registration.
ComponentId cid = getComponentId(aSuite.getGlobalId());
- //assertTrue("Suite " + aSuite.getGlobalId() + not +
- // " found from SCR", (aExists? cid != null: cid == null));
- Vector apps = aSuite.getApplications();
- for (int i = 0; i < apps.size(); i++)
- {
- cid = getComponentId(aSuite.getGlobalId(i));
- assertTrue("Application " + aSuite.getGlobalId(i) + not +
- " found from SCR", (aExists? cid != null: cid == null));
- }
+ assertTrue("Suite " + aSuite.getGlobalId() + not +
+ " found from SCR", (aExists? cid != null: cid == null));
+ // Check for USIF Phase 1 registration.
+ //Vector apps = aSuite.getApplications();
+ //for (int i = 0; i < apps.size(); i++)
+ //{
+ // cid = getComponentId(aSuite.getGlobalId(i));
+ // assertTrue("Application " + aSuite.getGlobalId(i) + not +
+ // " found from SCR", (aExists? cid != null: cid == null));
+ //}
}
private void logSuite(SuiteInfo aSuite)
--- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/customisationproperties/CustomisationPropertiesTest.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/customisationproperties/CustomisationPropertiesTest.java Thu Aug 19 09:48:13 2010 +0300
@@ -212,18 +212,18 @@
String drive = (String)value.firstElement();
assertTrue("PossibleInstallationDrives is null", (drive != null));
- assertTrue("First PossibleInstallationDrive is not C:", drive.equals("C:"));
+ assertTrue("First PossibleInstallationDrive is not C:, it is " + drive, drive.equals("C:"));
// second possible drive
drive = (String)value.get(1);
assertTrue("PossibleInstallationDrives is null", (drive != null));
- assertTrue("Second PossibleInstallationDrive is not E:", drive.equals("E:"));
+ assertTrue("Second PossibleInstallationDrive is not E:, it is " + drive, drive.equals("E:"));
value = cust.getIntegerProperty(CustomisationProperties.PossibleInstallationDrives);
assertTrue("PossibleInstallationDrives value is null", (value != null));
assertTrue("PossibleInstallationDrives value does not contain any integers", (value.size() > 0));
Integer idrive = (Integer)value.get(1);
- assertTrue("Second PossibleInstallationDrive is E:", idrive.intValue() == 4);
+ assertTrue("Second PossibleInstallationDrive is not E:, it is " + idrive, idrive.intValue() == 4);
}
public void testTypesOfPossibleInstallationDrives()
--- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/DownloaderTest.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/DownloaderTest.java Thu Aug 19 09:48:13 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"
@@ -37,8 +37,8 @@
*/
public class DownloaderTest extends TestCase implements InstallerMain
{
- private static final String TEST_URL = "http://195.134.231.83:7070/java-server/resources/DS_Snow.jar";
- private static final int TEST_URL_SIZE = 10241; // test data file size
+ private static final String TEST_URL = "/installertest/HelloWorld.jar";
+ private static final int TEST_URL_SIZE = 1511; // test data file size
// Begin j2meunit test framework setup
@@ -172,10 +172,15 @@
public void testBasicDownload(Downloader downloader,
TestDlListener listener)
{
+ String server = System.getProperty(
+ "com.nokia.mj.impl.installer.test.server");
+ assertNotNull("-server=<address>:<port> argument required.", server);
+
try
{
String filename = "test.dat";
- DownloadInfo dlInfo = new DownloadInfo(TEST_URL, filename);
+ DownloadInfo dlInfo = new DownloadInfo("http://" + server
+ + TEST_URL, filename);
downloader.start(dlInfo);
downloader.waitForCompletion();
assertTrue("Result DlInfo is null",
--- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/NotificationPosterTest.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/downloader/NotificationPosterTest.java Thu Aug 19 09:48:13 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"
@@ -36,7 +36,7 @@
*/
public class NotificationPosterTest extends TestCase implements InstallerMain
{
- private static final String TEST_URL = "http://195.134.231.83:7070/java-server/getresult.jsp?phone=CE0CBA106ADB77A9298A143E5136CD2B&tID=900_success";
+ private static final String TEST_URL = "/installertest/notify?tID=900_success";
// Begin j2meunit test framework setup
@@ -361,13 +361,18 @@
testNotifyPendingFailureLimit(poster);
}
- private static OtaStatusNotification createNotification(int aIndex)
+ private OtaStatusNotification createNotification(int aIndex)
{
+ String server = System.getProperty(
+ "com.nokia.mj.impl.installer.test.server");
+ assertNotNull("-server=<address>:<port> argument required.", server);
+
OtaStatusNotification notification = new OtaStatusNotification
(PlatformUid.createUid(Integer.toString(aIndex)),
System.currentTimeMillis(),
OtaStatusNotification.TYPE_INSTALL, OtaStatusCode.SUCCESS,
- TEST_URL + aIndex, System.currentTimeMillis(), 0);
+ "http://" + server + TEST_URL + aIndex, System.currentTimeMillis(),
+ 0);
return notification;
}
--- a/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/utils/SysUtilTest.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installer/tsrc/javasrc/com/nokia/mj/impl/installer/utils/SysUtilTest.java Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -33,6 +33,8 @@
*/
public class SysUtilTest extends TestCase implements InstallerMain
{
+ private int iPropertyValue = 0; // Used in testPropertyListener test case.
+
// Begin j2meunit test framework setup
public void installerMain(String[] args)
@@ -167,6 +169,49 @@
}
}));
+ if (Platform.isS60())
+ {
+ suite.addTest(new SysUtilTest("testPropertyListener", new TestMethod()
+ {
+ public void run(TestCase tc)
+ {
+ ((SysUtilTest)tc).testPropertyListener();
+ }
+ }));
+
+ suite.addTest(new SysUtilTest("testGetProcessState", new TestMethod()
+ {
+ public void run(TestCase tc)
+ {
+ ((SysUtilTest)tc).testGetProcessState();
+ }
+ }));
+
+ suite.addTest(new SysUtilTest("testDriveGetters", new TestMethod()
+ {
+ public void run(TestCase tc)
+ {
+ ((SysUtilTest)tc).testDriveGetters();
+ }
+ }));
+
+ suite.addTest(new SysUtilTest("testGetScreenSize", new TestMethod()
+ {
+ public void run(TestCase tc)
+ {
+ ((SysUtilTest)tc).testGetScreenSize();
+ }
+ }));
+
+ suite.addTest(new SysUtilTest("testIsoToLang", new TestMethod()
+ {
+ public void run(TestCase tc)
+ {
+ ((SysUtilTest)tc).testIsoToLang();
+ }
+ }));
+ }
+
com.nokia.mj.impl.utils.OmjTestRunner.run(suite);
}
@@ -198,11 +243,11 @@
{
try
{
- // Test PS keys defined in ScreensaverInternalPSKeys.h
- Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver
- int key = 0x00000001; // KScreenSaverPreviewMode
+ // Test PS keys defined in hwrmpowerstatesdkpskey.h
+ Uid uid = PlatformUid.createUid("0x10205041"); // KPSUidHWRMPowerState
+ int key = 0x00000003; // KHWRMChargingStatus
int value = SysUtil.getPropertyValue(uid, key);
- assertTrue("KScreenSaverPreviewMode(!=0): " + value, value == 0);
+ assertTrue("KHWRMChargingStatus(!=0): " + value, value == 0);
}
catch (InstallerException ie)
{
@@ -215,8 +260,8 @@
{
try
{
- // Test PS keys defined in ScreensaverInternalPSKeys.h
- Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver
+ // Test PS keys defined in hwrmpowerstatesdkpskey.h
+ Uid uid = PlatformUid.createUid("0x10205041"); // KPSUidHWRMPowerState
int key = 0x00000010; // Undefined key
int value = SysUtil.getPropertyValue(uid, key);
assertTrue("Getting undefined property value did not fail", false);
@@ -231,13 +276,12 @@
{
try
{
- // Test PS keys defined in ScreensaverInternalPSKeys.h
- Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver
- int key = 0x00000001; // KScreenSaverPreviewMode
- // Set screensaver preview mode on (stays on for 10 secs).
+ Uid uid = SysUtil.PROP_CATEGORY_SYSTEM;
+ long key = SysUtil.PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS;
SysUtil.setPropertyValue(uid, key, 1);
int value = SysUtil.getPropertyValue(uid, key);
- assertTrue("KScreenSaverPreviewMode(!=1): " + value, value == 1);
+ assertTrue("PROP_KEY_JAVA_LATEST_INSTALLATION_PROGRESS(!=1): " +
+ value, value == 1);
}
catch (InstallerException ie)
{
@@ -250,9 +294,8 @@
{
try
{
- // Test PS keys defined in ScreensaverInternalPSKeys.h
- Uid uid = PlatformUid.createUid("0x101F8771"); // KPSUidScreenSaver
- int key = 0x00000010; // Undefined key
+ Uid uid = SysUtil.PROP_CATEGORY_SYSTEM;
+ int key = 0x00000100; // Undefined key
SysUtil.setPropertyValue(uid, key, 1);
assertTrue("Setting undefined property value did not fail", false);
}
@@ -339,11 +382,12 @@
{
try
{
- // Test CenRep keys defined in ScreensaverInternalCRKeys.h
- Uid uid = PlatformUid.createUid("0x101F8770"); // KCRUidScreenSaver
- long key = 0x00000004; // KScreenSaverInvertedColors
+ // Test CenRep keys defined in Java security.
+ Uid uid = PlatformUid.createUid("0x2001B289"); // KJavaSecurity
+ long key = 0x00000004; // KJavaSecurity/KWarningsMode
int value = SysUtil.getRepositoryValue(uid, key);
- assertTrue("KScreenSaverInvertedColors(!=0): " + value, value == 0);
+ assertTrue("KJavaSecurity/KWarningsMode(!=2): " + value,
+ value == 2);
}
catch (InstallerException ie)
{
@@ -375,8 +419,8 @@
Uid uid = SysUtil.REPO_ID_JAVA_INST_VARIATION;
long key = SysUtil.REPO_KEY_JAVA_INST_SHELL_FOLDER_VALUE;
String value = SysUtil.getRepositoryStringValue(uid, key);
- //assertTrue("Unexpected value: " + value, "Games,Applications".equals(value));
- assertTrue("Unexpected value: " + value, "".equals(value));
+ assertTrue("Unexpected value: " + value, "Games,Applications".equals(value));
+ //assertTrue("Unexpected value: " + value, "".equals(value));
}
catch (InstallerException ie)
{
@@ -573,4 +617,126 @@
// OK, expected exception.
}
}
+
+ public void testPropertyListener()
+ {
+ final int category = 0x101f75b6;
+ final int key = 0x20019546;
+ final int value = 15;
+ final Object synchObject = this;
+ PropertyListener listener = new PropertyListener()
+ {
+ public void valueChanged(int aCategory, int aKey, int aValue)
+ {
+ try
+ {
+ if (aValue == 0)
+ {
+ // Ignore the first event which is sent when
+ // subscription is made.
+ return;
+ }
+ synchronized (synchObject)
+ {
+ iPropertyValue = aValue;
+ Log.log("PropertyListener.valueChanged: " + aValue +
+ " (" + aCategory + ", " + aKey + ")");
+ if (aCategory != category)
+ {
+ Log.logError("PropertyListener.valueChanged: " +
+ "invalid category " + aCategory);
+ }
+ if (aKey != key)
+ {
+ Log.logError("PropertyListener.valueChanged: " +
+ "invalid key " + aKey);
+ }
+ synchObject.notify();
+ }
+ }
+ catch (Throwable t)
+ {
+ Log.logError("PropertyListener.valueChanged exception", t);
+ }
+ }
+ };
+ try
+ {
+ iPropertyValue = 0;
+ SysUtil.setPropertyValue(
+ PlatformUid.createUid(category), key, iPropertyValue);
+ PropertyProvider provider = new PropertyProvider();
+ provider.subscribe(category, key, listener);
+ SysUtil.setPropertyValue(
+ PlatformUid.createUid(category), key, value);
+ try
+ {
+ synchronized (synchObject)
+ {
+ if (iPropertyValue == 0)
+ {
+ synchObject.wait(2000);
+ }
+ }
+ }
+ catch (InterruptedException ie)
+ {
+ }
+ provider.unsubscribe();
+ assertTrue("Unexpected property value after test: " +
+ iPropertyValue, iPropertyValue == value);
+ }
+ catch (Throwable t)
+ {
+ Log.logError("testPropertyListener exception", t);
+ assertTrue("Unexpected exception " + t, false);
+ }
+ }
+
+ public void testGetProcessState()
+ {
+ int state = SysUtil.getProcessState(PlatformUid.createUid("[102033e6]"));
+ assertTrue("installer process state is " + state +
+ ", not " + SysUtil.PROC_STATE_ALIVE,
+ SysUtil.PROC_STATE_ALIVE == state);
+ state = SysUtil.getProcessState(PlatformUid.createUid("[e0001001]"));
+ assertTrue("nonexisting process state is " + state + ", not 0",
+ 0 == state);
+ }
+
+ public void testDriveGetters()
+ {
+ int defMem = SysUtil.getDefaultPhoneMemory();
+ int defMassStorage = SysUtil.getDefaultMassStorage();
+ Log.log("testDriveGetter: defaultPhoneMemory = " + defMem);
+ Log.log("testDriveGetter: defaultMassStorage = " + defMassStorage);
+ }
+
+ public void testGetScreenSize()
+ {
+ int screenWidth = SysUtil.getScreenWidth();
+ int screenHeight = SysUtil.getScreenHeight();
+ Log.log("testGetScreenSize: screenWidth = " + screenWidth);
+ Log.log("testGetScreenSize: screenHeight = " + screenHeight);
+ assertTrue("screenWidth <= 0", screenWidth > 0);
+ assertTrue("screenHeight <= 0", screenHeight > 0);
+ }
+
+ public void testIsoToLang()
+ {
+ testIsoToLang("unknown", -1); // unknown locale is indicated with -1
+ testIsoToLang("fi", 9); // ELangFinnish, Finnish
+ testIsoToLang("fi_FI", 9); // ELangFinnish, Finnish
+ testIsoToLang("sv", 6); // ELangSwedish, Swedish
+ testIsoToLang("sv_FI", 85); // ELangFinlandSwedish, Finland Swedish
+ testIsoToLang("en", 1); // ELangEnglish, UK English
+ testIsoToLang("en_US", 10); // ELangAmerican, American
+ testIsoToLang("en_AU", 20); // ELangAustralian, Australian English
+ }
+
+ private void testIsoToLang(String aLocale, int aLang)
+ {
+ assertTrue("SysUtil.isoToLang " + aLocale + " != " + aLang,
+ SysUtil.isoToLang(aLocale) == aLang);
+ }
}
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000019.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000046.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000058.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000070.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000090.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000150.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000172.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000175.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000182.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000189.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000250.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000305.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000390.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000500.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000582.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000618.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/00000703.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/3DSpaceShooter.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,18 @@
+
+MIDlet-1: 3DSpaceShooter, /icon.png, Sapce3D
+
+
+MIDlet-Jar-Size: 240229
+
+
+MIDlet-Jar-URL: 3DSpaceShooter.jar
+MIDlet-Name: 3DSpaceShooter
+MIDlet-Vendor: Innovative Ideas From Outer Space Ltd.
+
+
+
+
+
+MIDlet-Version: 1.0.4
+Nokia-MIDlet-Original-Display-Size: 176,208
+Nokia-MIDlet-On-Screen-Keypad: navigationkeys
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/800_x_N97_64GB_fr_speed_v5_32_01.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,99 @@
+RepositoryContentType: text/plain
+UserAgent: NokiaN95/J2ME-IMPS
+ShowStatusTextInCL: 0
+SpaceBetweenFriendsNameAndHisIcon: 3
+ShowDomain: 0
+MIDlet-Icon: /img/App.png
+NormalPollRate: 12000
+TCPCIREnabled: 1
+Images: http://download.ko.mysite.fr/koi/j2me/enc/1111/
+SpecialKeys: -12
+Host: koi.ko.mysite.fr
+TCPPingRate: 1560000
+EnableCommunitySelector: 1
+BackgoundImgPos: 0
+ScrollBarWidth: 5
+MIDlet-Vendor: Vodafone
+BillingURL: http://koi.ko.mysite.fr/koi/sq.dll/awo_buy
+UseTemplate: 1
+MaxFriendsNumber: 150
+StopTCPCIR: 1
+MIDlet-Version: 4.5.27
+SelectCommand: 1
+KeepAlive: 1500000
+SMSCIREnabled: 1
+MultiTrans: 5
+DefaultDomain: gmaeam1.com
+EnableBackgroundImage: 0
+MicroEdition-Profile: MIDP-2.0
+TermsAndConditions: 1
+SeamlessLogin: 0
+GlobalMsgLength: 600
+MIDlet-Push-1: sms://:3716, ui.Main, *
+RegisterConnection: 1
+ViewType: 0
+HTTPCIREnabled: 1
+IsTabFontBold: 1
+AboutNaming: PrerryLake_h_N97_fr_speed_v4_5_27
+InitMessage: 1
+MicroEdition-Configuration: CLDC-1.0
+MIDlet-Jar-URL: 800€_x_N97_64GB_fr_speed_v5_32_01.jar
+AnimationRate: 300
+Multitask: 0
+EnableSemitransparentHighlight: 0
+CheckContentType: 1
+MaxMsgNumber: 30
+Port: 80
+LoginURL: http:/koi.ko.mysite.fr/koi/sq.dll/dsw_daas
+UseKeepAlive: 0
+MIDlet-Install-Notify: http://download.ko.mysite.fr/InstallNotify?c=
+SelfUpgrade: 1
+MIDlet-Data-Size: 500
+AnimationEnabled: 1
+TitleUpdateRate: 7000
+EnableRenameFriend: 0
+SystemMessageUserTimeout: 25000
+Help: http://download.ko.mysite.fr/koi/j2me/enc/help/fr/
+UseDeviceTimeForIncomingMsg: 1
+TCPCIRReconnectCount: 3
+DefaultLanguage: de
+MIDlet-1: Messenger,/img/App.png,ui.Main
+MsgListHeightTuner: 8
+MIDlet-Name: Messenger
+FontSize: 0
+WVExtension: /web/wv.dll/msn_imgw
+RefreshChoiceOnStateChange: 0
+MIDlet-Permissions: javax.microedition.io.Connector.http,javax.microedition.io.Connector.https,javax.microedition.io.Connector.socket,javax.microedition.io.Connector.sms,javax.wireless.messaging.sms.receive,javax.microedition.io.PushRegistry,javax.microedition.media.control.VideoControl.getSnapshot,javax.microedition.io.Connector.file.read,javax.microedition.io.Connector.file.write
+MaxConversations: 20
+SubscribePresence: 1
+PersistencyEnabled: 1
+RepositoryAlertMessage: Error loading application data. Please try again later.
+GlobalMaxCharCount: 5000
+EnableEmoticonsSelector: 1
+IdleMode: 1
+SpacerHeight: 5
+TCPCIRReconnectRate: 3000
+MIDlet-Jar-Size: 502719
+BackgroundEnabled: 1
+IsCaseInsensitive: 1
+AlertToneMsg: http://download.ko.mysite.fr/koi/j2me/enc/dingdong.mp3
+NormalNoPollTransition: 1800000
+AlertToneContact: http://download.ko.mysite.fr/koi/j2me/enc/alalal.mp3
+NoPollStateEnabled: 0
+Device: 3
+SupportCustomUTF8: 0
+MIDlet-Info-URL: www.koikoikoi.com
+MsgListWidthTuner: 15
+CommandsType: 1;4;2;4;3;8;5;4;6;2;8;2;9;7;10;4;11;8;23;4;24;3;37;2;68;2;69;7;76;4;80;2;86;6;87;1
+IdleModeTimeOut: 900000
+ShowAboutLogo: 1
+TopMarginFriendName: 2
+ContentLanguage: fr
+FastPollRate: 7000
+NokiaTimeOut: 100
+FastNormalTransition: 20000
+EnableShortProfile: 1
+RepositoryVersion: 1
+MIDlet-Jar-RSA-SHA1: QhSjP7F1q3TGmmNC45cUGclVWB537GtcMLpplIJGe+TyDwJ1Mx5VssNHpp3Qs3C1WHLycvcfOkDT0CscStI0lV/5Xy33z192qEHIT5lkGVz1Rd1nfBHqrIBqv77H7dHW1tdU6RiVajx8jrYYXz+Yh/7U2kskmGXd0bLSYq2cuZZgkiT9YDOLa8OJ1Xn2U4/AYzonM1tjGQvkOniCvwqv0DXDW3GAial5w7hzB4txSopBgWiCO7sEPgkssJIvWQ2dsuLnwb3nU8gsUYWuRqidSI5Dm8mSOEA0zjRoREjTJjkqRZXX3r27rtp+omYh+VNCkXDneiNcaihWpkW5TgMhVg==
+MIDlet-Certificate-1-1: MIIEOTCCAyGgAwIBAgILAQAAAAABFIeLkAEwCQYJKoZIhvcNAQEFBQAwUDELNAkGA1UEBhMCVVsxFzAVBgNVBAoIDlZvZGFmb25lIEdyb3VwMSgwJgYDVQQDEx9Wb2RhZm9uZSAoVHJ1c3RlZCBBcHBsaWNhdGlvbnMpMB4XDTA3MDgyMTA4MzA0NFoXDTEyMDgyMTA4MzA0NFowTzELMAkGA1UEBhMCU0cxFDASBgNVBAoTC05ldXN0YXIgTkdNMSowKAYDVQQDEyFNb2JpbGUgSW5zdGFudCBNZXNzYWdpbmcgMjEuMDguMDcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCFfdEngntebK38dtsdODIkNzMiYsngpTwgnDPqV23m/OtsCX1+1E3+ns9v7EPQVqeTuPYUbUiQRXAYE2NpnUjzNd4bKIXBlk18YpXftMxKv4XRvtVa273O/nbKigtR9IuJx2Pz/x/zWbDpc4ZitRQaRTHy0oA1W+htVI1BBzO8cFC3kf4DTNEXjeYHGF5U7deGp/KuN8qfN7QPJ5gtYyUcwYtrV9imc7P2idLFfYGejm7/s/R3qh9o3bIvqLSHUQbwTQNz7bA7QzpBYkSgaQqzif8+ZYRZuLApjbhpoM5XRFUwQCu6KXx7ZPMKoCKVjof20LWlilUiBrVIXMIwHq0tAgMBAAGjggETMIIBDzAOBgNVHQ8BAf8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwUgYDVR0fBEswSTBHoEWgQ4ZBaHR0cDovL2NybC52b2RhZm9uZS1wa2kuY29tL2NybC52L1ZvZGFmb25lVHJ1c3RlZEFwcGxpY2F0aW9ucy5jcmwwOAYIKwYBBQUHAQEELDAqMCgGCCsGAQUFBzABhhxodHRwOi8vb2NzcC52b2RhZm9uZS1wa2kuY29tMBoGA1UdIAQTMBEwDwYNKoY6AAHv9U8BAQMBAzAfBgNVHSMEGDAWgBQ7En6Wl4emCf8AlmWvsw/TeSSR9DAdBgNVHQ4EFgQUadzkP7g69+F/NQGoOfvOG1PC6YowDQYJKoZIhvcNAQEFBQADggEBAK2Z4qE4EFlXYL3ELnsbV/Ri6igPgdXgSZalaw8IKorw19TX7ERpL2tCiyDqisEJygNLW2iok9Nn3DUsmJTr0CoSZFGZc88hkJ9mlDTCQnNa9Hx9XQhp3Ig0uo1Eoei+12kF9j1kVlQJl6QkOPrbdmBbGpv7NFTM29zkPN/4wt3uUvoLZ/ZlbB4NjufZ6gVL77Bt2+UNwKLM4wF39Dy3zTD6qcJPuitGGSss0X4SYX6AzTtNRM+CtTPkFby10pHmmr4ClSfGtOZnXmbGizOIUh/lgOgv/nG9Q+dRDUGDTkhnDwMs1b0reQ0rGE1jFayCJ6Rmn/03FIN5N1SKfgkSeBE=
+MIDlet-Certificate-1-2: MIIECjCCAvKgAwIBAgIFAwEAAzANBgkqhkiG9w0BAQUF8DBLMQswCQYDVQQGEwJVSzEXNBUGA1UEChMOVm9kYWXvbmUgR3JvdXAxIzAhBgNVBAMTGlZvZGFmb25lIChPcGVyYXRvciBEb21haW4pMB4XDTA1MDYxMzExMDAwMFoXDTIxMTIzMTEyMDAwMFowUDELMAkGA1UEBhMCVUsxFzAVBgNVBAoTDlZvZGFmb25lIEdyb3VwMSgwJgYDVQQDEx9Wb2RhZm9uZSAoVHJ1c3RlZCBBcHBsaWNhdGlvbnMpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvfev7oXJy+WKdRjmc2i+Y8vMI3ey/LggGtOhGhY7w1oH1puYttgAjwPP7Ff2qObaJyfFnX81aCopQWeymGzpJtcIv/Z5sZRayBw9ceNIqI7WrwS3Ht//4uqUIH0p6VtPuRukNAnJewbFGgImowwZI4sizQ5Idqxx14lUoOTw8EaE0ygwXSJefS1w/5vuShyujd22F3wHpQnjo/lf05y14x43Uf+PpfFoVzvKm8q/n4VMtzMwi04vkgPjkflT2yay8WWtEpxU6rw8j32EWM/A2+kd4YbTE50I9/XFmIitHajaPVB3piwsChSt4d89UyIP/a+xGkPMultznEdH23SptQIDAQABo4HwMIHtMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBQ7En6Wl4emCf8AlmWvsw/TeSSR9DAZBgNVHSAEEjAQMA4GDCqGOgAB7/VPAQEDATBNBgNVHR8ERjBEMEKgQKA+hjxodHRwOi8vY3JsLnZvZGFmb25lLXBraS5jb20vY3JsLnYvVm9kYWZvbmVPcGVyYXRvckRvbWFpbi5jcmwwHQYDVR0lBBYwFAYIKwYBBQUHAwMGCCsGAQUFBwMJMB8GA1UdIwQYMBaAFEjdPe/gPJzfErEw/ZHhwen7l9wIMA0GCSqGSIb3DQEBBQUAA4IBAQCaehJEHzna6onjE8bCCsi7A5NxcQ2Cx85PYs67yxQZ0wMQq1khzxsOJPB7H4SoXlceNMvIxpgPFm/ZcLNdeyjoYOQccH+aS6GRSerYX3COdbtWA4Gjq/sB6ghoUZ74+VbXD3t9Rhrnt7fOMe1llWOcf/eoMmvOrJOrBPrC3ZxZEwyHAgyqEJDn2Z8KXTMUr41jge3KyhxRehflRcYhdXzwmE+8LOHaN7xLEZauOuafyBEVpjVN5UaaOm/v8mTn0TymV2j9R7D8Nycbz1gVeMrOhNW2GODxjvu5IoEHQh/myul28EecKGx05Xprcodr0a8Q6LKJg+ihJMxMrS3YEylp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,10 @@
+MIDlet-Jar-URL: https://uljava.gjmptw.de/midlets/harmonized/Local%20Connectivity%20(BT%20and%20IrDa)/BCExchanger/BCExchanger.jar
+MIDlet-Install-Notify: https://uljava.gjmptw.de/Index/Index.php/BCExchanger.jad?installed=BCExchanger_harmony
+MIDlet-1: BCExchangerMIDlet, /icon.png, bcexchanger.BCExchangerMIDlet
+MIDlet-Description: Demonstrates the usage of the JSR-82 Bluetooth OBEX API by exchanging business cards between devices.
+MIDlet-Jar-Size: 29967
+MIDlet-Name: BCExchanger
+MIDlet-Vendor: Forum Nokia
+MIDlet-Version: 1.0.0
+MicroEdition-Configuration: CLDC-1.1
+MicroEdition-Profile: MIDP-2.0
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/BCExchanger.zip has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/DevCertTestMIDlet.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,14 @@
+MIDlet-1: DevCertTestMIDlet, , com.nokia.midp.test.devcerttests.DevCertTestMIDlet
+MIDlet-Jar-Size: 3152
+MIDlet-Jar-URL: DevCertTestMIDlet.jar
+MIDlet-Name: DevCertTestMIDlet
+MIDlet-Permissions: javax.microedition.pim.ContactList.read,javax.microedition.pim.ContactList.write,javax.microedition.io.Connector.http
+MIDlet-Permissions-Opt: javax.microedition.io.Connector.https
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-2.0
+httpUrl: http://www.google.com
+httpsUrl: https://www.google.com
+MIDlet-Certificate-1-1: MIJs7jCCbFegAwIBAgIJAPNUaScSr5cxMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9EZXZpY2VfTWFudWZhY3R1cmVyMB4XDTA5MDkxNjExNDk1M1oXDTEwMDkxNjExNDk1M1owNTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFDASBgNVBAMTC0phdmFEZXZDZXJ0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXZ/GCV/N8foAkCQJfoiwGlwHO+f1lV9zloo0r0zosGtVqItLXKrvXEKylpOVWBygRVVrkl30Y1Cxess4aS1UmZ1rcvwL0jcvwlkZGacJazjtHE4UQuYJz9WRbYOaQxR2SVS/wU2Ptu/mr0ZgqFhgaJ1FzCuBdNaWzx2mGV9az/QIDAQABo4JqxjCCasIwKQYDVR0gBCIwIDAOBgwrBgEEAV4BMQEBAwQwDgYMKwYBBAEqAm4CAgICMA4GA1UdDwEB/wQEAwIHgDAXBgNVHSUEEDAOBgwrBgEEAV4BMQECAgMwgmpqBgwrBgEEAV4BMQECAgcBAf8EgmpVMIJqUQwPMDA0NDAxMDE1MDc2OTU5DA8xNDM3MjU3ODc0MDc3MzAMDzAwNDQwMTEwNDIzNjk4NQwPODUxODA4MzAxNzgwMzcwDA84MzYwMTU2MDMxNDY4MjgMDzM2ODYxNzM4NzAzNzM4MAwPNzY2NjI2NTYyMDM3MzI4DA84NjgwMjIwNjUxODczMTgMDzQ3NTEzNTQ0MzEwMzQwNAwPNDY0NTI4NzEzODY1MDY1DA84NjEyMTU3NzIwMDczODUMDzQwNzQ3NTAzMTI1NjYxOAwPNzQxMDY1MDUxNDE1ODI2DA81MzI1MTM4NTc4MzM1NTMMDzA4ODQ1NDM0Mjg4ODg2NQwPMTY1MTEwMDA3ODE1NTE2DA83NzYwMTU4NDUzNDgyODgMDzIyNTUzNTY4NjA4ODYwNQwPNDUzNTUyMTc2Mzc2MjcyDA8zNTAwNTM1MjQxMzMyMDYMDzg4NzU3ODg4NzM2MTM0NwwPNzgxODA1MjY0ODE0MzQyDA8yNTM4ODg2NzUzNzUxMjgMDzMyODczMzE2Nzc1MDg1OAwPMjA2Mzg1NDYyMTM4MjUyDA82NTA1NTIwNDcyMjIzNDMMDzA2MjQ4NzM2NTAxMzMyNgwPMzM4NjAxODY2NTcwMzcwDA8yNzcwMTgyMTEyODYzMzYMDzA3MDE2MzQ1MzQ3MzExMwwPMDM3MDI1ODcxMzE3ODc3DA81MjMyNDMzODgyMDA0NDIMDzg1NTcwODIzMzAyNjQzMQwPNTQzNDU4MzEzMzc1ODI1DA80MDgwMzUwNTQxODIxNzcMDzcxNjYyMjEzMzMzMjEzNAwPMTAzNzY1NTEwNDcwODQ3DA80NjAxNzgwODEwMTQ0NjYMDzMxMDYxMTQzNzY2NDUyMAwPMDQwMjM1MTMxMDE3NjI0DA8xNTIyMzUzNjA1MDg1NDQMDzc1NjU3Mjc2NDI1ODE3NQwPNjcwNjcyMTIyMzAzMjU3DA83NzUyNjU0NzQ3MjgwMjMMDzQyMTgwMzg1MjE0MjE2NQwPODE0MTcxODU0NjQ4MjcyDA80Mzg2MTIwNDczMDY2MzUMDzY2ODA4ODQ1MjM3NDAxNAwPMjMwMDgyNjEzNDYzNTM2DA8yODA4MTYyMjMyMTExMTYMDzc4MjM3MzE2NzgwMTgwMwwPMDYyNjU3NTgwODMxODMxDA82NzI0Njg2NDc0NTUwNTYMDzgyNTUyODAzMjY0NzQ0MwwPNDU2MzAxNTA4NzEwMDMzDA8xODgzMTg4MjAzNjI0NTcMDzQ4NDM3NjExMDUzNDQyMgwPMjMyMzU0MTQzNDE1NTU4DA84NDc2NzAxNzc3MDI0MTAMDzc4NDIzMTY3MDE3NDY1NQwPNDc2Nzg0NDI1MDE1MTMyDA81MTEzMTU3ODA1NjcxNDMMDzA1MDUxNjgyNDg1Mzc3NQwPNDUxNTA1NjA0MTE3NjQ3DA8wNzc3MzU0MTc0NzcwNzcMDzQ4ODQ3NzYzNTE3MTU1NgwPMTQ4NjM0MzM1MDgzNTgzDA8yMjMxMzE0NzI1Mzc0NzcMDzY1ODQ4ODQ2NzI0MjA1NQwPMzYwMTU2NDYwODU1ODM1DA8zNDc1MTczMjM2NDMwNDYMDzMwNTE3MDA0NDQyNjQ4MQwPMDg4NzMzMjAyMzUzNzQwDA8zNDY2NzY1MjY4MDA1MDMMDzUwODQ1MDEwNjM3MzY1NgwPMjAxNzM2NzEyMDUwNDg3DA80MDMwMDg1ODMwMzE1NTIMDzM4NTUyMDQ2ODA2ODAxMgwPNzIwNDc3Njc4NjM2NDg3DA84MTM4MTc1NDQzNTY3MzAMDzgyNzIyMzc3MzY1NTEzNQwPNjQ3MDEwNTUyMDA3ODY2DA8xODAzMjExMTg4ODY2NzIMDzc0MjEzMzg4MzgxNDIzNQwPNTc1MzU1NzQ4NTMwODgwDA8zMTAzNzAxMTY1NDcyNDMMDzQ0NDQ4NTU1Mzg0NTE3NQwPNzQzNzc1NzA4MjM2NDM3DA8yMzc1MjQxNTg3MTUxMTMMDzI3NzQwNTUzMDE2MzAyMAwPMTgyMzA3MTU2Mzg3MzM2DA8xMDMwMzA2NjIyNjA0NzAMDzE0MTYyMTU3MDI1MzI0NAwPNDY0MDcyMjc2NjQ1ODM3DA80NTUxNzc3NDczMDQ1NTcMDzI2NzYwODgyNjY3ODY0NgwPMzQwNjM1NjMyNTc3NDg0DA8wMTUxNzcwMzI2NjM4MDUMDzgwNzI2ODcwNzY3NjQwNQwPMjA1NzQ2NTE1NTQzMDIzDA82NDU3MzA4MTUxNjcwMzUMDzAzNDEzNjM0Mjc3NTAxNwwPNTc4ODAyODAyNDYzMzYyDA84NDA1MDUzMjE4MjM2MjcMDzA3NzEyNzYxMTEyNjUyNgwPMDE4NzU0NDgwMDM3NDM4DA8wMjEyNTgwNzAzNDE1NzgMDzg2MzAyNjcxNDcwMDYyNAwPMDU2NjQ0MjQ2NjA1MTEzDA8xMjIyMDMxNTcwNTg2MjEMDzgxMDY3NjQ2MjU0MDU1MwwPMTUxMzM1NzUyNTI3NDc0DA8wNjA3MzQyODg0MTgzNTQMDzEyNzYxMjI2NjE0MjUxMAwPODY2MTI0NDU3NzE2NDQxDA8zNDAwNjI0ODY3ODE2NjYMDzA1NzcyMjMwNTE4MzQ4MgwPODMzMzU2NTI3NDI3ODc2DA8zMTA2MjI0NjI0MTM0MzQMDzQ3NDYwODY1MzEyNjA2NAwPMDQzMzIyNzg1MDgxNzM2DA8zNzY0MTAzNzcyODQ2NTIMDzYxNDg3MzQxNDY4MTA3NQwPNjM2NDc1NTgzMDgxNTE4DA8zNzIzODAxMjgzNDAwMzUMDzcxMzEwNzAyNzIwNDcwMQwPNTU2MDA4MTY1MDg4MDMzDA83MjQ4MzQ4MTgyNjY2NTcMDzA2ODA2MTMwNDcyMzg0NgwPMTMzMzY1MjMwODQ1MDUyDA81NDQ2MDI1NjQzNzU0MjgMDzQ4MTM0ODQ3ODAwMjEwMAwPNDExMzA0MTUzMDA0NjcyDA83NTYyMzUxNzc3MDEzNTAMDzIwMTI3NTg3ODMzMTc0NwwPNTg2MTQ4NTYyMzM2NjgzDA84MDQ3Mzc1MjM0NTgzMjYMDzMyODYxNjI3NzQwMjAwOAwPNjU1ODMwNTExNTEwNTA4DA8wNDgwMDc1Nzg2NzIyODUMDzM1ODM2MTM4NDEyMDcwNQwPNTg1MzA2NzU1MjUwMDI3DA81MDU3NjQ3MjQ2MTExNjcMDzQ2NjU2MTc0NTMxMDU3NAwPNDU1MTUwMjI4NjQ3MTc3DA8yNDM1NDY0NTY1MDI4MzAMDzUyMDI4NjUzNDE0MTQ0MQwPMTUzNDA4MDc0NzAzMDE0DA81NjUwNjE1MTEwMjM2MTAMDzQ4MDExNDMwNzIwMTc1MwwPMjQ1Mjc2ODc3MTg3ODY2DA80MDY3MDgxMjM1NzExODQMDzQxMzU2MTA4NTY2MTAxNgwPNDIyMjI2NjEwMDcyMzgwDA8yMTEwNDE3MjU1MjM2MzYMDzU3ODM1NDE2MjQ3MzIzMwwPMDU4MTExMDQ3NzQxMjEwDA82NDUyMTAyMDAxNzI2NDgMDzA0MzEzMTc1MDE0NDA4MgwPODc3NTIxODg2NjE3NzU4DA80NjYxNTgyNTA2MTUzNjgMDzg3NTY4MzA4NjE2MjExMQwPMDQ4NjQzNjM1NzEwODUwDA8wNzg1NzY2NTYzODE4MzUMDzE4NTQzNTU4NTE3MjU3NAwPNDMxNjYxMjc4NTUwNDU0DA8yNTgwNzQ4NjU3MjM1MzAMDzM0MDc4ODYzODA2NzQ2NQwPNjE4NDIzNjMwMTM0NzczDA8yNjgwODQyNzQ0NzAzMjAMDzI4MDgxNDMxMjA2NzM1NQwPNDEyNjUxMTA4MzAxMTYzDA80NTE4ODIxODc4NTcyMjAMDzQ3NTYwODc2ODE0NzY2NgwPMDU3MDAzMjcxMTUyODI3DA8yNjAwMDYzODg2MjExNjYMDzM1MDg3NDQxMDUyMTMwOAwPODM1MDAwMzUzNTcxMTQwDA81MTU3MjAzMDYxMjg3NTYMDzA1ODgzNzY0ODQwNDg1NQwPNDA4NDg2NjQ0NDMzNDM2DA82NTg0ODM0MTIxMjM2NzcMDzU4ODA0NzA1NTM0MDYzOAwPNTA3NDMzMTMwMDY3MDY1DA8yNjQwNjcxNzc3NDc4NTgMDzQ4NTEwMTM4MTY1NjE1MAwPMzEwNzYzMzY2MjIxNDU1DA83NzIzMjMyMTEyMTQyMjQMDzU0ODg4MTU0Mzg4MTY0NwwPNDc2NTYyNTE3NzIzMTE2DA8wMTAwMTQ0NjEyODE4MDYMDzUwNzM1NzA3MDM4MDUyNwwPNTg3NDQ3ODIyMTExNTA2DA81MzY2NTExMjI2ODc0NzIMDzIxNDc0NTAwNjU0NTcyOAwPMjg2MTY2NzUxMTA2MzA4DA8xNjg3NzA1NDQ1MTIyMTcMDzM1MjU3MzcwMzQxMzU0MwwPMzAxNDEwODc4NDI2MjE1DA8zNDY2ODQxODUwNjgxMjMMDzUzMzA2NTMyMzEzNjI0NQwPNjA1MDE3ODUyNzU1NDM1DA80NzcxMzg3NTc0MjM2NjgMDzY2NzA4Mjc1NDUwNTUyMgwPODczMjQ1MTM4MTAwNDAwDA81NTc1MDI0ODczMjQ1NzEMDzI1MTEwNDAzMTcyNjI1NAwPNjI4MTA0NTEyMTU0MDAxDA80NzQzMDM1MTExMjI1NDUMDzQ4NDY4ODc1MDg2MTI4MgwPNTMxNjY0ODAxMjA3NjY0DA80NDc3NjA0MDUzMjM1NDcMDzgxODA2NjQ0MjgyMzQxMQwPNDg0NzQ1NzUzNTcxNTAyDA83MDM1NDE4Mjg3NjUwNzgMDzA0NDAwODczMTEyNTY0NAwPNTM0NTAzNjE4NTA3MDczDA83MDQ0NzE4NTE4MzQ1NDYMDzM0ODEwNjMzMTUyMDg0MgwPNzY0MDY3NTYyMjM1MjA0DA80NzQwMzEyNTI1ODE3NDUMDzU2NzQzNzQ4MzY2MjQ0NgwPNTIyNzM0NTg4MTY2NjE4DA8zNDU1NTQ0NzA0ODgwMjIMDzAzMjMzMjAyMzYyNjQzMAwPNjUwMDg0NDc1NTU1ODYyDA82ODE0ODA1NTM3NzM0NzcMDzM0NzMyMDI1NjE3NDg3MgwPMTA0NTIxNjY2Njg2NjI4DA81Njc2NDg1MTM3MjMzNzMMDzU4NzUxNzg4NDA2MzAzNAwPMjI1NTI3MDAxMTYyNDU1DA8zNTc2MjQzNDc1Nzc0NTAMDzY3NjQyNjQzODc2NzI0MAwPNDg2ODM0MTAwODA4NzU3DA8xNTg1NjY0NDM3MDA2ODUMDzY0NDY2ODE4MDU0NzY0MwwPMDQyMzU3MTQ3MTgyNjY0DA80NTA3NTQzODQyMzA2MzEMDzA1ODA3Mjc4MjIyODI4MwwPNTY1NjE1NjEwMzQxNzYwDA84NzIzNzIyODc0ODIzNTIMDzYzMDE2NzY0ODE1Njg4NgwPNjEwNDAzMzg2MDUzMTY4DA8zODA1ODQyMTE0ODEwNjUMDzExMzg0NTM0NDY3MjI1NgwPMjY2NDY1MzEzNTUzMjg4DA80MDExNTc2NzMyODAyMDcMDzc2NzI3NTQ2NjM0MzA3MgwPNDczMjY2NDY3MTU3NjA3DA8wMjY2NTQ2MzA1MzEyMjUMDzYxMzU2NjgxNjExMzg0MgwPNzE1MTE2MjE2NDI1NzcxDA8wMjY4MzcyMTQ2MDMyMzMMDzE2NjM2MzY1MzE3ODUwNAwPNjgyNDAwNjExMzQ0NTM3DA80MDE3NDM0MzMwNDI1NDYMDzY0MDc0MDMyNDg4MDgzNQwPNDU2MTQ0ODM1MTg2MTYyDA8xODI0NTYyNjI0NTcwMjQMDzQwMzEzNjc4ODY1NzI0NgwPNzUyMjE3NjI3NTQxMTIxDA8zMTcyMTQxNTgyMTYxMzgMDzM2MDI3ODA3MjA3MTA0OAwPMDU4MjA4MDgzMjg4NzIwDA80MTgxNDgwMDUyNzc2NTgMDzM0MTg1ODQyMjgwODYzNwwPNTU1MzIxMDI3MjMyNTE3DA83MjYyNjY3NTQ2Mjc2MzUMDzQwODc2NTg0NDExMzQ1NAwPMzAzMzc2ODIyODg0MTc4DA80MDE3MDI0NTMyMDYyNzQMDzIxMTcwNDc2NTE3MTIzNAwPMTg0NzEwMDY3NzgyMjAzDA8yNjIwMDAyMDQ1MjI1NjQMDzg4NDI0Nzg4NDI3Mzg4MAwPMTIzODAyMTI0Njc1NDA4DA8zMTczMDYyMjY4ODIwODQMDzQxMzc2NzQ4MzEyMjQ2MwwPMjc3MDU0NDI0MDQ3MzgyDA8xMTYwODA4NzU2NjE0NzEMDzE2MzY3MTIzNzg4NzIyMwwPODc0ODI1NjYxMTczNTU2DA80MjU1MTg0NjA2NTI2NzIMDzA1NzMyNzU0NTgxNTE2MAwPNDIwMzU0MzA3MzI2MzQwDA83NjQzMjYxMTc0MTQxMzcMDzQxNDEzODIyNzQ1MTc3OAwPNDE0MjE4MjQ3MzI4NzEzDA81NTAwNzE0MjIyMTE1MTAMDzE2MjcxODUwNzQ1NjYyMQwPNzE0NDc3MjI4MjAzMzE0DA80NzgwODAwMDAwNTg0MzcMDzI1NjQ4MTY1ODQzMzQ0MAwPNjYyODU0MzU2NjY4MzQ1DA8yNDE2ODY2NzY1NzI1NzgMDzUwMzIxNDE1MDU1MTU1MgwPNjAwNDU0MTI1MDU4MTc3DA83MjYxNjQ2NzY3MjMyMTgMDzUyNjMxMDMwMjMyNDA4MgwPNjgwNTEwMzE1NzI3ODgyDA80MjY4NzgzODE1MTcxMjgMDzQ3MzQ3NzI2MzM1NjAyNwwPNDgxODE4MDg3NTMxNjE4DA82NTIzMTY3NjY1MDg1MzIMDzM0NjgxNTI1NTcxNjc4MgwPNTcyNTY1ODQ4ODM2MzA2DA81MzMzNjQ3MzAyNjM3MzcMDzAwNTI1MjQ2ODEyODA2MAwPNzYxODIzNjM0NjA2NTQ0DA8yMDY4NDA1MzQ1MDE2MjUMDzgyNjg3MDExMTA4NzQ1MAwPNzcwNjUzNDE4MjE3NDU4DA83NjM0MzY4MTI4NDg3MjgMDzA2MjYzMjQyNjM1NTI0MAwPNTUzMDY1MzQ2NTU0MjQ2DA8zMDE3NjQyMjQ3MzA2MDEMDzM3MTUxMTM2MjQxMjA3MwwPMDgyMDg3MTc0MDA2NjA4DA8zMTg1NzQwNjA4NjA1MTgMDzQ4MjQ1MjIxMTUwNzIxMQwPNTQwNTAwNTQ2NzcyMDI2DA8xNjczNTAwMDQ2NzAzNDYMDzQzNTExMzIyMjE2NTExNgwPNjY3ODMzMTY0MTM0MTYwDA81MTI2MzYxNDEyNjIyNjcMDzcxMjA2ODA3NzUyMzMzNQwPNjY4MDMxMDc1MzU1NzU2DA82NTM3ODgxMzI1MDUxNjgMDzg2NjIyNTgxNzI3ODMzNgwPMjg2NTg3NDc2NjM0NzMzDA80NTQ2MTQ0MzU2MzY2NjIMDzQxMzU3ODEzMjMyNzgyMAwPNjMxMzQ1MzA2Nzc1NTQ0DA81ODA0NDczNDUzMjgzNTgMDzY1NTI1NTU4NzYxMzQ4NwwPMjUwMjAzODUyMTM3Mjg0DA81Mjg3NDYzNjg1MjAwNDgMDzIxNjE1NzQzODM0ODA3NgwPMjEzMzAzMTE1MzEwNzM0DA8zNzUwNzg0NDgwNDcwODAMDzM3Nzc1MTE3MzExMDc3NQwPODE0MDAyNjIxMjIyNDUyDA81NzY0MzM2NjAyNjMyNTAMDzIzNDAyMTI0MDExODA1NgwPODg3NjE1Nzg3NzEyMTAzDA84NTUzNTYxODA3NDE2NjgMDzc3NjA4NzgwNzgyMjE3MwwPNjU3MTg1NjcxMjIwMTI4DA8wNTU2NDAyNTQ4NzU3MTEMDzcyMDMyMDE0MjI3NjU1MAwPNjE2NTgzMDcxODIyNTc0DA81MTEwNDQ0MzEwNjg0MTAMDzgzMDg1NTM2MTAwMTQ1NwwPODAwMjA0NDAzMzAxMDI2DA8wNDM0NjIxNjg3NTE3NzUMDzI2MjYyMTc4NzgxNjQzMgwPNTc1NTU1MTQ2MTIwODY4DA8zNDEzODI1MTYwMjI0MzUMDzE2NTgzNzE2NDM2ODAyMgwPNzY3Njg0NzI2MTE3NDA1DA8yNjM1MzU4NDExNTEzNzAMDzAyMzAyMDE3NjM4MTI2NwwPNTg1MTI2MjgyMzgwMDQ3DA81MzgxNDI2MTgyMDM2MzQMDzczNDM1NjA1NTEwODIwNwwPNjA2NTA3MzE1MTE2NjE3DA8xMTgyMjA2MzYxNjEzODUMDzQ2NjY4MjE1NzIzNjg4MQwPNDUwNTc3MzI0Nzc4NzQ3DA80NjE1MzAwNTIxMDAzMjUMDzM1MTc4NjY1MzQ2NTYyOAwPNjIwMDE0NDM4NzMzNTM0DA8yODQ1MjA2NTE4NjM3MjAMDzUwODA1NTQwMzM3MDEzMgwPMzIzMjI2NzM3NzY4MTY1DA8wMTQyNDcyMTM2NDA0ODEMDzI0MDYxNzgzMDc4MjU3NQwPNDc2Mzc2NTY4NTQ4MDcwDA8yMzY4MzI4ODMwMTYzMDcMDzIzODYzODI3NjIzNzA2OAwPNTA3NzYxNDc1NDQ4MzUwDA83MjgxMDAwMzAzNzY3NzgMDzU2NjMxNDU3MDU1NTA2MAwPODY4NzExNjIzMTc0MzMwDA84MTQxMDgxNzU2NTI3MjMMDzIyMTc0MjQzMjY1NzM2MQwPNjA3NjgxMzYxNTgxMDU1DA83MzMwMDE0MDE2NzQ4MzgMDzY0MDQwMDUwMzA2MjI1NwwPMTI3NDI0MjQ0NTc4MzMwDA8xMDcwNjM1MTc3NzIwMjUMDzQ1MDUyODE3MzU1Mzg4NwwPNzE1NTExNDYyMDE2NzczDA8zNjQ4NzcxMzAzODExMjgMDzEzNDAwMTQ3MDI0MTE2MAwPODAzNjQ2NTE1NTIzMTUwDA8wODcxNDI3ODc1MTA3NjAMDzM0MjI3ODcxMjM3MjEwNgwPMzc0MDA3ODMwNjcxNzU2DA83NDY1MzE1MDAzMDU4NjcMDzEyNjM2MjQ4MzUzMzA1OAwPMjMzMjIwMDI3MTE1NTE1DA80MTQzNjMwMzc3NzA1NjYMDzM1NTE1MjEyNDAwMDg2MgwPODQwNzczNDU1Nzg1MTgwDA80NTc2NDQyMDExMjIzNDYMDzEzMzg3ODMyMjgyODU4MQwPNzM0NDQ3NTMyNTAzNTIwDA8zMTAwNDQyODYyNzczMTEMDzI4MTY3MDY2MTIyMzE0OAwPNTAyMDI2ODE1NzE4NDI3DA8wMzA3Njg1ODE1ODI2NDEMDzI4MjQ4MDYxNDU1NzMxMwwPNDU3Njc0NTU0MzI0NDA1DA84MTc0MTc2ODI4NTcwODEMDzMwNDE0ODI1MjEyMDY2NQwPNTEzMzExNDMzNzA1Njc2DA83NzUzNDI0Njg0MTI3ODEMDzM0NzgyNTczODc3NzA0OAwPNzIzODQ3NDYzMDQwNTI4DA8zNTI0MzA3MDc2MDYxNTIMDzc3ODgzNDU4MTI0NzQxMQwPMzQwNjIyMjMxMDg1MjM4DA83MzQyODIwMzU1NjA4MjEMDzgxMzgxMjY2NTI4NzQwMQwPMjI4MDI4NTExODUwMzI1DA8yNzgwNzE0ODE4MDIzODAMDzM4ODg0NTU0NTcwMzIzMgwPMDgwMDE0MzUxNDM1NTEzDA8wNzQzODUxNjcwNTUwMDcMDzQ2MzQxODM0MTUyNzAwMgwPODAzMDcyMTM2NDI0ODg3DA80NjAxMjMwNjgzNTIyMTcMDzMxNzAwNjU1MDE0Njg1MwwPMTcwMzIyODAxMTY2NTgwDA83MTM2NDU4MjI2Mjg4ODMMDzA3NTA0ODc2NzgyNjg3OAwPMDQ2MjA2ODYyNDY4NTgzDA8wMjc3ODM2MjgzMzgyNDYMDzIzMTY3MjA0NzAzNjc1NQwPMTUzMzIxMTQ1MzAwODQwDA83MTIyNTMyODQyNTExNTMMDzYzMDMyNjcyMjU3MzQzNwwPNzY0MTIwMjEyNTc2NzUwDA82MzUyMjczNzYxMTU2ODYMDzI3NDc2NDYzMzc3MTcyMAwPMzM0ODIzMjM0NTY2MjE4DA8yODYwNTg1NDAyNzM4NjQMDzA3NTg2MDMxODE3ODIyNgwPMTE3MzY3MzIzNTg0NjgwDA80MjI2ODg0MDc2NTE0MjQMDzQyODgxNjA2MjE0MzI0NQwPNjEyMDY3NTU1NzUxMjMzDA8yMTcyODM3MDg4NDY4NDYMDzc4MzgwMDI2NzcyMzE0MwwPNTc3NzY1MTI2MDI3ODU2DA8wODAwMDM3ODIzMjA3MDcMDzM3MzM3NTA1MzY1MDQzMAwPMzg1MjI0MDY0MDU3MzUzDA84ODQ4MjMxMzg0MDA4NzAMDzA3NzQ0NjYwNDEwMjMwNgwPNzM4MjgwMjM1NzYxNjg4DA83NzM2ODAxODU1NjIzMzMMDzU3MDY1MjYwMDQyNTMzMQwPMjQyNjQxNTcwMjg3MTMwDA8wNTc0NjczNDc3NDc1NjUMDzczODIzNjU3MzgwNDU0MAwPMDU1MzIxMzE3ODgzNDgzDA8zNTEzMjc1MDMwMzQwNDYMDzA2MjMxNTQ4NjY3NzI1NwwPMDc0MDEwNDMwMTI2MTY0DA83MDQ4MDE1NDI1ODI1NDQMDzE2Mjc3MjQyNTg2MTgzOAwPNTY4ODgyNzI1NzY3MTcxDA8wNzgyNTQ1NDE2NDM2NDYMDzY3MzE3NzI3ODM4MTgyNwwPNzEwNzU0Mzg0Mzg3MDg1DA8yMzEyNjg1NjA0NzIzNTYMDzIzMDYyNjgzODQxNTg2OAwPODcxMjIyMzI4MDY4NTQwDA80NTg3ODUxMTIyMzY4MjAMDzQxMjQyMzYyNTE1MDYyMAwPMjUwODUzNzExMjAzNDQ3DA82MDExNTcwMzg3NzUzMjcMDzM2NTQ2NDM3MjE2Nzg4NAwPMTU2MjAyMDgyMjQyMTQzDA84MjYwMDQwMzc3NTcyODAMDzIxNTQ1MDIzMjA4NjE1NAwPNTY3MDE4NTI3MDc2NjI1DA8yNDUyMjc0NjUxNjYzMDQMDzc4ODI4MTAyMDQ0MDQ1MQwPNDc2ODQ3MDI4ODg0MTYwDA83NzE0NDY1MjY1NTA3MzUMDzc1NDIyMzg1NTYzNjAxNwwPMTQ0NjE1NTA4MzQwMjA4DA83MjcxNjUwODMwNzgwMDUMDzEyNjQ1MzIyMjMwNjY3NwwPMjU3NTExNzY3ODQwMjgwDA8yNTg4MTA3MzYzNTAwNjAMDzE1Mjg1MjM0ODcxNjU0MgwPMzE0NDE1NzcyODc1NzA0DA83NjE3NzU3MDUwNjg4MzgMDzA0MzU2NzE4NjI0ODI4OAwPMDMzNTc0MjI3NzE3Mzc0DA81MDIyMDY4NjM1NTY0MzcMDzgxODM3ODMzNzE2NDQzMwwPMzExNDI4ODQyNTQxNDEwDA83ODYxNzQyNTE0MDc1NDMMDzM1NDg2ODQxNTAwNzQyNAwPNzg4Njg0Njc4Nzc4NTc0DA8wODc3MjAyMDUyMjA2NzQMDzIzNzQyMTcxODA2NTU2NAwPNjQzNjIwNzU1Mjc0MzM1DA81MTg0MDMyMDY0NzIxNzgMDzA1NzIzMzQ3MjUwNDQyNQwPNTgxMzI2NDY1MjY3NjYxDA8yNzc3ODM1NzM1MDc3NTUMDzg4NTAwMjA0ODc3MDAxMAwPNDczNzIzNjcxMjgzMzE3DA8yMTQzMTgxMjcwODE4MTAMDzA4NDU2ODg2NTAwMjcxMAwPNDc2NjE1MTg4NjAzNjMxDA83MDcwMDcxNzQ1ODM3MTAMDzYxMTUyNjcwMTEzNzEwMwwPMjEyMTczNzM1MDI3ODA2DA8wODgyMzgzMzEzMjA1NDUMDzU1NjEzODEyMjYyNjU4NgwPNTU4NDQyNzQ1ODI4NDI4DA8wNDQwMDIxNDUzMTAwNDMMDzU4MjQ1NzM0Mzc3MTY0NgwPMDg3NTM3NTY4NTMyNTQ4DA81MDI0NjU3NjA4ODg0NDcMDzE1MTUwMzYyMjE2NjM4NwwPMzQ0NzQxMjI2NDU3MTIyDA8yODIzMDU3ODI0NjY2MzQMDzYyNDMwNjE1NTAxMTU2MAwPMzA2NTE2NDUyNjI3NzUyDA81NDMxODc4MTg0Mjc1NDgMDzQwMTE4NzA2NTgxMDcxMgwPODc4MTgzNjE3NDUyMDE3DA8xNTI0NzgzMjY3NjUyNTUMDzEwNDIzNjgyMDY3NzEyMgwPMjM2MDM4MDczNTU3ODU1DA84NjAwMDI2NTczODQ1MzcMDzcxMjQ2NjAzMzAxMzI0NgwPNjU4NDcyMzM0NzgyNDUyDA82Mzg3ODY0MjMzMzg1NDIMDzUyODA4NzA0NjYxNzQxNAwPMjM4NjMwMTM2NzY1ODczDA80NjM1NTc0MTM2Nzg1MjUMDzAxMTQzODU3NzQxMTUxMgwPODYwNzQwMTg0Mjg0MDc1DA8xNzQyNTgzMDEwMzU0MDMMDzc0NzYyNjI3NDg2MzA2MwwPMTcxMDY2NTMwNTg1NjEzDA8zMDYyNDU0MTcwMzUyNDUMDzQ2ODUwMTA2MjEwNzUxNwwPODQ3Mzc1NjUxNzcwNTMxDA8zMDM2NjM3MzY4MzAxNjYMDzc3MDQ2MjY0MTMwNzg4MAwPMDcxNTUxNTMxNDYzMzIwDA81NzAxNTgyMjMyODcwMzgMDzE4NzA4NDUyNTUyNjM4MAwPMjY2NTE1MzAxODgzNTc2DA8yNDc2ODY4NjcxMzYzNjEMDzcxODM2ODAyMTIzNjQwMAwPMDIyNzUzMjcwMDAyODg1DA82MDMxMTgxNjA2NzY2ODQMDzY1Nzg2Njc1NDU2NTM2OAwPMDgyMjE1MjQyMDcyMzEwDA8wMDYwMDM1NDQyMDA1MzcMDzMwNzU2NTUxMzEzNzYxMAwPNTY0MjIyMTA3MjI1MzE1DA82ODQyODIxODg0NTYzNzIMDzQ4NzY1MDYwMTQ4NDMwMAwPNTU4MDYyMjgwMzE4NzQ1DA82NDM0ODMzNjE0NjI0MzIMDzY4MTY4MDExODUwNzg2NAwPMjU3MDMwMjQxNTA0ODY4DA82ODg0MDQ2NDU0NDEyMjMMDzMyMjQ4ODIyMzI1MTA1NAwPMTQ1MzcxODMyMDUxMDQ0DA8yNjQ2MDYzMDMzNjAxMDEMDzg4NDgyMzQ0ODM0ODgwNAwPMTQxMzgzODEyNDU0NTIwDA8wNjA2MTU3NzUwNTM2MjUMDzc3NDQwNjAzMzQ1NjI0NgwPMTQ4MzM3MzE2MTQwNTA0DA81MDU0MzI3NDU3MzY1ODMMDzQwMjEzNzU1MTI0NzY2MgwPNzQwNjI1NDg4NDcwNjYxDA80NDIxMjc2MjQ4ODc2MTgMDzA4NDgxNDgxODMyMTg1MgwPMTg1MDg2MjEwNTY3ODE2DA8xMjUwMjQxMzUwNTcxNzEMDzQwMzg2ODQ2NzMyNjQ0NgwPMjY1MTgyNzQyNjM1ODU4DA80ODczODUxNDczNjA4NTcMDzIwMzU2MjQzMTQ3NzQ1NgwPMzA3NzA2NTg3MTY2ODU0DA80NzQ3NTI3MzE3MzEzNjUMDzQzNjQwNzgxNTgwNTI1OAwPNjYxNjI0MTQ2NDI4NDMxDA80MTI2MjE0NjU2MTMyNTgMDzQ1ODc1NTI2NDY1MDM3MAwPMjcxODczNDE3MTU0NTMwDA83NjM0NTMyMzE2NTA0MTMMDzU3ODYxMzM2MjM1NDI3NQwPMDcyMjc1MzUyNjcyMDU0DA83NzM0NjE1MTQ1NzQyMzQMDzI3MDQ4Njg2MjIyNzI3MAwPNjE3NTYxNDA2NzcyNjQ0DA83NDc3MDc3NjIyMzg1NjEMDzA3NDYwMzA4NzE0NzA0MgwPODU1Njg1NDA1MjQ0NTQ0DA80NTM0NzMyODM1NDU3NzgMDzQ4NTU2Mzc0NTIxNTI0MAwPODEyMDg4MTM2NTY3NDA3DA8xMTU2NzEyMDgzODcwNzUMDzgxMTI0MjE0ODczMDA1MAwPODIyNzU4MTEwNjYxMzUwDA8xNzcxNjU0NTIxNzIyMDEMDzczODM3MjIxMDYyNDc1NgwPMzUzNzY4NjE1NzY3NDM0DA84NTg4NzMwMzU0MTA4NTYMDzcxMDYwMTc1MzczNzMwNAwPMTU4ODAzMTA2NjU4MTIzDA84NTc3MDY4MzQwNzc3MjAMDzI2ODI2Nzc1NjQ2Mzg2NgwPODgxMzUyNjE0NzU4MDgwDA80ODc2MzQwNDE3NTg3NDgMDzQ2MzAxODU2MjQwNzEwNAwPNzg2NTA1ODQ3MzY0NDM2DA8wNzg4MTE3MzEwNTUwNTEMDzQwMjYxNjQyNDAzNzg3NQwPMjMzMDMxNTMzMDE3NDA2DA8xNzMxNTE4NjYzNzc2ODIMDzE1MTc0MzE1MzExNjc0NwwPNTIyNjE2NzM1MzMwMTMzDA82NTQ3MjAwODc2NjA1MTgMDzQ3NTgwMDM1MTIyNzMwNwwPNzExMjYxNTgwMjAxMjQzDA80ODYwODMwMjAyNjQ4NjAMDzE1NjIyMTAzNTIxMDc3NAwPNjEyNjMyNTgxMDQyMDY2DA84MDU2NjM3MzUwMTQ0MDMMDzc2MTQ1MzcwODU0MzI2NgwPMTI4NjE1NDg1NzI0NDIxDA81MjExNDY3NDU1Mzg2NTMMDzAwODM1MzAxNzE2NDgwNgwPNTgxNDQyMTIzMTAyODU0DA8zNjIxMTYxNTcxNjAyMTAMDzMwMzg3MzUxNTAzODc0NQwPNDU4NDU3NzQ2MjIxNjQ0DA81NTIyMjA0NDAxMDY1MzcMDzgxNDI3NDcwNTI4MDMzNAwPMDQ4NjA1NjI2NjU3MDg3DA82NjMwNTUyNzc1MTg0NDIMDzg3NTAxNDA3MTc2NzYwMwwPMzI3ODUyMTgyNzc0NTQ1DA8wNDQ4NzU0MjM2NTE4MTcMDzI4MTExNTcxNDMwNjAzNQwPNDgxNTY1MzU3NTE3NjgwDA8wMTEyMzE3NDI3NTQzMDgMDzIyMTg0MjY4MTUzNTEwMAwPMDYyNzQyMDMzODgwNzUzDA81ODUxMzAzMDUwNzEwNjcMDzM1MTI4Nzg1MDA1NjcwNQwPMjcyODEwODQ1MzI4MDYyDA8zNTg1MzQ4MTAzMzgyMjMMDzQzMDM1NjY2MjAyMzIxNAwPMzY1NjM1NDY4ODM1NjM2DA81MDA0MzY3NjMwMzQ2NTQMDzAyMTE0MDg0MDQwMDYwOAwPMzEzMTMzNjg0ODM1NDgyDA81MTA0NjI3MTgyMjU3NzQMDzc3NTE2MjMzMTY4MTIwNwwPNjQ2MTU0NDQzNzU1ODM4DA8wODUzNzAzMTAzODI0NTUMDzU3Nzc2ODM1NDc2ODg3NwwPMjQ4ODQyNzIzNDU2Mjc0DA8yMDU4NjY2NjE4ODA2MjYMDzE3NTI4ODQxMzU3MjE2MAwPNTA0MzQyMTU1NjIyMzcxDA81ODY2MDE4NzY4MjY1NjYMDzEzMjUxODYyNTgxMTUxMwwPNDIzMDc4NDIzNjcyMzUyDA8xMTQ0NzczMTI1ODY2NDEMDzU2NDU4NTM0MTgyNDgyOAwPMjU0MTE4NzY1NjQzNjI0DA81NjA1MjAxNDUwNTUwNzAMDzg4ODQyODI0NTcwODIwNgwPNDM1NzY2MTE0MTc3NTQxDA8zNjY4MDQwODQ3Njc0MzMMDzE2NTgzODY2NTU2NDU0OAwPNzA1NjgzMTg4NzU1MTczDA84Njc3MzEwODMwNDAwMDIMDzA0MTg2MTg2MTQ3NDA4MwwPODIxODQ1NDAzNDA3MTUzDA81MzExNTQ4NTcxNDMzNjEMDzA0MTgwMTUwNDQ1MTAxNgwPMDAzNDUyNDc2MDYyNzc2DA82ODE1MjMwMTAwODYwODYMDzMyNTAzMTUyNDM1NTY1MgwPMTczMTI2NDAyODQ3MzAzDA8yMDMzNzc2MTU0ODM0NjEMDzUzMDIzODA3MDQ3NTQwNwwPNjYwNDUxODIwNTMwNDE4DA83Mzc0NzQ1NTQ2NjQyNzgMDzAyNjAzNjc2ODgzMzMzMgwPNjA1NDIxNjg2MDYzODAxDA8wMTYwNzI3MjUyNTIyNDQMDzg3MDYzMDQ3MjMwNTQzNAwPMDMyODAwMzQ3MzE0MTgzDA8wNDg0NzY3Njc2NDY4MTIMDzM1MDMxMjEwMDE2MDA0NgwPMTU3MzM0NTg3NTQzNjUwDA8zMjExMTExNjQxODQ0MDUMDzI3NTU3MDA1MzI1MjA2NAwPMjU3NjMwMTAyNDg1NjE3DA82NDU3NDYzNTgxMDYwNzAMDzM3NzgzMjIxMjM3NjQ2MAwPMjE2MTc2MTE0MTUyNjM1DA80NjgyNDMwNTQ4NTM4MTMMDzc4MTM2MDEzNTI1NTU2NQwPODcwNDEzMTcwMjg1NzU2DA83MTE3NDQ0NDE2MzQwNzEMDzEzNjE0MDAwNDU2MDIxNgwPNDA4MjQ4MjEyNDg4MTUwDA8yMjY1MDU3NTE1MjgyODgMDzY0NzU4MzcwNTAzMjYyNwwPNjUzMjQ1NDMwMzg4MDUzDA8wMTQ4NjUwMDMwNDUxMjAMDzIwNDA2MDA0MjY0NDAzNAwPMDM0MjM4MTUzMTg4MjQ0DA8yMjg1MjQyNjcyMTU4NjAMDzQ0MzE4MDgwNDI2ODUxMAwPMzM0ODA1NzUxMzg4MjU3DA81ODAyNDA1NzY2MDY4ODcMDzg0MzAwMDQ1ODY4NTA1MAwPNTY4Nzc4NjY3ODExMjcyDA8zMTUxMTcxNTIxMzQ2NjEMDzg0NTQ3NDMxMjQyMTYxNwwPNDYxMDIzNjQyMDgzODMyDA8yMTQ3MDM2MTg0NjM2NTIMDzM0NTQyNTIyMDU1MjQ3NwwPODMwMDUzODczMTA2NjcyDA8wMDUyMjEwMjc4NTE2NDgMDzE1MjY0Nzc1MTE1MTM2NAwPNzI2NDQxNjM2MDYwNzMzDA82ODU3MTgzMTIwNTA1MzEMDzI2NDM1MDIzODI0NjI4MAwPNTA0NDU0MzYwMTMyNDUyDA84Mzg0Mzc1NDI1NzA2MjQMDzQyNzQ2MDQ2NTE1NDAwMwwPMDQzODExMjEzNTM3NzYxDA84MTE4NDc3MzA4NjE0NjgMDzUxNTI1Mzc0ODEzMTQwOAwPMDQ1NDU0MDg4NDYyMTUwDA82MzE2Nzc4MTYwNTE2MjUMDzU4MzI4MjcwMTEyMTY0NAwPMzgzNTg0NzQ3NTM0MDE2DA8xMDIwNDY0MjUwMjU0MjQMDzU3MDA2NjIxNDQ4NTE1NwwPNDU4ODY4MTg1NjI4NDA4DA81ODUyNTg4NjYzNDY3NzgMDzUyNzQwNTYxODY2NDc0MAwPMjc0MjY4MTczODA3MTE3DA83NzY2MzcwNDY2NDA3NTQMDzUzNTEzMzMzMTM2NDA1MwwPMTA1MDYzMDAxMjIxNjUwDA81ODMzMTY2MjA2NDc3NzcMDzQzMzM3NDYzMDMyMTU2NAwPNDcxMjA0MzgzODAxODg3DA81NjUwNTIxMjU1MzUxMDYMDzM2NTMxODEzNzA2NzMwNgwPMjQzMjg4NzgzMjY3NzI3DA8zNzQxMDg2MjYxMDAxMjQMDzc4MjA4NDIyNzUwMDM3MQwPMzU0NzU3MjYzNjAzMzg1DA83NDM3MTU2MzAwODAwODYMDzM4MzIzNzc3NzMzMTE3NwwPMzU2MjIyMzUwMDc2MTE3DA84MDIwMzQxNjcwMjU1NzcMDzU1ODE1NTI1MjM0NDQzMwwPODE4ODcxMTQ0MDQxNDY3DA8yODQzNDI1NjAyMjg1NzcMDzA0NTQyMDcxNjEzODAwMAwPNzQ4MzgxMDQyMzIxMzgxDA8zNzE1MjA4NjI3MzMyODgMDzMxMjgzMjQwNjYxMzA1NQwPODA1ODgzMDUzNDIzMzUzDA8zODEzNzQ0NzI1MDQ4MjYMDzU2Mzc0ODE0NDI3MjU0NgwPNjE2MTA3Nzg1MTcwMjg1DA8wODQ4NjY2MzI1MTEyODAMDzMxNjEyNzE4NjUxNzgzMwwPMTAwMjQ2MTE1MDU0NzgzDA84NzQ3MTgwNzEzMzc0NDcMDzA1MzQ3NzgwMTEyNDEzNQwPNzcwNjM0MjQ1MzM4MTM0DA82MTQ2NzUyMjY1MzcwNDYMDzU1NjA4MTM4MDMzMTQ0NgwPNTgyMzI1NzU1MjU0MjM2DA8zMzAyMTI1NDcyNjQ0MTMMDzE1NDg3MDE0ODcwNzMyMQwPNTI3Njc3ODIyNTUxNjE1DA82ODY0MDgzNDE2MTQzNTAMDzQyNTAyNzM4NjAxMTc4OAwPMDg0MDExNDg4NzQ4ODY1DA81NTgxMjUyNjg0MzYwNzYMDzE0NzEyODE3NjczNzUwNgwPMzEwNzAzMjI2MTQwODE3DA8yNjA2NjAwODQ0NzQ2MjYMDzEyMjMxNjgzNjUwODE4MQwPNTAzMjA2ODI0MTc1NDY1DA8xMDY3MzIzNDE1NTg0ODcMDzgyMzI4NDcxMjIwMjg0NgwPNTIwMjUxMTIyMTU0MDM3DA80NzE2NTIyMTMxMTgyMTEMDzYwNzAzMjU4MzAxNTM4NQwPNzM4NjU2NjUwMzYyNTQwDA81NjQyNzUwMTg0MTI4MzUMDzU4MDIwNDM4NDg2NzM1MQwPMzYxNjA2NTgxNDU4NzczDA84MTAwNTg0NjA0MDY3MzgMDzA1ODA0MDAyMzMxMjE0MgwPNjg0NDY0MzQzNzg0MjQ3DA8xNjU1NTgxNjIzODQwNzEMDzU0ODA1MDgzMTY0NDczNQwPODU1NjY2NTI4ODM2NTUyDA82NjE0NjcyNjMwNDYwNDgMDzYwMzUzNTMxODEyNjAxOAwPMDE0MjM2MjU1MDM2NzEzDA84NDQ1MjQyNzYzNDc1MTQMDzY3MDc4MzY3MjYyMzYxMAwPMjY4MjU1NjgzMDcyNDc3DA8xNzUyMTY1MzgyODg4MDEMDzg2NjQxMTI0MDc1MzM4MgwPNDg1Mzc4MDgyNTQ4NTY3DA84ODU3Nzc2NTcxNzc1MzAMDzgxNzQyMjcwMjQwNDYyMwwPMzI2MzcxMzYwODcxNDAwDA8yNDcyNDg1MDA0MDY4MzcMDzA2MDE1NzIwNTQwMTIzMgwPNjgxNDMwNDEyMTA4MDE3DA82ODQwNzM0Mzg4MjgxNTgMDzU0MTI4MzQ3ODQyMTE4OAwPNjM2NDI1ODYyNTgxODg0DA84NzM4NjQ4MTc2MDA3NDcMDzM2MTg4MTcyNjQwMTUwNAwPMTM4NTY3ODI4ODAwNjEzDA8wNDE2NDI1MDM2MjUzNzUMDzUxODEzMTQwODg3MDgxMgwPMjcxNTM4ODc2NTEzNzM4DA8xODY4Mjc2MzU0MTEyODEMDzUyMzU4MjQ0ODU4MDUwOAwPMzg1MTg1MTg2ODE1NTMxDA84MjU4MzUzMTc2NDMwNDIMDzU4MzAzNTY0NTgwMzg2NwwPODQ1NTMxMzQ3MTg4ODMxDA84MDUyNzYyODA0MzI0ODIMDzQyMzcwMjAxMDQ4NjUyOAwPMjEwODIwMDA1ODU4MTQ4DA83MzQ3MTA3MjMzNTAwNTYMDzc1NjA2NDYyNTA3NDQzNwwPMjcwMjY1MDMyMTQzMDcyDA8wNjY2NDcxNTQ4MjA2NzQMDzU2NTAxNTE3MzQ3NTMxNQwPNjQ1MjQ3NDEyNTM3NTUwDA81MDY3MjAwODY2NTY4MjgMDzc2MTEwNTQ3NTUxMDYyMgwPNjY4NjMyODg2NzMxNTA4DA82NDE2NzI1ODQxNDUzNjAMDzY2NjcxMjIxODQwNzQ2NQwPNTg0MTIyMTM3MDAxMzIxDA84NDgyMzc1NTQzODgwMjcMDzc1NTg4NzI3MzYxMzI4NgwPMjY1MjI0NDAyNDM2ODExDA83MzMyNjMwMzg3NzAxMzUMDzE4Mjc1MDExMDE0Njc3MwwPNTgwNTUzMzA2MDgxMjA1DA80NzQ2MzMwNTIyMzUzNTYMDzg4NTgxMDYyMjIxNjQzMQwPMjQ1Mzc4ODQ2MzE0MjgwDA8zMzEwODIzNjg2MTM3MDYMDzA4MzQzMTA0NjYyNzE0OAwPMTc3NzgwNTQ2MjQyNzI1DA84NTIyNjYyMDU3MjI0NzYMDzM2NTgxMjg3ODMyMzQ1MQwPNzAzNDA3MTU1MzEzMDcyDA84NzgyODIxMjQwMTAwNjMMDzI1MjU4ODA0Mjc2NDYwNQwPMDIzODAyNjg2NzUyNjI1DA82NDQyMDI4MDUxMjA2ODEMDzE1NzAxMjU1ODU4NjU2MQwPMDM4ODAzNDUyNTU1MTI4DA82Mzc1MjMzNTUxNjUwMTAMDzQ2MjQxNjg3NTI2MjI3MQwPMDEzNjUzODAzODc0MjI0DA8wMTUyNzE0NDI0MzQ4MDcMDzI3NTc4NjcxNjc3MzYwMgwPODA2NDM0MTQ0MzEzMDczDA81NjMzMDEzNTY3NTIwMjMMDzcyMTc3NDI4NzAwMjIzNgwPMTg4ODQzNjEwMzQ2MDEyDA8zNTMyMTE1ODYxNTA2MDMMDzQxMDQyMDA0MzcxNTg2NAwPNTAzODY0NDIxMTg4MDEzDA83NTUwNDI3ODE4MTA2MTQMDzAxODQ4NzI0NjYyMzQwMgwPMDg2MDUxMzIwNDI4MTM1DA84ODcyMDc1NDU1NjA3NDMMDzg4NDQwNTIxMjExNzA2OAwPMDg2MjY4NDY0Mzg3NjA2DA8zODIwMzY2MzQ4NDEyNDYMDzI0NzI1MDExMTI2NTQ2NAwPNDA0ODQzNTIxNjg3NzAwDA8zNjg3MDEwNjcxNDM0ODMMDzgwODA3MjY0NDI2MTE4MwwPNTYzNTEzMDgwNTIzODI3DA82ODExMjczODg0NzY1NzUMDzY3MjI3MTcwMzQxNTcyMAwPMTA3NzcxNzAyMjU1NDY4DA8yMzc1MTQxNzY0MjMwMjYMDzQ4ODgxMzM2MjcyNjMwMgwPMzYwMDAyNTUyNzYwMzE4DA8yMTA0MzgxMDAwNzM0ODYMDzUzNjU2NDY2MDIyNTEwMwwPNDU3NjcxMjM0MDUwNjYxDA84Njg2NjY3Nzc3MDAyNjUMDzI2NzExNTEwMzQ0MjY4NgwPODc2MjYwMzUwNDExNzE2DA8wNjY2MjUxNTExNDMyMTcMDzIzNTI3MTMyMzM0MzUwOAwPMjg1MTgxNjI2NTU2NDAyDA82MDA0NzAwNzE2NzcxMzYMDzE3NDc3Njg0MDA1MTc3MgwPODY4ODczODUyNDI4NjgyDA81NjE2ODQ3ODYyNjczODYMDzMzNTI4MDA0NzMxNjg4MgwPMDM4Mzg3ODMzMzY1NjU4DA8wMzc1MDMxMjc3NTU3NzcMDzc4NzA2NTAwNzE1MDI0NAwPMzcyMjUxMzEyNzYwNjI3DA8wMTcxMjIxMTc0Mzc3MjIMDzM3ODMwMjA0NDU0MDc3NQwPNDgyNzY2NDYyNTYxNzE3DA8xMDY4MDY4MTE3MTg2NjgMDzEyODM3NzQ4NDA3MDE2MgwPMzE1ODUwNDYzMDY1MzIxDA84MjAxNTEwMzQxNjcyNTcMDzY3NzQ0NTQ1NjAzNTcxNAwPNTY0MTQwMjY2Mzc4NzM2DA84ODc3NTc4MzU1NTMxMTQMDzQzMTUyNTcxODI0MjYxNAwPMTAxNTIyNjEzMTIwNTg4DA83MzUyNTczODcyMzIwMzQMDzAyMzQ4NTg2MDQyNzE2OAwPMjUyNDUwNDgzNzU4NjU0DA83MzQ4MjE4MTQzNzcwNjUMDzg4MDgzMTA3ODU3Mjg1MwwPNzUyMDE1MDgxMTQxNTcwDA8zNzc4ODYxMTU4NzMzNTcMDzEwNTgzODcxNDI4NjY0MQwPMjg3NzEzMzE4ODE4NzEyDA8wMzUwODg3NDU4MDI1MTAMDzc2NTU4NTMxMzM0MzI4MAwPNzg1NzAzNjExMjczNjgzDA80MjQ2ODcxMDc0NTM4NTcMDzQ3MTc2MTQ3NzUyMjQwOAwPMTIxODY4NzM3NzY2MTAxDA8zNzg2NzAwMTY1MTQ2NjQMDzg4MDE1MDY2ODIyNzA2MwwPMzQ3NjM2MzI1NzI2MDYxDA83NzUzMTY0ODQ0MzU3ODAMDzU3MjMxODI1ODY2NTcyMAwPNzQzODI2MzIxODg0NjE1DA84ODU4MjQ1NjQ0ODczNDYMDzc1NjA0NjYwODU3NDE2OAwPMjIzNTI2Nzg0MDI0ODM2DA82NjQzMDA3NzQxODA1ODYMDzYwNDAxMDcyNTUwNDQ2NQwPNzY0MDE4Nzg3NjAyNTUxDA8xNDI1MzMyNTQyODczMjAMDzEzNDU3ODYxMTgzODU0MAwPNzM3NDU1MDcxMzEwMDU1DA8zMDMwMDg4MTI0MjU3MzMMDzc0ODU3MzU3MDIwNjcwMAwPNDIxNTAxMjA2MjU0MTE2DA80ODMzNjg0Njc1NDgwNjQMDzUyMTIyMzU4ODYwNzAzMgwPNTUyNjg3NTAxODI2MTY1DA80MTM2MjQwMjUwNzYyNDUMDzU2NjI3NzYwNjMwNzUzMgwPNzgwNTc4MzMzMjgwODA2DA84ODIxNjMwODc1MzIwMjUMDzI1ODI0NTc4NjU3NTcyNQwPNjMwNjIxNzEzMzQxNDU4DA83MjQxMjA1NTU2MzY2ODgMDzUwNzE4MDUwODU1NzA1NwwPNDQzMTY1MTc4ODA2ODMyDA84NDYzNTE2NTc1MDgzMTgMDzM0MDEyNTIwMDQ4ODY2NgwPNzg4MjcwODE2MDEwNjQ4DA82ODEyMjczMDQ2MzE2NTcMDzU0ODYxMDEzODMxNDgyMAwPNDI4NjA0Mzg2MTc2MTIyDA8wNDU2ODQ2MzU1NzcyNTgMDzU3MTEzNTMyMjg4NzIzNAwPNTQ2MzMzMjYzMzU3ODc4DA8zMDgyNzY2NTY0NzM0MDUMDzU0ODQ3MTMzNTM2NTYxOAwPNjY3NjM0MjIyMDE0MTQzDA8yNTMwNTcwMDI2ODY2MDcMDzc0NDUxNDgzNDc3NTA0NAwPNzMxODY2MzA0MDgxNTc1DA82MjU3NjcxNDgwNTc2MjcMDzY4NjQ2NzI4NDI4Mjc3MwwPNDAzMDUwMDM4NTQwMjAzDA8xNTQ3NDYzNzIyNzY1ODcMDzEzMTY1NTc3Nzg2MTE0NgwPMzY4Njc2MDMwMjQyMDMyDA8zMDY2MjM4MzYzNDY1MzMMDzUzNDgxMDc2NzI4MjI2NQwPNjYwMDEyNDA0MjI1NDU0DA8zMTg0MDc1ODYwNzgwMzYMDzMzMjQzMzc1MDg0NDUxMgwPNTA1MjMyMTE0NjgyMDA0DA8xMjYyNjcyNDM2NzQ0NTIMDzQ3NDQzNDYyNjAwMDA4NgwPNTY1MzI1NjMzNjcyNTQyDA8zMjc3MjMwNjUxNDcyMTgMDzcxNjQ2NzEzMDg2Mzg1MwwPMDQ1MDI3ODgzMzQ0NDYwDA8wNDQ3Mjg1MTA0MDE2MzUMDzU4ODgxNDYwNDg1Mjc1MwwPNDgzMzY0ODIzMzYyNjUwDA82NDMzMTUzMTcwMDgxNjQMDzAzNzQwNjEzNjM3Njc1MwwPODYzMjg2MjQ0MzgwMzQzDA80NjMyNzUzODMxNDMwMzcMDzM2NTQ3MzU2MDc0NjMyMgwPODc4MzM2NjY3NzI3NTQ3DA8zMDU2NDYzMzcwNjczNzEMDzM3MDA4MzE1MjY4NjE1NwwPODg4NTM1NzY3ODg3MzAwDA8zMzYwNzUyMTIxMjI3NjIMDzUwMDgzNTM0MTExMTQwNAwPMDQzNjg4NDg4Njc3MTE3DA82NDY0MzIyODM2MTAyNzQMDzE3MTIyMjA3ODIyNDgwMAwPMjUzMDEyMjg0NTg2MjUyDA80MzYyODIxMTg0NzU3MDQMDzgzMDQxNDU4NDM2MjQzMAwPNzY2ODIzNjYzMTI1MDI4DA8xMjAzODEyNjI3ODE3MTEMDzAxNjM1Nzg2NTg3MTQ3MQwPMDMyNzM3Nzg2MjgyMzY4DA8wMjYzMzAwMzcxNDUzMjEMDzgwODcyMzU1ODQ0MTgxMgwPNDI4MjMzMzI1MjQ1MDgyDA8xODgwMzAyMTczODA4MjcMDzI1MjYwMzI0NzcxNjg0MgwPMDE4MzM1MjA4NDAyMDczDA8zODgzNDQxMzMwNjU4ODgMDzAxODUxMjAwMTE1MTY2MQwPMDgzMjgzMTM2NjY1NjcyDA84NjMzODU3ODU0MTIwODgMDzgxNzg0MjQ2MjUxNTA3MQwPNTM2ODA1ODIyNzgxODU1DA8xNDA0NjYzNzY3MzQyMjQMDzMxNDUxMjgwODQzNjEzNgwPNzUzNjY3NTAxMjgzNTE1DA8zMjQ4MzM1MTMyMzEyMDcMDzc0NTMwMTY4NjI1MTg2NwwPMjE2NjMwNzM3NjEzNjM2DA81NzgxODUxNjY2Nzg1NzUMDzc0MjI0MDQ1NjI2MzU3NQwPODA2NDUyMDQyMzI1NDg2DA81NTAwMTExMDgyNzg4MjMMDzQxNTIwNzM3MjM4NDc1NAwPNjIwNTA4NTUxNTMyNDEwDA80NTM4NTYwNzA1NjgyNDAMDzE1NzY1MDIwNDM2NjUyOAwPMjcwNDUyNjc3Mjc1MDc1DA8wMTgyNzE2NTIwMDU1MjMMDzU2Nzg0NjA0NDI0MDEyNQwPNDYwNTgxMDUwNDg1MjM3DA80NjM1NTQwNzgxNjMxMzYMDzQ3ODAwMTAyNTAxMzU4NAwPNDc3NzUwMzEyMDg4NzYwDA84MDU1MzQwMTYwNzUyMDEMDzg1Mjg2MTcxNjQyNzExOAwPNzU2NjA3MzEyMzcwNTg2DA81NTQ3MTQ4NTAwNTQ2NTAMDzEzMzI2ODQ2MzMwMDMwNQwPMjYyNTU0MTYyNTU3NTMyDA80Mjg3NjI4NTc2NDE0MDMMDzg1MzQ1MzEyMTgzNDY0MAwPNDAzMTgyMjU4MDU0NDQ2DA84MzYzODAwNTczODY4MjgMDzIzNDAwODQxMzIzMDIzMQwPNDg4MzE1NzA2MDQ0ODAyDA82MzY4MjI3ODQzMTczNjUMDzg2ODg1MTU3NTA1Njg3NgwPNjY0NDAzMzA4NDIxNzMwDA8zMzI4MTQyNjA0NDExNTEMDzYyNTY3NjcyMjI4MjM1NwwPNTc1NzYwNDAyNjE2NzQyDA8xODQ1NTg4MzE4MzI4MzYMDzg3MDIxMDMxNjM0MjczMwwPNjg1NzQyMDg1MjYwNDExDA83NTY4ODU3NjUzMjczMzYMDzA0NjU3MzQ4MzU2MzYwOAwPNjE3MDQyMTU1ODEwMDgyDA84NTU4NDU4NzIxMjExNTgMDzc1MzYzNzI4MDgyNDIyNwwPNTM3MzAzNzU0MzYzMTI3DA81MzYyNjU4NjQ0MzcwMjIMDzc3MjcxODU4ODcxNDI0MwwPMDUwNjY2MDAwNTgyMzE3DA81MjE1NDY3MDYwMzYzMTAMDzczODQ1ODcyNzU1NTY1MgwPMTE1NTUwNzYxNjcwNzQ4DA82NzcwMDcyNjgwMTQzNTEMDzI4ODU3NTgzNTA1NzI1NwwPMzcxNjIzMjQyMjgwNzQ3DA8zNTU2Njg2NDAwMzgwNzQMDzQxNzExMzQ4ODQ0MDc1NAwPNzY2MzAwMjU4MTI2NzcyDA8xODU1ODE0NDUwMTM2NzMMDzg1ODIzMDY1NjYxNzY2NQwPMzIyNjQ2NzA3Njc3NjU3DA83ODg4ODU2MTAxODczNzIMDzc2MDgyNDcyMDI4NzcxNwwPNTc4Mjc0MTMzNDM3MTgwDA8yNDEyMzMzNDE4NzEyNTIMDzcyMjg3MjQ4MzY4MjA1MwwPNTQ0MDQyNDIzMzU2NDQ3DA83MjI2MDg3NTUwNjQ4MTEMDzM1NTE2NDU4NTcxMzcyNQwPNTE1NDI4NTQwNTQ0NzU0DA8yODUyNzU4NTE3MDc4NDcMDzY0Njc0NjUwMTEwNzQ2MAwPMDA3MDczMTQ1NjU1NTgwDA8wNTIzMTc1ODA0MDQ2NjQMDzUwNTAwMTY3NTg2MjU2MAwPMzEwMzQ4ODA0NDQxNzM1DA8wNzE0NzI1NzA4MTYyNTAMDzYzMjA4Mjg0NDY4MzE3NQwPNjUxNjY2MTgzNDY3MDI4DA8zNDgxMjA0ODI1NzM2NDgMDzE3MjUwODIxMDUxMTg2NgwPMzg2MTI2NTYxMzM3NzMzDA81NjAxMzU2MDYwMjE2ODcMDzI4MjY2NzgzNDUwMTI1MgwPMDIzMjY4NzIxODYxNDEwDA8xNDE4NjgyODg1MTQyNjgMDzcwNjMyMDQ4MDYyNTQ2NQwPNTA0NDMwNzE1MTA4NzQxDA8xNTQ4MTAwMjU4NDMzNTAMDzgxMTY4NjYyMTEwNTY0NwwPODY4NDM0MzU4MDY0MTA2DA82MzE2ODQ2MjMzMDA3NjgMDzgxODc0MzgxMDc2NjY3OAwPMTE0MzQyNDI0NTYwMzE2DA8wODU0MDQ3NjM4NTc4NjEMDzM1MTAyMjcyMjE4NzI0NgwPNzc2Njc4MzE3NDMyNDAwDA82MzIwNDE4Mjc2NzEyMzEMDzc2NDA3MjEzODMxNjEyMAwPNjMxNTUxODMzMTc2NjA2DA8yMzIwNDA4NzQ1NDc1MzcMDzI2NTA2MjExMjEyNjEyOAwPMjc0NDM1MDgyNzIzODYyDA80MDI0NjA0MjAwMzIyNzgMDzgwODg0MTI0ODExODYwMwwPMzAxMDM0NDE0NjUwNjcxDA8wNTc4NTM0ODc1NTg2MDIMDzc2MDYxNTMxNjU4MzAxNgwPNzgxMTgyNDIxNzUwNTA4DA8yMTEzNzY3MDczNDExNjYMDzc0MzM0NzQxNDgxNzI4NwwPMjg4NjE3NTM4MDQ0MjY2DA80MDMwODExMjE0MzE2MDEMDzc3NDU1MDgxNDQwMjYzNwwPNjc2NDQ2NDEyMjUzMzUxDA80NjE4ODQwNDgyMjI0MTMMDzQ2ODcwNDc1MDEyMzM1MwwPNTA4MzM0Njc3NjI1ODYyDA82NTY2MzEzNjQzMDE3MzIMDzcxMzI2NTgyNTUyMDIwMgwPNjIzMTQ2ODM0Mjg3NzI0DA8zODIwNTg3Mjc2Njg4NjcMDzA3MjcwNjYwNzc1MTUyMAwPNDg1NzY3NDI2NDU0MDE4DA84NTI0MDAzNTE2NDY1MjIMDzIyODEwNTgzMDY0MTM3NgwPMDAzNDczMTIzNTYwODcyDA8yMDA1ODA0Njg1NzY0NDIMDzc2MDg3MTc2NzUzNDUyNAwPNzg2MDI4Mzg2NTAyNDE4DA8xMzY4NTAwMTg1NDA4MzMMDzIyMzY1MzA3Nzg0MjQ1OAwPMTI4NzM4MDg3MjcxMzQyDA8xMjA4Mzc2MjQwMjQ0MzIMDzA3NTE3NTgxMzA2MDc0NAwPNjM4NTY0MTAyNTEyMzMzDA8wMjE4MjcyMzA3NDQ3MzUMDzAzMjAyNTQzMjc1ODUwMgwPMDY3Nzc1MTc1MDAzMjMwDA8wNzc1NDc0ODgwMTg0NzIMDzc0NjcwNjczNTAwMzMyMQwPODQ4MzgwODA0MjAxNDExDA8zMTQ4NTYwNTI0MzQ4NjAMDzI4ODAzNDUyNDI4MjQ0NQwPMDIyNTI4NTExNzg2NDQwDA82MDQwNjgxMDg1NzA1MjMMDzY1NTYyMjY3ODcwNTE2MgwPNTY0NDIxMDIyNTI3NzQzDA8wMjE1MjE3MDI1MDI4ODQMDzYzNzgwMTY1NTA0MDc2NwwPMzA3MTE4NDExMTc2NTU3DA8wMDYxNzI3NTM0NDQxMjAMDzU1MzgxNzI4Nzg4MDA3OAwPMzI2MjU2NjQ0MTIyNDc3DA8zNTgyNjQ0NDI2NzQ1NzcMDzQyMTg3MDg3MjMyNDIwNQwPNTE3NTMzMzE4ODY1NTE1DA81MDQ1Mjc3NjI1ODQ3NzAMDzcxNDAyNDQxMjEyNzgzOAwPNTIzMTYxODE4Mzg1NTEwDA8wMDI3Nzg2MzEyMDQ0ODQMDzMzNTUxMDcxMTYxODAwOAwPNDU1MDYwODMzMzMyMjM4DA80NTM4NzExNjE1MDg1MDMMDzQ0MzQ3MjUxNzM4MDU2NwwPNjIwMDM1MDg1MzU0NDcxDA81NjE4NjMzNTE2MjU0MDUMDzE1Mzc4NjYwMDgxNDM2NAwPNzgwMDgyNjEzODc2MzgzDA81Njc0Nzg1NTg0ODczMjcMDzM1NTIwNDg4NTMwMTM3NAwPNDA4MDAwNzU3MDQzODYxDA81NjgxNjQ1ODcyMzIwMTgMDzQ4MTUzMjMxODUyNzM0MAwPMzE0NDI0NjY4Mjc4NDg2DA81NDc3NzIwODcwMDU4NjMMDzMzMjExMTUwODMzODI2MgwPNDU3MjI4MzM3NjAzNzAwDA80ODQyODAzODQyNjg1NTYMDzEzMjMxMjQ3Nzc3ODQ2NAwPNjI3NjQyMDY2NTA0MzUzDA82NTAwNjEyMTIxNjY2MzcMDzE1MTA3ODY0MTc3NDUwMAwPNDEwODIyNDIwNzcyMDg0DA83NjEyMjY3ODYxODU4MjcMDzcxMDMyNTE1MjcwNDIxNAwPODY2NjU4MzA4MjEwMjcyDA80MjI3ODc4NDg1NTg3NDcMDzgzNzcxNDQ4MTI2MTg1NwwPNjM1ODY2MTA1MTIxMTcxDA83NDU2MDExNTM2MzAzNzUMDzg1MjUyNjE3MjM1MDUyOAwPNjI1MDM3NzY2MTc1MDc0DA84NzAyNDIyMjMyMjAyMzUMDzQ0MzQwMDMxNTYyNTY0NAwPODUzNDUyNzgyODAwMzcxDA8xMDM1MTY3NTY0NDgzNTYMDzQyMzUxMzYwNjcwMjUzOAwPMTcyMTAxNDg2MjcyNDUxDA80MzIzNDI0NDg3NjUwMDUMDzc1NjI4MDAxNDU1ODQxNAwPMTE1NjU2ODE2NzAwMDM0DA8wMjc4MjQ0MDc3MzU4NTIMDzM1NzYxNTgxMDYyNTA4MAwPMTIwNTQ4NjUzNTgwNTgxDA80MTI2MDg3NzAzMjI4NzMMDzYwMzgwNjQ4NjIxNTY0NQwPODQxNzE1NjIyMzQ4NjczDA82ODI0MjQ0MDIzNjUwMzcMDzQ0NzQwNTU0ODI1NjI3MgwPMTEwNDQwMTMwMjIyODM0DA8xNTQ0NDMzNzU1NjgzMTYMDzI3MTExNDU4MTYwNjM3OAwPNDIyNjU0MzI0MzM2NjA3DA83NjQ0MTQ1MDcyNDg0NDYMDzE3MzU3NzgxMjE1NDQ2MwwPNzcwNjAwMzAxMzgwNzAxDA80NTM0MzYzNjQwNzIwMjEMDzgzNzIyNTQ1NTUyMjAyMgwPNjAyMzQ2MjIwMjUyODA3DA84MzAyMDExMDQwNjA2MjIMDzUyODQ4NTgzMzg2MDI4MwwPMTc1NDc2NTA0NDQxMDQwDA83MTM1NDE2Njc3NDE2NzYMDzIwODU2NDcwMzYyNDU3NwwPMDA4NDcwMDIxMjg4MDU3DA8zMDAwMDA1ODIwODQ4NzYMDzE4MzI0NzEwNDIwNTQxNQwPMzEzODY2NTA3NTM0NjI1DA8zNzcwMDcyMDgxMjgzMTMMDzIyNzQ2ODIyMjE0MDIzMAwPODE2MjU3MDEyMDI0MjE3DA83NjAyMDMwMDY4MTM3MTEMDzQxMjgyNTE0NTQzMzIzOAwPMzI2MzU2MTE4Njg2NjQ3DA82NTM2NDIwMTcwMzI0MzMMDzEwODQ3MjYzMDAxODc1MAwPNzM3MDI3ODI4NDUzNzQzDA8xODQ4NzI1MjI1NDg1NzIMDzgxNTQ3NTA1MzYxNDEzNwwPNzUyMTg2ODY3MzYzMzMwDA82NTM0MzgyNjU0MTQyODUMDzIwMjQyMjI1MTA1NzQ1MQwPNzE1MzQ1MDI2MDY0MTIwDA8xNTcwNjc0MzM4MzA1NjUMDzcxNDcyNjIzODQ4MTA2NwwPMjg0NjM4NTY3MjM1MDYwDA8yNzQ3NjAzNDc3NTMwMzEMDzIyMTYzNjgwNTE3NDAzNQwPNjgzMjI2MTEzMTUxODA1DA82NTgwMzE2NDIyMzU0NzQMDzYyNjQwNzYyODAyMjAzMwwPMjIxMzgxNDgzMTMyMzI3DA8xNjU2NzEwNTI3ODI1NDgMDzY1ODgyMTU2ODU2ODY2NAwPMzY3MTU3NDUxMjIxNzU3DA8zNzMzMzUyNTE0MDgzODYMDzcwNDYwNjYwNTEyNzA3MwwPMjgzODg0ODU2ODI1MzA3DA8wODQzNzIyMzgwMTYxNzMMDzM3ODAyODExNzgyMjE3MgwPMzU3MjQ1MDI3MDQ1MDM2DA82NDUxNzAzNjg2NDQ3NzUMDzE1MDQyNTY0MDAxMTUwMQwPODYyMDMzNDQwNDgxNDcwDA82NzE4MDgwMTU1MDUxNDUMDzQ0NDI1NjQ3MjA1MTQ1MQwPNTU0MjM1MzI1NTg2MTIzDA84MzQ1NDUwODgyMjA3MjEMDzc4NjU1MjIxODYwODIxNQwPMzgyMDU1NjIyNTE0ODMwDA81MDMyNTMzMzExNDcyNjcMDzAxNDc2ODA4MzA0MDgzMQwPNTE0MzY4ODgxNDQxNTI0DA84ODMyMTUzMDMyNTQxMjUMDzAyNDQyNzE2MTIyMjg0MQwPNjI1NTYyMTQ3NDc2NDA2DA84NzM4NTA2MTgxNzc3MTMMDzIyNjM2NzU0MDczNjAxMQwPMzYzNjA4NDQ0Njg4MDEyDA80NzMzNzYzNTAwNzc2ODUMDzY3NTA1ODUxMDY3NDgwOAwPNTc1MDM1NDYxMzg2NDEyDA80NjU4Mjg0Mzg0NjY4MTgMDzIwNjE2NTg4NjU1NTczMAwPMjUzNjQxNDQzMTEyMjA0DA8xODE1MTE0MDI3NTA4MzMMDzU2NDYxNDQ1MTAxNTM3MgwPMDEyODQ2MzI2NjM2MjUxDA8zNjUzMDg2ODgwNTY3MjYMDzg4Njg2NjA2ODEzNDQ1MwwPNjM4ODMwMzEyNDA4MzgwDA81NTUzNzA4MDc2NTI0MDcMDzE2NDY0MTI3NzE1MjM2MwwPMzg3MTA2NTg4NDQ2NjEwDA8xNTIxMTc4ODY2NjI1MjYMDzU0MTU3ODIyMzQ1MjEwNAwPMDQ3MTMwODYwMzU0NDA2DA84MzQ2NDA3NTI4MDQ1NTcMDzExMDc4NjcxNDQ0NjI1NwwPMzUwMjEyMzAzNjgwMTQ0DA8xODc4ODI4ODQ3NDIyNzYMDzg1MzU1NDg4NTg0NTMxMgwPMTQ2NzY3MjI0Njc1MTY1DA84MTY1MjEwMjU0MjIwMTUMDzM1Nzg2NzMzNTczMTc1OAwPNzQwMjUwNTgyMDI3MzM0DA84MDcwNzA0NzUyNDA3MTQMDzcyMDA0MDI1MTgwMzczNwwPMDMyMjI4NzU1ODA3NDcwDA8zNDY0NTQyNzA1NDIxNTEMDzQ0MTMxODAyNzA4NzMzMAwPNjg2NjEyMDgyNjEwODg3DA8wMzUwNTY4NDQwNjA4NzMMDzUzMTc1NTQ4NDg4MTQ2MwwPNTc0ODA4NDUyMzU0MjU0DA8zODQyMDUwMjU1MTUwNTEMDzgxNTU1NDAwMjg4ODgyMwwPNjg0MDMzMDYwMTc4MzYzDA8yNTE3NDc3MjU2MTEwMTIMDzUzODQ0NDcwNDgzMjUwNAwPMDY2MzUyNTQzNjQwNTI2DA8xNjY0NzU1MTAzNjAwMjIMDzMwODE3ODA0NjI3MDQ2NgwPNTEyODQwMTI2MzUzMjYzDA82NTU3NjY3NzE0NDU2NDYMDzIyNDc3NjQ4MDE3NTc1NQwPNDc2MTAwMjYyMDMwNzQzDA8xMjE1NTExMDc3MjYxNDcMDzExNDc2NTMyMDU0MDEyNQwPNzY1Mjc2Njg0MTE1MjQ1DA80NDc1Nzg1NDgwMzEwODAMDzQ0MzgyMDY0ODQ0MDYwNgwPMDg3MDAwMDgzNjIyMDMwDA8yNjg4NDM3MzYxNDM2MDUMDzgzMjMxNTM4MTQ3MzE0NgwPMzI2Njg1MjI4MjYzNDM3DA81ODgxODAxMzUwNTEwNTAMDzQ0NTEzNDYwMDUxMDA1OAwPMzI3NzQxNjUxNjU3MTU1DA80MTYwMTgyNTQwMjg1NDUMDzQ3MDE2MDE3MTE0Mzc3OAwPNzYwNjAxMjU3NzgwNjgwDA80NjE1MzQ4NDU1NTU3NjcMDzU2MjIzMzYxMzAxMTcyNgwPMTQzNzE2ODMxMTg4MjI0DA8wNDM3ODQ3MzU2NDYzMzEMDzg1MDU3MzQ4ODEyMTYwMAwPMzEzMTA3MjIwMjM0MjMxDA83NTczMDcyNjE2NTMzODIMDzE2MTEwODYyNjY1Nzg2NAwPNTUyNzUxMzAyNDA3ODg1DA8yNDA2MTg2MDc1NjEwMzgMDzA0NTA2MzcwNzQyODQ0MgwPODUzNzA1NTIwNTYwNzY2DA8yNTI4NTI3NDU2NTQ4NDUMDzMyNzE3ODIxMjMwMjc1NAwPMjMxMzA4MTE0MzU3MjE3DA8zNDQ3NDU3ODY4MzIxNzQMDzI0NzM0NDc3MTI4ODE4NwwPMzM2ODEzODAxMTUxMzg3DA8xMTU4MjU1MDAxMzg2MjIMDzQxMTcxNDQ4MjAwMjAyNQwPMjQ0NDU1MjYyNjA4NjIyDA8wMDUzNDgzMzg3MjI1NzYMDzY1NzM2NzExMTc4NjYyMQwPMDE2MDU0MTIxODY3NDcwDA8xNDU2ODcwNDY4MDEzMjAMDzIwNTg1MjYyODE1NzA4NwwPNTIyNDY4MjQxMTQ2MTU1DA8zMzY2MjMyNTY4MzczMjUMDzAxMTMzNzg3Nzc0ODU3MgwPMTE0ODU4MDEzMjE4NTIzDA84Nzg1MDc0MjYwMDgwMTIMDzQ2MzM2NDE4NzE1NjYyMQwPNTcwMzMyMDYxMzI1MDUzDA83Nzg1MzA4ODQ2NTMyNjgMDzMzNjgxMjIxNDQ0Mjg3NwwPNjIxODI1MjYxMzMxODQzDA8yNTc1NzU3MTc3MzI1MDIMDzYyNDQ4MjU3NTI4NTAyMAwPMzQ4NDA1NjU2MTUyMjI3DA83NjY3MDAxMzU1MTQ1NzIMDzYzODM0NDE1MjUzMTcyNgwPNjAzMjEwODA1NzIyNzU1DA84NzAxNjcxMTM2ODU3MzYMDzYyMjI4NjQ0NjIyNTM4NgwPODcwNTgyNzYyNTg1MzUzDA8wNDMzNTg2MzAzMjU2ODcMDzc1ODI2NTA4NDQzNTA0MQwPMDM4MjM4NzI3ODUwNTQ2DA83MjYxMzQyMDgzMzYyMTEMDzU2ODM3NTIxMjU1MDgxMwwPNzM0MDQyMzExNDMwNzQ2DA83MDU3NDIwNTcyODU3MDQMDzg4NTA3NzAxNDYxMDc0MQwPODExNDI3NTA4NDgxMTIyDA80MzM2MzQ0NjQxNDU3NjQMDzc0MDAxMzY3NTc4MzE2MwwPODg1MzUwMzI2MTcwMDc4DA84NDQwMzY3MDI4MzYxMzQMDzc0ODA4NzY4NjA2NTcxMAwPODA3NDg3MTU2NzcyNjg3DA82NDY4NzIzNzU1MDU2NjcMDzI4NTE2Nzc0NTgyMDY1MwwPNDY2ODczNDUxODI0MzE4DA81NDg2NzIzMzA3MDgxODQMDzcyNjQ1NjgwMzI2MDI3NwwPMzE1MDM4ODAyMDY1NDgzDA83NjEzMjczNjM2NjM4ODEMDzQ2NjUzMzYyMzg1MjcwNAwPMTQ4ODE4MTQ4ODcxODE1DA82ODQzMDIzNDc2ODU4MDYMDzUzNjEyODQzMzMwMDgzNwwPNDAxMzQ4Njc0ODg3NzE0DA84NjQ1NzU4MDI4MTg4ODYMDzc2NTQ3NzIwMzIzMDEwMQwPMDA4MTI2MjA1Mzc2NzA0DA8wNjM4NjAwNTI4MjY0MTQMDzY4MDg0MTc0Mzc3MTQ2MwwPNDUyMzg3ODU4NjEzNzA4DA80MjYyMjA2NTMwNTIwNTMMDzc3NzM1NDE1ODQzMzg1NQwPODcyNDc2ODQyMzY4NjI3DA82NTQ3NDQ3NjMwNTMyNzUMDzg0NjU2MjMxMTYxNjYwOAwPNzEzMTUzNzM3MTE1MDMwDA8yMDQ2Nzg2MjczMTEzNjUMDzU4MTYwNDcxNzIwNjY0MQwPMTYxODIzMDIzMTUzNjEyDA83MTgwMDM4MDEwMzc4NjAMDzA2ODQyNDc0NTQwNjIzMQwPMzU0NzQyMzc2NDQ4MDU4DA8wODc4MzUyMjc4MTc3MTcMDzQ4ODYzNDEyNjExNjMxNAwPMDA0NDAxMDE1MDc2OTc1DA8wMDQ0MDEwMTE0Mzg0MDEMDzAwNDQwMTAxMTQxOTc0MAwPNjUxODAxNjc4NjQ1MDA0DA8zNjgyMDMwMDY0MDIzMjgMDzAwMDAwNTA2MTY2NTYwMAwPMzczNjczMTAyMjE1ODY3DA81NTAwNjE2NjQzNDcxNzAMDzI3MjgzODQ4NDUzNjcxNgwPMTUyMTM4MDIxNTg0MTAxDA8yMDMxMTA1NjM2MzM3MTgMDzQzNDI3MDYyNzMzODEwOAwPMzY4MTUxODcyMjE0Mzg0DA80NzI3MjI4NzExNTg4ODQMDzYxMzMxMjMwNjQ2MTA1MAwPODgxODgxNzEwNjI2NzI0DA8xNTIxNTE3MjA2MzEyMTcMDzA0MzUwNzIyNzU1NjQyNQwPMTY3ODAxMzIwNjIwMDQ4DA83MDQwMzU4MzEyNTQzMjIMDzQ3Mzg4MDM2MDg3ODE2MgwPMTE3NTQxODEwMDM2NTg1DA83NDIxMjQyMDUxNzYxMzIMDzEzMzg4MTI4NDM1MTUxMQwPNDE1ODcyMjUwNDg4MjYwDA8yMzUwNjIzNjcyODMzMzYMDzQyMTU3Mzc4MjMxMzcxNwwPODU2MjIxNjM2NTQyODM4DA82Mzc1NDI2MTI3MDUxMTcMDzg4ODU2NDAyODYzMTA3MQwPNzg4NDc3MjM1Njg0MjEzDA8zMzA0MjQxMjQ0ODM0MTgMDzI3NTQzNzExMTQ0NzIzNgwPNTMwNjQwNjM3ODIzMjQyDA8xMjExNDIzMjE1ODI0NDUMDzMxNDY2MzMzNjQxMDUzMgwPNzI1NzE2NDI4NDIzNTIwDA8zNjM4NTYyMDI0MjYxMTQMDzIzNTUxNTY2MzI0NDMwMwwPNjI4NzYxMjE4MDA4MjY4DA8xMzg0MDcxNzM0ODY3MTYMDzYzNjYxMzI2MTM3NjU4MgwPNTg3MTE2MjcyMDcxMTEwDA8yNDA1NDAzMDQzMjc3NDgMDzM0MTYxNDI2MDMxMDI3NAwPNDQwNTc4NzE0NDM1NjI0DA82MTc3NzY0MTYwNzUwMTMMDzA1NDE1MTAzNzI3NzYxNgwPNjMzNDU2MzM0NTQ0NjE2DA8wNjU3NzY1NTE4NDQzODIMDzIxMzMzMTU4NTY2ODE1NgwPNTgxNTAwMjY2ODY3NTIwDA81NDMzNDI4NDYwNzc0MzcMDzAzNjM3NTcyNzgwNjc1MAwPMDcyMzQ2ODg0NTU3MDg0DA8yMjcyNzYzNzIzODcyODYMDzEwNDg3NjUwNzUxNTU4MAwPODIxMDY1MTIzNjM4MjU1DA83MjMwNzc1ODA2MTE1MzEMDzI2MDYxNjMzNDIwNzU0NAwPMzU2NTY0NjM4MDYxNzQxDA8yNDY4NzMzNTA3MjgyODAMDzIyNTgwMjIwODI0NzcxMwwPNDQ4MTQ3MzEzNzAwODM0DA82MTYwMzg4NTgzODYxMDMMDzc4NjcyODgzODg2MjA3NQwPNjgwMTczNTYxNzgwMjg0DA81NjA4MzA4NDcyMDgxMDAMDzYyMjM0ODI0NjIzNTY3NAwPNDA3NDc4Mzg0MTExMzQxDA8xNDgxMDI1NzU3MzA3MjEMDzY1MDY1ODI2MTQ1MzE3MQwPMDgyMzU0MjIwNzQ2NzU3DA82MjQ4MjY2NDc4MTE1ODIMDzI3MjI2MTI3Mjc0NDA0NAwPNTIwMjIwNzgwMTc2MTY2DA81MDE1MzI4MDE0MDgxMjUMDzI1NDMwMzcwMDQyODgyOAwPNjc0NDc4ODY4MzQ4MjgxDA80NjMzMTY3NDU1MjcyNzUMDzQ3MTE4NTQ1MDIwMzEyMgwPNjM1NDgwMjg2MTEzNjUyDA82MTM0MzE4MjI4NTI3NzMMDzIyMTYzNDczNDg2MTA4NgwPNjE4NjU3NDcxNzUyMTE0DA8zMjg1MjU1MTIzMTgwNzAMDzQ2MTAzMTQ0NDAzMDMyNAwPNTc2ODU4NDI3MjE0MTg2DA82NjU0MDAwNjgwMjgxMzEMDzMwNTcyMzIxODQ0MTgxMwwPNTQ1MTg0NDYwMDg4NTQ2DA82ODExMDczNDM4Njg3MzgwDQYJKoZIhvcNAQEFBQADgYEAQq6zHN8SP8w71Yyq+cwwNQ2VZ4UMPRw/9JkW8ZUJWC4gae2lOfeyyjtN3akXaT+p+vETtfoPuCpPjvzPYoN1RZieyJnpSVzUrNw/lM6kSP5DjGg5K/WKWYad0VkQg56Kynp2YVX4yKUhBydd7iBeSGP900LAHRWCR++xq+r98mI=
+MIDlet-Jar-RSA-SHA1: PRpjLFh81oAjHdPSZ/9lTe64ICSSHOk/MQMdRSqwsoGMSPID91mBRFEYOIQ/5nocEscacSi81o089Y0gMpEIP8V/EWBD7WDP6xqjC0gSyac+QjZm1Bu7Pzav+JC5J3KEkKOGy4wgQKJx02bArR/P9LhYAe7T6LVVFbfFyw2lhJA=
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/EmptyLines.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/FL_Rocks.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,6 @@
+MIDlet-Version: 1.0
+MIDlet-Vendor: Standing Still Limited
+MIDlet-Jar-URL: http://195.114.231.97:7001/dls/delivery/ds/01AAvJ1WX3jmZsurMwoC/1/FL_Rocks.dm
+MIDlet-Install-Notify: http://195.114.231.97:7001/dls/delivery/ds/01AAvJ1WX3jmZsurMwoC/2/FL_Rocks/status
+MIDlet-Name: Rocks
+MIDlet-Jar-Size: 28196
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/NDRM.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,10 @@
+MIDlet-Jar-URL: NDRM.jar
+MIDlet-Install-Notify: http://uljava.gjmptw.de:8080/Index/Index/NDRM.jad?nstalled=NDRM_harmony
+MIDlet-Name: DRMonitor
+MIDlet-Vendor: m-internet.com Limited
+MIDlet-Version: 1.0
+MIDlet-Jar-Size: 24472
+MIDlet-Icon: /icon.png
+MIDlet-1: NDRM, /icon.png, ndrm.NDRMMIDlet
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/PlatformReqHTTP.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,11 @@
+MIDlet-1: PlatformReqHTTP, , com.nokia.midp.test.securitytests.PlatformReqHTTP
+MIDlet-Jar-Size: 2272
+MIDlet-Jar-URL: PlatformReqHTTP.jar
+MIDlet-Name: PlatformReqHTTP
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-2.0
+URL: http://tcktest3.extra.wirelessfuture.com:8080/axis/servlet/marika.GetServlet
+MIDlet-Certificate-1-1: MIICPDCCAaUCBD+zblMwDQYJKoZIhvcNAQEEBQAwZTELMAkGA1UEBhMCZmkxEDAOBgNVBAgTB1Vua25vd24xEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQwwCgYDVQQLEwNKQ0YxFDASBgNVBAMTC01hcmlrYSBGYWJlMB4XDTAzMTExMzExNDMxNVoXDTEzMTExMDExNDMxNVowZTELMAkGA1UEBhMCZmkxEDAOBgNVBAgTB1Vua25vd24xEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQwwCgYDVQQLEwNKQ0YxFDASBgNVBAMTC01hcmlrYSBGYWJlMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDsUJbYMb9GlP99Ax9n6m2AIAg+b2zC0u6h7OuLP+ls9OpI0sLtE1uBABCePloS0uKwmjtsdFc1zLyA/bpbi644xDw3PMIEhppeuKbLrog5uMk5wD1bFk5kJXYwYEorWVrFpLDmqFwEMig2a+Uhf7eTq1Ze/JgMHoUDXRo0eVsnFwIDAQABMA0GCSqGSIb3DQEBBAUAA4GBACuTqh37N34NnVzziuj66gmiE3rt7fKDTUCiqoHGfv7dpr4M0e8+y6FvtXtUXEajxX/DZbZuy0E9mZqmXsYyP2DDKbCg4cBJ23uOCffuYYVQFSnv4RQFVrQr4jMUHgX7wT5Ox4Ee8xcpsvWWfOgTY4zyEznOBUj6Uw4Xj7F+1yk8
+MIDlet-Jar-RSA-SHA1: UfQMdprNMMmJOk9INrJXe+Y06tnuL+zOJz4gJNEKnLPOzb6UwR2zczNddwfdBxENKbhw2RVp3GBQD2OZjB6UEU4kiw2S956RMlk5OVfqwXB5wvYPCePX6/8qgKSUmsBjNiEpXBGE2UT7MqbRApxmsf/OaDnzzd9Tlr9jUw+YU3w=
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MIDlet-Name: SimpleRMS
+Created-By: 1.5.0_12 (Sun Microsystems Inc.)
+MIDlet-Vendor: Unknown
+MIDlet-1: SimpleRMS, SimpleRMS.png, SimpleRMS
+MIDlet-Version: 1.0
+MicroEdition-Profile: MIDP-2.0
+
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/SimpleRMS8.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,24 @@
+IGP-BS: MP3D=MP3D_BS;SCDA=SCDA_BS;ASP3=ASP3_BS;PSDK=PSDK_BS;
+IGP-CATEGORIES: WN=WN;BS=BS;PROMO=0;OP=OP;
+IGP-DEMOS: DEMOPG=DEL;
+IGP-PROMOS: MB3D=MB3D;PB07=PB07;BBRK=BBRK;
+IGP-VERSION: 2.5.0
+IGP-WN: RBPF=RBPF_WN;MMN=MMN_WN;BRBO=BRBO_WN;ASCR=ASCR_WN;
+MIDLET-FULLVERSION-URL: http://advers.bestgamfts.com/redir/?from=D725&game=MD3D&op=GONG&game_type=DM&lg=EN
+MIDlet-1: Sun Shines 3D Demo, /icon.png, HightS3D
+MIDlet-Data-Size: 8192
+MIDlet-Description: Sun Shines 3D, Emulated sun shine in full 3D!
+MIDlet-Icon: /icon.png
+MIDlet-Jar-Size: 754864
+MIDlet-Jar-URL: SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.jar
+MIDlet-Name: Sun Shines 3D Demo
+MIDlet-Vendor: Celedons Two
+MIDlet-Version: 1.0.4
+Nokia-MIDlet-Block-Uninstall: true
+Nokia-MIDlet-Category: Applications
+Nokia-MIDlet-UID-1: 0x20012293
+Nokia-Scalable-Icon: /icon.svg
+Nokia-Scalable-Icon-MIDlet-1: /icon.svg
+URL-OPERATOR: http://bestgamfts.hereis.com/redir/?from=D725&op=GONG&game_type=DM&lg=EN&ver=2.5.0
+URL-PT: 0
+URL-TEMPLATE-GAME: http://bestgamfts.hereis.com/redir/?from=D725&op=GONG&game=XXXX&game_type=DM&lg=EN&emb=1&ver=2.5.0
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/SunShines3D_DEMO_nokia_N900_EN_IGP_ATandT_901.zip has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,14 @@
+MIDlet-1: TestMidlet, TestMidlet.png, TestMidlet
+MIDlet-Jar-Size: 3674
+MIDlet-Jar-URL: TestMidlet.jar
+MIDlet-Name: TestMidlet
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-2.0
+: Empty attribute name
+ : White space only attribute name
+ : White space only attribute name 2
+a<>: separators in attribute name
+bo: control characters in attribute name
+c:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet2.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,3 @@
+a<>: separators in attribute name
+bo: control characters in attribute name
+c:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/TestMidlet3.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,9 @@
+MIDlet-1: TestMidlet, TestMidlet.png, TestMidlet
+MIDlet-Jar-Size: 3674
+MIDlet-Jar-URL: TestMidlet.jar
+MIDlet-Name: TestMidlet
+MIDlet-Vendor: Nokia
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-2.0
+o: attribute name starts with CTL characters
+MIDlet-Version: 1.0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,32 @@
+MIDlet-1: Calculator, i.png,common.control.CalculatorMIDlet
+MIDlet-Name: Calculator
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.5
+MIDlet-Jar-Size: 123
+Nokia-MIDlet-Category: Application
+Nokia-UI-Enhancement: CanvasHasBackground
+MIDlet-Data-Size: 150
+Vertical-Move-Delta: 10
+Vertical-Move-Period: 2
+Inline-Editing-Supported: true
+Nokia-Platform: Nokia*
+Nokia-MIDlet-Category: Games
+Nokia-MIDlet-Name-en: Calculator
+Nokia-MIDlet-Name-de: Rechner
+Nokia-MIDlet-Name-es-ES: Calculadora
+Nokia-MIDlet-Name-fr: Calculatrice
+Nokia-MIDlet-Name-it: Calcolatrice
+Nokia-MIDlet-Name-tr-TR: Hesaplamalar
+Nokia-MIDlet-Name-nl-NL: Rekenmachine
+Nokia-MIDlet-Name-pt-PT: Calculadora
+Nokia-MIDlet-1-en: Calculator
+Nokia-MIDlet-1-de: Rechner
+Nokia-MIDlet-1-es-ES: Calculadora
+Nokia-MIDlet-1-fr: Calculatrice
+Nokia-MIDlet-1-it: Calcolatrice
+Nokia-MIDlet-1-tr-TR: Hesaplamalar
+Nokia-MIDlet-1-nl-NL: Rekenmachine
+Nokia-MIDlet-1-pt-PT: Calculadora
+MIDlet-Jar-Size: 84713
+MIDlet-Jar-URL: calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.jar
+Nokia-MIDlet-Category: Best-Sellers
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/calc2_en_de_es_ES_fr_it_tr_TR_nl_NL_pt_PT.zip has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceac00.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,12 @@
+MIDlet-Name: ASCII
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceac00/bin/CEAC00.jar
+MIDlet-Jar-Size: 1494
+MicroEdition-Profile: MIDP-2.0
+MicroEdition-Configuration: CLDC-1.0
+MIDlet-1: ASCII,,USASCII.CEAC00_01
+MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=9F732D83F3B6AF98EB6577EA92366D95&tID=ceac00
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cecn02.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,12 @@
+MIDlet-Name: ùÓùÔùÕ
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cecn02/bin/CECN02.jar
+MIDlet-Jar-Size: 1417
+MicroEdition-Profile: MIDP-2.0
+MicroEdition-Configuration: CLDC-1.0
+MIDlet-1: ùÓùÔùÕ, ,Big5.CECN02_01
+MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=C9EABB544D0A47788C684D71A5A1C8C9&tID=cecn02
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cecn06.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,12 @@
+MIDlet-Name: ‚X‚Y‚Z‚[
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cecn06/bin/CECN06.jar
+MIDlet-Jar-Size: 1415
+MicroEdition-Profile: MIDP-2.0
+MicroEdition-Configuration: CLDC-1.0
+MIDlet-1: ‚X‚Y‚Z‚[,,GBK.CECN06_01
+MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=79CD95B6352F8388513D6DDB699817CF&tID=cecn06
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis00.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,19 @@
+MIDlet-Name: ÷ùø
+
+MIDlet-Vendor: Nokia
+
+MIDlet-Version: 1.0
+
+MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceis00/bin/CEIS00.jar
+
+MIDlet-Jar-Size: 1450
+
+MIDlet-1: ÷ùø, , ISO8859_1.CEIS00_01
+
+MicroEdition-Configuration: CLDC-1.0
+
+MicroEdition-Profile: MIDP-2.0
+
+MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=1D11AB7B2A1E2BC200165EB4CF554232&tID=ceis00
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis09.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,11 @@
+MIDlet-Name: ¢£¤
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceis09/bin/CEIS09.jar
+MIDlet-Jar-Size: 1457
+MicroEdition-Profile: MIDP-2.0
+MicroEdition-Configuration: CLDC-1.0
+MIDlet-1: ¢£¤, ,ISO8859_15.CEIS09_01
+MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=7F914DE931B9D04E5F731F1ADCD163F6&tID=ceis09
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceis14.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,12 @@
+MIDlet-Name: ??»
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceis14/bin/CEIS14.jar
+MIDlet-Jar-Size: 1456
+MIDlet-1: ??», ,ISO8859_16.CEIS14_01
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-2.0
+MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=336AA79A2E085DC20583865B841DBE6B&tID=ceis14
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cejp04.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,4 @@
+MIDlet"DNa"De:"D"D@!"D"D"D"D"D"D"DMIDlet"DVe"Ddo"D"D"DNoki"D"D"DMIDlet"DVe"D"Dio"D"D"D1."D"D"DMIDlet"DJa"D"DURL:"DCEJP04"Dja"D"D"DMIDlet"DJa"D"DSi"De:"D1439"D"DMIDlet"D1:"D"D@!"D"D"D"D"D"D"D"DJISX0208"DCEJP04_0"D"D"DMicr"DEditio"D"DCo"Dfigu"Datio"D"D"DCLDC"D1."D"D"DMicr"DEditio"D"DPr"Dfile"D"DMIDP"D2."D"D"D
+MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=CF0B99F53572032690A4D26E0CB83D02&tID=cejp04
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/ceko01.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,11 @@
+MIDlet-Name: ÍÎÏÐ
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/ceko01/bin/CEKO01.jar
+MIDlet-Jar-Size: 1429
+MIDlet-1: ÍÎÏÐ, ,KOI8_R.CEKO01_01
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-2.0
+MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=64E5A88BE41622497EDF05039C15F26C&tID=ceko01
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cems01.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,12 @@
+MIDlet-Name: ýþ€
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cems01/bin/CEMS01.jar
+MIDlet-Jar-Size: 1465
+MicroEdition-Profile: MIDP-2.0
+MicroEdition-Configuration: CLDC-1.0
+MIDlet-1: ýþ€, ,windows_1250.CEMS01_01
+MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=3F627BEFBC6E8A0FB9510BA4EB42AE6F&tID=cems01
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/cems11.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,12 @@
+MIDlet-Name: ýþÿ
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MIDlet-Jar-URL: http://195.134.231.83:7070/java-server/resources/man_jam/cems11/bin/CEMS11.jar
+MIDlet-Jar-Size: 1467
+MicroEdition-Profile: MIDP-2.0
+MicroEdition-Configuration: CLDC-1.0
+MIDlet-1: ýþÿ, ,windows_1256.CEMS11_01
+MIDlet-Install-Notify: http://195.134.231.83:7070/java-server/getresult.jsp?phone=3EBDFC736561D6876CF9ED93D3BF1B36&tID=cems11
+
+
+
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut03.jad has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut04.jad has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut08.jad has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/ceut09.jad has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/einstein_EN_FR_IT_DE_ES_N97_v2942.jar has changed
Binary file javamanager/javainstaller/installer/tsrc/testdata/utils/javahelper.mif has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/mine_en_fr_de_it_es_ES_pt_PT.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,33 @@
+MIDlet-Name: HecticMine
+MIDlet-1: HecticMine,/images/icon.png,com.nokia.mid.appl.mine.common.MineMIDlet
+Nokia-MIDlet-Category: Game
+MIDlet-Icon: /images/icon.png
+MIDlet-Vendor: Nokia
+MIDlet-Version: 3.0.4
+MIDlet-Description: HecticMine
+Period-Speed-ms: 100
+Vertical-Text-Offset: -2
+Nokia-Platform: Nokia*
+Nokia-MIDlet-Name-en:
+Nokia-MIDlet-Name-fr: Hectic Mine
+Nokia-MIDlet-Name-de: Hectic Mine
+Nokia-MIDlet-Name-it: Hectic Mine
+Nokia-MIDlet-Name-es-ES: Hectic Mine
+Nokia-MIDlet-Name-pt-PT: Hectic Mine
+MIDlet-Jar-Size: 233616
+MIDlet-Jar-URL: mine_en_fr_de_it_es-ES_pt-PT.jar
+MIDlet-Certificate-1-1: MIIDhDCCAmygAwIBAgIEQhnyeTANBgkqhkiG9w0BAQUFADAzMQ4wDAYDVQQKEwVOb2tpYTEhMB8
+ GA1UEAxMYTm9raWEgQ29udGVudCBTaWduaW5nIENBMB4XDTA1MDIyMTE0Mzg0OVoXDTE2MDEwMjExMDUwNFowKDEOMAwGA1UEC
+ hMFTm9raWExFjAUBgNVBAMTDU5va2lhIENvbnRlbnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAK2PV8KLVSZ9OePe4k
+ 78GeQ0MiujbMd1wU9/xqhUFPst50drxhKzH+fMxvXgQOJ7viReolqWyq+ZmKpikGa+6SdqHysnVBhAqo9SLMNjlMfoOXVJ/lvM
+ gOk9k5oyVhBqFonw/FDDHmINC6w9o83e3gRq1C1m2T368yHbZtKifiVdAgMBAAGjggEtMIIBKTAOBgNVHQ8BAf8EBAMCB4AwEw
+ YDVR0lBAwwCgYIKwYBBQUHAwMwggEABgNVHSAEgfgwgfUwgfIGCysGAQQBXgExAQMBMIHiMIHRBggrBgEFBQcCAjCBxBqBwVJl
+ bGlhbmNlIG9uIHRoaXMgY2VydGlmaWNhdGUgYnkgYW55IHBhcnR5IGFzc3VtZXMgYWNjZXB0YW5jZSBvZiB0aGUgc3RhbmRhcm
+ QgdGVybXMgYW5kIGNvbmRpdGlvbnMgYW5kIGxpbWl0YXRpb25zIG9mIHVzZSwgYXMgZGV0YWlsZWQgaW4gdGhlIENlcnRpZmlj
+ YXRlIFByYWN0aWNlIFN0YXRlbWVudCBhdmFpbGFibGUgZnJvbSBOb2tpYS4wDAYIKwYBBQUHAgEWADANBgkqhkiG9w0BAQUFAA
+ OCAQEAvXtgKSffVjD52zHgUEFBBmXFq3QjgWNh8+cQTD23wnPYgfA4GBomMmznLiV3X03SOOI42DUUenQ9baPb78iU8AngF6xd
+ oOpFYlNtVka9YdD9mA0jtkoe4YEmykxPabSKDS50xVYgQG+5Y9H8nO9EyIiviP6drFmpRv635mf8Trlao63XIx4geoCMb9v8vS
+ dfs0louKB9DrjwFki/uHAQvRcVYnFNtAwHdri22UMx+GMppuY4/oPVvQqxgzfP+1AX/w2lgG7pi3lbVVUB4MLhG36kZIk8/J7B
+ lmATAL1/G5t19HR3+9doz5H94y3WQG7ClWN1eoQtjLlvLfZO/iu20g==
+MIDlet-Jar-RSA-SHA1: ncuy0soEPUB4OPGHNyLn1ldXU2FvKvs0bUKGn/aPQefKI15aOlrczlapIWreUukE3ArQImU/xwxWh0
+ Q8LROEULJKXRIYyoGCCblM6o6EPYn+YT+CDd/HV8JlHS6OO+sAV//9vWuo9orIwSwdKN8wGl0g1JmPl8LF8V5/MjSmyh8=
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testdata/utils/utf8bom.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,8 @@
+MIDlet-Name: ışÿ
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MIDlet-Jar-URL: utf8bom.jar
+MIDlet-Jar-Size: 1417
+MicroEdition-Profile: MIDP-2.0
+MicroEdition-Configuration: CLDC-1.0
+MIDlet-1: ışÿ, ,UTF8BOM.UTF8BOM
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,54 @@
+<!--
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+-->
+<project name="InstallerTestServer" default="dist" basedir="..">
+ <property name="catalina.home" value="C:/apps/apache-tomcat-6.0.26"/>
+ <property name="build" value="${basedir}/build"/>
+ <property name="java.build" value="${build}/javabuild"/>
+ <property name="classes" value="${java.build}/WEB-INF/classes"/>
+ <property name="src" value="${basedir}/javasrc"/>
+ <property name="web" value="${basedir}/content"/>
+
+ <path id="compile.classpath">
+ <fileset dir="${catalina.home}/bin">
+ <include name="*.jar"/>
+ </fileset>
+ <pathelement location="${catalina.home}/lib"/>
+ <fileset dir="${catalina.home}/lib">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <target name="compile">
+ <mkdir dir="${classes}"/>
+ <javac source="1.5" target="1.5" destdir="${classes}" srcdir="${src}">
+ <classpath refid="compile.classpath"/>
+ </javac>
+ </target>
+
+ <target name="dist" depends="compile">
+ <jar jarfile="${build}/installertest.war" basedir="${java.build}"
+ manifest="${web}/META-INF/MANIFEST.MF"/>
+ <jar jarfile="${build}/installertest.war" basedir="${web}"
+ update="true"/>
+ </target>
+
+ <target name="clean">
+ <delete dir="${java.build}"/>
+ <delete file="${build}/installertest.war"/>
+ </target>
+</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/build/readme.txt Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,41 @@
+Building
+--------
+
+Requirements:
+ * Apache Ant.
+ * Apache Tomcat. (Tested with 6.0.26)
+
+Change "catalina.home" property in build.xml file to match your Tomcat
+installation directory. Default is as follows:
+
+ <property name="catalina.home" value="C:/apps/apache-tomcat-6.0.26"/>
+
+To compile the project and to create .war archive just use either of following
+commands:
+
+ ant
+ ant dist
+
+To compile only use:
+
+ ant compile
+
+And to clean all build artifacts use:
+
+ ant clean
+
+Deployment
+----------
+
+After build is complete, "installertest.war" file is created into the "build"
+directory. Deploy it to Tomcat instance as any other .war file. For HTTP
+authentication tests it is assumed that user named "guest" with password
+"guest" and with role "guest" exits.
+
+Running the tests
+-----------------
+
+Before running tests add option "-server=server_ip_address:port" to
+NotificationPosterTest, DownloaderTest and InstallerEngineTest
+test suites in jiut.bat (for S60) or in build.xml (for Linux)
+in "javainstaller\installer\tsrc\build" directory.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,8 @@
+MIDlet-1: HelloWorld, , helloworld.HelloWorld
+MIDlet-Jar-Size: 1511
+MIDlet-Jar-URL: HelloWorld.jar
+MIDlet-Name: HelloWorld
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-2.0
\ No newline at end of file
Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,10 @@
+MIDlet-1: HelloWorld, , helloworld.HelloWorld
+MIDlet-Jar-Size: 7867927
+MIDlet-Jar-URL: HelloWorld_8mb.jar
+MIDlet-Name: HelloWorld_8mb
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-2.0
+MIDlet-Install-Notify: http://<SERVER><CONTEXT>/notify?tID=900_success
+MIDlet-Delete-Notify: http://<SERVER><CONTEXT>/notify?tID=912_deletion
Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_8mb.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_ota.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,10 @@
+MIDlet-1: HelloWorld, , helloworld.HelloWorld
+MIDlet-Jar-Size: 1511
+MIDlet-Jar-URL: HelloWorld.jar
+MIDlet-Name: HelloWorld
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-2.0
+MIDlet-Install-Notify: http://<SERVER><CONTEXT>/notify?tID=900_success
+MIDlet-Delete-Notify: http://<SERVER><CONTEXT>/notify?tID=912_deletion
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,9 @@
+MIDlet-1: HelloWorld, , helloworld.HelloWorld
+MIDlet-Jar-Size: 1719
+MIDlet-Jar-URL: http://<SERVER><CONTEXT>/redirect?name=HelloWorld_redirect.jar
+MIDlet-Name: HelloWorld_redirect
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-2.0
+MIDlet-Install-Notify: http://<SERVER><CONTEXT>/notify?tID=900_success
Binary file javamanager/javainstaller/installer/tsrc/testserver/content/HelloWorld_redirect.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/MANIFEST.MF Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/content/META-INF/context.xml Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+#
+# 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:
+#
+-->
+<Context docBase="installertest" path="/installertest">
+</Context>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/content/WEB-INF/web.xml Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+#
+# 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:
+#
+-->
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
+ <display-name>installertest</display-name>
+
+ <servlet>
+ <description></description>
+ <display-name>redirect</display-name>
+ <servlet-name>redirect</servlet-name>
+ <servlet-class>com.nokia.mj.impl.installer.testserver.RedirectServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>redirect</servlet-name>
+ <url-pattern>/redirect</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <description></description>
+ <display-name>jad</display-name>
+ <servlet-name>jad</servlet-name>
+ <servlet-class>com.nokia.mj.impl.installer.testserver.JadServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>jad</servlet-name>
+ <url-pattern>*.jad</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <description></description>
+ <display-name>notify</display-name>
+ <servlet-name>notify</servlet-name>
+ <servlet-class>com.nokia.mj.impl.installer.testserver.NotifyServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>notify</servlet-name>
+ <url-pattern>/notify</url-pattern>
+ </servlet-mapping>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name></web-resource-name>
+ <url-pattern>/httpauth/*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>guest</role-name>
+ </auth-constraint>
+ </security-constraint>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ <realm-name>httpauth</realm-name>
+ </login-config>
+
+ <security-role>
+ <role-name>guest</role-name>
+ </security-role>
+
+</web-app>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/content/httpauth/HelloWorld_http_auth.jad Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,8 @@
+MIDlet-1: HelloWorld, , helloworld.HelloWorld
+MIDlet-Jar-Size: 1721
+MIDlet-Jar-URL: HelloWorld_http_auth.jar
+MIDlet-Name: HelloWorld_http_auth
+MIDlet-Vendor: Nokia
+MIDlet-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-2.0
\ No newline at end of file
Binary file javamanager/javainstaller/installer/tsrc/testserver/content/httpauth/HelloWorld_http_auth.jar has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/JadServlet.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.mj.impl.installer.testserver;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Servlet implementation class JadServlet
+ */
+public class JadServlet extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ protected void processRequest(HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ ServletContext context = getServletContext();
+ String localPath = context.getRealPath(request.getServletPath());
+
+ response.setContentType("text/vnd.sun.j2me.app-descriptor");
+
+ BufferedReader in = null;
+ ServletOutputStream out = null;
+
+ try
+ {
+ in = new BufferedReader(new FileReader(localPath));
+ out = response.getOutputStream();
+
+ String line = in.readLine();
+ while (line != null)
+ {
+ if (line.startsWith("MIDlet-Jar-URL:")
+ || line.startsWith("MIDlet-Install-Notify:")
+ || line.startsWith("MIDlet-Delete-Notify:"))
+ {
+ line = line.replaceAll("<SERVER>", request.getServerName()
+ + ":" + request.getServerPort());
+ line = line.replaceAll("<CONTEXT>",
+ request.getContextPath());
+ }
+ out.println(line);
+ line = in.readLine();
+ }
+ }
+ catch (FileNotFoundException e)
+ {
+ response.sendError(HttpServletResponse.SC_NOT_FOUND,
+ request.getServletPath());
+ }
+ finally
+ {
+ if (out != null)
+ {
+ out.close();
+ }
+ if (in != null)
+ {
+ in.close();
+ }
+ }
+ }
+
+ protected void doGet(HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ processRequest(request, response);
+ }
+
+ protected void doPost(HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ processRequest(request, response);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/NotifyServlet.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.mj.impl.installer.testserver;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Servlet implementation class NotifyServlet
+ */
+public class NotifyServlet extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ protected void processRequest(HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ response.setStatus(HttpServletResponse.SC_OK);
+ }
+
+ protected void doGet(HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ processRequest(request, response);
+ }
+
+ protected void doPost(HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ processRequest(request, response);
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installer/tsrc/testserver/javasrc/com/nokia/mj/impl/installer/testserver/RedirectServlet.java Thu Aug 19 09:48:13 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:
+*
+*/
+
+package com.nokia.mj.impl.installer.testserver;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * Servlet implementation class RedirectServlet
+ */
+public class RedirectServlet extends HttpServlet
+{
+ private static final long serialVersionUID = 1L;
+
+ protected void processRequest(HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ int redirectCount = 1;
+ String redirectUrl = "http://" + request.getServerName() + ":"
+ + request.getServerPort()
+ + request.getContextPath();
+
+ String countParam = request.getParameter("count");
+ String nameParam = request.getParameter("name");
+
+ if (countParam != null)
+ {
+ try
+ {
+ redirectCount = Integer.parseInt(countParam);
+ }
+ catch (NumberFormatException nfe)
+ {
+ }
+ }
+
+ if (redirectCount > 1)
+ {
+ redirectUrl += request.getServletPath() + "?count="
+ + (redirectCount - 1) + "&name=";
+ }
+ else
+ {
+ redirectUrl += "/";
+ }
+
+ redirectUrl += nameParam;
+ response.sendRedirect(redirectUrl);
+ }
+
+ protected void doGet(HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ processRequest(request, response);
+ }
+
+ protected void doPost(HttpServletRequest request,
+ HttpServletResponse response)
+ throws ServletException, IOException
+ {
+ processRequest(request, response);
+ }
+
+}
--- a/javamanager/javainstaller/installerui/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -1,6 +1,6 @@
<!--
#
-# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
# All rights reserved.
# This component and the accompanying materials are made available
# under the terms of "Eclipse Public License v1.0"
@@ -12,7 +12,7 @@
#
# Contributors:
#
-# Description:
+# Description:
#
-->
@@ -50,6 +50,16 @@
</copy>
</target>
+ <target name="compile">
+ <condition property="installer.ui.excludes"
+ value="com/nokia/mj/impl/installer/ui/eswt/*.java"
+ else="com/nokia/mj/impl/installer/ui/eswt2/*.java">
+ <isset property="RD_JAVA_UI_QT"/>
+ </condition>
+ <echo message="installerui compilation excludes: ${installer.ui.excludes}"/>
+ <omj.javac excludes="${installer.ui.excludes}"/>
+ </target>
+
<target name="create.internal.api.jar" depends="export.data">
<omj.internal.apis includes="com/nokia/mj/impl/installer/ui/*.class"/>
</target>
--- a/javamanager/javainstaller/installerui/build/javainstallerui_0x2002DCB6.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/build/javainstallerui_0x2002DCB6.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javainstallerui.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../../inc
Binary file javamanager/javainstaller/installerui/data/java_3_trusted.png has changed
Binary file javamanager/javainstaller/installerui/data/java_3_untrusted.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/installerui/data/javaapplicationinstaller.css Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,205 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+QScrollArea#dialogArea {
+ /* General size parameters for all installer dialogs */
+
+ /* this depends on display; NHD portrait width:360px and height:640px used */
+ /* Note that popup width and height is according to portrait dimensions, and is the same in portrait and landscape */
+ width: 346.6px; /*expr(var(hb-param-screen-short-edge)- 2*var(hb-param-margin-gene-screen)); /* 2un*/
+ /*height: /*the size of MessageBox with 3-5 rows of text? */
+ max-height: 626.6px; /*expr(var(hb-param-long-edge)-2*var(hb-param-margin-gene-screen));
+ /*position: vertically and horizontally centre of screen - is this needed?*/
+}
+
+QScrollArea#appInfoArea {
+ /* This is valid for all installation query application details,
+ * and also for application details in short error message */
+ /* (ViewBase) */
+ /* Note: this text area becomes scrollable if there are more text
+ * that can be displayed at one time (this could be also QAbstractScrollArea?)*/
+ margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+}
+
+QLabel#heading {
+ /* Any installation query heading text: its text size, and top/left margins */
+ font-size: 26.8px; /*hb-param-text-height-primary;/*4un*/
+ font-weight: bold;
+ max-height: 53.6px; /*expr(var(hb-param-text-height-primary)+2*var(hb-param-margin-gene-popup)) - same as hb-param-widget-popup-heading-height;*/
+ margin-top: 13.4px; /*hb-param-margin-gene-top; /*2un*/
+ margin-left: 13.4px; /*hb-param-margin-gene-left; /*2un*/
+}
+
+QLabel#contentIcon {
+ /* This is valid for all icons displayed in the installation query content area */
+ /* Application icon, question icon, error icon in installation error dialog etc */
+ margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ /* size of icon - fixed size */
+ min-width: 53.6px; /*hb-param-graphic-size-primary-large;/*8un*/
+ max-width: 53.6px; /*hb-param-graphic-size-primary-large;/*8un*/
+ min-height: 53.6px; /* hb-param-graphic-size-primary-large;/*8un*/
+ max-height: 53.6px; /* hb-param-graphic-size-primary-large;/*8un*/
+}
+
+QComboBox#driveSelector{
+ /* Combo box in installationquery. Need to define the top margin at least (InstallConfirmationView). */
+ margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/
+}
+
+QProgressBar#progressBar{
+ /* Progress bar in installationquery. Need to define the top margin at least (ProgressView). */
+ margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/
+}
+
+QLabel#permissionDetails{
+ /* String that requests access for protected functionality in permission query */
+ /* (PermissionInfo) */
+ margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+}
+
+QLabel#errorLabel{
+ /* short error message from USIF (note: this is not Java specific error message but
+ * common to all installers), (ErrorView) */
+ font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/
+ margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/
+}
+
+QLabel#detailsWarningLabel{
+ /* Application is certified / is not certified views and permission details
+ * view texts (CertificateDetailsView, PermissionDetailsView) */
+ font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/
+}
+
+QLabel#urlLabel{
+ /* Text in authentication dialog (UsernamePasswordView) */
+ /* Note that this dialog is always in portrait */
+ font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/
+ margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+}
+
+QLabel#authLabel{
+ /* Text in authentication dialog (UsernamePasswordView) */
+ /* Note that this dialog is always in portrait */
+ font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/
+ margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+}
+
+QLabel#usernamePasswordLabel{
+ /* Label of username and password input fields in authentication dialog (UsernamePasswordView) */
+ /* Note that this dialog is always in portrait */
+ font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/
+ margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+}
+
+QLabel#usernamePasswordInputField{
+ /* Input fields of username and password in authentication dialog (UsernamePasswordView) */
+ /* Note that this dialog is always in portrait */
+ font-size: 23.45px; /*hb-param-text-height-secondary; /*3.5un*/
+ margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/
+ margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-bottom: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+}
+
+/* --- Buttons --- */
+
+QPushButton {
+ font-size: 20.1px;/* hb-param-text-height-tiny; /*3un*/
+}
+
+QPushButton#softKeyButton{
+ /* Installation query OK button (ConfirmationViewBase) */
+ margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ height: 50.25px; /*hb-param-widget-popup-softkey-height;/*7.5un*/
+ /* this depends on display; NHD portrait width:360px and height:640px used */
+ width: 173.3px; /*expr((var(hb-param-screen-short-edge)-2*var(hb-param-margin-gene-screen))/2); /* width of one button is half of popup width*/
+}
+
+QPushButton#softKeyButtonWide{
+ /* Ok button to go back from a details view (application is certified / not certified views
+ * and permission details view) (CertificateDetailsView, PermissionDetailsView)*/
+ /* this ok button has different top margin otherwise the same as OkCommand button with max-width */
+ margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/
+ height: 50.25px; /*hb-param-widget-popup-softkey-height;/*7.5un*/
+}
+
+QPushButton#securityButton{
+ /* Security lock icon button in installation query heading (ViewBase.createSecurityButton) */
+ margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ /* size of icon */
+ min-width: 26.8px; /* hb-param-graphic-size-primary-small; /*4un*/
+ max-width: 26.8px; /* hb-param-graphic-size-primary-small; /*4un*/
+ min-height: 26.8px; /* hb-param-graphic-size-primary-small; /*4un*/
+ max-height: 26.8px; /* hb-param-graphic-size-primary-small; /*4un*/
+
+}
+
+QPushButton#detailsLink{
+ /* Button in permission query to view details (PermissionConfirmationView) */
+ margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-left: 13.4px; /*hb-param-margin-gene-left; /*2un*/
+ margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+}
+
+QPushButton#allowButton{
+ /* Allow always function button in permission query */
+ /* (PermissionConfirmationView) */
+ margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-top: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+
+}
+
+QPushButton#denyButton{
+ /* Ask me later function buttons in permission query */
+ /* (PermissionConfirmationView) */
+ margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/
+}
+
+QPushButton#cancelButton{
+ /* Cancel installing function button in permission query */
+ /* (PermissionConfirmationView) */
+ margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-top: 5.025px; /*hb-param-margin-gene-middle-vertical; /*0.75un*/
+ margin-bottom: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+
+}
+
+QCheckBox#retainDataButton {
+ /* Retain user data check box button in update query */
+ /* Note that there is 2*hb-param-margin-gene-middle-vertical margin at the top as this check box is placed
+ * after drive selector combo */
+ /* (InstallConfirmationView) */
+ margin-right: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-left: 13.4px; /*hb-param-margin-gene-popup; /*2un*/
+ margin-top: 10.05px; /*expr(2*var(hb-param-margin-gene-middle-vertical));
+}
+
+/* --- End Buttons --- */
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUi.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUi.java Thu Aug 19 09:48:13 2010 +0300
@@ -385,6 +385,13 @@
}
/**
+ * Executes given Runnable synchronously in the UI thread.
+ */
+ public void syncExec(Runnable aRunnable)
+ {
+ }
+
+ /**
* Writes an info log entry to JavaInstaller log.
*
* @param aMsg message to be logged
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUiFactory.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/InstallerUiFactory.java Thu Aug 19 09:48:13 2010 +0300
@@ -50,9 +50,9 @@
installerUi = (InstallerUi)clazz.newInstance();
installerUi.init(aMode, aListener);
}
- catch (Exception ex)
+ catch (Throwable t)
{
- logError("Instantiating " + className + " failed", ex);
+ logError("Instantiating " + className + " failed", t);
}
return installerUi;
}
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallConfirmationView.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallConfirmationView.java Thu Aug 19 09:48:13 2010 +0300
@@ -23,18 +23,13 @@
import java.io.InputStream;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.SWTException;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Shell;
/**
* InstallConfirmationView asks installation confirmation
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallerUiEswt.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/InstallerUiEswt.java Thu Aug 19 09:48:13 2010 +0300
@@ -35,6 +35,7 @@
import java.io.InputStream;
import java.io.IOException;
+import java.util.Enumeration;
import java.util.Hashtable;
import org.eclipse.ercp.swt.midp.UIThreadSupport;
@@ -48,6 +49,8 @@
import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.extension.DisplayExtension;
+import org.eclipse.swt.internal.extension.ImageUtil;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Composite;
@@ -126,7 +129,6 @@
// Create a hashtable for icons.
iImageTable = new Hashtable();
// Create a new thread to be the UI main thread.
- iUiThreadExists = true;
UIThreadSupport.startInUIThread(new Runnable()
{
public void run()
@@ -145,6 +147,7 @@
private void uiMain()
{
log("uiMain: thread started");
+ iUiThreadExists = true;
try
{
// Create the necessary views.
@@ -201,10 +204,7 @@
display.sleep();
}
}
- if (iBoldFont != null && !iBoldFont.isDisposed())
- {
- iBoldFont.dispose();
- }
+ disposeResources();
display.dispose();
log("uiMain: display disposed");
synchronized (iExitWaitObject)
@@ -512,6 +512,12 @@
// updating it.
synchronized (iProgressSyncObject)
{
+ if (iDlProgressView != null && iDlProgressView.isVisible())
+ {
+ // If download progress is being displayed,
+ // do not display installation progress.
+ return;
+ }
if (iDisplayProgress && !iProgressView.isVisible())
{
iProgressView.setVisible(true);
@@ -994,6 +1000,14 @@
}
/**
+ * Executes given Runnable synchronously in the UI thread.
+ */
+ public void syncExec(Runnable aRunnable)
+ {
+ iParent.getDisplay().syncExec(aRunnable);
+ }
+
+ /**
* Returns string title basing on mode of this InstallerUi.
*/
protected String getTitle()
@@ -1033,17 +1047,21 @@
{
return iSecurityIcon;
}
- String iconFilename = ResourceUtil.UNTRUSTED_ICON_NAME;
+ int id = ImageUtil.THEME_IMAGE_SECURITY_UNTRUSTED;
if (aIdentified)
{
- iconFilename = ResourceUtil.TRUSTED_ICON_NAME;
+ id = ImageUtil.THEME_IMAGE_SECURITY_TRUSTED;
}
- String resourceDir = ResourceUtil.getResourceDir(0);
- for (int i = 1; iSecurityIcon == null && resourceDir != null; i++)
+
+ try
{
- iSecurityIcon = loadImage(aDisplay, resourceDir + iconFilename, false);
- resourceDir = ResourceUtil.getResourceDir(i);
+ iSecurityIcon = ImageUtil.createImageFromTheme(aDisplay, id);
}
+ catch (Throwable t)
+ {
+ log("Can not load security icon: " + t);
+ }
+
return iSecurityIcon;
}
@@ -1133,22 +1151,26 @@
try
{
long startTime = System.currentTimeMillis();
- ImageData[] imageDatas = new ImageLoader().load(aInputStream);
- ImageData imageData = imageDatas[0];
+
+ Image image = new Image(aDisplay, aInputStream);
if (aScaleImage)
{
- Point bestSize = getBestImageSize(
- imageData.width, imageData.height);
- if (bestSize.x != imageData.width ||
- bestSize.y != imageData.height)
+ int maxWidth = DisplayExtension.getBestImageWidth(DisplayExtension.LIST_ELEMENT);
+ int maxHeight = DisplayExtension.getBestImageHeight(DisplayExtension.LIST_ELEMENT);
+ Rectangle rect = image.getBounds();
+ if (maxWidth != rect.width || maxHeight != rect.height)
{
- imageData = imageData.scaledTo(bestSize.x, bestSize.y);
- log("Image " + aImageName + " scaled from " +
- imageDatas[0].width + "x" + imageDatas[0].height +
- " to " + bestSize.x + "x" + bestSize.y);
+ // Copy and scale natively preserving the aspect ratio
+ result = ImageUtil.scaleImage(aDisplay, image, new Point(maxWidth, maxHeight), true);
+ image.dispose();
+ image = null;
}
}
- result = new Image(aDisplay, imageData);
+ if (result == null)
+ {
+ result = image;
+ }
+
long endTime = System.currentTimeMillis();
log("Loaded image " + aImageName + " (load time " +
(endTime - startTime) + " ms)");
@@ -1162,33 +1184,6 @@
return result;
}
- /**
- * Determines the best image size for the image of given size.
- */
- private static Point getBestImageSize(int aWidth, int aHeight)
- {
- // Actually maximum image width and height should be obtained with
- // org.eclipse.swt.internal.extension.DisplayExtension
- // getBestImageWidth() and getBestImageHeight().
- final int MAX_WIDTH = 50; // max width in pixels
- final int MAX_HEIGHT = 50; // max height in pixels
- Point result = new Point(aWidth, aHeight);
- if (result.x > MAX_WIDTH || result.y > MAX_HEIGHT)
- {
- if (result.x >= MAX_WIDTH)
- {
- result.x = MAX_WIDTH;
- result.y = MAX_WIDTH * aHeight / aWidth;
- }
- if (result.y >= MAX_HEIGHT)
- {
- result.x = MAX_HEIGHT * aWidth / aHeight;
- result.y = MAX_HEIGHT;
- }
- }
- return result;
- }
-
/** Returns true if UI has been created and can be used. */
protected boolean isUiReady()
{
@@ -1284,6 +1279,13 @@
}
return iBoldFont;
}
+
+ int iconLabelTopMargin()
+ {
+ // Aproximating the space at the top of a Label.
+ // eSWT's Label adds extra space around texts but not around images.
+ return getBoldFont().getFontData()[0].getHeight();
+ }
void setActiveView(ViewBase aView)
{
@@ -1299,4 +1301,24 @@
{
return iActiveView;
}
+
+ private void disposeResources() {
+ if (iBoldFont != null && !iBoldFont.isDisposed())
+ {
+ iBoldFont.dispose();
+ }
+ if (iSecurityIcon != null && !iSecurityIcon.isDisposed())
+ {
+ iSecurityIcon.dispose();
+ }
+ Enumeration e = iImageTable.elements();
+ while (e.hasMoreElements())
+ {
+ Image img = (Image)e.nextElement();
+ if (img != null && !img.isDisposed())
+ {
+ img.dispose();
+ }
+ }
+ }
}
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/ViewBase.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt/ViewBase.java Thu Aug 19 09:48:13 2010 +0300
@@ -412,7 +412,11 @@
gridData.horizontalSpan = aColumns;
gridData.horizontalAlignment = SWT.CENTER;
gridData.verticalAlignment = SWT.TOP;
+ // This is to lower the image at the same level with the texts.
+ // eSWT's Label adds extra space around texts but not around images.
+ gridData.verticalIndent = iInstallerUi.iconLabelTopMargin();
label.setLayoutData(gridData);
+ label.setFont(iInstallerUi.getBoldFont());
return label;
}
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/CertificateDetailsView.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/CertificateDetailsView.java Thu Aug 19 09:48:13 2010 +0300
@@ -79,7 +79,7 @@
Label detailsLabel = createLabel(
InstallerUiTexts.get(InstallerUiTexts.NOT_CERTIFIED_TITLE),
horizontalSpan, labelStyle);
- detailsLabel.setFont(iInstallerUi.getBoldFont());
+ setCssId(detailsLabel, "heading");
// Add domain category label.
createLabel("", horizontalSpan, labelStyle);
@@ -103,6 +103,7 @@
new String[] { appName }),
horizontalSpan, labelStyle);
+ setCssId(warningLabel, "detailsWarningLabel");
}
/**
@@ -118,7 +119,7 @@
(InstallerUiTexts.get
(InstallerUiTexts.CERTIFICATE_TITLE),
horizontalSpan, labelStyle);
- detailsLabel.setFont(iInstallerUi.getBoldFont());
+ setCssId(detailsLabel, "heading");
SigningCertificate certificate = iCerts[iCertIndex];
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ConfirmationViewBase.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ConfirmationViewBase.java Thu Aug 19 09:48:13 2010 +0300
@@ -100,6 +100,7 @@
createCommands();
setDefaultCommand();
}
+ iInstallerUi.loadCss();
setVisible(true);
iInstallerUi.unhide();
}
@@ -184,6 +185,14 @@
if (iOkText != null)
{
iOkCommand = new Button(getCommandComposite(), SWT.PUSH);
+ if (iCancelText != null)
+ {
+ setCssId(iOkCommand, "softKeyButton");
+ }
+ else
+ {
+ setCssId(iOkCommand, "softKeyButtonWide");
+ }
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = horizontalSpan;
iOkCommand.setLayoutData(gridData);
@@ -230,6 +239,14 @@
if (iCancelText != null)
{
iCancelCommand = new Button(getCommandComposite(), SWT.PUSH);
+ if (iOkText != null)
+ {
+ setCssId(iCancelCommand, "softKeyButton");
+ }
+ else
+ {
+ setCssId(iCancelCommand, "softKeyButtonWide");
+ }
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = horizontalSpan;
iCancelCommand.setLayoutData(gridData);
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorDetailsView.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorDetailsView.java Thu Aug 19 09:48:13 2010 +0300
@@ -69,20 +69,20 @@
protected void createView()
{
// Add title.
+ Label titleLabel = null;
String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_FAILED);
if (iInstallerUi.getInstallInfo() != null)
{
- Label titleLabel = createLabel(title, getColumns() - 1, SWT.WRAP);
- titleLabel.setFont(iInstallerUi.getBoldFont());
+ titleLabel = createLabel(title, getColumns() - 1, SWT.WRAP);
// Add security icon.
iCertificates = iInstallerUi.getInstallInfo().getCertificates();
createSecurityButton();
}
else
{
- Label titleLabel = createLabel(title, getColumns(), SWT.WRAP);
- titleLabel.setFont(iInstallerUi.getBoldFont());
+ titleLabel = createLabel(title, getColumns(), SWT.WRAP);
}
+ setCssId(titleLabel, "heading");
int horizontalSpan = getColumns();
int labelStyle = SWT.WRAP;
@@ -90,6 +90,7 @@
// Begin widgets creation.
Label errorLabel = createLabel(
iException.getDetailedMessage(), horizontalSpan, labelStyle);
+ setCssId(errorLabel, "errorLabel");
// End of widgets creation.
}
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorView.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ErrorView.java Thu Aug 19 09:48:13 2010 +0300
@@ -78,7 +78,7 @@
else
{
Label titleLabel = createLabel(title, getColumns(), SWT.WRAP);
- titleLabel.setFont(iInstallerUi.getBoldFont());
+ setCssId(titleLabel, "heading");
}
int horizontalSpan = getColumns();
@@ -87,6 +87,7 @@
// Begin widgets creation.
Label errorLabel = createLabel(
iException.getShortMessage(), horizontalSpan, labelStyle);
+ setCssId(errorLabel, "errorLabel");
// End of widgets creation.
if (iInstallerUi.getInstallInfo() != null)
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallConfirmationView.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallConfirmationView.java Thu Aug 19 09:48:13 2010 +0300
@@ -33,7 +33,6 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
@@ -107,15 +106,7 @@
protected void createView()
{
// Add header.
- String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY);
- if (iInstallInfo != null)
- {
- if (iInstallInfo.getOldVersion() != null)
- {
- title = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY);
- }
- }
- addHeader(title, iInstallInfo, null);
+ addHeader(null, iInstallInfo, null);
GridData gridData = null;
int horizontalSpan = getColumns();
@@ -127,6 +118,7 @@
{
// Add installation drive selector.
iDriveSelector = new Combo(getComposite(), SWT.READ_ONLY);
+ setCssId(iDriveSelector, "driveSelector");
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = horizontalSpan;
iDriveSelector.setLayoutData(gridData);
@@ -156,6 +148,7 @@
{
// Add retain user data option.
iRetainDataButton = new Button(getComposite(), SWT.CHECK);
+ setCssId(iRetainDataButton, "retainDataButton");
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = horizontalSpan;
iRetainDataButton.setLayoutData(gridData);
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiEswt.java Thu Aug 19 09:48:13 2010 +0300
@@ -27,7 +27,6 @@
import com.nokia.mj.impl.installer.ui.LaunchAppInfo;
import com.nokia.mj.impl.installer.ui.PermissionInfo;
import com.nokia.mj.impl.installer.ui.UninstallInfo;
-import com.nokia.mj.impl.installer.ui.eswt.MinimalUi;
import com.nokia.mj.impl.rt.ui.ConfirmData;
import com.nokia.mj.impl.rt.ui.RuntimeUi;
import com.nokia.mj.impl.rt.ui.RuntimeUiFactory;
@@ -37,6 +36,7 @@
import java.io.InputStream;
import java.io.IOException;
+import java.util.Enumeration;
import java.util.Hashtable;
import org.eclipse.ercp.swt.midp.UIThreadSupport;
@@ -47,10 +47,10 @@
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.ImageLoader;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.internal.extension.DisplayExtension;
+import org.eclipse.swt.internal.qt.BaseCSSEngine;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Composite;
@@ -62,10 +62,15 @@
*/
public class InstallerUiEswt extends InstallerUi
{
+ /** Disable UI temporarily. */
+ private static final boolean DISABLE_UI =
+ (System.getProperty("com.nokia.mj.impl.installer.ui.disableui")
+ == null? false: true);
/** Default shell style. */
private static final int SHELL_STYLE =
SWT.BORDER | SWT.APPLICATION_MODAL | SWT.ON_TOP;
+ private BaseCSSEngine iCssEngine = null;
private Shell iParent = null;
private Shell iDialog = null;
private ProgressView iProgressView = null;
@@ -98,8 +103,6 @@
private boolean iDisplayProgress = false;
/** Flag telling if the first progress bar update has been traced. */
private boolean iProgressBarUpdateTraced = false;
- /** Flag telling if MinimalUi should be used if UI creation fails. */
- private boolean iMinimalUiEnabled = true;
/** Hashtable for storing the loaded icons. */
private static Hashtable iImageTable = null;
@@ -135,7 +138,6 @@
// Create a hashtable for icons.
iImageTable = new Hashtable();
// Create a new thread to be the UI main thread.
- iUiThreadExists = true;
UIThreadSupport.startInUIThread(new Runnable()
{
public void run()
@@ -154,12 +156,14 @@
private void uiMain()
{
log("uiMain: thread started");
+ iUiThreadExists = true;
try
{
// Create the necessary views.
DisplayExtension display = new DisplayExtension();
StartUpTrace.doTrace("InstallerUiEswt display created");
display.setAppName(""); // Remove display title.
+ iCssEngine = new BaseCSSEngine(display);
iParent = new Shell(display);
iDialog = new Shell(iParent, SHELL_STYLE);
iDefaultShellBounds = iDialog.internal_getDefaultBounds();
@@ -182,10 +186,10 @@
});
// Initialize best icon size.
- iBestIconSize = new Point(
- display.getBestImageWidth(DisplayExtension.ALERT),
- display.getBestImageHeight(DisplayExtension.ALERT));
- log("Best icon size: " + iBestIconSize);
+ //iBestIconSize = new Point(
+ // display.getBestImageWidth(DisplayExtension.ALERT),
+ // display.getBestImageHeight(DisplayExtension.ALERT));
+ //log("Best icon size: " + iBestIconSize);
synchronized (iInitWaitObject)
{
@@ -216,10 +220,7 @@
display.sleep();
}
}
- if (iBoldFont != null && !iBoldFont.isDisposed())
- {
- iBoldFont.dispose();
- }
+ disposeResources();
display.dispose();
log("uiMain: display disposed");
synchronized (iExitWaitObject)
@@ -302,24 +303,14 @@
super.confirm(aInstallInfo);
waitForUi();
- boolean result = true;
if (!isUiReady())
{
- result = false;
- if (iMinimalUiEnabled)
- {
- result = MinimalUi.confirmStatic(aInstallInfo);
- log("MinimalUi installation confirmation returns " + result);
- return result;
- }
- else
- {
- // If UI is not ready by the time confirmation is requested,
- // throw an exception.
- throw new RuntimeException("JavaInstallerUi not ready");
- }
+ // If UI is not ready by the time confirmation is requested,
+ // throw an exception.
+ throw new RuntimeException("JavaInstallerUi not ready");
}
+ boolean result = true;
if (result)
{
StartUpTrace.doTrace("InstallerUiEswt confirm");
@@ -463,6 +454,7 @@
public void updateProgress(int aProgress)
{
super.updateProgress(aProgress);
+ if (DISABLE_UI) return; // Disable UI temporarily.
if (!isUiReady())
{
return;
@@ -473,6 +465,12 @@
// updating it.
synchronized (iProgressSyncObject)
{
+ if (iDlProgressView != null && iDlProgressView.isVisible())
+ {
+ // If download progress is being displayed,
+ // do not display installation progress.
+ return;
+ }
if (iDisplayProgress && !iProgressView.isVisible())
{
// Re-create iProgressView here so that it gets
@@ -509,6 +507,7 @@
public void ended()
{
super.ended();
+ if (DISABLE_UI) return; // Disable UI temporarily.
if (!isUiReady())
{
return;
@@ -553,6 +552,7 @@
public void started(DownloadInfo aDownloadInfo)
{
super.started(aDownloadInfo);
+ if (DISABLE_UI) return; // Disable UI temporarily.
if (!isUiReady())
{
return;
@@ -579,6 +579,7 @@
public void updateProgress(DownloadInfo aDownloadInfo)
{
super.updateProgress(aDownloadInfo);
+ if (DISABLE_UI) return; // Disable UI temporarily.
if (!isUiReady())
{
return;
@@ -628,6 +629,7 @@
public void ended(DownloadInfo aDownloadInfo)
{
super.ended(aDownloadInfo);
+ if (DISABLE_UI) return; // Disable UI temporarily.
if (!isUiReady())
{
return;
@@ -654,6 +656,7 @@
public void setOcspIndicator(boolean aOn)
{
super.setOcspIndicator(aOn);
+ if (DISABLE_UI) return; // Disable UI temporarily.
waitForUi();
if (!isUiReady())
{
@@ -669,9 +672,10 @@
{
public void run()
{
- iOcspProgressView = new ProgressView(self, iDialog,
- InstallerUiTexts.get(InstallerUiTexts.OCSP_CHECK_PROGRESS),
- true);
+ iOcspProgressView = new ProgressView(
+ self, iDialog,
+ InstallerUiTexts.get(InstallerUiTexts.OCSP_CHECK_PROGRESS),
+ true);
}
});
iOcspProgressView.addCancelCommand();
@@ -754,6 +758,7 @@
public void error(InstallerExceptionBase aInstallerException)
{
super.error(aInstallerException);
+ if (DISABLE_UI) return; // Disable UI temporarily.
waitForUi();
if (!isUiReady()) {
@@ -799,45 +804,6 @@
}
/**
- * Notify user that an error has occurred using RuntimeUI.
- *
- * @param aInstallerException exception indicating the error reason
- */
- /*
- private void showRuntimeUiError(InstallerExceptionBase aInstallerException)
- {
- boolean identified = false;
- if (iInstallInfo != null)
- {
- if (iInstallInfo.getCertificates() != null)
- {
- identified = true;
- }
- }
- else if (iUninstallInfo != null)
- {
- if (iUninstallInfo.getCertificates() != null)
- {
- identified = true;
- }
- }
- String tmpTitle = InstallerUiTexts.get(InstallerUiTexts.INSTALL_FAILED);
-
- // Ensure that no confirmations are being displayed.
- cancelConfirmations();
- // Hide progress view before displaying error message.
- if (iProgressView != null)
- {
- iProgressView.setVisible(false);
- }
- // Use RuntimeUi to display uninstallation error message.
- RuntimeUi runtimeUi = RuntimeUiFactory.getRuntimeUi(identified);
- runtimeUi.error(tmpTitle, aInstallerException);
- runtimeUi.destroy();
- }
- */
-
- /**
* Seeks confirmation from the user.
*
* @param aAppName the name of the application on behalf of which the
@@ -850,6 +816,7 @@
*/
public boolean confirm(String aAppName, ConfirmData aConfirmData)
{
+ if (DISABLE_UI) return true; // Disable UI temporarily.
waitForUi();
if (!isUiReady()) {
return true;
@@ -888,6 +855,7 @@
*/
public String[] getUsernamePassword(String aUrl)
{
+ if (DISABLE_UI) return new String[] { "", "" }; // Disable UI temporarily.
waitForUi();
if (!isUiReady())
{
@@ -943,6 +911,7 @@
*/
public boolean launchAppQuery(LaunchAppInfo aLaunchAppInfo)
{
+ if (DISABLE_UI) return false; // Disable UI temporarily.
waitForUi();
if (!isUiReady() || iConfirmationsCanceled || getInstallInfo() == null)
{
@@ -964,19 +933,31 @@
});
}
boolean result = iLaunchAppQueryView.launchAppQuery(aLaunchAppInfo);
- iParent.getDisplay().syncExec(new Runnable()
+ iLaunchAppQueryView.dispose();
+ iLaunchAppQueryView = null;
+ if (!result)
{
- public void run()
+ iParent.getDisplay().syncExec(new Runnable()
{
- iParent.dispose();
- }
- });
- iLaunchAppQueryView = null;
+ public void run()
+ {
+ iParent.dispose();
+ }
+ });
+ }
log("LaunchAppQuery returns " + result + " for " + aLaunchAppInfo);
return result;
}
/**
+ * Executes given Runnable synchronously in the UI thread.
+ */
+ public void syncExec(Runnable aRunnable)
+ {
+ iParent.getDisplay().syncExec(aRunnable);
+ }
+
+ /**
* Hides or unhides InstallerUi.
*/
public void hide(boolean aHide)
@@ -1011,20 +992,23 @@
*/
protected String getTitle()
{
- String result = null;
- if (iMode == MODE_INSTALL)
- {
- result = InstallerUiTexts.get(InstallerUiTexts.INSTALLING);
- }
- else if (iMode == MODE_UNINSTALL)
+ String result = super.getTitle();
+ if (isUiReady())
{
- result = InstallerUiTexts.get("Uninstalling");
- }
- else if (iMode == MODE_APP_CONVERSION)
- {
- result = InstallerUiTexts.get(
- "Converting data for application " +
- iAppConversionCurrent + "/" + iAppConversionTotal);
+ if (iMode == MODE_INSTALL)
+ {
+ result = InstallerUiTexts.get(InstallerUiTexts.INSTALLING);
+ }
+ else if (iMode == MODE_UNINSTALL)
+ {
+ result = InstallerUiTexts.get("Uninstalling");
+ }
+ else if (iMode == MODE_APP_CONVERSION)
+ {
+ result = InstallerUiTexts.get(
+ "Converting data for application " +
+ iAppConversionCurrent + "/" + iAppConversionTotal);
+ }
}
return result;
}
@@ -1044,16 +1028,24 @@
{
return iSecurityIcon;
}
- String iconFilename = ResourceUtil.UNTRUSTED_ICON_NAME;
+ String iconFilename = "java_3_untrusted.png";
if (aIdentified)
{
- iconFilename = ResourceUtil.TRUSTED_ICON_NAME;
+ iconFilename = "java_3_trusted.png";
}
- String resourceDir = ResourceUtil.getResourceDir(0);
- for (int i = 1; iSecurityIcon == null && resourceDir != null; i++)
+ try
{
- iSecurityIcon = loadImage(aDisplay, resourceDir + iconFilename, false);
- resourceDir = ResourceUtil.getResourceDir(i);
+ String resourceDir = ResourceUtil.getResourceDir(0);
+ for (int i = 1; iSecurityIcon == null && resourceDir != null; i++)
+ {
+ iSecurityIcon = loadImage(
+ aDisplay, resourceDir + iconFilename, false);
+ resourceDir = ResourceUtil.getResourceDir(i);
+ }
+ }
+ catch (Throwable t)
+ {
+ log("Can not load security icon: " + t);
}
return iSecurityIcon;
}
@@ -1144,19 +1136,21 @@
try
{
long startTime = System.currentTimeMillis();
- ImageData[] imageDatas = new ImageLoader().load(aInputStream);
- ImageData imageData = imageDatas[0];
+ Image image = new Image(aDisplay, aInputStream);
+ ImageData imageData = image.getImageData();
if (aScaleImage)
{
Point bestSize = getBestImageSize(
- imageData.width, imageData.height);
+ imageData.width, imageData.height);
if (bestSize.x != imageData.width ||
bestSize.y != imageData.height)
{
+ Point oldSize =
+ new Point(imageData.width, imageData.height);
imageData = imageData.scaledTo(bestSize.x, bestSize.y);
log("Image " + aImageName + " scaled from " +
- imageDatas[0].width + "x" + imageDatas[0].height +
- " to " + bestSize.x + "x" + bestSize.y);
+ oldSize.x + "x" + oldSize.y + " to " +
+ bestSize.x + "x" + bestSize.y);
}
}
result = new Image(aDisplay, imageData);
@@ -1178,8 +1172,8 @@
*/
private static Point getBestImageSize(int aWidth, int aHeight)
{
- final int MAX_WIDTH = iBestIconSize.x;
- final int MAX_HEIGHT = iBestIconSize.y;
+ final int MAX_WIDTH = (iBestIconSize == null? 50: iBestIconSize.x);
+ final int MAX_HEIGHT = (iBestIconSize == null? 50: iBestIconSize.y);
Point result = new Point(aWidth, aHeight);
if (result.x > MAX_WIDTH || result.y > MAX_HEIGHT)
{
@@ -1307,4 +1301,57 @@
{
return iActiveView;
}
+
+ /**
+ * Loads JavaInstaller UI stylesheet.
+ */
+ void loadCss()
+ {
+ String cssFilename = "javaapplicationinstaller.css";
+ String cssPath = null;
+ try
+ {
+ if (iCssEngine != null)
+ {
+ boolean loaded = false;
+ String resourceDir = ResourceUtil.getResourceDir(0);
+ for (int i = 1; !loaded && resourceDir != null; i++)
+ {
+ cssPath = resourceDir + cssFilename;
+ FileUtility cssFile = new FileUtility(cssPath);
+ if (cssFile.exists())
+ {
+ iCssEngine.loadCSS(cssPath);
+ log("CSS loaded from " + cssPath);
+ break;
+ }
+ resourceDir = ResourceUtil.getResourceDir(i);
+ }
+ }
+ }
+ catch (Throwable t)
+ {
+ logError("Loading CSS from " + cssPath + " failed", t);
+ }
+ }
+
+ private void disposeResources() {
+ if (iBoldFont != null && !iBoldFont.isDisposed())
+ {
+ iBoldFont.dispose();
+ }
+ if (iSecurityIcon != null && !iSecurityIcon.isDisposed())
+ {
+ iSecurityIcon.dispose();
+ }
+ Enumeration e = iImageTable.elements();
+ while (e.hasMoreElements())
+ {
+ Image img = (Image)e.nextElement();
+ if (img != null && !img.isDisposed())
+ {
+ img.dispose();
+ }
+ }
+ }
}
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiTexts.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/InstallerUiTexts.java Thu Aug 19 09:48:13 2010 +0300
@@ -30,73 +30,6 @@
/*** ----------------------------- PUBLIC ------------------------------ */
// Define constants for localised text ids.
- public static final String OK = "Ok";
- public static final String CANCEL = "Cancel";
- public static final String BACK = "Ok";
- public static final String HIDE = "Hide";
- public static final String SHOW = "Show";
- public static final String CLOSE = "Close";
- public static final String INSTALL_QUERY = "Install?";
- public static final String UPDATE_QUERY = "Update?";
- public static final String OCSP_CHECK_PROGRESS = "Checking certificate validity";
- public static final String INSTALLING = "Installing";
- public static final String INSTALL_FAILED = "Installation failed";
- public static final String INSTALLATION_COMPLETE = "Installed";
- public static final String DOWNLOADING = "Downloading";
- public static final String CONNECT_TO = "Connect to";
- public static final String DOWNLOAD_APPLICATION = "To download %U you need to authenticate yourself";
- public static final String USERNAME = "Username:";
- public static final String PASSWORD = "Password:";
- public static final String SUITE_NAME = "%U (%U)";
- public static final String SUITE_VENDOR = "%U";
- public static final String SUITE_VERSION = "%U";
- public static final String APP_NAME = "%U";
- public static final String SIZE_KB = "%U kB";
- public static final String SIZE_MB = "%U MB";
- public static final String RETAIN_USER_DATA = "Retain application data";
- // Certificate info texts.
- public static final String NOT_CERTIFIED_TITLE = "Application is not certified.";
- public static final String NOT_CERTIFIED_INFO = "Application %U is from an unknown source.";
- public static final String CERTIFICATE_TITLE = "Application is certified.";
- public static final String DOMAIN = "Domain: %U";
- public static final String DOMAIN_MANU = "Manufacturer";
- public static final String DOMAIN_OPER = "Operator";
- public static final String DOMAIN_ITP = "Trusted 3rd party";
- public static final String DOMAIN_UTP = "Untrusted 3rd party";
- public static final String ISSUER = "Issuer: %U";
- public static final String SUBJECT = "Subject: %U";
- public static final String ORGANIZATION = "Organization: %U";
- public static final String VALID_FROM = "Valid from: %U";
- public static final String VALID_UNTIL = "Valid until: %U";
- public static final String SERIAL_NUMBER = "Serial number: %U";
- public static final String FINGERPRINT = "Fingerprint: %U";
- // Texts for installation drive selection.
- public static final String DRIVE_TYPE_UNKNOWN = "%U: Unknown";
- public static final String DRIVE_TYPE_UNKNOWN_KB = "%U: Unknown (%N kB)";
- public static final String DRIVE_TYPE_UNKNOWN_MB = "%U: Unknown (%N MB)";
- public static final String DRIVE_TYPE_UNKNOWN_GB = "%U: Unknown (%N GB)";
- public static final String DRIVE_TYPE_PHONE_MEMORY = "%U: Phone memory";
- public static final String DRIVE_TYPE_PHONE_MEMORY_KB = "%U: Phone memory (%N kB)";
- public static final String DRIVE_TYPE_PHONE_MEMORY_MB = "%U: Phone memory (%N MB)";
- public static final String DRIVE_TYPE_PHONE_MEMORY_GB = "%U: Phone memory (%N GB)";
- public static final String DRIVE_TYPE_MEMORY_CARD = "%U: Memory card";
- public static final String DRIVE_TYPE_MEMORY_CARD_KB = "%U: Memory card (%N kB)";
- public static final String DRIVE_TYPE_MEMORY_CARD_MB = "%U: Memory card (%N MB)";
- public static final String DRIVE_TYPE_MEMORY_CARD_GB = "%U: Memory card (%N GB)";
- public static final String DRIVE_TYPE_INTERNAL_MASS_STORAGE = "%U: Internal Mass Storage";
- public static final String DRIVE_TYPE_INTERNAL_MASS_STORAGE_KB = "%U: Internal Mass Storage (%N kB)";
- public static final String DRIVE_TYPE_INTERNAL_MASS_STORAGE_MB = "%U: Internal Mass Storage (%N MB)";
- public static final String DRIVE_TYPE_INTERNAL_MASS_STORAGE_GB = "%U: Internal Mass Storage (%N GB)";
- // Texts for permission confirmation view.
- public static final String PERM_QUERY = "Application %U asks permissions to access protected device functionality.";
- public static final String PERM_VIEW_DETAILS = "Details";
- public static final String PERM_ALLOW_ALWAYS = "Allow always";
- public static final String PERM_ASK_ME_LATER = "Ask me later";
- public static final String PERM_CANCEL = "Cancel installing";
- public static final String PERM_VIEW_DETAILS_TITLE = "Application asks permissions for:";
-
- /*
- // Define constants for localised text ids.
public static final String OK = "button_ok";
public static final String CANCEL = "button_cancel";
public static final String BACK = "button_back_ok";
@@ -114,9 +47,8 @@
public static final String DOWNLOAD_APPLICATION = "info_auth_yourself";
public static final String USERNAME = "dialog_username";
public static final String PASSWORD = "dialog_password";
- public static final String SUITE_NAME = "info_app_suite_name";
+ public static final String SUITE_NAME_VERSION = "info_app_suite_name_version";
public static final String SUITE_VENDOR = "info_vendor";
- public static final String SUITE_VERSION = "info_version";
public static final String APP_NAME = "info_app_name";
public static final String SIZE_KB = "info_size_kb";
public static final String SIZE_MB = "info_size_mb";
@@ -161,7 +93,6 @@
public static final String PERM_ASK_ME_LATER = "button_perm_ask_me_later";
public static final String PERM_CANCEL = "button_perm_cancel_installing";
public static final String PERM_VIEW_DETAILS_TITLE = "title_perm_view_details";
- */
/**
* Method for retrieving a text string with given id and no parameters.
@@ -183,12 +114,12 @@
*/
public static String get(String aTextId, Object[] aTextParameters)
{
- return new com.nokia.mj.impl.utils.Formatter(aTextId).format(aTextParameters);
- //if (iRes == null)
- //{
- // iRes = ResourceLoader.getInstance("javaapplicationinstaller", "txt_java_inst_");
- //}
- //return iRes.format(aTextId, aTextParameters);
+ if (iRes == null)
+ {
+ iRes = ResourceLoader.getInstance(
+ null, null, "javaapplicationinstaller", "txt_java_inst_");
+ }
+ return iRes.format(aTextId, aTextParameters);
}
/*** ---------------------------- PROTECTED --------------------------- */
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/LaunchAppQueryView.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/LaunchAppQueryView.java Thu Aug 19 09:48:13 2010 +0300
@@ -18,12 +18,9 @@
package com.nokia.mj.impl.installer.ui.eswt2;
-import com.nokia.mj.impl.installer.ui.InstallInfo;
import com.nokia.mj.impl.installer.ui.LaunchAppInfo;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Button;
/**
* LaunchAppQueryView asks from the user if the installed
@@ -31,9 +28,6 @@
*/
public class LaunchAppQueryView extends ConfirmationViewBase
{
- private LaunchAppInfo iLaunchAppInfo = null;
- private Button iDefaultButton = null;
-
/** Constructor */
protected LaunchAppQueryView()
{
@@ -46,7 +40,7 @@
{
super(aInstallerUi, aParent, 8);
setTitle(InstallerUiTexts.get(InstallerUiTexts.INSTALLATION_COMPLETE));
- setCommands("Show", //InstallerUiTexts.get(InstallerUiTexts.SHOW),
+ setCommands(InstallerUiTexts.get(InstallerUiTexts.SHOW),
InstallerUiTexts.get(InstallerUiTexts.CLOSE));
}
@@ -58,7 +52,6 @@
return false;
}
- iLaunchAppInfo = aLaunchAppInfo;
// Use confirm() from super class to display the view.
boolean result = confirm();
// Return the result to the client.
@@ -68,8 +61,8 @@
protected void createView()
{
// Add header.
- String title = "Installed";
- addHeader(title, iInstallerUi.getInstallInfo(), null);
+ addHeader(InstallerUiTexts.get(InstallerUiTexts.INSTALLATION_COMPLETE),
+ iInstallerUi.getInstallInfo(), null);
// Add content to the application info Composite.
addAppInfo(iInstallerUi.getInstallInfo(), true);
}
@@ -81,26 +74,4 @@
{
// User selection data is initialized in button listeners.
}
-
- /**
- * Returns SWT style for this view.
- */
- protected int getStyle()
- {
- return SWT.V_SCROLL;
- }
-
- /**
- * Called after view and commands have been created. Subclasses
- * can overrride this method to set focus to their own default
- * commands.
- */
- protected void setDefaultCommand()
- {
- if (iDefaultButton != null)
- {
- iDefaultButton.setFocus();
- getShell().setDefaultButton(iDefaultButton);
- }
- }
}
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionConfirmationView.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionConfirmationView.java Thu Aug 19 09:48:13 2010 +0300
@@ -35,7 +35,6 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Shell;
@@ -62,7 +61,7 @@
protected PermissionConfirmationView(
InstallerUiEswt aInstallerUi, Composite aParent)
{
- super(aInstallerUi, aParent, 8, true);
+ super(aInstallerUi, aParent, 8);
setTitle(InstallerUiTexts.get(InstallerUiTexts.INSTALLING));
setCommands(null, null);
}
@@ -93,39 +92,30 @@
protected void createView()
{
// Add header.
- String title = "Install?";
- String appName = "";
- if (iInstallInfo != null)
- {
- if (iInstallInfo.getOldVersion() != null)
- {
- title = "Update?";
- }
- appName = iInstallInfo.getName();
- }
- addHeader(title, iInstallInfo, null);
+ addHeader(null, iInstallInfo, null);
GridData gridData = null;
- int horizontalSpan = getColumns();
int labelStyle = SWT.WRAP;
// Add permission query label.
- Label domainLabel = createLabel(
- InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY,
- new String[] { appName }),
+ int detailsColumns = 2;
+ int horizontalSpan = getColumns() - detailsColumns;
+ Label permissionQueryLabel = createLabel(
+ InstallerUiTexts.get(InstallerUiTexts.PERM_QUERY),
horizontalSpan, labelStyle);
+ setCssId(permissionQueryLabel, "permissionDetails");
// Add link for permission details.
if (iPermissionInfo != null &&
iPermissionInfo.getPermissionNames() != null &&
iPermissionInfo.getPermissionNames().length > 0)
{
- Link detailsLink = new Link(getComposite(), SWT.NONE);
- detailsLink.setText(
- "<a>" +
- InstallerUiTexts.get(InstallerUiTexts.PERM_VIEW_DETAILS) +
- "</a>");
- detailsLink.addListener(SWT.Selection, new Listener()
+ horizontalSpan = detailsColumns;
+ Button detailsButton = new Button(getComposite(), SWT.NONE);
+ setCssId(detailsButton, "detailsLink");
+ detailsButton.setText(
+ InstallerUiTexts.get(InstallerUiTexts.PERM_VIEW_DETAILS));
+ detailsButton.addListener(SWT.Selection, new Listener()
{
public void handleEvent(Event aEvent)
{
@@ -134,15 +124,15 @@
});
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = horizontalSpan;
- detailsLink.setLayoutData(gridData);
- addSoftKeyListenerFor(detailsLink);
+ detailsButton.setLayoutData(gridData);
+ addSoftKeyListenerFor(detailsButton);
}
- // Number of pixels on top of the buttons.
- int verticalIndent = 5;
+ horizontalSpan = getColumns();
// Add allow button.
iAllowButton = new Button(getComposite(), SWT.NONE);
+ setCssId(iAllowButton, "allowButton");
iAllowButton.setText(InstallerUiTexts.get(
InstallerUiTexts.PERM_ALLOW_ALWAYS));
iAllowButton.addListener(SWT.Selection, new Listener()
@@ -169,13 +159,13 @@
});
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = horizontalSpan;
- gridData.verticalIndent = verticalIndent;
iAllowButton.setLayoutData(gridData);
iAllowButton.setFocus();
addSoftKeyListenerFor(iAllowButton);
// Add deny button.
iDenyButton = new Button(getComposite(), SWT.NONE);
+ setCssId(iDenyButton, "denyButton");
iDenyButton.setText(InstallerUiTexts.get(
InstallerUiTexts.PERM_ASK_ME_LATER));
iDenyButton.addListener(SWT.Selection, new Listener()
@@ -202,12 +192,12 @@
});
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = horizontalSpan;
- gridData.verticalIndent = verticalIndent;
iDenyButton.setLayoutData(gridData);
addSoftKeyListenerFor(iDenyButton);
// Add cancel button.
iCancelButton = new Button(getComposite(), SWT.NONE);
+ setCssId(iCancelButton, "cancelButton");
iCancelButton.setText(InstallerUiTexts.get(InstallerUiTexts.PERM_CANCEL));
iCancelButton.addListener(SWT.Selection, new Listener()
{
@@ -232,9 +222,12 @@
});
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = horizontalSpan;
- gridData.verticalIndent = verticalIndent;
iCancelButton.setLayoutData(gridData);
addSoftKeyListenerFor(iCancelButton);
+
+ // After other widgets have been added, add content to
+ // application info Composite.
+ addAppInfo(iInstallInfo, false);
}
/**
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionDetailsView.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/PermissionDetailsView.java Thu Aug 19 09:48:13 2010 +0300
@@ -64,7 +64,7 @@
(InstallerUiTexts.get
(InstallerUiTexts.PERM_VIEW_DETAILS_TITLE),
horizontalSpan, labelStyle);
- detailsLabel.setFont(iInstallerUi.getBoldFont());
+ setCssId(detailsLabel, "heading");
// Add permission names.
String[] permNames = iPermissionInfo.getPermissionNames();
@@ -84,6 +84,7 @@
Label permissionDetailsLabel = createLabel(
iPermissionInfo.getPermissionsDetails(),
horizontalSpan, labelStyle);
+ setCssId(permissionDetailsLabel, "detailsWarningLabel");
}
}
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ProgressView.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ProgressView.java Thu Aug 19 09:48:13 2010 +0300
@@ -86,6 +86,7 @@
{
setTitle(iMsg);
iLabel = createLabel(iMsg, SWT.WRAP);
+ setCssId(iLabel, "heading");
}
iIndeterminate = aIndeterminate;
@@ -102,6 +103,7 @@
iProgressBar.setMaximum(100);
iProgressBar.setSelection(iValue);
}
+ setCssId(iProgressBar, "progressBar");
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = getColumns();
iProgressBar.setLayoutData(gridData);
@@ -115,6 +117,8 @@
// By default add cancel command to all progress bars.
addCancelCommand();
+
+ iInstallerUi.loadCss();
}
/** Update text for this progress bar. */
@@ -169,13 +173,18 @@
{
public void run()
{
+ // Set horizontalSpan to 2 for one button,
+ // and to 1 for one two buttons.
+ int horizontalSpan = 2;
+ GridData gridData = null;
+ /*
iHideCommand = new Button(getCommandComposite(), SWT.PUSH);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 1;
+ setCssId(iHideCommand, "softKeyButton");
+ gridData = new GridData(GridData.FILL_HORIZONTAL);
+ gridData.horizontalSpan = horizontalSpan;
iHideCommand.setLayoutData(gridData);
iHideCommand.setText(InstallerUiTexts.get(InstallerUiTexts.HIDE));
- iHideCommand.addSelectionListener
- (new SelectionListener()
+ iHideCommand.addSelectionListener(new SelectionListener()
{
public void widgetDefaultSelected(SelectionEvent aEvent)
{
@@ -187,15 +196,16 @@
}
});
addSoftKeyListenerFor(iHideCommand);
+ */
iCancelCommand = new Button(getCommandComposite(), SWT.PUSH);
+ setCssId(iCancelCommand, "softKeyButtonWide");
gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 1;
+ gridData.horizontalSpan = horizontalSpan;
iCancelCommand.setLayoutData(gridData);
iCancelCommand.setText(
InstallerUiTexts.get(InstallerUiTexts.CANCEL));
- iCancelCommand.addSelectionListener
- (new SelectionListener()
+ iCancelCommand.addSelectionListener(new SelectionListener()
{
public void widgetDefaultSelected(SelectionEvent aEvent)
{
@@ -234,8 +244,11 @@
public void run()
{
getShell().setDefaultButton(null);
- iHideCommand.dispose();
- iHideCommand = null;
+ if (iHideCommand != null)
+ {
+ iHideCommand.dispose();
+ iHideCommand = null;
+ }
iCancelCommand.dispose();
iCancelCommand = null;
}
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/RuntimeConfirmationView.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/RuntimeConfirmationView.java Thu Aug 19 09:48:13 2010 +0300
@@ -57,10 +57,18 @@
String[] answerOptions = iConfirmData.getAnswerOptions();
switch (answerOptions.length)
{
- case 1: setCommands(answerOptions[0], null); break;
- case 2: setCommands(answerOptions[0], answerOptions[1]); break;
+ //case 1: setCommands(answerOptions[0], null); break;
+ case 1:
+ setCommands(InstallerUiTexts.get(InstallerUiTexts.OK), null);
+ break;
+ //case 2: setCommands(answerOptions[0], answerOptions[1]); break;
+ case 2:
+ setCommands(InstallerUiTexts.get(InstallerUiTexts.OK),
+ InstallerUiTexts.get(InstallerUiTexts.CANCEL));
+ break;
default: setCommands(null, null); break;
}
+
}
/**
@@ -68,27 +76,13 @@
*/
protected void createView()
{
- // Add title.
- if (iInstallerUi.getInstallInfo() != null)
- {
- Label titleLabel = createLabel(iAppName, getColumns() - 1, SWT.WRAP);
- titleLabel.setFont(iInstallerUi.getBoldFont());
- // Add security icon.
- iCertificates = iInstallerUi.getInstallInfo().getCertificates();
- createSecurityButton();
- }
- else
- {
- Label titleLabel = createLabel(iAppName, getColumns(), SWT.WRAP);
- titleLabel.setFont(iInstallerUi.getBoldFont());
- }
+ // Add header.
+ addHeader(null, iInstallerUi.getInstallInfo(), null);
GridData gridData = null;
int horizontalSpan = getColumns();
int labelStyle = SWT.WRAP;
- // Begin widgets creation.
-
// Add question label.
Label errorLabel = createLabel(
iConfirmData.getQuestion(), horizontalSpan, labelStyle);
@@ -132,7 +126,9 @@
iAnswerButtons[iConfirmData.getAnswerSuggestion()].setFocus();
}
- // End of widgets creation.
+ // After other widgets have been added, add content to
+ // application info Composite.
+ addAppInfo(iInstallerUi.getInstallInfo(), false);
}
/**
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/UsernamePasswordView.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/UsernamePasswordView.java Thu Aug 19 09:48:13 2010 +0300
@@ -108,28 +108,33 @@
int labelStyle = SWT.WRAP;
- Label titleLabel = createLabel
- (InstallerUiTexts.get(InstallerUiTexts.CONNECT_TO), labelStyle);
- titleLabel.setFont(iInstallerUi.getBoldFont());
+ Label titleLabel = createLabel(
+ InstallerUiTexts.get(InstallerUiTexts.CONNECT_TO), labelStyle);
+ setCssId(titleLabel, "heading");
- Label urlLabel = createLabel(iUrl, labelStyle);
+ Label urlLabel = createLabel(getServer(iUrl), labelStyle);
+ setCssId(urlLabel, "urlLabel");
- Label authLabel = createLabel
- (InstallerUiTexts.get
- (InstallerUiTexts.DOWNLOAD_APPLICATION, new String[] { iAppName }),
- labelStyle);
+ Label authLabel = createLabel(
+ InstallerUiTexts.get(InstallerUiTexts.DOWNLOAD_APPLICATION,
+ new String[] { iAppName }), labelStyle);
+ setCssId(authLabel, "authLabel");
- Label usernameLabel = createLabel
- (InstallerUiTexts.get(InstallerUiTexts.USERNAME), labelStyle);
+ Label usernameLabel = createLabel(
+ InstallerUiTexts.get(InstallerUiTexts.USERNAME), labelStyle);
+ setCssId(usernameLabel, "usernamePasswordLabel");
iUsernameText = new Text(getComposite(), SWT.BORDER);
+ setCssId(iUsernameText, "usernamePasswordInputField");
iUsernameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
addSoftKeyListenerFor(iUsernameText);
- Label passwordLabel = createLabel
- (InstallerUiTexts.get(InstallerUiTexts.PASSWORD), labelStyle);
+ Label passwordLabel = createLabel(
+ InstallerUiTexts.get(InstallerUiTexts.PASSWORD), labelStyle);
+ setCssId(passwordLabel, "usernamePasswordLabel");
iPasswordText = new Text(getComposite(), SWT.PASSWORD | SWT.BORDER);
+ setCssId(iPasswordText, "usernamePasswordInputField");
iPasswordText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
addSoftKeyListenerFor(iPasswordText);
}
@@ -151,4 +156,31 @@
{
return SWT.V_SCROLL;
}
+
+ /**
+ * Returns server part from HTTP URL.
+ */
+ private String getServer(String aUrl)
+ {
+ String server = aUrl;
+ int i = server.indexOf("://");
+ if (i != -1)
+ {
+ server = server.substring(i + 3);
+ i = server.indexOf(":");
+ if (i != -1)
+ {
+ server = server.substring(0, i);
+ }
+ else
+ {
+ i = server.indexOf("/");
+ if (i != -1)
+ {
+ server = server.substring(0, i);
+ }
+ }
+ }
+ return server;
+ }
}
--- a/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/installerui/javasrc/com/nokia/mj/impl/installer/ui/eswt2/ViewBase.java Thu Aug 19 09:48:13 2010 +0300
@@ -34,6 +34,7 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.qt.WidgetConstant;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -42,6 +43,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Widget;
/**
* Base class for different InstallerUi views.
@@ -50,6 +52,8 @@
{
/** Maximum view height in percentage from display client area height. */
protected static final int MAX_VIEW_HEIGHT = 80;
+ /** Maximum view width in percentage from display client area width. */
+ protected static final int MAX_VIEW_WIDTH = 90;
/** Parent shell for this view. */
protected Shell iParent = null;
/** Container for the contents of the view */
@@ -99,6 +103,7 @@
iParent = (Shell)aParent;
iContainer = new Composite(iParent, 0);
+ setCssId(iContainer, "dialogArea");
iContainer.setVisible(false);
iColumns = aColumns;
@@ -216,7 +221,7 @@
/** Set title for this view. */
public void setTitle(String aTitle)
{
- // Dialog shells have no title anymore
+ // Dialog shells have no title.
}
/** Disposes this view. */
@@ -341,12 +346,12 @@
SWT.DEFAULT, SWT.DEFAULT));
}
- int contentWidth = iDefaultContentSize.x;
+ int contentWidth = iDefaultContentSize.x * MAX_VIEW_WIDTH / 100;
if (aVerticalScrollBarVisible)
{
int verticalScrollBarWidth =
getScrolledComposite().getVerticalBar().getSize().x;
- contentWidth = iDefaultContentSize.x - verticalScrollBarWidth;
+ contentWidth -= verticalScrollBarWidth;
}
// Recalculate the size of the content.
@@ -355,7 +360,7 @@
Point cmdContentSize = cmdComp.computeSize(iDefaultContentSize.x, SWT.DEFAULT);
cmdComp.setSize(cmdContentSize);
- // Adjust Shell height. The Shell never changes the x position, nor the width.
+ // Adjust Shell height and width.
Rectangle dispRect = shell.getDisplay().getClientArea();
int offset = iDefaultContentSize.y - contentSize.y - cmdContentSize.y;
@@ -368,18 +373,20 @@
offset -= maxHeight - newHeight;
newHeight = maxHeight;
}
+ int newWidth = defShellBounds.width;
+ int maxWidth = dispRect.width * MAX_VIEW_WIDTH / 100;
+ if (newWidth > maxWidth)
+ {
+ newWidth = maxWidth;
+ }
+ // Always center horizontally and vertically.
Rectangle dispBounds = shell.getDisplay().getBounds();
+ int x = dispBounds.width - newWidth;
int y = dispBounds.height - newHeight;
- // Always center vertically.
+ x /= 2;
y /= 2;
- // For landscape orientation center vertically
- //if (dispRect.width > dispRect.height)
- //{
- // y /= 2;
- //}
- // Set bounds when command Buttons are in use.
- shell.setBounds(defShellBounds.x, y, defShellBounds.width, newHeight);
+ shell.setBounds(x, y, newWidth, newHeight);
Rectangle clientArea = shell.getClientArea();
iContainer.setSize(clientArea.width, clientArea.height);
iContainer.layout(true);
@@ -434,6 +441,14 @@
}
/**
+ * Sets CSS id for given widget.
+ */
+ protected void setCssId(Widget aWidget, String aCssId)
+ {
+ aWidget.setData(WidgetConstant.CSS_ID, aCssId);
+ }
+
+ /**
* Adds header used in installation views.
*/
protected void addHeader(
@@ -450,26 +465,28 @@
boolean aSecurityButton)
{
// Add title.
- String title = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY);
+ if (aTitle == null)
+ {
+ aTitle = InstallerUiTexts.get(InstallerUiTexts.INSTALL_QUERY);
+ if (aInstallInfo != null && aInstallInfo.getOldVersion() != null)
+ {
+ aTitle = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY);
+ }
+ }
+ Label titleLabel = createLabel(aTitle, getColumns() - 1, SWT.WRAP);
+ setCssId(titleLabel, "heading");
+
if (aInstallInfo != null)
{
- if (aInstallInfo.getOldVersion() != null)
- {
- title = InstallerUiTexts.get(InstallerUiTexts.UPDATE_QUERY);
- }
iCertificates = aInstallInfo.getCertificates();
}
- if (aUninstallInfo != null)
+ else if (aUninstallInfo != null)
{
- title = "Uninstall?";
iCertificates = aUninstallInfo.getCertificates();
}
- Label titleLabel = createLabel(aTitle, getColumns() - 1, SWT.WRAP);
- titleLabel.setFont(iInstallerUi.getBoldFont());
-
if (aSecurityButton)
{
- // Add security icon.
+ // Add security button.
createSecurityButton();
}
else
@@ -501,11 +518,12 @@
{
iconColumns = 2;
Label iconLabel = createLabel(iSuiteIcon, iconColumns, SWT.NONE);
+ setCssId(iconLabel, "contentIcon");
}
// Create a Composite for displaying application info.
iAppInfoScrolledComposite =
- new ScrolledComposite(getComposite(), SWT.H_SCROLL | SWT.V_SCROLL);
+ new ScrolledComposite(getComposite(), SWT.V_SCROLL);
iAppInfoScrolledComposite.setAlwaysShowScrollBars(false);
iAppInfoScrolledComposite.setExpandHorizontal(true);
GridData gridData = new GridData(GridData.FILL_BOTH);
@@ -514,6 +532,7 @@
iAppInfoComposite = new Composite(iAppInfoScrolledComposite, SWT.NONE);
iAppInfoComposite.setLayout(new GridLayout(1, true));
iAppInfoScrolledComposite.setContent(iAppInfoComposite);
+ setCssId(iAppInfoScrolledComposite, "appInfoArea");
}
/**
@@ -530,7 +549,7 @@
// Add suite name and version.
createAppInfoLabel(
InstallerUiTexts.get(
- InstallerUiTexts.SUITE_NAME,
+ InstallerUiTexts.SUITE_NAME_VERSION,
new String[] { aInstallInfo.getName(),
aInstallInfo.getVersion() }));
if (aFull)
@@ -553,10 +572,20 @@
}
if (size > 0)
{
- createAppInfoLabel(
- InstallerUiTexts.get(
- InstallerUiTexts.SIZE_KB,
- new String[] { Long.toString(1 + size/1024) }));
+ if (size > 1024*1024)
+ {
+ createAppInfoLabel(
+ InstallerUiTexts.get(
+ InstallerUiTexts.SIZE_MB,
+ new Object[] { new Integer((int)(1 + size/(1024*1024))) }));
+ }
+ else
+ {
+ createAppInfoLabel(
+ InstallerUiTexts.get(
+ InstallerUiTexts.SIZE_KB,
+ new Object[] { new Integer((int)(1 + size/1024)) }));
+ }
}
if (aFull)
{
@@ -639,7 +668,7 @@
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = aColumns;
gridData.horizontalAlignment = SWT.CENTER;
- gridData.verticalAlignment = SWT.CENTER;
+ gridData.verticalAlignment = SWT.TOP;
label.setLayoutData(gridData);
return label;
}
@@ -671,6 +700,7 @@
protected Label createSecurityLabel(boolean aIdentified)
{
Label label = createLabel((Image)null, 1, SWT.NONE);
+ setCssId(label, "securityLabel");
Image securityIcon = null;
if (iInstallerUi != null)
{
@@ -691,6 +721,7 @@
protected Button createSecurityButton()
{
Button button = new Button(getComposite(), SWT.PUSH);
+ setCssId(button, "securityButton");
GridData gridData = new GridData(
GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL);
gridData.horizontalSpan = 1;
--- a/javamanager/javainstaller/javainstaller.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/javainstaller.pro Thu Aug 19 09:48:13 2010 +0300
@@ -17,4 +17,5 @@
SUBDIRS += installerui/build/javainstallerui.pro
SUBDIRS += installer/build/javainstaller.pro
BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"appinstuiplugin/build/bld.inf\""
+BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"iconsizenotifplugin/build/bld.inf\""
BLD_INF_RULES.prj_extensions += "prj_extensions"
--- a/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/build/javasifplugin.mmp Thu Aug 19 09:48:13 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"
@@ -42,6 +42,7 @@
// Sources
SOURCEPATH ../src
+SOURCE asyncwaitcallback.cpp
SOURCE javasifplugin.cpp
SOURCE proxy.cpp
SOURCE resultsserver.cpp
@@ -52,13 +53,14 @@
USERINCLUDE ../inc
USERINCLUDE ../../../../inc
-SYSTEMINCLUDE ../../../../inc
+SYSTEMINCLUDE /epoc32/include/mw/hb/hbwidgets
// Libraries
LIBRARY apgrfx.lib
LIBRARY apmime.lib
LIBRARY ecom.lib
LIBRARY efsrv.lib
+LIBRARY hbwidgets.lib
LIBRARY sif.lib
LIBRARY javacomms.lib
-LIBRARY javaruntimestarterutils.lib
\ No newline at end of file
+LIBRARY javaruntimestarterutils.lib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/javasifplugin/inc/asyncwaitcallback.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class implements general wait object for calling a desired
+* callback function after asynchronous notification
+*
+*/
+
+#ifndef ASYNCWAITCALLBACK_H
+#define ASYNCWAITCALLBACK_H
+
+#include <e32base.h>
+
+namespace java
+{
+namespace installer
+{
+
+/**
+ * This class implements wait object for calling a desired
+ * callback function after rendezvous returns specified
+ * reason code from the process that this object is listening to.
+ */
+NONSHARABLE_CLASS(CAsyncWaitCallBack) : public CActive
+{
+public: // Constructors and destructor
+
+ static CAsyncWaitCallBack* NewL(TCallBack aCallBack);
+
+ // Destructor.
+ virtual ~CAsyncWaitCallBack();
+
+public: // From base classes
+
+ // from base class CActive
+
+ void RunL();
+
+ void DoCancel();
+
+public:
+
+ void Wait(RProcess aProcessToListen, TInt aActivatingReasonCode);
+
+private:
+
+ // Constructor.
+ CAsyncWaitCallBack();
+
+ // 2nd phase constructor.
+ void ConstructL(TCallBack aCallBack);
+
+private: // Data
+
+ // Callback member
+ TCallBack iCallBack;
+
+ // When request completes with this status code,
+ // callback is called.
+ TInt iActivatingReasonCode;
+
+ RProcess iProcessToListen;
+};
+
+} // installer
+} // java
+
+#endif // ASYNCWAITCALLBACK_H
--- a/javamanager/javainstaller/javasifplugin/inc/javasifplugin.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/inc/javasifplugin.h Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -22,10 +22,13 @@
#define JAVASIFPLUGIN_H
#include <e32base.h>
+#include <hbdevicenotificationdialogsymbian.h>
#include <usif/sif/sifplugin.h>
+#include "asyncwaitcallback.h"
#include "f32file.h"
-#include "resultsserver.h"
+
+class ResultsServer;
using namespace Usif;
@@ -36,9 +39,9 @@
const int INSTALLER_CANCEL_MESSAGE_ID = 603;
const int INSTALLER_CANCEL_RESPONSE_MESSAGE_ID = 604;
-namespace Java
+namespace java
{
-namespace Installer
+namespace installer
{
/**
@@ -195,6 +198,11 @@
virtual void CancelOperation();
+ /**
+ * Hides 'preparing installation' dialog.
+ */
+ void HidePrepInstDialogL();
+
private:
/**
@@ -221,16 +229,96 @@
*/
void CopyFilesIfNeededL(TFileName &aFileName);
+ /**
+ * Check if the file is Jad file. Argument KSifInParam_MimeType is
+ * used for check if it exists.
+ *
+ * @param[in] aFileHandle the file to be checked
+ * @param[in] aArguments Install request arguments
+ * @param[out] aIsJad set to ETrue if the file is Jad file
+ * @return KErrNone or Symbian error code
+ */
+ TInt IsJadFile(RFile& aFileHandle, const COpaqueNamedParams& aArguments, TBool& aIsJad);
+
+ /**
+ * Check if the file is Jad file.
+ *
+ * @param[in] aFileHandle the file to be checked
+ * @param[out] aIsJad set to ETrue if the file is Jad file
+ * @return KErrNone or Symbian error code
+ */
+ TInt IsJadFile(RFile& aFileHandle, TBool& aIsJad);
+
+ /**
+ * Uses the information in aArguments to create the correct command line for
+ * Java Installer.
+ *
+ * @param[in][out] aCommandLine the buffer to be filled with command line arguments
+ * @param[in] aArguments The array of opaque params for the plug-in. An empty
+ * array may be passed. The following param is defined for the "SCOMO Install
+ * Inactive" operation:
+ * Name: InstallInactive, Type: Int, Value: ETrue
+ * If a plug-in receives this param, it must install a component normally but the SCOMO
+ * State should remain EDeactivated.
+ */
+ void BuildInstallCommandLine(
+ TPtr& aCommandLine,
+ const COpaqueNamedParams& aArguments);
+
+ /**
+ * Returns the value of int param found from aArguments or -1 if
+ * the param is not found. Must be called only for int params
+ * that have positive value range!
+ *
+ * @param[in] aName The name of the integer param to be obtained.
+ * @param[in] aArguments The array of opaque params for the plug-in.
+ * @return -1 if the named param if not found, otherwise the value of the
+ */
+ TInt GetPositiveIntParam(
+ const TDesC& aName,
+ const COpaqueNamedParams& aArguments);
+
+ /**
+ * Start ResultsServer for receiving Comms message(s) from
+ * Java Installer
+ *
+ * @param[in][out] aResults If Comms message contains installation or
+ * uninstallation operation results, they will be stored in this variable
+ * @param[in][out] aComponentInfo If Comms message contains contains details of
+ * a component, they will be stored into this variable
+ * @return
+ */
+ TInt StartResultsServer(
+ COpaqueNamedParams& aResults,
+ CComponentInfo& aComponentInfo);
+
+ /**
+ * If Java Installer is already running, set error category EInstallerBusy etc
+ * to aResults, set aStatus to KErrAlreadyExists and return ETrue
+ * @param[in][out] aResults
+ * @param[in][out] aStatus
+ * @return ETrue if Java Installer is running
+ */
+ TBool ExitIfJavaInstallerRunning(
+ COpaqueNamedParams& aResults,
+ TRequestStatus& aStatus);
+
+ /**
+ * Creates 'preparing installation' dialog.
+ */
+ void CreatePrepInstDialogL();
private: // Data
- TRequestStatus* iStatus;
- RFs iRFs;
- RArray<RProcess> iHandlesToClose;
- ResultsServer* iResultsServer;
+ RFs mRFs;
+ RArray<RProcess> mHandlesToClose;
+ ResultsServer* mResultsServer;
- COpaqueNamedParams* iDummyResults;
- CComponentInfo* iDummyInfo;
+ COpaqueNamedParams* mDummyResults;
+ CComponentInfo* mDummyInfo;
+
+ CHbDeviceNotificationDialogSymbian* mPrepInstDialog;
+ CAsyncWaitCallBack* mWaitToHideDialog;
};
} // Installer
--- a/javamanager/javainstaller/javasifplugin/inc/resultsserver.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/inc/resultsserver.h Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
@@ -65,18 +65,19 @@
CommsEndpoint* getComms()
{
- return &iComms;
+ return &mComms;
}
private:
void clearData();
void setComponentInfoL();
+ void resetDefaultErrorValues();
+ void setCommonErrorInfo();
private:
- int iRunning; // 1 if running, 0 if not running
- CommsServerEndpoint iComms;
- COpaqueNamedParams &iResults;
- CComponentInfo &iInfo;
+ CommsServerEndpoint mComms;
+ COpaqueNamedParams &mResults;
+ CComponentInfo &mInfo;
std::map<std::wstring, int> iIntPairs;
std::map<std::wstring, std::wstring> iStringPairs;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javainstaller/javasifplugin/src/asyncwaitcallback.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,84 @@
+/*
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class implements general wait object for calling a desired
+ * callback function after asynchronous notification
+ *
+*/
+
+#include "asyncwaitcallback.h"
+#include "logger.h"
+
+using namespace java::installer;
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+CAsyncWaitCallBack* CAsyncWaitCallBack::NewL(TCallBack aCallBack)
+{
+ CAsyncWaitCallBack* self = new(ELeave) CAsyncWaitCallBack();
+ CleanupStack::PushL(self);
+ self->ConstructL(aCallBack);
+ CleanupStack::Pop(self);
+ return self;
+}
+
+CAsyncWaitCallBack::CAsyncWaitCallBack():
+ CActive(CActive::EPriorityStandard), iActivatingReasonCode(0)
+{
+}
+
+CAsyncWaitCallBack::~CAsyncWaitCallBack()
+{
+}
+
+void CAsyncWaitCallBack::ConstructL(TCallBack aCallBack)
+{
+ iCallBack = aCallBack;
+ CActiveScheduler::Add(this);
+}
+
+void CAsyncWaitCallBack::RunL()
+{
+ // Execute callback only if the request completed with correct
+ // status code
+ if (iStatus == iActivatingReasonCode)
+ {
+ ILOG1(EJavaInstaller,
+ "CAsyncWaitCallBack called with notif code %d",
+ iStatus.Int());
+ iCallBack.CallBack();
+ }
+ else
+ {
+ WLOG1(EJavaInstaller,
+ "CAsyncWaitCallBack was called with unexpected notif code %d, reactivate",
+ iStatus.Int());
+ // Reactivate wait
+ iProcessToListen.Rendezvous(iStatus);
+ SetActive();
+ }
+}
+
+void CAsyncWaitCallBack::DoCancel()
+{
+ iProcessToListen.RendezvousCancel(iStatus);
+}
+
+void CAsyncWaitCallBack::Wait(RProcess aProcessToListen, TInt aActivatingReasonCode)
+{
+ iActivatingReasonCode = aActivatingReasonCode;
+ iProcessToListen = aProcessToListen;
+ iProcessToListen.Rendezvous(iStatus);
+ SetActive();
+}
+
--- a/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/src/javasifplugin.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -20,33 +20,92 @@
#include <apgcli.h>
#include <apmstd.h>
+#include <charconv.h>
+#include <data_caging_path_literals.hrh>
#include <e32cmn.h>
#include <e32property.h>
-#include <charconv.h>
-#include <data_caging_path_literals.hrh>
+#include <string.h>
+#include <usif/usiferror.h>
#include "comms.h"
+#include "commsclientendpoint.h"
#include "commsmessage.h"
-#include "commsclientendpoint.h"
-#include "javasifplugin.h"
-#include "javauids.h"
-#include "logger.h"
+#include "javacommonutils.h"
#include "javaoslayer.h"
#include "javaprocessconstants.h"
#include "javasymbianoslayer.h"
+#include "javauids.h"
+#include "logger.h"
+#include "resultsserver.h"
#include "runtimeexception.h"
+#include "javasifplugin.h"
-using namespace Java::Installer;
+
+using namespace java::installer;
using namespace java::util;
using namespace java::comms;
_LIT(KPrivateDataCage, "\\private\\");
_LIT(KInboxDataCage, "\\private\\1000484b\\");
+_LIT(KJavaInstallerProcess, "Installer*");
+_LIT(KJavaInstallCopierProcess, "javainstallcopier.exe");
_LIT(KJavaInstallerDataCage, "\\private\\102033e6\\");
_LIT(KJavaInstallerTmp, "\\private\\102033E6\\installer\\tmp\\");
_LIT(KAnyExtension, ".*");
+_LIT(KComponentInfo, " componentinfo");
+_LIT(KCommsResult, " -commsresult=");
+_LIT(KJad, " -jad=");
+_LIT(KJar, " -jar=");
+_LIT(KDoubleQuote, "\"");
+_LIT(KInstall, " install");
+_LIT(KSilent, " -silent");
+_LIT(KUninstall, " uninstall");
+_LIT(KCid, " -cid=");
+_LIT(KDrive, " -drive=");
+_LIT(KYes, "yes");
+_LIT(KNo, "no");
+_LIT(KOcsp, " -ocsp=");
+_LIT(KIgnoreOcspWarnings, " -ignore_ocsp_warnings=");
+_LIT(KUpgrade, " -upgrade=");
+_LIT(KUpgradeData, " -upgrade_data=");
+_LIT(KUntrusted, " -untrusted=");
+_LIT(KOverwrite, " -overwrite=");
+_LIT(KDownload, " -download=");
+_LIT(KIap, " -iap=");
+_LIT(KSnap, " -snap=");
+_LIT(KForceCancel, " -forcecancel");
+_LIT(KBase64, " -base64=");
+_LIT(KUsername, " -username=");
+_LIT(KPassword, " -password=");
+_LIT(KSourceUrl, " -sourceurl=");
+_LIT(KCharSet, " -charset=");
+_LIT(KJadMimeType, "text/vnd.sun.j2me.app-descriptor");
+_LIT8(K8JadMimeType, "text/vnd.sun.j2me.app-descriptor");
+
+// Long Java Installer command lines contain max 2 path names (512 chars max) and
+// some options -> 1536 is long enough buffer
+const TInt KLongCmdLineLen = 1536;
+
+// When starting Java Installer for uninstallation the command line is much shorter
+const TInt KShortCmdLineLen = 256;
+
+// Java Installer is executed with same Uid as Java Runtime
+_LIT_SECURE_ID(KJavaInstallerSecureID, KJavaMidpSecureId);
+
+/**
+ * This function is called to hide the 'Preparing Installation' dialog.
+ */
+LOCAL_C TInt HidePrepInstDialog(TAny* aPlugin)
+{
+ CJavaSifPlugin *pPlugin = (CJavaSifPlugin *)aPlugin;
+ if (NULL != pPlugin)
+ {
+ TRAP_IGNORE(pPlugin->HidePrepInstDialogL());
+ }
+ return KErrNone;
+}
// ============================ MEMBER FUNCTIONS ===============================
@@ -61,24 +120,33 @@
CJavaSifPlugin::~CJavaSifPlugin()
{
- iRFs.Close();
+ mRFs.Close();
- TInt nHandles = iHandlesToClose.Count();
+ TInt nHandles = mHandlesToClose.Count();
while (nHandles > 0)
{
nHandles--;
- iHandlesToClose[nHandles].Close();
+ mHandlesToClose[nHandles].Close();
}
- iHandlesToClose.Reset();
+ mHandlesToClose.Reset();
+
+ delete mResultsServer;
+ mResultsServer = NULL;
+
+ delete mDummyResults;
+ mDummyResults = NULL;
- delete iResultsServer;
- iResultsServer = NULL;
+ delete mDummyInfo;
+ mDummyInfo = NULL;
+
+ delete mPrepInstDialog;
+ mPrepInstDialog = NULL;
- delete iDummyResults;
- iDummyResults = NULL;
-
- delete iDummyInfo;
- iDummyInfo = NULL;
+ if (mWaitToHideDialog)
+ {
+ delete mWaitToHideDialog;
+ mWaitToHideDialog = NULL;
+ }
}
CJavaSifPlugin::CJavaSifPlugin()
@@ -87,11 +155,12 @@
void CJavaSifPlugin::ConstructL()
{
- User::LeaveIfError(iRFs.Connect());
- User::LeaveIfError(iRFs.ShareProtected());
- iResultsServer = NULL;
- iDummyResults = COpaqueNamedParams::NewL();
- iDummyInfo = CComponentInfo::NewL();
+ User::LeaveIfError(mRFs.Connect());
+ User::LeaveIfError(mRFs.ShareProtected());
+ mResultsServer = NULL;
+ mDummyResults = COpaqueNamedParams::NewL(); // codescanner::forgottoputptroncleanupstack
+ mDummyInfo = CComponentInfo::NewL();
+ mWaitToHideDialog = NULL;
}
void CJavaSifPlugin::GetComponentInfo(
@@ -101,7 +170,7 @@
TRequestStatus& aStatus)
{
RFile fileHandle;
- TInt err = fileHandle.Open(iRFs, aFileName, EFileShareReadersOnly | EFileRead);
+ TInt err = fileHandle.Open(mRFs, aFileName, EFileShareReadersOnly | EFileRead);
if (KErrNone != err)
{
ELOG1(EJavaInstaller,
@@ -122,22 +191,37 @@
CComponentInfo& aComponentInfo,
TRequestStatus& aStatus)
{
+ if (ExitIfJavaInstallerRunning(*mDummyResults, aStatus))
+ {
+ return;
+ }
+
RProcess rJavaInstaller;
TFileName fileName;
- TBuf<1536> commandLine;
+ HBufC* pBufCommandLine = NULL;
+ TRAPD(err, pBufCommandLine = HBufC::NewL(KLongCmdLineLen))
+ if (KErrNone != err)
+ {
+ TRequestStatus *statusPtr(&aStatus);
+ User::RequestComplete(statusPtr, err);
+ return;
+ }
+ std::auto_ptr<HBufC> bufCommandLine(pBufCommandLine);
+ TPtr commandLine = pBufCommandLine->Des();
// Build command line used to pass all necessary info to Java Installer
std::auto_ptr<HBufC> installerStarterDll(
stringToDes(java::runtime::JAVA_INSTALLER_STARTER_DLL));
commandLine = installerStarterDll->Des();
- commandLine.Append(_L(" componentinfo"));
+ commandLine.Append(KComponentInfo);
// Ask Java Installer to send component info back
// as Comms message. 11000 is IPC_ADDRESS_JAVA_SIF_PLUGIN_C Comms endpoint
// that our ResultsServer will listen to.
- commandLine.Append(_L(" -commsresult=11000"));
+ commandLine.Append(KCommsResult);
+ commandLine.AppendNum(IPC_ADDRESS_JAVA_SIF_PLUGIN_C);
- TInt err = aFileHandle.FullName(fileName);
+ err = aFileHandle.FullName(fileName);
// Java Installer does not have AllFiles capability.
// So if the .jad/.jar file is in the private data cage of
@@ -154,42 +238,30 @@
}
// Check whether the file is .jad or .jar
- RApaLsSession apaSession;
- err = apaSession.Connect();
+ TBool isJad;
+ err = IsJadFile(aFileHandle, isJad);
if (KErrNone != err)
{
- ELOG1(EJavaInstaller,
- "CJavaSifPlugin::GetComponentInfo RApaLsSession Connect error %d", err);
TRequestStatus *statusPtr(&aStatus);
User::RequestComplete(statusPtr, err);
return;
}
- TDataType jadFileMimeType(_L8("text/vnd.sun.j2me.app-descriptor"));
- TBool isJad = EFalse;
- err = apaSession.RecognizeSpecificData(aFileHandle, jadFileMimeType, isJad);
- apaSession.Close();
- if (KErrNone != err)
- {
- // Just log the error
- ELOG1(EJavaInstaller,
- "CJavaSifPlugin::GetComponentInfo RApaLsSession RecognizeSpecificData error %d",
- err);
- }
if (isJad)
{
// Installation should be started from JAD file
- commandLine.Append(_L(" -jad="));
+ commandLine.Append(KJad);
}
else
{
// from JAR file
- commandLine.Append(_L(" -jar="));
+ commandLine.Append(KJar);
}
+
// Filename parameter must be surrounded in double quotes to
// ensure that spaces in filename are passed correctly.
- commandLine.Append(_L("\""));
+ commandLine.Append(KDoubleQuote);
commandLine.Append(fileName);
- commandLine.Append(_L("\""));
+ commandLine.Append(KDoubleQuote);
// Start JavaInstaller
std::auto_ptr<HBufC> installerProcess(
@@ -197,21 +269,7 @@
err = rJavaInstaller.Create(installerProcess->Des(), commandLine);
if (KErrNone == err)
{
- // Destroy old Comms server if it exists
- delete iResultsServer;
- iResultsServer = NULL;
- // Start new Comms server that receives component info and sets it to
- // to aComponentInfo.
- iResultsServer = new ResultsServer(*iDummyResults, aComponentInfo);
- if (NULL == iResultsServer)
- {
- err = KErrNoMemory;
- }
- else
- {
- // Start the server
- err = iResultsServer->start();
- }
+ err = StartResultsServer(*mDummyResults, aComponentInfo);
if (KErrNone != err)
{
// server cannot be started
@@ -241,7 +299,16 @@
// Do NOT close rJavaInstaller now -> the caller gets notification when the
// process actually closes.
- iHandlesToClose.Append(rJavaInstaller);
+ err = mHandlesToClose.Append(rJavaInstaller);
+ if ( err )
+ {
+ rJavaInstaller.Close();
+ ELOG1(EJavaInstaller, "CJavaSifPlugin::GetComponentInfo mHandles"
+ "ToClose.Append failed with error %d", err);
+ TRequestStatus *statusPtr(&aStatus);
+ User::RequestComplete(statusPtr, err);
+ return;
+ }
}
void CJavaSifPlugin::Install(
@@ -252,11 +319,12 @@
TRequestStatus& aStatus)
{
RFile fileHandle;
- TInt err = fileHandle.Open(iRFs, aFileName, EFileShareReadersOnly | EFileRead);
+ TInt err = fileHandle.Open(mRFs, aFileName, EFileShareReadersOnly | EFileRead);
if (KErrNone != err)
{
ELOG1(EJavaInstaller,
"CJavaSifPlugin::Install Opening file for reading failed with error %d", err);
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError));
TRequestStatus *statusPtr(&aStatus);
User::RequestComplete(statusPtr, err);
return;
@@ -273,16 +341,29 @@
COpaqueNamedParams& aResults,
TRequestStatus& aStatus)
{
- RProcess rJavaInstaller;
- TFileName fileName;
- // Max two path names and some options -> 1536 is enough
- TBuf<1536> commandLine;
+ if (ExitIfJavaInstallerRunning(aResults, aStatus))
+ {
+ return;
+ }
+
+ // Create buffer for Java Installer command line
+ HBufC* pBufCommandLine = NULL;
+ TRAPD(err, pBufCommandLine = HBufC::NewL(KLongCmdLineLen))
+ if (KErrNone != err)
+ {
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ELowMemory));
+ TRequestStatus *statusPtr(&aStatus);
+ User::RequestComplete(statusPtr, err);
+ return;
+ }
+ std::auto_ptr<HBufC> bufCommandLine(pBufCommandLine);
+ TPtr commandLine = pBufCommandLine->Des();
// Build command line used to pass all necessary info to Java Installer
std::auto_ptr<HBufC> installerStarterDll(
stringToDes(java::runtime::JAVA_INSTALLER_STARTER_DLL));
commandLine = installerStarterDll->Des();
- commandLine.Append(_L(" install"));
+ commandLine.Append(KInstall);
// Check whether this is silent installation
TInt silentInstall = 0;
@@ -294,175 +375,36 @@
{
ELOG(EJavaInstaller,
"CJavaSifPlugin::Install The caller did not have TrustedUI capability");
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ESecurityError));
TRequestStatus *statusPtr(&aStatus);
User::RequestComplete(statusPtr, KErrPermissionDenied);
return;
}
- commandLine.Append(_L(" -silent"));
+ commandLine.Append(KSilent);
}
-
- TBool paramFound = EFalse;
- TInt intValue = 0;
- TDesC desValue = KNullDesC;
-
- // KSifInParam_Drive -> -drive=install_target_drive (A, B, C, ..., Z)
- TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_Drive, intValue));
- if (paramFound)
- {
- // Value 0 is 'A:' drive and value 25 is 'Z:' drive
- if ((intValue > -1) && (intValue < 26))
- {
- commandLine.Append(_L(" -drive="));
- TChar drive('A');
- drive += intValue;
- commandLine.Append(drive);
- }
- else
- {
- WLOG1(EJavaInstaller,
- "CJavaSifPlugin::Install Ignoring illegal KSifInParam_Drive param (value %d)",
- intValue);
- }
- }
-
- // KSifInParam_PerformOCSP Yes/No/AskUser -> -ocsp=yes|no
- TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_PerformOCSP, intValue));
- if (paramFound)
+ else
{
- if (intValue == 0) // Yes
- {
- commandLine.Append(_L(" -ocsp=yes"));
- }
- else if (intValue == 1) // No
- {
- commandLine.Append(_L(" -ocsp=no"));
- }
- // AskUser is not supported
- }
-
- // KSifInParam_IgnoreOCSPWarnings Yes/No/AskUser -> -ignore_ocsp_warnings=yes|no
- TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_IgnoreOCSPWarnings, intValue));
- if (paramFound)
- {
- if (intValue == 0) // Yes
- {
- commandLine.Append(_L(" -ignore_ocsp_warnings=yes"));
- }
- else if (intValue == 1) // No
- {
- commandLine.Append(_L(" -ignore_ocsp_warnings=no"));
- }
- // AskUser is not supported
- }
-
- // KSifInParam_AllowUpgrade Yes/No/AskUser -> -upgrade=yes|no
- TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_AllowUpgrade, intValue));
- if (paramFound)
- {
- if (intValue == 0) // Yes
- {
- commandLine.Append(_L(" -upgrade=yes"));
- }
- else if (intValue == 1) // No
- {
- commandLine.Append(_L(" -upgrade=no"));
- }
- // AskUser is not supported
+ // Uncomment this to enable 'preparing installation' dialog.
+ //TRAP(err, CreatePrepInstDialogL());
+ //if (KErrNone != err)
+ //{
+ // WLOG1(EJavaInstaller,
+ // "CJavaSifPlugin::Install Creating preparing installation dialog failed, err=%d",
+ // err);
+ //}
}
- // KSifInParam_AllowUntrusted Yes/No/AskUser -> -untrusted=yes|no
- TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_AllowUntrusted, intValue));
- if (paramFound)
- {
- if (intValue == 0) // Yes
- {
- commandLine.Append(_L(" -untrusted=yes"));
- }
- else if (intValue == 1) // No
- {
- commandLine.Append(_L(" -untrusted=no"));
- }
- // AskUser is not supported
- }
-
- // KSifInParam_AllowOverwrite Yes/No/AskUser -> -overwrite=yes|no
- TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_AllowOverwrite, intValue));
- if (paramFound)
- {
- if (intValue == 0) // Yes
- {
- commandLine.Append(_L(" -overwrite=yes"));
- }
- else if (intValue == 1) // No
- {
- commandLine.Append(_L(" -overwrite=no"));
- }
- // AskUser is not supported
- }
-
- // KSifInParam_AllowDownload Yes/No/AskUser -> -download=yes|no
- TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_AllowDownload, intValue));
- if (paramFound)
- {
- if (intValue == 0) // Yes
- {
- commandLine.Append(_L(" -download=yes"));
- }
- else if (intValue == 1) // No
- {
- commandLine.Append(_L(" -download=no"));
- }
- // AskUser is not supported
- }
-
- // KSifInParam_UserName -> -username=download_username
- TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_UserName));
- if (desValue.Length() > 0)
- {
- commandLine.Append(_L(" -username="));
- commandLine.Append(desValue);
- }
-
- // KSifInParam_Password -> -password=download_password
- TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_Password));
- if (desValue.Length() > 0)
- {
- commandLine.Append(_L(" -password="));
- commandLine.Append(desValue);
- }
-
- // KSifInParam_SourceUrl -> -sourceurl=original (HTTP) URL of the JAD or JAR file
- TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_SourceUrl));
- if (desValue.Length() > 0)
- {
- commandLine.Append(_L(" -sourceurl="));
- commandLine.Append(desValue);
- }
-
- // KSifInParam_IAP -> -iap=IAP_ID (internet access point id)
- TRAP_IGNORE(paramFound = aArguments.GetIntByNameL(KSifInParam_IAP, intValue));
- if (paramFound)
- {
- commandLine.Append(_L(" -iap="));
- commandLine.AppendNum(intValue);
- }
-
- // KSifInParam_Charset -> -charset=Internet-standard character set name
- TRAP_IGNORE(desValue = aArguments.StringByNameL(KSifInParam_Charset));
- if (desValue.Length() > 0)
- {
- commandLine.Append(_L(" -charset="));
- commandLine.Append(desValue);
- }
-
+ BuildInstallCommandLine(commandLine, aArguments);
// Ask Java Installer to send installation results back
// as Comms message. 11000 is IPC_ADDRESS_JAVA_SIF_PLUGIN_C Comms endpoint
// that our ResultsServer will listen to.
- commandLine.Append(_L(" -commsresult=11000"));
+ commandLine.Append(KCommsResult);
+ commandLine.AppendNum(IPC_ADDRESS_JAVA_SIF_PLUGIN_C);
- TInt err = aFileHandle.FullName(fileName);
+ TFileName fileName;
+ err = aFileHandle.FullName(fileName);
// Java Installer does not have AllFiles capability.
// So if the .jad/.jar file is in the private data cage of
@@ -473,74 +415,53 @@
TRAP(err, CopyFilesIfNeededL(fileName));
if (KErrNone != err)
{
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError));
TRequestStatus *statusPtr(&aStatus);
User::RequestComplete(statusPtr, err);
return;
}
// Check whether the file is .jad or .jar
- RApaLsSession apaSession;
- err = apaSession.Connect();
+ TBool isJad = EFalse;
+ err = IsJadFile(aFileHandle, aArguments, isJad);
if (KErrNone != err)
{
- ELOG1(EJavaInstaller,
- "CJavaSifPlugin::Install RApaLsSession Connect error %d", err);
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError));
TRequestStatus *statusPtr(&aStatus);
User::RequestComplete(statusPtr, err);
return;
}
- TDataType jadFileMimeType(_L8("text/vnd.sun.j2me.app-descriptor"));
- TBool isJad = EFalse;
- err = apaSession.RecognizeSpecificData(aFileHandle, jadFileMimeType, isJad);
- apaSession.Close();
- if (KErrNone != err)
- {
- ELOG1(EJavaInstaller,
- "CJavaSifPlugin::Install RApaLsSession RecognizeSpecificData error %d", err);
- }
if (isJad)
{
// Installation should be started from JAD file
- commandLine.Append(_L(" -jad="));
+ commandLine.Append(KJad);
}
else
{
// from JAR file
- commandLine.Append(_L(" -jar="));
+ commandLine.Append(KJar);
}
// Filename parameter must be surrounded in double quotes to
// ensure that spaces in filename are passed correctly.
- commandLine.Append(_L("\""));
+ commandLine.Append(KDoubleQuote);
commandLine.Append(fileName);
- commandLine.Append(_L("\""));
+ commandLine.Append(KDoubleQuote);
// Start JavaInstaller
std::auto_ptr<HBufC> installerProcess(
stringToDes(java::runtime::JAVA_PROCESS));
+ RProcess rJavaInstaller;
err = rJavaInstaller.Create(installerProcess->Des(), commandLine);
if (KErrNone == err)
{
- // Destroy old Comms server if it exists
- delete iResultsServer;
- iResultsServer = NULL;
- // Start new Comms server that receives component ids, sets them
- // to aResults.
- iResultsServer = new ResultsServer(aResults, *iDummyInfo);
- if (NULL == iResultsServer)
- {
- err = KErrNoMemory;
- }
- else
- {
- // Start the server
- err = iResultsServer->start();
- }
+ err = StartResultsServer(aResults, *mDummyInfo);
if (KErrNone != err)
{
// server cannot be started
rJavaInstaller.Close();
ELOG1(EJavaInstaller,
"CJavaSifPlugin::Install: Cannot start results server, err %d", err);
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError));
TRequestStatus *statusPtr(&aStatus);
User::RequestComplete(statusPtr, err);
return;
@@ -555,37 +476,81 @@
rJavaInstaller.Close();
ELOG1(EJavaInstaller,
"CJavaSifPlugin::Install: starting JavaInstaller failed, err=%d", err);
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError));
TRequestStatus *statusPtr(&aStatus);
User::RequestComplete(statusPtr, err);
return;
}
+ if (!silentInstall)
+ {
+ TRAP(err, mWaitToHideDialog =
+ CAsyncWaitCallBack::NewL(TCallBack(HidePrepInstDialog, this)));
+ if (KErrNone == err)
+ {
+ // The active object will wait until JavaInstaller process calls Rendezvous.
+ // If JavaInstaller specifies reason code EJavaInstaller, then
+ // the active object will call callback function that will hide the
+ // 'Preparing installation' dialog. If reason code is not EJavaInstaller,
+ // the wait object will automatically wait for the next rendezvous.
+ mWaitToHideDialog->Wait( rJavaInstaller, EJavaInstaller );
+ }
+ else
+ {
+ ELOG1(EJavaInstaller, "CJavaSifPlugin::Install: Creating "
+ "mWaitToHideDialog failed, err %d", err);
+ }
+ }
rJavaInstaller.Resume();
// Do NOT close rJavaInstaller now -> the caller gets notification when the
// process actually closes.
- iHandlesToClose.Append(rJavaInstaller);
+ err = mHandlesToClose.Append(rJavaInstaller);
+ if ( err )
+ {
+ rJavaInstaller.Close();
+ ELOG1(EJavaInstaller, "CJavaSifPlugin::Install mHandles"
+ "ToClose.Append failed with error %d", err);
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ELowMemory));
+ TRequestStatus *statusPtr(&aStatus);
+ User::RequestComplete(statusPtr, err);
+ return;
+ }
+
}
void CJavaSifPlugin::Uninstall(
TComponentId aComponentId,
const TSecurityContext& aSecurityContext,
const COpaqueNamedParams& aArguments,
- COpaqueNamedParams& /* aResults */,
+ COpaqueNamedParams& aResults,
TRequestStatus& aStatus)
{
- RProcess rJavaInstaller;
- TFileName fileName;
- // Max one uid and some options -> 256 is enough
- TBuf<256> commandLine;
+ if (ExitIfJavaInstallerRunning(aResults, aStatus))
+ {
+ return;
+ }
+
+ // Allocate buffer for Java Installer command line
+ HBufC* pBufCommandLine = NULL;
+ TRAPD(err, pBufCommandLine = HBufC::NewL(KShortCmdLineLen))
+ if (KErrNone != err)
+ {
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ELowMemory));
+ TRequestStatus *statusPtr(&aStatus);
+ User::RequestComplete(statusPtr, err);
+ return;
+ }
+ std::auto_ptr<HBufC> bufCommandLine(pBufCommandLine);
+ TPtr commandLine = pBufCommandLine->Des();
// Build command line used to pass all necessary info to Java Installer
std::auto_ptr<HBufC> installerStarterDll(
stringToDes(java::runtime::JAVA_INSTALLER_STARTER_DLL));
commandLine = installerStarterDll->Des();
- commandLine.Append(_L(" uninstall"));
+ commandLine.Append(KUninstall);
- commandLine.Append(_L(" -cid="));
+ commandLine.Append(KCid);
commandLine.AppendNum(aComponentId);
// Check whether this is silent uninstallation
@@ -598,24 +563,35 @@
{
ELOG(EJavaInstaller,
"CJavaSifPlugin::Uninstall The caller did not have TrustedUI capability");
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ESecurityError));
TRequestStatus *statusPtr(&aStatus);
User::RequestComplete(statusPtr, KErrPermissionDenied);
return;
}
- commandLine.Append(_L(" -silent"));
+ commandLine.Append(KSilent);
}
- // No need to start iResultsServer because Uninstall() does not
- // return anything usefull in aResults. We could return extended
- // error code there.
-
// start JavaInstaller
std::auto_ptr<HBufC> installerProcess(
stringToDes(java::runtime::JAVA_PROCESS));
- TInt err = rJavaInstaller.Create(installerProcess->Des(), commandLine);
+ RProcess rJavaInstaller;
+ err = rJavaInstaller.Create(installerProcess->Des(), commandLine);
if (KErrNone == err)
{
+ err = StartResultsServer(aResults, *mDummyInfo);
+ if (KErrNone != err)
+ {
+ // server cannot be started
+ rJavaInstaller.Close();
+ ELOG1(EJavaInstaller,
+ "CJavaSifPlugin::Uninstall: Cannot start results server, err %d", err);
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError));
+ TRequestStatus *statusPtr(&aStatus);
+ User::RequestComplete(statusPtr, err);
+ return;
+ }
+
// the exit status of Java Installer will be passed to
// the asynch caller through aStatus
rJavaInstaller.Logon(aStatus);
@@ -627,6 +603,7 @@
rJavaInstaller.Close();
ELOG1(EJavaInstaller,
"CJavaSifPlugin::Uninstall: starting JavaInstaller failed, err=%d", err);
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError));
TRequestStatus *statusPtr(&aStatus);
User::RequestComplete(statusPtr, err);
return;
@@ -634,7 +611,17 @@
// Do NOT close rJavaInstaller now -> the caller gets notification when the
// process actually closes.
- iHandlesToClose.Append(rJavaInstaller);
+ err = mHandlesToClose.Append(rJavaInstaller);
+ if ( err )
+ {
+ rJavaInstaller.Close();
+ ELOG1(EJavaInstaller, "CJavaSifPlugin::Uninstall mHandles"
+ "ToClose.Append failed with error %d", err);
+ TRAP_IGNORE(aResults.AddIntL(KSifOutParam_ErrCategory, ELowMemory));
+ TRequestStatus *statusPtr(&aStatus);
+ User::RequestComplete(statusPtr, err);
+ return;
+ }
}
void CJavaSifPlugin::Activate(
@@ -664,7 +651,7 @@
// Send cancel message to Java Installer
// Check whether there is anything to cancel
- if (iHandlesToClose.Count() < 1)
+ if (mHandlesToClose.Count() < 1)
{
// No Java Installer process running, do nothing
WLOG(EJavaInstaller,
@@ -672,64 +659,47 @@
return;
}
- try
- {
- CommsMessage message;
- message.setModuleId(PLUGIN_ID_SAMPLE_C);
- message.setReceiver(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C);
- message.setSender(IPC_ADDRESS_JAVA_SIF_PLUGIN_C);
- message.setMessageId(INSTALLER_CANCEL_MESSAGE_ID);
+ CommsMessage message;
+ message.setReceiver(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C);
+ message.setSender(IPC_ADDRESS_JAVA_SIF_PLUGIN_C);
+ message.setMessageId(INSTALLER_CANCEL_MESSAGE_ID);
- CommsMessage replyMessage;
- int timeout = 10; // 10 seconds
+ CommsMessage replyMessage;
+ int timeout = 10; // 10 seconds // codescanner::magicnumbers
- CommsClientEndpoint comms;
- int err = comms.connect(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C);
- if (KErrNone == err)
- {
- err = comms.sendReceive(message, replyMessage, timeout);
- }
- else
- {
- // Cannot connect to Java Installer Comms end point,
- // for example Java Installer is still starting up or
- // already exiting
- WLOG1(EJavaInstaller,
- "CJavaSifPlugin:CancelOperation: Cannot connect to Java Installer "
- "Comms end point, err %d", err);
- return;
- }
- if (err != 0)
- {
- // Sending message to Java Installer failed.
- ELOG1(EJavaInstaller,
- "CJavaSifPlugin:CancelOperation: Cannot send message to Java Installer, err %d",
- err);
- // Ignore possible errors in disconnect
- (void)comms.disconnect();
- return;
- }
-
- // Ignore the cancel result returned in replyMessage
- // because current SIF API does not return cancel result
-
- // Ignore possible errors in disconnect
- (void)comms.disconnect();
+ CommsClientEndpoint comms;
+ int err = comms.connect(IPC_ADDRESS_JAVA_INSTALLER_SERVER_C);
+ if (KErrNone == err)
+ {
+ err = comms.sendReceive(message, replyMessage, timeout);
}
- catch (ExceptionBase& e)
+ else
{
- ELOG1(EJavaInstaller,
- "CJavaSifPlugin: Send cancel msg failed: ExceptionBase caught: %s ",
- e.toString().c_str());
+ // Cannot connect to Java Installer Comms end point,
+ // for example Java Installer is still starting up or
+ // already exiting
+ WLOG1(EJavaInstaller,
+ "CJavaSifPlugin:CancelOperation: Cannot connect to Java Installer "
+ "Comms end point, err %d", err);
return;
}
- catch (std::exception& e)
+ if (err != 0)
{
+ // Sending message to Java Installer failed.
ELOG1(EJavaInstaller,
- "CJavaSifPlugin: Send cancel msg failed: Exception %s caught", e.what());
+ "CJavaSifPlugin:CancelOperation: Cannot send message to Java Installer, err %d",
+ err);
+ // Ignore possible errors in disconnect
+ (void)comms.disconnect(); // codescanner::voidparameter
return;
}
+ // Ignore the cancel result returned in replyMessage
+ // because current SIF API does not return cancel result
+
+ // Ignore possible errors in disconnect
+ (void)comms.disconnect(); // codescanner::voidparameter
+
// It takes some time before Java Installer had really cancelled
// the operation and exited. Wait for it to happen because this function
// must return only after the original asynchronous call is completed.
@@ -737,14 +707,14 @@
// This array contains process handles for all Java Installer processes
// started from this sif plugin. The last handle is the active one.
// Check if it is still running
- if (iHandlesToClose[iHandlesToClose.Count()-1].ExitReason() != 0)
+ if (mHandlesToClose[mHandlesToClose.Count()-1].ExitReason() != 0)
{
// Process has already closed
return;
}
// Wait until it exits
- iHandlesToClose[iHandlesToClose.Count()-1].Logon(status);
- User::WaitForRequest(status);
+ mHandlesToClose[mHandlesToClose.Count()-1].Logon(status);
+ User::WaitForRequest(status); // codescanner::userWaitForRequest
// Ignore the exit status of Java Installer because current SIF API
// does not return cancel result
@@ -755,7 +725,7 @@
{
// Check if the file is in the private data cage of some process
TInt idx = aFileName.FindF(KPrivateDataCage);
- if ((idx != KErrNotFound) && (idx < 3))
+ if ((idx != KErrNotFound) && (idx < 3)) // codescanner::magicnumbers
{
// In case of device Inbox or Java Installer itself do nothing
if ((aFileName.FindF(KInboxDataCage) != KErrNotFound) ||
@@ -770,19 +740,37 @@
// (aFileName is <path>\<name>.<ext>, copy <path>\<name>.*
// to Java Installer tmp dir.)
TParse fp;
- iRFs.Parse(aFileName, fp);
-
- CFileMan* fm = CFileMan::NewL(iRFs);
+ mRFs.Parse(aFileName, fp);
TFileName filesToCopy = fp.DriveAndPath();
filesToCopy.Append(fp.Name());
filesToCopy.Append(KAnyExtension);
- TInt err = fm->Copy(filesToCopy, KJavaInstallerTmp, CFileMan::ERecurse);
- delete fm;
- if (KErrNone != err)
+
+ // Use JavaInstallCopier.exe to copy the files.
+ RProcess rJavaInstallCopier;
+ TInt err = rJavaInstallCopier.Create(
+ KJavaInstallCopierProcess, filesToCopy);
+ if (KErrNone == err)
{
+ TRequestStatus status;
+ rJavaInstallCopier.Logon(status);
+ rJavaInstallCopier.Resume();
+ User::WaitForRequest(status); // codescanner::userWaitForRequest
+ err = rJavaInstallCopier.ExitReason();
+ rJavaInstallCopier.Close();
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "CJavaSifPlugin::CopyFilesIfNeededL: copying files "
+ "to JavaInstaller data cage failed, err=%d", err);
+ User::Leave(err);
+ }
+ }
+ else
+ {
+ rJavaInstallCopier.Close();
ELOG1(EJavaInstaller,
- "CJavaSifPlugin::CopyFilesIfNeededL: copying files "
- "to Java Installer data cage failed, err=%d", err);
+ "CJavaSifPlugin::CopyFilesIfNeededL: starting "
+ "JavaInstallCopier failed, err=%d", err);
User::Leave(err);
}
@@ -795,4 +783,446 @@
return;
}
+
+TInt CJavaSifPlugin::IsJadFile(
+ RFile& aFileHandle,
+ const COpaqueNamedParams& aArguments,
+ TBool& aIsJad)
+{
+ TBool mimeTypeGiven = EFalse;
+
+ TRAP_IGNORE(
+ const TDesC &desValue = aArguments.StringByNameL(KSifInParam_MimeType);
+ if (desValue.Length() > 0)
+ {
+ mimeTypeGiven = ETrue;
+ if (!desValue.Compare(KJadMimeType))
+ {
+ aIsJad = ETrue;
+ }
+ else
+ {
+ aIsJad = EFalse;
+ }
+ }
+ )
+ if (mimeTypeGiven)
+ {
+ return KErrNone;
+ }
+
+ // Mime type was not given in the input arguments, must check the contents
+ // of the file itself
+ return IsJadFile(aFileHandle, aIsJad);
+}
+
+
+TInt CJavaSifPlugin::IsJadFile(
+ RFile& aFileHandle,
+ TBool& aIsJad)
+{
+ RApaLsSession apaSession;
+ TInt err = apaSession.Connect();
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "CJavaSifPlugin::IsJadFile RApaLsSession Connect error %d", err);
+ return err;
+ }
+
+ TDataType jadFileMimeType(K8JadMimeType);
+ err = apaSession.RecognizeSpecificData(aFileHandle, jadFileMimeType, aIsJad);
+ apaSession.Close();
+ if (KErrNone != err)
+ {
+ // Just log the error
+ ELOG1(EJavaInstaller,
+ "CJavaSifPlugin::IsJadFile RApaLsSession RecognizeSpecificData error %d",
+ err);
+ return err;
+ }
+
+ return KErrNone;
+}
+
+
+void CJavaSifPlugin::BuildInstallCommandLine(
+ TPtr& aCommandLine,
+ const COpaqueNamedParams& aArguments)
+{
+ // KSifInParam_Drive -> -drive=install_target_drive (A, B, C, ..., Z)
+ TInt intValue = GetPositiveIntParam(KSifInParam_Drive, aArguments);
+ // Value 0 is 'A:' drive and value 25 is 'Z:' drive
+ if ((intValue > -1) && (intValue < 26)) // codescanner::magicnumbers
+ {
+ aCommandLine.Append(KDrive);
+ TChar drive('A');
+ drive += intValue;
+ aCommandLine.Append(drive);
+ }
+
+ // KSifInParam_PerformOCSP Yes/No/AskUser -> -ocsp=yes|no
+ intValue = GetPositiveIntParam(KSifInParam_PerformOCSP, aArguments);
+ if (intValue == 0) // Yes
+ {
+ aCommandLine.Append(KOcsp);
+ aCommandLine.Append(KYes);
+ }
+ else if (intValue == 1) // No
+ {
+ aCommandLine.Append(KOcsp);
+ aCommandLine.Append(KNo);
+ }
+ // AskUser is not supported
+
+ // KSifInParam_IgnoreOCSPWarnings Yes/No/AskUser -> -ignore_ocsp_warnings=yes|no
+ intValue = GetPositiveIntParam(KSifInParam_IgnoreOCSPWarnings, aArguments);
+ if (intValue == 0) // Yes
+ {
+ aCommandLine.Append(KIgnoreOcspWarnings);
+ aCommandLine.Append(KYes);
+ }
+ else if (intValue == 1) // No
+ {
+ aCommandLine.Append(KIgnoreOcspWarnings);
+ aCommandLine.Append(KNo);
+ }
+ // AskUser is not supported
+
+ // KSifInParam_AllowUpgrade Yes/No/AskUser -> -upgrade=yes|no
+ intValue = GetPositiveIntParam(KSifInParam_AllowUpgrade, aArguments);
+ if (intValue == 0) // Yes
+ {
+ aCommandLine.Append(KUpgrade);
+ aCommandLine.Append(KYes);
+ }
+ else if (intValue == 1) // No
+ {
+ aCommandLine.Append(KUpgrade);
+ aCommandLine.Append(KNo);
+ }
+ // AskUser is not supported
+
+ // KSifInParam_AllowUpgradeData Yes/No/AskUser -> -upgrade_data=yes|no
+ intValue = GetPositiveIntParam(KSifInParam_AllowUpgradeData, aArguments);
+ if (intValue == 0) // Yes
+ {
+ aCommandLine.Append(KUpgradeData);
+ aCommandLine.Append(KYes);
+ }
+ else if (intValue == 1) // No
+ {
+ aCommandLine.Append(KUpgradeData);
+ aCommandLine.Append(KNo);
+ }
+ // AskUser is not supported
+
+ // KSifInParam_AllowUntrusted Yes/No/AskUser -> -untrusted=yes|no
+ intValue = GetPositiveIntParam(KSifInParam_AllowUntrusted, aArguments);
+ if (intValue == 0) // Yes
+ {
+ aCommandLine.Append(KUntrusted);
+ aCommandLine.Append(KYes);
+ }
+ else if (intValue == 1) // No
+ {
+ aCommandLine.Append(KUntrusted);
+ aCommandLine.Append(KNo);
+ }
+ // AskUser is not supported
+
+ // KSifInParam_AllowOverwrite Yes/No/AskUser -> -overwrite=yes|no
+ intValue = GetPositiveIntParam(KSifInParam_AllowOverwrite, aArguments);
+ if (intValue == 0) // Yes
+ {
+ aCommandLine.Append(KOverwrite);
+ aCommandLine.Append(KYes);
+ }
+ else if (intValue == 1) // No
+ {
+ aCommandLine.Append(KOverwrite);
+ aCommandLine.Append(KNo);
+ }
+ // AskUser is not supported
+
+ // KSifInParam_AllowDownload Yes/No/AskUser -> -download=yes|no
+ intValue = GetPositiveIntParam(KSifInParam_AllowDownload, aArguments);
+ if (intValue == 0) // Yes
+ {
+ aCommandLine.Append(KDownload);
+ aCommandLine.Append(KYes);
+ }
+ else if (intValue == 1) // No
+ {
+ aCommandLine.Append(KDownload);
+ aCommandLine.Append(KNo);
+ }
+ // AskUser is not supported
+
+ // KSifInParam_IAP -> -iap=IAP_ID (internet access point id)
+ intValue = GetPositiveIntParam(KSifInParam_IAP, aArguments);
+ if (intValue > -1)
+ {
+ // IAP ids are always positive
+ aCommandLine.Append(KIap);
+ aCommandLine.AppendNum(intValue);
+ }
+
+ // KSifInParam_SNAP -> -snap=SNAP_ID (service network access point id)
+ intValue = GetPositiveIntParam(KSifInParam_SNAP, aArguments);
+ if (intValue > -1)
+ {
+ // SNAP ids are always positive
+ aCommandLine.Append(KSnap);
+ aCommandLine.AppendNum(intValue);
+ }
+
+ // When this param is given, Java Installer will cancel installation
+ // before committing anything. This option is for debugging purposes only.
+ // KForceCancel -> -forcecancel
+ // The value of parameter is ignored
+ TRAP_IGNORE(
+ const TDesC &desValue = aArguments.StringByNameL(KForceCancel);
+ if (desValue.Length() > 0)
+ {
+ aCommandLine.Append(KForceCancel);
+ }
+ )
+
+ std::wstring base64EncodedArgs;
+ // KSifInParam_UserName -> -username=download_username
+ TRAP_IGNORE(
+ const TDesC &desValue = aArguments.StringByNameL(KSifInParam_UserName);
+ if (desValue.Length() > 0)
+ {
+ try
+ {
+ std::wstring value((wchar_t *)(desValue.Ptr()), desValue.Length());
+ std::wstring encodedValue = JavaCommonUtils::wbase64encode(value);
+ aCommandLine.Append(KUsername);
+ aCommandLine.Append(
+ (const unsigned short *)encodedValue.c_str(), (int)encodedValue.length());
+ base64EncodedArgs.append(L"username,");
+ }
+ catch (std::exception& e)
+ {
+ ELOG1(EJavaInstaller,
+ "CJavaSifPlugin::BuildInstallCommandLine Base64 encoding user "
+ "name failed, err %s", e.what());
+ }
+ }
+ )
+
+ // KSifInParam_Password -> -password=download_password
+ TRAP_IGNORE(
+ const TDesC &desValue = aArguments.StringByNameL(KSifInParam_Password);
+ if (desValue.Length() > 0)
+ {
+ try
+ {
+ std::wstring value((wchar_t *)(desValue.Ptr()), desValue.Length());
+ std::wstring encodedValue = JavaCommonUtils::wbase64encode(value);
+ aCommandLine.Append(KPassword);
+ aCommandLine.Append(
+ (const unsigned short *)encodedValue.c_str(), (int)encodedValue.length());
+ base64EncodedArgs.append(L"password,");
+ }
+ catch (std::exception& e)
+ {
+ ELOG1(EJavaInstaller,
+ "CJavaSifPlugin::BuildInstallCommandLine Base64 encoding password "
+ "failed, err %s", e.what());
+ }
+ }
+ )
+
+ // KSifInParam_SourceUrl -> -sourceurl=original (HTTP) URL of the JAD or JAR file
+ TRAP_IGNORE(
+ const TDesC &desValue = aArguments.StringByNameL(KSifInParam_SourceUrl);
+ if (desValue.Length() > 0)
+ {
+ try
+ {
+ std::wstring value((wchar_t *)(desValue.Ptr()), desValue.Length());
+ std::wstring encodedValue = JavaCommonUtils::wbase64encode(value);
+ aCommandLine.Append(KSourceUrl);
+ aCommandLine.Append(
+ (const unsigned short *)encodedValue.c_str(), (int)encodedValue.length());
+ base64EncodedArgs.append(L"sourceurl,");
+ }
+ catch (std::exception& e)
+ {
+ ELOG1(EJavaInstaller,
+ "CJavaSifPlugin::BuildInstallCommandLine Base64 encoding source "
+ "url failed, err %s", e.what());
+ }
+ }
+ )
+
+ // KSifInParam_Charset -> -charset=Internet-standard character set name
+ TRAP_IGNORE(
+ const TDesC &desValue = aArguments.StringByNameL(KSifInParam_Charset);
+ if (desValue.Length() > 0)
+ {
+ try
+ {
+ std::wstring value((wchar_t *)(desValue.Ptr()), desValue.Length());
+ std::wstring encodedValue = JavaCommonUtils::wbase64encode(value);
+ aCommandLine.Append(KCharSet);
+ aCommandLine.Append(
+ (const unsigned short *)encodedValue.c_str(), (int)encodedValue.length());
+ base64EncodedArgs.append(L"charset,");
+ }
+ catch (std::exception& e)
+ {
+ ELOG1(EJavaInstaller,
+ "CJavaSifPlugin::BuildInstallCommandLine Base64 encoding charset "
+ "failed, err %s", e.what());
+ }
+ }
+ )
+
+ if (base64EncodedArgs.length() > 0)
+ {
+ // Tell Java Installer which arguments have been Base64 encoded
+ aCommandLine.Append(KBase64);
+ aCommandLine.Append(
+ (const unsigned short *)base64EncodedArgs.c_str(), (int)base64EncodedArgs.length());
+ }
+
+ return;
+}
+
+TInt CJavaSifPlugin::GetPositiveIntParam(
+ const TDesC& aName,
+ const COpaqueNamedParams& aArguments)
+{
+ // Assume that the value will not be found
+ TInt intValue = -1;
+
+ // If the value can be read, intValue will be set, otherwise this function
+ // returns -1
+ TRAP_IGNORE((void)aArguments.GetIntByNameL(aName, intValue)); // codescanner::voidparameter
+
+ return intValue;
+}
+
+
+TInt CJavaSifPlugin::StartResultsServer(
+ COpaqueNamedParams& aResults,
+ CComponentInfo& aComponentInfo)
+{
+ // Destroy old Comms server if it exists
+ delete mResultsServer;
+ mResultsServer = NULL;
+
+ // Start new Comms server
+ mResultsServer = new ResultsServer(aResults, aComponentInfo); // codescanner::nonleavenew
+ if (NULL == mResultsServer)
+ {
+ return KErrNoMemory;
+ }
+ else
+ {
+ // Start the server
+ return mResultsServer->start();
+ }
+}
+
+
+TBool CJavaSifPlugin::ExitIfJavaInstallerRunning(
+ COpaqueNamedParams& aResults,
+ TRequestStatus& aStatus)
+{
+ // If Java Installer is already running, set error category EInstallerBusy etc
+ // to aResults and return
+
+ TInt err(KErrNone);
+ RProcess proc;
+ TFindProcess finder(KJavaInstallerProcess);
+ TFullName procName;
+
+ // Java Installer process SID is 0x102033E6 and name is "Installer"
+ while (finder.Next(procName) == KErrNone)
+ {
+ if (proc.Open(finder) != KErrNone)
+ {
+ continue;
+ }
+ if (proc.SecureId() == KJavaInstallerSecureID)
+ {
+ if (proc.ExitType() == EExitPending)
+ {
+ // Java Installer process is already running
+ proc.Close();
+
+ // return error information
+ TRAP(err, aResults.AddIntL(KSifOutParam_ErrCategory, EInstallerBusy));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "CJavaSifPlugin::ExitIfJavaInstallerRunning aResults.AddIntL "
+ "ErrCategory err %d", err);
+ }
+
+ TRAP(err, aResults.AddIntL(KSifOutParam_ErrCode, KErrInUse));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "CJavaSifPlugin::ExitIfJavaInstallerRunning aResults.AddIntL "
+ "ErrCode err %d", err);
+ }
+
+ TRAP(err, aResults.AddIntL(KSifOutParam_ExtendedErrCode, 0));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "CJavaSifPlugin::ExitIfJavaInstallerRunning aResults.AddIntL "
+ "ExtendedErrCode err %d", err);
+ }
+
+ // TODO: return also localized error message from usif
+ // common localization file after the localized strings are available
+
+ TRequestStatus *statusPtr(&aStatus);
+ User::RequestComplete(statusPtr, KErrInUse);
+ return ETrue;
+ }
+ }
+ proc.Close();
+ }
+
+ return EFalse;
+}
+
+/**
+ * Creates 'preparing installation' dialog.
+ */
+void CJavaSifPlugin::CreatePrepInstDialogL()
+{
+ ILOG(EJavaInstaller, "CJavaSifPlugin::CreatePrepInstDialogL creating dialog");
+ mPrepInstDialog = CHbDeviceNotificationDialogSymbian::NewL();
+ _LIT(KPrepInstText, "Preparing installation...");
+ mPrepInstDialog->SetTitleL(KPrepInstText);
+ mPrepInstDialog->SetTimeout(20*1000); // ms
+ mPrepInstDialog->ShowL();
+ ILOG(EJavaInstaller, "CJavaSifPlugin::CreatePrepInstDialogL dialog created");
+}
+
+void CJavaSifPlugin::HidePrepInstDialogL()
+{
+ ILOG(EJavaInstaller, "CJavaSifPlugin::HidePrepInstDialogL hiding dialog");
+ // Stop further timed calls
+ if (mWaitToHideDialog)
+ {
+ mWaitToHideDialog->Cancel();
+ }
+ // Close wait dialog.
+ if (mPrepInstDialog)
+ {
+ mPrepInstDialog->Close();
+ }
+ ILOG(EJavaInstaller, "CJavaSifPlugin::HidePrepInstDialogL dialog hidden");
+}
+
// End of File
--- a/javamanager/javainstaller/javasifplugin/src/proxy.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/src/proxy.cpp Thu Aug 19 09:48:13 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"
@@ -26,7 +26,7 @@
// CONSTANTS
const TImplementationProxy KImplementationTable[] =
{ IMPLEMENTATION_PROXY_ENTRY(KJavaSifPluginEcomImplUid,
- Java::Installer::CJavaSifPlugin::NewL)
+ java::installer::CJavaSifPlugin::NewL)
};
// -----------------------------------------------------------------------------
--- a/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/src/resultsserver.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
@@ -11,14 +11,18 @@
*
* Contributors:
*
-* Description: Comms server,
-* part of Java platform 2.0 javarestoreconverter process
+* Description: Comms server, part of Java Sif plugin.
+* When started in 'commsresult' mode from Java Sif plugin
+* Java Installer sends the results of the operation
+* it executes (install, uninstall or component info)
+* to this server.
*
*/
#include <iostream>
#include <unistd.h>
+#include <usif/usiferror.h>
#include "comms.h"
#include "javasymbianoslayer.h"
@@ -29,7 +33,7 @@
using namespace std;
ResultsServer::ResultsServer(COpaqueNamedParams& aResults, CComponentInfo& aInfo) :
- iResults(aResults), iInfo(aInfo)
+ mResults(aResults), mInfo(aInfo)
{
}
@@ -44,23 +48,43 @@
int ResultsServer::start()
{
- iRunning = 1;
- iComms.registerDefaultListener(this);
- return iComms.start(IPC_ADDRESS_JAVA_SIF_PLUGIN_C);
+ // Write reasonable error codes to mResults that can be used if
+ // Java Installer never returns InstallerResultMessage.
+ // If InstallerResultMessage is received the values will be overwritten.
+ TRAPD(err, mResults.AddIntL(KSifOutParam_ErrCategory, EUnexpectedError));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "ResultsServer::start mResults.AddIntL ErrCategory err %d", err);
+ }
+
+ TRAP(err, mResults.AddIntL(KSifOutParam_ErrCode, KErrUnknown));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "ResultsServer::start mResults.AddIntL ErrCode err %d", err);
+ }
+
+ TRAP(err, mResults.AddIntL(KSifOutParam_ExtendedErrCode, 0));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "ResultsServer::start mResults.AddIntL ExtendedErrCode err %d", err);
+ }
+
+ // TODO: return also localized error message (KSifOutParam_ErrMessage and
+ // perhaps also KSifOutParam_ErrMessageDetails) from usif
+ // common localization file after the localized strings are available
+
+
+ mComms.registerDefaultListener(this);
+ return mComms.start(IPC_ADDRESS_JAVA_SIF_PLUGIN_C);
}
int ResultsServer::stop()
{
- if (iRunning > 0)
- {
- iRunning = 0;
- iComms.unregisterDefaultListener(this);
- return iComms.stop();
- }
- else
- {
- return 0;
- }
+ mComms.unregisterDefaultListener(this);
+ return mComms.stop();
}
/**
@@ -117,66 +141,8 @@
if (KErrNone != result)
{
- // return common error information
- TRAP(err, iResults.AddIntL(KSifOutParam_ExtendedErrCode, result));
- if (KErrNone != err)
- {
- ELOG1(EJavaInstaller,
- "ResultsServer::processMessage iResults.AddIntL ExtendedErrCode err %d",
- err);
- }
-
- TRAP(err, iResults.AddIntL(KSifOutParam_ErrCode, result));
- if (KErrNone != err)
- {
- ELOG1(EJavaInstaller,
- "ResultsServer::processMessage iResults.AddIntL ErrCode err %d", err);
- }
-
- TRAP(err, iResults.AddIntL(
- KSifOutParam_ErrCategory, iIntPairs[L"error-category"]));
- if (KErrNone != err)
- {
- ELOG1(EJavaInstaller,
- "ResultsServer::processMessage iResults.AddIntL ErrCategory err %d",
- err);
- }
-
- HBufC *message = wstringToBuf(iStringPairs[L"error-message"]);
- if (message == NULL)
- {
- ELOG(EJavaInstaller,
- "ResultsServer::processMessage iResults.wstringToBuf returned NULL ");
- }
- else
- {
- TRAP(err, iResults.AddStringL(KSifOutParam_ErrMessage, *message));
- if (KErrNone != err)
- {
- ELOG1(EJavaInstaller,
- "ResultsServer::processMessage iResults.AddStringL ErrMessage err %d",
- err);
- }
- delete message;
- }
-
- message = wstringToBuf(iStringPairs[L"error-details"]);
- if (message == NULL)
- {
- ELOG(EJavaInstaller,
- "ResultsServer::processMessage iResults.wstringToBuf 2 returned NULL ");
- }
- else
- {
- TRAP(err, iResults.AddStringL(KSifOutParam_ErrMessageDetails, *message));
- if (KErrNone != err)
- {
- ELOG1(EJavaInstaller,
- "ResultsServer::processMessage iResults.AddStringL ErrMessageDetails "
- "err %d", err);
- }
- delete message;
- }
+ // return common error information;
+ setCommonErrorInfo();
if (INSTALL_OPERATION == operation)
{
@@ -197,17 +163,21 @@
}
else
{
- // operation succeeded
+ // Operation succeeded
+
+ // Overwrite (reset) the default error values set for the case where no
+ // InstallerResultMessage is never received
+ resetDefaultErrorValues();
if (INSTALL_OPERATION == operation)
{
// Return the component ids of the installed Java application.
TComponentId resultComponentId = iIntPairs[L"suite-cid"];
- TRAP(err, iResults.AddIntL(KSifOutParam_ComponentId, resultComponentId));
+ TRAP(err, mResults.AddIntL(KSifOutParam_ComponentId, resultComponentId));
if (KErrNone != err)
{
ELOG1(EJavaInstaller,
- "ResultsServer::processMessage iResults.AddIntL cid error %d", err);
+ "ResultsServer::processMessage mResults.AddIntL cid error %d", err);
}
}
else if (UNINSTALL_OPERATION == operation)
@@ -239,7 +209,7 @@
reply.setMessageId(INSTALLER_RESULT_RESPONSE_MESSAGE_ID);
reply << 0;
- int err = iComms.send(reply);
+ int err = mComms.send(reply);
if (err != 0)
{
ELOG1(EJavaInstaller,
@@ -262,6 +232,95 @@
}
+/**
+ * Set common error information.
+ * Note that the information is in member variables
+ * iIntPairs and iStringPairs
+ */
+void ResultsServer::setCommonErrorInfo()
+{
+ // return common error information
+ TRAPD(err, mResults.AddIntL(KSifOutParam_ErrCode, iIntPairs[L"error-code"]));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "ResultsServer::setCommonErrorInfo mResults.AddIntL ErrCode err %d", err);
+ }
+
+ TRAP(err, mResults.AddIntL(
+ KSifOutParam_ErrCategory, iIntPairs[L"error-category"]));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "ResultsServer::setCommonErrorInfo mResults.AddIntL ErrCategory err %d",
+ err);
+ }
+
+ HBufC *message = wstringToBuf(iStringPairs[L"error-message"]);
+ if (!message)
+ {
+ ELOG(EJavaInstaller,
+ "ResultsServer::setCommonErrorInfo mResults.wstringToBuf returned NULL ");
+ }
+ else
+ {
+ TRAP(err, mResults.AddStringL(KSifOutParam_ErrMessage, *message));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "ResultsServer::setCommonErrorInfo mResults.AddStringL ErrMessage err %d",
+ err);
+ }
+ delete message;
+ }
+
+ message = wstringToBuf(iStringPairs[L"error-details"]);
+ if (!message)
+ {
+ ELOG(EJavaInstaller,
+ "ResultsServer::setCommonErrorInfo mResults.wstringToBuf 2 returned NULL ");
+ }
+ else
+ {
+ TRAP(err, mResults.AddStringL(KSifOutParam_ErrMessageDetails, *message));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "ResultsServer::setCommonErrorInfo mResults.AddStringL ErrMessageDetails "
+ "err %d", err);
+ }
+ delete message;
+ }
+}
+
+
+/**
+ * Overwrite (reset) the default error values to 'no error'.
+ * The default error values were originally set for the case
+ * where no InstallerResultMessage is never received and we must
+ * return sensible error information.
+ */
+void ResultsServer::resetDefaultErrorValues()
+{
+ TRAPD(err, mResults.AddIntL(KSifOutParam_ErrCategory, 0));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "ResultsServer::resetDefaultErrorValues mResults.AddIntL ErrCategory err %d", err);
+ }
+
+ TRAP(err, mResults.AddIntL(KSifOutParam_ErrCode, 0));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaInstaller,
+ "ResultsServer::resetDefaultErrorValues mResults.AddIntL ErrCode err %d", err);
+ }
+
+ // TODO: reset also localized error message KSifOutParam_ErrMessage and
+ // perhaps also KSifOutParam_ErrMessageDetails if they have been set in start()
+}
+
+
void ResultsServer::clearData()
{
iIntPairs.clear();
@@ -300,7 +359,7 @@
ss >> midletUidN;
//LOG1WSTR(EJavaInstaller, EInfo,
- // "ResultsServer::processMessage: checking %s", midletUidN.c_str());
+ // "ResultsServer::processMessage: checking %S", midletUidN.c_str());
int uid = iIntPairs[midletUidN];
if (uid == 0)
@@ -326,8 +385,8 @@
CleanupStack::Pop(applicationInfo);
n++;
- }
- while (n < 10000); // sanity check: no suite can have 10000 midlets
+ } // sanity check: no suite can have 10000 midlets
+ while (n < 10000); // codescanner::magicnumbers
CComponentInfo::CNode *rootNode = NULL;
rootNode = CComponentInfo::CNode::NewLC(
@@ -348,7 +407,7 @@
);
// Store whole component info tree
- iInfo.SetRootNodeL(rootNode);
+ mInfo.SetRootNodeL(rootNode);
CleanupStack::Pop(rootNode);
CleanupStack::PopAndDestroy(&applications);
}
--- a/javamanager/javainstaller/javasifplugin/tsrc/build/testsifapi.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/tsrc/build/testsifapi.pro Thu Aug 19 09:48:13 2010 +0300
@@ -23,7 +23,7 @@
symbian {
TARGET.UID2 = 0
TARGET.UID3 = 0xE0E5E262
- TARGET.CAPABILITY = WriteDeviceData TrustedUI
+ TARGET.CAPABILITY = all -tcb -drm
LIBS += -lestor -lapparc -lapgrfx -lefsrv -lsif
--- a/javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/javasifplugin/tsrc/src.s60/main.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -31,7 +31,16 @@
using namespace Usif;
_LIT(KTestMIDlet, "E:\\stopwatch10midp2.jad");
-//_LIT(KTestMIDlet, "C:\\data\\installs\\DS_Snow.jad");
+_LIT(KTestMIDlet2, "E:\\stopwatch11midp2.jar");
+_LIT(KTestMIDlet3, "E:\\Private\\10281e17\\SimpleRMS.jar");
+_LIT(KUserName, "user");
+_LIT(KPassWord, "password");
+_LIT(KEmptyString, "");
+_LIT(KSourceUrl, "\\sourceurl\\foo");
+_LIT(KCharSet, "charset");
+_LIT(KJadMimeType, "text/vnd.sun.j2me.app-descriptor");
+_LIT(KJarMimeType, "application/java-archive");
+
/**
* Installs a component by file name
@@ -64,6 +73,82 @@
CleanupStack::PopAndDestroy(1);
}
+
+/**
+ * This test case requires that you start Java Installer
+ * manually before executing this one and keep it running
+ * this test case ends.
+ *
+ *
+ * Keep the installer running until 1) installation has failed
+ * 2) uninstallation has failed and 3) getComponentInfo had failed
+ * because the installer is already running.
+ */
+static void sifInstallerAlreadyRunningL()
+{
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: sifInstallerAlreadyRunningL: Called");
+
+ RSoftwareInstall installer;
+ TInt err = installer.Connect();
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaConverters,
+ "testsifapi: sifInstallerAlreadyRunningL: Cannot connect to RSoftwareInstall, err %d", err);
+ User::Leave(err);
+ }
+ CleanupClosePushL(installer);
+
+/*
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: sifInstallerAlreadyRunningL: Starting the first installer process");
+ TRequestStatus status;
+ installer.Install(KTestMIDlet, status);
+
+ // wait for second
+ User::After(1000000);
+*/
+
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: sifInstallerAlreadyRunningL: Starting the concurrent installation");
+ // Try to start concurrent installation, will fail
+ TRequestStatus status2;
+ installer.Install(KTestMIDlet2, status2, EFalse);
+ User::WaitForRequest(status2);
+ LOG1(EJavaConverters, EInfo,
+ "testsifapi: sifInstallerAlreadyRunningL: The return status of concurrent install operation was %d", status2.Int());
+
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: sifInstallerAlreadyRunningL: Starting the concurrent uninstallation");
+ // Try to start concurrent uninstallation, will fail
+ TRequestStatus status3;
+ installer.Uninstall(15, status3, EFalse);
+ User::WaitForRequest(status3);
+ LOG1(EJavaConverters, EInfo,
+ "testsifapi: sifInstallerAlreadyRunningL: The return status of concurrent uninstall operation was %d", status3.Int());
+
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: sifInstallerAlreadyRunningL: Starting the concurrent get component info");
+ // Try to start concurrent GetComponentInfo, will fail
+ TRequestStatus status4;
+ CComponentInfo *info = CComponentInfo::NewL();
+ installer.GetComponentInfo(KTestMIDlet, *info, status4);
+ User::WaitForRequest(status4);
+ delete info;
+ LOG1(EJavaConverters, EInfo,
+ "testsifapi: sifInstallerAlreadyRunningL: The return status of concurrent GetComponentInfo operation was %d", status4.Int());
+
+/*
+ User::WaitForRequest(status);
+
+ LOG1(EJavaConverters, EInfo,
+ "testsifapi: sifInstallerAlreadyRunningL: The return status of install operation was %d", status.Int());
+*/
+
+ // free resources before returning
+ CleanupStack::PopAndDestroy(1);
+}
+
/**
* Installs a component by file handle using opaque arguments/results
*/
@@ -89,8 +174,9 @@
User::Leave(err);
}
+// TEMP TEST
RFile installFile;
- err = installFile.Open(fs, KTestMIDlet, EFileShareReadersOnly | EFileRead);
+ err = installFile.Open(fs, KTestMIDlet3, EFileShareReadersOnly | EFileRead);
if (KErrNone != err)
{
ELOG1(EJavaConverters,
@@ -125,6 +211,32 @@
// Silent installation request
arguments->AddIntL(KSifInParam_InstallSilently, 1);
+ // drive E:
+ arguments->AddIntL(KSifInParam_Drive, 4);
+
+ // 0 is TSifPolicy::EUserAllowed == Yes
+ arguments->AddIntL(KSifInParam_PerformOCSP, 0);
+ arguments->AddIntL(KSifInParam_IgnoreOCSPWarnings, 0);
+
+ arguments->AddIntL(KSifInParam_AllowUpgrade, 0);
+ arguments->AddIntL(KSifInParam_AllowUntrusted, 0);
+ arguments->AddIntL(KSifInParam_AllowOverwrite, 0);
+ arguments->AddIntL(KSifInParam_AllowDownload, 0);
+
+
+// TEMP TEST prevent overflow
+// arguments->AddStringL(KSifInParam_UserName, KUserName);
+// arguments->AddStringL(KSifInParam_Password, KPassWord);
+
+ arguments->AddStringL(KSifInParam_SourceUrl, KSourceUrl);
+
+ arguments->AddIntL(KSifInParam_IAP, 3);
+
+ arguments->AddStringL(KSifInParam_Charset, KEmptyString);
+
+ arguments->AddStringL(KSifInParam_MimeType, KJadMimeType);
+
+
LOG(EJavaConverters, EInfo,
"testsifapi: sifByHandleAndArgsAndResultsInstallL: arguments created");
@@ -155,6 +267,90 @@
return componentId;
}
+/**
+ * Installs a component by file handle using other opaque arguments than
+ * sifByHandleAndArgsAndResultsInstallL()
+ */
+static TInt secondSifByFileAndArgsAndResultsInstallL()
+{
+ RSoftwareInstall installer;
+ TInt err = installer.Connect();
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaConverters,
+ "testsifapi: secondSifByFileAndArgsAndResultsInstallL: Cannot connect to RSoftwareInstall, err %d", err);
+ User::Leave(err);
+ }
+ CleanupClosePushL(installer);
+
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: secondSifByFileAndArgsAndResultsInstallL: RSoftwareInstall connected");
+
+ TRequestStatus status;
+ COpaqueNamedParams *arguments = COpaqueNamedParams::NewL();
+ CleanupStack::PushL(arguments);
+ COpaqueNamedParams *results = COpaqueNamedParams::NewL();
+ CleanupStack::PushL(results);
+
+ // Silent installation request
+ arguments->AddIntL(KSifInParam_InstallSilently, 1);
+
+ // illegal drive number 33
+ arguments->AddIntL(KSifInParam_Drive, 33);
+
+ // 1 is No
+ arguments->AddIntL(KSifInParam_PerformOCSP, 1);
+ arguments->AddIntL(KSifInParam_IgnoreOCSPWarnings, 1);
+
+ arguments->AddIntL(KSifInParam_AllowUpgrade, 1);
+ arguments->AddIntL(KSifInParam_AllowUntrusted, 1);
+ arguments->AddIntL(KSifInParam_AllowOverwrite, 1);
+ arguments->AddIntL(KSifInParam_AllowDownload, 1);
+
+// TEMP TEST prevent overflow
+// arguments->AddStringL(KSifInParam_UserName, KEmptyString);
+// arguments->AddStringL(KSifInParam_Password, KEmptyString);
+
+ arguments->AddStringL(KSifInParam_SourceUrl, KEmptyString);
+
+ arguments->AddIntL(KSifInParam_SNAP, 8);
+
+ arguments->AddStringL(KSifInParam_Charset, KCharSet);
+
+ arguments->AddStringL(KSifInParam_MimeType, KJarMimeType);
+
+ // forcecancel argument value is ignored, forcecancel is set if the value length > 0
+ arguments->AddStringL(_L("-forcecancel"), KCharSet);
+
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: secondSifByFileAndArgsAndResultsInstallL: arguments created");
+
+ installer.Install(KTestMIDlet2, *arguments, *results, status);
+
+ User::WaitForRequest(status);
+
+ LOG1(EJavaConverters, EInfo,
+ "testsifapi: secondSifByFileAndArgsAndResultsInstallL: The return status of install operation was %d", status.Int());
+
+
+ TInt componentId = 0;
+ TBool idExisted = results->GetIntByNameL(KSifOutParam_ComponentId, componentId);
+ if ( idExisted )
+ {
+ LOG1(EJavaConverters, EInfo,
+ "testsifapi: secondSifByFileAndArgsAndResultsInstallL: Component id was %d", componentId);
+ }
+ else
+ {
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: secondSifByFileAndArgsAndResultsInstallL: No component id was returned");
+ }
+
+ // free resources before returning
+ CleanupStack::PopAndDestroy(3);
+
+ return componentId;
+}
static void sifUninstallL(TInt &aComponentId)
{
@@ -296,8 +492,50 @@
logApplicationInfo(*(info->RootNodeL().Applications()[nInd]));
}
+ CleanupStack::PopAndDestroy(info);
+
+
+ User::After(1000000);
+
+ // Get component info also from jar
+ TRequestStatus status2;
+ CComponentInfo *info2 = CComponentInfo::NewL();
+ CleanupStack::PushL(info2);
+
+ installer.GetComponentInfo(KTestMIDlet2, *info2, status2);
+
+ User::WaitForRequest(status2);
+
+ LOG1(EJavaConverters, EInfo,
+ "testsifapi: sifGetComponentInfoL: The return status of get "
+ "component info operation 2 was %d", status.Int());
+
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: sifGetComponentInfoL: Logging root node (suite2)");
+
+ logComponentInfoNode(info2->RootNodeL());
+
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: sifGetComponentInfoL: Logging child nodes (MIDlets2)");
+
+ TInt nMIDlets2 = info2->RootNodeL().Children().Count();
+ TInt nInd2;
+ for (nInd2 = 0; nInd2 < nMIDlets2; nInd2++)
+ {
+ logComponentInfoNode(*(info2->RootNodeL().Children()[nInd2]));
+ }
+
+ nMIDlets2 = info2->RootNodeL().Applications().Count();
+ for (nInd2 = 0; nInd2 < nMIDlets2; nInd2++)
+ {
+ logApplicationInfo(*(info2->RootNodeL().Applications()[nInd2]));
+ }
+
+ CleanupStack::PopAndDestroy(info2);
+
+
// free resources before returning
- CleanupStack::PopAndDestroy(2);
+ CleanupStack::PopAndDestroy(1);
}
@@ -350,6 +588,18 @@
LOG(EJavaConverters, EInfo,
"testsifapi: cancelFunction: Called");
+ // TEMP TEST
+ // This thread does not have active scheduler,
+ // create and install it
+ CActiveScheduler* as = new CActiveScheduler();
+ if (NULL == as)
+ {
+ ELOG(EJavaConverters,
+ "testsifapi: cancelFunction: Cannot create active scheduler");
+ return 1;
+ }
+ CActiveScheduler::Install(as);
+
// Wait for 6 seconds so that the operation to be cancelled
// has had time to really do something already
User::After(6000000);
@@ -359,9 +609,13 @@
((RSoftwareInstall *)installer)->CancelOperation();
+ LOG(EJavaConverters, EInfo, "testsifapi: cancelFunction: Starting CActiveScheduler");
+ CActiveScheduler::Start();
+
LOG(EJavaConverters, EInfo,
"testsifapi: cancelFunction: CancelOperation() was called");
+ delete as;
return 0;
}
@@ -399,6 +653,7 @@
"testsifapi: cancelFromSameThread: CancelOperation() returned");
}
+
static void cancelInstallL()
{
LOG(EJavaConverters, EInfo,
@@ -438,6 +693,30 @@
}
+static void cancelNoOperationL()
+{
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: cancelNoOperationL: Called");
+
+ RSoftwareInstall installer;
+ TInt err = installer.Connect();
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaConverters,
+ "testsifapi: cancelNoOperationL: Cannot connect to RSoftwareInstall, err %d", err);
+ User::Leave(err);
+ }
+ CleanupClosePushL(installer);
+
+ cancelFromSameThread(installer);
+
+ LOG(EJavaConverters, EInfo,
+ "testsifapi: cancelNoOperationL: cancelFrom<X>Thread returned");
+
+ // free resources before returning
+ CleanupStack::PopAndDestroy(1);
+
+}
/**
* Create cleanup stack and run the cleaner code inside TRAP harness
@@ -445,35 +724,35 @@
*/
TInt E32Main()
{
-/*
- ELOG2(EJavaConverters,
- "testsifapi: Starting testing long long long long long long long long long long "
- "long long long long long long long long long long long long long long long long "
- "long long long long long long long long long long long long long long long long "
- "long long long long long long long long long long long long long buffer %d %d", 0, 1);
-
- LOG(EJavaConverters, EInfo,
- "testsifapi: sifByHandleAndArgsAndResultsInstallL: Called");
-*/
-
- __UHEAP_MARK;
+// __UHEAP_MARK;
CTrapCleanup* cleanupStack = CTrapCleanup::New();
TInt err = KErrNone;
- /*
- TRAP(err, cancelInstallL());
- if (KErrNone != err)
- {
- ELOG1(EJavaConverters, "testsifapi: cancelInstallL leaved with err %d", err);
- }
+ LOG(EJavaConverters, EInfo, "testsifapi: starting cancelNoOperationL");
+ TRAP(err, cancelNoOperationL());
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaConverters, "testsifapi: cancelNoOperationL leaved with err %d", err);
+ }
- // Wait for a moment
- User::After(500000);
- */
+ // Wait for a moment
+ User::After(500000);
+ LOG(EJavaConverters, EInfo, "testsifapi: starting cancelInstallL");
+ TRAP(err, cancelInstallL());
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaConverters, "testsifapi: cancelInstallL leaved with err %d", err);
+ }
+
+ // Wait for a moment
+ User::After(500000);
+
+
+ LOG(EJavaConverters, EInfo, "testsifapi: starting sifSimplestInstallL");
TRAP(err, sifSimplestInstallL());
if (KErrNone != err)
{
@@ -484,8 +763,25 @@
User::After(500000);
+
+ // This test case must be executed sepatately, while manually started
+ // Java Installer is running
+ LOG(EJavaConverters, EInfo, "testsifapi: starting sifInstallerAlreadyRunningL");
+ TRAP(err, sifInstallerAlreadyRunningL());
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaConverters, "testsifapi: sifInstallerAlreadyRunningL leaved with err %d", err);
+ }
+
+ // Wait for a moment
+ User::After(500000);
+
+
TInt componentId = 0;
+ TInt componentId2 = 0;
+
+ LOG(EJavaConverters, EInfo, "testsifapi: starting sifByHandleAndArgsAndResultsInstallL");
TRAP(err, componentId = sifByHandleAndArgsAndResultsInstallL());
if (KErrNone != err)
{
@@ -495,7 +791,22 @@
// Wait for a moment
User::After(500000);
- // TODO: if this fails, it leaks memory
+
+ // This installation will fail because MIDlet is untrusted and installing
+ // untrusted is denied AND because charset is illegal
+ LOG(EJavaConverters, EInfo, "testsifapi: starting secondSifByFileAndArgsAndResultsInstallL");
+ TRAP(err, componentId2 = secondSifByFileAndArgsAndResultsInstallL());
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaConverters,
+ "testsifapi: secondSifByFileAndArgsAndResultsInstallL leaved with err %d", err);
+ }
+ // Wait for a moment
+ User::After(500000);
+
+
+ // if this fails, it leaks memory
+ LOG(EJavaConverters, EInfo, "testsifapi: starting sifGetComponentInfoL");
TRAP(err, sifGetComponentInfoL());
if (KErrNone != err)
{
@@ -505,6 +816,7 @@
// Wait for a moment
User::After(500000);
+ LOG(EJavaConverters, EInfo, "testsifapi: starting sifActivationTestL");
TRAP(err, sifActivationTestL(componentId));
if (KErrNone != err)
{
@@ -519,6 +831,7 @@
// TODO: if this fails, it leaks memory
if (0 != componentId)
{
+ LOG(EJavaConverters, EInfo, "testsifapi: starting sifUninstallL");
TRAP(err, sifUninstallL(componentId));
if (KErrNone != err)
{
@@ -530,8 +843,9 @@
User::After(500000);
}
+
delete cleanupStack;
// __UHEAP_MARKEND;
- __UHEAP_MARKENDC(1);
+// __UHEAP_MARKENDC(1);
return KErrNone;
}
--- a/javamanager/javainstaller/subsystem.mk Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javainstaller/subsystem.mk Thu Aug 19 09:48:13 2010 +0300
@@ -20,17 +20,19 @@
installerui/build \
installer/build \
-NONQTSUBSYSTEMS = \
- appinstuiplugin/build
-
-SYMBIAN_ONLY = \
- appinstuiplugin/build
+ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
+ NONQTSUBSYSTEMS = javasifplugin/build
+ SYMBIAN_ONLY = javasifplugin/build
+ COMPONENTS += installcopier/build
+else
+ NONQTSUBSYSTEMS = appinstuiplugin/build
+ SYMBIAN_ONLY = appinstuiplugin/build
+ifndef RD_JAVA_S60_RELEASE_5_0_IAD
+ NONQTSUBSYSTEMS += iconsizenotifplugin/build
+ SYMBIAN_ONLY += iconsizenotifplugin/build
+endif
+endif
-ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
- NONQTSUBSYSTEMS += javasifplugin/build
- SYMBIAN_ONLY += javasifplugin/build
-endif
-
LINUX_ONLY =
include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- a/javamanager/javalauncher/build/javalauncher_0x2001E262.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javalauncher/build/javalauncher_0x2001E262.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javalauncher.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javamanager/javalauncher/src.s60/javalauncher.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javalauncher/src.s60/javalauncher.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -92,7 +92,7 @@
JavaStorageApplicationList_t foundEntries;
- // Get MIDlet-n from APPLICATION_PACKAGE_ATTRIBUTES_TABLE based on
+ // Get MIDlet-n from APPLICATION_PACKAGE_ATTRIBUTES_TABLE based on
// PACKAGE_ID and NAME.
attribute.setEntry(ID, aPackageId);
findPattern.insert(attribute);
@@ -107,7 +107,7 @@
return KErrNotFound;
}
- // Found the MIDlet-n argument. Now getting the MIDlet name and
+ // Found the MIDlet-n argument. Now getting the MIDlet name and
// main class. Name is the first argument and main class is the last
// in the comma separated list.
std::wstring value = foundEntries.front().begin()->entryValue();
@@ -549,6 +549,10 @@
err = getUidFromCommandLine(cmdLineBuf, uid);
if (KErrNone != err)
{
+ ELOG1WSTR(EJavaCaptain,
+ "JavaLauncher: process command line was %s",
+ (wchar_t *)(cmdLineBuf.PtrZ()));
+
CleanupStack::PopAndDestroy(pBufCmdLine);
CleanupStack::PopAndDestroy(commandLine);
return err;
@@ -672,8 +676,8 @@
LOG(EJavaCaptain, EInfo, "javalauncher: startJavaCaptain javacaptain.exe was started ok");
#endif
- // Wait 3 seconds so that Java Captain has time to start
- User::After(3000000);
+ // Wait 3 seconds so that Java Captain has time to start and get read to answer Comms
+ User::After(3000000); // codescanner::userafter
}
else
{
@@ -773,6 +777,8 @@
"javalauncher: OMJ app launch: Exception %s caught", e.what());
}
+ delete pBufCmdLine;
+
return err;
}
--- a/javamanager/javamanager.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javamanager.pro Thu Aug 19 09:48:13 2010 +0300
@@ -17,12 +17,13 @@
SUBDIRS += preinstaller/build/javapreinstaller.pro
SUBDIRS += debugapi/build/debugapi.pro
SUBDIRS += javalauncher/build/javalauncher.pro
+SUBDIRS += javaupgradeapp/build/javaupgradeapp.pro
SUBDIRS += javacaptain
SUBDIRS += javainstaller
SUBDIRS += javaregistry
SUBDIRS += javabackup
SUBDIRS += javasettings
+BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javarecognizer/build/bld.inf\""
BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javasidchecker/build/bld.inf\""
-BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javarecognizer/build/bld.inf\""
BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javaappschemeplugin/build/bld.inf\""
BLD_INF_RULES.prj_extensions += "prj_extensions"
--- a/javamanager/javarecognizer/build/recjar.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javarecognizer/build/recjar.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -32,7 +32,11 @@
// Use bytepair compression to enable code paging
PAGED
+APP_LAYER_SYSTEMINCLUDE
+
USERINCLUDE ../inc
+USERINCLUDE ../../../inc
+
SOURCEPATH ../src
SOURCE recjar.cpp
@@ -40,9 +44,6 @@
TARGET recjar.rsc
END
-SYSTEMINCLUDE ../../../inc
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE /epoc32/include/ecom
LIBRARY euser.lib apmime.lib efsrv.lib
--- a/javamanager/javarecognizer/src/recjar.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javarecognizer/src/recjar.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -100,7 +100,7 @@
weOwnFileHandle = ETrue;
}
- TInt fileRemaining;
+ TInt fileRemaining = 0;
User::LeaveIfError(file->Size(fileRemaining));
if (fileRemaining > aBuffer.Length())
{
--- a/javamanager/javaregistry/build/eabi/javaregistryclientu.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/build/eabi/javaregistryclientu.def Thu Aug 19 09:48:13 2010 +0300
@@ -209,4 +209,12 @@
_ZNK4Java7Manager8Registry34CWriteableJavaRegistryPackageEntry17UsedUserDiskSpaceEv @ 208 NONAME
_ZNK4Java7Manager8Registry34CWriteableJavaRegistryPackageEntry14IsPreinstalledEv @ 209 NONAME
_ZNK4Java25CJavaRegistryPackageEntry14IsPreinstalledEv @ 210 NONAME
+ _ZN4Java14CJavaAttributeD0Ev @ 211 NONAME
+ _ZN4Java14CJavaAttributeD1Ev @ 212 NONAME
+ _ZN4Java14CJavaAttributeD2Ev @ 213 NONAME
+ _ZN4Java18CJavaRegistryEntryD0Ev @ 214 NONAME
+ _ZN4Java18CJavaRegistryEntryD1Ev @ 215 NONAME
+ _ZN4Java18CJavaRegistryEntryD2Ev @ 216 NONAME
+ _ZThn4_N4Java14CJavaAttributeD0Ev @ 217 NONAME
+ _ZThn4_N4Java14CJavaAttributeD1Ev @ 218 NONAME
--- a/javamanager/javaregistry/build/javaregistryclient_0x10282476.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/build/javaregistryclient_0x10282476.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javaregistryclient.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../client/inc
--- a/javamanager/javaregistry/client/src/javaattribute.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/client/src/javaattribute.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -92,7 +92,7 @@
// ---------------------------------------------------------------------------
// CJavaAttribute::~MJavaAttribute
// ---------------------------------------------------------------------------
-CJavaAttribute::~CJavaAttribute()
+EXPORT_C CJavaAttribute::~CJavaAttribute()
{
delete iName;
delete iValue;
--- a/javamanager/javaregistry/client/src/javaregistryentry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/client/src/javaregistryentry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -115,7 +115,7 @@
// CJavaRegistryEntry::~CJavaRegistryEntry
// ---------------------------------------------------------------------------
//
-CJavaRegistryEntry::~CJavaRegistryEntry()
+EXPORT_C CJavaRegistryEntry::~CJavaRegistryEntry()
{
if (iWritableEntry)
{
--- a/javamanager/javaregistry/client/src/writeablejavaregistry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/client/src/writeablejavaregistry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -363,9 +363,17 @@
if (KErrNotFound == err)
{
+ // reset the error flag
+ err = KErrNone;
if (IsPresent((*iter)))
{
- aUids.Append(uid);
+ err = aUids.Append(uid);
+ }
+ if (err)
+ {
+ ELOG1(EJavaStorage, "Failed to add Uid to container. "
+ "( error code = %d )", err);
+
}
}
}
@@ -414,7 +422,7 @@
}
}
}
- catch (ExceptionBase)
+ catch (ExceptionBase& ee)
{
ELOG1WSTR(EJavaStorage, "MediaId conversion failed: '%s'", value);
}
--- a/javamanager/javaregistry/client/src/writeablejavaregistryentry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/client/src/writeablejavaregistryentry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -379,7 +379,7 @@
regAttr = CJavaAttribute::NewL(
nameBuf->Des(), valueBuf->Des(), trusted);
- iAttributes.Append(regAttr);
+ iAttributes.AppendL(regAttr);
nameBuf.reset(0);
valueBuf.reset(0);
--- a/javamanager/javaregistry/javasizehelper/client/build/javasizehelperclient_0x2002DCD1.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/javasizehelper/client/build/javasizehelperclient_0x2002DCD1.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javasizehelperclient.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../client/inc
--- a/javamanager/javaregistry/javasizehelper/server/build/javasizehelperserver_0x2002DCD2.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/javasizehelper/server/build/javasizehelperserver_0x2002DCD2.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javasizehelperserver.mmp
@@ -53,7 +53,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
--- a/javamanager/javaregistry/legacy/server/src/javaregstore.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/legacy/server/src/javaregstore.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -543,7 +543,7 @@
{
if (IsPresentL((*iter)))
{
- aUids.Append(uid);
+ aUids.AppendL(uid);
}
}
}
@@ -765,7 +765,7 @@
TInt err = uidToTUid(appUid, converted);
if (KErrNone == err)
{
- uids.Append(converted);
+ uids.AppendL(converted);
}
else
{
--- a/javamanager/javaregistry/legacy/tsrc/build/testlegacyregistry.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/legacy/tsrc/build/testlegacyregistry.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -20,9 +20,10 @@
CAPABILITY all -tcb -allfiles -drm
#include <../../../../../inc/java_stdcpp_support_for_exe.hrh>
-#include <domain/osextensions/platform_paths.hrh>
+#include <platform_paths.hrh>
-USERINCLUDE /epoc32/include/cpputest
+USERINCLUDE /epoc32/include/CppUTest // Due to TestHarness.h et al
+
USERINCLUDE ../src/utils
USERINCLUDE ../../../../../inc // == (JAVA_SRC_ROOT)/inc
USERINCLUDE ../../../../../jrt_plat/java_registry_api/inc
--- a/javamanager/javaregistry/legacy/tsrc/src/AllTests.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/legacy/tsrc/src/AllTests.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -15,8 +15,8 @@
*
*/
-#include "Platform.h"
-#include "CommandLineTestRunner.h"
+#include <CppUTest/Platform.h>
+#include <CppUTest/CommandLineTestRunner.h>
int main(int ac, char** av)
{
--- a/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <string>
-#include "TestHarness.h"
+#include <CppUTest/TestHarness.h>
#include "javastorage.h"
#include "javastorageexception.h"
--- a/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistryentry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/legacy/tsrc/src/testinstalledappsregistryentry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <string>
-#include "TestHarness.h"
+#include <CppUTest/TestHarness.h>
#include "javastorage.h"
#include "javastorageexception.h"
--- a/javamanager/javaregistry/legacy/tsrc/src/testlegacyregistry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/legacy/tsrc/src/testlegacyregistry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <string>
-#include "TestHarness.h"
+#include <CppUTest/TestHarness.h>
#include "javacommonutils.h"
#include "javaoslayer.h"
--- a/javamanager/javaregistry/legacy/tsrc/src/testmidletentry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/legacy/tsrc/src/testmidletentry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <string>
-#include "TestHarness.h"
+#include <CppUTest/TestHarness.h>
#include "javacommonutils.h"
#include "javaoslayer.h"
--- a/javamanager/javaregistry/legacy/tsrc/src/testsuiteentry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/legacy/tsrc/src/testsuiteentry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -18,7 +18,7 @@
#include <stdio.h>
#include <string>
-#include "TestHarness.h"
+#include <CppUTest/TestHarness.h>
#include "javacommonutils.h"
#include "javaoslayer.h"
--- a/javamanager/javaregistry/tsrc/build/alltests.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/tsrc/build/alltests.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -21,12 +21,12 @@
#include <../../../../inc/java_stdcpp_support_for_exe.hrh>
#include <platform_paths.hrh>
- APP_LAYER_SYSTEMINCLUDE
-MW_LAYER_SYSTEMINCLUDE
+
+APP_LAYER_SYSTEMINCLUDE
-USERINCLUDE /epoc32/include/cpputest
+USERINCLUDE /epoc32/include/CppUTest // Due to TestHarness.h et al
+
USERINCLUDE ../src/utils
-
USERINCLUDE ../../../../inc // == (JAVA_SRC_ROOT)/inc
// Using main() as entry point
--- a/javamanager/javaregistry/tsrc/src/AllTests.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/tsrc/src/AllTests.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -15,8 +15,8 @@
*
*/
-#include "Platform.h"
-#include "CommandLineTestRunner.h"
+#include <CppUTest/Platform.h>
+#include <CppUTest/CommandLineTestRunner.h>
int main(int ac, char** av)
{
--- a/javamanager/javaregistry/tsrc/src/AllTests.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/tsrc/src/AllTests.h Thu Aug 19 09:48:13 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-#include "Utest.h"
+#include <CppUTest/Utest.h>
//Include this in the test main to execute these tests
IMPORT_TEST_GROUP(TestRegistry);
--- a/javamanager/javaregistry/tsrc/src/testregistry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/tsrc/src/testregistry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -19,7 +19,7 @@
#include <string>
#include <memory>
-#include "TestHarness.h"
+#include <CppUTest/TestHarness.h>
#include "javastorage.h"
#include "javastorageexception.h"
--- a/javamanager/javaregistry/tsrc/src/testregistryapplicationentry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/tsrc/src/testregistryapplicationentry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -19,7 +19,7 @@
#include <string>
#include <memory>
-#include "TestHarness.h"
+#include <CppUTest/TestHarness.h>
#include "javaregistry.h"
#include "javaregistryapplicationentry.h"
--- a/javamanager/javaregistry/tsrc/src/testregistryentry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/tsrc/src/testregistryentry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -20,7 +20,7 @@
#include <x509certchain.h>
#include <memory>
-#include "TestHarness.h"
+#include <CppUTest/TestHarness.h>
#include "javastorage.h"
#include "javastorageexception.h"
--- a/javamanager/javaregistry/tsrc/src/testregistrypackageentry.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javaregistry/tsrc/src/testregistrypackageentry.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -19,7 +19,7 @@
#include <string>
#include <memory>
-#include "TestHarness.h"
+#include <CppUTest/TestHarness.h>
#include "javaprocessconstants.h"
#include "javaregistry.h"
--- a/javamanager/javasettings/appmngrplugin/build/appmngr2midletruntime.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasettings/appmngrplugin/build/appmngr2midletruntime.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -31,8 +31,13 @@
PAGED
-USERINCLUDE ../javapackagelookup/inc
-USERINCLUDE ../help/inc
+APP_LAYER_SYSTEMINCLUDE
+
+USERINCLUDE ../inc
+USERINCLUDE ../../../../inc
+USERINCLUDE ../javapackagelookup/inc
+USERINCLUDE ../help/inc
+USERINCLUDE ../../../javainstaller/iconsizenotifplugin/inc
SOURCEPATH ../javapackagelookup/src
SOURCE jcfjadjarmatcher.cpp
@@ -66,11 +71,6 @@
LANGUAGE_IDS
END
-USERINCLUDE ../inc
-
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE ../../../../inc
-
LIBRARY bafl.lib // Syslibs BAFL
LIBRARY appmngr2pluginapi.lib // AppMngr2 Runtime API
LIBRARY cone.lib // App Framework
@@ -101,6 +101,11 @@
LIBRARY ezip.lib // CZipFile
LIBRARY charconv.lib // CnvUtfConverter
LIBRARY hlplch.lib // Help
+LIBRARY apgrfx.lib // RApaLsSession
+LIBRARY aknicon.lib // CAknIcon
+LIBRARY fbscli.lib // CFbsBitmap
+LIBRARY cdlengine.lib // AknLayoutScalable_Avkon
+LIBRARY aknlayout2scalable.lib // TAknWindowComponentLayout
DEBUGLIBRARY flogger.lib // File logger API
--- a/javamanager/javasettings/appmngrplugin/inc/appmngr2midletappinfo.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasettings/appmngrplugin/inc/appmngr2midletappinfo.h Thu Aug 19 09:48:13 2010 +0300
@@ -392,6 +392,12 @@
* @since S60 9.1
*/
void ReadCertificatesInfoL();
+
+ /**
+ * Read the app's icon and store it in iAppBitmap & iAppMask.
+ * If not found or if error occured, iAppBitmap will remain NULL.
+ */
+ void GetAppIconL(TUid aMidletUid);
private: // data
--- a/javamanager/javasettings/appmngrplugin/inc/appmngr2midletruntime.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasettings/appmngrplugin/inc/appmngr2midletruntime.h Thu Aug 19 09:48:13 2010 +0300
@@ -68,6 +68,11 @@
* @since S60 9.1
*/
~CAppMngr2MidletRuntime();
+
+ /**
+ * Get the ideal size for Java raster icons in the app mgr list.
+ */
+ inline TSize JavaRasterIconSize() {return iJavaRasterIconSize;};
public: // from CAppMngr2Runtime
@@ -172,6 +177,11 @@
* Owned
*/
CAppMngr2MidletResourceHandler* iResourceHandler;
+
+ /**
+ * Size of java raster icons in the app mgr list.
+ */
+ TSize iJavaRasterIconSize;
};
#endif // APPMNGR2MIDLETRUNTIME_H
--- a/javamanager/javasettings/appmngrplugin/inc/appmngr2midletsettingsutil.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasettings/appmngrplugin/inc/appmngr2midletsettingsutil.h Thu Aug 19 09:48:13 2010 +0300
@@ -60,7 +60,7 @@
const int READ_USER_DATA_ACCESS_SETTINGS_DISPLAY_INDEX = 10;
const int WRITE_USER_DATA_ACCESS_SETTINGS_DISPLAY_INDEX = 11;
const int LOCATION_SETTINGS_DISPLAY_INDEX = 12;
-const int LANDMARK_SETTINGS_DISPLAY_INDEX = 12;
+const int LANDMARK_SETTINGS_DISPLAY_INDEX = 13;
const int AUTHENTICATION_SETTINGS_DISPLAY_INDEX = 14;
const int SMART_CARD_COMMUNICATION_SETTINGS_DISPLAY_INDEX = 15;
const int BROADCAST_SETTINGS_DISPLAY_INDEX = 16;
@@ -210,6 +210,7 @@
private:
static const std::wstring getLocalizedSettingsName(std::wstring aSettingsName);
+ static HBufC* getLocalizedSettingsNameLC(std::wstring aSettingsName);
static const std::wstring getLocalizedSettingsInteractionMode(int aInteractionMode);
static const std::wstring getLocalizedOnScreenKeypadValue(std::wstring aOnScreenKeypadValue);
static const std::wstring getLocalizedSecurityWarningsModeValue(std::wstring aSecurityWarningsModeValue);
--- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletappinfo.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletappinfo.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -31,10 +31,12 @@
#include <appmngr2drmutils.h> // TAppMngr2DRMUtils
#include <appmngr2cleanuputils.h> // CleanupResetAndDestroyPushL
-#include <javaapplicationsettings.rsg> // Midlet resource IDs
+#include <apgcli.h> // RApaLsSession
+
+#include <javaapplicationsettings.rsg> // Midlet resource IDs
#include "appmngr2midletappinfo.h" // CAppMngr2MidletAppInfo
#include "appmngr2midletruntime.h" // KAppMngr2MidletUid
-#include "javaapplicationsettings.hrh" // Midlet command IDs
+#include "javaapplicationsettings.hrh" // Midlet command IDs
#include "appmngr2midletinfoiterator.h" // CAppMngr2MidletInfoIterator
#include "appmngr2midletsettingsview.h" // CAppMngr2MidletSettingsView
#include "appmngr2midletsettingshandler.h" // CAppMngr2MidletSettingsHandler
@@ -189,8 +191,12 @@
CGulIcon* CAppMngr2MidletAppInfo::SpecificIconL() const
{
LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::SpecificIconL");
- CGulIcon* icon = CGulIcon::NewL(iAppBitmap, iAppMask);
- icon->SetBitmapsOwnedExternally(ETrue);
+ CGulIcon* icon = NULL;
+ if (iAppBitmap && iAppMask)
+ {
+ icon = CGulIcon::NewL(iAppBitmap, iAppMask);
+ icon->SetBitmapsOwnedExternally(ETrue);
+ }
return icon;
}
@@ -243,7 +249,7 @@
void CAppMngr2MidletAppInfo::GetMenuItemsL(
RPointerArray<CEikMenuPaneItem::SData>& aMenuCmds)
{
- LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::GetMenuItemsL");
+ LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::GetMenuItemsL");
TInt resourceOffset = iResourceHandler.AddResourceFileL();
CEikMenuPaneItem::SData* menuItemData = new(ELeave) CEikMenuPaneItem::SData;
CleanupStack::PushL(menuItemData);
@@ -468,8 +474,7 @@
//
const std::wstring CAppMngr2MidletAppInfo::SecurityDomainCategory() const
{
- LOG(EJavaAppMngrPlugin, EInfo, " + CAppMngr2MidletAppInfo::MidletSuiteSecurityDomainCategory ");
- LOG(EJavaAppMngrPlugin, EInfo, " - CAppMngr2MidletAppInfo::MidletSuiteSecurityDomainCategory ");
+ LOG(EJavaAppMngrPlugin, EInfo, "CAppMngr2MidletAppInfo::MidletSuiteSecurityDomainCategory ");
return iSecurityDomainCategory;
}
@@ -767,10 +772,14 @@
// MIDlet suite specific icons
if (midletUids.Count() > 0)
{
- AknsUtils::CreateAppIconLC(AknsUtils::SkinInstance(), midletUids[ 0 ],
- EAknsAppIconTypeList, iAppBitmap, iAppMask);
- CleanupStack::Pop(2); // iAppBitmap, iAppMask
+ // Errors ignored so that the midlet is still displayed in the list with default icon.
+ TRAPD(err, GetAppIconL(midletUids[0]));
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaAppMngrPlugin, "GetAppIconL error %d", err);
+ }
}
+
CleanupStack::PopAndDestroy(&midletUids);
// security domain
@@ -925,7 +934,7 @@
CleanupStack::PopAndDestroy(urlParam);
CleanupStack::PopAndDestroy(launcher);
- LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::ShowInfoUrlL");
+ LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::ShowInfoUrlL");
}
// ---------------------------------------------------------------------------
@@ -985,3 +994,37 @@
iCertsRead = ETrue;
LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::ReadCertificatesInfoL");
}
+
+void CAppMngr2MidletAppInfo::GetAppIconL(TUid aMidletUid)
+{
+ LOG(EJavaAppMngrPlugin, EInfo, "+ CAppMngr2MidletAppInfo::GetAppIconL");
+
+ ASSERT(!iAppBitmap);
+ ASSERT(!iAppMask);
+
+ RApaLsSession lsSession;
+ User::LeaveIfError(lsSession.Connect());
+ CleanupClosePushL(lsSession);
+ CApaMaskedBitmap* apaBmp = CApaMaskedBitmap::NewLC();
+
+ TSize size = static_cast<CAppMngr2MidletRuntime&>(Runtime()).JavaRasterIconSize();
+ TInt err = lsSession.GetAppIcon(aMidletUid, size, *apaBmp);
+ if (err == KErrNone)
+ {
+ iAppBitmap = new (ELeave) CFbsBitmap();
+ iAppMask = new (ELeave) CFbsBitmap();
+ User::LeaveIfError(iAppBitmap->Duplicate(apaBmp->Handle()));
+ User::LeaveIfError(iAppMask->Duplicate(apaBmp->Mask()->Handle()));
+ }
+ CleanupStack::PopAndDestroy(apaBmp);
+ CleanupStack::PopAndDestroy(&lsSession);
+
+ if (!iAppBitmap)
+ {
+ AknsUtils::CreateAppIconLC(AknsUtils::SkinInstance(), aMidletUid,
+ EAknsAppIconTypeList, iAppBitmap, iAppMask);
+ CleanupStack::Pop(2); // iAppBitmap, iAppMask
+ }
+
+ LOG(EJavaAppMngrPlugin, EInfo, "- CAppMngr2MidletAppInfo::GetAppIconL");
+}
--- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletmanifestreader.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletmanifestreader.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -119,7 +119,7 @@
{
CJavaAttribute* javaAttribute
= CJavaAttribute::NewL(namePtr, valuePtr, EFalse);
- aAttributes.Append(javaAttribute);
+ aAttributes.AppendL(javaAttribute);
}
CleanupStack::PopAndDestroy(value);
--- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletruntime.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletruntime.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -37,6 +37,7 @@
#include <bldvariant.hrh>
#include "logger.h" // LOG
+#include "iconsizeutils.h" // IconSizeUtils::GetIconSizes
// MIDlet icon file name
_LIT(KAppMngr2MidletIconFileNameMif, "AppMngr2Midlet.mif");
@@ -270,5 +271,8 @@
LOG(EJavaAppMngrPlugin, EInfo, " + CAppMngr2MidletRuntime::ConstructL ");
iJavaRegistry = Java::CJavaRegistry::NewL();
iResourceHandler = CAppMngr2MidletResourceHandler::NewL();
+ iJavaRasterIconSize = IconSizeUtils::GetIconSizes().iAppMgrIconSize;
+ ILOG2(EJavaAppMngrPlugin, "Java icon size (%d, %d)",
+ iJavaRasterIconSize.iWidth, iJavaRasterIconSize.iHeight);
LOG(EJavaAppMngrPlugin, EInfo, " - CAppMngr2MidletRuntime::ConstructL ");
}
--- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingshandler.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingshandler.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -244,9 +244,11 @@
findEntry(queryResult, VALUE, value);
- if (value.size() > 0)
+ if (value.size() > 0
+ && ((value == L"no")
+ || (value == L"navigationkeys")
+ || (value == L"gameactions")))
{
- // default is KValueGameactions if value is not defined
predefined = true;
}
LOG(EJavaAppMngrPlugin, EInfo, " - CAppMngr2MidletSettingsHandler::OnScreenKeypadValuePreDefinedL ");
--- a/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingsutil.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasettings/appmngrplugin/src/appmngr2midletsettingsutil.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -488,86 +488,121 @@
{
wstring ret = aSettingsName;
TRAP_IGNORE(
- HBufC* localizedName = NULL;
- if (aSettingsName == ACCESS_POINT_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NETWORK_DESTINATION);
- }
- else if (aSettingsName == ON_SCREEN_KEYPAD_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_KEYPAD);
- }
- else if (aSettingsName == SECURITY_WARNINGS_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SECURITY_WARNINGS);
- }
- else if (aSettingsName == NET_ACCESS_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NET_ACCESS);
- }
- else if (aSettingsName == LOW_LEVEL_NET_ACCESS_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOW_LEVEL_NET_ACCESS);
- }
- else if (aSettingsName == CALL_CONTROL_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_CALL_CONTROL);
- }
- else if (aSettingsName == MESSAGING_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MESSAGING);
- }
- else if (aSettingsName == RESTRICTED_MESSAGING_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_MESSAGING);
- }
- else if (aSettingsName == APPLICATION_AUTO_INVOCATION_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_APP_AUTO_INVOCAT);
- }
- else if (aSettingsName == LOCAL_CONNECTIVITY_SETTINGS)
+ HBufC* localizedName = getLocalizedSettingsNameLC(aSettingsName);
+ if (localizedName != NULL)
{
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCAL_CONN);
- }
- else if (aSettingsName == MULTIMEDIA_RECORDING_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MM_RECORD);
- }
- else if (aSettingsName == READ_USER_DATA_ACCESS_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_READ_DATA);
+ ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length());
+ CleanupStack::PopAndDestroy(localizedName);
}
- else if (aSettingsName == WRITE_USER_DATA_ACCESS_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_WRITE_DATA);
- }
- else if (aSettingsName == LOCATION_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCATION);
- }
- else if (aSettingsName == LANDMARK_SETTINGS)
+ );
+ return ret;
+}
+
+HBufC* AppMngr2MidletSettingsUtil::getLocalizedSettingsNameLC(wstring aSettingsName)
+{
+ HBufC* localizedName = NULL;
+ if (aSettingsName == ACCESS_POINT_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NETWORK_DESTINATION);
+ }
+ else if (aSettingsName == ON_SCREEN_KEYPAD_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_KEYPAD);
+ }
+ else if (aSettingsName == SECURITY_WARNINGS_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SECURITY_WARNINGS);
+ }
+ else if (aSettingsName == NET_ACCESS_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NET_ACCESS);
+ }
+ else if (aSettingsName == LOW_LEVEL_NET_ACCESS_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOW_LEVEL_NET_ACCESS);
+ }
+ else if (aSettingsName == CALL_CONTROL_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_CALL_CONTROL);
+ }
+ else if (aSettingsName == MESSAGING_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MESSAGING);
+ }
+ else if (aSettingsName == RESTRICTED_MESSAGING_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_RESTRICTED_MESSAGING);
+ }
+ else if (aSettingsName == APPLICATION_AUTO_INVOCATION_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_APP_AUTO_INVOCAT);
+ }
+ else if (aSettingsName == LOCAL_CONNECTIVITY_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCAL_CONN);
+ }
+ else if (aSettingsName == MULTIMEDIA_RECORDING_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_MM_RECORD);
+ }
+ else if (aSettingsName == READ_USER_DATA_ACCESS_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_READ_DATA);
+ }
+ else if (aSettingsName == WRITE_USER_DATA_ACCESS_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_WRITE_DATA);
+ }
+ else if (aSettingsName == LOCATION_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LOCATION);
+ }
+ else if (aSettingsName == LANDMARK_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LANDMARKS);
+ }
+ else if (aSettingsName == AUTHENTICATION_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_AUT);
+ }
+ else if (aSettingsName == SMART_CARD_COMMUNICATION_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SMARTCARD);
+ }
+ else if (aSettingsName == BROADCAST_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_BROADCAST);
+ }
+ else if (aSettingsName == NFC_WRITE_ACCESS_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NFC_WRITE_ACCESS);
+ }
+ else if (aSettingsName == URL_START_SETTINGS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_URL_START);
+ }
+ return localizedName;
+}
+
+const wstring AppMngr2MidletSettingsUtil::getLocalizedSettingsInteractionMode(int aInteractionMode)
+{
+ wstring ret = L"";
+ TRAP_IGNORE(
+ HBufC* localizedName = NULL;
+ switch (aInteractionMode)
{
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_LANDMARKS);
- }
- else if (aSettingsName == AUTHENTICATION_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_AUT);
- }
- else if (aSettingsName == SMART_CARD_COMMUNICATION_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_SMARTCARD);
- }
- else if (aSettingsName == BROADCAST_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_BROADCAST);
- }
- else if (aSettingsName == NFC_WRITE_ACCESS_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_NFC_WRITE_ACCESS);
- }
- else if (aSettingsName == URL_START_SETTINGS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_NAME_URL_START);
+ case INTERACTION_MODE_BLANKET:
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_BLANK);
+ break;
+ case INTERACTION_MODE_SESSION:
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_SESSION);
+ break;
+ case INTERACTION_MODE_ONESHOT:
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_ONESHOT);
+ break;
+ case INTERACTION_MODE_DENIED:
+ localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_NO);
+ break;
}
if (localizedName != NULL)
{
@@ -578,71 +613,50 @@
return ret;
}
-const wstring AppMngr2MidletSettingsUtil::getLocalizedSettingsInteractionMode(int aInteractionMode)
-{
- HBufC* localizedName = NULL;
- switch (aInteractionMode)
- {
- case INTERACTION_MODE_BLANKET:
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_BLANK);
- break;
- case INTERACTION_MODE_SESSION:
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_SESSION);
- break;
- case INTERACTION_MODE_ONESHOT:
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_ONESHOT);
- break;
- case INTERACTION_MODE_DENIED:
- localizedName = StringLoader::LoadLC(R_JAVA_SETTING_VALUE_NO);
- break;
- default:
- return L"";
- }
- wstring ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length());
- CleanupStack::PopAndDestroy(localizedName);
- return ret;
-}
-
const wstring AppMngr2MidletSettingsUtil::getLocalizedSecurityWarningsModeValue(wstring aSecurityWarningsModeValue)
{
- HBufC* localizedName = NULL;
- if (aSecurityWarningsModeValue == SECURITY_WARNINGS_DEFAULT_MODE)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_DEFAULT);
- }
- else if (aSecurityWarningsModeValue == SECURITY_WARNINGS_USER_DEFINED_MODE)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_USER_DEFINED);
- }
- else
- {
- return L"";
- }
- wstring ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length());
- CleanupStack::PopAndDestroy(localizedName);
+ wstring ret = L"";
+ TRAP_IGNORE(
+ HBufC* localizedName = NULL;
+ if (aSecurityWarningsModeValue == SECURITY_WARNINGS_DEFAULT_MODE)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_DEFAULT);
+ }
+ else if (aSecurityWarningsModeValue == SECURITY_WARNINGS_USER_DEFINED_MODE)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_SECURITY_WARNINGS_SETTING_VALUE_USER_DEFINED);
+ }
+ if (localizedName != NULL)
+ {
+ ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length());
+ CleanupStack::PopAndDestroy(localizedName);
+ }
+ );
return ret;
}
const wstring AppMngr2MidletSettingsUtil::getLocalizedOnScreenKeypadValue(wstring aOnScreenKeypadValue)
{
- HBufC* localizedName = NULL;
- if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NO)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NO);
- }
- else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_GAMEACTIONS)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_GAME);
- }
- else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NAVIGATION)
- {
- localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NAVIGATION);
- }
- else
- {
- return L"";
- }
- wstring ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length());
- CleanupStack::PopAndDestroy(localizedName);
+ wstring ret = L"";
+ TRAP_IGNORE(
+ HBufC* localizedName = NULL;
+ if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NO)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NO);
+ }
+ else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_GAMEACTIONS)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_GAME);
+ }
+ else if (aOnScreenKeypadValue == ON_SCREEN_KEYPAD_VALUE_NAVIGATION)
+ {
+ localizedName = StringLoader::LoadLC(R_JAVA_KEYPAD_SETTING_VALUE_NAVIGATION);
+ }
+ if (localizedName != NULL)
+ {
+ ret = wstring((const wchar_t*)localizedName->Ptr(), localizedName->Length());
+ CleanupStack::PopAndDestroy(localizedName);
+ }
+ );
return ret;
}
--- a/javamanager/javasettings/subsystem.mk Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasettings/subsystem.mk Thu Aug 19 09:48:13 2010 +0300
@@ -17,10 +17,7 @@
include $(JAVA_SRC_ROOT)/build/Makefile.defs
-ifdef RD_JAVA_APPLICATION_SETTINGS_QT
-COMPONENTS += appsettingsview_qt/build
-SYMBIAN_ONLY += appsettingsview_qt/build
-else
+ifndef RD_JAVA_APPLICATION_SETTINGS_QT
ifndef RD_JAVA_S60_RELEASE_5_0_IAD
NONQTSUBSYSTEMS += appmngrplugin/build
SYMBIAN_ONLY += appmngrplugin/build
--- a/javamanager/javasidchecker/build/javasidchecker.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasidchecker/build/javasidchecker.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -39,8 +39,7 @@
// Includes
USERINCLUDE .
USERINCLUDE ../inc
-
-SYSTEMINCLUDE ../../../inc /epoc32/include/ecom /epoc32/include/swi
+USERINCLUDE ../../../inc
// Sources
SOURCEPATH ../src
--- a/javamanager/javasidchecker/src/javasidchecker.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/javasidchecker/src/javasidchecker.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -21,7 +21,7 @@
#include <e32std.h>
-#include <implementationproxy.h>
+#include <ecom/implementationproxy.h>
#include <appversion.h>
#include "javauids.h"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javaupgradeapp/build/bld.inf Thu Aug 19 09:48:13 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
+javaupgradeapp_0x2002FF64.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javaupgradeapp/build/javaupgradeapp.pro Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Helper application for uninstalling a java application and
+# then installing new application (java or native)
+#
+#
+
+TEMPLATE=app
+TARGET=javaupgradeapp
+CONFIG += omj no_icon stl
+CONFIG -= qt
+
+symbian {
+ TARGET.UID2 = 0x2000CFEC
+ TARGET.UID3 = 0x2002FF64
+ TARGET.CAPABILITY = TrustedUI
+ LIBS += -lestor -lapparc -lapgrfx
+}
+
+include(../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javaupgradeapp/build/javaupgradeapp_0x2002FF64.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,128 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated file - do not edit manually
+*
+*/
+
+// ==============================================================================
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
+// This file is generated by qmake and should not be modified by the
+// user.
+// Name : javaupgradeapp.mmp
+// ==============================================================================
+
+TARGET javaupgradeapp.exe
+TARGETTYPE EXE
+
+UID 0x2000CFEC 0x2002FF64
+SECUREID 0x2002FF64
+
+EPOCALLOWDLLDATA
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO RD_JAVA_SYMBIAN_TARGET
+MACRO RD_JAVA_S60_RELEASE_9_2
+MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
+MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
+MACRO RD_JAVA_STDCPPV5
+MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
+MACRO RD_JAVA_HTTP_EMC_ENABLED
+MACRO RD_JAVA_NGA_ENABLED
+MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
+MACRO RD_JAVA_OPENC_BETA_PATCH
+MACRO RD_JAVA_INSTALLERUI_ENABLED
+MACRO RD_JAVA_PREWARM
+MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+MACRO RD_JAVA_MIDPRMS_DB
+MACRO __SYMBIAN32__
+MACRO J9EPOC32
+
+SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../../inc
+SYSTEMINCLUDE ../../../inc
+SYSTEMINCLUDE ../src.s60
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE .
+
+SOURCEPATH ../src.s60
+SOURCE javaupgradeapp.cpp
+
+
+LIBRARY estor.lib
+LIBRARY apparc.lib
+LIBRARY apgrfx.lib
+LIBRARY javautils.lib
+LIBRARY libpthread.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY euser.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY avkon.lib
+LIBRARY efsrv.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+STATICLIBRARY libcrt0.lib
+
+CAPABILITY TrustedUI
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+#if defined(ARMCC_4_0)
+OPTION ARMCC --import_all_vtbl
+#endif
+OPTION GCCE -fvisibility-inlines-hidden
+
+VERSION 10.0
+
+ARMFPU softvfp
+
+PAGED
+
+BYTEPAIRCOMPRESSTARGET
+
+USERINCLUDE .
+
+#include <platform_paths.hrh>
+
+ 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javaupgradeapp/sis/java_upgradeapp.pkg Thu Aug 19 09:48:13 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: Helper application for uninstalling a java application and
+; then installing new application (any installation package file)
+;
+;Languages
+&EN
+
+
+#{"javaupgradeapp"},(0x2002FF64),1,1,0, TYPE=SA,RU
+
+;Localised Vendor name
+%{"Nokia"}
+
+;Unique Vendor name
+:"Nokia"
+
+;Supports Series 60 v 5.0
+;This line indicates that this installation is for the Series 60 platform v3.0
+;This line must appear _exactly_ as shown below in the sis file
+;If this line is missing or incorrect, the sis file will not be able
+;to be installed on Series 60 v5.0 platforms
+[0x1028315F], 0, 0, 0, {"Series60ProductID"}
+
+;
+"\epoc32\release\armv5\urel\javaupgradeapp.exe"-"c:\sys\bin\javaupgradeapp.exe"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javamanager/javaupgradeapp/src.s60/javaupgradeapp.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,434 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Helper application for uninstalling a java application and
+* then installing new application (java or native)
+*
+*/
+
+#include <apgcli.h>
+#include <apacmdln.h>
+#include <apmstd.h>
+#include <bacline.h>
+#include <e32cmn.h>
+#include <s32mem.h>
+#include <unistd.h>
+
+#include "exceptionbase.h"
+#include "javaoslayer.h"
+#include "javacommonutils.h"
+#include "javaprocessconstants.h"
+#include "javasymbianoslayer.h"
+#include "javauids.h"
+#include "logger.h"
+
+
+using namespace java::util;
+
+
+_LIT8(KHexValueStart, "0x");
+_LIT8(KSemiColon, ";");
+_LIT8(KUidArg, "uid=");
+_LIT8(KFileArg, "file=");
+
+const TInt KExtraLenForLogging = 2;
+const TInt KArgumentValueMaxLen = 1568;
+// Wait for 0.5 sec if ArcApp has not yet initialized
+const TInt KDelayWhenWaitingAppArc = 500000;
+
+
+/**
+ * Set the value of the argument specified by aArgName to aArgValue
+ *
+ * @param aCmdLine command line to be parsed
+ * @param aArgName the name of the argument
+ * @param aArgValue the value parsed from command line will be returned here
+ */
+static void getArgValueL(const TPtrC8 &aCmdLine, const TDesC8 &aArgName, HBufC **aArgValue)
+{
+ TBuf8<KArgumentValueMaxLen> valueBuf;
+ TInt argPos = aCmdLine.FindF(aArgName);
+ if (argPos >= 0)
+ {
+ TInt semicolonPos = aCmdLine.Mid(argPos).Find(KSemiColon);
+ if (KErrNotFound == semicolonPos)
+ {
+ semicolonPos = aCmdLine.Mid(argPos).Length();
+ }
+ TInt argLen = semicolonPos - aArgName.Length();
+ if (argLen >= KArgumentValueMaxLen)
+ {
+ // Protect from buffer overflow.
+ WLOG2(EUtils,
+ "javaupgradeapp: argument value len too long (%d), cutting it to %d",
+ argLen, (KArgumentValueMaxLen - 1));
+ argLen = KArgumentValueMaxLen - 1;
+ }
+ else if (argLen == 0)
+ {
+ User::Leave(KErrArgument);
+ }
+
+ valueBuf = aCmdLine.Mid(argPos + aArgName.Length(), argLen);
+ }
+
+ // Allocate new HBufC
+ HBufC *pBufValue = HBufC::NewL(valueBuf.Length() + 2);
+
+ // Convert argument from UTF8 to UCS-2 (UTF16)
+ std::wstring tmp = JavaCommonUtils::utf8ToWstring((const char *)valueBuf.PtrZ());
+
+ // Return the argument inside the new HBufC
+ *pBufValue = (const TUint16 *)(tmp.c_str());
+ *aArgValue = pBufValue;
+}
+
+
+/**
+ * Parse the name from the value of 'file' parameter in
+ * command line given in aCmdLine
+ *
+ * @param aCmdLine command line to be parsed, the format is
+ * <other_args>;file=YYY;<other_args>
+ * @param aFileName will contain the name parsed from command line
+ */
+static void getNameFromCommandLineL(const TPtrC8 &aCmdLine, HBufC **aFileName)
+{
+ TInt err = aCmdLine.FindF(KFileArg);
+ User::LeaveIfError(err);
+
+ getArgValueL(aCmdLine, KFileArg, aFileName);
+}
+
+
+/**
+ * Parse the Uid from the value of 'uid' parameter in
+ * command line given in aCmdLine
+ *
+ * @param aCmdLine command line to be parsed, the format is
+ * uid=YYY;<other_args>
+ * @param aUid will contain the Uid parsed from command line
+ */
+static void getUidFromCommandLineL(const TPtrC8 &aCmdLine, TInt32 &aUid)
+{
+ TInt err(KErrNone);
+ TInt argPos = aCmdLine.FindF(KUidArg);
+ if (KErrNotFound != argPos)
+ {
+ TPtrC8 uidToParse = aCmdLine.Mid(argPos + KUidArg.iTypeLength);
+ TLex8 parseUid(uidToParse);
+ if (uidToParse.FindF(KHexValueStart) == 0)
+ {
+ parseUid.Inc(2); // skip hex prefix
+ TUint32 tmpValue;
+ err = parseUid.Val(tmpValue, EHex);
+ aUid = tmpValue;
+ }
+ else
+ {
+ err = parseUid.Val(aUid);
+ }
+
+ if (KErrNone != err)
+ {
+ ELOG1(EUtils,
+ "javaupgradeapp failed parsing app Uid from cmdline uid param. Error %d",
+ err);
+ }
+ }
+ else
+ {
+ ELOG(EUtils,
+ "javaupgradeapp cannot uninstall app because uid parameter is not given");
+ }
+
+ User::LeaveIfError(err);
+}
+
+
+/**
+ * Parse the process command line.
+ * Determine the uid of the Java application to be uninstalled and
+ * the name of the application package to be installed.
+ * Leaves if argument 'file' exist but file name cannot be found,
+ * leaves if argument 'uid' exist but uid cannot be parsed from command line,
+ * does NOT leave if only one of the arguments is present
+ *
+ * @param aFileName returns value of argument 'file'
+ * @param aUid returns Uid of the Java application to be uninstalled
+ */
+void getFileAndUidL(HBufC **aFileName, TInt32 *aUid)
+{
+ CApaCommandLine* commandLine;
+
+ // CApaCommandLine command line is used when this application has been
+ // launched using AppArc APIs.
+ TInt err = CApaCommandLine::GetCommandLineFromProcessEnvironment(commandLine);
+ if (KErrNone != err)
+ {
+ ELOG1(EUtils, "javaupgradeapp: Getting CApaCommandLine failed, err %d", err);
+ User::Leave(err);
+ }
+ CleanupStack::PushL(commandLine);
+
+ // Get the value of _application-args_
+ TPtrC8 args = commandLine->TailEnd();
+ HBufC8 *pBufCmdLine =
+ HBufC8::NewLC(args.Length() + KExtraLenForLogging);
+ if (args.Length() > 0)
+ {
+ // Copy the arguments to the new HBufC8
+ TPtr8 cmdLineBuf = pBufCmdLine->Des();
+ cmdLineBuf = args;
+
+ LOG1(EUtils, EInfo,
+ "javaupgradeapp: full cmd line is : %s",
+ cmdLineBuf.PtrZ());
+
+ // Get the midlet uid from the commandline
+ TRAPD(err, getUidFromCommandLineL(cmdLineBuf, *aUid));
+ // It is enough that either midlet uid OR installation package name
+ // have been given in commandline
+ if ((err != KErrNone) && (err != KErrNotFound))
+ {
+ User::Leave(err);
+ }
+
+ // Get the name of the installation package from the commandline
+ TRAPD(err2, getNameFromCommandLineL(cmdLineBuf, aFileName))
+ if (err2 != KErrNone)
+ {
+ if (err2 == KErrNotFound)
+ {
+ if (err == KErrNotFound)
+ {
+ // Both arguments missing
+ User::Leave(KErrArgument);
+ }
+ }
+ else
+ {
+ User::Leave(err2);
+ }
+ }
+ }
+ else
+ {
+ ELOG(EUtils, "javaupgradeapp: empty command line");
+ User::Leave(KErrArgument);
+ }
+
+ CleanupStack::PopAndDestroy(pBufCmdLine);
+ CleanupStack::PopAndDestroy(commandLine);
+}
+
+
+/**
+ * Uninstall the java application specified by aUid parameter.
+ *
+ * @param aUid the Uid of the java application to be uninstalled
+ */
+void uninstallJavaAppL(TInt32 aUid)
+{
+ RProcess rJavaInstaller;
+ TFileName fileName;
+ // Max one path name and some options -> 1536 is enough
+ TBuf<1536> commandLine;
+
+ // Build command line used to pass all necessary info to Java Installer
+ TInt len = strlen(java::runtime::JAVA_INSTALLER_STARTER_DLL);
+ TPtr8 ptr8InstallerDll((TUint8 *)java::runtime::JAVA_INSTALLER_STARTER_DLL, len, len);
+ commandLine.Copy(ptr8InstallerDll);
+
+ // Use command line options that make sure that uninstallation is done
+ // always, silently and so that the uninstalled java application will
+ // be preinstalled again if the user uninstalls it
+ commandLine.Append(_L(" uninstall -uid="));
+ commandLine.AppendNum(aUid);
+ commandLine.Append(_L(" -forceuninstall -silent -resetpreinstall"));
+
+ LOG1WSTR(EUtils, EInfo,
+ "javaupgradeapp:uninstallJavaAppL Java Installer command line is %s",
+ (wchar_t *)(commandLine.PtrZ()));
+
+ // start JavaInstaller
+ TBuf<64> installerProcess; // Actual len of the process name is 9
+ len = strlen(java::runtime::JAVA_PROCESS);
+ TPtr8 ptr8Process((TUint8 *)java::runtime::JAVA_PROCESS, len, len);
+ installerProcess.Copy(ptr8Process);
+
+ TRequestStatus status;
+ TInt err = rJavaInstaller.Create(installerProcess, commandLine);
+ if (KErrNone == err)
+ {
+ LOG(EUtils, EInfo, "javaupgradeapp:uninstallJavaAppL calling Logon");
+ // Get notification when Java Installer exits (or panics)
+ rJavaInstaller.Logon(status);
+
+ LOG(EUtils, EInfo, "javaupgradeapp:uninstallJavaAppL calling Resume");
+ rJavaInstaller.Resume();
+ }
+ else
+ {
+ ELOG1(EUtils,
+ "javaupgradeapp:uninstallJavaAppL Cannot start Java Installer, error %d",
+ err);
+ User::Leave(err);
+ }
+
+ // now wait until Java Installer exits
+ User::WaitForRequest(status);
+
+ LOG(EUtils, EInfo, "javaupgradeapp:uninstallJavaAppL calling RProcess::Close");
+ // free resources before returning
+ rJavaInstaller.Close();
+}
+
+
+/**
+ *
+ *
+ *
+ */
+void installAppPackageL(HBufC *aBufFileName)
+{
+ // Open file using default handler,
+ // if the file is an installation package, it will be installed
+ RApaLsSession apaSession;
+ TInt err = apaSession.Connect();
+ if (KErrNone != err)
+ {
+ ELOG(EUtils,
+ "javaupgradeapp:installAppPackageL: Cannot connect to AppArc server");
+ User::Leave(err);
+ }
+ CleanupClosePushL(apaSession);
+
+ TInt retryCounter(10);
+ TThreadId handlerTreadId;
+ do
+ {
+ err = apaSession.StartDocument(*aBufFileName, handlerTreadId);
+ if (RApaLsSession::EAppListInvalid == err)
+ {
+ // Application list has not yet been populated,
+ // try again after a short delay
+ retryCounter--;
+ if (retryCounter > 0)
+ {
+ User::After(KDelayWhenWaitingAppArc); // codescanner::userafter
+ continue;
+ }
+ else
+ {
+ ELOG(EUtils,
+ "javaupgradeapp:installAppPackageL: RApaLsSession "
+ "StartDocument returned EAppListInvalid for 10 times, exiting");
+ User::Leave(err);
+ }
+ }
+ else if (KErrNone != err)
+ {
+ ELOG1(EUtils,
+ "javaupgradeapp:installAppPackageL: RApaLsSession "
+ "StartDocument returned error %d", err);
+ User::Leave(err);
+ }
+
+ } while (RApaLsSession::EAppListInvalid == err);
+
+ CleanupStack::PopAndDestroy(); // apaSession
+}
+
+
+/**
+ * Get the uid of the Java application to be uninstaller and
+ * start Java Installer to uninstall the application.
+ * Then install the new application package given in cmdline
+ *
+ */
+void handleUpgradeL(void)
+{
+ HBufC *pBufFileName = NULL;
+ TInt32 uid(0);
+
+ getFileAndUidL(&pBufFileName, &uid);
+
+ if (uid != 0)
+ {
+ PLOG1(EUtils, "javaupgradeapp uninstalling app uid %x", uid);
+ uninstallJavaAppL(uid);
+ }
+ else
+ {
+ WLOG(EUtils, "javaupgradeapp: uid argument was not given");
+ }
+
+ if (pBufFileName != NULL)
+ {
+ PLOG1WSTR(EUtils,
+ "javaupgradeapp: installing new app package %s",
+ (wchar_t *)(pBufFileName->Des().PtrZ()));
+ installAppPackageL(pBufFileName);
+
+ delete pBufFileName;
+ }
+ else
+ {
+ WLOG(EUtils, "javaupgradeapp: file argument was not given");
+ }
+}
+
+
+/**
+ * Main function of executable javaupgradeapp.exe.
+ * "installer app" created by Services team starts this executable when
+ * the "installer app" must be replaced with the real application (java/native or wrt)
+ *
+ * The command line format is
+ * uid=<Uid>;file=<full_path_to_installation_file>
+ * for example
+ * uid=0x10137c4d;file=D:\\temp\\upgrade\\package.sis
+ *
+ * Sample code for starting this application from the "installer app" MIDlet
+ * @code
+
+ MIDlet.platformRequest(
+ “nativeapp://application-exe=javaupgradeapp.exe;application-args=uid=0x10137c4d;file=D:\\temp\\upgrade\\package.sis”);
+
+ * @endcode
+ *
+ */
+TInt E32Main(void)
+{
+ // TODO: check that only MIDP runtime process can start this in final version
+ // that goes to ROM
+
+
+ CTrapCleanup *pCleanupStack = CTrapCleanup::New();
+ if (NULL == pCleanupStack)
+ {
+ ELOG(EUtils, "Cannot create CleanupStack in javaupgradeapp.exe main()");
+ return KErrNoMemory;
+ }
+
+ TRAPD(err, handleUpgradeL());
+ if (KErrNone != err)
+ {
+ ELOG1(EUtils, "javaupgradeapp.exe: handleUpgradeL leaved with err %d", err);
+ }
+
+ delete pCleanupStack;
+ return err;
+}
+
--- a/javamanager/preinstaller/build/javapreinstaller.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/preinstaller/build/javapreinstaller.pro Thu Aug 19 09:48:13 2010 +0300
@@ -27,7 +27,9 @@
-lPlatformEnv \
-ljavacomms \
-lcharconv \
- -ljavastorage
+ -ljavastorage \
+ -lapparc \
+ -lapgrfx
}
include(../../../build/omj.pri)
--- a/javamanager/preinstaller/build/javapreinstaller_0x2002DCC6.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/preinstaller/build/javapreinstaller_0x2002DCC6.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javapreinstaller.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../inc
@@ -73,6 +72,8 @@
LIBRARY javacomms.lib
LIBRARY charconv.lib
LIBRARY javastorage.lib
+LIBRARY apparc.lib
+LIBRARY apgrfx.lib
LIBRARY javautils.lib
LIBRARY libpthread.lib
LIBRARY libstdcppv5.lib
@@ -85,12 +86,10 @@
LIBRARY mediaclientaudio.lib
LIBRARY eikcoctl.lib
LIBRARY eiksrv.lib
-LIBRARY apparc.lib
LIBRARY avkon.lib
LIBRARY ws32.lib
LIBRARY hal.lib
LIBRARY gdi.lib
-LIBRARY apgrfx.lib
CAPABILITY all -tcb
--- a/javamanager/preinstaller/src.s60/main.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/preinstaller/src.s60/main.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -119,7 +119,7 @@
// Start active scheduler. Preinstallation starts.
LOG(EJavaPreinstaller, EInfo, "startPreinstallationL: Starting CActiveScheduler");
- CActiveScheduler::Start();
+ CActiveScheduler::Start(); // codescanner::activestart
// Now preinstallation has been done
LOG(EJavaPreinstaller, EInfo, "startPreinstallationL: Cleaning up");
--- a/javamanager/preinstaller/src.s60/silentmidletinstall.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/preinstaller/src.s60/silentmidletinstall.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description: OMJ S60 preinstaller process
+* Description: OMJ Symbian preinstaller process
*
*/
@@ -26,6 +26,8 @@
#include "silentmidletinstall.h"
#include "javacommonutils.h"
+#include "javauid.h"
+#include "javauids.h"
#include "logger.h"
#include "javaprocessconstants.h"
#include "javasymbianoslayer.h"
@@ -51,6 +53,7 @@
_LIT(KMidletName, "MIDlet-Name");
_LIT(KMidletVendor, "MIDlet-Vendor");
_LIT(KMidletVersion, "MIDlet-Version");
+_LIT(KMidletUid, "Nokia-MIDlet-UID-1");
_LIT(KJadExtension, "*.jad");
@@ -96,9 +99,9 @@
*/
void CSilentMIDletInstall::ConstructL()
{
- JELOG2(EJavaPreinstaller);
iMIDletName = HBufC::NewL(KMaxBufferSize);
iMIDletVendor = HBufC::NewL(KMaxBufferSize);
+ iMIDletUid = HBufC::NewL(KMaxBufferSize);
iPreinstallServer = new(ELeave) PreinstallCommsServer();
iNumberOfAppsToInstall = 0;
@@ -111,7 +114,6 @@
*/
CSilentMIDletInstall::~CSilentMIDletInstall()
{
- JELOG2(EJavaPreinstaller);
iJadFiles.ResetAndDestroy();
iJadFiles.Close();
@@ -124,6 +126,9 @@
delete iMIDletVendor;
iMIDletVendor = NULL;
+ delete iMIDletUid;
+ iMIDletUid = NULL;
+
delete iPreinstallServer;
iPreinstallServer = NULL;
}
@@ -133,7 +138,6 @@
*/
void CSilentMIDletInstall::Start()
{
- JELOG2(EJavaPreinstaller);
iState = EFindOutDeviceDrives;
// Check if an explicit roll-back of a previous installation is needed
@@ -187,8 +191,6 @@
*/
void CSilentMIDletInstall::CompleteRequest()
{
- JELOG2(EJavaPreinstaller);
-
TRequestStatus *status = &iStatus;
User::RequestComplete(status, KErrNone);
if (!IsActive())
@@ -241,8 +243,6 @@
*/
void CSilentMIDletInstall::RunL()
{
- JELOG2(EJavaPreinstaller);
-
switch (iState)
{
case EFindOutDeviceDrives:
@@ -449,7 +449,7 @@
LOG1WSTR(EJavaPreinstaller, EInfo,
"CSilentMIDletInstall::GetDirEntriesL Adding file %s",
(wchar_t *)(pathPtr.PtrZ()));
- aVector.Append(path);
+ aVector.AppendL(path);
CleanupStack::Pop(path);
}
@@ -580,13 +580,12 @@
/**
* Parse MIDlet-Name, MIDlet-Vendor and MIDlet-Version parameters from JAD file.
* Parameters are used to determine whether to pre-install MIDlet or not.
+ * Parse also optional Nokia-MIDlet-UID-1 in case it is needed.
*
* @param ETrue if parsing succeeds otherwise EFalse.
*/
TBool CSilentMIDletInstall::ParseJadL(const TDesC& aJadFileName)
{
- JELOG2(EJavaPreinstaller);
-
HBufC *jadContent = NULL;
// Trap leave thrown if reading jad content fails
TRAPD(err, jadContent = GetJadContentL(aJadFileName));
@@ -647,6 +646,23 @@
"CSilentMIDletInstall::ParseJadL MIDlet-Version is %d.%d.%d",
iMIDletVersion.iMajor, iMIDletVersion.iMinor, iMIDletVersion.iBuild);
+ HBufC *midletUid = ParseAttribute(jadContent, KMidletUid);
+ if (NULL == midletUid)
+ {
+ // Ok, all MIDlets do not predefine Symbian Uid
+ iMIDletUid->Des().Zero();
+ }
+ else
+ {
+ // store midlet Uid to member variable and log it
+ TPtr uidPtr(iMIDletUid->Des());
+ uidPtr.Copy(*midletUid);
+ LOG1WSTR(EJavaPreinstaller, EInfo,
+ "CSilentMIDletInstall::ParseJadL Nokia-MIDlet-UID-1 %s",
+ (wchar_t *)(uidPtr.PtrZ()));
+ delete midletUid;
+ }
+
CleanupStack::PopAndDestroy(jadContent);
return ETrue;
}
@@ -727,10 +743,17 @@
// Do not preinstall application if it is found from this table
// and the version number of the application is the same or less
// than the version number in the table.
+ // If the application has been removed by javaupgradeupp or it has
+ // not yet been installed, the application is not in the table at all.
+ // Do not preinstall the application if there is a native application
+ // with the same Uid as the predefined Uid of the first Java
+ // application in the application suite.
+ TBool apaSessionConnected(EFalse);
+ RApaLsSession apaSession;
JavaStorageEntry attribute;
JavaStorageApplicationEntry_t findPattern;
- JavaStorageApplicationList_t foundEntries;
+ JavaStorageApplicationList_t foundEntries;
for (TInt i = 0; i < iJadFiles.Count(); i++)
{
@@ -778,8 +801,8 @@
{
// This application must not be preinstalled
LOG1WSTR(EJavaPreinstaller, EInfo,
- "CheckWhichAppsShouldBeInstalledL: User has removed application %s "
- "It must not be preinstalled again.", desToWstring(namePtr));
+ "CheckWhichAppsShouldBeInstalledL: User has removed application %s "
+ "It must not be preinstalled again.", desToWstring(namePtr));
}
else
{
@@ -817,9 +840,34 @@
else
{
skipInstall = EFalse;
+
LOG(EJavaPreinstaller, EInfo,
"CheckWhichAppsShouldBeInstalledL: Application has not "
"been installed previously");
+
+ // Check whether there is a native application installed
+ // with the same Uid as the predefined Uid of the first
+ // Java application in the suite.
+
+ // The string value of attribute Nokia-MIDlet-UID-1 from
+ // Jad file is in iMIDletUid if it was defined.
+ TInt err = KErrNone;
+ if (iMIDletUid->Length() > 0)
+ {
+ if (!apaSessionConnected)
+ {
+ err = apaSession.Connect();
+ apaSessionConnected = ETrue;
+ }
+
+ // If the presence of a possible native app cannot be
+ // determined, let Java Installer try to install
+ // the Java application
+ if (KErrNone == err)
+ {
+ skipInstall = IsNativeAppPresent(apaSession);
+ }
+ }
}
foundEntries.clear();
@@ -830,8 +878,8 @@
skipInstall = ETrue;
TPtr16 ptrJadName = iJadFiles[i]->Des();
ELOG1WSTR(EJavaPreinstaller,
- "CheckWhichAppsShouldBeInstalledL: Parsing JAD %s failed",
- desToWstring(ptrJadName));
+ "CheckWhichAppsShouldBeInstalledL: Parsing JAD %s failed",
+ desToWstring(ptrJadName));
}
if (skipInstall)
@@ -845,6 +893,11 @@
}
}
+ if (apaSessionConnected)
+ {
+ apaSession.Close();
+ }
+
js->close();
}
@@ -1165,3 +1218,53 @@
return midletVersion;
} // DesToAppVersion
+
+
+/**
+ * Parses the Uid in iMIDletUid and returns ETrue if there is a native
+ * application with the same Uid installed into the device.
+ * Returns EFalse in case of any error.
+ *
+ * @param[in] aApaSession open AppArc session
+ * @return EFalse if no native application with Uid in iMIDletUid
+ */
+TBool CSilentMIDletInstall::IsNativeAppPresent(const RApaLsSession& aApaSession)
+{
+ std::wstring uidValue((wchar_t *)(iMIDletUid->Ptr()), iMIDletUid->Length());
+ TUid appUid;
+ Uid javaUid(uidValue);
+ TInt err = uidToTUid(javaUid, appUid);
+
+ if (KErrNone != err)
+ {
+ WLOG1(EJavaPreinstaller,
+ "CSilentMIDletInstall::IsNativeAppPresent: Cannot convert %S to TUid",
+ uidValue.c_str());
+ return EFalse;
+ }
+
+ TUid appTypeUid;
+ err = aApaSession.GetAppType(appTypeUid, appUid);
+ if (KErrNone != err)
+ {
+ if (KErrNotFound == err)
+ {
+ // No such application in device
+ return EFalse;
+ }
+
+ // Cannot check presence from AppArc
+ ELOG1(EJavaPreinstaller,
+ "CSilentMIDletInstall::IsNativeAppPresent: RApaLsSession GetAppType error %d", err);
+ return EFalse;
+ }
+
+ if (appTypeUid.iUid != KMidletApplicationTypeUid)
+ {
+ // The application is present and it is not a MIDlet
+ return ETrue;
+ }
+
+ return EFalse;
+} // IsNativeAppPresent
+
--- a/javamanager/preinstaller/src.s60/silentmidletinstall.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/preinstaller/src.s60/silentmidletinstall.h Thu Aug 19 09:48:13 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description: OMJ S60 preinstaller process
+* Description: OMJ Symbian preinstaller process
*
*/
@@ -19,6 +19,7 @@
#ifndef SILENTMIDLETINSTALL_H
#define SILENTMIDLETINSTALL_H
+#include <apgcli.h> // for RApaLsSession
#include <f32file.h>
#include <e32base.h>
#include <javasymbianoslayer.h>
@@ -101,6 +102,9 @@
// Parses the application version string given in aAppVersionString
// and returns the corresponding Symbian TAppVersion.
TAppVersion DesToAppVersion(const HBufC *aAppVersionString);
+ // Parses the Uid in iMIDletUid and returns ETrue if there is a native
+ // application with the same Uid installed into the device
+ TBool IsNativeAppPresent(const RApaLsSession& aApaSession);
private:
@@ -123,6 +127,8 @@
HBufC* iMIDletVendor;
// Variable used for parsing midlet version from jad file
TAppVersion iMIDletVersion;
+ // Buffer used for parsing Uid of the first midlet from jad file
+ HBufC* iMIDletUid;
// Drive status info for each non-remote, non-substed drive on device
TUint iDriveStatuses[KMaxDrives];
--- a/javamanager/subsystem.mk Thu Jul 15 18:31:06 2010 +0300
+++ b/javamanager/subsystem.mk Thu Aug 19 09:48:13 2010 +0300
@@ -21,28 +21,42 @@
javainstaller \
javaregistry \
javabackup \
- javasettings
+ javasettings
COMPONENTS = \
preinstaller/build \
debugapi/build \
- javalauncher/build
-
+ javalauncher/build \
+ javaupgradeapp/build
+
NONQTSUBSYSTEMS = \
- javasidchecker/build \
- javarecognizer/build \
- javaappschemeplugin/build
+ javarecognizer/build
SYMBIAN_ONLY = \
javaregistry \
javalauncher/build \
+ javaupgradeapp/build \
javabackup \
- javasidchecker/build \
javarecognizer/build \
preinstaller/build \
- debugapi/build \
- javaappschemeplugin/build
+ debugapi/build
+ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
+NONQTSUBSYSTEMS += javasidchecker/build javaappschemeplugin/build
+SYMBIAN_ONLY += javasidchecker/build javaappschemeplugin/build
javasidchecker/build : javaregistry
+else
+COMPONENTS += javaappscheme/build javaqtrequest/build
+SYMBIAN_ONLY += javaappscheme/build javaqtrequest/build
+endif
+
+ifdef RD_JAVA_APPLICATION_SETTINGS_QT
+COMPONENTS += javasettings_qt/build
+SYMBIAN_ONLY += javasettings_qt/build
+endif
+
+# Declare that release preparation removes subdirectories not in build, except
+# listed special cases
+REMOVE_NOTBUILT_EXCLUDING = inc
include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- a/javaruntimes/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -23,5 +23,6 @@
#include "jvmargmodifier/default/build/bld.inf"
#include "jvmargmodifier/file/build/bld.inf"
#include "starterutils/build/bld.inf"
+#include "standalone/build/bld.inf"
#include "starter/build/bld.inf"
#include "midp/bld.inf"
--- a/javaruntimes/installer/starterdll/build/javainstallerstarter_0x2002DCB5.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/installer/starterdll/build/javainstallerstarter_0x2002DCB5.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javainstallerstarter.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../../inc
--- a/javaruntimes/installer/starterdll/src/main.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/installer/starterdll/src/main.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -149,6 +149,15 @@
return INSTALLER_ALREADY_RUNNING;
}
+ // Check whether executing this process during first boot.
+ ret = JavaCommonUtils::initIsFirstBoot();
+ if (0 != ret)
+ {
+ ELOG1(EJavaRuntime,
+ "INSTALLER main() Cannot create first_boot_done.dat flag file, errno.h err %d",
+ ret);
+ }
+
int result = -1;
try
{
@@ -212,7 +221,7 @@
#endif
// Wait 3 seconds so that Java Captain has time to start
- User::After(3000000);
+ User::After(3000000); // codescanner::userafter
}
else
{
@@ -348,6 +357,12 @@
const int oldHeapSize = 512;
jvm->overrideOldHeapSize(oldHeapSize);
+#ifdef __WINSCW__
+ // Setting smaller max heap in the emulator.
+ const int maxHeapSize = 8 * 1024; // 8 MB
+ jvm->overrideMaxHeapSize(maxHeapSize);
+#endif // __WINSCW__
+
jvm->enableThreadDumping();
jvm->setMainClass(INSTALLER_MAIN_CLASS);
@@ -369,7 +384,12 @@
jvm->appendSystemProperty(
L"-Dcom.nokia.mj.impl.rt.ui="
L"com.nokia.mj.impl.installer.ui.eswt2.InstallerRuntimeUi");
-#else
+#ifdef __SYMBIAN32__
+#ifndef __WINS__
+ //jvm->appendSystemProperty(L"-Dcom.nokia.mj.impl.installer.ui.disableui=1");
+#endif //__WINS__
+#endif // __SYMBIAN32__
+#else // RD_JAVA_S60_RELEASE_10_1_ONWARDS
jvm->appendSystemProperty(
L"-Dcom.nokia.mj.impl.installer.ui="
L"com.nokia.mj.impl.installer.ui.eswt.InstallerUiEswt");
--- a/javaruntimes/installer/starterexe/build/javainstaller_0x2001843A.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/installer/starterexe/build/javainstaller_0x2001843A.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javainstaller.mmp
@@ -54,7 +54,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../../inc
--- a/javaruntimes/javaruntimes.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/javaruntimes.pro Thu Aug 19 09:48:13 2010 +0300
@@ -19,6 +19,7 @@
SUBDIRS += installer/starterdll/build/javainstallerstarter.pro
SUBDIRS += installer/starterexe/build/javainstaller.pro
SUBDIRS += jvmargmodifier/file/build/javajvmargsmodifierfile.pro
-SUBDIRS += starter/build/java.pro
+SUBDIRS += standalone/build/javastarter.pro
+SUBDIRS += starter/build/javamidp.pro
SUBDIRS += midp
BLD_INF_RULES.prj_extensions += "prj_extensions"
--- a/javaruntimes/jvmargmodifier/default/build/javajvmargsmodifier_0x2002DCB8.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/jvmargmodifier/default/build/javajvmargsmodifier_0x2002DCB8.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javajvmargsmodifier.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile_0x2002DCB9.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/jvmargmodifier/file/build/javajvmargsmodifierfile_0x2002DCB9.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javajvmargsmodifierfile.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../../inc
--- a/javaruntimes/midp/runtime/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/midp/runtime/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -33,7 +33,6 @@
<target name="system.properties">
<properties>
- microedition.hostname=localhost
microedition.jtwi.version=1.0
microedition.msa.version=1.1-SUBSET
microedition.profiles=MIDP-2.1
--- a/javaruntimes/midp/runtime/build/javamidpruntime.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/midp/runtime/build/javamidpruntime.pro Thu Aug 19 09:48:13 2010 +0300
@@ -23,7 +23,7 @@
symbian {
- INCLUDEPATH += /epoc32/include/ecom
+ INCLUDEPATH += /epoc32/include/ecom # Due to schemehandler.inl in S60 5.0 2009w18 and SPB 10.1
LIBS += -lecom -lflogger -lDrmRightsInfo -lcaf -lDrmHelper -lapgrfx -lapparc -ljavautils
}
--- a/javaruntimes/midp/runtime/build/javamidpruntime_0x2002DCBF.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/midp/runtime/build/javamidpruntime_0x2002DCBF.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javamidpruntime.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE /epoc32/include/ecom
--- a/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/Main.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/Main.java Thu Aug 19 09:48:13 2010 +0300
@@ -38,12 +38,14 @@
{
// Do the start up trace.
StartUpTrace.doTrace("Midp runtime ready");
- if (Log.mOn) Log.logI("Starting MIDP runtime");
-
- System.out.println("java.version: " +
- System.getProperty("java.version"));
- System.out.println("java.fullversion: " +
- System.getProperty("java.fullversion"));
+ if (Log.mOn)
+ {
+ Log.logI("Starting MIDP runtime");
+ Log.logI("java.version: " +
+ System.getProperty("java.version"));
+ Log.logI("java.fullversion: " +
+ System.getProperty("java.fullversion"));
+ }
boolean ok = true;
try
--- a/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/StorageAccessor.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/midp/runtime/javasrc/com/nokia/mj/impl/rt/midp/StorageAccessor.java Thu Aug 19 09:48:13 2010 +0300
@@ -198,7 +198,6 @@
}
catch (NumberFormatException ne)
{
- Log.logW("Error in getting localized name: " + nameStr, ne);
}
}
}
--- a/javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/midp/runtime/javasrc/javax/microedition/midlet/MIDlet.java Thu Aug 19 09:48:13 2010 +0300
@@ -31,6 +31,7 @@
import com.nokia.mj.impl.security.midp.authorization.AccessControllerImpl;
import com.nokia.mj.impl.security.utils.SecurityPromptMessage;
+import com.nokia.mj.impl.utils.Id;
import com.nokia.mj.impl.utils.Logger;
/**
@@ -282,7 +283,7 @@
}
- private boolean showNote(String aAppName,String aConfirmationQueryId)
+ private boolean showNote(String aAppName, Id aConfirmationQueryId)
{
SecurityPromptMessage msg = SecurityPromptMessage.getInstance();
String queryTxt = msg.getText(aConfirmationQueryId,null);
@@ -322,9 +323,7 @@
mNoPromptSchemes = new Hashtable();
mNoPromptSchemes.put("cti:","");
mNoPromptSchemes.put("mailto:","");
- mNoPromptSchemes.put("mms:","");
mNoPromptSchemes.put("mmsto:","");
- mNoPromptSchemes.put("rtsp:","");
mNoPromptSchemes.put("sms:","");
mNoPromptSchemes.put("tel:","");
}
--- a/javaruntimes/midp/runtime/src.s60/platformrequesthandler.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/midp/runtime/src.s60/platformrequesthandler.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -18,9 +18,7 @@
#include <memory>
-#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
-#include <SchemeHandler.h>
-#else
+#ifndef RD_JAVA_S60_RELEASE_10_1_ONWARDS
#include <schemehandler.h>
#endif
@@ -68,7 +66,7 @@
void PlatformRequestHandler::handleUri(const std::wstring& aUri)
{
JELOG2(EJavaRuntime);
- TRAPD(err,launchAppL(aUri););
+ TRAPD(err, launchAppL(aUri));
if (err != KErrNone)
{
ELOG1(EJavaRuntime, "ERROR!!! PlatformRequestHandler::handleUri() %d",
@@ -76,8 +74,8 @@
if (KErrNotFound == err)
{
if ((aUri.find(L"localapp:jam/launch?") == 0) ||
- (aUri.find(L"localapp://jam/launch?") == 0) ||
- (aUri.find(L"javaapp:") == 0))
+ (aUri.find(L"localapp://jam/launch?") == 0) ||
+ (aUri.find(L"javaapp:") == 0))
{
// The URI is supported but the MIDlet specified by the URI
// does not exist.
@@ -112,9 +110,71 @@
}
else
{
+#ifdef RD_JAVA_S60_RELEASE_10_1_ONWARDS
+ std::wstring uri;
+ std::wstring okScheme(L"javaapp:");
+ if (aUri.find(L"localapp:jam/launch?") == 0)
+ {
+ // Remove the scheme not supported by the devices in 10.1 from the
+ // beginning, replace it with okScheme that is supported
+ uri = okScheme;
+ uri += aUri.substr(20); // 20 == wstrlen(L"localapp:jam/launch?")
+ }
+ else if (aUri.find(L"localapp://jam/launch?") == 0)
+ {
+ uri = okScheme;
+ uri += aUri.substr(22); // 22 == wstrlen(L"localapp://jam/launch?")
+ }
+ else if (aUri.find(L"javaapp://") == 0)
+ {
+ // TODO: after QtHighway has been fixed to that
+ // it can recognize "javaapp://" scheme, remove this.
+ // At 2010wk26 it recognizes only "javaapp:"
+ uri = okScheme;
+ uri += aUri.substr(10); // 10 == wstrlen(L"javaapp://")
+ }
+ else
+ {
+ uri = aUri;
+ }
+ LOG1(EJavaRuntime, EInfo, "Platform request. Converted uri: %S", uri.c_str());
+
+ TPtrC ptr((const TUint16 *)uri.c_str(), uri.length());
+ // Start javaqtrequest.exe so that url is command line argument.
+ // javaqtrequest is a Qt application that will use Qt Highway API
+ // to send the url request to correct XQServiceProvider
+ _LIT(KJavaQtRequestExe, "javaqtrequest.exe");
+ RProcess rProcess;
+ TInt err = rProcess.Create(KJavaQtRequestExe, ptr);
+ if (KErrNone != err)
+ {
+ ELOG1(EJavaRuntime,
+ "PlatformRequestHandler: launchAppL: Starting javaqtrequest.exe failed, err %d",
+ err);
+ User::Leave(err);
+ }
+
+ // Wait until javaqtrequest exits
+ TRequestStatus status;
+ rProcess.Logon(status);
+ rProcess.Resume();
+ User::WaitForRequest(status);
+
+ // Check the exit code of javaqtrequest
+ err = status.Int();
+ rProcess.Close();
+ if (err != KErrNone)
+ {
+ ELOG1(EJavaRuntime,
+ "PlatformRequestHandler: launchAppL: javaqtrequest.exe exited with err %d",
+ err);
+ User::Leave(err);
+ }
+#else
TPtrC ptr((const TUint16 *)aUri.c_str(), aUri.length());
std::auto_ptr<CSchemeHandler> schemeHandler(CSchemeHandler::NewL(ptr));
schemeHandler->HandleUrlStandaloneL(); // Process Uri in standalone mode.
+#endif
}
}
--- a/javaruntimes/midp/runtimestarter/build/javamidpstarter_0x2002DCC0.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/midp/runtimestarter/build/javamidpstarter_0x2002DCC0.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javamidpstarter.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javaruntimes/midp/runtimestarter/src/midpruntimestarter.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/midp/runtimestarter/src/midpruntimestarter.cpp Thu Aug 19 09:48:13 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"
@@ -397,36 +397,36 @@
LOG(EJavaRuntime, EInfo, "Nokia-MIDlet-App-Orientation not defined");
}
- // Check if the MIDlet has defined the MIDlet-Splash-Screen-Image
+ // Check if the MIDlet has defined the Nokia-MIDlet-Splash-Screen-Image
// JAD attribute.
std::auto_ptr<std::wstring> splashScreen
(getMidletAttributeFromStorage(*javaStorage.get(),
- L"MIDlet-Splash-Screen-Image"));
+ L"Nokia-MIDlet-Splash-Screen-Image"));
if (splashScreen.get() != 0)
{
std::transform(splashScreen->begin(), splashScreen->end(),
splashScreen->begin(), tolower);
if (*splashScreen == L"suppress")
{
- // If MIDlet-Splash-Screen-Image JAD attribute is suppress then
+ // If Nokia-MIDlet-Splash-Screen-Image JAD attribute is suppress then
// we start the UI into background.
- LOG(EJavaRuntime, EInfo, "MIDlet-Splash-Screen-Image is suppress");
+ LOG(EJavaRuntime, EInfo, "Nokia-MIDlet-Splash-Screen-Image is suppress");
uiParams.setScreenMode(NO_START_SCREEN);
uiParams.setBackgroundStart(true);
}
else
{
- // If MIDlet-Splash-Screen-Image JAD attribute is not suppress then
+ // If Nokia-MIDlet-Splash-Screen-Image JAD attribute is not suppress then
// we need to solve the root path of the MIDlet and provide that
// to the coreUI.
uiParams.setScreenMode(MIDLET_DEFINED_SCREEN);
- LOG1(EJavaRuntime, EInfo, "MIDlet-Splash-Screen-Image, setPath to %S",
+ LOG1(EJavaRuntime, EInfo, "Nokia-MIDlet-Splash-Screen-Image, setPath to %S",
mMidletInfo->mMIDletRootPath.c_str());
}
}
else
{
- LOG(EJavaRuntime, EInfo, "MIDlet-Splash-Screen-Image not defined");
+ LOG(EJavaRuntime, EInfo, "Nokia-MIDlet-Splash-Screen-Image not defined");
uiParams.setScreenMode(DEFAULT_START_SCREEN);
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javaruntimes/standalone/build/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,23 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated bld.inf -file
+*
+*/
+
+PRJ_PLATFORMS
+default
+
+PRJ_MMPFILES
+javastarter_0x2002E6A7.mmp
+#include "exports.inf"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javaruntimes/standalone/build/javastarter_0x2002E6A7.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated file - do not edit manually
+*
+*/
+
+// ==============================================================================
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
+// This file is generated by qmake and should not be modified by the
+// user.
+// Name : javastarter.mmp
+// ==============================================================================
+
+TARGET javastarter.dll
+TARGETTYPE DLL
+
+UID 0x1000008d 0x2002E6A7
+SECUREID 0x2002E6A7
+
+EPOCALLOWDLLDATA
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO RD_JAVA_SYMBIAN_TARGET
+MACRO RD_JAVA_S60_RELEASE_9_2
+MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
+MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
+MACRO RD_JAVA_STDCPPV5
+MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
+MACRO RD_JAVA_HTTP_EMC_ENABLED
+MACRO RD_JAVA_NGA_ENABLED
+MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
+MACRO RD_JAVA_OPENC_BETA_PATCH
+MACRO RD_JAVA_INSTALLERUI_ENABLED
+MACRO RD_JAVA_PREWARM
+MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+MACRO RD_JAVA_MIDPRMS_DB
+MACRO __SYMBIAN32__
+MACRO J9EPOC32
+
+SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../inc
+SYSTEMINCLUDE ../../inc
+SYSTEMINCLUDE ../../../inc
+SYSTEMINCLUDE ../src
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE .
+
+SOURCEPATH ../src
+SOURCE javastarterimpl.cpp
+
+
+LIBRARY javaruntimestarterutils.lib
+LIBRARY javautils.lib
+LIBRARY libpthread.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY euser.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY apparc.lib
+LIBRARY avkon.lib
+LIBRARY efsrv.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+LIBRARY apgrfx.lib
+
+CAPABILITY all -tcb
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+#if defined(ARMCC_4_0)
+OPTION ARMCC --import_all_vtbl
+#endif
+OPTION GCCE -fvisibility-inlines-hidden
+
+VERSION 10.0
+
+ARMFPU softvfp
+
+PAGED
+
+BYTEPAIRCOMPRESSTARGET
+
+USERINCLUDE .
+
+#include <platform_paths.hrh>
+
+ APP_LAYER_SYSTEMINCLUDE
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE
+
+ OS_LAYER_SSL_SYSTEMINCLUDE
+
+deffile ./~/javastarter.def
+
+ SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
+
+SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
+
+#ifdef WINSCW
+
+LIBRARY ewsd.lib
+
+#endif
+
+STDCPP
+
+#ifdef WINSCW
+DEFFILE ./bwins/javastarter.def
+#elif defined EABI
+DEFFILE ./eabi/javastarter.def
+#endif
--- a/javaruntimes/starter/build/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/starter/build/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -19,5 +19,5 @@
default
PRJ_MMPFILES
-java_0x102033E6.mmp
+javamidp_0x102033E6.mmp
#include "exports.inf"
--- a/javaruntimes/starter/build/java.pro Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-TEMPLATE=app
-TARGET=javamidp
-CONFIG += omj no_icon stl
-CONFIG -= qt
-
-include(../../../inc/build_defines.pri)
-
-symbian {
-
-contains(PROJECT_DEFINES,RD_JAVA_UI_QT) {
- TARGET.EPOCSTACKSIZE = 81920
-}
-
-!contains(PROJECT_DEFINES,RD_JAVA_UI_QT) {
- TARGET.EPOCSTACKSIZE = 16384
-}
-
- TARGET.EPOCHEAPSIZE = 0x00001000 0x02000000
-
- TARGET.UID2 = 0x102033E6
- TARGET.UID3 = 0x102033E6
-
- TARGET.SID = 0x102033E6
- TARGET.VID = 0x101FB657
-
- TARGET.CAPABILITY = \
- LocalServices NetworkServices ProtServ WriteDeviceData \
- ReadDeviceData ReadUserData WriteUserData UserEnvironment \
- SwEvent Location MultiMediaDD NetworkControl TrustedUI
-}
-
-include(../../../build/omj.pri)
--- a/javaruntimes/starter/build/java_0x102033E6.mmp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Generated file - do not edit manually
-*
-*/
-
-// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
-// This file is generated by qmake and should not be modified by the
-// user.
-// Name : java.mmp
-// ==============================================================================
-
-TARGET javamidp.exe
-TARGETTYPE EXE
-
-UID 0x102033E6 0x102033E6
-SECUREID 0x102033E6
-VENDORID 0x101FB657
-
-EPOCSTACKSIZE 16384
-EPOCHEAPSIZE 0x00001000 0x02000000
-EPOCALLOWDLLDATA
-
-
-// Qt Macros
-MACRO UNICODE
-MACRO QT_KEYPAD_NAVIGATION
-MACRO QT_SOFTKEYS_ENABLED
-MACRO QT_USE_MATH_H_FLOATS
-MACRO RD_JAVA_SYMBIAN_TARGET
-MACRO RD_JAVA_S60_RELEASE_9_2
-MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
-MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
-MACRO RD_JAVA_STDCPPV5
-MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
-MACRO RD_JAVA_HTTP_EMC_ENABLED
-MACRO RD_JAVA_NGA_ENABLED
-MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
-MACRO RD_JAVA_OPENC_BETA_PATCH
-MACRO RD_JAVA_INSTALLERUI_ENABLED
-MACRO RD_JAVA_PREWARM
-MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
-MACRO RD_JAVA_MIDPRMS_DB
-MACRO __SYMBIAN32__
-MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
-
-SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
-SYSTEMINCLUDE ../inc
-SYSTEMINCLUDE ../../inc
-SYSTEMINCLUDE ../../../inc
-SYSTEMINCLUDE ../src
-SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
-SYSTEMINCLUDE /epoc32/include/mw
-SYSTEMINCLUDE .
-
-SOURCEPATH ../src
-SOURCE main.cpp
-
-
-LIBRARY javautils.lib
-LIBRARY libpthread.lib
-LIBRARY libstdcppv5.lib
-LIBRARY libc.lib
-LIBRARY libm.lib
-LIBRARY euser.lib
-LIBRARY libdl.lib
-LIBRARY cone.lib
-LIBRARY eikcore.lib
-LIBRARY mediaclientaudio.lib
-LIBRARY eikcoctl.lib
-LIBRARY eiksrv.lib
-LIBRARY apparc.lib
-LIBRARY avkon.lib
-LIBRARY efsrv.lib
-LIBRARY charconv.lib
-LIBRARY ws32.lib
-LIBRARY hal.lib
-LIBRARY gdi.lib
-LIBRARY apgrfx.lib
-STATICLIBRARY libcrt0.lib
-
-CAPABILITY LocalServices NetworkServices ProtServ WriteDeviceData ReadDeviceData ReadUserData WriteUserData UserEnvironment SwEvent Location MultiMediaDD NetworkControl TrustedUI
-
-OPTION CW -wchar_t on
-OPTION ARMCC --visibility_inlines_hidden
-#if defined(ARMCC_4_0)
-OPTION ARMCC --import_all_vtbl
-#endif
-OPTION GCCE -fvisibility-inlines-hidden
-
-VERSION 10.0
-
-ARMFPU softvfp
-
-PAGED
-
-BYTEPAIRCOMPRESSTARGET
-
-USERINCLUDE .
-
-#include <platform_paths.hrh>
-
- 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javaruntimes/starter/build/javamidp.pro Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,52 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE=app
+TARGET=javamidp
+CONFIG += omj no_icon stl
+CONFIG -= qt
+
+include(../../../inc/build_defines.pri)
+
+symbian {
+
+contains(PROJECT_DEFINES,RD_JAVA_UI_QT) {
+ TARGET.EPOCSTACKSIZE = 81920
+}
+
+!contains(PROJECT_DEFINES,RD_JAVA_UI_QT) {
+ TARGET.EPOCSTACKSIZE = 16384
+}
+
+ TARGET.UID2 = 0x102033E6
+ TARGET.UID3 = 0x102033E6
+
+ TARGET.SID = 0x102033E6
+ TARGET.VID = 0x101FB657
+
+ TARGET.CAPABILITY = \
+ LocalServices NetworkServices ProtServ WriteDeviceData \
+ ReadDeviceData ReadUserData WriteUserData UserEnvironment \
+ SwEvent Location MultiMediaDD NetworkControl TrustedUI
+}
+# For wins the max heap is 16 MB and for arm it is 64 MB
+MMP_RULES += "$${LITERAL_HASH}ifdef WINSCW"
+MMP_RULES += "EPOCHEAPSIZE 0x00001000 0x01000000"
+MMP_RULES += "$${LITERAL_HASH}else // WINSCW"
+MMP_RULES += "EPOCHEAPSIZE 0x00001000 0x04000000"
+MMP_RULES += "$${LITERAL_HASH}endif // WINSCW"
+
+include(../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javaruntimes/starter/build/javamidp_0x102033E6.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,140 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated file - do not edit manually
+*
+*/
+
+// ==============================================================================
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
+// This file is generated by qmake and should not be modified by the
+// user.
+// Name : javamidp.mmp
+// ==============================================================================
+
+TARGET javamidp.exe
+TARGETTYPE EXE
+
+UID 0x102033E6 0x102033E6
+SECUREID 0x102033E6
+VENDORID 0x101FB657
+
+EPOCSTACKSIZE 16384
+EPOCALLOWDLLDATA
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO RD_JAVA_SYMBIAN_TARGET
+MACRO RD_JAVA_S60_RELEASE_9_2
+MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
+MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
+MACRO RD_JAVA_STDCPPV5
+MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
+MACRO RD_JAVA_HTTP_EMC_ENABLED
+MACRO RD_JAVA_NGA_ENABLED
+MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
+MACRO RD_JAVA_OPENC_BETA_PATCH
+MACRO RD_JAVA_INSTALLERUI_ENABLED
+MACRO RD_JAVA_PREWARM
+MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+MACRO RD_JAVA_MIDPRMS_DB
+MACRO __SYMBIAN32__
+MACRO J9EPOC32
+
+SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../inc
+SYSTEMINCLUDE ../../inc
+SYSTEMINCLUDE ../../../inc
+SYSTEMINCLUDE ../src
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE .
+
+SOURCEPATH ../src
+SOURCE main.cpp
+
+
+LIBRARY javautils.lib
+LIBRARY libpthread.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY euser.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY apparc.lib
+LIBRARY avkon.lib
+LIBRARY efsrv.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+LIBRARY apgrfx.lib
+STATICLIBRARY libcrt0.lib
+
+CAPABILITY LocalServices NetworkServices ProtServ WriteDeviceData ReadDeviceData ReadUserData WriteUserData UserEnvironment SwEvent Location MultiMediaDD NetworkControl TrustedUI
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+#if defined(ARMCC_4_0)
+OPTION ARMCC --import_all_vtbl
+#endif
+OPTION GCCE -fvisibility-inlines-hidden
+
+VERSION 10.0
+
+ARMFPU softvfp
+
+PAGED
+
+BYTEPAIRCOMPRESSTARGET
+
+USERINCLUDE .
+
+#ifdef WINSCW
+
+EPOCHEAPSIZE 0x00001000 0x01000000
+
+#else // WINSCW
+
+EPOCHEAPSIZE 0x00001000 0x04000000
+
+#endif // WINSCW
+
+#include <platform_paths.hrh>
+
+ 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
--- a/javaruntimes/starter/build/javamidp_installer.pkg Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-; javamidp_installer.pkg generated by qmake at 2010-06-22T08:16:56
-; This file is generated by qmake and should not be modified by the user
-;
-
-; Language
-&EN
-
-
-; SIS header: name, uid, version
-#{"javamidp installer"},(0xA000D7CE),1,0,0
-
-; Localised Vendor name
-%{"Vendor"}
-
-; Unique Vendor name
-:"Vendor"
-
-
-; Manual PKG pre-rules from PRO files
-pkg_depends_webkit
-pkg_depends_qt
-; Default HW/platform dependencies
-[0x101F7961],0,0,0,{"S60ProductID"}
-[0x102032BE],0,0,0,{"S60ProductID"}
-[0x102752AE],0,0,0,{"S60ProductID"}
-[0x1028315F],0,0,0,{"S60ProductID"}
-
-
-
-"R:/sf/app/jrt/javaruntimes/starter/build/javamidp.sis" - "c:\adm\javamidp.sis"
-@"R:/sf/mw/qt/smartinstaller.sis",(0x2002CCCD)
--- a/javaruntimes/starter/build/javamidp_template.pkg Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-; javamidp_template.pkg generated by qmake at 2010-06-22T08:16:56
-; This file is generated by qmake and should not be modified by the user
-;
-
-; Language
-&EN
-
-
-; SIS header: name, uid, version
-#{"javamidp"},(0x102033E6),1,0,0
-
-; Localised Vendor name
-%{"Vendor"}
-
-; Unique Vendor name
-:"Vendor"
-
-
-; Manual PKG pre-rules from PRO files
-pkg_depends_webkit
-pkg_depends_qt
-; Default HW/platform dependencies
-[0x101F7961],0,0,0,{"S60ProductID"}
-[0x102032BE],0,0,0,{"S60ProductID"}
-[0x102752AE],0,0,0,{"S60ProductID"}
-[0x1028315F],0,0,0,{"S60ProductID"}
-
-
-; Executable and default resource files
-"/epoc32/release/$(PLATFORM)/$(TARGET)/javamidp.exe" - "!:\sys\bin\javamidp.exe"
-
-; Manual PKG post-rules from PRO files
--- a/javaruntimes/starterutils/build/exports.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/starterutils/build/exports.inf Thu Aug 19 09:48:13 2010 +0300
@@ -11,7 +11,7 @@
*
* Contributors:
*
-* Description:
+* Description:
*
*/
@@ -19,3 +19,7 @@
../inc/jvmstarter.h |../../../javaruntimes/inc/jvmstarter.h
../inc/runtimestarterutils.h |../../../javaruntimes/inc/runtimestarterutils.h
+
+#ifdef RD_JAVA_SYMBIAN_TARGET
+../src.s60/javaruntimeprivatecrkeys.h |../../../inc/javaruntimeprivatecrkeys.h
+#endif
\ No newline at end of file
--- a/javaruntimes/starterutils/build/javaruntimestarterutils_0x2002DCCC.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/starterutils/build/javaruntimestarterutils_0x2002DCCC.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javaruntimestarterutils.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javaruntimes/starterutils/inc/jvmstarter.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/starterutils/inc/jvmstarter.h Thu Aug 19 09:48:13 2010 +0300
@@ -258,6 +258,13 @@
virtual void overrideNewHeapSize(int heapSize) = 0;
/**
+ * Overrides the default max heap size.
+ * @param heapSize Heap size in kilo bytes.
+ * @throws std::exception on error cases
+ */
+ virtual void overrideMaxHeapSize(int heapSize) = 0;
+
+ /**
* Overrides the default stack of the native thread.
*
* @param stackSize Stack size in kilo bytes.
--- a/javaruntimes/starterutils/src.s60/j9starters60.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/starterutils/src.s60/j9starters60.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -129,8 +129,15 @@
mJvmArgs.push_back(L"-Xmine16K"); // Minimum size for heap expansion.
mJvmArgs.push_back(L"-Xmns64K"); // Initial new space size. Keep this in sync with MemoryLogger.java
mJvmArgs.push_back(L"-Xmos64K"); // Initial old space size. Keep this in sync with MemoryLogger.java
+
+#ifdef __WINSCW__
mJvmArgs.push_back(L"-Xmox16M"); // Maximum old space size.
mJvmArgs.push_back(L"-Xmx16M"); // Memory maximum.
+#else // __WINSCW__
+ mJvmArgs.push_back(L"-Xmox64M"); // Maximum old space size.
+ mJvmArgs.push_back(L"-Xmx64M"); // Memory maximum.
+#endif // __WINSCW__
+
mJvmArgs.push_back(L"-Xmco16k"); // ROM class segment increment.
mJvmArgs.push_back(L"-Xmr1k"); // Remembered set size.
@@ -165,6 +172,24 @@
mJvmArgs.push_back(oldSpace);
}
+
+void J9StarterS60::overrideMaxHeapSize(int heapSize)
+{
+ JELOG2(EJavaRuntime);
+ std::wstring heapAsString(JavaCommonUtils::intToWstring(heapSize));
+ doOverideHeap(L"-Xmox", heapAsString);
+ doOverideHeap(L"-Xmx", heapAsString);
+}
+
+void J9StarterS60::doOverideHeap(const std::wstring& arg, const std::wstring& size)
+{
+ JELOG2(EJavaRuntime);
+ std::wstring maxHeapArg(arg);
+ maxHeapArg += size;
+ maxHeapArg += L"K";
+ mJvmArgs.push_back(maxHeapArg);
+}
+
void J9StarterS60::overrideNewHeapSize(int heapSize)
{
JELOG2(EJavaRuntime);
@@ -205,6 +230,10 @@
{
pathType = BOOT_CLASSPATH_TCKRUNNER;
}
+ else if (mIdentifier == L"JavaControlPanel")
+ {
+ pathType = BOOT_CLASSPATH_JAVACONTROLPANEL;
+ }
std::list<std::wstring> odcFiles;
std::list<std::wstring> bcpEntities;
--- a/javaruntimes/starterutils/src.s60/j9starters60.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/starterutils/src.s60/j9starters60.h Thu Aug 19 09:48:13 2010 +0300
@@ -74,6 +74,11 @@
/**
* @see jvmstarter.h
*/
+ virtual void overrideMaxHeapSize(int heapSize);
+
+ /**
+ * @see jvmstarter.h
+ */
virtual void overrideNativeStackSize(int stackSize);
/**
@@ -106,6 +111,15 @@
* @param odcFile Th ODC file to be appended.
*/
void appendOdcFile(const std::wstring& odcFile);
+
+ /**
+ * Internal utility for setting max heap sizes in kB. Used to
+ * set -Xmx and -Xmox vm args.
+ * @param arg String containing either -Xmx or -Xmox (not checked).
+ * @param size Size of the heap as string in kilo bytes.
+ */
+ void doOverideHeap(const std::wstring& arg, const std::wstring& size);
+
#ifdef __WINSCW__ // codescanner::ifpreprocessor
/**
--- a/javaruntimes/subsystem.mk Thu Jul 15 18:31:06 2010 +0300
+++ b/javaruntimes/subsystem.mk Thu Aug 19 09:48:13 2010 +0300
@@ -26,7 +26,8 @@
installer/starterexe/build \
jvmargmodifier/default/build \
jvmargmodifier/file/build \
- starterutils/build
+ starterutils/build \
+ standalone/build \
ifdef RD_JAVA_S60_RELEASE_5_0_IAD
COMPONENTS += starter/build.iad
@@ -37,5 +38,6 @@
starterutils/build: jvmargmodifier/default/build
midp: starterutils/build
installer/starterdll/build: starterutils/build
+standalone/build: starterutils/build
include ${JAVA_SRC_ROOT}/build/Makefile.subsystem
--- a/javatools/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javatools/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -20,6 +20,7 @@
#include "tckrunner/starter/build/bld.inf"
#include "tckrunner/runner/build/bld.inf"
+#include "javacontrolpanel/starter/build/bld.inf"
+#include "javacontrolpanel/controlpanel/build/bld.inf"
#include "javasecuritycustomization/build/bld.inf"
-#include "javacaptain_app/build/bld.inf"
#include "testcerts/bld.inf"
--- a/javatools/javacaptain_app/build/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-PRJ_PLATFORMS
-default
-
-PRJ_MMPFILES
-javacaptainapp.mmp
\ No newline at end of file
--- a/javatools/javacaptain_app/build/javacaptainapp.mmp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <bldvariant.hrh>
-#include <data_caging_paths.hrh>
-#include <platform_paths.hrh>
-#include <../../../inc/java_stdcpp_support_for_exe.hrh>
-#include <../../../inc/project_defines.hrh>
-
-TARGET JavaCap.exe
-TARGETTYPE exe
-UID 0x100039CE 0x20022D3C
-CAPABILITY AllFiles WriteDeviceData PowerMgmt NetworkControl
-
-SOURCEPATH ../src.s60
-SOURCE javacap.cpp
-
-PAGED
-
-USERINCLUDE ../../../inc
-
-START RESOURCE javacap.rss
-HEADER
-TARGETPATH APP_RESOURCE_DIR
-LANG SC
-END // RESOURCE
-
-START RESOURCE javacap_reg.rss
-// Do not change the UID below.
-TARGETPATH /private/10003a3f/apps
-END
-
-LIBRARY apparc.lib
-LIBRARY cone.lib
-LIBRARY eikcore.lib
-LIBRARY eikcoctl.lib
-LIBRARY avkon.lib
-LIBRARY bafl.lib
-LIBRARY egul.lib
-LIBRARY ws32.lib
-LIBRARY flogger.lib
-LIBRARY efsrv.lib
-LIBRARY centralrepository.lib
-
-LIBRARY javacomms.lib
-LIBRARY javaipc.lib
-LIBRARY javastorage.lib
-LIBRARY javadebugapi.lib
-
-// End of file
--- a/javatools/javacaptain_app/src.s60/javacap.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,685 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: JavaCap
-*
-*/
-
-
-#include "comms.h"
-#include "rtcmessages.h"
-#include "coremessages.h"
-
-#include "logger.h"
-
-#include "javacap.h"
-#include "javacap.hrh"
-
-#include "javainifileutils.h"
-
-#include <centralrepository.h>
-#include <SWInstallerInternalCRKeys.h>
-
-#include "javastoragenames.h" // Storage constants.
-#include "securitystoragedatadefs.h"
-
-#include <javacap.rsg>
-
-_LIT(KJavaCapYes, "Yes");
-_LIT(KJavaCapNo, "No");
-_LIT(KUserSecurityMode, "User");
-_LIT(KNormalSecurityMode, "Default");
-_LIT(KS60SecurityPolicyName, "S60");
-_LIT(KMSASecurityPolicyName, "MSA");
-_LIT(KATTSecurityPolicyName, "AT&T");
-_LIT(KS60SecurityPolicy, "s60");
-_LIT(KMSASecurityPolicy, "msa");
-_LIT(KATTSecurityPolicy, "att");
-// Java Security Policy Central Repository UID
-static const TUid KCRUidJavaSecurity = { 0x2001B289 };
-// IDs for security folder and file keys
-static const TUint32 KPolicy = 0x03;
-static const TUint32 KSecurityWarnings = 0x04;
-const int KS60SecurityPolicyId = 1;
-const int KMSASecurityPolicyId = 2;
-const int KATTSecurityPolicyId = 3;
-
-using namespace java::storage;
-using namespace std;
-using namespace java::util;
-using namespace java::comms;
-using namespace java::captain;
-
-void CJavaCaptainContainer::ConstructL(const TRect& aRect)
-{
- JELOG2(EJavaCaptain);
- mCaptainRunning = true;
- mPrewarmEnabled = false;
-#if defined(RD_JAVA_PREWARM) && !defined (__WINS__)
- mPrewarmEnabled = true;
-#endif // RD_JAVA_PREWARM
- mPrewarmUiEnabled = false;
- mDebugEnabled = false;
- mRedirectEnabled = false;
- iStorage.reset(JavaStorage::createInstance());
- try
- {
- iStorage->open();
- }
- catch (JavaStorageException& aJse)
- {
- User::Leave(aJse.mStatus);
- }
- mUserSecurityModeEnabled = (GetSecurityWarningsMode() == SECURITY_WARNINGS_USER_DEFINED_MODE);
- mSecurityPolicyId = GetSecurityPolicy();
- mHeader = _L("Java states:");
- updateStates();
- CreateWindowL();
- SetRect(aRect);
- ActivateL();
- mRedirector.reset(new LogRedirector());
-}
-
-CJavaCaptainContainer::~CJavaCaptainContainer()
-{
- JELOG2(EJavaCaptain);
-}
-
-void CJavaCaptainContainer::Draw(const TRect& /*aRect*/) const
-{
- JELOG2(EJavaCaptain);
- CWindowGc& gc = SystemGc();
- gc.Clear();
-
- const CFont* usedFont = CEikonEnv::Static()->NormalFont();
- gc.UseFont(usedFont);
-
- gc.DrawText(mHeader,TPoint(10,20));
- int pos = 50;
- gc.DrawText(mCaptainState,TPoint(20,pos));
- int gap = 25;
- pos += gap;
- gc.DrawText(mPrewarmState,TPoint(20,pos));
- pos += gap;
- gc.DrawText(mPrewarmUiState,TPoint(20,pos));
- pos += gap;
- gc.DrawText(mDebugState,TPoint(20,pos));
- pos += gap;
- gc.DrawText(mSecurityMode,TPoint(20,pos));
- pos += gap;
- gc.DrawText(mSecurityPolicy,TPoint(20,pos));
- pos += gap;
- gc.DrawText(mRedirectState,TPoint(20,pos));
-
- gc.DiscardFont();
-}
-
-void CJavaCaptainContainer::updateStates()
-{
-
- int propertyVal = java::util::JavaIniFileUtils::getProperty(java::util::UI_PREWARM);
- if (propertyVal != -1)
- {
- mPrewarmUiEnabled = propertyVal;
- }
-
- mCaptainState = _L("Captain running: ");
- if (mCaptainRunning)
- {
- mCaptainState.Append(KJavaCapYes);
- }
- else
- {
- mCaptainState.Append(KJavaCapNo);
- }
-
- mPrewarmState = _L("Prewarm enabled: ");
- if (mPrewarmEnabled)
- {
- mPrewarmState.Append(KJavaCapYes);
- }
- else
- {
- mPrewarmState.Append(KJavaCapNo);
- }
-
- mPrewarmUiState = _L("Prewarm UI enabled: ");
- if (mPrewarmUiEnabled)
- {
- mPrewarmUiState.Append(KJavaCapYes);
- }
- else
- {
- mPrewarmUiState.Append(KJavaCapNo);
- }
-
- mDebugState = _L("Java Debug enabled: ");
- if (mDebugEnabled)
- {
- mDebugState.Append(KJavaCapYes);
- }
- else
- {
- mDebugState.Append(KJavaCapNo);
- }
-
- mSecurityMode = _L("Security warnings: ");
- if (mUserSecurityModeEnabled)
- {
- mSecurityMode.Append(KUserSecurityMode);
- }
- else
- {
- mSecurityMode.Append(KNormalSecurityMode);
- }
-
- mSecurityPolicy = _L("Security policy: ");
- switch (mSecurityPolicyId)
- {
- case KS60SecurityPolicyId:
- mSecurityPolicy.Append(KS60SecurityPolicyName);
- break;
- case KMSASecurityPolicyId:
- mSecurityPolicy.Append(KMSASecurityPolicyName);
- break;
- case KATTSecurityPolicyId:
- mSecurityPolicy.Append(KATTSecurityPolicyName);
- break;
- default:
- mSecurityPolicy.Append(KS60SecurityPolicyName);
- }
-
- mRedirectState = _L("Redirect logs: ");
- if (mRedirectEnabled)
- {
- mRedirectState.Append(KJavaCapYes);
- }
- else
- {
- mRedirectState.Append(KJavaCapNo);
- }
-
- DrawDeferred();
-}
-
-void CJavaCaptainContainer::setCaptainState(bool running)
-{
- mCaptainRunning = running;
- updateStates();
-}
-
-
-
-#include "commsmessage.h"
-#include "commsclientendpoint.h"
-
-void CJavaCaptainContainer::handleStateChangeCmd(int cmd)
-{
- switch (cmd)
- {
-
- case ETogglePrewarmEnable:
- {
- mPrewarmEnabled = !mPrewarmEnabled;
- CommsMessage message;
- message.setModuleId(PLUGIN_ID_JAVACAPTAIN_CORE_C);
- if (mPrewarmEnabled)
- {
- message.setMessageId(CORE_MSG_ID_START_PREWARM);
- }
- else
- {
- message.setMessageId(CORE_MSG_ID_STOP_PREWARM);
- }
- CommsClientEndpoint comms;
- comms.connect(IPC_ADDRESS_JAVA_CAPTAIN_C);
- comms.send(message);
- comms.disconnect();
- break;
- }
- case ETogglePrewarmUiEnable:
- mPrewarmUiEnabled = !mPrewarmUiEnabled;
- java::util::JavaIniFileUtils::setProperty(java::util::UI_PREWARM, mPrewarmUiEnabled);
- break;
-
- case EDebugMode:
- {
- mDebugEnabled = !mDebugEnabled;
-
- CommsMessage message;
- std::wstring vmArgs = L"";
- if (mDebugEnabled)
- {
- vmArgs = L"-Xrunjdwp:server=y,address=localhost:8000";
- }
- setSetExtraArguments(message, vmArgs, L"");
-
- CommsClientEndpoint comms;
- comms.connect(IPC_ADDRESS_JAVA_CAPTAIN_C);
- comms.send(message);
- comms.disconnect();
- }
- break;
-
- case ESecurityMode:
- {
- mUserSecurityModeEnabled = !mUserSecurityModeEnabled;
-
- if (mUserSecurityModeEnabled)
- {
- SetSecurityWarningsMode(SECURITY_WARNINGS_USER_DEFINED_MODE);
- }
- else
- {
- SetSecurityWarningsMode(SECURITY_WARNINGS_DEFAULT_MODE);
- }
- }
- break;
- case ES60SecurityPolicy:
- mSecurityPolicyId = KS60SecurityPolicyId;
- SetSecurityPolicy(mSecurityPolicyId);
- break;
- case EMSASecurityPolicy:
- mSecurityPolicyId = KMSASecurityPolicyId;
- SetSecurityPolicy(mSecurityPolicyId);
- break;
- case EATTSecurityPolicy:
- mSecurityPolicyId = KATTSecurityPolicyId;
- SetSecurityPolicy(mSecurityPolicyId);
- break;
-
- case ERedirectMode:
- mRedirectEnabled = !mRedirectEnabled;
- if (mRedirectEnabled)
- {
- mRedirector->start();
- }
- else
- {
- mRedirector->stop();
- }
- break;
-
- default:
- break;
- }
- updateStates();
-}
-
-std::wstring CJavaCaptainContainer::GetSecurityWarningsMode()
-{
- try
- {
- JavaStorageApplicationEntry_t query;
- JavaStorageApplicationList_t queryResult;
- JavaStorageEntry attr;
- attr.setEntry(ID, L"");
- query.insert(attr);
- attr.setEntry(SECURITY_WARNINGS, L"");
- query.insert(attr);
- iStorage->search(MIDP_PACKAGE_TABLE, query, queryResult);
- JavaStorageApplicationList_t::const_iterator iterator;
- JavaStorageApplicationList_t domainQueryResult;
- for (iterator = queryResult.begin(); iterator != queryResult.end(); iterator++)
- {
- std::wstring securityWarnings = L"";
- JavaStorageApplicationEntry_t entry = (*iterator);
- findColumn(entry, SECURITY_WARNINGS, securityWarnings);
- if (securityWarnings == SECURITY_WARNINGS_USER_DEFINED_MODE)
- {
- // make them all USER
- SetSecurityWarningsMode(SECURITY_WARNINGS_USER_DEFINED_MODE);
- return SECURITY_WARNINGS_USER_DEFINED_MODE;
- }
- }
- }
- catch (JavaStorageException& aJse)
- {
- }
- // one mroe check: central repository
- std::wstring securityWarningsMode = SECURITY_WARNINGS_DEFAULT_MODE;
- TRAP_IGNORE(
- CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity);
- TInt warningsMode;
- User::LeaveIfError(repository->Get(KSecurityWarnings, warningsMode));
- switch (warningsMode)
-{
-case 1:
- securityWarningsMode = SECURITY_WARNINGS_USER_DEFINED_MODE;
- break;
-case 2:
- securityWarningsMode = SECURITY_WARNINGS_DEFAULT_MODE;
- break;
-}
-CleanupStack::PopAndDestroy(repository););
- return securityWarningsMode;
-}
-
-void CJavaCaptainContainer::SetSecurityWarningsMode(const std::wstring& aSecurityWarningsMode)
-{
- try
- {
- JavaStorageApplicationEntry_t query;
- JavaStorageApplicationList_t queryResult;
- JavaStorageEntry attr;
- attr.setEntry(ID, L"");
- query.insert(attr);
- iStorage->search(MIDP_PACKAGE_TABLE, query, queryResult);
- JavaStorageApplicationList_t::const_iterator iterator;
- JavaStorageApplicationList_t domainQueryResult;
- for (iterator = queryResult.begin(); iterator != queryResult.end(); iterator++)
- {
- std::wstring uid = L"";
- JavaStorageApplicationEntry_t entry = (*iterator);
- findColumn(entry, ID, uid);
- JavaStorageApplicationEntry_t oldEntry;
- JavaStorageEntry oldAttr;
- oldAttr.setEntry(ID, uid);
- oldEntry.insert(oldAttr);
- attr.setEntry(SECURITY_WARNINGS, aSecurityWarningsMode);
- entry.clear();
- entry.insert(attr);
- iStorage->update(MIDP_PACKAGE_TABLE, entry, oldEntry);
- }
- }
- catch (JavaStorageException& aJse)
- {
- }
- // set the cenRep key as well
- TRAP_IGNORE(
- CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity);
- if (aSecurityWarningsMode == SECURITY_WARNINGS_USER_DEFINED_MODE)
-{
- repository->Set(KSecurityWarnings, 1);
- }
- else
- {
- repository->Set(KSecurityWarnings, 2);
- }
- CleanupStack::PopAndDestroy(repository);
- );
-}
-
-void CJavaCaptainContainer::findColumn(const JavaStorageApplicationEntry_t& aEntry,
- const wstring& aColName, wstring& aColValue)
-{
- JavaStorageEntry findPattern;
- findPattern.setEntry(aColName, L"");
- JavaStorageApplicationEntry_t::const_iterator findIterator =
- aEntry.find(findPattern);
- if (findIterator != aEntry.end())
- {
- aColValue = findIterator->entryValue();
- }
-}
-
-
-int CJavaCaptainContainer::GetSecurityPolicy()
-{
- int securityPolicyId =KS60SecurityPolicyId;
- TRAP_IGNORE(
- CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity);
- HBufC* buf = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength);
- TPtr policy(buf->Des());
- User::LeaveIfError(repository->Get(KPolicy, policy));
- if (policy.Compare(KS60SecurityPolicy) == 0)
-{
- securityPolicyId = KS60SecurityPolicyId;
-}
-else if (policy.Compare(KMSASecurityPolicy) == 0)
-{
- securityPolicyId = KMSASecurityPolicyId;
-}
-else if (policy.Compare(KATTSecurityPolicy) == 0)
-{
- securityPolicyId = KATTSecurityPolicyId;
-}
-CleanupStack::PopAndDestroy(buf);
-CleanupStack::PopAndDestroy(repository););
- return securityPolicyId;
-}
-
-void CJavaCaptainContainer::SetSecurityPolicy(int aSecurityPolicyId)
-{
- TRAP_IGNORE(
- CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity);
- switch (aSecurityPolicyId)
-{
-case KS60SecurityPolicyId:
- User::LeaveIfError(repository->Set(KPolicy, KS60SecurityPolicy));
- break;
- case KMSASecurityPolicyId:
- User::LeaveIfError(repository->Set(KPolicy, KMSASecurityPolicy));
- break;
- case KATTSecurityPolicyId:
- User::LeaveIfError(repository->Set(KPolicy, KATTSecurityPolicy));
- break;
- }
- CleanupStack::PopAndDestroy(repository););
-}
-
-//
-// CJavaCaptainAppUi
-//
-CJavaCaptainAppUi::~CJavaCaptainAppUi()
-{
- JELOG2(EJavaCaptain);
- RemoveFromStack(iAppView);
- delete iAppView;
- delete mPeriodic;
-}
-
-void CJavaCaptainAppUi::ConstructL()
-{
- JELOG2(EJavaCaptain);
- BaseConstructL();
- iAppView=new(ELeave) CJavaCaptainContainer;
- iAppView->SetMopParent(this);
- iAppView->ConstructL(ClientRect());
-
- iCoeEnv->RootWin().EnableFocusChangeEvents();
- mPeriodic=CPeriodic::NewL(CActive::EPriorityStandard);
-
- AddToStackL(iAppView);
-
-}
-
-_LIT(KExecutableName, "javacaptain.exe");
-
-void senMsgToSplash(int id)
-{
- CommsMessage message;
- message.setModuleId(1);
- message.setMessageId(id);
- CommsClientEndpoint comms;
- comms.connect(10900);
- comms.send(message);
- comms.disconnect();
-}
-
-TInt CJavaCaptainAppUi::tick(TAny* appUi)
-{
- CJavaCaptainAppUi* app = static_cast<CJavaCaptainAppUi*>(appUi);
-// ELOG1(EJavaCaptain,"mActive: %d", app->mActive);
- if (app->mActive)
- {
- senMsgToSplash(1);
- }
- else
- {
- senMsgToSplash(2);
- }
- app->mActive = !app->mActive;
- return 0;
-}
-
-void CJavaCaptainAppUi::HandleCommandL(TInt aCommand)
-{
- JELOG2(EJavaCaptain);
-
- switch (aCommand)
- {
- case EAknSoftkeyExit:
- case EEikCmdExit:
- Exit();
- break;
- case ECaptainStart:
- {
- RProcess proc;
- int st = proc.Create(KExecutableName, KExecutableName);
- if (st == KErrNone)
- {
- proc.Resume();
- iAppView->setCaptainState(true);
- }
- proc.Close();
- }
- break;
-
- case ECaptainStop:
- {
- CommsMessage message;
- message.setModuleId(PLUGIN_ID_JAVACAPTAIN_CORE_C);
- message.setMessageId(CORE_MSG_ID_STOP_JAVACAPTAIN);
- CommsClientEndpoint comms;
- comms.connect(IPC_ADDRESS_JAVA_CAPTAIN_C);
- comms.send(message);
- comms.disconnect();
- iAppView->setCaptainState(false);
- }
- break;
-
- case EThreadDump:
- {
- CommsMessage message;
- message.setModuleId(PLUGIN_ID_JAVACAPTAIN_CORE_C);
- message.setMessageId(CORE_MSG_ID_DO_THREAD_DUMP);
- CommsClientEndpoint comms;
- comms.connect(IPC_ADDRESS_JAVA_CAPTAIN_C);
- comms.send(message);
- comms.disconnect();
- }
- break;
-
- case ETogglePrewarmEnable:
- case ETogglePrewarmUiEnable:
- case EDebugMode:
- case ESecurityMode:
- case ES60SecurityPolicy:
- case EMSASecurityPolicy:
- case EATTSecurityPolicy:
- case ERedirectMode:
- iAppView->handleStateChangeCmd(aCommand);
- break;
-
- default:
- Exit();
- break;
- }
-}
-
-CEikAppUi* CJavaCaptainEikDocument::CreateAppUiL()
-{
- JELOG2(EJavaCaptain);
- return(new(ELeave) CJavaCaptainAppUi);
-}
-
-void CJavaCaptainEikDocument::ConstructL()
-{
- JELOG2(EJavaCaptain);
-}
-
-TUid CJavaCaptainApplication::AppDllUid() const
-{
- JELOG2(EJavaCaptain);
- return KUidJavaCaptain;
-}
-
-CApaDocument* CJavaCaptainApplication::CreateDocumentL()
-{
- JELOG2(EJavaCaptain);
- CJavaCaptainEikDocument* document=new(ELeave) CJavaCaptainEikDocument(*this);
- CleanupStack::PushL(document);
- document->ConstructL();
- CleanupStack::Pop();
- return(document);
-}
-
-#include <eikstart.h>
-
-LOCAL_C CApaApplication* NewApplication()
-{
- JELOG2(EJavaCaptain);
- return new CJavaCaptainApplication;
-}
-
-
-GLDEF_C TInt E32Main()
-{
- JELOG2(EJavaCaptain);
- return EikStart::RunApplication(NewApplication);
-}
-
-
-#include <fcntl.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-LogRedirector::LogRedirector() : mFd(-1)
-{
- iJavaDiagnostic.reset(JavaDiagnostic::createInstance());
-}
-
-LogRedirector::~LogRedirector()
-{
-}
-
-void LogRedirector::start()
-{
- iJavaDiagnostic->setDiagnosticListener(*this);
- mFd = open("c:\\data\\javaredirect.log", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
-}
-
-void LogRedirector::stop()
-{
- iJavaDiagnostic->removeDiagnosticListener();
- close(mFd);
- mFd = -1;
-}
-
-void LogRedirector::systemOut(const TDesC8& aData)
-{
- write(aData);
-}
-
-void LogRedirector::systemErr(const TDesC8& aData)
-{
- write(aData);
-}
-
-void LogRedirector::log(const TDesC8& aData)
-{
- write(aData);
-}
-
-void LogRedirector::write(const TDesC8& aData)
-{
- if (mFd > 0)
- {
- ::write(mFd, (const char*)aData.Ptr(), aData.Size());
- }
-};
-
-
-
-// End of File
--- a/javatools/javacaptain_app/src.s60/javacap.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: JavaCap
-*
-*/
-
-#ifndef JAVACAP_H
-#define JAVACAP_H
-
-#include <aknapp.h>
-#include <aknappui.h>
-#include <AknDoc.h>
-#include <memory>
-#include <f32file.h>
-#include "javastorage.h"
-#include "javadiagnostic.h"
-using namespace java::debug;
-
-const TUid KUidJavaCaptain={ 0x20022D3C };
-class LogRedirector;
-
-class CJavaCaptainContainer : public CCoeControl
-{
-public:
- void ConstructL(const TRect& aRect);
- ~CJavaCaptainContainer();
- static void ThreadMain(CJavaCaptainContainer*);
- void updateStates();
- void setCaptainState(bool running);
- void handleStateChangeCmd(int cmd);
-
-private:
- void StartCaptain();
- void Draw(const TRect& aRect) const;
- std::wstring GetSecurityWarningsMode();
- void SetSecurityWarningsMode(const std::wstring& aSecurityWarningsMode);
- int GetSecurityPolicy();
- void SetSecurityPolicy(int);
- void findColumn(const java::storage::JavaStorageApplicationEntry_t& aEntry, const std::wstring& aColName, std::wstring& aColValue);
-
-
-private:
- TBuf<20> mHeader;
- TBuf<40> mCaptainState;
- TBuf<40> mPrewarmState;
- TBuf<40> mPrewarmUiState;
- TBuf<40> mDebugState;
- TBuf<40> mSecurityMode;
- TBuf<40> mSecurityPolicy;
- TBuf<40> mRedirectState;
-
- bool mCaptainRunning;
- bool mPrewarmEnabled;
- bool mPrewarmUiEnabled;
- bool mDebugEnabled;
- bool mUserSecurityModeEnabled;
- int mSecurityPolicyId;
- bool mRedirectEnabled;
-
- std::auto_ptr<java::storage::JavaStorage> iStorage;
- std::auto_ptr<LogRedirector> mRedirector;
-};
-
-class CJavaCaptainEikDocument : public CAknDocument
-{
-public:
- void ConstructL();
- CJavaCaptainEikDocument(CEikApplication& aApp): CAknDocument(aApp) { }
- ~CJavaCaptainEikDocument() {}
-private:
- // from CAknDocument
- CEikAppUi* CreateAppUiL();
-};
-
-class CJavaCaptainAppUi : public CAknAppUi
-{
-public:
- void ConstructL();
- ~CJavaCaptainAppUi();
-
-public:
- static TInt tick(TAny* splash);
-
-private:
- void HandleCommandL(TInt aCommand);
- CJavaCaptainContainer* iAppView;
- bool mActive;
- CPeriodic* mPeriodic;
-};
-
-class CJavaCaptainApplication : public CAknApplication
-{
-private:
- // from CApaApplication
- CApaDocument* CreateDocumentL();
- TUid AppDllUid() const;
-};
-
-class LogRedirector : public DiagnosticListener
-{
-public:
- LogRedirector();
- ~LogRedirector();
-
- void start();
- void stop();
-
- // DiagnosticListener methods
- virtual void systemOut(const TDesC8& aData);
- virtual void systemErr(const TDesC8& aData);
- virtual void log(const TDesC8& aData);
-
-private:
- void write(const TDesC8& aData);
- std::auto_ptr<java::debug::JavaDiagnostic> iJavaDiagnostic;
-
- int mFd;
-};
-
-#endif // JAVACAP_H
-
--- a/javatools/javacaptain_app/src.s60/javacap.hrh Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef _JAVACAP_HRH
-#define _JAVACAP_HRH
-
-enum JavaCapCommandIds
-{
- ECaptainCtl = 1,
- EPrewarmCtl,
- ECaptainStart,
- ECaptainStop,
- ETogglePrewarmEnable,
- ETogglePrewarmUiEnable,
- EThreadDump,
- EDebugMode,
- ESecurityMode,
- ESecurityPolicy,
- ES60SecurityPolicy,
- EMSASecurityPolicy,
- EATTSecurityPolicy,
- ERedirectMode
-};
-#endif
--- a/javatools/javacaptain_app/src.s60/javacap.rss Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-NAME JACA
-
-#include <eikon.rh>
-#include <avkon.rh>
-#include <avkon.rsg>
-#include <avkon.hrh>
-
-#ifdef RD_SCALABLE_UI
-#include <appinfo.rh>
-#endif
-
-#include "javacap.hrh"
-
-#include <data_caging_paths_strings.hrh>
-
-RESOURCE RSS_SIGNATURE { }
-
-RESOURCE TBUF { buf="javacap"; }
-
-RESOURCE EIK_APP_INFO
- {
- menubar = r_javacap_menubar;
- cba=R_AVKON_SOFTKEYS_OPTIONS_EXIT;
- }
-
-#ifdef RD_SCALABLE_UI
-RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info
-{
- short_caption = "JavaCap";
- caption_and_icon = CAPTION_AND_ICON_INFO
- {
- caption = "JavaCap";
- };
-}
-#endif
-
-//----------------------------------------------------
-//
-// r_javacap_menubar
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_BAR r_javacap_menubar
- {
- titles =
- {
- MENU_TITLE { menu_pane = r_javacap_menu; txt = "Menu"; }
- };
- }
-
-//----------------------------------------------------
-//
-// r_askello_menu
-//
-//----------------------------------------------------
-//
-RESOURCE MENU_PANE r_javacap_menu
-{
- items =
- {
- MENU_ITEM { command = ECaptainCtl; txt = "JavaCaptain"; cascade = r_javacap_sub_menu;},
- MENU_ITEM { command = EPrewarmCtl; txt = "Prewarm"; cascade = r_javacap_prewarm_menu; },
- MENU_ITEM { command = EThreadDump; txt = "Thread dump";},
- MENU_ITEM { command = EDebugMode; txt = "Change debug mode";},
- MENU_ITEM { command = ESecurityMode; txt = "Change security warnings";},
- MENU_ITEM { command = ESecurityPolicy; txt = "SecurityPolicy"; cascade = r_javacap_secpolicy_sub_menu;},
- MENU_ITEM { command = ERedirectMode; txt = "Change redirect mode";}
- };
-}
-
-RESOURCE MENU_PANE r_javacap_sub_menu
-{
- items =
- {
- MENU_ITEM { command = ECaptainStart; txt = "Start Captain"; },
- MENU_ITEM { command = ECaptainStop; txt = "Stop Captain"; }
- };
-}
-
-RESOURCE MENU_PANE r_javacap_secpolicy_sub_menu
-{
- items =
- {
- MENU_ITEM { command = ES60SecurityPolicy; txt = "S60"; },
- MENU_ITEM { command = EMSASecurityPolicy; txt = "MSA"; },
- MENU_ITEM { command = EATTSecurityPolicy; txt = "AT&T"; }
- };
-}
-
-RESOURCE MENU_PANE r_javacap_prewarm_menu
-{
- items =
- {
- MENU_ITEM { command = ETogglePrewarmEnable; txt = "Prewarm (on/off)"; },
- MENU_ITEM { command = ETogglePrewarmUiEnable; txt = "Prewarm UI (on/off)"; }
- };
-}
-
--- a/javatools/javacaptain_app/src.s60/javacap_reg.rss Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-#include <appinfo.rh>
-
-UID2 KUidAppRegistrationResourceFile
-UID3 0x20022D3C
-
-RESOURCE APP_REGISTRATION_INFO
-{
- app_file = "JavaCap";
- embeddability = KAppNotEmbeddable;
- newfile=KAppDoesNotSupportNewFile;
-}
-
-// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/build/bld.inf Thu Aug 19 09:48:13 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
+javacontrolpanel_0x2002FF62.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,30 @@
+<!--
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+-->
+
+<project name="javacontrolpanel" basedir="." default="deploy">
+
+ <import file="../../../../build/utilities.xml"/>
+
+ <property name="bootclasspath" value="${bootclasspath.cldc}"/>
+
+ <property name="javah.classnames"
+ value="com.nokia.mj.impl.javacontrolpanel.JavaCaptain,
+ com.nokia.mj.impl.javacontrolpanel.Redirector,
+ com.nokia.mj.impl.javacontrolpanel.SecurityConfig"/>
+
+</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/build/bwins/javacontrolpanelu.def Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+ ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/build/eabi/javacontrolpanelu.def Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+ _Z10jni_lookupPKc @ 1 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/build/javacontrolpanel.pro Thu Aug 19 09:48:13 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:
+#
+
+TARGET=javacontrolpanel
+TEMPLATE=lib
+
+CONFIG += omj java stl
+CONFIG -= qt
+
+LIBS += -ljavastorage
+
+symbian {
+ LIBS += -ljavadebugapi -lcentralrepository
+}
+
+include(../../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/build/javacontrolpanel_0x2002FF62.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,151 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated file - do not edit manually
+*
+*/
+
+// ==============================================================================
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
+// This file is generated by qmake and should not be modified by the
+// user.
+// Name : javacontrolpanel.mmp
+// ==============================================================================
+
+TARGET javacontrolpanel.dll
+TARGETTYPE DLL
+
+UID 0x1000008d 0x2002FF62
+SECUREID 0x2002FF62
+
+EPOCALLOWDLLDATA
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO RD_JAVA_SYMBIAN_TARGET
+MACRO RD_JAVA_S60_RELEASE_9_2
+MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
+MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
+MACRO RD_JAVA_STDCPPV5
+MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
+MACRO RD_JAVA_HTTP_EMC_ENABLED
+MACRO RD_JAVA_NGA_ENABLED
+MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
+MACRO RD_JAVA_OPENC_BETA_PATCH
+MACRO RD_JAVA_INSTALLERUI_ENABLED
+MACRO RD_JAVA_PREWARM
+MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+MACRO RD_JAVA_MIDPRMS_DB
+MACRO __SYMBIAN32__
+MACRO J9EPOC32
+
+SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../../../../inc
+SYSTEMINCLUDE ../src
+SYSTEMINCLUDE ../src.s60
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE .
+
+SOURCEPATH ../src
+SOURCE javacaptain.cpp
+SOURCE redirector.cpp
+SOURCE securityconfig.cpp
+
+SOURCEPATH ../src.s60
+SOURCE logredirector.cpp
+SOURCE security.cpp
+
+
+LIBRARY javastorage.lib
+LIBRARY javadebugapi.lib
+LIBRARY centralrepository.lib
+LIBRARY javautils.lib
+LIBRARY libpthread.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY euser.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY apparc.lib
+LIBRARY avkon.lib
+LIBRARY efsrv.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+LIBRARY apgrfx.lib
+
+CAPABILITY all -tcb
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+#if defined(ARMCC_4_0)
+OPTION ARMCC --import_all_vtbl
+#endif
+OPTION GCCE -fvisibility-inlines-hidden
+
+VERSION 10.0
+
+ARMFPU softvfp
+
+PAGED
+
+BYTEPAIRCOMPRESSTARGET
+
+USERINCLUDE .
+
+#include <platform_paths.hrh>
+
+ APP_LAYER_SYSTEMINCLUDE
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE
+
+ OS_LAYER_SSL_SYSTEMINCLUDE
+
+deffile ./~/javacontrolpanel.def
+
+ SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
+
+SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
+
+SOURCEPATH /epoc32/build/jrt/javabuild/javacontrolpanel
+
+SOURCE lookup.cpp
+
+SOURCEPATH /epoc32/build/jrt/javabuild/javacontrolpanel
+
+SOURCE jxe.c
+
+#ifdef WINSCW
+
+LIBRARY ewsd.lib
+
+#endif
+
+STDCPP
+
+#ifdef WINSCW
+DEFFILE ./bwins/javacontrolpanel.def
+#elif defined EABI
+DEFFILE ./eabi/javacontrolpanel.def
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaCaptain.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,206 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.mj.impl.javacontrolpanel;
+
+import com.nokia.mj.impl.utils.Logger;
+import com.nokia.mj.impl.comms.*;
+import com.nokia.mj.impl.comms.exception.*;
+
+
+class JavaCaptain
+{
+ private final static int PLUGIN_ID_JAVACAPTAIN_CORE_C = 13;
+ private final static int CORE_MSG_ID_STOP_JAVACAPTAIN = 130;
+ private final static int CORE_MSG_ID_DO_THREAD_DUMP = 131;
+ private final static int CORE_MSG_ID_START_PREWARM = 132;
+ private final static int CORE_MSG_ID_STOP_PREWARM = 133;
+ private final static int CORE_MSG_ID_GET_PREWARM = 134;
+
+ private final static int PLUGIN_ID_RTC_C = 1;
+ private final static int RTC_MSG_ID_SET_EXTRA_ARGUMENTS = 150;
+ private final static int RTC_MSG_ID_GET_EXTRA_ARGUMENTS = 151;
+
+ private final static String JVM_DEBUG_ARGS = "-Xrunjdwp:server=y,address=localhost:8000";
+
+ public JavaCaptain()
+ {
+ }
+
+ public boolean isRunning()
+ {
+ CommsEndpoint comms = new CommsEndpoint();
+ boolean isRunning = false;
+ try
+ {
+ comms.connect(CommsEndpoint.JAVA_CAPTAIN);
+ comms.disconnect();
+ isRunning = true;
+ }
+ catch (CommsException e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ comms.destroy();
+ }
+ return isRunning;
+ }
+
+ public void start()
+ {
+ _start();
+ // wait until JC message loop is up
+ for(int i = 0; i < 5; i++)
+ {
+ try
+ {
+ Thread.sleep(30);
+ }
+ catch(InterruptedException e) {}
+ if (isRunning())
+ {
+ break;
+ }
+ }
+ }
+
+ public void stop()
+ {
+ CommsMessage message = createMessage();
+ message.setMessageId(CORE_MSG_ID_STOP_JAVACAPTAIN);
+ // waits until JC message loop is down
+ sendReceive(message);
+ }
+
+ public boolean isPrewarmEnabled()
+ {
+ CommsMessage message = createMessage();
+ message.setMessageId(CORE_MSG_ID_GET_PREWARM);
+ CommsMessage reply = sendReceive(message);
+ int enabled = reply.readInt();
+ return enabled == 1 ? true : false;
+ }
+
+ public void enablePrewarm(boolean aEnable)
+ {
+ CommsMessage message = createMessage();
+ if (aEnable)
+ {
+ message.setMessageId(CORE_MSG_ID_START_PREWARM);
+ }
+ else
+ {
+ message.setMessageId(CORE_MSG_ID_STOP_PREWARM);
+ }
+ send(message);
+ }
+
+ public void doThreadDump()
+ {
+ CommsMessage message = createMessage();
+ message.setMessageId(CORE_MSG_ID_DO_THREAD_DUMP);
+ send(message);
+ }
+
+ public boolean isDebugEnabled()
+ {
+ CommsMessage message = createDebugMessage();
+ message.setMessageId(RTC_MSG_ID_GET_EXTRA_ARGUMENTS);
+ CommsMessage receivedMessage = sendReceive(message);
+ String vmArgs = receivedMessage.readString();
+ boolean enabled = false;
+ if(vmArgs.compareTo(JVM_DEBUG_ARGS) == 0)
+ {
+ enabled = true;
+ }
+ return enabled;
+ }
+
+ public void enableDebug(boolean aEnable)
+ {
+ String vmArgs = "";
+ if (aEnable)
+ {
+ vmArgs = JVM_DEBUG_ARGS;
+ }
+
+ CommsMessage message = createDebugMessage();
+ message.setMessageId(RTC_MSG_ID_SET_EXTRA_ARGUMENTS);
+ message.write(vmArgs);
+ message.write(""); // appArgs
+ send(message);
+ }
+
+ private void send(CommsMessage aMessage)
+ {
+ CommsEndpoint comms = new CommsEndpoint();
+ try
+ {
+ comms.connect(CommsEndpoint.JAVA_CAPTAIN);
+ comms.send(aMessage);
+ comms.disconnect();
+ }
+ catch (CommsException e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ comms.destroy();
+ }
+ }
+
+ private CommsMessage sendReceive(CommsMessage aMessage)
+ {
+ CommsEndpoint comms = new CommsEndpoint();
+ CommsMessage receivedMessage = new CommsMessage();
+ try
+ {
+ comms.connect(CommsEndpoint.JAVA_CAPTAIN);
+ receivedMessage = comms.sendReceive(aMessage, CommsEndpoint.WAIT_FOR_EVER);
+ comms.disconnect();
+ }
+ catch (CommsException e)
+ {
+ e.printStackTrace();
+ }
+ finally
+ {
+ comms.destroy();
+ }
+ return receivedMessage;
+ }
+
+ private CommsMessage createMessage()
+ {
+ CommsMessage message = new CommsMessage();
+ message.setModuleId(PLUGIN_ID_JAVACAPTAIN_CORE_C);
+ return message;
+ }
+
+ private CommsMessage createDebugMessage()
+ {
+ CommsMessage message = new CommsMessage();
+ message.setModuleId(PLUGIN_ID_RTC_C);
+ return message;
+ }
+
+ private native void _start();
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaControlPanel.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.mj.impl.javacontrolpanel;
+
+import com.nokia.mj.impl.utils.Logger;
+import com.nokia.mj.impl.rt.support.JvmInternal;
+import com.nokia.mj.impl.rt.support.ThreadEventListener;
+
+class JavaControlPanel
+{
+ /**
+ * JavaControlPanel main program.
+ *
+ * @param aArgs command line arguments
+ */
+ public static void main(String[] aArgs)
+ {
+ Logger.ILOG(Logger.EUtils, "JavaControlPanel.main starts");
+ int exitCode = 0;
+
+ try
+ {
+ JvmInternal.setThreadEventListener(new ThreadEventListener()
+ {
+ public void threadStarting(Thread newThread, Thread parentThread) {}
+ public void threadDied(Thread thread) {}
+ public void uncaughtException(Thread thread, Throwable throwable)
+ {
+ String threadName = null;
+ if (thread != null)
+ {
+ threadName = thread.getName();
+ }
+ Logger.ELOG(Logger.EUtils, "Unhandled exception in " +
+ threadName, throwable);
+ }
+ });
+ exitCode = mainWithResult(aArgs);
+ }
+ catch (Throwable t)
+ {
+ Logger.ELOG(Logger.EUtils, "Unhandled exception in main", t);
+ exitCode = -1;
+ }
+
+ Logger.ILOG(Logger.EUtils, "JavaControlPanel.main exits with code " + exitCode);
+ System.exit(exitCode);
+ }
+
+ /**
+ * JavaControlPanel main program which returns error code indicating
+ * operation result.
+ *
+ * @param aArgs command line arguments
+ * @return error code indicating operation result
+ */
+ public static int mainWithResult(String[] aArgs)
+ {
+ if (aArgs.length == 0)
+ {
+ JavaControlPanelUi ui = new JavaControlPanelUi();
+ ui.show();
+ }
+ else
+ {
+ Logger.WLOG(Logger.EUtils, "JavaControlPanel making thread dump and exiting");
+ new JavaCaptain().doThreadDump();
+ }
+ return 0;
+ }
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/JavaControlPanelUi.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,434 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.mj.impl.javacontrolpanel;
+
+import com.nokia.mj.impl.rt.support.Jvm;
+import org.eclipse.swt.layout.*;
+import org.eclipse.ercp.swt.mobile.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.graphics.*;
+
+import com.nokia.mj.impl.utils.Logger;
+
+class JavaControlPanelUi
+{
+ private JavaCaptain iCaptain;
+ private Redirector iRedirector;
+ private SecurityConfig iSecurity;
+
+ private Shell iShell;
+ private Button iJavaCaptain;
+ private Button iPrewarm;
+ private Button iThreadDump;
+ private Button iJavaDebug;
+ private Button iRedirect;
+ private Combo iSecurityWarnings;
+ private Combo iSecurityPolicy;
+
+ static
+ {
+ Jvm.loadSystemLibrary("javacontrolpanel");
+ }
+
+ public JavaControlPanelUi()
+ {
+ iCaptain = new JavaCaptain();
+ iRedirector = new Redirector();
+ iSecurity = new SecurityConfig();
+ }
+
+ public void show()
+ {
+ Display display = new Display();
+ iShell = new Shell(display);
+
+ createUi();
+ iShell.pack();
+ iShell.open();
+ handleOrientationChange();
+
+ while (!iShell.isDisposed())
+ {
+ if (!display.readAndDispatch())
+ {
+ display.sleep();
+ }
+ }
+ display.dispose();
+ }
+
+ private void exitEventLoop()
+ {
+ iRedirector.stop();
+ iShell.dispose();
+ }
+
+ private void createUi()
+ {
+ try
+ {
+ setLayout();
+ createJavaCaptainUi();
+ createPrewarmUi();
+ createThreadDumpUi();
+ createJavaDebugUi();
+ createSecurityWarningsUi();
+ createSecurityPolicyUi();
+ createRedirectLogsUi();
+ createCommands();
+ platformAdaptation();
+ }
+ catch (Throwable e)
+ {
+ Logger.ELOG(Logger.EUtils, "createUi failed", e);
+ exitEventLoop();
+ }
+ }
+
+ private void setLayout()
+ {
+ iShell.setText("Java Control Panel");
+ iShell.setLayout(new GridLayout(2, false));
+ }
+
+ private void createJavaCaptainUi()
+ {
+ Label label = new Label(iShell, SWT.NONE);
+ label.setText("Java Captain");
+ label.setLayoutData(new GridData(SWT.CENTER));
+
+ iJavaCaptain = new Button(iShell, SWT.TOGGLE);
+ iJavaCaptain.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ iJavaCaptain.addSelectionListener(new SelectionListener()
+ {
+ public void widgetDefaultSelected(SelectionEvent aEvent)
+ {
+ widgetSelected(aEvent);
+ }
+ public void widgetSelected(SelectionEvent event)
+ {
+ javaCaptainPressed();
+ }
+ });
+ toggleJavaCaptain(iCaptain.isRunning());
+ }
+
+ private void createPrewarmUi()
+ {
+ Label label = new Label(iShell, SWT.NONE);
+ label.setText("Prewarm");
+ label.setLayoutData(new GridData(SWT.CENTER));
+
+ iPrewarm = new Button(iShell, SWT.TOGGLE);
+ iPrewarm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ iPrewarm.addSelectionListener(new SelectionListener()
+ {
+ public void widgetDefaultSelected(SelectionEvent aEvent)
+ {
+ widgetSelected(aEvent);
+ }
+ public void widgetSelected(SelectionEvent event)
+ {
+ prewarmPressed();
+ }
+ });
+ togglePrewarm(iCaptain.isPrewarmEnabled());
+ }
+
+ private void createThreadDumpUi()
+ {
+ Label label = new Label(iShell, SWT.NONE);
+ label.setText("Thread Dump");
+ label.setLayoutData(new GridData(SWT.CENTER));
+
+ iThreadDump = new Button(iShell, SWT.PUSH);
+ iThreadDump.setText("Dump");
+ iThreadDump.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ iThreadDump.addSelectionListener(new SelectionListener()
+ {
+ public void widgetDefaultSelected(SelectionEvent aEvent)
+ {
+ widgetSelected(aEvent);
+ }
+ public void widgetSelected(SelectionEvent event)
+ {
+ threadDumpPressed();
+ }
+ });
+ }
+
+ private void createJavaDebugUi()
+ {
+ Label label = new Label(iShell, SWT.NONE);
+ label.setText("Java Debug");
+ label.setLayoutData(new GridData(SWT.CENTER));
+
+ iJavaDebug = new Button(iShell, SWT.TOGGLE);
+ iJavaDebug.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ iJavaDebug.addSelectionListener(new SelectionListener()
+ {
+ public void widgetDefaultSelected(SelectionEvent aEvent)
+ {
+ widgetSelected(aEvent);
+ }
+ public void widgetSelected(SelectionEvent event)
+ {
+ javaDebugPressed();
+ }
+ });
+ toggleJavaDebug(iCaptain.isDebugEnabled());
+ }
+
+ private void createSecurityWarningsUi()
+ {
+ Label label = new Label(iShell, SWT.NONE);
+ label.setText("Security Warnings");
+ label.setLayoutData(new GridData(SWT.CENTER));
+
+ iSecurityWarnings = new Combo(iShell, SWT.DROP_DOWN | SWT.READ_ONLY);
+ for(int i = 0; i < SecurityConfig.MODES.length; i++)
+ {
+ iSecurityWarnings.add(SecurityConfig.MODES[i]);
+ }
+ iSecurityWarnings.select(iSecurity.getWarningsMode());
+ iSecurityWarnings.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ iSecurityWarnings.addSelectionListener(new SelectionListener()
+ {
+ public void widgetDefaultSelected(SelectionEvent aEvent)
+ {
+ widgetSelected(aEvent);
+ }
+ public void widgetSelected(SelectionEvent event)
+ {
+ securityWarningsSelected();
+ }
+ });
+ }
+
+ private void createSecurityPolicyUi()
+ {
+ Label label = new Label(iShell, SWT.NONE);
+ label.setText("Security Policy");
+ label.setLayoutData(new GridData(SWT.CENTER));
+
+ iSecurityPolicy = new Combo(iShell, SWT.DROP_DOWN | SWT.READ_ONLY);
+ for(int i = 0; i < SecurityConfig.POLICIES.length; i++)
+ {
+ iSecurityPolicy.add(SecurityConfig.POLICIES[i]);
+ }
+ iSecurityPolicy.select(iSecurity.getSecurityPolicy());
+ iSecurityPolicy.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ iSecurityPolicy.addSelectionListener(new SelectionListener()
+ {
+ public void widgetDefaultSelected(SelectionEvent aEvent)
+ {
+ widgetSelected(aEvent);
+ }
+ public void widgetSelected(SelectionEvent event)
+ {
+ securityPolicySelected();
+ }
+ });
+ }
+
+ private void createRedirectLogsUi()
+ {
+ Label label = new Label(iShell, SWT.NONE);
+ label.setText("Redirect Logs");
+ label.setLayoutData(new GridData(SWT.CENTER));
+
+ iRedirect = new Button(iShell, SWT.TOGGLE);
+ iRedirect.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ iRedirect.addSelectionListener(new SelectionListener()
+ {
+ public void widgetDefaultSelected(SelectionEvent aEvent)
+ {
+ widgetSelected(aEvent);
+ }
+ public void widgetSelected(SelectionEvent event)
+ {
+ redirectPressed();
+ }
+ });
+ toggleRedirect(iRedirector.isRedirecting());
+ }
+
+ private void createCommands()
+ {
+ Command exit = new Command(iShell, Command.EXIT, 0);
+ exit.setText("Exit");
+ exit.addSelectionListener(new SelectionListener()
+ {
+ public void widgetDefaultSelected(SelectionEvent aEvent)
+ {
+ widgetSelected(aEvent);
+ }
+ public void widgetSelected(SelectionEvent aEvent)
+ {
+ exitEventLoop();
+ }
+ });
+ }
+
+ private void platformAdaptation()
+ {
+ if (isLinux())
+ {
+ configureUi();
+ }
+ }
+
+ private void configureUi()
+ {
+ // add second dummy command so that menu bar is visible
+ new Command(iShell, Command.GENERAL, 0).setText("");
+
+ // disable not supported services
+ iRedirect.setEnabled(false);
+ iSecurityPolicy.setEnabled(false);
+ iSecurityWarnings.setEnabled(false);
+ }
+
+ private void handleOrientationChange()
+ {
+ iShell.addControlListener(new ControlListener()
+ {
+ private boolean handleEvent = false;
+ public void controlMoved(ControlEvent e)
+ {
+ }
+ public void controlResized(ControlEvent e)
+ {
+ // ignore first event that comes during startup
+ if (handleEvent)
+ {
+ // avoid flickering during orientation change
+ iShell.setVisible(false);
+ iShell.layout();
+ iShell.setVisible(true);
+ }
+ handleEvent = true;
+ }
+ });
+ }
+
+
+ private void javaCaptainPressed()
+ {
+ if (iJavaCaptain.getSelection())
+ {
+ iCaptain.start();
+ javaCaptainStarted();
+ }
+ else
+ {
+ iCaptain.stop();
+ }
+ toggleJavaCaptain(iJavaCaptain.getSelection());
+ }
+
+ private void toggleJavaCaptain(boolean aSelected)
+ {
+ iJavaCaptain.setText( aSelected ? "Running" : "Stopped");
+ iJavaCaptain.setSelection(aSelected);
+ }
+
+ private void prewarmPressed()
+ {
+ iCaptain.enablePrewarm(iPrewarm.getSelection());
+ togglePrewarm(iPrewarm.getSelection());
+ }
+
+ private void togglePrewarm(boolean aSelected)
+ {
+ iPrewarm.setText( aSelected ? "Enabled" : "Disabled");
+ iPrewarm.setSelection(aSelected);
+ }
+
+ private void threadDumpPressed()
+ {
+ iCaptain.doThreadDump();
+ }
+
+ private void javaDebugPressed()
+ {
+ iCaptain.enableDebug(iJavaDebug.getSelection());
+ toggleJavaDebug(iJavaDebug.getSelection());
+ }
+
+ private void toggleJavaDebug(boolean aSelected)
+ {
+ iJavaDebug.setText( aSelected ? "Enabled" : "Disabled");
+ iJavaDebug.setSelection(aSelected);
+ }
+
+ private void securityWarningsSelected()
+ {
+ iSecurity.setWarningsMode(iSecurityWarnings.getSelectionIndex());
+ }
+
+ private void securityPolicySelected()
+ {
+ iSecurity.setSecurityPolicy(iSecurityPolicy.getSelectionIndex());
+ }
+
+ private void redirectPressed()
+ {
+ if (iRedirect.getSelection())
+ {
+ iRedirector.start();
+ }
+ else
+ {
+ iRedirector.stop();
+ }
+ toggleRedirect(iRedirect.getSelection());
+ }
+
+ private void toggleRedirect(boolean aSelected)
+ {
+ iRedirect.setText( aSelected ? "Yes" : "No");
+ iRedirect.setSelection(aSelected);
+ }
+
+ private void javaCaptainStarted()
+ {
+ // some JavaCaptain services return to default settings
+ // when JC is restarted so refresh states
+ togglePrewarm(iCaptain.isPrewarmEnabled());
+ toggleJavaDebug(iCaptain.isDebugEnabled());
+ }
+
+ private boolean isLinux()
+ {
+ String platform = System.getProperty("os.name");
+ if (platform != null && platform.equalsIgnoreCase("linux"))
+ {
+ return true;
+ }
+ return false;
+ }
+
+}
+
+
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/Redirector.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,58 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.mj.impl.javacontrolpanel;
+
+class Redirector
+{
+ private int iHandle;
+
+ public Redirector()
+ {
+ }
+
+ public void start()
+ {
+ stop();
+ iHandle = _start();
+ }
+
+ public void stop()
+ {
+ if (isRedirecting())
+ {
+ _stop(iHandle);
+ iHandle = 0;
+ }
+ }
+
+ public boolean isRedirecting()
+ {
+ if (iHandle != 0)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ private native int _start();
+ private native void _stop(int aHandle);
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/javacontrolpanel/SecurityConfig.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.mj.impl.javacontrolpanel;
+
+import com.nokia.mj.impl.utils.Logger;
+
+
+class SecurityConfig
+{
+ private static final String SECURITY_WARNINGS_USER_DEFINED_MODE = "1";
+ private static final String SECURITY_WARNINGS_DEFAULT_MODE = "2";
+
+ private static final int S60_SECURITY_POLICY_ID = 1;
+ private static final int MSA_SECURITY_POLICY_ID = 2;
+ private static final int ATT_SECURITY_POLICY_ID = 3;
+
+ public static final String MODES[] = { "Default", "User"};
+ public static final String POLICIES[] = { "S60", "MSA", "AT&T"};
+
+ public SecurityConfig()
+ {
+ }
+
+ public int getSecurityPolicy()
+ {
+ int index = _getSecurityPolicy() - 1;
+ return index;
+ }
+
+ public void setSecurityPolicy(int aPolicyIndex)
+ {
+ int id = aPolicyIndex + 1;
+ _setSecurityPolicy(id);
+ }
+
+ public int getWarningsMode()
+ {
+ String mode = _getSecurityWarningsMode();
+ int index = 0;
+ if (mode.compareTo(SECURITY_WARNINGS_USER_DEFINED_MODE) == 0 )
+ {
+ index = 1;
+ }
+ return index;
+ }
+
+ public void setWarningsMode(int aModeIndex)
+ {
+ if (aModeIndex == 0)
+ {
+ _setSecurityWarningsMode(SECURITY_WARNINGS_DEFAULT_MODE);
+ }
+ else
+ {
+ _setSecurityWarningsMode(SECURITY_WARNINGS_USER_DEFINED_MODE);
+ }
+ }
+
+ private native String _getSecurityWarningsMode();
+ private native void _setSecurityWarningsMode(String aMode);
+ private native int _getSecurityPolicy();
+ private native void _setSecurityPolicy(int aPolicyId);
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/rt/javacontrolpanel/ApplicationInfoImpl.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.mj.impl.rt.javacontrolpanel;
+
+import com.nokia.mj.impl.rt.support.ApplicationInfo;
+import com.nokia.mj.impl.utils.Uid;
+
+/**
+ * @author Nokia Corporation
+ * @version 1.0
+ */
+
+public class ApplicationInfoImpl extends ApplicationInfo
+{
+ private String iProtectionDomain = null;
+
+ /**
+ */
+ public String getRuntimeType()
+ {
+ // See runtime types defined in ApplicationInfo class.
+ return "JavaControlPanel";
+ }
+
+ /**
+ */
+ public String getProtectionDomain()
+ {
+ return MANUFACTURER_DOMAIN;
+ }
+
+ /**
+ */
+ public Uid getUid()
+ {
+ return Uid.createUid("[2002FF61]");
+ }
+
+ /**
+ */
+ public Uid getSuiteUid()
+ {
+ throw new RuntimeException
+ ("Get suite uid is not applicable for JavaControlPanel");
+ }
+
+ /**
+ */
+ public String getSuiteName()
+ {
+ return getName();
+ }
+
+ /**
+ */
+ public String getName()
+ {
+ return "JavaControlPanel";
+ }
+
+ /**
+ */
+ public String getVendor()
+ {
+ return "Nokia";
+ }
+
+ /**
+ */
+ public String getVersion()
+ {
+ return "1.0.0";
+ }
+
+ /**
+ */
+ public String getRootPath()
+ {
+ throw new RuntimeException
+ ("getRootPath is not applicable for JavaControlPanel");
+ }
+
+ /**
+ */
+ public String getMainClass()
+ {
+ throw new RuntimeException
+ ("Get main class is not applicable for JavaControlPanel");
+ }
+
+ /**
+ */
+ public String getAttribute(String key)
+ {
+ return null;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/javasrc/com/nokia/mj/impl/rt/javacontrolpanel/ApplicationUtilsImpl.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+package com.nokia.mj.impl.rt.javacontrolpanel;
+
+import com.nokia.mj.impl.rt.support.ApplicationInfo;
+import com.nokia.mj.impl.rt.support.ApplicationUtils;
+import com.nokia.mj.impl.utils.Uid;
+
+import java.security.Permission;
+import java.security.AccessControlException;
+
+/**
+ * @author Nokia Corporation
+ * @version 1.0
+ */
+public class ApplicationUtilsImpl extends ApplicationUtils
+{
+ public static void doShutdownImpl()
+ {
+ // Send shutdown notification to all registered listeners.
+ ((ApplicationUtilsImpl)sInstance).doShutdown();
+ }
+
+
+ public void notifyExitCmd()
+ {
+ }
+
+ public void checkPermission(Permission aPermission)
+ throws AccessControlException, NullPointerException
+ {
+ checkPermission(null, aPermission);
+ }
+
+ public void checkPermission(Uid aAppUid, Permission aPermission)
+ throws AccessControlException, NullPointerException
+ {
+ return;
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/src.s60/logredirector.cpp Thu Aug 19 09:48:13 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:
+*
+*/
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include "logredirector.h"
+
+LogRedirector::LogRedirector() : mFd(-1)
+{
+ iJavaDiagnostic.reset(JavaDiagnostic::createInstance());
+}
+
+LogRedirector::~LogRedirector()
+{
+}
+
+void LogRedirector::start()
+{
+ iJavaDiagnostic->setDiagnosticListener(*this);
+ mFd = open("c:\\data\\javaredirect.log", O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
+}
+
+void LogRedirector::stop()
+{
+ iJavaDiagnostic->removeDiagnosticListener();
+ close(mFd);
+ mFd = -1;
+}
+
+void LogRedirector::systemOut(const TDesC8& aData)
+{
+ write(aData);
+}
+
+void LogRedirector::systemErr(const TDesC8& aData)
+{
+ write(aData);
+}
+
+void LogRedirector::log(const TDesC8& aData)
+{
+ write(aData);
+}
+
+void LogRedirector::write(const TDesC8& aData)
+{
+ if (mFd > 0)
+ {
+ ::write(mFd, (const char*)aData.Ptr(), aData.Size());
+ }
+};
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/src.s60/logredirector.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef LOGREDIRECTOR_H
+#define LOGREDIRECTOR_H
+
+#include <memory>
+#include "javadiagnostic.h"
+using namespace java::debug;
+
+class LogRedirector : public DiagnosticListener
+{
+public:
+ LogRedirector();
+ ~LogRedirector();
+
+ void start();
+ void stop();
+
+ // DiagnosticListener methods
+ virtual void systemOut(const TDesC8& aData);
+ virtual void systemErr(const TDesC8& aData);
+ virtual void log(const TDesC8& aData);
+
+private:
+ void write(const TDesC8& aData);
+ std::auto_ptr<JavaDiagnostic> iJavaDiagnostic;
+ int mFd;
+};
+
+#endif // LOGREDIRECTOR_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/src.s60/security.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,220 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include <centralrepository.h>
+#include <SWInstallerInternalCRKeys.h>
+
+#include "security.h"
+#include "logger.h"
+#include "javastoragenames.h"
+#include "securitystoragedatadefs.h"
+
+using namespace java::storage;
+using namespace std;
+
+_LIT(KS60SecurityPolicy, "s60");
+_LIT(KMSASecurityPolicy, "msa");
+_LIT(KATTSecurityPolicy, "att");
+// Java Security Policy Central Repository UID
+static const TUid KCRUidJavaSecurity = { 0x2001B289 };
+// IDs for security folder and file keys
+static const TUint32 KPolicy = 0x03;
+static const TUint32 KSecurityWarnings = 0x04;
+
+const int S60_SECURITY_POLICY_ID = 1;
+const int MSA_SECURITY_POLICY_ID = 2;
+const int ATT_SECURITY_POLICY_ID = 3;
+
+
+Security::Security()
+{
+ try
+ {
+ iStorage.reset(JavaStorage::createInstance());
+ iStorage->open();
+ }
+ catch (JavaStorageException& e)
+ {
+ ELOG1(EUtils, "open storage connection failed, %s", e.toString().c_str());
+ }
+}
+
+Security::~Security()
+{
+}
+
+std::wstring Security::getSecurityWarningsMode()
+{
+ try
+ {
+ JavaStorageApplicationEntry_t query;
+ JavaStorageApplicationList_t queryResult;
+ JavaStorageEntry attr;
+ attr.setEntry(ID, L"");
+ query.insert(attr);
+ attr.setEntry(SECURITY_WARNINGS, L"");
+ query.insert(attr);
+ iStorage->search(MIDP_PACKAGE_TABLE, query, queryResult);
+ JavaStorageApplicationList_t::const_iterator iterator;
+ JavaStorageApplicationList_t domainQueryResult;
+ for (iterator = queryResult.begin(); iterator != queryResult.end(); iterator++)
+ {
+ std::wstring securityWarnings = L"";
+ JavaStorageApplicationEntry_t entry = (*iterator);
+ findColumn(entry, SECURITY_WARNINGS, securityWarnings);
+ if (securityWarnings == SECURITY_WARNINGS_USER_DEFINED_MODE)
+ {
+ // make them all USER
+ setSecurityWarningsMode(SECURITY_WARNINGS_USER_DEFINED_MODE);
+ return SECURITY_WARNINGS_USER_DEFINED_MODE;
+ }
+ }
+ }
+ catch (JavaStorageException& aJse)
+ {
+ }
+ // one more check: central repository
+ std::wstring securityWarningsMode = SECURITY_WARNINGS_DEFAULT_MODE;
+ TRAP_IGNORE
+ (
+ CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity);
+ TInt warningsMode;
+ User::LeaveIfError(repository->Get(KSecurityWarnings, warningsMode));
+ switch (warningsMode)
+ {
+ case 1:
+ securityWarningsMode = SECURITY_WARNINGS_USER_DEFINED_MODE;
+ break;
+ case 2:
+ securityWarningsMode = SECURITY_WARNINGS_DEFAULT_MODE;
+ break;
+ }
+ CleanupStack::PopAndDestroy(repository);
+ );
+ return securityWarningsMode;
+}
+
+void Security::setSecurityWarningsMode(const std::wstring& aSecurityWarningsMode)
+{
+ try
+ {
+ JavaStorageApplicationEntry_t query;
+ JavaStorageApplicationList_t queryResult;
+ JavaStorageEntry attr;
+ attr.setEntry(ID, L"");
+ query.insert(attr);
+ iStorage->search(MIDP_PACKAGE_TABLE, query, queryResult);
+ JavaStorageApplicationList_t::const_iterator iterator;
+ JavaStorageApplicationList_t domainQueryResult;
+ for (iterator = queryResult.begin(); iterator != queryResult.end(); iterator++)
+ {
+ std::wstring uid = L"";
+ JavaStorageApplicationEntry_t entry = (*iterator);
+ findColumn(entry, ID, uid);
+ JavaStorageApplicationEntry_t oldEntry;
+ JavaStorageEntry oldAttr;
+ oldAttr.setEntry(ID, uid);
+ oldEntry.insert(oldAttr);
+ attr.setEntry(SECURITY_WARNINGS, aSecurityWarningsMode);
+ entry.clear();
+ entry.insert(attr);
+ iStorage->update(MIDP_PACKAGE_TABLE, entry, oldEntry);
+ }
+ }
+ catch (JavaStorageException& aJse)
+ {
+ }
+ // set the cenRep key as well
+ TRAP_IGNORE
+ (
+ CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity);
+ if (aSecurityWarningsMode == SECURITY_WARNINGS_USER_DEFINED_MODE)
+ {
+ repository->Set(KSecurityWarnings, 1);
+ }
+ else
+ {
+ repository->Set(KSecurityWarnings, 2);
+ }
+ CleanupStack::PopAndDestroy(repository);
+ );
+}
+
+void Security::findColumn(const JavaStorageApplicationEntry_t& aEntry,
+ const wstring& aColName, wstring& aColValue)
+{
+ JavaStorageEntry findPattern;
+ findPattern.setEntry(aColName, L"");
+ JavaStorageApplicationEntry_t::const_iterator findIterator =
+ aEntry.find(findPattern);
+ if (findIterator != aEntry.end())
+ {
+ aColValue = findIterator->entryValue();
+ }
+}
+
+int Security::getSecurityPolicy()
+{
+ int securityPolicyId = S60_SECURITY_POLICY_ID;
+ TRAP_IGNORE
+ (
+ CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity);
+ HBufC* buf = HBufC::NewLC(NCentralRepositoryConstants::KMaxUnicodeStringLength);
+ TPtr policy(buf->Des());
+ User::LeaveIfError(repository->Get(KPolicy, policy));
+ if (policy.Compare(KS60SecurityPolicy) == 0)
+ {
+ securityPolicyId = S60_SECURITY_POLICY_ID;
+ }
+ else if (policy.Compare(KMSASecurityPolicy) == 0)
+ {
+ securityPolicyId = MSA_SECURITY_POLICY_ID;
+ }
+ else if (policy.Compare(KATTSecurityPolicy) == 0)
+ {
+ securityPolicyId = ATT_SECURITY_POLICY_ID;
+ }
+ CleanupStack::PopAndDestroy(buf);
+ CleanupStack::PopAndDestroy(repository);
+ );
+ return securityPolicyId;
+
+}
+
+void Security::setSecurityPolicy(int aSecurityPolicyId)
+{
+ TRAP_IGNORE
+ (
+ CRepository* repository = CRepository::NewLC(KCRUidJavaSecurity);
+ switch (aSecurityPolicyId)
+ {
+ case S60_SECURITY_POLICY_ID:
+ User::LeaveIfError(repository->Set(KPolicy, KS60SecurityPolicy));
+ break;
+ case MSA_SECURITY_POLICY_ID:
+ User::LeaveIfError(repository->Set(KPolicy, KMSASecurityPolicy));
+ break;
+ case ATT_SECURITY_POLICY_ID:
+ User::LeaveIfError(repository->Set(KPolicy, KATTSecurityPolicy));
+ break;
+ }
+ CleanupStack::PopAndDestroy(repository);
+ );
+}
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/src.s60/security.h Thu Aug 19 09:48:13 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:
+*
+*/
+
+#ifndef SECURITY_H
+#define SECURITY_H
+
+#include <string>
+#include <memory>
+#include "javastorage.h"
+
+class Security
+{
+public:
+ Security();
+ ~Security();
+
+ std::wstring getSecurityWarningsMode();
+ void setSecurityWarningsMode(const std::wstring& aMode);
+ int getSecurityPolicy();
+ void setSecurityPolicy(int aPolicyId);
+
+private:
+ void findColumn(const java::storage::JavaStorageApplicationEntry_t& aEntry,
+ const std::wstring& aColName, std::wstring& aColValue);
+
+ std::auto_ptr<java::storage::JavaStorage> iStorage;
+};
+
+#endif // SECURITY_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/src/javacaptain.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: JavaCaptain
+*
+*/
+
+
+#include "com_nokia_mj_impl_javacontrolpanel_JavaCaptain.h"
+
+#ifdef __SYMBIAN32__
+#include <spawn.h>
+#else
+#include <stdio.h>
+#endif
+
+#include <cstring>
+#include <errno.h>
+#include "logger.h"
+
+/*
+ * Class: com_nokia_mj_impl_javacontrolpanel_JavaCaptain
+ * Method: _start
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_nokia_mj_impl_javacontrolpanel_JavaCaptain__1start
+ (JNIEnv *, jobject)
+{
+ int rc = 0;
+ int pid = 0;
+ char* av[2];
+ int index = 0;
+ av[index++] = "javacaptain";
+ av[index] = NULL;
+
+#ifdef __SYMBIAN32__
+ rc = posix_spawn(&pid, "javacaptain", NULL, NULL, av, NULL);
+#else
+ if (!(pid = fork()))
+ {
+ rc = execvp("javacaptain", av);
+ if (rc == -1)
+ {
+ rc = errno;
+ }
+ }
+#endif // __SYMBIAN32__
+
+ if (rc)
+ {
+ ELOG3(EUtils,"%s failed, %s - errno=%d", __PRETTY_FUNCTION__, strerror(rc), rc);
+ }
+
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/src/redirector.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "com_nokia_mj_impl_javacontrolpanel_Redirector.h"
+#include "logger.h"
+#ifdef __SYMBIAN32__
+#include "logredirector.h"
+#endif
+
+/*
+ * Class: com_nokia_mj_impl_javacontrolpanel_Redirector
+ * Method: _start
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_javacontrolpanel_Redirector__1start
+ (JNIEnv *, jobject)
+{
+#ifdef __SYMBIAN32__
+ LogRedirector* redirector = new LogRedirector();
+ redirector->start();
+ return (jint)redirector;
+#else
+ return 0;
+#endif
+}
+
+/*
+ * Class: com_nokia_mj_impl_javacontrolpanel_Redirector
+ * Method: _stop
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_com_nokia_mj_impl_javacontrolpanel_Redirector__1stop
+ (JNIEnv *, jobject, jint aHandle)
+{
+#ifdef __SYMBIAN32__
+ LogRedirector* redirector = reinterpret_cast<LogRedirector*>(aHandle);
+ redirector->stop();
+ delete redirector;
+#endif
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/controlpanel/src/securityconfig.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,87 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include <string>
+#include "com_nokia_mj_impl_javacontrolpanel_SecurityConfig.h"
+#include "javajniutils.h"
+
+#ifdef __SYMBIAN32__
+#include "security.h"
+#endif
+
+/*
+ * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig
+ * Method: _getSecurityWarningsMode
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1getSecurityWarningsMode
+ (JNIEnv* aEnv, jobject)
+{
+#ifdef __SYMBIAN32__
+ Security security;
+ std::wstring mode = security.getSecurityWarningsMode();
+ return java::util::JniUtils::wstringToJstring(aEnv, mode);
+#else
+ return java::util::JniUtils::wstringToJstring(aEnv, L"2");;
+#endif
+}
+
+/*
+ * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig
+ * Method: _setSecurityWarningsMode
+ * Signature: (Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1setSecurityWarningsMode
+ (JNIEnv* aEnv, jobject, jstring aMode)
+{
+#ifdef __SYMBIAN32__
+ Security security;
+ std::wstring mode = java::util::JniUtils::jstringToWstring(aEnv, aMode);
+ security.setSecurityWarningsMode(mode);
+#endif
+}
+
+/*
+ * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig
+ * Method: _getSecurityPolicy
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1getSecurityPolicy
+ (JNIEnv *, jobject)
+{
+#ifdef __SYMBIAN32__
+ Security security;
+ return security.getSecurityPolicy();
+#else
+ return 1;
+#endif
+}
+
+/*
+ * Class: com_nokia_mj_impl_javacontrolpanel_SecurityConfig
+ * Method: _setSecurityPolicy
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_com_nokia_mj_impl_javacontrolpanel_SecurityConfig__1setSecurityPolicy
+ (JNIEnv *, jobject, jint aPolicyId)
+{
+#ifdef __SYMBIAN32__
+ Security security;
+ security.setSecurityPolicy(aPolicyId);
+#endif
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/starter/build/bld.inf Thu Aug 19 09:48:13 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
+javacontrolpanel_0x2002FF61.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/starter/build/javacontrolpanel.pro Thu Aug 19 09:48:13 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=javacontrolpanel
+CONFIG += omj no_icon stl
+CONFIG -= qt
+
+INCLUDEPATH += ../../../../javaruntimes/inc
+LIBS += -ljavacomms -ljavaruntimestarterutils
+
+symbian {
+ TARGET.EPOCHEAPSIZE = 0x020000 0x800000
+ TARGET.EPOCSTACKSIZE = 0x14000
+ TARGET.UID2 = 0x20004c45
+ TARGET.UID3 = 0x2002FF61
+ TARGET.SID = 0x2002FF61
+
+ TARGET.CAPABILITY = AllFiles WriteDeviceData PowerMgmt NetworkControl
+
+ MMP_RULES += "START RESOURCE ../data/javacontrolpanel_reg.rss"
+ MMP_RULES += "TARGETPATH /private/10003a3f/apps"
+ MMP_RULES += "END"
+}
+
+include(../../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/starter/build/javacontrolpanel_0x2002FF61.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,137 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated file - do not edit manually
+*
+*/
+
+// ==============================================================================
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
+// This file is generated by qmake and should not be modified by the
+// user.
+// Name : javacontrolpanel.mmp
+// ==============================================================================
+
+TARGET javacontrolpanel.exe
+TARGETTYPE EXE
+
+UID 0x20004c45 0x2002FF61
+SECUREID 0x2002FF61
+
+EPOCSTACKSIZE 0x14000
+EPOCHEAPSIZE 0x020000 0x800000
+EPOCALLOWDLLDATA
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO RD_JAVA_SYMBIAN_TARGET
+MACRO RD_JAVA_S60_RELEASE_9_2
+MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
+MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
+MACRO RD_JAVA_STDCPPV5
+MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
+MACRO RD_JAVA_HTTP_EMC_ENABLED
+MACRO RD_JAVA_NGA_ENABLED
+MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
+MACRO RD_JAVA_OPENC_BETA_PATCH
+MACRO RD_JAVA_INSTALLERUI_ENABLED
+MACRO RD_JAVA_PREWARM
+MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+MACRO RD_JAVA_MIDPRMS_DB
+MACRO __SYMBIAN32__
+MACRO J9EPOC32
+
+SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../../../../javaruntimes/inc
+SYSTEMINCLUDE ../../../../inc
+SYSTEMINCLUDE ../src
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE .
+
+SOURCEPATH ../src
+SOURCE main.cpp
+
+
+LIBRARY javacomms.lib
+LIBRARY javaruntimestarterutils.lib
+LIBRARY javautils.lib
+LIBRARY libpthread.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY euser.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY apparc.lib
+LIBRARY avkon.lib
+LIBRARY efsrv.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+LIBRARY apgrfx.lib
+STATICLIBRARY libcrt0.lib
+
+CAPABILITY AllFiles WriteDeviceData PowerMgmt NetworkControl
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+#if defined(ARMCC_4_0)
+OPTION ARMCC --import_all_vtbl
+#endif
+OPTION GCCE -fvisibility-inlines-hidden
+
+VERSION 10.0
+
+ARMFPU softvfp
+
+PAGED
+
+BYTEPAIRCOMPRESSTARGET
+
+USERINCLUDE .
+
+START RESOURCE ../data/javacontrolpanel_reg.rss
+
+TARGETPATH /private/10003a3f/apps
+
+END
+
+#include <platform_paths.hrh>
+
+ 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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/starter/data/javacontrolpanel_reg.rss Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: javacontrolpanel_reg.rss
+*
+*/
+
+
+#include <appinfo.rh>
+
+UID2 KUidAppRegistrationResourceFile
+UID3 0x2002FF61
+
+RESOURCE APP_REGISTRATION_INFO
+{
+ app_file = "JavaControlPanel";
+ embeddability = KAppEmbeddable;
+ newfile = KAppDoesNotSupportNewFile;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javatools/javacontrolpanel/starter/src/main.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Main program for the Java Manager process
+*
+*/
+
+#include <memory>
+#include <unistd.h>
+
+#include "logger.h"
+#include "exceptionbase.h"
+#include "runtimeexception.h"
+#include "javacommonutils.h"
+#include "runtimestarterutils.h"
+#include "jvmstarter.h"
+
+using namespace java::runtime;
+using namespace java::util;
+
+int startJvm(int argc, char *argv[]);
+const wchar_t* const JavaControlPanel_MAIN_CLASS = L"com.nokia.mj.impl.javacontrolpanel.JavaControlPanel";
+
+int main(int argc, char *argv[])
+{
+ LOG(EUtils, EInfo, "JavaControlPanel main()");
+ int result = -1;
+ try
+ {
+ result = startJvm(argc, argv);
+ }
+ catch (RuntimeException& e)
+ {
+ ELOG1(EUtils, "JavaControlPanel main() RuntimeException caught: %s ",
+ e.toString().c_str());
+ }
+
+ catch (ExceptionBase& e)
+ {
+ ELOG1(EUtils, "JavaControlPanel main() ExceptionBase caught: %s ",
+ e.toString().c_str());
+ }
+
+ catch (std::exception& e)
+ {
+ ELOG1(EUtils, "JavaControlPanel main() Exception %s caught", e.what());
+ }
+
+ LOG1(EUtils, EInfo, "JavaControlPanel EXIT = %d", result);
+ return result;
+}
+
+int startJvm(int argc, char *argv[])
+{
+ JELOG2(EUtils);
+
+ // Create instance of RuntimeStarterUtils for thread supervisioning.
+ std::auto_ptr<RuntimeStarterUtils> starterUtils(new RuntimeStarterUtils());
+ starterUtils->startThreadSupervisor();
+
+ // Create starter for starting the JVM
+ std::auto_ptr<JvmStarter>
+ jvm(JvmStarter::getJvmStarterInstance(JvmStarter::CLDC,
+ L"JavaControlPanel"));
+
+ // Set the debugging features available provided by the captain.
+ // starterUtils->enableDevelopmentFeatures(*jvm.get());
+ // jvm->enableThreadDumping();
+
+ jvm->appendSystemProperty(L"-Dcom.nokia.rt.port=javacontrolpanel");
+ jvm->setMainClass(JavaControlPanel_MAIN_CLASS);
+
+ for (int i = 1; i < argc; ++i)
+ {
+ jvm->appendApplicationArgument(
+ JavaCommonUtils::utf8ToWstring(argv[i]));
+ }
+
+ // Start the JVM.
+ return jvm->startJvm();
+}
--- a/javatools/javasecuritycustomization/build/javasecuritycustomization_0x20028786.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javatools/javasecuritycustomization/build/javasecuritycustomization_0x20028786.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javasecuritycustomization.mmp
@@ -53,7 +53,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../../inc
--- a/javatools/javatools.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javatools/javatools.pro Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,8 @@
TEMPLATE = subdirs
SUBDIRS += tckrunner/starter/build/tckrunner.pro
SUBDIRS += tckrunner/runner/build/tckrunner.pro
+SUBDIRS += javacontrolpanel/starter/build/javacontrolpanel.pro
+SUBDIRS += javacontrolpanel/controlpanel/build/javacontrolpanel.pro
SUBDIRS += javasecuritycustomization/build/javasecuritycustomization.pro
-BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"javacaptain_app/build/bld.inf\""
BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"testcerts/bld.inf\""
BLD_INF_RULES.prj_extensions += "prj_extensions"
--- a/javatools/subsystem.mk Thu Jul 15 18:31:06 2010 +0300
+++ b/javatools/subsystem.mk Thu Aug 19 09:48:13 2010 +0300
@@ -19,7 +19,9 @@
# Common
COMPONENTS = \
tckrunner/starter/build \
- tckrunner/runner/build
+ tckrunner/runner/build \
+ javacontrolpanel/starter/build \
+ javacontrolpanel/controlpanel/build \
# Platform specific
ifeq ($(BUILDENV),symbian)
@@ -43,7 +45,6 @@
endif
NONQTSUBSYSTEMS += \
- javacaptain_app/build \
testcerts
endif
--- a/javatools/tckrunner/runner/build/tckrunner_0x2002DCE3.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javatools/tckrunner/runner/build/tckrunner_0x2002DCE3.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : tckrunner.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../../../inc
--- a/javatools/tckrunner/runner/src/tckrunnernative.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javatools/tckrunner/runner/src/tckrunnernative.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -58,12 +58,13 @@
{
int rc = 0;
- const char* av[MAX_PARAMS + 5];
+ const char* av[MAX_PARAMS + 6];
int index = 0;
av[index++] = java::runtime::JAVA_PROCESS;
av[index++] = java::runtime::JAVA_INSTALLER_STARTER_DLL;
av[index++] = "poll";
av[index++] = "-address=tck";
+ av[index++] = "-drive=C";
int args = aEnv->GetArrayLength(aArgs);
char** installerArgs = new char*[args];
--- a/javatools/tckrunner/starter/build/tckrunner_0x2002121E.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javatools/tckrunner/starter/build/tckrunner_0x2002121E.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : tckrunner.mmp
@@ -54,7 +54,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../../../../javaruntimes/inc
--- a/javatools/tckrunner/starter/src/main.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javatools/tckrunner/starter/src/main.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -92,6 +92,12 @@
// starterUtils->enableDevelopmentFeatures(*jvm.get());
// jvm->enableThreadDumping();
+#ifdef __WINSCW__
+ // Setting smaller max heap in the emulator.
+ const int maxHeapSize = 2 * 1024; // 2 MB
+ jvm->overrideMaxHeapSize(maxHeapSize);
+#endif // __WINSCW__
+
jvm->appendSystemProperty(L"-Dcom.nokia.rt.port=tckrunner");
jvm->setMainClass(TCK_RUNNER_MAIN_CLASS);
--- a/javauis/amms_akn/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/amms_akn/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -27,7 +27,7 @@
file -->
<target name="compile">
- <omj.javac classpath="${compile.result.root}/javalegacyutils/classes/collection:${compile.result.root}/javamobilemedia/classes/first:${compile.result.root}/javautils/classes/first"/>
+ <omj.javac classpath="${compile.result.root}/javalegacyutils/classes/collection:${compile.result.root}/javamobilemedia/classes/first"/>
</target>
<!-- Needed by the utilities.xml. See the description form the utilities.xml
--- a/javauis/amms_akn/build/javaamms.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/amms_akn/build/javaamms.pro Thu Aug 19 09:48:13 2010 +0300
@@ -26,17 +26,14 @@
DEFINES += __JAVA_JSR234_TUNER
-INCLUDEPATH += /epoc32/include/mmf/common \
- /epoc32/include/caf \
- ../ammscontrol/inc \
+INCLUDEPATH += ../ammscontrol/inc \
../ammscontrol/audio3D/inc \
../ammscontrol/audioeffect/inc \
../mmacontrol/inc \
../module/inc \
../src_tuner/native/external_include \
../src_tuner/native/inc \
- ../ammscontrol/inc \
- ../../mmapi_akn/baseline/inc
+ ../ammscontrol/inc
SOURCES += ../ammscontrol/src/*.cpp \
@@ -47,8 +44,7 @@
../module/src/*.cpp
contains(PROJECT_DEFINES,RD_JAVA_HTTP_EMC_ENABLED) {
- INCLUDEPATH += ../../mmapi_akn/baseline/inc.emc \
- ../mmacontrol/inc.emc \
+ INCLUDEPATH += ../mmacontrol/inc.emc \
SOURCES += ../mmacontrol/src.emc/*.cpp
@@ -57,21 +53,12 @@
-lmmfdevsound
}
else{
- INCLUDEPATH += ../../mmapi_akn/baseline/inc.mmf \
- ../mmacontrol/inc.mmf \
+ INCLUDEPATH += ../mmacontrol/inc.mmf \
SOURCES += ../mmacontrol/src.mmf/*.cpp
}
-contains(PROJECT_DEFINES,RD_JAVA_NGA_ENABLED) {
- INCLUDEPATH += ../../mmapi_akn/baseline/inc.nga
-}
-else {
- INCLUDEPATH += ../../mmapi_akn/baseline/inc.dsa
-}
-
-
LIBS += -lAudioEqualizerEffect \
-lAudioEqualizerUtility \
-lCustomCommandUtility \
--- a/javauis/amms_akn/build/javaamms_0x2002DC96.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/amms_akn/build/javaamms_0x2002DC96.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javaamms.mmp
@@ -55,11 +55,8 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
-SYSTEMINCLUDE /epoc32/include/mmf/common
-SYSTEMINCLUDE /epoc32/include/caf
SYSTEMINCLUDE ../ammscontrol/inc
SYSTEMINCLUDE ../ammscontrol/audio3D/inc
SYSTEMINCLUDE ../ammscontrol/audioeffect/inc
@@ -68,9 +65,7 @@
SYSTEMINCLUDE ../src_tuner/native/external_include
SYSTEMINCLUDE ../src_tuner/native/inc
SYSTEMINCLUDE ../../mmapi_akn/baseline/inc
-SYSTEMINCLUDE ../../mmapi_akn/baseline/inc.emc
SYSTEMINCLUDE ../mmacontrol/inc.emc
-SYSTEMINCLUDE ../../mmapi_akn/baseline/inc.nga
SYSTEMINCLUDE ../../inc
SYSTEMINCLUDE ../../../inc
SYSTEMINCLUDE ../ammscontrol/src
--- a/javauis/amms_akn/mmacontrol/inc.emc/cammspancontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/amms_akn/mmacontrol/inc.emc/cammspancontrol.h Thu Aug 19 09:48:13 2010 +0300
@@ -21,7 +21,7 @@
// INCLUDES
#include <e32base.h>
-#include <mmfstandardcustomcommands.h>
+#include <mmf/common/mmfstandardcustomcommands.h>
#include <midiclientutility.h>
#include "cammscontrol.h"
--- a/javauis/amms_akn/mmacontrol/inc.mmf/cammspancontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/amms_akn/mmacontrol/inc.mmf/cammspancontrol.h Thu Aug 19 09:48:13 2010 +0300
@@ -21,8 +21,8 @@
// INCLUDES
#include <e32base.h>
-#include <MMFStandardCustomCommands.h>
-#include <MidiClientUtility.h>
+#include <mmf/common/mmfstandardcustomcommands.h>
+#include <midiclientutility.h>
#include "CAMMSControl.h"
// CONSTANTS
--- a/javauis/amms_akn/mmacontrol/inc/cammscustomcommandutility.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/amms_akn/mmacontrol/inc/cammscustomcommandutility.h Thu Aug 19 09:48:13 2010 +0300
@@ -22,7 +22,7 @@
// INCLUDES
#include <e32base.h>
#include <CustomCommandUtility.h>
-#include <mmfcontroller.h>
+#include <mmf/common/mmfcontroller.h>
// CLASS DECLARATION
--- a/javauis/amms_akn/mmacontrol/src.emc/cammsprioritycontrol.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/amms_akn/mmacontrol/src.emc/cammsprioritycontrol.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -25,7 +25,7 @@
#include <cmmaplayerevent.h>
#include <cmmaaudioplayer.h>
#include <cmmaemcaudioplayer.h>
-#include <mmfcontroller.h>
+#include <mmf/common/mmfcontroller.h>
#include <midiclientutility.h>
--- a/javauis/amms_akn/mmacontrol/src.mmf/cammsprioritycontrol.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/amms_akn/mmacontrol/src.mmf/cammsprioritycontrol.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -24,8 +24,8 @@
#include "CAMMSPriorityControl.h"
#include <CMMAPlayerEvent.h>
#include <CMMAAudioPlayer.h>
-#include <MMFController.h>
-#include <MidiClientUtility.h>
+#include <mmf/common/mmfcontroller.h>
+#include <midiclientutility.h>
--- a/javauis/amms_akn/mmacontrol/src/cammsaudiooutputcontrol.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/amms_akn/mmacontrol/src/cammsaudiooutputcontrol.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -23,7 +23,7 @@
#include <cmmaplayerevent.h>
#include <cmmaaudioplayer.h>
#include <cmmavideoplayer.h>
-#include <mmfcontroller.h>
+#include <mmf/common/mmfcontroller.h>
#include <midiclientutility.h>
#include <cammscustomcommandutility.h>
#include <JniEnvWrapper.h>
--- a/javauis/amms_akn/src_tuner/javasrc/com/nokia/amms/control/tuner/TunerControlImpl.java Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,548 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class implements
- * javax.microedition.amms.control.tuner.TunerControl
- *
-*/
-
-
-package com.nokia.amms.control.tuner;
-
-import javax.microedition.media.MediaException;
-import javax.microedition.media.Control;
-import com.nokia.microedition.media.InternalPlayer;
-import com.nokia.microedition.media.PlayerImpl;
-import com.nokia.microedition.media.Locator;
-import com.nokia.microedition.media.ManagerImpl;
-import com.nokia.microedition.media.control.ControlImpl;
-import com.nokia.mj.impl.rt.legacy.NativeError;
-
-public class TunerControlImpl
- extends ControlImpl
- implements javax.microedition.amms.control.tuner.TunerControl
-{
- //preset name max length
- private static final int MAX_PRESET_NAME_LENGTH = 100;
- //max number of presets
- private static final int MAX_NUMBER_OF_PRESETS = 20;
- //all frequencys are in 100 Hertzs
- private static final int HERTZ_MULTIPLIER = 100;
-
- /**
- * Constructor
- */
- public TunerControlImpl()
- {
- //JDEBUG( "AMMS TunerControlImpl Constructor" );
- }
-
- /**
- * Gets the minimum frequency supported by this tuner
- * with the given modulation.
- *
- * @param modulation The modulation whose supported minimum frequency
- * is asked.
- * @return The minimum frequency in 100 Hertzs.
- * @throws IllegalArgumentException if the <code>modulation</code> is not supported or it is null.
- */
- public int getMinFreq(String aModulation)
- {
- if (aModulation != MODULATION_FM)
- {
- throw new IllegalArgumentException("Modulation is not valid.");
- }
-
- int minFreq = _getMinFreq(iEventSource,
- iControlHandle);
-
- NativeError.check(minFreq);
-
- return minFreq / HERTZ_MULTIPLIER;
- }
-
- /**
- * Gets the maximum frequency supported by this tuner
- * with the given modulation.
- *
- * @param modulation The modulation whose supported maximum frequency
- * is asked.
- * @return The maximum frequency in 100 Hertzs.
- * @throws IllegalArgumentException if the <code>modulation</code> is not supported or it is null.
- */
- public int getMaxFreq(String aModulation)
- {
- if (aModulation != MODULATION_FM)
- {
- throw new IllegalArgumentException("Modulation is not valid.");
- }
-
- int maxFreq = _getMaxFreq(iEventSource,
- iControlHandle);
-
- NativeError.check(maxFreq);
-
- return maxFreq / HERTZ_MULTIPLIER;
- }
-
- /**
- * Tunes to the given frequency or to the closest supported frequency.
- *
- * @param freq The frequency in 100 Hertzs that will be taken into use.
- * If that frequency is not supported, the closest supported
- * frequency will be taken into use.
- *
- * @param modulation The modulation to be used. <code>TunerControl</code> specifies
- * predefined constants <code>MODULATION_FM</code> and <code>MODULATION_AM</code>
- * but other modulations can be supported as well. Supported modulations can be queried
- * by <code>System</code> property <code>tuner.modulations</code>.
- *
- * @throws IllegalArgumentException if <code>freq</code> is not inside the frequency band supported
- * by the device or if the <code>modulation</code> is not supported or the <code>modulation</code> is null.
- *
- * @return the frequency in 100 Hertzs that was taken into use.
- */
- public int setFrequency(int aFreq, String aModulation)
- {
- if (aModulation != MODULATION_FM)
- {
- throw new IllegalArgumentException("Modulation is not valid.");
- }
-
- int freqInUse = _setFrequency(iEventSource,
- iControlHandle,
- aFreq * HERTZ_MULTIPLIER);
-
- NativeError.check(freqInUse);
-
- return freqInUse / HERTZ_MULTIPLIER;
- }
-
- /**
- * Gets the frequency which the tuner has been tuned to.
- *
- * @return The frequency to which the device has been tuned, in 100 Hertzs.
- */
- public int getFrequency()
- {
- int freq = _getFrequency(iEventSource, iControlHandle);
-
- NativeError.check(freq);
-
- return freq / HERTZ_MULTIPLIER;
- }
-
- /**
- * <p>Seeks for the next broadcast signal. If the end of the Player's
- * frequency band is reached before a signal was found, the scan
- * continues from the other end until a signal is found or the
- * starting frequency is reached.</p>
- *
- * <p>After seeking, the frequency of the Player is the one that
- * was returned or if nothing was found, the original frequency.</p>
- *
- * @param startFreq the frequency in 100 Hertzs wherefrom the scan starts (inclusive)
- *
- * @param modulation The modulation to be used. <code>TunerControl</code> specifies
- * predefined constants <code>MODULATION_FM</code> and <code>MODULATION_AM</code>
- * but other modulations can be supported as well. Supported modulations can be queried
- * by <code>System</code> property <code>tuner.modulations</code>.
- * @param upwards if <code>true</code>, the scan proceeds towards higher frequencies,
- * otherwise towards lower frequencies
- *
- * @return The found frequency in 100 Hertzs or, if no signal was found, 0.
- *
- * @throws IllegalArgumentException if <code>startFreq</code> is not between the supported minimum
- * and maximum frequencies or if the <code>modulation</code> is null.
- * @throws MediaException if the seek functionality is not available for the given modulation.
- */
- public int seek(int aStartFreq, String aModulation, boolean aUpwards)
- throws MediaException
- {
- if (aModulation != MODULATION_FM)
- {
- throw new IllegalArgumentException("Modulation is not valid.");
- }
-
- int foundFreq = _seek(iEventSource,
- iControlHandle,
- aStartFreq * HERTZ_MULTIPLIER,
- aUpwards);
-
- NativeError.check(foundFreq);
-
- return foundFreq / HERTZ_MULTIPLIER;
- }
-
- /**
- * Gets the current squelching (muting in frequencies without broadcast)
- * setting.
- *
- * @return <code>true</code> if squelch is on or <code>false</code> if squelch is off.
- */
- public boolean getSquelch()
- {
- int retValue = _getSquelch(iEventSource, iControlHandle);
-
- NativeError.check(retValue);
-
- if (retValue == NativeError.KErrNone)
- {
- return true;
- }
-
- return false;
- }
-
- /**
- * Sets squelching on or off. Squelching means muting the frequencies
- * that do not contain radio broadcast.
- *
- * @param squelch <code>true</code> to turn the squelch on or <code>false</code> to turn the squelch off.
- * @throws MediaException if the given squelch setting is not supported.
- */
- public void setSquelch(boolean aSquelch) throws MediaException
- {
- int err = _setSquelch(iEventSource, iControlHandle, aSquelch);
-
- NativeError.check(err);
- }
-
- /**
- * Gets the modulation in use.
- *
- * @return The modulation currently in use.
- */
- public String getModulation()
- {
- //only FM modulation is supported
- return MODULATION_FM;
- }
-
- /**
- * Gets the strength of the recepted signal.
- *
- * @return A value between 0 and 100 where 0 means the faintest and 100 the strongest possible signal strength.
- * @throws MediaException if querying the signal strength is not supported.
- */
- public int getSignalStrength() throws MediaException
- {
- int signalStrength = _getSignalStrength(iEventSource,
- iControlHandle);
-
- if (signalStrength != NativeError.KErrNone)
- {
- throw new MediaException("Signal strength is not supported.");
- }
-
- return signalStrength;
- }
-
- /**
- * Gets the stereo mode in use.
- *
- * @return The stereo mode in use. Stereo mode is one of <code>MONO</code>,
- * <code>STEREO</code> or <code>AUTO</code>.
- */
- public int getStereoMode()
- {
- int stereoMode = _getStereoMode(iEventSource, iControlHandle);
-
- NativeError.check(stereoMode);
-
- return stereoMode;
- }
-
- /**
- * Sets the stereo mode.
- *
- * @param mode The stereo mode to be used. Stereo mode is one of <code>MONO</code>,
- * <code>STEREO</code> or <code>AUTO</code>.
- * @throws IllegalArgumentException if the given mode is not supported.
- */
- public void setStereoMode(int aStereoMode)
- {
- if (aStereoMode != MONO && aStereoMode != STEREO && aStereoMode != AUTO)
- {
- throw new IllegalArgumentException();
- }
-
- int err = _setStereoMode(iEventSource, iControlHandle, aStereoMode);
-
- if (err != NativeError.KErrNone)
- {
- throw new IllegalArgumentException("Stereo mode is not supported.");
- }
- }
-
- /**
- * Gets the number of presets. The numbering of presets starts from one and the largest
- * preset number equals the value returned from this method.
- *
- * @return The number of presets, or zero if the presets are not supported.
- */
- public int getNumberOfPresets()
- {
-
- return 0;
- }
-
- /**
- * Tunes the tuner by using settings specified in the preset. Changes to
- * presets following a <code>usePreset</code> call do not tune the tuner automatically.
- *
- * @param preset the preset to be used.
- * @throws IllegalArgumentException if <code>preset</code> < 1 or <code>preset</code> > number of presets.
- */
- public void usePreset(int aPreset)
- {
- if (aPreset < 0 || aPreset > MAX_NUMBER_OF_PRESETS)
- {
- throw new IllegalArgumentException("Preset out of preset range.");
- }
- int err = _usePreset(iEventSource, iControlHandle, aPreset);
-
- NativeError.check(err);
- }
-
- /**
- * Configures the preset using current frequency and modulation
- * (and stereo mode if native presets support storing it).
- *
- * @param preset the preset to be set.
- * @throws IllegalArgumentException if <code>preset</code> < 1 or <code>preset</code> > number of preset range.
- * @throws SecurityException if setting presets has been prohibited.
- */
- public void setPreset(int aPreset)
- {
- if (aPreset < 0 || aPreset > MAX_NUMBER_OF_PRESETS)
- {
- throw new IllegalArgumentException("Preset out of preset range.");
- }
- int err = _setPreset(iEventSource, iControlHandle, aPreset);
-
- NativeError.check(err);
- }
-
- /**
- * Configures the preset using given settings.
- * The stereo mode might not be stored if it is not supported by the presets.
- * (In that case, <code>IllegalArgumentException</code> is not thrown.)
- *
- * @param preset the preset to be configured.
- * @param freq the frequency of the preset in 100 Hertzs.
- * @param mod the modulation of the preset.
- * @param stereoMode the stereo mode of the preset.
- * @throws IllegalArgumentException if <code>preset</code> < 1 or <code>preset</code> > number of presets or
- * <code>freq</code> or <code>modulation</code> are not available or if the <code>modulation</code> is null or if <code>stereoMode</code> is not a supported stereo mode.
- * @throws SecurityException if setting presets has been prohibited.
- */
- public void setPreset(int aPreset, int aFreq, String aModulation, int aStereoMode)
- {
- if (aPreset < 0 || aPreset > MAX_NUMBER_OF_PRESETS)
- {
- throw new IllegalArgumentException("Preset out of preset range.");
- }
- if (aModulation != MODULATION_FM)
- {
- throw new IllegalArgumentException("Modulation is not valid.");
- }
- if (aStereoMode != MONO && aStereoMode != STEREO && aStereoMode != AUTO)
- {
- throw new IllegalArgumentException("Stereo mode is not supported.");
- }
-
- int err = _setPreset(iEventSource, iControlHandle, aPreset, aFreq * HERTZ_MULTIPLIER, aStereoMode);
-
- NativeError.check(err);
- }
-
- /**
- * Gets the preset's frequency.
- *
- * @param preset the preset whose frequency is to be returned.
- * @return The frequency of the preset in 100 Hertzs.
- * @throws IllegalArgumentException if <code>preset</code> < 1 or <code>preset</code> > number of presets.
- */
- public int getPresetFrequency(int aPreset)
- {
- if (aPreset < 0 || aPreset > MAX_NUMBER_OF_PRESETS)
- {
- throw new IllegalArgumentException("Preset out of preset range.");
- }
-
- int presetFreq = _getPresetFrequency(iEventSource, iControlHandle, aPreset);
-
- NativeError.check(presetFreq);
-
- return presetFreq / HERTZ_MULTIPLIER;
- }
-
- /**
- * Gets the preset's modulation.
- *
- * @param preset the preset whose modulation is to be returned.
- * @return The modulation of the preset.
- * @throws IllegalArgumentException if <code>preset</code> < 1 or <code>preset</code> > number of presets.
- */
- public String getPresetModulation(int aPreset)
- {
- if (aPreset < 0 || aPreset > MAX_NUMBER_OF_PRESETS)
- {
- throw new IllegalArgumentException("Preset out of preset range.");
- }
- return MODULATION_FM;
- }
-
- /**
- * Gets the preset's stereo mode.
- *
- * @param preset the preset whose stereo mode is to be returned.
- * @return The stereo mode of the preset. Stereo mode is one of
- * <code>MONO</code>, <code>STEREO</code> or <code>AUTO</code>.
- * @throws IllegalArgumentException if <code>preset</code> < 1 or <code>preset</code> > number of presets.
- * @throws MediaException if the presets do not support storing of the stereo mode.
- */
- public int getPresetStereoMode(int aPreset) throws MediaException
- {
- if (aPreset < 0 || aPreset > MAX_NUMBER_OF_PRESETS)
- {
- throw new IllegalArgumentException("Preset out of preset range.");
- }
-
- int presetStereoMode = _getPresetStereoMode(iEventSource, iControlHandle, aPreset);
-
- NativeError.check(presetStereoMode);
-
- return presetStereoMode;
- }
-
- /**
- * Gets the preset name.
- *
- * @param preset the preset whose name is to be returned.
- * @return A <code>String</code> containing the preset name.
- * @throws IllegalArgumentException if <code>preset</code> < 1 or <code>preset</code> > number of presets.
- */
- public String getPresetName(int aPreset)
- {
- if (aPreset < 0 || aPreset > MAX_NUMBER_OF_PRESETS)
- {
- throw new IllegalArgumentException("Preset out of preset range.");
- }
-
- int[] error = new int[ 1 ];
-
- String presetName = _getPresetName(iEventSource, iControlHandle, aPreset, error);
-
- NativeError.check(error[ 0 ]);
-
- return presetName;
- }
-
- /**
- * Sets the preset name.
- *
- * @param preset the preset whose name is to be set.
- * @param name the name of the preset.
- * @throws IllegalArgumentException if <code>preset</code> < 1 or <code>preset</code> > number of presets or
- * if the <code>name</code> is null.
- * @throws SecurityException if setting presets has been prohibited.
- */
- public void setPresetName(int aPreset, String aName)
- {
- if (aPreset < 0 || aPreset > MAX_NUMBER_OF_PRESETS)
- {
- throw new IllegalArgumentException("Preset out of preset range.");
- }
- if (aName.length() > MAX_PRESET_NAME_LENGTH)
- {
- throw new IllegalArgumentException("Preset name too long");
- }
-
- int err = _setPresetName(iEventSource, iControlHandle, aPreset, aName);
-
- NativeError.check(err);
- }
-
-
- private native int _getMinFreq(int aEventSourceHandle,
- int aTunerControlHandle);
-
- private native int _getMaxFreq(int aEventSourceHandle,
- int aTunerControlHandle);
-
- private native int _setFrequency(int aEventSourceHandle,
- int aTunerControlHandle,
- int aFreq);
-
- private native int _getFrequency(int aEventSourceHandle,
- int aTunerControlHandle);
-
-
- private native int _seek(int aEventSourceHandle,
- int aTunerControlHandle,
- int aStartFreq,
- boolean aUpwards);
-
- private native int _getSquelch(int aEventSourceHandle,
- int aTunerControlHandle);
-
- private native int _setSquelch(int aEventSourceHandle,
- int aTunerControlHandle,
- boolean aSquelch);
-
- private native int _getSignalStrength(int aEventSourceHandle,
- int aTunerControlHandle);
-
- private native int _getStereoMode(int aEventSourceHandle,
- int aTunerControlHandle);
-
- private native int _setStereoMode(int aEventSourceHandle,
- int aTunerControlHandle,
- int aStereoMode);
-
- private native int _usePreset(int aEventSourceHandle,
- int aTunerControlHandle,
- int aPreset);
-
- private native int _setPreset(int aEventSourceHandle,
- int aTunerControlHandle,
- int aPreset);
-
- private native int _setPreset(int aEventSourceHandle,
- int aTunerControlHandle,
- int aPreset,
- int aFreq,
- int aStereoMode);
-
- private native int _getPresetFrequency(int aEventSourceHandle,
- int aTunerControlHandle,
- int aPreset);
-
- private native int _getPresetStereoMode(int aEventSourceHandle,
- int aTunerControlHandle,
- int aPreset);
-
- private native int _setPresetName(int aEventSourceHandle,
- int aTunerControlHandle,
- int aPreset,
- String aName);
-
- private native String _getPresetName(int aEventSourceHandle,
- int aTunerControlHandle,
- int aPreset,
- int[] aError);
-
-
-}
--- a/javauis/amms_akn/src_tuner/javasrc/com/nokia/microedition/media/protocol/capture/radio/Protocol.java Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class is capture://radio protocol
- *
-*/
-
-package com.nokia.microedition.media.protocol.capture.radio;
-
-import com.nokia.microedition.media.Locator;
-import com.nokia.microedition.media.InternalPlayer;
-import com.nokia.microedition.media.PlayerImpl;
-import javax.microedition.media.MediaException;
-import com.nokia.mj.impl.rt.legacy.NativeError;
-import com.nokia.microedition.media.ManagerImpl;
-import com.nokia.amms.control.tuner.TunerControlImpl;
-
-/**
- * This class is capture://radio protocol.
- */
-public class Protocol
- implements com.nokia.microedition.media.protocol.Protocol
-{
- // Constants
- private static final String TUNER_CONTROL_NAME =
- "javax.microedition.amms.control.tuner.TunerControl";
-
- /**
- * Default constructor.
- */
- public Protocol()
- {
- }
-
- /**
- * From Protocol
- */
- public InternalPlayer createPlayer(Locator aLocator)
- throws java.io.IOException,
- MediaException,
- java.lang.SecurityException
- {
- // JDEBUG( "AMMS Tuner Protocol createPlayer" );
-
- String locatorParameters = aLocator.getParameters();
-
- // Create native tuner player. The native tuner player
- // creates a native tuner control and adds it to its list.
- // Handle for the native player are returned.
- int playerHandle = 0;
- playerHandle = _createNativeTunerPlayer(
- ManagerImpl.getEventSource(),
- locatorParameters);
-
-// JDEBUG( "AMMS Tuner Protocol createPlayer playerHandle = " + playerHandle );
-
- NativeError.check(playerHandle);
-
- PlayerImpl tunerPlayer = new PlayerImpl(playerHandle);
-
- return tunerPlayer;
- }
-
- /**
- * Creates native tuner player.
- * Native tuner player creates and adds native tuner control.
- *
- * @param aEventSourceHandle Handle to event source.
- * @param aLocatorParameters
- * @return Error code.
- */
- private native int _createNativeTunerPlayer(int aEventSourceHandle,
- String aLocatorParameters);
-}
--- a/javauis/amms_akn/src_tuner/native/external_include/fmradioenginecrkeys.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Definition of central repository keys for FM Radio Engine.
-*
-*/
-
-
-#ifndef FMRADIOENGINECRKEYS_H
-#define FMRADIOENGINECRKEYS_H
-
-// FM Radio Engine UID
-const TUid KCRUidFMRadioEngine = {0x101F7CBC};
-
-// Radio headset volume
-const TUint32 KRadioHeadsetVolume = 0x00000001;
-
-// Radio speaker volume
-const TUint32 KRadioSpeakerVolume = 0x00000002;
-
-// The last played radio frequency
-const TUint32 KFmRadioFrequency = 0x00000003;
-
-// The last played radio channel
-const TUint32 KFmRadioChannel = 0x00000004;
-
-// The radio mode before radio off
-const TUint32 KFmRadioMode = 0x00000005;
-
-// The first preset channel's location in central repository
-const TUint32 KFmRadioPresetChannel1 = 0x0000000A;
-
-#endif // FMRADIOENGINECRKEYS_H
-
-// End of file
-
-
--- a/javauis/amms_akn/src_tuner/native/external_include/tuner.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2535 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Header file for Tuner component.
-*
-*/
-
-
-#ifndef TUNER_H
-#define TUNER_H
-
-#include <e32base.h>
-#include <MCustomCommand.h>
-#include <mmf/common/mmfbase.h>
-#include <mmf/common/mmfutilities.h>
-#include <mmf/common/mmfcontrollerframework.h>
-#include <mmf/common/mmfstandardcustomcommands.h>
-#include <mmf/common/mmfaudio.h>
-#include <Mda/Common/audio.h>
-class RRadioSession;
-
-/**
-@file
-@publishedAll
-@prototype
-*/
-/**
-The Tuner Capabilities structure defines the capabilities of the tuner
-on the device, as retrieved using the function GetCapabilities.
-*/
-class TTunerCapabilities
-{
-public:
- inline TTunerCapabilities();
- inline TTunerCapabilities(TUint32 aTunerBands, TUint32 aAdditionalFunctions);
-public:
- /**
- Bitfield (as defined by CMMTunerUtility::TTunerBand) with the bits of the
- supported bands set
- */
- TUint32 iTunerBands;
-
- /** Tuner Function bit flags - may be extended in future */
- enum TTunerFunctions
- {
- /** Recording of Tuner Audio is possible */
- ETunerFunctionRecording = 0x01,
- /** Tuner can record and play back simultaneously */
- ETunerFunctionSimultaneousPlayAndRecord = 0x02,
- /** The tuner requires an external antenna (e.g. a headset) to function */
- ETunerFunctionRequiresAntenna = 0x04,
- /** CMMRdsTunerUtility supported */
- ETunerFunctionRds = 0x08,
- /** The tuner can be used when the device is in flight mode */
- ETunerFunctionAvailableInFlightMode = 0x10
- };
-
- /** Bitfield (as defined by ETunerFunctions) with the bits of the supported functions set */
- TUint32 iAdditionalFunctions;
-};
-
-/**
-Class representing a frequency.
-*/
-class TFrequency
-{
-public:
- inline TFrequency();
- explicit inline TFrequency(TInt aFrequency);
- inline TInt operator==(const TFrequency& aFrequency) const;
- inline TInt operator!=(const TFrequency& aFrequency) const;
- inline TInt operator> (const TFrequency& aFrequency) const;
- inline TInt operator>=(const TFrequency& aFrequency) const;
- inline TInt operator< (const TFrequency& aFrequency) const;
- inline TInt operator<=(const TFrequency& aFrequency) const;
-public:
- /**
- The Frequency, in Hertz. A TInt is at least 32 bits, giving a maximum frequency
- of at least 2.4GHz (i.e. 0x7fffffff Hz)
- */
- TInt iFrequency;
-};
-
-
-class MMMTunerObserver;
-class MMMTunerChangeObserver;
-class MMMTunerStereoObserver;
-class MMMSignalStrengthObserver;
-class MMMTunerAudioPlayerObserver;
-class MMMTunerAudioRecorderObserver;
-class CMMTunerAudioPlayerUtility;
-class CMMTunerAudioRecorderUtility;
-class CMMTunerScannerUtility;
-class CMMRdsTunerUtility;
-
-/**
-The MMF Tuner API is present to allow clients to control
-the tuner hardware present on a device.
-*/
-class CMMTunerUtility : public CBase
-{
- friend class CMMTunerAudioPlayerUtility;
- friend class CMMTunerAudioRecorderUtility;
- friend class CMMTunerScannerUtility;
- friend class CMMRdsTunerUtility;
-public:
- /** Tuner Band bit flags - may be extended in future */
- enum TTunerBand
- {
- ETunerNoBand = 0x00,
- /** Long Wave - uses frequencies */
- ETunerBandLw = 0x01,
- /** Amplitude Modulation or Medium Wave - uses frequencies */
- ETunerBandAm = 0x02,
- /** Frequency Modulation, European and American band - uses frequencies */
- ETunerBandFm = 0x04,
- /** Frequency Modulation, Japanese band - uses frequencies */
- ETunerBandJapaneseFm = 0x08,
- /** Digital Audio Broadcasting - uses channels */
- ETunerBandDab = 0x10,
- /** Digital Video Broadcasting */
- ETunerBandDvb = 0x20
- };
- /**
- Search direction enumeration
- */
- enum TSearchDirection
- {
- /** Search for stations upwards - i.e. by increasing frequency */
- ESearchDirectionUp = 1,
- /** Search for stations downwards - i.e. by decreasing frequency */
- ESearchDirectionDown
- };
- /**
- The Tuner Access Priority enables clients to correctly identify their needs
- when it comes to accessing the tuner. A process must have the MultimediaDD
- capability to use priorities greater than ETunerAccessPriorityNormal.
- */
- enum TTunerAccessPriority
- {
- /** Radio accessible when device is idle */
- ETunerAccessPriorityBackground = -100,
- /** Ordinary application priority */
- ETunerAccessPriorityNormal = 0,
- /** Radio is to be used as an alarm sound */
- ETunerAccessPriorityAlarm = 75,
- /** System use only */
- ETunerAccessPrioritySystem = 100
- };
- /**
- Bitmasks to indicate what state the tuner is in.
- */
- enum TTunerState
- {
- /**
- Tuner is active, and can therefore report frequency etc. If this bit is
- not set, none of the others should be set.
- */
- ETunerStateActive = 0x01,
- /** The tuner is playing sound. */
- ETunerStatePlaying = 0x02,
- /** The tuner is currently recording. */
- ETunerStateRecording = 0x04,
- /** The tuner is currently retuning or searching for a new station. */
- ETunerStateRetuning = 0x08,
- };
-public:
-
- /**
- Factory function to create a new instance of the Tuner. Tuner access priority
- setting is required to ensure that applications such as alarms using the radio
- as an alarm sound are not prevented from doing so by other clients. Priority
- setting is needed for audio output when accessing the sound device. Tuner is
- ready for use on return from this function.
-
- @param aObserver The observer object for receiving async completion callbacks
- @param aTunerIndex An index from 0 to TunersAvailable() - 1 specifying the tuner
- device to use.
- @param aAccessPriority Tuner access priority value
- @leave KErrNoMemory Out of memory
- @leave KErrNotFound The specified tuner or tuner controller is not present
- @return A pointer and ownership of the fully constructed CMMTunerUtility object
- */
- IMPORT_C static CMMTunerUtility* NewL(MMMTunerObserver& aObserver,
- TTunerBand aBand,
- TInt aTunerIndex,
- CMMTunerUtility::TTunerAccessPriority aAccessPriority = ETunerAccessPriorityNormal);
-
- IMPORT_C virtual ~CMMTunerUtility();
-
-
-
- /**
- Set the current tuner access priority of this client. This priority is used to
- arbitrate between multiple tuner clients, determining who get control of the
- tuner.
-
- The platform security capability is MultimediaDD and a client with this capability
- is allowed to set the priority in preference to a client with a lower capability.
-
- @param aAccessPriority The new priority to use.
- @capability MultimediaDD
- @return A standard system error code.
- */
- IMPORT_C TInt SetPriority(TTunerAccessPriority aAccessPriority);
-
- /**
- Get the current tuner access priority of this client.
-
- @param aAccessPriority A variable to which the current priority will be written.
- @return A standard system error code.
- */
- IMPORT_C TInt GetPriority(TTunerAccessPriority& aAccessPriority) const;
-
-
- /**
- Get the current state of the tuner.
-
- @param aState A variable to set with the current state. Bits set according to
- TTunerState.
- @return A standard system error code.
- */
- IMPORT_C TInt GetState(TUint32& aState) const;
-
- /**
- Indicates if the external antenna is currently attached or not. The tuner
- capabilties should be queried to determine if the external antenna is required
- to use the tuner or not; A value of false returned here does not necessarily
- imply that the tuner cannot be used.
-
- @param aAttached When this function returns, this will contain ETrue if and only
- if an external antenna is attached.
- @return A standard system error code.
- */
- IMPORT_C TInt IsAntennaAttached(TBool& aAttached);
-
- /**
- Indicates if the device is currently in 'flight mode' or not. The tuner
- capabilities should be queried to determine in the tuner can be used in flight
- mode or not.
-
- @param aFlightMode On return, this will have been set to ETrue if and only if
- the device is in flight mode.
- @return A standard system error code.
- */
- IMPORT_C TInt GetFlightMode(TBool& aFlightMode) const;
-
- /**
- Tune the tuner to the required frequency specified in Hertz. This is an asynchronous
- command and will result in a callback to MToTuneComplete or MToTunerError.
-
- If the session does not currently have control of the tuner, a request for control
- will be made. If control of the tuner is granted, a callback to MToTunerControlGranted
- will occur. If not, there will be a callback to MtoTunerError with error value
- KErrAccessDenied.
-
- Once control of the tuner has been granted, it will be retained until either a
- call to ReleaseTunerControl, or the session is preempted in which case there
- will be a callback to MToTunerError with error value KErrAccessDenied.
-
- @param aFrequency The frequency to tune to
- @param aBand The band to which aFrequency belongs
- */
- IMPORT_C void Tune(TFrequency aFrequency);
-
- /**
- Find a radio station, starting at the start frequency and searching in the
- direction specified (i.e. Up or down) the search is limited to the specified
- band. If the session does not currently have control of the tuner, a request
- for control will be made. If control of the tuner is granted, a callback to
- MToTunerControlGranted will occur. If not, there will be a callback to MToTunerError
- with error value KErrAccessDenied.
-
- Once control of the tuner has been granted, it will be retained until either a
- call to ReleaseTunerControl, or the session is preempted in which case there
- will be a callback to MToTunerError with error value KErrAccessDenied.
-
- A callback to MToTuneComplete will occur if the Seek is successful.
-
- @param aBand The band
- @param aSearchDirect The direction to search in
- @param aCircularSeek If set to ETrue the station seek will loop back to the other
- end of the band once the end of the band has been reached. (Defaults to ETrue)
- If not set reaching the end of the band without finding a station will result
- in a callback to MToTuneComplete with error KErrNotFound.
- */
- IMPORT_C void StationSeek(TSearchDirection aSearchDirection);
-
- /**
- Cancels an ongoing retune operation, as initiated by a call to Tune or StationSeek.
- The usual callback will not occur if this has been called.
-
- Has not affect if no tune or seek operation is ongoing.
- */
- IMPORT_C void CancelRetune();
-
- /**
- Makes a synchronous request for control of the tuner. If this method returns
- KErrNone, control of the tuner has been granted. Control of the tuner is kept
- until it is explically released using ReleaseTunerControl, or it is revoked
- in which case a callback to MToTunerError with an error of KErrAccessDenied
- will occur.
-
- If this method returns with KErrAccessDenied, a request to recieve a
- notifiaction when control could be granted can be made using
- NotifyTunerControl.
-
- Note that methods that require control of the tuner (such as Tune) will make
- a request for control themselves if control has not already been granted.
-
- @return A standard system error code. If control was granted, KErrNone, and if
- control was denied KErrAccessDenied.
- */
- IMPORT_C TInt RequestTunerControl();
-
- /**
- Makes an asyncronous request for control of the tuner. This method should be
- called after an control of the tuner has been denied to receive a notification
- when control of the tuner can be granted. A callback to MToTunerControlGranted
- will occur in this event.
- */
- IMPORT_C TInt NotifyTunerControl();
-
- /**
- Release control of the tuner, allowing other clients to tune it. Change
- notifications may still be received. A request for control of the tuner can be
- made again by calling RequestTunerControl, or any methods that require control
- of the tuner.
- */
- IMPORT_C void ReleaseTunerControl();
-
- /**
- Release the tuner. Any ongoing playing or recording activity will be stopped,
- control of the tuner will be released, and the hardware will be powered down if
- no other clients need it.
- */
- IMPORT_C void Close();
-
- /**
- Retrieve the current frequency that the tuner is tuned to
-
- @param aFrequency The variable to set to the current frequency,
- -1 if channels are in use
- @param aBand The variable used to set the current band.
- @return A standard system error code
- */
- IMPORT_C TInt GetFrequency(TFrequency& aFrequency) const;
-
- /**
- Retrieve the signal strenth of the currently tuned signal
-
- @param aSignalStrength Variable into which the signal strength will be written.
- @return A standard system error code
- */
- IMPORT_C TInt GetSignalStrength(TInt& aSignalStrength) const;
-
- /**
- Get the maximum possible signal strength of a tuned signal.
-
- @param aMaxSignalStrength A variable that will have the maximun signal strength
- written to.
- @return A standard system error code
- */
- IMPORT_C TInt GetMaxSignalStrength(TInt& aMaxSignalStrength) const;
-
- /**
- Request notifications when the signal strength changes. Due to the potentially
- short intervals at which the signal strength may change at, notifications will
- only be sent when a relatively large change occurrs. This should allow a visual
- display of signal strength to be maintained fairly accurately.
-
- The first signal strength notification will be sent immediately after this
- request.
-
- @param aObserver The object which will receive notifications of signal strength
- changes.
- @return A standard system error code
- */
- IMPORT_C TInt NotifySignalStrength(MMMSignalStrengthObserver& aObserver);
-
- /**
- Cancel an outstanding NotifySignalStrength request.
- */
- IMPORT_C void CancelNotifySignalStrength();
-
- /**
- Find out if the current signal is being received in stereo or not.
-
- @param aStereo On return, will be ETrue if and only if a stereo signal is
- currently being received.
- */
- IMPORT_C TInt IsStereoSignal(TBool& aStereo);
-
- /**
- Request notifications when stereo reception is lost/restored.
-
- @param aObserver The object requiring notification when a stereo signal is lost
- or restored. The first notification will occur immediately.
- @return A standard system error code
- */
- IMPORT_C TInt NotifyStereoChange(MMMTunerStereoObserver& aObserver);
-
- /**
- Cancels a stereo change notification request.
- */
- IMPORT_C void CancelNotifyStereoChange();
-
- /**
- Indicates whether the reception should be forced into monophonic mode.
-
- @param aMono If ETrue, all reception will be in mono mode even if a stereo
- signal is available. If EFalse, a stereo signal will be received when
- possible.
- @return A standard system error code.
- */
- IMPORT_C TInt ForceMonoReception(TBool aMono);
-
- /**
- Find out whether reception is forced into monophonic mode or not.
-
- @param aMono This will be set to ETrue if all reception is forced to be mono. If
- this is EFalse, this does not imply that stereo reception is currently
- available.
- @return A standard system error code.
- */
- IMPORT_C TInt GetForcedMonoReception(TBool& aMono) const;
-
- /**
- Sets the current squleching (muting in frequencies without reception) setting.
-
- @param aEnabled ETrue to enable squelching, EFalse to disable it.
- @return KErrNone if successful, else a system wide error code.
- */
- IMPORT_C TInt SetSquelch(TBool aEnabled);
-
- /**
- Gets the current squleching (muting in frequencies without reception) setting.
-
- @param aEnabled This will be set to ETrue if squelching is enabled, EFalse otherwise.
- @return KErrNone if successful, else a system wide error code.
- */
- IMPORT_C TInt GetSquelch(TBool& aEnabled) const;
-
- /**
- Get the capabilities of the tuner on the device
-
- @param aCaps The capabilities object to fill
- @return A standard system error code
- */
- IMPORT_C TInt GetCapabilities(TTunerCapabilities& aCaps) const;
-
- /**
- Get the frequency range (in Hertz) of the specified band.
- This function should be used to enquire the frequency range
- of the bands that GetCapabilities reports as supported.
-
- @param aBand The band to query
- @param aBottomFrequency The variable to set to the lowest frequency allowed
- @param aTopFrequency The variable to set to the highest frequency allowed
- @return A standard system error code
- */
- IMPORT_C TInt GetFrequencyBandRange(TFrequency& aBottomFrequency, TFrequency& aTopFrequency);
-
- /**
- Request to be notified when the tuned frequency or channel changes, or when the
- tuner changes state (e.g. starts playing or recording)
-
- @param aObserver The object wishing to receive tuning change events
- @return A standard system error code
- */
- IMPORT_C TInt NotifyChange(MMMTunerChangeObserver& aObserver);
-
- /**
- Cancel request to be notified when the tuned frequency or channel changes
- */
- IMPORT_C void CancelNotifyChange();
-
- /**
- Send a synchronous custom command to the tuner.
-
- @param aFunction The function number to indicate which function is to be called
- on the interface defined by the first IPC argument
- @param aArgs The IPC arguments to send to the tuner. The first of these
- arguments must be the UID of the interface within the tuner to which the
- command is destined, represented as an integer. Failure to set the first
- argument properly will result in the command completing with
- KErrNotSupported at best, but possibly the client being panicked.
- @return A standard system error code
- */
- IMPORT_C TInt CustomCommandSync(TInt aFunction, const TIpcArgs& aArgs);
-
- /**
- Send an asynchronous custom command to the tuner.
-
- @param aFunction The function number to indicate which function is to be called
- on the interface defined by the first IPC argument
- @param aArgs The IPC arguments to send to the tuner. The first of these
- arguments must be the UID of the interface within the tuner to which the
- command is destined, represented as an integer. Failure to set the first
- argument properly will result in the command completing with
- KErrNotSupported at best, but possibly the client being panicked.
- @param aStatus The TRequestStatus of an active object. This will contain the
- result of the request on completion. The exact range of result values is
- dependent on the interface.
- */
- IMPORT_C void CustomCommandAsync(TInt aFunction, const TIpcArgs& aArgs, TRequestStatus& aStatus);
-
- /**
- Get the Tuner Player Utility
-
- @param aAccessPriority A variable to which the current priority will be written.
- @return A standard system error code.
- */
- IMPORT_C CMMTunerAudioPlayerUtility* TunerPlayerUtilityL(MMMTunerAudioPlayerObserver& aObserver) ;
- /**
- Get the Tuner Recorder Utility
-
- @param aAccessPriority A variable to which the current priority will be written.
- @return A standard system error code.
- */
- IMPORT_C CMMTunerAudioRecorderUtility* TunerRecorderUtilityL(MMMTunerAudioRecorderObserver& aObserver) ;
-
- /**
- Get the Tuner Scanner Utility
-
- @param aAccessPriority A variable to which the current priority will be written.
- @return A standard system error code.
- */
- IMPORT_C CMMTunerScannerUtility* TunerScannerUtilityL() ;
-
- /**
- Get the Tuner Rds Utility
-
- @param aAccessPriority A variable to which the current priority will be written.
- @return A standard system error code.
- */
- IMPORT_C CMMRdsTunerUtility* TunerRdsUtilityL() ;
-
-private:
- CMMTunerUtility();
-protected:
- class CBody;
-private:
- CBody* iBody;
-};
-
-/**
-The Tuner Observer mixin class defines asynchronous
-event completion function callbacks
-*/
-class MMMTunerObserver
-{
-public:
- /**
- Tune complete event. This event is asynchronous
- and is received after a call to the Tune method.
-
- @param aError A standard system error
- */
- virtual void MToTuneComplete(TInt aError) = 0;
-
-};
-
-/**
-The Tuner Change Observer mixin class defines the interface via which
-notification for changes to the tuned frequency, channel and other tuner
-state can be received. A client interested in these notifications
-should call the function CMMTunerUtility::NotifyChange.
-*/
-class MMMTunerChangeObserver
-{
-public:
- /**
- Called when the tuned frequency changes
-
- @param aOldFrequency The frequency in use before the change
- @param aNewFrequency The new tuned frequency
- */
- virtual void MTcoFrequencyChanged(const TFrequency& aOldFrequency, const TFrequency& aNewFrequency) = 0;
-
- /**
- Called when the state of the tuner changes.
-
- @param aOldState The old state. Bits are set according to TTunerState.
- @param aNewState The new state. Bits are set according to TTunerState.
- */
- virtual void MTcoStateChanged(const TUint32& aOldState, const TUint32& aNewState) = 0;
-
- /**
- This function is called when an external antenna is detached from the device.
- This does not necessarily indicate that the tuner can no longer be used; the
- capabilities of the tuner indicate if the external antenna is required in order
- to use the tuner.
- */
- virtual void MTcoAntennaDetached() = 0;
-
- /**
- This function is called when an external antenna is attached to the device. If
- the antenna is required to use the tuner, this indicates that the tuner can be
- used again.
- */
- virtual void MTcoAntennaAttached() = 0;
-
- /**
- This function is called when the device enters or leaves flight mode. If the tuner
- cannot be used in flight mode when the device enters this mode, this indicates
- that the tuner can no longer be used; the capabilities of the tuner indicate if
- it can be used in flight mode or not.
-
- @param aFlightMode ETrue if the device has just entered flight mode, EFalse if
- flight mode has just been left.
- */
- virtual void FlightModeChanged(TBool aFlightMode) = 0;
-};
-
-/**
-The stereo observer mixin class defines the interface by which clients can be
-notified when a stereo signal is received/lost. An interested client should call
-the function CMMTunerUtility::NotifyStereoChange.
-*/
-class MMMTunerStereoObserver
-{
-public:
- /**
- Called when stereo reception is lost/restored.
-
- @param aStereo If true, indicates that stereo reception has just been restored.
- If false, indicates that stereo reception has just been lost.
- */
- virtual void MTsoStereoReceptionChanged(TBool aStereo) = 0;
-
- /**
- Called when a client enables/disabled forced mono reception.
-
- @param aForcedMono ETrue if reception is forced to be mono, even when a stereo
- signal is available.
- */
- virtual void MTsoForcedMonoChanged(TBool aForcedMono) = 0;
-};
-
-/**
-This mixin class should be derived from by clients wishing to receive
-notifications when the signal strength changes. Such a client should call
-function CMMTunerUtility::NotifySignalStrength.
-*/
-class MMMSignalStrengthObserver
-{
-public:
- /**
- Callback indicating that the signal strength has changed by an amount meriting
- a notification.
-
- @param aNewSignalStrength The new signal strength.
- */
- virtual void MssoSignalStrengthChanged(TInt aNewSignalStrength) = 0;
-};
-
-
-class MMMAudioResourceNotificationCallback;
-
-/**
-The Tuner Audio Player Utility is used to initiate and control playback of audio
-from the tuner.
-*/
-class CMMTunerAudioPlayerUtility : public CBase, public MCustomCommand
-{
- friend class CMMTunerUtility::CBody;
-public:
-
- IMPORT_C ~CMMTunerAudioPlayerUtility();
-
- /**
- Set-up the API for playing the output from tuner to the speaker asynchronously.
- Calls MMMTunerAudioPlayerObserver::MTapoInitializeComplete on completion. This must be
- called before Play.
-
- @param aPriority Sound device priority value
- @param aPref Sound device priority preference value
- */
- IMPORT_C void InitializeL(TInt aAudioPriority = EMdaPriorityNormal, TMdaPriorityPreference aPref = EMdaPriorityPreferenceTimeAndQuality);
-
- /**
- Start playback of the tuner output. To stop playback, call Mute, or Stop if
- play will not need to be restarted. InitializeL() must have already been
- called, and a callback to MTapoInitializeComplete with an error of KErrNone must
- have occurred; if this is not the case, this raises a TunerAudioPlay 1 panic.
- */
- IMPORT_C void Play();
-
- /**
- Mute or unmute playback.
-
- Raises a TunerAudioPlay 1 panic if the player is not properly initialized.
-
- @param aMute ETrue to mute the audio, EFalse to unmute it.
- @return A standard system error code
- */
- IMPORT_C TInt Mute(TBool aMute);
-
- /**
- Stop playback, and release the output device for use by other clients
-
- Raises a TunerAudioPlay 1 panic if the player is not properly initialized.
-
- Playback should already be under way.
- */
- IMPORT_C void Stop();
-
- /**
- Set the current audio priority. This priority is used to arbitrate
- between multiple audio sources trying to access the audio hardware.
-
- @param aPriority A priority between EMdaPriorityMin and EMdaPriorityMax
- @param aPref Time vs Quality priority preferences, enumerated in TMdaPriorityPreference
- @return A standard system error code
- */
- IMPORT_C TInt SetPriority(TInt aPriority, TMdaPriorityPreference aPref);
-
- /**
- Get the current audio priority. This is used to arbitrate between simultaneous
- accesses to the sound hardware.
-
- @param aPriority A priority between EMdaPriorityMin and EMdaPriorityMax to return
- @param aPref Time vs Quality priority preferences to return, enumerated in TMdaPriorityPreference
- @return A standard system error code
- */
- IMPORT_C TInt GetPriority(TInt& aPriority, TMdaPriorityPreference& aPref) const;
-
- /**
- Set the volume to the specified level
-
- Raises a TunerAudioPlay 1 panic if the player is not properly initialized.
-
- @param aVolume The volume level to set
- @return A standard system error code
- */
- IMPORT_C TInt SetVolume(TInt aVolume);
-
- /**
- Return the current volume
-
- @param aVolume The variable to set to the current volume
- @return A standard system error code
- */
- IMPORT_C TInt GetVolume(TInt& aVolume) const;
-
- /**
- Define a volume ramp, aRampInterval defining
- the interval between valid volume settings
-
- Raises a TunerAudioPlay 1 panic if the player is not properly initialized.
-
- @param aRampInterval The time interval over which the volume
- should be increased from zero to the current volume setting
- @return A standard system error code
- */
- IMPORT_C TInt SetVolumeRamp(const TTimeIntervalMicroSeconds& aRampInterval);
-
- /**
- Return the maximum volume supported
-
- @return The maximum volume setting permitted
- */
- IMPORT_C TInt MaxVolume() const;
-
- /**
- Set the stereo balance between left and right channels
-
- Raises a TunerAudioPlay 1 panic if the player is not properly initialized.
-
- @param aBalance The balance value to set - must be between
- KMMFBalanceMaxLeft and KMMFBalanceMaxRight
- @return A standard system error code
- */
- IMPORT_C TInt SetBalance(TInt aBalance = KMMFBalanceCenter);
-
- /**
- Return the current stereo balance
-
- @param aBalance The variable to set to the current balance
- @return A standard system error code
- */
- IMPORT_C TInt GetBalance(TInt& aBalance) const;
-
- /**
- Register for audio resource notifications, in the event that the audio resource is lost due to pre-emption
- by a higher priority audio client.
- */
- IMPORT_C TInt RegisterAudioResourceNotification(MMMAudioResourceNotificationCallback& aCallback, TUid aNotificationEventUid, const TDesC8* aNotificationRegistrationData = NULL);
-
- /**
- Cancel an outstanding audio resource notification.
- */
- IMPORT_C void CancelRegisterAudioResourceNotification(TUid aNotificationEventId);
-
- /**
- Returns the controller implementation information associated with the current controller, if any.
-
- @return The controller implementation structure associated with the controller
- @leave KErrNotFound if no controller is in use.
- */
- IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
-
- /**
- Send a synchronous custom command to the playback controller, if ones exists.
-
- @param aDestination The destination of the message, consisting of the uid of
- the interface of this message
- @param aFunction The function number to indicate which function is to be called
- on the interface defined in the aDestination parameter
- @param aDataTo1 The first chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataTo2 The second chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @return A standard system error code
- */
- IMPORT_C TInt CustomCommandSync(
- const TMMFMessageDestinationPckg& aDestination,
- TInt aFunction,
- const TDesC8& aDataTo1,
- const TDesC8& aDataTo2);
-
- /**
- Send a synchronous custom command to the playback controller, if ones exists.
-
- @param aDestination The destination of the message, consisting of the uid of
- the interface of this message
- @param aFunction The function number to indicate which function is to be called
- on the interface defined in the aDestination parameter
- @param aDataTo1 The first chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataTo2 The second chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataFrom The area of memory to which the controller framework
- will write any data to be passed back to the client. Can't be KNullDesC8.
- @return A standard system error code
- */
- IMPORT_C TInt CustomCommandSync(
- const TMMFMessageDestinationPckg& aDestination,
- TInt aFunction,
- const TDesC8& aDataTo1,
- const TDesC8& aDataTo2,
- TDes8& aDataFrom);
-
- /**
- Send an asynchronous custom command to the playback controller, if ones exists.
-
- @param aDestination The destination of the message, consisting of the uid of
- the interface of this message
- @param aFunction The function number to indicate which function is to be called
- on the interface defined in the aDestination parameter
- @param aDataTo1 The first chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataTo2 The second chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aStatus The TRequestStatus of an active object. This will contain the
- result of the request on completion. The exact range of result values is
- dependent on the interface.
- */
- IMPORT_C void CustomCommandAsync(
- const TMMFMessageDestinationPckg& aDestination,
- TInt aFunction,
- const TDesC8& aDataTo1,
- const TDesC8& aDataTo2,
- TRequestStatus& aStatus);
-
- /**
- Send an asynchronous custom command to the playback controller, if ones exists.
-
- @param aDestination The destination of the message, consisting of the uid of
- the interface of this message
- @param aFunction The function number to indicate which function is to be called
- on the interface defined in the aDestination parameter
- @param aDataTo1 The first chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataTo2 The second chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataFrom The area of memory to which the controller framework
- will write any data to be passed back to the client. Can't be KNullDesC8.
- @param aStatus The TRequestStatus of an active object. This will contain the
- result of the request on completion. The exact range of result values is
- dependent on the interface.
- */
- IMPORT_C void CustomCommandAsync(
- const TMMFMessageDestinationPckg& aDestination,
- TInt aFunction,
- const TDesC8& aDataTo1,
- const TDesC8& aDataTo2,
- TDes8& aDataFrom,
- TRequestStatus& aStatus);
-
-protected:
- /**
- Factory function to create a new Tuner Audio Player utility. Note that only one audio player
- utility may be created per instance of CMMTunerUtility. Multiple instances will result in an
- error of KErrAlreadyExists when InitializeL() is called.
-
- @param aTuner The tuner object which this utility will play the audio from.
- @param aObserver The observer of the player utility to receive asychronous completion and
- notifiction callbacks.
- @leave KErrNoMemory Out of memory
- @leave KErrNotSupported If the given tuner doesn't support audio playback.
- @return A new tuner audio player utility.
- */
- static CMMTunerAudioPlayerUtility* NewL(CMMTunerUtility& aTuner, RRadioSession& aRadioSession, MMMTunerAudioPlayerObserver& aObserver);
-
-private:
- CMMTunerAudioPlayerUtility();
-private:
- class CBody;
- CBody* iBody;
-};
-
-class MMMTunerAudioPlayerObserver
-{
-public:
- /**
- The TEvent enumeration is used to indicate which type of event is being sent to the client.
- Each event will be associated with an error code and potentially some addition information,
- and will be passed to the client via method MTapoPlayEvent().
- */
- enum TEventType
- {
- /** An event relating to the tuner itself. Any error other than KErrNone associated
- with this event type may indicate that the tuner cannot be used anymore.
-
- No additional information is associated with this type of event. */
- ETunerEvent,
- /**
- An event relating to audio playback.
-
- No additional information is associated with this type of event.
- */
- EAudioEvent
- };
-public:
- /**
- Initialize complete event. This event is asynchronous and is received after
- a call to CMMTunerAudioPlayerUtility::InitializeL().
-
- @param aError A standard system error
- */
- virtual void MTapoInitializeComplete(TInt aError) = 0;
-
- /**
- Passes an asychronous event to the tuner client.
-
- @param aEvent The type of event. See enumeration MMMTunerAudioPlayerObserver::TEventType
- for more information about when the event types mean.
- @param aError An error code associated with the event.
- @param aAdditionalInfo Any additional information associated with the event, or NULL if
- no such additional information exists.
- */
- virtual void MTapoPlayEvent(TEventType aEvent, TInt aError, TAny* aAdditionalInfo) = 0;
-};
-
-/**
-This class is used to perform recording of audio from the tuner. Many of the methods
-in this class have identical functionality to similarly names functions in class
-CMdaAudioRecorderUtility.
-*/
-class CMMTunerAudioRecorderUtility : public CBase
-{
- friend class CMMTunerUtility::CBody;
-public:
-
- IMPORT_C ~CMMTunerAudioRecorderUtility();
-
- /**
- Initialize for recording from the tuner to the specified file
- asynchronously. Calls MMMTunerAudioRecorderObserver::MTaroInitializeComplete on completion
-
- @param aRecordFilename The name of the file to create, if necessary, and record to
- @param "aDestinationDataType" Data type for recording
- @param "aControllerUid" The Uid of the controller to use for recording
- @param "aDestinationFormatUid" Uid of record format
- @param aPriority Sound device priority value
- @param aPref Sound device priority preference value
- */
- IMPORT_C void InitializeL(const TDesC& aRecordFilename,
- TFourCC aDestinationDataType = KFourCCNULL,
- TUid aControllerUid=KNullUid,
- TUid aDestinationFormatUid=KNullUid,
- TInt aAudioPriority = EMdaPriorityNormal,
- TMdaPriorityPreference aPref = EMdaPriorityPreferenceTimeAndQuality);
-
- /**
- Initialize for recording from the tuner to the specified descriptor
- asynchronously. Calls MMMTunerAudioRecorderObserver::MTaroInitializeComplete on completion
-
- @param aRecordDescriptor The descriptor to record to
- @param "aDestinationDataType" Data type for recording
- @param "aControllerUid" The Uid of the controller to use for recording
- @param "aDestinationFormatUid" Uid of record format
- @param aPriority Sound device priority value
- @param aPref Sound device priority preference value
- */
- IMPORT_C void InitializeL(TDes8& aRecordDescriptor,
- TFourCC aDestinationDataType = KFourCCNULL,
- TUid aControllerUid=KNullUid,
- TUid aDestinationFormatUid=KNullUid,
- TInt aAudioPriority = EMdaPriorityNormal,
- TMdaPriorityPreference aPref = EMdaPriorityPreferenceTimeAndQuality);
-
- /**
- Return a list of the supported data types for the record destination
- @param "aSupportedDataTypes" list of four character codes, representing supported data
- encodings for the record destination.
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C void GetSupportedDestinationDataTypesL(RArray<TFourCC>& aSupportedDataTypes) const;
-
- /**
- Set the data type of the destination audio clip
- @param "aDataType" four character code, representing the encoding of the destination audio clip
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C void SetDestinationDataTypeL(TFourCC aDataType);
-
- /**
- Return the data type of the destination audio clip
- @returns four character code, representing the encoding of the destination audio clip
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C TFourCC DestinationDataTypeL() const;
-
- /**
- Set the bit rate for recording
- @param "aBitRate" destination bit rate in bits/second
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C void SetDestinationBitRateL(TUint aBitRate);
-
- /**
- Return the recording bit rate
- @returns destination bit rate in bits/second
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C TUint DestinationBitRateL() const;
-
- /**
- Return a list of the supported bit rates for recording
- @param "aSupportedBitRates" List of bit rates supported for the record
- destination
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C void GetSupportedBitRatesL(RArray<TUint>& aSupportedBitRates) const;
-
- /**
- Set the sample rate for the record destination
- @param "aSampleRate" The sample rate of the record destination
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C void SetDestinationSampleRateL(TUint aSampleRate);
-
- /**
- Return the sample rate of the record destination
- @returns The sample rate of the record destination
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C TUint DestinationSampleRateL() const;
-
- /**
- Get a list of supported recording sample rates.
- @param "aSupportedSampleRates" List of the sample rates that are supported for
- recording
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C void GetSupportedSampleRatesL(RArray<TUint>& aSupportedSampleRates) const;
-
- /**
- Set the format of the audio clip. This can only be done if the audio clip does not
- exist
-
- @param "aFormatUid" Uid of the audio clip format
- @leaves KErrAlreadyExists if the clip already exists and the format is different
- from the existing format, or can leave with one of the system-wide error codes
- */
- IMPORT_C void SetDestinationFormatL(TUid aFormatUid);
-
- /**
- Return the format of the audio clip
- @returns Uid of the audio clip format
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C TUid DestinationFormatL() const;
-
- /**
- Set the number of channels for the recorded audio clip
- @param "aNumberOfChannels" The number of channels to record
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C void SetDestinationNumberOfChannelsL(TUint aNumberOfChannels);
-
- /**
- Return the number of channels in audio clip
- @returns number of channels supported by audio clip
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C TUint DestinationNumberOfChannelsL() const;
-
- /**
- Return a list of the supported number of channels for recording
- @param "aSupportedNumChannels" List of the number of channels supported for
- recording
- @leaves Can leave with one of the system-wide error codes
- */
- IMPORT_C void GetSupportedNumberOfChannelsL(RArray<TUint>& aSupportedNumChannels) const;
-
- /** Start recording of the tuner output */
- IMPORT_C void RecordL();
-
- /**
- Pause recording. Recording can be resumed with another call to Record.
-
- @return A standard system error code
- */
- IMPORT_C TInt PauseRecord();
-
- /**
- Stop recording, and release the output device for use by other clients
-
- Recording should already be under way.
- */
- IMPORT_C void Stop();
-
- /**
- Stop recording, and release the output device for use by other clients
-
- Recording should already be under way.
- */
- IMPORT_C void Close();
-
- /**
- Return the maximum value for the gain
-
- @return The maximum gain. For devices where automatic gain control is used, this value may be zero.
- */
- IMPORT_C TInt MaxGain() const;
-
- /**
- Sets the gain for the audio device to a specified value.
-
- @param aGain The gain setting. This can be any value from zero to the value returned by a call to
- MaxGain(). A value which is less than zero is set to zero. A value which is greater than
- MaxGain() is set to MaxGain().
- */
- IMPORT_C void SetGain(TInt aGain);
-
- /**
- Sets the current recording balance setting between the left and right stereo channels
-
- The balance can be changed before or during recording and is effective immediately.
-
- @param aBalance The balance value to set. Any value between KMMFBalanceMaxLeft and
- KMMFBalanceMaxRight, the default value being KMMFBalanceCenter.
- @return An error code indicating if the call was successful. KErrNone on success,
- otherwise another of the system-wide error codes.
- */
- IMPORT_C TInt SetRecordBalance(TInt aBalance = KMMFBalanceCenter);
-
- /**
- Returns the current recording balance setting between the left and right stereo channels.
-
- @param aBalance On return, contains the current recording balance between KMMFBalanceMaxLeft
- and KMMFBalanceMaxRight.
- @return An error code indicating if the call was successful. KErrNone on success, otherwise
- another of the system-wide error codes.
- */
- IMPORT_C TInt GetRecordBalance(TInt& aBalance) const;
-
- /**
- Set the current audio priority. This priority is used to arbitrate
- between multiple audio sources trying to access the audio hardware.
-
- @param aPriority A priority between EMdaPriorityMin and EMdaPriorityMax
- @param aPref Time vs Quality priority preferences, enumerated in TMdaPriorityPreference
- @return A standard system error code
- */
- IMPORT_C TInt SetPriority(TInt aPriority, TMdaPriorityPreference aPref);
-
- /**
- Get the current audio priority. This is used to arbitrate between simultaneous
- accesses to the sound hardware.
-
- @param aPriority A priority between EMdaPriorityMin and EMdaPriorityMax to return
- @param aPref Time vs Quality priority preferences to return, enumerated in TMdaPriorityPreference
- @return A standard system error code
- */
- IMPORT_C TInt GetPriority(TInt& aPriority, TMdaPriorityPreference& aPref) const;
-
- /**
- Register for audio resource notifications, in the event that the audio resource is lost due to pre-emption
- by a higher priority audio client.
- */
- IMPORT_C TInt RegisterAudioResourceNotification(MMMAudioResourceNotificationCallback& aCallback, TUid aNotificationEventUid, const TDesC8* aNotificationRegistrationData = NULL);
-
- /**
- Cancel an outstanding audio resource notification.
- */
- IMPORT_C void CancelRegisterAudioResourceNotification(TUid aNotificationEventId);
-
-
- /**
- Sets the maximum size for a file that is being recorded.
-
- When this limit is reached, MMF stops recording and notifies the client application. Notification is caused
- by MMdaObjectStateChangeObserver::MoscoStateChangeEvent() with the error code KErrEof.
-
- This function is provided so that applications such as recorders can limit the amount of file storage/memory
- that should be allocated.
-
- @param aMaxWriteLength
- The maximum file size in kilobytes. If the default value is used, there is no maximum file size.
-
- */
- IMPORT_C void SetMaxWriteLength(TInt aMaxWriteLength = KMdaClipLocationMaxWriteLengthNone);
-
- /**
- Returns the recording time available for the selected file or descriptor and encoding format.
- */
- IMPORT_C const TTimeIntervalMicroSeconds& RecordTimeAvailable();
-
- /**
- Returns the duration of the audio sample data.
- */
- IMPORT_C const TTimeIntervalMicroSeconds& Duration();
-
- /**
- Return the controller implementation information structure of the current controller
-
- @leave KErrNoMemory Out of memory
- @return A reference to the current controller information
- */
- IMPORT_C const CMMFControllerImplementationInformation& ControllerImplementationInformationL();
-
- /*
- Returns the number of meta data entries associated with this clip.
- @return Number of metadata entries
- */
- IMPORT_C TInt GetNumberOfMetaDataEntries(TInt& aNumEntries);
-
- /*
- Returns the specified meta data entry from the current audio clip.
- @return Metadata entry
- */
- IMPORT_C CMMFMetaDataEntry* GetMetaDataEntryL(TInt aMetaDataIndex);
-
- /*
- Adds a meta data entry to the audio clip.
- */
- IMPORT_C void AddMetaDataEntryL(CMMFMetaDataEntry& aMetaDataEntry);
-
- /*
- Removes a specified meta data entry from the audio clip
- @return An error code indicating if the call was successful
- */
- IMPORT_C TInt RemoveMetaDataEntry(TInt aMetaDataIndex);
-
- /*
- Replaces the specified meta data entry with a new entry
- */
- IMPORT_C void ReplaceMetaDataEntryL(TInt aMetaDataIndex, CMMFMetaDataEntry& aMetaDataEntry);
-
-
- /**
- Send a synchronous custom command to the recording controller
-
- @param aDestination The destination of the message, consisting of the uid of
- the interface of this message
- @param aFunction The function number to indicate which function is to be called
- on the interface defined in the aDestination parameter
- @param aDataTo1 The first chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataTo2 The second chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @return A standard system error code
- */
- IMPORT_C TInt CustomCommandSync(
- const TMMFMessageDestinationPckg& aDestination,
- TInt aFunction,
- const TDesC8& aDataTo1,
- const TDesC8& aDataTo2);
-
- /**
- Send a synchronous custom command to the recording controller
-
- @param aDestination The destination of the message, consisting of the uid of
- the interface of this message
- @param aFunction The function number to indicate which function is to be called
- on the interface defined in the aDestination parameter
- @param aDataTo1 The first chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataTo2 The second chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataFrom The area of memory to which the controller framework
- will write any data to be passed back to the client. Can't be KNullDesC8.
- @return A standard system error code
- */
- IMPORT_C TInt CustomCommandSync(
- const TMMFMessageDestinationPckg& aDestination,
- TInt aFunction,
- const TDesC8& aDataTo1,
- const TDesC8& aDataTo2,
- TDes8& aDataFrom);
-
- /**
- Send an asynchronous custom command to the recording controller
-
- @param aDestination The destination of the message, consisting of the uid of
- the interface of this message
- @param aFunction The function number to indicate which function is to be called
- on the interface defined in the aDestination parameter
- @param aDataTo1 The first chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataTo2 The second chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aStatus The TRequestStatus of an active object. This will contain the
- result of the request on completion. The exact range of result values is
- dependent on the interface.
- @return A standard system error code
- */
- IMPORT_C void CustomCommandAsync(
- const TMMFMessageDestinationPckg& aDestination,
- TInt aFunction,
- const TDesC8& aDataTo1,
- const TDesC8& aDataTo2,
- TRequestStatus& aStatus);
-
- /**
- Send an asynchronous custom command to the recording controller
-
- @param aDestination The destination of the message, consisting of the uid of
- the interface of this message
- @param aFunction The function number to indicate which function is to be called
- on the interface defined in the aDestination parameter
- @param aDataTo1 The first chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataTo2 The second chunk of data to be copied to the controller
- framework. The exact contents of the data are dependent on the
- interface being called. Can be KNullDesC8.
- @param aDataFrom The area of memory to which the controller framework
- will write any data to be passed back to the client. Can't be KNullDesC8.
- @param aStatus The TRequestStatus of an active object. This will contain the
- result of the request on completion. The exact range of result values is
- dependent on the interface.
- @return A standard system error code
- */
- IMPORT_C void CustomCommandAsync(
- const TMMFMessageDestinationPckg& aDestination,
- TInt aFunction,
- const TDesC8& aDataTo1,
- const TDesC8& aDataTo2,
- TDes8& aDataFrom,
- TRequestStatus& aStatus);
-
-protected:
- /**
- Create a new audio recorder utility. Note that only one audio recorder utility may be created
- per instance of CMMTunerUtility. Multiple instances will result in an error of KErrAlreadyExists
- when InitializeL() is called.
- */
- static CMMTunerAudioRecorderUtility* NewL(CMMTunerUtility& aTuner, MMMTunerAudioRecorderObserver& aObserver);
-
-private:
- CMMTunerAudioRecorderUtility();
-private:
- class CBody;
- CBody* iBody;
-
-};
-
-class MMMTunerAudioRecorderObserver
-{
-public:
- /**
- The TEvent enumeration is used to indicate which type of event is being sent to the client.
- Each event will be associated with an error code and potentially some addition information,
- and will be passed to the client via method MTaroRecordEvent().
- */
- enum TEventType
- {
- /** An event relating to the tuner itself. Any error other than KErrNone associated
- with this event type may indicate that the tuner cannot be used anymore.
-
- No additional information is associated with this type of event. */
- ETunerEvent,
- /**
- An event relating to audio recording.
-
- No additional information is associated with this type of event.
- */
- EAudioEvent
- };
-public:
- /**
- Initialize complete event. This event is asynchronous and is received after
- a call to CMMTunerAudioRecorderUtility::InitializeL.
-
- @param aError A standard system error
- */
- virtual void MTaroInitializeComplete(TInt aError) = 0;
-
- /**
- Passes an asychronous event to the tuner client.
-
- @param aEvent The type of event. See enumeration MMMTunerAudioRecorderObserver::TEventType
- for more information about when the event types mean.
- @param aError An error code associated with the event.
- @param aAdditionalInfo Any additional information associated with the event, or NULL if
- no such additional information exists.
- */
- virtual void MTaroRecordEvent(TEventType aEvent, TInt aError, TAny* aAdditionalInfo) = 0;
-};
-
-/**
-This class augments CMMTunerUtility to provide station scanning functionality,
-whereby the frequency spectrum is searched, pausing for a specified amount of
-time when a station is found.
-*/
-class CMMTunerScannerUtility : public CBase
-{
- friend class CMMTunerUtility::CBody;
-public:
-
- IMPORT_C ~CMMTunerScannerUtility();
-
- /**
- Continuously scan for a radio station, pausing for the time specified before
- continuing on to the next station. Call StopScan to select the currently tuned
- station. The search is limited to the specified band.
-
- @note The control of a CMMTunerUtility object must have been passed to this
- class (using TransferTunerControl) before this function is called.
-
- @param aBand The band to which aStartFrequency belongs
- @param aSearchDirect The direction to search in
- @param aPauseDuration Time to pause at each station
- @param aCircularScan If set to ETrue the station scan will loop back to the other
- end of the band once the end of the band has been reached. (Defaults to ETrue)
- */
- IMPORT_C void StationScan(CMMTunerUtility::TSearchDirection aSearchDirection,
- TTimeIntervalMicroSeconds32 aPauseDuration
- );
-
- /**
- Stop scanning and use the currently tuned station
-
- @return ETrue if a station is tuned, EFalse otherwise
- */
- IMPORT_C TBool StopScan();
-
-protected:
- /**
- Factory function to create a new CMMTunerScannerUtility.
-
- @param aTuner The tuner with which to perform the scanning.
- @leave KErrNoMemory Out of memory.
- @return A newly contructed tuner scanner utility.
- */
- static CMMTunerScannerUtility* NewL(CMMTunerUtility& aTuner,CMMTunerUtility::TTunerBand aBand);
-
-private:
- CMMTunerScannerUtility();
-private:
- class CBody;
- CBody* iBody;
-
-};
-
-
-/** Programme Station name, 8 characters */
-typedef TBuf<8> TRdsStationName;
-/** Programme Type Name, 8 characters */
-typedef TBuf<8> TRdsProgrammeTypeName;
-/** RDS Programme Identifier, a unique ID for each radio station */
-typedef TInt TRdsProgrammeIdentifier;
-
-/**
-Programme Item Number - identifies the start time of the current programme,
-as published by the broadcaster.
-*/
-class TRdsProgrammeItemNumber
-{
-public:
- /** The day of the month of the broadcast, in the range 1-31 */
- TInt iDayOfMonth;
- /** The hour of the day, in the range 0-23 */
- TInt iHour;
- /** The minute past the hour, in the range 0-59 */
- TInt iMinute;
-public:
- inline TInt operator==(const TRdsProgrammeItemNumber& aPin) const;
- inline TInt operator!=(const TRdsProgrammeItemNumber& aPin) const;
-};
-
-/**
-An RDS extended country code. The meaning of a value of this type is defined
-by the RDS specification, IEC62106.
-*/
-typedef TInt TRdsCountryCode;
-
-/**
-An RDS language identification code. The meaning of a value of this type is
-defined by the RDS specification, IEC62106.
-*/
-typedef TInt TRdsLanguageIdentifier;
-
-/**
-RDS Programme Type.
-
-The interpretation of values of this type depends on the origin of the RDS
-broadcast: in North America, a slightly different standard, RBDS, is used.
-These PTY codes are defined by static values KRbdsPtyXxxxx, for example
-KRbdsPtySoftRock.
-
-Elsewhere, including Europe, the RDS standard is used. In these areas, the
-PTY codes are defined by static values KRdsPtyXxxxx, for example
-KRdsPtyChildrensProgrammes.
-
-In all other important aspects, the European RDS and North American RBDS
-standards are identical.
-*/
-typedef TInt TRdsProgrammeType;
-
-/** No programme type or undefined */
-const static TRdsProgrammeType KRdsPtyNone = 0;
-/** News */
-const static TRdsProgrammeType KRdsPtyNews = 1;
-/** CurrentAffairs */
-const static TRdsProgrammeType KRdsPtyCurrentAffairs = 2;
-/** Information */
-const static TRdsProgrammeType KRdsPtyInformation = 3;
-/** Sport */
-const static TRdsProgrammeType KRdsPtySport = 4;
-/** Education */
-const static TRdsProgrammeType KRdsPtyEducation = 5;
-/** Drama */
-const static TRdsProgrammeType KRdsPtyDrama = 6;
-/** Culture */
-const static TRdsProgrammeType KRdsPtyCulture = 7;
-/** Science */
-const static TRdsProgrammeType KRdsPtyScience = 8;
-/** VariedSpeech */
-const static TRdsProgrammeType KRdsPtyVariedSpeech = 9;
-/** PopMusic */
-const static TRdsProgrammeType KRdsPtyPopMusic = 10;
-/** RockMusic */
-const static TRdsProgrammeType KRdsPtyRockMusic = 11;
-/** EasyListening */
-const static TRdsProgrammeType KRdsPtyEasyListening = 12;
-/** LightClassical */
-const static TRdsProgrammeType KRdsPtyLightClassical = 13;
-/** SeriousClassics */
-const static TRdsProgrammeType KRdsPtySeriousClassical = 14;
-/** OtherMusic */
-const static TRdsProgrammeType KRdsPtyOtherMusic = 15;
-/** Weather */
-const static TRdsProgrammeType KRdsPtyWeather = 16;
-/** Finance */
-const static TRdsProgrammeType KRdsPtyFinance = 17;
-/** ChildrensProgrammes */
-const static TRdsProgrammeType KRdsPtyChildrensProgrammes = 18;
-/** SocialAffairs */
-const static TRdsProgrammeType KRdsPtySocialAffairs = 19;
-/** Religion */
-const static TRdsProgrammeType KRdsPtyReligion = 20;
-/** PhoneIn */
-const static TRdsProgrammeType KRdsPtyPhoneIn = 21;
-/** Travel */
-const static TRdsProgrammeType KRdsPtyTravel = 22;
-/** Leisure */
-const static TRdsProgrammeType KRdsPtyLeisure = 23;
-/** JazzMusic */
-const static TRdsProgrammeType KRdsPtyJazzMusic = 24;
-/** CountryMusic */
-const static TRdsProgrammeType KRdsPtyCountryMusic = 25;
-/** NationalMusic */
-const static TRdsProgrammeType KRdsPtyNationalMusic = 26;
-/** OldiesMusic */
-const static TRdsProgrammeType KRdsPtyOldiesMusic = 27;
-/** FolkMusic */
-const static TRdsProgrammeType KRdsPtyFolkMusic = 28;
-/** Documentary */
-const static TRdsProgrammeType KRdsPtyDocumentary = 29;
-/** AlarmTest */
-const static TRdsProgrammeType KRdsPtyAlarmTest = 30;
-/** Alarm */
-const static TRdsProgrammeType KRdsPtyAlarm = 31;
-
-
-/** No programme type or undefined */
-const static TRdsProgrammeType KRbdsPtyNone = 0;
-/** News */
-const static TRdsProgrammeType KRbdsPtyNews = 1;
-/** Informaion */
-const static TRdsProgrammeType KRbdsPtyInformation = 2;
-/** Sports */
-const static TRdsProgrammeType KRbdsPtySports = 3;
-/** Talk */
-const static TRdsProgrammeType KRbdsPtyTalk = 4;
-/** Rock */
-const static TRdsProgrammeType KRbdsPtyRock = 5;
-/** Classic Rock */
-const static TRdsProgrammeType KRbdsPtyClassicRock = 6;
-/** Adult Hits */
-const static TRdsProgrammeType KRbdsPtyAdultHits = 7;
-/** Soft Rock */
-const static TRdsProgrammeType KRbdsPtySoftRock = 8;
-/** Top 40 */
-const static TRdsProgrammeType KRbdsPtyTop40 = 9;
-/** Country */
-const static TRdsProgrammeType KRbdsPtyCountry = 10;
-/** Oldies */
-const static TRdsProgrammeType KRbdsPtyOldies = 11;
-/** Soft */
-const static TRdsProgrammeType KRbdsPtySoft = 12;
-/** Nostalgia */
-const static TRdsProgrammeType KRbdsPtyNostalgia = 13;
-/** Jazz */
-const static TRdsProgrammeType KRbdsPtyJazz = 14;
-/** Classical */
-const static TRdsProgrammeType KRbdsPtyClassical = 15;
-/** Rhythm and Blues */
-const static TRdsProgrammeType KRbdsPtyRhythmAndBlues = 16;
-/** Soft Rhythm and Blues */
-const static TRdsProgrammeType KRbdsPtySoftRhythmAndBlues = 17;
-/** Language */
-const static TRdsProgrammeType KRbdsPtyLanguage = 18;
-/** Religious Music */
-const static TRdsProgrammeType KRbdsPtyReligiousMusic = 19;
-/** Religious Talk */
-const static TRdsProgrammeType KRbdsPtyReligiousTalk = 20;
-/** Personality */
-const static TRdsProgrammeType KRbdsPtyPersonality = 21;
-/** Public */
-const static TRdsProgrammeType KRbdsPtyPublic = 22;
-/** College */
-const static TRdsProgrammeType KRbdsPtyCollege = 23;
-/** Unassigned */
-const static TRdsProgrammeType KRbdsPtyUnassigned1 = 24;
-/** Unassigned */
-const static TRdsProgrammeType KRbdsPtyUnassigned2 = 25;
-/** Unassigned */
-const static TRdsProgrammeType KRbdsPtyUnassigned3 = 26;
-/** Unassigned */
-const static TRdsProgrammeType KRbdsPtyUnassigned4 = 27;
-/** Unassigned */
-const static TRdsProgrammeType KRbdsPtyUnassigned5 = 28;
-/** Weather */
-const static TRdsProgrammeType KRbdsPtyWeather = 29;
-/** Emergency Test */
-const static TRdsProgrammeType KRbdsPtyEmergencyTest = 30;
-/** Emergency */
-const static TRdsProgrammeType KRbdsPtyEmergency = 31;
-
-/**
-The RDS Capabilities class defines the capabilities of the RDS tuner on the
-device, as retrieved using the function GetRdsCapabilities.
-*/
-class TRdsCapabilities
-{
-public:
- /** RDS Function Bit Flags */
- enum TRdsFunctions
- {
- /** Traffic Announcement */
- ERdsFunctionTa = 0x01,
- /** Regional Links */
- ERdsFunctionRegLink = 0x02,
- /** News Announcement */
- ERdsFunctionNa = 0x04,
- /** Programme Type */
- ERdsFunctionPty = 0x08,
- /** Clock Time */
- ERdsFunctionCt = 0x10,
- /** Enhanced Other Networks */
- ERdsFunctionEon = 0x20,
- /** Alternative Frequency */
- ERdsFunctionAf = 0x40
- };
-public:
- /** Bitfield as defined by ERdsFunctions with the bits of the supported functions set */
- TUint32 iRdsFunctions;
-};
-
-class MMMRdsDataObserver;
-class MMMRdsEonObserver;
-class MMMRdsStateChangeObserver;
-class MMMRdsAnnouncementObserver;
-
-/**
-This class represents the basic RDS data associated with an RDS station.
-*/
-class TRdsData
-{
-public:
- inline TRdsData();
-public:
- /**
- Enumeration to indicate a subset of the members of class TRdsData. These values should
- be bitwise or'ed together to indicate which members belong in a set.
- */
- enum TField
- {
- /** Indicates the the member iPi is in a set */
- EProgrammeIdentifier = 0x001,
- /** Indicates the the member iPs is in a set */
- EStationName = 0x002,
- /** Indicates the the member iTp is in a set */
- ETrafficProgramme = 0x004,
- /** Indicates the the member iTa is in a set */
- ETrafficAnnouncement = 0x008,
- /** Indicates the the member iPty is in a set */
- EProgrammeType = 0x010,
- /** Indicates the the member iPtyn is in a set */
- EProgrammeTypeName = 0x020,
- /** Indicates the the member iPin is in a set */
- EProgrammeItemNumber = 0x040,
- /** Indicates the the member iMs is in a set */
- EMusicSpeech = 0x080,
- /** Indicates the the member iBroadcastLanguage is in a set */
- EBroadcastLanguage = 0x100,
- /** Indicates the the member iEcc is in a set */
- EExtendedCountryCode = 0x200
- };
- /**
- A value indicating a set containig all RDS data encapsulated by class TRdsData.
- */
- const static TUint32 KAllRdsData = (EProgrammeIdentifier | EStationName | ETrafficProgramme | ETrafficAnnouncement
- | EProgrammeType | EProgrammeTypeName | EProgrammeItemNumber | EMusicSpeech
- | EBroadcastLanguage | EExtendedCountryCode);
-public:
- /** Programme Identifier of the station */
- TRdsProgrammeIdentifier iPi;
- /** Programme Station name of the station */
- TRdsStationName iPs;
- /** Value of the Traffic Programme flag of the station */
- TBool iTp;
- /** Value of the Traffic Announcement flag of the station */
- TBool iTa;
- /** Programme Type of the station */
- TRdsProgrammeType iPty;
- /** Programme Type Name of the station */
- TRdsProgrammeTypeName iPtyn;
- /** Programme Item Number of the station */
- TRdsProgrammeItemNumber iPin;
- /** Value of the Music Speech flag of the station. EFalse indicates the speech is being
- broadcast at present. ETrue indicates that music is being broadcast, or that the flag is
- not in use by the broadcaster. */
- TBool iMs;
- /** The current language of the broadcast */
- TRdsLanguageIdentifier iBroadcastLanguage;
- /** The Extended Country Code of the station */
- TRdsCountryCode iEcc;
-};
-
-/**
-Class representing a station broadcast as an Enhanced Other Networks station.
-*/
-class TEonStation
-{
-public:
- /**
- Enumeration to indicate a subset of the members of class TEonStation. These values should
- be bitwise or'ed together to indicate which members belong in a set.
- */
- enum TField
- {
- /** Indicates that member iProgrammeIdentifier is valid. */
- EProgrammeIdentifier= 0x01,
- /** Indicates that member iStationName is valid. */
- EStationName = 0x02,
- /** Indicates that member iProgrammeType is valid. */
- EProgrammeType = 0x04,
- /** Indicates that member iTrafficProgramme is valid. */
- ETrafficProgramme = 0x08,
- /** Indicates that member iTrafficAnnouncement is valid. */
- ETrafficAnnouncement= 0x10,
- /** Indicates that member iProgrammeItemNumber is valid. */
- EProgrammeItemNumber= 0x20,
- /** Indicates that member iNoFrequencies is valid. */
- ENoFrequencies = 0x40,
- /** Indicates that member iNoMappedFrequencies is valid. */
- ENoMappedFrequencies= 0x80
- };
-public:
- /** The unique identifier of this station */
- TRdsProgrammeIdentifier iProgrammeIdentifier;
- /** The textual name of this station */
- TRdsStationName iStationName;
- /** The current programme type (PTY) of this station */
- TRdsProgrammeType iProgrammeType;
- /** Indicates if this station broadcasts traffic programmes */
- TBool iTrafficProgramme;
- /** Indicates if this station is currently broadcasting a traffic announcement */
- TBool iTrafficAnnouncement;
- /** The programme item number (PIN) of the current broadcast on this station. */
- TRdsProgrammeItemNumber iProgrammeItemNumber;
- /**
- The number of frequencies associated with this station. If this number is zero,
- it may be that the EON station uses the mapped frequencies method instead. See
- iNoMappedFrequencies.
- */
- TInt iNoFrequencies;
- /**
- The number of mapped frequencies associated with this station. If this number is
- zero, it may be that the EON station uses a flat frequency list instead. See
- iNoFrequencies.
- */
- TInt iNoMappedFrequencies;
- /**
- Indicates the subset of fields of the class that are valid. Bits are set according to enumeration
- TEonStation::TField
- */
- TUint32 iValid;
-};
-
-/**
-Mapped frequencies can be broadcast as a part of the EON information. They relate the
-current tuning frequency with the frequency which the referred EON station will be
-broadcast on.
-*/
-class TEonMappedFrequency
-{
-public:
- inline TEonMappedFrequency(TFrequency aTuningFrequency, TFrequency aMappedFrequency);
-public:
- /** The current tuning frequency, relating to the station broadcasting the EON informarion. */
- TFrequency iTuningFrequency;
- /**
- The mapped frequency. If iTunedFrequency matches the currently tuned frequency, the
- EON station will be broadcast on this frequency.
- */
- TFrequency iMappedFrequency;
-};
-
-/**
-The RDS class augments the tuner API to give access to the RDS capabilities
-of the device. As such additional tuner technologies can be supported without
-changing the Tuner API.
-
-Note that despite this class being names 'RDS', it is capable of supporting both
-the RDS standard, and the North American equivilant RBDS. The only important difference
-from the APIs perspective is the interpretation of the Programme Type (PTY) codes. See
-TRdsProgrammeType for more information.
-*/
-class CMMRdsTunerUtility : public CBase
-{
- friend class CMMTunerUtility::CBody;
-public:
- /** RDS Announcement Type */
- enum TAnnouncementType
- {
- /** Traffic announcement */
- ERdsTrafficAnnouncement,
- /** News announcement */
- ERdsNewsAnnouncement
- };
-public:
- /**
- Factory function to create a new instance of the RDS Tuner API
-
- @param aTuner A RDS capable tuner object (check using CMMTunerUtility::GetCapabilities())
- @param aObserver The observer of the tuner to receive asynchronous completion messages.
- @leave KErrNoMemory Out of memory
- @leave KErrNotFound CMMRdsTunerUtility object is not present
- @leave KErrNotSupported RDS is not supported by the tuner
- @return A pointer and ownership of a fully constructed CMMRdsTunerUtility object
- */
- IMPORT_C static CMMRdsTunerUtility* NewL(CMMTunerUtility& aTuner, MMMTunerObserver& aObserver, CMMTunerUtility::TTunerBand aBand);
-
- IMPORT_C ~CMMRdsTunerUtility();
-
- /**
- Get the RDS capabilities of the device
-
- @param aCaps The capabilities object to fill
- @return A standard system error code
- */
- IMPORT_C TInt GetRdsCapabilities(TRdsCapabilities& aCaps) const;
-
- /**
- Find a radio station which contains RDS data starting at the start frequency
- and searching in the direction specified (i.e. Up or down).
-
- @note this function is subject to the same access control scheme as the Tune
- methods of CMMTunerUtility
-
- @param aStartFrequency The frequency to start searching from, or 0 to start at the
- beginning of the stated band.
- @param aBand The frequency band to search. This must be a FM band.
- @param aSearchDirection The direction to search in
- @param aCircularSeek If set to ETrue the station seek will loop back to the
- other end of the band once the end of the band has been reached.
- (Defaults to ETrue) If not set reaching the end of the band without
- finding a station will result in a callback to MToTuneComplete with error
- KErrNotFound.
- */
- IMPORT_C void StationSearchByRds(TFrequency aStartFrequency,
- CMMTunerUtility::TSearchDirection aSearchDirection
- );
-
- /**
- Find a radio station, of the specified programme type starting at the start
- frequency and searching in the direction specified (i.e. Up or down).
-
- @note this function is subject to the same access control scheme as the Tune
- methods of CMMTunerUtility
-
- @param aProgType The type of programme to search for
- @param aStartFrequency The frequency to start searching from, or 0 to start at the
- beginning of the stated band.
- @param aBand The frequency band to search. This must be a FM band.
- @param aSearchDirection The direction to search in
- @param aCircularSeek If set to ETrue the station seek will loop back to the
- other end of the band once the end of the band has been reached.
- (Defaults to ETrue) If not set reaching the end of the band without
- finding a station will result in a callback to MToTuneComplete with error
- KErrNotFound.
- */
- IMPORT_C void StationSearchByProgrammeType(
- TRdsProgrammeType aProgType,
- TFrequency aStartFrequency,
- CMMTunerUtility::TSearchDirection aSearchDirection
- );
-
- /**
- Find a radio station, with the specified programme identifier starting at the
- start frequency and searching in the direction specified (i.e. Up or down).
-
- @note this function is subject to the same access control scheme as the Tune
- methods of CMMTunerUtility
-
- @param aPi The programme identifier of the station to search for
- @param aStartFrequency The frequency to start searching from, or 0 to start at the
- beginning of the stated band.
- @param aBand The frequency band to search. This must be a FM band.
- @param aSearchDirection The direction to search in
- @param aCircularSeek If set to ETrue the station seek will loop back to the other
- end of the band once the end of the band has been reached. (Defaults to ETrue)
- If not set reaching the end of the band without finding a station will result
- in a callback to MToTuneComplete with error KErrNotFound.
- */
- IMPORT_C void StationSearchByProgrammeIdentifier(
- TRdsProgrammeIdentifier aPi,
- TFrequency aStartFrequency,
- CMMTunerUtility::TSearchDirection aSearchDirection
- );
-
- /**
- Find a radio station, with the specified traffic programme flag value starting at
- the start frequency and searching in the direction specified (i.e. Up or down).
-
- @note this function is subject to the same access control scheme as the Tune
- methods of CMMTunerUtility
-
- @param aTp The TP flag value of a station to search for
- @param aStartFrequency The frequency to start searching from, or 0 to start at the
- beginning of the stated band.
- @param aBand The frequency band to search. This must be a FM band.
- @param aSearchDirection The direction to search in
- @param aCircularSeek If set to ETrue the station seek will loop back to the other
- end of the band once the end of the band has been reached. (Defaults to ETrue)
- If not set reaching the end of the band without finding a station will result
- in a callback to MToTuneComplete with error KErrNotFound.
- */
- IMPORT_C void StationSearchByTrafficProgramme(
- TBool aTp,
- TFrequency aStartFrequency,
- CMMTunerUtility::TSearchDirection aSearchDirection
- );
-
- /**
- Cancels an ongoing RDS search as initiated by one of the functions
- StationSearchByRds, StationSearchByProgrammeType,
- StationSearchByProgrammeIdentifier or StationSearchByTrafficProgramme. The
- asynchronous callback will not occur if this is called.
-
- Has not affect if no RDS search operation is ongoing.
- */
- IMPORT_C void CancelRdsSearch();
-
- /**
- Requests notifications when all RDS data become invalid due to the tuner being
- retuned.
-
- @param aObserver The client to be notified.
- @param aWhichData The subset of data for which change notifications are required.
- @return A standard system wide error code.
- */
- IMPORT_C TInt NotifyRdsDataChange(MMMRdsDataObserver& aObserver, TUint32 aWhichData = TRdsData::KAllRdsData);
-
- /**
- Cancel a NotifyRdsDataChange request.
- */
- IMPORT_C void CancelNotifyRdsDataChange();
-
- /**
- Request some RDS data. This will complete immediately with whatever RDS data have already been
- received.
-
- When this function returns, and data that was requested but is not indicated to be
- valid can be assumed not to have been received.
-
- @param aData The RDS data will be written to this variable.
- @param aValid On return, indicates a subset of RDS data that are valid.
- @param aWhichData The subset of RDS data that are being requested.
- @return A standard system wide error code.
- */
- IMPORT_C TInt GetRdsData(TRdsData& aData, TUint32& aValid, TUint32 aWhichData = TRdsData::KAllRdsData) const;
-
- /**
- Converts an RDS language identifier into a Symbian TLanguage type. Note that not all
- languages defined by the RDS specification IEC62106 are present in the TLanguage
- enumeration; in these cases, a value of ELangOther will be returned.
-
- @param aRdsLangId An RDS language identification code
- @return The corresponding TLanguage member, or ELangOther if none exists.
- */
- IMPORT_C static TLanguage ConvertRdsLanguageId(TRdsLanguageIdentifier aRdsLangId);
-
- /**
- Get the length of the available radio text. If no radio text is available this
- function will return KErrNotFound. The maximum possible length for radio text is 64 characters.
-
- @param aLength The variable to set to the length of the avaiable radio text
- @return A standard system error code.
- */
- IMPORT_C TInt GetRadioTextLength(TUint& aLength) const;
-
- /**
- Get the radio text. If no radio text is available, this will return KErrNotFound. In this
- case, a client can call NotifyRadioText to receive a notification when it is received.
-
- The radio text will have been converted to unicode, eliminating any control characters
- within it.
-
- @param aRadioText The descriptor to fill with the radio text
- @return A standard system error code
- */
- IMPORT_C TInt GetRadioText(TDes& aRadioText) const;
-
- /**
- Request notification when the radio text is received or changes.
-
- @param aObserver The client to be notified when the radio text is received or changes.
- @return A standard system wide error code.
- */
- IMPORT_C TInt NotifyRadioText(MMMRdsDataObserver& aObserver);
-
- /**
- Cancel a NotifyRadioText request.
- */
- IMPORT_C void CancelNotifyRadioText();
-
- /**
- Turns regional link function on or off depending on the value of the parameter.
- A value of ETrue should be passed if you wish to stay tuned to the currently
- tuned local station regardless of signal quality and signal strength.
- i.e. don't switch to another local station in the region.
-
- @param aRegOn ETrue to turn regional link on, EFalse to turn it off
- @return A standard system error code
- */
- IMPORT_C TInt SetRegionalLink(TBool aRegOn);
-
- /**
- Finds out if the regional link function is currently on or off.
-
- @param aRegOn This will be set to ETrue on return if and only if the regional
- link function is currently enabled.
- @return A standard system error code.
- */
- IMPORT_C TInt GetRegionalLink(TBool& aRegOn) const;
-
- /**
- Turn the travel announcement function on or off depending on the value of the
- parameter. A value of ETrue turns on Traffic Announcements, EFalse turns them off.
-
- If Traffic announcements are disabled while the tuner is retuned to a traffic
- announcement, the tuner will not revert to the original frequency. To revert to
- the original frequency, StopAnnouncement() must be called before the traffic
- announcement feature is disabled.
-
- @param aTaOn ETrue to turn TA on, EFalse to turn it off
- @return A standard system error code
- */
- IMPORT_C TInt SetTrafficAnnouncement(TBool aTaOn);
-
- /**
- Finds out if the traffic announcement function is currently enabled or not.
-
- @param aTaOn This is set to ETrue on return if and only if the traffic
- announcement function is currenly enabled.
- */
- IMPORT_C TInt GetTrafficAnnouncement(TBool& aTaOn) const;
-
- /**
- Set the absolute volume to apply during a traffic or news announcement.
-
- @param aVolume The volume to use. Must be between 0 and MaxVolume.
- @return A standard system error code.
- */
- IMPORT_C TInt SetAnnouncementVolume(TInt aVolume);
-
- /**
- Find the current absolute volume level used for news of traffic annoucements.
-
- @param aVolume This will be set to the current volume used for annoucements.
- @return A standard system error code, KErrNotFound if a annoucement volume offset has been set.
- use.
- */
- IMPORT_C TInt GetAnnouncementVolume(TInt& aVolume) const;
-
- /**
- Set the offset to the system volume level to apply during a traffic or news announcement
-
- @param aVolumeOffset The offset to the volume level to set for announcements. Must be between -MaxVolume and MaxVolume inclusive.
- the actual volume with the offset applied will be clipped between 0 and MaxVolume if the offset would
- otherwise result in a volume outside this range.
- @return A standard system error code
- */
- IMPORT_C TInt SetAnnouncementVolumeOffset(TInt aVolumeOffset);
-
- /**
- Find the current offset of the system volume that applies during traffic and news announcements.
-
- @param aVolumeOffset This will be set to the current traffic and news announcement offset on return.
- @return A standard system error code, KErrNotFound if an absolute annoucement volume has been set.
- */
- IMPORT_C TInt GetAnnouncementVolumeOffset(TInt& aVolumeOffset) const;
-
- /**
- Turn the news announcement function on or off depending on the value of the
- parameter. The news announcement function when enabled causes the radio to
- retune to a station when that station is broadcasting a news report. When the
- news announcement is finished the radio will tune back to the original station.
- A value of ETrue turns on News Announcements, EFalse turns them off.
-
- If News announcements are disabled while the tuner is retuned to a news
- announcement, the tuner will not revert to the original frequency. To revert to
- the original frequency, StopAnnouncement() must be called before the news
- announcement feature is disabled.
-
- @param aNaOn ETrue to turn NA on, EFalse to turn it off
- @return A standard system error code
- */
- IMPORT_C TInt SetNewsAnnouncement(TBool aNaOn);
-
- /**
- Finds out whether the news announcement function is on or off.
-
- @param aNaOn This will be set to ETrue if and only if the new announcement
- function is currently on.
- @return A standard system error code.
- */
- IMPORT_C TInt GetNewsAnnouncement(TBool& aNaOn) const;
-
- /**
- Cancels any current announcement, reverting to the original frequency. The announcement
- feature will remain enabled. If no announcement is currently happening, this function
- has no affect. This can be used for both News and Traffic announcements.
-
- @return A standard system error code. KErrNone if an announcement was successfully
- stopped, or KErrNotReady if no announcement is currently happening.
- */
- IMPORT_C TInt StopAnnouncement();
-
- /**
- Turns alternative frequency function on or off depending on the value of the parameter.
- A value of ETrue should be passed if you wish to enable automatic retuning to the current
- station on an alternative frequency.
-
- @param aAfOn ETrue to turn alternative frequency on, EFalse to turn it off
- @return A standard system error code
- */
- IMPORT_C TInt SetAlternativeFrequency(TBool aAfOn);
-
- /**
- Finds out whether the alternative frequency function is on or off.
-
- @param aAfOn This will be set to ETrue if and only if the alternative frequency
- function is currently on.
- @return A standard system error code.
- */
- IMPORT_C TInt GetAlternativeFrequency(TBool& aAfOn) const;
-
- /**
- Requests a notification when RDS functionality is enabled or disabled, or when
- the traffic announcement volume offset is changed.
-
- @param aObserver The class which is to be notified of the changes.
- @return A standard system error code.
- */
- IMPORT_C TInt NotifyRdsStateChange(MMMRdsStateChangeObserver& aObserver);
-
- /**
- Cancels an outstanding RDS state change notification request.
- */
- IMPORT_C void CancelNotifyRdsStateChange();
-
- /**
- Get the current RDS time. This is an asynchronous function due to the latency of
- the RDS information becoming available. This information is broadcast at the start of
- every minute, and is not cached for obvious reasons. Thus, whenever a request is made,
- it will complete next time the Data and Time are broadcast. The RDS standard states
- that this is broadcast within 0.1s of the start of a minute, and is accurate to one
- minute. The latency of the notification reaching the application cannot be guarteed.
-
- @param aTimeAndDate The variable to set to the current RDS time and date
- @param aStatus A TRequestStatus. This will be signalled when the request completes
- and will contain the result of the request, this will be one of the system error codes.
- */
- IMPORT_C void GetRdsTime(TPckg<TDateTime>& aTimeAndDate, TRequestStatus& aStatus) const;
-
- /**
- Cancel the GetRdsTime request
- */
- IMPORT_C void CancelGetRdsTime();
-
- /**
- Request notification when a retune caused by an announcement occurs. This will be
- a traffic or news announcement. A notification will be provided both at
- the start of the announcement and at the end.
-
- @param aObserver The object wishing to receive announcement events
- @return A standard system error code
- */
- IMPORT_C TInt NotifyAnnouncement(MMMRdsAnnouncementObserver& aObserver);
-
- /**
- Cancel the NotifyAnnouncement request
- */
- IMPORT_C void CancelNotifyAnnouncement();
-
- /**
- Returns a list containing information about other networks broadcast with the currently tuned
- programmme. This call will return immediately with whatever EON information is currently available.
- Note that is is possible for this function to return no EON stations when several are being broadcast
- simply because not enough RDS frames have been received yet. An interested application should make a
- call to NotifyEonInfo to receive notifications when EON information is received or changes.
-
- @param aEonInfo An array to which the EON information will be appended.
- */
- IMPORT_C void GetEonInfoL(RArray<TEonStation>& aEonInfo) const;
-
- /**
- Gets the frequencies assoicated with an EON station. This will complete immediately with whatever
- frequencies are currently cached. An interested application should make a call to NotifyEonChange
- to receive notifications when more frequencies are received.
-
- @param aEonStation the EON station to get the frequencies for
- @param aFrequencies an array to which the frequencies associated with the given station will be
- appended.
- */
- IMPORT_C void GetEonFrequenciesL(const TEonStation& aEonStation, RArray<TFrequency>& aFrequencies) const;
-
- /**
- Gets the mapped frequencies associated with an EON station. This will complete immediately with whatever
- mapped frequencies are currently cached. An interested application should make a call to NotifyEonChange
- to receive notifications when more frequencies are received.
-
- @param aEonStation the EON station to get the mapped frequencies for
- @param aMappedFrequencies an array to which the mapped frequencies associated with the given station
- will be appended.
- */
- IMPORT_C void GetEonMappedFrequenciesL(const TEonStation& aEonStation, RArray<TEonMappedFrequency>& aMappedFrequencies) const;
-
- /**
- Request notification when the Enhanced Other Networks (EON) information changes.
-
- @param aObserver The client to be notifier when EON information changes or an error occurs.
- */
- IMPORT_C TInt NotifyEonInfo(MMMRdsEonObserver& aObserver);
-
- /**
- Cancels a NotifyEonInfo request.
- */
- IMPORT_C void CancelNotifyEonInfo();
-
- /**
- Tunes to a station represented by a TEonStation. This will result to a callback to MtoTuneComplete.
-
- @param aEonStation The EON station that is to be tuned to.
- */
- IMPORT_C void TuneToEonStation(const TEonStation& aEonStation);
-
- /**
- Send a synchronous custom command to the RDS tuner.
-
- @param aFunction The function number to indicate which function is to be called
- on the interface defined by the first IPC argument
- @param aArgs The IPC arguments to send to the RDS tuner. The first of these
- arguments must be the UID of the interface within the tuner to which the
- command is destined, represented as an integer. Failure to set the first
- argument properly will result in the command completing with
- KErrNotSupported at best, but possibly the client being panicked.
- @return A standard system error code
- */
- IMPORT_C TInt CustomCommandSync(TInt aFunction, const TIpcArgs& aArgs);
-
- /**
- Send an asynchronous custom command to the RDS tuner.
-
- @param aFunction The function number to indicate which function is to be called
- on the interface defined by the first IPC argument
- @param aArgs The IPC arguments to send to the RDS tuner. The first of these
- arguments must be the UID of the interface within the tuner to which the
- command is destined, represented as an integer. Failure to set the first
- argument properly will result in the command completing with
- KErrNotSupported at best, but possibly the client being panicked.
- @param aStatus The TRequestStatus of an active object. This will contain the
- result of the request on completion. The exact range of result values is
- dependent on the interface.
- */
- IMPORT_C void CustomCommandAsync(TInt aFunction, const TIpcArgs& aArgs, TRequestStatus& aStatus);
-
-private:
- CMMRdsTunerUtility();
-private:
- class CBody;
- CBody* iBody;
-
-};
-
-/**
-This mixin class should be implemented by applications wishing to receive notifications
-when RDS data is received, changes or becomes invalid. Each method corresponds to a
-particular request in CMMRdsTunerUtility. Only methods corresponding to requests in
-CMMRdsTunerUtility that are used by a client need be implemented - empty default
-implementations are provided.
-*/
-class MMMRdsDataObserver
-{
-public:
- /**
- Called when some error occurs which makes RDS data unavailable.
- */
- virtual void MrdoError(TInt aError) = 0;
-
- /**
- Called when some RDS data is received or has changed.
-
- Two subsets of the RDS data supplied are indicted: that which has changed and that which is
- valid. This information can be interpreted as follows:
- For an item of RDS data x:
- valid(x) & !changed(x) => x was received before and has not changed
- valid(x) & changed(x) => x has either just been received for the first time, or has just changed
- !valid(x) & changed(x) => x is no longer available
- !valid(x) & !changed(x) => x was not available before, and is still not available.
-
- When the tuner is retuned to a new station, all RDS data will be flushed. This will result in
- a call to this function indicating that all RDS data has changed and is longer valid.
-
- @param aData The RDS data.
- @param aValid Indicates a subset of aData that is valid (i.e. has been received)
- @param aChanged Indicates a subset of aData that has changed since the last call to this function.
- */
- virtual void MrdoDataReceived(const TRdsData& aData, TUint32 aValid, TUint32 aChanged) = 0;
-
- /**
- Called when the RDS Radio Text (RT) is received, changes, or is no longer available.
-
- @param aRt The Radio Text message. This will be empty if aValid==EFalse.
- @param aValid Indicates if the radio text is valid.
- @param aChanges Indicates if the radio test has changed.
- */
- virtual void MrdoRadioTextReceived(const TDesC& aRt, TBool aValid, TBool aChanged) = 0;
-};
-
-/**
-The state change observer mixin class defines the interface via which changes to
-the state of the RDS radio can be observed. These state changes will be a result
-of a client enabling or disabling RDS functionality.
-*/
-class MMMRdsStateChangeObserver
-{
-public:
- /**
- Called when the regional link functionality is enabled/disabled.
-
- @param aNewRegLinkOn The new setting: ETrue if the regional link function has
- just been enabled.
- */
- virtual void MrscoRegionalLinkChanged(TBool aNewRegLinkOn) = 0;
-
- /**
- Called when the traffic announcement functionality has just been enabled or
- disabled.
-
- @param aNewTaOn ETrue if the TA function is now on, EFalse otherwise.
- */
- virtual void MrscoTrafficAnnouncementChanged(TBool aNewTaOn) = 0;
-
- /**
- Called when the traffic and news announcement volume offset is changed. A callback to
- this method indicates the a volume offset is being used instead of an absolute volume.
-
- @param aOldOffset The announcement volume offset before the change
- @param aNewOffset The announcement volume offset after the change
- */
- virtual void MrscoAnnouncementVolumeOffsetChanged(TInt aOldOffset, TInt aNewOffset) = 0;
-
- /**
- Called when the traffic an news announcement volume is changed. A callback to
- this method indicates that an absolute volume is being used instead of volume offsets.
-
- @param aOldVolume The announcement volume before the change.
- @param aNewVolume The announcement volume after the change.
- */
- virtual void MrscoAnnouncementVolumeChanged(TInt aOldVolume, TInt aNewVolume) = 0;
-
- /**
- Called when the news announcement functionality has just been enabled or
- disabled.
-
- @param aNewNAOn ETrue if the NA function is now enabled, else EFalse.
- */
- virtual void MrscoNewsAnnouncementChanged(TBool aNewNAOn) = 0;
-
- /**
- Called when the alternative frequencies function is turned on or off.
-
- @param aNewAFOn ETrue if the AF function has just been turned on, else EFalse.
- */
- virtual void MrscoAlternativeFrequenciesChanged(TBool aNewAFOn) = 0;
-};
-
-
-/**
-The Announcement Observer mixin class defines the interface via which
-announcement events can be received. A client interested in such
-information calls the function NotifyAnnouncement.
-*/
-class MMMRdsAnnouncementObserver
-{
-public:
- /**
- Called when an announcement starts
-
- @param aType The type of announcement (travel or news)
- */
- virtual void MraoAnnouncementStart(CMMRdsTunerUtility::TAnnouncementType aType) = 0;
-
- /**
- Called when an announcement ends
-
- @param aType The type of announcement (travel or news)
- */
- virtual void MraoAnnouncementEnd(CMMRdsTunerUtility::TAnnouncementType aType) = 0;
-
- /**
- Called when an error occurs which results in announcement notifications
- becoming unavailable.
- */
- virtual void MraoError(TInt aError) = 0;
-};
-
-/**
-The enhanced other networks observer mixin class defines the interface via
-which changes to the enhanced other networks information can be notified. A
-client interested in such information calls the function NotifyEonChange.
-*/
-class MMMRdsEonObserver
-{
-public:
- /**
- Called when some details of an EON station change. The station can be referenced
- to an existing one using it's Programme Identifier, which cannot change.
-
- @param aStation A TEonStation containing the new information about the station.
- @param aChanged The subset of the members of aStation that have changed. Bits are
- set according to TEonStation::TField.
- */
- virtual void MreoEonStationChanged(const TEonStation& aStation, TUint32 aChanged) = 0;
-
- /**
- Called when details of a new EON station are received.
-
- @param aStation A TEonStation containing the new information about the station.
- */
- virtual void MreoNewEonStation(const TEonStation& aStation) = 0;
-
- /**
- Called when details of <b>all</b> EON stations cease to be broadcast. This will
- typically happen when the tuner is retuned. More EON stations may continue to be
- recieved: this call does not indicate that EON information is no longer available.
- */
- virtual void MreoAllEonStationsRemoved() = 0;
-
- /**
- Called when details of an EON station cease to be broadcast.
-
- @param aPi The programme identifier of the EON station which has been removed.
- */
- virtual void MreoEonStationRemoved(const TRdsProgrammeIdentifier& aPi) = 0;
-
- /**
- Called when an error occurs resulting in EON notifications not being available.
- */
- virtual void MreoError(TInt aError) = 0;
-};
-
-#include <tuner.inl>
-
-#endif // TUNER_H
-
-// End of file
-
--- a/javauis/amms_akn/src_tuner/native/external_include/tuner.inl Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Inline functions for Tuner component.
-*
-*/
-
-
-TTunerCapabilities::TTunerCapabilities()
- : iTunerBands(0), iAdditionalFunctions(0)
-{}
-
-TTunerCapabilities::TTunerCapabilities(TUint32 aTunerBands, TUint32 aAdditionalFunctions)
- : iTunerBands(aTunerBands), iAdditionalFunctions(aAdditionalFunctions)
-{}
-
-TFrequency::TFrequency()
- : iFrequency(0)
-{}
-
-TFrequency::TFrequency(TInt aFrequency)
- : iFrequency(aFrequency)
-{}
-
-TInt TFrequency::operator==(const TFrequency& aFrequency) const
-{
- return (iFrequency==aFrequency.iFrequency);
-}
-
-TInt TFrequency::operator!=(const TFrequency& aFrequency) const
-{
- return (iFrequency!=aFrequency.iFrequency);
-}
-
-TInt TFrequency::operator> (const TFrequency& aFrequency) const
-{
- return (iFrequency>aFrequency.iFrequency);
-}
-
-TInt TFrequency::operator>=(const TFrequency& aFrequency) const
-{
- return (iFrequency>=aFrequency.iFrequency);
-}
-
-TInt TFrequency::operator< (const TFrequency& aFrequency) const
-{
- return (iFrequency<aFrequency.iFrequency);
-}
-
-TInt TFrequency::operator<=(const TFrequency& aFrequency) const
-{
- return (iFrequency<=aFrequency.iFrequency);
-}
-
-TRdsData::TRdsData()
-{
-}
-
-TEonMappedFrequency::TEonMappedFrequency(TFrequency aTuningFrequency, TFrequency aMappedFrequency)
- : iTuningFrequency(aTuningFrequency), iMappedFrequency(aMappedFrequency)
-{
-}
-
-TInt TRdsProgrammeItemNumber::operator==(const TRdsProgrammeItemNumber& aPin) const
-{
- return ((iDayOfMonth==aPin.iDayOfMonth)&&(iHour==aPin.iHour)&&(iMinute==aPin.iMinute));
-}
-
-TInt TRdsProgrammeItemNumber::operator!=(const TRdsProgrammeItemNumber& aPin) const
-{
- return (!((*this)==aPin));
-}
-
-// End of file
--- a/javauis/amms_akn/src_tuner/native/inc/ammstunerfactory.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class is used to create tuner player and control
-*
-*/
-
-
-
-#ifndef AMMSTUNERFACTORY_H
-#define AMMSTUNERFACTORY_H
-
-// INCLUDES
-#include <e32base.h>
-
-#include "CAMMSTunerControl.h"
-
-// FORWARD DECLARATIONS
-class CAMMSTunerPlayer;
-class CAMMSTunerControl;
-
-// CLASS DECLARATION
-/**
-* This class is used to create tuner player and control.
-* It parses locator parameters and set them to control.
-*/
-
-NONSHARABLE_CLASS(AMMSTunerFactory)
-{
-public: // Constructors and destructor
-
- /**
- * Destructor.
- */
- virtual ~AMMSTunerFactory();
-
-public: // New functions
-
- /**
- * ?member_description.
- * @param aTunerPlayer
- * @param aLocatorParams
- */
- static void CreatePlayerL(CAMMSTunerPlayer** aTunerPlayer,
- const TDesC* aLocatorParams);
-
-protected: // New functions
-
- /**
- * Parse all locator parameters.
- * @param aLocatorParams
- * @param aFrequency
- * @param aStereoMode
- * @param aPreset
- */
- static void ParseParamsL(const TDesC* aLocatorParams,
- TInt& aFrequency,
- TInt& aStereoMode,
- TInt& aPreset);
-
- /**
- * Parses frequency parameter
- * @param aFrequency - locator's frequency parameter
- * @return frequency in TInt
- */
- static TInt ParseFreqL(const TPtrC aFrequency);
-
- /**
- * Converts TPtrC to TReal using TLex.
- * @param aHertz - hertzs in TPtrC
- * @return hertzs in TReal
- */
- static TReal TDesCToTRealL(const TPtrC aHertz);
-
-private:
-
- /**
- * C++ default constructor.
- */
- AMMSTunerFactory();
-};
-
-#endif // AMMSTUNERFACTORY_H
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/inc/cammstunercontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,290 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Control for tuner
-*
-*/
-
-
-#ifndef CAMMSTUNERCONTROL_H
-#define CAMMSTUNERCONTROL_H
-
-// INCLUDES
-#include <e32base.h>
-#include <tuner.h>
-
-#include <CMMAControl.h>
-
-
-// FORWARD DECLARATIONS
-class CAMMSTunerPlayer;
-class CAMMSTunerPresetsHandler;
-
-// CLASS DECLARATION
-/**
-* Control for tuner
-*/
-
-NONSHARABLE_CLASS(CAMMSTunerControl) : public CMMAControl,
- public MMMTunerObserver,
- public MMMTunerChangeObserver,
- public MMMTunerStereoObserver
-{
-public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CAMMSTunerControl* NewL();
-
- /**
- * Destructor.
- */
- virtual ~CAMMSTunerControl();
-
-public: // New functions
-
- /**
- * Getter for CMMTunerUtility
- * @return CMMTunerUtility
- */
- CMMTunerUtility* TunerUtility();
-
- /**
- * Gets the minimum frequency supported by this tuner
- * with the given modulation.
- * @return minimum frequency supported by this tuner
- */
- TInt MinFreqL();
-
- /**
- * Gets the maximum frequency supported by this tuner
- * with the given modulation.
- * @return maximum frequency supported by this tuner
- */
- TInt MaxFreqL();
-
- /**
- * Tunes to the given frequency or to the closest supported frequency.
- * @param aFreq - the frequency in Hertzs that will be taken into use
- * @return the frequency in 100 Hertzs that was taken into use
-
- */
- void SetFrequencyL(TInt aFreq);
-
- /**
- * Gets the frequency which the tuner has been tuned to.
- * @return the frequency to which the device has been tuned,
- * in 100 Hertzs
- */
- TInt FrequencyL();
-
- /**
- * Seeks for the next broadcast signal.
- * @param aStartFreq - the frequency in Hertzs wherefrom the scan starts
- * @param aUpwards - if true, the scan proceeds towards higher
- * frequencies, otherwise towards lower frequencies
- * @return the found frequency
- */
- TInt SeekL(TInt aStartFreq, TBool aUpwards);
-
- /**
- * Gets the current squelching (muting in frequencies without broadcast)
- * setting.
- * @return true if squelch is on or false if squelch is off
- */
- TBool SquelchL();
-
- /**
- * Sets squelching on or off.
- * @param aSquelch - true to turn the squelch on or false
- * to turn the squelch off
- */
- void SetSquelchL(TBool aSquelch);
-
- /**
- * Gets the strength of the recepted signal.
- * @return a value between 0 and 100 where 0 means the faintest
- * and 100 the strongest possible signal strength
- */
- TInt SignalStrengthL();
-
- /**
- * Gets the stereo mode in use.
- * @return stereo mode in use
- */
- TInt StereoModeL();
-
- /**
- * Sets the stereo mode.
- * @param aMode - the stereo mode to be used
- */
- void SetStereoModeL(TInt aMode);
-
- /**
- * Tunes the tuner by using settings specified in the preset.
- * @param aPreset - the preset to be used.
- */
- void UsePresetL(TInt aPreset);
-
- /**
- * Configures the preset using current frequency and modulation
- * and stereo mode.
- * @param aPreset - the preset to be set.
- */
- void SetPresetL(TInt aPreset);
-
- /**
- * Configures the preset using given settings.
- * @param aPreset - the preset to be set.
- * @param aFrequency - the frequency to be set.
- * @param aStereoMode - the stereo mode to be set.
- */
- void SetPresetL(TInt aPreset, TInt aFrequency, TInt aStereoMode);
-
- /**
- * Gets preset frequency
- * @param aPreset - the preset whose frequency is to be returned
- . * @return the frequency of the preset in 100 Hertzs
- */
- TInt PresetFrequencyL(TInt aPreset);
-
- /**
- * Gets preset stereo mode
- * @param aPreset - the preset whose stereo mode is to be returned
- . * @return the stereo mode of the preset.
- */
- TInt PresetStereoModeL(TInt aPreset);
-
- /**
- * Set preset name
- * @param aPreset - the preset whose name is to be set
- * @param aPresetName - the name of the preset
- */
- void SetPresetNameL(TInt aPreset, const TDesC* aPresetName);
-
- /**
- * Get preset name
- * @param aPreset - the preset whose name is asked
- * @param aPresetName - the name of the preset
- */
- void GetPresetNameL(TInt aPreset, TPtrC* aPresetName);
-
-public: // functions from base classes
-
- // from CMMAControl
-
- const TDesC& ClassName() const;
-
- const TDesC& PublicClassName() const;
-
- // from MMMTunerObserver
-
- void MToTuneComplete(TInt aError);
-
- // from class MMMTunerChangeObserver
-
- /**
- Called when the tuned frequency changes
-
- @param aOldFrequency The frequency in use before the change
- @param aNewFrequency The new tuned frequency
- */
- void MTcoFrequencyChanged(const TFrequency& aOldFrequency,
- const TFrequency& aNewFrequency);
-
- /**
- Called when the state of the tuner changes.
-
- @param aOldState The old state. Bits are set according to TTunerState.
- @param aNewState The new state. Bits are set according to TTunerState.
- */
- void MTcoStateChanged(const TUint32& aOldState,
- const TUint32& aNewState);
-
- /**
- This function is called when an external antenna is detached from the device.
- This does not necessarily indicate that the tuner can no longer be used; the
- capabilities of the tuner indicate if the external antenna is required in order
- to use the tuner.
- */
- void MTcoAntennaDetached();
-
- /**
- This function is called when an external antenna is attached to the device. If
- the antenna is required to use the tuner, this indicates that the tuner can be
- used again.
- */
- void MTcoAntennaAttached();
-
- /**
- This function is called when the device enters or leaves flight mode. If the tuner
- cannot be used in flight mode when the device enters this mode, this indicates
- that the tuner can no longer be used; the capabilities of the tuner indicate if
- it can be used in flight mode or not.
-
- @param aFlightMode ETrue if the device has just entered flight mode, EFalse if
- flight mode has just been left.
- */
- void FlightModeChanged(TBool aFlightMode);
-
- // from class MMMTunerStereoObserver
-
- /**
- Called when stereo reception is lost/restored.
-
- @param aStereo If true, indicates that stereo reception has just been restored.
- If false, indicates that stereo reception has just been lost.
- */
- void MTsoStereoReceptionChanged(TBool aStereo);
-
- /**
- Called when a client enables/disabled forced mono reception.
-
- @param aForcedMono ETrue if reception is forced to be mono, even when a stereo
- signal is available.
- */
- void MTsoForcedMonoChanged(TBool aForcedMono);
-
-
-private:
-
- /**
- * C++ default constructor.
- */
- CAMMSTunerControl();
-
- /**
- * By default Symbian 2nd phase constructor is private.
- */
- void ConstructL();
-
- // Prohibit copy constructor if not deriving from CBase.
- // CAMMSTunerControl( const CAMMSTunerControl& );
- // Prohibit assigment operator if not deriving from CBase.
- // CAMMSTunerControl& operator=( const CAMMSTunerControl& );
-
-
-private: // Data
-
- TInt iMinFreq;
- TInt iMaxFreq;
-
- CMMTunerUtility* iTunerUtility;
- CActiveSchedulerWait* iActiveSchedulerWait;
- CAMMSTunerPresetsHandler* iPresetsHandler;
-};
-
-#endif // CAMMSTUNERCONTROL_H
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/inc/cammstunerplayer.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-
-
-#ifndef CAMMSTUNERPLAYER_H
-#define CAMMSTUNERPLAYER_H
-
-// INCLUDES
-#include <CMMAPlayer.h>
-#include "CAMMSTunerControl.h"
-
-#include <e32base.h>
-#include <tuner.h>
-
-
-// CLASS DECLARATION
-
-/**
-* Player for tuner
-*
-*/
-NONSHARABLE_CLASS(CAMMSTunerPlayer) : public CMMAPlayer,
- public MMMTunerAudioPlayerObserver
-{
-public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CAMMSTunerPlayer* NewL(CAMMSTunerControl* aTunerControl);
-
- /**
- * Destructor.
- */
- virtual ~CAMMSTunerPlayer();
-
-public: // from CMMAPlayer
-
- void PrefetchL();
- void StartL();
- void StopL(TBool aPostEvent);
- void DeallocateL();
- void GetMediaTime(TInt64* aMediaTime);
-
-public: // from MMMTunerAudioPlayerObserver
-
- void MTapoInitializeComplete(TInt aError);
- void MTapoPlayEvent(MMMTunerAudioPlayerObserver::TEventType aEvent, TInt aError, TAny* aAdditionalInfo);
-
-private:
-
- /**
- * C++ default constructor.
- */
- CAMMSTunerPlayer();
-
- /**
- * By default Symbian 2nd phase constructor is private.
- */
- void ConstructL(CAMMSTunerControl* aTunerControl);
-
-
- TInt64 CurrentTime();
-
-private: // Data
- CMMTunerAudioPlayerUtility* iTunerPlayerUtility;
- CAMMSTunerControl* iTunerControl;
- CActiveSchedulerWait* iActiveSchedulerWait;
-
- TBool iIsInitialized;
- TInt64 iMediaTime;
- TInt64 iStartTime;
-};
-
-#endif // CAMMSTUNERPLAYER_H
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/inc/cammstunerpresetshandler.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class handles presets central repository usage.
-*
-*/
-
-
-
-#ifndef CAMMSTUNERPRESETSHANDLER_H
-#define CAMMSTUNERPRESETSHANDLER_H
-
-// INCLUDES
-#include <e32base.h>
-#include <centralrepository.h>
-
-
-// FORWARD DECLARATIONS
-class TAMMSTunerPreset;
-
-// CLASS DECLARATION
-/**
-* This class handles presets central repository usage.
-*
-* @lib ?library
-* @since ?Series60_version
-*/
-NONSHARABLE_CLASS(CAMMSTunerPresetsHandler) : public CBase
-{
-public: // Constructors and destructor
-
- /**
- * Two-phased constructor.
- */
- static CAMMSTunerPresetsHandler* NewL();
-
- /**
- * Destructor.
- */
- virtual ~CAMMSTunerPresetsHandler();
-
-public: // New functions
-
- /**
- * Gets presets from central repository
- * @param aPreset - presets index
- * @param aTunerPreset
- */
- void GetPresetL(TInt aPreset, TAMMSTunerPreset &aTunerPreset);
-
- /**
- * Save presets to central repository
- * @param aPreset - presets index
- * @param aTunerPreset
- */
- void SavePresetL(TInt aPreset, TAMMSTunerPreset aTunerPreset);
-
-private:
-
- /**
- * C++ default constructor.
- */
- CAMMSTunerPresetsHandler();
-
- /**
- * By default Symbian 2nd phase constructor is private.
- */
- void ConstructL();
-
- // Prohibit copy constructor if not deriving from CBase.
- // CAMMSTunerPresetsHandler( const CAMMSTunerPresetsHandler& );
- // Prohibit assigment operator if not deriving from CBase.
- // CAMMSTunerPresetsHandler& operator=( const CAMMSTunerPresetsHandler& );
-
-
-private: // Data
-
- CRepository* iCentralRepository;
-
-
-};
-
-#endif // CAMMSTUNERPRESETSHANDLER_H
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/inc/cammstunervolumecontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class is used for setting volume to tuner player
-*
-*/
-
-
-#ifndef CAMMSTUNERVOLUMECONTROL_H
-#define CAMMSTUNERVOLUMECONTROL_H
-
-// INCLUDES
-#include <e32base.h>
-
-#include <CMMAVolumeControl.h>
-
-// FORWARD DECLARATIONS
-class CAMMSTunerPlayer;
-
-// CLASS DECLARATION
-/**
-* This class is used for setting volume to tuner player
-*/
-
-NONSHARABLE_CLASS(CAMMSTunerVolumeControl) : public CMMAVolumeControl
-{
-public: // Constructor
- static CAMMSTunerVolumeControl* NewL(CAMMSTunerPlayer* aTunerPlayer);
-
-public: // functions from base classes
-
- // from CMMAVolumeControl
-
- void DoSetLevelL(TInt aLevel);
-
-private:
-
- /**
- * C++ default constructor.
- */
- CAMMSTunerVolumeControl(CAMMSTunerPlayer* aTunerPlayer);
-
-
-private: // Data
-
- CAMMSTunerPlayer* iTunerPlayer;
-};
-
-#endif // CAMMSTUNERVOLUMECONTROL_H
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/inc/tammstunerpreset.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,104 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Helper class for preset handling, reads and writes preset
-* values in/out stream.
-*
-*/
-
-
-
-#ifndef TAMMSTUNERPRESET_H
-#define TAMMSTUNERPRESET_H
-
-// INCLUDES
-#include <e32base.h>
-
-
-// FORWARD DECLARATIONS
-class RWriteStream;
-class RReadStream;
-
-// CONSTANTS
-const TInt KPresetNameLength = 100;
-
-// CLASS DECLARATION
-/**
-* Helper class for preset handling, reads and writes preset
-* values in/out stream.
-*
-* @lib ?library
-* @since ?Series60_version
-*/
-NONSHARABLE_CLASS(TAMMSTunerPreset)
-{
-public:
-
- /**
- * C++ default constructor.
- */
- TAMMSTunerPreset();
-
- /**
- * Setter for preset name.
- */
- void SetPresetName(const TDesC* aPresetName);
-
- /**
- * Setter for preset frequency.
- */
- void SetPresetFrequency(const TInt aPresetFrequency);
-
- /**
- * Setter for preset stereo mode.
- */
- void SetPresetStereoMode(const TInt aPresetStereoMode);
-
- /**
- * Getter for preset name.
- */
- TPtrC PresetName();
-
- /**
- * Getter for preset frequency.
- */
- TInt PresetFrequency();
-
- /**
- * Getter for preset stereo mode.
- */
- TInt PresetStereoMode();
-
- /**
- * Serialize the data to stream.
- * @param aStream - used for write stream
- */
- void ExternalizeL(RWriteStream &aStream) const;
-
- /**
- * deserialize the data out of stream.
- * @param aStream used for read stream
- */
- void InternalizeL(RReadStream &aStream);
-
-private:
-
- TBuf<KPresetNameLength> iPresetName;
- TInt iPresetFrequency;
- TInt iPresetStereoMode;
-
-};
-
-#endif // TAMMSTUNERPRESET_H
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/src/ammstunerfactory.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,300 +0,0 @@
-/*
-* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class is used to create tuner player and control
-*
-*/
-
-
-
-// INCLUDE FILES
-#include "AMMSTunerFactory.h"
-#include "CAMMSTunerPlayer.h"
-#include "CAMMSTunerControl.h"
-//#include "CAMMSTunerVolumeControl.h"
-#include <CMMAPlayerProperties.h>
-
-#include <e32std.h>
-#include <e32math.h>
-#include <jdebug.h>
-
-// CONSTANTS
-_LIT(KFreqParam, "f");
-
-_LIT(KModulationParam, "mod");
-
-_LIT(KStereoModeParam, "st");
-MMA_PARAMETER_STR(KStereoModeParamMono, "mono");
-MMA_PARAMETER_STR(KStereoModeParamStereo, "stereo");
-MMA_PARAMETER_STR(KStereoModeParamAuto, "auto");
-MMA_PARAMETER_ARRAY(KValidStereoModeValues)
-{
- {
- &KStereoModeParamMono
- }, {&KStereoModeParamStereo}, {&KStereoModeParamAuto}
-};
-
-_LIT(KProgramIdParam, "id");
-_LIT(KPresetParam, "preset");
-
-_LIT(KModulationFm, "fm");
-
-_LIT(KStereoModeMono, "mono");
-_LIT(KStereoModeStereo, "stereo");
-_LIT(KStereoModeAuto, "auto");
-
-const TInt KMegaHertzChar = 'M';
-const TInt KKiloHertzChar = 'k';
-const TInt KFreqDotChar = '.';
-
-const TInt KMegaHzMultiplier = 1000000;
-const TInt KKiloHzMultiplier = 1000;
-
-const TInt KStereoModeMonoInt = 1;
-const TInt KStereoModeStereoInt = 2;
-const TInt KStereoModeAutoInt = 3;
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// Destructor
-AMMSTunerFactory::~AMMSTunerFactory()
-{
-
-}
-
-
-// -----------------------------------------------------------------------------
-// AMMSTunerFactory::CreatePlayerL
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void AMMSTunerFactory::CreatePlayerL(CAMMSTunerPlayer** aTunerPlayer,
- const TDesC* aLocatorParams)
-{
- DEBUG("AMMSTunerFactory::CreatePlayerL +");
-
- TInt frequency = 0;
- TInt stereoMode = 0;
- TInt preset = 0;
-
- if (aLocatorParams->Length() != 0)
- {
- DEBUG("AMMSTunerFactory::CreatePlayerL 1");
- ParseParamsL(aLocatorParams, frequency, stereoMode, preset);
- }
-
- //create tunercontrol
- CAMMSTunerControl* tunerControl = CAMMSTunerControl::NewL();
- CleanupStack::PushL(tunerControl);
-
- //set values to tunercontrol
- if (frequency > 0)
- {
- tunerControl->SetFrequencyL(frequency);
- }
-
- if (frequency == 0)
- {
- //by default frequency is fm modulation's min freq
- tunerControl->SetFrequencyL(tunerControl->MinFreqL());
- }
-
- if (stereoMode > 0)
- {
- tunerControl->SetStereoModeL(stereoMode);
- }
-
- if (preset > 0)
- {
- tunerControl->UsePresetL(preset);
- }
-
- //create tunerplayer
- *aTunerPlayer = CAMMSTunerPlayer::NewL(tunerControl);
-
- //create tunervolumeconrol
- //CAMMSTunerVolumeControl* tunerVolumeControl = CAMMSTunerVolumeControl::NewL( *aTunerPlayer );
-
- //add controls to player
- (*aTunerPlayer)->AddControlL(tunerControl);
- //(*aTunerPlayer)->AddControlL( tunerVolumeControl );
- CleanupStack::Pop(tunerControl);
- DEBUG("AMMSTunerFactory::CreatePlayerL -");
-}
-
-// -----------------------------------------------------------------------------
-// AMMSTunerFactory::ParseParamsL
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void AMMSTunerFactory::ParseParamsL(const TDesC* aLocatorParams,
- TInt& aFrequency,
- TInt& aStereoMode,
- TInt& aPreset)
-{
- DEBUG("AMMSTunerFactory::ParseParamsL +");
- CMMAParameterRuleSet* rules = CMMAParameterRuleSet::NewLC();
-
- //freq rule
- TMMAParameterRuleDes freqRule(KFreqParam);
- rules->AppendRuleL(&freqRule);
-
- //modulation rule
- TMMAParameterRuleDes modulationRule(KModulationParam);
- rules->AppendRuleL(&modulationRule);
-
- //stereo mode rule
- TMMAParameterRuleDes stereoModeRule(KStereoModeParam, KValidStereoModeValues,
- MMA_PARAMETER_ARRAY_SIZE(KValidStereoModeValues));
- rules->AppendRuleL(&stereoModeRule);
-
- //preset rule KMinTInt-KMaxTInt
- TMMAParameterRuleInt presetRule(KPresetParam);
- rules->AppendRuleL(&presetRule);
-
- //id rule
- TMMAParameterRuleDes idRule(KProgramIdParam);
- rules->AppendRuleL(&idRule);
-
- CMMAPlayerProperties* properties = CMMAPlayerProperties::NewL(*aLocatorParams, *rules);
- CleanupStack::PushL(properties);
-
- // validating properties
- properties->ValidateL();
-
- //get freq
- TPtrC freq(NULL, 0);
- properties->GetProperty(KFreqParam, freq);
- //parse frequency
- if (freq.Length() != 0)
- {
- aFrequency = ParseFreqL(freq);
- }
-
- //get modulation
- TPtrC modulation(NULL, 0);
- properties->GetProperty(KModulationParam, modulation);
- if (modulation.Length() != 0)
- {
- // only fm modulation is supported
- if (modulation.Compare(KModulationFm) != 0)
- {
- User::Leave(KErrNotSupported);
- }
- }
-
- //get stereo mode
- TPtrC stereoMode(NULL, 0);
- properties->GetProperty(KStereoModeParam, stereoMode);
- if (stereoMode.Compare(KStereoModeMono) == 0)
- {
- aStereoMode = KStereoModeMonoInt;
- }
- else if (stereoMode.Compare(KStereoModeStereo) == 0)
- {
- aStereoMode = KStereoModeStereoInt;
- }
- else if (stereoMode.Compare(KStereoModeAuto) == 0)
- {
- aStereoMode = KStereoModeAutoInt;
- }
-
- //get preset
- properties->GetProperty(KPresetParam, aPreset);
-
- //get id
- TPtrC id(NULL, 0);
- properties->GetProperty(KProgramIdParam, id);
- if (id.Length() != 0)
- {
- // id is not supported
- User::Leave(KErrNotSupported);
- }
-
- CleanupStack::PopAndDestroy(properties);
- CleanupStack::PopAndDestroy(rules);
- DEBUG("AMMSTunerFactory::ParseParamsL -");
-}
-
-// -----------------------------------------------------------------------------
-// AMMSTunerFactory::ParseFreqL
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TInt AMMSTunerFactory::ParseFreqL(const TPtrC aFrequency)
-{
- DEBUG("AMMSTunerFactory::ParseFreqL +");
- TReal freqReal = 0;
-
- //is value MHz or kHz or just hertz
- TInt freqPrefixMPos = aFrequency.Locate(KMegaHertzChar);
- TInt freqPrefixKPos = aFrequency.Locate(KKiloHertzChar);
-
- if (freqPrefixMPos != KErrNotFound)
- {
- //there is a M
- TPtrC hertz = aFrequency.Left(freqPrefixMPos);
- //TPtrC -> TReal
- TReal value = TDesCToTRealL(hertz);
-
- freqReal = value * KMegaHzMultiplier;
- }
- else if (freqPrefixKPos != KErrNotFound)
- {
- //there is a k
- TPtrC hertz = aFrequency.Left(freqPrefixKPos);
- //TPtrC -> TReal
- TReal value = TDesCToTRealL(hertz);
-
- freqReal = value * KKiloHzMultiplier;
- }
- else
- {
- //parameter value is simply hertz, there is no M or k
- //TPtrC -> TReal
- freqReal = TDesCToTRealL(aFrequency);
- }
- TInt32 freqInt = 0;
- //TReal -> TInt
- TInt err = Math::Int(freqInt, freqReal);
- if (err != KErrNone)
- {
- User::Leave(KErrArgument);
- }
-
- return freqInt;
-}
-
-// -----------------------------------------------------------------------------
-// AMMSTunerFactory::TDesCToTRealL
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-TReal AMMSTunerFactory::TDesCToTRealL(const TPtrC aHertz)
-{
- DEBUG("AMMSTunerFactory::TDesCToTRealL +");
- TReal valueReal = 0;
- TLex lex(aHertz);
- if ((lex.Val(valueReal, KFreqDotChar) != KErrNone) ||
- !lex.Eos())
- {
- User::Leave(KErrArgument);
- }
- return valueReal;
-}
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/src/cammstunercontrol.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,504 +0,0 @@
-/*
-* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class is used to control tuner
-*
-*/
-
-
-
-// INCLUDE FILES
-#include "CAMMSTunerControl.h"
-#include "CAMMSTunerPlayer.h"
-#include "CAMMSTunerPresetsHandler.h"
-#include "TAMMSTunerPreset.h"
-#include "AMMSTunerFactory.h"
-
-#include <tuner.h>
-#include <jdebug.h>
-
-
-// CONSTANTS
-_LIT(KControlImplName, "com.nokia.amms.control.tuner.TunerControlImpl");
-_LIT(KControlPublicName, "javax.microedition.amms.control.tuner.TunerControl");
-
-const TInt KStereoModeMono = 1;
-const TInt KStereoModeStereo = 2;
-const TInt KStereoModeAuto = 3;
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::CAMMSTunerControl
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CAMMSTunerControl::CAMMSTunerControl()
-{
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CAMMSTunerControl* CAMMSTunerControl::NewL()
-{
- CAMMSTunerControl* self = new(ELeave) CAMMSTunerControl;
-
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop();
-
- return self;
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CAMMSTunerControl::ConstructL()
-{
- DEBUG("CAMMSTunerControl::ConstructL +");
-
- iTunerUtility = CMMTunerUtility::NewL(*this,
- CMMTunerUtility::ETunerBandFm,
- 1,
- CMMTunerUtility::ETunerAccessPriorityNormal);
-
- iActiveSchedulerWait = new(ELeave) CActiveSchedulerWait();
-
- iPresetsHandler = CAMMSTunerPresetsHandler::NewL();
-
- iMinFreq = MinFreqL();
- iMaxFreq = MaxFreqL();
-
- DEBUG("CAMMSTunerControl::ConstructL -");
-}
-
-
-// Destructor
-CAMMSTunerControl::~CAMMSTunerControl()
-{
- DEBUG("CAMMSTunerControl::~CAMMSTunerControl +");
- delete iTunerUtility;
- delete iActiveSchedulerWait;
- delete iPresetsHandler;
- DEBUG("CAMMSTunerControl::~CAMMSTunerControl -");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::TunerUtility()
-// -----------------------------------------------------------------------------
-CMMTunerUtility* CAMMSTunerControl::TunerUtility()
-{
- DEBUG("CAMMSTunerControl::TunerUtility");
- return iTunerUtility;
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::MinFreq()
-// -----------------------------------------------------------------------------
-TInt CAMMSTunerControl::MinFreqL()
-{
- DEBUG("CAMMSTunerControl::MinFreqL +");
- TFrequency minFreq;
- TFrequency maxFreq;
- User::LeaveIfError(iTunerUtility->GetFrequencyBandRange(minFreq,
- maxFreq));
- DEBUG_INT("CAMMSTunerControl::MinFreqL = %d", minFreq.iFrequency);
- return minFreq.iFrequency;
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::MaxFreq()
-// -----------------------------------------------------------------------------
-TInt CAMMSTunerControl::MaxFreqL()
-{
- DEBUG("CAMMSTunerControl::MaxFreqL +");
- TFrequency minFreq;
- TFrequency maxFreq;
- User::LeaveIfError(iTunerUtility->GetFrequencyBandRange(minFreq,
- maxFreq));
- DEBUG_INT("CAMMSTunerControl::MaxFreqL = %d", maxFreq.iFrequency);
- return maxFreq.iFrequency;
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::SetFrequency()
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::SetFrequencyL(TInt aFreq)
-{
- DEBUG("CAMMSTunerControl::SetFrequency +");
- if (aFreq < iMinFreq || aFreq > iMaxFreq)
- {
- User::Leave(KErrArgument);
- }
-
- TFrequency freq = TFrequency(aFreq);
-
- TUint32 state = 0;
- iTunerUtility->GetState(state);
- DEBUG_INT("CAMMSTunerControl::SetFrequency, state = %d", state);
-
- DEBUG_INT("CAMMSTunerControl::SetFrequency = %d", freq.iFrequency);
-
- iTunerUtility->Tune(freq);
- if (!iActiveSchedulerWait->IsStarted())
- {
- iActiveSchedulerWait->Start(); // CSI: 10 Active object state already checked. #
- }
- DEBUG("CAMMSTunerControl::SetFrequency -");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::Frequency()
-// -----------------------------------------------------------------------------
-TInt CAMMSTunerControl::FrequencyL()
-{
- DEBUG("CAMMSTunerControl::Frequency +");
- TFrequency freq;
-
- User::LeaveIfError(iTunerUtility->GetFrequency(freq));
- TInt frequency = freq.iFrequency;
- DEBUG_INT("CAMMSTunerControl::Frequency frequency = %d", frequency);
- return frequency;
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::SeekL()
-// -----------------------------------------------------------------------------
-TInt CAMMSTunerControl::SeekL(TInt aStartFreq, TBool aUpwards)
-{
- DEBUG("CAMMSTunerControl::SeekL +");
- if (aStartFreq < iMinFreq || aStartFreq > iMaxFreq)
- {
- User::Leave(KErrArgument);
- }
-
- if (aUpwards)
- {
- iTunerUtility->StationSeek(CMMTunerUtility::ESearchDirectionUp);
- if (!iActiveSchedulerWait->IsStarted())
- {
- iActiveSchedulerWait->Start(); // CSI: 10 Active object state already checked. #
- }
- }
- else
- {
- iTunerUtility->StationSeek(CMMTunerUtility::ESearchDirectionDown);
- if (!iActiveSchedulerWait->IsStarted())
- {
- iActiveSchedulerWait->Start(); // CSI: 10 Active object state already checked. #
- }
- }
-
- return FrequencyL();
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::SquelchL()
-// -----------------------------------------------------------------------------
-TBool CAMMSTunerControl::SquelchL()
-{
- DEBUG("CAMMSTunerControl::SquelchL +");
- TBool enabled = EFalse;
- User::LeaveIfError(iTunerUtility->GetSquelch(enabled));
- return enabled;
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::SetSquelchL()
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::SetSquelchL(TBool aSquelch)
-{
- DEBUG("CAMMSTunerControl::SetSquelchL +");
- User::LeaveIfError(iTunerUtility->SetSquelch(aSquelch));
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::SignalStrengthL()
-// -----------------------------------------------------------------------------
-TInt CAMMSTunerControl::SignalStrengthL()
-{
- DEBUG("CAMMSTunerControl::SignalStrengthL +");
- TInt maxSignalStrength = 0;
- TInt signalStrength = 0;
-
- User::LeaveIfError(iTunerUtility->GetMaxSignalStrength(maxSignalStrength));
- DEBUG_INT("CAMMSTunerControl::SignalStrengthL, maxSignalStrength = %d", maxSignalStrength);
- User::LeaveIfError(iTunerUtility->GetSignalStrength(signalStrength));
- DEBUG_INT("CAMMSTunerControl::SignalStrengthL, signalStrength = %d", signalStrength);
- if (maxSignalStrength > 0)
- {
- return signalStrength / maxSignalStrength * 100; // CSI: 47 signal strength must be between 0 and 100 #
- }
- return KErrNotSupported;
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::StereoModeL()
-// -----------------------------------------------------------------------------
-TInt CAMMSTunerControl::StereoModeL()
-{
- DEBUG("CAMMSTunerControl::StereoModeL +");
- TBool mono = EFalse;
- TBool stereo = EFalse;
-
- User::LeaveIfError(iTunerUtility->GetForcedMonoReception(mono));
- if (mono)
- {
- return KStereoModeMono;
- }
-
- //User::LeaveIfError( iTunerUtility->IsStereoSignal( stereo ) );
- TInt err = iTunerUtility->IsStereoSignal(stereo);
- //this is for emulator testing, FIX IT
- if (err == KErrNotReady)
- {
- return KStereoModeAuto;
- }
- else if (err != KErrNone)
- {
- User::LeaveIfError(err);
- }
-
- if (stereo)
- {
- return KStereoModeStereo;
- }
-
- return KStereoModeAuto;
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::SetStereoMode()
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::SetStereoModeL(TInt aMode)
-{
- DEBUG("CAMMSTunerControl::SetStereoModeL +");
- if (aMode == KStereoModeMono)
- {
- User::LeaveIfError(iTunerUtility->ForceMonoReception(ETrue));
- }
-
- if (aMode == KStereoModeStereo)
- {
- User::LeaveIfError(iTunerUtility->ForceMonoReception(EFalse));
- TBool stereo = EFalse;
- User::LeaveIfError(iTunerUtility->IsStereoSignal(stereo));
- if (!stereo)
- {
- User::Leave(KErrNotSupported);
- }
- }
-
- if (aMode == KStereoModeAuto)
- {
- User::LeaveIfError(iTunerUtility->ForceMonoReception(EFalse));
- }
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::UsePresetL()
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::UsePresetL(TInt aPreset)
-{
- DEBUG("CAMMSTunerControl::UsePresetL +");
- TAMMSTunerPreset tunerPreset;
-
- //get presets
- iPresetsHandler->GetPresetL(aPreset, tunerPreset);
-
- //set presets to tunerutility
- SetFrequencyL(tunerPreset.PresetFrequency());
- SetStereoModeL(tunerPreset.PresetStereoMode());
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::SetPresetL()
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::SetPresetL(TInt aPreset)
-{
- DEBUG("CAMMSTunerControl::SetPresetL1 +");
- TAMMSTunerPreset tunerPreset;
-
- //get current frequency
- tunerPreset.SetPresetFrequency(FrequencyL());
- //get current stereo mode
- tunerPreset.SetPresetStereoMode(StereoModeL());
-
- iPresetsHandler->SavePresetL(aPreset, tunerPreset);
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::SetPresetL()
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::SetPresetL(TInt aPreset,
- TInt aFrequency,
- TInt aStereoMode)
-{
- DEBUG("CAMMSTunerControl::SetPresetL2 +");
- TAMMSTunerPreset tunerPreset;
-
- tunerPreset.SetPresetFrequency(aFrequency);
- tunerPreset.SetPresetStereoMode(aStereoMode);
-
- iPresetsHandler->SavePresetL(aPreset, tunerPreset);
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::PresetFrequencyL()
-// -----------------------------------------------------------------------------
-TInt CAMMSTunerControl::PresetFrequencyL(TInt aPreset)
-{
- DEBUG("CAMMSTunerControl::PresetFrequencyL +");
- TAMMSTunerPreset tunerPreset;
-
- iPresetsHandler->GetPresetL(aPreset, tunerPreset);
-
- return tunerPreset.PresetFrequency();
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::PresetStereoModeL()
-// -----------------------------------------------------------------------------
-TInt CAMMSTunerControl::PresetStereoModeL(TInt aPreset)
-{
- DEBUG("CAMMSTunerControl::PresetStereoModeL +");
- TAMMSTunerPreset tunerPreset;
-
- iPresetsHandler->GetPresetL(aPreset, tunerPreset);
-
- return tunerPreset.PresetStereoMode();
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::SetPresetNameL()
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::SetPresetNameL(TInt aPreset, const TDesC* aPresetName)
-{
- DEBUG("CAMMSTunerControl::SetPresetNameL +");
- TAMMSTunerPreset tunerPreset;
-
- iPresetsHandler->GetPresetL(aPreset, tunerPreset);
-
- tunerPreset.SetPresetName(aPresetName);
-
- iPresetsHandler->SavePresetL(aPreset, tunerPreset);
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::GetPresetNameL()
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::GetPresetNameL(TInt aPreset, TPtrC* aPresetName)
-{
- DEBUG("CAMMSTunerControl::GetPresetNameL +");
- TAMMSTunerPreset tunerPreset;
-
- iPresetsHandler->GetPresetL(aPreset, tunerPreset);
-
- aPresetName->Set(tunerPreset.PresetName());
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::ClassName()
-// -----------------------------------------------------------------------------
-const TDesC& CAMMSTunerControl::ClassName() const
-{
- return KControlImplName;
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::PublicClassName()
-// -----------------------------------------------------------------------------
-const TDesC& CAMMSTunerControl::PublicClassName() const
-{
- return KControlPublicName;
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::MToTuneComplete()
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::MToTuneComplete(TInt aError)
-{
- if (iActiveSchedulerWait->IsStarted())
- {
- DEBUG("CAMMSTunerControl::MToTuneComplete AsyncStop");
- iActiveSchedulerWait->AsyncStop();
- }
- DEBUG_INT("CAMMSTunerControl::MToTuneComplete ERROR = %d", aError);
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::MTcoFrequencyChanged
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::MTcoFrequencyChanged(const TFrequency& /*aOldFrequency*/,
- const TFrequency& /*aNewFrequency*/)
-{
- DEBUG("CAMMSTunerControl::MTcoFrequencyChanged");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::MTcoStateChanged
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::MTcoStateChanged(const TUint32& /*aOldState*/,
- const TUint32& /*aNewState*/)
-{
- DEBUG("CAMMSTunerControl::MTcoStateChanged");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::MTcoAntennaDetached
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::MTcoAntennaDetached()
-{
- DEBUG("CAMMSTunerControl::MTcoAntennaDetached");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::MTcoAntennaAttached
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::MTcoAntennaAttached()
-{
- DEBUG("CAMMSTunerControl::MTcoAntennaAttached");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::FlightModeChanged
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::FlightModeChanged(TBool /*aFlightMode*/)
-{
- DEBUG("CAMMSTunerControl::FlightModeChanged");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::MTsoStereoReceptionChanged
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::MTsoStereoReceptionChanged(TBool /*aStereo*/)
-{
- DEBUG("CAMMSTunerControl::MTsoStereoReceptionChanged");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerControl::MTsoForcedMonoChanged
-// -----------------------------------------------------------------------------
-void CAMMSTunerControl::MTsoForcedMonoChanged(TBool /*aForcedMono*/)
-{
- DEBUG("CAMMSTunerControl::MTsoForcedMonoChanged");
-}
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/src/cammstunerplayer.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +0,0 @@
-/*
-* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class is a tuner player
-*
-*/
-
-
-
-// INCLUDE FILES
-#include "CAMMSTunerPlayer.h"
-#include "CAMMSTunerControl.h"
-
-#include <tuner.h>
-#include <jdebug.h>
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPlayer::CAMMSTunerPlayer
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CAMMSTunerPlayer::CAMMSTunerPlayer()
-{
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPlayer::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CAMMSTunerPlayer* CAMMSTunerPlayer::NewL(CAMMSTunerControl* aTunerControl)
-{
- CAMMSTunerPlayer* self = new(ELeave) CAMMSTunerPlayer;
-
- CleanupStack::PushL(self);
- self->ConstructL(aTunerControl);
- CleanupStack::Pop();
-
- return self;
-}
-
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPlayer::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CAMMSTunerPlayer::ConstructL(CAMMSTunerControl* aTunerControl)
-{
- DEBUG("CAMMSTunerPlayer::ConstructL +");
- iTunerControl = aTunerControl;
- iTunerPlayerUtility = iTunerControl->TunerUtility()->TunerPlayerUtilityL(*this);
- iActiveSchedulerWait = new(ELeave) CActiveSchedulerWait();
- iIsInitialized = EFalse;
-
- DEBUG("CAMMSTunerPlayer::ConstructL -");
-}
-
-// Destructor
-CAMMSTunerPlayer::~CAMMSTunerPlayer()
-{
- DEBUG("CAMMSTunerPlayer::~CAMMSTunerPlayer +");
- delete iTunerPlayerUtility;
- delete iActiveSchedulerWait;
- DEBUG("CAMMSTunerPlayer::~CAMMSTunerPlayer -");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPlayer::PrefetchL()
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-void CAMMSTunerPlayer::PrefetchL()
-{
- DEBUG("CAMMSTunerPlayer::PrefetchL +");
- //this must be called before play, stop, mute etc...
- iTunerPlayerUtility->InitializeL(EMdaPriorityNormal,
- EMdaPriorityPreferenceTimeAndQuality);
- if (!iActiveSchedulerWait->IsStarted())
- {
- iActiveSchedulerWait->Start(); // CSI: 10 Active object state already checked. #
- }
-
- DEBUG("CAMMSTunerPlayer::PrefetchL -");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPlayer::StartL()
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-void CAMMSTunerPlayer::StartL()
-{
- DEBUG("CAMMSTunerPlayer::StartL +");
- if (iIsInitialized)
- {
- // inform java side
- ChangeState(EStarted);
- iTunerPlayerUtility->Play();
- // set time when started
- iStartTime = CurrentTime();
-
- TInt64 time;
- GetMediaTime(&time);
- PostLongEvent(CMMAPlayerEvent::EStarted, time);
- }
- else
- {
- User::Leave(KErrNotReady);
- }
- DEBUG("CAMMSTunerPlayer::StartL -");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPlayer::StopL()
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-void CAMMSTunerPlayer::StopL(TBool /*aPostEvent*/)
-{
- DEBUG("CAMMSTunerPlayer::StopL +");
- if (iIsInitialized)
- {
- ChangeState(EPrefetched);
-
- iTunerPlayerUtility->Stop();
-
- TInt64 time;
- GetMediaTime(&time);
- iStartTime = KErrNotFound;
- PostLongEvent(CMMAPlayerEvent::EStopped, time);
- }
- else
- {
- User::Leave(KErrNotReady);
- }
-
- DEBUG("CAMMSTunerPlayer::StopL -");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPlayer::DeallocateL()
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-void CAMMSTunerPlayer::DeallocateL()
-{
-
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPlayer::GetMediaTime()
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-void CAMMSTunerPlayer::GetMediaTime(TInt64* aMediaTime)
-{
- if (iState == EStarted)
- {
- // add play time to media time
- iMediaTime += CurrentTime() - iStartTime;
- // set new start time
- iStartTime = CurrentTime();
- }
-
- // set value to parameter
- (*aMediaTime) = iMediaTime;
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPlayer::MTapoInitializeComplete
-// Initialize complete event. This event is asynchronous and is received after
-// a call to CMMTunerAudioPlayerUtility::InitializeL().
-// -----------------------------------------------------------------------------
-void CAMMSTunerPlayer::MTapoInitializeComplete(TInt aError)
-{
- DEBUG_INT("CAMMSTunerPlayer::MTapoInitializeComplete aError = %d", aError);
- if (iActiveSchedulerWait->IsStarted())
- {
- DEBUG("CAMMSTunerControl::MToTuneComplete AsyncStop");
- iActiveSchedulerWait->AsyncStop();
- }
- if (aError == KErrNone)
- {
- iIsInitialized = ETrue;
- ChangeState(EPrefetched);
- // Inform Java side.
- PostActionCompleted(KErrNone);
- }
- else
- {
- DEBUG_INT("CAMMSTunerPlayer::MTapoInitializeComplete aError = %d", aError);
- PostLongEvent(CMMAPlayerEvent::EError, aError);
- //User::Leave( aError );
- }
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPlayer::MTapoPlayEvent
-// Passes an asychronous event to the tuner client.
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-void CAMMSTunerPlayer::MTapoPlayEvent(
- MMMTunerAudioPlayerObserver::TEventType /*aEvent*/,
- TInt /*aError*/, TAny* /*aAdditionalInfo*/)
-{
- DEBUG("CAMMSTunerPlayer::MTapoPlayEvent +");
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPlayer::CurrentTime()
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-TInt64 CAMMSTunerPlayer::CurrentTime()
-{
- TTime time;
- time.HomeTime();
- return time.Int64();
-}
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/src/cammstunerpresetshandler.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ?Description
-*
-*/
-
-
-
-// INCLUDE FILES
-#include "CAMMSTunerPresetsHandler.h"
-#include "TAMMSTunerPreset.h"
-
-#include <FMRadioEngineCRKeys.h>
-#include <s32mem.h>
-#include <jdebug.h>
-
-
-// CONSTANTS
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPresetsHandler::CAMMSTunerPresetsHandler
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-CAMMSTunerPresetsHandler::CAMMSTunerPresetsHandler()
-{
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPresetsHandler::ConstructL
-// Symbian 2nd phase constructor can leave.
-// -----------------------------------------------------------------------------
-//
-void CAMMSTunerPresetsHandler::ConstructL()
-{
- iCentralRepository = CRepository::NewL(KCRUidFMRadioEngine);
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPresetsHandler::NewL
-// Two-phased constructor.
-// -----------------------------------------------------------------------------
-//
-CAMMSTunerPresetsHandler* CAMMSTunerPresetsHandler::NewL()
-{
- CAMMSTunerPresetsHandler* self = new(ELeave) CAMMSTunerPresetsHandler;
-
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop();
-
- return self;
-}
-
-
-// Destructor
-CAMMSTunerPresetsHandler::~CAMMSTunerPresetsHandler()
-{
- delete iCentralRepository;
-}
-
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPresetsHandler::GetPreset
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CAMMSTunerPresetsHandler::GetPresetL(TInt aPreset, TAMMSTunerPreset &aTunerPreset)
-{
- // KFmRadioPresetChannel1 = The first preset channel's location in central repository
- TInt tempChannelIndex = KFmRadioPresetChannel1 + aPreset;
-
- HBufC8* buf = HBufC8::NewLC(sizeof(TAMMSTunerPreset));
- TPtr8 bufPtr = buf->Des();
-
- TInt err = iCentralRepository->Get(tempChannelIndex, bufPtr);
- if (err == KErrNone)
- {
- RDesReadStream inStream;
- inStream.Open(bufPtr);
- CleanupClosePushL(inStream);
- aTunerPreset.InternalizeL(inStream);
- CleanupStack::PopAndDestroy(&inStream);
- }
- else
- {
- User::Leave(err);
- }
- CleanupStack::PopAndDestroy(); // buf
-}
-
-// -----------------------------------------------------------------------------
-// CAMMSTunerPresetsHandler::SavePreset
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CAMMSTunerPresetsHandler::SavePresetL(TInt aPreset, TAMMSTunerPreset aTunerPreset)
-{
- // KFmRadioPresetChannel1 = The first preset channel's location in central repository
- TInt fieldNameIndex = KFmRadioPresetChannel1 + TUint32(aPreset);
-
- HBufC8* buf = HBufC8::NewLC(sizeof(TAMMSTunerPreset));
- TPtr8 bufPtr = buf->Des();
-
- RDesWriteStream outStream(bufPtr);
- CleanupClosePushL(outStream);
- aTunerPreset.ExternalizeL(outStream);
- outStream.CommitL();
- CleanupStack::PopAndDestroy(&outStream);
-
- iCentralRepository->Set(fieldNameIndex, bufPtr);
- CleanupStack::PopAndDestroy(); //buf
-}
-
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/src/cammstunervolumecontrol.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class is used for setting volume to tuner player
-*
-*/
-
-
-
-// INCLUDE FILES
-#include "CAMMSTunerVolumeControl.h"
-#include "CAMMSTunerPlayer.h"
-
-#include <jdebug.h>
-
-
-CAMMSTunerVolumeControl::CAMMSTunerVolumeControl(CAMMSTunerPlayer* aTunerPlayer)
- : CMMAVolumeControl(aTunerPlayer)
-{
- iTunerPlayer = aTunerPlayer;
-}
-
-CAMMSTunerVolumeControl* CAMMSTunerVolumeControl::NewL(CAMMSTunerPlayer* aTunerPlayer)
-{
- DEBUG("CAMMSTunerVolumeControl::NewL +");
- CAMMSTunerVolumeControl* self = new(ELeave) CAMMSTunerVolumeControl(aTunerPlayer);
-
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop();
-
- return self;
-}
-
-void CAMMSTunerVolumeControl::DoSetLevelL(TInt aLevel)
-{
- DEBUG_INT("CAMMSTunerVolumeControl::DoSetLevelL, aLevel = %d", aLevel);
- // TunerPlayer does not currently have SetVolumeL method
- User::Invariant();
-}
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/src/protocol.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Protocol JNI wrapper.
- *
-*/
-
-
-// EXTERNAL INCLUDES
-#include <jutils.h>
-#include <jdebug.h>
-
-// INTERNAL INCLUDES
-#include "com_nokia_microedition_media_protocol_capture_radio_Protocol.h"
-#include <CMMAEventSource.h>
-#include "CAMMSTunerControl.h"
-#include "CAMMSTunerPlayer.h"
-#include "AMMSTunerFactory.h"
-
-// Creates native tuner player
-JNIEXPORT jint JNICALL
-Java_com_nokia_microedition_media_protocol_capture_radio_Protocol__1createNativeTunerPlayer(
- JNIEnv* aJniEnv,
- jobject /*aPeer*/,
- jint aEventSourceHandle,
- jstring aLocatorParameters)
-{
- DEBUG("AMMS Java_com_nokia_microedition_media_protocol_capture_radio_Protocol__1createNativeTunerPlayer +");
- CMMAEventSource* eventSource = JavaUnhand< CMMAEventSource >(
- aEventSourceHandle);
-
- RJString locatorParams(*aJniEnv, aLocatorParameters);
-
- CAMMSTunerPlayer* tunerPlayer = NULL;
-
- TInt error = eventSource->ExecuteTrap(
- &AMMSTunerFactory::CreatePlayerL,
- &tunerPlayer,
- (const TDesC*)&locatorParams);
-
- DEBUG_INT("AMMS __1createNativeTunerPlayer, error = %d", error);
-
- if (error != KErrNone)
- {
- return error;
- }
-
- return JavaMakeHandle(tunerPlayer);
-}
-
--- a/javauis/amms_akn/src_tuner/native/src/tammstunerpreset.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ?Description
-*
-*/
-
-
-
-// INCLUDE FILES
-#include "TAMMSTunerPreset.h"
-
-#include <s32mem.h>
-#include <jdebug.h>
-
-
-// ============================ MEMBER FUNCTIONS ===============================
-
-// -----------------------------------------------------------------------------
-// TAMMSTunerPreset::TAMMSTunerPreset
-// C++ default constructor can NOT contain any code, that
-// might leave.
-// -----------------------------------------------------------------------------
-//
-TAMMSTunerPreset::TAMMSTunerPreset()
-{
-}
-
-// -----------------------------------------------------------------------------
-// TAMMSTunerPreset::SetPresetName
-// -----------------------------------------------------------------------------
-//
-void TAMMSTunerPreset::SetPresetName(const TDesC* aPresetName)
-{
- iPresetName.Copy(*aPresetName);
-}
-
-// -----------------------------------------------------------------------------
-// TAMMSTunerPreset::SetPresetFrequency
-// -----------------------------------------------------------------------------
-//
-void TAMMSTunerPreset::SetPresetFrequency(const TInt aPresetFrequency)
-{
- iPresetFrequency = aPresetFrequency;
-}
-
-// -----------------------------------------------------------------------------
-// TAMMSTunerPreset::SetPresetStereoMode
-// -----------------------------------------------------------------------------
-//
-void TAMMSTunerPreset::SetPresetStereoMode(const TInt aPresetStereoMode)
-{
- iPresetStereoMode = aPresetStereoMode;
-}
-
-// -----------------------------------------------------------------------------
-// TAMMSTunerPreset::PresetName
-// -----------------------------------------------------------------------------
-//
-TPtrC TAMMSTunerPreset::PresetName()
-{
- return iPresetName;
-}
-
-// -----------------------------------------------------------------------------
-// TAMMSTunerPreset::PresetFrequency
-// -----------------------------------------------------------------------------
-//
-TInt TAMMSTunerPreset::PresetFrequency()
-{
- return iPresetFrequency;
-}
-
-// -----------------------------------------------------------------------------
-// TAMMSTunerPreset::PresetStereoMode
-// -----------------------------------------------------------------------------
-//
-TInt TAMMSTunerPreset::PresetStereoMode()
-{
- return iPresetStereoMode;
-}
-
-// -----------------------------------------------------------------------------
-// TAMMSTunerPreset::ExternalizeL
-// Writes preset values to stream.
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void TAMMSTunerPreset::ExternalizeL(RWriteStream& aStream) const
-{
- aStream<<iPresetName;
- aStream.WriteUint32L(iPresetFrequency);
- aStream.WriteUint32L(iPresetStereoMode);
-}
-
-// -----------------------------------------------------------------------------
-// TAMMSTunerPreset::InternalizeL
-// Reads preset values from stream.
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void TAMMSTunerPreset::InternalizeL(RReadStream& aStream)
-{
- aStream>>iPresetName;
- iPresetFrequency = aStream.ReadUint32L();
- iPresetStereoMode = aStream.ReadUint32L();
-}
-
-// End of File
--- a/javauis/amms_akn/src_tuner/native/src/tunercontrol.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,729 +0,0 @@
-/*
-* Copyright (c) 2005-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: TunerControl JNI wrapper.
- *
-*/
-
-
-// EXTERNAL INCLUDES
-#include <jutils.h>
-
-// INTERNAL INCLUDES
-#include "com_nokia_amms_control_tuner_TunerControlImpl.h"
-#include <CMMAEventSource.h>
-#include "CAMMSTunerControl.h"
-
-/**
-* Static delegator function for getMinFreq
-*/
-LOCAL_C void GetMinFreqL(CAMMSTunerControl* aNativeClass,
- TInt *aMinFreq)
-{
-
- *aMinFreq = aNativeClass->MinFreqL();
-}
-
-/**
-* getMinFreq JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1getMinFreq(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle)
-{
- TInt minFreq;
-
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(GetMinFreqL,
- nativeHandle,
- &minFreq);
-
- if (err != KErrNone)
- {
- return err;
- }
-
- return minFreq;
-}
-
-
-/**
-* Static delegator function for getMaxFreq
-*/
-LOCAL_C void GetMaxFreqL(CAMMSTunerControl* aNativeClass,
- TInt *aMaxFreq)
-{
-
- *aMaxFreq = aNativeClass->MaxFreqL();
-}
-
-/**
-* getMaxFreq JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1getMaxFreq(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle)
-{
- TInt maxFreq;
-
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(GetMaxFreqL,
- nativeHandle,
- &maxFreq);
-
- if (err != KErrNone)
- {
- return err;
- }
-
- return maxFreq;
-}
-
-
-/**
-* Static delegator function for setFrequency
-*/
-LOCAL_C void SetFreqL(CAMMSTunerControl* aNativeClass,
- TInt aFreq)
-{
-
- aNativeClass->SetFrequencyL(aFreq);
-}
-
-/**
-* Static delegator function for getFrequency
-*/
-LOCAL_C void GetFreqL(CAMMSTunerControl* aNativeClass,
- TInt *aFreq)
-{
- *aFreq = aNativeClass->FrequencyL();
-}
-
-/**
-* setFrequency JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1setFrequency(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle,
- jint aFreq)
-{
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(SetFreqL,
- nativeHandle,
- aFreq);
-
- if (err != KErrNone)
- {
- return err;
- }
-
- //get tuned frequency
- TInt tunedFreq;
- err = eventSource->ExecuteTrap(GetFreqL,
- nativeHandle,
- &tunedFreq);
- if (err != KErrNone)
- {
- return err;
- }
-
- return tunedFreq;
-}
-
-/**
-* getFrequency JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1getFrequency(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle)
-{
- TInt freq;
-
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(GetFreqL,
- nativeHandle,
- &freq);
- if (err != KErrNone)
- {
- return err;
- }
-
- return freq;
-}
-
-
-/**
-* Static delegator function for seek
-*/
-LOCAL_C void SeekL(CAMMSTunerControl* aNativeClass,
- TInt aStartFreq,
- TBool aUpwards,
- TInt* aSeekedFreq)
-{
-
- *aSeekedFreq = aNativeClass->SeekL(aStartFreq, aUpwards);
-}
-
-/**
-* seek JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1seek(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle,
- jint aStartFreq,
- jboolean aUpwards)
-{
- TInt seekedFreq;
-
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(SeekL,
- nativeHandle,
- aStartFreq,
- (TBool) aUpwards,
- &seekedFreq);
-
- if (err != KErrNone)
- {
- return err;
- }
-
- return seekedFreq;
-}
-
-
-/**
-* Static delegator function for getSquelch
-*/
-LOCAL_C void GetSquelchL(CAMMSTunerControl* aNativeClass,
- TBool* aSquelch)
-{
-
- *aSquelch = aNativeClass->SquelchL();
-}
-
-/**
-* getSquelch JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1getSquelch(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle)
-{
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TBool squelch = EFalse;
-
- TInt err = eventSource->ExecuteTrap(GetSquelchL,
- nativeHandle,
- &squelch);
-
- if (err != KErrNone)
- {
- return err;
- }
-
- if (!squelch)
- {
- //return 1 if false
- return 1;
- }
- //return 0 if true
- return KErrNone;
-}
-
-
-/**
-* Static delegator function for setSquelch
-*/
-LOCAL_C void SetSquelchL(CAMMSTunerControl* aNativeClass,
- TBool aSquelch)
-{
-
- aNativeClass->SetSquelchL(aSquelch);
-}
-
-/**
-* setSquelch JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1setSquelch(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle,
- jboolean aSquelch)
-{
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(SetSquelchL,
- nativeHandle,
- (TBool) aSquelch);
-
- if (err != KErrNone)
- {
- return err;
- }
-
- return KErrNone;
-}
-
-
-/**
-* Static delegator function for getSignalStrength
-*/
-LOCAL_C void GetSignalStrengthL(CAMMSTunerControl* aNativeClass,
- TInt *aSignalStrength)
-{
-
- *aSignalStrength = aNativeClass->SignalStrengthL();
-}
-
-/**
-* getSignalStrength JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1getSignalStrength(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle)
-{
- TInt signalStrength;
-
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(GetSignalStrengthL,
- nativeHandle,
- &signalStrength);
- if (err != KErrNone)
- {
- return err;
- }
-
- return signalStrength;
-}
-
-
-/**
-* Static delegator function for getStereoMode
-*/
-LOCAL_C void GetStereoModeL(CAMMSTunerControl* aNativeClass,
- TInt *aStereoMode)
-{
-
- *aStereoMode = aNativeClass->StereoModeL();
-}
-
-/**
-* getStereoMode JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1getStereoMode(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle)
-{
- TInt stereoMode;
-
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(GetStereoModeL,
- nativeHandle,
- &stereoMode);
- if (err != KErrNone)
- {
- return err;
- }
-
- return stereoMode;
-}
-
-
-/**
-* Static delegator function for setStereoMode
-*/
-LOCAL_C void SetStereoModeL(CAMMSTunerControl* aNativeClass,
- TInt aStereoMode)
-{
- aNativeClass->SetStereoModeL(aStereoMode);
-}
-
-/**
-* setStereoMode JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1setStereoMode(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle,
- jint aStereoMode)
-{
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(SetStereoModeL,
- nativeHandle,
- aStereoMode);
-
- return err;
-}
-
-
-/**
-* Static delegator function for usePreset
-*/
-LOCAL_C void UsePresetL(CAMMSTunerControl* aNativeClass,
- TInt aPreset)
-{
- aNativeClass->UsePresetL(aPreset);
-}
-
-/**
-* usePreset JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1usePreset(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle,
- jint aPreset)
-{
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(UsePresetL,
- nativeHandle,
- aPreset);
-
- return err;
-}
-
-
-/**
-* Static delegator function for setPreset__III
-*/
-LOCAL_C void SetPresetL(CAMMSTunerControl* aNativeClass,
- TInt aPreset)
-{
- aNativeClass->SetPresetL(aPreset);
-}
-
-/**
-* setPreset__III JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1setPreset__III(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle,
- jint aPreset)
-{
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(SetPresetL,
- nativeHandle,
- aPreset);
-
- return err;
-}
-
-
-/**
-* Static delegator function for setPreset__IIIII
-*/
-LOCAL_C void SetPresetL(CAMMSTunerControl* aNativeClass,
- TInt aPreset,
- TInt aFrequency,
- TInt aStereoMode)
-{
- aNativeClass->SetPresetL(aPreset, aFrequency, aStereoMode);
-}
-
-/**
-* setPreset__IIIII JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1setPreset__IIIII(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle,
- jint aPreset,
- jint aFrequency,
- jint aStereoMode)
-{
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(SetPresetL,
- nativeHandle,
- aPreset,
- aFrequency,
- aStereoMode);
-
- return err;
-}
-
-
-/**
-* Static delegator function for getPresetFrequency
-*/
-LOCAL_C void GetPresetFreqL(CAMMSTunerControl* aNativeClass,
- TInt aPreset,
- TInt *aPresetFreq)
-{
-
- *aPresetFreq = aNativeClass->PresetFrequencyL(aPreset);
-}
-
-/**
-* getPresetFrequency JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1getPresetFrequency(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle,
- jint aPreset)
-{
- TInt presetFreq;
-
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(GetPresetFreqL,
- nativeHandle,
- aPreset,
- &presetFreq);
- if (err != KErrNone)
- {
- return err;
- }
-
- return presetFreq;
-}
-
-
-/**
-* Static delegator function for getPresetStereoMode
-*/
-LOCAL_C void GetPresetStereoModeL(CAMMSTunerControl* aNativeClass,
- TInt aPreset,
- TInt *aPresetStereoMode)
-{
-
- *aPresetStereoMode = aNativeClass->PresetStereoModeL(aPreset);
-}
-
-/**
-* getPresetStereoMode JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1getPresetStereoMode(
- JNIEnv* /*aJni*/,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle,
- jint aPreset)
-{
- TInt presetStereoMode;
-
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TInt err = eventSource->ExecuteTrap(GetPresetStereoModeL,
- nativeHandle,
- aPreset,
- &presetStereoMode);
- if (err != KErrNone)
- {
- return err;
- }
-
- return presetStereoMode;
-}
-
-
-/**
-* Static delegator function for setPresetName
-*/
-LOCAL_C void SetPresetNameL(CAMMSTunerControl* aNativeClass,
- TInt aPreset,
- const TDesC* aPresetName)
-{
- aNativeClass->SetPresetNameL(aPreset, aPresetName);
-}
-
-/**
-* setPresetName JNI function
-*/
-JNIEXPORT jint JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1setPresetName(
- JNIEnv* aJni,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle,
- jint aPreset,
- jstring aPresetName)
-{
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- RJString presetName(*aJni, aPresetName);
-
- TInt err = eventSource->ExecuteTrap(SetPresetNameL,
- nativeHandle,
- aPreset,
- (const TDesC*)&presetName);
-
- return err;
-}
-
-
-/**
-* Static delegator function for getPresetName
-*/
-LOCAL_C void GetPresetNameL(CAMMSTunerControl* aNativeClass,
- TInt aPreset,
- TPtrC* aPresetName)
-{
- aNativeClass->GetPresetNameL(aPreset, aPresetName);
-}
-
-/**
-* getPresetName JNI function
-*/
-JNIEXPORT jstring JNICALL
-Java_com_nokia_amms_control_tuner_TunerControlImpl__1getPresetName(
- JNIEnv* aJni,
- jobject /*aJobject*/,
- jint aEventSourceHandle,
- jint aTunerControlHandle,
- jint aPreset,
- jintArray aError)
-{
- CMMAEventSource* eventSource =
- JavaUnhand<CMMAEventSource>(aEventSourceHandle);
-
- CAMMSTunerControl* nativeHandle =
- JavaUnhand<CAMMSTunerControl>(aTunerControlHandle);
-
- TPtrC presetNamePtr(NULL, 0);
- jstring presetName = NULL;
-
- TInt err = eventSource->ExecuteTrap(GetPresetNameL,
- nativeHandle,
- aPreset,
- &presetNamePtr);
-
- if (err == KErrNone)
- {
- presetName = CreateJavaString(*aJni, presetNamePtr);
- if (!presetName)
- {
- err = KErrNotSupported;
- }
- }
-
- jint javaErr[ 1 ] = { err };
- aJni->SetIntArrayRegion(aError, 0, 1, javaErr);
-
- return presetName;
-}
-
-// End of file
--- a/javauis/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/bld.inf Thu Aug 19 09:48:13 2010 +0300
@@ -18,6 +18,7 @@
PRJ_PLATFORMS
default
+#include "nokiasound/build/bld.inf"
#include "amms_akn/build/bld.inf"
#include "coreui_akn/build/bld.inf"
#include "eswt_akn/eswtdirectcontent/build/bld.inf"
@@ -25,7 +26,6 @@
#include "m2g_akn/build/bld.inf"
#include "m3g_akn/build/bld.inf"
#include "mmapi_akn/build/bld.inf"
-#include "nokiasound_akn/build/bld.inf"
#include "remconobserver_akn/build/bld.inf"
#include "runtimeui_akn/build/bld.inf"
#include "softnotification_akn/build/bld.inf"
--- a/javauis/coreui_akn/build/javacoreui_0x2002DCA8.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/coreui_akn/build/javacoreui_0x2002DCA8.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javacoreui.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javauis/coreui_akn/javasrc/com/nokia/mj/impl/coreuiavkon/CoreUiImpl.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/coreui_akn/javasrc/com/nokia/mj/impl/coreuiavkon/CoreUiImpl.java Thu Aug 19 09:48:13 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"
@@ -87,7 +87,7 @@
}
}
- String splashScreenImg = appInfo.getAttribute("MIDlet-Splash-Screen-Image");
+ String splashScreenImg = appInfo.getAttribute("Nokia-MIDlet-Splash-Screen-Image");
if (splashScreenImg != null)
{
if (splashScreenImg.toLowerCase().equals("suppress"))
--- a/javauis/coreui_akn/src/coreuiavkonimpl.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/coreui_akn/src/coreuiavkonimpl.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -220,7 +220,8 @@
{
uidToTUid(mMidletUid, mMidletTUid);
if (mMidletUid == Uid(L"[2001843a]") || // Is it installer.
- mMidletUid == Uid(L"[2002121e]")) // Is it TCK runner.
+ mMidletUid == Uid(L"[2002121e]") || // Is it TCK runner.
+ mMidletUid == Uid(L"[2002FF61]")) // Is it Java Control Panel.
{
mShowStartScreen = false;
}
--- a/javauis/eswt_akn/eswtapifacade/group/eswtapifacade.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/eswtapifacade/group/eswtapifacade.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -50,13 +50,17 @@
USERINCLUDE ../inc
USERINCLUDE ../../org.eclipse.ercp.swt.s60/native/inc
-SYSTEMINCLUDE /epoc32/include/ecom
+
+#ifdef RD_JAVA_S60_RELEASE_5_0
+SYSTEMINCLUDE /epoc32/include/ecom // Due to schemehandler.inl in S60 5.0 2009w18
+#endif
// java/javauis/inc
-SYSTEMINCLUDE ../../../inc
+USERINCLUDE ../../../inc
// java/inc
-SYSTEMINCLUDE ../../../../inc
+USERINCLUDE ../../../../inc
+
SOURCEPATH ../src
SOURCE swtbrowseractiveapdb.cpp
--- a/javauis/eswt_akn/eswtdirectcontent/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/eswtdirectcontent/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -26,10 +26,6 @@
<property name="java.src.paths" value="../src"/>
- <target name="compile">
- <omj.javac classpath="${compile.result.root}/javautils/classes/first"/>
- </target>
-
<property name="javah.classnames"
value="org.eclipse.swt.widgets.DCControl"/>
</project>
--- a/javauis/eswt_akn/eswtdirectcontent/build/eswtdirectcontent_0x2002DC94.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/eswtdirectcontent/build/eswtdirectcontent_0x2002DC94.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : eswtdirectcontent.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../native/inc
--- a/javauis/eswt_akn/eswtdirectcontent/native/inc/swtdccontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/eswtdirectcontent/native/inc/swtdccontrol.h Thu Aug 19 09:48:13 2010 +0300
@@ -75,6 +75,8 @@
void DoDraw();
void DoCallDSAResourcesCallback(MUiEventConsumer *aConsumer);
void DoCallUICallback(MUiEventConsumer *aConsumer, TInt aCallbackId);
+ void FixUIOrientation();
+ void UnFixUIOrientation();
public: // From CCoeControl
void SetDimmed(TBool aDimmed);
@@ -116,6 +118,7 @@
TBool aIsInUiThread);
void MdcGetUICallback(MUiEventConsumer& aConsumer, TInt aCallbackId);
TRect MdcContainerWindowRect() const;
+ void MdcFixUIOrientation(TBool aEnableFix);
public: // From MSwtDcFullscreenProvider
void HandleDcEvent(int aType);
@@ -193,7 +196,11 @@
// This observer receives requests from any thread and asynchronously
// calls a callback in ESWT thread to a given receiver
CSwtDcObserver* iDcObserver;
-
+
+ // Indicates that UI orientation has been set to fixed
+ // by this instance already, so another calls of
+ // MdcFixUIOrientation(ETrue) are ignored then. And vice versa.
+ TBool iFixedOrientationSet;
};
--- a/javauis/eswt_akn/eswtdirectcontent/native/inc/swtdcobserver.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/eswtdirectcontent/native/inc/swtdcobserver.h Thu Aug 19 09:48:13 2010 +0300
@@ -53,7 +53,7 @@
* @lib eswtdirectcontent.dll
* @since S60 v5.2
*/
-class CSwtDcObserver : public CActive
+NONSHARABLE_CLASS(CSwtDcObserver) : public CActive
{
public:
/**
--- a/javauis/eswt_akn/eswtdirectcontent/native/src/swtdccontrol.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/eswtdirectcontent/native/src/swtdccontrol.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -39,7 +39,9 @@
{
ERedraw,
ESetFullScreen,
- EUpdateFullScreen
+ EUpdateFullScreen,
+ EFixUIOrientation,
+ EUnFixUIOrientation
};
///////////////////////////////////////////////////////////////////////////////
@@ -53,6 +55,7 @@
, iDsaWasStartedAlready(EFalse)
#endif
, iDcObserver(NULL)
+ , iFixedOrientationSet(EFalse)
{
SetFocusing(EFalse);
}
@@ -85,6 +88,12 @@
iDcObserver = NULL;
}
+ if (iFixedOrientationSet)
+ {
+ iDisplay.UiUtils().UnRegisterFixScreenOrientation();
+ iFixedOrientationSet = EFalse;
+ }
+
DEBUG("CSwtDCControl::~CSwtDCControl()-");
}
@@ -543,6 +552,18 @@
return GetShell().Control()->GetBounds();
}
+void CSwtDCControl::MdcFixUIOrientation(TBool aEnableFix)
+{
+ if (aEnableFix)
+ {
+ iDcObserver->InvokeDcEvent(*this, EFixUIOrientation);
+ }
+ else
+ {
+ iDcObserver->InvokeDcEvent(*this, EUnFixUIOrientation);
+ }
+}
+
#ifdef SWTDCCONTROL_DSA_ENABLED
void CSwtDCControl::Restart(RDirectScreenAccess::TTerminationReasons /*aReason*/)
{
@@ -801,6 +822,24 @@
return iContent && iContent->MdcFrameBuffer() != 0;
}
+void CSwtDCControl::FixUIOrientation()
+{
+ if (!iFixedOrientationSet)
+ {
+ iDisplay.UiUtils().RegisterFixScreenOrientation();
+ iFixedOrientationSet = ETrue;
+ }
+}
+
+void CSwtDCControl::UnFixUIOrientation()
+{
+ if (iFixedOrientationSet)
+ {
+ iDisplay.UiUtils().UnRegisterFixScreenOrientation();
+ iFixedOrientationSet = EFalse;
+ }
+}
+
/**
* Receives asynchronous events from iDcObserver
*/
@@ -817,6 +856,12 @@
case EUpdateFullScreen:
UpdateFullScreenState();
break;
+ case EFixUIOrientation:
+ FixUIOrientation();
+ break;
+ case EUnFixUIOrientation:
+ UnFixUIOrientation();
+ break;
}
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/bwins/eswtu.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/bwins/eswtu.def Thu Aug 19 09:48:13 2010 +0300
@@ -13,80 +13,85 @@
?GetBackground@ASwtControlBase@@UBE?AVTRgb@@XZ @ 12 NONAME ; class TRgb ASwtControlBase::GetBackground(void) const
?Redraw@ASwtControlBase@@UAEXXZ @ 13 NONAME ; void ASwtControlBase::Redraw(void)
?GetPopupMenu@ASwtControlBase@@UBEPBVMSwtMenu@@XZ @ 14 NONAME ; class MSwtMenu const * ASwtControlBase::GetPopupMenu(void) const
- ?SetEnabled@ASwtControlBase@@UAEXH@Z @ 15 NONAME ; void ASwtControlBase::SetEnabled(int)
- ?Flags@ASwtControlBase@@UBEIXZ @ 16 NONAME ; unsigned int ASwtControlBase::Flags(void) const
- ?HandlePositionChanged@ASwtControlBase@@IAEXXZ @ 17 NONAME ; void ASwtControlBase::HandlePositionChanged(void)
- ?UiUtils@ASwtControlBase@@IBEAAVCSwtUiUtils@@XZ @ 18 NONAME ; class CSwtUiUtils & ASwtControlBase::UiUtils(void) const
- ?Paint@ASwtControlBase@@UBEXABVTRect@@HPAVMSwtGc@@PAHHPAVHBufC16@@@Z @ 19 NONAME ; void ASwtControlBase::Paint(class TRect const &, int, class MSwtGc *, int *, int, class HBufC16 *) const
- ?Style@ASwtControlBase@@UBEHXZ @ 20 NONAME ; int ASwtControlBase::Style(void) const
- ?HasDoNotDrawFlag@ASwtControlBase@@UBEHXZ @ 21 NONAME ; int ASwtControlBase::HasDoNotDrawFlag(void) const
- ?DoDelete@ASwtControlBase@@MAEXXZ @ 22 NONAME ; void ASwtControlBase::DoDelete(void)
- ?AddToControlStackL@ASwtControlBase@@UAEXH@Z @ 23 NONAME ; void ASwtControlBase::AddToControlStackL(int)
- ?DoPaint@ASwtControlBase@@MBEXABVTRect@@@Z @ 24 NONAME ; void ASwtControlBase::DoPaint(class TRect const &) const
- ?FocusBackgroundPolicy@ASwtControlBase@@UBEHXZ @ 25 NONAME ; int ASwtControlBase::FocusBackgroundPolicy(void) const
- ?IsDescentOf@ASwtControlBase@@UBEHABVMSwtControl@@@Z @ 26 NONAME ; int ASwtControlBase::IsDescentOf(class MSwtControl const &) const
- ?IsDefaultBackgroundUse@ASwtControlBase@@UBEHXZ @ 27 NONAME ; int ASwtControlBase::IsDefaultBackgroundUse(void) const
- ?GetForeground@ASwtControlBase@@UBE?AVTRgb@@XZ @ 28 NONAME ; class TRgb ASwtControlBase::GetForeground(void) const
- ?GetLocation@ASwtControlBase@@UBE?AVTPoint@@XZ @ 29 NONAME ; class TPoint ASwtControlBase::GetLocation(void) const
- ?GetTopCaptionedControl@ASwtControlBase@@UBEPAVMSwtCaptionedControl@@XZ @ 30 NONAME ; class MSwtCaptionedControl * ASwtControlBase::GetTopCaptionedControl(void) const
- ?GetVisible@ASwtControlBase@@UBEHXZ @ 31 NONAME ; int ASwtControlBase::GetVisible(void) const
- ??1ASwtControlBase@@MAE@XZ @ 32 NONAME ; ASwtControlBase::~ASwtControlBase(void)
- ?Update@ASwtControlBase@@UBEXXZ @ 33 NONAME ; void ASwtControlBase::Update(void) const
- ?MSKSelCmdEnabled@ASwtControlBase@@UBEHXZ @ 34 NONAME ; int ASwtControlBase::MSKSelCmdEnabled(void) const
- ?IsFocusable@ASwtControlBase@@UBEHH@Z @ 35 NONAME ; int ASwtControlBase::IsFocusable(int) const
- ??0ASwtControlBase@@IAE@AAVMSwtDisplay@@PAV_jweak@@PAVMSwtComposite@@H@Z @ 36 NONAME ; ASwtControlBase::ASwtControlBase(class MSwtDisplay &, class _jweak *, class MSwtComposite *, int)
- ?HandleUpdate@ASwtControlBase@@UAEXXZ @ 37 NONAME ; void ASwtControlBase::HandleUpdate(void)
- ?GetWidgetSize@ASwtControlBase@@UBE?AVTSize@@XZ @ 38 NONAME ; class TSize ASwtControlBase::GetWidgetSize(void) const
- ?CbaButtonIsUsed@ASwtControlBase@@UBEHH@Z @ 39 NONAME ; int ASwtControlBase::CbaButtonIsUsed(int) const
- ?IsLongTapAnimationCandidate@ASwtControlBase@@UBEHABUTPointerEvent@@@Z @ 40 NONAME ; int ASwtControlBase::IsLongTapAnimationCandidate(struct TPointerEvent const &) const
- ?DefaultFont@ASwtControlBase@@MBEABVMSwtFont@@XZ @ 41 NONAME ; class MSwtFont const & ASwtControlBase::DefaultFont(void) const
- ?SetLocation@ASwtControlBase@@UAEXABVTPoint@@@Z @ 42 NONAME ; void ASwtControlBase::SetLocation(class TPoint const &)
- ??1CSwtServer@@UAE@XZ @ 43 NONAME ; CSwtServer::~CSwtServer(void)
- ?IsPaintingUrgently@ASwtControlBase@@UBEHXZ @ 44 NONAME ; int ASwtControlBase::IsPaintingUrgently(void) const
- ?HandlePointerEventL@ASwtControlBase@@UAEXABUTPointerEvent@@@Z @ 45 NONAME ; void ASwtControlBase::HandlePointerEventL(struct TPointerEvent const &)
- ?SetForegroundL@ASwtControlBase@@UAEXPBVMSwtColor@@@Z @ 46 NONAME ; void ASwtControlBase::SetForegroundL(class MSwtColor const *)
- ?SetWidgetSize@ASwtControlBase@@UAEXABVTSize@@@Z @ 47 NONAME ; void ASwtControlBase::SetWidgetSize(class TSize const &)
- ?SetPopupMenuL@ASwtControlBase@@UAEXPBVMSwtMenu@@@Z @ 48 NONAME ; void ASwtControlBase::SetPopupMenuL(class MSwtMenu const *)
- ?NewGcL@ASwtControlBase@@UAEPAVMSwtGc@@XZ @ 49 NONAME ; class MSwtGc * ASwtControlBase::NewGcL(void)
- ?SetCapture@ASwtControlBase@@UAEXH@Z @ 50 NONAME ; void ASwtControlBase::SetCapture(int)
- ?FocusBackgroundNow@ASwtControlBase@@IBEPAVCAknsBasicBackgroundControlContext@@XZ @ 51 NONAME ; class CAknsBasicBackgroundControlContext * ASwtControlBase::FocusBackgroundNow(void) const
- ?ForceTraverseEvent@ASwtControlBase@@UAEHW4TSwtTraversal@@H@Z @ 52 NONAME ; int ASwtControlBase::ForceTraverseEvent(enum TSwtTraversal, int)
- ?RedrawRegion@ASwtControlBase@@UAEXABVTRect@@@Z @ 53 NONAME ; void ASwtControlBase::RedrawRegion(class TRect const &)
- ?GetVisibleRecursively@ASwtControlBase@@UBEHXZ @ 54 NONAME ; int ASwtControlBase::GetVisibleRecursively(void) const
- ?JavaPeer@ASwtControlBase@@UBEPAV_jweak@@XZ @ 55 NONAME ; class _jweak * ASwtControlBase::JavaPeer(void) const
- ?GetParent@ASwtControlBase@@UBEPAVMSwtComposite@@XZ @ 56 NONAME ; class MSwtComposite * ASwtControlBase::GetParent(void) const
- ?HandleSizeChanged@ASwtControlBase@@IAEXXZ @ 57 NONAME ; void ASwtControlBase::HandleSizeChanged(void)
- ?SetSwtFocus@ASwtControlBase@@UAEHH@Z @ 58 NONAME ; int ASwtControlBase::SetSwtFocus(int)
- ?MoveBelow@ASwtControlBase@@UAEXPBVMSwtControl@@@Z @ 59 NONAME ; void ASwtControlBase::MoveBelow(class MSwtControl const *)
- ?SetColorL@ASwtControlBase@@IAEXW4TLogicalColor@@PBVMSwtColor@@@Z @ 60 NONAME ; void ASwtControlBase::SetColorL(enum TLogicalColor, class MSwtColor const *)
- ?ClientRect@ASwtControlBase@@UBE?AVTRect@@XZ @ 61 NONAME ; class TRect ASwtControlBase::ClientRect(void) const
- ?GetBounds@ASwtControlBase@@UBE?AVTRect@@XZ @ 62 NONAME ; class TRect ASwtControlBase::GetBounds(void) const
- ?RemoveFromControlStack@ASwtControlBase@@UAEXXZ @ 63 NONAME ; void ASwtControlBase::RemoveFromControlStack(void)
- ?MSKLabelL@ASwtControlBase@@UBEPAVHBufC16@@XZ @ 64 NONAME ; class HBufC16 * ASwtControlBase::MSKLabelL(void) const
- ?SetRedraw@ASwtControlBase@@UAEXH@Z @ 65 NONAME ; void ASwtControlBase::SetRedraw(int)
- ?SetBounds@ASwtControlBase@@UAEXABVTRect@@@Z @ 66 NONAME ; void ASwtControlBase::SetBounds(class TRect const &)
- ?BorderOuterRect@ASwtControlBase@@MBE?AVTRect@@ABV2@@Z @ 67 NONAME ; class TRect ASwtControlBase::BorderOuterRect(class TRect const &) const
- ?SetVisible@ASwtControlBase@@UAEXH@Z @ 68 NONAME ; void ASwtControlBase::SetVisible(int)
- ?IsOnControlStack@ASwtControlBase@@UBEHXZ @ 69 NONAME ; int ASwtControlBase::IsOnControlStack(void) const
- ?NewL@CSwtServer@@SAPAV1@PAX@Z @ 70 NONAME ; class CSwtServer * CSwtServer::NewL(void *)
- ?GetFont@ASwtControlBase@@UBEPBVMSwtFont@@XZ @ 71 NONAME ; class MSwtFont const * ASwtControlBase::GetFont(void) const
- ?ToDisplay@ASwtControlBase@@UBE?AVTPoint@@ABV2@@Z @ 72 NONAME ; class TPoint ASwtControlBase::ToDisplay(class TPoint const &) const
- ?ToControl@ASwtControlBase@@UBE?AVTPoint@@ABV2@@Z @ 73 NONAME ; class TPoint ASwtControlBase::ToControl(class TPoint const &) const
- ?GetControlContext@ASwtControlBase@@UBEPAVMAknsControlContext@@XZ @ 74 NONAME ; class MAknsControlContext * ASwtControlBase::GetControlContext(void) const
- ?GraphicsDevice@ASwtControlBase@@UAEAAVCBitmapDevice@@XZ @ 75 NONAME ; class CBitmapDevice & ASwtControlBase::GraphicsDevice(void)
- ?GetShell@ASwtControlBase@@UBEAAVMSwtShell@@XZ @ 76 NONAME ; class MSwtShell & ASwtControlBase::GetShell(void) const
- ?MoveAbove@ASwtControlBase@@UAEXPBVMSwtControl@@@Z @ 77 NONAME ; void ASwtControlBase::MoveAbove(class MSwtControl const *)
- ?SetFontL@ASwtControlBase@@UAEXPBVMSwtFont@@@Z @ 78 NONAME ; void ASwtControlBase::SetFontL(class MSwtFont const *)
- ?PaintUrgently@ASwtControlBase@@UBEXABVTRect@@H@Z @ 79 NONAME ; void ASwtControlBase::PaintUrgently(class TRect const &, int) const
- ?SwtMopSupplyObject@ASwtControlBase@@QAE?AVPtr@TTypeUid@@V3@@Z @ 80 NONAME ; class TTypeUid::Ptr ASwtControlBase::SwtMopSupplyObject(class TTypeUid)
- ?UpdateDoNotDrawFlag@ASwtControlBase@@UAEXXZ @ 81 NONAME ; void ASwtControlBase::UpdateDoNotDrawFlag(void)
- ?GetTopShell@ASwtControlBase@@UBEAAVMSwtShell@@XZ @ 82 NONAME ; class MSwtShell & ASwtControlBase::GetTopShell(void) const
- ?DoControlSpecificFeedback@ASwtControlBase@@UBEXABH0ABUTPointerEvent@@@Z @ 83 NONAME ; void ASwtControlBase::DoControlSpecificFeedback(int const &, int const &, struct TPointerEvent const &) const
- ?Draw@ASwtControlBase@@UBEXAAVCWindowGc@@ABVCCoeControl@@ABVTRect@@@Z @ 84 NONAME ; void ASwtControlBase::Draw(class CWindowGc &, class CCoeControl const &, class TRect const &) const
- ?GetEnabled@ASwtControlBase@@UBEHXZ @ 85 NONAME ; int ASwtControlBase::GetEnabled(void) const
- ?RegisterWithParentL@ASwtControlBase@@IAEXXZ @ 86 NONAME ; void ASwtControlBase::RegisterWithParentL(void)
- ?DrawBorder@ASwtControlBase@@MBEXABVTRect@@@Z @ 87 NONAME ; void ASwtControlBase::DrawBorder(class TRect const &) const
- ?ComputeTabListL@ASwtControlBase@@UAEXAAV?$RPointerArray@VMSwtControl@@@@@Z @ 88 NONAME ; void ASwtControlBase::ComputeTabListL(class RPointerArray<class MSwtControl> &)
- ?VisibleRect@ASwtControlBase@@UBE?AVTRect@@H@Z @ 89 NONAME ; class TRect ASwtControlBase::VisibleRect(int) const
- ?EnableFocusHighlight@ASwtControlBase@@UAEXH@Z @ 90 NONAME ; void ASwtControlBase::EnableFocusHighlight(int)
+ ?GetNearestCaptionedControl@ASwtControlBase@@UBEPAVMSwtCaptionedControl@@H@Z @ 15 NONAME ; class MSwtCaptionedControl * ASwtControlBase::GetNearestCaptionedControl(int) const
+ ?SetEnabled@ASwtControlBase@@UAEXH@Z @ 16 NONAME ; void ASwtControlBase::SetEnabled(int)
+ ?Flags@ASwtControlBase@@UBEIXZ @ 17 NONAME ; unsigned int ASwtControlBase::Flags(void) const
+ ?HandlePositionChanged@ASwtControlBase@@IAEXXZ @ 18 NONAME ; void ASwtControlBase::HandlePositionChanged(void)
+ ?UiUtils@ASwtControlBase@@IBEAAVCSwtUiUtils@@XZ @ 19 NONAME ; class CSwtUiUtils & ASwtControlBase::UiUtils(void) const
+ ?Paint@ASwtControlBase@@UBEXABVTRect@@HPAVMSwtGc@@PAHHPAVHBufC16@@@Z @ 20 NONAME ; void ASwtControlBase::Paint(class TRect const &, int, class MSwtGc *, int *, int, class HBufC16 *) const
+ ?Style@ASwtControlBase@@UBEHXZ @ 21 NONAME ; int ASwtControlBase::Style(void) const
+ ?HasDoNotDrawFlag@ASwtControlBase@@UBEHXZ @ 22 NONAME ; int ASwtControlBase::HasDoNotDrawFlag(void) const
+ ?DoDelete@ASwtControlBase@@MAEXXZ @ 23 NONAME ; void ASwtControlBase::DoDelete(void)
+ ?AddToControlStackL@ASwtControlBase@@UAEXH@Z @ 24 NONAME ; void ASwtControlBase::AddToControlStackL(int)
+ ?DoPaint@ASwtControlBase@@MBEXABVTRect@@@Z @ 25 NONAME ; void ASwtControlBase::DoPaint(class TRect const &) const
+ ?VisibleRect@ASwtControlBase@@UBE?AVTRect@@H@Z @ 26 NONAME ; class TRect ASwtControlBase::VisibleRect(int) const
+ ?FocusBackgroundPolicy@ASwtControlBase@@UBEHXZ @ 27 NONAME ; int ASwtControlBase::FocusBackgroundPolicy(void) const
+ ?IsDescentOf@ASwtControlBase@@UBEHABVMSwtControl@@@Z @ 28 NONAME ; int ASwtControlBase::IsDescentOf(class MSwtControl const &) const
+ ?IsDefaultBackgroundUse@ASwtControlBase@@UBEHXZ @ 29 NONAME ; int ASwtControlBase::IsDefaultBackgroundUse(void) const
+ ?HandleHighlightChange@ASwtControlBase@@UAEXXZ @ 30 NONAME ; void ASwtControlBase::HandleHighlightChange(void)
+ ?GetForeground@ASwtControlBase@@UBE?AVTRgb@@XZ @ 31 NONAME ; class TRgb ASwtControlBase::GetForeground(void) const
+ ?EnableFocusHighlight@ASwtControlBase@@UAEXH@Z @ 32 NONAME ; void ASwtControlBase::EnableFocusHighlight(int)
+ ?GetLocation@ASwtControlBase@@UBE?AVTPoint@@XZ @ 33 NONAME ; class TPoint ASwtControlBase::GetLocation(void) const
+ ?SetHighlight@ASwtControlBase@@UAEXH@Z @ 34 NONAME ; void ASwtControlBase::SetHighlight(int)
+ ?PressBackgroundPolicy@ASwtControlBase@@UBEHXZ @ 35 NONAME ; int ASwtControlBase::PressBackgroundPolicy(void) const
+ ?GetVisible@ASwtControlBase@@UBEHXZ @ 36 NONAME ; int ASwtControlBase::GetVisible(void) const
+ ??1ASwtControlBase@@MAE@XZ @ 37 NONAME ; ASwtControlBase::~ASwtControlBase(void)
+ ?Update@ASwtControlBase@@UBEXXZ @ 38 NONAME ; void ASwtControlBase::Update(void) const
+ ?MSKSelCmdEnabled@ASwtControlBase@@UBEHXZ @ 39 NONAME ; int ASwtControlBase::MSKSelCmdEnabled(void) const
+ ?IsFocusable@ASwtControlBase@@UBEHH@Z @ 40 NONAME ; int ASwtControlBase::IsFocusable(int) const
+ ??0ASwtControlBase@@IAE@AAVMSwtDisplay@@PAV_jweak@@PAVMSwtComposite@@H@Z @ 41 NONAME ; ASwtControlBase::ASwtControlBase(class MSwtDisplay &, class _jweak *, class MSwtComposite *, int)
+ ?HandleUpdate@ASwtControlBase@@UAEXXZ @ 42 NONAME ; void ASwtControlBase::HandleUpdate(void)
+ ?GetWidgetSize@ASwtControlBase@@UBE?AVTSize@@XZ @ 43 NONAME ; class TSize ASwtControlBase::GetWidgetSize(void) const
+ ?CbaButtonIsUsed@ASwtControlBase@@UBEHH@Z @ 44 NONAME ; int ASwtControlBase::CbaButtonIsUsed(int) const
+ ?IsLongTapAnimationCandidate@ASwtControlBase@@UBEHABUTPointerEvent@@@Z @ 45 NONAME ; int ASwtControlBase::IsLongTapAnimationCandidate(struct TPointerEvent const &) const
+ ?DefaultFont@ASwtControlBase@@MBEABVMSwtFont@@XZ @ 46 NONAME ; class MSwtFont const & ASwtControlBase::DefaultFont(void) const
+ ?SetLocation@ASwtControlBase@@UAEXABVTPoint@@@Z @ 47 NONAME ; void ASwtControlBase::SetLocation(class TPoint const &)
+ ??1CSwtServer@@UAE@XZ @ 48 NONAME ; CSwtServer::~CSwtServer(void)
+ ?IsPaintingUrgently@ASwtControlBase@@UBEHXZ @ 49 NONAME ; int ASwtControlBase::IsPaintingUrgently(void) const
+ ?HandlePointerEventL@ASwtControlBase@@UAEXABUTPointerEvent@@@Z @ 50 NONAME ; void ASwtControlBase::HandlePointerEventL(struct TPointerEvent const &)
+ ?SetForegroundL@ASwtControlBase@@UAEXPBVMSwtColor@@@Z @ 51 NONAME ; void ASwtControlBase::SetForegroundL(class MSwtColor const *)
+ ?SetWidgetSize@ASwtControlBase@@UAEXABVTSize@@@Z @ 52 NONAME ; void ASwtControlBase::SetWidgetSize(class TSize const &)
+ ?SetPopupMenuL@ASwtControlBase@@UAEXPBVMSwtMenu@@@Z @ 53 NONAME ; void ASwtControlBase::SetPopupMenuL(class MSwtMenu const *)
+ ?NewGcL@ASwtControlBase@@UAEPAVMSwtGc@@XZ @ 54 NONAME ; class MSwtGc * ASwtControlBase::NewGcL(void)
+ ?SetCapture@ASwtControlBase@@UAEXH@Z @ 55 NONAME ; void ASwtControlBase::SetCapture(int)
+ ?FocusBackgroundNow@ASwtControlBase@@IBEPAVCAknsBasicBackgroundControlContext@@XZ @ 56 NONAME ; class CAknsBasicBackgroundControlContext * ASwtControlBase::FocusBackgroundNow(void) const
+ ?ForceTraverseEvent@ASwtControlBase@@UAEHW4TSwtTraversal@@H@Z @ 57 NONAME ; int ASwtControlBase::ForceTraverseEvent(enum TSwtTraversal, int)
+ ?RedrawRegion@ASwtControlBase@@UAEXABVTRect@@@Z @ 58 NONAME ; void ASwtControlBase::RedrawRegion(class TRect const &)
+ ?GetVisibleRecursively@ASwtControlBase@@UBEHXZ @ 59 NONAME ; int ASwtControlBase::GetVisibleRecursively(void) const
+ ?JavaPeer@ASwtControlBase@@UBEPAV_jweak@@XZ @ 60 NONAME ; class _jweak * ASwtControlBase::JavaPeer(void) const
+ ?GetParent@ASwtControlBase@@UBEPAVMSwtComposite@@XZ @ 61 NONAME ; class MSwtComposite * ASwtControlBase::GetParent(void) const
+ ?HandleSizeChanged@ASwtControlBase@@IAEXXZ @ 62 NONAME ; void ASwtControlBase::HandleSizeChanged(void)
+ ?SetSwtFocus@ASwtControlBase@@UAEHH@Z @ 63 NONAME ; int ASwtControlBase::SetSwtFocus(int)
+ ?MoveBelow@ASwtControlBase@@UAEXPBVMSwtControl@@@Z @ 64 NONAME ; void ASwtControlBase::MoveBelow(class MSwtControl const *)
+ ?SetColorL@ASwtControlBase@@IAEXW4TLogicalColor@@PBVMSwtColor@@@Z @ 65 NONAME ; void ASwtControlBase::SetColorL(enum TLogicalColor, class MSwtColor const *)
+ ?ClientRect@ASwtControlBase@@UBE?AVTRect@@XZ @ 66 NONAME ; class TRect ASwtControlBase::ClientRect(void) const
+ ?GetBounds@ASwtControlBase@@UBE?AVTRect@@XZ @ 67 NONAME ; class TRect ASwtControlBase::GetBounds(void) const
+ ?RemoveFromControlStack@ASwtControlBase@@UAEXXZ @ 68 NONAME ; void ASwtControlBase::RemoveFromControlStack(void)
+ ?MSKLabelL@ASwtControlBase@@UBEPAVHBufC16@@XZ @ 69 NONAME ; class HBufC16 * ASwtControlBase::MSKLabelL(void) const
+ ?SetRedraw@ASwtControlBase@@UAEXH@Z @ 70 NONAME ; void ASwtControlBase::SetRedraw(int)
+ ?SetBounds@ASwtControlBase@@UAEXABVTRect@@@Z @ 71 NONAME ; void ASwtControlBase::SetBounds(class TRect const &)
+ ?BorderOuterRect@ASwtControlBase@@MBE?AVTRect@@ABV2@@Z @ 72 NONAME ; class TRect ASwtControlBase::BorderOuterRect(class TRect const &) const
+ ?SetVisible@ASwtControlBase@@UAEXH@Z @ 73 NONAME ; void ASwtControlBase::SetVisible(int)
+ ?IsOnControlStack@ASwtControlBase@@UBEHXZ @ 74 NONAME ; int ASwtControlBase::IsOnControlStack(void) const
+ ?NewL@CSwtServer@@SAPAV1@PAX@Z @ 75 NONAME ; class CSwtServer * CSwtServer::NewL(void *)
+ ?GetFont@ASwtControlBase@@UBEPBVMSwtFont@@XZ @ 76 NONAME ; class MSwtFont const * ASwtControlBase::GetFont(void) const
+ ?HasHighlight@ASwtControlBase@@UBEHH@Z @ 77 NONAME ; int ASwtControlBase::HasHighlight(int) const
+ ?ToDisplay@ASwtControlBase@@UBE?AVTPoint@@ABV2@@Z @ 78 NONAME ; class TPoint ASwtControlBase::ToDisplay(class TPoint const &) const
+ ?ToControl@ASwtControlBase@@UBE?AVTPoint@@ABV2@@Z @ 79 NONAME ; class TPoint ASwtControlBase::ToControl(class TPoint const &) const
+ ?GetControlContext@ASwtControlBase@@UBEPAVMAknsControlContext@@XZ @ 80 NONAME ; class MAknsControlContext * ASwtControlBase::GetControlContext(void) const
+ ?GraphicsDevice@ASwtControlBase@@UAEAAVCBitmapDevice@@XZ @ 81 NONAME ; class CBitmapDevice & ASwtControlBase::GraphicsDevice(void)
+ ?GetShell@ASwtControlBase@@UBEAAVMSwtShell@@XZ @ 82 NONAME ; class MSwtShell & ASwtControlBase::GetShell(void) const
+ ?MoveAbove@ASwtControlBase@@UAEXPBVMSwtControl@@@Z @ 83 NONAME ; void ASwtControlBase::MoveAbove(class MSwtControl const *)
+ ?SetFontL@ASwtControlBase@@UAEXPBVMSwtFont@@@Z @ 84 NONAME ; void ASwtControlBase::SetFontL(class MSwtFont const *)
+ ?PaintUrgently@ASwtControlBase@@UBEXABVTRect@@H@Z @ 85 NONAME ; void ASwtControlBase::PaintUrgently(class TRect const &, int) const
+ ?SwtMopSupplyObject@ASwtControlBase@@QAE?AVPtr@TTypeUid@@V3@@Z @ 86 NONAME ; class TTypeUid::Ptr ASwtControlBase::SwtMopSupplyObject(class TTypeUid)
+ ?UpdateDoNotDrawFlag@ASwtControlBase@@UAEXXZ @ 87 NONAME ; void ASwtControlBase::UpdateDoNotDrawFlag(void)
+ ?GetTopShell@ASwtControlBase@@UBEAAVMSwtShell@@XZ @ 88 NONAME ; class MSwtShell & ASwtControlBase::GetTopShell(void) const
+ ?DoControlSpecificFeedback@ASwtControlBase@@UBEXABH0ABUTPointerEvent@@@Z @ 89 NONAME ; void ASwtControlBase::DoControlSpecificFeedback(int const &, int const &, struct TPointerEvent const &) const
+ ?Draw@ASwtControlBase@@UBEXAAVCWindowGc@@ABVCCoeControl@@ABVTRect@@@Z @ 90 NONAME ; void ASwtControlBase::Draw(class CWindowGc &, class CCoeControl const &, class TRect const &) const
+ ?GetEnabled@ASwtControlBase@@UBEHXZ @ 91 NONAME ; int ASwtControlBase::GetEnabled(void) const
+ ?RegisterWithParentL@ASwtControlBase@@IAEXXZ @ 92 NONAME ; void ASwtControlBase::RegisterWithParentL(void)
+ ?DrawBorder@ASwtControlBase@@MBEXABVTRect@@@Z @ 93 NONAME ; void ASwtControlBase::DrawBorder(class TRect const &) const
+ ?ComputeTabListL@ASwtControlBase@@UAEXAAV?$RPointerArray@VMSwtControl@@@@@Z @ 94 NONAME ; void ASwtControlBase::ComputeTabListL(class RPointerArray<class MSwtControl> &)
+ ?PrepareForTraverse@ASwtControlBase@@UAEXXZ @ 95 NONAME ; void ASwtControlBase::PrepareForTraverse(void)
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eabi/eswtu.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eabi/eswtu.def Thu Aug 19 09:48:13 2010 +0300
@@ -12,91 +12,96 @@
_ZN15ASwtControlBase11SetSwtFocusEi @ 11 NONAME
_ZN15ASwtControlBase12HandleUpdateEv @ 12 NONAME
_ZN15ASwtControlBase12RedrawRegionERK5TRect @ 13 NONAME
- _ZN15ASwtControlBase13SetPopupMenuLEPK8MSwtMenu @ 14 NONAME
- _ZN15ASwtControlBase13SetWidgetSizeERK5TSize @ 15 NONAME
- _ZN15ASwtControlBase14GraphicsDeviceEv @ 16 NONAME
- _ZN15ASwtControlBase14IsFocusControlEv @ 17 NONAME
- _ZN15ASwtControlBase14SetBackgroundLEPK9MSwtColor @ 18 NONAME
- _ZN15ASwtControlBase14SetForegroundLEPK9MSwtColor @ 19 NONAME
- _ZN15ASwtControlBase15ComputeTabListLER13RPointerArrayI11MSwtControlE @ 20 NONAME
- _ZN15ASwtControlBase15PostMouseEventLERK13TPointerEvent @ 21 NONAME
- _ZN15ASwtControlBase17HandleSizeChangedEv @ 22 NONAME
- _ZN15ASwtControlBase18AddToControlStackLEi @ 23 NONAME
- _ZN15ASwtControlBase18ForceTraverseEventE13TSwtTraversali @ 24 NONAME
- _ZN15ASwtControlBase18HandleFocusChangedE8TDrawNow @ 25 NONAME
- _ZN15ASwtControlBase18SwtMopSupplyObjectE8TTypeUid @ 26 NONAME
- _ZN15ASwtControlBase19HandlePointerEventLERK13TPointerEvent @ 27 NONAME
- _ZN15ASwtControlBase19RegisterWithParentLEv @ 28 NONAME
- _ZN15ASwtControlBase19UpdateDoNotDrawFlagEv @ 29 NONAME
- _ZN15ASwtControlBase21HandlePositionChangedEv @ 30 NONAME
- _ZN15ASwtControlBase22RemoveFromControlStackEv @ 31 NONAME
- _ZN15ASwtControlBase6NewGcLEv @ 32 NONAME
- _ZN15ASwtControlBase6RedrawEv @ 33 NONAME
- _ZN15ASwtControlBase7DisposeEv @ 34 NONAME
- _ZN15ASwtControlBase8DoDeleteEv @ 35 NONAME
- _ZN15ASwtControlBase8SetFontLEPK8MSwtFont @ 36 NONAME
- _ZN15ASwtControlBase9MoveAboveEPK11MSwtControl @ 37 NONAME
- _ZN15ASwtControlBase9MoveBelowEPK11MSwtControl @ 38 NONAME
- _ZN15ASwtControlBase9SetBoundsERK5TRect @ 39 NONAME
- _ZN15ASwtControlBase9SetColorLE13TLogicalColorPK9MSwtColor @ 40 NONAME
- _ZN15ASwtControlBase9SetRedrawEi @ 41 NONAME
- _ZN15ASwtControlBaseC2ER11MSwtDisplayP6_jweakP13MSwtCompositei @ 42 NONAME
- _ZN15ASwtControlBaseD0Ev @ 43 NONAME
- _ZN15ASwtControlBaseD1Ev @ 44 NONAME
- _ZN15ASwtControlBaseD2Ev @ 45 NONAME
- _ZNK15ASwtControlBase10ClientRectEv @ 46 NONAME
- _ZNK15ASwtControlBase10DrawBorderERK5TRect @ 47 NONAME
- _ZNK15ASwtControlBase10GetEnabledEv @ 48 NONAME
- _ZNK15ASwtControlBase10GetVisibleEv @ 49 NONAME
- _ZNK15ASwtControlBase11DefaultFontEv @ 50 NONAME
- _ZNK15ASwtControlBase11GetLocationEv @ 51 NONAME
- _ZNK15ASwtControlBase11GetTopShellEv @ 52 NONAME
- _ZNK15ASwtControlBase11IsDescentOfERK11MSwtControl @ 53 NONAME
- _ZNK15ASwtControlBase11IsFocusableEi @ 54 NONAME
- _ZNK15ASwtControlBase12GetPopupMenuEv @ 55 NONAME
- _ZNK15ASwtControlBase13GetBackgroundEv @ 56 NONAME
- _ZNK15ASwtControlBase13GetForegroundEv @ 57 NONAME
- _ZNK15ASwtControlBase13GetWidgetSizeEv @ 58 NONAME
- _ZNK15ASwtControlBase13PaintUrgentlyERK5TRecti @ 59 NONAME
- _ZNK15ASwtControlBase14GetBorderWidthEv @ 60 NONAME
- _ZNK15ASwtControlBase14GetControlMenuEv @ 61 NONAME
- _ZNK15ASwtControlBase15BorderInnerRectEv @ 62 NONAME
- _ZNK15ASwtControlBase15BorderOuterRectERK5TRect @ 63 NONAME
- _ZNK15ASwtControlBase15CbaButtonIsUsedEi @ 64 NONAME
- _ZNK15ASwtControlBase16HasDoNotDrawFlagEv @ 65 NONAME
- _ZNK15ASwtControlBase16IsOnControlStackEv @ 66 NONAME
- _ZNK15ASwtControlBase16MSKSelCmdEnabledEv @ 67 NONAME
- _ZNK15ASwtControlBase17GetControlContextEv @ 68 NONAME
- _ZNK15ASwtControlBase18IsPaintingUrgentlyEv @ 69 NONAME
- _ZNK15ASwtControlBase21FocusBackgroundPolicyEv @ 70 NONAME
- _ZNK15ASwtControlBase21GetVisibleRecursivelyEv @ 71 NONAME
- _ZNK15ASwtControlBase22GetTopCaptionedControlEv @ 72 NONAME
- _ZNK15ASwtControlBase22IsDefaultBackgroundUseEv @ 73 NONAME
- _ZNK15ASwtControlBase25DoControlSpecificFeedbackERKiS1_RK13TPointerEvent @ 74 NONAME
- _ZNK15ASwtControlBase27IsLongTapAnimationCandidateERK13TPointerEvent @ 75 NONAME
- _ZNK15ASwtControlBase4DrawER9CWindowGcRK11CCoeControlRK5TRect @ 76 NONAME
- _ZNK15ASwtControlBase5FlagsEv @ 77 NONAME
- _ZNK15ASwtControlBase5PaintERK5TRectiP6MSwtGcPiiP7HBufC16 @ 78 NONAME
- _ZNK15ASwtControlBase5StyleEv @ 79 NONAME
- _ZNK15ASwtControlBase6UpdateEv @ 80 NONAME
- _ZNK15ASwtControlBase7DoPaintERK5TRect @ 81 NONAME
- _ZNK15ASwtControlBase7GetFontEv @ 82 NONAME
- _ZNK15ASwtControlBase7UiUtilsEv @ 83 NONAME
- _ZNK15ASwtControlBase8GetShellEv @ 84 NONAME
- _ZNK15ASwtControlBase8JavaPeerEv @ 85 NONAME
- _ZNK15ASwtControlBase9GetBoundsEv @ 86 NONAME
- _ZNK15ASwtControlBase9GetParentEv @ 87 NONAME
- _ZNK15ASwtControlBase9IsKeyUsedEj @ 88 NONAME
- _ZNK15ASwtControlBase9MSKLabelLEv @ 89 NONAME
- _ZNK15ASwtControlBase9ToControlERK6TPoint @ 90 NONAME
- _ZNK15ASwtControlBase9ToDisplayERK6TPoint @ 91 NONAME
- _ZTI11CSwtBrowser @ 92 NONAME
- _ZTI15ASwtControlBase @ 93 NONAME
- _ZTI22CSwtBrowserPreferences @ 94 NONAME
- _ZTV11CSwtBrowser @ 95 NONAME
- _ZTV15ASwtControlBase @ 96 NONAME
- _ZTV22CSwtBrowserPreferences @ 97 NONAME
- _ZThn4_NK15ASwtControlBase4DrawER9CWindowGcRK11CCoeControlRK5TRect @ 98 NONAME
- _ZNK15ASwtControlBase11VisibleRectEi @ 99 NONAME
- _ZN15ASwtControlBase20EnableFocusHighlightEi @ 100 NONAME
+ _ZN15ASwtControlBase12SetHighlightEi @ 14 NONAME
+ _ZN15ASwtControlBase13SetPopupMenuLEPK8MSwtMenu @ 15 NONAME
+ _ZN15ASwtControlBase13SetWidgetSizeERK5TSize @ 16 NONAME
+ _ZN15ASwtControlBase14GraphicsDeviceEv @ 17 NONAME
+ _ZN15ASwtControlBase14IsFocusControlEv @ 18 NONAME
+ _ZN15ASwtControlBase14SetBackgroundLEPK9MSwtColor @ 19 NONAME
+ _ZN15ASwtControlBase14SetForegroundLEPK9MSwtColor @ 20 NONAME
+ _ZN15ASwtControlBase15ComputeTabListLER13RPointerArrayI11MSwtControlE @ 21 NONAME
+ _ZN15ASwtControlBase15PostMouseEventLERK13TPointerEvent @ 22 NONAME
+ _ZN15ASwtControlBase17HandleSizeChangedEv @ 23 NONAME
+ _ZN15ASwtControlBase18AddToControlStackLEi @ 24 NONAME
+ _ZN15ASwtControlBase18ForceTraverseEventE13TSwtTraversali @ 25 NONAME
+ _ZN15ASwtControlBase18HandleFocusChangedE8TDrawNow @ 26 NONAME
+ _ZN15ASwtControlBase18SwtMopSupplyObjectE8TTypeUid @ 27 NONAME
+ _ZN15ASwtControlBase19HandlePointerEventLERK13TPointerEvent @ 28 NONAME
+ _ZN15ASwtControlBase19RegisterWithParentLEv @ 29 NONAME
+ _ZN15ASwtControlBase19UpdateDoNotDrawFlagEv @ 30 NONAME
+ _ZN15ASwtControlBase20EnableFocusHighlightEi @ 31 NONAME
+ _ZN15ASwtControlBase21HandleHighlightChangeEv @ 32 NONAME
+ _ZN15ASwtControlBase21HandlePositionChangedEv @ 33 NONAME
+ _ZN15ASwtControlBase22RemoveFromControlStackEv @ 34 NONAME
+ _ZN15ASwtControlBase6NewGcLEv @ 35 NONAME
+ _ZN15ASwtControlBase6RedrawEv @ 36 NONAME
+ _ZN15ASwtControlBase7DisposeEv @ 37 NONAME
+ _ZN15ASwtControlBase8DoDeleteEv @ 38 NONAME
+ _ZN15ASwtControlBase8SetFontLEPK8MSwtFont @ 39 NONAME
+ _ZN15ASwtControlBase9MoveAboveEPK11MSwtControl @ 40 NONAME
+ _ZN15ASwtControlBase9MoveBelowEPK11MSwtControl @ 41 NONAME
+ _ZN15ASwtControlBase9SetBoundsERK5TRect @ 42 NONAME
+ _ZN15ASwtControlBase9SetColorLE13TLogicalColorPK9MSwtColor @ 43 NONAME
+ _ZN15ASwtControlBase9SetRedrawEi @ 44 NONAME
+ _ZN15ASwtControlBaseC2ER11MSwtDisplayP6_jweakP13MSwtCompositei @ 45 NONAME
+ _ZN15ASwtControlBaseD0Ev @ 46 NONAME
+ _ZN15ASwtControlBaseD1Ev @ 47 NONAME
+ _ZN15ASwtControlBaseD2Ev @ 48 NONAME
+ _ZNK15ASwtControlBase10ClientRectEv @ 49 NONAME
+ _ZNK15ASwtControlBase10DrawBorderERK5TRect @ 50 NONAME
+ _ZNK15ASwtControlBase10GetEnabledEv @ 51 NONAME
+ _ZNK15ASwtControlBase10GetVisibleEv @ 52 NONAME
+ _ZNK15ASwtControlBase11DefaultFontEv @ 53 NONAME
+ _ZNK15ASwtControlBase11GetLocationEv @ 54 NONAME
+ _ZNK15ASwtControlBase11GetTopShellEv @ 55 NONAME
+ _ZNK15ASwtControlBase11IsDescentOfERK11MSwtControl @ 56 NONAME
+ _ZNK15ASwtControlBase11IsFocusableEi @ 57 NONAME
+ _ZNK15ASwtControlBase11VisibleRectEi @ 58 NONAME
+ _ZNK15ASwtControlBase12GetPopupMenuEv @ 59 NONAME
+ _ZNK15ASwtControlBase12HasHighlightEi @ 60 NONAME
+ _ZNK15ASwtControlBase13GetBackgroundEv @ 61 NONAME
+ _ZNK15ASwtControlBase13GetForegroundEv @ 62 NONAME
+ _ZNK15ASwtControlBase13GetWidgetSizeEv @ 63 NONAME
+ _ZNK15ASwtControlBase13PaintUrgentlyERK5TRecti @ 64 NONAME
+ _ZNK15ASwtControlBase14GetBorderWidthEv @ 65 NONAME
+ _ZNK15ASwtControlBase14GetControlMenuEv @ 66 NONAME
+ _ZNK15ASwtControlBase15BorderInnerRectEv @ 67 NONAME
+ _ZNK15ASwtControlBase15BorderOuterRectERK5TRect @ 68 NONAME
+ _ZNK15ASwtControlBase15CbaButtonIsUsedEi @ 69 NONAME
+ _ZNK15ASwtControlBase16HasDoNotDrawFlagEv @ 70 NONAME
+ _ZNK15ASwtControlBase16IsOnControlStackEv @ 71 NONAME
+ _ZNK15ASwtControlBase16MSKSelCmdEnabledEv @ 72 NONAME
+ _ZNK15ASwtControlBase17GetControlContextEv @ 73 NONAME
+ _ZNK15ASwtControlBase18IsPaintingUrgentlyEv @ 74 NONAME
+ _ZNK15ASwtControlBase21FocusBackgroundPolicyEv @ 75 NONAME
+ _ZNK15ASwtControlBase21GetVisibleRecursivelyEv @ 76 NONAME
+ _ZNK15ASwtControlBase21PressBackgroundPolicyEv @ 77 NONAME
+ _ZNK15ASwtControlBase22IsDefaultBackgroundUseEv @ 78 NONAME
+ _ZNK15ASwtControlBase25DoControlSpecificFeedbackERKiS1_RK13TPointerEvent @ 79 NONAME
+ _ZNK15ASwtControlBase26GetNearestCaptionedControlEi @ 80 NONAME
+ _ZNK15ASwtControlBase27IsLongTapAnimationCandidateERK13TPointerEvent @ 81 NONAME
+ _ZNK15ASwtControlBase4DrawER9CWindowGcRK11CCoeControlRK5TRect @ 82 NONAME
+ _ZNK15ASwtControlBase5FlagsEv @ 83 NONAME
+ _ZNK15ASwtControlBase5PaintERK5TRectiP6MSwtGcPiiP7HBufC16 @ 84 NONAME
+ _ZNK15ASwtControlBase5StyleEv @ 85 NONAME
+ _ZNK15ASwtControlBase6UpdateEv @ 86 NONAME
+ _ZNK15ASwtControlBase7DoPaintERK5TRect @ 87 NONAME
+ _ZNK15ASwtControlBase7GetFontEv @ 88 NONAME
+ _ZNK15ASwtControlBase7UiUtilsEv @ 89 NONAME
+ _ZNK15ASwtControlBase8GetShellEv @ 90 NONAME
+ _ZNK15ASwtControlBase8JavaPeerEv @ 91 NONAME
+ _ZNK15ASwtControlBase9GetBoundsEv @ 92 NONAME
+ _ZNK15ASwtControlBase9GetParentEv @ 93 NONAME
+ _ZNK15ASwtControlBase9IsKeyUsedEj @ 94 NONAME
+ _ZNK15ASwtControlBase9MSKLabelLEv @ 95 NONAME
+ _ZNK15ASwtControlBase9ToControlERK6TPoint @ 96 NONAME
+ _ZNK15ASwtControlBase9ToDisplayERK6TPoint @ 97 NONAME
+ _ZTI11CSwtBrowser @ 98 NONAME
+ _ZTI15ASwtControlBase @ 99 NONAME
+ _ZTI22CSwtBrowserPreferences @ 100 NONAME
+ _ZTV11CSwtBrowser @ 101 NONAME
+ _ZTV15ASwtControlBase @ 102 NONAME
+ _ZTV22CSwtBrowserPreferences @ 103 NONAME
+ _ZThn4_NK15ASwtControlBase4DrawER9CWindowGcRK11CCoeControlRK5TRect @ 104 NONAME
+ _ZN15ASwtControlBase18PrepareForTraverseEv @ 105 NONAME
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eswt.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eswt.pro Thu Aug 19 09:48:13 2010 +0300
@@ -19,10 +19,6 @@
CONFIG += omj java stl
CONFIG -= qt
-INCLUDEPATH += /epoc32/include/domain/applications \
- /epoc32/include/applications \
- /epoc32/include/domain/middleware \
- ../inc
SOURCES += ../src/cswtclient.cpp \
../src/methodcall.cpp \
../src/org_eclipse_ercp_swt_expanded_internal_OS.cpp \
@@ -132,7 +128,8 @@
../src/swttree.cpp \
../src/swtuiutils.cpp \
../src/swtwindowgc.cpp \
- ../src/utils.cpp
+ ../src/utils.cpp \
+ ../src/imagescaler.cpp
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eswt_0x2002DC93.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/build/eswt_0x2002DC93.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : eswt.mmp
@@ -52,12 +52,8 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../../mw/qt/mkspecs/common/symbian
-SYSTEMINCLUDE /epoc32/include/domain/applications
-SYSTEMINCLUDE /epoc32/include/applications
-SYSTEMINCLUDE /epoc32/include/domain/middleware
SYSTEMINCLUDE ../inc
SYSTEMINCLUDE ../../../../inc
SYSTEMINCLUDE ../../../../../inc
@@ -177,6 +173,7 @@
SOURCE swtuiutils.cpp
SOURCE swtwindowgc.cpp
SOURCE utils.cpp
+SOURCE imagescaler.cpp
LIBRARY aknicon.lib
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/eswt.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/eswt.h Thu Aug 19 09:48:13 2010 +0300
@@ -17,6 +17,7 @@
#include <coedef.h>
#include <eikenv.h>
#include <w32std.h>
+#include <AknUtils.h>
class _jweak;
@@ -40,14 +41,12 @@
/*
- * SWT style constants
+ * SWT style constants, used by the native libraries
*/
const TInt KSwtStyleBar = 1 << 1;
-const TInt KSwtStyleDropDown = 1 << 2;
const TInt KSwtStylePopUp = 1 << 3;
const TInt KSwtStyleSeparator = 1 << 1;
const TInt KSwtStyleToggle = 1 << 1;
-const TInt KSwtStyleArrow = 1 << 2;
const TInt KSwtStylePush = 1 << 3;
const TInt KSwtStyleRadio = 1 << 4;
const TInt KSwtStyleCheck = 1 << 5;
@@ -56,27 +55,15 @@
const TInt KSwtStyleSingle = 1 << 2;
const TInt KSwtStyleReadOnly = 1 << 3;
const TInt KSwtStyleWrap = 1 << 6;
-const TInt KSwtStyleSimple = 1 << 6;
const TInt KSwtStylePassword = 1 << 22;
const TInt KSwtStyleShadowIn = 1 << 2;
const TInt KSwtStyleShadowOut = 1 << 3;
-const TInt KSwtStyleShadowEtchedIn = 1 << 4;
-const TInt KSwtStyleShadowEtchedOut = 1 << 6;
-const TInt KSwtStyleShadowNone = 1 << 5;
const TInt KSwtStyleIndeterminate = 1 << 1;
-const TInt KSwtStyleTool = 1 << 2;
const TInt KSwtStyleNoTrim = 1 << 3;
-const TInt KSwtStyleResize = 1 << 4;
const TInt KSwtStyleTitle = 1 << 5;
-const TInt KSwtStyleClose = 1 << 6;
-const TInt KSwtStyleMenu = KSwtStyleClose;
-const TInt KSwtStyleMin = 1 << 7;
-const TInt KSwtStyleMax = 1 << 10;
const TInt KSwtStyleHScroll = 1 << 8;
const TInt KSwtStyleVScroll = 1 << 9;
const TInt KSwtStyleBorder = 1 << 11;
-const TInt KSwtStyleClipChildren = 1 << 12;
-const TInt KSwtStyleClipSiblings = 1 << 13;
const TInt KSwtStyleOnTop = 1 << 14;
const TInt KSwtStyleModeless = 0;
const TInt KSwtStylePrimaryModal = 1 << 15;
@@ -87,15 +74,11 @@
const TInt KSwtStyleFlat = 1 << 23;
const TInt KSwtStyleSmooth = 1 << 16;
const TInt KSwtStyleNoBackground = 1 << 18;
-const TInt KSwtStyleNoFocus = 1 << 19;
const TInt KSwtStyleNoRedrawResize = 1 << 20;
const TInt KSwtStyleNoMergePaints = 1 << 21;
const TInt KSwtStyleNoRadioGroup = 1 << 22;
const TInt KSwtStyleLeftToRight = 1 << 25;
const TInt KSwtStyleRightToLeft = 1 << 26;
-const TInt KSwtStyleMirrored = 1 << 27;
-const TInt KSwtStyleEmbedded = 1 << 24;
-const TInt KSwtStyleVirtual = 1 << 28;
const TInt KSwtStyleUp = 1 << 7;
const TInt KSwtStyleDown = 1 << 10;
const TInt KSwtStyleLead = 1 << 14;
@@ -103,20 +86,10 @@
const TInt KSwtStyleCenter = 1 << 24;
const TInt KSwtStyleHorizontal = 1 << 8;
const TInt KSwtStyleVertical = 1 << 9;
-const TInt KSwtStyleBeginning = 1;
-const TInt KSwtStyleFill = 4;
const TInt KSwtStyleOpen = 1 << 12;
const TInt KSwtStyleSave = 1 << 13;
-// Although the styles KSwtStyleShellTrim and KSwtStyleDialogTrim use
-// the KSwtStyleNormalStatusPane in Mobile Extension, we still do not bitwise OR
-// them with KSwtStyleNormalStatusPane, to keep the compatibility when Mobile
-// Extensions is not used.
-const TInt KSwtStyleShellTrim = KSwtStyleTitle | KSwtStyleClose | KSwtStyleMin | KSwtStyleMax | KSwtStyleResize;
-const TInt KSwtStyleDialogTrim = KSwtStyleTitle | KSwtStyleClose | KSwtStyleBorder;
-
-
/**
* Binary mask for the modality styles
*/
@@ -177,14 +150,6 @@
/**
- * Default value of the ProgressBar
- */
-const TInt KDefaultProgressBarSelectionValue= 0;
-const TInt KDefaultProgressBarMinValue = 0;
-const TInt KDefaultProgressBarMaxValue = 100;
-
-
-/**
* Retrieves the message box's button from it's style
*/
inline TMsgBoxButtons SwtMsgBoxButtons(TInt aMsgBoxStyle)
@@ -194,52 +159,23 @@
/**
- * Greatest number of pages in a CSwtMultiPageDialog
- */
-const TInt KMultiPageDialogNbPageMax = 5;
-
-
-/**
- * SWT error code
+ * SWT error code, , used by the native libraries.
*/
enum TSwtError
{
- ESwtErrorNone = 0,
ESwtErrorUnspecified = 1,
ESwtErrorNoHandles = 2,
- ESwtErrorNoMoreCallbacks = 3,
ESwtErrorNullArgument = 4,
ESwtErrorInvalidArgument = 5,
ESwtErrorInvalidRange = 6,
ESwtErrorCannotBeZero = 7,
- ESwtErrorCannotGetItem = 8,
ESwtErrorCannotGetSelection = 9,
- ESwtErrorCannotGetItemHeight = 11,
- ESwtErrorCannotGetText = 12,
- ESwtErrorCannotSetText = 13,
ESwtErrorItemNotAdded = 14,
- ESwtErrorItemNotRemoved = 15,
- ESwtErrorNotImplemented = 20,
- ESwtErrorMenuNotDropDown = 21,
ESwtErrorThreadInvalidAccess = 22,
- ESwtErrorWidgetDisposed = 24,
- ESwtErrorMenuItemNotCascade = 27,
ESwtErrorCannotSetSelection = 28,
- ESwtErrorCannotSetMenu = 29,
- ESwtErrorCannotSetEnabled = 30,
- ESwtErrorCannotGetEnabled = 31,
- ESwtErrorInvalidParent = 32,
- ESwtErrorMenuNotBar = 33,
- ESwtErrorCannotGetCount = 36,
- ESwtErrorMenuNotPopUp = 37,
ESwtErrorUnsupportedDepth = 38,
ESwtErrorIO = 39,
ESwtErrorInvalidImage = 40,
- ESwtErrorUnsupportedFormat = 42,
- ESwtErrorInvalidSubclass = 43,
- ESwtErrorGraphicDisposed = 44,
- ESwtErrorDeviceDisposed = 45,
- ESwtErrorFailedExec = 46,
ESwtErrorFailedLoadLibrary = 47
};
@@ -253,19 +189,16 @@
/**
- * SWT event type
+ * SWT events (constant values specifed in eSWT API)
*/
enum TSwtEventType
{
- // SWT events (constant values specifed in eSWT API)
ESwtEventNone = 0,
ESwtEventKeyDown = 1,
ESwtEventKeyUp = 2,
ESwtEventMouseDown = 3,
ESwtEventMouseUp = 4,
ESwtEventMouseMove = 5,
- ESwtEventMouseEnter = 6,
- ESwtEventMouseExit = 7,
ESwtEventMouseDoubleClick = 8,
ESwtEventPaint = 9,
ESwtEventMove = 10,
@@ -277,8 +210,6 @@
ESwtEventFocusOut = 16,
ESwtEventExpand = 17,
ESwtEventCollapse = 18,
- ESwtEventIconify = 19,
- ESwtEventDeiconify = 20,
ESwtEventClose = 21,
ESwtEventShow = 22,
ESwtEventHide = 23,
@@ -286,22 +217,13 @@
ESwtEventVerify = 25,
ESwtEventActivate = 26,
ESwtEventDeactivate = 27,
- ESwtEventHelp = 28,
- ESwtEventDragDetect = 29,
- ESwtEventArm = 30,
ESwtEventTraverse = 31,
- ESwtEventMouseHover = 32,
- ESwtEventHardKeyDown = 33,
- ESwtEventHardKeyUp = 34,
- ESwtEventMenuDetect = 35,
- ESwtEventSetData = 36,
ESwtEventSettings = 39, //added in eSWT 1.1
// Custom events
ESwtEventLocation = 1000,
ESwtEventProgress = 1002,
ESwtEventStatusText = 1003,
ESwtEventTitle = 1004,
- ESwtEventExit = 1005,
ESwtEventForeground = 1006,
ESwtEventDialogStringResult = 1007,
ESwtEventDialogIntegerResult = 1008,
@@ -337,16 +259,6 @@
/*
- * SWT IME constants
- */
-const TInt KSwtImeDbcs = 1 << 1; // Input Method Editor style constant for double byte input behaviour.
-const TInt KSwtImeAlpha = 1 << 2; // Input Method Editor style constant for alpha input behaviour.
-const TInt KSwtImeNative = 1 << 3; // Input Method Editor style constant for native input behaviour.
-const TInt KSwtImePhonetic = 1 << 4; // Input Method Editor style constant for phonetic input behaviour.
-const TInt KSwtImeRoman = 1 << 5; // Input Method Editor style constant for romanicised input behaviour.
-
-
-/*
* SWT key modifiers
*/
const TInt KSwtModifierAlt = 1 << 16;
@@ -410,9 +322,6 @@
const TInt KSwtScanCodeBase = (1 << 25);
-
-
-
/**
* SWT key code
*/
@@ -537,29 +446,10 @@
/**
- * System colour ID
+ * System color IDs used from the native libs (the values are defined by the eSWT API)
*/
enum TSwtColorId
{
- // Default colours
- ESwtColorWhite = 1, // Default colour white.
- ESwtColorBlack = 2, // Default colour black.
- ESwtColorRed = 3, // Default colour red.
- ESwtColorDarkRed = 4, // Default colour dark red.
- ESwtColorGreen = 5, // Default colour green.
- ESwtColorDarkGreen = 6, // Default colour dark green.
- ESwtColorYellow = 7, // Default colour yellow.
- ESwtColorDarkYellow = 8, // Default colour dark yellow.
- ESwtColorBlue = 9, // Default colour blue.
- ESwtColorDarkBlue = 10, // Default colour dark blue.
- ESwtColorMagenta = 11, // Default colour magenta.
- ESwtColorDarkMagenta = 12, // Default colour dark magenta.
- ESwtColorCyan = 13, // Default colour cyan.
- ESwtColorDarkCyan = 14, // Default colour dark cyan.
- ESwtColorGray = 15, // Default colour gray.
- ESwtColorDarkGray = 16, // Default colour dark gray.
-
- // System colours
ESwtColorWidgetDarkShadow = 17, // System colour used to paint dark shadow areas.
ESwtColorWidgetNormalShadow = 18, // System colour used to paint normal shadow areas.
ESwtColorWidgetLightShadow = 19, // System colour used to paint light shadow areas.
@@ -579,53 +469,11 @@
ESwtColorTitleInactiveBackgroundGradient = 35 // System colour used to paint inactive title background gradient.
};
-
/**
- * Orientation
- */
-enum TSwtOrientation
-{
- ESwtLeftToRight = KSwtStyleLeftToRight, // Left to right orientation
- ESwtRightToLeft = KSwtStyleRightToLeft // Right to left orientation
-};
-
-
-/*
- * Image transparency type
- */
-const TInt KSwtTransparencyNone = 0x0; // The image contains no transparency
-const TInt KSwtTransparencyAlpha = 1 << 0; // The image contains alpha transparency information
-const TInt KSwtTransparencyMask = 1 << 1; // The image contains a transparency mask
-const TInt KSwtTransparencyPixel = 1 << 2; // The image contains a transparent pixel
-
-
-/**
- * Image Copy type
+ * Default Text colors
*/
-enum TSwtImageCopyType
-{
- /**
- * The Image constructor argument indicating that
- * the new image should be a copy of the image provided as
- * an argument (value is 0).
- */
- ESwtImageCopy = 0, // Simple image copy
- ESwtImageDisabled = 1, // The copy must look like the "disabled" original
- ESwtImageGray = 2 // The copy must be a gray scaled version of the original
-};
-
-
-/**
- * Default width for a widget
- */
-const TInt KSwtDefaultWidth = 64;
-
-
-/**
- * Default height for a widget
- */
-const TInt KSwtDefaultHeight = 64;
-
+const TInt KHighlightedTextColor = EAknsCIQsnTextColorsCG8;
+const TInt KNonHighlightedTextColor = EAknsCIQsnTextColorsCG6;
/**
* Window priorities. By default the CCoeControl window priority is 0.
@@ -695,6 +543,16 @@
/**
+ * Ids for theme icons from wich MSwtImage objects can be created.
+ */
+enum TSwtThemeImageId
+{
+ ESwtThemeImageSecurityTrusted = 0,
+ ESwtThemeImageSecurityUntrusted
+};
+
+
+/**
* Interface class for resource change observers.
*/
class MSwtResourceChangeObserver
@@ -859,9 +717,7 @@
* Posts an asynchronous keyboard event
* @param aPeer The Java object to send the event to
* @param aType The event type, must be one of ESwtEventMouseDown,
- * ESwtEventMouseUp, ESwtEventMouseMove,
- * ESwtEventMouseEnter, ESwtEventMouseExit
- * or ESwtEventMouseDoubleClick
+ * ESwtEventMouseUp, or ESwtEventMouseDoubleClick
* @param aButton The pressed or relased button, must be one of KSwtMouseButton1,
* KSwtMouseButton2 or KSwtMouseButton3.
* @param aPos The mouse's position of client coordinates.
@@ -1063,12 +919,12 @@
* @return void
*/
virtual void PostTitleEventL(TSwtPeer aPeer, const TDesC& aTitle) = 0;
-
+
/**
* Posts a show focused control to a ScrolledComposite.
*/
virtual void PostShowFocusedControlEventL(TSwtPeer aPeer) =0;
-
+
/**
* Get eSWT Java application allocated id
* @return Java application allocated id
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/eswtwidgetscore.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/eswtwidgetscore.h Thu Aug 19 09:48:13 2010 +0300
@@ -61,6 +61,7 @@
class MSwtFontDialog;
class MSwtDirectoryDialog;
class MSwtHyperLink;
+class MSwtScrollable;
static const TInt KSwtCommandBaseId = 0x1000;
@@ -214,7 +215,25 @@
// Captioned Controls use case, default focus background policy
// applies to itself and children
- ECaptionedCtrlFocusBackground
+ ECaptionedCtrlFocusBackground,
+
+ // This policy is similar to EEmbeddedFocusBackground.
+ // Its use case is for lists, listviews, tables, trees and listboxes.
+ // They don't have focus background at all even when placed
+ // to captioned control (only captioned control has highlight)
+ ENoFocusBackgroundInCaptionedControl
+ };
+
+ enum TPressBackgroundPolicy
+ {
+ // No need for pressed highlight.
+ ENoPressBackground = 0,
+
+ // Highlight is applied whenever the control is pressed.
+ EPressBackground = 1,
+
+ // The control has it's own pressed highlight.
+ EEmbeddedPressBackground = 2
};
public:
@@ -326,6 +345,12 @@
virtual TInt FocusBackgroundPolicy() const =0;
/**
+ * Returns the policy of the pressed background.
+ * See TPressBackgroundPolicy.
+ */
+ virtual TInt PressBackgroundPolicy() const =0;
+
+ /**
* Returns true if the control is selectable by the user and is not dimmed
*/
virtual TBool GetEnabled() const =0;
@@ -453,7 +478,7 @@
/**
* Get the top CaptionedControl of the Control, if any
*/
- virtual MSwtCaptionedControl* GetTopCaptionedControl() const =0;
+ virtual MSwtCaptionedControl* GetNearestCaptionedControl(TBool aIncludeSelf = ETrue) const =0;
/**
* Gets the control's width and height;
@@ -591,6 +616,7 @@
{
return NULL;
}
+
virtual const MSwtShell* ShellInterface() const
{
return NULL;
@@ -772,7 +798,7 @@
* Only for 9.2
*/
virtual void EnableFocusHighlight(TBool aEnable) = 0;
-
+
/**
* Get the visible rectangle of this control.
* Window coordinates.
@@ -782,6 +808,43 @@
* else return visible client rectangle of the control.
*/
virtual TRect VisibleRect(TBool aVisibleBounds = EFalse) const = 0;
+
+ /**
+ * Get the scrollable interface of control.
+ * If control is not scrollable method returns null
+ */
+ virtual MSwtScrollable* ScrollableInterface() const
+ {
+ return NULL;
+ }
+
+ /**
+ * True if the control owns a focus / pressed highlighted background.
+ * @param aIncludingParents - if true, the parent tree is checked also.
+ */
+ virtual TBool HasHighlight(TBool aIncludingParents = ETrue) const = 0;
+
+ /**
+ * Instructs the control to create and display a highlighted background.
+ * This is *not* supposed to repaint!
+ */
+ virtual void SetHighlight(TBool aEnabled) = 0;
+
+ /**
+ * React to highlight changes in itself or in the parent tree.
+ * This is *not* supposed to repaint!
+ */
+ virtual void HandleHighlightChange() = 0;
+
+ /**
+ * True if pressed by pointer.
+ */
+ virtual TInt Pressed() const = 0;
+
+ /**
+ * Get ready for traverse event
+ */
+ virtual void PrepareForTraverse() = 0;
};
@@ -1362,21 +1425,11 @@
virtual void SetControlGoingToStack(MSwtControl* aControl) =0;
/**
- * Return the pointer to the child which should be added to Control Stack.
- */
- virtual MSwtControl* ControlGoingToStack() const =0;
-
- /**
* Set the pointer to the child which gains the focus.
*/
virtual void SetControlGainingFocus(MSwtControl* aControl) =0;
/**
- * Return the pointer to the child which gains the focus.
- */
- virtual MSwtControl* ControlGainingFocus() const =0;
-
- /**
* Get the current status pane style.
*/
virtual TSwtStatusPaneStyle StatusPaneStyle() const = 0;
@@ -1425,11 +1478,24 @@
*/
virtual void SetTaskTip() = 0;
virtual TBool IsTaskTip() const = 0;
-
+
/**
* Sets the location even if top shell.
*/
virtual void DoSetLocation(const TPoint& aPoint) = 0;
+
+ /**
+ * To be called whenever focus changes or controls get pressed.
+ * @param aDrawNow - immediate or deferred repaint.
+ * For focus changes deferred repaint is preferred.
+ * For pressed state changes immediate repaint is preferred.
+ */
+ virtual void UpdateHighlight(TBool aDrawNow = EFalse) = 0;
+
+ /**
+ * Remove any references to the disposing control.
+ */
+ virtual void ControlDisposing(const MSwtControl& aControl) = 0;
};
/**
@@ -2860,60 +2926,85 @@
* Returns the current control that is grabbing the pointer events.
*/
virtual MSwtControl* PointerCaptureControl() = 0;
-
- /**
- * Rearranges the application layout (status pane, Shell position, split
- * input view size) for best editing experience. There can be only one
- * editor in split view mode at a time. Setting 0 clears the split view
+
+ /**
+ * Rearranges the application layout (status pane, Shell position, split
+ * input view size) for best editing experience. There can be only one
+ * editor in split view mode at a time. Setting 0 clears the split view
* and restores the layout.
- *
+ *
* Following actions must be delegated to UiUtils while split editing is on:
* - Relocating the split input Shell (@see SetSplitInputShellPos)
* - Resizing the split input view. (@see SetSplitInputViewSize)
- *
+ *
* Following actions must be notified to UiUtils while split editing is on:
* - Resizing the split input shell. (@see AdjustSplitInputShellPos)
* - Relocating the split input view. (@see AdjustSplitInputShellPos)
*/
virtual void SetSplitInputEditor(MSwtControl* aEditor) = 0;
-
+
/**
* The currently active(focused) split input editor.
* Can be any Text, TextExtension, ConstrainedText or DateEditor.
*/
virtual MSwtControl* SplitInputEditor() const = 0;
-
+
/**
* The currently active split input editor or a parent ScrolledComposite.
* The view is getting resized automatically to fit in the available space
* above the VKB.
*/
virtual MSwtControl* SplitInputView() const = 0;
-
+
/**
* The parent shell of the active split input editor is temporarily
* moved vertically during split input editing therefore setting a new
* location must be diverted trough UiUtils.
- * @param aOriginalPos - The real position of the Shell, which will be
+ * @param aOriginalPos - The real position of the Shell, which will be
* applied when VKB closes.
*/
virtual void SetSplitInputShellPos(const TPoint& aOriginalPos) = 0;
-
- /**
- * The active split input editor or its ScrolledComposite ancestor
- * is temporarily resized vertically during split input editing
+
+ /**
+ * The active split input editor or its ScrolledComposite ancestor
+ * is temporarily resized vertically during split input editing
* therefore setting a new size must be diverted trough UiUtils.
- * @param aOriginalSize - The real size of the control, which will be
+ * @param aOriginalSize - The real size of the control, which will be
* applied when VKB closes.
*/
virtual void SetSplitInputViewSize(const TSize& aOriginalSize) = 0;
-
+
/**
* The split input shell resized during split editing or
* the split input view relocated during split editing.
* The vertical position of the shell will be readjusted.
*/
virtual void AdjustSplitInputShellPos() = 0;
+
+ /**
+ * Fixes the UI orientation on screen.
+ * The orientation remains fixed until UnRegisterFixScreenOrientation()
+ * is called for so many times as this method was called.
+ */
+ virtual void RegisterFixScreenOrientation() = 0;
+
+ /**
+ * Unregisters request to fix the UI orientation.
+ * Component which called RegisterFixScreenOrientation()
+ * must call this funtion when UI orientation fix is no more needed.
+ * The UI orientation remains fixed until this method is called
+ * so many times as registering methods was called.
+ */
+ virtual void UnRegisterFixScreenOrientation() = 0;
+
+ /**
+ * Indicates that the UI orientation is fixed.
+ * This means that some components requested it calling
+ * RegisterFixScreenOrientation().
+ *
+ * @return ETrue when the UI orientation is fixed.
+ */
+ virtual TBool IsScreenOrientationFixed() const = 0;
};
@@ -3365,11 +3456,6 @@
virtual TRgb* RunColorDialogL(TRgb* aDefaultColor) const=0;
/**
- * Constructs a FontDialog
- */
- virtual MSwtFontDialog* NewFontDialogL() const =0;
-
- /**
* Constructs a DirectoryDialog
*/
virtual MSwtDirectoryDialog* NewDirectoryDialogL(const TDesC& aFilterPath,
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/imagescaler.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nokia Corporation - S60 implementation
+ *******************************************************************************/
+
+#ifndef IMAGESCALER_H
+#define IMAGESCALER_H
+
+class CBitmapScaler;
+
+NONSHARABLE_CLASS(CImageScaler)
+ : public CActive
+{
+public:
+ static CImageScaler* NewL();
+ ~CImageScaler();
+ void Scale(CFbsBitmap& aSrcBitmap, CFbsBitmap& aDestBitmap, TBool aKeepAspectRatio);
+
+protected:
+ void RunL();
+ void DoCancel();
+
+private:
+ CImageScaler();
+ void ConstructL();
+
+private:
+ CActiveSchedulerWait* iWait;
+ CBitmapScaler* iBitmapScaler;
+};
+
+
+#endif // IMAGESCALER_H
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtbutton.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtbutton.h Thu Aug 19 09:48:13 2010 +0300
@@ -150,6 +150,8 @@
const TPointerEvent& aPointerEvent) const;
#endif //RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+ void UpdateTextColor();
+
// From CCoeControl
public:
CCoeControl* ComponentControl(TInt aIndex) const;
@@ -185,6 +187,8 @@
TSize ComputeSizeL(TInt aWHint, TInt aHHint);
MSwtButton* ButtonInterface();
TInt FocusBackgroundPolicy() const;
+ TInt PressBackgroundPolicy() const;
+ void HandleHighlightChange();
// From MSwtButton
public:
@@ -242,6 +246,8 @@
#ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK
MTouchFeedback *iFeedback;
#endif //RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+
+ const MSwtColor* iCustomFg;
};
#endif // SWTBUTTON_H
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcaptionedcontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcaptionedcontrol.h Thu Aug 19 09:48:13 2010 +0300
@@ -114,11 +114,6 @@
void DoSetSize(const TSize& aSize);
/**
- * Default foreground setter.
- */
- void SetDefaultForegroundL();
-
- /**
* Get the children of the current contained control.
* @param aAllChildren returned array of children.
* @param aParent parent for which the children will be returned.
@@ -148,6 +143,8 @@
*/
void SwtHandleResourceChangeL(TInt aType);
+ void UpdateTextColor();
+
// From CCoeControl
public:
TInt CountComponentControls() const;
@@ -186,6 +183,7 @@
MSwtCaptionedControl* CaptionedControlInterface() const;
void UpdateDoNotDrawFlag();
void SetForegroundL(const MSwtColor* aColor);
+ void HandleHighlightChange();
// From ASwtControlBase
protected:
@@ -261,9 +259,9 @@
/**
* Current custom foreground.
- * Not Own.
+ * Not own.
*/
- const MSwtColor* iForegroundColor;
+ const MSwtColor* iCustomFg;
/**
* Can be the child or null.
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcombo.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcombo.h Thu Aug 19 09:48:13 2010 +0300
@@ -99,6 +99,7 @@
TEventCode aType);
TBool IsKeyUsed(TUint aKeyCode) const;
HBufC* MSKLabelL() const;
+ TInt PressBackgroundPolicy() const;
// From ASwtScrollableBase
protected:
@@ -236,12 +237,6 @@
* Not own.
*/
MTouchFeedback* iFeedback;
-
- /**
- * True for as long as pressed by pointer.
- * Eclipses ASwtControlBase::iPressed!
- */
- TBool iPressed;
};
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcommandmenu.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcommandmenu.h Thu Aug 19 09:48:13 2010 +0300
@@ -34,7 +34,7 @@
void Reset();
void AppendCommand(const MSwtCommand& aCommand,
const MSwtMenu* aCascadeMenu);
- void AppendSeparator();
+ void AppendSeparatorL();
void InsertCommand(const MSwtCommand& aCommand,
const MSwtMenu* aCascadeMenu, TInt aPos);
const RPointerArray<MSwtCommand>& Commands() const;
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcomposite.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcomposite.h Thu Aug 19 09:48:13 2010 +0300
@@ -93,6 +93,7 @@
void Update() const;
void SetBounds(const TRect& aRect);
void SetWidgetSize(const TSize& aSize);
+ void HandleHighlightChange();
// From ASwtScrollableBase
protected:
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcontrolbase.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtcontrolbase.h Thu Aug 19 09:48:13 2010 +0300
@@ -315,6 +315,7 @@
IMPORT_C TBool IsFocusable(TInt aReason = KSwtFocusByApi) const;
IMPORT_C TBool SetSwtFocus(TInt aReason = KSwtFocusByApi);
IMPORT_C TInt FocusBackgroundPolicy() const;
+ IMPORT_C TInt PressBackgroundPolicy() const;
IMPORT_C TBool GetEnabled() const;
IMPORT_C TBool GetVisible() const;
IMPORT_C TBool GetVisibleRecursively() const;
@@ -334,7 +335,7 @@
IMPORT_C TBool IsDescentOf(const MSwtControl& aParent) const;
IMPORT_C MSwtShell& GetShell() const;
IMPORT_C MSwtShell& GetTopShell() const;
- IMPORT_C MSwtCaptionedControl* GetTopCaptionedControl() const;
+ IMPORT_C MSwtCaptionedControl* GetNearestCaptionedControl(TBool aIncludeSelf = ETrue) const;
IMPORT_C TSize GetWidgetSize() const;
IMPORT_C void SetWidgetSize(const TSize& aSize);
IMPORT_C TBool IsFocusControl();
@@ -365,18 +366,27 @@
IMPORT_C TBool IsOnControlStack() const;
IMPORT_C void UpdateDoNotDrawFlag();
IMPORT_C TBool HasDoNotDrawFlag() const;
- void HideSilently() {};
- void ShowSilently() {};
+ void HideSilently() {};
+ void ShowSilently() {};
TBool HiddenSilently() const
{
return GetShell().Control()->HiddenSilently();
};
IMPORT_C TBool IsLongTapAnimationCandidate(const TPointerEvent& aPointerEvent) const;
- IMPORT_C void DoControlSpecificFeedback(const TBool& aFirstTap,
- const TBool& aTappedToChildRect, const TPointerEvent& aPointerEvent) const;
- IMPORT_C void PostMouseEventL(const TPointerEvent& aPointerEvent);
- IMPORT_C void EnableFocusHighlight(TBool aEnable);
+ IMPORT_C void DoControlSpecificFeedback(const TBool& aFirstTap,
+ const TBool& aTappedToChildRect,
+ const TPointerEvent& aPointerEvent) const;
+ IMPORT_C void PostMouseEventL(const TPointerEvent& aPointerEvent);
+ IMPORT_C void EnableFocusHighlight(TBool aEnable);
IMPORT_C TRect VisibleRect(TBool aVisibleBounds = EFalse) const;
+ IMPORT_C void SetHighlight(TBool aEnabled);
+ IMPORT_C TBool HasHighlight(TBool aIncludingParents = ETrue) const;
+ IMPORT_C void HandleHighlightChange();
+ TInt Pressed() const
+ {
+ return iPressed;
+ };
+ IMPORT_C void PrepareForTraverse();
protected:
MSwtDisplay& iDisplay;
@@ -401,9 +411,15 @@
TBool iFocusChanged;
/**
- * Used to implement visual pressed down feedback for some controls.
+ * Control pressed by pointer.
*/
- TBool iPressed;
+ TInt iPressed;
+
+ /**
+ * If this is true, the control should draw a highlight
+ * either because it is pressed or focused.
+ */
+ TBool iHighlightEnabled;
};
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtdateeditor.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtdateeditor.h Thu Aug 19 09:48:13 2010 +0300
@@ -128,6 +128,8 @@
*/
void UpdateFieldCounters(TBool aIsFieldNumeric, TBool aIsFieldChanged);
+ void UpdateTextColor();
+
// From CCoeControl
public:
TInt CountComponentControls() const;
@@ -161,6 +163,8 @@
void SetBounds(const TRect& aRect);
void SetWidgetSize(const TSize& aSize);
TSwtPeer Dispose();
+ TInt PressBackgroundPolicy() const;
+ void HandleHighlightChange();
// From ASwtControlBase
protected:
@@ -246,6 +250,11 @@
*/
TBool iBgColorIsCustom;
TBool iFgColorIsCustom;
+
+ /**
+ * Foreground color
+ */
+ TRgb iForegroundColor;
};
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtdisplaybase.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtdisplaybase.h Thu Aug 19 09:48:13 2010 +0300
@@ -77,6 +77,9 @@
TBool MousePostL(const TSwtKeyEventData& aData, TPoint point);
MSwtImage* NewImageL(const TSize& aSize);
MSwtImage* NewImageFromDataL(const MSwtImageData& aData);
+ MSwtImage* NewImageFromThemeL(const TInt aId);
+ MSwtImage* ScaleImageL(const MSwtImage& aSrcImage,
+ const TSize& aDestSize, TBool aKeepAspectRatio);
inline CSwtJavaBufferDrawer& JavaBufferDrawer();
// Methods to be used by either thread
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtfactory.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtfactory.h Thu Aug 19 09:48:13 2010 +0300
@@ -124,7 +124,6 @@
MSwtTree* NewTreeL(MSwtDisplay& aDisplay, TSwtPeer aPeer,
MSwtComposite& aParent, TInt aStyle) const;
TRgb* RunColorDialogL(TRgb* aDefaultColor) const;
- MSwtFontDialog* NewFontDialogL() const;
MSwtDirectoryDialog* NewDirectoryDialogL(const TDesC& aFilterPath,
const TDesC& aTitle) const;
MSwtBrowser* NewBrowserL(MSwtDisplay& aDisplay, TSwtPeer aPeer,
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swthyperlink.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swthyperlink.h Thu Aug 19 09:48:13 2010 +0300
@@ -66,10 +66,12 @@
const TDesC& aText,
const TRect& aTextRect,
const CGraphicsContext::TTextAlign& aAlignment) const;
- void UpdateSkinColor();
void UpdateDefaultFontL();
void LaunchHandler();
TPtrC Scheme();
+ TRgb LinkColor() const;
+ TRgb LinkBgColor() const;
+ TRgb PressedLinkColor() const;
// From base class CCoeControl
@@ -94,6 +96,7 @@
public:
void SetForegroundL(const MSwtColor* aColor);
TSize ComputeSizeL(TInt aWHint, TInt aHHint);
+ TInt PressBackgroundPolicy() const;
// From base class ASwtControlBase
@@ -132,24 +135,10 @@
MSwtFont* iDefaultFont;
/**
- * Link fragment text color.
- */
- TRgb iLinkColor;
-
- /**
- * Link fragment text color when highlighted.
+ * Custom foreground color used by the non pressed link.
+ * Not own.
*/
- TRgb iHighlightedLinkColor;
-
- /**
- * Link fragment back highlight color.
- */
- TRgb iHighlightColor;
-
- /**
- * True if currently used text color is a color set by the Java application.
- */
- TBool iCustomTextColor;
+ const MSwtColor* iCustomFg;
/**
* The format of the hyperlink. Textual formatting done and the handler
@@ -162,12 +151,6 @@
* Not own.
*/
MTouchFeedback* iFeedback;
-
- /**
- * True for as long as pressed by pointer.
- * Eclipses ASwtControlBase::iPressed!
- */
- TBool iPressed;
};
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtimage.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtimage.h Thu Aug 19 09:48:13 2010 +0300
@@ -71,8 +71,8 @@
/**
* Two phase constructor.
- * @param aBitmap source bitmap
- * @param aBitmap source mask
+ * @param aBitmap source bitmap - ownership NOT transferred
+ * @param aBitmap source mask - ownership NOT transferred
* @param aTopLeft initial position
* @param aDelayTime frame delay
* @param aDisposalMethod disposal method of previous frames
@@ -81,6 +81,14 @@
static CSwtImage* NewL(CFbsBitmap& aBitmap, CFbsBitmap* aMask,
const TPoint& aTopLeft, TInt aDelayTime, TSwtGifDisposal aDisposalMethod);
+ /**
+ * Two phase constructor.
+ * @param aBitmap source bitmap - ownership transferred
+ * @param aBitmap source mask - ownership transferred
+ * @return pointer to image constructed bitmap + mask
+ */
+ static CSwtImage* NewL(CFbsBitmap& aBitmap, CFbsBitmap* aMask);
+
private:
/**
* First phase constructor.
@@ -116,7 +124,7 @@
* @param aDisposalMethod disposal method of previous frames
*/
void ConstructL(CFbsBitmap& aBitmap, CFbsBitmap* aMask, const TPoint& aTopLeft,
- TInt aDelayTime, TSwtGifDisposal aDisposalMethod);
+ TInt aDelayTime, TSwtGifDisposal aDisposalMethod, TBool aBmpOwnExternally);
/**
* Color key setter.
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtinput.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtinput.h Thu Aug 19 09:48:13 2010 +0300
@@ -30,7 +30,8 @@
static CSwtInput* NewL(TSwtPeer aPeer, TInt aId);
private:
- inline CSwtInput(TSwtPeer aPeer, TInt aId);
+ inline CSwtInput(TSwtPeer aPeer);
+ void ConstructL(TInt aId);
~CSwtInput();
// From MSwtInput
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlabel.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlabel.h Thu Aug 19 09:48:13 2010 +0300
@@ -57,6 +57,7 @@
void DoSetFontL(const CFont* aFont);
void SwtHandleResourceChangeL(TInt aType);
TInt GetFontHeight(const CFont* aFont) const;
+ void UpdateTextColor();
// From CCoeControl
public:
@@ -84,6 +85,7 @@
void SetForegroundL(const MSwtColor* aColor);
TSize ComputeSizeL(TInt aWHint, TInt aHHint);
void SetFontL(const MSwtFont* aFont);
+ void HandleHighlightChange();
// From ASwtControlbase
protected:
@@ -114,7 +116,7 @@
TInt iOriginalTextLineCount;// Count how many lines are in the text ('\n')
MSwtFont* iDefaultFont; // The text's default font, owned, NULL only if iText is NULL
const MSwtImage* iImage; // The image to draw, may be NULL, ref counted
- const MSwtColor* iForegroundColor; // The set foreground color
+ const MSwtColor* iCustomFg;
TBool iDashedLineSeparatorInUse;
};
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlink.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlink.h Thu Aug 19 09:48:13 2010 +0300
@@ -54,7 +54,6 @@
TInt aStyle);
void ConstructL();
void SwtHandleResourceChangeL(TInt aType);
- void UpdateSkinColor();
void UpdateDefaultFontL();
void UpdateMarginValues();
TRect TextRect() const;
@@ -100,7 +99,10 @@
const TInt aCurrentLineIndex) const;
void SetFocusedFragment();
TBool IsRtl() const;
-
+ TRgb TextColor() const;
+ TRgb LinkColor() const;
+ TRgb LinkBgColor() const;
+ TRgb PressedLinkColor() const;
// From base class CCoeControl
public:
@@ -126,6 +128,7 @@
TSize ComputeSizeL(TInt aWHint, TInt aHHint);
void SetFontL(const MSwtFont* aFont);
TBool SetSwtFocus(TInt aReason = KSwtFocusByApi);
+ TInt PressBackgroundPolicy() const;
// From base class ASwtControlBase
protected:
@@ -173,29 +176,10 @@
TInt iLineHeight;
/**
- * Plain text fragment text color.
- */
- TRgb iTextColor;
-
- /**
- * Link fragment text color.
- */
- TRgb iLinkColor;
-
- /**
- * Link fragment text color when highlighted.
+ * Custom foreground color used by the text and non pressed links.
+ * Not own.
*/
- TRgb iHighlightedLinkColor;
-
- /**
- * Link fragment back highlight color.
- */
- TRgb iHighlightColor;
-
- /**
- * True if currently used text color is a color set by the Java application.
- */
- TBool iCustomTextColor;
+ const MSwtColor* iCustomFg;
/**
* The margins used for text positioning when drawing.
@@ -226,12 +210,6 @@
const CSwtLinkFragmentDescriptor* iFocusedFragment;
/**
- * True for as long as pressed by pointer.
- * Eclipses ASwtControlBase::iPressed!
- */
- TBool iPressed;
-
- /**
* True if 2 or more targets.
*/
TBool iMultipleTargets;
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlistbase.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlistbase.h Thu Aug 19 09:48:13 2010 +0300
@@ -289,6 +289,8 @@
#ifdef RD_JAVA_S60_RELEASE_9_2
void EnableFocusHighlight(TBool aEnable);
#endif //RD_JAVA_S60_RELEASE_9_2
+ TInt FocusBackgroundPolicy() const;
+ void PrepareForTraverse();
// From ASwtScrollableBase
protected:
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlistbox.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlistbox.h Thu Aug 19 09:48:13 2010 +0300
@@ -179,6 +179,8 @@
#ifdef RD_JAVA_S60_RELEASE_9_2
void EnableFocusHighlight(TBool aEnable);
#endif //RD_JAVA_S60_RELEASE_9_2
+ TInt FocusBackgroundPolicy() const;
+ void PrepareForTraverse();
// From MSwtListBox
public:
@@ -470,11 +472,6 @@
TRgb iDefColor;
/**
- * Used to hide initial flickering.
- */
- TBool iRestoreRedraw;
-
- /**
* Maximum icon sizes for the current layout.
*/
TSize iMaxDetailIconSize;
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlistboxlists.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlistboxlists.h Thu Aug 19 09:48:13 2010 +0300
@@ -235,7 +235,7 @@
* @param aListType see TSwtLbType
* @return ETrue if listbox is formatted.
*/
- static void Cells(TInt aListType, RArray<TInt>& aCellArray);
+ static void CellsL(TInt aListType, RArray<TInt>& aCellArray);
/**
* Check if a int value is in the range of listbox types.
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlistview.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtlistview.h Thu Aug 19 09:48:13 2010 +0300
@@ -129,6 +129,8 @@
#ifdef RD_JAVA_S60_RELEASE_9_2
void EnableFocusHighlight(TBool aEnable);
#endif //RD_JAVA_S60_RELEASE_9_2
+ TInt FocusBackgroundPolicy() const;
+ void PrepareForTraverse();
// From MEikCommandObserver
public:
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtmobiledevice.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtmobiledevice.h Thu Aug 19 09:48:13 2010 +0300
@@ -41,7 +41,7 @@
public:
static CSwtMobileDevice* NewL(MSwtDisplay& aDisplay, TSwtPeer aPeer);
static TInt HwScreenCount();
- static void GetHwInputs(RArray<TSwtHwInput>& aInputs);
+ static void GetHwInputsL(RArray<TSwtHwInput>& aInputs);
private:
inline CSwtMobileDevice(MSwtDisplay& aDisplay, TSwtPeer aPeer);
virtual ~CSwtMobileDevice();
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtrotateimage.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtrotateimage.h Thu Aug 19 09:48:13 2010 +0300
@@ -62,12 +62,12 @@
/**
* Add a image which will be rotate after a call to the method Start().
*/
- void AddImage(CFbsBitmap* aImage);
+ void AddImageL(CFbsBitmap* aImage);
/**
* Add images which will be rotate after a call to the method Start().
*/
- void AddImages(const RArray<CFbsBitmap*>& aImages);
+ void AddImagesL(const RArray<CFbsBitmap*>& aImages);
/**
* Indicate if a redraw should be make when the rotation of all images is finih,
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtscrollablebase.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtscrollablebase.h Thu Aug 19 09:48:13 2010 +0300
@@ -88,6 +88,7 @@
// From ASwtControlBase
public:
virtual TRect ClientRect() const;
+ virtual MSwtScrollable* ScrollableInterface();
// From MEikScrollBarObserver
public:
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtshell.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtshell.h Thu Aug 19 09:48:13 2010 +0300
@@ -36,8 +36,8 @@
void ConstructL();
MSwtShell& GetTopShell() const;
void RemoveAndRememberFocus();
-
- // Relocating an editor's Shell must be delegated to UiUtils
+
+ // Relocating an editor's Shell must be delegated to UiUtils
// while split editing is on (@see SetSplitInputShellPos)
// CCoeControl::SetRect must not be called directly.
void DoSetRect(const TRect& aRect);
@@ -138,9 +138,7 @@
const MSwtCommand* DefaultCommand() const;
void SetFullScreen(TBool aFullScreen);
void SetControlGoingToStack(MSwtControl* aControl);
- MSwtControl* ControlGoingToStack() const;
void SetControlGainingFocus(MSwtControl* aControl);
- MSwtControl* ControlGainingFocus() const;
MSwtShell::TSwtStatusPaneStyle StatusPaneStyle() const
{
return MSwtShell::EStyleLargeStatusPane;
@@ -157,6 +155,8 @@
void SetTaskTip();
TBool IsTaskTip() const;
void DoSetLocation(const TPoint& aPoint);
+ void UpdateHighlight(TBool aDrawNow = EFalse);
+ void ControlDisposing(const MSwtControl& aControl);
// From MEikStatusPaneObserver
public:
@@ -164,6 +164,8 @@
private:
void FinishRedraw() const;
+ void DoSetFocusControl(MSwtControl* aControl);
+ void DoSetHighlight(MSwtControl& aControl, TBool aEnabled);
// Data
private:
@@ -174,6 +176,15 @@
MSwtControl* iFocusControl;
/**
+ * Keep track of last known focused control for the purpose
+ * of switching off its highlight when new controls gets focused.
+ * Not intended to be used for any athoer purpose (set to NULL
+ * after the highlight is cleared).
+ * Not own.
+ */
+ MSwtControl* iPrevFocusControl;
+
+ /**
* This Shell's focus control before it got deactivated, may be NULL.
* Not own.
*/
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtsortedlist.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtsortedlist.h Thu Aug 19 09:48:13 2010 +0300
@@ -163,6 +163,8 @@
#ifdef RD_JAVA_S60_RELEASE_9_2
void EnableFocusHighlight(TBool aEnable);
#endif //RD_JAVA_S60_RELEASE_9_2
+ void PrepareForTraverse();
+
protected:
void DoPaint(const TRect& aRect) const;
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swttable.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swttable.h Thu Aug 19 09:48:13 2010 +0300
@@ -283,6 +283,7 @@
#ifdef RD_JAVA_S60_RELEASE_9_2
void EnableFocusHighlight(TBool aEnable);
#endif //RD_JAVA_S60_RELEASE_9_2
+ void PrepareForTraverse();
// from base class ASwtScrollableBase
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swttextbase.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swttextbase.h Thu Aug 19 09:48:13 2010 +0300
@@ -152,6 +152,8 @@
*/
void FixPadding();
+ void UpdateTextColor();
+
#if defined( RD_SCALABLE_UI_V2)
// From MCoeCaptionRetrieverForFep
private:
@@ -182,7 +184,6 @@
// From MSwtControl
public:
TBool SetSwtFocus(TInt aReason = KSwtFocusByApi);
- TInt FocusBackgroundPolicy() const;
TRect ClientRect() const;
CCoeControl& CoeControl();
const CCoeControl& CoeControl() const;
@@ -195,6 +196,8 @@
void SetBounds(const TRect& aRect);
void SetWidgetSize(const TSize& aSize);
TSwtPeer Dispose();
+ TInt PressBackgroundPolicy() const;
+ void HandleHighlightChange();
// From ASwtControlBase
protected:
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtuiutils.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/swtuiutils.h Thu Aug 19 09:48:13 2010 +0300
@@ -15,6 +15,7 @@
#include <AknPopupFader.h>
+#include <aknappui.h>
#include "eswtwidgetscore.h"
@@ -187,10 +188,10 @@
void HideIndicator(TInt aId);
void HideIndicators();
-
+
void DoSetSplitInputShellPos(const TPoint& aPos);
void DoSetSplitInputViewSize(const TSize& aSize);
-
+
MSwtControl* ScrolledCompositeAncestor(const MSwtControl& aControl) const;
// From MSwtUiUtils
@@ -240,7 +241,10 @@
void SetSplitInputShellPos(const TPoint& aOriginalPos);
void SetSplitInputViewSize(const TSize& aOriginalSize);
void AdjustSplitInputShellPos();
-
+ void RegisterFixScreenOrientation();
+ void UnRegisterFixScreenOrientation();
+ TBool IsScreenOrientationFixed() const;
+
protected:
void HandleFreeRamEventL(TInt aEventType);
@@ -400,7 +404,7 @@
* Key input flag.
*/
TBool iNaviKeyInput;
-
+
/**
* Split input data.
*/
@@ -409,6 +413,9 @@
TSize iSplitInputViewSize;
TPoint iSplitInputShellPos;
TBool iSplitInputSPVisible;
+ TInt iFixScreenOrientationApplicantsCount;
+ TBool iRestoreOrientation;
+ CAknAppUiBase::TAppUiOrientation iOldUiOrientation;
};
/**
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/utils.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/inc/utils.h Thu Aug 19 09:48:13 2010 +0300
@@ -127,11 +127,7 @@
*/
inline HBufC* ConvertStringLC(JNIEnv* aJniEnv, const jstring aString)
{
-#ifdef _UNICODE
return ConvertString16LC(aJniEnv, aString);
-#else
- // code needs to be written
-#endif
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/imagescaler.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nokia Corporation - S60 implementation
+ *******************************************************************************/
+
+
+#include <eikenv.h>
+#include <bitmaptransforms.h>
+#include "imagescaler.h"
+
+
+CImageScaler::CImageScaler()
+ : CActive(EPriorityStandard)
+{
+ CActiveScheduler::Add(this);
+}
+
+CImageScaler::~CImageScaler()
+{
+ Cancel();
+ if (iBitmapScaler)
+ iBitmapScaler->Cancel();
+ delete iBitmapScaler;
+ delete iWait;
+}
+
+CImageScaler* CImageScaler::NewL()
+{
+ CImageScaler* self = new(ELeave) CImageScaler();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(self);
+ return self;
+}
+
+void CImageScaler::ConstructL()
+{
+ iBitmapScaler = CBitmapScaler::NewL();
+ iBitmapScaler->SetQualityAlgorithm(CBitmapScaler::EMaximumQuality);
+ iWait = new(ELeave) CActiveSchedulerWait;
+}
+
+void CImageScaler::Scale(CFbsBitmap& aSrcBitmap, CFbsBitmap& aDestBitmap, TBool aKeepAspectRatio)
+{
+ iBitmapScaler->Scale(&iStatus, aSrcBitmap, aDestBitmap, aKeepAspectRatio);
+ SetActive();
+ iWait->Start();
+}
+
+void CImageScaler::RunL()
+{
+ iWait->AsyncStop();
+}
+
+void CImageScaler::DoCancel()
+{
+}
+
+// End of File
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/org_eclipse_ercp_swt_mobile_internal_OS.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/org_eclipse_ercp_swt_mobile_internal_OS.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -1483,12 +1483,19 @@
jint* elements = aJniEnv->GetIntArrayElements(aIconsHandles, &isCopy);
if (elements != NULL)
{
- for (TInt i=0; i<count; ++i)
+ TInt err = KErrNone;
+ for (TInt i=0; i<count && !err; ++i)
{
- iconsHandles.Append(reinterpret_cast<MSwtImage*>(elements[i]));
+ err = iconsHandles.Append(reinterpret_cast<MSwtImage*>(elements[i]));
}
// Cleanup
aJniEnv->ReleaseIntArrayElements(aIconsHandles, elements, JNI_ABORT);
+
+ if (err != KErrNone )
+ {
+ ThrowIfError(err, aJniEnv);
+ return;
+ }
}
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/org_eclipse_swt_internal_symbian_OS.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/org_eclipse_swt_internal_symbian_OS.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -1506,6 +1506,18 @@
return reinterpret_cast<jint>(result);
}
+ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_symbian_OS_Image_1NewFromTheme(JNIEnv* aJniEnv, jclass, jint aDevice, jint aId)
+ {
+ ASwtDisplayBase* display = DisplayFromDevice(aDevice);
+ MSwtImage* result = NULL;
+ TRAPD(error, CallMethodL(result, display, &ASwtDisplayBase::NewImageFromThemeL, aId));
+ ThrowIfError(error, aJniEnv);
+
+ INCREASE_INSTANCE_COUNT_USE_DISPLAY(result, Image, display);
+
+ return reinterpret_cast<jint>(result);
+ }
+
JNIEXPORT void JNICALL Java_org_eclipse_swt_internal_symbian_OS_Image_1Dispose(JNIEnv*, jclass, jint aDevice, jint aHandle)
{
CSwtDisplay* display = DisplayFromDevice(aDevice);
@@ -1553,6 +1565,20 @@
CallMethod(static_cast<const MSwtRefCounted*>(image), &MSwtImage::RemoveRef);
}
+ JNIEXPORT jint JNICALL Java_org_eclipse_swt_internal_symbian_OS_Image_1Scale(JNIEnv* aJniEnv, jclass,
+ jint aDevice, jint aHandle, jint aWidth, jint aHeight, jboolean aKeepAspectRatio)
+ {
+ ASwtDisplayBase* display = DisplayFromDevice(aDevice);
+ const MSwtImage* image = reinterpret_cast<MSwtImage*>(aHandle);
+ const TSize size(aWidth, aHeight);
+ MSwtImage* result = NULL;
+ TRAPD(error, CallMethodL(result, display, &ASwtDisplayBase::ScaleImageL, *image, size, aKeepAspectRatio));
+ ThrowIfError(error, aJniEnv);
+
+ INCREASE_INSTANCE_COUNT_USE_DISPLAY(result, Image, display);
+
+ return reinterpret_cast<jint>(result);
+ }
/*
* Class Menu
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtbutton.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtbutton.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -213,12 +213,7 @@
iButton->SetBackground(this); // Back will be drawn by ASwtControlBase::Draw
// Set default color
- TRgb color;
- AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
- color,
- KAknsIIDQsnTextColors,
- EAknsCIQsnTextColorsCG6);
- iButton->OverrideColorL(EColorButtonText, color);
+ UpdateTextColor();
}
// ---------------------------------------------------------------------------
@@ -412,6 +407,7 @@
{
ChangeCheckOrRadioIconL(iSelected);
}
+ UpdateTextColor();
}
}
}
@@ -632,26 +628,9 @@
//
void CSwtButton::SetForegroundL(const MSwtColor* aColor)
{
- TRgb color;
-
- if (aColor)
- {
- color = aColor->RgbValue();
- }
- else
- {
- AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
- color,
- KAknsIIDQsnTextColors,
- EAknsCIQsnTextColorsCG6);
- }
-
- if (iButton)
- {
- iButton->OverrideColorL(EColorButtonText, color);
- }
-
ASwtControlBase::DoSetForegroundL(aColor);
+ iCustomFg = aColor;
+ UpdateTextColor();
Redraw();
}
@@ -827,10 +806,78 @@
//
TInt CSwtButton::FocusBackgroundPolicy() const
{
- return EEmbeddedFocusBackground;
+ TInt policy(EEmbeddedFocusBackground);
+ if (iStyle & (KSwtStyleCheck | KSwtStyleRadio))
+ {
+ policy = EDefaultFocusBackground;
+ }
+ return policy;
};
// ---------------------------------------------------------------------------
+// CSwtButton::PressBackgroundPolicy
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+TInt CSwtButton::PressBackgroundPolicy() const
+{
+ return EEmbeddedPressBackground;
+}
+
+// ---------------------------------------------------------------------------
+// CSwtButton::UpdateTextColor
+// ---------------------------------------------------------------------------
+//
+void CSwtButton::UpdateTextColor()
+{
+ if (iButton)
+ {
+ TBool highlighted = HasHighlight() && (iStyle & (KSwtStyleCheck | KSwtStyleRadio));
+
+ TRgb color(0);
+ TInt err(KErrNone);
+
+ if (highlighted)
+ {
+ // Highlighted foreground color, overrides all others.
+ err = AknsUtils::GetCachedColor(AknsUtils::SkinInstance()
+ , color
+ , KAknsIIDQsnTextColors
+ , KHighlightedTextColor);
+ }
+ else if (iCustomFg)
+ {
+ // Custom foreground color, overrides the default.
+ color = iCustomFg->RgbValue();
+ }
+ else
+ {
+ // Default foreground color.
+ err = AknsUtils::GetCachedColor(AknsUtils::SkinInstance()
+ , color
+ , KAknsIIDQsnTextColors
+ , KNonHighlightedTextColor);
+ }
+
+ if (err == KErrNone)
+ {
+ TRAP_IGNORE(iButton->OverrideColorL(EColorButtonText, color));
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------
+// CSwtButton::HandleHighlightChange
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+void CSwtButton::HandleHighlightChange()
+{
+ if (iStyle & (KSwtStyleCheck | KSwtStyleRadio))
+ UpdateTextColor();
+}
+
+// ---------------------------------------------------------------------------
// CSwtButton::Control
// From MSwtButton
// ---------------------------------------------------------------------------
@@ -1182,6 +1229,15 @@
iButton->HandlePointerEventL(aPointerEvent);
}
+ // If directly captioned, the CaptionedControl gets "pressed" as well.
+ if (aPointerEvent.iType == TPointerEvent::EButton1Up
+ || aPointerEvent.iType == TPointerEvent::EButton1Down)
+ {
+ iPressed = aPointerEvent.iType == TPointerEvent::EButton1Down;
+ if (iParent->Control()->CaptionedControlInterface())
+ GetShell().UpdateHighlight(ETrue);
+ }
+
PostMouseEventL(aPointerEvent);
}
#endif // RD_SCALABLE_UI_V2
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcaptionedcontrol.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcaptionedcontrol.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -148,9 +148,6 @@
iDefaultFont->RemoveRef();
iDefaultFont = NULL;
}
-
- // Not Own
- iForegroundColor = NULL;
}
// ---------------------------------------------------------------------------
@@ -175,9 +172,10 @@
iControl->SetFocusing(ETrue);
iControl->ActivateL();
- SetDefaultForegroundL();
SetBackground(this); // Back will be drawn by ASwtControlBase::Draw
ActivateL();
+
+ UpdateTextColor();
}
// ---------------------------------------------------------------------------
@@ -231,20 +229,6 @@
}
// ---------------------------------------------------------------------------
-// CSwtCaptionedControl::SetEmphasis
-// ---------------------------------------------------------------------------
-//
-void CSwtCaptionedControl::SetEmphasis(TDrawNow /*aDrawNow*/)
-{
- // If foreground color has not been set then update according to focus
- if (!iForegroundColor)
- {
- TRAP_IGNORE(SetDefaultForegroundL());
- }
- Redraw();
-}
-
-// ---------------------------------------------------------------------------
// CSwtCaptionedControl::ComputeInnerRect
// ---------------------------------------------------------------------------
//
@@ -313,29 +297,6 @@
}
// ---------------------------------------------------------------------------
-// CSwtCaptionedControl::SetDefaultForegroundL
-// ---------------------------------------------------------------------------
-//
-void CSwtCaptionedControl::SetDefaultForegroundL()
-{
- TRgb defaultColor;
- TAknsQsnTextColorsIndex colorIndex;
- if (iDisplay.UiUtils().NaviKeyInput() && IsFocusedOrChildIsFocused())
- {
- colorIndex = EAknsCIQsnTextColorsCG10;
- }
- else
- {
- colorIndex = EAknsCIQsnTextColorsCG6;
- }
- if (AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), defaultColor,
- KAknsIIDQsnTextColors, colorIndex) == KErrNone)
- {
- OverrideColorL(EColorLabelText, defaultColor);
- }
-}
-
-// ---------------------------------------------------------------------------
// CSwtCaptionedControl::GetRecursiveChildrenL
// ---------------------------------------------------------------------------
//
@@ -694,14 +655,6 @@
//
void CSwtCaptionedControl::SwtHandleResourceChangeL(TInt aType)
{
- if (aType == KAknsMessageSkinChange || aType == KEikDynamicLayoutVariantSwitch)
- {
- if (!iForegroundColor)
- {
- SetDefaultForegroundL();
- }
- }
-
CEikCaptionedControl::HandleResourceChange(aType);
CCoeControl* coeChild = CoeChild();
@@ -751,6 +704,11 @@
}
}
}
+
+ if (aType == KAknsMessageSkinChange)
+ {
+ UpdateTextColor();
+ }
}
}
@@ -762,13 +720,62 @@
void CSwtCaptionedControl::SetForegroundL(const MSwtColor* aColor)
{
ASwtControlBase::DoSetForegroundL(aColor);
- SetColorL(EColorLabelText, aColor);
- if (!aColor)
+ iCustomFg = aColor;
+ UpdateTextColor();
+ Redraw();
+}
+
+// ---------------------------------------------------------------------------
+// CSwtCaptionedControl::UpdateTextColor
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+void CSwtCaptionedControl::UpdateTextColor()
+{
+ TRgb color(0);
+ TInt err(KErrNone);
+
+ if (HasHighlight())
+ {
+ // Highlighted foreground color, overrides all others.
+ err = AknsUtils::GetCachedColor(AknsUtils::SkinInstance()
+ , color
+ , KAknsIIDQsnTextColors
+ , KHighlightedTextColor);
+ }
+ else if (iCustomFg)
{
- SetDefaultForegroundL();
+ // Custom foreground color, overrides the default.
+ color = iCustomFg->RgbValue();
+ }
+ else
+ {
+ // Default foreground color.
+ err = AknsUtils::GetCachedColor(AknsUtils::SkinInstance()
+ , color
+ , KAknsIIDQsnTextColors
+ , KNonHighlightedTextColor);
+ }
+
+ if (err == KErrNone)
+ {
+ TRAP_IGNORE(OverrideColorL(EColorLabelText, color));
}
- iForegroundColor = aColor;
- Redraw();
+}
+
+// ---------------------------------------------------------------------------
+// CSwtCaptionedControl::HandleHighlightChange
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+void CSwtCaptionedControl::HandleHighlightChange()
+{
+ UpdateTextColor();
+ MSwtControl* child = Child();
+ if (child)
+ {
+ child->HandleHighlightChange();
+ }
}
// ---------------------------------------------------------------------------
@@ -779,7 +786,6 @@
void CSwtCaptionedControl::FocusChanged(TDrawNow aDrawNow)
{
HandleFocusChanged(aDrawNow);
- SetEmphasis(aDrawNow);
}
// ---------------------------------------------------------------------------
@@ -1630,7 +1636,6 @@
//
void CSwtCaptionedControl::ChildFocusChanged(MSwtControl& aControl)
{
- SetEmphasis(ENoDrawNow);
GetParent()->ChildFocusChanged(aControl);
}
@@ -1816,7 +1821,6 @@
iCaption->SetMopParent(this); // Absolutely necessary
iCaption->MakeVisible(IsVisible());
iCaption->SetDimmed(IsDimmed());
- SetEmphasis(ENoDrawNow);
if (AknLayoutUtils::LayoutMirrored())
{
iCaption->SetAlignment(EHRightVCenter);
@@ -1841,6 +1845,8 @@
{
iCaption->iMargin.iTop = captionRealFontHeight - font.HeightInPixels();
}
+
+ UpdateTextColor();
}
// We force a call to ( private ) SizeChanged to resize the components.
@@ -1873,7 +1879,6 @@
iTrailer->SetMopParent(this); // Absolutely necessary
iTrailer->MakeVisible(IsVisible());
iTrailer->SetDimmed(IsDimmed());
- SetEmphasis(ENoDrawNow);
iTrailer->ActivateL();
}
@@ -1890,6 +1895,8 @@
{
iTrailer->iMargin.iTop = captionRealFontHeight - font.HeightInPixels();
}
+
+ UpdateTextColor();
}
// We force a call to ( private ) SizeChanged to resize the components.
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcombo.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcombo.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -294,7 +294,7 @@
if (pressed != iPressed)
{
- Redraw();
+ GetShell().UpdateHighlight(ETrue); // draw now
}
PostMouseEventL(aPointerEvent);
@@ -468,6 +468,7 @@
{
if (!iOpen)
{
+ Invalidate(Rect());
DoOpenL();
iDisplay.PostDefaultSelectionEventL(iPeer);
}
@@ -520,6 +521,16 @@
}
// ---------------------------------------------------------------------------
+// CSwtCombo::PressBackgroundPolicy
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+TInt CSwtCombo::PressBackgroundPolicy() const
+{
+ return EEmbeddedPressBackground;
+}
+
+// ---------------------------------------------------------------------------
// CSwtCombo::ComputeTrim
// From MSwtScrollable
// ---------------------------------------------------------------------------
@@ -1346,7 +1357,9 @@
// Get new selection
iPrevSelIdx = iCombo->SelectedIndex();
- Redraw();
+
+ // Remove the pressed down highlight
+ GetShell().UpdateHighlight(ETrue);
}
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcommandarranger.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcommandarranger.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -229,7 +229,7 @@
#ifdef RD_SCALABLE_UI_V2
TRAP_IGNORE(iDisplay.MenuArranger().CloseStylusPopupMenuL());
-#endif //RD_SCALABLE_UI_V2);
+#endif //RD_SCALABLE_UI_V2);
}
void CSwtCommandArranger::ComputeAndRefreshCbaAndMenuL(TBool aFocusedControlOnly)
@@ -305,10 +305,10 @@
// Add a separator in the command menu before appending the new commands to it
if (itIsNotTheFirstControlWithCommands)
{
- iCommandMenu->AppendSeparator();
+ iCommandMenu->AppendSeparatorL();
if (iCommandMenuOK)
{
- iCommandMenuOK->AppendSeparator();
+ iCommandMenuOK->AppendSeparatorL();
}
}
else
@@ -1600,5 +1600,5 @@
return iCommands.FindInOrder(iSearchedContainer, containerOrder);
}
-#endif //RD_SCALABLE_UI_V2
+#endif //RD_SCALABLE_UI_V2
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcommandmenu.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcommandmenu.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -94,11 +94,11 @@
}
}
-void CSwtCommandMenu::AppendSeparator()
+void CSwtCommandMenu::AppendSeparatorL()
{
// If append fails then separator won't appear in menu. It's a shame but
// it's like that (nothing specific to do if this happens).
- iSeparators.Append(iItems.Count() - 1);
+ iSeparators.AppendL(iItems.Count() - 1);
}
const RPointerArray<MSwtCommand>& CSwtCommandMenu::Commands() const
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcomposite.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcomposite.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -692,6 +692,22 @@
void CSwtComposite::PositionChanged()
{
+ if (IsShell())
+ {
+ const TInt childCount = iChildren.Count();
+ for (TInt i = 0; i < childCount; ++i)
+ {
+ MSwtControl* child = iChildren[i];
+ // We reset the position of child control in order to
+ // correctly display scrollbar's background
+ if (!child->IsShell() && child->ScrollableInterface())
+ {
+ CCoeControl& coeChild = child->CoeControl();
+ TPoint pos(coeChild.Position());
+ coeChild.SetPosition(pos);
+ }
+ }
+ }
RectChanged();
HandlePositionChanged();
}
@@ -976,6 +992,20 @@
}
}
+void CSwtComposite::HandleHighlightChange()
+{
+ TInt count = iChildren.Count();
+
+ for (TInt i = 0; i < count; ++i)
+ {
+ MSwtControl* child = iChildren[i];
+ if (!child->IsShell())
+ {
+ child->HandleHighlightChange();
+ }
+ }
+}
+
void CSwtComposite::DrawScrollBarBackground(const TRect& aRect) const
{
const CCoeControl& coeControl = CoeControl();
@@ -1419,7 +1449,7 @@
// From MAknPhysicsObserver
void CSwtComposite::ViewPositionChanged(const TPoint& aNewPosition,
- TBool aDrawNow, TUint /*aFlags*/)
+ TBool /*aDrawNow*/, TUint /*aFlags*/)
{
if (!iScrlCompContent || iPhysicsViewPos == aNewPosition)
{
@@ -1468,24 +1498,24 @@
coeCtrl.SetPosition(TPoint(x, y));
iPhysicsViewPos = aNewPosition;
- if (aDrawNow)
+ if (iVScroll)
+ {
+ TInt pos = viewRect.iTl.iY - y; // composite coords
+ pos = Min(pos, iVScroll->GetMaximum());
+ pos = Max(pos, 0);
+ TRAP_IGNORE(iVScroll->DoSetThumbPositionL(pos));
+ }
+ if (iHScroll)
{
- if (iVScroll)
- {
- TInt pos = viewRect.iTl.iY - y; // composite coords
- pos = Min(pos, iVScroll->GetMaximum());
- pos = Max(pos, 0);
- TRAP_IGNORE(iVScroll->DoSetThumbPositionL(pos));
- }
- if (iHScroll)
- {
- TInt pos = viewRect.iTl.iX - x; // composite coords
- pos = Min(pos, iHScroll->GetMaximum());
- pos = Max(pos, 0);
- TRAP_IGNORE(iHScroll->DoSetThumbPositionL(pos));
- }
- PaintUrgently();
+ TInt pos = viewRect.iTl.iX - x; // composite coords
+ pos = Min(pos, iHScroll->GetMaximum());
+ pos = Max(pos, 0);
+ TRAP_IGNORE(iHScroll->DoSetThumbPositionL(pos));
}
+ // We have to always repaint the composite, since after setPosition
+ // some child controls might redraw themselves. This can cause distortions
+ // while panning the composite.
+ PaintUrgently();
#ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK
// Flicking or panning the composite content should give the feedback
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcontrolbase.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcontrolbase.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -73,12 +73,7 @@
CSwtLafFacade::EInputFieldSkinPlacingGeneralLine5, rect, 0).Rect().iTl;
iFocusFrame = CAknsFrameBackgroundControlContext::NewL(
-#ifdef RD_JAVA_S60_RELEASE_9_2
- KAknsIIDQsnFrPopupPreview,
-#else
- KAknsIIDQsnFrInput,
-#endif // RD_JAVA_S60_RELEASE_9_2
- rect, innerRect, EFalse /*parent absolute*/);
+ KAknsIIDQsnFrInput, rect, innerRect, EFalse /*parent absolute*/);
if (iBackgrdDefaultUsed)
{
@@ -88,45 +83,19 @@
CAknsBasicBackgroundControlContext* ASwtControlBase::FocusBackgroundNow() const
{
-#ifdef RD_JAVA_S60_RELEASE_9_2
- if (!iDisplay.UiUtils().NaviKeyInput() && !iPressed)
+ if (HasHighlight(EFalse)) // not checking parents
+ {
+ return iFocusFrame;
+ }
+ else
{
return NULL;
}
-#endif // RD_JAVA_S60_RELEASE_9_2
-
- // Pressed down state shows the highlight no matter what.
- if (!iPressed)
- {
- TInt policy = FocusBackgroundPolicy();
-
- // CaptionedControls that have a custom back color set provide a highlight with
- // no parent context and that can be a problem for semi transparent highligts.
- // The remedy for this is to let the child control draw its own highlight for
- // as long as the parent CaptionedControl has the custom background color set.
- if ((policy == ENoFocusBackground)
- || (policy == EEmbeddedFocusBackground)
- || (iParent && iParent->Control()->CaptionedControlInterface() && iParent->Control()->IsDefaultBackgroundUse())
- || (policy == ECaptionedCtrlFocusBackground && !IsFocusedOrChildIsFocused())
- || (policy == EDefaultFocusBackground && GetShell().FocusControl() != this)
- || (GetShell().Composite()->CountFocusableChildren(1, this) == 0))
- {
- return NULL;
- }
- }
-
- // If we got here, it means we have to draw a focus background.
- if (!iFocusFrame)
- {
- TRAP_IGNORE(const_cast<ASwtControlBase*>(this)->CreateFocusBackgroundL());
- }
-
- return iFocusFrame;
}
void ASwtControlBase::RedrawFocusBackground()
{
- MSwtCaptionedControl* captCtrl = GetTopCaptionedControl();
+ MSwtCaptionedControl* captCtrl = GetNearestCaptionedControl();
if (captCtrl)
{
captCtrl->Composite()->Control()->Redraw();
@@ -466,6 +435,7 @@
MSwtControl* urgentPaintControl = shell.UrgentPaintControl();
if (urgentPaintControl)
{
+ // Redraw requests outside urgently painted controls are ignored.
if (IsDescentOf(*urgentPaintControl))
{
urgentPaintControl->PaintUrgently(aRect);
@@ -532,6 +502,39 @@
return rect;
}
+EXPORT_C TBool ASwtControlBase::HasHighlight(TBool aIncludingParents /*= ETrue*/) const
+{
+ TBool res = iHighlightEnabled;
+ if (!res && aIncludingParents)
+ {
+ res = res || (iParent && iParent->Control()->HasHighlight(ETrue));
+ }
+ return res;
+}
+
+EXPORT_C void ASwtControlBase::SetHighlight(TBool aEnabled)
+{
+ iHighlightEnabled = aEnabled;
+
+ // Prepare the frame
+ if (aEnabled && !iFocusFrame)
+ {
+ TRAP_IGNORE(const_cast<ASwtControlBase*>(this)->CreateFocusBackgroundL());
+ }
+
+ HandleHighlightChange();
+}
+
+EXPORT_C void ASwtControlBase::HandleHighlightChange()
+{
+ // Do nothing here. Inherit where needed.
+}
+
+EXPORT_C void ASwtControlBase::PrepareForTraverse()
+{
+ // Do nothing here. Inherit where needed.
+}
+
TRect ASwtControlBase::ClipToVisibleRect(const TRect& aRect) const
{
// WINDOW COORDINATES!
@@ -755,16 +758,13 @@
TSwtEventType type((focused) ? ESwtEventFocusIn : ESwtEventFocusOut);
TRAP_IGNORE(iDisplay.PostFocusEventL(JavaPeer(), type));
- if (!(iCtrlFlags & MSwtControl::EFlagDoNotDraw))
- {
- Redraw();
- }
-
if (focused)
{
// Add to ControlStack since the control becomes focused
TRAP_IGNORE(AddToControlStackL(ECoeStackPriorityDefault));
}
+
+ shell.UpdateHighlight();
}
TKeyResponse ASwtControlBase::OfferKeyEventToCommandAndMenuArrangersL(
@@ -861,14 +861,6 @@
EStdKeyRightArrow, EKeyDownArrow, EStdKeyDownArrow);
}
- if (aKeyEvent.iScanCode == EStdKeyDownArrow
- || aKeyEvent.iScanCode == EStdKeyUpArrow
- || aKeyEvent.iScanCode == EStdKeyRightArrow
- || aKeyEvent.iScanCode == EStdKeyLeftArrow)
- {
- iDisplay.UiUtils().SetNaviKeyInput(ETrue);
- }
-
// Offer key event to command arranger first
TKeyResponse keyResponse = OfferKeyEventToCommandAndMenuArrangersL(aKeyEvent, aType);
if (keyResponse == EKeyWasConsumed)
@@ -1092,11 +1084,20 @@
}
MSwtComposite* parent = GetParent();
+ TInt policy = FocusBackgroundPolicy();
if (IsDefaultBackgroundUse())
{
background = aBeginSearchToThis ? GetControlContext() : NULL;
while (!background && parent)
{
+ // If policy is ENoFocusBackgroundInCaptionedControl, bypass the caption highlight.
+ if (policy == ENoFocusBackgroundInCaptionedControl
+ && parent->Control()->CaptionedControlInterface())
+ {
+ parent = parent->Control()->GetParent();
+ ASSERT(parent);
+ }
+
background = parent->Control()->GetControlContext();
// If the parent is a Shell we stop on it.
@@ -1349,14 +1350,6 @@
Invalidate(CoeControl().Rect());
- if (GetShell().ControlGoingToStack() == this)
- {
- GetShell().SetControlGoingToStack(NULL);
- }
- if (GetShell().ControlGainingFocus() == this)
- {
- GetShell().SetControlGainingFocus(NULL);
- }
if (UiUtils().PointerCaptureControl() == this)
{
UiUtils().SetPointerCaptureControl(NULL);
@@ -1372,6 +1365,8 @@
RemoveFromControlStack();
+ GetShell().ControlDisposing(*this);
+
TSwtPeer peer(iPeer);
DoDelete();
return peer;
@@ -1737,6 +1732,11 @@
return EDefaultFocusBackground;
};
+EXPORT_C TInt ASwtControlBase::PressBackgroundPolicy() const
+{
+ return ENoPressBackground;
+};
+
EXPORT_C TBool ASwtControlBase::GetEnabled() const
{
return (CoeControl().IsDimmed()) ? EFalse : ETrue;
@@ -1763,10 +1763,7 @@
EXPORT_C MAknsControlContext* ASwtControlBase::GetControlContext() const
{
- // A focus highlight without parent context is no good since the highlight
- // graphic may be semi transparent, so return CaptionedControl's highlight
- // only if no back color has been set.
- if (CaptionedControlInterface() && IsDefaultBackgroundUse())
+ if (CaptionedControlInterface())
{
return FocusBackgroundNow();
}
@@ -1890,15 +1887,15 @@
return *shell;
}
-EXPORT_C MSwtCaptionedControl* ASwtControlBase::GetTopCaptionedControl() const
+EXPORT_C MSwtCaptionedControl* ASwtControlBase::GetNearestCaptionedControl(TBool aIncludeSelf /*= ETrue*/) const
{
MSwtCaptionedControl* res = NULL;
- const MSwtControl* ctrl = this;
+ const MSwtControl* ctrl = aIncludeSelf ? this : (GetParent() ? GetParent()->Control() : NULL);
while (ctrl)
{
if (ctrl->CaptionedControlInterface())
{
- res = ctrl->CaptionedControlInterface();
+ return ctrl->CaptionedControlInterface();
}
ctrl = ctrl->GetParent() ? ctrl->GetParent()->Control() : NULL;
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcontrolhelper.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtcontrolhelper.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -222,13 +222,9 @@
CleanupStack::PushL(buffer);
TPtrC8 ptr8(buffer->Ptr(0));
-#ifdef _UNICODE
return TPtr16(reinterpret_cast<TText16*>(const_cast<TText8*>(ptr8.Ptr())),
length,
length); //lint !e826
-#else
- return TPtr8(const_cast<TText8*>(ptr8.Ptr()), ptr8.Length(), ptr8.Length());
-#endif
}
/*
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtdateeditor.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtdateeditor.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -62,6 +62,7 @@
, iCurrentFieldLength(0)
, iCurrentFieldDecimalPlacesCount(0)
, iLastField(0)
+ , iFgColorIsCustom(EFalse)
{
}
@@ -281,8 +282,16 @@
{
ASwtControlBase::DoSetForegroundL(aColor);
- TRgb color((aColor) ? aColor->RgbValue() : iEikonEnv->Color(EColorControlText));
- iEditor->OverrideColorL(EColorControlText, color);
+ if (aColor)
+ {
+ iFgColorIsCustom = ETrue;
+ iForegroundColor = aColor->RgbValue();
+ }
+ else
+ {
+ iFgColorIsCustom = EFalse;
+ iForegroundColor = 0;
+ }
// If a back color has been set, cannot go back to skin colors yet.
if (!iBgColorIsCustom)
@@ -297,15 +306,7 @@
}
}
- if (aColor)
- {
- iFgColorIsCustom = ETrue;
- }
- else
- {
- iFgColorIsCustom = EFalse;
- }
-
+ UpdateTextColor();
Redraw();
}
@@ -584,6 +585,11 @@
ProcessFontUpdate();
}
SizeChanged();
+
+ if (aType == KAknsMessageSkinChange)
+ {
+ UpdateTextColor();
+ }
}
#ifdef RD_JAVA_S60_RELEASE_9_2
else if (aType == KAknSplitInputEnabled)
@@ -1013,7 +1019,7 @@
iEditor->SetFocus(IsFocused());
iEditor->SetDimmed(IsDimmed());
RetrieveDefaultFontL();
- iEditor->SetSkinTextColorL(EAknsCIQsnTextColorsCG6);
+ iEditor->SetSkinTextColorL(KNonHighlightedTextColor);
#ifdef RD_JAVA_S60_RELEASE_9_2
if (iEditor->SupportsFeature(CEikMfne::EPartialScreenInput))
@@ -1023,6 +1029,11 @@
#endif
}
ActivateL();
+
+ // Because the creation of the contained editor is delayed
+ // we need to ensure that it redraws with correct size.
+ // Not doing this would result in empty list in CaptionedControl for instance.
+ SizeChanged();
}
// ---------------------------------------------------------------------------------------------
@@ -1188,6 +1199,40 @@
return ASwtControlBase::Dispose();
}
+void CSwtDateEditor::UpdateTextColor()
+{
+ if (iEditor)
+ {
+ if (HasHighlight())
+ {
+ // Highlighted foreground color, overrides all others.
+ iEditor->SetUseOverrideColors(EFalse);
+ TRAP_IGNORE(iEditor->SetSkinTextColorL(KHighlightedTextColor));
+ }
+ else if (iFgColorIsCustom)
+ {
+ // Custom foreground color, overrides the default.
+ iEditor->SetUseOverrideColors(ETrue);
+ TRAP_IGNORE(iEditor->OverrideColorL(EColorControlText, iForegroundColor));
+ }
+ else
+ {
+ // Default foreground color.
+ iEditor->SetUseOverrideColors(EFalse);
+ TRAP_IGNORE(iEditor->SetSkinTextColorL(KNonHighlightedTextColor));
+ }
+ }
+}
+
+TInt CSwtDateEditor::PressBackgroundPolicy() const
+{
+ return EPressBackground;
+}
+
+void CSwtDateEditor::HandleHighlightChange()
+{
+ UpdateTextColor();
+}
// ---------------------------------------------------------------------------------------------
// CSwtDateEditor::HandlePointerEventL
@@ -1211,9 +1256,29 @@
iPressed = hit && !isActiveSplitEditor;
#endif
+ TBool forward(EFalse);
+
if (!(aPointerEvent.iType == TPointerEvent::EButton1Up
&& (iDisplay.RevertPointerEvent() || !hit)))
{
+ forward = ETrue;
+ }
+
+ //Selected field might changed
+ iCurrentFieldLength = 0;
+ iCurrentFieldDecimalPlacesCount = 0;
+ iLastField = iEditor->CurrentField();
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ if (pressed != iPressed)
+ {
+ GetShell().UpdateHighlight(ETrue); // draw now
+ }
+#endif
+
+ // Forwarding this late due to splitview + pressed flicker issues.
+ if (forward)
+ {
iEditor->HandlePointerEventL(aPointerEvent);
//MSK label update may be needed.
@@ -1228,16 +1293,6 @@
// End MSK
}
- //Selected field might changed
- iCurrentFieldLength = 0;
- iCurrentFieldDecimalPlacesCount = 0;
- iLastField = iEditor->CurrentField();
-
-#ifdef RD_JAVA_S60_RELEASE_9_2
- if (pressed != iPressed)
- Redraw();
-#endif
-
PostMouseEventL(aPointerEvent);
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtdisplay.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtdisplay.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -589,7 +589,7 @@
CSwtDialogBroker* CSwtDisplay::CreateDialogBrokerL()
{
CSwtDialogBroker* dlgBroker = new(ELeave) CSwtDialogBroker(this, CSwtDialogBroker::ENoRequest);
- iDialogBrokers.Append(dlgBroker);
+ iDialogBrokers.AppendL(dlgBroker);
return dlgBroker;
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtdisplaybase.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtdisplaybase.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -16,6 +16,11 @@
#include <eikon.hrh>
#include <AknUtils.h>
#include <bautils.h>
+#include <avkon.mbg>
+#include <AknsUtils.h>
+#include <AknsConstants.h>
+#include <aknconsts.h>
+#include <AknIconUtils.h>
#include <swtlaffacade.h>
#include "s60commonutils.h"
#include "swtfactory.h"
@@ -30,7 +35,7 @@
#include "swtjavabufferdrawer.h"
#include "swtfont.h"
#include "swtuiutils.h"
-
+#include "imagescaler.h"
#define ASSERT_JAVAUITHREAD() ASSERT(IsCurrentThreadJavaUi())
#define ASSERT_NATIVEUITHREAD() ASSERT(IsCurrentThreadNativeUi())
@@ -363,7 +368,6 @@
/**
* Constructs an uninitialised Image
- *
* @param aSize The new image's size
*/
MSwtImage* ASwtDisplayBase::NewImageL(const TSize& aSize)
@@ -371,10 +375,8 @@
return CSwtImage::NewL(*this, aSize, *this);
}
-
/**
* Constructs an Image with initial data
- *
* @param aData The data to construct the image from
*/
MSwtImage* ASwtDisplayBase::NewImageFromDataL(const MSwtImageData& aData)
@@ -382,6 +384,93 @@
return CSwtImage::NewL(this, aData, this);
}
+/**
+ * Constructs an image from native theme.
+ * @param aId See TSwtThemeImageId
+ */
+MSwtImage* ASwtDisplayBase::NewImageFromThemeL(const TInt aId)
+{
+ CFbsBitmap* bmp = NULL;
+ CFbsBitmap* mask = NULL;
+ TSize size(0, 0);
+ switch (aId)
+ {
+ case ESwtThemeImageSecurityTrusted:
+ AknsUtils::CreateIconL(AknsUtils::SkinInstance(),
+ KAknsIIDQgnIndiMidpTrusted, bmp, mask,
+ AknIconUtils::AvkonIconFileName(),
+ EMbmAvkonQgn_indi_midp_trusted,
+ EMbmAvkonQgn_indi_midp_trusted_mask);
+ size = CSwtLafFacade::GetLayoutRect(CSwtLafFacade::EListSingleGraphicPaneG1,
+ TRect(),0).Rect().Size();
+ break;
+ case ESwtThemeImageSecurityUntrusted:
+ AknsUtils::CreateIconL(AknsUtils::SkinInstance(),
+ KAknsIIDQgnIndiMidpUntrusted, bmp, mask,
+ AknIconUtils::AvkonIconFileName(),
+ EMbmAvkonQgn_indi_midp_untrusted,
+ EMbmAvkonQgn_indi_midp_untrusted_mask);
+ size = CSwtLafFacade::GetLayoutRect(CSwtLafFacade::EListSingleGraphicPaneG1,
+ TRect(),0).Rect().Size();
+ break;
+ default:
+ return NULL;
+ }
+
+ if (!bmp)
+ {
+ return NULL;
+ }
+ else
+ {
+ if (size.iWidth > 0)
+ {
+ AknIconUtils::SetSize(bmp, size);
+ }
+ // bmp & mask ownership transferred to returned object
+ return CSwtImage::NewL(*bmp, mask);
+ }
+}
+
+/**
+ * Constructs an Image from another Image.
+ * @param aData The data to construct the image from
+ */
+MSwtImage* ASwtDisplayBase::ScaleImageL(const MSwtImage& aSrcImage,
+ const TSize& aDestSize, TBool aKeepAspectRatio)
+{
+ CFbsBitmap& srcBmp = const_cast<CFbsBitmap&>(aSrcImage.Bitmap());
+ CFbsBitmap* srcMask = const_cast<CFbsBitmap*>(aSrcImage.MaskBitmap());
+
+ CFbsBitmap* bmp = new(ELeave) CFbsBitmap;
+ CleanupStack::PushL(bmp);
+ User::LeaveIfError(bmp->Create(aDestSize, srcBmp.DisplayMode()));
+
+ CFbsBitmap* mask = 0;
+ if (srcMask)
+ {
+ mask = new(ELeave) CFbsBitmap;
+ CleanupStack::PushL(mask);
+ User::LeaveIfError(mask->Create(aDestSize, EGray256));
+ }
+
+ CImageScaler* scaler = CImageScaler::NewL();
+ CleanupStack::PushL(scaler);
+ scaler->Scale(srcBmp, *bmp, aKeepAspectRatio);
+ if (srcMask)
+ {
+ scaler->Scale(*srcMask, *mask, aKeepAspectRatio);
+ }
+ CleanupStack::PopAndDestroy(scaler);
+ if (mask)
+ {
+ CleanupStack::Pop(mask);
+ }
+ CleanupStack::Pop(bmp);
+
+ // bmp & mask ownership transferred to returned object
+ return CSwtImage::NewL(*bmp, mask);
+}
//
// Own internal event methods
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtevents.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtevents.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -303,17 +303,15 @@
if (iControl.IsFocusControl())
{
// Find the Control's Shell
- MSwtShell* shell;
MSwtControl* ctrl = &iControl;
- while ((shell = ctrl->ShellInterface()) == NULL)
- {
- ctrl = ctrl->GetParent()->Control();
- }
+ MSwtShell& shell = ctrl->GetShell();
// Find next focusable control
- MSwtControl* newFocus = shell->FindTraversalTargetL(iDetail, iControl);
+ MSwtControl* newFocus = shell.FindTraversalTargetL(iDetail, iControl);
if (newFocus)
{
+ shell.Display().UiUtils().SetNaviKeyInput(ETrue);
+ newFocus->PrepareForTraverse();
newFocus->CoeControl().SetFocus(ETrue, ENoDrawNow);
}
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtfactory.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtfactory.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -459,13 +459,6 @@
return CSwtTree::NewL(aDisplay, aPeer, aParent, aStyle);
}
-MSwtFontDialog* CSwtFactory::NewFontDialogL() const
-{
- User::Leave(ESwtErrorNotImplemented);
- return NULL;
- //return new( ELeave ) CSwtFontDialog();
-}
-
TRgb* CSwtFactory::RunColorDialogL(TRgb* aDefaultColor) const
{
return CSwtColorDialog::RunDlgL(aDefaultColor);
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swthyperlink.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swthyperlink.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -86,7 +86,6 @@
UpdateDefaultFontL();
iFormattedText.CreateL(KNullDesC);
iOriginalText.CreateL(KNullDesC);
- UpdateSkinColor();
SetBackground(this); // Back will be drawn by ASwtControlBase::Draw
#ifdef RD_TACTILE_FEEDBACK
@@ -103,13 +102,6 @@
{
UpdateDefaultFontL();
}
- else if (aType == KAknsMessageSkinChange)
- {
- if (!iCustomTextColor)
- {
- UpdateSkinColor();
- }
- }
}
@@ -165,14 +157,14 @@
textLocation.iX += alignmentSpace;
}
- TRgb textColor = iLinkColor;
+ TRgb textColor = LinkColor();
// Same background highlight as that of Link
if (iPressed || (iDisplay.UiUtils().NaviKeyInput() && IsFocused()))
{
- textColor = iHighlightedLinkColor;
+ textColor = PressedLinkColor();
aGc.SetPenStyle(CGraphicsContext::ENullPen);
aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
- aGc.SetBrushColor(iHighlightColor);
+ aGc.SetBrushColor(LinkBgColor());
aGc.DrawRect(TRect(TPoint(textLocation.iX, textLocation.iY - aFont->FontMaxAscent()),
TSize(textWidth, aFont->FontLineGap())));
}
@@ -188,23 +180,6 @@
}
-void CSwtHyperLink::UpdateSkinColor()
-{
- AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
- iLinkColor,
- KAknsIIDQsnHighlightColors,
- EAknsCIQsnHighlightColorsCG3);
- AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
- iHighlightColor,
- KAknsIIDQsnHighlightColors,
- EAknsCIQsnHighlightColorsCG2);
- AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
- iHighlightedLinkColor,
- KAknsIIDQsnTextColors,
- EAknsCIQsnTextColorsCG24);
-}
-
-
void CSwtHyperLink::UpdateDefaultFontL()
{
if (iDefaultFont)
@@ -272,6 +247,43 @@
return scheme;
}
+TRgb CSwtHyperLink::LinkColor() const
+{
+ TBool highlighted = HasHighlight();
+ if (!highlighted && iCustomFg)
+ {
+ return iCustomFg->RgbValue();
+ }
+ else
+ {
+ TRgb res(0);
+ AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
+ res,
+ KAknsIIDQsnHighlightColors,
+ EAknsCIQsnHighlightColorsCG3);
+ return res;
+ }
+}
+
+TRgb CSwtHyperLink::PressedLinkColor() const
+{
+ TRgb res(0);
+ AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
+ res,
+ KAknsIIDQsnTextColors,
+ EAknsCIQsnTextColorsCG24);
+ return res;
+}
+
+TRgb CSwtHyperLink::LinkBgColor() const
+{
+ TRgb res(0);
+ AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
+ res,
+ KAknsIIDQsnHighlightColors,
+ EAknsCIQsnHighlightColorsCG2);
+ return res;
+}
// ---------------------------------------------------------------------------
// From class CCoeControl.
@@ -446,7 +458,7 @@
#endif //RD_JAVA_ADVANCED_TACTILE_FEEDBACK
}
#endif //RD_TACTILE_FEEDBACK
- Redraw();
+ GetShell().UpdateHighlight(ETrue); // draw now
break;
}
@@ -463,7 +475,7 @@
}
if (pressed != iPressed)
{
- Redraw();
+ GetShell().UpdateHighlight(ETrue); // draw now
}
break;
}
@@ -478,7 +490,7 @@
}
if (pressed != iPressed)
{
- Redraw();
+ GetShell().UpdateHighlight(ETrue); // draw now
}
break;
}
@@ -497,18 +509,7 @@
void CSwtHyperLink::SetForegroundL(const MSwtColor* aColor)
{
ASwtControlBase::DoSetForegroundL(aColor);
- aColor ? iCustomTextColor = ETrue : iCustomTextColor = EFalse;
- if (iCustomTextColor)
- {
- TRgb rgb;
- TBool overrideColorSet(GetColor(EColorControlText, rgb));
- ASSERT(overrideColorSet);
- iLinkColor = rgb;
- }
- else
- {
- UpdateSkinColor();
- }
+ iCustomFg = aColor;
Redraw();
}
@@ -542,6 +543,15 @@
return res;
}
+// ---------------------------------------------------------------------------
+// CSwtHyperLink::PressBackgroundPolicy
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+TInt CSwtHyperLink::PressBackgroundPolicy() const
+{
+ return EEmbeddedPressBackground;
+}
// ---------------------------------------------------------------------------
// From class ASwtControlBase.
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtimage.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtimage.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -95,7 +95,20 @@
{
CSwtImage* self = new(ELeave) CSwtImage(NULL, NULL);
CleanupStack::PushL(self);
- self->ConstructL(aBitmap, aMask, aTopLeft, aDelayTime, aDisposalMethod);
+ self->ConstructL(aBitmap, aMask, aTopLeft, aDelayTime, aDisposalMethod, ETrue);
+ CleanupStack::Pop(self);
+ return self;
+}
+
+// ---------------------------------------------------------------------------
+// CSwtImage::NewL
+// ---------------------------------------------------------------------------
+//
+CSwtImage* CSwtImage::NewL(CFbsBitmap& aBitmap, CFbsBitmap* aMask)
+{
+ CSwtImage* self = new(ELeave) CSwtImage(NULL, NULL);
+ CleanupStack::PushL(self);
+ self->ConstructL(aBitmap, aMask, TPoint(0, 0), 0, KSwtDisposalUnspecified, EFalse);
CleanupStack::Pop(self);
return self;
}
@@ -263,10 +276,11 @@
// ---------------------------------------------------------------------------
//
void CSwtImage::ConstructL(CFbsBitmap& aBitmap, CFbsBitmap* aMask,
- const TPoint& aTopLeft, TInt aDelayTime, TSwtGifDisposal aDisposalMethod)
+ const TPoint& aTopLeft, TInt aDelayTime,
+ TSwtGifDisposal aDisposalMethod, TBool aBmpOwnExternally)
{
- // Caution: when using this constructor you depend on the external bitmap's lifetime
- iOwnExternally = ETrue;
+ // Caution: if true, the object depends on the external bitmap's lifetime
+ iOwnExternally = aBmpOwnExternally;
iBitmap = &aBitmap;
iMask = aMask;
@@ -1600,12 +1614,50 @@
// NOTE! iScaledMasksInverted entries are valid only if
// the main mask is monochrome. Otherwise they are NULL
// and iScaledMasks entries should be used instead.
- iScaledBitmapRefs.Append(0);
- iScaledBitmaps.Append(bmp);
- iScaledMasks.Append(mask);
- iScaledMasksInverted.Append(maski);
+ TInt err = KErrNone;
+ TInt appendCount = 0;
+ err = iScaledBitmapRefs.Append(0);
+ if (err == KErrNone)
+ {
+ ++appendCount;
+ err = iScaledBitmaps.Append(bmp);
+ }
+ if (err == KErrNone)
+ {
+ ++appendCount;
+ err = iScaledMasks.Append(mask);
+ }
+ if (err == KErrNone)
+ {
+ ++appendCount;
+ err = iScaledMasksInverted.Append(maski);
+ }
+
+ if (err)
+ {
+ if (appendCount > 0)
+ {
+ iScaledBitmapRefs.Remove(iScaledBitmapRefs.Count() - 1);
+ }
+ if (appendCount > 1)
+ {
+ iScaledBitmaps.Remove(iScaledBitmaps.Count() - 1);
+ }
+ if (appendCount > 2)
+ {
+ iScaledMasks.Remove(iScaledMasks.Count() - 1);
+ }
+
+ delete bmp;
+ bmp = NULL;
+ delete mask;
+ mask = NULL;
+ delete maski;
+ maski = NULL;
+ }
}
- else
+
+ if (!bmp)
{
// In the case of no memory or whatever
ASSERT(EFalse);
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtinput.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtinput.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -24,7 +24,10 @@
//
CSwtInput* CSwtInput::NewL(TSwtPeer aPeer, TInt aId)
{
- CSwtInput* self = new(ELeave) CSwtInput(aPeer, aId);
+ CSwtInput* self = new(ELeave) CSwtInput(aPeer);
+ CleanupStack::PushL(self);
+ self->ConstructL(aId);
+ CleanupStack::Pop(self);
return self;
}
@@ -32,21 +35,27 @@
// CSwtInput::CSwtInput
// ---------------------------------------------------------------------------
//
-CSwtInput::CSwtInput(TSwtPeer aPeer, TInt aId)
+CSwtInput::CSwtInput(TSwtPeer aPeer)
: iPeer(aPeer)
+ , iType(KErrNotFound)
+ , iLocation(KErrNotFound)
{
- iType = KErrNotFound;
- iLocation = KErrNotFound;
+}
+
+void CSwtInput::ConstructL(TInt aId)
+{
RArray<CSwtMobileDevice::TSwtHwInput> inputs;
- CSwtMobileDevice::GetHwInputs(inputs);
+ CleanupClosePushL(inputs);
+ CSwtMobileDevice::GetHwInputsL(inputs);
if (aId < inputs.Count())
{
iType = inputs[aId].iType;
iLocation = inputs[aId].iLocation;
}
- inputs.Close();
+ CleanupStack::PopAndDestroy(&inputs);
}
+
// ---------------------------------------------------------------------------
// CSwtInput::~CSwtInput
// ---------------------------------------------------------------------------
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtinstancecounts.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtinstancecounts.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -61,13 +61,13 @@
CheckLeak(iTreeItem);
// Controls deserve a special treatment as we don't know precisely which has been disposed
- const TInt ctrlSum = iButton + iCanvas + iCaptionedControl + iCombo
- + iComposite + iConstrainedText + iDateEditor + iDecorations
- + iHyperLink + iLabel + iList + iListBox
- + iListView + iMultiPagePager + iMultiPageTabGroup + iMultiPageDialog
- + iProgressBar + iShell + iSlider + iSortedList
- + iText + iTextExtension + iTable + iTree
- + iBrowser + iMobileShell + iDCControl;
+ const TInt ctrlSum = iButton + iCanvas + iCaptionedControl + iCombo
+ + iComposite + iConstrainedText + iDateEditor + iDecorations
+ + iHyperLink + iLabel + iList + iListBox
+ + iListView + iMultiPagePager + iMultiPageTabGroup + iMultiPageDialog
+ + iProgressBar + iShell + iSlider + iSortedList
+ + iText + iTextExtension + iTable + iTree
+ + iBrowser + iMobileShell + iDCControl + iLink;
CheckLeak(iDisposedControls, ctrlSum);
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlabel.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlabel.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -117,14 +117,7 @@
SetAlignment(iStyle & KSwtAlignmentMask);
RetrieveDefaultFontL();
DoSetFontL(&iDefaultFont->Font());
-
- MAknsSkinInstance* skin = AknsUtils::SkinInstance();
- TRgb defaultColor;
- if (AknsUtils::GetCachedColor(skin, defaultColor,
- KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6) == KErrNone)
- {
- iEikLabel->OverrideColorL(EColorLabelText, defaultColor);
- }
+ UpdateTextColor();
// Correct position of CEikLabel will be set in PositionChanged()
}
@@ -835,16 +828,10 @@
{
CreateSeparatorL();
}
- // If label foreground color has not been set then set ceiklabel to new skin default color
- if ((!iForegroundColor) && iEikLabel)
+
+ if (aType == KAknsMessageSkinChange)
{
- MAknsSkinInstance* skin = AknsUtils::SkinInstance();
- TRgb defaultColor;
- if (AknsUtils::GetCachedColor(skin, defaultColor,
- KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6) == KErrNone)
- {
- iEikLabel->OverrideColorL(EColorLabelText, defaultColor);
- }
+ UpdateTextColor();
}
}
else if (aType == KEikDynamicLayoutVariantSwitch)
@@ -1227,7 +1214,60 @@
}
// ---------------------------------------------------------------------------
-// CSwtLabel::DefaultFont
+// CSwtLabel::UpdateTextColor
+// ---------------------------------------------------------------------------
+//
+void CSwtLabel::UpdateTextColor()
+{
+ // This method is used only when label has parent, that has gained focus
+ // highlight. In such case label gets focus highlight and text color
+ // has to be updated
+ if (iEikLabel)
+ {
+ TRgb color(0);
+ TInt err(KErrNone);
+
+ if (HasHighlight())
+ {
+ // Highlighted foreground color, overrides all others.
+ err = AknsUtils::GetCachedColor(AknsUtils::SkinInstance()
+ , color
+ , KAknsIIDQsnTextColors
+ , KHighlightedTextColor);
+ }
+ else if (iCustomFg)
+ {
+ // Custom foreground color, overrides the default.
+ color = iCustomFg->RgbValue();
+ }
+ else
+ {
+ // Default foreground color.
+ err = AknsUtils::GetCachedColor(AknsUtils::SkinInstance()
+ , color
+ , KAknsIIDQsnTextColors
+ , KNonHighlightedTextColor);
+ }
+
+ if (err == KErrNone)
+ {
+ TRAP_IGNORE(iEikLabel->OverrideColorL(EColorLabelText, color));
+ }
+ }
+}
+
+// ---------------------------------------------------------------------------
+// CSwtLabel::HandleHighlightChange
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+void CSwtLabel::HandleHighlightChange()
+{
+ UpdateTextColor();
+}
+
+// ---------------------------------------------------------------------------
+// CSwtLabel::SetForegroundL
// From MSwtControl
// ---------------------------------------------------------------------------
//
@@ -1235,20 +1275,8 @@
{
ASwtControlBase::DoSetForegroundL(aColor);
SetColorL(EColorLabelText, aColor);
-
- // if color is null then reset label to default color
- if (aColor == NULL && iEikLabel != NULL)
- {
- MAknsSkinInstance* skin = AknsUtils::SkinInstance();
- TRgb defaultColor;
- if (AknsUtils::GetCachedColor(skin, defaultColor,
- KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6) == KErrNone)
- {
- iEikLabel->OverrideColorL(EColorLabelText, defaultColor);
- }
- }
-
- iForegroundColor = aColor;
+ iCustomFg = aColor;
+ UpdateTextColor();
Redraw();
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlink.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlink.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -193,7 +193,6 @@
UpdateDefaultFontL();
DoSetFont(&iDefaultFont->Font());
UpdateMarginValues();
- UpdateSkinColor();
SetBackground(this); // Back will be drawn by ASwtControlBase::Draw
#ifdef RD_TACTILE_FEEDBACK
@@ -216,40 +215,9 @@
UpdateMarginValues();
BuildDrawableFragmentsListL(TextRect());
}
- else if (aType == KAknsMessageSkinChange)
- {
- if (!iCustomTextColor)
- {
- UpdateSkinColor();
- }
- }
}
/**
- * Updates skin colors
- */
-void CSwtLink::UpdateSkinColor()
-{
- AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
- iTextColor,
- KAknsIIDQsnTextColors,
- EAknsCIQsnTextColorsCG6);
- AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
- iLinkColor,
- KAknsIIDQsnHighlightColors,
- EAknsCIQsnHighlightColorsCG3);
- AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
- iHighlightColor,
- KAknsIIDQsnHighlightColors,
- EAknsCIQsnHighlightColorsCG2);
- AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
- iHighlightedLinkColor,
- KAknsIIDQsnTextColors,
- EAknsCIQsnTextColorsCG24);
-}
-
-
-/**
* Updates default font
*/
void CSwtLink::UpdateDefaultFontL()
@@ -1006,20 +974,20 @@
TRect rect = fragment->Rect();
rect.Move(textRect.iTl);
- TRgb textColor = iTextColor;
+ TRgb textColor = TextColor();
if (fragment->FragmentDescriptor()->Target())
{
- textColor = iLinkColor;
+ textColor = LinkColor();
}
// Same background highlight as that of HyperLink
if (fragment->FragmentDescriptor() == iFocusedFragment
&& (iPressed || iDisplay.UiUtils().NaviKeyInput()))
{
- textColor = iHighlightedLinkColor;
+ textColor = PressedLinkColor();
gc.SetPenStyle(CGraphicsContext::ENullPen);
gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
- gc.SetBrushColor(iHighlightColor);
+ gc.SetBrushColor(LinkBgColor());
gc.DrawRect(rect);
}
@@ -1128,7 +1096,7 @@
if (iPressed)
{
- Redraw();
+ GetShell().UpdateHighlight(ETrue); // draw now
}
break;
}
@@ -1162,7 +1130,7 @@
if (pressed != iPressed)
{
- Redraw();
+ GetShell().UpdateHighlight(ETrue); // draw now
}
break;
}
@@ -1193,7 +1161,7 @@
if (pressed != iPressed)
{
- Redraw();
+ GetShell().UpdateHighlight(ETrue); // draw now
}
break;
}
@@ -1209,23 +1177,10 @@
void CSwtLink::SetForegroundL(const MSwtColor* aColor)
{
ASwtControlBase::DoSetForegroundL(aColor);
- aColor ? iCustomTextColor = ETrue : iCustomTextColor = EFalse;
- if (iCustomTextColor)
- {
- TRgb rgb;
- TBool overrideColorSet(GetColor(EColorControlText, rgb));
- ASSERT(overrideColorSet);
- iTextColor = rgb;
- iLinkColor = rgb;
- }
- else
- {
- UpdateSkinColor();
- }
+ iCustomFg = aColor;
Redraw();
}
-
// ---------------------------------------------------------------------------
// From class MSwtControl.
// ---------------------------------------------------------------------------
@@ -1240,6 +1195,36 @@
return ComputeTextSizeL(aWHint, aHHint);
}
+// ---------------------------------------------------------------------------
+// CSwtLink::DefaultFont
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+void CSwtLink::SetFontL(const MSwtFont* aFont)
+{
+ ASwtControlBase::DoSetFontL(aFont);
+ DoSetFont(&GetFont()->Font());
+ Redraw();
+}
+
+TBool CSwtLink::SetSwtFocus(TInt aReason /*= KSwtFocusByApi*/)
+{
+ TBool prevFocused = IsFocusControl();
+ TBool res = ASwtControlBase::SetSwtFocus(aReason);
+
+ // Gaines focus by pointer
+ if (IsFocusControl() && !prevFocused)
+ {
+ iFocusChanged = ETrue;
+ }
+
+ return res;
+}
+
+TInt CSwtLink::PressBackgroundPolicy() const
+{
+ return EEmbeddedPressBackground;
+}
// ---------------------------------------------------------------------------
// CSwtLink::ComputeTextSizeL
@@ -1450,18 +1435,61 @@
return result;
}
-// ---------------------------------------------------------------------------
-// CSwtLink::DefaultFont
-// From MSwtControl
-// ---------------------------------------------------------------------------
-//
-void CSwtLink::SetFontL(const MSwtFont* aFont)
+TRgb CSwtLink::TextColor() const
{
- ASwtControlBase::DoSetFontL(aFont);
- DoSetFont(&GetFont()->Font());
- Redraw();
+ TBool highlighted = HasHighlight();
+ if (!highlighted && iCustomFg)
+ {
+ return iCustomFg->RgbValue();
+ }
+ else
+ {
+ TRgb res(0);
+ AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
+ res,
+ KAknsIIDQsnTextColors,
+ highlighted ? KHighlightedTextColor : KNonHighlightedTextColor);
+ return res;
+ }
}
+TRgb CSwtLink::LinkColor() const
+{
+ TBool highlighted = HasHighlight();
+ if (!highlighted && iCustomFg)
+ {
+ return iCustomFg->RgbValue();
+ }
+ else
+ {
+ TRgb res(0);
+ AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
+ res,
+ KAknsIIDQsnHighlightColors,
+ EAknsCIQsnHighlightColorsCG3);
+ return res;
+ }
+}
+
+TRgb CSwtLink::PressedLinkColor() const
+{
+ TRgb res(0);
+ AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
+ res,
+ KAknsIIDQsnTextColors,
+ EAknsCIQsnTextColorsCG24);
+ return res;
+}
+
+TRgb CSwtLink::LinkBgColor() const
+{
+ TRgb res(0);
+ AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
+ res,
+ KAknsIIDQsnHighlightColors,
+ EAknsCIQsnHighlightColorsCG2);
+ return res;
+}
void CSwtLink::DoSetFont(const CFont* aFont)
{
@@ -1564,20 +1592,6 @@
}
}
-TBool CSwtLink::SetSwtFocus(TInt aReason /*= KSwtFocusByApi*/)
-{
- TBool prevFocused = IsFocusControl();
- TBool res = ASwtControlBase::SetSwtFocus(aReason);
-
- // Gaines focus by pointer
- if (IsFocusControl() && !prevFocused)
- {
- iFocusChanged = ETrue;
- }
-
- return res;
-}
-
// ---------------------------------------------------------------------------
// CSwtLinkFragmentDescriptor
// ---------------------------------------------------------------------------
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistbase.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistbase.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -1425,6 +1425,37 @@
}
#endif //RD_JAVA_S60_RELEASE_9_2
+TInt CSwtListBase::FocusBackgroundPolicy() const
+{
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ return ENoFocusBackgroundInCaptionedControl;
+#else
+ return EDefaultFocusBackground;
+#endif // RD_JAVA_S60_RELEASE_9_2
+}
+
+// ---------------------------------------------------------------------------
+// CSwtListBase::PrepareForTraverse
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+void CSwtListBase::PrepareForTraverse()
+{
+ ASSERT(iList);
+ ASSERT(iList->View());
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ // AvKon enables highlight only when key event is recieved.
+ // When traversing, no key event is sent to AvKon, so we
+ // have to enable highlight by ourselves.
+ CListItemDrawer* itemDrawer = iList->View()->ItemDrawer();
+ if (itemDrawer)
+ {
+ itemDrawer->ClearFlags(CListItemDrawer::ESingleClickDisabledHighlight);
+ }
+#endif //RD_JAVA_S60_RELEASE_9_2
+}
+
// ---------------------------------------------------------------------------
// CSwtListBase::SbFrame
// From ASwtScrollableBase
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistbox.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistbox.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -463,12 +463,6 @@
if (iList)
{
- // The redraw is restored after the initialization of the listbox.
- if (iRestoreRedraw)
- {
- iRestoreRedraw = EFalse;
- iList->View()->SetDisableRedraw(EFalse);
- }
TRect rect = BorderInnerRect();
iList->SetSize(rect.Size());
@@ -874,6 +868,37 @@
}
#endif //RD_JAVA_S60_RELEASE_9_2
+TInt CSwtListBox::FocusBackgroundPolicy() const
+{
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ return ENoFocusBackgroundInCaptionedControl;
+#else
+ return EDefaultFocusBackground;
+#endif // RD_JAVA_S60_RELEASE_9_2
+}
+
+// ---------------------------------------------------------------------------
+// CSwtListBox::PrepareForTraverse
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+void CSwtListBox::PrepareForTraverse()
+{
+ ASSERT(iList);
+ ASSERT(iList->View());
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ // AvKon enables highlight only when key event is recieved.
+ // When traversing, no key event is sent to AvKon, so we
+ // have to enable highlight by ourselves.
+ CListItemDrawer* itemDrawer = iList->View()->ItemDrawer();
+ if (itemDrawer)
+ {
+ itemDrawer->ClearFlags(CListItemDrawer::ESingleClickDisabledHighlight);
+ }
+#endif //RD_JAVA_S60_RELEASE_9_2
+}
+
// ---------------------------------------------------------------------------
// CSwtListBox::Scrollable
// From MSwtListBox
@@ -946,7 +971,7 @@
iPrevSelItems = new(ELeave) CArrayFixFlat<TInt>(KInitSelArrLength);
// Get item cells
- CSwtListBoxLists::Cells(iProps.iListType, iCells);
+ CSwtListBoxLists::CellsL(iProps.iListType, iCells);
// This is needed for the case where the theme has animated highlights.
iList->SetFocus(ETrue, ENoDrawNow);
@@ -967,15 +992,14 @@
}
#endif
- // Must trigger SizeChanged which Avkon lists use to create the layout
- // columns. Not calling this will result in invisible lists or incorrect
- // list layouts. Also important is to hide the list while is being
- // created to avoid flickering.
- iList->View()->SetDisableRedraw(ETrue);
UpdateListMskL();
- SizeChanged();
+
ActivateL();
- iRestoreRedraw = ETrue;
+
+ // Because the creation of the contained list is delayed
+ // we need to ensure that it redraws with correct size.
+ // Not doing this would result in empty list in CaptionedControl for instance.
+ SizeChanged();
}
// ---------------------------------------------------------------------------
@@ -1521,6 +1545,7 @@
CSwtListBoxLists::SetListObserver(aListType, list, this);
list->SetContainerWindowL(*this);
list->SetCurrentItemIndex(0);
+ list->MakeVisible(ETrue);
list->SetComponentsToInheritVisibility(ETrue);
CreateScrollBarsL(list);
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistboxlists.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistboxlists.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -340,7 +340,7 @@
// CSwtListBoxLists::Cells
// ---------------------------------------------------------------------------
//
-void CSwtListBoxLists::Cells(
+void CSwtListBoxLists::CellsL(
TInt aListType,
RArray<TInt>& aCellArray)
{
@@ -348,7 +348,7 @@
for (TInt i = 0; (KSwtLbCells[aListType][i] != ECellInvalid)
&& (i < KMaxCellCount); i++)
{
- aCellArray.Append(KSwtLbCells[aListType][i]);
+ aCellArray.AppendL(KSwtLbCells[aListType][i]);
}
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistview.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistview.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -239,7 +239,7 @@
iStylusPopupUnmarkAll = CSwtMenuItem::NewL(iDisplay, NULL, *iStylusPopupMenu, 1, 0, EAknUnmarkAll);
iStylusPopupUnmarkAll->SetTextL(iMenuItemUnmarkAll->Text());
-#endif //RD_SCALABLE_UI_V2
+#endif //RD_SCALABLE_UI_V2
}
iOldSelectionArray = new(ELeave) CArrayFixFlat<TInt>(2);
@@ -854,11 +854,11 @@
const TInt refImgCount = iRefImages.Count();
if (refImgCount > aPos)
{
- iRefImages.Insert(refImg, aPos);
+ iRefImages.InsertL(refImg, aPos);
}
else
{
- iRefImages.Append(refImg);
+ iRefImages.AppendL(refImg);
}
#ifdef DEBUG_CHECK_IMAGES
@@ -1350,6 +1350,11 @@
CCoeControl::HandleResourceChange(aType);
SizeChangedL();
}
+ else if (aType == KEikMessageUnfadeWindows
+ || aType == KEikMessageWindowsFadeChange)
+ {
+ CCoeControl::HandleResourceChange(aType);
+ }
else
{
CCoeControl::HandleResourceChange(aType);
@@ -1430,14 +1435,14 @@
iMenuItemUnmarkAll->SetEnabled(EFalse);
#ifdef RD_SCALABLE_UI_V2
iStylusPopupUnmarkAll->SetEnabled(EFalse);
-#endif //RD_SCALABLE_UI_V2
+#endif //RD_SCALABLE_UI_V2
}
else
{
iMenuItemUnmarkAll->SetEnabled(ETrue);
#ifdef RD_SCALABLE_UI_V2
iStylusPopupUnmarkAll->SetEnabled(ETrue);
-#endif //RD_SCALABLE_UI_V2
+#endif //RD_SCALABLE_UI_V2
}
if (GetGridView()->SelectionIndexes()->Count() == GetGridModel()->NumberOfItems())
@@ -1445,14 +1450,14 @@
iMenuItemMarkAll->SetEnabled(EFalse);
#ifdef RD_SCALABLE_UI_V2
iStylusPopupMarkAll->SetEnabled(EFalse);
-#endif //RD_SCALABLE_UI_V2
+#endif //RD_SCALABLE_UI_V2
}
else
{
iMenuItemMarkAll->SetEnabled(ETrue);
#ifdef RD_SCALABLE_UI_V2
iStylusPopupMarkAll->SetEnabled(ETrue);
-#endif //RD_SCALABLE_UI_V2
+#endif //RD_SCALABLE_UI_V2
}
}
}
@@ -1541,7 +1546,7 @@
{
iStylusPopupMenu->Dispose();
}
-#endif //RD_SCALABLE_UI_V2
+#endif //RD_SCALABLE_UI_V2
delete iMarkString;
delete iUnmarkString;
@@ -3659,6 +3664,32 @@
}
#endif //RD_JAVA_S60_RELEASE_9_2
+TInt CSwtListView::FocusBackgroundPolicy() const
+{
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ return ENoFocusBackgroundInCaptionedControl;
+#else
+ return EDefaultFocusBackground;
+#endif // RD_JAVA_S60_RELEASE_9_2
+}
+
+void CSwtListView::PrepareForTraverse()
+{
+ ASSERT(iGrid);
+ ASSERT(iGrid->View());
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ // AvKon enables highlight only when key event is recieved.
+ // When traversing, no key event is sent to AvKon, so we
+ // have to enable highlight by ourselves.
+ CListItemDrawer* itemDrawer = iGrid->View()->ItemDrawer();
+ if (itemDrawer)
+ {
+ itemDrawer->ClearFlags(CListItemDrawer::ESingleClickDisabledHighlight);
+ }
+#endif //RD_JAVA_S60_RELEASE_9_2
+}
+
#ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK
void CSwtListView::DoControlSpecificFeedback(
const TBool& aFirstTap,
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtmenuitem.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtmenuitem.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -374,7 +374,7 @@
if (iImageSizes.Find(aSize) == KErrNotFound)
{
iImage->AddSubRef(aSize);
- iImageSizes.Append(aSize);
+ iImageSizes.AppendL(aSize);
}
aBitmap = bmp;
aMask = const_cast<CFbsBitmap*>(iImage->SubMaskBitmap(aSize, ETrue));
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtmobiledevice.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtmobiledevice.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -11,6 +11,7 @@
#include <hal.h>
+#include <e32svr.h>
#include <aknsoundsystem.h>
#include <aknappui.h>
#include <aknenv.h>
@@ -48,7 +49,7 @@
// CSwtMobileDevice::GetHwInputs
// ---------------------------------------------------------------------------
//
-void CSwtMobileDevice::GetHwInputs(
+void CSwtMobileDevice::GetHwInputsL(
RArray<CSwtMobileDevice::TSwtHwInput>& aInputs)
{
TInt mask;
@@ -68,9 +69,9 @@
tempInput.iLocation = MSwtMobileDevice::ELocal;
}
tempInput.iType = MSwtInput::ESoftKeys;
- aInputs.Append(tempInput);
+ aInputs.AppendL(tempInput);
tempInput.iType = MSwtInput::EFullKeyboard;
- aInputs.Append(tempInput);
+ aInputs.AppendL(tempInput);
}
if (mask & EKeyboard_Keypad)
@@ -84,9 +85,9 @@
tempInput.iLocation = MSwtMobileDevice::ELocal;
}
tempInput.iType = MSwtInput::ESoftKeys;
- aInputs.Append(tempInput);
+ aInputs.AppendL(tempInput);
tempInput.iType = MSwtInput::EKeyPad;
- aInputs.Append(tempInput);
+ aInputs.AppendL(tempInput);
}
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtmultipagedialog.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtmultipagedialog.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -207,7 +207,7 @@
tabItem.iComposite = aComposite;
tabItem.iTabId = newId;
tabItem.iHasTitle = aTitle.Length() > 0 ? ETrue : EFalse;
- iTabItems.Append(tabItem);
+ iTabItems.AppendL(tabItem);
iTabGroup->SetTabFixedWidthL(ComputeTabStyle());
RefreshStatusPane();
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtprogressbar.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtprogressbar.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -25,8 +25,18 @@
#include "swtfont.h"
#include "swtprogressbar.h"
+
+/**
+ * Default value of the ProgressBar
+ */
+const TInt KDefaultProgressBarSelectionValue= 0;
+const TInt KDefaultProgressBarMinValue = 0;
+const TInt KDefaultProgressBarMaxValue = 100;
+
+
// ======== MEMBER FUNCTIONS ========
+
TInt CSwtProgressBar::AnimationCallBack(TAny* aPtr)
{
CSwtProgressBar* progressBar = static_cast<CSwtProgressBar*>(aPtr);
@@ -143,8 +153,8 @@
AknsUtils::CreateIconL(skin, KAknsIIDQgnGrafBarProgress, bitmap, mask,
KAvkonBitmapFile, EMbmAvkonQgn_graf_bar_progress, EMbmAvkonQgn_graf_bar_progress_mask);
- iImagesToDelete.Append(bitmap);
- iImagesToDelete.Append(mask);
+ iImagesToDelete.AppendL(bitmap);
+ iImagesToDelete.AppendL(mask);
User::LeaveIfError(iBarImages.Append(bitmap));
User::LeaveIfError(iBarMasks.Append(mask));
}
@@ -177,8 +187,8 @@
bitmap = aknAnimation ->BitmapAnimData()->FrameArray().At(i)->Bitmap();
mask = aknAnimation ->BitmapAnimData()->FrameArray().At(i)->Mask();
- iImagesToDelete.Append(bitmap);
- iImagesToDelete.Append(mask);
+ iImagesToDelete.AppendL(bitmap);
+ iImagesToDelete.AppendL(mask);
User::LeaveIfError(iBarImages.Append(bitmap));
if (mask)
@@ -195,23 +205,23 @@
iBarFrameLeftImage, iBarFrameLeftMask, KAvkonBitmapFile,
EMbmAvkonQgn_graf_bar_frame_side_l,
EMbmAvkonQgn_graf_bar_frame_side_l_mask);
- iImagesToDelete.Append(iBarFrameLeftImage);
- iImagesToDelete.Append(iBarFrameLeftMask);
+ iImagesToDelete.AppendL(iBarFrameLeftImage);
+ iImagesToDelete.AppendL(iBarFrameLeftMask);
AknsUtils::CreateIconL(skin, KAknsIIDQgnGrafBarFrameCenter,
iBarFrameCenterImage, iBarFrameCenterMask, KAvkonBitmapFile,
EMbmAvkonQgn_graf_bar_frame_center,
EMbmAvkonQgn_graf_bar_frame_center_mask);
- iImagesToDelete.Append(iBarFrameCenterImage);
- iImagesToDelete.Append(iBarFrameCenterMask);
+ iImagesToDelete.AppendL(iBarFrameCenterImage);
+ iImagesToDelete.AppendL(iBarFrameCenterMask);
AknsUtils::CreateIconL(skin, KAknsIIDQgnGrafBarFrameSideR,
iBarFrameRightImage, iBarFrameRightMask, KAvkonBitmapFile,
EMbmAvkonQgn_graf_bar_frame_side_r,
EMbmAvkonQgn_graf_bar_frame_side_r_mask);
- iImagesToDelete.Append(iBarFrameRightImage);
- iImagesToDelete.Append(iBarFrameRightMask);
+ iImagesToDelete.AppendL(iBarFrameRightImage);
+ iImagesToDelete.AppendL(iBarFrameRightMask);
if (iStyle & KSwtStyleIndeterminate && IsVisible())
{
@@ -268,12 +278,12 @@
TRAP(error, (aBitmap = CreatePlainBitmapL(aBitmap)));
if (error == KErrNone)
- iImagesToDelete.Append(aBitmap);
+ TRAP_IGNORE(iImagesToDelete.AppendL(aBitmap));
}
}
if (error == KErrNone)
- iImagesRotator->AddImage(aBitmap);
+ TRAP_IGNORE(iImagesRotator->AddImageL(aBitmap));
}
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtrotateimage.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtrotateimage.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -78,7 +78,7 @@
iImages.Reset();
}
-void CAORotateImage::AddImage(CFbsBitmap* aImage)
+void CAORotateImage::AddImageL(CFbsBitmap* aImage)
{
ASSERT(aImage);
ASSERT(!aImage->IsCompressedInRAM());
@@ -86,11 +86,11 @@
Cancel();
if (!aImage->IsCompressedInRAM())
{
- iImages.Append(aImage);
+ iImages.AppendL(aImage);
}
}
-void CAORotateImage::AddImages(const RArray<CFbsBitmap*>& aImages)
+void CAORotateImage::AddImagesL(const RArray<CFbsBitmap*>& aImages)
{
Cancel();
for (TInt i = 0; i < aImages.Count(); i++)
@@ -101,7 +101,7 @@
if (!aImages[i]->IsCompressedInRAM())
{
- iImages.Append(aImages[i]);
+ iImages.AppendL(aImages[i]);
}
}
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtscreen.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtscreen.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -389,6 +389,12 @@
//
void CSwtScreen::SetOrientationL(TInt aOrientation)
{
+ // Checks whether some component fixed the screen orientation
+ if (iDisplay.UiUtils().IsScreenOrientationFixed())
+ {
+ User::Leave(ESwtErrorCannotSetSelection);
+ }
+
iOrientation = aOrientation;
if (IsScreenOn())
{
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtscrollablebase.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtscrollablebase.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -301,3 +301,8 @@
{
}
#endif //RD_SCALABLE_UI_V2
+
+MSwtScrollable* ASwtScrollableBase::ScrollableInterface()
+{
+ return this;
+}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtshell.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtshell.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -343,6 +343,7 @@
iTitleText = NULL;
iFocusControl = NULL;
+ iPrevFocusControl = NULL;
iFocusMemory = NULL;
iDefaultCommand = NULL;
iControlGoingToStack= NULL;
@@ -1566,7 +1567,7 @@
}
}
- iFocusControl = aControl;
+ DoSetFocusControl(aControl);
}
// ---------------------------------------------------------------------------
@@ -1601,6 +1602,8 @@
const TDesC* titleText = GetText();
// Find a focus control
+ MSwtControl* newFocusControl = NULL;
+
if (aSetFocus)
{
if (!iFocusMemory)
@@ -1616,7 +1619,7 @@
MSwtControl* ctrl = (*tabList)[i];
if (ctrl->IsFocusable())
{
- iFocusControl = ctrl;
+ newFocusControl = ctrl;
break;
}
}
@@ -1624,13 +1627,12 @@
}
else if (!iFocusMemory->IsFocusable())
{
- iFocusControl = NULL;
- TRAP_IGNORE((iFocusControl = FindTraversalTargetL(
- ESwtTraverseTabPrevious, *iFocusMemory)));
+ TRAP_IGNORE((newFocusControl = FindTraversalTargetL(
+ ESwtTraverseTabPrevious, *iFocusMemory)));
}
else
{
- iFocusControl = iFocusMemory;
+ newFocusControl = iFocusMemory;
}
}
@@ -1638,14 +1640,13 @@
TRAP_IGNORE(iDisplay.PostShellEventL(iPeer, ESwtEventActivate));
- if (iFocusControl)
+ if (newFocusControl)
{
// Give focus to the focus control
- ASSERT(!iFocusControl->IsShell());
- CCoeControl& coeFocusCtrl = iFocusControl->CoeControl();
+ ASSERT(!newFocusControl->IsShell());
+ CCoeControl& coeFocusCtrl = newFocusControl->CoeControl();
if (!coeFocusCtrl.IsFocused())
{
- iFocusControl = NULL;
// This will set iFocusControl to the correct value
coeFocusCtrl.SetFocus(ETrue);
ASSERT(&iFocusControl->CoeControl() == &coeFocusCtrl);
@@ -1846,16 +1847,6 @@
}
// ---------------------------------------------------------------------------
-// CSwtShell::ControlGoingToStack
-// From MSwtShell
-// ---------------------------------------------------------------------------
-//
-MSwtControl* CSwtShell::ControlGoingToStack() const
-{
- return iControlGoingToStack;
-}
-
-// ---------------------------------------------------------------------------
// CSwtShell::SetControlGainingFocus
// From MSwtShell
// ---------------------------------------------------------------------------
@@ -1866,16 +1857,6 @@
}
// ---------------------------------------------------------------------------
-// CSwtShell::ControlGainingFocus
-// From MSwtShell
-// ---------------------------------------------------------------------------
-//
-MSwtControl* CSwtShell::ControlGainingFocus() const
-{
- return iControlGainingFocus;
-}
-
-// ---------------------------------------------------------------------------
// CSwtUiUtils::DefaultBounds
// From MSwtShell
// ---------------------------------------------------------------------------
@@ -1965,7 +1946,7 @@
if (iFocusControl)
{
- iFocusControl = NULL;
+ DoSetFocusControl(NULL);
}
iFocusMemory = aControl;
@@ -2148,7 +2129,6 @@
}
}
-
// ---------------------------------------------------------------------------
// CSwtShell::HandleStatusPaneSizeChange
// From MEikStatusPaneObserver
@@ -2168,3 +2148,171 @@
iDisplay.CoeEnv()->WsSession().Finish();
#endif
}
+
+// ---------------------------------------------------------------------------
+// CSwtShell::UpdateHighlight
+// ---------------------------------------------------------------------------
+//
+void CSwtShell::UpdateHighlight(TBool aDrawNow /*= EFalse*/)
+{
+ // Turn off highlight for the previously focused control and its eventual
+ // nearest captioned control parent.
+ if (iPrevFocusControl)
+ {
+ MSwtCaptionedControl* captParent = iPrevFocusControl->GetNearestCaptionedControl(EFalse);
+ MSwtControl* captParentCtrl = NULL;
+ if (captParent)
+ {
+ MSwtComposite* captParentComp = captParent->Composite();
+ if (captParentComp)
+ {
+ captParentCtrl = captParentComp->Control();
+ DoSetHighlight(*captParentCtrl, EFalse);
+ }
+ }
+
+ DoSetHighlight(*iPrevFocusControl, EFalse);
+
+ if (aDrawNow)
+ {
+ if (captParentCtrl)
+ captParentCtrl->Redraw();
+ else
+ iPrevFocusControl->Redraw();
+ }
+ else
+ {
+ if (captParentCtrl)
+ captParentCtrl->CoeControl().DrawDeferred();
+ else
+ iPrevFocusControl->CoeControl().DrawDeferred();
+ }
+
+ iPrevFocusControl = NULL;
+ }
+
+ // Turn on highlight for the current focused control and its eventual
+ // nearest captioned control parent.
+ if (iFocusControl)
+ {
+ TBool ctrlHighlight = EFalse;
+ TBool captHighlight = EFalse;
+
+ if (iFocusControl->Pressed())
+ {
+ // Always represent pressed state with highlight
+ TInt pressPolicy = iFocusControl->PressBackgroundPolicy();
+ ctrlHighlight = pressPolicy == EPressBackground;
+ captHighlight = pressPolicy == EPressBackground
+ || pressPolicy == EEmbeddedPressBackground;
+ }
+ else
+ {
+ if (iDisplay.UiUtils().NaviKeyInput())
+ {
+ TBool noOtherFocusableCtrls(CountFocusableChildren(1, iFocusControl) == 0);
+ if (noOtherFocusableCtrls)
+ {
+ // No highlight if there's only one focusable control
+ ctrlHighlight = EFalse;
+ captHighlight = EFalse;
+ }
+ else
+ {
+ captHighlight = ETrue;
+ ctrlHighlight = ETrue;
+
+ TInt policy = iFocusControl->FocusBackgroundPolicy();
+ if ((policy == ENoFocusBackground)
+ || (policy == EEmbeddedFocusBackground)
+ || (policy ==ENoFocusBackgroundInCaptionedControl))
+ {
+ ctrlHighlight = EFalse;
+ }
+ }
+ }
+ else
+ {
+ // No focus highlight with touch input
+ ctrlHighlight = EFalse;
+ captHighlight = EFalse;
+ }
+ }
+
+ TBool directlyCaptioned(EFalse);
+ MSwtCaptionedControl* captParent = iFocusControl->GetNearestCaptionedControl(EFalse);
+ MSwtControl* captParentCtrl = NULL;
+ if (captParent)
+ {
+ MSwtComposite* captParentComp = captParent->Composite();
+ if (captParentComp)
+ {
+ directlyCaptioned = iFocusControl->GetParent() == captParentComp;
+ // When pressing, only the direct caption control gets "pressed" also.
+ if (!directlyCaptioned && iFocusControl->Pressed())
+ captHighlight = EFalse;
+ captParentCtrl = captParentComp->Control();
+ DoSetHighlight(*captParentCtrl, captHighlight);
+ }
+ }
+
+ if (!directlyCaptioned)
+ {
+ DoSetHighlight(*iFocusControl, ctrlHighlight);
+ }
+
+ if (aDrawNow)
+ {
+ if (captParentCtrl)
+ captParentCtrl->Redraw();
+ else
+ iFocusControl->Redraw();
+ }
+ else
+ {
+ if (captParentCtrl)
+ captParentCtrl->CoeControl().DrawDeferred();
+ else
+ iFocusControl->CoeControl().DrawDeferred();
+ }
+ }
+}
+
+void CSwtShell::DoSetFocusControl(MSwtControl* aControl)
+{
+ iPrevFocusControl = iFocusControl;
+
+ // This must always be the only place to assign to iFocusControl!
+ iFocusControl = aControl;
+}
+
+void CSwtShell::DoSetHighlight(MSwtControl& aControl, TBool aEnabled)
+{
+ if (aControl.HasHighlight(EFalse) != aEnabled) // not checking parents
+ {
+ aControl.SetHighlight(aEnabled);
+ }
+}
+
+void CSwtShell::ControlDisposing(const MSwtControl& aControl)
+{
+ const MSwtControl* control = &aControl;
+
+ if (control == iPrevFocusControl)
+ iPrevFocusControl = NULL;
+
+ if (control == iControlGoingToStack)
+ iControlGoingToStack = NULL;
+
+ if (control == iControlGainingFocus)
+ iControlGainingFocus = NULL;
+
+ if (control== iFocusControl)
+ iFocusControl = NULL;
+
+ if (control == iFocusMemory)
+ iFocusMemory = NULL;
+
+ if (control == iUrgentPaintControl)
+ iUrgentPaintControl = NULL;
+}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtslider.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtslider.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -349,8 +349,8 @@
// Update the image size before the rotation of the image.
iImageSize.SetSize(iImageSize.iHeight, iImageSize.iWidth);
- iImagesRotator->AddImage(iSliderImage);
- iImagesRotator->AddImage(iSliderImageMask);
+ iImagesRotator->AddImageL(iSliderImage);
+ iImagesRotator->AddImageL(iSliderImageMask);
iImagesRotator->Start(this);
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtsortedlist.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtsortedlist.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -619,6 +619,29 @@
#endif //RD_JAVA_S60_RELEASE_9_2
// ---------------------------------------------------------------------------
+// CSwtSortedList::PrepareForTraverse
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+void CSwtSortedList::PrepareForTraverse()
+{
+ ASSERT(iList);
+ ASSERT(iList->View());
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ // AvKon enables highlight only when key event is recieved.
+ // When traversing, no key event is sent to AvKon, so we
+ // have to enable highlight by ourselves.
+ CListItemDrawer* itemDrawer = iList->View()->ItemDrawer();
+ if (itemDrawer)
+ {
+ itemDrawer->ClearFlags(CListItemDrawer::ESingleClickDisabledHighlight);
+ }
+#endif //RD_JAVA_S60_RELEASE_9_2
+}
+
+
+// ---------------------------------------------------------------------------
// CSwtSortedList::DoPaint
// From MSwtControl
// ---------------------------------------------------------------------------
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swttable.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swttable.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -1904,9 +1904,12 @@
//
TInt CSwtTable::FocusBackgroundPolicy() const
{
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ return ENoFocusBackgroundInCaptionedControl;
+#else
return ASwtControlBase::FocusBackgroundPolicy();
-};
-
+#endif // RD_JAVA_S60_RELEASE_9_2
+}
// ---------------------------------------------------------------------------
// From MSwtControl
// ---------------------------------------------------------------------------
@@ -2197,6 +2200,27 @@
}
#endif //RD_JAVA_S60_RELEASE_9_2
+// ---------------------------------------------------------------------------
+// CSwtTable::PrepareForTraverse
+// From MSwtControl
+// ---------------------------------------------------------------------------
+//
+void CSwtTable::PrepareForTraverse()
+{
+ ASSERT(iTableListBox);
+ ASSERT(iTableListBox->View());
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ // AvKon enables highlight only when key event is recieved.
+ // When traversing, no key event is sent to AvKon, so we
+ // have to enable highlight by ourselves.
+ CListItemDrawer* itemDrawer = iTableListBox->View()->ItemDrawer();
+ if (itemDrawer)
+ {
+ itemDrawer->ClearFlags(CListItemDrawer::ESingleClickDisabledHighlight);
+ }
+#endif //RD_JAVA_S60_RELEASE_9_2
+}
// ---------------------------------------------------------------------------
// From ASwtScrollableBase
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swttextbase.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swttextbase.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -216,19 +216,37 @@
charMask.SetAttrib(EAttFontPosture);
}
- // when we set the new font color also changes. So we have to set the color again.
- if (!iTextColor)
+ TRgb color(0);
+ TInt err(KErrNone);
+
+ if (HasHighlight())
{
- TRgb color;
- AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), color,
- KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6);
- charFormat.iFontPresentation.iTextColor = color;
+ err = AknsUtils::GetCachedColor(AknsUtils::SkinInstance()
+ , color
+ , KAknsIIDQsnTextColors
+ , KHighlightedTextColor);
+ if (err == KErrNone)
+ {
+ charFormat.iFontPresentation.iTextColor = color;
+ charMask.SetAttrib(EAttColor);
+ }
+ }
+ else if (iTextColor)
+ {
+ charFormat.iFontPresentation.iTextColor = GetForeground();
charMask.SetAttrib(EAttColor);
}
else
{
- charFormat.iFontPresentation.iTextColor = GetForeground();
- charMask.SetAttrib(EAttColor);
+ err = AknsUtils::GetCachedColor(AknsUtils::SkinInstance()
+ , color
+ , KAknsIIDQsnTextColors
+ , KNonHighlightedTextColor);
+ if (err == KErrNone)
+ {
+ charFormat.iFontPresentation.iTextColor = color;
+ charMask.SetAttrib(EAttColor);
+ }
}
if (iStyle & KSwtStyleSingle)
@@ -287,18 +305,23 @@
void CSwtTextBase::SetForegroundL(const MSwtColor* aColor)
{
ASwtControlBase::DoSetForegroundL(aColor);
- TRgb color(aColor ? aColor->RgbValue() :
- iDisplay.CoeEnv()->Color(EColorControlText));
- if (iEditor)
+
+ iTextColor = ETrue;
+ if (!aColor)
+ {
+ iTextColor = EFalse;
+ }
+ else if (iEditor)
{
TCharFormat charFormat;
TCharFormatMask charMask;
- charFormat.iFontPresentation.iTextColor=color;
+ charFormat.iFontPresentation.iTextColor = aColor->RgbValue();
charMask.SetAttrib(EAttColor);
static_cast<CGlobalText*>(iEditor->Text())->
ApplyCharFormatL(charFormat, charMask, 0, iEditor->TextLength());
- iTextColor = ETrue;
}
+
+ UpdateTextColor();
Redraw();
}
@@ -345,6 +368,61 @@
return ASwtScrollableBase::Dispose();
}
+TInt CSwtTextBase::PressBackgroundPolicy() const
+{
+ return EPressBackground;
+}
+
+void CSwtTextBase::UpdateTextColor()
+{
+ if (iEditor)
+ {
+ TCharFormat charFormat;
+ TCharFormatMask charMask;
+ TRgb color(0);
+ TInt err(KErrNone);
+
+ if (HasHighlight())
+ {
+ // Highlighted foreground color, overrides all others.
+ err = AknsUtils::GetCachedColor(AknsUtils::SkinInstance()
+ , color
+ , KAknsIIDQsnTextColors
+ , KHighlightedTextColor);
+ if (err == KErrNone)
+ {
+ charFormat.iFontPresentation.iTextColor = color;
+ }
+ }
+ else if (iTextColor)
+ {
+ // Custom foreground color, overrides the default.
+ charFormat.iFontPresentation.iTextColor = GetForeground();
+ }
+ else
+ {
+ // Default foreground color.
+ err = AknsUtils::GetCachedColor(AknsUtils::SkinInstance()
+ , color
+ , KAknsIIDQsnTextColors
+ , KNonHighlightedTextColor);
+ if (err == KErrNone)
+ {
+ charFormat.iFontPresentation.iTextColor = color;
+ }
+ }
+
+ charMask.SetAttrib(EAttColor);
+ TRAP_IGNORE(static_cast<CGlobalText*>(iEditor->Text())->
+ ApplyCharFormatL(charFormat, charMask, 0, iEditor->TextLength()));
+ }
+}
+
+void CSwtTextBase::HandleHighlightChange()
+{
+ UpdateTextColor();
+}
+
// ---------------------------------------------------------------------------
// CSwtTextBase::ComputeDelta
// ---------------------------------------------------------------------------
@@ -835,9 +913,11 @@
if (aType == KAknsMessageSkinChange || aType == KEikDynamicLayoutVariantSwitch)
{
+ // The highlight color will be updated from ProcessFontUpdateL()
+
if (!iFont)
{
- RetrieveDefaultFontL();
+ RetrieveDefaultFontL(); // ProcessFontUpdateL() will get called also.
}
else
{
@@ -906,14 +986,15 @@
vsb->HandlePointerEventL(aPointerEvent);
}
+ TBool forward(EFalse);
+ TPointerEvent pointerEvent(aPointerEvent);
+
// Edwin tap. Button1Up after the long tap is not forwarded to the editor
if (!(aPointerEvent.iType == TPointerEvent::EButton1Up
&& (iDisplay.RevertPointerEvent() || !hit))
&& !iVScrollBarGrabsPointerEvents
&& !iIgnorePointerDown)
{
- TPointerEvent pointerEvent(aPointerEvent);
-
// If clicking on margins, move the pointer event.
TRect viewRect(iEditor->TextView()->ViewRect());
TRect viewRectWithoutMargins(viewRect);
@@ -949,7 +1030,7 @@
}
}
- iEditor->HandlePointerEventL(pointerEvent);
+ forward = ETrue;
}
// Stop scrollbar grabbing
@@ -967,7 +1048,9 @@
}
if (pressed != iPressed)
- Redraw();
+ {
+ GetShell().UpdateHighlight(ETrue); // draw now
+ }
#endif
#ifndef RD_JAVA_S60_RELEASE_9_2
@@ -975,6 +1058,12 @@
iIgnorePointerDown = EFalse;
#endif // RD_JAVA_S60_RELEASE_9_2
+ // Forwarding this late due to splitview + pressed flicker issues.
+ if (forward)
+ {
+ iEditor->HandlePointerEventL(pointerEvent);
+ }
+
PostMouseEventL(aPointerEvent);
}
#else //RD_SCALABLE_UI_V2
@@ -1175,25 +1264,6 @@
}
// ---------------------------------------------------------------------------
-// CSwtTextBase::FocusBackgroundPolicy
-// From MSwtControl
-// While background color is set, the editor's control context must be null,
-// otherwise there will be ugly background drawing problems while typing.
-// ---------------------------------------------------------------------------
-//
-TInt CSwtTextBase::FocusBackgroundPolicy() const
-{
- if (!IsDefaultBackgroundUse())
- {
- return EEmbeddedFocusBackground;
- }
- else
- {
- return ASwtControlBase::FocusBackgroundPolicy();
- }
-};
-
-// ---------------------------------------------------------------------------
// CSwtTextBase::ClientRect
// From MSwtControl
// ---------------------------------------------------------------------------
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swttextextension.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swttextextension.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -280,6 +280,19 @@
//
void CSwtTextExtension::FetchEmailL()
{
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ // Closing the VKB. Otherwise opened dialog will not be drawn over
+ // the whole screen. After closing dialog, VKB opens itself again
+ if (Editor().IsFocused())
+ {
+ CCoeFep* fep = iDisplay.CoeEnv()->Fep();
+ if (fep)
+ {
+ fep->HandleDestructionOfFocusedItem();
+ }
+ }
+#endif //RD_JAVA_S60_RELEASE_9_2
+
// The dialog used to select the address doesn't work properly if there is no
// status pane. Therefore, the status pane is temporarily made visible for
// the duration of showing the dialog.
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swttree.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swttree.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -284,8 +284,12 @@
TInt CSwtTree::FocusBackgroundPolicy() const
{
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ return ENoFocusBackgroundInCaptionedControl;
+#else
// Bypass CSwtComposite's focus background.
return ASwtControlBase::FocusBackgroundPolicy();
+#endif // RD_JAVA_S60_RELEASE_9_2
};
void CSwtTree::ProcessKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtuiutils.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtuiutils.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -24,6 +24,7 @@
#include <AknUtils.h>
#include <AknsDrawUtils.h>
#include <AknTextDecorationMetrics.h>
+#include <layoutmetadata.cdl.h>
#ifdef RD_JAVA_S60_RELEASE_9_2
#include <AknPriv.hrh>
#include <aknappui.h>
@@ -496,6 +497,7 @@
, iBrowserShellGarbage(NULL)
, iShellGarbageCollectionRequested(EFalse)
, iScrollBarBreadth(-1)
+ , iFixScreenOrientationApplicantsCount(0)
{
}
@@ -813,8 +815,11 @@
{
TInt index = iShells.Find(&aShell);
ASSERT(index != KErrNotFound);
- iShells.Remove(index);
- iShells.Append(&aShell);
+ TInt err = iShells.Append(&aShell);
+ if (err == KErrNone)
+ {
+ iShells.Remove(index);
+ }
}
// ---------------------------------------------------------------------------
@@ -960,7 +965,7 @@
case ESwtColorWidgetForeground:
case ESwtColorListForeground:
AknsUtils::GetCachedColor(skin, color, KAknsIIDQsnTextColors,
- EAknsCIQsnTextColorsCG6);
+ KNonHighlightedTextColor);
break;
case ESwtColorListSelectionText:
AknsUtils::GetCachedColor(skin, color, KAknsIIDQsnTextColors,
@@ -1567,7 +1572,7 @@
{
case ESwtListImage:
maxImageSize = CSwtLafFacade::GetLayoutRect(
- CSwtLafFacade::EListSingleLargeGraphicPaneG1, TRect(), 0).Rect().Size();
+ CSwtLafFacade::EListDoubleLargeGraphicPaneG1, TRect(), 0).Rect().Size();
break;
case ESwtChoiceImage:
maxImageSize = CSwtLafFacade::GetLayoutRect(
@@ -1578,6 +1583,7 @@
CSwtLafFacade::EPopupMidpNoteAlarmWindowG1, TRect(), 0).Rect().Size();
break;
default:
+
break;
}
return maxImageSize;
@@ -1671,9 +1677,7 @@
{
if (iActiveShell)
{
- MSwtControl* ctrl = iActiveShell->FocusControl();
- if (ctrl)
- ctrl->Redraw();
+ iActiveShell->UpdateHighlight();
}
}
}
@@ -2092,3 +2096,45 @@
return (aShell && aShell->GetParentShell() && IsApplicationModal(*aShell));
}
+// ---------------------------------------------------------------------------
+// CSwtUiUtils::RegisterFixScreenOrientation
+// ---------------------------------------------------------------------------
+//
+void CSwtUiUtils::RegisterFixScreenOrientation()
+{
+ iFixScreenOrientationApplicantsCount++;
+
+ // Store the old setting for the first applicant only
+ if (iFixScreenOrientationApplicantsCount == 1)
+ {
+ iOldUiOrientation = iAvkonAppUi->Orientation();
+ iRestoreOrientation =
+ (iOldUiOrientation == CAknAppUiBase::EAppUiOrientationUnspecified);
+
+ // Fix the orientation when was set to unspecified only
+ if (iRestoreOrientation)
+ {
+ TRAP_IGNORE(iAvkonAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationLandscape));
+ }
+ }
+}
+
+void CSwtUiUtils::UnRegisterFixScreenOrientation()
+{
+ if (iFixScreenOrientationApplicantsCount > 0)
+ {
+ iFixScreenOrientationApplicantsCount--;
+
+ if (iFixScreenOrientationApplicantsCount == 0 && iRestoreOrientation)
+ {
+ TRAP_IGNORE(iAvkonAppUi->SetOrientationL(iOldUiOrientation));
+ iRestoreOrientation = EFalse;
+ }
+ }
+}
+
+TBool CSwtUiUtils::IsScreenOrientationFixed() const
+{
+ return iFixScreenOrientationApplicantsCount > 0;
+}
+
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/graphics/Color.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/graphics/Color.java Thu Aug 19 09:48:13 2010 +0300
@@ -287,8 +287,6 @@
return OS.Color_RgbValue(device.handle, handle);
}
-
-
/**
* Invokes platform specific functionality to allocate a new Color.
* <p>
@@ -300,8 +298,8 @@
* </p>
*
* @param device the device on which to allocate the color
- * @param handle the handle for the font
- * @return a new font object containing the specified device and handle
+ * @param handle the handle for the color
+ * @return a new color object containing the specified device and handle
*/
public static Color internal_new(Device device, int handle)
{
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/graphics/Image.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/graphics/Image.java Thu Aug 19 09:48:13 2010 +0300
@@ -284,7 +284,7 @@
if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
init(device, new ImageData(filename));
}
-
+
/**
* Disposes of the operating system resources associated with
* the image. Applications must dispose of all images which
@@ -772,4 +772,47 @@
return baoStream.toByteArray();
}
+
+ /**
+ * Invokes platform specific functionality to allocate a new image
+ * which has handle to a system image.
+ * <p>
+ * <b>IMPORTANT:</b> This method is <em>not</em> part of the public
+ * API for <code>Font</code>. It is marked public only so that it
+ * can be shared within the packages provided by SWT. It is not
+ * available on all platforms, and should never be called from
+ * application code.
+ * </p>
+ *
+ * @param device the device on which to allocate the image
+ * @param handle the native handle for the image
+ * @return a new image object containing the specified device and
+ * system image handle
+ */
+ public static Image internal_new(Device device, int handle)
+ {
+ if (device == null) device = Device.getDevice();
+ if (device == null) SWT.error(SWT.ERROR_NULL_ARGUMENT);
+ if (handle == 0)
+ {
+ SWT.error(SWT.ERROR_NO_HANDLES, null, device.getLastError());
+ }
+
+ Image image = new Image();
+ image.device = device;
+ image.handle = handle;
+ image.type = SWT.BITMAP;
+
+ try
+ {
+ if (device.tracking) device.new_Object(image);
+ }
+ catch (Error e)
+ {
+ OS.Image_Dispose(device.handle, handle);
+ throw e;
+ }
+
+ return image;
+ }
}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/internal/extension/DisplayExtension.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/internal/extension/DisplayExtension.java Thu Aug 19 09:48:13 2010 +0300
@@ -15,42 +15,41 @@
import org.eclipse.swt.internal.symbian.OS;
import org.eclipse.swt.widgets.Display;
-public final class DisplayExtension extends Display
+public final class DisplayExtension extends Display
{
-
/* Image types, same values as MIDP */
public static final int LIST_ELEMENT = 1;
public static final int CHOICE_GROUP_ELEMENT = 2;
public static final int ALERT = 3;
- public DisplayExtension()
+ public DisplayExtension()
{
super();
}
/**
* Determine the best width for the given image type.
+ *
* @param imageType
* @return Best height or -1 if invalid image type given.
*/
- public int getBestImageWidth(int imageType)
+ public static int getBestImageWidth(int imageType)
{
- checkDevice();
return getBestImageSize(imageType).x;
}
/**
* Determine the best height for the given image type.
+ *
* @param imageType
* @return Best height or -1 if invalid image type given.
*/
- public int getBestImageHeight(int imageType)
+ public static int getBestImageHeight(int imageType)
{
- checkDevice();
return getBestImageSize(imageType).y;
}
- private Point getBestImageSize(int imageType)
+ private static Point getBestImageSize(int imageType)
{
return OS.DisplayExtension_getBestImageSize(imageType);
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/internal/extension/ImageUtil.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Nokia Corporation - initial implementation
+ *******************************************************************************/
+
+package org.eclipse.swt.internal.extension;
+
+import java.io.InputStream;
+
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.internal.symbian.OS;
+
+public final class ImageUtil {
+
+ public static final int THEME_IMAGE_SECURITY_TRUSTED = 0;
+ public static final int THEME_IMAGE_SECURITY_UNTRUSTED = 1;
+
+ public static Image createImageWithoutSecurityCheck(Device device,
+ String filename) {
+ return new Image(device, filename);
+ }
+
+ public static Image createImageFromTheme(Device device, int id) {
+ return Image.internal_new(device, OS.Image_NewFromTheme(device.handle, id));
+ }
+
+ public static Image scaleImage(Device device, Image srcImage,
+ Point destSize, boolean keepAspectRatio) {
+ return Image.internal_new(device, OS.Image_Scale(device.handle,
+ srcImage.handle, destSize.x, destSize.y, keepAspectRatio));
+ }
+
+ public static Point getImageSize(Device device, String filename) {
+ // Stub implementation for compatibility with Qt-based eSWT.
+ return null;
+ }
+
+ public static Point getImageSize(InputStream stream) {
+ // Stub implementation for compatibility with Qt-based eSWT.
+ return null;
+ }
+}
--- a/javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/internal/symbian/OS.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/eswt_akn/org.eclipse.ercp.swt.s60/src/org/eclipse/swt/internal/symbian/OS.java Thu Aug 19 09:48:13 2010 +0300
@@ -224,11 +224,13 @@
*/
public static final native int Image_New(int deviceHandle, int width, int height);
public static final native int Image_NewFromData(int deviceHandle, ImageData data);
+ public static final native int Image_NewFromTheme(int deviceHandle, int id);
public static final native void Image_Dispose(int deviceHandle, int handle);
public static final native Rectangle Image_GetBounds(int handle);
public static final native ImageData Image_GetData(int handle);
public static final native void Image_AddRef(int handle);
public static final native void Image_RemoveRef(int handle);
+ public static final native int Image_Scale(int deviceHandle, int srcImageHandle, int destWidth, int destHeight, boolean keepAspectRatio);
/*
* Class Link
--- a/javauis/javalegacyutils/build/javalegacyutils_0x2002DCBB.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/javalegacyutils/build/javalegacyutils_0x2002DCBB.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javalegacyutils.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javauis/javalegacyutils/javasrc/com/nokia/mj/impl/rt/legacy/ToolkitInvoker.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/javalegacyutils/javasrc/com/nokia/mj/impl/rt/legacy/ToolkitInvoker.java Thu Aug 19 09:48:13 2010 +0300
@@ -88,15 +88,6 @@
*/
public abstract boolean isNgaEnabled();
-
- /**
- * NGA specific change.
- * LCDUI's client APIs (e.g M3G) can check are they on foreground or not.
- * @return <code>true</code> if MIDlet is on foreground.
- * @since S60 9.2
- */
- public abstract boolean isForeground();
-
//
// Image access
//
--- a/javauis/javalegacyutils/javasrc/com/nokia/mj/impl/rt/legacy/ToolkitObserverNGAExtension.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/javalegacyutils/javasrc/com/nokia/mj/impl/rt/legacy/ToolkitObserverNGAExtension.java Thu Aug 19 09:48:13 2010 +0300
@@ -21,9 +21,7 @@
public interface ToolkitObserverNGAExtension extends ToolkitObserver
{
/**
- * Notification about MIDlet going to background or coming foreground.
- * @param foreground true, when MIDlet came to foreground
- * false, when MIDlet was sent to background
+ * Notification that observer should free all graphics memory immediately.
*/
- void foregroundEvent(boolean foreground);
+ void freeGraphicsMemory();
}
\ No newline at end of file
--- a/javauis/javauis.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/javauis.pro Thu Aug 19 09:48:13 2010 +0300
@@ -14,6 +14,7 @@
# Description: Generated file - do not edit manually
#
TEMPLATE = subdirs
+SUBDIRS += nokiasound/build/javanokiasound.pro
SUBDIRS += javalegacyutils
SUBDIRS += remconobserver_akn/build/javaremconobserver.pro
SUBDIRS += eswt_akn/org.eclipse.ercp.swt.s60/native/build/eswt.pro
@@ -24,7 +25,6 @@
SUBDIRS += eswt_akn/eswtdirectcontent/build/eswtdirectcontent.pro
SUBDIRS += m2g_akn/build/javam2g.pro
SUBDIRS += m3g_akn/build/javam3g.pro
-SUBDIRS += nokiasound_akn/build/javanokiasound.pro
SUBDIRS += runtimeui_akn/build/javaruntimeui.pro
SUBDIRS += softnotification_akn/build/javasoftnotification.pro
BLD_INF_RULES.prj_extensions += "$${LITERAL_HASH}include \"coreui/build/bld.inf\""
Binary file javauis/lcdui_akn/conf/lcdui.confml has changed
Binary file javauis/lcdui_akn/conf/lcdui_102072C2.crml has changed
--- a/javauis/lcdui_akn/javalcdui/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -77,6 +77,9 @@
com.nokia.mid.ui.TextEditorImpl,
com.nokia.mid.ui.Clipboard,
com.nokia.mid.ui.S60TextEditor,
+ com.nokia.mid.ui.S40TextEditor,
+ com.nokia.mid.ui.TextEditorExtensionAccess,
+ com.nokia.mid.ui.TextEditorTouchControl,
com.nokia.mid.ui.TextEditorListener,
com.nokia.mid.ui.CanvasGraphicsItem,
com.nokia.mid.ui.CanvasGraphicsItemPainter,
--- a/javauis/lcdui_akn/javalcdui/build/javalcdui_0x2002DCBA.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/build/javalcdui_0x2002DCBA.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javalcdui.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc.nokialcdui
--- a/javauis/lcdui_akn/javalcdui/inc/CMIDEnv.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/inc/CMIDEnv.h Thu Aug 19 09:48:13 2010 +0300
@@ -60,6 +60,7 @@
virtual TUid MidletUid() const;
virtual TPtrC MidletHome() const;
virtual void DisplayableIsDestructed(const MMIDDisplayable* displayable);
+ const MMIDDisplayable* LastFullscreenDisplayable() const;
#ifdef RD_SCALABLE_UI_V2
// This function can be moved out from RD_SCALABLE_UI_V2 flag if needed.
@@ -157,6 +158,20 @@
virtual TBool IsHardwareAcceleratedL(
MMIDEnv::THardwareType aHardwareType = MMIDEnv::EHardware3D);
+ /**
+ * @see MMIDEnv#HandleFullOrPartialForegroundL()
+ */
+ virtual void HandleFullOrPartialForegroundL(TBool aFullOrPartialFg);
+
+ /**
+ * @see MMIDEnv#HandleFreeGraphicsMemory()
+ */
+ virtual void HandleFreeGraphicsMemory();
+
+ /**
+ * @see MMIDEnv#HasFullOrPartialForeground()
+ */
+ virtual TBool HasFullOrPartialForeground() const;
private:
/**
* Checks and initializes 2D & 3D harware status
@@ -262,6 +277,7 @@
#ifdef RD_JAVA_NGA_ENABLED
TInt iHardwareStatus;
+ TBool iFullOrPartialFg;
#endif // RD_JAVA_NGA_ENABLED
};
--- a/javauis/lcdui_akn/javalcdui/inc/CMIDToLcduiObserver.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/inc/CMIDToLcduiObserver.h Thu Aug 19 09:48:13 2010 +0300
@@ -131,6 +131,18 @@
*/
void InvokeUICallback(MUiEventConsumer& aConsumer, TInt aCallbackId);
+ /**
+ * Invokes MDirectContainer::InvokeLcduiEvent in UI thread.
+ *
+ * @since S60 9.2
+ * @param aControl CCoeControl pointer needed for checking that registered
+ * control has not unregistered yet.
+ * @param aContainer The container to be notifed.
+ */
+ void InvokeLcduiEvent(
+ MMIDLcduiEventConsumer& aConsumer,
+ TInt aCallbackId);
+
private:
/** CMIDToLcduiObserver event datatype */
enum TToLcduiEventType
@@ -141,6 +153,7 @@
#ifdef RD_JAVA_NGA_ENABLED
,ENotifyContentAdded
#endif
+ ,ELcduiEvent
};
/** CMIDToLcduiObserver event content datatype */
@@ -149,7 +162,7 @@
TToLcduiEventType iType;
CCoeControl* iControl;
TRect iRect;
- MUiEventConsumer* iConsumer;
+ void* iConsumer;
TInt iId;
#ifdef RD_JAVA_NGA_ENABLED
MDirectContainer* iContainer;
@@ -179,15 +192,26 @@
MUiEventConsumer *aConsumer);
/**
- * Invokes callback aConsumer->MdcUICallback.
+ * Invokes callback aConsumer->HandleLcduiEvent(aCallbackId)
+ *
+ * @since S60 9.2
+ * @param aConsumer Consumer of the callback.
+ * @param aCallbackId Id which is provided to the callback
+ */
+ void DoInvokeLcduiEvent(
+ MMIDLcduiEventConsumer *aConsumer,
+ TInt aCallbackId);
+
+ /**
+ * Invokes callback aConsumer->MdcUICallback
*
* @since S60 5.0
* @param aConsumer Consumer of the callback.
* @param aCallbackId Id which is provided to the callback
*/
void DoInvokeUICallback(
- MUiEventConsumer *aConsumer,
- TInt aCallbackId);
+ MUiEventConsumer *aConsumer,
+ TInt aCallbackId);
#ifdef RD_JAVA_NGA_ENABLED
@@ -221,7 +245,7 @@
*
* @since S60 5.0
*/
- virtual void DoCancel();
+ virtual void DoCancel();
private:
/**
--- a/javauis/lcdui_akn/javalcdui/inc/CMIDToolkit.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/inc/CMIDToolkit.h Thu Aug 19 09:48:13 2010 +0300
@@ -31,6 +31,7 @@
//
class CApaWindowGroupName;
class CMIDToolkit;
+class MMIDDisplayable;
/**
Utility class providing access to the MIDlet suite attributes.
@@ -104,6 +105,9 @@
TBool PostSerialEvent(jobject aRunnable);
void DisposeObject(MMIDComponent* aObject);
+ // Returns pointer to last fullscreen displayble.
+ inline const MMIDDisplayable* LastFullscreenDisplayable() const;
+
//
// Activate event sources
//
@@ -165,6 +169,10 @@
void HandleForegroundL(TBool aForeground);
void HandleSwitchOnEventL();
void HandleResourceChangeL(TInt aType);
+#ifdef RD_JAVA_NGA_ENABLED
+ void HandleFullOrPartialForegroundL(TBool aFullOrPartialFg);
+ void HandleFreeGraphicsMemory();
+#endif
private:
/**
@@ -218,6 +226,15 @@
void LoadLibrariesL();
+ /**
+ * If current displayable is canvas,
+ * returns pointer to it.
+ *
+ * @return pointer to the current canvas, if current displayable is canvas.
+ * NULL, if current displayable is not canvas.
+ */
+ MMIDCanvas* GetCurrentCanvas() const;
+
public:
/*@ deprecated */
jmethodID iHandleNotifyMethod;
@@ -242,7 +259,7 @@
struct TObjectEntry
{
-public:
+ public:
TObjectEntry(MMIDComponent* aComponent);
union
{
@@ -384,4 +401,9 @@
}
}
+inline const MMIDDisplayable* CMIDToolkit::LastFullscreenDisplayable() const
+{
+ return iOldFullScreenDisplayable;
+}
+
#endif // CMIDTOOLKIT_H
--- a/javauis/lcdui_akn/javalcdui/inc/Lcdglue.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/inc/Lcdglue.h Thu Aug 19 09:48:13 2010 +0300
@@ -57,6 +57,18 @@
* Called by appui in response to CONE resource change.
*/
virtual void HandleResourceChangeL(TInt aType)=0;
+
+#ifdef RD_JAVA_NGA_ENABLED
+ /**
+ * Called by appui when application gains or loses partial/full foreground.
+ */
+ virtual void HandleFullOrPartialForegroundL(TBool aFullOrPartialFg)=0;
+
+ /**
+ * Called by appui when application needs to free all GPU memory immediately.
+ */
+ virtual void HandleFreeGraphicsMemory()=0;
+#endif //RD_JAVA_NGA_ENABLED
};
#endif
@@ -65,7 +77,8 @@
public:
virtual MMIDComponentFactory* CreateComponentFactoryL() = 0;
#ifdef LCDUI_TRANSITIONAL_API
- virtual void SetObserver(MMIDObserver* aObserver) = 0;
+ virtual void SetObserverL(MMIDObserver* aObserver) = 0;
+ virtual void SetEnv(MMIDEnv* aEnv) = 0;
#endif
};
--- a/javauis/lcdui_akn/javalcdui/inc/MMIDCustomComponent.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/inc/MMIDCustomComponent.h Thu Aug 19 09:48:13 2010 +0300
@@ -48,7 +48,8 @@
{
EFullscreenChange,
EResolutionChange,
- EPartialVKBChange
+ EPartialVKBChange,
+ EForegroundGained
};
public: // New methods
@@ -135,6 +136,15 @@
*/
virtual void HandleResourceChange(TInt aType) = 0;
+ /**
+ * Handles switching from foreground to background and vice versa.
+ *
+ * @param aForeground Flag if it switches to foreground or to backgound.
+ *
+ * @since S60 5.0
+ */
+ virtual void HandleForeground(TBool aForeground) = 0;
+
protected: // Destructor
/**
--- a/javauis/lcdui_akn/javalcdui/inc/lcdui.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/inc/lcdui.h Thu Aug 19 09:48:13 2010 +0300
@@ -49,7 +49,6 @@
#include <badesca.h>
#include <gdi.h>
#include <w32std.h>
-#include <aknsconstants.h>
#ifdef RD_JAVA_NGA_ENABLED
#include <EGL/egltypes.h>
@@ -89,6 +88,7 @@
class MMIDTextEditor;
class MMIDCanvasGraphicsItem;
class MMIDCanvasGraphicsItemPainter;
+class MMIDLcduiEventConsumer;
/**
* @internalComponent
@@ -134,13 +134,6 @@
}
-#ifdef RD_JAVA_S60_RELEASE_9_2
-const TInt KHighlightedItemTextColor = EAknsCIQsnTextColorsCG6;
-#else
-const TInt KHighlightedItemTextColor = EAknsCIQsnTextColorsCG8;
-#endif // RD_JAVA_S60_RELEASE_9_2
-const TInt KNonHighlightedItemTextColor = EAknsCIQsnTextColorsCG6;
-
/**
*
@@ -242,7 +235,7 @@
* @return <code>ETrue</code> if EGL exists.
* @since S60 9.2
*/
- virtual TBool IsEglAvailable() = 0;
+ virtual TBool IsEglAvailable() const = 0;
/**
* Gets and binds EGL surface.
@@ -830,6 +823,13 @@
* @since S60 9.2
*/
virtual void UpdateRect(const TRect& aRect) = 0;
+
+ /**
+ * Notifies canvas about MIDlet exit. In exit Canvas must draw content to CWindowGc
+ * to enable system transition effects.
+ * @since S60 9.2
+ */
+ virtual void MidletExiting() = 0;
#endif // RD_JAVA_NGA_ENABLED
virtual TBool ReadyToBlit() const = 0;
@@ -2175,7 +2175,9 @@
EItemChanged = 0, // Futuredev: value
// EList
ESelect = 0, // Futuredev: value
- EM3GDraw = 32 // M3G content is drowned on canvas
+ EM3GDraw = 32, // M3G content is drowned on canvas
+ EForcedPaint = 33,
+ EFreeGraphicsMemory = 34
};
/**
@@ -2255,6 +2257,21 @@
* Handles a change to resources which are shared accross the environment.
*/
virtual void HandleResourceChangeL(TInt aType) = 0;
+
+#ifdef RD_JAVA_NGA_ENABLED
+ /**
+ * Called when MIDlet gains or loses partial/full foreground.
+ * Application (CAknAppUi::HandleWsEventL()) gets AknFullOrPartialForegroundGained event
+ * when it becomes at least partially visible even if it would not be the foreground application.
+ * AknFullOrPartialForegroundLost is received when application is not all visible anymore.
+ */
+ virtual void HandleFullOrPartialForegroundL(TBool /*aFullOrPartialFg*/) {}
+
+ /**
+ * Called when all graphics memory needs to be freed immediately.
+ */
+ virtual void HandleFreeGraphicsMemory() {}
+#endif //RD_JAVA_NGA_ENABLED
};
/**
@@ -2483,6 +2500,25 @@
*/
virtual TBool IsHardwareAcceleratedL(
MMIDEnv::THardwareType aHardwareType) = 0;
+
+ /**
+ * Called when MIDlet's partial/full foreground status is changed.
+ * @since S60 9.2
+ */
+ virtual void HandleFullOrPartialForegroundL(TBool aFullOrPartialFg) = 0;
+
+ /**
+ * Called when graphics memory needs to be freed immediately.
+ * @since S60 9.2
+ */
+ virtual void HandleFreeGraphicsMemory() = 0;
+
+ /**
+ * Checks if MIDlet is at least partially visible.
+ * @return ETrue if MIDlet has full or partial foreground.
+ * @since S60 9.2
+ */
+ virtual TBool HasFullOrPartialForeground() const = 0;
#endif // RD_JAVA_NGA_ENABLED
/**
@@ -2515,6 +2551,14 @@
* @since Java 2.0
*/
virtual void DisplayableIsDestructed(const MMIDDisplayable* aDisplayable) = 0;
+
+ /**
+ * Returns pointer to last fullscreen Displayble.
+ *
+ * @return Last fullscreen Displayable
+ * @since Java 2.1
+ */
+ virtual const MMIDDisplayable* LastFullscreenDisplayable() const = 0;
};
/**
@@ -2598,6 +2642,8 @@
virtual void InvokeUICallback(
MUiEventConsumer& aConsumer,
TInt aCallbackId) = 0;
+
+ virtual void InvokeLcduiEvent(MMIDLcduiEventConsumer& aConsumer, TInt aCallbackId) = 0;
};
/**
@@ -2880,4 +2926,10 @@
virtual void AbortAsync() = 0;
};
+class MMIDLcduiEventConsumer
+{
+public:
+ virtual void HandleLcduiEvent(int aType) = 0;
+};
+
#endif // LCDUI_H
--- a/javauis/lcdui_akn/javalcdui/inc/reflcdui.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/inc/reflcdui.h Thu Aug 19 09:48:13 2010 +0300
@@ -182,6 +182,14 @@
*/
virtual void MdcNotifyContentAdded() {}
#endif
+
+ /**
+ * Fixes screen UI orientation.
+ *
+ * @param aEnableFix If ETrue, the UI orientation will be fixed.
+ * If EFalse, the standard UI orientation is restored.
+ */
+ virtual void MdcFixUIOrientation(TBool aEnableFix) = 0;
};
/**
@@ -241,5 +249,6 @@
virtual void MdcResumeDSA() = 0;
};
+
#endif // REFLCDUI_H
--- a/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/CanvasGraphicsItem.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/CanvasGraphicsItem.java Thu Aug 19 09:48:13 2010 +0300
@@ -480,13 +480,17 @@
*/
final void registeredFinalize()
{
- synchronized (iToolkit)
+ if (mFinalizer != null )
{
- if (iHandle > 0)
+ synchronized (iToolkit)
{
- _dispose(getToolkitHandle(), iHandle);
- iHandle = 0;
+ if (iHandle != 0)
+ {
+ iToolkitInvoker.toolkitDisposeObject(iToolkit,iHandle);
+ iHandle = 0;
+ }
}
+ mFinalizer = null;
}
}
--- a/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/Clipboard.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/Clipboard.java Thu Aug 19 09:48:13 2010 +0300
@@ -66,7 +66,9 @@
* Copies characters from the system clipboard.
* <P>
* Returns empty string when there is nothing in the system clipboard.
- *
+ * <P>
+ * This method is not supported on S40 platform, returns <code>null</code>.
+ * <P>
* @return the content in clipboard
*/
public static String copyFromClipboard()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/S40TextEditor.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,322 @@
+/*
+ * 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: Interface for S40 Text Editor
+ *
+ */
+
+package com.nokia.mid.ui;
+
+import javax.microedition.lcdui.Command;
+import javax.microedition.lcdui.Image;
+
+/**
+ * <p>
+ * This interfaces provides access to extended editing-related functionality, that is only
+ * available on Series 40 devices.</p>
+ * <b>Commands:</b><br>
+ * Applications can use {@link com.nokia.mid.ui.S40TextEditor#getTextEditorCommands()} and {@link com.nokia.mid.ui.S40TextEditor#launchTextEditorCommand(Command, int)}
+ * to present editing-commands in a customized way. When launching such a command, the application has to specify a
+ * command-mode. This is because some commands may require information regarding the key-state that has caused this command to
+ * be launched. For example, calling <code>launchTextEditorCommand(cmd, COMMAND_MODE_KEYPRESS)</code> for the "Clear"-command will cause
+ * to editor to keep deleting characters until the application calls <code>launchTextEditorCommand(cmd, COMMAND_MODE_KEYRELEASE)</code>.
+ * Since not all commands require keystate-information, applications can use {@link com.nokia.mid.ui.S40TextEditor#isCommandKeyWanted(Command)}
+ * If no command-key is wanted, COMMAND_MODE_SELECTED should be passed when launching this command <p>
+ * <b>Indicator-icons</b><br>
+ * It is possible to access the indicator-icons that the platform would normally display as Images, using
+ * {@link com.nokia.mid.ui.S40TextEditor#getIndicatorIcons()} <p>
+ * <b>Visibility</b><br>
+ * Applications may be in the situation where they want an editor to be visible, but to not process keys or be animated, e.g. while
+ * a custom options-menu is displayed. In those cases, it is possible to call {@link com.nokia.mid.ui.S40TextEditor#setVisible(int)} <p>
+ * <b>Extra properties</b><br>
+ * Some properties that are not available in the com.nokia.mid.ui.TextEditor, like writing-direction, native emoticon support
+ * and positioning for native popup-windows. <p>
+ * On Series 40 devices this interface is implemented by the object returned by {@link com.nokia.mid.ui.TextEditor#createTextEditor(String, int, int, int, int)} if
+ * the MIDlet is manufacturer or operator signed.
+ *
+ */
+public abstract interface S40TextEditor {
+
+ /**
+ * command type used to indicate commands
+ * that should be put on the middle softkey
+ */
+ public final static int SELECT_SOFTKEY_COMMAND = 9;
+
+ /**
+ * command type used to indicate commands
+ * that should be put on the right softkey.
+ */
+ public final static int RIGHT_SOFTKEY_COMMAND = 10;
+
+ /**
+ * command type used to indicate commands
+ * that should be put as the last one in the option list.
+ */
+ public final static int LAST_IN_OPTIONS_COMMAND = 12;
+
+ /**
+ * command type used to indicate commands
+ * that should be put on the left softkey.
+ */
+ public final static int LEFT_SOFTKEY_COMMAND = 13;
+
+
+ /**
+ * constant for left-to-right direction
+ */
+ public static final int DIRECTION_LTR = 0;
+
+ /**
+ * constant for right-to-left direction
+ */
+ public static final int DIRECTION_RTL = 1;
+
+ /**
+ * Constant for Cursor Wrap Off
+ * No cursor wrapping occurs.
+ * Traverse out callback is active for up / down
+ * Traverse out callback is active for left / right when the editor is empty.
+ */
+ public static final int CURSOR_WRAP_OFF = 0;
+
+ /**
+ * Constant for Cursor Wrap Left/Right
+ * Cursor wrapping is active only for left / right.
+ * Traverse out callback is supported for up / down.
+ */
+ public static final int CURSOR_WRAP_LEFT_RIGHT = 2;
+
+ /**
+ * Constant for Cursor Wrap Full
+ * Cursor wrapping is active for all directions (up / down / left / right).
+ * Doesnt send traverse out callback.
+ */
+ public static final int CURSOR_WRAP_FULL = 1;
+
+ /**
+ * Event that indicates that the applications options-list should be closed.
+ * The implementation sends this even in a case where the platform has displayed further
+ * nested options as the result of a {@link com.nokia.mid.ui.S40TextEditor#launchTextEditorCommand(Command, int)}-call.
+ * If the user selects one of the nested options (e.g. "copy"), the platform will carry out the
+ * associated functionality, dismiss the native options-popup and send the
+ * ACTION_OPTIONS_CLOSED-event, in order to indicate that any options-list that the application
+ * might have displayed should also be closed.
+ *
+ */
+ public static final int ACTION_OPTIONS_CLOSED = 0x00010000;
+
+ /**
+ * Indicates that the user tries to exit this TextEditor left.
+ * This action is only generated when the cursor wrap mode is set to {@link #CURSOR_WRAP_OFF} and the editor
+ * is empty.
+ */
+ public static final int ACTION_TRAVERSE_LEFT = 0x00020000;
+
+ /**
+ * Indicates that the user tries to exit this TextEditor right.
+ * This action is only generated when the cursor wrap mode is set to {@link #CURSOR_WRAP_OFF} and the editor
+ * is empty.
+ */
+ public static final int ACTION_TRAVERSE_RIGHT = 0x00040000;
+
+// native_const(JAVA_TEXTEDITOR)
+// {
+
+ /**
+ * Indicates that the text in this TextEditor is masked according to the
+ * Oz Mobile Password Masking Scheme
+ */
+ public static final int PASSWORD_MASKED = 0x400000;
+
+ /**
+ * Indicates that the text in this TextEditor is locked according to the
+ * Oz Mobile Password Masking Scheme
+ */
+ public static final int PASSWORD_LOCKED = 0x800000;
+// }
+
+ /**
+ * constant value to indicate a hidden/invisible TextEditor
+ */
+ public static final int HIDDEN=1;
+
+ /**
+ * constant value to indicate partial visibility of a TextEditor.
+ * A partially visible TextEditor will still be displayed, but not
+ * receive any key-events, and not have a blinking cursor
+ */
+ public static final int PARTIALLY_VISIBLE=2;
+
+ /**
+ * constant value to indicate full visibility of a TextEditor
+ */
+ public static final int VISIBLE=3;
+
+
+ /**
+ * Command-mode to indicate that a command is launched without keystate-information, e.g. from
+ * an options-menu
+ */
+ public static final int COMMAND_MODE_SELECTED=0;
+
+ /**
+ * Command-mode to indicate that a command is launched with a keypress, e.g. by pressing RSK
+ */
+ public static final int COMMAND_MODE_KEYPRESS=1;
+
+ /**
+ * Command-mode to indicate that a command has been launched with a keypress, and that this key
+ * has now been released, e.g. by releasing the RSK
+ */
+ public static final int COMMAND_MODE_KEYRELEASE=2;
+
+ /**
+ * Specifies the current input mode of this TextEditor
+ * @param mode the new input-mode. This should be a value returned by {@link com.nokia.mid.ui.S40TextEditor#getInputMode()}
+ */
+ public void setInputMode(int mode) throws IllegalArgumentException;
+
+ /**
+ * Gets the current input mode of this TextEditor
+ * @return the current input mode. This value represents a native input-mode, that can be passed to {@link com.nokia.mid.ui.S40TextEditor#setInputMode(int)}
+ *
+ */
+ public int getInputMode();
+
+ /**
+ * Returns the current set of Editor-Commands
+ * @return the commands
+ */
+ public Command[] getTextEditorCommands();
+
+ /**
+ * Executes an editor-option. This method will invoke native functionality according to the command. This may
+ * be an action in the editor (copy, delete,..) which then in turn will cause callbacks to this editors
+ * TextEditorListener. It may as well cause platform-controlled panels (nested options, touch-dialog) to cover part of
+ * or the full display. <br>
+ * This method should be called from inside the keyPressed()-method.
+ * @param cmd The command to launch. This has to be a command returned by {@link com.nokia.mid.ui.S40TextEditor#getTextEditorCommands()}
+ * @return true if launching this command has displayed a list of further sub-commands as a popup. if an application
+ * has displayed an options-menu before launching a command, this options-menu should normally stay on the screen
+ * after this launch, to indicate that the native sub-commands are nested and related to the command that has been
+ * launched.
+ *
+ * @throws IllegalStateException if the TextEditor is not focussed during this call
+ * @throws IllegalArgumentException if the command is not available in the editor. Commands that are
+ * available in the editor are only those that this editor has provided via {@link com.nokia.mid.ui.S40TextEditor#getTextEditorCommands()}
+ */
+ public boolean launchTextEditorCommand(Command cmd,int mode) throws IllegalStateException, IllegalArgumentException;
+
+ /**
+ * Gets the menu-state of a Command
+ * @param cmd The Command to query for Menu-state. This has to be a command returned by {@link com.nokia.mid.ui.S40TextEditor#getTextEditorCommands()}
+ * @return true if this a Menu Command. Launching a Menu Command will show a popup on the display, providing further
+ * commands to the user
+ */
+ public boolean isMenuCommand(Command cmd);
+
+ /**
+ * Returns whether a command requires keystate-information to be launched.
+ * @param cmd The command to be queried
+ * @return true if cmd requires keystate-information. In this case, one of COMMAND_MODE_KEYPRESS or COMMAND_MODE_KEYRELEASE
+ * should be passed when launching this command via {@link com.nokia.mid.ui.S40TextEditor#launchTextEditorCommand(Command, int)}
+ * false if cmd does not require keystate-informationl. In that case, COMMAND_MODE_SELECTED should be passed when launching it.
+ */
+ public boolean isCommandKeyWanted(Command cmd);
+
+
+ /**
+ * Specifies the amount of pixels by which the TextEditor will scroll text horizontally, if multiline
+ * input is disabled.
+ * @param offset The scrolling offset. When a cursor-movement requires horizontal scrolling of the
+ * text, this value indicates by how many pixels the text will be moved.
+ */
+ public void setHorizontalScrollingWidth(int offset);
+
+ /**
+ * Gets the current horizontal scrolling width
+ * @return the scrolling width
+ */
+ public int getHorizontalScrollingWidth();
+
+ /**
+ * Gets the current writing-direction
+ * @return DIRECTION_LTR or DIRECTION_RTL
+ */
+ public int getWritingDirection();
+
+ /**
+ * Gets the current indicator-icons as images
+ * @return the icons
+ */
+ public Image[] getIndicatorIcons();
+
+ /**
+ * Specifies the visibility of this TextEditor.
+ * In some cases, for example when an application wants to display a custom Options-Menu, the method
+ * {@link com.nokia.mid.ui.TextEditor#setVisible(boolean)} may not be sufficient. For this purpose,
+ * this method allows to specify a partial visibility, which will display the TextEditor without
+ * e.g. animating the curosr, an in which the application can receive the key-events from the Canvas.
+ * @param visible the type of the visibility. Has to be one of VISIBLE,PARTIALLY_VISIBLE or HIDDEN.
+ * Calling this method with VISIBLE has the same effect as calling {@link com.nokia.mid.ui.TextEditor#setVisible(boolean)}
+ * with true, HIDDEN as with false.
+ * @throws IllegalArgumentException if visible has an unspecified value
+ */
+ public void setVisible(int visible) throws IllegalArgumentException;
+
+ /**
+ * Specifies whether emoticons should be available for this editor. If not enabled, the implementation
+ * will not provide any facilities to insert emoticons, e.g. via commands or special character-dialog,
+ * itself
+ * @param enable true to enable emoticons, false to disable
+ */
+ public void enableEmoticons(boolean enable);
+
+ /**
+ * Gets the emoticons-state of this editor
+ * @return true if emoticons are enabled, false if not
+ */
+ public boolean isEnableEmoticons();
+
+ /**
+ * Specifies a position on the screen where native popups will be displayed. This is a hint to the
+ * implementation, that may be disregarded.
+ * @param x x-coordinate of the popups position
+ * @param y y-coordinate of the popups position
+ */
+ public void setPopupPosition(int x,int y);
+
+ /**
+ * Specifies prefix and postfix text to be displayed along with the actual editor-content.
+ * This text will not be part of the actual editor-buffer, and hence can't be edited, and will not
+ * be considered by methods like {@link com.nokia.mid.ui.TextEditor#size()}
+ * @param prefix text to be displayed before the actual content. May be null to disable prefix-text
+ * @param postfix text to be displayed after the actual content. May be null to disable postfix-text
+ */
+ public void setFixedText(String prefix,String postfix);
+
+ /**
+ * Specifies the Cursor Wrap setting. This is required to allow the canvas editor to change state so
+ * that left / right cursor keys are able to traverse out of the editor if the editor is empty.
+ * @param wrap new cursor wrap setting
+ */
+ public void setCursorWrap(int wrap);
+
+ /**
+ * Gets the current Cursor Wrap setting
+ * @return current cursor wrap setting
+ */
+ public int getCursorWrap();
+
+}
--- a/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/TextEditor.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/TextEditor.java Thu Aug 19 09:48:13 2010 +0300
@@ -931,6 +931,8 @@
* rendered using given color value. The default highlight background
* color is fully opaque black.
*
+ * This method is not supported on S40 platform.
+ *
* @param color
* the color
*/
@@ -951,6 +953,8 @@
* using given color value. The default highlight foreground color is fully
* opaque white.
*
+ * This method is not supported on S40 platform.
+ *
* @param color
* the color
*/
@@ -1436,19 +1440,23 @@
*/
final void registeredFinalize()
{
- synchronized (iToolkit)
+ if (mFinalizer!=null)
{
- if (iHandle > 0)
+ synchronized (iToolkit)
{
- _dispose(getToolkitHandle(), iHandle);
- iHandle = 0;
+ if (iHandle > 0)
+ {
+ iToolkitInvoker.toolkitDisposeObject(iToolkit,iHandle);
+ iHandle = 0;
- if (iParent != null)
- {
- // Remove from editor container.
- iEditorContainer.removeEditor(this, iParent);
+ if (iParent != null)
+ {
+ // Remove from editor container.
+ iEditorContainer.removeEditor(this, iParent);
+ }
}
}
+ mFinalizer = null;
}
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/TextEditorExtensionAccess.java Thu Aug 19 09:48:13 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: Touch-support for TextEditor-API
+*
+*/
+
+package com.nokia.mid.ui;
+
+import com.nokia.mid.ui.TextEditorTouchControl;
+
+/**
+ * This interface provides access to extended functionality related to the TextEditor-API
+ * The object returned by the method {@link com.nokia.mid.ui.TextEditor#createTextEditor(int, int, int, int)} and
+ * {@link com.nokia.mid.ui.TextEditor#createTextEditor(int, int, int, int)} implements this interface.
+ * It depends on the capabilities of the device whether the extensions provided via this interface are
+ * supported or not. For unsupported extensions, the getter-methods of this interface will return null.
+ */
+public interface TextEditorExtensionAccess
+{
+
+ /**
+ * Gets the Touch-extensions of the TextEditor-API. See also {@link TextEditorTouchControl}
+ * @return the extension, or null if the device does not support touch.
+ */
+ public TextEditorTouchControl getTouchControl();
+
+}
--- a/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/TextEditorListener.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/TextEditorListener.java Thu Aug 19 09:48:13 2010 +0300
@@ -99,6 +99,7 @@
public static final int ACTION_SCROLLBAR_CHANGED = 0x800;
// Events 0x1000 and 0x2000 are used in s60 extension
+ // Events 0x10000, 0x20000, 0x40000, 0x400000, 0x800000 are used in s40 extension
/**
* This method is called by the platform to notify the client about events
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/TextEditorTouchControl.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,164 @@
+/*
+* 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: TextEditor-API alignment for Nokia-UI
+*
+*/
+package com.nokia.mid.ui;
+
+import com.nokia.mid.ui.TextEditorListener;
+
+/**
+ * Touch-devices can use a virtual control-panel to replace physical keys, and to facilitate
+ * textual input. The purpose of this interface is to provide some level of access and control over such a panel, when
+ * using the TextEditor-API. <p>
+ *
+ * MIDlets can obtain an instance of this interface via the {@link TextEditorExtensionAccess} in the
+ * following way:
+ * <pre>
+ * TextEditor editor = com.nokia.mid.ui.TextEditor.createTextEditor("hello world", 50, TextField.ANY, 100, 100);
+ * TextEditorTouchControl touchControl = ((TextEditorExtensionAccess)editor).getTouchControl();
+ * if(touchControl!=null){
+ * // this is a touch-device
+ * }
+ * else{
+ * // this is a non-touch-device
+ * }
+ * </pre>
+ * The instance is associated with the editor it has been obtained from, and controls only this editor.<p>
+ *
+ * Because a control-panel covers parts of the display which would otherwise be available to the application, MIDlets may
+ * choose to only display the panel at certain times, e.g. when the editor is focussed. This is possible with
+ * {@link TextEditorTouchControl#setPanelMode(int)}. Furthermore, a panel can be positioned anywhere an the display via
+ * {@link TextEditorTouchControl#setPanelPosition(int, int)}. This interface also allows to query the size of the panel, so
+ * that applications can integrate it into the Canvas. <p>
+ *
+ * On touch-devices, the platform can make use of pointer-input to let the user interact with a TextEditor on a Canvas, without
+ * that the application knows about this. For example, if the user taps with his stylus or finger somewhere inside a visible
+ * and focussed TextEditor, the MIDlet might not receive any notification about this via the Canvas-methods pointerPressed,
+ * pointerDragged or pointerReleased. Instead, the platform could change the position of the cursor and generate the
+ * according event for the editors {@link TextEditorListener}. Or it may even just ignore this event completely. In general,
+ * an application should not expect to receive any pointer-events after a "press" inside a focussed TextEditor.
+ * Under certain circumstances however, for example as a response to the {@link com.nokia.mid.ui.TextEditorListener#ACTION_TRAVERSE_OUT_SCROLL_UP}
+ * or {@link com.nokia.mid.ui.TextEditorListener#ACTION_TRAVERSE_OUT_SCROLL_DOWN} event, an application can decide at any time to override this
+ * behaviour, and force the platform to deliver all subsequent pointer-events to the Canvas.
+ * This can be done with {@link TextEditorTouchControl#setTouchEnabled(boolean)}. Note that a TextEditor which has been touch-disabled
+ * this way will not be able to perform any interaction like cursor-positioning or scrolling via touch-input, until is has been
+ * enabled again.
+ */
+public interface TextEditorTouchControl
+{
+
+
+ //native_const(JAVA_TEXTEDITOR)
+ //{
+
+ /**
+ * Constant to disable the display of a keypad/control-panel
+ */
+ public static final int PANEL_OFF = 1;
+
+ /**
+ * Constant to enable the display of a keypad/control-panel.
+ * In this mode the user cannot change the position of the panel, however
+ * the MIDlet can still do so via {@link TextEditorTouchControl#setPanelPosition(int, int)}
+ */
+ public static final int PANEL_FIXED_POSITION = 2;
+
+ /**
+ * Constant to enable the display of a keypad/control-panel.
+ * In this mode, the user can change the position of the panel of the display e.g. by
+ * dragging, if this is supported by the device. Changes to the position will generate the
+ * {@link TextEditorTouchControl#ACTION_PANEL_MOVED}-event. The current panel-position is
+ * provided via {@link TextEditorTouchControl#getPanelX()} and {@link TextEditorTouchControl#getPanelY()}
+ */
+ public static final int PANEL_FLOATING = 3;
+ //}
+
+ /**
+ * Event to indicate that the keypad/control-panel has been moved by the user
+ */
+ public static final int ACTION_PANEL_MOVED = 0x10000000;
+
+
+ /**
+ * Controls the behaviour of the virtual keypad/control-panel, if the device provides one.
+ * This is a hint which may be disregarded if the device does not support a virtual keypad/control-panel.
+ * @param mode One of {@link TextEditorTouchControl#PANEL_OFF} {@link TextEditorTouchControl#PANEL_FIXED_POSITION}
+ * or {@link TextEditorTouchControl#PANEL_FLOATING}
+ */
+ public void setPanelMode(int mode);
+
+ /**
+ * Gets the current panel-mode
+ * @return the mode, see {@link TextEditorTouchControl#setPanelMode(int)}
+ */
+ public int getPanelMode();
+
+ /**
+ * Sets the position of the panel on the display.
+ * @param x x-position of the keypad
+ * @param y y-position of the keypad
+ */
+ public void setPanelPosition(int x, int y);
+
+ /**
+ * Gets the width of the panel
+ * @return the width
+ */
+ public int getPanelWidth();
+
+ /**
+ * Gets the height of the panel
+ * @return the height
+ */
+ public int getPanelHeight();
+
+ /**
+ * Gets the current x-position of the panel on the display
+ * @return the x-coordinate
+ */
+ public int getPanelX();
+
+ /**
+ * Gets the current y-position of the panel on the display
+ * @return the y-coordinate
+ */
+ public int getPanelY();
+
+ /**
+ * Specifies whether or not the editor will receive touch-events. This is enabled by default.
+ * An editor with touch-event disabled won't be able to perform any touch-related functionality
+ * such as scrolling or positioning the cursor. It may however still be controlled via the
+ * virtual keypad/control-panel if that is enabled, or receive other input e.g. via physical
+ * keys
+ * @param enabled true to enabled touch-event, false to disable
+ */
+ public void setTouchEnabled(boolean enabled);
+
+ /**
+ * Gets the current touch-enabled state
+ * @return true if the editor is touch-enabled, false otherwise
+ */
+ public boolean isTouchEnabled();
+
+ /**
+ * Sets the caret as close as possible to a given x/y location. This is a hint to the implementation
+ * that may be disregarded.
+ * @param x new x-coordinate for the caret, relative to the editors origin
+ * @param y new y-coordinate for the caret, relative to the editors origin
+ */
+ public void setCaret(int x, int y);
+
+
+}
--- a/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/impl/TextEditorListenerImpl.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/com/nokia/mid/ui/impl/TextEditorListenerImpl.java Thu Aug 19 09:48:13 2010 +0300
@@ -138,15 +138,17 @@
final void registeredFinalize()
{
// JDEBUG( "TextEditorListenerImpl.registeredFinalize() +" );
-
- synchronized (iToolkit)
+ if (mFinalizer!=null)
{
- if (iHandle > 0)
+ synchronized (iToolkit)
{
- _dispose(iToolkitInvoker.toolkitGetHandle(iToolkit), iHandle);
-
- iHandle = 0;
+ if (iHandle > 0)
+ {
+ iToolkitInvoker.toolkitDisposeObject(iToolkit,iHandle);
+ iHandle = 0;
+ }
}
+ mFinalizer = null;
}
// JDEBUG( "TextEditorListenerImpl.registeredFinalize() -" );
--- a/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/javax/microedition/lcdui/CanvasGraphicsItemPainter.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc.nokialcdui/javax/microedition/lcdui/CanvasGraphicsItemPainter.java Thu Aug 19 09:48:13 2010 +0300
@@ -263,12 +263,15 @@
*/
final void registeredFinalize()
{
- synchronized (iToolkit)
+ if (mFinalizer != null)
{
- if (iHandle > 0)
+ synchronized (iToolkit)
{
- _dispose(iToolkit.getHandle(), iHandle);
- iHandle = 0;
+ if (iHandle > 0)
+ {
+ iToolkit.disposeObject(iHandle);
+ iHandle = 0;
+ }
}
}
}
--- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Canvas.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Canvas.java Thu Aug 19 09:48:13 2010 +0300
@@ -95,6 +95,7 @@
*/
private boolean iHasBackgroundImage;
private boolean iIsGameCanvas;
+ private Object iPaintLock;
protected Canvas()
{
@@ -140,6 +141,7 @@
}
iM3GContent = false;
+ iPaintLock = new Object();
}
}
@@ -281,7 +283,7 @@
public final void serviceRepaints()
{
- paint();
+ paint(false);
}
// Canvas spec'd to have getWidth() method override.
@@ -355,7 +357,7 @@
protected abstract void paint(Graphics aGraphics);
- private void handlePaint(int aX, int aY, int aWidth, int aHeight)
+ private void handlePaint(int aX, int aY, int aWidth, int aHeight, boolean forced)
{
synchronized (iToolkit)
{
@@ -386,10 +388,10 @@
}
}
- paint();
+ paint(forced);
}
- private void paint()
+ private void paint(boolean forced)
{
Graphics graphics;
int x;
@@ -397,55 +399,58 @@
int w;
int h;
- synchronized (iCallbackLock)
+ synchronized (iPaintLock)
{
- final int width;
- final int height;
-
- //
- // Synchronize to protect the update region from concurrent
- // repaint()'s. Note that this is *not* sufficient to ensure
- // that no other callbacks are called by the event thread
- // whilst the current thread is in the repaint routine, for
- // that we use the callbacklock below.
- //
- synchronized (iToolkit)
+ synchronized (iCallbackLock)
{
- width = iWidth;
- height = iHeight;
+ final int width;
+ final int height;
- x = iRepaintX1;
- y = iRepaintY1;
- w = iRepaintX2-iRepaintX1;
- h = iRepaintY2-iRepaintY1;
+ //
+ // Synchronize to protect the update region from concurrent
+ // repaint()'s. Note that this is *not* sufficient to ensure
+ // that no other callbacks are called by the event thread
+ // whilst the current thread is in the repaint routine, for
+ // that we use the callbacklock below.
+ //
+ synchronized (iToolkit)
+ {
+ width = iWidth;
+ height = iHeight;
- iRepaintX1 = 0;
- iRepaintY1 = 0;
- iRepaintX2 = 0;
- iRepaintY2 = 0;
+ x = iRepaintX1;
+ y = iRepaintY1;
+ w = iRepaintX2-iRepaintX1;
+ h = iRepaintY2-iRepaintY1;
- if (!((w>0) && (h>0) && IsShown()))
- {
- return;
+ iRepaintX1 = 0;
+ iRepaintY1 = 0;
+ iRepaintX2 = 0;
+ iRepaintY2 = 0;
+
+ if (!((w>0) && (h>0) && (IsShown() || forced)))
+ {
+ return;
+ }
+
+ graphics = GetPaintGraphics();
}
- graphics = GetPaintGraphics();
+ graphics.reset(width, height);
+ graphics.setClip(x, y, w, h);
+
+ // On a non-full-screen (normal) mode Canvas the background
+ // image must be initially shown, if the value of the iHasBackgroundImage
+ // is true.
+ if (!iFullScreen && iHasBackgroundImage && !iIsGameCanvas)
+ {
+ drawBackground(true);
+ }
+ paint(graphics);
}
- graphics.reset(width, height);
- graphics.setClip(x, y, w, h);
-
- // On a non-full-screen (normal) mode Canvas the background
- // image must be initially shown, if the value of the iHasBackgroundImage
- // is true.
- if (!iFullScreen && iHasBackgroundImage && !iIsGameCanvas)
- {
- drawBackground(true);
- }
- paint(graphics);
+ flush(x, y, w, h);
}
-
- flush(x, y, w, h);
}
void flush(int aX, int aY, int aWidth, int aHeight)
@@ -569,12 +574,14 @@
switch (aEvent)
{
case Toolkit.EVENT_PAINT:
+ case Toolkit.EVENT_FORCED_PAINT:
{
final int x = aData0 >>> 16;
final int y = aData0 & 0xffff;
final int w = aData1 >>> 16;
final int h = aData1 & 0xffff;
- handlePaint(x, y, w, h);
+ boolean forced = (aEvent == Toolkit.EVENT_FORCED_PAINT);
+ handlePaint(x, y, w, h, forced);
}
break;
--- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Graphics.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Graphics.java Thu Aug 19 09:48:13 2010 +0300
@@ -858,11 +858,6 @@
public void drawChar(char aChar, int aX, int aY, int aAnchor)
{
- if (isDownscaled())
- {
- aX = (aX * iOnScreenWidth) / iWidth;
- aY = (aY * iOnScreenHeight) / iHeight;
- }
// Calling of drawChars with array with size 1.
iChar[0] = aChar;
DrawChars(iChar, 0, 1, aX, aY, aAnchor);
@@ -870,13 +865,6 @@
public void drawChars(char[] aChars,int aOffset,int aLength,int aX,int aY,int aAnchor)
{
- // If is downscaling on, then it downscales drawing point.
- if (isDownscaled())
- {
- aX = (aX * iOnScreenWidth) / iWidth;
- aY = (aY * iOnScreenHeight) / iHeight;
- }
-
synchronized (iBuffer)
{
// Checking if offset and length are correct.
@@ -894,6 +882,12 @@
private void DrawChars(char[] aChars,int aOffset,int aLength,int aX,int aY,int aAnchor)
{
+ // If is downscaling on, then it downscales drawing point.
+ if (isDownscaled())
+ {
+ aX = (aX * iOnScreenWidth) / iWidth;
+ aY = (aY * iOnScreenHeight) / iHeight;
+ }
// checking of anchor or setting default
aAnchor = checkAnchor(aAnchor, STRING_ANCHOR_MASK);
if (isDownscaled())
--- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Image.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Image.java Thu Aug 19 09:48:13 2010 +0300
@@ -450,14 +450,6 @@
start = (long)aOffset + (long)aScanLength*((long)aHeight-1);
}
- //
- // aScanLength may be < 0, hence end < start is valid.
- //
- if ((start < 0) || (start > limit) || (end < 0) || (end > limit))
- {
- throw new ArrayIndexOutOfBoundsException("destination range exceeds array bounds");
- }
-
final int width = iWidth;
final int height = iHeight;
@@ -478,6 +470,15 @@
final String info = "args=("+aX+','+aY+','+aWidth+','+aHeight+"), rect=("+sx1 +','+sy1+','+sx2+','+sy2+"), image width="+width+",height="+height;
throw new IllegalArgumentException("getRGB: Exceeding bounds of source image: " + info);
}
+
+ //
+ // aScanLength may be < 0, hence end < start is valid.
+ //
+ if ((start < 0) || (start > limit) || (end < 0) || (end > limit))
+ {
+ throw new ArrayIndexOutOfBoundsException("destination range exceeds array bounds");
+ }
+
final int scanLength = Math.abs(aScanLength);
if (scanLength < aWidth)
--- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Ticker.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Ticker.java Thu Aug 19 09:48:13 2010 +0300
@@ -28,6 +28,7 @@
private int iHandle;
private String iText;
private Finalizer mFinalizer;
+ private static final int MAX_TICKER_SIZE = 8000; // less than 8KB
public Ticker(String aText)
{
@@ -35,6 +36,11 @@
{
throw new NullPointerException();
}
+ else if (aText.length() > MAX_TICKER_SIZE)
+ {
+ aText = aText.substring(0, MAX_TICKER_SIZE - 1);
+ }
+
mFinalizer = new Finalizer()
{
public void finalizeImpl()
@@ -57,6 +63,11 @@
{
throw new NullPointerException();
}
+ else if (aText.length() > MAX_TICKER_SIZE)
+ {
+ aText = aText.substring(0, MAX_TICKER_SIZE - 1);
+ }
+
synchronized (iToolkit)
{
if (iHandle <= 0) throw new RuntimeException("bad handle");
--- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Toolkit.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/Toolkit.java Thu Aug 19 09:48:13 2010 +0300
@@ -131,6 +131,9 @@
static final int EVET_CANVAS_GRAPHICS_ITEM_REPAINT = 31;
static final int EVENT_M3G_DRAW = 32 ;
+ static final int EVENT_FORCED_PAINT = 33;
+ static final int EVENT_FREE_GPU_MEMORY = 34;
+
// IMPLICIT EVENT TYPES
static final int EVENT_DISMISS = 0; // ALERT
static final int EVENT_ITEM_CHANGED = 0; // ITEM(S)
@@ -261,7 +264,7 @@
InputStream getResourceAsStream(String aResource)
throws
- IOException
+ IOException
{
return getClass().getResourceAsStream(aResource);
}
@@ -554,11 +557,10 @@
break;
case EVENT_FOREGROUND:
iDisplay.handleForeground(true);
- notifyForeground(true);
break;
case EVENT_BACKGROUND:
iDisplay.handleForeground(false);
- notifyForeground(false);
+ notifyFreeGraphicsMemory();
break;
case EVENT_SET_CURRENT:
iDisplay.switchCurrent();
@@ -566,6 +568,9 @@
case EVENT_SERIAL:
iDisplay.processSerialEvents();
break;
+ case EVENT_FREE_GPU_MEMORY:
+ notifyFreeGraphicsMemory();
+ break;
default:
throw new IllegalArgumentException();
}
@@ -573,7 +578,7 @@
}
}
- private synchronized void notifyForeground(boolean foreground)
+ private synchronized void notifyFreeGraphicsMemory()
{
if (null != iObservers)
{
@@ -584,7 +589,7 @@
{
final ToolkitObserverNGAExtension observer =
(ToolkitObserverNGAExtension)iObservers.elementAt(ii);
- observer.foregroundEvent(foreground);
+ observer.freeGraphicsMemory();
}
}
}
--- a/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/ToolkitInvoker.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/javasrc/javax/microedition/lcdui/ToolkitInvoker.java Thu Aug 19 09:48:13 2010 +0300
@@ -287,22 +287,5 @@
}
return ((Graphics)aGraphics).iHandle;
}
-
- /*
- * @see com.nokia.mj.impl.rt.legacy.ToolkitInvoker#isForeground()
- */
- public boolean isForeground()
- {
- Toolkit toolkit = getCurrentToolkit();
- if (toolkit != null)
- {
- Display display = toolkit.getDisplay();
- if (display != null)
- {
- return display.IsForeground();
- }
- }
- return false;
- }
}
--- a/javauis/lcdui_akn/javalcdui/src/CMIDEnv.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/src/CMIDEnv.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -283,6 +283,13 @@
void CMIDEnv::HandleForegroundL(TBool aForeground)
{
+#ifdef RD_JAVA_NGA_ENABLED
+ if (aForeground)
+ {
+ iFullOrPartialFg = ETrue;
+ }
+#endif // RD_JAVA_NGA_ENABLED
+
for (TInt i = iObservers.Count(); i--;)
{
iObservers[i]->HandleForegroundL(aForeground);
@@ -303,9 +310,32 @@
{
iToolkit->Utils()->HandleResourceChangedL();
}
+}
+#ifdef RD_JAVA_NGA_ENABLED
+void CMIDEnv::HandleFullOrPartialForegroundL(TBool aForeground)
+{
+ iFullOrPartialFg = aForeground;
+ for (TInt i = iObservers.Count(); i--;)
+ {
+ iObservers[i]->HandleFullOrPartialForegroundL(aForeground);
+ }
}
+void CMIDEnv::HandleFreeGraphicsMemory()
+{
+ for (TInt i = iObservers.Count(); i--;)
+ {
+ iObservers[i]->HandleFreeGraphicsMemory();
+ }
+}
+
+TBool CMIDEnv::HasFullOrPartialForeground() const
+{
+ return iFullOrPartialFg;
+}
+#endif //RD_JAVA_NGA_ENABLED
+
TInt CMIDEnv::MidletAttribute(const TDesC& aAttributeName, TPtrC& aAttributeValue)
{
return iToolkit->MidletAttribute(aAttributeName,aAttributeValue);
@@ -540,3 +570,8 @@
// for prevereting of panic during changing to new Displayable
iToolkit->DisplayableIsDestructed(aDisplayable);
}
+
+const MMIDDisplayable* CMIDEnv::LastFullscreenDisplayable() const
+{
+ return iToolkit->LastFullscreenDisplayable();
+}
--- a/javauis/lcdui_akn/javalcdui/src/CMIDToLcduiObserver.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/src/CMIDToLcduiObserver.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -75,7 +75,7 @@
//
#ifdef RD_JAVA_NGA_ENABLED
void CMIDToLcduiObserver::RegisterControl(
- CCoeControl& aControl, MDirectContainer* aCallbackContainer /*= NULL*/)
+ CCoeControl& aControl, MDirectContainer* /*aCallbackContainer*/)
#else
void CMIDToLcduiObserver::RegisterControl(CCoeControl& aControl)
#endif
@@ -90,18 +90,6 @@
// Appending of control failed
DEBUG("CMIDToLcduiObserver::RegisterControl - Append failed");
}
-
-#ifdef RD_JAVA_NGA_ENABLED
- if (aCallbackContainer)
- {
- TToLcduiEventData data;
- data.iType = ENotifyContentAdded;
- data.iContainer = aCallbackContainer;
- data.iControl = &aControl;
- data.iConsumer = NULL;
- iEventQueue.Send(data);
- }
-#endif
}
}
@@ -164,7 +152,7 @@
TToLcduiEventData data;
data.iType = EDSAResourcesCallbackEvent;
data.iControl = &aControl;
- data.iConsumer = &aConsumer;
+ data.iConsumer = (void*)&aConsumer;
// Add event to the queue
iEventQueue.Send(data);
@@ -187,7 +175,7 @@
// Prepare event data
TToLcduiEventData data;
data.iType = EUICallbackEvent;
- data.iConsumer = &aConsumer;
+ data.iConsumer = (void*)&aConsumer;
data.iId = aCallbackId;
// Add event to the queue
@@ -215,10 +203,13 @@
DoFlushControl(data.iControl, data.iRect);
break;
case EDSAResourcesCallbackEvent:
- DoInvokeDSAResourcesCallback(data.iControl, data.iConsumer);
+ DoInvokeDSAResourcesCallback(data.iControl, (MUiEventConsumer*)data.iConsumer);
break;
case EUICallbackEvent:
- DoInvokeUICallback(data.iConsumer, data.iId);
+ DoInvokeUICallback((MUiEventConsumer*)data.iConsumer, data.iId);
+ break;
+ case ELcduiEvent:
+ DoInvokeLcduiEvent((MMIDLcduiEventConsumer*)data.iConsumer,data.iId);
break;
#ifdef RD_JAVA_NGA_ENABLED
case ENotifyContentAdded:
@@ -286,6 +277,15 @@
}
}
+void CMIDToLcduiObserver::DoInvokeLcduiEvent(
+ MMIDLcduiEventConsumer* aConsumer,
+ TInt aCallbackId)
+{
+ if (aConsumer)
+ {
+ aConsumer->HandleLcduiEvent(aCallbackId);
+ }
+}
// ---------------------------------------------------------------------------
// CMIDToLcduiObserver::DoInvokeUICallback
@@ -299,6 +299,7 @@
aConsumer->MdcUICallback(aCallbackId);
}
+
#ifdef RD_JAVA_NGA_ENABLED
// ---------------------------------------------------------------------------
// CMIDToLcduiObserver::DoInvokeNotifyContentAdded
@@ -314,3 +315,26 @@
}
}
#endif
+
+// ---------------------------------------------------------------------------
+// CSwtDcObserver::InvokeDcEvent
+// Asynchronously sends an event into a consumer.
+// The call may origin in other than eswt thread.
+// ---------------------------------------------------------------------------
+//
+void CMIDToLcduiObserver::InvokeLcduiEvent(
+ MMIDLcduiEventConsumer& aConsumer,
+ TInt aCallbackId)
+{
+ // Can run in non lcdui thread
+
+ // Prepare event data
+ TToLcduiEventData data;
+ data.iType = ELcduiEvent;
+ data.iConsumer = (void*)&aConsumer;
+ data.iId = aCallbackId;
+
+ // Add event to the queue
+ iEventQueue.Send(data);
+}
+
--- a/javauis/lcdui_akn/javalcdui/src/CMIDToolkit.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/javalcdui/src/CMIDToolkit.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -123,8 +123,8 @@
{
public:
TRevertCurrent(MMIDDisplayable*& aCurrentPointer)
- : iCurrentPointer(aCurrentPointer)
- , iPrevious(aCurrentPointer)
+ : iCurrentPointer(aCurrentPointer)
+ , iPrevious(aCurrentPointer)
{
}
static void Revert(TAny*);
@@ -166,8 +166,8 @@
* CONSTRUCTION PHASE 1 . Java side.
*/
CMIDToolkit::CMIDToolkit()
- : iPhase(EPhase1)
- , iOldFullScreenDisplayable(NULL), iObjects(EGranularity), iSentToBgTime(0), mFirst(ETrue)
+ : iPhase(EPhase1)
+ , iOldFullScreenDisplayable(NULL), iObjects(EGranularity), iSentToBgTime(0), mFirst(ETrue)
{
LCDUI_DEBUG_INT("CMIDToolkit::CMIDToolkit(%d) CONSTRUCTION PHASE 1", (TInt)this);
iFinalizeMutex.CreateLocal();
@@ -249,6 +249,18 @@
iEnv->HandleSwitchOnL(ETrue);
}
+#ifdef RD_JAVA_NGA_ENABLED
+void CMIDToolkit::HandleFullOrPartialForegroundL(TBool aFullOrPartialFg)
+{
+ iEnv->HandleFullOrPartialForegroundL(aFullOrPartialFg);
+}
+
+void CMIDToolkit::HandleFreeGraphicsMemory()
+{
+ iEnv->HandleFreeGraphicsMemory();
+}
+#endif
+
/**
* CONSTRUCTION PHASE 2.
* Java Side.
@@ -276,9 +288,9 @@
iHandleDisplayEvent = aJni.GetMethodID(clz, "handleDisplayEvent", "(Ljavax/microedition/lcdui/Toolkit;IIII)V");
iHandleNotifyMethod = aJni.GetMethodID(clz, "handleAsyncEvent", "(Ljava/lang/Object;I)V");
iHandleCanavsGraphicsItemPainterEvent = aJni.GetMethodID(
- clz,
- "handleCanvasGraphicsItemPainterEvent",
- "(Ljavax/microedition/lcdui/CanvasGraphicsItemPainter;IIII)V");
+ clz,
+ "handleCanvasGraphicsItemPainterEvent",
+ "(Ljavax/microedition/lcdui/CanvasGraphicsItemPainter;IIII)V");
aJni.DeleteLocalRef(clz);
@@ -390,6 +402,17 @@
iEnv->SetUtils(iUtils);
}
+MMIDCanvas* CMIDToolkit::GetCurrentCanvas() const
+{
+ MMIDCanvas* ret = NULL;
+ MMIDComponent* content = iCurrentDisplayable ? iCurrentDisplayable->Component() : NULL;
+ if (content && content->Type() == MMIDComponent::ECanvas)
+ {
+ ret = static_cast<MMIDCanvas*>(content);
+ }
+ return ret;
+}
+
//
// Enables events
//
@@ -397,7 +420,7 @@
{
iOpen=ETrue;
SetTaskListEntry(ETrue);
- RLcdui::Get()->Plugin()->SetObserver(this);
+ RLcdui::Get()->Plugin()->SetObserverL(this);
iCoeEnv->RootWin().EnableReceiptOfFocus(ETrue);
}
@@ -578,14 +601,26 @@
TBool isCanvas = EFalse;
TBool isCanvasReadyToBlit = EFalse;
+ TBool isFullscreenUI = ETrue;
if (content)
{
- if (content->Type() == MMIDComponent::ECanvas)
+ MMIDComponent::TType contentType = content->Type();
+
+ if (contentType == MMIDComponent::ECanvas)
{
isCanvas = ETrue;
MMIDCanvas* canvas = static_cast<MMIDCanvas*>(content);
isCanvasReadyToBlit = canvas->ReadyToBlit();
}
+ else
+ {
+ if (contentType == MMIDComponent::EAlert ||
+ (contentType == MMIDComponent::ETextBox &&
+ iCurrentDisplayable->IsPopupTextBox()))
+ {
+ isFullscreenUI = EFalse;
+ }
+ }
}
if (!content || !isCanvas || isCanvasReadyToBlit)
@@ -594,7 +629,8 @@
{
iCurrentDisplayable->DrawNow();
}
- appUi->stopStartScreen();
+
+ appUi->stopStartScreen(isFullscreenUI);
}
}
}
@@ -685,6 +721,13 @@
iGrLibrary.Close();
+ // Null MMIDEnv pointer from CMIDAppUi before
+ // destroying iEnv
+ if (RLcdui::Get()->Plugin())
+ {
+ RLcdui::Get()->Plugin()->SetEnv(NULL);
+ }
+
delete iEnv;
iEnv = NULL;
}
@@ -734,6 +777,17 @@
break;
}
+#ifdef RD_JAVA_NGA_ENABLED
+ // Notify canvas about exit, so that canvas MIDlets
+ // get system effect in exit
+ MMIDCanvas* canvas = GetCurrentCanvas();
+ if (canvas)
+ {
+ canvas->MidletExiting();
+ }
+#endif // RD_JAVA_NGA_ENABLED
+
+
// Always use exit effect when exiting midlet
GfxTransEffect::BeginFullScreen(AknTransEffect::EApplicationExit, TRect(),
AknTransEffect::EParameterType, AknTransEffect::GfxTransParam(iAppUid));
@@ -765,7 +819,8 @@
if (RLcdui::Get()->Plugin())
{
- RLcdui::Get()->Plugin()->SetObserver(NULL);
+ // The leave can occur only when starting MIDlet
+ TRAP_IGNORE(RLcdui::Get()->Plugin()->SetObserverL(NULL));
}
DestroyUi();
@@ -899,8 +954,8 @@
}
CMIDToolkit::TObjectEntry::TObjectEntry(MMIDComponent* aComponent)
- : iComponent(aComponent)
- , iDisposed(NULL)
+ : iComponent(aComponent)
+ , iDisposed(NULL)
{
}
@@ -969,7 +1024,7 @@
}
CMIDletSuite::CMIDletSuite()
- :iAttributes()
+ :iAttributes()
{
}
--- a/javauis/lcdui_akn/lcdgd/build/lcdc16ma.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/build/lcdc16ma.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -35,11 +35,10 @@
OPTION ARMCC -Otime
ALWAYS_BUILD_AS_ARM
+APP_LAYER_SYSTEMINCLUDE
+
USERINCLUDE ../inc
-SYSTEMINCLUDE ../inc
-SYSTEMINCLUDE /epoc32/include/ecom
-SYSTEMINCLUDE ../../../../inc
-APP_LAYER_SYSTEMINCLUDE
+USERINCLUDE ../../../../inc
SOURCEPATH ../src
SOURCE lcdc16ma.cpp
--- a/javauis/lcdui_akn/lcdgd/build/lcdc16mu.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/build/lcdc16mu.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -35,12 +35,11 @@
OPTION ARMCC -Otime
ALWAYS_BUILD_AS_ARM
-USERINCLUDE ../inc
-SYSTEMINCLUDE ../inc
-SYSTEMINCLUDE /epoc32/include/ecom
-SYSTEMINCLUDE ../../../../inc
APP_LAYER_SYSTEMINCLUDE
+USERINCLUDE ../inc
+USERINCLUDE ../../../../inc
+
SOURCEPATH ../src
SOURCE lcdc16mu.cpp
SOURCE lcdbitblt.cpp
--- a/javauis/lcdui_akn/lcdgd/build/lcdc4k.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/build/lcdc4k.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -36,12 +36,11 @@
OPTION ARMCC -Otime
ALWAYS_BUILD_AS_ARM
-USERINCLUDE ../inc
-SYSTEMINCLUDE ../inc
-SYSTEMINCLUDE ../../../../inc
-SYSTEMINCLUDE /epoc32/include/ecom
APP_LAYER_SYSTEMINCLUDE
+USERINCLUDE ../inc
+USERINCLUDE ../../../../inc
+
SOURCEPATH ../src
SOURCE lcdc4k.cpp
SOURCE lcd16bpp.cpp
--- a/javauis/lcdui_akn/lcdgd/build/lcdc64k.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/build/lcdc64k.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -35,11 +35,11 @@
OPTION ARMCC -Otime
ALWAYS_BUILD_AS_ARM
-USERINCLUDE ../inc
-SYSTEMINCLUDE /epoc32/include/ecom
-SYSTEMINCLUDE ../../../../inc
APP_LAYER_SYSTEMINCLUDE
+USERINCLUDE ../inc
+USERINCLUDE ../../../../inc
+
SOURCEPATH ../src
SOURCE lcdc64k.cpp
SOURCE lcd16bpp.cpp
--- a/javauis/lcdui_akn/lcdgd/build/lcdgdrv.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/build/lcdgdrv.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -31,8 +31,6 @@
APP_LAYER_SYSTEMINCLUDE
USERINCLUDE ../inc
-SYSTEMINCLUDE ../inc
-SYSTEMINCLUDE /epoc32/include
SOURCEPATH ../src
SOURCE lcdgdrv.cpp
--- a/javauis/lcdui_akn/lcdgd/build/lcdgdrvi.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/build/lcdgdrvi.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -34,9 +34,9 @@
OPTION ARMCC -Otime
ALWAYS_BUILD_AS_ARM
+APP_LAYER_SYSTEMINCLUDE
+
USERINCLUDE ../inc
-SYSTEMINCLUDE ../inc
-APP_LAYER_SYSTEMINCLUDE
SOURCEPATH ../src
SOURCE lcdgdrvi.cpp
--- a/javauis/lcdui_akn/lcdgd/resource/10208162.RSS Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/resource/10208162.RSS Thu Aug 19 09:48:13 2010 +0300
@@ -19,7 +19,7 @@
//
// Color64K plugin registration resource file.
//
-#include <registryinfov2.rh>
+#include <ecom/registryinfov2.rh>
#include "lcdgd.hrh"
RESOURCE REGISTRY_INFO r_registry
--- a/javauis/lcdui_akn/lcdgd/resource/10208164.RSS Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/resource/10208164.RSS Thu Aug 19 09:48:13 2010 +0300
@@ -19,7 +19,7 @@
//
// Color4K plugin registration resource file.
//
-#include <registryinfov2.rh>
+#include <ecom/registryinfov2.rh>
#include "lcdgd.hrh"
RESOURCE REGISTRY_INFO r_registry
--- a/javauis/lcdui_akn/lcdgd/resource/10208166.RSS Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/resource/10208166.RSS Thu Aug 19 09:48:13 2010 +0300
@@ -19,7 +19,7 @@
//
// Color16MU plugin registration resource file.
//
-#include <registryinfov2.rh>
+#include <ecom/registryinfov2.rh>
#include "lcdgd.hrh"
RESOURCE REGISTRY_INFO r_registry
--- a/javauis/lcdui_akn/lcdgd/resource/10208168.RSS Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/resource/10208168.RSS Thu Aug 19 09:48:13 2010 +0300
@@ -19,7 +19,7 @@
//
// Color16MA plugin registration resource file.
//
-#include <registryinfov2.rh>
+#include <ecom/registryinfov2.rh>
#include "lcdgd.hrh"
RESOURCE REGISTRY_INFO r_registry
--- a/javauis/lcdui_akn/lcdgd/src/lcdc16ma.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/src/lcdc16ma.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
#include <graphicsaccelerator.h>
-#include <implementationproxy.h>
+#include <ecom/implementationproxy.h>
#include "lcdgdrvif.h"
#include "lcdtransform.h"
--- a/javauis/lcdui_akn/lcdgd/src/lcdc16mu.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/src/lcdc16mu.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
#include <graphicsaccelerator.h>
-#include <implementationproxy.h>
+#include <ecom/implementationproxy.h>
#include "lcdgdrvif.h"
#include "lcdtransform.h"
--- a/javauis/lcdui_akn/lcdgd/src/lcdc4k.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/src/lcdc4k.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
#include <graphicsaccelerator.h>
-#include <implementationproxy.h>
+#include <ecom/implementationproxy.h>
#include <j2me/jdebug.h>
--- a/javauis/lcdui_akn/lcdgd/src/lcdc64k.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgd/src/lcdc64k.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
#include <graphicsaccelerator.h>
-#include <implementationproxy.h>
+#include <ecom/implementationproxy.h>
#include <j2me/jdebug.h>
--- a/javauis/lcdui_akn/lcdgr/build/lcdgr.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgr/build/lcdgr.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -78,11 +78,10 @@
APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE ../inc
-
-SYSTEMINCLUDE ../../inc
-SYSTEMINCLUDE ../../../inc
-SYSTEMINCLUDE ../../../../inc
+USERINCLUDE ../inc
+USERINCLUDE ../../inc
+USERINCLUDE ../../../inc
+USERINCLUDE ../../../../inc
LIBRARY avkon.lib
LIBRARY gdi.lib
--- a/javauis/lcdui_akn/lcdgr/inc/CMIDGraphics.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgr/inc/CMIDGraphics.h Thu Aug 19 09:48:13 2010 +0300
@@ -147,7 +147,7 @@
* @see MMIDComponentNgaExtension#IsEglAvailable()
* @since S60 9.2
*/
- virtual TBool IsEglAvailable();
+ virtual TBool IsEglAvailable() const;
/**
* @see MMIDComponentNgaExtension#BindEglSurface()
--- a/javauis/lcdui_akn/lcdgr/src/CMIDGraphics.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgr/src/CMIDGraphics.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -587,7 +587,7 @@
// CMIDGraphics::IsEglAvailable()
// ---------------------------------------------------------------------------
//
-TBool CMIDGraphics::IsEglAvailable()
+TBool CMIDGraphics::IsEglAvailable() const
{
return (iCanvasTarget ? iCanvasTarget->IsEglAvailable() : EFalse);
}
--- a/javauis/lcdui_akn/lcdgr/src/LcdGraphics.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdgr/src/LcdGraphics.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -613,7 +613,11 @@
TPoint start;
TPoint end;
ArcVectors(start, end, rect, aStartAngle, aArcAngle);
- iContext->DrawPie(rect,start,end);
+ // Ignore very small arc
+ if (aArcAngle >= 180 || (Abs(start.iX - end.iX) > 2 || Abs(start.iY - end.iY) > 2))
+ {
+ iContext->DrawPie(rect, start, end);
+ }
}
}
@@ -845,7 +849,7 @@
iSurface->End(iCount);
CHECK_BITMAP_LOCK();
-
+
// MMIDCanvas::DrawBackground modifies settings of iContext.
// Reset pen and brush settings here, so they
// are re-applied again when needed.
--- a/javauis/lcdui_akn/lcdui/build/lcdui.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/build/lcdui.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -112,14 +112,13 @@
TARGETPATH private/10003a3f/apps
END
-SYSTEMINCLUDE ../inc
-
-SYSTEMINCLUDE ../../inc
-SYSTEMINCLUDE ../../../inc
-SYSTEMINCLUDE ../../../../inc
-SYSTEMINCLUDE ../../../../inc/j2me
-SYSTEMINCLUDE ../../../../inc/j2me/midp2/data
-SYSTEMINCLUDE ../../../../inc/j2me/midp2/security
+USERINCLUDE ../inc
+USERINCLUDE ../../inc
+USERINCLUDE ../../../inc
+USERINCLUDE ../../../../inc
+USERINCLUDE ../../../../inc/j2me
+USERINCLUDE ../../../../inc/j2me/midp2/data
+USERINCLUDE ../../../../inc/j2me/midp2/security
// LCDUI had dependencies to apps layer
@@ -212,6 +211,7 @@
LIBRARY libEGL.lib
LIBRARY libGLESv1_CM.lib
LIBRARY alfdecoderserverclient.lib
+LIBRARY goommonitor.lib
#endif // RD_JAVA_NGA_ENABLED
NOSTRICTDEF
--- a/javauis/lcdui_akn/lcdui/inc/CMIDAppUi.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDAppUi.h Thu Aug 19 09:48:13 2010 +0300
@@ -56,13 +56,24 @@
void SetEnv(MMIDEnv& aEnv);
void UnSetEnv();
+ void SetPauseAppState(TBool aState);
+ TBool GetPauseAppState();
private:
// MLcduiPlugin
- void SetObserver(MMIDObserver* aObserver);
+ void SetObserverL(MMIDObserver* aObserver);
MMIDComponentFactory* CreateComponentFactoryL();
-
+ // This will be called from Toolkit before it deletes CMIDEnv
+ void SetEnv(MMIDEnv* aEnv);
+#ifdef RD_JAVA_NGA_ENABLED
+ /**
+ * Handle graphics out of memory event sent by the GOOM module.
+ * This method releases graphics memory and informs the GOOM about this.
+ * @return <code>ETrue</code> if the event was handled properly.
+ */
+ TBool HandleGoomMemoryLowEventL();
+#endif // RD_JAVA_NGA_ENABLED
private: // data
MMIDObserver* iObserver;
@@ -72,6 +83,9 @@
MMIDEnv* iEnv;
CMIDDisplayable* iCurrentDisplayable;
+ // To store orientation change before Observer is set.
+ TBool iPendingOrientationChange;
+ TBool iPauseApp;
};
#endif // CMIDAPPUI_H
--- a/javauis/lcdui_akn/lcdui/inc/CMIDCanvas.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDCanvas.h Thu Aug 19 09:48:13 2010 +0300
@@ -134,6 +134,7 @@
public MMIDCanvas,
public MMIDBufferProcessor,
public MDirectContainer,
+ public MMIDLcduiEventConsumer,
#ifdef CANVAS_DIRECT_ACCESS
public MDirectScreenAccess,
#endif
@@ -583,6 +584,17 @@
void MdcNotifyContentAdded();
#endif
+ /**
+ * From MDirectContainer.
+ *
+ * @since S60 v9.2
+ * @param TBool aEnableFix
+ */
+ void MdcFixUIOrientation(TBool aEnableFix);
+
+// From MMIDLcduiEventConsumer
+public:
+ void HandleLcduiEvent(int aType);
// from base class MMIDMediaKeysListener
@@ -709,6 +721,14 @@
*/
TBool IsFullScreen() const;
+ /**
+ * Returns the drawing rectangle.
+ *
+ * @since java 2.1
+ * @return The rectangle where canvas draws.
+ */
+ inline const TRect ViewRect() const;
+
#ifdef RD_JAVA_S60_RELEASE_9_2
/**
* Gets a Displayable from the container.
@@ -1050,7 +1070,11 @@
* returns EFalse.
*/
TBool IsNetworkIndicatorEnabledL() const;
-
+#ifdef RD_JAVA_NGA_ENABLED
+ TBool IsDownScaling(const TSize& aSourceSize, const TRect& aDestRect,TBool aM3GContent) const;
+#else
+ TBool IsDownScaling(const TSize& aSourceSize, const TRect& aDestRect) const;
+#endif //RD_JAVA_NGA_ENABLED
public:
/**
* Handles switching from foreground to
@@ -1059,6 +1083,23 @@
*/
void HandleForeground(TBool aForeground);
+#ifdef RD_JAVA_NGA_ENABLED
+ /**
+ * Motification about MIDlet's changed full or partial foreground status.
+ * @param aFullOrPartialFg ETrue, when full or partial foreground was gained.
+ * EFalse, when foreground was fully lost.
+ * @param aCurrentDisplayable ETrue, if canvas is the current displayable
+ */
+ void HandleFullOrPartialForegroundL(TBool aFullOrPartialFg, TBool aCurrentDisplayable);
+
+ /**
+ * Frees all GPU memory that is reserved by Canvas.
+ * @param aForced If ETrue, memory is freed without checking window visibility
+ * If EFalse, memory is freed if canvas window is invisible.
+ */
+ void FreeGraphicsMemory(TBool aForced);
+#endif
+
private:
/** States of the first paint */
enum TFirstPainState {
@@ -1120,7 +1161,7 @@
* @see MMIDComponentNgaExtension#IsEglAvailable()
* @since S60 9.2
*/
- TBool IsEglAvailable();
+ TBool IsEglAvailable() const;
/**
* @see MMIDComponentNgaExtension#BindEglSurface()
@@ -1166,6 +1207,10 @@
*/
void UpdateRect(const TRect& aRect);
+ /**
+ * @see MMIDCanvas::MidletExiting()
+ */
+ void MidletExiting();
private:
/**
* Blits pbuffer surface scaled to window surface
@@ -1207,9 +1252,11 @@
/**
* Releases EGL resources
+ * @param aReadback Defines if surface content is copied to bitmap before
+ * destroying surface
* @since S60 9.2
*/
- void CloseEgl();
+ void CloseEgl(TBool aReadback);
/**
* Creates EGL context
@@ -1243,9 +1290,10 @@
/**
* Handles size changed. EGL window surface needs to be recreated
* if window size increases.
+ * @param aOrientationChange ETrue, method is called because of orientation change
* @since S60 9.2
*/
- void HandleSizeChanged();
+ void HandleSizeChanged(TBool aOrientationChange);
/**
* Draws frame buffer 2D content as OpenGL texture in case of
@@ -1333,6 +1381,25 @@
*/
void ClearUiSurface(TBool aDrawing);
+ /**
+ * Draws current canvas content to CWindowGc.
+ * @since S60 9.2
+ */
+ void DrawToWindowGc();
+
+ /**
+ * Checks if canvas window is currently really visible on screen.
+ * Used for checking when canvas should destroy its surfaces.
+ * @since S60 9.2
+ */
+ TBool IsWindowVisible() const;
+
+ /**
+ * Posts forced paint event to Java side. Forced paint causes Canvas.paint() to be
+ * called, event if Displayable.isShown() would return false in Java. See also Canvas.java.
+ * @since S60 9.2
+ */
+ void PostForcedPaint();
#endif // RD_JAVA_NGA_ENABLED
private: // data
@@ -1561,11 +1628,6 @@
*/
TRect iOldContentBounds;
- /**
- * The startup trace should be done only once.
- */
- mutable TBool iStartUpTraceDone;
-
// The list of registered custom components.
RPointerArray< MMIDCustomComponent > iCustomComponents;
@@ -1637,6 +1699,10 @@
* Reset to EFalse in CloseEgl().
*/
TBool iM3GContent;
+ /**
+ * Previously Flag of iM3GContent
+ */
+ mutable TBool iPrevM3GContent;
/**
* ETrue, while M3G has bound to canvas EGL surface.
@@ -1703,6 +1769,10 @@
GLshort* iVertexArray;
GLubyte* iTriangleStrip;
+ /**
+ * ETrue, when midlet is exiting and this canvas is the current displayable
+ */
+ TBool iExiting;
#endif // RD_JAVA_NGA_ENABLED
/**
@@ -1737,6 +1807,11 @@
*aDst++ = (argb >> 24) & 0xFFu;
}
}
+
+inline const TRect CMIDCanvas::ViewRect() const
+{
+ return iViewRect;
+}
#endif // RD_JAVA_NGA_ENABLED
#endif // CMIDCANVAS_H
--- a/javauis/lcdui_akn/lcdui/inc/CMIDCanvasGraphicsItem.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDCanvasGraphicsItem.h Thu Aug 19 09:48:13 2010 +0300
@@ -74,7 +74,6 @@
*/
virtual ~CMIDCanvasGraphicsItem();
-
public: // From MMIDCustomComponent
/**
@@ -163,6 +162,15 @@
*/
void HandleResourceChange(TInt aType);
+ /**
+ * Handles switching from foreground to background and vice versa.
+ *
+ * @param aForeground Flag if it switches to foreground or to backgound.
+ *
+ * @since S60 5.0
+ */
+ void HandleForeground(TBool aForeground);
+
public: // From MMIDScalable
TBool IsScalingOn() const;
@@ -269,6 +277,14 @@
* @since S60 5.0
*/
void Dispose();
+public: // Own methods
+
+ /**
+ * Removes this component from component container
+ * when its painter being disposed first (during finalization)
+ */
+ void CMIDCanvasGraphicsItem::DeregisterCanvasGraphicsItem();
+
private: // own methods
/**
--- a/javauis/lcdui_akn/lcdui/inc/CMIDCanvasKeypad.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDCanvasKeypad.h Thu Aug 19 09:48:13 2010 +0300
@@ -170,7 +170,7 @@
*
* @since S60 5.0
*/
- void InitializeKeys();
+ void InitializeKeysL();
/**
* Sets key event struct for each button.
--- a/javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupListBox.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDChoiceGroupListBox.h Thu Aug 19 09:48:13 2010 +0300
@@ -83,6 +83,7 @@
*/
void SingleClickDisableHighlightL(TBool aDisable);
void SetHighlight(TBool aVisible);
+ TBool GetHighlight();
#endif // RD_JAVA_S60_RELEASE_9_2
--- a/javauis/lcdui_akn/lcdui/inc/CMIDCustomItem.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDCustomItem.h Thu Aug 19 09:48:13 2010 +0300
@@ -35,6 +35,7 @@
#include "CMIDTactileFeedbackExtension.h"
#endif //RD_TACTILE_FEEDBACK
+
// FORWARD DECLARATIONS
class CMIDRemConObserver;
class CMIDKeyDecoder;
@@ -48,7 +49,7 @@
#ifdef RD_TACTILE_FEEDBACK
, public MMIDTactileFeedbackComponent
#endif // RD_TACTILE_FEEDBACK
-
+ , public MMIDLcduiEventConsumer
{
public:
static CMIDCustomItem* NewL(MMIDEnv& aEnv, const TDesC& aLabel, CMIDUIManager* aUIManager);
@@ -231,6 +232,18 @@
void MdcRemoveContentBounds(const TRect& aRect);
void MdcGetDSAResources(MUiEventConsumer& aConsumer);
void MdcGetUICallback(MUiEventConsumer& aConsumer, TInt aCallbackId);
+
+ /**
+ * From MDirectContainer.
+ *
+ * @since S60 v9.2
+ * @param TBool aEnableFix
+ */
+ void MdcFixUIOrientation(TBool aEnableFix);
+
+// From MMIDLcduiEventConsumer
+public:
+ void HandleLcduiEvent(int aType);
// From MMIDMediaKeysListener
public:
@@ -335,6 +348,13 @@
* from another than MMAPI ES thread.
*/
TPoint iLastWindowPosition;
+
+ /**
+ * using for Items on Form
+ * checking if Form was created
+ */
+ TBool iUiFixed;
+ TBool iUiToBeFixedLater;
};
--- a/javauis/lcdui_akn/lcdui/inc/CMIDDisplayable.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDDisplayable.h Thu Aug 19 09:48:13 2010 +0300
@@ -37,14 +37,13 @@
#include <AknsDrawUtils.h>// skin
// for backgroud control context (iBackGroundControlContext)
#include <AknsBasicBackgroundControlContext.h> //skin
+#include <aknappui.h>
#include "CMIDCommand.h"
// API needed for working with commands and command list (setting, getting, handling)
#include "CMIDCommandList.h"
// using CMIDMenuHandler::TMenuType
#include "CMIDMenuHandler.h"
-// using TMidpCustomEvents enumeration
-#include "S60LCDUICustomEvents.h"
#include "CMIDCanvasKeypad.h"
#include <e32property.h>
@@ -70,7 +69,7 @@
// Container for MIDlet Displayables.
NONSHARABLE_CLASS(CMIDDisplayable) : public CEikBorderedControl, public MMIDDisplayable,
- public MMIDEnvObserver, public MAknLongTapDetectorCallBack, public MEikMenuObserver
+public MMIDEnvObserver, public MAknLongTapDetectorCallBack, public MEikMenuObserver
{
public:
@@ -142,6 +141,10 @@
void HandleSwitchOnL(TBool aSwitchOn);
void HandleForegroundL(TBool aForeground);
void HandleResourceChangeL(TInt aType);
+#ifdef RD_JAVA_NGA_ENABLED
+ void HandleFullOrPartialForegroundL(TBool aFullOrPartialFg);
+ void HandleFreeGraphicsMemory();
+#endif
// Title handling
TBool HasTitle() const;
@@ -162,10 +165,13 @@
void InitializeCbasL();
void SetCba(CEikButtonGroupContainer* aCba);
TBool ShowOkOptionsMenuL();
+ TBool ShowScreenOrHelpOptionsMenuL();
TInt NumCommandsForOkOptionsMenu() const;
+ TInt NumCommandsForScreenOrHelpOptionsMenu() const;
TInt GetHighestPriorityScreenOrHelpCommand() const;
void SetItemCommandList(CMIDCommandList* aList, CMIDCommand* aMSKCommand);
void SetMSKCommand(CMIDCommand* aMSKCommand);
+
/**
* Stores select command to Displayable
* @param aSelectCommand a command used in MSK and in menu
@@ -311,6 +317,33 @@
* @since S60 5.0
*/
void ProcessMSKCommandL();
+ /**
+ * Enum callback type
+ * @since S60 9.2
+ */
+ enum TLcduiUiCallbackType
+ {
+ EFixUIOrientation,
+ EUnFixUIOrientation
+ };
+
+ /**
+ * Fix orientation from MMA
+ *
+ * @return void
+ *
+ * @since S60 9.2
+ */
+ void FixOrientation();
+
+ /**
+ * Release orientation from MMA
+ *
+ * @return void
+ *
+ * @since S60 9.2
+ */
+ void ReleaseOrientation();
private:
// Construction and destruction
@@ -332,7 +365,7 @@
void HandleStandardCommandL(const TCommandEntry& aCmdEntry);
void HandleItemCommandL(const TCommandEntry& aCmdEntry);
TInt GetInternalCommandIdFor(CMIDCommand* aCommand) const;
- void GetOkOptionsMenuCommands(RPointerArray<CMIDCommand>& aCommands) const;
+ void GetOkOptionsMenuCommandsL(RPointerArray<CMIDCommand>& aCommands) const;
void ResetSoftKeysAndCommands(const RArray<CMIDCommandList*>& aLists);
// Visual layouting and updating
@@ -355,14 +388,14 @@
* Default ctor
*/
TDirectContentsRect()
- : iRefCount(0) {}
+ : iRefCount(0) {}
/**
* Ctor
* @param aRect Rectangle
*/
TDirectContentsRect(const TRect& aRect)
- : iRect(aRect), iRefCount(1) {}
+ : iRect(aRect), iRefCount(1) {}
TRect iRect;
TInt iRefCount;
@@ -444,6 +477,12 @@
void HideIndicator(CEikStatusPane* aSp, TInt aId);
void HideIndicators();
+ /**
+ * If content control is CMIDCanvas, returns pointer to it, NULL otherwise.
+ * @since S60 9.2
+ */
+ CMIDCanvas* GetContentCanvas();
+
private:
CMIDAppUi* iAppUi;
CMIDUIManager* iUIManager;
@@ -559,7 +598,10 @@
// Indicates opened split screen keyboard
TBool iSplitScreenKeyboard;
#endif // RD_JAVA_S60_RELEASE_9_2
-
+
+ TBool iRestoreOrientation;
+ CAknAppUiBase::TAppUiOrientation iOldUiOrientation;
+ TInt iReleaseCnt;
};
--- a/javauis/lcdui_akn/lcdui/inc/CMIDForm.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDForm.h Thu Aug 19 09:48:13 2010 +0300
@@ -395,6 +395,7 @@
static TBool IsGaugeItem(CMIDControlItem& aControlItem);
static TBool IsTextFieldItem(CMIDControlItem& aControlItem);
static TBool IsChoiceGroup(CMIDControlItem& aControlItem);
+ static TBool IsPopupChoiceGroup(CMIDControlItem& aControlItem);
static TBool IsDateField(CMIDControlItem& aControlItem);
static TBool IsLabelContainerItem(CMIDControlItem& aControlItem);
static TBool IsSpacerUsedForFormatting(CMIDControlItem& aControlItem);
@@ -403,6 +404,8 @@
#ifdef RD_JAVA_S60_RELEASE_9_2
public:
void PostPendingUpEventL();
+ TInt FormRowIndex(CMIDFormRow* aRow);
+ CMIDFormRow* FormRow(TInt aIndex);
#endif // RD_JAVA_S60_RELEASE_9_2
private:
--- a/javauis/lcdui_akn/lcdui/inc/CMIDFormRow.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDFormRow.h Thu Aug 19 09:48:13 2010 +0300
@@ -44,6 +44,9 @@
public: // From CCoeControl
TInt CountComponentControls() const;
CCoeControl* ComponentControl(TInt aIndex) const;
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ void Draw(const TRect& /*aRect*/) const;
+#endif // RD_JAVA_S60_RELEASE_9_2
virtual void SizeChanged();
virtual TSize MinimumSize();
@@ -70,6 +73,13 @@
private:
CMIDFormRow(CMIDForm& aForm);
void ConstructL();
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ /**
+ * Checks whether the separator line must be drawn
+ * above this form row.
+ */
+ void SetSeparator();
+#endif // RD_JAVA_S60_RELEASE_9_2
private:
CMIDForm& iForm;
@@ -77,6 +87,13 @@
RArray<CMIDControlItem*> iItems;
TSize iEmptyRowSize; // size used for empty rows
TInt iCurrentWidth; // used when adding items to the row. Keeps track of the total width of items added to row
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ /**
+ * Separator line is drawn between Form rows (except between Form rows that
+ * belong together e.g. concatenated StringItems).
+ */
+ TBool iSeparator;
+#endif // RD_JAVA_S60_RELEASE_9_2
};
--- a/javauis/lcdui_akn/lcdui/inc/CMIDGaugeItem.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDGaugeItem.h Thu Aug 19 09:48:13 2010 +0300
@@ -38,6 +38,7 @@
class CEikProgressInfo;
class CAknSlider;
class CAknBitmapAnimation;
+class CAknsFrameBackgroundControlContext;
/** This interface is implemented by the alert dialog (CMIDAlertDialog). The current
design is such that the alert dialog uses its own animations (loaded from resource)
@@ -295,6 +296,8 @@
void SetGaugeListenerFromAlert(MMIDGaugeToAlertListner* aGaugeToAlertListner);
+ TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
+
private:
/**
* Ctor
@@ -358,6 +361,16 @@
*/
TBool BitmapAnimationUsed() const;
+ /**
+ * Gets new correct instance of control context or null.
+ *
+ * @return New instance of CAknsFrameBackgroundControlContext.
+ * Instance maybe a null.
+ *
+ * @since S60 v5.0
+ */
+ CAknsFrameBackgroundControlContext* BackgroundControlContext();
+
private:
CEikProgressInfo* iProgressInfo;
MMIDGaugeToAlertListner* iGaugeToAlertListner;
--- a/javauis/lcdui_akn/lcdui/inc/CMIDItemLabel.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDItemLabel.h Thu Aug 19 09:48:13 2010 +0300
@@ -91,6 +91,7 @@
void ResolutionChange();
TInt ItemLabelMargin();
void AdjustToSizeL(const TSize& aSize);
+ void LayoutItemLabel();
private:
CMIDItemLabel(TInt aMaxWidth, TBool aLabelBeforeContent, TInt aMaxNumberOfLines,
--- a/javauis/lcdui_akn/lcdui/inc/CMIDKeyDecoder.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDKeyDecoder.h Thu Aug 19 09:48:13 2010 +0300
@@ -20,6 +20,7 @@
#define CMIDKEYDECODER_H
#include <e32base.h>
+#include <e32svr.h>
#include <lcdui.h>
// CMIDQwertyWatch* iQwertyWatch
--- a/javauis/lcdui_akn/lcdui/inc/CMIDTextBoxQueryDialog.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDTextBoxQueryDialog.h Thu Aug 19 09:48:13 2010 +0300
@@ -269,6 +269,7 @@
//
void UpdateLeftSoftKeyL();
TBool OkToExitL(TInt aButtonId);
+ void PreLayoutDynInitL();
private:
/**
--- a/javauis/lcdui_akn/lcdui/inc/CMIDTextEditor.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDTextEditor.h Thu Aug 19 09:48:13 2010 +0300
@@ -681,6 +681,15 @@
void HandleResourceChange(TInt aType);
/**
+ * Handles switching from foreground to background and vice versa.
+ *
+ * @param aForeground Flag if it switches to foreground or to backgound.
+ *
+ * @since S60 5.0
+ */
+ void HandleForeground(TBool aForeground);
+
+ /**
* Sets the caret in the Editor at x, y location.
*
* @param x
--- a/javauis/lcdui_akn/lcdui/inc/CMIDUtils.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/inc/CMIDUtils.h Thu Aug 19 09:48:13 2010 +0300
@@ -373,9 +373,15 @@
void UpdatePTIEngineStatusL();
#ifdef RD_INTELLIGENT_TEXT_INPUT
+
#ifdef RD_JAVA_S60_RELEASE_5_0_IAD
void CallToJavaPtiVariationL(TInt aType);
-#endif //RD_JAVA_S60_RELEASE_5_0_IAD
+#endif //RD_JAVA_S60_RELEASE_5_0_IAD
+
+ /**
+ * Function sets keyboard type/layout for Pti engine
+ */
+ void SetPtiKeyboardL();
#endif //RD_INTELLIGENT_TEXT_INPUT
private:
@@ -409,6 +415,8 @@
RLibrary iPtiSupportLib;
#endif //RD_JAVA_S60_RELEASE_5_0_IAD
+ // Storing current pti keyboard type/layout
+ TInt iPtiKeyboardType;
#endif // RD_INTELLIGENT_TEXT_INPUT
TInt iQwertyMode;
--- a/javauis/lcdui_akn/lcdui/inc/S60LCDUICustomEvents.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: ?Description
-*
-*/
-
-
-#ifndef S60LCDUICUSTOMEVENTS_H
-#define S60LCDUICUSTOMEVENTS_H
-
-enum TMidpCustomEvents // dialog line ids
-{
- EEnableMultipleKeyPressedEvent = 7539, // try it use all the odd numbers
- EDisableMultipleKeyPressedEvent
-};
-
-
-#endif // S60LCDUICUSTOMEVENTS_H
-
--- a/javauis/lcdui_akn/lcdui/src/CMIDAppUi.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDAppUi.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -15,7 +15,6 @@
*
*/
-
#include <eikenv.h>
#include <eiksrvc.h>
#include <eikappui.h>
@@ -25,14 +24,15 @@
#include <javaregistryentry.h>
#include <javaregistry.h>
#include <javaattribute.h>
-
+#ifdef RD_JAVA_NGA_ENABLED
+#include <goommonitorsession.h>
+#include <goommonitorplugin.hrh>
+#endif // RD_JAVA_NGA_ENABLED
#include "CMIDAppUi.h"
// using CMIDApplication API for iApp
#include "CMIDApplication.h"
// needed for creating CMIDComponentFactory
#include "CMIDComponentFactory.h"
-// constants for repeating key events
-#include "S60LCDUICustomEvents.h"
// CMIDDisplayable class for iCurrentDisplayable
#include "CMIDDisplayable.h"
@@ -44,7 +44,8 @@
using namespace Java;
// class CMIDAppUi
-CMIDAppUi::CMIDAppUi() : iCurrentDisplayable(NULL)
+CMIDAppUi::CMIDAppUi() : iCurrentDisplayable(NULL),
+ iPendingOrientationChange(EFalse), iPauseApp(EFalse)
{
mJavaAppUi = java::ui::CoreUiAvkonLcdui::getInstance().getJavaAknAppUi();
mCoreAppUi = java::ui::CoreUiAvkonLcdui::getInstance().getJavaUiAppUi();
@@ -132,22 +133,16 @@
}
else
{
- //
- //
- //
+ if (aType == KEikDynamicLayoutVariantSwitch)
+ {
+ // Observer not set yet. Storing it for use after it is set.
+ iPendingOrientationChange= ETrue;
+ }
}
}
-void CMIDAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& /*aEvent*/)
+void CMIDAppUi::HandleApplicationSpecificEventL(TInt /*aType*/, const TWsEvent& /*aEvent*/)
{
- if (EEnableMultipleKeyPressedEvent == aType)
- {
- mCoreAppUi->glueSetKeyBlockMode(ENoKeyBlock);
- }
- else if (EDisableMultipleKeyPressedEvent == aType)
- {
- mCoreAppUi->glueSetKeyBlockMode(EDefaultBlockMode);
- }
}
TBool CMIDAppUi::HandleWsEventL(const TWsEvent& aEvent,
@@ -174,24 +169,35 @@
if (aEvent.Type() == EEventUser)
{
- if ((*reinterpret_cast<TApaSystemEvent*>(aEvent.EventData())) == EApaSystemEventShutdown)
+ TApaSystemEvent* eventData = reinterpret_cast<TApaSystemEvent*>(aEvent.EventData());
+ if ((*eventData) == EApaSystemEventShutdown)
{
+#ifdef RD_JAVA_NGA_ENABLED
+ // Check the reason
+ eventData++;
+ if ((*eventData) == KGoomMemoryLowEvent)
+ {
+ return HandleGoomMemoryLowEventL();
+ }
+#endif // RD_JAVA_NGA_ENABLED
// Oom or exit from task-list. Ask the CoreUi to shutdown the MIDlet.
java::ui::CoreUiAvkonLcdui::getInstance().shutDownRequestFromWindowServer();
}
}
// Workaround to send pauseApp with long-press of the Menu key
+ // if no event was send yet
if (aEvent.Type() == EEventKey)
{
if (aEvent.Key()->iScanCode == EStdKeyApplication0
- && aEvent.Key()->iRepeats == 1)
+ && aEvent.Key()->iRepeats == 1 && !iPauseApp)
{
if (iEnv && iEnv->MidletAttributeIsSetToVal(
LcduiMidletAttributes::KAttribFlipClose,
LcduiMidletAttributeValues::KPauseValue))
{
iEnv->PostMidletEvent(EPause);
+ SetPauseAppState(ETrue);
}
}
}
@@ -233,6 +239,13 @@
if ((aEvent.Type() == KAknFullOrPartialForegroundLost)
|| (aEvent.Type() == EEventFocusLost))
{
+#ifdef RD_JAVA_NGA_ENABLED
+ if (aEvent.Type() == KAknFullOrPartialForegroundLost && iObserver)
+ {
+ iObserver->HandleFullOrPartialForegroundL(EFalse);
+ }
+#endif // RD_JAVA_NGA_ENABLED
+
if (iCurrentDisplayable && (iDisplayables.Count() > 0))
{
iCurrentDisplayable->HandleApplicationBackground();
@@ -248,6 +261,13 @@
}
}
+#ifdef RD_JAVA_NGA_ENABLED
+ if (aEvent.Type() == KAknFullOrPartialForegroundGained && iObserver)
+ {
+ iObserver->HandleFullOrPartialForegroundL(ETrue);
+ }
+#endif // RD_JAVA_NGA_ENABLED
+
return EFalse;
}
@@ -262,12 +282,36 @@
iEnv = 0;
}
+#ifdef RD_JAVA_NGA_ENABLED
+TBool CMIDAppUi::HandleGoomMemoryLowEventL()
+{
+ if (iObserver)
+ {
+ iObserver->HandleFreeGraphicsMemory();
+ RGOomMonitorSession session;
+ User::LeaveIfError(session.Connect());
+ session.ThisAppIsNotExiting(CCoeEnv::Static()->RootWin().Identifier());
+ session.Close();
+ return ETrue;
+ }
+ return EFalse;
+}
+#endif // RD_JAVA_NGA_ENABLED
+
//
// From MLcduiPlugin
//
-void CMIDAppUi::SetObserver(MMIDObserver* aObserver)
+void CMIDAppUi::SetObserverL(MMIDObserver* aObserver)
{
iObserver = aObserver;
+ if (iPendingOrientationChange)
+ {
+ // We have received orientation change during the construction phase.
+ // Resending it again in order to ensure correct layout and
+ // orientation.
+ iObserver->HandleResourceChangeL(KEikDynamicLayoutVariantSwitch);
+ iPendingOrientationChange = EFalse;
+ }
}
//
@@ -278,6 +322,14 @@
return new(ELeave) CMIDComponentFactory;
}
+//
+// From MLcduiPlugin
+//
+void CMIDAppUi::SetEnv(MMIDEnv* aEnv)
+{
+ iEnv = aEnv;
+}
+
RPointerArray<CMIDDisplayable>& CMIDAppUi::Displayables()
{
return iDisplayables;
@@ -319,3 +371,15 @@
return mJavaAppUi->StatusPane();
}
+void CMIDAppUi::SetPauseAppState(TBool aState)
+{
+ JELOG2(EJavaUI);
+ iPauseApp = aState;
+}
+
+TBool CMIDAppUi::GetPauseAppState()
+{
+ JELOG2(EJavaUI);
+ return iPauseApp;
+}
+
--- a/javauis/lcdui_akn/lcdui/src/CMIDCanvas.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDCanvas.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -134,6 +134,16 @@
TRect iRect;
};
+// ---------------------------------------------------------------------------
+// TLcduiEvent
+// ---------------------------------------------------------------------------
+//
+enum TLcduiEvent
+{
+ EFixUIOrientation,
+ EUnFixUIOrientation,
+ EVideoAdded
+};
// ======== LOCAL FUNCTIONS ========
@@ -159,9 +169,15 @@
// @param aDestRect Destination rect.
// ---------------------------------------------------------------------------
//
-inline TBool IsDownScaling(const TSize& aSourceSize, const TRect& aDestRect, TBool aM3GContent)
+TBool CMIDCanvas::IsDownScaling(const TSize& aSourceSize, const TRect& aDestRect,TBool aM3GContent) const
{
// if m3G is drawing then downscaling is turn off
+ // Send event in case of the M3G draw.
+ if (iM3GContent != iPrevM3GContent)
+ {
+ PostEvent(EM3GDraw, iM3GContent, 0);
+ }
+ iPrevM3GContent=iM3GContent;
if (aM3GContent)
{
return EFalse;
@@ -176,7 +192,7 @@
// @param aSourceSize Source rect size.
// @param aDestRect Destination rect.
// ---------------------------------------------------------------------------
-inline TBool IsDownScaling(const TSize& aSourceSize, const TRect& aDestRect)
+TBool CMIDCanvas::IsDownScaling(const TSize& aSourceSize, const TRect& aDestRect) const
{
return (aSourceSize.iWidth > aDestRect.Width() ||
aSourceSize.iHeight > aDestRect.Height());
@@ -304,7 +320,7 @@
}
#ifdef RD_JAVA_NGA_ENABLED
- CloseEgl();
+ CloseEgl(EFalse);
DisposePixelSource();
delete[] iTexturePixels;
delete[] iVertexArray;
@@ -832,9 +848,9 @@
TInt& /* aCycles */,
java::util::Monitor* aMonitor)
{
- if (!iForeground)
- {
- DEBUG("CMIDCanvas::ProcessL() - not foreground");
+
+ if (!iForeground && iFirstPaintState == EFirstPaintNeverOccurred)
+ {
ASSERT(!iAlfMonitor);
aRead = aEnd;
return EFalse;
@@ -844,9 +860,12 @@
{
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)
+ iDirectContents.Count() == 0 &&
+ IsWindowVisible())
{
DEBUG("CMIDCanvas::ProcessL - M3G content start");
iM3GContent = ETrue;
@@ -911,7 +930,7 @@
return iFrameReady;
}
-#else // RD_JAVA_NGA_ENABLED
+#else // RD_JAVA_NGA_ENABLED
// ---------------------------------------------------------------------------
// From class MMIDBufferProcessor.
@@ -1090,11 +1109,9 @@
PostEvent(EPaint, posPacked, sizePacked);
}
- // If is added first direct content, then NGA is switched off
- // and move of iViewRect is needed.
- if (iFullScreen && iScalingOn && iDirectContents.Count() == 1)
- {
- iViewRect.Move(-iPositionRelativeToScreen);
+ if (iDirectContents.Count() > 0)
+ {
+ iEnv.ToLcduiObserver().InvokeLcduiEvent(*this, EVideoAdded);
}
#endif // RD_JAVA_NGA_ENABLED
}
@@ -1117,14 +1134,6 @@
if (iDirectContents.Count() == 0)
{
iRestoreContentWhenUnfaded = EFalse;
-#ifdef RD_JAVA_NGA_ENABLED
- // If is removed last direct content, then NGA is switched on
- // and move of iViewRect is needed.
- if (iScalingOn && iFullScreen)
- {
- iViewRect.Move(iPositionRelativeToScreen);
- }
-#endif // RD_JAVA_NGA_ENABLED
}
}
}
@@ -1284,11 +1293,55 @@
//
void CMIDCanvas::MdcNotifyContentAdded()
{
- DisposePixelSource();
- CloseEgl();
+ // no implementation
}
#endif // RD_JAVA_NGA_ENABLED
+// ---------------------------------------------------------------------------
+// From class MDirectContainer.
+// CMIDCanvas::MdcFixUIOrientation(TBool aEnableFix)
+// ---------------------------------------------------------------------------
+//
+void CMIDCanvas::MdcFixUIOrientation(TBool aEnableFix)
+{
+ if (aEnableFix)
+ {
+ iEnv.ToLcduiObserver().InvokeLcduiEvent(*this, EFixUIOrientation);
+ }
+ else
+ {
+ iEnv.ToLcduiObserver().InvokeLcduiEvent(*this, EUnFixUIOrientation);
+ }
+}
+
+// ---------------------------------------------------------------------------
+// From class MMIDLcduiEventConsumer.
+// CMIDCanvas::HandleLcduiEvent(int aType)
+// ---------------------------------------------------------------------------
+//
+void CMIDCanvas::HandleLcduiEvent(int aType)
+{
+ if (!iDisplayable)
+ {
+ return;
+ }
+
+ switch (aType)
+ {
+ case EFixUIOrientation:
+ iDisplayable->FixOrientation();
+ break;
+ case EUnFixUIOrientation:
+ iDisplayable->ReleaseOrientation();
+ break;
+ case EVideoAdded:
+#ifdef RD_JAVA_NGA_ENABLED
+ DisposePixelSource();
+ CloseEgl(IsGameCanvas());
+#endif // RD_JAVA_NGA_ENABLED
+ break;
+ }
+}
// ---------------------------------------------------------------------------
// From class MMIDMediaKeysListener.
@@ -1399,7 +1452,7 @@
{
DEBUG("CMIDCanvas::RegisterComponentL, registering new");
- iCustomComponents.Append(aComponent);
+ iCustomComponents.AppendL(aComponent);
// Update custom components count in order to improve
// the performance when counting components
@@ -1523,12 +1576,7 @@
// Remove the old index from the components array.
iCustomComponents.Remove(index);
- // Add the component to the new index. Note that the array
- // should contain memory for all the components since
- // Remove should not decrease the memory used by the array
- // Therefore, the following operation is leave-safe and
- // return value is ignored intentionally.
- iCustomComponents.Insert(aComponent, aNewIndex);
+ iCustomComponents.InsertL(aComponent, aNewIndex);
// Redraw the whole canvas.
DrawDeferred();
@@ -1577,19 +1625,34 @@
//
void CMIDCanvas::UpdateL(const TRect& aRect)
{
+ if (!IsWindowVisible())
+ {
+ return;
+ }
+
+ // Don't update screen after canvas size has been changed,
+ // if there is no valid content from Java side yet
+ if (iWndUpdate &&
+ (iContentSize.iWidth > aRect.Size().iWidth ||
+ iContentSize.iHeight > aRect.Size().iHeight))
+ {
+ return;
+ }
+
+ iWndUpdate = EFalse;
+
// Drawing Network indicator only when Update is called.
if (iFullScreen && iNetworkIndicator)
{
iNetworkIndicator->SetDrawIndicator(ETrue);
}
- // iRestoreContentWhenUnfaded is used when Canvas should be faded
- // DrawNow need to be called, otherwise Canvas will be unfaded
- if (iDirectContents.Count() == 0 && !iRestoreContentWhenUnfaded && IsFocused())
+ if (iDirectContents.Count() == 0)
{
// In case direct content content was removed
// from canvas, recreate pixel source here
- if (!iAlfCompositionPixelSource && !IsEglAvailable())
+ if (!iAlfCompositionPixelSource &&
+ !IsEglAvailable())
{
InitPixelSourceL();
}
@@ -1606,9 +1669,8 @@
{
DrawNow(aRect);
}
-#ifdef RD_JAVA_NGA_ENABLED
+
iCoeEnv->WsSession().Finish();
-#endif
if (iFirstPaintState == EFirstPaintInitiated ||
iFirstPaintState == EFirstPaintPrepared)
@@ -1624,12 +1686,6 @@
}
}
- // This is needed to avoid artifacting after orientation switch.
- // It is called once after orientation change.
- if (iWndUpdate)
- {
- iWndUpdate = EFalse;
- }
}
#else // !RD_JAVA_NGA_ENABLED
@@ -1779,16 +1835,6 @@
}
else // M3G content, use EGL surface
{
- // Invalidates window so that wserv does not
- // draw window content on top our EGL surface.
- // This is needed only once when starting to use EGL surface.
- if (iM3GStart)
- {
- DEBUG("CMIDCanvas::DrawWindow - invalidate");
- Window().Invalidate();
- iM3GStart = EFalse;
- }
-
if (iScalingOn && iFullScreen)
{
SetCurrentEglType(EEglPbuffer);
@@ -1815,6 +1861,16 @@
SetCurrentEglType(EEglNone);
+ // Invalidates window so that wserv does not
+ // draw window content on top our EGL surface.
+ // This is needed only once when starting to use EGL surface.
+ if (iM3GStart)
+ {
+ DEBUG("CMIDCanvas::DrawWindow - invalidate");
+ Window().Invalidate();
+ iM3GStart = EFalse;
+ }
+
if (iFirstPaintState != EFirstPaintOccurred)
{
iFirstPaintState = EFirstPaintOccurred;
@@ -2122,10 +2178,17 @@
TBool partialVKBOpen = (aType == KAknSplitInputEnabled);
if (partialVKBOpen != iPartialVKBOpen)
{
+ // setting member variable
iPartialVKBOpen = partialVKBOpen;
+
+ // First we need inform focused item, after other.
+ iCustomComponents[iFocusedComponent]->HandleResourceChange(aType);
for (int i = 0; i < iCustomComponents.Count(); i++)
{
- iCustomComponents[i]->HandleResourceChange(aType);
+ if (i != iFocusedComponent)
+ {
+ iCustomComponents[i]->HandleResourceChange(aType);
+ }
}
}
}
@@ -2136,7 +2199,7 @@
{
// We need inform TextEditor that input language is changed.
if ((iFocusedComponent != KComponentFocusedNone) &&
- (iFocusedComponent < iCustomComponents.Count()))
+ (iFocusedComponent < iCustomComponents.Count()))
{
iCustomComponents[iFocusedComponent]->
CustomComponentControl(KComponentMainControl)->
@@ -2321,16 +2384,6 @@
// iContentSize.iHeight - 1)
point -= iViewRect.iTl;
-#ifdef RD_JAVA_NGA_ENABLED
- // If NGA is started and scaling is on then the drawing rectangle
- // is moved. Them we need move pointer events too.
- if (iFullScreen && iScalingOn && iDirectContents.Count() == 0)
- {
- // Fix coordinates
- point += iPositionRelativeToScreen;
- }
-#endif // RD_JAVA_NGA_ENABLED
-
if (javaMaxCoords != nativeMaxCoords)
{
point.iX = (point.iX * javaMaxCoords.iWidth) /
@@ -2477,7 +2530,7 @@
#ifdef RD_JAVA_NGA_ENABLED
// To avoid situation when Canvas is redrawn but black area remains
- if (iAlfCompositionPixelSource)
+ if (iAlfCompositionPixelSource && iDirectContents.Count() == 0)
{
TRAPD(err, ActivatePixelSourceL(EFalse));
if (err != KErrNone)
@@ -2512,7 +2565,7 @@
// To remove cursor on focused control.
if ((iFocusedComponent != KComponentFocusedNone) &&
- (iFocusedComponent < iCustomComponents.Count()) &&
+ (iFocusedComponent < iCustomComponents.Count()) &&
iCustomComponents[iFocusedComponent]->
CustomComponentControl(KComponentMainControl)->IsVisible())
{
@@ -2521,14 +2574,13 @@
SetFocus(EFalse);
}
-#ifdef RD_JAVA_NGA_ENABLED
- // Avoid the situation when the content is drawn over the menu
- SuspendPixelSource();
-#endif // RD_JAVA_NGA_ENABLED
-
// Repaint to ensure that fading will be displayed correctly for Alert
- // or PopupTextBox when DSA is paused.
- DrawDeferred();
+ // or PopupTextBox when DSA is paused. No redraw, if canvas is using
+ // background surfaces i.e. EGL or pixel source
+ if (iDirectContents.Count() > 0)
+ {
+ DrawDeferred();
+ }
}
DEBUG("- CMIDCanvas::FocusChanged");
@@ -2579,12 +2631,42 @@
if ((contentSize != iContentSize) || iScalingOn)
{
+#ifdef RD_JAVA_NGA_ENABLED
+ TSize oldContentSize = iContentSize;
iContentSize = contentSize;
-#ifdef RD_JAVA_NGA_ENABLED
- HandleSizeChanged();
+ TBool landscape = Layout_Meta_Data::IsLandscapeOrientation();
+
+ if (IsWindowVisible() &&
+ (oldContentSize.iWidth < iContentSize.iWidth ||
+ oldContentSize.iHeight < iContentSize.iHeight ||
+ landscape != iLandscape))
+ {
+ iWndUpdate = ETrue;
+ if (IsEglAvailable())
+ {
+ // Clear with black to avoid incorrectly sized
+ // surface flashing on screen in orientation switch
+ TRgb color(KOpaqueBlackColor);
+ ClearEglSurface(EEglWindow, &color);
+ }
+ }
+
+ HandleSizeChanged(landscape != iLandscape);
+ iLandscape = landscape;
+
+ PostEvent(ESizeChanged, iContentSize.iWidth, iContentSize.iHeight);
+
+ if (IsWindowVisible() && iWndUpdate)
+ {
+ // Post forced paint to enable Canvas repaint behind
+ // Alert or Pop-up TextBox
+ PostForcedPaint();
+ }
+#else
+ iContentSize = contentSize;
+ PostEvent(ESizeChanged, iContentSize.iWidth, iContentSize.iHeight);
#endif // RD_JAVA_NGA_ENABLED
- PostEvent(ESizeChanged, iContentSize.iWidth, iContentSize.iHeight);
}
#ifdef CANVAS_DIRECT_ACCESS
@@ -2631,50 +2713,39 @@
//
void CMIDCanvas::Draw(const TRect& aRect) const
{
- if (!iStartUpTraceDone)
- {
- java::util::JavaOsLayer::startUpTrace("MIDP: CMIDCanvas::Draw starts", -1, -1);
- }
DEBUG("CMIDCanvas::Draw ++");
- // While changing the orientation method DrawWindow() not called,
- // variable iWndUpdate is set to True. If iWndUpdate is True
- // DrawWindow() is called from method Update()
- // This is needed to avoid artifacting after orientation switch.
- TBool landscape = Layout_Meta_Data::IsLandscapeOrientation();
-
- if (iLandscape != landscape && !iAlfCompositionPixelSource)
- {
- iLandscape = landscape;
- iWndUpdate = ETrue;
+ if (iWndUpdate)
+ {
+ return;
+ }
+
+ if (iDirectContents.Count() > 0)
+ {
+ DrawWindow(aRect);
}
else
{
- // iRestoreContentWhenUnfaded is used when Canvas should be faded
- // DrawWindow need to be called, otherwise Canvas will be unfaded
- // Sometimes iRestoreContentWhenUnfaded is not set yet and Canvas
- // already lost focus, then IsFocused is used
- if (iDirectContents.Count() > 0 || iRestoreContentWhenUnfaded || !IsFocused())
+ CMIDCanvas* myself = const_cast<CMIDCanvas*>(this);
+
+ if (IsEglAvailable())
{
- DrawWindow(aRect);
+ myself->ClearUiSurface(ETrue);
+ }
+ else if (iAlfCompositionPixelSource)
+ {
+ myself->ClearUiSurface(ETrue);
+ TRAP_IGNORE(myself->ActivatePixelSourceL(ETrue));
}
else
{
- CMIDCanvas* myself = const_cast<CMIDCanvas*>(this);
- myself->ClearUiSurface(ETrue);
- if (iAlfCompositionPixelSource)
- {
- TRAP_IGNORE(myself->ActivatePixelSourceL(ETrue));
- }
+ // This is the case when M3G midlet is
+ // coming back to foreground and EGL
+ // surface is not re-created yet
+ DrawWindow(aRect);
}
- iWndUpdate = EFalse;
- }
-
- if (!iStartUpTraceDone)
- {
- java::util::JavaOsLayer::startUpTrace("MIDP: CMIDCanvas::Draw ends", -1, -1);
- iStartUpTraceDone = ETrue;
- }
+ }
+
DEBUG("CMIDCanvas::Draw --");
}
#else // !RD_JAVA_NGA_ENABLED
@@ -2687,10 +2758,6 @@
//
void CMIDCanvas::Draw(const TRect& aRect) const
{
- if (!iStartUpTraceDone)
- {
- java::util::JavaOsLayer::startUpTrace("MIDP: CMIDCanvas::Draw starts", -1, -1);
- }
DEBUG("+ CMIDCanvas::Draw");
#ifdef CANVAS_DOUBLE_BUFFER
@@ -2744,11 +2811,6 @@
#endif // CANVAS_DOUBLE_BUFFER
#endif // CANVAS_ASYNC_PAINT
- if (!iStartUpTraceDone)
- {
- java::util::JavaOsLayer::startUpTrace("MIDP: CMIDCanvas::Draw ends", -1, -1);
- iStartUpTraceDone = ETrue;
- }
DEBUG("- CMIDCanvas::Draw");
}
#endif // RD_JAVA_NGA_ENABLED
@@ -2952,7 +3014,7 @@
iEnv.IsHardwareAcceleratedL(MMIDEnv::EHardware3D) > 0;
InitPixelSourceL();
-#endif // RD_JAVA_NGA_ENABLED
+#endif // RD_JAVA_NGA_ENABLED
#ifdef RD_JAVA_S60_RELEASE_9_2
iPartialVKBOpen = EFalse;
@@ -2980,6 +3042,7 @@
iDisplayable = (CMIDDisplayable*) &aWindow;
CCoeControl::SetContainerWindowL(aWindow);
Window().SetBackgroundColor();
+ MakeVisible(aWindow.IsVisible());
#ifdef RD_SCALABLE_UI_V2
Window().SetPointerGrab(ETrue);
@@ -3188,16 +3251,6 @@
if (iFullScreen)
{
-#ifdef RD_JAVA_NGA_ENABLED
- // If both NGA and scaling are on, then iViewRect is needed move
- // for preverifing wrong position of Canvas.
- if (iScalingOn && (!iFullScreen || iDirectContents.Count() == 0))
- {
- // Translate to screen coordinates.
- rect.Move(iPositionRelativeToScreen);
- }
-#endif // RD_JAVA_NGA_ENABLED
-
if (iNetworkIndicator)
{
// Refresh the layout data for network indicator.
@@ -3208,13 +3261,6 @@
// orientation.
TSize orientedOrgMIDletScrSize(OrientedOrgMIDletScrSize());
- // If Nokia-MIDlet-Target-Display-Size is defined, Canvas will be
- // scaled to that size.
- if (iTargetMIDletScrSize != KZeroSize)
- {
- viewSize = iTargetMIDletScrSize;
- }
-
#ifdef RD_JAVA_S60_RELEASE_9_2
// If partial VKB is open then MIDlet is not scaled.
// That we need set iViewRect to whole size of Canvas.
@@ -3222,8 +3268,15 @@
{
viewSize = Size();
}
-#endif //RD_JAVA_S60_RELEASE_9_2
-
+ else if (iTargetMIDletScrSize != KZeroSize)
+#else
+ if (iTargetMIDletScrSize != KZeroSize)
+#endif //RD_JAVA_S60_RELEASE_9_2
+ {
+ // If Nokia-MIDlet-Target-Display-Size is defined, Canvas will be
+ // scaled to that size.
+ viewSize = iTargetMIDletScrSize;
+ }
// If optional JAD parameter Nokia-MIDlet-Target-Display-Size is NOT
// defined and Nokia-MIDlet-Original-Display-Size is defined to
// smaller size than the device's screen size, we will scale the
@@ -3322,14 +3375,6 @@
#ifdef CANVAS_DIRECT_ACCESS
StartDirectAccess();
#endif // CANVAS_DIRECT_ACCESS
-#ifdef RD_JAVA_NGA_ENABLED
- // To avoid situation when Orientation was changed and black screen is shown
- TRAPD(err, UpdateL(iViewRect));
- if (err != KErrNone)
- {
- DEBUG_INT("CMIDCanvas::Layout - update error %d", err);
- }
-#endif // RD_JAVA_NGA_ENABLED
TInt contentsCount(iDirectContents.Count());
@@ -3565,25 +3610,22 @@
{
DEBUG_INT("CMIDCanvas::HandleForeground(%d) ++", aForeground);
+ // If foreground/background state is changed,
+ // then we need resize all custom components.
+ if (iForeground != aForeground && iCustomComponents.Count() > 0)
+ {
+ for (int i = 0; i < iCustomComponents.Count(); i++)
+ {
+ iCustomComponents[i]->HandleForeground(aForeground);
+ }
+ }
+
iForeground = aForeground;
#ifdef RD_JAVA_NGA_ENABLED
- if (!iForeground)
- {
- if (IsEglAvailable())
- {
- if (iEglOccupied)
- {
- DEBUG("CMIDCanvas::HandleForeground() - egl - pending dispose");
- iEglPendingDispose = ETrue;
- }
- else
- {
- CloseEgl();
- }
- }
-
- SuspendPixelSource();
+ if (!aForeground)
+ {
+ FreeGraphicsMemory(EFalse);
}
#endif // RD_JAVA_NGA_ENABLED
@@ -3591,6 +3633,60 @@
}
#ifdef RD_JAVA_NGA_ENABLED
+// ---------------------------------------------------------------------------
+// CMIDCanvas::HandleFullOrPartialForegroundL
+// ---------------------------------------------------------------------------
+//
+void CMIDCanvas::HandleFullOrPartialForegroundL(
+ TBool aFullOrPartialFg, TBool aCurrentDisplayable)
+{
+ if (!aFullOrPartialFg && aCurrentDisplayable)
+ {
+ FreeGraphicsMemory(ETrue);
+ }
+ else if (!iPrevM3GContent && iAlfCompositionPixelSource)
+ {
+ SuspendPixelSource();
+ ActivatePixelSourceL(ETrue);
+ }
+}
+
+// ---------------------------------------------------------------------------
+// CMIDCanvas::FreeGraphicsMemory
+// Free GPU memory if the canvas is not visible anymore. If aForced is true,
+// visibility is not checked.
+// ---------------------------------------------------------------------------
+//
+void CMIDCanvas::FreeGraphicsMemory(TBool aForced)
+{
+ // No freeing in exit case to avoid flickering
+ if ((!aForced && IsWindowVisible()) || iExiting)
+ {
+ return;
+ }
+
+ if (IsEglAvailable())
+ {
+ if (iEglOccupied)
+ {
+ DEBUG("CMIDCanvas::FreeGraphcisMemory() - egl - pending dispose");
+ iEglPendingDispose = ETrue;
+ }
+ else
+ {
+ CloseEgl(ETrue);
+ // If MIDlet is not visible on foreground post event to Java
+ // so that M3G is notfied and frees the m3gCore memory
+ if (!iEnv.HasFullOrPartialForeground())
+ {
+ iEnv.PostMidletEvent(EFreeGraphicsMemory);
+ eglReleaseThread();
+ }
+ }
+ }
+
+ SuspendPixelSource();
+}
// ---------------------------------------------------------------------------
// CMIDCanvas::InitPixelSourceL()
@@ -3668,8 +3764,14 @@
return;
}
- // ProduceNewFrameL() is called in some cases
- // directly from ActivateSyncL(), need to set iFrameReady
+ // Don't activate, if there is no valid content from Java yet
+ if (!ReadyToBlit())
+ {
+ return;
+ }
+
+ // ProduceNewFrameL() is called directly from ActivateSyncL()
+ // if pixel source is suspended, need to set iFrameReady
// before ActivateSyncL()
iFrameReady = ETrue;
TRAPD(err, iAlfCompositionPixelSource->ActivateSyncL());
@@ -3681,11 +3783,21 @@
if (iPixelSourceSuspended)
{
- ClearUiSurface(aDrawingOngoing);
iPixelSourceSuspended = EFalse;
if (iFullScreen && iScalingOn)
{
- iAlfCompositionPixelSource->SetExtent(iViewRect, KPhoneScreen);
+ TRect targetRect = iViewRect;
+ targetRect.Move(iPositionRelativeToScreen);
+ iAlfCompositionPixelSource->SetExtent(targetRect, KPhoneScreen);
+ // Flag is set to in order that screen gets updated at least once
+ // after SetExtent() call
+ iFrameReady = ETrue;
+ }
+
+ if (!aDrawingOngoing)
+ {
+ ClearUiSurface(aDrawingOngoing);
+ iCoeEnv->WsSession().Finish();
}
}
}
@@ -3705,14 +3817,53 @@
gc.SetBrushColor(KTransparentClearColor);
gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
gc.Clear();
+
+ // Clearing is done via EGL in scaled M3G case
+ if (iScalingOn && iFullScreen && !IsEglAvailable())
+ {
+ const TRect rect = Rect();
+ if (rect != iViewRect)
+ {
+ gc.SetBrushColor(KRgbBlack);
+ gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
+ DrawUtils::ClearBetweenRects(gc, rect, iViewRect);
+ }
+ }
+
if (!aDrawing)
{
DeactivateGc();
Window().EndRedraw();
}
+}
+
+// ---------------------------------------------------------------------------
+// CMIDCanvas::DrawToWindowGc
+// Draws current frame buffer content to CWindowGc
+// ---------------------------------------------------------------------------
+//
+void CMIDCanvas::DrawToWindowGc()
+{
+ if (iDirectContents.Count() > 0 ||
+ !IsWindowVisible() ||
+ !iForeground)
+ {
+ return;
+ }
+
+ Window().BeginRedraw();
+ ActivateGc();
+
+ TRect rect = (iFullScreen && iScalingOn) ? iViewRect : Rect();
+ DrawWindow(rect);
+
+ DeactivateGc();
+ Window().EndRedraw();
+
iCoeEnv->WsSession().Finish();
}
+// ---------------------------------------------------------------------------
// CMIDCanvas::SuspendPixelSource
// ---------------------------------------------------------------------------
//
@@ -3976,7 +4127,7 @@
// Destroys EGL contexts and surfaces.
// ---------------------------------------------------------------------------
//
-void CMIDCanvas::CloseEgl()
+void CMIDCanvas::CloseEgl(TBool aReadback)
{
DEBUG("CMIDCanvas::CloseEglL() ++");
@@ -3992,9 +4143,8 @@
// MIDlet might draw only 2D after this =>
// need to set frame buffer opaque to be compatible with
- // blending methods in Lcdgd. UpdateOffScreenBitmapL() does this
- // for GameCanvas.
- if (!IsGameCanvas() && iFrameContext)
+ // blending methods in Lcdgd. UpdateOffScreenBitmapL() does this too.
+ if (!aReadback && iFrameContext)
{
iFrameContext->SetBrushColor(KOpaqueClearColor);
iFrameContext->SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
@@ -4002,10 +4152,13 @@
}
// Take a snapshot from window surface to the frame buffer.
- TRAPD(err, UpdateOffScreenBitmapL(EFalse));
- if (err != KErrNone)
- {
- DEBUG("CMIDCanvas::CloseEgl() - UpdateOffScreenBitmapL() failed");
+ if (aReadback)
+ {
+ TRAPD(err, UpdateOffScreenBitmapL(ETrue));
+ if (err != KErrNone)
+ {
+ DEBUG("CMIDCanvas::CloseEgl() - UpdateOffScreenBitmapL() failed");
+ }
}
// make sure the we have no current target
@@ -4139,7 +4292,7 @@
// next ProcessL() when M3G_CONTENT_START is recieved from Java side.
// ---------------------------------------------------------------------------
//
-void CMIDCanvas::HandleSizeChanged()
+void CMIDCanvas::HandleSizeChanged(TBool aOrientationChange)
{
DEBUG("CMIDCanvas::HandleSizeChanged ++");
@@ -4149,7 +4302,8 @@
{
TSize surfaceSize = GetEglSurfaceSize(iEglWindowSurface);
TSize controlSize = Size();
- if (surfaceSize.iHeight < controlSize.iHeight ||
+ if (aOrientationChange ||
+ surfaceSize.iHeight < controlSize.iHeight ||
surfaceSize.iWidth < controlSize.iWidth)
{
// Check if egl surface is currently occupied.
@@ -4157,14 +4311,14 @@
{
// Delayed resizing. It is done when the ReleaseEglSurface method
// is called.
- DEBUG("CMIDCanvas::HandleSizeChanged - egl - resize pending");
iEglPendingResize = ETrue;
}
else
{
- DEBUG("CMIDCanvas::SizeChanged - close egl");
// Surface recreation is done in next ProcessL() call
- CloseEgl();
+ // No readback from EGL, because canvas needs to
+ // repaint itself anyway in new size
+ CloseEgl(EFalse);
}
}
}
@@ -4211,7 +4365,7 @@
// Return ETrue, if EGL based drawing is in use.
// ---------------------------------------------------------------------------
//
-TBool CMIDCanvas::IsEglAvailable()
+TBool CMIDCanvas::IsEglAvailable() const
{
return (iEglWindowSurface != EGL_NO_SURFACE);
}
@@ -4253,14 +4407,18 @@
if (iEglPendingDispose)
{
DEBUG("CMIDCanvas::ReleaseEglSurface() - dispose egl");
- CloseEgl();
+ FreeGraphicsMemory(ETrue);
}
else if (iEglPendingResize)
{
DEBUG("CMIDCanvas::ReleaseEglSurface() - pending resize");
- HandleSizeChanged();
+ HandleSizeChanged(ETrue);
}
- ClearFrameBuffer();
+
+ if (IsEglAvailable())
+ {
+ ClearFrameBuffer();
+ }
}
}
@@ -4443,6 +4601,17 @@
TRect canvasRect = IsDownScaling(iContentSize, iViewRect, iM3GContent) ?
TRect(iViewRect.Size()) : TRect(iContentSize);
rect.Intersection(canvasRect);
+ // Checking if rect have intersection with frameRect
+ TRect frameRect(TPoint(), iFrameBuffer->SizeInPixels());
+ if (!rect.Intersects(frameRect))
+ {
+ return;
+ }
+ rect.Intersection(frameRect);
+ if (rect.IsEmpty())
+ {
+ return;
+ }
// Update the member rects
if (iUpperUpdateRect.Intersects(rect))
@@ -4480,6 +4649,22 @@
}
// ---------------------------------------------------------------------------
+// From MMIDCanvas
+// CMIDCanvas::MidletExiting
+// Draws content to CWindowGc to enable the system effect on MIDlet exit.
+// Canvas might be in the middle of rendering new frame when this is called.
+// Having incomplete frame on screen in some exit cases is anyway better than
+// fully black always.
+// ---------------------------------------------------------------------------
+//
+void CMIDCanvas::MidletExiting()
+{
+ iExiting = ETrue;
+ TRAP_IGNORE(UpdateOffScreenBitmapL(ETrue));
+ DrawToWindowGc();
+}
+
+// ---------------------------------------------------------------------------
// CMIDCanvas::BlitFrameBufferPixels
// Sets up OpenGL state for 2D texture rendering and renders the textures for
// updated frame buffer areas by calling BlitSubRect().
@@ -4614,8 +4799,11 @@
TInt srcOffset = (canvasHeight - (yStart + ySize)) * stride +
xStart * KBytesPerPixel;
- BlitSubRectTexture(xStart, yStart, xSize, ySize, stride,
- (TUint8*)iFrameBuffer->DataAddress() + srcOffset);
+ if ((xSize > 0) && (xSize <= 256) && (ySize > 0) && (ySize <= 256))
+ {
+ BlitSubRectTexture(xStart, yStart, xSize, ySize, stride,
+ (TUint8*)iFrameBuffer->DataAddress() + srcOffset);
+ }
}
}
}
@@ -4678,7 +4866,7 @@
if (err == GL_OUT_OF_MEMORY)
{
glDeleteTextures(KTexturesCount, tempTexObj);
- DEBUG("CMIDCanvas::BlitSubRectTexture(): Out of memory when creating OpenGL texture");
+ ELOG(EJavaUI, "CMIDCanvas::BlitSubRectTexture(): Out of memory when creating OpenGL texture");
return;
}
else if (err != GL_NO_ERROR)
@@ -4713,7 +4901,6 @@
{
// Clear the pixel data with transparent for case where
// actual texture data does not cover the full tile.
- // This should be actually done with glClear().
Mem::FillZ(dst, tileWidth * tileHeight * KBytesPerPixel);
dst += tileWidth * (tileHeight - aHeight) * KBytesPerPixel;
}
@@ -4961,11 +5148,11 @@
glLoadIdentity();
// position texture screen coordinates
- pos[0] = (GLshort)iViewRect.iTl.iX - iPositionRelativeToScreen.iX;
+ pos[0] = (GLshort)iViewRect.iTl.iX;
pos[1] = (GLshort)iViewRect.Height() + (height - iViewRect.iBr.iY);
pos[2] = pos[0];
pos[3] = (GLshort)height - iViewRect.iBr.iY;
- pos[4] = (GLshort)iViewRect.iBr.iX - iPositionRelativeToScreen.iX;
+ pos[4] = (GLshort)iViewRect.iBr.iX;
pos[5] = pos[1];
pos[6] = pos[4];
pos[7] = pos[3];
@@ -5077,5 +5264,31 @@
return KEglSuccess;
}
+// ---------------------------------------------------------------------------
+// CMIDCanvas::IsWindowVisible
+// Checks if canvas window is currently visible on display. Canvas may be visible
+// e.g. behind task switcher or system dialogs even though MIDlet is not the
+// foreground application in that case. This function relies on
+// CMIDDisplayble setting canvas window invisible when some other full-screen
+// displayble is set as current.
+// ---------------------------------------------------------------------------
+//
+TBool CMIDCanvas::IsWindowVisible() const
+{
+ return iEnv.HasFullOrPartialForeground() && IsVisible();
+}
+
+// ---------------------------------------------------------------------------
+// CMIDCanvas::PostForcedPaint
+// Send forced paint to Java. Canvas.paint() will be called even if canvas is
+// not the current displayable.
+// ---------------------------------------------------------------------------
+//
+void CMIDCanvas::PostForcedPaint()
+{
+ TInt posPacked = 0;
+ TInt sizePacked = (iContentSize.iWidth << 16) | (iContentSize.iHeight);
+ PostEvent(EForcedPaint, posPacked, sizePacked);
+}
#endif // RD_JAVA_NGA_ENABLED
// End of File.
--- a/javauis/lcdui_akn/lcdui/src/CMIDCanvasGraphicsItem.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDCanvasGraphicsItem.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -81,6 +81,12 @@
{
DEBUG("CMIDCanvasGraphicsItem::~CMIDCanvasGraphicsItem +");
+ // When disposing item first, removes the painter parent
+ if (iItemPainter)
+ {
+ iItemPainter->SetItem(NULL);
+ }
+
// Remove this component from the container if set.
if (iComponentContainer)
{
@@ -313,7 +319,7 @@
void CMIDCanvasGraphicsItem::Dispose()
{
DEBUG("CMIDCanvasGraphicsItem::Dispose +");
-
+
delete this;
DEBUG("CMIDCanvasGraphicsItem::Dispose -");
@@ -370,6 +376,15 @@
}
}
+void CMIDCanvasGraphicsItem::HandleForeground(TBool aForeground)
+{
+ // If Canvas goes to foreground and scaling is on,
+ // then we resize a CanvasGraphicsItem.
+ if (aForeground)
+ {
+ HandleChangeForScaling(EForegroundGained);
+ }
+}
void CMIDCanvasGraphicsItem::HandleChangeForScaling(TChange aChange)
{
// Calling functions which set size and position.
@@ -380,7 +395,9 @@
}
SetPosition(iNonScaledPosition.iX, iNonScaledPosition.iY);
- if (aChange == EResolutionChange || aChange == EFullscreenChange)
+ if (aChange == EResolutionChange
+ || aChange == EFullscreenChange
+ || aChange == EForegroundGained)
{
if (iUtils)
{
@@ -406,4 +423,16 @@
#endif // RD_JAVA_S60_RELEASE_9_2
}
+void CMIDCanvasGraphicsItem::DeregisterCanvasGraphicsItem()
+{
+ // This method is called on item from painter, when painter is disposed
+ // before disposal of item
+ if (iComponentContainer)
+ {
+ // Remove this component from the container if set.
+ iComponentContainer->UnregisterComponent(this);
+ }
+
+ iComponentContainer = NULL;
+}
// End of file
--- a/javauis/lcdui_akn/lcdui/src/CMIDCanvasGraphicsItemPainter.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDCanvasGraphicsItemPainter.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -77,6 +77,12 @@
{
DEBUG("CMIDCanvasGraphicsItemPainter::~CMIDCanvasGraphicsItemPainter +");
+ // Removes the parent item from component container
+ if (iItem)
+ {
+ iItem->DeregisterCanvasGraphicsItem();
+ }
+
// Release buffers
ResetBuffers();
@@ -85,7 +91,7 @@
{
iDirectContainer->MdcRemoveContent(this);
}
-
+
iItem = NULL;
DEBUG("CMIDCanvasGraphicsItemPainter::~CMIDCanvasGraphicsItemPainter -");
@@ -291,7 +297,7 @@
void CMIDCanvasGraphicsItemPainter::Dispose()
{
DEBUG("CMIDCanvasGraphicsItemPainter::Dispose +");
-
+
delete this;
DEBUG("CMIDCanvasGraphicsItemPainter::Dispose -");
--- a/javauis/lcdui_akn/lcdui/src/CMIDCanvasKeypad.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDCanvasKeypad.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -378,7 +378,7 @@
}
SetRectForAllButtons();//Needed for updating OSK-buttons when closing/opening hw-keyboard
CreateButtonsL();
- InitializeKeys();
+ InitializeKeysL();
ActivateL(); // Window owning control draws all children (buttons)
MakeVisible(ETrue);
DrawDeferred();
@@ -504,7 +504,7 @@
buttonData.iButton->SetExtent(iRockerRect.iTl, iRockerRect.Size());
buttonData.iButton->ActivateL();
InitializeKeyEvents(TKeypadKeys(i), &buttonData);
- iButtonData.Append(buttonData);
+ iButtonData.AppendL(buttonData);
CleanupStack::Pop(buttonData.iButton);
}
CleanupStack::PopAndDestroy(); // reader;
@@ -554,7 +554,7 @@
buttonDataGameA.iButton->SetExtent(iGameARect.iTl, iGameARect.Size());
buttonDataGameA.iButton->ActivateL();
InitializeKeyEvents(EGameA, &buttonDataGameA);
- iButtonData.Append(buttonDataGameA);
+ iButtonData.AppendL(buttonDataGameA);
//GameB
bitmap = NULL;
@@ -589,7 +589,7 @@
buttonDataGameB.iButton->SetExtent(iGameBRect.iTl, iGameBRect.Size());
buttonDataGameB.iButton->ActivateL();
InitializeKeyEvents(EGameB, &buttonDataGameB);
- iButtonData.Append(buttonDataGameB);
+ iButtonData.AppendL(buttonDataGameB);
//GameC
bitmap = NULL;
@@ -624,7 +624,7 @@
buttonDataGameC.iButton->SetExtent(iGameCRect.iTl, iGameCRect.Size());
buttonDataGameC.iButton->ActivateL();
InitializeKeyEvents(EGameC, &buttonDataGameC);
- iButtonData.Append(buttonDataGameC);
+ iButtonData.AppendL(buttonDataGameC);
//GameD
bitmap = NULL;
@@ -658,7 +658,7 @@
buttonDataGameD.iButton->SetExtent(iGameDRect.iTl, iGameDRect.Size());
buttonDataGameD.iButton->ActivateL();
InitializeKeyEvents(EGameD, &buttonDataGameD);
- iButtonData.Append(buttonDataGameD);
+ iButtonData.AppendL(buttonDataGameD);
}
//LSK & RSK buttons
@@ -830,17 +830,17 @@
buttonDataLSK.iButton->SetExtent(iLskRect.iTl, iLskRect.Size());
buttonDataLSK.iButton->ActivateL();
InitializeKeyEvents(ELsk, &buttonDataLSK);
- iButtonData.Append(buttonDataLSK);
+ iButtonData.AppendL(buttonDataLSK);
buttonDataRSK.iButton->SetContainerWindowL(*this);
buttonDataRSK.iButton->SetExtent(iRskRect.iTl, iRskRect.Size());
buttonDataRSK.iButton->ActivateL();
InitializeKeyEvents(ERsk, &buttonDataRSK);
- iButtonData.Append(buttonDataRSK);
+ iButtonData.AppendL(buttonDataRSK);
}
-void CMIDCanvasKeypad::InitializeKeys()
+void CMIDCanvasKeypad::InitializeKeysL()
{
TInt buttonCount = iButtonData.Count();
iCurrentButtonData.Reset();
@@ -856,8 +856,8 @@
{
iButtonData[i].iButton->SetPosition(iRockerRect.iTl);
iButtonData[i].iButton->SetSize(iRockerRect.Size());
- iCurrentButtonData.Append(&iButtonData[i]);
- iButtonStack.Append(i);
+ iCurrentButtonData.AppendL(&iButtonData[i]);
+ iButtonStack.AppendL(i);
}
}
// Other keys
@@ -870,29 +870,29 @@
{
iButtonData[i].iButton->SetPosition(iGameARect.iTl);
iButtonData[i].iButton->SetSize(iGameARect.Size());
- iCurrentButtonData.Append(&iButtonData[i]);
- iButtonStack.Append(i);
+ iCurrentButtonData.AppendL(&iButtonData[i]);
+ iButtonStack.AppendL(i);
}
else if (iButtonData[i].keyType == EGameB)
{
iButtonData[i].iButton->SetPosition(iGameBRect.iTl);
iButtonData[i].iButton->SetSize(iGameBRect.Size());
- iCurrentButtonData.Append(&iButtonData[i]);
- iButtonStack.Append(i);
+ iCurrentButtonData.AppendL(&iButtonData[i]);
+ iButtonStack.AppendL(i);
}
else if (iButtonData[i].keyType == EGameC)
{
iButtonData[i].iButton->SetPosition(iGameCRect.iTl);
iButtonData[i].iButton->SetSize(iGameCRect.Size());
- iCurrentButtonData.Append(&iButtonData[i]);
- iButtonStack.Append(i);
+ iCurrentButtonData.AppendL(&iButtonData[i]);
+ iButtonStack.AppendL(i);
}
else if (iButtonData[i].keyType == EGameD)
{
iButtonData[i].iButton->SetPosition(iGameDRect.iTl);
iButtonData[i].iButton->SetSize(iGameDRect.Size());
- iCurrentButtonData.Append(&iButtonData[i]);
- iButtonStack.Append(i);
+ iCurrentButtonData.AppendL(&iButtonData[i]);
+ iButtonStack.AppendL(i);
}
}
@@ -900,14 +900,14 @@
if (iButtonData[i].keyType == ELsk && iIsFullScreenMode)
{
iButtonData[i].iButton->SetExtent(iLskRect.iTl, iLskRect.Size());
- iCurrentButtonData.Append(&iButtonData[i]);
- iButtonStack.Append(i);
+ iCurrentButtonData.AppendL(&iButtonData[i]);
+ iButtonStack.AppendL(i);
}
else if (iButtonData[i].keyType == ERsk && iIsFullScreenMode)
{
iButtonData[i].iButton->SetExtent(iRskRect.iTl, iRskRect.Size());
- iCurrentButtonData.Append(&iButtonData[i]);
- iButtonStack.Append(i);
+ iCurrentButtonData.AppendL(&iButtonData[i]);
+ iButtonStack.AppendL(i);
}
}
}
@@ -1393,7 +1393,7 @@
feedback->InstantFeedback(ETouchFeedbackSensitiveButton);
}
break;
-#endif //RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+#endif //RD_JAVA_ADVANCED_TACTILE_FEEDBACK
}
}
#endif // RD_TACTILE_FEEDBACK
--- a/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupControl.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupControl.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -688,20 +688,36 @@
// Save the currently selected item (if exclusive choice)
TInt oldSelected = iModel->SelectedElement();
TInt oldCurrentIndex = -1;
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ TBool wasHighlighted = EFalse;
+#endif // RD_JAVA_S60_RELEASE_9_2
if (iListBox)
{
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ wasHighlighted = iListBox->GetHighlight();
+#endif // RD_JAVA_S60_RELEASE_9_2
+
oldCurrentIndex = iListBox->View()->CurrentItemIndex();
// Let the listbox take a shot at the key
resp = iListBox->OfferKeyEventL(aKeyEvent, aType);
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ wasHighlighted = (iListBox->GetHighlight() && !wasHighlighted) ? EFalse : ETrue;
+#endif // RD_JAVA_S60_RELEASE_9_2
}
// If click (enter) on an already selected item in an exclusive choice,
- // do not consume the key. This allows the form to display a context menu
+ // do not consume the key. This allows the form to display a context menu.
+ // Choicegroup element need to be focused and selected
if ((iType == MMIDChoiceGroup::EExclusive) &&
((aKeyEvent.iCode == EKeyOK) || (aKeyEvent.iCode == EKeyEnter)) &&
((oldSelected != -1) || (oldSelected == -1 && oldCurrentIndex == -1)) &&
- (oldSelected == iModel->SelectedElement()))
+ (oldSelected == iModel->SelectedElement())
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ && (wasHighlighted && iListBox->GetHighlight())
+#endif // RD_JAVA_S60_RELEASE_9_2
+ )
{
// Do not consume the key, so that form can pop a menu
CMIDDisplayable& displayable = iItem->Form()->CurrentDisplayable();
@@ -723,12 +739,21 @@
}
else
{
+ TInt numScreenOrHelpCommands = displayable.NumCommandsForScreenOrHelpOptionsMenu();
+
// if ( cntOpt > 1 ) will run menu, else execute ProcessCommandL( CommandOffset )
if (cntOpt > 1)
{
displayable.MenuHandler()->ShowMenuL(CMIDMenuHandler::EOkMenu);
resp = EKeyWasConsumed;
}
+ else if (cntOpt == 0 && numScreenOrHelpCommands > 1)
+ {
+ // If there is more than one screen command on form
+ // and there is no ok/item commands then show menu
+ displayable.MenuHandler()->ShowMenuL(CMIDMenuHandler::EOptionsMenu);
+ resp = EKeyWasConsumed;
+ }
else if (command && command->CommandType() != MMIDCommand::EBack &&
command->CommandType() != MMIDCommand::ECancel)
{
@@ -1174,15 +1199,13 @@
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 = KHighlightedItemTextColor;
+ textColor = EAknsCIQsnTextColorsCG8;
}
else
{
- textColor = KNonHighlightedItemTextColor;
+ textColor = EAknsCIQsnTextColorsCG6;
}
AknsUtils::GetCachedColor(AknsUtils::SkinInstance(),
--- a/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupListBox.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDChoiceGroupListBox.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -581,4 +581,9 @@
{
iHighlight = aVisible;
}
+
+TBool CMIDChoiceGroupListBox::GetHighlight()
+{
+ return iHighlight;
+}
#endif // RD_JAVA_S60_RELEASE_9_2
--- a/javauis/lcdui_akn/lcdui/src/CMIDControlItem.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDControlItem.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -261,12 +261,10 @@
{
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)
- ? KHighlightedItemTextColor : KNonHighlightedItemTextColor;
+ ? EAknsCIQsnTextColorsCG8 : EAknsCIQsnTextColorsCG6;
// Get color from skin
if ((AknsUtils::GetCachedColor(AknsUtils::SkinInstance(), color,
--- a/javauis/lcdui_akn/lcdui/src/CMIDCustomItem.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDCustomItem.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -54,6 +54,17 @@
it needs to draw bitmaps with these sizes. @see KMaxScreenSizeFactor */
const TInt KCIMaxScreenSizeFactor = 2;
+// ---------------------------------------------------------------------------
+// TLcduiEvent
+// ---------------------------------------------------------------------------
+//
+enum TLcduiEvent
+{
+ EFixUIOrientation,
+ EUnFixUIOrientation
+};
+
+
CMIDCustomItem* CMIDCustomItem::NewL(
MMIDEnv& aEnv, const TDesC& aLabel, CMIDUIManager* aUIManager)
{
@@ -78,6 +89,8 @@
, iRestoreDirectContentWhenUnfaded(EFalse)
, iPreviousVisibility(EFalse)
, iConsumerWaitingForDSAResourcesCallback(NULL)
+ , iUiFixed(EFalse)
+ , iUiToBeFixedLater(EFalse)
{
iMMidItem = this;
@@ -246,6 +259,12 @@
{
iDirectContent->MdcContainerDestroyed();
}
+
+ if (iUiFixed && iForm)
+ {
+ iForm->CurrentDisplayable().ReleaseOrientation();
+ iUiFixed = EFalse;
+ }
#ifndef RD_JAVA_NGA_ENABLED
if (iDirectAccess)
@@ -1328,10 +1347,24 @@
{
ChangeDirectContainerVisibility(ETrue);
}
+
+ if (iUiToBeFixedLater && iForm)
+ {
+ iForm->CurrentDisplayable().FixOrientation();
+ iUiFixed = ETrue;
+ iUiToBeFixedLater = EFalse;
+ }
}
void CMIDCustomItem::ItemRemovedFromForm()
{
+ if (iUiFixed && iForm)
+ {
+ iForm->CurrentDisplayable().ReleaseOrientation();
+ iUiFixed = EFalse;
+ iUiToBeFixedLater = EFalse;
+ }
+
CMIDItem::ItemRemovedFromForm();
ChangeDirectContainerVisibility(EFalse);
@@ -1524,6 +1557,52 @@
}
// ---------------------------------------------------------------------------
+// From class MDirectContainer.
+// CMIDCustomItem::MdcFixUIOrientation(TBool aEnableFix)
+// ---------------------------------------------------------------------------
+//
+
+void CMIDCustomItem::MdcFixUIOrientation(TBool aEnableFix)
+{
+ if (aEnableFix)
+ {
+ iEnv.ToLcduiObserver().InvokeLcduiEvent(*this, EFixUIOrientation);
+ }
+ 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;
+ }
+}
//
// ---------------------------------------------------------------------------
//
--- a/javauis/lcdui_akn/lcdui/src/CMIDDateFieldItem.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDDateFieldItem.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -492,6 +492,8 @@
// Show Menu or activate one command
else
{
+ TInt numScreenOrHelpCommands = displayable.NumCommandsForScreenOrHelpOptionsMenu();
+
// Active Command Show Menu
// if ( cntOpt > 1 ) will run menu, else execute ProcessCommandL( CommandOffset )
if (cntOpt > 1)
@@ -499,6 +501,13 @@
displayable.MenuHandler()->ShowMenuL(CMIDMenuHandler::EOkMenu);
return EKeyWasConsumed;
}
+ else if (cntOpt == 0 && numScreenOrHelpCommands > 1)
+ {
+ // If there is more than one screen command on form
+ // and there is no ok/item commands then show menu
+ displayable.MenuHandler()->ShowMenuL(CMIDMenuHandler::EOptionsMenu);
+ return EKeyWasConsumed;
+ }
else if (command && command->CommandType() != MMIDCommand::EBack &&
command->CommandType() != MMIDCommand::ECancel)
{
@@ -517,7 +526,8 @@
//
// End Enter Key
//
- if (code == EKeyDownArrow || code == EKeyUpArrow || code == EKeyApplication0)
+ if (code == EKeyDownArrow || code == EKeyUpArrow ||
+ (code == EKeyApplication0 || aKeyEvent.iScanCode == EStdKeyApplication0))
return EKeyWasNotConsumed;
if (!iInitialised && aType == EEventKey && !CMIDUtils::IgnoreKeyEvent(aKeyEvent.iCode))
@@ -954,17 +964,15 @@
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(KHighlightedItemTextColor);
+ iEditor->SetSkinTextColorL(EAknsCIQsnTextColorsCG8);
}
else
{
// Text colour from skin - unfocused
- iEditor->SetSkinTextColorL(KNonHighlightedItemTextColor);
+ iEditor->SetSkinTextColorL(EAknsCIQsnTextColorsCG6);
}
}
--- a/javauis/lcdui_akn/lcdui/src/CMIDDisplayable.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDDisplayable.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -272,7 +272,8 @@
iSKPositionWithQwerty = ESoftkeysBottom;
}
else
- {//default value
+ {
+ //default value
iSKPositionWithQwerty = ESoftkeysRight;
}
@@ -291,6 +292,8 @@
,iPenInputServerConnected(EFalse)
#endif //RD_TACTILE_FEEDBACK
,iIdOfMSKCommand(KErrNotFound)
+ ,iRestoreOrientation(EFalse)
+ ,iReleaseCnt(0)
{
#ifdef RD_JAVA_S60_RELEASE_9_2
iSplitScreenKeyboard = EFalse;
@@ -359,7 +362,8 @@
delete iCommandList;
if (iMenuHandler->GetDisplayable() == this)
- {//this may happen when the application is exiting
+ {
+ //this may happen when the application is exiting
iMenuHandler->SetDisplayable(NULL);
}
@@ -372,10 +376,6 @@
**/
void CMIDDisplayable::Dispose()
{
- if (iAppUi)
- {
- iAppUi->UnSetEnv();
- }
ReplaceBehindAlertIfNeeded();
delete this;
@@ -396,7 +396,8 @@
&& IsVisible()
&& (iMenuHandler->GetDisplayable())
&& (iMenuHandler->GetDisplayable()->Component()->Type() == EAlert))
- {// In this case we are a faded displayable behind a dialog
+ {
+ // In this case we are a faded displayable behind a dialog
TInt numDisplayables = iAppUi->Displayables().Count();
TInt index = -1;
TInt currentPosition = 999;
@@ -632,7 +633,7 @@
}
#else
User::LeaveIfError(aItems.Append(item));
-#endif // RD_JAVA_S60_RELEASE_9_2
+#endif // RD_JAVA_S60_RELEASE_9_2
}
}
}
@@ -671,7 +672,8 @@
PopulateMenuItemsWithListL(aMenuType, aMenuItems, iCommandList, EFalse);
}
else if (aMenuType == CMIDMenuHandler::EHelpMenu)
- { // Add the Help commands only
+ {
+ // Add the Help commands only
PopulateMenuItemsWithListL(aMenuType, aMenuItems, iCommandList, EFalse);
}
else if (aMenuType == CMIDMenuHandler::EOptionsMenu)
@@ -693,7 +695,8 @@
}
if (aCommandId == EAknSoftkeyContextOptions)
- { // MSK command to show context sensitive menu -> open it
+ {
+ // MSK command to show context sensitive menu -> open it
ShowOkOptionsMenuL();
}
else if (aCommandId == KBuiltInMSKCommandId)
@@ -730,7 +733,7 @@
form->PostPendingUpEventL();
}
}
-#endif // RD_JAVA_S60_RELEASE_9_2
+#endif // RD_JAVA_S60_RELEASE_9_2
}
#ifdef RD_SCALABLE_UI_V2
@@ -752,7 +755,8 @@
{
TBool postJavaEvent = ETrue;
if (aCmdEntry.iCommand->Id() < 0)
- { //non-midlet command, see if there is an observer
+ {
+ //non-midlet command, see if there is an observer
if (aCmdEntry.iCommand->Observer())
{
postJavaEvent = !(aCmdEntry.iCommand->Observer()->ProcessCommandL(aCmdEntry.iCommand));
@@ -770,7 +774,8 @@
{
TBool postJavaEvent = ETrue;
if (aCmdEntry.iCommand->Id() < 0)
- { //non-midlet command, see if there is an observer
+ {
+ //non-midlet command, see if there is an observer
if (aCmdEntry.iCommand->Observer())
{
postJavaEvent = !(aCmdEntry.iCommand->Observer()->ProcessCommandL(aCmdEntry.iCommand));
@@ -990,32 +995,40 @@
form->HandleForegroundL(aForeground);
}
- HandleCanvasForeground(aForeground);
+ // Notify canvas about gained foreground only if it is the current displayable
+ if (!aForeground || iActive)
+ {
+ HandleCanvasForeground(aForeground);
+ }
if (aForeground)
{
- //If MIDlet is sent to foreground and JAD-attribute BackgroundEvent=Pause,
- //then call startApp() method for the MIDlet.
+ // If MIDlet is sent to foreground and JAD-attribute BackgroundEvent=Pause,
+ // then call startApp() method for the MIDlet.
if (iEnv.MidletAttributeIsSetToVal(LcduiMidletAttributes::KAttribBackgroundEvent,
LcduiMidletAttributeValues::KPauseValue))
{
iEnv.PostMidletEvent(EStart);
+ iAppUi->SetPauseAppState(EFalse);
}
}
else //to background
{
- //If MIDlet is sent to background and JAD-attribute BackgroundEvent=Pause,
- //then call pauseApp() method for the MIDlet.
+ // If MIDlet is sent to background and JAD-attribute BackgroundEvent=Pause,
+ // and window is not faded yet or window is already faded but pauseApp was not called yet,
+ // then call pauseApp() method for the MIDlet.
+ TBool isfaded = this->DrawableWindow()->IsFaded();
if (iEnv.MidletAttributeIsSetToVal(LcduiMidletAttributes::KAttribBackgroundEvent,
- LcduiMidletAttributeValues::KPauseValue) &&
- !this->DrawableWindow()->IsFaded())
+ LcduiMidletAttributeValues::KPauseValue) && (!isfaded ||
+ (isfaded && !iAppUi->GetPauseAppState())))
{
iEnv.PostMidletEvent(EPause);
+ iAppUi->SetPauseAppState(ETrue);
}
}
DEBUG("- CMIDDisplayable::HandleForegroundL");
@@ -1030,11 +1043,13 @@
DEBUG("+ CMIDDisplayable::HandleResourceChangeL");
if (aType == KEikDynamicLayoutVariantSwitch)
- { // dynamic orientation change
+ {
+ // dynamic orientation change
// Correct rect is set for displayable
if (iActive && iCanvasKeypad)
- { //Update correct On-Screen Keypad type
+ {
+ //Update correct On-Screen Keypad type
UpdateOnScreenKeypadSettings();
}
UpdateDisplayableRect();
@@ -1042,15 +1057,53 @@
// MIDlet icon is resized in cpane SizeChanged()
if (!iActive && iContentControl)
- {//The active displayable already gets this call by the CONE framework but
+ {
+ //The active displayable already gets this call by the CONE framework but
//background displayables don't, so for example a background form won't be
//re-laid-out if we don't call this here
iContentControl->HandleResourceChange(aType);
}
#ifdef RD_SCALABLE_UI_V2
+ // When current Displayble is Canvas or popup Displayable and the last
+ // Displayble was Canvas, then OSK visual appearance is needed
+ // to be change.
if (iUseOnScreenKeypad && iCanvasKeypad && (iActive || this->DrawableWindow()->IsFaded()))
{
- iCanvasKeypad->UpdateVisualAppearanceL(*iCanvas, iOnScreenKeyboardType, *this);
+ if (iActive)
+ {
+ // Current is Canvas.
+ iCanvasKeypad->UpdateVisualAppearanceL(*iCanvas, iOnScreenKeyboardType, *this);
+ }
+ else
+ {
+ // Get current Displayable and the last fullscreen Displayble.
+ MMIDDisplayable* current = iEnv.Current();
+ const MMIDDisplayable* last = iEnv.LastFullscreenDisplayable();
+ if (current && last && current->Component()
+ && last->Component())
+ {
+ // Get types of Displayables.
+ MMIDComponent::TType lastType = last->Component()->Type();
+ MMIDComponent::TType currentType = current->Component()->Type();
+ if (lastType == ECanvas)
+ {
+ if (currentType == EAlert)
+ {
+ // Current is Alert and the last fullscreen
+ // Displayable was Canvas.
+ iCanvasKeypad->UpdateVisualAppearanceL(
+ *iCanvas, iOnScreenKeyboardType, *this);
+ }
+ else if (currentType == ETextBox && current->IsPopupTextBox())
+ {
+ // Current is popup TextBox and the last fullscreen
+ // Displayable was Canvas.
+ iCanvasKeypad->UpdateVisualAppearanceL(
+ *iCanvas, iOnScreenKeyboardType, *this);
+ }
+ }
+ }
+ }
}
#endif // RD_SCALABLE_UI_V2
iFullscreenCanvasLabelCacheIsValid = EFalse;
@@ -1058,7 +1111,8 @@
else if (aType == KEikColorResourceChange ||
aType == KAknsMessageSkinChange ||
aType == KUidValueCoeColorSchemeChangeEvent)
- { //skin or color change, may need to recreate ctx icon
+ {
+ //skin or color change, may need to recreate ctx icon
// send skin change event to non-active controls so they can also
// reload graphics
if (!iActive && iContentControl)
@@ -1083,6 +1137,26 @@
}
}
+#ifdef RD_JAVA_NGA_ENABLED
+void CMIDDisplayable::HandleFullOrPartialForegroundL(TBool aFullOrPartialFg)
+{
+ CMIDCanvas* canvas = GetContentCanvas();
+ if (canvas)
+ {
+ canvas->HandleFullOrPartialForegroundL(aFullOrPartialFg, iActive);
+ }
+}
+
+void CMIDDisplayable::HandleFreeGraphicsMemory()
+{
+ CMIDCanvas* canvas = GetContentCanvas();
+ if (canvas)
+ {
+ canvas->FreeGraphicsMemory(ETrue);
+ }
+}
+#endif // RD_JAVA_NGA_ENABLED
+
/**
* The container has changed it available drawing space, so resize
* the displayable to fit and post a size changed event.
@@ -1150,122 +1224,133 @@
{
DEBUG("+ CMIDDisplayable::GetCanvasRectFromLaf");
- TRect resultRect;
+ TRect resultRect = TRect(0,0,0,0);
AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, resultRect);
TAknLayoutRect canvasRect;
TAknLayoutRect mainPane;
TAknLayoutRect mainMidpPane;
- //Read canvasRect from LAF depending on keyboard type
- switch (iOnScreenKeyboardType)
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ // If split screen is open, then it is needed return current size of Canvas.
+ if (iSplitScreenKeyboard)
{
- case EOnScreenKeypadValueNo:
- break;
- case EOnScreenKeypadValueNavigationKeys:
- {
- if (iIsFullScreenMode)
+ CMIDCanvas* canvas = GetContentCanvas();
+ if (canvas)
{
- if (!Layout_Meta_Data::IsLandscapeOrientation()) //portrait
- {
- canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(1).LayoutLine());
- }
- else //landscape
- {
- canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(8).LayoutLine());
- }
+ resultRect = canvas->ViewRect();
}
- else //normal mode
+ }
+ else
+ {
+#endif // RD_JAVA_S60_RELEASE_9_2
+ //Read canvasRect from LAF depending on keyboard type
+ switch (iOnScreenKeyboardType)
{
- if (!Layout_Meta_Data::IsLandscapeOrientation()) //portrait
+ case EOnScreenKeypadValueNo:
+ break;
+ case EOnScreenKeypadValueNavigationKeys:
+ {
+ if (iIsFullScreenMode)
{
- mainPane.LayoutRect(resultRect, AknLayoutScalable_Avkon::main_pane(3).LayoutLine());
- mainMidpPane.LayoutRect(mainPane.Rect(), AknLayoutScalable_Avkon::main_midp_pane(0).LayoutLine());
- canvasRect.LayoutRect(mainMidpPane.Rect(), AknLayoutScalable_Avkon::midp_canvas_pane(4).LayoutLine());
- }
- else //landscape
- {
- mainPane.LayoutRect(resultRect, AknLayoutScalable_Avkon::main_pane(4).LayoutLine());
- mainMidpPane.LayoutRect(mainPane.Rect(), AknLayoutScalable_Avkon::main_midp_pane(1).LayoutLine());
- canvasRect.LayoutRect(mainMidpPane.Rect(), AknLayoutScalable_Avkon::midp_canvas_pane(7).LayoutLine());
- }
- }
- resultRect = canvasRect.Rect();
- break;
- }
- case EOnScreenKeypadValueGameActions:
- {
- if (iIsFullScreenMode)
- {
- if (!Layout_Meta_Data::IsLandscapeOrientation()) //portrait
- {
- canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(2).LayoutLine());
+ if (!Layout_Meta_Data::IsLandscapeOrientation()) //portrait
+ {
+ canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(1).LayoutLine());
+ }
+ else //landscape
+ {
+ canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(8).LayoutLine());
+ }
}
- else //landscape
- {
- canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(3).LayoutLine());
- }
- }
- else //normal mode
- {
- if (!Layout_Meta_Data::IsLandscapeOrientation()) //portrait
- {
- mainPane.LayoutRect(resultRect, AknLayoutScalable_Avkon::main_pane(3).LayoutLine());
- mainMidpPane.LayoutRect(mainPane.Rect(), AknLayoutScalable_Avkon::main_midp_pane(0).LayoutLine());
- canvasRect.LayoutRect(mainMidpPane.Rect(), AknLayoutScalable_Avkon::midp_canvas_pane(5).LayoutLine());
- }
- else//landscape
+ else //normal mode
{
- mainPane.LayoutRect(resultRect, AknLayoutScalable_Avkon::main_pane(4).LayoutLine());
- mainMidpPane.LayoutRect(mainPane.Rect(), AknLayoutScalable_Avkon::main_midp_pane(1).LayoutLine());
- canvasRect.LayoutRect(mainMidpPane.Rect(), AknLayoutScalable_Avkon::midp_canvas_pane(6).LayoutLine());
- }
- }
- resultRect = canvasRect.Rect();
- break;
- }
- case EOnScreenKeypadValueLskRsk:
- {
- if (iIsFullScreenMode)
- {
- if (!Layout_Meta_Data::IsLandscapeOrientation()) //portrait
- {
- canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(11).LayoutLine());
- }
- else //landscape
- {
- if (iSKPositionWithQwerty == ESoftkeysRight)
+ if (!Layout_Meta_Data::IsLandscapeOrientation()) //portrait
{
- canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(10).LayoutLine());
+ mainPane.LayoutRect(resultRect, AknLayoutScalable_Avkon::main_pane(3).LayoutLine());
+ mainMidpPane.LayoutRect(mainPane.Rect(), AknLayoutScalable_Avkon::main_midp_pane(0).LayoutLine());
+ canvasRect.LayoutRect(mainMidpPane.Rect(), AknLayoutScalable_Avkon::midp_canvas_pane(4).LayoutLine());
}
- else
+ else //landscape
{
-#ifdef RD_JAVA_S60_RELEASE_9_2
- canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(9).LayoutLine());
-#else
- resultRect = TRect(80,0,560,360); // Layout data not defined in older releases.
- DEBUG("- CMIDDisplayable::GetCanvasRectFromLaf");
- return resultRect;
-#endif // RD_JAVA_S60_RELEASE_9_2
+ mainPane.LayoutRect(resultRect, AknLayoutScalable_Avkon::main_pane(4).LayoutLine());
+ mainMidpPane.LayoutRect(mainPane.Rect(), AknLayoutScalable_Avkon::main_midp_pane(1).LayoutLine());
+ canvasRect.LayoutRect(mainMidpPane.Rect(), AknLayoutScalable_Avkon::midp_canvas_pane(7).LayoutLine());
}
}
+ resultRect = canvasRect.Rect();
+ break;
}
- else//normal mode
+ case EOnScreenKeypadValueGameActions:
{
- //no need to present LSK&RSK in OSK when in normal mode Canvas
- resultRect = TRect(0,0,0,0);
-
- DEBUG("- CMIDDisplayable::GetCanvasRectFromLaf");
- return resultRect;
+ if (iIsFullScreenMode)
+ {
+ if (!Layout_Meta_Data::IsLandscapeOrientation()) //portrait
+ {
+ canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(2).LayoutLine());
+ }
+ else //landscape
+ {
+ canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(3).LayoutLine());
+ }
+ }
+ else //normal mode
+ {
+ if (!Layout_Meta_Data::IsLandscapeOrientation()) //portrait
+ {
+ mainPane.LayoutRect(resultRect, AknLayoutScalable_Avkon::main_pane(3).LayoutLine());
+ mainMidpPane.LayoutRect(mainPane.Rect(), AknLayoutScalable_Avkon::main_midp_pane(0).LayoutLine());
+ canvasRect.LayoutRect(mainMidpPane.Rect(), AknLayoutScalable_Avkon::midp_canvas_pane(5).LayoutLine());
+ }
+ else//landscape
+ {
+ mainPane.LayoutRect(resultRect, AknLayoutScalable_Avkon::main_pane(4).LayoutLine());
+ mainMidpPane.LayoutRect(mainPane.Rect(), AknLayoutScalable_Avkon::main_midp_pane(1).LayoutLine());
+ canvasRect.LayoutRect(mainMidpPane.Rect(), AknLayoutScalable_Avkon::midp_canvas_pane(6).LayoutLine());
+ }
+ }
+ resultRect = canvasRect.Rect();
+ break;
}
- resultRect = canvasRect.Rect();
- break;
+ case EOnScreenKeypadValueLskRsk:
+ {
+ if (iIsFullScreenMode)
+ {
+ if (!Layout_Meta_Data::IsLandscapeOrientation()) //portrait
+ {
+ canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(11).LayoutLine());
+ }
+ else //landscape
+ {
+ if (iSKPositionWithQwerty == ESoftkeysRight)
+ {
+ canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(10).LayoutLine());
+ }
+ else
+ {
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ canvasRect.LayoutRect(resultRect, AknLayoutScalable_Avkon::midp_canvas_pane(9).LayoutLine());
+#else
+ resultRect = TRect(80,0,560,360); // Layout data not defined in older releases.
+ DEBUG("- CMIDDisplayable::GetCanvasRectFromLaf");
+ return resultRect;
+#endif // RD_JAVA_S60_RELEASE_9_2
+ }
+ }
+ }
+ else//normal mode
+ {
+ //no need to present LSK&RSK in OSK when in normal mode Canvas
+ resultRect = TRect(0,0,0,0);
+
+ DEBUG("- CMIDDisplayable::GetCanvasRectFromLaf");
+ return resultRect;
+ }
+ resultRect = canvasRect.Rect();
+ break;
+ }
+ }
+#ifdef RD_JAVA_S60_RELEASE_9_2
}
- default:
- {
- resultRect = TRect(0,0,0,0);
- break;
- }
- }
+#endif // RD_JAVA_S60_RELEASE_9_2
DEBUG("- CMIDDisplayable::GetCanvasRectFromLaf");
return resultRect;
@@ -1371,10 +1456,10 @@
iActive = aCurrent;
const TType type = iContent->Type();
- HandleCanvasForeground(aCurrent);
-
if (aCurrent)
{
+ HandleCanvasForeground(aCurrent);
+
// when setting displayable as current remember to deactivate
// the default displayable if it has not been done yet
CMIDDisplayable* defaultDisplayable =
@@ -1406,14 +1491,16 @@
}
if (type == EAlert)
- {// alerts do their on thing, they rely on sleeping dialogs in fact
+ {
+ // alerts do their on thing, they rely on sleeping dialogs in fact
CMIDAlert* alert = static_cast<CMIDAlert*>(iContentControl);
TRAP_IGNORE(alert->HandleCurrentL(aCurrent));
UpdateTickerL();
}
else if (type == ETextBox && iIsPopupTextBox)
- {// Pop-up TextBox do their on thing, they rely on sleeping dialogs in fact
+ {
+ // Pop-up TextBox do their on thing, they rely on sleeping dialogs in fact
CMIDTextBoxDialogControl* textBoxDialogControl =
static_cast<CMIDTextBoxDialogControl*>(iContentControl);
TRAP_IGNORE(textBoxDialogControl->HandleCurrentL(aCurrent));
@@ -1436,6 +1523,9 @@
{
MakeVisible(EFalse);
}
+
+ // Notify canvas after changing the visibility
+ HandleCanvasForeground(aCurrent);
}
iContentControl->SetFocus(aCurrent);
@@ -1993,7 +2083,8 @@
}
#endif //RD_SCALABLE_UI_V2
if (!iActive)
- { // Restore pane visibility. There is one pane for all displayables.
+ {
+ // Restore pane visibility. There is one pane for all displayables.
// Only active displayable can decide about the pane visibility.
// Others should not change it.
pane->MakeVisible(paneVisible);
@@ -2012,7 +2103,8 @@
iCba->ReduceRect(iDisplayableRect);
if (!iActive)
- { // Restore cba visibility. There is one cba for all displayables.
+ {
+ // Restore cba visibility. There is one cba for all displayables.
// Only active displayable can decide about the cba visibility.
// Others should not change it.
iCba->MakeVisible(cbaVisible);
@@ -2050,7 +2142,8 @@
SetRect(iDisplayableRect);
if (iActive)
- { //this means we are the active displayable
+ {
+ //this means we are the active displayable
UpdateVisualAppearanceL();
}
@@ -2119,7 +2212,8 @@
CMIDCommand* oldMSKCommand = iMSKCommand;
iMSKCommand = aMSKCommand;
if (oldMSKCommand != iMSKCommand)
- { // avoid unnecessary updating to avoid flickering
+ {
+ // avoid unnecessary updating to avoid flickering
TRAP_IGNORE(InitializeCbasL());
}
}
@@ -2127,7 +2221,8 @@
void CMIDDisplayable::SetSelectCommand(CMIDCommand* aSelectCommand)
{
if (aSelectCommand != iSelectCommand)
- { // avoid unnecessary updating to avoid flickering
+ {
+ // avoid unnecessary updating to avoid flickering
iSelectCommand = aSelectCommand;
TRAP_IGNORE(InitializeCbasL());
}
@@ -2239,7 +2334,7 @@
if (iSelectCommand)
#else
if (!iSelectCommandEnabled && iSelectCommand)
-#endif // RD_JAVA_S60_RELEASE_9_2
+#endif // RD_JAVA_S60_RELEASE_9_2
{
// remove the select command
for (TInt j = 0; j < lists.Count(); j++)
@@ -2346,7 +2441,8 @@
// There is a explicitly set MSK command -> it takes the precedence and gets MSK
TInt commandId = GetInternalCommandIdFor(iMSKCommand);
if (commandId == KCommandIdNotFound)
- {// it must be a built-in command, it is the only command not contained in the command lists
+ {
+ // it must be a built-in command, it is the only command not contained in the command lists
commandId = KBuiltInMSKCommandId;
}
iCba->SetCommandL(KMSKPositionInCBA, commandId, iMSKCommand->ShortLabel());
@@ -2357,7 +2453,7 @@
// There is no explicitly set MSK command and just one for the context menu.
// Instead of a menu, put the command to MSK directly.
RPointerArray<CMIDCommand> commands;
- GetOkOptionsMenuCommands(commands);
+ GetOkOptionsMenuCommandsL(commands);
ASSERT(commands.Count() == 1);
CMIDCommand* command = commands[0];
commands.Close();
@@ -2475,7 +2571,8 @@
cmd.iCommand = NULL;
if (iItemCommandList && iItemCommandList->Count() > 0)
- {// there can only be one so pick the first one
+ {
+ // there can only be one so pick the first one
cmd = iItemCommandList->At(0);
if (cmd.iCommand->IsMappedToSoftKey())
@@ -2488,7 +2585,8 @@
{
TInt index = iCommandList->HighestPriorityCommand(MMIDCommand::EOk);
if (index == KErrNotFound)
- {// there can only be one so if the other one was KErrNotFound, this must be it
+ {
+ // there can only be one so if the other one was KErrNotFound, this must be it
index = iCommandList->HighestPriorityCommand(MMIDCommand::EItem);
}
cmd = iCommandList->At(index);
@@ -2510,6 +2608,47 @@
return EFalse;
}
+// ---------------------------------------------------------------------------
+// See how many commands eligible for the screen or help - optins menu we have.
+// If we have only one command call ProcessCommandL. Otherwise show
+// options menu. In these two cases return ETrue. If zero or negative
+// commands do nothing and return EFalse.
+// ---------------------------------------------------------------------------
+TBool CMIDDisplayable::ShowScreenOrHelpOptionsMenuL()
+{
+ TBool ret = EFalse;
+ TInt numOkCommands = NumCommandsForOkOptionsMenu();
+ TInt numScreenOrHelpCommands = NumCommandsForScreenOrHelpOptionsMenu();
+ TInt screenOrHelpCmdIndex = GetHighestPriorityScreenOrHelpCommand();
+
+ // There is no OK or ITEM command defined on form
+ // There are SCREEN or HELP commands
+ if (iCommandList && screenOrHelpCmdIndex != KErrNotFound && numOkCommands == 0)
+ {
+ CMIDCommand *command = NULL;
+ if (iCommandList->IsValidIndex(screenOrHelpCmdIndex))
+ {
+ command = iCommandList->At(screenOrHelpCmdIndex).iCommand;
+ }
+
+ if (command && (command->CommandType() == MMIDCommand::EScreen ||
+ command->CommandType() == MMIDCommand::EHelp) && iMenuHandler)
+ {
+ if (numScreenOrHelpCommands > 1)
+ {
+ iMenuHandler->ShowMenuL(CMIDMenuHandler::EOptionsMenu);
+ ret = ETrue;
+ }
+ else if (numScreenOrHelpCommands == 1)
+ {
+ ProcessCommandL(iCommandList->CommandOffset());
+ ret = ETrue;
+ }
+ }
+ }
+
+ return ret;
+}
// ---------------------------------------------------------------------------
// Return the number of commands that can be displayed in the ok-options menu.
@@ -2572,6 +2711,47 @@
}
// ---------------------------------------------------------------------------
+// Return the number of commands that can be displayed in the screen or help - options menu.
+// Form item screen or help commands are ignored
+//
+// TextBox/TextField device-provided commands:
+// - "Fetch number"
+// - "Call"
+// - "Fetch e-mail address"
+// are exception. Those are visible ONLY in Options menu so here they are
+// removed from context menu commands count.
+// ---------------------------------------------------------------------------
+TInt CMIDDisplayable::NumCommandsForScreenOrHelpOptionsMenu() const
+{
+ TInt ret = 0;
+
+ // Add SCREEN and HELP commands from form
+ if (iCommandList)
+ {
+ TInt numCommands = iCommandList->Count();
+ for (TInt i = 0; i < numCommands; i++)
+ {
+ const CMIDCommand& command = *(iCommandList->At(i).iCommand);
+
+ if (((command.CommandType() == MMIDCommand::EScreen) ||
+ (command.CommandType() == MMIDCommand::EHelp)) &&
+ (command.Id() != CMIDEdwinUtils::EMenuCommandFetchPhoneNumber) &&
+ (command.Id() != CMIDEdwinUtils::EMenuCommandFetchEmailAddress) &&
+ (command.Id() != CMIDEdwinUtils::EMenuCommandCreatePhoneCall))
+ {
+ TBool selectCommand = (&command == iSelectCommand);
+ if (selectCommand && !iSelectCommandEnabled)
+ {
+ continue;
+ }
+ ret++;
+ }
+ }
+ }
+ return ret;
+}
+
+// ---------------------------------------------------------------------------
// Returns a pointer to the command in the iCommandList with the specified
// ID number. If such command is not found, returns NULL.
// ---------------------------------------------------------------------------
@@ -2603,7 +2783,7 @@
// If there are item commands, there are placed first. Form commands of ITEM
// and OK type are then included always.
// ---------------------------------------------------------------------------
-void CMIDDisplayable::GetOkOptionsMenuCommands(RPointerArray<CMIDCommand>& aCommands) const
+void CMIDDisplayable::GetOkOptionsMenuCommandsL(RPointerArray<CMIDCommand>& aCommands) const
{
aCommands.Reset();
if (iItemCommandList && iItemCommandList->Count() > 0)
@@ -2615,7 +2795,7 @@
(command->Id() != CMIDEdwinUtils::EMenuCommandFetchEmailAddress) &&
(command->Id() != CMIDEdwinUtils::EMenuCommandCreatePhoneCall))
{
- aCommands.Append(command);
+ aCommands.AppendL(command);
}
}
}
@@ -2635,7 +2815,7 @@
{
continue;
}
- aCommands.Append(command);
+ aCommands.AppendL(command);
}
}
}
@@ -2725,7 +2905,7 @@
if (NumCommandsForOkOptionsMenu() > 0)
#else
if (NumCommandsForOkOptionsMenu() > 1)
-#endif // RD_JAVA_S60_RELEASE_9_2
+#endif // RD_JAVA_S60_RELEASE_9_2
{
iLongTapDetector->PointerEventL(aPointerEvent);
}
@@ -2758,7 +2938,7 @@
PopulateMenuItemsWithListL(CMIDMenuHandler::EPopUpMenu, menuItems, iItemCommandList, EFalse);
#else
PopulateMenuItemsWithListL(CMIDMenuHandler::EOkMenu, menuItems, iItemCommandList, EFalse);
-#endif // RD_JAVA_S60_RELEASE_9_2
+#endif // RD_JAVA_S60_RELEASE_9_2
}
// Add form commands always
@@ -2766,12 +2946,12 @@
PopulateMenuItemsWithListL(CMIDMenuHandler::EPopUpMenu, menuItems, iCommandList, EFalse);
#else
PopulateMenuItemsWithListL(CMIDMenuHandler::EOkMenu, menuItems, iCommandList, EFalse);
-#endif // RD_JAVA_S60_RELEASE_9_2
+#endif // RD_JAVA_S60_RELEASE_9_2
#ifdef RD_JAVA_S60_RELEASE_9_2
if (menuItems.Count() > 0)
#else
if (menuItems.Count() > 1)
-#endif // RD_JAVA_S60_RELEASE_9_2
+#endif // RD_JAVA_S60_RELEASE_9_2
{
// recreate stylus popup menu because it does not have method
// for clearing the menu items
@@ -2975,8 +3155,15 @@
rect, TIdentityRelation< TDirectContentsRect >(CMIDDisplayable::MatchDirectContentsRects));
if (index == KErrNotFound)
{
- iDirectContentsRects.Append(rect);
- UpdateDirectContentsRegion();
+ TInt err = iDirectContentsRects.Append(rect);
+ if (KErrNone == err)
+ {
+ UpdateDirectContentsRegion();
+ }
+ else
+ {
+ DEBUG_INT("CMIDDisplayable::AddDirectContentArea - RArray append error %d", err);
+ }
}
else
{
@@ -3161,11 +3348,9 @@
void CMIDDisplayable::HandleCanvasForeground(TBool aForeground)
{
- if (iContent && iContentControl &&
- (iContent->Type() == MMIDComponent::ECanvas ||
- iContent->Type() == MMIDComponent::EGameCanvas))
+ CMIDCanvas* canvas = GetContentCanvas();
+ if (canvas)
{
- CMIDCanvas* canvas = static_cast<CMIDCanvas*>(iContentControl);
canvas->HandleForeground(aForeground);
}
}
@@ -3225,6 +3410,18 @@
HideIndicator(pane, EEikStatusPaneUidDigitalClock);
}
+CMIDCanvas* CMIDDisplayable::GetContentCanvas()
+{
+ CMIDCanvas* ret = NULL;
+ if (iContent && iContentControl &&
+ (iContent->Type() == MMIDComponent::ECanvas ||
+ iContent->Type() == MMIDComponent::EGameCanvas))
+ {
+ ret = static_cast<CMIDCanvas*>(iContentControl);
+ }
+ return ret;
+}
+
CPropertyWatch* CPropertyWatch::NewL(MMIDDisplayable* aDisplayable)
{
DEBUG("+ CPropertyWatch::NewL");
@@ -3239,6 +3436,48 @@
return self;
}
+void CMIDDisplayable::FixOrientation()
+{
+ TBool tmpRestoreOrientation;
+
+ if (!iAvkonAppUi)
+ {
+ return;
+ }
+
+ iOldUiOrientation = iAvkonAppUi->Orientation();
+ tmpRestoreOrientation = (iOldUiOrientation == CAknAppUiBase::EAppUiOrientationUnspecified) ? ETrue : EFalse;
+
+ // Fix the orientation when was set to unspecified only
+ if (tmpRestoreOrientation)
+ {
+ TRAP_IGNORE(iAvkonAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationLandscape));
+
+ iRestoreOrientation = ETrue;
+ ++iReleaseCnt;
+ }
+
+}
+
+void CMIDDisplayable::ReleaseOrientation()
+{
+ if (!iAvkonAppUi)
+ {
+ return;
+ }
+
+ if (iReleaseCnt > 0)
+ {
+ --iReleaseCnt;
+ if (iReleaseCnt == 0 && iRestoreOrientation)
+ {
+ TRAP_IGNORE(iAvkonAppUi->SetOrientationL(iOldUiOrientation));
+ iRestoreOrientation = EFalse;
+ }
+
+ }
+}
+
CPropertyWatch::CPropertyWatch()
: CActive(0)
{
--- a/javauis/lcdui_akn/lcdui/src/CMIDEdwin.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDEdwin.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -770,7 +770,8 @@
{
CEikEdwin::SetCursorPosL(cursorPos + 1, EFalse);
}
- else if (cursorPos == (iMaxSize - 1) && cursorPos == textLength && scanCode==EStdKeyFullStop)
+ else if (cursorPos == (iMaxSize - 1) && cursorPos == textLength &&
+ (scanCode == EStdKeyFullStop || scanCode == EStdKeyMinus))
{
CEikEdwin::SetCursorPosL(iMaxSize, EFalse);
}
@@ -840,7 +841,7 @@
}
}
- if (aType != EEventKey)
+ if (aType != EEventKey && aKeyEvent.iScanCode != EStdKeyApplication0)
{
UpdateTextCapacityIndicatorValueL();
return EKeyWasConsumed;
@@ -849,13 +850,16 @@
TKeyResponse response = EKeyWasNotConsumed;
- //Error tone playing case2:
- //Play error tone if TextBox/TextField is read-only or maximum length has been reached.
- //Here is handling of full keyboard keys(NOT 0...9) and all virtual keyboard keys.
- //(Note: Virtual keyboard sends only EEventKey type events, not up or down events)
- //(Note: Error tone is played when there is no text to be replaced i.e. no text has been painted)
- if (!iEdwinUtils->IsNavigationKey(aKeyEvent) && !iEdwinUtils->IsHotKeyL(aKeyEvent, iCoeEnv) && !aKeyEvent.iCode == EKeyYes &&
- (!iKeyEventsPending || (scanCode < KKeyQwerty0 || scanCode > KKeyQwerty9)))
+ // Error tone playing case2:
+ // Play error tone if TextBox/TextField is read-only or maximum length has been reached.
+ // Here is handling of full keyboard keys(NOT 0...9) and all virtual keyboard keys
+ // (camera and menu key not included).
+ // (Note: Virtual keyboard sends only EEventKey type events, not up or down events)
+ // (Note: Error tone is played when there is no text to be replaced i.e. no text has been painted)
+ if (!iEdwinUtils->IsNavigationKey(aKeyEvent) && !iEdwinUtils->IsHotKeyL(aKeyEvent, iCoeEnv) && aKeyEvent.iCode != EKeyYes &&
+ (!iKeyEventsPending || (scanCode < KKeyQwerty0 || scanCode > KKeyQwerty9)) &&
+ (aKeyEvent.iCode != EKeyApplication0 && scanCode != EStdKeyApplication0 &&
+ aKeyEvent.iCode != EKeyApplication19 && scanCode != EStdKeyApplication19))
{
if (IsReadOnly() || (TextLength() >= iMaxSize && aKeyEvent.iCode != EKeyBackspace))
{
@@ -922,14 +926,21 @@
if (res && TChar(aKeyEvent.iCode) == TChar('-') &&
TextLength() < iMaxSize)
{
+ TInt textLength = TextLength();
res->InsertL(GetCaretPosition(), KMinusChar);
HandleTextChangedL(); // notify editor about the text changes
CEikEdwin::ReportEdwinEventL(EEventTextUpdate);
+ TInt cursorPos = GetCaretPosition();
if (TextLength() < iMaxSize)
{
CEikEdwin::SetCursorPosL(GetCaretPosition() + 1, EFalse);
}
+ else if (cursorPos == (iMaxSize - 1) && cursorPos == textLength)
+
+ {
+ CEikEdwin::SetCursorPosL(iMaxSize, EFalse);
+ }
}
}
--- a/javauis/lcdui_akn/lcdui/src/CMIDForm.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDForm.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -159,7 +159,7 @@
/**
* Inserts a new Item.
*/
-void CMIDForm::InsertItemL(MMIDItem& aItem,TInt aIndex)
+void CMIDForm::InsertItemL(MMIDItem& aItem, TInt aIndex)
{
DEBUG("CMIDForm::InsertItemL");
@@ -339,6 +339,25 @@
TRect controlRect = GetControlRect(iFocused);
TBool visible = RectPartiallyVisible(controlRect);
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ TInt numItemCommands = controlItem.CommandList()->Count();
+
+ // If focused form item does not have any commands,
+ // and select key was pressed try to show screen\help option menu.
+ // ChoiceGroup and DateField handles this case separately.
+ // Gauge enter key is also handled here,
+ // so it would behave the same way as selection key.
+ if (numItemCommands == 0 && aType == EEventKey &&
+ controlItem.Type() != MMIDComponent::EChoiceGroup &&
+ controlItem.Type() != MMIDComponent::EDateField &&
+ (aKeyEvent.iScanCode == EStdKeyDevice3 ||
+ (aKeyEvent.iScanCode == EStdKeyEnter &&
+ controlItem.Type() == MMIDComponent::EGauge)))
+ {
+ iDisplayable.ShowScreenOrHelpOptionsMenuL();
+ }
+#endif // RD_JAVA_S60_RELEASE_9_2
+
// arrow key events are not sent to the hidden focused item
if ((visible || !isArrowKey) &&
controlItem.OfferKeyEventL(aKeyEvent,aType) == EKeyWasConsumed)
@@ -2314,11 +2333,7 @@
// Background for highlighted item, frame rects are set later
iHighlightedBackgroundCc = CAknsFrameBackgroundControlContext::NewL(
-#ifdef RD_JAVA_S60_RELEASE_9_2
- KAknsIIDQsnFrPopupPreview,
-#else
KAknsIIDQsnFrInput,
-#endif // RD_JAVA_S60_RELEASE_9_2
TRect(), TRect(), ETrue);
iDisplayable.SetComponentL(*this);
@@ -3156,9 +3171,28 @@
{
TInt numLines = aTextControl.NumLines();
for (TInt j = 0; j < numLines; j++)
- { // insert every line as a CMIDLabelContainerItem
- CreateAndAddLabelContainerItemL(
- aStringItem, *(aTextControl.LabelAtIdx(j)), aIsStringItemContent);
+ {
+ CEikLabel* label = aTextControl.LabelAtIdx(j);
+
+ if (label)
+ {
+ CGraphicsContext::TTextAlign align = aTextControl.LabelAtIdx(j)->iAlignment.TextAlign();
+
+ // If aLabel aligment is incorrect relayout aLabel
+ if ((align != CGraphicsContext::ERight &&
+ iInitialAlignment == MMIDItem::ERight) ||
+ (align != CGraphicsContext::ELeft &&
+ iInitialAlignment == MMIDItem::ELeft) ||
+ (align != CGraphicsContext::ECenter &&
+ iInitialAlignment == MMIDItem::ECenter))
+ {
+ aTextControl.LayoutItemLabel();
+ }
+
+ // insert every line as a CMIDLabelContainerItem
+ CreateAndAddLabelContainerItemL(
+ aStringItem, *(label), aIsStringItemContent);
+ }
if (j != (numLines-1))
{ // insert a row break except for the last line
@@ -3547,6 +3581,22 @@
return (aControlItem.iMMidItem->Type() == MMIDComponent::EChoiceGroup);
}
+TBool CMIDForm::IsPopupChoiceGroup(CMIDControlItem& aControlItem)
+{
+ if (aControlItem.iMMidItem
+ && aControlItem.iMMidItem->Type() == MMIDComponent::EChoiceGroup)
+ {
+ CMIDChoiceGroupItem& cgItem = static_cast<CMIDChoiceGroupItem&>(aControlItem);
+ CMIDChoiceGroupControl* cgControl =
+ static_cast<CMIDChoiceGroupControl*>(cgItem.ComponentControl(1));
+ if (cgControl && cgControl->ChoiceType() == MMIDChoiceGroup::EPopup)
+ {
+ return ETrue;
+ }
+ }
+ return EFalse;
+}
+
TBool CMIDForm::IsDateField(CMIDControlItem& aControlItem)
{
if (!aControlItem.iMMidItem)
@@ -3599,6 +3649,20 @@
}
}
}
+
+TInt CMIDForm::FormRowIndex(CMIDFormRow* aRow)
+{
+ return iRows.Find(aRow);
+}
+
+CMIDFormRow* CMIDForm::FormRow(TInt aIndex)
+{
+ if (iRows.Count() > aIndex)
+ {
+ return iRows[aIndex];
+ }
+ return NULL;
+}
#endif // RD_JAVA_S60_RELEASE_9_2
// returns: The number of new lines before an item.
@@ -3969,13 +4033,18 @@
TInt CMIDForm::GetMidpNaviPos()
{
- // get main pane size from CEikAppU
- TRect mainPane = iAvkonAppUi->ApplicationRect();
-
- // get screen size in pixels
TAknLayoutRect mainMidpPane;
+
+ // get main pane size from Avkon (size in pixels)
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ TRect mainPane;
+ AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPane);
+ mainMidpPane.LayoutRect(mainPane,
+ AknLayoutScalable_Avkon::main_midp_pane().LayoutLine());
+#else
mainMidpPane.LayoutRect(iEikonEnv->ScreenDevice()->SizeInPixels(),
AknLayoutScalable_Avkon::main_midp_pane().LayoutLine());
+#endif // RD_JAVA_S60_RELEASE_9_2
// getting form size depends on screen orientation
TInt variety = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0;
@@ -4168,6 +4237,10 @@
if (iPointedControl)
{
TInt highlightTimeout = iPhysics->HighlightDelay() * 1000;
+ if (IsPopupChoiceGroup(*iPointedControl))
+ {
+ highlightTimeout /= 2;
+ }
iHighlightTimer->Start(TTimeIntervalMicroSeconds32(highlightTimeout),
TTimeIntervalMicroSeconds32(highlightTimeout),
TCallBack(HighlightTimerCallback, this));
@@ -4307,7 +4380,14 @@
{
if (iFocused != KErrNotFound)
{
- ControlItem(iFocused).HandlePointerEventL(aPointerEvent);
+ if (IsPopupChoiceGroup(*iPointedControl))
+ {
+ iPointedControl->HandlePointerEventL(aPointerEvent);
+ }
+ else
+ {
+ ControlItem(iFocused).HandlePointerEventL(aPointerEvent);
+ }
}
if (LayoutPending())
--- a/javauis/lcdui_akn/lcdui/src/CMIDGaugeItem.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDGaugeItem.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -46,6 +46,9 @@
// using AknsDrawUtils for drawing background
#include <AknsDrawUtils.h>
#include <applayout.cdl.h>
+
+// for MAknsControlContext::SupplyMopObject method
+#include <AknsFrameBackgroundControlContext.h>
// LAF
#include <aknlayoutscalable_avkon.cdl.h>
@@ -98,7 +101,8 @@
void CMIDGaugeItem::CGaugeTimer::RunL()
{
if (!iGauge.iGaugeFrameData)
- {//if the bitmaps haven't been created it means we are inside an alert,
+ {
+ //if the bitmaps haven't been created it means we are inside an alert,
//which is using its own bitmaps for the gauge animation.
//Return without restarting the timer
return;
@@ -1079,7 +1083,8 @@
TSize CMIDNonInteractiveGauge::MinimumSize()
{
if (!iLabelControl || (iLabelControl->Text()->Length() == 0))
- { // item doesn't have label
+ {
+ // item doesn't have label
return TSize(FormClientAreaWidth(), iItemheightWithoutLabel);
}
else // item has label
@@ -1639,6 +1644,39 @@
iBitmapAnimation->BitmapAnimData()->FrameArray().Count() > 0;
}
+TTypeUid::Ptr CMIDNonInteractiveGauge::MopSupplyObject(TTypeUid aId)
+{
+ TTypeUid::Ptr ptr = TTypeUid::Null();
+
+ // When control context is requested we return new correct one.
+ // Default implementation otherwise.
+ if (aId.iUid == MAknsControlContext::ETypeId && iForm && IsFocused())
+ {
+ ptr = MAknsControlContext::SupplyMopObject(aId, BackgroundControlContext());
+ }
+ else
+ {
+ ptr = CMIDControlItem::MopSupplyObject(aId);
+ }
+ return ptr;
+}
+
+CAknsFrameBackgroundControlContext* CMIDNonInteractiveGauge::BackgroundControlContext()
+{
+ // It tries create new instance of CAknsFrameBackgroundControlContext.
+ // When construction fails, the error is logged.
+ CAknsFrameBackgroundControlContext* context = NULL;
+ TRAPD(err, context = CAknsFrameBackgroundControlContext::NewL(
+ KAknsIIDQsnFrInput, Rect(), Rect(), EFalse));
+ if (err != KErrNone)
+ {
+ DEBUG_INT("CMIDNonInteractiveGauge::BackgroundControlContext -\
+ CAknsFrameBackgroundControlContext::NewL failed with error number %d", err);
+ context = NULL;
+ }
+ return context;
+}
+
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
@@ -1745,7 +1783,8 @@
TSize CMIDInteractiveGauge::MinimumSize()
{
if (!iLabelControl || (iLabelControl->Text()->Length() == 0))
- { // item doesn't have label
+ {
+ // item doesn't have label
return TSize(FormClientAreaWidth(), iItemheightWithoutLabel);
}
else // item has label
--- a/javauis/lcdui_akn/lcdui/src/CMIDItemLabel.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDItemLabel.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -643,6 +643,11 @@
} //else
}
+void CMIDItemLabel::LayoutItemLabel()
+{
+ SizeChanged();
+}
+
void CMIDItemLabel::ResetLabelArray()
{
for (TInt i=0; i < iLabelArray->Count(); i++)
--- a/javauis/lcdui_akn/lcdui/src/CMIDMenuHandler.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDMenuHandler.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -44,6 +44,8 @@
#include "lcdui.h"
#include <j2me/jdebug.h>
#include "CMIDUIManager.h"
+#include "coreuiavkonlcdui.h"
+#include "coreuiappui.h"
const TInt KResolutionStringLength = 4;
@@ -201,23 +203,24 @@
//
void CMIDMenuHandler::SendMultipleKeyPressedEvent()
{
- ASSERT(iDisplayable);
-
- RWsSession wsSession = CCoeEnv::Static()->WsSession();
- TWsEvent event;
-
- // Check the current Display type if it is canvas enable the
- // multiple key events, other wise disable it.
- MMIDComponent* component = iDisplayable->Component();
- MMIDComponent::TType type = component->Type();
-
- if (type == MMIDComponent::ECanvas)
- event.SetType(EEnableMultipleKeyPressedEvent); // set event type enable multiple key pressed event
- else
- event.SetType(EDisableMultipleKeyPressedEvent); // set event type disable multiple key pressed event
- event.SetTimeNow(); // set the event time
- event.SetHandle(wsSession.WsHandle()); // set window server handle
- wsSession.SendEventToAllWindowGroups(event);
+ ASSERT(iDisplayable);
+ java::ui::CoreUiAvkonAppUi* appUi =
+ java::ui::CoreUiAvkonLcdui::getInstance().getJavaUiAppUi();
+ if (appUi)
+ {
+ MMIDComponent* component = iDisplayable->Component();
+ if (component)
+ {
+ if (component->Type() == MMIDComponent::ECanvas)
+ {
+ appUi->glueSetKeyBlockMode(ENoKeyBlock);
+ }
+ else
+ {
+ appUi->glueSetKeyBlockMode(EDefaultBlockMode);
+ }
+ }
+ }
}
--- a/javauis/lcdui_akn/lcdui/src/CMIDTactileFeedbackExtension.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDTactileFeedbackExtension.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -22,6 +22,8 @@
#include "CMIDCanvas.h"
#include "CMIDCustomItem.h"
+#include <j2me/jdebug.h>
+
CMIDTactileFeedbackExtension::CMIDTactileFeedbackExtension(MMIDTactileFeedbackComponent* aParent, TInt aParentType): TypeCanvas(1), TypeCustomItem(2)
{
@@ -74,6 +76,7 @@
void CMIDTactileFeedbackExtension::RegisterFeedbackArea(TInt aId, TRect aRect, TInt aStyle)
{
FeedbackArea* area = GetAreaByID(aId, NULL);
+ TInt err = KErrNone;
if (area)
{
area->rect = aRect;
@@ -85,10 +88,17 @@
newArea.id = aId;
newArea.rect = aRect;
newArea.style = (TTouchLogicalFeedback)aStyle;
- iFeedbackAreasArray.Append(newArea);
+ err = iFeedbackAreasArray.Append(newArea);
}
- iParent->UpdateTactileFeedback();
+ if (KErrNone == err )
+ {
+ iParent->UpdateTactileFeedback();
+ }
+ else
+ {
+ DEBUG_INT("CMIDTactileFeedbackExtension::RegisterFeedbackArea - RArray append error %d", err);
+ }
}
void CMIDTactileFeedbackExtension::SetFeedbackArea(TInt aId, TRect aRect, TInt aStyle)
--- a/javauis/lcdui_akn/lcdui/src/CMIDTextBoxDialogControl.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDTextBoxDialogControl.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -68,12 +68,13 @@
iTextContent.CreateL(KNullDesC, aMaxSize);
CreateTextBoxQueryDialogL(iDialog, aConstraints, aMaxSize, aText);
+ SetTextL(aText);
iDisplayable->SetPopupTextBox(ETrue);
SetRect(iDisplayable->Rect());
iDisplayable->SetComponentL(*this);
- SetTextL(aText);
+
SetContainerWindowL(*iDisplayable);
iCurrentText = GetTextL();
@@ -175,13 +176,10 @@
TInt curPosition = iCursorPosition;
iCursorPosition = 0;
- iDialog->SetCursorPositionL(0);
+ iDialog->SetCursorPositionL(iCursorPosition);
+
iDialog->ShowL(ETrue);
-
- if (iCurrentText)
- {
- SetTextL(*iCurrentText);
- }
+
iCursorPosition = curPosition;
// Set cursor position back to original value.
iDialog->SetCursorPositionL(iCursorPosition);
--- a/javauis/lcdui_akn/lcdui/src/CMIDTextBoxQueryDialog.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDTextBoxQueryDialog.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -455,7 +455,6 @@
void CMIDTextBoxQueryDialog::FocusChanged(TDrawNow aDrawNow)
{
CAknTextQueryDialog::FocusChanged(aDrawNow);
- TRAP_IGNORE(UpdateScrollBarPositionL());
}
//
// We do not want to become visible if we are not showing
@@ -689,7 +688,8 @@
{
SetCursorPositionL(cursorPos + 1);
}
- else if (cursorPos == (iMaxSize - 1) && cursorPos == textLength && scanCode==EStdKeyFullStop)
+ else if (cursorPos == (iMaxSize - 1) && cursorPos == textLength &&
+ (scanCode == EStdKeyFullStop || scanCode == EStdKeyMinus))
{
SetCursorPositionL(iMaxSize);
}
@@ -768,13 +768,16 @@
// If there is no focus textbox should not consume keys
if (isFocused)
{
- //Error tone playing case2:
- //Play error tone if TextBox/TextField is read-only or maximum length has been reached.
- //Here is handling of full keyboard keys(NOT 0...9) and all virtual keyboard keys.
- //(Note: Virtual keyboard sends only EEventKey type events, not up or down events)
- //(Note: Error tone is played when there is no text to be replaced i.e. no text has been painted)
- if (!iEdwinUtils->IsNavigationKey(aKeyEvent) && !iEdwinUtils->IsHotKeyL(aKeyEvent, iCoeEnv) && !aKeyEvent.iCode == EKeyYes &&
- (!iKeyEventsPending || (scanCode < KKeyQwerty0 || scanCode > KKeyQwerty9)))
+ // Error tone playing case2:
+ // Play error tone if TextBox/TextField is read-only or maximum length has been reached.
+ // Here is handling of full keyboard keys(NOT 0...9) and all virtual keyboard keys
+ // (camera and menu key not included).
+ // (Note: Virtual keyboard sends only EEventKey type events, not up or down events)
+ // (Note: Error tone is played when there is no text to be replaced i.e. no text has been painted)
+ if (!iEdwinUtils->IsNavigationKey(aKeyEvent) && !iEdwinUtils->IsHotKeyL(aKeyEvent, iCoeEnv) && aKeyEvent.iCode != EKeyYes &&
+ (!iKeyEventsPending || (scanCode < KKeyQwerty0 || scanCode > KKeyQwerty9)) &&
+ (aKeyEvent.iCode != EKeyApplication0 && scanCode != EStdKeyApplication0 &&
+ aKeyEvent.iCode != EKeyApplication19 && scanCode != EStdKeyApplication19))
{
if (iEditor->IsReadOnly() || (Size() >= iMaxSize && aKeyEvent.iCode != EKeyBackspace))
{
@@ -835,15 +838,21 @@
if (res && TChar(aKeyEvent.iCode) == TChar('-') &&
Size() < iMaxSize)
{
+ TInt textLength = Size();
res->InsertL(GetCaretPosition(), KMinusChar);
// notify editor about the text changes
iEditor->HandleTextChangedL();
+ TInt cursorPos = GetCaretPosition();
if (Size() < iMaxSize)
{
SetCursorPositionL(GetCaretPosition() + 1);
}
+ else if (cursorPos == (iMaxSize - 1) && cursorPos == textLength)
+ {
+ SetCursorPositionL(iMaxSize);
+ }
//Prevent changes that would result in an illegal string
HandleTextUpdateL(MEikEdwinObserver::EEventTextUpdate);
}
@@ -1069,6 +1078,9 @@
}
else
{
+ // avoid po-pup dialog box blinking
+ MakeVisible(EFalse);
+
ExitSleepingDialog();
#ifdef RD_SCALABLE_UI_V2
SetPointerCapture(EFalse);
@@ -1282,6 +1294,11 @@
iThisMultitapKey = 0; // reset key counter
iLastMultitapKey = 0;
+
+ if(iEditor->ScrollBarFrame())
+ {
+ iEditor->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff);
+ }
}
TBool CMIDTextBoxQueryDialog::Showing()
@@ -1550,12 +1567,7 @@
void CMIDTextBoxQueryDialog::HandleResourceChange(TInt aType)
{
CAknTextQueryDialog::HandleResourceChange(aType);
- if (aType == KEikDynamicLayoutVariantSwitch ||
- aType == KEikColorResourceChange || aType == KAknsMessageSkinChange ||
- aType == KUidValueCoeColorSchemeChangeEvent)
- {
- TRAP_IGNORE(UpdateScrollBarPositionL());
- }
+ TRAP_IGNORE(UpdateScrollBarPositionL());
}
/* UpdateScrollBarPositionL
@@ -1564,25 +1576,25 @@
*/
void CMIDTextBoxQueryDialog::UpdateScrollBarPositionL()
{
- if(iEditor && iEditor->TextLayout())
+ if (iEditor && iEditor->TextLayout())
{
TInt numLines = iEditor->TextLayout()->NumFormattedLines();
- if(numLines == iEditor->MaximumHeightInLines())
+ if (numLines == iEditor->MaximumHeightInLines())
{
- if(iEditor->ScrollBarFrame())
+ if (iEditor->ScrollBarFrame())
{
iEditor->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff);
}
}
- else if(numLines > iEditor->MaximumHeightInLines())
+ else if (numLines > iEditor->MaximumHeightInLines())
{
- if(!iEditor->ScrollBarFrame())
+ if (!iEditor->ScrollBarFrame())
{
iEditor->CreatePreAllocatedScrollBarFrameL();
iEditor->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
}
TRect editorRect = iEditor->Rect();
- if(iEditor->ScrollBarFrame()->VerticalScrollBar())
+ if (iEditor->ScrollBarFrame()->VerticalScrollBar())
{
editorRect.SetWidth(editorRect.Width() - iEditor->ScrollBarFrame()->VerticalScrollBar()->ScrollBarBreadth());
iEditor->SetRect(editorRect);
@@ -1590,4 +1602,10 @@
}
}
}
+
+void CMIDTextBoxQueryDialog::PreLayoutDynInitL()
+{
+ CAknQueryDialog::PreLayoutDynInitL();
+ UpdateLeftSoftKeyL();
+}
// End of file
--- a/javauis/lcdui_akn/lcdui/src/CMIDTextEditor.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDTextEditor.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -357,13 +357,13 @@
// It sets edwin variables necessary for correct clipping.
iTextEdwin->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect());
iTextEdwin->SetScaling(IsScalingOn());
-
+
// It sets indicator variables necessary for correct clipping.
iEditingStateIndicator->SetScalingOn(IsScalingOn());
iEditingStateIndicator->SetCanvasRect(iUtils->GetOnScreenCanvasRect());
}
}
-
+
DEBUG("CMIDTextEditor::SetParentL -");
}
@@ -614,9 +614,9 @@
// Remove the selection at this point. The selection can be
// set again with the API.
SetCursorPositionL(iTextEdwin->CursorPos());
-
+
if (iEditingStateIndicator->EnabledState() ==
- CMIDEditingStateIndicator::EIndicatorStateRelative)
+ CMIDEditingStateIndicator::EIndicatorStateRelative)
{
// Enable the custom indicators as in Avkon if not controlled
// by the client application
@@ -1429,7 +1429,14 @@
TInt newEditorWindowHeight = iTextEdwin->EditorWindowHeight();
if (size.iHeight != newEditorWindowHeight)
{
- SetEditorSize(size.iWidth, newEditorWindowHeight);
+ if (!IsScalingOn())
+ {
+ SetEditorSize(size.iWidth, newEditorWindowHeight);
+ }
+ else if (iUtils)
+ {
+ SetEditorSize(size.iWidth, iUtils->DoDescaling(newEditorWindowHeight, CMIDUtils::EVertical));
+ }
}
// SetEditorSize method resets the flag, make sure it remains true
// here.
@@ -2187,6 +2194,17 @@
}
}
+void CMIDTextEditor::HandleForeground(TBool aForeground)
+{
+ // If Canvas goes to foreground and scaling is on,
+ // then we resize a TextEditor.
+ if (aForeground && iUtils && iComponentContainer && iUtils->IsScalingEnabled() &&
+ iComponentContainer->IsFullScreen())
+ {
+ HandleChangeForScaling(EForegroundGained);
+ }
+}
+
void CMIDTextEditor::HandleChangeForScaling(TChange aChange)
{
// It is needed to store iRowCountActive, because SetEditorSize resets it.
@@ -2207,7 +2225,9 @@
// restoring of iRowCountActive
iRowCountActive = rowCountActive;
- if ((aChange == EFullscreenChange) || (aChange == EResolutionChange))
+ if (aChange == EFullscreenChange
+ || aChange == EResolutionChange
+ || aChange == EForegroundGained)
{
if (iUtils)
{
@@ -2226,6 +2246,11 @@
}
}
+ if (aChange == EForegroundGained)
+ {
+ iEditingStateIndicator->MakeVisible(iEditingStateIndicator->EnabledState());
+ }
+
#ifdef RD_JAVA_S60_RELEASE_9_2
if (aChange == EPartialVKBChange)
{
--- a/javauis/lcdui_akn/lcdui/src/CMIDTextFieldEdwin.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDTextFieldEdwin.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -123,11 +123,7 @@
}
else
{ // skinning colour groups for editable text
- // Set color for content text (logical color constants
- // are defined in lcdui.h)
- skinTextColor = IsFocused() ?
- TAknsQsnTextColorsIndex(KHighlightedItemTextColor)
- : TAknsQsnTextColorsIndex(KNonHighlightedItemTextColor);
+ skinTextColor = IsFocused() ? EAknsCIQsnTextColorsCG8 : EAknsCIQsnTextColorsCG6;
}
TRect parentRect = aRect;
--- a/javauis/lcdui_akn/lcdui/src/CMIDTextFieldItem.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDTextFieldItem.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -677,17 +677,15 @@
{
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(KHighlightedItemTextColor);
+ iTextField->SetTextSkinColorIdL(EAknsCIQsnTextColorsCG8);
}
else
{
// Text colour from skin - unfocused
- iTextField->SetTextSkinColorIdL(KNonHighlightedItemTextColor);
+ iTextField->SetTextSkinColorIdL(EAknsCIQsnTextColorsCG6);
}
}
}
--- a/javauis/lcdui_akn/lcdui/src/CMIDTicker.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDTicker.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -795,7 +795,7 @@
if (aAdd)
{ //KAddDisplayable:
- iDisplayableRArray.Append(aDisplayable);
+ iDisplayableRArray.AppendL(aDisplayable);
}
else
{
--- a/javauis/lcdui_akn/lcdui/src/CMIDUtils.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDUtils.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -703,7 +703,6 @@
iStickyHandler.Reset();
}
-
#ifdef RD_INTELLIGENT_TEXT_INPUT
TPtiTextCase textCase = EPtiCaseLower;
@@ -731,6 +730,15 @@
TBuf<KPTIEngineResultSize> mapData;
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ // Set keyboard type/layout just before mapping the key
+ TRAPD(err, SetPtiKeyboardL());
+ if (err != KErrNone)
+ {
+ DEBUG_INT("CMIDUtils::MappingDataForKey - SetPtiKeyboardL leaved with error = %d", err);
+ }
+#endif // RD_JAVA_S60_RELEASE_9_2
+
iPtiEngine->MappingDataForKey(
(TPtiKey)aEvent.iScanCode, mapData, textCase);
@@ -740,53 +748,35 @@
aEvent.iCode = mapData[0];
}
#endif // RD_INTELLIGENT_TEXT_INPUT
-
}
void CMIDUtils::UpdatePTIEngineStatusL()
{
-
#ifdef RD_INTELLIGENT_TEXT_INPUT
-
RProperty::Get(KCRUidAvkon, KAknQwertyInputModeActive, iQwertyMode);
- // keyboard layout default value: 0 - No Keyboard
- TInt keyboardLayout = 0;
// Read keyboard layout from central repository
- RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardLayout);
+ RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, iPtiKeyboardType);
+ SetPtiKeyboardL();
TPtiEngineInputMode mode = EPtiEngineInputModeNone;
- switch (keyboardLayout)
+ switch (iPtiKeyboardType)
{
case EPtiKeyboard12Key:
mode = EPtiEngineMultitapping;
-#ifdef RD_JAVA_S60_RELEASE_5_0_IAD
- CallToJavaPtiVariationL(keyboardLayout);
-#else
- iPtiEngine->SetKeyboardType((TPtiKeyboardType)keyboardLayout);
-#endif
break;
case EPtiKeyboardQwerty4x12:
case EPtiKeyboardQwerty4x10:
case EPtiKeyboardQwerty3x11:
-#ifdef RD_JAVA_S60_RELEASE_5_0_IAD
- CallToJavaPtiVariationL(keyboardLayout);
-#else
- iPtiEngine->SetKeyboardType((TPtiKeyboardType)keyboardLayout);
-#endif
mode = EPtiEngineQwerty;
break;
case EPtiKeyboardHalfQwerty:
-#ifdef RD_JAVA_S60_RELEASE_5_0_IAD
- CallToJavaPtiVariationL(keyboardLayout);
-#else
- iPtiEngine->SetKeyboardType((TPtiKeyboardType)keyboardLayout);
-#endif
mode = EPtiEngineHalfQwerty;
break;
default:
break;
}
+
// input language default value: 0 (automatic)
TInt inputLang = 0;
if (iRepository)
@@ -807,19 +797,16 @@
inputLang = ELangEnglish;
}
}
+
TRAPD(err, iPtiEngine->ActivateLanguageL(inputLang, mode));
if (KErrNone != err)
{
DEBUG_INT("CMIDUtils::UpdatePTIEngineStatusL - ActivateLanguageL leaved with error = %d", err);
return;
}
-
-
#endif // RD_INTELLIGENT_TEXT_INPUT
-
}
-
void CMIDUtils::HandleResourceChangedL()
{
UpdatePTIEngineStatusL();
@@ -841,6 +828,9 @@
: iEnv(&aEnv)
, iUIManager(aUIManager)
, iScalingData()
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+ , iPtiKeyboardType(EPtiKeyboardNone)
+#endif // RD_INTELLIGENT_TEXT_INPUT
, iQwertyMode(EFalse)
, iStickyKey(0)
, iLastScanCode(0)
@@ -865,7 +855,6 @@
delete iRepository;
iRepository = NULL;
#endif //RD_INTELLIGENT_TEXT_INPUT
-
}
#ifdef RD_INTELLIGENT_TEXT_INPUT
@@ -1222,12 +1211,18 @@
{
screenRect = current->GetCanvasRectFromLaf();
}
+ else
+ {
+ // No displayable is current. It will be initialized in other time.
+ iScalingDataInitialized=EFalse;
+ return;
+ }
// Traslate of rect of screen into size
data.iScreenSize = screenRect.Size();
- // Check if scaling is is on now.
- if (iMenuHandler->IsScalingEffectiveInCurrentScreen())
+ // Check if scaling is ON now.
+ if (iMenuHandler->IsScalingEnabled())
{
// Get original and target size from JAD attributes
@@ -1626,4 +1621,18 @@
return TRect(canvasOrigin, iScalingData.iCanvasSize);
}
+#ifdef RD_INTELLIGENT_TEXT_INPUT
+void CMIDUtils::SetPtiKeyboardL()
+{
+#ifdef RD_JAVA_S60_RELEASE_5_0_IAD
+ CallToJavaPtiVariationL(iPtiKeyboardType);
+#else
+ if (iPtiEngine)
+ {
+ iPtiEngine->SetKeyboardType((TPtiKeyboardType)iPtiKeyboardType);
+ }
+#endif // RD_JAVA_S60_RELEASE_5_0_IAD
+}
+#endif // RD_INTELLIGENT_TEXT_INPUT
+
// End of File
--- a/javauis/lcdui_akn/lcdui/src/Cmidformrow.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/Cmidformrow.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -26,6 +26,18 @@
#include "CMIDControlItem.h"
#include "CMIDItemLabel.h"
+#ifdef RD_JAVA_S60_RELEASE_9_2
+#include "CMIDLabelContainerItem.h"
+
+#include <AknsUtils.h>
+#include <aknlayoutscalable_avkon.cdl.h>
+
+// CONSTANTS
+// Default for Form separator line color's alpha value, used if not
+// found from skin.
+const TInt KDefaultSeparatorAlpha = 32;
+const TInt KDefaultSeparatorColor = 0;
+#endif // RD_JAVA_S60_RELEASE_9_2
CMIDFormRow* CMIDFormRow::NewL(CMIDForm& aForm)
{
@@ -64,6 +76,49 @@
return iItems[aIndex];
}
+#ifdef RD_JAVA_S60_RELEASE_9_2
+void CMIDFormRow::Draw(const TRect& /*aRect*/) const
+{
+ if (iSeparator)
+ {
+ CWindowGc& gc = SystemGc();
+ MAknsSkinInstance* skin = AknsUtils::SkinInstance();
+ gc.SetBrushStyle(CGraphicsContext::ENullBrush);
+ gc.SetPenStyle(CGraphicsContext::ESolidPen);
+
+ TRgb color;
+ TInt err = AknsUtils::GetCachedColor(skin,
+ color,
+ KAknsIIDQsnTextColors,
+ EAknsCIQsnTextColorsCG6);
+ if (err != KErrNone)
+ {
+ color = KDefaultSeparatorColor;
+ }
+
+ TRgb colorFromSkin;
+ // Get alpha value from skin, if not successful, default is used.
+ err = AknsUtils::GetCachedColor(skin ? skin : AknsUtils::SkinInstance(),
+ colorFromSkin,
+ KAknsIIDQsnLineColors,
+ EAknsCIQsnLineColorsCG15);
+
+ color.SetAlpha(!err ? colorFromSkin.Red() : KDefaultSeparatorAlpha);
+ gc.SetDrawMode(CGraphicsContext::EDrawModePEN);
+ gc.SetPenColor(color);
+
+ // Draw line to upper part of the form row.
+ TRect lineRect(Rect());
+ // Using same margin value with avkon list box separator lines.
+ TInt gap = AknLayoutScalable_Avkon::listscroll_gen_pane(0).LayoutLine().it;
+ lineRect.Shrink(gap, 0);
+ lineRect.Move(0, 1);
+ gc.DrawLine(TPoint(lineRect.iTl.iX, lineRect.iTl.iY),
+ TPoint(lineRect.iBr.iX, lineRect.iTl.iY));
+ }
+}
+#endif // RD_JAVA_S60_RELEASE_9_2
+
void CMIDFormRow::SizeChanged()
{
TInt xOff = 0;
@@ -163,6 +218,10 @@
User::LeaveIfError(iItems.Insert(aItem, 0));
}
iCurrentWidth += aItem->Size().iWidth;
+
+#ifdef RD_JAVA_S60_RELEASE_9_2
+ SetSeparator();
+#endif // RD_JAVA_S60_RELEASE_9_2
}
void CMIDFormRow::SetAlignment(MMIDItem::TLayout aAlignment)
@@ -470,7 +529,7 @@
{
#ifdef RD_SCALABLE_UI_V2
SetAllowStrayPointers();
-#endif
+#endif // RD_SCALABLE_UI_V2
}
void CMIDFormRow::ConstructL()
@@ -497,4 +556,95 @@
return ret;
}
+#ifdef RD_JAVA_S60_RELEASE_9_2
+void CMIDFormRow::SetSeparator()
+{
+ // Separator is not drawn above the first row.
+ if (iForm.FormRowIndex(this) <= 0)
+ {
+ iSeparator = EFalse;
+ return;
+ }
+ else
+ {
+ iSeparator = ETrue;
+ }
+
+ // Separator is not drawn if the rows includes only spacers
+ if (!HasNonSpacerItems())
+ {
+ iSeparator = EFalse;
+ return;
+ }
+
+ if (Item(0)->HasLabel())
+ {
+ iSeparator = ETrue;
+ return;
+ }
+ else
+ {
+ // If the first item is other than StringItem then draw separator.
+ if (!CMIDForm::IsLabelContainerItem(*Item(0)))
+ {
+ iSeparator = ETrue;
+ return;
+ }
+ else
+ {
+ // If Button type StringItem then separator is drawn.
+ if (CMIDForm::IsStringItemButton(*Item(0)))
+ {
+ iSeparator = ETrue;
+ return;
+ }
+
+ CMIDLabelContainerItem* ucsi = static_cast<CMIDLabelContainerItem*>(Item(0));
+ // If the first item is label, then draw separator.
+ if (ucsi && !ucsi->IsStringItemContent())
+ {
+ iSeparator = ETrue;
+ return;
+ }
+ else
+ {
+ // If the last item in the previous row is StringItem,
+ // then do not draw separator.
+ TInt prevRowIndex = iForm.FormRowIndex(this) - 1;
+ if (prevRowIndex >= 0)
+ {
+ CMIDFormRow* prevRow = iForm.FormRow(prevRowIndex);
+ TInt index = 0;
+ if (prevRow)
+ {
+ index = prevRow->NumItems();
+
+ // If there are items in previous row check if row is StrinItem
+ if (index >= 1)
+ {
+ CMIDControlItem* lastPrevItem = prevRow->Item(index - 1);
+
+ if (lastPrevItem && CMIDForm::IsLabelContainerItem(*lastPrevItem))
+ {
+ iSeparator = EFalse;
+ return;
+ }
+ else
+ {
+ iSeparator = ETrue;
+ return;
+ }
+ }
+ else
+ {
+ iSeparator = ETrue;
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+#endif // RD_JAVA_S60_RELEASE_9_2
// End of File
--- a/javauis/lcdui_akn/lcduiphysicswrapper/build/lcduiphysicswrapper.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcduiphysicswrapper/build/lcduiphysicswrapper.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -41,10 +41,10 @@
SOURCEPATH ../src
SOURCE CMIDPhysicsWrapper.cpp
-USERINCLUDE ../inc
-SYSTEMINCLUDE ../../inc
-SYSTEMINCLUDE ../../../inc
-SYSTEMINCLUDE ../../../../inc
+USERINCLUDE ../inc
+USERINCLUDE ../../inc
+USERINCLUDE ../../../inc
+USERINCLUDE ../../../../inc
// Dependencies to apps layer
LIBRARY aknphysics.lib
--- a/javauis/m2g_akn/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/m2g_akn/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -24,13 +24,9 @@
file -->
<target name="compile">
- <omj.javac classpath="${classpath}:${impl.cldc.jar}"/>
+ <omj.javac classpath="${compile.result.root}/javalegacyutils/classes/collection:${compile.result.root}/javalcdui/classes/first"/>
</target>
-
- <!-- Needed by the utilities.xml. See the description form the utilities.xml
- file -->
-
<property name="javah.classnames"
value="com.nokia.microedition.m2g.M2GDocument,
com.nokia.microedition.m2g.M2GSVGPath,
--- a/javauis/m2g_akn/build/javam2g_0x2002DCBD.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/m2g_akn/build/javam2g_0x2002DCBD.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javam2g.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javauis/m3g_akn/build/javam3g_0x2002DCBE.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/m3g_akn/build/javam3g_0x2002DCBE.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javam3g.mmp
@@ -54,7 +54,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javauis/m3g_akn/javasrc/javax/microedition/m3g/Graphics3D.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/m3g_akn/javasrc/javax/microedition/m3g/Graphics3D.java Thu Aug 19 09:48:13 2010 +0300
@@ -107,7 +107,7 @@
private Rect viewport;
private Rect clip;
private boolean ngaEnabled = false;
- private boolean foreground;
+ private boolean pendingGLESRelease = false;
//------------------------------------------------------------------
@@ -128,9 +128,7 @@
}
if (instance.graphics3D == null)
{
- // graphics3D must be assigned to interface before asking foreground status
instance.graphics3D = new Graphics3D();
- instance.graphics3D.foreground = ToolkitInvoker.getToolkitInvoker().isForeground();
}
return instance.graphics3D;
}
@@ -158,7 +156,7 @@
this.clip = new Rect();
// Initializes NGA status - enabled or disabled
ngaEnabled = invoker.isNgaEnabled();
- }
+ }
/**
*
@@ -185,7 +183,7 @@
*/
public void bindTarget(java.lang.Object target, boolean depth, int flags)
{
- synchronized (Interface.getInstance())
+ synchronized (Interface.getInstance())
{
integrityCheck();
int eventSrcHandle = 0;
@@ -288,16 +286,16 @@
*/
public void releaseTarget()
{
- synchronized (Interface.getInstance())
+ synchronized (Interface.getInstance())
{
integrityCheck();
if (currentTarget == null)
{
return;
}
-
+
int eventSrcHandle = 0;
-
+
try
{
// Bind event source
@@ -328,9 +326,12 @@
finally
{
currentTarget = null;
-
- if (ngaEnabled && !foreground && eventSrcHandle != 0)
+
+ if (ngaEnabled &&
+ pendingGLESRelease &&
+ eventSrcHandle != 0)
{
+ pendingGLESRelease = false;
_freeGLESResources(eventSrcHandle, handle);
}
@@ -748,16 +749,19 @@
}
}
- void setForeground(boolean foreground)
+ void freeGraphicsMemory()
{
synchronized (Interface.getInstance())
{
- this.foreground = foreground;
- if (ngaEnabled &&
- !foreground &&
- currentTarget == null)
+ if (!ngaEnabled)
{
- try
+ return;
+ }
+
+ if (currentTarget == null)
+ {
+ pendingGLESRelease = false;
+ try
{
_freeGLESResources(Interface.bindEventSource(), handle);
}
@@ -766,9 +770,13 @@
Interface.releaseEventSource();
}
}
+ else
+ {
+ pendingGLESRelease = true;
+ }
}
}
-
+
private native static int _ctor(int hInterface);
private native static void _addRef(int hObject);
@@ -850,6 +858,6 @@
private native static int _getTargetWidth(int graphicsHandle);
private native static void _updateEglContent(int eventSourceHandle,
int graphicsHandle);
- private native static void _freeGLESResources(int eventSourceHandle,
+ private native static void _freeGLESResources(int eventSourceHandle,
int handle);
}
--- a/javauis/m3g_akn/javasrc/javax/microedition/m3g/Interface.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/m3g_akn/javasrc/javax/microedition/m3g/Interface.java Thu Aug 19 09:48:13 2010 +0300
@@ -427,15 +427,15 @@
}
MemoryUtil.freeNativeMemory();
}
-
+
/*
- * @see ToolkitObserverNGAExtension#foregroundEvent(boolean)
+ * @see ToolkitObserverNGAExtension#freeGraphicsMemory()
*/
- public void foregroundEvent(boolean foreground)
+ public void freeGraphicsMemory()
{
if (graphics3D != null)
{
- graphics3D.setForeground(foreground);
+ graphics3D.freeGraphicsMemory();
}
}
--- a/javauis/mmapi_akn/audiostreaming/inc.emc/cmmaaudiostreammetadatacontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/audiostreaming/inc.emc/cmmaaudiostreammetadatacontrol.h Thu Aug 19 09:48:13 2010 +0300
@@ -20,7 +20,7 @@
#define CMMAAUDIOSTREAMMETADATACONTROL_H
// INCLUDES
-#include <mmfcontroller.h>
+#include <mmf/common/mmfcontroller.h>
#include <MetaDataUtility.h>
#include <MetaDataFieldContainer.h>
#include "cmmametadatacontrol.h"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/inc.dsa/cmmacameraplayer.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,157 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class is used for playing camera.
+*
+*/
+
+
+#ifndef CMMACAMERAPLAYER_H
+#define CMMACAMERAPLAYER_H
+
+// INCLUDES
+#include <ecam.h>
+#include "cmmaplayer.h"
+#include "mmmaguiplayer.h"
+#include "mmmasnapshot.h"
+#include "cmmacamerawindow.h"
+
+// CONSTANTS
+_LIT(KMMACameraPlayer, "CameraPlayer");
+
+// CLASS DECLARATION
+/**
+* This class is used for playing camera.
+*
+*
+*/
+
+NONSHARABLE_CLASS(CMMACameraPlayer): public CMMAPlayer,
+ public MMMAGuiPlayer,
+ public MMMASnapshot,
+ public MCameraObserver
+{
+public: // Construction
+ /**
+ * Creates new CMMACameraPlayer for the camera at certain index.
+ * Index must be smaller CCamera::CamerasAvailable().
+ * @param aCameraIndex Index of the camera.
+ */
+ static CMMACameraPlayer* NewLC(TInt aCameraIndex);
+
+ // Destructor
+ ~CMMACameraPlayer();
+
+protected:
+ // C++ constructor
+ CMMACameraPlayer();
+ void ConstructL(TInt aCameraIndex);
+
+private: // new methods
+ TInt64 CurrentTime();
+ void ResolveViewFinderSizeL(TSize& aSize);
+ void ResolveScreenSizeL(TSize& aSize);
+ void ResolveCaptureSizes(const CCamera::TFormat aFormat,
+ const TInt aNumImageSizesSupported,
+ const TSize& aRequestSize,
+ TSize& aSourceSize,
+ TInt& aSourceIndex,
+ TInt& aLargestIndex);
+
+public: // from CMMAPlayer
+ void StartL(TBool aPostEvent);
+ void StopL(TBool aPostEvent);
+ void DeallocateL();
+ void RealizeL();
+ void PrefetchL();
+ void GetDuration(TInt64* aDuration);
+ void SetMediaTimeL(TInt64* aTime);
+ void GetMediaTime(TInt64* aMediaTime);
+ void CloseL();
+ const TDesC& Type();
+public: // From MCameraObserver
+ void ReserveComplete(TInt aError);
+ void PowerOnComplete(TInt aError);
+ void ViewFinderFrameReady(CFbsBitmap& aFrame);
+
+ void ImageReady(CFbsBitmap* aBitmap,
+ HBufC8* aData,
+ TInt aError);
+
+ void FrameBufferReady(MFrameBuffer* aFrameBuffer,
+ TInt aError);
+
+public: // From MMMAGuiPlayer
+ void SetDisplayL(MMMADisplay* aDisplay);
+ TSize SourceSize();
+ void NotifyWithStringEvent(CMMAPlayerEvent::TEventType aEventType,
+ const TDesC& aStringEventData);
+ MMMASnapshot* SnapshoterL();
+
+public: // From MMMASnapshot
+ MMMASnapshot::TEncoding TakeSnapshotL(TRequestStatus* aStatus,
+ const TSize& aSize,
+ const CMMAImageSettings& aSettings);
+ CFbsBitmap* SnapshotBitmap();
+ HBufC8* SnapshotEncoded();
+
+public: // New methods
+ TInt CameraHandle();
+ /**
+ * Disables or enables viewfinder stopping.
+ * Needed when using recording.
+ *
+ * @param aStopViewFinder If true viewfinder will be really stopped.
+ */
+ void SetViewFinderMode(TBool aStopViewFinder);
+
+private: // Data
+ /**
+ * Window used to render viewfinder.
+ * Owned.
+ */
+ CMMACameraWindow* iWindow;
+
+ /**
+ * Camera instance used for taking snapshots and recording.
+ * iWindow uses this to create duplicated camera instance.
+ * Owned.
+ */
+ CCamera* iCamera;
+ MMMADisplay* iDisplay;
+
+ // index to be used for size enumeration
+ TInt iSourceSizeIndex;
+
+ TInt64 iMediaTime;
+ TInt64 iStartTime;
+
+ TRequestStatus* iSnapshotStatus;
+
+ // Owned.
+ CFbsBitmap* iSnapshotBitmap;
+ HBufC8* iSnapshotEncoded;
+
+ TSize iSize;
+ TBool iStopViewFinder;
+
+ // inner class for waiting realize, owned
+ class CRealizeWait : public CActiveSchedulerWait
+ {
+ public:
+ TInt iError;
+ };
+ CRealizeWait* iRealizeWait;
+};
+
+#endif // CMMACAMERAPLAYER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/inc.dsa/cmmacameraplayerfactory.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class is used for creating camera players.
+*
+*/
+
+
+#ifndef CMMACAMERAPLAYERFACTORY_H
+#define CMMACAMERAPLAYERFACTORY_H
+
+// INCLUDES
+#include <e32base.h>
+#include "cmmammfplayerfactory.h"
+#include "tmmaparametervalidator.h"
+
+// CLASS DECLARATION
+/**
+* This class is used for creating camera players.
+*
+*
+*/
+
+NONSHARABLE_CLASS(CMMACameraPlayerFactory): public CMMAMMFPlayerFactory
+{
+public: // Construction
+ static CMMACameraPlayerFactory* NewLC();
+ ~CMMACameraPlayerFactory();
+
+private:
+ CMMACameraPlayerFactory();
+
+public: // From MMMAPlayerFactory
+ CMMAPlayer* CreatePlayerL(const TDesC& aContentType);
+
+ CMMAPlayer* CreatePlayerL(const TDesC8& aHeaderData);
+
+ CMMAPlayer* CreatePlayerL(const TDesC& aProtocol,
+ const TDesC& aMiddlePart,
+ const TDesC& aParameters);
+
+ void GetSupportedProtocolsL(const TDesC& aContentType,
+ CDesC16Array& aProtocolArray);
+
+public: // From CMMAMMFPlayerFactory
+
+ CMMAPlayer* CreatePlayerL(
+ CMMAMMFResolver* aResolver);
+
+
+ void MediaIdsL(RArray<TUid>& aMediaIds);
+
+ void PreparePluginSelectionParametersL(
+ CMMAMMFResolver* aResolver,
+ CMMFFormatSelectionParameters* aFormatSelection);
+
+private: // Data
+ CMMAAudioSettings* iAudioSettings; // Owned audio settings
+ TMMAVideoSettings iVideoSettings; // Video settings
+ TInt iCameraIndex;
+};
+
+#endif // CMMACAMERAPLAYERFACTORY_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/inc.dsa/cmmasnapshot.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,177 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class takes snapshot and resizes bitmap if needed.
+*
+*/
+
+#ifndef CMMASNAPSHOT_H
+#define CMMASNAPSHOT_H
+
+// INCLUDES
+#include <bitmaptransforms.h>
+#include "tmmaparametervalidator.h"
+#include "mmmasnapshot.h"
+
+// FORWARD DECLARATIONS
+class MMMAGuiPlayer;
+class MMMAEventPoster;
+class MMMASnapshotReadyCallback;
+
+
+// CLASS DECLARATION
+/**
+* This class takes snapshot from MMMAGuiPlayer and resizes bitmap
+* if needed. Then bitmap is converted to wanted image format and posted
+* to java side. This class is used only from CMMAVideoControl and
+* this class is made to separate many asynchronous calls from control and
+* resource releasing.
+*
+*
+*/
+
+NONSHARABLE_CLASS(CMMASnapshot): public CActive
+{
+private: // private state
+ enum TMMASnapshotState
+ {
+ EIdle,
+ ETakingSnapshot,
+ EResizing,
+ EEncoding
+ };
+public:
+ /**
+ * Creates new CMMASnapshot which will be associated to gui player.
+ *
+ * @param aGuiPlayer Player used to take snapshot bitmap.
+ * @param aCallBack Will be informed when completed.
+ */
+ static CMMASnapshot* NewL(MMMAGuiPlayer* aGuiPlayer,
+ MMMASnapshotReadyCallback& aCallBack);
+ /**
+ * Destructor.
+ */
+ virtual ~CMMASnapshot();
+
+private:
+ /**
+ * Creates required member variables.
+ */
+ void ConstructL();
+
+ /**
+ * Contructs new CMMASnapshot.
+ *
+ * @param aGuiPlayer Used to take snapshot bitmap.
+ * @param aCallBack Will be informed when completed.
+ */
+ CMMASnapshot(MMMAGuiPlayer* aGuiPlayer,
+ MMMASnapshotReadyCallback& aCallBack);
+
+public: // new methods
+ /**
+ * Takes snapshot from player and converts it to according to
+ * the properties.
+ *
+ * @param aProperties Snapshot's properties.
+ */
+ void TakeSnapShotL(const TDesC& aProperties);
+
+ /**
+ * Caller takes the ownership of the buffer.
+ *
+ * @return Image buffer. Ownership is transferred.
+ */
+ HBufC8* ImageBuffer();
+
+
+private:// New methods
+ /**
+ * Resizing image to size of settings
+ */
+ void ResizeL();
+
+ /**
+ * Encodes bitmap to wanted mime-type
+ */
+ void EncodeL();
+
+ /**
+ * Called when snapshot is ready or error occures. This method will
+ * inform also the MMMASnapshotReadyCallback interface.
+ *
+ * @param aError Error code for the caller class.
+ */
+ void Completed(TInt aError);
+
+public: // CActive
+ void RunL();
+ TInt RunError(TInt aError);
+ void DoCancel();
+
+private:
+ /**
+ * Bitmap encoder, owned
+ */
+ CImageEncoder* iEncoder;
+
+ /**
+ * Bitmap will be got from gui player and ownership is
+ * transfers to this class, owned
+ */
+ CFbsBitmap* iBitmap;
+
+ /**
+ * Bitmap scaler, owned
+ */
+ CBitmapScaler* iScaler;
+
+ /**
+ * Buffer used for storing encoded data, owned
+ */
+ HBufC8* iBuffer;
+
+ /**
+ * Bitmap settings, owned
+ */
+ CMMAImageSettings* iSettings;
+
+ /**
+ * Snapshot encoding
+ */
+ MMMASnapshot::TEncoding iEncoding;
+
+ /**
+ * GUI player interface, used for taking snapshot, not owned
+ */
+ MMMAGuiPlayer* iGUIPlayer;
+
+ /**
+ * When snapshot is ready or error occures callback will be informed.
+ */
+ MMMASnapshotReadyCallback& iCallBack;
+
+ /**
+ * Internal state
+ */
+ TMMASnapshotState iState;
+};
+
+#endif // CMMASNAPSHOT_H
+
+
+
+
+
+
--- a/javauis/mmapi_akn/baseline/inc.emc/cmmaemcaudioplayer.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc.emc/cmmaemcaudioplayer.h Thu Aug 19 09:48:13 2010 +0300
@@ -20,7 +20,7 @@
// INCLUDES
#include "cmmaemcplayerbase.h"
-#include "mmfbase.h"
+#include "mmf/common/mmfbase.h"
// CONSTANTS
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/inc.nga/cmmacameraplayer.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,220 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class is used for playing camera.
+*
+*/
+
+
+#ifndef CMMACAMERAPLAYER_H
+#define CMMACAMERAPLAYER_H
+
+// INCLUDES
+#include <sensrvdatalistener.h>
+#include <sensrvchannel.h>
+#include <sensrvorientationsensor.h>
+#include <ECamOrientationCustomInterface2.h>
+#include <ECamUIOrientationOverrideCustomAPI.h>
+#include <ecam.h>
+#include "cmmaplayer.h"
+#include "mmmaguiplayer.h"
+#include "mmmasnapshot.h"
+#include "cmmacamerawindow.h"
+
+// CONSTANTS
+_LIT(KMMACameraPlayer, "CameraPlayer");
+
+enum TCamActiveCamera
+{
+ ECamActiveCameraPrimary,
+ ECamActiveCameraSecondary,
+ ECamActiveCameraNone
+};
+
+
+enum TCamImageOrientation
+{
+ ECamOrientation0,
+ ECamOrientation90,
+ ECamOrientation180,
+ ECamOrientation270,
+ ECamOrientationIgnore,
+ ECamOrientationCount
+};
+
+// CLASS DECLARATION
+/**
+* This class is used for playing camera.
+*
+*
+*/
+
+NONSHARABLE_CLASS(CMMACameraPlayer): public CMMAPlayer,
+ public MMMAGuiPlayer,
+ public MMMASnapshot,
+ public MCameraObserver2,
+ public MSensrvDataListener
+{
+public: // Construction
+ /**
+ * Creates new CMMACameraPlayer for the camera at certain index.
+ * Index must be smaller CCamera::CamerasAvailable().
+ * @param aCameraIndex Index of the camera.
+ */
+ static CMMACameraPlayer* NewLC(TCamActiveCamera aCameraIndex);
+
+ // Destructor
+ ~CMMACameraPlayer();
+
+protected:
+ // C++ constructor
+ CMMACameraPlayer(TCamActiveCamera aCameraIndex);
+ void ConstructL(TCamActiveCamera aCameraIndex);
+
+private: // new methods
+ TInt64 CurrentTime();
+ void ResolveViewFinderSizeL(TSize& aSize);
+ void ResolveScreenSizeL(TSize& aSize);
+ void ResolveCaptureSizes(const CCamera::TFormat aFormat,
+ const TInt aNumImageSizesSupported,
+ const TSize& aRequestSize,
+ TSize& aSourceSize,
+ TInt& aSourceIndex,
+ TInt& aLargestIndex);
+ /**
+ * Registers and start listening to sensor channel.
+ */
+ void UpdateSensorInfoL();
+
+ /**
+ * Copies bitmap image from camerabuffer to iSnapshotBitmap
+ */
+ void HandleBitmapCopyL(MCameraBuffer& aCameraBuffer,
+ CFbsBitmap* aSrcBitmap);
+
+ /**
+ * Determines amount of image rotation required for the given sensor
+ * orientation input.
+ */
+ static TCamImageOrientation MapSensorOrientatio2CamOrientation(
+ const TSensrvOrientationData::TSensrvDeviceOrientation& aSensorOrientation,
+ TCamImageOrientation aLastImageOrientation,
+ TCamActiveCamera aActiveCameraIndex);
+
+ /**
+ * Convert UI orienation setting value of type TCamImageOrientation
+ * to MCameraOrientation TOrientation value.
+ */
+ static MCameraOrientation::TOrientation
+ Map2CameraOrientation(const TCamImageOrientation& aSettingOrientation);
+
+public: // from CMMAPlayer
+ void StartL(TBool aPostEvent);
+ void StopL(TBool aPostEvent);
+ void DeallocateL();
+ void RealizeL();
+ void PrefetchL();
+ void GetDuration(TInt64* aDuration);
+ void SetMediaTimeL(TInt64* aTime);
+ void GetMediaTime(TInt64* aMediaTime);
+ void CloseL();
+ const TDesC& Type();
+public: // From MCameraObserver2
+ void HandleEvent(const TECAMEvent& aEvent);
+ void ViewFinderReady(MCameraBuffer& aCameraBuffer,TInt aError);
+ void ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError);
+ void VideoBufferReady(MCameraBuffer& aCameraBuffer,TInt aError);
+
+public: // From MMMAGuiPlayer
+ void SetDisplayL(MMMADisplay* aDisplay);
+ TSize SourceSize();
+ void NotifyWithStringEvent(CMMAPlayerEvent::TEventType aEventType,
+ const TDesC& aStringEventData);
+ MMMASnapshot* SnapshoterL();
+
+public: // From MMMASnapshot
+ MMMASnapshot::TEncoding TakeSnapshotL(TRequestStatus* aStatus,
+ const TSize& aSize,
+ const CMMAImageSettings& aSettings);
+ CFbsBitmap* SnapshotBitmap();
+ HBufC8* SnapshotEncoded();
+
+private: // From MSensrvDataListener
+ void DataReceived(CSensrvChannel& aChannel,
+ TInt aCount,
+ TInt aDataLost);
+ void DataError(CSensrvChannel& aChannel,
+ TSensrvErrorSeverity aError);
+ void GetDataListenerInterfaceL(TUid aInterfaceUid,
+ TAny*& aInterface);
+
+public: // New methods
+ TInt CameraHandle();
+ /**
+ * Disables or enables viewfinder stopping.
+ * Needed when using recording.
+ *
+ * @param aStopViewFinder If true viewfinder will be really stopped.
+ */
+ void SetViewFinderMode(TBool aStopViewFinder);
+
+private: // Data
+ /**
+ * Window used to render viewfinder.
+ * Owned.
+ */
+ CMMACameraWindow* iWindow;
+
+ /**
+ * Camera instance used for taking snapshots and recording.
+ * iWindow uses this to create duplicated camera instance.
+ * Owned.
+ */
+ CCamera* iCamera;
+ MMMADisplay* iDisplay;
+
+ // index to be used for size enumeration
+ TInt iSourceSizeIndex;
+
+ TInt64 iMediaTime;
+ TInt64 iStartTime;
+
+ TRequestStatus* iSnapshotStatus;
+
+ // Owned.
+ CFbsBitmap* iSnapshotBitmap;
+ HBufC8* iSnapshotEncoded;
+
+ TSize iSize;
+ TBool iStopViewFinder;
+
+ // inner class for waiting realize, owned
+ class CRealizeWait : public CActiveSchedulerWait
+ {
+ public:
+ TInt iError;
+ };
+ CRealizeWait* iRealizeWait;
+
+ TCamActiveCamera iActiveCameraIndex;
+ TCamImageOrientation iImageOrientation;
+ TCamImageOrientation iLastImageOrientation;
+ // owned
+ CSensrvChannel* iAccSensorChannel;
+ // not owned
+ MCameraOrientation* iCustomInterfaceOrientation;
+ // not owned
+ MCameraUIOrientationOverride* iCustomInterfaceUIOrientationOverride;
+};
+
+#endif // CMMACAMERAPLAYER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/inc.nga/cmmacameraplayerfactory.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class is used for creating camera players.
+*
+*/
+
+
+#ifndef CMMACAMERAPLAYERFACTORY_H
+#define CMMACAMERAPLAYERFACTORY_H
+
+// INCLUDES
+#include <e32base.h>
+#include "cmmammfplayerfactory.h"
+#include "tmmaparametervalidator.h"
+#include "cmmacameraplayer.h"
+
+// CLASS DECLARATION
+/**
+* This class is used for creating camera players.
+*
+*
+*/
+
+NONSHARABLE_CLASS(CMMACameraPlayerFactory): public CMMAMMFPlayerFactory
+{
+public: // Construction
+ static CMMACameraPlayerFactory* NewLC();
+ ~CMMACameraPlayerFactory();
+
+private:
+ CMMACameraPlayerFactory();
+
+public: // From MMMAPlayerFactory
+ CMMAPlayer* CreatePlayerL(const TDesC& aContentType);
+
+ CMMAPlayer* CreatePlayerL(const TDesC8& aHeaderData);
+
+ CMMAPlayer* CreatePlayerL(const TDesC& aProtocol,
+ const TDesC& aMiddlePart,
+ const TDesC& aParameters);
+
+ void GetSupportedProtocolsL(const TDesC& aContentType,
+ CDesC16Array& aProtocolArray);
+
+public: // From CMMAMMFPlayerFactory
+
+ CMMAPlayer* CreatePlayerL(
+ CMMAMMFResolver* aResolver);
+
+
+ void MediaIdsL(RArray<TUid>& aMediaIds);
+
+ void PreparePluginSelectionParametersL(
+ CMMAMMFResolver* aResolver,
+ CMMFFormatSelectionParameters* aFormatSelection);
+
+private: // Data
+ CMMAAudioSettings* iAudioSettings; // Owned audio settings
+ TMMAVideoSettings iVideoSettings; // Video settings
+ TCamActiveCamera iCameraIndex;
+};
+
+#endif // CMMACAMERAPLAYERFACTORY_H
--- a/javauis/mmapi_akn/baseline/inc.nga/cmmacamerawindow.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc.nga/cmmacamerawindow.h Thu Aug 19 09:48:13 2010 +0300
@@ -49,7 +49,7 @@
NONSHARABLE_CLASS(CMMACameraWindow): public CBase,
public MMMADisplayWindow,
- public MCameraObserver,
+ public MCameraObserver2,
public MUiEventConsumer,
public MDirectScreenAccess
{
@@ -125,17 +125,11 @@
void ContainerDestroyed();
-// from base class MCameraObserver
- void ReserveComplete(TInt aError);
- void PowerOnComplete(TInt aError);
- void ViewFinderFrameReady(CFbsBitmap& aFrame);
-
- void ImageReady(CFbsBitmap* aBitmap,
- HBufC8* aData,
- TInt aError);
-
- void FrameBufferReady(MFrameBuffer* aFrameBuffer,
- TInt aError);
+// from base class MCameraObserver2
+ void HandleEvent(const TECAMEvent& aEvent);
+ void ViewFinderReady(MCameraBuffer& aCameraBuffer,TInt aError);
+ void ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError);
+ void VideoBufferReady(MCameraBuffer& aCameraBuffer,TInt aError);
// from base class MUiEventConsumer
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/inc.nga/cmmasnapshot.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,182 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class takes snapshot and resizes bitmap if needed.
+*
+*/
+
+#ifndef CMMASNAPSHOT_H
+#define CMMASNAPSHOT_H
+
+// INCLUDES
+#include <bitmaptransforms.h>
+#include "tmmaparametervalidator.h"
+#include "mmmasnapshot.h"
+
+// FORWARD DECLARATIONS
+class MMMAGuiPlayer;
+class MMMAEventPoster;
+class MMMASnapshotReadyCallback;
+
+
+// CLASS DECLARATION
+/**
+* This class takes snapshot from MMMAGuiPlayer and resizes bitmap
+* if needed. Then bitmap is converted to wanted image format and posted
+* to java side. This class is used only from CMMAVideoControl and
+* this class is made to separate many asynchronous calls from control and
+* resource releasing.
+*
+*
+*/
+
+NONSHARABLE_CLASS(CMMASnapshot): public CActive
+{
+private: // private state
+ enum TMMASnapshotState
+ {
+ EIdle,
+ ETakingSnapshot,
+ EResizing,
+ EEncoding
+ };
+public:
+ /**
+ * Creates new CMMASnapshot which will be associated to gui player.
+ *
+ * @param aGuiPlayer Player used to take snapshot bitmap.
+ * @param aCallBack Will be informed when completed.
+ */
+ static CMMASnapshot* NewL(MMMAGuiPlayer* aGuiPlayer,
+ MMMASnapshotReadyCallback& aCallBack);
+ /**
+ * Destructor.
+ */
+ virtual ~CMMASnapshot();
+
+private:
+ /**
+ * Creates required member variables.
+ */
+ void ConstructL();
+
+ /**
+ * Contructs new CMMASnapshot.
+ *
+ * @param aGuiPlayer Used to take snapshot bitmap.
+ * @param aCallBack Will be informed when completed.
+ */
+ CMMASnapshot(MMMAGuiPlayer* aGuiPlayer,
+ MMMASnapshotReadyCallback& aCallBack);
+
+public: // new methods
+ /**
+ * Takes snapshot from player and converts it to according to
+ * the properties.
+ *
+ * @param aProperties Snapshot's properties.
+ */
+ void TakeSnapShotL(const TDesC& aProperties);
+
+ /**
+ * Caller takes the ownership of the buffer.
+ *
+ * @return Image buffer. Ownership is transferred.
+ */
+ HBufC8* ImageBuffer();
+
+
+private:// New methods
+ /**
+ * Resizing image to size of settings
+ */
+ void ResizeL();
+
+ /**
+ * Encodes bitmap to wanted mime-type
+ */
+ void EncodeL();
+
+ /**
+ * Called when snapshot is ready or error occures. This method will
+ * inform also the MMMASnapshotReadyCallback interface.
+ *
+ * @param aError Error code for the caller class.
+ */
+ void Completed(TInt aError);
+
+public: // CActive
+ void RunL();
+ TInt RunError(TInt aError);
+ void DoCancel();
+
+private:
+ /**
+ * Bitmap encoder, owned
+ */
+ CImageEncoder* iEncoder;
+
+ /**
+ * Bitmap will be got from gui player and ownership is
+ * transfers to this class, owned
+ */
+ CFbsBitmap* iBitmap;
+
+ /**
+ * Bitmap scaler, owned
+ */
+ CBitmapScaler* iScaler;
+
+ /**
+ * Buffer used for storing encoded data, owned
+ */
+ HBufC8* iBuffer;
+
+ /**
+ * Bitmap settings, owned
+ */
+ CMMAImageSettings* iSettings;
+
+ /**
+ * Snapshot encoding
+ */
+ MMMASnapshot::TEncoding iEncoding;
+
+ /**
+ * GUI player interface, used for taking snapshot, not owned
+ */
+ MMMAGuiPlayer* iGUIPlayer;
+
+ /**
+ * When snapshot is ready or error occures callback will be informed.
+ */
+ MMMASnapshotReadyCallback& iCallBack;
+
+ /**
+ * Internal state
+ */
+ TMMASnapshotState iState;
+
+ /**
+ *Internal State for maintaining the Aspect Ratio.
+ */
+ TBool iScalingFactor;
+};
+
+#endif // CMMASNAPSHOT_H
+
+
+
+
+
+
--- a/javauis/mmapi_akn/baseline/inc.nga/cmmasurfacewindow.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc.nga/cmmasurfacewindow.h Thu Aug 19 09:48:13 2010 +0300
@@ -202,7 +202,7 @@
*
* @param aStatus true indicates cable connected else false
*/
- void SetAVCableConnStatus(TBool aStatus);
+ IMPORT_C void SetAVCableConnStatus(TBool aStatus);
private: // New methods
/**
--- a/javauis/mmapi_akn/baseline/inc.nga/cmmavideoplayer.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc.nga/cmmavideoplayer.h Thu Aug 19 09:48:13 2010 +0300
@@ -135,6 +135,7 @@
*/
CAccMonitor *iAccMonitor;
RAccMonCapabilityArray iAccMonCapabilityArray;
+ TBool isHDMICableConnected;
};
#endif // CMMAVIDEOPLAYER_H
--- a/javauis/mmapi_akn/baseline/inc/cmmaaudiometadatacontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc/cmmaaudiometadatacontrol.h Thu Aug 19 09:48:13 2010 +0300
@@ -21,7 +21,7 @@
#define CMMAAUDIOMETADATACONTROL_H
// INCLUDES
-#include <mmfcontroller.h>
+#include <mmf/common/mmfcontroller.h>
#include "cmmametadatacontrol.h"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/inc/cmmacallstatemonitor.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Publish and Subscribe key watcher
+*
+*/
+
+
+#ifndef CMMACALLSTATEMONITOR_H
+#define CMMACALLSTATEMONITOR_H
+
+#include <e32property.h>
+
+class MMMACallStateObserver;
+
+/**
+ * Publish and subscribe key watcher.
+ *
+ * @lib
+ */
+class CMMACallStateMonitor : public CActive
+ {
+public:
+
+ /*
+ * Two Phased Constructor.
+ *
+ * @since
+ * @param aUid PubSub UID to watch
+ * @param aKey specific key to watch
+ * @return Construced object
+ */
+ static CMMACallStateMonitor* NewL( TUid aUid, TInt aKey,
+ MMMACallStateObserver* aObserver );
+
+ /*
+ * virtual destructor.
+ *
+ * @since
+ */
+ virtual ~CMMACallStateMonitor();
+
+public: // New Functions
+
+ /*
+ * Return the value of the key.
+ *
+ * @since
+ * @param aValue
+ * @return KErrNone, if successful otherwise system error
+ */
+ TInt GetValue( TInt& aValue );
+
+protected: // From Base class
+
+ /*
+ * From CActive.
+ *
+ * @since
+ */
+ void RunL();
+
+ /*
+ * From CActive.
+ *
+ * @since
+ */
+ void DoCancel();
+
+private:
+
+ /*
+ * Default Constructor.
+ *
+ * @since
+ * @param aUid PubSub key to watch
+ * @param aKey specific key to watch
+ */
+ CMMACallStateMonitor( TUid aUid,
+ TInt aKey,
+ MMMACallStateObserver* aObserver );
+
+ /*
+ * Second phased constructor.
+ *
+ * @since
+ */
+ void ConstructL();
+
+private: // data
+
+ RProperty iProperty;
+ MMMACallStateObserver* iObserver; // not owned
+ TUid iUid; // Uid that we are watching
+ TInt iKey; // Key that we are watching
+ };
+
+#endif // C_MMAPSKEYWATCHER_H
\ No newline at end of file
--- a/javauis/mmapi_akn/baseline/inc/cmmacameraplayer.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/*
-* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class is used for playing camera.
-*
-*/
-
-
-#ifndef CMMACAMERAPLAYER_H
-#define CMMACAMERAPLAYER_H
-
-// INCLUDES
-#include <ecam.h>
-#include "cmmaplayer.h"
-#include "mmmaguiplayer.h"
-#include "mmmasnapshot.h"
-#include "cmmacamerawindow.h"
-
-// CONSTANTS
-_LIT(KMMACameraPlayer, "CameraPlayer");
-
-// CLASS DECLARATION
-/**
-* This class is used for playing camera.
-*
-*
-*/
-
-NONSHARABLE_CLASS(CMMACameraPlayer): public CMMAPlayer,
- public MMMAGuiPlayer,
- public MMMASnapshot,
- public MCameraObserver
-{
-public: // Construction
- /**
- * Creates new CMMACameraPlayer for the camera at certain index.
- * Index must be smaller CCamera::CamerasAvailable().
- * @param aCameraIndex Index of the camera.
- */
- static CMMACameraPlayer* NewLC(TInt aCameraIndex);
-
- // Destructor
- ~CMMACameraPlayer();
-
-protected:
- // C++ constructor
- CMMACameraPlayer();
- void ConstructL(TInt aCameraIndex);
-
-private: // new methods
- TInt64 CurrentTime();
- void ResolveViewFinderSizeL(TSize& aSize);
- void ResolveScreenSizeL(TSize& aSize);
- void ResolveCaptureSizes(const CCamera::TFormat aFormat,
- const TInt aNumImageSizesSupported,
- const TSize& aRequestSize,
- TSize& aSourceSize,
- TInt& aSourceIndex,
- TInt& aLargestIndex);
-
-public: // from CMMAPlayer
- void StartL(TBool aPostEvent);
- void StopL(TBool aPostEvent);
- void DeallocateL();
- void RealizeL();
- void PrefetchL();
- void GetDuration(TInt64* aDuration);
- void SetMediaTimeL(TInt64* aTime);
- void GetMediaTime(TInt64* aMediaTime);
- void CloseL();
- const TDesC& Type();
-public: // From MCameraObserver
- void ReserveComplete(TInt aError);
- void PowerOnComplete(TInt aError);
- void ViewFinderFrameReady(CFbsBitmap& aFrame);
-
- void ImageReady(CFbsBitmap* aBitmap,
- HBufC8* aData,
- TInt aError);
-
- void FrameBufferReady(MFrameBuffer* aFrameBuffer,
- TInt aError);
-
-public: // From MMMAGuiPlayer
- void SetDisplayL(MMMADisplay* aDisplay);
- TSize SourceSize();
- void NotifyWithStringEvent(CMMAPlayerEvent::TEventType aEventType,
- const TDesC& aStringEventData);
- MMMASnapshot* SnapshoterL();
-
-public: // From MMMASnapshot
- MMMASnapshot::TEncoding TakeSnapshotL(TRequestStatus* aStatus,
- const TSize& aSize,
- const CMMAImageSettings& aSettings);
- CFbsBitmap* SnapshotBitmap();
- HBufC8* SnapshotEncoded();
-
-public: // New methods
- TInt CameraHandle();
- /**
- * Disables or enables viewfinder stopping.
- * Needed when using recording.
- *
- * @param aStopViewFinder If true viewfinder will be really stopped.
- */
- void SetViewFinderMode(TBool aStopViewFinder);
-
-private: // Data
- /**
- * Window used to render viewfinder.
- * Owned.
- */
- CMMACameraWindow* iWindow;
-
- /**
- * Camera instance used for taking snapshots and recording.
- * iWindow uses this to create duplicated camera instance.
- * Owned.
- */
- CCamera* iCamera;
- MMMADisplay* iDisplay;
-
- // index to be used for size enumeration
- TInt iSourceSizeIndex;
-
- TInt64 iMediaTime;
- TInt64 iStartTime;
-
- TRequestStatus* iSnapshotStatus;
-
- // Owned.
- CFbsBitmap* iSnapshotBitmap;
- HBufC8* iSnapshotEncoded;
-
- TSize iSize;
- TBool iStopViewFinder;
-
- // inner class for waiting realize, owned
- class CRealizeWait : public CActiveSchedulerWait
- {
- public:
- TInt iError;
- };
- CRealizeWait* iRealizeWait;
-};
-
-#endif // CMMACAMERAPLAYER_H
--- a/javauis/mmapi_akn/baseline/inc/cmmacameraplayerfactory.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class is used for creating camera players.
-*
-*/
-
-
-#ifndef CMMACAMERAPLAYERFACTORY_H
-#define CMMACAMERAPLAYERFACTORY_H
-
-// INCLUDES
-#include <e32base.h>
-#include "cmmammfplayerfactory.h"
-#include "tmmaparametervalidator.h"
-
-// CLASS DECLARATION
-/**
-* This class is used for creating camera players.
-*
-*
-*/
-
-NONSHARABLE_CLASS(CMMACameraPlayerFactory): public CMMAMMFPlayerFactory
-{
-public: // Construction
- static CMMACameraPlayerFactory* NewLC();
- ~CMMACameraPlayerFactory();
-
-private:
- CMMACameraPlayerFactory();
-
-public: // From MMMAPlayerFactory
- CMMAPlayer* CreatePlayerL(const TDesC& aContentType);
-
- CMMAPlayer* CreatePlayerL(const TDesC8& aHeaderData);
-
- CMMAPlayer* CreatePlayerL(const TDesC& aProtocol,
- const TDesC& aMiddlePart,
- const TDesC& aParameters);
-
- void GetSupportedProtocolsL(const TDesC& aContentType,
- CDesC16Array& aProtocolArray);
-
-public: // From CMMAMMFPlayerFactory
-
- CMMAPlayer* CreatePlayerL(
- CMMAMMFResolver* aResolver);
-
-
- void MediaIdsL(RArray<TUid>& aMediaIds);
-
- void PreparePluginSelectionParametersL(
- CMMAMMFResolver* aResolver,
- CMMFFormatSelectionParameters* aFormatSelection);
-
-private: // Data
- CMMAAudioSettings* iAudioSettings; // Owned audio settings
- TMMAVideoSettings iVideoSettings; // Video settings
- TInt iCameraIndex;
-};
-
-#endif // CMMACAMERAPLAYERFACTORY_H
--- a/javauis/mmapi_akn/baseline/inc/cmmadisplay.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc/cmmadisplay.h Thu Aug 19 09:48:13 2010 +0300
@@ -59,6 +59,7 @@
TBool IsVisible();
TBool IsFullScreen();
virtual void SetForeground(TBool aIsForeground, TBool UseEventServer);
+ virtual void FixUIOrientation(TBool aFix);
/**
* Gets notification that there is container to draw assigned
@@ -90,6 +91,7 @@
virtual void UIGetCallback(
MUiEventConsumer& aConsumer,
TInt aCallbackId);
+
public: // Methods derived from MDirectContent
/**
* Used to obtain RWindow rect
--- a/javauis/mmapi_akn/baseline/inc/cmmaframepositioningcontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc/cmmaframepositioningcontrol.h Thu Aug 19 09:48:13 2010 +0300
@@ -20,8 +20,8 @@
#define CMMAFRAMEPOSITIONINGCONTROL_H
// EXTERNAL INCLUDES
-#include "mmfcontroller.h"
-#include "mmfstandardcustomcommands.h"
+#include "mmf/common/mmfcontroller.h"
+#include "mmf/common/mmfstandardcustomcommands.h"
// INTERNAL INCLUDES
#include "cmmacontrol.h" // base class
--- a/javauis/mmapi_akn/baseline/inc/cmmamidimetadatacontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc/cmmamidimetadatacontrol.h Thu Aug 19 09:48:13 2010 +0300
@@ -21,7 +21,7 @@
#define CMMAMIDIMETADATACONTROL_H
// INCLUDES
-#include <mmfcontroller.h>
+#include <mmf/common/mmfcontroller.h>
#include "cmmamidiplayer.h"
#include "cmmametadatacontrol.h"
--- a/javauis/mmapi_akn/baseline/inc/cmmaplayer.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc/cmmaplayer.h Thu Aug 19 09:48:13 2010 +0300
@@ -25,9 +25,11 @@
#include "cmmaplayerevent.h"
#include "mmmasourcestreamlistener.h"
#include "mmmaplayerstatelistener.h"
+#include "mmmacallstateobserver.h"
// FORWARD DECLARATIONS
class CMMADurationUpdater;
+class CMMACallStateMonitor;
// CONTANTS
@@ -52,7 +54,7 @@
*/
class CMMAPlayer : public CBase,
- public MMMASourceStreamListener
+ public MMMASourceStreamListener, MMMACallStateObserver
{
public:
@@ -174,7 +176,7 @@
* Close the Player and release its resources. After this player is in
* EClosed state and cannot be used anymore.
*/
- virtual void CloseL();
+ IMPORT_C virtual void CloseL();
/**
* Gets duration.
@@ -216,6 +218,10 @@
*/
HBufC* ContentType() const;
+public: // from MMMACallStateObserver
+
+ void HandleCallStateEventL(TUid aUid, TInt aKey);
+
public: // new methods
/**
* Sets Java listener object that will be used to post player events
@@ -451,6 +457,16 @@
*/
CMMADurationUpdater* iDurationUpdater;
+ /**
+ * Used to get the callback for Call State Events.
+ */
+ CMMACallStateMonitor* iStateObserver;
+
+ /**
+ * Used to determine if the Player is in Paused state
+ * due to call or done by user.
+ */
+ TBool isPausedByCall;
};
--- a/javauis/mmapi_akn/baseline/inc/cmmasnapshot.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,177 +0,0 @@
-/*
-* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class takes snapshot and resizes bitmap if needed.
-*
-*/
-
-#ifndef CMMASNAPSHOT_H
-#define CMMASNAPSHOT_H
-
-// INCLUDES
-#include <bitmaptransforms.h>
-#include "tmmaparametervalidator.h"
-#include "mmmasnapshot.h"
-
-// FORWARD DECLARATIONS
-class MMMAGuiPlayer;
-class MMMAEventPoster;
-class MMMASnapshotReadyCallback;
-
-
-// CLASS DECLARATION
-/**
-* This class takes snapshot from MMMAGuiPlayer and resizes bitmap
-* if needed. Then bitmap is converted to wanted image format and posted
-* to java side. This class is used only from CMMAVideoControl and
-* this class is made to separate many asynchronous calls from control and
-* resource releasing.
-*
-*
-*/
-
-NONSHARABLE_CLASS(CMMASnapshot): public CActive
-{
-private: // private state
- enum TMMASnapshotState
- {
- EIdle,
- ETakingSnapshot,
- EResizing,
- EEncoding
- };
-public:
- /**
- * Creates new CMMASnapshot which will be associated to gui player.
- *
- * @param aGuiPlayer Player used to take snapshot bitmap.
- * @param aCallBack Will be informed when completed.
- */
- static CMMASnapshot* NewL(MMMAGuiPlayer* aGuiPlayer,
- MMMASnapshotReadyCallback& aCallBack);
- /**
- * Destructor.
- */
- virtual ~CMMASnapshot();
-
-private:
- /**
- * Creates required member variables.
- */
- void ConstructL();
-
- /**
- * Contructs new CMMASnapshot.
- *
- * @param aGuiPlayer Used to take snapshot bitmap.
- * @param aCallBack Will be informed when completed.
- */
- CMMASnapshot(MMMAGuiPlayer* aGuiPlayer,
- MMMASnapshotReadyCallback& aCallBack);
-
-public: // new methods
- /**
- * Takes snapshot from player and converts it to according to
- * the properties.
- *
- * @param aProperties Snapshot's properties.
- */
- void TakeSnapShotL(const TDesC& aProperties);
-
- /**
- * Caller takes the ownership of the buffer.
- *
- * @return Image buffer. Ownership is transferred.
- */
- HBufC8* ImageBuffer();
-
-
-private:// New methods
- /**
- * Resizing image to size of settings
- */
- void ResizeL();
-
- /**
- * Encodes bitmap to wanted mime-type
- */
- void EncodeL();
-
- /**
- * Called when snapshot is ready or error occures. This method will
- * inform also the MMMASnapshotReadyCallback interface.
- *
- * @param aError Error code for the caller class.
- */
- void Completed(TInt aError);
-
-public: // CActive
- void RunL();
- TInt RunError(TInt aError);
- void DoCancel();
-
-private:
- /**
- * Bitmap encoder, owned
- */
- CImageEncoder* iEncoder;
-
- /**
- * Bitmap will be got from gui player and ownership is
- * transfers to this class, owned
- */
- CFbsBitmap* iBitmap;
-
- /**
- * Bitmap scaler, owned
- */
- CBitmapScaler* iScaler;
-
- /**
- * Buffer used for storing encoded data, owned
- */
- HBufC8* iBuffer;
-
- /**
- * Bitmap settings, owned
- */
- CMMAImageSettings* iSettings;
-
- /**
- * Snapshot encoding
- */
- MMMASnapshot::TEncoding iEncoding;
-
- /**
- * GUI player interface, used for taking snapshot, not owned
- */
- MMMAGuiPlayer* iGUIPlayer;
-
- /**
- * When snapshot is ready or error occures callback will be informed.
- */
- MMMASnapshotReadyCallback& iCallBack;
-
- /**
- * Internal state
- */
- TMMASnapshotState iState;
-};
-
-#endif // CMMASNAPSHOT_H
-
-
-
-
-
-
--- a/javauis/mmapi_akn/baseline/inc/cmmavideourlplayer.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc/cmmavideourlplayer.h Thu Aug 19 09:48:13 2010 +0300
@@ -28,6 +28,9 @@
// FORWARD DECLARATIONS
class CMMAEventSource;
+//Can not open audio device or lost control of audio device
+const TInt KErrMMAudioDevice = -12014;
+
// CLASS DECLARATION
/**
* This class is used for playing video.
--- a/javauis/mmapi_akn/baseline/inc/cmmavolumecontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc/cmmavolumecontrol.h Thu Aug 19 09:48:13 2010 +0300
@@ -22,7 +22,7 @@
// INCLUDES
#include "cmmacontrol.h"
#include "mmmaplayerstatelistener.h"
-#include <mprofilechangeobserver.h>
+#include <MProfileChangeObserver.h>
// CONSTANS
_LIT(KMMAVolumeControlName, "VolumeControl");
@@ -47,11 +47,11 @@
static void StaticGetLevelL(CMMAVolumeControl* aVolumeControl,
TInt* aLevel);
- ~CMMAVolumeControl();
+ IMPORT_C ~CMMAVolumeControl();
protected:
- CMMAVolumeControl(CMMAPlayer* aPlayer);
- void ConstructBaseL();
+ IMPORT_C CMMAVolumeControl(CMMAPlayer* aPlayer);
+ IMPORT_C void ConstructBaseL();
/**
* Sets the level to player.
@@ -66,18 +66,18 @@
virtual TInt DoGetLevelL() = 0;
public: // From CMMAControl
- const TDesC& ClassName() const;
+ IMPORT_C const TDesC& ClassName() const;
/**
* Refresh volume control.
*/
- void RefreshControl();
+ IMPORT_C void RefreshControl();
public: // From MMMAPlayerStateListener
- void StateChanged(TInt aState);
+ IMPORT_C void StateChanged(TInt aState);
public: // from MProfileChangeObserver
- void HandleActiveProfileEventL(TProfileEvent aProfileEvent, TInt aProfileId );
+ IMPORT_C void HandleActiveProfileEventL(TProfileEvent aProfileEvent, TInt aProfileId );
public: // New methods
/**
@@ -105,6 +105,8 @@
* volume setting is done.
*/
IMPORT_C void SetAudioOutputPreferenceL( TInt aRoutingPreference);
+
+ void InitializeGlobalVolumeLevel(TInt aGlobalVolumeLevel);
private: // New methods
@@ -144,6 +146,9 @@
TInt iAudioOutputPreference;
// Current profile Id.
TInt iProfileId;
+private:
+ // The Global Volume level at the time when a player is created
+ TInt iInitialGlobalVolumeLevel;
};
#endif // CMMAVOLUMECONTROL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/inc/mmmacallstateobserver.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,42 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Observer class for Publish and Subscribe handling
+*
+*/
+
+
+#ifndef MMMMACALLSTATEOBSERVER_H
+#define MMMMACALLSTATEOBSERVER_H
+
+/**
+ * Abstract interface to the PS key watcher.
+ *
+ * @lib
+ */
+NONSHARABLE_CLASS(MMMACallStateObserver)
+ {
+public:
+
+ /**
+ * Handle Call state event
+ *
+ * @since
+ * @param aUid The UID that identifies the property category
+ * @param aKey The property sub-key
+ */
+ virtual void HandleCallStateEventL(TUid aUid, TInt aKey) = 0;
+ };
+
+
+#endif // M_MMMAPSKEYOBSERVER_H
--- a/javauis/mmapi_akn/baseline/inc/mmmacontainer.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc/mmmacontainer.h Thu Aug 19 09:48:13 2010 +0300
@@ -102,6 +102,14 @@
* @returns The rect of the content window in screen co-ordinates.
*/
virtual TRect MdcContainerWindowRect() const = 0;
+
+ /**
+ * Fixes screen UI orientation.
+ *
+ * @param aEnableFix If ETrue, the UI orientation will be fixed.
+ * If EFalse, the standard UI orientation is restored.
+ */
+ virtual void MdcFixUIOrientation(TBool aEnableFix) = 0;
};
--- a/javauis/mmapi_akn/baseline/inc/mmmadisplay.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc/mmmadisplay.h Thu Aug 19 09:48:13 2010 +0300
@@ -182,6 +182,14 @@
virtual void UIGetCallback(
MUiEventConsumer& aConsumer,
TInt aCallbackId) = 0;
+
+ /**
+ * Fixes screen UI orientation.
+ *
+ * @param aFix If ETrue, the UI orientation will be fixed.
+ * If EFalse, the standard UI orientation is restored.
+ */
+ virtual void FixUIOrientation(TBool aFix) = 0;
};
#endif // MMMADISPLAY_H
--- a/javauis/mmapi_akn/baseline/inc/tmmaparametervalidator.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/inc/tmmaparametervalidator.h Thu Aug 19 09:48:13 2010 +0300
@@ -21,7 +21,7 @@
// INCLUDES
#include <e32base.h>
-#include <mmfutilities.h>
+#include <mmf/common/mmfutilities.h>
#include <imageconversion.h>
// STRUCTS
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/src.dsa/cmmacameraplayer.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,672 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class is used for playing camera.
+*
+*/
+
+
+// INCLUDE FILES
+#include <jdebug.h>
+#include <fbs.h>
+#include <e32svr.h>
+#include "cmmacameraplayer.h"
+#include "tmmaparametervalidator.h"
+#include "mmmadisplay.h"
+#include "cmmacamerasound.h"
+
+#if defined( __WINS__ )
+#include <w32std.h>
+#endif
+
+// CONSTANTS
+_LIT8(KImageJpegMime, "image/jpeg");
+_LIT8(KJpegMime, "jpeg");
+_LIT(KVideoControlName, "VideoControl");
+
+CMMACameraPlayer* CMMACameraPlayer::NewLC(TInt aCameraIndex)
+{
+ CMMACameraPlayer* self = new(ELeave) CMMACameraPlayer;
+ CleanupStack::PushL(self);
+ self->ConstructL(aCameraIndex);
+ return self;
+}
+
+CMMACameraPlayer::~CMMACameraPlayer()
+{
+ DEBUG("CMMACameraPlayer::~CMMACameraPlayer");
+
+ // Free (duplicated) UI camera resources first.
+ // Window is not able to send any
+ // callback requests to UI from now.
+ if (iWindow)
+ {
+ iWindow->SetDisplay(NULL);
+ }
+
+ if (iCamera)
+ {
+ iCamera->CancelCaptureImage();
+ iCamera->Release();
+ delete iCamera;
+ }
+
+ delete iSnapshotEncoded;
+ delete iSnapshotBitmap;
+ delete iRealizeWait;
+
+ if (iDisplay && iDisplay->HasContainer())
+ {
+ // Window will delete itself
+ // after all pending events are processed
+ // (lazy delete)
+ iDisplay->UIGetCallback(
+ *iWindow, CMMACameraWindow::EDestroyWindow);
+ }
+ else
+ {
+ delete iWindow;
+ }
+ iWindow = NULL;
+}
+
+
+CMMACameraPlayer::CMMACameraPlayer():
+ iDisplay(NULL),
+ iSourceSizeIndex(KErrNotFound),
+ iStartTime(KErrNotFound)
+{
+ iStopViewFinder = ETrue;
+}
+
+
+void CMMACameraPlayer::ConstructL(TInt aCameraIndex)
+{
+ CMMAPlayer::ConstructL();
+
+ if (aCameraIndex >= CCamera::CamerasAvailable())
+ {
+ // image capture is not supported
+ User::Leave(KErrNotFound);
+ }
+
+ iCamera = CCamera::NewL(*this, aCameraIndex);
+
+ iWindow = CMMACameraWindow::NewL(iCamera->Handle());
+
+ TCameraInfo cameraInfo;
+ iCamera->CameraInfo(cameraInfo);
+
+ if (cameraInfo.iNumImageSizesSupported < 1)
+ {
+ // image capture is not supported
+ User::Leave(KErrNotFound);
+ }
+
+ // default snapshot size
+ iSourceSizeIndex = cameraInfo.iNumImageSizesSupported - 1;
+
+ iRealizeWait = new(ELeave)CRealizeWait;
+}
+
+TInt64 CMMACameraPlayer::CurrentTime()
+{
+ TTime time;
+ time.HomeTime();
+ return time.Int64();
+}
+
+void CMMACameraPlayer::ResolveViewFinderSizeL(TSize& aSize)
+{
+ DEBUG("CMMACameraPlayer::ResolveViewFinderSizeL");
+
+ TSize resultSize;
+
+ // The only way to find out the size is to start the view finder
+ // with a proper size (screen size).
+
+ ResolveScreenSizeL(resultSize);
+
+ // StartViewFinderBitmapsL changes resultSize to
+ // the used view finder size.
+ // Used to get the source size only.
+ iCamera->StartViewFinderBitmapsL(resultSize);
+
+ // Bitmap viewfinder is not used anymore.
+ iCamera->StopViewFinder();
+
+ aSize = resultSize;
+}
+
+void CMMACameraPlayer::ResolveScreenSizeL(TSize& aSize)
+{
+ DEBUG("CMMACameraPlayer::ResolveScreenSizeL");
+
+#if defined( __WINS__ )
+ TSize size(0,0);
+ RWsSession ws;
+
+ if (ws.Connect() == KErrNone)
+ {
+ CleanupClosePushL(ws);
+
+ CWsScreenDevice* wsScreenDevice = new(ELeave)CWsScreenDevice(ws);
+ CleanupStack::PushL(wsScreenDevice);
+
+ User::LeaveIfError(wsScreenDevice->Construct());
+
+ size = wsScreenDevice->SizeInPixels();
+
+ CleanupStack::PopAndDestroy(2); // wsScreenDevice, ws.Close()
+ }
+
+ aSize = size;
+
+#else
+ TScreenInfoV01 info;
+ TPckgBuf< TScreenInfoV01 > buf(info);
+
+ UserSvr::ScreenInfo(buf);
+ info = buf();
+
+ aSize = info.iScreenSize;
+#endif
+}
+
+void CMMACameraPlayer::ResolveCaptureSizes(const CCamera::TFormat aFormat,
+ const TInt aNumImageSizesSupported,
+ const TSize& aRequestSize,
+ TSize& aSourceSize,
+ TInt& aSourceIndex,
+ TInt& aLargestIndex)
+{
+ // Largest image size
+ TSize largestSize;
+ // Index to largest image size
+ TInt largestSizeIndex = 0;
+ // Source size
+ TSize sourceSize;
+ // Default source size index not set
+ TInt sourceSizeIndex = KErrNotFound;
+ // Temporary size for iterating capture sizes
+ TSize tmpSize;
+
+ DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: aFormat = 0x%x", aFormat);
+
+ // go through all supported sizes.
+ // Notice: Capture sizes are assumed to be in order from smaller to larger sizes
+ for (TInt i = 0; i < aNumImageSizesSupported; i++)
+ {
+ iCamera->EnumerateCaptureSizes(tmpSize,
+ i,
+ aFormat);
+
+ DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iWidth = %d", tmpSize.iWidth);
+ DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iHeight = %d", tmpSize.iHeight);
+
+ // Check if current is the largest
+ if ((largestSize.iWidth < tmpSize.iWidth) &&
+ (largestSize.iHeight < tmpSize.iHeight))
+ {
+ largestSize = tmpSize;
+ largestSizeIndex = i;
+ }
+
+ // If wanted size is smaller than tmpSize we can use it
+ if ((aRequestSize.iWidth <= tmpSize.iWidth) &&
+ (aRequestSize.iHeight <= tmpSize.iHeight))
+ {
+ sourceSize = tmpSize;
+ sourceSizeIndex = i;
+ }
+ }
+
+ DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: sourceSizeIndex = %d", sourceSizeIndex);
+ DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: largestSizeIndex = %d", largestSizeIndex);
+
+ aSourceSize = sourceSize;
+ aSourceIndex = sourceSizeIndex;
+ aLargestIndex = largestSizeIndex;
+}
+
+void CMMACameraPlayer::StartL(TBool aPostEvent)
+{
+ DEBUG_INT("CMMACameraPlayer:StartL iState %d", iState);
+
+ // start can't be called to not ready player
+ if (iState == EPrefetched)
+ {
+ // camera passes ready images through
+ // ViewFinderFrameReady method
+
+ // set time when started
+ iStartTime = CurrentTime();
+
+ // inform java side
+ ChangeState(EStarted);
+
+ TInt64 time;
+ GetMediaTime(&time);
+
+ // Notify the camera window
+ // about the status change
+ iWindow->SetStarted(ETrue);
+
+ if (aPostEvent)
+ {
+ // inform java side
+ PostLongEvent(CMMAPlayerEvent::EStarted, time);
+ }
+ }
+ PostActionCompleted(KErrNone); // java start return
+}
+
+void CMMACameraPlayer::StopL(TBool aPostEvent)
+{
+ DEBUG_INT("CMMACameraPlayer::StopL", iState);
+ if (iState == EStarted)
+ {
+ TInt64 time;
+ GetMediaTime(&time); // add played time to media time
+
+ if (iStopViewFinder && iWindow->ViewFinderActive())
+ {
+ iWindow->SetStarted(EFalse);
+ }
+ iStartTime = KErrNotFound;
+
+ if (aPostEvent)
+ {
+ PostLongEvent(CMMAPlayerEvent::EStopped, time);
+ }
+
+ // go back to prefetched state
+ ChangeState(EPrefetched);
+ }
+}
+
+void CMMACameraPlayer::DeallocateL()
+{
+ // If player is started when deallocate is called,
+ // player is stopped from java side -> state is changed to
+ // prefetched.
+ // In prefetched state only reserved resource is
+ // camera reserve( released with iCamera->Release() )
+ // In realized state no resources have been reserved.
+ // CHANGED: not releasing camera anymore, since it is already
+ // done in realized state
+ if (iState == EPrefetched)
+ {
+ ChangeState(ERealized);
+ }
+}
+
+
+void CMMACameraPlayer::RealizeL()
+{
+ iCamera->Reserve();
+ // this lock will be released when power on is completed (or error)
+ if (!iRealizeWait->IsStarted())
+ {
+ iRealizeWait->Start();
+ }
+ User::LeaveIfError(iRealizeWait->iError);
+ CMMAPlayer::RealizeL();
+}
+
+
+void CMMACameraPlayer::PrefetchL()
+{
+ DEBUG("MMA::CMMACameraPlayer::PrefetchL");
+ // nothing to do here
+ ChangeState(EPrefetched);
+ PostActionCompleted(KErrNone);
+}
+
+
+void CMMACameraPlayer::GetDuration(TInt64* aDuration)
+{
+ // camera viewer has no duration.
+ *aDuration = KTimeUnknown;
+}
+
+
+void CMMACameraPlayer::SetMediaTimeL(TInt64* /*aTime*/)
+{
+ DEBUG("MMA::CMMACameraPlayer::SetMediaTimeL ");
+ // with camera media time is not supported.
+}
+
+
+void CMMACameraPlayer::GetMediaTime(TInt64* aMediaTime)
+{
+ if (iState == EStarted)
+ {
+ // add play time to media time
+ iMediaTime += CurrentTime() - iStartTime;
+ // set new start time
+ iStartTime = CurrentTime();
+ }
+
+ // set value to parameter
+ (*aMediaTime) = iMediaTime;
+}
+
+void CMMACameraPlayer::CloseL()
+{
+ DEBUG("MMA::CMMACameraPlayer::CloseL()");
+
+ // cancel all activity
+ iCamera->CancelCaptureImage();
+
+ // Stop and release UI Camera instance
+ iWindow->SetDisplay(NULL);
+
+ // we don't need reserve camera anymore
+ iCamera->Release();
+
+ CMMAPlayer::CloseL();
+}
+
+const TDesC& CMMACameraPlayer::Type()
+{
+ return KMMACameraPlayer;
+}
+
+// MCameraObserver
+void CMMACameraPlayer::ReserveComplete(TInt aError)
+{
+ DEBUG_INT("MMA::CMMACameraPlayer::ReserveComplete %d", aError);
+ if (aError == KErrNone)
+ {
+ // camera will notify completion with PowerOnComplete method.
+ iCamera->PowerOn();
+ }
+ else
+ {
+ // release lock and store error. State doesn't change.
+ iRealizeWait->iError = aError;
+ iRealizeWait->AsyncStop();
+ }
+
+}
+
+void CMMACameraPlayer::PowerOnComplete(TInt aError)
+{
+ DEBUG_INT("MMA::CMMACameraPlayer::PowerOnComplete %d", aError);
+
+ TSize viewFinderSize;
+ TInt error = aError;
+
+ if (error == KErrNone)
+ {
+ // The view finder size must be known after prefetching.
+ TRAP(error, ResolveViewFinderSizeL(viewFinderSize));
+ }
+
+ if (error == KErrNone)
+ {
+ iSize = viewFinderSize;
+
+ if (iDisplay)
+ {
+ iDisplay->SourceSizeChanged(iSize);
+ NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName);
+ }
+ }
+
+ iRealizeWait->iError = error;
+ iRealizeWait->AsyncStop();
+}
+
+void CMMACameraPlayer::ViewFinderFrameReady(CFbsBitmap& /*aFrame*/)
+{
+ // Empty implementation of an interface method.
+ // DirectViewFinder is used
+ // instead of BitmapViewFinder
+}
+
+void CMMACameraPlayer::ImageReady(CFbsBitmap* aBitmap,
+ HBufC8* aData,
+ TInt aError)
+{
+ DEBUG_INT("MMA::CMMACameraPlayer::ImageReady %d", aError);
+
+ // This method should never be called,
+ // unless we are taking snapshot
+ __ASSERT_DEBUG(iSnapshotStatus, User::Invariant());
+
+ __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant());
+ __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant());
+
+ if (aError == KErrNone)
+ {
+ // this class has ownership of the bitmap until
+ // snapshot bitmap is got from this class.
+ iSnapshotBitmap = aBitmap;
+ iSnapshotEncoded = aData;
+ }
+
+ // notify the caller, error code or KErrNone
+ User::RequestComplete(iSnapshotStatus, aError);
+ iWindow->SetStarted(ETrue);
+ // Status is not needed anymore
+ // and this class don't own the status.
+ iSnapshotStatus = NULL;
+}
+
+void CMMACameraPlayer::FrameBufferReady(MFrameBuffer* /*aFrameBuffer*/,
+ TInt /*aError*/)
+{
+ DEBUG("MMA::CMMACameraPlayer::FrameBufferReady");
+ // this callback will never be called
+ // Asserted in debug build to be sure.
+ __ASSERT_DEBUG(EFalse, User::Invariant());
+}
+
+void CMMACameraPlayer::SetDisplayL(MMMADisplay* aDisplay)
+{
+ DEBUG("MMA::CMMACameraPlayer::SetDisplay");
+
+ // now it is ready to draw
+ iDisplay = aDisplay;
+
+ // Passes display into iWindow.
+ // Allocates all resources needed to use a camera DirectViewFinder.
+ iWindow->SetDisplay(aDisplay);
+
+ iDisplay->SetWindowL(iWindow);
+
+ // Set view finder size to the display only if the view finder
+ // size has been resolved.
+ if (iSize != TSize(0, 0))
+ {
+ iDisplay->SourceSizeChanged(iSize);
+ NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName);
+ }
+}
+
+TSize CMMACameraPlayer::SourceSize()
+{
+ return iSize;
+}
+
+MMMASnapshot::TEncoding CMMACameraPlayer::TakeSnapshotL(TRequestStatus* aStatus,
+ const TSize& aSize,
+ const CMMAImageSettings& aSettings)
+{
+ __ASSERT_DEBUG(!iSnapshotStatus, User::Invariant());
+ __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant());
+ __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant());
+
+ // snapshots can not be taken if player is not realized
+ if (iState < ERealized)
+ {
+ User::Leave(KErrNotReady);
+ }
+ // save status which will be notified
+ iSnapshotStatus = aStatus;
+
+ // changing status to pending
+ *iSnapshotStatus = KRequestPending;
+
+ // Source size not set in the beginning
+ TSize sourceSize;
+
+ // Use default if size is not specified.
+ TInt sourceSizeIndex = iSourceSizeIndex;
+
+ // Largest image size index
+ TInt largestSizeIndex = 0;
+
+ // Get camera characteristics
+ TCameraInfo cameraInfo;
+ iCamera->CameraInfo(cameraInfo);
+
+ // Set default snapshot encoding type
+ TEncoding encoding = EBitmap;
+
+ // Set default image capture format
+ CCamera::TFormat format = CCamera::EFormatFbsBitmapColor16M;
+
+ DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iImageFormatsSupported = 0x%x", cameraInfo.iImageFormatsSupported);
+ DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iNumImageSizesSupported = %d", cameraInfo.iNumImageSizesSupported);
+
+ // Check if size was set in Java
+ if (aSize.iWidth != KErrNotFound &&
+ aSize.iHeight != KErrNotFound)
+ {
+ // Determine if jpeg capture was requested
+ if ((*aSettings.iMimeType == KJpegMime) ||
+ (*aSettings.iMimeType == KImageJpegMime))
+ {
+ // Shortcut for supported image formats
+ TUint32 imageFormats = cameraInfo.iImageFormatsSupported;
+
+ // Jpeg subtype constants
+ _LIT8(KJpegJfif, "jfif");
+ _LIT8(KJpegExif, "exif");
+
+ // Resolve requested jpeg subtype from settings and camerainfo
+ if ((imageFormats & CCamera::EFormatJpeg) &&
+ (*aSettings.iType == KJpegJfif))
+ {
+ // JFIF JPEG
+ format = CCamera::EFormatJpeg;
+ encoding = EEncoded;
+ }
+ else if ((imageFormats & CCamera::EFormatExif) &&
+ (*aSettings.iType == KJpegExif))
+ {
+ // EXIF JPEG
+ format = CCamera::EFormatExif;
+ encoding = EEncoded;
+ }
+ }
+
+ // Try to resolve nearest source size to the one requested,
+ // except for the JFIF and EXIF jpeg subtypes the match has
+ // to be exact otherwise non-encode capture format will be
+ // used
+ ResolveCaptureSizes(format,
+ cameraInfo.iNumImageSizesSupported,
+ aSize,
+ sourceSize,
+ sourceSizeIndex,
+ largestSizeIndex);
+
+ // Format was either of the jpeg formats and requested size
+ // didn't match the source size
+ if ((format >= CCamera::EFormatJpeg &&
+ format <= CCamera::EFormatExif) &&
+ (aSize != sourceSize))
+ {
+ // Try again with an non-encoded format
+ format = CCamera::EFormatFbsBitmapColor16M;
+ encoding = EBitmap;
+ ResolveCaptureSizes(format,
+ cameraInfo.iNumImageSizesSupported,
+ aSize,
+ sourceSize,
+ sourceSizeIndex,
+ largestSizeIndex);
+ }
+
+ if (sourceSizeIndex == KErrNotFound)
+ {
+ // If correct index was not found use the largest.
+ sourceSizeIndex = largestSizeIndex;
+ }
+ }
+ // else use default iSourceSizeIndex and default image capture format
+
+ iCamera->PrepareImageCaptureL(format,
+ sourceSizeIndex);
+
+ // play sound when capturing image
+ CMMACameraSound::PlayImageCaptureSoundL();
+
+ // start capture, ImageReady will be called when ready
+ iWindow->SetStarted(EFalse);
+
+ iCamera->CaptureImage();
+
+ DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: format = 0x%x", format);
+ DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: sourceSizeIndex = %d", sourceSizeIndex);
+ DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: encoding = %d", encoding);
+
+ // Inform caller which snapshot encoding was ultimately used
+ return encoding;
+}
+
+CFbsBitmap* CMMACameraPlayer::SnapshotBitmap()
+{
+ CFbsBitmap* bitmap = iSnapshotBitmap;
+
+ // ownership transfers to the caller
+ iSnapshotBitmap = NULL;
+ return bitmap;
+}
+
+HBufC8* CMMACameraPlayer::SnapshotEncoded()
+{
+ HBufC8* encoded = iSnapshotEncoded;
+
+ // ownership transfers to the caller
+ iSnapshotEncoded = NULL;
+ return encoded;
+}
+
+void CMMACameraPlayer::NotifyWithStringEvent(
+ CMMAPlayerEvent::TEventType aEventType,
+ const TDesC& aStringEventData)
+{
+ PostStringEvent(aEventType, aStringEventData);
+}
+
+MMMASnapshot* CMMACameraPlayer::SnapshoterL()
+{
+ return this;
+}
+
+TInt CMMACameraPlayer::CameraHandle()
+{
+ return iCamera->Handle();
+}
+
+void CMMACameraPlayer::SetViewFinderMode(TBool aStopViewFinder)
+{
+ iStopViewFinder = aStopViewFinder;
+}
+
+// END OF FILE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/src.dsa/cmmacameraplayerfactory.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,224 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class is used for creating camera players.
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <jdebug.h>
+
+#include "cmmacameraplayerfactory.h"
+#include "cmmacameraplayer.h"
+#include "cmmavideocontrol.h"
+#include "cmmavideorecordcontrol.h"
+#include "cmmastoptimecontrol.h"
+#include "cmmaplayerproperties.h"
+#include "cmmammfresolver.h"
+
+_LIT(KDefaultVideo, "video");
+//is the main camera
+_LIT(KDevcamZero, "devcam0");
+// the secondary camera
+_LIT(KDevcamOne, "devcam1");
+
+_LIT(KEncodingProperty, "encoding");
+
+_LIT(KVideoMp4MimeType, "video/mp4");
+_LIT(KVideoH264MimeType, "video/H264");
+
+CMMACameraPlayerFactory* CMMACameraPlayerFactory::NewLC()
+{
+ CMMACameraPlayerFactory* pFactory =
+ new(ELeave) CMMACameraPlayerFactory();
+ CleanupStack::PushL(pFactory);
+ return pFactory;
+}
+
+
+CMMACameraPlayerFactory::CMMACameraPlayerFactory()
+{
+}
+
+
+CMMACameraPlayerFactory::~CMMACameraPlayerFactory()
+{
+ delete iAudioSettings;
+}
+
+CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(
+ CMMAMMFResolver* aResolver)
+{
+ DEBUG("MMA::CMMACameraPlayerFactory::CreatePlayerL( aResolver )+");
+ CMMACameraPlayer* player = CMMACameraPlayer::NewLC(iCameraIndex);
+
+ /* Add VideoControl */
+ CMMAVideoControl* videoControl = new(ELeave)CMMAVideoControl(player);
+
+ CleanupStack::PushL(videoControl);
+ player->AddControlL(videoControl);
+ CleanupStack::Pop(videoControl);
+
+ /* Add RecordControl */
+ CMMAVideoRecordControl* videoRecordControl =
+ CMMAVideoRecordControl::NewL(player,
+ aResolver,
+ iVideoSettings,
+ iAudioSettings,
+ player->CameraHandle());
+ CleanupStack::PushL(videoRecordControl);
+ player->AddControlL(videoRecordControl);
+ // ownership transfered to player
+ CleanupStack::Pop(videoRecordControl);
+
+ // With record control view finder can't be stopped,
+ // because it can not be restarted.
+ player->SetViewFinderMode(EFalse);
+
+ CleanupStack::Pop(player);
+ return player;
+}
+
+
+void CMMACameraPlayerFactory::MediaIdsL(RArray<TUid>& aMediaIds)
+{
+ CleanupClosePushL(aMediaIds);
+ User::LeaveIfError(aMediaIds.Append(KUidMediaTypeVideo));
+ CleanupStack::Pop();
+}
+
+void CMMACameraPlayerFactory::PreparePluginSelectionParametersL(
+ CMMAMMFResolver* aResolver,
+ CMMFFormatSelectionParameters* aFormatSelection)
+{
+ // We are creating record type player
+ aResolver->SetRequiredRecordFormatSupportL(*aFormatSelection);
+}
+
+CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC&)
+{
+ // record player cannot be created from conten-type, since this is used only
+ // when we have also data
+ return NULL;
+}
+
+
+CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC8&)
+{
+ // record player cannot be created with header data
+ return NULL;
+}
+
+CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(
+ const TDesC& aProtocol,
+ const TDesC& aMiddlePart,
+ const TDesC& aParameters)
+{
+ DEBUG_STR("MMA::CMMACameraPlayerFactory::CreatePlayerL aParameters = %S", aParameters);
+ // check that locator is capture:://audio
+ if (aProtocol != KMMACaptureProtocol)
+ {
+ return NULL;
+ }
+
+ iCameraIndex = KErrNotFound;
+
+ // If the device supports multiple cameras then "capture://devcam0" is the
+ // main camera pointing outwards from the user. "capture://devcam1" is the
+ // secondary camera pointing e.g. towards the user. "capture://video" is
+ // the default camera locator pointing to the same camera as "devcam0"
+ if ((aMiddlePart == KDefaultVideo) ||
+ (aMiddlePart == KDevcamZero))
+ {
+ // First camera
+ iCameraIndex = 0;
+ }
+ else if (aMiddlePart == KDevcamOne)
+ {
+ // Second camera.
+ iCameraIndex = 1;
+ }
+ else
+ {
+ // not supported type
+ return NULL;
+ }
+
+ CMMAAudioSettings* audioSettings = new(ELeave) CMMAAudioSettings;
+ audioSettings->iDataType = KMMFFourCCCodeNULL;
+ delete iAudioSettings;
+ iAudioSettings = audioSettings;
+
+ if (aParameters.Length() == 0)
+ {
+ // getting defaults from validator
+ iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters);
+ }
+ else
+ {
+ // we accept either video or mixed parameters, so properties must contain encoding 2 times for mixed and
+ // 1 time for video.
+ // making tmp des without first "encoding"
+ TInt lengthWithoutEncoding = aParameters.Length() - KEncodingProperty().Length();
+ if (lengthWithoutEncoding < 0)
+ {
+ User::Leave(KErrArgument);
+ }
+ TPtrC tmp = aParameters.Right(lengthWithoutEncoding);
+ // finding second "encoding"
+ TInt videoPropertiesStartPos = tmp.Find(KEncodingProperty);
+ if (videoPropertiesStartPos == KErrNotFound)
+ {
+ // there is not another encoding, so assuming that there is only video parameters
+ iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters);
+ }
+ else
+ {
+ // there is mixed parameters
+ videoPropertiesStartPos += KEncodingProperty().Length();
+
+ // skipping '&' char
+ TPtrC audioProperties = aParameters.Left(videoPropertiesStartPos - 1);
+ TPtrC videoProperties = aParameters.Mid(videoPropertiesStartPos);
+ iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(videoProperties);
+
+ CMMAAudioSettings* audioSettings = TMMAParameterValidator::ValidateAudioPropertiesL(audioProperties);
+ delete iAudioSettings;
+ iAudioSettings = audioSettings;
+ }
+ }
+
+ // if wanted video capture encoding is H264, we must create player with video/mp4
+ // because mmf doesn't have controller for H264
+ if (iVideoSettings.iEncoding.Compare(KVideoH264MimeType) == 0)
+ {
+ return CMMAMMFPlayerFactory::CreatePlayerL(KVideoMp4MimeType);
+ }
+
+ // Find controller with content-type
+ return CMMAMMFPlayerFactory::CreatePlayerL(iVideoSettings.iEncoding);
+}
+
+void CMMACameraPlayerFactory::GetSupportedProtocolsL(
+ const TDesC& aContentType,
+ CDesC16Array& aProtocolArray)
+{
+ if (IsSupportedContentTypeL(aContentType))
+ {
+ aProtocolArray.AppendL(KMMACaptureProtocol);
+ }
+}
+
+// END OF FILE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/src.dsa/cmmasnapshot.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,248 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class takes snapshot and resizes bitmap if needed.
+*
+*/
+
+
+// INCLUDE FILES
+#include <jdebug.h>
+
+#include "cmmasnapshot.h"
+#include "mmmaguiplayer.h"
+#include "mmmasnapshotreadycallback.h"
+#include "mmmasnapshot.h"
+
+// CONSTANTS
+const TInt KIgnoreSize = -1;
+
+
+// CONSTRUCTION
+CMMASnapshot* CMMASnapshot::NewL(MMMAGuiPlayer* aGuiPlayer,
+ MMMASnapshotReadyCallback& aCallBack)
+{
+ CMMASnapshot* self = new(ELeave) CMMASnapshot(aGuiPlayer,
+ aCallBack);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(); // self
+ return self;
+}
+
+CMMASnapshot::~CMMASnapshot()
+{
+ if (iScaler)
+ {
+ iScaler->Cancel();
+ delete iScaler;
+ }
+ if (iEncoder)
+ {
+ iEncoder->Cancel();
+ delete iEncoder;
+ }
+ delete iBitmap;
+ delete iBuffer;
+ delete iSettings;
+}
+
+void CMMASnapshot::ConstructL()
+{
+ CActiveScheduler::Add(this);
+ iScaler = CBitmapScaler::NewL();
+}
+
+CMMASnapshot::CMMASnapshot(MMMAGuiPlayer* aGuiPlayer,
+ MMMASnapshotReadyCallback& aCallBack):
+ CActive(EPriorityStandard),
+ iEncoding(MMMASnapshot::EBitmap),
+ iCallBack(aCallBack),
+ iState(EIdle)
+{
+ iGUIPlayer = aGuiPlayer;
+}
+
+void CMMASnapshot::TakeSnapShotL(const TDesC& aProperties)
+{
+ // snapshot sequence is not finished
+ __ASSERT_DEBUG(iState == EIdle, User::Invariant());
+ // image buffer must be taken with ImageBuffer before taking new snapshot
+ __ASSERT_DEBUG(iBuffer == NULL, User::Invariant());
+
+ CMMAImageSettings* settings
+ = TMMAParameterValidator::ValidateImagePropertiesL(aProperties);
+ CleanupStack::PushL(settings);
+
+ delete iSettings;
+ CleanupStack::Pop(settings);
+ iSettings = settings;
+
+ // take snapshot from player. RunL is called when image is ready
+ // or error occures
+ iState = ETakingSnapshot;
+ TSize snapshotSize(iSettings->iWidth, iSettings->iHeight);
+ iEncoding = iGUIPlayer->SnapshoterL()->TakeSnapshotL(&iStatus,
+ snapshotSize,
+ *iSettings);
+ SetActive();
+}
+
+HBufC8* CMMASnapshot::ImageBuffer()
+{
+ // this must not be called when snapshot sequence is running
+ __ASSERT_DEBUG(iState == EIdle, User::Invariant());
+ HBufC8* buffer = iBuffer;
+ // caller takes ownership of the buffer
+ iBuffer = NULL;
+ return buffer;
+}
+
+void CMMASnapshot::ResizeL()
+{
+ iState = EResizing;
+ TSize imageSize(iBitmap->SizeInPixels());
+ if (iSettings->iWidth != KIgnoreSize)
+ {
+ imageSize.iWidth = iSettings->iWidth;
+ }
+ if (iSettings->iHeight != KIgnoreSize)
+ {
+ imageSize.iHeight = iSettings->iHeight;
+ }
+ if (imageSize == iBitmap->SizeInPixels())
+ {
+ // no user resizing needed, continue sequence
+ EncodeL();
+ }
+ else
+ {
+ iScaler->Scale(&iStatus, *iBitmap, imageSize, EFalse);
+ SetActive();
+ }
+}
+
+void CMMASnapshot::EncodeL()
+{
+ // CImageEncoder cannot be reused, so have to make it every time
+ CImageEncoder* encoder = CImageEncoder::DataNewL(iBuffer, *iSettings->iMimeType);
+ delete iEncoder;
+ iEncoder = encoder;
+
+ iState = EEncoding;
+ iEncoder->Convert(&iStatus, *iBitmap, iSettings->iImageData);
+ SetActive();
+}
+
+void CMMASnapshot::Completed(TInt aError)
+{
+ iStatus = aError;
+ iCallBack.SnapshotReady();
+}
+
+void CMMASnapshot::RunL()
+{
+ if (iStatus != KErrNone)
+ {
+ // Error has occured, inform java side and change state
+ iState = EIdle;
+ Completed(iStatus.Int());
+ return;
+ }
+
+ switch (iState)
+ {
+ case ETakingSnapshot:
+ {
+ DEBUG_INT("MMA::CMMASnapshot::RunL: iEncoding = %d", iEncoding);
+ if (iEncoding == MMMASnapshot::EEncoded)
+ {
+ // take encoded image from player.
+ // Ownership transfers to this class.
+ iBuffer = iGUIPlayer->SnapshoterL()->SnapshotEncoded();
+ if (!iBuffer)
+ {
+ // error has occured with taking image
+ Completed(KErrNotFound);
+ }
+ // Image is ready, update internal state and inform listener
+ // Encoded images are not resized
+ iState = EIdle;
+ Completed(KErrNone);
+ }
+ else
+ {
+ // take bitmap from player.
+ // Ownership transfers to this class.
+ iBitmap = iGUIPlayer->SnapshoterL()->SnapshotBitmap();
+ if (!iBitmap)
+ {
+ // error has occured with taking image
+ Completed(KErrNotFound);
+ }
+ // Continue to next state
+ ResizeL();
+ }
+ break;
+ }
+ case EResizing:
+ {
+ // Continue to next state
+ EncodeL();
+ break;
+ }
+ case EEncoding:
+ {
+ delete iEncoder;
+ iEncoder = NULL;
+
+ delete iBitmap;
+ iBitmap = NULL;
+ iState = EIdle;
+ // encoding is ready, inform listener
+ Completed(KErrNone);
+ break;
+ }
+ default:
+ {
+ // unknown state
+ __ASSERT_DEBUG(EFalse, User::Invariant());
+ }
+ }
+}
+
+TInt CMMASnapshot::RunError(TInt aError)
+{
+ // Reset state
+ iState = EIdle;
+ // Pass error code to observer
+ Completed(aError);
+
+ return KErrNone;
+}
+
+void CMMASnapshot::DoCancel()
+{
+ // snapshot taking cannot be cancelled
+ if (iScaler)
+ {
+ iScaler->Cancel();
+ }
+ if (iEncoder)
+ {
+ iEncoder->Cancel();
+ }
+ iState = EIdle;
+}
+
+// END OF FILE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/src.nga/cmmacameraplayer.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,964 @@
+/*
+* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class is used for playing camera.
+*
+*/
+
+
+// INCLUDE FILES
+#include <sensrvchannelfinder.h>
+#include <sensrvorientationsensor.h>
+#include <jdebug.h>
+#include <fbs.h>
+#include <e32svr.h>
+#include "cmmacameraplayer.h"
+#include "tmmaparametervalidator.h"
+#include "mmmadisplay.h"
+#include "cmmacamerasound.h"
+
+#if defined( __WINS__ )
+#include <w32std.h>
+#endif
+
+// CONSTANTS
+_LIT8(KImageJpegMime, "image/jpeg");
+_LIT8(KJpegMime, "jpeg");
+_LIT(KVideoControlName, "VideoControl");
+
+CMMACameraPlayer* CMMACameraPlayer::NewLC(TCamActiveCamera aCameraIndex)
+{
+ CMMACameraPlayer* self = new(ELeave) CMMACameraPlayer(aCameraIndex);
+ CleanupStack::PushL(self);
+ self->ConstructL(aCameraIndex);
+ return self;
+}
+
+CMMACameraPlayer::~CMMACameraPlayer()
+{
+ DEBUG("CMMACameraPlayer::~CMMACameraPlayer +");
+
+ // Free (duplicated) UI camera resources first.
+ // Window is not able to send any
+ // callback requests to UI from now.
+ if (iWindow)
+ {
+ iWindow->SetDisplay(NULL);
+ }
+
+ if (iCamera)
+ {
+ iCamera->CancelCaptureImage();
+ iCamera->Release();
+ delete iCamera;
+ }
+
+ delete iSnapshotEncoded;
+ delete iSnapshotBitmap;
+ delete iRealizeWait;
+
+ if (iDisplay && iDisplay->HasContainer())
+ {
+ // Window will delete itself
+ // after all pending events are processed
+ // (lazy delete)
+ iDisplay->UIGetCallback(
+ *iWindow, CMMACameraWindow::EDestroyWindow);
+ }
+ else
+ {
+ delete iWindow;
+ }
+ iWindow = NULL;
+ // Delete sensor api object
+ delete iAccSensorChannel;
+ DEBUG("CMMACameraPlayer::~CMMACameraPlayer -");
+}
+
+
+CMMACameraPlayer::CMMACameraPlayer(TCamActiveCamera aCameraIndex):
+ iDisplay(NULL),
+ iSourceSizeIndex(KErrNotFound),
+ iStartTime(KErrNotFound),
+ iSnapshotEncoded(NULL),
+ iActiveCameraIndex(aCameraIndex),
+ iImageOrientation(ECamOrientation0),
+ iLastImageOrientation(ECamOrientation0)
+{
+ iStopViewFinder = ETrue;
+}
+
+
+void CMMACameraPlayer::ConstructL(TCamActiveCamera aCameraIndex)
+{
+ CMMAPlayer::ConstructL();
+
+ if (aCameraIndex >= CCamera::CamerasAvailable())
+ {
+ // image capture is not supported
+ User::Leave(KErrNotFound);
+ }
+
+ iCamera = CCamera::New2L(*this, aCameraIndex, 100);
+
+ iCustomInterfaceOrientation =
+ static_cast <MCameraOrientation*>(
+ iCamera->CustomInterface(KCameraOrientationUid ));
+ iCustomInterfaceUIOrientationOverride =
+ static_cast <MCameraUIOrientationOverride*>(
+ iCamera->CustomInterface(KCameraUIOrientationOverrideUid));
+ // Fix to landscape mode
+ iCustomInterfaceUIOrientationOverride->SetOrientationModeL(1);
+
+ iWindow = CMMACameraWindow::NewL(iCamera->Handle());
+
+ TCameraInfo cameraInfo;
+ iCamera->CameraInfo(cameraInfo);
+
+ if (cameraInfo.iNumImageSizesSupported < 1)
+ {
+ // image capture is not supported
+ User::Leave(KErrNotFound);
+ }
+
+ // default snapshot size
+ iSourceSizeIndex = cameraInfo.iNumImageSizesSupported - 1;
+
+ iRealizeWait = new(ELeave)CRealizeWait;
+}
+
+TInt64 CMMACameraPlayer::CurrentTime()
+{
+ TTime time;
+ time.HomeTime();
+ return time.Int64();
+}
+
+void CMMACameraPlayer::ResolveViewFinderSizeL(TSize& aSize)
+{
+ DEBUG("CMMACameraPlayer::ResolveViewFinderSizeL");
+
+ TSize resultSize;
+
+ // The only way to find out the size is to start the view finder
+ // with a proper size (screen size).
+
+ ResolveScreenSizeL(resultSize);
+
+ // StartViewFinderBitmapsL changes resultSize to
+ // the used view finder size.
+ // Used to get the source size only.
+ iCamera->StartViewFinderBitmapsL(resultSize);
+
+ // Bitmap viewfinder is not used anymore.
+ iCamera->StopViewFinder();
+
+ aSize = resultSize;
+}
+
+void CMMACameraPlayer::ResolveScreenSizeL(TSize& aSize)
+{
+ DEBUG("CMMACameraPlayer::ResolveScreenSizeL");
+
+#if defined( __WINS__ )
+ TSize size(0,0);
+ RWsSession ws;
+
+ if (ws.Connect() == KErrNone)
+ {
+ CleanupClosePushL(ws);
+
+ CWsScreenDevice* wsScreenDevice = new(ELeave)CWsScreenDevice(ws);
+ CleanupStack::PushL(wsScreenDevice);
+
+ User::LeaveIfError(wsScreenDevice->Construct());
+
+ size = wsScreenDevice->SizeInPixels();
+
+ CleanupStack::PopAndDestroy(2); // wsScreenDevice, ws.Close()
+ }
+
+ aSize = size;
+
+#else
+ TScreenInfoV01 info;
+ TPckgBuf< TScreenInfoV01 > buf(info);
+
+ UserSvr::ScreenInfo(buf);
+ info = buf();
+
+ aSize = info.iScreenSize;
+#endif
+}
+
+void CMMACameraPlayer::ResolveCaptureSizes(const CCamera::TFormat aFormat,
+ const TInt aNumImageSizesSupported,
+ const TSize& aRequestSize,
+ TSize& aSourceSize,
+ TInt& aSourceIndex,
+ TInt& aLargestIndex)
+{
+ // Largest image size
+ TSize largestSize;
+ // Index to largest image size
+ TInt largestSizeIndex = 0;
+ // Source size
+ TSize sourceSize;
+ // Default source size index not set
+ TInt sourceSizeIndex = KErrNotFound;
+ // Temporary size for iterating capture sizes
+ TSize tmpSize;
+
+ DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: aFormat = 0x%x", aFormat);
+
+ // go through all supported sizes.
+ // Notice: Capture sizes are assumed to be in order from smaller to larger sizes
+ for (TInt i = 0; i < aNumImageSizesSupported; i++)
+ {
+ iCamera->EnumerateCaptureSizes(tmpSize,
+ i,
+ aFormat);
+
+ DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iWidth = %d", tmpSize.iWidth);
+ DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iHeight = %d", tmpSize.iHeight);
+
+ // Check if current is the largest
+ if ((largestSize.iWidth < tmpSize.iWidth) &&
+ (largestSize.iHeight < tmpSize.iHeight))
+ {
+ largestSize = tmpSize;
+ largestSizeIndex = i;
+ }
+
+ // If wanted size is smaller than tmpSize we can use it
+ if ((aRequestSize.iWidth <= tmpSize.iWidth) &&
+ (aRequestSize.iHeight <= tmpSize.iHeight))
+ {
+ sourceSize = tmpSize;
+ sourceSizeIndex = i;
+ }
+ }
+
+ DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: sourceSizeIndex = %d", sourceSizeIndex);
+ DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: largestSizeIndex = %d", largestSizeIndex);
+
+ aSourceSize = sourceSize;
+ aSourceIndex = sourceSizeIndex;
+ aLargestIndex = largestSizeIndex;
+}
+
+void CMMACameraPlayer::StartL(TBool aPostEvent)
+{
+ DEBUG_INT("CMMACameraPlayer:StartL iState %d", iState);
+
+ // start can't be called to not ready player
+ if (iState == EPrefetched)
+ {
+ // camera passes ready images through
+ // ViewFinderFrameReady method
+
+ // set time when started
+ iStartTime = CurrentTime();
+
+ // inform java side
+ ChangeState(EStarted);
+
+ TInt64 time;
+ GetMediaTime(&time);
+
+ // Notify the camera window
+ // about the status change
+ iWindow->SetStarted(ETrue);
+
+ if (aPostEvent)
+ {
+ // inform java side
+ PostLongEvent(CMMAPlayerEvent::EStarted, time);
+ }
+ }
+ PostActionCompleted(KErrNone); // java start return
+}
+
+void CMMACameraPlayer::StopL(TBool aPostEvent)
+{
+ DEBUG_INT("CMMACameraPlayer::StopL", iState);
+ if (iState == EStarted)
+ {
+ TInt64 time;
+ GetMediaTime(&time); // add played time to media time
+
+ if (iStopViewFinder && iWindow->ViewFinderActive())
+ {
+ iWindow->SetStarted(EFalse);
+ }
+ iStartTime = KErrNotFound;
+
+ if (aPostEvent)
+ {
+ PostLongEvent(CMMAPlayerEvent::EStopped, time);
+ }
+
+ // go back to prefetched state
+ ChangeState(EPrefetched);
+ }
+}
+
+void CMMACameraPlayer::DeallocateL()
+{
+ // If player is started when deallocate is called,
+ // player is stopped from java side -> state is changed to
+ // prefetched.
+ // In prefetched state only reserved resource is
+ // camera reserve( released with iCamera->Release() )
+ // In realized state no resources have been reserved.
+ // CHANGED: not releasing camera anymore, since it is already
+ // done in realized state
+ if (iState == EPrefetched)
+ {
+ ChangeState(ERealized);
+ }
+}
+
+
+void CMMACameraPlayer::RealizeL()
+{
+ iCamera->Reserve();
+ // this lock will be released when power on is completed (or error)
+ if (!iRealizeWait->IsStarted())
+ {
+ iRealizeWait->Start();
+ }
+ User::LeaveIfError(iRealizeWait->iError);
+ CMMAPlayer::RealizeL();
+}
+
+
+void CMMACameraPlayer::PrefetchL()
+{
+ DEBUG("MMA::CMMACameraPlayer::PrefetchL");
+ // nothing to do here
+ ChangeState(EPrefetched);
+ PostActionCompleted(KErrNone);
+}
+
+
+void CMMACameraPlayer::GetDuration(TInt64* aDuration)
+{
+ // camera viewer has no duration.
+ *aDuration = KTimeUnknown;
+}
+
+
+void CMMACameraPlayer::SetMediaTimeL(TInt64* /*aTime*/)
+{
+ DEBUG("MMA::CMMACameraPlayer::SetMediaTimeL ");
+ // with camera media time is not supported.
+}
+
+
+void CMMACameraPlayer::GetMediaTime(TInt64* aMediaTime)
+{
+ if (iState == EStarted)
+ {
+ // add play time to media time
+ iMediaTime += CurrentTime() - iStartTime;
+ // set new start time
+ iStartTime = CurrentTime();
+ }
+
+ // set value to parameter
+ (*aMediaTime) = iMediaTime;
+}
+
+void CMMACameraPlayer::CloseL()
+{
+ DEBUG("MMA::CMMACameraPlayer::CloseL()");
+
+ // cancel all activity
+ iCamera->CancelCaptureImage();
+
+ // Stop and release UI Camera instance
+ iWindow->SetDisplay(NULL);
+
+ // we don't need reserve camera anymore
+ iCamera->Release();
+
+ iCustomInterfaceOrientation = NULL;
+ if (iAccSensorChannel)
+ {
+ iAccSensorChannel->StopDataListening();
+ }
+
+ if (iDisplay)
+ {
+ iDisplay->FixUIOrientation(EFalse);
+ }
+
+ CMMAPlayer::CloseL();
+}
+
+const TDesC& CMMACameraPlayer::Type()
+{
+ return KMMACameraPlayer;
+}
+
+
+void CMMACameraPlayer::HandleEvent(const TECAMEvent& aEvent)
+{
+ TInt error = aEvent.iErrorCode;
+ if (KUidECamEventReserveComplete == aEvent.iEventType)
+ {
+ DEBUG_INT("MMA::CMMACameraPlayer::HandleEvent:KUidECamEventReserveComplete error %d", error);
+ if (error == KErrNone)
+ {
+ // camera will notify completion with PowerOnComplete method.
+ iCamera->PowerOn();
+ }
+ else
+ {
+ // release lock and store error. State doesn't change.
+ iRealizeWait->iError = error;
+ iRealizeWait->AsyncStop();
+ }
+ }
+ else if (KUidECamEventPowerOnComplete == aEvent.iEventType)
+ {
+ DEBUG_INT("MMA::CMMACameraPlayer::HandleEvent:KUidECamEventPowerOnComplete error %d", error);
+
+ TSize viewFinderSize;
+
+ if (error == KErrNone)
+ {
+ // The view finder size must be known after prefetching.
+ TRAP(error, ResolveViewFinderSizeL(viewFinderSize));
+ }
+
+ if (error == KErrNone)
+ {
+ iSize = viewFinderSize;
+
+ if (iDisplay)
+ {
+ iDisplay->SourceSizeChanged(iSize);
+ NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName);
+
+ iDisplay->FixUIOrientation(ETrue);
+ }
+ }
+
+ iRealizeWait->iError = error;
+ iRealizeWait->AsyncStop();
+ }
+}
+
+void CMMACameraPlayer::ViewFinderReady(MCameraBuffer& aCameraBuffer,
+ TInt /*aError*/)
+{
+ aCameraBuffer.Release();
+}
+
+void CMMACameraPlayer::ImageBufferReady(MCameraBuffer& aCameraBuffer,TInt aError)
+{
+ DEBUG_INT("MMA::CMMACameraPlayer::ImageBufferReady %d", aError);
+
+ // This method should never be called,
+ // unless we are taking snapshot
+ __ASSERT_DEBUG(iSnapshotStatus, User::Invariant());
+ __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant());
+ __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant());
+
+ TInt error = aError;
+ if (aError == KErrNone)
+ {
+ CFbsBitmap* srcBitmap = NULL;
+ TRAP(error, HandleBitmapCopyL(aCameraBuffer, srcBitmap));
+ DEBUG_INT("MMA::CMMACameraPlayer::ImageBufferReady HandleBitmapCopyL %d", error);
+
+ // picture data is not of bitmap type
+ if (!srcBitmap && (KErrNotSupported == error))
+ {
+ TDesC8* temp = NULL;
+ TRAP(error, temp = aCameraBuffer.DataL(0));
+ DEBUG_INT("CMMACameraPlayer::CopyImageDataL DataL error %d", error);
+ if (KErrNone == error)
+ {
+ iSnapshotEncoded = temp->Alloc();
+ }
+ }
+ }
+
+ // notify the caller, error code or KErrNone
+ User::RequestComplete(iSnapshotStatus, error);
+ iWindow->SetStarted(ETrue);
+ // Status is not needed anymore
+ // and this class don't own the status.
+ iSnapshotStatus = NULL;
+ aCameraBuffer.Release();
+}
+
+void CMMACameraPlayer::VideoBufferReady(MCameraBuffer& aCameraBuffer,
+ TInt /*aError*/)
+{
+ aCameraBuffer.Release();
+}
+
+void CMMACameraPlayer::HandleBitmapCopyL(MCameraBuffer& aCameraBuffer,
+ CFbsBitmap* aSrcBitmap)
+{
+ DEBUG("MMA::CMMACameraPlayer::HandleBitmapCopyL +");
+
+ aSrcBitmap = &(aCameraBuffer.BitmapL(0)); // not owned
+
+ iSnapshotBitmap = new(ELeave)CFbsBitmap();
+
+ User::LeaveIfError(iSnapshotBitmap->Create(aSrcBitmap->SizeInPixels(),
+ aSrcBitmap->DisplayMode()));
+ CFbsBitmapDevice* bitmapDevice = NULL;
+ CFbsBitGc* bitmapGc = NULL;
+
+ bitmapDevice = CFbsBitmapDevice::NewL(iSnapshotBitmap);
+ bitmapDevice->CreateContext(bitmapGc);
+ bitmapGc->BitBlt(TPoint(0,0), aSrcBitmap);
+
+ delete bitmapGc;
+ delete bitmapDevice;
+ DEBUG("MMA::CMMACameraPlayer::HandleBitmapCopyL -");
+}
+
+void CMMACameraPlayer::SetDisplayL(MMMADisplay* aDisplay)
+{
+ DEBUG("MMA::CMMACameraPlayer::SetDisplay");
+
+ // now it is ready to draw
+ iDisplay = aDisplay;
+
+ // Passes display into iWindow.
+ // Allocates all resources needed to use a camera DirectViewFinder.
+ iWindow->SetDisplay(aDisplay);
+
+ iDisplay->SetWindowL(iWindow);
+
+ // Set view finder size to the display only if the view finder
+ // size has been resolved.
+ if (iSize != TSize(0, 0))
+ {
+ iDisplay->SourceSizeChanged(iSize);
+ NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName);
+ }
+
+ iDisplay->FixUIOrientation(ETrue);
+ UpdateSensorInfoL();
+}
+
+TSize CMMACameraPlayer::SourceSize()
+{
+ return iSize;
+}
+
+MMMASnapshot::TEncoding CMMACameraPlayer::TakeSnapshotL(TRequestStatus* aStatus,
+ const TSize& aSize,
+ const CMMAImageSettings& aSettings)
+{
+ __ASSERT_DEBUG(!iSnapshotStatus, User::Invariant());
+ __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant());
+ __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant());
+
+ // snapshots can not be taken if player is not realized
+ if (iState < ERealized)
+ {
+ User::Leave(KErrNotReady);
+ }
+ // save status which will be notified
+ iSnapshotStatus = aStatus;
+
+ // changing status to pending
+ *iSnapshotStatus = KRequestPending;
+
+ // Source size not set in the beginning
+ TSize sourceSize;
+
+ // Use default if size is not specified.
+ TInt sourceSizeIndex;
+
+ if (aSize.iWidth != KErrNotFound &&
+ aSize.iHeight != KErrNotFound)
+ {
+ sourceSizeIndex = iSourceSizeIndex;
+ }
+ else
+ {
+ sourceSizeIndex = 0;
+ }
+
+ // Largest image size index
+ TInt largestSizeIndex = 0;
+
+ // Get camera characteristics
+ TCameraInfo cameraInfo;
+ iCamera->CameraInfo(cameraInfo);
+
+ // Set default snapshot encoding type
+ TEncoding encoding = EEncoded;
+ // Set default image capture format
+ CCamera::TFormat format = CCamera::EFormatExif;
+
+ DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iImageFormatsSupported = 0x%x", cameraInfo.iImageFormatsSupported);
+ DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iNumImageSizesSupported = %d", cameraInfo.iNumImageSizesSupported);
+
+ // Check if size was set in Java
+ if (aSize.iWidth != KErrNotFound &&
+ aSize.iHeight != KErrNotFound)
+ {
+ DEBUG("MMA::CMMACameraPlayer::TakeSnapshotL size was set in MIDlet");
+ // Determine if jpeg capture was requested
+ if ((*aSettings.iMimeType == KJpegMime) ||
+ (*aSettings.iMimeType == KImageJpegMime))
+ {
+ // Shortcut for supported image formats
+ TUint32 imageFormats = cameraInfo.iImageFormatsSupported;
+
+ // Jpeg subtype constants
+ _LIT8(KJpegJfif, "jfif");
+ _LIT8(KJpegExif, "exif");
+
+ // Resolve requested jpeg subtype from settings and camerainfo
+ if ((imageFormats & CCamera::EFormatJpeg) &&
+ (*aSettings.iType == KJpegJfif))
+ {
+ // JFIF JPEG
+ format = CCamera::EFormatJpeg;
+ encoding = EEncoded;
+ }
+ else if ((imageFormats & CCamera::EFormatExif) &&
+ (*aSettings.iType == KJpegExif))
+ {
+ // EXIF JPEG
+ format = CCamera::EFormatExif;
+ encoding = EEncoded;
+ }
+ }
+
+ // Try to resolve nearest source size to the one requested,
+ // except for the JFIF and EXIF jpeg subtypes the match has
+ // to be exact otherwise non-encode capture format will be
+ // used
+ ResolveCaptureSizes(format,
+ cameraInfo.iNumImageSizesSupported,
+ aSize,
+ sourceSize,
+ sourceSizeIndex,
+ largestSizeIndex);
+
+ // Format was either of the jpeg formats and requested size
+ // didn't match the source size
+ if ((format >= CCamera::EFormatJpeg &&
+ format <= CCamera::EFormatExif) &&
+ (aSize != sourceSize))
+ {
+ // Try again with an non-encoded format
+ format = CCamera::EFormatFbsBitmapColor16M;
+ encoding = EBitmap;
+ ResolveCaptureSizes(format,
+ cameraInfo.iNumImageSizesSupported,
+ aSize,
+ sourceSize,
+ sourceSizeIndex,
+ largestSizeIndex);
+ }
+
+ if (sourceSizeIndex == KErrNotFound)
+ {
+ // If correct index was not found use the largest.
+ sourceSizeIndex = largestSizeIndex;
+ }
+ }
+ // else use default iSourceSizeIndex and default image capture format
+
+ iCamera->PrepareImageCaptureL(format,
+ sourceSizeIndex);
+
+ // play sound when capturing image
+ CMMACameraSound::PlayImageCaptureSoundL();
+
+ // start capture, ImageBufferReady will be called when ready
+ iWindow->SetStarted(EFalse);
+
+ iCamera->CaptureImage();
+
+ DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: format = 0x%x", format);
+ DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: sourceSizeIndex = %d", sourceSizeIndex);
+ DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: encoding = %d", encoding);
+
+ // Inform caller which snapshot encoding was ultimately used
+ return encoding;
+}
+
+CFbsBitmap* CMMACameraPlayer::SnapshotBitmap()
+{
+ CFbsBitmap* bitmap = iSnapshotBitmap;
+
+ // ownership transfers to the caller
+ iSnapshotBitmap = NULL;
+ return bitmap;
+}
+
+HBufC8* CMMACameraPlayer::SnapshotEncoded()
+{
+ HBufC8* encoded = iSnapshotEncoded;
+
+ // ownership transfers to the caller
+ iSnapshotEncoded = NULL;
+ return encoded;
+}
+
+void CMMACameraPlayer::NotifyWithStringEvent(
+ CMMAPlayerEvent::TEventType aEventType,
+ const TDesC& aStringEventData)
+{
+ PostStringEvent(aEventType, aStringEventData);
+}
+
+MMMASnapshot* CMMACameraPlayer::SnapshoterL()
+{
+ return this;
+}
+
+TInt CMMACameraPlayer::CameraHandle()
+{
+ return iCamera->Handle();
+}
+
+void CMMACameraPlayer::SetViewFinderMode(TBool aStopViewFinder)
+{
+ iStopViewFinder = aStopViewFinder;
+}
+
+void CMMACameraPlayer::UpdateSensorInfoL()
+{
+ DEBUG("CMMACameraPlayer::UpdateSensorInfoL +");
+ CSensrvChannelFinder* channelFinder;
+ channelFinder = CSensrvChannelFinder::NewL();
+ CleanupStack::PushL(channelFinder);
+
+ //List of found channels.
+ RSensrvChannelInfoList channelInfoList;
+ CleanupClosePushL(channelInfoList);
+
+ //Create and fill channel search criteria.
+ TSensrvChannelInfo channelInfo;
+ channelInfo.iChannelType = KSensrvChannelTypeIdOrientationData;
+ //Find the orientation channel
+ channelFinder->FindChannelsL(channelInfoList, channelInfo);
+
+ if(channelInfoList.Count() != 1)
+ {
+ DEBUG("CMMACameraPlayer::UpdateSensorInfoL, Orientation channel not found");
+ User::Leave( KErrNotSupported );
+ }
+ else
+ {
+ DEBUG("CMMACameraPlayer::UpdateSensorInfoL, Orientation channel found");
+ }
+
+ iAccSensorChannel = CSensrvChannel::NewL(channelInfoList[ 0 ]);
+ CleanupStack::PopAndDestroy(&channelInfoList);
+ CleanupStack::PopAndDestroy(channelFinder);
+
+ TRAPD(channelerror, iAccSensorChannel->OpenChannelL());
+ if (channelerror!=KErrNone)
+ {
+ User::Leave( channelerror );
+ }
+
+ // start listening
+ iAccSensorChannel->StartDataListeningL(this, //this object is data listener for this channel
+ 1, //aDesiredCount is one, i.e. each orientation change is notified separately
+ 1, //aMaximumCount is one, i.e. object count in receiving data buffer is one
+ 0);//buffering period is not used
+ iLastImageOrientation = ECamOrientation0;
+ DEBUG("CMMACameraPlayer::UpdateSensorInfoL -");
+}
+
+void CMMACameraPlayer::DataReceived(CSensrvChannel& aChannel,
+ TInt /*aCount*/,
+ TInt /*aDataLost*/)
+{
+ DEBUG_INT("CMMACameraPlayer::DataReceived aChannel %d", aChannel.GetChannelInfo().iChannelType);
+
+ if (KSensrvChannelTypeIdOrientationData == aChannel.GetChannelInfo().iChannelType)
+ {
+ TSensrvOrientationData orientationData;
+ TPckg<TSensrvOrientationData> orientationPackage(orientationData);
+ aChannel.GetData(orientationPackage);
+
+ iImageOrientation =
+ MapSensorOrientatio2CamOrientation(orientationData.iDeviceOrientation,
+ iLastImageOrientation,
+ iActiveCameraIndex);
+
+ TRAPD(error, iCustomInterfaceOrientation->SetOrientationL(Map2CameraOrientation(iImageOrientation)));
+ if (KErrNone == error)
+ {
+ DEBUG_INT("CMMACameraPlayer::DataReceived SetOrientationL error = %d", error);
+ }
+
+ iLastImageOrientation = iImageOrientation;
+ }
+}
+
+void CMMACameraPlayer::DataError(CSensrvChannel& /*aChannel*/,
+ TSensrvErrorSeverity aError)
+{
+ DEBUG_INT("MMA::CMMACameraPlayer::DataError: aError = %d", aError);
+ if ( ESensrvErrorSeverityFatal == aError )
+ {
+ // Delete sensor api object
+ delete iAccSensorChannel;
+ iAccSensorChannel = NULL;
+
+ // Set orientation back to default if not already there.
+ iImageOrientation = ECamOrientation0;
+ }
+}
+
+void CMMACameraPlayer::GetDataListenerInterfaceL(TUid /*aInterfaceUid*/,
+ TAny*& /*aInterface*/)
+{
+}
+
+TCamImageOrientation CMMACameraPlayer::MapSensorOrientatio2CamOrientation(
+ const TSensrvOrientationData::TSensrvDeviceOrientation& aSensorOrientation,
+ TCamImageOrientation aLastImageOrientation,
+ TCamActiveCamera aActiveCameraIndex)
+{
+ DEBUG_INT("MMA::CMMACameraPlayer::MapSensorOrientatio2CamOrientation: aSensorOrientation = %d",
+ aSensorOrientation);
+
+ TCamImageOrientation cameraOrientation( ECamOrientation0 );
+
+ // Primary camera rotation
+ if (aActiveCameraIndex == ECamActiveCameraPrimary)
+ {
+ switch(aSensorOrientation)
+ {
+ case TSensrvOrientationData::EOrientationDisplayUpwards:
+ DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayUpwards");
+ // If coming from upside down portrait...
+ if ( ECamOrientation270 == aLastImageOrientation )
+ {
+ // Switch from upside down portrait to normal portrait.") )
+ cameraOrientation = ECamOrientation90; // Set normal portrait
+ }
+ // If coming from upside down landscape...
+ else if ( ECamOrientation180 == aLastImageOrientation )
+ {
+ // Switch from upside down landscape to normal landscape...") )
+ cameraOrientation = ECamOrientation0; // Set normal lanscape
+ }
+ // If neither one, keep the current image orientation.
+ else
+ {
+ cameraOrientation = ECamOrientationIgnore;
+ }
+ break;
+
+ case TSensrvOrientationData::EOrientationDisplayDownwards:
+ DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayDownwards");
+ // Camera is pointing up now. Check if it was upside down previously.
+ // If coming from upside down portrait...
+ if ( ECamOrientation270 == aLastImageOrientation )
+ {
+ // Switch from upside down portrait to normal portrait...") )
+ cameraOrientation = ECamOrientation90; // Set normal portrait
+ }
+ // If coming from upside down landscape...
+ else if ( ECamOrientation180 == aLastImageOrientation )
+ {
+ // Switch from upside down landscape to normal landscape...") )
+ cameraOrientation = ECamOrientation0; // Set normal lanscape
+ }
+ // If neither one, keep the current image orientation.
+ else
+ {
+ cameraOrientation = ECamOrientationIgnore;
+ }
+ break;
+ case TSensrvOrientationData::EOrientationDisplayRightUp:
+ DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayRightUp");
+ case TSensrvOrientationData::EOrientationUndefined:
+ DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationUndefined");
+ cameraOrientation = ECamOrientation0;
+ break;
+ case TSensrvOrientationData::EOrientationDisplayUp:
+ DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayUp");
+ cameraOrientation = ECamOrientation90;
+ break;
+ case TSensrvOrientationData::EOrientationDisplayLeftUp:
+ DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayLeftUp");
+ cameraOrientation = ECamOrientation180;
+ break;
+ case TSensrvOrientationData::EOrientationDisplayDown:
+ DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation EOrientationDisplayDown");
+ cameraOrientation = ECamOrientation270;
+ break;
+ default:
+ DEBUG("Camera <> Unexpected orientation value");
+ break;
+ }
+ }
+ // Secondary camera rotations
+ else if (aActiveCameraIndex == ECamActiveCameraSecondary)
+ {
+ if (aSensorOrientation == TSensrvOrientationData::EOrientationDisplayUp) // Portrait
+ {
+ DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation Secondary-camera EOrientationDisplayUp");
+ cameraOrientation = ECamOrientation180;
+ }
+ else if (aSensorOrientation == TSensrvOrientationData::EOrientationDisplayDown) // Upside down portrait
+ {
+ DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation Secondary-camera EOrientationDisplayDown");
+ cameraOrientation = ECamOrientation180;
+ }
+ else
+ {
+ DEBUG("CMMACameraPlayer::MapSensorOrientatio2CamOrientation Secondary-camera else");
+ cameraOrientation = ECamOrientation0;
+ }
+ }
+
+ return cameraOrientation;
+}
+
+MCameraOrientation::TOrientation CMMACameraPlayer::Map2CameraOrientation(
+ const TCamImageOrientation& aSettingOrientation )
+{
+ DEBUG("CMMACameraPlayer::Map2CameraOrientation +");
+ switch(aSettingOrientation)
+ {
+ case ECamOrientation90:
+ DEBUG("CMMACameraPlayer::Map2CameraOrientation ECamOrientation90");
+ return MCameraOrientation::EOrientation90;
+ case ECamOrientation180:
+ DEBUG("CMMACameraPlayer::Map2CameraOrientation ECamOrientation180");
+ return MCameraOrientation::EOrientation180;
+ case ECamOrientation270:
+ DEBUG("CMMACameraPlayer::Map2CameraOrientation ECamOrientation270");
+ return MCameraOrientation::EOrientation270;
+ case ECamOrientation0: // <<fall through>>
+ default:
+ DEBUG("CMMACameraPlayer::Map2CameraOrientation ECamOrientation0 or default");
+ return MCameraOrientation::EOrientation0;
+ }
+}
+
+// END OF FILE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/src.nga/cmmacameraplayerfactory.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,224 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class is used for creating camera players.
+*
+*/
+
+
+// INCLUDE FILES
+#include <e32std.h>
+#include <jdebug.h>
+
+#include "cmmacameraplayerfactory.h"
+#include "cmmacameraplayer.h"
+#include "cmmavideocontrol.h"
+#include "cmmavideorecordcontrol.h"
+#include "cmmastoptimecontrol.h"
+#include "cmmaplayerproperties.h"
+#include "cmmammfresolver.h"
+
+_LIT(KDefaultVideo, "video");
+//is the main camera
+_LIT(KDevcamZero, "devcam0");
+// the secondary camera
+_LIT(KDevcamOne, "devcam1");
+
+_LIT(KEncodingProperty, "encoding");
+
+_LIT(KVideoMp4MimeType, "video/mp4");
+_LIT(KVideoH264MimeType, "video/H264");
+
+CMMACameraPlayerFactory* CMMACameraPlayerFactory::NewLC()
+{
+ CMMACameraPlayerFactory* pFactory =
+ new(ELeave) CMMACameraPlayerFactory();
+ CleanupStack::PushL(pFactory);
+ return pFactory;
+}
+
+
+CMMACameraPlayerFactory::CMMACameraPlayerFactory()
+{
+}
+
+
+CMMACameraPlayerFactory::~CMMACameraPlayerFactory()
+{
+ delete iAudioSettings;
+}
+
+CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(
+ CMMAMMFResolver* aResolver)
+{
+ DEBUG("MMA::CMMACameraPlayerFactory::CreatePlayerL( aResolver )+");
+ CMMACameraPlayer* player = CMMACameraPlayer::NewLC(iCameraIndex);
+
+ /* Add VideoControl */
+ CMMAVideoControl* videoControl = new(ELeave)CMMAVideoControl(player);
+
+ CleanupStack::PushL(videoControl);
+ player->AddControlL(videoControl);
+ CleanupStack::Pop(videoControl);
+
+ /* Add RecordControl */
+ CMMAVideoRecordControl* videoRecordControl =
+ CMMAVideoRecordControl::NewL(player,
+ aResolver,
+ iVideoSettings,
+ iAudioSettings,
+ player->CameraHandle());
+ CleanupStack::PushL(videoRecordControl);
+ player->AddControlL(videoRecordControl);
+ // ownership transfered to player
+ CleanupStack::Pop(videoRecordControl);
+
+ // With record control view finder can't be stopped,
+ // because it can not be restarted.
+ player->SetViewFinderMode(EFalse);
+
+ CleanupStack::Pop(player);
+ return player;
+}
+
+
+void CMMACameraPlayerFactory::MediaIdsL(RArray<TUid>& aMediaIds)
+{
+ CleanupClosePushL(aMediaIds);
+ User::LeaveIfError(aMediaIds.Append(KUidMediaTypeVideo));
+ CleanupStack::Pop();
+}
+
+void CMMACameraPlayerFactory::PreparePluginSelectionParametersL(
+ CMMAMMFResolver* aResolver,
+ CMMFFormatSelectionParameters* aFormatSelection)
+{
+ // We are creating record type player
+ aResolver->SetRequiredRecordFormatSupportL(*aFormatSelection);
+}
+
+CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC&)
+{
+ // record player cannot be created from conten-type, since this is used only
+ // when we have also data
+ return NULL;
+}
+
+
+CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC8&)
+{
+ // record player cannot be created with header data
+ return NULL;
+}
+
+CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(
+ const TDesC& aProtocol,
+ const TDesC& aMiddlePart,
+ const TDesC& aParameters)
+{
+ DEBUG_STR("MMA::CMMACameraPlayerFactory::CreatePlayerL aParameters = %S", aParameters);
+ // check that locator is capture:://audio
+ if (aProtocol != KMMACaptureProtocol)
+ {
+ return NULL;
+ }
+
+ iCameraIndex = ECamActiveCameraNone;
+
+ // If the device supports multiple cameras then "capture://devcam0" is the
+ // main camera pointing outwards from the user. "capture://devcam1" is the
+ // secondary camera pointing e.g. towards the user. "capture://video" is
+ // the default camera locator pointing to the same camera as "devcam0"
+ if ((aMiddlePart == KDefaultVideo) ||
+ (aMiddlePart == KDevcamZero))
+ {
+ // First camera
+ iCameraIndex = ECamActiveCameraPrimary;
+ }
+ else if (aMiddlePart == KDevcamOne)
+ {
+ // Second camera.
+ iCameraIndex = ECamActiveCameraSecondary;
+ }
+ else
+ {
+ // not supported type
+ return NULL;
+ }
+
+ CMMAAudioSettings* audioSettings = new(ELeave) CMMAAudioSettings;
+ audioSettings->iDataType = KMMFFourCCCodeNULL;
+ delete iAudioSettings;
+ iAudioSettings = audioSettings;
+
+ if (aParameters.Length() == 0)
+ {
+ // getting defaults from validator
+ iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters);
+ }
+ else
+ {
+ // we accept either video or mixed parameters, so properties must contain encoding 2 times for mixed and
+ // 1 time for video.
+ // making tmp des without first "encoding"
+ TInt lengthWithoutEncoding = aParameters.Length() - KEncodingProperty().Length();
+ if (lengthWithoutEncoding < 0)
+ {
+ User::Leave(KErrArgument);
+ }
+ TPtrC tmp = aParameters.Right(lengthWithoutEncoding);
+ // finding second "encoding"
+ TInt videoPropertiesStartPos = tmp.Find(KEncodingProperty);
+ if (videoPropertiesStartPos == KErrNotFound)
+ {
+ // there is not another encoding, so assuming that there is only video parameters
+ iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters);
+ }
+ else
+ {
+ // there is mixed parameters
+ videoPropertiesStartPos += KEncodingProperty().Length();
+
+ // skipping '&' char
+ TPtrC audioProperties = aParameters.Left(videoPropertiesStartPos - 1);
+ TPtrC videoProperties = aParameters.Mid(videoPropertiesStartPos);
+ iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(videoProperties);
+
+ CMMAAudioSettings* audioSettings = TMMAParameterValidator::ValidateAudioPropertiesL(audioProperties);
+ delete iAudioSettings;
+ iAudioSettings = audioSettings;
+ }
+ }
+
+ // if wanted video capture encoding is H264, we must create player with video/mp4
+ // because mmf doesn't have controller for H264
+ if (iVideoSettings.iEncoding.Compare(KVideoH264MimeType) == 0)
+ {
+ return CMMAMMFPlayerFactory::CreatePlayerL(KVideoMp4MimeType);
+ }
+
+ // Find controller with content-type
+ return CMMAMMFPlayerFactory::CreatePlayerL(iVideoSettings.iEncoding);
+}
+
+void CMMACameraPlayerFactory::GetSupportedProtocolsL(
+ const TDesC& aContentType,
+ CDesC16Array& aProtocolArray)
+{
+ if (IsSupportedContentTypeL(aContentType))
+ {
+ aProtocolArray.AppendL(KMMACaptureProtocol);
+ }
+}
+
+// END OF FILE
--- a/javauis/mmapi_akn/baseline/src.nga/cmmacamerawindow.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/src.nga/cmmacamerawindow.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -385,80 +385,68 @@
// ---------------------------------------------------------------------------
-// From class MCameraObserver
-// CMMACameraWindow::ReserveComplete
+// From class MCameraObserver2
+// CMMACameraWindow::HandleEvent
//
// ---------------------------------------------------------------------------
//
-void CMMACameraWindow::ReserveComplete(TInt aError)
+void CMMACameraWindow::HandleEvent(const TECAMEvent& aEvent)
{
- DEBUG_INT("MMA::CMMACameraWindow::ReserveComplete %d", aError);
-
- if (aError == KErrNone)
+ TInt error = aEvent.iErrorCode;
+ if (KUidECamEventReserveComplete == aEvent.iEventType)
{
- // camera will notify completion with PowerOnComplete method.
- iUICamera->PowerOn();
+ DEBUG_INT("MMA::CMMACameraPlayer::HandleEvent:KUidECamEventReserveComplete error %d", error);
+ if (error == KErrNone)
+ {
+ // camera will notify completion with PowerOnComplete method.
+ iUICamera->PowerOn();
+ }
}
-}
-
-
-// ---------------------------------------------------------------------------
-// From class MCameraObserver
-// CMMACameraWindow::PowerOnComplete
-//
-// ---------------------------------------------------------------------------
-//
-void CMMACameraWindow::PowerOnComplete(TInt aError)
-{
- DEBUG_INT("MMA::CMMACameraWindow::PowerOnComplete %d", aError);
-
- if (aError == KErrNone)
+ else if (KUidECamEventPowerOnComplete == aEvent.iEventType)
{
- iCameraPowerOn = ETrue;
- SetViewFinderVisibility(ETrue);
+ DEBUG_INT("MMA::CMMACameraPlayer::HandleEvent:KUidECamEventPowerOnComplete error %d", error);
+ if (error == KErrNone)
+ {
+ iCameraPowerOn = ETrue;
+ SetViewFinderVisibility(ETrue);
+ }
}
}
// ---------------------------------------------------------------------------
-// From class MCameraObserver
-// CMMACameraWindow::ViewFinderFrameReady
+// From class MCameraObserver2
+// CMMACameraWindow::ViewFinderReady
//
// ---------------------------------------------------------------------------
//
-void CMMACameraWindow::ViewFinderFrameReady(CFbsBitmap& /*aFrame*/)
+void CMMACameraWindow::ViewFinderReady(MCameraBuffer& /*aCameraBuffer*/,
+ TInt /*aError*/)
{
- // Empty implementation of the interface method
- DEBUG("MMA::CMMACameraWindow::ViewFinderFrameReady");
}
// ---------------------------------------------------------------------------
-// From class MCameraObserver
-// CMMACameraWindow::ImageReady
+// From class MCameraObserver2
+// CMMACameraWindow::ImageBufferReady
//
// ---------------------------------------------------------------------------
//
-void CMMACameraWindow::ImageReady(CFbsBitmap* /*aBitmap*/,
- HBufC8* /*aData*/,
- TInt /*aError*/)
+void CMMACameraWindow::ImageBufferReady(MCameraBuffer& /*aCameraBuffer*/,
+ TInt /*aError*/)
{
- // Empty implementation of the interface method
- DEBUG("MMA::CMMACameraWindow::ImageReady");
}
// ---------------------------------------------------------------------------
-// From class MCameraObserver
-// CMMACameraWindow::FrameBufferReady
+// From class MCameraObserver2
+// CMMACameraWindow::VideoBufferReady
//
// ---------------------------------------------------------------------------
//
-void CMMACameraWindow::FrameBufferReady(MFrameBuffer* /*aFrameBuffer*/,
+void CMMACameraWindow::VideoBufferReady(MCameraBuffer& /*aCameraBuffer*/,
TInt /*aError*/)
{
- // Empty implementation of the interface method
- DEBUG("MMA::CMMACameraWindow::FrameBufferReady");
}
@@ -533,7 +521,7 @@
if (!iUICamera)
{
TRAPD(error, iUICamera =
- CCamera::NewDuplicateL(*this, iCameraHandle));
+ CCamera::NewDuplicate2L(*this, iCameraHandle));
DEBUG_INT(
"MMA::CMMACameraWindow::UIStartViewFinder - NewDuplicateL %d",
@@ -905,7 +893,7 @@
//
void CMMACameraWindow::MdcUICallback(TInt aCallbackId)
{
- DEBUG("MMA::CMMACameraWindow::MdcUICallback");
+ DEBUG_INT("MMA::CMMACameraWindow::MdcUICallback callbackid %d", aCallbackId);
switch (aCallbackId)
{
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/src.nga/cmmasnapshot.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,277 @@
+/*
+* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class takes snapshot and resizes bitmap if needed.
+*
+*/
+
+
+// INCLUDE FILES
+#include <jdebug.h>
+
+#include "cmmasnapshot.h"
+#include "mmmaguiplayer.h"
+#include "mmmasnapshotreadycallback.h"
+#include "mmmasnapshot.h"
+
+// CONSTANTS
+const TInt KIgnoreSize = -1;
+
+
+// CONSTRUCTION
+CMMASnapshot* CMMASnapshot::NewL(MMMAGuiPlayer* aGuiPlayer,
+ MMMASnapshotReadyCallback& aCallBack)
+{
+ CMMASnapshot* self = new(ELeave) CMMASnapshot(aGuiPlayer,
+ aCallBack);
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(); // self
+ return self;
+}
+
+CMMASnapshot::~CMMASnapshot()
+{
+ if (iScaler)
+ {
+ iScaler->Cancel();
+ delete iScaler;
+ }
+ if (iEncoder)
+ {
+ iEncoder->Cancel();
+ delete iEncoder;
+ }
+ delete iBitmap;
+ delete iBuffer;
+ delete iSettings;
+}
+
+void CMMASnapshot::ConstructL()
+{
+ CActiveScheduler::Add(this);
+ iScaler = CBitmapScaler::NewL();
+}
+
+CMMASnapshot::CMMASnapshot(MMMAGuiPlayer* aGuiPlayer,
+ MMMASnapshotReadyCallback& aCallBack):
+ CActive(EPriorityStandard),
+ iEncoding(MMMASnapshot::EBitmap),
+ iCallBack(aCallBack),
+ iState(EIdle)
+{
+ iGUIPlayer = aGuiPlayer;
+}
+
+void CMMASnapshot::TakeSnapShotL(const TDesC& aProperties)
+{
+ // snapshot sequence is not finished
+ __ASSERT_DEBUG(iState == EIdle, User::Invariant());
+ // image buffer must be taken with ImageBuffer before taking new snapshot
+ __ASSERT_DEBUG(iBuffer == NULL, User::Invariant());
+
+ CMMAImageSettings* settings
+ = TMMAParameterValidator::ValidateImagePropertiesL(aProperties);
+ CleanupStack::PushL(settings);
+
+ delete iSettings;
+ CleanupStack::Pop(settings);
+ iSettings = settings;
+
+ // take snapshot from player. RunL is called when image is ready
+ // or error occures
+ iState = ETakingSnapshot;
+ TSize snapshotSize(iSettings->iWidth, iSettings->iHeight);
+ iEncoding = iGUIPlayer->SnapshoterL()->TakeSnapshotL(&iStatus,
+ snapshotSize,
+ *iSettings);
+ SetActive();
+}
+
+HBufC8* CMMASnapshot::ImageBuffer()
+{
+ // this must not be called when snapshot sequence is running
+ __ASSERT_DEBUG(iState == EIdle, User::Invariant());
+ HBufC8* buffer = iBuffer;
+ // caller takes ownership of the buffer
+ iBuffer = NULL;
+ return buffer;
+}
+
+void CMMASnapshot::ResizeL()
+{
+ iState = EResizing;
+ TSize imageSize(iBitmap->SizeInPixels());
+ if (iSettings->iWidth != KIgnoreSize)
+ {
+ imageSize.iWidth = iSettings->iWidth;
+ }
+ if (iSettings->iHeight != KIgnoreSize)
+ {
+ imageSize.iHeight = iSettings->iHeight;
+ }
+ if (imageSize == iBitmap->SizeInPixels())
+ {
+ // no user resizing needed, continue sequence
+ EncodeL();
+ }
+ else
+ {
+ if(iScalingFactor)
+ {
+ iScalingFactor = EFalse;
+ iScaler->Scale(&iStatus, *iBitmap, imageSize, EFalse);
+ }
+ else
+ {
+ iScaler->Scale(&iStatus, *iBitmap, imageSize, ETrue);
+ }
+ SetActive();
+ }
+}
+
+void CMMASnapshot::EncodeL()
+{
+ // CImageEncoder cannot be reused, so have to make it every time
+ CImageEncoder* encoder = CImageEncoder::DataNewL(iBuffer, *iSettings->iMimeType);
+ delete iEncoder;
+ iEncoder = encoder;
+
+ iState = EEncoding;
+ iEncoder->Convert(&iStatus, *iBitmap, iSettings->iImageData);
+ SetActive();
+}
+
+void CMMASnapshot::Completed(TInt aError)
+{
+ iStatus = aError;
+ iCallBack.SnapshotReady();
+}
+
+void CMMASnapshot::RunL()
+{
+ if (iStatus != KErrNone)
+ {
+ // Error has occured, inform java side and change state
+ iState = EIdle;
+ Completed(iStatus.Int());
+ return;
+ }
+
+ switch (iState)
+ {
+ case ETakingSnapshot:
+ {
+ DEBUG_INT("MMA::CMMASnapshot::RunL: iEncoding = %d", iEncoding);
+ if (iEncoding == MMMASnapshot::EEncoded)
+ {
+ // take encoded image from player.
+ // Ownership transfers to this class.
+ iBuffer = iGUIPlayer->SnapshoterL()->SnapshotEncoded();
+ if (!iBuffer)
+ {
+ // error has occured with taking image
+ Completed(KErrNotFound);
+ }
+ // Image is ready, update internal state and inform listener
+ // Encoded images are not resized
+ iState = EIdle;
+ Completed(KErrNone);
+ }
+ else
+ {
+ // take bitmap from player.
+ // Ownership transfers to this class.
+ iBitmap = iGUIPlayer->SnapshoterL()->SnapshotBitmap();
+ if (!iBitmap)
+ {
+ // error has occured with taking image
+ Completed(KErrNotFound);
+ }
+ else
+ {
+ TInt nativeArea = iBitmap->SizeInPixels().iWidth * iBitmap->SizeInPixels().iHeight;
+ TInt requestArea = iSettings->iWidth * iSettings->iHeight;
+ if(requestArea < nativeArea && (((TReal)iSettings->iWidth/iSettings->iHeight != (4.0/3.0)) && ((TReal)iSettings->iWidth/iSettings->iHeight != (16.0/9.0))))
+ {
+ DEBUG_INT2("CMMASnapshot::EncodeL() nativeBitmap->iWidth = %d, nativeBitmap->iHeight %d",iBitmap->SizeInPixels().iWidth,iBitmap->SizeInPixels().iHeight);
+ if(iBitmap)
+ {
+ iBitmap->Resize(TSize(iSettings->iWidth,iSettings->iHeight));
+ }
+ }
+ else if(requestArea > nativeArea && (((TReal)iSettings->iWidth/iSettings->iHeight != (4.0/3.0))))
+ {
+ if(iBitmap)
+ {
+ iScalingFactor = ETrue;
+ }
+ }
+ }
+ // Continue to next statecd
+ ResizeL();
+ }
+ break;
+ }
+ case EResizing:
+ {
+ // Continue to next state
+ EncodeL();
+ break;
+ }
+ case EEncoding:
+ {
+ delete iEncoder;
+ iEncoder = NULL;
+
+ delete iBitmap;
+ iBitmap = NULL;
+
+ iState = EIdle;
+ // encoding is ready, inform listener
+ Completed(KErrNone);
+ break;
+ }
+ default:
+ {
+ // unknown state
+ __ASSERT_DEBUG(EFalse, User::Invariant());
+ }
+ }
+}
+
+TInt CMMASnapshot::RunError(TInt aError)
+{
+ // Reset state
+ iState = EIdle;
+ // Pass error code to observer
+ Completed(aError);
+
+ return KErrNone;
+}
+
+void CMMASnapshot::DoCancel()
+{
+ // snapshot taking cannot be cancelled
+ if (iScaler)
+ {
+ iScaler->Cancel();
+ }
+ if (iEncoder)
+ {
+ iEncoder->Cancel();
+ }
+ iState = EIdle;
+}
+
+// END OF FILE
--- a/javauis/mmapi_akn/baseline/src.nga/cmmasurfacewindow.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/src.nga/cmmasurfacewindow.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -667,7 +667,7 @@
DEBUG("MID::CMMASurfaceWindow::CleanVideoDisplay -");
}
-void CMMASurfaceWindow::SetAVCableConnStatus(TBool aStatus)
+EXPORT_C void CMMASurfaceWindow::SetAVCableConnStatus(TBool aStatus)
{
iAVCableConnected = aStatus;
if (iDisplay && !iAVCableConnected)
--- a/javauis/mmapi_akn/baseline/src.nga/cmmavideoplayer.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/src.nga/cmmavideoplayer.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -83,7 +83,8 @@
CMMAAudioPlayer(aResolver),
iVideoControllerCustomCommands(iController),
iVideoPlayControllerCustomCommands(iController),
- iVideoPlaySurfaceSupportCustomCommands(iController)
+ iVideoPlaySurfaceSupportCustomCommands(iController),
+ isHDMICableConnected(EFalse)
{
iMMASurface.iPrevSurfaceAvailable = EFalse;
}
@@ -248,12 +249,21 @@
if ((aEvent.iEventType == KMMFEventCategoryVideoPlayerGeneralError) &&
(aEvent.iErrorCode == KMMVideoBlitError))
{
- TRAPD(error, StartL(EFalse));
- if (KErrNone != error)
- {
- DEBUG_INT("MMA:CMMAVideoPlayer::HandleEvent, StartL() error %d", error);
- }
- return;
+ // incase of HDMI cable is inserted, start the player again before ignoring the error otherwise simply ignore
+ if(isHDMICableConnected)
+ {
+ TRAPD(error, StartL(EFalse));
+ if (KErrNone != error)
+ {
+ DEBUG_INT("MMA:CMMAVideoPlayer::HandleEvent, StartL() error %d",
+ error);
+ }
+ return;
+ }
+ else // no HDMI cable is inserted, Hence ignore the error.
+ {
+ return;
+ }
}
// KNotCompleteVideoError can be notified when video is not complete
@@ -569,6 +579,7 @@
DEBUG_INT("MID::CMMAVideoPlayer::ConnectedL %d", deviceType);
if (iSurfaceWindow && (deviceType == KAccMonAVDevice))
{
+ isHDMICableConnected = ETrue;
iSurfaceWindow->SetAVCableConnStatus(ETrue);
}
}
@@ -579,6 +590,7 @@
DEBUG_INT("MID::CMMAVideoPlayer::DisconnectedL %d", deviceType);
if (iSurfaceWindow && (deviceType == KAccMonAVDevice))
{
+ isHDMICableConnected = EFalse;
iSurfaceWindow->SetAVCableConnStatus(EFalse);
}
}
--- a/javauis/mmapi_akn/baseline/src/cmmaaudiorecorder.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/src/cmmaaudiorecorder.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -19,7 +19,7 @@
#include <jdebug.h>
#include <mmf/server/mmffile.h>
#include <mmf/server/mmfdes.h>
-#include <mmfformatimplementationuids.hrh>
+#include <mmf/plugin/mmfformatimplementationuids.hrh>
#include "cmmaaudiorecorder.h"
#include "cmmaoutputstream.h"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/mmapi_akn/baseline/src/cmmacallstatemonitor.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Publish and Subscribe key watcher
+*
+*/
+
+
+#include <e32base.h>
+#include "cmmacallstatemonitor.h"
+#include "mmmacallstateobserver.h"
+
+// ---------------------------------------------------------------------------
+// Default Constructor
+// ---------------------------------------------------------------------------
+//
+CMMACallStateMonitor::CMMACallStateMonitor( TUid aUid, TInt aKey,
+ MMMACallStateObserver* aObserver ) :
+ CActive( EPriorityHigh ),
+ iObserver( aObserver ),
+ iUid( aUid ),
+ iKey( aKey )
+
+ {
+ }
+
+
+// ---------------------------------------------------------------------------
+// 2nd phased Constructor
+// ---------------------------------------------------------------------------
+//
+void CMMACallStateMonitor::ConstructL()
+ {
+ CActiveScheduler::Add(this);
+
+ iProperty.Attach( iUid, iKey );
+ iProperty.Subscribe( iStatus );
+ SetActive();
+ }
+
+
+// ---------------------------------------------------------------------------
+// Two-Phased COnstructor
+// ---------------------------------------------------------------------------
+//
+CMMACallStateMonitor* CMMACallStateMonitor::NewL( TUid aUid, TInt aKey,
+ MMMACallStateObserver* aObserver )
+ {
+ CMMACallStateMonitor* self = new(ELeave) CMMACallStateMonitor( aUid,
+ aKey,
+ aObserver );
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop( self );
+ return self;
+ }
+
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CMMACallStateMonitor::~CMMACallStateMonitor()
+ {
+ Cancel(); // Cancels waiting request
+ iProperty.Close();
+ }
+
+// ---------------------------------------------------------------------------
+// CMMAPSKeyWatcher::RunL
+// ---------------------------------------------------------------------------
+//
+void CMMACallStateMonitor::RunL()
+ {
+ iProperty.Subscribe( iStatus );
+ SetActive();
+
+ // Notify Observer and start watching again
+ if( iObserver )
+ {
+ iObserver->HandleCallStateEventL( iUid, iKey );
+ }
+ }
+
+// ---------------------------------------------------------------------------
+// CMMAPSKeyWatcher::DoCancel
+// ---------------------------------------------------------------------------
+//
+void CMMACallStateMonitor::DoCancel()
+ {
+ iProperty.Cancel();
+ }
+
+// ---------------------------------------------------------------------------
+// CMMAPSKeyWatcher::GetValue
+// ---------------------------------------------------------------------------
+//
+TInt CMMACallStateMonitor::GetValue( TInt& aValue )
+ {
+ return iProperty.Get( aValue );
+ }
+
--- a/javauis/mmapi_akn/baseline/src/cmmacameraplayer.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,671 +0,0 @@
-/*
-* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class is used for playing camera.
-*
-*/
-
-
-// INCLUDE FILES
-#include <jdebug.h>
-#include <fbs.h>
-#include "cmmacameraplayer.h"
-#include "tmmaparametervalidator.h"
-#include "mmmadisplay.h"
-#include "cmmacamerasound.h"
-
-#if defined( __WINS__ )
-#include <w32std.h>
-#endif
-
-// CONSTANTS
-_LIT8(KImageJpegMime, "image/jpeg");
-_LIT8(KJpegMime, "jpeg");
-_LIT(KVideoControlName, "VideoControl");
-
-CMMACameraPlayer* CMMACameraPlayer::NewLC(TInt aCameraIndex)
-{
- CMMACameraPlayer* self = new(ELeave) CMMACameraPlayer;
- CleanupStack::PushL(self);
- self->ConstructL(aCameraIndex);
- return self;
-}
-
-CMMACameraPlayer::~CMMACameraPlayer()
-{
- DEBUG("CMMACameraPlayer::~CMMACameraPlayer");
-
- // Free (duplicated) UI camera resources first.
- // Window is not able to send any
- // callback requests to UI from now.
- if (iWindow)
- {
- iWindow->SetDisplay(NULL);
- }
-
- if (iCamera)
- {
- iCamera->CancelCaptureImage();
- iCamera->Release();
- delete iCamera;
- }
-
- delete iSnapshotEncoded;
- delete iSnapshotBitmap;
- delete iRealizeWait;
-
- if (iDisplay && iDisplay->HasContainer())
- {
- // Window will delete itself
- // after all pending events are processed
- // (lazy delete)
- iDisplay->UIGetCallback(
- *iWindow, CMMACameraWindow::EDestroyWindow);
- }
- else
- {
- delete iWindow;
- }
- iWindow = NULL;
-}
-
-
-CMMACameraPlayer::CMMACameraPlayer():
- iDisplay(NULL),
- iSourceSizeIndex(KErrNotFound),
- iStartTime(KErrNotFound)
-{
- iStopViewFinder = ETrue;
-}
-
-
-void CMMACameraPlayer::ConstructL(TInt aCameraIndex)
-{
- CMMAPlayer::ConstructL();
-
- if (aCameraIndex >= CCamera::CamerasAvailable())
- {
- // image capture is not supported
- User::Leave(KErrNotFound);
- }
-
- iCamera = CCamera::NewL(*this, aCameraIndex);
-
- iWindow = CMMACameraWindow::NewL(iCamera->Handle());
-
- TCameraInfo cameraInfo;
- iCamera->CameraInfo(cameraInfo);
-
- if (cameraInfo.iNumImageSizesSupported < 1)
- {
- // image capture is not supported
- User::Leave(KErrNotFound);
- }
-
- // default snapshot size
- iSourceSizeIndex = cameraInfo.iNumImageSizesSupported - 1;
-
- iRealizeWait = new(ELeave)CRealizeWait;
-}
-
-TInt64 CMMACameraPlayer::CurrentTime()
-{
- TTime time;
- time.HomeTime();
- return time.Int64();
-}
-
-void CMMACameraPlayer::ResolveViewFinderSizeL(TSize& aSize)
-{
- DEBUG("CMMACameraPlayer::ResolveViewFinderSizeL");
-
- TSize resultSize;
-
- // The only way to find out the size is to start the view finder
- // with a proper size (screen size).
-
- ResolveScreenSizeL(resultSize);
-
- // StartViewFinderBitmapsL changes resultSize to
- // the used view finder size.
- // Used to get the source size only.
- iCamera->StartViewFinderBitmapsL(resultSize);
-
- // Bitmap viewfinder is not used anymore.
- iCamera->StopViewFinder();
-
- aSize = resultSize;
-}
-
-void CMMACameraPlayer::ResolveScreenSizeL(TSize& aSize)
-{
- DEBUG("CMMACameraPlayer::ResolveScreenSizeL");
-
-#if defined( __WINS__ )
- TSize size(0,0);
- RWsSession ws;
-
- if (ws.Connect() == KErrNone)
- {
- CleanupClosePushL(ws);
-
- CWsScreenDevice* wsScreenDevice = new(ELeave)CWsScreenDevice(ws);
- CleanupStack::PushL(wsScreenDevice);
-
- User::LeaveIfError(wsScreenDevice->Construct());
-
- size = wsScreenDevice->SizeInPixels();
-
- CleanupStack::PopAndDestroy(2); // wsScreenDevice, ws.Close()
- }
-
- aSize = size;
-
-#else
- TScreenInfoV01 info;
- TPckgBuf< TScreenInfoV01 > buf(info);
-
- UserSvr::ScreenInfo(buf);
- info = buf();
-
- aSize = info.iScreenSize;
-#endif
-}
-
-void CMMACameraPlayer::ResolveCaptureSizes(const CCamera::TFormat aFormat,
- const TInt aNumImageSizesSupported,
- const TSize& aRequestSize,
- TSize& aSourceSize,
- TInt& aSourceIndex,
- TInt& aLargestIndex)
-{
- // Largest image size
- TSize largestSize;
- // Index to largest image size
- TInt largestSizeIndex = 0;
- // Source size
- TSize sourceSize;
- // Default source size index not set
- TInt sourceSizeIndex = KErrNotFound;
- // Temporary size for iterating capture sizes
- TSize tmpSize;
-
- DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: aFormat = 0x%x", aFormat);
-
- // go through all supported sizes.
- // Notice: Capture sizes are assumed to be in order from smaller to larger sizes
- for (TInt i = 0; i < aNumImageSizesSupported; i++)
- {
- iCamera->EnumerateCaptureSizes(tmpSize,
- i,
- aFormat);
-
- DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iWidth = %d", tmpSize.iWidth);
- DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: tmpSize.iHeight = %d", tmpSize.iHeight);
-
- // Check if current is the largest
- if ((largestSize.iWidth < tmpSize.iWidth) &&
- (largestSize.iHeight < tmpSize.iHeight))
- {
- largestSize = tmpSize;
- largestSizeIndex = i;
- }
-
- // If wanted size is smaller than tmpSize we can use it
- if ((aRequestSize.iWidth <= tmpSize.iWidth) &&
- (aRequestSize.iHeight <= tmpSize.iHeight))
- {
- sourceSize = tmpSize;
- sourceSizeIndex = i;
- }
- }
-
- DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: sourceSizeIndex = %d", sourceSizeIndex);
- DEBUG_INT("MMA::CMMACameraPlayer::ResolveCaptureSizes: largestSizeIndex = %d", largestSizeIndex);
-
- aSourceSize = sourceSize;
- aSourceIndex = sourceSizeIndex;
- aLargestIndex = largestSizeIndex;
-}
-
-void CMMACameraPlayer::StartL(TBool aPostEvent)
-{
- DEBUG_INT("CMMACameraPlayer:StartL iState %d", iState);
-
- // start can't be called to not ready player
- if (iState == EPrefetched)
- {
- // camera passes ready images through
- // ViewFinderFrameReady method
-
- // set time when started
- iStartTime = CurrentTime();
-
- // inform java side
- ChangeState(EStarted);
-
- TInt64 time;
- GetMediaTime(&time);
-
- // Notify the camera window
- // about the status change
- iWindow->SetStarted(ETrue);
-
- if (aPostEvent)
- {
- // inform java side
- PostLongEvent(CMMAPlayerEvent::EStarted, time);
- }
- }
- PostActionCompleted(KErrNone); // java start return
-}
-
-void CMMACameraPlayer::StopL(TBool aPostEvent)
-{
- DEBUG_INT("CMMACameraPlayer::StopL", iState);
- if (iState == EStarted)
- {
- TInt64 time;
- GetMediaTime(&time); // add played time to media time
-
- if (iStopViewFinder && iWindow->ViewFinderActive())
- {
- iWindow->SetStarted(EFalse);
- }
- iStartTime = KErrNotFound;
-
- if (aPostEvent)
- {
- PostLongEvent(CMMAPlayerEvent::EStopped, time);
- }
-
- // go back to prefetched state
- ChangeState(EPrefetched);
- }
-}
-
-void CMMACameraPlayer::DeallocateL()
-{
- // If player is started when deallocate is called,
- // player is stopped from java side -> state is changed to
- // prefetched.
- // In prefetched state only reserved resource is
- // camera reserve( released with iCamera->Release() )
- // In realized state no resources have been reserved.
- // CHANGED: not releasing camera anymore, since it is already
- // done in realized state
- if (iState == EPrefetched)
- {
- ChangeState(ERealized);
- }
-}
-
-
-void CMMACameraPlayer::RealizeL()
-{
- iCamera->Reserve();
- // this lock will be released when power on is completed (or error)
- if (!iRealizeWait->IsStarted())
- {
- iRealizeWait->Start();
- }
- User::LeaveIfError(iRealizeWait->iError);
- CMMAPlayer::RealizeL();
-}
-
-
-void CMMACameraPlayer::PrefetchL()
-{
- DEBUG("MMA::CMMACameraPlayer::PrefetchL");
- // nothing to do here
- ChangeState(EPrefetched);
- PostActionCompleted(KErrNone);
-}
-
-
-void CMMACameraPlayer::GetDuration(TInt64* aDuration)
-{
- // camera viewer has no duration.
- *aDuration = KTimeUnknown;
-}
-
-
-void CMMACameraPlayer::SetMediaTimeL(TInt64* /*aTime*/)
-{
- DEBUG("MMA::CMMACameraPlayer::SetMediaTimeL ");
- // with camera media time is not supported.
-}
-
-
-void CMMACameraPlayer::GetMediaTime(TInt64* aMediaTime)
-{
- if (iState == EStarted)
- {
- // add play time to media time
- iMediaTime += CurrentTime() - iStartTime;
- // set new start time
- iStartTime = CurrentTime();
- }
-
- // set value to parameter
- (*aMediaTime) = iMediaTime;
-}
-
-void CMMACameraPlayer::CloseL()
-{
- DEBUG("MMA::CMMACameraPlayer::CloseL()");
-
- // cancel all activity
- iCamera->CancelCaptureImage();
-
- // Stop and release UI Camera instance
- iWindow->SetDisplay(NULL);
-
- // we don't need reserve camera anymore
- iCamera->Release();
-
- CMMAPlayer::CloseL();
-}
-
-const TDesC& CMMACameraPlayer::Type()
-{
- return KMMACameraPlayer;
-}
-
-// MCameraObserver
-void CMMACameraPlayer::ReserveComplete(TInt aError)
-{
- DEBUG_INT("MMA::CMMACameraPlayer::ReserveComplete %d", aError);
- if (aError == KErrNone)
- {
- // camera will notify completion with PowerOnComplete method.
- iCamera->PowerOn();
- }
- else
- {
- // release lock and store error. State doesn't change.
- iRealizeWait->iError = aError;
- iRealizeWait->AsyncStop();
- }
-
-}
-
-void CMMACameraPlayer::PowerOnComplete(TInt aError)
-{
- DEBUG_INT("MMA::CMMACameraPlayer::PowerOnComplete %d", aError);
-
- TSize viewFinderSize;
- TInt error = aError;
-
- if (error == KErrNone)
- {
- // The view finder size must be known after prefetching.
- TRAP(error, ResolveViewFinderSizeL(viewFinderSize));
- }
-
- if (error == KErrNone)
- {
- iSize = viewFinderSize;
-
- if (iDisplay)
- {
- iDisplay->SourceSizeChanged(iSize);
- NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName);
- }
- }
-
- iRealizeWait->iError = error;
- iRealizeWait->AsyncStop();
-}
-
-void CMMACameraPlayer::ViewFinderFrameReady(CFbsBitmap& /*aFrame*/)
-{
- // Empty implementation of an interface method.
- // DirectViewFinder is used
- // instead of BitmapViewFinder
-}
-
-void CMMACameraPlayer::ImageReady(CFbsBitmap* aBitmap,
- HBufC8* aData,
- TInt aError)
-{
- DEBUG_INT("MMA::CMMACameraPlayer::ImageReady %d", aError);
-
- // This method should never be called,
- // unless we are taking snapshot
- __ASSERT_DEBUG(iSnapshotStatus, User::Invariant());
-
- __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant());
- __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant());
-
- if (aError == KErrNone)
- {
- // this class has ownership of the bitmap until
- // snapshot bitmap is got from this class.
- iSnapshotBitmap = aBitmap;
- iSnapshotEncoded = aData;
- }
-
- // notify the caller, error code or KErrNone
- User::RequestComplete(iSnapshotStatus, aError);
- iWindow->SetStarted(ETrue);
- // Status is not needed anymore
- // and this class don't own the status.
- iSnapshotStatus = NULL;
-}
-
-void CMMACameraPlayer::FrameBufferReady(MFrameBuffer* /*aFrameBuffer*/,
- TInt /*aError*/)
-{
- DEBUG("MMA::CMMACameraPlayer::FrameBufferReady");
- // this callback will never be called
- // Asserted in debug build to be sure.
- __ASSERT_DEBUG(EFalse, User::Invariant());
-}
-
-void CMMACameraPlayer::SetDisplayL(MMMADisplay* aDisplay)
-{
- DEBUG("MMA::CMMACameraPlayer::SetDisplay");
-
- // now it is ready to draw
- iDisplay = aDisplay;
-
- // Passes display into iWindow.
- // Allocates all resources needed to use a camera DirectViewFinder.
- iWindow->SetDisplay(aDisplay);
-
- iDisplay->SetWindowL(iWindow);
-
- // Set view finder size to the display only if the view finder
- // size has been resolved.
- if (iSize != TSize(0, 0))
- {
- iDisplay->SourceSizeChanged(iSize);
- NotifyWithStringEvent(CMMAPlayerEvent::ESizeChanged, KVideoControlName);
- }
-}
-
-TSize CMMACameraPlayer::SourceSize()
-{
- return iSize;
-}
-
-MMMASnapshot::TEncoding CMMACameraPlayer::TakeSnapshotL(TRequestStatus* aStatus,
- const TSize& aSize,
- const CMMAImageSettings& aSettings)
-{
- __ASSERT_DEBUG(!iSnapshotStatus, User::Invariant());
- __ASSERT_DEBUG(!iSnapshotBitmap, User::Invariant());
- __ASSERT_DEBUG(!iSnapshotEncoded, User::Invariant());
-
- // snapshots can not be taken if player is not realized
- if (iState < ERealized)
- {
- User::Leave(KErrNotReady);
- }
- // save status which will be notified
- iSnapshotStatus = aStatus;
-
- // changing status to pending
- *iSnapshotStatus = KRequestPending;
-
- // Source size not set in the beginning
- TSize sourceSize;
-
- // Use default if size is not specified.
- TInt sourceSizeIndex = iSourceSizeIndex;
-
- // Largest image size index
- TInt largestSizeIndex = 0;
-
- // Get camera characteristics
- TCameraInfo cameraInfo;
- iCamera->CameraInfo(cameraInfo);
-
- // Set default snapshot encoding type
- TEncoding encoding = EBitmap;
-
- // Set default image capture format
- CCamera::TFormat format = CCamera::EFormatFbsBitmapColor16M;
-
- DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iImageFormatsSupported = 0x%x", cameraInfo.iImageFormatsSupported);
- DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: cameraInfo.iNumImageSizesSupported = %d", cameraInfo.iNumImageSizesSupported);
-
- // Check if size was set in Java
- if (aSize.iWidth != KErrNotFound &&
- aSize.iHeight != KErrNotFound)
- {
- // Determine if jpeg capture was requested
- if ((*aSettings.iMimeType == KJpegMime) ||
- (*aSettings.iMimeType == KImageJpegMime))
- {
- // Shortcut for supported image formats
- TUint32 imageFormats = cameraInfo.iImageFormatsSupported;
-
- // Jpeg subtype constants
- _LIT8(KJpegJfif, "jfif");
- _LIT8(KJpegExif, "exif");
-
- // Resolve requested jpeg subtype from settings and camerainfo
- if ((imageFormats & CCamera::EFormatJpeg) &&
- (*aSettings.iType == KJpegJfif))
- {
- // JFIF JPEG
- format = CCamera::EFormatJpeg;
- encoding = EEncoded;
- }
- else if ((imageFormats & CCamera::EFormatExif) &&
- (*aSettings.iType == KJpegExif))
- {
- // EXIF JPEG
- format = CCamera::EFormatExif;
- encoding = EEncoded;
- }
- }
-
- // Try to resolve nearest source size to the one requested,
- // except for the JFIF and EXIF jpeg subtypes the match has
- // to be exact otherwise non-encode capture format will be
- // used
- ResolveCaptureSizes(format,
- cameraInfo.iNumImageSizesSupported,
- aSize,
- sourceSize,
- sourceSizeIndex,
- largestSizeIndex);
-
- // Format was either of the jpeg formats and requested size
- // didn't match the source size
- if ((format >= CCamera::EFormatJpeg &&
- format <= CCamera::EFormatExif) &&
- (aSize != sourceSize))
- {
- // Try again with an non-encoded format
- format = CCamera::EFormatFbsBitmapColor16M;
- encoding = EBitmap;
- ResolveCaptureSizes(format,
- cameraInfo.iNumImageSizesSupported,
- aSize,
- sourceSize,
- sourceSizeIndex,
- largestSizeIndex);
- }
-
- if (sourceSizeIndex == KErrNotFound)
- {
- // If correct index was not found use the largest.
- sourceSizeIndex = largestSizeIndex;
- }
- }
- // else use default iSourceSizeIndex and default image capture format
-
- iCamera->PrepareImageCaptureL(format,
- sourceSizeIndex);
-
- // play sound when capturing image
- CMMACameraSound::PlayImageCaptureSoundL();
-
- // start capture, ImageReady will be called when ready
- iWindow->SetStarted(EFalse);
-
- iCamera->CaptureImage();
-
- DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: format = 0x%x", format);
- DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: sourceSizeIndex = %d", sourceSizeIndex);
- DEBUG_INT("MMA::CMMACameraPlayer::TakeSnapshotL: encoding = %d", encoding);
-
- // Inform caller which snapshot encoding was ultimately used
- return encoding;
-}
-
-CFbsBitmap* CMMACameraPlayer::SnapshotBitmap()
-{
- CFbsBitmap* bitmap = iSnapshotBitmap;
-
- // ownership transfers to the caller
- iSnapshotBitmap = NULL;
- return bitmap;
-}
-
-HBufC8* CMMACameraPlayer::SnapshotEncoded()
-{
- HBufC8* encoded = iSnapshotEncoded;
-
- // ownership transfers to the caller
- iSnapshotEncoded = NULL;
- return encoded;
-}
-
-void CMMACameraPlayer::NotifyWithStringEvent(
- CMMAPlayerEvent::TEventType aEventType,
- const TDesC& aStringEventData)
-{
- PostStringEvent(aEventType, aStringEventData);
-}
-
-MMMASnapshot* CMMACameraPlayer::SnapshoterL()
-{
- return this;
-}
-
-TInt CMMACameraPlayer::CameraHandle()
-{
- return iCamera->Handle();
-}
-
-void CMMACameraPlayer::SetViewFinderMode(TBool aStopViewFinder)
-{
- iStopViewFinder = aStopViewFinder;
-}
-
-// END OF FILE
--- a/javauis/mmapi_akn/baseline/src/cmmacameraplayerfactory.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,224 +0,0 @@
-/*
-* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class is used for creating camera players.
-*
-*/
-
-
-// INCLUDE FILES
-#include <e32std.h>
-#include <jdebug.h>
-
-#include "cmmacameraplayerfactory.h"
-#include "cmmacameraplayer.h"
-#include "cmmavideocontrol.h"
-#include "cmmavideorecordcontrol.h"
-#include "cmmastoptimecontrol.h"
-#include "cmmaplayerproperties.h"
-#include "cmmammfresolver.h"
-
-_LIT(KDefaultVideo, "video");
-//is the main camera
-_LIT(KDevcamZero, "devcam0");
-// the secondary camera
-_LIT(KDevcamOne, "devcam1");
-
-_LIT(KEncodingProperty, "encoding");
-
-_LIT(KVideoMp4MimeType, "video/mp4");
-_LIT(KVideoH264MimeType, "video/H264");
-
-CMMACameraPlayerFactory* CMMACameraPlayerFactory::NewLC()
-{
- CMMACameraPlayerFactory* pFactory =
- new(ELeave) CMMACameraPlayerFactory();
- CleanupStack::PushL(pFactory);
- return pFactory;
-}
-
-
-CMMACameraPlayerFactory::CMMACameraPlayerFactory()
-{
-}
-
-
-CMMACameraPlayerFactory::~CMMACameraPlayerFactory()
-{
- delete iAudioSettings;
-}
-
-CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(
- CMMAMMFResolver* aResolver)
-{
- DEBUG("MMA::CMMACameraPlayerFactory::CreatePlayerL( aResolver )+");
- CMMACameraPlayer* player = CMMACameraPlayer::NewLC(iCameraIndex);
-
- /* Add VideoControl */
- CMMAVideoControl* videoControl = new(ELeave)CMMAVideoControl(player);
-
- CleanupStack::PushL(videoControl);
- player->AddControlL(videoControl);
- CleanupStack::Pop(videoControl);
-
- /* Add RecordControl */
- CMMAVideoRecordControl* videoRecordControl =
- CMMAVideoRecordControl::NewL(player,
- aResolver,
- iVideoSettings,
- iAudioSettings,
- player->CameraHandle());
- CleanupStack::PushL(videoRecordControl);
- player->AddControlL(videoRecordControl);
- // ownership transfered to player
- CleanupStack::Pop(videoRecordControl);
-
- // With record control view finder can't be stopped,
- // because it can not be restarted.
- player->SetViewFinderMode(EFalse);
-
- CleanupStack::Pop(player);
- return player;
-}
-
-
-void CMMACameraPlayerFactory::MediaIdsL(RArray<TUid>& aMediaIds)
-{
- CleanupClosePushL(aMediaIds);
- User::LeaveIfError(aMediaIds.Append(KUidMediaTypeVideo));
- CleanupStack::Pop();
-}
-
-void CMMACameraPlayerFactory::PreparePluginSelectionParametersL(
- CMMAMMFResolver* aResolver,
- CMMFFormatSelectionParameters* aFormatSelection)
-{
- // We are creating record type player
- aResolver->SetRequiredRecordFormatSupportL(*aFormatSelection);
-}
-
-CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC&)
-{
- // record player cannot be created from conten-type, since this is used only
- // when we have also data
- return NULL;
-}
-
-
-CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(const TDesC8&)
-{
- // record player cannot be created with header data
- return NULL;
-}
-
-CMMAPlayer* CMMACameraPlayerFactory::CreatePlayerL(
- const TDesC& aProtocol,
- const TDesC& aMiddlePart,
- const TDesC& aParameters)
-{
- DEBUG_STR("MMA::CMMACameraPlayerFactory::CreatePlayerL aParameters = %S", aParameters);
- // check that locator is capture:://audio
- if (aProtocol != KMMACaptureProtocol)
- {
- return NULL;
- }
-
- iCameraIndex = KErrNotFound;
-
- // If the device supports multiple cameras then "capture://devcam0" is the
- // main camera pointing outwards from the user. "capture://devcam1" is the
- // secondary camera pointing e.g. towards the user. "capture://video" is
- // the default camera locator pointing to the same camera as "devcam0"
- if ((aMiddlePart == KDefaultVideo) ||
- (aMiddlePart == KDevcamZero))
- {
- // First camera
- iCameraIndex = 0;
- }
- else if (aMiddlePart == KDevcamOne)
- {
- // Second camera.
- iCameraIndex = 1;
- }
- else
- {
- // not supported type
- return NULL;
- }
-
- CMMAAudioSettings* audioSettings = new(ELeave) CMMAAudioSettings;
- audioSettings->iDataType = KMMFFourCCCodeNULL;
- delete iAudioSettings;
- iAudioSettings = audioSettings;
-
- if (aParameters.Length() == 0)
- {
- // getting defaults from validator
- iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters);
- }
- else
- {
- // we accept either video or mixed parameters, so properties must contain encoding 2 times for mixed and
- // 1 time for video.
- // making tmp des without first "encoding"
- TInt lengthWithoutEncoding = aParameters.Length() - KEncodingProperty().Length();
- if (lengthWithoutEncoding < 0)
- {
- User::Leave(KErrArgument);
- }
- TPtrC tmp = aParameters.Right(lengthWithoutEncoding);
- // finding second "encoding"
- TInt videoPropertiesStartPos = tmp.Find(KEncodingProperty);
- if (videoPropertiesStartPos == KErrNotFound)
- {
- // there is not another encoding, so assuming that there is only video parameters
- iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(aParameters);
- }
- else
- {
- // there is mixed parameters
- videoPropertiesStartPos += KEncodingProperty().Length();
-
- // skipping '&' char
- TPtrC audioProperties = aParameters.Left(videoPropertiesStartPos - 1);
- TPtrC videoProperties = aParameters.Mid(videoPropertiesStartPos);
- iVideoSettings = TMMAParameterValidator::ValidateVideoPropertiesL(videoProperties);
-
- CMMAAudioSettings* audioSettings = TMMAParameterValidator::ValidateAudioPropertiesL(audioProperties);
- delete iAudioSettings;
- iAudioSettings = audioSettings;
- }
- }
-
- // if wanted video capture encoding is H264, we must create player with video/mp4
- // because mmf doesn't have controller for H264
- if (iVideoSettings.iEncoding.Compare(KVideoH264MimeType) == 0)
- {
- return CMMAMMFPlayerFactory::CreatePlayerL(KVideoMp4MimeType);
- }
-
- // Find controller with content-type
- return CMMAMMFPlayerFactory::CreatePlayerL(iVideoSettings.iEncoding);
-}
-
-void CMMACameraPlayerFactory::GetSupportedProtocolsL(
- const TDesC& aContentType,
- CDesC16Array& aProtocolArray)
-{
- if (IsSupportedContentTypeL(aContentType))
- {
- aProtocolArray.AppendL(KMMACaptureProtocol);
- }
-}
-
-// END OF FILE
--- a/javauis/mmapi_akn/baseline/src/cmmadisplay.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/src/cmmadisplay.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -455,4 +455,12 @@
}
}
+void CMMADisplay::FixUIOrientation(TBool aFix)
+{
+ if (iDirectContainer)
+ {
+ iDirectContainer->MdcFixUIOrientation(aFix);
+ }
+}
+
// END OF FILE
--- a/javauis/mmapi_akn/baseline/src/cmmammfplayerbase.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/src/cmmammfplayerbase.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -146,6 +146,7 @@
// inform java side
PostLongEvent(CMMAPlayerEvent::EStarted, iStartedEventTime);
}
+
ChangeState(EStarted);
PostActionCompleted(KErrNone); // java start return
}
@@ -159,35 +160,9 @@
iStartedEventTime = time;
TInt err = KErrNone;
- // AAC controller does not support multiple
- // calls to pause but leave with KErrNotReady.
- // That error is dismissed as player should
- // be paused already in that case.
- if (time == 0)
- {
- DEBUG("CMMAMMFPlayerBase::StopL: Position is zero, stopping");
- // Normally pause would be called, but if
- // current time is zero, Stop is called instead.
- // This is done because video playback breaks
- // if pause is called between events
- // KMMFEventCategoryVideoLoadingStarted and
- // KMMFEventCategoryVideoLoadingCompleted
- // (no wurther events are delivered altough
- // playback continues fine).
- // However calling Stop is tolerated in that
- // situation.
- err = iController.Stop();
- if (err == KErrNone)
- {
- err = iController.Prime();
- }
- }
- else
- {
- DEBUG("CMMAMMFPlayerBase::StopL: Position not zero, pausing");
- err = iController.Pause();
- }
-
+ DEBUG("CMMAMMFPlayerBase::StopL: Position not zero, pausing");
+ err = iController.Pause();
+
if ((err != KErrNone) && (err != KErrNotReady))
{
DEBUG_INT("CMMAMMFPlayerBase::StopL: pause/stop failed %d, leaving", err);
--- a/javauis/mmapi_akn/baseline/src/cmmaplayer.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/src/cmmaplayer.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -18,11 +18,13 @@
// INCLUDE FILES
#include <jdebug.h>
#include <JniEnvWrapper.h>
+#include <ctsydomainpskeys.h>
#include "cmmaplayer.h"
#include "cmmaeventsource.h"
#include "cmmadurationupdater.h"
#include "cmmavolumecontrol.h"
+#include "cmmacallstatemonitor.h"
// CONSTANTS
_LIT(KPanicOutOfMem, "out of memory");
@@ -43,6 +45,7 @@
delete iOOMErrorEvent;
delete iDurationUpdater;
delete iContentType;
+ delete iStateObserver;
}
@@ -51,7 +54,8 @@
iRepeatForever(EFalse),
iRepeatCount(0),
iDuration(KTimeUnknown),
- iState(EUnrealized)
+ iState(EUnrealized),
+ isPausedByCall(EFalse)
{
}
@@ -60,6 +64,10 @@
{
DEBUG("MMA::CMMAPlayer::ConstructL + ");
iDurationUpdater = CMMADurationUpdater::NewL(*this);
+ // Listen to call state changes
+ iStateObserver = CMMACallStateMonitor::NewL(KPSUidCtsyCallInformation,
+ KCTsyCallState,this);
+
DEBUG("MMA::CMMAPlayer::ConstructL - ");
}
@@ -145,7 +153,7 @@
}
-void CMMAPlayer::CloseL()
+EXPORT_C void CMMAPlayer::CloseL()
{
DEBUG("MMA::CMMAPlayer::CloseL ");
PostObjectEvent(CMMAPlayerEvent::EClosed, NULL);
@@ -421,7 +429,7 @@
}
-void CMMAPlayer::PostActionCompleted(TInt aError)
+EXPORT_C void CMMAPlayer::PostActionCompleted(TInt aError)
{
iActionCompletedEvent->SetEventData(aError);
iEventPoster->PostEvent(iActionCompletedEvent,
@@ -452,4 +460,72 @@
iControls.ResetAndDestroy();
}
}
+
+
+void CMMAPlayer::HandleCallStateEventL(TUid aUid, TInt aKey)
+{
+ DEBUG("CMMAPlayer::HandleCallStateEvent +");
+ DEBUG_INT2( "CMMAVideoUrlPlayer::HandleCallStateEvent(TUid aUid, TInt aKey) = (%d, %d)",aUid.iUid, aKey);
+
+ TInt callState;
+ iStateObserver->GetValue(callState);
+ DEBUG_INT( "CMMAVideoUrlPlayer::HandleCallStateEvent: state = %d", callState);
+
+ switch (callState)
+ {
+ case EPSCTsyCallStateUninitialized:
+ {
+ DEBUG_INT( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateUninitialized istate = %d", iState);
+ break;
+ }
+
+ case EPSCTsyCallStateAlerting:
+
+ case EPSCTsyCallStateRinging:
+
+ case EPSCTsyCallStateDialling:
+
+ case EPSCTsyCallStateAnswering:
+
+ case EPSCTsyCallStateConnected:
+ {
+ DEBUG_INT( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateConnected iState = %d", iState);
+ if(iState == CMMAPlayer::EStarted)
+ {
+ DEBUG( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateConnected started state");
+ StopL(ETrue);
+ isPausedByCall = ETrue;
+ }
+ break;
+ }
+ case EPSCTsyCallStateDisconnecting:
+ {
+ DEBUG_INT( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateDisconnecting istate = %d", iState);
+ break;
+ }
+ case EPSCTsyCallStateNone:
+ {
+ DEBUG_INT( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateNone istate = %d", iState);
+ if( (iState == CMMAPlayer::EPrefetched) && isPausedByCall )
+ {
+ DEBUG( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateNone Prefetched state");
+ StartL(ETrue);
+ isPausedByCall = EFalse;
+ }
+ break;
+ }
+
+ case EPSCTsyCallStateHold:
+ {
+ DEBUG_INT( "CMMAVideoUrlPlayer::HandlePSEvent EPSCTsyCallStateHold iState = %d", iState);
+ break;
+ }
+ default:
+ {
+ DEBUG( "CMMAVideoUrlPlayer::HandlePSEvent default");
+ // Default is no pause
+ break;
+ }
+ }
+}
// END OF FILE
--- a/javauis/mmapi_akn/baseline/src/cmmasnapshot.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,248 +0,0 @@
-/*
-* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class takes snapshot and resizes bitmap if needed.
-*
-*/
-
-
-// INCLUDE FILES
-#include <jdebug.h>
-
-#include "cmmasnapshot.h"
-#include "mmmaguiplayer.h"
-#include "mmmasnapshotreadycallback.h"
-#include "mmmasnapshot.h"
-
-// CONSTANTS
-const TInt KIgnoreSize = -1;
-
-
-// CONSTRUCTION
-CMMASnapshot* CMMASnapshot::NewL(MMMAGuiPlayer* aGuiPlayer,
- MMMASnapshotReadyCallback& aCallBack)
-{
- CMMASnapshot* self = new(ELeave) CMMASnapshot(aGuiPlayer,
- aCallBack);
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop(); // self
- return self;
-}
-
-CMMASnapshot::~CMMASnapshot()
-{
- if (iScaler)
- {
- iScaler->Cancel();
- delete iScaler;
- }
- if (iEncoder)
- {
- iEncoder->Cancel();
- delete iEncoder;
- }
- delete iBitmap;
- delete iBuffer;
- delete iSettings;
-}
-
-void CMMASnapshot::ConstructL()
-{
- CActiveScheduler::Add(this);
- iScaler = CBitmapScaler::NewL();
-}
-
-CMMASnapshot::CMMASnapshot(MMMAGuiPlayer* aGuiPlayer,
- MMMASnapshotReadyCallback& aCallBack):
- CActive(EPriorityStandard),
- iEncoding(MMMASnapshot::EBitmap),
- iCallBack(aCallBack),
- iState(EIdle)
-{
- iGUIPlayer = aGuiPlayer;
-}
-
-void CMMASnapshot::TakeSnapShotL(const TDesC& aProperties)
-{
- // snapshot sequence is not finished
- __ASSERT_DEBUG(iState == EIdle, User::Invariant());
- // image buffer must be taken with ImageBuffer before taking new snapshot
- __ASSERT_DEBUG(iBuffer == NULL, User::Invariant());
-
- CMMAImageSettings* settings
- = TMMAParameterValidator::ValidateImagePropertiesL(aProperties);
- CleanupStack::PushL(settings);
-
- delete iSettings;
- CleanupStack::Pop(settings);
- iSettings = settings;
-
- // take snapshot from player. RunL is called when image is ready
- // or error occures
- iState = ETakingSnapshot;
- TSize snapshotSize(iSettings->iWidth, iSettings->iHeight);
- iEncoding = iGUIPlayer->SnapshoterL()->TakeSnapshotL(&iStatus,
- snapshotSize,
- *iSettings);
- SetActive();
-}
-
-HBufC8* CMMASnapshot::ImageBuffer()
-{
- // this must not be called when snapshot sequence is running
- __ASSERT_DEBUG(iState == EIdle, User::Invariant());
- HBufC8* buffer = iBuffer;
- // caller takes ownership of the buffer
- iBuffer = NULL;
- return buffer;
-}
-
-void CMMASnapshot::ResizeL()
-{
- iState = EResizing;
- TSize imageSize(iBitmap->SizeInPixels());
- if (iSettings->iWidth != KIgnoreSize)
- {
- imageSize.iWidth = iSettings->iWidth;
- }
- if (iSettings->iHeight != KIgnoreSize)
- {
- imageSize.iHeight = iSettings->iHeight;
- }
- if (imageSize == iBitmap->SizeInPixels())
- {
- // no user resizing needed, continue sequence
- EncodeL();
- }
- else
- {
- iScaler->Scale(&iStatus, *iBitmap, imageSize, EFalse);
- SetActive();
- }
-}
-
-void CMMASnapshot::EncodeL()
-{
- // CImageEncoder cannot be reused, so have to make it every time
- CImageEncoder* encoder = CImageEncoder::DataNewL(iBuffer, *iSettings->iMimeType);
- delete iEncoder;
- iEncoder = encoder;
-
- iState = EEncoding;
- iEncoder->Convert(&iStatus, *iBitmap, iSettings->iImageData);
- SetActive();
-}
-
-void CMMASnapshot::Completed(TInt aError)
-{
- iStatus = aError;
- iCallBack.SnapshotReady();
-}
-
-void CMMASnapshot::RunL()
-{
- if (iStatus != KErrNone)
- {
- // Error has occured, inform java side and change state
- iState = EIdle;
- Completed(iStatus.Int());
- return;
- }
-
- switch (iState)
- {
- case ETakingSnapshot:
- {
- DEBUG_INT("MMA::CMMASnapshot::RunL: iEncoding = %d", iEncoding);
- if (iEncoding == MMMASnapshot::EEncoded)
- {
- // take encoded image from player.
- // Ownership transfers to this class.
- iBuffer = iGUIPlayer->SnapshoterL()->SnapshotEncoded();
- if (!iBuffer)
- {
- // error has occured with taking image
- Completed(KErrNotFound);
- }
- // Image is ready, update internal state and inform listener
- // Encoded images are not resized
- iState = EIdle;
- Completed(KErrNone);
- }
- else
- {
- // take bitmap from player.
- // Ownership transfers to this class.
- iBitmap = iGUIPlayer->SnapshoterL()->SnapshotBitmap();
- if (!iBitmap)
- {
- // error has occured with taking image
- Completed(KErrNotFound);
- }
- // Continue to next state
- ResizeL();
- }
- break;
- }
- case EResizing:
- {
- // Continue to next state
- EncodeL();
- break;
- }
- case EEncoding:
- {
- delete iEncoder;
- iEncoder = NULL;
-
- delete iBitmap;
- iBitmap = NULL;
- iState = EIdle;
- // encoding is ready, inform listener
- Completed(KErrNone);
- break;
- }
- default:
- {
- // unknown state
- __ASSERT_DEBUG(EFalse, User::Invariant());
- }
- }
-}
-
-TInt CMMASnapshot::RunError(TInt aError)
-{
- // Reset state
- iState = EIdle;
- // Pass error code to observer
- Completed(aError);
-
- return KErrNone;
-}
-
-void CMMASnapshot::DoCancel()
-{
- // snapshot taking cannot be cancelled
- if (iScaler)
- {
- iScaler->Cancel();
- }
- if (iEncoder)
- {
- iEncoder->Cancel();
- }
- iState = EIdle;
-}
-
-// END OF FILE
--- a/javauis/mmapi_akn/baseline/src/cmmasnapshotevent.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/src/cmmasnapshotevent.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -48,9 +48,11 @@
DEBUG("MMA::CMMASnapshotEvent::Dispatch");
// create java byte array
+
jbyteArray byteArray;
if (iImageBuffer)
+
{
byteArray = aJni.NewByteArray(iImageBuffer->Size());
if (byteArray)
@@ -82,8 +84,8 @@
byteArray);
delete iImageBuffer;
+ iImageBuffer = NULL; // otherwise double delete in destructor
- iImageBuffer = NULL; // otherwise double delete in destructor
aJni.DeleteLocalRef(byteArray);
}
--- a/javauis/mmapi_akn/baseline/src/cmmavideourlplayerlivestreamdelegate.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/src/cmmavideourlplayerlivestreamdelegate.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -52,7 +52,7 @@
void CMMAVideoUrlPlayer::CMMAVideoUrlPlayerLiveStreamDelegate::StartL(TBool /*aPostEvent*/)
{
// start can't be called to not ready player
- ASSERT(iPlayer.iState == EPrefetched);
+ //ASSERT(iPlayer.iState == EPrefetched);
iPlayer.PrefetchL();
@@ -122,7 +122,7 @@
void CMMAVideoUrlPlayer::CMMAVideoUrlPlayerLiveStreamDelegate::HandleEvent(const TMMFEvent& aEvent)
{
- DEBUG_INT("MMA:CMMAVideoUrlPlayer: Live stream: HandleEvent %d", aEvent.iEventType.iUid);
+ DEBUG_INT("MMA:CMMAVideoUrlPlayer: Live stream: HandleEvent -EventTypeUid = %u", aEvent.iEventType.iUid);
DEBUG_INT("MMA:CMMAVideoUrlPlayer: Live stream: HandleEvent error code: %d", aEvent.iErrorCode);
TInt err = aEvent.iErrorCode;
@@ -202,8 +202,13 @@
// usually error condition -45 (KErrSessionClosed) or -33 (KErrTimedOut)
if (err != KErrNone)
{
- DEBUG("MMA:CMMAVideoUrlPlayer: Live stream: KMMFEventCategoryVideoPlayerGeneralError Inform Parent");
- iPlayer.HandleEventToParent(aEvent);
+ if(err == KErrSessionClosed || err == KErrMMAudioDevice)
+ {
+ DEBUG_INT("MMA:CMMAVideoUrlPlayer: Live stream: Ignoring error %d", err);
+ return;
+ }
+ DEBUG("MMA:CMMAVideoUrlPlayer: Live stream: KMMFEventCategoryVideoPlayerGeneralError Inform Parent");
+ iPlayer.HandleEventToParent(aEvent);
}
DEBUG("MMA:CMMAVideoUrlPlayer: Live stream: KMMFEventCategoryVideoPlayerGeneralError -");
}
--- a/javauis/mmapi_akn/baseline/src/cmmavolumecontrol.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/src/cmmavolumecontrol.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -20,9 +20,9 @@
#include "cmmaplayer.h"
#include "cmmavolumecontrol.h"
#include <jdebug.h>
-#include <mprofile.h>
-#include <mprofileengine.h>
-#include <cprofilechangenotifyhandler.h>
+#include <MProfile.h>
+#include <MProfileEngine.h>
+#include <CProfileChangeNotifyHandler.h>
_LIT(KMMAVolumeErrorMsg, "Can't set volume level");
@@ -46,20 +46,20 @@
}
-CMMAVolumeControl::CMMAVolumeControl(CMMAPlayer* aPlayer)
+EXPORT_C CMMAVolumeControl::CMMAVolumeControl(CMMAPlayer* aPlayer)
: iPlayer(aPlayer), iLevel(KMMAVolumeMaxLevel)
{
}
-CMMAVolumeControl::~CMMAVolumeControl()
+EXPORT_C CMMAVolumeControl::~CMMAVolumeControl()
{
delete iProfChangeNotifier;
iLevels.Close();
}
-void CMMAVolumeControl::ConstructBaseL()
+EXPORT_C void CMMAVolumeControl::ConstructBaseL()
{
iPlayer->AddStateListenerL(this);
@@ -114,8 +114,8 @@
iLevel = CalculateLevel();
}
-void CMMAVolumeControl::HandleActiveProfileEventL(TProfileEvent aProfileEvent,
- TInt aProfileId)
+EXPORT_C void CMMAVolumeControl::HandleActiveProfileEventL(
+ TProfileEvent aProfileEvent, TInt aProfileId)
{
switch (aProfileEvent)
{
@@ -157,7 +157,7 @@
-const TDesC& CMMAVolumeControl::ClassName() const
+EXPORT_C const TDesC& CMMAVolumeControl::ClassName() const
{
return KMMAVolumeControlName;
}
@@ -172,7 +172,7 @@
iLevel = aLevel;
}
-void CMMAVolumeControl::StateChanged(TInt aState)
+EXPORT_C void CMMAVolumeControl::StateChanged(TInt aState)
{
DEBUG_INT("CMMAVolumeControl::StateChanged - state %d", aState);
// Set the volume if the player is prefetched
@@ -204,10 +204,12 @@
{
if ((iLevels.Count() - 1) == KMMAGlobalVolumeSoundIndex)
{
- DEBUG("MMA::CMMAVolumeControl::StateChanged : Post GLOBAL VOL EVENT ");
- if (iLevels[ KMMAGlobalVolumeSoundIndex ] != KErrNotFound)
+ if ((iLevels[ KMMAGlobalVolumeSoundIndex ] != KErrNotFound) &&
+ (iLevels[ KMMAGlobalVolumeSoundIndex] != iInitialGlobalVolumeLevel))
{
- DEBUG_INT("MMA::CMMAVolumeControl::StateChanged : Post complete Val = %d ",iLevels[ KMMAGlobalVolumeSoundIndex ]);
+ DEBUG("MMA::CMMAVolumeControl::StateChanged : Post GLOBAL VOL EVENT ");
+ DEBUG_INT("MMA::CMMAVolumeControl::StateChanged : Post complete Val = %d ",
+ iLevels[ KMMAGlobalVolumeSoundIndex ]);
iPlayer->PostLongEvent(CMMAPlayerEvent::ENOKIA_EXTERNAL_VOLUME_EVENT,
iLevels[ KMMAGlobalVolumeSoundIndex ]);
}
@@ -215,7 +217,7 @@
}
}
-void CMMAVolumeControl::RefreshVolume()
+EXPORT_C void CMMAVolumeControl::RefreshVolume()
{
DEBUG("MMA::CMMAVolumeControl::RefreshVolume ++ ");
TRAPD(error,
@@ -238,7 +240,7 @@
DEBUG("MMA::CMMAVolumeControl::RefreshVolume -- ");
}
-void CMMAVolumeControl::RefreshControl()
+EXPORT_C void CMMAVolumeControl::RefreshControl()
{
RefreshVolume();
}
@@ -283,6 +285,10 @@
}
}
+void CMMAVolumeControl::InitializeGlobalVolumeLevel(TInt aGlobalVolumeLevel)
+{
+ iInitialGlobalVolumeLevel = aGlobalVolumeLevel;
+}
void CMMAVolumeControl::GetVolumeLevelL(TInt aLevelIndex,
TInt* aVolumeLevel)
{
@@ -330,6 +336,7 @@
// Actual sound level will be multiplying all levels.
for (TInt i = 0; i < levelCount; i++)
{
+ DEBUG_INT2("CMMAVolumeControl::CalculateLevel value at iLevels[ %d ] is %d",i,iLevels[i]);
// If the level is not known it is expected to be max volume
level = (iLevels[ i ] == KErrNotFound ?
level * KMMAVolumeMaxLevel :
--- a/javauis/mmapi_akn/baseline/src/tmmaparametervalidator.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/baseline/src/tmmaparametervalidator.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -18,10 +18,10 @@
// INCLUDE FILES
#include <jdebug.h>
-#include <mmfformatimplementationuids.hrh>
-#include <mmfcontrollerimplementationuids.hrh>
+#include <mmf/plugin/mmfformatimplementationuids.hrh>
+#include <mmf/plugin/mmfcontrollerimplementationuids.hrh>
+#include <mmf/common/mmfcontrollerpluginresolver.h>
#include "cmmaplayerproperties.h"
-#include <mmfcontrollerpluginresolver.h>
#include "tmmaparametervalidator.h"
--- a/javauis/mmapi_akn/build/bwins/javamobilemedia_5_0u.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/build/bwins/javamobilemedia_5_0u.def Thu Aug 19 09:48:13 2010 +0300
@@ -66,4 +66,13 @@
?StopL@CMMAVideoUrlPlayer@@UAEXH@Z @ 65 NONAME ; void CMMAVideoUrlPlayer::StopL(int)
?TakeSnapshotL@CMMAVideoPlayer@@UAE?AW4TEncoding@MMMASnapshot@@PAVTRequestStatus@@ABVTSize@@ABVCMMAImageSettings@@@Z @ 66 NONAME ; enum MMMASnapshot::TEncoding CMMAVideoPlayer::TakeSnapshotL(class TRequestStatus *, class TSize const &, class CMMAImageSettings const &)
?Type@CMMAVideoPlayer@@MAEABVTDesC16@@XZ @ 67 NONAME ; class TDesC16 const & CMMAVideoPlayer::Type(void)
+ ??0CMMAVolumeControl@@IAE@PAVCMMAPlayer@@@Z @ 68 NONAME ; CMMAVolumeControl::CMMAVolumeControl(class CMMAPlayer *)
+ ??1CMMAVolumeControl@@UAE@XZ @ 69 NONAME ; CMMAVolumeControl::~CMMAVolumeControl(void)
+ ?ClassName@CMMAVolumeControl@@UBEABVTDesC16@@XZ @ 70 NONAME ; class TDesC16 const & CMMAVolumeControl::ClassName(void) const
+ ?CloseL@CMMAPlayer@@UAEXXZ @ 71 NONAME ; void CMMAPlayer::CloseL(void)
+ ?ConstructBaseL@CMMAVolumeControl@@IAEXXZ @ 72 NONAME ; void CMMAVolumeControl::ConstructBaseL(void)
+ ?HandleActiveProfileEventL@CMMAVolumeControl@@UAEXW4TProfileEvent@@H@Z @ 73 NONAME ; void CMMAVolumeControl::HandleActiveProfileEventL(enum TProfileEvent, int)
+ ?RefreshControl@CMMAVolumeControl@@UAEXXZ @ 74 NONAME ; void CMMAVolumeControl::RefreshControl(void)
+ ?RefreshVolume@CMMAVolumeControl@@AAEXXZ @ 75 NONAME ; void CMMAVolumeControl::RefreshVolume(void)
+ ?StateChanged@CMMAVolumeControl@@UAEXH@Z @ 76 NONAME ; void CMMAVolumeControl::StateChanged(int)
--- a/javauis/mmapi_akn/build/bwins/javamobilemediau.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/build/bwins/javamobilemediau.def Thu Aug 19 09:48:13 2010 +0300
@@ -87,4 +87,14 @@
?StopL@CMMAVideoUrlPlayer@@UAEXH@Z @ 86 NONAME ; void CMMAVideoUrlPlayer::StopL(int)
??1CMMAVideoControl@@UAE@XZ @ 87 NONAME ; CMMAVideoControl::~CMMAVideoControl(void)
?HandleSwitchOnL@CMMAVideoControl@@UAEXH@Z @ 88 NONAME ; void CMMAVideoControl::HandleSwitchOnL(int)
+ ?StateChanged@CMMAVolumeControl@@UAEXH@Z @ 89 NONAME ; void CMMAVolumeControl::StateChanged(int)
+ ?CloseL@CMMAPlayer@@UAEXXZ @ 90 NONAME ; void CMMAPlayer::CloseL(void)
+ ?RefreshControl@CMMAVolumeControl@@UAEXXZ @ 91 NONAME ; void CMMAVolumeControl::RefreshControl(void)
+ ?SetAVCableConnStatus@CMMASurfaceWindow@@QAEXH@Z @ 92 NONAME ; void CMMASurfaceWindow::SetAVCableConnStatus(int)
+ ?RefreshVolume@CMMAVolumeControl@@AAEXXZ @ 93 NONAME ; void CMMAVolumeControl::RefreshVolume(void)
+ ?HandleActiveProfileEventL@CMMAVolumeControl@@UAEXW4TProfileEvent@@H@Z @ 94 NONAME ; void CMMAVolumeControl::HandleActiveProfileEventL(enum TProfileEvent, int)
+ ??1CMMAVolumeControl@@UAE@XZ @ 95 NONAME ; CMMAVolumeControl::~CMMAVolumeControl(void)
+ ??0CMMAVolumeControl@@IAE@PAVCMMAPlayer@@@Z @ 96 NONAME ; CMMAVolumeControl::CMMAVolumeControl(class CMMAPlayer *)
+ ?ConstructBaseL@CMMAVolumeControl@@IAEXXZ @ 97 NONAME ; void CMMAVolumeControl::ConstructBaseL(void)
+ ?ClassName@CMMAVolumeControl@@UBEABVTDesC16@@XZ @ 98 NONAME ; class TDesC16 const & CMMAVolumeControl::ClassName(void) const
--- a/javauis/mmapi_akn/build/eabi/javamobilemedia_5_0u.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/build/eabi/javamobilemedia_5_0u.def Thu Aug 19 09:48:13 2010 +0300
@@ -9,128 +9,146 @@
_ZN10CMMAPlayer15PostStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 8 NONAME
_ZN10CMMAPlayer16AddSourceStreamLEP7JNIEnv_P15CMMAEventSourceP8_jobject @ 9 NONAME
_ZN10CMMAPlayer17AddStateListenerLEP23MMMAPlayerStateListener @ 10 NONAME
- _ZN10CMMAPlayer19RemoveStateListenerEP23MMMAPlayerStateListener @ 11 NONAME
- _ZN10CMMAPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 12 NONAME
- _ZN10CMMAPlayer7ControlEi @ 13 NONAME
- _ZN10CMMAPlayerC2Ev @ 14 NONAME
- _ZN10CMMAPlayerD0Ev @ 15 NONAME
- _ZN10CMMAPlayerD1Ev @ 16 NONAME
- _ZN10CMMAPlayerD2Ev @ 17 NONAME
- _ZN11CMMAManager17AddPlayerFactoryLEP17MMMAPlayerFactory @ 18 NONAME
- _ZN15CMMAAudioPlayer13PlayCompleteLEi @ 19 NONAME
- _ZN15CMMAAudioPlayer13PrefetchDataLERK6TDesC8 @ 20 NONAME
- _ZN15CMMAAudioPlayer13PrefetchFileLEv @ 21 NONAME
- _ZN15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 22 NONAME
- _ZN15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 23 NONAME
- _ZN15CMMAEventSource25SetPlayerInstanceObserverEP26MMMAPlayerInstanceObserver @ 24 NONAME
- _ZN15CMMAEventSource26StaticAddObjectFromHandleLEPS_i @ 25 NONAME
- _ZN15CMMAEventSource7PlayersEv @ 26 NONAME
- _ZN15CMMAVideoPlayer10SourceSizeEv @ 27 NONAME
- _ZN15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 28 NONAME
- _ZN15CMMAVideoPlayer11SnapshoterLEv @ 29 NONAME
- _ZN15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 30 NONAME
- _ZN15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 31 NONAME
- _ZN15CMMAVideoPlayer14SnapshotBitmapEv @ 32 NONAME
- _ZN15CMMAVideoPlayer15SnapshotEncodedEv @ 33 NONAME
- _ZN15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 34 NONAME
- _ZN15CMMAVideoPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 35 NONAME
- _ZN15CMMAVideoPlayer4TypeEv @ 36 NONAME
- _ZN16CMMAVideoControl13SnapshotReadyEv @ 37 NONAME
- _ZN16CMMAVideoControl15HandleSwitchOnLEi @ 38 NONAME
- _ZN16CMMAVideoControl17HandleForegroundLEi @ 39 NONAME
- _ZN16CMMAVideoControl21HandleResourceChangeLEi @ 40 NONAME
- _ZN16CMMAVideoControlC1EP13MMMAGuiPlayer @ 41 NONAME
- _ZN16CMMAVideoControlC2EP13MMMAGuiPlayer @ 42 NONAME
- _ZN16CMMAVideoControlD0Ev @ 43 NONAME
- _ZN16CMMAVideoControlD1Ev @ 44 NONAME
- _ZN16CMMAVideoControlD2Ev @ 45 NONAME
- _ZN17CMMAMMFPlayerBase10ControllerEv @ 46 NONAME
- _ZN17CMMAMMFPlayerBase11GetDurationEPx @ 47 NONAME
- _ZN17CMMAMMFPlayerBase6DoOpenE4TUidRK6TDesC8S0_S3_20TMMFPrioritySettings @ 48 NONAME
- _ZN17CMMAVolumeControl15SetVolumeLevelLEii @ 49 NONAME
- _ZN17CMMAVolumeControl25SetAudioOutputPreferenceLEi @ 50 NONAME
- _ZN17CMMAVolumeControl9AddLevelLEv @ 51 NONAME
- _ZN18CMMAVideoUrlPlayer10ConstructLERK7TDesC16 @ 52 NONAME
- _ZN18CMMAVideoUrlPlayer11DeallocateLEv @ 53 NONAME
- _ZN18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 54 NONAME
- _ZN18CMMAVideoUrlPlayer12GetMediaTimeEPx @ 55 NONAME
- _ZN18CMMAVideoUrlPlayer5StopLEi @ 56 NONAME
- _ZN18CMMAVideoUrlPlayer6CloseLEv @ 57 NONAME
- _ZN18CMMAVideoUrlPlayer6StartLEi @ 58 NONAME
- _ZN18CMMAVideoUrlPlayer8RealizeLEv @ 59 NONAME
- _ZN18CMMAVideoUrlPlayer9PrefetchLEv @ 60 NONAME
- _ZN18CMMAVideoUrlPlayerC1EP15CMMAMMFResolver @ 61 NONAME
- _ZN18CMMAVideoUrlPlayerC2EP15CMMAMMFResolver @ 62 NONAME
- _ZN18CMMAVideoUrlPlayerD0Ev @ 63 NONAME
- _ZN18CMMAVideoUrlPlayerD1Ev @ 64 NONAME
- _ZN18CMMAVideoUrlPlayerD2Ev @ 65 NONAME
- _ZN20CMMAMMFPlayerFactory13CreatePlayerLEP29CMMFFormatSelectionParametersPK7TDesC16 @ 66 NONAME
- _ZN20CMMAMMFPlayerFactory33PreparePluginSelectionParametersLEP15CMMAMMFResolverP29CMMFFormatSelectionParameters @ 67 NONAME
- _ZN20CMMAMMFPlayerFactoryC2Ev @ 68 NONAME
- _ZN20CMMAMMFPlayerFactoryD0Ev @ 69 NONAME
- _ZN20CMMAMMFPlayerFactoryD1Ev @ 70 NONAME
- _ZN20CMMAMMFPlayerFactoryD2Ev @ 71 NONAME
- _ZN22CMMAAudioVolumeControl4NewLEP15CMMAAudioPlayer @ 72 NONAME
- _ZNK11CMMAControl15PublicClassNameEv @ 73 NONAME
- _ZNK14CMMAMIDIPlayer10MidiClientEv @ 74 NONAME
- _ZNK16CMMAVideoControl9ClassNameEv @ 75 NONAME
- _ZTI10CMMAPlayer @ 76 NONAME
- _ZTI11CMMAControl @ 77 NONAME
- _ZTI14CMMAMIDIPlayer @ 78 NONAME
- _ZTI15CMMAEventSource @ 79 NONAME
- _ZTI16CMMAVideoControl @ 80 NONAME
- _ZTI17CMMAMMFPlayerBase @ 81 NONAME
- _ZTI17CMMAStreamRequest @ 82 NONAME
- _ZTI17CMMAVolumeControl @ 83 NONAME
- _ZTI18CMMAVideoUrlPlayer @ 84 NONAME
- _ZTI20CMMAMMFPlayerFactory @ 85 NONAME
- _ZTI26CPlaybackCompletedCallback @ 86 NONAME
- _ZTIN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 87 NONAME
- _ZTIN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 88 NONAME
- _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 89 NONAME
- _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 90 NONAME
- _ZTIN19CMMAStopTimeControl10CStopTimerE @ 91 NONAME
- _ZTV10CMMAPlayer @ 92 NONAME
- _ZTV11CMMAControl @ 93 NONAME
- _ZTV14CMMAMIDIPlayer @ 94 NONAME
- _ZTV15CMMAEventSource @ 95 NONAME
- _ZTV16CMMAVideoControl @ 96 NONAME
- _ZTV17CMMAMMFPlayerBase @ 97 NONAME
- _ZTV17CMMAStreamRequest @ 98 NONAME
- _ZTV17CMMAVolumeControl @ 99 NONAME
- _ZTV18CMMAVideoUrlPlayer @ 100 NONAME
- _ZTV20CMMAMMFPlayerFactory @ 101 NONAME
- _ZTV26CPlaybackCompletedCallback @ 102 NONAME
- _ZTVN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 103 NONAME
- _ZTVN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 104 NONAME
- _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 105 NONAME
- _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 106 NONAME
- _ZTVN19CMMAStopTimeControl10CStopTimerE @ 107 NONAME
- _ZThn12_N16CMMAVideoControl15HandleSwitchOnLEi @ 108 NONAME
- _ZThn12_N16CMMAVideoControl17HandleForegroundLEi @ 109 NONAME
- _ZThn12_N16CMMAVideoControl21HandleResourceChangeLEi @ 110 NONAME
- _ZThn152_N18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 111 NONAME
- _ZThn280_N15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 112 NONAME
- _ZThn280_N15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 113 NONAME
- _ZThn288_N15CMMAVideoPlayer10SourceSizeEv @ 114 NONAME
- _ZThn288_N15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 115 NONAME
- _ZThn288_N15CMMAVideoPlayer11SnapshoterLEv @ 116 NONAME
- _ZThn288_N15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 117 NONAME
- _ZThn288_N18CMMAVideoUrlPlayerD0Ev @ 118 NONAME
- _ZThn288_N18CMMAVideoUrlPlayerD1Ev @ 119 NONAME
- _ZThn292_N15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 120 NONAME
- _ZThn292_N15CMMAVideoPlayer14SnapshotBitmapEv @ 121 NONAME
- _ZThn292_N15CMMAVideoPlayer15SnapshotEncodedEv @ 122 NONAME
- _ZThn292_N18CMMAVideoUrlPlayerD0Ev @ 123 NONAME
- _ZThn292_N18CMMAVideoUrlPlayerD1Ev @ 124 NONAME
- _ZThn4_N10CMMAPlayerD0Ev @ 125 NONAME
- _ZThn4_N10CMMAPlayerD1Ev @ 126 NONAME
- _ZThn4_N15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 127 NONAME
- _ZThn4_N18CMMAVideoUrlPlayerD0Ev @ 128 NONAME
- _ZThn4_N18CMMAVideoUrlPlayerD1Ev @ 129 NONAME
- _ZThn4_N20CMMAMMFPlayerFactoryD0Ev @ 130 NONAME
- _ZThn4_N20CMMAMMFPlayerFactoryD1Ev @ 131 NONAME
- _ZThn8_N16CMMAVideoControl13SnapshotReadyEv @ 132 NONAME
- _ZThn8_N16CMMAVideoControlD0Ev @ 133 NONAME
- _ZThn8_N16CMMAVideoControlD1Ev @ 134 NONAME
+ _ZN10CMMAPlayer19PostActionCompletedEi @ 11 NONAME
+ _ZN10CMMAPlayer19RemoveStateListenerEP23MMMAPlayerStateListener @ 12 NONAME
+ _ZN10CMMAPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 13 NONAME
+ _ZN10CMMAPlayer6CloseLEv @ 14 NONAME
+ _ZN10CMMAPlayer7ControlEi @ 15 NONAME
+ _ZN10CMMAPlayerC2Ev @ 16 NONAME
+ _ZN10CMMAPlayerD0Ev @ 17 NONAME
+ _ZN10CMMAPlayerD1Ev @ 18 NONAME
+ _ZN10CMMAPlayerD2Ev @ 19 NONAME
+ _ZN11CMMAManager17AddPlayerFactoryLEP17MMMAPlayerFactory @ 20 NONAME
+ _ZN15CMMAAudioPlayer13PlayCompleteLEi @ 21 NONAME
+ _ZN15CMMAAudioPlayer13PrefetchDataLERK6TDesC8 @ 22 NONAME
+ _ZN15CMMAAudioPlayer13PrefetchFileLEv @ 23 NONAME
+ _ZN15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 24 NONAME
+ _ZN15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 25 NONAME
+ _ZN15CMMAEventSource25SetPlayerInstanceObserverEP26MMMAPlayerInstanceObserver @ 26 NONAME
+ _ZN15CMMAEventSource26StaticAddObjectFromHandleLEPS_i @ 27 NONAME
+ _ZN15CMMAEventSource7PlayersEv @ 28 NONAME
+ _ZN15CMMAVideoPlayer10SourceSizeEv @ 29 NONAME
+ _ZN15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 30 NONAME
+ _ZN15CMMAVideoPlayer11SnapshoterLEv @ 31 NONAME
+ _ZN15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 32 NONAME
+ _ZN15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 33 NONAME
+ _ZN15CMMAVideoPlayer14SnapshotBitmapEv @ 34 NONAME
+ _ZN15CMMAVideoPlayer15SnapshotEncodedEv @ 35 NONAME
+ _ZN15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 36 NONAME
+ _ZN15CMMAVideoPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 37 NONAME
+ _ZN15CMMAVideoPlayer4TypeEv @ 38 NONAME
+ _ZN16CMMAVideoControl13SnapshotReadyEv @ 39 NONAME
+ _ZN16CMMAVideoControl15HandleSwitchOnLEi @ 40 NONAME
+ _ZN16CMMAVideoControl17HandleForegroundLEi @ 41 NONAME
+ _ZN16CMMAVideoControl21HandleResourceChangeLEi @ 42 NONAME
+ _ZN16CMMAVideoControlC1EP13MMMAGuiPlayer @ 43 NONAME
+ _ZN16CMMAVideoControlC2EP13MMMAGuiPlayer @ 44 NONAME
+ _ZN16CMMAVideoControlD0Ev @ 45 NONAME
+ _ZN16CMMAVideoControlD1Ev @ 46 NONAME
+ _ZN16CMMAVideoControlD2Ev @ 47 NONAME
+ _ZN17CMMAMMFPlayerBase10ControllerEv @ 48 NONAME
+ _ZN17CMMAMMFPlayerBase11GetDurationEPx @ 49 NONAME
+ _ZN17CMMAMMFPlayerBase6DoOpenE4TUidRK6TDesC8S0_S3_20TMMFPrioritySettings @ 50 NONAME
+ _ZN17CMMAVolumeControl12StateChangedEi @ 51 NONAME
+ _ZN17CMMAVolumeControl13RefreshVolumeEv @ 52 NONAME
+ _ZN17CMMAVolumeControl14ConstructBaseLEv @ 53 NONAME
+ _ZN17CMMAVolumeControl14RefreshControlEv @ 54 NONAME
+ _ZN17CMMAVolumeControl15SetVolumeLevelLEii @ 55 NONAME
+ _ZN17CMMAVolumeControl25HandleActiveProfileEventLE13TProfileEventi @ 56 NONAME
+ _ZN17CMMAVolumeControl25SetAudioOutputPreferenceLEi @ 57 NONAME
+ _ZN17CMMAVolumeControl9AddLevelLEv @ 58 NONAME
+ _ZN17CMMAVolumeControlC2EP10CMMAPlayer @ 59 NONAME
+ _ZN17CMMAVolumeControlD0Ev @ 60 NONAME
+ _ZN17CMMAVolumeControlD1Ev @ 61 NONAME
+ _ZN17CMMAVolumeControlD2Ev @ 62 NONAME
+ _ZN18CMMAVideoUrlPlayer10ConstructLERK7TDesC16 @ 63 NONAME
+ _ZN18CMMAVideoUrlPlayer11DeallocateLEv @ 64 NONAME
+ _ZN18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 65 NONAME
+ _ZN18CMMAVideoUrlPlayer12GetMediaTimeEPx @ 66 NONAME
+ _ZN18CMMAVideoUrlPlayer5StopLEi @ 67 NONAME
+ _ZN18CMMAVideoUrlPlayer6CloseLEv @ 68 NONAME
+ _ZN18CMMAVideoUrlPlayer6StartLEi @ 69 NONAME
+ _ZN18CMMAVideoUrlPlayer8RealizeLEv @ 70 NONAME
+ _ZN18CMMAVideoUrlPlayer9PrefetchLEv @ 71 NONAME
+ _ZN18CMMAVideoUrlPlayerC1EP15CMMAMMFResolver @ 72 NONAME
+ _ZN18CMMAVideoUrlPlayerC2EP15CMMAMMFResolver @ 73 NONAME
+ _ZN18CMMAVideoUrlPlayerD0Ev @ 74 NONAME
+ _ZN18CMMAVideoUrlPlayerD1Ev @ 75 NONAME
+ _ZN18CMMAVideoUrlPlayerD2Ev @ 76 NONAME
+ _ZN20CMMAMMFPlayerFactory13CreatePlayerLEP29CMMFFormatSelectionParametersPK7TDesC16 @ 77 NONAME
+ _ZN20CMMAMMFPlayerFactory33PreparePluginSelectionParametersLEP15CMMAMMFResolverP29CMMFFormatSelectionParameters @ 78 NONAME
+ _ZN20CMMAMMFPlayerFactoryC2Ev @ 79 NONAME
+ _ZN20CMMAMMFPlayerFactoryD0Ev @ 80 NONAME
+ _ZN20CMMAMMFPlayerFactoryD1Ev @ 81 NONAME
+ _ZN20CMMAMMFPlayerFactoryD2Ev @ 82 NONAME
+ _ZN22CMMAAudioVolumeControl4NewLEP15CMMAAudioPlayer @ 83 NONAME
+ _ZNK11CMMAControl15PublicClassNameEv @ 84 NONAME
+ _ZNK14CMMAMIDIPlayer10MidiClientEv @ 85 NONAME
+ _ZNK16CMMAVideoControl9ClassNameEv @ 86 NONAME
+ _ZNK17CMMAVolumeControl9ClassNameEv @ 87 NONAME
+ _ZTI10CMMAPlayer @ 88 NONAME ; #<TI>#
+ _ZTI11CMMAControl @ 89 NONAME ; #<TI>#
+ _ZTI14CMMAMIDIPlayer @ 90 NONAME ; #<TI>#
+ _ZTI15CMMAEventSource @ 91 NONAME ; #<TI>#
+ _ZTI16CMMAVideoControl @ 92 NONAME ; #<TI>#
+ _ZTI17CMMAMMFPlayerBase @ 93 NONAME ; #<TI>#
+ _ZTI17CMMAStreamRequest @ 94 NONAME ; #<TI>#
+ _ZTI17CMMAVolumeControl @ 95 NONAME ; #<TI>#
+ _ZTI18CMMAVideoUrlPlayer @ 96 NONAME ; #<TI>#
+ _ZTI20CMMACallStateMonitor @ 97 NONAME ; #<TI>#
+ _ZTI20CMMAMMFPlayerFactory @ 98 NONAME ; #<TI>#
+ _ZTI26CPlaybackCompletedCallback @ 99 NONAME ; #<TI>#
+ _ZTIN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 100 NONAME ; #<TI>#
+ _ZTIN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 101 NONAME ; #<TI>#
+ _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 102 NONAME ; #<TI>#
+ _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 103 NONAME ; #<TI>#
+ _ZTIN19CMMAStopTimeControl10CStopTimerE @ 104 NONAME ; #<TI>#
+ _ZTV10CMMAPlayer @ 105 NONAME ; #<VT>#
+ _ZTV11CMMAControl @ 106 NONAME ; #<VT>#
+ _ZTV14CMMAMIDIPlayer @ 107 NONAME ; #<VT>#
+ _ZTV15CMMAEventSource @ 108 NONAME ; #<VT>#
+ _ZTV16CMMAVideoControl @ 109 NONAME ; #<VT>#
+ _ZTV17CMMAMMFPlayerBase @ 110 NONAME ; #<VT>#
+ _ZTV17CMMAStreamRequest @ 111 NONAME ; #<VT>#
+ _ZTV17CMMAVolumeControl @ 112 NONAME ; #<VT>#
+ _ZTV18CMMAVideoUrlPlayer @ 113 NONAME ; #<VT>#
+ _ZTV20CMMACallStateMonitor @ 114 NONAME ; #<VT>#
+ _ZTV20CMMAMMFPlayerFactory @ 115 NONAME ; #<VT>#
+ _ZTV26CPlaybackCompletedCallback @ 116 NONAME ; #<VT>#
+ _ZTVN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 117 NONAME ; #<VT>#
+ _ZTVN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 118 NONAME ; #<VT>#
+ _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 119 NONAME ; #<VT>#
+ _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 120 NONAME ; #<VT>#
+ _ZTVN19CMMAStopTimeControl10CStopTimerE @ 121 NONAME ; #<VT>#
+ _ZThn12_N16CMMAVideoControl15HandleSwitchOnLEi @ 122 NONAME ; #<thunk>#
+ _ZThn12_N16CMMAVideoControl17HandleForegroundLEi @ 123 NONAME ; #<thunk>#
+ _ZThn12_N16CMMAVideoControl21HandleResourceChangeLEi @ 124 NONAME ; #<thunk>#
+ _ZThn12_N17CMMAVolumeControl25HandleActiveProfileEventLE13TProfileEventi @ 125 NONAME ; #<thunk>#
+ _ZThn160_N18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 126 NONAME ; #<thunk>#
+ _ZThn288_N15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 127 NONAME ; #<thunk>#
+ _ZThn288_N15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 128 NONAME ; #<thunk>#
+ _ZThn296_N15CMMAVideoPlayer10SourceSizeEv @ 129 NONAME ; #<thunk>#
+ _ZThn296_N15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 130 NONAME ; #<thunk>#
+ _ZThn296_N15CMMAVideoPlayer11SnapshoterLEv @ 131 NONAME ; #<thunk>#
+ _ZThn296_N15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 132 NONAME ; #<thunk>#
+ _ZThn296_N18CMMAVideoUrlPlayerD0Ev @ 133 NONAME ; #<thunk>#
+ _ZThn296_N18CMMAVideoUrlPlayerD1Ev @ 134 NONAME ; #<thunk>#
+ _ZThn300_N15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 135 NONAME ; #<thunk>#
+ _ZThn300_N15CMMAVideoPlayer14SnapshotBitmapEv @ 136 NONAME ; #<thunk>#
+ _ZThn300_N15CMMAVideoPlayer15SnapshotEncodedEv @ 137 NONAME ; #<thunk>#
+ _ZThn300_N18CMMAVideoUrlPlayerD0Ev @ 138 NONAME ; #<thunk>#
+ _ZThn300_N18CMMAVideoUrlPlayerD1Ev @ 139 NONAME ; #<thunk>#
+ _ZThn4_N10CMMAPlayerD0Ev @ 140 NONAME ; #<thunk>#
+ _ZThn4_N10CMMAPlayerD1Ev @ 141 NONAME ; #<thunk>#
+ _ZThn4_N15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 142 NONAME ; #<thunk>#
+ _ZThn4_N18CMMAVideoUrlPlayerD0Ev @ 143 NONAME ; #<thunk>#
+ _ZThn4_N18CMMAVideoUrlPlayerD1Ev @ 144 NONAME ; #<thunk>#
+ _ZThn4_N20CMMAMMFPlayerFactoryD0Ev @ 145 NONAME ; #<thunk>#
+ _ZThn4_N20CMMAMMFPlayerFactoryD1Ev @ 146 NONAME ; #<thunk>#
+ _ZThn8_N16CMMAVideoControl13SnapshotReadyEv @ 147 NONAME ; #<thunk>#
+ _ZThn8_N16CMMAVideoControlD0Ev @ 148 NONAME ; #<thunk>#
+ _ZThn8_N16CMMAVideoControlD1Ev @ 149 NONAME ; #<thunk>#
+ _ZThn8_N17CMMAVolumeControl12StateChangedEi @ 150 NONAME ; #<thunk>#
+ _ZThn8_N17CMMAVolumeControlD0Ev @ 151 NONAME ; #<thunk>#
+ _ZThn8_N17CMMAVolumeControlD1Ev @ 152 NONAME ; #<thunk>#
--- a/javauis/mmapi_akn/build/eabi/javamobilemediau.def Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/build/eabi/javamobilemediau.def Thu Aug 19 09:48:13 2010 +0300
@@ -9,158 +9,177 @@
_ZN10CMMAPlayer15PostStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 8 NONAME
_ZN10CMMAPlayer16AddSourceStreamLEP7JNIEnv_P15CMMAEventSourceP8_jobject @ 9 NONAME
_ZN10CMMAPlayer17AddStateListenerLEP23MMMAPlayerStateListener @ 10 NONAME
- _ZN10CMMAPlayer19RemoveStateListenerEP23MMMAPlayerStateListener @ 11 NONAME
- _ZN10CMMAPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 12 NONAME
- _ZN10CMMAPlayer7ControlEi @ 13 NONAME
- _ZN10CMMAPlayerC2Ev @ 14 NONAME
- _ZN10CMMAPlayerD0Ev @ 15 NONAME
- _ZN10CMMAPlayerD1Ev @ 16 NONAME
- _ZN10CMMAPlayerD2Ev @ 17 NONAME
- _ZN11CMMAManager17AddPlayerFactoryLEP17MMMAPlayerFactory @ 18 NONAME
- _ZN15CMMAAudioPlayer13PlayCompleteLEi @ 19 NONAME
- _ZN15CMMAAudioPlayer13PrefetchDataLERK6TDesC8 @ 20 NONAME
- _ZN15CMMAAudioPlayer13PrefetchFileLEv @ 21 NONAME
- _ZN15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 22 NONAME
- _ZN15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 23 NONAME
- _ZN15CMMAEventSource25SetPlayerInstanceObserverEP26MMMAPlayerInstanceObserver @ 24 NONAME
- _ZN15CMMAEventSource26StaticAddObjectFromHandleLEPS_i @ 25 NONAME
- _ZN15CMMAEventSource7PlayersEv @ 26 NONAME
- _ZN15CMMAVideoPlayer10SourceSizeEv @ 27 NONAME
- _ZN15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 28 NONAME
- _ZN15CMMAVideoPlayer11SnapshoterLEv @ 29 NONAME
- _ZN15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 30 NONAME
- _ZN15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 31 NONAME
- _ZN15CMMAVideoPlayer14SnapshotBitmapEv @ 32 NONAME
- _ZN15CMMAVideoPlayer15SnapshotEncodedEv @ 33 NONAME
- _ZN15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 34 NONAME
- _ZN15CMMAVideoPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 35 NONAME
- _ZN15CMMAVideoPlayer4TypeEv @ 36 NONAME
- _ZN16CMMAVideoControl13SnapshotReadyEv @ 37 NONAME
- _ZN16CMMAVideoControl15HandleSwitchOnLEi @ 38 NONAME
- _ZN16CMMAVideoControl17HandleForegroundLEi @ 39 NONAME
- _ZN16CMMAVideoControl21HandleResourceChangeLEi @ 40 NONAME
- _ZN16CMMAVideoControlC1EP13MMMAGuiPlayer @ 41 NONAME
- _ZN16CMMAVideoControlC2EP13MMMAGuiPlayer @ 42 NONAME
- _ZN16CMMAVideoControlD0Ev @ 43 NONAME
- _ZN16CMMAVideoControlD1Ev @ 44 NONAME
- _ZN16CMMAVideoControlD2Ev @ 45 NONAME
- _ZN17CMMAEMCPlayerBase13StreamControlEv @ 46 NONAME
- _ZN17CMMAEMCPlayerBase9MMFactoryEv @ 47 NONAME
- _ZN17CMMAMMFPlayerBase10ControllerEv @ 48 NONAME
- _ZN17CMMAMMFPlayerBase11GetDurationEPx @ 49 NONAME
- _ZN17CMMAMMFPlayerBase6DoOpenE4TUidRK6TDesC8S0_S3_20TMMFPrioritySettings @ 50 NONAME
- _ZN17CMMASurfaceWindow10SetDisplayEP11MMMADisplay @ 51 NONAME
- _ZN17CMMASurfaceWindow13RemoveSurfaceEv @ 52 NONAME
- _ZN17CMMASurfaceWindow20SetSurfaceParametersERK10TSurfaceIdRK5TRectRK17TVideoAspectRatio @ 53 NONAME
- _ZN17CMMASurfaceWindow27SetChangedSurfaceParametersERK10TSurfaceIdRK5TRectRK17TVideoAspectRatio @ 54 NONAME
- _ZN17CMMASurfaceWindow4NewLEP15CMMAEventSourceP10CMMAPlayeri @ 55 NONAME
- _ZN17CMMAVolumeControl15SetVolumeLevelLEii @ 56 NONAME
- _ZN17CMMAVolumeControl25SetAudioOutputPreferenceLEi @ 57 NONAME
- _ZN17CMMAVolumeControl9AddLevelLEv @ 58 NONAME
- _ZN18CMMAEMCAudioPlayer10ConstructLEv @ 59 NONAME
- _ZN18CMMAEMCAudioPlayer13PlayCompleteLEi @ 60 NONAME
- _ZN18CMMAEMCAudioPlayer13PrefetchDataLERK6TDesC8 @ 61 NONAME
- _ZN18CMMAEMCAudioPlayer13PrefetchFileLEv @ 62 NONAME
- _ZN18CMMAEMCAudioPlayer14ReadCompletedLEiRK6TDesC8 @ 63 NONAME
- _ZN18CMMAEMCAudioPlayer4TypeEv @ 64 NONAME
- _ZN18CMMAEMCAudioPlayer8RealizeLEv @ 65 NONAME
- _ZN18CMMAEMCAudioPlayer9PrefetchLEv @ 66 NONAME
- _ZN18CMMAEMCAudioPlayerC1EP15CMMAEMCResolver @ 67 NONAME
- _ZN18CMMAEMCAudioPlayerC2EP15CMMAEMCResolver @ 68 NONAME
- _ZN18CMMAEMCAudioPlayerD0Ev @ 69 NONAME
- _ZN18CMMAEMCAudioPlayerD1Ev @ 70 NONAME
- _ZN18CMMAEMCAudioPlayerD2Ev @ 71 NONAME
- _ZN18CMMAVideoUrlPlayer10ConstructLERK7TDesC16 @ 72 NONAME
- _ZN18CMMAVideoUrlPlayer11DeallocateLEv @ 73 NONAME
- _ZN18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 74 NONAME
- _ZN18CMMAVideoUrlPlayer12GetMediaTimeEPx @ 75 NONAME
- _ZN18CMMAVideoUrlPlayer5StopLEi @ 76 NONAME
- _ZN18CMMAVideoUrlPlayer6CloseLEv @ 77 NONAME
- _ZN18CMMAVideoUrlPlayer6StartLEi @ 78 NONAME
- _ZN18CMMAVideoUrlPlayer8RealizeLEv @ 79 NONAME
- _ZN18CMMAVideoUrlPlayer9PrefetchLEv @ 80 NONAME
- _ZN18CMMAVideoUrlPlayerC1EP15CMMAMMFResolver @ 81 NONAME
- _ZN18CMMAVideoUrlPlayerC2EP15CMMAMMFResolver @ 82 NONAME
- _ZN18CMMAVideoUrlPlayerD0Ev @ 83 NONAME
- _ZN18CMMAVideoUrlPlayerD1Ev @ 84 NONAME
- _ZN18CMMAVideoUrlPlayerD2Ev @ 85 NONAME
- _ZN20CMMAMMFPlayerFactory13CreatePlayerLEP29CMMFFormatSelectionParametersPK7TDesC16 @ 86 NONAME
- _ZN20CMMAMMFPlayerFactory33PreparePluginSelectionParametersLEP15CMMAMMFResolverP29CMMFFormatSelectionParameters @ 87 NONAME
- _ZN20CMMAMMFPlayerFactoryC2Ev @ 88 NONAME
- _ZN20CMMAMMFPlayerFactoryD0Ev @ 89 NONAME
- _ZN20CMMAMMFPlayerFactoryD1Ev @ 90 NONAME
- _ZN20CMMAMMFPlayerFactoryD2Ev @ 91 NONAME
- _ZN22CMMAAudioVolumeControl4NewLEP15CMMAAudioPlayer @ 92 NONAME
- _ZN25CMMAEMCAudioVolumeControl11DoGetLevelLEv @ 93 NONAME
- _ZN25CMMAEMCAudioVolumeControl11DoSetLevelLEi @ 94 NONAME
- _ZN25CMMAEMCAudioVolumeControl4NewLER18CMMAEMCAudioPlayer @ 95 NONAME
- _ZN25CMMAEMCAudioVolumeControlC1ER18CMMAEMCAudioPlayer @ 96 NONAME
- _ZN25CMMAEMCAudioVolumeControlC2ER18CMMAEMCAudioPlayer @ 97 NONAME
- _ZNK11CMMAControl15PublicClassNameEv @ 98 NONAME
- _ZNK14CMMAMIDIPlayer10MidiClientEv @ 99 NONAME
- _ZNK16CMMAVideoControl9ClassNameEv @ 100 NONAME
- _ZTI10CMMAPlayer @ 101 NONAME
- _ZTI11CMMAControl @ 102 NONAME
- _ZTI14CMMAMIDIPlayer @ 103 NONAME
- _ZTI15CMMAEventSource @ 104 NONAME
- _ZTI16CMMAVideoControl @ 105 NONAME
- _ZTI17CMMAMMFPlayerBase @ 106 NONAME
- _ZTI17CMMAStreamRequest @ 107 NONAME
- _ZTI17CMMAVolumeControl @ 108 NONAME
- _ZTI18CHXMetaDataUtility @ 109 NONAME
- _ZTI18CMMAVideoUrlPlayer @ 110 NONAME
- _ZTI20CMMAMMFPlayerFactory @ 111 NONAME
- _ZTI26CPlaybackCompletedCallback @ 112 NONAME
- _ZTIN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 113 NONAME
- _ZTIN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 114 NONAME
- _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 115 NONAME
- _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 116 NONAME
- _ZTIN19CMMAStopTimeControl10CStopTimerE @ 117 NONAME
- _ZTV10CMMAPlayer @ 118 NONAME
- _ZTV11CMMAControl @ 119 NONAME
- _ZTV14CMMAMIDIPlayer @ 120 NONAME
- _ZTV15CMMAEventSource @ 121 NONAME
- _ZTV16CMMAVideoControl @ 122 NONAME
- _ZTV17CMMAMMFPlayerBase @ 123 NONAME
- _ZTV17CMMAStreamRequest @ 124 NONAME
- _ZTV17CMMAVolumeControl @ 125 NONAME
- _ZTV18CHXMetaDataUtility @ 126 NONAME
- _ZTV18CMMAVideoUrlPlayer @ 127 NONAME
- _ZTV20CMMAMMFPlayerFactory @ 128 NONAME
- _ZTV26CPlaybackCompletedCallback @ 129 NONAME
- _ZTVN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 130 NONAME
- _ZTVN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 131 NONAME
- _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 132 NONAME
- _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 133 NONAME
- _ZTVN19CMMAStopTimeControl10CStopTimerE @ 134 NONAME
- _ZThn12_N16CMMAVideoControl15HandleSwitchOnLEi @ 135 NONAME
- _ZThn12_N16CMMAVideoControl17HandleForegroundLEi @ 136 NONAME
- _ZThn12_N16CMMAVideoControl21HandleResourceChangeLEi @ 137 NONAME
- _ZThn152_N18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 138 NONAME
- _ZThn280_N15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 139 NONAME
- _ZThn280_N15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 140 NONAME
- _ZThn288_N15CMMAVideoPlayer10SourceSizeEv @ 141 NONAME
- _ZThn288_N15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 142 NONAME
- _ZThn288_N15CMMAVideoPlayer11SnapshoterLEv @ 143 NONAME
- _ZThn288_N15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 144 NONAME
- _ZThn288_N18CMMAVideoUrlPlayerD0Ev @ 145 NONAME
- _ZThn288_N18CMMAVideoUrlPlayerD1Ev @ 146 NONAME
- _ZThn292_N15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 147 NONAME
- _ZThn292_N15CMMAVideoPlayer14SnapshotBitmapEv @ 148 NONAME
- _ZThn292_N15CMMAVideoPlayer15SnapshotEncodedEv @ 149 NONAME
- _ZThn292_N18CMMAVideoUrlPlayerD0Ev @ 150 NONAME
- _ZThn292_N18CMMAVideoUrlPlayerD1Ev @ 151 NONAME
- _ZThn4_N10CMMAPlayerD0Ev @ 152 NONAME
- _ZThn4_N10CMMAPlayerD1Ev @ 153 NONAME
- _ZThn4_N15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 154 NONAME
- _ZThn4_N18CMMAEMCAudioPlayer14ReadCompletedLEiRK6TDesC8 @ 155 NONAME
- _ZThn4_N18CMMAEMCAudioPlayerD0Ev @ 156 NONAME
- _ZThn4_N18CMMAEMCAudioPlayerD1Ev @ 157 NONAME
- _ZThn4_N18CMMAVideoUrlPlayerD0Ev @ 158 NONAME
- _ZThn4_N18CMMAVideoUrlPlayerD1Ev @ 159 NONAME
- _ZThn4_N20CMMAMMFPlayerFactoryD0Ev @ 160 NONAME
- _ZThn4_N20CMMAMMFPlayerFactoryD1Ev @ 161 NONAME
- _ZThn8_N16CMMAVideoControl13SnapshotReadyEv @ 162 NONAME
- _ZThn8_N16CMMAVideoControlD0Ev @ 163 NONAME
- _ZThn8_N16CMMAVideoControlD1Ev @ 164 NONAME
+ _ZN10CMMAPlayer19PostActionCompletedEi @ 11 NONAME
+ _ZN10CMMAPlayer19RemoveStateListenerEP23MMMAPlayerStateListener @ 12 NONAME
+ _ZN10CMMAPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 13 NONAME
+ _ZN10CMMAPlayer6CloseLEv @ 14 NONAME
+ _ZN10CMMAPlayer7ControlEi @ 15 NONAME
+ _ZN10CMMAPlayerC2Ev @ 16 NONAME
+ _ZN10CMMAPlayerD0Ev @ 17 NONAME
+ _ZN10CMMAPlayerD1Ev @ 18 NONAME
+ _ZN10CMMAPlayerD2Ev @ 19 NONAME
+ _ZN11CMMAManager17AddPlayerFactoryLEP17MMMAPlayerFactory @ 20 NONAME
+ _ZN15CMMAAudioPlayer13PlayCompleteLEi @ 21 NONAME
+ _ZN15CMMAAudioPlayer13PrefetchDataLERK6TDesC8 @ 22 NONAME
+ _ZN15CMMAAudioPlayer13PrefetchFileLEv @ 23 NONAME
+ _ZN15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 24 NONAME
+ _ZN15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 25 NONAME
+ _ZN15CMMAEventSource25SetPlayerInstanceObserverEP26MMMAPlayerInstanceObserver @ 26 NONAME
+ _ZN15CMMAEventSource26StaticAddObjectFromHandleLEPS_i @ 27 NONAME
+ _ZN15CMMAEventSource7PlayersEv @ 28 NONAME
+ _ZN15CMMAVideoPlayer10SourceSizeEv @ 29 NONAME
+ _ZN15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 30 NONAME
+ _ZN15CMMAVideoPlayer11SnapshoterLEv @ 31 NONAME
+ _ZN15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 32 NONAME
+ _ZN15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 33 NONAME
+ _ZN15CMMAVideoPlayer14SnapshotBitmapEv @ 34 NONAME
+ _ZN15CMMAVideoPlayer15SnapshotEncodedEv @ 35 NONAME
+ _ZN15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 36 NONAME
+ _ZN15CMMAVideoPlayer24SetPlayerListenerObjectLEP8_jobjectP7JNIEnv_P15MMMAEventPoster @ 37 NONAME
+ _ZN15CMMAVideoPlayer4TypeEv @ 38 NONAME
+ _ZN16CMMAVideoControl13SnapshotReadyEv @ 39 NONAME
+ _ZN16CMMAVideoControl15HandleSwitchOnLEi @ 40 NONAME
+ _ZN16CMMAVideoControl17HandleForegroundLEi @ 41 NONAME
+ _ZN16CMMAVideoControl21HandleResourceChangeLEi @ 42 NONAME
+ _ZN16CMMAVideoControlC1EP13MMMAGuiPlayer @ 43 NONAME
+ _ZN16CMMAVideoControlC2EP13MMMAGuiPlayer @ 44 NONAME
+ _ZN16CMMAVideoControlD0Ev @ 45 NONAME
+ _ZN16CMMAVideoControlD1Ev @ 46 NONAME
+ _ZN16CMMAVideoControlD2Ev @ 47 NONAME
+ _ZN17CMMAEMCPlayerBase13StreamControlEv @ 48 NONAME
+ _ZN17CMMAEMCPlayerBase9MMFactoryEv @ 49 NONAME
+ _ZN17CMMAMMFPlayerBase10ControllerEv @ 50 NONAME
+ _ZN17CMMAMMFPlayerBase11GetDurationEPx @ 51 NONAME
+ _ZN17CMMAMMFPlayerBase6DoOpenE4TUidRK6TDesC8S0_S3_20TMMFPrioritySettings @ 52 NONAME
+ _ZN17CMMASurfaceWindow10SetDisplayEP11MMMADisplay @ 53 NONAME
+ _ZN17CMMASurfaceWindow13RemoveSurfaceEv @ 54 NONAME
+ _ZN17CMMASurfaceWindow20SetAVCableConnStatusEi @ 55 NONAME
+ _ZN17CMMASurfaceWindow20SetSurfaceParametersERK10TSurfaceIdRK5TRectRK17TVideoAspectRatio @ 56 NONAME
+ _ZN17CMMASurfaceWindow27SetChangedSurfaceParametersERK10TSurfaceIdRK5TRectRK17TVideoAspectRatio @ 57 NONAME
+ _ZN17CMMASurfaceWindow4NewLEP15CMMAEventSourceP10CMMAPlayeri @ 58 NONAME
+ _ZN17CMMAVolumeControl12StateChangedEi @ 59 NONAME
+ _ZN17CMMAVolumeControl13RefreshVolumeEv @ 60 NONAME
+ _ZN17CMMAVolumeControl14ConstructBaseLEv @ 61 NONAME
+ _ZN17CMMAVolumeControl14RefreshControlEv @ 62 NONAME
+ _ZN17CMMAVolumeControl15SetVolumeLevelLEii @ 63 NONAME
+ _ZN17CMMAVolumeControl25HandleActiveProfileEventLE13TProfileEventi @ 64 NONAME
+ _ZN17CMMAVolumeControl25SetAudioOutputPreferenceLEi @ 65 NONAME
+ _ZN17CMMAVolumeControl9AddLevelLEv @ 66 NONAME
+ _ZN17CMMAVolumeControlC2EP10CMMAPlayer @ 67 NONAME
+ _ZN17CMMAVolumeControlD0Ev @ 68 NONAME
+ _ZN17CMMAVolumeControlD1Ev @ 69 NONAME
+ _ZN17CMMAVolumeControlD2Ev @ 70 NONAME
+ _ZN18CMMAEMCAudioPlayer10ConstructLEv @ 71 NONAME
+ _ZN18CMMAEMCAudioPlayer13PlayCompleteLEi @ 72 NONAME
+ _ZN18CMMAEMCAudioPlayer13PrefetchDataLERK6TDesC8 @ 73 NONAME
+ _ZN18CMMAEMCAudioPlayer13PrefetchFileLEv @ 74 NONAME
+ _ZN18CMMAEMCAudioPlayer14ReadCompletedLEiRK6TDesC8 @ 75 NONAME
+ _ZN18CMMAEMCAudioPlayer4TypeEv @ 76 NONAME
+ _ZN18CMMAEMCAudioPlayer8RealizeLEv @ 77 NONAME
+ _ZN18CMMAEMCAudioPlayer9PrefetchLEv @ 78 NONAME
+ _ZN18CMMAEMCAudioPlayerC1EP15CMMAEMCResolver @ 79 NONAME
+ _ZN18CMMAEMCAudioPlayerC2EP15CMMAEMCResolver @ 80 NONAME
+ _ZN18CMMAEMCAudioPlayerD0Ev @ 81 NONAME
+ _ZN18CMMAEMCAudioPlayerD1Ev @ 82 NONAME
+ _ZN18CMMAEMCAudioPlayerD2Ev @ 83 NONAME
+ _ZN18CMMAVideoUrlPlayer10ConstructLERK7TDesC16 @ 84 NONAME
+ _ZN18CMMAVideoUrlPlayer11DeallocateLEv @ 85 NONAME
+ _ZN18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 86 NONAME
+ _ZN18CMMAVideoUrlPlayer12GetMediaTimeEPx @ 87 NONAME
+ _ZN18CMMAVideoUrlPlayer5StopLEi @ 88 NONAME
+ _ZN18CMMAVideoUrlPlayer6CloseLEv @ 89 NONAME
+ _ZN18CMMAVideoUrlPlayer6StartLEi @ 90 NONAME
+ _ZN18CMMAVideoUrlPlayer8RealizeLEv @ 91 NONAME
+ _ZN18CMMAVideoUrlPlayer9PrefetchLEv @ 92 NONAME
+ _ZN18CMMAVideoUrlPlayerC1EP15CMMAMMFResolver @ 93 NONAME
+ _ZN18CMMAVideoUrlPlayerC2EP15CMMAMMFResolver @ 94 NONAME
+ _ZN18CMMAVideoUrlPlayerD0Ev @ 95 NONAME
+ _ZN18CMMAVideoUrlPlayerD1Ev @ 96 NONAME
+ _ZN18CMMAVideoUrlPlayerD2Ev @ 97 NONAME
+ _ZN20CMMAMMFPlayerFactory13CreatePlayerLEP29CMMFFormatSelectionParametersPK7TDesC16 @ 98 NONAME
+ _ZN20CMMAMMFPlayerFactory33PreparePluginSelectionParametersLEP15CMMAMMFResolverP29CMMFFormatSelectionParameters @ 99 NONAME
+ _ZN20CMMAMMFPlayerFactoryC2Ev @ 100 NONAME
+ _ZN20CMMAMMFPlayerFactoryD0Ev @ 101 NONAME
+ _ZN20CMMAMMFPlayerFactoryD1Ev @ 102 NONAME
+ _ZN20CMMAMMFPlayerFactoryD2Ev @ 103 NONAME
+ _ZN22CMMAAudioVolumeControl4NewLEP15CMMAAudioPlayer @ 104 NONAME
+ _ZN25CMMAEMCAudioVolumeControl11DoGetLevelLEv @ 105 NONAME
+ _ZN25CMMAEMCAudioVolumeControl11DoSetLevelLEi @ 106 NONAME
+ _ZN25CMMAEMCAudioVolumeControl4NewLER18CMMAEMCAudioPlayer @ 107 NONAME
+ _ZN25CMMAEMCAudioVolumeControlC1ER18CMMAEMCAudioPlayer @ 108 NONAME
+ _ZN25CMMAEMCAudioVolumeControlC2ER18CMMAEMCAudioPlayer @ 109 NONAME
+ _ZNK11CMMAControl15PublicClassNameEv @ 110 NONAME
+ _ZNK14CMMAMIDIPlayer10MidiClientEv @ 111 NONAME
+ _ZNK16CMMAVideoControl9ClassNameEv @ 112 NONAME
+ _ZNK17CMMAVolumeControl9ClassNameEv @ 113 NONAME
+ _ZTI10CMMAPlayer @ 114 NONAME
+ _ZTI11CMMAControl @ 115 NONAME
+ _ZTI14CMMAMIDIPlayer @ 116 NONAME
+ _ZTI15CMMAEventSource @ 117 NONAME
+ _ZTI16CMMAVideoControl @ 118 NONAME
+ _ZTI17CMMAMMFPlayerBase @ 119 NONAME
+ _ZTI17CMMAStreamRequest @ 120 NONAME
+ _ZTI17CMMAVolumeControl @ 121 NONAME
+ _ZTI18CHXMetaDataUtility @ 122 NONAME
+ _ZTI18CMMAVideoUrlPlayer @ 123 NONAME
+ _ZTI20CMMACallStateMonitor @ 124 NONAME
+ _ZTI20CMMAMMFPlayerFactory @ 125 NONAME
+ _ZTI26CPlaybackCompletedCallback @ 126 NONAME
+ _ZTIN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 127 NONAME
+ _ZTIN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 128 NONAME
+ _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 129 NONAME
+ _ZTIN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 130 NONAME
+ _ZTIN19CMMAStopTimeControl10CStopTimerE @ 131 NONAME
+ _ZTV10CMMAPlayer @ 132 NONAME
+ _ZTV11CMMAControl @ 133 NONAME
+ _ZTV14CMMAMIDIPlayer @ 134 NONAME
+ _ZTV15CMMAEventSource @ 135 NONAME
+ _ZTV16CMMAVideoControl @ 136 NONAME
+ _ZTV17CMMAMMFPlayerBase @ 137 NONAME
+ _ZTV17CMMAStreamRequest @ 138 NONAME
+ _ZTV17CMMAVolumeControl @ 139 NONAME
+ _ZTV18CHXMetaDataUtility @ 140 NONAME
+ _ZTV18CMMAVideoUrlPlayer @ 141 NONAME
+ _ZTV20CMMACallStateMonitor @ 142 NONAME
+ _ZTV20CMMAMMFPlayerFactory @ 143 NONAME
+ _ZTV26CPlaybackCompletedCallback @ 144 NONAME
+ _ZTVN15CMMAMIDIControl23CChannelVolumeEventWaitE @ 145 NONAME
+ _ZTVN18CMMAVideoUrlPlayer26CMMAVideoUrlPlayerDelegateE @ 146 NONAME
+ _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerClipStreamDelegateE @ 147 NONAME
+ _ZTVN18CMMAVideoUrlPlayer36CMMAVideoUrlPlayerLiveStreamDelegateE @ 148 NONAME
+ _ZTVN19CMMAStopTimeControl10CStopTimerE @ 149 NONAME
+ _ZThn12_N16CMMAVideoControl15HandleSwitchOnLEi @ 150 NONAME
+ _ZThn12_N16CMMAVideoControl17HandleForegroundLEi @ 151 NONAME
+ _ZThn12_N16CMMAVideoControl21HandleResourceChangeLEi @ 152 NONAME
+ _ZThn12_N17CMMAVolumeControl25HandleActiveProfileEventLE13TProfileEventi @ 153 NONAME
+ _ZThn160_N18CMMAVideoUrlPlayer11HandleEventERK9TMMFEvent @ 154 NONAME
+ _ZThn288_N15CMMAAudioPlayer21ErrorPlaybackCompleteEi @ 155 NONAME
+ _ZThn288_N15CMMAAudioPlayer23HandlePlaybackCompleteLEv @ 156 NONAME
+ _ZThn296_N15CMMAVideoPlayer10SourceSizeEv @ 157 NONAME
+ _ZThn296_N15CMMAVideoPlayer11SetDisplayLEP11MMMADisplay @ 158 NONAME
+ _ZThn296_N15CMMAVideoPlayer11SnapshoterLEv @ 159 NONAME
+ _ZThn296_N15CMMAVideoPlayer21NotifyWithStringEventEN15CMMAPlayerEvent10TEventTypeERK7TDesC16 @ 160 NONAME
+ _ZThn296_N18CMMAVideoUrlPlayerD0Ev @ 161 NONAME
+ _ZThn296_N18CMMAVideoUrlPlayerD1Ev @ 162 NONAME
+ _ZThn300_N15CMMAVideoPlayer13TakeSnapshotLEP14TRequestStatusRK5TSizeRK17CMMAImageSettings @ 163 NONAME
+ _ZThn300_N15CMMAVideoPlayer14SnapshotBitmapEv @ 164 NONAME
+ _ZThn300_N15CMMAVideoPlayer15SnapshotEncodedEv @ 165 NONAME
+ _ZThn300_N18CMMAVideoUrlPlayerD0Ev @ 166 NONAME
+ _ZThn300_N18CMMAVideoUrlPlayerD1Ev @ 167 NONAME
+ _ZThn4_N10CMMAPlayerD0Ev @ 168 NONAME
+ _ZThn4_N10CMMAPlayerD1Ev @ 169 NONAME
+ _ZThn4_N15CMMAVideoPlayer14ReadCompletedLEiRK6TDesC8 @ 170 NONAME
+ _ZThn4_N18CMMAEMCAudioPlayer14ReadCompletedLEiRK6TDesC8 @ 171 NONAME
+ _ZThn4_N18CMMAEMCAudioPlayerD0Ev @ 172 NONAME
+ _ZThn4_N18CMMAEMCAudioPlayerD1Ev @ 173 NONAME
+ _ZThn4_N18CMMAVideoUrlPlayerD0Ev @ 174 NONAME
+ _ZThn4_N18CMMAVideoUrlPlayerD1Ev @ 175 NONAME
+ _ZThn4_N20CMMAMMFPlayerFactoryD0Ev @ 176 NONAME
+ _ZThn4_N20CMMAMMFPlayerFactoryD1Ev @ 177 NONAME
+ _ZThn8_N16CMMAVideoControl13SnapshotReadyEv @ 178 NONAME
+ _ZThn8_N16CMMAVideoControlD0Ev @ 179 NONAME
+ _ZThn8_N16CMMAVideoControlD1Ev @ 180 NONAME
+ _ZThn8_N17CMMAVolumeControl12StateChangedEi @ 181 NONAME
+ _ZThn8_N17CMMAVolumeControlD0Ev @ 182 NONAME
+ _ZThn8_N17CMMAVolumeControlD1Ev @ 183 NONAME
--- a/javauis/mmapi_akn/build/exports.inf Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/build/exports.inf Thu Aug 19 09:48:13 2010 +0300
@@ -37,6 +37,9 @@
../baseline/inc/cmmaplayerevent.h |../../inc/cmmaplayerevent.h
../baseline/inc/cmmasourcestream.h |../../inc/cmmasourcestream.h
../baseline/inc/cmmavideocontrol.h |../../inc/cmmavideocontrol.h
+../baseline/inc/cmmaaudioplayer.h |../../inc/cmmaaudioplayer.h
+../baseline/inc/cmmamidiplayer.h |../../inc/cmmamidiplayer.h
+../baseline/inc/cmmammfplayerbase.h |../../inc/cmmammfplayerbase.h
../baseline/inc/cmmavolumecontrol.h |../../inc/cmmavolumecontrol.h
../baseline/inc/cmmammfplayerfactory.h |../../inc/cmmammfplayerfactory.h
../baseline/inc/cmmaaudiovolumecontrol.h |../../inc/cmmaaudiovolumecontrol.h
@@ -47,16 +50,23 @@
../baseline/inc/mmmadisplaywindow.h |../../inc/mmmadisplaywindow.h
../baseline/inc/mmmaplayerfactory.h |../../inc/mmmaplayerfactory.h
../baseline/inc/mmmaplayerstatelistener.h |../../inc/mmmaplayerstatelistener.h
+../baseline/inc/mmmaplayerinstanceobserver.h |../../inc/mmmaplayerinstanceobserver.h
+../baseline/inc/mmmacallstateobserver.h |../../inc/mmmacallstateobserver.h
../baseline/inc/mmmasourcestreamlistener.h |../../inc/mmmasourcestreamlistener.h
../baseline/inc/mmmasnapshotreadycallback.h |../../inc/mmmasnapshotreadycallback.h
#ifdef RD_JAVA_NGA_ENABLED
../baseline/inc.nga/cmmavideoplayer.h |../../inc/cmmavideoplayer.h
../baseline/inc.nga/cmmasurfacewindow.h |../../inc/cmmasurfacewindow.h
+#else
+../baseline/inc.dsa/cmmadsawindow.h |../../inc/cmmadsawindow.h
+../baseline/inc.dsa/cmmavideoplayer.h |../../inc/cmmavideoplayer.h
#endif
#ifdef RD_JAVA_HTTP_EMC_ENABLED
../baseline/inc.emc/cmmamanager.h |../../inc/cmmamanager.h
+../baseline/inc.emc/cmmaemcaudioplayer.h |../../inc/cmmaemcaudioplayer.h
+../baseline/inc.emc/cmmaemcplayerbase.h |../../inc/cmmaemcplayerbase.h
#endif
// Generic configuration interface for mobilemedia cenrep settings
--- a/javauis/mmapi_akn/build/javamobilemedia.pro Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/build/javamobilemedia.pro Thu Aug 19 09:48:13 2010 +0300
@@ -24,8 +24,7 @@
DEFINES += RD_JAVA_VOLUME_CONTROL
DEFINES += RD_JAVA_OMA_DRM_V2
-INCLUDEPATH += /epoc32/include/mmf/common \
- ../animated_gif/inc \
+INCLUDEPATH += ../animated_gif/inc \
../baseline/inc \
../src_drmv2/inc \
../directcontent/inc \
@@ -69,7 +68,10 @@
SOURCES += ../baseline/src.nga/*.cpp
- LIBS += -lmediaclientvideodisplay
+ LIBS += -lmediaclientvideodisplay \
+ -lsensrvclient \
+ -lsensrvutil \
+ -lfbscli
}
else {
INCLUDEPATH += ../baseline/inc.dsa
--- a/javauis/mmapi_akn/build/javamobilemedia_0x2002DCC2.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/build/javamobilemedia_0x2002DCC2.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javamobilemedia.mmp
@@ -54,10 +54,8 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
-SYSTEMINCLUDE /epoc32/include/mmf/common
SYSTEMINCLUDE ../animated_gif/inc
SYSTEMINCLUDE ../baseline/inc
SYSTEMINCLUDE ../src_drmv2/inc
@@ -112,8 +110,7 @@
SOURCE cmmaaudiorecorderfactory.cpp
SOURCE cmmaaudiovolumecontrol.cpp
SOURCE cmmabitmapwindow.cpp
-SOURCE cmmacameraplayer.cpp
-SOURCE cmmacameraplayerfactory.cpp
+SOURCE cmmacallstatemonitor.cpp
SOURCE cmmacanvasdisplay.cpp
SOURCE cmmacontrol.cpp
SOURCE cmmadeleterefevent.cpp
@@ -143,7 +140,6 @@
SOURCE cmmaplayerproperties.cpp
SOURCE cmmaratecontrol.cpp
SOURCE cmmarecordcontrol.cpp
-SOURCE cmmasnapshot.cpp
SOURCE cmmasnapshotevent.cpp
SOURCE cmmasourcestream.cpp
SOURCE cmmasourcestreamevent.cpp
@@ -188,7 +184,10 @@
SOURCE emcsourceinfo.cpp
SOURCEPATH ../baseline/src.nga
+SOURCE cmmacameraplayer.cpp
+SOURCE cmmacameraplayerfactory.cpp
SOURCE cmmacamerawindow.cpp
+SOURCE cmmasnapshot.cpp
SOURCE cmmasurfacewindow.cpp
SOURCE cmmavideoplayer.cpp
@@ -222,6 +221,9 @@
LIBRARY apgrfx.lib
LIBRARY flogger.lib
LIBRARY mediaclientvideodisplay.lib
+LIBRARY sensrvclient.lib
+LIBRARY sensrvutil.lib
+LIBRARY fbscli.lib
LIBRARY AknIcon.lib
LIBRARY aknskins.lib
LIBRARY aknskinsrv.lib
@@ -249,7 +251,6 @@
LIBRARY eikcore.lib
LIBRARY esock.lib
LIBRARY euser.lib
-LIBRARY fbscli.lib
LIBRARY javalegacyutils.lib
LIBRARY javaremconobserver.lib
LIBRARY mediaclientvideo.lib
--- a/javauis/mmapi_akn/directcontent/inc/cmmadcdisplay.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/directcontent/inc/cmmadcdisplay.h Thu Aug 19 09:48:13 2010 +0300
@@ -60,6 +60,7 @@
void SetFullScreenL(TBool aFullScreen);
void SourceSizeChanged(const TSize& aSourceSize);
TBool IsVisible();
+ void FixUIOrientation(TBool aFix);
/**
* Gets notification that there is container to draw assigned
@@ -135,6 +136,8 @@
// Not own
MMMAGuiPlayer* iPlayer;
+
+ TBool iFixUIOrientation;
};
#endif // CMMADCDISPLAY_H
--- a/javauis/mmapi_akn/directcontent/src/cmmadcdisplay.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/directcontent/src/cmmadcdisplay.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -274,6 +274,12 @@
iWindow->SetVisible(aContainer->MdcContainerVisibility() &&
iVisible);
}
+
+ if(iFixUIOrientation)
+ {
+ iContainer->MdcFixUIOrientation(ETrue);
+ iFixUIOrientation = EFalse;
+ }
}
// interface MMMADirectContent
@@ -312,6 +318,19 @@
}
}
+void CMMADCDisplay::FixUIOrientation(TBool aFix)
+{
+ if (iContainer)
+ {
+ iContainer->MdcFixUIOrientation(aFix);
+ }
+ else
+ {
+ // fix orientation when container becomes available
+ iFixUIOrientation = aFix;
+ }
+}
+
TInt CMMADCDisplay::InitBitmapMode()
{
TInt errCode = KErrNone;
@@ -349,7 +368,8 @@
CMMADCDisplay::CMMADCDisplay(MMMAGuiPlayer* aPlayer,
CMMAEventSource* aEventSource,
- jobject aGUIObject)
+ jobject aGUIObject):
+ iFixUIOrientation(EFalse)
{
iPlayer = aPlayer;
iEventSource = aEventSource;
--- a/javauis/mmapi_akn/src_drmv2/inc/cmmadrmmetadatacontrol.h Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/src_drmv2/inc/cmmadrmmetadatacontrol.h Thu Aug 19 09:48:13 2010 +0300
@@ -21,7 +21,7 @@
#define CMMADRMMETADATACONTROL_H
// INCLUDES
-#include <mmfcontroller.h>
+#include <mmf/common/mmfcontroller.h>
#include "cmmadrmaudioplayer.h"
#include "cmmametadatacontrol.h"
--- a/javauis/mmapi_akn/src_drmv2/src/cmmadrmplayerfactory.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/src_drmv2/src/cmmadrmplayerfactory.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -19,9 +19,14 @@
// INCLUDE FILES
#include <jdebug.h>
+#ifndef RD_JAVA_S60_RELEASE_5_0
+#include <caf/cafplatform.h>
+#endif
+
+#include <caf/stringattributeset.h>
+
#include <DRMCommon.h>
#include <DRMHelper.h>
-#include <caf/stringattributeset.h>
#include "cmmadrmplayerfactory.h"
#include "cmmadrmaudioplayer.h"
--- a/javauis/mmapi_akn/volumekeys/src/cmmaglobalvolume.cpp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/mmapi_akn/volumekeys/src/cmmaglobalvolume.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -72,6 +72,7 @@
//
void CMMAGlobalVolume::AddPlayerL(CMMAPlayer* aPlayer)
{
+ DEBUG("CMMAGlobalVolume: AddPlayerL +");
// Find if the player has a volume control
CMMAVolumeControl* control = FindVolumeControl(aPlayer);
@@ -82,12 +83,19 @@
// Create new volume control and level index pair
playerHolder.iVolumeControl = control;
playerHolder.iVolumeIndex = control->AddLevelL();
+ DEBUG_INT2("CMMAGlobalVolume: AddPlayerL : iVolumeIndex = %d and iLevel = %d",playerHolder.iVolumeIndex,iLevel);
playerHolder.iPlayer = aPlayer;
// Set current volume level for the control
control->SetVolumeLevelL(playerHolder.iVolumeIndex, iLevel);
+ // To set the initial Global Volume for each player so that
+ // it will not post any event during the transition to realized state if there
+ // is no change in the global volume between player creation and realization.
+ control->InitializeGlobalVolumeLevel(iLevel);
// Add created pair to the control list
iControlList.AppendL(playerHolder);
}
+
+ DEBUG("CMMAGlobalVolume: AddPlayerL -");
}
// ---------------------------------------------------------------------------
@@ -96,6 +104,7 @@
//
void CMMAGlobalVolume::RemovePlayer(CMMAPlayer* aPlayer)
{
+ DEBUG("CMMAGlobalVolume: RemovePlayer +");
// Find if the player has a volume control
CMMAVolumeControl* control = FindVolumeControl(aPlayer);
@@ -105,11 +114,14 @@
// Check that if this type of volume control can be found from
// the control list and remove it
TInt count(iControlList.Count());
+ DEBUG_INT("CMMAGlobalVolume: RemovePlayer :No of CMMAVolumeControl instances = %d",count);
+
for (TInt i(0); i < count; i++)
{
const TMMAPlayerHolder& holder = iControlList[ i ];
if (control == holder.iVolumeControl)
{
+ DEBUG("CMMAGlobalVolume: RemovePlayer removing the instance of CMMAVolumeControl from the list");
iControlList.Remove(i);
break;
}
@@ -124,6 +136,7 @@
void CMMAGlobalVolume::VolumeUp()
{
DEBUG_INT("THREADID = %d : CMMAGlobalVolume: VolumeUp: +", RThread().Id());
+ DEBUG_INT("CMMAGlobalVolume: VolumeUp : iLevel = %d", iLevel);
// Adjust volume if midlet is in foreground and the volume level value
// is not too high, in this case it cannot be set over KMMAVolumeMaxLevel
if (iForeground->IsForeground() && (iLevel < KMMAVolumeMaxLevel))
@@ -134,6 +147,7 @@
iLevel > (KMMAVolumeMaxLevel - KMMAVolumeLevelStep) ?
KMMAVolumeMaxLevel - iLevel : iLevel + KMMAVolumeLevelStep;
// Increase level by new value
+ DEBUG_INT("CMMAGlobalVolume: VolumeUp : effective volume to be set to player = %d", level);
SetControlVolumeLevels(level);
}
DEBUG("CMMAGlobalVolume: VolumeUp: -");
@@ -146,6 +160,7 @@
void CMMAGlobalVolume::VolumeDown()
{
DEBUG_INT("THREADID = %d : CMMAGlobalVolume: VolumeDown: +", RThread().Id());
+ DEBUG_INT("CMMAGlobalVolume: VolumeDown : iLevel = %d", iLevel);
// Adjust volume if midlet is in foreground and the volume value
// is not too low, in this case it cannot be set under zero
if (iForeground->IsForeground() && (iLevel > 0))
@@ -155,6 +170,7 @@
TInt level =
iLevel < KMMAVolumeLevelStep ?
0 : iLevel - KMMAVolumeLevelStep;
+ DEBUG_INT("CMMAGlobalVolume: VolumeDown : effective volume to be set to player = %d", level);
// Decrease level by new value
SetControlVolumeLevels(level);
}
@@ -188,6 +204,7 @@
void CMMAGlobalVolume::SetControlVolumeLevels(TInt aLevel)
{
TInt count(iControlList.Count());
+ DEBUG_INT("CMMAGlobalVolume: SetControlVolumeLevels + count of controls = %d",count);
// Adjust volume for all current volume controls associated
for (TInt i(0); i < count; i++)
{
@@ -195,6 +212,7 @@
// Set new volume level for this control
TRAPD(error,
hdr.iVolumeControl->SetVolumeLevelL(hdr.iVolumeIndex, aLevel));
+ DEBUG_INT2("CMMAGlobalVolume: SetControlVolumeLevels level set to control = %d,err = %d",aLevel,error);
if (error != KErrNone)
{
hdr.iPlayer->PostStringEvent(
@@ -211,6 +229,7 @@
// in any sophisticated way so we just have to ignore it. Debug builds
// may panic in this case
TInt error = iSettingsStore->Set(KMobileMediaVolumeLevel, aLevel);
+ DEBUG_INT2("CMMAGlobalVolume::setting the new value to Settings store, value = %d, err = %d", aLevel, error);
__ASSERT_DEBUG(error == KErrNone, User::Invariant());
}
@@ -235,6 +254,7 @@
// Get level from the settings store
User::LeaveIfError(iSettingsStore->Get(KMobileMediaVolumeLevel, iLevel));
+ DEBUG_INT("CMMAGlobalVolume::ConstructL - iLevel got from cenrep = %d", iLevel);
}
// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/build/bld.inf Thu Aug 19 09:48:13 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
+javanokiasound_0x2002DCC4.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/build/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,33 @@
+<!--
+#
+# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+-->
+
+<project name="javanokiasound" default="deploy" basedir=".">
+
+ <import file="../../../build/utilities.xml"/>
+
+ <!-- Needed by the utilities.xml. See the description form the utilities.xml
+ file -->
+ <property name="javah.classnames"
+ value="com.nokia.mid.sound.Sound"/>
+
+ <target name="create.public.api.jar">
+ <omj.public.apis includes="com/nokia/mid/sound/Sound.class,
+ com/nokia/mid/sound/SoundListener.class"/>
+ </target>
+
+</project>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/build/bwins/javanokiasoundu.def Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+ ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *)
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/build/eabi/javanokiasoundu.def Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+ _Z10jni_lookupPKc @ 1 NONAME
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/build/javanokiasound.pro Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,28 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE=lib
+TARGET=javanokiasound
+CONFIG += omj java stl
+CONFIG -= qt
+
+LIBS += -lcenrepnotifhandler \
+ -lcentralrepository \
+ -lmediaclientaudio \
+ -lcommonengine \
+ -ljavautils
+
+include(../../../build/omj.pri)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/build/javanokiasound_0x2002DCC4.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,150 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Generated file - do not edit manually
+*
+*/
+
+// ==============================================================================
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
+// This file is generated by qmake and should not be modified by the
+// user.
+// Name : javanokiasound.mmp
+// ==============================================================================
+
+TARGET javanokiasound.dll
+TARGETTYPE DLL
+
+UID 0x1000008d 0x2002DCC4
+SECUREID 0x2002DCC4
+
+EPOCALLOWDLLDATA
+
+
+// Qt Macros
+MACRO UNICODE
+MACRO QT_KEYPAD_NAVIGATION
+MACRO QT_SOFTKEYS_ENABLED
+MACRO QT_USE_MATH_H_FLOATS
+MACRO RD_JAVA_SYMBIAN_TARGET
+MACRO RD_JAVA_S60_RELEASE_9_2
+MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
+MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
+MACRO RD_JAVA_STDCPPV5
+MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
+MACRO RD_JAVA_HTTP_EMC_ENABLED
+MACRO RD_JAVA_NGA_ENABLED
+MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
+MACRO RD_JAVA_OPENC_BETA_PATCH
+MACRO RD_JAVA_INSTALLERUI_ENABLED
+MACRO RD_JAVA_PREWARM
+MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
+MACRO RD_JAVA_MIDPRMS_DB
+MACRO __SYMBIAN32__
+MACRO J9EPOC32
+
+SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
+SYSTEMINCLUDE ../inc
+SYSTEMINCLUDE ../../inc
+SYSTEMINCLUDE ../../../inc
+SYSTEMINCLUDE ../src
+SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
+SYSTEMINCLUDE /epoc32/include/mw
+SYSTEMINCLUDE .
+
+SOURCEPATH ../src
+SOURCE cmidclip.cpp
+SOURCE cmidsound.cpp
+SOURCE CMIDSoundImpl.cpp
+SOURCE cmidtone.cpp
+SOURCE sound.cpp
+
+
+LIBRARY cenrepnotifhandler.lib
+LIBRARY centralrepository.lib
+LIBRARY mediaclientaudio.lib
+LIBRARY commonengine.lib
+LIBRARY javautils.lib
+LIBRARY libpthread.lib
+LIBRARY libstdcppv5.lib
+LIBRARY libc.lib
+LIBRARY libm.lib
+LIBRARY euser.lib
+LIBRARY libdl.lib
+LIBRARY cone.lib
+LIBRARY eikcore.lib
+LIBRARY eikcoctl.lib
+LIBRARY eiksrv.lib
+LIBRARY apparc.lib
+LIBRARY avkon.lib
+LIBRARY efsrv.lib
+LIBRARY charconv.lib
+LIBRARY ws32.lib
+LIBRARY hal.lib
+LIBRARY gdi.lib
+LIBRARY apgrfx.lib
+
+CAPABILITY all -tcb
+
+OPTION CW -wchar_t on
+OPTION ARMCC --visibility_inlines_hidden
+#if defined(ARMCC_4_0)
+OPTION ARMCC --import_all_vtbl
+#endif
+OPTION GCCE -fvisibility-inlines-hidden
+
+VERSION 10.0
+
+ARMFPU softvfp
+
+PAGED
+
+BYTEPAIRCOMPRESSTARGET
+
+USERINCLUDE .
+
+#include <platform_paths.hrh>
+
+ APP_LAYER_SYSTEMINCLUDE
+
+ OS_LAYER_LIBC_SYSTEMINCLUDE
+
+ OS_LAYER_SSL_SYSTEMINCLUDE
+
+deffile ./~/javanokiasound.def
+
+ SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
+
+SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
+
+SOURCEPATH /epoc32/build/jrt/javabuild/javanokiasound
+
+SOURCE lookup.cpp
+
+SOURCEPATH /epoc32/build/jrt/javabuild/javanokiasound
+
+SOURCE jxe.c
+
+#ifdef WINSCW
+
+LIBRARY ewsd.lib
+
+#endif
+
+STDCPP
+
+#ifdef WINSCW
+DEFFILE ./bwins/javanokiasound.def
+#elif defined EABI
+DEFFILE ./eabi/javanokiasound.def
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/inc/CMIDClip.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class implements wav playing.
+*
+*/
+
+
+#ifndef CMIDCLIP_H
+#define CMIDCLIP_H
+
+// INCLUDES
+#include <e32base.h>
+#include <mdaaudiosampleplayer.h>
+
+#include "CMIDSoundImpl.h"
+
+// FORWARD DECLARATIONS
+class MMIDEventSender;
+
+// CLASS DEFINITION
+/**
+ * This class implements wav playing.
+ *
+ */
+NONSHARABLE_CLASS(CMIDClip): public CMIDSoundImpl,
+ public MMdaAudioPlayerCallback
+{
+public:
+
+ static CMIDClip* NewL(const TDesC8* aData, MMIDEventSender* aEventSender);
+ // Destructor
+ ~CMIDClip();
+
+protected:
+
+ // C++ constructor
+ CMIDClip(MMIDEventSender* aEventSender);
+ // Second phase
+ void ConstructL(const TDesC8* aData);
+
+public:
+
+ virtual TInt Play(TInt aLoop);
+ virtual void Stop();
+ virtual void SetVolume(TInt aVolume);
+ virtual TInt Volume();
+ virtual void Release();
+
+public: // from MMdaAudioPlayerCallback
+ void MapcInitComplete(TInt aError,
+ const TTimeIntervalMicroSeconds& aDuration);
+ void MapcPlayComplete(TInt aError);
+
+private:
+
+ HBufC8* iClip;
+ CMdaAudioPlayerUtility* iMdaAudioPlayerUtility;
+ TInt iLoops;
+ TInt iVolume;
+};
+
+#endif // CMIDCLIP_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/inc/CMIDSound.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,106 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Wrapper for CMIDClip and CMIDTone class initialisations.
+*
+*/
+
+
+// INCLUDES
+#include <mevents.h>
+#include <e32base.h>
+#include <cenrepnotifyhandler.h>
+#include "MMIDEventSender.h"
+#include "functionserver.h"
+
+// FORWARD DECLARATIONS
+class CMIDSoundImpl;
+
+// CLASS DEFINITION
+/**
+ * CMIDSound is a wrapper that handles which class is
+ * wanted to be initialised, CMIDClip or CMIDTone
+ *
+ */
+NONSHARABLE_CLASS(CMIDSound):
+ public CBase, MCenRepNotifyHandlerCallback, MMIDEventSender, java::util::FunctionServer
+{
+
+public:
+
+ // Destructor
+ ~CMIDSound();
+
+public: // From MCenRepNotifyHandlerCallback
+ /**
+ * Notifies this class about changes in the audio enable status
+ */
+ void HandleNotifyInt(TUint32 aId, TInt aNewValue);
+
+public: // From MMIDEventSender
+ /**
+ * Sends event to Java SoundListener.
+ * @since 3.0
+ * @param aEventType Type of the event to send
+ */
+ void SendEvent(TInt aEventType);
+
+protected:
+
+ // C++ default constructor
+ CMIDSound();
+
+private:
+ TBool IsAudioEnabled();
+
+public:
+
+ static CMIDSound* NewL(JNIEnv& aJni, jobject aSound);
+ void SetBeep(TInt aFreq, TInt64 aDuration);
+ TInt Init(TInt aType, const TDesC8* aData);
+ void InitL(TInt aType, const TDesC8* aData);
+ TInt InitProfileListener();
+ void InitProfileListenerL();
+ TInt Play(TInt aLoop);
+ TInt DoPlay(TInt aLoop);
+ void Resume();
+ void DoResume();
+ void Stop();
+ void DoStop();
+ TInt SoundVolume();
+ TInt Volume();
+ void SetVolume(TInt aVolume);
+ void DoSetVolume(TInt aVolume);
+ TInt State();
+ TInt PlayerState();
+ void Release();
+ void DoRelease();
+
+
+private:
+
+ CMIDSoundImpl* iMIDSound;
+ TInt iFreq;
+ TInt64 iDur;
+ TInt iSource;
+ TInt iRealVolume;
+
+ // owned, informs about changes in iRepository
+ CCenRepNotifyHandler* iProfileListener;
+
+ // owned, current profile
+ CRepository* iRepository;
+
+ TInt iHandle;
+};
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/inc/CMIDSoundEvent.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Class for sound related events.
+*
+*/
+
+
+#ifndef CMIDSOUNDEVENT_H
+#define CMIDSOUNDEVENT_H
+
+#include <jni.h>
+
+// CLASS DEFINITION
+
+/**
+ * Class for sound related events.
+ */
+NONSHARABLE_CLASS(CMIDSoundEvent)
+{
+public: // constructor
+ CMIDSoundEvent(TInt aEvent);
+
+public: // new methods
+ /**
+ * Setter for listener
+ * @param aListener this event will be sent to this listener
+ */
+ void SetListener(jobject aListener);
+
+ /**
+ * Setter for method ID
+ * @param aMethodID this event will be sent by calling this method
+ */
+ void SetMethodID(jmethodID aMethodID);
+
+ /**
+ * Adds a global reference to peer object, this reference is
+ * removed when the event is dispatched. This prevents peer
+ * object from being deleted by garbage collector before the
+ * event has been dispatched.
+ */
+ void AddGlobalRef(JavaVM* javaVM);
+
+
+private:
+ void Dispatch(JNIEnv& aJni);
+
+private:
+ jobject iListener;
+ jmethodID iMethodID;
+ TInt iEvent;
+ jobject iGlobalRef;
+ // Number of times the global reference has been added.
+ // The actual global reference is removed when the counter reaches zero.
+ TInt iRefCount;
+
+};
+
+
+#endif // CMIDSOUNDEVENT_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/inc/CMIDSoundImpl.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Interface and a base class for CMIDClip and CMIDTone.
+*
+*/
+
+
+
+#ifndef CMIDSOUNDIMPL_H
+#define CMIDSOUNDIMPL_H
+
+// INCLUDES
+#include <e32base.h>
+
+// FORWARD DECLARATIONS
+class MMIDEventSender;
+
+
+// CLASS DEFINITION
+/**
+ * This class is interface and a base class for CMIDClip and CMIDTone
+ *
+ */
+NONSHARABLE_CLASS(CMIDSoundImpl): public CBase
+{
+
+public:
+
+ enum TState
+ {
+ ENotReady,
+ EReadyToPlay,
+ EPlaying,
+ ENotSupported,
+ EInitialising
+ };
+
+public:
+
+ // destructor
+ ~CMIDSoundImpl();
+
+protected:
+
+ void ConstructL();
+
+ // C++ constructor
+ CMIDSoundImpl(MMIDEventSender* aEventSender);
+
+public:
+
+ void Resume();
+
+ virtual TInt Play(TInt aLoop) = 0;
+ virtual void Stop() = 0;
+ virtual void SetVolume(TInt aVolume) = 0;
+ virtual TInt Volume() = 0;
+ virtual void Release() = 0;
+
+ inline TInt State() const;
+
+protected:
+
+
+ TInt iState;
+
+ // true if playback has been started.
+ TBool iPlayed;
+
+ CActiveSchedulerWait* iSchedulerWait;
+
+ // events are sent through this interface
+ MMIDEventSender* iEventSender;
+
+};
+
+inline TInt CMIDSoundImpl::State() const
+{
+ return iState;
+};
+
+#endif // CMIDSOUNDIMPL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/inc/CMIDTone.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,74 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class implements beep playing and OTA ringingtone playing.
+*
+*/
+
+
+#ifndef CMIDTONE_H
+#define CMIDTONE_H
+
+// INCLUDES
+#include <e32base.h>
+#include <mdaaudiotoneplayer.h>
+
+#include "CMIDSoundImpl.h"
+
+// FORWARD DECLARATIONS
+class MMIDEventSender;
+
+// CLASS DEFINITION
+/**
+ * This class implements beep playing and OTA ringingtone playing.
+ *
+ */
+NONSHARABLE_CLASS(CMIDTone): public CMIDSoundImpl, public MMdaAudioToneObserver
+{
+public:
+
+ static CMIDTone* NewL(TInt aFreq, TInt64 aDuration,
+ MMIDEventSender* aEventSender);
+ static CMIDTone* NewL(const TDesC8& aData, MMIDEventSender* aEventSender);
+ // Destructor
+ ~CMIDTone();
+
+protected:
+
+ // C++ constructor
+ CMIDTone(MMIDEventSender* aEventSender);
+ // Second phase
+ void ConstructL(TInt aFreq, TInt64 aDuration);
+ void ConstructL(const TDesC8& aData);
+
+public:
+
+ virtual TInt Play(TInt aLoop);
+ virtual void Stop();
+ virtual void SetVolume(TInt aVolume);
+ virtual TInt Volume();
+ virtual void Release();
+
+public: // from MMdaAudioToneObserver
+
+ void MatoPrepareComplete(TInt aError);
+ void MatoPlayComplete(TInt aError);
+
+private:
+
+ TInt iFreq;
+ TInt64 iDuration;
+ CMdaAudioToneUtility* iMdaAudioToneUtility;
+};
+
+#endif // CMIDTONE_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/inc/MMIDEventSender.h Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: SoundImpl instances can send events through this interface
+*
+*/
+
+
+
+#ifndef MMIDEVENTSENDER_H
+#define MMIDEVENTSENDER_H
+
+/**
+* SoundImpl instances cand send events through this interface.
+* This interface has only one method, SendEvent(), which can be used
+* for sending all types of sound events.
+*
+* @since 3.0
+*/
+NONSHARABLE_CLASS(MMIDEventSender)
+{
+
+public: // New functions
+
+ /**
+ * Sends event to Java SoundListener.
+ * @since 3.0
+ * @param aEventType Type of the event to send
+ */
+ virtual void SendEvent(TInt aEventType) = 0;
+
+protected:
+
+ /**
+ * C++ default constructor.
+ */
+ MMIDEventSender() { }
+
+private:
+
+ // Prohibit copy constructor if not deriving from CBase.
+ MMIDEventSender(const MMIDEventSender&) { }
+ // Prohibit assigment operator if not deriving from CBase.
+ MMIDEventSender& operator=(const MMIDEventSender&)
+ {
+ return *this;
+ }
+
+};
+
+#endif // MMIDEVENTSENDER_H
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/javasrc/com/nokia/mid/sound/Sound.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,698 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Provides Sound API for playing tones and digitized audio.
+*
+*/
+
+
+package com.nokia.mid.sound;
+
+import com.nokia.mj.impl.rt.support.Finalizer;
+import java.util.Vector;
+import com.nokia.mj.impl.utils.Logger;
+import java.lang.Thread;
+
+/**
+ * <p>
+ * Provides simple Sound API for playing tones and digitized audio.
+ * </p><p>
+ * Since MIDP doesn't have any Sound API for games there is a need
+ * for proprietary sound extension to support devices audio
+ * capabilities. Every implementation has capability to produce tone
+ * sounds (e.g. ringing tones), this is the minimum support. Currently
+ * some products support or will support also digitized audio formats.
+ * The Game sound API will support both buzzer and digitized audio.
+ * Buzzer must be supported by all implementations. If implementation
+ * doesn't have buzzer the buzzer tones are emulated.
+ * </p>
+ * Since implementations have different audio capabilities,
+ * application can query which audio formats are supported by
+ * implementation by calling {@link #getSupportedFormats()}.
+ * <p>
+ * All implementations need to support at least tone based sounds
+ * (type FORMAT_TONE) via {@link #Sound(int freq, long duration)} and
+ * {@link #init(int freq, long duration)}. In addition all implementations
+ * must support Smart messaging ringingtone format (type FORMAT_TONE)
+ * via {@link #Sound(byte[] data, int type)} and
+ * {@link #init(byte[] data, int type) }.
+ * <p>
+ * Note that there is also work going on with Multimedia API that
+ * is done in JCP as
+ * <a href="http://www.jcp.org/jsr/detail/135.jsp">JSR 135</a>.
+ * The standard Multimedia API
+ * will replace the proprietary Game Sound API when it is ready. However
+ * Sound API will be supported also later on but probably it will be
+ * stated as deprecated.
+ * </p>
+ * @version 1.1
+ * @see com.nokia.mid.ui.DeviceControl
+ * @since 1.0
+ */
+
+public class Sound
+{
+
+ /**
+ * Tone based format is used.
+ *
+ * init(int freq, int duration) puts sound into this format.
+ * @since 1.0
+ *
+ */
+ public static final int FORMAT_TONE = 1;
+
+ /**
+ * Content is in WAV format.
+ * @since 1.0
+ *
+ */
+ public static final int FORMAT_WAV = 5;
+
+ /**
+ * Sound is playing.
+ * @since 1.0
+ *
+ */
+ public static final int SOUND_PLAYING = 0;
+
+ /**
+ * Sound is stopped.
+ * @since 1.0
+ *
+ */
+ public static final int SOUND_STOPPED = 1;
+
+ /**
+ * Sound is uninitialized (released).
+ * @since 1.0
+ */
+ public static final int SOUND_UNINITIALIZED = 3;
+
+ /**
+ * Sound is reinitialising
+ */
+ private static final int SOUND_REINITIALISING = 4;
+
+ private static final int FORMAT_BEEP = 2;
+ private static final int NOT_SUPPORTED_ERROR = 3;
+
+ private static final int ERR_NOT_READY = -18;
+ private static final int ERR_ARGUMENT = -6;
+
+ private int iHandle;
+
+ private Finalizer iFinalizer;
+ private int iCurrentType;
+ private int iState;
+ private int iGain = -1;
+
+ Vector iSoundListeners = new Vector();
+
+ private static Sound iPlayingSound;
+
+ static
+ {
+ com.nokia.mj.impl.rt.support.Jvm.loadSystemLibrary("javanokiasound");
+ }
+
+ /**
+ * Constructors initialize the Sound object so that it is ready for
+ * playback. This constructor is used for initializing Sound
+ * object based on byte array data. The data should contain the data
+ * presented in the data format specified by type parameter. The Sound
+ * class defines also generally supported types as constants.
+ * <p>
+ * All implementations need to support at least Nokia
+ * Smart Messaging, Over the Air (OTA) ringingtone format.
+ * The type of this format is FORMAT_TONE.
+ * <p>
+ * Note: some implementations can't throw exceptions about
+ * sound data being corrupted or illegal during construction.
+ * This will result that IllagalArgumentException is delayed until
+ * play(int loop) method is called. Applications thus need to except
+ * that IllegalArgumentException is thrown in this method or during
+ * play method call.
+ * <p>
+ * @throws java.lang.IllegalArgumentException if the data can not be
+ recognized to
+ * given type or the type is unsupported or unknown
+ * @throws java.lang.NullPointerException if the data is null
+ * @since 1.0
+ *
+ */
+ public Sound(byte[] data, int type)
+ {
+ Logger.LOG(Logger.EJavaUI, Logger.EInfo, "Sound Constructor");
+ iFinalizer = registerForFinalization();
+
+ iHandle = _create();
+
+ iState = SOUND_UNINITIALIZED;
+
+ init(data, type);
+ }
+
+ /**
+ * Constructors initialize the Sound object so that it is ready for
+ * playback. Sound is initialized as a simple tone based sound.
+ * <p>
+ * See method {@link #init(int freq, long duration)} for
+ * freq value descriptions. See also a note on exceptions semantics in
+ * {@link #init(int freq, long duration)}.
+ *
+ * @param freq a frequency value
+ * @param duration the duration of the tone in milliseconds
+ * @throws java.lang.IllegalArgumentException if parameter values are
+ * illegal, freq is not in given range or duration is negative or zero
+ * @since 1.0
+ */
+ public Sound(int freq, long duration)
+ {
+
+ iFinalizer = registerForFinalization();
+ iHandle = _create();
+
+ iState = SOUND_UNINITIALIZED;
+
+ init(freq, duration);
+ }
+
+ /**
+ * Called when this object is finalized, frees native resources
+ */
+
+ public Finalizer registerForFinalization()
+ {
+
+ return new Finalizer()
+ {
+ public void finalizeImpl()
+ {
+ doFinalize();
+ }
+ };
+ }
+
+ void doFinalize()
+ {
+
+ if (iFinalizer == null)
+ {
+ return;
+ }
+ iFinalizer = null;
+
+ if (iHandle > 0)
+ {
+ _dispose(iHandle);
+ }
+ }
+
+ /**
+ * Releases audio resources reserved by this object. After object
+ * is released it goes to uninitialized state. This method should
+ * be called when Sound object is not needed anymore.
+ * @since 1.0
+ */
+ public void release()
+ {
+ if ((iState != SOUND_UNINITIALIZED) &&
+ (iState != SOUND_REINITIALISING))
+ {
+ iState = SOUND_REINITIALISING;
+ soundStateChanged(SOUND_UNINITIALIZED);
+ }
+
+ _release(iHandle);
+
+ iState = SOUND_UNINITIALIZED;
+
+ }
+
+ /**
+ * Initializes Sound to play a simple beep.
+ * <p>
+ * Note: some implementations may not support the full frequency
+ * scale defined in table below. They will throw
+ * IllegalArgumentException instead for unsupported values. The
+ * exception may also be delayed
+ * until the play(int loop) method is called.
+ * <p>
+ * Following table describes some freq argument
+ * values:
+ * <pre>
+ * Description Frequency
+ * Freq off 0
+ * Ring freq A0 220
+ * Ring freq B0b 233
+ * Ring freq B0 247
+ * Ring freq C0 262
+ * Ring freq D0b 277
+ * Ring freq D0 294
+ * Ring freq E0b 311
+ * Ring freq E0 330
+ * Ring freq F0 349
+ * Ring freq G0b 370
+ * Ring freq G0 392
+ * Ring freq A1b 416
+ * Ring freq A1 440
+ * Ring freq B1b 466
+ * Ring freq B1 494
+ * Ring freq C1 523
+ * Ring freq D1b 554
+ * Ring freq D1 587
+ * Ring freq E1b 622
+ * Ring freq E1 659
+ * Ring freq F1 698
+ * Ring freq G1b 740
+ * Ring freq G1 784
+ * Ring freq A2b 831
+ * Ring freq A2 880
+ * Ring freq B2b 932
+ * Ring freq B2 988
+ * Ring freq C2 1047
+ * Ring freq D2b 1109
+ * Ring freq D2 1175
+ * Ring freq E2b 1245
+ * Ring freq E2 1319
+ * Ring freq F2 1397
+ * Ring freq G2b 1480
+ * Ring freq G2 1568
+ * Ring freq A3b 1661
+ * Ring freq A3 1760
+ * Ring freq B3b 1865
+ * Ring freq B3 1976
+ * Ring freq C3 2093
+ * Ring freq D3b 2217
+ * Ring freq D3 2349
+ * Ring freq E3b 2489
+ * Ring freq E3 2637
+ * Ring freq F3 2794
+ * Ring freq G3b 2960
+ * Ring freq G3 3136
+ * Ring freq A4b 3322
+ * Ring freq A4 3520
+ * Ring freq B4b 3729
+ * Ring freq B4 3951
+ * Ring freq C4 4186
+ * Ring freq D4b 4434
+ * Ring freq D4 4698
+ * Ring freq E4b 4978
+ * Ring freq E4 5274
+ * Ring freq F4 5588
+ * Ring freq G4b 5920
+ * Ring freq G4 6272
+ * Ring freq A5b 6644
+ * Ring freq A5 7040
+ * Ring freq B5b 7458
+ * Ring freq B5 7902
+ * Ring freq C5 8372
+ * Ring freq D5b 8870
+ * Ring freq D5 9396
+ * Ring freq E5b 9956
+ * Ring freq E5 10548
+ * Ring freq F5 11176
+ * Ring freq G5b 11840
+ * Ring freq G5 12544
+ * Ring freq A6b 13288
+ *
+ * </pre>
+ *
+ * @param duration length of the beep in milliseconds
+ * @param freq frequency to be played
+ * @throws java.lang.IllegalArgumentException if parameter values are
+ * illegal, freq is not in given range or duration is negative or zero
+ * @since 1.0
+ */
+ public void init(int freq, long duration)
+ {
+ if (duration < 1 || duration > 10000000)
+ {
+ throw(new IllegalArgumentException(
+ "Bad duration value, must be 1-10000000"));
+ }
+ if (freq < 0 || freq > 15000)
+ {
+ throw(new IllegalArgumentException(
+ "Bad frequency value, must be 0-15000"));
+ }
+ // if the uninitialised event is sent from native side, it reaches
+ // listener too late in TCK test sound8004, thus we send the event
+ // already here
+ if ((iState != SOUND_UNINITIALIZED) &&
+ (iState != SOUND_REINITIALISING))
+ {
+ iState = SOUND_REINITIALISING;
+ soundStateChanged(SOUND_UNINITIALIZED);
+ } // end of if (iState != SOUND_UNINITIALIZED)
+
+ iCurrentType = FORMAT_BEEP;
+ int err = _init(iHandle, iCurrentType, null, freq, duration);
+ if (err == ERR_NOT_READY)
+ {
+ throw new RuntimeException(Integer.toString(err));
+ }
+ else if (err == ERR_ARGUMENT)
+ {
+ throw new IllegalArgumentException("Data is invalid");
+ }
+ iState = SOUND_STOPPED;
+ }
+
+ /**
+ * Initializes Sound object based on byte
+ * array data. The data should contain the data presented in the data
+ * format specified by type parameter. The Sound class defines also
+ * generally supported types as constants.
+ * <p>
+ * All implementations need to support at least Nokia
+ * Smart Messaging, Over the Air (OTA) ringingtone format.
+ * The type of this format is FORMAT_TONE.
+ * <p>
+ * Note: some implementations can't throw exceptions about
+ * sound data being corrupted or illegal during this method call.
+ * This will result that IllagalArgumentException is delayed until
+ * play(int loop) method is called. Applications thus need to except
+ * that IllegalArgumentException is thrown in this method or during
+ * play method call.
+ * <p>
+ * @param data a byte array containing the data to be played
+ * @param type type of the audio
+ * @throws java.lang.IllegalArgumentException if the data can not be
+ recognized to
+ * given type or the type is unsupported or unknown
+ * @throws java.lang.NullPointerException if the data is null
+ * @since 1.0
+ */
+ public void init(byte[] data, int type)
+ {
+ if (!(type == FORMAT_WAV || type == FORMAT_TONE))
+ {
+ throw(new IllegalArgumentException("Type is not supported"));
+ }
+ if (data == null)
+ {
+ throw(new NullPointerException("Data is null"));
+ }
+
+ if ((iState != SOUND_UNINITIALIZED) &&
+ (iState != SOUND_REINITIALISING))
+ {
+ iState = SOUND_REINITIALISING;
+ soundStateChanged(SOUND_UNINITIALIZED);
+ } // end of if (iState != SOUND_UNINITIALIZED)
+
+ iCurrentType = type;
+ int err = _init(iHandle, iCurrentType, data, 0, 0);
+ if (err == ERR_NOT_READY || err == ERR_ARGUMENT )
+ {
+ throw new IllegalArgumentException("Data is invalid");
+ }
+
+ iState = SOUND_STOPPED;
+ }
+
+
+ /**
+ * Get the current state of the Sound object.
+ *
+ * @return current state, SOUND_PLAYING, SOUND_STOPPED or
+ SOUND_UNINITIALIZED
+ * @since 1.0
+ *
+ */
+ public int getState()
+ {
+ if (iState == SOUND_REINITIALISING)
+ {
+ return SOUND_UNINITIALIZED;
+ }
+
+ iState = _getState(iHandle);
+ switch (iState)
+ {
+ case(0): // ENotReady
+ case(4): // EInitialising
+ iState = SOUND_UNINITIALIZED;
+ break;
+ case(1): // EReadyToPlay
+ iState = SOUND_STOPPED;
+ break;
+ case(2): // EPlaying
+ iState = SOUND_PLAYING;
+ break;
+ default:
+ }
+ return iState;
+ }
+
+ /**
+ * This method is used for starting the playback from the beginning of a
+ * sound object. The loop parameter defined the loop count for playback.
+ * Argument zero (0) means continuos looping. For uninitialized sound the
+ * play method doesn't do anything and silently returns. For stopped and
+ * playing sounds the playback starts from beginning of the sound with new
+ * looping information.
+ * <p>
+ * This method will throw IllegalStateException if playback cannot be
+ * started since all channels are in use, or playback is not possible
+ * because there is more higher priority system sounds being played.
+ * <p>
+ * If Sound playback is possible this method will return immediately and
+ * thus will not block the calling thread during the playback. If any error
+ * that prevents the playback is encountered during the playback, the
+ * playback is silently stopped as if called to the stop method.
+ *
+ * @param number number of times audio is played. Value 0 plays audio in
+ * continous loop.
+ * @throws java.lang.IllegalStateException if the sound object cannot be
+ * played because all the channels are already in use.
+ * @throws java.lang.IllegalArgumentException if the loop value is negative,
+ * or if sound values/date is illegal or corrupted.
+ * @since 1.0
+ *
+ */
+ public void play(int loop) throws IllegalArgumentException
+ {
+ if (loop < 0)
+ {
+ throw(new IllegalArgumentException("Negative loop value"));
+ }
+ if (iState == SOUND_REINITIALISING)
+ {
+ return;
+ } // end of if (iState == SOUND_REINITIALISING)
+
+ if (iPlayingSound != null)
+ {
+ if (iPlayingSound.getState() == SOUND_PLAYING)
+ {
+ iPlayingSound.stop();
+ }
+ } // end of if (iPlayingSound != null)
+
+ int error = _play(iHandle, loop);
+ if ((error == NOT_SUPPORTED_ERROR))
+ {
+ throw(new IllegalArgumentException("Sound is not supported"));
+ }
+ iPlayingSound = this;
+ }
+
+ /**
+ * The method will stop the sound playback, storing the current position.
+ * For sound that has never been started (may be uninitialized), or is
+ * currently being stopped the method call doesn't do anything and returns
+ * silently.
+ *
+ * Note that for tone based sounds it is not possible to resume from
+ * position the sound was stopped at, to be specific, stop will reset
+ * the position to the beginning of the sound.
+ * @since 1.0
+ */
+ public void stop()
+ {
+ if (iState == SOUND_REINITIALISING)
+ {
+ return;
+ } // end of if (iState == SOUND_REINITIALISING)
+ _stop(iHandle);
+ }
+
+ /**
+ * The method will continue the stopped sound object from the position it
+ * was stopped to. For sound that has never been started (may be
+ * uninitialized), or is currently being played the method call doesn't
+ * do anything.
+ * <p>
+ * Note: For tone based sounds the resume starts the sound from the
+ * beginning of the sound clip.
+ * @since 1.0
+ *
+ */
+ public void resume()
+ {
+ if (iState == SOUND_REINITIALISING)
+ {
+ return;
+ } // end of if (iState == SOUND_REINITIALISING)
+ _resume(iHandle);
+ }
+
+ /**
+ * Sets the gain for the sound object. The gain is a value between
+ * 0 and 255. Implementation scales the gain value to the limits it
+ * supports. Notice that any gain value > 0 should result a gain
+ * value > 0. If the gain is smaller than this minimum value then
+ * gain is set to 0, if the gain greater than this maximum value
+ * then the gain is set to maximum value (255).
+ *
+ * @param gain gain value: 0 - 255
+ * @throws java.lang.IllegalArgumentException if the gain not 0 - 255
+ * @since 1.0
+ */
+ public void setGain(int gain)
+ {
+ if (iState == SOUND_REINITIALISING)
+ {
+ return;
+ } // end of if (iState == SOUND_REINITIALISING)
+ if (gain < 0)
+ {
+ gain = 0;
+ }
+ else if (gain > 255)
+ {
+ gain = 255;
+ }
+ iGain = gain;
+ _setVolume(iHandle, iGain);
+ }
+
+ /**
+ * Get the gain (or volume) of Sound object. The gain is a value
+ * between 0 and 255. System returns a scaled value based on the
+ * limits it supports. Notice that any system gain value > 0 should
+ * return a gain value > 0.
+ *
+ * @return gain value 0 - 255
+ * @since 1.0
+ *
+ */
+ public int getGain()
+ {
+ if (iGain == -1)
+ {
+ return _volume(iHandle);
+ }
+ // we have previously set gain
+ return iGain;
+ }
+
+ /**
+ * Returns number of concurrent sounds the device can play for
+ * specific audio type. Returns 1 if only one sound can be played
+ * at a time. Notice that most types use same channel resources.
+ * @return total number of available channels.
+ * @param type the media type
+ * @throws java.lang.IllegalArgumentException if the type is unsupported
+ * or unknown
+ * @since 1.0
+ */
+ public static int getConcurrentSoundCount(int type)
+ {
+ if ((type != FORMAT_TONE) && (type != FORMAT_WAV))
+ {
+ throw(new IllegalArgumentException("Type is not supported"));
+ }
+
+ return 1;
+ }
+
+ /**
+ * Returns the supported audio formats as an int array.
+ *
+ * @return an array containing supported audio formats as
+ * int values (e.g. FORMAT_TONE, FORMAT_WAV),
+ * or an empty array if no audio formats are supported.
+ * @since 1.0
+ */
+ static public int[] getSupportedFormats()
+ {
+ return(new int[] { FORMAT_TONE, FORMAT_WAV });
+ }
+
+ /**
+ * Registeres a listener for playback state notifications.
+ * @see com.nokia.mid.sound.SoundListener
+ * @param listener a listener that is notified when state
+ * changes occur or null if listener is to be
+ * removed.
+ * @since 1.0
+ *
+ */
+ public void setSoundListener(SoundListener listener)
+ {
+ iSoundListeners.addElement(listener);
+ }
+
+ /**
+ * Callback method when sound state changes
+ *
+ */
+ public void soundStateChanged(final int event)
+ {
+ /*
+ for(int i = 0; i < iSoundListeners.size(); i++)
+ {
+ ((SoundListener)iSoundListeners.elementAt(i)).soundStateChanged(this, event);
+ }
+ */
+ //Notify SoundState Listeners in a separate thread, so that application doesn't
+ //block main thread
+ new Thread(new Runnable()
+ {
+ public void run()
+ {
+ notifySoundStateListeners(event);
+ }
+ }).start();
+ }
+
+ /**
+ * Notify Sound State Listeners
+ */
+ public synchronized void notifySoundStateListeners(int event)
+ {
+ for (int i = 0; i < iSoundListeners.size(); i++)
+ {
+ ((SoundListener)iSoundListeners.elementAt(i)).soundStateChanged(this, event);
+ }
+ }
+
+ private native void _dispose(int aHandle);
+ private native int _create();
+ private native int _init(int aHandle, int aType,
+ byte[] aData,
+ int aFrequency, long aDuration);
+ private native void _release(int aHandle);
+ private native int _play(int aHandle, int aLoop);
+ private native void _stop(int aHandle);
+ private native void _resume(int aHandle);
+ private native void _setVolume(int aHandle, int aVolume);
+ private native int _volume(int aHandle);
+ private native int _getState(int aHandle);
+
+} //End of Sound class
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/javasrc/com/nokia/mid/sound/SoundListener.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Interface indicating changes in the playback state.
+*
+*/
+
+
+package com.nokia.mid.sound;
+
+/**
+ * <p>
+ * This interface is used by applications which need to receive events
+ * that indicate changes in the playback state of the Sound objects.
+ * </p>
+ * @see com.nokia.mid.sound.Sound
+ * @version 1.1
+ * @since 1.0
+ */
+
+public interface SoundListener
+{
+
+ /**
+ * Called when playback state of an Sound has been changed.
+ * Listener will be notified when playback has been started
+ * or stopped.
+ * @see com.nokia.mid.sound.Sound#setSoundListener(SoundListener listener)
+ * @see com.nokia.mid.sound.Sound#SOUND_PLAYING
+ * @see com.nokia.mid.sound.Sound#SOUND_STOPPED
+ * @param sound the sound object this event relates to
+ * @param event the sound changed event, SOUND_PLAYING or SOUND_STOPPED
+ * @since 1.0
+ */
+ public abstract void soundStateChanged(Sound sound, int event);
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/src/CMIDSoundImpl.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Interface and a base class for CMIDClip and CMIDTone.
+*
+*/
+
+
+#include "CMIDSoundImpl.h"
+#include "CMIDSoundEvent.h"
+#include "com_nokia_mid_sound_Sound.h"
+
+CMIDSoundImpl::~CMIDSoundImpl()
+{
+
+}
+
+CMIDSoundImpl::CMIDSoundImpl(MMIDEventSender* aEventSender)
+{
+ iEventSender = aEventSender;
+}
+
+void CMIDSoundImpl::ConstructL()
+{
+
+}
+
+void CMIDSoundImpl::Resume()
+{
+ if (iPlayed && (iState == EReadyToPlay))
+ {
+ Play(1);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/src/cmidclip.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,196 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class implements wav playing.
+*
+*/
+
+
+#include <e32std.h>
+#include <AudioPreference.h>
+
+#include "com_nokia_mid_sound_Sound.h"
+#include "CMIDClip.h"
+#include "MMIDEventSender.h"
+
+namespace
+{
+const TInt KMIDMaxJavaVolume = 255;
+const TInt KMIDMinNativeVolume = 1;
+const TInt KMIDHeaderLength = 4;
+_LIT8(KMIDHeaderWAV, "RIFF");
+_LIT8(KMIDHeaderAMR, "#!AM");
+const TInt KMIDClipForever = 999999;
+const TInt KMIDMinDataSize = 4;
+}
+
+CMIDClip* CMIDClip::NewL(const TDesC8* aData, MMIDEventSender* aEventSender)
+{
+ CMIDClip* self = new(ELeave) CMIDClip(aEventSender);
+ CleanupStack::PushL(self);
+ self->ConstructL(aData);
+ CleanupStack::Pop(self);
+ return self;
+}
+
+CMIDClip::~CMIDClip()
+{
+ if (iMdaAudioPlayerUtility)
+ {
+ if (iState == EPlaying)
+ {
+ iMdaAudioPlayerUtility->Stop();
+ }
+ }
+ delete iMdaAudioPlayerUtility;
+ delete iClip;
+ delete iSchedulerWait;
+}
+
+CMIDClip::CMIDClip(MMIDEventSender* aEventSender)
+ : CMIDSoundImpl(aEventSender)
+{
+}
+
+void CMIDClip::ConstructL(const TDesC8* aData)
+{
+ CMIDSoundImpl::ConstructL();
+ iSchedulerWait = new(ELeave) CActiveSchedulerWait;
+
+ if (aData->Length() < KMIDMinDataSize)
+ {
+ iState = ENotSupported;
+ User::Leave(KErrArgument);
+ }
+
+ TPtrC8 header = aData->Left(KMIDHeaderLength);
+
+ if ((header != KMIDHeaderWAV()) && (header != KMIDHeaderAMR))
+ {
+ iState = ENotSupported;
+ User::Leave(KErrArgument);
+ }
+
+ iState = EInitialising;
+ iClip = aData->AllocL();
+ iMdaAudioPlayerUtility =
+ CMdaAudioPlayerUtility::
+ NewDesPlayerReadOnlyL(*iClip, *this,
+ KAudioPriorityRecording);
+ iMdaAudioPlayerUtility->UseSharedHeap();
+ iSchedulerWait->Start();
+}
+
+TInt CMIDClip::Play(TInt aLoop)
+{
+ __ASSERT_DEBUG(iState == EReadyToPlay, User::Invariant());
+
+ if (aLoop == 0)
+ {
+ // There is no known working method to play clip forever, so we play
+ // it for a long time instead.
+ aLoop = KMIDClipForever;
+ }
+
+ --aLoop;
+
+ // Setting repeats to 1 causes sound played twice
+ if (aLoop > 0)
+ {
+ iMdaAudioPlayerUtility->SetRepeats(aLoop, TTimeIntervalMicroSeconds(0));
+ }
+
+ iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_PLAYING);
+
+ iMdaAudioPlayerUtility->Play();
+ iState = EPlaying;
+ iPlayed = ETrue;
+ return KErrNone;
+}
+
+void CMIDClip::Stop()
+{
+ if (iState == EPlaying)
+ {
+ iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED);
+ iMdaAudioPlayerUtility->Stop();
+ iState = EReadyToPlay;
+ }
+}
+
+void CMIDClip::SetVolume(TInt aVolume)
+{
+ iVolume = aVolume;
+ TInt volume = 0;
+ if (aVolume)
+ {
+ volume = (((iMdaAudioPlayerUtility->MaxVolume()
+ - KMIDMinNativeVolume + 1)
+ * aVolume)
+ / (KMIDMaxJavaVolume + 1)) + KMIDMinNativeVolume;
+ }
+ iMdaAudioPlayerUtility->SetVolume(volume);
+}
+
+TInt CMIDClip::Volume()
+{
+ return iVolume;
+}
+
+void CMIDClip::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
+{
+ if (aError == KErrNone)
+ {
+ //Setting iVolume to max because
+ //CMdaAudioPlayerUtility doesn't have Volume()
+ iVolume = KMIDMaxJavaVolume;
+ iState = EReadyToPlay;
+ }
+ else
+ {
+ if (aError == KErrNotSupported)
+ {
+ iState = ENotSupported;
+ }
+ else
+ {
+ iState = ENotReady;
+ }
+ }
+ iSchedulerWait->AsyncStop();
+}
+
+void CMIDClip::MapcPlayComplete(TInt /*aError*/)
+{
+ iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED);
+ iState = EReadyToPlay;
+}
+
+void CMIDClip::Release()
+{
+ if (iMdaAudioPlayerUtility)
+ {
+ if (iState == EPlaying)
+ {
+ iMdaAudioPlayerUtility->Stop();
+ }
+ }
+ delete iMdaAudioPlayerUtility;
+ iMdaAudioPlayerUtility = NULL;
+ delete iClip;
+ iClip = NULL;
+ iState = ENotReady;
+}
+
+//End of File
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/src/cmidsound.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,313 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Wrapper for CMIDClip and CMIDTone class initialisations.
+*
+*/
+
+
+#include <e32std.h>
+#include <centralrepository.h>
+#include <ProfileEngineSDKCRKeys.h>
+
+#include "CMIDSound.h"
+#include "CMIDTone.h"
+#include "CMIDClip.h"
+#include "logger.h"
+#include "fs_methodcall.h"
+#include "com_nokia_mid_sound_Sound.h"
+
+
+CMIDSound* CMIDSound::NewL(JNIEnv& aJni, jobject aPeer)
+{
+ JELOG2(EJavaUI);
+
+ CMIDSound* self = new CMIDSound();
+ if (self != NULL)
+ {
+ self->attachToVm(aJni, aPeer);
+ }
+ return self;
+}
+
+CMIDSound::~CMIDSound()
+{
+ delete iMIDSound;
+
+ // CENREP
+ if (iProfileListener)
+ {
+ iProfileListener->StopListening();
+ delete iProfileListener;
+ }
+ delete iRepository;
+}
+
+void CMIDSound::HandleNotifyInt(TUint32 aId, TInt aNewValue)
+{
+ JELOG2(EJavaUI);
+ if (aId == KProEngActiveWarningTones)
+ {
+ if (iMIDSound)
+ {
+ iMIDSound->SetVolume(aNewValue == 0 ? 0 : iRealVolume);
+ }
+ }
+}
+
+void CMIDSound::SendEvent(TInt aEventType)
+{
+ /**
+ *Callback to Java
+ */
+ JELOG2(EJavaUI);
+
+ jclass javaPeerClass = mJniEnv->FindClass("com/nokia/mid/sound/Sound");
+
+ jmethodID soundStateChangeCallback = mJniEnv->GetMethodID(
+ javaPeerClass /*mJavaPeerClass */, "soundStateChanged", "(I)V");
+
+
+ mJniEnv->CallVoidMethod(mJavaPeerObject, soundStateChangeCallback,
+ aEventType);
+}
+
+CMIDSound::CMIDSound()
+ : java::util::FunctionServer("CMIDSoundFunctionServer"),
+ iMIDSound(0)
+{
+ JELOG2(EJavaUI);
+ createServerToNewThread();
+}
+
+int CMIDSound::InitProfileListener()
+{
+ TRAPD(err, CallMethodL(this, &CMIDSound::InitProfileListenerL, this));
+ return err;
+}
+
+void CMIDSound::InitProfileListenerL()
+{
+ JELOG2(EJavaUI);
+ // repository for profile
+ iRepository = CRepository::NewL(KCRUidProfileEngine);
+
+ // get notifies about changes in KProEngActiveWarningTones
+ iProfileListener = CCenRepNotifyHandler::NewL(*this,
+ *iRepository,
+ CCenRepNotifyHandler::EIntKey,
+ KProEngActiveWarningTones);
+
+ // Changes will be informed to HandleNotifyInt
+ iProfileListener->StartListeningL();
+}
+
+TBool CMIDSound::IsAudioEnabled(/*CMIDSound* aSelf*/)
+{
+ JELOG2(EJavaUI);
+ TInt isProfileOn = 0;
+ TInt error = iRepository->Get(KProEngActiveWarningTones, isProfileOn);
+ TBool retVal = EFalse;
+
+ // If getting profile status fails do not play any tones.
+ if ((isProfileOn == 1) &&
+ (error == KErrNone))
+ {
+ retVal = ETrue;
+ }
+ return retVal;
+}
+
+void CMIDSound::SetBeep(TInt aFreq, TInt64 aDuration)
+{
+ JELOG2(EJavaUI);
+ iFreq = aFreq;
+ iDur = aDuration;
+}
+
+TInt CMIDSound::Init(TInt aType, const TDesC8* aData)
+{
+ JELOG2(EJavaUI);
+ TRAPD(err, CallMethodL(this, &CMIDSound::InitL, aType, aData, this));
+ return err;
+}
+
+void CMIDSound::InitL(TInt aType, const TDesC8* aData)
+{
+ JELOG2(EJavaUI);
+
+ if (iMIDSound)
+ {
+ if (iMIDSound->State() == CMIDSoundImpl::EInitialising)
+ {
+ return;
+ }
+ if (iMIDSound->State() == CMIDSoundImpl::EReadyToPlay ||
+ iMIDSound->State() == CMIDSoundImpl::EPlaying)
+ {
+ iMIDSound->Release();
+ }
+ }
+
+ CMIDSoundImpl* soundImpl = NULL;
+ switch (aType)
+ {
+ case com_nokia_mid_sound_Sound_FORMAT_TONE: //Tone
+ {
+ soundImpl = CMIDTone::NewL(*aData, this);
+ break;
+ }
+ case com_nokia_mid_sound_Sound_FORMAT_BEEP: //Beep
+ {
+ soundImpl = CMIDTone::NewL(iFreq, iDur, this);
+ break;
+ }
+ case com_nokia_mid_sound_Sound_FORMAT_WAV: //Wav
+ {
+ soundImpl = CMIDClip::NewL(aData, this);
+ break;
+ }
+ default:
+ {
+ break;
+ }
+ }
+
+ if (soundImpl)
+ {
+ if (soundImpl->State() != CMIDSoundImpl::EReadyToPlay)
+ {
+ TInt state = soundImpl->State();
+ delete soundImpl;
+ User::Leave(KErrNotReady);
+ }
+ iRealVolume = soundImpl->Volume();
+ }
+
+ delete iMIDSound;
+ iMIDSound = soundImpl;
+}
+
+TInt CMIDSound::Play(TInt aLoop)
+{
+ JELOG2(EJavaUI);
+ TInt err = 0;
+ CallMethod(err, this, &CMIDSound::DoPlay, aLoop, this);
+ return err;
+}
+
+TInt CMIDSound::DoPlay(TInt aLoop)
+{
+ JELOG2(EJavaUI);
+
+ if (iMIDSound)
+ {
+ TInt state = iMIDSound->State();
+ if (state != CMIDSoundImpl::EReadyToPlay)
+ {
+ return state;
+ }
+ }
+ else
+ {
+ return CMIDSoundImpl::ENotSupported;
+ }
+ if (!IsAudioEnabled())
+ {
+ iMIDSound->SetVolume(0);
+ }
+ return iMIDSound->Play(aLoop);
+}
+
+void CMIDSound::Resume()
+{
+ JELOG2(EJavaUI);
+ CallMethod(this, &CMIDSound::DoResume, this);
+}
+
+void CMIDSound::DoResume()
+{
+ JELOG2(EJavaUI);
+ iMIDSound->Resume();
+}
+
+void CMIDSound::Stop()
+{
+ JELOG2(EJavaUI);
+ CallMethod(this, &CMIDSound::DoStop, this);
+}
+
+void CMIDSound::DoStop()
+{
+ JELOG2(EJavaUI);
+ iMIDSound->Stop();
+}
+
+TInt CMIDSound::SoundVolume()
+{
+ JELOG2(EJavaUI);
+ TInt result = 0;
+ CallMethod(result, this, &CMIDSound::Volume, this);
+ return result;
+}
+
+TInt CMIDSound::Volume()
+{
+ JELOG2(EJavaUI);
+ return iMIDSound->Volume();
+}
+
+void CMIDSound::SetVolume(TInt aVolume)
+{
+ JELOG2(EJavaUI);
+ CallMethod(this, &CMIDSound::DoSetVolume, aVolume, this);
+}
+
+void CMIDSound::DoSetVolume(TInt aVolume)
+{
+ JELOG2(EJavaUI);
+ iRealVolume = aVolume;
+ TInt currentState = iMIDSound->State();
+ if ((currentState == CMIDSoundImpl::EReadyToPlay) ||
+ (currentState == CMIDSoundImpl::EPlaying))
+ {
+ iMIDSound->SetVolume(IsAudioEnabled() ? aVolume : 0);
+ }
+}
+
+
+TInt CMIDSound::PlayerState()
+{
+ JELOG2(EJavaUI);
+ TInt result = 0;
+ CallMethod(result, this, &CMIDSound::State, this);
+ return result;
+}
+
+TInt CMIDSound::State()
+{
+ JELOG2(EJavaUI);
+ return iMIDSound->State();
+}
+
+void CMIDSound::Release()
+{
+ JELOG2(EJavaUI);
+ CallMethod(this, &CMIDSound::DoRelease, this);
+}
+
+void CMIDSound::DoRelease()
+{
+ JELOG2(EJavaUI);
+ iMIDSound->Release();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/src/cmidtone.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,244 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: This class implements beep playing and OTA ringingtone playing.
+*
+*/
+
+
+#include <e32std.h>
+#include <e32svr.h>
+
+#include "com_nokia_mid_sound_Sound.h"
+#include "CMIDTone.h"
+#include "MMIDEventSender.h"
+
+namespace
+{
+const TInt KMIDMaxJavaVolume = 255;
+const TInt KMIDMinNativeVolume = 1;
+const TInt KMIDStopSleepTime = 10000;
+const TInt KMIDMicrosInMilli = 1000;
+const TInt KMIDMinDataLength = 4;
+const TInt KMIDLoopForever = 999999;
+}
+
+CMIDTone* CMIDTone::NewL(TInt aFreq, TInt64 aDuration,
+ MMIDEventSender* aEventSender)
+{
+ CMIDTone* self = new(ELeave) CMIDTone(aEventSender);
+ CleanupStack::PushL(self);
+ self->ConstructL(aFreq, aDuration);
+ CleanupStack::Pop(self);
+ return self;
+}
+
+CMIDTone* CMIDTone::NewL(const TDesC8& aData, MMIDEventSender* aEventSender)
+{
+ CMIDTone* self = new(ELeave) CMIDTone(aEventSender);
+ CleanupStack::PushL(self);
+ self->ConstructL(aData);
+ CleanupStack::Pop(self);
+ return self;
+}
+
+
+CMIDTone::~CMIDTone()
+{
+ if (iMdaAudioToneUtility)
+ {
+ if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityNotReady)
+ {
+ iMdaAudioToneUtility->CancelPrepare();
+ }
+ else if (iMdaAudioToneUtility->State()
+ == EMdaAudioToneUtilityPlaying)
+ {
+ iMdaAudioToneUtility->CancelPlay();
+ }
+ }
+ delete iMdaAudioToneUtility;
+ delete iSchedulerWait;
+}
+
+CMIDTone::CMIDTone(MMIDEventSender* aEventSender)
+ : CMIDSoundImpl(aEventSender)
+{
+}
+
+void CMIDTone::ConstructL(TInt aFreq, TInt64 aDuration)
+{
+ CMIDSoundImpl::ConstructL();
+ iSchedulerWait = new(ELeave) CActiveSchedulerWait;
+ iFreq = aFreq;
+ iDuration = aDuration;
+ iState = EInitialising;
+ iMdaAudioToneUtility = CMdaAudioToneUtility::NewL(*this);
+ iMdaAudioToneUtility->PrepareToPlayTone(iFreq,
+ TTimeIntervalMicroSeconds(iDuration * KMIDMicrosInMilli));
+ iSchedulerWait->Start();
+}
+
+void CMIDTone::ConstructL(const TDesC8& aData)
+{
+ CMIDSoundImpl::ConstructL();
+ iSchedulerWait = new(ELeave) CActiveSchedulerWait;
+ // first byte is the number of command parts
+ iFreq = 0;
+ iDuration = 0;
+ iState = EInitialising;
+
+ if (aData.Length() < KMIDMinDataLength)
+ {
+ iState = ENotSupported;
+ User::Leave(KErrArgument);
+ }
+
+ if (aData[0x000] == 0x02 && aData[0x001] == 0x4a && aData[0x002] == 0x3a)
+ {
+ iState = EInitialising;
+ }
+ else if (aData[0x000] == 0x03 && aData[0x001] == 0x4a && aData[0x002] ==
+ 0x44 && aData[0x003] == 0x3a)
+ {
+ iState = EInitialising;
+ }
+ else if (aData[0] == 0x00 && aData[1] == 0x11)
+ {
+ iState = EInitialising;
+ }
+ else
+ {
+ iState = ENotSupported;
+ User::Leave(KErrArgument);
+ }
+ iMdaAudioToneUtility = CMdaAudioToneUtility::NewL(*this);
+ iMdaAudioToneUtility->PrepareToPlayDesSequence(aData);
+ iSchedulerWait->Start();
+
+}
+
+TInt CMIDTone::Play(TInt aLoop)
+{
+ __ASSERT_DEBUG(iState == EReadyToPlay, User::Invariant());
+
+ if (aLoop == 0)
+ {
+ // There is no known working method to play tone forever
+ aLoop = KMIDLoopForever;
+ }
+
+ // Setting repeats to 1 causes sound played twice
+ if (aLoop == 1)
+ {
+ iMdaAudioToneUtility->SetRepeats(0, TTimeIntervalMicroSeconds(0));
+ }
+ else if (aLoop > 1)
+ {
+ iMdaAudioToneUtility->SetRepeats(aLoop, TTimeIntervalMicroSeconds(0));
+ }
+
+ iMdaAudioToneUtility->Play();
+
+ iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_PLAYING);
+ iState = EPlaying;
+ iPlayed = ETrue;
+
+ return KErrNone;
+}
+
+void CMIDTone::Stop()
+{
+ if (iState == EPlaying)
+ {
+ iMdaAudioToneUtility->CancelPlay();
+ // sleep to make sure the device has time to stop
+ User::After(TTimeIntervalMicroSeconds32(KMIDStopSleepTime)); // CSI: 92 MdaAudioToneUtility does not send event when stopping has finished #
+ iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED);
+ iState = EReadyToPlay;
+ }
+}
+
+void CMIDTone::SetVolume(TInt aVolume)
+{
+ TInt maxVolume = iMdaAudioToneUtility->MaxVolume();
+ TInt volume = 0;
+ if (aVolume)
+ {
+ volume = (((maxVolume
+ - KMIDMinNativeVolume + 1)
+ * aVolume)
+ / (KMIDMaxJavaVolume + 1)) + KMIDMinNativeVolume;
+ }
+ iMdaAudioToneUtility->SetVolume(volume);
+}
+
+TInt CMIDTone::Volume()
+{
+ TInt maxVolume = iMdaAudioToneUtility->MaxVolume();
+ TInt volume = (iMdaAudioToneUtility->Volume() *
+ KMIDMaxJavaVolume) / maxVolume;
+
+ return volume;
+}
+
+void CMIDTone::MatoPrepareComplete(TInt aError)
+{
+ if (aError == KErrNone)
+ {
+ iState = EReadyToPlay;
+ }
+ else
+ {
+ if (aError == KErrNotSupported)
+ {
+ iState = ENotSupported;
+ }
+ else
+ {
+ iState = ENotReady;
+ }
+ }
+ iSchedulerWait->AsyncStop();
+}
+
+void CMIDTone::MatoPlayComplete(TInt aError)
+{
+ if (KErrNone == aError)
+ {
+ iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED);
+ iState = EReadyToPlay;
+ }
+}
+
+void CMIDTone::Release()
+{
+ iState = ENotReady;
+ if (iMdaAudioToneUtility)
+ {
+ if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityNotReady)
+ {
+ iMdaAudioToneUtility->CancelPrepare();
+ }
+ else if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityPlaying
+ || iState == EPlaying)
+ {
+ iMdaAudioToneUtility->CancelPlay();
+ }
+ }
+ delete iMdaAudioToneUtility;
+ iMdaAudioToneUtility = NULL;
+ iState = ENotReady;
+}
+
+// End of File
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/nokiasound/src/sound.cpp Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,209 @@
+/*
+* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: JNI class for Sound.java.
+*
+*/
+
+
+#include <e32def.h> // MAKE_TINT64 Warning fix
+
+#include "com_nokia_mid_sound_Sound.h"
+#include "CMIDSound.h"
+#include "javajniutils.h"
+#include "javacommonutils.h"
+#include "logger.h"
+
+/*
+ * Class: com_nokia_mid_sound_Sound
+ * Method: _dispose
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1dispose
+(JNIEnv* /* aJni */, jobject /* aSound */, jint aHandle)
+{
+ JELOG2(EJavaUI);
+ CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
+ delete sound;
+}
+
+/*
+ * Class: com_nokia_mid_sound_Sound
+ * Method: _create
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1create
+(JNIEnv* aJni, jobject aSound)
+{
+ JELOG2(EJavaUI);
+
+ TInt handle(0);
+ CMIDSound* sound = 0;
+ TRAPD(err,
+ {
+ sound = CMIDSound::NewL(*aJni, aSound);
+ if (sound != 0)
+ {
+ sound->InitProfileListener();
+ }
+ });
+
+ if (err != KErrNone)
+ {
+
+ java::util::JniUtils::throwNewException(aJni, "java/lang/RuntimeException" ,
+ "Failed to create Native Peer " +
+ java::util::JavaCommonUtils::intToString(err));
+ }
+ else
+ {
+
+ handle = reinterpret_cast<TInt>(sound);
+ }
+ return handle;
+}
+
+/*
+ * Class: com_nokia_mid_sound_Sound
+ * Method: _init
+ * Signature: (III[BIJ)I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1init
+(JNIEnv* aJni, jobject, jint aHandle, jint aType, jbyteArray aData,
+ jint aFrequency, jlong aDuration)
+{
+ JELOG2(EJavaUI);
+ TInt freq(aFrequency);
+ TInt64 duration = *reinterpret_cast<TInt64*>(&aDuration);
+
+ CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
+
+ TPtrC8 ptr;
+ jbyte* data = NULL;
+
+ if (aType != com_nokia_mid_sound_Sound_FORMAT_BEEP)
+ {
+ if (!aData)
+ {
+ return KErrGeneral;
+ }
+ data = aJni->GetByteArrayElements(aData,0);
+ jint length = aJni->GetArrayLength(aData);
+ ptr.Set((TUint8*)data, length);
+ }
+
+ // Had to make SetBeep() due to number of maximum parameters in ExecuteTrap.
+ sound->SetBeep(freq, duration);
+ TInt err = sound->Init(aType, (const TDesC8*)&ptr);
+
+ if (aType != com_nokia_mid_sound_Sound_FORMAT_BEEP)
+ {
+ aJni->ReleaseByteArrayElements(aData, data, 0);
+ }
+ return err;
+}
+
+/*
+ * Class: com_nokia_mid_sound_Sound
+ * Method: _release
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1release
+(JNIEnv*, jobject, jint aHandle)
+{
+ JELOG2(EJavaUI);
+ CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
+ sound->Release();
+}
+
+
+/*
+ * Class: com_nokia_mid_sound_Sound
+ * Method: _play
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1play
+(JNIEnv*, jobject, jint aHandle, jint aLoop)
+{
+ JELOG2(EJavaUI);
+ CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
+ TInt err = sound->Play(aLoop);
+ return err;
+}
+
+/*
+ * Class: com_nokia_mid_sound_Sound
+ * Method: _stop
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1stop
+(JNIEnv*, jobject, jint aHandle)
+{
+ JELOG2(EJavaUI);
+ CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
+ sound->Stop();
+}
+
+/*
+ * Class: com_nokia_mid_sound_Sound
+ * Method: _resume
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1resume
+(JNIEnv*, jobject, jint aHandle)
+{
+ JELOG2(EJavaUI);
+ CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
+ sound->Resume();
+}
+
+/*
+ * Class: com_nokia_mid_sound_Sound
+ * Method: _setVolume
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1setVolume
+(JNIEnv*, jobject, jint aHandle, jint aVolume)
+{
+ JELOG2(EJavaUI);
+ CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
+ sound->SetVolume(aVolume);
+}
+
+/*
+ * Class: com_nokia_mid_sound_Sound
+ * Method: _volume
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1volume
+(JNIEnv*, jobject, jint aHandle)
+{
+ JELOG2(EJavaUI);
+ CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
+ TInt volume = sound->SoundVolume();
+ return(volume);
+}
+
+/*
+ * Class: com_nokia_mid_sound_Sound
+ * Method: _getState
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1getState
+(JNIEnv*, jobject, jint aHandle)
+{
+ JELOG2(EJavaUI);
+ CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
+ TInt state = sound->PlayerState();
+ return state;
+}
--- a/javauis/nokiasound_akn/build/bld.inf Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Generated bld.inf -file
-*
-*/
-
-PRJ_PLATFORMS
-default
-
-PRJ_MMPFILES
-javanokiasound_0x2002DCC4.mmp
--- a/javauis/nokiasound_akn/build/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-<!--
-#
-# Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
--->
-
-<project name="javanokiasound" default="deploy" basedir=".">
-
- <import file="../../../build/utilities.xml"/>
-
- <!-- Needed by the utilities.xml. See the description form the utilities.xml
- file -->
- <property name="javah.classnames"
- value="com.nokia.mid.sound.Sound"/>
-
- <target name="create.public.api.jar">
- <omj.public.apis includes="com/nokia/mid/sound/Sound.class,
- com/nokia/mid/sound/SoundListener.class"/>
- </target>
-
-</project>
--- a/javauis/nokiasound_akn/build/bwins/javanokiasoundu.def Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
- ?jni_lookup@@YAP6AXXZPBD@Z @ 1 NONAME ; void (*)(void) jni_lookup(char const *)
-
--- a/javauis/nokiasound_akn/build/eabi/javanokiasoundu.def Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-EXPORTS
- _Z10jni_lookupPKc @ 1 NONAME
-
--- a/javauis/nokiasound_akn/build/javanokiasound.pro Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-TEMPLATE=lib
-TARGET=javanokiasound
-CONFIG += omj java stl
-CONFIG -= qt
-
-LIBS += -lcenrepnotifhandler \
- -lcentralrepository \
- -lmediaclientaudio \
- -lcommonengine \
- -ljavautils
-
-include(../../../build/omj.pri)
--- a/javauis/nokiasound_akn/build/javanokiasound_0x2002DCC4.mmp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Generated file - do not edit manually
-*
-*/
-
-// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
-// This file is generated by qmake and should not be modified by the
-// user.
-// Name : javanokiasound.mmp
-// ==============================================================================
-
-TARGET javanokiasound.dll
-TARGETTYPE DLL
-
-UID 0x1000008d 0x2002DCC4
-SECUREID 0x2002DCC4
-
-EPOCALLOWDLLDATA
-
-
-// Qt Macros
-MACRO UNICODE
-MACRO QT_KEYPAD_NAVIGATION
-MACRO QT_SOFTKEYS_ENABLED
-MACRO QT_USE_MATH_H_FLOATS
-MACRO RD_JAVA_SYMBIAN_TARGET
-MACRO RD_JAVA_S60_RELEASE_9_2
-MACRO RD_JAVA_S60_RELEASE_9_2_ONWARDS
-MACRO RD_JAVA_S60_RELEASE_5_0_ONWARDS
-MACRO RD_JAVA_STDCPPV5
-MACRO RD_JAVA_EPOCALLOWDLLDATA_FIX
-MACRO RD_JAVA_HTTP_EMC_ENABLED
-MACRO RD_JAVA_NGA_ENABLED
-MACRO RD_JAVA_PROXIMITY_LISTENER_ENABLED
-MACRO RD_JAVA_OPENC_BETA_PATCH
-MACRO RD_JAVA_INSTALLERUI_ENABLED
-MACRO RD_JAVA_PREWARM
-MACRO RD_JAVA_ADVANCED_TACTILE_FEEDBACK
-MACRO RD_JAVA_MIDPRMS_DB
-MACRO __SYMBIAN32__
-MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
-
-SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
-SYSTEMINCLUDE ../inc
-SYSTEMINCLUDE ../../inc
-SYSTEMINCLUDE ../../../inc
-SYSTEMINCLUDE ../src
-SYSTEMINCLUDE /epoc32/include/stdapis/stlportv5
-SYSTEMINCLUDE /epoc32/include/mw
-SYSTEMINCLUDE .
-
-SOURCEPATH ../src
-SOURCE cmidclip.cpp
-SOURCE cmidsound.cpp
-SOURCE CMIDSoundImpl.cpp
-SOURCE cmidtone.cpp
-SOURCE sound.cpp
-
-
-LIBRARY cenrepnotifhandler.lib
-LIBRARY centralrepository.lib
-LIBRARY mediaclientaudio.lib
-LIBRARY commonengine.lib
-LIBRARY javautils.lib
-LIBRARY libpthread.lib
-LIBRARY libstdcppv5.lib
-LIBRARY libc.lib
-LIBRARY libm.lib
-LIBRARY euser.lib
-LIBRARY libdl.lib
-LIBRARY cone.lib
-LIBRARY eikcore.lib
-LIBRARY eikcoctl.lib
-LIBRARY eiksrv.lib
-LIBRARY apparc.lib
-LIBRARY avkon.lib
-LIBRARY efsrv.lib
-LIBRARY charconv.lib
-LIBRARY ws32.lib
-LIBRARY hal.lib
-LIBRARY gdi.lib
-LIBRARY apgrfx.lib
-
-CAPABILITY all -tcb
-
-OPTION CW -wchar_t on
-OPTION ARMCC --visibility_inlines_hidden
-#if defined(ARMCC_4_0)
-OPTION ARMCC --import_all_vtbl
-#endif
-OPTION GCCE -fvisibility-inlines-hidden
-
-VERSION 10.0
-
-ARMFPU softvfp
-
-PAGED
-
-BYTEPAIRCOMPRESSTARGET
-
-USERINCLUDE .
-
-#include <platform_paths.hrh>
-
- APP_LAYER_SYSTEMINCLUDE
-
- OS_LAYER_LIBC_SYSTEMINCLUDE
-
- OS_LAYER_SSL_SYSTEMINCLUDE
-
-deffile ./~/javanokiasound.def
-
- SYSTEMINCLUDE OS_LAYER_PUBLIC_EXPORT_PATH(stdapis/stlportv5)
-
-SYSTEMINCLUDE /epoc32/build/jrt/javabuild/inc.javah
-
-SOURCEPATH /epoc32/build/jrt/javabuild/javanokiasound
-
-SOURCE lookup.cpp
-
-SOURCEPATH /epoc32/build/jrt/javabuild/javanokiasound
-
-SOURCE jxe.c
-
-#ifdef WINSCW
-
-LIBRARY ewsd.lib
-
-#endif
-
-STDCPP
-
-#ifdef WINSCW
-DEFFILE ./bwins/javanokiasound.def
-#elif defined EABI
-DEFFILE ./eabi/javanokiasound.def
-#endif
--- a/javauis/nokiasound_akn/inc/CMIDClip.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,73 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class implements wav playing.
-*
-*/
-
-
-#ifndef CMIDCLIP_H
-#define CMIDCLIP_H
-
-// INCLUDES
-#include <e32base.h>
-#include <mdaaudiosampleplayer.h>
-
-#include "CMIDSoundImpl.h"
-
-// FORWARD DECLARATIONS
-class MMIDEventSender;
-
-// CLASS DEFINITION
-/**
- * This class implements wav playing.
- *
- */
-NONSHARABLE_CLASS(CMIDClip): public CMIDSoundImpl,
- public MMdaAudioPlayerCallback
-{
-public:
-
- static CMIDClip* NewL(const TDesC8* aData, MMIDEventSender* aEventSender);
- // Destructor
- ~CMIDClip();
-
-protected:
-
- // C++ constructor
- CMIDClip(MMIDEventSender* aEventSender);
- // Second phase
- void ConstructL(const TDesC8* aData);
-
-public:
-
- virtual TInt Play(TInt aLoop);
- virtual void Stop();
- virtual void SetVolume(TInt aVolume);
- virtual TInt Volume();
- virtual void Release();
-
-public: // from MMdaAudioPlayerCallback
- void MapcInitComplete(TInt aError,
- const TTimeIntervalMicroSeconds& aDuration);
- void MapcPlayComplete(TInt aError);
-
-private:
-
- HBufC8* iClip;
- CMdaAudioPlayerUtility* iMdaAudioPlayerUtility;
- TInt iLoops;
- TInt iVolume;
-};
-
-#endif // CMIDCLIP_H
--- a/javauis/nokiasound_akn/inc/CMIDSound.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Wrapper for CMIDClip and CMIDTone class initialisations.
-*
-*/
-
-
-// INCLUDES
-#include <mevents.h>
-#include <e32base.h>
-#include <cenrepnotifyhandler.h>
-#include "MMIDEventSender.h"
-#include "functionserver.h"
-
-// FORWARD DECLARATIONS
-class CMIDSoundImpl;
-
-// CLASS DEFINITION
-/**
- * CMIDSound is a wrapper that handles which class is
- * wanted to be initialised, CMIDClip or CMIDTone
- *
- */
-NONSHARABLE_CLASS(CMIDSound):
- public CBase, MCenRepNotifyHandlerCallback, MMIDEventSender, java::util::FunctionServer
-{
-
-public:
-
- // Destructor
- ~CMIDSound();
-
-public: // From MCenRepNotifyHandlerCallback
- /**
- * Notifies this class about changes in the audio enable status
- */
- void HandleNotifyInt(TUint32 aId, TInt aNewValue);
-
-public: // From MMIDEventSender
- /**
- * Sends event to Java SoundListener.
- * @since 3.0
- * @param aEventType Type of the event to send
- */
- void SendEvent(TInt aEventType);
-
-protected:
-
- // C++ default constructor
- CMIDSound();
-
-private:
- TBool IsAudioEnabled();
-
-public:
-
- static CMIDSound* NewL(JNIEnv& aJni, jobject aSound);
- void SetBeep(TInt aFreq, TInt64 aDuration);
- TInt Init(TInt aType, const TDesC8* aData);
- void InitL(TInt aType, const TDesC8* aData);
- TInt InitProfileListener();
- void InitProfileListenerL();
- TInt Play(TInt aLoop);
- TInt DoPlay(TInt aLoop);
- void Resume();
- void DoResume();
- void Stop();
- void DoStop();
- TInt SoundVolume();
- TInt Volume();
- void SetVolume(TInt aVolume);
- void DoSetVolume(TInt aVolume);
- TInt State();
- TInt PlayerState();
- void Release();
- void DoRelease();
-
-
-private:
-
- CMIDSoundImpl* iMIDSound;
- TInt iFreq;
- TInt64 iDur;
- TInt iSource;
- TInt iRealVolume;
-
- // owned, informs about changes in iRepository
- CCenRepNotifyHandler* iProfileListener;
-
- // owned, current profile
- CRepository* iRepository;
-
- TInt iHandle;
-};
-
--- a/javauis/nokiasound_akn/inc/CMIDSoundEvent.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Class for sound related events.
-*
-*/
-
-
-#ifndef CMIDSOUNDEVENT_H
-#define CMIDSOUNDEVENT_H
-
-#include <jni.h>
-
-// CLASS DEFINITION
-
-/**
- * Class for sound related events.
- */
-NONSHARABLE_CLASS(CMIDSoundEvent)
-{
-public: // constructor
- CMIDSoundEvent(TInt aEvent);
-
-public: // new methods
- /**
- * Setter for listener
- * @param aListener this event will be sent to this listener
- */
- void SetListener(jobject aListener);
-
- /**
- * Setter for method ID
- * @param aMethodID this event will be sent by calling this method
- */
- void SetMethodID(jmethodID aMethodID);
-
- /**
- * Adds a global reference to peer object, this reference is
- * removed when the event is dispatched. This prevents peer
- * object from being deleted by garbage collector before the
- * event has been dispatched.
- */
- void AddGlobalRef(JavaVM* javaVM);
-
-
-private:
- void Dispatch(JNIEnv& aJni);
-
-private:
- jobject iListener;
- jmethodID iMethodID;
- TInt iEvent;
- jobject iGlobalRef;
- // Number of times the global reference has been added.
- // The actual global reference is removed when the counter reaches zero.
- TInt iRefCount;
-
-};
-
-
-#endif // CMIDSOUNDEVENT_H
--- a/javauis/nokiasound_akn/inc/CMIDSoundImpl.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Interface and a base class for CMIDClip and CMIDTone.
-*
-*/
-
-
-
-#ifndef CMIDSOUNDIMPL_H
-#define CMIDSOUNDIMPL_H
-
-// INCLUDES
-#include <e32base.h>
-
-// FORWARD DECLARATIONS
-class MMIDEventSender;
-
-
-// CLASS DEFINITION
-/**
- * This class is interface and a base class for CMIDClip and CMIDTone
- *
- */
-NONSHARABLE_CLASS(CMIDSoundImpl): public CBase
-{
-
-public:
-
- enum TState
- {
- ENotReady,
- EReadyToPlay,
- EPlaying,
- ENotSupported,
- EInitialising
- };
-
-public:
-
- // destructor
- ~CMIDSoundImpl();
-
-protected:
-
- void ConstructL();
-
- // C++ constructor
- CMIDSoundImpl(MMIDEventSender* aEventSender);
-
-public:
-
- void Resume();
-
- virtual TInt Play(TInt aLoop) = 0;
- virtual void Stop() = 0;
- virtual void SetVolume(TInt aVolume) = 0;
- virtual TInt Volume() = 0;
- virtual void Release() = 0;
-
- inline TInt State() const;
-
-protected:
-
-
- TInt iState;
-
- // true if playback has been started.
- TBool iPlayed;
-
- CActiveSchedulerWait* iSchedulerWait;
-
- // events are sent through this interface
- MMIDEventSender* iEventSender;
-
-};
-
-inline TInt CMIDSoundImpl::State() const
-{
- return iState;
-};
-
-#endif // CMIDSOUNDIMPL_H
--- a/javauis/nokiasound_akn/inc/CMIDTone.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class implements beep playing and OTA ringingtone playing.
-*
-*/
-
-
-#ifndef CMIDTONE_H
-#define CMIDTONE_H
-
-// INCLUDES
-#include <e32base.h>
-#include <mdaaudiotoneplayer.h>
-
-#include "CMIDSoundImpl.h"
-
-// FORWARD DECLARATIONS
-class MMIDEventSender;
-
-// CLASS DEFINITION
-/**
- * This class implements beep playing and OTA ringingtone playing.
- *
- */
-NONSHARABLE_CLASS(CMIDTone): public CMIDSoundImpl, public MMdaAudioToneObserver
-{
-public:
-
- static CMIDTone* NewL(TInt aFreq, TInt64 aDuration,
- MMIDEventSender* aEventSender);
- static CMIDTone* NewL(const TDesC8& aData, MMIDEventSender* aEventSender);
- // Destructor
- ~CMIDTone();
-
-protected:
-
- // C++ constructor
- CMIDTone(MMIDEventSender* aEventSender);
- // Second phase
- void ConstructL(TInt aFreq, TInt64 aDuration);
- void ConstructL(const TDesC8& aData);
-
-public:
-
- virtual TInt Play(TInt aLoop);
- virtual void Stop();
- virtual void SetVolume(TInt aVolume);
- virtual TInt Volume();
- virtual void Release();
-
-public: // from MMdaAudioToneObserver
-
- void MatoPrepareComplete(TInt aError);
- void MatoPlayComplete(TInt aError);
-
-private:
-
- TInt iFreq;
- TInt64 iDuration;
- CMdaAudioToneUtility* iMdaAudioToneUtility;
-};
-
-#endif // CMIDTONE_H
--- a/javauis/nokiasound_akn/inc/MMIDEventSender.h Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: SoundImpl instances can send events through this interface
-*
-*/
-
-
-
-#ifndef MMIDEVENTSENDER_H
-#define MMIDEVENTSENDER_H
-
-/**
-* SoundImpl instances cand send events through this interface.
-* This interface has only one method, SendEvent(), which can be used
-* for sending all types of sound events.
-*
-* @since 3.0
-*/
-NONSHARABLE_CLASS(MMIDEventSender)
-{
-
-public: // New functions
-
- /**
- * Sends event to Java SoundListener.
- * @since 3.0
- * @param aEventType Type of the event to send
- */
- virtual void SendEvent(TInt aEventType) = 0;
-
-protected:
-
- /**
- * C++ default constructor.
- */
- MMIDEventSender() { }
-
-private:
-
- // Prohibit copy constructor if not deriving from CBase.
- MMIDEventSender(const MMIDEventSender&) { }
- // Prohibit assigment operator if not deriving from CBase.
- MMIDEventSender& operator=(const MMIDEventSender&)
- {
- return *this;
- }
-
-};
-
-#endif // MMIDEVENTSENDER_H
-
-// End of File
--- a/javauis/nokiasound_akn/javasrc/com/nokia/mid/sound/Sound.java Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,698 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Provides Sound API for playing tones and digitized audio.
-*
-*/
-
-
-package com.nokia.mid.sound;
-
-import com.nokia.mj.impl.rt.support.Finalizer;
-import java.util.Vector;
-import com.nokia.mj.impl.utils.Logger;
-import java.lang.Thread;
-
-/**
- * <p>
- * Provides simple Sound API for playing tones and digitized audio.
- * </p><p>
- * Since MIDP doesn't have any Sound API for games there is a need
- * for proprietary sound extension to support devices audio
- * capabilities. Every implementation has capability to produce tone
- * sounds (e.g. ringing tones), this is the minimum support. Currently
- * some products support or will support also digitized audio formats.
- * The Game sound API will support both buzzer and digitized audio.
- * Buzzer must be supported by all implementations. If implementation
- * doesn't have buzzer the buzzer tones are emulated.
- * </p>
- * Since implementations have different audio capabilities,
- * application can query which audio formats are supported by
- * implementation by calling {@link #getSupportedFormats()}.
- * <p>
- * All implementations need to support at least tone based sounds
- * (type FORMAT_TONE) via {@link #Sound(int freq, long duration)} and
- * {@link #init(int freq, long duration)}. In addition all implementations
- * must support Smart messaging ringingtone format (type FORMAT_TONE)
- * via {@link #Sound(byte[] data, int type)} and
- * {@link #init(byte[] data, int type) }.
- * <p>
- * Note that there is also work going on with Multimedia API that
- * is done in JCP as
- * <a href="http://www.jcp.org/jsr/detail/135.jsp">JSR 135</a>.
- * The standard Multimedia API
- * will replace the proprietary Game Sound API when it is ready. However
- * Sound API will be supported also later on but probably it will be
- * stated as deprecated.
- * </p>
- * @version 1.1
- * @see com.nokia.mid.ui.DeviceControl
- * @since 1.0
- */
-
-public class Sound
-{
-
- /**
- * Tone based format is used.
- *
- * init(int freq, int duration) puts sound into this format.
- * @since 1.0
- *
- */
- public static final int FORMAT_TONE = 1;
-
- /**
- * Content is in WAV format.
- * @since 1.0
- *
- */
- public static final int FORMAT_WAV = 5;
-
- /**
- * Sound is playing.
- * @since 1.0
- *
- */
- public static final int SOUND_PLAYING = 0;
-
- /**
- * Sound is stopped.
- * @since 1.0
- *
- */
- public static final int SOUND_STOPPED = 1;
-
- /**
- * Sound is uninitialized (released).
- * @since 1.0
- */
- public static final int SOUND_UNINITIALIZED = 3;
-
- /**
- * Sound is reinitialising
- */
- private static final int SOUND_REINITIALISING = 4;
-
- private static final int FORMAT_BEEP = 2;
- private static final int NOT_SUPPORTED_ERROR = 3;
-
- private static final int ERR_NOT_READY = -18;
- private static final int ERR_ARGUMENT = -6;
-
- private int iHandle;
-
- private Finalizer iFinalizer;
- private int iCurrentType;
- private int iState;
- private int iGain = -1;
-
- Vector iSoundListeners = new Vector();
-
- private static Sound iPlayingSound;
-
- static
- {
- com.nokia.mj.impl.rt.support.Jvm.loadSystemLibrary("javanokiasound");
- }
-
- /**
- * Constructors initialize the Sound object so that it is ready for
- * playback. This constructor is used for initializing Sound
- * object based on byte array data. The data should contain the data
- * presented in the data format specified by type parameter. The Sound
- * class defines also generally supported types as constants.
- * <p>
- * All implementations need to support at least Nokia
- * Smart Messaging, Over the Air (OTA) ringingtone format.
- * The type of this format is FORMAT_TONE.
- * <p>
- * Note: some implementations can't throw exceptions about
- * sound data being corrupted or illegal during construction.
- * This will result that IllagalArgumentException is delayed until
- * play(int loop) method is called. Applications thus need to except
- * that IllegalArgumentException is thrown in this method or during
- * play method call.
- * <p>
- * @throws java.lang.IllegalArgumentException if the data can not be
- recognized to
- * given type or the type is unsupported or unknown
- * @throws java.lang.NullPointerException if the data is null
- * @since 1.0
- *
- */
- public Sound(byte[] data, int type)
- {
- Logger.LOG(Logger.EJavaUI, Logger.EInfo, "Sound Constructor");
- iFinalizer = registerForFinalization();
-
- iHandle = _create();
-
- iState = SOUND_UNINITIALIZED;
-
- init(data, type);
- }
-
- /**
- * Constructors initialize the Sound object so that it is ready for
- * playback. Sound is initialized as a simple tone based sound.
- * <p>
- * See method {@link #init(int freq, long duration)} for
- * freq value descriptions. See also a note on exceptions semantics in
- * {@link #init(int freq, long duration)}.
- *
- * @param freq a frequency value
- * @param duration the duration of the tone in milliseconds
- * @throws java.lang.IllegalArgumentException if parameter values are
- * illegal, freq is not in given range or duration is negative or zero
- * @since 1.0
- */
- public Sound(int freq, long duration)
- {
-
- iFinalizer = registerForFinalization();
- iHandle = _create();
-
- iState = SOUND_UNINITIALIZED;
-
- init(freq, duration);
- }
-
- /**
- * Called when this object is finalized, frees native resources
- */
-
- public Finalizer registerForFinalization()
- {
-
- return new Finalizer()
- {
- public void finalizeImpl()
- {
- doFinalize();
- }
- };
- }
-
- void doFinalize()
- {
-
- if (iFinalizer == null)
- {
- return;
- }
- iFinalizer = null;
-
- if (iHandle > 0)
- {
- _dispose(iHandle);
- }
- }
-
- /**
- * Releases audio resources reserved by this object. After object
- * is released it goes to uninitialized state. This method should
- * be called when Sound object is not needed anymore.
- * @since 1.0
- */
- public void release()
- {
- if ((iState != SOUND_UNINITIALIZED) &&
- (iState != SOUND_REINITIALISING))
- {
- iState = SOUND_REINITIALISING;
- soundStateChanged(SOUND_UNINITIALIZED);
- }
-
- _release(iHandle);
-
- iState = SOUND_UNINITIALIZED;
-
- }
-
- /**
- * Initializes Sound to play a simple beep.
- * <p>
- * Note: some implementations may not support the full frequency
- * scale defined in table below. They will throw
- * IllegalArgumentException instead for unsupported values. The
- * exception may also be delayed
- * until the play(int loop) method is called.
- * <p>
- * Following table describes some freq argument
- * values:
- * <pre>
- * Description Frequency
- * Freq off 0
- * Ring freq A0 220
- * Ring freq B0b 233
- * Ring freq B0 247
- * Ring freq C0 262
- * Ring freq D0b 277
- * Ring freq D0 294
- * Ring freq E0b 311
- * Ring freq E0 330
- * Ring freq F0 349
- * Ring freq G0b 370
- * Ring freq G0 392
- * Ring freq A1b 416
- * Ring freq A1 440
- * Ring freq B1b 466
- * Ring freq B1 494
- * Ring freq C1 523
- * Ring freq D1b 554
- * Ring freq D1 587
- * Ring freq E1b 622
- * Ring freq E1 659
- * Ring freq F1 698
- * Ring freq G1b 740
- * Ring freq G1 784
- * Ring freq A2b 831
- * Ring freq A2 880
- * Ring freq B2b 932
- * Ring freq B2 988
- * Ring freq C2 1047
- * Ring freq D2b 1109
- * Ring freq D2 1175
- * Ring freq E2b 1245
- * Ring freq E2 1319
- * Ring freq F2 1397
- * Ring freq G2b 1480
- * Ring freq G2 1568
- * Ring freq A3b 1661
- * Ring freq A3 1760
- * Ring freq B3b 1865
- * Ring freq B3 1976
- * Ring freq C3 2093
- * Ring freq D3b 2217
- * Ring freq D3 2349
- * Ring freq E3b 2489
- * Ring freq E3 2637
- * Ring freq F3 2794
- * Ring freq G3b 2960
- * Ring freq G3 3136
- * Ring freq A4b 3322
- * Ring freq A4 3520
- * Ring freq B4b 3729
- * Ring freq B4 3951
- * Ring freq C4 4186
- * Ring freq D4b 4434
- * Ring freq D4 4698
- * Ring freq E4b 4978
- * Ring freq E4 5274
- * Ring freq F4 5588
- * Ring freq G4b 5920
- * Ring freq G4 6272
- * Ring freq A5b 6644
- * Ring freq A5 7040
- * Ring freq B5b 7458
- * Ring freq B5 7902
- * Ring freq C5 8372
- * Ring freq D5b 8870
- * Ring freq D5 9396
- * Ring freq E5b 9956
- * Ring freq E5 10548
- * Ring freq F5 11176
- * Ring freq G5b 11840
- * Ring freq G5 12544
- * Ring freq A6b 13288
- *
- * </pre>
- *
- * @param duration length of the beep in milliseconds
- * @param freq frequency to be played
- * @throws java.lang.IllegalArgumentException if parameter values are
- * illegal, freq is not in given range or duration is negative or zero
- * @since 1.0
- */
- public void init(int freq, long duration)
- {
- if (duration < 1 || duration > 10000000)
- {
- throw(new IllegalArgumentException(
- "Bad duration value, must be 1-10000000"));
- }
- if (freq < 0 || freq > 15000)
- {
- throw(new IllegalArgumentException(
- "Bad frequency value, must be 0-15000"));
- }
- // if the uninitialised event is sent from native side, it reaches
- // listener too late in TCK test sound8004, thus we send the event
- // already here
- if ((iState != SOUND_UNINITIALIZED) &&
- (iState != SOUND_REINITIALISING))
- {
- iState = SOUND_REINITIALISING;
- soundStateChanged(SOUND_UNINITIALIZED);
- } // end of if (iState != SOUND_UNINITIALIZED)
-
- iCurrentType = FORMAT_BEEP;
- int err = _init(iHandle, iCurrentType, null, freq, duration);
- if (err == ERR_NOT_READY)
- {
- throw new RuntimeException(Integer.toString(err));
- }
- else if (err == ERR_ARGUMENT)
- {
- throw new IllegalArgumentException("Data is invalid");
- }
- iState = SOUND_STOPPED;
- }
-
- /**
- * Initializes Sound object based on byte
- * array data. The data should contain the data presented in the data
- * format specified by type parameter. The Sound class defines also
- * generally supported types as constants.
- * <p>
- * All implementations need to support at least Nokia
- * Smart Messaging, Over the Air (OTA) ringingtone format.
- * The type of this format is FORMAT_TONE.
- * <p>
- * Note: some implementations can't throw exceptions about
- * sound data being corrupted or illegal during this method call.
- * This will result that IllagalArgumentException is delayed until
- * play(int loop) method is called. Applications thus need to except
- * that IllegalArgumentException is thrown in this method or during
- * play method call.
- * <p>
- * @param data a byte array containing the data to be played
- * @param type type of the audio
- * @throws java.lang.IllegalArgumentException if the data can not be
- recognized to
- * given type or the type is unsupported or unknown
- * @throws java.lang.NullPointerException if the data is null
- * @since 1.0
- */
- public void init(byte[] data, int type)
- {
- if (!(type == FORMAT_WAV || type == FORMAT_TONE))
- {
- throw(new IllegalArgumentException("Type is not supported"));
- }
- if (data == null)
- {
- throw(new NullPointerException("Data is null"));
- }
-
- if ((iState != SOUND_UNINITIALIZED) &&
- (iState != SOUND_REINITIALISING))
- {
- iState = SOUND_REINITIALISING;
- soundStateChanged(SOUND_UNINITIALIZED);
- } // end of if (iState != SOUND_UNINITIALIZED)
-
- iCurrentType = type;
- int err = _init(iHandle, iCurrentType, data, 0, 0);
- if (err == ERR_NOT_READY || err == ERR_ARGUMENT )
- {
- throw new IllegalArgumentException("Data is invalid");
- }
-
- iState = SOUND_STOPPED;
- }
-
-
- /**
- * Get the current state of the Sound object.
- *
- * @return current state, SOUND_PLAYING, SOUND_STOPPED or
- SOUND_UNINITIALIZED
- * @since 1.0
- *
- */
- public int getState()
- {
- if (iState == SOUND_REINITIALISING)
- {
- return SOUND_UNINITIALIZED;
- }
-
- iState = _getState(iHandle);
- switch (iState)
- {
- case(0): // ENotReady
- case(4): // EInitialising
- iState = SOUND_UNINITIALIZED;
- break;
- case(1): // EReadyToPlay
- iState = SOUND_STOPPED;
- break;
- case(2): // EPlaying
- iState = SOUND_PLAYING;
- break;
- default:
- }
- return iState;
- }
-
- /**
- * This method is used for starting the playback from the beginning of a
- * sound object. The loop parameter defined the loop count for playback.
- * Argument zero (0) means continuos looping. For uninitialized sound the
- * play method doesn't do anything and silently returns. For stopped and
- * playing sounds the playback starts from beginning of the sound with new
- * looping information.
- * <p>
- * This method will throw IllegalStateException if playback cannot be
- * started since all channels are in use, or playback is not possible
- * because there is more higher priority system sounds being played.
- * <p>
- * If Sound playback is possible this method will return immediately and
- * thus will not block the calling thread during the playback. If any error
- * that prevents the playback is encountered during the playback, the
- * playback is silently stopped as if called to the stop method.
- *
- * @param number number of times audio is played. Value 0 plays audio in
- * continous loop.
- * @throws java.lang.IllegalStateException if the sound object cannot be
- * played because all the channels are already in use.
- * @throws java.lang.IllegalArgumentException if the loop value is negative,
- * or if sound values/date is illegal or corrupted.
- * @since 1.0
- *
- */
- public void play(int loop) throws IllegalArgumentException
- {
- if (loop < 0)
- {
- throw(new IllegalArgumentException("Negative loop value"));
- }
- if (iState == SOUND_REINITIALISING)
- {
- return;
- } // end of if (iState == SOUND_REINITIALISING)
-
- if (iPlayingSound != null)
- {
- if (iPlayingSound.getState() == SOUND_PLAYING)
- {
- iPlayingSound.stop();
- }
- } // end of if (iPlayingSound != null)
-
- int error = _play(iHandle, loop);
- if ((error == NOT_SUPPORTED_ERROR))
- {
- throw(new IllegalArgumentException("Sound is not supported"));
- }
- iPlayingSound = this;
- }
-
- /**
- * The method will stop the sound playback, storing the current position.
- * For sound that has never been started (may be uninitialized), or is
- * currently being stopped the method call doesn't do anything and returns
- * silently.
- *
- * Note that for tone based sounds it is not possible to resume from
- * position the sound was stopped at, to be specific, stop will reset
- * the position to the beginning of the sound.
- * @since 1.0
- */
- public void stop()
- {
- if (iState == SOUND_REINITIALISING)
- {
- return;
- } // end of if (iState == SOUND_REINITIALISING)
- _stop(iHandle);
- }
-
- /**
- * The method will continue the stopped sound object from the position it
- * was stopped to. For sound that has never been started (may be
- * uninitialized), or is currently being played the method call doesn't
- * do anything.
- * <p>
- * Note: For tone based sounds the resume starts the sound from the
- * beginning of the sound clip.
- * @since 1.0
- *
- */
- public void resume()
- {
- if (iState == SOUND_REINITIALISING)
- {
- return;
- } // end of if (iState == SOUND_REINITIALISING)
- _resume(iHandle);
- }
-
- /**
- * Sets the gain for the sound object. The gain is a value between
- * 0 and 255. Implementation scales the gain value to the limits it
- * supports. Notice that any gain value > 0 should result a gain
- * value > 0. If the gain is smaller than this minimum value then
- * gain is set to 0, if the gain greater than this maximum value
- * then the gain is set to maximum value (255).
- *
- * @param gain gain value: 0 - 255
- * @throws java.lang.IllegalArgumentException if the gain not 0 - 255
- * @since 1.0
- */
- public void setGain(int gain)
- {
- if (iState == SOUND_REINITIALISING)
- {
- return;
- } // end of if (iState == SOUND_REINITIALISING)
- if (gain < 0)
- {
- gain = 0;
- }
- else if (gain > 255)
- {
- gain = 255;
- }
- iGain = gain;
- _setVolume(iHandle, iGain);
- }
-
- /**
- * Get the gain (or volume) of Sound object. The gain is a value
- * between 0 and 255. System returns a scaled value based on the
- * limits it supports. Notice that any system gain value > 0 should
- * return a gain value > 0.
- *
- * @return gain value 0 - 255
- * @since 1.0
- *
- */
- public int getGain()
- {
- if (iGain == -1)
- {
- return _volume(iHandle);
- }
- // we have previously set gain
- return iGain;
- }
-
- /**
- * Returns number of concurrent sounds the device can play for
- * specific audio type. Returns 1 if only one sound can be played
- * at a time. Notice that most types use same channel resources.
- * @return total number of available channels.
- * @param type the media type
- * @throws java.lang.IllegalArgumentException if the type is unsupported
- * or unknown
- * @since 1.0
- */
- public static int getConcurrentSoundCount(int type)
- {
- if ((type != FORMAT_TONE) && (type != FORMAT_WAV))
- {
- throw(new IllegalArgumentException("Type is not supported"));
- }
-
- return 1;
- }
-
- /**
- * Returns the supported audio formats as an int array.
- *
- * @return an array containing supported audio formats as
- * int values (e.g. FORMAT_TONE, FORMAT_WAV),
- * or an empty array if no audio formats are supported.
- * @since 1.0
- */
- static public int[] getSupportedFormats()
- {
- return(new int[] { FORMAT_TONE, FORMAT_WAV });
- }
-
- /**
- * Registeres a listener for playback state notifications.
- * @see com.nokia.mid.sound.SoundListener
- * @param listener a listener that is notified when state
- * changes occur or null if listener is to be
- * removed.
- * @since 1.0
- *
- */
- public void setSoundListener(SoundListener listener)
- {
- iSoundListeners.addElement(listener);
- }
-
- /**
- * Callback method when sound state changes
- *
- */
- public void soundStateChanged(final int event)
- {
- /*
- for(int i = 0; i < iSoundListeners.size(); i++)
- {
- ((SoundListener)iSoundListeners.elementAt(i)).soundStateChanged(this, event);
- }
- */
- //Notify SoundState Listeners in a separate thread, so that application doesn't
- //block main thread
- new Thread(new Runnable()
- {
- public void run()
- {
- notifySoundStateListeners(event);
- }
- }).start();
- }
-
- /**
- * Notify Sound State Listeners
- */
- public synchronized void notifySoundStateListeners(int event)
- {
- for (int i = 0; i < iSoundListeners.size(); i++)
- {
- ((SoundListener)iSoundListeners.elementAt(i)).soundStateChanged(this, event);
- }
- }
-
- private native void _dispose(int aHandle);
- private native int _create();
- private native int _init(int aHandle, int aType,
- byte[] aData,
- int aFrequency, long aDuration);
- private native void _release(int aHandle);
- private native int _play(int aHandle, int aLoop);
- private native void _stop(int aHandle);
- private native void _resume(int aHandle);
- private native void _setVolume(int aHandle, int aVolume);
- private native int _volume(int aHandle);
- private native int _getState(int aHandle);
-
-} //End of Sound class
-
--- a/javauis/nokiasound_akn/javasrc/com/nokia/mid/sound/SoundListener.java Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Interface indicating changes in the playback state.
-*
-*/
-
-
-package com.nokia.mid.sound;
-
-/**
- * <p>
- * This interface is used by applications which need to receive events
- * that indicate changes in the playback state of the Sound objects.
- * </p>
- * @see com.nokia.mid.sound.Sound
- * @version 1.1
- * @since 1.0
- */
-
-public interface SoundListener
-{
-
- /**
- * Called when playback state of an Sound has been changed.
- * Listener will be notified when playback has been started
- * or stopped.
- * @see com.nokia.mid.sound.Sound#setSoundListener(SoundListener listener)
- * @see com.nokia.mid.sound.Sound#SOUND_PLAYING
- * @see com.nokia.mid.sound.Sound#SOUND_STOPPED
- * @param sound the sound object this event relates to
- * @param event the sound changed event, SOUND_PLAYING or SOUND_STOPPED
- * @since 1.0
- */
- public abstract void soundStateChanged(Sound sound, int event);
-
-}
--- a/javauis/nokiasound_akn/src/CMIDSoundImpl.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Interface and a base class for CMIDClip and CMIDTone.
-*
-*/
-
-
-#include "CMIDSoundImpl.h"
-#include "CMIDSoundEvent.h"
-#include "com_nokia_mid_sound_Sound.h"
-
-CMIDSoundImpl::~CMIDSoundImpl()
-{
-
-}
-
-CMIDSoundImpl::CMIDSoundImpl(MMIDEventSender* aEventSender)
-{
- iEventSender = aEventSender;
-}
-
-void CMIDSoundImpl::ConstructL()
-{
-
-}
-
-void CMIDSoundImpl::Resume()
-{
- if (iPlayed && (iState == EReadyToPlay))
- {
- Play(1);
- }
-}
--- a/javauis/nokiasound_akn/src/cmidclip.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,196 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class implements wav playing.
-*
-*/
-
-
-#include <e32std.h>
-#include <AudioPreference.h>
-
-#include "com_nokia_mid_sound_Sound.h"
-#include "CMIDClip.h"
-#include "MMIDEventSender.h"
-
-namespace
-{
-const TInt KMIDMaxJavaVolume = 255;
-const TInt KMIDMinNativeVolume = 1;
-const TInt KMIDHeaderLength = 4;
-_LIT8(KMIDHeaderWAV, "RIFF");
-_LIT8(KMIDHeaderAMR, "#!AM");
-const TInt KMIDClipForever = 999999;
-const TInt KMIDMinDataSize = 4;
-}
-
-CMIDClip* CMIDClip::NewL(const TDesC8* aData, MMIDEventSender* aEventSender)
-{
- CMIDClip* self = new(ELeave) CMIDClip(aEventSender);
- CleanupStack::PushL(self);
- self->ConstructL(aData);
- CleanupStack::Pop(self);
- return self;
-}
-
-CMIDClip::~CMIDClip()
-{
- if (iMdaAudioPlayerUtility)
- {
- if (iState == EPlaying)
- {
- iMdaAudioPlayerUtility->Stop();
- }
- }
- delete iMdaAudioPlayerUtility;
- delete iClip;
- delete iSchedulerWait;
-}
-
-CMIDClip::CMIDClip(MMIDEventSender* aEventSender)
- : CMIDSoundImpl(aEventSender)
-{
-}
-
-void CMIDClip::ConstructL(const TDesC8* aData)
-{
- CMIDSoundImpl::ConstructL();
- iSchedulerWait = new(ELeave) CActiveSchedulerWait;
-
- if (aData->Length() < KMIDMinDataSize)
- {
- iState = ENotSupported;
- User::Leave(KErrArgument);
- }
-
- TPtrC8 header = aData->Left(KMIDHeaderLength);
-
- if ((header != KMIDHeaderWAV()) && (header != KMIDHeaderAMR))
- {
- iState = ENotSupported;
- User::Leave(KErrArgument);
- }
-
- iState = EInitialising;
- iClip = aData->AllocL();
- iMdaAudioPlayerUtility =
- CMdaAudioPlayerUtility::
- NewDesPlayerReadOnlyL(*iClip, *this,
- KAudioPriorityRecording);
- iMdaAudioPlayerUtility->UseSharedHeap();
- iSchedulerWait->Start();
-}
-
-TInt CMIDClip::Play(TInt aLoop)
-{
- __ASSERT_DEBUG(iState == EReadyToPlay, User::Invariant());
-
- if (aLoop == 0)
- {
- // There is no known working method to play clip forever, so we play
- // it for a long time instead.
- aLoop = KMIDClipForever;
- }
-
- --aLoop;
-
- // Setting repeats to 1 causes sound played twice
- if (aLoop > 0)
- {
- iMdaAudioPlayerUtility->SetRepeats(aLoop, TTimeIntervalMicroSeconds(0));
- }
-
- iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_PLAYING);
-
- iMdaAudioPlayerUtility->Play();
- iState = EPlaying;
- iPlayed = ETrue;
- return KErrNone;
-}
-
-void CMIDClip::Stop()
-{
- if (iState == EPlaying)
- {
- iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED);
- iMdaAudioPlayerUtility->Stop();
- iState = EReadyToPlay;
- }
-}
-
-void CMIDClip::SetVolume(TInt aVolume)
-{
- iVolume = aVolume;
- TInt volume = 0;
- if (aVolume)
- {
- volume = (((iMdaAudioPlayerUtility->MaxVolume()
- - KMIDMinNativeVolume + 1)
- * aVolume)
- / (KMIDMaxJavaVolume + 1)) + KMIDMinNativeVolume;
- }
- iMdaAudioPlayerUtility->SetVolume(volume);
-}
-
-TInt CMIDClip::Volume()
-{
- return iVolume;
-}
-
-void CMIDClip::MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/)
-{
- if (aError == KErrNone)
- {
- //Setting iVolume to max because
- //CMdaAudioPlayerUtility doesn't have Volume()
- iVolume = KMIDMaxJavaVolume;
- iState = EReadyToPlay;
- }
- else
- {
- if (aError == KErrNotSupported)
- {
- iState = ENotSupported;
- }
- else
- {
- iState = ENotReady;
- }
- }
- iSchedulerWait->AsyncStop();
-}
-
-void CMIDClip::MapcPlayComplete(TInt /*aError*/)
-{
- iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED);
- iState = EReadyToPlay;
-}
-
-void CMIDClip::Release()
-{
- if (iMdaAudioPlayerUtility)
- {
- if (iState == EPlaying)
- {
- iMdaAudioPlayerUtility->Stop();
- }
- }
- delete iMdaAudioPlayerUtility;
- iMdaAudioPlayerUtility = NULL;
- delete iClip;
- iClip = NULL;
- iState = ENotReady;
-}
-
-//End of File
-
--- a/javauis/nokiasound_akn/src/cmidsound.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,309 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Wrapper for CMIDClip and CMIDTone class initialisations.
-*
-*/
-
-
-#include <e32std.h>
-#include <centralrepository.h>
-#include <ProfileEngineSDKCRKeys.h>
-
-#include "CMIDSound.h"
-#include "CMIDTone.h"
-#include "CMIDClip.h"
-#include "logger.h"
-#include "fs_methodcall.h"
-#include "com_nokia_mid_sound_Sound.h"
-
-
-CMIDSound* CMIDSound::NewL(JNIEnv& aJni, jobject aPeer)
-{
- JELOG2(EJavaUI);
-
- CMIDSound* self = new CMIDSound();
- if (self != NULL)
- {
- self->attachToVm(aJni, aPeer);
- }
- return self;
-}
-
-CMIDSound::~CMIDSound()
-{
- delete iMIDSound;
-
- // CENREP
- if (iProfileListener)
- {
- iProfileListener->StopListening();
- delete iProfileListener;
- }
- delete iRepository;
-}
-
-void CMIDSound::HandleNotifyInt(TUint32 aId, TInt aNewValue)
-{
- JELOG2(EJavaUI);
- if (aId == KProEngActiveWarningTones)
- {
- if (iMIDSound)
- {
- iMIDSound->SetVolume(aNewValue == 0 ? 0 : iRealVolume);
- }
- }
-}
-
-void CMIDSound::SendEvent(TInt aEventType)
-{
- /**
- *Callback to Java
- */
- JELOG2(EJavaUI);
-
- jclass javaPeerClass = mJniEnv->FindClass("com/nokia/mid/sound/Sound");
-
- jmethodID soundStateChangeCallback = mJniEnv->GetMethodID(
- javaPeerClass /*mJavaPeerClass */, "soundStateChanged", "(I)V");
-
-
- mJniEnv->CallVoidMethod(mJavaPeerObject, soundStateChangeCallback,
- aEventType);
-}
-
-CMIDSound::CMIDSound()
- : java::util::FunctionServer("CMIDSoundFunctionServer"),
- iMIDSound(0)
-{
- JELOG2(EJavaUI);
- createServerToNewThread();
-}
-
-int CMIDSound::InitProfileListener()
-{
- TRAPD(err, CallMethodL(this, &CMIDSound::InitProfileListenerL, this));
- return err;
-}
-
-void CMIDSound::InitProfileListenerL()
-{
- JELOG2(EJavaUI);
- // repository for profile
- iRepository = CRepository::NewL(KCRUidProfileEngine);
-
- // get notifies about changes in KProEngActiveWarningTones
- iProfileListener = CCenRepNotifyHandler::NewL(*this,
- *iRepository,
- CCenRepNotifyHandler::EIntKey,
- KProEngActiveWarningTones);
-
- // Changes will be informed to HandleNotifyInt
- iProfileListener->StartListeningL();
-}
-
-TBool CMIDSound::IsAudioEnabled(/*CMIDSound* aSelf*/)
-{
- JELOG2(EJavaUI);
- TInt isProfileOn = 0;
- TInt error = iRepository->Get(KProEngActiveWarningTones, isProfileOn);
- TBool retVal = EFalse;
-
- // If getting profile status fails do not play any tones.
- if ((isProfileOn == 1) &&
- (error == KErrNone))
- {
- retVal = ETrue;
- }
- return retVal;
-}
-
-void CMIDSound::SetBeep(TInt aFreq, TInt64 aDuration)
-{
- JELOG2(EJavaUI);
- iFreq = aFreq;
- iDur = aDuration;
-}
-
-TInt CMIDSound::Init(TInt aType, const TDesC8* aData)
-{
- JELOG2(EJavaUI);
- TRAPD(err, CallMethodL(this, &CMIDSound::InitL, aType, aData, this));
- return err;
-}
-
-void CMIDSound::InitL(TInt aType, const TDesC8* aData)
-{
- JELOG2(EJavaUI);
-
- if (iMIDSound)
- {
- if (iMIDSound->State() == CMIDSoundImpl::EInitialising)
- {
- return;
- }
- if (iMIDSound->State() == CMIDSoundImpl::EReadyToPlay ||
- iMIDSound->State() == CMIDSoundImpl::EPlaying)
- {
- iMIDSound->Release();
- }
- }
-
- CMIDSoundImpl* soundImpl = NULL;
- switch (aType)
- {
- case com_nokia_mid_sound_Sound_FORMAT_TONE: //Tone
- {
- soundImpl = CMIDTone::NewL(*aData, this);
- break;
- }
- case com_nokia_mid_sound_Sound_FORMAT_BEEP: //Beep
- {
- soundImpl = CMIDTone::NewL(iFreq, iDur, this);
- break;
- }
- case com_nokia_mid_sound_Sound_FORMAT_WAV: //Wav
- {
- soundImpl = CMIDClip::NewL(aData, this);
- break;
- }
- default:
- {
- break;
- }
- }
- if (soundImpl->State() != CMIDSoundImpl::EReadyToPlay)
- {
- TInt state = soundImpl->State();
- delete soundImpl;
- User::Leave(KErrNotReady);
- }
- iRealVolume = soundImpl->Volume();
-
- delete iMIDSound;
- iMIDSound = soundImpl;
-}
-
-TInt CMIDSound::Play(TInt aLoop)
-{
- JELOG2(EJavaUI);
- TInt err = 0;
- CallMethod(err, this, &CMIDSound::DoPlay, aLoop, this);
- return err;
-}
-
-TInt CMIDSound::DoPlay(TInt aLoop)
-{
- JELOG2(EJavaUI);
-
- if ( iMIDSound )
- {
- TInt state = iMIDSound->State();
- if (state != CMIDSoundImpl::EReadyToPlay)
- {
- return state;
- }
- }
- else
- {
- return CMIDSoundImpl::ENotSupported;
- }
- if (!IsAudioEnabled())
- {
- iMIDSound->SetVolume(0);
- }
- return iMIDSound->Play(aLoop);
-}
-
-void CMIDSound::Resume()
-{
- JELOG2(EJavaUI);
- CallMethod(this, &CMIDSound::DoResume, this);
-}
-
-void CMIDSound::DoResume()
-{
- JELOG2(EJavaUI);
- iMIDSound->Resume();
-}
-
-void CMIDSound::Stop()
-{
- JELOG2(EJavaUI);
- CallMethod(this, &CMIDSound::DoStop, this);
-}
-
-void CMIDSound::DoStop()
-{
- JELOG2(EJavaUI);
- iMIDSound->Stop();
-}
-
-TInt CMIDSound::SoundVolume()
-{
- JELOG2(EJavaUI);
- TInt result = 0;
- CallMethod(result, this, &CMIDSound::Volume, this);
- return result;
-}
-
-TInt CMIDSound::Volume()
-{
- JELOG2(EJavaUI);
- return iMIDSound->Volume();
-}
-
-void CMIDSound::SetVolume(TInt aVolume)
-{
- JELOG2(EJavaUI);
- CallMethod(this, &CMIDSound::DoSetVolume, aVolume, this);
-}
-
-void CMIDSound::DoSetVolume(TInt aVolume)
-{
- JELOG2(EJavaUI);
- iRealVolume = aVolume;
- TInt currentState = iMIDSound->State();
- if ((currentState == CMIDSoundImpl::EReadyToPlay) ||
- (currentState == CMIDSoundImpl::EPlaying))
- {
- iMIDSound->SetVolume(IsAudioEnabled() ? aVolume : 0);
- }
-}
-
-
-TInt CMIDSound::PlayerState()
-{
- JELOG2(EJavaUI);
- TInt result = 0;
- CallMethod(result, this, &CMIDSound::State, this);
- return result;
-}
-
-TInt CMIDSound::State()
-{
- JELOG2(EJavaUI);
- return iMIDSound->State();
-}
-
-void CMIDSound::Release()
-{
- JELOG2(EJavaUI);
- CallMethod(this, &CMIDSound::DoRelease, this);
-}
-
-void CMIDSound::DoRelease()
-{
- JELOG2(EJavaUI);
- iMIDSound->Release();
-}
--- a/javauis/nokiasound_akn/src/cmidtone.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,244 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This class implements beep playing and OTA ringingtone playing.
-*
-*/
-
-
-#include <e32std.h>
-#include <e32svr.h>
-
-#include "com_nokia_mid_sound_Sound.h"
-#include "CMIDTone.h"
-#include "MMIDEventSender.h"
-
-namespace
-{
-const TInt KMIDMaxJavaVolume = 255;
-const TInt KMIDMinNativeVolume = 1;
-const TInt KMIDStopSleepTime = 10000;
-const TInt KMIDMicrosInMilli = 1000;
-const TInt KMIDMinDataLength = 4;
-const TInt KMIDLoopForever = 999999;
-}
-
-CMIDTone* CMIDTone::NewL(TInt aFreq, TInt64 aDuration,
- MMIDEventSender* aEventSender)
-{
- CMIDTone* self = new(ELeave) CMIDTone(aEventSender);
- CleanupStack::PushL(self);
- self->ConstructL(aFreq, aDuration);
- CleanupStack::Pop(self);
- return self;
-}
-
-CMIDTone* CMIDTone::NewL(const TDesC8& aData, MMIDEventSender* aEventSender)
-{
- CMIDTone* self = new(ELeave) CMIDTone(aEventSender);
- CleanupStack::PushL(self);
- self->ConstructL(aData);
- CleanupStack::Pop(self);
- return self;
-}
-
-
-CMIDTone::~CMIDTone()
-{
- if (iMdaAudioToneUtility)
- {
- if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityNotReady)
- {
- iMdaAudioToneUtility->CancelPrepare();
- }
- else if (iMdaAudioToneUtility->State()
- == EMdaAudioToneUtilityPlaying)
- {
- iMdaAudioToneUtility->CancelPlay();
- }
- }
- delete iMdaAudioToneUtility;
- delete iSchedulerWait;
-}
-
-CMIDTone::CMIDTone(MMIDEventSender* aEventSender)
- : CMIDSoundImpl(aEventSender)
-{
-}
-
-void CMIDTone::ConstructL(TInt aFreq, TInt64 aDuration)
-{
- CMIDSoundImpl::ConstructL();
- iSchedulerWait = new(ELeave) CActiveSchedulerWait;
- iFreq = aFreq;
- iDuration = aDuration;
- iState = EInitialising;
- iMdaAudioToneUtility = CMdaAudioToneUtility::NewL(*this);
- iMdaAudioToneUtility->PrepareToPlayTone(iFreq,
- TTimeIntervalMicroSeconds(iDuration * KMIDMicrosInMilli));
- iSchedulerWait->Start();
-}
-
-void CMIDTone::ConstructL(const TDesC8& aData)
-{
- CMIDSoundImpl::ConstructL();
- iSchedulerWait = new(ELeave) CActiveSchedulerWait;
- // first byte is the number of command parts
- iFreq = 0;
- iDuration = 0;
- iState = EInitialising;
-
- if (aData.Length() < KMIDMinDataLength)
- {
- iState = ENotSupported;
- User::Leave(KErrArgument);
- }
-
- if (aData[0x000] == 0x02 && aData[0x001] == 0x4a && aData[0x002] == 0x3a)
- {
- iState = EInitialising;
- }
- else if (aData[0x000] == 0x03 && aData[0x001] == 0x4a && aData[0x002] ==
- 0x44 && aData[0x003] == 0x3a)
- {
- iState = EInitialising;
- }
- else if (aData[0] == 0x00 && aData[1] == 0x11)
- {
- iState = EInitialising;
- }
- else
- {
- iState = ENotSupported;
- User::Leave(KErrArgument);
- }
- iMdaAudioToneUtility = CMdaAudioToneUtility::NewL(*this);
- iMdaAudioToneUtility->PrepareToPlayDesSequence(aData);
- iSchedulerWait->Start();
-
-}
-
-TInt CMIDTone::Play(TInt aLoop)
-{
- __ASSERT_DEBUG(iState == EReadyToPlay, User::Invariant());
-
- if (aLoop == 0)
- {
- // There is no known working method to play tone forever
- aLoop = KMIDLoopForever;
- }
-
- // Setting repeats to 1 causes sound played twice
- if (aLoop == 1)
- {
- iMdaAudioToneUtility->SetRepeats(0, TTimeIntervalMicroSeconds(0));
- }
- else if (aLoop > 1)
- {
- iMdaAudioToneUtility->SetRepeats(aLoop, TTimeIntervalMicroSeconds(0));
- }
-
- iMdaAudioToneUtility->Play();
-
- iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_PLAYING);
- iState = EPlaying;
- iPlayed = ETrue;
-
- return KErrNone;
-}
-
-void CMIDTone::Stop()
-{
- if (iState == EPlaying)
- {
- iMdaAudioToneUtility->CancelPlay();
- // sleep to make sure the device has time to stop
- User::After(TTimeIntervalMicroSeconds32(KMIDStopSleepTime)); // CSI: 92 MdaAudioToneUtility does not send event when stopping has finished #
- iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED);
- iState = EReadyToPlay;
- }
-}
-
-void CMIDTone::SetVolume(TInt aVolume)
-{
- TInt maxVolume = iMdaAudioToneUtility->MaxVolume();
- TInt volume = 0;
- if (aVolume)
- {
- volume = (((maxVolume
- - KMIDMinNativeVolume + 1)
- * aVolume)
- / (KMIDMaxJavaVolume + 1)) + KMIDMinNativeVolume;
- }
- iMdaAudioToneUtility->SetVolume(volume);
-}
-
-TInt CMIDTone::Volume()
-{
- TInt maxVolume = iMdaAudioToneUtility->MaxVolume();
- TInt volume = (iMdaAudioToneUtility->Volume() *
- KMIDMaxJavaVolume) / maxVolume;
-
- return volume;
-}
-
-void CMIDTone::MatoPrepareComplete(TInt aError)
-{
- if (aError == KErrNone)
- {
- iState = EReadyToPlay;
- }
- else
- {
- if (aError == KErrNotSupported)
- {
- iState = ENotSupported;
- }
- else
- {
- iState = ENotReady;
- }
- }
- iSchedulerWait->AsyncStop();
-}
-
-void CMIDTone::MatoPlayComplete(TInt aError)
-{
- if (KErrNone == aError)
- {
- iEventSender->SendEvent(com_nokia_mid_sound_Sound_SOUND_STOPPED);
- iState = EReadyToPlay;
- }
-}
-
-void CMIDTone::Release()
-{
- iState = ENotReady;
- if (iMdaAudioToneUtility)
- {
- if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityNotReady)
- {
- iMdaAudioToneUtility->CancelPrepare();
- }
- else if (iMdaAudioToneUtility->State() == EMdaAudioToneUtilityPlaying
- || iState == EPlaying)
- {
- iMdaAudioToneUtility->CancelPlay();
- }
- }
- delete iMdaAudioToneUtility;
- iMdaAudioToneUtility = NULL;
- iState = ENotReady;
-}
-
-// End of File
--- a/javauis/nokiasound_akn/src/sound.cpp Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: JNI class for Sound.java.
-*
-*/
-
-
-#include <e32def.h> // MAKE_TINT64 Warning fix
-
-#include "com_nokia_mid_sound_Sound.h"
-#include "CMIDSound.h"
-#include "javajniutils.h"
-#include "javacommonutils.h"
-#include "logger.h"
-
-/*
- * Class: com_nokia_mid_sound_Sound
- * Method: _dispose
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1dispose
-(JNIEnv* /* aJni */, jobject /* aSound */, jint aHandle)
-{
- JELOG2(EJavaUI);
- CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
- delete sound;
-}
-
-/*
- * Class: com_nokia_mid_sound_Sound
- * Method: _create
- * Signature: (I)I
- */
-JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1create
-(JNIEnv* aJni, jobject aSound)
-{
- JELOG2(EJavaUI);
-
- TInt handle(0);
- CMIDSound* sound = 0;
- TRAPD(err,
- {
- sound = CMIDSound::NewL(*aJni, aSound);
- if (sound != 0)
- {
- sound->InitProfileListener();
- }
- });
-
- if (err != KErrNone)
- {
-
- java::util::JniUtils::throwNewException(aJni, "java/lang/RuntimeException" ,
- "Failed to create Native Peer " +
- java::util::JavaCommonUtils::intToString(err));
- }
- else
- {
-
- handle = reinterpret_cast<TInt>(sound);
- }
- return handle;
-}
-
-/*
- * Class: com_nokia_mid_sound_Sound
- * Method: _init
- * Signature: (III[BIJ)I
- */
-JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1init
-(JNIEnv* aJni, jobject, jint aHandle, jint aType, jbyteArray aData,
- jint aFrequency, jlong aDuration)
-{
- JELOG2(EJavaUI);
- TInt freq(aFrequency);
- TInt64 duration = *reinterpret_cast<TInt64*>(&aDuration);
-
- CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
-
- TPtrC8 ptr;
- jbyte* data = NULL;
-
- if (aType != com_nokia_mid_sound_Sound_FORMAT_BEEP)
- {
- if (!aData)
- {
- return KErrGeneral;
- }
- data = aJni->GetByteArrayElements(aData,0);
- jint length = aJni->GetArrayLength(aData);
- ptr.Set((TUint8*)data, length);
- }
-
- // Had to make SetBeep() due to number of maximum parameters in ExecuteTrap.
- sound->SetBeep(freq, duration);
- TInt err = sound->Init(aType, (const TDesC8*)&ptr);
-
- if (aType != com_nokia_mid_sound_Sound_FORMAT_BEEP)
- {
- aJni->ReleaseByteArrayElements(aData, data, 0);
- }
- return err;
-}
-
-/*
- * Class: com_nokia_mid_sound_Sound
- * Method: _release
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1release
-(JNIEnv*, jobject, jint aHandle)
-{
- JELOG2(EJavaUI);
- CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
- sound->Release();
-}
-
-
-/*
- * Class: com_nokia_mid_sound_Sound
- * Method: _play
- * Signature: (II)I
- */
-JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1play
-(JNIEnv*, jobject, jint aHandle, jint aLoop)
-{
- JELOG2(EJavaUI);
- CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
- TInt err = sound->Play(aLoop);
- return err;
-}
-
-/*
- * Class: com_nokia_mid_sound_Sound
- * Method: _stop
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1stop
-(JNIEnv*, jobject, jint aHandle)
-{
- JELOG2(EJavaUI);
- CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
- sound->Stop();
-}
-
-/*
- * Class: com_nokia_mid_sound_Sound
- * Method: _resume
- * Signature: (II)V
- */
-JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1resume
-(JNIEnv*, jobject, jint aHandle)
-{
- JELOG2(EJavaUI);
- CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
- sound->Resume();
-}
-
-/*
- * Class: com_nokia_mid_sound_Sound
- * Method: _setVolume
- * Signature: (III)V
- */
-JNIEXPORT void JNICALL Java_com_nokia_mid_sound_Sound__1setVolume
-(JNIEnv*, jobject, jint aHandle, jint aVolume)
-{
- JELOG2(EJavaUI);
- CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
- sound->SetVolume(aVolume);
-}
-
-/*
- * Class: com_nokia_mid_sound_Sound
- * Method: _volume
- * Signature: (II)I
- */
-JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1volume
-(JNIEnv*, jobject, jint aHandle)
-{
- JELOG2(EJavaUI);
- CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
- TInt volume = sound->SoundVolume();
- return(volume);
-}
-
-/*
- * Class: com_nokia_mid_sound_Sound
- * Method: _getState
- * Signature: (II)I
- */
-JNIEXPORT jint JNICALL Java_com_nokia_mid_sound_Sound__1getState
-(JNIEnv*, jobject, jint aHandle)
-{
- JELOG2(EJavaUI);
- CMIDSound* sound = reinterpret_cast<CMIDSound*>(aHandle);
- TInt state = sound->PlayerState();
- return state;
-}
--- a/javauis/remconobserver_akn/build/javaremconobserver_0x2002DCCA.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/remconobserver_akn/build/javaremconobserver_0x2002DCCA.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javaremconobserver.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javauis/runtimeui_akn/build/javaruntimeui_0x2002DCCD.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/runtimeui_akn/build/javaruntimeui_0x2002DCCD.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javaruntimeui.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../src.s60
--- a/javauis/runtimeui_akn/loc/javausermessages.loc Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/runtimeui_akn/loc/javausermessages.loc Thu Aug 19 09:48:13 2010 +0300
@@ -450,6 +450,18 @@
#define qtn_java_secur_error_drm_rights_not_valid "No digital rights to launch application."
// d:Security error message:
+// d:short error message
+// l:popup_info_list_pane_t1
+//
+#define qtn_java_secur_error_jar_not_found "Application's deployment package not found."
+
+// d:Security error message:
+// d:short error message
+// l:popup_info_list_pane_t1
+//
+#define qtn_java_secur_error_jar_not_found_details "Possible reasons for the missing files: the files might reside on a memory card which is not currently present or has been formatted."
+
+// d:Security error message:
// d:detailed error message
// l:popup_info_list_pane_t1
//
--- a/javauis/softnotification_akn/build/javasoftnotification_0x2002DCD6.mmp Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/softnotification_akn/build/javasoftnotification_0x2002DCD6.mmp Thu Aug 19 09:48:13 2010 +0300
@@ -16,7 +16,7 @@
*/
// ==============================================================================
-// Generated by qmake (2.01a) (Qt 4.6.3) on: (date)
+// Generated by qmake (2.01a) (Qt 4.6.4) on: (date)
// This file is generated by qmake and should not be modified by the
// user.
// Name : javasoftnotification.mmp
@@ -52,7 +52,6 @@
MACRO RD_JAVA_MIDPRMS_DB
MACRO __SYMBIAN32__
MACRO J9EPOC32
-MACRO RD_JAVA_OMJ_FSERVER
SYSTEMINCLUDE ../../../../../mw/qt/mkspecs/common/symbian
SYSTEMINCLUDE ../inc
--- a/javauis/subsystem.mk Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/subsystem.mk Thu Aug 19 09:48:13 2010 +0300
@@ -23,13 +23,16 @@
NONQTSUBSYSTEMS += \
coreui/build
+COMPONENTS += nokiasound/build
#
# Common legacy utilities
#
SUBSYSTEMS += javalegacyutils
-SYMBIAN_ONLY += javalegacyutils
+
+SYMBIAN_ONLY += javalegacyutils nokiasound/build
+
#
--- a/javauis/subsystem_akn.mk Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/subsystem_akn.mk Thu Aug 19 09:48:13 2010 +0300
@@ -22,7 +22,6 @@
m2g_akn/build \
m3g_akn/build \
mmapi_akn/build \
- nokiasound_akn/build \
remconobserver_akn/build \
runtimeui_akn/build \
softnotification_akn/build
--- a/javauis/subsystem_qt.mk Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/subsystem_qt.mk Thu Aug 19 09:48:13 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"
@@ -14,6 +14,10 @@
# Description: Makefile for Qt based components and subsystems
#
-COMPONENTS += eswt_qt/build lcdui_qt/build runtimeui_qt/build nokiauiapi_qt/build mmapi_qt/build amms_qt/build
+SUBSYSTEMS += eswt_qt/build
+COMPONENTS += lcdui_qt/build runtimeui_qt/build nokiauiapi_qt/build mmapi_qt/build amms_qt/build m3g_qt/build
SYMBIAN_ONLY += mmapi_qt/build amms_qt/build m3g_qt/build
+
+# Build order dependency
+lcdui_qt/build runtimeui_qt/build nokiauiapi_qt/build mmapi_qt/build amms_qt/build m3g_qt/build: eswt_qt/build
--- a/javauis/tsrc/fute/lcdui/Midp_Alert_01/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/tsrc/fute/lcdui/Midp_Alert_01/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -28,7 +28,7 @@
<property name="midlet.permissions" value=""/>
<property name="package.name" value="Midp_Alert_01"/>
<property name="company.name" value="Nokia"/>
- <property name="midlet.version" value="1.1"/>
+ <property name="midlet.version" value="1.2"/>
<property name="midlet.description" value=""/>
<!-- Get settings for a basic MIDlet. -->
--- a/javauis/tsrc/fute/lcdui/Midp_Alert_01/src/AlertTests.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/tsrc/fute/lcdui/Midp_Alert_01/src/AlertTests.java Thu Aug 19 09:48:13 2010 +0300
@@ -156,6 +156,14 @@
errorAlert.setTimeout(Alert.FOREVER);
Display.getDisplay(parent).setCurrent(errorAlert);
}
+ catch (IllegalArgumentException e)
+ {
+ System.out.println("Exception: " + e.toString());
+ Alert errorAlert = new Alert("Exception", e.toString(), null,
+ AlertType.ERROR);
+ errorAlert.setTimeout(Alert.FOREVER);
+ Display.getDisplay(parent).setCurrent(errorAlert);
+ }
}
else if (c == cmdExit)
{
--- a/javauis/tsrc/fute/lcdui/Midp_Form_01/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/tsrc/fute/lcdui/Midp_Form_01/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -28,7 +28,7 @@
<property name="midlet.permissions" value=""/>
<property name="package.name" value="Midp_Form_01"/>
<property name="company.name" value="Nokia"/>
- <property name="midlet.version" value="1.1"/>
+ <property name="midlet.version" value="1.2"/>
<property name="midlet.description" value=""/>
<!-- Get settings for a basic MIDlet. -->
--- a/javauis/tsrc/fute/lcdui/Midp_Form_01/src/FormMethodsTests.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/tsrc/fute/lcdui/Midp_Form_01/src/FormMethodsTests.java Thu Aug 19 09:48:13 2010 +0300
@@ -56,7 +56,7 @@
private final String imgStr = "ImageItem";
- private final String spacerStr = "Spacer";
+ private final String spacerStr = "Spacer (100x100)";
private ChoiceGroup cg = null;
@@ -324,7 +324,7 @@
else if (item.equals(imgStr))
addImageItem();
else if (item.equals(spacerStr))
- addSpacer(10,10);
+ addSpacer(100,100);
else if (item.equals(tfStr))
{
addTextField("ANY", TextField.ANY);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/tsrc/fute/lcdui/Midp_General/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,113 @@
+<!--
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+-->
+
+<project name="Midp_General" default="pack">
+
+ <!-- Get general settings for MIDlet projects. -->
+ <import file="../../properties.xml"/>
+
+ <!-- Set properties for this project. -->
+ <property name="midlet1.name" value="Midp_General_01"/>
+ <property name="midlet1.icon.name" value=""/>
+ <property name="midlet1.package.name" value="Midp_General_01"/>
+ <property name="midlet2.name" value="Midp_General_02"/>
+ <property name="midlet2.icon.name" value=""/>
+ <property name="midlet2.package.name" value="Midp_General_02"/>
+ <property name="midlet3.name" value="Midp_General_03"/>
+ <property name="midlet3.icon.name" value=""/>
+ <property name="midlet3.package.name" value="Midp_General_03"/>
+ <property name="midlet4.name" value="Midp_General_04"/>
+ <property name="midlet4.icon.name" value=""/>
+ <property name="midlet4.package.name" value="Midp_General_04"/>
+ <property name="midlet5.name" value="Midp_General_05"/>
+ <property name="midlet5.icon.name" value=""/>
+ <property name="midlet5.package.name" value="Midp_General_05"/>
+ <property name="midlet.permissions" value=""/>
+ <property name="package.name" value="Midp_General"/>
+ <property name="company.name" value="Nokia"/>
+ <property name="midlet.version" value="1.2"/>
+ <property name="midlet.description" value=""/>
+
+ <!-- Package Preverifed classes, resources and MANIFEST file -->
+ <target name="pack" depends="preverify">
+ <wtkjad jadfile="${bin}/${package.name}.jad"
+ jarfile="${bin}/${package.name}.jar"
+ update="true"
+ config="1.1"
+ profile="2.1"
+ manifest="${bin}/MANIFEST.MF"
+ name="${package.name}"
+ vendor="${company.name}">
+ <attribute name="MIDlet-Permissions" value="${midlet.permissions}"/>
+ <attribute name="MicroEdition-Profile" value="MIDP-2.1"/>
+ <attribute name="MicroEdition-Configuration" value="CLDC-1.1"/>
+ <attribute name="MIDlet-Version" value="${midlet.version}"/>
+ <attribute name="MIDlet-Description" value="${midlet.description}"/>
+ <attribute name="Nokia-UI-Enhancement" value="PopUpTextBox"/>
+ <midlet name="${midlet1.name}" icon="${midlet1.icon.name}" class="${midlet1.package.name}" />
+ <midlet name="${midlet2.name}" icon="${midlet2.icon.name}" class="${midlet2.package.name}" />
+ <midlet name="${midlet3.name}" icon="${midlet3.icon.name}" class="${midlet3.package.name}" />
+ <midlet name="${midlet4.name}" icon="${midlet4.icon.name}" class="${midlet4.package.name}" />
+ <midlet name="${midlet5.name}" icon="${midlet5.icon.name}" class="${midlet5.package.name}" />
+ </wtkjad>
+
+ <wtkjad jadfile="${bin}/${package.name}_fullscreen_textbox.jad"
+ jarfile="${bin}/${package.name}.jar"
+ update="true"
+ config="1.1"
+ profile="2.1"
+ manifest="${bin}/MANIFEST.MF"
+ name="${package.name}"
+ vendor="${company.name}">
+ <attribute name="MIDlet-Permissions" value="${midlet.permissions}"/>
+ <attribute name="MicroEdition-Profile" value="MIDP-2.1"/>
+ <attribute name="MicroEdition-Configuration" value="CLDC-1.1"/>
+ <attribute name="MIDlet-Version" value="${midlet.version}"/>
+ <attribute name="MIDlet-Description" value="${midlet.description}"/>
+ <attribute name="Nokia-UI-Enhancement" value="FullScreenTextBox"/>
+ <midlet name="${midlet1.name}" icon="${midlet1.icon.name}" class="${midlet1.package.name}" />
+ <midlet name="${midlet2.name}" icon="${midlet2.icon.name}" class="${midlet2.package.name}" />
+ <midlet name="${midlet3.name}" icon="${midlet3.icon.name}" class="${midlet3.package.name}" />
+ <midlet name="${midlet4.name}" icon="${midlet4.icon.name}" class="${midlet4.package.name}" />
+ <midlet name="${midlet5.name}" icon="${midlet5.icon.name}" class="${midlet5.package.name}" />
+ </wtkjad>
+
+ <wtkpackage
+ jarfile="${bin}/${package.name}.jar"
+ jadfile="${bin}/${package.name}.jad"
+ classpath="${project.class.path}"
+ basedir="${prever}"
+ autoversion="false">
+ <exclude_from_manifest name="Nokia-UI-Enhancement"/>
+ <fileset dir="${res}"
+ excludes="**/distribution.policy.s60" />
+ </wtkpackage>
+
+ <wtkpackage
+ jarfile="${bin}/${package.name}.jar"
+ jadfile="${bin}/${package.name}_fullscreen_textbox.jad"
+ classpath="${project.class.path}"
+ basedir="${prever}"
+ autoversion="false">
+ <exclude_from_manifest name="Nokia-UI-Enhancement"/>
+ <fileset dir="${res}"
+ excludes="**/distribution.policy.s60" />
+ </wtkpackage>
+ </target>
+
+</project>
\ No newline at end of file
Binary file javauis/tsrc/fute/lcdui/Midp_General/res/small.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/tsrc/fute/lcdui/Midp_General/src/EmptyForm.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+ * import midp classes.
+ */
+import javax.microedition.midlet.*;
+import javax.microedition.lcdui.*;
+
+/**
+ * This is the main class for the empty Form.
+ */
+
+public class EmptyForm extends Form
+{
+
+ /**
+ * The constructor creates and displays the Form.
+ *
+ *@param parent is the parent midlet.
+ */
+ public EmptyForm(MIDlet parent)
+ {
+ super(parent.getClass().getName());
+ Display.getDisplay(parent).setCurrent(this);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_01.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,72 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+ * import midp classes.
+ */
+import javax.microedition.midlet.*;
+import javax.microedition.lcdui.*;
+
+/**
+ * This is the main class for the Midp_General_01 tests.
+ */
+
+public class Midp_General_01 extends MIDlet implements CommandListener
+{
+ private Form theForm;
+ private Command cmdExit = new Command("Exit", Command.EXIT, 1);
+
+ /**
+ * Signals the MIDlet to start and enter the Active state.
+ */
+ protected void startApp()
+ {
+ theForm = new EmptyForm(this);
+ theForm.addCommand(cmdExit);
+ theForm.setCommandListener(this);
+ }
+
+ /**
+ * Signals the MIDlet to terminate and enter the Destroyed state.
+ *
+ */
+ protected void destroyApp(boolean unconditional)
+ {
+ }
+
+ /**
+ * Signals the MIDlet to stop and enter the Paused state.
+ */
+ protected void pauseApp()
+ {
+ }
+
+ /**
+ * This method handles command invocations.
+ *
+ *@param c This is the command responsible for the event.
+ *@param s Should be equal to this.
+ */
+ public void commandAction(Command c, Displayable s)
+ {
+ if (c == cmdExit)
+ {
+ destroyApp(false);
+ notifyDestroyed();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_02.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+ * import midp classes.
+ */
+import javax.microedition.midlet.*;
+import javax.microedition.lcdui.*;
+
+/**
+ * This is the main class for the Midp_General_02 tests.
+ */
+
+public class Midp_General_02 extends MIDlet implements CommandListener
+{
+
+ TextBox tb;
+ Display display;
+ private Command cmdExit = new Command("Exit", Command.EXIT, 1);
+
+ String theText = "This is a TextBox with very long text blah blah blah blah blah blah" +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah" +
+ "This is the last sentence.";
+
+ public Midp_General_02()
+ {
+ tb = new TextBox("TextBox", theText, 1000, TextField.ANY);
+ tb.addCommand(cmdExit);
+ tb.setCommandListener(this);
+ display = Display.getDisplay(this);
+ }
+
+ /**
+ * Signals the MIDlet to start and enter the Active state.
+ */
+ protected void startApp()
+ {
+ display.setCurrent(tb);
+ }
+
+ /**
+ * Signals the MIDlet to terminate and enter the Destroyed state.
+ *
+ */
+ protected void destroyApp(boolean unconditional)
+ {
+ }
+
+ /**
+ * Signals the MIDlet to stop and enter the Paused state.
+ */
+ protected void pauseApp()
+ {
+ }
+
+ /**
+ * This method handles command invocations.
+ *
+ *@param c This is the command responsible for the event.
+ *@param s Should be equal to this.
+ */
+ public void commandAction(Command c, Displayable s)
+ {
+ if (c == cmdExit)
+ {
+ destroyApp(false);
+ notifyDestroyed();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_03.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,80 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+ * import midp classes.
+ */
+import javax.microedition.midlet.*;
+import javax.microedition.lcdui.*;
+
+/**
+ * This is the main class for the Midp_General_03 tests.
+ */
+
+public class Midp_General_03 extends MIDlet implements CommandListener
+{
+
+ private List emptyList;
+ private Display display;
+ private Command cmdExit = new Command("Exit", Command.EXIT, 1);
+
+ public Midp_General_03()
+ {
+ emptyList = new List("List", List.EXCLUSIVE);
+ emptyList.addCommand(cmdExit);
+ emptyList.setCommandListener(this);
+ display = Display.getDisplay(this);
+ }
+
+ /**
+ * Signals the MIDlet to start and enter the Active state.
+ */
+ protected void startApp()
+ {
+ display.setCurrent(emptyList);
+ }
+
+ /**
+ * Signals the MIDlet to terminate and enter the Destroyed state.
+ *
+ */
+ protected void destroyApp(boolean unconditional)
+ {
+ }
+
+ /**
+ * Signals the MIDlet to stop and enter the Paused state.
+ */
+ protected void pauseApp()
+ {
+ }
+
+ /**
+ * This method handles command invocations.
+ *
+ *@param c This is the command responsible for the event.
+ *@param s Should be equal to this.
+ */
+ public void commandAction(Command c, Displayable s)
+ {
+ if (c == cmdExit)
+ {
+ destroyApp(false);
+ notifyDestroyed();
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_04.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,108 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+ * import midp classes.
+ */
+import javax.microedition.midlet.*;
+import javax.microedition.lcdui.*;
+
+/**
+ * This is the main class for the Midp_General_04 tests.
+ */
+
+public class Midp_General_04 extends MIDlet implements CommandListener
+{
+
+ private Alert alert;
+ private Display display;
+ private Gauge indicator;
+ private Image image;
+ private Command cmdScreen = new Command("Screen cmd", Command.SCREEN, 1);
+ private Command cmdExit = new Command("Exit", Command.EXIT, 1);
+
+ private String alertText = "This is a modal alert with very long text blah blah blah blah blah blah " +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah " +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah " +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah " +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah " +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah " +
+ "blah blah blah blah blah blah blah blah blah blah blah blah blah blah";
+
+ public Midp_General_04()
+ {
+ alert = new Alert("Alert title", alertText, null, AlertType.INFO);
+ alert.addCommand(cmdExit);
+ alert.addCommand(cmdScreen);
+ alert.setCommandListener(this);
+ indicator = new Gauge(null, false, Gauge.INDEFINITE, Gauge.CONTINUOUS_RUNNING);
+ alert.setIndicator(indicator);
+
+ try
+ {
+ image = Image.createImage("/small.png");
+ }
+ catch (java.io.IOException e)
+ {
+ }
+ alert.setImage(image);
+
+ display = Display.getDisplay(this);
+ }
+
+ /**
+ * Signals the MIDlet to start and enter the Active state.
+ */
+ protected void startApp()
+ {
+ display.setCurrent(alert);
+ }
+
+ /**
+ * Signals the MIDlet to terminate and enter the Destroyed state.
+ *
+ */
+ protected void destroyApp(boolean unconditional)
+ {
+ }
+
+ /**
+ * Signals the MIDlet to stop and enter the Paused state.
+ */
+ protected void pauseApp()
+ {
+ }
+
+ /**
+ * This method handles command invocations.
+ *
+ *@param c This is the command responsible for the event.
+ *@param s Should be equal to this.
+ */
+ public void commandAction(Command c, Displayable s)
+ {
+ if (c == cmdExit)
+ {
+ destroyApp(false);
+ notifyDestroyed();
+ }
+ else if (c == cmdScreen)
+ {
+ alert.setTitle("Command run");
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/javauis/tsrc/fute/lcdui/Midp_General/src/Midp_General_05.java Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,89 @@
+/*
+* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+/**
+ * import midp classes.
+ */
+import javax.microedition.midlet.*;
+import javax.microedition.lcdui.*;
+
+/**
+ * This is the main class for the Midp_General_05 tests.
+ */
+
+public class Midp_General_05 extends MIDlet implements CommandListener
+{
+
+ private Canvas canvas;
+ private Display display;
+ private Command cmdExit = new Command("Exit", Command.EXIT, 1);
+
+ public Midp_General_05()
+ {
+ display = Display.getDisplay(this);
+ canvas = new EmptyCanvas();
+ canvas.addCommand(cmdExit);
+ canvas.setCommandListener(this);
+ }
+
+ /**
+ * Signals the MIDlet to start and enter the Active state.
+ */
+ protected void startApp()
+ {
+ display.setCurrent(canvas);
+ }
+
+ /**
+ * Signals the MIDlet to terminate and enter the Destroyed state.
+ *
+ */
+ protected void destroyApp(boolean unconditional)
+ {
+ }
+
+ /**
+ * Signals the MIDlet to stop and enter the Paused state.
+ */
+ protected void pauseApp()
+ {
+ }
+
+ /**
+ * This method handles command invocations.
+ *
+ *@param c This is the command responsible for the event.
+ *@param s Should be equal to this.
+ */
+ public void commandAction(Command c, Displayable s)
+ {
+ if (c == cmdExit)
+ {
+ destroyApp(false);
+ notifyDestroyed();
+ }
+ }
+}
+
+class EmptyCanvas extends Canvas
+{
+ protected void paint(Graphics g)
+ {
+ g.setColor(0, 0, 0);
+ g.drawString("Empty Canvas", getWidth()/2, getHeight()/2, Graphics.TOP | Graphics.HCENTER);
+ }
+}
--- a/javauis/tsrc/fute/lcdui/Midp_General_02/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-<!--
-#
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
--->
-
-<project name="Midp_General_02" default="pack">
-
- <!-- Get general settings for MIDlet projects. -->
- <import file="../../properties.xml"/>
-
- <!-- Set properties for this project. -->
- <property name="midlet1.name" value="Midp_General_02"/>
- <property name="midlet1.icon.name" value=""/>
- <property name="midlet1.package.name" value="Midp_General_02"/>
- <property name="midlet.permissions" value=""/>
- <property name="package.name" value="Midp_General_02"/>
- <property name="company.name" value="Nokia"/>
- <property name="midlet.version" value="1.0"/>
- <property name="midlet.description" value=""/>
-
- <!-- Get settings for a basic MIDlet. -->
- <import file="../../properties-basic-midlet.xml"/>
-
-</project>
\ No newline at end of file
--- a/javauis/tsrc/fute/lcdui/Midp_General_02/src/Midp_General_02.java Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-/**
- * import midp classes.
- */
-import javax.microedition.midlet.*;
-import javax.microedition.lcdui.*;
-
-/**
- *
- */
-
-public class Midp_General_02 extends MIDlet
-{
-
- TextBox tb;
- Display display;
-
- public Midp_General_02()
- {
- tb = new TextBox("TextBox", null, 1000, TextField.ANY);
- display = Display.getDisplay(this);
- }
-
- /**
- * Signals the MIDlet to start and enter the Active state.
- */
- protected void startApp()
- {
- display.setCurrent(tb);
- }
-
- /**
- * Signals the MIDlet to terminate and enter the Destroyed state.
- *
- */
- protected void destroyApp(boolean unconditional)
- {
- }
-
- /**
- * Signals the MIDlet to stop and enter the Paused state.
- */
- protected void pauseApp()
- {
- }
-}
-
--- a/javauis/tsrc/fute/lcdui/Midp_General_04/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-<!--
-#
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
--->
-
-<project name="Midp_General_04" default="pack">
-
- <!-- Get general settings for MIDlet projects. -->
- <import file="../../properties.xml"/>
-
- <!-- Set properties for this project. -->
- <property name="midlet1.name" value="Midp_General_04"/>
- <property name="midlet1.icon.name" value=""/>
- <property name="midlet1.package.name" value="Midp_General_04"/>
- <property name="midlet.permissions" value=""/>
- <property name="package.name" value="Midp_General_04"/>
- <property name="company.name" value="Nokia"/>
- <property name="midlet.version" value="1.0"/>
- <property name="midlet.description" value=""/>
-
- <!-- Get settings for a basic MIDlet. -->
- <import file="../../properties-basic-midlet.xml"/>
-
-</project>
\ No newline at end of file
--- a/javauis/tsrc/fute/lcdui/Midp_General_04/src/Midp_General_04.java Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-/**
- * import midp classes.
- */
-import javax.microedition.midlet.*;
-import javax.microedition.lcdui.*;
-
-/**
- *
- */
-
-public class Midp_General_04 extends MIDlet
-{
-
- private Alert alert;
- private Display display;
-
- public Midp_General_04()
- {
- alert = new Alert("Alert title", "Alert Text", null, AlertType.INFO);
- display = Display.getDisplay(this);
- }
-
- /**
- * Signals the MIDlet to start and enter the Active state.
- */
- protected void startApp()
- {
- display.setCurrent(alert);
- }
-
- /**
- * Signals the MIDlet to terminate and enter the Destroyed state.
- *
- */
- protected void destroyApp(boolean unconditional)
- {
- }
-
- /**
- * Signals the MIDlet to stop and enter the Paused state.
- */
- protected void pauseApp()
- {
- }
-}
-
--- a/javauis/tsrc/fute/lcdui/Midp_General_05/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-<!--
-#
-# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
--->
-
-<project name="Midp_General_05" default="pack">
-
- <!-- Get general settings for MIDlet projects. -->
- <import file="../../properties.xml"/>
-
- <!-- Set properties for this project. -->
- <property name="midlet1.name" value="Midp_General_05"/>
- <property name="midlet1.icon.name" value=""/>
- <property name="midlet1.package.name" value="Midp_General_05"/>
- <property name="midlet.permissions" value=""/>
- <property name="package.name" value="Midp_General_05"/>
- <property name="company.name" value="Nokia"/>
- <property name="midlet.version" value="1.0"/>
- <property name="midlet.description" value=""/>
-
- <!-- Get settings for a basic MIDlet. -->
- <import file="../../properties-basic-midlet.xml"/>
-
-</project>
\ No newline at end of file
--- a/javauis/tsrc/fute/lcdui/Midp_General_05/src/Midp_General_05.java Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-/**
- * import midp classes.
- */
-import javax.microedition.midlet.*;
-import javax.microedition.lcdui.*;
-
-/**
- *
- */
-
-public class Midp_General_05 extends MIDlet
-{
-
- private Canvas canvas;
- private Display display;
-
- public Midp_General_05()
- {
- display = Display.getDisplay(this);
- canvas = new EmptyCanvas();
- }
-
- /**
- * Signals the MIDlet to start and enter the Active state.
- */
- protected void startApp()
- {
- display.setCurrent(canvas);
- }
-
- /**
- * Signals the MIDlet to terminate and enter the Destroyed state.
- *
- */
- protected void destroyApp(boolean unconditional)
- {
- }
-
- /**
- * Signals the MIDlet to stop and enter the Paused state.
- */
- protected void pauseApp()
- {
- }
-}
-
-class EmptyCanvas extends Canvas
-{
- protected void paint(Graphics g)
- {
- g.setColor(0, 0, 0);
- g.drawString("Empty Canvas", getWidth()/2, getHeight()/2, Graphics.TOP | Graphics.HCENTER);
- }
-}
-
--- a/javauis/tsrc/fute/lcdui/Midp_StringItem_01/build.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/tsrc/fute/lcdui/Midp_StringItem_01/build.xml Thu Aug 19 09:48:13 2010 +0300
@@ -28,7 +28,7 @@
<property name="midlet.permissions" value=""/>
<property name="package.name" value="Midp_StringItem_01"/>
<property name="company.name" value="Nokia"/>
- <property name="midlet.version" value="1.1"/>
+ <property name="midlet.version" value="1.2"/>
<property name="midlet.description" value=""/>
<!-- Get settings for a basic MIDlet. -->
--- a/javauis/tsrc/fute/lcdui/Midp_StringItem_01/src/FormStringItemTests.java Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/tsrc/fute/lcdui/Midp_StringItem_01/src/FormStringItemTests.java Thu Aug 19 09:48:13 2010 +0300
@@ -62,9 +62,11 @@
//the command to create the StringItem with the entered label and text and with focus
private Command cmdCreateHL = new Command("Create as Hyperlink", Command.SCREEN, 1);
+ private Command cmdCreateHLM = new Command("Create as Hyperlink 2 cmds", Command.SCREEN, 1);
//the command to create the StringItem with the entered label and text and with focus
private Command cmdCreateButton = new Command("Create as Button", Command.SCREEN, 1);
+ private Command cmdCreateButtonM = new Command("Create as Button 2 cmds", Command.SCREEN, 1);
//the command to unlock the Item
private Command cmdUnlock = new Command("Unlock", Command.SCREEN, 1);
@@ -97,6 +99,11 @@
private Command cmdNext = new Command("Next", Command.SCREEN, 1);
private Command cmdExit = new Command("Exit", Command.EXIT, 1);
+ // commands for the form
+ private Command cmdItemF = new Command("ItemF", Command.ITEM, 1);
+ private Command cmdOkF = new Command("OkF", Command.OK, 1);
+ private Command cmdScreenF = new Command("Add form commands", Command.SCREEN, 1);
+
static int change = -1;
public FormStringItemTests(Midp_StringItem_01 m)
@@ -118,7 +125,9 @@
append(cg);
addCommand(cmdCreate);
addCommand(cmdCreateHL);
+ addCommand(cmdCreateHLM);
addCommand(cmdCreateButton);
+ addCommand(cmdCreateButtonM);
addCommand(cmdLayout);
addCommand(cmdLayoutHL);
addCommand(cmdLayoutButton);
@@ -134,6 +143,7 @@
//create StringItemForm
stringItemForm = new Form("StringItem");
stringItemForm.addCommand(cmdBack);
+ stringItemForm.addCommand(cmdScreenF);
stringItemForm.setCommandListener(this);
}
@@ -223,39 +233,27 @@
}
else if (c == cmdLayout)
{
-
layoutTest(Item.PLAIN);
-
}
else if (c == cmdLayoutHL)
{
-
layoutTest(Item.HYPERLINK);
-
}
else if (c == cmdLayoutButton)
{
-
layoutTest(Item.BUTTON);
-
}
else if (c == cmdVLayout)
{
-
verticalLayoutTest(Item.PLAIN);
-
}
else if (c == cmdVLayoutHL)
{
-
verticalLayoutTest(Item.HYPERLINK);
-
}
else if (c == cmdVLayoutButton)
{
-
verticalLayoutTest(Item.BUTTON);
-
}
else if (c == cmdAddListeners)
{
@@ -272,6 +270,11 @@
m.destroyApp(false);
m.notifyDestroyed();
}
+ else if (c == cmdScreenF)
+ {
+ stringItemForm.addCommand(cmdItemF);
+ stringItemForm.addCommand(cmdOkF);
+ }
else
{
String l = label.getString();
@@ -282,12 +285,12 @@
if (c == cmdCreate)
si = new StringItem(l, t);
- else if (c == cmdCreateHL)
+ else if (c == cmdCreateHL || c == cmdCreateHLM)
{
si = new StringItem(l, t, Item.HYPERLINK);
si.setDefaultCommand(cmdItem);
}
- else if (c == cmdCreateButton)
+ else if (c == cmdCreateButton || c == cmdCreateButtonM)
{
si = new StringItem(l, t, Item.BUTTON);
si.setDefaultCommand(cmdItem);
@@ -352,6 +355,10 @@
stringItemForm.addCommand(cmdRemoveCommand);
stringItemForm.addCommand(cmdRestoreCommand);
stringItemForm.addCommand(cmdRemoveItem);
+ if (c == cmdCreateButtonM || c == cmdCreateHLM)
+ {
+ si.addCommand(cmdBack);
+ }
Display.getDisplay(m).setCurrent(stringItemForm);
}
}
--- a/layers.sysdef.xml Thu Jul 15 18:31:06 2010 +0300
+++ b/layers.sysdef.xml Thu Aug 19 09:48:13 2010 +0300
@@ -10,22 +10,10 @@
<unit unitID="jrt.jrt" mrp="" bldFile="&layer_real_source_path;/group"
filter="!sf_build" name="jrt" />
</module>
-
-<!-- When releasing to SF, change the sf_build to this.
<module name="jrt_sf">
<unit unitID="jrt.jrt_sf" mrp="" bldFile="&layer_real_source_path;/group/sf"
filter="sf_build" name="jrt_sf" />
</module>
--->
- <module name="jrt">
- <unit unitID="jrt.jrt.jrt_plat" mrp="" bldFile="&layer_real_source_path;/jrt_plat/group"
- filter="sf_build" name="jrt_jrt_plat" />
- </module>
- <module name="jrt">
- <unit unitID="jrt.jrt.java_stubs" mrp="" bldFile="&layer_real_source_path;/java_stubs/group"
- filter="sf_build" name="jrt_jrt_stubs" />
- </module>
-
</layer>
</systemModel>
</SystemDefinition>
--- a/rom/java_2_1.iby Thu Jul 15 18:31:06 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,361 +0,0 @@
-/*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - Initial contribution
-*
-* Contributors:
-*
-* Description:
-* Image-description file of the Java package for ROFS1.
-*/
-
-#ifndef __JAVA_IBY__
-#define __JAVA_IBY__
-
-#include <data_caging_paths_for_iby.hrh>
-
-// Helper defines
-define JAVA_RES_BLD ABI_DIR\BUILD_DIR\z\resource\java
-define JAVA_RES_IMG RESOURCE_FILES_DIR\java
-define JAVA_VM_RES_BLD JAVA_RES_BLD\jvm\lib\jrt
-define JAVA_VM_RES_IMG JAVA_RES_IMG\jvm\lib\jrt
-define JAVA_POLICY_BLD ABI_DIR\BUILD_DIR\z\resource\java\security\policies
-define JAVA_POLICY_IMG RESOURCE_FILES_DIR\java\security\policies
-
-
-////////////////////////////
-// Java Manager collection//
-////////////////////////////
-
-// stub sis
-data=ZSYSTEM\install\java.sis System\Install\java.sis
-
-
-// AppMngr plugin
-ECOM_PLUGIN( appmngr2midletplugin.dll, appmngr2midletplugin.rsc )
-data=ZRESOURCE\plugins\appmngr2midletplugin.rsc ECOM_RESOURCE_DIR\appmngr2midletplugin.rsc
-
-// Captain
-file=ABI_DIR\BUILD_DIR\javacaptain_ext_btdeviceclassmanager.dll SHARED_LIB_DIR\javacaptain_ext_btdeviceclassmanager.dll
-file=ABI_DIR\BUILD_DIR\javacaptain_ext_config.dll SHARED_LIB_DIR\javacaptain_ext_config.dll
-file=ABI_DIR\BUILD_DIR\javacaptain_ext_ondemand_2.dll SHARED_LIB_DIR\javacaptain_ext_ondemand_2.dll
-file=ABI_DIR\BUILD_DIR\javacaptain_ext_ondemand_7.dll SHARED_LIB_DIR\javacaptain_ext_ondemand_7.dll
-file=ABI_DIR\BUILD_DIR\javacaptain_ext_preinstallerstarter.dll SHARED_LIB_DIR\javacaptain_ext_preinstallerstarter.dll
-file=ABI_DIR\BUILD_DIR\javacaptain_ext_pushregistryplugin.dll SHARED_LIB_DIR\javacaptain_ext_pushregistryplugin.dll
-file=ABI_DIR\BUILD_DIR\javacaptain_ext_storageserverplugin.dll SHARED_LIB_DIR\javacaptain_ext_storageserverplugin.dll
-file=ABI_DIR\BUILD_DIR\javacaptain.exe PROGRAMS_DIR\javacaptain.exe
-
-// Registry
-file=ABI_DIR\BUILD_DIR\javaregistryclient.dll SHARED_LIB_DIR\javaregistryclient.dll
-file=ABI_DIR\BUILD_DIR\javasizehelperclient.dll SHARED_LIB_DIR\javasizehelperclient.dll
-file=ABI_DIR\BUILD_DIR\javasizehelperserver.dll SHARED_LIB_DIR\javasizehelperserver.dll
-
-// Installer
-ECOM_PLUGIN(ifeui.dll,ifeui.rsc)
-data=ZRESOURCE\plugins\ifeui.rsc ECOM_RESOURCE_DIR\ifeui.rsc
-data=ZPRIVATE\10003a3f\apps\javainstaller_reg.rsc \private\10003a3f\import\apps\javainstaller_reg.rsc
-data=ZRESOURCE\apps\javainstaller_loc.rsc APP_RESOURCE_DIR\javainstaller_loc.rsc
-data=ZRESOURCE\apps\javainstaller_icon.mif APP_BITMAP_DIR\javainstaller_icon.mif
-file=ABI_DIR\BUILD_DIR\javainstaller.dll SHARED_LIB_DIR\javainstaller.dll
-data=JAVA_VM_RES_BLD\javainstallerui.odc JAVA_VM_RES_IMG\javainstallerui.odc
-file=ABI_DIR\BUILD_DIR\javainstallerui.dll SHARED_LIB_DIR\javainstallerui.dll
-data=JAVA_VM_RES_BLD\javainstaller.odc JAVA_VM_RES_IMG\javainstaller.odc
-file=ABI_DIR\BUILD_DIR\javainstallerstarter.dll PROGRAMS_DIR\javainstallerstarter.dll
-file=ABI_DIR\BUILD_DIR\javapreinstaller.dll PROGRAMS_DIR\javapreinstaller.dll
-data=ZRESOURCE\java\java_app_92.mif JAVA_RES_IMG\java_app.mif
-data=ZRESOURCE\java\java_trusted.png JAVA_RES_IMG\java_trusted.png
-data=ZRESOURCE\java\java_untrusted.png JAVA_RES_IMG\java_untrusted.png
-data=DATAZ_\private\102033E6\installer\inst_plugins.cfg \private\102033E6\installer\inst_plugins.cfg
-
-// Launchers
-file=ABI_DIR\BUILD_DIR\javalauncher.exe PROGRAMS_DIR\javalauncher.exe
-ECOM_PLUGIN(javaappschemeplugin.dll,javaappschemeplugin.rsc)
-data=ZRESOURCE\plugins\javaappschemeplugin.rsc ECOM_RESOURCE_DIR\javaappschemeplugin.rsc
-
-// SID Checker
-ECOM_PLUGIN(javasidchecker.dll,10281FBE.rsc)
-data=ZRESOURCE\plugins\javasidchecker.rsc ECOM_RESOURCE_DIR\javasidchecker.rsc
-
-// Recognizers
-ECOM_PLUGIN(recjar.dll, 102031FB.rsc)
-data=ZRESOURCE\plugins\recjar.rsc ECOM_RESOURCE_DIR\recjar.rsc
-
-// Backup & Restore
-file=ABI_DIR\BUILD_DIR\javabackup.exe PROGRAMS_DIR\javabackup.exe
-ECOM_PLUGIN(midp2backupplugin.dll,10282474.rsc)
-data=ZRESOURCE\plugins\midp2backupplugin.rsc ECOM_RESOURCE_DIR\midp2backupplugin.rsc
-data=DATAZ_\private\1028246F\backup_registration.xml \private\1028246F\backup_registration.xml
-data=DATAZ_\private\102033E6\backup_registration.xml \private\102033E6\backup_registration.xml
-
-
-/////////////////////////
-// Java UIs collection //
-/////////////////////////
-
-// CoreUi
-file=ABI_DIR\BUILD_DIR\javacoreui.dll SHARED_LIB_DIR\javacoreui.dll
-data=JAVA_VM_RES_BLD\javacoreui.odc JAVA_VM_RES_IMG\javacoreui.odc
-
-// eSWT
-file=ABI_DIR\BUILD_DIR\eswt.dll SHARED_LIB_DIR\eswt.dll
-data=JAVA_VM_RES_BLD\eswt.odc JAVA_VM_RES_IMG\eswt.odc
-file=ABI_DIR\BUILD_DIR\eswtphysics.dll SHARED_LIB_DIR\eswtphysics.dll
-file=ABI_DIR\BUILD_DIR\eswtapifacade.dll SHARED_LIB_DIR\eswtapifacade.dll
-file=ABI_DIR\BUILD_DIR\eswtdirectcontent.dll SHARED_LIB_DIR\eswtdirectcontent.dll
-data=JAVA_VM_RES_BLD\eswtdirectcontent.odc JAVA_VM_RES_IMG\eswtdirectcontent.odc
-data=ZPRIVATE\10003a3f\apps\eswt_reg.rsc \private\10003a3f\import\apps\eswt_reg.rsc
-
-// LCDUI
-file=ABI_DIR\BUILD_DIR\javalcdui.dll SHARED_LIB_DIR\javalcdui.dll
-data=JAVA_VM_RES_BLD\javalcdui.odc JAVA_VM_RES_IMG\javalcdui.odc
-file=ABI_DIR\BUILD_DIR\lcdui.dll SHARED_LIB_DIR\lcdui.dll
-file=ABI_DIR\BUILD_DIR\lcdgr.dll SHARED_LIB_DIR\lcdgr.dll
-file=ABI_DIR\BUILD_DIR\lcdgdrv.dll SHARED_LIB_DIR\lcdgdrv.dll
-file=ABI_DIR\BUILD_DIR\lcdgdrvi.dll SHARED_LIB_DIR\lcdgdrvi.dll
-file=ABI_DIR\BUILD_DIR\lcduiphysicswrap.dll SHARED_LIB_DIR\lcduiphysicswrap.dll
-ECOM_PLUGIN(LCDC4K.dll, 10208164.rsc)
-ECOM_PLUGIN(LCDC64K.dll, 10208162.rsc)
-ECOM_PLUGIN(LCDC16MU.dll, 10208166.rsc)
-ECOM_PLUGIN(LCDC16MA.dll, 10208168.rsc)
-data=ZRESOURCE\java\lcdgr.rsc JAVA_RES_IMG\lcdgr.rsc
-data=ZPRIVATE\10003a3f\apps\lcdui_reg.rsc \private\10003a3f\import\apps\lcdui_reg.rsc
-
-SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,lcdui)
-
-// AMMS API
-file=ABI_DIR\BUILD_DIR\javaamms.dll SHARED_LIB_DIR\javaamms.dll
-data=JAVA_VM_RES_BLD\javaamms.odc JAVA_VM_RES_IMG\javaamms.odc
-
-// Mobile Media API
-file=ABI_DIR\BUILD_DIR\javamobilemedia.dll SHARED_LIB_DIR\javamobilemedia.dll
-data=JAVA_VM_RES_BLD\javamobilemedia.odc JAVA_VM_RES_IMG\javamobilemedia.odc
-data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaCapture.wav \System\Sounds\Digital\CamcorderJavaCapture.wav
-data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaStart.wav \System\Sounds\Digital\CamcorderJavaStart.wav
-
-// MobInfo API
-file=ABI_DIR\BUILD_DIR\javamobinfo.dll SHARED_LIB_DIR\javamobinfo.dll
-data=JAVA_VM_RES_BLD\javamobinfo.odc JAVA_VM_RES_IMG\javamobinfo.odc
-
-// GlobalIndicators API
-file=ABI_DIR\BUILD_DIR\javaglobalindicators.dll SHARED_LIB_DIR\javaglobalindicators.dll
-data=JAVA_VM_RES_BLD\javaglobalindicators.odc JAVA_VM_RES_IMG\javaglobalindicators.odc
-
-// SoftNotification API
-file=ABI_DIR\BUILD_DIR\javasoftnotification.dll SHARED_LIB_DIR\javasoftnotification.dll
-data=JAVA_VM_RES_BLD\javasoftnotification.odc JAVA_VM_RES_IMG\javasoftnotification.odc
-
-// 2G API
-file=ABI_DIR\BUILD_DIR\javam2g.dll SHARED_LIB_DIR\javam2g.dll
-data=JAVA_VM_RES_BLD\javam2g.odc JAVA_VM_RES_IMG\javam2g.odc
-
-// 3G API
-file=ABI_DIR\BUILD_DIR\javam3g.dll SHARED_LIB_DIR\javam3g.dll
-data=JAVA_VM_RES_BLD\javam3g.odc JAVA_VM_RES_IMG\javam3g.odc
-
-// Nokia Sound API
-file=ABI_DIR\BUILD_DIR\javanokiasound.dll SHARED_LIB_DIR\javanokiasound.dll
-data=JAVA_VM_RES_BLD\javanokiasound.odc JAVA_VM_RES_IMG\javanokiasound.odc
-
-// Remote Connection Observer
-file=ABI_DIR\BUILD_DIR\javaremconobserver.dll SHARED_LIB_DIR\javaremconobserver.dll
-
-// Legacy utilities
-file=ABI_DIR\BUILD_DIR\javalegacyutils.dll SHARED_LIB_DIR\javalegacyutils.dll
-data=JAVA_VM_RES_BLD\javalegacyutils.odc JAVA_VM_RES_IMG\javalegacyutils.odc
-
-
-/////////////////////////////
-// Java Runtimes collection //
-/////////////////////////////
-
-// Runtime utilities
-file=ABI_DIR\BUILD_DIR\javaruntimeui.dll SHARED_LIB_DIR\javaruntimeui.dll
-data=JAVA_VM_RES_BLD\javaruntimeui.odc JAVA_VM_RES_IMG\javaruntimeui.odc
-file=ABI_DIR\BUILD_DIR\javaruntimestarterutils.dll SHARED_LIB_DIR\javaruntimestarterutils.dll
-
-// MIDP runtime
-file=ABI_DIR\BUILD_DIR\javamidp.exe PROGRAMS_DIR\javamidp.exe
-file=ABI_DIR\BUILD_DIR\javamidpstarter.dll SHARED_LIB_DIR\javamidpstarter.dll
-file=ABI_DIR\BUILD_DIR\javamidpruntime.dll SHARED_LIB_DIR\javamidpruntime.dll
-data=JAVA_VM_RES_BLD\javamidpruntime.odc JAVA_VM_RES_IMG\javamidpruntime.odc
-
-// An empty JVM argument modifier (to prevent 3rd parties from installing a DLL with this name)
-// To enable JVM argument modifier - comment 1st line below and uncomment 2nd line below
-file=ABI_DIR\BUILD_DIR\javajvmargsmodifier.dll SHARED_LIB_DIR\javajvmargsmodifier.dll
-//file=ABI_DIR\BUILD_DIR\javajvmargsmodifierfile.dll SHARED_LIB_DIR\javajvmargsmodifier.dll
-
-
-/////////////////////////////
-// Java Commons collection //
-/////////////////////////////
-
-// J9 JVM
-file=ABI_DIR\BUILD_DIR\j9.dll SHARED_LIB_DIR\j9.dll
-file=ABI_DIR\BUILD_DIR\j9vmall23.dll SHARED_LIB_DIR\j9vmall23.dll
-file=ABI_DIR\BUILD_DIR\j9mjit23.dll SHARED_LIB_DIR\j9mjit23.dll
-file=ABI_DIR\BUILD_DIR\jclcldc11_23.dll SHARED_LIB_DIR\jclcldc11_23.dll
-file=ABI_DIR\BUILD_DIR\jclcdc11_23.dll SHARED_LIB_DIR\jclcdc11_23.dll
-file=ABI_DIR\BUILD_DIR\j9fdm23.dll SHARED_LIB_DIR\j9fdm23.dll
-file=ABI_DIR\BUILD_DIR\JvmNativePort.dll SHARED_LIB_DIR\JvmNativePort.dll
-data=JAVA_RES_BLD\jvm\bin\java.properties JAVA_RES_IMG\jvm\bin\java.properties
-data=JAVA_RES_BLD\jvm\lib\security\java.policy JAVA_RES_IMG\jvm\lib\security\java.policy
-data=JAVA_RES_BLD\jvm\lib\security\java.security JAVA_RES_IMG\jvm\lib\security\java.security
-
-// Utilities
-file=ABI_DIR\BUILD_DIR\javautils.dll SHARED_LIB_DIR\javautils.dll
-data=JAVA_VM_RES_BLD\javautils.odc JAVA_VM_RES_IMG\javautils.odc
-file=ABI_DIR\BUILD_DIR\javacomms.dll SHARED_LIB_DIR\javacomms.dll
-data=JAVA_VM_RES_BLD\javacomms.odc JAVA_VM_RES_IMG\javacomms.odc
-file=ABI_DIR\BUILD_DIR\javaipc.dll SHARED_LIB_DIR\javaipc.dll
-file=ABI_DIR\BUILD_DIR\javafileutils.dll SHARED_LIB_DIR\javafileutils.dll
-data=JAVA_VM_RES_BLD\javafileutils.odc JAVA_VM_RES_IMG\javafileutils.odc
-file=ABI_DIR\BUILD_DIR\javadebugapi.dll SHARED_LIB_DIR\javadebugapi.dll
-
-// Security dlls
-file=ABI_DIR\BUILD_DIR\javasecurity.dll SHARED_LIB_DIR\javasecurity.dll
-data=JAVA_VM_RES_BLD\javasecurity.odc JAVA_VM_RES_IMG\javasecurity.odc
-ECOM_PLUGIN(javaunicertstoreplugin.dll,200213A3.rsc)
-data=ZRESOURCE\plugins\javaunicertstoreplugin.rsc ECOM_RESOURCE_DIR\javaunicertstoreplugin.rsc
-
-// Security certs & policies
-data=JAVA_POLICY_BLD\s60_manufacturer.ser JAVA_POLICY_IMG\s60_manufacturer.ser
-data=JAVA_POLICY_BLD\s60_operator.ser JAVA_POLICY_IMG\s60_operator.ser
-data=JAVA_POLICY_BLD\s60_trustedthirdparty.ser JAVA_POLICY_IMG\s60_trustedthirdparty.ser
-data=JAVA_POLICY_BLD\s60_untrusted.ser JAVA_POLICY_IMG\s60_untrusted.ser
-data=JAVA_POLICY_BLD\msa_manufacturer.ser JAVA_POLICY_IMG\msa_manufacturer.ser
-data=JAVA_POLICY_BLD\msa_operator.ser JAVA_POLICY_IMG\msa_operator.ser
-data=JAVA_POLICY_BLD\msa_trustedthirdparty.ser JAVA_POLICY_IMG\msa_trustedthirdparty.ser
-data=JAVA_POLICY_BLD\msa_untrusted.ser JAVA_POLICY_IMG\msa_untrusted.ser
-data=JAVA_POLICY_BLD\att_manufacturer.ser JAVA_POLICY_IMG\att_manufacturer.ser
-data=JAVA_POLICY_BLD\att_operator.ser JAVA_POLICY_IMG\att_operator.ser
-data=JAVA_POLICY_BLD\att_operatorextra.ser JAVA_POLICY_IMG\att_operatorextra.ser
-data=JAVA_POLICY_BLD\att_trustedthirdparty.ser JAVA_POLICY_IMG\att_trustedthirdparty.ser
-data=JAVA_POLICY_BLD\att_untrusted.ser JAVA_POLICY_IMG\att_untrusted.ser
-data=JAVA_POLICY_BLD\all.ser JAVA_POLICY_IMG\all.ser
-
-
-// Java environment info
-file=ABI_DIR\BUILD_DIR\javaenvinfo.dll SHARED_LIB_DIR\javaenvinfo.dll
-data=ABI_DIR\BUILD_DIR\Z\Resource\versions\java.txt RESOURCE_FILES_DIR\versions\java.txt
-
-// Storage
-file=ABI_DIR\BUILD_DIR\javastorage.dll SHARED_LIB_DIR\javastorage.dll
-data=JAVA_VM_RES_BLD\javastorage.odc JAVA_VM_RES_IMG\javastorage.odc
-
-// GCF base
-file=ABI_DIR\BUILD_DIR\javagcf.dll SHARED_LIB_DIR\javagcf.dll
-data=JAVA_VM_RES_BLD\javagcf.odc JAVA_VM_RES_IMG\javagcf.odc
-
-// Connection Manager
-file=ABI_DIR\BUILD_DIR\javaconnectionmanager.dll SHARED_LIB_DIR\javaconnectionmanager.dll
-data=JAVA_VM_RES_BLD\javaconnectionmanager.odc JAVA_VM_RES_IMG\javaconnectionmanager.odc
-
-// Http & https protocols
-file=ABI_DIR\BUILD_DIR\javahttp.dll SHARED_LIB_DIR\javahttp.dll
-file=ABI_DIR\BUILD_DIR\javahttps.dll SHARED_LIB_DIR\javahttps.dll
-data=JAVA_VM_RES_BLD\javahttp.odc JAVA_VM_RES_IMG\javahttp.odc
-data=JAVA_VM_RES_BLD\javahttps.odc JAVA_VM_RES_IMG\javahttps.odc
-
-// Socket protocol
-file=ABI_DIR\BUILD_DIR\javasocket.dll SHARED_LIB_DIR\javasocket.dll
-file=ABI_DIR\BUILD_DIR\javasocketscplugin.dll SHARED_LIB_DIR\javasocketscplugin.dll
-data=JAVA_VM_RES_BLD\javasocket.odc JAVA_VM_RES_IMG\javasocket.odc
-
-// Secure socket protocol
-file=ABI_DIR\BUILD_DIR\javassl.dll SHARED_LIB_DIR\javassl.dll
-data=JAVA_VM_RES_BLD\javassl.odc JAVA_VM_RES_IMG\javassl.odc
-
-
-////////////////////////////////
-// Java Extensions collection //
-////////////////////////////////
-
-// Push
-file=ABI_DIR\BUILD_DIR\javapushcontroller.dll SHARED_LIB_DIR\javapushcontroller.dll
-file=ABI_DIR\BUILD_DIR\javapushregistry.dll SHARED_LIB_DIR\javapushregistry.dll
-data=JAVA_VM_RES_BLD\javapushregistry.odc JAVA_VM_RES_IMG\javapushregistry.odc
-
-// Bluetooth
-file=ABI_DIR\BUILD_DIR\javabluecove.dll SHARED_LIB_DIR\javabluecove.dll
-file=ABI_DIR\BUILD_DIR\javabluetooth.dll SHARED_LIB_DIR\javabluetooth.dll
-file=ABI_DIR\BUILD_DIR\javabluetoothcommons.dll SHARED_LIB_DIR\javabluetoothcommons.dll
-file=ABI_DIR\BUILD_DIR\javabtgoepscplugin.dll SHARED_LIB_DIR\javabtgoepscplugin.dll
-file=ABI_DIR\BUILD_DIR\javabtl2capscplugin.dll SHARED_LIB_DIR\javabtl2capscplugin.dll
-file=ABI_DIR\BUILD_DIR\javabtsppscplugin.dll SHARED_LIB_DIR\javabtsppscplugin.dll
-data=JAVA_VM_RES_BLD\javabluecove.odc JAVA_VM_RES_IMG\javabluecove.odc
-data=JAVA_VM_RES_BLD\javabluetooth.odc JAVA_VM_RES_IMG\javabluetooth.odc
-data=JAVA_VM_RES_BLD\javabluetoothcommons.odc JAVA_VM_RES_IMG\javabluetoothcommons.odc
-
-// WMA
-file=ABI_DIR\BUILD_DIR\javawma.dll SHARED_LIB_DIR\javawma.dll
-file=ABI_DIR\BUILD_DIR\javawmamms.dll SHARED_LIB_DIR\javawmamms.dll
-file=ABI_DIR\BUILD_DIR\javacbsscplugin.dll SHARED_LIB_DIR\javacbsscplugin.dll
-file=ABI_DIR\BUILD_DIR\javammsscplugin.dll SHARED_LIB_DIR\javammsscplugin.dll
-file=ABI_DIR\BUILD_DIR\javasmsscplugin.dll SHARED_LIB_DIR\javasmsscplugin.dll
-data=JAVA_VM_RES_BLD\javawma.odc JAVA_VM_RES_IMG\javawma.odc
-data=JAVA_VM_RES_BLD\javawmamms.odc JAVA_VM_RES_IMG\javawmamms.odc
-
-// Comm
-file=ABI_DIR\BUILD_DIR\javacomm.dll SHARED_LIB_DIR\javacomm.dll
-data=JAVA_VM_RES_BLD\javacomm.odc JAVA_VM_RES_IMG\javacomm.odc
-
-// Datagram
-file=ABI_DIR\BUILD_DIR\javadatagram.dll SHARED_LIB_DIR\javadatagram.dll
-file=ABI_DIR\BUILD_DIR\javadatagramscplugin.dll SHARED_LIB_DIR\javadatagramscplugin.dll
-data=JAVA_VM_RES_BLD\javadatagram.odc JAVA_VM_RES_IMG\javadatagram.odc
-
-// Location API
-file=ABI_DIR\BUILD_DIR\javalocation.dll SHARED_LIB_DIR\javalocation.dll
-data=JAVA_VM_RES_BLD\javalocation.odc JAVA_VM_RES_IMG\javalocation.odc
-
-// Sensor API
-file=ABI_DIR\BUILD_DIR\javasensor.dll SHARED_LIB_DIR\javasensor.dll
-data=JAVA_VM_RES_BLD\javasensor.odc JAVA_VM_RES_IMG\javasensor.odc
-
-// Web services API
-file=ABI_DIR\BUILD_DIR\javawebservices.dll SHARED_LIB_DIR\javawebservices.dll
-data=JAVA_VM_RES_BLD\javawebservices.odc JAVA_VM_RES_IMG\javawebservices.odc
-
-// PIM API
-file=ABI_DIR\BUILD_DIR\javapim.dll SHARED_LIB_DIR\javapim.dll
-data=JAVA_VM_RES_BLD\javapim.odc JAVA_VM_RES_IMG\javapim.odc
-
-// RMS API
-file=ABI_DIR\BUILD_DIR\javarms.dll SHARED_LIB_DIR\javarms.dll
-data=JAVA_VM_RES_BLD\javarms.odc JAVA_VM_RES_IMG\javarms.odc
-
-// SATSA API
-file=ABI_DIR\BUILD_DIR\javasatsa.dll SHARED_LIB_DIR\javasatsa.dll
-data=JAVA_VM_RES_BLD\javasatsa.odc JAVA_VM_RES_IMG\javasatsa.odc
-
-// File API
-file=ABI_DIR\BUILD_DIR\javafile.dll SHARED_LIB_DIR\javafile.dll
-data=JAVA_VM_RES_BLD\javafile.odc JAVA_VM_RES_IMG\javafile.odc
-
-// IAP Info API
-file=ABI_DIR\BUILD_DIR\javaiapinfo.dll SHARED_LIB_DIR\javaiapinfo.dll
-data=JAVA_VM_RES_BLD\javaiapinfo.odc JAVA_VM_RES_IMG\javaiapinfo.odc
-
-
-///////////////////
-// Miscellaneous //
-///////////////////
-
-// Generated localization file resources
-data=JAVA_VM_RES_BLD\resources.jar JAVA_VM_RES_IMG\resources.jar
-
-// ODC list files
-data=ZRESOURCE\java\midpOdcList JAVA_RES_IMG\midpodclist
-data=ZRESOURCE\java\installerOdcList JAVA_RES_IMG\installerodclist
-data=ZRESOURCE\java\tckRunnerOdcList JAVA_RES_IMG\tckrunnerodclist
-
-// trust roots list
-data=ZRESOURCE\java\security\trustroots\midprootslist JAVA_RES_IMG\security\trustroots\midprootslist
-
-#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/java_2_2.iby Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,372 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - Initial contribution
+*
+* Contributors:
+*
+* Description:
+* Image-description file of the Java package for ROFS1.
+*/
+
+#ifndef __JAVA_IBY__
+#define __JAVA_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+// Helper defines
+define JAVA_RES_BLD ABI_DIR\BUILD_DIR\z\resource\java
+define JAVA_RES_IMG RESOURCE_FILES_DIR\java
+define JAVA_VM_RES_BLD JAVA_RES_BLD\jvm\lib\jrt
+define JAVA_VM_RES_IMG JAVA_RES_IMG\jvm\lib\jrt
+define JAVA_POLICY_BLD ABI_DIR\BUILD_DIR\z\resource\java\security\policies
+define JAVA_POLICY_IMG RESOURCE_FILES_DIR\java\security\policies
+
+
+////////////////////////////
+// Java Manager collection//
+////////////////////////////
+
+// stub sis
+data=ZSYSTEM\install\java.sis System\Install\java.sis
+
+
+// AppMngr plugin
+ECOM_PLUGIN( appmngr2midletplugin.dll, appmngr2midletplugin.rsc )
+data=ZRESOURCE\plugins\appmngr2midletplugin.rsc ECOM_RESOURCE_DIR\appmngr2midletplugin.rsc
+
+// Captain
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_autostarter.dll SHARED_LIB_DIR\javacaptain_ext_autostarter.dll
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_btdeviceclassmanager.dll SHARED_LIB_DIR\javacaptain_ext_btdeviceclassmanager.dll
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_config.dll SHARED_LIB_DIR\javacaptain_ext_config.dll
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_ondemand_2.dll SHARED_LIB_DIR\javacaptain_ext_ondemand_2.dll
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_ondemand_7.dll SHARED_LIB_DIR\javacaptain_ext_ondemand_7.dll
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_preinstallerstarter.dll SHARED_LIB_DIR\javacaptain_ext_preinstallerstarter.dll
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_pushregistryplugin.dll SHARED_LIB_DIR\javacaptain_ext_pushregistryplugin.dll
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_storageserverplugin.dll SHARED_LIB_DIR\javacaptain_ext_storageserverplugin.dll
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_settingslistener.dll SHARED_LIB_DIR\javacaptain_ext_settingslistener.dll
+file=ABI_DIR\BUILD_DIR\javacaptain.exe PROGRAMS_DIR\javacaptain.exe
+
+// Registry
+file=ABI_DIR\BUILD_DIR\javaregistryclient.dll SHARED_LIB_DIR\javaregistryclient.dll
+file=ABI_DIR\BUILD_DIR\javasizehelperclient.dll SHARED_LIB_DIR\javasizehelperclient.dll
+file=ABI_DIR\BUILD_DIR\javasizehelperserver.dll SHARED_LIB_DIR\javasizehelperserver.dll
+
+// Installer
+ECOM_PLUGIN(ifeui.dll,ifeui.rsc)
+data=ZRESOURCE\plugins\ifeui.rsc ECOM_RESOURCE_DIR\ifeui.rsc
+data=ZPRIVATE\10003a3f\apps\javainstaller_reg.rsc \private\10003a3f\import\apps\javainstaller_reg.rsc
+data=ZRESOURCE\apps\javainstaller_loc.rsc APP_RESOURCE_DIR\javainstaller_loc.rsc
+data=ZRESOURCE\apps\javainstaller_icon.mif APP_BITMAP_DIR\javainstaller_icon.mif
+file=ABI_DIR\BUILD_DIR\javainstaller.dll SHARED_LIB_DIR\javainstaller.dll
+data=JAVA_VM_RES_BLD\javainstallerui.odc JAVA_VM_RES_IMG\javainstallerui.odc
+file=ABI_DIR\BUILD_DIR\javainstallerui.dll SHARED_LIB_DIR\javainstallerui.dll
+data=JAVA_VM_RES_BLD\javainstaller.odc JAVA_VM_RES_IMG\javainstaller.odc
+file=ABI_DIR\BUILD_DIR\javainstallerstarter.dll PROGRAMS_DIR\javainstallerstarter.dll
+file=ABI_DIR\BUILD_DIR\javapreinstaller.dll PROGRAMS_DIR\javapreinstaller.dll
+data=ZRESOURCE\java\java_app_92.mif JAVA_RES_IMG\java_app.mif
+data=ZRESOURCE\java\java_trusted.png JAVA_RES_IMG\java_trusted.png
+data=ZRESOURCE\java\java_untrusted.png JAVA_RES_IMG\java_untrusted.png
+data=DATAZ_\private\102033E6\installer\inst_plugins.cfg \private\102033E6\installer\inst_plugins.cfg
+
+// Launchers
+file=ABI_DIR\BUILD_DIR\javalauncher.exe PROGRAMS_DIR\javalauncher.exe
+ECOM_PLUGIN(javaappschemeplugin.dll,javaappschemeplugin.rsc)
+data=ZRESOURCE\plugins\javaappschemeplugin.rsc ECOM_RESOURCE_DIR\javaappschemeplugin.rsc
+
+// SID Checker
+ECOM_PLUGIN(javasidchecker.dll,10281FBE.rsc)
+data=ZRESOURCE\plugins\javasidchecker.rsc ECOM_RESOURCE_DIR\javasidchecker.rsc
+
+// Recognizers
+ECOM_PLUGIN(recjar.dll, 102031FB.rsc)
+data=ZRESOURCE\plugins\recjar.rsc ECOM_RESOURCE_DIR\recjar.rsc
+
+// Backup & Restore
+file=ABI_DIR\BUILD_DIR\javabackup.exe PROGRAMS_DIR\javabackup.exe
+ECOM_PLUGIN(midp2backupplugin.dll,10282474.rsc)
+data=ZRESOURCE\plugins\midp2backupplugin.rsc ECOM_RESOURCE_DIR\midp2backupplugin.rsc
+data=DATAZ_\private\1028246F\backup_registration.xml \private\1028246F\backup_registration.xml
+data=DATAZ_\private\102033E6\backup_registration.xml \private\102033E6\backup_registration.xml
+
+
+/////////////////////////
+// Java UIs collection //
+/////////////////////////
+
+// CoreUi
+file=ABI_DIR\BUILD_DIR\javacoreui.dll SHARED_LIB_DIR\javacoreui.dll
+data=JAVA_VM_RES_BLD\javacoreui.odc JAVA_VM_RES_IMG\javacoreui.odc
+
+// eSWT
+file=ABI_DIR\BUILD_DIR\eswt.dll SHARED_LIB_DIR\eswt.dll
+data=JAVA_VM_RES_BLD\eswt.odc JAVA_VM_RES_IMG\eswt.odc
+file=ABI_DIR\BUILD_DIR\eswtphysics.dll SHARED_LIB_DIR\eswtphysics.dll
+file=ABI_DIR\BUILD_DIR\eswtapifacade.dll SHARED_LIB_DIR\eswtapifacade.dll
+file=ABI_DIR\BUILD_DIR\eswtdirectcontent.dll SHARED_LIB_DIR\eswtdirectcontent.dll
+data=JAVA_VM_RES_BLD\eswtdirectcontent.odc JAVA_VM_RES_IMG\eswtdirectcontent.odc
+data=ZPRIVATE\10003a3f\apps\eswt_reg.rsc \private\10003a3f\import\apps\eswt_reg.rsc
+
+// LCDUI
+file=ABI_DIR\BUILD_DIR\javalcdui.dll SHARED_LIB_DIR\javalcdui.dll
+data=JAVA_VM_RES_BLD\javalcdui.odc JAVA_VM_RES_IMG\javalcdui.odc
+file=ABI_DIR\BUILD_DIR\lcdui.dll SHARED_LIB_DIR\lcdui.dll
+file=ABI_DIR\BUILD_DIR\lcdgr.dll SHARED_LIB_DIR\lcdgr.dll
+file=ABI_DIR\BUILD_DIR\lcdgdrv.dll SHARED_LIB_DIR\lcdgdrv.dll
+file=ABI_DIR\BUILD_DIR\lcdgdrvi.dll SHARED_LIB_DIR\lcdgdrvi.dll
+file=ABI_DIR\BUILD_DIR\lcduiphysicswrap.dll SHARED_LIB_DIR\lcduiphysicswrap.dll
+ECOM_PLUGIN(LCDC4K.dll, 10208164.rsc)
+ECOM_PLUGIN(LCDC64K.dll, 10208162.rsc)
+ECOM_PLUGIN(LCDC16MU.dll, 10208166.rsc)
+ECOM_PLUGIN(LCDC16MA.dll, 10208168.rsc)
+data=ZRESOURCE\java\lcdgr.rsc JAVA_RES_IMG\lcdgr.rsc
+data=ZPRIVATE\10003a3f\apps\lcdui_reg.rsc \private\10003a3f\import\apps\lcdui_reg.rsc
+
+SCALABLE_IMAGE(APP_BITMAP_DIR,APP_BITMAP_DIR,lcdui)
+
+// AMMS API
+file=ABI_DIR\BUILD_DIR\javaamms.dll SHARED_LIB_DIR\javaamms.dll
+data=JAVA_VM_RES_BLD\javaamms.odc JAVA_VM_RES_IMG\javaamms.odc
+
+// Mobile Media API
+file=ABI_DIR\BUILD_DIR\javamobilemedia.dll SHARED_LIB_DIR\javamobilemedia.dll
+data=JAVA_VM_RES_BLD\javamobilemedia.odc JAVA_VM_RES_IMG\javamobilemedia.odc
+data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaCapture.wav \System\Sounds\Digital\CamcorderJavaCapture.wav
+data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaStart.wav \System\Sounds\Digital\CamcorderJavaStart.wav
+
+// MobInfo API
+file=ABI_DIR\BUILD_DIR\javamobinfo.dll SHARED_LIB_DIR\javamobinfo.dll
+data=JAVA_VM_RES_BLD\javamobinfo.odc JAVA_VM_RES_IMG\javamobinfo.odc
+
+// GlobalIndicators API
+file=ABI_DIR\BUILD_DIR\javaglobalindicators.dll SHARED_LIB_DIR\javaglobalindicators.dll
+data=JAVA_VM_RES_BLD\javaglobalindicators.odc JAVA_VM_RES_IMG\javaglobalindicators.odc
+
+// SoftNotification API
+file=ABI_DIR\BUILD_DIR\javasoftnotification.dll SHARED_LIB_DIR\javasoftnotification.dll
+data=JAVA_VM_RES_BLD\javasoftnotification.odc JAVA_VM_RES_IMG\javasoftnotification.odc
+
+// 2G API
+file=ABI_DIR\BUILD_DIR\javam2g.dll SHARED_LIB_DIR\javam2g.dll
+data=JAVA_VM_RES_BLD\javam2g.odc JAVA_VM_RES_IMG\javam2g.odc
+
+// 3G API
+file=ABI_DIR\BUILD_DIR\javam3g.dll SHARED_LIB_DIR\javam3g.dll
+data=JAVA_VM_RES_BLD\javam3g.odc JAVA_VM_RES_IMG\javam3g.odc
+
+// Nokia Sound API
+file=ABI_DIR\BUILD_DIR\javanokiasound.dll SHARED_LIB_DIR\javanokiasound.dll
+data=JAVA_VM_RES_BLD\javanokiasound.odc JAVA_VM_RES_IMG\javanokiasound.odc
+
+// Remote Connection Observer
+file=ABI_DIR\BUILD_DIR\javaremconobserver.dll SHARED_LIB_DIR\javaremconobserver.dll
+
+// Legacy utilities
+file=ABI_DIR\BUILD_DIR\javalegacyutils.dll SHARED_LIB_DIR\javalegacyutils.dll
+data=JAVA_VM_RES_BLD\javalegacyutils.odc JAVA_VM_RES_IMG\javalegacyutils.odc
+
+
+/////////////////////////////
+// Java Runtimes collection //
+/////////////////////////////
+
+// Runtime utilities
+file=ABI_DIR\BUILD_DIR\javaruntimeui.dll SHARED_LIB_DIR\javaruntimeui.dll
+data=JAVA_VM_RES_BLD\javaruntimeui.odc JAVA_VM_RES_IMG\javaruntimeui.odc
+file=ABI_DIR\BUILD_DIR\javaruntimestarterutils.dll SHARED_LIB_DIR\javaruntimestarterutils.dll
+file=ABI_DIR\BUILD_DIR\javastarter.dll SHARED_LIB_DIR\javastarter.dll
+
+// MIDP runtime
+file=ABI_DIR\BUILD_DIR\javamidp.exe PROGRAMS_DIR\javamidp.exe
+file=ABI_DIR\BUILD_DIR\javamidpstarter.dll SHARED_LIB_DIR\javamidpstarter.dll
+file=ABI_DIR\BUILD_DIR\javamidpruntime.dll SHARED_LIB_DIR\javamidpruntime.dll
+data=JAVA_VM_RES_BLD\javamidpruntime.odc JAVA_VM_RES_IMG\javamidpruntime.odc
+
+// An empty JVM argument modifier (to prevent 3rd parties from installing a DLL with this name)
+// To enable JVM argument modifier - comment 1st line below and uncomment 2nd line below
+file=ABI_DIR\BUILD_DIR\javajvmargsmodifier.dll SHARED_LIB_DIR\javajvmargsmodifier.dll
+//file=ABI_DIR\BUILD_DIR\javajvmargsmodifierfile.dll SHARED_LIB_DIR\javajvmargsmodifier.dll
+
+
+/////////////////////////////
+// Java Commons collection //
+/////////////////////////////
+
+// J9 JVM
+file=ABI_DIR\BUILD_DIR\j9.dll SHARED_LIB_DIR\j9.dll
+file=ABI_DIR\BUILD_DIR\j9vmall23.dll SHARED_LIB_DIR\j9vmall23.dll
+file=ABI_DIR\BUILD_DIR\j9mjit23.dll SHARED_LIB_DIR\j9mjit23.dll
+file=ABI_DIR\BUILD_DIR\jclcldc11_23.dll SHARED_LIB_DIR\jclcldc11_23.dll
+file=ABI_DIR\BUILD_DIR\jclcdc11_23.dll SHARED_LIB_DIR\jclcdc11_23.dll
+file=ABI_DIR\BUILD_DIR\j9fdm23.dll SHARED_LIB_DIR\j9fdm23.dll
+file=ABI_DIR\BUILD_DIR\JvmNativePort.dll SHARED_LIB_DIR\JvmNativePort.dll
+data=JAVA_RES_BLD\jvm\bin\java.properties JAVA_RES_IMG\jvm\bin\java.properties
+data=JAVA_RES_BLD\jvm\lib\security\java.policy JAVA_RES_IMG\jvm\lib\security\java.policy
+data=JAVA_RES_BLD\jvm\lib\security\java.security JAVA_RES_IMG\jvm\lib\security\java.security
+
+// Utilities
+file=ABI_DIR\BUILD_DIR\javautils.dll SHARED_LIB_DIR\javautils.dll
+data=JAVA_VM_RES_BLD\javautils.odc JAVA_VM_RES_IMG\javautils.odc
+file=ABI_DIR\BUILD_DIR\javacomms.dll SHARED_LIB_DIR\javacomms.dll
+data=JAVA_VM_RES_BLD\javacomms.odc JAVA_VM_RES_IMG\javacomms.odc
+file=ABI_DIR\BUILD_DIR\javaipc.dll SHARED_LIB_DIR\javaipc.dll
+file=ABI_DIR\BUILD_DIR\javafileutils.dll SHARED_LIB_DIR\javafileutils.dll
+data=JAVA_VM_RES_BLD\javafileutils.odc JAVA_VM_RES_IMG\javafileutils.odc
+file=ABI_DIR\BUILD_DIR\javadebugapi.dll SHARED_LIB_DIR\javadebugapi.dll
+
+// Security dlls
+file=ABI_DIR\BUILD_DIR\javasecurity.dll SHARED_LIB_DIR\javasecurity.dll
+data=JAVA_VM_RES_BLD\javasecurity.odc JAVA_VM_RES_IMG\javasecurity.odc
+ECOM_PLUGIN(javaunicertstoreplugin.dll,200213A3.rsc)
+data=ZRESOURCE\plugins\javaunicertstoreplugin.rsc ECOM_RESOURCE_DIR\javaunicertstoreplugin.rsc
+
+// Security certs & policies
+data=JAVA_POLICY_BLD\s60_manufacturer.ser JAVA_POLICY_IMG\s60_manufacturer.ser
+data=JAVA_POLICY_BLD\s60_operator.ser JAVA_POLICY_IMG\s60_operator.ser
+data=JAVA_POLICY_BLD\s60_trustedthirdparty.ser JAVA_POLICY_IMG\s60_trustedthirdparty.ser
+data=JAVA_POLICY_BLD\s60_untrusted.ser JAVA_POLICY_IMG\s60_untrusted.ser
+data=JAVA_POLICY_BLD\msa_manufacturer.ser JAVA_POLICY_IMG\msa_manufacturer.ser
+data=JAVA_POLICY_BLD\msa_operator.ser JAVA_POLICY_IMG\msa_operator.ser
+data=JAVA_POLICY_BLD\msa_trustedthirdparty.ser JAVA_POLICY_IMG\msa_trustedthirdparty.ser
+data=JAVA_POLICY_BLD\msa_untrusted.ser JAVA_POLICY_IMG\msa_untrusted.ser
+data=JAVA_POLICY_BLD\att_manufacturer.ser JAVA_POLICY_IMG\att_manufacturer.ser
+data=JAVA_POLICY_BLD\att_operator.ser JAVA_POLICY_IMG\att_operator.ser
+data=JAVA_POLICY_BLD\att_operatorextra.ser JAVA_POLICY_IMG\att_operatorextra.ser
+data=JAVA_POLICY_BLD\att_trustedthirdparty.ser JAVA_POLICY_IMG\att_trustedthirdparty.ser
+data=JAVA_POLICY_BLD\att_untrusted.ser JAVA_POLICY_IMG\att_untrusted.ser
+data=JAVA_POLICY_BLD\all.ser JAVA_POLICY_IMG\all.ser
+
+
+// Java environment info
+file=ABI_DIR\BUILD_DIR\javaenvinfo.dll SHARED_LIB_DIR\javaenvinfo.dll
+data=ABI_DIR\BUILD_DIR\Z\Resource\versions\java.txt RESOURCE_FILES_DIR\versions\java.txt
+
+// Storage
+file=ABI_DIR\BUILD_DIR\javastorage.dll SHARED_LIB_DIR\javastorage.dll
+data=JAVA_VM_RES_BLD\javastorage.odc JAVA_VM_RES_IMG\javastorage.odc
+
+// GCF base
+file=ABI_DIR\BUILD_DIR\javagcf.dll SHARED_LIB_DIR\javagcf.dll
+data=JAVA_VM_RES_BLD\javagcf.odc JAVA_VM_RES_IMG\javagcf.odc
+
+// Connection Manager
+file=ABI_DIR\BUILD_DIR\javaconnectionmanager.dll SHARED_LIB_DIR\javaconnectionmanager.dll
+data=JAVA_VM_RES_BLD\javaconnectionmanager.odc JAVA_VM_RES_IMG\javaconnectionmanager.odc
+
+// Http & https protocols
+file=ABI_DIR\BUILD_DIR\javahttp.dll SHARED_LIB_DIR\javahttp.dll
+file=ABI_DIR\BUILD_DIR\javahttps.dll SHARED_LIB_DIR\javahttps.dll
+data=JAVA_VM_RES_BLD\javahttp.odc JAVA_VM_RES_IMG\javahttp.odc
+data=JAVA_VM_RES_BLD\javahttps.odc JAVA_VM_RES_IMG\javahttps.odc
+
+// Socket protocol
+file=ABI_DIR\BUILD_DIR\javasocket.dll SHARED_LIB_DIR\javasocket.dll
+file=ABI_DIR\BUILD_DIR\javasocketscplugin.dll SHARED_LIB_DIR\javasocketscplugin.dll
+data=JAVA_VM_RES_BLD\javasocket.odc JAVA_VM_RES_IMG\javasocket.odc
+
+// Secure socket protocol
+file=ABI_DIR\BUILD_DIR\javassl.dll SHARED_LIB_DIR\javassl.dll
+data=JAVA_VM_RES_BLD\javassl.odc JAVA_VM_RES_IMG\javassl.odc
+
+
+////////////////////////////////
+// Java Extensions collection //
+////////////////////////////////
+
+// Push
+file=ABI_DIR\BUILD_DIR\javapushcontroller.dll SHARED_LIB_DIR\javapushcontroller.dll
+file=ABI_DIR\BUILD_DIR\javapushregistry.dll SHARED_LIB_DIR\javapushregistry.dll
+data=JAVA_VM_RES_BLD\javapushregistry.odc JAVA_VM_RES_IMG\javapushregistry.odc
+
+// Bluetooth
+file=ABI_DIR\BUILD_DIR\javabluecove.dll SHARED_LIB_DIR\javabluecove.dll
+file=ABI_DIR\BUILD_DIR\javabluetooth.dll SHARED_LIB_DIR\javabluetooth.dll
+file=ABI_DIR\BUILD_DIR\javabluetoothcommons.dll SHARED_LIB_DIR\javabluetoothcommons.dll
+file=ABI_DIR\BUILD_DIR\javabtgoepscplugin.dll SHARED_LIB_DIR\javabtgoepscplugin.dll
+file=ABI_DIR\BUILD_DIR\javabtl2capscplugin.dll SHARED_LIB_DIR\javabtl2capscplugin.dll
+file=ABI_DIR\BUILD_DIR\javabtsppscplugin.dll SHARED_LIB_DIR\javabtsppscplugin.dll
+data=JAVA_VM_RES_BLD\javabluecove.odc JAVA_VM_RES_IMG\javabluecove.odc
+data=JAVA_VM_RES_BLD\javabluetooth.odc JAVA_VM_RES_IMG\javabluetooth.odc
+data=JAVA_VM_RES_BLD\javabluetoothcommons.odc JAVA_VM_RES_IMG\javabluetoothcommons.odc
+
+// WMA
+file=ABI_DIR\BUILD_DIR\javawma.dll SHARED_LIB_DIR\javawma.dll
+file=ABI_DIR\BUILD_DIR\javawmamms.dll SHARED_LIB_DIR\javawmamms.dll
+file=ABI_DIR\BUILD_DIR\javacbsscplugin.dll SHARED_LIB_DIR\javacbsscplugin.dll
+file=ABI_DIR\BUILD_DIR\javammsscplugin.dll SHARED_LIB_DIR\javammsscplugin.dll
+file=ABI_DIR\BUILD_DIR\javasmsscplugin.dll SHARED_LIB_DIR\javasmsscplugin.dll
+data=JAVA_VM_RES_BLD\javawma.odc JAVA_VM_RES_IMG\javawma.odc
+data=JAVA_VM_RES_BLD\javawmamms.odc JAVA_VM_RES_IMG\javawmamms.odc
+
+// Comm
+file=ABI_DIR\BUILD_DIR\javacomm.dll SHARED_LIB_DIR\javacomm.dll
+data=JAVA_VM_RES_BLD\javacomm.odc JAVA_VM_RES_IMG\javacomm.odc
+
+// Datagram
+file=ABI_DIR\BUILD_DIR\javadatagram.dll SHARED_LIB_DIR\javadatagram.dll
+file=ABI_DIR\BUILD_DIR\javadatagramscplugin.dll SHARED_LIB_DIR\javadatagramscplugin.dll
+data=JAVA_VM_RES_BLD\javadatagram.odc JAVA_VM_RES_IMG\javadatagram.odc
+
+// Location API
+file=ABI_DIR\BUILD_DIR\javalocation.dll SHARED_LIB_DIR\javalocation.dll
+data=JAVA_VM_RES_BLD\javalocation.odc JAVA_VM_RES_IMG\javalocation.odc
+
+// Sensor API
+file=ABI_DIR\BUILD_DIR\javasensor.dll SHARED_LIB_DIR\javasensor.dll
+data=JAVA_VM_RES_BLD\javasensor.odc JAVA_VM_RES_IMG\javasensor.odc
+
+// Web services API
+file=ABI_DIR\BUILD_DIR\javawebservices.dll SHARED_LIB_DIR\javawebservices.dll
+data=JAVA_VM_RES_BLD\javawebservices.odc JAVA_VM_RES_IMG\javawebservices.odc
+
+// PIM API
+file=ABI_DIR\BUILD_DIR\javapim.dll SHARED_LIB_DIR\javapim.dll
+data=JAVA_VM_RES_BLD\javapim.odc JAVA_VM_RES_IMG\javapim.odc
+
+// RMS API
+file=ABI_DIR\BUILD_DIR\javarms.dll SHARED_LIB_DIR\javarms.dll
+data=JAVA_VM_RES_BLD\javarms.odc JAVA_VM_RES_IMG\javarms.odc
+
+// SATSA API
+file=ABI_DIR\BUILD_DIR\javasatsa.dll SHARED_LIB_DIR\javasatsa.dll
+data=JAVA_VM_RES_BLD\javasatsa.odc JAVA_VM_RES_IMG\javasatsa.odc
+
+// File API
+file=ABI_DIR\BUILD_DIR\javafile.dll SHARED_LIB_DIR\javafile.dll
+data=JAVA_VM_RES_BLD\javafile.odc JAVA_VM_RES_IMG\javafile.odc
+
+// IAP Info API
+file=ABI_DIR\BUILD_DIR\javaiapinfo.dll SHARED_LIB_DIR\javaiapinfo.dll
+data=JAVA_VM_RES_BLD\javaiapinfo.odc JAVA_VM_RES_IMG\javaiapinfo.odc
+
+
+///////////////////
+// Miscellaneous //
+///////////////////
+
+// Generated localization file resources
+data=JAVA_VM_RES_BLD\resources.jar JAVA_VM_RES_IMG\resources.jar
+
+// ODC list files
+data=ZRESOURCE\java\midpOdcList JAVA_RES_IMG\midpodclist
+data=ZRESOURCE\java\installerOdcList JAVA_RES_IMG\installerodclist
+data=ZRESOURCE\java\tckRunnerOdcList JAVA_RES_IMG\tckrunnerodclist
+data=ZRESOURCE\java\javacontrolpanelodclist JAVA_RES_IMG\javacontrolpanelodclist
+
+// trust roots list
+data=ZRESOURCE\java\security\trustroots\midprootslist JAVA_RES_IMG\security\trustroots\midprootslist
+
+// Utility for Services team
+file=ABI_DIR\BUILD_DIR\javaupgradeapp.exe PROGRAMS_DIR\javaupgradeapp.exe
+
+// Java icon size notifier ecom plugin
+ECOM_PLUGIN(javaiconsizenotifplugin.dll, javaiconsizenotifplugin.rsc)
+data=ZRESOURCE\plugins\javaiconsizenotifplugin.rsc ECOM_RESOURCE_DIR\javaiconsizenotifplugin.rsc
+
+#endif
--- a/rom/java_3_1.iby Thu Jul 15 18:31:06 2010 +0300
+++ b/rom/java_3_1.iby Thu Aug 19 09:48:13 2010 +0300
@@ -36,13 +36,12 @@
// stub sis
data=ZSYSTEM\install\java.sis System\Install\java.sis
-#ifdef RD_JAVA_APPLICATION_SETTINGS_QT
// Application settings
-//file=ABI_DIR\BUILD_DIR\javaapplicationsettingsview.dll SHARED_LIB_DIR\javaapplicationsettingsview.dll
-//data=DATAZ_\resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin
-#endif
+file=ABI_DIR\BUILD_DIR\javaapplicationsettingsview.dll SHARED_LIB_DIR\javaapplicationsettingsview.dll
+data=DATAZ_\resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin resource\qt\plugins\appsettings\javaapplicationsettingsview.qtplugin
// Captain
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_autostarter.dll SHARED_LIB_DIR\javacaptain_ext_autostarter.dll
file=ABI_DIR\BUILD_DIR\javacaptain_ext_btdeviceclassmanager.dll SHARED_LIB_DIR\javacaptain_ext_btdeviceclassmanager.dll
file=ABI_DIR\BUILD_DIR\javacaptain_ext_config.dll SHARED_LIB_DIR\javacaptain_ext_config.dll
file=ABI_DIR\BUILD_DIR\javacaptain_ext_ondemand_2.dll SHARED_LIB_DIR\javacaptain_ext_ondemand_2.dll
@@ -50,6 +49,7 @@
file=ABI_DIR\BUILD_DIR\javacaptain_ext_preinstallerstarter.dll SHARED_LIB_DIR\javacaptain_ext_preinstallerstarter.dll
file=ABI_DIR\BUILD_DIR\javacaptain_ext_pushregistryplugin.dll SHARED_LIB_DIR\javacaptain_ext_pushregistryplugin.dll
file=ABI_DIR\BUILD_DIR\javacaptain_ext_storageserverplugin.dll SHARED_LIB_DIR\javacaptain_ext_storageserverplugin.dll
+file=ABI_DIR\BUILD_DIR\javacaptain_ext_settingslistener.dll SHARED_LIB_DIR\javacaptain_ext_settingslistener.dll
#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
file=ABI_DIR\BUILD_DIR\javacaptain_ext_scrupdater.dll SHARED_LIB_DIR\javacaptain_ext_scrupdater.dll
#endif
@@ -61,8 +61,6 @@
file=ABI_DIR\BUILD_DIR\javasizehelperserver.dll SHARED_LIB_DIR\javasizehelperserver.dll
// Installer
-ECOM_PLUGIN(ifeui.dll,ifeui.rsc)
-data=ZRESOURCE\plugins\ifeui.rsc ECOM_RESOURCE_DIR\ifeui.rsc
data=ZPRIVATE\10003a3f\apps\javainstaller_reg.rsc \private\10003a3f\import\apps\javainstaller_reg.rsc
data=ZRESOURCE\apps\javainstaller_loc.rsc APP_RESOURCE_DIR\javainstaller_loc.rsc
data=ZRESOURCE\apps\javainstaller_icon.mif APP_BITMAP_DIR\javainstaller_icon.mif
@@ -73,23 +71,21 @@
file=ABI_DIR\BUILD_DIR\javainstallerstarter.dll PROGRAMS_DIR\javainstallerstarter.dll
file=ABI_DIR\BUILD_DIR\javapreinstaller.dll PROGRAMS_DIR\javapreinstaller.dll
data=ZRESOURCE\java\java_app_92.mif JAVA_RES_IMG\java_app.mif
-data=ZRESOURCE\java\java_trusted.png JAVA_RES_IMG\java_trusted.png
-data=ZRESOURCE\java\java_untrusted.png JAVA_RES_IMG\java_untrusted.png
+data=ZRESOURCE\java\java_3_trusted.png JAVA_RES_IMG\java_3_trusted.png
+data=ZRESOURCE\java\java_3_untrusted.png JAVA_RES_IMG\java_3_untrusted.png
+data=ZRESOURCE\java\javaapplicationinstaller.css JAVA_RES_IMG\javaapplicationinstaller.css
data=DATAZ_\private\102033E6\installer\inst_plugins.cfg \private\102033E6\installer\inst_plugins.cfg
// Launchers
file=ABI_DIR\BUILD_DIR\javalauncher.exe PROGRAMS_DIR\javalauncher.exe
-ECOM_PLUGIN(javaappschemeplugin.dll,javaappschemeplugin.rsc)
-data=ZRESOURCE\plugins\javaappschemeplugin.rsc ECOM_RESOURCE_DIR\javaappschemeplugin.rsc
-
-// SID Checker
-ECOM_PLUGIN(javasidchecker.dll,javasidchecker.rsc)
-data=ZRESOURCE\plugins\javasidchecker.rsc ECOM_RESOURCE_DIR\javasidchecker.rsc
+file=ABI_DIR\BUILD_DIR\javaappscheme.exe PROGRAMS_DIR\javaappscheme.exe
+file=ABI_DIR\BUILD_DIR\javaqtrequest.exe PROGRAMS_DIR\javaqtrequest.exe
#ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK
// Usif installer plugin
ECOM_PLUGIN(javasifplugin.dll,javasifplugin.rsc)
data=ZRESOURCE\plugins\javasifplugin.rsc ECOM_RESOURCE_DIR\javasifplugin.rsc
+file=ABI_DIR\BUILD_DIR\javainstallcopier.exe PROGRAMS_DIR\javainstallcopier.exe
#endif
// Recognizers
@@ -117,22 +113,13 @@
// eSWT
file=ABI_DIR\BUILD_DIR\eswtqt.dll SHARED_LIB_DIR\eswtqt.dll
data=JAVA_VM_RES_BLD\eswtqt.odc JAVA_VM_RES_IMG\eswtqt.odc
+file=ABI_DIR\BUILD_DIR\eswtqtwebkit.dll SHARED_LIB_DIR\eswtqtwebkit.dll
+data=JAVA_VM_RES_BLD\eswtqtwebkit.odc JAVA_VM_RES_IMG\eswtqtwebkit.odc
// LCDUI
file=ABI_DIR\BUILD_DIR\openlcdui.dll SHARED_LIB_DIR\openlcdui.dll
data=JAVA_VM_RES_BLD\openlcdui.odc JAVA_VM_RES_IMG\openlcdui.odc
-// AMMS API
-/*
-file=ABI_DIR\BUILD_DIR\javaamms.dll SHARED_LIB_DIR\javaamms.dll
-data=JAVA_VM_RES_BLD\javaamms.odc JAVA_VM_RES_IMG\javaamms.odc
-*/
-// Mobile Media API
-/*
-file=ABI_DIR\BUILD_DIR\javamobilemedia.dll SHARED_LIB_DIR\javamobilemedia.dll
-data=JAVA_VM_RES_BLD\javamobilemedia.odc JAVA_VM_RES_IMG\javamobilemedia.odc
-data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaCapture.wav \System\Sounds\Digital\CamcorderJavaCapture.wav
-data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaStart.wav \System\Sounds\Digital\CamcorderJavaStart.wav
-*/
+
// MobInfo API
file=ABI_DIR\BUILD_DIR\javamobinfo.dll SHARED_LIB_DIR\javamobinfo.dll
data=JAVA_VM_RES_BLD\javamobinfo.odc JAVA_VM_RES_IMG\javamobinfo.odc
@@ -146,22 +133,21 @@
data=JAVA_VM_RES_BLD\javasoftnotification.odc JAVA_VM_RES_IMG\javasoftnotification.odc
*/
-// 2G API
+// M2G API
/*file=ABI_DIR\BUILD_DIR\javam2g.dll SHARED_LIB_DIR\javam2g.dll
data=JAVA_VM_RES_BLD\javam2g.odc JAVA_VM_RES_IMG\javam2g.odc
*/
-// 3G API
-/*file=ABI_DIR\BUILD_DIR\javam3g.dll SHARED_LIB_DIR\javam3g.dll
+// M3G API
+file=ABI_DIR\BUILD_DIR\javam3g.dll SHARED_LIB_DIR\javam3g.dll
data=JAVA_VM_RES_BLD\javam3g.odc JAVA_VM_RES_IMG\javam3g.odc
-*/
+
// Nokia UI API
file=ABI_DIR\BUILD_DIR\javanokiaui.dll SHARED_LIB_DIR\javanokiaui.dll
data=JAVA_VM_RES_BLD\javanokiaui.odc JAVA_VM_RES_IMG\javanokiaui.odc
// Nokia Sound API
-/*file=ABI_DIR\BUILD_DIR\javanokiasound.dll SHARED_LIB_DIR\javanokiasound.dll
+file=ABI_DIR\BUILD_DIR\javanokiasound.dll SHARED_LIB_DIR\javanokiasound.dll
data=JAVA_VM_RES_BLD\javanokiasound.odc JAVA_VM_RES_IMG\javanokiasound.odc
-*/
// Remote Connection Observer
/*file=ABI_DIR\BUILD_DIR\javaremconobserver.dll SHARED_LIB_DIR\javaremconobserver.dll
@@ -180,6 +166,7 @@
file=ABI_DIR\BUILD_DIR\javaruntimeui.dll SHARED_LIB_DIR\javaruntimeui.dll
data=JAVA_VM_RES_BLD\javaruntimeui.odc JAVA_VM_RES_IMG\javaruntimeui.odc
file=ABI_DIR\BUILD_DIR\javaruntimestarterutils.dll SHARED_LIB_DIR\javaruntimestarterutils.dll
+file=ABI_DIR\BUILD_DIR\javastarter.dll SHARED_LIB_DIR\javastarter.dll
// MIDP runtime
file=ABI_DIR\BUILD_DIR\javamidp.exe PROGRAMS_DIR\javamidp.exe
@@ -344,6 +331,15 @@
file=ABI_DIR\BUILD_DIR\javaiapinfo.dll SHARED_LIB_DIR\javaiapinfo.dll
data=JAVA_VM_RES_BLD\javaiapinfo.odc JAVA_VM_RES_IMG\javaiapinfo.odc
+// MMAPI
+file=ABI_DIR\BUILD_DIR\javamobilemedia.dll SHARED_LIB_DIR\javamobilemedia.dll
+data=JAVA_VM_RES_BLD\javamobilemedia.odc JAVA_VM_RES_IMG\javamobilemedia.odc
+data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaCapture.wav \System\Sounds\Digital\CamcorderJavaCapture.wav
+data=ABI_DIR\BUILD_DIR\z\system\sounds\digital\CamcorderJavaStart.wav \System\Sounds\Digital\CamcorderJavaStart.wav
+
+// AMMS
+file=ABI_DIR\BUILD_DIR\javaamms.dll SHARED_LIB_DIR\javaamms.dll
+data=JAVA_VM_RES_BLD\javaamms.odc JAVA_VM_RES_IMG\javaamms.odc
///////////////////
// Miscellaneous //
@@ -356,8 +352,12 @@
data=ZRESOURCE\java\midpOdcList JAVA_RES_IMG\midpodclist
data=ZRESOURCE\java\installerOdcList JAVA_RES_IMG\installerodclist
data=ZRESOURCE\java\tckRunnerOdcList JAVA_RES_IMG\tckrunnerodclist
+data=ZRESOURCE\java\javacontrolpanelodclist JAVA_RES_IMG\javacontrolpanelodclist
// trust roots list
data=ZRESOURCE\java\security\trustroots\midprootslist JAVA_RES_IMG\security\trustroots\midprootslist
+// Utility for Services team
+file=ABI_DIR\BUILD_DIR\javaupgradeapp.exe PROGRAMS_DIR\javaupgradeapp.exe
+
#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/javacontrolpanelodclist Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,7 @@
+javautils.odc
+javacomms.odc
+javalegacyutils.odc
+eswt.odc
+eswtdirectcontent.odc
+resources.jar
+javacontrolpanel.odc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/javacontrolpanelodclist30 Thu Aug 19 09:48:13 2010 +0300
@@ -0,0 +1,5 @@
+javautils.odc
+javacomms.odc
+eswtqt.odc
+resources.jar
+javacontrolpanel.odc
--- a/rom/javatest.iby Thu Jul 15 18:31:06 2010 +0300
+++ b/rom/javatest.iby Thu Aug 19 09:48:13 2010 +0300
@@ -46,9 +46,10 @@
data=JAVA_CERT_BLD\test_trustedthirdparty.der JAVA_CERT_IMG\test_trustedthirdparty.der
data=JAVA_CERT_BLD\test_trustedthirdparty.metadata JAVA_CERT_IMG\test_trustedthirdparty.metadata
-// JavaCap App test utility
-file=ABI_DIR\BUILD_DIR\JavaCap.exe PROGRAMS_DIR\JavaCap.exe
-data=ZPRIVATE\10003a3f\apps\JavaCap_reg.rsc \private\10003a3f\import\apps\JavaCap_reg.rsc
-data=\epoc32\data\z\resource\apps\JavaCap.rsc \resource\apps\JavaCap.rsc
+// Java Control Panel test utility
+file=ABI_DIR\BUILD_DIR\javacontrolpanel.exe PROGRAMS_DIR\javacontrolpanel.exe
+file=ABI_DIR\BUILD_DIR\javacontrolpanel.dll SHARED_LIB_DIR\javacontrolpanel.dll
+data=JAVA_VM_ODC_BLD\javacontrolpanel.odc JAVA_VM_ODC_IMG\javacontrolpanel.odc
+data=ZPRIVATE\10003a3f\apps\javacontrolpanel_reg.rsc \private\10003a3f\import\apps\javacontrolpanel_reg.rsc
#endif
--- a/rom/midpodclist30 Thu Jul 15 18:31:06 2010 +0300
+++ b/rom/midpodclist30 Thu Aug 19 09:48:13 2010 +0300
@@ -1,4 +1,5 @@
eswtqt.odc
+javaamms.odc
javabluecove.odc
javabluetooth.odc
javabluetoothcommons.odc
@@ -17,6 +18,7 @@
javam3g.odc
javamidpruntime.odc
javamobinfo.odc
+javamobilemedia.odc
javanokiasound.odc
javapim.odc
javapushregistry.odc