#include "components/samsung/account_provider/account_provider_impl.h"
+#include <app_control.h>
#include <map>
#include "base/logging.h"
#include "components/samsung/public/account_provider/account_provider.h"
self->account_provider_->SSOAccountList(data);
return SSO_TRUE;
}
+
+void AccountProviderImpl::LaunchSSOMenu() {
+ char* app_id_mod = NULL; // to match the function argument
+ SSORESULT res = sso_get_account_ui_application_package_id(
+ &app_id_mod); // New added API from 23 platform
+ if (res != SSO_TRUE) {
+ LOG(INFO) << "fail to get app id";
+ return;
+ }
+ LOG(INFO) << "successfully got app id";
+ if (app_id_mod != NULL) {
+ std::string app_id(app_id_mod);
+ LOG(INFO) << "app_id is[" << app_id.c_str() << "]";
+ free(app_id_mod);
+ int ret;
+ app_control_h app_control;
+ ret = app_control_create(&app_control);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ LOG(INFO) << "app_control_create ret value: " << ret;
+ }
+ app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
+ ret = app_control_set_app_id(app_control, app_id.c_str());
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ LOG(INFO) << "app_control_set_app_id ret: " << ret;
+ }
+ ret = app_control_send_launch_request(app_control, NULL,
+ NULL); // != APP_CONTROL_ERROR_NONE
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ LOG(INFO) << "app_control_send_launch_request ret: " << ret;
+ }
+ app_control_destroy(app_control);
+ } else {
+ LOG(INFO) << "Failed to get app_id";
+ }
+}