Fix for 2137900: Be more conservative about poking the wakelock.

Updated after review: white space, check for null pattern listener.
This commit is contained in:
Jim Miller
2009-09-29 14:16:21 -07:00
parent b80fbd4479
commit 41e8dc02cd

View File

@@ -212,6 +212,12 @@ public class LockPatternView extends View {
*/
void onPatternCleared();
/**
* The user extended the pattern currently being drawn by one cell.
* @param pattern The pattern with newly added cell.
*/
void onPatternCellAdded(List<Cell> pattern);
/**
* A pattern was detected from the user.
* @param pattern The pattern.
@@ -447,6 +453,9 @@ public class LockPatternView extends View {
private void addCellToPattern(Cell newCell) {
mPatternDrawLookup[newCell.getRow()][newCell.getColumn()] = true;
mPattern.add(newCell);
if (mOnPatternListener != null) {
mOnPatternListener.onPatternCellAdded(mPattern);
}
}
// helper method to find which cell a point maps to