if (mode == ORIENTATION_AUTOMATIC)
{
+ // device : 180 degree
+ // return the previous orientation status
+
+ _ControlManager* pCore = _ControlManager::GetInstance();
+ if (pCore)
+ {
+ _ControlRotation controlRotation = pCore->GetScreenRotation();
+ if (controlRotation == _CONTROL_ROTATION_180)
+ {
+ OrientationStatus prevOrientationStatus = ORIENTATION_STATUS_NONE;
+
+ _ControlRotation prevRotation = pCore->GetOrientationStatus();
+ switch (prevRotation)
+ {
+ case _CONTROL_ROTATION_0:
+ // fall through
+ case _CONTROL_ROTATION_180:
+ prevOrientationStatus = ORIENTATION_STATUS_PORTRAIT;
+ break;
+ case _CONTROL_ROTATION_90:
+ prevOrientationStatus = ORIENTATION_STATUS_LANDSCAPE_REVERSE;
+ break;
+ case _CONTROL_ROTATION_270:
+ prevOrientationStatus = ORIENTATION_STATUS_LANDSCAPE;
+ break;
+ default:
+ break;
+ }
+
+ return prevOrientationStatus;
+ }
+ }
+
return ::Convert(screenRotation, false);
}