Search in sources :

Example 6 with NfcAdapter

use of android.nfc.NfcAdapter in project android_frameworks_base by DirtyUnicorns.

the class CardEmulation method recoverService.

void recoverService() {
    NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
    sService = adapter.getCardEmulationService();
}
Also used : NfcAdapter(android.nfc.NfcAdapter)

Example 7 with NfcAdapter

use of android.nfc.NfcAdapter in project android_frameworks_base by AOSPA.

the class NfcFCardEmulation method recoverService.

void recoverService() {
    NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
    sService = adapter.getNfcFCardEmulationService();
}
Also used : NfcAdapter(android.nfc.NfcAdapter)

Example 8 with NfcAdapter

use of android.nfc.NfcAdapter in project android_frameworks_base by AOSPA.

the class CardEmulation method recoverService.

void recoverService() {
    NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
    sService = adapter.getCardEmulationService();
}
Also used : NfcAdapter(android.nfc.NfcAdapter)

Example 9 with NfcAdapter

use of android.nfc.NfcAdapter in project android_frameworks_base by ResurrectionRemix.

the class CardEmulation method recoverService.

void recoverService() {
    NfcAdapter adapter = NfcAdapter.getDefaultAdapter(mContext);
    sService = adapter.getCardEmulationService();
}
Also used : NfcAdapter(android.nfc.NfcAdapter)

Example 10 with NfcAdapter

use of android.nfc.NfcAdapter in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class WifiSettings method onCreateContextMenu.

@Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo info) {
    Preference preference = (Preference) view.getTag();
    if (preference instanceof LongPressAccessPointPreference) {
        mSelectedAccessPoint = ((LongPressAccessPointPreference) preference).getAccessPoint();
        menu.setHeaderTitle(mSelectedAccessPoint.getSsid());
        if (mSelectedAccessPoint.isConnectable()) {
            menu.add(Menu.NONE, MENU_ID_CONNECT, 0, R.string.wifi_menu_connect);
        }
        WifiConfiguration config = mSelectedAccessPoint.getConfig();
        // Some configs are ineditable
        if (isEditabilityLockedDown(getActivity(), config)) {
            return;
        }
        if (mSelectedAccessPoint.isSaved() || mSelectedAccessPoint.isEphemeral()) {
            // Allow forgetting a network if either the network is saved or ephemerally
            // connected. (In the latter case, "forget" blacklists the network so it won't
            // be used again, ephemerally).
            menu.add(Menu.NONE, MENU_ID_FORGET, 0, R.string.wifi_menu_forget);
        }
        // current connected AP, add a disconnect option to it
        if (getResources().getBoolean(R.bool.config_auto_connect_wifi_enabled)) {
            if (mSelectedAccessPoint.isActive()) {
                menu.add(Menu.NONE, MENU_ID_DISCONNECT, 0, R.string.wifi_menu_disconnect);
            }
        }
        if (mSelectedAccessPoint.isSaved()) {
            menu.add(Menu.NONE, MENU_ID_MODIFY, 0, R.string.wifi_menu_modify);
            NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(getActivity());
            if (nfcAdapter != null && nfcAdapter.isEnabled() && mSelectedAccessPoint.getSecurity() != AccessPoint.SECURITY_NONE) {
                // Only allow writing of NFC tags for password-protected networks.
                menu.add(Menu.NONE, MENU_ID_WRITE_NFC, 0, R.string.wifi_menu_write_to_nfc);
            }
        }
    }
}
Also used : WifiConfiguration(android.net.wifi.WifiConfiguration) AccessPointPreference(com.android.settingslib.wifi.AccessPointPreference) Preference(android.support.v7.preference.Preference) NfcAdapter(android.nfc.NfcAdapter)

Aggregations

NfcAdapter (android.nfc.NfcAdapter)22 Activity (android.app.Activity)4 NdefMessage (android.nfc.NdefMessage)3 NdefRecord (android.nfc.NdefRecord)3 NfcEvent (android.nfc.NfcEvent)2 SuppressLint (android.annotation.SuppressLint)1 Fragment (android.app.Fragment)1 ComponentName (android.content.ComponentName)1 Intent (android.content.Intent)1 PackageManager (android.content.pm.PackageManager)1 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)1 ResolveInfo (android.content.pm.ResolveInfo)1 Resources (android.content.res.Resources)1 WifiConfiguration (android.net.wifi.WifiConfiguration)1 Tag (android.nfc.Tag)1 Bundle (android.os.Bundle)1 UserManager (android.os.UserManager)1 PreferenceFragment (android.preference.PreferenceFragment)1 Preference (android.support.v7.preference.Preference)1 InputMethodManager (android.view.inputmethod.InputMethodManager)1