|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-E3941FAF-988E-5FB3-8E62-84E192E41EA1" xml:lang="en"><title>Managing |
|
13 a Dynamic Startup Configuration</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section><title>Introduction</title> <p>Managing a Dynamic Startup Configuration |
|
15 (DSC) corresponds to the process of <xref href="GUID-E3941FAF-988E-5FB3-8E62-84E192E41EA1.dita#GUID-E3941FAF-988E-5FB3-8E62-84E192E41EA1/GUID-29F02099-0371-5FF5-B6A1-7C035096ED68">adding</xref>, <xref href="GUID-E3941FAF-988E-5FB3-8E62-84E192E41EA1.dita#GUID-E3941FAF-988E-5FB3-8E62-84E192E41EA1/GUID-E331B03E-28BA-567E-9E84-5E7DFFEEDCEC">modifying</xref> and |
|
16 removing items from a DSC. For example, a device creator can add an AMC (After |
|
17 Market Component) to a DSC, which is required to be started at phone boot |
|
18 time along with other AMCs. Another example can be a device creator wishing |
|
19 to change the start up behavior of an AMC, so that it can start in the background. </p> <p>You |
|
20 can use <xref href="GUID-EB3CA81E-8684-3851-A556-1C91CAD3891F.dita"><apiname>RDscStore</apiname></xref> and <xref href="GUID-54F2480A-07A1-3FA1-920D-5F1D3469C40B.dita"><apiname>CDscItem</apiname></xref> to manage |
|
21 a DSC. <xref href="GUID-54F2480A-07A1-3FA1-920D-5F1D3469C40B.dita"><apiname>CDscItem</apiname></xref> is dependant upon common startup classes <xref href="GUID-90F95A8A-A901-3987-99ED-57F1A57F1C09.dita"><apiname>CStartupProperties</apiname></xref>, <xref href="GUID-CE6290FD-9E85-3587-851E-F50791556DCE.dita"><apiname>TStartupMethod</apiname></xref>, <xref href="GUID-117F3C1B-9E2D-34D2-9353-7CB8C9369D27.dita"><apiname>TStartupType</apiname></xref> and <xref href="GUID-60321D90-AC11-349A-9CA7-CDC962A63A07.dita"><apiname>TRestartAction</apiname></xref>. </p> <p>Usage |
|
22 of <xref href="GUID-EB3CA81E-8684-3851-A556-1C91CAD3891F.dita"><apiname>RDscStore</apiname></xref> is straightforward. You need to create an |
|
23 instance of <xref href="GUID-EB3CA81E-8684-3851-A556-1C91CAD3891F.dita"><apiname>RDscStore</apiname></xref>, call <codeph>OpenL()</codeph> and |
|
24 use the functions as appropriate. Most of the functions leave with error codes, |
|
25 rather than returning. The error code is typically <codeph>KErrNotReady</codeph>, |
|
26 if the DSC database is not set up, or the code returned by the encapsulated |
|
27 database client. </p> <p>Note that <xref href="GUID-EB3CA81E-8684-3851-A556-1C91CAD3891F.dita"><apiname>RDscStore</apiname></xref> is NOT derived |
|
28 from <xref href="GUID-6D8A458C-9A39-3000-A3BC-060A2A3663E6.dita"><apiname>RSessionBase</apiname></xref>. </p> </section> |
|
29 <section><title>Procedure</title> <p id="GUID-29F02099-0371-5FF5-B6A1-7C035096ED68"><b>Adding |
|
30 an item to a DSC</b> </p> <ol id="GUID-03CFC3E5-19C7-5CCF-BC8B-9FA78BDB2AF4"> |
|
31 <li id="GUID-231AB326-E496-5F5F-940E-A85884A2FBB2"><p>Create the DSC item |
|
32 using <xref href="GUID-54F2480A-07A1-3FA1-920D-5F1D3469C40B.dita"><apiname>CDscItem</apiname></xref>. </p> <codeblock id="GUID-F193D641-FBA7-53EC-B736-B770B54343F6" xml:space="preserve">TUid iDscUid; |
|
33 iDscUid = TUid::Uid(KDefaultSymbianDsc); |
|
34 |
|
35 //Create the instance |
|
36 CDscItem* dscItem = CDscItem::NewL(); |
|
37 CleanupStack::PushL(dscItem); |
|
38 |
|
39 dscItem->SetDscId(iDscUid); |
|
40 |
|
41 //Define the name of the AMC |
|
42 _LIT( filename, "mypackage.exe"); |
|
43 |
|
44 //Arguments for the AMC |
|
45 TPtrC amaArgs; |
|
46 ... |
|
47 |
|
48 //Set the file parameters for the AMC |
|
49 dscItem->SetFileParamsL(filename, amaArgs); |
|
50 |
|
51 //Set the start-up properties for the AMC |
|
52 dscItem->SetStartupTypeL(TStartupType::EStartProcess); |
|
53 dscItem->SetStartMethodL(TStartMethod::EFireAndForget); |
|
54 dscItem->SetNoOfRetriesL(TNoOfRetries::ERetry0); |
|
55 |
|
56 ... |
|
57 |
|
58 CleanupStack::PopAndDestroy(dscItem);</codeblock> </li> |
|
59 <li id="GUID-C5431C80-CBE7-5D12-B701-0C28F09FFFBC"><p>Add the DSC item to |
|
60 the DSC using <xref href="GUID-EB3CA81E-8684-3851-A556-1C91CAD3891F.dita#GUID-EB3CA81E-8684-3851-A556-1C91CAD3891F/GUID-11BA9684-72EF-329F-B94B-223515E1133A"><apiname>RDscStore::AddItemL()</apiname></xref>. </p> <codeblock id="GUID-994924FF-9657-580F-AA2E-C0564868BA67" xml:space="preserve">RDscStore dscClient; |
|
61 dscClient.OpenL(); |
|
62 CleanupClosePushL(dscClient); |
|
63 |
|
64 ... |
|
65 |
|
66 dscClient.AddItemL(*dscItem); |
|
67 CleanupStack::PopAndDestroy();</codeblock> </li> |
|
68 </ol> <p id="GUID-E331B03E-28BA-567E-9E84-5E7DFFEEDCEC"><b>Modifying an item |
|
69 in a DSC</b> </p> <ol id="GUID-DF840BDC-1799-50F4-8BAB-89891FEC35AC"> |
|
70 <li id="GUID-F60BD2CA-F3C7-5CAA-97F0-64AE5810790F"><p>Make changes to the |
|
71 DSC item as per your requirement using the functions of <xref href="GUID-54F2480A-07A1-3FA1-920D-5F1D3469C40B.dita"><apiname>CDscItem</apiname></xref>. </p> <codeblock id="GUID-F48EBB29-4318-592E-ABF6-4B3D5A10DDA9" xml:space="preserve">CDscItem* dscItem = CDscItem::NewL(); |
|
72 CleanupStack::PushL(dscItem); |
|
73 |
|
74 //Change the start-up properties for the AMC |
|
75 dscItem->SetStartupTypeL(TStartupType::EStartApp); |
|
76 dscItem->SetStartMethodL(TStartMethod::EWaitForStart); |
|
77 dscItem->SetNoOfRetriesL(TNoOfRetries::ERetry1); |
|
78 |
|
79 ... |
|
80 |
|
81 CleanupStack::PopAndDestroy(dscItem);</codeblock> </li> |
|
82 <li id="GUID-C6592B4D-45CA-5034-8739-F659755AD5C2"><p>Pass the updated DSC |
|
83 item to the DSC using <xref href="GUID-EB3CA81E-8684-3851-A556-1C91CAD3891F.dita#GUID-EB3CA81E-8684-3851-A556-1C91CAD3891F/GUID-9BB82550-B622-3777-BC4B-6966D4EC6995"><apiname>RDscStore::UpdateItemL()</apiname></xref>. </p> <codeblock id="GUID-8EF684B4-29C4-50BA-9CE7-22BABB676666" xml:space="preserve">RDscStore dscClient; |
|
84 dscClient.OpenL(); |
|
85 CleanupClosePushL(dscClient); |
|
86 |
|
87 ... |
|
88 |
|
89 dscClient.UpdateItemL(*dscItem); |
|
90 CleanupStack::PopAndDestroy();</codeblock> </li> |
|
91 </ol> </section> |
|
92 </conbody><related-links> |
|
93 <link href="GUID-70202CC9-BC49-539A-8255-4B0B9C24A702.dita"><linktext> After Market |
|
94 Application Starter Overview</linktext></link> |
|
95 <link href="GUID-623B375B-6EAD-53A2-AB4E-CCDF1BDB5057.dita"><linktext>Creating |
|
96 a Dynamic Startup Configuration</linktext></link> |
|
97 </related-links></concept> |