Loading core/java/android/nfc/cardemulation/HostNfcFService.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -64,6 +64,7 @@ import android.util.Log; * android:description="@string/servicedesc"> * android:description="@string/servicedesc"> * <system-code-filter android:name="4000"/> * <system-code-filter android:name="4000"/> * <nfcid2-filter android:name="02FE000000000000"/> * <nfcid2-filter android:name="02FE000000000000"/> <t3tPmm-filter android:name="FFFFFFFFFFFFFFFF"/> * </host-nfcf-service> * </host-nfcf-service> * </pre> * </pre> * * Loading @@ -76,6 +77,7 @@ import android.util.Log; * <ul> * <ul> * <li>Exactly one {@link android.R.styleable#SystemCodeFilter <system-code-filter>} tag.</li> * <li>Exactly one {@link android.R.styleable#SystemCodeFilter <system-code-filter>} tag.</li> * <li>Exactly one {@link android.R.styleable#Nfcid2Filter <nfcid2-filter>} tag.</li> * <li>Exactly one {@link android.R.styleable#Nfcid2Filter <nfcid2-filter>} tag.</li> * <li>Zero or one {@link android.R.styleable#T3tPmmFilter <t3tPmm-filter>} tag.</li> * </ul> * </ul> * </p> * </p> * * Loading core/java/android/nfc/cardemulation/NfcFServiceInfo.java +31 −4 Original line number Original line Diff line number Diff line Loading @@ -18,9 +18,9 @@ package android.nfc.cardemulation; import android.content.ComponentName; import android.content.ComponentName; import android.content.pm.PackageManager; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.pm.ServiceInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.content.res.XmlResourceParser; Loading Loading @@ -79,12 +79,17 @@ public final class NfcFServiceInfo implements Parcelable { */ */ final int mUid; final int mUid; /** * LF_T3T_PMM of the service */ final String mT3tPmm; /** /** * @hide * @hide */ */ public NfcFServiceInfo(ResolveInfo info, String description, public NfcFServiceInfo(ResolveInfo info, String description, String systemCode, String dynamicSystemCode, String nfcid2, String dynamicNfcid2, String systemCode, String dynamicSystemCode, String nfcid2, String dynamicNfcid2, int uid) { int uid, String t3tPmm) { this.mService = info; this.mService = info; this.mDescription = description; this.mDescription = description; this.mSystemCode = systemCode; this.mSystemCode = systemCode; Loading @@ -92,6 +97,7 @@ public final class NfcFServiceInfo implements Parcelable { this.mNfcid2 = nfcid2; this.mNfcid2 = nfcid2; this.mDynamicNfcid2 = dynamicNfcid2; this.mDynamicNfcid2 = dynamicNfcid2; this.mUid = uid; this.mUid = uid; this.mT3tPmm = t3tPmm; } } public NfcFServiceInfo(PackageManager pm, ResolveInfo info) public NfcFServiceInfo(PackageManager pm, ResolveInfo info) Loading Loading @@ -130,6 +136,7 @@ public final class NfcFServiceInfo implements Parcelable { String systemCode = null; String systemCode = null; String nfcid2 = null; String nfcid2 = null; String t3tPmm = null; final int depth = parser.getDepth(); final int depth = parser.getDepth(); while (((eventType = parser.next()) != XmlPullParser.END_TAG || while (((eventType = parser.next()) != XmlPullParser.END_TAG || Loading Loading @@ -160,10 +167,22 @@ public final class NfcFServiceInfo implements Parcelable { nfcid2 = null; nfcid2 = null; } } a.recycle(); a.recycle(); } else if (eventType == XmlPullParser.START_TAG && tagName.equals("t3tPmm-filter") && t3tPmm == null) { final TypedArray a = res.obtainAttributes(attrs, com.android.internal.R.styleable.T3tPmmFilter); t3tPmm = a.getString( com.android.internal.R.styleable.T3tPmmFilter_name).toUpperCase(); if (t3tPmm == null) { String defaultT3tPmm = "FFFFFFFFFFFFFFFF"; t3tPmm = defaultT3tPmm; } a.recycle(); } } } } mSystemCode = (systemCode == null ? "NULL" : systemCode); mSystemCode = (systemCode == null ? "NULL" : systemCode); mNfcid2 = (nfcid2 == null ? "NULL" : nfcid2); mNfcid2 = (nfcid2 == null ? "NULL" : nfcid2); mT3tPmm = (t3tPmm == null ? "NULL" : t3tPmm); } catch (NameNotFoundException e) { } catch (NameNotFoundException e) { throw new XmlPullParserException("Unable to create context for: " + si.packageName); throw new XmlPullParserException("Unable to create context for: " + si.packageName); } finally { } finally { Loading Loading @@ -202,6 +221,10 @@ public final class NfcFServiceInfo implements Parcelable { return mUid; return mUid; } } public String getT3tPmm() { return mT3tPmm; } public CharSequence loadLabel(PackageManager pm) { public CharSequence loadLabel(PackageManager pm) { return mService.loadLabel(pm); return mService.loadLabel(pm); } } Loading @@ -223,6 +246,7 @@ public final class NfcFServiceInfo implements Parcelable { if (mDynamicNfcid2 != null) { if (mDynamicNfcid2 != null) { out.append(", dynamic NFCID2: " + mDynamicNfcid2); out.append(", dynamic NFCID2: " + mDynamicNfcid2); } } out.append(", T3T PMM:" + mT3tPmm); return out.toString(); return out.toString(); } } Loading @@ -235,7 +259,7 @@ public final class NfcFServiceInfo implements Parcelable { if (!thatService.getComponent().equals(this.getComponent())) return false; if (!thatService.getComponent().equals(this.getComponent())) return false; if (!thatService.mSystemCode.equalsIgnoreCase(this.mSystemCode)) return false; if (!thatService.mSystemCode.equalsIgnoreCase(this.mSystemCode)) return false; if (!thatService.mNfcid2.equalsIgnoreCase(this.mNfcid2)) return false; if (!thatService.mNfcid2.equalsIgnoreCase(this.mNfcid2)) return false; if (!thatService.mT3tPmm.equalsIgnoreCase(this.mT3tPmm)) return false; return true; return true; } } Loading Loading @@ -264,6 +288,7 @@ public final class NfcFServiceInfo implements Parcelable { dest.writeString(mDynamicNfcid2); dest.writeString(mDynamicNfcid2); } } dest.writeInt(mUid); dest.writeInt(mUid); dest.writeString(mT3tPmm); }; }; public static final Parcelable.Creator<NfcFServiceInfo> CREATOR = public static final Parcelable.Creator<NfcFServiceInfo> CREATOR = Loading @@ -283,8 +308,9 @@ public final class NfcFServiceInfo implements Parcelable { dynamicNfcid2 = source.readString(); dynamicNfcid2 = source.readString(); } } int uid = source.readInt(); int uid = source.readInt(); String t3tPmm = source.readString(); NfcFServiceInfo service = new NfcFServiceInfo(info, description, NfcFServiceInfo service = new NfcFServiceInfo(info, description, systemCode, dynamicSystemCode, nfcid2, dynamicNfcid2, uid); systemCode, dynamicSystemCode, nfcid2, dynamicNfcid2, uid, t3tPmm); return service; return service; } } Loading @@ -299,6 +325,7 @@ public final class NfcFServiceInfo implements Parcelable { " (Description: " + getDescription() + ")"); " (Description: " + getDescription() + ")"); pw.println(" System Code: " + getSystemCode()); pw.println(" System Code: " + getSystemCode()); pw.println(" NFCID2: " + getNfcid2()); pw.println(" NFCID2: " + getNfcid2()); pw.println(" T3tPmm: " + getT3tPmm()); } } } } core/res/res/values/attrs.xml +7 −0 Original line number Original line Diff line number Diff line Loading @@ -3619,6 +3619,13 @@ <attr name="name" /> <attr name="name" /> </declare-styleable> </declare-styleable> <!-- Specify one or more <code>t3tPmm-filter</code> elements inside a <code>host-nfcf-service</code> element to specify a LF_T3T_PMM --> <declare-styleable name="T3tPmmFilter"> <attr name="name" /> </declare-styleable> <declare-styleable name="ActionMenuItemView"> <declare-styleable name="ActionMenuItemView"> <attr name="minWidth" /> <attr name="minWidth" /> </declare-styleable> </declare-styleable> Loading Loading
core/java/android/nfc/cardemulation/HostNfcFService.java +2 −0 Original line number Original line Diff line number Diff line Loading @@ -64,6 +64,7 @@ import android.util.Log; * android:description="@string/servicedesc"> * android:description="@string/servicedesc"> * <system-code-filter android:name="4000"/> * <system-code-filter android:name="4000"/> * <nfcid2-filter android:name="02FE000000000000"/> * <nfcid2-filter android:name="02FE000000000000"/> <t3tPmm-filter android:name="FFFFFFFFFFFFFFFF"/> * </host-nfcf-service> * </host-nfcf-service> * </pre> * </pre> * * Loading @@ -76,6 +77,7 @@ import android.util.Log; * <ul> * <ul> * <li>Exactly one {@link android.R.styleable#SystemCodeFilter <system-code-filter>} tag.</li> * <li>Exactly one {@link android.R.styleable#SystemCodeFilter <system-code-filter>} tag.</li> * <li>Exactly one {@link android.R.styleable#Nfcid2Filter <nfcid2-filter>} tag.</li> * <li>Exactly one {@link android.R.styleable#Nfcid2Filter <nfcid2-filter>} tag.</li> * <li>Zero or one {@link android.R.styleable#T3tPmmFilter <t3tPmm-filter>} tag.</li> * </ul> * </ul> * </p> * </p> * * Loading
core/java/android/nfc/cardemulation/NfcFServiceInfo.java +31 −4 Original line number Original line Diff line number Diff line Loading @@ -18,9 +18,9 @@ package android.nfc.cardemulation; import android.content.ComponentName; import android.content.ComponentName; import android.content.pm.PackageManager; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; import android.content.pm.ServiceInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Resources; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.content.res.XmlResourceParser; Loading Loading @@ -79,12 +79,17 @@ public final class NfcFServiceInfo implements Parcelable { */ */ final int mUid; final int mUid; /** * LF_T3T_PMM of the service */ final String mT3tPmm; /** /** * @hide * @hide */ */ public NfcFServiceInfo(ResolveInfo info, String description, public NfcFServiceInfo(ResolveInfo info, String description, String systemCode, String dynamicSystemCode, String nfcid2, String dynamicNfcid2, String systemCode, String dynamicSystemCode, String nfcid2, String dynamicNfcid2, int uid) { int uid, String t3tPmm) { this.mService = info; this.mService = info; this.mDescription = description; this.mDescription = description; this.mSystemCode = systemCode; this.mSystemCode = systemCode; Loading @@ -92,6 +97,7 @@ public final class NfcFServiceInfo implements Parcelable { this.mNfcid2 = nfcid2; this.mNfcid2 = nfcid2; this.mDynamicNfcid2 = dynamicNfcid2; this.mDynamicNfcid2 = dynamicNfcid2; this.mUid = uid; this.mUid = uid; this.mT3tPmm = t3tPmm; } } public NfcFServiceInfo(PackageManager pm, ResolveInfo info) public NfcFServiceInfo(PackageManager pm, ResolveInfo info) Loading Loading @@ -130,6 +136,7 @@ public final class NfcFServiceInfo implements Parcelable { String systemCode = null; String systemCode = null; String nfcid2 = null; String nfcid2 = null; String t3tPmm = null; final int depth = parser.getDepth(); final int depth = parser.getDepth(); while (((eventType = parser.next()) != XmlPullParser.END_TAG || while (((eventType = parser.next()) != XmlPullParser.END_TAG || Loading Loading @@ -160,10 +167,22 @@ public final class NfcFServiceInfo implements Parcelable { nfcid2 = null; nfcid2 = null; } } a.recycle(); a.recycle(); } else if (eventType == XmlPullParser.START_TAG && tagName.equals("t3tPmm-filter") && t3tPmm == null) { final TypedArray a = res.obtainAttributes(attrs, com.android.internal.R.styleable.T3tPmmFilter); t3tPmm = a.getString( com.android.internal.R.styleable.T3tPmmFilter_name).toUpperCase(); if (t3tPmm == null) { String defaultT3tPmm = "FFFFFFFFFFFFFFFF"; t3tPmm = defaultT3tPmm; } a.recycle(); } } } } mSystemCode = (systemCode == null ? "NULL" : systemCode); mSystemCode = (systemCode == null ? "NULL" : systemCode); mNfcid2 = (nfcid2 == null ? "NULL" : nfcid2); mNfcid2 = (nfcid2 == null ? "NULL" : nfcid2); mT3tPmm = (t3tPmm == null ? "NULL" : t3tPmm); } catch (NameNotFoundException e) { } catch (NameNotFoundException e) { throw new XmlPullParserException("Unable to create context for: " + si.packageName); throw new XmlPullParserException("Unable to create context for: " + si.packageName); } finally { } finally { Loading Loading @@ -202,6 +221,10 @@ public final class NfcFServiceInfo implements Parcelable { return mUid; return mUid; } } public String getT3tPmm() { return mT3tPmm; } public CharSequence loadLabel(PackageManager pm) { public CharSequence loadLabel(PackageManager pm) { return mService.loadLabel(pm); return mService.loadLabel(pm); } } Loading @@ -223,6 +246,7 @@ public final class NfcFServiceInfo implements Parcelable { if (mDynamicNfcid2 != null) { if (mDynamicNfcid2 != null) { out.append(", dynamic NFCID2: " + mDynamicNfcid2); out.append(", dynamic NFCID2: " + mDynamicNfcid2); } } out.append(", T3T PMM:" + mT3tPmm); return out.toString(); return out.toString(); } } Loading @@ -235,7 +259,7 @@ public final class NfcFServiceInfo implements Parcelable { if (!thatService.getComponent().equals(this.getComponent())) return false; if (!thatService.getComponent().equals(this.getComponent())) return false; if (!thatService.mSystemCode.equalsIgnoreCase(this.mSystemCode)) return false; if (!thatService.mSystemCode.equalsIgnoreCase(this.mSystemCode)) return false; if (!thatService.mNfcid2.equalsIgnoreCase(this.mNfcid2)) return false; if (!thatService.mNfcid2.equalsIgnoreCase(this.mNfcid2)) return false; if (!thatService.mT3tPmm.equalsIgnoreCase(this.mT3tPmm)) return false; return true; return true; } } Loading Loading @@ -264,6 +288,7 @@ public final class NfcFServiceInfo implements Parcelable { dest.writeString(mDynamicNfcid2); dest.writeString(mDynamicNfcid2); } } dest.writeInt(mUid); dest.writeInt(mUid); dest.writeString(mT3tPmm); }; }; public static final Parcelable.Creator<NfcFServiceInfo> CREATOR = public static final Parcelable.Creator<NfcFServiceInfo> CREATOR = Loading @@ -283,8 +308,9 @@ public final class NfcFServiceInfo implements Parcelable { dynamicNfcid2 = source.readString(); dynamicNfcid2 = source.readString(); } } int uid = source.readInt(); int uid = source.readInt(); String t3tPmm = source.readString(); NfcFServiceInfo service = new NfcFServiceInfo(info, description, NfcFServiceInfo service = new NfcFServiceInfo(info, description, systemCode, dynamicSystemCode, nfcid2, dynamicNfcid2, uid); systemCode, dynamicSystemCode, nfcid2, dynamicNfcid2, uid, t3tPmm); return service; return service; } } Loading @@ -299,6 +325,7 @@ public final class NfcFServiceInfo implements Parcelable { " (Description: " + getDescription() + ")"); " (Description: " + getDescription() + ")"); pw.println(" System Code: " + getSystemCode()); pw.println(" System Code: " + getSystemCode()); pw.println(" NFCID2: " + getNfcid2()); pw.println(" NFCID2: " + getNfcid2()); pw.println(" T3tPmm: " + getT3tPmm()); } } } }
core/res/res/values/attrs.xml +7 −0 Original line number Original line Diff line number Diff line Loading @@ -3619,6 +3619,13 @@ <attr name="name" /> <attr name="name" /> </declare-styleable> </declare-styleable> <!-- Specify one or more <code>t3tPmm-filter</code> elements inside a <code>host-nfcf-service</code> element to specify a LF_T3T_PMM --> <declare-styleable name="T3tPmmFilter"> <attr name="name" /> </declare-styleable> <declare-styleable name="ActionMenuItemView"> <declare-styleable name="ActionMenuItemView"> <attr name="minWidth" /> <attr name="minWidth" /> </declare-styleable> </declare-styleable> Loading