[SystemInfo][DeviceOrientation] Remove 'Unknown' in status to fix TCT failure
authorfyraimar <fyraimar@gmail.com>
Fri, 27 Sep 2013 09:27:41 +0000 (17:27 +0800)
committerfyraimar <fyraimar@gmail.com>
Fri, 27 Sep 2013 09:30:26 +0000 (17:30 +0800)
system_info/system_info_device_orientation.h
system_info/system_info_device_orientation_mobile.cc

index 274a202..d4fc90e 100644 (file)
@@ -21,13 +21,12 @@ enum SystemInfoDeviceOrientationStatus {
   PORTRAIT_SECONDARY,
   LANDSCAPE_PRIMARY,
   LANDSCAPE_SECONDARY,
-  UNKNOWN
 };
 
 class SysInfoDeviceOrientation {
  public:
   explicit SysInfoDeviceOrientation(ContextAPI* api)
-    :status_(UNKNOWN),
+    :status_(PORTRAIT_PRIMARY),
      sensorHandle_(0),
      isRegister_(false) {
     api_ = api;
index 3aae06b..b093201 100644 (file)
@@ -23,7 +23,7 @@ void SysInfoDeviceOrientation::SetStatus() {
 
   int r = sf_check_rotation(&event);
   if (r < 0) {
-    status_ = UNKNOWN;
+    status_ = PORTRAIT_PRIMARY;
     return;
   }
 
@@ -78,14 +78,14 @@ std::string SysInfoDeviceOrientation::ToOrientationStatusString(
       ret = "LANDSCAPE_SECONDARY";
       break;
     default:
-      ret = "UNKNOWN";
+      ret = "PORTRAIT_PRIMARY";
   }
   return ret;
 }
 
 enum SystemInfoDeviceOrientationStatus
 SysInfoDeviceOrientation::EventToStatus(int event_data) {
-  enum SystemInfoDeviceOrientationStatus m = UNKNOWN;
+  enum SystemInfoDeviceOrientationStatus m = PORTRAIT_PRIMARY;
   switch (event_data) {
     case(ROTATION_EVENT_0):
       m = PORTRAIT_PRIMARY;
@@ -100,7 +100,7 @@ SysInfoDeviceOrientation::EventToStatus(int event_data) {
       m = LANDSCAPE_PRIMARY;
       break;
     default:
-      m = UNKNOWN;
+      m = PORTRAIT_PRIMARY;
   }
 
   return m;