> ## Documentation Index
> Fetch the complete documentation index at: https://committ.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Enforcement Module

> System-level permissions auditing and configuration routing.

# Enforcement Module

The `enforcement-module` operates as the primary security auditor for the React Native application. It establishes a JSI bridge for inspecting deeply nested OS configurations that standard React Native permission libraries are incapable of accurately evaluating.

## Auditing Protocol

The `checkAllPermissions` function executes a comprehensive state evaluation across critical Android systems:

```mermaid theme={null}
graph TD
    A[React Native UI] -->|invoke checkAllPermissions| B(EnforcementModule.kt)
    B --> C{Accessibility Service}
    B --> D{Draw Overlays}
    B --> E{Location Policy}
    B --> F{Battery Optimization}
    B --> G{Device Admin}
    
    C -->|Settings.Secure| H[Active]
    D -->|canDrawOverlays| I[Active]
    E -->|ACCESS_BACKGROUND_LOCATION| J[Active]
    F -->|isIgnoringBatteryOptimizations| K[Exempted]
    G -->|isAdminActive| L[Active]
    
    H --> M[Map Structure Returned]
    I --> M
    J --> M
    K --> M
    L --> M
```

* **Accessibility Services**: Validates `Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES` to guarantee the Blocker module is actively armed within the OS layer.
* **Draw Overlays**: Verifies `canDrawOverlays` privileges, an absolute requirement for rendering the un-dismissable full-screen penalty UI.
* **Location Constraints**: Validates that GPS permissions are explicitly set to "Allow all the time" (`ACCESS_BACKGROUND_LOCATION`). A standard "Allow while using" configuration is structurally rejected, as Android OS background tracking termination would initiate an inescapable fail-closed blockout sequence.
* **Battery Optimization**: Confirms the application is whitelisted from Android Doze Mode execution limits.
* **Device Administration**: Inspects the `DevicePolicyManager` to verify anti-uninstall protections are bound to the package.

## Settings Routing Infrastructure

Because OEMs (Samsung, Xiaomi, OnePlus) continuously alter their Settings menu architectures, standard Android intents frequently fail or misdirect users. The `openSettings` function provides specialized deep-linking to route the user directly to the correct permission configuration page across diverse hardware variants.
