WatchFaceRuntimeService


abstract class WatchFaceRuntimeService : WatchFaceService

Known direct subclasses
ListenableWatchFaceRuntimeService

This class is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.


WatchFaceRuntimeService is a special kind of WatchFaceService, which loads the watch face definition from another resource only watch face package (see the resourceOnlyWatchFacePackageName parameter passed to createUserStyleSchema, createComplicationSlotsManager, createUserStyleFlavors and createWatchFace).

WatchFaceRuntimeServices are required to be stateless as multiple can be created in parallel. If per instance state is required please use StatefulWatchFaceRuntimeService.

Note because a WatchFaceRuntimeService loads it's resources from another package, it will need the following permission:

    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />

Currently Wear OS only supports the runtime for the Android Watch Face Format (see https://developer.android.com/training/wearables/wff for more details).

Note only one watch face definition per resource only watch face package is supported.

use Watch Face Format instead

Summary

Public constructors

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Protected functions

final ComplicationSlotsManager
createComplicationSlotsManager(
    currentUserStyleRepository: CurrentUserStyleRepository
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

abstract ComplicationSlotsManager
@WorkerThread
createComplicationSlotsManager(
    currentUserStyleRepository: CurrentUserStyleRepository,
    resourceOnlyWatchFacePackageName: String
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

final UserStyleFlavors
createUserStyleFlavors(
    currentUserStyleRepository: CurrentUserStyleRepository,
    complicationSlotsManager: ComplicationSlotsManager
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

abstract UserStyleFlavors
@WorkerThread
createUserStyleFlavors(
    currentUserStyleRepository: CurrentUserStyleRepository,
    complicationSlotsManager: ComplicationSlotsManager,
    resourceOnlyWatchFacePackageName: String
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

final UserStyleSchema

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

abstract UserStyleSchema
@WorkerThread
createUserStyleSchema(resourceOnlyWatchFacePackageName: String)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

final suspend WatchFace
createWatchFace(
    surfaceHolder: SurfaceHolder,
    watchState: WatchState,
    complicationSlotsManager: ComplicationSlotsManager,
    currentUserStyleRepository: CurrentUserStyleRepository
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

abstract suspend WatchFace
@WorkerThread
createWatchFace(
    surfaceHolder: SurfaceHolder,
    watchState: WatchState,
    complicationSlotsManager: ComplicationSlotsManager,
    currentUserStyleRepository: CurrentUserStyleRepository,
    resourceOnlyWatchFacePackageName: String
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Inherited functions

From android.content.ComponentCallbacks
open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

From android.content.ComponentCallbacks2
open Unit
onTrimMemory(level: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

From android.content.Context
open Boolean
bindIsolatedService(
    service: Intent,
    flags: Context.BindServiceFlags,
    instanceName: String,
    executor: Executor,
    conn: ServiceConnection
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean
bindIsolatedService(
    service: Intent,
    flags: Int,
    instanceName: String,
    executor: Executor,
    conn: ServiceConnection
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean
bindService(
    service: Intent,
    conn: ServiceConnection,
    flags: Context.BindServiceFlags
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean
bindService(service: Intent, conn: ServiceConnection, flags: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean
bindService(
    service: Intent,
    flags: Context.BindServiceFlags,
    executor: Executor,
    conn: ServiceConnection
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean
bindService(
    service: Intent,
    flags: Int,
    executor: Executor,
    conn: ServiceConnection
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean
bindServiceAsUser(
    service: Intent,
    conn: ServiceConnection,
    flags: Context.BindServiceFlags,
    user: UserHandle
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean
bindServiceAsUser(
    service: Intent,
    conn: ServiceConnection,
    flags: Int,
    user: UserHandle
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open IntArray

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int
checkCallingUriPermission(uri: Uri, modeFlags: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open IntArray

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int
checkContentUriPermissionFull(uri: Uri, pid: Int, uid: Int, modeFlags: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int
checkPermission(permission: String, pid: Int, uid: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int
checkUriPermission(uri: Uri, pid: Int, uid: Int, modeFlags: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int
checkUriPermission(
    uri: Uri?,
    readPermission: String?,
    writePermission: String?,
    pid: Int,
    uid: Int,
    modeFlags: Int
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open IntArray
checkUriPermissions(
    uris: MutableList<Uri>,
    pid: Int,
    uid: Int,
    modeFlags: Int
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. Deprecated in Java

open Context
createAttributionContext(attributionTag: String?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Context
createConfigurationContext(overrideConfiguration: Configuration)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Context
createContext(contextParams: ContextParams)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Context

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Context

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Context

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Context

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Context
createPackageContext(packageName: String, flags: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Context
createWindowContext(type: Int, options: Bundle?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Context
createWindowContext(display: Display, type: Int, options: Bundle?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Array<String>

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
enforceCallingOrSelfPermission(permission: String, message: String?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
enforceCallingOrSelfUriPermission(
    uri: Uri,
    modeFlags: Int,
    message: String
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
enforceCallingPermission(permission: String, message: String?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
enforceCallingUriPermission(uri: Uri, modeFlags: Int, message: String)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
enforcePermission(permission: String, pid: Int, uid: Int, message: String?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
enforceUriPermission(
    uri: Uri,
    pid: Int,
    uid: Int,
    modeFlags: Int,
    message: String
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
enforceUriPermission(
    uri: Uri?,
    readPermission: String?,
    writePermission: String?,
    pid: Int,
    uid: Int,
    modeFlags: Int,
    message: String?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Array<String>

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Int

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

ColorStateList

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open File

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open File
getDir(name: String, mode: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Drawable?

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open File?

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Array<File>

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open File

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open SharedPreferences

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

String
getString(resId: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

String
getString(resId: Int, vararg formatArgs: Any)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Any

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

T
<T : Any> getSystemService(serviceClass: Class<T>)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open String?
getSystemServiceName(serviceClass: Class<*>)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

CharSequence
getText(resId: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
grantUriPermission(toPackage: String, uri: Uri, modeFlags: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean
moveDatabaseFrom(sourceContext: Context, name: String)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean
moveSharedPreferencesFrom(sourceContext: Context, name: String)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

TypedArray

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

TypedArray

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

TypedArray

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

TypedArray
obtainStyledAttributes(
    set: AttributeSet?,
    attrs: IntArray,
    defStyleAttr: Int,
    defStyleRes: Int
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open FileInputStream

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open FileOutputStream
openFileOutput(name: String, mode: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open SQLiteDatabase
openOrCreateDatabase(
    name: String,
    mode: Int,
    factory: SQLiteDatabase.CursorFactory
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open SQLiteDatabase
openOrCreateDatabase(
    name: String,
    mode: Int,
    factory: SQLiteDatabase.CursorFactory,
    errorHandler: DatabaseErrorHandler?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Drawable

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Intent?

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Intent?
registerReceiver(
    receiver: BroadcastReceiver?,
    filter: IntentFilter,
    flags: Int
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Intent?
registerReceiver(
    receiver: BroadcastReceiver?,
    filter: IntentFilter,
    broadcastPermission: String?,
    scheduler: Handler?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Intent?
registerReceiver(
    receiver: BroadcastReceiver?,
    filter: IntentFilter,
    broadcastPermission: String?,
    scheduler: Handler?,
    flags: Int
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
revokeUriPermission(uri: Uri, modeFlags: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
revokeUriPermission(targetPackage: String, uri: Uri, modeFlags: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
sendBroadcast(intent: Intent, receiverPermission: String?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
sendBroadcast(intent: Intent, receiverPermission: String?, options: Bundle?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
sendBroadcastAsUser(
    intent: Intent,
    user: UserHandle,
    receiverPermission: String?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
sendBroadcastWithMultiplePermissions(
    intent: Intent,
    receiverPermissions: Array<String>
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
sendOrderedBroadcast(intent: Intent, receiverPermission: String?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
sendOrderedBroadcast(
    intent: Intent,
    receiverPermission: String?,
    options: Bundle?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
sendOrderedBroadcast(
    intent: Intent,
    receiverPermission: String?,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
sendOrderedBroadcast(
    intent: Intent,
    receiverPermission: String?,
    options: Bundle?,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
sendOrderedBroadcast(
    intent: Intent,
    receiverPermission: String?,
    receiverAppOp: String?,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
sendOrderedBroadcastAsUser(
    intent: Intent,
    user: UserHandle,
    receiverPermission: String?,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. Deprecated in Java

open Unit
sendStickyBroadcast(intent: Intent, options: Bundle?)

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit
sendStickyOrderedBroadcast(
    intent: Intent,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)

This function is deprecated. Deprecated in Java

open Unit
sendStickyOrderedBroadcastAsUser(
    intent: Intent,
    user: UserHandle,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialCode: Int,
    initialData: String?,
    initialExtras: Bundle?
)

This function is deprecated. Deprecated in Java

open Unit
setTheme(resid: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. Deprecated in Java

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
startActivities(intents: Array<Intent>, options: Bundle?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
startActivity(intent: Intent, options: Bundle?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open ComponentName?

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean
startInstrumentation(
    className: ComponentName,
    profileFile: String?,
    arguments: Bundle?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
startIntentSender(
    intent: IntentSender,
    fillInIntent: Intent?,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
startIntentSender(
    intent: IntentSender,
    fillInIntent: Intent?,
    flagsMask: Int,
    flagsValues: Int,
    extraFlags: Int,
    options: Bundle?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open ComponentName?
startService(service: Intent)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
updateServiceGroup(conn: ServiceConnection, group: Int, importance: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

From android.content.ContextWrapper
open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
sendOrderedBroadcast(
    intent: Intent,
    initialCode: Int,
    receiverPermission: String?,
    receiverAppOp: String?,
    resultReceiver: BroadcastReceiver?,
    scheduler: Handler?,
    initialData: String?,
    initialExtras: Bundle?,
    options: Bundle?
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

From android.app.Service
IBinder?
onBind(intent: Intent)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
onRebind(intent: Intent)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
onStart(intent: Intent, startId: Int)

This function is deprecated. Deprecated in Java

open Int
onStartCommand(intent: Intent, flags: Int, startId: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
onTaskRemoved(rootIntent: Intent)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
onTimeout(startId: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit
onTimeout(startId: Int, fgsType: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean
onUnbind(intent: Intent)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Unit
startForeground(id: Int, notification: Notification)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Unit
startForeground(
    id: Int,
    notification: Notification,
    foregroundServiceType: Int
)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Unit
stopForeground(notificationBehavior: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Unit
stopForeground(removeNotification: Boolean)

This function is deprecated. Deprecated in Java

Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Unit
stopSelf(startId: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Boolean
stopSelfResult(startId: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

From android.service.wallpaper.WallpaperService
open WallpaperService.Engine?

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

From androidx.wear.watchface.WatchFaceService
open Unit
@UiThread
dump(fd: FileDescriptor, writer: PrintWriter, args: Array<String>)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Handler

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open ComplicationSlotInflationFactory?

This function is deprecated. Use the version with currentUserStyleRepository argument instead

open ComplicationSlotInflationFactory

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Handler

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Unit

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

final WallpaperService.Engine

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Inherited properties

From android.content.ContextWrapper
open Context

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open ApplicationInfo

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open AssetManager

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open AttributionSource

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open String?

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Context

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open File

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open ClassLoader

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open File

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open ContentResolver

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open File

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Display

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open File?

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Array<File>

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Array<File>

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open File

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Boolean

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Executor

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Looper

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open File

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open File

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Array<File>

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open String

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open String

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open PackageManager

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open String

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open String

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open ContextParams?

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Resources

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Resources.Theme

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Drawable

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

open Int

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

From android.app.Service
Application

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Int

This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Public constructors

WatchFaceRuntimeService

Added in 1.2.0
Deprecated in 1.3.0-alpha07
WatchFaceRuntimeService()

Protected functions

createComplicationSlotsManager

protected final fun createComplicationSlotsManager(
    currentUserStyleRepository: CurrentUserStyleRepository
): ComplicationSlotsManager

If the WatchFaceService's manifest doesn't define a androidx.wear.watchface.XmlSchemaAndComplicationSlotsDefinition meta data tag then override this factory method to create a non-empty ComplicationSlotsManager. This manager will be passed to createUserStyleFlavors and createWatchFace. This will be called from a background thread but the ComplicationSlotsManager should be accessed exclusively from the UiThread afterwards.

Parameters
currentUserStyleRepository: CurrentUserStyleRepository

The CurrentUserStyleRepository constructed using the UserStyleSchema returned by createUserStyleSchema.

createComplicationSlotsManager

Added in 1.2.0
Deprecated in 1.3.0-alpha07
@WorkerThread
protected abstract fun createComplicationSlotsManager(
    currentUserStyleRepository: CurrentUserStyleRepository,
    resourceOnlyWatchFacePackageName: String
): ComplicationSlotsManager

If the WatchFaceService's manifest doesn't define an androidx.wear.watchface.XmlSchemaAndComplicationSlotsDefinition meta data tag then override this factory method to create a non-empty ComplicationSlotsManager. This manager will be passed to createUserStyleFlavors and createWatchFace. This will be called from a background thread but the ComplicationSlotsManager should be accessed exclusively from the UiThread afterwards.

Parameters
currentUserStyleRepository: CurrentUserStyleRepository

The CurrentUserStyleRepository constructed using the UserStyleSchema returned by createUserStyleSchema.

resourceOnlyWatchFacePackageName: String

The android package from which the watch face definition should be loaded.

createUserStyleFlavors

protected final fun createUserStyleFlavors(
    currentUserStyleRepository: CurrentUserStyleRepository,
    complicationSlotsManager: ComplicationSlotsManager
): UserStyleFlavors

If the WatchFaceService's manifest doesn't define a androidx.wear.watchface.XmlSchemaAndComplicationSlotsDefinition meta data tag then override this factory method to create non-empty UserStyleFlavors. This is called on a background thread. The system reads the flavors once and changes may be ignored until the APK is updated. Metadata tag "androidx.wear.watchface.FLAVORS_SUPPORTED" should be added to let the system know the service supports flavors.

Parameters
currentUserStyleRepository: CurrentUserStyleRepository

The CurrentUserStyleRepository constructed using the UserStyleSchema returned by createUserStyleSchema.

complicationSlotsManager: ComplicationSlotsManager

The ComplicationSlotsManager returned by createComplicationSlotsManager

Returns
UserStyleFlavors

The UserStyleFlavors, which is exposed to the system.

createUserStyleFlavors

Added in 1.2.0
Deprecated in 1.3.0-alpha07
@WorkerThread
protected abstract fun createUserStyleFlavors(
    currentUserStyleRepository: CurrentUserStyleRepository,
    complicationSlotsManager: ComplicationSlotsManager,
    resourceOnlyWatchFacePackageName: String
): UserStyleFlavors

If the WatchFaceService's manifest doesn't define an androidx.wear.watchface.XmlSchemaAndComplicationSlotsDefinition meta data tag then override this factory method to create non-empty UserStyleFlavors. This is called on a background thread. The system reads the flavors once and changes may be ignored until the APK is updated. Metadata tag "androidx.wear.watchface.FLAVORS_SUPPORTED" should be added to let the system know the service supports flavors.

Parameters
currentUserStyleRepository: CurrentUserStyleRepository

The CurrentUserStyleRepository constructed using the UserStyleSchema returned by createUserStyleSchema.

complicationSlotsManager: ComplicationSlotsManager

The ComplicationSlotsManager returned by createComplicationSlotsManager

resourceOnlyWatchFacePackageName: String

The android package from which the watch face definition should be loaded.

Returns
UserStyleFlavors

The UserStyleFlavors, which is exposed to the system.

createUserStyleSchema

protected final fun createUserStyleSchema(): UserStyleSchema

If the WatchFaceService's manifest doesn't define an androidx.wear.watchface.XmlSchemaAndComplicationSlotsDefinition meta data tag then override this factory method to create a non-empty UserStyleSchema. A CurrentUserStyleRepository constructed with this schema will be passed to createComplicationSlotsManager, createUserStyleFlavors and createWatchFace. This is called on a background thread.

createUserStyleSchema

Added in 1.2.0
Deprecated in 1.3.0-alpha07
@WorkerThread
protected abstract fun createUserStyleSchema(resourceOnlyWatchFacePackageName: String): UserStyleSchema

If the WatchFaceService's manifest doesn't define a androidx.wear.watchface.XmlSchemaAndComplicationSlotsDefinition meta data tag then override this factory method to create a non-empty UserStyleSchema. A CurrentUserStyleRepository constructed with this schema will be passed to createComplicationSlotsManager, createUserStyleFlavors and createWatchFace. This is called on a background thread.

Parameters
resourceOnlyWatchFacePackageName: String

The android package from which the watch face definition should be loaded.

createWatchFace

protected final suspend fun createWatchFace(
    surfaceHolder: SurfaceHolder,
    watchState: WatchState,
    complicationSlotsManager: ComplicationSlotsManager,
    currentUserStyleRepository: CurrentUserStyleRepository
): WatchFace

Override this factory method to create your WatchFaceImpl. This method will be called by the library on a background thread, if possible any expensive initialization should be done asynchronously. The WatchFace and its Renderer should be accessed exclusively from the UiThread afterwards. There is a memory barrier between construction and rendering so no special threading primitives are required.

Warning the system will likely time out waiting for watch face initialization if it takes longer than MAX_CREATE_WATCHFACE_TIME_MILLIS milliseconds.

Parameters
surfaceHolder: SurfaceHolder

The SurfaceHolder to pass to the Renderer's constructor.

watchState: WatchState

The WatchState for the watch face.

complicationSlotsManager: ComplicationSlotsManager

The ComplicationSlotsManager returned by createComplicationSlotsManager.

currentUserStyleRepository: CurrentUserStyleRepository

The CurrentUserStyleRepository constructed using the UserStyleSchema returned by createUserStyleSchema.

Returns
WatchFace

A WatchFace whose Renderer uses the provided surfaceHolder.

createWatchFace

@WorkerThread
protected abstract suspend fun createWatchFace(
    surfaceHolder: SurfaceHolder,
    watchState: WatchState,
    complicationSlotsManager: ComplicationSlotsManager,
    currentUserStyleRepository: CurrentUserStyleRepository,
    resourceOnlyWatchFacePackageName: String
): WatchFace

Override this factory method to create your WatchFaceImpl. This method will be called by the library on a background thread, if possible any expensive initialization should be done asynchronously. The WatchFace and its Renderer should be accessed exclusively from the UiThread afterwards. There is a memory barrier between construction and rendering so no special threading primitives are required.

Warning the system will likely time out waiting for watch face initialization if it takes longer than WatchFaceService.MAX_CREATE_WATCHFACE_TIME_MILLIS milliseconds.

Parameters
surfaceHolder: SurfaceHolder

The SurfaceHolder to pass to the Renderer's constructor.

watchState: WatchState

The WatchState for the watch face.

complicationSlotsManager: ComplicationSlotsManager

The ComplicationSlotsManager returned by createComplicationSlotsManager.

currentUserStyleRepository: CurrentUserStyleRepository

The CurrentUserStyleRepository constructed using the UserStyleSchema returned by createUserStyleSchema.

resourceOnlyWatchFacePackageName: String

The android package from which the watch face definition should be loaded.

Returns
WatchFace

A WatchFace whose Renderer uses the provided surfaceHolder.