oxmc 3b74d330b8 provisioner: split base/OTA tasks; defer APK install to USER_PRESENT
Previously pm install ran on BOOT_COMPLETED, triggering idmap2d overlay
re-evaluation under load and causing repeated SIGKILL cycles.

New design:
- ACTION_BASE_PROVISION (BOOT_COMPLETED): applies settings from the
  pre-installed config APK and configures the setup wizard state.
  No network, no pm install, completes quickly.
- ACTION_OTA_UPDATE (USER_PRESENT): downloads the config APK URL and
  installs it over the built-in copy if the OTA check interval has elapsed
  (default 24 h, configurable via ota_check_interval_ms in vendor.cfg).
  Attempt timestamp is recorded before download to prevent server-error
  storms on repeated screen unlocks.

All shared helpers (applyConfigApkSettings, applyApns, configureSetupWizard,
downloadApk, installApk) moved to service level so both tasks share them.
2026-06-09 22:10:12 -07:00
2025-08-21 01:11:21 -07:00
2025-08-22 15:32:39 -07:00
2025-08-21 01:11:21 -07:00
2025-08-21 01:23:18 -07:00

Config Provisioner

Overview

Config Provisioner is an Android system service and broadcast receiver designed to automate device provisioning based on vendor-specific configuration. On device boot, it checks for a vendor configuration file (/vendor/etc/config_provisioner/vendor.cfg). If provisioning is enabled and a valid APK URL is provided, it downloads and installs a configuration APK, then configures the device setup wizard according to vendor preferences.

Key Features

  • Runs automatically on boot (including locked boot)
  • Checks for vendor configuration file
  • Downloads and installs a configuration APK if required
  • Configures Android Setup Wizard (enables/disables, marks setup complete)
  • Persists provisioning state to avoid repeated runs

Vendor Configuration File Format

The vendor configuration file is located at /vendor/etc/config_provisioner/vendor.cfg. It is a simple key-value file with one setting per line. Lines starting with # are comments and ignored.

Supported Keys

  • enable_setup_wizard (boolean: true/false/1/0)
    • Enables or disables the Android Setup Wizard after provisioning.
  • enable_provisioning (boolean: true/false/1/0)
    • Enables or disables the provisioning process.
  • vendor_id (string)
    • Identifier for the vendor/device.
  • network_timeout (integer, milliseconds)
    • Timeout for network operations (e.g., APK download).
  • config_apk_url (string, URL)
    • URL to the configuration APK to be downloaded and installed.

Example

# Vendor configuration for Config Provisioner
enable_setup_wizard=false
enable_provisioning=true
vendor_id=acme_corp
network_timeout=30000
config_apk_url=https://example.com/config/acme_config.apk

Default Values

If a key is missing, the following defaults are used:

Logging & Debugging

The service logs all configuration values and provisioning steps to logcat under the tags ConfigProvisioner and VendorConfig.

Permissions

The app requires system-level permissions to install packages, access network state, receive boot events, and modify setup wizard state.

License

S
Description
No description provided
Readme GPL-3.0 111 KiB
Languages
Java 100%