User-Interaction
Because fewer people lose their data when an OTA update fails thanks to the UDC feature, users have a better OTA update experience. As a result, fewer people may contact customer service with update-related problems. Users may observe numerous device reboots when an OTA update fails, though. We will now be discussing the various APIs which are a part of the Data Checkpoint one by one.
Particulars |
API Used |
Description |
---|---|---|
To Mark a Checkpoint | void startCheckpoint(int retry) | When the framework is prepared to begin an update, it calls this function. Before checkpointed file systems, like userdata, are mounted R/W after a reboot, the checkpoint is created. The updater calls needsRollback to determine whether a rollback of the update is necessary if the retry count is positive. The API defers to the A/B bootloader’s judgment if the retry count is zero. |
To Mark the Changes | void commitChanges() | When the modifications are ready to be committed after a reboot, the framework invokes this function. This is invoked prior to BootComplete and before data (such as images, videos, SMS, and server reception of receipt) is written to userdata. This approach is ineffective if there are no ongoing checkpointed updates. |
To Check if a RollBack is required | bool needsRollback() | When the system needs to enquire that does the fallback needs to be called, it can use this API and get the status in the form of a boolean value. A true means yes, a rollback is required. |
To Cancel all the Changes Made | abortChanges() | If you want to cancel all the changes made, and also stop the process in between you can call the abort API to handle that, and use it to stop the process in between. |
GeekTip #2: When performing a typical A/B update, this procedure is not invoked.
User Data Checkpoint (UDC) in Android 13
User Data Checkpoint is a crucial feature, which was initially introduced in Android 10, but has now improved over time, and now in Android 13, is better than ever. In this article, we will understand more about the concept of UDC, and how we can avail it in case our app ever differs from the OTA update policy and the update fails.
GeekTip #1: The User Data Checkpoint (UDC) is a fallback support, and is not ensured to act always when a crash or software update fails.