Skip to content

Commit 8dd9206

Browse files
committed
Fix NPE in rotation lock QS.
Bug: 7172228 Change-Id: I3ac35e18fe7ce5af13ee4c54dabae80df696c819
1 parent 74a550f commit 8dd9206

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,11 @@ void onRotationLockChanged() {
399399
mRotationLockState.label = locked
400400
? mContext.getString(R.string.quick_settings_rotation_locked_label)
401401
: mContext.getString(R.string.quick_settings_rotation_unlocked_label);
402-
mRotationLockCallback.refreshView(mRotationLockTile, mRotationLockState);
402+
403+
// may be called before addRotationLockTile due to RotationPolicyListener in QuickSettings
404+
if (mRotationLockTile != null && mRotationLockCallback != null) {
405+
mRotationLockCallback.refreshView(mRotationLockTile, mRotationLockState);
406+
}
403407
}
404408

405409
}

0 commit comments

Comments
 (0)