|
47 | 47 | * Any other binder transactions must include an additional int flag into their bundle or the parsing |
48 | 48 | * of this object will fail. |
49 | 49 | */ |
50 | | -public class BaseSdlPacket implements Parcelable{ |
| 50 | +public class BaseSdlPacket { |
51 | 51 |
|
52 | 52 | /** |
53 | 53 | * This is the amount of bytes added to the bundle from the router service for a specific int |
@@ -359,92 +359,6 @@ public String toString() { |
359 | 359 | public void setMessagingVersion(int version){ |
360 | 360 | this.messagingVersion = version; |
361 | 361 | } |
362 | | - |
363 | | - |
364 | | - |
365 | | - /* *************************************************************************************************************************************************** |
366 | | - * *********************************************************** Parceable Overrides ***************************************************************** |
367 | | - *****************************************************************************************************************************************************/ |
368 | | - |
369 | | - |
370 | | - |
371 | | - //I think this is FIFO...right? |
372 | | - public BaseSdlPacket(Parcel p) { |
373 | | - this.version = p.readInt(); |
374 | | - this.encryption = (p.readInt() == 0) ? false : true; |
375 | | - this.frameType = p.readInt(); |
376 | | - this.serviceType = p.readInt(); |
377 | | - this.frameInfo = p.readInt(); |
378 | | - this.sessionId = p.readInt(); |
379 | | - this.dataSize = p.readInt(); |
380 | | - this.messageId = p.readInt(); |
381 | | - if(p.readInt() == 1){ //We should have a payload attached |
382 | | - payload = new byte[dataSize]; |
383 | | - p.readByteArray(payload); |
384 | | - } |
385 | | - |
386 | | - this.priorityCoefficient = p.readInt(); |
387 | | - |
388 | | - if(p.dataAvail() > EXTRA_PARCEL_DATA_LENGTH) { //See note on constant for why not 0 |
389 | | - try { |
390 | | - messagingVersion = p.readInt(); |
391 | | - if (messagingVersion >= 2) { |
392 | | - if (p.readInt() == 1) { //We should have a transport type attached |
393 | | - this.transportRecord = (TransportRecord) p.readParcelable(TransportRecord.class.getClassLoader()); |
394 | | - } |
395 | | - } |
396 | | - }catch (RuntimeException e){ |
397 | | - DebugTool.logError("Error creating packet from parcel", e); |
398 | | - } |
399 | | - } |
400 | | - } |
401 | | - |
402 | | - |
403 | | - @Override |
404 | | - public int describeContents() { |
405 | | - return 0; |
406 | | - } |
407 | | - |
408 | | - @Override |
409 | | - public void writeToParcel(Parcel dest, int flags) { |
410 | | - |
411 | | - dest.writeInt(version); |
412 | | - dest.writeInt(encryption? 1 : 0); |
413 | | - dest.writeInt(frameType); |
414 | | - dest.writeInt(serviceType); |
415 | | - dest.writeInt(frameInfo); |
416 | | - dest.writeInt(sessionId); |
417 | | - dest.writeInt(dataSize); |
418 | | - dest.writeInt(messageId); |
419 | | - dest.writeInt(payload!=null? 1 : 0); |
420 | | - if(payload!=null){ |
421 | | - dest.writeByteArray(payload); |
422 | | - } |
423 | | - dest.writeInt(priorityCoefficient); |
424 | | - |
425 | | - ///Additions after initial creation |
426 | | - if(messagingVersion > 1){ |
427 | | - dest.writeInt(messagingVersion); |
428 | | - |
429 | | - dest.writeInt(transportRecord!=null? 1 : 0); |
430 | | - if(transportRecord != null){ |
431 | | - dest.writeParcelable(transportRecord,0); |
432 | | - } |
433 | | - } |
434 | | - |
435 | | - } |
436 | | - |
437 | | - public static final Parcelable.Creator<BaseSdlPacket> CREATOR = new Parcelable.Creator<BaseSdlPacket>() { |
438 | | - public BaseSdlPacket createFromParcel(Parcel in) { |
439 | | - return new BaseSdlPacket(in); |
440 | | - } |
441 | | - |
442 | | - @Override |
443 | | - public BaseSdlPacket[] newArray(int size) { |
444 | | - return new BaseSdlPacket[size]; |
445 | | - } |
446 | | - |
447 | | - }; |
448 | 362 |
|
449 | 363 | public void putTag(String tag, Object data){ |
450 | 364 | if(bsonPayload == null){ |
|
0 commit comments