* commit '99e267ebcf8f950cbdcf8438cc7383e1fc6a56c2': New API added in NfcAdapter to enable/disable SE card emulation
This commit is contained in:
@@ -702,4 +702,28 @@ public final class NfcAdapter {
|
|||||||
return null;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user