summaryrefslogtreecommitdiffstats
path: root/core/java/android/app/assist/AssistStructure.java
blob: 1677e9576b6e0472cb27b46a4d79f8ef91f39c72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package android.app.assist;

import android.app.Activity;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * New home for AssistStructure.
 */
public final class AssistStructure extends android.app.AssistStructure implements Parcelable {

    public AssistStructure() {
    }

    /** @hide */
    public AssistStructure(Activity activity) {
        super(activity);
    }

    AssistStructure(Parcel in) {
        super(in);
    }

    public WindowNode getWindowNodeAt(int index) {
        return super.getWindowNodeAt(index);
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel out, int flags) {
        if (mHaveData) {
            // This object holds its data.  We want to write a send channel that the
            // other side can use to retrieve that data.
            if (mSendChannel == null) {
                mSendChannel = new SendChannel();
            }
            out.writeStrongBinder(mSendChannel);
        } else {
            // This object doesn't hold its data, so just propagate along its receive channel.
            out.writeStrongBinder(mReceiveChannel);
        }
    }

    public static final Parcelable.Creator<AssistStructure> CREATOR
            = new Parcelable.Creator<AssistStructure>() {
        public AssistStructure createFromParcel(Parcel in) {
            return new AssistStructure(in);
        }

        public AssistStructure[] newArray(int size) {
            return new AssistStructure[size];
        }
    };
}