• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 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 static java.lang.annotation.RetentionPolicy.SOURCE;
20 
21 import android.annotation.IntDef;
22 
23 import java.lang.annotation.Retention;
24 
25 /**
26  * Describes the reason why {@link com.android.server.inputmethod.InputMethodManagerService} is
27  * calling {@link com.android.internal.view.IInputMethodClient#onUnbindMethod}.
28  */
29 @Retention(SOURCE)
30 @IntDef(value = {
31         UnbindReason.UNSPECIFIED,
32         UnbindReason.SWITCH_CLIENT,
33         UnbindReason.SWITCH_IME,
34         UnbindReason.DISCONNECT_IME,
35         UnbindReason.NO_IME,
36         UnbindReason.SWITCH_IME_FAILED,
37         UnbindReason.SWITCH_USER,
38         UnbindReason.ACCESSIBILITY_SERVICE_DISABLED
39 })
40 public @interface UnbindReason {
41     /**
42      * Reason is not specified.
43      */
44     int UNSPECIFIED = 0;
45     /**
46      * When a new IME client becomes active, the previous IME client will unbound from the current
47      * IME.
48      */
49     int SWITCH_CLIENT = 1;
50     /**
51      * Before a new IME becomes active, the current IME client be unbound from the previous IME.
52      */
53     int SWITCH_IME = 2;
54     /**
55      * When the current IME is disconnected, the current IME client will be unbound.
56      */
57     int DISCONNECT_IME = 3;
58     /**
59      * When the system loses the last enabled IME, the current IME client will be unbound.
60      */
61     int NO_IME = 4;
62     /**
63      * When the system failed to switch to another IME, the current IME client will be unbound.
64      */
65     int SWITCH_IME_FAILED = 5;
66     /**
67      * When a new user becomes foreground, the previous IME client will be unbound from the previous
68      * user's active IME.
69      */
70     int SWITCH_USER = 6;
71     int ACCESSIBILITY_SERVICE_DISABLED = 7;
72 }
73