1 /*
2  * Copyright (C) 2019 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 com.android.internal.inputmethod;
18 
19 import android.net.Uri;
20 import android.view.inputmethod.InputMethodSubtype;
21 
22 import com.android.internal.inputmethod.IBooleanResultCallback;
23 import com.android.internal.inputmethod.IInputContentUriToken;
24 import com.android.internal.inputmethod.IIInputContentUriTokenResultCallback;
25 import com.android.internal.inputmethod.IVoidResultCallback;
26 
27 /**
28  * Defines priviledged operations that only the current IME is allowed to call.
29  * Actual operations are implemented and handled by InputMethodManagerService.
30  */
31 oneway interface IInputMethodPrivilegedOperations {
setImeWindowStatusAsync(int vis, int backDisposition)32     void setImeWindowStatusAsync(int vis, int backDisposition);
reportStartInputAsync(in IBinder startInputToken)33     void reportStartInputAsync(in IBinder startInputToken);
createInputContentUriToken(in Uri contentUri, in String packageName, in IIInputContentUriTokenResultCallback resultCallback)34     void createInputContentUriToken(in Uri contentUri, in String packageName,
35             in IIInputContentUriTokenResultCallback resultCallback);
reportFullscreenModeAsync(boolean fullscreen)36     void reportFullscreenModeAsync(boolean fullscreen);
setInputMethod(String id, in IVoidResultCallback resultCallback)37     void setInputMethod(String id, in IVoidResultCallback resultCallback);
setInputMethodAndSubtype(String id, in InputMethodSubtype subtype, in IVoidResultCallback resultCallback)38     void setInputMethodAndSubtype(String id, in InputMethodSubtype subtype,
39             in IVoidResultCallback resultCallback);
hideMySoftInput(int flags, in IVoidResultCallback resultCallback)40     void hideMySoftInput(int flags, in IVoidResultCallback resultCallback);
showMySoftInput(int flags, in IVoidResultCallback resultCallback)41     void showMySoftInput(int flags, in IVoidResultCallback resultCallback);
updateStatusIconAsync(String packageName, int iconId)42     void updateStatusIconAsync(String packageName, int iconId);
switchToPreviousInputMethod(in IBooleanResultCallback resultCallback)43     void switchToPreviousInputMethod(in IBooleanResultCallback resultCallback);
switchToNextInputMethod(boolean onlyCurrentIme, in IBooleanResultCallback resultCallback)44     void switchToNextInputMethod(boolean onlyCurrentIme, in IBooleanResultCallback resultCallback);
shouldOfferSwitchingToNextInputMethod(in IBooleanResultCallback resultCallback)45     void shouldOfferSwitchingToNextInputMethod(in IBooleanResultCallback resultCallback);
notifyUserActionAsync()46     void notifyUserActionAsync();
applyImeVisibilityAsync(IBinder showOrHideInputToken, boolean setVisible)47     void applyImeVisibilityAsync(IBinder showOrHideInputToken, boolean setVisible);
48 }
49