@@ -21,11 +21,10 @@ eval "$WAIT_COMMAND"
22# Force a sleep of twenty no matter what, since we may need to wait for unity8
22# Force a sleep of twenty no matter what, since we may need to wait for unity8
23# to finish coming up (it's hard to tell when the greeter is actually rendered)
23# to finish coming up (it's hard to tell when the greeter is actually rendered)
26+# We need to go through sudo to get a proper environment for dbus set up
26−GDBUS_CMD="gdbus call --session --dest com.canonical.UnityGreeter --object-path / --method com.canonical.UnityGreeter.HideGreeter && echo Greeter unlocked"
27+UNLOCK_OUTPUT=$(adb shell "sudo -u phablet -i gdbus call --session --dest com.canonical.UnityGreeter --object-path / --method com.canonical.UnityGreeter.HideGreeter && echo Greeter unlocked" 2>&1)
28−UNLOCK_OUTPUT=$(adb shell "if [ \"\$(id -u)\" = 0 ]; then sudo -u phablet -i $GDBUS_CMD; else $GDBUS_CMD; fi" 2>&1)
29if echo "$UNLOCK_OUTPUT" | grep 'Greeter unlocked' >/dev/null; then
28if echo "$UNLOCK_OUTPUT" | grep 'Greeter unlocked' >/dev/null; then
30 echo "I: Unlock passed"
29 echo "I: Unlock passed"