Package-level declarations
Types
Returns current cellular signal strength. Requires ACCESS_NETWORK_STATE (checked up front). On API 29+ reads the first cellular entry from SignalStrength.cellSignalStrengths (added in Q — calling it on API 28 throws NoSuchMethodError); below that falls back to a reflection-based GSM read with a synthesized dBm estimate. Output: signal_asu, signal_dbm, level (excellent/good/moderate/poor/none), level_numeric (0-4). Returns ToolResult.error when permission is missing, no SignalStrength/cellular entry is available, or on failure.
Returns mobile (cellular) data usage over a look-back window. Prefers android.app.usage.NetworkStatsManager.querySummaryForDevice which requires the PACKAGE_USAGE_STATS special-access grant; on SecurityException/failure it silently falls back to android.net.TrafficStats cumulative-since-boot totals (which ignore the days window and add a note). Param days (1-90, default 30). Output: bytes_rx, bytes_tx, query_period_days, and note only on the fallback path. Returns ToolResult.error only when even TrafficStats is unsupported.
Reports whether the active network is carried over a VPN. Requires ACCESS_NETWORK_STATE (checked up front). On API 23+ inspects NetworkCapabilities.TRANSPORT_VPN and attempts to resolve the owning app's package name via reflection on the hidden ownerUid field (often "unknown"); below API 23 uses the deprecated TYPE_VPN network info (package always null). Output: is_active, vpn_package_name (nullable / "unknown"). Returns ToolResult.error when permission is missing or on failure.
Provider for the network tools: data usage, cellular signal, and VPN status. Combines a normal runtime permission (ACCESS_NETWORK_STATE) with the PACKAGE_USAGE_STATS special-access grant (checked via android.app.AppOpsManager, not a runtime dialog). GetDataUsageTool degrades to TrafficStats without usage access; the signal and VPN tools only need ACCESS_NETWORK_STATE.