diff options
author | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2018-11-06 10:17:27 +0800 |
---|---|---|
committer | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2018-11-06 10:17:27 +0800 |
commit | 43452ff8a759da135525678528c159f1e4e68504 (patch) | |
tree | f21a5f2c1998461d660823cc40c509846baaa0a4 /sample | |
parent | 8bf11a8668902565b0e9a23e320777f5fb611848 (diff) |
use appid instead of appname in "tap_shortcut"
Now In homescreen-service used application_id to identify
different application, so use appid instead of appname
in "tap_shortcut" parameter.
Bug-AGL: SPEC-1764
Change-Id: I46af214cf25108ca0c2983a54547ab1f64f9ab59
Signed-off-by: wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com>
Diffstat (limited to 'sample')
-rw-r--r-- | sample/simple-egl/src/simple-egl.cpp | 10 | ||||
-rw-r--r-- | sample/template/main.cpp | 16 |
2 files changed, 8 insertions, 18 deletions
diff --git a/sample/simple-egl/src/simple-egl.cpp b/sample/simple-egl/src/simple-egl.cpp index 799729b..4271a66 100644 --- a/sample/simple-egl/src/simple-egl.cpp +++ b/sample/simple-egl/src/simple-egl.cpp @@ -570,14 +570,8 @@ init_hs(LibHomeScreen* hs){ } hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [](json_object *object){ - const char *application_name = json_object_get_string( - json_object_object_get(object, "application_name")); - HMI_DEBUG("simple-egl","Event_TapShortcut application_name = %s ", application_name); - if(strcmp(application_name, app_name.c_str()) == 0) - { - HMI_DEBUG("simple-egl","try to activesurface %s ", app_name.c_str()); - wm->activateWindow(main_role); - } + HMI_DEBUG("simple-egl","try to activesurface %s ", app_name.c_str()); + wm->activateWindow(main_role); }); return 0; diff --git a/sample/template/main.cpp b/sample/template/main.cpp index 831df41..fef270b 100644 --- a/sample/template/main.cpp +++ b/sample/template/main.cpp @@ -146,16 +146,12 @@ int main(int argc, char *argv[]) // Set event handler hs->set_event_handler(LibHomeScreen::Event_TapShortcut, [wm](json_object *object) { - const char *appname = json_object_get_string( - json_object_object_get(object, "application_name")); - if(myname == appname) { - qDebug("Surface %s got tapShortcut\n", appname); - // Application should call LibWindowmanager::endDraw() in TapShortcut handler - json_object *obj = json_object_new_object(); - json_object_object_add(obj, wm->kKeyDrawingName, json_object_new_string(app_name.c_str())); - json_object_object_add(obj, wm->kKeyDrawingArea, json_object_new_string("normal.full")); - wm->activateSurface(obj); - } + qDebug("Surface %s got tapShortcut\n", myname.c_str()); + // Application should call LibWindowmanager::endDraw() in TapShortcut handler + json_object *obj = json_object_new_object(); + json_object_object_add(obj, wm->kKeyDrawingName, json_object_new_string(myname.c_str())); + json_object_object_add(obj, wm->kKeyDrawingArea, json_object_new_string("normal.full")); + wm->activateSurface(obj); }); /* |