am 038cabe0: NFC integration

Merge commit '038cabe0247ee46df62f9363f1a303bc5b9c1028' into gingerbread-plus-aosp

* commit '038cabe0247ee46df62f9363f1a303bc5b9c1028':
  NFC integration
This commit is contained in:
Nick Pelly
2010-09-28 22:40:18 -07:00
committed by Android Git Automerger
44 changed files with 6762 additions and 1 deletions

View File

@@ -99,6 +99,8 @@ import android.view.inputmethod.InputMethodManager;
import android.accounts.AccountManager;
import android.accounts.IAccountManager;
import android.app.admin.DevicePolicyManager;
import com.trustedlogic.trustednfc.android.NfcManager;
import com.trustedlogic.trustednfc.android.INfcManager;
import com.android.internal.os.IDropBoxManagerService;
@@ -168,6 +170,7 @@ class ContextImpl extends Context {
private static ThrottleManager sThrottleManager;
private static WifiManager sWifiManager;
private static LocationManager sLocationManager;
private static NfcManager sNfcManager;
private static final HashMap<String, SharedPreferencesImpl> sSharedPrefs =
new HashMap<String, SharedPreferencesImpl>();
@@ -966,6 +969,8 @@ class ContextImpl extends Context {
return getClipboardManager();
} else if (WALLPAPER_SERVICE.equals(name)) {
return getWallpaperManager();
} else if (NFC_SERVICE.equals(name)) {
return getNfcManager();
} else if (DROPBOX_SERVICE.equals(name)) {
return getDropBoxManager();
} else if (DEVICE_POLICY_SERVICE.equals(name)) {
@@ -1201,6 +1206,21 @@ class ContextImpl extends Context {
return mDownloadManager;
}
private NfcManager getNfcManager()
{
synchronized (sSync) {
if (sNfcManager == null) {
IBinder b = ServiceManager.getService(NFC_SERVICE);
if (b == null) {
return null;
}
INfcManager service = INfcManager.Stub.asInterface(b);
sNfcManager = new NfcManager(service, mMainThread.getHandler());
}
}
return sNfcManager;
}
@Override
public int checkPermission(String permission, int pid, int uid) {
if (permission == null) {

View File

@@ -1554,6 +1554,16 @@ public abstract class Context {
/** @hide */
public static final String SIP_SERVICE = "sip";
/**
* Use with {@link #getSystemService} to retrieve an
* {@link com.trustedlogic.trustednfc.android.INfcManager.INfcManager} for
* accessing NFC methods.
*
* @see #getSystemService
* @hide
*/
public static final String NFC_SERVICE = "nfc";
/**
* Determine whether the given permission is allowed for a particular
* process and user ID running in the system.

View File

@@ -1639,6 +1639,86 @@ public final class Settings {
*/
public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse";
/**
* Whether nfc is enabled/disabled
* 0=disabled. 1=enabled.
* @hide
*/
public static final String NFC_ON = "nfc_on";
/**
* Whether nfc secure element is enabled/disabled
* 0=disabled. 1=enabled.
* @hide
*/
public static final String NFC_SECURE_ELEMENT_ON = "nfc_secure_element_on";
/**
* Whether nfc secure element is enabled/disabled
* 0=disabled. 1=enabled.
* @hide
*/
public static final String NFC_SECURE_ELEMENT_ID = "nfc_secure_element_id";
/**
* LLCP LTO value
* @hide
*/
public static final String NFC_LLCP_LTO = "nfc_llcp_lto";
/**
* LLCP MIU value
* @hide
*/
public static final String NFC_LLCP_MIU = "nfc_llcp_miu";
/**
* LLCP WKS value
* @hide
*/
public static final String NFC_LLCP_WKS = "nfc_llcp_wks";
/**
* LLCP OPT value
* @hide
*/
public static final String NFC_LLCP_OPT = "nfc_llcp_opt";
/**
* NFC Discovery Reader A
* 0=disabled. 1=enabled.
* @hide
*/
public static final String NFC_DISCOVERY_A = "nfc_discovery_a";
/**
* NFC Discovery Reader B
* 0=disabled. 1=enabled.
* @hide
*/
public static final String NFC_DISCOVERY_B = "nfc_discovery_b";
/**
* NFC Discovery Reader Felica
* 0=disabled. 1=enabled.
* @hide
*/
public static final String NFC_DISCOVERY_F = "nfc_discovery_felica";
/**
* NFC Discovery Reader 15693
* 0=disabled. 1=enabled.
* @hide
*/
public static final String NFC_DISCOVERY_15693 = "nfc_discovery_15693";
/**
* NFC Discovery NFCIP
* 0=disabled. 1=enabled.
* @hide
*/
public static final String NFC_DISCOVERY_NFCIP = "nfc_discovery_nfcip";
/**
* Show pointer location on screen?
* 0 = no
@@ -1804,7 +1884,19 @@ public final class Settings {
SHOW_WEB_SUGGESTIONS,
NOTIFICATION_LIGHT_PULSE,
SIP_CALL_OPTIONS,
SIP_RECEIVE_CALLS
SIP_RECEIVE_CALLS,
NFC_ON,
NFC_SECURE_ELEMENT_ON,
NFC_SECURE_ELEMENT_ID,
NFC_LLCP_LTO,
NFC_LLCP_MIU,
NFC_LLCP_WKS,
NFC_LLCP_OPT,
NFC_DISCOVERY_A,
NFC_DISCOVERY_B,
NFC_DISCOVERY_F,
NFC_DISCOVERY_15693,
NFC_DISCOVERY_NFCIP,
};
// Settings moved to Settings.Secure