/** * Write this to another Parcel. Note that this discards the internal Parcel and should not be * used anymore. This is so we can pass this to a Binder where we won't have a chance to call * recycle on this. */ @Override public void writeToParcel(Parcel dest, int flags) { final int N = mList.size(); final int callFlags = flags; dest.writeInt(N); if (DEBUG) Log.d(TAG, "Writing " + N + " items"); if (N > 0) { final Class<?> listElementClass = mList.get(0).getClass(); dest.writeParcelableCreator(mList.get(0)); int i = 0; while (i < N && dest.dataSize() < MAX_IPC_SIZE) { dest.writeInt(1); final T parcelable = mList.get(i); verifySameType(listElementClass, parcelable.getClass()); parcelable.writeToParcel(dest, callFlags); if (DEBUG) Log.d(TAG, "Wrote inline #" + i + ": " + mList.get(i)); i++; } if (i < N) { dest.writeInt(0); Binder retriever = new Binder() { @Override protected boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { if (code != FIRST_CALL_TRANSACTION) { return super.onTransact(code, data, reply, flags); } int i = data.readInt(); if (DEBUG) Log.d(TAG, "Writing more @" + i + " of " + N); while (i < N && reply.dataSize() < MAX_IPC_SIZE) { reply.writeInt(1); final T parcelable = mList.get(i); verifySameType(listElementClass, parcelable.getClass()); parcelable.writeToParcel(reply, callFlags); if (DEBUG) Log.d(TAG, "Wrote extra #" + i + ": " + mList.get(i)); i++; } if (i < N) { if (DEBUG) Log.d(TAG, "Breaking @" + i + " of " + N); reply.writeInt(0); } return true; } }; if (DEBUG) Log.d(TAG, "Breaking @" + i + " of " + N + ": retriever=" + retriever); dest.writeStrongBinder(retriever); } } }
/** * Write this to another Parcel. Note that this discards the internal Parcel and should not be * used anymore. This is so we can pass this to a Binder where we won't have a chance to call * recycle on this. */ @DSGenerator( tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2014-09-07 03:18:43.626 -0400", hash_original_method = "74A4BECDA9C488959F6AA6625D981FD8", hash_generated_method = "D089205EB00DB7A060AC70284C038F5C") @Override public void writeToParcel(Parcel dest, int flags) { final int N = mList.size(); final int callFlags = flags; dest.writeInt(N); if (DEBUG) Log.d(TAG, "Writing " + N + " items"); if (N > 0) { dest.writeParcelableCreator(mList.get(0)); int i = 0; while (i < N && dest.dataSize() < MAX_FIRST_IPC_SIZE) { dest.writeInt(1); mList.get(i).writeToParcel(dest, callFlags); if (DEBUG) Log.d(TAG, "Wrote inline #" + i + ": " + mList.get(i)); i++; } if (i < N) { dest.writeInt(0); Binder retriever = new Binder() { @DSSafe(DSCat.SAFE_LIST) @Override protected boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { if (code != FIRST_CALL_TRANSACTION) { return super.onTransact(code, data, reply, flags); } int i = data.readInt(); if (DEBUG) Log.d(TAG, "Writing more @" + i + " of " + N); while (i < N && reply.dataSize() < MAX_IPC_SIZE) { reply.writeInt(1); mList.get(i).writeToParcel(reply, callFlags); if (DEBUG) Log.d(TAG, "Wrote extra #" + i + ": " + mList.get(i)); i++; } if (i < N) { if (DEBUG) Log.d(TAG, "Breaking @" + i + " of " + N); reply.writeInt(0); } return true; } }; if (DEBUG) Log.d(TAG, "Breaking @" + i + " of " + N + ": retriever=" + retriever); dest.writeStrongBinder(retriever); } } }
/** * Appends a parcel to this list slice. * * @param item Parcelable item to append to this list slice * @return true when the list slice is full and should not be appended to anymore */ @DSGenerator( tool_name = "Doppelganger", tool_version = "2.0", generated_on = "2013-12-30 12:34:55.746 -0500", hash_original_method = "1E56C806D3B84E35689447C22D535D39", hash_generated_method = "C66D6F971A7BE1AFC963389EBB6ACC76") public boolean append(T item) { if (mParcel == null) { throw new IllegalStateException("ParceledListSlice has already been recycled"); } item.writeToParcel(mParcel, PARCELABLE_WRITE_RETURN_VALUE); mNumItems++; return (((mParcel.dataSize() + MAX_IPC_SIZE)) == 1); }
// Check if there at least MAX_OPS_PER_BATCH ops in queue and flush if there are. // If force is true, flush regardless of size. private void applyBatchIfNeeded( ArrayList<ContentProviderOperation> ops, int maxOpsPerBatch, boolean force) throws RemoteException, OperationApplicationException { if (force || ops.size() >= maxOpsPerBatch) { // STOPSHIP Remove calculating size of data before ship if (LogUtils.isLoggable(TAG, Log.DEBUG)) { final Parcel parcel = Parcel.obtain(); for (ContentProviderOperation op : ops) { op.writeToParcel(parcel, 0); } Log.d(TAG, String.format("Committing %d ops total size=%d", ops.size(), parcel.dataSize())); parcel.recycle(); } mContentResolver.applyBatch(EmailContent.AUTHORITY, ops); ops.clear(); } }
void logWriteInfo(String str) { Log.d(LT, str + ": " + "dataSize = " + p.dataSize()); }
@Override protected Object responseCallList(Parcel p) { int num; int voiceSettings; ArrayList<DriverCall> response; DriverCall dc; int dataAvail = p.dataAvail(); int pos = p.dataPosition(); int size = p.dataSize(); Log.d(LOG_TAG, "Parcel size = " + size); Log.d(LOG_TAG, "Parcel pos = " + pos); Log.d(LOG_TAG, "Parcel dataAvail = " + dataAvail); // Samsung f****d up here num = p.readInt(); Log.d(LOG_TAG, "num = " + num); response = new ArrayList<DriverCall>(num); for (int i = 0; i < num; i++) { if (mIsSamsungCdma) dc = new SamsungDriverCall(); else dc = new DriverCall(); dc.state = DriverCall.stateFromCLCC(p.readInt()); Log.d(LOG_TAG, "state = " + dc.state); dc.index = p.readInt(); Log.d(LOG_TAG, "index = " + dc.index); dc.TOA = p.readInt(); Log.d(LOG_TAG, "state = " + dc.TOA); dc.isMpty = (0 != p.readInt()); Log.d(LOG_TAG, "isMpty = " + dc.isMpty); dc.isMT = (0 != p.readInt()); Log.d(LOG_TAG, "isMT = " + dc.isMT); dc.als = p.readInt(); Log.d(LOG_TAG, "als = " + dc.als); voiceSettings = p.readInt(); dc.isVoice = (0 == voiceSettings) ? false : true; Log.d(LOG_TAG, "isVoice = " + dc.isVoice); dc.isVoicePrivacy = (0 != p.readInt()); // Some Samsung magic data for Videocalls voiceSettings = p.readInt(); // printing it to cosole for later investigation Log.d(LOG_TAG, "Samsung magic = " + voiceSettings); dc.number = p.readString(); Log.d(LOG_TAG, "number = " + dc.number); int np = p.readInt(); Log.d(LOG_TAG, "np = " + np); dc.numberPresentation = DriverCall.presentationFromCLIP(np); dc.name = p.readString(); Log.d(LOG_TAG, "name = " + dc.name); dc.namePresentation = p.readInt(); Log.d(LOG_TAG, "namePresentation = " + dc.namePresentation); int uusInfoPresent = p.readInt(); Log.d(LOG_TAG, "uusInfoPresent = " + uusInfoPresent); if (uusInfoPresent == 1) { dc.uusInfo = new UUSInfo(); dc.uusInfo.setType(p.readInt()); dc.uusInfo.setDcs(p.readInt()); byte[] userData = p.createByteArray(); dc.uusInfo.setUserData(userData); Log.v( LOG_TAG, String.format( "Incoming UUS : type=%d, dcs=%d, length=%d", dc.uusInfo.getType(), dc.uusInfo.getDcs(), dc.uusInfo.getUserData().length)); Log.v(LOG_TAG, "Incoming UUS : data (string)=" + new String(dc.uusInfo.getUserData())); Log.v( LOG_TAG, "Incoming UUS : data (hex): " + IccUtils.bytesToHexString(dc.uusInfo.getUserData())); } else { Log.v(LOG_TAG, "Incoming UUS : NOT present!"); } // Make sure there's a leading + on addresses with a TOA of 145 dc.number = PhoneNumberUtils.stringFromStringAndTOA(dc.number, dc.TOA); response.add(dc); if (dc.isVoicePrivacy) { mVoicePrivacyOnRegistrants.notifyRegistrants(); Log.d(LOG_TAG, "InCall VoicePrivacy is enabled"); } else { mVoicePrivacyOffRegistrants.notifyRegistrants(); Log.d(LOG_TAG, "InCall VoicePrivacy is disabled"); } } Collections.sort(response); return response; }
/** * Construct a VoLteServiceState object from the given parcel. * * @hide */ public VoLteServiceState(Parcel in) { if (DBG) log("Size of VoLteServiceState parcel:" + in.dataSize()); mSrvccState = in.readInt(); }