sensord: store unknown rotation event when auto_rotation sensor starts 10/74010/1 accepted/tizen/common/20160610.182644 accepted/tizen/ivi/20160611.084529 accepted/tizen/mobile/20160611.084346 accepted/tizen/tv/20160611.084432 accepted/tizen/wearable/20160611.084456 submit/tizen/20160610.104308
authorkibak.yoon <kibak.yoon@samsung.com>
Wed, 8 Jun 2016 03:45:22 +0000 (12:45 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Fri, 10 Jun 2016 10:36:40 +0000 (03:36 -0700)
- when sensor starts, it would be better to store unknown rotation event
  for getting auto_rotation sensor data.

Change-Id: I68e25ec9460b7959b200185ef674adc2293a3b55
Signed-off-by: kibak.yoon <kibak.yoon@samsung.com>
(cherry picked from commit 6c74491e0abe56efac3f217ddcd34323cc135272)

src/sensor/auto_rotation/auto_rotation_sensor.cpp
src/server/sensor_base.cpp
src/server/sensor_base.h

index b3f0784..717bf1d 100644 (file)
@@ -196,8 +196,11 @@ bool auto_rotation_sensor::set_wakeup(int wakeup)
 
 bool auto_rotation_sensor::on_start(void)
 {
+       int length;
        m_rotation = AUTO_ROTATION_DEGREE_UNKNOWN;
 
+       get_data(&m_last_data, &length);
+
        m_alg->start();
 
        m_accel_sensor->add_interval((intptr_t)this , m_interval, true);
index dcc6623..7414782 100644 (file)
@@ -31,11 +31,11 @@ using std::make_pair;
 using std::vector;
 
 sensor_base::sensor_base()
-: m_id(SENSOR_ID_INVALID)
+: m_last_data(NULL)
+, m_id(SENSOR_ID_INVALID)
 , m_permission(SENSOR_PERMISSION_STANDARD)
 , m_started(false)
 , m_client(0)
-, m_last_data(NULL)
 {
 }
 
index e5e07c7..5ad476d 100644 (file)
@@ -77,6 +77,8 @@ public:
        int get_permission(void);
 
 protected:
+       sensor_data_t *m_last_data;
+
        void set_permission(int permission);
 
        unsigned long long get_timestamp(void);
@@ -93,7 +95,6 @@ private:
        unsigned int m_client;
        cmutex m_client_mutex;
 
-       sensor_data_t *m_last_data;
        cmutex m_data_cache_mutex;
 
        virtual int set_attribute(int32_t attribute, int32_t value);