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

Commit 5052189d authored by George Chang's avatar George Chang
Browse files

Update SetAlwaysOn to SetControllerAlwaysOn

Bug: 182979907
Test: atest NfcNciInstrumentationTests
Change-Id: I6b794259ec597e5d7f86e94705017b8fe169a102
parent abd045e9
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -6724,10 +6724,10 @@ package android.nfc {
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean enable();
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean enableNdefPush();
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean enableSecureNfc(boolean);
    method @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON) public boolean isAlwaysOnEnabled();
    method @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON) public boolean isAlwaysOnSupported();
    method @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON) public boolean isControllerAlwaysOn();
    method @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON) public boolean isControllerAlwaysOnSupported();
    method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean removeNfcUnlockHandler(android.nfc.NfcAdapter.NfcUnlockHandler);
    method @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON) public boolean setAlwaysOn(boolean);
    method @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON) public boolean setControllerAlwaysOn(boolean);
    method public void setNdefPushMessage(android.nfc.NdefMessage, android.app.Activity, int);
    field public static final int FLAG_NDEF_PUSH_NO_CONFIRM = 1; // 0x1
  }
+3 −3
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ interface INfcAdapter
    boolean deviceSupportsNfcSecure();
    boolean setNfcSecure(boolean enable);

    boolean setAlwaysOn(boolean value);
    boolean isAlwaysOnEnabled();
    boolean isAlwaysOnSupported();
    boolean setControllerAlwaysOn(boolean value);
    boolean isControllerAlwaysOn();
    boolean isControllerAlwaysOnSupported();
}
+9 −9
Original line number Diff line number Diff line
@@ -2255,12 +2255,12 @@ public final class NfcAdapter {
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON)
    public boolean setAlwaysOn(boolean value) {
    public boolean setControllerAlwaysOn(boolean value) {
        if (!sHasNfcFeature) {
            throw new UnsupportedOperationException();
        }
        try {
            return sService.setAlwaysOn(value);
            return sService.setControllerAlwaysOn(value);
        } catch (RemoteException e) {
            attemptDeadServiceRecovery(e);
            // Try one more time
@@ -2269,7 +2269,7 @@ public final class NfcAdapter {
                return false;
            }
            try {
                return sService.setAlwaysOn(value);
                return sService.setControllerAlwaysOn(value);
            } catch (RemoteException ee) {
                Log.e(TAG, "Failed to recover NFC Service.");
            }
@@ -2287,9 +2287,9 @@ public final class NfcAdapter {

    @SystemApi
    @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON)
    public boolean isAlwaysOnEnabled() {
    public boolean isControllerAlwaysOn() {
        try {
            return sService.isAlwaysOnEnabled();
            return sService.isControllerAlwaysOn();
        } catch (RemoteException e) {
            attemptDeadServiceRecovery(e);
            // Try one more time
@@ -2298,7 +2298,7 @@ public final class NfcAdapter {
                return false;
            }
            try {
                return sService.isAlwaysOnEnabled();
                return sService.isControllerAlwaysOn();
            } catch (RemoteException ee) {
                Log.e(TAG, "Failed to recover NFC Service.");
            }
@@ -2316,12 +2316,12 @@ public final class NfcAdapter {

    @SystemApi
    @RequiresPermission(android.Manifest.permission.NFC_SET_CONTROLLER_ALWAYS_ON)
    public boolean isAlwaysOnSupported() {
    public boolean isControllerAlwaysOnSupported() {
        if (!sHasNfcFeature) {
            throw new UnsupportedOperationException();
        }
        try {
            return sService.isAlwaysOnSupported();
            return sService.isControllerAlwaysOnSupported();
        } catch (RemoteException e) {
            attemptDeadServiceRecovery(e);
            // Try one more time
@@ -2330,7 +2330,7 @@ public final class NfcAdapter {
                return false;
            }
            try {
                return sService.isAlwaysOnSupported();
                return sService.isControllerAlwaysOnSupported();
            } catch (RemoteException ee) {
                Log.e(TAG, "Failed to recover NFC Service.");
            }