我使用pass sdk v1.2.1,根據programming guide有一種方法來更改指紋對話框中顯示的備用文本。該指南說,你要檢查功能Spass.DEVICE_FINGERPRINT_AVAILABLE_PASSWORD
被允許調用changeStandbyString
,這樣的事情:三星通過sdk更改指紋對話框中的備用文本
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 5.XX的Android上使用它的Galaxy S5得到的異常
IllegalStateException: setStandbyString is not supported.
什麼它似乎有些奇怪的是,除了被調用,如果屬實內changeStandbyString
回報的方法,它原來是叫當您檢查同樣的方法
isFeatureEnabled(Spass.DEVICE_FINGERPRINT_AVAILABLE_PASSWORD);
所以看起來有點不對勁,有什麼想法?
這與Android工作室調試時生成的代碼:
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()
是一個叫兩個情況下,當您檢查的功能,看是否允許且當您更改文字,看起來應該是在changeStandbyString
if(!this.d())
,因爲它在其他國家做的方法,如:
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;
}
}
這裏throw new IllegalStateException("setDialogTitle is not supported.");
只發生,如果this.b()
返回false爲m當標誌爲Spass.DEVICE_FINGERPRINT_CUSTOMIZED_DIALOG
(Spass.DEVICE_FINGERPRINT_CUSTOMIZED_DIALOG = 2
)時,方法從isFeaturedEnabled
調用。