前段时间一直在忙高通项目的需求,同事转给我一个证书安装的bug给我,一直没时间解,给Marvell提case,个把月了还不给回复,囧!求人不如求己正好最近需求做完了,索性就自己跟下代码。
证书安装入口在设置-->安全里,相应代码如下:
android:title="@string/credentials_install"
android:summary="@string/credentials_install_summary"
android:persistent="false">
android:targetPackage="com.android.certinstaller"
android:targetClass="com.android.certinstaller.CertInstallerMain"/>
当我们点击“从存储设备安装证书”时,就会通过intent进入CertInstallerMain。在onCreate里对相应action做处理
if (Credentials.INSTALL_ACTION.equals(action)
|| Credentials.INSTALL_AS_USER_ACTION.equals(action)) {
Bundle bundle = intent.getExtras();//这里获取的bundle为空。
由于bundle未空会执行如下代码:
if (bundle == null
|| bundle.isEmpty()