Fix NPE in Display Settings.

Handle occasional race in delivering change notifications.

Bug: 6012882
Change-Id: Ic9eff72920ff65a2c8ab85f4af59ba438cd8f99f
This commit is contained in:
Amith Yamasani
2012-05-14 17:46:23 -07:00
parent e5050b1be7
commit 980a6c3c4b

View File

@@ -236,6 +236,7 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
}
private void updateAccelerometerRotationCheckbox() {
if (getActivity() == null) return;
mAccelerometer.setChecked(Settings.System.getInt(
getContentResolver(),
Settings.System.ACCELEROMETER_ROTATION, 0) != 0);