22 |
24 |
23 #include <e32std.h> |
25 #include <e32std.h> |
24 |
26 |
25 #include <domaindefs.h> |
27 #include <domaindefs.h> |
26 |
28 |
|
29 |
27 /** |
30 /** |
28 @internalComponent |
31 Internal macro used by EStart source. It provides the filename of the Domain |
|
32 Manager server. |
|
33 Not to be used outside the KernelHwSrv package. |
29 */ |
34 */ |
30 #define KDmManagerFileNameLit _L("domainSrv.exe") |
35 #define KDmManagerFileNameLit _L("domainSrv.exe") |
31 |
36 |
|
37 |
|
38 |
32 /** |
39 /** |
33 @internalComponent |
40 Internal session class used inside the Domain Manager client library. |
|
41 Not to be used outside the KernelHwSrv package. |
34 */ |
42 */ |
35 class RDmManagerSession : public RSessionBase |
43 class RDmManagerSession : public RSessionBase |
36 { |
44 { |
37 public: |
45 public: |
|
46 // Power hierarchy connect |
38 TInt Connect(); |
47 TInt Connect(); |
|
48 |
|
49 // Specified hierarchy connect |
39 TInt Connect(TDmHierarchyId aHierarchyId); |
50 TInt Connect(TDmHierarchyId aHierarchyId); |
40 TInt ConnectObserver(TDmHierarchyId aHierarchyId); |
51 TInt ConnectObserver(TDmHierarchyId aHierarchyId); |
|
52 |
|
53 // Controller related functions |
41 void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
54 void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
42 void RequestDomainTransition(TDmDomainId, TDmDomainState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
55 void RequestDomainTransition(TDmDomainId, TDmDomainState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
43 void CancelTransition(); |
56 void CancelTransition(); |
44 TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId); |
57 TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId); |
45 TInt GetTransitionFailureCount(); |
58 TInt GetTransitionFailureCount(); |
46 TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures); |
59 TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures); |
|
60 |
47 // Observer related functions |
61 // Observer related functions |
48 TInt StartObserver(TDmDomainId aDomainId,TDmNotifyType aNotifyType); |
62 TInt StartObserver(TDmDomainId aDomainId,TDmNotifyType aNotifyType); |
49 void GetNotification(TRequestStatus& aStatus); |
63 void GetNotification(TRequestStatus& aStatus); |
50 TInt GetEventCount(); |
64 TInt GetEventCount(); |
51 TInt GetEvents(RArray<const TTransInfo>& aTransitions); |
65 TInt GetEvents(RArray<const TTransInfo>& aTransitions); |
53 TInt ObserverDomainCount(); |
67 TInt ObserverDomainCount(); |
54 }; |
68 }; |
55 |
69 |
56 |
70 |
57 /** |
71 /** |
58 @publishedPartner |
72 Published platform interface of the Domain Manager for clients performing |
59 @released |
73 the "Domain Controller" role implementing domain policy on the platform. |
60 |
74 |
61 The policy's interface to the domain manager. |
75 Controllers can use this class to request domain state transitions either |
|
76 system-wide across the whole domain hierarchy or only within a specific domain |
|
77 subtree. |
|
78 |
|
79 The Domain Manager may utilize the Transition Monitoring feature for some state |
|
80 transitions (as defined in the policy) which allows trusted clients to request |
|
81 more time to complete their work for the transition e.g. power down transitions. |
|
82 |
|
83 It also provides utility methods allowing policy controllers to load additional |
|
84 hierarchies (from a domain policy library) and to monitor the Domain Manager's |
|
85 start-up. |
|
86 |
|
87 See the RDmDomain class for the interface used by Domain Member clients. |
|
88 |
|
89 Also see domaindefs.h for Domain Manager specific error codes used with this |
|
90 API. |
62 */ |
91 */ |
63 class RDmDomainManager |
92 class RDmDomainManager |
64 { |
93 { |
65 public: |
94 public: |
66 IMPORT_C static TInt WaitForInitialization(); |
95 IMPORT_C static TInt WaitForInitialization(); |
|
96 |
67 public: |
97 public: |
|
98 // Power Hierarchy |
68 IMPORT_C TInt Connect(); |
99 IMPORT_C TInt Connect(); |
69 IMPORT_C void Close(); |
|
70 |
|
71 IMPORT_C void RequestSystemTransition(TPowerState aState, TRequestStatus& aStatus); |
100 IMPORT_C void RequestSystemTransition(TPowerState aState, TRequestStatus& aStatus); |
72 IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TPowerState aState, TRequestStatus& aStatus); |
101 IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TPowerState aState, TRequestStatus& aStatus); |
|
102 IMPORT_C void SystemShutdown(); |
|
103 |
|
104 // Controller Specified Hierarchy |
|
105 IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId); |
|
106 IMPORT_C TInt Connect(TDmHierarchyId aHierarchyId); |
|
107 IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
|
108 IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
|
109 |
|
110 // Common session/hierarchy |
|
111 IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures); |
|
112 IMPORT_C TInt GetTransitionFailureCount(); |
73 IMPORT_C void CancelTransition(); |
113 IMPORT_C void CancelTransition(); |
74 |
114 IMPORT_C void Close(); |
75 IMPORT_C void SystemShutdown(); |
115 |
76 /** |
|
77 @internalAll |
|
78 */ |
|
79 IMPORT_C TInt Connect(TDmHierarchyId aHierarchyId); |
|
80 /** |
|
81 @internalAll |
|
82 */ |
|
83 IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
|
84 /** |
|
85 @internalAll |
|
86 */ |
|
87 IMPORT_C void RequestDomainTransition(TDmDomainId aDomain, TDmDomainState aState, TDmTraverseDirection aDirection, TRequestStatus& aStatus); |
|
88 /** |
|
89 @internalAll |
|
90 */ |
|
91 IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId); |
|
92 /** |
|
93 @internalAll |
|
94 */ |
|
95 IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures); |
|
96 /** |
|
97 @internalAll |
|
98 */ |
|
99 IMPORT_C TInt GetTransitionFailureCount(); |
|
100 private: |
116 private: |
101 RDmManagerSession iSession; |
117 RDmManagerSession iSession; |
102 }; |
118 }; |
103 |
119 |
104 |
120 |
105 |
121 |
106 |
|
107 /** |
|
108 @internalComponent |
|
109 |
|
110 An abstract class to allow a domain controller to interface to the domain manager. |
|
111 |
|
112 To make use of this class an application must derive from it and implement a RunL() |
|
113 method to handle notifications. |
|
114 After the derived class has been instantiated, it must call ConstructL(). |
|
115 */ |
|
116 class CDmDomainManager : public CActive |
|
117 { |
|
118 public: |
|
119 IMPORT_C CDmDomainManager(TDmHierarchyId aHierarchyId); |
|
120 IMPORT_C ~CDmDomainManager(); |
|
121 |
|
122 IMPORT_C void RequestSystemTransition(TDmDomainState aState, TDmTraverseDirection aDirection); |
|
123 IMPORT_C void RequestDomainTransition(TDmDomainId aDomainId, TDmDomainState aState, TDmTraverseDirection aDirection); |
|
124 IMPORT_C static TInt AddDomainHierarchy(TDmHierarchyId aHierarchyId); |
|
125 IMPORT_C TInt GetTransitionFailures(RArray<const TTransitionFailure>& aTransitionFailures); |
|
126 IMPORT_C TInt GetTransitionFailureCount(); |
|
127 virtual void RunL() = 0; |
|
128 protected: |
|
129 // from CActive |
|
130 IMPORT_C void DoCancel(); |
|
131 IMPORT_C void ConstructL(); |
|
132 |
|
133 private: |
|
134 RDmDomainManager iManager; |
|
135 TDmHierarchyId iHierarchyId; |
|
136 TInt iReserved[4]; |
|
137 }; |
|
138 |
|
139 #endif |
122 #endif |