diff --git a/sdk/src/java/lineageos/profiles/ConnectionSettings.java b/sdk/src/java/lineageos/profiles/ConnectionSettings.java index d9395c83..bb559f8f 100644 --- a/sdk/src/java/lineageos/profiles/ConnectionSettings.java +++ b/sdk/src/java/lineageos/profiles/ConnectionSettings.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015 The CyanogenMod Project - * 2020 The LineageOS Project + * 2020-2024 The LineageOS Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -254,18 +254,13 @@ public final class ConnectionSettings implements Parcelable { public void processOverride(Context context) { BluetoothAdapter bta = BluetoothAdapter.getDefaultAdapter(); LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); + NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(context); WifiManager wm = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); SubscriptionManager sm = context.getSystemService(SubscriptionManager.class); - NfcAdapter nfcAdapter = null; - try { - nfcAdapter = NfcAdapter.getNfcAdapter(context); - } catch (UnsupportedOperationException e) { - //Nfc not available - } boolean forcedState = getValue() == 1; boolean currentState;