summaryrefslogtreecommitdiffstats
path: root/nfc-extras
diff options
context:
space:
mode:
authormike wakerly <mikey@google.com>2012-10-03 13:45:00 -0700
committermike wakerly <mikey@google.com>2012-10-03 14:14:23 -0700
commitf74df47fc9aee3a274db006db5024892972a0c8a (patch)
treea00978c6d254b2e4361ef969ea9d9a235e9ec481 /nfc-extras
parent26884df75c69587561e397ec4da6b5b463e37fe9 (diff)
downloadframeworks_base-f74df47fc9aee3a274db006db5024892972a0c8a.zip
frameworks_base-f74df47fc9aee3a274db006db5024892972a0c8a.tar.gz
frameworks_base-f74df47fc9aee3a274db006db5024892972a0c8a.tar.bz2
NfcAdapterExtras: expose driver name.
Bug: 7276355 Change-Id: I65597f732c2ccb749f8fc5ef1793bacf5de8b592
Diffstat (limited to 'nfc-extras')
-rw-r--r--nfc-extras/java/com/android/nfc_extras/NfcAdapterExtras.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/nfc-extras/java/com/android/nfc_extras/NfcAdapterExtras.java b/nfc-extras/java/com/android/nfc_extras/NfcAdapterExtras.java
index 9c87c22..ffed804 100644
--- a/nfc-extras/java/com/android/nfc_extras/NfcAdapterExtras.java
+++ b/nfc-extras/java/com/android/nfc_extras/NfcAdapterExtras.java
@@ -234,4 +234,21 @@ public final class NfcAdapterExtras {
attemptDeadServiceRecovery(e);
}
}
+
+ /**
+ * Returns the name of this adapter's driver.
+ *
+ * <p>Different NFC adapters may use different drivers. This value is
+ * informational and should not be parsed.
+ *
+ * @return the driver name, or empty string if unknown
+ */
+ public String getDriverName() {
+ try {
+ return sService.getDriverName(mPackageName);
+ } catch (RemoteException e) {
+ attemptDeadServiceRecovery(e);
+ return "";
+ }
+ }
}