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_NUMBERS on API 30+ (READ_PHONE_STATE suffices on API <= 29); 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, subscription_id (the default subscription's id — TelephonyManager.subscriptionId on API 30+, SubscriptionManager.getDefaultSubscriptionId() below; -1 if none), and slot_index — the physical SIM slot of that subscription (SubscriptionInfo.simSlotIndex, which needs READ_PHONE_STATE, falling back to the permission-free SubscriptionManager.getSlotIndex on API 29+; -1 if unknown).
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.