mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Update registration to allow PIN entry.
This commit is contained in:
@@ -81,7 +81,8 @@ public class AvatarHelper {
|
||||
* Whether or not an avatar is present for the given recipient.
|
||||
*/
|
||||
public static boolean hasAvatar(@NonNull Context context, @NonNull RecipientId recipientId) {
|
||||
return getAvatarFile(context, recipientId).exists();
|
||||
File avatarFile = getAvatarFile(context, recipientId);
|
||||
return avatarFile.exists() && avatarFile.length() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,8 +34,7 @@ public final class ProfileName implements Parcelable {
|
||||
this(in.readString(), in.readString());
|
||||
}
|
||||
|
||||
public @NonNull
|
||||
String getGivenName() {
|
||||
public @NonNull String getGivenName() {
|
||||
return givenName;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,11 @@ package org.thoughtcrime.securesms.profiles.edit;
|
||||
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.navigation.NavGraph;
|
||||
import androidx.navigation.Navigation;
|
||||
|
||||
@@ -23,6 +26,12 @@ public class EditProfileActivity extends BaseActionBarActivity implements EditPr
|
||||
|
||||
private final DynamicTheme dynamicTheme = new DynamicRegistrationTheme();
|
||||
|
||||
public static @NonNull Intent getIntent(@NonNull Context context, boolean showToolbar) {
|
||||
Intent intent = new Intent(context, EditProfileActivity.class);
|
||||
intent.putExtra(EditProfileActivity.SHOW_TOOLBAR, showToolbar);
|
||||
return intent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle bundle) {
|
||||
super.onCreate(bundle);
|
||||
|
||||
@@ -45,6 +45,8 @@ import org.thoughtcrime.securesms.mms.GlideApp;
|
||||
import org.thoughtcrime.securesms.permissions.Permissions;
|
||||
import org.thoughtcrime.securesms.profiles.ProfileName;
|
||||
import org.thoughtcrime.securesms.providers.BlobProvider;
|
||||
import org.thoughtcrime.securesms.registration.RegistrationUtil;
|
||||
import org.thoughtcrime.securesms.storage.StorageSyncHelper;
|
||||
import org.thoughtcrime.securesms.util.FeatureFlags;
|
||||
import org.thoughtcrime.securesms.util.concurrent.SimpleTask;
|
||||
import org.thoughtcrime.securesms.util.text.AfterTextChanged;
|
||||
@@ -307,9 +309,7 @@ public class EditProfileFragment extends Fragment {
|
||||
private void handleUpload() {
|
||||
viewModel.submitProfile(uploadResult -> {
|
||||
if (uploadResult == EditProfileRepository.UploadResult.SUCCESS) {
|
||||
if (SignalStore.kbsValues().hasPin()) {
|
||||
SignalStore.registrationValues().setRegistrationComplete();
|
||||
}
|
||||
RegistrationUtil.markRegistrationPossiblyComplete();
|
||||
|
||||
ApplicationDependencies.getMegaphoneRepository().markFinished(Megaphones.Event.PROFILE_NAMES_FOR_ALL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user