return true;
}
+int StepParseManifest::GetSupportModeVal(std::string support_mode) {
+ int mode = 0;
+ std::size_t found = std::string::npos;
+
+ found = support_mode.find(APP_SUPPORT_MODE_ULTRA_POWER_SAVING_STR);
+ if (found != std::string::npos)
+ mode |= APP_SUPPORT_MODE_ULTRA_POWER_SAVING_VAL;
+
+ found = support_mode.find(APP_SUPPORT_MODE_COOL_DOWN_STR);
+ if (found != std::string::npos)
+ mode |= APP_SUPPORT_MODE_COOL_DOWN_VAL;
+
+ found = support_mode.find(APP_SUPPORT_MODE_SCREEN_READER_STR);
+ if (found != std::string::npos)
+ mode |= APP_SUPPORT_MODE_SCREEN_READER_VAL;
+
+ return mode;
+}
+
bool StepParseManifest::FillInstallationInfo(manifest_x* manifest) {
manifest->root_path = strdup(
(context_->root_application_path.get() / manifest->package).c_str());
return false;
}
+ int support_mode_val = GetSupportModeVal(pkg_info->support_mode());
+
manifest->ns = strdup(pkg_info->xmlns().c_str());
manifest->package = strdup(pkg_info->package().c_str());
manifest->nodisplay_setting = strdup(pkg_info->nodisplay_setting().c_str());
- manifest->support_mode = strdup(pkg_info->support_mode().c_str());
+ manifest->support_mode = strdup((std::to_string(support_mode_val)).c_str());
manifest->appsetting = strdup("false");
manifest->support_disable = strdup("false");
manifest->version = strdup(pkg_info->version().c_str());
// if there is no app yet, set this app as mainapp
bool main_app = manifest->application == nullptr;
+ int package_support_mode_val = atoi(manifest->support_mode);
+ int app_support_mode_val = package_support_mode_val |
+ GetSupportModeVal(application.app_info.support_mode());
+
application_x* widget_app =
static_cast<application_x*>(calloc(1, sizeof(application_x)));
widget_app->appid = strdup(application.app_info.appid().c_str());
widget_app->multiple = strdup("false");
widget_app->nodisplay = strdup("true");
widget_app->support_mode =
- strdup(application.app_info.support_mode().c_str());
+ strdup((std::to_string(app_support_mode_val)).c_str());
widget_app->taskmanage = strdup("false");
widget_app->indicatordisplay = strdup("false");
widget_app->type =
// if there is no app yet, set this app as mainapp
bool main_app = manifest->application == nullptr;
+ int package_support_mode_val = atoi(manifest->support_mode);
+ int app_support_mode_val = package_support_mode_val |
+ GetSupportModeVal(application.app_info.support_mode());
+
application_x* service_app =
static_cast<application_x*>(calloc(1, sizeof(application_x)));
service_app->appid = strdup(application.app_info.appid().c_str());
service_app->multiple = strdup(application.app_info.multiple().c_str());
service_app->taskmanage = strdup(application.app_info.taskmanage().c_str());
service_app->support_mode =
- strdup(application.app_info.support_mode().c_str());
+ strdup((std::to_string(app_support_mode_val)).c_str());
service_app->autorestart =
strdup(application.app_info.auto_restart().c_str());
service_app->onboot = strdup(application.app_info.on_boot().c_str());
// if there is no app yet, set this app as mainapp
bool main_app = manifest->application == nullptr;
+ int package_support_mode_val = atoi(manifest->support_mode);
+ int app_support_mode_val = package_support_mode_val |
+ GetSupportModeVal(application.app_info.support_mode());
+
application_x* ui_app =
static_cast<application_x*>(calloc(1, sizeof(application_x)));
ui_app->appid = strdup(application.app_info.appid().c_str());
ui_app->launch_mode = strdup(application.app_info.launch_mode().c_str());
ui_app->multiple = strdup(application.app_info.multiple().c_str());
ui_app->nodisplay = strdup(application.app_info.nodisplay().c_str());
- ui_app->support_mode = strdup(application.app_info.support_mode().c_str());
+ ui_app->support_mode =
+ strdup((std::to_string(app_support_mode_val)).c_str());
ui_app->taskmanage = strdup(application.app_info.taskmanage().c_str());
ui_app->type = strdup(application.app_info.type().c_str());
ui_app->ui_gadget = strdup(application.app_info.uigadget().c_str());
for (const auto& watch_application : watch_application_list->items) {
bool main_app = manifest->application == nullptr;
+ int package_support_mode_val = atoi(manifest->support_mode);
+ int app_support_mode_val = package_support_mode_val |
+ GetSupportModeVal(watch_application.app_info.support_mode());
+
application_x* watch_app =
static_cast<application_x*>(calloc(1, sizeof(application_x)));
watch_app->appid = strdup(watch_application.app_info.appid().c_str());
watch_app->process_pool = strdup("false");
watch_app->autorestart = strdup("false");
watch_app->onboot = strdup("false");
- watch_app->support_disable = strdup(manifest->support_disable);
+ watch_app->support_mode =
+ strdup((std::to_string(app_support_mode_val)).c_str());
watch_app->ui_gadget = strdup("false");
watch_app->launch_mode = strdup("single");
watch_app->ambient_support =