Skip to content

Commit e0f085d

Browse files
author
Dianne Hackborn
committed
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
1 parent 2f504d9 commit e0f085d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

packages/SystemUI/src/com/android/systemui/statusbar/policy/CompatModeButton.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public CompatModeButton(Context context, AttributeSet attrs, int defStyle) {
4949

5050
public void refresh() {
5151
int mode = mAM.getFrontActivityScreenCompatMode();
52+
if (mode == ActivityManager.COMPAT_MODE_UNKNOWN) {
53+
// If in an unknown state, don't change.
54+
return;
55+
}
5256
final boolean vis = (mode != ActivityManager.COMPAT_MODE_NEVER
5357
&& mode != ActivityManager.COMPAT_MODE_ALWAYS);
5458
if (DEBUG) Slog.d(TAG, "compat mode is " + mode + "; icon will " + (vis ? "show" : "hide"));

packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ protected View makeStatusBarView() {
534534

535535
mCompatModeButton = (CompatModeButton) sb.findViewById(R.id.compatModeButton);
536536
mCompatModeButton.setOnClickListener(mOnClickListener);
537+
mCompatModeButton.setVisibility(View.GONE);
537538

538539
// for redirecting errant bar taps to the IME
539540
mFakeSpaceBar = sb.findViewById(R.id.fake_space_bar);

policy/src/com/android/internal/policy/impl/PhoneWindowManager.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
import android.graphics.Rect;
4141
import android.graphics.RectF;
4242
import android.os.BatteryManager;
43-
import android.os.Binder;
4443
import android.os.Bundle;
4544
import android.os.Handler;
4645
import android.os.IBinder;
@@ -72,6 +71,7 @@
7271
import android.util.SparseArray;
7372
import android.view.Gravity;
7473
import android.view.HapticFeedbackConstants;
74+
import android.view.IApplicationToken;
7575
import android.view.IWindowManager;
7676
import android.view.InputChannel;
7777
import android.view.InputDevice;
@@ -343,6 +343,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
343343

344344
// The last window we were told about in focusChanged.
345345
WindowState mFocusedWindow;
346+
IApplicationToken mFocusedApp;
346347

347348
private final InputHandler mPointerLocationInputHandler = new BaseInputHandler() {
348349
@Override
@@ -3813,11 +3814,13 @@ private int updateSystemUiVisibilityLw() {
38133814
int diff = visibility ^ mLastSystemUiFlags;
38143815
final boolean needsMenu = (mFocusedWindow.getAttrs().flags
38153816
& WindowManager.LayoutParams.FLAG_NEEDS_MENU_KEY) != 0;
3816-
if (diff == 0 && mLastFocusNeedsMenu == needsMenu) {
3817+
if (diff == 0 && mLastFocusNeedsMenu == needsMenu
3818+
&& mFocusedApp == mFocusedWindow.getAppToken()) {
38173819
return 0;
38183820
}
38193821
mLastSystemUiFlags = visibility;
38203822
mLastFocusNeedsMenu = needsMenu;
3823+
mFocusedApp = mFocusedWindow.getAppToken();
38213824
mHandler.post(new Runnable() {
38223825
public void run() {
38233826
if (mStatusBarService == null) {

0 commit comments

Comments
 (0)