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

Commit 7f3cf958 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Work around instability of Display.getRotation().

Ensures that the navigation buttons are properly oriented
each time the screen comes on.

Bug: 7086018
Change-Id: Iac6243792a8c64001ff7409108fb892bd470e4c4
parent fef288b0
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -451,6 +451,7 @@ public class PhoneStatusBar extends BaseStatusBar {
        filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
        filter.addAction(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
        filter.addAction(Intent.ACTION_SCREEN_OFF);
        filter.addAction(Intent.ACTION_SCREEN_ON);
        context.registerReceiver(mBroadcastReceiver, filter);

        return mStatusBarView;
@@ -788,11 +789,6 @@ public class PhoneStatusBar extends BaseStatusBar {
        setAreThereNotifications();
    }

    @Override
    protected void onConfigurationChanged(Configuration newConfig) {
        updateShowSearchHoldoff();
    }

    private void updateShowSearchHoldoff() {
        mShowSearchHoldoff = mContext.getResources().getInteger(
            R.integer.config_show_search_delay);
@@ -1804,9 +1800,17 @@ public class PhoneStatusBar extends BaseStatusBar {
                makeExpandedInvisible();
            }
            else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) {
                if (DEBUG) {
                    Slog.v(TAG, "configuration changed: " + mContext.getResources().getConfiguration());
                }
                updateResources();
                repositionNavigationBar();
                updateExpandedViewPos(EXPANDED_LEAVE_ALONE);
                updateShowSearchHoldoff();
            }
            else if (Intent.ACTION_SCREEN_ON.equals(action)) {
                // work around problem where mDisplay.getRotation() is not stable while screen is off (bug 7086018)
                repositionNavigationBar();
            }
        }
    };