| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.view.inputmethod; |
| 18 |
|
| 19 |
import android.os.IBinder; |
| 20 |
import android.os.Parcel; |
| 21 |
import android.os.Parcelable; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
public final class InputBinding implements Parcelable { |
| 28 |
static final String TAG = "InputBinding"; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
final InputConnection mConnection; |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
final IBinder mConnectionToken; |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
final int mUid; |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
final int mPid; |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
public InputBinding(InputConnection conn, IBinder connToken, |
| 59 |
int uid, int pid) { |
| 60 |
mConnection = conn; |
| 61 |
mConnectionToken = connToken; |
| 62 |
mUid = uid; |
| 63 |
mPid = pid; |
| 64 |
} |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
public InputBinding(InputConnection conn, InputBinding binding) { |
| 74 |
mConnection = conn; |
| 75 |
mConnectionToken = binding.getConnectionToken(); |
| 76 |
mUid = binding.getUid(); |
| 77 |
mPid = binding.getPid(); |
| 78 |
} |
| 79 |
|
| 80 |
InputBinding(Parcel source) { |
| 81 |
mConnection = null; |
| 82 |
mConnectionToken = source.readStrongBinder(); |
| 83 |
mUid = source.readInt(); |
| 84 |
mPid = source.readInt(); |
| 85 |
} |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
public InputConnection getConnection() { |
| 91 |
return mConnection; |
| 92 |
} |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
public IBinder getConnectionToken() { |
| 100 |
return mConnectionToken; |
| 101 |
} |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
public int getUid() { |
| 107 |
return mUid; |
| 108 |
} |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
public int getPid() { |
| 114 |
return mPid; |
| 115 |
} |
| 116 |
|
| 117 |
@Override |
| 118 |
public String toString() { |
| 119 |
return "InputBinding{" + mConnectionToken |
| 120 |
+ " / uid " + mUid + " / pid " + mPid + "}"; |
| 121 |
} |
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
public void writeToParcel(Parcel dest, int flags) { |
| 130 |
dest.writeStrongBinder(mConnectionToken); |
| 131 |
dest.writeInt(mUid); |
| 132 |
dest.writeInt(mPid); |
| 133 |
} |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
public static final @android.annotation.NonNull Parcelable.Creator<InputBinding> CREATOR = new Parcelable.Creator<InputBinding>() { |
| 139 |
public InputBinding createFromParcel(Parcel source) { |
| 140 |
return new InputBinding(source); |
| 141 |
} |
| 142 |
|
| 143 |
public InputBinding[] newArray(int size) { |
| 144 |
return new InputBinding[size]; |
| 145 |
} |
| 146 |
}; |
| 147 |
|
| 148 |
public int describeContents() { |
| 149 |
return 0; |
| 150 |
} |
| 151 |
} |