Skip to the content.

Device Profile Preset Matrix

Developer reference for the S0327 device-profile feature: why it exists, where the matrix lives, how it is applied, and how to change it.

Owner-authored, data-driven. The preset matrix is no longer a hardcoded Kotlin table. It is a CSV asset edited by the owner/developer and parsed at runtime. Editing presets = editing the CSV (no code change), except when adding a brand-new setting column (then add one applier case).


1. Why device profiles matter

The first run sets language and permissions but never asks how the device is actually used. One default set fits a personal phone, a couch tablet, a car head unit, a TV box, a photo frame, a dedicated audio/video player, an e-reader and a VR headset equally badly.

A device profile is the user’s intent, captured once, that seeds safer starting defaults for content types, thumbnails, fullscreen / keep-awake / background-audio behaviour, destructive-action confirmations, and many more settings. The profile is intent, not hardware truth (a tablet can be a photo frame; a Quest build can run on a plain phone). The user can change it later in Settings.


2. Where it lives (data flow)

Model: domain/model/AppSettings.kt. The CSV option column values are exactly AppSettings field names.


3. CSV format

Value formats by field type

Known data caveats (owner to fix in the CSV)


4. How to change the matrix

  1. Change values or a profile: edit app_v2/src/main/assets/device_profile_presets.csv. No code change. Rebuild and the new values apply on the next profile selection.
  2. Add a profile column: add the column with the matching profile key header; the loader maps it by name. (All 11 DeviceProfileType keys are already supported.)
  3. Add a new setting row: add the row (header = the AppSettings field name) AND add a matching when case in DeviceProfilePresetApplier.applyOverride so the value is coerced to the field.
  4. Keep Other empty (it is the “no preset” profile).
  5. Update ApplyProfilePresetUseCaseTest if behaviour changes.
  6. Verify coverage: pwsh -NoProfile -File scripts/check_device_profile_presets.ps1 fails (exit 1) if any AppSettings field lacks a CSV row or any DeviceProfileType lacks a column; run it with -AddMissing to append the missing rows/columns as empty cells. Consider wiring it into CI / a pre-commit check so a new setting or profile can never silently miss the matrix.

The CSV may be edited in a spreadsheet (Excel / Google Sheets) and saved quoted ("value") or plain; the loader (DeviceProfilePresetCsvDataSource) parses both.

State/credential fields (e.g. defaultUser, defaultPassword, lastUsedResourceId) are deliberately NOT handled by the applier - even if present in the CSV they are skipped, so a profile apply never wipes credentials or session state.


5. Profile icon asset registry (S0327 §11.14)

Provisional minimalist vector icon set, wired into the shared picker (DeviceProfilePickerDialogFragment) and reusable in docs. Replace with final art later; keep ids stable.

Profile Drawable id
Personal smartphone ic_profile_personal_smartphone
Tablet & desktop mode ic_profile_home_tablet
TV / media box ic_profile_tv_media_box
Car head unit ic_profile_car_head_unit
Media player ic_profile_media_player
Photo frame ic_profile_photo_frame
Video player ic_profile_video_player
Audio player ic_profile_audio_player
E-book reader ic_profile_ebook_reader
VR headset ic_profile_vr_headset
Other / Custom ic_profile_other