The com.phosra.sdk Kotlin library provides on-device child safety enforcement for Android using UsageStatsManager, DevicePolicyManager, VpnService, and AccessibilityService.
Overview
The SDK has a two-layer architecture:
API Client -- Communicates with the Phosra API to register devices, fetch compiled policies, submit enforcement reports, and acknowledge policy versions.
Enforcement Engine -- Translates the compiled policy document into native Android API calls to enforce content filters, screen time limits, web filtering, purchase controls, and more.
API Client
Handles device registration, policy sync, and reporting via the Phosra REST API.
Enforcement Engine
Maps policy rules to UsageStatsManager, DevicePolicyManager, VpnService, and AccessibilityService.
Requirements
Requirement
Version
Android
8.0+ (API 26)
Kotlin
1.9+
Gradle
8+
compileSdk
35
targetSdk
35
Installation
The com.phosra:sdk Android library is in private preview — it is not published to Maven Central or Google's Maven repo yet. Email [email protected] for the AAR / private Maven URL and access credentials. Once you have access, add the private repository and the dependency to your Gradle build:
The 45 OCSS rule categories the Android SDK maps to native framework primitives (of the 123 categories in the OCSS rule registry; the remainder are policy-only or census-enforced and carry no client-side Android verb):
Content Rules
Category
Android API
Mechanism
content_rating
PackageManager
App age rating metadata check
content_block_title
UsageStatsManager + Overlay
Block by package name
content_allow_title
UsageStatsManager + Overlay
Allow only listed packages
content_allowlist_mode
UsageStatsManager + Overlay
Block all unlisted apps
content_descriptor_block
PackageManager
Content descriptor filtering
Time Rules
Category
Android API
Mechanism
time_daily_limit
UsageStatsManager
Aggregate usage, lock at limit
time_scheduled_hours
AlarmManager
Allow usage only during scheduled hours
time_per_app_limit
UsageStatsManager
Per-package usage tracking
time_downtime
AlarmManager
Lock device during downtime windows
Purchase Rules
Category
Android API
Mechanism
purchase_approval
DevicePolicyManager
Restrict Play Store access
purchase_block_iap
DevicePolicyManager
Block in-app purchase flows
purchase_spending_cap
None
Play Billing observer (in-app)
Social Rules
Category
Android API
Mechanism
social_contacts
ContactsContract
Restrict contact access
social_chat_control
UsageStatsManager + Overlay
Block messaging apps
social_multiplayer
UsageStatsManager + Overlay
Block multiplayer gaming apps
Web Rules
Category
Android API
Mechanism
web_safesearch
VpnService
DNS redirect to safe search
web_category_block
VpnService
DNS-based category blocking
web_custom_allowlist
VpnService
Allow only listed domains
web_custom_blocklist
VpnService
Block listed domains
web_filter_level
VpnService
Preset blocklist by level
Privacy Rules
Category
Android API
Mechanism
privacy_location
LocationManager
App-level location permission management
privacy_profile_visibility
None
App-level enforcement
privacy_data_sharing
None
App-level enforcement
privacy_account_creation
None
In-app parental gate
Monitoring Rules
Category
Android API
Mechanism
monitoring_activity
UsageStatsManager
Query and report usage data
monitoring_alerts
UsageStatsManager + AlarmManager
Threshold-based alerts
Engagement Rules
Category
Android API
Mechanism
algo_feed_control
UsageStatsManager + Overlay
Block/limit social apps
addictive_design_control
UsageStatsManager + Overlay
Block offending apps
Notification Rules
Category
Android API
Mechanism
notification_curfew
NotificationListenerService
Suppress during curfew
usage_timer_notification
AlarmManager
Periodic usage reminder
Legislation-Driven Rules
Category
Android API
Mechanism
targeted_ad_block
None
App-level (no system API)
dm_restriction
UsageStatsManager + Overlay
Block messaging apps
age_gate
None
In-app enforcement
data_deletion_request
None
App-level support flow
geolocation_opt_in
LocationManager
Per-app permission management
Compliance Rules
Category
Android API
Mechanism
csam_reporting
None
Server-side detection
library_filter_compliance
VpnService
DNS-based web filtering
ai_minor_interaction
UsageStatsManager + Overlay
Block AI apps
social_media_min_age
UsageStatsManager + Overlay
Block social apps for underage
image_rights_minor
None
App-level enforcement
Parental / Legislative Rules
Category
Android API
Mechanism
parental_consent_gate
None
In-app parental auth flow
parental_event_notification
AlarmManager + FCM
Push to parent on flagged events
screen_time_report
UsageStatsManager
Generate and submit usage summary
commercial_data_ban
None
App/server-level policy
algorithmic_audit
None
Platform transparency requirement
Google Play Compliance
Apps using UsageStatsManager, AccessibilityService, VpnService, and Device Admin require additional review by Google Play. Plan for a longer review cycle.
Required Declarations
Permissions Declaration Form: Submit in Play Console for QUERY_ALL_PACKAGES, PACKAGE_USAGE_STATS, and Accessibility Service usage.
Data Safety section: Declare all data collected from child devices. Phosra collects:
App usage statistics (aggregated)
Web activity (domain-level, via DNS)
Device metadata (model, OS version)
VPN usage: Declare that the VPN is used exclusively for local DNS filtering, not for routing traffic through external servers.
Target audience: Set to "Parents" -- the app is a parental control tool, not a child-facing app.
Families Policy: If your app appears in the Play Store's Family section, ensure compliance with Google's Families Policy.
Tips for Approval
Provide a detailed app description explaining the parental control use case
Include a demo video showing the parent setup flow and enforcement in action