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

Commit 8b08a9f7 authored by Nikolas Havrikov's avatar Nikolas Havrikov
Browse files

Extract hiding status bar icon

Bug: 205676419
Test: make
Change-Id: I1afed9f50196eae5acc70379b61b04bddf4a2954
parent bf82be54
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -1780,9 +1780,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
                mKeyguardManager = mContext.getSystemService(KeyguardManager.class);
                mNotificationManager = mContext.getSystemService(NotificationManager.class);
                mStatusBar = statusBar;
                if (mStatusBar != null) {
                    mStatusBar.setIconVisibility(mSlotIme, false);
                }
                hideStatusBarIconLocked();
                updateSystemUiLocked(mImeWindowVis, mBackDisposition);
                mShowOngoingImeSwitcherForPhones = mRes.getBoolean(
                        com.android.internal.R.bool.show_ongoing_ime_switcher);
@@ -2604,9 +2602,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            setCurMethodUid(Process.INVALID_UID);
            scheduleNotifyImeUidToAudioService(getCurMethodUid());
        }
        if (mStatusBar != null) {
            mStatusBar.setIconVisibility(mSlotIme, false);
        }
        hideStatusBarIconLocked();
        mInFullscreenMode = false;
    }

@@ -2621,9 +2617,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
            try {
                if (iconId == 0) {
                    if (DEBUG) Slog.d(TAG, "hide the small icon for the input method");
                    if (mStatusBar != null) {
                        mStatusBar.setIconVisibility(mSlotIme, false);
                    }
                    hideStatusBarIconLocked();
                } else if (packageName != null) {
                    if (DEBUG) Slog.d(TAG, "show a small icon for the input method");
                    CharSequence contentDescription = null;
@@ -2649,6 +2643,13 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
        }
    }

    @GuardedBy("mMethodMap")
    private void hideStatusBarIconLocked() {
        if (mStatusBar != null) {
            mStatusBar.setIconVisibility(mSlotIme, false);
        }
    }

    @GuardedBy("mMethodMap")
    private boolean shouldShowImeSwitcherLocked(int visibility) {
        if (!mShowOngoingImeSwitcherForPhones) return false;