{"id":180505,"date":"2013-05-22T14:54:03","date_gmt":"2013-05-22T10:54:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=180505"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=180505","title":{"rendered":"<span class=\"post_title\">\u0418\u0437\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Ubuntu Touch \u0438 Android<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/26e\/9a5\/386\/26e9a5386887fca6118dfc962f3eaeaf.png\"\/><br \/>  \u041f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440.<\/p>\n<p>  \u041f\u0430\u0440\u0443 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0441\u044f \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c <font color=\"#c0392b\">Ubuntu Touch<\/font> \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 <font color=\"#c0392b\">Allwinner A10<\/font>,<br \/>  \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0434\u0435\u043b\u0430\u043b \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0441\u0435\u0431\u0435 \u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c. \u0421\u0435\u0439\u0447\u0430\u0441, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043e\u043d\u0438 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b, \u043f\u043e\u043a\u0430 Ubuntu Touch \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u043b\u0430 \u043d\u0430 \u0441\u0432\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 <font color=\"#c0392b\">Mir<\/font> \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043b\u0438\u0446\u0430\u043c \u043d\u0430\u0439\u0442\u0438 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0443\u044e \u0442\u043e\u0447\u043a\u0443, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0431\u043b\u0438\u0437\u043a\u043e\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 UT.<\/p>\n<p>  \u0421\u0442\u0438\u043b\u044c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0430\u043b\u0451\u043a \u043e\u0442 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043f\u0440\u043e\u0442\u0438\u0432, \u0442\u043e<br \/>  \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  <\/p>\n<h5>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 libhybris<\/h5>\n<p>  <font color=\"#c0392b\">libhybris<\/font> \u2014 \u043f\u0440\u043e\u0441\u043b\u043e\u0439\u043a\u0430, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/Glibc\">Glibc<\/a> userspace \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438\u0437 <a href=\"http:\/\/ru.wikipedia.org\/wiki\/Bionic_(\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430)\">Bionic<\/a> userspace, \u043d\u0430 \u043b\u0435\u0442\u0443 \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u0438\u0437 Glibc. \u041f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043f\u0440\u0438\u0435\u0442\u0430\u0440\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0434\u043b\u044f Android \u0432 Linux-\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435. \u041d\u0430\u0438\u0431\u00f3\u043b\u044c\u0448\u0430\u044f \u043f\u043e\u043b\u044c\u0437\u0430, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u043f\u0440\u0438\u0435\u0442\u0430\u0440\u043d\u044b\u0435 GPU-\u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 Android.<\/p>\n<h5>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 surfaceflinger<\/h5>\n<p>  <font color=\"#c0392b\">surfaceflinger<\/font> \u2014 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430, \u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043b\u043e\u0451\u0432.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/202\/eb2\/404\/202eb240485762e7ba6323e3e34c374d.png\"\/><\/p>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e <font color=\"#c0392b\">Binder IPC<\/font> \u0438 <font color=\"#c0392b\">SurfaceFlinger<\/font>:  <\/p>\n<ul>\n<li><a href=\"http:\/\/developer.mips.com\/2012\/04\/11\/learning-about-android-graphics-subsystem\">http:\/\/developer.mips.com\/2012\/04\/11\/learning-about-android-graphics-subsystem<br \/>   <\/a><\/li>\n<li><a href=\"http:\/\/0xlab.org\/~jserv\/android-binder-ipc.pdf\">http:\/\/0xlab.org\/~jserv\/android-binder-ipc.pdf<br \/>   <\/a><\/li>\n<\/ul>\n<h5>Ubuntu Touch<\/h5>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0439 <font color=\"#c0392b\">Android JB 4.2<\/font>, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 <font color=\"#c0392b\">CyagenMod-10.1<\/font> (\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043f\u043e\u0434\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 CM \u2014 <a href=\"http:\/\/phablet.ubuntu.com\/gitweb\">phablet.ubuntu.com\/gitweb<\/a>). \u0418\u0437 \u043d\u0435\u0433\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043e \u0432\u0441\u0451 \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 <font color=\"#c0392b\">dalvik<\/font> \u0438 <font color=\"#c0392b\">java<\/font> \u2014 \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0438\u0437 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 <font color=\"#c0392b\">HAL<\/font>. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <font color=\"#c0392b\">AOSP 4.1<\/font>, \u043d\u043e \u0431\u0443\u0434\u044c\u0442\u0435 \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u0438 \u043f\u043e\u0434 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0435 API \u043e\u0442 4.1, \u043e\u043d\u043e \u043d\u0435 \u043f\u043e\u043a\u0440\u044b\u0442\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 \u0438 \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0438 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442 \u0440\u0435\u043b\u0438\u0437\u0430 \u043a \u0440\u0435\u043b\u0438\u0437\u0443.<\/p>\n<p>  \u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b UT \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0432 <font color=\"#c0392b\">chroot<\/font>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <a href=\"http:\/\/phablet.ubuntu.com\/gitweb?p=ubuntu\/uchroot.git;a=tree\">uchroot<\/a>, \u043e\u0442\u0440\u044b\u0432\u043e\u043a:  <\/p>\n<pre><code class=\"cpp\">static int ubuntum(void *a) {     \/* Chroot *\/     chroot(&quot;\/data\/ubuntu&quot;);     chdir(&quot;\/&quot;);      \/* Set basic env variables *\/     char *const envp[8] = {         &quot;container=aal&quot;,         &quot;PATH=\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin&quot;,          &quot;SHELL=\/bin\/bash&quot;,          &quot;HOME=\/root&quot;,         &quot;USER=root&quot;,         &quot;USERNAME=root&quot;,         &quot;LOGNAME=root&quot;,          NULL     };      \/* Exec shell *\/     execle(&quot;\/sbin\/init&quot;, &quot;\/sbin\/init&quot;, &quot;--verbose&quot;, NULL, envp);      return 0; } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Android-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 chroot-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f Ubuntu \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c <font color=\"#c0392b\">libhybris<\/font>. <br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/69f\/bcb\/308\/69fbcb30850197e8939d83f97ea8464a.png\"\/><\/p>\n<h4>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Ubuntu Touch<\/h4>\n<p>  \u0421\u0443\u043f \u0438\u0437 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 UT \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0432 lanchpad-\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 <a href=\"https:\/\/code.launchpad.net\/~phablet-team\">~phablet-team<\/a>.<br \/>  \u041d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0438\u0435 \u0437\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043d\u0430 Android \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445:  <\/p>\n<ul>\n<li><a href=\"https:\/\/code.launchpad.net\/~phablet-team\/platform-api\/trunk\">platform-api<br \/>   <\/a><\/li>\n<li><a href=\"https:\/\/code.launchpad.net\/~phablet-team\/qtubuntu\/trunk\">qtubuntu<br \/>   <\/a><\/li>\n<\/ul>\n<p>  \u0421\u043a\u0430\u0447\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432:  <\/p>\n<pre><code>bzr branch lp:platform-api bzr branch lp:qtubuntu <\/code><\/pre>\n<h5>Ubuntu Platform API<\/h5>\n<p>  <font color=\"#c0392b\">Ubuntu platform API<\/font> \u2014 \u043d\u0438\u0437\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 API \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b (Android).<\/p>\n<p>  <font color=\"#c0392b\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/font>  <\/p>\n<ul>\n<li>ubuntu_application_ui_show_surface<\/li>\n<li>ubuntu_application_ui_hide_surface<\/li>\n<li>ubuntu_application_ui_move_surface_to<\/li>\n<li>ubuntu_application_ui_resize_surface_to<\/li>\n<\/ul>\n<p>  \u0418\u0437 \u0444\u0430\u0439\u043b\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/view\/head:\/doc\/mainpage.md\">doc\/mainpage.md<\/a> \u0443\u0437\u043d\u0430\u0451\u043c, \u0447\u0442\u043e \u0434\u0435\u0440\u0435\u0432\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u0432 <font color=\"#c0392b\">platform-api<\/font> \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438:  <\/p>\n<ul>\n<li><font color=\"#c0392b\">include<\/font> \u2014 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u0430\u044f \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f platform API<\/li>\n<li><font color=\"#c0392b\">android<\/font> \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f platform API \u043f\u043e\u0434 Android (\u044f \u0431\u044b \u0443\u0442\u043e\u0447\u043d\u0438\u043b \u2014 \u043f\u043e\u0434 Android 4.2)<\/li>\n<\/ul>\n<p>  \u0418 \u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u043d\u0430 \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u044d\u0442\u0438\u043c API \u2014 \u044d\u0442\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u0438\u0437<br \/>  \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/files\/head:\/include\/ubuntu\/application\">includes\/ubuntu\/application<\/a>, \u0430 \u0432\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c.<\/p>\n<p>  \u0418\u0437 \u0444\u0430\u0439\u043b\u0430 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/view\/head:\/debian\/control\">debian\/control<\/a> \u0443\u0437\u043d\u0430\u0451\u043c, \u0447\u0442\u043e:  <\/p>\n<pre><code>Package: libplatform-api1-hybris Depends: libhybris Description: Hybris implementation of the Platform API (runtime) This package provides the hybris implementation of the Platform API.    The produced library should be used via libhybris, to communicate with the Android userspace, which is where the Ubuntu Application Manager lives. <\/code><\/pre>\n<p>  \u0410\u0433\u0430, \u0437\u043d\u0430\u0447\u0438\u0442, \u0441\u0443\u0434\u044f \u043f\u043e <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/view\/head:\/android\/hybris\/Android.mk\">android\/hybris\/Android.mk<\/a>, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f platform API \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0431\u0438\u0431\u043b\u043e\u0442\u0435\u043a\u0438 <font color=\"#c0392b\">libubuntu_application_api<\/font> \u0441 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u043e\u0439 \u0441 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043b\u0438\u0431\u0430\u043c\u0438 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430 \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 android userspace:  <\/p>\n<pre><code>LOCAL_SRC_FILES := \\     ubuntu_application_api_for_hybris.cpp \\     ubuntu_application_gps_for_hybris.cpp \\     ubuntu_application_sensors_for_hybris.cpp \\     ..\/default\/default_ubuntu_application_sensor.cpp \\     ..\/default\/default_ubuntu_application_ui.cpp \\     ..\/default\/default_ubuntu_ui.cpp \\     application_manager.cpp  LOCAL_MODULE := libubuntu_application_api  LOCAL_SHARED_LIBRARIES := \\     libandroidfw \\     libbinder \\     libutils \\     libgui \\     libEGL \\     libGLESv2 \\     libhardware \\     libhardware_legacy <\/code><\/pre>\n<p>  \u0411\u0435\u0437 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043e\u0441\u0442\u0430\u043b\u0430\u0441\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/view\/head:\/src\/android\">platform-api\/src\/android<\/a>, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0451 \u0432 \u0434\u0435\u0442\u0430\u043b\u044f\u0445. \u0421\u0443\u0434\u044f \u043f\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u044e \u0444\u0430\u0439\u043b\u0430 <font color=\"#c0392b\">CMakeLists.txt<\/font>, \u0441\u0431\u043e\u0440\u043a\u0430 \u0438\u0434\u0451\u0442 \u0443\u0436\u0435 \u0434\u043b\u044f glibc.<\/p>\n<p>  \u0415\u0441\u0442\u044c \u043e\u0434\u0438\u043d-\u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u043a\u043e\u0434\u043e\u043c \u2014 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/view\/head:\/src\/android\/ubuntu_application_api.cpp\">ubuntu_application_api.cpp<\/a>, \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0432 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c:  <\/p>\n<pre><code class=\"cpp\">extern void *android_dlopen(const char *filename, int flag); extern void *android_dlsym(void *handle, const char *symbol); <\/code><\/pre>\n<p> \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440 <font color=\"#c0392b\">libhybris<\/font> \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438\u0437 shared-\u043b\u0438\u0431\u044b \u0438\u0437 android userspace.<\/p>\n<pre><code class=\"cpp\">struct Bridge {     static const char* path_to_library() {         return &quot;\/system\/lib\/libubuntu_application_api.so&quot;;     }     Bridge() : lib_handle(android_dlopen(path_to_library(), RTLD_LAZY)) {         assert(lib_handle && &quot;Error loading ubuntu_application_api&quot;);     }  .......      void* resolve_symbol(const char* symbol) const {         return android_dlsym(lib_handle, symbol);     }     void* lib_handle; }; <\/code><\/pre>\n<p> \u2014 \u043d\u0435\u0445\u0438\u0442\u0440\u044b\u0439 \u043c\u043e\u0441\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0438\u0437 <font color=\"#c0392b\">libubuntu_application_api.so<\/font>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043b\u0430\u0434\u0438\u0442 \u0441 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430, \u0438 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e \u00ab\u0441\u043e\u0431\u0440\u0430\u043b\u0438\u00bb \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/view\/head:\/android\/hybris\/Android.mk\">android\/hybris\/Android.mk<\/a>.<\/p>\n<pre><code class=\"cpp\">#define IMPLEMENT_VOID_FUNCTION3(symbol, arg1, arg2, arg3)      \\     void symbol(arg1 _1, arg2 _2, arg3 _3) {                    \\         static void (*f)(arg1, arg2, arg3) = NULL;              \\         DLSYM(&f, #symbol);                                     \\         f(_1, _2, _3); } .......  IMPLEMENT_VOID_FUNCTION2(ubuntu_application_ui_init, int, char**); IMPLEMENT_FUNCTION0(StageHint, ubuntu_application_ui_setup_get_stage_hint); IMPLEMENT_FUNCTION0(FormFactorHint, ubuntu_application_ui_setup_get_form_factor_hint); IMPLEMENT_VOID_FUNCTION1(ubuntu_application_ui_start_a_new_session, SessionCredentials*); IMPLEMENT_VOID_FUNCTION2(ubuntu_application_ui_set_clipboard_content, void*, size_t); ....... <\/code><\/pre>\n<p> \u2014 \u043a\u0443\u0447\u0430 \u043e\u0431\u0451\u0440\u0442\u043e\u043a \u0434\u043b\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 API, \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 <font color=\"#c0392b\">libubuntu_application_api.so<\/font>.<\/p>\n<p>  <b>\u0418\u0442\u0430\u043a, \u0432\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u0435 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b:<\/b>  <\/p>\n<ul>\n<li><font color=\"#c0392b\">libubuntu_application_api.so<\/font> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434 bionic, \u0436\u0438\u0432\u0451\u0442 \u0432 android userspace;<\/li>\n<li><font color=\"#c0392b\">libubuntu_application_api.so<\/font> \u2014 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434 glibc, \u0436\u0438\u0432\u0451\u0442 \u0432 linux userpace (chroot), \u0433\u0440\u0443\u0437\u0438\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 libhybris.<\/li>\n<\/ul>\n<p>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u044d\u043d\u0442\u0440\u043e\u043f\u0438\u044e \u0432\u0441\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0443\u0442\u0451\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a.<br \/>  \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0438\u0445 \u0434\u0435\u0431\u0430\u0442\u044b \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 <a href=\"https:\/\/code.launchpad.net\/~xnox\/platform-api\/inline-packaging\/+merge\/153874\">merge-153874 discussion<\/a>, \u0442\u043e \u0443\u0448\u0438 \u0432\u044f\u043d\u0443\u0442.<\/p>\n<h5>Ubuntu Application Manager<\/h5>\n<p>  \u0412 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/view\/head:\/android\/hybris\">platform-api\/android\/hybris<\/a> \u043f\u043e\u043c\u0438\u043c\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Ubuntu platform API \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 <font color=\"#c0392b\">ubuntuappmanager<\/font> \u2014 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 Ubuntu, \u043e\u043d \u0436\u0438\u0432\u0451\u0442 \u0432 android userspace \u0438, \u0441\u0443\u0434\u044f \u043f\u043e <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/view\/head:\/android\/hybris\/Android.mk\">Android.mk<\/a>, \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <font color=\"#c0392b\">libubuntu_application_api<\/font> \u0438 \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <font color=\"#c0392b\">Binder IPC<\/font> \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0430\u043d\u0434\u0440\u043e\u0438\u0434\u0430.  <\/p>\n<pre><code>LOCAL_SRC_FILES:= \\     application_manager.cpp \\     default_application_manager.cpp \\  LOCAL_MODULE:= ubuntuappmanager LOCAL_MODULE_TAGS := optional  LOCAL_SHARED_LIBRARIES := \\     libbinder \\     libinput \\     libgui \\     libskia \\     libandroidfw \\     libutils \\     libEGL \\     libGLESv2 \\     libubuntu_application_api <\/code><\/pre>\n<p>  \u0420\u0435\u0448\u0430\u0435\u0442 \u043a\u0443\u0447\u0443 \u0437\u0430\u0434\u0430\u0447 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0441\u0435\u0441\u0441\u0438\u044f\u043c\u0438, \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/view\/head:\/android\/hybris\/default_application_manager.h\">default_application_manager.h<\/a>:  <\/p>\n<pre><code class=\"cpp\">    void update_app_lists();     void binderDied(const android::wp&lt;android::IBinder&gt;& who);     void register_a_surface(...);     void request_fullscreen(...);     int get_session_pid(const android::sp&lt;android::IApplicationManagerSession&gt;& session);     void focus_running_session_with_id(int id);     void unfocus_running_sessions();     int32_t query_snapshot_layer_for_session_with_id(int id);     android::IApplicationManagerSession::SurfaceProperties query_surface_properties_for_session_id(int id);     void switch_focused_application_locked(size_t index_of_next_focused_app);     void switch_focus_to_next_application_locked();     void kill_focused_application_locked();      void start_a_new_session(         int32_t session_type,         int32_t stage_hint,         const android::String8& app_name,         const android::String8& desktop_file,         const android::sp&lt;android::IApplicationManagerSession&gt;& session,         int fd); <\/code><\/pre>\n<p>  <\/p>\n<h5>QtUbuntu<\/h5>\n<p>  \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0441 \u0447\u0430\u0441\u0442\u044c\u044e UT, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0435\u0439 \u0437\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 Ubuntu platform API \u0438 Qt\/QML \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 <a href=\"http:\/\/qt-project.org\/wiki\/Qt-Platform-Abstraction\">Qt Platform Abstraction<\/a>, \u0442\u043e, \u0432 \u043a\u0440\u0430\u0442\u0446\u0435, \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Qt \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 QPA-\u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432.<\/p>\n<p>  \u0412 QPA-\u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u0440\u043e\u0434\u0435 <font color=\"#c0392b\">createPlatformWindow<\/font>, \u0430 \u0437\u0430\u0442\u0435\u043c Qt \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u043a\u043e\u0448\u043a\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0438\u043c\u0432\u043e\u043b <font color=\"#c0392b\">createPlatformWindow<\/font> \u0438\u0437 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u0438 \u0432 \u0443\u0441 \u043d\u0435 \u0434\u0443\u0435\u0442, \u043a\u0443\u0434\u0430 \u043e\u043d\u043e \u0442\u0430\u043c \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e\u0448\u043b\u043e.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e \u0441 QPA \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Ubuntu application API.  <\/p>\n<pre><code>~\/ubuntu\/qtubuntu $ tree . \u251c\u2500\u2500 qtubuntu.pro \u251c\u2500\u2500 src \u2502   \u251c\u2500\u2500 modules \u2502   \u2502   \u251c\u2500\u2500 application   &lt;------------------ QML plugin \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441 \u2502   \u2502   \u2502   \u251c\u2500\u2500 application.cc               | Ubuntu Application Manager \u2502   \u2502   \u2502   \u251c\u2500\u2500 application.h                | \u0438\u0437 QtQuick \u2502   \u2502   \u2502   \u251c\u2500\u2500 application.pro              | \u2502   \u2502   \u2502   \u251c\u2500\u2500 application_image.cc         | \u2502   \u2502   \u2502   \u251c\u2500\u2500 application_image.h          | \u2502   \u2502   \u2502   \u251c\u2500\u2500 application_list_model.cc    | \u2502   \u2502   \u2502   \u251c\u2500\u2500 application_list_model.h     | \u2502   \u2502   \u2502   \u251c\u2500\u2500 application_manager.cc       | \u2502   \u2502   \u2502   \u251c\u2500\u2500 application_manager.h        | \u2502   \u2502   \u2502   \u251c\u2500\u2500 application_window.cc        | \u2502   \u2502   \u2502   \u251c\u2500\u2500 application_window.h         | \u2502   \u2502   \u2502   \u251c\u2500\u2500 input_filter_area.cc         | \u2502   \u2502   \u2502   \u251c\u2500\u2500 input_filter_area.h          | \u2502   \u2502   \u2502   \u251c\u2500\u2500 logging.h                    | \u2502   \u2502   \u2502   \u251c\u2500\u2500 plugin.cc                    | \u2502   \u2502   \u2502   \u2514\u2500\u2500 qmldir                       | \u2502   \u2502   \u251c\u2500\u2500 ---------------------------------- \u2502   \u2502   \u2514\u2500\u2500 modules.pro \u2502   \u251c\u2500\u2500 platforms \u2502   \u2502   \u251c\u2500\u2500 base \u2502   \u2502   \u251c\u2500\u2500 platforms.pro \u2502   \u2502   \u2514\u2500\u2500 ubuntu   &lt;-------------- QPA \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u0438 \u2502   \u2502         \u251c\u2500\u2500 clipboard.cc \u2502   \u2502         \u251c\u2500\u2500 clipboard.h \u2502   \u2502         \u251c\u2500\u2500 input.cc \u2502   \u2502         \u251c\u2500\u2500 input.h \u2502   \u2502         \u251c\u2500\u2500 integration.cc &lt;-- \u0437\u0434\u0435\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d `createPlatformWindow` \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u2502   \u2502         \u251c\u2500\u2500 integration.h \u2502   \u2502         \u251c\u2500\u2500 main.cc \u2502   \u2502         \u251c\u2500\u2500 screen.cc \u2502   \u2502         \u251c\u2500\u2500 screen.h \u2502   \u2502         \u251c\u2500\u2500 ubuntu.json \u2502   \u2502         \u251c\u2500\u2500 ubuntu.pro \u2502   \u2502         \u251c\u2500\u2500 window.cc \u2502   \u2502         \u2514\u2500\u2500 window.h \u2502   \u2514\u2500\u2500 src.pro \u2514\u2500\u2500 tests <\/code><\/pre>\n<p>  \u0421\u0443\u0434\u044f \u043f\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u043c\u0443 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/qtubuntu\/trunk\/view\/head:\/src\/platforms\/ubuntu\/ubuntu.pro\">ubuntu.pro<\/a>, \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u043b\u0438\u043d\u043a\u0443\u0435\u0442\u0441\u044f \u0441 glibc-\u0432\u0435\u0440\u0441\u0438\u0435\u0439 <font color=\"#c0392b\">libubuntu_application_api.so<\/font><br \/>  \u041e\u0431\u0440\u0430\u0442\u0438\u043c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 platform API, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0432 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/qtubuntu\/trunk\/view\/head:\/src\/platforms\/ubuntu\/integration.cc\">integration.cc<\/a> \u0438 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/qtubuntu\/trunk\/view\/head:\/src\/platforms\/ubuntu\/window.cc\">window.cc<\/a>:  <\/p>\n<pre><code class=\"cpp\">#include &lt;ubuntu\/application\/ui\/ubuntu_application_ui.h&gt;  ubuntu_application_ui_start_a_new_session(&credentials); ubuntu_application_ui_destroy_surface(surface_); ubuntu_application_ui_create_surface(&surface_, &quot;QUbuntuWindow&quot;, geometry.width(), geometry.height(), static_cast&lt;SurfaceRole&gt;(role), flags, eventCallback, this); ubuntu_application_ui_move_surface_to(surface_, geometry.x(), geometry.y()); ubuntu_application_ui_request_fullscreen_for_surface(surface_); ubuntu_application_ui_move_surface_to(surface_, rect.x(), rect.y()); ubuntu_application_ui_resize_surface_to(surface_, rect.width(), rect.height()); ubuntu_application_ui_request_fullscreen_for_surface(surface_); ubuntu_application_ui_show_surface(surface_); ubuntu_application_ui_hide_surface(surface_); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0448\u0435 Qt \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u043a\u043e\u0448\u043a\u043e, \u0442\u043e \u043e\u043d\u043e \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 QPA \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b <font color=\"#c0392b\">qubuntu<\/font> \u2014 <font color=\"#c0392b\">QUbuntuIntegration::createPlatformWindow<\/font> \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/qtubuntu\/trunk\/view\/head:\/src\/platforms\/ubuntu\/integration.cc\">integration.cc<\/a>:  <\/p>\n<pre><code class=\"cpp\">QPlatformWindow* QUbuntuIntegration::createPlatformWindow(QWindow* window) { .......   \/\/ Create the window.   QPlatformWindow* platformWindow = new QUbuntuWindow(.......); ....... } <\/code><\/pre>\n<p>  \u0417\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u044f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 <font color=\"#c0392b\">QUbuntuWindow<\/font> \u0432 \u0444\u0430\u0439\u043b\u0435 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/qtubuntu\/trunk\/view\/head:\/src\/platforms\/ubuntu\/window.cc\">window.cc<\/a>, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <font color=\"#c0392b\">QUbuntuWindow::createWindow()<\/font>:  <\/p>\n<pre><code class=\"cpp\">void QUbuntuWindow::createWindow() { .......   ubuntu_application_ui_create_surface(       &surface_, &quot;QUbuntuWindow&quot;, geometry.width(), geometry.height(),       static_cast&lt;SurfaceRole&gt;(role), flags, eventCallback, this); .......   ubuntu_application_ui_move_surface_to(surface_, geometry.x(), geometry.y()); ....... } <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043a\u0440\u0430\u0439\u043d\u0435 \u0443\u0440\u0435\u0437\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u043e \u0441\u0443\u0442\u044c \u044f\u0441\u043d\u0430 \u2014 \u0434\u0435\u043b\u0430\u044e\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432\u044b \u043a <font color=\"#c0392b\">Ubuntu platform API<\/font>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0443 \u043d\u0430\u0441 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0432 glibc-\u0432\u0435\u0440\u0441\u0438\u0438 <font color=\"#c0392b\">libubuntu_application_api.so<\/font>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u043e\u0441\u0442\u043e\u043c \u043a bionic-\u0432\u0435\u0440\u0441\u0438\u0438 <font color=\"#c0392b\">libubuntu_application_api.so<\/font>, \u043a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043b\u0435\u0436\u0438\u0442 \u0432 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/view\/head:\/android\">platform-api\/android<\/a>.<\/p>\n<p>  <font color=\"#c0392b\">\u041f\u0440\u044b\u0433\u0430\u0435\u043c?<\/font><\/p>\n<p>  \u041f\u0440\u044b\u0433\u043d\u0443\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e grep \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u0432 <a href=\"http:\/\/bazaar.launchpad.net\/~phablet-team\/platform-api\/trunk\/view\/head:\/android\/default\/default_ubuntu_application_ui.cpp\">platform-api\/android\/default\/default_ubuntu_application_ui.cpp<\/a>:  <\/p>\n<pre><code class=\"cpp\">\/\/ \u042d\u0442\u043e \u0432 ubuntu_application_ui_create_surface   ubuntu::application::ui::Surface::Ptr surface = session-&gt;create_surface(props,          ubuntu::application::ui::input::Listener::Ptr(new CallbackEventListener(cb, ctx)));  \/\/ \u042d\u0442\u043e \u0432 ubuntu_application_ui_move_surface_to   auto s = static_cast&lt;Holder&lt;ubuntu::application::ui::Surface::Ptr&gt;*&gt;(surface);   s-&gt;value-&gt;move_to(x, y); <\/code><\/pre>\n<p>  \u041d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u043c\u0430\u0442\u0440\u0451\u0448\u043a\u0443 \u0438 \u043d\u0430\u0439\u0442\u0438, \u043a\u0430\u043a \u0436\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b <font color=\"#c0392b\">ubuntu::application::ui::Session<\/font> \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, <font color=\"#c0392b\">ubuntu::application::ui::Surface<\/font>. \u0410 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043e\u043d\u0438 \u0432 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u2014 <font color=\"#c0392b\">ubuntu_application_api_for_hybris.cpp<\/font>:  <\/p>\n<pre><code class=\"cpp\">namespace android { ....... struct Session : public ubuntu::application::ui::Session, public UbuntuSurface::Observer {    .......     Session(.....) {     ......     ubuntu::application::ui::Surface::Ptr create_surface(         const ubuntu::application::ui::SurfaceProperties& props,         const ubuntu::application::ui::input::Listener::Ptr& listener) {         .......          \/\/ \u041e, \u0430 \u0432\u043e\u0442 \u0438 \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0430. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u043c\u043e\u0442\u0430\u0442\u044c \u0432\u0432\u0435\u0440\u0445 \u0438 \u043d\u0430\u0439\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e UbuntuSurface         UbuntuSurface* surface = new UbuntuSurface(client, client_channel, looper,             props, listener,this);           .......           \/\/ 100% \u044d\u0442\u043e \u043d\u0430\u0448 \u043a\u043b\u0438\u0435\u043d\u0442, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c UbuntuSurface          return ubuntu::application::ui::Surface::Ptr(surface);          ....... <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0430\u0442\u044b\u0432\u0430\u0435\u043c, \u043d\u0430\u0445\u043e\u0434\u0438\u043c <font color=\"#c0392b\">UbuntuSurface<\/font>:  <\/p>\n<pre><code class=\"cpp\">struct UbuntuSurface : public ubuntu::application::ui::Surface {     .......     UbuntuSurface(const sp&lt;SurfaceComposerClient&gt;& client, .......)     : ubuntu::application::ui::Surface(listener)     {         \/\/ \u0412\u043e\u0442 \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e - \u043f\u0440\u044f\u043c\u043e\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a Android API         surface_control = client-&gt;createSurface(                               String8(props.title),                               props.width,                               props.height,                               PIXEL_FORMAT_RGBA_8888,                               props.flags & .......);          surface = surface_control-&gt;getSurface();         ....... <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0435\u043a\u0438\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 <font color=\"#c0392b\">android::SurfaceControl<\/font>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432\u044b\u0437\u043e\u0432\u0430 <font color=\"#c0392b\">android::SurfaceComposerClient()-&gt;createSurface()<\/font>.<br \/>  \u0427\u0435\u0440\u0435\u0437 \u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0442 \u0432\u0441\u0435 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a <font color=\"#c0392b\">android::SurfaceComposerClient<\/font> (<a href=\"http:\/\/code.metager.de\/source\/xref\/android\/4.1.1\/frameworks\/native\/libs\/gui\/Surface.cpp\">frameworks\/native\/libs\/gui\/Surface.cpp<\/a>), \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a: \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0441\u043b\u043e\u0451\u0432 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043d\u0430\u0437\u0430\u0434 \u043f\u043e \u0446\u0435\u043f\u043e\u0447\u043a\u0435, \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u043c, \u0447\u0442\u043e \u0436\u0435 \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0435 Qt \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 QPA \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u043e\u0439 Ubuntu. <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/999\/95e\/5ef\/99995e5ef4dc09c5e8901e23a367bbaa.gif\"\/><\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435 \u044f \u0432\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u0441\u0435\u0431\u044f \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f Ubuntu Touch \u0438 Android \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u043c. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0438\u0434\u0442\u0438 \u0443\u0436\u0435 \u0432 \u043e\u0442\u0440\u044b\u0432\u0435 \u043e\u0442 \u0432\u0441\u0435\u0433\u043e \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e. \u041d\u0435\u0440\u0430\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f <font color=\"#c0392b\">qmlscene<\/font> \u0438 <font color=\"#c0392b\">ubuntuappmanager<\/font>, \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 <font color=\"#c0392b\">SurfaceFlinger<\/font> \u0438 <font color=\"#c0392b\">InputDispatcher<\/font> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438\u0437 \u0443\u0433\u043e\u043b\u043a\u043e\u0432 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u043e\u043d\u043e\u0439 \u0442\u0435\u043c\u044b. \u041d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u0430\u044f \u0438\u0441\u0442\u043e\u0440\u0438\u044f.<\/p>\n<p>  \u0427\u0435\u0440\u0435\u0437 \u043d\u0435\u0434\u0435\u043b\u044e \u043f\u0440\u0438\u0435\u0434\u0435\u0442 \u0442\u0435\u043b\u0435\u0444\u043e\u043d \u043d\u0430 Firefox OS, \u0440\u0430\u0441\u043f\u043e\u0442\u0440\u043e\u0448\u0443 \u0435\u0433\u043e\u2026    \t \t\t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/180505\/\"> http:\/\/habrahabr.ru\/post\/180505\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/26e\/9a5\/386\/26e9a5386887fca6118dfc962f3eaeaf.png\"\/><br \/>  \u041f\u0440\u0438\u0432\u0435\u0442, \u0445\u0430\u0431\u0440.<\/p>\n<p>  \u041f\u0430\u0440\u0443 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043d\u0430\u0437\u0430\u0434 \u044f \u0437\u0430\u043d\u0438\u043c\u0430\u043b\u0441\u044f \u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c <font color=\"#c0392b\">Ubuntu Touch<\/font> \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 <font color=\"#c0392b\">Allwinner A10<\/font>,<br \/>  \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0434\u0435\u043b\u0430\u043b \u0437\u0430\u043c\u0435\u0442\u043a\u0438 \u0441\u0435\u0431\u0435 \u043d\u0430 \u043f\u0430\u043c\u044f\u0442\u044c. \u0421\u0435\u0439\u0447\u0430\u0441, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043e\u043d\u0438 \u0432\u0441\u0451 \u0435\u0449\u0451 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b, \u043f\u043e\u043a\u0430 Ubuntu Touch \u043e\u043a\u043e\u043d\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u043b\u0430 \u043d\u0430 \u0441\u0432\u043e\u0439 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 <font color=\"#c0392b\">Mir<\/font> \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043b\u0438\u0446\u0430\u043c \u043d\u0430\u0439\u0442\u0438 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0443\u044e \u0442\u043e\u0447\u043a\u0443, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0431\u043b\u0438\u0437\u043a\u043e\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 UT.<\/p>\n<p>  \u0421\u0442\u0438\u043b\u044c \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0430\u043b\u0451\u043a \u043e\u0442 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043f\u0440\u043e\u0442\u0438\u0432, \u0442\u043e<br \/>  \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u044e \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-180505","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/180505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=180505"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/180505\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=180505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=180505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=180505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}