~cimi/unity8/card_touchdown

« back to all changes in this revision

Viewing changes to tools/unlock-device

  • Committer: Andrea Cimitan
  • Date: 2014-06-20 15:02:12 UTC
  • mfrom: (917.1.36 obeyArtShapeFixedSize)
  • Revision ID: andrea.cimitan@gmail.com-20140620150212-an6nkcv515i22usy
Merged albert branch with fixes for icon size

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
        esac
18
18
done
19
19
 
20
 
UNLOCK_SCRIPT='
21
 
import dbus, logging;
22
 
from unity8 import process_helpers as helpers;
23
 
logging.basicConfig(level=logging.INFO);
24
 
bus = dbus.SystemBus().get_object("com.canonical.powerd", "/com/canonical/powerd");
25
 
cookie = bus.requestSysState("unlock-device-hold", 1, dbus_interface="com.canonical.powerd");
26
 
helpers.restart_unity_with_testability();
27
 
bus.clearSysState(cookie, dbus_interface="com.canonical.powerd");
28
 
helpers.unlock_unity()
29
 
'
 
20
LIGHTDM_CONFIG="
 
21
[SeatDefaults]
 
22
autologin-in-background=false
 
23
"
 
24
LIGHTDM_CONFIG_FILE="/etc/lightdm/lightdm.conf.d/99-unity8-greeter-unlock.conf"
 
25
 
 
26
adb shell "echo '$LIGHTDM_CONFIG' > $LIGHTDM_CONFIG_FILE"
30
27
 
31
28
eval "$WAIT_COMMAND"
32
29
 
33
 
UNLOCK_OUTPUT=$(adb shell "sudo -u phablet -i python3 -c '$UNLOCK_SCRIPT'" 2>&1)
34
 
if echo "$UNLOCK_OUTPUT" | grep 'Greeter unlocked' >/dev/null; then
35
 
    echo "I: Unlock passed"
36
 
    exit 0
37
 
else
38
 
    echo "I: Unlock failed, script output: '$UNLOCK_OUTPUT'"
39
 
    exit 1
40
 
fi
 
30
adb shell "rm -f $LIGHTDM_CONFIG_FILE"
 
31
 
 
32
exit 0