Prevent context leak through SystemSensorManager (#245)

pull/248/head
MatFl 6 years ago committed by Mattia Iavarone
parent 819638862f
commit c113933b60
  1. 4
      cameraview/src/main/utils/com/otaliastudios/cameraview/OrientationHelper.java

@ -22,7 +22,7 @@ class OrientationHelper {
OrientationHelper(Context context, @NonNull Callback callback) {
mCallback = callback;
mListener = new OrientationEventListener(context, SensorManager.SENSOR_DELAY_NORMAL) {
mListener = new OrientationEventListener(context.getApplicationContext(), SensorManager.SENSOR_DELAY_NORMAL) {
@Override
public void onOrientationChanged(int orientation) {
@ -72,4 +72,4 @@ class OrientationHelper {
int getDisplayOffset() {
return mDisplayOffset;
}
}
}

Loading…
Cancel
Save