加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – 三星传递sdk在指纹对话框中更改待机文本

发布时间:2020-12-15 02:16:57 所属栏目:Java 来源:网络整理
导读:我正在使用pass sdk v1.2.1,根据 programming guide,有一种方法可以更改指纹对话框中显示的待机文本.该指南说您必须检查是否启用Spass.DEVICE_FINGERPRINT_AVAILABLE_PASSWORD功能来调用changeStandbyString,如下所示: if(pass.isFeatureEnabled(Spass.DEVI
我正在使用pass sdk v1.2.1,根据 programming guide,有一种方法可以更改指纹对话框中显示的待机文本.该指南说您必须检查是否启用Spass.DEVICE_FINGERPRINT_AVAILABLE_PASSWORD功能来调用changeStandbyString,如下所示:

if(pass.isFeatureEnabled(Spass.DEVICE_FINGERPRINT_AVAILABLE_PASSWORD)) {
    mSpassFingerprint.changeStandbyString("Touch your fingerprint or press the button for launching own menu”);
 }

我尝试在带有Android 6.0和Galaxy S5 Android 5.x.x的Galaxy S5上使用它,我得到了例外

IllegalStateException: setStandbyString is not supported.

看起来有点奇怪的是,如果changeStandbyString中的方法返回true,则调用异常,结果是检查时调用的方法相同

isFeatureEnabled(Spass.DEVICE_FINGERPRINT_AVAILABLE_PASSWORD);

所以看起来有些不对劲,任何想法?

这是用android studio调试时生成的代码:

public void changeStandbyString(String var1) {
        this.f();
        if(this.d()) {
            throw new IllegalStateException("setStandbyString is not supported.");
        } else if(var1 == null) {
            throw new IllegalArgumentException("the standby text passed is null.");
        } else if(var1.length() > 100) {
            throw new IllegalArgumentException("the standby text passed is longer than 100 characters.");
        } else {
            this.m = var1;
        }
    }

public boolean isFeatureEnabled(int var1) {
        if(this.a == null) {
            throw new IllegalStateException("initialize() is not Called first.");
        } else {
            switch(var1) {
            case 0:
                return this.a.a();
            case 1:
            case 2:
                return this.a.b();
            case 3:
                return this.a.c();
            case 4:
                return this.a.d();
            default:
                throw new IllegalArgumentException("type passed is not valid");
            }
        }
    }

请注意,方法d()是在两种情况下调用的方法,当您检查feature以查看是否启用以及何时更改文本时,看起来应该是if(!this.d())in changeStandbyString,就像在其他方法中那样:

public void setDialogTitle(String var1,int var2) {
        this.f();
        if(!this.b()) {
            throw new IllegalStateException("setDialogTitle is not supported.");
        } else if(var1 == null) {
            throw new IllegalArgumentException("the titletext passed is null.");
        } else if(var1.length() > 256) {
            throw new IllegalArgumentException("the title text passed is longer than 256 characters.");
        } else if(var2 >>> 24 != 0) {
            throw new IllegalArgumentException("alpha value is not supported in the titleColor.");
        } else {
            this.f = var1;
            this.g = var2 + -16777216;
        }
    }

抛出新的IllegalStateException(“不支持setDialogTitle.”);只有当this.b()返回false时才会发生,这是当标志为Spass.DEVICE_FINGERPRINT_CUSTOMIZED_DIALOG(Spass.DEVICE_FINGERPRINT_CUSTOMIZED_DIALOG = 2)时从isFeaturedEnabled调用的方法.

解决方法

编程指南doc是错误的.如果isFeatureEnabled(Spass.DEVICE_FINGERPRINT_AVAILABLE_PASSWORD)返回false,则可以激活此功能.您可以查看 code samples以了解如何使用此功能.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读