Class: SleepMenu

SleepMenu

new SleepMenu()

SleepMenu controls functionality found in the menu after long-pressing on the power button.

SleepMenu controls functionality found in the menu after long-pressing on the power button. Controls include: airplane mode, silence incoming calls, restart, and power off. This file also currently contains a developerOptions object which is not currently in use.

Source:
Requires:
  • module:InitLogoHandler
  • module:LogoLoader
  • module:Service
  • module:SettingsListener

Requires

  • module:InitLogoHandler
  • module:LogoLoader
  • module:Service
  • module:SettingsListener

Members

developerOptions :Object

Additional options to show in the menu if developer menu is enabled.

Additional options to show in the menu if developer menu is enabled.

Type:
  • Object
Source:

elements :Object

References to elements in the menu.

References to elements in the menu.

Type:
  • Object
Source:

isDeveloperMenuEnabled :Boolean

Indicate setting status of developer.menu.enabled

.

Indicate setting status of developer.menu.enabled

Type:
  • Boolean
Source:

isFlightModeEnabled :Boolean

Indicate setting status of ril.radio.disabled

.

Indicate setting status of ril.radio.disabled

Type:
  • Boolean
Source:

isSilentModeEnabled :Boolean

Indicate setting status of volume

.

Indicate setting status of volume

Type:
  • Boolean
Source:

visible

Whether or not the sleep menu is visibile.

Whether or not the sleep menu is visibile.

Source:

Methods

_actualPowerOff(isReboot)

Helper for powering the device off.

Helper for powering the device off.

Parameters:
Name Type Description
isReboot Boolean

Whether or not to reboot the phone.

Source:

buildMenu(items)

Builds markup for all menu items.

Builds markup for all menu items.

Parameters:
Name Type Description
items Array

A list of items.

Source:

clickHandler(action)

Handles click events on menu items.

Handles click events on menu items.

Parameters:
Name Type Description
action String

The action of the clicked menu item.

Source:

generateItems()

Generates menu items.

Generates menu items.

Source:

getAllElements()

Populates this.elements with references to elements.

Populates this.elements with references to elements.

Source:

handleEvent(evt)

General event handler.

General event handler.

Parameters:
Name Type Description
evt Event

The event to handle.

Source:

hide()

Hides the sleep menu.

Hides the sleep menu.

Source:

show()

Shows the sleep menu.

Shows the sleep menu.

Source:

start()

Start listening for events and settings changes.

Start listening for events and settings changes.

Source:

startPowerOff(reboot)

Begins the power off of the device.

Begins the power off of the device. Also reboots the device if requested.

Parameters:
Name Type Description
reboot Boolean

Whether or not to reboot the phone.

Source: