1 #ifndef ANDROID_PDX_CHANNEL_PARCELABLE_H_
2 #define ANDROID_PDX_CHANNEL_PARCELABLE_H_
3 
4 #include <binder/Parcelable.h>
5 #include <pdx/channel_handle.h>
6 
7 namespace android {
8 namespace pdx {
9 
10 /**
11  * A parcelable object holds all necessary objects to recreate a ClientChannel.
12  * In addition to the android::Parcelable interface, this interface exposees
13  * more PDX-related interface.
14  */
15 class ChannelParcelable : public Parcelable {
16  public:
17   virtual ~ChannelParcelable() = default;
18 
19   // Returns whether the parcelable object holds a valid client channel.
20   virtual bool IsValid() const = 0;
21 
22   // Returns a channel handle constructed from this parcelable object and takes
23   // the ownership of all resources from the parcelable object. In another word,
24   // the parcelable object will become invalid after TakeChannelHandle returns.
25   virtual LocalChannelHandle TakeChannelHandle() = 0;
26 };
27 
28 }  // namespace pdx
29 }  // namespace android
30 
31 #endif  // ANDROID_PDX_CHANNEL_PARCELABLE_H_
32