Skip to content

Most visited

Recently visited

navigation

CameraPrewarmService

public abstract class CameraPrewarmService
extends Service

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


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

Summary

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.

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

CameraPrewarmService

added in API level 23
CameraPrewarmService ()

Public methods

onBind

added in API level 23
IBinder onBind (Intent intent)

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 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
IBinder Return an IBinder through which clients can call on to the service.

onCooldown

added in API level 23
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. 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
void onPrewarm ()

Called when the camera should be prewarmed.

onUnbind

added in API level 23
boolean onUnbind (Intent intent)

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

Parameters
intent 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
boolean Return true if you would like to have the service's onRebind(Intent) method later called when new clients bind to it.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.