1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.view.translation; 18 19 import android.content.ComponentName; 20 import android.os.IBinder; 21 import android.os.IRemoteCallback; 22 import android.os.ResultReceiver; 23 import android.view.autofill.AutofillId; 24 import android.view.translation.TranslationContext; 25 import android.view.translation.TranslationSpec; 26 import android.view.translation.UiTranslationSpec; 27 import com.android.internal.os.IResultReceiver; 28 29 import java.util.List; 30 31 /** 32 * Mediator between apps being translated and translation service implementation. 33 * 34 * {@hide} 35 */ 36 oneway interface ITranslationManager { onTranslationCapabilitiesRequest(int sourceFormat, int destFormat, in ResultReceiver receiver, int userId)37 void onTranslationCapabilitiesRequest(int sourceFormat, int destFormat, 38 in ResultReceiver receiver, int userId); registerTranslationCapabilityCallback(in IRemoteCallback callback, int userId)39 void registerTranslationCapabilityCallback(in IRemoteCallback callback, int userId); unregisterTranslationCapabilityCallback(in IRemoteCallback callback, int userId)40 void unregisterTranslationCapabilityCallback(in IRemoteCallback callback, int userId); onSessionCreated(in TranslationContext translationContext, int sessionId, in IResultReceiver receiver, int userId)41 void onSessionCreated(in TranslationContext translationContext, 42 int sessionId, in IResultReceiver receiver, int userId); 43 updateUiTranslationState(int state, in TranslationSpec sourceSpec, in TranslationSpec targetSpec, in List<AutofillId> viewIds, IBinder token, int taskId, in UiTranslationSpec uiTranslationSpec, int userId)44 void updateUiTranslationState(int state, in TranslationSpec sourceSpec, 45 in TranslationSpec targetSpec, in List<AutofillId> viewIds, IBinder token, int taskId, 46 in UiTranslationSpec uiTranslationSpec, int userId); 47 registerUiTranslationStateCallback(in IRemoteCallback callback, int userId)48 void registerUiTranslationStateCallback(in IRemoteCallback callback, int userId); unregisterUiTranslationStateCallback(in IRemoteCallback callback, int userId)49 void unregisterUiTranslationStateCallback(in IRemoteCallback callback, int userId); getServiceSettingsActivity(in IResultReceiver result, int userId)50 void getServiceSettingsActivity(in IResultReceiver result, int userId); onTranslationFinished(boolean activityDestroyed, IBinder token, in ComponentName componentName, int userId)51 void onTranslationFinished(boolean activityDestroyed, IBinder token, 52 in ComponentName componentName, int userId); 53 } 54