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

Commit 3e33da67 authored by Mike Digman's avatar Mike Digman
Browse files

Add rotation logs to help debug bug reports

Debug logs should be turned off for release

Change-Id: I8d9f1ee1e46d014669def25dd47c3a151545afc6
Fixes: 74961129
Test: manual
parent 50f118a1
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ public class NavigationBarFragment extends Fragment implements Callbacks {

    public static final String TAG = "NavigationBar";
    private static final boolean DEBUG = false;
    private static final boolean DEBUG_ROTATION = true;
    private static final String EXTRA_DISABLE_STATE = "disabled_state";

    private final static int BUTTON_FADE_IN_OUT_DURATION_MS = 100;
@@ -396,6 +397,16 @@ public class NavigationBarFragment extends Fragment implements Callbacks {

    @Override
    public void onRotationProposal(final int rotation, boolean isValid) {
        final int winRotation = mWindowManager.getDefaultDisplay().getRotation();
        if (DEBUG_ROTATION) {
            Log.v(TAG, "onRotationProposal proposedRotation=" + Surface.rotationToString(rotation)
                    + ", winRotation=" + Surface.rotationToString(winRotation)
                    + ", isValid=" + isValid + ", mNavBarWindowState="
                    + StatusBarManager.windowStateToString(mNavigationBarWindowState)
                    + ", isRotateButtonVisible=" + (mNavigationBarView == null ? "null" :
                        mNavigationBarView.isRotateButtonVisible()));
        }

        // This method will be called on rotation suggestion changes even if the proposed rotation
        // is not valid for the top app. Use invalid rotation choices as a signal to remove the
        // rotate button if shown.
@@ -405,7 +416,6 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
        }

        // If window rotation matches suggested rotation, remove any current suggestions
        final int winRotation = mWindowManager.getDefaultDisplay().getRotation();
        if (rotation == winRotation) {
            getView().removeCallbacks(mRemoveRotationProposal);
            setRotateSuggestionButtonState(false);