Skip to content
Commit 6061ddc2 authored by Bill Lin's avatar Bill Lin
Browse files

Check shortcut enabled before auto trun on OHM

When device (factory)boot, controller regsiter settings
'one_handed_mode_activated' will receive callback, and
the shortcut do not enabled by default, the flow will
go to auto enable one-handed mode feature and leading
unexpedted UX(disabled by default) and testing issue.

Solution:
- Add additional check for shortcut enabled when
  onActivatedActionChanged() callback.
- When setting is pull screen, notify shortcut
  one_handed_mode_activated to reset and align current
  mState when function enabled.

Note:
The setting provider one_handed_mode_activated could set
2 different values when shortcut button pressed
 - "0" mapping to pull screen STATE_NONE
 - "1" mapping to pull screen STATE_ACTIVE
Since show notification do not have state, whenever
onChange callback, we trigger expand notification.

Test: atest WMShellUnitTests
Test: manual factory reset | reboot check Log should show \
      "Shortcut not enabled, skip onActivatedActionChanged()".
Test: manual disable both OHM & shortcut toggle in settings \
      '# adb shell settings --user 0 put secure \
      one_handed_mode_activated 1'
      should not auto enable OHM main toggle.
Bug: 191736174
Bug: 191831415
Bug: 191950195
Fixes: 191812697
Change-Id: Ib9d66fbbcc7e6a52a37bb47efebf90c9d2644508
parent 3245ab13
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment