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

Commit 65ff129f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove the dependency on IWindowManager from IMMS"

parents c927d14c 24ab9e18
Loading
Loading
Loading
Loading
+9 −16
Original line number Diff line number Diff line
@@ -126,7 +126,6 @@ import android.util.SparseArray;
import android.util.SparseBooleanArray;
import android.util.proto.ProtoOutputStream;
import android.view.DisplayInfo;
import android.view.IWindowManager;
import android.view.InputChannel;
import android.view.InputDevice;
import android.view.MotionEvent;
@@ -289,7 +288,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
    private final Handler mHandler;
    final InputMethodSettings mSettings;
    final SettingsObserver mSettingsObserver;
    final IWindowManager mIWindowManager;
    private final SparseBooleanArray mLoggedDeniedGetInputMethodWindowVisibleHeightForUid =
            new SparseBooleanArray(0);
    final WindowManagerInternal mWindowManagerInternal;
@@ -1715,8 +1713,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
        mHandler = Handler.createAsync(thread.getLooper(), this);
        // Note: SettingsObserver doesn't register observers in its constructor.
        mSettingsObserver = new SettingsObserver(mHandler);
        mIWindowManager = IWindowManager.Stub.asInterface(
                ServiceManager.getService(Context.WINDOW_SERVICE));
        mWindowManagerInternal = LocalServices.getService(WindowManagerInternal.class);
        mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class);
        mPackageManagerInternal = LocalServices.getService(PackageManagerInternal.class);
@@ -3160,10 +3156,9 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                mImeSwitcherNotification.setContentTitle(title)
                        .setContentText(summary)
                        .setContentIntent(mImeSwitchPendingIntent);
                try {
                // TODO(b/120076400): Figure out what is the best behavior
                if ((mNotificationManager != null)
                            && !mIWindowManager.hasNavigationBar(DEFAULT_DISPLAY)) {
                        && !mWindowManagerInternal.hasNavigationBar(DEFAULT_DISPLAY)) {
                    if (DEBUG) {
                        Slog.d(TAG, "--- show notification: label =  " + summary);
                    }
@@ -3172,8 +3167,6 @@ public final class InputMethodManagerService extends IInputMethodManager.Stub
                            mImeSwitcherNotification.build(), UserHandle.ALL);
                    mNotificationShown = true;
                }
                } catch (RemoteException e) {
                }
            } else {
                if (mNotificationShown && mNotificationManager != null) {
                    if (DEBUG) {
+9 −0
Original line number Diff line number Diff line
@@ -602,6 +602,15 @@ public abstract class WindowManagerInternal {
    public abstract void updateInputMethodTargetWindow(@NonNull IBinder imeToken,
            @NonNull IBinder imeTargetWindowToken);

    /**
     * Returns the presence of a software navigation bar on the specified display.
     *
     * @param displayId the id of display to check if there is a software navigation bar.
     * @return {@code true} if there is a software navigation. {@code false} otherwise, including
     *         the case when the specified display does not exist.
     */
    public abstract boolean hasNavigationBar(int displayId);

    /**
      * Returns true when the hardware keyboard is available.
      */
+5 −0
Original line number Diff line number Diff line
@@ -7910,6 +7910,11 @@ public class WindowManagerService extends IWindowManager.Stub
            }
        }

        @Override
        public boolean hasNavigationBar(int displayId) {
            return WindowManagerService.this.hasNavigationBar(displayId);
        }

        @Override
        public boolean isHardKeyboardAvailable() {
            synchronized (mGlobalLock) {