Remove unused methods and classes

This is a follow up CL to my previous CL [1], which logically reverted
IInputMethodManager from emulated sync IPCs to truly sync IPCs.

There are several methods and classes that are no longer actively used
after that revert CL.  This CL also removes those unused stuff until
we we actually start using them again.

Since those methods and classes are not used right now, there should
be no user/developer visible behavior change in this CL.

 [1]: If16ac0de536d9089eb04f6e07b1ee47378124658
      662b48b72d841119160ab5c1b03be1ea36f3351d

Bug: 192412909
Test: presubmit
Change-Id: I8666ac1399058b980e51e2459122b2f5f36c77b5
diff --git a/core/java/com/android/internal/inputmethod/CallbackUtils.java b/core/java/com/android/internal/inputmethod/CallbackUtils.java
index 3958b9e..1933c54 100644
--- a/core/java/com/android/internal/inputmethod/CallbackUtils.java
+++ b/core/java/com/android/internal/inputmethod/CallbackUtils.java
@@ -16,15 +16,9 @@
 
 package com.android.internal.inputmethod;
 
-import android.annotation.AnyThread;
 import android.annotation.NonNull;
 import android.os.RemoteException;
-import android.view.inputmethod.InputMethodInfo;
-import android.view.inputmethod.InputMethodSubtype;
 
-import com.android.internal.view.InputBindResult;
-
-import java.util.List;
 import java.util.function.BooleanSupplier;
 import java.util.function.IntSupplier;
 import java.util.function.Supplier;
