//From IAppStateChangeListener
virtual void OnForeground(void);
virtual void OnBackground(void){};
+ virtual void OnScreenOff(void){};
private:
// Create the call buttons panel and add to form
virtual void OnForeground(void);
//Called when App goes to background
virtual void OnBackground(void);
+ //Called when screen goes off
+ virtual void OnScreenOff(void){};
//From IOrientationEventListener
virtual void OnOrientationChanged(const Tizen::Ui::Control& source, Tizen::Ui::OrientationStatus orientationStatus);
virtual void OnForeground(void) = 0;
virtual void OnBackground(void) = 0;
+ virtual void OnScreenOff(void) = 0;
};
#endif /* _PHN_STATE_CHANGE_LISTNER_H_ */
//From IAppStateChangeListener
virtual void OnForeground(void);
virtual void OnBackground(void){};
+ virtual void OnScreenOff(void);
+
private:
// Method to fetch person details using phone number.
void ShowPersonDetails(const Tizen::Base::String& phoneNumber, const Tizen::Base::String& contactLblName, const Tizen::Base::String& nameLblName, AppCallInfo* pCallInfo);
{
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
}
void
+IncomingCallForm::OnScreenOff(void)
+{
+ __pCallPresentor->StopAlert();
+}
+
+void
IncomingCallForm::CallDisconnected(void)
{
//check if no call option popup is shown, then remain on incoming call screen.