目录

ScreenBarrier

Class Info

public final class ScreenBarrier extends Object

屏幕围栏,包括状态驻留、亮屏,灭屏和解锁的围栏。

开发者应当提醒用户手机屏幕状态可能被App监控。

Public Method Summary

Qualifier and Type

Method Name

AwarenessBarrier

public static AwarenessBarrier keeping(int screenStatus)

AwarenessBarrier

public static AwarenessBarrier screenOn()

AwarenessBarrier

public static AwarenessBarrier screenOff()

AwarenessBarrier

public static AwarenessBarrier screenUnlock()

Public Methods

[h2]keeping

Method

public static AwarenessBarrier keeping(int screenStatus)

状态驻留围栏,开发者添加亮屏、灭屏、解锁三种屏幕状态驻留围栏后,当屏幕状态保持为指定状态时,此围栏状态为TRUE并触发围栏事件上报。

Parameters

Name

Description

screenStatus

屏幕状态。
Returns

Type

Description

AwarenessBarrier

情景感知围栏。

Throws

Name

Description

IllegalArgumentException

参数不合法(screenStatus不为SCREEN_ON,SCREEN_OFF、UNLOCKED时)异常。

[h2]screenOn

Method

public static AwarenessBarrier screenOn()

亮屏围栏,添加此围栏后,当手机亮屏且未解锁时,此围栏状态为TRUE并触发围栏事件上报,5s后状态切换为FALSE。

Returns

Type

Description

AwarenessBarrier

情景感知围栏。

[h2]screenOff

Method

public static AwarenessBarrier screenOff()

灭屏围栏,添加此围栏后,当手机灭屏时,此围栏状态为TRUE并触发围栏事件上报,5s后状态切换为FALSE。

Returns

Type

Description

AwarenessBarrier

情景感知围栏。

[h2]screenUnlock

Method

public static AwarenessBarrier screenUnlock()

解锁围栏,添加此围栏后,当解锁时,此围栏状态为TRUE并触发围栏事件上报,5s后状态切换为FALSE。

Returns

Type

Description

AwarenessBarrier

情景感知围栏。