# WatchFaceService.Engine

Summary:[Ctors](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine#pubctors)\|[Methods](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine#inhmethods)  

# WatchFaceService.Engine

`
public


abstract
class
WatchFaceService.Engine
`  
`


``

extends `[WallpaperService.Engine](http://developer.android.com/reference/android/service/wallpaper/WallpaperService.Engine.html)`


``


`

|---|---|------------------------------------------------------------|
| [java.lang.Object](http://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [android.service.wallpaper.WallpaperService.Engine](http://developer.android.com/reference/android/service/wallpaper/WallpaperService.Engine.html) ||
|   | ↳ | android.support.wearable.watchface.WatchFaceService.Engine |

|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known direct subclasses [CanvasWatchFaceService.Engine](https://developer.android.com/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html),[Gles2WatchFaceService.Engine](https://developer.android.com/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html) |------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------| | [CanvasWatchFaceService.Engine](https://developer.android.com/reference/android/support/wearable/watchface/CanvasWatchFaceService.Engine.html) | *This class is deprecated. Use[Watch Face Format](https://developer.android.com/training/wearables/wff)APIs instead.* | | [Gles2WatchFaceService.Engine](https://developer.android.com/reference/android/support/wearable/watchface/Gles2WatchFaceService.Engine.html)   | *This class is deprecated. Use[Watch Face Format](https://developer.android.com/training/wearables/wff)APIs instead.* | |

<br />

*** ** * ** ***

<br />

**This class is deprecated.**   
Use[Watch Face Format](https://developer.android.com/training/wearables/wff)APIs instead.

The actual implementation of a watch face. You must implement[WatchFaceService.onCreateEngine()](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#onCreateEngine())to return your concrete Engine implementation.

## Summary

|                                                        ### Public constructors                                                        ||
|------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Engine](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#Engine())`() ` |

|                                                                                                                                                                                                                                                                     ### Public methods                                                                                                                                                                                                                                                                     ||
|------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` final int`                                                                       | ` `[getInterruptionFilter](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getInterruptionFilter())`() ` Returns interruption filter selected by the user.                                                                                                                                                                                                                                                     |
| ` final int`                                                                       | ` `[getNotificationCount](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getNotificationCount())`() ` Returns the total number of notification cards in the stream.                                                                                                                                                                                                                                           |
| ` final `[Rect](http://developer.android.com/reference/android/graphics/Rect.html) | ` `[getPeekCardPosition](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getPeekCardPosition())`() ` *This method is deprecated. Wear 2.0 doesn't have peeking cards*                                                                                                                                                                                                                                          |
| ` final int`                                                                       | ` `[getUnreadCount](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#getUnreadCount())`() ` Returns the number of unread notification cards in the stream.                                                                                                                                                                                                                                                      |
| ` final boolean`                                                                   | ` `[isInAmbientMode](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#isInAmbientMode())`() ` Returns whether the watch face is in ambient mode.                                                                                                                                                                                                                                                                |
| ` void`                                                                            | ` `[onAmbientModeChanged](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onAmbientModeChanged(boolean))`(boolean inAmbientMode) ` Called when the device enters or exits ambient mode.                                                                                                                                                                                                                        |
| ` `[Bundle](http://developer.android.com/reference/android/os/Bundle.html)         | ` `[onCommand](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onCommand(java.lang.String,%20int,%20int,%20int,%20android.os.Bundle,%20boolean))`(`[String](http://developer.android.com/reference/java/lang/String.html)` action, int x, int y, int z, `[Bundle](http://developer.android.com/reference/android/os/Bundle.html)` extras, boolean resultRequested) `                                           |
| ` void`                                                                            | ` `[onComplicationDataUpdate](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onComplicationDataUpdate(int,%20android.support.wearable.complications.ComplicationData))`(int watchFaceComplicationId, `[ComplicationData](https://developer.android.com/reference/android/support/wearable/complications/ComplicationData.html)` data) ` Called when new complication data is received.                        |
| ` void`                                                                            | ` `[onCreate](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onCreate(android.view.SurfaceHolder))`(`[SurfaceHolder](http://developer.android.com/reference/android/view/SurfaceHolder.html)` holder) `                                                                                                                                                                                                       |
| ` void`                                                                            | ` `[onDestroy](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onDestroy())`() `                                                                                                                                                                                                                                                                                                                               |
| ` void`                                                                            | ` `[onInterruptionFilterChanged](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onInterruptionFilterChanged(int))`(int interruptionFilter) ` Called when the user changes interruption filter.                                                                                                                                                                                                                |
| ` void`                                                                            | ` `[onNotificationCountChanged](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onNotificationCountChanged(int))`(int count) ` Called when the total number of notification cards in the stream has changed.                                                                                                                                                                                                   |
| ` void`                                                                            | ` `[onPeekCardPositionUpdate](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onPeekCardPositionUpdate(android.graphics.Rect))`(`[Rect](http://developer.android.com/reference/android/graphics/Rect.html)` rect) ` *This method is deprecated. Wear 2.0 doesn't have peeking cards*                                                                                                                           |
| ` void`                                                                            | ` `[onPropertiesChanged](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onPropertiesChanged(android.os.Bundle))`(`[Bundle](http://developer.android.com/reference/android/os/Bundle.html)` properties) ` Called when the properties of the device are determined.                                                                                                                                             |
| ` void`                                                                            | ` `[onTapCommand](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onTapCommand(int,%20int,%20int,%20long))`(int tapType, int x, int y, long eventTime) ` Called when a tap or touch related event occurs.                                                                                                                                                                                                      |
| ` void`                                                                            | ` `[onTimeTick](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onTimeTick())`() ` Called periodically to update the time shown by the watch face.                                                                                                                                                                                                                                                             |
| ` void`                                                                            | ` `[onTouchEvent](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onTouchEvent(android.view.MotionEvent))`(`[MotionEvent](http://developer.android.com/reference/android/view/MotionEvent.html)` event) ` *This method is deprecated. Do not use this to receive touch events on a watch face.*                                                                                                                |
| ` void`                                                                            | ` `[onUnreadCountChanged](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onUnreadCountChanged(int))`(int count) ` Called when the number of unread notification cards in the stream has changed.                                                                                                                                                                                                              |
| ` void`                                                                            | ` `[onVisibilityChanged](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onVisibilityChanged(boolean))`(boolean visible) ` Called to inform you of the watch face becoming visible or hidden.                                                                                                                                                                                                                  |
| ` void`                                                                            | ` `[setActiveComplications](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setActiveComplications(int...))`(int... watchFaceComplicationIds) ` Sets the complications which are active in the watchface.                                                                                                                                                                                                      |
| ` void`                                                                            | ` `[setDefaultComplicationProvider](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setDefaultComplicationProvider(int,%20android.content.ComponentName,%20int))`(int watchFaceComplicationId, `[ComponentName](http://developer.android.com/reference/android/content/ComponentName.html)` provider, int type) ` Sets a custom provider as the default provider for the specified watch face complication id. |
| ` void`                                                                            | ` `[setDefaultSystemComplicationProvider](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setDefaultSystemComplicationProvider(int,%20int,%20int))`(int watchFaceComplicationId, int systemProvider, int type) ` Sets a system provider as the default provider for the specified watch face complication id.                                                                                                  |
| ` void`                                                                            | ` `[setTouchEventsEnabled](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setTouchEventsEnabled(boolean))`(boolean enabled) ` *This method is deprecated. Do not use this to receive touch events on a watch face.*                                                                                                                                                                                           |
| ` void`                                                                            | ` `[setWatchFaceStyle](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setWatchFaceStyle(android.support.wearable.watchface.WatchFaceStyle))`(`[WatchFaceStyle](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceStyle.html)` watchFaceStyle) ` Sets the watch face style.                                                                                                  |

| ### Inherited methods |
|-----------------------|---|
| From class` `[android.service.wallpaper.WallpaperService.Engine](http://developer.android.com/reference/android/service/wallpaper/WallpaperService.Engine.html)` ` |--------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` void`                                                                                    | ` dump(`[String](http://developer.android.com/reference/java/lang/String.html)` arg0, `[FileDescriptor](http://developer.android.com/reference/java/io/FileDescriptor.html)` arg1, `[PrintWriter](http://developer.android.com/reference/java/io/PrintWriter.html)` arg2, `[String[]](http://developer.android.com/reference/java/lang/String.html)` arg3) ` | | ` int`                                                                                     | ` getDesiredMinimumHeight() `                                                                                                                                                                                                                                                                                                                                | | ` int`                                                                                     | ` getDesiredMinimumWidth() `                                                                                                                                                                                                                                                                                                                                 | | ` `[Context](http://developer.android.com/reference/android/content/Context.html)          | ` getDisplayContext() `                                                                                                                                                                                                                                                                                                                                      | | ` `[SurfaceHolder](http://developer.android.com/reference/android/view/SurfaceHolder.html) | ` getSurfaceHolder() `                                                                                                                                                                                                                                                                                                                                       | | ` boolean`                                                                                 | ` isPreview() `                                                                                                                                                                                                                                                                                                                                              | | ` boolean`                                                                                 | ` isVisible() `                                                                                                                                                                                                                                                                                                                                              | | ` void`                                                                                    | ` notifyColorsChanged() `                                                                                                                                                                                                                                                                                                                                    | | ` void`                                                                                    | ` onApplyWindowInsets(`[WindowInsets](http://developer.android.com/reference/android/view/WindowInsets.html)` arg0) `                                                                                                                                                                                                                                        | | ` `[Bundle](http://developer.android.com/reference/android/os/Bundle.html)                 | ` onCommand(`[String](http://developer.android.com/reference/java/lang/String.html)` arg0, int arg1, int arg2, int arg3, `[Bundle](http://developer.android.com/reference/android/os/Bundle.html)` arg4, boolean arg5) `                                                                                                                                     | | ` WallpaperColors`                                                                         | ` onComputeColors() `                                                                                                                                                                                                                                                                                                                                        | | ` void`                                                                                    | ` onCreate(`[SurfaceHolder](http://developer.android.com/reference/android/view/SurfaceHolder.html)` arg0) `                                                                                                                                                                                                                                                 | | ` void`                                                                                    | ` onDesiredSizeChanged(int arg0, int arg1) `                                                                                                                                                                                                                                                                                                                 | | ` void`                                                                                    | ` onDestroy() `                                                                                                                                                                                                                                                                                                                                              | | ` void`                                                                                    | ` onOffsetsChanged(float arg0, float arg1, float arg2, float arg3, int arg4, int arg5) `                                                                                                                                                                                                                                                                     | | ` void`                                                                                    | ` onSurfaceChanged(`[SurfaceHolder](http://developer.android.com/reference/android/view/SurfaceHolder.html)` arg0, int arg1, int arg2, int arg3) `                                                                                                                                                                                                           | | ` void`                                                                                    | ` onSurfaceCreated(`[SurfaceHolder](http://developer.android.com/reference/android/view/SurfaceHolder.html)` arg0) `                                                                                                                                                                                                                                         | | ` void`                                                                                    | ` onSurfaceDestroyed(`[SurfaceHolder](http://developer.android.com/reference/android/view/SurfaceHolder.html)` arg0) `                                                                                                                                                                                                                                       | | ` void`                                                                                    | ` onSurfaceRedrawNeeded(`[SurfaceHolder](http://developer.android.com/reference/android/view/SurfaceHolder.html)` arg0) `                                                                                                                                                                                                                                    | | ` void`                                                                                    | ` onTouchEvent(`[MotionEvent](http://developer.android.com/reference/android/view/MotionEvent.html)` arg0) `                                                                                                                                                                                                                                                 | | ` void`                                                                                    | ` onVisibilityChanged(boolean arg0) `                                                                                                                                                                                                                                                                                                                        | | ` void`                                                                                    | ` onZoomChanged(float arg0) `                                                                                                                                                                                                                                                                                                                                | | ` void`                                                                                    | ` setOffsetNotificationsEnabled(boolean arg0) `                                                                                                                                                                                                                                                                                                              | | ` void`                                                                                    | ` setTouchEventsEnabled(boolean arg0) `                                                                                                                                                                                                                                                                                                                      | ||
| From class` `[java.lang.Object](http://developer.android.com/reference/java/lang/Object.html)` ` |------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------| | ` `[Object](http://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                               | | ` boolean`                                                                         | ` equals(`[Object](http://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                            | ` finalize() `                                                                            | | ` final `[Class](http://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                            | | ` int`                                                                             | ` hashCode() `                                                                            | | ` final void`                                                                      | ` notify() `                                                                              | | ` final void`                                                                      | ` notifyAll() `                                                                           | | ` `[String](http://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                            | | ` final void`                                                                      | ` wait(long arg0, int arg1) `                                                             | | ` final void`                                                                      | ` wait(long arg0) `                                                                       | | ` final void`                                                                      | ` wait() `                                                                                | ||

## Public constructors

### Engine

```
public Engine ()
```

<br />

<br />

## Public methods

### getInterruptionFilter

```
public final int getInterruptionFilter ()
```

Returns interruption filter selected by the user.

<br />

|                                                                                                                                                                                                                                                                                                                                                                                                                                               Returns                                                                                                                                                                                                                                                                                                                                                                                                                                                ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [WatchFaceService.INTERRUPTION_FILTER_NONE](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#INTERRUPTION_FILTER_NONE),[WatchFaceService.INTERRUPTION_FILTER_PRIORITY](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#INTERRUPTION_FILTER_PRIORITY),[WatchFaceService.INTERRUPTION_FILTER_ALL](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#INTERRUPTION_FILTER_ALL),[WatchFaceService.INTERRUPTION_FILTER_ALARMS](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#INTERRUPTION_FILTER_ALARMS), or[WatchFaceService.INTERRUPTION_FILTER_UNKNOWN](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#INTERRUPTION_FILTER_UNKNOWN). <br /> |

### getNotificationCount

```
public final int getNotificationCount ()
```

Returns the total number of notification cards in the stream.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getPeekCardPosition

```
public final Rect getPeekCardPosition ()
```

<br />

**This method is deprecated.**   
Wear 2.0 doesn't have peeking cards

Returns the location of the first peeking card. This doesn't provide information about all movements of the card, only about its location when it's peeking at the bottom and allowing the watch face to be exposed.

<br />

|                                      Returns                                      ||
|---------------------------------------------------------------------------|--------|
| [Rect](http://developer.android.com/reference/android/graphics/Rect.html) | <br /> |

### getUnreadCount

```
public final int getUnreadCount ()
```

Returns the number of unread notification cards in the stream.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### isInAmbientMode

```
public final boolean isInAmbientMode ()
```

Returns whether the watch face is in ambient mode. When true, the watch face should display in white on black.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### onAmbientModeChanged

```
public void onAmbientModeChanged (boolean inAmbientMode)
```

Called when the device enters or exits ambient mode. The watch face should switch to a black and white display in ambient mode. If the watch face displays seconds, it should hide them in ambient mode.

<br />

|            Parameters             ||
|-----------------|------------------|
| `inAmbientMode` | `boolean` <br /> |

### onCommand

```
public Bundle onCommand (String action, 
                int x, 
                int y, 
                int z, 
                Bundle extras, 
                boolean resultRequested)
```

<br />

<br />

|             Parameters              ||
|-------------------|------------------|
| `action`          | `String` <br />  |
| `x`               | `int` <br />     |
| `y`               | `int` <br />     |
| `z`               | `int` <br />     |
| `extras`          | `Bundle` <br />  |
| `resultRequested` | `boolean` <br /> |

|                                     Returns                                     ||
|-------------------------------------------------------------------------|--------|
| [Bundle](http://developer.android.com/reference/android/os/Bundle.html) | <br /> |

### onComplicationDataUpdate

```
public void onComplicationDataUpdate (int watchFaceComplicationId, 
                ComplicationData data)
```

Called when new complication data is received.

<br />

|                                                                                                                                                           Parameters                                                                                                                                                            ||
|---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `watchFaceComplicationId` | `int`: The id of the complication that the data relates to. This will be an id that was previously sent in a call to[setActiveComplications(int...)](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setActiveComplications(int...)). <br /> |
| `data`                    | `ComplicationData`: The data that should be displayed in the complication. <br />                                                                                                                                                                                                                    |

### onCreate

```
public void onCreate (SurfaceHolder holder)
```

<br />

<br />

|            Parameters            ||
|----------|------------------------|
| `holder` | `SurfaceHolder` <br /> |

### onDestroy

```
public void onDestroy ()
```

<br />

<br />

### onInterruptionFilterChanged

```
public void onInterruptionFilterChanged (int interruptionFilter)
```

Called when the user changes interruption filter. The watch face should adjust the amount of information it displays. For example, if it displays the number of pending emails, it should hide it if interruptionFilter is equal to[WatchFaceService.INTERRUPTION_FILTER_NONE](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#INTERRUPTION_FILTER_NONE).`interruptionFilter`can be[WatchFaceService.INTERRUPTION_FILTER_NONE](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#INTERRUPTION_FILTER_NONE),[WatchFaceService.INTERRUPTION_FILTER_PRIORITY](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#INTERRUPTION_FILTER_PRIORITY),[WatchFaceService.INTERRUPTION_FILTER_ALL](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#INTERRUPTION_FILTER_ALL),[WatchFaceService.INTERRUPTION_FILTER_ALARMS](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#INTERRUPTION_FILTER_ALARMS), or[WatchFaceService.INTERRUPTION_FILTER_UNKNOWN](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#INTERRUPTION_FILTER_UNKNOWN).

<br />

|             Parameters             ||
|----------------------|--------------|
| `interruptionFilter` | `int` <br /> |

### onNotificationCountChanged

```
public void onNotificationCountChanged (int count)
```

Called when the total number of notification cards in the stream has changed.

<br />

|                                 Parameters                                  ||
|---------|--------------------------------------------------------------------|
| `count` | `int`: total number of the notification cards in the stream <br /> |

### onPeekCardPositionUpdate

```
public void onPeekCardPositionUpdate (Rect rect)
```

<br />

**This method is deprecated.**   
Wear 2.0 doesn't have peeking cards

Called when the first, peeking card positions itself on the screen. This is where the watch face can change its appearance depending on where the card is on the screen. This doesn't provide information about all movements of the card, only about its location when it's peeking at the bottom and allowing the watch face to be exposed.

<br />

|      Parameters       ||
|--------|---------------|
| `rect` | `Rect` <br /> |

### onPropertiesChanged

```
public void onPropertiesChanged (Bundle properties)
```

Called when the properties of the device are determined. These include[WatchFaceService.PROPERTY_BURN_IN_PROTECTION](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#PROPERTY_BURN_IN_PROTECTION)and[WatchFaceService.PROPERTY_LOW_BIT_AMBIENT](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.html#PROPERTY_LOW_BIT_AMBIENT).

<br />

|                                 Parameters                                 ||
|--------------|--------------------------------------------------------------|
| `properties` | `Bundle`: a bundle containing the hardware properties <br /> |

### onTapCommand

```
public void onTapCommand (int tapType, 
                int x, 
                int y, 
                long eventTime)
```

Called when a tap or touch related event occurs.

<br />

|                                                                                      Parameters                                                                                       ||
|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `tapType`   | `int`: Value representing the event sent to the wallpaper. <br />                                                                                                        |
| `x`         | `int`: X coordinate of the event. <br />                                                                                                                                 |
| `y`         | `int`: Y coordinate of the event. <br />                                                                                                                                 |
| `eventTime` | `long`: The time the tap occurred, in the[SystemClock.uptimeMillis()](http://developer.android.com/reference/android/os/SystemClock.html#uptimeMillis())time base <br /> |

### onTimeTick

```
public void onTimeTick ()
```

Called periodically to update the time shown by the watch face. This method is called:

- at least once per minute in both ambient and interactive modes
- when date or time has changed
- when timezone has changed

<br />

<br />

### onTouchEvent

```
public void onTouchEvent (MotionEvent event)
```

<br />

**This method is deprecated.**   
Do not use this to receive touch events on a watch face.

<br />

<br />

|          Parameters           ||
|---------|----------------------|
| `event` | `MotionEvent` <br /> |

### onUnreadCountChanged

```
public void onUnreadCountChanged (int count)
```

Called when the number of unread notification cards in the stream has changed.

<br />

|                                                  Parameters                                                  ||
|---------|-----------------------------------------------------------------------------------------------------|
| `count` | `int`: number of the notification cards in the stream that haven't yet been seen by the user <br /> |

### onVisibilityChanged

```
public void onVisibilityChanged (boolean visible)
```

Called to inform you of the watch face becoming visible or hidden. If you decide to override this method, you*must* call`super.onVisibilityChanged(visible)`as the first statement in your override.

<br />

|         Parameters          ||
|-----------|------------------|
| `visible` | `boolean` <br /> |

### setActiveComplications

```
public void setActiveComplications (int... watchFaceComplicationIds)
```

Sets the complications which are active in the watchface. Complication data will be received for these ids.

Any ids not in the provided`ids`will be considered inactive.

If providers and complication data types have been configured, the data received will match the type chosen by the user. If no provider has been configured, data of type[ComplicationData.TYPE_NOT_CONFIGURED](https://developer.android.com/reference/android/support/wearable/complications/ComplicationData.html#TYPE_NOT_CONFIGURED)will be received.

Ids here are chosen by the watch face to represent each complication and can be any integer.

<br />

|                Parameters                ||
|----------------------------|--------------|
| `watchFaceComplicationIds` | `int` <br /> |

### setDefaultComplicationProvider

```
public void setDefaultComplicationProvider (int watchFaceComplicationId, 
                ComponentName provider, 
                int type)
```

Sets a custom provider as the default provider for the specified watch face complication id. This may be used to set a non-system provider as a default, if the component name of the provider is known. To set a system provider as a default, use[setDefaultSystemComplicationProvider(int, int, int)](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setDefaultSystemComplicationProvider(int,%20int,%20int))instead.

This will do nothing if the provider is not installed, or if the specified type is not supported by the provider, or if the user has already selected a provider for the complication.

Note that if the watch face has not yet been granted the RECEIVE_COMPLICATION_DATA permission, it will not be able to receive data from the provider unless the provider is from the same app package as the watch face, or the provider lists the watch face as a safe watch face. For system providers that may be used before your watch face has the permission, use[setDefaultSystemComplicationProvider(int, int, int)](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setDefaultSystemComplicationProvider(int,%20int,%20int))with a safe provider instead.

A provider not satisfying the above conditions may still be set as a default using this method, but the watch face will receive dummy data of type[ComplicationData.TYPE_NO_PERMISSION](https://developer.android.com/reference/android/support/wearable/complications/ComplicationData.html#TYPE_NO_PERMISSION)until the permission has been granted.

To set an 'empty' default, this method may be used with`provider`equal to null, and`type`equal to[TYPE_EMPTY](https://developer.android.com/reference/android/support/wearable/complications/ComplicationData.html#TYPE_EMPTY). It is not required to do this for all complications - any complications with no default set and no user-selected provider will receive data of[TYPE_NOT_CONFIGURED](https://developer.android.com/reference/android/support/wearable/complications/ComplicationData.html#TYPE_NOT_CONFIGURED).

<br />

|                    Parameters                     ||
|---------------------------|------------------------|
| `watchFaceComplicationId` | `int` <br />           |
| `provider`                | `ComponentName` <br /> |
| `type`                    | `int` <br />           |

### setDefaultSystemComplicationProvider

```
public void setDefaultSystemComplicationProvider (int watchFaceComplicationId, 
                int systemProvider, 
                int type)
```

Sets a system provider as the default provider for the specified watch face complication id.

The chosen provider must be one listed in the[SystemProviders](https://developer.android.com/reference/android/support/wearable/complications/SystemProviders.html)class.

This will do nothing if the provider is not installed, or if the specified type is not supported by the provider, or if the user has already selected a provider for the complication.

Note that if the watch face has not yet been granted the RECEIVE_COMPLICATION_DATA permission, it will not be able to receive data from the provider unless it is a safe provider (see the provider descriptions in the[SystemProviders](https://developer.android.com/reference/android/support/wearable/complications/SystemProviders.html)class).

A non-safe provider may still be set as a default using this method, but the watch face will receive dummy data of type[ComplicationData.TYPE_NO_PERMISSION](https://developer.android.com/reference/android/support/wearable/complications/ComplicationData.html#TYPE_NO_PERMISSION)until the permission has been granted.

It is not required to do this for all complications - any complications with no default set and no user-selected provider will receive data of[TYPE_NOT_CONFIGURED](https://developer.android.com/reference/android/support/wearable/complications/ComplicationData.html#TYPE_NOT_CONFIGURED).

To set a non-system provider as a default, or to clear a default, use[setDefaultComplicationProvider(int, ComponentName, int)](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#setDefaultComplicationProvider(int,%20android.content.ComponentName,%20int)).

<br />

|               Parameters                ||
|---------------------------|--------------|
| `watchFaceComplicationId` | `int` <br /> |
| `systemProvider`          | `int` <br /> |
| `type`                    | `int` <br /> |

### setTouchEventsEnabled

```
public void setTouchEventsEnabled (boolean enabled)
```

<br />

**This method is deprecated.**   
Do not use this to receive touch events on a watch face.

<br />

<br />

|         Parameters          ||
|-----------|------------------|
| `enabled` | `boolean` <br /> |

### setWatchFaceStyle

```
public void setWatchFaceStyle (WatchFaceStyle watchFaceStyle)
```

Sets the watch face style. This affects how UI elements such as the battery indicator are drawn on top of the watch face. Typically called in[onCreate(SurfaceHolder)](https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine.html#onCreate(android.view.SurfaceHolder))but may be called at any time, e.g. in response to the user changing the watch face configuration. Must be called from the wallpaper thread.

<br />

|                Parameters                 ||
|------------------|-------------------------|
| `watchFaceStyle` | `WatchFaceStyle` <br /> |