Powerd

Dependants/Clients

  • libhybris
  • ofono

Test Plan

Test target device: Nexus 4 Secondary/backup device: Nexus 7 2013 (flo) - can't be used to test integration with ofono

Initial set up

  • Install latest image on phone
  • Build package containing the code to be landed, push them to and install them on the device
  • Reboot the phone

Steps to install powerd from silo on Krillin

copy the debs to the device and execute the following steps:

$ adb reboot recovery
$ adb shell
~ # export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
~ # mount /system
~ # chroot /system /bin/bash
root@localhost:/# touch /etc/init.d/powerd
root@localhost:/# dpkg -i /var/cache/apt/archives/powerd_0.16+14.10.20140819-0ubuntu1_armhf.deb
(Reading database ... 39993 files and directories currently installed.)
Preparing to unpack .../powerd_0.16+14.10.20140819-0ubuntu1_armhf.deb ...
Unpacking powerd (0.16+14.10.20140819-0ubuntu1) over (0.16+14.10.20140819-0ubuntu1) ...
Setting up powerd (0.16+14.10.20140819-0ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
root@localhost:/# rm /etc/init.d/powerd 
root@localhost:/# sync
root@localhost:/# exit

Steps to install powerd from silo on Arale

instructions added by kgunn in frustration, good to double check on irc, but these seemed to work

Make sure to use the correct recovery img

  1. First, make sure to download the recovery.img to your host machine from the correct location, as of Aug 2015 that is http://people.canonical.com/~alextu/tangxi/recovery/recovery.img

  2. reboot the phone into fastboot mode by power button & vol- simultaneously from off state

  3. Then flash that

host $ fastboot flash recovery recovery.img

Installing powerd on Arale

note for whatever reason, adb reboot recovery doesn't seem to allow adb, but booting into fastboot and then into recovery does

  1. boot into fastboot by holding power button & vol- simultaneously, then boot into recovery by power & vol+

  2. download deb from silo ppa you'd like to install onto your host
  3. copy the debs to the device & install by:

host $ adb shell
device ~ # export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
device ~ # mount /system
device ~ # chroot /system /bin/bash
device root@localhost:/# touch /etc/init.d/powerd
host $ adb push /onyourhost/powerd*.deb /system/tmp
device root@localhost:/# dpkg -i /tmp/powerd*.deb
device root@localhost:/# rm /etc/init.d/powerd 
device root@localhost:/# sync
device root@localhost:/# exit
device ~ # exit
host $ adb reboot

Manual Tests

  • Test that the device can automatically shutdown the screen and suspend
  • Test that the device can wake up/suspend when pressing the power button
  • Test that the device can wake up when receiving a call
  • Test that the device can wake up when connecting/disconnecting usb charger
  • See if the lab-specific screen unlock logic still works:
    bzr branch lp:ubuntu-test-cases/touch
    adb push touch/utils/target/unlock_screen.py /sbin/
    adb shell apt-get install unity8-autopilot
    adb shell 'sudo -i -u phablet bash -ic "/usr/bin/python /sbin/unlock_screen.py"'
  • Test that killing a process that holds a SysPowerRequest effectively releases the wakelock. Running the following command should result in "active" not being in the list after 5 seconds (without any opened app, just unity8):

    powerd-cli active & sleep 2 && kill -9 `pidof powerd-cli`
  • Unplug the usb cable and reboot the phone. It shouldn't take more than 30 seconds to reboot to the bootloader.
    • This is because if the phone takes more than 30 seconds to reboot it might mean that it's trying to suspend at the same time (bug 1452300)

Process/Merges/TestPlans/Powerd (last edited 2015-09-25 15:21:00 by pool-173-74-225-137)