Fix crash in ChooseLockPassworkFragment.

Check for null activity when the handler receives messages to ensure
that the fragment is still attached to the activity.

Fixes: 31034901

Test: Manual - Manually try to update password, verify it works. Run
monkey test on settings package and verify no crash seen.

Change-Id: I9753729ee64458fa1bc25d78abc946d2563a5067
This commit is contained in:
Doris Ling
2016-08-24 17:17:52 -07:00
parent 0948ce0cdb
commit f958f2e14e

View File

@@ -899,6 +899,9 @@ public class ChooseLockPassword extends SettingsActivity {
@Override
public void handleMessage(Message msg) {
if (getActivity() == null) {
return;
}
if (msg.what == ON_TEXT_CHANGED) {
updateUi();
}