AbilityForm, AbilityInfo, AbsComponentSaveState, AppAccount, ApplicationInfo, AudioStreamProperty, AVDescription, AVElement, AVMetadata, AVPlaybackInfo, AVPlaybackState, AVPlaybackState.AVPlaybackCustomAction, AVQueueElement, BackupBundleInfo, BasePacMap, BiometricAuthentication.SystemAuthDialogInfo, BleAdvertiseData, BleAdvertiseSettings, BleScanFilter, BleScanResult, BluetoothDeviceClass, BluetoothRemoteDevice, BuiltinKeyEvent, BundleInfo, CdmaSignalInformation, CommonEventData, CommonEventInfo, CommonEventPublishInfo, CommonEventSubscribeInfo, ComponentProvider, ComponentProvider.Action, ComponentSaveState, CompositeEvent, ConnectionProperties, ContinuationDeviceInfo, Courier, CourierEx, CvPoint, CvRect, DataAbilityOperation, DataAbilityPredicates, DataAbilityResult, DeviceConfigInfo, DeviceInfo, DownloadConfig, EditingCapability, EditingText, EditorAttribute, ElementName, ElementNameEx, ExtraParams, Form, FormBaseInfo, FormBindingData, FormInfo, GattCharacteristic, GattDescriptor, GattService, GeneralReceiver, GeoAddress, GsmSignalInformation, HapModuleInfo, HttpProxy, InnerEvent, Insets, InstallParam, Intent, IntentAgent, IntentAgentEx, IntentParams, IpInfo, IpPrefix, KeyBoardEvent, KeyEvent, LinkAddress, LteSignalInformation, ManipulationEvent, MatchingSkills, MessageRecord, MessageUser, MimeData, MouseEvent, MousePointerStyle, MousePointerStyle.HotSpot, MultimodalEvent, NdefMessage, NetCapabilities, NetHandle, NetSpecifier, NetworkState, NotificationActionButton, NotificationRequest, NotificationRequest.NotificationContent, NotificationRequest.NotificationConversationalContent, NotificationRequest.NotificationConversationalContent.ConversationalMessage, NotificationRequest.NotificationLongTextContent, NotificationRequest.NotificationMediaContent, NotificationRequest.NotificationMultiLineContent, NotificationRequest.NotificationNormalContent, NotificationRequest.NotificationPictureContent, NotificationSlot, NotificationSlotGroup, NotificationSorting, NotificationSortingMap, NotificationSubscribeInfo, NotificationUserInput, NrSignalInformation, PacMap, PacMapEx, PasteData, PasteData.DataProperty, PasteData.Record, PermissionDef, PermissionGroupDef, PersistablePacMap, PixelMap, ProcessErrorInfo, ProcessInfo, ProviderFormInfo, Rect, Rect, ReminderRequest, ReminderRequestAlarm, ReminderRequestCalendar, ReminderRequestTimer, RequestParam, RichContent, RotationEvent, RouteInfo, SequenceUuid, SharedBlock, ShortcutInfo, ShortcutIntent, SignalInformation, SpeechEvent, StorageInfo, StylusEvent, Surface, SystemMemoryInfo, TagInfo, TdscdmaSignalInformation, TouchEvent, Uri, ValuesBucket, ViewsStatus, WcdmaSignalInformation, WifiDeviceConfig, WifiLinkedInfo, WifiP2pConfig, WifiP2pDevice, WifiP2pGroup, WifiP2pLinkedInfo, WifiP2pNetworkInfo, WifiScanInfo, WorkInfopublic interface Sequenceable
Parcel during
inter-process communication (IPC).
This can be done during IPC only after the class inherits from Sequenceable
and implements the marshalling and unmarshalling methods provided in
Sequenceable. If the class has a final member variable whose value cannot be
changed by calling unmarshalling, you must also implement the createFromParcel
method in Sequenceable.Producer.
Example code:
public class Example implements Sequenceable {
private int number;
private String name;
public boolean marshalling(Parcel out) {
return out.writeInt(number) && out.writeString(name);
}
public boolean unmarshalling(Parcel in) {
this.number = in.readInt();
this.name = in.readString();
return true;
}
public static final Sequenceable.Producer PRODUCER = new Sequenceable.Producer() {
public Example createFromParcel(Parcel in) {
// Initialize an instance first, then do customized unmarshlling.
Example instance = new Example();
instance.unmarshalling(in);
return instance;
}
};
}
| 限定符和类型 | 接口 | 说明 |
|---|---|---|
static interface |
Sequenceable.Producer<T> |
Creates a
Sequenceable instance from a Parcel. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
default boolean |
hasFileDescriptor() |
Checks whether the implementation class of this
Sequenceable contains FileDescriptor object data. |
boolean |
marshalling(Parcel out) |
Marshals this
Sequenceable object into a Parcel. |
boolean |
unmarshalling(Parcel in) |
Unmarshals this
Sequenceable object from a Parcel. |
default boolean hasFileDescriptor()
Sequenceable contains FileDescriptor object data.
If the custom Sequenceable class contains any FileDescriptor data, you should override this
method.
This method return false by default.
true if it contains FileDescriptor data; returns false otherwise.boolean marshalling(Parcel out)
Sequenceable object into a Parcel.out - Indicates the Parcel object to which the Sequenceable
object will be marshaled..true if the marshalling is successful; returns false otherwise.ParcelException - Throws this exception if the operation fails.boolean unmarshalling(Parcel in)
Sequenceable object from a Parcel.in - Indicates the Parcel object into which the Sequenceable
object has been marshaled.true if the unmarshalling is successful; returns false otherwise.ParcelException - Throws this exception if the operation fails.