Merge lp:~ted/ubuntu-app-launch/drop-surface-flinger into lp:ubuntu-app-launch/14.04

Proposed by Ted Gould on 2014-03-28
Status: Merged
Approved by: Charles Kerr on 2014-04-02
Approved revision: 147
Merged at revision: 145
Proposed branch: lp:~ted/ubuntu-app-launch/drop-surface-flinger
Merge into: lp:ubuntu-app-launch/14.04
Diff against target: 186 lines (+9/-47)
6 files modified
click-exec.c (+0/-7)
desktop-exec.c (+1/-3)
exec-line-exec.c (+0/-7)
tests/exec-util-test.cc (+2/-10)
upstart-jobs/application-click.conf.in (+2/-10)
upstart-jobs/application-legacy.conf.in (+4/-10)
To merge this branch: bzr merge lp:~ted/ubuntu-app-launch/drop-surface-flinger
Reviewer Review Type Date Requested Status
Charles Kerr (community) 2014-03-28 Approve on 2014-04-02
PS Jenkins bot (community) continuous-integration Approve on 2014-03-28
Review via email: mp+213326@code.launchpad.net

Commit message

Drop Surface Flinger support

Description of the change

Free us from the flinger!

To post a comment you must log in.
Charles Kerr (charlesk) wrote :

Looks good.

One suggestion, it would be better to use g_get_user_data_dir() than to build it by hand.

Charles Kerr (charlesk) wrote :

gah! I just asked you to fix code that's being removed. Clearly you should fix it, /then/ remove it.

review: Approve
148. By Ted Gould on 2014-05-21

