Handled pre-resume scenario of watch application 94/166294/2
authorSinJae Lee <sinjae4b.lee@samsung.com>
Mon, 8 Jan 2018 06:11:29 +0000 (15:11 +0900)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 9 Jan 2018 15:45:53 +0000 (15:45 +0000)
[Issue#] N/A
[Request] N/A
[Occurrence Version] N/A

[Problem] According to platform policy, all ui engines should forcely update in OnTimeTick during pause state
[Cause & Measure] In LCD on case, up-to-date screen should be shown.

[Developer] SinJae Lee

Change-Id: Ifccfc0b1f8119e28c2a4830361d29a0e5ddaf0ec

adaptors/wearable/watch-application-impl.cpp
adaptors/wearable/watch-application-impl.h [changed mode: 0644->0755]

index 7bad7fe..dd5b004 100755 (executable)
@@ -46,11 +46,47 @@ WatchApplication::~WatchApplication()
 {
 }
 
+void WatchApplication::OnInit()
+{
+  Application::OnInit();
+
+  Dali::Adaptor::Get().SetRenderRefreshRate( 2 ); // make 30 fps for watch applications
+
+  mState = INITIALIZED;
+}
+
+void WatchApplication::OnTerminate()
+{
+  Application::OnTerminate();
+
+  mState = TERMINATED;
+}
+
+void WatchApplication::OnResume()
+{
+  Application::OnResume();
+
+  mState = RESUMED;
+}
+
+void WatchApplication::OnPause()
+{
+  Application::OnPause();
+
+  mState = PAUSED;
+}
+
 void WatchApplication::OnTimeTick(WatchTime& time)
 {
   Dali::WatchApplication watch(this);
   mTickSignal.Emit( watch, time );
 
+  if(mState == PAUSED)
+  {
+    // This is a pre-resume scenario. All rendering engine of tizen SHOULD forcely update once at this time.
+    Internal::Adaptor::Adaptor::GetImplementation( GetAdaptor() ).RequestUpdateOnce();
+  }
+
   // A watch application will queue messages to update the UI in the signal emitted above
   // Process these immediately to avoid a blinking issue where the old time is briefly visible
   CoreEventInterface& eventInterface = Internal::Adaptor::Adaptor::GetImplementation( GetAdaptor() );
old mode 100644 (file)
new mode 100755 (executable)
index 6617805..0c9b723
@@ -35,6 +35,14 @@ namespace Adaptor
 class WatchApplication;
 typedef IntrusivePtr<WatchApplication> WatchApplicationPtr;
 
+enum WatchApplicationState
+{
+  INITIALIZED,
+  PAUSED,
+  RESUMED = INITIALIZED,
+  TERMINATED
+};
+
 /**
  * Implementation of the WatchApplication class.
  */
@@ -68,6 +76,26 @@ public:
   virtual ~WatchApplication();
 
   /**
+   * Called when the framework is initialised.
+   */
+  virtual void OnInit();
+
+  /**
+   * Called when the framework is terminated.
+   */
+  virtual void OnTerminate();
+
+  /**
+   * Called when the framework is paused.
+   */
+  virtual void OnPause();
+
+  /**
+   * Called when the framework resumes from a paused state.
+   */
+  virtual void OnResume();
+
+  /**
    * Called every second
    */
   void OnTimeTick(WatchTime& time);
@@ -95,7 +123,10 @@ public:
   // Signals
   WatchTimeSignal                        mTickSignal;
   WatchTimeSignal                        mAmbientTickSignal;
-  WatchBoolSignal                      mAmbientChangeSignal;
+  WatchBoolSignal                        mAmbientChangeSignal;
+
+private:
+  WatchApplicationState                  mState;
 };
 
 inline WatchApplication& GetImplementation(Dali::WatchApplication& watch)