Use getDefaultAdapter instead of getNfcAdapter
getNfcAdapter can throw an exception if NFC is not available Bug: 19227597 Change-Id: Ib95849057938066dc5760a34f16333f5423ce61f
This commit is contained in:
@@ -519,8 +519,7 @@ public class WifiSettings extends RestrictedSettingsFragment
|
|||||||
}
|
}
|
||||||
if (mSelectedAccessPoint.networkId != INVALID_NETWORK_ID) {
|
if (mSelectedAccessPoint.networkId != INVALID_NETWORK_ID) {
|
||||||
menu.add(Menu.NONE, MENU_ID_MODIFY, 0, R.string.wifi_menu_modify);
|
menu.add(Menu.NONE, MENU_ID_MODIFY, 0, R.string.wifi_menu_modify);
|
||||||
|
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(getActivity());
|
||||||
NfcAdapter nfcAdapter = NfcAdapter.getNfcAdapter(getActivity());
|
|
||||||
if (nfcAdapter != null && nfcAdapter.isEnabled() &&
|
if (nfcAdapter != null && nfcAdapter.isEnabled() &&
|
||||||
mSelectedAccessPoint.security != AccessPoint.SECURITY_NONE) {
|
mSelectedAccessPoint.security != AccessPoint.SECURITY_NONE) {
|
||||||
// Only allow writing of NFC tags for password-protected networks.
|
// Only allow writing of NFC tags for password-protected networks.
|
||||||
|
Reference in New Issue
Block a user