Merge trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'click-exec.c'
2--- click-exec.c 2014-03-07 14:19:03 +0000
3+++ click-exec.c 2014-05-21 15:00:36 +0000
4@@ -160,13 +160,6 @@
5
6 tracepoint(upstart_app_launch, click_read_desktop);
7
8- /* TODO: This is for Surface Flinger, when we drop support we can drop this */
9- gchar * userdesktopfile = g_strdup_printf("%s.desktop", app_id);
10- gchar * userdesktoppath = g_build_filename(g_get_home_dir(), ".local", "share", "applications", userdesktopfile, NULL);
11- set_upstart_variable("APP_DESKTOP_FILE", userdesktoppath, FALSE);
12- g_free(userdesktopfile);
13- g_free(userdesktoppath);
14-
15 g_debug("Setting 'APP_EXEC' to '%s'", exec);
16 /* NOTE: This should be the last upstart variable set as it is sync
17 so it will wait for a reply from Upstart implying that Upstart
18
19=== modified file 'desktop-exec.c'
20--- desktop-exec.c 2014-02-07 14:56:27 +0000
21+++ desktop-exec.c 2014-05-21 15:00:36 +0000
22@@ -71,10 +71,8 @@
23
24 tracepoint(upstart_app_launch, desktop_found);
25
26- /* TODO: This is for Surface Flinger. When we drop support, we can drop this code */
27+ /* Desktop file name so that libs can get other info from it */
28 if (desktopfilename != NULL) {
29- set_upstart_variable("APP_DESKTOP_FILE", desktopfilename, FALSE);
30- /* This is not for SF, it's for platform API only above is for SF */
31 set_upstart_variable("APP_DESKTOP_FILE_PATH", desktopfilename, FALSE);
32 g_free(desktopfilename);
33 }
34
35=== modified file 'exec-line-exec.c'
36--- exec-line-exec.c 2014-02-07 14:56:27 +0000
37+++ exec-line-exec.c 2014-05-21 15:00:36 +0000
38@@ -46,7 +46,6 @@
39
40 /* URIs */
41 const gchar * app_uris = g_getenv("APP_URIS");
42- const gchar * app_desktop = g_getenv("APP_DESKTOP_FILE");
43
44 /* Look to see if we have a directory defined that we
45 should be using for everything. If so, change to it
46@@ -117,12 +116,6 @@
47
48 tracepoint(upstart_app_launch, exec_parse_complete);
49
50- /* Surface flinger check */
51- if (g_getenv("USING_SURFACE_FLINGER") != NULL && app_desktop != NULL) {
52- gchar * sf = g_strdup_printf("--desktop_file_hint=%s", app_desktop);
53- g_array_append_val(newargv, sf);
54- }
55-
56 /* Now exec */
57 gchar ** nargv = (gchar**)g_array_free(newargv, FALSE);
58
59
60=== modified file 'tests/exec-util-test.cc'
61--- tests/exec-util-test.cc 2014-03-12 00:28:05 +0000
62+++ tests/exec-util-test.cc 2014-05-21 15:00:36 +0000
63@@ -94,7 +94,7 @@
64 guint len = 0;
65 const DbusTestDbusMockCall * calls = dbus_test_dbus_mock_object_get_method_calls(mock, obj, "SetEnv", &len, NULL);
66
67- ASSERT_EQ(12, len);
68+ ASSERT_EQ(11, len);
69 ASSERT_NE(nullptr, calls);
70
71 unsigned int i;
72@@ -109,7 +109,6 @@
73 bool got_shader_dir = false;
74 bool got_app_dir = false;
75 bool got_app_exec = false;
76- bool got_app_desktop = false;
77 bool got_app_desktop_path = false;
78
79 #define APP_DIR CMAKE_SOURCE_DIR "/click-root-dir/.click/users/test-user/com.test.good"
80@@ -153,8 +152,6 @@
81 } else if (g_strcmp0(var, "APP_EXEC") == 0) {
82 EXPECT_STREQ("foo", value);
83 got_app_exec = true;
84- } else if (g_strcmp0(var, "APP_DESKTOP_FILE") == 0) {
85- got_app_desktop = true;
86 } else if (g_strcmp0(var, "APP_DESKTOP_FILE_PATH") == 0) {
87 EXPECT_STREQ(APP_DIR "/application.desktop", value);
88 got_app_desktop_path = true;
89@@ -178,7 +175,6 @@
90 EXPECT_TRUE(got_shader_dir);
91 EXPECT_TRUE(got_app_dir);
92 EXPECT_TRUE(got_app_exec);
93- EXPECT_TRUE(got_app_desktop);
94 EXPECT_TRUE(got_app_desktop_path);
95 }
96
97@@ -193,13 +189,12 @@
98 guint len = 0;
99 const DbusTestDbusMockCall * calls = dbus_test_dbus_mock_object_get_method_calls(mock, obj, "SetEnv", &len, NULL);
100
101- ASSERT_EQ(4, len);
102+ ASSERT_EQ(3, len);
103 ASSERT_NE(nullptr, calls);
104
105 unsigned int i;
106
107 bool got_app_exec = false;
108- bool got_app_desktop = false;
109 bool got_app_desktop_path = false;
110 bool got_app_exec_policy = false;
111
112@@ -219,8 +214,6 @@
113 if (g_strcmp0(var, "APP_EXEC") == 0) {
114 EXPECT_STREQ("foo", value);
115 got_app_exec = true;
116- } else if (g_strcmp0(var, "APP_DESKTOP_FILE") == 0) {
117- got_app_desktop = true;
118 } else if (g_strcmp0(var, "APP_DESKTOP_FILE_PATH") == 0) {
119 EXPECT_STREQ(CMAKE_SOURCE_DIR "/applications/foo.desktop", value);
120 got_app_desktop_path = true;
121@@ -236,7 +229,6 @@
122 }
123
124 EXPECT_TRUE(got_app_exec);
125- EXPECT_TRUE(got_app_desktop);
126 EXPECT_TRUE(got_app_desktop_path);
127 EXPECT_TRUE(got_app_exec_policy);
128 }
129
130=== modified file 'upstart-jobs/application-click.conf.in'
131--- upstart-jobs/application-click.conf.in 2014-04-11 18:33:23 +0000
132+++ upstart-jobs/application-click.conf.in 2014-05-21 15:00:36 +0000
133@@ -10,22 +10,14 @@
134 env APP_EXEC
135 env APP_URIS
136 env APP_DIR
137-# For Surface Flinger
138-env APP_DESKTOP_FILE
139-env APP_PROCESS_GROUP
140+env APP_DESKTOP_FILE_PATH
141
142 env UPSTART_APP_LAUNCH_ARCH="@upstart_app_launch_arch@"
143 export UPSTART_APP_LAUNCH_ARCH
144
145 apparmor switch ${APP_ID}
146
147-pre-start script
148- if pgrep -u system surfaceflinger ; then
149- initctl set-env USING_SURFACE_FLINGER=1
150- fi
151-
152- exec @pkglibexecdir@/click-exec
153-end script
154+pre-start exec @pkglibexecdir@/click-exec
155
156 # Remember, this is confined
157 exec @pkglibexecdir@/exec-line-exec
158
159=== modified file 'upstart-jobs/application-legacy.conf.in'
160--- upstart-jobs/application-legacy.conf.in 2014-02-13 22:43:55 +0000
161+++ upstart-jobs/application-legacy.conf.in 2014-05-21 15:00:36 +0000
162@@ -10,20 +10,14 @@
163 env APP_EXEC
164 env APP_EXEC_POLICY=""
165 env APP_URIS
166-# For Surface Flinger
167-env APP_DESKTOP_FILE
168+env APP_DESKTOP_FILE_PATH
169
170 # This will be set to "unconfined" by desktop-exec if there is no confinement defined
171 apparmor switch $APP_EXEC_POLICY
172
173-pre-start script
174- if pgrep -u system surfaceflinger ; then
175- initctl set-env USING_SURFACE_FLINGER=1
176- fi
177-
178- exec @pkglibexecdir@/desktop-exec
179-end script
180-
181+pre-start exec @pkglibexecdir@/desktop-exec
182+
183+# This could be confined
184 exec @pkglibexecdir@/exec-line-exec
185
186 post-start exec @pkglibexecdir@/zg-report-app open

Subscribers

People subscribed via source and target branches