109 iStreamer = CBTSACStreamerController::NewL(*this); |
109 iStreamer = CBTSACStreamerController::NewL(*this); |
110 // Initially idle state is registered as observer of GAVDP |
110 // Initially idle state is registered as observer of GAVDP |
111 iGavdp = CBTSACGavdp::NewL(state); |
111 iGavdp = CBTSACGavdp::NewL(state); |
112 iLocalSEPs = CBTSACSEPManager::NewL(TBTDevAddr()); |
112 iLocalSEPs = CBTSACSEPManager::NewL(TBTDevAddr()); |
113 iGavdpErrorActive = CBtsacActive::NewL(*this, CActive::EPriorityStandard, KRequestIdGavdpError); |
113 iGavdpErrorActive = CBtsacActive::NewL(*this, CActive::EPriorityStandard, KRequestIdGavdpError); |
114 ChangeStateL(state); |
114 CleanupStack::Pop(state); |
115 CleanupStack::Pop(state); |
115 ChangeStateL(state); |
116 |
|
117 ResetRemoteCache(); |
116 ResetRemoteCache(); |
118 |
117 |
119 TInt err = RProperty::Define( KBTAudioRemCon, |
118 TInt err = RProperty::Define( KBTAudioRemCon, |
120 KBTAudioPlayerControl, RProperty::EInt, |
119 KBTAudioPlayerControl, RProperty::EInt, |
121 KPSKeyReadPolicy, |
120 KPSKeyReadPolicy, |
126 |
125 |
127 // ----------------------------------------------------------------------------- |
126 // ----------------------------------------------------------------------------- |
128 // CBTSAController::ChangeStateL |
127 // CBTSAController::ChangeStateL |
129 // ----------------------------------------------------------------------------- |
128 // ----------------------------------------------------------------------------- |
130 // |
129 // |
|
130 |
131 void CBTSAController::ChangeStateL(CBtsacState* aState) |
131 void CBTSAController::ChangeStateL(CBtsacState* aState) |
132 { |
132 { |
133 TRACE_FUNC_ENTRY |
133 TRACE_FUNC_ENTRY |
134 TRACE_ASSERT(!!aState, EBTPanicNullPointer); |
134 TRACE_ASSERT(aState != NULL, EBTPanicNullPointer); |
135 if(iState) |
135 if(iState && aState->GetStateIndex() == iState->GetStateIndex()) |
136 { |
136 { |
137 if(aState->GetStateIndex() == iState->GetStateIndex()) |
137 // We already are in desired state, delete the state which came in and return |
138 { |
138 TRACE_INFO((_L("CBTSAController::ChangeStateL(), already in desired state."))) |
139 // We already are in desired state, delete the state which came in and return |
139 delete aState; |
140 TRACE_INFO((_L("CBTSAController::ChangeStateL(), already in desired state."))) |
140 return; |
141 delete aState; |
141 } |
142 return; |
142 delete iState; |
143 } |
143 iState = aState; |
144 } |
144 TInt err = KErrNone; |
145 CBtsacState *CurrentState = iState; |
145 TRAP(err, iState->EnterL()); |
146 iState = aState; |
146 if (err) |
147 TInt err = KErrNone; |
147 { |
148 TRAP(err, iState->EnterL()); |
148 ChangeStateL(iState->ErrorOnEntryL(err)); |
149 if (err) |
149 } |
150 { |
150 TRACE_FUNC_EXIT |
151 ChangeStateL(iState->ErrorOnEntryL(err)); |
151 } |
152 } |
152 |
153 delete CurrentState; |
|
154 TRACE_FUNC_EXIT |
|
155 } |
|
156 |
153 |
157 // ----------------------------------------------------------------------------- |
154 // ----------------------------------------------------------------------------- |
158 // CBTSAController::ResetRemoteCache |
155 // CBTSAController::ResetRemoteCache |
159 // ----------------------------------------------------------------------------- |
156 // ----------------------------------------------------------------------------- |
160 // |
157 // |