Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4c3b7e9 authored by Nick Pelly's avatar Nick Pelly Committed by Android Git Automerger
Browse files

am 038cabe0: NFC integration

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

* commit '038cabe0':
  NFC integration
parents 10b15c08 038cabe0
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -159,6 +159,14 @@ LOCAL_SRC_FILES += \
	core/java/com/android/internal/view/IInputMethodClient.aidl \
	core/java/com/android/internal/view/IInputMethodManager.aidl \
	core/java/com/android/internal/view/IInputMethodSession.aidl \
	core/java/com/trustedlogic/trustednfc/android/ILlcpConnectionlessSocket.aidl \
	core/java/com/trustedlogic/trustednfc/android/ILlcpServiceSocket.aidl \
	core/java/com/trustedlogic/trustednfc/android/ILlcpSocket.aidl \
	core/java/com/trustedlogic/trustednfc/android/INdefTag.aidl \
	core/java/com/trustedlogic/trustednfc/android/INfcManager.aidl \
	core/java/com/trustedlogic/trustednfc/android/INfcTag.aidl \
	core/java/com/trustedlogic/trustednfc/android/IP2pInitiator.aidl \
	core/java/com/trustedlogic/trustednfc/android/IP2pTarget.aidl \
	location/java/android/location/IGeocodeProvider.aidl \
	location/java/android/location/IGpsStatusListener.aidl \
	location/java/android/location/IGpsStatusProvider.aidl \
+20 −0
Original line number Diff line number Diff line
@@ -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) {
+10 −0
Original line number Diff line number Diff line
@@ -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.
+93 −1
Original line number Diff line number Diff line
@@ -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
+34 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2010 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.trustedlogic.trustednfc.android;

import com.trustedlogic.trustednfc.android.LlcpPacket;

/**
 * TODO
 *
 * {@hide}
 */
interface ILlcpConnectionlessSocket
{

    void        close(int nativeHandle);
    int         getSap(int nativeHandle);
    LlcpPacket  receiveFrom(int nativeHandle);
    int        sendTo(int nativeHandle, in LlcpPacket packet);
    
}
 No newline at end of file
Loading