Fix NullPointerException in SmartAutoRotateCameraStateController

Test: none

Bug: 184844470
Change-Id: I9eca78b11ff8a70dc7c026d7ef77e0b08db8ffbe
This commit is contained in:
Abel Tesfaye
2021-04-12 19:29:06 +00:00
parent 54e74cae5f
commit 0f402e0cae

View File

@@ -44,7 +44,9 @@ public class SmartAutoRotateCameraStateController extends BasePreferenceControll
super(context, key);
mPrivacyManager = SensorPrivacyManager.getInstance(context);
mPrivacyManager.addSensorPrivacyListener(CAMERA, (sensor, enabled) -> {
if (mPreference != null) {
mPreference.setVisible(enabled);
}
updateState(mPreference);
});
}