Most visited

Recently visited

Added in API level 23

CameraPrewarmService

public abstract class CameraPrewarmService
extends Service

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


扩展此课程以实现摄像机预热服务。 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)

将通信信道返回给服务。

abstract void onCooldown(boolean cameraIntentFired)

在预热阶段完成时调用,这可能是因为此时摄像机发射意图已被触发,或者不再需要预热。

abstract void onPrewarm()

当相机应预热时调用。

boolean onUnbind(Intent intent)

当所有客户端与服务发布的特定接口断开连接时调用。

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)

将通信信道返回给服务。 如果客户端无法绑定到服务,可能会返回null。 返回IBinder通常是一个复杂的界面已经described using aidl

请注意,与其他应用程序组件不同,此处返回的IBinder接口调用可能不会发生在进程的主线程上 有关主线程的更多信息可以在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)

在预热阶段完成时调用,这可能是因为此时摄像机发射意图已被触发,或者不再需要预热。 在后一种情况下,客户应立即关闭相机。

如果相机发射意图已被解雇,则无法保证这两个事件的顺序。 在创建处理相机意图的活动之前或之后,可能会发生冷却。

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

onPrewarm

Added in API level 23
void onPrewarm ()

当相机应预热时调用。

onUnbind

Added in API level 23
boolean onUnbind (Intent intent)

当所有客户端与服务发布的特定接口断开连接时调用。 默认实现什么也不做,并返回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.

Hooray!