Added in API level 23

CameraPrewarmService

abstract class CameraPrewarmService : Service
kotlin.Any
   ↳ android.content.Context
   ↳ android.content.ContextWrapper
   ↳ android.app.Service
   ↳ android.service.media.CameraPrewarmService

Extend this class to implement a camera prewarm service. See android.provider.MediaStore#META_DATA_STILL_IMAGE_CAMERA_PREWARM_SERVICE.

Summary

Inherited constants
Public constructors

Public methods
open IBinder?
onBind(intent: Intent!)

abstract Unit
onCooldown(cameraIntentFired: Boolean)

Called when prewarm phase is done, either because the camera launch intent has been fired at this point or prewarm is no longer needed.

abstract Unit

Called when the camera should be prewarmed.

open Boolean
onUnbind(intent: Intent!)

Inherited functions

Public constructors

CameraPrewarmService

CameraPrewarmService()

Public methods

onBind

Added in API level 23
open fun onBind(intent: Intent!): IBinder?
Parameters
intent Intent!: The Intent that was used to bind to this service, as given to android.content.Context#bindService. Note that any extras that were included with the Intent at that point will not be seen here.
Return
IBinder? Return an IBinder through which clients can call on to the service.

onCooldown

Added in API level 23
abstract fun onCooldown(cameraIntentFired: Boolean): Unit

Called when prewarm phase is done, either because the camera launch intent has been fired at this point or prewarm is no longer needed. A client should close the camera immediately in the latter case.

In case the camera launch intent has been fired, there is no guarantee about the ordering of these two events. Cooldown might happen either before or after the activity has been created that handles the camera intent.

Parameters
cameraIntentFired Boolean: Indicates whether the intent to launch the camera has been fired.

onPrewarm

Added in API level 23
abstract fun onPrewarm(): Unit

Called when the camera should be prewarmed.

onUnbind

Added in API level 23
open fun onUnbind(intent: Intent!): Boolean
Parameters
intent Intent!: The Intent that was used to bind to this service, as given to android.content.Context#bindService. Note that any extras that were included with the Intent at that point will not be seen here.
Return
Boolean Return true if you would like to have the service's onRebind method later called when new clients bind to it.