svc nfc should support watches too
Check for both FEATURE_NFC and FEATURE_NFC_HOST_CARD_EMULATION in the "svc nfc" command. Watches may only have the latter, but should still support the nfc enable/disable command. See b/24532713#comment7 for context. Bug 32386425 Change-Id: I307798f00728c6b437aebfcf58115af7265e3692
This commit is contained in:
@@ -58,7 +58,8 @@ public class NfcCommand extends Svc.Command {
|
|||||||
IPackageManager pm = IPackageManager.Stub.asInterface(
|
IPackageManager pm = IPackageManager.Stub.asInterface(
|
||||||
ServiceManager.getService("package"));
|
ServiceManager.getService("package"));
|
||||||
try {
|
try {
|
||||||
if (pm.hasSystemFeature(PackageManager.FEATURE_NFC, 0)) {
|
if (pm.hasSystemFeature(PackageManager.FEATURE_NFC, 0) ||
|
||||||
|
pm.hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION, 0)) {
|
||||||
INfcAdapter nfc = INfcAdapter.Stub
|
INfcAdapter nfc = INfcAdapter.Stub
|
||||||
.asInterface(ServiceManager.getService(Context.NFC_SERVICE));
|
.asInterface(ServiceManager.getService(Context.NFC_SERVICE));
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user