Loading core/java/com/android/internal/inputmethod/IInputMethodManagerGlobal.java +17 −0 Original line number Diff line number Diff line Loading @@ -155,4 +155,21 @@ public final class IInputMethodManagerGlobal { throw e.rethrowFromSystemServer(); } } /** * Invokes {@link IInputMethodManager#removeImeSurface()} */ @RequiresPermission(android.Manifest.permission.INTERNAL_SYSTEM_WINDOW) @AnyThread public static void removeImeSurface(@Nullable Consumer<RemoteException> exceptionHandler) { final IInputMethodManager service = getService(); if (service == null) { return; } try { service.removeImeSurface(); } catch (RemoteException e) { handleRemoteExceptionOrRethrow(e, exceptionHandler); } } } libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java +5 −18 Original line number Diff line number Diff line Loading @@ -21,12 +21,10 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.annotation.IntDef; import android.content.ComponentName; import android.content.Context; import android.content.res.Configuration; import android.graphics.Point; import android.graphics.Rect; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Slog; import android.util.SparseArray; import android.view.IDisplayWindowInsetsController; Loading @@ -43,7 +41,7 @@ import android.view.animation.PathInterpolator; import androidx.annotation.VisibleForTesting; import com.android.internal.view.IInputMethodManager; import com.android.internal.inputmethod.IInputMethodManagerGlobal; import com.android.wm.shell.sysui.ShellInit; import java.util.ArrayList; Loading Loading @@ -514,16 +512,10 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged } void removeImeSurface() { final IInputMethodManager imms = getImms(); if (imms != null) { try { // Remove the IME surface to make the insets invisible for // non-client controlled insets. imms.removeImeSurface(); } catch (RemoteException e) { Slog.e(TAG, "Failed to remove IME surface.", e); } } IInputMethodManagerGlobal.removeImeSurface( e -> Slog.e(TAG, "Failed to remove IME surface.", e)); } /** Loading Loading @@ -597,11 +589,6 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged } } public IInputMethodManager getImms() { return IInputMethodManager.Stub.asInterface( ServiceManager.getService(Context.INPUT_METHOD_SERVICE)); } private static boolean haveSameLeash(InsetsSourceControl a, InsetsSourceControl b) { if (a == b) { return true; Loading libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java +0 −7 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import android.view.SurfaceControl; import androidx.test.filters.SmallTest; import com.android.internal.view.IInputMethodManager; import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.sysui.ShellInit; Loading @@ -56,8 +55,6 @@ public class DisplayImeControllerTest extends ShellTestCase { @Mock private SurfaceControl.Transaction mT; @Mock private IInputMethodManager mMock; @Mock private ShellInit mShellInit; private DisplayImeController.PerDisplay mPerDisplay; private Executor mExecutor; Loading @@ -76,10 +73,6 @@ public class DisplayImeControllerTest extends ShellTestCase { public void release(SurfaceControl.Transaction t) { } }, mExecutor) { @Override public IInputMethodManager getImms() { return mMock; } @Override void removeImeSurface() { } }.new PerDisplay(DEFAULT_DISPLAY, ROTATION_0); Loading Loading
core/java/com/android/internal/inputmethod/IInputMethodManagerGlobal.java +17 −0 Original line number Diff line number Diff line Loading @@ -155,4 +155,21 @@ public final class IInputMethodManagerGlobal { throw e.rethrowFromSystemServer(); } } /** * Invokes {@link IInputMethodManager#removeImeSurface()} */ @RequiresPermission(android.Manifest.permission.INTERNAL_SYSTEM_WINDOW) @AnyThread public static void removeImeSurface(@Nullable Consumer<RemoteException> exceptionHandler) { final IInputMethodManager service = getService(); if (service == null) { return; } try { service.removeImeSurface(); } catch (RemoteException e) { handleRemoteExceptionOrRethrow(e, exceptionHandler); } } }
libs/WindowManager/Shell/src/com/android/wm/shell/common/DisplayImeController.java +5 −18 Original line number Diff line number Diff line Loading @@ -21,12 +21,10 @@ import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.annotation.IntDef; import android.content.ComponentName; import android.content.Context; import android.content.res.Configuration; import android.graphics.Point; import android.graphics.Rect; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Slog; import android.util.SparseArray; import android.view.IDisplayWindowInsetsController; Loading @@ -43,7 +41,7 @@ import android.view.animation.PathInterpolator; import androidx.annotation.VisibleForTesting; import com.android.internal.view.IInputMethodManager; import com.android.internal.inputmethod.IInputMethodManagerGlobal; import com.android.wm.shell.sysui.ShellInit; import java.util.ArrayList; Loading Loading @@ -514,16 +512,10 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged } void removeImeSurface() { final IInputMethodManager imms = getImms(); if (imms != null) { try { // Remove the IME surface to make the insets invisible for // non-client controlled insets. imms.removeImeSurface(); } catch (RemoteException e) { Slog.e(TAG, "Failed to remove IME surface.", e); } } IInputMethodManagerGlobal.removeImeSurface( e -> Slog.e(TAG, "Failed to remove IME surface.", e)); } /** Loading Loading @@ -597,11 +589,6 @@ public class DisplayImeController implements DisplayController.OnDisplaysChanged } } public IInputMethodManager getImms() { return IInputMethodManager.Stub.asInterface( ServiceManager.getService(Context.INPUT_METHOD_SERVICE)); } private static boolean haveSameLeash(InsetsSourceControl a, InsetsSourceControl b) { if (a == b) { return true; Loading
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/DisplayImeControllerTest.java +0 −7 Original line number Diff line number Diff line Loading @@ -39,7 +39,6 @@ import android.view.SurfaceControl; import androidx.test.filters.SmallTest; import com.android.internal.view.IInputMethodManager; import com.android.wm.shell.ShellTestCase; import com.android.wm.shell.sysui.ShellInit; Loading @@ -56,8 +55,6 @@ public class DisplayImeControllerTest extends ShellTestCase { @Mock private SurfaceControl.Transaction mT; @Mock private IInputMethodManager mMock; @Mock private ShellInit mShellInit; private DisplayImeController.PerDisplay mPerDisplay; private Executor mExecutor; Loading @@ -76,10 +73,6 @@ public class DisplayImeControllerTest extends ShellTestCase { public void release(SurfaceControl.Transaction t) { } }, mExecutor) { @Override public IInputMethodManager getImms() { return mMock; } @Override void removeImeSurface() { } }.new PerDisplay(DEFAULT_DISPLAY, ROTATION_0); Loading