public class FlashlightTile extends QSTile<QSTile.BooleanState> implements FlashlightController.FlashlightListener
QSTile.AirplaneBooleanState, QSTile.AnimationIcon, QSTile.BooleanState, QSTile.Callback, QSTile.DetailAdapter, QSTile.DrawableIcon, QSTile.H, QSTile.Host, QSTile.Icon, QSTile.ResourceIcon, QSTile.SignalState, QSTile.State
Constructor and Description |
---|
FlashlightTile(QSTile.Host host) |
Modifier and Type | Method and Description |
---|---|
protected String |
composeChangeAnnouncement() |
Intent |
getLongClickIntent() |
int |
getMetricsCategory()
Declare the category of this tile.
|
CharSequence |
getTileLabel() |
protected void |
handleClick() |
protected void |
handleDestroy() |
protected void |
handleLongClick() |
protected void |
handleUpdateState(QSTile.BooleanState state,
Object arg) |
protected void |
handleUserSwitch(int newUserId) |
boolean |
isAvailable()
Is a startup check whether this device currently supports this tile.
|
QSTile.BooleanState |
newTileState() |
void |
onFlashlightAvailabilityChanged(boolean available)
Called when there is a change in availability of the flashlight functionality
|
void |
onFlashlightChanged(boolean enabled)
Called when the flashlight was turned off or on.
|
void |
onFlashlightError()
Called when there is an error that turns the flashlight off.
|
void |
setListening(boolean listening) |
addCallback, checkIfRestrictionEnforcedByAdminOnly, clearState, click, createTileView, destroy, fireScanStateChanged, fireToggleStateChanged, getDetailAdapter, getHost, getState, getTileSpec, handleClearState, handleRefreshState, handleSecondaryClick, longClick, refreshState, refreshState, removeCallback, removeCallbacks, secondaryClick, setDetailListening, setListening, setTileSpec, shouldAnnouncementBeDelayed, showDetail, userSwitch
public FlashlightTile(QSTile.Host host)
protected void handleDestroy()
handleDestroy
in class QSTile<QSTile.BooleanState>
public QSTile.BooleanState newTileState()
newTileState
in class QSTile<QSTile.BooleanState>
public void setListening(boolean listening)
setListening
in class QSTile<QSTile.BooleanState>
protected void handleUserSwitch(int newUserId)
handleUserSwitch
in class QSTile<QSTile.BooleanState>
public Intent getLongClickIntent()
getLongClickIntent
in class QSTile<QSTile.BooleanState>
public boolean isAvailable()
QSTile
isAvailable
in class QSTile<QSTile.BooleanState>
protected void handleClick()
handleClick
in class QSTile<QSTile.BooleanState>
public CharSequence getTileLabel()
getTileLabel
in class QSTile<QSTile.BooleanState>
protected void handleLongClick()
handleLongClick
in class QSTile<QSTile.BooleanState>
protected void handleUpdateState(QSTile.BooleanState state, Object arg)
handleUpdateState
in class QSTile<QSTile.BooleanState>
public int getMetricsCategory()
QSTile
com.android.internal.logging.MetricsProto.MetricsEvent
by editing frameworks/base/proto/src/metrics_constants.proto.getMetricsCategory
in class QSTile<QSTile.BooleanState>
protected String composeChangeAnnouncement()
composeChangeAnnouncement
in class QSTile<QSTile.BooleanState>
public void onFlashlightChanged(boolean enabled)
FlashlightController.FlashlightListener
onFlashlightChanged
in interface FlashlightController.FlashlightListener
enabled
- true if the flashlight is currently turned on.public void onFlashlightError()
FlashlightController.FlashlightListener
onFlashlightError
in interface FlashlightController.FlashlightListener
public void onFlashlightAvailabilityChanged(boolean available)
FlashlightController.FlashlightListener
onFlashlightAvailabilityChanged
in interface FlashlightController.FlashlightListener
available
- true if the flashlight is currently available.