mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Migrate local account data into SignalStore.
This commit is contained in:
committed by
Cody Henthorne
parent
87f175a96b
commit
8aea20f147
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.thoughtcrime.securesms.AppCapabilities;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.whispersystems.signalservice.api.account.AccountAttributes;
|
||||
@@ -18,11 +19,11 @@ public final class LogSectionCapabilities implements LogSection {
|
||||
|
||||
@Override
|
||||
public @NonNull CharSequence getContent(@NonNull Context context) {
|
||||
if (!TextSecurePreferences.isPushRegistered(context)) {
|
||||
if (!SignalStore.account().isRegistered()) {
|
||||
return "Unregistered";
|
||||
}
|
||||
|
||||
if (TextSecurePreferences.getLocalNumber(context) == null || TextSecurePreferences.getLocalAci(context) == null) {
|
||||
if (SignalStore.account().getE164() == null || SignalStore.account().getAci() == null) {
|
||||
return "Self not yet available!";
|
||||
}
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ final class LogSectionKeyPreferences implements LogSection {
|
||||
.append("Prefer Contact Photos: ").append(SignalStore.settings().isPreferSystemContactPhotos()).append("\n")
|
||||
.append("Call Bandwidth Mode : ").append(SignalStore.settings().getCallBandwidthMode()).append("\n")
|
||||
.append("Client Deprecated : ").append(SignalStore.misc().isClientDeprecated()).append("\n")
|
||||
.append("Push Registered : ").append(TextSecurePreferences.isPushRegistered(context)).append("\n")
|
||||
.append("Push Registered : ").append(SignalStore.account().isRegistered()).append("\n")
|
||||
.append("Unauthorized Received: ").append(TextSecurePreferences.isUnauthorizedRecieved(context)).append("\n")
|
||||
.append("self.isRegistered() : ").append(TextSecurePreferences.getLocalAci(context) == null ? "false" : Recipient.self().isRegistered()).append("\n")
|
||||
.append("self.isRegistered() : ").append(SignalStore.account().getAci() == null ? "false" : Recipient.self().isRegistered()).append("\n")
|
||||
.append("Thread Trimming : ").append(getThreadTrimmingString()).append("\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -14,12 +14,12 @@ import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GoogleApiAvailability;
|
||||
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.emoji.EmojiFiles;
|
||||
import org.thoughtcrime.securesms.keyvalue.SignalStore;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.util.AppSignatureUtil;
|
||||
import org.thoughtcrime.securesms.util.ByteUnit;
|
||||
import org.thoughtcrime.securesms.util.CensorshipUtil;
|
||||
import org.thoughtcrime.securesms.util.DeviceProperties;
|
||||
import org.thoughtcrime.securesms.util.ScreenDensity;
|
||||
import org.thoughtcrime.securesms.util.ServiceUtil;
|
||||
@@ -31,7 +31,6 @@ import org.whispersystems.signalservice.api.push.ACI;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
|
||||
public class LogSectionSystemInfo implements LogSection {
|
||||
|
||||
@@ -63,9 +62,9 @@ public class LogSectionSystemInfo implements LogSection {
|
||||
builder.append("OS Host : ").append(Build.HOST).append("\n");
|
||||
builder.append("RecipientId : ").append(SignalStore.registrationValues().isRegistrationComplete() ? Recipient.self().getId() : "N/A").append("\n");
|
||||
builder.append("ACI : ").append(getCensoredAci(context)).append("\n");
|
||||
builder.append("Censored : ").append(CensorshipUtil.isCensored(context)).append("\n");
|
||||
builder.append("Censored : ").append(ApplicationDependencies.getSignalServiceNetworkAccess().isCensored()).append("\n");
|
||||
builder.append("Play Services : ").append(getPlayServicesString(context)).append("\n");
|
||||
builder.append("FCM : ").append(!TextSecurePreferences.isFcmDisabled(context)).append("\n");
|
||||
builder.append("FCM : ").append(SignalStore.account().isFcmEnabled()).append("\n");
|
||||
builder.append("BkgRestricted : ").append(Build.VERSION.SDK_INT >= 28 ? DeviceProperties.isBackgroundRestricted(context) : "N/A").append("\n");
|
||||
builder.append("Locale : ").append(Locale.getDefault().toString()).append("\n");
|
||||
builder.append("Linked Devices: ").append(TextSecurePreferences.isMultiDevice(context)).append("\n");
|
||||
@@ -165,7 +164,7 @@ public class LogSectionSystemInfo implements LogSection {
|
||||
}
|
||||
|
||||
private static String getCensoredAci(@NonNull Context context) {
|
||||
ACI aci = TextSecurePreferences.getLocalAci(context);
|
||||
ACI aci = SignalStore.account().getAci();
|
||||
|
||||
if (aci != null) {
|
||||
String aciString = aci.toString();
|
||||
|
||||
Reference in New Issue
Block a user