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

Commit a625b38c authored by Mike Lockwood's avatar Mike Lockwood
Browse files

PowerManagerService: Fix keyboard backlight support:



Turn off keyboard backlight immediately when keyboard is closed.
Changing keyboard visibility state signals user activity except in the case
where the keyboard is closed and the screen is already off.

Fixes bugs b/1351141 and b/1319625

Change-Id: If4bf2c1dd8e0c2bc08196e443b6103a6041f27e1
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent 91e2d865
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -1848,7 +1848,17 @@ class PowerManagerService extends IPowerManager.Stub
    }
    
    public void setKeyboardVisibility(boolean visible) {
        synchronized (mLocks) {
            if (mSpew) {
                Log.d(TAG, "setKeyboardVisibility: " + visible);
            }
            mKeyboardVisible = visible;
            // don't signal user activity when closing keyboard if the screen is off.
            // otherwise, we want to make sure the backlights are adjusted.
            if (visible || (mPowerState & SCREEN_ON_BIT) != 0) {
                userActivity(SystemClock.uptimeMillis(), false, BUTTON_EVENT, true);
            }
        }
    }

    /**