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

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

Merge "Remove unused methods and classes"

parents bf86dd03 b1fb07a8
Loading
Loading
Loading
Loading
+0 −115
Original line number Diff line number Diff line
@@ -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;
@@ -40,34 +34,6 @@ public final class CallbackUtils {
    private CallbackUtils() {
    }

    /**
     * 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.
     *
@@ -94,87 +60,6 @@ public final class CallbackUtils {
        } catch (RemoteException ignored) { }
    }

    /**
     * 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.
     *
+0 −25
Original line number Diff line number Diff line
/*
 * 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
+0 −25
Original line number Diff line number Diff line
/*
 * 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
+0 −25
Original line number Diff line number Diff line
/*
 * 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
+0 −25
Original line number Diff line number Diff line
/*
 * 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
Loading