Android APIs
public abstract class

CameraPrewarmService

extends Service
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.app.Service
         ↳ android.service.media.CameraPrewarmService

Class Overview

Extend this class to implement a camera prewarm service. See META_DATA_STILL_IMAGE_CAMERA_PREWARM_SERVICE.

Summary

[Expand]
Inherited Constants
From class android.app.Service
From class android.content.Context
From interface android.content.ComponentCallbacks2
Public Constructors
CameraPrewarmService()
Public Methods
IBinder onBind(Intent intent)
Return the communication channel to the service.
abstract void onCooldown(boolean cameraIntentFired)
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 void onPrewarm()
Called when the camera should be prewarmed.
boolean onUnbind(Intent intent)
Called when all clients have disconnected from a particular interface published by the service.
[Expand]
Inherited Methods
From class android.app.Service
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks2
From interface android.content.ComponentCallbacks

Public Constructors

public CameraPrewarmService ()

Added in API level 23

Public Methods

public IBinder onBind (Intent intent)

Added in API level 23

Return the communication channel to the service. May return null if clients can not bind to the service. The returned IBinder is usually for a complex interface that has been described using aidl.

Note that unlike other application components, calls on to the IBinder interface returned here may not happen on the main thread of the process. More information about the main thread can be found in Processes and Threads.

Parameters
intent The Intent that was used to bind to this service, as given to Context.bindService. Note that any extras that were included with the Intent at that point will not be seen here.
Returns
  • Return an IBinder through which clients can call on to the service.

public abstract void onCooldown (boolean cameraIntentFired)

Added in API level 23

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 Indicates whether the intent to launch the camera has been fired.

public abstract void onPrewarm ()

Added in API level 23

Called when the camera should be prewarmed.

public boolean onUnbind (Intent intent)

Added in API level 23

Called when all clients have disconnected from a particular interface published by the service. The default implementation does nothing and returns false.

Parameters
intent The Intent that was used to bind to this service, as given to Context.bindService. Note that any extras that were included with the Intent at that point will not be seen here.
Returns
  • Return true if you would like to have the service's onRebind(Intent) method later called when new clients bind to it.