@@ -13,18 +13,16 @@ if [ -z "$ANDROID_SERIAL" ]; then
1313 exit 1
1414fi
1515
16−UNLOCK_SCRIPT="
16+UNLOCK_SCRIPT='
1717import dbus, logging;
1818from unity8 import process_helpers as helpers;
1919logging.basicConfig(level=logging.INFO);
20−bus = dbus.SystemBus().get_object(\"com.canonical.powerd\", \"/com/canonical/powerd\");
21−cookie = bus.requestSysState(\"unlock-device-hold\", 1, dbus_interface=\"com.canonical.powerd\");
20+bus = dbus.SystemBus().get_object("com.canonical.powerd", "/com/canonical/powerd");
21+cookie = bus.requestSysState("unlock-device-hold", 1, dbus_interface="com.canonical.powerd");
2222helpers.restart_unity_with_testability();
23−bus.clearSysState(cookie, dbus_interface=\"com.canonical.powerd\");
23+bus.clearSysState(cookie, dbus_interface="com.canonical.powerd");
2424helpers.unlock_unity()
25−"
26−
27−RETURN_CODE=0
25+'
2826
2927retries=0
3028while [ $retries -lt $max_retries ]; do
@@ -43,9 +41,9 @@ while [ $retries -lt $max_retries ]; do
4341 echo "W: Unlock failed, trying again"
4442 else
4543 echo "E: Unlock failed, no more retries"
46− RETURN_CODE=1
44+ exit 1
4745 fi
4846 fi
4947done
5048
51−exit $RETURN_CODE
49+exit 0