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

Commit 51625184 authored by Mike Digman's avatar Mike Digman Committed by Android (Google) Code Review
Browse files

Merge "Add rotation logs to help debug bug reports" into pi-dev

parents b96b6bbd 3e33da67
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);