언어 설정

Menu
Sites
Language
Auto rotation ON or OFF state.

Hi,

How can 3rd party apps get the state of Auto rotation from the quickpanel.

Regards,

Anand

Responses

3 댓글
Mehedi Alamgir

The following code will provide you Auto Rotation state of your device

   bool statusCode;
   int ret;

   ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED, &statusCode);
   if (ret != RUNTIME_INFO_ERROR_NONE)
   {
      // Error Occured
      
   }
   dlog_print(DLOG_INFO, LOG_TAG, "Auto-Rotation: %s", statusCode ? "Enabled" : "Disabled")

if the value of statusCode is 0 then Auto Rotation is disabled and if the value of statusCode is 1 then Auto Rotation is enable.

Hope above code will help you.

If you find my answer is helpful for you then please mark it as BEST ANSWER so that other may find it easier in the future.

Mehedi Alamgir

Use following header file for above code

#include<stdbool.h>
#include<runtime_info>
Anand Rudrakshi

I did it using system_settings APIs.

int 

system_settings_get_value_bool (system_settings_key_e key, bool *value)

 

key = SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO 

As i also needed call back for this key change event.

Thanks anyway!