Loading core/api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -11002,6 +11002,8 @@ package android.nfc.cardemulation { method @FlaggedApi("android.nfc.enable_nfc_mainline") public void setCategoryOtherServiceEnabled(boolean); 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.screen_state_attribute_toggle") public void setRequiresScreenOn(boolean); method @FlaggedApi("android.nfc.screen_state_attribute_toggle") public void setRequiresUnlock(boolean); method public void setShouldDefaultToObserveMode(boolean); method public boolean shouldDefaultToObserveMode(); method @FlaggedApi("android.nfc.nfc_associated_role_services") public boolean wantsRoleHolderPriority(); nfc-non-updatable/flags/flags.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -198,6 +198,14 @@ flag { bug: "380892385" } flag { name: "screen_state_attribute_toggle" is_exported: true namespace: "nfc" description: "API to toggle requireDeviceUnlock and requireDeviceScreenOn attributes for HCE service." bug: "417742419" } # Unless you are adding a flag for a file under nfc-non-updatable, you should # not add a flag here for Android 16+ targeting features. Use the flags # in com.android.nfc.module.flags (packages/modules/Nfc/flags) instead. nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java +22 −2 Original line number Diff line number Diff line Loading @@ -143,12 +143,12 @@ public final class ApduServiceInfo implements Parcelable { /** * Whether this service should only be started when the device is unlocked. */ private final boolean mRequiresDeviceUnlock; private boolean mRequiresDeviceUnlock; /** * Whether this service should only be started when the device is screen on. */ private final boolean mRequiresDeviceScreenOn; private boolean mRequiresDeviceScreenOn; /** * The id of the service banner specified in XML. Loading Loading @@ -747,6 +747,16 @@ public final class ApduServiceInfo implements Parcelable { return mRequiresDeviceUnlock; } /** * Sets whether this service should only be activated when the device is unlocked. * @param requiresUnlock True if the service should only be activated when the device is * unlocked, false otherwise. */ @FlaggedApi(Flags.FLAG_SCREEN_STATE_ATTRIBUTE_TOGGLE) public void setRequiresUnlock(boolean requiresUnlock) { mRequiresDeviceUnlock = requiresUnlock; } /** * Returns whether this service should only be started when the device is screen on. * @return whether the service requires screen on Loading @@ -756,6 +766,16 @@ public final class ApduServiceInfo implements Parcelable { return mRequiresDeviceScreenOn; } /** * Sets whether this service should only be activated when the device's screen is on. * @param requiresScreenOn True if the service should only be activated when the device's screen * is on, false otherwise */ @FlaggedApi(Flags.FLAG_SCREEN_STATE_ATTRIBUTE_TOGGLE) public void setRequiresScreenOn(boolean requiresScreenOn) { mRequiresDeviceScreenOn = requiresScreenOn; } /** * Returns whether the NFC stack should default to observe mode when this service is preferred. * @return whether the NFC stack should default to observe mode when this service is preferred Loading Loading
core/api/system-current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -11002,6 +11002,8 @@ package android.nfc.cardemulation { method @FlaggedApi("android.nfc.enable_nfc_mainline") public void setCategoryOtherServiceEnabled(boolean); 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.screen_state_attribute_toggle") public void setRequiresScreenOn(boolean); method @FlaggedApi("android.nfc.screen_state_attribute_toggle") public void setRequiresUnlock(boolean); method public void setShouldDefaultToObserveMode(boolean); method public boolean shouldDefaultToObserveMode(); method @FlaggedApi("android.nfc.nfc_associated_role_services") public boolean wantsRoleHolderPriority();
nfc-non-updatable/flags/flags.aconfig +8 −0 Original line number Diff line number Diff line Loading @@ -198,6 +198,14 @@ flag { bug: "380892385" } flag { name: "screen_state_attribute_toggle" is_exported: true namespace: "nfc" description: "API to toggle requireDeviceUnlock and requireDeviceScreenOn attributes for HCE service." bug: "417742419" } # Unless you are adding a flag for a file under nfc-non-updatable, you should # not add a flag here for Android 16+ targeting features. Use the flags # in com.android.nfc.module.flags (packages/modules/Nfc/flags) instead.
nfc-non-updatable/java/android/nfc/cardemulation/ApduServiceInfo.java +22 −2 Original line number Diff line number Diff line Loading @@ -143,12 +143,12 @@ public final class ApduServiceInfo implements Parcelable { /** * Whether this service should only be started when the device is unlocked. */ private final boolean mRequiresDeviceUnlock; private boolean mRequiresDeviceUnlock; /** * Whether this service should only be started when the device is screen on. */ private final boolean mRequiresDeviceScreenOn; private boolean mRequiresDeviceScreenOn; /** * The id of the service banner specified in XML. Loading Loading @@ -747,6 +747,16 @@ public final class ApduServiceInfo implements Parcelable { return mRequiresDeviceUnlock; } /** * Sets whether this service should only be activated when the device is unlocked. * @param requiresUnlock True if the service should only be activated when the device is * unlocked, false otherwise. */ @FlaggedApi(Flags.FLAG_SCREEN_STATE_ATTRIBUTE_TOGGLE) public void setRequiresUnlock(boolean requiresUnlock) { mRequiresDeviceUnlock = requiresUnlock; } /** * Returns whether this service should only be started when the device is screen on. * @return whether the service requires screen on Loading @@ -756,6 +766,16 @@ public final class ApduServiceInfo implements Parcelable { return mRequiresDeviceScreenOn; } /** * Sets whether this service should only be activated when the device's screen is on. * @param requiresScreenOn True if the service should only be activated when the device's screen * is on, false otherwise */ @FlaggedApi(Flags.FLAG_SCREEN_STATE_ATTRIBUTE_TOGGLE) public void setRequiresScreenOn(boolean requiresScreenOn) { mRequiresDeviceScreenOn = requiresScreenOn; } /** * Returns whether the NFC stack should default to observe mode when this service is preferred. * @return whether the NFC stack should default to observe mode when this service is preferred Loading