Loading core/java/android/nfc/NdefMessage.java +19 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.nfc; import android.os.Parcel; import android.os.Parcelable; import android.util.proto.ProtoOutputStream; import java.nio.ByteBuffer; import java.util.Arrays; Loading Loading @@ -250,4 +251,22 @@ public final class NdefMessage implements Parcelable { public String toString() { return "NdefMessage " + Arrays.toString(mRecords); } /** * Dump debugging information as a NdefMessageProto * @hide * * Note: * See proto definition in frameworks/base/core/proto/android/nfc/ndef.proto * When writing a nested message, must call {@link ProtoOutputStream#start(long)} before and * {@link ProtoOutputStream#end(long)} after. * Never reuse a proto field number. When removing a field, mark it as reserved. */ public void dumpDebug(ProtoOutputStream proto) { for (NdefRecord record : mRecords) { long token = proto.start(NdefMessageProto.NDEF_RECORDS); record.dumpDebug(proto); proto.end(token); } } } No newline at end of file core/java/android/nfc/NdefRecord.java +17 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Intent; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; import android.util.proto.ProtoOutputStream; import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; Loading Loading @@ -1051,6 +1052,22 @@ public final class NdefRecord implements Parcelable { return b.toString(); } /** * Dump debugging information as a NdefRecordProto * @hide * * Note: * See proto definition in frameworks/base/core/proto/android/nfc/ndef.proto * When writing a nested message, must call {@link ProtoOutputStream#start(long)} before and * {@link ProtoOutputStream#end(long)} after. * Never reuse a proto field number. When removing a field, mark it as reserved. */ public void dumpDebug(ProtoOutputStream proto) { proto.write(NdefRecordProto.TYPE, mType); proto.write(NdefRecordProto.ID, mId); proto.write(NdefRecordProto.PAYLOAD_BYTES, mPayload.length); } private static StringBuilder bytesToString(byte[] bs) { StringBuilder s = new StringBuilder(); for (byte b : bs) { Loading core/java/android/nfc/cardemulation/AidGroup.java +16 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.compat.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; import android.util.Log; import android.util.proto.ProtoOutputStream; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -117,6 +118,21 @@ public final class AidGroup implements Parcelable { return out.toString(); } /** * Dump debugging info as AidGroupProto * * If the output belongs to a sub message, the caller is responsible for wrapping this function * between {@link ProtoOutputStream#start(long)} and {@link ProtoOutputStream#end(long)}. * * @param proto the ProtoOutputStream to write to */ public void dump(ProtoOutputStream proto) { proto.write(AidGroupProto.CATEGORY, category); for (String aid : aids) { proto.write(AidGroupProto.AIDS, aid); } } @Override public int describeContents() { return 0; Loading core/java/android/nfc/cardemulation/ApduServiceInfo.java +31 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.os.Parcelable; import android.util.AttributeSet; import android.util.Log; import android.util.Xml; import android.util.proto.ProtoOutputStream; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -607,4 +608,34 @@ public final class ApduServiceInfo implements Parcelable { } pw.println(" Settings Activity: " + mSettingsActivityName); } /** * Dump debugging info as ApduServiceInfoProto * * If the output belongs to a sub message, the caller is responsible for wrapping this function * between {@link ProtoOutputStream#start(long)} and {@link ProtoOutputStream#end(long)}. * See proto definition in frameworks/base/core/proto/android/nfc/apdu_service_info.proto * * @param proto the ProtoOutputStream to write to */ public void dumpDebug(ProtoOutputStream proto) { getComponent().dumpDebug(proto, ApduServiceInfoProto.COMPONENT_NAME); proto.write(ApduServiceInfoProto.DESCRIPTION, getDescription()); proto.write(ApduServiceInfoProto.ON_HOST, mOnHost); if (!mOnHost) { proto.write(ApduServiceInfoProto.OFF_HOST_NAME, mOffHostName); proto.write(ApduServiceInfoProto.STATIC_OFF_HOST_NAME, mStaticOffHostName); } for (AidGroup group : mStaticAidGroups.values()) { long token = proto.start(ApduServiceInfoProto.STATIC_AID_GROUPS); group.dump(proto); proto.end(token); } for (AidGroup group : mDynamicAidGroups.values()) { long token = proto.start(ApduServiceInfoProto.STATIC_AID_GROUPS); group.dump(proto); proto.end(token); } proto.write(ApduServiceInfoProto.SETTINGS_ACTIVITY_NAME, mSettingsActivityName); } } core/java/android/nfc/cardemulation/NfcFServiceInfo.java +17 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.os.Parcelable; import android.util.AttributeSet; import android.util.Log; import android.util.Xml; import android.util.proto.ProtoOutputStream; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -325,5 +326,21 @@ public final class NfcFServiceInfo implements Parcelable { pw.println(" NFCID2: " + getNfcid2()); pw.println(" T3tPmm: " + getT3tPmm()); } /** * Dump debugging info as NfcFServiceInfoProto * * If the output belongs to a sub message, the caller is responsible for wrapping this function * between {@link ProtoOutputStream#start(long)} and {@link ProtoOutputStream#end(long)}. * * @param proto the ProtoOutputStream to write to */ public void dumpDebug(ProtoOutputStream proto) { getComponent().dumpDebug(proto, NfcFServiceInfoProto.COMPONENT_NAME); proto.write(NfcFServiceInfoProto.DESCRIPTION, getDescription()); proto.write(NfcFServiceInfoProto.SYSTEM_CODE, getSystemCode()); proto.write(NfcFServiceInfoProto.NFCID2, getNfcid2()); proto.write(NfcFServiceInfoProto.T3T_PMM, getT3tPmm()); } } Loading
core/java/android/nfc/NdefMessage.java +19 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.nfc; import android.os.Parcel; import android.os.Parcelable; import android.util.proto.ProtoOutputStream; import java.nio.ByteBuffer; import java.util.Arrays; Loading Loading @@ -250,4 +251,22 @@ public final class NdefMessage implements Parcelable { public String toString() { return "NdefMessage " + Arrays.toString(mRecords); } /** * Dump debugging information as a NdefMessageProto * @hide * * Note: * See proto definition in frameworks/base/core/proto/android/nfc/ndef.proto * When writing a nested message, must call {@link ProtoOutputStream#start(long)} before and * {@link ProtoOutputStream#end(long)} after. * Never reuse a proto field number. When removing a field, mark it as reserved. */ public void dumpDebug(ProtoOutputStream proto) { for (NdefRecord record : mRecords) { long token = proto.start(NdefMessageProto.NDEF_RECORDS); record.dumpDebug(proto); proto.end(token); } } } No newline at end of file
core/java/android/nfc/NdefRecord.java +17 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.Intent; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; import android.util.proto.ProtoOutputStream; import java.nio.BufferUnderflowException; import java.nio.ByteBuffer; Loading Loading @@ -1051,6 +1052,22 @@ public final class NdefRecord implements Parcelable { return b.toString(); } /** * Dump debugging information as a NdefRecordProto * @hide * * Note: * See proto definition in frameworks/base/core/proto/android/nfc/ndef.proto * When writing a nested message, must call {@link ProtoOutputStream#start(long)} before and * {@link ProtoOutputStream#end(long)} after. * Never reuse a proto field number. When removing a field, mark it as reserved. */ public void dumpDebug(ProtoOutputStream proto) { proto.write(NdefRecordProto.TYPE, mType); proto.write(NdefRecordProto.ID, mId); proto.write(NdefRecordProto.PAYLOAD_BYTES, mPayload.length); } private static StringBuilder bytesToString(byte[] bs) { StringBuilder s = new StringBuilder(); for (byte b : bs) { Loading
core/java/android/nfc/cardemulation/AidGroup.java +16 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.compat.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; import android.util.Log; import android.util.proto.ProtoOutputStream; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -117,6 +118,21 @@ public final class AidGroup implements Parcelable { return out.toString(); } /** * Dump debugging info as AidGroupProto * * If the output belongs to a sub message, the caller is responsible for wrapping this function * between {@link ProtoOutputStream#start(long)} and {@link ProtoOutputStream#end(long)}. * * @param proto the ProtoOutputStream to write to */ public void dump(ProtoOutputStream proto) { proto.write(AidGroupProto.CATEGORY, category); for (String aid : aids) { proto.write(AidGroupProto.AIDS, aid); } } @Override public int describeContents() { return 0; Loading
core/java/android/nfc/cardemulation/ApduServiceInfo.java +31 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.os.Parcelable; import android.util.AttributeSet; import android.util.Log; import android.util.Xml; import android.util.proto.ProtoOutputStream; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -607,4 +608,34 @@ public final class ApduServiceInfo implements Parcelable { } pw.println(" Settings Activity: " + mSettingsActivityName); } /** * Dump debugging info as ApduServiceInfoProto * * If the output belongs to a sub message, the caller is responsible for wrapping this function * between {@link ProtoOutputStream#start(long)} and {@link ProtoOutputStream#end(long)}. * See proto definition in frameworks/base/core/proto/android/nfc/apdu_service_info.proto * * @param proto the ProtoOutputStream to write to */ public void dumpDebug(ProtoOutputStream proto) { getComponent().dumpDebug(proto, ApduServiceInfoProto.COMPONENT_NAME); proto.write(ApduServiceInfoProto.DESCRIPTION, getDescription()); proto.write(ApduServiceInfoProto.ON_HOST, mOnHost); if (!mOnHost) { proto.write(ApduServiceInfoProto.OFF_HOST_NAME, mOffHostName); proto.write(ApduServiceInfoProto.STATIC_OFF_HOST_NAME, mStaticOffHostName); } for (AidGroup group : mStaticAidGroups.values()) { long token = proto.start(ApduServiceInfoProto.STATIC_AID_GROUPS); group.dump(proto); proto.end(token); } for (AidGroup group : mDynamicAidGroups.values()) { long token = proto.start(ApduServiceInfoProto.STATIC_AID_GROUPS); group.dump(proto); proto.end(token); } proto.write(ApduServiceInfoProto.SETTINGS_ACTIVITY_NAME, mSettingsActivityName); } }
core/java/android/nfc/cardemulation/NfcFServiceInfo.java +17 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ import android.os.Parcelable; import android.util.AttributeSet; import android.util.Log; import android.util.Xml; import android.util.proto.ProtoOutputStream; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; Loading Loading @@ -325,5 +326,21 @@ public final class NfcFServiceInfo implements Parcelable { pw.println(" NFCID2: " + getNfcid2()); pw.println(" T3tPmm: " + getT3tPmm()); } /** * Dump debugging info as NfcFServiceInfoProto * * If the output belongs to a sub message, the caller is responsible for wrapping this function * between {@link ProtoOutputStream#start(long)} and {@link ProtoOutputStream#end(long)}. * * @param proto the ProtoOutputStream to write to */ public void dumpDebug(ProtoOutputStream proto) { getComponent().dumpDebug(proto, NfcFServiceInfoProto.COMPONENT_NAME); proto.write(NfcFServiceInfoProto.DESCRIPTION, getDescription()); proto.write(NfcFServiceInfoProto.SYSTEM_CODE, getSystemCode()); proto.write(NfcFServiceInfoProto.NFCID2, getNfcid2()); proto.write(NfcFServiceInfoProto.T3T_PMM, getT3tPmm()); } }