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

Commit e0f085d4 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #5433192 and maybe #5433192

5433192: Factory reset device: compatibility screen is the first...
...screen before setup wizard

Don't show compat mode dialog if compat mode is unknown (which happens
early in boot before an activity is shown for example).  Also make sure
to update status any time the current focus app token changes, so we
correctly update every time switching apps.

5651152 [Stingray] change zoom/strech setting icon won't go away

This is probably also fixed by updating when the app token changes.

Change-Id: Ibe9bd6277166230d5d96689741b78325ea099d57
parent 2f504d9e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -49,6 +49,10 @@ public class CompatModeButton extends ImageView {

    public void refresh() {
        int mode = mAM.getFrontActivityScreenCompatMode();
        if (mode == ActivityManager.COMPAT_MODE_UNKNOWN) {
            // If in an unknown state, don't change.
            return;
        }
        final boolean vis = (mode != ActivityManager.COMPAT_MODE_NEVER
                          && mode != ActivityManager.COMPAT_MODE_ALWAYS);
        if (DEBUG) Slog.d(TAG, "compat mode is " + mode + "; icon will " + (vis ? "show" : "hide"));
+1 −0
Original line number Diff line number Diff line
@@ -534,6 +534,7 @@ public class TabletStatusBar extends StatusBar implements

        mCompatModeButton = (CompatModeButton) sb.findViewById(R.id.compatModeButton);
        mCompatModeButton.setOnClickListener(mOnClickListener);
        mCompatModeButton.setVisibility(View.GONE);

        // for redirecting errant bar taps to the IME
        mFakeSpaceBar = sb.findViewById(R.id.fake_space_bar);
+5 −2
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@ import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.BatteryManager;
import android.os.Binder;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
@@ -72,6 +71,7 @@ import android.util.Slog;
import android.util.SparseArray;
import android.view.Gravity;
import android.view.HapticFeedbackConstants;
import android.view.IApplicationToken;
import android.view.IWindowManager;
import android.view.InputChannel;
import android.view.InputDevice;
@@ -343,6 +343,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {

    // The last window we were told about in focusChanged.
    WindowState mFocusedWindow;
    IApplicationToken mFocusedApp;

    private final InputHandler mPointerLocationInputHandler = new BaseInputHandler() {
        @Override
@@ -3813,11 +3814,13 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        int diff = visibility ^ mLastSystemUiFlags;
        final boolean needsMenu = (mFocusedWindow.getAttrs().flags
                & WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY) != 0;
        if (diff == 0 && mLastFocusNeedsMenu == needsMenu) {
        if (diff == 0 && mLastFocusNeedsMenu == needsMenu
                && mFocusedApp == mFocusedWindow.getAppToken()) {
            return 0;
        }
        mLastSystemUiFlags = visibility;
        mLastFocusNeedsMenu = needsMenu;
        mFocusedApp = mFocusedWindow.getAppToken();
        mHandler.post(new Runnable() {
                public void run() {
                    if (mStatusBarService == null) {