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

Commit 7bcd2c62 authored by daniel_tomas's avatar daniel_tomas Committed by Nick Pelly
Browse files

New API added in NfcAdapter to enable/disable SE card emulation

Change-Id: Ia0c123873ba9265b45e847d1a30c1300de3c1346
parent 1df862a4
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -702,4 +702,28 @@ public final class NfcAdapter {
            return null;
        }
    }

    /**
     * To change the Secure Element Card Emulation state (ON/OFF)
     * @hide
     */
    public void changeNfcSecureElementCardEmulationState(boolean state)
    {
        int seId = 11259375;
        if(state){
            /* Enable card emulation */
            try {
                sService.selectSecureElement(seId);
            } catch (RemoteException e) {
                Log.e(TAG, "Enable card emulation failed", e);
            }
        }else{
            /* Disable card emulation */
            try {
                sService.deselectSecureElement();
            } catch (RemoteException e) {
                Log.e(TAG, " card emulation failed", e);
            }
        }
    }
}