diff options
| author | 2024-02-26 14:59:47 -0500 | |
|---|---|---|
| committer | 2024-02-28 01:04:39 +0000 | |
| commit | 776bb064284ae9265adee6f2c5ee1f7c707d4c8c (patch) | |
| tree | 1ae80cb082c5633807e9826059de7583d69f8192 | |
| parent | 0491bba4b4778c401a8772372a08b18b7946bca6 (diff) | |
Rename defaultToObserveMode to shouldDefaultToObserveMode
Bug: b/326419514
Test: Updated and ran the CTS test
Change-Id: If7b5935bd531a824ecb3f938d0e8f63de24dba10
| -rw-r--r-- | core/api/current.txt | 2 | ||||
| -rw-r--r-- | core/api/system-current.txt | 4 | ||||
| -rw-r--r-- | core/res/res/values/attrs.xml | 4 | ||||
| -rw-r--r-- | core/res/res/values/public-staging.xml | 2 | ||||
| -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/ApduServiceInfo.java | 28 | ||||
| -rw-r--r-- | nfc/java/android/nfc/cardemulation/CardEmulation.java | 6 |
8 files changed, 25 insertions, 25 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 386396c67c71..7a3908e4fb17 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -691,7 +691,6 @@ package android { field public static final int defaultHeight = 16844021; // 0x10104f5 field @FlaggedApi("android.content.res.default_locale") public static final int defaultLocale; field public static final int defaultToDeviceProtectedStorage = 16844036; // 0x1010504 - field @FlaggedApi("android.nfc.Flags.FLAG_OBSERVE_MODE") public static final int defaultToObserveMode; field public static final int defaultValue = 16843245; // 0x10101ed field public static final int defaultWidth = 16844020; // 0x10104f4 field public static final int delay = 16843212; // 0x10101cc @@ -1501,6 +1500,7 @@ package android { field public static final int shortcutId = 16844072; // 0x1010528 field public static final int shortcutLongLabel = 16844074; // 0x101052a field public static final int shortcutShortLabel = 16844073; // 0x1010529 + field @FlaggedApi("android.nfc.Flags.FLAG_OBSERVE_MODE") public static final int shouldDefaultToObserveMode; field public static final int shouldDisableView = 16843246; // 0x10101ee field public static final int shouldUseDefaultUnfoldTransition = 16844364; // 0x101064c field public static final int showAsAction = 16843481; // 0x10102d9 diff --git a/core/api/system-current.txt b/core/api/system-current.txt index d9b5d56544d6..03f1e45eb3ec 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -10422,7 +10422,6 @@ package android.nfc.cardemulation { @FlaggedApi("android.nfc.enable_nfc_mainline") public final class ApduServiceInfo implements android.os.Parcelable { ctor @FlaggedApi("android.nfc.enable_nfc_mainline") public ApduServiceInfo(@NonNull android.content.pm.PackageManager, @NonNull android.content.pm.ResolveInfo, boolean) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; method @FlaggedApi("android.nfc.nfc_read_polling_loop") public void addPollingLoopFilter(@NonNull String, boolean); - method @FlaggedApi("android.nfc.nfc_observe_mode") public boolean defaultToObserveMode(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public int describeContents(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void dump(@NonNull android.os.ParcelFileDescriptor, @NonNull java.io.PrintWriter, @NonNull String[]); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void dumpDebug(@NonNull android.util.proto.ProtoOutputStream); @@ -10452,9 +10451,10 @@ package android.nfc.cardemulation { method @FlaggedApi("android.nfc.enable_nfc_mainline") public boolean requiresUnlock(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void resetOffHostSecureElement(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void setCategoryOtherServiceEnabled(boolean); - method @FlaggedApi("android.nfc.nfc_observe_mode") public void setDefaultToObserveMode(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.nfc_observe_mode") public void setShouldDefaultToObserveMode(boolean); + 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; } diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index c1fd61948e68..48cf09a84e57 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -4409,7 +4409,7 @@ <attr name="requireDeviceScreenOn" format="boolean"/> <!-- Whether the device should default to observe mode when this service is default or in the foreground. --> - <attr name="defaultToObserveMode" format="boolean"/> + <attr name="shouldDefaultToObserveMode" format="boolean"/> </declare-styleable> <!-- Use <code>offhost-apdu-service</code> as the root tag of the XML resource that @@ -4436,7 +4436,7 @@ <attr name="requireDeviceScreenOn"/> <!-- Whether the device should default to observe mode when this service is default or in the foreground. --> - <attr name="defaultToObserveMode"/> + <attr name="shouldDefaultToObserveMode"/> </declare-styleable> <!-- Specify one or more <code>aid-group</code> elements inside a diff --git a/core/res/res/values/public-staging.xml b/core/res/res/values/public-staging.xml index 5987f6ea05d4..3303c076c090 100644 --- a/core/res/res/values/public-staging.xml +++ b/core/res/res/values/public-staging.xml @@ -160,7 +160,7 @@ <!-- @FlaggedApi("android.view.inputmethod.connectionless_handwriting") --> <public name="supportsConnectionlessStylusHandwriting" /> <!-- @FlaggedApi("android.nfc.Flags.FLAG_OBSERVE_MODE") --> - <public name="defaultToObserveMode"/> + <public name="shouldDefaultToObserveMode"/> <!-- @FlaggedApi("android.security.asm_restrictions_enabled") --> <public name="allowCrossUidActivitySwitchFromBelow"/> <!-- @FlaggedApi("com.android.text.flags.use_bounds_for_width") --> diff --git a/nfc/api/current.txt b/nfc/api/current.txt index 0fb7c95e3680..9d0221a3ae68 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, boolean); 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 setShouldDefaultToObserveModeForService(@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 64f7fa44c12f..85a07b74871b 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 setDefaultToObserveModeForService(int userId, in android.content.ComponentName service, boolean enable); + boolean setShouldDefaultToObserveModeForService(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 autoTransact); boolean setOffHostForService(int userHandle, in ComponentName service, in String offHostSecureElement); diff --git a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java index e62e37bd4ca0..2c7d61eea777 100644 --- a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java +++ b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java @@ -141,7 +141,7 @@ public final class ApduServiceInfo implements Parcelable { /** * Whether the NFC stack should default to Observe Mode when this preferred service. */ - private boolean mDefaultToObserveMode; + private boolean mShouldDefaultToObserveMode; /** * @hide @@ -275,8 +275,8 @@ public final class ApduServiceInfo implements Parcelable { com.android.internal.R.styleable.HostApduService_settingsActivity); mOffHostName = null; mStaticOffHostName = mOffHostName; - mDefaultToObserveMode = sa.getBoolean( - R.styleable.HostApduService_defaultToObserveMode, + mShouldDefaultToObserveMode = sa.getBoolean( + R.styleable.HostApduService_shouldDefaultToObserveMode, false); sa.recycle(); } else { @@ -297,8 +297,8 @@ public final class ApduServiceInfo implements Parcelable { com.android.internal.R.styleable.HostApduService_settingsActivity); mOffHostName = sa.getString( com.android.internal.R.styleable.OffHostApduService_secureElementName); - mDefaultToObserveMode = sa.getBoolean( - R.styleable.HostApduService_defaultToObserveMode, + mShouldDefaultToObserveMode = sa.getBoolean( + R.styleable.HostApduService_shouldDefaultToObserveMode, false); if (mOffHostName != null) { if (mOffHostName.equals("eSE")) { @@ -633,22 +633,22 @@ public final class ApduServiceInfo implements Parcelable { } /** - * Returns whether the NFC stack should default to observe mode when this servise is preferred. - * @return whether the NFC stack should default to observe mode when this servise is preferred + * 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 */ @FlaggedApi(Flags.FLAG_NFC_OBSERVE_MODE) - public boolean defaultToObserveMode() { - return mDefaultToObserveMode; + public boolean shouldDefaultToObserveMode() { + return mShouldDefaultToObserveMode; } /** - * Sets whether the NFC stack should default to observe mode when this servise is preferred. - * @param defaultToObserveMode whether the NFC stack should default to observe mode when this - * servise is preferred + * Sets whether the NFC stack should default to observe mode when this service is preferred. + * @param shouldDefaultToObserveMode whether the NFC stack should default to observe mode when + * this service is preferred */ @FlaggedApi(Flags.FLAG_NFC_OBSERVE_MODE) - public void setDefaultToObserveMode(boolean defaultToObserveMode) { - mDefaultToObserveMode = defaultToObserveMode; + public void setShouldDefaultToObserveMode(boolean shouldDefaultToObserveMode) { + mShouldDefaultToObserveMode = shouldDefaultToObserveMode; } /** diff --git a/nfc/java/android/nfc/cardemulation/CardEmulation.java b/nfc/java/android/nfc/cardemulation/CardEmulation.java index 47ddd9de224f..ea58504063d7 100644 --- a/nfc/java/android/nfc/cardemulation/CardEmulation.java +++ b/nfc/java/android/nfc/cardemulation/CardEmulation.java @@ -348,11 +348,11 @@ public final class CardEmulation { * @return whether the change was successful. */ @FlaggedApi(Flags.FLAG_NFC_OBSERVE_MODE) - public boolean setDefaultToObserveModeForService(@NonNull ComponentName service, + public boolean setShouldDefaultToObserveModeForService(@NonNull ComponentName service, boolean enable) { try { - return sService.setDefaultToObserveModeForService(mContext.getUser().getIdentifier(), - service, enable); + return sService.setShouldDefaultToObserveModeForService( + mContext.getUser().getIdentifier(), service, enable); } catch (RemoteException e) { Log.e(TAG, "Failed to reach CardEmulationService."); } |