summaryrefslogtreecommitdiffstats
path: root/core/java/android/content/Context.java
diff options
context:
space:
mode:
authorNick Pelly <npelly@google.com>2010-12-07 22:40:28 -0800
committerNick Pelly <npelly@google.com>2010-12-10 17:12:33 -0800
commit50b4d8f643f31b37e9872f562fb869059cf79c8a (patch)
tree6f866534d961355448a91f04ee5b3bec2b3b7dd5 /core/java/android/content/Context.java
parenta218e01437c3c47c49ced7ab363bf98fe92cf1e3 (diff)
downloadframeworks_base-50b4d8f643f31b37e9872f562fb869059cf79c8a.zip
frameworks_base-50b4d8f643f31b37e9872f562fb869059cf79c8a.tar.gz
frameworks_base-50b4d8f643f31b37e9872f562fb869059cf79c8a.tar.bz2
Make getSystemService(NFC_SERVICE) the NFC entry point.
This gives NFC service a handle to the application context. Deprecate NfcAdapter.getDefaultAdapter(), it does not provide a context. Using this method will print a warning, and will later throw an exception if a method that requires a context is called. No 2.3 API's will fail, but new API's that do require a context might fail. Also add helper NfcAdapter.getDefaultAdapter(Context). Change-Id: I9a6378de4ef4b61ad922f8d53e64e2a1a1d5d60c
Diffstat (limited to 'core/java/android/content/Context.java')
-rw-r--r--core/java/android/content/Context.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index a370b334..85c29b8 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -1551,6 +1551,14 @@ public abstract class Context {
/**
* Use with {@link #getSystemService} to retrieve a
+ * {@link android.nfc.NfcManager} for using NFC.
+ *
+ * @see #getSystemService
+ */
+ public static final String NFC_SERVICE = "nfc";
+
+ /**
+ * Use with {@link #getSystemService} to retrieve a
* {@link android.net.sip.SipManager} for accessing the SIP related service.
*
* @see #getSystemService