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). On API 28 it uses the public TelephonyManager.getSignalStrength() + SignalStrength.getLevel() for the level; signal_asu and signal_dbm there come from the GSM reading and are null when it is unknown. 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 — or on API < 29, where a null subscriber id yields an empty (all-zero) summary — it 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, plus query_period_days on the windowed path or note (and no query_period_days) on the since-boot 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; on API 30+ it resolves the owning app's package via the public NetworkCapabilities.getOwnerUid(), which the platform only populates for the VPN app itself, so it is usually "unknown". Below API 30 the owner is not exposed publicly and is always "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 UsageAccess, not a runtime dialog). GetDataUsageTool degrades to TrafficStats without usage access; the signal and VPN tools only need ACCESS_NETWORK_STATE.