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

Proposed by Michael Terry on 2015-12-03
Status: Merged
Approved by: Daniel d'Andrada on 2015-12-03
Approved revision: 204
Merged at revision: 203
Proposed branch: lp:~mterry/unity-api/fix-wakelocks
Merge into: lp:unity-api
Prerequisite: lp:~dandrader/unity-api/surfaceItemFillMode2
Diff against target: 164 lines (+40/-1)
7 files modified
debian/changelog (+4/-0)
include/unity/shell/application/ApplicationInfoInterface.h (+10/-0)
include/unity/shell/application/ApplicationManagerInterface.h (+2/-0)
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
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) 2015-12-03 Approve on 2015-12-03
PS Jenkins bot (community) continuous-integration 2015-12-03 Approve on 2015-12-03
Review via email: mp+279499@code.launchpad.net

This proposal supersedes a proposal from 2015-12-03.

Commit message

Added ApplicationInfoInterface::exemptFromLifecycle

Description of the change

Added ApplicationInfoInterface::exemptFromLifecycle

Related to similar changes in qtmir and unity8, to fix bug 1518764:
 https://code.launchpad.net/~mterry/qtmir/fix-wakelocks/+merge/279481
 https://code.launchpad.net/~mterry/unity8/fix-wakelocks/+merge/279489

To post a comment you must log in.
Daniel d'Andrada (dandrader) wrote : Posted in a previous version of this proposal

Copy-and-paste problem in the documentation of that new property

review: Needs Fixing
Michael Terry (mterry) wrote : Posted in a previous version of this proposal

> Copy-and-paste problem in the documentation of that new property

Duh, good eye. :) Fixed.

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

Subscribers

People subscribed via source and target branches

to all changes: