Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fda2f09 authored by James Willcox's avatar James Willcox Committed by ziyiw
Browse files

Add support for NFC associated role services

This allows NFC APDU services to opt-in to sharing the same priority as
the role owner if the containing package and the role owner have the
same package signature. The is useful for apps that have these types of
services spread amongst multiple packages.

Bug: 366243361
Test: atest RegisteredAidCacheTest
Flag: android.nfc.nfc_associated_role_services

Merged-In: Id1ff0a7dbef12283a135508d43f66148c08fbba3
Change-Id: Id1ff0a7dbef12283a135508d43f66148c08fbba3
parent 642e90e9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1491,6 +1491,7 @@ package android {
    field public static final int shadowRadius = 16843108; // 0x1010164
    field public static final int shape = 16843162; // 0x101019a
    field public static final int shareInterpolator = 16843195; // 0x10101bb
    field @FlaggedApi("android.nfc.nfc_associated_role_services") public static final int shareRolePriority;
    field @Deprecated public static final int sharedUserId = 16842763; // 0x101000b
    field @Deprecated public static final int sharedUserLabel = 16843361; // 0x1010261
    field public static final int sharedUserMaxSdkVersion = 16844365; // 0x101064d
+1 −0
Original line number Diff line number Diff line
@@ -10484,6 +10484,7 @@ package android.nfc.cardemulation {
    method @FlaggedApi("android.nfc.enable_nfc_mainline") public void setDynamicAidGroup(@NonNull android.nfc.cardemulation.AidGroup);
    method @FlaggedApi("android.nfc.enable_nfc_mainline") public void setOffHostSecureElement(@NonNull String);
    method @FlaggedApi("android.nfc.nfc_observe_mode") public void setShouldDefaultToObserveMode(boolean);
    method @FlaggedApi("android.nfc.nfc_associated_role_services") public boolean shareRolePriority();
    method @FlaggedApi("android.nfc.nfc_observe_mode") public boolean shouldDefaultToObserveMode();
    method @FlaggedApi("android.nfc.enable_nfc_mainline") public void writeToParcel(@NonNull android.os.Parcel, int);
    field @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public static final android.os.Parcelable.Creator<android.nfc.cardemulation.ApduServiceInfo> CREATOR;
+7 −0
Original line number Diff line number Diff line
@@ -4460,6 +4460,12 @@
        <!-- Whether the device should default to observe mode when this service is
             default or in the foreground. -->
        <attr name="shouldDefaultToObserveMode" format="boolean"/>
        <!-- Whether this service should share the same AID routing priority as the role
             owner. This package and the role owner must have the same signature, and the
             role owner must opt into this behavior by using the property named by
             {@link android.nfc.cardemulation.CardEmulation.PROPERTY_ALLOW_SHARED_ROLE_PRIORITY }
             in the <code>&lt;application&rt;</code> tag. -->
        <attr name="shareRolePriority" format="boolean"/>
    </declare-styleable>
    <!-- Use <code>offhost-apdu-service</code> as the root tag of the XML resource that
@@ -4487,6 +4493,7 @@
        <!-- Whether the device should default to observe mode when this service is
             default or in the foreground. -->
        <attr name="shouldDefaultToObserveMode"/>
        <attr name="shareRolePriority"/>
    </declare-styleable>
    <!-- Specify one or more <code>aid-group</code> elements inside a
+2 −0
Original line number Diff line number Diff line
@@ -118,6 +118,8 @@
    <public name="languageSettingsActivity"/>
    <!-- @FlaggedApi("android.service.controls.flags.Flags.FLAG_HOME_PANEL_DREAM") -->
    <public name="dreamCategory"/>
    <!-- @FlaggedApi(android.nfc.Flags.FLAG_NFC_ASSOCIATED_ROLE_SERVICES) -->
    <public name="shareRolePriority"/>
  </staging-public-group>

  <staging-public-group type="id" first-id="0x01b60000">
+1 −0
Original line number Diff line number Diff line
@@ -233,6 +233,7 @@ package android.nfc.cardemulation {
    field @FlaggedApi("android.nfc.nfc_event_listener") public static final int NFC_INTERNAL_ERROR_NFC_CRASH_RESTART = 1; // 0x1
    field @FlaggedApi("android.nfc.nfc_event_listener") public static final int NFC_INTERNAL_ERROR_NFC_HARDWARE_ERROR = 2; // 0x2
    field @FlaggedApi("android.nfc.nfc_event_listener") public static final int NFC_INTERNAL_ERROR_UNKNOWN = 0; // 0x0
    field @FlaggedApi("android.nfc.nfc_associated_role_services") public static final String PROPERTY_ALLOW_SHARED_ROLE_PRIORITY = "android.nfc.cardemulation.PROPERTY_ALLOW_SHARED_ROLE_PRIORITY";
    field @FlaggedApi("android.nfc.nfc_override_recover_routing_table") public static final int PROTOCOL_AND_TECHNOLOGY_ROUTE_DEFAULT = 3; // 0x3
    field @FlaggedApi("android.nfc.nfc_override_recover_routing_table") public static final int PROTOCOL_AND_TECHNOLOGY_ROUTE_DH = 0; // 0x0
    field @FlaggedApi("android.nfc.nfc_override_recover_routing_table") public static final int PROTOCOL_AND_TECHNOLOGY_ROUTE_ESE = 1; // 0x1
Loading