summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2012-09-14 17:29:12 -0700
committerDaniel Sandler <dsandler@android.com>2012-09-14 17:29:21 -0700
commit8dd9206abbca6d143e3874abf46eca67f5340b31 (patch)
tree4e12679c4fe33bd5632913f2881a57a82c9b5589
parent74a550fac7f30463c368bc01969a4fa57ac61791 (diff)
downloadframeworks_base-8dd9206abbca6d143e3874abf46eca67f5340b31.zip
frameworks_base-8dd9206abbca6d143e3874abf46eca67f5340b31.tar.gz
frameworks_base-8dd9206abbca6d143e3874abf46eca67f5340b31.tar.bz2
Fix NPE in rotation lock QS.
Bug: 7172228 Change-Id: I3ac35e18fe7ce5af13ee4c54dabae80df696c819
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
index 031504f..f239110 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
@@ -399,7 +399,11 @@ class QuickSettingsModel implements BluetoothStateChangeCallback,
mRotationLockState.label = locked
? mContext.getString(R.string.quick_settings_rotation_locked_label)
: mContext.getString(R.string.quick_settings_rotation_unlocked_label);
- mRotationLockCallback.refreshView(mRotationLockTile, mRotationLockState);
+
+ // may be called before addRotationLockTile due to RotationPolicyListener in QuickSettings
+ if (mRotationLockTile != null && mRotationLockCallback != null) {
+ mRotationLockCallback.refreshView(mRotationLockTile, mRotationLockState);
+ }
}
} \ No newline at end of file