Fix NPE
Bug: 5120674 Change-Id: Iedfd7af33a96b68d83d9a844f61ac40b9523ecdb
This commit is contained in:
parent
3234123fba
commit
94ac3d760b
1 changed files with 4 additions and 1 deletions
|
@ -187,13 +187,16 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save() {
|
public void save() {
|
||||||
|
if (mCurrentId == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mIsAlphabetMode = isAlphabetMode();
|
mIsAlphabetMode = isAlphabetMode();
|
||||||
if (mIsAlphabetMode) {
|
if (mIsAlphabetMode) {
|
||||||
mIsShiftLocked = isShiftLocked();
|
mIsShiftLocked = isShiftLocked();
|
||||||
mIsShifted = !mIsShiftLocked && isShiftedOrShiftLocked();
|
mIsShifted = !mIsShiftLocked && isShiftedOrShiftLocked();
|
||||||
} else {
|
} else {
|
||||||
mIsShiftLocked = false;
|
mIsShiftLocked = false;
|
||||||
mIsShifted = mSymbolsShiftedKeyboardId.equals(mCurrentId);
|
mIsShifted = mCurrentId.equals(mSymbolsShiftedKeyboardId);
|
||||||
}
|
}
|
||||||
mIsValid = true;
|
mIsValid = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue