Symbian3/SDK/Source/GUID-1E4FFC56-8473-4E0A-B2E2-4E8DE8B1D00F.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     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 task
       
    11   PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
       
    12 <task id="GUID-1E4FFC56-8473-4E0A-B2E2-4E8DE8B1D00F" xml:lang="en"><title>Increasing
       
    13 the Priority of a Third-Party Application</title><shortdesc>This section describes how a third-party application can increase
       
    14 its OOM priority by using OOM Monitor APIs.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
       
    15 <context id="GUID-FD9A15E9-6313-4BD3-A52A-7E3B71D39B37-GENID-1-8-1-10-1-1-8-1-5-1-6-1-5-1-3-1"><p>Third-party applications
       
    16 that needs to be running all the time can increase their priority to <codeph>High</codeph> from
       
    17 the default level (<codeph>Normal</codeph>). By increasing the priority, applications
       
    18 can protect itself from being closed by the OOM Monitor. For example:</p><ul>
       
    19 <li><p>IP Phone application receiving IP calls </p></li>
       
    20 <li><p>Instant Messaging application receiving messages</p></li>
       
    21 </ul><p>are applications which listens for events from the network all the
       
    22 time.</p></context>
       
    23 <steps id="GUID-01A482C7-3004-484D-9948-B0B892E913AF-GENID-1-8-1-10-1-1-8-1-5-1-6-1-5-1-3-2">
       
    24 <step id="GUID-83631E4F-71D0-4FD2-8FD6-46689AAFA761-GENID-1-8-1-10-1-1-8-1-5-1-6-1-5-1-3-2-1"><cmd>Create an OOM Monitor
       
    25 session</cmd>
       
    26 <info><codeblock xml:space="preserve">ROomMonitorSession ioomMonitorSession;
       
    27 CleanUpClosePushL(ioomMonitorSession);
       
    28 User::LeaveIfError(ioomMonitorSession.Connect());
       
    29 </codeblock></info>
       
    30 </step>
       
    31 <step id="GUID-3033BB28-ACC5-440C-9BDB-D1BC36CD001C-GENID-1-8-1-10-1-1-8-1-5-1-6-1-5-1-3-2-2"><cmd>Set the priority
       
    32 for the application to <codeph>High</codeph> .</cmd>
       
    33 <info><codeblock xml:space="preserve">iOomMonitorSession.SetOomPriority(ROomMonitorSession::EOomPriorityHigh);
       
    34 DoCriticalBackgroundProcessingL();
       
    35 </codeblock></info>
       
    36 </step>
       
    37 <step id="GUID-5B3E8176-528F-45E7-B1CE-57ADCFAB5C6C-GENID-1-8-1-10-1-1-8-1-5-1-6-1-5-1-3-2-3"><cmd>Close the session.</cmd>
       
    38 <info><codeblock xml:space="preserve">iOomMonitorSession.Close();
       
    39 </codeblock></info>
       
    40 </step>
       
    41 </steps>
       
    42 </taskbody><related-links>
       
    43 <link href="GUID-CE308C71-D8B2-43B3-97FD-B868285ED5FB.dita"><linktext>OOM Monitor
       
    44 Priority</linktext></link>
       
    45 <link href="GUID-88752800-83BD-4845-80A0-6B65D8D81924.dita"><linktext>OOM Monitor
       
    46 Reference</linktext></link>
       
    47 </related-links></task>