Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2423d61 authored by Yorke Lee's avatar Yorke Lee Committed by Android (Google) Code Review
Browse files

Merge "Disable OrientationEventListener when activity backgrounded" into mnc-dev

parents 2d888276 d4290a3f
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -233,13 +233,6 @@ public class InCallActivity extends Activity implements FragmentDisplayManager {
            }
        };

        if (mOrientationEventListener.canDetectOrientation()) {
            Log.v(this, "Orientation detection enabled.");
            mOrientationEventListener.enable();
        } else {
            Log.v(this, "Orientation detection disabled.");
            mOrientationEventListener.disable();
        }
        Log.d(this, "onCreate(): exit");
    }

@@ -259,6 +252,14 @@ public class InCallActivity extends Activity implements FragmentDisplayManager {
        Log.d(this, "onStart()...");
        super.onStart();

        if (mOrientationEventListener.canDetectOrientation()) {
            Log.v(this, "Orientation detection enabled.");
            mOrientationEventListener.enable();
        } else {
            Log.v(this, "Orientation detection disabled.");
            mOrientationEventListener.disable();
        }

        // setting activity should be last thing in setup process
        InCallPresenter.getInstance().setActivity(this);

@@ -314,9 +315,9 @@ public class InCallActivity extends Activity implements FragmentDisplayManager {
    @Override
    protected void onStop() {
        Log.d(this, "onStop()...");

        InCallPresenter.getInstance().updateIsChangingConfigurations();
        InCallPresenter.getInstance().onActivityStopped();
        mOrientationEventListener.disable();
        super.onStop();
    }