Class: DeviceAPI::Android::Kindle
- Defined in:
- lib/device_api/android/device/kindle.rb
Overview
Kindle specific device class
Instance Attribute Summary
Attributes inherited from Device
Instance Method Summary collapse
-
#unlock ⇒ Object
On non-Kindle devices, if a device is locked without a password (i.e. ‘Swipe to unlock’), then you can unlock that device by broadcasting a ‘WakeUp’ intent.
Methods inherited from Device
#app_version_number, #battery, #battery_info, #battery_level, #block_package, #connect, create, #device, #disconnect, #diskstat, #dpi, #imei, inherited, #initialize, #install, #intent, #ip_address, #is_connected?, #is_remote?, #list_installed_packages, #manufacturer, #memory, #model, #monkey, #orientation, #package_name, #powered?, #range, #reboot, #screen_on?, #screenshot, #serial_no, #set_ip_and_port, #status, #type, #uninstall, #uptime, #version, #wifi_mac_address, #wifi_status
Constructor Details
This class inherits a constructor from DeviceAPI::Android::Device
Instance Method Details
#unlock ⇒ Object
On non-Kindle devices, if a device is locked without a password (i.e. ‘Swipe to unlock’), then you can unlock that device by broadcasting a ‘WakeUp’ intent. On Kindle devices, this does not work due to Amazons implementation of the Keyguard.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/device_api/android/device/kindle.rb', line 8 def unlock ADB.keyevent(qualifier, '26') unless screen_on? return ADB.swipe(qualifier, {x_from: 900, y_from: 500, x_to: 300, y_to: 500}) if version.split('.').first.to_i < 5 if orientation == :landscape coords = { x_from: 500, y_from: 750, x_to: 500, y_to: 250 } else coords = { x_from: 300, y_from: 900, x_to: 300, y_to: 600 } end ADB.swipe(qualifier, coords) end |