|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Implementation of CDCMOCustCmdAllReasons class. |
|
16 * |
|
17 */ |
|
18 |
|
19 #include <schtime.h> |
|
20 #include <csch_cli.h> |
|
21 #include <centralrepository.h> |
|
22 #include <dcmoclient.h> |
|
23 #include <featmgr.h> |
|
24 #include <DevManInternalCRKeys.h> |
|
25 #include "dcmocustcmdallreasons.h" |
|
26 #include "dcmostartupDebug.h" |
|
27 |
|
28 |
|
29 // ======== MEMBER FUNCTIONS ======== |
|
30 |
|
31 // --------------------------------------------------------------------------- |
|
32 // CDCMOCustCmdAllReasons::NewL |
|
33 // --------------------------------------------------------------------------- |
|
34 // |
|
35 CDCMOCustCmdAllReasons* CDCMOCustCmdAllReasons::NewL() |
|
36 { |
|
37 FLOG( _L( "[CDCMOCustCmdAllReasons::NewL() BEGIN " ) ); |
|
38 return new ( ELeave ) CDCMOCustCmdAllReasons; |
|
39 } |
|
40 |
|
41 |
|
42 // --------------------------------------------------------------------------- |
|
43 // CDCMOCustCmdAllReasons::~CDCMOCustCmdAllReasons |
|
44 // --------------------------------------------------------------------------- |
|
45 // |
|
46 CDCMOCustCmdAllReasons::~CDCMOCustCmdAllReasons() |
|
47 { |
|
48 FLOG( _L( "[CDCMOCustCmdAllReasons::~CDCMOCustCmdAllReasons() " ) ); |
|
49 } |
|
50 |
|
51 |
|
52 // --------------------------------------------------------------------------- |
|
53 // CDCMOCustCmdAllReasons::Initialize |
|
54 // --------------------------------------------------------------------------- |
|
55 // |
|
56 TInt CDCMOCustCmdAllReasons::Initialize( CSsmCustomCommandEnv* /*aCmdEnv*/ ) |
|
57 { |
|
58 FLOG( _L( "[CDCMOCustCmdAllReasons::~Initialize() " ) ); |
|
59 return KErrNone; |
|
60 } |
|
61 |
|
62 |
|
63 // --------------------------------------------------------------------------- |
|
64 // CDCMOCustCmdAllReasons::Execute |
|
65 // --------------------------------------------------------------------------- |
|
66 // |
|
67 void CDCMOCustCmdAllReasons::Execute( |
|
68 const TDesC8& /*aParams*/, |
|
69 TRequestStatus& aRequest ) |
|
70 { |
|
71 FLOG( _L( "[CDCMOCustCmdAllReasons::~Execute() BEGIN " ) ); |
|
72 aRequest = KRequestPending; |
|
73 TRAP_IGNORE(ExecuteL()); |
|
74 TRequestStatus* request = &aRequest; |
|
75 User::RequestComplete( request, KErrNone ); |
|
76 FLOG( _L( "[CDCMOCustCmdAllReasons::~Execute() END " ) ); |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // CDCMOCustCmdAllReasons::ExecuteL |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 void CDCMOCustCmdAllReasons::ExecuteL( ) |
|
84 { |
|
85 FLOG( _L( "[CDCMOStartupExtensionPlugIn]::ExecuteL() Boot reason AllReason BEGIN " ) ); |
|
86 FeatureManager::InitializeLibL(); |
|
87 if ( FeatureManager::FeatureSupported ( KFeatureIdFfRuntimeDeviceCapabilityConfiguration ) ) |
|
88 { |
|
89 CRepository *rep = NULL; |
|
90 TInt value(KErrNotFound); |
|
91 TRAPD( err1, rep = CRepository::NewL( KCRUidDeviceManagementInternalKeys )) ; |
|
92 if(!err1) |
|
93 rep->Get( KDevManMemCardCtrl, value ); |
|
94 delete rep; |
|
95 rep = NULL; |
|
96 if(!value) |
|
97 { |
|
98 RDCMOClient* dcmoClient = NULL; |
|
99 TRAPD( err2, dcmoClient = RDCMOClient::NewL()); |
|
100 if(!err2) |
|
101 { |
|
102 TBuf<20> xValue; |
|
103 xValue.Copy(_L("ExternalMemory")); |
|
104 TInt err = dcmoClient->SetDCMOIntAttributeValue(xValue, EEnable, value); |
|
105 delete dcmoClient; |
|
106 dcmoClient = NULL; |
|
107 } |
|
108 } |
|
109 } |
|
110 // uninitialize feature manager |
|
111 FeatureManager::UnInitializeLib(); |
|
112 FLOG( _L( "[CDCMOStartupExtensionPlugIn]::ExecuteL() Boot reason AllReason END " ) ); |
|
113 } |
|
114 |
|
115 // --------------------------------------------------------------------------- |
|
116 // CDCMOCustCmdAllReasons::ExecuteCancel |
|
117 // --------------------------------------------------------------------------- |
|
118 // |
|
119 void CDCMOCustCmdAllReasons::ExecuteCancel() |
|
120 { |
|
121 |
|
122 } |
|
123 |
|
124 |
|
125 // --------------------------------------------------------------------------- |
|
126 // CDCMOCustCmdAllReasons::Close |
|
127 // --------------------------------------------------------------------------- |
|
128 // |
|
129 void CDCMOCustCmdAllReasons::Close() |
|
130 { |
|
131 FLOG( _L( "[CDCMOStartupExtensionPlugIn]::Close() " ) ); |
|
132 } |
|
133 |
|
134 |
|
135 // --------------------------------------------------------------------------- |
|
136 // CDCMOCustCmdAllReasons::Release |
|
137 // --------------------------------------------------------------------------- |
|
138 // |
|
139 void CDCMOCustCmdAllReasons::Release() |
|
140 { |
|
141 |
|
142 FLOG( _L( "[CDCMOStartupExtensionPlugIn]::Close() " ) ); |
|
143 delete this; |
|
144 } |