Review comments addressed in audiorecorder
authorrahul varna <rahul.varna@samsung.com>
Tue, 23 Apr 2013 05:02:13 +0000 (14:02 +0900)
committerrahul varna <rahul.varna@samsung.com>
Tue, 23 Apr 2013 05:02:13 +0000 (14:02 +0900)
Signed-off-by: rahul varna <rahul.varna@samsung.com>
project/src/Recorder/AudioRecorderForm.cpp
project/src/Recorder/VideoRecorderForm.cpp

index ae89631..821f9a9 100644 (file)
@@ -787,6 +787,23 @@ AudioRecorderForm::Activate(void* pActivateParam)
 
        FreeResources();
 
+       Tizen::System::BatteryLevel batteryLevel;
+       Tizen::System::Battery::GetCurrentLevel(batteryLevel);
+
+       if (batteryLevel == BATTERY_CRITICAL || batteryLevel == BATTERY_EMPTY || batteryLevel == BATTERY_LOW)
+       {
+               bool isCharging = false;
+               Tizen::System::RuntimeInfo::GetValue(String(L"IsCharging"), isCharging);
+               if (isCharging == false)
+               {
+                       //Free the resource and go back to previous form
+                       FreeResources();
+                       Deactivate();
+
+                       return E_SUCCESS;
+               }
+       }
+
        if (__pProgress != null)
        {
                __pProgress->SetValue(0);
index a4f245a..cc367cf 100644 (file)
@@ -1226,9 +1226,9 @@ VideoRecorderForm::Activate(void* pActivateParam)
                if (isCharging == false)
                {
                        MessageBox msgBox;
-                       int reslut_a;
+                       int outResult;
                        msgBox.Construct("Info", "Please Charge the Battery to use the recorder", MSGBOX_STYLE_OK, MESSAGE_BOX_TIMEOUT);
-                       msgBox.ShowAndWait(reslut_a);
+                       msgBox.ShowAndWait(outResult);
                        __pProgress->SetValue(0);
                        __pProgress->Draw();
                        __pElapsedTimeLable->SetText(__startTime);