Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 88be9696 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "charger: support screen rotation" am: e72c5c76 am: 07f18040

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1867821

Change-Id: I8147d1a1cc222c9495151583b62563cdcf8e30f6
parents 93265a29 07f18040
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -99,6 +99,15 @@ void HealthdDraw::blank_screen(bool blank, int drm) {
    gr_fb_blank(blank, drm);
}

/* support screen rotation for foldable phone */
void HealthdDraw::rotate_screen(int drm) {
    if (!graphics_available) return;
    if (drm == 0)
        gr_rotate(GRRotation::RIGHT /* landscape mode */);
    else
        gr_rotate(GRRotation::NONE /* Portrait mode */);
}

void HealthdDraw::clear_screen(void) {
    if (!graphics_available) return;
    gr_color(0, 0, 0, 255);
+3 −0
Original line number Diff line number Diff line
@@ -35,6 +35,9 @@ class HealthdDraw {
  // Blanks screen if true, unblanks if false.
  virtual void blank_screen(bool blank, int drm);

  // Rotate screen.
  virtual void rotate_screen(int drm);

  static std::unique_ptr<HealthdDraw> Create(animation *anim);

 protected:
+1 −0
Original line number Diff line number Diff line
@@ -352,6 +352,7 @@ void Charger::UpdateScreenState(int64_t now) {
    if (screen_switch_ == SCREEN_SWITCH_ENABLE) {
        healthd_draw_->blank_screen(true, 0 /* drm */);
        healthd_draw_->blank_screen(true, 1 /* drm */);
        healthd_draw_->rotate_screen(static_cast<int>(drm_));
        screen_blanked_ = true;
        screen_switch_ = SCREEN_SWITCH_DISABLE;
    }