Package-level declarations
Types
Returns the device call state from android.telephony.TelephonyManager. The deprecated callState getter needs READ_PHONE_STATE: without it, apps targeting API < 31 silently get CALL_STATE_IDLE (so this tool may falsely report "idle"), while apps targeting API 31+ get a SecurityException instead — caught here and surfaced as a clear error rather than a generic failure. Output: state ("idle" | "ringing" | "active" | "unknown").
Returns the current registered network operator from android.telephony.TelephonyManager. No permission required. The numeric operator_id (PLMN) is split into 3-digit mcc and remaining mnc when at least 5 digits are present. Output: operator_name, operator_id, mcc, mnc (any may be null/empty when not on a cellular network).
Returns the device's line-1 phone number via the deprecated TelephonyManager.line1Number. Requires READ_PHONE_STATE (or READ_SMS/READ_PHONE_NUMBERS); even so the value is frequently unavailable (carrier/SIM does not populate it) and SecurityException is caught and treated as null. Output: phone_number (nullable), is_available.
Returns SIM card details from android.telephony.TelephonyManager. simSerialNumber (ICCID) needs READ_PHONE_STATE/privileged access and is null on API 29+ for non-privileged apps; SecurityException is caught and yields null. Carrier name and country ISO need no permission. Output: sim_serial (nullable), carrier_name, country_iso, and slot_index — which actually carries the default subscriptionId (public API 30+; the method didn't exist earlier), NOT the physical SIM slot, and is 0 below API 30 or on error.
Provider for the telephony tools: phone number, SIM info, network operator, and call state. The declared permissions gate the identity-bearing tools (GetPhoneNumberTool, GetSimInfoTool, and call state on API 31+); GetNetworkOperatorTool needs none. Each tool degrades gracefully (null fields) when its permission is absent rather than erroring.