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

Commit d40f43c1 authored by Martijn Coenen's avatar Martijn Coenen
Browse files

NFC: @hide some APIs, add setDefaultForNextTap API.

Change-Id: I31efe4c96a62e6c3dcb984a885214e6df045c6c6
parent a7397883
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -14790,7 +14790,6 @@ package android.nfc.cardemulation {
    method public static synchronized android.nfc.cardemulation.CardEmulationManager getInstance(android.nfc.NfcAdapter);
    method public boolean isDefaultServiceForAid(android.content.ComponentName, java.lang.String);
    method public boolean isDefaultServiceForCategory(android.content.ComponentName, java.lang.String);
    method public boolean setDefaultServiceForCategory(android.content.ComponentName, java.lang.String);
    field public static final java.lang.String ACTION_CHANGE_DEFAULT = "android.nfc.cardemulation.ACTION_CHANGE_DEFAULT";
    field public static final java.lang.String CATEGORY_OTHER = "other";
    field public static final java.lang.String CATEGORY_PAYMENT = "payment";
+1 −0
Original line number Diff line number Diff line
@@ -28,5 +28,6 @@ interface INfcCardEmulation
    boolean isDefaultServiceForCategory(int userHandle, in ComponentName service, String category);
    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);
    List<ApduServiceInfo> getServices(int userHandle, in String category);
}
+23 −2
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ public final class CardEmulationManager {
    }

    /**
     * @return
     * @hide
     */
    public boolean setDefaultServiceForCategory(ComponentName service, String category) {
        try {
@@ -207,6 +207,27 @@ public final class CardEmulationManager {
        }
    }

    /**
     * @hide
     */
    public boolean setDefaultForNextTap(ComponentName service) {
        try {
            return sService.setDefaultForNextTap(UserHandle.myUserId(), service);
        } catch (RemoteException e) {
            // Try one more time
            recoverService();
            if (sService == null) {
                Log.e(TAG, "Failed to recover CardEmulationService.");
                return false;
            }
            try {
                return sService.setDefaultForNextTap(UserHandle.myUserId(), service);
            } catch (RemoteException ee) {
                Log.e(TAG, "Failed to reach CardEmulationService.");
                return false;
            }
        }
    }
    /**
     * @hide
     */