Merge lp:~dobey/ubuntu-system-settings/token-deleted into lp:ubuntu-system-settings

Proposed by dobey on 2015-02-18
Status: Merged
Approved by: Ken VanDine on 2015-02-20
Approved revision: 1316
Merged at revision: 1324
Proposed branch: lp:~dobey/ubuntu-system-settings/token-deleted
Merge into: lp:ubuntu-system-settings
Diff against target: 76 lines (+15/-0)
5 files modified
plugins/system-update/PageComponent.qml (+5/-0)
plugins/system-update/update_manager.cpp (+4/-0)
plugins/system-update/update_manager.h (+1/-0)
tests/plugins/system-update/fakessoservice.cpp (+2/-0)
tests/plugins/system-update/fakessoservice.h (+3/-0)
To merge this branch: bzr merge lp:~dobey/ubuntu-system-settings/token-deleted
Reviewer Review Type Date Requested Status
Ken VanDine 2015-02-18 Approve on 2015-02-20
PS Jenkins bot continuous-integration Approve on 2015-02-19
Review via email: mp+250202@code.launchpad.net

Commit Message

Handle the credentialsDeleted signal appropriately.

Description of the Change

To test this is a bit difficult. You will need a U1 account on the phone, which is not added to the "unconfined" ACL. This can be done on the latest images, by manually deleting the ACL entry in the database after creating an account.

Close system settings.
Open the terminal app or use phablet-shell to perform the sqlite work.

First get the account ID:

# account-console list

That will print a list of account IDs and their provider. Take a note of the "ubuntuone" account, and use it as a parameter for the next command:

# account-console show <account-id>

Look for the "CredentialsId" field; let's call its value $ACCOUNT_ID.
Then you need to delete the entry from the ACL table in the signon database.

# sqlite3 .config/signond/signon.db
sqlite> delete from ACL where identity_id=$ACCOUNT_ID;
sqlite> delete from OWNER where identity_id=$ACCOUNT_ID;

Now, open system settings, and go to the Updates page. Without this branch, you should see the button requesting you to log in to U1 to get app updates. With this branch, the online accounts UI should pop up directly to the U1 page requesting to log in again.

To post a comment you must log in.
Ken VanDine (ken-vandine) wrote :

Please include steps to manually test

review: Needs Information
Ken VanDine (ken-vandine) wrote :

Looks good and works as described, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/system-update/PageComponent.qml'
2--- plugins/system-update/PageComponent.qml 2015-01-30 18:09:06 +0000
3+++ plugins/system-update/PageComponent.qml 2015-02-18 19:56:56 +0000
4@@ -204,6 +204,11 @@
5 credentialsNotification.visible = true;
6 }
7
8+ onCredentialsDeleted: {
9+ credentialsNotification.visible = false;
10+ uoaConfig.exec();
11+ }
12+
13 onSystemUpdateDownloaded: {
14 root.installAll = false;
15 }
16
17=== modified file 'plugins/system-update/update_manager.cpp'
18--- plugins/system-update/update_manager.cpp 2015-01-23 10:01:34 +0000
19+++ plugins/system-update/update_manager.cpp 2015-02-18 19:56:56 +0000
20@@ -63,6 +63,10 @@
21 this, SIGNAL(credentialsNotFound()));
22 QObject::connect(&m_service, SIGNAL(credentialsNotFound()),
23 this, SLOT(clickUpdateNotAvailable()));
24+ QObject::connect(&m_service, SIGNAL(credentialsDeleted()),
25+ this, SIGNAL(credentialsDeleted()));
26+ QObject::connect(&m_service, SIGNAL(credentialsDeleted()),
27+ this, SLOT(clickUpdateNotAvailable()));
28 // PROCESS
29 QObject::connect(&m_process, SIGNAL(finished(int)),
30 this, SLOT(processOutput()));
31
32=== modified file 'plugins/system-update/update_manager.h'
33--- plugins/system-update/update_manager.h 2014-12-09 21:01:36 +0000
34+++ plugins/system-update/update_manager.h 2015-02-18 19:56:56 +0000
35@@ -68,6 +68,7 @@
36 void modelChanged();
37 void updatesNotFound();
38 void credentialsNotFound();
39+ void credentialsDeleted();
40 void updateAvailableFound(bool downloading);
41 void errorFound();
42 void networkError();
43
44=== modified file 'tests/plugins/system-update/fakessoservice.cpp'
45--- tests/plugins/system-update/fakessoservice.cpp 2014-05-07 15:37:22 +0000
46+++ tests/plugins/system-update/fakessoservice.cpp 2015-02-18 19:56:56 +0000
47@@ -13,6 +13,8 @@
48 if(m_validCredentials) {
49 Token token("token_key", "token_secret", "consumer_key", "consumer_secret");
50 emit this->credentialsFound(token);
51+ } else if (m_deletedCredentials) {
52+ emit this->credentialsDeleted();
53 } else {
54 emit this->credentialsNotFound();
55 }
56
57=== modified file 'tests/plugins/system-update/fakessoservice.h'
58--- tests/plugins/system-update/fakessoservice.h 2014-05-05 18:18:37 +0000
59+++ tests/plugins/system-update/fakessoservice.h 2015-02-18 19:56:56 +0000
60@@ -17,13 +17,16 @@
61 void getCredentials();
62
63 void setValidCredentials(bool value) { m_validCredentials = value; }
64+ void setDeletedCredentials(bool value) { m_deletedCredentials = value; }
65
66 signals:
67 void credentialsFound(const Token&);
68 void credentialsNotFound();
69+ void credentialsDeleted();
70
71 private:
72 bool m_validCredentials;
73+ bool m_deletedCredentials;
74 };
75
76 }

Subscribers

People subscribed via source and target branches