struct voice_event_s {
rpc_port_parcelable_t parcelable;
int type;
+ int timestamp;
char *source;
};
}
rpc_port_parcel_write_int32(parcel, h->type);
+ rpc_port_parcel_write_int32(parcel, h->timestamp);
rpc_port_parcel_write_string(parcel, h->source ? h->source : "");
}
}
rpc_port_parcel_read_int32(parcel, &h->type);
+ rpc_port_parcel_read_int32(parcel, &h->timestamp);
rpc_port_parcel_read_string(parcel, &h->source);
}
}
handle->type = h->type;
+ handle->timestamp = h->timestamp;
if (h->source) {
handle->source = strdup(h->source);
if (!handle->source) {
return 0;
}
+int rpc_port_voice_event_set_timestamp(rpc_port_voice_event_h h, int timestamp)
+{
+ if (!h) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ h->timestamp = timestamp;
+ return 0;
+}
+
int rpc_port_voice_event_set_source(rpc_port_voice_event_h h, const char *source)
{
if (!h || !source) {
return 0;
}
+int rpc_port_voice_event_get_timestamp(rpc_port_voice_event_h h, int *timestamp)
+{
+ if (!h || !timestamp) {
+ _E("Invalid parameter");
+ return -1;
+ }
+
+ *timestamp = h->timestamp;
+ return 0;
+}
+
int rpc_port_voice_event_get_source(rpc_port_voice_event_h h, char **source)
{
if (!h || !source) {
int rpc_port_voice_event_set_type(rpc_port_voice_event_h h, int type);
+int rpc_port_voice_event_set_timestamp(rpc_port_voice_event_h h, int timestamp);
+
int rpc_port_voice_event_set_source(rpc_port_voice_event_h h, const char *source);
int rpc_port_voice_event_get_type(rpc_port_voice_event_h h, int *type);
+int rpc_port_voice_event_get_timestamp(rpc_port_voice_event_h h, int *timestamp);
+
int rpc_port_voice_event_get_source(rpc_port_voice_event_h h, char **source);
typedef struct action_event_s *rpc_port_action_event_h;