Only use commit() (sync disk write) for preferences that opt in with
sync=true. The language preference in OtherConfig is currently the only
one that needs this — it triggers an immediate process restart via
context.restart().
Other string preferences continue using apply() (async) to avoid
unnecessary main-thread blocking.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Use commit() instead of apply() for String preference writes to ensure
the value is written to disk synchronously before the process is killed
during restart().
Root cause: SharedPreferences.apply() writes to memory immediately but
commits to disk asynchronously. When context.restart() calls
Process.killProcess()+exitProcess(0) immediately after writing the
language preference, the async disk write may not complete, causing the
new process to read the old value.
Closes#862
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>