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:
Tucker Sylvestro
2016-12-14 14:01:14 -05:00
parent df459cb2ea
commit 1876583bfb

View File

@@ -58,7 +58,8 @@ public class NfcCommand extends Svc.Command {
IPackageManager pm = IPackageManager.Stub.asInterface(
ServiceManager.getService("package"));
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
.asInterface(ServiceManager.getService(Context.NFC_SERVICE));
try {