@@ -41,34 +35,6 @@
     }
 
     /**
-     * A utility method using given {@link IInputBindResultResultCallback} to callback the
-     * {@link InputBindResult}.
-     *
-     * @param callback {@link IInputBindResultResultCallback} to be called back.
-     * @param resultSupplier the supplier from which {@link InputBindResult} is provided.
-     */
-    @AnyThread
-    public static void onResult(@NonNull IInputBindResultResultCallback callback,
-            @NonNull Supplier<InputBindResult> resultSupplier) {
-        InputBindResult result = null;
-        Throwable exception = null;
-
-        try {
-            result = resultSupplier.get();
-        } catch (Throwable throwable) {
-            exception = throwable;
-        }
-
-        try {
-            if (exception != null) {
-                callback.onError(ThrowableHolder.of(exception));
-                return;
-            }
-            callback.onResult(result);
-        } catch (RemoteException ignored) { }
-    }
-
-    /**
      * A utility method using given {@link IBooleanResultCallback} to callback the result.
      *
      * @param callback {@link IBooleanResultCallback} to be called back.
@@ -95,87 +61,6 @@
     }
 
     /**
-     * A utility method using given {@link IInputMethodSubtypeResultCallback} to callback the
-     * result.
-     *
-     * @param callback {@link IInputMethodSubtypeResultCallback} to be called back.
-     * @param resultSupplier the supplier from which the result is provided.
-     */
-    public static void onResult(@NonNull IInputMethodSubtypeResultCallback callback,
-            @NonNull Supplier<InputMethodSubtype> resultSupplier) {
-        InputMethodSubtype result = null;
-        Throwable exception = null;
-
-        try {
-            result = resultSupplier.get();
-        } catch (Throwable throwable) {
-            exception = throwable;
-        }
-
-        try {
-            if (exception != null) {
-                callback.onError(ThrowableHolder.of(exception));
-                return;
-            }
-            callback.onResult(result);
-        } catch (RemoteException ignored) { }
-    }
-
-    /**
-     * A utility method using given {@link IInputMethodSubtypeListResultCallback} to callback the
-     * result.
-     *
-     * @param callback {@link IInputMethodSubtypeListResultCallback} to be called back.
-     * @param resultSupplier the supplier from which the result is provided.
-     */
-    public static void onResult(@NonNull IInputMethodSubtypeListResultCallback callback,
-            @NonNull Supplier<List<InputMethodSubtype>> resultSupplier) {
-        List<InputMethodSubtype> result = null;
-        Throwable exception = null;
-
-        try {
-            result = resultSupplier.get();
-        } catch (Throwable throwable) {
-            exception = throwable;
-        }
-
-        try {
-            if (exception != null) {
-                callback.onError(ThrowableHolder.of(exception));
-                return;
-            }
-            callback.onResult(result);
-        } catch (RemoteException ignored) { }
-    }
-
-    /**
-     * A utility method using given {@link IInputMethodInfoListResultCallback} to callback the
-     * result.
-     *
-     * @param callback {@link IInputMethodInfoListResultCallback} to be called back.
-     * @param resultSupplier the supplier from which the result is provided.
-     */
-    public static void onResult(@NonNull IInputMethodInfoListResultCallback callback,
-            @NonNull Supplier<List<InputMethodInfo>> resultSupplier) {
-        List<InputMethodInfo> result = null;
-        Throwable exception = null;
-
-        try {
-            result = resultSupplier.get();
-        } catch (Throwable throwable) {
-            exception = throwable;
-        }
-
-        try {
-            if (exception != null) {
-                callback.onError(ThrowableHolder.of(exception));
-                return;
-            }
-            callback.onResult(result);
-        } catch (RemoteException ignored) { }
-    }
-
-    /**
      * A utility method using given {@link IIntResultCallback} to callback the result.
      *
      * @param callback {@link IIntResultCallback} to be called back.
diff --git a/core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl b/core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl
deleted file mode 100644
index 2691984..0000000
--- a/core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.inputmethod;
-
-import com.android.internal.view.InputBindResult;
-import com.android.internal.inputmethod.ThrowableHolder;
-
-oneway interface IInputBindResultResultCallback {
-    void onResult(in InputBindResult result);
-    void onError(in ThrowableHolder exception);
-}
\ No newline at end of file
diff --git a/core/java/com/android/internal/inputmethod/IInputMethodInfoListResultCallback.aidl b/core/java/com/android/internal/inputmethod/IInputMethodInfoListResultCallback.aidl
deleted file mode 100644
index 0dfd5da..0000000
--- a/core/java/com/android/internal/inputmethod/IInputMethodInfoListResultCallback.aidl
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.inputmethod;
-
-import android.view.inputmethod.InputMethodInfo;
-import com.android.internal.inputmethod.ThrowableHolder;
-
-oneway interface IInputMethodInfoListResultCallback {
-    void onResult(in List<InputMethodInfo> result);
-    void onError(in ThrowableHolder exception);
-}
\ No newline at end of file
diff --git a/core/java/com/android/internal/inputmethod/IInputMethodSubtypeListResultCallback.aidl b/core/java/com/android/internal/inputmethod/IInputMethodSubtypeListResultCallback.aidl
deleted file mode 100644
index 619c87e..0000000
--- a/core/java/com/android/internal/inputmethod/IInputMethodSubtypeListResultCallback.aidl
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.inputmethod;
-
-import android.view.inputmethod.InputMethodSubtype;
-import com.android.internal.inputmethod.ThrowableHolder;
-
-oneway interface IInputMethodSubtypeListResultCallback {
-    void onResult(in List<InputMethodSubtype> result);
-    void onError(in ThrowableHolder exception);
-}
\ No newline at end of file
diff --git a/core/java/com/android/internal/inputmethod/IInputMethodSubtypeResultCallback.aidl b/core/java/com/android/internal/inputmethod/IInputMethodSubtypeResultCallback.aidl
deleted file mode 100644
index 66c0902..0000000
--- a/core/java/com/android/internal/inputmethod/IInputMethodSubtypeResultCallback.aidl
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.internal.inputmethod;
-
-import android.view.inputmethod.InputMethodSubtype;
-import com.android.internal.inputmethod.ThrowableHolder;
-
-oneway interface IInputMethodSubtypeResultCallback {
-    void onResult(in InputMethodSubtype result);
-    void onError(in ThrowableHolder exception);
-}
\ No newline at end of file
diff --git a/core/java/com/android/internal/inputmethod/ResultCallbacks.java b/core/java/com/android/internal/inputmethod/ResultCallbacks.java
index c56ed2d..398cffb 100644
--- a/core/java/com/android/internal/inputmethod/ResultCallbacks.java
+++ b/core/java/com/android/internal/inputmethod/ResultCallbacks.java
@@ -20,13 +20,8 @@
 import android.annotation.BinderThread;
 import android.annotation.NonNull;
 import android.annotation.Nullable;
-import android.view.inputmethod.InputMethodInfo;
-import android.view.inputmethod.InputMethodSubtype;
-
-import com.android.internal.view.InputBindResult;
 
 import java.lang.ref.WeakReference;
-import java.util.List;
 import java.util.concurrent.atomic.AtomicReference;
 
 /**
@@ -171,43 +166,6 @@
     }
 
     /**
-     * Creates {@link IInputBindResultResultCallback.Stub} that is to set
-     * {@link Completable.InputBindResult} when receiving the result.
-     *
-     * @param value {@link Completable.InputBindResult} to be set when receiving the result.
-     * @return {@link IInputBindResultResultCallback.Stub} that can be passed as a binder IPC
-     *         parameter.
-     */
-    @AnyThread
-    public static IInputBindResultResultCallback.Stub of(
-            @NonNull Completable.InputBindResult value) {
-        final AtomicReference<WeakReference<Completable.InputBindResult>>
-                atomicRef = new AtomicReference<>(new WeakReference<>(value));
-
-        return new IInputBindResultResultCallback.Stub() {
-            @BinderThread
-            @Override
-            public void onResult(InputBindResult result) {
-                final Completable.InputBindResult value = unwrap(atomicRef);
-                if (value == null) {
-                    return;
-                }
-                value.onComplete(result);
-            }
-
-            @BinderThread
-            @Override
-            public void onError(ThrowableHolder throwableHolder) {
-                final Completable.InputBindResult value = unwrap(atomicRef);
-                if (value == null) {
-                    return;
-                }
-                value.onError(throwableHolder);
-            }
-        };
-    }
-
-    /**
      * Creates {@link IBooleanResultCallback.Stub} that is to set {@link Completable.Boolean} when
      * receiving the result.
      *
@@ -243,117 +201,6 @@
     }
 
     /**
-     * Creates {@link IInputMethodSubtypeResultCallback.Stub} that is to set
-     * {@link Completable.InputMethodSubtype} when receiving the result.
-     *
-     * @param value {@link Completable.InputMethodSubtype} to be set when receiving the result.
-     * @return {@link IInputMethodSubtypeResultCallback.Stub} that can be passed as a binder
-     * IPC parameter.
-     */
-    @AnyThread
-    public static IInputMethodSubtypeResultCallback.Stub of(
-            @NonNull Completable.InputMethodSubtype value) {
-        final AtomicReference<WeakReference<Completable.InputMethodSubtype>>
-                atomicRef = new AtomicReference<>(new WeakReference<>(value));
-
-        return new IInputMethodSubtypeResultCallback.Stub() {
-            @BinderThread
-            @Override
-            public void onResult(InputMethodSubtype result) {
-                final Completable.InputMethodSubtype value = unwrap(atomicRef);
-                if (value == null) {
-                    return;
-                }
-                value.onComplete(result);
-            }
-
-            @BinderThread
-            @Override
-            public void onError(ThrowableHolder throwableHolder) {
-                final Completable.InputMethodSubtype value = unwrap(atomicRef);
-                if (value == null) {
-                    return;
-                }
-                value.onError(throwableHolder);
-            }
-        };
-    }
-
-    /**
-     * Creates {@link IInputMethodSubtypeListResultCallback.Stub} that is to set
-     * {@link Completable.InputMethodSubtypeList} when receiving the result.
-     *
-     * @param value {@link Completable.InputMethodSubtypeList} to be set when receiving the result.
-     * @return {@link IInputMethodSubtypeListResultCallback.Stub} that can be passed as a binder
-     * IPC parameter.
-     */
-    @AnyThread
-    public static IInputMethodSubtypeListResultCallback.Stub of(
-            @NonNull Completable.InputMethodSubtypeList value) {
-        final AtomicReference<WeakReference<Completable.InputMethodSubtypeList>>
-                atomicRef = new AtomicReference<>(new WeakReference<>(value));
-
-        return new IInputMethodSubtypeListResultCallback.Stub() {
-            @BinderThread
-            @Override
-            public void onResult(List<InputMethodSubtype> result) {
-                final Completable.InputMethodSubtypeList value = unwrap(atomicRef);
-                if (value == null) {
-                    return;
-                }
-                value.onComplete(result);
-            }
-
-            @BinderThread
-            @Override
-            public void onError(ThrowableHolder throwableHolder) {
-                final Completable.InputMethodSubtypeList value = unwrap(atomicRef);
-                if (value == null) {
-                    return;
-                }
-                value.onError(throwableHolder);
-            }
-        };
-    }
-
-    /**
-     * Creates {@link IInputMethodInfoListResultCallback.Stub} that is to set
-     * {@link Completable.InputMethodInfoList} when receiving the result.
-     *
-     * @param value {@link Completable.InputMethodInfoList} to be set when receiving the result.
-     * @return {@link IInputMethodInfoListResultCallback.Stub} that can be passed as a binder
-     * IPC parameter.
-     */
-    @AnyThread
-    public static IInputMethodInfoListResultCallback.Stub of(
-            @NonNull Completable.InputMethodInfoList value) {
-        final AtomicReference<WeakReference<Completable.InputMethodInfoList>>
-                atomicRef = new AtomicReference<>(new WeakReference<>(value));
-
-        return new IInputMethodInfoListResultCallback.Stub() {
-            @BinderThread
-            @Override
-            public void onResult(List<InputMethodInfo> result) {
-                final Completable.InputMethodInfoList value = unwrap(atomicRef);
-                if (value == null) {
-                    return;
-                }
-                value.onComplete(result);
-            }
-
-            @BinderThread
-            @Override
-            public void onError(ThrowableHolder throwableHolder) {
-                final Completable.InputMethodInfoList value = unwrap(atomicRef);
-                if (value == null) {
-                    return;
-                }
-                value.onError(throwableHolder);
-            }
-        };
-    }
-
-    /**
      * Creates {@link IVoidResultCallback.Stub} that is to set {@link Completable.Void} when
      * receiving the result.
      *