mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Improve logging and the naming of some fields.
This commit is contained in:
@@ -212,13 +212,13 @@ public class CreateProfileFragment extends LoggingFragment {
|
||||
if (FeatureFlags.phoneNumberPrivacy()) {
|
||||
getParentFragmentManager().setFragmentResultListener(WhoCanFindMeByPhoneNumberFragment.REQUEST_KEY, getViewLifecycleOwner(), (requestKey, result) -> {
|
||||
if (WhoCanFindMeByPhoneNumberFragment.REQUEST_KEY.equals(requestKey)) {
|
||||
presentWhoCanFindMeDescription(SignalStore.phoneNumberPrivacy().getPhoneNumberListingMode());
|
||||
presentWhoCanFindMeDescription(SignalStore.phoneNumberPrivacy().getPhoneNumberDiscoverabilityMode());
|
||||
}
|
||||
});
|
||||
|
||||
binding.whoCanFindMeContainer.setVisibility(View.VISIBLE);
|
||||
binding.whoCanFindMeContainer.setOnClickListener(v -> SafeNavigation.safeNavigate(Navigation.findNavController(v), CreateProfileFragmentDirections.actionCreateProfileFragmentToPhoneNumberPrivacy()));
|
||||
presentWhoCanFindMeDescription(SignalStore.phoneNumberPrivacy().getPhoneNumberListingMode());
|
||||
presentWhoCanFindMeDescription(SignalStore.phoneNumberPrivacy().getPhoneNumberDiscoverabilityMode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,12 +285,12 @@ public class CreateProfileFragment extends LoggingFragment {
|
||||
}
|
||||
}
|
||||
|
||||
private void presentWhoCanFindMeDescription(PhoneNumberPrivacyValues.PhoneNumberListingMode phoneNumberListingMode) {
|
||||
private void presentWhoCanFindMeDescription(PhoneNumberPrivacyValues.PhoneNumberDiscoverabilityMode phoneNumberListingMode) {
|
||||
switch (phoneNumberListingMode) {
|
||||
case LISTED:
|
||||
case DISCOVERABLE:
|
||||
binding.whoCanFindMeDescription.setText(R.string.PhoneNumberPrivacy_everyone);
|
||||
break;
|
||||
case UNLISTED:
|
||||
case NOT_DISCOVERABLE:
|
||||
binding.whoCanFindMeDescription.setText(R.string.PhoneNumberPrivacy_nobody);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ import org.thoughtcrime.securesms.storage.StorageSyncHelper
|
||||
class WhoCanFindMeByPhoneNumberRepository {
|
||||
|
||||
fun getCurrentState(): WhoCanFindMeByPhoneNumberState {
|
||||
return when (SignalStore.phoneNumberPrivacy().phoneNumberListingMode) {
|
||||
PhoneNumberPrivacyValues.PhoneNumberListingMode.LISTED -> WhoCanFindMeByPhoneNumberState.EVERYONE
|
||||
PhoneNumberPrivacyValues.PhoneNumberListingMode.UNLISTED -> WhoCanFindMeByPhoneNumberState.NOBODY
|
||||
return when (SignalStore.phoneNumberPrivacy().phoneNumberDiscoverabilityMode) {
|
||||
PhoneNumberPrivacyValues.PhoneNumberDiscoverabilityMode.DISCOVERABLE -> WhoCanFindMeByPhoneNumberState.EVERYONE
|
||||
PhoneNumberPrivacyValues.PhoneNumberDiscoverabilityMode.NOT_DISCOVERABLE -> WhoCanFindMeByPhoneNumberState.NOBODY
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@ class WhoCanFindMeByPhoneNumberRepository {
|
||||
return Completable.fromAction {
|
||||
when (whoCanFindMeByPhoneNumberState) {
|
||||
WhoCanFindMeByPhoneNumberState.EVERYONE -> {
|
||||
SignalStore.phoneNumberPrivacy().phoneNumberListingMode = PhoneNumberPrivacyValues.PhoneNumberListingMode.LISTED
|
||||
SignalStore.phoneNumberPrivacy().phoneNumberDiscoverabilityMode = PhoneNumberPrivacyValues.PhoneNumberDiscoverabilityMode.DISCOVERABLE
|
||||
}
|
||||
WhoCanFindMeByPhoneNumberState.NOBODY -> {
|
||||
SignalStore.phoneNumberPrivacy().phoneNumberSharingMode = PhoneNumberPrivacyValues.PhoneNumberSharingMode.NOBODY
|
||||
SignalStore.phoneNumberPrivacy().phoneNumberListingMode = PhoneNumberPrivacyValues.PhoneNumberListingMode.UNLISTED
|
||||
SignalStore.phoneNumberPrivacy().phoneNumberDiscoverabilityMode = PhoneNumberPrivacyValues.PhoneNumberDiscoverabilityMode.NOT_DISCOVERABLE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user