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

Commit b390e65b authored by Charlie Boutier's avatar Charlie Boutier
Browse files

Pandora: Add start padding on the passkey

This is needed to handle 4 digits passkey.

Test: avatar run --mobly-std-log --include-filter 'ExampleTest#test_le_pairing(1,1,0)'
Bug: 274015211
Change-Id: Ibc3ad75079d12d49b41abd185f1acf0c7fdd0238
parent d90bc4f9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -235,7 +235,7 @@ class Security(private val context: Context) : SecurityImplBase(), Closeable {
          when (answer.answerCase!!) {
            PairingEventAnswer.AnswerCase.CONFIRM -> device.setPairingConfirmation(true)
            PairingEventAnswer.AnswerCase.PASSKEY ->
              device.setPin(answer.passkey.toString().toByteArray())
              device.setPin(answer.passkey.toString().padStart(6, '0'))
            PairingEventAnswer.AnswerCase.PIN -> device.setPin(answer.pin.toByteArray())
            PairingEventAnswer.AnswerCase.ANSWER_NOT_SET -> error("unexpected pairing answer type")
          }