| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.app; |
| 18 |
|
| 19 |
import android.net.Uri; |
| 20 |
import android.os.Parcel; |
| 21 |
import android.os.Parcelable; |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
public class RemoteInputHistoryItem implements Parcelable { |
| 34 |
private CharSequence mText; |
| 35 |
private String mMimeType; |
| 36 |
private Uri mUri; |
| 37 |
|
| 38 |
public RemoteInputHistoryItem(String mimeType, Uri uri, CharSequence backupText) { |
| 39 |
this.mMimeType = mimeType; |
| 40 |
this.mUri = uri; |
| 41 |
this.mText = Notification.safeCharSequence(backupText); |
| 42 |
} |
| 43 |
|
| 44 |
public RemoteInputHistoryItem(CharSequence text) { |
| 45 |
this.mText = Notification.safeCharSequence(text); |
| 46 |
} |
| 47 |
|
| 48 |
protected RemoteInputHistoryItem(Parcel in) { |
| 49 |
mText = in.readCharSequence(); |
| 50 |
mMimeType = in.readStringNoHelper(); |
| 51 |
mUri = in.readParcelable(Uri.class.getClassLoader(), android.net.Uri.class); |
| 52 |
} |
| 53 |
|
| 54 |
public static final Creator<RemoteInputHistoryItem> CREATOR = |
| 55 |
new Creator<RemoteInputHistoryItem>() { |
| 56 |
@Override |
| 57 |
public RemoteInputHistoryItem createFromParcel(Parcel in) { |
| 58 |
return new RemoteInputHistoryItem(in); |
| 59 |
} |
| 60 |
|
| 61 |
@Override |
| 62 |
public RemoteInputHistoryItem[] newArray(int size) { |
| 63 |
return new RemoteInputHistoryItem[size]; |
| 64 |
} |
| 65 |
}; |
| 66 |
|
| 67 |
public CharSequence getText() { |
| 68 |
return mText; |
| 69 |
} |
| 70 |
|
| 71 |
public String getMimeType() { |
| 72 |
return mMimeType; |
| 73 |
} |
| 74 |
|
| 75 |
public Uri getUri() { |
| 76 |
return mUri; |
| 77 |
} |
| 78 |
|
| 79 |
@Override |
| 80 |
public int describeContents() { |
| 81 |
return 0; |
| 82 |
} |
| 83 |
|
| 84 |
@Override |
| 85 |
public void writeToParcel(Parcel dest, int flags) { |
| 86 |
dest.writeCharSequence(mText); |
| 87 |
dest.writeStringNoHelper(mMimeType); |
| 88 |
dest.writeParcelable(mUri, flags); |
| 89 |
} |
| 90 |
} |