Fix for N_SE-43348
authorAbhismita Ghosh <g.abhismita@samsung.com>
Sat, 29 Jun 2013 05:52:01 +0000 (14:52 +0900)
committerAbhismita Ghosh <g.abhismita@samsung.com>
Sat, 29 Jun 2013 06:04:26 +0000 (15:04 +0900)
Change-Id: Ic888d50bce35321b17eb0e5386c2b8ecbeb3e00e

inc/VpVideoPlayerForm.h
src/VpMainFrame.cpp
src/VpVideoPlayerForm.cpp

index 3e18076..d3d7c4d 100755 (executable)
@@ -55,10 +55,13 @@ public:
        void Initialize(void);
 
        void CancelTimerByFrameDeactivated(void);
-       void ShowControlByFrameActivated(void);
+       void CheckAppLaunchable(void);
 
        result SetActiveAudioRoute(const Tizen::Media::AudioRouteInfo& route);
 
+       void SetFrameActivated(bool frameActivated);
+       bool GetFrameActivated(void) const;
+
        virtual result OnInitializing(void);
        virtual result OnTerminating(void);
 
@@ -190,6 +193,7 @@ private:
        bool __availableAudioRoute[OUTPUT_AUDIO_ROUTE_MAX];
        bool __sliderMoved;
        bool __playingBeforeSlide;
+       bool __frameActivated;
        int __audioRouteMode;
        long __timeToSeek;
        VideoPlayerPresentationModel* __pVideoPlayerPresentationModel;
index 83a4410..fb38cb7 100755 (executable)
@@ -87,7 +87,8 @@ MainFrame::OnFrameActivated(const Frame& source)
                VideoPlayerForm* pForm = static_cast<VideoPlayerForm*>(GetCurrentForm());
                if (pForm != null)
                {
-                       pForm->ShowControlByFrameActivated();
+                       pForm->SetFrameActivated(true);
+                       pForm->CheckAppLaunchable();
                }
 
                PlayerState playState = PLAYER_STATE_ERROR;
index fbb5fab..174e506 100644 (file)
@@ -105,6 +105,7 @@ VideoPlayerForm::VideoPlayerForm(void)
        , __isControlVisibleState(true)
        , __sliderMoved(false)
        , __playingBeforeSlide(false)
+       , __frameActivated(false)
        , __audioRouteMode(0)
        , __timeToSeek(SEEK_TIME_NONE)
        , __pVideoPlayerPresentationModel(null)
@@ -531,9 +532,6 @@ VideoPlayerForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId
 
        TryReturnVoid(__pVideoPlayerPresentationModel != null, "__pVideoPlayerPresentationModel is null");
 
-       CheckCallStatus();
-       CheckLowBatteryStatus();
-
        SetScreenModeButtonImage();
 }
 
@@ -1540,9 +1538,9 @@ VideoPlayerForm::ShowControl(bool setShow)
 }
 
 void
-VideoPlayerForm::ShowControlByFrameActivated(void)
+VideoPlayerForm::CheckAppLaunchable(void)
 {
-       AppLogDebug("ShowControlByFrameActivated");
+       AppLogDebug("CheckAppLaunchable");
 
        CheckCallStatus();
        CheckLowBatteryStatus();
@@ -1561,6 +1559,18 @@ VideoPlayerForm::CancelTimerByFrameDeactivated(void)
 }
 
 void
+VideoPlayerForm::SetFrameActivated(bool frameActivated)
+{
+       __frameActivated = frameActivated;
+}
+
+bool
+VideoPlayerForm::GetFrameActivated(void) const
+{
+       return __frameActivated;
+}
+
+void
 VideoPlayerForm::OnPlayContentChanged(const String& fileName)
 {
        String totalTime;
@@ -2183,9 +2193,11 @@ VideoPlayerForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
                        Battery::GetCurrentLevel(batteryLevel);
                        Battery::IsCharging(isCharging);
 
+                       bool frameActivated = GetFrameActivated();
+
                        if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY)
                        {
-                               if (isCharging == false)
+                               if (isCharging == false && frameActivated == true)
                                {
                                        OnFormBackRequested(*this);
                                }