mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 12:49:55 +01:00
Blank UnlockActivity when not using fingerprint unlock
This commit is contained in:
@@ -29,6 +29,7 @@ import static android.hardware.biometrics.BiometricPrompt.BIOMETRIC_ERROR_LOCKOU
|
|||||||
import static android.hardware.biometrics.BiometricPrompt.BIOMETRIC_ERROR_LOCKOUT_PERMANENT;
|
import static android.hardware.biometrics.BiometricPrompt.BIOMETRIC_ERROR_LOCKOUT_PERMANENT;
|
||||||
import static android.hardware.biometrics.BiometricPrompt.BIOMETRIC_ERROR_USER_CANCELED;
|
import static android.hardware.biometrics.BiometricPrompt.BIOMETRIC_ERROR_USER_CANCELED;
|
||||||
import static android.os.Build.VERSION.SDK_INT;
|
import static android.os.Build.VERSION.SDK_INT;
|
||||||
|
import static android.view.View.INVISIBLE;
|
||||||
import static org.briarproject.briar.android.activity.RequestCodes.REQUEST_KEYGUARD_UNLOCK;
|
import static org.briarproject.briar.android.activity.RequestCodes.REQUEST_KEYGUARD_UNLOCK;
|
||||||
import static org.briarproject.briar.android.util.UiUtils.hasKeyguardLock;
|
import static org.briarproject.briar.android.util.UiUtils.hasKeyguardLock;
|
||||||
import static org.briarproject.briar.android.util.UiUtils.hasUsableFingerprint;
|
import static org.briarproject.briar.android.util.UiUtils.hasUsableFingerprint;
|
||||||
@@ -60,6 +61,12 @@ public class UnlockActivity extends BaseActivity {
|
|||||||
Button button = findViewById(R.id.unlock);
|
Button button = findViewById(R.id.unlock);
|
||||||
button.setOnClickListener(view -> requestUnlock());
|
button.setOnClickListener(view -> requestUnlock());
|
||||||
|
|
||||||
|
if (!hasUsableFingerprint(this)) {
|
||||||
|
getWindow().setBackgroundDrawable(null);
|
||||||
|
button.setVisibility(INVISIBLE);
|
||||||
|
findViewById(R.id.image).setVisibility(INVISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
keyguardShown = state != null && state.getBoolean(KEYGUARD_SHOWN);
|
keyguardShown = state != null && state.getBoolean(KEYGUARD_SHOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,14 +147,14 @@ public class UnlockActivity extends BaseActivity {
|
|||||||
errorCode == BIOMETRIC_ERROR_LOCKOUT_PERMANENT) {
|
errorCode == BIOMETRIC_ERROR_LOCKOUT_PERMANENT) {
|
||||||
if (hasKeyguardLock(UnlockActivity.this)) {
|
if (hasKeyguardLock(UnlockActivity.this)) {
|
||||||
requestKeyguardUnlock();
|
requestKeyguardUnlock();
|
||||||
} else {
|
} else if (errString != null) {
|
||||||
// normally fingerprints require a screen lock, but
|
// normally fingerprints require a screen lock, but
|
||||||
// who knows if that's true for all devices out there
|
// who knows if that's true for all devices out there
|
||||||
Toast.makeText(UnlockActivity.this, errString,
|
Toast.makeText(UnlockActivity.this, errString,
|
||||||
Toast.LENGTH_LONG).show();
|
Toast.LENGTH_LONG).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (errString != null) {
|
||||||
Toast.makeText(UnlockActivity.this, errString,
|
Toast.makeText(UnlockActivity.this, errString,
|
||||||
Toast.LENGTH_LONG).show();
|
Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user