Set is_local_initialized before calling BTA_DmBond() in btif
If a peer doesn't support secure connections, BT makes a shortcut to
prefetch the pin. If the connection is initialized by the user, the
pin will default to 0000, which works almost all the time.
However, the variable that stores "is initialized by user" is set after
the shortcut, therefore it's possible to be asked for pin even though
the connection is user initialized.
Bug: 360065704
Test: m -j
Test: Verify with the steps given below with Apple magic mouse.
(1) Spy for the Remote Name Req HCI event (e.g. using btmon).
(2) Put mouse in pairing more and initiate pairing.
(3) Immediately when event (1) is captured, power off the mouse.
(4) Wait 5 seconds (until HCI connect request times out).
(5) Power on mouse and pair again
(6) Verify no pin code entry is asked, mouse is usable.
Flag: EXEMPT, trivial bugfix
Change-Id: I3327736209d7168c47665a852ccba7984186a9c0
Loading
Please register or sign in to comment