{
AppControlProviderManager* pProviderMgr = AppControlProviderManager::GetInstance();
pProviderMgr->SetAppControlProviderEventListener(this);
+ PowerManager::AddScreenEventListener(*this);
return true;
}
// TODO:
// Deallocate resources allocated by this App for termination.
// The App's permanent data and context can be saved via appRegistry.
+ PowerManager::RemoveScreenEventListener(*this);
return true;
}
void
CallApp::OnScreenOff(void)
{
- // TODO:
- // Unless there is a strong reason to do otherwise, release resources (such as 3D, media, and sensors) to allow the device
- // to enter the sleep mode to save the battery.
- // Invoking a lengthy asynchronous method within this listener method can be risky, because it is not guaranteed to invoke a
- // callback before the device enters the sleep mode.
- // Similarly, do not perform lengthy operations in this listener method. Any operation must be a quick one.
+ AppLogDebug("Enter");
+ IEnumerator* pEnum = __listenerList.GetEnumeratorN();
+ while (pEnum->MoveNext() == E_SUCCESS)
+ {
+ IAppStateChangeListener* pInterface = static_cast<IAppStateChangeListener*>(pEnum->GetCurrent());
+ if (pInterface == null)
+ {
+ delete pEnum;
+
+ return;
+ }
+ pInterface->OnScreenOff();
+ }
+ delete pEnum;
+
}
SceneId
Terminate();
return;
}
+ else
+ {
+ //invalid phone number.always return, but App will come to foreground
+ //and show current screen, if any calls is present.
+ return;
+ }
}
//call type
pKey = new (std::nothrow) String(PARAM_CALL_TYPE);
CallApp::SetTopMostWindow(bool bTopMost)
{
AppLogDebug("bTopMost = %d",bTopMost);
- result res = E_FAILURE;
//ToDO: Need to see if there is better way to handle
//this case
if(bTopMost == true)
{
GetAppFrame()->GetFrame()->SetZOrderGroup(WINDOW_Z_ORDER_GROUP_HIGHEST);
- if(PowerManager::IsScreenOn() == false)
- {
- AppLogDebug("TurnScreenOn");
- res = PowerManager::TurnScreenOn();
- AppLogDebug("TurnScreenOn %d",res);
- }
AppManager::GetInstance()->AddActiveAppEventListener(*this);
}
PowerManager::KeepScreenOnState(false);
AppManager::GetInstance()->RemoveActiveAppEventListener(*this);
}
- //Unlock the phone if its locked
-/* if(LockManager::GetInstance()->IsLocked())
- {
- AppLogDebug("Phone Locked");
- LockManager::GetInstance()->Unlock();
- }*/
+
}
void
CallApp::OnActiveAppChanged(const String& appId)
{
+ result res = E_FAILURE;
AppLogDebug("Enter %ls",appId.GetPointer());
if(GetAppId().Equals(appId) == true)
{
+ if(PowerManager::IsScreenOn() == false)
+ {
+ AppLogDebug("TurnScreenOn");
+ res = PowerManager::TurnScreenOn();
+ AppLogDebug("TurnScreenOn %d",res);
+ }
result res = PowerManager::KeepScreenOnState(true,false);
AppLogDebug("KeepScreenOnState %d",res);