diff options
| author | 2024-02-15 17:12:03 -0500 | |
|---|---|---|
| committer | 2024-02-17 16:21:31 +0000 | |
| commit | b23955e748b0d2f273bc9a3fd8441e5b27f85197 (patch) | |
| tree | 4cbbc00278bf5e7f6bf02d3d2c4251939f5b731a | |
| parent | 9e73f1dba6d234c8e860de9cc681dfec7d964356 (diff) | |
Rename setServiceObserveModeDefault() to
setDefaultToObserveModeForService to address API feedback
Bug: b/315131060
Test: Tested by running cts tests
Change-Id: I110dc72bc5d820fbd483b6f40936903a53490084
| -rw-r--r-- | nfc/api/current.txt | 2 | ||||
| -rw-r--r-- | nfc/java/android/nfc/INfcCardEmulation.aidl | 2 | ||||
| -rw-r--r-- | nfc/java/android/nfc/cardemulation/CardEmulation.java | 15 |
3 files changed, 10 insertions, 9 deletions
diff --git a/nfc/api/current.txt b/nfc/api/current.txt index 845a8f97db10..f111327ef619 100644 --- a/nfc/api/current.txt +++ b/nfc/api/current.txt @@ -206,9 +206,9 @@ package android.nfc.cardemulation { method public boolean registerAidsForService(android.content.ComponentName, String, java.util.List<java.lang.String>); method @FlaggedApi("android.nfc.nfc_read_polling_loop") public boolean registerPollingLoopFilterForService(@NonNull android.content.ComponentName, @NonNull String); method public boolean removeAidsForService(android.content.ComponentName, String); + method @FlaggedApi("android.nfc.nfc_observe_mode") public boolean setDefaultToObserveModeForService(@NonNull android.content.ComponentName, boolean); method @NonNull @RequiresPermission(android.Manifest.permission.NFC) public boolean setOffHostForService(@NonNull android.content.ComponentName, @NonNull String); method public boolean setPreferredService(android.app.Activity, android.content.ComponentName); - method @FlaggedApi("android.nfc.nfc_observe_mode") public boolean setServiceObserveModeDefault(@NonNull android.content.ComponentName, boolean); method public boolean supportsAidPrefixRegistration(); method @NonNull @RequiresPermission(android.Manifest.permission.NFC) public boolean unsetOffHostForService(@NonNull android.content.ComponentName); method public boolean unsetPreferredService(android.app.Activity); diff --git a/nfc/java/android/nfc/INfcCardEmulation.aidl b/nfc/java/android/nfc/INfcCardEmulation.aidl index 791bd8c9e6f4..65d0625f251e 100644 --- a/nfc/java/android/nfc/INfcCardEmulation.aidl +++ b/nfc/java/android/nfc/INfcCardEmulation.aidl @@ -30,7 +30,7 @@ interface INfcCardEmulation boolean isDefaultServiceForAid(int userHandle, in ComponentName service, String aid); boolean setDefaultServiceForCategory(int userHandle, in ComponentName service, String category); boolean setDefaultForNextTap(int userHandle, in ComponentName service); - boolean setServiceObserveModeDefault(int userId, in android.content.ComponentName service, boolean enable); + boolean setDefaultToObserveModeForService(int userId, in android.content.ComponentName service, boolean enable); boolean registerAidGroupForService(int userHandle, in ComponentName service, in AidGroup aidGroup); boolean registerPollingLoopFilterForService(int userHandle, in ComponentName service, in String pollingLoopFilter); boolean setOffHostForService(int userHandle, in ComponentName service, in String offHostSecureElement); diff --git a/nfc/java/android/nfc/cardemulation/CardEmulation.java b/nfc/java/android/nfc/cardemulation/CardEmulation.java index 53288cc032a8..e681a8568300 100644 --- a/nfc/java/android/nfc/cardemulation/CardEmulation.java +++ b/nfc/java/android/nfc/cardemulation/CardEmulation.java @@ -338,19 +338,20 @@ public final class CardEmulation { } } /** - * Sets whether the system should default to observe mode or not when the service is in the - * foreground or the default payment service. The default is to not enable observe mode when - * a service either the foreground default service or the default payment service so not - * calling this method will preserve that behavior. + * Sets whether when this service becomes the preferred service, if the NFC stack + * should enable observe mode or disable observe mode. The default is to not enable observe + * mode when a service either the foreground default service or the default payment service so + * not calling this method will preserve that behavior. * * @param service The component name of the service - * @param enable Whether the servic should default to observe mode or not + * @param enable Whether the service should default to observe mode or not * @return whether the change was successful. */ @FlaggedApi(Flags.FLAG_NFC_OBSERVE_MODE) - public boolean setServiceObserveModeDefault(@NonNull ComponentName service, boolean enable) { + public boolean setDefaultToObserveModeForService(@NonNull ComponentName service, + boolean enable) { try { - return sService.setServiceObserveModeDefault(mContext.getUser().getIdentifier(), + return sService.setDefaultToObserveModeForService(mContext.getUser().getIdentifier(), service, enable); } catch (RemoteException e) { Log.e(TAG, "Failed to reach CardEmulationService."); |