Merge lp:~ken-vandine/content-hub/trust_session_wip into lp:content-hub
- trust_session_wip
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 314 |
Proposed branch: | lp:~ken-vandine/content-hub/trust_session_wip |
Merge into: | lp:content-hub |
Diff against target: |
1425 lines (+1032/-9) 25 files modified
CMakeLists.txt (+4/-2) debian/content-hub.install (+1/-0) debian/control (+2/-0) import/Ubuntu/Content/contenthub.h (+1/-0) include/com/ubuntu/content/transfer.h (+4/-0) src/CMakeLists.txt (+2/-1) src/com/ubuntu/applicationmanager/application_manager.h (+14/-0) src/com/ubuntu/content/CMakeLists.txt (+3/-0) src/com/ubuntu/content/detail/app_manager.cpp (+29/-1) src/com/ubuntu/content/detail/app_manager.h (+2/-0) src/com/ubuntu/content/detail/com.ubuntu.content.Service.xml (+4/-0) src/com/ubuntu/content/detail/com.ubuntu.content.Transfer.xml (+9/-0) src/com/ubuntu/content/detail/mir-helper.cpp (+235/-0) src/com/ubuntu/content/detail/mir-helper.h (+69/-0) src/com/ubuntu/content/detail/service.cpp (+54/-4) src/com/ubuntu/content/detail/service.h (+5/-1) src/com/ubuntu/content/detail/transfer.cpp (+38/-0) src/com/ubuntu/content/detail/transfer.h (+7/-0) src/com/ubuntu/content/transfer.cpp (+10/-0) src/com/ubuntu/content/transfer_p.h (+19/-0) src/helper/CMakeLists.txt (+61/-0) src/helper/exec-tool.c (+222/-0) src/helper/exec-tool.cpp (+107/-0) src/helper/mir-connection-demangler.c (+126/-0) tests/acceptance-tests/app_manager_mock.h (+4/-0) |
To merge this branch: | bzr merge lp:~ken-vandine/content-hub/trust_session_wip |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
system-apps-ci-bot | continuous-integration | Needs Fixing | |
PS Jenkins bot | continuous-integration | Needs Fixing | |
Ubuntu Phablet Team | Pending | ||
Review via email: mp+250843@code.launchpad.net |
Commit message
Description of the change
Just to get a CI run
PS Jenkins bot (ps-jenkins) wrote : | # |
- 188. By Ken VanDine
-
Moved the session creation to the service
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:188
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 189. By Ken VanDine
-
Fixed getting proper clientPid
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:189
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 190. By Ken VanDine
-
fixed a crash on systems without Mir
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:190
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 191. By Ken VanDine
-
Re-implemetation of the exec-tool based on the one from pay-service
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:191
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 192. By Ken VanDine
-
use mir-connection-
demangler
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:192
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 193. By Ken VanDine
-
fixed CONTENT_
HUB_MIR_ SOCKET env
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:193
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 194. By Ken VanDine
-
pass just the fd id
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:194
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 195. By Ken VanDine
-
fixed dbus call to service
- 196. By Ken VanDine
-
ensure the id for the socket is returned as a string
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:196
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 197. By Ken VanDine
-
Fixed reference
- 198. By Ken VanDine
-
MirHelper fixes
- 199. By Ken VanDine
-
more debug output
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:199
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 200. By Ken VanDine
-
more debug output
- 201. By Ken VanDine
-
Hold a reference to the promptSession with the Transfer
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:200
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:201
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 202. By Ken VanDine
-
Removed un-needed unref
- 203. By Ken VanDine
-
ensure the promptSession is destroyed in the Transfer destructor
- 204. By Ken VanDine
-
Delete reference to promptSession in the destructor
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:204
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 205. By Ken VanDine
-
fixed ref
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:205
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 206. By Ken VanDine
-
Debugging output
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:206
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 207. By Ken VanDine
-
fixed shell quoting
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:207
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 208. By Ken VanDine
-
working, mostly
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:208
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 209. By Ken VanDine
-
use ubuntu_
app_launch_ stop_helper to stop apps started with a PromptSession
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:209
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
system-apps-ci-bot (system-apps-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:209
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2014-08-14 11:49:28 +0000 | |||
3 | +++ CMakeLists.txt 2015-03-18 18:55:05 +0000 | |||
4 | @@ -16,7 +16,7 @@ | |||
5 | 16 | 16 | ||
6 | 17 | cmake_minimum_required(VERSION 2.8) | 17 | cmake_minimum_required(VERSION 2.8) |
7 | 18 | 18 | ||
9 | 19 | project(content-hub) | 19 | project (content-hub C CXX) |
10 | 20 | 20 | ||
11 | 21 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) | 21 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) |
12 | 22 | 22 | ||
13 | @@ -24,7 +24,7 @@ | |||
14 | 24 | include (EnableCoverageReport) | 24 | include (EnableCoverageReport) |
15 | 25 | include (GSettings) | 25 | include (GSettings) |
16 | 26 | 26 | ||
18 | 27 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -pedantic -Wextra -fPIC -pthread") | 27 | #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wall -std=c99 -pedantic -Wextra -fPIC -pthread") |
19 | 28 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Werror -Wall -fno-strict-aliasing -pedantic -Wextra -fPIC -pthread -Wno-unused-function") | 28 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Werror -Wall -fno-strict-aliasing -pedantic -Wextra -fPIC -pthread -Wno-unused-function") |
20 | 29 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") | 29 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") |
21 | 30 | 30 | ||
22 | @@ -68,6 +68,8 @@ | |||
23 | 68 | pkg_check_modules(DBUS REQUIRED dbus-1) | 68 | pkg_check_modules(DBUS REQUIRED dbus-1) |
24 | 69 | pkg_check_modules(UBUNTU_DOWNLOAD_MANAGER REQUIRED ubuntu-download-manager-client) | 69 | pkg_check_modules(UBUNTU_DOWNLOAD_MANAGER REQUIRED ubuntu-download-manager-client) |
25 | 70 | pkg_check_modules(NOTIFY REQUIRED libnotify) | 70 | pkg_check_modules(NOTIFY REQUIRED libnotify) |
26 | 71 | pkg_check_modules(MIRCLIENT REQUIRED mirclient) | ||
27 | 72 | pkg_check_modules(CLICK REQUIRED click-0.4) | ||
28 | 71 | 73 | ||
29 | 72 | add_definitions(-DDEBUG_ENABLED) | 74 | add_definitions(-DDEBUG_ENABLED) |
30 | 73 | 75 | ||
31 | 74 | 76 | ||
32 | === modified file 'debian/content-hub.install' | |||
33 | --- debian/content-hub.install 2014-11-18 14:59:03 +0000 | |||
34 | +++ debian/content-hub.install 2015-03-18 18:55:05 +0000 | |||
35 | @@ -1,5 +1,6 @@ | |||
36 | 1 | usr/bin/content-hub-service | 1 | usr/bin/content-hub-service |
37 | 2 | usr/lib/*/content-hub | 2 | usr/lib/*/content-hub |
38 | 3 | usr/lib/*/ubuntu-app-launch | ||
39 | 3 | usr/share/click/hooks | 4 | usr/share/click/hooks |
40 | 4 | usr/share/dbus-1 | 5 | usr/share/dbus-1 |
41 | 5 | usr/share/glib-2.0/schemas | 6 | usr/share/glib-2.0/schemas |
42 | 6 | 7 | ||
43 | === modified file 'debian/control' | |||
44 | --- debian/control 2014-11-18 14:59:03 +0000 | |||
45 | +++ debian/control 2015-03-18 18:55:05 +0000 | |||
46 | @@ -9,8 +9,10 @@ | |||
47 | 9 | doxygen, | 9 | doxygen, |
48 | 10 | google-mock, | 10 | google-mock, |
49 | 11 | lcov, | 11 | lcov, |
50 | 12 | libclick-0.4-dev, | ||
51 | 12 | libglib2.0-dev, | 13 | libglib2.0-dev, |
52 | 13 | libgsettings-qt-dev, | 14 | libgsettings-qt-dev, |
53 | 15 | libmirclient-dev [!powerpc !ppc64 !ppc64el], | ||
54 | 14 | libnih-dbus-dev, | 16 | libnih-dbus-dev, |
55 | 15 | libnotify-dev, | 17 | libnotify-dev, |
56 | 16 | libubuntu-download-manager-client-dev, | 18 | libubuntu-download-manager-client-dev, |
57 | 17 | 19 | ||
58 | === modified file 'import/Ubuntu/Content/contenthub.h' | |||
59 | --- import/Ubuntu/Content/contenthub.h 2014-08-04 17:57:26 +0000 | |||
60 | +++ import/Ubuntu/Content/contenthub.h 2015-03-18 18:55:05 +0000 | |||
61 | @@ -71,6 +71,7 @@ | |||
62 | 71 | void updateState(); | 71 | void updateState(); |
63 | 72 | 72 | ||
64 | 73 | private: | 73 | private: |
65 | 74 | QString setupPromptSession(); | ||
66 | 74 | QList<ContentTransfer *> m_finishedImports; | 75 | QList<ContentTransfer *> m_finishedImports; |
67 | 75 | QHash<com::ubuntu::content::Transfer *, ContentTransfer *> m_activeImports; | 76 | QHash<com::ubuntu::content::Transfer *, ContentTransfer *> m_activeImports; |
68 | 76 | com::ubuntu::content::Hub *m_hub; | 77 | com::ubuntu::content::Hub *m_hub; |
69 | 77 | 78 | ||
70 | === modified file 'include/com/ubuntu/content/transfer.h' | |||
71 | --- include/com/ubuntu/content/transfer.h 2014-08-27 13:49:13 +0000 | |||
72 | +++ include/com/ubuntu/content/transfer.h 2015-03-18 18:55:05 +0000 | |||
73 | @@ -64,6 +64,7 @@ | |||
74 | 64 | Q_PROPERTY(QString contentType READ contentType) | 64 | Q_PROPERTY(QString contentType READ contentType) |
75 | 65 | Q_PROPERTY(QString source READ source) | 65 | Q_PROPERTY(QString source READ source) |
76 | 66 | Q_PROPERTY(QString destination READ destination) | 66 | Q_PROPERTY(QString destination READ destination) |
77 | 67 | Q_PROPERTY(QString mirSocket READ mirSocket WRITE setMirSocket NOTIFY mirSocketChanged) | ||
78 | 67 | 68 | ||
79 | 68 | public: | 69 | public: |
80 | 69 | enum State | 70 | enum State |
81 | @@ -115,11 +116,14 @@ | |||
82 | 115 | Q_INVOKABLE virtual QString contentType() const; | 116 | Q_INVOKABLE virtual QString contentType() const; |
83 | 116 | Q_INVOKABLE virtual QString source() const; | 117 | Q_INVOKABLE virtual QString source() const; |
84 | 117 | Q_INVOKABLE virtual QString destination() const; | 118 | Q_INVOKABLE virtual QString destination() const; |
85 | 119 | Q_INVOKABLE virtual QString mirSocket() const; | ||
86 | 120 | Q_INVOKABLE virtual bool setMirSocket(const QString); | ||
87 | 118 | 121 | ||
88 | 119 | Q_SIGNAL void stateChanged(); | 122 | Q_SIGNAL void stateChanged(); |
89 | 120 | Q_SIGNAL void storeChanged(); | 123 | Q_SIGNAL void storeChanged(); |
90 | 121 | Q_SIGNAL void selectionTypeChanged(); | 124 | Q_SIGNAL void selectionTypeChanged(); |
91 | 122 | Q_SIGNAL void downloadIdChanged(); | 125 | Q_SIGNAL void downloadIdChanged(); |
92 | 126 | Q_SIGNAL void mirSocketChanged(); | ||
93 | 123 | 127 | ||
94 | 124 | private: | 128 | private: |
95 | 125 | struct Private; | 129 | struct Private; |
96 | 126 | 130 | ||
97 | === modified file 'src/CMakeLists.txt' | |||
98 | --- src/CMakeLists.txt 2013-07-15 11:07:50 +0000 | |||
99 | +++ src/CMakeLists.txt 2015-03-18 18:55:05 +0000 | |||
100 | @@ -14,4 +14,5 @@ | |||
101 | 14 | # | 14 | # |
102 | 15 | # Authored by: Thomas Voss <thomas.voss@canonical.com> | 15 | # Authored by: Thomas Voss <thomas.voss@canonical.com> |
103 | 16 | 16 | ||
104 | 17 | add_subdirectory(com) | ||
105 | 18 | \ No newline at end of file | 17 | \ No newline at end of file |
106 | 18 | add_subdirectory(com) | ||
107 | 19 | add_subdirectory(helper) | ||
108 | 19 | 20 | ||
109 | === modified file 'src/com/ubuntu/applicationmanager/application_manager.h' | |||
110 | --- src/com/ubuntu/applicationmanager/application_manager.h 2014-05-26 06:45:57 +0000 | |||
111 | +++ src/com/ubuntu/applicationmanager/application_manager.h 2015-03-18 18:55:05 +0000 | |||
112 | @@ -38,6 +38,20 @@ | |||
113 | 38 | * \param app_id ID for the application (for example "gallery-app" - used for the desktop) | 38 | * \param app_id ID for the application (for example "gallery-app" - used for the desktop) |
114 | 39 | */ | 39 | */ |
115 | 40 | virtual bool invoke_application(const std::string &app_id) = 0; | 40 | virtual bool invoke_application(const std::string &app_id) = 0; |
116 | 41 | |||
117 | 42 | /*! | ||
118 | 43 | * \brief invoke_application_with_socket starts an application without a trusted session | ||
119 | 44 | * \param app_id ID for the application (for example "gallery-app" - used for the desktop) | ||
120 | 45 | * \param socket path to MIR_SOCKET | ||
121 | 46 | */ | ||
122 | 47 | virtual bool invoke_application_with_socket(const std::string &app_id, const std::string &socket) = 0; | ||
123 | 48 | |||
124 | 49 | /*! | ||
125 | 50 | * \brief stop_application_with_helper stops an application started by the content-hub helper | ||
126 | 51 | * \param app_id ID for the application (for example "gallery-app" - used for the desktop) | ||
127 | 52 | */ | ||
128 | 53 | virtual bool stop_application_with_helper(const std::string &app_id) = 0; | ||
129 | 54 | |||
130 | 41 | /*! | 55 | /*! |
131 | 42 | * \brief stop_application stops an application started by ubuntu | 56 | * \brief stop_application stops an application started by ubuntu |
132 | 43 | * \param app_id ID for the application (for example "gallery-app" - used for the desktop) | 57 | * \param app_id ID for the application (for example "gallery-app" - used for the desktop) |
133 | 44 | 58 | ||
134 | === modified file 'src/com/ubuntu/content/CMakeLists.txt' | |||
135 | --- src/com/ubuntu/content/CMakeLists.txt 2014-05-26 06:45:57 +0000 | |||
136 | +++ src/com/ubuntu/content/CMakeLists.txt 2015-03-18 18:55:05 +0000 | |||
137 | @@ -28,6 +28,7 @@ | |||
138 | 28 | ${UBUNTU_LAUNCH_INCLUDE_DIRS} | 28 | ${UBUNTU_LAUNCH_INCLUDE_DIRS} |
139 | 29 | ${UBUNTU_DOWNLOAD_MANAGER_INCLUDE_DIRS} | 29 | ${UBUNTU_DOWNLOAD_MANAGER_INCLUDE_DIRS} |
140 | 30 | ${NOTIFY_INCLUDE_DIRS} | 30 | ${NOTIFY_INCLUDE_DIRS} |
141 | 31 | ${MIRCLIENT_INCLUDE_DIRS} | ||
142 | 31 | ) | 32 | ) |
143 | 32 | 33 | ||
144 | 33 | qt5_add_dbus_interface( | 34 | qt5_add_dbus_interface( |
145 | @@ -77,6 +78,7 @@ | |||
146 | 77 | detail/transfer.cpp | 78 | detail/transfer.cpp |
147 | 78 | detail/handler.cpp | 79 | detail/handler.cpp |
148 | 79 | detail/i18n.cpp | 80 | detail/i18n.cpp |
149 | 81 | detail/mir-helper.cpp | ||
150 | 80 | 82 | ||
151 | 81 | ${CONTENT_HUB_MOCS} | 83 | ${CONTENT_HUB_MOCS} |
152 | 82 | ${CONTENT_SERVICE_STUB} | 84 | ${CONTENT_SERVICE_STUB} |
153 | @@ -105,6 +107,7 @@ | |||
154 | 105 | ${GIO_LIBRARIES} | 107 | ${GIO_LIBRARIES} |
155 | 106 | ${UBUNTU_DOWNLOAD_MANAGER_LIBRARIES} | 108 | ${UBUNTU_DOWNLOAD_MANAGER_LIBRARIES} |
156 | 107 | ${NOTIFY_LIBRARIES} | 109 | ${NOTIFY_LIBRARIES} |
157 | 110 | ${MIRCLIENT_LIBRARIES} | ||
158 | 108 | ) | 111 | ) |
159 | 109 | 112 | ||
160 | 110 | install( | 113 | install( |
161 | 111 | 114 | ||
162 | === modified file 'src/com/ubuntu/content/detail/app_manager.cpp' | |||
163 | --- src/com/ubuntu/content/detail/app_manager.cpp 2014-05-26 06:45:57 +0000 | |||
164 | +++ src/com/ubuntu/content/detail/app_manager.cpp 2015-03-18 18:55:05 +0000 | |||
165 | @@ -24,7 +24,6 @@ | |||
166 | 24 | /*! | 24 | /*! |
167 | 25 | * \reimp | 25 | * \reimp |
168 | 26 | */ | 26 | */ |
169 | 27 | |||
170 | 28 | bool cucd::AppManager::invoke_application(const std::string &app_id) | 27 | bool cucd::AppManager::invoke_application(const std::string &app_id) |
171 | 29 | { | 28 | { |
172 | 30 | TRACE() << Q_FUNC_INFO << "APP_ID:" << app_id.c_str(); | 29 | TRACE() << Q_FUNC_INFO << "APP_ID:" << app_id.c_str(); |
173 | @@ -36,6 +35,35 @@ | |||
174 | 36 | /*! | 35 | /*! |
175 | 37 | * \reimp | 36 | * \reimp |
176 | 38 | */ | 37 | */ |
177 | 38 | bool cucd::AppManager::invoke_application_with_socket(const std::string &app_id, const std::string &socket) | ||
178 | 39 | { | ||
179 | 40 | TRACE() << Q_FUNC_INFO << "APP_ID:" << app_id.c_str(); | ||
180 | 41 | QVector<const gchar*> uris; | ||
181 | 42 | uris.append(g_strdup_printf("%s", socket.c_str())); | ||
182 | 43 | uris.append(""); | ||
183 | 44 | uris.append(NULL); | ||
184 | 45 | TRACE() << Q_FUNC_INFO << "URIS:" << g_strdup_printf("%s", socket.c_str()); | ||
185 | 46 | gboolean ok = ubuntu_app_launch_start_helper("content-hub", | ||
186 | 47 | app_id.c_str(), | ||
187 | 48 | uris.constData()); | ||
188 | 49 | return static_cast<bool>(ok); | ||
189 | 50 | } | ||
190 | 51 | |||
191 | 52 | /*! | ||
192 | 53 | * \reimp | ||
193 | 54 | */ | ||
194 | 55 | bool cucd::AppManager::stop_application_with_helper(const std::string &app_id) | ||
195 | 56 | { | ||
196 | 57 | TRACE() << Q_FUNC_INFO << "APP_ID:" << app_id.c_str(); | ||
197 | 58 | |||
198 | 59 | gboolean ok = ubuntu_app_launch_stop_helper("content-hub", | ||
199 | 60 | app_id.c_str()); | ||
200 | 61 | return static_cast<bool>(ok); | ||
201 | 62 | } | ||
202 | 63 | |||
203 | 64 | /*! | ||
204 | 65 | * \reimp | ||
205 | 66 | */ | ||
206 | 39 | bool cucd::AppManager::stop_application(const std::string &app_id) | 67 | bool cucd::AppManager::stop_application(const std::string &app_id) |
207 | 40 | { | 68 | { |
208 | 41 | TRACE() << Q_FUNC_INFO << "APP_ID:" << app_id.c_str(); | 69 | TRACE() << Q_FUNC_INFO << "APP_ID:" << app_id.c_str(); |
209 | 42 | 70 | ||
210 | === modified file 'src/com/ubuntu/content/detail/app_manager.h' | |||
211 | --- src/com/ubuntu/content/detail/app_manager.h 2014-02-13 19:11:43 +0000 | |||
212 | +++ src/com/ubuntu/content/detail/app_manager.h 2015-03-18 18:55:05 +0000 | |||
213 | @@ -36,6 +36,8 @@ | |||
214 | 36 | AppManager& operator=(const AppManager&) = default; | 36 | AppManager& operator=(const AppManager&) = default; |
215 | 37 | 37 | ||
216 | 38 | virtual bool invoke_application(const std::string &app_id); | 38 | virtual bool invoke_application(const std::string &app_id); |
217 | 39 | virtual bool invoke_application_with_socket(const std::string &app_id, const std::string &socket); | ||
218 | 40 | virtual bool stop_application_with_helper(const std::string &app_id); | ||
219 | 39 | virtual bool stop_application(const std::string &app_id); | 41 | virtual bool stop_application(const std::string &app_id); |
220 | 40 | virtual bool is_application_started(const std::string &app_id); | 42 | virtual bool is_application_started(const std::string &app_id); |
221 | 41 | }; | 43 | }; |
222 | 42 | 44 | ||
223 | === modified file 'src/com/ubuntu/content/detail/com.ubuntu.content.Service.xml' | |||
224 | --- src/com/ubuntu/content/detail/com.ubuntu.content.Service.xml 2014-08-04 17:56:09 +0000 | |||
225 | +++ src/com/ubuntu/content/detail/com.ubuntu.content.Service.xml 2015-03-18 18:55:05 +0000 | |||
226 | @@ -43,5 +43,9 @@ | |||
227 | 43 | <method name="HandlerActive"> | 43 | <method name="HandlerActive"> |
228 | 44 | <arg name="peer_id" type="s" direction="in" /> | 44 | <arg name="peer_id" type="s" direction="in" /> |
229 | 45 | </method> | 45 | </method> |
230 | 46 | <method name="GetMirSocket"> | ||
231 | 47 | <arg type="i" name="fd" direction="in" /> | ||
232 | 48 | <arg type="h" name="handle" direction="out" /> | ||
233 | 49 | </method> | ||
234 | 46 | </interface> | 50 | </interface> |
235 | 47 | </node> | 51 | </node> |
236 | 48 | 52 | ||
237 | === modified file 'src/com/ubuntu/content/detail/com.ubuntu.content.Transfer.xml' | |||
238 | --- src/com/ubuntu/content/detail/com.ubuntu.content.Transfer.xml 2014-08-27 13:49:13 +0000 | |||
239 | +++ src/com/ubuntu/content/detail/com.ubuntu.content.Transfer.xml 2015-03-18 18:55:05 +0000 | |||
240 | @@ -64,5 +64,14 @@ | |||
241 | 64 | <method name="destination"> | 64 | <method name="destination"> |
242 | 65 | <arg name="destination" type="s" direction="out" /> | 65 | <arg name="destination" type="s" direction="out" /> |
243 | 66 | </method> | 66 | </method> |
244 | 67 | <method name="MirSocket"> | ||
245 | 68 | <arg name="mir_socket" type="s" direction="out" /> | ||
246 | 69 | </method> | ||
247 | 70 | <method name="SetMirSocket"> | ||
248 | 71 | <arg name="mir_socket" type="s" direction="in" /> | ||
249 | 72 | </method> | ||
250 | 73 | <signal name="MirSocketChanged"> | ||
251 | 74 | <arg name="mir_socket" type="s"/> | ||
252 | 75 | </signal> | ||
253 | 67 | </interface> | 76 | </interface> |
254 | 68 | </node> | 77 | </node> |
255 | 69 | 78 | ||
256 | === added file 'src/com/ubuntu/content/detail/mir-helper.cpp' | |||
257 | --- src/com/ubuntu/content/detail/mir-helper.cpp 1970-01-01 00:00:00 +0000 | |||
258 | +++ src/com/ubuntu/content/detail/mir-helper.cpp 2015-03-18 18:55:05 +0000 | |||
259 | @@ -0,0 +1,235 @@ | |||
260 | 1 | /* | ||
261 | 2 | * Copyright 2015 Canonical Ltd. | ||
262 | 3 | * | ||
263 | 4 | * This program is free software; you can redistribute it and/or modify | ||
264 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
265 | 6 | * the Free Software Foundation; version 3. | ||
266 | 7 | * | ||
267 | 8 | * This program is distributed in the hope that it will be useful, | ||
268 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
269 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
270 | 11 | * GNU Lesser General Public License for more details. | ||
271 | 12 | * | ||
272 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
273 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
274 | 15 | */ | ||
275 | 16 | |||
276 | 17 | #include "debug.h" | ||
277 | 18 | #include "mir-helper.h" | ||
278 | 19 | |||
279 | 20 | #include <mir_toolkit/mir_client_library.h> | ||
280 | 21 | #include <mir_toolkit/mir_prompt_session.h> | ||
281 | 22 | |||
282 | 23 | #include <QHash> | ||
283 | 24 | #include <QStandardPaths> | ||
284 | 25 | #include <QWeakPointer> | ||
285 | 26 | |||
286 | 27 | static MirHelper *m_instance = 0; | ||
287 | 28 | |||
288 | 29 | class PromptSessionPrivate | ||
289 | 30 | { | ||
290 | 31 | public: | ||
291 | 32 | inline PromptSessionPrivate(MirPromptSession *session, pid_t initiatorPid); | ||
292 | 33 | inline ~PromptSessionPrivate(); | ||
293 | 34 | |||
294 | 35 | void emitFinished() { Q_EMIT q_ptr->finished(); } | ||
295 | 36 | |||
296 | 37 | MirPromptSession *m_mirSession; | ||
297 | 38 | pid_t m_initiatorPid; | ||
298 | 39 | QList<int> m_fds; | ||
299 | 40 | mutable PromptSession *q_ptr; | ||
300 | 41 | }; | ||
301 | 42 | |||
302 | 43 | class MirHelperPrivate: public QObject | ||
303 | 44 | { | ||
304 | 45 | Q_OBJECT | ||
305 | 46 | Q_DECLARE_PUBLIC(MirHelper) | ||
306 | 47 | |||
307 | 48 | public: | ||
308 | 49 | inline MirHelperPrivate(MirHelper *helper); | ||
309 | 50 | inline ~MirHelperPrivate(); | ||
310 | 51 | |||
311 | 52 | PromptSession *createPromptSession(pid_t initiatorPid); | ||
312 | 53 | void onSessionStopped(MirPromptSession *mirSession); | ||
313 | 54 | |||
314 | 55 | private: | ||
315 | 56 | friend class PromptSession; | ||
316 | 57 | MirConnection *m_connection; | ||
317 | 58 | QHash<pid_t,QWeakPointer<PromptSession> > m_sessions; | ||
318 | 59 | mutable MirHelper *q_ptr; | ||
319 | 60 | }; | ||
320 | 61 | |||
321 | 62 | PromptSessionPrivate::PromptSessionPrivate(MirPromptSession *session, | ||
322 | 63 | pid_t initiatorPid): | ||
323 | 64 | m_mirSession(session), | ||
324 | 65 | m_initiatorPid(initiatorPid) | ||
325 | 66 | { | ||
326 | 67 | TRACE() << Q_FUNC_INFO; | ||
327 | 68 | } | ||
328 | 69 | |||
329 | 70 | PromptSessionPrivate::~PromptSessionPrivate() | ||
330 | 71 | { | ||
331 | 72 | mir_prompt_session_release_sync(m_mirSession); | ||
332 | 73 | m_mirSession = 0; | ||
333 | 74 | } | ||
334 | 75 | |||
335 | 76 | PromptSession::PromptSession(PromptSessionPrivate *priv): | ||
336 | 77 | d_ptr(priv) | ||
337 | 78 | { | ||
338 | 79 | TRACE() << Q_FUNC_INFO; | ||
339 | 80 | priv->q_ptr = this; | ||
340 | 81 | } | ||
341 | 82 | |||
342 | 83 | PromptSession::~PromptSession() | ||
343 | 84 | { | ||
344 | 85 | TRACE() << Q_FUNC_INFO; | ||
345 | 86 | Q_D(PromptSession); | ||
346 | 87 | MirHelperPrivate *helperPrivate = MirHelper::instance()->d_ptr; | ||
347 | 88 | helperPrivate->m_sessions.remove(d->m_initiatorPid); | ||
348 | 89 | delete d_ptr; | ||
349 | 90 | } | ||
350 | 91 | |||
351 | 92 | static void client_fd_callback(MirPromptSession *, size_t count, | ||
352 | 93 | int const *fds, void *context) | ||
353 | 94 | { | ||
354 | 95 | TRACE() << Q_FUNC_INFO; | ||
355 | 96 | PromptSessionPrivate *priv = (PromptSessionPrivate *)context; | ||
356 | 97 | for (size_t i = 0; i < count; i++) { | ||
357 | 98 | priv->m_fds.append(fds[i]); | ||
358 | 99 | } | ||
359 | 100 | } | ||
360 | 101 | |||
361 | 102 | void PromptSession::release() | ||
362 | 103 | { | ||
363 | 104 | TRACE() << Q_FUNC_INFO; | ||
364 | 105 | Q_D(PromptSession); | ||
365 | 106 | if (d->m_mirSession) | ||
366 | 107 | mir_prompt_session_release_sync(d->m_mirSession); | ||
367 | 108 | d->m_mirSession = NULL; | ||
368 | 109 | } | ||
369 | 110 | |||
370 | 111 | QString PromptSession::requestSocket() | ||
371 | 112 | { | ||
372 | 113 | TRACE() << Q_FUNC_INFO; | ||
373 | 114 | Q_D(PromptSession); | ||
374 | 115 | |||
375 | 116 | d->m_fds.clear(); | ||
376 | 117 | mir_wait_for(mir_prompt_session_new_fds_for_prompt_providers( | ||
377 | 118 | d->m_mirSession, 1, client_fd_callback, d)); | ||
378 | 119 | if (!d->m_fds.isEmpty()) { | ||
379 | 120 | return QString("%1").arg(d->m_fds[0]); | ||
380 | 121 | } else { | ||
381 | 122 | return QString(); | ||
382 | 123 | } | ||
383 | 124 | } | ||
384 | 125 | |||
385 | 126 | MirHelperPrivate::MirHelperPrivate(MirHelper *helper): | ||
386 | 127 | QObject(helper), | ||
387 | 128 | q_ptr(helper) | ||
388 | 129 | { | ||
389 | 130 | TRACE() << Q_FUNC_INFO; | ||
390 | 131 | QString mirSocket = | ||
391 | 132 | QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) + | ||
392 | 133 | "/mir_socket_trusted"; | ||
393 | 134 | m_connection = mir_connect_sync(mirSocket.toUtf8().constData(), | ||
394 | 135 | "content-hub-service"); | ||
395 | 136 | if (Q_UNLIKELY(!mir_connection_is_valid(m_connection))) { | ||
396 | 137 | qWarning() << "Invalid Mir connection:" << | ||
397 | 138 | mir_connection_get_error_message(m_connection); | ||
398 | 139 | return; | ||
399 | 140 | } | ||
400 | 141 | } | ||
401 | 142 | |||
402 | 143 | MirHelperPrivate::~MirHelperPrivate() | ||
403 | 144 | { | ||
404 | 145 | TRACE() << Q_FUNC_INFO; | ||
405 | 146 | if (m_connection) { | ||
406 | 147 | mir_connection_release(m_connection); | ||
407 | 148 | m_connection = 0; | ||
408 | 149 | } | ||
409 | 150 | } | ||
410 | 151 | |||
411 | 152 | static void session_event_callback(MirPromptSession *mirSession, | ||
412 | 153 | MirPromptSessionState state, | ||
413 | 154 | void *self) | ||
414 | 155 | { | ||
415 | 156 | TRACE() << Q_FUNC_INFO; | ||
416 | 157 | MirHelperPrivate *helper = reinterpret_cast<MirHelperPrivate*>(self); | ||
417 | 158 | TRACE() << "Prompt Session state updated to" << state; | ||
418 | 159 | if (state == mir_prompt_session_state_stopped) { | ||
419 | 160 | helper->onSessionStopped(mirSession); | ||
420 | 161 | } | ||
421 | 162 | } | ||
422 | 163 | |||
423 | 164 | void MirHelperPrivate::onSessionStopped(MirPromptSession *mirSession) | ||
424 | 165 | { | ||
425 | 166 | TRACE() << Q_FUNC_INFO; | ||
426 | 167 | Q_FOREACH(PromptSessionP session, m_sessions) { | ||
427 | 168 | if (mirSession == session->d_ptr->m_mirSession) { | ||
428 | 169 | session->d_ptr->emitFinished(); | ||
429 | 170 | } | ||
430 | 171 | } | ||
431 | 172 | } | ||
432 | 173 | |||
433 | 174 | PromptSession *MirHelperPrivate::createPromptSession(pid_t initiatorPid) | ||
434 | 175 | { | ||
435 | 176 | TRACE() << Q_FUNC_INFO << initiatorPid; | ||
436 | 177 | if (Q_UNLIKELY(!m_connection)) return 0; | ||
437 | 178 | if (Q_UNLIKELY(!mir_connection_is_valid(m_connection))) return 0; | ||
438 | 179 | |||
439 | 180 | MirPromptSession *mirSession = | ||
440 | 181 | mir_connection_create_prompt_session_sync(m_connection, | ||
441 | 182 | initiatorPid, | ||
442 | 183 | session_event_callback, | ||
443 | 184 | this); | ||
444 | 185 | if (!mirSession) return 0; | ||
445 | 186 | |||
446 | 187 | if (Q_UNLIKELY(!mir_prompt_session_is_valid(mirSession))) { | ||
447 | 188 | qWarning() << "Invalid prompt session:" << | ||
448 | 189 | mir_prompt_session_error_message(mirSession); | ||
449 | 190 | return 0; | ||
450 | 191 | } | ||
451 | 192 | |||
452 | 193 | return new PromptSession(new PromptSessionPrivate(mirSession, initiatorPid)); | ||
453 | 194 | } | ||
454 | 195 | |||
455 | 196 | MirHelper::MirHelper(QObject *parent): | ||
456 | 197 | QObject(parent), | ||
457 | 198 | d_ptr(new MirHelperPrivate(this)) | ||
458 | 199 | { | ||
459 | 200 | TRACE() << Q_FUNC_INFO; | ||
460 | 201 | } | ||
461 | 202 | |||
462 | 203 | MirHelper::~MirHelper() | ||
463 | 204 | { | ||
464 | 205 | TRACE() << Q_FUNC_INFO; | ||
465 | 206 | m_instance = 0; | ||
466 | 207 | } | ||
467 | 208 | |||
468 | 209 | MirHelper *MirHelper::instance() | ||
469 | 210 | { | ||
470 | 211 | TRACE() << Q_FUNC_INFO; | ||
471 | 212 | if (!m_instance) { | ||
472 | 213 | m_instance = new MirHelper; | ||
473 | 214 | } | ||
474 | 215 | return m_instance; | ||
475 | 216 | } | ||
476 | 217 | |||
477 | 218 | PromptSessionP MirHelper::createPromptSession(pid_t initiatorPid) | ||
478 | 219 | { | ||
479 | 220 | Q_D(MirHelper); | ||
480 | 221 | TRACE() << Q_FUNC_INFO << initiatorPid; | ||
481 | 222 | PromptSessionP session = d->m_sessions.value(initiatorPid); | ||
482 | 223 | if (session.isNull()) { | ||
483 | 224 | TRACE() << Q_FUNC_INFO << "Session is NULL"; | ||
484 | 225 | PromptSession *s = d->createPromptSession(initiatorPid); | ||
485 | 226 | if (s) { | ||
486 | 227 | TRACE() << Q_FUNC_INFO << "Creating new session"; | ||
487 | 228 | session = PromptSessionP(s); | ||
488 | 229 | d->m_sessions.insert(initiatorPid, session); | ||
489 | 230 | } | ||
490 | 231 | } | ||
491 | 232 | return session; | ||
492 | 233 | } | ||
493 | 234 | |||
494 | 235 | #include "mir-helper.moc" | ||
495 | 0 | 236 | ||
496 | === added file 'src/com/ubuntu/content/detail/mir-helper.h' | |||
497 | --- src/com/ubuntu/content/detail/mir-helper.h 1970-01-01 00:00:00 +0000 | |||
498 | +++ src/com/ubuntu/content/detail/mir-helper.h 2015-03-18 18:55:05 +0000 | |||
499 | @@ -0,0 +1,69 @@ | |||
500 | 1 | /* | ||
501 | 2 | * Copyright 2015 Canonical Ltd. | ||
502 | 3 | * | ||
503 | 4 | * This program is free software; you can redistribute it and/or modify | ||
504 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
505 | 6 | * the Free Software Foundation; version 3. | ||
506 | 7 | * | ||
507 | 8 | * This program is distributed in the hope that it will be useful, | ||
508 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
509 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
510 | 11 | * GNU Lesser General Public License for more details. | ||
511 | 12 | * | ||
512 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
513 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
514 | 15 | */ | ||
515 | 16 | |||
516 | 17 | #ifndef MIR_HELPER_H | ||
517 | 18 | #define MIR_HELPER_H | ||
518 | 19 | |||
519 | 20 | #include <QObject> | ||
520 | 21 | #include <QSharedPointer> | ||
521 | 22 | |||
522 | 23 | class PromptSessionPrivate; | ||
523 | 24 | class MirHelperPrivate; | ||
524 | 25 | |||
525 | 26 | class PromptSession: public QObject | ||
526 | 27 | { | ||
527 | 28 | Q_OBJECT | ||
528 | 29 | |||
529 | 30 | public: | ||
530 | 31 | ~PromptSession(); | ||
531 | 32 | |||
532 | 33 | QString requestSocket(); | ||
533 | 34 | void release(); | ||
534 | 35 | |||
535 | 36 | Q_SIGNALS: | ||
536 | 37 | void finished(); | ||
537 | 38 | |||
538 | 39 | private: | ||
539 | 40 | explicit PromptSession(PromptSessionPrivate *priv); | ||
540 | 41 | |||
541 | 42 | private: | ||
542 | 43 | friend class MirHelperPrivate; | ||
543 | 44 | PromptSessionPrivate *d_ptr; | ||
544 | 45 | Q_DECLARE_PRIVATE(PromptSession) | ||
545 | 46 | }; | ||
546 | 47 | |||
547 | 48 | typedef QSharedPointer<PromptSession> PromptSessionP; | ||
548 | 49 | |||
549 | 50 | class MirHelper: public QObject | ||
550 | 51 | { | ||
551 | 52 | Q_OBJECT | ||
552 | 53 | |||
553 | 54 | public: | ||
554 | 55 | static MirHelper *instance(); | ||
555 | 56 | |||
556 | 57 | PromptSessionP createPromptSession(pid_t initiatorPid); | ||
557 | 58 | |||
558 | 59 | private: | ||
559 | 60 | explicit MirHelper(QObject *parent = 0); | ||
560 | 61 | ~MirHelper(); | ||
561 | 62 | |||
562 | 63 | private: | ||
563 | 64 | friend class PromptSession; | ||
564 | 65 | MirHelperPrivate *d_ptr; | ||
565 | 66 | Q_DECLARE_PRIVATE(MirHelper) | ||
566 | 67 | }; | ||
567 | 68 | |||
568 | 69 | #endif // MIR_HELPER_H | ||
569 | 0 | 70 | ||
570 | === modified file 'src/com/ubuntu/content/detail/service.cpp' | |||
571 | --- src/com/ubuntu/content/detail/service.cpp 2014-11-19 18:37:26 +0000 | |||
572 | +++ src/com/ubuntu/content/detail/service.cpp 2015-03-18 18:55:05 +0000 | |||
573 | @@ -168,7 +168,7 @@ | |||
574 | 168 | 168 | ||
575 | 169 | QDBusObjectPath cucd::Service::CreateImportFromPeer(const QString& peer_id, const QString& app_id, const QString& type_id) | 169 | QDBusObjectPath cucd::Service::CreateImportFromPeer(const QString& peer_id, const QString& app_id, const QString& type_id) |
576 | 170 | { | 170 | { |
578 | 171 | TRACE() << Q_FUNC_INFO; | 171 | TRACE() << Q_FUNC_INFO << "APP_ID:" << app_id << "SERVICE:" << this->message().service(); |
579 | 172 | QString dest_id = app_id; | 172 | QString dest_id = app_id; |
580 | 173 | if (dest_id.isEmpty()) | 173 | if (dest_id.isEmpty()) |
581 | 174 | { | 174 | { |
582 | @@ -314,6 +314,12 @@ | |||
583 | 314 | } | 314 | } |
584 | 315 | 315 | ||
585 | 316 | auto transfer = new cucd::Transfer(import_counter, src_id, dest_id, dir, type_id, this); | 316 | auto transfer = new cucd::Transfer(import_counter, src_id, dest_id, dir, type_id, this); |
586 | 317 | if (dir == cuc::Transfer::Import) { | ||
587 | 318 | uint clientPid = d->connection.interface()->servicePid(this->message().service()); | ||
588 | 319 | auto mirSocket = setupPromptSession(transfer, clientPid); | ||
589 | 320 | if (!mirSocket.isEmpty()) | ||
590 | 321 | transfer->SetMirSocket(mirSocket); | ||
591 | 322 | } | ||
592 | 317 | new TransferAdaptor(transfer); | 323 | new TransferAdaptor(transfer); |
593 | 318 | d->active_transfers.insert(transfer); | 324 | d->active_transfers.insert(transfer); |
594 | 319 | 325 | ||
595 | @@ -338,6 +344,28 @@ | |||
596 | 338 | return QDBusObjectPath{source}; | 344 | return QDBusObjectPath{source}; |
597 | 339 | } | 345 | } |
598 | 340 | 346 | ||
599 | 347 | QString cucd::Service::setupPromptSession(cucd::Transfer* t, uint clientPid) | ||
600 | 348 | { | ||
601 | 349 | TRACE() << Q_FUNC_INFO << "PID:" << clientPid; | ||
602 | 350 | if (!m_mirHelper) { | ||
603 | 351 | TRACE() << "No MirHelper, creating one"; | ||
604 | 352 | m_mirHelper = MirHelper::instance(); | ||
605 | 353 | } | ||
606 | 354 | PromptSessionP session = m_mirHelper->createPromptSession(clientPid); | ||
607 | 355 | if (!session) return ""; | ||
608 | 356 | |||
609 | 357 | QString mirSocket = session->requestSocket(); | ||
610 | 358 | t->SetPromptSession(session); | ||
611 | 359 | TRACE() << Q_FUNC_INFO << "mirSocket:" << mirSocket; | ||
612 | 360 | |||
613 | 361 | /* | ||
614 | 362 | QObject::connect(session.data(), SIGNAL(finished()), | ||
615 | 363 | q, SIGNAL(finished())); | ||
616 | 364 | */ | ||
617 | 365 | |||
618 | 366 | return mirSocket; | ||
619 | 367 | } | ||
620 | 368 | |||
621 | 341 | void cucd::Service::handle_imports(int state) | 369 | void cucd::Service::handle_imports(int state) |
622 | 342 | { | 370 | { |
623 | 343 | TRACE() << Q_FUNC_INFO << state; | 371 | TRACE() << Q_FUNC_INFO << state; |
624 | @@ -365,14 +393,27 @@ | |||
625 | 365 | } | 393 | } |
626 | 366 | } | 394 | } |
627 | 367 | 395 | ||
629 | 368 | d->app_manager->invoke_application(transfer->source().toStdString()); | 396 | if (transfer->MirSocket().isEmpty() || !transfer->WasSourceStartedByContentHub()) |
630 | 397 | d->app_manager->invoke_application(transfer->source().toStdString()); | ||
631 | 398 | else | ||
632 | 399 | d->app_manager->invoke_application_with_socket(transfer->source().toStdString(), transfer->MirSocket().toStdString()); | ||
633 | 369 | } | 400 | } |
634 | 370 | 401 | ||
635 | 371 | if (state == cuc::Transfer::charged) | 402 | if (state == cuc::Transfer::charged) |
636 | 372 | { | 403 | { |
637 | 373 | TRACE() << Q_FUNC_INFO << "Charged"; | 404 | TRACE() << Q_FUNC_INFO << "Charged"; |
640 | 374 | if (transfer->WasSourceStartedByContentHub()) | 405 | if (transfer->WasSourceStartedByContentHub()) { |
641 | 375 | d->app_manager->stop_application(transfer->source().toStdString()); | 406 | if (!transfer->MirSocket().isEmpty()) { |
642 | 407 | PromptSessionP pSession = transfer->PromptSession(); | ||
643 | 408 | PromptSession* session = pSession.data(); | ||
644 | 409 | if (session) | ||
645 | 410 | session->release(); | ||
646 | 411 | pSession.clear(); | ||
647 | 412 | d->app_manager->stop_application_with_helper(transfer->source().toStdString()); | ||
648 | 413 | } | ||
649 | 414 | else | ||
650 | 415 | d->app_manager->stop_application(transfer->source().toStdString()); | ||
651 | 416 | } | ||
652 | 376 | 417 | ||
653 | 377 | d->app_manager->invoke_application(transfer->destination().toStdString()); | 418 | d->app_manager->invoke_application(transfer->destination().toStdString()); |
654 | 378 | 419 | ||
655 | @@ -598,3 +639,12 @@ | |||
656 | 598 | } | 639 | } |
657 | 599 | } | 640 | } |
658 | 600 | } | 641 | } |
659 | 642 | |||
660 | 643 | QDBusUnixFileDescriptor cucd::Service::GetMirSocket(int fd_id) | ||
661 | 644 | { | ||
662 | 645 | TRACE() << Q_FUNC_INFO << fd_id; | ||
663 | 646 | auto fd = QDBusUnixFileDescriptor(fd_id); | ||
664 | 647 | TRACE() << Q_FUNC_INFO << "FD isValid" << fd.isValid(); | ||
665 | 648 | return fd; | ||
666 | 649 | |||
667 | 650 | } | ||
668 | 601 | 651 | ||
669 | === modified file 'src/com/ubuntu/content/detail/service.h' | |||
670 | --- src/com/ubuntu/content/detail/service.h 2014-11-19 18:37:26 +0000 | |||
671 | +++ src/com/ubuntu/content/detail/service.h 2015-03-18 18:55:05 +0000 | |||
672 | @@ -25,9 +25,11 @@ | |||
673 | 25 | #include <QtDBus/QDBusMessage> | 25 | #include <QtDBus/QDBusMessage> |
674 | 26 | #include <QtDBus/QDBusServiceWatcher> | 26 | #include <QtDBus/QDBusServiceWatcher> |
675 | 27 | #include <QtDBus/QDBusContext> | 27 | #include <QtDBus/QDBusContext> |
676 | 28 | #include <QDBusUnixFileDescriptor> | ||
677 | 28 | 29 | ||
678 | 29 | #include <com/ubuntu/applicationmanager/application_manager.h> | 30 | #include <com/ubuntu/applicationmanager/application_manager.h> |
679 | 30 | #include "handler.h" | 31 | #include "handler.h" |
680 | 32 | #include "mir-helper.h" | ||
681 | 31 | #include "transfer.h" | 33 | #include "transfer.h" |
682 | 32 | 34 | ||
683 | 33 | namespace com | 35 | namespace com |
684 | @@ -66,6 +68,7 @@ | |||
685 | 66 | void HandlerActive(const QString&); | 68 | void HandlerActive(const QString&); |
686 | 67 | void Quit(); | 69 | void Quit(); |
687 | 68 | void DownloadManagerError(QString); | 70 | void DownloadManagerError(QString); |
688 | 71 | QDBusUnixFileDescriptor GetMirSocket(int); | ||
689 | 69 | 72 | ||
690 | 70 | private: | 73 | private: |
691 | 71 | bool should_cancel(int); | 74 | bool should_cancel(int); |
692 | @@ -73,6 +76,7 @@ | |||
693 | 73 | struct RegHandler; | 76 | struct RegHandler; |
694 | 74 | QDBusServiceWatcher* m_watcher; | 77 | QDBusServiceWatcher* m_watcher; |
695 | 75 | QScopedPointer<Private> d; | 78 | QScopedPointer<Private> d; |
696 | 79 | MirHelper* m_mirHelper = 0; | ||
697 | 76 | 80 | ||
698 | 77 | private Q_SLOTS: | 81 | private Q_SLOTS: |
699 | 78 | void handle_imports(int); | 82 | void handle_imports(int); |
700 | @@ -80,7 +84,7 @@ | |||
701 | 80 | void handler_unregistered(const QString&); | 84 | void handler_unregistered(const QString&); |
702 | 81 | QDBusObjectPath CreateTransfer(const QString&, const QString&, int, const QString&); | 85 | QDBusObjectPath CreateTransfer(const QString&, const QString&, int, const QString&); |
703 | 82 | void download_notify (com::ubuntu::content::detail::Transfer*); | 86 | void download_notify (com::ubuntu::content::detail::Transfer*); |
705 | 83 | 87 | QString setupPromptSession(com::ubuntu::content::detail::Transfer*, uint); | |
706 | 84 | }; | 88 | }; |
707 | 85 | } | 89 | } |
708 | 86 | } | 90 | } |
709 | 87 | 91 | ||
710 | === modified file 'src/com/ubuntu/content/detail/transfer.cpp' | |||
711 | --- src/com/ubuntu/content/detail/transfer.cpp 2014-09-26 10:34:39 +0000 | |||
712 | +++ src/com/ubuntu/content/detail/transfer.cpp 2015-03-18 18:55:05 +0000 | |||
713 | @@ -17,6 +17,7 @@ | |||
714 | 17 | */ | 17 | */ |
715 | 18 | 18 | ||
716 | 19 | #include "debug.h" | 19 | #include "debug.h" |
717 | 20 | #include "mir-helper.h" | ||
718 | 20 | #include "transfer.h" | 21 | #include "transfer.h" |
719 | 21 | #include "utils.cpp" | 22 | #include "utils.cpp" |
720 | 22 | 23 | ||
721 | @@ -59,6 +60,8 @@ | |||
722 | 59 | bool source_started_by_content_hub; | 60 | bool source_started_by_content_hub; |
723 | 60 | QString download_id; | 61 | QString download_id; |
724 | 61 | const QString content_type; | 62 | const QString content_type; |
725 | 63 | QString mir_socket = ""; | ||
726 | 64 | PromptSessionP promptSession; | ||
727 | 62 | }; | 65 | }; |
728 | 63 | 66 | ||
729 | 64 | cucd::Transfer::Transfer(const int id, | 67 | cucd::Transfer::Transfer(const int id, |
730 | @@ -357,12 +360,14 @@ | |||
731 | 357 | /* sets, if the source app is freshly started by the content hub */ | 360 | /* sets, if the source app is freshly started by the content hub */ |
732 | 358 | void cucd::Transfer::SetSourceStartedByContentHub(bool started) | 361 | void cucd::Transfer::SetSourceStartedByContentHub(bool started) |
733 | 359 | { | 362 | { |
734 | 363 | TRACE() << Q_FUNC_INFO << started; | ||
735 | 360 | d->source_started_by_content_hub = started; | 364 | d->source_started_by_content_hub = started; |
736 | 361 | } | 365 | } |
737 | 362 | 366 | ||
738 | 363 | /* returns if the source app was started by the content hub */ | 367 | /* returns if the source app was started by the content hub */ |
739 | 364 | bool com::ubuntu::content::detail::Transfer::WasSourceStartedByContentHub() const | 368 | bool com::ubuntu::content::detail::Transfer::WasSourceStartedByContentHub() const |
740 | 365 | { | 369 | { |
741 | 370 | TRACE() << Q_FUNC_INFO << d->source_started_by_content_hub;; | ||
742 | 366 | return d->source_started_by_content_hub; | 371 | return d->source_started_by_content_hub; |
743 | 367 | } | 372 | } |
744 | 368 | 373 | ||
745 | @@ -371,3 +376,36 @@ | |||
746 | 371 | TRACE() << __PRETTY_FUNCTION__; | 376 | TRACE() << __PRETTY_FUNCTION__; |
747 | 372 | return d->content_type; | 377 | return d->content_type; |
748 | 373 | } | 378 | } |
749 | 379 | |||
750 | 380 | QString cucd::Transfer::MirSocket() | ||
751 | 381 | { | ||
752 | 382 | TRACE() << Q_FUNC_INFO << d->mir_socket; | ||
753 | 383 | return d->mir_socket; | ||
754 | 384 | } | ||
755 | 385 | |||
756 | 386 | void cucd::Transfer::SetMirSocket(QString mir_socket) | ||
757 | 387 | { | ||
758 | 388 | TRACE() << Q_FUNC_INFO << mir_socket; | ||
759 | 389 | |||
760 | 390 | if (d->mir_socket == mir_socket) | ||
761 | 391 | return; | ||
762 | 392 | |||
763 | 393 | d->mir_socket = mir_socket; | ||
764 | 394 | Q_EMIT(MirSocketChanged(d->mir_socket)); | ||
765 | 395 | } | ||
766 | 396 | |||
767 | 397 | PromptSessionP cucd::Transfer::PromptSession() | ||
768 | 398 | { | ||
769 | 399 | TRACE() << Q_FUNC_INFO; | ||
770 | 400 | return d->promptSession; | ||
771 | 401 | } | ||
772 | 402 | |||
773 | 403 | void cucd::Transfer::SetPromptSession(PromptSessionP promptSession) | ||
774 | 404 | { | ||
775 | 405 | TRACE() << Q_FUNC_INFO; | ||
776 | 406 | |||
777 | 407 | if (d->promptSession == promptSession) | ||
778 | 408 | return; | ||
779 | 409 | |||
780 | 410 | d->promptSession = promptSession; | ||
781 | 411 | } | ||
782 | 374 | 412 | ||
783 | === modified file 'src/com/ubuntu/content/detail/transfer.h' | |||
784 | --- src/com/ubuntu/content/detail/transfer.h 2014-09-26 10:34:39 +0000 | |||
785 | +++ src/com/ubuntu/content/detail/transfer.h 2015-03-18 18:55:05 +0000 | |||
786 | @@ -18,6 +18,7 @@ | |||
787 | 18 | #ifndef TRANSFER_H_ | 18 | #ifndef TRANSFER_H_ |
788 | 19 | #define TRANSFER_H_ | 19 | #define TRANSFER_H_ |
789 | 20 | 20 | ||
790 | 21 | #include "mir-helper.h" | ||
791 | 21 | #include <QObject> | 22 | #include <QObject> |
792 | 22 | #include <QStringList> | 23 | #include <QStringList> |
793 | 23 | #include <QDir> | 24 | #include <QDir> |
794 | @@ -43,6 +44,7 @@ | |||
795 | 43 | Q_PROPERTY(QString destination READ destination) | 44 | Q_PROPERTY(QString destination READ destination) |
796 | 44 | Q_PROPERTY(int direction READ Direction) | 45 | Q_PROPERTY(int direction READ Direction) |
797 | 45 | Q_PROPERTY(QString ContentType READ ContentType) | 46 | Q_PROPERTY(QString ContentType READ ContentType) |
798 | 47 | Q_PROPERTY(QString MirSocket READ MirSocket WRITE SetMirSocket NOTIFY MirSocketChanged) | ||
799 | 46 | 48 | ||
800 | 47 | public: | 49 | public: |
801 | 48 | Transfer(const int, const QString&, const QString&, const int, const QString&, QObject* parent = nullptr); | 50 | Transfer(const int, const QString&, const QString&, const int, const QString&, QObject* parent = nullptr); |
802 | @@ -60,6 +62,7 @@ | |||
803 | 60 | void SelectionTypeChanged(int SelectionType); | 62 | void SelectionTypeChanged(int SelectionType); |
804 | 61 | void DownloadIdChanged(QString DownloadId); | 63 | void DownloadIdChanged(QString DownloadId); |
805 | 62 | void DownloadManagerError(QString ErrorMessage); | 64 | void DownloadManagerError(QString ErrorMessage); |
806 | 65 | void MirSocketChanged(QString MirSocket); | ||
807 | 63 | 66 | ||
808 | 64 | public Q_SLOTS: | 67 | public Q_SLOTS: |
809 | 65 | int State(); | 68 | int State(); |
810 | @@ -86,6 +89,10 @@ | |||
811 | 86 | void DownloadError(Ubuntu::DownloadManager::Error* error); | 89 | void DownloadError(Ubuntu::DownloadManager::Error* error); |
812 | 87 | QString ContentType(); | 90 | QString ContentType(); |
813 | 88 | void AddItemsFromDir(QDir dir); | 91 | void AddItemsFromDir(QDir dir); |
814 | 92 | QString MirSocket(); | ||
815 | 93 | void SetMirSocket(QString MirSocket); | ||
816 | 94 | PromptSessionP PromptSession(); | ||
817 | 95 | void SetPromptSession(PromptSessionP promptSession); | ||
818 | 89 | 96 | ||
819 | 90 | private: | 97 | private: |
820 | 91 | struct Private; | 98 | struct Private; |
821 | 92 | 99 | ||
822 | === modified file 'src/com/ubuntu/content/transfer.cpp' | |||
823 | --- src/com/ubuntu/content/transfer.cpp 2014-08-27 13:49:13 +0000 | |||
824 | +++ src/com/ubuntu/content/transfer.cpp 2015-03-18 18:55:05 +0000 | |||
825 | @@ -136,3 +136,13 @@ | |||
826 | 136 | { | 136 | { |
827 | 137 | return d->destination(); | 137 | return d->destination(); |
828 | 138 | } | 138 | } |
829 | 139 | |||
830 | 140 | QString cuc::Transfer::mirSocket() const | ||
831 | 141 | { | ||
832 | 142 | return d->mirSocket(); | ||
833 | 143 | } | ||
834 | 144 | |||
835 | 145 | bool cuc::Transfer::setMirSocket(QString socket) | ||
836 | 146 | { | ||
837 | 147 | return d->setMirSocket(socket); | ||
838 | 148 | } | ||
839 | 139 | 149 | ||
840 | === modified file 'src/com/ubuntu/content/transfer_p.h' | |||
841 | --- src/com/ubuntu/content/transfer_p.h 2014-08-27 13:49:13 +0000 | |||
842 | +++ src/com/ubuntu/content/transfer_p.h 2015-03-18 18:55:05 +0000 | |||
843 | @@ -243,6 +243,25 @@ | |||
844 | 243 | return static_cast<QString>(reply.value()); | 243 | return static_cast<QString>(reply.value()); |
845 | 244 | } | 244 | } |
846 | 245 | 245 | ||
847 | 246 | QString mirSocket() | ||
848 | 247 | { | ||
849 | 248 | auto reply = remote_transfer->MirSocket(); | ||
850 | 249 | reply.waitForFinished(); | ||
851 | 250 | |||
852 | 251 | if (reply.isError()) | ||
853 | 252 | return QString(); | ||
854 | 253 | |||
855 | 254 | return static_cast<QString>(reply.value()); | ||
856 | 255 | } | ||
857 | 256 | |||
858 | 257 | bool setMirSocket(QString mir_socket) | ||
859 | 258 | { | ||
860 | 259 | auto reply = remote_transfer->SetMirSocket(mir_socket); | ||
861 | 260 | reply.waitForFinished(); | ||
862 | 261 | |||
863 | 262 | return not reply.isError(); | ||
864 | 263 | } | ||
865 | 264 | |||
866 | 246 | com::ubuntu::content::dbus::Transfer* remote_transfer; | 265 | com::ubuntu::content::dbus::Transfer* remote_transfer; |
867 | 247 | }; | 266 | }; |
868 | 248 | } | 267 | } |
869 | 249 | 268 | ||
870 | === added directory 'src/helper' | |||
871 | === added file 'src/helper/CMakeLists.txt' | |||
872 | --- src/helper/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
873 | +++ src/helper/CMakeLists.txt 2015-03-18 18:55:05 +0000 | |||
874 | @@ -0,0 +1,61 @@ | |||
875 | 1 | # Copyright © 2013 Canonical Ltd. | ||
876 | 2 | # | ||
877 | 3 | # This program is free software: you can redistribute it and/or modify | ||
878 | 4 | # it under the terms of the GNU General Public License version 3 as | ||
879 | 5 | # published by the Free Software Foundation. | ||
880 | 6 | # | ||
881 | 7 | # This program is distributed in the hope that it will be useful, | ||
882 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
883 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
884 | 10 | # GNU General Public License for more details. | ||
885 | 11 | # | ||
886 | 12 | # You should have received a copy of the GNU General Public License | ||
887 | 13 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
888 | 14 | # | ||
889 | 15 | # Authored by: Thomas Voss <thomas.voss@canonical.com> | ||
890 | 16 | |||
891 | 17 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -g -fPIE ${GCOV_FLAGS}") | ||
892 | 18 | |||
893 | 19 | include_directories( | ||
894 | 20 | ${CMAKE_CURRENT_BINARY_DIR} | ||
895 | 21 | ${UBUNTU_LAUNCH_INCLUDE_DIRS} | ||
896 | 22 | ${GIO_INCLUDE_DIRS} | ||
897 | 23 | ${GLIB_INCLUDE_DIRS} | ||
898 | 24 | ${CLICK_INCLUDE_DIRS} | ||
899 | 25 | ) | ||
900 | 26 | |||
901 | 27 | ########################### | ||
902 | 28 | # Mir Connection Demangler | ||
903 | 29 | ########################### | ||
904 | 30 | |||
905 | 31 | add_executable(mir-connection-demangler mir-connection-demangler.c) | ||
906 | 32 | target_link_libraries(mir-connection-demangler ${GLIB_LDFLAGS} ${GIO_LDFLAGS}) | ||
907 | 33 | #install( | ||
908 | 34 | # RUNTIME "${CMAKE_CURRENT_BINARY_DIR}/mir-connection-demangler" | ||
909 | 35 | # DESTINATION "${CMAKE_INSTALL_FULL_PKGLIBEXECDIR}" | ||
910 | 36 | #) | ||
911 | 37 | |||
912 | 38 | ############################# | ||
913 | 39 | # Untrusted Helper Exec Tool | ||
914 | 40 | ############################# | ||
915 | 41 | |||
916 | 42 | add_definitions(-DSOCKET_TOOL="${CMAKE_INSTALL_FULL_LIBEXECDIR}/ubuntu-app-launch/content-hub/mir-connection-demangler") | ||
917 | 43 | add_executable( | ||
918 | 44 | exec-tool | ||
919 | 45 | |||
920 | 46 | exec-tool.c | ||
921 | 47 | ) | ||
922 | 48 | |||
923 | 49 | target_link_libraries( | ||
924 | 50 | exec-tool | ||
925 | 51 | |||
926 | 52 | ${UBUNTU_LAUNCH_LDFLAGS} | ||
927 | 53 | ${CLICK_LDFLAGS} | ||
928 | 54 | ${GLIB_LDFLAGS} | ||
929 | 55 | ${GIO_LDFLAGS} | ||
930 | 56 | ) | ||
931 | 57 | |||
932 | 58 | install( | ||
933 | 59 | PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/exec-tool" "${CMAKE_CURRENT_BINARY_DIR}/mir-connection-demangler" | ||
934 | 60 | DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/ubuntu-app-launch/content-hub" | ||
935 | 61 | ) | ||
936 | 0 | 62 | ||
937 | === added file 'src/helper/exec-tool.c' | |||
938 | --- src/helper/exec-tool.c 1970-01-01 00:00:00 +0000 | |||
939 | +++ src/helper/exec-tool.c 2015-03-18 18:55:05 +0000 | |||
940 | @@ -0,0 +1,222 @@ | |||
941 | 1 | /* | ||
942 | 2 | * Copyright © 2014 Canonical Ltd. | ||
943 | 3 | * | ||
944 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
945 | 5 | * under the terms of the GNU General Public License version 3, as published | ||
946 | 6 | * by the Free Software Foundation. | ||
947 | 7 | * | ||
948 | 8 | * This program is distributed in the hope that it will be useful, but | ||
949 | 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
950 | 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
951 | 11 | * PURPOSE. See the GNU General Public License for more details. | ||
952 | 12 | * | ||
953 | 13 | * You should have received a copy of the GNU General Public License along | ||
954 | 14 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
955 | 15 | * | ||
956 | 16 | * Authors: | ||
957 | 17 | * Ted Gould <ted.gould@canonical.com> | ||
958 | 18 | */ | ||
959 | 19 | |||
960 | 20 | #include <glib.h> | ||
961 | 21 | #include <click.h> | ||
962 | 22 | #include <ubuntu-app-launch.h> | ||
963 | 23 | |||
964 | 24 | gchar * | ||
965 | 25 | build_exec_envvar (const gchar * appid) | ||
966 | 26 | { | ||
967 | 27 | gchar * appid_desktop = g_strdup_printf("%s.desktop", appid); | ||
968 | 28 | /* FIXME: We need our hook to create our own symlink to the desktop file to use */ | ||
969 | 29 | gchar * desktopfilepath = g_build_filename(g_get_user_cache_dir(), "ubuntu-app-launch", "desktop", appid_desktop, NULL); | ||
970 | 30 | g_free(appid_desktop); | ||
971 | 31 | |||
972 | 32 | if (!g_file_test(desktopfilepath, G_FILE_TEST_EXISTS)) { | ||
973 | 33 | g_error("Can not file desktop file for '%s', expecting: '%s'", appid, desktopfilepath); | ||
974 | 34 | g_free(desktopfilepath); | ||
975 | 35 | return NULL; | ||
976 | 36 | } | ||
977 | 37 | |||
978 | 38 | GError * error = NULL; | ||
979 | 39 | GKeyFile * keyfile = g_key_file_new(); | ||
980 | 40 | g_key_file_load_from_file(keyfile, desktopfilepath, G_KEY_FILE_NONE, &error); | ||
981 | 41 | |||
982 | 42 | if (error != NULL) { | ||
983 | 43 | g_error("Unable to read content-hub desktop file '%s': %s", desktopfilepath, error->message); | ||
984 | 44 | g_free(desktopfilepath); | ||
985 | 45 | g_key_file_free(keyfile); | ||
986 | 46 | g_error_free(error); | ||
987 | 47 | return NULL; | ||
988 | 48 | } | ||
989 | 49 | |||
990 | 50 | g_free(desktopfilepath); | ||
991 | 51 | |||
992 | 52 | if (!g_key_file_has_key(keyfile, "Desktop Entry", "Exec", NULL)) { | ||
993 | 53 | g_error("Desktop file does not have 'Exec' key"); | ||
994 | 54 | g_key_file_free(keyfile); | ||
995 | 55 | return NULL; | ||
996 | 56 | } | ||
997 | 57 | |||
998 | 58 | gchar * exec = g_key_file_get_string(keyfile, "Desktop Entry", "Exec", NULL); | ||
999 | 59 | g_key_file_free(keyfile); | ||
1000 | 60 | |||
1001 | 61 | gchar * prepend = g_strdup_printf("%s %s", SOCKET_TOOL, exec); | ||
1002 | 62 | g_free(exec); | ||
1003 | 63 | g_debug("Final Exec line: %s", prepend); | ||
1004 | 64 | |||
1005 | 65 | gchar * envvar = g_strdup_printf("APP_EXEC=%s", prepend); | ||
1006 | 66 | g_free(prepend); | ||
1007 | 67 | |||
1008 | 68 | return envvar; | ||
1009 | 69 | } | ||
1010 | 70 | |||
1011 | 71 | gboolean | ||
1012 | 72 | build_uri_envvar(const gchar * appuris, gchar ** euri, gchar ** esocket) | ||
1013 | 73 | { | ||
1014 | 74 | gint argc; | ||
1015 | 75 | gchar ** argv; | ||
1016 | 76 | GError * error = NULL; | ||
1017 | 77 | |||
1018 | 78 | g_shell_parse_argv(appuris, &argc, &argv, &error); | ||
1019 | 79 | if (error != NULL) { | ||
1020 | 80 | g_critical("Unable to parse URIs '%s': %s", appuris, error->message); | ||
1021 | 81 | g_error_free(error); | ||
1022 | 82 | return FALSE; | ||
1023 | 83 | } | ||
1024 | 84 | |||
1025 | 85 | if (argc != 2) { | ||
1026 | 86 | g_critical("We should be getting 2 entries from '%s' but got %d", appuris, argc); | ||
1027 | 87 | g_strfreev(argv); | ||
1028 | 88 | return FALSE; | ||
1029 | 89 | } | ||
1030 | 90 | |||
1031 | 91 | *esocket = g_strdup_printf("CONTENT_HUB_MIR_SOCKET=%s", g_shell_quote(argv[0])); | ||
1032 | 92 | gchar * quoted = g_shell_quote(argv[1]); | ||
1033 | 93 | *euri = g_strdup_printf("APP_URIS=%s", quoted); | ||
1034 | 94 | |||
1035 | 95 | g_free(quoted); | ||
1036 | 96 | g_strfreev(argv); | ||
1037 | 97 | |||
1038 | 98 | return TRUE; | ||
1039 | 99 | } | ||
1040 | 100 | |||
1041 | 101 | gchar * | ||
1042 | 102 | build_dir_envvar (const gchar * appid) | ||
1043 | 103 | { | ||
1044 | 104 | GError * error = NULL; | ||
1045 | 105 | gchar * package = NULL; | ||
1046 | 106 | /* 'Parse' the App ID */ | ||
1047 | 107 | if (!ubuntu_app_launch_app_id_parse(appid, &package, NULL, NULL)) { | ||
1048 | 108 | g_warning("Unable to parse App ID: '%s'", appid); | ||
1049 | 109 | return NULL; | ||
1050 | 110 | } | ||
1051 | 111 | |||
1052 | 112 | /* Check click to find out where the files are */ | ||
1053 | 113 | ClickDB * db = click_db_new(); | ||
1054 | 114 | /* If TEST_CLICK_DB is unset, this reads the system database. */ | ||
1055 | 115 | click_db_read(db, g_getenv("TEST_CLICK_DB"), &error); | ||
1056 | 116 | if (error != NULL) { | ||
1057 | 117 | g_warning("Unable to read Click database: %s", error->message); | ||
1058 | 118 | g_error_free(error); | ||
1059 | 119 | g_free(package); | ||
1060 | 120 | return NULL; | ||
1061 | 121 | } | ||
1062 | 122 | /* If TEST_CLICK_USER is unset, this uses the current user name. */ | ||
1063 | 123 | ClickUser * user = click_user_new_for_user(db, g_getenv("TEST_CLICK_USER"), &error); | ||
1064 | 124 | if (error != NULL) { | ||
1065 | 125 | g_warning("Unable to read Click database: %s", error->message); | ||
1066 | 126 | g_error_free(error); | ||
1067 | 127 | g_free(package); | ||
1068 | 128 | g_object_unref(db); | ||
1069 | 129 | return NULL; | ||
1070 | 130 | } | ||
1071 | 131 | gchar * pkgdir = click_user_get_path(user, package, &error); | ||
1072 | 132 | |||
1073 | 133 | g_object_unref(user); | ||
1074 | 134 | g_object_unref(db); | ||
1075 | 135 | g_free(package); | ||
1076 | 136 | |||
1077 | 137 | if (error != NULL) { | ||
1078 | 138 | g_warning("Unable to get the Click package directory for %s: %s", package, error->message); | ||
1079 | 139 | g_error_free(error); | ||
1080 | 140 | return NULL; | ||
1081 | 141 | } | ||
1082 | 142 | |||
1083 | 143 | gchar * envvar = g_strdup_printf("APP_DIR=%s", pkgdir); | ||
1084 | 144 | g_free(pkgdir); | ||
1085 | 145 | return envvar; | ||
1086 | 146 | } | ||
1087 | 147 | |||
1088 | 148 | int | ||
1089 | 149 | main (int argc, char * argv[]) | ||
1090 | 150 | { | ||
1091 | 151 | g_debug("argc: %d", argc); | ||
1092 | 152 | g_debug("argv: %s", g_shell_quote(argv[0])); | ||
1093 | 153 | GError * error = NULL; | ||
1094 | 154 | |||
1095 | 155 | /* Build up our exec */ | ||
1096 | 156 | const gchar * appid = g_getenv("APP_ID"); | ||
1097 | 157 | if (appid == NULL) { | ||
1098 | 158 | g_error("Environment variable 'APP_ID' required"); | ||
1099 | 159 | return -1; | ||
1100 | 160 | } | ||
1101 | 161 | |||
1102 | 162 | gchar * envexec = build_exec_envvar(appid); | ||
1103 | 163 | if (envexec == NULL) { | ||
1104 | 164 | return -1; | ||
1105 | 165 | } | ||
1106 | 166 | |||
1107 | 167 | /* Build up our socket name URL */ | ||
1108 | 168 | const gchar * appuris = g_getenv("APP_URIS"); | ||
1109 | 169 | if (appuris == NULL) { | ||
1110 | 170 | g_error("Environment variable 'APP_URIS' required"); | ||
1111 | 171 | g_free(envexec); | ||
1112 | 172 | return -1; | ||
1113 | 173 | } | ||
1114 | 174 | |||
1115 | 175 | gchar * envuri = NULL; | ||
1116 | 176 | gchar * envsocket = NULL; | ||
1117 | 177 | |||
1118 | 178 | if (!build_uri_envvar(appuris, &envuri, &envsocket)) { | ||
1119 | 179 | g_free(envexec); | ||
1120 | 180 | return -1; | ||
1121 | 181 | } | ||
1122 | 182 | |||
1123 | 183 | gchar * envdir = build_dir_envvar(appid); | ||
1124 | 184 | /* envdir might be NULL if not a click */ | ||
1125 | 185 | |||
1126 | 186 | /* Execute the setting of the variables! */ | ||
1127 | 187 | |||
1128 | 188 | gchar * initctlargv[7] = { | ||
1129 | 189 | "initctl", | ||
1130 | 190 | "set-env", | ||
1131 | 191 | envexec, | ||
1132 | 192 | envuri, | ||
1133 | 193 | envsocket, | ||
1134 | 194 | envdir, | ||
1135 | 195 | NULL | ||
1136 | 196 | }; | ||
1137 | 197 | |||
1138 | 198 | g_spawn_sync( | ||
1139 | 199 | NULL, /* pwd */ | ||
1140 | 200 | initctlargv, | ||
1141 | 201 | NULL, /* env */ | ||
1142 | 202 | G_SPAWN_SEARCH_PATH, | ||
1143 | 203 | NULL, /* child setup */ | ||
1144 | 204 | NULL, /* user data ^ */ | ||
1145 | 205 | NULL, /* stdout */ | ||
1146 | 206 | NULL, /* stderr */ | ||
1147 | 207 | NULL, /* return code */ | ||
1148 | 208 | &error | ||
1149 | 209 | ); | ||
1150 | 210 | |||
1151 | 211 | g_free(envexec); | ||
1152 | 212 | g_free(envuri); | ||
1153 | 213 | g_free(envsocket); | ||
1154 | 214 | |||
1155 | 215 | if (error == NULL) { | ||
1156 | 216 | return 0; | ||
1157 | 217 | } else { | ||
1158 | 218 | g_error("Unable to spawn 'initctl': %s", error->message); | ||
1159 | 219 | g_error_free(error); | ||
1160 | 220 | return -1; | ||
1161 | 221 | } | ||
1162 | 222 | } | ||
1163 | 0 | 223 | ||
1164 | === added file 'src/helper/exec-tool.cpp' | |||
1165 | --- src/helper/exec-tool.cpp 1970-01-01 00:00:00 +0000 | |||
1166 | +++ src/helper/exec-tool.cpp 2015-03-18 18:55:05 +0000 | |||
1167 | @@ -0,0 +1,107 @@ | |||
1168 | 1 | /* | ||
1169 | 2 | * Copyright (C) 2014-2015 Canonical Ltd. | ||
1170 | 3 | * | ||
1171 | 4 | * Contact: Ken VanDine <ken.vandine@canonical.com> | ||
1172 | 5 | * | ||
1173 | 6 | * This file is part of content-hub | ||
1174 | 7 | * | ||
1175 | 8 | * This program is free software: you can redistribute it and/or modify it | ||
1176 | 9 | * under the terms of the GNU General Public License version 3, as published | ||
1177 | 10 | * by the Free Software Foundation. | ||
1178 | 11 | * | ||
1179 | 12 | * This program is distributed in the hope that it will be useful, but | ||
1180 | 13 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
1181 | 14 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
1182 | 15 | * PURPOSE. See the GNU General Public License for more details. | ||
1183 | 16 | * | ||
1184 | 17 | * You should have received a copy of the GNU General Public License along | ||
1185 | 18 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1186 | 19 | */ | ||
1187 | 20 | |||
1188 | 21 | #include <QByteArray> | ||
1189 | 22 | #include <QCoreApplication> | ||
1190 | 23 | #include <QDebug> | ||
1191 | 24 | #include <QProcess> | ||
1192 | 25 | #include <QStringList> | ||
1193 | 26 | |||
1194 | 27 | QStringList parseParameters(const QByteArray &cmdLine) | ||
1195 | 28 | { | ||
1196 | 29 | QStringList params; | ||
1197 | 30 | QByteArray nextParam; | ||
1198 | 31 | |||
1199 | 32 | bool insideDoubleQuotes = false; | ||
1200 | 33 | |||
1201 | 34 | for (int i = 0; i < cmdLine.count(); i++) { | ||
1202 | 35 | char c = cmdLine.at(i); | ||
1203 | 36 | if (c == '\'' && !insideDoubleQuotes) { | ||
1204 | 37 | int endQuote = cmdLine.indexOf('\'', i + 1); | ||
1205 | 38 | if (Q_UNLIKELY(endQuote < 0)) { | ||
1206 | 39 | qWarning() << "Cannot parse parameters" << cmdLine; | ||
1207 | 40 | return params; | ||
1208 | 41 | } | ||
1209 | 42 | nextParam += cmdLine.mid(i + 1, endQuote - i - 1); | ||
1210 | 43 | i = endQuote; | ||
1211 | 44 | } else if (c == '"') { | ||
1212 | 45 | if (insideDoubleQuotes) { | ||
1213 | 46 | insideDoubleQuotes = false; | ||
1214 | 47 | } else { | ||
1215 | 48 | insideDoubleQuotes = true; | ||
1216 | 49 | } | ||
1217 | 50 | } else if (c == '\\') { | ||
1218 | 51 | i++; | ||
1219 | 52 | if (Q_UNLIKELY(i == cmdLine.count())) { | ||
1220 | 53 | qWarning() << "Incomplete command line" << cmdLine; | ||
1221 | 54 | return params; | ||
1222 | 55 | } | ||
1223 | 56 | nextParam += cmdLine.at(i); | ||
1224 | 57 | } else if (c == ' ' && !insideDoubleQuotes) { | ||
1225 | 58 | params.append(QString::fromUtf8(nextParam)); | ||
1226 | 59 | nextParam.clear(); | ||
1227 | 60 | } else { | ||
1228 | 61 | nextParam += cmdLine.at(i); | ||
1229 | 62 | } | ||
1230 | 63 | } | ||
1231 | 64 | |||
1232 | 65 | if (!nextParam.isEmpty()) { | ||
1233 | 66 | params.append(QString::fromUtf8(nextParam)); | ||
1234 | 67 | } | ||
1235 | 68 | |||
1236 | 69 | return params; | ||
1237 | 70 | } | ||
1238 | 71 | |||
1239 | 72 | int main(int argc, char **argv) | ||
1240 | 73 | { | ||
1241 | 74 | QCoreApplication app(argc, argv); | ||
1242 | 75 | |||
1243 | 76 | QStringList appUris = parseParameters(qgetenv("APP_URIS")); | ||
1244 | 77 | if (Q_UNLIKELY(appUris.count() < 1)) { | ||
1245 | 78 | qCritical() << "Missing URIs" << appUris; | ||
1246 | 79 | return EXIT_FAILURE; | ||
1247 | 80 | } | ||
1248 | 81 | |||
1249 | 82 | QStringList arguments; | ||
1250 | 83 | arguments.append("set-env"); | ||
1251 | 84 | QString app_id(qgetenv("APP_ID")); | ||
1252 | 85 | arguments.append("APP_EXEC="); | ||
1253 | 86 | arguments.append(app_id); | ||
1254 | 87 | |||
1255 | 88 | // Mir socket URL; might be invalid | ||
1256 | 89 | QString mirSocket = appUris[0]; | ||
1257 | 90 | if (!mirSocket.startsWith("invalid")) { | ||
1258 | 91 | QString mirUrl = | ||
1259 | 92 | QString("MIR_SOCKET=%1").arg(mirSocket); | ||
1260 | 93 | arguments.append(mirUrl); | ||
1261 | 94 | } | ||
1262 | 95 | |||
1263 | 96 | arguments.append("CONTENT_HUB_LOGGING_LEVEL=2"); | ||
1264 | 97 | |||
1265 | 98 | QStringList newAppUrisList = appUris.mid(1); | ||
1266 | 99 | QString newAppUris = QString("APP_URIS=%1").arg(newAppUrisList.join(' ')); | ||
1267 | 100 | |||
1268 | 101 | arguments.append(newAppUris); | ||
1269 | 102 | |||
1270 | 103 | int ret = QProcess::execute("initctl", arguments); | ||
1271 | 104 | |||
1272 | 105 | return (ret >= 0) ? EXIT_SUCCESS : EXIT_FAILURE; | ||
1273 | 106 | } | ||
1274 | 107 | |||
1275 | 0 | 108 | ||
1276 | === added file 'src/helper/mir-connection-demangler.c' | |||
1277 | --- src/helper/mir-connection-demangler.c 1970-01-01 00:00:00 +0000 | |||
1278 | +++ src/helper/mir-connection-demangler.c 2015-03-18 18:55:05 +0000 | |||
1279 | @@ -0,0 +1,126 @@ | |||
1280 | 1 | /* | ||
1281 | 2 | * Copyright © 2014-2015 Canonical Ltd. | ||
1282 | 3 | * | ||
1283 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
1284 | 5 | * under the terms of the GNU General Public License version 3, as published | ||
1285 | 6 | * by the Free Software Foundation. | ||
1286 | 7 | * | ||
1287 | 8 | * This program is distributed in the hope that it will be useful, but | ||
1288 | 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
1289 | 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
1290 | 11 | * PURPOSE. See the GNU General Public License for more details. | ||
1291 | 12 | * | ||
1292 | 13 | * You should have received a copy of the GNU General Public License along | ||
1293 | 14 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1294 | 15 | * | ||
1295 | 16 | * Authors: | ||
1296 | 17 | * Ted Gould <ted.gould@canonical.com> | ||
1297 | 18 | * Ken VanDine <ken.vandine@canonical.com> | ||
1298 | 19 | */ | ||
1299 | 20 | |||
1300 | 21 | #include <gio/gio.h> | ||
1301 | 22 | #include <gio/gunixfdlist.h> | ||
1302 | 23 | |||
1303 | 24 | #include <errno.h> | ||
1304 | 25 | #include <fcntl.h> | ||
1305 | 26 | |||
1306 | 27 | int | ||
1307 | 28 | main (int argc, char * argv[]) | ||
1308 | 29 | { | ||
1309 | 30 | const gchar * mir_socket = g_getenv("CONTENT_HUB_MIR_SOCKET"); | ||
1310 | 31 | if (mir_socket == NULL || mir_socket[0] == '\0') { | ||
1311 | 32 | g_error("Unable to find Mir connection from Content Hub"); | ||
1312 | 33 | return -1; | ||
1313 | 34 | } | ||
1314 | 35 | gchar * mir_socket_unquoted = g_shell_unquote(mir_socket, NULL); | ||
1315 | 36 | if (mir_socket_unquoted == NULL) { | ||
1316 | 37 | mir_socket_unquoted = g_strdup(mir_socket); | ||
1317 | 38 | } | ||
1318 | 39 | |||
1319 | 40 | g_print("Mir Connection Path: %s\n", mir_socket_unquoted); | ||
1320 | 41 | |||
1321 | 42 | GError * error = NULL; | ||
1322 | 43 | GDBusConnection * bus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error); | ||
1323 | 44 | |||
1324 | 45 | if (error != NULL) { | ||
1325 | 46 | g_error("Unable to get session bus: %s", error->message); | ||
1326 | 47 | g_error_free(error); | ||
1327 | 48 | return -1; | ||
1328 | 49 | } | ||
1329 | 50 | |||
1330 | 51 | GVariant * retval; | ||
1331 | 52 | GUnixFDList * fdlist; | ||
1332 | 53 | |||
1333 | 54 | /* Index into fds */ | ||
1334 | 55 | GVariant* id = g_variant_new_int32(g_strtod(mir_socket_unquoted, NULL)); | ||
1335 | 56 | g_free(mir_socket_unquoted); | ||
1336 | 57 | GVariant* params = g_variant_new_tuple(&id, 1); | ||
1337 | 58 | |||
1338 | 59 | retval = g_dbus_connection_call_with_unix_fd_list_sync( | ||
1339 | 60 | bus, | ||
1340 | 61 | "com.ubuntu.content.dbus.Service", | ||
1341 | 62 | "/", | ||
1342 | 63 | "com.ubuntu.content.dbus.Service", | ||
1343 | 64 | "GetMirSocket", | ||
1344 | 65 | params, | ||
1345 | 66 | G_VARIANT_TYPE("(h)"), | ||
1346 | 67 | G_DBUS_CALL_FLAGS_NO_AUTO_START, | ||
1347 | 68 | -1, /* timeout */ | ||
1348 | 69 | NULL, /* fd list in */ | ||
1349 | 70 | &fdlist, | ||
1350 | 71 | NULL, /* cancelable */ | ||
1351 | 72 | &error); | ||
1352 | 73 | |||
1353 | 74 | g_clear_object(&bus); | ||
1354 | 75 | |||
1355 | 76 | if (error != NULL) { | ||
1356 | 77 | g_error("Unable to get Mir socket over dbus: %s", error->message); | ||
1357 | 78 | g_error_free(error); | ||
1358 | 79 | return -1; | ||
1359 | 80 | } | ||
1360 | 81 | |||
1361 | 82 | GVariant * outhandle = g_variant_get_child_value(retval, 0); | ||
1362 | 83 | |||
1363 | 84 | if (outhandle == NULL) { | ||
1364 | 85 | g_error("Unable to get data from function"); | ||
1365 | 86 | return -1; | ||
1366 | 87 | } | ||
1367 | 88 | |||
1368 | 89 | gint32 handle = g_variant_get_handle(outhandle); | ||
1369 | 90 | g_variant_unref(outhandle); | ||
1370 | 91 | g_variant_unref(retval); | ||
1371 | 92 | |||
1372 | 93 | if (handle >= g_unix_fd_list_get_length(fdlist)) { | ||
1373 | 94 | g_error("Handle is %d but the FD list only has %d entries", handle, g_unix_fd_list_get_length(fdlist)); | ||
1374 | 95 | g_clear_object(&fdlist); | ||
1375 | 96 | return -1; | ||
1376 | 97 | } | ||
1377 | 98 | |||
1378 | 99 | gint32 fd = g_unix_fd_list_get(fdlist, handle, &error); | ||
1379 | 100 | g_clear_object(&fdlist); | ||
1380 | 101 | |||
1381 | 102 | if (error != NULL) { | ||
1382 | 103 | g_error("Unable to Unix FD: %s", error->message); | ||
1383 | 104 | g_error_free(error); | ||
1384 | 105 | return -1; | ||
1385 | 106 | } | ||
1386 | 107 | |||
1387 | 108 | errno = 0; | ||
1388 | 109 | fcntl(fd, F_GETFD); | ||
1389 | 110 | if (errno != 0) { | ||
1390 | 111 | perror("File descriptor is invalid"); | ||
1391 | 112 | return -1; | ||
1392 | 113 | } | ||
1393 | 114 | |||
1394 | 115 | /* Make sure the FD doesn't close on exec */ | ||
1395 | 116 | fcntl(fd, F_SETFD, 0); | ||
1396 | 117 | |||
1397 | 118 | gchar * mirsocketbuf = g_strdup_printf("fd://%d", fd); | ||
1398 | 119 | setenv("MIR_SOCKET", mirsocketbuf, 1); | ||
1399 | 120 | g_print("Setting MIR_SOCKET to: '%s'\n", mirsocketbuf); | ||
1400 | 121 | |||
1401 | 122 | g_free(mirsocketbuf); | ||
1402 | 123 | |||
1403 | 124 | /* Thought, is argv NULL terminated? */ | ||
1404 | 125 | return execvp(argv[1], argv + 1); | ||
1405 | 126 | } | ||
1406 | 0 | 127 | ||
1407 | === modified file 'tests/acceptance-tests/app_manager_mock.h' | |||
1408 | --- tests/acceptance-tests/app_manager_mock.h 2014-02-13 19:11:43 +0000 | |||
1409 | +++ tests/acceptance-tests/app_manager_mock.h 2015-03-18 18:55:05 +0000 | |||
1410 | @@ -30,11 +30,15 @@ | |||
1411 | 30 | using namespace ::testing; | 30 | using namespace ::testing; |
1412 | 31 | 31 | ||
1413 | 32 | ON_CALL(*this, invoke_application(_)).WillByDefault(Return(true)); | 32 | ON_CALL(*this, invoke_application(_)).WillByDefault(Return(true)); |
1414 | 33 | ON_CALL(*this, invoke_application_with_socket(_,_)).WillByDefault(Return(true)); | ||
1415 | 34 | ON_CALL(*this, stop_application_with_helper(_)).WillByDefault(Return(true)); | ||
1416 | 33 | ON_CALL(*this, stop_application(_)).WillByDefault(Return(true)); | 35 | ON_CALL(*this, stop_application(_)).WillByDefault(Return(true)); |
1417 | 34 | ON_CALL(*this, is_application_started(_)).WillByDefault(Return(true)); | 36 | ON_CALL(*this, is_application_started(_)).WillByDefault(Return(true)); |
1418 | 35 | } | 37 | } |
1419 | 36 | 38 | ||
1420 | 37 | MOCK_METHOD1(invoke_application, bool(const std::string &)); | 39 | MOCK_METHOD1(invoke_application, bool(const std::string &)); |
1421 | 40 | MOCK_METHOD2(invoke_application_with_socket, bool(const std::string &, const std::string &)); | ||
1422 | 41 | MOCK_METHOD1(stop_application_with_helper, bool(const std::string &)); | ||
1423 | 38 | MOCK_METHOD1(stop_application, bool(const std::string &)); | 42 | MOCK_METHOD1(stop_application, bool(const std::string &)); |
1424 | 39 | MOCK_METHOD1(is_application_started, bool(const std::string &)); | 43 | MOCK_METHOD1(is_application_started, bool(const std::string &)); |
1425 | 40 | }; | 44 | }; |
FAILED: Continuous integration, rev:187 /code.launchpad .net/~ken- vandine/ content- hub/trust_ session_ wip/+merge/ 250843/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http:// jenkins. qa.ubuntu. com/job/ content- hub-ci/ 216/ jenkins. qa.ubuntu. com/job/ content- hub-vivid- amd64-ci/ 12 jenkins. qa.ubuntu. com/job/ content- hub-vivid- armhf-ci/ 12 jenkins. qa.ubuntu. com/job/ content- hub-vivid- armhf-ci/ 12/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ content- hub-vivid- i386-ci/ 12
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/content- hub-ci/ 216/rebuild
http://