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

Commit b23955e7 authored by Brad Lassey's avatar Brad Lassey
Browse files

Rename setServiceObserveModeDefault() to

setDefaultToObserveModeForService to address API feedback

Bug: b/315131060
Test: Tested by running cts tests
Change-Id: I110dc72bc5d820fbd483b6f40936903a53490084
parent 9e73f1db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
+8 −7
Original line number Diff line number Diff line
@@ -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.");