Merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/devbootmsg5 into lp:qtcreator-plugin-ubuntu

Proposed by Benjamin Zeller
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 332
Merged at revision: 332
Proposed branch: lp:~zeller-benjamin/qtcreator-plugin-ubuntu/devbootmsg5
Merge into: lp:qtcreator-plugin-ubuntu
Diff against target: 95 lines (+33/-5)
3 files modified
share/qtcreator/ubuntu/scripts/device_wait_for_shell (+14/-3)
src/ubuntu/ubuntudevice.cpp (+17/-2)
src/ubuntu/ubuntudevice.h (+2/-0)
To merge this branch: bzr merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/devbootmsg5
Reviewer Review Type Date Requested Status
Zoltan Balogh Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+247675@code.launchpad.net

Commit message

More descriptive messages when waiting for the device to be ready LP:#1400843

Description of the change

More descriptive messages when waiting for the device to be ready LP:#1400843

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

let it fly

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'share/qtcreator/ubuntu/scripts/device_wait_for_shell'
2--- share/qtcreator/ubuntu/scripts/device_wait_for_shell 2014-05-14 14:18:55 +0000
3+++ share/qtcreator/ubuntu/scripts/device_wait_for_shell 2015-01-27 07:34:20 +0000
4@@ -22,13 +22,24 @@
5
6 adb -s ${SERIALNUMBER} wait-for-device
7
8-# The device is accesibale on ADB"
9+# The device is accessible on ADB"
10+set +e
11+
12+error=$(adb -s ${SERIALNUMBER} shell echo ok 2>&1)
13+
14+if [[ ${error} =~ "closed" ]]; then
15+ echo "DevLocked"
16+else
17+ echo "DevUnLocked"
18+fi
19+
20+set -e
21
22 # Start waiting for Unity8"
23
24-until pids=$(adb -s ${SERIALNUMBER} shell pidof unity8|egrep -v "^$");
25+until pids=$(adb -s ${SERIALNUMBER} shell pidof unity8 2>/dev/null|egrep -v "^$");
26 do
27- sleep 0.1;
28+ sleep 0.1;
29 done;
30
31 echo "Unity8 is up with PID: ${pids}"
32
33=== modified file 'src/ubuntu/ubuntudevice.cpp'
34--- src/ubuntu/ubuntudevice.cpp 2014-11-27 16:23:51 +0000
35+++ src/ubuntu/ubuntudevice.cpp 2015-01-27 07:34:20 +0000
36@@ -146,7 +146,7 @@
37 //at this point the serial ID should be known
38 m_dev->setupPrivateKey();
39
40- setProcessState(UbuntuDevice::WaitForBoot);
41+ setProcessState(UbuntuDevice::WaitForBootAdbAccess);
42 beginAction(QString::fromLatin1(Constants::UBUNTUDEVICESWIDGET_WAIT_FOR_BOOT_MESSAGE));
43
44 stopProcess();
45@@ -184,7 +184,9 @@
46 waitForBoot();
47 break;
48 }
49- case UbuntuDevice::WaitForBoot: {
50+ case UbuntuDevice::WaitForBoot:
51+ case UbuntuDevice::WaitForBootAdbAccess:
52+ case UbuntuDevice::WaitForBootDeviceLock: {
53 if(code != 0) {
54 m_errorCount++;
55 waitForBoot();
56@@ -397,6 +399,15 @@
57
58 void UbuntuDeviceHelper::onMessage(const QString &msg) {
59 m_reply.append(msg);
60+
61+ if(m_dev->m_processState == UbuntuDevice::WaitForBootAdbAccess) {
62+ if(m_reply.contains(QStringLiteral("DevLocked"))) {
63+ setProcessState(UbuntuDevice::WaitForBootDeviceLock);
64+ }
65+ else if(m_reply.contains(QStringLiteral("DevUnLocked"))) {
66+ setProcessState(UbuntuDevice::WaitForBoot);
67+ }
68+ }
69 }
70
71 void UbuntuDeviceHelper::onError(const QString &error)
72@@ -1206,6 +1217,10 @@
73 return tr("Waiting for the emulator to start up");
74 case WaitForBoot:
75 return tr("Waiting for the device to finish booting");
76+ case WaitForBootAdbAccess:
77+ return tr("Waiting for adb access, make sure the developer mode is enabled");
78+ case WaitForBootDeviceLock:
79+ return tr("Waiting for the device, make sure it is unlocked");
80 case DetectDeviceVersion:
81 return tr("Detecting device version");
82 case DetectNetworkConnection:
83
84=== modified file 'src/ubuntu/ubuntudevice.h'
85--- src/ubuntu/ubuntudevice.h 2014-08-06 16:00:53 +0000
86+++ src/ubuntu/ubuntudevice.h 2015-01-27 07:34:20 +0000
87@@ -126,6 +126,8 @@
88 enum ProcessState {
89 NotStarted,
90 WaitForEmulatorStart,
91+ WaitForBootAdbAccess,
92+ WaitForBootDeviceLock,
93 WaitForBoot,
94 DetectDeviceVersion,
95 DetectNetworkConnection,

Subscribers

People subscribed via source and target branches