目录

安全显示

Overview

安全显示包括TEE中可信图形界面的显示及相关输入事件的处理。TUI(Trusted User Interface)使用过程中可以确保由TEE控制屏幕,并与REE和其它TA隔离。

Method Summary

Qualifier and Type

Method Name and Description

TEE_Result

TEE_TUICheckTextFormat(char* text, uint32_t* width, uint32_t* height, uint32_t* lastIndex)

检测字符串是否支持。

TEE_Result

TEE_TUIGetScreenInfo(TEE_TUIScreenOrientation screenOrientation, uint32_t nbEntryFields, EE_TUIScreenInfo* screenInfo)

输入屏幕方向,获取对应TUI信息。

TEE_Result

TEE_TUIInitSession(void)

初始化TUI资源。

TEE_Result

TEE_TUICloseSession(void)

释放TUI资源。

TEE_Result

TEE_TUIDisplayScreen(TEE_TUIScreenConfiguration* screenConfiguration, bool closeTUISession, TEE_TUIEntryField* entryFields, uint32_t entryFieldCount, TEE_TUIButtonType* selectedButton)

根据输入的label、button、entryfield绘制TUI,并返回用户输入和选中的button。

TEE_Result

TEE_TUISetInfo(int type)

该函数用于设置汉字编码,系统默认支持UTF-8,如果是UTF-8编码则无需调用此函数,系统默认支持;如果是GBK编码则需要调用该函数,参数传1。每个TUI界面仅支持一种编码。使用该接口需要与华为确认编码是否支持。

Methods

[h2]TEE_TUICheckTextFormat

Method

TEE_Result TEE_TUICheckTextFormat (char* text, uint32_t* width, uint32_t* height, uint32_t* lastIndex)

检测是否支持指定字符串内容。

Parameters

Name

Description

text

需要被检查的字符串。

width

text的像素宽度。

height

text的像素高度。

lastIndex

指向字符串中最后一个被检查的字符。如果成功的话,返回字符串中最后一个字符;失败的话,返回导致失败的字符;index从0开始计数。

Return

Type

Description

TEE_Result

参见错误码定义。

[h2]TEE_TUIGetScreenInfo

Method

TEE_Result TEE_TUIGetScreenInfo(TEE_TUIScreenOrientation screenOrientation, uint32_t nbEntryFields, EE_TUIScreenInfo* screenInfo)

输入屏幕方向,获取对应TUI信息。

Parameters

Name

Description

screenOrientation

定义输入的显示方向。

nbEntryFields

定义输入区域的数量。

screenInfo

返回显示方向的界面信息。

Return

Type

Description

TEE_Result

参见错误码定义

[h2]TEE_TUIInitSession

Method

TEE_Result TEE_TUIInitSession(void)

初始化TUI资源。

Return

Type

Description

TEE_Result

参见错误码定义。

[h2]TEE_TUICloseSession

Method

TEE_Result TEE_TUICloseSession(void)

释放TUI资源。

Return

Type

Description

TEE_Result

参见错误码定义。

[h2]TEE_TUIDisplayScreen

Method

TEE_Result TEE_TUIDisplayScreen(TEE_TUIScreenConfiguration* screenConfiguration, bool closeTUISession, TEE_TUIEntryField* entryFields, uint32_t entryFieldCount, TEE_TUIButtonType* selectedButton)

根据输入的label、button、entryfield绘制TUI,并返回用户输入和选中的buttons。

Parameters

Name

Description

screenConfiguration

配置显示界面的label和可选的buttons。

closeTUISession

如果为true,则TUI session会在退出此函数后自动关闭。

entryFields

指向一系列输入区域。包含了显示界面上的输入区域,并使用用户的输入填充TEE_TUIEntryField中的buffer。 如果entryFieldCount为0,entryFields会被忽略。

entryFieldCount

输入区域个数。

selectedButton

当函数成功执行时,用户在退出显示界面时点击的按钮。

Return

Type

Description

TEE_Result

参见错误码定义。

[h2]TEE_TUISetInfo

Method

TEE_Result TEE_TUISetInfo(int type)

该函数用于设置汉字编码,系统默认支持UTF-8,如果是UTF-8编码则无需调用此函数,系统默认支持;如果是GBK编码则需要调用该函数,参数传1。每个TUI界面仅支持一种编码。使用该接口需要与业务接口人确认。

Parameters

Name

Description

type

编码类型,1为GBK,暂不支持其它。

Return

Type

Description

TEE_Result

参见错误码定义。