Tizen OS Local Recovery Client Guide

From Tizen Wiki
Jump to: navigation, search
  1. Setup tizen-manifest
    1. Add metaday key
      • Without metadata, recovery daemon cannot send event to client
      • Metadata key : tizen-recovery-manager, value : client
    2. Add priviliege
    3. Example tizen-manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns="http://tizen.org/ns/packages" api-version="5.5" package="org.example.recovery-manager-client" version="1.0.0">
    <profile name="iot-headed" />
    <service-application appid="org.example.recovery-manager-client" exec="recovery-manager-client" type="capp" multiple="false" taskmanage="false" nodisplay="true">
        <icon>recovery-manager-client.png</icon>
        <label>recovery-manager-client</label>
        <metadata key="tizen-recovery-manager" value="client"/>
    </service-application>
    <privileges>
        <privilege>http://tizen.org/privilege/reboot</privilege>
    </privileges>
</manifest>
2. Setup src
  1. Client app should process plug event after receive plug app control
    • Plugged event key : recovery-plug, value : (image path)
  2. Client app should process unplug event after receive unplug app control
    • Unplugged event key : recovery-unplug, value : (usb home path)
  3. Client app should process user's recovery trigger event
    • Recovery reboot reason : recovery
  4. Example source code
void service_app_control(app_control_h app_control, void *data)
{
    int ret = 0;
    char *value = NULL;

    ret = app_control_get_extra_data(app_control, "recovery-plug", &value);
    if (ret == APP_CONTROL_ERROR_NONE) {
        /* Process plug event */
        LOGI("App-control recovery-plug : %s", value);
    }

    ret = app_control_get_extra_data(app_control, "recovery-unplug", &value);
    if (ret == APP_CONTROL_ERROR_NONE) {
        /* Process unplug event */
        LOGI("App-control recovery-unplug : %s", value);
    }

    ret = app_control_get_extra_data(app_control, "recovery-trigger", &value);
    if (ret == APP_CONTROL_ERROR_NONE) {
        /* Process user's recovery trigger event */
        LOGI("App-control recovery-trigger : %s", value);

        /* For example, reboot recovery */ 
        ret = device_power_reboot("recovery");
    }
}