extern const wchar_t* IDC_LABEL_VIDEO_TITLE;
extern const wchar_t* IDC_SLIDER;
+extern const wchar_t* DEVICE_STORAGE_CARD_MOUNTED;
+extern const wchar_t* DEVICE_STORAGE_CARD_UNMOUNTED;
+
#endif // _VP_TYPES_H_
: public Tizen::App::UiApp
, public Tizen::App::IAppControlProviderEventListener
, public Tizen::System::IChargingEventListener
+ , public Tizen::System::IDeviceEventListener
, public Tizen::System::ISettingEventListener
{
public:
virtual void OnForeground(void);
+ virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String& state);
+
const Tizen::Base::String* GetArgument(const Tizen::Base::String& key) const;
private:
const wchar_t* IDC_LABEL_FULLTIME = L"IDC_LABEL_FULLTIME";
const wchar_t* IDC_LABEL_VIDEO_TITLE = L"IDC_LABEL_VIDEO_TITLE";
const wchar_t* IDC_SLIDER = L"IDC_SLIDER";
+
+const wchar_t* DEVICE_STORAGE_CARD_MOUNTED = L"Mounted";
+const wchar_t* DEVICE_STORAGE_CARD_UNMOUNTED = L"Unmounted";
PowerManager::SetChargingEventListener(*this);
+ DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+
return true;
}
PowerManager::RemoveChargingEventListener(*this);
+ DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
+
delete __pArguments;
__pArguments = null;
if (key.CompareTo(PARAM_LANGUAGE) == 0 || key.CompareTo(PARAM_COUNTRY) == 0)
{
UiApp* pApp = UiApp::GetInstance();
+ TryReturnVoid(pApp != null, "pApp is null");
pApp->Terminate();
}
}
pMainFrame->Invalidate(true);
}
}
+
+void
+VideoPlayerApp::OnDeviceStateChanged(DeviceType deviceType, const Tizen::Base::String& state)
+{
+ AppLogDebug("OnDeviceStateChanged");
+
+ String extStoragePath = Environment::GetExternalStoragePath();
+ String uriData = GetUriData();
+
+ if (deviceType == DEVICE_TYPE_STORAGE_CARD && state == DEVICE_STORAGE_CARD_UNMOUNTED
+ && uriData.StartsWith(extStoragePath, 0) == true)
+ {
+ UiApp* pApp = UiApp::GetInstance();
+ TryReturnVoid(pApp != null, "pApp is null");
+ pApp->Terminate();
+ }
+}