一、需求背景
是否支持用图形显示SPN,根据EF_PNNI和EF_IMG的信息,即从卡读取PNNI和IMG新信息给SystemUI显示
whether support the ability to display an icon/image for the alpha tag, using the EF-PNNI and EF-IMG files from the SIM?
现状:EF_IMG源码有定义和获取的接口,EF_PNNI在文件协议中定义了,但是MD也还没相关的实现
名词说明
名词 | 解释 |
---|---|
EF_IMG | EF-IMG文件包含关于互通移动性组的信息。 它存储与不同网络(如GSM和UMTS)互通相关的数据。 EF-IMG文件包含移动性管理、认证、安全性和其他特定于网络的参数。 |
EF-PNNI | EF ID 6FDF,PLMN Network Name Icon |
名词 | 解释 |
---|---|
SIM | Subscriber Identity Module,用户识别模块卡 |
pSIM | 物理SIM卡,传统插入设备卡槽的物理卡 。 |
eSIM | an Embedded SIM-only,激活后功能等同于pSIM |
uSIM | Universal Subscriber Identity Module?通用 |
EF | Elementary File,SIM卡中的每个EF文件都有一个唯一的标识符(File Identifier),用于标识和访问该文件。EF文件可以被读取、写入和更新,允许SIM卡上的信息进行修改和管理。 EF文件通过特定的命令和协议(如ISO 7816)与SIM卡进行通信和操作。 |
STK | SIM卡应用工具包 |
eri | Enhanced Roaming Indicator? |
二、功能逻辑
需要确认MD C是否支持并提供接口,接着Telephony上层Java读取SIM信息,公开接口给应用程 获取IMG内容,最后Systemui显示。
三、代码实现
1、MD SIM Service(默认支持)
Modem 定义了SIM服务,包含EF_IMG文件定义 (sim_service.h),而且读卡是默认支持的,读卡操作在MD是通用接口。
//device/google/cuttlefish/host/commands/modem_simulator/sim_service.h
/* SimStatus */
SimStatus sim_status_;
/* SimFileSystem */
struct SimFileSystem {
EF_IMG = 0x4F20,
};
2、Framework Telephony
Telephony上层定义 IccConstants.java。
对于AP而言,此信息就是EF文件的ID不同,可以参考其他EF文件读取方式,把PNNI/IMG读取以供应用侧使用。
IccConstants.java 定义EF文件常量
//frameworks/opt/telephony/src/java/com/android/internal/telephony/uicc/IccConstants.java
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.internal.telephony.uicc;
/**
* {@hide}
*/
public interface IccConstants {
// GSM SIM file ids from TS 51.011
static final int EF_IMG = 0x4F20;
// GSM SIM file ids from CPHS (phase 2, version 4.2) CPHS4_2.WW6
static final int EF_CFF_CPHS = 0x6F13;
static final int EF_SPN_CPHS = 0x6F14;
static final int EF_SPN_SHORT_CPHS = 0x6F18;
static final int EF_INFO_CPHS = 0x6F16;
static final int EF_CSP_CPHS = 0x6F15;
}
IconLoader.java 加载EF信息
frameworks/opt/telephony/src/java/com/android/internal/telephony/cat/IconLoader.java
cat(Card Application Toolkit):在Android的Telephony框架中,是一个用于处理SIM卡上的智能卡应用程序的组件。
- 处理消息 EVENT_READ_EF_IMG_RECOED_DONE
- readIconData() :获取图标数据
- loadEFImgTransparent():通过IccFileHandler 获取
package com.android.internal.telephony.cat;
/**
* Class for loading