Merge lp:~mterry/unity-api/fix-wakelocks-8.5 into lp:unity-api/stable

Proposed by Michał Sawicz
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 196
Merged at revision: 196
Proposed branch: lp:~mterry/unity-api/fix-wakelocks-8.5
Merge into: lp:unity-api/stable
Diff against target: 175 lines (+43/-2)
8 files modified
debian/changelog (+6/-0)
include/unity/shell/application/ApplicationInfoInterface.h (+10/-0)
include/unity/shell/application/ApplicationManagerInterface.h (+2/-0)
include/unity/shell/application/CMakeLists.txt (+1/-1)
test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp (+16/-1)
test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h (+3/-0)
test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationManager.cpp (+2/-0)
test/qmltest/unity/shell/application/tst_Application.qml (+3/-0)
To merge this branch: bzr merge lp:~mterry/unity-api/fix-wakelocks-8.5
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Approve
Review via email: mp+279626@code.launchpad.net

Commit message

To post a comment you must log in.
Revision history for this message
Daniel d'Andrada (dandrader) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-11-02 11:23:43 +0000
3+++ debian/changelog 2015-12-04 16:16:19 +0000
4@@ -1,3 +1,9 @@
5+unity-api (7.102.1) UNRELEASED; urgency=medium
6+
7+ * Added ApplicationInfoInterface::exemptFromLifecycle
8+
9+ -- Michael Terry <mterry@ubuntu.com> Thu, 03 Dec 2015 10:28:00 -0500
10+
11 unity-api (7.102+16.04.20151102-0ubuntu1) xenial; urgency=medium
12
13 [ Nick Dedekind ]
14
15=== modified file 'include/unity/shell/application/ApplicationInfoInterface.h'
16--- include/unity/shell/application/ApplicationInfoInterface.h 2015-10-01 16:24:37 +0000
17+++ include/unity/shell/application/ApplicationInfoInterface.h 2015-12-04 16:16:19 +0000
18@@ -204,6 +204,13 @@
19 */
20 Q_PROPERTY(bool isTouchApp READ isTouchApp CONSTANT)
21
22+ /**
23+ * @brief Whether this app is exempt from lifecycle management
24+ *
25+ * If true, this app will never entirely suspend its process.
26+ */
27+ Q_PROPERTY(bool exemptFromLifecycle READ exemptFromLifecycle WRITE setExemptFromLifecycle NOTIFY exemptFromLifecycleChanged)
28+
29 protected:
30 /// @cond
31 ApplicationInfoInterface(const QString &appId, QObject* parent = 0): QObject(parent) { Q_UNUSED(appId) }
32@@ -275,6 +282,8 @@
33 virtual Qt::ScreenOrientations supportedOrientations() const = 0;
34 virtual bool rotatesWindowContents() const = 0;
35 virtual bool isTouchApp() const = 0;
36+ virtual bool exemptFromLifecycle() const = 0;
37+ virtual void setExemptFromLifecycle(bool) = 0;
38 /// @endcond
39
40 Q_SIGNALS:
41@@ -286,6 +295,7 @@
42 void stateChanged(State state);
43 void requestedStateChanged(RequestedState value);
44 void focusedChanged(bool focused);
45+ void exemptFromLifecycleChanged(bool exemptFromLifecycle);
46 /// @endcond
47 };
48
49
50=== modified file 'include/unity/shell/application/ApplicationManagerInterface.h'
51--- include/unity/shell/application/ApplicationManagerInterface.h 2015-10-01 17:12:53 +0000
52+++ include/unity/shell/application/ApplicationManagerInterface.h 2015-12-04 16:16:19 +0000
53@@ -71,6 +71,7 @@
54 m_roleNames.insert(RoleState, "state");
55 m_roleNames.insert(RoleFocused, "focused");
56 m_roleNames.insert(RoleIsTouchApp, "isTouchApp");
57+ m_roleNames.insert(RoleExemptFromLifecycle, "exemptFromLifecycle");
58
59 connect(this, SIGNAL(rowsInserted(QModelIndex, int, int)), SIGNAL(countChanged()));
60 connect(this, SIGNAL(rowsRemoved(QModelIndex, int, int)), SIGNAL(countChanged()));
61@@ -94,6 +95,7 @@
62 RoleState,
63 RoleFocused,
64 RoleIsTouchApp,
65+ RoleExemptFromLifecycle,
66 };
67
68 /// @cond
69
70=== modified file 'include/unity/shell/application/CMakeLists.txt'
71--- include/unity/shell/application/CMakeLists.txt 2015-10-30 16:56:14 +0000
72+++ include/unity/shell/application/CMakeLists.txt 2015-12-04 16:16:19 +0000
73@@ -7,7 +7,7 @@
74
75 set(UNITY_API_LIB_HDRS ${UNITY_API_LIB_HDRS} ${headers} ${internal_headers} PARENT_SCOPE)
76
77-set(VERSION 10)
78+set(VERSION 10.1)
79 set(PKGCONFIG_NAME "unity-shell-application")
80 set(PKGCONFIG_DESCRIPTION "Unity shell Application APIs")
81 set(PKGCONFIG_REQUIRES "Qt5Core")
82
83=== modified file 'test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp'
84--- test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp 2015-10-01 16:24:37 +0000
85+++ test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.cpp 2015-12-04 16:16:19 +0000
86@@ -29,7 +29,8 @@
87 m_icon(icon),
88 m_stage(MainStage),
89 m_state(Running),
90- m_focused(false)
91+ m_focused(false),
92+ m_exemptFromLifecycle(false)
93 {
94
95 }
96@@ -149,3 +150,17 @@
97 {
98 return true;
99 }
100+
101+bool MockApplicationInfo::exemptFromLifecycle() const
102+{
103+ return m_exemptFromLifecycle;
104+}
105+
106+void MockApplicationInfo::setExemptFromLifecycle(bool exemptFromLifecycle)
107+{
108+ if (m_exemptFromLifecycle != exemptFromLifecycle)
109+ {
110+ m_exemptFromLifecycle = exemptFromLifecycle;
111+ Q_EMIT exemptFromLifecycleChanged(m_exemptFromLifecycle);
112+ }
113+}
114
115=== modified file 'test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h'
116--- test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h 2015-10-01 16:24:37 +0000
117+++ test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationInfo.h 2015-12-04 16:16:19 +0000
118@@ -56,6 +56,8 @@
119 bool rotatesWindowContents() const override;
120
121 bool isTouchApp() const override;
122+ bool exemptFromLifecycle() const override;
123+ void setExemptFromLifecycle(bool exemptFromLifecycle) override;
124
125 private:
126 QString m_appId;
127@@ -65,6 +67,7 @@
128 ApplicationInfoInterface::Stage m_stage;
129 ApplicationInfoInterface::State m_state;
130 bool m_focused;
131+ bool m_exemptFromLifecycle;
132 };
133
134 #endif // MOCKAPPLICATIONINFO_H
135
136=== modified file 'test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationManager.cpp'
137--- test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationManager.cpp 2015-10-01 17:12:53 +0000
138+++ test/qmltest/mocks/plugins/Unity/Application/Mocks/MockApplicationManager.cpp 2015-12-04 16:16:19 +0000
139@@ -68,6 +68,8 @@
140 return item->focused();
141 case RoleIsTouchApp:
142 return item->isTouchApp();
143+ case RoleExemptFromLifecycle:
144+ return item->exemptFromLifecycle();
145 }
146
147 return QVariant();
148
149=== modified file 'test/qmltest/unity/shell/application/tst_Application.qml'
150--- test/qmltest/unity/shell/application/tst_Application.qml 2015-10-01 17:12:53 +0000
151+++ test/qmltest/unity/shell/application/tst_Application.qml 2015-12-04 16:16:19 +0000
152@@ -70,6 +70,7 @@
153 { enum: "RoleState" },
154 { enum: "RoleFocused" },
155 { enum: "RoleIsTouchApp" },
156+ { enum: "RoleExemptFromLifecycle" },
157 ];
158 }
159
160@@ -90,6 +91,7 @@
161 { tag: "ApplicationManager.roles[state]", role: "state", type: "number" },
162 { tag: "ApplicationManager.roles[focused]", role: "focused", type: "boolean" },
163 { tag: "ApplicationManager.roles[isTouchApp]", role: "isTouchApp", type: "boolean" },
164+ { tag: "ApplicationManager.roles[exemptFromLifecycle]", role: "exemptFromLifecycle", type: "boolean" },
165 ];
166 }
167
168@@ -146,6 +148,7 @@
169 { tag: "ApplicationInfo.properties[requestedState]", property: "requestedState", type: "number" },
170 { tag: "ApplicationInfo.properties[focused]", property: "focused", type: "boolean" },
171 { tag: "ApplicationInfo.properties[isTouchApp]", constant: "isTouchApp", type: "boolean" },
172+ { tag: "ApplicationInfo.properties[exemptFromLifecycle]", constant: "exemptFromLifecycle", type: "boolean" },
173 { tag: "ApplicationInfo.properties[splashTitle]", constant: "splashTitle", type: "string" },
174 { tag: "ApplicationInfo.properties[splashImage]", constant: "splashImage", type: "url" },
175 { tag: "ApplicationInfo.properties[splashShowHeader]", constant: "splashShowHeader", type: "boolean"},

Subscribers

People subscribed via source and target branches

to all changes: