Unable to Register TelephonyManager for Signal Strength Changes due to SecurityException

31 views Asked by At

I am facing an issue while trying to register a TelephonyManager to listen for signal strength changes in my Android application. The error message I'm encountering is:

java.lang.SecurityException: Unable to listen for events [1, 20, 5, 21, 23, 9, 11] due to insufficient location permissions.

Here is the code snippet where I attempt to register the TelephonyManager:

if (SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
                        tmanager2.registerTelephonyCallback(INCLUDE_LOCATION_DATA_COARSE, executorist, TelephonyCallback);
                    }

I have given all required permission.

0

There are 0 answers