mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
ask for system unlock before accessing "password & account" (#2859)
* request lock-pattern to access "password and account" section --------- Co-authored-by: bjoern <r10s@b44t.com>
This commit is contained in:
committed by
GitHub
parent
9dfaa8fe33
commit
8092498da4
@@ -43,6 +43,7 @@ import org.thoughtcrime.securesms.profiles.AvatarHelper;
|
||||
import org.thoughtcrime.securesms.profiles.ProfileMediaConstraints;
|
||||
import org.thoughtcrime.securesms.scribbles.ScribbleActivity;
|
||||
import org.thoughtcrime.securesms.util.Prefs;
|
||||
import org.thoughtcrime.securesms.util.ScreenLockUtil;
|
||||
import org.thoughtcrime.securesms.util.ViewUtil;
|
||||
|
||||
import java.io.File;
|
||||
@@ -162,9 +163,18 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Emoj
|
||||
case Crop.REQUEST_CROP:
|
||||
setAvatarView(Crop.getOutput(data));
|
||||
break;
|
||||
|
||||
case ScreenLockUtil.REQUEST_CODE_CONFIRM_CREDENTIALS:
|
||||
openRegistrationActivity();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void openRegistrationActivity() {
|
||||
Intent intent = new Intent(this, RegistrationActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void setAvatarView(Uri output) {
|
||||
final ProfileMediaConstraints constraints = new ProfileMediaConstraints();
|
||||
GlideApp.with(this)
|
||||
@@ -208,8 +218,10 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Emoj
|
||||
this.statusView = ViewUtil.findById(this, R.id.status_text);
|
||||
|
||||
passwordAccountSettings.setOnClickListener(view -> {
|
||||
Intent intent = new Intent(this, RegistrationActivity.class);
|
||||
startActivity(intent);
|
||||
boolean result = ScreenLockUtil.applyScreenLock(this, getString(R.string.pref_password_and_account_settings), getString(R.string.enter_system_secret_to_continue), ScreenLockUtil.REQUEST_CODE_CONFIRM_CREDENTIALS);
|
||||
if (!result) {
|
||||
openRegistrationActivity();
|
||||
}
|
||||
});
|
||||
|
||||
if (fromWelcome) {
|
||||
|
||||
Reference in New Issue
Block a user