Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit e95203e0 authored by Hans Boehm's avatar Hans Boehm
Browse files

Make onSaveInstanceState wait for database writes

Bug: 34051652

Add a mechanism to wait for (asynchronous) database writes to
complete.

Invoke it in Calculator.onSaveInstanceState(). This avoids a potential
situation in which the saved instance state bundle includes a reference
to an expression that never made it to the database. This may be more
likely than it appears, since we run all background tasks on a single
thread. A database save operation can get hung up behind a computation.

Note that in almost all cases, the wait operation will return
immediately, as evidenced by the fact that this very rarely
leads to crashes without the wait operation.

Change-Id: I7c2bdcd9bf19f6cb4bd653fb9244bca0f6b25435
parent c3a0b31c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment