Settings: fix potential crash when setting new pattern

When setting a pattern that has a different size length than default, or
the currently set pattern, an exception can occur when rotating the
device because the lock pattern utils method assumes a length, which may
not be correct.

Update to use the static version of stringToPattern() which accepts a
length.

Also fix the pattern comparison check. It was comparing two array list
objects to decide whether the pattern was the same, and after a
rotation, the objects would have been reconstructed, and it never would
have accepted the correct pattern.

Ref: CYNGNOS-661

Change-Id: I07aea58638195e9c8b7689b1e8db80694cb1c1db
Signed-off-by: Roman Birg <roman@cyngn.com>
2 files changed