Skip to content

Commit

Permalink
Forget orientation state when sensor is stopped / sensord is not avai…
Browse files Browse the repository at this point in the history
…lable

Allows logic elsewhere in mce to detect orientation sensor downtime.
  • Loading branch information
spiiroin committed Apr 1, 2014
1 parent e03d002 commit 92e0e45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mce-sensorfw.c
Expand Up @@ -1517,7 +1517,7 @@ static bool orient_have = false;
static void (*orient_notify_cb)(int state) = 0;

/** Orientation state to report when sensord is not available */
#define ORIENT_STATE_WHEN_SENSORD_IS_DOWN MCE_ORIENTATION_FACE_UP
#define ORIENT_STATE_WHEN_SENSORD_IS_DOWN MCE_ORIENTATION_UNDEFINED

/** Wrapper for orient_notify_cb hook
*/
Expand Down Expand Up @@ -1814,6 +1814,7 @@ static void mce_sensorfw_orient_stop_sensor(void)
}

orient_have = false;
orient_notify(ORIENT_STATE_WHEN_SENSORD_IS_DOWN, true);
EXIT:
return;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/display.c
Expand Up @@ -3909,8 +3909,8 @@ static void mdy_display_state_enter_post(void)
break;

default:
mce_sensorfw_orient_set_notify(0);
mce_sensorfw_orient_disable();
mce_sensorfw_orient_set_notify(0);
break;
}

Expand Down

0 comments on commit 92e0e45

Please sign in to comment.